@activepieces/piece-sftp 0.5.8 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +62 -23
package/src/index.js CHANGED
@@ -1,26 +1,65 @@
1
- "use strict";var XE=Object.create;var bo=Object.defineProperty;var JE=Object.getOwnPropertyDescriptor;var eA=Object.getOwnPropertyNames;var tA=Object.getPrototypeOf,rA=Object.prototype.hasOwnProperty;var c=(t,e)=>bo(t,"name",{value:e,configurable:!0});var le=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},hd=(t,e)=>{for(var r in e)bo(t,r,{get:e[r],enumerable:!0})},gd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eA(e))!rA.call(t,i)&&i!==r&&bo(t,i,{get:()=>e[i],enumerable:!(n=JE(e,i))||n.enumerable});return t};var br=(t,e,r)=>(r=t!=null?XE(tA(t)):{},gd(e||!t||!t.__esModule?bo(r,"default",{value:t,enumerable:!0}):r,t)),nA=t=>gd(bo({},"__esModule",{value:!0}),t);var Mp=le((zp,na)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),o="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",a={zoneIndex:new RegExp(o,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${o})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${e}\\.${e}\\.${e}\\.${e}(${o})?$`,"i")};function u(h,_){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,E=-1,v=(h.match(a.zoneIndex)||[])[0],w,H;for(v&&(v=v.substring(1),h=h.replace(/%.+$/,""));(E=h.indexOf(":",E+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>_)return null;for(H=_-b,w=":";H--;)w+="0:";return h=h.replace("::",w),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),_=(function(){let D=h.split(":"),J=[];for(let Y=0;Y<D.length;Y++)J.push(parseInt(D[Y],16));return J})(),{parts:_,zoneId:v}}c(u,"expandIPv6");function l(h,_,b,E){if(h.length!==_.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,w;for(;E>0;){if(w=b-E,w<0&&(w=0),h[v]>>w!==_[v]>>w)return!1;E-=b,v+=1}return!0}c(l,"matchCIDR");function d(h){if(i.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}c(d,"parseIntAuto");function p(h,_){for(;h.length<_;)h=`0${h}`;return h}c(p,"padPart");let g={};g.IPv4=(function(){function h(_){if(_.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,E;for(b=0;b<_.length;b++)if(E=_[b],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=_}return c(h,"IPv4"),h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(_,b){let E;if(b===void 0&&(E=_,_=E[0],b=E[1]),_.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,_.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,b=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,w,H;for(v=3;v>=0;v-=1)if(w=this.octets[v],w in E){if(H=E[w],b&&H!==0)return null;H!==8&&(b=!0),_+=H}else return null;return 32-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return g.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h})(),g.IPv4.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),b=_[0].toByteArray(),E=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],w=0;for(;w<4;)v.push(parseInt(b[w],10)|parseInt(E[w],10)^255),w++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.isIPv4=function(h){return this.parser(h)!==null},g.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},g.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv4.isValidFourPartDecimal=function(h){return!!(g.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},g.IPv4.isValidCIDRFourPartDecimal=function(h){let _=h.match(/^(.+)\/(\d+)$/);return!g.IPv4.isValidCIDR(h)||!_?!1:g.IPv4.isValidFourPartDecimal(_[1])},g.IPv4.networkAddressFromCIDR=function(h){let _,b,E,v,w;try{for(_=this.parseCIDR(h),E=_[0].toByteArray(),w=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],b=0;b<4;)v.push(parseInt(E[b],10)&parseInt(w[b],10)),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.parse=function(h){let _=this.parser(h);if(_===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(_)},g.IPv4.parseCIDR=function(h){let _;if(_=h.match(/^(.+)\/(\d+)$/)){let b=parseInt(_[2]);if(b>=0&&b<=32){let E=[this.parse(_[1]),b];return Object.defineProperty(E,"toString",{value:c(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},g.IPv4.parser=function(h){let _,b,E;if(_=h.match(r.fourOctet))return(function(){let v=_.slice(1,6),w=[];for(let H=0;H<v.length;H++)b=v[H],w.push(d(b));return w})();if(_=h.match(r.longValue)){if(E=d(_[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],w;for(w=0;w<=24;w+=8)v.push(E>>w&255);return v})().reverse()}else return(_=h.match(r.twoOctet))?(function(){let v=_.slice(1,4),w=[];if(E=d(v[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return w.push(d(v[0])),w.push(E>>16&255),w.push(E>>8&255),w.push(E&255),w})():(_=h.match(r.threeOctet))?(function(){let v=_.slice(1,5),w=[];if(E=d(v[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return w.push(d(v[0])),w.push(d(v[1])),w.push(E>>8&255),w.push(E&255),w})():null},g.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let _=[0,0,0,0],b=0,E=Math.floor(h/8);for(;b<E;)_[b]=255,b++;return E<4&&(_[E]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.IPv6=(function(){function h(_,b){let E,v;if(_.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(_[E]<<8|_[E+1]);else if(_.length===8)this.parts=_;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(v=this.parts[E],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return c(h,"IPv6"),h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(_,b){let E;if(b===void 0&&(E=_,_=E[0],b=E[1]),_.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,_.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,b=!1,E={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,w;for(let H=7;H>=0;H-=1)if(v=this.parts[H],v in E){if(w=E[v],b&&w!==0)return null;w!==16&&(b=!0),_+=w}else return null;return 128-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let _,b=[],E=this.parts;for(let v=0;v<E.length;v++)_=E[v],b.push(_>>8),b.push(_&255);return b},h.prototype.toFixedLengthString=function(){let _=(function(){let E=[];for(let v=0;v<this.parts.length;v++)E.push(p(this.parts[v].toString(16),4));return E}).call(this).join(":"),b="";return this.zoneId&&(b=`%${this.zoneId}`),_+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let _=this.parts.slice(-2),b=_[0],E=_[1];return new g.IPv4([b>>8,b&255,E>>8,E&255])},h.prototype.toNormalizedString=function(){let _=(function(){let E=[];for(let v=0;v<this.parts.length;v++)E.push(this.parts[v].toString(16));return E}).call(this).join(":"),b="";return this.zoneId&&(b=`%${this.zoneId}`),_+b},h.prototype.toRFC5952String=function(){let _=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString(),E=0,v=-1,w;for(;w=_.exec(b);)w[0].length>v&&(E=w.index,v=w[0].length);return v<0?b:`${b.substring(0,E)}::${b.substring(E+v)}`},h.prototype.toString=function(){return this.toRFC5952String()},h})(),g.IPv6.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),b=_[0].toByteArray(),E=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],w=0;for(;w<16;)v.push(parseInt(b[w],10)|parseInt(E[w],10)^255),w++;return new this(v)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},g.IPv6.isIPv6=function(h){return this.parser(h)!==null},g.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let _=this.parser(h);return new this(_.parts,_.zoneId),!0}catch{return!1}},g.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv6.networkAddressFromCIDR=function(h){let _,b,E,v,w;try{for(_=this.parseCIDR(h),E=_[0].toByteArray(),w=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],b=0;b<16;)v.push(parseInt(E[b],10)&parseInt(w[b],10)),b++;return new this(v)}catch(H){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${H})`)}},g.IPv6.parse=function(h){let _=this.parser(h);if(_.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(_.parts,_.zoneId)},g.IPv6.parseCIDR=function(h){let _,b,E;if((b=h.match(/^(.+)\/(\d+)$/))&&(_=parseInt(b[2]),_>=0&&_<=128))return E=[this.parse(b[1]),_],Object.defineProperty(E,"toString",{value:c(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},g.IPv6.parser=function(h){let _,b,E,v,w,H;if(E=h.match(a.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(a.native.test(h))return u(h,8);if((E=h.match(a.transitional))&&(H=E[6]||"",_=E[1],E[1].endsWith("::")||(_=_.slice(0,-1)),_=u(_+H,6),_.parts)){for(w=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],b=0;b<w.length;b++)if(v=w[b],!(0<=v&&v<=255))return null;return _.parts.push(w[0]<<8|w[1]),_.parts.push(w[2]<<8|w[3]),{parts:_.parts,zoneId:_.zoneId}}return null},g.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0,E=Math.floor(h/8);for(;b<E;)_[b]=255,b++;return E<16&&(_[E]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.fromByteArray=function(h){let _=h.length;if(_===4)return new g.IPv4(h);if(_===16)return new g.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},g.isValid=function(h){return g.IPv6.isValid(h)||g.IPv4.isValid(h)},g.isValidCIDR=function(h){return g.IPv6.isValidCIDR(h)||g.IPv4.isValidCIDR(h)},g.parse=function(h){if(g.IPv6.isValid(h))return g.IPv6.parse(h);if(g.IPv4.isValid(h))return g.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},g.parseCIDR=function(h){try{return g.IPv6.parseCIDR(h)}catch{try{return g.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},g.process=function(h){let _=this.parse(h);return _.kind()==="ipv6"&&_.isIPv4MappedAddress()?_.toIPv4Address():_},g.subnetMatch=function(h,_,b){let E,v,w,H;b==null&&(b="unicast");for(v in _)if(Object.prototype.hasOwnProperty.call(_,v)){for(w=_[v],w[0]&&!(w[0]instanceof Array)&&(w=[w]),E=0;E<w.length;E++)if(H=w[E],h.kind()===H[0].kind()&&h.match.apply(h,H))return v}return b},typeof na<"u"&&na.exports?na.exports=g:t.ipaddr=g})(zp)});var oa=le(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.parseControlResponse=Lb;ii.isSingleLine=zh;ii.isMultiline=Mh;ii.positiveCompletion=zb;ii.positiveIntermediate=Mb;var _u=`
2
- `;function Lb(t){let e=t.split(/\r?\n/).filter(Fb),r=[],n=0,i;for(let s=0;s<e.length;s++){let a=e[s];if(i)i.test(a)&&(i=void 0,r.push(e.slice(n,s+1).join(_u)));else if(Mh(a)){let u=a.substr(0,3);i=new RegExp(`^${u}(?:$| )`),n=s}else zh(a)&&r.push(a)}let o=i?e.slice(n).join(_u)+_u:"";return{messages:r,rest:o}}c(Lb,"parseControlResponse");function zh(t){return/^\d\d\d(?:$| )/.test(t)}c(zh,"isSingleLine");function Mh(t){return/^\d\d\d-/.test(t)}c(Mh,"isMultiline");function zb(t){return t>=200&&t<300}c(zb,"positiveCompletion");function Mb(t){return t>=300&&t<400}c(Mb,"positiveIntermediate");function Fb(t){return t.trim()!==""}c(Fb,"isNotBlank")});var Eu=le(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.FTPContext=Di.FTPError=void 0;var Hb=require("net"),jb=oa(),sa=class extends Error{static{c(this,"FTPError")}constructor(e){super(e.message),this.name=this.constructor.name,this.code=e.code}};Di.FTPError=sa;function Fh(){}c(Fh,"doNothing");var Wb=2**16,yu=class{static{c(this,"FTPContext")}constructor(e=0,r="utf8"){this.timeout=e,this.verbose=!1,this.ipFamily=void 0,this.tlsOptions={},this._partialResponse="",this._encoding=r,this._socket=this.socket=this._newSocket(),this._dataSocket=void 0}close(){let e=this._task?"User closed client during task":"User closed client",r=new Error(e);this.closeWithError(r)}closeWithError(e){this._closingError||(this._closingError=e,this._closeControlSocket(),this._closeSocket(this._dataSocket),this._passToHandler(e),this._stopTrackingTask())}get closed(){return this.socket.remoteAddress===void 0||this._closingError!==void 0}reset(){this.socket=this._newSocket()}get socket(){return this._socket}set socket(e){this.dataSocket=void 0,this.tlsOptions={},this._partialResponse="",this._socket&&(e.localPort===this._socket.localPort?this._removeSocketListeners(this.socket):this._closeControlSocket()),e&&(this._closingError=void 0,e.setTimeout(0),e.setEncoding(this._encoding),e.setKeepAlive(!0),e.on("data",r=>this._onControlSocketData(r)),e.on("end",()=>this.closeWithError(new Error("Server sent FIN packet unexpectedly, closing connection."))),e.on("close",r=>{r||this.closeWithError(new Error("Server closed connection unexpectedly."))}),this._setupDefaultErrorHandlers(e,"control socket")),this._socket=e}get dataSocket(){return this._dataSocket}set dataSocket(e){this._closeSocket(this._dataSocket),e&&(e.setTimeout(0),this._setupDefaultErrorHandlers(e,"data socket")),this._dataSocket=e}get encoding(){return this._encoding}set encoding(e){this._encoding=e,this.socket&&this.socket.setEncoding(e)}send(e){if(/[\r\n\0]/.test(e))throw new Error(`Invalid command: Contains control characters. (${e})`);let n=e.startsWith("PASS")?"> PASS ###":`> ${e}`;this.log(n),this._socket.write(e+`\r
3
- `,this.encoding)}request(e){return this.handle(e,(r,n)=>{r instanceof Error?n.reject(r):n.resolve(r)})}handle(e,r){if(this._task){let n=new Error("User launched a task while another one is still running. Forgot to use 'await' or '.then()'?");n.stack+=`
4
- Running task launched at: ${this._task.stack}`,this.closeWithError(n)}return new Promise((n,i)=>{if(this._task={stack:new Error().stack||"Unknown call stack",responseHandler:r,resolver:{resolve:c(o=>{this._stopTrackingTask(),n(o)},"resolve"),reject:c(o=>{this._stopTrackingTask(),i(o)},"reject")}},this._closingError){let o=new Error(`Client is closed because ${this._closingError.message}`);o.stack+=`
5
- Closing reason: ${this._closingError.stack}`,o.code=this._closingError.code!==void 0?this._closingError.code:"0",this._passToHandler(o);return}this.socket.setTimeout(this.timeout),e&&this.send(e)})}log(e){this.verbose&&console.log(e)}get hasTLS(){return"encrypted"in this._socket}_stopTrackingTask(){this.socket.setTimeout(0),this._task=void 0}_onControlSocketData(e){if(this.log(`< ${e}`),this._partialResponse.length+e.length>Wb){this.closeWithError(new Error("FTP control response exceeded maximum allowed size"));return}let r=this._partialResponse+e,n=(0,jb.parseControlResponse)(r);this._partialResponse=n.rest;for(let i of n.messages){let o=parseInt(i.substr(0,3),10),s={code:o,message:i},a=o>=400?new sa(s):void 0;this._passToHandler(a||s)}}_passToHandler(e){this._task&&this._task.responseHandler(e,this._task.resolver)}_setupDefaultErrorHandlers(e,r){e.once("error",n=>{n.message+=` (${r})`,this.closeWithError(n)}),e.once("close",n=>{n&&this.closeWithError(new Error(`Socket closed due to transmission error (${r})`))}),e.once("timeout",()=>{e.destroy(),this.closeWithError(new Error(`Timeout (${r})`))})}_closeControlSocket(){this._removeSocketListeners(this._socket),this._socket.on("error",Fh),this.send("QUIT"),this._closeSocket(this._socket)}_closeSocket(e){e&&(this._removeSocketListeners(e),e.on("error",Fh),e.destroy())}_removeSocketListeners(e){e.removeAllListeners(),e.removeAllListeners("timeout"),e.removeAllListeners("data"),e.removeAllListeners("end"),e.removeAllListeners("error"),e.removeAllListeners("close"),e.removeAllListeners("connect")}_newSocket(){return new Hb.Socket}};Di.FTPContext=yu});var Au=le(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.describeTLS=qb;Bi.describeAddress=Qb;Bi.upgradeSocket=Vb;Bi.ipIsPrivateV4Address=Kb;var Hh=require("tls");function qb(t){if(t instanceof Hh.TLSSocket){let e=t.getProtocol();return e||"Server socket or disconnected client socket"}return"No encryption"}c(qb,"describeTLS");function Qb(t){return t.remoteFamily==="IPv6"?`[${t.remoteAddress}]:${t.remotePort}`:`${t.remoteAddress}:${t.remotePort}`}c(Qb,"describeAddress");function Vb(t,e){return new Promise((r,n)=>{let i=Object.assign({},e,{socket:t}),o=(0,Hh.connect)(i,()=>{i.rejectUnauthorized!==!1&&!o.authorized?n(o.authorizationError):(o.removeAllListeners("error"),r(o))}).once("error",s=>{n(s)})})}c(Vb,"upgradeSocket");function Kb(t=""){t.startsWith("::ffff:")&&(t=t.substr(7));let e=t.split(".").map(r=>parseInt(r,10));return e[0]===10||e[0]===172&&e[1]>=16&&e[1]<=31||e[0]===192&&e[1]===168||t==="127.0.0.1"}c(Kb,"ipIsPrivateV4Address")});var Fo=le(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.FileInfo=Li.FileType=void 0;var Ui;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=3]="SymbolicLink"})(Ui||(Li.FileType=Ui={}));var aa=class{static{c(this,"FileInfo")}constructor(e){this.name=e,this.type=Ui.Unknown,this.size=0,this.rawModifiedAt="",this.modifiedAt=void 0,this.permissions=void 0,this.hardLinkCount=void 0,this.link=void 0,this.group=void 0,this.user=void 0,this.uniqueID=void 0,this.name=e}get isDirectory(){return this.type===Ui.Directory}get isSymbolicLink(){return this.type===Ui.SymbolicLink}get isFile(){return this.type===Ui.File}get date(){return this.rawModifiedAt}set date(e){this.rawModifiedAt=e}};Li.FileInfo=aa;aa.UnixPermission={Read:4,Write:2,Execute:1}});var Wh=le(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.testLine=Gb;Ho.parseLine=Zb;Ho.transformList=Yb;var bu=Fo(),jh=new RegExp("(\\S+)\\s+(\\S+)\\s+(?:(<DIR>)|([0-9]+))\\s+(\\S.*)");function Gb(t){return/^\d{2}/.test(t)&&jh.test(t)}c(Gb,"testLine");function Zb(t){let e=t.match(jh);if(e===null)return;let r=e[5];if(r==="."||r==="..")return;let n=new bu.FileInfo(r);return e[3]==="<DIR>"?(n.type=bu.FileType.Directory,n.size=0):(n.type=bu.FileType.File,n.size=parseInt(e[4],10)),n.rawModifiedAt=e[1]+" "+e[2],n}c(Zb,"parseLine");function Yb(t){return t}c(Yb,"transformList")});var Qh=le(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.testLine=tx;jo.parseLine=rx;jo.transformList=nx;var tn=Fo(),Xb="\u6708",Jb="\u65E5",ex="\u5E74",qh=new RegExp("([bcdelfmpSs-])(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]?)))\\+?\\s*(\\d+)\\s+(?:(\\S+(?:\\s\\S+)*?)\\s+)?(?:(\\S+(?:\\s\\S+)*)\\s+)?(\\d+(?:,\\s*\\d+)?)\\s+((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3})|(?:\\d{1,2}"+Xb+"\\s+\\d{1,2}"+Jb+"))\\s+((?:\\d+(?::\\d+)?)|(?:\\d{4}"+ex+"))\\s(.*)");function tx(t){return qh.test(t)}c(tx,"testLine");function rx(t){let e=t.match(qh);if(e===null)return;let r=e[21];if(r==="."||r==="..")return;let n=new tn.FileInfo(r);switch(n.size=parseInt(e[18],10),n.user=e[16],n.group=e[17],n.hardLinkCount=parseInt(e[15],10),n.rawModifiedAt=e[19]+" "+e[20],n.permissions={user:xu(e[4],e[5],e[6]),group:xu(e[8],e[9],e[10]),world:xu(e[12],e[13],e[14])},e[1].charAt(0)){case"d":n.type=tn.FileType.Directory;break;case"e":n.type=tn.FileType.SymbolicLink;break;case"l":n.type=tn.FileType.SymbolicLink;break;case"b":case"c":n.type=tn.FileType.File;break;case"f":case"-":n.type=tn.FileType.File;break;default:n.type=tn.FileType.Unknown}if(n.isSymbolicLink){let i=r.indexOf(" -> ");i!==-1&&(n.name=r.substring(0,i),n.link=r.substring(i+4))}return n}c(rx,"parseLine");function nx(t){return t}c(nx,"transformList");function xu(t,e,r){let n=0;t!=="-"&&(n+=tn.FileInfo.UnixPermission.Read),e!=="-"&&(n+=tn.FileInfo.UnixPermission.Write);let i=r.charAt(0);return i!=="-"&&i.toUpperCase()!==i&&(n+=tn.FileInfo.UnixPermission.Execute),n}c(xu,"parseMode")});var Iu=le(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.testLine=ox;Mi.parseLine=sx;Mi.transformList=ax;Mi.parseMLSxDate=Gh;var zi=Fo();function Vh(t,e){e.size=parseInt(t,10)}c(Vh,"parseSize");var ix={size:Vh,sizd:Vh,unique:c((t,e)=>{e.uniqueID=t},"unique"),modify:c((t,e)=>{e.modifiedAt=Gh(t),e.rawModifiedAt=e.modifiedAt.toISOString()},"modify"),type:c((t,e)=>{if(t.startsWith("OS.unix=slink"))return e.type=zi.FileType.SymbolicLink,e.link=t.substr(t.indexOf(":")+1),1;switch(t){case"file":e.type=zi.FileType.File;break;case"dir":e.type=zi.FileType.Directory;break;case"OS.unix=symlink":e.type=zi.FileType.SymbolicLink;break;case"cdir":case"pdir":return 2;default:e.type=zi.FileType.Unknown}return 1},"type"),"unix.mode":c((t,e)=>{let r=t.substr(-3);e.permissions={user:parseInt(r[0],10),group:parseInt(r[1],10),world:parseInt(r[2],10)}},"unix.mode"),"unix.ownername":c((t,e)=>{e.user=t},"unix.ownername"),"unix.owner":c((t,e)=>{e.user===void 0&&(e.user=t)},"unix.owner"),get"unix.uid"(){return this["unix.owner"]},"unix.groupname":c((t,e)=>{e.group=t},"unix.groupname"),"unix.group":c((t,e)=>{e.group===void 0&&(e.group=t)},"unix.group"),get"unix.gid"(){return this["unix.group"]}};function Kh(t,e){let r=t.indexOf(e),n=t.substr(0,r),i=t.substr(r+e.length);return[n,i]}c(Kh,"splitStringOnce");function ox(t){return/^\S+=\S+;/.test(t)||t.startsWith(" ")}c(ox,"testLine");function sx(t){let[e,r]=Kh(t," ");if(r===""||r==="."||r==="..")return;let n=new zi.FileInfo(r),i=e.split(";");for(let o of i){let[s,a]=Kh(o,"=");if(!a)continue;let u=ix[s.toLowerCase()];if(!u)continue;if(u(a,n)===2)return}return n}c(sx,"parseLine");function ax(t){let e=new Map;for(let n of t)!n.isSymbolicLink&&n.uniqueID!==void 0&&e.set(n.uniqueID,n);let r=[];for(let n of t){if(n.isSymbolicLink&&n.uniqueID!==void 0&&n.link===void 0){let o=e.get(n.uniqueID);o!==void 0&&(n.link=o.name)}!n.name.includes("/")&&r.push(n)}return r}c(ax,"transformList");function Gh(t){return new Date(Date.UTC(+t.slice(0,4),+t.slice(4,6)-1,+t.slice(6,8),+t.slice(8,10),+t.slice(10,12),+t.slice(12,14),+t.slice(15,18)))}c(Gh,"parseMLSxDate")});var Su=le(_n=>{"use strict";var cx=_n&&_n.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:c(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ux=_n&&_n.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vu=_n&&_n.__importStar||(function(){var t=c(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&cx(r,e,n[i]);return ux(r,e),r}})();Object.defineProperty(_n,"__esModule",{value:!0});_n.parseList=yx;var lx=vu(Wh()),fx=vu(Qh()),dx=vu(Iu()),px=[lx,fx,dx];function hx(t,e){return e.find(r=>r.testLine(t)===!0)}c(hx,"firstCompatibleParser");function gx(t){return t.trim()!==""}c(gx,"isNotBlank");function mx(t){return!t.startsWith("total")}c(mx,"isNotMeta");var _x=/\r?\n/;function yx(t){let e=t.split(_x).filter(gx).filter(mx);if(e.length===0)return[];let r=e[e.length-1],n=hx(r,px);if(!n)throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing. Your FTP server seems to be using another format. You can see the transmitted listing when setting `client.ftp.verbose = true`. You can then provide a custom parser to `client.parseList`, see the documentation for details.");let i=e.map(n.parseLine).filter(o=>o!==void 0);return n.transformList(i)}c(yx,"parseList")});var Zh=le(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.ProgressTracker=void 0;var wu=class{static{c(this,"ProgressTracker")}constructor(){this.bytesOverall=0,this.intervalMs=500,this.onStop=ca,this.onHandle=ca}reportTo(e=ca){this.onHandle=e}start(e,r,n){let i=0;this.onStop=Ex(this.intervalMs,()=>{let o=e.bytesRead+e.bytesWritten;this.bytesOverall+=o-i,i=o,this.onHandle({name:r,type:n,bytes:o,bytesOverall:this.bytesOverall})})}stop(){this.onStop(!1)}updateAndStop(){this.onStop(!0)}};ua.ProgressTracker=wu;function Ex(t,e){let r=setInterval(e,t),n=c(i=>{clearInterval(r),i&&e(),e=ca},"stopFunc");return e(),n}c(Ex,"poll");function ca(){}c(ca,"noop")});var Yh=le(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.StringWriter=void 0;var Ax=require("stream"),Pu=class extends Ax.Writable{static{c(this,"StringWriter")}constructor(e=1*1024*1024){super(),this.maxByteLength=e,this.byteLength=0,this.bufs=[]}_write(e,r,n){if(!(e instanceof Buffer)){n(new Error("StringWriter: expects chunks of type 'Buffer'."));return}if(this.byteLength+e.byteLength>this.maxByteLength){n(new Error(`StringWriter: Maximum bytes exceeded, maxByteLength=${this.maxByteLength}.`));return}this.byteLength+=e.byteLength,this.bufs.push(e),n(null)}getText(e){return Buffer.concat(this.bufs).toString(e)}};la.StringWriter=Pu});var Cu=le(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.enterPassiveModeIPv6=bx;rn.parseEpsvResponse=eg;rn.enterPassiveModeIPv4=xx;rn.enterPassiveModeIPv4_forceControlHostIP=Ix;rn.parsePasvResponse=Tu;rn.connectForPassiveTransfer=pa;rn.uploadFrom=vx;rn.downloadTo=Sx;var Fi=Au(),Jh=require("stream"),Xh=require("tls"),fa=oa();async function bx(t){let e=await t.request("EPSV"),r=eg(e.message);if(!r)throw new Error("Can't parse EPSV response: "+e.message);let n=t.socket.remoteAddress;if(n===void 0)throw new Error("Control socket is disconnected, can't get remote address.");return await pa(n,r,t),e}c(bx,"enterPassiveModeIPv6");function eg(t){let e=t.match(/[|!]{3}(.+)[|!]/);if(e===null||e[1]===void 0)throw new Error(`Can't parse response to 'EPSV': ${t}`);let r=parseInt(e[1],10);if(Number.isNaN(r))throw new Error(`Can't parse response to 'EPSV', port is not a number: ${t}`);return r}c(eg,"parseEpsvResponse");async function xx(t){let e=await t.request("PASV"),r=Tu(e.message);if(!r)throw new Error("Can't parse PASV response: "+e.message);let n=t.socket.remoteAddress;return(0,Fi.ipIsPrivateV4Address)(r.host)&&n&&!(0,Fi.ipIsPrivateV4Address)(n)&&(r.host=n),await pa(r.host,r.port,t),e}c(xx,"enterPassiveModeIPv4");async function Ix(t){let e=await t.request("PASV"),r=Tu(e.message);if(!r)throw new Error("Can't parse PASV response: "+e.message);let n=t.socket.remoteAddress;if(n===void 0)throw new Error("Control socket is disconnected, can't get remote address.");return await pa(n,r.port,t),e}c(Ix,"enterPassiveModeIPv4_forceControlHostIP");function Tu(t){let e=t.match(/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/);if(e===null||e.length!==4)throw new Error(`Can't parse response to 'PASV': ${t}`);return{host:e[1].replace(/,/g,"."),port:(parseInt(e[2],10)&255)*256+(parseInt(e[3],10)&255)}}c(Tu,"parsePasvResponse");function pa(t,e,r){return new Promise((n,i)=>{let o=r._newSocket(),s=c(function(u){u.message="Can't open data connection in passive mode: "+u.message,i(u)},"handleConnErr"),a=c(function(){o.destroy(),i(new Error(`Timeout when trying to open data connection to ${t}:${e}`))},"handleTimeout");o.setTimeout(r.timeout),o.on("error",s),o.on("timeout",a),o.connect({port:e,host:t,family:r.ipFamily},()=>{r.socket instanceof Xh.TLSSocket&&(o=(0,Xh.connect)(Object.assign({},r.tlsOptions,{socket:o,session:r.socket.getSession()}))),o.removeListener("error",s),o.removeListener("timeout",a),r.dataSocket=o,n()})})}c(pa,"connectForPassiveTransfer");var da=class{static{c(this,"TransferResolver")}constructor(e,r){this.ftp=e,this.progress=r,this.response=void 0,this.dataTransferDone=!1}onDataStart(e,r){if(this.ftp.dataSocket===void 0)throw new Error("Data transfer should start but there is no data connection.");this.ftp.socket.setTimeout(0),this.ftp.dataSocket.setTimeout(this.ftp.timeout),this.progress.start(this.ftp.dataSocket,e,r)}onDataDone(e){this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.ftp.dataSocket&&this.ftp.dataSocket.setTimeout(0),this.dataTransferDone=!0,this.tryResolve(e)}onControlDone(e,r){this.response=r,this.tryResolve(e)}onError(e,r){this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.ftp.dataSocket=void 0,e.reject(r)}onUnexpectedRequest(e){let r=new Error(`Unexpected FTP response is requesting an answer: ${e.message}`);this.ftp.closeWithError(r)}tryResolve(e){this.dataTransferDone&&this.response!==void 0&&(this.ftp.dataSocket=void 0,e.resolve(this.response))}};function vx(t,e){let r=new da(e.ftp,e.tracker),n=`${e.command} ${e.remotePath}`;return e.ftp.handle(n,(i,o)=>{if(i instanceof Error)r.onError(o,i);else if(i.code===150||i.code===125){let s=e.ftp.dataSocket;if(!s){r.onError(o,new Error("Upload should begin but no data connection is available."));return}let a="getCipher"in s?s.getCipher()!==void 0:!0;wx(a,s,"secureConnect",()=>{e.ftp.log(`Uploading to ${(0,Fi.describeAddress)(s)} (${(0,Fi.describeTLS)(s)})`),r.onDataStart(e.remotePath,e.type),(0,Jh.pipeline)(t,s,u=>{u?r.onError(o,u):r.onDataDone(o)})})}else(0,fa.positiveCompletion)(i.code)?r.onControlDone(o,i):(0,fa.positiveIntermediate)(i.code)&&r.onUnexpectedRequest(i)})}c(vx,"uploadFrom");function Sx(t,e){if(!e.ftp.dataSocket)throw new Error("Download will be initiated but no data connection is available.");let r=new da(e.ftp,e.tracker);return e.ftp.handle(e.command,(n,i)=>{if(n instanceof Error)r.onError(i,n);else if(n.code===150||n.code===125){let o=e.ftp.dataSocket;if(!o){r.onError(i,new Error("Download should begin but no data connection is available."));return}e.ftp.log(`Downloading from ${(0,Fi.describeAddress)(o)} (${(0,Fi.describeTLS)(o)})`),r.onDataStart(e.remotePath,e.type),(0,Jh.pipeline)(o,t,s=>{s?r.onError(i,s):r.onDataDone(i)})}else n.code===350?e.ftp.send("RETR "+e.remotePath):(0,fa.positiveCompletion)(n.code)?r.onControlDone(i,n):(0,fa.positiveIntermediate)(n.code)&&r.onUnexpectedRequest(n)})}c(Sx,"downloadTo");function wx(t,e,r,n){t===!0?n():e.once(r,()=>n())}c(wx,"onConditionOrEvent")});var og=le(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.Client=void 0;var Bn=require("fs"),ku=require("path"),Px=require("tls"),ji=require("util"),Wo=Eu(),oi=Au(),Ru=oa(),Tx=Su(),Cx=Iu(),kx=Zh(),Rx=Yh(),Hi=Cu(),Nx=(0,ji.promisify)(Bn.readdir),Ox=(0,ji.promisify)(Bn.mkdir),Nu=(0,ji.promisify)(Bn.stat),tg=(0,ji.promisify)(Bn.open),rg=(0,ji.promisify)(Bn.close),$x=(0,ji.promisify)(Bn.unlink),ng={allowSeparateTransferHost:!0,maxListingBytes:40*1024*1024},ig=c(()=>["LIST -a","LIST"],"LIST_COMMANDS_DEFAULT"),Dx=c(()=>["MLSD","LIST -a","LIST"],"LIST_COMMANDS_MLSD"),Ou=class{static{c(this,"Client")}constructor(e=3e4,r=ng){this.availableListCommands=ig();let n={...ng,...r};this.ftp=new Wo.FTPContext(e),this.prepareTransfer=this._enterFirstCompatibleMode([Hi.enterPassiveModeIPv6,n.allowSeparateTransferHost?Hi.enterPassiveModeIPv4:Hi.enterPassiveModeIPv4_forceControlHostIP]),this.options=n,this.parseList=Tx.parseList,this._progressTracker=new kx.ProgressTracker}close(){this.ftp.close(),this._progressTracker.stop()}get closed(){return this.ftp.closed}connect(e="localhost",r=21){return this.ftp.reset(),this.ftp.socket.connect({host:e,port:r,family:this.ftp.ipFamily},()=>this.ftp.log(`Connected to ${(0,oi.describeAddress)(this.ftp.socket)} (${(0,oi.describeTLS)(this.ftp.socket)})`)),this._handleConnectResponse()}connectImplicitTLS(e="localhost",r=21,n={}){return this.ftp.reset(),this.ftp.socket=(0,Px.connect)(r,e,n,()=>this.ftp.log(`Connected to ${(0,oi.describeAddress)(this.ftp.socket)} (${(0,oi.describeTLS)(this.ftp.socket)})`)),this.ftp.tlsOptions=n,this._handleConnectResponse()}_handleConnectResponse(){return this.ftp.handle(void 0,(e,r)=>{e instanceof Error?r.reject(e):(0,Ru.positiveCompletion)(e.code)?r.resolve(e):r.reject(new Wo.FTPError(e))})}send(e,r=!1){return r?(this.ftp.log("Deprecated call using send(command, flag) with boolean flag to ignore errors. Use sendIgnoringError(command)."),this.sendIgnoringError(e)):this.ftp.request(e)}sendIgnoringError(e){return this.ftp.handle(e,(r,n)=>{r instanceof Wo.FTPError?n.resolve({code:r.code,message:r.message}):r instanceof Error?n.reject(r):n.resolve(r)})}async useTLS(e={},r="AUTH TLS"){let n=await this.send(r);return this.ftp.socket=await(0,oi.upgradeSocket)(this.ftp.socket,e),this.ftp.tlsOptions=e,this.ftp.log(`Control socket is using: ${(0,oi.describeTLS)(this.ftp.socket)}`),n}login(e="anonymous",r="guest"){return this.ftp.log(`Login security: ${(0,oi.describeTLS)(this.ftp.socket)}`),this.ftp.handle("USER "+e,(n,i)=>{n instanceof Error?i.reject(n):(0,Ru.positiveCompletion)(n.code)?i.resolve(n):n.code===331?this.ftp.send("PASS "+r):i.reject(new Wo.FTPError(n))})}async useDefaultSettings(){let r=(await this.features()).has("MLST");this.availableListCommands=r?Dx():ig(),await this.send("TYPE I"),await this.sendIgnoringError("STRU F"),await this.sendIgnoringError("OPTS UTF8 ON"),r&&await this.sendIgnoringError("OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;"),this.ftp.hasTLS&&(await this.sendIgnoringError("PBSZ 0"),await this.sendIgnoringError("PROT P"))}async access(e={}){var r,n;let i=e.secure===!0,o=e.secure==="implicit",s;if(o?s=await this.connectImplicitTLS(e.host,e.port,e.secureOptions):s=await this.connect(e.host,e.port),i){let a=(r=e.secureOptions)!==null&&r!==void 0?r:{};a.host=(n=a.host)!==null&&n!==void 0?n:e.host,await this.useTLS(a)}return await this.sendIgnoringError("OPTS UTF8 ON"),await this.login(e.user,e.password),await this.useDefaultSettings(),s}async pwd(){let e=await this.send("PWD"),r=e.message.match(/"(.+)"/);if(r===null||r[1]===void 0)throw new Error(`Can't parse response to command 'PWD': ${e.message}`);return r[1]}async features(){let e=await this.sendIgnoringError("FEAT"),r=new Map;return e.code<400&&(0,Ru.isMultiline)(e.message)&&e.message.split(`
6
- `).slice(1,-1).forEach(n=>{let i=n.trim().split(" ");r.set(i[0],i[1]||"")}),r}async cd(e){let r=await this.protectWhitespace(e);return this.send("CWD "+r)}async cdup(){return this.send("CDUP")}async lastMod(e){let r=await this.protectWhitespace(e),i=(await this.send(`MDTM ${r}`)).message.slice(4);return(0,Cx.parseMLSxDate)(i)}async size(e){let n=`SIZE ${await this.protectWhitespace(e)}`,i=await this.send(n),o=parseInt(i.message.slice(4),10);if(Number.isNaN(o))throw new Error(`Can't parse response to command '${n}' as a numerical value: ${i.message}`);return o}async rename(e,r){let n=await this.protectWhitespace(e),i=await this.protectWhitespace(r);return await this.send("RNFR "+n),this.send("RNTO "+i)}async remove(e,r=!1){let n=await this.protectWhitespace(e);return r?this.sendIgnoringError(`DELE ${n}`):this.send(`DELE ${n}`)}trackProgress(e){this._progressTracker.bytesOverall=0,this._progressTracker.reportTo(e)}async uploadFrom(e,r,n={}){return this._uploadWithCommand(e,r,"STOR",n)}async appendFrom(e,r,n={}){return this._uploadWithCommand(e,r,"APPE",n)}async _uploadWithCommand(e,r,n,i){return typeof e=="string"?this._uploadLocalFile(e,r,n,i):this._uploadFromStream(e,r,n)}async _uploadLocalFile(e,r,n,i){let o=await tg(e,"r"),s=(0,Bn.createReadStream)("",{fd:o,start:i.localStart,end:i.localEndInclusive,autoClose:!1});try{return await this._uploadFromStream(s,r,n)}finally{await qo(()=>rg(o))}}async _uploadFromStream(e,r,n){let i=c(o=>this.ftp.closeWithError(o),"onError");e.once("error",i);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,Hi.uploadFrom)(e,{ftp:this.ftp,tracker:this._progressTracker,command:n,remotePath:o,type:"upload"})}finally{e.removeListener("error",i)}}async downloadTo(e,r,n=0){return typeof e=="string"?this._downloadToFile(e,r,n):this._downloadToStream(e,r,n)}async _downloadToFile(e,r,n){let i=n>0,s=await tg(e,i?"r+":"w"),a=(0,Bn.createWriteStream)("",{fd:s,start:n,autoClose:!1});try{return await this._downloadToStream(a,r,n)}catch(u){let l=await qo(()=>Nu(e)),d=l&&l.size>0;throw!i&&!d&&await qo(()=>$x(e)),u}finally{await qo(()=>rg(s))}}async _downloadToStream(e,r,n){let i=c(o=>this.ftp.closeWithError(o),"onError");e.once("error",i);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,Hi.downloadTo)(e,{ftp:this.ftp,tracker:this._progressTracker,command:n>0?`REST ${n}`:`RETR ${o}`,remotePath:o,type:"download"})}finally{e.removeListener("error",i),e.end()}}async list(e=""){let r=await this.protectWhitespace(e),n;for(let i of this.availableListCommands){let o=r===""?i:`${i} ${r}`;await this.prepareTransfer(this.ftp);try{let s=await this._requestListWithCommand(o);return this.availableListCommands=[i],s}catch(s){if(!(s instanceof Wo.FTPError))throw s;n=s}}throw n}async _requestListWithCommand(e){let r=new Rx.StringWriter(this.options.maxListingBytes);await(0,Hi.downloadTo)(r,{ftp:this.ftp,tracker:this._progressTracker,command:e,remotePath:"",type:"list"});let n=r.getText(this.ftp.encoding);return this.ftp.log(n),this.parseList(n)}async removeDir(e){return this._exitAtCurrentDirectory(async()=>{await this.cd(e);let r=await this.pwd();await this.clearWorkingDir(),r==="/"||(await this.cdup(),await this.removeEmptyDir(r))})}async clearWorkingDir(){for(let e of await this.list())e.isDirectory?(await this.cd(e.name),await this.clearWorkingDir(),await this.cdup(),await this.removeEmptyDir(e.name)):await this.remove(e.name)}async uploadFromDir(e,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.ensureDir(r),await this._uploadToWorkingDir(e)))}async _uploadToWorkingDir(e){let r=await Nx(e);for(let n of r){let i=(0,ku.join)(e,n),o=await Nu(i);o.isFile()?await this.uploadFrom(i,n):o.isDirectory()&&(await this._openDir(n),await this._uploadToWorkingDir(i),await this.cdup())}}async downloadToDir(e,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.cd(r),await this._downloadFromWorkingDir(e)))}async _downloadFromWorkingDir(e){await Bx(e);for(let r of await this.list()){if(!r.name||(0,ku.basename)(r.name)!==r.name){let o=JSON.stringify(r.name);this.ftp.log(`Invalid filename from server listing, will skip file. (${o})`);continue}let i=(0,ku.join)(e,r.name);r.isDirectory?(await this.cd(r.name),await this._downloadFromWorkingDir(i),await this.cdup()):r.isFile&&await this.downloadTo(i,r.name)}}async ensureDir(e){e.startsWith("/")&&await this.cd("/");let r=e.split("/").filter(n=>n!=="");for(let n of r)await this._openDir(n)}async _openDir(e){await this.sendIgnoringError("MKD "+e),await this.cd(e)}async removeEmptyDir(e){let r=await this.protectWhitespace(e);return this.send(`RMD ${r}`)}async protectWhitespace(e){if(!e.startsWith(" "))return e;let r=await this.pwd();return(r.endsWith("/")?r:r+"/")+e}async _exitAtCurrentDirectory(e){let r=await this.pwd();try{return await e()}finally{this.closed||await qo(()=>this.cd(r))}}_enterFirstCompatibleMode(e){return async r=>{r.log("Trying to find optimal transfer strategy...");let n;for(let i of e)try{let o=await i(r);return r.log("Optimal transfer strategy found."),this.prepareTransfer=i,o}catch(o){n=o}throw new Error(`None of the available transfer strategies work. Last error response was '${n}'.`)}}async upload(e,r,n={}){return this.ftp.log("Warning: upload() has been deprecated, use uploadFrom()."),this.uploadFrom(e,r,n)}async append(e,r,n={}){return this.ftp.log("Warning: append() has been deprecated, use appendFrom()."),this.appendFrom(e,r,n)}async download(e,r,n=0){return this.ftp.log("Warning: download() has been deprecated, use downloadTo()."),this.downloadTo(e,r,n)}async uploadDir(e,r){return this.ftp.log("Warning: uploadDir() has been deprecated, use uploadFromDir()."),this.uploadFromDir(e,r)}async downloadDir(e){return this.ftp.log("Warning: downloadDir() has been deprecated, use downloadToDir()."),this.downloadToDir(e)}};ha.Client=Ou;async function Bx(t){try{await Nu(t)}catch{await Ox(t,{recursive:!0})}}c(Bx,"ensureLocalDirectory");async function qo(t){try{return await t()}catch{return}}c(qo,"ignoreError")});var ag=le(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0})});var nn=le(xr=>{"use strict";var Ux=xr&&xr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:c(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qo=xr&&xr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ux(e,t,r)};Object.defineProperty(xr,"__esModule",{value:!0});xr.enterPassiveModeIPv6=xr.enterPassiveModeIPv4=void 0;Qo(og(),xr);Qo(Eu(),xr);Qo(Fo(),xr);Qo(Su(),xr);Qo(ag(),xr);var cg=Cu();Object.defineProperty(xr,"enterPassiveModeIPv4",{enumerable:!0,get:c(function(){return cg.enterPassiveModeIPv4},"get")});Object.defineProperty(xr,"enterPassiveModeIPv6",{enumerable:!0,get:c(function(){return cg.enterPassiveModeIPv6},"get")})});var ga=le((uF,ug)=>{ug.exports={newInvalidAsn1Error:c(function(t){var e=new Error;return e.name="InvalidAsn1Error",e.message=t||"",e},"newInvalidAsn1Error")}});var ma=le((fF,lg)=>{lg.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}});var $u=le((dF,fg)=>{"use strict";var _a=require("buffer"),Wi=_a.Buffer,zr={},Mr;for(Mr in _a)_a.hasOwnProperty(Mr)&&(Mr==="SlowBuffer"||Mr==="Buffer"||(zr[Mr]=_a[Mr]));var qi=zr.Buffer={};for(Mr in Wi)Wi.hasOwnProperty(Mr)&&(Mr==="allocUnsafe"||Mr==="allocUnsafeSlow"||(qi[Mr]=Wi[Mr]));zr.Buffer.prototype=Wi.prototype;(!qi.from||qi.from===Uint8Array.from)&&(qi.from=function(t,e,r){if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&typeof t.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return Wi(t,e,r)});qi.alloc||(qi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=Wi(t);return!e||e.length===0?n.fill(0):typeof r=="string"?n.fill(e,r):n.fill(e),n});if(!zr.kStringMaxLength)try{zr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}zr.constants||(zr.constants={MAX_LENGTH:zr.kMaxLength},zr.kStringMaxLength&&(zr.constants.MAX_STRING_LENGTH=zr.kStringMaxLength));fg.exports=zr});var hg=le((pF,pg)=>{var Lx=require("assert"),dg=$u().Buffer,Vo=ma(),zx=ga(),Qi=zx.newInvalidAsn1Error;function Ir(t){if(!t||!dg.isBuffer(t))throw new TypeError("data must be a node Buffer");this._buf=t,this._size=t.length,this._len=0,this._offset=0}c(Ir,"Reader");Object.defineProperty(Ir.prototype,"length",{enumerable:!0,get:c(function(){return this._len},"get")});Object.defineProperty(Ir.prototype,"offset",{enumerable:!0,get:c(function(){return this._offset},"get")});Object.defineProperty(Ir.prototype,"remain",{get:c(function(){return this._size-this._offset},"get")});Object.defineProperty(Ir.prototype,"buffer",{get:c(function(){return this._buf.slice(this._offset)},"get")});Ir.prototype.readByte=function(t){if(this._size-this._offset<1)return null;var e=this._buf[this._offset]&255;return t||(this._offset+=1),e};Ir.prototype.peek=function(){return this.readByte(!0)};Ir.prototype.readLength=function(t){if(t===void 0&&(t=this._offset),t>=this._size)return null;var e=this._buf[t++]&255;if(e===null)return null;if((e&128)===128){if(e&=127,e===0)throw Qi("Indefinite length not supported");if(e>4)throw Qi("encoding too long");if(this._size-t<e)return null;this._len=0;for(var r=0;r<e;r++)this._len=(this._len<<8)+(this._buf[t++]&255)}else this._len=e;return t};Ir.prototype.readSequence=function(t){var e=this.peek();if(e===null)return null;if(t!==void 0&&t!==e)throw Qi("Expected 0x"+t.toString(16)+": got 0x"+e.toString(16));var r=this.readLength(this._offset+1);return r===null?null:(this._offset=r,e)};Ir.prototype.readInt=function(){return this._readTag(Vo.Integer)};Ir.prototype.readBoolean=function(){return this._readTag(Vo.Boolean)!==0};Ir.prototype.readEnumeration=function(){return this._readTag(Vo.Enumeration)};Ir.prototype.readString=function(t,e){t||(t=Vo.OctetString);var r=this.peek();if(r===null)return null;if(r!==t)throw Qi("Expected 0x"+t.toString(16)+": got 0x"+r.toString(16));var n=this.readLength(this._offset+1);if(n===null||this.length>this._size-n)return null;if(this._offset=n,this.length===0)return e?dg.alloc(0):"";var i=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,e?i:i.toString("utf8")};Ir.prototype.readOID=function(t){t||(t=Vo.OID);var e=this.readString(t,!0);if(e===null)return null;for(var r=[],n=0,i=0;i<e.length;i++){var o=e[i]&255;n<<=7,n+=o&127,(o&128)===0&&(r.push(n),n=0)}return n=r.shift(),r.unshift(n%40),r.unshift(n/40>>0),r.join(".")};Ir.prototype._readTag=function(t){Lx.ok(t!==void 0);var e=this.peek();if(e===null)return null;if(e!==t)throw Qi("Expected 0x"+t.toString(16)+": got 0x"+e.toString(16));var r=this.readLength(this._offset+1);if(r===null)return null;if(this.length>4)throw Qi("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var n=this._buf[this._offset],i=0,o=0;o<this.length;o++)i<<=8,i|=this._buf[this._offset++]&255;return(n&128)===128&&o!==4&&(i-=1<<o*8),i>>0};pg.exports=Ir});var mg=le((gF,gg)=>{var Un=require("assert"),ya=$u().Buffer,Ln=ma(),Mx=ga(),Ea=Mx.newInvalidAsn1Error,Fx={size:1024,growthFactor:8};function Hx(t,e){Un.ok(t),Un.equal(typeof t,"object"),Un.ok(e),Un.equal(typeof e,"object");var r=Object.getOwnPropertyNames(t);return r.forEach(function(n){if(!e[n]){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i)}}),e}c(Hx,"merge");function yr(t){t=Hx(Fx,t||{}),this._buf=ya.alloc(t.size||1024),this._size=this._buf.length,this._offset=0,this._options=t,this._seq=[]}c(yr,"Writer");Object.defineProperty(yr.prototype,"buffer",{get:c(function(){if(this._seq.length)throw Ea(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)},"get")});yr.prototype.writeByte=function(t){if(typeof t!="number")throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=t};yr.prototype.writeInt=function(t,e){if(typeof t!="number")throw new TypeError("argument must be a Number");typeof e!="number"&&(e=Ln.Integer);for(var r=4;((t&4286578688)===0||(t&4286578688)===-8388608)&&r>1;)r--,t<<=8;if(r>4)throw Ea("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=e,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(t&4278190080)>>>24,t<<=8};yr.prototype.writeNull=function(){this.writeByte(Ln.Null),this.writeByte(0)};yr.prototype.writeEnumeration=function(t,e){if(typeof t!="number")throw new TypeError("argument must be a Number");return typeof e!="number"&&(e=Ln.Enumeration),this.writeInt(t,e)};yr.prototype.writeBoolean=function(t,e){if(typeof t!="boolean")throw new TypeError("argument must be a Boolean");typeof e!="number"&&(e=Ln.Boolean),this._ensure(3),this._buf[this._offset++]=e,this._buf[this._offset++]=1,this._buf[this._offset++]=t?255:0};yr.prototype.writeString=function(t,e){if(typeof t!="string")throw new TypeError("argument must be a string (was: "+typeof t+")");typeof e!="number"&&(e=Ln.OctetString);var r=ya.byteLength(t);this.writeByte(e),this.writeLength(r),r&&(this._ensure(r),this._buf.write(t,this._offset),this._offset+=r)};yr.prototype.writeBuffer=function(t,e){if(typeof e!="number")throw new TypeError("tag must be a number");if(!ya.isBuffer(t))throw new TypeError("argument must be a buffer");this.writeByte(e),this.writeLength(t.length),this._ensure(t.length),t.copy(this._buf,this._offset,0,t.length),this._offset+=t.length};yr.prototype.writeStringArray=function(t){if(!t instanceof Array)throw new TypeError("argument must be an Array[String]");var e=this;t.forEach(function(r){e.writeString(r)})};yr.prototype.writeOID=function(t,e){if(typeof t!="string")throw new TypeError("argument must be a string");if(typeof e!="number"&&(e=Ln.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(t))throw new Error("argument is not a valid OID string");function r(s,a){a<128?s.push(a):a<16384?(s.push(a>>>7|128),s.push(a&127)):a<2097152?(s.push(a>>>14|128),s.push((a>>>7|128)&255),s.push(a&127)):a<268435456?(s.push(a>>>21|128),s.push((a>>>14|128)&255),s.push((a>>>7|128)&255),s.push(a&127)):(s.push((a>>>28|128)&255),s.push((a>>>21|128)&255),s.push((a>>>14|128)&255),s.push((a>>>7|128)&255),s.push(a&127))}c(r,"encodeOctet");var n=t.split("."),i=[];i.push(parseInt(n[0],10)*40+parseInt(n[1],10)),n.slice(2).forEach(function(s){r(i,parseInt(s,10))});var o=this;this._ensure(2+i.length),this.writeByte(e),this.writeLength(i.length),i.forEach(function(s){o.writeByte(s)})};yr.prototype.writeLength=function(t){if(typeof t!="number")throw new TypeError("argument must be a Number");if(this._ensure(4),t<=127)this._buf[this._offset++]=t;else if(t<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=t;else if(t<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=t>>8,this._buf[this._offset++]=t;else if(t<=16777215)this._buf[this._offset++]=131,this._buf[this._offset++]=t>>16,this._buf[this._offset++]=t>>8,this._buf[this._offset++]=t;else throw Ea("Length too long (> 4 bytes)")};yr.prototype.startSequence=function(t){typeof t!="number"&&(t=Ln.Sequence|Ln.Constructor),this.writeByte(t),this._seq.push(this._offset),this._ensure(3),this._offset+=3};yr.prototype.endSequence=function(){var t=this._seq.pop(),e=t+3,r=this._offset-e;if(r<=127)this._shift(e,r,-2),this._buf[t]=r;else if(r<=255)this._shift(e,r,-1),this._buf[t]=129,this._buf[t+1]=r;else if(r<=65535)this._buf[t]=130,this._buf[t+1]=r>>8,this._buf[t+2]=r;else if(r<=16777215)this._shift(e,r,1),this._buf[t]=131,this._buf[t+1]=r>>16,this._buf[t+2]=r>>8,this._buf[t+3]=r;else throw Ea("Sequence too long")};yr.prototype._shift=function(t,e,r){Un.ok(t!==void 0),Un.ok(e!==void 0),Un.ok(r),this._buf.copy(this._buf,t+r,t,t+e),this._offset+=r};yr.prototype._ensure=function(t){if(Un.ok(t),this._size-this._offset<t){var e=this._size*this._options.growthFactor;e-this._offset<t&&(e+=t);var r=ya.alloc(e);this._buf.copy(r,0,0,this._offset),this._buf=r,this._size=e}};gg.exports=yr});var _g=le((_F,xa)=>{var Du=ga(),Bu=ma(),jx=hg(),Wx=mg();xa.exports={Reader:jx,Writer:Wx};for(Aa in Bu)Bu.hasOwnProperty(Aa)&&(xa.exports[Aa]=Bu[Aa]);var Aa;for(ba in Du)Du.hasOwnProperty(ba)&&(xa.exports[ba]=Du[ba]);var ba});var Ko=le((yF,yg)=>{var Uu=_g();yg.exports={Ber:Uu,BerReader:Uu.Reader,BerWriter:Uu.Writer}});var Eg=le((EF,Ia)=>{(function(t){"use strict";var e=c(function(m){var A,y=new Float64Array(16);if(m)for(A=0;A<m.length;A++)y[A]=m[A];return y},"gf"),r=c(function(){throw new Error("no PRNG")},"randombytes"),n=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var o=e(),s=e([1]),a=e([56129,1]),u=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),p=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(m,A,y,f){m[A]=y>>24&255,m[A+1]=y>>16&255,m[A+2]=y>>8&255,m[A+3]=y&255,m[A+4]=f>>24&255,m[A+5]=f>>16&255,m[A+6]=f>>8&255,m[A+7]=f&255}c(h,"ts64");function _(m,A,y,f,x){var O,z=0;for(O=0;O<x;O++)z|=m[A+O]^y[f+O];return(1&z-1>>>8)-1}c(_,"vn");function b(m,A,y,f){return _(m,A,y,f,16)}c(b,"crypto_verify_16");function E(m,A,y,f){return _(m,A,y,f,32)}c(E,"crypto_verify_32");function v(m,A,y,f){for(var x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,O=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,z=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,ie=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,ce=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,ye=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,pe=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,_t=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,_e=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Me=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Fe=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Xe=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,Ye=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,He=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Ge=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,je=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Ee=x,Ie=O,ge=z,Ae=ie,be=ce,de=ye,Q=pe,K=_t,se=_e,ne=Me,oe=Fe,ae=Xe,ke=Ye,Je=He,rt=Ge,et=je,S,it=0;it<20;it+=2)S=Ee+ke|0,be^=S<<7|S>>>25,S=be+Ee|0,se^=S<<9|S>>>23,S=se+be|0,ke^=S<<13|S>>>19,S=ke+se|0,Ee^=S<<18|S>>>14,S=de+Ie|0,ne^=S<<7|S>>>25,S=ne+de|0,Je^=S<<9|S>>>23,S=Je+ne|0,Ie^=S<<13|S>>>19,S=Ie+Je|0,de^=S<<18|S>>>14,S=oe+Q|0,rt^=S<<7|S>>>25,S=rt+oe|0,ge^=S<<9|S>>>23,S=ge+rt|0,Q^=S<<13|S>>>19,S=Q+ge|0,oe^=S<<18|S>>>14,S=et+ae|0,Ae^=S<<7|S>>>25,S=Ae+et|0,K^=S<<9|S>>>23,S=K+Ae|0,ae^=S<<13|S>>>19,S=ae+K|0,et^=S<<18|S>>>14,S=Ee+Ae|0,Ie^=S<<7|S>>>25,S=Ie+Ee|0,ge^=S<<9|S>>>23,S=ge+Ie|0,Ae^=S<<13|S>>>19,S=Ae+ge|0,Ee^=S<<18|S>>>14,S=de+be|0,Q^=S<<7|S>>>25,S=Q+de|0,K^=S<<9|S>>>23,S=K+Q|0,be^=S<<13|S>>>19,S=be+K|0,de^=S<<18|S>>>14,S=oe+ne|0,ae^=S<<7|S>>>25,S=ae+oe|0,se^=S<<9|S>>>23,S=se+ae|0,ne^=S<<13|S>>>19,S=ne+se|0,oe^=S<<18|S>>>14,S=et+rt|0,ke^=S<<7|S>>>25,S=ke+et|0,Je^=S<<9|S>>>23,S=Je+ke|0,rt^=S<<13|S>>>19,S=rt+Je|0,et^=S<<18|S>>>14;Ee=Ee+x|0,Ie=Ie+O|0,ge=ge+z|0,Ae=Ae+ie|0,be=be+ce|0,de=de+ye|0,Q=Q+pe|0,K=K+_t|0,se=se+_e|0,ne=ne+Me|0,oe=oe+Fe|0,ae=ae+Xe|0,ke=ke+Ye|0,Je=Je+He|0,rt=rt+Ge|0,et=et+je|0,m[0]=Ee>>>0&255,m[1]=Ee>>>8&255,m[2]=Ee>>>16&255,m[3]=Ee>>>24&255,m[4]=Ie>>>0&255,m[5]=Ie>>>8&255,m[6]=Ie>>>16&255,m[7]=Ie>>>24&255,m[8]=ge>>>0&255,m[9]=ge>>>8&255,m[10]=ge>>>16&255,m[11]=ge>>>24&255,m[12]=Ae>>>0&255,m[13]=Ae>>>8&255,m[14]=Ae>>>16&255,m[15]=Ae>>>24&255,m[16]=be>>>0&255,m[17]=be>>>8&255,m[18]=be>>>16&255,m[19]=be>>>24&255,m[20]=de>>>0&255,m[21]=de>>>8&255,m[22]=de>>>16&255,m[23]=de>>>24&255,m[24]=Q>>>0&255,m[25]=Q>>>8&255,m[26]=Q>>>16&255,m[27]=Q>>>24&255,m[28]=K>>>0&255,m[29]=K>>>8&255,m[30]=K>>>16&255,m[31]=K>>>24&255,m[32]=se>>>0&255,m[33]=se>>>8&255,m[34]=se>>>16&255,m[35]=se>>>24&255,m[36]=ne>>>0&255,m[37]=ne>>>8&255,m[38]=ne>>>16&255,m[39]=ne>>>24&255,m[40]=oe>>>0&255,m[41]=oe>>>8&255,m[42]=oe>>>16&255,m[43]=oe>>>24&255,m[44]=ae>>>0&255,m[45]=ae>>>8&255,m[46]=ae>>>16&255,m[47]=ae>>>24&255,m[48]=ke>>>0&255,m[49]=ke>>>8&255,m[50]=ke>>>16&255,m[51]=ke>>>24&255,m[52]=Je>>>0&255,m[53]=Je>>>8&255,m[54]=Je>>>16&255,m[55]=Je>>>24&255,m[56]=rt>>>0&255,m[57]=rt>>>8&255,m[58]=rt>>>16&255,m[59]=rt>>>24&255,m[60]=et>>>0&255,m[61]=et>>>8&255,m[62]=et>>>16&255,m[63]=et>>>24&255}c(v,"core_salsa20");function w(m,A,y,f){for(var x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,O=y[0]&255|(y[1]&255)<<8|(y[2]&255)<<16|(y[3]&255)<<24,z=y[4]&255|(y[5]&255)<<8|(y[6]&255)<<16|(y[7]&255)<<24,ie=y[8]&255|(y[9]&255)<<8|(y[10]&255)<<16|(y[11]&255)<<24,ce=y[12]&255|(y[13]&255)<<8|(y[14]&255)<<16|(y[15]&255)<<24,ye=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,pe=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,_t=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,_e=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Me=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Fe=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Xe=y[16]&255|(y[17]&255)<<8|(y[18]&255)<<16|(y[19]&255)<<24,Ye=y[20]&255|(y[21]&255)<<8|(y[22]&255)<<16|(y[23]&255)<<24,He=y[24]&255|(y[25]&255)<<8|(y[26]&255)<<16|(y[27]&255)<<24,Ge=y[28]&255|(y[29]&255)<<8|(y[30]&255)<<16|(y[31]&255)<<24,je=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Ee=x,Ie=O,ge=z,Ae=ie,be=ce,de=ye,Q=pe,K=_t,se=_e,ne=Me,oe=Fe,ae=Xe,ke=Ye,Je=He,rt=Ge,et=je,S,it=0;it<20;it+=2)S=Ee+ke|0,be^=S<<7|S>>>25,S=be+Ee|0,se^=S<<9|S>>>23,S=se+be|0,ke^=S<<13|S>>>19,S=ke+se|0,Ee^=S<<18|S>>>14,S=de+Ie|0,ne^=S<<7|S>>>25,S=ne+de|0,Je^=S<<9|S>>>23,S=Je+ne|0,Ie^=S<<13|S>>>19,S=Ie+Je|0,de^=S<<18|S>>>14,S=oe+Q|0,rt^=S<<7|S>>>25,S=rt+oe|0,ge^=S<<9|S>>>23,S=ge+rt|0,Q^=S<<13|S>>>19,S=Q+ge|0,oe^=S<<18|S>>>14,S=et+ae|0,Ae^=S<<7|S>>>25,S=Ae+et|0,K^=S<<9|S>>>23,S=K+Ae|0,ae^=S<<13|S>>>19,S=ae+K|0,et^=S<<18|S>>>14,S=Ee+Ae|0,Ie^=S<<7|S>>>25,S=Ie+Ee|0,ge^=S<<9|S>>>23,S=ge+Ie|0,Ae^=S<<13|S>>>19,S=Ae+ge|0,Ee^=S<<18|S>>>14,S=de+be|0,Q^=S<<7|S>>>25,S=Q+de|0,K^=S<<9|S>>>23,S=K+Q|0,be^=S<<13|S>>>19,S=be+K|0,de^=S<<18|S>>>14,S=oe+ne|0,ae^=S<<7|S>>>25,S=ae+oe|0,se^=S<<9|S>>>23,S=se+ae|0,ne^=S<<13|S>>>19,S=ne+se|0,oe^=S<<18|S>>>14,S=et+rt|0,ke^=S<<7|S>>>25,S=ke+et|0,Je^=S<<9|S>>>23,S=Je+ke|0,rt^=S<<13|S>>>19,S=rt+Je|0,et^=S<<18|S>>>14;m[0]=Ee>>>0&255,m[1]=Ee>>>8&255,m[2]=Ee>>>16&255,m[3]=Ee>>>24&255,m[4]=de>>>0&255,m[5]=de>>>8&255,m[6]=de>>>16&255,m[7]=de>>>24&255,m[8]=oe>>>0&255,m[9]=oe>>>8&255,m[10]=oe>>>16&255,m[11]=oe>>>24&255,m[12]=et>>>0&255,m[13]=et>>>8&255,m[14]=et>>>16&255,m[15]=et>>>24&255,m[16]=Q>>>0&255,m[17]=Q>>>8&255,m[18]=Q>>>16&255,m[19]=Q>>>24&255,m[20]=K>>>0&255,m[21]=K>>>8&255,m[22]=K>>>16&255,m[23]=K>>>24&255,m[24]=se>>>0&255,m[25]=se>>>8&255,m[26]=se>>>16&255,m[27]=se>>>24&255,m[28]=ne>>>0&255,m[29]=ne>>>8&255,m[30]=ne>>>16&255,m[31]=ne>>>24&255}c(w,"core_hsalsa20");function H(m,A,y,f){v(m,A,y,f)}c(H,"crypto_core_salsa20");function D(m,A,y,f){w(m,A,y,f)}c(D,"crypto_core_hsalsa20");var J=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Y(m,A,y,f,x,O,z){var ie=new Uint8Array(16),ce=new Uint8Array(64),ye,pe;for(pe=0;pe<16;pe++)ie[pe]=0;for(pe=0;pe<8;pe++)ie[pe]=O[pe];for(;x>=64;){for(H(ce,ie,z,J),pe=0;pe<64;pe++)m[A+pe]=y[f+pe]^ce[pe];for(ye=1,pe=8;pe<16;pe++)ye=ye+(ie[pe]&255)|0,ie[pe]=ye&255,ye>>>=8;x-=64,A+=64,f+=64}if(x>0)for(H(ce,ie,z,J),pe=0;pe<x;pe++)m[A+pe]=y[f+pe]^ce[pe];return 0}c(Y,"crypto_stream_salsa20_xor");function X(m,A,y,f,x){var O=new Uint8Array(16),z=new Uint8Array(64),ie,ce;for(ce=0;ce<16;ce++)O[ce]=0;for(ce=0;ce<8;ce++)O[ce]=f[ce];for(;y>=64;){for(H(z,O,x,J),ce=0;ce<64;ce++)m[A+ce]=z[ce];for(ie=1,ce=8;ce<16;ce++)ie=ie+(O[ce]&255)|0,O[ce]=ie&255,ie>>>=8;y-=64,A+=64}if(y>0)for(H(z,O,x,J),ce=0;ce<y;ce++)m[A+ce]=z[ce];return 0}c(X,"crypto_stream_salsa20");function P(m,A,y,f,x){var O=new Uint8Array(32);D(O,f,x,J);for(var z=new Uint8Array(8),ie=0;ie<8;ie++)z[ie]=f[ie+16];return X(m,A,y,z,O)}c(P,"crypto_stream");function C(m,A,y,f,x,O,z){var ie=new Uint8Array(32);D(ie,O,z,J);for(var ce=new Uint8Array(8),ye=0;ye<8;ye++)ce[ye]=O[ye+16];return Y(m,A,y,f,x,ce,ie)}c(C,"crypto_stream_xor");var M=c(function(m){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var A,y,f,x,O,z,ie,ce;A=m[0]&255|(m[1]&255)<<8,this.r[0]=A&8191,y=m[2]&255|(m[3]&255)<<8,this.r[1]=(A>>>13|y<<3)&8191,f=m[4]&255|(m[5]&255)<<8,this.r[2]=(y>>>10|f<<6)&7939,x=m[6]&255|(m[7]&255)<<8,this.r[3]=(f>>>7|x<<9)&8191,O=m[8]&255|(m[9]&255)<<8,this.r[4]=(x>>>4|O<<12)&255,this.r[5]=O>>>1&8190,z=m[10]&255|(m[11]&255)<<8,this.r[6]=(O>>>14|z<<2)&8191,ie=m[12]&255|(m[13]&255)<<8,this.r[7]=(z>>>11|ie<<5)&8065,ce=m[14]&255|(m[15]&255)<<8,this.r[8]=(ie>>>8|ce<<8)&8191,this.r[9]=ce>>>5&127,this.pad[0]=m[16]&255|(m[17]&255)<<8,this.pad[1]=m[18]&255|(m[19]&255)<<8,this.pad[2]=m[20]&255|(m[21]&255)<<8,this.pad[3]=m[22]&255|(m[23]&255)<<8,this.pad[4]=m[24]&255|(m[25]&255)<<8,this.pad[5]=m[26]&255|(m[27]&255)<<8,this.pad[6]=m[28]&255|(m[29]&255)<<8,this.pad[7]=m[30]&255|(m[31]&255)<<8},"poly1305");M.prototype.blocks=function(m,A,y){for(var f=this.fin?0:2048,x,O,z,ie,ce,ye,pe,_t,_e,Me,Fe,Xe,Ye,He,Ge,je,Ee,Ie,ge,Ae=this.h[0],be=this.h[1],de=this.h[2],Q=this.h[3],K=this.h[4],se=this.h[5],ne=this.h[6],oe=this.h[7],ae=this.h[8],ke=this.h[9],Je=this.r[0],rt=this.r[1],et=this.r[2],S=this.r[3],it=this.r[4],yt=this.r[5],Et=this.r[6],nt=this.r[7],pt=this.r[8],ht=this.r[9];y>=16;)x=m[A+0]&255|(m[A+1]&255)<<8,Ae+=x&8191,O=m[A+2]&255|(m[A+3]&255)<<8,be+=(x>>>13|O<<3)&8191,z=m[A+4]&255|(m[A+5]&255)<<8,de+=(O>>>10|z<<6)&8191,ie=m[A+6]&255|(m[A+7]&255)<<8,Q+=(z>>>7|ie<<9)&8191,ce=m[A+8]&255|(m[A+9]&255)<<8,K+=(ie>>>4|ce<<12)&8191,se+=ce>>>1&8191,ye=m[A+10]&255|(m[A+11]&255)<<8,ne+=(ce>>>14|ye<<2)&8191,pe=m[A+12]&255|(m[A+13]&255)<<8,oe+=(ye>>>11|pe<<5)&8191,_t=m[A+14]&255|(m[A+15]&255)<<8,ae+=(pe>>>8|_t<<8)&8191,ke+=_t>>>5|f,_e=0,Me=_e,Me+=Ae*Je,Me+=be*(5*ht),Me+=de*(5*pt),Me+=Q*(5*nt),Me+=K*(5*Et),_e=Me>>>13,Me&=8191,Me+=se*(5*yt),Me+=ne*(5*it),Me+=oe*(5*S),Me+=ae*(5*et),Me+=ke*(5*rt),_e+=Me>>>13,Me&=8191,Fe=_e,Fe+=Ae*rt,Fe+=be*Je,Fe+=de*(5*ht),Fe+=Q*(5*pt),Fe+=K*(5*nt),_e=Fe>>>13,Fe&=8191,Fe+=se*(5*Et),Fe+=ne*(5*yt),Fe+=oe*(5*it),Fe+=ae*(5*S),Fe+=ke*(5*et),_e+=Fe>>>13,Fe&=8191,Xe=_e,Xe+=Ae*et,Xe+=be*rt,Xe+=de*Je,Xe+=Q*(5*ht),Xe+=K*(5*pt),_e=Xe>>>13,Xe&=8191,Xe+=se*(5*nt),Xe+=ne*(5*Et),Xe+=oe*(5*yt),Xe+=ae*(5*it),Xe+=ke*(5*S),_e+=Xe>>>13,Xe&=8191,Ye=_e,Ye+=Ae*S,Ye+=be*et,Ye+=de*rt,Ye+=Q*Je,Ye+=K*(5*ht),_e=Ye>>>13,Ye&=8191,Ye+=se*(5*pt),Ye+=ne*(5*nt),Ye+=oe*(5*Et),Ye+=ae*(5*yt),Ye+=ke*(5*it),_e+=Ye>>>13,Ye&=8191,He=_e,He+=Ae*it,He+=be*S,He+=de*et,He+=Q*rt,He+=K*Je,_e=He>>>13,He&=8191,He+=se*(5*ht),He+=ne*(5*pt),He+=oe*(5*nt),He+=ae*(5*Et),He+=ke*(5*yt),_e+=He>>>13,He&=8191,Ge=_e,Ge+=Ae*yt,Ge+=be*it,Ge+=de*S,Ge+=Q*et,Ge+=K*rt,_e=Ge>>>13,Ge&=8191,Ge+=se*Je,Ge+=ne*(5*ht),Ge+=oe*(5*pt),Ge+=ae*(5*nt),Ge+=ke*(5*Et),_e+=Ge>>>13,Ge&=8191,je=_e,je+=Ae*Et,je+=be*yt,je+=de*it,je+=Q*S,je+=K*et,_e=je>>>13,je&=8191,je+=se*rt,je+=ne*Je,je+=oe*(5*ht),je+=ae*(5*pt),je+=ke*(5*nt),_e+=je>>>13,je&=8191,Ee=_e,Ee+=Ae*nt,Ee+=be*Et,Ee+=de*yt,Ee+=Q*it,Ee+=K*S,_e=Ee>>>13,Ee&=8191,Ee+=se*et,Ee+=ne*rt,Ee+=oe*Je,Ee+=ae*(5*ht),Ee+=ke*(5*pt),_e+=Ee>>>13,Ee&=8191,Ie=_e,Ie+=Ae*pt,Ie+=be*nt,Ie+=de*Et,Ie+=Q*yt,Ie+=K*it,_e=Ie>>>13,Ie&=8191,Ie+=se*S,Ie+=ne*et,Ie+=oe*rt,Ie+=ae*Je,Ie+=ke*(5*ht),_e+=Ie>>>13,Ie&=8191,ge=_e,ge+=Ae*ht,ge+=be*pt,ge+=de*nt,ge+=Q*Et,ge+=K*yt,_e=ge>>>13,ge&=8191,ge+=se*it,ge+=ne*S,ge+=oe*et,ge+=ae*rt,ge+=ke*Je,_e+=ge>>>13,ge&=8191,_e=(_e<<2)+_e|0,_e=_e+Me|0,Me=_e&8191,_e=_e>>>13,Fe+=_e,Ae=Me,be=Fe,de=Xe,Q=Ye,K=He,se=Ge,ne=je,oe=Ee,ae=Ie,ke=ge,A+=16,y-=16;this.h[0]=Ae,this.h[1]=be,this.h[2]=de,this.h[3]=Q,this.h[4]=K,this.h[5]=se,this.h[6]=ne,this.h[7]=oe,this.h[8]=ae,this.h[9]=ke},M.prototype.finish=function(m,A){var y=new Uint16Array(10),f,x,O,z;if(this.leftover){for(z=this.leftover,this.buffer[z++]=1;z<16;z++)this.buffer[z]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(f=this.h[1]>>>13,this.h[1]&=8191,z=2;z<10;z++)this.h[z]+=f,f=this.h[z]>>>13,this.h[z]&=8191;for(this.h[0]+=f*5,f=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=f,f=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=f,y[0]=this.h[0]+5,f=y[0]>>>13,y[0]&=8191,z=1;z<10;z++)y[z]=this.h[z]+f,f=y[z]>>>13,y[z]&=8191;for(y[9]-=8192,x=(f^1)-1,z=0;z<10;z++)y[z]&=x;for(x=~x,z=0;z<10;z++)this.h[z]=this.h[z]&x|y[z];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,O=this.h[0]+this.pad[0],this.h[0]=O&65535,z=1;z<8;z++)O=(this.h[z]+this.pad[z]|0)+(O>>>16)|0,this.h[z]=O&65535;m[A+0]=this.h[0]>>>0&255,m[A+1]=this.h[0]>>>8&255,m[A+2]=this.h[1]>>>0&255,m[A+3]=this.h[1]>>>8&255,m[A+4]=this.h[2]>>>0&255,m[A+5]=this.h[2]>>>8&255,m[A+6]=this.h[3]>>>0&255,m[A+7]=this.h[3]>>>8&255,m[A+8]=this.h[4]>>>0&255,m[A+9]=this.h[4]>>>8&255,m[A+10]=this.h[5]>>>0&255,m[A+11]=this.h[5]>>>8&255,m[A+12]=this.h[6]>>>0&255,m[A+13]=this.h[6]>>>8&255,m[A+14]=this.h[7]>>>0&255,m[A+15]=this.h[7]>>>8&255},M.prototype.update=function(m,A,y){var f,x;if(this.leftover){for(x=16-this.leftover,x>y&&(x=y),f=0;f<x;f++)this.buffer[this.leftover+f]=m[A+f];if(y-=x,A+=x,this.leftover+=x,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(y>=16&&(x=y-y%16,this.blocks(m,A,x),A+=x,y-=x),y){for(f=0;f<y;f++)this.buffer[this.leftover+f]=m[A+f];this.leftover+=y}};function L(m,A,y,f,x,O){var z=new M(O);return z.update(y,f,x),z.finish(m,A),0}c(L,"crypto_onetimeauth");function T(m,A,y,f,x,O){var z=new Uint8Array(16);return L(z,0,y,f,x,O),b(m,A,z,0)}c(T,"crypto_onetimeauth_verify");function F(m,A,y,f,x){var O;if(y<32)return-1;for(C(m,0,A,0,y,f,x),L(m,16,m,32,y-32,m),O=0;O<16;O++)m[O]=0;return 0}c(F,"crypto_secretbox");function j(m,A,y,f,x){var O,z=new Uint8Array(32);if(y<32||(P(z,0,32,f,x),T(A,16,A,32,y-32,z)!==0))return-1;for(C(m,0,A,0,y,f,x),O=0;O<32;O++)m[O]=0;return 0}c(j,"crypto_secretbox_open");function B(m,A){var y;for(y=0;y<16;y++)m[y]=A[y]|0}c(B,"set25519");function Z(m){var A,y,f=1;for(A=0;A<16;A++)y=m[A]+f+65535,f=Math.floor(y/65536),m[A]=y-f*65536;m[0]+=f-1+37*(f-1)}c(Z,"car25519");function te(m,A,y){for(var f,x=~(y-1),O=0;O<16;O++)f=x&(m[O]^A[O]),m[O]^=f,A[O]^=f}c(te,"sel25519");function k(m,A){var y,f,x,O=e(),z=e();for(y=0;y<16;y++)z[y]=A[y];for(Z(z),Z(z),Z(z),f=0;f<2;f++){for(O[0]=z[0]-65517,y=1;y<15;y++)O[y]=z[y]-65535-(O[y-1]>>16&1),O[y-1]&=65535;O[15]=z[15]-32767-(O[14]>>16&1),x=O[15]>>16&1,O[14]&=65535,te(z,O,1-x)}for(y=0;y<16;y++)m[2*y]=z[y]&255,m[2*y+1]=z[y]>>8}c(k,"pack25519");function W(m,A){var y=new Uint8Array(32),f=new Uint8Array(32);return k(y,m),k(f,A),E(y,0,f,0)}c(W,"neq25519");function q(m){var A=new Uint8Array(32);return k(A,m),A[0]&1}c(q,"par25519");function ee(m,A){var y;for(y=0;y<16;y++)m[y]=A[2*y]+(A[2*y+1]<<8);m[15]&=32767}c(ee,"unpack25519");function ue(m,A,y){for(var f=0;f<16;f++)m[f]=A[f]+y[f]}c(ue,"A");function me(m,A,y){for(var f=0;f<16;f++)m[f]=A[f]-y[f]}c(me,"Z");function he(m,A,y){var f,x,O=0,z=0,ie=0,ce=0,ye=0,pe=0,_t=0,_e=0,Me=0,Fe=0,Xe=0,Ye=0,He=0,Ge=0,je=0,Ee=0,Ie=0,ge=0,Ae=0,be=0,de=0,Q=0,K=0,se=0,ne=0,oe=0,ae=0,ke=0,Je=0,rt=0,et=0,S=y[0],it=y[1],yt=y[2],Et=y[3],nt=y[4],pt=y[5],ht=y[6],Yt=y[7],vt=y[8],qt=y[9],Qt=y[10],Vt=y[11],sr=y[12],pr=y[13],hr=y[14],gr=y[15];f=A[0],O+=f*S,z+=f*it,ie+=f*yt,ce+=f*Et,ye+=f*nt,pe+=f*pt,_t+=f*ht,_e+=f*Yt,Me+=f*vt,Fe+=f*qt,Xe+=f*Qt,Ye+=f*Vt,He+=f*sr,Ge+=f*pr,je+=f*hr,Ee+=f*gr,f=A[1],z+=f*S,ie+=f*it,ce+=f*yt,ye+=f*Et,pe+=f*nt,_t+=f*pt,_e+=f*ht,Me+=f*Yt,Fe+=f*vt,Xe+=f*qt,Ye+=f*Qt,He+=f*Vt,Ge+=f*sr,je+=f*pr,Ee+=f*hr,Ie+=f*gr,f=A[2],ie+=f*S,ce+=f*it,ye+=f*yt,pe+=f*Et,_t+=f*nt,_e+=f*pt,Me+=f*ht,Fe+=f*Yt,Xe+=f*vt,Ye+=f*qt,He+=f*Qt,Ge+=f*Vt,je+=f*sr,Ee+=f*pr,Ie+=f*hr,ge+=f*gr,f=A[3],ce+=f*S,ye+=f*it,pe+=f*yt,_t+=f*Et,_e+=f*nt,Me+=f*pt,Fe+=f*ht,Xe+=f*Yt,Ye+=f*vt,He+=f*qt,Ge+=f*Qt,je+=f*Vt,Ee+=f*sr,Ie+=f*pr,ge+=f*hr,Ae+=f*gr,f=A[4],ye+=f*S,pe+=f*it,_t+=f*yt,_e+=f*Et,Me+=f*nt,Fe+=f*pt,Xe+=f*ht,Ye+=f*Yt,He+=f*vt,Ge+=f*qt,je+=f*Qt,Ee+=f*Vt,Ie+=f*sr,ge+=f*pr,Ae+=f*hr,be+=f*gr,f=A[5],pe+=f*S,_t+=f*it,_e+=f*yt,Me+=f*Et,Fe+=f*nt,Xe+=f*pt,Ye+=f*ht,He+=f*Yt,Ge+=f*vt,je+=f*qt,Ee+=f*Qt,Ie+=f*Vt,ge+=f*sr,Ae+=f*pr,be+=f*hr,de+=f*gr,f=A[6],_t+=f*S,_e+=f*it,Me+=f*yt,Fe+=f*Et,Xe+=f*nt,Ye+=f*pt,He+=f*ht,Ge+=f*Yt,je+=f*vt,Ee+=f*qt,Ie+=f*Qt,ge+=f*Vt,Ae+=f*sr,be+=f*pr,de+=f*hr,Q+=f*gr,f=A[7],_e+=f*S,Me+=f*it,Fe+=f*yt,Xe+=f*Et,Ye+=f*nt,He+=f*pt,Ge+=f*ht,je+=f*Yt,Ee+=f*vt,Ie+=f*qt,ge+=f*Qt,Ae+=f*Vt,be+=f*sr,de+=f*pr,Q+=f*hr,K+=f*gr,f=A[8],Me+=f*S,Fe+=f*it,Xe+=f*yt,Ye+=f*Et,He+=f*nt,Ge+=f*pt,je+=f*ht,Ee+=f*Yt,Ie+=f*vt,ge+=f*qt,Ae+=f*Qt,be+=f*Vt,de+=f*sr,Q+=f*pr,K+=f*hr,se+=f*gr,f=A[9],Fe+=f*S,Xe+=f*it,Ye+=f*yt,He+=f*Et,Ge+=f*nt,je+=f*pt,Ee+=f*ht,Ie+=f*Yt,ge+=f*vt,Ae+=f*qt,be+=f*Qt,de+=f*Vt,Q+=f*sr,K+=f*pr,se+=f*hr,ne+=f*gr,f=A[10],Xe+=f*S,Ye+=f*it,He+=f*yt,Ge+=f*Et,je+=f*nt,Ee+=f*pt,Ie+=f*ht,ge+=f*Yt,Ae+=f*vt,be+=f*qt,de+=f*Qt,Q+=f*Vt,K+=f*sr,se+=f*pr,ne+=f*hr,oe+=f*gr,f=A[11],Ye+=f*S,He+=f*it,Ge+=f*yt,je+=f*Et,Ee+=f*nt,Ie+=f*pt,ge+=f*ht,Ae+=f*Yt,be+=f*vt,de+=f*qt,Q+=f*Qt,K+=f*Vt,se+=f*sr,ne+=f*pr,oe+=f*hr,ae+=f*gr,f=A[12],He+=f*S,Ge+=f*it,je+=f*yt,Ee+=f*Et,Ie+=f*nt,ge+=f*pt,Ae+=f*ht,be+=f*Yt,de+=f*vt,Q+=f*qt,K+=f*Qt,se+=f*Vt,ne+=f*sr,oe+=f*pr,ae+=f*hr,ke+=f*gr,f=A[13],Ge+=f*S,je+=f*it,Ee+=f*yt,Ie+=f*Et,ge+=f*nt,Ae+=f*pt,be+=f*ht,de+=f*Yt,Q+=f*vt,K+=f*qt,se+=f*Qt,ne+=f*Vt,oe+=f*sr,ae+=f*pr,ke+=f*hr,Je+=f*gr,f=A[14],je+=f*S,Ee+=f*it,Ie+=f*yt,ge+=f*Et,Ae+=f*nt,be+=f*pt,de+=f*ht,Q+=f*Yt,K+=f*vt,se+=f*qt,ne+=f*Qt,oe+=f*Vt,ae+=f*sr,ke+=f*pr,Je+=f*hr,rt+=f*gr,f=A[15],Ee+=f*S,Ie+=f*it,ge+=f*yt,Ae+=f*Et,be+=f*nt,de+=f*pt,Q+=f*ht,K+=f*Yt,se+=f*vt,ne+=f*qt,oe+=f*Qt,ae+=f*Vt,ke+=f*sr,Je+=f*pr,rt+=f*hr,et+=f*gr,O+=38*Ie,z+=38*ge,ie+=38*Ae,ce+=38*be,ye+=38*de,pe+=38*Q,_t+=38*K,_e+=38*se,Me+=38*ne,Fe+=38*oe,Xe+=38*ae,Ye+=38*ke,He+=38*Je,Ge+=38*rt,je+=38*et,x=1,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=ye+x+65535,x=Math.floor(f/65536),ye=f-x*65536,f=pe+x+65535,x=Math.floor(f/65536),pe=f-x*65536,f=_t+x+65535,x=Math.floor(f/65536),_t=f-x*65536,f=_e+x+65535,x=Math.floor(f/65536),_e=f-x*65536,f=Me+x+65535,x=Math.floor(f/65536),Me=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,f=Xe+x+65535,x=Math.floor(f/65536),Xe=f-x*65536,f=Ye+x+65535,x=Math.floor(f/65536),Ye=f-x*65536,f=He+x+65535,x=Math.floor(f/65536),He=f-x*65536,f=Ge+x+65535,x=Math.floor(f/65536),Ge=f-x*65536,f=je+x+65535,x=Math.floor(f/65536),je=f-x*65536,f=Ee+x+65535,x=Math.floor(f/65536),Ee=f-x*65536,O+=x-1+37*(x-1),x=1,f=O+x+65535,x=Math.floor(f/65536),O=f-x*65536,f=z+x+65535,x=Math.floor(f/65536),z=f-x*65536,f=ie+x+65535,x=Math.floor(f/65536),ie=f-x*65536,f=ce+x+65535,x=Math.floor(f/65536),ce=f-x*65536,f=ye+x+65535,x=Math.floor(f/65536),ye=f-x*65536,f=pe+x+65535,x=Math.floor(f/65536),pe=f-x*65536,f=_t+x+65535,x=Math.floor(f/65536),_t=f-x*65536,f=_e+x+65535,x=Math.floor(f/65536),_e=f-x*65536,f=Me+x+65535,x=Math.floor(f/65536),Me=f-x*65536,f=Fe+x+65535,x=Math.floor(f/65536),Fe=f-x*65536,f=Xe+x+65535,x=Math.floor(f/65536),Xe=f-x*65536,f=Ye+x+65535,x=Math.floor(f/65536),Ye=f-x*65536,f=He+x+65535,x=Math.floor(f/65536),He=f-x*65536,f=Ge+x+65535,x=Math.floor(f/65536),Ge=f-x*65536,f=je+x+65535,x=Math.floor(f/65536),je=f-x*65536,f=Ee+x+65535,x=Math.floor(f/65536),Ee=f-x*65536,O+=x-1+37*(x-1),m[0]=O,m[1]=z,m[2]=ie,m[3]=ce,m[4]=ye,m[5]=pe,m[6]=_t,m[7]=_e,m[8]=Me,m[9]=Fe,m[10]=Xe,m[11]=Ye,m[12]=He,m[13]=Ge,m[14]=je,m[15]=Ee}c(he,"M");function xt(m,A){he(m,A,A)}c(xt,"S");function kt(m,A){var y=e(),f;for(f=0;f<16;f++)y[f]=A[f];for(f=253;f>=0;f--)xt(y,y),f!==2&&f!==4&&he(y,y,A);for(f=0;f<16;f++)m[f]=y[f]}c(kt,"inv25519");function Xt(m,A){var y=e(),f;for(f=0;f<16;f++)y[f]=A[f];for(f=250;f>=0;f--)xt(y,y),f!==1&&he(y,y,A);for(f=0;f<16;f++)m[f]=y[f]}c(Xt,"pow2523");function Ar(m,A,y){var f=new Uint8Array(32),x=new Float64Array(80),O,z,ie=e(),ce=e(),ye=e(),pe=e(),_t=e(),_e=e();for(z=0;z<31;z++)f[z]=A[z];for(f[31]=A[31]&127|64,f[0]&=248,ee(x,y),z=0;z<16;z++)ce[z]=x[z],pe[z]=ie[z]=ye[z]=0;for(ie[0]=pe[0]=1,z=254;z>=0;--z)O=f[z>>>3]>>>(z&7)&1,te(ie,ce,O),te(ye,pe,O),ue(_t,ie,ye),me(ie,ie,ye),ue(ye,ce,pe),me(ce,ce,pe),xt(pe,_t),xt(_e,ie),he(ie,ye,ie),he(ye,ce,_t),ue(_t,ie,ye),me(ie,ie,ye),xt(ce,ie),me(ye,pe,_e),he(ie,ye,a),ue(ie,ie,pe),he(ye,ye,ie),he(ie,pe,_e),he(pe,ce,x),xt(ce,_t),te(ie,ce,O),te(ye,pe,O);for(z=0;z<16;z++)x[z+16]=ie[z],x[z+32]=ye[z],x[z+48]=ce[z],x[z+64]=pe[z];var Me=x.subarray(32),Fe=x.subarray(16);return kt(Me,Me),he(Fe,Fe,Me),k(m,Fe),0}c(Ar,"crypto_scalarmult");function Br(m,A){return Ar(m,A,i)}c(Br,"crypto_scalarmult_base");function Sr(m,A){return r(A,32),Br(m,A)}c(Sr,"crypto_box_keypair");function Ai(m,A,y){var f=new Uint8Array(32);return Ar(f,y,A),D(m,n,f,J)}c(Ai,"crypto_box_beforenm");var mo=F,Bs=j;function _o(m,A,y,f,x,O){var z=new Uint8Array(32);return Ai(z,x,O),mo(m,A,y,f,z)}c(_o,"crypto_box");function bi(m,A,y,f,x,O){var z=new Uint8Array(32);return Ai(z,x,O),Bs(m,A,y,f,z)}c(bi,"crypto_box_open");var xi=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function re(m,A,y,f){for(var x=new Int32Array(16),O=new Int32Array(16),z,ie,ce,ye,pe,_t,_e,Me,Fe,Xe,Ye,He,Ge,je,Ee,Ie,ge,Ae,be,de,Q,K,se,ne,oe,ae,ke=m[0],Je=m[1],rt=m[2],et=m[3],S=m[4],it=m[5],yt=m[6],Et=m[7],nt=A[0],pt=A[1],ht=A[2],Yt=A[3],vt=A[4],qt=A[5],Qt=A[6],Vt=A[7],sr=0;f>=128;){for(be=0;be<16;be++)de=8*be+sr,x[be]=y[de+0]<<24|y[de+1]<<16|y[de+2]<<8|y[de+3],O[be]=y[de+4]<<24|y[de+5]<<16|y[de+6]<<8|y[de+7];for(be=0;be<80;be++)if(z=ke,ie=Je,ce=rt,ye=et,pe=S,_t=it,_e=yt,Me=Et,Fe=nt,Xe=pt,Ye=ht,He=Yt,Ge=vt,je=qt,Ee=Qt,Ie=Vt,Q=Et,K=Vt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=(S>>>14|vt<<18)^(S>>>18|vt<<14)^(vt>>>9|S<<23),K=(vt>>>14|S<<18)^(vt>>>18|S<<14)^(S>>>9|vt<<23),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=S&it^~S&yt,K=vt&qt^~vt&Qt,se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=xi[be*2],K=xi[be*2+1],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=x[be%16],K=O[be%16],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,ge=oe&65535|ae<<16,Ae=se&65535|ne<<16,Q=ge,K=Ae,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=(ke>>>28|nt<<4)^(nt>>>2|ke<<30)^(nt>>>7|ke<<25),K=(nt>>>28|ke<<4)^(ke>>>2|nt<<30)^(ke>>>7|nt<<25),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,Q=ke&Je^ke&rt^Je&rt,K=nt&pt^nt&ht^pt&ht,se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,Me=oe&65535|ae<<16,Ie=se&65535|ne<<16,Q=ye,K=He,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=ge,K=Ae,se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,ye=oe&65535|ae<<16,He=se&65535|ne<<16,Je=z,rt=ie,et=ce,S=ye,it=pe,yt=_t,Et=_e,ke=Me,pt=Fe,ht=Xe,Yt=Ye,vt=He,qt=Ge,Qt=je,Vt=Ee,nt=Ie,be%16===15)for(de=0;de<16;de++)Q=x[de],K=O[de],se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=x[(de+9)%16],K=O[(de+9)%16],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ge=x[(de+1)%16],Ae=O[(de+1)%16],Q=(ge>>>1|Ae<<31)^(ge>>>8|Ae<<24)^ge>>>7,K=(Ae>>>1|ge<<31)^(Ae>>>8|ge<<24)^(Ae>>>7|ge<<25),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ge=x[(de+14)%16],Ae=O[(de+14)%16],Q=(ge>>>19|Ae<<13)^(Ae>>>29|ge<<3)^ge>>>6,K=(Ae>>>19|ge<<13)^(ge>>>29|Ae<<3)^(Ae>>>6|ge<<26),se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,x[de]=oe&65535|ae<<16,O[de]=se&65535|ne<<16;Q=ke,K=nt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[0],K=A[0],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[0]=ke=oe&65535|ae<<16,A[0]=nt=se&65535|ne<<16,Q=Je,K=pt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[1],K=A[1],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[1]=Je=oe&65535|ae<<16,A[1]=pt=se&65535|ne<<16,Q=rt,K=ht,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[2],K=A[2],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[2]=rt=oe&65535|ae<<16,A[2]=ht=se&65535|ne<<16,Q=et,K=Yt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[3],K=A[3],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[3]=et=oe&65535|ae<<16,A[3]=Yt=se&65535|ne<<16,Q=S,K=vt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[4],K=A[4],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[4]=S=oe&65535|ae<<16,A[4]=vt=se&65535|ne<<16,Q=it,K=qt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[5],K=A[5],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[5]=it=oe&65535|ae<<16,A[5]=qt=se&65535|ne<<16,Q=yt,K=Qt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[6],K=A[6],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[6]=yt=oe&65535|ae<<16,A[6]=Qt=se&65535|ne<<16,Q=Et,K=Vt,se=K&65535,ne=K>>>16,oe=Q&65535,ae=Q>>>16,Q=m[7],K=A[7],se+=K&65535,ne+=K>>>16,oe+=Q&65535,ae+=Q>>>16,ne+=se>>>16,oe+=ne>>>16,ae+=oe>>>16,m[7]=Et=oe&65535|ae<<16,A[7]=Vt=se&65535|ne<<16,sr+=128,f-=128}return f}c(re,"crypto_hashblocks_hl");function fe(m,A,y){var f=new Int32Array(8),x=new Int32Array(8),O=new Uint8Array(256),z,ie=y;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,x[0]=4089235720,x[1]=2227873595,x[2]=4271175723,x[3]=1595750129,x[4]=2917565137,x[5]=725511199,x[6]=4215389547,x[7]=327033209,re(f,x,A,y),y%=128,z=0;z<y;z++)O[z]=A[ie-y+z];for(O[y]=128,y=256-128*(y<112?1:0),O[y-9]=0,h(O,y-8,ie/536870912|0,ie<<3),re(f,x,O,y),z=0;z<8;z++)h(m,8*z,f[z],x[z]);return 0}c(fe,"crypto_hash");function ve(m,A){var y=e(),f=e(),x=e(),O=e(),z=e(),ie=e(),ce=e(),ye=e(),pe=e();me(y,m[1],m[0]),me(pe,A[1],A[0]),he(y,y,pe),ue(f,m[0],m[1]),ue(pe,A[0],A[1]),he(f,f,pe),he(x,m[3],A[3]),he(x,x,l),he(O,m[2],A[2]),ue(O,O,O),me(z,f,y),me(ie,O,x),ue(ce,O,x),ue(ye,f,y),he(m[0],z,ie),he(m[1],ye,ce),he(m[2],ce,ie),he(m[3],z,ye)}c(ve,"add");function Be(m,A,y){var f;for(f=0;f<4;f++)te(m[f],A[f],y)}c(Be,"cswap");function ut(m,A){var y=e(),f=e(),x=e();kt(x,A[2]),he(y,A[0],x),he(f,A[1],x),k(m,f),m[31]^=q(y)<<7}c(ut,"pack");function Jt(m,A,y){var f,x;for(B(m[0],o),B(m[1],s),B(m[2],s),B(m[3],o),x=255;x>=0;--x)f=y[x/8|0]>>(x&7)&1,Be(m,A,f),ve(A,m),ve(m,m),Be(m,A,f)}c(Jt,"scalarmult");function Xr(m,A){var y=[e(),e(),e(),e()];B(y[0],d),B(y[1],p),B(y[2],s),he(y[3],d,p),Jt(m,y,A)}c(Xr,"scalarbase");function kr(m,A,y){var f=new Uint8Array(64),x=[e(),e(),e(),e()],O;for(y||r(A,32),fe(f,A,32),f[0]&=248,f[31]&=127,f[31]|=64,Xr(x,f),ut(m,x),O=0;O<32;O++)A[O+32]=m[O];return 0}c(kr,"crypto_sign_keypair");var Ii=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function It(m,A){var y,f,x,O;for(f=63;f>=32;--f){for(y=0,x=f-32,O=f-12;x<O;++x)A[x]+=y-16*A[f]*Ii[x-(f-32)],y=A[x]+128>>8,A[x]-=y*256;A[x]+=y,A[f]=0}for(y=0,x=0;x<32;x++)A[x]+=y-(A[31]>>4)*Ii[x],y=A[x]>>8,A[x]&=255;for(x=0;x<32;x++)A[x]-=y*Ii[x];for(f=0;f<32;f++)A[f+1]+=A[f]>>8,m[f]=A[f]&255}c(It,"modL");function ar(m){var A=new Float64Array(64),y;for(y=0;y<64;y++)A[y]=m[y];for(y=0;y<64;y++)m[y]=0;It(m,A)}c(ar,"reduce");function or(m,A,y,f){var x=new Uint8Array(64),O=new Uint8Array(64),z=new Uint8Array(64),ie,ce,ye=new Float64Array(64),pe=[e(),e(),e(),e()];fe(x,f,32),x[0]&=248,x[31]&=127,x[31]|=64;var _t=y+64;for(ie=0;ie<y;ie++)m[64+ie]=A[ie];for(ie=0;ie<32;ie++)m[32+ie]=x[32+ie];for(fe(z,m.subarray(32),y+32),ar(z),Xr(pe,z),ut(m,pe),ie=32;ie<64;ie++)m[ie]=f[ie];for(fe(O,m,y+64),ar(O),ie=0;ie<64;ie++)ye[ie]=0;for(ie=0;ie<32;ie++)ye[ie]=z[ie];for(ie=0;ie<32;ie++)for(ce=0;ce<32;ce++)ye[ie+ce]+=O[ie]*x[ce];return It(m.subarray(32),ye),_t}c(or,"crypto_sign");function jt(m,A){var y=e(),f=e(),x=e(),O=e(),z=e(),ie=e(),ce=e();return B(m[2],s),ee(m[1],A),xt(x,m[1]),he(O,x,u),me(x,x,m[2]),ue(O,m[2],O),xt(z,O),xt(ie,z),he(ce,ie,z),he(y,ce,x),he(y,y,O),Xt(y,y),he(y,y,x),he(y,y,O),he(y,y,O),he(m[0],y,O),xt(f,m[0]),he(f,f,O),W(f,x)&&he(m[0],m[0],g),xt(f,m[0]),he(f,f,O),W(f,x)?-1:(q(m[0])===A[31]>>7&&me(m[0],o,m[0]),he(m[3],m[0],m[1]),0)}c(jt,"unpackneg");function Pt(m,A,y,f){var x,O,z=new Uint8Array(32),ie=new Uint8Array(64),ce=[e(),e(),e(),e()],ye=[e(),e(),e(),e()];if(O=-1,y<64||jt(ye,f))return-1;for(x=0;x<y;x++)m[x]=A[x];for(x=0;x<32;x++)m[x+32]=f[x];if(fe(ie,m,y),ar(ie),Jt(ce,ye,ie),Xr(ye,A.subarray(32)),ve(ce,ye),ut(z,ce),y-=64,E(A,0,z,0)){for(x=0;x<y;x++)m[x]=0;return-1}for(x=0;x<y;x++)m[x]=A[x+64];return O=y,O}c(Pt,"crypto_sign_open");var Ur=32,Wt=24,ei=32,vi=16,yo=32,Us=32,Eo=32,Ao=32,Cc=32,fd=Wt,GE=ei,ZE=vi,ln=64,ti=32,Si=64,kc=32,Rc=64;t.lowlevel={crypto_core_hsalsa20:D,crypto_stream_xor:C,crypto_stream:P,crypto_stream_salsa20_xor:Y,crypto_stream_salsa20:X,crypto_onetimeauth:L,crypto_onetimeauth_verify:T,crypto_verify_16:b,crypto_verify_32:E,crypto_secretbox:F,crypto_secretbox_open:j,crypto_scalarmult:Ar,crypto_scalarmult_base:Br,crypto_box_beforenm:Ai,crypto_box_afternm:mo,crypto_box:_o,crypto_box_open:bi,crypto_box_keypair:Sr,crypto_hash:fe,crypto_sign:or,crypto_sign_keypair:kr,crypto_sign_open:Pt,crypto_secretbox_KEYBYTES:Ur,crypto_secretbox_NONCEBYTES:Wt,crypto_secretbox_ZEROBYTES:ei,crypto_secretbox_BOXZEROBYTES:vi,crypto_scalarmult_BYTES:yo,crypto_scalarmult_SCALARBYTES:Us,crypto_box_PUBLICKEYBYTES:Eo,crypto_box_SECRETKEYBYTES:Ao,crypto_box_BEFORENMBYTES:Cc,crypto_box_NONCEBYTES:fd,crypto_box_ZEROBYTES:GE,crypto_box_BOXZEROBYTES:ZE,crypto_sign_BYTES:ln,crypto_sign_PUBLICKEYBYTES:ti,crypto_sign_SECRETKEYBYTES:Si,crypto_sign_SEEDBYTES:kc,crypto_hash_BYTES:Rc};function dd(m,A){if(m.length!==Ur)throw new Error("bad key size");if(A.length!==Wt)throw new Error("bad nonce size")}c(dd,"checkLengths");function YE(m,A){if(m.length!==Eo)throw new Error("bad public key size");if(A.length!==Ao)throw new Error("bad secret key size")}c(YE,"checkBoxLengths");function Rr(){var m,A;for(A=0;A<arguments.length;A++)if((m=Object.prototype.toString.call(arguments[A]))!=="[object Uint8Array]")throw new TypeError("unexpected type "+m+", use Uint8Array")}c(Rr,"checkArrayTypes");function pd(m){for(var A=0;A<m.length;A++)m[A]=0}c(pd,"cleanup"),t.util||(t.util={},t.util.decodeUTF8=t.util.encodeUTF8=t.util.encodeBase64=t.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),t.randomBytes=function(m){var A=new Uint8Array(m);return r(A,m),A},t.secretbox=function(m,A,y){Rr(m,A,y),dd(y,A);for(var f=new Uint8Array(ei+m.length),x=new Uint8Array(f.length),O=0;O<m.length;O++)f[O+ei]=m[O];return F(x,f,f.length,A,y),x.subarray(vi)},t.secretbox.open=function(m,A,y){Rr(m,A,y),dd(y,A);for(var f=new Uint8Array(vi+m.length),x=new Uint8Array(f.length),O=0;O<m.length;O++)f[O+vi]=m[O];return f.length<32||j(x,f,f.length,A,y)!==0?!1:x.subarray(ei)},t.secretbox.keyLength=Ur,t.secretbox.nonceLength=Wt,t.secretbox.overheadLength=vi,t.scalarMult=function(m,A){if(Rr(m,A),m.length!==Us)throw new Error("bad n size");if(A.length!==yo)throw new Error("bad p size");var y=new Uint8Array(yo);return Ar(y,m,A),y},t.scalarMult.base=function(m){if(Rr(m),m.length!==Us)throw new Error("bad n size");var A=new Uint8Array(yo);return Br(A,m),A},t.scalarMult.scalarLength=Us,t.scalarMult.groupElementLength=yo,t.box=function(m,A,y,f){var x=t.box.before(y,f);return t.secretbox(m,A,x)},t.box.before=function(m,A){Rr(m,A),YE(m,A);var y=new Uint8Array(Cc);return Ai(y,m,A),y},t.box.after=t.secretbox,t.box.open=function(m,A,y,f){var x=t.box.before(y,f);return t.secretbox.open(m,A,x)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var m=new Uint8Array(Eo),A=new Uint8Array(Ao);return Sr(m,A),{publicKey:m,secretKey:A}},t.box.keyPair.fromSecretKey=function(m){if(Rr(m),m.length!==Ao)throw new Error("bad secret key size");var A=new Uint8Array(Eo);return Br(A,m),{publicKey:A,secretKey:new Uint8Array(m)}},t.box.publicKeyLength=Eo,t.box.secretKeyLength=Ao,t.box.sharedKeyLength=Cc,t.box.nonceLength=fd,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(m,A){if(Rr(m,A),A.length!==Si)throw new Error("bad secret key size");var y=new Uint8Array(ln+m.length);return or(y,m,m.length,A),y},t.sign.open=function(m,A){if(arguments.length!==2)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Rr(m,A),A.length!==ti)throw new Error("bad public key size");var y=new Uint8Array(m.length),f=Pt(y,m,m.length,A);if(f<0)return null;for(var x=new Uint8Array(f),O=0;O<x.length;O++)x[O]=y[O];return x},t.sign.detached=function(m,A){for(var y=t.sign(m,A),f=new Uint8Array(ln),x=0;x<f.length;x++)f[x]=y[x];return f},t.sign.detached.verify=function(m,A,y){if(Rr(m,A,y),A.length!==ln)throw new Error("bad signature size");if(y.length!==ti)throw new Error("bad public key size");var f=new Uint8Array(ln+m.length),x=new Uint8Array(ln+m.length),O;for(O=0;O<ln;O++)f[O]=A[O];for(O=0;O<m.length;O++)f[O+ln]=m[O];return Pt(x,f,f.length,y)>=0},t.sign.keyPair=function(){var m=new Uint8Array(ti),A=new Uint8Array(Si);return kr(m,A),{publicKey:m,secretKey:A}},t.sign.keyPair.fromSecretKey=function(m){if(Rr(m),m.length!==Si)throw new Error("bad secret key size");for(var A=new Uint8Array(ti),y=0;y<A.length;y++)A[y]=m[32+y];return{publicKey:A,secretKey:new Uint8Array(m)}},t.sign.keyPair.fromSeed=function(m){if(Rr(m),m.length!==kc)throw new Error("bad seed size");for(var A=new Uint8Array(ti),y=new Uint8Array(Si),f=0;f<32;f++)y[f]=m[f];return kr(A,y,!0),{publicKey:A,secretKey:y}},t.sign.publicKeyLength=ti,t.sign.secretKeyLength=Si,t.sign.seedLength=kc,t.sign.signatureLength=ln,t.hash=function(m){Rr(m);var A=new Uint8Array(Rc);return fe(A,m,m.length),A},t.hash.hashLength=Rc,t.verify=function(m,A){return Rr(m,A),m.length===0||A.length===0||m.length!==A.length?!1:_(m,0,A,0,m.length)===0},t.setPRNG=function(m){r=m},(function(){var m=typeof self<"u"?self.crypto||self.msCrypto:null;if(m&&m.getRandomValues){var A=65536;t.setPRNG(function(y,f){var x,O=new Uint8Array(f);for(x=0;x<f;x+=A)m.getRandomValues(O.subarray(x,x+Math.min(f-x,A)));for(x=0;x<f;x++)y[x]=O[x];pd(O)})}else typeof require<"u"&&(m=require("crypto"),m&&m.randomBytes&&t.setPRNG(function(y,f){var x,O=m.randomBytes(f);for(x=0;x<f;x++)y[x]=O[x];pd(O)}))})()})(typeof Ia<"u"&&Ia.exports?Ia.exports:self.nacl=self.nacl||{})});var Fu=le((bF,Ag)=>{"use strict";var Lu=Eg().lowlevel.crypto_hash,yn=0,ai=c(function(){this.S=[new Uint32Array([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]),new Uint32Array([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]),new Uint32Array([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]),new Uint32Array([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])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])},"Blowfish");function Sa(t,e,r){return(t[0][e[r+3]]+t[1][e[r+2]]^t[2][e[r+1]])+t[3][e[r]]}c(Sa,"F");ai.prototype.encipher=function(t,e){e===void 0&&(e=new Uint8Array(t.buffer),t.byteOffset!==0&&(e=e.subarray(t.byteOffset))),t[0]^=this.P[0];for(var r=1;r<16;r+=2)t[1]^=Sa(this.S,e,0)^this.P[r],t[0]^=Sa(this.S,e,4)^this.P[r+1];var n=t[0];t[0]=t[1]^this.P[17],t[1]=n};ai.prototype.decipher=function(t){var e=new Uint8Array(t.buffer);t.byteOffset!==0&&(e=e.subarray(t.byteOffset)),t[0]^=this.P[17];for(var r=16;r>0;r-=2)t[1]^=Sa(this.S,e,0)^this.P[r],t[0]^=Sa(this.S,e,4)^this.P[r-1];var n=t[0];t[0]=t[1]^this.P[0],t[1]=n};function si(t,e){var r,n=0;for(r=0;r<4;r++,yn++)yn>=e&&(yn=0),n=n<<8|t[yn];return n}c(si,"stream2word");ai.prototype.expand0state=function(t,e){var r=new Uint32Array(2),n,i,o=new Uint8Array(r.buffer);for(n=0,yn=0;n<18;n++)this.P[n]^=si(t,e);for(yn=0,n=0;n<18;n+=2)this.encipher(r,o),this.P[n]=r[0],this.P[n+1]=r[1];for(n=0;n<4;n++)for(i=0;i<256;i+=2)this.encipher(r,o),this.S[n][i]=r[0],this.S[n][i+1]=r[1]};ai.prototype.expandstate=function(t,e,r,n){var i=new Uint32Array(2),o,s;for(o=0,yn=0;o<18;o++)this.P[o]^=si(r,n);for(o=0,yn=0;o<18;o+=2)i[0]^=si(t,e),i[1]^=si(t,e),this.encipher(i),this.P[o]=i[0],this.P[o+1]=i[1];for(o=0;o<4;o++)for(s=0;s<256;s+=2)i[0]^=si(t,e),i[1]^=si(t,e),this.encipher(i),this.S[o][s]=i[0],this.S[o][s+1]=i[1];yn=0};ai.prototype.enc=function(t,e){for(var r=0;r<e;r++)this.encipher(t.subarray(r*2))};ai.prototype.dec=function(t,e){for(var r=0;r<e;r++)this.decipher(t.subarray(r*2))};var va=8,zu=32;function Mu(t,e,r){var n=new ai,i=new Uint32Array(va),o,s=new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,105,116,101]);for(n.expandstate(e,64,t,64),o=0;o<64;o++)n.expand0state(e,64),n.expand0state(t,64);for(o=0;o<va;o++)i[o]=si(s,s.byteLength);for(o=0;o<64;o++)n.enc(i,i.byteLength/8);for(o=0;o<va;o++)r[4*o+3]=i[o]>>>24,r[4*o+2]=i[o]>>>16,r[4*o+1]=i[o]>>>8,r[4*o+0]=i[o]}c(Mu,"bcrypt_hash");function qx(t,e,r,n,i,o,s){var a=new Uint8Array(64),u=new Uint8Array(64),l=new Uint8Array(zu),d=new Uint8Array(zu),p=new Uint8Array(n+4),g,h,_,b,E,v,w=o;if(s<1||e===0||n===0||o===0||o>l.byteLength*l.byteLength||n>1<<20)return-1;for(b=Math.floor((o+l.byteLength-1)/l.byteLength),_=Math.floor((o+b-1)/b),g=0;g<n;g++)p[g]=r[g];for(Lu(a,t,e),v=1;o>0;v++){for(p[n+0]=v>>>24,p[n+1]=v>>>16,p[n+2]=v>>>8,p[n+3]=v,Lu(u,p,n+4),Mu(a,u,d),g=l.byteLength;g--;)l[g]=d[g];for(g=1;g<s;g++)for(Lu(u,d,d.byteLength),Mu(a,u,d),h=0;h<l.byteLength;h++)l[h]^=d[h];for(_=Math.min(_,o),g=0;g<_&&(E=g*b+(v-1),!(E>=w));g++)i[E]=l[g];o-=g}return 0}c(qx,"bcrypt_pbkdf");Ag.exports={BLOCKS:va,HASHSIZE:zu,hash:Mu,pbkdf:qx}});var An=le((IF,Pa)=>{"use strict";var En=require("crypto"),Ki;try{Ki=require("cpu-features")()}catch{}var{bindingAvailable:bg,CIPHER_INFO:Qx,MAC_INFO:Vx}=Mn(),xg=(()=>{if(typeof En.sign=="function"&&typeof En.verify=="function"){let t=`-----BEGIN PRIVATE KEY-----\r
1
+ "use strict";var Kk=Object.create;var ta=Object.defineProperty;var Gk=Object.getOwnPropertyDescriptor;var Yk=Object.getOwnPropertyNames;var Xk=Object.getPrototypeOf,Jk=Object.prototype.hasOwnProperty;var a=(e,t)=>ta(e,"name",{value:t,configurable:!0});var me=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},cn=(e,t)=>{for(var r in t)ta(e,r,{get:t[r],enumerable:!0})},wb=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Yk(t))!Jk.call(e,n)&&n!==r&&ta(e,n,{get:()=>t[n],enumerable:!(i=Gk(t,n))||i.enumerable});return e};var Dr=(e,t,r)=>(r=e!=null?Kk(Xk(e)):{},wb(t||!e||!e.__esModule?ta(r,"default",{value:e,enumerable:!0}):r,e)),eC=e=>wb(ta({},"__esModule",{value:!0}),e);var vI=me((II,Sd)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},i=new RegExp("^0[0-7]+$","i"),n=new RegExp("^0x[a-f0-9]+$","i"),o="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(o,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${o})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${o})?$`,"i")};function u(h,_){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let y=0,b=-1,v=(h.match(c.zoneIndex)||[])[0],S,M;for(v&&(v=v.substring(1),h=h.replace(/%.+$/,""));(b=h.indexOf(":",b+1))>=0;)y++;if(h.substr(0,2)==="::"&&y--,h.substr(-2,2)==="::"&&y--,y>_)return null;for(M=_-y,S=":";M--;)S+="0:";return h=h.replace("::",S),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),_=(function(){let R=h.split(":"),J=[];for(let te=0;te<R.length;te++)J.push(parseInt(R[te],16));return J})(),{parts:_,zoneId:v}}a(u,"expandIPv6");function l(h,_,y,b){if(h.length!==_.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,S;for(;b>0;){if(S=y-b,S<0&&(S=0),h[v]>>S!==_[v]>>S)return!1;b-=y,v+=1}return!0}a(l,"matchCIDR");function f(h){if(n.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(i.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}a(f,"parseIntAuto");function p(h,_){for(;h.length<_;)h=`0${h}`;return h}a(p,"padPart");let g={};g.IPv4=(function(){function h(_){if(_.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,b;for(y=0;y<_.length;y++)if(b=_[y],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=_}return a(h,"IPv4"),h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(_,y){let b;if(y===void 0&&(b=_,_=b[0],y=b[1]),_.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,_.octets,8,y)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,y=!1,b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,S,M;for(v=3;v>=0;v-=1)if(S=this.octets[v],S in b){if(M=b[S],y&&M!==0)return null;M!==8&&(y=!0),_+=M}else return null;return 32-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return g.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h})(),g.IPv4.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),y=_[0].toByteArray(),b=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],S=0;for(;S<4;)v.push(parseInt(y[S],10)|parseInt(b[S],10)^255),S++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.isIPv4=function(h){return this.parser(h)!==null},g.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},g.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv4.isValidFourPartDecimal=function(h){return!!(g.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},g.IPv4.isValidCIDRFourPartDecimal=function(h){let _=h.match(/^(.+)\/(\d+)$/);return!g.IPv4.isValidCIDR(h)||!_?!1:g.IPv4.isValidFourPartDecimal(_[1])},g.IPv4.networkAddressFromCIDR=function(h){let _,y,b,v,S;try{for(_=this.parseCIDR(h),b=_[0].toByteArray(),S=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(b[y],10)&parseInt(S[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},g.IPv4.parse=function(h){let _=this.parser(h);if(_===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(_)},g.IPv4.parseCIDR=function(h){let _;if(_=h.match(/^(.+)\/(\d+)$/)){let y=parseInt(_[2]);if(y>=0&&y<=32){let b=[this.parse(_[1]),y];return Object.defineProperty(b,"toString",{value:a(function(){return this.join("/")},"value")}),b}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},g.IPv4.parser=function(h){let _,y,b;if(_=h.match(r.fourOctet))return(function(){let v=_.slice(1,6),S=[];for(let M=0;M<v.length;M++)y=v[M],S.push(f(y));return S})();if(_=h.match(r.longValue)){if(b=f(_[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],S;for(S=0;S<=24;S+=8)v.push(b>>S&255);return v})().reverse()}else return(_=h.match(r.twoOctet))?(function(){let v=_.slice(1,4),S=[];if(b=f(v[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return S.push(f(v[0])),S.push(b>>16&255),S.push(b>>8&255),S.push(b&255),S})():(_=h.match(r.threeOctet))?(function(){let v=_.slice(1,5),S=[];if(b=f(v[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return S.push(f(v[0])),S.push(f(v[1])),S.push(b>>8&255),S.push(b&255),S})():null},g.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let _=[0,0,0,0],y=0,b=Math.floor(h/8);for(;y<b;)_[y]=255,y++;return b<4&&(_[b]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.IPv6=(function(){function h(_,y){let b,v;if(_.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(_[b]<<8|_[b+1]);else if(_.length===8)this.parts=_;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(v=this.parts[b],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return a(h,"IPv6"),h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(_,y){let b;if(y===void 0&&(b=_,_=b[0],y=b[1]),_.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,_.parts,16,y)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,y=!1,b={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,S;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in b){if(S=b[v],y&&S!==0)return null;S!==16&&(y=!0),_+=S}else return null;return 128-_},h.prototype.range=function(){return g.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let _,y=[],b=this.parts;for(let v=0;v<b.length;v++)_=b[v],y.push(_>>8),y.push(_&255);return y},h.prototype.toFixedLengthString=function(){let _=(function(){let b=[];for(let v=0;v<this.parts.length;v++)b.push(p(this.parts[v].toString(16),4));return b}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),_+y},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let _=this.parts.slice(-2),y=_[0],b=_[1];return new g.IPv4([y>>8,y&255,b>>8,b&255])},h.prototype.toNormalizedString=function(){let _=(function(){let b=[];for(let v=0;v<this.parts.length;v++)b.push(this.parts[v].toString(16));return b}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),_+y},h.prototype.toRFC5952String=function(){let _=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),b=0,v=-1,S;for(;S=_.exec(y);)S[0].length>v&&(b=S.index,v=S[0].length);return v<0?y:`${y.substring(0,b)}::${y.substring(b+v)}`},h.prototype.toString=function(){return this.toRFC5952String()},h})(),g.IPv6.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),y=_[0].toByteArray(),b=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],S=0;for(;S<16;)v.push(parseInt(y[S],10)|parseInt(b[S],10)^255),S++;return new this(v)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},g.IPv6.isIPv6=function(h){return this.parser(h)!==null},g.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let _=this.parser(h);return new this(_.parts,_.zoneId),!0}catch{return!1}},g.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},g.IPv6.networkAddressFromCIDR=function(h){let _,y,b,v,S;try{for(_=this.parseCIDR(h),b=_[0].toByteArray(),S=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(b[y],10)&parseInt(S[y],10)),y++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},g.IPv6.parse=function(h){let _=this.parser(h);if(_.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(_.parts,_.zoneId)},g.IPv6.parseCIDR=function(h){let _,y,b;if((y=h.match(/^(.+)\/(\d+)$/))&&(_=parseInt(y[2]),_>=0&&_<=128))return b=[this.parse(y[1]),_],Object.defineProperty(b,"toString",{value:a(function(){return this.join("/")},"value")}),b;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},g.IPv6.parser=function(h){let _,y,b,v,S,M;if(b=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(c.native.test(h))return u(h,8);if((b=h.match(c.transitional))&&(M=b[6]||"",_=b[1],b[1].endsWith("::")||(_=_.slice(0,-1)),_=u(_+M,6),_.parts)){for(S=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],y=0;y<S.length;y++)if(v=S[y],!(0<=v&&v<=255))return null;return _.parts.push(S[0]<<8|S[1]),_.parts.push(S[2]<<8|S[3]),{parts:_.parts,zoneId:_.zoneId}}return null},g.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,b=Math.floor(h/8);for(;y<b;)_[y]=255,y++;return b<16&&(_[b]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},g.fromByteArray=function(h){let _=h.length;if(_===4)return new g.IPv4(h);if(_===16)return new g.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},g.isValid=function(h){return g.IPv6.isValid(h)||g.IPv4.isValid(h)},g.isValidCIDR=function(h){return g.IPv6.isValidCIDR(h)||g.IPv4.isValidCIDR(h)},g.parse=function(h){if(g.IPv6.isValid(h))return g.IPv6.parse(h);if(g.IPv4.isValid(h))return g.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},g.parseCIDR=function(h){try{return g.IPv6.parseCIDR(h)}catch{try{return g.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},g.process=function(h){let _=this.parse(h);return _.kind()==="ipv6"&&_.isIPv4MappedAddress()?_.toIPv4Address():_},g.subnetMatch=function(h,_,y){let b,v,S,M;y==null&&(y="unicast");for(v in _)if(Object.prototype.hasOwnProperty.call(_,v)){for(S=_[v],S[0]&&!(S[0]instanceof Array)&&(S=[S]),b=0;b<S.length;b++)if(M=S[b],h.kind()===M[0].kind()&&h.match.apply(h,M))return v}return y},typeof Sd<"u"&&Sd.exports?Sd.exports=g:e.ipaddr=g})(II)});var Pd=me(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.parseControlResponse=HN;ho.isSingleLine=Sv;ho.isMultiline=wv;ho.positiveCompletion=jN;ho.positiveIntermediate=WN;var ky=`
2
+ `;function HN(e){let t=e.split(/\r?\n/).filter(qN),r=[],i=0,n;for(let s=0;s<t.length;s++){let c=t[s];if(n)n.test(c)&&(n=void 0,r.push(t.slice(i,s+1).join(ky)));else if(wv(c)){let u=c.substr(0,3);n=new RegExp(`^${u}(?:$| )`),i=s}else Sv(c)&&r.push(c)}let o=n?t.slice(i).join(ky)+ky:"";return{messages:r,rest:o}}a(HN,"parseControlResponse");function Sv(e){return/^\d\d\d(?:$| )/.test(e)}a(Sv,"isSingleLine");function wv(e){return/^\d\d\d-/.test(e)}a(wv,"isMultiline");function jN(e){return e>=200&&e<300}a(jN,"positiveCompletion");function WN(e){return e>=300&&e<400}a(WN,"positiveIntermediate");function qN(e){return e.trim()!==""}a(qN,"isNotBlank")});var Ry=me(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.FTPContext=Es.FTPError=void 0;var VN=require("net"),ZN=require("tls"),QN=Pd(),Td=class extends Error{static{a(this,"FTPError")}constructor(t){super(t.message),this.name=this.constructor.name,this.code=t.code}};Es.FTPError=Td;function Pv(){}a(Pv,"doNothing");var KN=2**16,Cy=class{static{a(this,"FTPContext")}constructor(t=0,r="utf8"){this.timeout=t,this.verbose=!1,this.ipFamily=void 0,this.tlsOptions={},this.tlsSessionStore=void 0,this._partialResponse="",this._encoding=r,this._socket=this.socket=this._newSocket(),this._dataSocket=void 0}close(){let t=this._task?"User closed client during task":"User closed client",r=new Error(t);this.closeWithError(r)}closeWithError(t){this._closingError||(this._closingError=t,this._closeControlSocket(),this._closeSocket(this._dataSocket),this._passToHandler(t),this._stopTrackingTask())}get closed(){return this.socket.remoteAddress===void 0||this._closingError!==void 0}reset(){this.socket=this._newSocket()}get socket(){return this._socket}set socket(t){this.dataSocket=void 0,this.tlsOptions={},this.tlsSessionStore=void 0,this._partialResponse="",this._socket&&(t.localPort===this._socket.localPort?this._removeSocketListeners(this.socket):this._closeControlSocket()),t&&(this._closingError=void 0,t.setTimeout(0),t.setEncoding(this._encoding),t.setKeepAlive(!0),t.on("data",r=>this._onControlSocketData(r)),t.on("end",()=>this.closeWithError(new Error("Server sent FIN packet unexpectedly, closing connection."))),t.on("close",r=>{r||this.closeWithError(new Error("Server closed connection unexpectedly."))}),this._setupDefaultErrorHandlers(t,"control socket"),t instanceof ZN.TLSSocket&&t.on("session",r=>{this.tlsSessionStore=r})),this._socket=t}get dataSocket(){return this._dataSocket}set dataSocket(t){this._closeSocket(this._dataSocket),t&&(t.setTimeout(0),this._setupDefaultErrorHandlers(t,"data socket")),this._dataSocket=t}get encoding(){return this._encoding}set encoding(t){this._encoding=t,this.socket&&this.socket.setEncoding(t)}send(t){if(/[\r\n\0]/.test(t))throw new Error(`Invalid command: Contains control characters. (${t})`);let i=t.startsWith("PASS")?"> PASS ###":`> ${t}`;this.log(i),this._socket.write(t+`\r
3
+ `,this.encoding)}request(t){return this.handle(t,(r,i)=>{r instanceof Error?i.reject(r):i.resolve(r)})}handle(t,r){if(this._task){let i=new Error("User launched a task while another one is still running. Forgot to use 'await' or '.then()'?");i.stack+=`
4
+ Running task launched at: ${this._task.stack}`,this.closeWithError(i)}return new Promise((i,n)=>{let o=!1,s=a(()=>{o||(o=!0,this._stopTrackingTask())},"stopTrackingOnce");if(this._task={stack:new Error().stack||"Unknown call stack",responseHandler:r,resolver:{resolve:a(c=>{s(),i(c)},"resolve"),reject:a(c=>{s(),n(c)},"reject")}},this._closingError){let c=new Error(`Client is closed because ${this._closingError.message}`);c.stack+=`
5
+ Closing reason: ${this._closingError.stack}`,c.code=this._closingError.code!==void 0?this._closingError.code:"0",this._passToHandler(c);return}this.socket.setTimeout(this.timeout),t&&this.send(t)})}log(t){this.verbose&&console.log(t)}get hasTLS(){return"encrypted"in this._socket}_stopTrackingTask(){this.socket.setTimeout(0),this._task=void 0}_onControlSocketData(t){if(this.log(`< ${t}`),this._partialResponse.length+t.length>KN){this.closeWithError(new Error("FTP control response exceeded maximum allowed size"));return}let r=this._partialResponse+t,i=(0,QN.parseControlResponse)(r);this._partialResponse=i.rest;for(let n of i.messages){let o=parseInt(n.substr(0,3),10),s={code:o,message:n},c=o>=400?new Td(s):void 0;this._passToHandler(c||s)}}_passToHandler(t){this._task&&this._task.responseHandler(t,this._task.resolver)}_setupDefaultErrorHandlers(t,r){t.once("error",i=>{i.message+=` (${r})`,this.closeWithError(i)}),t.once("close",i=>{i&&this.closeWithError(new Error(`Socket closed due to transmission error (${r})`))}),t.once("timeout",()=>{t.destroy(),this.closeWithError(new Error(`Timeout (${r})`))})}_closeControlSocket(){this._removeSocketListeners(this._socket),this._socket.on("error",Pv),this.send("QUIT"),this._closeSocket(this._socket)}_closeSocket(t){t&&(this._removeSocketListeners(t),t.on("error",Pv),t.destroy())}_removeSocketListeners(t){t.removeAllListeners(),t.removeAllListeners("timeout"),t.removeAllListeners("data"),t.removeAllListeners("end"),t.removeAllListeners("error"),t.removeAllListeners("close"),t.removeAllListeners("connect")}_newSocket(){return new VN.Socket}};Es.FTPContext=Cy});var Oy=me(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.describeTLS=GN;go.describeAddress=YN;go.upgradeSocket=XN;go.isLoopback=JN;go.ipIsPrivateV4Address=e$;var Tv=require("tls");function GN(e){if(e instanceof Tv.TLSSocket){let t=e.getProtocol();return t||"Server socket or disconnected client socket"}return"No encryption"}a(GN,"describeTLS");function YN(e){return e.remoteFamily==="IPv6"?`[${e.remoteAddress}]:${e.remotePort}`:`${e.remoteAddress}:${e.remotePort}`}a(YN,"describeAddress");function XN(e,t){return new Promise((r,i)=>{let n=Object.assign({},t,{socket:e}),o=(0,Tv.connect)(n,()=>{n.rejectUnauthorized!==!1&&!o.authorized?i(o.authorizationError):(o.removeAllListeners("error"),r(o))}).once("error",s=>{i(s)})})}a(XN,"upgradeSocket");function JN(e){return e==="::1"||e.startsWith("127.")}a(JN,"isLoopback");function e$(e=""){e.startsWith("::ffff:")&&(e=e.substr(7));let t=e.split(".").map(r=>parseInt(r,10));return t[0]===10||t[0]===172&&t[1]>=16&&t[1]<=31||t[0]===192&&t[1]===168||e==="127.0.0.1"}a(e$,"ipIsPrivateV4Address")});var tu=me(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.FileInfo=bs.FileType=void 0;var As;(function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=3]="SymbolicLink"})(As||(bs.FileType=As={}));var kd=class{static{a(this,"FileInfo")}constructor(t){this.name=t,this.type=As.Unknown,this.size=0,this.rawModifiedAt="",this.modifiedAt=void 0,this.permissions=void 0,this.hardLinkCount=void 0,this.link=void 0,this.group=void 0,this.user=void 0,this.uniqueID=void 0,this.name=t}get isDirectory(){return this.type===As.Directory}get isSymbolicLink(){return this.type===As.SymbolicLink}get isFile(){return this.type===As.File}get date(){return this.rawModifiedAt}set date(t){this.rawModifiedAt=t}};bs.FileInfo=kd;kd.UnixPermission={Read:4,Write:2,Execute:1}});var Cv=me(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.testLine=t$;ru.parseLine=r$;ru.transformList=n$;var Ny=tu(),kv=new RegExp("^\\s*(\\S+)\\s+(\\S+)\\s+(?:(<DIR>)|([0-9]+))\\s+(\\S.*)");function t$(e){return/^\d{2}/.test(e)&&kv.test(e)}a(t$,"testLine");function r$(e){let t=e.match(kv);if(t===null)return;let r=t[5];if(r==="."||r==="..")return;let i=new Ny.FileInfo(r);return t[3]==="<DIR>"?(i.type=Ny.FileType.Directory,i.size=0):(i.type=Ny.FileType.File,i.size=parseInt(t[4],10)),i.rawModifiedAt=t[1]+" "+t[2],i}a(r$,"parseLine");function n$(e){return e}a(n$,"transformList")});var Ov=me(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.testLine=a$;nu.parseLine=c$;nu.transformList=u$;var Rn=tu(),i$="\u6708",o$="\u65E5",s$="\u5E74",Rv=new RegExp("^[\\s\\d]*([bcdelfmpSs-])(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]?)))\\+?\\s*(\\d+)\\s+(?:(\\S+(?:\\s\\S+){0,7}?)\\s+)?(?:(\\S+(?:\\s\\S+){0,7})\\s+)?(\\d+(?:,\\s*\\d+)?)\\s+((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3})|(?:\\d{1,2}"+i$+"\\s+\\d{1,2}"+o$+"))\\s+((?:\\d+(?::\\d+)?)|(?:\\d{4}"+s$+"))\\s(.*)");function a$(e){return Rv.test(e)}a(a$,"testLine");function c$(e){let t=e.match(Rv);if(t===null)return;let r=t[21];if(r==="."||r==="..")return;let i=new Rn.FileInfo(r);switch(i.size=parseInt(t[18],10),i.user=t[16],i.group=t[17],i.hardLinkCount=parseInt(t[15],10),i.rawModifiedAt=t[19]+" "+t[20],i.permissions={user:$y(t[4],t[5],t[6]),group:$y(t[8],t[9],t[10]),world:$y(t[12],t[13],t[14])},t[1].charAt(0)){case"d":i.type=Rn.FileType.Directory;break;case"e":i.type=Rn.FileType.SymbolicLink;break;case"l":i.type=Rn.FileType.SymbolicLink;break;case"b":case"c":i.type=Rn.FileType.File;break;case"f":case"-":i.type=Rn.FileType.File;break;default:i.type=Rn.FileType.Unknown}if(i.isSymbolicLink){let n=r.indexOf(" -> ");n!==-1&&(i.name=r.substring(0,n),i.link=r.substring(n+4))}return i}a(c$,"parseLine");function u$(e){return e}a(u$,"transformList");function $y(e,t,r){let i=0;e!=="-"&&(i+=Rn.FileInfo.UnixPermission.Read),t!=="-"&&(i+=Rn.FileInfo.UnixPermission.Write);let n=r.charAt(0);return n!=="-"&&n.toUpperCase()!==n&&(i+=Rn.FileInfo.UnixPermission.Execute),i}a($y,"parseMode")});var Dy=me(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.testLine=f$;Is.parseLine=d$;Is.transformList=p$;Is.parseMLSxDate=Dv;var xs=tu();function Nv(e,t){t.size=parseInt(e,10)}a(Nv,"parseSize");var l$={size:Nv,sizd:Nv,unique:a((e,t)=>{t.uniqueID=e},"unique"),modify:a((e,t)=>{t.modifiedAt=Dv(e),t.rawModifiedAt=t.modifiedAt.toISOString()},"modify"),type:a((e,t)=>{if(e.startsWith("OS.unix=slink"))return t.type=xs.FileType.SymbolicLink,t.link=e.substr(e.indexOf(":")+1),1;switch(e){case"file":t.type=xs.FileType.File;break;case"dir":t.type=xs.FileType.Directory;break;case"OS.unix=symlink":t.type=xs.FileType.SymbolicLink;break;case"cdir":case"pdir":return 2;default:t.type=xs.FileType.Unknown}return 1},"type"),"unix.mode":a((e,t)=>{let r=e.substr(-3);t.permissions={user:parseInt(r[0],10),group:parseInt(r[1],10),world:parseInt(r[2],10)}},"unix.mode"),"unix.ownername":a((e,t)=>{t.user=e},"unix.ownername"),"unix.owner":a((e,t)=>{t.user===void 0&&(t.user=e)},"unix.owner"),get"unix.uid"(){return this["unix.owner"]},"unix.groupname":a((e,t)=>{t.group=e},"unix.groupname"),"unix.group":a((e,t)=>{t.group===void 0&&(t.group=e)},"unix.group"),get"unix.gid"(){return this["unix.group"]}};function $v(e,t){let r=e.indexOf(t),i=e.substr(0,r),n=e.substr(r+t.length);return[i,n]}a($v,"splitStringOnce");function f$(e){return/^\S+=\S+;/.test(e)||e.startsWith(" ")}a(f$,"testLine");function d$(e){let[t,r]=$v(e," ");if(r===""||r==="."||r==="..")return;let i=new xs.FileInfo(r),n=t.split(";");for(let o of n){let[s,c]=$v(o,"=");if(!c)continue;let u=l$[s.toLowerCase()];if(!u)continue;if(u(c,i)===2)return}return i}a(d$,"parseLine");function p$(e){let t=new Map;for(let i of e)!i.isSymbolicLink&&i.uniqueID!==void 0&&t.set(i.uniqueID,i);let r=[];for(let i of e){if(i.isSymbolicLink&&i.uniqueID!==void 0&&i.link===void 0){let o=t.get(i.uniqueID);o!==void 0&&(i.link=o.name)}!i.name.includes("/")&&r.push(i)}return r}a(p$,"transformList");function Dv(e){return new Date(Date.UTC(+e.slice(0,4),+e.slice(4,6)-1,+e.slice(6,8),+e.slice(8,10),+e.slice(10,12),+e.slice(12,14),+e.slice(15,18)))}a(Dv,"parseMLSxDate")});var zy=me(Kn=>{"use strict";var h$=Kn&&Kn.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return t[r]},"get")}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),g$=Kn&&Kn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),By=Kn&&Kn.__importStar||(function(){var e=a(function(t){return e=Object.getOwnPropertyNames||function(r){var i=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i[i.length]=n);return i},e(t)},"ownKeys");return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var i=e(t),n=0;n<i.length;n++)i[n]!=="default"&&h$(r,t,i[n]);return g$(r,t),r}})();Object.defineProperty(Kn,"__esModule",{value:!0});Kn.parseList=v$;var m$=By(Cv()),_$=By(Ov()),y$=By(Dy()),E$=[m$,_$,y$];function A$(e,t){return t.find(r=>r.testLine(e)===!0)}a(A$,"firstCompatibleParser");function b$(e){return e.trim()!==""}a(b$,"isNotBlank");function x$(e){return!e.startsWith("total")}a(x$,"isNotMeta");var I$=/\r?\n/;function v$(e){let t=e.split(I$).filter(b$).filter(x$);if(t.length===0)return[];let r=t[t.length-1],i=A$(r,E$);if(!i)throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing. Your FTP server seems to be using another format. You can see the transmitted listing when setting `client.ftp.verbose = true`. You can then provide a custom parser to `client.parseList`, see the documentation for details.");let n=t.map(i.parseLine).filter(o=>o!==void 0);return i.transformList(n)}a(v$,"parseList")});var Bv=me(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.ProgressTracker=void 0;var Ly=class{static{a(this,"ProgressTracker")}constructor(){this.bytesOverall=0,this.intervalMs=500,this.onStop=Cd,this.onHandle=Cd}reportTo(t=Cd){this.onHandle=t}start(t,r,i){let n=0;this.onStop=S$(this.intervalMs,()=>{let o=t.bytesRead+t.bytesWritten;this.bytesOverall+=o-n,n=o,this.onHandle({name:r,type:i,bytes:o,bytesOverall:this.bytesOverall})})}stop(){this.onStop(!1)}updateAndStop(){this.onStop(!0)}};Rd.ProgressTracker=Ly;function S$(e,t){let r=setInterval(t,e),i=a(n=>{clearInterval(r),n&&t(),t=Cd},"stopFunc");return t(),i}a(S$,"poll");function Cd(){}a(Cd,"noop")});var zv=me(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.StringWriter=void 0;var w$=require("stream"),Uy=class extends w$.Writable{static{a(this,"StringWriter")}constructor(t=1*1024*1024){super(),this.maxByteLength=t,this.byteLength=0,this.bufs=[]}_write(t,r,i){if(!(t instanceof Buffer)){i(new Error("StringWriter: expects chunks of type 'Buffer'."));return}if(this.byteLength+t.byteLength>this.maxByteLength){i(new Error(`StringWriter: Maximum bytes exceeded, maxByteLength=${this.maxByteLength}.`));return}this.byteLength+=t.byteLength,this.bufs.push(t),i(null)}getText(t){return Buffer.concat(this.bufs).toString(t)}};Od.StringWriter=Uy});var Uv=me(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.TransferWatchdog=void 0;var P$=500,T$=4,My=class{static{a(this,"TransferWatchdog")}constructor(){this.timer=void 0}start(t,r,i,n){if(this.stop(),i<=0)return;let o=Math.max(1,Math.min(Math.floor(i/T$),P$)),s=Lv(t),c=0,u=0;this.timer=setInterval(()=>{let l=Lv(t),f=l!==s;if(s=l,!k$(t,r)){c=0,u=i;return}if(f){c=0,u=0;return}c+=o,c>=i+u&&(this.stop(),n())},o),this.timer.unref()}stop(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}};Nd.TransferWatchdog=My;function Lv(e){return e.bytesRead+e.bytesWritten}a(Lv,"countBytes");function k$(e,t){return t==="download"?!e.isPaused():e.writableLength>0}a(k$,"isWaitingForServer")});var Hy=me(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.enterPassiveModeIPv6=R$;On.parseEpsvResponse=Hv;On.enterPassiveModeIPv4=O$;On.enterPassiveModeIPv4_forceControlHostIP=N$;On.parsePasvResponse=Fy;On.connectForPassiveTransfer=Bd;On.uploadFrom=$$;On.downloadTo=D$;var Fv=require("stream"),Mv=require("tls"),C$=Uv(),Ii=Oy(),$d=Pd();async function R$(e){let t=await e.request("EPSV"),r=Hv(t.message);if(!r)throw new Error("Can't parse EPSV response: "+t.message);let i=e.socket.remoteAddress;if(i===void 0)throw new Error("Control socket is disconnected, can't get remote address.");return await Bd(i,r,e),t}a(R$,"enterPassiveModeIPv6");function Hv(e){let t=e.match(/[|!]{3}(.+)[|!]/);if(t===null||t[1]===void 0)throw new Error(`Can't parse response to 'EPSV': ${e}`);let r=parseInt(t[1],10);if(Number.isNaN(r))throw new Error(`Can't parse response to 'EPSV', port is not a number: ${e}`);return r}a(Hv,"parseEpsvResponse");async function O$(e){let t=await e.request("PASV"),r=Fy(t.message);if(!r)throw new Error("Can't parse PASV response: "+t.message);let i=e.socket.remoteAddress;return(0,Ii.ipIsPrivateV4Address)(r.host)&&i&&!(0,Ii.ipIsPrivateV4Address)(i)&&(r.host=i),await Bd(r.host,r.port,e),t}a(O$,"enterPassiveModeIPv4");async function N$(e){let t=await e.request("PASV"),r=Fy(t.message);if(!r)throw new Error("Can't parse PASV response: "+t.message);let i=e.socket.remoteAddress;if(i===void 0)throw new Error("Control socket is disconnected, can't get remote address.");let n=i.replace(/^::ffff:/i,"");if(!(n===r.host||(0,Ii.isLoopback)(n)&&(0,Ii.isLoopback)(r.host)))throw new Error(`PASV returned another host (${r.host}) for data transfer that you have connected to (${i}). Even though the FTP protocol allows this, basic-ftp disables this feature by default for security reasons. If you do need this feature, instantiate the Client with the optional paramter "allowSeparateTransferHost: true". See the README documentation for more information.`);return await Bd(n,r.port,e),t}a(N$,"enterPassiveModeIPv4_forceControlHostIP");function Fy(e){let t=e.match(/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/);if(t===null||t.length!==4)throw new Error(`Can't parse response to 'PASV': ${e}`);return{host:t[1].replace(/,/g,"."),port:(parseInt(t[2],10)&255)*256+(parseInt(t[3],10)&255)}}a(Fy,"parsePasvResponse");function Bd(e,t,r){return new Promise((i,n)=>{let o=r._newSocket(),s=o,c=a(function(l){l.message="Can't open data connection in passive mode: "+l.message,n(l)},"handleConnErr"),u=a(function(){s.destroy(),n(new Error(`Timeout when trying to open data connection to ${e}:${t}`))},"handleTimeout");s.setTimeout(r.timeout),s.on("error",c),s.on("timeout",u),s.connect({port:t,host:e,family:r.ipFamily},()=>{var l;if(r.socket instanceof Mv.TLSSocket){let f=(0,Mv.connect)(Object.assign({},r.tlsOptions,{socket:o,session:(l=r.tlsSessionStore)!==null&&l!==void 0?l:r.socket.getSession()}));f.on("session",p=>{r.tlsSessionStore=p}),s=f}o.setTimeout(0),s.removeListener("error",c),s.removeListener("timeout",u),r.dataSocket=s,i()})})}a(Bd,"connectForPassiveTransfer");var Dd=class{static{a(this,"TransferResolver")}constructor(t,r){this.ftp=t,this.progress=r,this.response=void 0,this.dataTransferDone=!1,this.taskSettled=!1,this.watchdog=new C$.TransferWatchdog}onDataStart(t,r){if(this.ftp.dataSocket===void 0)throw new Error("Data transfer should start but there is no data connection.");this.ftp.socket.setTimeout(0),this.ftp.dataSocket.setTimeout(0),this.watchdog.start(this.ftp.dataSocket,r==="upload"?"upload":"download",this.ftp.timeout,()=>{this.ftp.closeWithError(new Error("Timeout (data socket)"))}),this.progress.start(this.ftp.dataSocket,t,r)}onDataDone(t){this.taskSettled||(this.watchdog.stop(),this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.dataTransferDone=!0,this.tryResolve(t))}onControlDone(t,r){this.response=r,this.tryResolve(t)}onError(t,r){this.taskSettled||(this.taskSettled=!0,this.watchdog.stop(),this.progress.updateAndStop(),this.ftp.socket.setTimeout(this.ftp.timeout),this.ftp.dataSocket=void 0,t.reject(r))}onUnexpectedRequest(t){let r=new Error(`Unexpected FTP response is requesting an answer: ${t.message}`);this.ftp.closeWithError(r)}tryResolve(t){this.dataTransferDone&&this.response!==void 0&&(this.taskSettled=!0,this.ftp.dataSocket=void 0,t.resolve(this.response))}};function $$(e,t){let r=new Dd(t.ftp,t.tracker),i=`${t.command} ${t.remotePath}`,n=!1;return t.ftp.handle(i,(o,s)=>{if(o instanceof Error)r.onError(s,o);else if(o.code===150||o.code===125){if(n)return;n=!0;let c=t.ftp.dataSocket;if(!c){r.onError(s,new Error("Upload should begin but no data connection is available."));return}let u="getCipher"in c?c.getCipher()!==void 0:!0;B$(u,c,"secureConnect",()=>{t.ftp.log(`Uploading to ${(0,Ii.describeAddress)(c)} (${(0,Ii.describeTLS)(c)})`),r.onDataStart(t.remotePath,t.type),(0,Fv.pipeline)(e,c,l=>{l?r.onError(s,l):r.onDataDone(s)})})}else(0,$d.positiveCompletion)(o.code)?r.onControlDone(s,o):(0,$d.positiveIntermediate)(o.code)&&r.onUnexpectedRequest(o)})}a($$,"uploadFrom");function D$(e,t){if(!t.ftp.dataSocket)throw new Error("Download will be initiated but no data connection is available.");let r=new Dd(t.ftp,t.tracker),i=!1;return t.ftp.handle(t.command,(n,o)=>{if(n instanceof Error)r.onError(o,n);else if(n.code===150||n.code===125){if(i)return;i=!0;let s=t.ftp.dataSocket;if(!s){r.onError(o,new Error("Download should begin but no data connection is available."));return}t.ftp.log(`Downloading from ${(0,Ii.describeAddress)(s)} (${(0,Ii.describeTLS)(s)})`),r.onDataStart(t.remotePath,t.type),(0,Fv.pipeline)(s,e,c=>{c?r.onError(o,c):r.onDataDone(o)})}else n.code===350?t.ftp.send("RETR "+t.remotePath):(0,$d.positiveCompletion)(n.code)?r.onControlDone(o,n):(0,$d.positiveIntermediate)(n.code)&&r.onUnexpectedRequest(n)})}a(D$,"downloadTo");function B$(e,t,r,i){e===!0?i():t.once(r,()=>i())}a(B$,"onConditionOrEvent")});var Zv=me(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.Client=void 0;var Gn=require("fs"),jy=require("path"),z$=require("tls"),_o=require("util"),iu=Ry(),mo=Oy(),Wy=Pd(),L$=zy(),U$=Dy(),M$=Bv(),F$=zv(),vs=Hy(),H$=(0,_o.promisify)(Gn.readdir),j$=(0,_o.promisify)(Gn.mkdir),qy=(0,_o.promisify)(Gn.stat),W$=(0,_o.promisify)(Gn.fstat),jv=(0,_o.promisify)(Gn.open),Wv=(0,_o.promisify)(Gn.close),q$=(0,_o.promisify)(Gn.unlink),qv={allowSeparateTransferHost:!1,maxListingBytes:40*1024*1024},Vv=a(()=>["LIST -a","LIST"],"LIST_COMMANDS_DEFAULT"),V$=a(()=>["MLSD","LIST -a","LIST"],"LIST_COMMANDS_MLSD"),Vy=class{static{a(this,"Client")}constructor(t=3e4,r=qv){this.availableListCommands=Vv();let i={...qv,...r};this.ftp=new iu.FTPContext(t),this.prepareTransfer=this._enterFirstCompatibleMode([vs.enterPassiveModeIPv6,i.allowSeparateTransferHost?vs.enterPassiveModeIPv4:vs.enterPassiveModeIPv4_forceControlHostIP]),this.options=i,this.parseList=L$.parseList,this._progressTracker=new M$.ProgressTracker}close(){this.ftp.close(),this._progressTracker.stop()}get closed(){return this.ftp.closed}connect(t="localhost",r=21){return this.ftp.reset(),this.ftp.socket.connect({host:t,port:r,family:this.ftp.ipFamily},()=>this.ftp.log(`Connected to ${(0,mo.describeAddress)(this.ftp.socket)} (${(0,mo.describeTLS)(this.ftp.socket)})`)),this._handleConnectResponse()}connectImplicitTLS(t="localhost",r=21,i={}){var n;return this.ftp.reset(),i.host=(n=i.host)!==null&&n!==void 0?n:t,this.ftp.socket=(0,z$.connect)(r,t,i,()=>this.ftp.log(`Connected to ${(0,mo.describeAddress)(this.ftp.socket)} (${(0,mo.describeTLS)(this.ftp.socket)})`)),this.ftp.tlsOptions=i,this._handleConnectResponse()}_handleConnectResponse(){return this.ftp.handle(void 0,(t,r)=>{t instanceof Error?r.reject(t):(0,Wy.positiveCompletion)(t.code)?r.resolve(t):r.reject(new iu.FTPError(t))})}send(t,r=!1){return r?(this.ftp.log("Deprecated call using send(command, flag) with boolean flag to ignore errors. Use sendIgnoringError(command)."),this.sendIgnoringError(t)):this.ftp.request(t)}sendIgnoringError(t){return this.ftp.handle(t,(r,i)=>{r instanceof iu.FTPError?i.resolve({code:r.code,message:r.message}):r instanceof Error?i.reject(r):i.resolve(r)})}async useTLS(t={},r="AUTH TLS"){let i=await this.send(r);return this.ftp.socket=await(0,mo.upgradeSocket)(this.ftp.socket,t),this.ftp.tlsOptions=t,this.ftp.log(`Control socket is using: ${(0,mo.describeTLS)(this.ftp.socket)}`),i}login(t="anonymous",r="guest"){return this.ftp.log(`Login security: ${(0,mo.describeTLS)(this.ftp.socket)}`),this.ftp.handle("USER "+t,(i,n)=>{i instanceof Error?n.reject(i):(0,Wy.positiveCompletion)(i.code)?n.resolve(i):i.code===331?this.ftp.send("PASS "+r):n.reject(new iu.FTPError(i))})}async useDefaultSettings(){let r=(await this.features()).has("MLST");this.availableListCommands=r?V$():Vv(),await this.send("TYPE I"),await this.sendIgnoringError("STRU F"),await this.sendIgnoringError("OPTS UTF8 ON"),r&&await this.sendIgnoringError("OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;"),this.ftp.hasTLS&&(await this.sendIgnoringError("PBSZ 0"),await this.sendIgnoringError("PROT P"))}async access(t={}){var r,i;let n=t.secure===!0,o=t.secure==="implicit",s;if(o?s=await this.connectImplicitTLS(t.host,t.port,t.secureOptions):s=await this.connect(t.host,t.port),n){let c=(r=t.secureOptions)!==null&&r!==void 0?r:{};c.host=(i=c.host)!==null&&i!==void 0?i:t.host,await this.useTLS(c)}return await this.sendIgnoringError("OPTS UTF8 ON"),await this.login(t.user,t.password),await this.useDefaultSettings(),s}async pwd(){let t=await this.send("PWD"),r=t.message.match(/"(.+)"/);if(r===null||r[1]===void 0)throw new Error(`Can't parse response to command 'PWD': ${t.message}`);return r[1]}async features(){let t=await this.sendIgnoringError("FEAT"),r=new Map;return t.code<400&&(0,Wy.isMultiline)(t.message)&&t.message.split(`
6
+ `).slice(1,-1).forEach(i=>{let n=i.trim().split(" ");r.set(n[0],n[1]||"")}),r}async cd(t){let r=await this.protectWhitespace(t);return this.send("CWD "+r)}async cdup(){return this.send("CDUP")}async lastMod(t){let r=await this.protectWhitespace(t),n=(await this.send(`MDTM ${r}`)).message.slice(4);return(0,U$.parseMLSxDate)(n)}async size(t){let i=`SIZE ${await this.protectWhitespace(t)}`,n=await this.send(i),o=parseInt(n.message.slice(4),10);if(Number.isNaN(o))throw new Error(`Can't parse response to command '${i}' as a numerical value: ${n.message}`);return o}async rename(t,r){let i=await this.protectWhitespace(t),n=await this.protectWhitespace(r);return await this.send("RNFR "+i),this.send("RNTO "+n)}async remove(t,r=!1){let i=await this.protectWhitespace(t);return r?this.sendIgnoringError(`DELE ${i}`):this.send(`DELE ${i}`)}trackProgress(t){this._progressTracker.bytesOverall=0,this._progressTracker.reportTo(t)}async uploadFrom(t,r,i={}){return this._uploadWithCommand(t,r,"STOR",i)}async appendFrom(t,r,i={}){return this._uploadWithCommand(t,r,"APPE",i)}async _uploadWithCommand(t,r,i,n){return typeof t=="string"?this._uploadLocalFile(t,r,i,n):this._uploadFromStream(t,r,i)}async _uploadLocalFile(t,r,i,n){let o=await jv(t,"r"),s=(0,Gn.createReadStream)("",{fd:o,start:n.localStart,end:n.localEndInclusive,autoClose:!1});try{let c=await Q$(o,n),u=await this._uploadFromStream(s,r,i);if(c!==void 0&&s.bytesRead!==c)throw new Error(`Local file "${t}" changed while it was being uploaded to "${r}": expected to send ${c} bytes but sent ${s.bytesRead}. The remote file is incomplete.`);return u}finally{await ou(()=>Wv(o))}}async _uploadFromStream(t,r,i){let n=a(o=>this.ftp.closeWithError(o),"onError");t.once("error",n);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,vs.uploadFrom)(t,{ftp:this.ftp,tracker:this._progressTracker,command:i,remotePath:o,type:"upload"})}finally{t.removeListener("error",n)}}async downloadTo(t,r,i=0){return typeof t=="string"?this._downloadToFile(t,r,i):this._downloadToStream(t,r,i)}async _downloadToFile(t,r,i){let n=i>0,s=await jv(t,n?"r+":"w"),c=(0,Gn.createWriteStream)("",{fd:s,start:i,autoClose:!1});try{return await this._downloadToStream(c,r,i)}catch(u){let l=await ou(()=>qy(t)),f=l&&l.size>0;throw!n&&!f&&await ou(()=>q$(t)),u}finally{await ou(()=>Wv(s))}}async _downloadToStream(t,r,i){let n=a(o=>this.ftp.closeWithError(o),"onError");t.once("error",n);try{let o=await this.protectWhitespace(r);return await this.prepareTransfer(this.ftp),await(0,vs.downloadTo)(t,{ftp:this.ftp,tracker:this._progressTracker,command:i>0?`REST ${i}`:`RETR ${o}`,remotePath:o,type:"download"})}finally{t.removeListener("error",n),t.end()}}async list(t=""){let r=await this.protectWhitespace(t),i;for(let n of this.availableListCommands){let o=r===""?n:`${n} ${r}`;await this.prepareTransfer(this.ftp);try{let s=await this._requestListWithCommand(o);return this.availableListCommands=[n],s}catch(s){if(!(s instanceof iu.FTPError))throw s;i=s}}throw i}async _requestListWithCommand(t){let r=new F$.StringWriter(this.options.maxListingBytes);await(0,vs.downloadTo)(r,{ftp:this.ftp,tracker:this._progressTracker,command:t,remotePath:"",type:"list"});let i=r.getText(this.ftp.encoding);return this.ftp.log(i),this.parseList(i)}async removeDir(t){return this._exitAtCurrentDirectory(async()=>{await this.cd(t);let r=await this.pwd();await this.clearWorkingDir(),r==="/"||(await this.cdup(),await this.removeEmptyDir(r))})}async clearWorkingDir(){for(let t of await this.list())t.isDirectory?(await this.cd(t.name),await this.clearWorkingDir(),await this.cdup(),await this.removeEmptyDir(t.name)):await this.remove(t.name)}async uploadFromDir(t,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.ensureDir(r),await this._uploadToWorkingDir(t)))}async _uploadToWorkingDir(t){let r=await H$(t);for(let i of r){let n=(0,jy.join)(t,i),o=await qy(n);o.isFile()?await this.uploadFrom(n,i):o.isDirectory()&&(await this._openDir(i),await this._uploadToWorkingDir(n),await this.cdup())}}async downloadToDir(t,r){return this._exitAtCurrentDirectory(async()=>(r&&await this.cd(r),await this._downloadFromWorkingDir(t)))}async _downloadFromWorkingDir(t){await Z$(t);for(let r of await this.list()){if(!r.name||(0,jy.basename)(r.name)!==r.name){let o=JSON.stringify(r.name);this.ftp.log(`Invalid filename from server listing, will skip file. (${o})`);continue}let n=(0,jy.join)(t,r.name);r.isDirectory?(await this.cd(r.name),await this._downloadFromWorkingDir(n),await this.cdup()):r.isFile&&await this.downloadTo(n,r.name)}}async ensureDir(t){t.startsWith("/")&&await this.cd("/");let r=t.split("/").filter(i=>i!=="");for(let i of r)await this._openDir(i)}async _openDir(t){await this.sendIgnoringError("MKD "+t),await this.cd(t)}async removeEmptyDir(t){let r=await this.protectWhitespace(t);return this.send(`RMD ${r}`)}async protectWhitespace(t){if(!t.startsWith(" "))return t;let r=await this.pwd();return(r.endsWith("/")?r:r+"/")+t}async _exitAtCurrentDirectory(t){let r=await this.pwd();try{return await t()}finally{this.closed||await ou(()=>this.cd(r))}}_enterFirstCompatibleMode(t){return async r=>{r.log("Trying to find optimal transfer strategy...");let i;for(let n of t)try{let o=await n(r);return r.log("Optimal transfer strategy found."),this.prepareTransfer=n,o}catch(o){i=o}throw new Error(`None of the available transfer strategies work. Last error response was '${i}'.`)}}async upload(t,r,i={}){return this.ftp.log("Warning: upload() has been deprecated, use uploadFrom()."),this.uploadFrom(t,r,i)}async append(t,r,i={}){return this.ftp.log("Warning: append() has been deprecated, use appendFrom()."),this.appendFrom(t,r,i)}async download(t,r,i=0){return this.ftp.log("Warning: download() has been deprecated, use downloadTo()."),this.downloadTo(t,r,i)}async uploadDir(t,r){return this.ftp.log("Warning: uploadDir() has been deprecated, use uploadFromDir()."),this.uploadFromDir(t,r)}async downloadDir(t){return this.ftp.log("Warning: downloadDir() has been deprecated, use downloadToDir()."),this.downloadToDir(t)}};zd.Client=Vy;async function Z$(e){try{await qy(e)}catch{await j$(e,{recursive:!0})}}a(Z$,"ensureLocalDirectory");async function Q$(e,t){var r;let i=await W$(e);if(!i.isFile())return;let n=(r=t.localStart)!==null&&r!==void 0?r:0,o=t.localEndInclusive!==void 0?Math.min(t.localEndInclusive+1,i.size):i.size;return Math.max(0,o-n)}a(Q$,"expectedBytesFromLocalFile");async function ou(e){try{return await e()}catch{return}}a(ou,"ignoreError")});var Kv=me(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0})});var Nn=me(Ur=>{"use strict";var K$=Ur&&Ur.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return t[r]},"get")}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),su=Ur&&Ur.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&K$(t,e,r)};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.enterPassiveModeIPv6=Ur.enterPassiveModeIPv4=void 0;su(Zv(),Ur);su(Ry(),Ur);su(tu(),Ur);su(zy(),Ur);su(Kv(),Ur);var Gv=Hy();Object.defineProperty(Ur,"enterPassiveModeIPv4",{enumerable:!0,get:a(function(){return Gv.enterPassiveModeIPv4},"get")});Object.defineProperty(Ur,"enterPassiveModeIPv6",{enumerable:!0,get:a(function(){return Gv.enterPassiveModeIPv6},"get")})});var Ld=me((_Q,Yv)=>{Yv.exports={newInvalidAsn1Error:a(function(e){var t=new Error;return t.name="InvalidAsn1Error",t.message=e||"",t},"newInvalidAsn1Error")}});var Ud=me((EQ,Xv)=>{Xv.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}});var Zy=me((AQ,Jv)=>{"use strict";var Md=require("buffer"),Ss=Md.Buffer,dn={},pn;for(pn in Md)Md.hasOwnProperty(pn)&&(pn==="SlowBuffer"||pn==="Buffer"||(dn[pn]=Md[pn]));var ws=dn.Buffer={};for(pn in Ss)Ss.hasOwnProperty(pn)&&(pn==="allocUnsafe"||pn==="allocUnsafeSlow"||(ws[pn]=Ss[pn]));dn.Buffer.prototype=Ss.prototype;(!ws.from||ws.from===Uint8Array.from)&&(ws.from=function(e,t,r){if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&typeof e.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return Ss(e,t,r)});ws.alloc||(ws.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=Ss(e);return!t||t.length===0?i.fill(0):typeof r=="string"?i.fill(t,r):i.fill(t),i});if(!dn.kStringMaxLength)try{dn.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}dn.constants||(dn.constants={MAX_LENGTH:dn.kMaxLength},dn.kStringMaxLength&&(dn.constants.MAX_STRING_LENGTH=dn.kStringMaxLength));Jv.exports=dn});var rS=me((bQ,tS)=>{var G$=require("assert"),eS=Zy().Buffer,au=Ud(),Y$=Ld(),Ps=Y$.newInvalidAsn1Error;function Mr(e){if(!e||!eS.isBuffer(e))throw new TypeError("data must be a node Buffer");this._buf=e,this._size=e.length,this._len=0,this._offset=0}a(Mr,"Reader");Object.defineProperty(Mr.prototype,"length",{enumerable:!0,get:a(function(){return this._len},"get")});Object.defineProperty(Mr.prototype,"offset",{enumerable:!0,get:a(function(){return this._offset},"get")});Object.defineProperty(Mr.prototype,"remain",{get:a(function(){return this._size-this._offset},"get")});Object.defineProperty(Mr.prototype,"buffer",{get:a(function(){return this._buf.slice(this._offset)},"get")});Mr.prototype.readByte=function(e){if(this._size-this._offset<1)return null;var t=this._buf[this._offset]&255;return e||(this._offset+=1),t};Mr.prototype.peek=function(){return this.readByte(!0)};Mr.prototype.readLength=function(e){if(e===void 0&&(e=this._offset),e>=this._size)return null;var t=this._buf[e++]&255;if(t===null)return null;if((t&128)===128){if(t&=127,t===0)throw Ps("Indefinite length not supported");if(t>4)throw Ps("encoding too long");if(this._size-e<t)return null;this._len=0;for(var r=0;r<t;r++)this._len=(this._len<<8)+(this._buf[e++]&255)}else this._len=t;return e};Mr.prototype.readSequence=function(e){var t=this.peek();if(t===null)return null;if(e!==void 0&&e!==t)throw Ps("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);return r===null?null:(this._offset=r,t)};Mr.prototype.readInt=function(){return this._readTag(au.Integer)};Mr.prototype.readBoolean=function(){return this._readTag(au.Boolean)!==0};Mr.prototype.readEnumeration=function(){return this._readTag(au.Enumeration)};Mr.prototype.readString=function(e,t){e||(e=au.OctetString);var r=this.peek();if(r===null)return null;if(r!==e)throw Ps("Expected 0x"+e.toString(16)+": got 0x"+r.toString(16));var i=this.readLength(this._offset+1);if(i===null||this.length>this._size-i)return null;if(this._offset=i,this.length===0)return t?eS.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")};Mr.prototype.readOID=function(e){e||(e=au.OID);var t=this.readString(e,!0);if(t===null)return null;for(var r=[],i=0,n=0;n<t.length;n++){var o=t[n]&255;i<<=7,i+=o&127,(o&128)===0&&(r.push(i),i=0)}return i=r.shift(),r.unshift(i%40),r.unshift(i/40>>0),r.join(".")};Mr.prototype._readTag=function(e){G$.ok(e!==void 0);var t=this.peek();if(t===null)return null;if(t!==e)throw Ps("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(r===null)return null;if(this.length>4)throw Ps("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,o=0;o<this.length;o++)n<<=8,n|=this._buf[this._offset++]&255;return(i&128)===128&&o!==4&&(n-=1<<o*8),n>>0};tS.exports=Mr});var iS=me((IQ,nS)=>{var vi=require("assert"),Fd=Zy().Buffer,Si=Ud(),X$=Ld(),Hd=X$.newInvalidAsn1Error,J$={size:1024,growthFactor:8};function e4(e,t){vi.ok(e),vi.equal(typeof e,"object"),vi.ok(t),vi.equal(typeof t,"object");var r=Object.getOwnPropertyNames(e);return r.forEach(function(i){if(!t[i]){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n)}}),t}a(e4,"merge");function Or(e){e=e4(J$,e||{}),this._buf=Fd.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}a(Or,"Writer");Object.defineProperty(Or.prototype,"buffer",{get:a(function(){if(this._seq.length)throw Hd(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)},"get")});Or.prototype.writeByte=function(e){if(typeof e!="number")throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e};Or.prototype.writeInt=function(e,t){if(typeof e!="number")throw new TypeError("argument must be a Number");typeof t!="number"&&(t=Si.Integer);for(var r=4;((e&4286578688)===0||(e&4286578688)===-8388608)&&r>1;)r--,e<<=8;if(r>4)throw Hd("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(e&4278190080)>>>24,e<<=8};Or.prototype.writeNull=function(){this.writeByte(Si.Null),this.writeByte(0)};Or.prototype.writeEnumeration=function(e,t){if(typeof e!="number")throw new TypeError("argument must be a Number");return typeof t!="number"&&(t=Si.Enumeration),this.writeInt(e,t)};Or.prototype.writeBoolean=function(e,t){if(typeof e!="boolean")throw new TypeError("argument must be a Boolean");typeof t!="number"&&(t=Si.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0};Or.prototype.writeString=function(e,t){if(typeof e!="string")throw new TypeError("argument must be a string (was: "+typeof e+")");typeof t!="number"&&(t=Si.OctetString);var r=Fd.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)};Or.prototype.writeBuffer=function(e,t){if(typeof t!="number")throw new TypeError("tag must be a number");if(!Fd.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length};Or.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(r){t.writeString(r)})};Or.prototype.writeOID=function(e,t){if(typeof e!="string")throw new TypeError("argument must be a string");if(typeof t!="number"&&(t=Si.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");function r(s,c){c<128?s.push(c):c<16384?(s.push(c>>>7|128),s.push(c&127)):c<2097152?(s.push(c>>>14|128),s.push((c>>>7|128)&255),s.push(c&127)):c<268435456?(s.push(c>>>21|128),s.push((c>>>14|128)&255),s.push((c>>>7|128)&255),s.push(c&127)):(s.push((c>>>28|128)&255),s.push((c>>>21|128)&255),s.push((c>>>14|128)&255),s.push((c>>>7|128)&255),s.push(c&127))}a(r,"encodeOctet");var i=e.split("."),n=[];n.push(parseInt(i[0],10)*40+parseInt(i[1],10)),i.slice(2).forEach(function(s){r(n,parseInt(s,10))});var o=this;this._ensure(2+n.length),this.writeByte(t),this.writeLength(n.length),n.forEach(function(s){o.writeByte(s)})};Or.prototype.writeLength=function(e){if(typeof e!="number")throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else if(e<=16777215)this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else throw Hd("Length too long (> 4 bytes)")};Or.prototype.startSequence=function(e){typeof e!="number"&&(e=Si.Sequence|Si.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3};Or.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else if(r<=16777215)this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r;else throw Hd("Sequence too long")};Or.prototype._shift=function(e,t,r){vi.ok(e!==void 0),vi.ok(t!==void 0),vi.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r};Or.prototype._ensure=function(e){if(vi.ok(e),this._size-this._offset<e){var t=this._size*this._options.growthFactor;t-this._offset<e&&(t+=e);var r=Fd.alloc(t);this._buf.copy(r,0,0,this._offset),this._buf=r,this._size=t}};nS.exports=Or});var oS=me((SQ,qd)=>{var Qy=Ld(),Ky=Ud(),t4=rS(),r4=iS();qd.exports={Reader:t4,Writer:r4};for(jd in Ky)Ky.hasOwnProperty(jd)&&(qd.exports[jd]=Ky[jd]);var jd;for(Wd in Qy)Qy.hasOwnProperty(Wd)&&(qd.exports[Wd]=Qy[Wd]);var Wd});var cu=me((wQ,sS)=>{var Gy=oS();sS.exports={Ber:Gy,BerReader:Gy.Reader,BerWriter:Gy.Writer}});var aS=me((PQ,Vd)=>{(function(e){"use strict";var t=a(function(m){var A,E=new Float64Array(16);if(m)for(A=0;A<m.length;A++)E[A]=m[A];return E},"gf"),r=a(function(){throw new Error("no PRNG")},"randombytes"),i=new Uint8Array(16),n=new Uint8Array(32);n[0]=9;var o=t(),s=t([1]),c=t([56129,1]),u=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),p=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(m,A,E,d){m[A]=E>>24&255,m[A+1]=E>>16&255,m[A+2]=E>>8&255,m[A+3]=E&255,m[A+4]=d>>24&255,m[A+5]=d>>16&255,m[A+6]=d>>8&255,m[A+7]=d&255}a(h,"ts64");function _(m,A,E,d,x){var D,F=0;for(D=0;D<x;D++)F|=m[A+D]^E[d+D];return(1&F-1>>>8)-1}a(_,"vn");function y(m,A,E,d){return _(m,A,E,d,16)}a(y,"crypto_verify_16");function b(m,A,E,d){return _(m,A,E,d,32)}a(b,"crypto_verify_32");function v(m,A,E,d){for(var x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,D=E[0]&255|(E[1]&255)<<8|(E[2]&255)<<16|(E[3]&255)<<24,F=E[4]&255|(E[5]&255)<<8|(E[6]&255)<<16|(E[7]&255)<<24,se=E[8]&255|(E[9]&255)<<8|(E[10]&255)<<16|(E[11]&255)<<24,he=E[12]&255|(E[13]&255)<<8|(E[14]&255)<<16|(E[15]&255)<<24,we=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,be=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,It=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Se=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ze=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,rt=E[16]&255|(E[17]&255)<<8|(E[18]&255)<<16|(E[19]&255)<<24,tt=E[20]&255|(E[21]&255)<<8|(E[22]&255)<<16|(E[23]&255)<<24,Ke=E[24]&255|(E[25]&255)<<8|(E[26]&255)<<16|(E[27]&255)<<24,Je=E[28]&255|(E[29]&255)<<8|(E[30]&255)<<16|(E[31]&255)<<24,Ge=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Pe=x,Ce=D,Ie=F,Te=se,ke=he,Ae=we,K=be,G=It,ce=Se,oe=Ze,ae=Qe,de=rt,Be=tt,nt=Ke,ct=Je,it=Ge,w,lt=0;lt<20;lt+=2)w=Pe+Be|0,ke^=w<<7|w>>>25,w=ke+Pe|0,ce^=w<<9|w>>>23,w=ce+ke|0,Be^=w<<13|w>>>19,w=Be+ce|0,Pe^=w<<18|w>>>14,w=Ae+Ce|0,oe^=w<<7|w>>>25,w=oe+Ae|0,nt^=w<<9|w>>>23,w=nt+oe|0,Ce^=w<<13|w>>>19,w=Ce+nt|0,Ae^=w<<18|w>>>14,w=ae+K|0,ct^=w<<7|w>>>25,w=ct+ae|0,Ie^=w<<9|w>>>23,w=Ie+ct|0,K^=w<<13|w>>>19,w=K+Ie|0,ae^=w<<18|w>>>14,w=it+de|0,Te^=w<<7|w>>>25,w=Te+it|0,G^=w<<9|w>>>23,w=G+Te|0,de^=w<<13|w>>>19,w=de+G|0,it^=w<<18|w>>>14,w=Pe+Te|0,Ce^=w<<7|w>>>25,w=Ce+Pe|0,Ie^=w<<9|w>>>23,w=Ie+Ce|0,Te^=w<<13|w>>>19,w=Te+Ie|0,Pe^=w<<18|w>>>14,w=Ae+ke|0,K^=w<<7|w>>>25,w=K+Ae|0,G^=w<<9|w>>>23,w=G+K|0,ke^=w<<13|w>>>19,w=ke+G|0,Ae^=w<<18|w>>>14,w=ae+oe|0,de^=w<<7|w>>>25,w=de+ae|0,ce^=w<<9|w>>>23,w=ce+de|0,oe^=w<<13|w>>>19,w=oe+ce|0,ae^=w<<18|w>>>14,w=it+ct|0,Be^=w<<7|w>>>25,w=Be+it|0,nt^=w<<9|w>>>23,w=nt+Be|0,ct^=w<<13|w>>>19,w=ct+nt|0,it^=w<<18|w>>>14;Pe=Pe+x|0,Ce=Ce+D|0,Ie=Ie+F|0,Te=Te+se|0,ke=ke+he|0,Ae=Ae+we|0,K=K+be|0,G=G+It|0,ce=ce+Se|0,oe=oe+Ze|0,ae=ae+Qe|0,de=de+rt|0,Be=Be+tt|0,nt=nt+Ke|0,ct=ct+Je|0,it=it+Ge|0,m[0]=Pe>>>0&255,m[1]=Pe>>>8&255,m[2]=Pe>>>16&255,m[3]=Pe>>>24&255,m[4]=Ce>>>0&255,m[5]=Ce>>>8&255,m[6]=Ce>>>16&255,m[7]=Ce>>>24&255,m[8]=Ie>>>0&255,m[9]=Ie>>>8&255,m[10]=Ie>>>16&255,m[11]=Ie>>>24&255,m[12]=Te>>>0&255,m[13]=Te>>>8&255,m[14]=Te>>>16&255,m[15]=Te>>>24&255,m[16]=ke>>>0&255,m[17]=ke>>>8&255,m[18]=ke>>>16&255,m[19]=ke>>>24&255,m[20]=Ae>>>0&255,m[21]=Ae>>>8&255,m[22]=Ae>>>16&255,m[23]=Ae>>>24&255,m[24]=K>>>0&255,m[25]=K>>>8&255,m[26]=K>>>16&255,m[27]=K>>>24&255,m[28]=G>>>0&255,m[29]=G>>>8&255,m[30]=G>>>16&255,m[31]=G>>>24&255,m[32]=ce>>>0&255,m[33]=ce>>>8&255,m[34]=ce>>>16&255,m[35]=ce>>>24&255,m[36]=oe>>>0&255,m[37]=oe>>>8&255,m[38]=oe>>>16&255,m[39]=oe>>>24&255,m[40]=ae>>>0&255,m[41]=ae>>>8&255,m[42]=ae>>>16&255,m[43]=ae>>>24&255,m[44]=de>>>0&255,m[45]=de>>>8&255,m[46]=de>>>16&255,m[47]=de>>>24&255,m[48]=Be>>>0&255,m[49]=Be>>>8&255,m[50]=Be>>>16&255,m[51]=Be>>>24&255,m[52]=nt>>>0&255,m[53]=nt>>>8&255,m[54]=nt>>>16&255,m[55]=nt>>>24&255,m[56]=ct>>>0&255,m[57]=ct>>>8&255,m[58]=ct>>>16&255,m[59]=ct>>>24&255,m[60]=it>>>0&255,m[61]=it>>>8&255,m[62]=it>>>16&255,m[63]=it>>>24&255}a(v,"core_salsa20");function S(m,A,E,d){for(var x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,D=E[0]&255|(E[1]&255)<<8|(E[2]&255)<<16|(E[3]&255)<<24,F=E[4]&255|(E[5]&255)<<8|(E[6]&255)<<16|(E[7]&255)<<24,se=E[8]&255|(E[9]&255)<<8|(E[10]&255)<<16|(E[11]&255)<<24,he=E[12]&255|(E[13]&255)<<8|(E[14]&255)<<16|(E[15]&255)<<24,we=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,be=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,It=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Se=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ze=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,rt=E[16]&255|(E[17]&255)<<8|(E[18]&255)<<16|(E[19]&255)<<24,tt=E[20]&255|(E[21]&255)<<8|(E[22]&255)<<16|(E[23]&255)<<24,Ke=E[24]&255|(E[25]&255)<<8|(E[26]&255)<<16|(E[27]&255)<<24,Je=E[28]&255|(E[29]&255)<<8|(E[30]&255)<<16|(E[31]&255)<<24,Ge=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Pe=x,Ce=D,Ie=F,Te=se,ke=he,Ae=we,K=be,G=It,ce=Se,oe=Ze,ae=Qe,de=rt,Be=tt,nt=Ke,ct=Je,it=Ge,w,lt=0;lt<20;lt+=2)w=Pe+Be|0,ke^=w<<7|w>>>25,w=ke+Pe|0,ce^=w<<9|w>>>23,w=ce+ke|0,Be^=w<<13|w>>>19,w=Be+ce|0,Pe^=w<<18|w>>>14,w=Ae+Ce|0,oe^=w<<7|w>>>25,w=oe+Ae|0,nt^=w<<9|w>>>23,w=nt+oe|0,Ce^=w<<13|w>>>19,w=Ce+nt|0,Ae^=w<<18|w>>>14,w=ae+K|0,ct^=w<<7|w>>>25,w=ct+ae|0,Ie^=w<<9|w>>>23,w=Ie+ct|0,K^=w<<13|w>>>19,w=K+Ie|0,ae^=w<<18|w>>>14,w=it+de|0,Te^=w<<7|w>>>25,w=Te+it|0,G^=w<<9|w>>>23,w=G+Te|0,de^=w<<13|w>>>19,w=de+G|0,it^=w<<18|w>>>14,w=Pe+Te|0,Ce^=w<<7|w>>>25,w=Ce+Pe|0,Ie^=w<<9|w>>>23,w=Ie+Ce|0,Te^=w<<13|w>>>19,w=Te+Ie|0,Pe^=w<<18|w>>>14,w=Ae+ke|0,K^=w<<7|w>>>25,w=K+Ae|0,G^=w<<9|w>>>23,w=G+K|0,ke^=w<<13|w>>>19,w=ke+G|0,Ae^=w<<18|w>>>14,w=ae+oe|0,de^=w<<7|w>>>25,w=de+ae|0,ce^=w<<9|w>>>23,w=ce+de|0,oe^=w<<13|w>>>19,w=oe+ce|0,ae^=w<<18|w>>>14,w=it+ct|0,Be^=w<<7|w>>>25,w=Be+it|0,nt^=w<<9|w>>>23,w=nt+Be|0,ct^=w<<13|w>>>19,w=ct+nt|0,it^=w<<18|w>>>14;m[0]=Pe>>>0&255,m[1]=Pe>>>8&255,m[2]=Pe>>>16&255,m[3]=Pe>>>24&255,m[4]=Ae>>>0&255,m[5]=Ae>>>8&255,m[6]=Ae>>>16&255,m[7]=Ae>>>24&255,m[8]=ae>>>0&255,m[9]=ae>>>8&255,m[10]=ae>>>16&255,m[11]=ae>>>24&255,m[12]=it>>>0&255,m[13]=it>>>8&255,m[14]=it>>>16&255,m[15]=it>>>24&255,m[16]=K>>>0&255,m[17]=K>>>8&255,m[18]=K>>>16&255,m[19]=K>>>24&255,m[20]=G>>>0&255,m[21]=G>>>8&255,m[22]=G>>>16&255,m[23]=G>>>24&255,m[24]=ce>>>0&255,m[25]=ce>>>8&255,m[26]=ce>>>16&255,m[27]=ce>>>24&255,m[28]=oe>>>0&255,m[29]=oe>>>8&255,m[30]=oe>>>16&255,m[31]=oe>>>24&255}a(S,"core_hsalsa20");function M(m,A,E,d){v(m,A,E,d)}a(M,"crypto_core_salsa20");function R(m,A,E,d){S(m,A,E,d)}a(R,"crypto_core_hsalsa20");var J=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function te(m,A,E,d,x,D,F){var se=new Uint8Array(16),he=new Uint8Array(64),we,be;for(be=0;be<16;be++)se[be]=0;for(be=0;be<8;be++)se[be]=D[be];for(;x>=64;){for(M(he,se,F,J),be=0;be<64;be++)m[A+be]=E[d+be]^he[be];for(we=1,be=8;be<16;be++)we=we+(se[be]&255)|0,se[be]=we&255,we>>>=8;x-=64,A+=64,d+=64}if(x>0)for(M(he,se,F,J),be=0;be<x;be++)m[A+be]=E[d+be]^he[be];return 0}a(te,"crypto_stream_salsa20_xor");function ee(m,A,E,d,x){var D=new Uint8Array(16),F=new Uint8Array(64),se,he;for(he=0;he<16;he++)D[he]=0;for(he=0;he<8;he++)D[he]=d[he];for(;E>=64;){for(M(F,D,x,J),he=0;he<64;he++)m[A+he]=F[he];for(se=1,he=8;he<16;he++)se=se+(D[he]&255)|0,D[he]=se&255,se>>>=8;E-=64,A+=64}if(E>0)for(M(F,D,x,J),he=0;he<E;he++)m[A+he]=F[he];return 0}a(ee,"crypto_stream_salsa20");function P(m,A,E,d,x){var D=new Uint8Array(32);R(D,d,x,J);for(var F=new Uint8Array(8),se=0;se<8;se++)F[se]=d[se+16];return ee(m,A,E,F,D)}a(P,"crypto_stream");function C(m,A,E,d,x,D,F){var se=new Uint8Array(32);R(se,D,F,J);for(var he=new Uint8Array(8),we=0;we<8;we++)he[we]=D[we+16];return te(m,A,E,d,x,he,se)}a(C,"crypto_stream_xor");var H=a(function(m){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var A,E,d,x,D,F,se,he;A=m[0]&255|(m[1]&255)<<8,this.r[0]=A&8191,E=m[2]&255|(m[3]&255)<<8,this.r[1]=(A>>>13|E<<3)&8191,d=m[4]&255|(m[5]&255)<<8,this.r[2]=(E>>>10|d<<6)&7939,x=m[6]&255|(m[7]&255)<<8,this.r[3]=(d>>>7|x<<9)&8191,D=m[8]&255|(m[9]&255)<<8,this.r[4]=(x>>>4|D<<12)&255,this.r[5]=D>>>1&8190,F=m[10]&255|(m[11]&255)<<8,this.r[6]=(D>>>14|F<<2)&8191,se=m[12]&255|(m[13]&255)<<8,this.r[7]=(F>>>11|se<<5)&8065,he=m[14]&255|(m[15]&255)<<8,this.r[8]=(se>>>8|he<<8)&8191,this.r[9]=he>>>5&127,this.pad[0]=m[16]&255|(m[17]&255)<<8,this.pad[1]=m[18]&255|(m[19]&255)<<8,this.pad[2]=m[20]&255|(m[21]&255)<<8,this.pad[3]=m[22]&255|(m[23]&255)<<8,this.pad[4]=m[24]&255|(m[25]&255)<<8,this.pad[5]=m[26]&255|(m[27]&255)<<8,this.pad[6]=m[28]&255|(m[29]&255)<<8,this.pad[7]=m[30]&255|(m[31]&255)<<8},"poly1305");H.prototype.blocks=function(m,A,E){for(var d=this.fin?0:2048,x,D,F,se,he,we,be,It,Se,Ze,Qe,rt,tt,Ke,Je,Ge,Pe,Ce,Ie,Te=this.h[0],ke=this.h[1],Ae=this.h[2],K=this.h[3],G=this.h[4],ce=this.h[5],oe=this.h[6],ae=this.h[7],de=this.h[8],Be=this.h[9],nt=this.r[0],ct=this.r[1],it=this.r[2],w=this.r[3],lt=this.r[4],vt=this.r[5],St=this.r[6],ut=this.r[7],Et=this.r[8],At=this.r[9];E>=16;)x=m[A+0]&255|(m[A+1]&255)<<8,Te+=x&8191,D=m[A+2]&255|(m[A+3]&255)<<8,ke+=(x>>>13|D<<3)&8191,F=m[A+4]&255|(m[A+5]&255)<<8,Ae+=(D>>>10|F<<6)&8191,se=m[A+6]&255|(m[A+7]&255)<<8,K+=(F>>>7|se<<9)&8191,he=m[A+8]&255|(m[A+9]&255)<<8,G+=(se>>>4|he<<12)&8191,ce+=he>>>1&8191,we=m[A+10]&255|(m[A+11]&255)<<8,oe+=(he>>>14|we<<2)&8191,be=m[A+12]&255|(m[A+13]&255)<<8,ae+=(we>>>11|be<<5)&8191,It=m[A+14]&255|(m[A+15]&255)<<8,de+=(be>>>8|It<<8)&8191,Be+=It>>>5|d,Se=0,Ze=Se,Ze+=Te*nt,Ze+=ke*(5*At),Ze+=Ae*(5*Et),Ze+=K*(5*ut),Ze+=G*(5*St),Se=Ze>>>13,Ze&=8191,Ze+=ce*(5*vt),Ze+=oe*(5*lt),Ze+=ae*(5*w),Ze+=de*(5*it),Ze+=Be*(5*ct),Se+=Ze>>>13,Ze&=8191,Qe=Se,Qe+=Te*ct,Qe+=ke*nt,Qe+=Ae*(5*At),Qe+=K*(5*Et),Qe+=G*(5*ut),Se=Qe>>>13,Qe&=8191,Qe+=ce*(5*St),Qe+=oe*(5*vt),Qe+=ae*(5*lt),Qe+=de*(5*w),Qe+=Be*(5*it),Se+=Qe>>>13,Qe&=8191,rt=Se,rt+=Te*it,rt+=ke*ct,rt+=Ae*nt,rt+=K*(5*At),rt+=G*(5*Et),Se=rt>>>13,rt&=8191,rt+=ce*(5*ut),rt+=oe*(5*St),rt+=ae*(5*vt),rt+=de*(5*lt),rt+=Be*(5*w),Se+=rt>>>13,rt&=8191,tt=Se,tt+=Te*w,tt+=ke*it,tt+=Ae*ct,tt+=K*nt,tt+=G*(5*At),Se=tt>>>13,tt&=8191,tt+=ce*(5*Et),tt+=oe*(5*ut),tt+=ae*(5*St),tt+=de*(5*vt),tt+=Be*(5*lt),Se+=tt>>>13,tt&=8191,Ke=Se,Ke+=Te*lt,Ke+=ke*w,Ke+=Ae*it,Ke+=K*ct,Ke+=G*nt,Se=Ke>>>13,Ke&=8191,Ke+=ce*(5*At),Ke+=oe*(5*Et),Ke+=ae*(5*ut),Ke+=de*(5*St),Ke+=Be*(5*vt),Se+=Ke>>>13,Ke&=8191,Je=Se,Je+=Te*vt,Je+=ke*lt,Je+=Ae*w,Je+=K*it,Je+=G*ct,Se=Je>>>13,Je&=8191,Je+=ce*nt,Je+=oe*(5*At),Je+=ae*(5*Et),Je+=de*(5*ut),Je+=Be*(5*St),Se+=Je>>>13,Je&=8191,Ge=Se,Ge+=Te*St,Ge+=ke*vt,Ge+=Ae*lt,Ge+=K*w,Ge+=G*it,Se=Ge>>>13,Ge&=8191,Ge+=ce*ct,Ge+=oe*nt,Ge+=ae*(5*At),Ge+=de*(5*Et),Ge+=Be*(5*ut),Se+=Ge>>>13,Ge&=8191,Pe=Se,Pe+=Te*ut,Pe+=ke*St,Pe+=Ae*vt,Pe+=K*lt,Pe+=G*w,Se=Pe>>>13,Pe&=8191,Pe+=ce*it,Pe+=oe*ct,Pe+=ae*nt,Pe+=de*(5*At),Pe+=Be*(5*Et),Se+=Pe>>>13,Pe&=8191,Ce=Se,Ce+=Te*Et,Ce+=ke*ut,Ce+=Ae*St,Ce+=K*vt,Ce+=G*lt,Se=Ce>>>13,Ce&=8191,Ce+=ce*w,Ce+=oe*it,Ce+=ae*ct,Ce+=de*nt,Ce+=Be*(5*At),Se+=Ce>>>13,Ce&=8191,Ie=Se,Ie+=Te*At,Ie+=ke*Et,Ie+=Ae*ut,Ie+=K*St,Ie+=G*vt,Se=Ie>>>13,Ie&=8191,Ie+=ce*lt,Ie+=oe*w,Ie+=ae*it,Ie+=de*ct,Ie+=Be*nt,Se+=Ie>>>13,Ie&=8191,Se=(Se<<2)+Se|0,Se=Se+Ze|0,Ze=Se&8191,Se=Se>>>13,Qe+=Se,Te=Ze,ke=Qe,Ae=rt,K=tt,G=Ke,ce=Je,oe=Ge,ae=Pe,de=Ce,Be=Ie,A+=16,E-=16;this.h[0]=Te,this.h[1]=ke,this.h[2]=Ae,this.h[3]=K,this.h[4]=G,this.h[5]=ce,this.h[6]=oe,this.h[7]=ae,this.h[8]=de,this.h[9]=Be},H.prototype.finish=function(m,A){var E=new Uint16Array(10),d,x,D,F;if(this.leftover){for(F=this.leftover,this.buffer[F++]=1;F<16;F++)this.buffer[F]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(d=this.h[1]>>>13,this.h[1]&=8191,F=2;F<10;F++)this.h[F]+=d,d=this.h[F]>>>13,this.h[F]&=8191;for(this.h[0]+=d*5,d=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=d,d=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=d,E[0]=this.h[0]+5,d=E[0]>>>13,E[0]&=8191,F=1;F<10;F++)E[F]=this.h[F]+d,d=E[F]>>>13,E[F]&=8191;for(E[9]-=8192,x=(d^1)-1,F=0;F<10;F++)E[F]&=x;for(x=~x,F=0;F<10;F++)this.h[F]=this.h[F]&x|E[F];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,D=this.h[0]+this.pad[0],this.h[0]=D&65535,F=1;F<8;F++)D=(this.h[F]+this.pad[F]|0)+(D>>>16)|0,this.h[F]=D&65535;m[A+0]=this.h[0]>>>0&255,m[A+1]=this.h[0]>>>8&255,m[A+2]=this.h[1]>>>0&255,m[A+3]=this.h[1]>>>8&255,m[A+4]=this.h[2]>>>0&255,m[A+5]=this.h[2]>>>8&255,m[A+6]=this.h[3]>>>0&255,m[A+7]=this.h[3]>>>8&255,m[A+8]=this.h[4]>>>0&255,m[A+9]=this.h[4]>>>8&255,m[A+10]=this.h[5]>>>0&255,m[A+11]=this.h[5]>>>8&255,m[A+12]=this.h[6]>>>0&255,m[A+13]=this.h[6]>>>8&255,m[A+14]=this.h[7]>>>0&255,m[A+15]=this.h[7]>>>8&255},H.prototype.update=function(m,A,E){var d,x;if(this.leftover){for(x=16-this.leftover,x>E&&(x=E),d=0;d<x;d++)this.buffer[this.leftover+d]=m[A+d];if(E-=x,A+=x,this.leftover+=x,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(E>=16&&(x=E-E%16,this.blocks(m,A,x),A+=x,E-=x),E){for(d=0;d<E;d++)this.buffer[this.leftover+d]=m[A+d];this.leftover+=E}};function U(m,A,E,d,x,D){var F=new H(D);return F.update(E,d,x),F.finish(m,A),0}a(U,"crypto_onetimeauth");function k(m,A,E,d,x,D){var F=new Uint8Array(16);return U(F,0,E,d,x,D),y(m,A,F,0)}a(k,"crypto_onetimeauth_verify");function j(m,A,E,d,x){var D;if(E<32)return-1;for(C(m,0,A,0,E,d,x),U(m,16,m,32,E-32,m),D=0;D<16;D++)m[D]=0;return 0}a(j,"crypto_secretbox");function W(m,A,E,d,x){var D,F=new Uint8Array(32);if(E<32||(P(F,0,32,d,x),k(A,16,A,32,E-32,F)!==0))return-1;for(C(m,0,A,0,E,d,x),D=0;D<32;D++)m[D]=0;return 0}a(W,"crypto_secretbox_open");function z(m,A){var E;for(E=0;E<16;E++)m[E]=A[E]|0}a(z,"set25519");function X(m){var A,E,d=1;for(A=0;A<16;A++)E=m[A]+d+65535,d=Math.floor(E/65536),m[A]=E-d*65536;m[0]+=d-1+37*(d-1)}a(X,"car25519");function ne(m,A,E){for(var d,x=~(E-1),D=0;D<16;D++)d=x&(m[D]^A[D]),m[D]^=d,A[D]^=d}a(ne,"sel25519");function O(m,A){var E,d,x,D=t(),F=t();for(E=0;E<16;E++)F[E]=A[E];for(X(F),X(F),X(F),d=0;d<2;d++){for(D[0]=F[0]-65517,E=1;E<15;E++)D[E]=F[E]-65535-(D[E-1]>>16&1),D[E-1]&=65535;D[15]=F[15]-32767-(D[14]>>16&1),x=D[15]>>16&1,D[14]&=65535,ne(F,D,1-x)}for(E=0;E<16;E++)m[2*E]=F[E]&255,m[2*E+1]=F[E]>>8}a(O,"pack25519");function q(m,A){var E=new Uint8Array(32),d=new Uint8Array(32);return O(E,m),O(d,A),b(E,0,d,0)}a(q,"neq25519");function V(m){var A=new Uint8Array(32);return O(A,m),A[0]&1}a(V,"par25519");function re(m,A){var E;for(E=0;E<16;E++)m[E]=A[2*E]+(A[2*E+1]<<8);m[15]&=32767}a(re,"unpack25519");function _e(m,A,E){for(var d=0;d<16;d++)m[d]=A[d]+E[d]}a(_e,"A");function ve(m,A,E){for(var d=0;d<16;d++)m[d]=A[d]-E[d]}a(ve,"Z");function xe(m,A,E){var d,x,D=0,F=0,se=0,he=0,we=0,be=0,It=0,Se=0,Ze=0,Qe=0,rt=0,tt=0,Ke=0,Je=0,Ge=0,Pe=0,Ce=0,Ie=0,Te=0,ke=0,Ae=0,K=0,G=0,ce=0,oe=0,ae=0,de=0,Be=0,nt=0,ct=0,it=0,w=E[0],lt=E[1],vt=E[2],St=E[3],ut=E[4],Et=E[5],At=E[6],ar=E[7],Ot=E[8],tr=E[9],rr=E[10],nr=E[11],gr=E[12],Pr=E[13],Tr=E[14],kr=E[15];d=A[0],D+=d*w,F+=d*lt,se+=d*vt,he+=d*St,we+=d*ut,be+=d*Et,It+=d*At,Se+=d*ar,Ze+=d*Ot,Qe+=d*tr,rt+=d*rr,tt+=d*nr,Ke+=d*gr,Je+=d*Pr,Ge+=d*Tr,Pe+=d*kr,d=A[1],F+=d*w,se+=d*lt,he+=d*vt,we+=d*St,be+=d*ut,It+=d*Et,Se+=d*At,Ze+=d*ar,Qe+=d*Ot,rt+=d*tr,tt+=d*rr,Ke+=d*nr,Je+=d*gr,Ge+=d*Pr,Pe+=d*Tr,Ce+=d*kr,d=A[2],se+=d*w,he+=d*lt,we+=d*vt,be+=d*St,It+=d*ut,Se+=d*Et,Ze+=d*At,Qe+=d*ar,rt+=d*Ot,tt+=d*tr,Ke+=d*rr,Je+=d*nr,Ge+=d*gr,Pe+=d*Pr,Ce+=d*Tr,Ie+=d*kr,d=A[3],he+=d*w,we+=d*lt,be+=d*vt,It+=d*St,Se+=d*ut,Ze+=d*Et,Qe+=d*At,rt+=d*ar,tt+=d*Ot,Ke+=d*tr,Je+=d*rr,Ge+=d*nr,Pe+=d*gr,Ce+=d*Pr,Ie+=d*Tr,Te+=d*kr,d=A[4],we+=d*w,be+=d*lt,It+=d*vt,Se+=d*St,Ze+=d*ut,Qe+=d*Et,rt+=d*At,tt+=d*ar,Ke+=d*Ot,Je+=d*tr,Ge+=d*rr,Pe+=d*nr,Ce+=d*gr,Ie+=d*Pr,Te+=d*Tr,ke+=d*kr,d=A[5],be+=d*w,It+=d*lt,Se+=d*vt,Ze+=d*St,Qe+=d*ut,rt+=d*Et,tt+=d*At,Ke+=d*ar,Je+=d*Ot,Ge+=d*tr,Pe+=d*rr,Ce+=d*nr,Ie+=d*gr,Te+=d*Pr,ke+=d*Tr,Ae+=d*kr,d=A[6],It+=d*w,Se+=d*lt,Ze+=d*vt,Qe+=d*St,rt+=d*ut,tt+=d*Et,Ke+=d*At,Je+=d*ar,Ge+=d*Ot,Pe+=d*tr,Ce+=d*rr,Ie+=d*nr,Te+=d*gr,ke+=d*Pr,Ae+=d*Tr,K+=d*kr,d=A[7],Se+=d*w,Ze+=d*lt,Qe+=d*vt,rt+=d*St,tt+=d*ut,Ke+=d*Et,Je+=d*At,Ge+=d*ar,Pe+=d*Ot,Ce+=d*tr,Ie+=d*rr,Te+=d*nr,ke+=d*gr,Ae+=d*Pr,K+=d*Tr,G+=d*kr,d=A[8],Ze+=d*w,Qe+=d*lt,rt+=d*vt,tt+=d*St,Ke+=d*ut,Je+=d*Et,Ge+=d*At,Pe+=d*ar,Ce+=d*Ot,Ie+=d*tr,Te+=d*rr,ke+=d*nr,Ae+=d*gr,K+=d*Pr,G+=d*Tr,ce+=d*kr,d=A[9],Qe+=d*w,rt+=d*lt,tt+=d*vt,Ke+=d*St,Je+=d*ut,Ge+=d*Et,Pe+=d*At,Ce+=d*ar,Ie+=d*Ot,Te+=d*tr,ke+=d*rr,Ae+=d*nr,K+=d*gr,G+=d*Pr,ce+=d*Tr,oe+=d*kr,d=A[10],rt+=d*w,tt+=d*lt,Ke+=d*vt,Je+=d*St,Ge+=d*ut,Pe+=d*Et,Ce+=d*At,Ie+=d*ar,Te+=d*Ot,ke+=d*tr,Ae+=d*rr,K+=d*nr,G+=d*gr,ce+=d*Pr,oe+=d*Tr,ae+=d*kr,d=A[11],tt+=d*w,Ke+=d*lt,Je+=d*vt,Ge+=d*St,Pe+=d*ut,Ce+=d*Et,Ie+=d*At,Te+=d*ar,ke+=d*Ot,Ae+=d*tr,K+=d*rr,G+=d*nr,ce+=d*gr,oe+=d*Pr,ae+=d*Tr,de+=d*kr,d=A[12],Ke+=d*w,Je+=d*lt,Ge+=d*vt,Pe+=d*St,Ce+=d*ut,Ie+=d*Et,Te+=d*At,ke+=d*ar,Ae+=d*Ot,K+=d*tr,G+=d*rr,ce+=d*nr,oe+=d*gr,ae+=d*Pr,de+=d*Tr,Be+=d*kr,d=A[13],Je+=d*w,Ge+=d*lt,Pe+=d*vt,Ce+=d*St,Ie+=d*ut,Te+=d*Et,ke+=d*At,Ae+=d*ar,K+=d*Ot,G+=d*tr,ce+=d*rr,oe+=d*nr,ae+=d*gr,de+=d*Pr,Be+=d*Tr,nt+=d*kr,d=A[14],Ge+=d*w,Pe+=d*lt,Ce+=d*vt,Ie+=d*St,Te+=d*ut,ke+=d*Et,Ae+=d*At,K+=d*ar,G+=d*Ot,ce+=d*tr,oe+=d*rr,ae+=d*nr,de+=d*gr,Be+=d*Pr,nt+=d*Tr,ct+=d*kr,d=A[15],Pe+=d*w,Ce+=d*lt,Ie+=d*vt,Te+=d*St,ke+=d*ut,Ae+=d*Et,K+=d*At,G+=d*ar,ce+=d*Ot,oe+=d*tr,ae+=d*rr,de+=d*nr,Be+=d*gr,nt+=d*Pr,ct+=d*Tr,it+=d*kr,D+=38*Ce,F+=38*Ie,se+=38*Te,he+=38*ke,we+=38*Ae,be+=38*K,It+=38*G,Se+=38*ce,Ze+=38*oe,Qe+=38*ae,rt+=38*de,tt+=38*Be,Ke+=38*nt,Je+=38*ct,Ge+=38*it,x=1,d=D+x+65535,x=Math.floor(d/65536),D=d-x*65536,d=F+x+65535,x=Math.floor(d/65536),F=d-x*65536,d=se+x+65535,x=Math.floor(d/65536),se=d-x*65536,d=he+x+65535,x=Math.floor(d/65536),he=d-x*65536,d=we+x+65535,x=Math.floor(d/65536),we=d-x*65536,d=be+x+65535,x=Math.floor(d/65536),be=d-x*65536,d=It+x+65535,x=Math.floor(d/65536),It=d-x*65536,d=Se+x+65535,x=Math.floor(d/65536),Se=d-x*65536,d=Ze+x+65535,x=Math.floor(d/65536),Ze=d-x*65536,d=Qe+x+65535,x=Math.floor(d/65536),Qe=d-x*65536,d=rt+x+65535,x=Math.floor(d/65536),rt=d-x*65536,d=tt+x+65535,x=Math.floor(d/65536),tt=d-x*65536,d=Ke+x+65535,x=Math.floor(d/65536),Ke=d-x*65536,d=Je+x+65535,x=Math.floor(d/65536),Je=d-x*65536,d=Ge+x+65535,x=Math.floor(d/65536),Ge=d-x*65536,d=Pe+x+65535,x=Math.floor(d/65536),Pe=d-x*65536,D+=x-1+37*(x-1),x=1,d=D+x+65535,x=Math.floor(d/65536),D=d-x*65536,d=F+x+65535,x=Math.floor(d/65536),F=d-x*65536,d=se+x+65535,x=Math.floor(d/65536),se=d-x*65536,d=he+x+65535,x=Math.floor(d/65536),he=d-x*65536,d=we+x+65535,x=Math.floor(d/65536),we=d-x*65536,d=be+x+65535,x=Math.floor(d/65536),be=d-x*65536,d=It+x+65535,x=Math.floor(d/65536),It=d-x*65536,d=Se+x+65535,x=Math.floor(d/65536),Se=d-x*65536,d=Ze+x+65535,x=Math.floor(d/65536),Ze=d-x*65536,d=Qe+x+65535,x=Math.floor(d/65536),Qe=d-x*65536,d=rt+x+65535,x=Math.floor(d/65536),rt=d-x*65536,d=tt+x+65535,x=Math.floor(d/65536),tt=d-x*65536,d=Ke+x+65535,x=Math.floor(d/65536),Ke=d-x*65536,d=Je+x+65535,x=Math.floor(d/65536),Je=d-x*65536,d=Ge+x+65535,x=Math.floor(d/65536),Ge=d-x*65536,d=Pe+x+65535,x=Math.floor(d/65536),Pe=d-x*65536,D+=x-1+37*(x-1),m[0]=D,m[1]=F,m[2]=se,m[3]=he,m[4]=we,m[5]=be,m[6]=It,m[7]=Se,m[8]=Ze,m[9]=Qe,m[10]=rt,m[11]=tt,m[12]=Ke,m[13]=Je,m[14]=Ge,m[15]=Pe}a(xe,"M");function Tt(m,A){xe(m,A,A)}a(Tt,"S");function Mt(m,A){var E=t(),d;for(d=0;d<16;d++)E[d]=A[d];for(d=253;d>=0;d--)Tt(E,E),d!==2&&d!==4&&xe(E,E,A);for(d=0;d<16;d++)m[d]=E[d]}a(Mt,"inv25519");function ur(m,A){var E=t(),d;for(d=0;d<16;d++)E[d]=A[d];for(d=250;d>=0;d--)Tt(E,E),d!==1&&xe(E,E,A);for(d=0;d<16;d++)m[d]=E[d]}a(ur,"pow2523");function $r(m,A,E){var d=new Uint8Array(32),x=new Float64Array(80),D,F,se=t(),he=t(),we=t(),be=t(),It=t(),Se=t();for(F=0;F<31;F++)d[F]=A[F];for(d[31]=A[31]&127|64,d[0]&=248,re(x,E),F=0;F<16;F++)he[F]=x[F],be[F]=se[F]=we[F]=0;for(se[0]=be[0]=1,F=254;F>=0;--F)D=d[F>>>3]>>>(F&7)&1,ne(se,he,D),ne(we,be,D),_e(It,se,we),ve(se,se,we),_e(we,he,be),ve(he,he,be),Tt(be,It),Tt(Se,se),xe(se,we,se),xe(we,he,It),_e(It,se,we),ve(se,se,we),Tt(he,se),ve(we,be,Se),xe(se,we,c),_e(se,se,be),xe(we,we,se),xe(se,be,Se),xe(be,he,x),Tt(he,It),ne(se,he,D),ne(we,be,D);for(F=0;F<16;F++)x[F+16]=se[F],x[F+32]=we[F],x[F+48]=he[F],x[F+64]=be[F];var Ze=x.subarray(32),Qe=x.subarray(16);return Mt(Ze,Ze),xe(Qe,Qe,Ze),O(m,Qe),0}a($r,"crypto_scalarmult");function sn(m,A){return $r(m,A,n)}a(sn,"crypto_scalarmult_base");function Hr(m,A){return r(A,32),sn(m,A)}a(Hr,"crypto_box_keypair");function Oo(m,A,E){var d=new Uint8Array(32);return $r(d,E,A),R(m,i,d,J)}a(Oo,"crypto_box_beforenm");var Gs=j,Gu=W;function Ys(m,A,E,d,x,D){var F=new Uint8Array(32);return Oo(F,x,D),Gs(m,A,E,d,F)}a(Ys,"crypto_box");function No(m,A,E,d,x,D){var F=new Uint8Array(32);return Oo(F,x,D),Gu(m,A,E,d,F)}a(No,"crypto_box_open");var $o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ie(m,A,E,d){for(var x=new Int32Array(16),D=new Int32Array(16),F,se,he,we,be,It,Se,Ze,Qe,rt,tt,Ke,Je,Ge,Pe,Ce,Ie,Te,ke,Ae,K,G,ce,oe,ae,de,Be=m[0],nt=m[1],ct=m[2],it=m[3],w=m[4],lt=m[5],vt=m[6],St=m[7],ut=A[0],Et=A[1],At=A[2],ar=A[3],Ot=A[4],tr=A[5],rr=A[6],nr=A[7],gr=0;d>=128;){for(ke=0;ke<16;ke++)Ae=8*ke+gr,x[ke]=E[Ae+0]<<24|E[Ae+1]<<16|E[Ae+2]<<8|E[Ae+3],D[ke]=E[Ae+4]<<24|E[Ae+5]<<16|E[Ae+6]<<8|E[Ae+7];for(ke=0;ke<80;ke++)if(F=Be,se=nt,he=ct,we=it,be=w,It=lt,Se=vt,Ze=St,Qe=ut,rt=Et,tt=At,Ke=ar,Je=Ot,Ge=tr,Pe=rr,Ce=nr,K=St,G=nr,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=(w>>>14|Ot<<18)^(w>>>18|Ot<<14)^(Ot>>>9|w<<23),G=(Ot>>>14|w<<18)^(Ot>>>18|w<<14)^(w>>>9|Ot<<23),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=w&lt^~w&vt,G=Ot&tr^~Ot&rr,ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=$o[ke*2],G=$o[ke*2+1],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=x[ke%16],G=D[ke%16],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,Ie=ae&65535|de<<16,Te=ce&65535|oe<<16,K=Ie,G=Te,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=(Be>>>28|ut<<4)^(ut>>>2|Be<<30)^(ut>>>7|Be<<25),G=(ut>>>28|Be<<4)^(Be>>>2|ut<<30)^(Be>>>7|ut<<25),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,K=Be&nt^Be&ct^nt&ct,G=ut&Et^ut&At^Et&At,ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,Ze=ae&65535|de<<16,Ce=ce&65535|oe<<16,K=we,G=Ke,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=Ie,G=Te,ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,we=ae&65535|de<<16,Ke=ce&65535|oe<<16,nt=F,ct=se,it=he,w=we,lt=be,vt=It,St=Se,Be=Ze,Et=Qe,At=rt,ar=tt,Ot=Ke,tr=Je,rr=Ge,nr=Pe,ut=Ce,ke%16===15)for(Ae=0;Ae<16;Ae++)K=x[Ae],G=D[Ae],ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=x[(Ae+9)%16],G=D[(Ae+9)%16],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,Ie=x[(Ae+1)%16],Te=D[(Ae+1)%16],K=(Ie>>>1|Te<<31)^(Ie>>>8|Te<<24)^Ie>>>7,G=(Te>>>1|Ie<<31)^(Te>>>8|Ie<<24)^(Te>>>7|Ie<<25),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,Ie=x[(Ae+14)%16],Te=D[(Ae+14)%16],K=(Ie>>>19|Te<<13)^(Te>>>29|Ie<<3)^Ie>>>6,G=(Te>>>19|Ie<<13)^(Ie>>>29|Te<<3)^(Te>>>6|Ie<<26),ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,x[Ae]=ae&65535|de<<16,D[Ae]=ce&65535|oe<<16;K=Be,G=ut,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[0],G=A[0],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[0]=Be=ae&65535|de<<16,A[0]=ut=ce&65535|oe<<16,K=nt,G=Et,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[1],G=A[1],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[1]=nt=ae&65535|de<<16,A[1]=Et=ce&65535|oe<<16,K=ct,G=At,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[2],G=A[2],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[2]=ct=ae&65535|de<<16,A[2]=At=ce&65535|oe<<16,K=it,G=ar,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[3],G=A[3],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[3]=it=ae&65535|de<<16,A[3]=ar=ce&65535|oe<<16,K=w,G=Ot,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[4],G=A[4],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[4]=w=ae&65535|de<<16,A[4]=Ot=ce&65535|oe<<16,K=lt,G=tr,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[5],G=A[5],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[5]=lt=ae&65535|de<<16,A[5]=tr=ce&65535|oe<<16,K=vt,G=rr,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[6],G=A[6],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[6]=vt=ae&65535|de<<16,A[6]=rr=ce&65535|oe<<16,K=St,G=nr,ce=G&65535,oe=G>>>16,ae=K&65535,de=K>>>16,K=m[7],G=A[7],ce+=G&65535,oe+=G>>>16,ae+=K&65535,de+=K>>>16,oe+=ce>>>16,ae+=oe>>>16,de+=ae>>>16,m[7]=St=ae&65535|de<<16,A[7]=nr=ce&65535|oe<<16,gr+=128,d-=128}return d}a(ie,"crypto_hashblocks_hl");function Ee(m,A,E){var d=new Int32Array(8),x=new Int32Array(8),D=new Uint8Array(256),F,se=E;for(d[0]=1779033703,d[1]=3144134277,d[2]=1013904242,d[3]=2773480762,d[4]=1359893119,d[5]=2600822924,d[6]=528734635,d[7]=1541459225,x[0]=4089235720,x[1]=2227873595,x[2]=4271175723,x[3]=1595750129,x[4]=2917565137,x[5]=725511199,x[6]=4215389547,x[7]=327033209,ie(d,x,A,E),E%=128,F=0;F<E;F++)D[F]=A[se-E+F];for(D[E]=128,E=256-128*(E<112?1:0),D[E-9]=0,h(D,E-8,se/536870912|0,se<<3),ie(d,x,D,E),F=0;F<8;F++)h(m,8*F,d[F],x[F]);return 0}a(Ee,"crypto_hash");function Re(m,A){var E=t(),d=t(),x=t(),D=t(),F=t(),se=t(),he=t(),we=t(),be=t();ve(E,m[1],m[0]),ve(be,A[1],A[0]),xe(E,E,be),_e(d,m[0],m[1]),_e(be,A[0],A[1]),xe(d,d,be),xe(x,m[3],A[3]),xe(x,x,l),xe(D,m[2],A[2]),_e(D,D,D),ve(F,d,E),ve(se,D,x),_e(he,D,x),_e(we,d,E),xe(m[0],F,se),xe(m[1],we,he),xe(m[2],he,se),xe(m[3],F,we)}a(Re,"add");function je(m,A,E){var d;for(d=0;d<4;d++)ne(m[d],A[d],E)}a(je,"cswap");function gt(m,A){var E=t(),d=t(),x=t();Mt(x,A[2]),xe(E,A[0],x),xe(d,A[1],x),O(m,d),m[31]^=V(E)<<7}a(gt,"pack");function lr(m,A,E){var d,x;for(z(m[0],o),z(m[1],s),z(m[2],s),z(m[3],o),x=255;x>=0;--x)d=E[x/8|0]>>(x&7)&1,je(m,A,d),Re(A,m),Re(m,m),je(m,A,d)}a(lr,"scalarmult");function Tn(m,A){var E=[t(),t(),t(),t()];z(E[0],f),z(E[1],p),z(E[2],s),xe(E[3],f,p),lr(m,E,A)}a(Tn,"scalarbase");function Yr(m,A,E){var d=new Uint8Array(64),x=[t(),t(),t(),t()],D;for(E||r(A,32),Ee(d,A,32),d[0]&=248,d[31]&=127,d[31]|=64,Tn(x,d),gt(m,x),D=0;D<32;D++)A[D+32]=m[D];return 0}a(Yr,"crypto_sign_keypair");var Do=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function kt(m,A){var E,d,x,D;for(d=63;d>=32;--d){for(E=0,x=d-32,D=d-12;x<D;++x)A[x]+=E-16*A[d]*Do[x-(d-32)],E=A[x]+128>>8,A[x]-=E*256;A[x]+=E,A[d]=0}for(E=0,x=0;x<32;x++)A[x]+=E-(A[31]>>4)*Do[x],E=A[x]>>8,A[x]&=255;for(x=0;x<32;x++)A[x]-=E*Do[x];for(d=0;d<32;d++)A[d+1]+=A[d]>>8,m[d]=A[d]&255}a(kt,"modL");function _r(m){var A=new Float64Array(64),E;for(E=0;E<64;E++)A[E]=m[E];for(E=0;E<64;E++)m[E]=0;kt(m,A)}a(_r,"reduce");function hr(m,A,E,d){var x=new Uint8Array(64),D=new Uint8Array(64),F=new Uint8Array(64),se,he,we=new Float64Array(64),be=[t(),t(),t(),t()];Ee(x,d,32),x[0]&=248,x[31]&=127,x[31]|=64;var It=E+64;for(se=0;se<E;se++)m[64+se]=A[se];for(se=0;se<32;se++)m[32+se]=x[32+se];for(Ee(F,m.subarray(32),E+32),_r(F),Tn(be,F),gt(m,be),se=32;se<64;se++)m[se]=d[se];for(Ee(D,m,E+64),_r(D),se=0;se<64;se++)we[se]=0;for(se=0;se<32;se++)we[se]=F[se];for(se=0;se<32;se++)for(he=0;he<32;he++)we[se+he]+=D[se]*x[he];return kt(m.subarray(32),we),It}a(hr,"crypto_sign");function Jt(m,A){var E=t(),d=t(),x=t(),D=t(),F=t(),se=t(),he=t();return z(m[2],s),re(m[1],A),Tt(x,m[1]),xe(D,x,u),ve(x,x,m[2]),_e(D,m[2],D),Tt(F,D),Tt(se,F),xe(he,se,F),xe(E,he,x),xe(E,E,D),ur(E,E),xe(E,E,x),xe(E,E,D),xe(E,E,D),xe(m[0],E,D),Tt(d,m[0]),xe(d,d,D),q(d,x)&&xe(m[0],m[0],g),Tt(d,m[0]),xe(d,d,D),q(d,x)?-1:(V(m[0])===A[31]>>7&&ve(m[0],o,m[0]),xe(m[3],m[0],m[1]),0)}a(Jt,"unpackneg");function zt(m,A,E,d){var x,D,F=new Uint8Array(32),se=new Uint8Array(64),he=[t(),t(),t(),t()],we=[t(),t(),t(),t()];if(D=-1,E<64||Jt(we,d))return-1;for(x=0;x<E;x++)m[x]=A[x];for(x=0;x<32;x++)m[x+32]=d[x];if(Ee(se,m,E),_r(se),lr(he,we,se),Tn(we,A.subarray(32)),Re(he,we),gt(F,he),E-=64,b(A,0,F,0)){for(x=0;x<E;x++)m[x]=0;return-1}for(x=0;x<E;x++)m[x]=A[x+64];return D=E,D}a(zt,"crypto_sign_open");var an=32,er=24,Hi=32,Bo=16,Xs=32,Yu=32,Js=32,ea=32,Xp=32,Ib=er,Vk=Hi,Zk=Bo,Un=64,ji=32,zo=64,Jp=32,eh=64;e.lowlevel={crypto_core_hsalsa20:R,crypto_stream_xor:C,crypto_stream:P,crypto_stream_salsa20_xor:te,crypto_stream_salsa20:ee,crypto_onetimeauth:U,crypto_onetimeauth_verify:k,crypto_verify_16:y,crypto_verify_32:b,crypto_secretbox:j,crypto_secretbox_open:W,crypto_scalarmult:$r,crypto_scalarmult_base:sn,crypto_box_beforenm:Oo,crypto_box_afternm:Gs,crypto_box:Ys,crypto_box_open:No,crypto_box_keypair:Hr,crypto_hash:Ee,crypto_sign:hr,crypto_sign_keypair:Yr,crypto_sign_open:zt,crypto_secretbox_KEYBYTES:an,crypto_secretbox_NONCEBYTES:er,crypto_secretbox_ZEROBYTES:Hi,crypto_secretbox_BOXZEROBYTES:Bo,crypto_scalarmult_BYTES:Xs,crypto_scalarmult_SCALARBYTES:Yu,crypto_box_PUBLICKEYBYTES:Js,crypto_box_SECRETKEYBYTES:ea,crypto_box_BEFORENMBYTES:Xp,crypto_box_NONCEBYTES:Ib,crypto_box_ZEROBYTES:Vk,crypto_box_BOXZEROBYTES:Zk,crypto_sign_BYTES:Un,crypto_sign_PUBLICKEYBYTES:ji,crypto_sign_SECRETKEYBYTES:zo,crypto_sign_SEEDBYTES:Jp,crypto_hash_BYTES:eh};function vb(m,A){if(m.length!==an)throw new Error("bad key size");if(A.length!==er)throw new Error("bad nonce size")}a(vb,"checkLengths");function Qk(m,A){if(m.length!==Js)throw new Error("bad public key size");if(A.length!==ea)throw new Error("bad secret key size")}a(Qk,"checkBoxLengths");function Xr(){var m,A;for(A=0;A<arguments.length;A++)if((m=Object.prototype.toString.call(arguments[A]))!=="[object Uint8Array]")throw new TypeError("unexpected type "+m+", use Uint8Array")}a(Xr,"checkArrayTypes");function Sb(m){for(var A=0;A<m.length;A++)m[A]=0}a(Sb,"cleanup"),e.util||(e.util={},e.util.decodeUTF8=e.util.encodeUTF8=e.util.encodeBase64=e.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),e.randomBytes=function(m){var A=new Uint8Array(m);return r(A,m),A},e.secretbox=function(m,A,E){Xr(m,A,E),vb(E,A);for(var d=new Uint8Array(Hi+m.length),x=new Uint8Array(d.length),D=0;D<m.length;D++)d[D+Hi]=m[D];return j(x,d,d.length,A,E),x.subarray(Bo)},e.secretbox.open=function(m,A,E){Xr(m,A,E),vb(E,A);for(var d=new Uint8Array(Bo+m.length),x=new Uint8Array(d.length),D=0;D<m.length;D++)d[D+Bo]=m[D];return d.length<32||W(x,d,d.length,A,E)!==0?!1:x.subarray(Hi)},e.secretbox.keyLength=an,e.secretbox.nonceLength=er,e.secretbox.overheadLength=Bo,e.scalarMult=function(m,A){if(Xr(m,A),m.length!==Yu)throw new Error("bad n size");if(A.length!==Xs)throw new Error("bad p size");var E=new Uint8Array(Xs);return $r(E,m,A),E},e.scalarMult.base=function(m){if(Xr(m),m.length!==Yu)throw new Error("bad n size");var A=new Uint8Array(Xs);return sn(A,m),A},e.scalarMult.scalarLength=Yu,e.scalarMult.groupElementLength=Xs,e.box=function(m,A,E,d){var x=e.box.before(E,d);return e.secretbox(m,A,x)},e.box.before=function(m,A){Xr(m,A),Qk(m,A);var E=new Uint8Array(Xp);return Oo(E,m,A),E},e.box.after=e.secretbox,e.box.open=function(m,A,E,d){var x=e.box.before(E,d);return e.secretbox.open(m,A,x)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var m=new Uint8Array(Js),A=new Uint8Array(ea);return Hr(m,A),{publicKey:m,secretKey:A}},e.box.keyPair.fromSecretKey=function(m){if(Xr(m),m.length!==ea)throw new Error("bad secret key size");var A=new Uint8Array(Js);return sn(A,m),{publicKey:A,secretKey:new Uint8Array(m)}},e.box.publicKeyLength=Js,e.box.secretKeyLength=ea,e.box.sharedKeyLength=Xp,e.box.nonceLength=Ib,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(m,A){if(Xr(m,A),A.length!==zo)throw new Error("bad secret key size");var E=new Uint8Array(Un+m.length);return hr(E,m,m.length,A),E},e.sign.open=function(m,A){if(arguments.length!==2)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Xr(m,A),A.length!==ji)throw new Error("bad public key size");var E=new Uint8Array(m.length),d=zt(E,m,m.length,A);if(d<0)return null;for(var x=new Uint8Array(d),D=0;D<x.length;D++)x[D]=E[D];return x},e.sign.detached=function(m,A){for(var E=e.sign(m,A),d=new Uint8Array(Un),x=0;x<d.length;x++)d[x]=E[x];return d},e.sign.detached.verify=function(m,A,E){if(Xr(m,A,E),A.length!==Un)throw new Error("bad signature size");if(E.length!==ji)throw new Error("bad public key size");var d=new Uint8Array(Un+m.length),x=new Uint8Array(Un+m.length),D;for(D=0;D<Un;D++)d[D]=A[D];for(D=0;D<m.length;D++)d[D+Un]=m[D];return zt(x,d,d.length,E)>=0},e.sign.keyPair=function(){var m=new Uint8Array(ji),A=new Uint8Array(zo);return Yr(m,A),{publicKey:m,secretKey:A}},e.sign.keyPair.fromSecretKey=function(m){if(Xr(m),m.length!==zo)throw new Error("bad secret key size");for(var A=new Uint8Array(ji),E=0;E<A.length;E++)A[E]=m[32+E];return{publicKey:A,secretKey:new Uint8Array(m)}},e.sign.keyPair.fromSeed=function(m){if(Xr(m),m.length!==Jp)throw new Error("bad seed size");for(var A=new Uint8Array(ji),E=new Uint8Array(zo),d=0;d<32;d++)E[d]=m[d];return Yr(A,E,!0),{publicKey:A,secretKey:E}},e.sign.publicKeyLength=ji,e.sign.secretKeyLength=zo,e.sign.seedLength=Jp,e.sign.signatureLength=Un,e.hash=function(m){Xr(m);var A=new Uint8Array(eh);return Ee(A,m,m.length),A},e.hash.hashLength=eh,e.verify=function(m,A){return Xr(m,A),m.length===0||A.length===0||m.length!==A.length?!1:_(m,0,A,0,m.length)===0},e.setPRNG=function(m){r=m},(function(){var m=typeof self<"u"?self.crypto||self.msCrypto:null;if(m&&m.getRandomValues){var A=65536;e.setPRNG(function(E,d){var x,D=new Uint8Array(d);for(x=0;x<d;x+=A)m.getRandomValues(D.subarray(x,x+Math.min(d-x,A)));for(x=0;x<d;x++)E[x]=D[x];Sb(D)})}else typeof require<"u"&&(m=require("crypto"),m&&m.randomBytes&&e.setPRNG(function(E,d){var x,D=m.randomBytes(d);for(x=0;x<d;x++)E[x]=D[x];Sb(D)}))})()})(typeof Vd<"u"&&Vd.exports?Vd.exports:self.nacl=self.nacl||{})});var eE=me((kQ,cS)=>{"use strict";var Yy=aS().lowlevel.crypto_hash,Yn=0,Eo=a(function(){this.S=[new Uint32Array([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]),new Uint32Array([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]),new Uint32Array([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]),new Uint32Array([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])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])},"Blowfish");function Qd(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}a(Qd,"F");Eo.prototype.encipher=function(e,t){t===void 0&&(t=new Uint8Array(e.buffer),e.byteOffset!==0&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=Qd(this.S,t,0)^this.P[r],e[0]^=Qd(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i};Eo.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);e.byteOffset!==0&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;r>0;r-=2)e[1]^=Qd(this.S,t,0)^this.P[r],e[0]^=Qd(this.S,t,4)^this.P[r-1];var i=e[0];e[0]=e[1]^this.P[0],e[1]=i};function yo(e,t){var r,i=0;for(r=0;r<4;r++,Yn++)Yn>=t&&(Yn=0),i=i<<8|e[Yn];return i}a(yo,"stream2word");Eo.prototype.expand0state=function(e,t){var r=new Uint32Array(2),i,n,o=new Uint8Array(r.buffer);for(i=0,Yn=0;i<18;i++)this.P[i]^=yo(e,t);for(Yn=0,i=0;i<18;i+=2)this.encipher(r,o),this.P[i]=r[0],this.P[i+1]=r[1];for(i=0;i<4;i++)for(n=0;n<256;n+=2)this.encipher(r,o),this.S[i][n]=r[0],this.S[i][n+1]=r[1]};Eo.prototype.expandstate=function(e,t,r,i){var n=new Uint32Array(2),o,s;for(o=0,Yn=0;o<18;o++)this.P[o]^=yo(r,i);for(o=0,Yn=0;o<18;o+=2)n[0]^=yo(e,t),n[1]^=yo(e,t),this.encipher(n),this.P[o]=n[0],this.P[o+1]=n[1];for(o=0;o<4;o++)for(s=0;s<256;s+=2)n[0]^=yo(e,t),n[1]^=yo(e,t),this.encipher(n),this.S[o][s]=n[0],this.S[o][s+1]=n[1];Yn=0};Eo.prototype.enc=function(e,t){for(var r=0;r<t;r++)this.encipher(e.subarray(r*2))};Eo.prototype.dec=function(e,t){for(var r=0;r<t;r++)this.decipher(e.subarray(r*2))};var Zd=8,Xy=32;function Jy(e,t,r){var i=new Eo,n=new Uint32Array(Zd),o,s=new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,105,116,101]);for(i.expandstate(t,64,e,64),o=0;o<64;o++)i.expand0state(t,64),i.expand0state(e,64);for(o=0;o<Zd;o++)n[o]=yo(s,s.byteLength);for(o=0;o<64;o++)i.enc(n,n.byteLength/8);for(o=0;o<Zd;o++)r[4*o+3]=n[o]>>>24,r[4*o+2]=n[o]>>>16,r[4*o+1]=n[o]>>>8,r[4*o+0]=n[o]}a(Jy,"bcrypt_hash");function n4(e,t,r,i,n,o,s){var c=new Uint8Array(64),u=new Uint8Array(64),l=new Uint8Array(Xy),f=new Uint8Array(Xy),p=new Uint8Array(i+4),g,h,_,y,b,v,S=o;if(s<1||t===0||i===0||o===0||o>l.byteLength*l.byteLength||i>1<<20)return-1;for(y=Math.floor((o+l.byteLength-1)/l.byteLength),_=Math.floor((o+y-1)/y),g=0;g<i;g++)p[g]=r[g];for(Yy(c,e,t),v=1;o>0;v++){for(p[i+0]=v>>>24,p[i+1]=v>>>16,p[i+2]=v>>>8,p[i+3]=v,Yy(u,p,i+4),Jy(c,u,f),g=l.byteLength;g--;)l[g]=f[g];for(g=1;g<s;g++)for(Yy(u,f,f.byteLength),Jy(c,u,f),h=0;h<l.byteLength;h++)l[h]^=f[h];for(_=Math.min(_,o),g=0;g<_&&(b=g*y+(v-1),!(b>=S));g++)n[b]=l[g];o-=g}return 0}a(n4,"bcrypt_pbkdf");cS.exports={BLOCKS:Zd,HASHSIZE:Xy,hash:Jy,pbkdf:n4}});var Jn=me((RQ,Gd)=>{"use strict";var Xn=require("crypto"),ks;try{ks=require("cpu-features")()}catch{}var{bindingAvailable:uS,CIPHER_INFO:i4,MAC_INFO:o4}=Pi(),lS=(()=>{if(typeof Xn.sign=="function"&&typeof Xn.verify=="function"){let e=`-----BEGIN PRIVATE KEY-----\r
7
7
  MC4CAQAwBQYDK2VwBCIEIHKj+sVa9WcD/q2DJUJaf43Kptc8xYuUQA4bOFj9vC8T\r
8
- -----END PRIVATE KEY-----`,e=Buffer.from("a"),r,n;try{r=En.sign(null,e,t),n=En.verify(null,e,t,r)}catch{}return Buffer.isBuffer(r)&&r.length===64&&n===!0}return!1})(),Ig=typeof En.diffieHellman=="function"&&typeof En.generateKeyPairSync=="function"&&typeof En.createPublicKey=="function",wa=["ecdh-sha2-nistp256","ecdh-sha2-nistp384","ecdh-sha2-nistp521","diffie-hellman-group-exchange-sha256","diffie-hellman-group14-sha256","diffie-hellman-group15-sha512","diffie-hellman-group16-sha512","diffie-hellman-group17-sha512","diffie-hellman-group18-sha512"];Ig&&(wa.unshift("curve25519-sha256"),wa.unshift("curve25519-sha256@libssh.org"));var Kx=wa.concat(["diffie-hellman-group-exchange-sha1","diffie-hellman-group14-sha1","diffie-hellman-group1-sha1"]),Hu=["ecdsa-sha2-nistp256","ecdsa-sha2-nistp384","ecdsa-sha2-nistp521","rsa-sha2-512","rsa-sha2-256","ssh-rsa"];xg&&Hu.unshift("ssh-ed25519");var Gx=Hu.concat(["ssh-dss"]),vg=(()=>{let t=En.getCiphers();return e=>t.includes(Qx[e].sslName)})(),zn=["aes128-gcm@openssh.com","aes256-gcm@openssh.com","aes128-ctr","aes192-ctr","aes256-ctr"];Ki&&Ki.flags&&!Ki.flags.aes?bg?zn.unshift("chacha20-poly1305@openssh.com"):zn.push("chacha20-poly1305@openssh.com"):bg&&Ki&&Ki.arch==="x86"?zn.splice(4,0,"chacha20-poly1305@openssh.com"):zn.push("chacha20-poly1305@openssh.com");zn=zn.filter(vg);var Zx=zn.concat(["aes256-cbc","aes192-cbc","aes128-cbc","blowfish-cbc","3des-cbc","aes128-gcm","aes256-gcm","arcfour256","arcfour128","cast128-cbc","arcfour"].filter(vg)),Sg=(()=>{let t=En.getHashes();return e=>t.includes(Vx[e].sslName)})(),wg=["hmac-sha2-256-etm@openssh.com","hmac-sha2-512-etm@openssh.com","hmac-sha1-etm@openssh.com","hmac-sha2-256","hmac-sha2-512","hmac-sha1"].filter(Sg),Yx=wg.concat(["hmac-md5","hmac-sha2-256-96","hmac-sha2-512-96","hmac-ripemd160","hmac-sha1-96","hmac-md5-96"].filter(Sg)),Pg=["none","zlib@openssh.com","zlib"],Xx=Pg.concat([]),Vi={BAD_DHGEX:1,OLD_EXIT:2,DYN_RPORT_BUG:4,BUG_DHGEX_LARGE:8,IMPLY_RSA_SHA2_SIGALGS:16};Pa.exports={MESSAGE:{DISCONNECT:1,IGNORE:2,UNIMPLEMENTED:3,DEBUG:4,SERVICE_REQUEST:5,SERVICE_ACCEPT:6,EXT_INFO:7,KEXINIT:20,NEWKEYS:21,KEXDH_INIT:30,KEXDH_REPLY:31,KEXDH_GEX_GROUP:31,KEXDH_GEX_INIT:32,KEXDH_GEX_REPLY:33,KEXDH_GEX_REQUEST:34,KEXECDH_INIT:30,KEXECDH_REPLY:31,USERAUTH_REQUEST:50,USERAUTH_FAILURE:51,USERAUTH_SUCCESS:52,USERAUTH_BANNER:53,USERAUTH_PASSWD_CHANGEREQ:60,USERAUTH_PK_OK:60,USERAUTH_INFO_REQUEST:60,USERAUTH_INFO_RESPONSE:61,GLOBAL_REQUEST:80,REQUEST_SUCCESS:81,REQUEST_FAILURE:82,CHANNEL_OPEN:90,CHANNEL_OPEN_CONFIRMATION:91,CHANNEL_OPEN_FAILURE:92,CHANNEL_WINDOW_ADJUST:93,CHANNEL_DATA:94,CHANNEL_EXTENDED_DATA:95,CHANNEL_EOF:96,CHANNEL_CLOSE:97,CHANNEL_REQUEST:98,CHANNEL_SUCCESS:99,CHANNEL_FAILURE:100},DISCONNECT_REASON:{HOST_NOT_ALLOWED_TO_CONNECT:1,PROTOCOL_ERROR:2,KEY_EXCHANGE_FAILED:3,RESERVED:4,MAC_ERROR:5,COMPRESSION_ERROR:6,SERVICE_NOT_AVAILABLE:7,PROTOCOL_VERSION_NOT_SUPPORTED:8,HOST_KEY_NOT_VERIFIABLE:9,CONNECTION_LOST:10,BY_APPLICATION:11,TOO_MANY_CONNECTIONS:12,AUTH_CANCELED_BY_USER:13,NO_MORE_AUTH_METHODS_AVAILABLE:14,ILLEGAL_USER_NAME:15},DISCONNECT_REASON_STR:void 0,CHANNEL_OPEN_FAILURE:{ADMINISTRATIVELY_PROHIBITED:1,CONNECT_FAILED:2,UNKNOWN_CHANNEL_TYPE:3,RESOURCE_SHORTAGE:4},TERMINAL_MODE:{TTY_OP_END:0,VINTR:1,VQUIT:2,VERASE:3,VKILL:4,VEOF:5,VEOL:6,VEOL2:7,VSTART:8,VSTOP:9,VSUSP:10,VDSUSP:11,VREPRINT:12,VWERASE:13,VLNEXT:14,VFLUSH:15,VSWTCH:16,VSTATUS:17,VDISCARD:18,IGNPAR:30,PARMRK:31,INPCK:32,ISTRIP:33,INLCR:34,IGNCR:35,ICRNL:36,IUCLC:37,IXON:38,IXANY:39,IXOFF:40,IMAXBEL:41,ISIG:50,ICANON:51,XCASE:52,ECHO:53,ECHOE:54,ECHOK:55,ECHONL:56,NOFLSH:57,TOSTOP:58,IEXTEN:59,ECHOCTL:60,ECHOKE:61,PENDIN:62,OPOST:70,OLCUC:71,ONLCR:72,OCRNL:73,ONOCR:74,ONLRET:75,CS7:90,CS8:91,PARENB:92,PARODD:93,TTY_OP_ISPEED:128,TTY_OP_OSPEED:129},CHANNEL_EXTENDED_DATATYPE:{STDERR:1},SIGNALS:["ABRT","ALRM","FPE","HUP","ILL","INT","QUIT","SEGV","TERM","USR1","USR2","KILL","PIPE"].reduce((t,e)=>({...t,[e]:1}),{}),COMPAT:Vi,COMPAT_CHECKS:[["Cisco-1.25",Vi.BAD_DHGEX],[/^Cisco-1[.]/,Vi.BUG_DHGEX_LARGE],[/^[0-9.]+$/,Vi.OLD_EXIT],[/^OpenSSH_5[.][0-9]+/,Vi.DYN_RPORT_BUG],[/^OpenSSH_7[.]4/,Vi.IMPLY_RSA_SHA2_SIGALGS]],DEFAULT_KEX:wa,SUPPORTED_KEX:Kx,DEFAULT_SERVER_HOST_KEY:Hu,SUPPORTED_SERVER_HOST_KEY:Gx,DEFAULT_CIPHER:zn,SUPPORTED_CIPHER:Zx,DEFAULT_MAC:wg,SUPPORTED_MAC:Yx,DEFAULT_COMPRESSION:Pg,SUPPORTED_COMPRESSION:Xx,curve25519Supported:Ig,eddsaSupported:xg};Pa.exports.DISCONNECT_REASON_BY_VALUE=Array.from(Object.entries(Pa.exports.DISCONNECT_REASON)).reduce((t,[e,r])=>({...t,[r]:e}),{})});var Vr=le((vF,Rg)=>{"use strict";var Fr=Ko().Ber,Ta,kg=Buffer[Symbol.species],Jx=Object.getPrototypeOf(Uint8Array.prototype).fill;function Tg(t,e){return t[e++]*16777216+t[e++]*65536+t[e++]*256+t[e]}c(Tg,"readUInt32BE");function Go(t,e,r,n,i){i||(i=0),n>t.length&&(n=t.length);let o=n-r,s=e.length-i;return o>s&&(o=s),e.set(new Uint8Array(t.buffer,t.byteOffset+r,o),i),o}c(Go,"bufferCopy");function Zo(t,e,r){return r===void 0&&(r=t.length),new kg(t.buffer,t.byteOffset+e,r-e)}c(Zo,"bufferSlice");function Wu(){let t=0,e,r={init:c((n,i)=>{e=n,t=typeof i=="number"?i:0},"init"),pos:c(()=>t,"pos"),length:c(()=>e?e.length:0,"length"),avail:c(()=>e&&t<e.length?e.length-t:0,"avail"),clear:c(()=>{e=void 0},"clear"),readUInt32BE:c(()=>{if(!(!e||t+3>=e.length))return e[t++]*16777216+e[t++]*65536+e[t++]*256+e[t++]},"readUInt32BE"),readUInt64BE:c(n=>{if(!(!e||t+7>=e.length))switch(n){case"always":return BigInt(`0x${e.hexSlice(t,t+=8)}`);case"maybe":if(e[t]>31)return BigInt(`0x${e.hexSlice(t,t+=8)}`);default:return e[t++]*72057594037927940+e[t++]*281474976710656+e[t++]*1099511627776+e[t++]*4294967296+e[t++]*16777216+e[t++]*65536+e[t++]*256+e[t++]}},"readUInt64BE"),skip:c(n=>{e&&n>0&&(t+=n)},"skip"),skipString:c(()=>{let n=r.readUInt32BE();if(n!==void 0)return t+=n,t<=e.length?n:void 0},"skipString"),readByte:c(()=>{if(e&&t<e.length)return e[t++]},"readByte"),readBool:c(()=>{if(e&&t<e.length)return!!e[t++]},"readBool"),readList:c(()=>{let n=r.readString(!0);if(n!==void 0)return n?n.split(","):[]},"readList"),readString:c((n,i)=>{typeof n=="number"&&(i=n,n=void 0);let o=r.readUInt32BE();if(o!==void 0&&!(e.length-t<o||typeof i=="number"&&o>i))return n?Buffer.isBuffer(n)?Go(e,n,t,t+=o):e.utf8Slice(t,t+=o):Zo(e,t,t+=o)},"readString"),readRaw:c(n=>{if(e){if(typeof n!="number")return Zo(e,t,t+=e.length-t);if(e.length-t>=n)return Zo(e,t,t+=n)}},"readRaw")};return r}c(Wu,"makeBufferParser");function Cg(t,e,r){let n=new Error(t);return typeof e=="boolean"?(r=e,n.level="protocol"):n.level=e||"protocol",n.fatal=!!r,n}c(Cg,"makeError");function ju(t,e,r){return t[r++]=e>>>24,t[r++]=e>>>16,t[r++]=e>>>8,t[r++]=e,r}c(ju,"writeUInt32BE");var Ca=Wu();Rg.exports={bufferCopy:Go,bufferSlice:Zo,FastBuffer:kg,bufferFill:c((t,e,r,n)=>Jx.call(t,e,r,n),"bufferFill"),makeError:Cg,doFatalError:c((t,e,r,n)=>{let i;return Ta===void 0&&({DISCONNECT_REASON:Ta}=An()),e instanceof Error?(i=e,typeof r!="number"?n=Ta.PROTOCOL_ERROR:n=r):i=Cg(e,r,!0),typeof n!="number"&&(n=Ta.PROTOCOL_ERROR),t.disconnect(n),t._destruct(),t._onError(i),1/0},"doFatalError"),readUInt32BE:Tg,writeUInt32BE:ju,writeUInt32LE:c((t,e,r)=>(t[r++]=e,t[r++]=e>>>8,t[r++]=e>>>16,t[r++]=e>>>24,r),"writeUInt32LE"),makeBufferParser:Wu,bufferParser:Wu(),readString:c((t,e,r,n)=>{typeof r=="number"&&(n=r,r=void 0),e===void 0&&(e=0);let i=t.length-e;if(e<0||e>=t.length||i<4)return;let o=Tg(t,e);if(i<4+o||typeof n=="number"&&o>n)return;e+=4;let s=e+o;return t._pos=s,r?Buffer.isBuffer(r)?Go(t,r,e,s):t.utf8Slice(e,s):Zo(t,e,s)},"readString"),sigSSHToASN1:c((t,e)=>{switch(e){case"ssh-dss":{if(t.length>40)return t;let r=new Fr.Writer;r.startSequence();let n=t.slice(0,20),i=t.slice(20);if(n[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,n.copy(o,1),n=o}else n[0]===0&&!(n[1]&128)&&(n=n.slice(1));if(i[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,i.copy(o,1),i=o}else i[0]===0&&!(i[1]&128)&&(i=i.slice(1));return r.writeBuffer(n,Fr.Integer),r.writeBuffer(i,Fr.Integer),r.endSequence(),r.buffer}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{Ca.init(t,0);let r=Ca.readString(),n=Ca.readString();if(Ca.clear(),r===void 0||n===void 0)return;let i=new Fr.Writer;return i.startSequence(),i.writeBuffer(r,Fr.Integer),i.writeBuffer(n,Fr.Integer),i.endSequence(),i.buffer}default:return t}},"sigSSHToASN1"),convertSignature:c((t,e)=>{switch(e){case"ssh-dss":{if(t.length<=40)return t;let r=new Fr.Reader(t);r.readSequence();let n=r.readString(Fr.Integer,!0),i=r.readString(Fr.Integer,!0),o=0,s=0;if(n.length<20){let u=Buffer.allocUnsafe(20);u.set(n,1),n=u,n[0]=0}if(i.length<20){let u=Buffer.allocUnsafe(20);u.set(i,1),i=u,i[0]=0}n.length>20&&n[0]===0&&(o=1),i.length>20&&i[0]===0&&(s=1);let a=Buffer.allocUnsafe(n.length-o+(i.length-s));return Go(n,a,o,n.length,0),Go(i,a,s,i.length,n.length-o),a}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{if(t[0]===0)return t;let r=new Fr.Reader(t);r.readSequence();let n=r.readString(Fr.Integer,!0),i=r.readString(Fr.Integer,!0);if(n===null||i===null)return;let o=Buffer.allocUnsafe(4+n.length+4+i.length);return ju(o,n.length,0),o.set(n,4),ju(o,i.length,4+n.length),o.set(i,8+n.length),o}}return t},"convertSignature"),sendPacket:c((t,e,r)=>!r&&t._kexinit!==void 0?(t._queue===void 0&&(t._queue=[]),t._queue.push(e),t._debug&&t._debug("Outbound: ... packet queued"),!1):(t._cipher.encrypt(e),!0),"sendPacket")}});var Ng=le((ka,Qu)=>{var qu=(function(){var t=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(t=t||__filename),(function(e){e=e||{};var r;r||(r=typeof e<"u"?e:{});var n,i;r.ready=new Promise(function(re,fe){n=re,i=fe});var o={},s;for(s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);var a=typeof window=="object",u=typeof importScripts=="function",l=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",d="",p,g,h,_,b;l?(d=u?require("path").dirname(d)+"/":__dirname+"/",p=c(function(re,fe){var ve=Sr(re);return ve?fe?ve:ve.toString():(_||(_=require("fs")),b||(b=require("path")),re=b.normalize(re),_.readFileSync(re,fe?null:"utf8"))},"C"),h=c(function(re){return re=p(re,!0),re.buffer||(re=new Uint8Array(re)),J(re.buffer),re},"E"),g=c(function(re,fe,ve){var Be=Sr(re);Be&&fe(Be),_||(_=require("fs")),b||(b=require("path")),re=b.normalize(re),_.readFile(re,function(ut,Jt){ut?ve(ut):fe(Jt.buffer)})},"D"),1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),r.inspect=function(){return"[Emscripten Module object]"}):(a||u)&&(u?d=self.location.href:typeof document<"u"&&document.currentScript&&(d=document.currentScript.src),t&&(d=t),d.indexOf("blob:")!==0?d=d.substr(0,d.lastIndexOf("/")+1):d="",p=c(function(re){try{var fe=new XMLHttpRequest;return fe.open("GET",re,!1),fe.send(null),fe.responseText}catch(ut){if(re=Sr(re)){fe=[];for(var ve=0;ve<re.length;ve++){var Be=re[ve];255<Be&&(Ar&&J(!1,"Character code "+Be+" ("+String.fromCharCode(Be)+") at offset "+ve+" not in 0x00-0xFF."),Be&=255),fe.push(String.fromCharCode(Be))}return fe.join("")}throw ut}},"C"),u&&(h=c(function(re){try{var fe=new XMLHttpRequest;return fe.open("GET",re,!1),fe.responseType="arraybuffer",fe.send(null),new Uint8Array(fe.response)}catch(ve){if(re=Sr(re))return re;throw ve}},"E")),g=c(function(re,fe,ve){var Be=new XMLHttpRequest;Be.open("GET",re,!0),Be.responseType="arraybuffer",Be.onload=function(){if(Be.status==200||Be.status==0&&Be.response)fe(Be.response);else{var ut=Sr(re);ut?fe(ut.buffer):ve()}},Be.onerror=ve,Be.send(null)},"D")),r.print||console.log.bind(console);var E=r.printErr||console.warn.bind(console);for(s in o)o.hasOwnProperty(s)&&(r[s]=o[s]);o=null;var v;r.wasmBinary&&(v=r.wasmBinary);var w=r.noExitRuntime||!0;typeof WebAssembly!="object"&&ee("no native wasm support detected");var H,D=!1;function J(re,fe){re||ee("Assertion failed: "+fe)}c(J,"assert");function Y(re){var fe=r["_"+re];return J(fe,"Cannot call unknown function "+re+", make sure it is exported"),fe}c(Y,"N");function X(re,fe,ve,Be){var ut={string:c(function(It){var ar=0;if(It!=null&&It!==0){var or=(It.length<<2)+1;ar=_o(or);var jt=ar,Pt=L;if(0<or){or=jt+or-1;for(var Ur=0;Ur<It.length;++Ur){var Wt=It.charCodeAt(Ur);if(55296<=Wt&&57343>=Wt){var ei=It.charCodeAt(++Ur);Wt=65536+((Wt&1023)<<10)|ei&1023}if(127>=Wt){if(jt>=or)break;Pt[jt++]=Wt}else{if(2047>=Wt){if(jt+1>=or)break;Pt[jt++]=192|Wt>>6}else{if(65535>=Wt){if(jt+2>=or)break;Pt[jt++]=224|Wt>>12}else{if(jt+3>=or)break;Pt[jt++]=240|Wt>>18,Pt[jt++]=128|Wt>>12&63}Pt[jt++]=128|Wt>>6&63}Pt[jt++]=128|Wt&63}}Pt[jt]=0}}return ar},"string"),array:c(function(It){var ar=_o(It.length);return M.set(It,ar),ar},"array")},Jt=Y(re),Xr=[];if(re=0,Be)for(var kr=0;kr<Be.length;kr++){var Ii=ut[ve[kr]];Ii?(re===0&&(re=mo()),Xr[kr]=Ii(Be[kr])):Xr[kr]=Be[kr]}return ve=Jt.apply(null,Xr),ve=(function(It){if(fe==="string")if(It){for(var ar=L,or=It+NaN,jt=It;ar[jt]&&!(jt>=or);)++jt;if(16<jt-It&&ar.subarray&&P)It=P.decode(ar.subarray(It,jt));else{for(or="";It<jt;){var Pt=ar[It++];if(Pt&128){var Ur=ar[It++]&63;if((Pt&224)==192)or+=String.fromCharCode((Pt&31)<<6|Ur);else{var Wt=ar[It++]&63;Pt=(Pt&240)==224?(Pt&15)<<12|Ur<<6|Wt:(Pt&7)<<18|Ur<<12|Wt<<6|ar[It++]&63,65536>Pt?or+=String.fromCharCode(Pt):(Pt-=65536,or+=String.fromCharCode(55296|Pt>>10,56320|Pt&1023))}}else or+=String.fromCharCode(Pt)}It=or}}else It="";else It=fe==="boolean"?!!It:It;return It})(ve),re!==0&&Bs(re),ve}c(X,"ca");var P=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,C,M,L;function T(){var re=H.buffer;C=re,r.HEAP8=M=new Int8Array(re),r.HEAP16=new Int16Array(re),r.HEAP32=new Int32Array(re),r.HEAPU8=L=new Uint8Array(re),r.HEAPU16=new Uint16Array(re),r.HEAPU32=new Uint32Array(re),r.HEAPF32=new Float32Array(re),r.HEAPF64=new Float64Array(re)}c(T,"ia");var F,j=[],B=[],Z=[];function te(){var re=r.preRun.shift();j.unshift(re)}c(te,"ma");var k=0,W=null,q=null;r.preloadedImages={},r.preloadedAudios={};function ee(re){throw r.onAbort&&r.onAbort(re),E(re),D=!0,re=new WebAssembly.RuntimeError("abort("+re+"). Build with -s ASSERTIONS=1 for more info."),i(re),re}c(ee,"K");var ue="data:application/octet-stream;base64,",me;if(me="data:application/octet-stream;base64,AGFzbQEAAAABIAZgAX8Bf2ADf39/AGABfwBgAABgAAF/YAZ/f39/f38AAgcBAWEBYQAAAwsKAAEDAQAAAgQFAgQFAXABAQEFBwEBgAKAgAIGCQF/AUGAjMACCwclCQFiAgABYwADAWQACQFlAAgBZgAHAWcABgFoAAUBaQAKAWoBAAqGTQpPAQJ/QYAIKAIAIgEgAEEDakF8cSICaiEAAkAgAkEAIAAgAU0bDQAgAD8AQRB0SwRAIAAQAEUNAQtBgAggADYCACABDwtBhAhBMDYCAEF/C4wFAg5+Cn8gACgCJCEUIAAoAiAhFSAAKAIcIREgACgCGCESIAAoAhQhEyACQRBPBEAgAC0ATEVBGHQhFyAAKAIEIhZBBWytIQ8gACgCCCIYQQVsrSENIAAoAgwiGUEFbK0hCyAAKAIQIhpBBWytIQkgADUCACEIIBqtIRAgGa0hDiAYrSEMIBatIQoDQCASIAEtAAMiEiABLQAEQQh0ciABLQAFQRB0ciABLQAGIhZBGHRyQQJ2Qf///x9xaq0iAyAOfiABLwAAIAEtAAJBEHRyIBNqIBJBGHRBgICAGHFqrSIEIBB+fCARIAEtAAdBCHQgFnIgAS0ACEEQdHIgAS0ACSIRQRh0ckEEdkH///8fcWqtIgUgDH58IAEtAApBCHQgEXIgAS0AC0EQdHIgAS0ADEEYdHJBBnYgFWqtIgYgCn58IBQgF2ogAS8ADSABLQAPQRB0cmqtIgcgCH58IAMgDH4gBCAOfnwgBSAKfnwgBiAIfnwgByAJfnwgAyAKfiAEIAx+fCAFIAh+fCAGIAl+fCAHIAt+fCADIAh+IAQgCn58IAUgCX58IAYgC358IAcgDX58IAMgCX4gBCAIfnwgBSALfnwgBiANfnwgByAPfnwiA0IaiEL/////D4N8IgRCGohC/////w+DfCIFQhqIQv////8Pg3wiBkIaiEL/////D4N8IgdCGoinQQVsIAOnQf///x9xaiITQRp2IASnQf///x9xaiESIAWnQf///x9xIREgBqdB////H3EhFSAHp0H///8fcSEUIBNB////H3EhEyABQRBqIQEgAkEQayICQQ9LDQALCyAAIBQ2AiQgACAVNgIgIAAgETYCHCAAIBI2AhggACATNgIUCwMAAQu2BAEGfwJAIAAoAjgiBARAIABBPGohBQJAIAJBECAEayIDIAIgA0kbIgZFDQAgBkEDcSEHAkAgBkEBa0EDSQRAQQAhAwwBCyAGQXxxIQhBACEDA0AgBSADIARqaiABIANqLQAAOgAAIAUgA0EBciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0ECciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0EDciIEIAAoAjhqaiABIARqLQAAOgAAIANBBGohAyAAKAI4IQQgCEEEayIIDQALCyAHRQ0AA0AgBSADIARqaiABIANqLQAAOgAAIANBAWohAyAAKAI4IQQgB0EBayIHDQALCyAAIAQgBmoiAzYCOCADQRBJDQEgACAFQRAQAiAAQQA2AjggAiAGayECIAEgBmohAQsgAkEQTwRAIAAgASACQXBxIgMQAiACQQ9xIQIgASADaiEBCyACRQ0AIAJBA3EhBCAAQTxqIQVBACEDIAJBAWtBA08EQCACQXxxIQcDQCAFIAAoAjggA2pqIAEgA2otAAA6AAAgBSADQQFyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQJyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQNyIgYgACgCOGpqIAEgBmotAAA6AAAgA0EEaiEDIAdBBGsiBw0ACwsgBARAA0AgBSAAKAI4IANqaiABIANqLQAAOgAAIANBAWohAyAEQQFrIgQNAAsLIAAgACgCOCACajYCOAsLoS0BDH8jAEEQayIMJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEH0AU0EQEGICCgCACIFQRAgAEELakF4cSAAQQtJGyIIQQN2IgJ2IgFBA3EEQCABQX9zQQFxIAJqIgNBA3QiAUG4CGooAgAiBEEIaiEAAkAgBCgCCCICIAFBsAhqIgFGBEBBiAggBUF+IAN3cTYCAAwBCyACIAE2AgwgASACNgIICyAEIANBA3QiAUEDcjYCBCABIARqIgEgASgCBEEBcjYCBAwNCyAIQZAIKAIAIgpNDQEgAQRAAkBBAiACdCIAQQAgAGtyIAEgAnRxIgBBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2aiIDQQN0IgBBuAhqKAIAIgQoAggiASAAQbAIaiIARgRAQYgIIAVBfiADd3EiBTYCAAwBCyABIAA2AgwgACABNgIICyAEQQhqIQAgBCAIQQNyNgIEIAQgCGoiAiADQQN0IgEgCGsiA0EBcjYCBCABIARqIAM2AgAgCgRAIApBA3YiAUEDdEGwCGohB0GcCCgCACEEAn8gBUEBIAF0IgFxRQRAQYgIIAEgBXI2AgAgBwwBCyAHKAIICyEBIAcgBDYCCCABIAQ2AgwgBCAHNgIMIAQgATYCCAtBnAggAjYCAEGQCCADNgIADA0LQYwIKAIAIgZFDQEgBkEAIAZrcUEBayIAIABBDHZBEHEiAnYiAUEFdkEIcSIAIAJyIAEgAHYiAUECdkEEcSIAciABIAB2IgFBAXZBAnEiAHIgASAAdiIBQQF2QQFxIgByIAEgAHZqQQJ0QbgKaigCACIBKAIEQXhxIAhrIQMgASECA0ACQCACKAIQIgBFBEAgAigCFCIARQ0BCyAAKAIEQXhxIAhrIgIgAyACIANJIgIbIQMgACABIAIbIQEgACECDAELCyABIAhqIgkgAU0NAiABKAIYIQsgASABKAIMIgRHBEAgASgCCCIAQZgIKAIASRogACAENgIMIAQgADYCCAwMCyABQRRqIgIoAgAiAEUEQCABKAIQIgBFDQQgAUEQaiECCwNAIAIhByAAIgRBFGoiAigCACIADQAgBEEQaiECIAQoAhAiAA0ACyAHQQA2AgAMCwtBfyEIIABBv39LDQAgAEELaiIAQXhxIQhBjAgoAgAiCUUNAEEAIAhrIQMCQAJAAkACf0EAIAhBgAJJDQAaQR8gCEH///8HSw0AGiAAQQh2IgAgAEGA/j9qQRB2QQhxIgJ0IgAgAEGA4B9qQRB2QQRxIgF0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAEgAnIgAHJrIgBBAXQgCCAAQRVqdkEBcXJBHGoLIgVBAnRBuApqKAIAIgJFBEBBACEADAELQQAhACAIQQBBGSAFQQF2ayAFQR9GG3QhAQNAAkAgAigCBEF4cSAIayIHIANPDQAgAiEEIAciAw0AQQAhAyACIQAMAwsgACACKAIUIgcgByACIAFBHXZBBHFqKAIQIgJGGyAAIAcbIQAgAUEBdCEBIAINAAsLIAAgBHJFBEBBACEEQQIgBXQiAEEAIABrciAJcSIARQ0DIABBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2akECdEG4CmooAgAhAAsgAEUNAQsDQCAAKAIEQXhxIAhrIgEgA0khAiABIAMgAhshAyAAIAQgAhshBCAAKAIQIgEEfyABBSAAKAIUCyIADQALCyAERQ0AIANBkAgoAgAgCGtPDQAgBCAIaiIGIARNDQEgBCgCGCEFIAQgBCgCDCIBRwRAIAQoAggiAEGYCCgCAEkaIAAgATYCDCABIAA2AggMCgsgBEEUaiICKAIAIgBFBEAgBCgCECIARQ0EIARBEGohAgsDQCACIQcgACIBQRRqIgIoAgAiAA0AIAFBEGohAiABKAIQIgANAAsgB0EANgIADAkLIAhBkAgoAgAiAk0EQEGcCCgCACEDAkAgAiAIayIBQRBPBEBBkAggATYCAEGcCCADIAhqIgA2AgAgACABQQFyNgIEIAIgA2ogATYCACADIAhBA3I2AgQMAQtBnAhBADYCAEGQCEEANgIAIAMgAkEDcjYCBCACIANqIgAgACgCBEEBcjYCBAsgA0EIaiEADAsLIAhBlAgoAgAiBkkEQEGUCCAGIAhrIgE2AgBBoAhBoAgoAgAiAiAIaiIANgIAIAAgAUEBcjYCBCACIAhBA3I2AgQgAkEIaiEADAsLQQAhACAIQS9qIgkCf0HgCygCAARAQegLKAIADAELQewLQn83AgBB5AtCgKCAgICABDcCAEHgCyAMQQxqQXBxQdiq1aoFczYCAEH0C0EANgIAQcQLQQA2AgBBgCALIgFqIgVBACABayIHcSICIAhNDQpBwAsoAgAiBARAQbgLKAIAIgMgAmoiASADTQ0LIAEgBEsNCwtBxAstAABBBHENBQJAAkBBoAgoAgAiAwRAQcgLIQADQCADIAAoAgAiAU8EQCABIAAoAgRqIANLDQMLIAAoAggiAA0ACwtBABABIgFBf0YNBiACIQVB5AsoAgAiA0EBayIAIAFxBEAgAiABayAAIAFqQQAgA2txaiEFCyAFIAhNDQYgBUH+////B0sNBkHACygCACIEBEBBuAsoAgAiAyAFaiIAIANNDQcgACAESw0HCyAFEAEiACABRw0BDAgLIAUgBmsgB3EiBUH+////B0sNBSAFEAEiASAAKAIAIAAoAgRqRg0EIAEhAAsCQCAAQX9GDQAgCEEwaiAFTQ0AQegLKAIAIgEgCSAFa2pBACABa3EiAUH+////B0sEQCAAIQEMCAsgARABQX9HBEAgASAFaiEFIAAhAQwIC0EAIAVrEAEaDAULIAAiAUF/Rw0GDAQLAAtBACEEDAcLQQAhAQwFCyABQX9HDQILQcQLQcQLKAIAQQRyNgIACyACQf7///8HSw0BIAIQASEBQQAQASEAIAFBf0YNASAAQX9GDQEgACABTQ0BIAAgAWsiBSAIQShqTQ0BC0G4C0G4CygCACAFaiIANgIAQbwLKAIAIABJBEBBvAsgADYCAAsCQAJAAkBBoAgoAgAiBwRAQcgLIQADQCABIAAoAgAiAyAAKAIEIgJqRg0CIAAoAggiAA0ACwwCC0GYCCgCACIAQQAgACABTRtFBEBBmAggATYCAAtBACEAQcwLIAU2AgBByAsgATYCAEGoCEF/NgIAQawIQeALKAIANgIAQdQLQQA2AgADQCAAQQN0IgNBuAhqIANBsAhqIgI2AgAgA0G8CGogAjYCACAAQQFqIgBBIEcNAAtBlAggBUEoayIDQXggAWtBB3FBACABQQhqQQdxGyIAayICNgIAQaAIIAAgAWoiADYCACAAIAJBAXI2AgQgASADakEoNgIEQaQIQfALKAIANgIADAILIAAtAAxBCHENACADIAdLDQAgASAHTQ0AIAAgAiAFajYCBEGgCCAHQXggB2tBB3FBACAHQQhqQQdxGyIAaiICNgIAQZQIQZQIKAIAIAVqIgEgAGsiADYCACACIABBAXI2AgQgASAHakEoNgIEQaQIQfALKAIANgIADAELQZgIKAIAIAFLBEBBmAggATYCAAsgASAFaiECQcgLIQACQAJAAkACQAJAAkADQCACIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQELQcgLIQADQCAHIAAoAgAiAk8EQCACIAAoAgRqIgQgB0sNAwsgACgCCCEADAALAAsgACABNgIAIAAgACgCBCAFajYCBCABQXggAWtBB3FBACABQQhqQQdxG2oiCSAIQQNyNgIEIAJBeCACa0EHcUEAIAJBCGpBB3EbaiIFIAggCWoiBmshAiAFIAdGBEBBoAggBjYCAEGUCEGUCCgCACACaiIANgIAIAYgAEEBcjYCBAwDCyAFQZwIKAIARgRAQZwIIAY2AgBBkAhBkAgoAgAgAmoiADYCACAGIABBAXI2AgQgACAGaiAANgIADAMLIAUoAgQiAEEDcUEBRgRAIABBeHEhBwJAIABB/wFNBEAgBSgCCCIDIABBA3YiAEEDdEGwCGpGGiADIAUoAgwiAUYEQEGICEGICCgCAEF+IAB3cTYCAAwCCyADIAE2AgwgASADNgIIDAELIAUoAhghCAJAIAUgBSgCDCIBRwRAIAUoAggiACABNgIMIAEgADYCCAwBCwJAIAVBFGoiACgCACIDDQAgBUEQaiIAKAIAIgMNAEEAIQEMAQsDQCAAIQQgAyIBQRRqIgAoAgAiAw0AIAFBEGohACABKAIQIgMNAAsgBEEANgIACyAIRQ0AAkAgBSAFKAIcIgNBAnRBuApqIgAoAgBGBEAgACABNgIAIAENAUGMCEGMCCgCAEF+IAN3cTYCAAwCCyAIQRBBFCAIKAIQIAVGG2ogATYCACABRQ0BCyABIAg2AhggBSgCECIABEAgASAANgIQIAAgATYCGAsgBSgCFCIARQ0AIAEgADYCFCAAIAE2AhgLIAUgB2ohBSACIAdqIQILIAUgBSgCBEF+cTYCBCAGIAJBAXI2AgQgAiAGaiACNgIAIAJB/wFNBEAgAkEDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwDC0EfIQAgAkH///8HTQRAIAJBCHYiACAAQYD+P2pBEHZBCHEiA3QiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASADciAAcmsiAEEBdCACIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQQCQEGMCCgCACIDQQEgAHQiAXFFBEBBjAggASADcjYCACAEIAY2AgAgBiAENgIYDAELIAJBAEEZIABBAXZrIABBH0YbdCEAIAQoAgAhAQNAIAEiAygCBEF4cSACRg0DIABBHXYhASAAQQF0IQAgAyABQQRxaiIEKAIQIgENAAsgBCAGNgIQIAYgAzYCGAsgBiAGNgIMIAYgBjYCCAwCC0GUCCAFQShrIgNBeCABa0EHcUEAIAFBCGpBB3EbIgBrIgI2AgBBoAggACABaiIANgIAIAAgAkEBcjYCBCABIANqQSg2AgRBpAhB8AsoAgA2AgAgByAEQScgBGtBB3FBACAEQSdrQQdxG2pBL2siACAAIAdBEGpJGyICQRs2AgQgAkHQCykCADcCECACQcgLKQIANwIIQdALIAJBCGo2AgBBzAsgBTYCAEHICyABNgIAQdQLQQA2AgAgAkEYaiEAA0AgAEEHNgIEIABBCGohASAAQQRqIQAgASAESQ0ACyACIAdGDQMgAiACKAIEQX5xNgIEIAcgAiAHayIEQQFyNgIEIAIgBDYCACAEQf8BTQRAIARBA3YiAEEDdEGwCGohAgJ/QYgIKAIAIgFBASAAdCIAcUUEQEGICCAAIAFyNgIAIAIMAQsgAigCCAshACACIAc2AgggACAHNgIMIAcgAjYCDCAHIAA2AggMBAtBHyEAIAdCADcCECAEQf///wdNBEAgBEEIdiIAIABBgP4/akEQdkEIcSICdCIAIABBgOAfakEQdkEEcSIBdCIAIABBgIAPakEQdkECcSIAdEEPdiABIAJyIAByayIAQQF0IAQgAEEVanZBAXFyQRxqIQALIAcgADYCHCAAQQJ0QbgKaiEDAkBBjAgoAgAiAkEBIAB0IgFxRQRAQYwIIAEgAnI2AgAgAyAHNgIAIAcgAzYCGAwBCyAEQQBBGSAAQQF2ayAAQR9GG3QhACADKAIAIQEDQCABIgIoAgRBeHEgBEYNBCAAQR12IQEgAEEBdCEAIAIgAUEEcWoiAygCECIBDQALIAMgBzYCECAHIAI2AhgLIAcgBzYCDCAHIAc2AggMAwsgAygCCCIAIAY2AgwgAyAGNgIIIAZBADYCGCAGIAM2AgwgBiAANgIICyAJQQhqIQAMBQsgAigCCCIAIAc2AgwgAiAHNgIIIAdBADYCGCAHIAI2AgwgByAANgIIC0GUCCgCACIAIAhNDQBBlAggACAIayIBNgIAQaAIQaAIKAIAIgIgCGoiADYCACAAIAFBAXI2AgQgAiAIQQNyNgIEIAJBCGohAAwDC0GECEEwNgIAQQAhAAwCCwJAIAVFDQACQCAEKAIcIgJBAnRBuApqIgAoAgAgBEYEQCAAIAE2AgAgAQ0BQYwIIAlBfiACd3EiCTYCAAwCCyAFQRBBFCAFKAIQIARGG2ogATYCACABRQ0BCyABIAU2AhggBCgCECIABEAgASAANgIQIAAgATYCGAsgBCgCFCIARQ0AIAEgADYCFCAAIAE2AhgLAkAgA0EPTQRAIAQgAyAIaiIAQQNyNgIEIAAgBGoiACAAKAIEQQFyNgIEDAELIAQgCEEDcjYCBCAGIANBAXI2AgQgAyAGaiADNgIAIANB/wFNBEAgA0EDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwBC0EfIQAgA0H///8HTQRAIANBCHYiACAAQYD+P2pBEHZBCHEiAnQiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASACciAAcmsiAEEBdCADIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQICQAJAIAlBASAAdCIBcUUEQEGMCCABIAlyNgIAIAIgBjYCACAGIAI2AhgMAQsgA0EAQRkgAEEBdmsgAEEfRht0IQAgAigCACEIA0AgCCIBKAIEQXhxIANGDQIgAEEddiECIABBAXQhACABIAJBBHFqIgIoAhAiCA0ACyACIAY2AhAgBiABNgIYCyAGIAY2AgwgBiAGNgIIDAELIAEoAggiACAGNgIMIAEgBjYCCCAGQQA2AhggBiABNgIMIAYgADYCCAsgBEEIaiEADAELAkAgC0UNAAJAIAEoAhwiAkECdEG4CmoiACgCACABRgRAIAAgBDYCACAEDQFBjAggBkF+IAJ3cTYCAAwCCyALQRBBFCALKAIQIAFGG2ogBDYCACAERQ0BCyAEIAs2AhggASgCECIABEAgBCAANgIQIAAgBDYCGAsgASgCFCIARQ0AIAQgADYCFCAAIAQ2AhgLAkAgA0EPTQRAIAEgAyAIaiIAQQNyNgIEIAAgAWoiACAAKAIEQQFyNgIEDAELIAEgCEEDcjYCBCAJIANBAXI2AgQgAyAJaiADNgIAIAoEQCAKQQN2IgBBA3RBsAhqIQRBnAgoAgAhAgJ/QQEgAHQiACAFcUUEQEGICCAAIAVyNgIAIAQMAQsgBCgCCAshACAEIAI2AgggACACNgIMIAIgBDYCDCACIAA2AggLQZwIIAk2AgBBkAggAzYCAAsgAUEIaiEACyAMQRBqJAAgAAsQACMAIABrQXBxIgAkACAACwYAIAAkAAsEACMAC4AJAgh/BH4jAEGQAWsiBiQAIAYgBS0AA0EYdEGAgIAYcSAFLwAAIAUtAAJBEHRycjYCACAGIAUoAANBAnZBg/7/H3E2AgQgBiAFKAAGQQR2Qf+B/x9xNgIIIAYgBSgACUEGdkH//8AfcTYCDCAFLwANIQggBS0ADyEJIAZCADcCFCAGQgA3AhwgBkEANgIkIAYgCCAJQRB0QYCAPHFyNgIQIAYgBSgAEDYCKCAGIAUoABQ2AiwgBiAFKAAYNgIwIAUoABwhBSAGQQA6AEwgBkEANgI4IAYgBTYCNCAGIAEgAhAEIAQEQCAGIAMgBBAECyAGKAI4IgEEQCAGQTxqIgIgAWpBAToAACABQQFqQQ9NBEAgASAGakE9aiEEAkBBDyABayIDRQ0AIAMgBGoiAUEBa0EAOgAAIARBADoAACADQQNJDQAgAUECa0EAOgAAIARBADoAASABQQNrQQA6AAAgBEEAOgACIANBB0kNACABQQRrQQA6AAAgBEEAOgADIANBCUkNACAEQQAgBGtBA3EiAWoiBEEANgIAIAQgAyABa0F8cSIBaiIDQQRrQQA2AgAgAUEJSQ0AIARBADYCCCAEQQA2AgQgA0EIa0EANgIAIANBDGtBADYCACABQRlJDQAgBEEANgIYIARBADYCFCAEQQA2AhAgBEEANgIMIANBEGtBADYCACADQRRrQQA2AgAgA0EYa0EANgIAIANBHGtBADYCACABIARBBHFBGHIiAWsiA0EgSQ0AIAEgBGohAQNAIAFCADcDGCABQgA3AxAgAUIANwMIIAFCADcDACABQSBqIQEgA0EgayIDQR9LDQALCwsgBkEBOgBMIAYgAkEQEAILIAY1AjQhECAGNQIwIREgBjUCLCEOIAAgBjUCKCAGKAIkIAYoAiAgBigCHCAGKAIYIgNBGnZqIgJBGnZqIgFBGnZqIgtBgICAYHIgAUH///8fcSINIAJB////H3EiCCAGKAIUIAtBGnZBBWxqIgFB////H3EiCUEFaiIFQRp2IANB////H3EgAUEadmoiA2oiAUEadmoiAkEadmoiBEEadmoiDEEfdSIHIANxIAEgDEEfdkEBayIDQf///x9xIgpxciIBQRp0IAUgCnEgByAJcXJyrXwiDzwAACAAIA9CGIg8AAMgACAPQhCIPAACIAAgD0IIiDwAASAAIA4gByAIcSACIApxciICQRR0IAFBBnZyrXwgD0IgiHwiDjwABCAAIA5CGIg8AAcgACAOQhCIPAAGIAAgDkIIiDwABSAAIBEgByANcSAEIApxciIBQQ50IAJBDHZyrXwgDkIgiHwiDjwACCAAIA5CGIg8AAsgACAOQhCIPAAKIAAgDkIIiDwACSAAIBAgAyAMcSAHIAtxckEIdCABQRJ2cq18IA5CIIh8Ig48AAwgACAOQhiIPAAPIAAgDkIQiDwADiAAIA5CCIg8AA0gBkIANwIwIAZCADcCKCAGQgA3AiAgBkIANwIYIAZCADcCECAGQgA3AgggBkIANwIAIAZBkAFqJAALpwwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAMgAygCACIBayIDQZgIKAIASQ0BIAAgAWohACADQZwIKAIARwRAIAFB/wFNBEAgAygCCCICIAFBA3YiBEEDdEGwCGpGGiACIAMoAgwiAUYEQEGICEGICCgCAEF+IAR3cTYCAAwDCyACIAE2AgwgASACNgIIDAILIAMoAhghBgJAIAMgAygCDCIBRwRAIAMoAggiAiABNgIMIAEgAjYCCAwBCwJAIANBFGoiAigCACIEDQAgA0EQaiICKAIAIgQNAEEAIQEMAQsDQCACIQcgBCIBQRRqIgIoAgAiBA0AIAFBEGohAiABKAIQIgQNAAsgB0EANgIACyAGRQ0BAkAgAyADKAIcIgJBAnRBuApqIgQoAgBGBEAgBCABNgIAIAENAUGMCEGMCCgCAEF+IAJ3cTYCAAwDCyAGQRBBFCAGKAIQIANGG2ogATYCACABRQ0CCyABIAY2AhggAygCECICBEAgASACNgIQIAIgATYCGAsgAygCFCICRQ0BIAEgAjYCFCACIAE2AhgMAQsgBSgCBCIBQQNxQQNHDQBBkAggADYCACAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAMgBU8NACAFKAIEIgFBAXFFDQACQCABQQJxRQRAIAVBoAgoAgBGBEBBoAggAzYCAEGUCEGUCCgCACAAaiIANgIAIAMgAEEBcjYCBCADQZwIKAIARw0DQZAIQQA2AgBBnAhBADYCAA8LIAVBnAgoAgBGBEBBnAggAzYCAEGQCEGQCCgCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQACQCABQf8BTQRAIAUoAggiAiABQQN2IgRBA3RBsAhqRhogAiAFKAIMIgFGBEBBiAhBiAgoAgBBfiAEd3E2AgAMAgsgAiABNgIMIAEgAjYCCAwBCyAFKAIYIQYCQCAFIAUoAgwiAUcEQCAFKAIIIgJBmAgoAgBJGiACIAE2AgwgASACNgIIDAELAkAgBUEUaiICKAIAIgQNACAFQRBqIgIoAgAiBA0AQQAhAQwBCwNAIAIhByAEIgFBFGoiAigCACIEDQAgAUEQaiECIAEoAhAiBA0ACyAHQQA2AgALIAZFDQACQCAFIAUoAhwiAkECdEG4CmoiBCgCAEYEQCAEIAE2AgAgAQ0BQYwIQYwIKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiABNgIAIAFFDQELIAEgBjYCGCAFKAIQIgIEQCABIAI2AhAgAiABNgIYCyAFKAIUIgJFDQAgASACNgIUIAIgATYCGAsgAyAAQQFyNgIEIAAgA2ogADYCACADQZwIKAIARw0BQZAIIAA2AgAPCyAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAAsgAEH/AU0EQCAAQQN2IgFBA3RBsAhqIQACf0GICCgCACICQQEgAXQiAXFFBEBBiAggASACcjYCACAADAELIAAoAggLIQIgACADNgIIIAIgAzYCDCADIAA2AgwgAyACNgIIDwtBHyECIANCADcCECAAQf///wdNBEAgAEEIdiIBIAFBgP4/akEQdkEIcSIBdCICIAJBgOAfakEQdkEEcSICdCIEIARBgIAPakEQdkECcSIEdEEPdiABIAJyIARyayIBQQF0IAAgAUEVanZBAXFyQRxqIQILIAMgAjYCHCACQQJ0QbgKaiEBAkACQAJAQYwIKAIAIgRBASACdCIHcUUEQEGMCCAEIAdyNgIAIAEgAzYCACADIAE2AhgMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgASgCACEBA0AgASIEKAIEQXhxIABGDQIgAkEddiEBIAJBAXQhAiAEIAFBBHFqIgdBEGooAgAiAQ0ACyAHIAM2AhAgAyAENgIYCyADIAM2AgwgAyADNgIIDAELIAQoAggiACADNgIMIAQgAzYCCCADQQA2AhggAyAENgIMIAMgADYCCAtBqAhBqAgoAgBBAWsiAEF/IAAbNgIACwsLCQEAQYEICwIGUA==",!me.startsWith(ue)){var he=me;me=r.locateFile?r.locateFile(he,d):d+he}function xt(){var re=me;try{if(re==me&&v)return new Uint8Array(v);var fe=Sr(re);if(fe)return fe;if(h)return h(re);throw"both async and sync fetching of the wasm failed"}catch(ve){ee(ve)}}c(xt,"pa");function kt(){if(!v&&(a||u)){if(typeof fetch=="function"&&!me.startsWith("file://"))return fetch(me,{credentials:"same-origin"}).then(function(re){if(!re.ok)throw"failed to load wasm binary file at '"+me+"'";return re.arrayBuffer()}).catch(function(){return xt()});if(g)return new Promise(function(re,fe){g(me,function(ve){re(new Uint8Array(ve))},fe)})}return Promise.resolve().then(function(){return xt()})}c(kt,"qa");function Xt(re){for(;0<re.length;){var fe=re.shift();if(typeof fe=="function")fe(r);else{var ve=fe.m;typeof ve=="number"?fe.l===void 0?F.get(ve)():F.get(ve)(fe.l):ve(fe.l===void 0?null:fe.l)}}}c(Xt,"X");var Ar=!1,Br=typeof atob=="function"?atob:function(re){var fe="",ve=0;re=re.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++)),ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++)),Jt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++)),Xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(re.charAt(ve++));Be=Be<<2|ut>>4,ut=(ut&15)<<4|Jt>>2;var kr=(Jt&3)<<6|Xr;fe+=String.fromCharCode(Be),Jt!==64&&(fe+=String.fromCharCode(ut)),Xr!==64&&(fe+=String.fromCharCode(kr))}while(ve<re.length);return fe};function Sr(re){if(re.startsWith(ue)){if(re=re.slice(ue.length),typeof l=="boolean"&&l){var fe=Buffer.from(re,"base64");fe=new Uint8Array(fe.buffer,fe.byteOffset,fe.byteLength)}else try{var ve=Br(re),Be=new Uint8Array(ve.length);for(re=0;re<ve.length;++re)Be[re]=ve.charCodeAt(re);fe=Be}catch{throw Error("Converting base64 string to bytes failed.")}return fe}}c(Sr,"H");var Ai={a:c(function(re){var fe=L.length;if(re>>>=0,2147483648<re)return!1;for(var ve=1;4>=ve;ve*=2){var Be=fe*(1+.2/ve);Be=Math.min(Be,re+100663296),Be=Math.max(re,Be),0<Be%65536&&(Be+=65536-Be%65536);e:{try{H.grow(Math.min(2147483648,Be)-C.byteLength+65535>>>16),T();var ut=1;break e}catch{}ut=void 0}if(ut)return!0}return!1},"a")};(function(){function re(ut){r.asm=ut.exports,H=r.asm.b,T(),F=r.asm.j,B.unshift(r.asm.c),k--,r.monitorRunDependencies&&r.monitorRunDependencies(k),k==0&&(W!==null&&(clearInterval(W),W=null),q&&(ut=q,q=null,ut()))}c(re,"a");function fe(ut){re(ut.instance)}c(fe,"c");function ve(ut){return kt().then(function(Jt){return WebAssembly.instantiate(Jt,Be)}).then(ut,function(Jt){E("failed to asynchronously prepare wasm: "+Jt),ee(Jt)})}c(ve,"d");var Be={a:Ai};if(k++,r.monitorRunDependencies&&r.monitorRunDependencies(k),r.instantiateWasm)try{return r.instantiateWasm(Be,re)}catch(ut){return E("Module.instantiateWasm callback failed with error: "+ut),!1}return(function(){return v||typeof WebAssembly.instantiateStreaming!="function"||me.startsWith(ue)||me.startsWith("file://")||typeof fetch!="function"?ve(fe):fetch(me,{credentials:"same-origin"}).then(function(ut){return WebAssembly.instantiateStreaming(ut,Be).then(fe,function(Jt){return E("wasm streaming compile failed: "+Jt),E("falling back to ArrayBuffer instantiation"),ve(fe)})})})().catch(i),{}})(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.c).apply(null,arguments)},r._poly1305_auth=function(){return(r._poly1305_auth=r.asm.d).apply(null,arguments)};var mo=r.stackSave=function(){return(mo=r.stackSave=r.asm.e).apply(null,arguments)},Bs=r.stackRestore=function(){return(Bs=r.stackRestore=r.asm.f).apply(null,arguments)},_o=r.stackAlloc=function(){return(_o=r.stackAlloc=r.asm.g).apply(null,arguments)};r._malloc=function(){return(r._malloc=r.asm.h).apply(null,arguments)},r._free=function(){return(r._free=r.asm.i).apply(null,arguments)},r.cwrap=function(re,fe,ve,Be){ve=ve||[];var ut=ve.every(function(Jt){return Jt==="number"});return fe!=="string"&&ut&&!Be?Y(re):function(){return X(re,fe,ve,arguments)}};var bi;q=c(function re(){bi||xi(),bi||(q=re)},"ta");function xi(){function re(){if(!bi&&(bi=!0,r.calledRun=!0,!D)){if(Xt(B),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var fe=r.postRun.shift();Z.unshift(fe)}Xt(Z)}}if(c(re,"a"),!(0<k)){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)te();Xt(j),0<k||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),re()},1)):re())}}if(c(xi,"Z"),r.run=xi,r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return xi(),e.ready})})();typeof ka=="object"&&typeof Qu=="object"?Qu.exports=qu:typeof define=="function"&&define.amd?define([],function(){return qu}):typeof ka=="object"&&(ka.createPoly1305=qu)});var Mn=le((PF,Ug)=>{"use strict";var{createCipheriv:Zi,createDecipheriv:Ra,createHmac:Vu,randomFillSync:ci,timingSafeEqual:Ku}=require("crypto"),{readUInt32BE:Xo,writeUInt32BE:$r}=Vr(),Fn=Buffer[Symbol.species],Og=2**32-1,$g=Buffer.alloc(0),Gi=Buffer.alloc(4),Na=new Map,ui=35e3,Gu,ll,fl,dl,pl,hl,gl;try{Gu=require("./crypto/build/Release/sshcrypto.node"),{AESGCMCipher:ll,ChaChaPolyCipher:fl,GenericCipher:dl,AESGCMDecipher:pl,ChaChaPolyDecipher:hl,GenericDecipher:gl}=Gu}catch{}var fr=1,eI=(()=>{function t(e,r,n,i,o,s,a){return{sslName:e,blockLen:r,keyLen:n,ivLen:i!==0||a&fr?i:r,authLen:o,discardLen:s,stream:!!(a&fr)}}return c(t,"info"),{"chacha20-poly1305@openssh.com":t("chacha20",8,64,0,16,0,fr),"aes128-gcm":t("aes-128-gcm",16,16,12,16,0,fr),"aes256-gcm":t("aes-256-gcm",16,32,12,16,0,fr),"aes128-gcm@openssh.com":t("aes-128-gcm",16,16,12,16,0,fr),"aes256-gcm@openssh.com":t("aes-256-gcm",16,32,12,16,0,fr),"aes128-cbc":t("aes-128-cbc",16,16,0,0,0,0),"aes192-cbc":t("aes-192-cbc",16,24,0,0,0,0),"aes256-cbc":t("aes-256-cbc",16,32,0,0,0,0),"rijndael-cbc@lysator.liu.se":t("aes-256-cbc",16,32,0,0,0,0),"3des-cbc":t("des-ede3-cbc",8,24,0,0,0,0),"blowfish-cbc":t("bf-cbc",8,16,0,0,0,0),"idea-cbc":t("idea-cbc",8,16,0,0,0,0),"cast128-cbc":t("cast-cbc",8,16,0,0,0,0),"aes128-ctr":t("aes-128-ctr",16,16,16,0,0,fr),"aes192-ctr":t("aes-192-ctr",16,24,16,0,0,fr),"aes256-ctr":t("aes-256-ctr",16,32,16,0,0,fr),"3des-ctr":t("des-ede3",8,24,8,0,0,fr),"blowfish-ctr":t("bf-ecb",8,16,8,0,0,fr),"cast128-ctr":t("cast5-ecb",8,16,8,0,0,fr),arcfour:t("rc4",8,16,0,0,1536,fr),arcfour128:t("rc4",8,16,0,0,1536,fr),arcfour256:t("rc4",8,32,0,0,1536,fr),arcfour512:t("rc4",8,64,0,0,1536,fr)}})(),tI=(()=>{function t(e,r,n,i){return{sslName:e,len:r,actualLen:n,isETM:i}}return c(t,"info"),{"hmac-md5":t("md5",16,16,!1),"hmac-md5-96":t("md5",16,12,!1),"hmac-ripemd160":t("ripemd160",20,20,!1),"hmac-sha1":t("sha1",20,20,!1),"hmac-sha1-etm@openssh.com":t("sha1",20,20,!0),"hmac-sha1-96":t("sha1",20,12,!1),"hmac-sha2-256":t("sha256",32,32,!1),"hmac-sha2-256-etm@openssh.com":t("sha256",32,32,!0),"hmac-sha2-256-96":t("sha256",32,12,!1),"hmac-sha2-512":t("sha512",64,64,!1),"hmac-sha2-512-etm@openssh.com":t("sha512",64,64,!0),"hmac-sha2-512-96":t("sha512",64,12,!1)}})(),Zu=class{static{c(this,"NullCipher")}constructor(e,r){this.outSeqno=e,this._onWrite=r,this._dead=!1}free(){this._dead=!0}allocPacket(e){let r=5+e,n=8-(r&7);n<4&&(n+=8),r+=n;let i=Buffer.allocUnsafe(r);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){this._dead||(this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},Dg=Buffer.alloc(32),wr=Buffer.alloc(16),Yo,Jo,ml,Yu=class{static{c(this,"ChaChaPolyCipherNative")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encKeyMain=r.cipherKey.slice(0,32),this._encKeyPktLen=r.cipherKey.slice(32),this._dead=!1}free(){this._dead=!0}allocPacket(e){let r=5+e,n=8-(r-4&7);n<4&&(n+=8),r+=n;let i=Buffer.allocUnsafe(r);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){if(this._dead)return;wr[0]=0,$r(wr,this.outSeqno,12);let r=Zi("chacha20",this._encKeyMain,wr).update(Dg),n=Zi("chacha20",this._encKeyPktLen,wr).update(e.slice(0,4));this._onWrite(n),wr[0]=1;let i=Zi("chacha20",this._encKeyMain,wr).update(e.slice(4));this._onWrite(i),ml(Jo,n,n.length,i,i.length,r);let o=Buffer.allocUnsafe(16);o.set(new Uint8Array(Yo.HEAPU8.buffer,Jo,16),0),this._onWrite(o),this.outSeqno=this.outSeqno+1>>>0}},Xu=class{static{c(this,"ChaChaPolyCipherBinding")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new fl(r.cipherKey),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let r=5+e,n=8-(r-4&7);n<4&&(n+=8),r+=n;let i=Buffer.allocUnsafe(r+16);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){this._dead||(this._instance.encrypt(e,this.outSeqno),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},Ju=class{static{c(this,"AESGCMCipherNative")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encSSLName=r.cipherInfo.sslName,this._encKey=r.cipherKey,this._encIV=r.cipherIV,this._dead=!1}free(){this._dead=!0}allocPacket(e){let r=5+e,n=16-(r-4&15);n<4&&(n+=16),r+=n;let i=Buffer.allocUnsafe(r);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){if(this._dead)return;let r=Zi(this._encSSLName,this._encKey,this._encIV);r.setAutoPadding(!1);let n=e.slice(0,4);r.setAAD(n),this._onWrite(n);let i=r.update(e.slice(4));this._onWrite(i);let o=r.final();o.length&&this._onWrite(o);let s=r.getAuthTag();this._onWrite(s),Bg(this._encIV),this.outSeqno=this.outSeqno+1>>>0}},el=class{static{c(this,"AESGCMCipherBinding")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new ll(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let r=5+e,n=16-(r-4&15);n<4&&(n+=16),r+=n;let i=Buffer.allocUnsafe(r+16);return $r(i,r-4,0),i[4]=n,ci(i,5+e,n),i}encrypt(e){this._dead||(this._instance.encrypt(e),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},tl=class{static{c(this,"GenericCipherNative")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._cipherInstance=Zi(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._aadLen=this._macETM?4:0,this._dead=!1;let n=r.cipherInfo.discardLen;if(n){let i=Na.get(n);i===void 0&&(i=Buffer.alloc(n),Na.set(n,i)),this._cipherInstance.update(i)}}free(){this._dead=!0}allocPacket(e){let r=this._encBlockLen,n=5+e,i=r-(n-this._aadLen&r-1);i<4&&(i+=r),n+=i;let o=Buffer.allocUnsafe(n);return $r(o,n-4,0),o[4]=i,ci(o,5+e,i),o}encrypt(e){if(this._dead)return;let r;if(this._macETM){let i=new Uint8Array(e.buffer,e.byteOffset,4),o=this._cipherInstance.update(new Uint8Array(e.buffer,e.byteOffset+4,e.length-4));this._onWrite(i),this._onWrite(o),r=Vu(this._macSSLName,this._macKey),$r(Gi,this.outSeqno,0),r.update(Gi),r.update(i),r.update(o)}else{let i=this._cipherInstance.update(e);this._onWrite(i),r=Vu(this._macSSLName,this._macKey),$r(Gi,this.outSeqno,0),r.update(Gi),r.update(e)}let n=r.digest();n.length>this._macActualLen&&(n=n.slice(0,this._macActualLen)),this._onWrite(n),this.outSeqno=this.outSeqno+1>>>0}},rl=class{static{c(this,"GenericCipherBinding")}constructor(e){let r=e.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._macLen=r.macInfo.len,this._macActualLen=r.macInfo.actualLen,this._aadLen=r.macInfo.isETM?4:0,this._instance=new dl(r.cipherInfo.sslName,r.cipherKey,r.cipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(e){let r=this._encBlockLen,n=5+e,i=r-(n-this._aadLen&r-1);i<4&&(i+=r),n+=i;let o=Buffer.allocUnsafe(n+this._macLen);return $r(o,n-4,0),o[4]=i,ci(o,5+e,i),o}encrypt(e){this._dead||(this._instance.encrypt(e,this.outSeqno),this._macActualLen<this._macLen&&(e=new Fn(e.buffer,e.byteOffset,e.length-(this._macLen-this._macActualLen))),this._onWrite(e),this.outSeqno=this.outSeqno+1>>>0)}},nl=class{static{c(this,"NullDecipher")}constructor(e,r){this.inSeqno=e,this._onPayload=r,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,n-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+e[r++];if(this._lenBytes<4)return;if(this._len>ui||this._len<8||(4+this._len&7)!==0)throw new Error("Bad packet length");if(r>=n)return}if(this._packetPos<this._len){let o=Math.min(this._len-this._packetPos,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),r+=o,this._packetPos+=o,this._packetPos<this._len)return}let i=this._packet?new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):$g;this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},il=class{static{c(this,"ChaChaPolyDecipherNative")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decKeyMain=r.decipherKey.slice(0,32),this._decKeyPktLen=r.decipherKey.slice(32),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._calcMac=Buffer.allocUnsafe(16),this._macPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenPos<4){let a=Math.min(4-this._lenPos,n-r);for(;a--;)this._lenBuf[this._lenPos++]=e[r++];if(this._lenPos<4)return;wr[0]=0,$r(wr,this.inSeqno,12);let u=Ra("chacha20",this._decKeyPktLen,wr).update(this._lenBuf);if(this._len=Xo(u,0),this._len>ui||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length")}if(this._pktLen<this._len){if(r>=n)return;let a=Math.min(this._len-this._pktLen,n-r),u;if(r!==0||a!==n?u=new Uint8Array(e.buffer,e.byteOffset+r,a):u=e,a===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._pktLen)),r+=a,this._pktLen+=a,this._pktLen<this._len||r>=n)return}{let a=Math.min(16-this._macPos,n-r);if(r!==0||a!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,a),this._macPos):this._mac.set(e,this._macPos),r+=a,this._macPos+=a,this._macPos<16)return}wr[0]=0,$r(wr,this.inSeqno,12);let i=Zi("chacha20",this._decKeyMain,wr).update(Dg);if(ml(Jo,this._lenBuf,4,this._packet,this._packet.length,i),this._calcMac.set(new Uint8Array(Yo.HEAPU8.buffer,Jo,16),0),!Ku(this._calcMac,this._mac))throw new Error("Invalid MAC");wr[0]=1;let o=Ra("chacha20",this._decKeyMain,wr).update(this._packet),s=new Fn(o.buffer,o.byteOffset+1,o.length-o[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let a=this._onPayload(s);if(a!==void 0)return a===!1?r:a}}}},ol=class{static{c(this,"ChaChaPolyDecipherBinding")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new hl(r.decipherKey),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._macPos=0}free(){this._instance.free()}decrypt(e,r,n){for(;r<n;){if(this._lenPos<4){let o=Math.min(4-this._lenPos,n-r);for(;o--;)this._lenBuf[this._lenPos++]=e[r++];if(this._lenPos<4)return;if(this._len=this._instance.decryptLen(this._lenBuf,this.inSeqno),this._len>ui||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length");if(r>=n)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(16-this._macPos,n-r);if(r!==0||o!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._macPos):this._mac.set(e,this._macPos),r+=o,this._macPos+=o,this._macPos<16)return}this._instance.decrypt(this._packet,this._mac,this.inSeqno);let i=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},sl=class{static{c(this,"AESGCMDecipherNative")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=null,this._decipherSSLName=r.decipherInfo.sslName,this._decipherKey=r.decipherKey,this._decipherIV=r.decipherIV,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,n-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+e[r++];if(this._lenBytes<4)return;if(this._len+20>ui||this._len<16||(this._len&15)!==0)throw new Error("Bad packet length");this._decipherInstance=Ra(this._decipherSSLName,this._decipherKey,this._decipherIV),this._decipherInstance.setAutoPadding(!1),this._decipherInstance.setAAD(rI(this._len))}if(this._pktLen<this._len){if(r>=n)return;let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=this._decipherInstance.update(new Uint8Array(e.buffer,e.byteOffset+r,o)):s=this._decipherInstance.update(e),s.length&&(o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),this._packetPos+=s.length),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(16-this._tagPos,n-r);if(r!==0||o!==n?this._tag.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._tagPos):this._tag.set(e,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}{this._decipherInstance.setAuthTag(this._tag);let o=this._decipherInstance.final();o.length&&(this._packet?this._packet.set(o,this._packetPos):this._packet=o)}let i=this._packet?new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):$g;this.inSeqno=this.inSeqno+1>>>0,Bg(this._decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},al=class{static{c(this,"AESGCMDecipherBinding")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new pl(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(e,r,n){for(;r<n;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,n-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+e[r++];if(this._lenBytes<4)return;if(this._len+20>ui||this._len<16||(this._len&15)!==0)throw new Error(`Bad packet length: ${this._len}`)}if(this._pktLen<this._len){if(r>=n)return;let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(16-this._tagPos,n-r);if(r!==0||o!==n?this._tag.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._tagPos):this._tag.set(e,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}this._instance.decrypt(this._packet,this._len,this._tag);let i=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}},cl=class{static{c(this,"GenericDecipherNative")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=Ra(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._decipherInstance.setAutoPadding(!1),this._block=Buffer.allocUnsafe(r.macInfo.isETM?4:r.decipherInfo.blockLen),this._blockSize=r.decipherInfo.blockLen,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._macInstance=null;let n=r.decipherInfo.discardLen;if(n){let i=Na.get(n);i===void 0&&(i=Buffer.alloc(n),Na.set(n,i)),this._decipherInstance.update(i)}}free(){}decrypt(e,r,n){for(;r<n;){if(this._blockPos<this._block.length){let s=Math.min(this._block.length-this._blockPos,n-r);if(r!==0||s!==n||s<e.length?this._block.set(new Uint8Array(e.buffer,e.byteOffset+r,s),this._blockPos):this._block.set(e,this._blockPos),r+=s,this._blockPos+=s,this._blockPos<this._block.length)return;let a,u;if(this._macETM?this._len=u=Xo(this._block,0):(a=this._decipherInstance.update(this._block),this._len=Xo(a,0),u=4+this._len-this._blockSize),this._len>ui||this._len<5||(u&this._blockSize-1)!==0)throw new Error("Bad packet length");if(this._macInstance=Vu(this._macSSLName,this._macKey),$r(Gi,this.inSeqno,0),this._macInstance.update(Gi),this._macETM?this._macInstance.update(this._block):(this._macInstance.update(new Uint8Array(a.buffer,a.byteOffset,4)),this._pktLen=a.length-4,this._packetPos=this._pktLen,this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(a.buffer,a.byteOffset+4,this._packetPos),0)),r>=n)return}if(this._pktLen<this._len){let s=Math.min(this._len-this._pktLen,n-r),a;r!==0||s!==n?a=new Uint8Array(e.buffer,e.byteOffset+r,s):a=e,this._macETM&&this._macInstance.update(a);let u=this._decipherInstance.update(a);if(u.length&&(s===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._packetPos)),this._packetPos+=u.length),r+=s,this._pktLen+=s,this._pktLen<this._len||r>=n)return}{let s=Math.min(this._macActualLen-this._macPos,n-r);if(r!==0||s!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,s),this._macPos):this._mac.set(e,this._macPos),r+=s,this._macPos+=s,this._macPos<this._macActualLen)return}this._macETM||this._macInstance.update(this._packet);let i=this._macInstance.digest();if(this._macActualLen<i.length&&(i=new Uint8Array(i.buffer,i.byteOffset,this._macActualLen)),!nI(i,this._mac))throw new Error("Invalid MAC");let o=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._macPos=0,this._macInstance=null;{let s=this._onPayload(o);if(s!==void 0)return s===!1?r:s}}}},ul=class{static{c(this,"GenericDecipherBinding")}constructor(e){let r=e.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new gl(r.decipherInfo.sslName,r.decipherKey,r.decipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM,r.macInfo.actualLen),this._block=Buffer.allocUnsafe(r.macInfo.isETM||r.decipherInfo.stream?4:r.decipherInfo.blockLen),this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM}free(){this._instance.free()}decrypt(e,r,n){for(;r<n;){if(this._blockPos<this._block.length){let o=Math.min(this._block.length-this._blockPos,n-r);if(r!==0||o!==n||o<e.length?this._block.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._blockPos):this._block.set(e,this._blockPos),r+=o,this._blockPos+=o,this._blockPos<this._block.length)return;let s;if(this._macETM?this._len=s=Xo(this._block,0):(this._instance.decryptBlock(this._block),this._len=Xo(this._block,0),s=4+this._len-this._block.length),this._len>ui||this._len<5||(s&this._block.length-1)!==0)throw new Error("Bad packet length");if(this._macETM||(this._pktLen=this._block.length-4,this._pktLen&&(this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(this._block.buffer,this._block.byteOffset+4,this._pktLen),0))),r>=n)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,n-r),s;if(r!==0||o!==n?s=new Uint8Array(e.buffer,e.byteOffset+r,o):s=e,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=n)return}{let o=Math.min(this._macActualLen-this._macPos,n-r);if(r!==0||o!==n?this._mac.set(new Uint8Array(e.buffer,e.byteOffset+r,o),this._macPos):this._mac.set(e,this._macPos),r+=o,this._macPos+=o,this._macPos<this._macActualLen)return}this._instance.decrypt(this._packet,this.inSeqno,this._block,this._mac);let i=new Fn(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._macPos=0,this._macInstance=null;{let o=this._onPayload(i);if(o!==void 0)return o===!1?r:o}}}};function Bg(t){++t[11]>>>8&&++t[10]>>>8&&++t[9]>>>8&&++t[8]>>>8&&++t[7]>>>8&&++t[6]>>>8&&++t[5]>>>8&&++t[4]>>>8}c(Bg,"ivIncrement");var rI=(()=>{let t=Buffer.alloc(4);return e=>(t[0]=e>>>24,t[1]=e>>>16,t[2]=e>>>8,t[3]=e,t)})();function nI(t,e){return t.length!==e.length?(Ku(t,t),!1):Ku(t,e)}c(nI,"timingSafeEquals");function iI(t){if(typeof t!="object"||t===null)throw new Error("Invalid config");if(typeof t.outbound!="object"||t.outbound===null)throw new Error("Invalid outbound");let e=t.outbound;if(typeof e.onWrite!="function")throw new Error("Invalid outbound.onWrite");if(typeof e.cipherInfo!="object"||e.cipherInfo===null)throw new Error("Invalid outbound.cipherInfo");if(!Buffer.isBuffer(e.cipherKey)||e.cipherKey.length!==e.cipherInfo.keyLen)throw new Error("Invalid outbound.cipherKey");if(e.cipherInfo.ivLen&&(!Buffer.isBuffer(e.cipherIV)||e.cipherIV.length!==e.cipherInfo.ivLen))throw new Error("Invalid outbound.cipherIV");if(typeof e.seqno!="number"||e.seqno<0||e.seqno>Og)throw new Error("Invalid outbound.seqno");let r=!!e.forceNative;switch(e.cipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return ll&&!r?new el(t):new Ju(t);case"chacha20":return fl&&!r?new Xu(t):new Yu(t);default:{if(typeof e.macInfo!="object"||e.macInfo===null)throw new Error("Invalid outbound.macInfo");if(!Buffer.isBuffer(e.macKey)||e.macKey.length!==e.macInfo.len)throw new Error("Invalid outbound.macKey");return dl&&!r?new rl(t):new tl(t)}}}c(iI,"createCipher");function oI(t){if(typeof t!="object"||t===null)throw new Error("Invalid config");if(typeof t.inbound!="object"||t.inbound===null)throw new Error("Invalid inbound");let e=t.inbound;if(typeof e.onPayload!="function")throw new Error("Invalid inbound.onPayload");if(typeof e.decipherInfo!="object"||e.decipherInfo===null)throw new Error("Invalid inbound.decipherInfo");if(!Buffer.isBuffer(e.decipherKey)||e.decipherKey.length!==e.decipherInfo.keyLen)throw new Error("Invalid inbound.decipherKey");if(e.decipherInfo.ivLen&&(!Buffer.isBuffer(e.decipherIV)||e.decipherIV.length!==e.decipherInfo.ivLen))throw new Error("Invalid inbound.decipherIV");if(typeof e.seqno!="number"||e.seqno<0||e.seqno>Og)throw new Error("Invalid inbound.seqno");let r=!!e.forceNative;switch(e.decipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return pl&&!r?new al(t):new sl(t);case"chacha20":return hl&&!r?new ol(t):new il(t);default:{if(typeof e.macInfo!="object"||e.macInfo===null)throw new Error("Invalid inbound.macInfo");if(!Buffer.isBuffer(e.macKey)||e.macKey.length!==e.macInfo.len)throw new Error("Invalid inbound.macKey");return gl&&!r?new ul(t):new cl(t)}}}c(oI,"createDecipher");Ug.exports={CIPHER_INFO:eI,MAC_INFO:tI,bindingAvailable:!!Gu,init:new Promise(async(t,e)=>{try{Yo=await Ng()(),Jo=Yo._malloc(16),ml=Yo.cwrap("poly1305_auth",null,["number","array","number","array","number","array"])}catch(r){return e(r)}t()}),NullCipher:Zu,createCipher:iI,NullDecipher:nl,createDecipher:oI}});var jn=le((CF,Vg)=>{"use strict";var{createDecipheriv:yl,createECDH:sI,createHash:ts,createHmac:aI,createSign:cI,createVerify:uI,getCiphers:lI,sign:Lg,verify:zg}=require("crypto"),fI=lI(),{Ber:$e}=Ko(),dI=Fu().pbkdf,{CIPHER_INFO:rs}=Mn(),{eddsaSupported:El,SUPPORTED_CIPHER:pI}=An(),{bufferSlice:li,makeBufferParser:hI,readString:Re,readUInt32BE:es,writeUInt32BE:ur}=Vr(),bn=Symbol("Hash Algorithm"),Kr=Symbol("Private key PEM"),on=Symbol("Public key PEM"),Hn=Symbol("Public key SSH"),Yi=Symbol("Decrypted Key"),_l=Object.create(null);{let t=Object.keys(rs);for(let e=0;e<t.length;++e){let r=rs[t[e]].sslName;!r||_l[r]||(_l[r]=rs[t[e]])}}var Oa=hI();function Gr(t,e){e=e.base64Slice(0,e.length);let r=e.replace(/.{64}/g,`$&
9
- `);return e.length&63&&(r+=`
10
- `),`-----BEGIN ${t} KEY-----
11
- ${r}-----END ${t} KEY-----`}c(Gr,"makePEM");function ns(t,e){let r=Buffer.allocUnsafe(t.length+e.length);return r.set(t,0),r.set(e,t.length),r}c(ns,"combineBuffers");function Al(t,e){let r=t.length,n=t._pos||0;for(let i=0;i<e;++i){let o=r-n;if(n>=r||o<4)return!1;let s=es(t,n);if(o<4+s)return!1;n+=4+s}return t._pos=n,!0}c(Al,"skipFields");function is(t,e){let r=new $e.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.113549.1.1.1"),r.writeNull(),r.endSequence(),r.startSequence($e.BitString),r.writeByte(0),r.startSequence(),r.writeBuffer(t,$e.Integer),r.writeBuffer(e,$e.Integer),r.endSequence(),r.endSequence(),r.endSequence(),Gr("PUBLIC",r.buffer)}c(is,"genOpenSSLRSAPub");function os(t,e){let r=Buffer.allocUnsafe(15+e.length+4+t.length);ur(r,7,0),r.utf8Write("ssh-rsa",4,7);let n=11;return ur(r,e.length,n),r.set(e,n+=4),ur(r,t.length,n+=e.length),r.set(t,n+4),r}c(os,"genOpenSSHRSAPub");var Mg=(()=>{function t(n,i,o,s,a,u,l,d){let p=new $e.Writer;return p.startSequence(),p.writeInt(0,$e.Integer),p.writeBuffer(n,$e.Integer),p.writeBuffer(i,$e.Integer),p.writeBuffer(o,$e.Integer),p.writeBuffer(s,$e.Integer),p.writeBuffer(a,$e.Integer),p.writeBuffer(u,$e.Integer),p.writeBuffer(l,$e.Integer),p.writeBuffer(d,$e.Integer),p.endSequence(),p.buffer}c(t,"genRSAASN1Buf");function e(n){return BigInt(`0x${n.hexSlice(0,n.length)}`)}c(e,"bigIntFromBuffer");function r(n){let i=n.toString(16);if((i.length&1)!==0)i=`0${i}`;else{let o=i.charCodeAt(0);(o===56||o===57||o>=97&&o<=102)&&(i=`00${i}`)}return Buffer.from(i,"hex")}return c(r,"bigIntToBuffer"),c(function(i,o,s,a,u,l){let d=e(s),p=r(d%(e(u)-1n)),g=r(d%(e(l)-1n));return Gr("RSA PRIVATE",t(i,o,s,u,l,p,g,a))},"genOpenSSLRSAPriv")})();function ss(t,e,r,n){let i=new $e.Writer;return i.startSequence(),i.startSequence(),i.writeOID("1.2.840.10040.4.1"),i.startSequence(),i.writeBuffer(t,$e.Integer),i.writeBuffer(e,$e.Integer),i.writeBuffer(r,$e.Integer),i.endSequence(),i.endSequence(),i.startSequence($e.BitString),i.writeByte(0),i.writeBuffer(n,$e.Integer),i.endSequence(),i.endSequence(),Gr("PUBLIC",i.buffer)}c(ss,"genOpenSSLDSAPub");function as(t,e,r,n){let i=Buffer.allocUnsafe(15+t.length+4+e.length+4+r.length+4+n.length);ur(i,7,0),i.utf8Write("ssh-dss",4,7);let o=11;return ur(i,t.length,o),i.set(t,o+=4),ur(i,e.length,o+=t.length),i.set(e,o+=4),ur(i,r.length,o+=e.length),i.set(r,o+=4),ur(i,n.length,o+=r.length),i.set(n,o+4),i}c(as,"genOpenSSHDSAPub");function Fg(t,e,r,n,i){let o=new $e.Writer;return o.startSequence(),o.writeInt(0,$e.Integer),o.writeBuffer(t,$e.Integer),o.writeBuffer(e,$e.Integer),o.writeBuffer(r,$e.Integer),o.writeBuffer(n,$e.Integer),o.writeBuffer(i,$e.Integer),o.endSequence(),Gr("DSA PRIVATE",o.buffer)}c(Fg,"genOpenSSLDSAPriv");function Hg(t){let e=new $e.Writer;return e.startSequence(),e.startSequence(),e.writeOID("1.3.101.112"),e.endSequence(),e.startSequence($e.BitString),e.writeByte(0),e._ensure(t.length),e._buf.set(t,e._offset),e._offset+=t.length,e.endSequence(),e.endSequence(),Gr("PUBLIC",e.buffer)}c(Hg,"genOpenSSLEdPub");function jg(t){let e=Buffer.allocUnsafe(19+t.length);return ur(e,11,0),e.utf8Write("ssh-ed25519",4,11),ur(e,t.length,15),e.set(t,19),e}c(jg,"genOpenSSHEdPub");function gI(t){let e=new $e.Writer;return e.startSequence(),e.writeInt(0,$e.Integer),e.startSequence(),e.writeOID("1.3.101.112"),e.endSequence(),e.startSequence($e.OctetString),e.writeBuffer(t,$e.OctetString),e.endSequence(),e.endSequence(),Gr("PRIVATE",e.buffer)}c(gI,"genOpenSSLEdPriv");function bl(t,e){let r=new $e.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.10045.2.1"),r.writeOID(t),r.endSequence(),r.startSequence($e.BitString),r.writeByte(0),r._ensure(e.length),r._buf.set(e,r._offset),r._offset+=e.length,r.endSequence(),r.endSequence(),Gr("PUBLIC",r.buffer)}c(bl,"genOpenSSLECDSAPub");function xl(t,e){let r;switch(t){case"1.2.840.10045.3.1.7":r="nistp256";break;case"1.3.132.0.34":r="nistp384";break;case"1.3.132.0.35":r="nistp521";break;default:return}let n=Buffer.allocUnsafe(39+e.length);return ur(n,19,0),n.utf8Write(`ecdsa-sha2-${r}`,4,19),ur(n,8,23),n.utf8Write(r,27,8),ur(n,e.length,35),n.set(e,39),n}c(xl,"genOpenSSHECDSAPub");function mI(t,e,r){let n=new $e.Writer;return n.startSequence(),n.writeInt(1,$e.Integer),n.writeBuffer(r,$e.OctetString),n.startSequence(160),n.writeOID(t),n.endSequence(),n.startSequence(161),n.startSequence($e.BitString),n.writeByte(0),n._ensure(e.length),n._buf.set(e,n._offset),n._offset+=e.length,n.endSequence(),n.endSequence(),n.endSequence(),Gr("EC PRIVATE",n.buffer)}c(mI,"genOpenSSLECDSAPriv");function _I(t,e){let r=sI(t);return r.setPrivateKey(e),r.getPublicKey()}c(_I,"genOpenSSLECDSAPubFromPriv");var cs={sign:c(typeof Lg=="function"?function(e,r){let n=this[Kr];if(n===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[bn]);try{return Lg(r,e,n)}catch(i){return i}}:function(e,r){let n=this[Kr];if(n===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[bn]);let i=cI(r);i.update(e);try{return i.sign(n)}catch(o){return o}},"sign"),verify:c(typeof zg=="function"?function(e,r,n){let i=this[on];if(i===null)return new Error("No public key available");(!n||typeof n!="string")&&(n=this[bn]);try{return zg(n,e,i,r)}catch(o){return o}}:function(e,r,n){let i=this[on];if(i===null)return new Error("No public key available");(!n||typeof n!="string")&&(n=this[bn]);let o=uI(n);o.update(e);try{return o.verify(i,r)}catch(s){return s}},"verify"),isPrivateKey:c(function(){return this[Kr]!==null},"isPrivateKey"),getPrivatePEM:c(function(){return this[Kr]},"getPrivatePEM"),getPublicPEM:c(function(){return this[on]},"getPublicPEM"),getPublicSSH:c(function(){return this[Hn]},"getPublicSSH"),equals:c(function(e){let r=Qg(e);return r instanceof Error?!1:this.type===r.type&&this[Kr]===r[Kr]&&this[on]===r[on]&&this[Hn].equals(r[Hn])},"equals")};function $a(t,e,r,n,i,o,s){this.type=t,this.comment=e,this[Kr]=r,this[on]=n,this[Hn]=i,this[bn]=o,this[Yi]=s}c($a,"OpenSSH_Private");$a.prototype=cs;{let e=function(r,n,i){let o=[];if(r.length<8)return new Error("Malformed OpenSSH private key");let s=es(r,0),a=es(r,4);if(s!==a)return i?new Error("OpenSSH key integrity check failed -- bad passphrase?"):new Error("OpenSSH key integrity check failed");r._pos=8;let u,l;for(u=0;u<n;++u){let p,g,h,_,b=Re(r,r._pos,!0);if(b===void 0)return new Error("Malformed OpenSSH private key");switch(b){case"ssh-rsa":{let v=Re(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0)return new Error("Malformed OpenSSH private key");let H=Re(r,r._pos);if(H===void 0)return new Error("Malformed OpenSSH private key");let D=Re(r,r._pos);if(D===void 0)return new Error("Malformed OpenSSH private key");let J=Re(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");let Y=Re(r,r._pos);if(Y===void 0)return new Error("Malformed OpenSSH private key");h=is(v,w),_=os(v,w),g=Mg(v,w,H,D,J,Y),p="sha1";break}case"ssh-dss":{let v=Re(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0)return new Error("Malformed OpenSSH private key");let H=Re(r,r._pos);if(H===void 0)return new Error("Malformed OpenSSH private key");let D=Re(r,r._pos);if(D===void 0)return new Error("Malformed OpenSSH private key");let J=Re(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");h=ss(v,w,H,D),_=as(v,w,H,D),g=Fg(v,w,H,D,J),p="sha1";break}case"ssh-ed25519":{if(!El)return new Error(`Unsupported OpenSSH private key type: ${b}`);let v=Re(r,r._pos);if(v===void 0||v.length!==32)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0||w.length!==64)return new Error("Malformed OpenSSH private key");h=Hg(v),_=jg(v),g=gI(li(w,0,32)),p=null;break}case"ecdsa-sha2-nistp256":p="sha256",l="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":p===void 0&&(p="sha384",l="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(p===void 0&&(p="sha512",l="1.3.132.0.35"),!Al(r,1))return new Error("Malformed OpenSSH private key");let v=Re(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let w=Re(r,r._pos);if(w===void 0)return new Error("Malformed OpenSSH private key");h=bl(l,v),_=xl(l,v),g=mI(l,v,w);break}default:return new Error(`Unsupported OpenSSH private key type: ${b}`)}let E=Re(r,r._pos,!0);if(E===void 0)return new Error("Malformed OpenSSH private key");o.push(new $a(b,E,g,h,_,p,i))}let d=0;for(u=r._pos;u<r.length;++u)if(r[u]!==++d%255)return new Error("Malformed OpenSSH private key");return o};c(e,"parseOpenSSHPrivKeys");let t=/^-----BEGIN OPENSSH PRIVATE KEY-----(?:\r\n|\n)([\s\S]+)(?:\r\n|\n)-----END OPENSSH PRIVATE KEY-----$/;$a.parse=(r,n)=>{let i=t.exec(r);if(i===null)return null;let o,s=Buffer.from(i[1],"base64");if(s.length<31)return new Error("Malformed OpenSSH private key");let a=s.utf8Slice(0,15);if(a!=="openssh-key-v1\0")return new Error(`Unsupported OpenSSH key magic: ${a}`);let u=Re(s,15,!0);if(u===void 0)return new Error("Malformed OpenSSH private key");if(u!=="none"&&pI.indexOf(u)===-1)return new Error(`Unsupported cipher for OpenSSH key: ${u}`);let l=Re(s,s._pos,!0);if(l===void 0)return new Error("Malformed OpenSSH private key");if(l!=="none"){if(u==="none")return new Error("Malformed OpenSSH private key");if(l!=="bcrypt")return new Error(`Unsupported kdf name for OpenSSH key: ${l}`);if(!n)return new Error("Encrypted private OpenSSH key detected, but no passphrase given")}else if(u!=="none")return new Error("Malformed OpenSSH private key");let d,p,g;u!=="none"&&(d=rs[u]);let h=Re(s,s._pos);if(h===void 0)return new Error("Malformed OpenSSH private key");if(h.length)switch(l){case"none":return new Error("Malformed OpenSSH private key");case"bcrypt":{let b=Re(h,0);if(b===void 0||h._pos+4>h.length)return new Error("Malformed OpenSSH private key");let E=es(h,h._pos),v=Buffer.allocUnsafe(d.keyLen+d.ivLen);if(dI(n,n.length,b,b.length,v,v.length,E)!==0)return new Error("Failed to generate information to decrypt key");p=li(v,0,d.keyLen),g=li(v,d.keyLen,v.length);break}}else if(l!=="none")return new Error("Malformed OpenSSH private key");if(s._pos+3>=s.length)return new Error("Malformed OpenSSH private key");let _=es(s,s._pos);if(s._pos+=4,_>0){for(let E=0;E<_;++E){let v=Re(s,s._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");if(Re(v,0,!0)===void 0)return new Error("Malformed OpenSSH private key")}let b=Re(s,s._pos);if(b===void 0)return new Error("Malformed OpenSSH private key");if(p!==void 0){if(b.length<d.blockLen||b.length%d.blockLen!==0)return new Error("Malformed OpenSSH private key");try{let E={authTagLength:d.authLen},v=yl(d.sslName,p,g,E);if(v.setAutoPadding(!1),d.authLen>0){if(s.length-s._pos<d.authLen)return new Error("Malformed OpenSSH private key");v.setAuthTag(li(s,s._pos,s._pos+=d.authLen))}b=ns(v.update(b),v.final())}catch(E){return E}}if(s._pos!==s.length)return new Error("Malformed OpenSSH private key");o=e(b,_,p!==void 0)}else o=[];return o instanceof Error?o:o[0]}}function Da(t,e,r,n,i,o,s){this.type=t,this.comment=e,this[Kr]=r,this[on]=n,this[Hn]=i,this[bn]=o,this[Yi]=s}c(Da,"OpenSSH_Old_Private");Da.prototype=cs;{let t=/^-----BEGIN (RSA|DSA|EC) PRIVATE KEY-----(?:\r\n|\n)((?:[^:]+:\s*[\S].*(?:\r\n|\n))*)([\s\S]+)(?:\r\n|\n)-----END (RSA|DSA|EC) PRIVATE KEY-----$/;Da.parse=(e,r)=>{let n=t.exec(e);if(n===null)return null;let i=Buffer.from(n[3],"base64"),o=n[2],s=!1;if(o!==void 0){o=o.split(/\r\n|\n/g);for(let _=0;_<o.length;++_){let b=o[_],E=b.indexOf(":");if(b.slice(0,E)==="DEK-Info"){let v=b.slice(E+2);if(E=v.indexOf(","),E===-1)continue;let w=v.slice(0,E).toLowerCase();if(fI.indexOf(w)===-1)return new Error(`Cipher (${w}) not supported for encrypted OpenSSH private key`);let H=_l[w];if(!H)return new Error(`Cipher (${w}) not supported for encrypted OpenSSH private key`);let D=Buffer.from(v.slice(E+1),"hex");if(D.length!==H.ivLen)return new Error("Malformed encrypted OpenSSH private key");if(!r)return new Error("Encrypted OpenSSH private key detected, but no passphrase given");let J=li(D,0,8),Y=ts("md5").update(r).update(J).digest();for(;Y.length<H.keyLen;)Y=ns(Y,ts("md5").update(Y).update(r).update(J).digest());Y.length>H.keyLen&&(Y=li(Y,0,H.keyLen));try{let X=yl(w,Y,D);X.setAutoPadding(!1),i=ns(X.update(i),X.final()),s=!0}catch(X){return X}}}}let a,u,l,d,p,g,h="Malformed OpenSSH private key";switch(s&&(h+=". Bad passphrase?"),n[1]){case"RSA":a="ssh-rsa",u=Gr("RSA PRIVATE",i);try{g=new $e.Reader(i),g.readSequence(),g.readInt();let _=g.readString($e.Integer,!0);if(_===null)return new Error(h);let b=g.readString($e.Integer,!0);if(b===null)return new Error(h);l=is(_,b),d=os(_,b)}catch{return new Error(h)}p="sha1";break;case"DSA":a="ssh-dss",u=Gr("DSA PRIVATE",i);try{g=new $e.Reader(i),g.readSequence(),g.readInt();let _=g.readString($e.Integer,!0);if(_===null)return new Error(h);let b=g.readString($e.Integer,!0);if(b===null)return new Error(h);let E=g.readString($e.Integer,!0);if(E===null)return new Error(h);let v=g.readString($e.Integer,!0);if(v===null)return new Error(h);l=ss(_,b,E,v),d=as(_,b,E,v)}catch{return new Error(h)}p="sha1";break;case"EC":{let _,b,E;try{g=new $e.Reader(i),g.readSequence(),g.readInt(),b=g.readString($e.OctetString,!0),g.readByte();let w=g.readLength();if(w!==null){if(g._offset=w,E=g.readOID(),E===null)return new Error(h);switch(E){case"1.2.840.10045.3.1.7":_="prime256v1",a="ecdsa-sha2-nistp256",p="sha256";break;case"1.3.132.0.34":_="secp384r1",a="ecdsa-sha2-nistp384",p="sha384";break;case"1.3.132.0.35":_="secp521r1",a="ecdsa-sha2-nistp521",p="sha512";break;default:return new Error(`Unsupported private key EC OID: ${E}`)}}else return new Error(h)}catch{return new Error(h)}u=Gr("EC PRIVATE",i);let v=_I(_,b);l=bl(E,v),d=xl(E,v);break}}return new Da(a,"",u,l,d,p,s)}}function Ba(t,e,r,n,i,o,s){this.type=t,this.comment=e,this[Kr]=r,this[on]=n,this[Hn]=i,this[bn]=o,this[Yi]=s}c(Ba,"PPK_Private");Ba.prototype=cs;{let t=Buffer.alloc(0),e=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r=Buffer.from([0,0,0,0]),n=Buffer.from([0,0,0,1]),i=/^PuTTY-User-Key-File-2: (ssh-(?:rsa|dss))\r?\nEncryption: (aes256-cbc|none)\r?\nComment: ([^\r\n]*)\r?\nPublic-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-MAC: ([^\r\n]+)/;Ba.parse=(o,s)=>{let a=i.exec(o);if(a===null)return null;let u=a[2],l=u!=="none";if(l&&!s)return new Error("Encrypted PPK private key detected, but no passphrase given");let d=Buffer.from(a[5],"base64");if(l){let M=rs[u],L=ns(ts("sha1").update(r).update(s).digest(),ts("sha1").update(n).update(s).digest());L.length>M.keyLen&&(L=li(L,0,M.keyLen));try{let T=yl(M.sslName,L,e);T.setAutoPadding(!1),d=ns(T.update(d),T.final())}catch(T){return T}}let p=a[1],g=a[3],h=Buffer.from(a[4],"base64"),_=a[6],b=p.length,E=u.length,v=Buffer.byteLength(g),w=h.length,H=d.length,D=Buffer.allocUnsafe(4+b+4+E+4+v+4+w+4+H),J=0;if(ur(D,b,J),D.utf8Write(p,J+=4,b),ur(D,E,J+=b),D.utf8Write(u,J+=4,E),ur(D,v,J+=E),D.utf8Write(g,J+=4,v),ur(D,w,J+=v),D.set(h,J+=4),ur(D,H,J+=w),D.set(d,J+4),s||(s=t),aI("sha1",ts("sha1").update("putty-private-key-file-mac-key").update(s).digest()).update(D).digest("hex")!==_)return l?new Error("PPK private key integrity check failed -- bad passphrase?"):new Error("PPK private key integrity check failed");let X,P,C;switch(h._pos=0,Al(h,1),p){case"ssh-rsa":{let M=Re(h,h._pos);if(M===void 0)return new Error("Malformed PPK public key");let L=Re(h,h._pos);if(L===void 0)return new Error("Malformed PPK public key");let T=Re(d,0);if(T===void 0)return new Error("Malformed PPK private key");let F=Re(d,d._pos);if(F===void 0)return new Error("Malformed PPK private key");let j=Re(d,d._pos);if(j===void 0)return new Error("Malformed PPK private key");let B=Re(d,d._pos);if(B===void 0)return new Error("Malformed PPK private key");X=is(L,M),P=os(L,M),C=Mg(L,M,T,B,F,j);break}case"ssh-dss":{let M=Re(h,h._pos);if(M===void 0)return new Error("Malformed PPK public key");let L=Re(h,h._pos);if(L===void 0)return new Error("Malformed PPK public key");let T=Re(h,h._pos);if(T===void 0)return new Error("Malformed PPK public key");let F=Re(h,h._pos);if(F===void 0)return new Error("Malformed PPK public key");let j=Re(d,0);if(j===void 0)return new Error("Malformed PPK private key");X=ss(M,L,T,F),P=as(M,L,T,F),C=Fg(M,L,T,F,j);break}}return new Ba(p,g,C,X,P,"sha1",l)}}function La(t,e,r,n,i){this.type=t,this.comment=e,this[Kr]=null,this[on]=r,this[Hn]=n,this[bn]=i,this[Yi]=!1}c(La,"OpenSSH_Public");La.prototype=cs;{let t;El?t=/^(((?:ssh-(?:rsa|dss|ed25519))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/:t=/^(((?:ssh-(?:rsa|dss))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/,La.parse=e=>{let r=t.exec(e);if(r===null)return null;let n=r[1],i=r[2],o=Buffer.from(r[3],"base64"),s=r[4]||"",a=Re(o,o._pos,!0);return a===void 0||a.indexOf(i)!==0?new Error("Malformed OpenSSH public key"):Il(o,i,s,n)}}function Ua(t,e,r,n,i){this.type=t,this.comment=e,this[Kr]=null,this[on]=r,this[Hn]=n,this[bn]=i,this[Yi]=!1}c(Ua,"RFC4716_Public");Ua.prototype=cs;{let t=/^---- BEGIN SSH2 PUBLIC KEY ----(?:\r?\n)((?:.{0,72}\r?\n)+)---- END SSH2 PUBLIC KEY ----$/,e=/^[A-Z0-9a-z/+=\r\n]+$/,r=/^([\x21-\x39\x3B-\x7E]{1,64}): ((?:[^\\]*\\\r?\n)*[^\r\n]+)\r?\n/gm,n=/\\\r?\n/g;Ua.parse=i=>{let o=t.exec(i);if(o===null)return null;let s=o[1],a=0,u="";for(;o=r.exec(s);){let h=o[1],_=o[2].replace(n,"");if(_.length>1024)return r.lastIndex=0,new Error("Malformed RFC4716 public key");a=r.lastIndex,h.toLowerCase()==="comment"&&(u=_,u.length>1&&u.charCodeAt(0)===34&&u.charCodeAt(u.length-1)===34&&(u=u.slice(1,-1)))}let l=s.slice(a);if(!e.test(l))return new Error("Malformed RFC4716 public key");l=Buffer.from(l,"base64");let d=Re(l,0,!0);if(d===void 0)return new Error("Malformed RFC4716 public key");let p=null,g=null;switch(d){case"ssh-rsa":{let h=Re(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=Re(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");p=is(_,h),g=os(_,h);break}case"ssh-dss":{let h=Re(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=Re(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");let b=Re(l,l._pos);if(b===void 0)return new Error("Malformed RFC4716 public key");let E=Re(l,l._pos);if(E===void 0)return new Error("Malformed RFC4716 public key");p=ss(h,_,b,E),g=as(h,_,b,E);break}default:return new Error("Malformed RFC4716 public key")}return new Ua(d,u,p,g,"sha1")}}function Il(t,e,r,n){if(!Wg(e))return new Error(`Unsupported OpenSSH public key type: ${e}`);let i,o,s=null,a=null;switch(e){case"ssh-rsa":{let u=Re(t,t._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=Re(t,t._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");s=is(l,u),a=os(l,u),i="sha1";break}case"ssh-dss":{let u=Re(t,t._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=Re(t,t._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");let d=Re(t,t._pos);if(d===void 0)return new Error("Malformed OpenSSH public key");let p=Re(t,t._pos);if(p===void 0)return new Error("Malformed OpenSSH public key");s=ss(u,l,d,p),a=as(u,l,d,p),i="sha1";break}case"ssh-ed25519":{let u=Re(t,t._pos||0);if(u===void 0||u.length!==32)return new Error("Malformed OpenSSH public key");s=Hg(u),a=jg(u),i=null;break}case"ecdsa-sha2-nistp256":i="sha256",o="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":i===void 0&&(i="sha384",o="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(i===void 0&&(i="sha512",o="1.3.132.0.35"),!Al(t,1))return new Error("Malformed OpenSSH public key");let u=Re(t,t._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");s=bl(o,u),a=xl(o,u);break}default:return new Error(`Unsupported OpenSSH public key type: ${e}`)}return new La(n,r,s,a,i)}c(Il,"parseDER");function Wg(t){switch(t){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return!0;case"ssh-ed25519":if(El)return!0;default:return!1}}c(Wg,"isSupportedKeyType");function qg(t){return t?typeof t[Yi]=="boolean":!1}c(qg,"isParsedKey");function Qg(t,e){if(qg(t))return t;let r;if(Buffer.isBuffer(t))r=t,t=t.utf8Slice(0,t.length).trim();else if(typeof t=="string")t=t.trim();else return new Error("Key data must be a Buffer or string");if(e!=null){if(typeof e=="string")e=Buffer.from(e);else if(!Buffer.isBuffer(e))return new Error("Passphrase must be a string or Buffer when supplied")}let n;if((n=$a.parse(t,e))!==null||(n=Da.parse(t,e))!==null||(n=Ba.parse(t,e))!==null||(n=La.parse(t))!==null||(n=Ua.parse(t))!==null)return n;if(r){Oa.init(r,0);let i=Oa.readString(!0);i!==void 0&&(t=Oa.readRaw(),t!==void 0&&(n=Il(t,i,"",i),n instanceof Error&&(n=null))),Oa.clear()}return n||new Error("Unsupported key format")}c(Qg,"parseKey");Vg.exports={isParsedKey:qg,isSupportedKeyType:Wg,parseDERKey:c((t,e)=>Il(t,e,"",e),"parseDERKey"),parseKey:Qg}});var Cl=le(($F,nm)=>{"use strict";var{Socket:Yg}=require("net"),{Duplex:Xg}=require("stream"),{resolve:yI}=require("path"),{readFile:Kg}=require("fs"),{execFile:EI,spawn:AI}=require("child_process"),{isParsedKey:Gg,parseKey:us}=jn(),{makeBufferParser:bI,readUInt32BE:Tl,writeUInt32BE:Pr,writeUInt32LE:Zg}=Vr();function ls(t){let e=!1;return(...r)=>{e||(e=!0,t(...r))}}c(ls,"once");function xI(t,e){let r=Buffer.allocUnsafe(t.length+e.length);return t.copy(r,0),e.copy(r,t.length),r}c(xI,"concat");function Sl(){}c(Sl,"noop");var II=Buffer.alloc(0),zt=bI(),fs=class{static{c(this,"BaseAgent")}getIdentities(e){e(new Error("Missing getIdentities() implementation"))}sign(e,r,n,i){typeof n=="function"&&(i=n),i(new Error("Missing sign() implementation"))}},Ji=class extends fs{static{c(this,"OpenSSHAgent")}constructor(e){super(),this.socketPath=e}getStream(e){e=ls(e);let r=new Yg;r.on("connect",()=>{e(null,r)}),r.on("close",n).on("end",n).on("error",n),r.connect(this.socketPath);function n(){try{r.destroy()}catch{}e(new Error("Failed to connect to agent"))}c(n,"onFail")}getIdentities(e){e=ls(e),this.getStream((r,n)=>{function i(s){if(n)try{n.destroy()}catch{}s||(s=new Error("Failed to retrieve identities from agent")),e(s)}if(c(i,"onFail"),r)return i(r);let o=new wl(!0);o.on("error",i),o.pipe(n).pipe(o),n.on("close",i).on("end",i).on("error",i),o.getIdentities((s,a)=>{if(s)return i(s);try{n.destroy()}catch{}e(null,a)})})}sign(e,r,n,i){typeof n=="function"?(i=n,n=void 0):(typeof n!="object"||n===null)&&(n=void 0),i=ls(i),this.getStream((o,s)=>{function a(l){if(s)try{s.destroy()}catch{}l||(l=new Error("Failed to sign data with agent")),i(l)}if(c(a,"onFail"),o)return a(o);let u=new wl(!0);u.on("error",a),u.pipe(s).pipe(u),s.on("close",a).on("end",a).on("error",a),u.sign(e,r,n,(l,d)=>{if(l)return a(l);try{s.destroy()}catch{}i(null,d)})})}},Jg=(()=>{let s=yI(__dirname,"..","util/pagent.exe"),a={10:new Error("Invalid pagent.exe arguments"),11:new Error("Pageant is not running"),12:new Error("pagent.exe could not create an mmap"),13:new Error("pagent.exe could not set mode for stdin"),14:new Error("pagent.exe could not set mode for stdout"),15:new Error("pagent.exe did not get expected input payload")};function u(d){d.buffer=null,d.proc&&(d.proc.kill(),d.proc=void 0)}c(u,"destroy");class l extends Xg{static{c(this,"PageantSocket")}constructor(){super(),this.proc=void 0,this.buffer=null}_read(p){}_write(p,g,h){if(this.buffer===null)this.buffer=p;else{let v=Buffer.allocUnsafe(this.buffer.length+p.length);this.buffer.copy(v,0),p.copy(v,this.buffer.length),this.buffer=v}if(this.buffer.length<4)return h();let _=Tl(this.buffer,0);if(this.buffer.length-4<_)return h();if(p=this.buffer.slice(0,4+_),this.buffer.length>4+_)return h(new Error("Unexpected multiple agent requests"));this.buffer=null;let b,E=this.proc=AI(s,[p.length]);E.stdout.on("data",v=>{this.push(v)}),E.on("error",v=>{b=v,h(b)}),E.on("close",v=>{if(this.proc=void 0,!b){if(b=a[v])return h(b);h()}}),E.stdin.end(p)}_final(p){u(this),p()}_destroy(p,g){u(this),g()}}return class extends Ji{static{c(this,"PageantAgent")}getStream(p){p(null,new l)}}})(),em=(()=>{let t=/^!<socket >(\d+) s ([A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8})/;return class extends Ji{static{c(this,"CygwinAgent")}getStream(r){r=ls(r);let n=this.socketPath,i=!1;Kg(n,c(function o(s,a){if(s){if(i)return r(new Error("Invalid cygwin unix socket path"));EI("cygpath",["-w",n],(Y,X,P)=>{if(Y||X.length===0)return r(new Error("Invalid cygwin unix socket path"));i=!0,n=X.toString().replace(/[\r\n]/g,""),Kg(n,o)});return}let u=t.exec(a.toString("ascii"));if(!u)return r(new Error("Malformed cygwin unix socket file"));let l,d=0,p=!1,g=[],h,_=Buffer.alloc(12),b=parseInt(u[1],10),E=u[2].replace(/-/g,""),v=Buffer.allocUnsafe(16);for(let Y=0,X=0;X<32;++Y,X+=2)v[Y]=parseInt(E.substring(X,X+2),16);for(let Y=0;Y<16;Y+=4)Zg(v,Tl(v,Y),Y);J();function w(){d=0,l="secret",h.write(v)}c(w,"_onconnect");function H(Y){if(d+=Y.length,l==="secret"){d===16&&(d=0,l="creds",h.write(_));return}if(l==="creds"&&(p||g.push(Y),d===12)){if(h.removeListener("connect",w),h.removeListener("data",H),h.removeListener("error",D),h.removeListener("end",D),h.removeListener("close",D),p)return r(null,h);p=!0,_=Buffer.concat(g),Zg(_,process.pid,0),h.on("error",()=>{}),h.destroy(),J()}}c(H,"_ondata");function D(){r(new Error("Problem negotiating cygwin unix socket security"))}c(D,"onFail");function J(){h=new Yg,h.on("connect",w),h.on("data",H),h.on("error",D),h.on("end",D),h.on("close",D),h.connect(b)}c(J,"tryConnect")},"readCygsocket"))}}})(),vI=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;function tm(t){return process.platform==="win32"&&!vI.test(t)?t==="pageant"?new Jg:new em(t):new Ji(t)}c(tm,"createAgent");var wl=(()=>{function l(P){let C;for(;P[w].length;){let M=P[w][0][p];if(M===void 0)break;P[w].shift(),C=P.push(M)}return C}c(l,"processResponses");let d=Symbol("Inbound Request Type"),p=Symbol("Inbound Request Response"),g=Symbol("Inbound Request Context");class h{static{c(this,"AgentInboundRequest")}constructor(C,M){this[d]=C,this[p]=void 0,this[g]=M}hasResponded(){return this[p]!==void 0}getType(){return this[d]}getContext(){return this[g]}}function _(P,C,M){return C[p]=M,l(P)}c(_,"respond");function b(P){if(P[D]=null,P[H]===0){let C=P[w];if(C&&C.length){P[w]=[];for(let M of C)M.cb(new Error("No reply from server"))}}try{P.end()}catch{}setImmediate(()=>{P[X]||P.emit("end"),P[Y]||P.emit("close")})}c(b,"cleanup");function E(){this[Y]=!0}c(E,"onClose");function v(){this[X]=!0}c(v,"onEnd");let w=Symbol("Requests"),H=Symbol("Agent Protocol Role"),D=Symbol("Agent Protocol Buffer"),J=Symbol("Agent Protocol Current Message Length"),Y=Symbol("Agent Protocol Closed"),X=Symbol("Agent Protocol Ended");return class extends Xg{static{c(this,"AgentProtocol")}constructor(C){super({autoDestroy:!0,emitClose:!1}),this[H]=C?0:1,this[w]=[],this[D]=null,this[J]=-1,this.once("end",v),this.once("close",E)}_read(C){}_write(C,M,L){this[D]===null?this[D]=C:this[D]=xI(this[D],C);let T=this[D],F=T.length,j=0;for(;j<F&&!(F<5||(this[J]===-1&&(this[J]=Tl(T,j)),F<4+this[J]));){let B=T[j+=4];if(++j,this[H]===0){if(this[w].length===0)return L(new Error("Received unexpected message from server"));let Z=this[w].shift();switch(B){case 5:Z.cb(new Error("Agent responded with failure"));break;case 12:{if(Z.type!==11)return L(new Error("Agent responded with wrong message type"));zt.init(T,j);let te=zt.readUInt32BE();if(te===void 0)return zt.clear(),L(new Error("Malformed agent response"));let k=[];for(let W=0;W<te;++W){let q=zt.readString();if(q===void 0)return zt.clear(),L(new Error("Malformed agent response"));let ee=zt.readString(!0);if(ee===void 0)return zt.clear(),L(new Error("Malformed agent response"));q=us(q),!(q instanceof Error)&&(q.comment=q.comment||ee,k.push(q))}j=zt.pos(),zt.clear(),Z.cb(null,k);break}case 14:{if(Z.type!==13)return L(new Error("Agent responded with wrong message type"));zt.init(T,j);let te=zt.readString();if(j=zt.pos(),zt.clear(),te===void 0)return L(new Error("Malformed agent response"));if(zt.init(te,0),zt.readString(!0),te=zt.readString(),zt.clear(),te===void 0)return L(new Error("Malformed OpenSSH signature format"));Z.cb(null,te);break}default:return L(new Error("Agent responded with unsupported message type"))}}else switch(B){case 11:{let Z=new h(B);this[w].push(Z),this.emit("identities",Z);break}case 13:{zt.init(T,j);let Z=zt.readString(),te=zt.readString(),k=zt.readUInt32BE();if(j=zt.pos(),zt.clear(),k===void 0){let ue=new h(B);return this[w].push(ue),this.failureReply(ue)}if(Z=us(Z),Z instanceof Error){let ue=new h(B);return this[w].push(ue),this.failureReply(ue)}let W={hash:void 0},q;Z.type==="ssh-rsa"&&(k&2?(q="rsa-sha2-256",W.hash="sha256"):k&4&&(q="rsa-sha2-512",W.hash="sha512")),q===void 0&&(q=Z.type);let ee=new h(B,q);this[w].push(ee),this.emit("sign",ee,Z,te,W);break}default:{let Z=new h(B);this[w].push(Z),this.failureReply(Z)}}if(this[J]=-1,j===F){this[D]=null;break}else this[D]=T=T.slice(j),F=T.length,j=0}L()}_destroy(C,M){b(this),M()}_final(C){b(this),C()}sign(C,M,L,T){if(this[H]!==0)throw new Error("Client-only method called with server role");typeof L=="function"?(T=L,L=void 0):(typeof L!="object"||L===null)&&(L=void 0);let F=0;if(C=us(C),C instanceof Error)throw new Error("Invalid public key argument");if(C.type==="ssh-rsa"&&L)switch(L.hash){case"sha256":F=2;break;case"sha512":F=4;break}C=C.getPublicSSH();let j=13,B=C.length,Z=M.length,te=0,k=Buffer.allocUnsafe(9+B+4+Z+4);return Pr(k,k.length-4,te),k[te+=4]=j,Pr(k,B,++te),C.copy(k,te+=4),Pr(k,Z,te+=B),M.copy(k,te+=4),Pr(k,F,te+=Z),typeof T!="function"&&(T=Sl),this[w].push({type:j,cb:T}),this.push(k)}getIdentities(C){if(this[H]!==0)throw new Error("Client-only method called with server role");let M=11,L=0,T=Buffer.allocUnsafe(5);return Pr(T,T.length-4,L),T[L+=4]=M,typeof C!="function"&&(C=Sl),this[w].push({type:M,cb:C}),this.push(T)}failureReply(C){if(this[H]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;let M=0,L=Buffer.allocUnsafe(5);return Pr(L,L.length-4,M),L[M+=4]=5,_(this,C,L)}getIdentitiesReply(C,M){if(this[H]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==11)throw new Error("Invalid response to request");if(!Array.isArray(M))throw new Error("Keys argument must be an array");let L=4,T=[];for(let B=0;B<M.length;++B){let Z=M[B];if(typeof Z!="object"||Z===null)throw new Error(`Invalid key entry: ${Z}`);let te,k;if(Gg(Z))te=Z;else if(Gg(Z.pubKey))te=Z.pubKey;else if(typeof Z.pubKey!="object"||Z.pubKey===null||({pubKey:te,comment:k}=Z.pubKey,te=us(te),te instanceof Error))continue;k=te.comment||k,te=te.getPublicSSH(),L+=4+te.length,k&&typeof k=="string"?k=Buffer.from(k):Buffer.isBuffer(k)||(k=II),L+=4+k.length,T.push({pubKey:te,comment:k})}let F=0,j=Buffer.allocUnsafe(5+L);Pr(j,j.length-4,F),j[F+=4]=12,Pr(j,T.length,++F),F+=4;for(let B=0;B<T.length;++B){let{pubKey:Z,comment:te}=T[B];Pr(j,Z.length,F),Z.copy(j,F+=4),Pr(j,te.length,F+=Z.length),F+=4,te.length&&(te.copy(j,F),F+=te.length)}return _(this,C,j)}signReply(C,M){if(this[H]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==13)throw new Error("Invalid response to request");if(!Buffer.isBuffer(M))throw new Error("Signature argument must be a Buffer");if(M.length===0)throw new Error("Signature argument must be non-empty");let L=0,T=C.getContext(),F=Buffer.byteLength(T),j=Buffer.allocUnsafe(13+F+4+M.length);return Pr(j,j.length-4,L),j[L+=4]=14,Pr(j,4+F+4+M.length,++L),Pr(j,F,L+=4),j.utf8Write(T,L+=4,F),Pr(j,M.length,L+=F),M.copy(j,L+=4),_(this,C,j)}}})(),vl=Symbol("Agent"),Zr=Symbol("Agent Keys"),xn=Symbol("Agent Keys Index"),Xi=Symbol("Agent Init Callbacks"),Pl=class{static{c(this,"AgentContext")}constructor(e){if(typeof e=="string")e=tm(e);else if(!rm(e))throw new Error("Invalid agent argument");this[vl]=e,this[Zr]=null,this[xn]=-1,this[Xi]=null}init(e){if(typeof e!="function"&&(e=Sl),this[Zr]===null)if(this[Xi]===null){this[Xi]=[e];let r=c((...n)=>{process.nextTick(()=>{let i=this[Xi];this[Xi]=null;for(let o of i)o(...n)})},"doCbs");this[vl].getIdentities(ls((n,i)=>{if(n)return r(n);if(!Array.isArray(i))return r(new Error("Agent implementation failed to provide keys"));let o=[];for(let s of i)s=us(s),!(s instanceof Error)&&o.push(s);this[Zr]=o,this[xn]=-1,r()}))}else this[Xi].push(e);else process.nextTick(e)}nextKey(){return this[Zr]===null||++this[xn]>=this[Zr].length?!1:this[Zr][this[xn]]}currentKey(){return this[Zr]===null||this[xn]>=this[Zr].length?null:this[Zr][this[xn]]}pos(){return this[Zr]===null||this[xn]>=this[Zr].length?-1:this[xn]}reset(){this[xn]=-1}sign(...e){this[vl].sign(...e)}};function rm(t){return t instanceof fs}c(rm,"isAgent");nm.exports={AgentContext:Pl,AgentProtocol:wl,BaseAgent:fs,createAgent:tm,CygwinAgent:em,isAgent:rm,OpenSSHAgent:Ji,PageantAgent:Jg}});var Dl=le((BF,im)=>{"use strict";var{kMaxLength:SI}=require("buffer"),{createInflate:wI,constants:{DEFLATE:PI,INFLATE:TI,Z_DEFAULT_CHUNK:CI,Z_DEFAULT_COMPRESSION:kI,Z_DEFAULT_MEMLEVEL:RI,Z_DEFAULT_STRATEGY:NI,Z_DEFAULT_WINDOWBITS:OI,Z_PARTIAL_FLUSH:$I}}=require("zlib"),DI=wI()._handle.constructor;function BI(){throw new Error("Should not get here")}c(BI,"processCallback");function UI(t,e,r){let n=this._owner,i=new Error(t);i.errno=e,i.code=r,n._err=i}c(UI,"zlibOnError");function $l(t){t._handle&&(t._handle.close(),t._handle=null)}c($l,"_close");var za=class{static{c(this,"Zlib")}constructor(e){let r=OI,n=kI,i=RI,o=NI,s=void 0;this._err=void 0,this._writeState=new Uint32Array(2),this._chunkSize=CI,this._maxOutputLength=SI,this._outBuffer=Buffer.allocUnsafe(this._chunkSize),this._outOffset=0,this._handle=new DI(e),this._handle._owner=this,this._handle.onerror=UI,this._handle.init(r,n,i,o,this._writeState,BI,s)}writeSync(e,r){let n=this._handle;if(!n)throw new Error("Invalid Zlib instance");let i=e.length,o=this._chunkSize-this._outOffset,s=0,a,u,l,d=0,p=this._writeState,g=this._outBuffer,h=this._outOffset,_=this._chunkSize;for(;;){if(n.writeSync($I,e,s,i,g,h,o),this._err)throw this._err;a=p[0],u=p[1];let E=i-u,v=o-a;if(v>0){let w=h===0&&v===g.length?g:g.slice(h,h+v);if(h+=v,l?l.push===void 0?l=[l,w]:l.push(w):l=w,d+=w.byteLength,d>this._maxOutputLength)throw $l(this),new Error(`Output length exceeded maximum of ${this._maxOutputLength}`)}else if(v!==0)throw new Error("have should not go down");if((a===0||h>=_)&&(o=_,h=0,g=Buffer.allocUnsafe(_)),a===0)s+=E,i=u;else break}if(this._outBuffer=g,this._outOffset=h,d===0&&(l=Buffer.alloc(0)),r)return l.totalLen=d,l;if(l.push===void 0)return l;let b=Buffer.allocUnsafe(d);for(let E=0,v=0;E<l.length;++E){let w=l[E];b.set(w,v),v+=w.length}return b}},kl=class{static{c(this,"ZlibPacketWriter")}constructor(e){this.allocStart=0,this.allocStartKEX=0,this._protocol=e,this._zlib=new za(PI)}cleanup(){this._zlib&&$l(this._zlib)}alloc(e,r){return Buffer.allocUnsafe(e)}finalize(e,r){if(this._protocol._kexinit===void 0||r){let n=this._zlib.writeSync(e,!0),i=this._protocol._cipher.allocPacket(n.totalLen);if(n.push===void 0)i.set(n,5);else for(let o=0,s=5;o<n.length;++o){let a=n[o];i.set(a,s),s+=a.length}return i}return e}},Rl=class{static{c(this,"PacketWriter")}constructor(e){this.allocStart=5,this.allocStartKEX=5,this._protocol=e}cleanup(){}alloc(e,r){return this._protocol._kexinit===void 0||r?this._protocol._cipher.allocPacket(e):Buffer.allocUnsafe(e)}finalize(e,r){return e}},Nl=class{static{c(this,"ZlibPacketReader")}constructor(){this._zlib=new za(TI)}cleanup(){this._zlib&&$l(this._zlib)}read(e){return this._zlib.writeSync(e,!1)}},Ol=class{static{c(this,"PacketReader")}cleanup(){}read(e){return e}};im.exports={PacketReader:Ol,PacketWriter:Rl,ZlibPacketReader:Nl,ZlibPacketWriter:kl}});var um=le((LF,cm)=>{"use strict";var{bufferSlice:Bl,bufferParser:$,doFatalError:Tt,sigSSHToASN1:om,writeUInt32BE:sm}=Vr(),{CHANNEL_OPEN_FAILURE:LI,COMPAT:zI,MESSAGE:Ct,TERMINAL_MODE:am}=An(),{parseKey:MI}=jn(),FI=Array.from(Object.entries(am)).reduce((t,[e,r])=>({...t,[e]:r}),{});cm.exports={[Ct.DISCONNECT]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readString(!0),i=$.readString();if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed DISCONNECT packet");t._debug&&t._debug(`Inbound: Received DISCONNECT (${r}, "${n}")`);let o=t._handlers.DISCONNECT;o&&o(t,r,n)},[Ct.IGNORE]:(t,e)=>{t._debug&&t._debug("Inbound: Received IGNORE")},[Ct.UNIMPLEMENTED]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed UNIMPLEMENTED packet");t._debug&&t._debug(`Inbound: Received UNIMPLEMENTED (seqno ${r})`)},[Ct.DEBUG]:(t,e)=>{$.init(e,1);let r=$.readBool(),n=$.readString(!0),i=$.readString();if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed DEBUG packet");t._debug&&t._debug("Inbound: Received DEBUG");let o=t._handlers.DEBUG;o&&o(t,r,n)},[Ct.SERVICE_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readString(!0);if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed SERVICE_REQUEST packet");t._debug&&t._debug(`Inbound: Received SERVICE_REQUEST (${r})`);let n=t._handlers.SERVICE_REQUEST;n&&n(t,r)},[Ct.SERVICE_ACCEPT]:(t,e)=>{$.init(e,1);let r=$.readString(!0);if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed SERVICE_ACCEPT packet");t._debug&&t._debug(`Inbound: Received SERVICE_ACCEPT (${r})`);let n=t._handlers.SERVICE_ACCEPT;n&&n(t,r)},[Ct.EXT_INFO]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n;if(r!==void 0){n=[];for(let o=0;o<r;++o){let s=$.readString(!0),a=$.readString();if(a!==void 0)if(s==="server-sig-algs"){let u=a.latin1Slice(0,a.length).split(",");n.push({name:s,algs:u});continue}else continue;n=void 0;break}}if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed EXT_INFO packet");t._debug&&t._debug("Inbound: Received EXT_INFO");let i=t._handlers.EXT_INFO;i&&i(t,n)},[Ct.USERAUTH_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readString(!0),i=$.readString(!0),o,s;switch(i){case"none":o=null;break;case"password":{let u=$.readBool();if(u!==void 0&&(o=$.readString(!0),o!==void 0&&u)){let l=$.readString(!0);l!==void 0?o={oldPassword:o,newPassword:l}:o=void 0}break}case"publickey":{let u=$.readBool();if(u!==void 0){let l=$.readString(!0),d=l,p=$.readString(),g;switch(l){case"rsa-sha2-256":d="ssh-rsa",g="sha256";break;case"rsa-sha2-512":d="ssh-rsa",g="sha512";break}if(u){let h=$.pos(),_=$.readString();if(_!==void 0&&(_.length>4+l.length+4&&_.utf8Slice(4,4+l.length)===l&&(_=Bl(_,4+l.length+4)),_=om(_,d),_)){let b=t._kex.sessionID,E=Buffer.allocUnsafe(4+b.length+h);sm(E,b.length,0),E.set(b,4),E.set(new Uint8Array(e.buffer,e.byteOffset,h),4+b.length),o={keyAlgo:d,key:p,signature:_,blob:E,hashAlgo:g}}}else o={keyAlgo:d,key:p,hashAlgo:g},s="publickey -- check"}break}case"hostbased":{let u=$.readString(!0),l=u,d=$.readString(),p=$.readString(!0),g=$.readString(!0),h;switch(u){case"rsa-sha2-256":l="ssh-rsa",h="sha256";break;case"rsa-sha2-512":l="ssh-rsa",h="sha512";break}let _=$.pos(),b=$.readString();if(b!==void 0&&(b.length>4+u.length+4&&b.utf8Slice(4,4+u.length)===u&&(b=Bl(b,4+u.length+4)),b=om(b,l),b!==void 0)){let E=t._kex.sessionID,v=Buffer.allocUnsafe(4+E.length+_);sm(v,E.length,0),v.set(E,4),v.set(new Uint8Array(e.buffer,e.byteOffset,_),4+E.length),o={keyAlgo:l,key:d,signature:b,blob:v,localHostname:p,localUsername:g,hashAlgo:h}}break}case"keyboard-interactive":$.skipString(),o=$.readList();break;default:i!==void 0&&(o=$.readRaw())}if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed USERAUTH_REQUEST packet");s===void 0&&(s=i),t._authsQueue.push(i),t._debug&&t._debug(`Inbound: Received USERAUTH_REQUEST (${s})`);let a=t._handlers.USERAUTH_REQUEST;a&&a(t,r,n,i,o)},[Ct.USERAUTH_FAILURE]:(t,e)=>{$.init(e,1);let r=$.readList(),n=$.readBool();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_FAILURE packet");t._debug&&t._debug(`Inbound: Received USERAUTH_FAILURE (${r})`),t._authsQueue.shift();let i=t._handlers.USERAUTH_FAILURE;i&&i(t,r,n)},[Ct.USERAUTH_SUCCESS]:(t,e)=>{t._debug&&t._debug("Inbound: Received USERAUTH_SUCCESS"),t._authsQueue.shift();let r=t._handlers.USERAUTH_SUCCESS;r&&r(t)},[Ct.USERAUTH_BANNER]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_BANNER packet");t._debug&&t._debug("Inbound: Received USERAUTH_BANNER");let i=t._handlers.USERAUTH_BANNER;i&&i(t,r)},60:(t,e)=>{if(!t._authsQueue.length){t._debug&&t._debug("Inbound: Received payload type 60 without auth");return}switch(t._authsQueue[0]){case"password":{$.init(e,1);let r=$.readString(!0),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_PASSWD_CHANGEREQ packet");t._debug&&t._debug("Inbound: Received USERAUTH_PASSWD_CHANGEREQ");let i=t._handlers.USERAUTH_PASSWD_CHANGEREQ;i&&i(t,r);break}case"publickey":{$.init(e,1);let r=$.readString(!0),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_PK_OK packet");t._debug&&t._debug("Inbound: Received USERAUTH_PK_OK"),t._authsQueue.shift();let i=t._handlers.USERAUTH_PK_OK;i&&i(t,r,n);break}case"keyboard-interactive":{$.init(e,1);let r=$.readString(!0),n=$.readString(!0);$.readString();let i=$.readUInt32BE(),o;if(i!==void 0){o=new Array(i);let a;for(a=0;a<i;++a){let u=$.readString(!0),l=$.readBool();if(l===void 0)break;o[a]={prompt:u,echo:l}}a!==i&&(o=void 0)}if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed USERAUTH_INFO_REQUEST packet");t._debug&&t._debug("Inbound: Received USERAUTH_INFO_REQUEST");let s=t._handlers.USERAUTH_INFO_REQUEST;s&&s(t,r,n,o);break}default:t._debug&&t._debug("Inbound: Received unexpected payload type 60")}},61:(t,e)=>{if(!t._authsQueue.length){t._debug&&t._debug("Inbound: Received payload type 61 without auth");return}if(t._authsQueue[0]!=="keyboard-interactive")return Tt(t,"Inbound: Received unexpected payload type 61");$.init(e,1);let r=$.readUInt32BE(),n;if(r!==void 0){n=new Array(r);let o;for(o=0;o<r;++o){let s=$.readString(!0);if(s===void 0)break;n[o]=s}o!==r&&(n=void 0)}if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed USERAUTH_INFO_RESPONSE packet");t._debug&&t._debug("Inbound: Received USERAUTH_INFO_RESPONSE");let i=t._handlers.USERAUTH_INFO_RESPONSE;i&&i(t,n)},[Ct.GLOBAL_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readBool(),i;if(n!==void 0)switch(r){case"tcpip-forward":case"cancel-tcpip-forward":{let s=$.readString(!0),a=$.readUInt32BE();a!==void 0&&(i={bindAddr:s,bindPort:a});break}case"streamlocal-forward@openssh.com":case"cancel-streamlocal-forward@openssh.com":{let s=$.readString(!0);s!==void 0&&(i={socketPath:s});break}case"no-more-sessions@openssh.com":i=null;break;case"hostkeys-00@openssh.com":{for(i=[];$.avail()>0;){let s=$.readString();if(s===void 0){i=void 0;break}let a=MI(s);a instanceof Error||i.push(a)}break}default:i=$.readRaw()}if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed GLOBAL_REQUEST packet");t._debug&&t._debug(`Inbound: GLOBAL_REQUEST (${r})`);let o=t._handlers.GLOBAL_REQUEST;o?o(t,r,n,i):t.requestFailure()},[Ct.REQUEST_SUCCESS]:(t,e)=>{let r=e.length>1?Bl(e,1):null;t._debug&&t._debug("Inbound: REQUEST_SUCCESS");let n=t._handlers.REQUEST_SUCCESS;n&&n(t,r)},[Ct.REQUEST_FAILURE]:(t,e)=>{t._debug&&t._debug("Inbound: Received REQUEST_FAILURE");let r=t._handlers.REQUEST_FAILURE;r&&r(t)},[Ct.CHANNEL_OPEN]:(t,e)=>{$.init(e,1);let r=$.readString(!0),n=$.readUInt32BE(),i=$.readUInt32BE(),o=$.readUInt32BE(),s;switch(r){case"forwarded-tcpip":case"direct-tcpip":{let u=$.readString(!0),l=$.readUInt32BE(),d=$.readString(!0),p=$.readUInt32BE();p!==void 0&&(s={type:r,sender:n,window:i,packetSize:o,data:{destIP:u,destPort:l,srcIP:d,srcPort:p}});break}case"forwarded-streamlocal@openssh.com":case"direct-streamlocal@openssh.com":{let u=$.readString(!0);u!==void 0&&(s={type:r,sender:n,window:i,packetSize:o,data:{socketPath:u}});break}case"x11":{let u=$.readString(!0),l=$.readUInt32BE();l!==void 0&&(s={type:r,sender:n,window:i,packetSize:o,data:{srcIP:u,srcPort:l}});break}default:s={type:r,sender:n,window:i,packetSize:o,data:{}}}if($.clear(),s===void 0)return Tt(t,"Inbound: Malformed CHANNEL_OPEN packet");t._debug&&t._debug(`Inbound: CHANNEL_OPEN (s:${n}, ${r})`);let a=t._handlers.CHANNEL_OPEN;a?a(t,s):t.channelOpenFail(s.sender,LI.ADMINISTRATIVELY_PROHIBITED,"","")},[Ct.CHANNEL_OPEN_CONFIRMATION]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE(),i=$.readUInt32BE(),o=$.readUInt32BE(),s=$.avail()?$.readRaw():void 0;if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed CHANNEL_OPEN_CONFIRMATION packet");t._debug&&t._debug(`Inbound: CHANNEL_OPEN_CONFIRMATION (r:${r}, s:${n})`);let a=t._handlers.CHANNEL_OPEN_CONFIRMATION;a&&a(t,{recipient:r,sender:n,window:i,packetSize:o,data:s})},[Ct.CHANNEL_OPEN_FAILURE]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE(),i=$.readString(!0),o=$.readString();if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed CHANNEL_OPEN_FAILURE packet");t._debug&&t._debug(`Inbound: CHANNEL_OPEN_FAILURE (r:${r})`);let s=t._handlers.CHANNEL_OPEN_FAILURE;s&&s(t,r,n,i)},[Ct.CHANNEL_WINDOW_ADJUST]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed CHANNEL_WINDOW_ADJUST packet");t._debug&&t._debug(`Inbound: CHANNEL_WINDOW_ADJUST (r:${r}, ${n})`);let i=t._handlers.CHANNEL_WINDOW_ADJUST;i&&i(t,r,n)},[Ct.CHANNEL_DATA]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readString();if($.clear(),n===void 0)return Tt(t,"Inbound: Malformed CHANNEL_DATA packet");t._debug&&t._debug(`Inbound: CHANNEL_DATA (r:${r}, ${n.length})`);let i=t._handlers.CHANNEL_DATA;i&&i(t,r,n)},[Ct.CHANNEL_EXTENDED_DATA]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readUInt32BE(),i=$.readString();if($.clear(),i===void 0)return Tt(t,"Inbound: Malformed CHANNEL_EXTENDED_DATA packet");t._debug&&t._debug(`Inbound: CHANNEL_EXTENDED_DATA (r:${r}, ${i.length})`);let o=t._handlers.CHANNEL_EXTENDED_DATA;o&&o(t,r,i,n)},[Ct.CHANNEL_EOF]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_EOF packet");t._debug&&t._debug(`Inbound: CHANNEL_EOF (r:${r})`);let n=t._handlers.CHANNEL_EOF;n&&n(t,r)},[Ct.CHANNEL_CLOSE]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_CLOSE packet");t._debug&&t._debug(`Inbound: CHANNEL_CLOSE (r:${r})`);let n=t._handlers.CHANNEL_CLOSE;n&&n(t,r)},[Ct.CHANNEL_REQUEST]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE(),n=$.readString(!0),i=$.readBool(),o;if(i!==void 0)switch(n){case"exit-status":o=$.readUInt32BE(),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"exit-signal":{let a,u;if(t._compatFlags&zI.OLD_EXIT){let d=$.readUInt32BE();switch(d){case 1:a="HUP";break;case 2:a="INT";break;case 3:a="QUIT";break;case 6:a="ABRT";break;case 9:a="KILL";break;case 14:a="ALRM";break;case 15:a="TERM";break;default:d!==void 0&&(a=`UNKNOWN (${d})`)}u=!1}else a=$.readString(!0),u=$.readBool(),u===void 0&&(a=void 0);let l=$.readString(!0);$.skipString()!==void 0&&(o={signal:a,coreDumped:u,errorMessage:l}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${a})`);break}case"pty-req":{let a=$.readString(!0),u=$.readUInt32BE(),l=$.readUInt32BE(),d=$.readUInt32BE(),p=$.readUInt32BE(),g=$.readString();if(g!==void 0){$.init(g,1);let h={};for(;$.avail();){let _=$.readByte();if(_===am.TTY_OP_END)break;let b=FI[_],E=$.readUInt32BE();if(_===void 0||b===void 0||E===void 0){h=void 0;break}h[b]=E}h!==void 0&&(o={term:a,cols:u,rows:l,width:d,height:p,modes:h})}t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break}case"window-change":{let a=$.readUInt32BE(),u=$.readUInt32BE(),l=$.readUInt32BE(),d=$.readUInt32BE();d!==void 0&&(o={cols:a,rows:u,width:l,height:d}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break}case"x11-req":{let a=$.readBool(),u=$.readString(!0),l=$.readString(),d=$.readUInt32BE();d!==void 0&&(o={single:a,protocol:u,cookie:l,screen:d}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break}case"env":{let a=$.readString(!0),u=$.readString(!0);u!==void 0&&(o={name:a,value:u}),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${a}=${u})`);break}case"shell":o=null,t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break;case"exec":o=$.readString(!0),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"subsystem":o=$.readString(!0),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"signal":o=$.readString(!0),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"xon-xoff":o=$.readBool(),t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n}: ${o})`);break;case"auth-agent-req@openssh.com":o=null,t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`);break;default:o=$.avail()?$.readRaw():null,t._debug&&t._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${n})`)}if($.clear(),o===void 0)return Tt(t,"Inbound: Malformed CHANNEL_REQUEST packet");let s=t._handlers.CHANNEL_REQUEST;s&&s(t,r,n,i,o)},[Ct.CHANNEL_SUCCESS]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_SUCCESS packet");t._debug&&t._debug(`Inbound: CHANNEL_SUCCESS (r:${r})`);let n=t._handlers.CHANNEL_SUCCESS;n&&n(t,r)},[Ct.CHANNEL_FAILURE]:(t,e)=>{$.init(e,1);let r=$.readUInt32BE();if($.clear(),r===void 0)return Tt(t,"Inbound: Malformed CHANNEL_FAILURE packet");t._debug&&t._debug(`Inbound: CHANNEL_FAILURE (r:${r})`);let n=t._handlers.CHANNEL_FAILURE;n&&n(t,r)}}});var Ma=le((zF,lm)=>{"use strict";var Ul=new Array(256);[Fa().HANDLERS,um()].forEach(t=>{for(let[e,r]of Object.entries(t))e=+e,isFinite(e)&&e>=0&&e<Ul.length&&(Ul[e]=r)});lm.exports=Ul});var Fa=le((FF,Am)=>{"use strict";var{createDiffieHellman:HI,createDiffieHellmanGroup:jI,createECDH:WI,createHash:zl,createPublicKey:qI,diffieHellman:QI,generateKeyPairSync:VI,randomFillSync:KI}=require("crypto"),{Ber:fm}=Ko(),{COMPAT:Ml,curve25519Supported:GI,DEFAULT_KEX:dm,DEFAULT_SERVER_HOST_KEY:pm,DEFAULT_CIPHER:Ha,DEFAULT_MAC:ja,DEFAULT_COMPRESSION:Wa,DISCONNECT_REASON:st,MESSAGE:wt}=An(),{CIPHER_INFO:ro,createCipher:ZI,createDecipher:YI,MAC_INFO:hm}=Mn(),{parseDERKey:XI}=jn(),{bufferFill:JI,bufferParser:ot,convertSignature:ev,doFatalError:at,FastBuffer:tv,sigSSHToASN1:rv,writeUInt32BE:lr}=Vr(),{PacketReader:gm,PacketWriter:mm,ZlibPacketReader:qa,ZlibPacketWriter:Qa}=Dl(),eo,nv=2048,iv=8192,ov=Buffer.alloc(0);function _m(t){let e;if(t._compatFlags&Ml.BAD_DHGEX){let r=t._offer.lists.kex,n=r.array,i=!1;for(let o=0;o<n.length;++o)n[o].includes("group-exchange")&&(i||(i=!0,n=n.slice()),n.splice(o--,1));if(i){let o=17+t._offer.totalSize+1+4,s=Buffer.from(n.join(","));o-=r.buffer.length-s.length;let a=t._offer.lists.all,u=new Uint8Array(a.buffer,a.byteOffset+4+r.buffer.length,a.length-(4+r.buffer.length));e=Buffer.allocUnsafe(o),lr(e,s.length,17),e.set(s,21),e.set(u,21+s.length)}}e===void 0&&(e=Buffer.allocUnsafe(17+t._offer.totalSize+1+4),t._offer.copyAllTo(e,17)),t._debug&&t._debug("Outbound: Sending KEXINIT"),e[0]=wt.KEXINIT,KI(e,1,16),JI(e,0,e.length-5),t._kexinit=e,t._packetRW.write.allocStart=0;{let r=t._packetRW.write.allocStartKEX,n=t._packetRW.write.alloc(e.length,!0);n.set(e,r),t._cipher.encrypt(t._packetRW.write.finalize(n,!0))}}c(_m,"kexinit");function ym(t,e){let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0}};if(ot.init(e,17),(r.kex=ot.readList())===void 0||(r.serverHostKey=ot.readList())===void 0||(r.cs.cipher=ot.readList())===void 0||(r.sc.cipher=ot.readList())===void 0||(r.cs.mac=ot.readList())===void 0||(r.sc.mac=ot.readList())===void 0||(r.cs.compress=ot.readList())===void 0||(r.sc.compress=ot.readList())===void 0||(r.cs.lang=ot.readList())===void 0||(r.sc.lang=ot.readList())===void 0)return ot.clear(),at(t,"Received malformed KEXINIT","handshake",st.KEY_EXCHANGE_FAILED);let n=ot.pos(),i=n<e.length&&e[n]===1;ot.clear();let o=t._offer,s=r,a=o.lists.kex.array;if(t._compatFlags&Ml.BAD_DHGEX){let D=!1;for(let J=0;J<a.length;++J)a[J].indexOf("group-exchange")!==-1&&(D||(D=!0,a=a.slice()),a.splice(J--,1))}let u,l,d,p=t._debug;p&&p("Inbound: Handshake in progress"),p&&p(`Handshake: (local) KEX method: ${a}`),p&&p(`Handshake: (remote) KEX method: ${s.kex}`);let g;if(t._server?(l=a,u=s.kex,g=u.indexOf("ext-info-c")!==-1):(l=s.kex,u=a,g=l.indexOf("ext-info-s")!==-1),t._strictMode===void 0&&(t._server?t._strictMode=u.indexOf("kex-strict-c-v00@openssh.com")!==-1:t._strictMode=l.indexOf("kex-strict-s-v00@openssh.com")!==-1,t._strictMode&&(p&&p("Handshake: strict KEX mode enabled"),t._decipher.inSeqno!==1)))return p&&p("Handshake: KEXINIT not first packet in strict KEX mode"),at(t,"Handshake failed: KEXINIT not first packet in strict KEX mode","handshake",st.KEY_EXCHANGE_FAILED);for(d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: no matching key exchange algorithm"),at(t,"Handshake failed: no matching key exchange algorithm","handshake",st.KEY_EXCHANGE_FAILED);r.kex=u[d],p&&p(`Handshake: KEX algorithm: ${u[d]}`),i&&(!s.kex.length||u[d]!==s.kex[0])&&(t._skipNextInboundPacket=!0);let h=o.lists.serverHostKey.array;for(p&&p(`Handshake: (local) Host key format: ${h}`),p&&p(`Handshake: (remote) Host key format: ${s.serverHostKey}`),t._server?(l=h,u=s.serverHostKey):(l=s.serverHostKey,u=h),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching host key format"),at(t,"Handshake failed: no matching host key format","handshake",st.KEY_EXCHANGE_FAILED);r.serverHostKey=u[d],p&&p(`Handshake: Host key format: ${u[d]}`);let _=o.lists.cs.cipher.array;for(p&&p(`Handshake: (local) C->S cipher: ${_}`),p&&p(`Handshake: (remote) C->S cipher: ${s.cs.cipher}`),t._server?(l=_,u=s.cs.cipher):(l=s.cs.cipher,u=_),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching C->S cipher"),at(t,"Handshake failed: no matching C->S cipher","handshake",st.KEY_EXCHANGE_FAILED);r.cs.cipher=u[d],p&&p(`Handshake: C->S Cipher: ${u[d]}`);let b=o.lists.sc.cipher.array;for(p&&p(`Handshake: (local) S->C cipher: ${b}`),p&&p(`Handshake: (remote) S->C cipher: ${s.sc.cipher}`),t._server?(l=b,u=s.sc.cipher):(l=s.sc.cipher,u=b),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching S->C cipher"),at(t,"Handshake failed: no matching S->C cipher","handshake",st.KEY_EXCHANGE_FAILED);r.sc.cipher=u[d],p&&p(`Handshake: S->C cipher: ${u[d]}`);let E=o.lists.cs.mac.array;if(p&&p(`Handshake: (local) C->S MAC: ${E}`),p&&p(`Handshake: (remote) C->S MAC: ${s.cs.mac}`),ro[r.cs.cipher].authLen>0)r.cs.mac="",p&&p("Handshake: C->S MAC: <implicit>");else{for(t._server?(l=E,u=s.cs.mac):(l=s.cs.mac,u=E),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching C->S MAC"),at(t,"Handshake failed: no matching C->S MAC","handshake",st.KEY_EXCHANGE_FAILED);r.cs.mac=u[d],p&&p(`Handshake: C->S MAC: ${u[d]}`)}let v=o.lists.sc.mac.array;if(p&&p(`Handshake: (local) S->C MAC: ${v}`),p&&p(`Handshake: (remote) S->C MAC: ${s.sc.mac}`),ro[r.sc.cipher].authLen>0)r.sc.mac="",p&&p("Handshake: S->C MAC: <implicit>");else{for(t._server?(l=v,u=s.sc.mac):(l=s.sc.mac,u=v),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching S->C MAC"),at(t,"Handshake failed: no matching S->C MAC","handshake",st.KEY_EXCHANGE_FAILED);r.sc.mac=u[d],p&&p(`Handshake: S->C MAC: ${u[d]}`)}let w=o.lists.cs.compress.array;for(p&&p(`Handshake: (local) C->S compression: ${w}`),p&&p(`Handshake: (remote) C->S compression: ${s.cs.compress}`),t._server?(l=w,u=s.cs.compress):(l=s.cs.compress,u=w),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching C->S compression"),at(t,"Handshake failed: no matching C->S compression","handshake",st.KEY_EXCHANGE_FAILED);r.cs.compress=u[d],p&&p(`Handshake: C->S compression: ${u[d]}`);let H=o.lists.sc.compress.array;for(p&&p(`Handshake: (local) S->C compression: ${H}`),p&&p(`Handshake: (remote) S->C compression: ${s.sc.compress}`),t._server?(l=H,u=s.sc.compress):(l=s.sc.compress,u=H),d=0;d<u.length&&l.indexOf(u[d])===-1;++d);if(d===u.length)return p&&p("Handshake: No matching S->C compression"),at(t,"Handshake failed: no matching S->C compression","handshake",st.KEY_EXCHANGE_FAILED);r.sc.compress=u[d],p&&p(`Handshake: S->C compression: ${u[d]}`),r.cs.lang="",r.sc.lang="",t._kex&&(t._kexinit||_m(t),t._decipher._onPayload=Em.bind(t,{firstPacket:!1})),t._kex=sv(r,t,e),t._kex.remoteExtInfoEnabled=g,t._kex.start()}c(ym,"handleKexInit");var sv=(()=>{function t(s){let a=0,u=s.length;for(;s[a]===0;)++a,--u;let l;return s[a]&128?(l=Buffer.allocUnsafe(1+u),l[0]=0,s.copy(l,1,a),s=l):u!==s.length&&(l=Buffer.allocUnsafe(u),s.copy(l,0,a),s=l),s}c(t,"convertToMpint");class e{static{c(this,"KeyExchange")}constructor(a,u,l){this._protocol=u,this.sessionID=u._kex?u._kex.sessionID:void 0,this.negotiated=a,this.remoteExtInfoEnabled=!1,this._step=1,this._public=null,this._dh=null,this._sentNEWKEYS=!1,this._receivedNEWKEYS=!1,this._finished=!1,this._hostVerified=!1,this._kexinit=u._kexinit,this._remoteKexinit=l,this._identRaw=u._identRaw,this._remoteIdentRaw=u._remoteIdentRaw,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0}finish(a){if(this._finished)return!1;this._finished=!0;let u=this._protocol._server,l=this.negotiated,d=this.convertPublicKey(this._dhData),p=this.computeSecret(this._dhData);if(p instanceof Error)return p.message=`Error while computing DH secret (${this.type}): ${p.message}`,p.level="handshake",at(this._protocol,p,st.KEY_EXCHANGE_FAILED);let g=zl(this.hashName);sn(g,u?this._remoteIdentRaw:this._identRaw),sn(g,u?this._identRaw:this._remoteIdentRaw),sn(g,u?this._remoteKexinit:this._kexinit),sn(g,u?this._kexinit:this._remoteKexinit);let h=u?this._hostKey.getPublicSSH():this._hostKey;if(sn(g,h),this.type==="groupex"){let H=this.getDHParams(),D=Buffer.allocUnsafe(4);lr(D,this._minBits,0),g.update(D),lr(D,this._prefBits,0),g.update(D),lr(D,this._maxBits,0),g.update(D),sn(g,H.prime),sn(g,H.generator)}sn(g,u?d:this.getPublicKey());let _=u?this.getPublicKey():d;sn(g,_),sn(g,p);let b=g.digest();if(u){let H;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":H="sha256";break;case"rsa-sha2-512":H="sha512";break}this._protocol._debug&&this._protocol._debug("Generating signature ...");let D=this._hostKey.sign(b,H);if(D instanceof Error)return at(this._protocol,`Handshake failed: signature generation failed for ${this._hostKey.type} host key: ${D.message}`,"handshake",st.KEY_EXCHANGE_FAILED);if(D=ev(D,this._hostKey.type),D===!1)return at(this._protocol,`Handshake failed: signature conversion failed for ${this._hostKey.type} host key`,"handshake",st.KEY_EXCHANGE_FAILED);let J=this.negotiated.serverHostKey,Y=Buffer.byteLength(J),X=4+Y+4+D.length,P=this._protocol._packetRW.write.allocStartKEX,C=this._protocol._packetRW.write.alloc(5+h.length+4+_.length+4+X,!0);if(C[P]=wt.KEXDH_REPLY,lr(C,h.length,++P),C.set(h,P+=4),lr(C,_.length,P+=h.length),C.set(_,P+=4),lr(C,X,P+=_.length),lr(C,Y,P+=4),C.utf8Write(J,P+=4,Y),lr(C,D.length,P+=Y),C.set(D,P+=4),this._protocol._debug){let M;switch(this.type){case"group":M="KEXDH_REPLY";break;case"groupex":M="KEXDH_GEX_REPLY";break;default:M="KEXECDH_REPLY"}this._protocol._debug(`Outbound: Sending ${M}`)}this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(C,!0))}else{ot.init(this._sig,0);let H=ot.readString(!0);if(!H)return at(this._protocol,"Malformed packet while reading signature","handshake",st.KEY_EXCHANGE_FAILED);if(H!==l.serverHostKey)return at(this._protocol,`Wrong signature type: ${H}, expected: ${l.serverHostKey}`,"handshake",st.KEY_EXCHANGE_FAILED);let D=ot.readString();if(ot.clear(),D===void 0)return at(this._protocol,"Malformed packet while reading signature","handshake",st.KEY_EXCHANGE_FAILED);if(!(D=rv(D,H)))return at(this._protocol,"Malformed signature","handshake",st.KEY_EXCHANGE_FAILED);let J;{ot.init(this._hostKey,0);let P=ot.readString(!0),C=this._hostKey.slice(ot.pos());if(ot.clear(),J=XI(C,P),J instanceof Error)return J.level="handshake",at(this._protocol,J,st.KEY_EXCHANGE_FAILED)}let Y;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":Y="sha256";break;case"rsa-sha2-512":Y="sha512";break}this._protocol._debug&&this._protocol._debug("Verifying signature ...");let X=J.verify(b,D,Y);if(X!==!0)return X instanceof Error?this._protocol._debug&&this._protocol._debug(`Signature verification failed: ${X.stack}`):this._protocol._debug&&this._protocol._debug("Signature verification failed"),at(this._protocol,"Handshake failed: signature verification failed","handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Verified signature")}(u||!a)&&Va(this);let E,v,w=c(H=>{if(E)return Va(this),E.outbound.seqno=this._protocol._cipher.outSeqno,this._protocol._cipher.free(),this._protocol._cipher=ZI(E),this._protocol._packetRW.write=v,E=void 0,v=void 0,this._protocol._onHandshakeComplete(l),!1;this.sessionID||(this.sessionID=b);{let Z=Buffer.allocUnsafe(4+p.length);lr(Z,p.length,0),Z.set(p,4),p=Z}let D=ro[l.cs.cipher],J=ro[l.sc.cipher],Y=to(D.ivLen,this.hashName,p,b,this.sessionID,"A"),X=to(J.ivLen,this.hashName,p,b,this.sessionID,"B"),P=to(D.keyLen,this.hashName,p,b,this.sessionID,"C"),C=to(J.keyLen,this.hashName,p,b,this.sessionID,"D"),M,L;D.authLen||(M=hm[l.cs.mac],L=to(M.len,this.hashName,p,b,this.sessionID,"E"));let T,F;J.authLen||(T=hm[l.sc.mac],F=to(T.len,this.hashName,p,b,this.sessionID,"F"));let j={inbound:{onPayload:this._protocol._onPayload,seqno:this._protocol._decipher.inSeqno,decipherInfo:u?D:J,decipherIV:u?Y:X,decipherKey:u?P:C,macInfo:u?M:T,macKey:u?L:F},outbound:{onWrite:this._protocol._onWrite,seqno:this._protocol._cipher.outSeqno,cipherInfo:u?J:D,cipherIV:u?X:Y,cipherKey:u?C:P,macInfo:u?T:M,macKey:u?F:L}};this._protocol._decipher.free(),E=j,this._protocol._decipher=YI(j);let B={read:void 0,write:void 0};switch(l.cs.compress){case"zlib":u?B.read=new qa:B.write=new Qa(this._protocol);break;case"zlib@openssh.com":if(this._protocol._authenticated){u?B.read=new qa:B.write=new Qa(this._protocol);break}default:u?B.read=new gm:B.write=new mm(this._protocol)}switch(l.sc.compress){case"zlib":u?B.write=new Qa(this._protocol):B.read=new qa;break;case"zlib@openssh.com":if(this._protocol._authenticated){u?B.write=new Qa(this._protocol):B.read=new qa;break}default:u?B.write=new mm(this._protocol):B.read=new gm}return this._protocol._packetRW.read.cleanup(),this._protocol._packetRW.write.cleanup(),this._protocol._packetRW.read=B.read,v=B.write,this._public=null,this._dh=null,this._kexinit=this._protocol._kexinit=void 0,this._remoteKexinit=void 0,this._identRaw=void 0,this._remoteIdentRaw=void 0,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0,H?!1:w()},"completeHandshake");if((u||a)&&(this.finish=w),!u)return w(a)}start(){if(!this._protocol._server){if(this._protocol._debug){let d;this.type==="group"?d="KEXDH_INIT":d="KEXECDH_INIT",this._protocol._debug(`Outbound: Sending ${d}`)}let a=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+a.length,!0);l[u]=wt.KEXDH_INIT,lr(l,a.length,++u),l.set(a,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}getPublicKey(){this.generateKeys();let a=this._public;if(a)return this.convertPublicKey(a)}convertPublicKey(a){let u,l=0,d=a.length;for(;a[l]===0;)++l,--d;return a[l]&128?(u=Buffer.allocUnsafe(1+d),u[0]=0,a.copy(u,1,l),u):(d!==a.length&&(u=Buffer.allocUnsafe(d),a.copy(u,0,l),a=u),a)}computeSecret(a){this.generateKeys();try{return t(this._dh.computeSecret(a))}catch(u){return u}}parse(a){let u=a[0];switch(this._step){case 1:if(this._protocol._server){if(u!==wt.KEXDH_INIT)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_INIT}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Init"),ot.init(a,1);let l=ot.readString();if(ot.clear(),l===void 0)return at(this._protocol,"Received malformed KEX*_INIT","handshake",st.KEY_EXCHANGE_FAILED);this._dhData=l;let d=this._protocol._hostKeys[this.negotiated.serverHostKey];Array.isArray(d)&&(d=d[0]),this._hostKey=d,this.finish()}else{if(u!==wt.KEXDH_REPLY)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_REPLY}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Reply"),ot.init(a,1);let l,d,p;if((l=ot.readString())===void 0||(d=ot.readString())===void 0||(p=ot.readString())===void 0)return ot.clear(),at(this._protocol,"Received malformed KEX*_REPLY","handshake",st.KEY_EXCHANGE_FAILED);ot.clear(),ot.init(l,0);let g=ot.readString(!0);if(ot.clear(),g===void 0)return at(this._protocol,"Received malformed host public key","handshake",st.KEY_EXCHANGE_FAILED);if(g!==this.negotiated.serverHostKey)switch(this.negotiated.serverHostKey){case"rsa-sha2-256":case"rsa-sha2-512":if(g==="ssh-rsa")break;default:return at(this._protocol,"Host key does not match negotiated type","handshake",st.KEY_EXCHANGE_FAILED)}this._hostKey=l,this._dhData=d,this._sig=p;let h=!1,_;if(this._protocol._hostVerifier===void 0?(_=!0,this._protocol._debug&&this._protocol._debug("Host accepted by default (no verification)")):_=this._protocol._hostVerifier(l,b=>{if(!h){if(h=!0,b===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),at(this._protocol,"Host denied (verification failed)","handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,this._receivedNEWKEYS?this.finish():Va(this)}}),_===void 0){++this._step;return}if(h=!0,_===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),at(this._protocol,"Host denied (verification failed)","handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,Va(this)}++this._step;break;case 2:return u!==wt.NEWKEYS?at(this._protocol,`Received packet ${u} instead of ${wt.NEWKEYS}`,"handshake",st.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Inbound: NEWKEYS"),this._receivedNEWKEYS=!0,this._protocol._strictMode&&(this._protocol._decipher.inSeqno=0),++this._step,this.finish(!this._protocol._server&&!this._hostVerified));default:return at(this._protocol,`Received unexpected packet ${u} after NEWKEYS`,"handshake",st.KEY_EXCHANGE_FAILED)}}}class r extends e{static{c(this,"Curve25519Exchange")}constructor(a,...u){super(...u),this.type="25519",this.hashName=a,this._keys=null}generateKeys(){this._keys||(this._keys=VI("x25519"))}getPublicKey(){return this.generateKeys(),this._keys.publicKey.export({type:"spki",format:"der"}).slice(-32)}convertPublicKey(a){let u,l=0,d=a.length;for(;a[l]===0;)++l,--d;return a.length===32||d!==a.length&&(u=Buffer.allocUnsafe(d),a.copy(u,0,l),a=u),a}computeSecret(a){this.generateKeys();try{let u=new fm.Writer;return u.startSequence(),u.startSequence(),u.writeOID("1.3.101.110"),u.endSequence(),u.startSequence(fm.BitString),u.writeByte(0),u._ensure(a.length),a.copy(u._buf,u._offset,0,a.length),u._offset+=a.length,u.endSequence(),u.endSequence(),t(QI({privateKey:this._keys.privateKey,publicKey:qI({key:u.buffer,type:"spki",format:"der"})}))}catch(u){return u}}}class n extends e{static{c(this,"ECDHExchange")}constructor(a,u,...l){super(...l),this.type="ecdh",this.curveName=a,this.hashName=u}generateKeys(){this._dh||(this._dh=WI(this.curveName),this._public=this._dh.generateKeys())}}class i extends e{static{c(this,"DHGroupExchange")}constructor(a,...u){super(...u),this.type="groupex",this.hashName=a,this._prime=null,this._generator=null,this._minBits=nv,this._prefBits=av(this.negotiated),this._protocol._compatFlags&Ml.BUG_DHGEX_LARGE&&(this._prefBits=Math.min(this._prefBits,4096)),this._maxBits=iv}start(){if(this._protocol._server)return;this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_REQUEST");let a=this._protocol._packetRW.write.allocStartKEX,u=this._protocol._packetRW.write.alloc(13,!0);u[a]=wt.KEXDH_GEX_REQUEST,lr(u,this._minBits,++a),lr(u,this._prefBits,a+=4),lr(u,this._maxBits,a+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(u,!0))}generateKeys(){!this._dh&&this._prime&&this._generator&&(this._dh=HI(this._prime,this._generator),this._public=this._dh.generateKeys())}setDHParams(a,u){if(!Buffer.isBuffer(a))throw new Error("Invalid prime value");if(!Buffer.isBuffer(u))throw new Error("Invalid generator value");this._prime=a,this._generator=u}getDHParams(){if(this._dh)return{prime:t(this._dh.getPrime()),generator:t(this._dh.getGenerator())}}parse(a){let u=a[0];switch(this._step){case 1:{if(this._protocol._server)return u!==wt.KEXDH_GEX_REQUEST?at(this._protocol,`Received packet ${u} instead of `+wt.KEXDH_GEX_REQUEST,"handshake",st.KEY_EXCHANGE_FAILED):at(this._protocol,"Group exchange not implemented for server","handshake",st.KEY_EXCHANGE_FAILED);if(u!==wt.KEXDH_GEX_GROUP)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_GEX_GROUP}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Group"),ot.init(a,1);let l,d;if((l=ot.readString())===void 0||(d=ot.readString())===void 0)return ot.clear(),at(this._protocol,"Received malformed KEXDH_GEX_GROUP","handshake",st.KEY_EXCHANGE_FAILED);ot.clear(),this.setDHParams(l,d),this.generateKeys();let p=this.getPublicKey();this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_INIT");let g=this._protocol._packetRW.write.allocStartKEX,h=this._protocol._packetRW.write.alloc(5+p.length,!0);h[g]=wt.KEXDH_GEX_INIT,lr(h,p.length,++g),h.set(p,g+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(h,!0)),++this._step;break}case 2:if(this._protocol._server)return u!==wt.KEXDH_GEX_INIT?at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_GEX_INIT}`,"handshake",st.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Received DH GEX Init"),at(this._protocol,"Group exchange not implemented for server","handshake",st.KEY_EXCHANGE_FAILED));if(u!==wt.KEXDH_GEX_REPLY)return at(this._protocol,`Received packet ${u} instead of ${wt.KEXDH_GEX_REPLY}`,"handshake",st.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Reply"),this._step=1,a[0]=wt.KEXDH_REPLY,this.parse=e.prototype.parse,this.parse(a)}}}class o extends e{static{c(this,"DHExchange")}constructor(a,u,...l){super(...l),this.type="group",this.groupName=a,this.hashName=u}start(){if(!this._protocol._server){this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_INIT");let a=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+a.length,!0);l[u]=wt.KEXDH_INIT,lr(l,a.length,++u),l.set(a,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}generateKeys(){this._dh||(this._dh=jI(this.groupName),this._public=this._dh.generateKeys())}getDHParams(){if(this._dh)return{prime:t(this._dh.getPrime()),generator:t(this._dh.getGenerator())}}}return(s,...a)=>{if(typeof s!="object"||s===null)throw new Error("Invalid negotiated argument");let u=s.kex;if(typeof u=="string"){switch(a=[s,...a],u){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!GI)break;return new r("sha256",...a);case"ecdh-sha2-nistp256":return new n("prime256v1","sha256",...a);case"ecdh-sha2-nistp384":return new n("secp384r1","sha384",...a);case"ecdh-sha2-nistp521":return new n("secp521r1","sha512",...a);case"diffie-hellman-group1-sha1":return new o("modp2","sha1",...a);case"diffie-hellman-group14-sha1":return new o("modp14","sha1",...a);case"diffie-hellman-group14-sha256":return new o("modp14","sha256",...a);case"diffie-hellman-group15-sha512":return new o("modp15","sha512",...a);case"diffie-hellman-group16-sha512":return new o("modp16","sha512",...a);case"diffie-hellman-group17-sha512":return new o("modp17","sha512",...a);case"diffie-hellman-group18-sha512":return new o("modp18","sha512",...a);case"diffie-hellman-group-exchange-sha1":return new i("sha1",...a);case"diffie-hellman-group-exchange-sha256":return new i("sha256",...a)}throw new Error(`Unsupported key exchange algorithm: ${u}`)}throw new Error(`Invalid key exchange type: ${u}`)}})(),Ll=(()=>{let t=["kex","serverHostKey",["cs","cipher"],["sc","cipher"],["cs","mac"],["sc","mac"],["cs","compress"],["sc","compress"],["cs","lang"],["sc","lang"]];return class{static{c(this,"KexInit")}constructor(r){if(typeof r!="object"||r===null)throw new TypeError("Argument must be an object");let n={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},all:void 0},i=0;for(let a of t){let u,l,d,p;if(typeof a=="string")u=n,l=r[a],d=p=a;else{let h=a[0];u=n[h],p=a[1],l=r[h][p],d=`${h}.${p}`}let g={array:void 0,buffer:void 0};if(Buffer.isBuffer(l))g.array=(""+l).split(","),g.buffer=l,i+=4+l.length;else{if(typeof l=="string"&&(l=l.split(",")),Array.isArray(l))g.array=l,g.buffer=Buffer.from(l.join(","));else throw new TypeError(`Invalid \`${d}\` type: ${typeof l}`);i+=4+g.buffer.length}u[p]=g}let o=Buffer.allocUnsafe(i);n.all=o;let s=0;for(let a of t){let u;typeof a=="string"?u=n[a].buffer:u=n[a[0]][a[1]].buffer,s=lr(o,u.length,s),o.set(u,s),s+=u.length}this.totalSize=i,this.lists=n}copyAllTo(r,n){let i=this.lists.all;if(typeof n!="number")throw new TypeError(`Invalid offset value: ${typeof n}`);if(r.length-n<i.length)throw new Error("Insufficient space to copy list");return r.set(i,n),i.length}}})(),sn=(()=>{let t=Buffer.allocUnsafe(4);return(e,r)=>{lr(t,r.length,0),e.update(t),e.update(r)}})();function to(t,e,r,n,i,o){let s;if(t){let a=zl(e).update(r).update(n).update(o).update(i).digest();for(;a.length<t;){let u=zl(e).update(r).update(n).update(a).digest(),l=Buffer.allocUnsafe(a.length+u.length);l.set(a,0),l.set(u,a.length),a=l}a.length===t?s=a:s=new tv(a.buffer,a.byteOffset,t)}else s=ov;return s}c(to,"generateKEXVal");function Em(t,e){if(e.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}if(this._skipNextInboundPacket){this._skipNextInboundPacket=!1;return}e=this._packetRW.read.read(e);let r=e[0];if(!this._strictMode)switch(r){case wt.IGNORE:case wt.UNIMPLEMENTED:case wt.DEBUG:return eo||(eo=Ma()),eo[r](this,e)}switch(r){case wt.DISCONNECT:return eo||(eo=Ma()),eo[r](this,e);case wt.KEXINIT:return t.firstPacket?(t.firstPacket=!1,ym(this,e)):at(this,"Received extra KEXINIT during handshake","handshake",st.KEY_EXCHANGE_FAILED);default:if(r<20||r>49)return at(this,`Received unexpected packet type ${r}`,"handshake",st.KEY_EXCHANGE_FAILED)}return this._kex.parse(e)}c(Em,"onKEXPayload");function av(t){let e=ro[t.cs.cipher],r=ro[t.sc.cipher],n=Math.max(0,e.sslName==="des-ede3-cbc"?14:e.keyLen,e.blockLen,e.ivLen,r.sslName==="des-ede3-cbc"?14:r.keyLen,r.blockLen,r.ivLen)*8;return n<=112?2048:n<=128?3072:n<=192?7680:8192}c(av,"dhEstimate");function Va(t){if(!t._sentNEWKEYS){t._protocol._debug&&t._protocol._debug("Outbound: Sending NEWKEYS");let e=t._protocol._packetRW.write.allocStartKEX,r=t._protocol._packetRW.write.alloc(1,!0);r[e]=wt.NEWKEYS,t._protocol._cipher.encrypt(t._protocol._packetRW.write.finalize(r,!0)),t._sentNEWKEYS=!0,t._protocol._strictMode&&(t._protocol._cipher.outSeqno=0)}}c(Va,"trySendNEWKEYS");Am.exports={KexInit:Ll,kexinit:_m,onKEXPayload:Em,DEFAULT_KEXINIT_CLIENT:new Ll({kex:dm.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),serverHostKey:pm,cs:{cipher:Ha,mac:ja,compress:Wa,lang:[]},sc:{cipher:Ha,mac:ja,compress:Wa,lang:[]}}),DEFAULT_KEXINIT_SERVER:new Ll({kex:dm.concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:pm,cs:{cipher:Ha,mac:ja,compress:Wa,lang:[]},sc:{cipher:Ha,mac:ja,compress:Wa,lang:[]}}),HANDLERS:{[wt.KEXINIT]:ym}}});var bm=le((jF,cv)=>{cv.exports={name:"ssh2",version:"1.16.0",author:"Brian White <mscdex@mscdex.net>",description:"SSH2 client and server modules written in pure JavaScript for node.js",main:"./lib/index.js",engines:{node:">=10.16.0"},dependencies:{asn1:"^0.2.6","bcrypt-pbkdf":"^1.0.2"},devDependencies:{"@mscdex/eslint-config":"^1.1.0",eslint:"^7.32.0"},optionalDependencies:{"cpu-features":"~0.0.10",nan:"^2.20.0"},scripts:{install:"node install.js",rebuild:"node install.js",test:"node test/test.js",lint:"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js examples lib test","lint:fix":"npm run lint -- --fix"},keywords:["ssh","ssh2","sftp","secure","shell","exec","remote","client"],licenses:[{type:"MIT",url:"http://github.com/mscdex/ssh2/raw/master/LICENSE"}],repository:{type:"git",url:"http://github.com/mscdex/ssh2.git"}}});var Wl=le((WF,$m)=>{"use strict";var{inspect:Pm}=require("util"),{bindingAvailable:uv,NullCipher:lv,NullDecipher:fv}=Mn(),{COMPAT_CHECKS:dv,DISCONNECT_REASON:Tm,eddsaSupported:pv,MESSAGE:we,SIGNALS:xm,TERMINAL_MODE:Hl}=An(),{DEFAULT_KEXINIT_CLIENT:hv,DEFAULT_KEXINIT_SERVER:gv,KexInit:Im,kexinit:Cm,onKEXPayload:mv}=Fa(),{parseKey:vm}=jn(),_v=Ma(),{bufferCopy:Ka,bufferFill:yv,bufferSlice:km,convertSignature:Sm,sendPacket:Pe,writeUInt32BE:R}=Vr(),{PacketReader:Ev,PacketWriter:Av,ZlibPacketReader:Rm,ZlibPacketWriter:Nm}=Dl(),bv=bm().version,xv=new Map(Object.values(Tm).map(t=>[t,1])),Om=Buffer.from(`SSH-2.0-ssh2js${bv}`),Iv=Buffer.from(`${Om}\r
12
- `),vv=8192,Sv=1024,wm=Buffer.from([we.GLOBAL_REQUEST,0,0,0,21,107,101,101,112,97,108,105,118,101,64,111,112,101,110,115,115,104,46,99,111,109,1]),wv=Buffer.from([Hl.TTY_OP_END]);function Fl(){}c(Fl,"noop");var jl=class{static{c(this,"Protocol")}constructor(e){let r=e.onWrite;if(typeof r!="function")throw new Error("Missing onWrite function");this._onWrite=h=>{r(h)};let n=e.onError;if(typeof n!="function")throw new Error("Missing onError function");this._onError=h=>{n(h)};let i=e.debug;this._debug=typeof i=="function"?h=>{i(h)}:void 0;let o=e.onHeader;this._onHeader=typeof o=="function"?(...h)=>{o(...h)}:Fl;let s=e.onPacket;this._onPacket=typeof s=="function"?()=>{s()}:Fl;let a=e.onHandshakeComplete;typeof a!="function"&&(a=Fl);let u;this._onHandshakeComplete=(...h)=>{this._debug&&this._debug("Handshake completed"),u===void 0?u=!0:u=!1;let _=this._queue;if(_){this._queue=void 0,this._debug&&this._debug(`Draining outbound queue (${_.length}) ...`);for(let b=0;b<_.length;++b){let E=_[b],v=this._packetRW.write.finalize(E);if(v===E){let w=this._cipher.allocPacket(E.length);w.set(E,5),v=w}Pe(this,v)}this._debug&&this._debug("... finished draining outbound queue")}u&&this._server&&this._kex.remoteExtInfoEnabled&&Ov(this),a(...h)},this._queue=void 0;let l=e.messageHandlers;typeof l=="object"&&l!==null?this._handlers=l:this._handlers={},this._onPayload=kv.bind(this),this._server=!!e.server,this._banner=void 0;let d;if(this._server){if(typeof e.hostKeys!="object"||e.hostKeys===null)throw new Error("Missing server host key(s)");this._hostKeys=e.hostKeys,typeof e.greeting=="string"&&e.greeting.length&&(d=e.greeting.slice(-2)===`\r
13
- `?e.greeting:`${e.greeting}\r
14
- `),typeof e.banner=="string"&&e.banner.length&&(this._banner=e.banner.slice(-2)===`\r
15
- `?e.banner:`${e.banner}\r
16
- `)}else this._hostKeys=void 0;let p=e.offer;typeof p!="object"||p===null?p=this._server?gv:hv:p.constructor!==Im&&(this._server?p.kex=p.kex.concat(["kex-strict-s-v00@openssh.com"]):p.kex=p.kex.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),p=new Im(p)),this._kex=void 0,this._strictMode=void 0,this._kexinit=void 0,this._offer=p,this._cipher=new lv(0,this._onWrite),this._decipher=void 0,this._skipNextInboundPacket=!1,this._packetRW={read:new Ev,write:new Av(this)},this._hostVerifier=!this._server&&typeof e.hostVerifier=="function"?e.hostVerifier:void 0,this._parse=Tv,this._buffer=void 0,this._authsQueue=[],this._authenticated=!1,this._remoteIdentRaw=void 0;let g;if(typeof e.ident=="string")this._identRaw=Buffer.from(`SSH-2.0-${e.ident}`),g=Buffer.allocUnsafe(this._identRaw.length+2),g.set(this._identRaw,0),g[g.length-2]=13,g[g.length-1]=10;else if(Buffer.isBuffer(e.ident)){let h=Buffer.allocUnsafe(8+e.ident.length);h.latin1Write("SSH-2.0-",0,8),h.set(e.ident,8),this._identRaw=h,g=Buffer.allocUnsafe(h.length+2),g.set(h,0),g[g.length-2]=13,g[g.length-1]=10}else this._identRaw=Om,g=Iv;this._compatFlags=0,this._debug&&(uv?this._debug("Custom crypto binding available"):this._debug("Custom crypto binding not available")),this._debug&&this._debug(`Local ident: ${Pm(this._identRaw.toString())}`),this.start=()=>{this.start=void 0,d&&this._onWrite(d),this._onWrite(g)}}_destruct(e){this._packetRW.read.cleanup(),this._packetRW.write.cleanup(),this._cipher&&this._cipher.free(),this._decipher&&this._decipher.free(),(typeof e!="string"||e.length===0)&&(e="fatal error"),this.parse=()=>{throw new Error(`Instance unusable after ${e}`)},this._onWrite=()=>{throw new Error(`Instance unusable after ${e}`)},this._destruct=void 0}cleanup(){this._destruct&&this._destruct()}parse(e,r,n){for(;r<n;)r=this._parse(e,r,n)}disconnect(e){let n=this._packetRW.write.allocStartKEX,i=this._packetRW.write.alloc(13,!0),o=n+13;xv.has(e)||(e=Tm.PROTOCOL_ERROR),i[n]=we.DISCONNECT,R(i,e,++n),i.fill(0,n+=4,o),this._debug&&this._debug(`Outbound: Sending DISCONNECT (${e})`),Pe(this,this._packetRW.write.finalize(i,!0),!0)}ping(){let e=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(wm.length);r.set(wm,e),this._debug&&this._debug("Outbound: Sending ping (GLOBAL_REQUEST: keepalive@openssh.com)"),Pe(this,this._packetRW.write.finalize(r))}rekey(){this._kexinit===void 0?(this._debug&&this._debug("Outbound: Initiated explicit rekey"),this._queue=[],Cm(this)):this._debug&&this._debug("Outbound: Ignoring rekey during handshake")}requestSuccess(e){let r=this._packetRW.write.allocStart,n;Buffer.isBuffer(e)?(n=this._packetRW.write.alloc(1+e.length),n[r]=we.REQUEST_SUCCESS,n.set(e,++r)):(n=this._packetRW.write.alloc(1),n[r]=we.REQUEST_SUCCESS),this._debug&&this._debug("Outbound: Sending REQUEST_SUCCESS"),Pe(this,this._packetRW.write.finalize(n))}requestFailure(){let e=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[e]=we.REQUEST_FAILURE,this._debug&&this._debug("Outbound: Sending REQUEST_FAILURE"),Pe(this,this._packetRW.write.finalize(r))}channelSuccess(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_SUCCESS,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_SUCCESS (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelFailure(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_FAILURE,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_FAILURE (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelEOF(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_EOF,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_EOF (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelClose(e){let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5);n[r]=we.CHANNEL_CLOSE,R(n,e,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_CLOSE (r:${e})`),Pe(this,this._packetRW.write.finalize(n))}channelWindowAdjust(e,r){let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(9);i[n]=we.CHANNEL_WINDOW_ADJUST,R(i,e,++n),R(i,r,n+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_WINDOW_ADJUST (r:${e}, ${r})`),Pe(this,this._packetRW.write.finalize(i))}channelData(e,r){let n=Buffer.isBuffer(r),i=n?r.length:Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(9+i);s[o]=we.CHANNEL_DATA,R(s,e,++o),R(s,i,o+=4),n?s.set(r,o+=4):s.utf8Write(r,o+=4,i),this._debug&&this._debug(`Outbound: Sending CHANNEL_DATA (r:${e}, ${i})`),Pe(this,this._packetRW.write.finalize(s))}channelExtData(e,r,n){let i=Buffer.isBuffer(r),o=i?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(13+o);a[s]=we.CHANNEL_EXTENDED_DATA,R(a,e,++s),R(a,n,s+=4),R(a,o,s+=4),i?a.set(r,s+=4):a.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_EXTENDED_DATA (r:${e})`),Pe(this,this._packetRW.write.finalize(a))}channelOpenConfirm(e,r,n,i){let o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(17);s[o]=we.CHANNEL_OPEN_CONFIRMATION,R(s,e,++o),R(s,r,o+=4),R(s,n,o+=4),R(s,i,o+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_CONFIRMATION (r:${e}, l:${r})`),Pe(this,this._packetRW.write.finalize(s))}channelOpenFail(e,r,n){typeof n!="string"&&(n="");let i=Buffer.byteLength(n),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(13+i+4);s[o]=we.CHANNEL_OPEN_FAILURE,R(s,e,++o),R(s,r,o+=4),R(s,i,o+=4),o+=4,i&&(s.utf8Write(n,o,i),o+=i),R(s,0,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_FAILURE (r:${e})`),Pe(this,this._packetRW.write.finalize(s))}service(e){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r);i[n]=we.SERVICE_REQUEST,R(i,r,++n),i.utf8Write(e,n+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_REQUEST (${e})`),Pe(this,this._packetRW.write.finalize(i))}authPassword(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=Buffer.byteLength(r),s=n?Buffer.byteLength(n):0,a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+i+4+14+4+8+1+4+o+(n?4+s:0));u[a]=we.USERAUTH_REQUEST,R(u,i,++a),u.utf8Write(e,a+=4,i),R(u,14,a+=i),u.utf8Write("ssh-connection",a+=4,14),R(u,8,a+=14),u.utf8Write("password",a+=4,8),u[a+=8]=n?1:0,R(u,o,++a),Buffer.isBuffer(r)?Ka(r,u,0,o,a+=4):u.utf8Write(r,a+=4,o),n?(R(u,s,a+=o),Buffer.isBuffer(n)?Ka(n,u,0,s,a+=4):u.utf8Write(n,a+=4,s),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (changed password)")):this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (password)"),this._authsQueue.push("password"),Pe(this,this._packetRW.write.finalize(u))}authPK(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");if(r=vm(r),r instanceof Error)throw new Error("Invalid key");let o=r.type;r=r.getPublicSSH(),typeof n=="function"&&(i=n,n=void 0),n||(n=o);let s=Buffer.byteLength(e),a=Buffer.byteLength(n),u=r.length,l=this._kex.sessionID,d=l.length,p=(i?4+d:0)+1+4+s+4+14+4+9+1+4+a+4+u,g,h;if(i?(g=Buffer.allocUnsafe(p),h=0,R(g,d,h),g.set(l,h+=4),h+=d):(g=this._packetRW.write.alloc(p),h=this._packetRW.write.allocStart),g[h]=we.USERAUTH_REQUEST,R(g,s,++h),g.utf8Write(e,h+=4,s),R(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),R(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=i?1:0,R(g,a,++h),g.utf8Write(n,h+=4,a),R(g,u,h+=a),g.set(r,h+=4),!i){this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey -- check)"),Pe(this,this._packetRW.write.finalize(g));return}i(g,_=>{if(_=Sm(_,o),_===!1)throw new Error("Error while converting handshake signature");let b=_.length;h=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(5+s+4+14+4+9+1+4+a+4+u+4+4+a+4+b),g[h]=we.USERAUTH_REQUEST,R(g,s,++h),g.utf8Write(e,h+=4,s),R(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),R(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=1,R(g,a,++h),g.utf8Write(n,h+=4,a),R(g,u,h+=a),g.set(r,h+=4),R(g,4+a+4+b,h+=u),R(g,a,h+=4),g.utf8Write(n,h+=4,a),R(g,b,h+=a),g.set(_,h+=4),this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey)"),Pe(this,this._packetRW.write.finalize(g))})}authHostbased(e,r,n,i,o,s){if(this._server)throw new Error("Client-only method called in server mode");if(r=vm(r),r instanceof Error)throw new Error("Invalid key");let a=r.type;r=r.getPublicSSH(),typeof o=="function"&&(s=o,o=void 0),o||(o=a);let u=Buffer.byteLength(e),l=Buffer.byteLength(o),d=r.length,p=this._kex.sessionID,g=p.length,h=Buffer.byteLength(n),_=Buffer.byteLength(i),b=Buffer.allocUnsafe(4+g+1+4+u+4+14+4+9+4+l+4+d+4+h+4+_),E=0;R(b,g,E),b.set(p,E+=4),b[E+=g]=we.USERAUTH_REQUEST,R(b,u,++E),b.utf8Write(e,E+=4,u),R(b,14,E+=u),b.utf8Write("ssh-connection",E+=4,14),R(b,9,E+=14),b.utf8Write("hostbased",E+=4,9),R(b,l,E+=9),b.utf8Write(o,E+=4,l),R(b,d,E+=l),b.set(r,E+=4),R(b,h,E+=d),b.utf8Write(n,E+=4,h),R(b,_,E+=h),b.utf8Write(i,E+=4,_),s(b,v=>{if(v=Sm(v,a),!v)throw new Error("Error while converting handshake signature");let w=v.length,H=b.length-g-4;E=this._packetRW.write.allocStart;let D=this._packetRW.write.alloc(H+4+4+l+4+w);Ka(b,D,4+g,b.length,E),R(D,4+l+4+w,E+=H),R(D,l,E+=4),D.utf8Write(o,E+=4,l),R(D,w,E+=l),D.set(v,E+=4),this._authsQueue.push("hostbased"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (hostbased)"),Pe(this,this._packetRW.write.finalize(D))})}authKeyboard(e){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r+4+14+4+20+4+4);i[n]=we.USERAUTH_REQUEST,R(i,r,++n),i.utf8Write(e,n+=4,r),R(i,14,n+=r),i.utf8Write("ssh-connection",n+=4,14),R(i,20,n+=14),i.utf8Write("keyboard-interactive",n+=4,20),R(i,0,n+=20),R(i,0,n+=4),this._authsQueue.push("keyboard-interactive"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (keyboard-interactive)"),Pe(this,this._packetRW.write.finalize(i))}authNone(e){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r+4+14+4+4);i[n]=we.USERAUTH_REQUEST,R(i,r,++n),i.utf8Write(e,n+=4,r),R(i,14,n+=r),i.utf8Write("ssh-connection",n+=4,14),R(i,4,n+=14),i.utf8Write("none",n+=4,4),this._authsQueue.push("none"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (none)"),Pe(this,this._packetRW.write.finalize(i))}authInfoRes(e){if(this._server)throw new Error("Client-only method called in server mode");let r=0,n;if(e){n=new Array(e.length);for(let s=0;s<e.length;++s){let a=Buffer.byteLength(e[s]);n[s]=a,r+=4+a}}let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(5+r);if(o[i]=we.USERAUTH_INFO_RESPONSE,e){R(o,e.length,++i),i+=4;for(let s=0;s<e.length;++s){let a=n[s];R(o,a,i),i+=4,a&&(o.utf8Write(e[s],i,a),i+=a)}}else R(o,0,++i);this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_RESPONSE"),Pe(this,this._packetRW.write.finalize(o))}tcpipForward(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+i+4);s[o]=we.GLOBAL_REQUEST,R(s,13,++o),s.utf8Write("tcpip-forward",o+=4,13),s[o+=13]=n===void 0||n===!0?1:0,R(s,i,++o),s.utf8Write(e,o+=4,i),R(s,r,o+=i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (tcpip-forward)"),Pe(this,this._packetRW.write.finalize(s))}cancelTcpipForward(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(30+i+4);s[o]=we.GLOBAL_REQUEST,R(s,20,++o),s.utf8Write("cancel-tcpip-forward",o+=4,20),s[o+=20]=n===void 0||n===!0?1:0,R(s,i,++o),s.utf8Write(e,o+=4,i),R(s,r,o+=i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-tcpip-forward)"),Pe(this,this._packetRW.write.finalize(s))}openssh_streamLocalForward(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(41+n);o[i]=we.GLOBAL_REQUEST,R(o,31,++i),o.utf8Write("streamlocal-forward@openssh.com",i+=4,31),o[i+=31]=r===void 0||r===!0?1:0,R(o,n,++i),o.utf8Write(e,i+=4,n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),Pe(this,this._packetRW.write.finalize(o))}openssh_cancelStreamLocalForward(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(48+n);o[i]=we.GLOBAL_REQUEST,R(o,38,++i),o.utf8Write("cancel-streamlocal-forward@openssh.com",i+=4,38),o[i+=38]=r===void 0||r===!0?1:0,R(o,n,++i),o.utf8Write(e,i+=4,n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),Pe(this,this._packetRW.write.finalize(o))}directTcpip(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(i.srcIP),s=Buffer.byteLength(i.dstIP),a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(33+o+4+4+s+4);u[a]=we.CHANNEL_OPEN,R(u,12,++a),u.utf8Write("direct-tcpip",a+=4,12),R(u,e,a+=12),R(u,r,a+=4),R(u,n,a+=4),R(u,s,a+=4),u.utf8Write(i.dstIP,a+=4,s),R(u,i.dstPort,a+=s),R(u,o,a+=4),u.utf8Write(i.srcIP,a+=4,o),R(u,i.srcPort,a+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, direct-tcpip)`),Pe(this,this._packetRW.write.finalize(u))}openssh_directStreamLocal(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(i.socketPath),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(51+o+4+4);a[s]=we.CHANNEL_OPEN,R(a,30,++s),a.utf8Write("direct-streamlocal@openssh.com",s+=4,30),R(a,e,s+=30),R(a,r,s+=4),R(a,n,s+=4),R(a,o,s+=4),a.utf8Write(i.socketPath,s+=4,o),yv(a,0,s+=o,s+8),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, direct-streamlocal@openssh.com)`),Pe(this,this._packetRW.write.finalize(a))}openssh_noMoreSessions(e){if(this._server)throw new Error("Client-only method called in server mode");let r=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(34);n[r]=we.GLOBAL_REQUEST,R(n,28,++r),n.utf8Write("no-more-sessions@openssh.com",r+=4,28),n[r+=28]=e===void 0||e===!0?1:0,this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (no-more-sessions@openssh.com)"),Pe(this,this._packetRW.write.finalize(n))}session(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(24);o[i]=we.CHANNEL_OPEN,R(o,7,++i),o.utf8Write("session",i+=4,7),R(o,e,i+=7),R(o,r,i+=4),R(o,n,i+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, session)`),Pe(this,this._packetRW.write.finalize(o))}windowChange(e,r,n,i,o){if(this._server)throw new Error("Client-only method called in server mode");let s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(39);a[s]=we.CHANNEL_REQUEST,R(a,e,++s),R(a,13,s+=4),a.utf8Write("window-change",s+=4,13),a[s+=13]=0,R(a,n,++s),R(a,r,s+=4),R(a,o,s+=4),R(a,i,s+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, window-change)`),Pe(this,this._packetRW.write.finalize(a))}pty(e,r,n,i,o,s,a,u){if(this._server)throw new Error("Client-only method called in server mode");(!s||!s.length)&&(s="vt100"),a&&!Buffer.isBuffer(a)&&!Array.isArray(a)&&typeof a=="object"&&a!==null&&(a=Nv(a)),(!a||!a.length)&&(a=wv);let l=s.length,d=a.length,p=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(21+l+4+4+4+4+4+d);if(g[p]=we.CHANNEL_REQUEST,R(g,e,++p),R(g,7,p+=4),g.utf8Write("pty-req",p+=4,7),g[p+=7]=u===void 0||u===!0?1:0,R(g,l,++p),g.utf8Write(s,p+=4,l),R(g,n,p+=l),R(g,r,p+=4),R(g,o,p+=4),R(g,i,p+=4),R(g,d,p+=4),p+=4,Array.isArray(a))for(let h=0;h<d;++h)g[p++]=a[h];else Buffer.isBuffer(a)&&g.set(a,p);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, pty-req)`),Pe(this,this._packetRW.write.finalize(g))}shell(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(15);i[n]=we.CHANNEL_REQUEST,R(i,e,++n),R(i,5,n+=4),i.utf8Write("shell",n+=4,5),i[n+=5]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, shell)`),Pe(this,this._packetRW.write.finalize(i))}exec(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.isBuffer(r),o=i?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(18+o);a[s]=we.CHANNEL_REQUEST,R(a,e,++s),R(a,4,s+=4),a.utf8Write("exec",s+=4,4),a[s+=4]=n===void 0||n===!0?1:0,R(a,o,++s),i?a.set(r,s+=4):a.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exec: ${r})`),Pe(this,this._packetRW.write.finalize(a))}signal(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=r;if(r=r.toUpperCase(),r.slice(0,3)==="SIG"&&(r=r.slice(3)),xm[r]!==1)throw new Error(`Invalid signal: ${n}`);let i=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(20+i);s[o]=we.CHANNEL_REQUEST,R(s,e,++o),R(s,6,o+=4),s.utf8Write("signal",o+=4,6),s[o+=6]=0,R(s,i,++o),s.utf8Write(r,o+=4,i),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, signal: ${r})`),Pe(this,this._packetRW.write.finalize(s))}env(e,r,n,i){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(r),s=Buffer.isBuffer(n),a=s?n.length:Buffer.byteLength(n),u=this._packetRW.write.allocStart,l=this._packetRW.write.alloc(17+o+4+a);l[u]=we.CHANNEL_REQUEST,R(l,e,++u),R(l,3,u+=4),l.utf8Write("env",u+=4,3),l[u+=3]=i===void 0||i===!0?1:0,R(l,o,++u),l.utf8Write(r,u+=4,o),R(l,a,u+=o),s?l.set(n,u+=4):l.utf8Write(n,u+=4,a),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, env: ${r}=${n})`),Pe(this,this._packetRW.write.finalize(l))}x11Forward(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=r.protocol,o=r.cookie,s=Buffer.isBuffer(i),a=s?i.length:Buffer.byteLength(i),u=Buffer.isBuffer(o),l=u?o.length:Buffer.byteLength(o),d=this._packetRW.write.allocStart,p=this._packetRW.write.alloc(22+a+4+l+4);p[d]=we.CHANNEL_REQUEST,R(p,e,++d),R(p,7,d+=4),p.utf8Write("x11-req",d+=4,7),p[d+=7]=n===void 0||n===!0?1:0,p[++d]=r.single?1:0,R(p,a,++d),s?p.set(i,d+=4):p.utf8Write(i,d+=4,a),R(p,l,d+=a),u?p.set(o,d+=4):p.latin1Write(o,d+=4,l),R(p,r.screen||0,d+=l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, x11-req)`),Pe(this,this._packetRW.write.finalize(p))}subsystem(e,r,n){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+i);s[o]=we.CHANNEL_REQUEST,R(s,e,++o),R(s,9,o+=4),s.utf8Write("subsystem",o+=4,9),s[o+=9]=n===void 0||n===!0?1:0,R(s,i,++o),s.utf8Write(r,o+=4,i),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, subsystem: ${r})`),Pe(this,this._packetRW.write.finalize(s))}openssh_agentForward(e,r){if(this._server)throw new Error("Client-only method called in server mode");let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(36);i[n]=we.CHANNEL_REQUEST,R(i,e,++n),R(i,26,n+=4),i.utf8Write("auth-agent-req@openssh.com",n+=4,26),i[n+=26]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, auth-agent-req@openssh.com)`),Pe(this,this._packetRW.write.finalize(i))}openssh_hostKeysProve(e){if(this._server)throw new Error("Client-only method called in server mode");let r=0,n=[];for(let s of e){let a=s.getPublicSSH();r+=4+a.length,n.push(a)}let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(35+r);o[i]=we.GLOBAL_REQUEST,R(o,29,++i),o.utf8Write("hostkeys-prove-00@openssh.com",i+=4,29),o[i+=29]=1,++i;for(let s of n)R(o,s.length,i),Ka(s,o,0,s.length,i+=4),i+=s.length;this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (hostkeys-prove-00@openssh.com)"),Pe(this,this._packetRW.write.finalize(o))}serviceAccept(e){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r);if(i[n]=we.SERVICE_ACCEPT,R(i,r,++n),i.utf8Write(e,n+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_ACCEPT (${e})`),Pe(this,this._packetRW.write.finalize(i)),this._server&&this._banner&&e==="ssh-userauth"){let o=this._banner;this._banner=void 0;let s=Buffer.byteLength(o);n=this._packetRW.write.allocStart;let a=this._packetRW.write.alloc(5+s+4);a[n]=we.USERAUTH_BANNER,R(a,s,++n),a.utf8Write(o,n+=4,s),R(a,0,n+=s),this._debug&&this._debug("Outbound: Sending USERAUTH_BANNER"),Pe(this,this._packetRW.write.finalize(a))}}forwardedTcpip(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(i.boundAddr),s=Buffer.byteLength(i.remoteAddr),a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(36+o+4+4+s+4);u[a]=we.CHANNEL_OPEN,R(u,15,++a),u.utf8Write("forwarded-tcpip",a+=4,15),R(u,e,a+=15),R(u,r,a+=4),R(u,n,a+=4),R(u,o,a+=4),u.utf8Write(i.boundAddr,a+=4,o),R(u,i.boundPort,a+=o),R(u,s,a+=4),u.utf8Write(i.remoteAddr,a+=4,s),R(u,i.remotePort,a+=s),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, forwarded-tcpip)`),Pe(this,this._packetRW.write.finalize(u))}x11(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(i.originAddr),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(24+o+4);a[s]=we.CHANNEL_OPEN,R(a,3,++s),a.utf8Write("x11",s+=4,3),R(a,e,s+=3),R(a,r,s+=4),R(a,n,s+=4),R(a,o,s+=4),a.utf8Write(i.originAddr,s+=4,o),R(a,i.originPort,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, x11)`),Pe(this,this._packetRW.write.finalize(a))}openssh_authAgent(e,r,n){if(!this._server)throw new Error("Server-only method called in client mode");let i=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(39);o[i]=we.CHANNEL_OPEN,R(o,22,++i),o.utf8Write("auth-agent@openssh.com",i+=4,22),R(o,e,i+=22),R(o,r,i+=4),R(o,n,i+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, auth-agent@openssh.com)`),Pe(this,this._packetRW.write.finalize(o))}openssh_forwardedStreamLocal(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(i.socketPath),s=this._packetRW.write.allocStart,a=this._packetRW.write.alloc(54+o+4);a[s]=we.CHANNEL_OPEN,R(a,33,++s),a.utf8Write("forwarded-streamlocal@openssh.com",s+=4,33),R(a,e,s+=33),R(a,r,s+=4),R(a,n,s+=4),R(a,o,s+=4),a.utf8Write(i.socketPath,s+=4,o),R(a,0,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${e}, forwarded-streamlocal@openssh.com)`),Pe(this,this._packetRW.write.finalize(a))}exitStatus(e,r){if(!this._server)throw new Error("Server-only method called in client mode");let n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(25);i[n]=we.CHANNEL_REQUEST,R(i,e,++n),R(i,11,n+=4),i.utf8Write("exit-status",n+=4,11),i[n+=11]=0,R(i,r,++n),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exit-status: ${r})`),Pe(this,this._packetRW.write.finalize(i))}exitSignal(e,r,n,i){if(!this._server)throw new Error("Server-only method called in client mode");let o=r;if(typeof o!="string"||!o)throw new Error(`Invalid signal: ${o}`);let s=r.toUpperCase();if(s.slice(0,3)==="SIG"&&(s=s.slice(3)),xm[s]!==1)throw new Error(`Invalid signal: ${o}`);let a=Buffer.byteLength(s),u=i?Buffer.byteLength(i):0,l=this._packetRW.write.allocStart,d=this._packetRW.write.alloc(25+a+1+4+u+4);d[l]=we.CHANNEL_REQUEST,R(d,e,++l),R(d,11,l+=4),d.utf8Write("exit-signal",l+=4,11),d[l+=11]=0,R(d,a,++l),d.utf8Write(s,l+=4,a),d[l+=a]=n?1:0,R(d,u,++l),l+=4,u&&(d.utf8Write(i,l,u),l+=u),R(d,0,l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${e}, exit-signal: ${r})`),Pe(this,this._packetRW.write.finalize(d))}authFailure(e,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let n;if(typeof e=="boolean"&&(r=e,e=void 0),e){n=[];for(let a=0;a<e.length;++a)e[a].toLowerCase()!=="none"&&n.push(e[a]);n=n.join(",")}else n="";let i=n.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+i+1);s[o]=we.USERAUTH_FAILURE,R(s,i,++o),s.utf8Write(n,o+=4,i),s[o+=i]=r===!0?1:0,this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_FAILURE"),Pe(this,this._packetRW.write.finalize(s))}authSuccess(){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let e=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[e]=we.USERAUTH_SUCCESS,this._authsQueue.shift(),this._authenticated=!0,this._debug&&this._debug("Outbound: Sending USERAUTH_SUCCESS"),Pe(this,this._packetRW.write.finalize(r)),this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.read=new Rm),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.write=new Nm(this))}authPKOK(e,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0||this._authsQueue[0]!=="publickey")throw new Error('"publickey" auth not in progress');let n=Buffer.byteLength(e),i=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+n+4+i);s[o]=we.USERAUTH_PK_OK,R(s,n,++o),s.utf8Write(e,o+=4,n),R(s,i,o+=n),s.set(r,o+=4),this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_PK_OK"),Pe(this,this._packetRW.write.finalize(s))}authPasswdChg(e){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(e),n=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5+r+4);i[n]=we.USERAUTH_PASSWD_CHANGEREQ,R(i,r,++n),i.utf8Write(e,n+=4,r),R(i,0,n+=r),this._debug&&this._debug("Outbound: Sending USERAUTH_PASSWD_CHANGEREQ"),Pe(this,this._packetRW.write.finalize(i))}authInfoReq(e,r,n){if(!this._server)throw new Error("Server-only method called in client mode");let i=0,o=e?Buffer.byteLength(e):0,s=r?Buffer.byteLength(r):0;for(let l=0;l<n.length;++l)i+=4+Buffer.byteLength(n[l].prompt)+1;let a=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+o+4+s+4+4+i);u[a]=we.USERAUTH_INFO_REQUEST,R(u,o,++a),a+=4,e&&(u.utf8Write(e,a,o),a+=o),R(u,s,a),a+=4,r&&(u.utf8Write(r,a,s),a+=s),R(u,0,a),R(u,n.length,a+=4),a+=4;for(let l=0;l<n.length;++l){let d=n[l],p=Buffer.byteLength(d.prompt);R(u,p,a),a+=4,p&&(u.utf8Write(d.prompt,a,p),a+=p),u[a++]=d.echo?1:0}this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_REQUEST"),Pe(this,this._packetRW.write.finalize(u))}},Pv=/^SSH-(2\.0|1\.99)-([^ ]+)(?: (.*))?$/;function Tv(t,e,r){let n,i;this._buffer?(n=Buffer.allocUnsafe(this._buffer.length+(r-e)),n.set(this._buffer,0),e===0?n.set(t,this._buffer.length):n.set(new Uint8Array(t.buffer,t.byteOffset+e,r-e),this._buffer.length),i=this._buffer.length,e=0):(n=t,i=0);let o=e,s=e,a=e,u=!1,l=0,d=0;for(;e<n.length;++e){let p=n[e];if(p===13){u=!0;continue}if(p===10){if(a>s&&a-s>4&&n[s]===83&&n[s+1]===83&&n[s+2]===72&&n[s+3]===45){let g=n.latin1Slice(o,a+1),h=s===o?g:g.slice(s-o),_=Pv.exec(h);if(!_)throw new Error("Invalid identification string");let b={greeting:s===o?"":g.slice(0,s-o),identRaw:h,versions:{protocol:_[1],software:_[2]},comments:_[3]};return this._remoteIdentRaw=Buffer.from(h),this._debug&&this._debug(`Remote ident: ${Pm(h)}`),this._compatFlags=Rv(b),this._buffer=void 0,this._decipher=new fv(0,mv.bind(this,{firstPacket:!0})),this._parse=Cv,this._onHeader(b),this._destruct?(Cm(this),e+1-i):r}if(this._server)throw new Error("Greetings from clients not permitted");if(++d>Sv)throw new Error("Max greeting lines exceeded");u=!1,s=e+1,l=0}else{if(u)throw new Error("Invalid header: expected newline");if(++l>=vv)throw new Error("Header line too long")}a=e}return this._buffer||(this._buffer=km(n,o)),e-i}c(Tv,"parseHeader");function Cv(t,e,r){return this._decipher.decrypt(t,e,r)}c(Cv,"parsePacket");function kv(t){if(this._onPacket(),t.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}t=this._packetRW.read.read(t);let e=t[0];e===we.USERAUTH_SUCCESS&&!this._server&&!this._authenticated&&(this._authenticated=!0,this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.write=new Nm(this)),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.read=new Rm));let r=_v[e];if(r===void 0){this._debug&&this._debug(`Inbound: Unsupported message type: ${e}`);return}return r(this,t)}c(kv,"onPayload");function Rv(t){let e=t.versions.software,r=0;for(let n of dv)typeof n[0]=="string"?e===n[0]&&(r|=n[1]):n[0].test(e)&&(r|=n[1]);return r}c(Rv,"getCompatFlags");function Nv(t){let e=Object.keys(t),r=Buffer.allocUnsafe(5*e.length+1),n=0;for(let i=0;i<e.length;++i){let o=e[i];if(o==="TTY_OP_END")continue;let s=Hl[o];if(s===void 0)continue;let a=t[o];typeof a=="number"&&isFinite(a)&&(r[n++]=s,r[n++]=a>>>24,r[n++]=a>>>16,r[n++]=a>>>8,r[n++]=a)}return r[n++]=Hl.TTY_OP_END,n<r.length?km(r,0,n):r}c(Nv,"modesToBytes");function Ov(t){let e="ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss";pv&&(e=`ssh-ed25519,${e}`);let r=Buffer.byteLength(e),n=t._packetRW.write.allocStart,i=t._packetRW.write.alloc(28+r);i[n]=we.EXT_INFO,R(i,1,++n),R(i,15,n+=4),i.utf8Write("server-sig-algs",n+=4,15),R(i,r,n+=15),i.utf8Write(e,n+=4,r),t._debug&&t._debug("Outbound: Sending EXT_INFO"),Pe(t,t._packetRW.write.finalize(i))}c(Ov,"sendExtInfo");$m.exports=jl});var Mm=le(ds=>{"use strict";var Ga=require("assert"),{inspect:$v}=require("util");function Dm(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}c(Dm,"addNumericalSeparator");function Bm(t,e){if(Ga(typeof e=="string","`thing` has to be of type string"),Array.isArray(t)){let r=t.length;return Ga(r>0,"At least one expected value needs to be specified"),t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}return`of ${e} ${String(t)}`}c(Bm,"oneOf");ds.ERR_INTERNAL_ASSERTION=class Lm extends Error{static{c(this,"ERR_INTERNAL_ASSERTION")}constructor(e){super(),Error.captureStackTrace(this,Lm);let r=`This is caused by either a bug in ssh2 or incorrect usage of ssh2 internals.
8
+ -----END PRIVATE KEY-----`,t=Buffer.from("a"),r,i;try{r=Xn.sign(null,t,e),i=Xn.verify(null,t,e,r)}catch{}return Buffer.isBuffer(r)&&r.length===64&&i===!0}return!1})(),fS=typeof Xn.diffieHellman=="function"&&typeof Xn.generateKeyPairSync=="function"&&typeof Xn.createPublicKey=="function",Kd=["ecdh-sha2-nistp256","ecdh-sha2-nistp384","ecdh-sha2-nistp521","diffie-hellman-group-exchange-sha256","diffie-hellman-group14-sha256","diffie-hellman-group15-sha512","diffie-hellman-group16-sha512","diffie-hellman-group17-sha512","diffie-hellman-group18-sha512"];fS&&(Kd.unshift("curve25519-sha256"),Kd.unshift("curve25519-sha256@libssh.org"));var s4=Kd.concat(["diffie-hellman-group-exchange-sha1","diffie-hellman-group14-sha1","diffie-hellman-group1-sha1"]),tE=["ecdsa-sha2-nistp256","ecdsa-sha2-nistp384","ecdsa-sha2-nistp521","rsa-sha2-512","rsa-sha2-256","ssh-rsa"];lS&&tE.unshift("ssh-ed25519");var a4=tE.concat(["ssh-dss"]),dS=(()=>{let e=Xn.getCiphers();return t=>e.includes(i4[t].sslName)})(),wi=["aes128-gcm@openssh.com","aes256-gcm@openssh.com","aes128-ctr","aes192-ctr","aes256-ctr"];ks&&ks.flags&&!ks.flags.aes?uS?wi.unshift("chacha20-poly1305@openssh.com"):wi.push("chacha20-poly1305@openssh.com"):uS&&ks&&ks.arch==="x86"?wi.splice(4,0,"chacha20-poly1305@openssh.com"):wi.push("chacha20-poly1305@openssh.com");wi=wi.filter(dS);var c4=wi.concat(["aes256-cbc","aes192-cbc","aes128-cbc","blowfish-cbc","3des-cbc","aes128-gcm","aes256-gcm","arcfour256","arcfour128","cast128-cbc","arcfour"].filter(dS)),pS=(()=>{let e=Xn.getHashes();return t=>e.includes(o4[t].sslName)})(),hS=["hmac-sha2-256-etm@openssh.com","hmac-sha2-512-etm@openssh.com","hmac-sha1-etm@openssh.com","hmac-sha2-256","hmac-sha2-512","hmac-sha1"].filter(pS),u4=hS.concat(["hmac-md5","hmac-sha2-256-96","hmac-sha2-512-96","hmac-ripemd160","hmac-sha1-96","hmac-md5-96"].filter(pS)),gS=["none","zlib@openssh.com","zlib"],l4=gS.concat([]),Ts={BAD_DHGEX:1,OLD_EXIT:2,DYN_RPORT_BUG:4,BUG_DHGEX_LARGE:8,IMPLY_RSA_SHA2_SIGALGS:16};Gd.exports={MESSAGE:{DISCONNECT:1,IGNORE:2,UNIMPLEMENTED:3,DEBUG:4,SERVICE_REQUEST:5,SERVICE_ACCEPT:6,EXT_INFO:7,KEXINIT:20,NEWKEYS:21,KEXDH_INIT:30,KEXDH_REPLY:31,KEXDH_GEX_GROUP:31,KEXDH_GEX_INIT:32,KEXDH_GEX_REPLY:33,KEXDH_GEX_REQUEST:34,KEXECDH_INIT:30,KEXECDH_REPLY:31,USERAUTH_REQUEST:50,USERAUTH_FAILURE:51,USERAUTH_SUCCESS:52,USERAUTH_BANNER:53,USERAUTH_PASSWD_CHANGEREQ:60,USERAUTH_PK_OK:60,USERAUTH_INFO_REQUEST:60,USERAUTH_INFO_RESPONSE:61,GLOBAL_REQUEST:80,REQUEST_SUCCESS:81,REQUEST_FAILURE:82,CHANNEL_OPEN:90,CHANNEL_OPEN_CONFIRMATION:91,CHANNEL_OPEN_FAILURE:92,CHANNEL_WINDOW_ADJUST:93,CHANNEL_DATA:94,CHANNEL_EXTENDED_DATA:95,CHANNEL_EOF:96,CHANNEL_CLOSE:97,CHANNEL_REQUEST:98,CHANNEL_SUCCESS:99,CHANNEL_FAILURE:100},DISCONNECT_REASON:{HOST_NOT_ALLOWED_TO_CONNECT:1,PROTOCOL_ERROR:2,KEY_EXCHANGE_FAILED:3,RESERVED:4,MAC_ERROR:5,COMPRESSION_ERROR:6,SERVICE_NOT_AVAILABLE:7,PROTOCOL_VERSION_NOT_SUPPORTED:8,HOST_KEY_NOT_VERIFIABLE:9,CONNECTION_LOST:10,BY_APPLICATION:11,TOO_MANY_CONNECTIONS:12,AUTH_CANCELED_BY_USER:13,NO_MORE_AUTH_METHODS_AVAILABLE:14,ILLEGAL_USER_NAME:15},DISCONNECT_REASON_STR:void 0,CHANNEL_OPEN_FAILURE:{ADMINISTRATIVELY_PROHIBITED:1,CONNECT_FAILED:2,UNKNOWN_CHANNEL_TYPE:3,RESOURCE_SHORTAGE:4},TERMINAL_MODE:{TTY_OP_END:0,VINTR:1,VQUIT:2,VERASE:3,VKILL:4,VEOF:5,VEOL:6,VEOL2:7,VSTART:8,VSTOP:9,VSUSP:10,VDSUSP:11,VREPRINT:12,VWERASE:13,VLNEXT:14,VFLUSH:15,VSWTCH:16,VSTATUS:17,VDISCARD:18,IGNPAR:30,PARMRK:31,INPCK:32,ISTRIP:33,INLCR:34,IGNCR:35,ICRNL:36,IUCLC:37,IXON:38,IXANY:39,IXOFF:40,IMAXBEL:41,ISIG:50,ICANON:51,XCASE:52,ECHO:53,ECHOE:54,ECHOK:55,ECHONL:56,NOFLSH:57,TOSTOP:58,IEXTEN:59,ECHOCTL:60,ECHOKE:61,PENDIN:62,OPOST:70,OLCUC:71,ONLCR:72,OCRNL:73,ONOCR:74,ONLRET:75,CS7:90,CS8:91,PARENB:92,PARODD:93,TTY_OP_ISPEED:128,TTY_OP_OSPEED:129},CHANNEL_EXTENDED_DATATYPE:{STDERR:1},SIGNALS:["ABRT","ALRM","FPE","HUP","ILL","INT","QUIT","SEGV","TERM","USR1","USR2","KILL","PIPE"].reduce((e,t)=>({...e,[t]:1}),{}),COMPAT:Ts,COMPAT_CHECKS:[["Cisco-1.25",Ts.BAD_DHGEX],[/^Cisco-1[.]/,Ts.BUG_DHGEX_LARGE],[/^[0-9.]+$/,Ts.OLD_EXIT],[/^OpenSSH_5[.][0-9]+/,Ts.DYN_RPORT_BUG],[/^OpenSSH_7[.]4/,Ts.IMPLY_RSA_SHA2_SIGALGS]],DEFAULT_KEX:Kd,SUPPORTED_KEX:s4,DEFAULT_SERVER_HOST_KEY:tE,SUPPORTED_SERVER_HOST_KEY:a4,DEFAULT_CIPHER:wi,SUPPORTED_CIPHER:c4,DEFAULT_MAC:hS,SUPPORTED_MAC:u4,DEFAULT_COMPRESSION:gS,SUPPORTED_COMPRESSION:l4,curve25519Supported:fS,eddsaSupported:lS};Gd.exports.DISCONNECT_REASON_BY_VALUE=Array.from(Object.entries(Gd.exports.DISCONNECT_REASON)).reduce((e,[t,r])=>({...e,[r]:t}),{})});var In=me((OQ,ES)=>{"use strict";var hn=cu().Ber,Yd,yS=Buffer[Symbol.species],f4=Object.getPrototypeOf(Uint8Array.prototype).fill;function mS(e,t){return e[t++]*16777216+e[t++]*65536+e[t++]*256+e[t]}a(mS,"readUInt32BE");function uu(e,t,r,i,n){n||(n=0),i>e.length&&(i=e.length);let o=i-r,s=t.length-n;return o>s&&(o=s),t.set(new Uint8Array(e.buffer,e.byteOffset+r,o),n),o}a(uu,"bufferCopy");function lu(e,t,r){return r===void 0&&(r=e.length),new yS(e.buffer,e.byteOffset+t,r-t)}a(lu,"bufferSlice");function nE(){let e=0,t,r={init:a((i,n)=>{t=i,e=typeof n=="number"?n:0},"init"),pos:a(()=>e,"pos"),length:a(()=>t?t.length:0,"length"),avail:a(()=>t&&e<t.length?t.length-e:0,"avail"),clear:a(()=>{t=void 0},"clear"),readUInt32BE:a(()=>{if(!(!t||e+3>=t.length))return t[e++]*16777216+t[e++]*65536+t[e++]*256+t[e++]},"readUInt32BE"),readUInt64BE:a(i=>{if(!(!t||e+7>=t.length))switch(i){case"always":return BigInt(`0x${t.hexSlice(e,e+=8)}`);case"maybe":if(t[e]>31)return BigInt(`0x${t.hexSlice(e,e+=8)}`);default:return t[e++]*72057594037927940+t[e++]*281474976710656+t[e++]*1099511627776+t[e++]*4294967296+t[e++]*16777216+t[e++]*65536+t[e++]*256+t[e++]}},"readUInt64BE"),skip:a(i=>{t&&i>0&&(e+=i)},"skip"),skipString:a(()=>{let i=r.readUInt32BE();if(i!==void 0)return e+=i,e<=t.length?i:void 0},"skipString"),readByte:a(()=>{if(t&&e<t.length)return t[e++]},"readByte"),readBool:a(()=>{if(t&&e<t.length)return!!t[e++]},"readBool"),readList:a(()=>{let i=r.readString(!0);if(i!==void 0)return i?i.split(","):[]},"readList"),readString:a((i,n)=>{typeof i=="number"&&(n=i,i=void 0);let o=r.readUInt32BE();if(o!==void 0&&!(t.length-e<o||typeof n=="number"&&o>n))return i?Buffer.isBuffer(i)?uu(t,i,e,e+=o):t.utf8Slice(e,e+=o):lu(t,e,e+=o)},"readString"),readRaw:a(i=>{if(t){if(typeof i!="number")return lu(t,e,e+=t.length-e);if(t.length-e>=i)return lu(t,e,e+=i)}},"readRaw")};return r}a(nE,"makeBufferParser");function _S(e,t,r){let i=new Error(e);return typeof t=="boolean"?(r=t,i.level="protocol"):i.level=t||"protocol",i.fatal=!!r,i}a(_S,"makeError");function rE(e,t,r){return e[r++]=t>>>24,e[r++]=t>>>16,e[r++]=t>>>8,e[r++]=t,r}a(rE,"writeUInt32BE");var Xd=nE();ES.exports={bufferCopy:uu,bufferSlice:lu,FastBuffer:yS,bufferFill:a((e,t,r,i)=>f4.call(e,t,r,i),"bufferFill"),makeError:_S,doFatalError:a((e,t,r,i)=>{let n;return Yd===void 0&&({DISCONNECT_REASON:Yd}=Jn()),t instanceof Error?(n=t,typeof r!="number"?i=Yd.PROTOCOL_ERROR:i=r):n=_S(t,r,!0),typeof i!="number"&&(i=Yd.PROTOCOL_ERROR),e.disconnect(i),e._destruct(),e._onError(n),1/0},"doFatalError"),readUInt32BE:mS,writeUInt32BE:rE,writeUInt32LE:a((e,t,r)=>(e[r++]=t,e[r++]=t>>>8,e[r++]=t>>>16,e[r++]=t>>>24,r),"writeUInt32LE"),makeBufferParser:nE,bufferParser:nE(),readString:a((e,t,r,i)=>{typeof r=="number"&&(i=r,r=void 0),t===void 0&&(t=0);let n=e.length-t;if(t<0||t>=e.length||n<4)return;let o=mS(e,t);if(n<4+o||typeof i=="number"&&o>i)return;t+=4;let s=t+o;return e._pos=s,r?Buffer.isBuffer(r)?uu(e,r,t,s):e.utf8Slice(t,s):lu(e,t,s)},"readString"),sigSSHToASN1:a((e,t)=>{switch(t){case"ssh-dss":{if(e.length>40)return e;let r=new hn.Writer;r.startSequence();let i=e.slice(0,20),n=e.slice(20);if(i[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,i.copy(o,1),i=o}else i[0]===0&&!(i[1]&128)&&(i=i.slice(1));if(n[0]&128){let o=Buffer.allocUnsafe(21);o[0]=0,n.copy(o,1),n=o}else n[0]===0&&!(n[1]&128)&&(n=n.slice(1));return r.writeBuffer(i,hn.Integer),r.writeBuffer(n,hn.Integer),r.endSequence(),r.buffer}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{Xd.init(e,0);let r=Xd.readString(),i=Xd.readString();if(Xd.clear(),r===void 0||i===void 0)return;let n=new hn.Writer;return n.startSequence(),n.writeBuffer(r,hn.Integer),n.writeBuffer(i,hn.Integer),n.endSequence(),n.buffer}default:return e}},"sigSSHToASN1"),convertSignature:a((e,t)=>{switch(t){case"ssh-dss":{if(e.length<=40)return e;let r=new hn.Reader(e);r.readSequence();let i=r.readString(hn.Integer,!0),n=r.readString(hn.Integer,!0),o=0,s=0;if(i.length<20){let u=Buffer.allocUnsafe(20);u.set(i,1),i=u,i[0]=0}if(n.length<20){let u=Buffer.allocUnsafe(20);u.set(n,1),n=u,n[0]=0}i.length>20&&i[0]===0&&(o=1),n.length>20&&n[0]===0&&(s=1);let c=Buffer.allocUnsafe(i.length-o+(n.length-s));return uu(i,c,o,i.length,0),uu(n,c,s,n.length,i.length-o),c}case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":{if(e[0]===0)return e;let r=new hn.Reader(e);r.readSequence();let i=r.readString(hn.Integer,!0),n=r.readString(hn.Integer,!0);if(i===null||n===null)return;let o=Buffer.allocUnsafe(4+i.length+4+n.length);return rE(o,i.length,0),o.set(i,4),rE(o,n.length,4+i.length),o.set(n,8+i.length),o}}return e},"convertSignature"),sendPacket:a((e,t,r)=>!r&&e._kexinit!==void 0?(e._queue===void 0&&(e._queue=[]),e._queue.push(t),e._debug&&e._debug("Outbound: ... packet queued"),!1):(e._cipher.encrypt(t),!0),"sendPacket")}});var AS=me((Jd,oE)=>{var iE=(function(){var e=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(e=e||__filename),(function(t){t=t||{};var r;r||(r=typeof t<"u"?t:{});var i,n;r.ready=new Promise(function(ie,Ee){i=ie,n=Ee});var o={},s;for(s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);var c=typeof window=="object",u=typeof importScripts=="function",l=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",f="",p,g,h,_,y;l?(f=u?require("path").dirname(f)+"/":__dirname+"/",p=a(function(ie,Ee){var Re=Hr(ie);return Re?Ee?Re:Re.toString():(_||(_=require("fs")),y||(y=require("path")),ie=y.normalize(ie),_.readFileSync(ie,Ee?null:"utf8"))},"C"),h=a(function(ie){return ie=p(ie,!0),ie.buffer||(ie=new Uint8Array(ie)),J(ie.buffer),ie},"E"),g=a(function(ie,Ee,Re){var je=Hr(ie);je&&Ee(je),_||(_=require("fs")),y||(y=require("path")),ie=y.normalize(ie),_.readFile(ie,function(gt,lr){gt?Re(gt):Ee(lr.buffer)})},"D"),1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),r.inspect=function(){return"[Emscripten Module object]"}):(c||u)&&(u?f=self.location.href:typeof document<"u"&&document.currentScript&&(f=document.currentScript.src),e&&(f=e),f.indexOf("blob:")!==0?f=f.substr(0,f.lastIndexOf("/")+1):f="",p=a(function(ie){try{var Ee=new XMLHttpRequest;return Ee.open("GET",ie,!1),Ee.send(null),Ee.responseText}catch(gt){if(ie=Hr(ie)){Ee=[];for(var Re=0;Re<ie.length;Re++){var je=ie[Re];255<je&&($r&&J(!1,"Character code "+je+" ("+String.fromCharCode(je)+") at offset "+Re+" not in 0x00-0xFF."),je&=255),Ee.push(String.fromCharCode(je))}return Ee.join("")}throw gt}},"C"),u&&(h=a(function(ie){try{var Ee=new XMLHttpRequest;return Ee.open("GET",ie,!1),Ee.responseType="arraybuffer",Ee.send(null),new Uint8Array(Ee.response)}catch(Re){if(ie=Hr(ie))return ie;throw Re}},"E")),g=a(function(ie,Ee,Re){var je=new XMLHttpRequest;je.open("GET",ie,!0),je.responseType="arraybuffer",je.onload=function(){if(je.status==200||je.status==0&&je.response)Ee(je.response);else{var gt=Hr(ie);gt?Ee(gt.buffer):Re()}},je.onerror=Re,je.send(null)},"D")),r.print||console.log.bind(console);var b=r.printErr||console.warn.bind(console);for(s in o)o.hasOwnProperty(s)&&(r[s]=o[s]);o=null;var v;r.wasmBinary&&(v=r.wasmBinary);var S=r.noExitRuntime||!0;typeof WebAssembly!="object"&&re("no native wasm support detected");var M,R=!1;function J(ie,Ee){ie||re("Assertion failed: "+Ee)}a(J,"assert");function te(ie){var Ee=r["_"+ie];return J(Ee,"Cannot call unknown function "+ie+", make sure it is exported"),Ee}a(te,"N");function ee(ie,Ee,Re,je){var gt={string:a(function(kt){var _r=0;if(kt!=null&&kt!==0){var hr=(kt.length<<2)+1;_r=Ys(hr);var Jt=_r,zt=U;if(0<hr){hr=Jt+hr-1;for(var an=0;an<kt.length;++an){var er=kt.charCodeAt(an);if(55296<=er&&57343>=er){var Hi=kt.charCodeAt(++an);er=65536+((er&1023)<<10)|Hi&1023}if(127>=er){if(Jt>=hr)break;zt[Jt++]=er}else{if(2047>=er){if(Jt+1>=hr)break;zt[Jt++]=192|er>>6}else{if(65535>=er){if(Jt+2>=hr)break;zt[Jt++]=224|er>>12}else{if(Jt+3>=hr)break;zt[Jt++]=240|er>>18,zt[Jt++]=128|er>>12&63}zt[Jt++]=128|er>>6&63}zt[Jt++]=128|er&63}}zt[Jt]=0}}return _r},"string"),array:a(function(kt){var _r=Ys(kt.length);return H.set(kt,_r),_r},"array")},lr=te(ie),Tn=[];if(ie=0,je)for(var Yr=0;Yr<je.length;Yr++){var Do=gt[Re[Yr]];Do?(ie===0&&(ie=Gs()),Tn[Yr]=Do(je[Yr])):Tn[Yr]=je[Yr]}return Re=lr.apply(null,Tn),Re=(function(kt){if(Ee==="string")if(kt){for(var _r=U,hr=kt+NaN,Jt=kt;_r[Jt]&&!(Jt>=hr);)++Jt;if(16<Jt-kt&&_r.subarray&&P)kt=P.decode(_r.subarray(kt,Jt));else{for(hr="";kt<Jt;){var zt=_r[kt++];if(zt&128){var an=_r[kt++]&63;if((zt&224)==192)hr+=String.fromCharCode((zt&31)<<6|an);else{var er=_r[kt++]&63;zt=(zt&240)==224?(zt&15)<<12|an<<6|er:(zt&7)<<18|an<<12|er<<6|_r[kt++]&63,65536>zt?hr+=String.fromCharCode(zt):(zt-=65536,hr+=String.fromCharCode(55296|zt>>10,56320|zt&1023))}}else hr+=String.fromCharCode(zt)}kt=hr}}else kt="";else kt=Ee==="boolean"?!!kt:kt;return kt})(Re),ie!==0&&Gu(ie),Re}a(ee,"ca");var P=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,C,H,U;function k(){var ie=M.buffer;C=ie,r.HEAP8=H=new Int8Array(ie),r.HEAP16=new Int16Array(ie),r.HEAP32=new Int32Array(ie),r.HEAPU8=U=new Uint8Array(ie),r.HEAPU16=new Uint16Array(ie),r.HEAPU32=new Uint32Array(ie),r.HEAPF32=new Float32Array(ie),r.HEAPF64=new Float64Array(ie)}a(k,"ia");var j,W=[],z=[],X=[];function ne(){var ie=r.preRun.shift();W.unshift(ie)}a(ne,"ma");var O=0,q=null,V=null;r.preloadedImages={},r.preloadedAudios={};function re(ie){throw r.onAbort&&r.onAbort(ie),b(ie),R=!0,ie=new WebAssembly.RuntimeError("abort("+ie+"). Build with -s ASSERTIONS=1 for more info."),n(ie),ie}a(re,"K");var _e="data:application/octet-stream;base64,",ve;if(ve="data:application/octet-stream;base64,AGFzbQEAAAABIAZgAX8Bf2ADf39/AGABfwBgAABgAAF/YAZ/f39/f38AAgcBAWEBYQAAAwsKAAEDAQAAAgQFAgQFAXABAQEFBwEBgAKAgAIGCQF/AUGAjMACCwclCQFiAgABYwADAWQACQFlAAgBZgAHAWcABgFoAAUBaQAKAWoBAAqGTQpPAQJ/QYAIKAIAIgEgAEEDakF8cSICaiEAAkAgAkEAIAAgAU0bDQAgAD8AQRB0SwRAIAAQAEUNAQtBgAggADYCACABDwtBhAhBMDYCAEF/C4wFAg5+Cn8gACgCJCEUIAAoAiAhFSAAKAIcIREgACgCGCESIAAoAhQhEyACQRBPBEAgAC0ATEVBGHQhFyAAKAIEIhZBBWytIQ8gACgCCCIYQQVsrSENIAAoAgwiGUEFbK0hCyAAKAIQIhpBBWytIQkgADUCACEIIBqtIRAgGa0hDiAYrSEMIBatIQoDQCASIAEtAAMiEiABLQAEQQh0ciABLQAFQRB0ciABLQAGIhZBGHRyQQJ2Qf///x9xaq0iAyAOfiABLwAAIAEtAAJBEHRyIBNqIBJBGHRBgICAGHFqrSIEIBB+fCARIAEtAAdBCHQgFnIgAS0ACEEQdHIgAS0ACSIRQRh0ckEEdkH///8fcWqtIgUgDH58IAEtAApBCHQgEXIgAS0AC0EQdHIgAS0ADEEYdHJBBnYgFWqtIgYgCn58IBQgF2ogAS8ADSABLQAPQRB0cmqtIgcgCH58IAMgDH4gBCAOfnwgBSAKfnwgBiAIfnwgByAJfnwgAyAKfiAEIAx+fCAFIAh+fCAGIAl+fCAHIAt+fCADIAh+IAQgCn58IAUgCX58IAYgC358IAcgDX58IAMgCX4gBCAIfnwgBSALfnwgBiANfnwgByAPfnwiA0IaiEL/////D4N8IgRCGohC/////w+DfCIFQhqIQv////8Pg3wiBkIaiEL/////D4N8IgdCGoinQQVsIAOnQf///x9xaiITQRp2IASnQf///x9xaiESIAWnQf///x9xIREgBqdB////H3EhFSAHp0H///8fcSEUIBNB////H3EhEyABQRBqIQEgAkEQayICQQ9LDQALCyAAIBQ2AiQgACAVNgIgIAAgETYCHCAAIBI2AhggACATNgIUCwMAAQu2BAEGfwJAIAAoAjgiBARAIABBPGohBQJAIAJBECAEayIDIAIgA0kbIgZFDQAgBkEDcSEHAkAgBkEBa0EDSQRAQQAhAwwBCyAGQXxxIQhBACEDA0AgBSADIARqaiABIANqLQAAOgAAIAUgA0EBciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0ECciIEIAAoAjhqaiABIARqLQAAOgAAIAUgA0EDciIEIAAoAjhqaiABIARqLQAAOgAAIANBBGohAyAAKAI4IQQgCEEEayIIDQALCyAHRQ0AA0AgBSADIARqaiABIANqLQAAOgAAIANBAWohAyAAKAI4IQQgB0EBayIHDQALCyAAIAQgBmoiAzYCOCADQRBJDQEgACAFQRAQAiAAQQA2AjggAiAGayECIAEgBmohAQsgAkEQTwRAIAAgASACQXBxIgMQAiACQQ9xIQIgASADaiEBCyACRQ0AIAJBA3EhBCAAQTxqIQVBACEDIAJBAWtBA08EQCACQXxxIQcDQCAFIAAoAjggA2pqIAEgA2otAAA6AAAgBSADQQFyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQJyIgYgACgCOGpqIAEgBmotAAA6AAAgBSADQQNyIgYgACgCOGpqIAEgBmotAAA6AAAgA0EEaiEDIAdBBGsiBw0ACwsgBARAA0AgBSAAKAI4IANqaiABIANqLQAAOgAAIANBAWohAyAEQQFrIgQNAAsLIAAgACgCOCACajYCOAsLoS0BDH8jAEEQayIMJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEH0AU0EQEGICCgCACIFQRAgAEELakF4cSAAQQtJGyIIQQN2IgJ2IgFBA3EEQCABQX9zQQFxIAJqIgNBA3QiAUG4CGooAgAiBEEIaiEAAkAgBCgCCCICIAFBsAhqIgFGBEBBiAggBUF+IAN3cTYCAAwBCyACIAE2AgwgASACNgIICyAEIANBA3QiAUEDcjYCBCABIARqIgEgASgCBEEBcjYCBAwNCyAIQZAIKAIAIgpNDQEgAQRAAkBBAiACdCIAQQAgAGtyIAEgAnRxIgBBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2aiIDQQN0IgBBuAhqKAIAIgQoAggiASAAQbAIaiIARgRAQYgIIAVBfiADd3EiBTYCAAwBCyABIAA2AgwgACABNgIICyAEQQhqIQAgBCAIQQNyNgIEIAQgCGoiAiADQQN0IgEgCGsiA0EBcjYCBCABIARqIAM2AgAgCgRAIApBA3YiAUEDdEGwCGohB0GcCCgCACEEAn8gBUEBIAF0IgFxRQRAQYgIIAEgBXI2AgAgBwwBCyAHKAIICyEBIAcgBDYCCCABIAQ2AgwgBCAHNgIMIAQgATYCCAtBnAggAjYCAEGQCCADNgIADA0LQYwIKAIAIgZFDQEgBkEAIAZrcUEBayIAIABBDHZBEHEiAnYiAUEFdkEIcSIAIAJyIAEgAHYiAUECdkEEcSIAciABIAB2IgFBAXZBAnEiAHIgASAAdiIBQQF2QQFxIgByIAEgAHZqQQJ0QbgKaigCACIBKAIEQXhxIAhrIQMgASECA0ACQCACKAIQIgBFBEAgAigCFCIARQ0BCyAAKAIEQXhxIAhrIgIgAyACIANJIgIbIQMgACABIAIbIQEgACECDAELCyABIAhqIgkgAU0NAiABKAIYIQsgASABKAIMIgRHBEAgASgCCCIAQZgIKAIASRogACAENgIMIAQgADYCCAwMCyABQRRqIgIoAgAiAEUEQCABKAIQIgBFDQQgAUEQaiECCwNAIAIhByAAIgRBFGoiAigCACIADQAgBEEQaiECIAQoAhAiAA0ACyAHQQA2AgAMCwtBfyEIIABBv39LDQAgAEELaiIAQXhxIQhBjAgoAgAiCUUNAEEAIAhrIQMCQAJAAkACf0EAIAhBgAJJDQAaQR8gCEH///8HSw0AGiAAQQh2IgAgAEGA/j9qQRB2QQhxIgJ0IgAgAEGA4B9qQRB2QQRxIgF0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAEgAnIgAHJrIgBBAXQgCCAAQRVqdkEBcXJBHGoLIgVBAnRBuApqKAIAIgJFBEBBACEADAELQQAhACAIQQBBGSAFQQF2ayAFQR9GG3QhAQNAAkAgAigCBEF4cSAIayIHIANPDQAgAiEEIAciAw0AQQAhAyACIQAMAwsgACACKAIUIgcgByACIAFBHXZBBHFqKAIQIgJGGyAAIAcbIQAgAUEBdCEBIAINAAsLIAAgBHJFBEBBACEEQQIgBXQiAEEAIABrciAJcSIARQ0DIABBACAAa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2akECdEG4CmooAgAhAAsgAEUNAQsDQCAAKAIEQXhxIAhrIgEgA0khAiABIAMgAhshAyAAIAQgAhshBCAAKAIQIgEEfyABBSAAKAIUCyIADQALCyAERQ0AIANBkAgoAgAgCGtPDQAgBCAIaiIGIARNDQEgBCgCGCEFIAQgBCgCDCIBRwRAIAQoAggiAEGYCCgCAEkaIAAgATYCDCABIAA2AggMCgsgBEEUaiICKAIAIgBFBEAgBCgCECIARQ0EIARBEGohAgsDQCACIQcgACIBQRRqIgIoAgAiAA0AIAFBEGohAiABKAIQIgANAAsgB0EANgIADAkLIAhBkAgoAgAiAk0EQEGcCCgCACEDAkAgAiAIayIBQRBPBEBBkAggATYCAEGcCCADIAhqIgA2AgAgACABQQFyNgIEIAIgA2ogATYCACADIAhBA3I2AgQMAQtBnAhBADYCAEGQCEEANgIAIAMgAkEDcjYCBCACIANqIgAgACgCBEEBcjYCBAsgA0EIaiEADAsLIAhBlAgoAgAiBkkEQEGUCCAGIAhrIgE2AgBBoAhBoAgoAgAiAiAIaiIANgIAIAAgAUEBcjYCBCACIAhBA3I2AgQgAkEIaiEADAsLQQAhACAIQS9qIgkCf0HgCygCAARAQegLKAIADAELQewLQn83AgBB5AtCgKCAgICABDcCAEHgCyAMQQxqQXBxQdiq1aoFczYCAEH0C0EANgIAQcQLQQA2AgBBgCALIgFqIgVBACABayIHcSICIAhNDQpBwAsoAgAiBARAQbgLKAIAIgMgAmoiASADTQ0LIAEgBEsNCwtBxAstAABBBHENBQJAAkBBoAgoAgAiAwRAQcgLIQADQCADIAAoAgAiAU8EQCABIAAoAgRqIANLDQMLIAAoAggiAA0ACwtBABABIgFBf0YNBiACIQVB5AsoAgAiA0EBayIAIAFxBEAgAiABayAAIAFqQQAgA2txaiEFCyAFIAhNDQYgBUH+////B0sNBkHACygCACIEBEBBuAsoAgAiAyAFaiIAIANNDQcgACAESw0HCyAFEAEiACABRw0BDAgLIAUgBmsgB3EiBUH+////B0sNBSAFEAEiASAAKAIAIAAoAgRqRg0EIAEhAAsCQCAAQX9GDQAgCEEwaiAFTQ0AQegLKAIAIgEgCSAFa2pBACABa3EiAUH+////B0sEQCAAIQEMCAsgARABQX9HBEAgASAFaiEFIAAhAQwIC0EAIAVrEAEaDAULIAAiAUF/Rw0GDAQLAAtBACEEDAcLQQAhAQwFCyABQX9HDQILQcQLQcQLKAIAQQRyNgIACyACQf7///8HSw0BIAIQASEBQQAQASEAIAFBf0YNASAAQX9GDQEgACABTQ0BIAAgAWsiBSAIQShqTQ0BC0G4C0G4CygCACAFaiIANgIAQbwLKAIAIABJBEBBvAsgADYCAAsCQAJAAkBBoAgoAgAiBwRAQcgLIQADQCABIAAoAgAiAyAAKAIEIgJqRg0CIAAoAggiAA0ACwwCC0GYCCgCACIAQQAgACABTRtFBEBBmAggATYCAAtBACEAQcwLIAU2AgBByAsgATYCAEGoCEF/NgIAQawIQeALKAIANgIAQdQLQQA2AgADQCAAQQN0IgNBuAhqIANBsAhqIgI2AgAgA0G8CGogAjYCACAAQQFqIgBBIEcNAAtBlAggBUEoayIDQXggAWtBB3FBACABQQhqQQdxGyIAayICNgIAQaAIIAAgAWoiADYCACAAIAJBAXI2AgQgASADakEoNgIEQaQIQfALKAIANgIADAILIAAtAAxBCHENACADIAdLDQAgASAHTQ0AIAAgAiAFajYCBEGgCCAHQXggB2tBB3FBACAHQQhqQQdxGyIAaiICNgIAQZQIQZQIKAIAIAVqIgEgAGsiADYCACACIABBAXI2AgQgASAHakEoNgIEQaQIQfALKAIANgIADAELQZgIKAIAIAFLBEBBmAggATYCAAsgASAFaiECQcgLIQACQAJAAkACQAJAAkADQCACIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQELQcgLIQADQCAHIAAoAgAiAk8EQCACIAAoAgRqIgQgB0sNAwsgACgCCCEADAALAAsgACABNgIAIAAgACgCBCAFajYCBCABQXggAWtBB3FBACABQQhqQQdxG2oiCSAIQQNyNgIEIAJBeCACa0EHcUEAIAJBCGpBB3EbaiIFIAggCWoiBmshAiAFIAdGBEBBoAggBjYCAEGUCEGUCCgCACACaiIANgIAIAYgAEEBcjYCBAwDCyAFQZwIKAIARgRAQZwIIAY2AgBBkAhBkAgoAgAgAmoiADYCACAGIABBAXI2AgQgACAGaiAANgIADAMLIAUoAgQiAEEDcUEBRgRAIABBeHEhBwJAIABB/wFNBEAgBSgCCCIDIABBA3YiAEEDdEGwCGpGGiADIAUoAgwiAUYEQEGICEGICCgCAEF+IAB3cTYCAAwCCyADIAE2AgwgASADNgIIDAELIAUoAhghCAJAIAUgBSgCDCIBRwRAIAUoAggiACABNgIMIAEgADYCCAwBCwJAIAVBFGoiACgCACIDDQAgBUEQaiIAKAIAIgMNAEEAIQEMAQsDQCAAIQQgAyIBQRRqIgAoAgAiAw0AIAFBEGohACABKAIQIgMNAAsgBEEANgIACyAIRQ0AAkAgBSAFKAIcIgNBAnRBuApqIgAoAgBGBEAgACABNgIAIAENAUGMCEGMCCgCAEF+IAN3cTYCAAwCCyAIQRBBFCAIKAIQIAVGG2ogATYCACABRQ0BCyABIAg2AhggBSgCECIABEAgASAANgIQIAAgATYCGAsgBSgCFCIARQ0AIAEgADYCFCAAIAE2AhgLIAUgB2ohBSACIAdqIQILIAUgBSgCBEF+cTYCBCAGIAJBAXI2AgQgAiAGaiACNgIAIAJB/wFNBEAgAkEDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwDC0EfIQAgAkH///8HTQRAIAJBCHYiACAAQYD+P2pBEHZBCHEiA3QiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASADciAAcmsiAEEBdCACIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQQCQEGMCCgCACIDQQEgAHQiAXFFBEBBjAggASADcjYCACAEIAY2AgAgBiAENgIYDAELIAJBAEEZIABBAXZrIABBH0YbdCEAIAQoAgAhAQNAIAEiAygCBEF4cSACRg0DIABBHXYhASAAQQF0IQAgAyABQQRxaiIEKAIQIgENAAsgBCAGNgIQIAYgAzYCGAsgBiAGNgIMIAYgBjYCCAwCC0GUCCAFQShrIgNBeCABa0EHcUEAIAFBCGpBB3EbIgBrIgI2AgBBoAggACABaiIANgIAIAAgAkEBcjYCBCABIANqQSg2AgRBpAhB8AsoAgA2AgAgByAEQScgBGtBB3FBACAEQSdrQQdxG2pBL2siACAAIAdBEGpJGyICQRs2AgQgAkHQCykCADcCECACQcgLKQIANwIIQdALIAJBCGo2AgBBzAsgBTYCAEHICyABNgIAQdQLQQA2AgAgAkEYaiEAA0AgAEEHNgIEIABBCGohASAAQQRqIQAgASAESQ0ACyACIAdGDQMgAiACKAIEQX5xNgIEIAcgAiAHayIEQQFyNgIEIAIgBDYCACAEQf8BTQRAIARBA3YiAEEDdEGwCGohAgJ/QYgIKAIAIgFBASAAdCIAcUUEQEGICCAAIAFyNgIAIAIMAQsgAigCCAshACACIAc2AgggACAHNgIMIAcgAjYCDCAHIAA2AggMBAtBHyEAIAdCADcCECAEQf///wdNBEAgBEEIdiIAIABBgP4/akEQdkEIcSICdCIAIABBgOAfakEQdkEEcSIBdCIAIABBgIAPakEQdkECcSIAdEEPdiABIAJyIAByayIAQQF0IAQgAEEVanZBAXFyQRxqIQALIAcgADYCHCAAQQJ0QbgKaiEDAkBBjAgoAgAiAkEBIAB0IgFxRQRAQYwIIAEgAnI2AgAgAyAHNgIAIAcgAzYCGAwBCyAEQQBBGSAAQQF2ayAAQR9GG3QhACADKAIAIQEDQCABIgIoAgRBeHEgBEYNBCAAQR12IQEgAEEBdCEAIAIgAUEEcWoiAygCECIBDQALIAMgBzYCECAHIAI2AhgLIAcgBzYCDCAHIAc2AggMAwsgAygCCCIAIAY2AgwgAyAGNgIIIAZBADYCGCAGIAM2AgwgBiAANgIICyAJQQhqIQAMBQsgAigCCCIAIAc2AgwgAiAHNgIIIAdBADYCGCAHIAI2AgwgByAANgIIC0GUCCgCACIAIAhNDQBBlAggACAIayIBNgIAQaAIQaAIKAIAIgIgCGoiADYCACAAIAFBAXI2AgQgAiAIQQNyNgIEIAJBCGohAAwDC0GECEEwNgIAQQAhAAwCCwJAIAVFDQACQCAEKAIcIgJBAnRBuApqIgAoAgAgBEYEQCAAIAE2AgAgAQ0BQYwIIAlBfiACd3EiCTYCAAwCCyAFQRBBFCAFKAIQIARGG2ogATYCACABRQ0BCyABIAU2AhggBCgCECIABEAgASAANgIQIAAgATYCGAsgBCgCFCIARQ0AIAEgADYCFCAAIAE2AhgLAkAgA0EPTQRAIAQgAyAIaiIAQQNyNgIEIAAgBGoiACAAKAIEQQFyNgIEDAELIAQgCEEDcjYCBCAGIANBAXI2AgQgAyAGaiADNgIAIANB/wFNBEAgA0EDdiIAQQN0QbAIaiECAn9BiAgoAgAiAUEBIAB0IgBxRQRAQYgIIAAgAXI2AgAgAgwBCyACKAIICyEAIAIgBjYCCCAAIAY2AgwgBiACNgIMIAYgADYCCAwBC0EfIQAgA0H///8HTQRAIANBCHYiACAAQYD+P2pBEHZBCHEiAnQiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASACciAAcmsiAEEBdCADIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBuApqIQICQAJAIAlBASAAdCIBcUUEQEGMCCABIAlyNgIAIAIgBjYCACAGIAI2AhgMAQsgA0EAQRkgAEEBdmsgAEEfRht0IQAgAigCACEIA0AgCCIBKAIEQXhxIANGDQIgAEEddiECIABBAXQhACABIAJBBHFqIgIoAhAiCA0ACyACIAY2AhAgBiABNgIYCyAGIAY2AgwgBiAGNgIIDAELIAEoAggiACAGNgIMIAEgBjYCCCAGQQA2AhggBiABNgIMIAYgADYCCAsgBEEIaiEADAELAkAgC0UNAAJAIAEoAhwiAkECdEG4CmoiACgCACABRgRAIAAgBDYCACAEDQFBjAggBkF+IAJ3cTYCAAwCCyALQRBBFCALKAIQIAFGG2ogBDYCACAERQ0BCyAEIAs2AhggASgCECIABEAgBCAANgIQIAAgBDYCGAsgASgCFCIARQ0AIAQgADYCFCAAIAQ2AhgLAkAgA0EPTQRAIAEgAyAIaiIAQQNyNgIEIAAgAWoiACAAKAIEQQFyNgIEDAELIAEgCEEDcjYCBCAJIANBAXI2AgQgAyAJaiADNgIAIAoEQCAKQQN2IgBBA3RBsAhqIQRBnAgoAgAhAgJ/QQEgAHQiACAFcUUEQEGICCAAIAVyNgIAIAQMAQsgBCgCCAshACAEIAI2AgggACACNgIMIAIgBDYCDCACIAA2AggLQZwIIAk2AgBBkAggAzYCAAsgAUEIaiEACyAMQRBqJAAgAAsQACMAIABrQXBxIgAkACAACwYAIAAkAAsEACMAC4AJAgh/BH4jAEGQAWsiBiQAIAYgBS0AA0EYdEGAgIAYcSAFLwAAIAUtAAJBEHRycjYCACAGIAUoAANBAnZBg/7/H3E2AgQgBiAFKAAGQQR2Qf+B/x9xNgIIIAYgBSgACUEGdkH//8AfcTYCDCAFLwANIQggBS0ADyEJIAZCADcCFCAGQgA3AhwgBkEANgIkIAYgCCAJQRB0QYCAPHFyNgIQIAYgBSgAEDYCKCAGIAUoABQ2AiwgBiAFKAAYNgIwIAUoABwhBSAGQQA6AEwgBkEANgI4IAYgBTYCNCAGIAEgAhAEIAQEQCAGIAMgBBAECyAGKAI4IgEEQCAGQTxqIgIgAWpBAToAACABQQFqQQ9NBEAgASAGakE9aiEEAkBBDyABayIDRQ0AIAMgBGoiAUEBa0EAOgAAIARBADoAACADQQNJDQAgAUECa0EAOgAAIARBADoAASABQQNrQQA6AAAgBEEAOgACIANBB0kNACABQQRrQQA6AAAgBEEAOgADIANBCUkNACAEQQAgBGtBA3EiAWoiBEEANgIAIAQgAyABa0F8cSIBaiIDQQRrQQA2AgAgAUEJSQ0AIARBADYCCCAEQQA2AgQgA0EIa0EANgIAIANBDGtBADYCACABQRlJDQAgBEEANgIYIARBADYCFCAEQQA2AhAgBEEANgIMIANBEGtBADYCACADQRRrQQA2AgAgA0EYa0EANgIAIANBHGtBADYCACABIARBBHFBGHIiAWsiA0EgSQ0AIAEgBGohAQNAIAFCADcDGCABQgA3AxAgAUIANwMIIAFCADcDACABQSBqIQEgA0EgayIDQR9LDQALCwsgBkEBOgBMIAYgAkEQEAILIAY1AjQhECAGNQIwIREgBjUCLCEOIAAgBjUCKCAGKAIkIAYoAiAgBigCHCAGKAIYIgNBGnZqIgJBGnZqIgFBGnZqIgtBgICAYHIgAUH///8fcSINIAJB////H3EiCCAGKAIUIAtBGnZBBWxqIgFB////H3EiCUEFaiIFQRp2IANB////H3EgAUEadmoiA2oiAUEadmoiAkEadmoiBEEadmoiDEEfdSIHIANxIAEgDEEfdkEBayIDQf///x9xIgpxciIBQRp0IAUgCnEgByAJcXJyrXwiDzwAACAAIA9CGIg8AAMgACAPQhCIPAACIAAgD0IIiDwAASAAIA4gByAIcSACIApxciICQRR0IAFBBnZyrXwgD0IgiHwiDjwABCAAIA5CGIg8AAcgACAOQhCIPAAGIAAgDkIIiDwABSAAIBEgByANcSAEIApxciIBQQ50IAJBDHZyrXwgDkIgiHwiDjwACCAAIA5CGIg8AAsgACAOQhCIPAAKIAAgDkIIiDwACSAAIBAgAyAMcSAHIAtxckEIdCABQRJ2cq18IA5CIIh8Ig48AAwgACAOQhiIPAAPIAAgDkIQiDwADiAAIA5CCIg8AA0gBkIANwIwIAZCADcCKCAGQgA3AiAgBkIANwIYIAZCADcCECAGQgA3AgggBkIANwIAIAZBkAFqJAALpwwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAMgAygCACIBayIDQZgIKAIASQ0BIAAgAWohACADQZwIKAIARwRAIAFB/wFNBEAgAygCCCICIAFBA3YiBEEDdEGwCGpGGiACIAMoAgwiAUYEQEGICEGICCgCAEF+IAR3cTYCAAwDCyACIAE2AgwgASACNgIIDAILIAMoAhghBgJAIAMgAygCDCIBRwRAIAMoAggiAiABNgIMIAEgAjYCCAwBCwJAIANBFGoiAigCACIEDQAgA0EQaiICKAIAIgQNAEEAIQEMAQsDQCACIQcgBCIBQRRqIgIoAgAiBA0AIAFBEGohAiABKAIQIgQNAAsgB0EANgIACyAGRQ0BAkAgAyADKAIcIgJBAnRBuApqIgQoAgBGBEAgBCABNgIAIAENAUGMCEGMCCgCAEF+IAJ3cTYCAAwDCyAGQRBBFCAGKAIQIANGG2ogATYCACABRQ0CCyABIAY2AhggAygCECICBEAgASACNgIQIAIgATYCGAsgAygCFCICRQ0BIAEgAjYCFCACIAE2AhgMAQsgBSgCBCIBQQNxQQNHDQBBkAggADYCACAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAA8LIAMgBU8NACAFKAIEIgFBAXFFDQACQCABQQJxRQRAIAVBoAgoAgBGBEBBoAggAzYCAEGUCEGUCCgCACAAaiIANgIAIAMgAEEBcjYCBCADQZwIKAIARw0DQZAIQQA2AgBBnAhBADYCAA8LIAVBnAgoAgBGBEBBnAggAzYCAEGQCEGQCCgCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQACQCABQf8BTQRAIAUoAggiAiABQQN2IgRBA3RBsAhqRhogAiAFKAIMIgFGBEBBiAhBiAgoAgBBfiAEd3E2AgAMAgsgAiABNgIMIAEgAjYCCAwBCyAFKAIYIQYCQCAFIAUoAgwiAUcEQCAFKAIIIgJBmAgoAgBJGiACIAE2AgwgASACNgIIDAELAkAgBUEUaiICKAIAIgQNACAFQRBqIgIoAgAiBA0AQQAhAQwBCwNAIAIhByAEIgFBFGoiAigCACIEDQAgAUEQaiECIAEoAhAiBA0ACyAHQQA2AgALIAZFDQACQCAFIAUoAhwiAkECdEG4CmoiBCgCAEYEQCAEIAE2AgAgAQ0BQYwIQYwIKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiABNgIAIAFFDQELIAEgBjYCGCAFKAIQIgIEQCABIAI2AhAgAiABNgIYCyAFKAIUIgJFDQAgASACNgIUIAIgATYCGAsgAyAAQQFyNgIEIAAgA2ogADYCACADQZwIKAIARw0BQZAIIAA2AgAPCyAFIAFBfnE2AgQgAyAAQQFyNgIEIAAgA2ogADYCAAsgAEH/AU0EQCAAQQN2IgFBA3RBsAhqIQACf0GICCgCACICQQEgAXQiAXFFBEBBiAggASACcjYCACAADAELIAAoAggLIQIgACADNgIIIAIgAzYCDCADIAA2AgwgAyACNgIIDwtBHyECIANCADcCECAAQf///wdNBEAgAEEIdiIBIAFBgP4/akEQdkEIcSIBdCICIAJBgOAfakEQdkEEcSICdCIEIARBgIAPakEQdkECcSIEdEEPdiABIAJyIARyayIBQQF0IAAgAUEVanZBAXFyQRxqIQILIAMgAjYCHCACQQJ0QbgKaiEBAkACQAJAQYwIKAIAIgRBASACdCIHcUUEQEGMCCAEIAdyNgIAIAEgAzYCACADIAE2AhgMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgASgCACEBA0AgASIEKAIEQXhxIABGDQIgAkEddiEBIAJBAXQhAiAEIAFBBHFqIgdBEGooAgAiAQ0ACyAHIAM2AhAgAyAENgIYCyADIAM2AgwgAyADNgIIDAELIAQoAggiACADNgIMIAQgAzYCCCADQQA2AhggAyAENgIMIAMgADYCCAtBqAhBqAgoAgBBAWsiAEF/IAAbNgIACwsLCQEAQYEICwIGUA==",!ve.startsWith(_e)){var xe=ve;ve=r.locateFile?r.locateFile(xe,f):f+xe}function Tt(){var ie=ve;try{if(ie==ve&&v)return new Uint8Array(v);var Ee=Hr(ie);if(Ee)return Ee;if(h)return h(ie);throw"both async and sync fetching of the wasm failed"}catch(Re){re(Re)}}a(Tt,"pa");function Mt(){if(!v&&(c||u)){if(typeof fetch=="function"&&!ve.startsWith("file://"))return fetch(ve,{credentials:"same-origin"}).then(function(ie){if(!ie.ok)throw"failed to load wasm binary file at '"+ve+"'";return ie.arrayBuffer()}).catch(function(){return Tt()});if(g)return new Promise(function(ie,Ee){g(ve,function(Re){ie(new Uint8Array(Re))},Ee)})}return Promise.resolve().then(function(){return Tt()})}a(Mt,"qa");function ur(ie){for(;0<ie.length;){var Ee=ie.shift();if(typeof Ee=="function")Ee(r);else{var Re=Ee.m;typeof Re=="number"?Ee.l===void 0?j.get(Re)():j.get(Re)(Ee.l):Re(Ee.l===void 0?null:Ee.l)}}}a(ur,"X");var $r=!1,sn=typeof atob=="function"?atob:function(ie){var Ee="",Re=0;ie=ie.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Re++)),gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Re++)),lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Re++)),Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(ie.charAt(Re++));je=je<<2|gt>>4,gt=(gt&15)<<4|lr>>2;var Yr=(lr&3)<<6|Tn;Ee+=String.fromCharCode(je),lr!==64&&(Ee+=String.fromCharCode(gt)),Tn!==64&&(Ee+=String.fromCharCode(Yr))}while(Re<ie.length);return Ee};function Hr(ie){if(ie.startsWith(_e)){if(ie=ie.slice(_e.length),typeof l=="boolean"&&l){var Ee=Buffer.from(ie,"base64");Ee=new Uint8Array(Ee.buffer,Ee.byteOffset,Ee.byteLength)}else try{var Re=sn(ie),je=new Uint8Array(Re.length);for(ie=0;ie<Re.length;++ie)je[ie]=Re.charCodeAt(ie);Ee=je}catch{throw Error("Converting base64 string to bytes failed.")}return Ee}}a(Hr,"H");var Oo={a:a(function(ie){var Ee=U.length;if(ie>>>=0,2147483648<ie)return!1;for(var Re=1;4>=Re;Re*=2){var je=Ee*(1+.2/Re);je=Math.min(je,ie+100663296),je=Math.max(ie,je),0<je%65536&&(je+=65536-je%65536);e:{try{M.grow(Math.min(2147483648,je)-C.byteLength+65535>>>16),k();var gt=1;break e}catch{}gt=void 0}if(gt)return!0}return!1},"a")};(function(){function ie(gt){r.asm=gt.exports,M=r.asm.b,k(),j=r.asm.j,z.unshift(r.asm.c),O--,r.monitorRunDependencies&&r.monitorRunDependencies(O),O==0&&(q!==null&&(clearInterval(q),q=null),V&&(gt=V,V=null,gt()))}a(ie,"a");function Ee(gt){ie(gt.instance)}a(Ee,"c");function Re(gt){return Mt().then(function(lr){return WebAssembly.instantiate(lr,je)}).then(gt,function(lr){b("failed to asynchronously prepare wasm: "+lr),re(lr)})}a(Re,"d");var je={a:Oo};if(O++,r.monitorRunDependencies&&r.monitorRunDependencies(O),r.instantiateWasm)try{return r.instantiateWasm(je,ie)}catch(gt){return b("Module.instantiateWasm callback failed with error: "+gt),!1}return(function(){return v||typeof WebAssembly.instantiateStreaming!="function"||ve.startsWith(_e)||ve.startsWith("file://")||typeof fetch!="function"?Re(Ee):fetch(ve,{credentials:"same-origin"}).then(function(gt){return WebAssembly.instantiateStreaming(gt,je).then(Ee,function(lr){return b("wasm streaming compile failed: "+lr),b("falling back to ArrayBuffer instantiation"),Re(Ee)})})})().catch(n),{}})(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.c).apply(null,arguments)},r._poly1305_auth=function(){return(r._poly1305_auth=r.asm.d).apply(null,arguments)};var Gs=r.stackSave=function(){return(Gs=r.stackSave=r.asm.e).apply(null,arguments)},Gu=r.stackRestore=function(){return(Gu=r.stackRestore=r.asm.f).apply(null,arguments)},Ys=r.stackAlloc=function(){return(Ys=r.stackAlloc=r.asm.g).apply(null,arguments)};r._malloc=function(){return(r._malloc=r.asm.h).apply(null,arguments)},r._free=function(){return(r._free=r.asm.i).apply(null,arguments)},r.cwrap=function(ie,Ee,Re,je){Re=Re||[];var gt=Re.every(function(lr){return lr==="number"});return Ee!=="string"&&gt&&!je?te(ie):function(){return ee(ie,Ee,Re,arguments)}};var No;V=a(function ie(){No||$o(),No||(V=ie)},"ta");function $o(){function ie(){if(!No&&(No=!0,r.calledRun=!0,!R)){if(ur(z),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var Ee=r.postRun.shift();X.unshift(Ee)}ur(X)}}if(a(ie,"a"),!(0<O)){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)ne();ur(W),0<O||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),ie()},1)):ie())}}if(a($o,"Z"),r.run=$o,r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return $o(),t.ready})})();typeof Jd=="object"&&typeof oE=="object"?oE.exports=iE:typeof define=="function"&&define.amd?define([],function(){return iE}):typeof Jd=="object"&&(Jd.createPoly1305=iE)});var Pi=me((DQ,SS)=>{"use strict";var{createCipheriv:Rs,createDecipheriv:ep,createHmac:sE,randomFillSync:Ao,timingSafeEqual:aE}=require("crypto"),{readUInt32BE:du,writeUInt32BE:nn}=In(),Ti=Buffer[Symbol.species],bS=2**32-1,xS=Buffer.alloc(0),Cs=Buffer.alloc(4),tp=new Map,bo=35e3,cE,IE,vE,SE,wE,PE,TE;try{cE=require("./crypto/build/Release/sshcrypto.node"),{AESGCMCipher:IE,ChaChaPolyCipher:vE,GenericCipher:SE,AESGCMDecipher:wE,ChaChaPolyDecipher:PE,GenericDecipher:TE}=cE}catch{}var Sr=1,d4=(()=>{function e(t,r,i,n,o,s,c){return{sslName:t,blockLen:r,keyLen:i,ivLen:n!==0||c&Sr?n:r,authLen:o,discardLen:s,stream:!!(c&Sr)}}return a(e,"info"),{"chacha20-poly1305@openssh.com":e("chacha20",8,64,0,16,0,Sr),"aes128-gcm":e("aes-128-gcm",16,16,12,16,0,Sr),"aes256-gcm":e("aes-256-gcm",16,32,12,16,0,Sr),"aes128-gcm@openssh.com":e("aes-128-gcm",16,16,12,16,0,Sr),"aes256-gcm@openssh.com":e("aes-256-gcm",16,32,12,16,0,Sr),"aes128-cbc":e("aes-128-cbc",16,16,0,0,0,0),"aes192-cbc":e("aes-192-cbc",16,24,0,0,0,0),"aes256-cbc":e("aes-256-cbc",16,32,0,0,0,0),"rijndael-cbc@lysator.liu.se":e("aes-256-cbc",16,32,0,0,0,0),"3des-cbc":e("des-ede3-cbc",8,24,0,0,0,0),"blowfish-cbc":e("bf-cbc",8,16,0,0,0,0),"idea-cbc":e("idea-cbc",8,16,0,0,0,0),"cast128-cbc":e("cast-cbc",8,16,0,0,0,0),"aes128-ctr":e("aes-128-ctr",16,16,16,0,0,Sr),"aes192-ctr":e("aes-192-ctr",16,24,16,0,0,Sr),"aes256-ctr":e("aes-256-ctr",16,32,16,0,0,Sr),"3des-ctr":e("des-ede3",8,24,8,0,0,Sr),"blowfish-ctr":e("bf-ecb",8,16,8,0,0,Sr),"cast128-ctr":e("cast5-ecb",8,16,8,0,0,Sr),arcfour:e("rc4",8,16,0,0,1536,Sr),arcfour128:e("rc4",8,16,0,0,1536,Sr),arcfour256:e("rc4",8,32,0,0,1536,Sr),arcfour512:e("rc4",8,64,0,0,1536,Sr)}})(),p4=(()=>{function e(t,r,i,n){return{sslName:t,len:r,actualLen:i,isETM:n}}return a(e,"info"),{"hmac-md5":e("md5",16,16,!1),"hmac-md5-96":e("md5",16,12,!1),"hmac-ripemd160":e("ripemd160",20,20,!1),"hmac-sha1":e("sha1",20,20,!1),"hmac-sha1-etm@openssh.com":e("sha1",20,20,!0),"hmac-sha1-96":e("sha1",20,12,!1),"hmac-sha2-256":e("sha256",32,32,!1),"hmac-sha2-256-etm@openssh.com":e("sha256",32,32,!0),"hmac-sha2-256-96":e("sha256",32,12,!1),"hmac-sha2-512":e("sha512",64,64,!1),"hmac-sha2-512-etm@openssh.com":e("sha512",64,64,!0),"hmac-sha2-512-96":e("sha512",64,12,!1)}})(),uE=class{static{a(this,"NullCipher")}constructor(t,r){this.outSeqno=t,this._onWrite=r,this._dead=!1}free(){this._dead=!0}allocPacket(t){let r=5+t,i=8-(r&7);i<4&&(i+=8),r+=i;let n=Buffer.allocUnsafe(r);return nn(n,r-4,0),n[4]=i,Ao(n,5+t,i),n}encrypt(t){this._dead||(this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},IS=Buffer.alloc(32),Zr=Buffer.alloc(16),fu,pu,kE,lE=class{static{a(this,"ChaChaPolyCipherNative")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encKeyMain=r.cipherKey.slice(0,32),this._encKeyPktLen=r.cipherKey.slice(32),this._dead=!1}free(){this._dead=!0}allocPacket(t){let r=5+t,i=8-(r-4&7);i<4&&(i+=8),r+=i;let n=Buffer.allocUnsafe(r);return nn(n,r-4,0),n[4]=i,Ao(n,5+t,i),n}encrypt(t){if(this._dead)return;Zr[0]=0,nn(Zr,this.outSeqno,12);let r=Rs("chacha20",this._encKeyMain,Zr).update(IS),i=Rs("chacha20",this._encKeyPktLen,Zr).update(t.slice(0,4));this._onWrite(i),Zr[0]=1;let n=Rs("chacha20",this._encKeyMain,Zr).update(t.slice(4));this._onWrite(n),kE(pu,i,i.length,n,n.length,r);let o=Buffer.allocUnsafe(16);o.set(new Uint8Array(fu.HEAPU8.buffer,pu,16),0),this._onWrite(o),this.outSeqno=this.outSeqno+1>>>0}},fE=class{static{a(this,"ChaChaPolyCipherBinding")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new vE(r.cipherKey),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(t){let r=5+t,i=8-(r-4&7);i<4&&(i+=8),r+=i;let n=Buffer.allocUnsafe(r+16);return nn(n,r-4,0),n[4]=i,Ao(n,5+t,i),n}encrypt(t){this._dead||(this._instance.encrypt(t,this.outSeqno),this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},dE=class{static{a(this,"AESGCMCipherNative")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encSSLName=r.cipherInfo.sslName,this._encKey=r.cipherKey,this._encIV=r.cipherIV,this._dead=!1}free(){this._dead=!0}allocPacket(t){let r=5+t,i=16-(r-4&15);i<4&&(i+=16),r+=i;let n=Buffer.allocUnsafe(r);return nn(n,r-4,0),n[4]=i,Ao(n,5+t,i),n}encrypt(t){if(this._dead)return;let r=Rs(this._encSSLName,this._encKey,this._encIV);r.setAutoPadding(!1);let i=t.slice(0,4);r.setAAD(i),this._onWrite(i);let n=r.update(t.slice(4));this._onWrite(n);let o=r.final();o.length&&this._onWrite(o);let s=r.getAuthTag();this._onWrite(s),vS(this._encIV),this.outSeqno=this.outSeqno+1>>>0}},pE=class{static{a(this,"AESGCMCipherBinding")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._instance=new IE(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(t){let r=5+t,i=16-(r-4&15);i<4&&(i+=16),r+=i;let n=Buffer.allocUnsafe(r+16);return nn(n,r-4,0),n[4]=i,Ao(n,5+t,i),n}encrypt(t){this._dead||(this._instance.encrypt(t),this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},hE=class{static{a(this,"GenericCipherNative")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._cipherInstance=Rs(r.cipherInfo.sslName,r.cipherKey,r.cipherIV),this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._aadLen=this._macETM?4:0,this._dead=!1;let i=r.cipherInfo.discardLen;if(i){let n=tp.get(i);n===void 0&&(n=Buffer.alloc(i),tp.set(i,n)),this._cipherInstance.update(n)}}free(){this._dead=!0}allocPacket(t){let r=this._encBlockLen,i=5+t,n=r-(i-this._aadLen&r-1);n<4&&(n+=r),i+=n;let o=Buffer.allocUnsafe(i);return nn(o,i-4,0),o[4]=n,Ao(o,5+t,n),o}encrypt(t){if(this._dead)return;let r;if(this._macETM){let n=new Uint8Array(t.buffer,t.byteOffset,4),o=this._cipherInstance.update(new Uint8Array(t.buffer,t.byteOffset+4,t.length-4));this._onWrite(n),this._onWrite(o),r=sE(this._macSSLName,this._macKey),nn(Cs,this.outSeqno,0),r.update(Cs),r.update(n),r.update(o)}else{let n=this._cipherInstance.update(t);this._onWrite(n),r=sE(this._macSSLName,this._macKey),nn(Cs,this.outSeqno,0),r.update(Cs),r.update(t)}let i=r.digest();i.length>this._macActualLen&&(i=i.slice(0,this._macActualLen)),this._onWrite(i),this.outSeqno=this.outSeqno+1>>>0}},gE=class{static{a(this,"GenericCipherBinding")}constructor(t){let r=t.outbound;this.outSeqno=r.seqno,this._onWrite=r.onWrite,this._encBlockLen=r.cipherInfo.blockLen,this._macLen=r.macInfo.len,this._macActualLen=r.macInfo.actualLen,this._aadLen=r.macInfo.isETM?4:0,this._instance=new SE(r.cipherInfo.sslName,r.cipherKey,r.cipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM),this._dead=!1}free(){this._dead=!0,this._instance.free()}allocPacket(t){let r=this._encBlockLen,i=5+t,n=r-(i-this._aadLen&r-1);n<4&&(n+=r),i+=n;let o=Buffer.allocUnsafe(i+this._macLen);return nn(o,i-4,0),o[4]=n,Ao(o,5+t,n),o}encrypt(t){this._dead||(this._instance.encrypt(t,this.outSeqno),this._macActualLen<this._macLen&&(t=new Ti(t.buffer,t.byteOffset,t.length-(this._macLen-this._macActualLen))),this._onWrite(t),this.outSeqno=this.outSeqno+1>>>0)}},mE=class{static{a(this,"NullDecipher")}constructor(t,r){this.inSeqno=t,this._onPayload=r,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,i-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+t[r++];if(this._lenBytes<4)return;if(this._len>bo||this._len<8||(4+this._len&7)!==0)throw new Error("Bad packet length");if(r>=i)return}if(this._packetPos<this._len){let o=Math.min(this._len-this._packetPos,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),r+=o,this._packetPos+=o,this._packetPos<this._len)return}let n=this._packet?new Ti(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):xS;this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},_E=class{static{a(this,"ChaChaPolyDecipherNative")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decKeyMain=r.decipherKey.slice(0,32),this._decKeyPktLen=r.decipherKey.slice(32),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._calcMac=Buffer.allocUnsafe(16),this._macPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenPos<4){let c=Math.min(4-this._lenPos,i-r);for(;c--;)this._lenBuf[this._lenPos++]=t[r++];if(this._lenPos<4)return;Zr[0]=0,nn(Zr,this.inSeqno,12);let u=ep("chacha20",this._decKeyPktLen,Zr).update(this._lenBuf);if(this._len=du(u,0),this._len>bo||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length")}if(this._pktLen<this._len){if(r>=i)return;let c=Math.min(this._len-this._pktLen,i-r),u;if(r!==0||c!==i?u=new Uint8Array(t.buffer,t.byteOffset+r,c):u=t,c===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._pktLen)),r+=c,this._pktLen+=c,this._pktLen<this._len||r>=i)return}{let c=Math.min(16-this._macPos,i-r);if(r!==0||c!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,c),this._macPos):this._mac.set(t,this._macPos),r+=c,this._macPos+=c,this._macPos<16)return}Zr[0]=0,nn(Zr,this.inSeqno,12);let n=Rs("chacha20",this._decKeyMain,Zr).update(IS);if(kE(pu,this._lenBuf,4,this._packet,this._packet.length,n),this._calcMac.set(new Uint8Array(fu.HEAPU8.buffer,pu,16),0),!aE(this._calcMac,this._mac))throw new Error("Invalid MAC");Zr[0]=1;let o=ep("chacha20",this._decKeyMain,Zr).update(this._packet),s=new Ti(o.buffer,o.byteOffset+1,o.length-o[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let c=this._onPayload(s);if(c!==void 0)return c===!1?r:c}}}},yE=class{static{a(this,"ChaChaPolyDecipherBinding")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new PE(r.decipherKey),this._len=0,this._lenBuf=Buffer.alloc(4),this._lenPos=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(16),this._macPos=0}free(){this._instance.free()}decrypt(t,r,i){for(;r<i;){if(this._lenPos<4){let o=Math.min(4-this._lenPos,i-r);for(;o--;)this._lenBuf[this._lenPos++]=t[r++];if(this._lenPos<4)return;if(this._len=this._instance.decryptLen(this._lenBuf,this.inSeqno),this._len>bo||this._len<8||(this._len&7)!==0)throw new Error("Bad packet length");if(r>=i)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(16-this._macPos,i-r);if(r!==0||o!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._macPos):this._mac.set(t,this._macPos),r+=o,this._macPos+=o,this._macPos<16)return}this._instance.decrypt(this._packet,this._mac,this.inSeqno);let n=new Ti(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenPos=0,this._packet=null,this._pktLen=0,this._macPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},EE=class{static{a(this,"AESGCMDecipherNative")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=null,this._decipherSSLName=r.decipherInfo.sslName,this._decipherKey=r.decipherKey,this._decipherIV=r.decipherIV,this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,i-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+t[r++];if(this._lenBytes<4)return;if(this._len+20>bo||this._len<16||(this._len&15)!==0)throw new Error("Bad packet length");this._decipherInstance=ep(this._decipherSSLName,this._decipherKey,this._decipherIV),this._decipherInstance.setAutoPadding(!1),this._decipherInstance.setAAD(h4(this._len))}if(this._pktLen<this._len){if(r>=i)return;let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=this._decipherInstance.update(new Uint8Array(t.buffer,t.byteOffset+r,o)):s=this._decipherInstance.update(t),s.length&&(o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._packetPos)),this._packetPos+=s.length),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(16-this._tagPos,i-r);if(r!==0||o!==i?this._tag.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._tagPos):this._tag.set(t,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}{this._decipherInstance.setAuthTag(this._tag);let o=this._decipherInstance.final();o.length&&(this._packet?this._packet.set(o,this._packetPos):this._packet=o)}let n=this._packet?new Ti(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1):xS;this.inSeqno=this.inSeqno+1>>>0,vS(this._decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},AE=class{static{a(this,"AESGCMDecipherBinding")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new wE(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tag=Buffer.allocUnsafe(16),this._tagPos=0}free(){}decrypt(t,r,i){for(;r<i;){if(this._lenBytes<4){let o=Math.min(4-this._lenBytes,i-r);for(this._lenBytes+=o;o--;)this._len=(this._len<<8)+t[r++];if(this._lenBytes<4)return;if(this._len+20>bo||this._len<16||(this._len&15)!==0)throw new Error(`Bad packet length: ${this._len}`)}if(this._pktLen<this._len){if(r>=i)return;let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(16-this._tagPos,i-r);if(r!==0||o!==i?this._tag.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._tagPos):this._tag.set(t,this._tagPos),r+=o,this._tagPos+=o,this._tagPos<16)return}this._instance.decrypt(this._packet,this._len,this._tag);let n=new Ti(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._len=0,this._lenBytes=0,this._packet=null,this._pktLen=0,this._tagPos=0;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}},bE=class{static{a(this,"GenericDecipherNative")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._decipherInstance=ep(r.decipherInfo.sslName,r.decipherKey,r.decipherIV),this._decipherInstance.setAutoPadding(!1),this._block=Buffer.allocUnsafe(r.macInfo.isETM?4:r.decipherInfo.blockLen),this._blockSize=r.decipherInfo.blockLen,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macSSLName=r.macInfo.sslName,this._macKey=r.macKey,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM,this._macInstance=null;let i=r.decipherInfo.discardLen;if(i){let n=tp.get(i);n===void 0&&(n=Buffer.alloc(i),tp.set(i,n)),this._decipherInstance.update(n)}}free(){}decrypt(t,r,i){for(;r<i;){if(this._blockPos<this._block.length){let s=Math.min(this._block.length-this._blockPos,i-r);if(r!==0||s!==i||s<t.length?this._block.set(new Uint8Array(t.buffer,t.byteOffset+r,s),this._blockPos):this._block.set(t,this._blockPos),r+=s,this._blockPos+=s,this._blockPos<this._block.length)return;let c,u;if(this._macETM?this._len=u=du(this._block,0):(c=this._decipherInstance.update(this._block),this._len=du(c,0),u=4+this._len-this._blockSize),this._len>bo||this._len<5||(u&this._blockSize-1)!==0)throw new Error("Bad packet length");if(this._macInstance=sE(this._macSSLName,this._macKey),nn(Cs,this.inSeqno,0),this._macInstance.update(Cs),this._macETM?this._macInstance.update(this._block):(this._macInstance.update(new Uint8Array(c.buffer,c.byteOffset,4)),this._pktLen=c.length-4,this._packetPos=this._pktLen,this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(c.buffer,c.byteOffset+4,this._packetPos),0)),r>=i)return}if(this._pktLen<this._len){let s=Math.min(this._len-this._pktLen,i-r),c;r!==0||s!==i?c=new Uint8Array(t.buffer,t.byteOffset+r,s):c=t,this._macETM&&this._macInstance.update(c);let u=this._decipherInstance.update(c);if(u.length&&(s===this._len?this._packet=u:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(u,this._packetPos)),this._packetPos+=u.length),r+=s,this._pktLen+=s,this._pktLen<this._len||r>=i)return}{let s=Math.min(this._macActualLen-this._macPos,i-r);if(r!==0||s!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,s),this._macPos):this._mac.set(t,this._macPos),r+=s,this._macPos+=s,this._macPos<this._macActualLen)return}this._macETM||this._macInstance.update(this._packet);let n=this._macInstance.digest();if(this._macActualLen<n.length&&(n=new Uint8Array(n.buffer,n.byteOffset,this._macActualLen)),!g4(n,this._mac))throw new Error("Invalid MAC");let o=new Ti(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._packetPos=0,this._pktLen=0,this._macPos=0,this._macInstance=null;{let s=this._onPayload(o);if(s!==void 0)return s===!1?r:s}}}},xE=class{static{a(this,"GenericDecipherBinding")}constructor(t){let r=t.inbound;this.inSeqno=r.seqno,this._onPayload=r.onPayload,this._instance=new TE(r.decipherInfo.sslName,r.decipherKey,r.decipherIV,r.macInfo.sslName,r.macKey,r.macInfo.isETM,r.macInfo.actualLen),this._block=Buffer.allocUnsafe(r.macInfo.isETM||r.decipherInfo.stream?4:r.decipherInfo.blockLen),this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._mac=Buffer.allocUnsafe(r.macInfo.actualLen),this._macPos=0,this._macActualLen=r.macInfo.actualLen,this._macETM=r.macInfo.isETM}free(){this._instance.free()}decrypt(t,r,i){for(;r<i;){if(this._blockPos<this._block.length){let o=Math.min(this._block.length-this._blockPos,i-r);if(r!==0||o!==i||o<t.length?this._block.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._blockPos):this._block.set(t,this._blockPos),r+=o,this._blockPos+=o,this._blockPos<this._block.length)return;let s;if(this._macETM?this._len=s=du(this._block,0):(this._instance.decryptBlock(this._block),this._len=du(this._block,0),s=4+this._len-this._block.length),this._len>bo||this._len<5||(s&this._block.length-1)!==0)throw new Error("Bad packet length");if(this._macETM||(this._pktLen=this._block.length-4,this._pktLen&&(this._packet=Buffer.allocUnsafe(this._len),this._packet.set(new Uint8Array(this._block.buffer,this._block.byteOffset+4,this._pktLen),0))),r>=i)return}if(this._pktLen<this._len){let o=Math.min(this._len-this._pktLen,i-r),s;if(r!==0||o!==i?s=new Uint8Array(t.buffer,t.byteOffset+r,o):s=t,o===this._len?this._packet=s:(this._packet||(this._packet=Buffer.allocUnsafe(this._len)),this._packet.set(s,this._pktLen)),r+=o,this._pktLen+=o,this._pktLen<this._len||r>=i)return}{let o=Math.min(this._macActualLen-this._macPos,i-r);if(r!==0||o!==i?this._mac.set(new Uint8Array(t.buffer,t.byteOffset+r,o),this._macPos):this._mac.set(t,this._macPos),r+=o,this._macPos+=o,this._macPos<this._macActualLen)return}this._instance.decrypt(this._packet,this.inSeqno,this._block,this._mac);let n=new Ti(this._packet.buffer,this._packet.byteOffset+1,this._packet.length-this._packet[0]-1);this.inSeqno=this.inSeqno+1>>>0,this._blockPos=0,this._len=0,this._packet=null,this._pktLen=0,this._macPos=0,this._macInstance=null;{let o=this._onPayload(n);if(o!==void 0)return o===!1?r:o}}}};function vS(e){++e[11]>>>8&&++e[10]>>>8&&++e[9]>>>8&&++e[8]>>>8&&++e[7]>>>8&&++e[6]>>>8&&++e[5]>>>8&&++e[4]>>>8}a(vS,"ivIncrement");var h4=(()=>{let e=Buffer.alloc(4);return t=>(e[0]=t>>>24,e[1]=t>>>16,e[2]=t>>>8,e[3]=t,e)})();function g4(e,t){return e.length!==t.length?(aE(e,e),!1):aE(e,t)}a(g4,"timingSafeEquals");function m4(e){if(typeof e!="object"||e===null)throw new Error("Invalid config");if(typeof e.outbound!="object"||e.outbound===null)throw new Error("Invalid outbound");let t=e.outbound;if(typeof t.onWrite!="function")throw new Error("Invalid outbound.onWrite");if(typeof t.cipherInfo!="object"||t.cipherInfo===null)throw new Error("Invalid outbound.cipherInfo");if(!Buffer.isBuffer(t.cipherKey)||t.cipherKey.length!==t.cipherInfo.keyLen)throw new Error("Invalid outbound.cipherKey");if(t.cipherInfo.ivLen&&(!Buffer.isBuffer(t.cipherIV)||t.cipherIV.length!==t.cipherInfo.ivLen))throw new Error("Invalid outbound.cipherIV");if(typeof t.seqno!="number"||t.seqno<0||t.seqno>bS)throw new Error("Invalid outbound.seqno");let r=!!t.forceNative;switch(t.cipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return IE&&!r?new pE(e):new dE(e);case"chacha20":return vE&&!r?new fE(e):new lE(e);default:{if(typeof t.macInfo!="object"||t.macInfo===null)throw new Error("Invalid outbound.macInfo");if(!Buffer.isBuffer(t.macKey)||t.macKey.length!==t.macInfo.len)throw new Error("Invalid outbound.macKey");return SE&&!r?new gE(e):new hE(e)}}}a(m4,"createCipher");function _4(e){if(typeof e!="object"||e===null)throw new Error("Invalid config");if(typeof e.inbound!="object"||e.inbound===null)throw new Error("Invalid inbound");let t=e.inbound;if(typeof t.onPayload!="function")throw new Error("Invalid inbound.onPayload");if(typeof t.decipherInfo!="object"||t.decipherInfo===null)throw new Error("Invalid inbound.decipherInfo");if(!Buffer.isBuffer(t.decipherKey)||t.decipherKey.length!==t.decipherInfo.keyLen)throw new Error("Invalid inbound.decipherKey");if(t.decipherInfo.ivLen&&(!Buffer.isBuffer(t.decipherIV)||t.decipherIV.length!==t.decipherInfo.ivLen))throw new Error("Invalid inbound.decipherIV");if(typeof t.seqno!="number"||t.seqno<0||t.seqno>bS)throw new Error("Invalid inbound.seqno");let r=!!t.forceNative;switch(t.decipherInfo.sslName){case"aes-128-gcm":case"aes-256-gcm":return wE&&!r?new AE(e):new EE(e);case"chacha20":return PE&&!r?new yE(e):new _E(e);default:{if(typeof t.macInfo!="object"||t.macInfo===null)throw new Error("Invalid inbound.macInfo");if(!Buffer.isBuffer(t.macKey)||t.macKey.length!==t.macInfo.len)throw new Error("Invalid inbound.macKey");return TE&&!r?new xE(e):new bE(e)}}}a(_4,"createDecipher");SS.exports={CIPHER_INFO:d4,MAC_INFO:p4,bindingAvailable:!!cE,init:new Promise(async(e,t)=>{try{fu=await AS()(),pu=fu._malloc(16),kE=fu.cwrap("poly1305_auth",null,["number","array","number","array","number","array"])}catch(r){return t(r)}e()}),NullCipher:uE,createCipher:m4,NullDecipher:mE,createDecipher:_4}});var Ci=me((zQ,DS)=>{"use strict";var{createDecipheriv:RE,createECDH:y4,createHash:gu,createHmac:E4,createSign:A4,createVerify:b4,getCiphers:x4,sign:wS,verify:PS}=require("crypto"),I4=x4(),{Ber:Fe}=cu(),v4=eE().pbkdf,{CIPHER_INFO:mu}=Pi(),{eddsaSupported:OE,SUPPORTED_CIPHER:S4}=Jn(),{bufferSlice:xo,makeBufferParser:w4,readString:Le,readUInt32BE:hu,writeUInt32BE:br}=In(),ei=Symbol("Hash Algorithm"),vn=Symbol("Private key PEM"),$n=Symbol("Public key PEM"),ki=Symbol("Public key SSH"),Os=Symbol("Decrypted Key"),CE=Object.create(null);{let e=Object.keys(mu);for(let t=0;t<e.length;++t){let r=mu[e[t]].sslName;!r||CE[r]||(CE[r]=mu[e[t]])}}var rp=w4();function Sn(e,t){t=t.base64Slice(0,t.length);let r=t.replace(/.{64}/g,`$&
9
+ `);return t.length&63&&(r+=`
10
+ `),`-----BEGIN ${e} KEY-----
11
+ ${r}-----END ${e} KEY-----`}a(Sn,"makePEM");function _u(e,t){let r=Buffer.allocUnsafe(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}a(_u,"combineBuffers");function NE(e,t){let r=e.length,i=e._pos||0;for(let n=0;n<t;++n){let o=r-i;if(i>=r||o<4)return!1;let s=hu(e,i);if(o<4+s)return!1;i+=4+s}return e._pos=i,!0}a(NE,"skipFields");function yu(e,t){let r=new Fe.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.113549.1.1.1"),r.writeNull(),r.endSequence(),r.startSequence(Fe.BitString),r.writeByte(0),r.startSequence(),r.writeBuffer(e,Fe.Integer),r.writeBuffer(t,Fe.Integer),r.endSequence(),r.endSequence(),r.endSequence(),Sn("PUBLIC",r.buffer)}a(yu,"genOpenSSLRSAPub");function Eu(e,t){let r=Buffer.allocUnsafe(15+t.length+4+e.length);br(r,7,0),r.utf8Write("ssh-rsa",4,7);let i=11;return br(r,t.length,i),r.set(t,i+=4),br(r,e.length,i+=t.length),r.set(e,i+4),r}a(Eu,"genOpenSSHRSAPub");var TS=(()=>{function e(i,n,o,s,c,u,l,f){let p=new Fe.Writer;return p.startSequence(),p.writeInt(0,Fe.Integer),p.writeBuffer(i,Fe.Integer),p.writeBuffer(n,Fe.Integer),p.writeBuffer(o,Fe.Integer),p.writeBuffer(s,Fe.Integer),p.writeBuffer(c,Fe.Integer),p.writeBuffer(u,Fe.Integer),p.writeBuffer(l,Fe.Integer),p.writeBuffer(f,Fe.Integer),p.endSequence(),p.buffer}a(e,"genRSAASN1Buf");function t(i){return BigInt(`0x${i.hexSlice(0,i.length)}`)}a(t,"bigIntFromBuffer");function r(i){let n=i.toString(16);if((n.length&1)!==0)n=`0${n}`;else{let o=n.charCodeAt(0);(o===56||o===57||o>=97&&o<=102)&&(n=`00${n}`)}return Buffer.from(n,"hex")}return a(r,"bigIntToBuffer"),a(function(n,o,s,c,u,l){let f=t(s),p=r(f%(t(u)-1n)),g=r(f%(t(l)-1n));return Sn("RSA PRIVATE",e(n,o,s,u,l,p,g,c))},"genOpenSSLRSAPriv")})();function Au(e,t,r,i){let n=new Fe.Writer;return n.startSequence(),n.startSequence(),n.writeOID("1.2.840.10040.4.1"),n.startSequence(),n.writeBuffer(e,Fe.Integer),n.writeBuffer(t,Fe.Integer),n.writeBuffer(r,Fe.Integer),n.endSequence(),n.endSequence(),n.startSequence(Fe.BitString),n.writeByte(0),n.writeBuffer(i,Fe.Integer),n.endSequence(),n.endSequence(),Sn("PUBLIC",n.buffer)}a(Au,"genOpenSSLDSAPub");function bu(e,t,r,i){let n=Buffer.allocUnsafe(15+e.length+4+t.length+4+r.length+4+i.length);br(n,7,0),n.utf8Write("ssh-dss",4,7);let o=11;return br(n,e.length,o),n.set(e,o+=4),br(n,t.length,o+=e.length),n.set(t,o+=4),br(n,r.length,o+=t.length),n.set(r,o+=4),br(n,i.length,o+=r.length),n.set(i,o+4),n}a(bu,"genOpenSSHDSAPub");function kS(e,t,r,i,n){let o=new Fe.Writer;return o.startSequence(),o.writeInt(0,Fe.Integer),o.writeBuffer(e,Fe.Integer),o.writeBuffer(t,Fe.Integer),o.writeBuffer(r,Fe.Integer),o.writeBuffer(i,Fe.Integer),o.writeBuffer(n,Fe.Integer),o.endSequence(),Sn("DSA PRIVATE",o.buffer)}a(kS,"genOpenSSLDSAPriv");function CS(e){let t=new Fe.Writer;return t.startSequence(),t.startSequence(),t.writeOID("1.3.101.112"),t.endSequence(),t.startSequence(Fe.BitString),t.writeByte(0),t._ensure(e.length),t._buf.set(e,t._offset),t._offset+=e.length,t.endSequence(),t.endSequence(),Sn("PUBLIC",t.buffer)}a(CS,"genOpenSSLEdPub");function RS(e){let t=Buffer.allocUnsafe(19+e.length);return br(t,11,0),t.utf8Write("ssh-ed25519",4,11),br(t,e.length,15),t.set(e,19),t}a(RS,"genOpenSSHEdPub");function P4(e){let t=new Fe.Writer;return t.startSequence(),t.writeInt(0,Fe.Integer),t.startSequence(),t.writeOID("1.3.101.112"),t.endSequence(),t.startSequence(Fe.OctetString),t.writeBuffer(e,Fe.OctetString),t.endSequence(),t.endSequence(),Sn("PRIVATE",t.buffer)}a(P4,"genOpenSSLEdPriv");function $E(e,t){let r=new Fe.Writer;return r.startSequence(),r.startSequence(),r.writeOID("1.2.840.10045.2.1"),r.writeOID(e),r.endSequence(),r.startSequence(Fe.BitString),r.writeByte(0),r._ensure(t.length),r._buf.set(t,r._offset),r._offset+=t.length,r.endSequence(),r.endSequence(),Sn("PUBLIC",r.buffer)}a($E,"genOpenSSLECDSAPub");function DE(e,t){let r;switch(e){case"1.2.840.10045.3.1.7":r="nistp256";break;case"1.3.132.0.34":r="nistp384";break;case"1.3.132.0.35":r="nistp521";break;default:return}let i=Buffer.allocUnsafe(39+t.length);return br(i,19,0),i.utf8Write(`ecdsa-sha2-${r}`,4,19),br(i,8,23),i.utf8Write(r,27,8),br(i,t.length,35),i.set(t,39),i}a(DE,"genOpenSSHECDSAPub");function T4(e,t,r){let i=new Fe.Writer;return i.startSequence(),i.writeInt(1,Fe.Integer),i.writeBuffer(r,Fe.OctetString),i.startSequence(160),i.writeOID(e),i.endSequence(),i.startSequence(161),i.startSequence(Fe.BitString),i.writeByte(0),i._ensure(t.length),i._buf.set(t,i._offset),i._offset+=t.length,i.endSequence(),i.endSequence(),i.endSequence(),Sn("EC PRIVATE",i.buffer)}a(T4,"genOpenSSLECDSAPriv");function k4(e,t){let r=y4(e);return r.setPrivateKey(t),r.getPublicKey()}a(k4,"genOpenSSLECDSAPubFromPriv");var xu={sign:a(typeof wS=="function"?function(t,r){let i=this[vn];if(i===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[ei]);try{return wS(r,t,i)}catch(n){return n}}:function(t,r){let i=this[vn];if(i===null)return new Error("No private key available");(!r||typeof r!="string")&&(r=this[ei]);let n=A4(r);n.update(t);try{return n.sign(i)}catch(o){return o}},"sign"),verify:a(typeof PS=="function"?function(t,r,i){let n=this[$n];if(n===null)return new Error("No public key available");(!i||typeof i!="string")&&(i=this[ei]);try{return PS(i,t,n,r)}catch(o){return o}}:function(t,r,i){let n=this[$n];if(n===null)return new Error("No public key available");(!i||typeof i!="string")&&(i=this[ei]);let o=b4(i);o.update(t);try{return o.verify(n,r)}catch(s){return s}},"verify"),isPrivateKey:a(function(){return this[vn]!==null},"isPrivateKey"),getPrivatePEM:a(function(){return this[vn]},"getPrivatePEM"),getPublicPEM:a(function(){return this[$n]},"getPublicPEM"),getPublicSSH:a(function(){return this[ki]},"getPublicSSH"),equals:a(function(t){let r=$S(t);return r instanceof Error?!1:this.type===r.type&&this[vn]===r[vn]&&this[$n]===r[$n]&&this[ki].equals(r[ki])},"equals")};function np(e,t,r,i,n,o,s){this.type=e,this.comment=t,this[vn]=r,this[$n]=i,this[ki]=n,this[ei]=o,this[Os]=s}a(np,"OpenSSH_Private");np.prototype=xu;{let t=function(r,i,n){let o=[];if(r.length<8)return new Error("Malformed OpenSSH private key");let s=hu(r,0),c=hu(r,4);if(s!==c)return n?new Error("OpenSSH key integrity check failed -- bad passphrase?"):new Error("OpenSSH key integrity check failed");r._pos=8;let u,l;for(u=0;u<i;++u){let p,g,h,_,y=Le(r,r._pos,!0);if(y===void 0)return new Error("Malformed OpenSSH private key");switch(y){case"ssh-rsa":{let v=Le(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let S=Le(r,r._pos);if(S===void 0)return new Error("Malformed OpenSSH private key");let M=Le(r,r._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");let R=Le(r,r._pos);if(R===void 0)return new Error("Malformed OpenSSH private key");let J=Le(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");let te=Le(r,r._pos);if(te===void 0)return new Error("Malformed OpenSSH private key");h=yu(v,S),_=Eu(v,S),g=TS(v,S,M,R,J,te),p="sha1";break}case"ssh-dss":{let v=Le(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let S=Le(r,r._pos);if(S===void 0)return new Error("Malformed OpenSSH private key");let M=Le(r,r._pos);if(M===void 0)return new Error("Malformed OpenSSH private key");let R=Le(r,r._pos);if(R===void 0)return new Error("Malformed OpenSSH private key");let J=Le(r,r._pos);if(J===void 0)return new Error("Malformed OpenSSH private key");h=Au(v,S,M,R),_=bu(v,S,M,R),g=kS(v,S,M,R,J),p="sha1";break}case"ssh-ed25519":{if(!OE)return new Error(`Unsupported OpenSSH private key type: ${y}`);let v=Le(r,r._pos);if(v===void 0||v.length!==32)return new Error("Malformed OpenSSH private key");let S=Le(r,r._pos);if(S===void 0||S.length!==64)return new Error("Malformed OpenSSH private key");h=CS(v),_=RS(v),g=P4(xo(S,0,32)),p=null;break}case"ecdsa-sha2-nistp256":p="sha256",l="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":p===void 0&&(p="sha384",l="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(p===void 0&&(p="sha512",l="1.3.132.0.35"),!NE(r,1))return new Error("Malformed OpenSSH private key");let v=Le(r,r._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");let S=Le(r,r._pos);if(S===void 0)return new Error("Malformed OpenSSH private key");h=$E(l,v),_=DE(l,v),g=T4(l,v,S);break}default:return new Error(`Unsupported OpenSSH private key type: ${y}`)}let b=Le(r,r._pos,!0);if(b===void 0)return new Error("Malformed OpenSSH private key");o.push(new np(y,b,g,h,_,p,n))}let f=0;for(u=r._pos;u<r.length;++u)if(r[u]!==++f%255)return new Error("Malformed OpenSSH private key");return o};a(t,"parseOpenSSHPrivKeys");let e=/^-----BEGIN OPENSSH PRIVATE KEY-----(?:\r\n|\n)([\s\S]+)(?:\r\n|\n)-----END OPENSSH PRIVATE KEY-----$/;np.parse=(r,i)=>{let n=e.exec(r);if(n===null)return null;let o,s=Buffer.from(n[1],"base64");if(s.length<31)return new Error("Malformed OpenSSH private key");let c=s.utf8Slice(0,15);if(c!=="openssh-key-v1\0")return new Error(`Unsupported OpenSSH key magic: ${c}`);let u=Le(s,15,!0);if(u===void 0)return new Error("Malformed OpenSSH private key");if(u!=="none"&&S4.indexOf(u)===-1)return new Error(`Unsupported cipher for OpenSSH key: ${u}`);let l=Le(s,s._pos,!0);if(l===void 0)return new Error("Malformed OpenSSH private key");if(l!=="none"){if(u==="none")return new Error("Malformed OpenSSH private key");if(l!=="bcrypt")return new Error(`Unsupported kdf name for OpenSSH key: ${l}`);if(!i)return new Error("Encrypted private OpenSSH key detected, but no passphrase given")}else if(u!=="none")return new Error("Malformed OpenSSH private key");let f,p,g;u!=="none"&&(f=mu[u]);let h=Le(s,s._pos);if(h===void 0)return new Error("Malformed OpenSSH private key");if(h.length)switch(l){case"none":return new Error("Malformed OpenSSH private key");case"bcrypt":{let y=Le(h,0);if(y===void 0||h._pos+4>h.length)return new Error("Malformed OpenSSH private key");let b=hu(h,h._pos),v=Buffer.allocUnsafe(f.keyLen+f.ivLen);if(v4(i,i.length,y,y.length,v,v.length,b)!==0)return new Error("Failed to generate information to decrypt key");p=xo(v,0,f.keyLen),g=xo(v,f.keyLen,v.length);break}}else if(l!=="none")return new Error("Malformed OpenSSH private key");if(s._pos+3>=s.length)return new Error("Malformed OpenSSH private key");let _=hu(s,s._pos);if(s._pos+=4,_>0){for(let b=0;b<_;++b){let v=Le(s,s._pos);if(v===void 0)return new Error("Malformed OpenSSH private key");if(Le(v,0,!0)===void 0)return new Error("Malformed OpenSSH private key")}let y=Le(s,s._pos);if(y===void 0)return new Error("Malformed OpenSSH private key");if(p!==void 0){if(y.length<f.blockLen||y.length%f.blockLen!==0)return new Error("Malformed OpenSSH private key");try{let b={authTagLength:f.authLen},v=RE(f.sslName,p,g,b);if(v.setAutoPadding(!1),f.authLen>0){if(s.length-s._pos<f.authLen)return new Error("Malformed OpenSSH private key");v.setAuthTag(xo(s,s._pos,s._pos+=f.authLen))}y=_u(v.update(y),v.final())}catch(b){return b}}if(s._pos!==s.length)return new Error("Malformed OpenSSH private key");o=t(y,_,p!==void 0)}else o=[];return o instanceof Error?o:o[0]}}function ip(e,t,r,i,n,o,s){this.type=e,this.comment=t,this[vn]=r,this[$n]=i,this[ki]=n,this[ei]=o,this[Os]=s}a(ip,"OpenSSH_Old_Private");ip.prototype=xu;{let e=/^-----BEGIN (RSA|DSA|EC) PRIVATE KEY-----(?:\r\n|\n)((?:[^:]+:\s*[\S].*(?:\r\n|\n))*)([\s\S]+)(?:\r\n|\n)-----END (RSA|DSA|EC) PRIVATE KEY-----$/;ip.parse=(t,r)=>{let i=e.exec(t);if(i===null)return null;let n=Buffer.from(i[3],"base64"),o=i[2],s=!1;if(o!==void 0){o=o.split(/\r\n|\n/g);for(let _=0;_<o.length;++_){let y=o[_],b=y.indexOf(":");if(y.slice(0,b)==="DEK-Info"){let v=y.slice(b+2);if(b=v.indexOf(","),b===-1)continue;let S=v.slice(0,b).toLowerCase();if(I4.indexOf(S)===-1)return new Error(`Cipher (${S}) not supported for encrypted OpenSSH private key`);let M=CE[S];if(!M)return new Error(`Cipher (${S}) not supported for encrypted OpenSSH private key`);let R=Buffer.from(v.slice(b+1),"hex");if(R.length!==M.ivLen)return new Error("Malformed encrypted OpenSSH private key");if(!r)return new Error("Encrypted OpenSSH private key detected, but no passphrase given");let J=xo(R,0,8),te=gu("md5").update(r).update(J).digest();for(;te.length<M.keyLen;)te=_u(te,gu("md5").update(te).update(r).update(J).digest());te.length>M.keyLen&&(te=xo(te,0,M.keyLen));try{let ee=RE(S,te,R);ee.setAutoPadding(!1),n=_u(ee.update(n),ee.final()),s=!0}catch(ee){return ee}}}}let c,u,l,f,p,g,h="Malformed OpenSSH private key";switch(s&&(h+=". Bad passphrase?"),i[1]){case"RSA":c="ssh-rsa",u=Sn("RSA PRIVATE",n);try{g=new Fe.Reader(n),g.readSequence(),g.readInt();let _=g.readString(Fe.Integer,!0);if(_===null)return new Error(h);let y=g.readString(Fe.Integer,!0);if(y===null)return new Error(h);l=yu(_,y),f=Eu(_,y)}catch{return new Error(h)}p="sha1";break;case"DSA":c="ssh-dss",u=Sn("DSA PRIVATE",n);try{g=new Fe.Reader(n),g.readSequence(),g.readInt();let _=g.readString(Fe.Integer,!0);if(_===null)return new Error(h);let y=g.readString(Fe.Integer,!0);if(y===null)return new Error(h);let b=g.readString(Fe.Integer,!0);if(b===null)return new Error(h);let v=g.readString(Fe.Integer,!0);if(v===null)return new Error(h);l=Au(_,y,b,v),f=bu(_,y,b,v)}catch{return new Error(h)}p="sha1";break;case"EC":{let _,y,b;try{g=new Fe.Reader(n),g.readSequence(),g.readInt(),y=g.readString(Fe.OctetString,!0),g.readByte();let S=g.readLength();if(S!==null){if(g._offset=S,b=g.readOID(),b===null)return new Error(h);switch(b){case"1.2.840.10045.3.1.7":_="prime256v1",c="ecdsa-sha2-nistp256",p="sha256";break;case"1.3.132.0.34":_="secp384r1",c="ecdsa-sha2-nistp384",p="sha384";break;case"1.3.132.0.35":_="secp521r1",c="ecdsa-sha2-nistp521",p="sha512";break;default:return new Error(`Unsupported private key EC OID: ${b}`)}}else return new Error(h)}catch{return new Error(h)}u=Sn("EC PRIVATE",n);let v=k4(_,y);l=$E(b,v),f=DE(b,v);break}}return new ip(c,"",u,l,f,p,s)}}function op(e,t,r,i,n,o,s){this.type=e,this.comment=t,this[vn]=r,this[$n]=i,this[ki]=n,this[ei]=o,this[Os]=s}a(op,"PPK_Private");op.prototype=xu;{let e=Buffer.alloc(0),t=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r=Buffer.from([0,0,0,0]),i=Buffer.from([0,0,0,1]),n=/^PuTTY-User-Key-File-2: (ssh-(?:rsa|dss))\r?\nEncryption: (aes256-cbc|none)\r?\nComment: ([^\r\n]*)\r?\nPublic-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-Lines: \d+\r?\n([\s\S]+?)\r?\nPrivate-MAC: ([^\r\n]+)/;op.parse=(o,s)=>{let c=n.exec(o);if(c===null)return null;let u=c[2],l=u!=="none";if(l&&!s)return new Error("Encrypted PPK private key detected, but no passphrase given");let f=Buffer.from(c[5],"base64");if(l){let H=mu[u],U=_u(gu("sha1").update(r).update(s).digest(),gu("sha1").update(i).update(s).digest());U.length>H.keyLen&&(U=xo(U,0,H.keyLen));try{let k=RE(H.sslName,U,t);k.setAutoPadding(!1),f=_u(k.update(f),k.final())}catch(k){return k}}let p=c[1],g=c[3],h=Buffer.from(c[4],"base64"),_=c[6],y=p.length,b=u.length,v=Buffer.byteLength(g),S=h.length,M=f.length,R=Buffer.allocUnsafe(4+y+4+b+4+v+4+S+4+M),J=0;if(br(R,y,J),R.utf8Write(p,J+=4,y),br(R,b,J+=y),R.utf8Write(u,J+=4,b),br(R,v,J+=b),R.utf8Write(g,J+=4,v),br(R,S,J+=v),R.set(h,J+=4),br(R,M,J+=S),R.set(f,J+4),s||(s=e),E4("sha1",gu("sha1").update("putty-private-key-file-mac-key").update(s).digest()).update(R).digest("hex")!==_)return l?new Error("PPK private key integrity check failed -- bad passphrase?"):new Error("PPK private key integrity check failed");let ee,P,C;switch(h._pos=0,NE(h,1),p){case"ssh-rsa":{let H=Le(h,h._pos);if(H===void 0)return new Error("Malformed PPK public key");let U=Le(h,h._pos);if(U===void 0)return new Error("Malformed PPK public key");let k=Le(f,0);if(k===void 0)return new Error("Malformed PPK private key");let j=Le(f,f._pos);if(j===void 0)return new Error("Malformed PPK private key");let W=Le(f,f._pos);if(W===void 0)return new Error("Malformed PPK private key");let z=Le(f,f._pos);if(z===void 0)return new Error("Malformed PPK private key");ee=yu(U,H),P=Eu(U,H),C=TS(U,H,k,z,j,W);break}case"ssh-dss":{let H=Le(h,h._pos);if(H===void 0)return new Error("Malformed PPK public key");let U=Le(h,h._pos);if(U===void 0)return new Error("Malformed PPK public key");let k=Le(h,h._pos);if(k===void 0)return new Error("Malformed PPK public key");let j=Le(h,h._pos);if(j===void 0)return new Error("Malformed PPK public key");let W=Le(f,0);if(W===void 0)return new Error("Malformed PPK private key");ee=Au(H,U,k,j),P=bu(H,U,k,j),C=kS(H,U,k,j,W);break}}return new op(p,g,C,ee,P,"sha1",l)}}function ap(e,t,r,i,n){this.type=e,this.comment=t,this[vn]=null,this[$n]=r,this[ki]=i,this[ei]=n,this[Os]=!1}a(ap,"OpenSSH_Public");ap.prototype=xu;{let e;OE?e=/^(((?:ssh-(?:rsa|dss|ed25519))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/:e=/^(((?:ssh-(?:rsa|dss))|ecdsa-sha2-nistp(?:256|384|521))(?:-cert-v0[01]@openssh.com)?) ([A-Z0-9a-z/+=]+)(?:$|\s+([\S].*)?)$/,ap.parse=t=>{let r=e.exec(t);if(r===null)return null;let i=r[1],n=r[2],o=Buffer.from(r[3],"base64"),s=r[4]||"",c=Le(o,o._pos,!0);return c===void 0||c.indexOf(n)!==0?new Error("Malformed OpenSSH public key"):BE(o,n,s,i)}}function sp(e,t,r,i,n){this.type=e,this.comment=t,this[vn]=null,this[$n]=r,this[ki]=i,this[ei]=n,this[Os]=!1}a(sp,"RFC4716_Public");sp.prototype=xu;{let e=/^---- BEGIN SSH2 PUBLIC KEY ----(?:\r?\n)((?:.{0,72}\r?\n)+)---- END SSH2 PUBLIC KEY ----$/,t=/^[A-Z0-9a-z/+=\r\n]+$/,r=/^([\x21-\x39\x3B-\x7E]{1,64}): ((?:[^\\]*\\\r?\n)*[^\r\n]+)\r?\n/gm,i=/\\\r?\n/g;sp.parse=n=>{let o=e.exec(n);if(o===null)return null;let s=o[1],c=0,u="";for(;o=r.exec(s);){let h=o[1],_=o[2].replace(i,"");if(_.length>1024)return r.lastIndex=0,new Error("Malformed RFC4716 public key");c=r.lastIndex,h.toLowerCase()==="comment"&&(u=_,u.length>1&&u.charCodeAt(0)===34&&u.charCodeAt(u.length-1)===34&&(u=u.slice(1,-1)))}let l=s.slice(c);if(!t.test(l))return new Error("Malformed RFC4716 public key");l=Buffer.from(l,"base64");let f=Le(l,0,!0);if(f===void 0)return new Error("Malformed RFC4716 public key");let p=null,g=null;switch(f){case"ssh-rsa":{let h=Le(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=Le(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");p=yu(_,h),g=Eu(_,h);break}case"ssh-dss":{let h=Le(l,l._pos);if(h===void 0)return new Error("Malformed RFC4716 public key");let _=Le(l,l._pos);if(_===void 0)return new Error("Malformed RFC4716 public key");let y=Le(l,l._pos);if(y===void 0)return new Error("Malformed RFC4716 public key");let b=Le(l,l._pos);if(b===void 0)return new Error("Malformed RFC4716 public key");p=Au(h,_,y,b),g=bu(h,_,y,b);break}default:return new Error("Malformed RFC4716 public key")}return new sp(f,u,p,g,"sha1")}}function BE(e,t,r,i){if(!OS(t))return new Error(`Unsupported OpenSSH public key type: ${t}`);let n,o,s=null,c=null;switch(t){case"ssh-rsa":{let u=Le(e,e._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=Le(e,e._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");s=yu(l,u),c=Eu(l,u),n="sha1";break}case"ssh-dss":{let u=Le(e,e._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");let l=Le(e,e._pos);if(l===void 0)return new Error("Malformed OpenSSH public key");let f=Le(e,e._pos);if(f===void 0)return new Error("Malformed OpenSSH public key");let p=Le(e,e._pos);if(p===void 0)return new Error("Malformed OpenSSH public key");s=Au(u,l,f,p),c=bu(u,l,f,p),n="sha1";break}case"ssh-ed25519":{let u=Le(e,e._pos||0);if(u===void 0||u.length!==32)return new Error("Malformed OpenSSH public key");s=CS(u),c=RS(u),n=null;break}case"ecdsa-sha2-nistp256":n="sha256",o="1.2.840.10045.3.1.7";case"ecdsa-sha2-nistp384":n===void 0&&(n="sha384",o="1.3.132.0.34");case"ecdsa-sha2-nistp521":{if(n===void 0&&(n="sha512",o="1.3.132.0.35"),!NE(e,1))return new Error("Malformed OpenSSH public key");let u=Le(e,e._pos||0);if(u===void 0)return new Error("Malformed OpenSSH public key");s=$E(o,u),c=DE(o,u);break}default:return new Error(`Unsupported OpenSSH public key type: ${t}`)}return new ap(i,r,s,c,n)}a(BE,"parseDER");function OS(e){switch(e){case"ssh-rsa":case"ssh-dss":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":case"ecdsa-sha2-nistp521":return!0;case"ssh-ed25519":if(OE)return!0;default:return!1}}a(OS,"isSupportedKeyType");function NS(e){return e?typeof e[Os]=="boolean":!1}a(NS,"isParsedKey");function $S(e,t){if(NS(e))return e;let r;if(Buffer.isBuffer(e))r=e,e=e.utf8Slice(0,e.length).trim();else if(typeof e=="string")e=e.trim();else return new Error("Key data must be a Buffer or string");if(t!=null){if(typeof t=="string")t=Buffer.from(t);else if(!Buffer.isBuffer(t))return new Error("Passphrase must be a string or Buffer when supplied")}let i;if((i=np.parse(e,t))!==null||(i=ip.parse(e,t))!==null||(i=op.parse(e,t))!==null||(i=ap.parse(e))!==null||(i=sp.parse(e))!==null)return i;if(r){rp.init(r,0);let n=rp.readString(!0);n!==void 0&&(e=rp.readRaw(),e!==void 0&&(i=BE(e,n,"",n),i instanceof Error&&(i=null))),rp.clear()}return i||new Error("Unsupported key format")}a($S,"parseKey");DS.exports={isParsedKey:NS,isSupportedKeyType:OS,parseDERKey:a((e,t)=>BE(e,t,"",t),"parseDERKey"),parseKey:$S}});var HE=me((HQ,qS)=>{"use strict";var{Socket:US}=require("net"),{Duplex:MS}=require("stream"),{resolve:C4}=require("path"),{readFile:BS}=require("fs"),{execFile:R4,spawn:O4}=require("child_process"),{isParsedKey:zS,parseKey:Iu}=Ci(),{makeBufferParser:N4,readUInt32BE:FE,writeUInt32BE:Qr,writeUInt32LE:LS}=In();function vu(e){let t=!1;return(...r)=>{t||(t=!0,e(...r))}}a(vu,"once");function $4(e,t){let r=Buffer.allocUnsafe(e.length+t.length);return e.copy(r,0),t.copy(r,e.length),r}a($4,"concat");function LE(){}a(LE,"noop");var D4=Buffer.alloc(0),Kt=N4(),Su=class{static{a(this,"BaseAgent")}getIdentities(t){t(new Error("Missing getIdentities() implementation"))}sign(t,r,i,n){typeof i=="function"&&(n=i),n(new Error("Missing sign() implementation"))}},$s=class extends Su{static{a(this,"OpenSSHAgent")}constructor(t){super(),this.socketPath=t}getStream(t){t=vu(t);let r=new US;r.on("connect",()=>{t(null,r)}),r.on("close",i).on("end",i).on("error",i),r.connect(this.socketPath);function i(){try{r.destroy()}catch{}t(new Error("Failed to connect to agent"))}a(i,"onFail")}getIdentities(t){t=vu(t),this.getStream((r,i)=>{function n(s){if(i)try{i.destroy()}catch{}s||(s=new Error("Failed to retrieve identities from agent")),t(s)}if(a(n,"onFail"),r)return n(r);let o=new UE(!0);o.on("error",n),o.pipe(i).pipe(o),i.on("close",n).on("end",n).on("error",n),o.getIdentities((s,c)=>{if(s)return n(s);try{i.destroy()}catch{}t(null,c)})})}sign(t,r,i,n){typeof i=="function"?(n=i,i=void 0):(typeof i!="object"||i===null)&&(i=void 0),n=vu(n),this.getStream((o,s)=>{function c(l){if(s)try{s.destroy()}catch{}l||(l=new Error("Failed to sign data with agent")),n(l)}if(a(c,"onFail"),o)return c(o);let u=new UE(!0);u.on("error",c),u.pipe(s).pipe(u),s.on("close",c).on("end",c).on("error",c),u.sign(t,r,i,(l,f)=>{if(l)return c(l);try{s.destroy()}catch{}n(null,f)})})}},FS=(()=>{let s=C4(__dirname,"..","util/pagent.exe"),c={10:new Error("Invalid pagent.exe arguments"),11:new Error("Pageant is not running"),12:new Error("pagent.exe could not create an mmap"),13:new Error("pagent.exe could not set mode for stdin"),14:new Error("pagent.exe could not set mode for stdout"),15:new Error("pagent.exe did not get expected input payload")};function u(f){f.buffer=null,f.proc&&(f.proc.kill(),f.proc=void 0)}a(u,"destroy");class l extends MS{static{a(this,"PageantSocket")}constructor(){super(),this.proc=void 0,this.buffer=null}_read(p){}_write(p,g,h){if(this.buffer===null)this.buffer=p;else{let v=Buffer.allocUnsafe(this.buffer.length+p.length);this.buffer.copy(v,0),p.copy(v,this.buffer.length),this.buffer=v}if(this.buffer.length<4)return h();let _=FE(this.buffer,0);if(this.buffer.length-4<_)return h();if(p=this.buffer.slice(0,4+_),this.buffer.length>4+_)return h(new Error("Unexpected multiple agent requests"));this.buffer=null;let y,b=this.proc=O4(s,[p.length]);b.stdout.on("data",v=>{this.push(v)}),b.on("error",v=>{y=v,h(y)}),b.on("close",v=>{if(this.proc=void 0,!y){if(y=c[v])return h(y);h()}}),b.stdin.end(p)}_final(p){u(this),p()}_destroy(p,g){u(this),g()}}return class extends $s{static{a(this,"PageantAgent")}getStream(p){p(null,new l)}}})(),HS=(()=>{let e=/^!<socket >(\d+) s ([A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8})/;return class extends $s{static{a(this,"CygwinAgent")}getStream(r){r=vu(r);let i=this.socketPath,n=!1;BS(i,a(function o(s,c){if(s){if(n)return r(new Error("Invalid cygwin unix socket path"));R4("cygpath",["-w",i],(te,ee,P)=>{if(te||ee.length===0)return r(new Error("Invalid cygwin unix socket path"));n=!0,i=ee.toString().replace(/[\r\n]/g,""),BS(i,o)});return}let u=e.exec(c.toString("ascii"));if(!u)return r(new Error("Malformed cygwin unix socket file"));let l,f=0,p=!1,g=[],h,_=Buffer.alloc(12),y=parseInt(u[1],10),b=u[2].replace(/-/g,""),v=Buffer.allocUnsafe(16);for(let te=0,ee=0;ee<32;++te,ee+=2)v[te]=parseInt(b.substring(ee,ee+2),16);for(let te=0;te<16;te+=4)LS(v,FE(v,te),te);J();function S(){f=0,l="secret",h.write(v)}a(S,"_onconnect");function M(te){if(f+=te.length,l==="secret"){f===16&&(f=0,l="creds",h.write(_));return}if(l==="creds"&&(p||g.push(te),f===12)){if(h.removeListener("connect",S),h.removeListener("data",M),h.removeListener("error",R),h.removeListener("end",R),h.removeListener("close",R),p)return r(null,h);p=!0,_=Buffer.concat(g),LS(_,process.pid,0),h.on("error",()=>{}),h.destroy(),J()}}a(M,"_ondata");function R(){r(new Error("Problem negotiating cygwin unix socket security"))}a(R,"onFail");function J(){h=new US,h.on("connect",S),h.on("data",M),h.on("error",R),h.on("end",R),h.on("close",R),h.connect(y)}a(J,"tryConnect")},"readCygsocket"))}}})(),B4=/^[/\\][/\\]\.[/\\]pipe[/\\].+/;function jS(e){return process.platform==="win32"&&!B4.test(e)?e==="pageant"?new FS:new HS(e):new $s(e)}a(jS,"createAgent");var UE=(()=>{function l(P){let C;for(;P[S].length;){let H=P[S][0][p];if(H===void 0)break;P[S].shift(),C=P.push(H)}return C}a(l,"processResponses");let f=Symbol("Inbound Request Type"),p=Symbol("Inbound Request Response"),g=Symbol("Inbound Request Context");class h{static{a(this,"AgentInboundRequest")}constructor(C,H){this[f]=C,this[p]=void 0,this[g]=H}hasResponded(){return this[p]!==void 0}getType(){return this[f]}getContext(){return this[g]}}function _(P,C,H){return C[p]=H,l(P)}a(_,"respond");function y(P){if(P[R]=null,P[M]===0){let C=P[S];if(C&&C.length){P[S]=[];for(let H of C)H.cb(new Error("No reply from server"))}}try{P.end()}catch{}setImmediate(()=>{P[ee]||P.emit("end"),P[te]||P.emit("close")})}a(y,"cleanup");function b(){this[te]=!0}a(b,"onClose");function v(){this[ee]=!0}a(v,"onEnd");let S=Symbol("Requests"),M=Symbol("Agent Protocol Role"),R=Symbol("Agent Protocol Buffer"),J=Symbol("Agent Protocol Current Message Length"),te=Symbol("Agent Protocol Closed"),ee=Symbol("Agent Protocol Ended");return class extends MS{static{a(this,"AgentProtocol")}constructor(C){super({autoDestroy:!0,emitClose:!1}),this[M]=C?0:1,this[S]=[],this[R]=null,this[J]=-1,this.once("end",v),this.once("close",b)}_read(C){}_write(C,H,U){this[R]===null?this[R]=C:this[R]=$4(this[R],C);let k=this[R],j=k.length,W=0;for(;W<j&&!(j<5||(this[J]===-1&&(this[J]=FE(k,W)),j<4+this[J]));){let z=k[W+=4];if(++W,this[M]===0){if(this[S].length===0)return U(new Error("Received unexpected message from server"));let X=this[S].shift();switch(z){case 5:X.cb(new Error("Agent responded with failure"));break;case 12:{if(X.type!==11)return U(new Error("Agent responded with wrong message type"));Kt.init(k,W);let ne=Kt.readUInt32BE();if(ne===void 0)return Kt.clear(),U(new Error("Malformed agent response"));let O=[];for(let q=0;q<ne;++q){let V=Kt.readString();if(V===void 0)return Kt.clear(),U(new Error("Malformed agent response"));let re=Kt.readString(!0);if(re===void 0)return Kt.clear(),U(new Error("Malformed agent response"));V=Iu(V),!(V instanceof Error)&&(V.comment=V.comment||re,O.push(V))}W=Kt.pos(),Kt.clear(),X.cb(null,O);break}case 14:{if(X.type!==13)return U(new Error("Agent responded with wrong message type"));Kt.init(k,W);let ne=Kt.readString();if(W=Kt.pos(),Kt.clear(),ne===void 0)return U(new Error("Malformed agent response"));if(Kt.init(ne,0),Kt.readString(!0),ne=Kt.readString(),Kt.clear(),ne===void 0)return U(new Error("Malformed OpenSSH signature format"));X.cb(null,ne);break}default:return U(new Error("Agent responded with unsupported message type"))}}else switch(z){case 11:{let X=new h(z);this[S].push(X),this.emit("identities",X);break}case 13:{Kt.init(k,W);let X=Kt.readString(),ne=Kt.readString(),O=Kt.readUInt32BE();if(W=Kt.pos(),Kt.clear(),O===void 0){let _e=new h(z);return this[S].push(_e),this.failureReply(_e)}if(X=Iu(X),X instanceof Error){let _e=new h(z);return this[S].push(_e),this.failureReply(_e)}let q={hash:void 0},V;X.type==="ssh-rsa"&&(O&2?(V="rsa-sha2-256",q.hash="sha256"):O&4&&(V="rsa-sha2-512",q.hash="sha512")),V===void 0&&(V=X.type);let re=new h(z,V);this[S].push(re),this.emit("sign",re,X,ne,q);break}default:{let X=new h(z);this[S].push(X),this.failureReply(X)}}if(this[J]=-1,W===j){this[R]=null;break}else this[R]=k=k.slice(W),j=k.length,W=0}U()}_destroy(C,H){y(this),H()}_final(C){y(this),C()}sign(C,H,U,k){if(this[M]!==0)throw new Error("Client-only method called with server role");typeof U=="function"?(k=U,U=void 0):(typeof U!="object"||U===null)&&(U=void 0);let j=0;if(C=Iu(C),C instanceof Error)throw new Error("Invalid public key argument");if(C.type==="ssh-rsa"&&U)switch(U.hash){case"sha256":j=2;break;case"sha512":j=4;break}C=C.getPublicSSH();let W=13,z=C.length,X=H.length,ne=0,O=Buffer.allocUnsafe(9+z+4+X+4);return Qr(O,O.length-4,ne),O[ne+=4]=W,Qr(O,z,++ne),C.copy(O,ne+=4),Qr(O,X,ne+=z),H.copy(O,ne+=4),Qr(O,j,ne+=X),typeof k!="function"&&(k=LE),this[S].push({type:W,cb:k}),this.push(O)}getIdentities(C){if(this[M]!==0)throw new Error("Client-only method called with server role");let H=11,U=0,k=Buffer.allocUnsafe(5);return Qr(k,k.length-4,U),k[U+=4]=H,typeof C!="function"&&(C=LE),this[S].push({type:H,cb:C}),this.push(k)}failureReply(C){if(this[M]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;let H=0,U=Buffer.allocUnsafe(5);return Qr(U,U.length-4,H),U[H+=4]=5,_(this,C,U)}getIdentitiesReply(C,H){if(this[M]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==11)throw new Error("Invalid response to request");if(!Array.isArray(H))throw new Error("Keys argument must be an array");let U=4,k=[];for(let z=0;z<H.length;++z){let X=H[z];if(typeof X!="object"||X===null)throw new Error(`Invalid key entry: ${X}`);let ne,O;if(zS(X))ne=X;else if(zS(X.pubKey))ne=X.pubKey;else if(typeof X.pubKey!="object"||X.pubKey===null||({pubKey:ne,comment:O}=X.pubKey,ne=Iu(ne),ne instanceof Error))continue;O=ne.comment||O,ne=ne.getPublicSSH(),U+=4+ne.length,O&&typeof O=="string"?O=Buffer.from(O):Buffer.isBuffer(O)||(O=D4),U+=4+O.length,k.push({pubKey:ne,comment:O})}let j=0,W=Buffer.allocUnsafe(5+U);Qr(W,W.length-4,j),W[j+=4]=12,Qr(W,k.length,++j),j+=4;for(let z=0;z<k.length;++z){let{pubKey:X,comment:ne}=k[z];Qr(W,X.length,j),X.copy(W,j+=4),Qr(W,ne.length,j+=X.length),j+=4,ne.length&&(ne.copy(W,j),j+=ne.length)}return _(this,C,W)}signReply(C,H){if(this[M]!==1)throw new Error("Server-only method called with client role");if(!(C instanceof h))throw new Error("Wrong request argument");if(C.hasResponded())return!0;if(C.getType()!==13)throw new Error("Invalid response to request");if(!Buffer.isBuffer(H))throw new Error("Signature argument must be a Buffer");if(H.length===0)throw new Error("Signature argument must be non-empty");let U=0,k=C.getContext(),j=Buffer.byteLength(k),W=Buffer.allocUnsafe(13+j+4+H.length);return Qr(W,W.length-4,U),W[U+=4]=14,Qr(W,4+j+4+H.length,++U),Qr(W,j,U+=4),W.utf8Write(k,U+=4,j),Qr(W,H.length,U+=j),H.copy(W,U+=4),_(this,C,W)}}})(),zE=Symbol("Agent"),wn=Symbol("Agent Keys"),ti=Symbol("Agent Keys Index"),Ns=Symbol("Agent Init Callbacks"),ME=class{static{a(this,"AgentContext")}constructor(t){if(typeof t=="string")t=jS(t);else if(!WS(t))throw new Error("Invalid agent argument");this[zE]=t,this[wn]=null,this[ti]=-1,this[Ns]=null}init(t){if(typeof t!="function"&&(t=LE),this[wn]===null)if(this[Ns]===null){this[Ns]=[t];let r=a((...i)=>{process.nextTick(()=>{let n=this[Ns];this[Ns]=null;for(let o of n)o(...i)})},"doCbs");this[zE].getIdentities(vu((i,n)=>{if(i)return r(i);if(!Array.isArray(n))return r(new Error("Agent implementation failed to provide keys"));let o=[];for(let s of n)s=Iu(s),!(s instanceof Error)&&o.push(s);this[wn]=o,this[ti]=-1,r()}))}else this[Ns].push(t);else process.nextTick(t)}nextKey(){return this[wn]===null||++this[ti]>=this[wn].length?!1:this[wn][this[ti]]}currentKey(){return this[wn]===null||this[ti]>=this[wn].length?null:this[wn][this[ti]]}pos(){return this[wn]===null||this[ti]>=this[wn].length?-1:this[ti]}reset(){this[ti]=-1}sign(...t){this[zE].sign(...t)}};function WS(e){return e instanceof Su}a(WS,"isAgent");qS.exports={AgentContext:ME,AgentProtocol:UE,BaseAgent:Su,createAgent:jS,CygwinAgent:HS,isAgent:WS,OpenSSHAgent:$s,PageantAgent:FS}});var QE=me((WQ,VS)=>{"use strict";var{kMaxLength:z4}=require("buffer"),{createInflate:L4,constants:{DEFLATE:U4,INFLATE:M4,Z_DEFAULT_CHUNK:F4,Z_DEFAULT_COMPRESSION:H4,Z_DEFAULT_MEMLEVEL:j4,Z_DEFAULT_STRATEGY:W4,Z_DEFAULT_WINDOWBITS:q4,Z_PARTIAL_FLUSH:V4}}=require("zlib"),Z4=L4()._handle.constructor;function Q4(){throw new Error("Should not get here")}a(Q4,"processCallback");function K4(e,t,r){let i=this._owner,n=new Error(e);n.errno=t,n.code=r,i._err=n}a(K4,"zlibOnError");function ZE(e){e._handle&&(e._handle.close(),e._handle=null)}a(ZE,"_close");var cp=class{static{a(this,"Zlib")}constructor(t){let r=q4,i=H4,n=j4,o=W4,s=void 0;this._err=void 0,this._writeState=new Uint32Array(2),this._chunkSize=F4,this._maxOutputLength=z4,this._outBuffer=Buffer.allocUnsafe(this._chunkSize),this._outOffset=0,this._handle=new Z4(t),this._handle._owner=this,this._handle.onerror=K4,this._handle.init(r,i,n,o,this._writeState,Q4,s)}writeSync(t,r){let i=this._handle;if(!i)throw new Error("Invalid Zlib instance");let n=t.length,o=this._chunkSize-this._outOffset,s=0,c,u,l,f=0,p=this._writeState,g=this._outBuffer,h=this._outOffset,_=this._chunkSize;for(;;){if(i.writeSync(V4,t,s,n,g,h,o),this._err)throw this._err;c=p[0],u=p[1];let b=n-u,v=o-c;if(v>0){let S=h===0&&v===g.length?g:g.slice(h,h+v);if(h+=v,l?l.push===void 0?l=[l,S]:l.push(S):l=S,f+=S.byteLength,f>this._maxOutputLength)throw ZE(this),new Error(`Output length exceeded maximum of ${this._maxOutputLength}`)}else if(v!==0)throw new Error("have should not go down");if((c===0||h>=_)&&(o=_,h=0,g=Buffer.allocUnsafe(_)),c===0)s+=b,n=u;else break}if(this._outBuffer=g,this._outOffset=h,f===0&&(l=Buffer.alloc(0)),r)return l.totalLen=f,l;if(l.push===void 0)return l;let y=Buffer.allocUnsafe(f);for(let b=0,v=0;b<l.length;++b){let S=l[b];y.set(S,v),v+=S.length}return y}},jE=class{static{a(this,"ZlibPacketWriter")}constructor(t){this.allocStart=0,this.allocStartKEX=0,this._protocol=t,this._zlib=new cp(U4)}cleanup(){this._zlib&&ZE(this._zlib)}alloc(t,r){return Buffer.allocUnsafe(t)}finalize(t,r){if(this._protocol._kexinit===void 0||r){let i=this._zlib.writeSync(t,!0),n=this._protocol._cipher.allocPacket(i.totalLen);if(i.push===void 0)n.set(i,5);else for(let o=0,s=5;o<i.length;++o){let c=i[o];n.set(c,s),s+=c.length}return n}return t}},WE=class{static{a(this,"PacketWriter")}constructor(t){this.allocStart=5,this.allocStartKEX=5,this._protocol=t}cleanup(){}alloc(t,r){return this._protocol._kexinit===void 0||r?this._protocol._cipher.allocPacket(t):Buffer.allocUnsafe(t)}finalize(t,r){return t}},qE=class{static{a(this,"ZlibPacketReader")}constructor(){this._zlib=new cp(M4)}cleanup(){this._zlib&&ZE(this._zlib)}read(t){return this._zlib.writeSync(t,!1)}},VE=class{static{a(this,"PacketReader")}cleanup(){}read(t){return t}};VS.exports={PacketReader:VE,PacketWriter:WE,ZlibPacketReader:qE,ZlibPacketWriter:jE}});var YS=me((VQ,GS)=>{"use strict";var{bufferSlice:KE,bufferParser:B,doFatalError:Lt,sigSSHToASN1:ZS,writeUInt32BE:QS}=In(),{CHANNEL_OPEN_FAILURE:G4,COMPAT:Y4,MESSAGE:Ut,TERMINAL_MODE:KS}=Jn(),{parseKey:X4}=Ci(),J4=Array.from(Object.entries(KS)).reduce((e,[t,r])=>({...e,[t]:r}),{});GS.exports={[Ut.DISCONNECT]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readString(!0),n=B.readString();if(B.clear(),n===void 0)return Lt(e,"Inbound: Malformed DISCONNECT packet");e._debug&&e._debug(`Inbound: Received DISCONNECT (${r}, "${i}")`);let o=e._handlers.DISCONNECT;o&&o(e,r,i)},[Ut.IGNORE]:(e,t)=>{e._debug&&e._debug("Inbound: Received IGNORE")},[Ut.UNIMPLEMENTED]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return Lt(e,"Inbound: Malformed UNIMPLEMENTED packet");e._debug&&e._debug(`Inbound: Received UNIMPLEMENTED (seqno ${r})`)},[Ut.DEBUG]:(e,t)=>{B.init(t,1);let r=B.readBool(),i=B.readString(!0),n=B.readString();if(B.clear(),n===void 0)return Lt(e,"Inbound: Malformed DEBUG packet");e._debug&&e._debug("Inbound: Received DEBUG");let o=e._handlers.DEBUG;o&&o(e,r,i)},[Ut.SERVICE_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readString(!0);if(B.clear(),r===void 0)return Lt(e,"Inbound: Malformed SERVICE_REQUEST packet");e._debug&&e._debug(`Inbound: Received SERVICE_REQUEST (${r})`);let i=e._handlers.SERVICE_REQUEST;i&&i(e,r)},[Ut.SERVICE_ACCEPT]:(e,t)=>{B.init(t,1);let r=B.readString(!0);if(B.clear(),r===void 0)return Lt(e,"Inbound: Malformed SERVICE_ACCEPT packet");e._debug&&e._debug(`Inbound: Received SERVICE_ACCEPT (${r})`);let i=e._handlers.SERVICE_ACCEPT;i&&i(e,r)},[Ut.EXT_INFO]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i;if(r!==void 0){i=[];for(let o=0;o<r;++o){let s=B.readString(!0),c=B.readString();if(c!==void 0)if(s==="server-sig-algs"){let u=c.latin1Slice(0,c.length).split(",");i.push({name:s,algs:u});continue}else continue;i=void 0;break}}if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed EXT_INFO packet");e._debug&&e._debug("Inbound: Received EXT_INFO");let n=e._handlers.EXT_INFO;n&&n(e,i)},[Ut.USERAUTH_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readString(!0),n=B.readString(!0),o,s;switch(n){case"none":o=null;break;case"password":{let u=B.readBool();if(u!==void 0&&(o=B.readString(!0),o!==void 0&&u)){let l=B.readString(!0);l!==void 0?o={oldPassword:o,newPassword:l}:o=void 0}break}case"publickey":{let u=B.readBool();if(u!==void 0){let l=B.readString(!0),f=l,p=B.readString(),g;switch(l){case"rsa-sha2-256":f="ssh-rsa",g="sha256";break;case"rsa-sha2-512":f="ssh-rsa",g="sha512";break}if(u){let h=B.pos(),_=B.readString();if(_!==void 0&&(_.length>4+l.length+4&&_.utf8Slice(4,4+l.length)===l&&(_=KE(_,4+l.length+4)),_=ZS(_,f),_)){let y=e._kex.sessionID,b=Buffer.allocUnsafe(4+y.length+h);QS(b,y.length,0),b.set(y,4),b.set(new Uint8Array(t.buffer,t.byteOffset,h),4+y.length),o={keyAlgo:f,key:p,signature:_,blob:b,hashAlgo:g}}}else o={keyAlgo:f,key:p,hashAlgo:g},s="publickey -- check"}break}case"hostbased":{let u=B.readString(!0),l=u,f=B.readString(),p=B.readString(!0),g=B.readString(!0),h;switch(u){case"rsa-sha2-256":l="ssh-rsa",h="sha256";break;case"rsa-sha2-512":l="ssh-rsa",h="sha512";break}let _=B.pos(),y=B.readString();if(y!==void 0&&(y.length>4+u.length+4&&y.utf8Slice(4,4+u.length)===u&&(y=KE(y,4+u.length+4)),y=ZS(y,l),y!==void 0)){let b=e._kex.sessionID,v=Buffer.allocUnsafe(4+b.length+_);QS(v,b.length,0),v.set(b,4),v.set(new Uint8Array(t.buffer,t.byteOffset,_),4+b.length),o={keyAlgo:l,key:f,signature:y,blob:v,localHostname:p,localUsername:g,hashAlgo:h}}break}case"keyboard-interactive":B.skipString(),o=B.readList();break;default:n!==void 0&&(o=B.readRaw())}if(B.clear(),o===void 0)return Lt(e,"Inbound: Malformed USERAUTH_REQUEST packet");s===void 0&&(s=n),e._authsQueue.push(n),e._debug&&e._debug(`Inbound: Received USERAUTH_REQUEST (${s})`);let c=e._handlers.USERAUTH_REQUEST;c&&c(e,r,i,n,o)},[Ut.USERAUTH_FAILURE]:(e,t)=>{B.init(t,1);let r=B.readList(),i=B.readBool();if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed USERAUTH_FAILURE packet");e._debug&&e._debug(`Inbound: Received USERAUTH_FAILURE (${r})`),e._authsQueue.shift();let n=e._handlers.USERAUTH_FAILURE;n&&n(e,r,i)},[Ut.USERAUTH_SUCCESS]:(e,t)=>{e._debug&&e._debug("Inbound: Received USERAUTH_SUCCESS"),e._authsQueue.shift();let r=e._handlers.USERAUTH_SUCCESS;r&&r(e)},[Ut.USERAUTH_BANNER]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readString();if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed USERAUTH_BANNER packet");e._debug&&e._debug("Inbound: Received USERAUTH_BANNER");let n=e._handlers.USERAUTH_BANNER;n&&n(e,r)},60:(e,t)=>{if(!e._authsQueue.length){e._debug&&e._debug("Inbound: Received payload type 60 without auth");return}switch(e._authsQueue[0]){case"password":{B.init(t,1);let r=B.readString(!0),i=B.readString();if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed USERAUTH_PASSWD_CHANGEREQ packet");e._debug&&e._debug("Inbound: Received USERAUTH_PASSWD_CHANGEREQ");let n=e._handlers.USERAUTH_PASSWD_CHANGEREQ;n&&n(e,r);break}case"publickey":{B.init(t,1);let r=B.readString(!0),i=B.readString();if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed USERAUTH_PK_OK packet");e._debug&&e._debug("Inbound: Received USERAUTH_PK_OK"),e._authsQueue.shift();let n=e._handlers.USERAUTH_PK_OK;n&&n(e,r,i);break}case"keyboard-interactive":{B.init(t,1);let r=B.readString(!0),i=B.readString(!0);B.readString();let n=B.readUInt32BE(),o;if(n!==void 0){o=new Array(n);let c;for(c=0;c<n;++c){let u=B.readString(!0),l=B.readBool();if(l===void 0)break;o[c]={prompt:u,echo:l}}c!==n&&(o=void 0)}if(B.clear(),o===void 0)return Lt(e,"Inbound: Malformed USERAUTH_INFO_REQUEST packet");e._debug&&e._debug("Inbound: Received USERAUTH_INFO_REQUEST");let s=e._handlers.USERAUTH_INFO_REQUEST;s&&s(e,r,i,o);break}default:e._debug&&e._debug("Inbound: Received unexpected payload type 60")}},61:(e,t)=>{if(!e._authsQueue.length){e._debug&&e._debug("Inbound: Received payload type 61 without auth");return}if(e._authsQueue[0]!=="keyboard-interactive")return Lt(e,"Inbound: Received unexpected payload type 61");B.init(t,1);let r=B.readUInt32BE(),i;if(r!==void 0){i=new Array(r);let o;for(o=0;o<r;++o){let s=B.readString(!0);if(s===void 0)break;i[o]=s}o!==r&&(i=void 0)}if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed USERAUTH_INFO_RESPONSE packet");e._debug&&e._debug("Inbound: Received USERAUTH_INFO_RESPONSE");let n=e._handlers.USERAUTH_INFO_RESPONSE;n&&n(e,i)},[Ut.GLOBAL_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readBool(),n;if(i!==void 0)switch(r){case"tcpip-forward":case"cancel-tcpip-forward":{let s=B.readString(!0),c=B.readUInt32BE();c!==void 0&&(n={bindAddr:s,bindPort:c});break}case"streamlocal-forward@openssh.com":case"cancel-streamlocal-forward@openssh.com":{let s=B.readString(!0);s!==void 0&&(n={socketPath:s});break}case"no-more-sessions@openssh.com":n=null;break;case"hostkeys-00@openssh.com":{for(n=[];B.avail()>0;){let s=B.readString();if(s===void 0){n=void 0;break}let c=X4(s);c instanceof Error||n.push(c)}break}default:n=B.readRaw()}if(B.clear(),n===void 0)return Lt(e,"Inbound: Malformed GLOBAL_REQUEST packet");e._debug&&e._debug(`Inbound: GLOBAL_REQUEST (${r})`);let o=e._handlers.GLOBAL_REQUEST;o?o(e,r,i,n):e.requestFailure()},[Ut.REQUEST_SUCCESS]:(e,t)=>{let r=t.length>1?KE(t,1):null;e._debug&&e._debug("Inbound: REQUEST_SUCCESS");let i=e._handlers.REQUEST_SUCCESS;i&&i(e,r)},[Ut.REQUEST_FAILURE]:(e,t)=>{e._debug&&e._debug("Inbound: Received REQUEST_FAILURE");let r=e._handlers.REQUEST_FAILURE;r&&r(e)},[Ut.CHANNEL_OPEN]:(e,t)=>{B.init(t,1);let r=B.readString(!0),i=B.readUInt32BE(),n=B.readUInt32BE(),o=B.readUInt32BE(),s;switch(r){case"forwarded-tcpip":case"direct-tcpip":{let u=B.readString(!0),l=B.readUInt32BE(),f=B.readString(!0),p=B.readUInt32BE();p!==void 0&&(s={type:r,sender:i,window:n,packetSize:o,data:{destIP:u,destPort:l,srcIP:f,srcPort:p}});break}case"forwarded-streamlocal@openssh.com":case"direct-streamlocal@openssh.com":{let u=B.readString(!0);u!==void 0&&(s={type:r,sender:i,window:n,packetSize:o,data:{socketPath:u}});break}case"x11":{let u=B.readString(!0),l=B.readUInt32BE();l!==void 0&&(s={type:r,sender:i,window:n,packetSize:o,data:{srcIP:u,srcPort:l}});break}default:s={type:r,sender:i,window:n,packetSize:o,data:{}}}if(B.clear(),s===void 0)return Lt(e,"Inbound: Malformed CHANNEL_OPEN packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN (s:${i}, ${r})`);let c=e._handlers.CHANNEL_OPEN;c?c(e,s):e.channelOpenFail(s.sender,G4.ADMINISTRATIVELY_PROHIBITED,"","")},[Ut.CHANNEL_OPEN_CONFIRMATION]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE(),n=B.readUInt32BE(),o=B.readUInt32BE(),s=B.avail()?B.readRaw():void 0;if(B.clear(),o===void 0)return Lt(e,"Inbound: Malformed CHANNEL_OPEN_CONFIRMATION packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN_CONFIRMATION (r:${r}, s:${i})`);let c=e._handlers.CHANNEL_OPEN_CONFIRMATION;c&&c(e,{recipient:r,sender:i,window:n,packetSize:o,data:s})},[Ut.CHANNEL_OPEN_FAILURE]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE(),n=B.readString(!0),o=B.readString();if(B.clear(),o===void 0)return Lt(e,"Inbound: Malformed CHANNEL_OPEN_FAILURE packet");e._debug&&e._debug(`Inbound: CHANNEL_OPEN_FAILURE (r:${r})`);let s=e._handlers.CHANNEL_OPEN_FAILURE;s&&s(e,r,i,n)},[Ut.CHANNEL_WINDOW_ADJUST]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE();if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed CHANNEL_WINDOW_ADJUST packet");e._debug&&e._debug(`Inbound: CHANNEL_WINDOW_ADJUST (r:${r}, ${i})`);let n=e._handlers.CHANNEL_WINDOW_ADJUST;n&&n(e,r,i)},[Ut.CHANNEL_DATA]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readString();if(B.clear(),i===void 0)return Lt(e,"Inbound: Malformed CHANNEL_DATA packet");e._debug&&e._debug(`Inbound: CHANNEL_DATA (r:${r}, ${i.length})`);let n=e._handlers.CHANNEL_DATA;n&&n(e,r,i)},[Ut.CHANNEL_EXTENDED_DATA]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readUInt32BE(),n=B.readString();if(B.clear(),n===void 0)return Lt(e,"Inbound: Malformed CHANNEL_EXTENDED_DATA packet");e._debug&&e._debug(`Inbound: CHANNEL_EXTENDED_DATA (r:${r}, ${n.length})`);let o=e._handlers.CHANNEL_EXTENDED_DATA;o&&o(e,r,n,i)},[Ut.CHANNEL_EOF]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return Lt(e,"Inbound: Malformed CHANNEL_EOF packet");e._debug&&e._debug(`Inbound: CHANNEL_EOF (r:${r})`);let i=e._handlers.CHANNEL_EOF;i&&i(e,r)},[Ut.CHANNEL_CLOSE]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return Lt(e,"Inbound: Malformed CHANNEL_CLOSE packet");e._debug&&e._debug(`Inbound: CHANNEL_CLOSE (r:${r})`);let i=e._handlers.CHANNEL_CLOSE;i&&i(e,r)},[Ut.CHANNEL_REQUEST]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE(),i=B.readString(!0),n=B.readBool(),o;if(n!==void 0)switch(i){case"exit-status":o=B.readUInt32BE(),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"exit-signal":{let c,u;if(e._compatFlags&Y4.OLD_EXIT){let f=B.readUInt32BE();switch(f){case 1:c="HUP";break;case 2:c="INT";break;case 3:c="QUIT";break;case 6:c="ABRT";break;case 9:c="KILL";break;case 14:c="ALRM";break;case 15:c="TERM";break;default:f!==void 0&&(c=`UNKNOWN (${f})`)}u=!1}else c=B.readString(!0),u=B.readBool(),u===void 0&&(c=void 0);let l=B.readString(!0);B.skipString()!==void 0&&(o={signal:c,coreDumped:u,errorMessage:l}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${c})`);break}case"pty-req":{let c=B.readString(!0),u=B.readUInt32BE(),l=B.readUInt32BE(),f=B.readUInt32BE(),p=B.readUInt32BE(),g=B.readString();if(g!==void 0){B.init(g,1);let h={};for(;B.avail();){let _=B.readByte();if(_===KS.TTY_OP_END)break;let y=J4[_],b=B.readUInt32BE();if(_===void 0||y===void 0||b===void 0){h=void 0;break}h[y]=b}h!==void 0&&(o={term:c,cols:u,rows:l,width:f,height:p,modes:h})}e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break}case"window-change":{let c=B.readUInt32BE(),u=B.readUInt32BE(),l=B.readUInt32BE(),f=B.readUInt32BE();f!==void 0&&(o={cols:c,rows:u,width:l,height:f}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break}case"x11-req":{let c=B.readBool(),u=B.readString(!0),l=B.readString(),f=B.readUInt32BE();f!==void 0&&(o={single:c,protocol:u,cookie:l,screen:f}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break}case"env":{let c=B.readString(!0),u=B.readString(!0);u!==void 0&&(o={name:c,value:u}),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${c}=${u})`);break}case"shell":o=null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break;case"exec":o=B.readString(!0),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"subsystem":o=B.readString(!0),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"signal":o=B.readString(!0),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"xon-xoff":o=B.readBool(),e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i}: ${o})`);break;case"auth-agent-req@openssh.com":o=null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`);break;default:o=B.avail()?B.readRaw():null,e._debug&&e._debug(`Inbound: CHANNEL_REQUEST (r:${r}, ${i})`)}if(B.clear(),o===void 0)return Lt(e,"Inbound: Malformed CHANNEL_REQUEST packet");let s=e._handlers.CHANNEL_REQUEST;s&&s(e,r,i,n,o)},[Ut.CHANNEL_SUCCESS]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return Lt(e,"Inbound: Malformed CHANNEL_SUCCESS packet");e._debug&&e._debug(`Inbound: CHANNEL_SUCCESS (r:${r})`);let i=e._handlers.CHANNEL_SUCCESS;i&&i(e,r)},[Ut.CHANNEL_FAILURE]:(e,t)=>{B.init(t,1);let r=B.readUInt32BE();if(B.clear(),r===void 0)return Lt(e,"Inbound: Malformed CHANNEL_FAILURE packet");e._debug&&e._debug(`Inbound: CHANNEL_FAILURE (r:${r})`);let i=e._handlers.CHANNEL_FAILURE;i&&i(e,r)}}});var up=me((ZQ,XS)=>{"use strict";var GE=new Array(256);[lp().HANDLERS,YS()].forEach(e=>{for(let[t,r]of Object.entries(e))t=+t,isFinite(t)&&t>=0&&t<GE.length&&(GE[t]=r)});XS.exports=GE});var lp=me((KQ,cw)=>{"use strict";var{createDiffieHellman:eD,createDiffieHellmanGroup:tD,createECDH:rD,createHash:XE,createPublicKey:nD,diffieHellman:iD,generateKeyPairSync:oD,randomFillSync:sD}=require("crypto"),{Ber:JS}=cu(),{COMPAT:JE,curve25519Supported:aD,DEFAULT_KEX:ew,DEFAULT_SERVER_HOST_KEY:tw,DEFAULT_CIPHER:fp,DEFAULT_MAC:dp,DEFAULT_COMPRESSION:pp,DISCONNECT_REASON:dt,MESSAGE:Bt}=Jn(),{CIPHER_INFO:zs,createCipher:cD,createDecipher:uD,MAC_INFO:rw}=Pi(),{parseDERKey:lD}=Ci(),{bufferFill:fD,bufferParser:ft,convertSignature:dD,doFatalError:pt,FastBuffer:pD,sigSSHToASN1:hD,writeUInt32BE:xr}=In(),{PacketReader:nw,PacketWriter:iw,ZlibPacketReader:hp,ZlibPacketWriter:gp}=QE(),Ds,gD=2048,mD=8192,_D=Buffer.alloc(0);function ow(e){let t;if(e._compatFlags&JE.BAD_DHGEX){let r=e._offer.lists.kex,i=r.array,n=!1;for(let o=0;o<i.length;++o)i[o].includes("group-exchange")&&(n||(n=!0,i=i.slice()),i.splice(o--,1));if(n){let o=17+e._offer.totalSize+1+4,s=Buffer.from(i.join(","));o-=r.buffer.length-s.length;let c=e._offer.lists.all,u=new Uint8Array(c.buffer,c.byteOffset+4+r.buffer.length,c.length-(4+r.buffer.length));t=Buffer.allocUnsafe(o),xr(t,s.length,17),t.set(s,21),t.set(u,21+s.length)}}t===void 0&&(t=Buffer.allocUnsafe(17+e._offer.totalSize+1+4),e._offer.copyAllTo(t,17)),e._debug&&e._debug("Outbound: Sending KEXINIT"),t[0]=Bt.KEXINIT,sD(t,1,16),fD(t,0,t.length-5),e._kexinit=t,e._packetRW.write.allocStart=0;{let r=e._packetRW.write.allocStartKEX,i=e._packetRW.write.alloc(t.length,!0);i.set(t,r),e._cipher.encrypt(e._packetRW.write.finalize(i,!0))}}a(ow,"kexinit");function sw(e,t){let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0}};if(ft.init(t,17),(r.kex=ft.readList())===void 0||(r.serverHostKey=ft.readList())===void 0||(r.cs.cipher=ft.readList())===void 0||(r.sc.cipher=ft.readList())===void 0||(r.cs.mac=ft.readList())===void 0||(r.sc.mac=ft.readList())===void 0||(r.cs.compress=ft.readList())===void 0||(r.sc.compress=ft.readList())===void 0||(r.cs.lang=ft.readList())===void 0||(r.sc.lang=ft.readList())===void 0)return ft.clear(),pt(e,"Received malformed KEXINIT","handshake",dt.KEY_EXCHANGE_FAILED);let i=ft.pos(),n=i<t.length&&t[i]===1;ft.clear();let o=e._offer,s=r,c=o.lists.kex.array;if(e._compatFlags&JE.BAD_DHGEX){let R=!1;for(let J=0;J<c.length;++J)c[J].indexOf("group-exchange")!==-1&&(R||(R=!0,c=c.slice()),c.splice(J--,1))}let u,l,f,p=e._debug;p&&p("Inbound: Handshake in progress"),p&&p(`Handshake: (local) KEX method: ${c}`),p&&p(`Handshake: (remote) KEX method: ${s.kex}`);let g;if(e._server?(l=c,u=s.kex,g=u.indexOf("ext-info-c")!==-1):(l=s.kex,u=c,g=l.indexOf("ext-info-s")!==-1),e._strictMode===void 0&&(e._server?e._strictMode=u.indexOf("kex-strict-c-v00@openssh.com")!==-1:e._strictMode=l.indexOf("kex-strict-s-v00@openssh.com")!==-1,e._strictMode&&(p&&p("Handshake: strict KEX mode enabled"),e._decipher.inSeqno!==1)))return p&&p("Handshake: KEXINIT not first packet in strict KEX mode"),pt(e,"Handshake failed: KEXINIT not first packet in strict KEX mode","handshake",dt.KEY_EXCHANGE_FAILED);for(f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: no matching key exchange algorithm"),pt(e,"Handshake failed: no matching key exchange algorithm","handshake",dt.KEY_EXCHANGE_FAILED);r.kex=u[f],p&&p(`Handshake: KEX algorithm: ${u[f]}`),n&&(!s.kex.length||u[f]!==s.kex[0])&&(e._skipNextInboundPacket=!0);let h=o.lists.serverHostKey.array;for(p&&p(`Handshake: (local) Host key format: ${h}`),p&&p(`Handshake: (remote) Host key format: ${s.serverHostKey}`),e._server?(l=h,u=s.serverHostKey):(l=s.serverHostKey,u=h),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching host key format"),pt(e,"Handshake failed: no matching host key format","handshake",dt.KEY_EXCHANGE_FAILED);r.serverHostKey=u[f],p&&p(`Handshake: Host key format: ${u[f]}`);let _=o.lists.cs.cipher.array;for(p&&p(`Handshake: (local) C->S cipher: ${_}`),p&&p(`Handshake: (remote) C->S cipher: ${s.cs.cipher}`),e._server?(l=_,u=s.cs.cipher):(l=s.cs.cipher,u=_),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching C->S cipher"),pt(e,"Handshake failed: no matching C->S cipher","handshake",dt.KEY_EXCHANGE_FAILED);r.cs.cipher=u[f],p&&p(`Handshake: C->S Cipher: ${u[f]}`);let y=o.lists.sc.cipher.array;for(p&&p(`Handshake: (local) S->C cipher: ${y}`),p&&p(`Handshake: (remote) S->C cipher: ${s.sc.cipher}`),e._server?(l=y,u=s.sc.cipher):(l=s.sc.cipher,u=y),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching S->C cipher"),pt(e,"Handshake failed: no matching S->C cipher","handshake",dt.KEY_EXCHANGE_FAILED);r.sc.cipher=u[f],p&&p(`Handshake: S->C cipher: ${u[f]}`);let b=o.lists.cs.mac.array;if(p&&p(`Handshake: (local) C->S MAC: ${b}`),p&&p(`Handshake: (remote) C->S MAC: ${s.cs.mac}`),zs[r.cs.cipher].authLen>0)r.cs.mac="",p&&p("Handshake: C->S MAC: <implicit>");else{for(e._server?(l=b,u=s.cs.mac):(l=s.cs.mac,u=b),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching C->S MAC"),pt(e,"Handshake failed: no matching C->S MAC","handshake",dt.KEY_EXCHANGE_FAILED);r.cs.mac=u[f],p&&p(`Handshake: C->S MAC: ${u[f]}`)}let v=o.lists.sc.mac.array;if(p&&p(`Handshake: (local) S->C MAC: ${v}`),p&&p(`Handshake: (remote) S->C MAC: ${s.sc.mac}`),zs[r.sc.cipher].authLen>0)r.sc.mac="",p&&p("Handshake: S->C MAC: <implicit>");else{for(e._server?(l=v,u=s.sc.mac):(l=s.sc.mac,u=v),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching S->C MAC"),pt(e,"Handshake failed: no matching S->C MAC","handshake",dt.KEY_EXCHANGE_FAILED);r.sc.mac=u[f],p&&p(`Handshake: S->C MAC: ${u[f]}`)}let S=o.lists.cs.compress.array;for(p&&p(`Handshake: (local) C->S compression: ${S}`),p&&p(`Handshake: (remote) C->S compression: ${s.cs.compress}`),e._server?(l=S,u=s.cs.compress):(l=s.cs.compress,u=S),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching C->S compression"),pt(e,"Handshake failed: no matching C->S compression","handshake",dt.KEY_EXCHANGE_FAILED);r.cs.compress=u[f],p&&p(`Handshake: C->S compression: ${u[f]}`);let M=o.lists.sc.compress.array;for(p&&p(`Handshake: (local) S->C compression: ${M}`),p&&p(`Handshake: (remote) S->C compression: ${s.sc.compress}`),e._server?(l=M,u=s.sc.compress):(l=s.sc.compress,u=M),f=0;f<u.length&&l.indexOf(u[f])===-1;++f);if(f===u.length)return p&&p("Handshake: No matching S->C compression"),pt(e,"Handshake failed: no matching S->C compression","handshake",dt.KEY_EXCHANGE_FAILED);r.sc.compress=u[f],p&&p(`Handshake: S->C compression: ${u[f]}`),r.cs.lang="",r.sc.lang="",e._kex&&(e._kexinit||ow(e),e._decipher._onPayload=aw.bind(e,{firstPacket:!1})),e._kex=yD(r,e,t),e._kex.remoteExtInfoEnabled=g,e._kex.start()}a(sw,"handleKexInit");var yD=(()=>{function e(s){let c=0,u=s.length;for(;s[c]===0;)++c,--u;let l;return s[c]&128?(l=Buffer.allocUnsafe(1+u),l[0]=0,s.copy(l,1,c),s=l):u!==s.length&&(l=Buffer.allocUnsafe(u),s.copy(l,0,c),s=l),s}a(e,"convertToMpint");class t{static{a(this,"KeyExchange")}constructor(c,u,l){this._protocol=u,this.sessionID=u._kex?u._kex.sessionID:void 0,this.negotiated=c,this.remoteExtInfoEnabled=!1,this._step=1,this._public=null,this._dh=null,this._sentNEWKEYS=!1,this._receivedNEWKEYS=!1,this._finished=!1,this._hostVerified=!1,this._kexinit=u._kexinit,this._remoteKexinit=l,this._identRaw=u._identRaw,this._remoteIdentRaw=u._remoteIdentRaw,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0}finish(c){if(this._finished)return!1;this._finished=!0;let u=this._protocol._server,l=this.negotiated,f=this.convertPublicKey(this._dhData),p=this.computeSecret(this._dhData);if(p instanceof Error)return p.message=`Error while computing DH secret (${this.type}): ${p.message}`,p.level="handshake",pt(this._protocol,p,dt.KEY_EXCHANGE_FAILED);let g=XE(this.hashName);Dn(g,u?this._remoteIdentRaw:this._identRaw),Dn(g,u?this._identRaw:this._remoteIdentRaw),Dn(g,u?this._remoteKexinit:this._kexinit),Dn(g,u?this._kexinit:this._remoteKexinit);let h=u?this._hostKey.getPublicSSH():this._hostKey;if(Dn(g,h),this.type==="groupex"){let M=this.getDHParams(),R=Buffer.allocUnsafe(4);xr(R,this._minBits,0),g.update(R),xr(R,this._prefBits,0),g.update(R),xr(R,this._maxBits,0),g.update(R),Dn(g,M.prime),Dn(g,M.generator)}Dn(g,u?f:this.getPublicKey());let _=u?this.getPublicKey():f;Dn(g,_),Dn(g,p);let y=g.digest();if(u){let M;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":M="sha256";break;case"rsa-sha2-512":M="sha512";break}this._protocol._debug&&this._protocol._debug("Generating signature ...");let R=this._hostKey.sign(y,M);if(R instanceof Error)return pt(this._protocol,`Handshake failed: signature generation failed for ${this._hostKey.type} host key: ${R.message}`,"handshake",dt.KEY_EXCHANGE_FAILED);if(R=dD(R,this._hostKey.type),R===!1)return pt(this._protocol,`Handshake failed: signature conversion failed for ${this._hostKey.type} host key`,"handshake",dt.KEY_EXCHANGE_FAILED);let J=this.negotiated.serverHostKey,te=Buffer.byteLength(J),ee=4+te+4+R.length,P=this._protocol._packetRW.write.allocStartKEX,C=this._protocol._packetRW.write.alloc(5+h.length+4+_.length+4+ee,!0);if(C[P]=Bt.KEXDH_REPLY,xr(C,h.length,++P),C.set(h,P+=4),xr(C,_.length,P+=h.length),C.set(_,P+=4),xr(C,ee,P+=_.length),xr(C,te,P+=4),C.utf8Write(J,P+=4,te),xr(C,R.length,P+=te),C.set(R,P+=4),this._protocol._debug){let H;switch(this.type){case"group":H="KEXDH_REPLY";break;case"groupex":H="KEXDH_GEX_REPLY";break;default:H="KEXECDH_REPLY"}this._protocol._debug(`Outbound: Sending ${H}`)}this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(C,!0))}else{ft.init(this._sig,0);let M=ft.readString(!0);if(!M)return pt(this._protocol,"Malformed packet while reading signature","handshake",dt.KEY_EXCHANGE_FAILED);if(M!==l.serverHostKey)return pt(this._protocol,`Wrong signature type: ${M}, expected: ${l.serverHostKey}`,"handshake",dt.KEY_EXCHANGE_FAILED);let R=ft.readString();if(ft.clear(),R===void 0)return pt(this._protocol,"Malformed packet while reading signature","handshake",dt.KEY_EXCHANGE_FAILED);if(!(R=hD(R,M)))return pt(this._protocol,"Malformed signature","handshake",dt.KEY_EXCHANGE_FAILED);let J;{ft.init(this._hostKey,0);let P=ft.readString(!0),C=this._hostKey.slice(ft.pos());if(ft.clear(),J=lD(C,P),J instanceof Error)return J.level="handshake",pt(this._protocol,J,dt.KEY_EXCHANGE_FAILED)}let te;switch(this.negotiated.serverHostKey){case"rsa-sha2-256":te="sha256";break;case"rsa-sha2-512":te="sha512";break}this._protocol._debug&&this._protocol._debug("Verifying signature ...");let ee=J.verify(y,R,te);if(ee!==!0)return ee instanceof Error?this._protocol._debug&&this._protocol._debug(`Signature verification failed: ${ee.stack}`):this._protocol._debug&&this._protocol._debug("Signature verification failed"),pt(this._protocol,"Handshake failed: signature verification failed","handshake",dt.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Verified signature")}(u||!c)&&mp(this);let b,v,S=a(M=>{if(b)return mp(this),b.outbound.seqno=this._protocol._cipher.outSeqno,this._protocol._cipher.free(),this._protocol._cipher=cD(b),this._protocol._packetRW.write=v,b=void 0,v=void 0,this._protocol._onHandshakeComplete(l),!1;this.sessionID||(this.sessionID=y);{let X=Buffer.allocUnsafe(4+p.length);xr(X,p.length,0),X.set(p,4),p=X}let R=zs[l.cs.cipher],J=zs[l.sc.cipher],te=Bs(R.ivLen,this.hashName,p,y,this.sessionID,"A"),ee=Bs(J.ivLen,this.hashName,p,y,this.sessionID,"B"),P=Bs(R.keyLen,this.hashName,p,y,this.sessionID,"C"),C=Bs(J.keyLen,this.hashName,p,y,this.sessionID,"D"),H,U;R.authLen||(H=rw[l.cs.mac],U=Bs(H.len,this.hashName,p,y,this.sessionID,"E"));let k,j;J.authLen||(k=rw[l.sc.mac],j=Bs(k.len,this.hashName,p,y,this.sessionID,"F"));let W={inbound:{onPayload:this._protocol._onPayload,seqno:this._protocol._decipher.inSeqno,decipherInfo:u?R:J,decipherIV:u?te:ee,decipherKey:u?P:C,macInfo:u?H:k,macKey:u?U:j},outbound:{onWrite:this._protocol._onWrite,seqno:this._protocol._cipher.outSeqno,cipherInfo:u?J:R,cipherIV:u?ee:te,cipherKey:u?C:P,macInfo:u?k:H,macKey:u?j:U}};this._protocol._decipher.free(),b=W,this._protocol._decipher=uD(W);let z={read:void 0,write:void 0};switch(l.cs.compress){case"zlib":u?z.read=new hp:z.write=new gp(this._protocol);break;case"zlib@openssh.com":if(this._protocol._authenticated){u?z.read=new hp:z.write=new gp(this._protocol);break}default:u?z.read=new nw:z.write=new iw(this._protocol)}switch(l.sc.compress){case"zlib":u?z.write=new gp(this._protocol):z.read=new hp;break;case"zlib@openssh.com":if(this._protocol._authenticated){u?z.write=new gp(this._protocol):z.read=new hp;break}default:u?z.write=new iw(this._protocol):z.read=new nw}return this._protocol._packetRW.read.cleanup(),this._protocol._packetRW.write.cleanup(),this._protocol._packetRW.read=z.read,v=z.write,this._public=null,this._dh=null,this._kexinit=this._protocol._kexinit=void 0,this._remoteKexinit=void 0,this._identRaw=void 0,this._remoteIdentRaw=void 0,this._hostKey=void 0,this._dhData=void 0,this._sig=void 0,M?!1:S()},"completeHandshake");if((u||c)&&(this.finish=S),!u)return S(c)}start(){if(!this._protocol._server){if(this._protocol._debug){let f;this.type==="group"?f="KEXDH_INIT":f="KEXECDH_INIT",this._protocol._debug(`Outbound: Sending ${f}`)}let c=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+c.length,!0);l[u]=Bt.KEXDH_INIT,xr(l,c.length,++u),l.set(c,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}getPublicKey(){this.generateKeys();let c=this._public;if(c)return this.convertPublicKey(c)}convertPublicKey(c){let u,l=0,f=c.length;for(;c[l]===0;)++l,--f;return c[l]&128?(u=Buffer.allocUnsafe(1+f),u[0]=0,c.copy(u,1,l),u):(f!==c.length&&(u=Buffer.allocUnsafe(f),c.copy(u,0,l),c=u),c)}computeSecret(c){this.generateKeys();try{return e(this._dh.computeSecret(c))}catch(u){return u}}parse(c){let u=c[0];switch(this._step){case 1:if(this._protocol._server){if(u!==Bt.KEXDH_INIT)return pt(this._protocol,`Received packet ${u} instead of ${Bt.KEXDH_INIT}`,"handshake",dt.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Init"),ft.init(c,1);let l=ft.readString();if(ft.clear(),l===void 0)return pt(this._protocol,"Received malformed KEX*_INIT","handshake",dt.KEY_EXCHANGE_FAILED);this._dhData=l;let f=this._protocol._hostKeys[this.negotiated.serverHostKey];Array.isArray(f)&&(f=f[0]),this._hostKey=f,this.finish()}else{if(u!==Bt.KEXDH_REPLY)return pt(this._protocol,`Received packet ${u} instead of ${Bt.KEXDH_REPLY}`,"handshake",dt.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH Reply"),ft.init(c,1);let l,f,p;if((l=ft.readString())===void 0||(f=ft.readString())===void 0||(p=ft.readString())===void 0)return ft.clear(),pt(this._protocol,"Received malformed KEX*_REPLY","handshake",dt.KEY_EXCHANGE_FAILED);ft.clear(),ft.init(l,0);let g=ft.readString(!0);if(ft.clear(),g===void 0)return pt(this._protocol,"Received malformed host public key","handshake",dt.KEY_EXCHANGE_FAILED);if(g!==this.negotiated.serverHostKey)switch(this.negotiated.serverHostKey){case"rsa-sha2-256":case"rsa-sha2-512":if(g==="ssh-rsa")break;default:return pt(this._protocol,"Host key does not match negotiated type","handshake",dt.KEY_EXCHANGE_FAILED)}this._hostKey=l,this._dhData=f,this._sig=p;let h=!1,_;if(this._protocol._hostVerifier===void 0?(_=!0,this._protocol._debug&&this._protocol._debug("Host accepted by default (no verification)")):_=this._protocol._hostVerifier(l,y=>{if(!h){if(h=!0,y===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),pt(this._protocol,"Host denied (verification failed)","handshake",dt.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,this._receivedNEWKEYS?this.finish():mp(this)}}),_===void 0){++this._step;return}if(h=!0,_===!1)return this._protocol._debug&&this._protocol._debug("Host denied (verification failed)"),pt(this._protocol,"Host denied (verification failed)","handshake",dt.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Host accepted (verified)"),this._hostVerified=!0,mp(this)}++this._step;break;case 2:return u!==Bt.NEWKEYS?pt(this._protocol,`Received packet ${u} instead of ${Bt.NEWKEYS}`,"handshake",dt.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Inbound: NEWKEYS"),this._receivedNEWKEYS=!0,this._protocol._strictMode&&(this._protocol._decipher.inSeqno=0),++this._step,this.finish(!this._protocol._server&&!this._hostVerified));default:return pt(this._protocol,`Received unexpected packet ${u} after NEWKEYS`,"handshake",dt.KEY_EXCHANGE_FAILED)}}}class r extends t{static{a(this,"Curve25519Exchange")}constructor(c,...u){super(...u),this.type="25519",this.hashName=c,this._keys=null}generateKeys(){this._keys||(this._keys=oD("x25519"))}getPublicKey(){return this.generateKeys(),this._keys.publicKey.export({type:"spki",format:"der"}).slice(-32)}convertPublicKey(c){let u,l=0,f=c.length;for(;c[l]===0;)++l,--f;return c.length===32||f!==c.length&&(u=Buffer.allocUnsafe(f),c.copy(u,0,l),c=u),c}computeSecret(c){this.generateKeys();try{let u=new JS.Writer;return u.startSequence(),u.startSequence(),u.writeOID("1.3.101.110"),u.endSequence(),u.startSequence(JS.BitString),u.writeByte(0),u._ensure(c.length),c.copy(u._buf,u._offset,0,c.length),u._offset+=c.length,u.endSequence(),u.endSequence(),e(iD({privateKey:this._keys.privateKey,publicKey:nD({key:u.buffer,type:"spki",format:"der"})}))}catch(u){return u}}}class i extends t{static{a(this,"ECDHExchange")}constructor(c,u,...l){super(...l),this.type="ecdh",this.curveName=c,this.hashName=u}generateKeys(){this._dh||(this._dh=rD(this.curveName),this._public=this._dh.generateKeys())}}class n extends t{static{a(this,"DHGroupExchange")}constructor(c,...u){super(...u),this.type="groupex",this.hashName=c,this._prime=null,this._generator=null,this._minBits=gD,this._prefBits=ED(this.negotiated),this._protocol._compatFlags&JE.BUG_DHGEX_LARGE&&(this._prefBits=Math.min(this._prefBits,4096)),this._maxBits=mD}start(){if(this._protocol._server)return;this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_REQUEST");let c=this._protocol._packetRW.write.allocStartKEX,u=this._protocol._packetRW.write.alloc(13,!0);u[c]=Bt.KEXDH_GEX_REQUEST,xr(u,this._minBits,++c),xr(u,this._prefBits,c+=4),xr(u,this._maxBits,c+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(u,!0))}generateKeys(){!this._dh&&this._prime&&this._generator&&(this._dh=eD(this._prime,this._generator),this._public=this._dh.generateKeys())}setDHParams(c,u){if(!Buffer.isBuffer(c))throw new Error("Invalid prime value");if(!Buffer.isBuffer(u))throw new Error("Invalid generator value");this._prime=c,this._generator=u}getDHParams(){if(this._dh)return{prime:e(this._dh.getPrime()),generator:e(this._dh.getGenerator())}}parse(c){let u=c[0];switch(this._step){case 1:{if(this._protocol._server)return u!==Bt.KEXDH_GEX_REQUEST?pt(this._protocol,`Received packet ${u} instead of `+Bt.KEXDH_GEX_REQUEST,"handshake",dt.KEY_EXCHANGE_FAILED):pt(this._protocol,"Group exchange not implemented for server","handshake",dt.KEY_EXCHANGE_FAILED);if(u!==Bt.KEXDH_GEX_GROUP)return pt(this._protocol,`Received packet ${u} instead of ${Bt.KEXDH_GEX_GROUP}`,"handshake",dt.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Group"),ft.init(c,1);let l,f;if((l=ft.readString())===void 0||(f=ft.readString())===void 0)return ft.clear(),pt(this._protocol,"Received malformed KEXDH_GEX_GROUP","handshake",dt.KEY_EXCHANGE_FAILED);ft.clear(),this.setDHParams(l,f),this.generateKeys();let p=this.getPublicKey();this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_GEX_INIT");let g=this._protocol._packetRW.write.allocStartKEX,h=this._protocol._packetRW.write.alloc(5+p.length,!0);h[g]=Bt.KEXDH_GEX_INIT,xr(h,p.length,++g),h.set(p,g+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(h,!0)),++this._step;break}case 2:if(this._protocol._server)return u!==Bt.KEXDH_GEX_INIT?pt(this._protocol,`Received packet ${u} instead of ${Bt.KEXDH_GEX_INIT}`,"handshake",dt.KEY_EXCHANGE_FAILED):(this._protocol._debug&&this._protocol._debug("Received DH GEX Init"),pt(this._protocol,"Group exchange not implemented for server","handshake",dt.KEY_EXCHANGE_FAILED));if(u!==Bt.KEXDH_GEX_REPLY)return pt(this._protocol,`Received packet ${u} instead of ${Bt.KEXDH_GEX_REPLY}`,"handshake",dt.KEY_EXCHANGE_FAILED);this._protocol._debug&&this._protocol._debug("Received DH GEX Reply"),this._step=1,c[0]=Bt.KEXDH_REPLY,this.parse=t.prototype.parse,this.parse(c)}}}class o extends t{static{a(this,"DHExchange")}constructor(c,u,...l){super(...l),this.type="group",this.groupName=c,this.hashName=u}start(){if(!this._protocol._server){this._protocol._debug&&this._protocol._debug("Outbound: Sending KEXDH_INIT");let c=this.getPublicKey(),u=this._protocol._packetRW.write.allocStartKEX,l=this._protocol._packetRW.write.alloc(5+c.length,!0);l[u]=Bt.KEXDH_INIT,xr(l,c.length,++u),l.set(c,u+=4),this._protocol._cipher.encrypt(this._protocol._packetRW.write.finalize(l,!0))}}generateKeys(){this._dh||(this._dh=tD(this.groupName),this._public=this._dh.generateKeys())}getDHParams(){if(this._dh)return{prime:e(this._dh.getPrime()),generator:e(this._dh.getGenerator())}}}return(s,...c)=>{if(typeof s!="object"||s===null)throw new Error("Invalid negotiated argument");let u=s.kex;if(typeof u=="string"){switch(c=[s,...c],u){case"curve25519-sha256":case"curve25519-sha256@libssh.org":if(!aD)break;return new r("sha256",...c);case"ecdh-sha2-nistp256":return new i("prime256v1","sha256",...c);case"ecdh-sha2-nistp384":return new i("secp384r1","sha384",...c);case"ecdh-sha2-nistp521":return new i("secp521r1","sha512",...c);case"diffie-hellman-group1-sha1":return new o("modp2","sha1",...c);case"diffie-hellman-group14-sha1":return new o("modp14","sha1",...c);case"diffie-hellman-group14-sha256":return new o("modp14","sha256",...c);case"diffie-hellman-group15-sha512":return new o("modp15","sha512",...c);case"diffie-hellman-group16-sha512":return new o("modp16","sha512",...c);case"diffie-hellman-group17-sha512":return new o("modp17","sha512",...c);case"diffie-hellman-group18-sha512":return new o("modp18","sha512",...c);case"diffie-hellman-group-exchange-sha1":return new n("sha1",...c);case"diffie-hellman-group-exchange-sha256":return new n("sha256",...c)}throw new Error(`Unsupported key exchange algorithm: ${u}`)}throw new Error(`Invalid key exchange type: ${u}`)}})(),YE=(()=>{let e=["kex","serverHostKey",["cs","cipher"],["sc","cipher"],["cs","mac"],["sc","mac"],["cs","compress"],["sc","compress"],["cs","lang"],["sc","lang"]];return class{static{a(this,"KexInit")}constructor(r){if(typeof r!="object"||r===null)throw new TypeError("Argument must be an object");let i={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},sc:{cipher:void 0,mac:void 0,compress:void 0,lang:void 0},all:void 0},n=0;for(let c of e){let u,l,f,p;if(typeof c=="string")u=i,l=r[c],f=p=c;else{let h=c[0];u=i[h],p=c[1],l=r[h][p],f=`${h}.${p}`}let g={array:void 0,buffer:void 0};if(Buffer.isBuffer(l))g.array=(""+l).split(","),g.buffer=l,n+=4+l.length;else{if(typeof l=="string"&&(l=l.split(",")),Array.isArray(l))g.array=l,g.buffer=Buffer.from(l.join(","));else throw new TypeError(`Invalid \`${f}\` type: ${typeof l}`);n+=4+g.buffer.length}u[p]=g}let o=Buffer.allocUnsafe(n);i.all=o;let s=0;for(let c of e){let u;typeof c=="string"?u=i[c].buffer:u=i[c[0]][c[1]].buffer,s=xr(o,u.length,s),o.set(u,s),s+=u.length}this.totalSize=n,this.lists=i}copyAllTo(r,i){let n=this.lists.all;if(typeof i!="number")throw new TypeError(`Invalid offset value: ${typeof i}`);if(r.length-i<n.length)throw new Error("Insufficient space to copy list");return r.set(n,i),n.length}}})(),Dn=(()=>{let e=Buffer.allocUnsafe(4);return(t,r)=>{xr(e,r.length,0),t.update(e),t.update(r)}})();function Bs(e,t,r,i,n,o){let s;if(e){let c=XE(t).update(r).update(i).update(o).update(n).digest();for(;c.length<e;){let u=XE(t).update(r).update(i).update(c).digest(),l=Buffer.allocUnsafe(c.length+u.length);l.set(c,0),l.set(u,c.length),c=l}c.length===e?s=c:s=new pD(c.buffer,c.byteOffset,e)}else s=_D;return s}a(Bs,"generateKEXVal");function aw(e,t){if(t.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}if(this._skipNextInboundPacket){this._skipNextInboundPacket=!1;return}t=this._packetRW.read.read(t);let r=t[0];if(!this._strictMode)switch(r){case Bt.IGNORE:case Bt.UNIMPLEMENTED:case Bt.DEBUG:return Ds||(Ds=up()),Ds[r](this,t)}switch(r){case Bt.DISCONNECT:return Ds||(Ds=up()),Ds[r](this,t);case Bt.KEXINIT:return e.firstPacket?(e.firstPacket=!1,sw(this,t)):pt(this,"Received extra KEXINIT during handshake","handshake",dt.KEY_EXCHANGE_FAILED);default:if(r<20||r>49)return pt(this,`Received unexpected packet type ${r}`,"handshake",dt.KEY_EXCHANGE_FAILED)}return this._kex.parse(t)}a(aw,"onKEXPayload");function ED(e){let t=zs[e.cs.cipher],r=zs[e.sc.cipher],i=Math.max(0,t.sslName==="des-ede3-cbc"?14:t.keyLen,t.blockLen,t.ivLen,r.sslName==="des-ede3-cbc"?14:r.keyLen,r.blockLen,r.ivLen)*8;return i<=112?2048:i<=128?3072:i<=192?7680:8192}a(ED,"dhEstimate");function mp(e){if(!e._sentNEWKEYS){e._protocol._debug&&e._protocol._debug("Outbound: Sending NEWKEYS");let t=e._protocol._packetRW.write.allocStartKEX,r=e._protocol._packetRW.write.alloc(1,!0);r[t]=Bt.NEWKEYS,e._protocol._cipher.encrypt(e._protocol._packetRW.write.finalize(r,!0)),e._sentNEWKEYS=!0,e._protocol._strictMode&&(e._protocol._cipher.outSeqno=0)}}a(mp,"trySendNEWKEYS");cw.exports={KexInit:YE,kexinit:ow,onKEXPayload:aw,DEFAULT_KEXINIT_CLIENT:new YE({kex:ew.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),serverHostKey:tw,cs:{cipher:fp,mac:dp,compress:pp,lang:[]},sc:{cipher:fp,mac:dp,compress:pp,lang:[]}}),DEFAULT_KEXINIT_SERVER:new YE({kex:ew.concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:tw,cs:{cipher:fp,mac:dp,compress:pp,lang:[]},sc:{cipher:fp,mac:dp,compress:pp,lang:[]}}),HANDLERS:{[Bt.KEXINIT]:sw}}});var uw=me((YQ,AD)=>{AD.exports={name:"ssh2",version:"1.16.0",author:"Brian White <mscdex@mscdex.net>",description:"SSH2 client and server modules written in pure JavaScript for node.js",main:"./lib/index.js",engines:{node:">=10.16.0"},dependencies:{asn1:"^0.2.6","bcrypt-pbkdf":"^1.0.2"},devDependencies:{"@mscdex/eslint-config":"^1.1.0",eslint:"^7.32.0"},optionalDependencies:{"cpu-features":"~0.0.10",nan:"^2.20.0"},scripts:{install:"node install.js",rebuild:"node install.js",test:"node test/test.js",lint:"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js examples lib test","lint:fix":"npm run lint -- --fix"},keywords:["ssh","ssh2","sftp","secure","shell","exec","remote","client"],licenses:[{type:"MIT",url:"http://github.com/mscdex/ssh2/raw/master/LICENSE"}],repository:{type:"git",url:"http://github.com/mscdex/ssh2.git"}}});var nA=me((XQ,xw)=>{"use strict";var{inspect:gw}=require("util"),{bindingAvailable:bD,NullCipher:xD,NullDecipher:ID}=Pi(),{COMPAT_CHECKS:vD,DISCONNECT_REASON:mw,eddsaSupported:SD,MESSAGE:Oe,SIGNALS:lw,TERMINAL_MODE:tA}=Jn(),{DEFAULT_KEXINIT_CLIENT:wD,DEFAULT_KEXINIT_SERVER:PD,KexInit:fw,kexinit:_w,onKEXPayload:TD}=lp(),{parseKey:dw}=Ci(),kD=up(),{bufferCopy:_p,bufferFill:CD,bufferSlice:yw,convertSignature:pw,sendPacket:Ne,writeUInt32BE:$}=In(),{PacketReader:RD,PacketWriter:OD,ZlibPacketReader:Ew,ZlibPacketWriter:Aw}=QE(),ND=uw().version,$D=new Map(Object.values(mw).map(e=>[e,1])),bw=Buffer.from(`SSH-2.0-ssh2js${ND}`),DD=Buffer.from(`${bw}\r
12
+ `),BD=8192,zD=1024,hw=Buffer.from([Oe.GLOBAL_REQUEST,0,0,0,21,107,101,101,112,97,108,105,118,101,64,111,112,101,110,115,115,104,46,99,111,109,1]),LD=Buffer.from([tA.TTY_OP_END]);function eA(){}a(eA,"noop");var rA=class{static{a(this,"Protocol")}constructor(t){let r=t.onWrite;if(typeof r!="function")throw new Error("Missing onWrite function");this._onWrite=h=>{r(h)};let i=t.onError;if(typeof i!="function")throw new Error("Missing onError function");this._onError=h=>{i(h)};let n=t.debug;this._debug=typeof n=="function"?h=>{n(h)}:void 0;let o=t.onHeader;this._onHeader=typeof o=="function"?(...h)=>{o(...h)}:eA;let s=t.onPacket;this._onPacket=typeof s=="function"?()=>{s()}:eA;let c=t.onHandshakeComplete;typeof c!="function"&&(c=eA);let u;this._onHandshakeComplete=(...h)=>{this._debug&&this._debug("Handshake completed"),u===void 0?u=!0:u=!1;let _=this._queue;if(_){this._queue=void 0,this._debug&&this._debug(`Draining outbound queue (${_.length}) ...`);for(let y=0;y<_.length;++y){let b=_[y],v=this._packetRW.write.finalize(b);if(v===b){let S=this._cipher.allocPacket(b.length);S.set(b,5),v=S}Ne(this,v)}this._debug&&this._debug("... finished draining outbound queue")}u&&this._server&&this._kex.remoteExtInfoEnabled&&qD(this),c(...h)},this._queue=void 0;let l=t.messageHandlers;typeof l=="object"&&l!==null?this._handlers=l:this._handlers={},this._onPayload=HD.bind(this),this._server=!!t.server,this._banner=void 0;let f;if(this._server){if(typeof t.hostKeys!="object"||t.hostKeys===null)throw new Error("Missing server host key(s)");this._hostKeys=t.hostKeys,typeof t.greeting=="string"&&t.greeting.length&&(f=t.greeting.slice(-2)===`\r
13
+ `?t.greeting:`${t.greeting}\r
14
+ `),typeof t.banner=="string"&&t.banner.length&&(this._banner=t.banner.slice(-2)===`\r
15
+ `?t.banner:`${t.banner}\r
16
+ `)}else this._hostKeys=void 0;let p=t.offer;typeof p!="object"||p===null?p=this._server?PD:wD:p.constructor!==fw&&(this._server?p.kex=p.kex.concat(["kex-strict-s-v00@openssh.com"]):p.kex=p.kex.concat(["ext-info-c","kex-strict-c-v00@openssh.com"]),p=new fw(p)),this._kex=void 0,this._strictMode=void 0,this._kexinit=void 0,this._offer=p,this._cipher=new xD(0,this._onWrite),this._decipher=void 0,this._skipNextInboundPacket=!1,this._packetRW={read:new RD,write:new OD(this)},this._hostVerifier=!this._server&&typeof t.hostVerifier=="function"?t.hostVerifier:void 0,this._parse=MD,this._buffer=void 0,this._authsQueue=[],this._authenticated=!1,this._remoteIdentRaw=void 0;let g;if(typeof t.ident=="string")this._identRaw=Buffer.from(`SSH-2.0-${t.ident}`),g=Buffer.allocUnsafe(this._identRaw.length+2),g.set(this._identRaw,0),g[g.length-2]=13,g[g.length-1]=10;else if(Buffer.isBuffer(t.ident)){let h=Buffer.allocUnsafe(8+t.ident.length);h.latin1Write("SSH-2.0-",0,8),h.set(t.ident,8),this._identRaw=h,g=Buffer.allocUnsafe(h.length+2),g.set(h,0),g[g.length-2]=13,g[g.length-1]=10}else this._identRaw=bw,g=DD;this._compatFlags=0,this._debug&&(bD?this._debug("Custom crypto binding available"):this._debug("Custom crypto binding not available")),this._debug&&this._debug(`Local ident: ${gw(this._identRaw.toString())}`),this.start=()=>{this.start=void 0,f&&this._onWrite(f),this._onWrite(g)}}_destruct(t){this._packetRW.read.cleanup(),this._packetRW.write.cleanup(),this._cipher&&this._cipher.free(),this._decipher&&this._decipher.free(),(typeof t!="string"||t.length===0)&&(t="fatal error"),this.parse=()=>{throw new Error(`Instance unusable after ${t}`)},this._onWrite=()=>{throw new Error(`Instance unusable after ${t}`)},this._destruct=void 0}cleanup(){this._destruct&&this._destruct()}parse(t,r,i){for(;r<i;)r=this._parse(t,r,i)}disconnect(t){let i=this._packetRW.write.allocStartKEX,n=this._packetRW.write.alloc(13,!0),o=i+13;$D.has(t)||(t=mw.PROTOCOL_ERROR),n[i]=Oe.DISCONNECT,$(n,t,++i),n.fill(0,i+=4,o),this._debug&&this._debug(`Outbound: Sending DISCONNECT (${t})`),Ne(this,this._packetRW.write.finalize(n,!0),!0)}ping(){let t=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(hw.length);r.set(hw,t),this._debug&&this._debug("Outbound: Sending ping (GLOBAL_REQUEST: keepalive@openssh.com)"),Ne(this,this._packetRW.write.finalize(r))}rekey(){this._kexinit===void 0?(this._debug&&this._debug("Outbound: Initiated explicit rekey"),this._queue=[],_w(this)):this._debug&&this._debug("Outbound: Ignoring rekey during handshake")}requestSuccess(t){let r=this._packetRW.write.allocStart,i;Buffer.isBuffer(t)?(i=this._packetRW.write.alloc(1+t.length),i[r]=Oe.REQUEST_SUCCESS,i.set(t,++r)):(i=this._packetRW.write.alloc(1),i[r]=Oe.REQUEST_SUCCESS),this._debug&&this._debug("Outbound: Sending REQUEST_SUCCESS"),Ne(this,this._packetRW.write.finalize(i))}requestFailure(){let t=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[t]=Oe.REQUEST_FAILURE,this._debug&&this._debug("Outbound: Sending REQUEST_FAILURE"),Ne(this,this._packetRW.write.finalize(r))}channelSuccess(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Oe.CHANNEL_SUCCESS,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_SUCCESS (r:${t})`),Ne(this,this._packetRW.write.finalize(i))}channelFailure(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Oe.CHANNEL_FAILURE,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_FAILURE (r:${t})`),Ne(this,this._packetRW.write.finalize(i))}channelEOF(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Oe.CHANNEL_EOF,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_EOF (r:${t})`),Ne(this,this._packetRW.write.finalize(i))}channelClose(t){let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(5);i[r]=Oe.CHANNEL_CLOSE,$(i,t,++r),this._debug&&this._debug(`Outbound: Sending CHANNEL_CLOSE (r:${t})`),Ne(this,this._packetRW.write.finalize(i))}channelWindowAdjust(t,r){let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(9);n[i]=Oe.CHANNEL_WINDOW_ADJUST,$(n,t,++i),$(n,r,i+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_WINDOW_ADJUST (r:${t}, ${r})`),Ne(this,this._packetRW.write.finalize(n))}channelData(t,r){let i=Buffer.isBuffer(r),n=i?r.length:Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(9+n);s[o]=Oe.CHANNEL_DATA,$(s,t,++o),$(s,n,o+=4),i?s.set(r,o+=4):s.utf8Write(r,o+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_DATA (r:${t}, ${n})`),Ne(this,this._packetRW.write.finalize(s))}channelExtData(t,r,i){let n=Buffer.isBuffer(r),o=n?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(13+o);c[s]=Oe.CHANNEL_EXTENDED_DATA,$(c,t,++s),$(c,i,s+=4),$(c,o,s+=4),n?c.set(r,s+=4):c.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_EXTENDED_DATA (r:${t})`),Ne(this,this._packetRW.write.finalize(c))}channelOpenConfirm(t,r,i,n){let o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(17);s[o]=Oe.CHANNEL_OPEN_CONFIRMATION,$(s,t,++o),$(s,r,o+=4),$(s,i,o+=4),$(s,n,o+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_CONFIRMATION (r:${t}, l:${r})`),Ne(this,this._packetRW.write.finalize(s))}channelOpenFail(t,r,i){typeof i!="string"&&(i="");let n=Buffer.byteLength(i),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(13+n+4);s[o]=Oe.CHANNEL_OPEN_FAILURE,$(s,t,++o),$(s,r,o+=4),$(s,n,o+=4),o+=4,n&&(s.utf8Write(i,o,n),o+=n),$(s,0,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN_FAILURE (r:${t})`),Ne(this,this._packetRW.write.finalize(s))}service(t){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r);n[i]=Oe.SERVICE_REQUEST,$(n,r,++i),n.utf8Write(t,i+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_REQUEST (${t})`),Ne(this,this._packetRW.write.finalize(n))}authPassword(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=Buffer.byteLength(r),s=i?Buffer.byteLength(i):0,c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+n+4+14+4+8+1+4+o+(i?4+s:0));u[c]=Oe.USERAUTH_REQUEST,$(u,n,++c),u.utf8Write(t,c+=4,n),$(u,14,c+=n),u.utf8Write("ssh-connection",c+=4,14),$(u,8,c+=14),u.utf8Write("password",c+=4,8),u[c+=8]=i?1:0,$(u,o,++c),Buffer.isBuffer(r)?_p(r,u,0,o,c+=4):u.utf8Write(r,c+=4,o),i?($(u,s,c+=o),Buffer.isBuffer(i)?_p(i,u,0,s,c+=4):u.utf8Write(i,c+=4,s),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (changed password)")):this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (password)"),this._authsQueue.push("password"),Ne(this,this._packetRW.write.finalize(u))}authPK(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");if(r=dw(r),r instanceof Error)throw new Error("Invalid key");let o=r.type;r=r.getPublicSSH(),typeof i=="function"&&(n=i,i=void 0),i||(i=o);let s=Buffer.byteLength(t),c=Buffer.byteLength(i),u=r.length,l=this._kex.sessionID,f=l.length,p=(n?4+f:0)+1+4+s+4+14+4+9+1+4+c+4+u,g,h;if(n?(g=Buffer.allocUnsafe(p),h=0,$(g,f,h),g.set(l,h+=4),h+=f):(g=this._packetRW.write.alloc(p),h=this._packetRW.write.allocStart),g[h]=Oe.USERAUTH_REQUEST,$(g,s,++h),g.utf8Write(t,h+=4,s),$(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),$(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=n?1:0,$(g,c,++h),g.utf8Write(i,h+=4,c),$(g,u,h+=c),g.set(r,h+=4),!n){this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey -- check)"),Ne(this,this._packetRW.write.finalize(g));return}n(g,_=>{if(_=pw(_,o),_===!1)throw new Error("Error while converting handshake signature");let y=_.length;h=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(5+s+4+14+4+9+1+4+c+4+u+4+4+c+4+y),g[h]=Oe.USERAUTH_REQUEST,$(g,s,++h),g.utf8Write(t,h+=4,s),$(g,14,h+=s),g.utf8Write("ssh-connection",h+=4,14),$(g,9,h+=14),g.utf8Write("publickey",h+=4,9),g[h+=9]=1,$(g,c,++h),g.utf8Write(i,h+=4,c),$(g,u,h+=c),g.set(r,h+=4),$(g,4+c+4+y,h+=u),$(g,c,h+=4),g.utf8Write(i,h+=4,c),$(g,y,h+=c),g.set(_,h+=4),this._authsQueue.push("publickey"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (publickey)"),Ne(this,this._packetRW.write.finalize(g))})}authHostbased(t,r,i,n,o,s){if(this._server)throw new Error("Client-only method called in server mode");if(r=dw(r),r instanceof Error)throw new Error("Invalid key");let c=r.type;r=r.getPublicSSH(),typeof o=="function"&&(s=o,o=void 0),o||(o=c);let u=Buffer.byteLength(t),l=Buffer.byteLength(o),f=r.length,p=this._kex.sessionID,g=p.length,h=Buffer.byteLength(i),_=Buffer.byteLength(n),y=Buffer.allocUnsafe(4+g+1+4+u+4+14+4+9+4+l+4+f+4+h+4+_),b=0;$(y,g,b),y.set(p,b+=4),y[b+=g]=Oe.USERAUTH_REQUEST,$(y,u,++b),y.utf8Write(t,b+=4,u),$(y,14,b+=u),y.utf8Write("ssh-connection",b+=4,14),$(y,9,b+=14),y.utf8Write("hostbased",b+=4,9),$(y,l,b+=9),y.utf8Write(o,b+=4,l),$(y,f,b+=l),y.set(r,b+=4),$(y,h,b+=f),y.utf8Write(i,b+=4,h),$(y,_,b+=h),y.utf8Write(n,b+=4,_),s(y,v=>{if(v=pw(v,c),!v)throw new Error("Error while converting handshake signature");let S=v.length,M=y.length-g-4;b=this._packetRW.write.allocStart;let R=this._packetRW.write.alloc(M+4+4+l+4+S);_p(y,R,4+g,y.length,b),$(R,4+l+4+S,b+=M),$(R,l,b+=4),R.utf8Write(o,b+=4,l),$(R,S,b+=l),R.set(v,b+=4),this._authsQueue.push("hostbased"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (hostbased)"),Ne(this,this._packetRW.write.finalize(R))})}authKeyboard(t){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r+4+14+4+20+4+4);n[i]=Oe.USERAUTH_REQUEST,$(n,r,++i),n.utf8Write(t,i+=4,r),$(n,14,i+=r),n.utf8Write("ssh-connection",i+=4,14),$(n,20,i+=14),n.utf8Write("keyboard-interactive",i+=4,20),$(n,0,i+=20),$(n,0,i+=4),this._authsQueue.push("keyboard-interactive"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (keyboard-interactive)"),Ne(this,this._packetRW.write.finalize(n))}authNone(t){if(this._server)throw new Error("Client-only method called in server mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r+4+14+4+4);n[i]=Oe.USERAUTH_REQUEST,$(n,r,++i),n.utf8Write(t,i+=4,r),$(n,14,i+=r),n.utf8Write("ssh-connection",i+=4,14),$(n,4,i+=14),n.utf8Write("none",i+=4,4),this._authsQueue.push("none"),this._debug&&this._debug("Outbound: Sending USERAUTH_REQUEST (none)"),Ne(this,this._packetRW.write.finalize(n))}authInfoRes(t){if(this._server)throw new Error("Client-only method called in server mode");let r=0,i;if(t){i=new Array(t.length);for(let s=0;s<t.length;++s){let c=Buffer.byteLength(t[s]);i[s]=c,r+=4+c}}let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(5+r);if(o[n]=Oe.USERAUTH_INFO_RESPONSE,t){$(o,t.length,++n),n+=4;for(let s=0;s<t.length;++s){let c=i[s];$(o,c,n),n+=4,c&&(o.utf8Write(t[s],n,c),n+=c)}}else $(o,0,++n);this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_RESPONSE"),Ne(this,this._packetRW.write.finalize(o))}tcpipForward(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+n+4);s[o]=Oe.GLOBAL_REQUEST,$(s,13,++o),s.utf8Write("tcpip-forward",o+=4,13),s[o+=13]=i===void 0||i===!0?1:0,$(s,n,++o),s.utf8Write(t,o+=4,n),$(s,r,o+=n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (tcpip-forward)"),Ne(this,this._packetRW.write.finalize(s))}cancelTcpipForward(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(30+n+4);s[o]=Oe.GLOBAL_REQUEST,$(s,20,++o),s.utf8Write("cancel-tcpip-forward",o+=4,20),s[o+=20]=i===void 0||i===!0?1:0,$(s,n,++o),s.utf8Write(t,o+=4,n),$(s,r,o+=n),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-tcpip-forward)"),Ne(this,this._packetRW.write.finalize(s))}openssh_streamLocalForward(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(41+i);o[n]=Oe.GLOBAL_REQUEST,$(o,31,++n),o.utf8Write("streamlocal-forward@openssh.com",n+=4,31),o[n+=31]=r===void 0||r===!0?1:0,$(o,i,++n),o.utf8Write(t,n+=4,i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (streamlocal-forward@openssh.com)"),Ne(this,this._packetRW.write.finalize(o))}openssh_cancelStreamLocalForward(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(48+i);o[n]=Oe.GLOBAL_REQUEST,$(o,38,++n),o.utf8Write("cancel-streamlocal-forward@openssh.com",n+=4,38),o[n+=38]=r===void 0||r===!0?1:0,$(o,i,++n),o.utf8Write(t,n+=4,i),this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (cancel-streamlocal-forward@openssh.com)"),Ne(this,this._packetRW.write.finalize(o))}directTcpip(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(n.srcIP),s=Buffer.byteLength(n.dstIP),c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(33+o+4+4+s+4);u[c]=Oe.CHANNEL_OPEN,$(u,12,++c),u.utf8Write("direct-tcpip",c+=4,12),$(u,t,c+=12),$(u,r,c+=4),$(u,i,c+=4),$(u,s,c+=4),u.utf8Write(n.dstIP,c+=4,s),$(u,n.dstPort,c+=s),$(u,o,c+=4),u.utf8Write(n.srcIP,c+=4,o),$(u,n.srcPort,c+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, direct-tcpip)`),Ne(this,this._packetRW.write.finalize(u))}openssh_directStreamLocal(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(n.socketPath),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(51+o+4+4);c[s]=Oe.CHANNEL_OPEN,$(c,30,++s),c.utf8Write("direct-streamlocal@openssh.com",s+=4,30),$(c,t,s+=30),$(c,r,s+=4),$(c,i,s+=4),$(c,o,s+=4),c.utf8Write(n.socketPath,s+=4,o),CD(c,0,s+=o,s+8),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, direct-streamlocal@openssh.com)`),Ne(this,this._packetRW.write.finalize(c))}openssh_noMoreSessions(t){if(this._server)throw new Error("Client-only method called in server mode");let r=this._packetRW.write.allocStart,i=this._packetRW.write.alloc(34);i[r]=Oe.GLOBAL_REQUEST,$(i,28,++r),i.utf8Write("no-more-sessions@openssh.com",r+=4,28),i[r+=28]=t===void 0||t===!0?1:0,this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (no-more-sessions@openssh.com)"),Ne(this,this._packetRW.write.finalize(i))}session(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(24);o[n]=Oe.CHANNEL_OPEN,$(o,7,++n),o.utf8Write("session",n+=4,7),$(o,t,n+=7),$(o,r,n+=4),$(o,i,n+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, session)`),Ne(this,this._packetRW.write.finalize(o))}windowChange(t,r,i,n,o){if(this._server)throw new Error("Client-only method called in server mode");let s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(39);c[s]=Oe.CHANNEL_REQUEST,$(c,t,++s),$(c,13,s+=4),c.utf8Write("window-change",s+=4,13),c[s+=13]=0,$(c,i,++s),$(c,r,s+=4),$(c,o,s+=4),$(c,n,s+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, window-change)`),Ne(this,this._packetRW.write.finalize(c))}pty(t,r,i,n,o,s,c,u){if(this._server)throw new Error("Client-only method called in server mode");(!s||!s.length)&&(s="vt100"),c&&!Buffer.isBuffer(c)&&!Array.isArray(c)&&typeof c=="object"&&c!==null&&(c=WD(c)),(!c||!c.length)&&(c=LD);let l=s.length,f=c.length,p=this._packetRW.write.allocStart,g=this._packetRW.write.alloc(21+l+4+4+4+4+4+f);if(g[p]=Oe.CHANNEL_REQUEST,$(g,t,++p),$(g,7,p+=4),g.utf8Write("pty-req",p+=4,7),g[p+=7]=u===void 0||u===!0?1:0,$(g,l,++p),g.utf8Write(s,p+=4,l),$(g,i,p+=l),$(g,r,p+=4),$(g,o,p+=4),$(g,n,p+=4),$(g,f,p+=4),p+=4,Array.isArray(c))for(let h=0;h<f;++h)g[p++]=c[h];else Buffer.isBuffer(c)&&g.set(c,p);this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, pty-req)`),Ne(this,this._packetRW.write.finalize(g))}shell(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(15);n[i]=Oe.CHANNEL_REQUEST,$(n,t,++i),$(n,5,i+=4),n.utf8Write("shell",i+=4,5),n[i+=5]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, shell)`),Ne(this,this._packetRW.write.finalize(n))}exec(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.isBuffer(r),o=n?r.length:Buffer.byteLength(r),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(18+o);c[s]=Oe.CHANNEL_REQUEST,$(c,t,++s),$(c,4,s+=4),c.utf8Write("exec",s+=4,4),c[s+=4]=i===void 0||i===!0?1:0,$(c,o,++s),n?c.set(r,s+=4):c.utf8Write(r,s+=4,o),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, exec: ${r})`),Ne(this,this._packetRW.write.finalize(c))}signal(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=r;if(r=r.toUpperCase(),r.slice(0,3)==="SIG"&&(r=r.slice(3)),lw[r]!==1)throw new Error(`Invalid signal: ${i}`);let n=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(20+n);s[o]=Oe.CHANNEL_REQUEST,$(s,t,++o),$(s,6,o+=4),s.utf8Write("signal",o+=4,6),s[o+=6]=0,$(s,n,++o),s.utf8Write(r,o+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, signal: ${r})`),Ne(this,this._packetRW.write.finalize(s))}env(t,r,i,n){if(this._server)throw new Error("Client-only method called in server mode");let o=Buffer.byteLength(r),s=Buffer.isBuffer(i),c=s?i.length:Buffer.byteLength(i),u=this._packetRW.write.allocStart,l=this._packetRW.write.alloc(17+o+4+c);l[u]=Oe.CHANNEL_REQUEST,$(l,t,++u),$(l,3,u+=4),l.utf8Write("env",u+=4,3),l[u+=3]=n===void 0||n===!0?1:0,$(l,o,++u),l.utf8Write(r,u+=4,o),$(l,c,u+=o),s?l.set(i,u+=4):l.utf8Write(i,u+=4,c),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, env: ${r}=${i})`),Ne(this,this._packetRW.write.finalize(l))}x11Forward(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=r.protocol,o=r.cookie,s=Buffer.isBuffer(n),c=s?n.length:Buffer.byteLength(n),u=Buffer.isBuffer(o),l=u?o.length:Buffer.byteLength(o),f=this._packetRW.write.allocStart,p=this._packetRW.write.alloc(22+c+4+l+4);p[f]=Oe.CHANNEL_REQUEST,$(p,t,++f),$(p,7,f+=4),p.utf8Write("x11-req",f+=4,7),p[f+=7]=i===void 0||i===!0?1:0,p[++f]=r.single?1:0,$(p,c,++f),s?p.set(n,f+=4):p.utf8Write(n,f+=4,c),$(p,l,f+=c),u?p.set(o,f+=4):p.latin1Write(o,f+=4,l),$(p,r.screen||0,f+=l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, x11-req)`),Ne(this,this._packetRW.write.finalize(p))}subsystem(t,r,i){if(this._server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(r),o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(23+n);s[o]=Oe.CHANNEL_REQUEST,$(s,t,++o),$(s,9,o+=4),s.utf8Write("subsystem",o+=4,9),s[o+=9]=i===void 0||i===!0?1:0,$(s,n,++o),s.utf8Write(r,o+=4,n),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, subsystem: ${r})`),Ne(this,this._packetRW.write.finalize(s))}openssh_agentForward(t,r){if(this._server)throw new Error("Client-only method called in server mode");let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(36);n[i]=Oe.CHANNEL_REQUEST,$(n,t,++i),$(n,26,i+=4),n.utf8Write("auth-agent-req@openssh.com",i+=4,26),n[i+=26]=r===void 0||r===!0?1:0,this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, auth-agent-req@openssh.com)`),Ne(this,this._packetRW.write.finalize(n))}openssh_hostKeysProve(t){if(this._server)throw new Error("Client-only method called in server mode");let r=0,i=[];for(let s of t){let c=s.getPublicSSH();r+=4+c.length,i.push(c)}let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(35+r);o[n]=Oe.GLOBAL_REQUEST,$(o,29,++n),o.utf8Write("hostkeys-prove-00@openssh.com",n+=4,29),o[n+=29]=1,++n;for(let s of i)$(o,s.length,n),_p(s,o,0,s.length,n+=4),n+=s.length;this._debug&&this._debug("Outbound: Sending GLOBAL_REQUEST (hostkeys-prove-00@openssh.com)"),Ne(this,this._packetRW.write.finalize(o))}serviceAccept(t){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r);if(n[i]=Oe.SERVICE_ACCEPT,$(n,r,++i),n.utf8Write(t,i+=4,r),this._debug&&this._debug(`Outbound: Sending SERVICE_ACCEPT (${t})`),Ne(this,this._packetRW.write.finalize(n)),this._server&&this._banner&&t==="ssh-userauth"){let o=this._banner;this._banner=void 0;let s=Buffer.byteLength(o);i=this._packetRW.write.allocStart;let c=this._packetRW.write.alloc(5+s+4);c[i]=Oe.USERAUTH_BANNER,$(c,s,++i),c.utf8Write(o,i+=4,s),$(c,0,i+=s),this._debug&&this._debug("Outbound: Sending USERAUTH_BANNER"),Ne(this,this._packetRW.write.finalize(c))}}forwardedTcpip(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(n.boundAddr),s=Buffer.byteLength(n.remoteAddr),c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(36+o+4+4+s+4);u[c]=Oe.CHANNEL_OPEN,$(u,15,++c),u.utf8Write("forwarded-tcpip",c+=4,15),$(u,t,c+=15),$(u,r,c+=4),$(u,i,c+=4),$(u,o,c+=4),u.utf8Write(n.boundAddr,c+=4,o),$(u,n.boundPort,c+=o),$(u,s,c+=4),u.utf8Write(n.remoteAddr,c+=4,s),$(u,n.remotePort,c+=s),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, forwarded-tcpip)`),Ne(this,this._packetRW.write.finalize(u))}x11(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(n.originAddr),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(24+o+4);c[s]=Oe.CHANNEL_OPEN,$(c,3,++s),c.utf8Write("x11",s+=4,3),$(c,t,s+=3),$(c,r,s+=4),$(c,i,s+=4),$(c,o,s+=4),c.utf8Write(n.originAddr,s+=4,o),$(c,n.originPort,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, x11)`),Ne(this,this._packetRW.write.finalize(c))}openssh_authAgent(t,r,i){if(!this._server)throw new Error("Server-only method called in client mode");let n=this._packetRW.write.allocStart,o=this._packetRW.write.alloc(39);o[n]=Oe.CHANNEL_OPEN,$(o,22,++n),o.utf8Write("auth-agent@openssh.com",n+=4,22),$(o,t,n+=22),$(o,r,n+=4),$(o,i,n+=4),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, auth-agent@openssh.com)`),Ne(this,this._packetRW.write.finalize(o))}openssh_forwardedStreamLocal(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=Buffer.byteLength(n.socketPath),s=this._packetRW.write.allocStart,c=this._packetRW.write.alloc(54+o+4);c[s]=Oe.CHANNEL_OPEN,$(c,33,++s),c.utf8Write("forwarded-streamlocal@openssh.com",s+=4,33),$(c,t,s+=33),$(c,r,s+=4),$(c,i,s+=4),$(c,o,s+=4),c.utf8Write(n.socketPath,s+=4,o),$(c,0,s+=o),this._debug&&this._debug(`Outbound: Sending CHANNEL_OPEN (r:${t}, forwarded-streamlocal@openssh.com)`),Ne(this,this._packetRW.write.finalize(c))}exitStatus(t,r){if(!this._server)throw new Error("Server-only method called in client mode");let i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(25);n[i]=Oe.CHANNEL_REQUEST,$(n,t,++i),$(n,11,i+=4),n.utf8Write("exit-status",i+=4,11),n[i+=11]=0,$(n,r,++i),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, exit-status: ${r})`),Ne(this,this._packetRW.write.finalize(n))}exitSignal(t,r,i,n){if(!this._server)throw new Error("Server-only method called in client mode");let o=r;if(typeof o!="string"||!o)throw new Error(`Invalid signal: ${o}`);let s=r.toUpperCase();if(s.slice(0,3)==="SIG"&&(s=s.slice(3)),lw[s]!==1)throw new Error(`Invalid signal: ${o}`);let c=Buffer.byteLength(s),u=n?Buffer.byteLength(n):0,l=this._packetRW.write.allocStart,f=this._packetRW.write.alloc(25+c+1+4+u+4);f[l]=Oe.CHANNEL_REQUEST,$(f,t,++l),$(f,11,l+=4),f.utf8Write("exit-signal",l+=4,11),f[l+=11]=0,$(f,c,++l),f.utf8Write(s,l+=4,c),f[l+=c]=i?1:0,$(f,u,++l),l+=4,u&&(f.utf8Write(n,l,u),l+=u),$(f,0,l),this._debug&&this._debug(`Outbound: Sending CHANNEL_REQUEST (r:${t}, exit-signal: ${r})`),Ne(this,this._packetRW.write.finalize(f))}authFailure(t,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let i;if(typeof t=="boolean"&&(r=t,t=void 0),t){i=[];for(let c=0;c<t.length;++c)t[c].toLowerCase()!=="none"&&i.push(t[c]);i=i.join(",")}else i="";let n=i.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+n+1);s[o]=Oe.USERAUTH_FAILURE,$(s,n,++o),s.utf8Write(i,o+=4,n),s[o+=n]=r===!0?1:0,this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_FAILURE"),Ne(this,this._packetRW.write.finalize(s))}authSuccess(){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0)throw new Error("No auth in progress");let t=this._packetRW.write.allocStart,r=this._packetRW.write.alloc(1);r[t]=Oe.USERAUTH_SUCCESS,this._authsQueue.shift(),this._authenticated=!0,this._debug&&this._debug("Outbound: Sending USERAUTH_SUCCESS"),Ne(this,this._packetRW.write.finalize(r)),this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.read=new Ew),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.write=new Aw(this))}authPKOK(t,r){if(!this._server)throw new Error("Server-only method called in client mode");if(this._authsQueue.length===0||this._authsQueue[0]!=="publickey")throw new Error('"publickey" auth not in progress');let i=Buffer.byteLength(t),n=r.length,o=this._packetRW.write.allocStart,s=this._packetRW.write.alloc(5+i+4+n);s[o]=Oe.USERAUTH_PK_OK,$(s,i,++o),s.utf8Write(t,o+=4,i),$(s,n,o+=i),s.set(r,o+=4),this._authsQueue.shift(),this._debug&&this._debug("Outbound: Sending USERAUTH_PK_OK"),Ne(this,this._packetRW.write.finalize(s))}authPasswdChg(t){if(!this._server)throw new Error("Server-only method called in client mode");let r=Buffer.byteLength(t),i=this._packetRW.write.allocStart,n=this._packetRW.write.alloc(5+r+4);n[i]=Oe.USERAUTH_PASSWD_CHANGEREQ,$(n,r,++i),n.utf8Write(t,i+=4,r),$(n,0,i+=r),this._debug&&this._debug("Outbound: Sending USERAUTH_PASSWD_CHANGEREQ"),Ne(this,this._packetRW.write.finalize(n))}authInfoReq(t,r,i){if(!this._server)throw new Error("Server-only method called in client mode");let n=0,o=t?Buffer.byteLength(t):0,s=r?Buffer.byteLength(r):0;for(let l=0;l<i.length;++l)n+=4+Buffer.byteLength(i[l].prompt)+1;let c=this._packetRW.write.allocStart,u=this._packetRW.write.alloc(5+o+4+s+4+4+n);u[c]=Oe.USERAUTH_INFO_REQUEST,$(u,o,++c),c+=4,t&&(u.utf8Write(t,c,o),c+=o),$(u,s,c),c+=4,r&&(u.utf8Write(r,c,s),c+=s),$(u,0,c),$(u,i.length,c+=4),c+=4;for(let l=0;l<i.length;++l){let f=i[l],p=Buffer.byteLength(f.prompt);$(u,p,c),c+=4,p&&(u.utf8Write(f.prompt,c,p),c+=p),u[c++]=f.echo?1:0}this._debug&&this._debug("Outbound: Sending USERAUTH_INFO_REQUEST"),Ne(this,this._packetRW.write.finalize(u))}},UD=/^SSH-(2\.0|1\.99)-([^ ]+)(?: (.*))?$/;function MD(e,t,r){let i,n;this._buffer?(i=Buffer.allocUnsafe(this._buffer.length+(r-t)),i.set(this._buffer,0),t===0?i.set(e,this._buffer.length):i.set(new Uint8Array(e.buffer,e.byteOffset+t,r-t),this._buffer.length),n=this._buffer.length,t=0):(i=e,n=0);let o=t,s=t,c=t,u=!1,l=0,f=0;for(;t<i.length;++t){let p=i[t];if(p===13){u=!0;continue}if(p===10){if(c>s&&c-s>4&&i[s]===83&&i[s+1]===83&&i[s+2]===72&&i[s+3]===45){let g=i.latin1Slice(o,c+1),h=s===o?g:g.slice(s-o),_=UD.exec(h);if(!_)throw new Error("Invalid identification string");let y={greeting:s===o?"":g.slice(0,s-o),identRaw:h,versions:{protocol:_[1],software:_[2]},comments:_[3]};return this._remoteIdentRaw=Buffer.from(h),this._debug&&this._debug(`Remote ident: ${gw(h)}`),this._compatFlags=jD(y),this._buffer=void 0,this._decipher=new ID(0,TD.bind(this,{firstPacket:!0})),this._parse=FD,this._onHeader(y),this._destruct?(_w(this),t+1-n):r}if(this._server)throw new Error("Greetings from clients not permitted");if(++f>zD)throw new Error("Max greeting lines exceeded");u=!1,s=t+1,l=0}else{if(u)throw new Error("Invalid header: expected newline");if(++l>=BD)throw new Error("Header line too long")}c=t}return this._buffer||(this._buffer=yw(i,o)),t-n}a(MD,"parseHeader");function FD(e,t,r){return this._decipher.decrypt(e,t,r)}a(FD,"parsePacket");function HD(e){if(this._onPacket(),e.length===0){this._debug&&this._debug("Inbound: Skipping empty packet payload");return}e=this._packetRW.read.read(e);let t=e[0];t===Oe.USERAUTH_SUCCESS&&!this._server&&!this._authenticated&&(this._authenticated=!0,this._kex.negotiated.cs.compress==="zlib@openssh.com"&&(this._packetRW.write=new Aw(this)),this._kex.negotiated.sc.compress==="zlib@openssh.com"&&(this._packetRW.read=new Ew));let r=kD[t];if(r===void 0){this._debug&&this._debug(`Inbound: Unsupported message type: ${t}`);return}return r(this,e)}a(HD,"onPayload");function jD(e){let t=e.versions.software,r=0;for(let i of vD)typeof i[0]=="string"?t===i[0]&&(r|=i[1]):i[0].test(t)&&(r|=i[1]);return r}a(jD,"getCompatFlags");function WD(e){let t=Object.keys(e),r=Buffer.allocUnsafe(5*t.length+1),i=0;for(let n=0;n<t.length;++n){let o=t[n];if(o==="TTY_OP_END")continue;let s=tA[o];if(s===void 0)continue;let c=e[o];typeof c=="number"&&isFinite(c)&&(r[i++]=s,r[i++]=c>>>24,r[i++]=c>>>16,r[i++]=c>>>8,r[i++]=c)}return r[i++]=tA.TTY_OP_END,i<r.length?yw(r,0,i):r}a(WD,"modesToBytes");function qD(e){let t="ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss";SD&&(t=`ssh-ed25519,${t}`);let r=Buffer.byteLength(t),i=e._packetRW.write.allocStart,n=e._packetRW.write.alloc(28+r);n[i]=Oe.EXT_INFO,$(n,1,++i),$(n,15,i+=4),n.utf8Write("server-sig-algs",i+=4,15),$(n,r,i+=15),n.utf8Write(t,i+=4,r),e._debug&&e._debug("Outbound: Sending EXT_INFO"),Ne(e,e._packetRW.write.finalize(n))}a(qD,"sendExtInfo");xw.exports=rA});var Tw=me(wu=>{"use strict";var yp=require("assert"),{inspect:VD}=require("util");function Iw(e){let t="",r=e.length,i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}a(Iw,"addNumericalSeparator");function vw(e,t){if(yp(typeof t=="string","`thing` has to be of type string"),Array.isArray(e)){let r=e.length;return yp(r>0,"At least one expected value needs to be specified"),e=e.map(i=>String(i)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}a(vw,"oneOf");wu.ERR_INTERNAL_ASSERTION=class ww extends Error{static{a(this,"ERR_INTERNAL_ASSERTION")}constructor(t){super(),Error.captureStackTrace(this,ww);let r=`This is caused by either a bug in ssh2 or incorrect usage of ssh2 internals.
17
17
  Please open an issue with this stack trace at https://github.com/mscdex/ssh2/issues
18
- `;this.message=e===void 0?r:`${e}
19
- ${r}`}};var Dv=2**32,Um=(()=>{try{return new Function("return 2n ** 32n")()}catch{}})();ds.ERR_OUT_OF_RANGE=class zm extends RangeError{static{c(this,"ERR_OUT_OF_RANGE")}constructor(e,r,n,i){super(),Error.captureStackTrace(this,zm),Ga(r,'Missing "range" argument');let o=i?e:`The value of "${e}" is out of range.`,s;Number.isInteger(n)&&Math.abs(n)>Dv?s=Dm(String(n)):typeof n=="bigint"?(s=String(n),(n>Um||n<-Um)&&(s=Dm(s)),s+="n"):s=$v(n),o+=` It must be ${r}. Received ${s}`,this.message=o}};var Za=class t extends TypeError{static{c(this,"ERR_INVALID_ARG_TYPE")}constructor(e,r,n){super(),Error.captureStackTrace(this,t),Ga(typeof e=="string","'name' must be a string");let i;typeof r=="string"&&r.startsWith("not ")?(i="must not be",r=r.replace(/^not /,"")):i="must be";let o;if(e.endsWith(" argument"))o=`The ${e} ${i} ${Bm(r,"type")}`;else{let s=e.includes(".")?"property":"argument";o=`The "${e}" ${s} ${i} ${Bm(r,"type")}`}o+=`. Received type ${typeof n}`,this.message=o}};ds.ERR_INVALID_ARG_TYPE=Za;ds.validateNumber=c(function(e,r){if(typeof e!="number")throw new Za(r,"number",e)},"validateNumber")});var ps=le((KF,Jm)=>{"use strict";var Bv=require("events"),qn=require("fs"),{constants:Tr}=qn,{Readable:Qm,Writable:Jl}=require("stream"),{inherits:Vm,types:{isDate:Vl}}=require("util"),Uv=Buffer[Symbol.species],{bufferCopy:Wn,bufferSlice:oo,makeBufferParser:Lv,writeUInt32BE:G}=Vr(),In={SIZE:1,UIDGID:2,PERMISSIONS:4,ACMODTIME:8,EXTENDED:2147483648},De=Buffer.alloc(28),mt={OK:0,EOF:1,NO_SUCH_FILE:2,PERMISSION_DENIED:3,FAILURE:4,BAD_MESSAGE:5,NO_CONNECTION:6,CONNECTION_LOST:7,OP_UNSUPPORTED:8},zv=new Map(Object.values(mt).map(t=>[t,1])),Mv={[mt.OK]:"No error",[mt.EOF]:"End of file",[mt.NO_SUCH_FILE]:"No such file or directory",[mt.PERMISSION_DENIED]:"Permission denied",[mt.FAILURE]:"Failure",[mt.BAD_MESSAGE]:"Bad message",[mt.NO_CONNECTION]:"No connection",[mt.CONNECTION_LOST]:"Connection lost",[mt.OP_UNSUPPORTED]:"Operation unsupported"},Ne={INIT:1,OPEN:3,CLOSE:4,READ:5,WRITE:6,LSTAT:7,FSTAT:8,SETSTAT:9,FSETSTAT:10,OPENDIR:11,READDIR:12,REMOVE:13,MKDIR:14,RMDIR:15,REALPATH:16,STAT:17,RENAME:18,READLINK:19,SYMLINK:20,EXTENDED:200},Cr={VERSION:2,STATUS:101,HANDLE:102,DATA:103,NAME:104,ATTRS:105,EXTENDED:201},Te={READ:1,WRITE:2,APPEND:4,CREAT:8,TRUNC:16,EXCL:32},Fm=2*1024,St=2**32-1,Fv=Buffer.from([0,0,0,5,Ne.INIT,0,0,0,3]),Hv=Buffer.from([0,0,0,5,Cr.VERSION,0,0,0,3]),jv=/^SSH-2.0-(?:OpenSSH|dropbear)/,ql=256*1024,U=Lv(),Wv={readable:!1,writable:!1,push:c(t=>{},"push"),once:c(()=>{},"once"),on:c(()=>{},"on"),emit:c(()=>{},"emit"),end:c(()=>{},"end")};function Km(){}c(Km,"noop");var Kl=class extends Bv{static{c(this,"SFTP")}constructor(e,r,n){super(),(typeof n!="object"||!n)&&(n={});let i=e._protocol._remoteIdentRaw;this.server=!!n.server,this._debug=typeof n.debug=="function"?n.debug:void 0,this._isOpenSSH=i&&jv.test(i),this._version=-1,this._extensions={},this._biOpt=n.biOpt,this._pktLenBytes=0,this._pktLen=0,this._pktPos=0,this._pktType=0,this._pktData=void 0,this._writeReqid=-1,this._requests={},this._maxInPktLen=ql,this._maxOutPktLen=34e3,this._maxReadLen=(this._isOpenSSH?ql:34e3)-Fm,this._maxWriteLen=(this._isOpenSSH?ql:34e3)-Fm,this.maxOpenHandles=void 0,this._client=e,this._protocol=e._protocol,this._callbacks=[],this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this._waitWindow=!1,this._chunkcb=void 0,this._buffer=[],this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this.stderr=Wv,this.readable=!0}push(e){if(e===null){if(Xm(this),!this.readable)return;this.readable=!1,this.emit("end");return}let r=0;for(;r<e.length;){if(this._pktLenBytes<4){let s=Math.min(4-this._pktLenBytes,e.length-r);for(this._pktLenBytes+=s;s--;)this._pktLen=(this._pktLen<<8)+e[r++];if(this._pktLenBytes<4)return;if(this._pktLen===0)return At(this,"Invalid packet length");if(this._pktLen>this._maxInPktLen){let a=this._maxInPktLen;return At(this,`Packet length ${this._pktLen} exceeds max length of ${a}`)}if(r>=e.length)return}if(this._pktPos<this._pktLen){let s=Math.min(this._pktLen-this._pktPos,e.length-r);if(r!==0||s!==e.length?s===this._pktLen?this._pkt=new Uv(e.buffer,e.byteOffset+r,s):(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(new Uint8Array(e.buffer,e.byteOffset+r,s),this._pktPos)):s===this._pktLen?this._pkt=e:(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(e,this._pktPos)),r+=s,this._pktPos+=s,this._pktPos<this._pktLen)return}let n=this._pkt[0],i=this._pkt;this._pktLen=0,this._pktLenBytes=0,this._pkt=void 0,this._pktPos=0;let o=this.server?Gv[n]:Kv[n];if(!o)return At(this,`Unknown packet type ${n}`);if(this._version===-1){if(this.server){if(n!==Ne.INIT)return At(this,`Expected INIT packet, got ${n}`)}else if(n!==Cr.VERSION)return At(this,`Expected VERSION packet, got ${n}`)}if(o(this,i)===!1)return}}end(){this.destroy()}destroy(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._protocol.channelClose(this.outgoing.id))}_init(){this._init=Km,this.server||ft(this,Fv)}createReadStream(e,r){if(this.server)throw new Error("Client-only method called in server mode");return new vn(this,e,r)}createWriteStream(e,r){if(this.server)throw new Error("Client-only method called in server mode");return new Hr(this,e,r)}open(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");typeof n=="function"&&(i=n,n=void 0);let o=typeof r=="number"?r:Zm(r);if(o===null)throw new Error(`Unknown flags string: ${r}`);let s=0,a=0;(typeof n=="string"||typeof n=="number")&&(n={mode:n}),typeof n=="object"&&n!==null&&(n=fi(n),s=n.flags,a=n.nb);let u=Buffer.byteLength(e),l=9,d=Buffer.allocUnsafe(13+u+4+4+a);G(d,d.length-4,0),d[4]=Ne.OPEN;let p=this._writeReqid=this._writeReqid+1&St;G(d,p,5),G(d,u,l),d.utf8Write(e,l+=4,u),G(d,o,l+=u),G(d,s,l+=4),a&&(l+=4,a===De.length?d.set(De,l):Wn(De,d,0,a,l),l+=a),this._requests[p]={cb:i};let g=ft(this,d);this._debug&&this._debug(`SFTP: Outbound: ${g?"Buffered":"Sending"} OPEN`)}close(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let n=e.length,i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.CLOSE;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.set(e,i+=4),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} CLOSE`)}read(e,r,n,i,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(n>=r.length)throw new Error("offset is out of bounds");if(n+i>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");Gm(this,e,r,n,i,o,s)}readData(e,r,n,i,o,s){this.read(e,r,n,i,o,s)}write(e,r,n,i,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(n>r.length)throw new Error("offset is out of bounds");if(n+i>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");if(!i){s&&process.nextTick(s,void 0,0);return}let a=this._maxWriteLen,u=Math.max(i-a,0),l=o;u&&(i=a);let d=e.length,p=9,g=Buffer.allocUnsafe(13+d+8+4+i);G(g,g.length-4,0),g[4]=Ne.WRITE;let h=this._writeReqid=this._writeReqid+1&St;G(g,h,5),G(g,d,p),g.set(e,p+=4),p+=d;for(let b=7;b>=0;--b)g[p+b]=o&255,o/=256;G(g,i,p+=8),Wn(r,g,n,n+i,p+=4),this._requests[h]={cb:c(b=>{b?typeof s=="function"&&s(b):u?this.write(e,r,n+i,u,l+i,s):typeof s=="function"&&s(void 0,n+i)},"cb")};let _=ft(this,g);if(this._debug){let b=_?"Sent":"Buffered";this._debug(`SFTP: Outbound: ${b} WRITE (id:${h})`)}}writeData(e,r,n,i,o,s){this.write(e,r,n,i,o,s)}fastGet(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");Hm(this,qn,e,r,n,i)}fastPut(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");Hm(qn,this,e,r,n,i)}readFile(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i;if(typeof n=="function"?i=n:typeof r=="function"&&(i=r,r=void 0),typeof r=="string")r={encoding:r,flag:"r"};else if(!r)r={encoding:null,flag:"r"};else if(typeof r!="object")throw new TypeError("Bad arguments");let o=r.encoding;if(o&&!Buffer.isEncoding(o))throw new Error(`Unknown encoding: ${o}`);let s,a,u,l=0,d,p=0,g=r.flag||"r",h=c(()=>{s===0?(a=Buffer.allocUnsafe(8192),this.read(d,a,0,8192,p,_)):this.read(d,a,l,s-l,p,_)},"read"),_=c((E,v)=>{let w;if(E){if(w=E.code===mt.EOF,!w)return this.close(d,()=>i&&i(E))}else w=!1;if(w||s===0&&v===0)return b();p+=v,l+=v,s!==0?l===s?b():h():(u.push(oo(a,0,v)),h())},"afterRead");_._wantEOFError=!0;let b=c(()=>{this.close(d,E=>(s===0?a=Buffer.concat(u,l):l<s&&(a=oo(a,0,l)),o&&(a=a.toString(o)),i&&i(E,a)))},"close");this.open(e,g,438,(E,v)=>{if(E)return i&&i(E);d=v;let w=c((H,D)=>{if(H){this.stat(e,(J,Y)=>{if(J)return this.close(d,()=>{i&&i(H)});w(null,Y)});return}if(s=D.size||0,s===0)return u=[],h();a=Buffer.allocUnsafe(s),h()},"tryStat");this.fstat(d,w)})}writeFile(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof i=="function"?o=i:typeof n=="function"&&(o=n,n=void 0),typeof n=="string")n={encoding:n,mode:438,flag:"w"};else if(!n)n={encoding:"utf8",mode:438,flag:"w"};else if(typeof n!="object")throw new TypeError("Bad arguments");if(n.encoding&&!Buffer.isEncoding(n.encoding))throw new Error(`Unknown encoding: ${n.encoding}`);let s=n.flag||"w";this.open(e,s,n.mode,(a,u)=>{if(a)o&&o(a);else{let l=Buffer.isBuffer(r)?r:Buffer.from(""+r,n.encoding||"utf8"),d=/a/.test(s)?null:0;if(d===null){let p=c((g,h)=>{if(g){this.stat(e,(_,b)=>{if(_)return this.close(u,()=>{o&&o(g)});p(null,b)});return}Gl(this,u,l,0,l.length,h.size,o)},"tryStat");this.fstat(u,p);return}Gl(this,u,l,0,l.length,d,o)}})}appendFile(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof i=="function"?o=i:typeof n=="function"&&(o=n,n=void 0),typeof n=="string")n={encoding:n,mode:438,flag:"a"};else if(!n)n={encoding:"utf8",mode:438,flag:"a"};else if(typeof n!="object")throw new TypeError("Bad arguments");n.flag||(n=Object.assign({flag:"a"},n)),this.writeFile(e,r,n,o)}exists(e,r){if(this.server)throw new Error("Client-only method called in server mode");this.stat(e,n=>{r&&r(!n)})}unlink(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.REMOVE;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} REMOVE`)}rename(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(e),o=Buffer.byteLength(r),s=9,a=Buffer.allocUnsafe(13+i+4+o);G(a,a.length-4,0),a[4]=Ne.RENAME;let u=this._writeReqid=this._writeReqid+1&St;G(a,u,5),G(a,i,s),a.utf8Write(e,s+=4,i),G(a,o,s+=i),a.utf8Write(r,s+=4,o),this._requests[u]={cb:n};let l=ft(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} RENAME`)}mkdir(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=0,o=0;typeof r=="function"&&(n=r,r=void 0),typeof r=="object"&&r!==null&&(r=fi(r),i=r.flags,o=r.nb);let s=Buffer.byteLength(e),a=9,u=Buffer.allocUnsafe(13+s+4+o);G(u,u.length-4,0),u[4]=Ne.MKDIR;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,s,a),u.utf8Write(e,a+=4,s),G(u,i,a+=s),o&&(a+=4,o===De.length?u.set(De,a):Wn(De,u,0,o,a),a+=o),this._requests[l]={cb:n};let d=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${d?"Buffered":"Sending"} MKDIR`)}rmdir(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.RMDIR;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} RMDIR`)}readdir(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");typeof r=="function"&&(n=r,r={}),(typeof r!="object"||r===null)&&(r={});let i=!(r&&r.full);if(!Buffer.isBuffer(e)&&typeof e!="string")throw new Error("missing directory handle or path");if(typeof e=="string"){let d=[],p=0,g=c((h,_)=>{if(h)return n(h);this.readdir(_,r,(b,E)=>{let v=b&&b.code===mt.EOF;if(b&&!v)return this.close(_,()=>n(b));if(v)return this.close(_,w=>{if(w)return n(w);n(void 0,d)});for(let w=0;w<E.length;++w,++p)d[p]=E[w];g(void 0,_)})},"reread");return this.opendir(e,g)}let o=e.length,s=9,a=Buffer.allocUnsafe(13+o);G(a,a.length-4,0),a[4]=Ne.READDIR;let u=this._writeReqid=this._writeReqid+1&St;G(a,u,5),G(a,o,s),a.set(e,s+=4),this._requests[u]={cb:i?(d,p)=>{if(typeof n=="function"){if(d)return n(d);for(let g=p.length-1;g>=0;--g)(p[g].filename==="."||p[g].filename==="..")&&p.splice(g,1);n(void 0,p)}}:n};let l=ft(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} READDIR`)}fstat(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let n=e.length,i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.FSTAT;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.set(e,i+=4),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} FSTAT`)}stat(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.STAT;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} STAT`)}lstat(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.LSTAT;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} LSTAT`)}opendir(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.OPENDIR;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:r};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} OPENDIR`)}setstat(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=0,o=0;typeof r=="object"&&r!==null?(r=fi(r),i=r.flags,o=r.nb):typeof r=="function"&&(n=r);let s=Buffer.byteLength(e),a=9,u=Buffer.allocUnsafe(13+s+4+o);G(u,u.length-4,0),u[4]=Ne.SETSTAT;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,s,a),u.utf8Write(e,a+=4,s),G(u,i,a+=s),o&&(a+=4,o===De.length?u.set(De,a):Wn(De,u,0,o,a),a+=o),this._requests[l]={cb:n};let d=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${d?"Buffered":"Sending"} SETSTAT`)}fsetstat(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let i=0,o=0;typeof r=="object"&&r!==null?(r=fi(r),i=r.flags,o=r.nb):typeof r=="function"&&(n=r);let s=e.length,a=9,u=Buffer.allocUnsafe(13+s+4+o);G(u,u.length-4,0),u[4]=Ne.FSETSTAT;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,s,a),u.set(e,a+=4),G(u,i,a+=s),o&&(a+=4,o===De.length?u.set(De,a):Wn(De,u,0,o,a),a+=o),this._requests[l]={cb:n};let d=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${d?"Buffered":"Sending"} FSETSTAT`)}futimes(e,r,n,i){return this.fsetstat(e,{atime:no(r),mtime:no(n)},i)}utimes(e,r,n,i){return this.setstat(e,{atime:no(r),mtime:no(n)},i)}fchown(e,r,n,i){return this.fsetstat(e,{uid:r,gid:n},i)}chown(e,r,n,i){return this.setstat(e,{uid:r,gid:n},i)}fchmod(e,r,n){return this.fsetstat(e,{mode:r},n)}chmod(e,r,n){return this.setstat(e,{mode:r},n)}readlink(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.READLINK;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:c((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing link info"));r(void 0,l[0].filename)}},"cb")};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} READLINK`)}symlink(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(r),o=Buffer.byteLength(e),s=9,a=Buffer.allocUnsafe(13+i+4+o);G(a,a.length-4,0),a[4]=Ne.SYMLINK;let u=this._writeReqid=this._writeReqid+1&St;G(a,u,5),this._isOpenSSH?(G(a,o,s),a.utf8Write(e,s+=4,o),G(a,i,s+=o),a.utf8Write(r,s+=4,i)):(G(a,i,s),a.utf8Write(r,s+=4,i),G(a,o,s+=i),a.utf8Write(e,s+=4,o)),this._requests[u]={cb:n};let l=ft(this,a);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} SYMLINK`)}realpath(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(e),i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Ne.REALPATH;let s=this._writeReqid=this._writeReqid+1&St;G(o,s,5),G(o,n,i),o.utf8Write(e,i+=4,n),this._requests[s]={cb:c((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing path info"));r(void 0,l[0].filename)}},"cb")};let a=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} REALPATH`)}ext_openssh_rename(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");let i=this._extensions["posix-rename@openssh.com"];if(!i||i!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(e),s=Buffer.byteLength(r),a=9,u=Buffer.allocUnsafe(41+o+4+s);G(u,u.length-4,0),u[4]=Ne.EXTENDED;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,24,a),u.utf8Write("posix-rename@openssh.com",a+=4,24),G(u,o,a+=24),u.utf8Write(e,a+=4,o),G(u,s,a+=o),u.utf8Write(r,a+=4,s),this._requests[l]={cb:n};let d=ft(this,u);if(this._debug){let p=d?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} posix-rename@openssh.com`)}}ext_openssh_statvfs(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=this._extensions["statvfs@openssh.com"];if(!n||n!=="2")throw new Error("Server does not support this extended request");let i=Buffer.byteLength(e),o=9,s=Buffer.allocUnsafe(36+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,19,o),s.utf8Write("statvfs@openssh.com",o+=4,19),G(s,i,o+=19),s.utf8Write(e,o+=4,i),this._requests[a]={extended:"statvfs@openssh.com",cb:r};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} statvfs@openssh.com`)}}ext_openssh_fstatvfs(e,r){if(this.server)throw new Error("Client-only method called in server mode");let n=this._extensions["fstatvfs@openssh.com"];if(!n||n!=="2")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let i=e.length,o=9,s=Buffer.allocUnsafe(37+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,20,o),s.utf8Write("fstatvfs@openssh.com",o+=4,20),G(s,i,o+=20),s.set(e,o+=4),this._requests[a]={extended:"fstatvfs@openssh.com",cb:r};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} fstatvfs@openssh.com`)}}ext_openssh_hardlink(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["hardlink@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(e),s=Buffer.byteLength(r),a=9,u=Buffer.allocUnsafe(37+o+4+s);G(u,u.length-4,0),u[4]=Ne.EXTENDED;let l=this._writeReqid=this._writeReqid+1&St;G(u,l,5),G(u,20,a),u.utf8Write("hardlink@openssh.com",a+=4,20),G(u,o,a+=20),u.utf8Write(e,a+=4,o),G(u,s,a+=o),u.utf8Write(r,a+=4,s),this._requests[l]={cb:n};let d=ft(this,u);if(this._debug){let p=d?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} hardlink@openssh.com`)}}ext_openssh_fsync(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["fsync@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("handle is not a Buffer");let i=e.length,o=9,s=Buffer.allocUnsafe(34+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,17,o),s.utf8Write("fsync@openssh.com",o+=4,17),G(s,i,o+=17),s.set(e,o+=4),this._requests[a]={cb:r};let u=ft(this,s);this._debug&&this._debug(`SFTP: Outbound: ${u?"Buffered":"Sending"} fsync@openssh.com`)}ext_openssh_lsetstat(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["lsetstat@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=0,s=0;typeof r=="object"&&r!==null?(r=fi(r),o=r.flags,s=r.nb):typeof r=="function"&&(n=r);let a=Buffer.byteLength(e),u=9,l=Buffer.allocUnsafe(37+a+4+s);G(l,l.length-4,0),l[4]=Ne.EXTENDED;let d=this._writeReqid=this._writeReqid+1&St;G(l,d,5),G(l,20,u),l.utf8Write("lsetstat@openssh.com",u+=4,20),G(l,a,u+=20),l.utf8Write(e,u+=4,a),G(l,o,u+=a),s&&(u+=4,s===De.length?l.set(De,u):Wn(De,l,0,s,u),u+=s),this._requests[d]={cb:n};let p=ft(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} lsetstat@openssh.com`)}}ext_openssh_expandPath(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["expand-path@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let i=Buffer.byteLength(e),o=9,s=Buffer.allocUnsafe(40+i);G(s,s.length-4,0),s[4]=Ne.EXTENDED;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,5),G(s,23,o),s.utf8Write("expand-path@openssh.com",o+=4,23),G(s,i,o+=20),s.utf8Write(e,o+=4,i),this._requests[a]={cb:c((l,d)=>{if(typeof r=="function"){if(l)return r(l);if(!d||!d.length)return r(new Error("Response missing expanded path"));r(void 0,d[0].filename)}},"cb")};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} expand-path@openssh.com`)}}ext_copy_data(e,r,n,i,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["copy-data"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(e))throw new Error("Source handle is not a Buffer");if(!Buffer.isBuffer(i))throw new Error("Destination handle is not a Buffer");let u=0,l=Buffer.allocUnsafe(26+e.length+8+8+4+i.length+8);G(l,l.length-4,u),u+=4,l[u]=Ne.EXTENDED,++u;let d=this._writeReqid=this._writeReqid+1&St;G(l,d,u),u+=4,G(l,9,u),u+=4,l.utf8Write("copy-data",u,9),u+=9,G(l,e.length,u),u+=4,l.set(e,u),u+=e.length;for(let g=7;g>=0;--g)l[u+g]=r&255,r/=256;u+=8;for(let g=7;g>=0;--g)l[u+g]=n&255,n/=256;u+=8,G(l,i.length,u),u+=4,l.set(i,u),u+=i.length;for(let g=7;g>=0;--g)l[u+g]=o&255,o/=256;this._requests[d]={cb:s};let p=ft(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} copy-data`)}}ext_home_dir(e,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["home-directory"]!=="1")throw new Error("Server does not support this extended request");if(typeof e!="string")throw new TypeError("username is not a string");let i=0,o=Buffer.byteLength(e),s=Buffer.allocUnsafe(31+o);G(s,s.length-4,i),i+=4,s[i]=Ne.EXTENDED,++i;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,i),i+=4,G(s,14,i),i+=4,s.utf8Write("home-directory",i,14),i+=14,G(s,o,i),i+=4,s.utf8Write(e,i,o),i+=o,this._requests[a]={cb:c((l,d)=>{if(typeof r=="function"){if(l)return r(l);if(!d||!d.length)return r(new Error("Response missing home directory"));r(void 0,d[0].filename)}},"cb")};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} home-directory`)}}ext_users_groups(e,r,n){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["users-groups-by-id@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Array.isArray(e))throw new TypeError("uids is not an array");for(let l of e)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("uid values must all be 32-bit unsigned integers");if(!Array.isArray(r))throw new TypeError("gids is not an array");for(let l of r)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("gid values must all be 32-bit unsigned integers");let o=0,s=Buffer.allocUnsafe(47+4*e.length+4+4*r.length);G(s,s.length-4,o),o+=4,s[o]=Ne.EXTENDED,++o;let a=this._writeReqid=this._writeReqid+1&St;G(s,a,o),o+=4,G(s,30,o),o+=4,s.utf8Write("users-groups-by-id@openssh.com",o,30),o+=30,G(s,4*e.length,o),o+=4;for(let l of e)G(s,l,o),o+=4;G(s,4*r.length,o),o+=4;for(let l of r)G(s,l,o),o+=4;this._requests[a]={extended:"users-groups-by-id@openssh.com",cb:n};let u=ft(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} users-groups-by-id@openssh.com`)}}handle(e,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Buffer.isBuffer(r))throw new Error("handle is not a Buffer");let n=r.length;if(n>256)throw new Error("handle too large (> 256 bytes)");let i=9,o=Buffer.allocUnsafe(13+n);G(o,o.length-4,0),o[4]=Cr.HANDLE,G(o,e,5),G(o,n,i),n&&o.set(r,i+=4);let s=ft(this,o);this._debug&&this._debug(`SFTP: Outbound: ${s?"Buffered":"Sending"} HANDLE`)}status(e,r,n){if(!this.server)throw new Error("Server-only method called in client mode");if(!zv.has(r))throw new Error(`Bad status code: ${r}`);n||(n="");let i=Buffer.byteLength(n),o=9,s=Buffer.allocUnsafe(17+i+4);G(s,s.length-4,0),s[4]=Cr.STATUS,G(s,e,5),G(s,r,o),G(s,i,o+=4),o+=4,i&&(s.utf8Write(n,o,i),o+=i),G(s,0,o);let a=ft(this,s);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} STATUS`)}data(e,r,n){if(!this.server)throw new Error("Server-only method called in client mode");let i=Buffer.isBuffer(r);if(!i&&typeof r!="string")throw new Error("data is not a Buffer or string");let o;!i&&!n&&(n=void 0,o=!0);let s=i?r.length:Buffer.byteLength(r,n),a=9,u=Buffer.allocUnsafe(13+s);G(u,u.length-4,0),u[4]=Cr.DATA,G(u,e,5),G(u,s,a),s&&(i?u.set(r,a+=4):o?u.utf8Write(r,a+=4,s):u.write(r,a+=4,s,n));let l=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} DATA`)}name(e,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Array.isArray(r)){if(typeof r!="object"||r===null)throw new Error("names is not an object or array");r=[r]}let n=r.length,i=0,o,s=[];for(let d=0;d<n;++d){let p=r[d],g=!p||!p.filename||typeof p.filename!="string"?"":p.filename;i+=4+Buffer.byteLength(g);let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname;if(i+=4+Buffer.byteLength(h),typeof p.attrs=="object"&&p.attrs!==null){if(o=fi(p.attrs),i+=4+o.nb,o.nb){let _;o.nb===De.length?_=new Uint8Array(De):(_=new Uint8Array(o.nb),Wn(De,_,0,o.nb,0)),o.bytes=_}s.push(o)}else i+=4,s.push(null)}let a=9,u=Buffer.allocUnsafe(13+i);G(u,u.length-4,0),u[4]=Cr.NAME,G(u,e,5),G(u,n,a),a+=4;for(let d=0;d<n;++d){let p=r[d];{let h=!p||!p.filename||typeof p.filename!="string"?"":p.filename,_=Buffer.byteLength(h);G(u,_,a),a+=4,_&&(u.utf8Write(h,a,_),a+=_)}{let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname,_=Buffer.byteLength(h);G(u,_,a),a+=4,_&&(u.utf8Write(h,a,_),a+=_)}let g=s[d];g?(G(u,g.flags,a),a+=4,g.flags&&g.bytes&&(u.set(g.bytes,a),a+=g.nb)):(G(u,0,a),a+=4)}let l=ft(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} NAME`)}attrs(e,r){if(!this.server)throw new Error("Server-only method called in client mode");if(typeof r!="object"||r===null)throw new Error("attrs is not an object");r=fi(r);let n=r.flags,i=r.nb,o=9,s=Buffer.allocUnsafe(13+i);G(s,s.length-4,0),s[4]=Cr.ATTRS,G(s,e,5),G(s,n,o),i&&(o+=4,i===De.length?s.set(De,o):Wn(De,s,0,i,o),o+=i);let a=ft(this,s);this._debug&&this._debug(`SFTP: Outbound: ${a?"Buffered":"Sending"} ATTRS`)}};function qv(t){try{return Buffer.allocUnsafe(t)}catch(e){return e}}c(qv,"tryCreateBuffer");function Gm(t,e,r,n,i,o,s,a){let u=t._maxReadLen,l=Math.max(i-u,0);l&&(i=u);let d=e.length,p=9,g=o,h=Buffer.allocUnsafe(13+d+8+4);G(h,h.length-4,0),h[4]=Ne.READ;let _=t._writeReqid=t._writeReqid+1&St;G(h,_,5),G(h,d,p),h.set(e,p+=4),p+=d;for(let v=7;v>=0;--v)h[p+v]=g&255,g/=256;G(h,i,p+=8),typeof s!="function"&&(s=Km);let b=a||{nb:0,position:o,off:n,origOff:n,len:void 0,overflow:void 0,cb:c((v,w,H)=>{let D=b.len,J=b.overflow;if(v){if(s._wantEOFError||v.code!==mt.EOF)return s(v)}else{if(H>D)return s(new Error("Received more data than requested"));if(H===D&&J){b.nb+=H,b.position+=H,b.off+=H,Gm(t,e,r,b.off,J,b.position,s,b);return}}H=H||0,b.origOff===0&&r.length===b.nb?w=r:w=oo(r,b.origOff,b.origOff+b.nb+H),s(void 0,b.nb+H,w,b.position)},"cb"),buffer:void 0};b.len=i,b.overflow=l,b.buffer=oo(r,n,n+i),t._requests[_]=b;let E=ft(t,h);t._debug&&t._debug(`SFTP: Outbound: ${E?"Buffered":"Sending"} READ`)}c(Gm,"read_");function Hm(t,e,r,n,i,o){let s=64,a=32768,u,l,d;typeof i=="function"?o=i:typeof i=="object"&&i!==null&&(typeof i.concurrency=="number"&&i.concurrency>0&&!isNaN(i.concurrency)&&(s=i.concurrency),typeof i.chunkSize=="number"&&i.chunkSize>0&&!isNaN(i.chunkSize)&&(a=i.chunkSize),typeof i.fileSize=="number"&&i.fileSize>0&&!isNaN(i.fileSize)&&(d=i.fileSize),typeof i.step=="function"&&(u=i.step),(typeof i.mode=="string"||typeof i.mode=="number")&&(l=ef(i.mode)));let p,g=0,h=0,_=!1,b,E,v,w=a*s;function H(D){if(_)return;_=!0;let J=0,Y;b||E?(Y=c(()=>{--J===0&&o(D)},"cbfinal"),b&&(t===qn||t.outgoing.state==="open")&&++J,E&&(e===qn||e.outgoing.state==="open")&&++J,b&&(t===qn||t.outgoing.state==="open")&&t.close(b,Y),E&&(e===qn||e.outgoing.state==="open")&&e.close(E,Y)):o(D)}c(H,"onerror"),t.open(r,"r",(D,J)=>{if(D)return H(D);b=J,d===void 0?t.fstat(b,Y):Y(null,{size:d});function Y(X,P){if(X){if(t!==qn){t.stat(r,(C,M)=>{if(C)return H(X);Y(null,M)});return}return H(X)}p=P.size,e.open(n,"w",(C,M)=>{if(C)return H(C);if(E=M,p<=0)return H();for(;w>p;){if(s===1){w=p;break}w-=a,--s}if(v=qv(w),v instanceof Error)return H(v);l!==void 0?e.fchmod(E,l,c(function B(Z){if(Z){e.chmod(n,l,te=>B());return}j()},"tryAgain")):j();function L(B,Z,te,k,W,q){if(B)return H(B);W=W||0,e.write(E,v,W,Z,k,ee);function ee(ue){if(ue)return H(ue);if(h+=Z,u&&u(h,Z,p),Z<q)return F(W,k+Z,q-Z);if(h===p){e.close(E,he=>{if(E=void 0,he)return H(he);t.close(b,xt=>{if(b=void 0,xt)return H(xt);o()})});return}if(g>=p)return;let me=g+a>p?p-g:a;F(W,g,me),g+=me}c(ee,"writeCb")}c(L,"onread");function T(B,Z,te){return(k,W,q)=>{L(k,W,q,Z,B,te)}}c(T,"makeCb");function F(B,Z,te){t.read(b,v,B,te,Z,T(B,Z,te))}c(F,"singleRead");function j(){let B=0,Z=0;for(;g<p&&B<s;){let te=g+a>p?p-g:a;F(Z,g,te),Z+=te,g+=te,++B}}c(j,"startReads")})}c(Y,"tryStat")})}c(Hm,"fastXfer");function Gl(t,e,r,n,i,o,s){let a=typeof s=="function"?s:void 0;t.write(e,r,n,i,o,(u,l)=>{if(u)return t.close(e,()=>{a&&a(u)});l===i?t.close(e,a):(n+=l,i-=l,o+=l,Gl(t,e,r,n,i,o,a))})}c(Gl,"writeAll");var Xa=class{static{c(this,"Stats")}constructor(e){this.mode=e&&e.mode,this.uid=e&&e.uid,this.gid=e&&e.gid,this.size=e&&e.size,this.atime=e&&e.atime,this.mtime=e&&e.mtime,this.extended=e&&e.extended}isDirectory(){return(this.mode&Tr.S_IFMT)===Tr.S_IFDIR}isFile(){return(this.mode&Tr.S_IFMT)===Tr.S_IFREG}isBlockDevice(){return(this.mode&Tr.S_IFMT)===Tr.S_IFBLK}isCharacterDevice(){return(this.mode&Tr.S_IFMT)===Tr.S_IFCHR}isSymbolicLink(){return(this.mode&Tr.S_IFMT)===Tr.S_IFLNK}isFIFO(){return(this.mode&Tr.S_IFMT)===Tr.S_IFIFO}isSocket(){return(this.mode&Tr.S_IFMT)===Tr.S_IFSOCK}};function fi(t){let e=0,r=0;if(typeof t=="object"&&t!==null){if(typeof t.size=="number"){e|=In.SIZE;let n=t.size;De[r++]=n/72057594037927940,De[r++]=n/281474976710656,De[r++]=n/1099511627776,De[r++]=n/4294967296,De[r++]=n/16777216,De[r++]=n/65536,De[r++]=n/256,De[r++]=n}if(typeof t.uid=="number"&&typeof t.gid=="number"){e|=In.UIDGID;let n=t.uid,i=t.gid;De[r++]=n>>>24,De[r++]=n>>>16,De[r++]=n>>>8,De[r++]=n,De[r++]=i>>>24,De[r++]=i>>>16,De[r++]=i>>>8,De[r++]=i}if(typeof t.mode=="number"||typeof t.mode=="string"){let n=ef(t.mode);e|=In.PERMISSIONS,De[r++]=n>>>24,De[r++]=n>>>16,De[r++]=n>>>8,De[r++]=n}if((typeof t.atime=="number"||Vl(t.atime))&&(typeof t.mtime=="number"||Vl(t.mtime))){let n=no(t.atime),i=no(t.mtime);e|=In.ACMODTIME,De[r++]=n>>>24,De[r++]=n>>>16,De[r++]=n>>>8,De[r++]=n,De[r++]=i>>>24,De[r++]=i>>>16,De[r++]=i>>>8,De[r++]=i}}return{flags:e,nb:r}}c(fi,"attrsToBytes");function no(t){if(typeof t=="number"&&t===t)return t;if(Vl(t))return parseInt(t.getTime()/1e3,10);throw new Error(`Cannot parse time: ${t}`)}c(no,"toUnixTimestamp");function ef(t){if(typeof t=="number"&&t===t)return t;if(typeof t=="string")return ef(parseInt(t,8));throw new Error(`Cannot parse mode: ${t}`)}c(ef,"modeNum");var Zl={r:Te.READ,"r+":Te.READ|Te.WRITE,w:Te.TRUNC|Te.CREAT|Te.WRITE,wx:Te.TRUNC|Te.CREAT|Te.WRITE|Te.EXCL,xw:Te.TRUNC|Te.CREAT|Te.WRITE|Te.EXCL,"w+":Te.TRUNC|Te.CREAT|Te.READ|Te.WRITE,"wx+":Te.TRUNC|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL,"xw+":Te.TRUNC|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL,a:Te.APPEND|Te.CREAT|Te.WRITE,ax:Te.APPEND|Te.CREAT|Te.WRITE|Te.EXCL,xa:Te.APPEND|Te.CREAT|Te.WRITE|Te.EXCL,"a+":Te.APPEND|Te.CREAT|Te.READ|Te.WRITE,"ax+":Te.APPEND|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL,"xa+":Te.APPEND|Te.CREAT|Te.READ|Te.WRITE|Te.EXCL};function Zm(t){let e=Zl[t];return e!==void 0?e:null}c(Zm,"stringToFlags");var Qv=(()=>{let t=Object.keys(Zl);return e=>{for(let r=0;r<t.length;++r){let n=t[r];if(Zl[n]===e)return n}return null}})();function io(t){let e=U.readUInt32BE();if(e===void 0)return;let r=new Xa;if(e&In.SIZE){let n=U.readUInt64BE(t);if(n===void 0)return;r.size=n}if(e&In.UIDGID){let n=U.readUInt32BE(),i=U.readUInt32BE();if(i===void 0)return;r.uid=n,r.gid=i}if(e&In.PERMISSIONS){let n=U.readUInt32BE();if(n===void 0)return;r.mode=n}if(e&In.ACMODTIME){let n=U.readUInt32BE(),i=U.readUInt32BE();if(i===void 0)return;r.atime=n,r.mtime=i}if(e&In.EXTENDED){let n=U.readUInt32BE();if(n===void 0)return;let i={};for(let o=0;o<n;++o){let s=U.readString(!0),a=U.readString();if(a===void 0)return;i[s]=a}r.extended=i}return r}c(io,"readAttrs");function ft(t,e){let r=Ym(t,e);return r!==void 0?(t._buffer.push(r),!1):!0}c(ft,"sendOrBuffer");function Ym(t,e){let r=t.outgoing;if(r.state!=="open")return;if(r.window===0)return t._waitWindow=!0,t._chunkcb=jm,e;let n,i=e.length,o=0;for(;i-o>0&&r.window>0;){let s=Math.min(i-o,r.window,r.packetSize);r.window-=s,r.window===0&&(t._waitWindow=!0,t._chunkcb=jm),o===0&&s===i?t._protocol.channelData(t.outgoing.id,e):t._protocol.channelData(t.outgoing.id,oo(e,o,o+s)),o+=s}return i-o>0&&(o>0?n=oo(e,o,i):n=e),n}c(Ym,"tryWritePayload");function jm(){this._chunkcb=void 0;let t=this._buffer,e=0;for(;e<t.length;){let r=t[e],n=Ym(this,r);if(n!==void 0){n!==r&&(t[e]=n),e>0&&(this._buffer=t.slice(e));return}++e}e>0&&(this._buffer=[])}c(jm,"drainBuffer");function At(t,e,r){let n=new Error(e);return n.level="sftp-protocol",!r&&t._debug&&t._debug(`SFTP: Inbound: ${e}`),t.emit("error",n),t.destroy(),Xm(t),!1}c(At,"doFatalSFTPError");function Xm(t){let e=Object.keys(t._requests);if(e.length===0)return;let r=t._requests;t._requests={};let n=new Error("No response from server");for(let i=0;i<e.length;++i){let o=r[e[i]];typeof o.cb=="function"&&o.cb(n)}}c(Xm,"cleanupRequests");function Vv(t,e){let r=9,n=Buffer.allocUnsafe(31);G(n,n.length-4,0),n[4]=Ne.EXTENDED;let i=t._writeReqid=t._writeReqid+1&St;G(n,i,5),G(n,18,r),n.utf8Write("limits@openssh.com",r+=4,18),t._requests[i]={extended:"limits@openssh.com",cb:e};let o=ft(t,n);if(t._debug){let s=o?"Buffered":"Sending";t._debug(`SFTP: Outbound: ${s} limits@openssh.com`)}}c(Vv,"requestLimits");var Kv={[Cr.VERSION]:(t,e)=>{if(t._version!==-1)return At(t,"Duplicate VERSION packet");let r={};U.init(e,1);let n=U.readUInt32BE();for(;U.avail();){let i=U.readString(!0),o=U.readString(!0);if(o===void 0){n=void 0;break}r[i]=o}if(U.clear(),n===void 0)return At(t,"Malformed VERSION packet");if(t._debug){let i=Object.keys(r);i.length?t._debug(`SFTP: Inbound: Received VERSION (v${n}, exts:${i})`):t._debug(`SFTP: Inbound: Received VERSION (v${n})`)}if(t._version=n,t._extensions=r,r["limits@openssh.com"]==="1")return Vv(t,(i,o)=>{i||(o.maxPktLen>0&&(t._maxOutPktLen=o.maxPktLen),o.maxReadLen>0&&(t._maxReadLen=o.maxReadLen),o.maxWriteLen>0&&(t._maxWriteLen=o.maxWriteLen),t.maxOpenHandles=o.maxOpenHandles>0?o.maxOpenHandles:1/0),t.emit("ready")});t.emit("ready")},[Cr.STATUS]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readUInt32BE(),i=U.readString(!0);if(U.clear(),t._debug){let s=JSON.stringify(i);t._debug(`SFTP: Inbound: Received STATUS (id:${r}, ${n}, ${s})`)}let o=t._requests[r];if(delete t._requests[r],o&&typeof o.cb=="function"){if(n===mt.OK){o.cb();return}let s=new Error(i||Mv[n]||"Unknown status");s.code=n,o.cb(s)}},[Cr.HANDLE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0)return r!==void 0&&delete t._requests[r],At(t,"Malformed HANDLE packet");t._debug&&t._debug(`SFTP: Inbound: Received HANDLE (id:${r})`);let i=t._requests[r];delete t._requests[r],i&&typeof i.cb=="function"&&i.cb(void 0,n)},[Cr.DATA]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n;if(r!==void 0&&(n=t._requests[r],delete t._requests[r]),n&&typeof n.cb=="function")if(n.buffer){let i=U.readString(n.buffer);if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received DATA (id:${r}, ${i})`),n.cb(void 0,n.buffer,i);return}}else{let i=U.readString();if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received DATA (id:${r}, ${i.length})`),n.cb(void 0,i);return}}else{let i=U.skipString();if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received DATA (id:${r}, ${i})`);return}}return At(t,"Malformed DATA packet")},[Cr.NAME]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n;r!==void 0&&(n=t._requests[r],delete t._requests[r]);let i=U.readUInt32BE();if(i!==void 0){let o=[];for(let s=0;s<i;++s){let a=U.readString(!0),u=U.readString(!0),l=io(t._biOpt);if(l===void 0){o=void 0;break}o.push({filename:a,longname:u,attrs:l})}if(o!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received NAME (id:${r}, ${o.length})`),U.clear(),n&&typeof n.cb=="function"&&n.cb(void 0,o);return}}return U.clear(),At(t,"Malformed NAME packet")},[Cr.ATTRS]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n;r!==void 0&&(n=t._requests[r],delete t._requests[r]);let i=io(t._biOpt);if(U.clear(),i!==void 0){t._debug&&t._debug(`SFTP: Inbound: Received ATTRS (id:${r})`),n&&typeof n.cb=="function"&&n.cb(void 0,i);return}return At(t,"Malformed ATTRS packet")},[Cr.EXTENDED]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE();if(r!==void 0){let n=t._requests[r];if(n)switch(delete t._requests[r],n.extended){case"statvfs@openssh.com":case"fstatvfs@openssh.com":{let i=t._biOpt,o={f_bsize:U.readUInt64BE(i),f_frsize:U.readUInt64BE(i),f_blocks:U.readUInt64BE(i),f_bfree:U.readUInt64BE(i),f_bavail:U.readUInt64BE(i),f_files:U.readUInt64BE(i),f_ffree:U.readUInt64BE(i),f_favail:U.readUInt64BE(i),f_sid:U.readUInt64BE(i),f_flag:U.readUInt64BE(i),f_namemax:U.readUInt64BE(i)};if(o.f_namemax===void 0)break;t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${n.extended})`),U.clear(),typeof n.cb=="function"&&n.cb(void 0,o);return}case"limits@openssh.com":{let i={maxPktLen:U.readUInt64BE(),maxReadLen:U.readUInt64BE(),maxWriteLen:U.readUInt64BE(),maxOpenHandles:U.readUInt64BE()};if(i.maxOpenHandles===void 0)break;t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${n.extended})`),U.clear(),typeof n.cb=="function"&&n.cb(void 0,i);return}case"users-groups-by-id@openssh.com":{let i=U.readUInt32BE();if(i===void 0)break;let o=new Array(i);for(let u=0;u<o.length;++u)o[u]=U.readString(!0);let s=U.readUInt32BE();if(s===void 0)break;let a=new Array(s);for(let u=0;u<a.length;++u)a[u]=U.readString(!0);if(a.length>0&&a[a.length-1]===void 0)break;t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${n.extended})`),U.clear(),typeof n.cb=="function"&&n.cb(void 0,o,a);return}default:t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),U.clear(),typeof n.cb=="function"&&n.cb();return}else{t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),U.clear();return}}return U.clear(),At(t,"Malformed EXTENDED_REPLY packet")}},Gv={[Ne.INIT]:(t,e)=>{if(t._version!==-1)return At(t,"Duplicate INIT packet");let r={};U.init(e,1);let n=U.readUInt32BE();for(;U.avail();){let i=U.readString(!0),o=U.readString(!0);if(o===void 0){n=void 0;break}r[i]=o}if(U.clear(),n===void 0)return At(t,"Malformed INIT packet");if(t._debug){let i=Object.keys(r);i.length?t._debug(`SFTP: Inbound: Received INIT (v${n}, exts:${i})`):t._debug(`SFTP: Inbound: Received INIT (v${n})`)}ft(t,Hv),t._version=n,t._extensions=r,t.emit("ready")},[Ne.OPEN]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=U.readUInt32BE(),o=io(t._biOpt);if(U.clear(),o===void 0)return At(t,"Malformed OPEN packet");t._debug&&t._debug(`SFTP: Inbound: Received OPEN (id:${r})`),t.emit("OPEN",r,n,i,o)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.CLOSE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0||n.length>256)return At(t,"Malformed CLOSE packet");t._debug&&t._debug(`SFTP: Inbound: Received CLOSE (id:${r})`),t.emit("CLOSE",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.READ]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(),i=U.readUInt64BE(t._biOpt),o=U.readUInt32BE();if(U.clear(),o===void 0||n.length>256)return At(t,"Malformed READ packet");t._debug&&t._debug(`SFTP: Inbound: Received READ (id:${r})`),t.emit("READ",r,n,i,o)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.WRITE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(),i=U.readUInt64BE(t._biOpt),o=U.readString();if(U.clear(),o===void 0||n.length>256)return At(t,"Malformed WRITE packet");t._debug&&t._debug(`SFTP: Inbound: Received WRITE (id:${r})`),t.emit("WRITE",r,n,i,o)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.LSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed LSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received LSTAT (id:${r})`),t.emit("LSTAT",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.FSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0||n.length>256)return At(t,"Malformed FSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received FSTAT (id:${r})`),t.emit("FSTAT",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.SETSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=io(t._biOpt);if(U.clear(),i===void 0)return At(t,"Malformed SETSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received SETSTAT (id:${r})`),t.emit("SETSTAT",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.FSETSTAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(),i=io(t._biOpt);if(U.clear(),i===void 0||n.length>256)return At(t,"Malformed FSETSTAT packet");t._debug&&t._debug(`SFTP: Inbound: Received FSETSTAT (id:${r})`),t.emit("FSETSTAT",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.OPENDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed OPENDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received OPENDIR (id:${r})`),t.emit("OPENDIR",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.READDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString();if(U.clear(),n===void 0||n.length>256)return At(t,"Malformed READDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received READDIR (id:${r})`),t.emit("READDIR",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.REMOVE]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed REMOVE packet");t._debug&&t._debug(`SFTP: Inbound: Received REMOVE (id:${r})`),t.emit("REMOVE",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.MKDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=io(t._biOpt);if(U.clear(),i===void 0)return At(t,"Malformed MKDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received MKDIR (id:${r})`),t.emit("MKDIR",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.RMDIR]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed RMDIR packet");t._debug&&t._debug(`SFTP: Inbound: Received RMDIR (id:${r})`),t.emit("RMDIR",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.REALPATH]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed REALPATH packet");t._debug&&t._debug(`SFTP: Inbound: Received REALPATH (id:${r})`),t.emit("REALPATH",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.STAT]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed STAT packet");t._debug&&t._debug(`SFTP: Inbound: Received STAT (id:${r})`),t.emit("STAT",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.RENAME]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=U.readString(!0);if(U.clear(),i===void 0)return At(t,"Malformed RENAME packet");t._debug&&t._debug(`SFTP: Inbound: Received RENAME (id:${r})`),t.emit("RENAME",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.READLINK]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(U.clear(),n===void 0)return At(t,"Malformed READLINK packet");t._debug&&t._debug(`SFTP: Inbound: Received READLINK (id:${r})`),t.emit("READLINK",r,n)||t.status(r,mt.OP_UNSUPPORTED)},[Ne.SYMLINK]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0),i=U.readString(!0);if(U.clear(),i===void 0)return At(t,"Malformed SYMLINK packet");t._debug&&t._debug(`SFTP: Inbound: Received SYMLINK (id:${r})`);let o;t._isOpenSSH?o=t.emit("SYMLINK",r,i,n):o=t.emit("SYMLINK",r,n,i),o||t.status(r,mt.OP_UNSUPPORTED)},[Ne.EXTENDED]:(t,e)=>{U.init(e,1);let r=U.readUInt32BE(),n=U.readString(!0);if(n===void 0)return U.clear(),At(t,"Malformed EXTENDED packet");let i;U.avail()&&(i=U.readRaw()),U.clear(),t._debug&&t._debug(`SFTP: Inbound: Received EXTENDED (id:${r})`),t.emit("EXTENDED",r,n,i)||t.status(r,mt.OP_UNSUPPORTED)}},{ERR_INVALID_ARG_TYPE:Zv,ERR_OUT_OF_RANGE:Ya,validateNumber:Yv}=Mm(),Wm=128,vr,Yl=[];function Xv(t){Yl.length>0?vr=Yl.pop():vr=Buffer.allocUnsafe(t),vr.used=0}c(Xv,"allocNewPool");function Xl(t,e){if(!Number.isSafeInteger(t))throw Yv(t,e),Number.isInteger(t)?new Ya(e,">= 0 and <= 2 ** 53 - 1",t):new Ya(e,"an integer",t);if(t<0)throw new Ya(e,">= 0 and <= 2 ** 53 - 1",t)}c(Xl,"checkPosition");function Ql(t){return t+7&-8}c(Ql,"roundUpToMultipleOf8");function vn(t,e,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}if(r.highWaterMark===void 0&&(r.highWaterMark=64*1024),r.emitClose=!1,r.autoDestroy=!1,Qm.call(this,r),this.path=e,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesRead=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=t,this._opening=!1,this.start!==void 0&&(Xl(this.start,"start"),this.pos=this.start),this.end===void 0)this.end=1/0;else if(this.end!==1/0&&(Xl(this.end,"end"),this.start!==void 0&&this.start>this.end))throw new Ya("start",`<= "end" (here: ${this.end})`,this.start);this.on("end",function(){this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}c(vn,"ReadStream");Vm(vn,Qm);vn.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(t,e)=>{if(this._opening=!1,t){this.emit("error",t),this.autoClose&&this.destroy();return}this.handle=e,this.emit("open",e),this.emit("ready"),this.read()}))};vn.prototype._read=function(t){if(!Buffer.isBuffer(this.handle))return this.once("open",()=>this._read(t));if(this.destroyed)return;(!vr||vr.length-vr.used<Wm)&&Xv(this.readableHighWaterMark||this._readableState.highWaterMark);let e=vr,r=Math.min(vr.length-vr.used,t),n=vr.used;if(this.end!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);this.sftp.read(this.handle,vr,vr.used,r,this.pos,(i,o)=>{if(i){this.emit("error",i),this.autoClose&&this.destroy();return}let s=null;if(n+r===e.used&&e===vr)e.used=Ql(e.used+o-r);else{let a=n+r&-8,u=Ql(n+o);a-u>=Wm&&Yl.push(e.slice(u,a))}o>0&&(this.bytesRead+=o,s=e.slice(n,n+o)),this.pos+=o,this.push(s)}),vr.used=Ql(vr.used+r)};vn.prototype._destroy=function(t,e){if(this._opening&&!Buffer.isBuffer(this.handle)){this.once("open",qm.bind(null,this,e,t));return}qm(this,e,t),this.handle=null,this._opening=!1};function qm(t,e,r){if(!t.handle)return n();t.sftp.close(t.handle,n);function n(i){i=i||r,e(i),t.isClosed=!0,i||t.emit("close")}c(n,"onclose")}c(qm,"closeStream");vn.prototype.close=function(t){this.destroy(null,t)};Object.defineProperty(vn.prototype,"pending",{get(){return this.handle===null},configurable:!0});function Hr(t,e,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}r.emitClose=!1,r.autoDestroy=!1,Jl.call(this,r),this.path=e,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesWritten=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=t,this._opening=!1,this.start!==void 0&&(Xl(this.start,"start"),this.pos=this.start),r.encoding&&this.setDefaultEncoding(r.encoding),this.on("finish",function(){this._writableState.finalCalled||this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}c(Hr,"WriteStream");Vm(Hr,Jl);Hr.prototype._final=function(t){this.autoClose&&this.destroy(),t()};Hr.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(t,e)=>{if(this._opening=!1,t){this.emit("error",t),this.autoClose&&this.destroy();return}this.handle=e;let r=c(n=>{if(n){this.sftp.chmod(this.path,this.mode,i=>r());return}if(this.flags[0]==="a"){let i=c((o,s)=>{if(o){this.sftp.stat(this.path,(a,u)=>{if(a){this.destroy(),this.emit("error",o);return}i(null,u)});return}this.pos=s.size,this.emit("open",e),this.emit("ready")},"tryStat");this.sftp.fstat(e,i);return}this.emit("open",e),this.emit("ready")},"tryAgain");this.sftp.fchmod(e,this.mode,r)}))};Hr.prototype._write=function(t,e,r){if(!Buffer.isBuffer(t)){let n=new Zv("data","Buffer",t);return this.emit("error",n)}if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._write(t,e,r)});this.sftp.write(this.handle,t,0,t.length,this.pos,(n,i)=>{if(n)return this.autoClose&&this.destroy(),r(n);this.bytesWritten+=i,r()}),this.pos+=t.length};Hr.prototype._writev=function(t,e){if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._writev(t,e)});let r=this.sftp,n=this.handle,i=t.length,o=c((s,a)=>{if(s)return this.destroy(),e(s);this.bytesWritten+=a,--i===0&&e()},"onwrite");for(let s=0;s<t.length;++s){let a=t[s].chunk;r.write(n,a,0,a.length,this.pos,o),this.pos+=a.length}};typeof Jl.prototype.destroy!="function"&&(Hr.prototype.destroy=vn.prototype.destroy);Hr.prototype._destroy=vn.prototype._destroy;Hr.prototype.close=function(t){if(t){if(this.isClosed){process.nextTick(t);return}this.on("close",t)}this.autoClose||this.on("finish",this.destroy.bind(this)),this.end()};Hr.prototype.destroySoon=Hr.prototype.end;Object.defineProperty(Hr.prototype,"pending",{get(){return this.handle===null},configurable:!0});Jm.exports={flagsToString:Qv,OPEN_MODE:Te,SFTP:Kl,Stats:Xa,STATUS_CODE:mt,stringToFlags:Zm}});var af=le((ZF,n_)=>{"use strict";var{Duplex:Jv,Readable:eS,Writable:tS}=require("stream"),{CHANNEL_EXTENDED_DATATYPE:{STDERR:e_}}=An(),{bufferSlice:Ja}=Vr(),rS=32*1024,hs=2*1024*1024,of=hs/2,tf=class extends eS{static{c(this,"ClientStderr")}constructor(e,r){super(r),this._channel=e}_read(e){this._channel._waitChanDrain&&(this._channel._waitChanDrain=!1,this._channel.incoming.window<=of&&sf(this._channel))}},rf=class extends tS{static{c(this,"ServerStderr")}constructor(e){super({highWaterMark:hs}),this._channel=e}_write(e,r,n){let i=this._channel,o=i._client._protocol,s=i.outgoing,a=s.packetSize,u=s.id,l=s.window,d=e.length,p=0;if(s.state==="open"){for(;d-p>0&&l>0;){let g=d-p;g>l&&(g=l),g>a&&(g=a),p===0&&g===d?o.channelExtData(u,e,e_):o.channelExtData(u,Ja(e,p,p+g),e_),p+=g,l-=g}if(s.window=l,d-p>0){l===0&&(i._waitWindow=!0),p>0?i._chunkErr=Ja(e,p,d):i._chunkErr=e,i._chunkcbErr=n;return}n()}}},nf=class extends Jv{static{c(this,"Channel")}constructor(e,r,n){let i={highWaterMark:hs,allowHalfOpen:!n||n&&n.allowHalfOpen!==!1,emitClose:!1};super(i),this.allowHalfOpen=i.allowHalfOpen;let o=!!(n&&n.server);this.server=o,this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this._callbacks=[],this._client=e,this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this.stdin=this.stdout=this,o?this.stderr=new rf(this):this.stderr=new tf(this,i),this._waitWindow=!1,this._waitChanDrain=!1,this._chunk=void 0,this._chunkcb=void 0,this._chunkErr=void 0,this._chunkcbErr=void 0,this.on("finish",t_).on("prefinish",t_),this.on("end",r_).on("close",r_)}_read(e){this._waitChanDrain&&(this._waitChanDrain=!1,this.incoming.window<=of&&sf(this))}_write(e,r,n){let i=this._client._protocol,o=this.outgoing,s=o.packetSize,a=o.id,u=o.window,l=e.length,d=0;if(o.state==="open"){for(;l-d>0&&u>0;){let p=l-d;p>u&&(p=u),p>s&&(p=s),d===0&&p===l?i.channelData(a,e):i.channelData(a,Ja(e,d,d+p)),d+=p,u-=p}if(o.window=u,l-d>0){u===0&&(this._waitWindow=!0),d>0?this._chunk=Ja(e,d,l):this._chunk=e,this._chunkcb=n;return}n()}}eof(){this.outgoing.state==="open"&&(this.outgoing.state="eof",this._client._protocol.channelEOF(this.outgoing.id))}close(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._client._protocol.channelClose(this.outgoing.id))}destroy(){return this.end(),this.close(),this}setWindow(e,r,n,i){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&(this.subtype==="shell"||this.subtype==="exec")&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.windowChange(this.outgoing.id,e,r,n,i)}signal(e){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.signal(this.outgoing.id,e)}exit(e,r,n){if(!this.server)throw new Error("Server-only method called in client mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&(typeof e=="number"?this._client._protocol.exitStatus(this.outgoing.id,e):this._client._protocol.exitSignal(this.outgoing.id,e,r,n))}};function t_(){this.eof(),(this.server||!this.allowHalfOpen)&&this.close(),this.writable=!1}c(t_,"onFinish");function r_(){this.readable=!1}c(r_,"onEnd");function sf(t){if(t.outgoing.state==="closed")return;let e=hs-t.incoming.window;e<=0||(t.incoming.window+=e,t._client._protocol.channelWindowAdjust(t.outgoing.id,e))}c(sf,"windowAdjust");n_.exports={Channel:nf,MAX_WINDOW:hs,PACKET_SIZE:rS,windowAdjust:sf,WINDOW_THRESHOLD:of}});var lf=le((XF,s_)=>{"use strict";var{SFTP:nS}=ps(),gs=2**32-1;function i_(t,e,r,n){if(t._chanMgr.remove(e),typeof n!="function")return;let i;r instanceof Error?i=r:typeof r=="object"&&r!==null?(i=new Error(`(SSH) Channel open failure: ${r.description}`),i.reason=r.reason):(i=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),i.reason=""),n(i)}c(i_,"onChannelOpenFailure");function o_(t,e,r,n,i){if(typeof r=="function"){i_(t,e,n,r);return}if(typeof r!="object"||r===null||r.incoming&&r.incoming.state==="closed"||(t._chanMgr.remove(e),r.server&&r.constructor.name==="Session"))return;r.incoming.state="closed",r.readable&&r.push(null),r.server?r.stderr.writable&&r.stderr.end():r.stderr.readable&&r.stderr.push(null),r.constructor!==nS&&(r.outgoing.state==="open"||r.outgoing.state==="eof")&&!i&&r.close(),r.outgoing.state==="closing"&&(r.outgoing.state="closed");let o=r._readableState,s=r._writableState;s&&!s.ending&&!s.finished&&!i&&r.end();let a=r._callbacks;r._callbacks=[];for(let u=0;u<a.length;++u)a[u](!0);if(r.server)!r.readable||r.destroyed||o&&o.endEmitted?r.emit("close"):r.once("end",()=>r.emit("close"));else{let u;switch(r.type){case"direct-streamlocal@openssh.com":case"direct-tcpip":u=c(()=>r.emit("close"),"doClose");break;default:{let d=r._exit;u=c(()=>{d.code===null?r.emit("close",d.code,d.signal,d.dump,d.desc):r.emit("close",d.code)},"doClose")}}!r.readable||r.destroyed||o&&o.endEmitted?u():r.once("end",u);let l=r.stderr._readableState;!r.stderr.readable||r.stderr.destroyed||l&&l.endEmitted?r.stderr.emit("close"):r.stderr.once("end",()=>r.stderr.emit("close"))}}c(o_,"onCHANNEL_CLOSE");var uf=class{static{c(this,"ChannelManager")}constructor(e){this._client=e,this._channels={},this._cur=-1,this._count=0}add(e){let r;if(this._cur<gs)r=++this._cur;else if(this._count===0)this._cur=0,r=0;else{let n=this._channels;for(let i=0;i<gs;++i)if(n[i]===void 0){r=i;break}}return r===void 0?-1:(this._channels[r]=e||!0,++this._count,r)}update(e,r){if(typeof e!="number"||e<0||e>=gs||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);r&&this._channels[e]&&(this._channels[e]=r)}get(e){if(typeof e!="number"||e<0||e>=gs||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);return this._channels[e]}remove(e){if(typeof e!="number"||e<0||e>=gs||!isFinite(e))throw new Error(`Invalid channel id: ${e}`);this._channels[e]&&(delete this._channels[e],this._count&&--this._count)}cleanup(e){let r=this._channels;this._channels={},this._cur=-1,this._count=0;let n=Object.keys(r),i=this._client;for(let o=0;o<n.length;++o){let s=+n[o],a=r[s];o_(i,s,a._channel||a,e,!0)}}},cf=(()=>{let t=Object.prototype.toString;return e=>t.call(e)==="[object RegExp]"})();function iS(t,e,r){if(Array.isArray(t)&&t.length>0){for(let n=0;n<t.length;++n)if(r.indexOf(t[n])===-1)throw new Error(`Unsupported algorithm: ${t[n]}`);return t}if(typeof t=="object"&&t!==null){let n=Object.keys(t),i=e;for(let o=0;o<n.length;++o){let s=n[o],a=t[s];switch(s){case"append":if(Array.isArray(a)||(a=[a]),Array.isArray(a))for(let u=0;u<a.length;++u){let l=a[u];if(typeof l=="string"){if(!l||i.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);i===e&&(i=i.slice()),i.push(l)}else if(cf(l))for(let d=0;d<r.length;++d){let p=r[d];if(l.test(p)){if(i.indexOf(p)!==-1)continue;i===e&&(i=i.slice()),i.push(p)}}}break;case"prepend":if(Array.isArray(a)||(a=[a]),Array.isArray(a))for(let u=a.length;u>=0;--u){let l=a[u];if(typeof l=="string"){if(!l||i.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);i===e&&(i=i.slice()),i.unshift(l)}else if(cf(l))for(let d=r.length;d>=0;--d){let p=r[d];if(l.test(p)){if(i.indexOf(p)!==-1)continue;i===e&&(i=i.slice()),i.unshift(p)}}}break;case"remove":if(Array.isArray(a)||(a=[a]),Array.isArray(a))for(let u=0;u<a.length;++u){let l=a[u];if(typeof l=="string"){if(!l)continue;let d=i.indexOf(l);if(d===-1)continue;i===e&&(i=i.slice()),i.splice(d,1)}else if(cf(l))for(let d=0;d<i.length;++d)l.test(i[d])&&(i===e&&(i=i.slice()),i.splice(d,1),--d)}break}}return i}return e}c(iS,"generateAlgorithmList");s_.exports={ChannelManager:uf,generateAlgorithmList:iS,onChannelOpenFailure:i_,onCHANNEL_CLOSE:o_,isWritable:c(t=>t&&t.writable&&t._readableState&&t._readableState.ended===!1,"isWritable")}});var gf=le((e5,T_)=>{"use strict";var{createHash:oS,getHashes:sS,randomFillSync:aS}=require("crypto"),{Socket:cS}=require("net"),{lookup:uS}=require("dns"),lS=require("events"),fS=sS(),{COMPAT:S_,CHANNEL_EXTENDED_DATATYPE:{STDERR:dS},CHANNEL_OPEN_FAILURE:ms,DEFAULT_CIPHER:a_,DEFAULT_COMPRESSION:c_,DEFAULT_KEX:u_,DEFAULT_MAC:l_,DEFAULT_SERVER_HOST_KEY:f_,DISCONNECT_REASON:d_,DISCONNECT_REASON_BY_VALUE:pS,SUPPORTED_CIPHER:hS,SUPPORTED_COMPRESSION:gS,SUPPORTED_KEX:mS,SUPPORTED_MAC:_S,SUPPORTED_SERVER_HOST_KEY:yS}=An(),{init:ES}=Mn(),AS=Wl(),{parseKey:rc}=jn(),{SFTP:bS}=ps(),{bufferCopy:p_,makeBufferParser:w_,makeError:xS,readUInt32BE:IS,sigSSHToASN1:vS,writeUInt32BE:ff}=Vr(),{AgentContext:h_,createAgent:g_,isAgent:m_}=Cl(),{Channel:P_,MAX_WINDOW:nc,PACKET_SIZE:ic,windowAdjust:__,WINDOW_THRESHOLD:y_}=af(),{ChannelManager:SS,generateAlgorithmList:_s,isWritable:nr,onChannelOpenFailure:wS,onCHANNEL_CLOSE:PS}=lf(),ec=w_(),tc=w_(),ys=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,pf=c(t=>{},"noop"),hf=class extends lS{static{c(this,"Client")}constructor(){super(),this.config={host:void 0,port:void 0,localAddress:void 0,localPort:void 0,forceIPv4:void 0,forceIPv6:void 0,keepaliveCountMax:void 0,keepaliveInterval:void 0,readyTimeout:void 0,ident:void 0,username:void 0,password:void 0,privateKey:void 0,tryKeyboard:void 0,agent:void 0,allowAgentFwd:void 0,authHandler:void 0,hostHashAlgo:void 0,hostHashCb:void 0,strictVendor:void 0,debug:void 0},this._agent=void 0,this._readyTimeout=void 0,this._chanMgr=void 0,this._callbacks=void 0,this._forwarding=void 0,this._forwardingUnix=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._remoteVer=void 0,this._protocol=void 0,this._sock=void 0,this._resetKA=void 0}connect(e){if(this._sock&&nr(this._sock))return this.once("close",()=>{this.connect(e)}),this.end(),this;this.config.host=e.hostname||e.host||"localhost",this.config.port=e.port||22,this.config.localAddress=typeof e.localAddress=="string"?e.localAddress:void 0,this.config.localPort=typeof e.localPort=="string"||typeof e.localPort=="number"?e.localPort:void 0,this.config.forceIPv4=e.forceIPv4||!1,this.config.forceIPv6=e.forceIPv6||!1,this.config.keepaliveCountMax=typeof e.keepaliveCountMax=="number"&&e.keepaliveCountMax>=0?e.keepaliveCountMax:3,this.config.keepaliveInterval=typeof e.keepaliveInterval=="number"&&e.keepaliveInterval>0?e.keepaliveInterval:0,this.config.readyTimeout=typeof e.readyTimeout=="number"&&e.readyTimeout>=0?e.readyTimeout:2e4,this.config.ident=typeof e.ident=="string"||Buffer.isBuffer(e.ident)?e.ident:void 0;let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:[]},sc:void 0},n=!0;if(typeof e.algorithms=="object"&&e.algorithms!==null&&(r.kex=_s(e.algorithms.kex,u_,mS),r.kex!==u_&&(n=!1),r.serverHostKey=_s(e.algorithms.serverHostKey,f_,yS),r.serverHostKey!==f_&&(n=!1),r.cs.cipher=_s(e.algorithms.cipher,a_,hS),r.cs.cipher!==a_&&(n=!1),r.cs.mac=_s(e.algorithms.hmac,l_,_S),r.cs.mac!==l_&&(n=!1),r.cs.compress=_s(e.algorithms.compress,c_,gS),r.cs.compress!==c_&&(n=!1),n||(r.sc=r.cs)),typeof e.username=="string")this.config.username=e.username;else if(typeof e.user=="string")this.config.username=e.user;else throw new Error("Invalid username");this.config.password=typeof e.password=="string"?e.password:void 0,this.config.privateKey=typeof e.privateKey=="string"||Buffer.isBuffer(e.privateKey)?e.privateKey:void 0,this.config.localHostname=typeof e.localHostname=="string"?e.localHostname:void 0,this.config.localUsername=typeof e.localUsername=="string"?e.localUsername:void 0,this.config.tryKeyboard=e.tryKeyboard===!0,typeof e.agent=="string"&&e.agent.length?this.config.agent=g_(e.agent):m_(e.agent)?this.config.agent=e.agent:this.config.agent=void 0,this.config.allowAgentFwd=e.agentForward===!0&&this.config.agent!==void 0;let i=this.config.authHandler=typeof e.authHandler=="function"||Array.isArray(e.authHandler)?e.authHandler:void 0;this.config.strictVendor=typeof e.strictVendor=="boolean"?e.strictVendor:!0;let o=this.config.debug=typeof e.debug=="function"?e.debug:void 0;if(e.agentForward===!0&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");let s=this._callbacks=[];this._chanMgr=new SS(this),this._forwarding={},this._forwardingUnix={},this._acceptX11=0,this._agentFwdEnabled=!1,this._agent=this.config.agent?this.config.agent:void 0,this._remoteVer=void 0;let a;if(this.config.privateKey){if(a=rc(this.config.privateKey,e.passphrase),a instanceof Error)throw new Error(`Cannot parse privateKey: ${a.message}`);if(Array.isArray(a)&&(a=a[0]),a.getPrivatePEM()===null)throw new Error("privateKey value does not contain a (valid) private key")}let u;if(typeof e.hostVerifier=="function"){let k=e.hostVerifier,W;fS.indexOf(e.hostHash)!==-1&&(W=e.hostHash),u=c((q,ee)=>{W&&(q=oS(W).update(q).digest("hex"));let ue=k(q,ee);ue!==void 0&&ee(ue)},"hostVerifier")}let l=this._sock=e.sock||new cS,d=!1,p=!1;this._protocol&&this._protocol.cleanup();let g=o?(k,W,q)=>{o(`Debug output from server: ${JSON.stringify(q)}`)}:void 0,h,_=this._protocol=new AS({ident:this.config.ident,offer:n?void 0:r,onWrite:c(k=>{nr(l)&&l.write(k)},"onWrite"),onError:c(k=>{k.level==="handshake"&&clearTimeout(this._readyTimeout),_._destruct||l.removeAllListeners("data"),this.emit("error",k);try{l.end()}catch{}},"onError"),onHeader:c(k=>{p=!0,this._remoteVer=k.versions.software,k.greeting&&this.emit("greeting",k.greeting)},"onHeader"),onHandshakeComplete:c(k=>{this.emit("handshake",k),d||(d=!0,_.service("ssh-userauth"))},"onHandshakeComplete"),debug:o,hostVerifier:u,messageHandlers:{DEBUG:g,DISCONNECT:c((k,W,q)=>{if(W!==d_.BY_APPLICATION){q||(q=pS[W],q===void 0&&(q=`Unexpected disconnection reason: ${W}`));let ee=new Error(q);ee.code=W,this.emit("error",ee)}l.end()},"DISCONNECT"),SERVICE_ACCEPT:c((k,W)=>{W==="ssh-userauth"&&B()},"SERVICE_ACCEPT"),EXT_INFO:c((k,W)=>{if(h===void 0){for(let q of W)if(q.name==="server-sig-algs"){h=q.algs;return}h=null}},"EXT_INFO"),USERAUTH_BANNER:c((k,W)=>{this.emit("banner",W)},"USERAUTH_BANNER"),USERAUTH_SUCCESS:c(k=>{D(),clearTimeout(this._readyTimeout),this.emit("ready")},"USERAUTH_SUCCESS"),USERAUTH_FAILURE:c((k,W,q)=>{if(P.keyAlgos){let ee=P.keyAlgos[0][0];if(o&&o(`Client: ${P.type} (${ee}) auth failed`),P.keyAlgos.shift(),P.keyAlgos.length){let[ue,me]=P.keyAlgos[0];switch(P.type){case"agent":_.authPK(P.username,P.agentCtx.currentKey(),ue);return;case"publickey":_.authPK(P.username,P.key,ue);return;case"hostbased":_.authHostbased(P.username,P.key,P.localHostname,P.localUsername,ue,(he,xt)=>{let kt=P.key.sign(he,me);if(kt instanceof Error)return kt.message=`Error while signing with key: ${kt.message}`,kt.level="client-authentication",this.emit("error",kt),B();xt(kt)});return}}else P.keyAlgos=void 0}if(P.type==="agent"){let ee=P.agentCtx.pos();return o&&o(`Client: Agent key #${ee+1} failed`),Z()}o&&o(`Client: ${P.type} auth failed`),C=q,M=W,B()},"USERAUTH_FAILURE"),USERAUTH_PASSWD_CHANGEREQ:c((k,W)=>{P.type==="password"&&this.emit("change password",W,q=>{_.authPassword(this.config.username,this.config.password,q)})},"USERAUTH_PASSWD_CHANGEREQ"),USERAUTH_PK_OK:c(k=>{let W,q;if(P.keyAlgos&&([W,q]=P.keyAlgos[0]),P.type==="agent"){let ee=P.agentCtx.currentKey();_.authPK(P.username,ee,W,(ue,me)=>{let he={hash:q};P.agentCtx.sign(ee,ue,he,(xt,kt)=>{if(xt)xt.level="agent",this.emit("error",xt);else return me(kt);Z()})})}else P.type==="publickey"&&_.authPK(P.username,P.key,W,(ee,ue)=>{let me=P.key.sign(ee,q);if(me instanceof Error)return me.message=`Error signing data with key: ${me.message}`,me.level="client-authentication",this.emit("error",me),B();ue(me)})},"USERAUTH_PK_OK"),USERAUTH_INFO_REQUEST:c((k,W,q,ee)=>{if(P.type==="keyboard-interactive"){if((Array.isArray(ee)?ee.length:0)===0){o&&o("Client: Sending automatic USERAUTH_INFO_RESPONSE"),_.authInfoRes();return}P.prompt(W,q,"",ee,me=>{_.authInfoRes(me)})}},"USERAUTH_INFO_REQUEST"),REQUEST_SUCCESS:c((k,W)=>{s.length&&s.shift()(!1,W)},"REQUEST_SUCCESS"),REQUEST_FAILURE:c(k=>{s.length&&s.shift()(!0)},"REQUEST_FAILURE"),GLOBAL_REQUEST:c((k,W,q,ee)=>{W==="hostkeys-00@openssh.com"?(NS(this,ee,(ue,me)=>{ue||this.emit("hostkeys",me)}),q&&_.requestSuccess()):q&&_.requestFailure()},"GLOBAL_REQUEST"),CHANNEL_OPEN:c((k,W)=>{kS(this,W)},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:c((k,W)=>{let q=this._chanMgr.get(W.recipient);if(typeof q!="function")return;let ee=q.type==="sftp",me={type:ee?"session":q.type,incoming:{id:W.recipient,window:nc,packetSize:ic,state:"open"},outgoing:{id:W.sender,window:W.window,packetSize:W.packetSize,state:"open"}},he=ee?new bS(this,me,{debug:o}):new P_(this,me);this._chanMgr.update(W.recipient,he),q(void 0,he)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:c((k,W,q,ee)=>{let ue=this._chanMgr.get(W);if(typeof ue!="function")return;wS(this,W,{reason:q,description:ee},ue)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:c((k,W,q)=>{let ee=this._chanMgr.get(W);if(!(typeof ee!="object"||ee===null)&&ee.incoming.window!==0){if(ee.incoming.window-=q.length,ee.push(q)===!1){ee._waitChanDrain=!0;return}ee.incoming.window<=y_&&__(ee)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:c((k,W,q,ee)=>{if(ee!==dS)return;let ue=this._chanMgr.get(W);if(!(typeof ue!="object"||ue===null)&&ue.incoming.window!==0){if(ue.incoming.window-=q.length,!ue.stderr.push(q)){ue._waitChanDrain=!0;return}ue.incoming.window<=y_&&__(ue)}},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:c((k,W,q)=>{let ee=this._chanMgr.get(W);typeof ee!="object"||ee===null||(ee.outgoing.window+=q,ee._waitWindow&&(ee._waitWindow=!1,ee._chunk?ee._write(ee._chunk,null,ee._chunkcb):ee._chunkcb?ee._chunkcb():ee._chunkErr?ee.stderr._write(ee._chunkErr,null,ee._chunkcbErr):ee._chunkcbErr&&ee._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:c((k,W)=>{let q=this._chanMgr.get(W);typeof q!="object"||q===null||(this._resetKA(),q._callbacks.length&&q._callbacks.shift()(!1))},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:c((k,W)=>{let q=this._chanMgr.get(W);typeof q!="object"||q===null||(this._resetKA(),q._callbacks.length&&q._callbacks.shift()(!0))},"CHANNEL_FAILURE"),CHANNEL_REQUEST:c((k,W,q,ee,ue)=>{let me=this._chanMgr.get(W);if(typeof me!="object"||me===null)return;let he=me._exit;if(he.code===void 0){switch(q){case"exit-status":me.emit("exit",he.code=ue);return;case"exit-signal":me.emit("exit",he.code=null,he.signal=`SIG${ue.signal}`,he.dump=ue.coreDumped,he.desc=ue.errorMessage);return}ee&&k.channelFailure(me.outgoing.id)}},"CHANNEL_REQUEST"),CHANNEL_EOF:c((k,W)=>{let q=this._chanMgr.get(W);typeof q!="object"||q===null||q.incoming.state==="open"&&(q.incoming.state="eof",q.readable&&q.push(null),q.stderr.readable&&q.stderr.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:c((k,W)=>{PS(this,W,this._chanMgr.get(W))},"CHANNEL_CLOSE")}});l.pause();let b=this.config.keepaliveInterval,E=this.config.keepaliveCountMax,v=0,w,H=c(()=>{if(++v>E){if(clearInterval(w),l.readable){let k=new Error("Keepalive timeout");k.level="client-timeout",this.emit("error",k),l.destroy()}return}nr(l)?(s.push(D),_.ping()):clearInterval(w)},"sendKA");function D(){b>0&&(v=0,clearInterval(w),nr(l)&&(w=setInterval(H,b)))}c(D,"resetKA"),this._resetKA=D;let J=(()=>{let k=!1;return()=>{if(!k&&(k=!0,X&&!p)){let W=xS("Connection lost before handshake","protocol",!0);this.emit("error",W)}}})(),Y=(()=>{let k=!1;return()=>{k||(k=!0,X=!0,o&&o("Socket connected"),this.emit("connect"),ES.then(()=>{_.start(),l.on("data",W=>{try{_.parse(W,0,W.length)}catch(q){this.emit("error",q);try{nr(l)&&l.end()}catch{}}}),l.stderr&&typeof l.stderr.resume=="function"&&l.stderr.resume(),l.resume()}).catch(W=>{this.emit("error",W);try{nr(l)&&l.end()}catch{}}))}})(),X=!1;l.on("connect",Y).on("timeout",()=>{this.emit("timeout")}).on("error",k=>{o&&o(`Socket error: ${k.message}`),clearTimeout(this._readyTimeout),k.level="client-socket",this.emit("error",k)}).on("end",()=>{o&&o("Socket ended"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(w),this.emit("end")}).on("close",()=>{o&&o("Socket closed"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(w),this.emit("close");let k=s;s=this._callbacks=[];let W=new Error("No response from server");for(let q=0;q<k.length;++q)k[q](W);this._chanMgr.cleanup(W)});let P,C=null,M=null,L=["none"];this.config.password!==void 0&&L.push("password"),a!==void 0&&L.push("publickey"),this._agent!==void 0&&L.push("agent"),this.config.tryKeyboard&&L.push("keyboard-interactive"),a!==void 0&&this.config.localHostname!==void 0&&this.config.localUsername!==void 0&&L.push("hostbased"),Array.isArray(i)?i=v_(i):typeof i!="function"&&(i=v_(L));let T=!1,F=c(k=>{if(!T){if(T=!0,k===!1){let W=new Error("All configured authentication methods failed");W.level="client-authentication",this.emit("error",W),this.end();return}if(typeof k=="string"){let W=k;if(L.indexOf(W)===-1)return j(`Authentication method not allowed: ${W}`);let q=this.config.username;switch(W){case"password":k={type:W,username:q,password:this.config.password};break;case"publickey":k={type:W,username:q,key:a};break;case"hostbased":k={type:W,username:q,key:a,localHostname:this.config.localHostname,localUsername:this.config.localUsername};break;case"agent":k={type:W,username:q,agentCtx:new h_(this._agent)};break;case"keyboard-interactive":k={type:W,username:q,prompt:c((...ee)=>this.emit("keyboard-interactive",...ee),"prompt")};break;case"none":k={type:W,username:q};break;default:return j(`Skipping unsupported authentication method: ${k}`)}}else{if(typeof k!="object"||k===null)return j(`Skipping invalid authentication attempt: ${k}`);{let W=k.username;if(typeof W!="string")return j(`Skipping invalid authentication attempt: ${k}`);let q=k.type;switch(q){case"password":{let{password:ee}=k;if(typeof ee!="string"&&!Buffer.isBuffer(ee))return j("Skipping invalid password auth attempt");k={type:q,username:W,password:ee};break}case"publickey":{let ee=rc(k.key,k.passphrase);if(ee instanceof Error)return j("Skipping invalid key auth attempt");if(!ee.isPrivateKey())return j("Skipping non-private key");k={type:q,username:W,key:ee};break}case"hostbased":{let{localHostname:ee,localUsername:ue}=k,me=rc(k.key,k.passphrase);if(me instanceof Error||typeof ee!="string"||typeof ue!="string")return j("Skipping invalid hostbased auth attempt");if(!me.isPrivateKey())return j("Skipping non-private key");k={type:q,username:W,key:me,localHostname:ee,localUsername:ue};break}case"agent":{let ee=k.agent;if(typeof ee=="string"&&ee.length)ee=g_(ee);else if(!m_(ee))return j(`Skipping invalid agent: ${k.agent}`);k={type:q,username:W,agentCtx:new h_(ee)};break}case"keyboard-interactive":{let{prompt:ee}=k;if(typeof ee!="function")return j("Skipping invalid keyboard-interactive auth attempt");k={type:q,username:W,prompt:ee};break}case"none":k={type:q,username:W};break;default:return j(`Skipping unsupported authentication method: ${k}`)}}}P=k;try{let W=P.username;switch(P.type){case"password":_.authPassword(W,P.password);break;case"publickey":{let q;if(P.keyAlgos=df(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)q=P.keyAlgos[0][0];else return j("Skipping key authentication (no mutual hash algorithm)");_.authPK(W,P.key,q);break}case"hostbased":{let q,ee;if(P.keyAlgos=df(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)[q,ee]=P.keyAlgos[0];else return j("Skipping hostbased authentication (no mutual hash algorithm)");_.authHostbased(W,P.key,P.localHostname,P.localUsername,q,(ue,me)=>{let he=P.key.sign(ue,ee);if(he instanceof Error)return he.message=`Error while signing with key: ${he.message}`,he.level="client-authentication",this.emit("error",he),B();me(he)});break}case"agent":P.agentCtx.init(q=>{if(q)return q.level="agent",this.emit("error",q),B();Z()});break;case"keyboard-interactive":_.authKeyboard(W);break;case"none":_.authNone(W);break}}finally{T=!1}}},"doNextAuth");function j(k){o&&o(k),process.nextTick(B)}c(j,"skipAuth");function B(){T=!1;let k=i(M,C,F);T||k===void 0||F(k)}c(B,"tryNextAuth");let Z=c(()=>{if(P.type==="agent"){let k=P.agentCtx.nextKey();if(k===!1)o&&o("Agent: No more keys left to try"),o&&o("Client: agent auth failed"),B();else{let W=P.agentCtx.pos(),q;if(P.keyAlgos=df(this,k,h),P.keyAlgos)if(P.keyAlgos.length)q=P.keyAlgos[0][0];else{o&&o(`Agent: Skipping key #${W+1} (no mutual hash algorithm)`),Z();return}o&&o(`Agent: Trying key #${W+1}`),_.authPK(P.username,k,q)}}},"tryNextAgentKey"),te=c(()=>{this.config.readyTimeout>0&&(this._readyTimeout=setTimeout(()=>{let k=new Error("Timed out while waiting for handshake");k.level="client-timeout",this.emit("error",k),l.destroy()},this.config.readyTimeout))},"startTimeout");if(e.sock)te(),typeof l.connecting=="boolean"&&l.connecting||Y();else{let k=this.config.host,W=this.config.forceIPv4,q=this.config.forceIPv6;o&&o(`Client: Trying ${k} on port ${this.config.port} ...`);let ee=c(()=>{te(),l.connect({host:k,port:this.config.port,localAddress:this.config.localAddress,localPort:this.config.localPort}),l.setMaxListeners(0),l.setTimeout(typeof e.timeout=="number"?e.timeout:0)},"doConnect");!W&&!q||W&&q?ee():uS(k,W?4:6,(ue,me,he)=>{if(ue){let xt=W?"IPv4":"IPv6",kt=new Error(`Error while looking up ${xt} address for '${k}': ${ue}`);clearTimeout(this._readyTimeout),kt.level="client-dns",this.emit("error",kt),this.emit("close");return}k=me,ee()})}return this}end(){return this._sock&&nr(this._sock)&&(this._protocol.disconnect(d_.BY_APPLICATION),this._sock.end()),this}destroy(){return this._sock&&nr(this._sock)&&this._sock.destroy(),this}exec(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");typeof r=="function"&&(n=r,r={});let i={allowHalfOpen:r.allowHalfOpen!==!1};return so(this,"session",i,(o,s)=>{if(o){n(o);return}let a=[];function u(l){if(l){s.close(),n(l);return}a.length&&a.shift()()}c(u,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&a.push(()=>b_(s,u)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&x_(s,r.env),(typeof r.pty=="object"&&r.pty!==null||r.pty===!0)&&a.push(()=>A_(s,r.pty,u)),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&a.push(()=>E_(s,r.x11,u))),a.push(()=>CS(s,e,r,n)),a.shift()()}),this}shell(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return typeof e=="function"?(n=e,e=r=void 0):typeof r=="function"&&(n=r,r=void 0),e&&(e.x11!==void 0||e.env!==void 0)&&(r=e,e=void 0),so(this,"session",(i,o)=>{if(i){n(i);return}let s=[];function a(u){if(u){o.close(),n(u);return}s.length&&s.shift()()}c(a,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&s.push(()=>b_(o,a)),e!==!1&&s.push(()=>A_(o,e,a)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&x_(o,r.env),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&s.push(()=>E_(o,r.x11,a))),s.push(()=>TS(o,n)),s.shift()()}),this}subsys(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return so(this,"session",(n,i)=>{if(n){r(n);return}I_(i,e,(o,s)=>{if(o){r(o);return}r(void 0,s)})}),this}forwardIn(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let i=typeof n=="function";return i&&this._callbacks.push((o,s)=>{if(o){n(o!==!0?o:new Error(`Unable to bind to ${e}:${r}`));return}let a=r;r===0&&s&&s.length>=4&&(a=IS(s,0),this._protocol._compatFlags&S_.DYN_RPORT_BUG||(r=a)),this._forwarding[`${e}:${r}`]=a,n(void 0,a)}),this._protocol.tcpipForward(e,r,i),this}unforwardIn(e,r,n){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let i=typeof n=="function";return i&&this._callbacks.push(o=>{if(o){n(o!==!0?o:new Error(`Unable to unbind from ${e}:${r}`));return}delete this._forwarding[`${e}:${r}`],n()}),this._protocol.cancelTcpipForward(e,r,i),this}forwardOut(e,r,n,i,o){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let s={srcIP:e,srcPort:r,dstIP:n,dstPort:i};return typeof o!="function"&&(o=pf),so(this,"direct-tcpip",s,o),this}openssh_noMoreSessions(e){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let r=typeof e=="function";return!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(r&&this._callbacks.push(n=>{if(n){e(n!==!0?n:new Error("Unable to disable future sessions"));return}e()}),this._protocol.openssh_noMoreSessions(r),this):r?(process.nextTick(e,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardInStreamLocal(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let n=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(n&&this._callbacks.push(i=>{if(i){r(i!==!0?i:new Error(`Unable to bind to ${e}`));return}this._forwardingUnix[e]=!0,r()}),this._protocol.openssh_streamLocalForward(e,n),this):n?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_unforwardInStreamLocal(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");let n=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(n&&this._callbacks.push(i=>{if(i){r(i!==!0?i:new Error(`Unable to unbind from ${e}`));return}delete this._forwardingUnix[e],r()}),this._protocol.openssh_cancelStreamLocalForward(e,n),this):n?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardOutStreamLocal(e,r){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return typeof r!="function"&&(r=pf),!this.config.strictVendor||this.config.strictVendor&&ys.test(this._remoteVer)?(so(this,"direct-streamlocal@openssh.com",{socketPath:e},r),this):(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this)}sftp(e){if(!this._sock||!nr(this._sock))throw new Error("Not connected");return so(this,"sftp",(r,n)=>{if(r){e(r);return}I_(n,"sftp",(i,o)=>{if(i){e(i);return}function s(){n.removeListener("ready",a),n.removeListener("error",u),n.removeListener("exit",l),n.removeListener("close",l)}c(s,"removeListeners");function a(){s(),e(void 0,n)}c(a,"onReady");function u(d){s(),e(d)}c(u,"onError");function l(d,p){s();let g;typeof d=="number"?g=`Received exit code ${d} while establishing SFTP session`:p!==void 0?g=`Received signal ${p} while establishing SFTP session`:g="Received unexpected SFTP session termination";let h=new Error(g);h.code=d,h.signal=p,e(h)}c(l,"onExit"),n.on("ready",a).on("error",u).on("exit",l).on("close",l),n._init()})}),this}setNoDelay(e){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(e),this}};function so(t,e,r,n){let i=nc,o=ic;typeof r=="function"&&(n=r,r={});let s=c((u,l)=>{n(u,l)},"wrapper");s.type=e;let a=t._chanMgr.add(s);if(a===-1){n(new Error("No free channels available"));return}switch(e){case"session":case"sftp":t._protocol.session(a,i,o);break;case"direct-tcpip":t._protocol.directTcpip(a,i,o,r);break;case"direct-streamlocal@openssh.com":t._protocol.openssh_directStreamLocal(a,i,o,r);break;default:throw new Error(`Unsupported channel type: ${e}`)}}c(so,"openChannel");function E_(t,e,r){let n={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:void 0,screen:0};typeof e=="function"?r=e:typeof e=="object"&&e!==null&&(typeof e.single=="boolean"&&(n.single=e.single),typeof e.screen=="number"&&(n.screen=e.screen),typeof e.protocol=="string"&&(n.protocol=e.protocol),typeof e.cookie=="string"?n.cookie=e.cookie:Buffer.isBuffer(e.cookie)&&(n.cookie=e.cookie.hexSlice(0,e.cookie.length))),n.cookie===void 0&&(n.cookie=RS());let i=typeof r=="function";if(t.outgoing.state!=="open"){i&&r(new Error("Channel is not open"));return}i&&t._callbacks.push(o=>{if(o){r(o!==!0?o:new Error("Unable to request X11"));return}t._hasX11=!0,++t._client._acceptX11,t.once("close",()=>{t._client._acceptX11&&--t._client._acceptX11}),r()}),t._client._protocol.x11Forward(t.outgoing.id,n,i)}c(E_,"reqX11");function A_(t,e,r){let n=24,i=80,o=640,s=480,a="vt100",u=null;typeof e=="function"?r=e:typeof e=="object"&&e!==null&&(typeof e.rows=="number"&&(n=e.rows),typeof e.cols=="number"&&(i=e.cols),typeof e.width=="number"&&(o=e.width),typeof e.height=="number"&&(s=e.height),typeof e.term=="string"&&(a=e.term),typeof e.modes=="object"&&(u=e.modes));let l=typeof r=="function";if(t.outgoing.state!=="open"){l&&r(new Error("Channel is not open"));return}l&&t._callbacks.push(d=>{if(d){r(d!==!0?d:new Error("Unable to request a pseudo-terminal"));return}r()}),t._client._protocol.pty(t.outgoing.id,n,i,s,o,a,u,l)}c(A_,"reqPty");function b_(t,e){let r=typeof e=="function";if(t.outgoing.state!=="open"){r&&e(new Error("Channel is not open"));return}if(t._client._agentFwdEnabled){r&&e(!1);return}t._client._agentFwdEnabled=!0,t._callbacks.push(n=>{if(n){t._client._agentFwdEnabled=!1,r&&e(n!==!0?n:new Error("Unable to request agent forwarding"));return}r&&e()}),t._client._protocol.openssh_agentForward(t.outgoing.id,!0)}c(b_,"reqAgentFwd");function TS(t,e){if(t.outgoing.state!=="open"){e(new Error("Channel is not open"));return}t._callbacks.push(r=>{if(r){e(r!==!0?r:new Error("Unable to open shell"));return}t.subtype="shell",e(void 0,t)}),t._client._protocol.shell(t.outgoing.id,!0)}c(TS,"reqShell");function CS(t,e,r,n){if(t.outgoing.state!=="open"){n(new Error("Channel is not open"));return}t._callbacks.push(i=>{if(i){n(i!==!0?i:new Error("Unable to exec"));return}t.subtype="exec",t.allowHalfOpen=r.allowHalfOpen!==!1,n(void 0,t)}),t._client._protocol.exec(t.outgoing.id,e,!0)}c(CS,"reqExec");function x_(t,e){if(t.outgoing.state!=="open")return;let r=Object.keys(e||{});for(let n=0;n<r.length;++n){let i=r[n],o=e[i];t._client._protocol.env(t.outgoing.id,i,o,!1)}}c(x_,"reqEnv");function I_(t,e,r){if(t.outgoing.state!=="open"){r(new Error("Channel is not open"));return}t._callbacks.push(n=>{if(n){r(n!==!0?n:new Error(`Unable to start subsystem: ${e}`));return}t.subtype="subsystem",r(void 0,t)}),t._client._protocol.subsystem(t.outgoing.id,e,!0)}c(I_,"reqSubsystem");function kS(t,e){let r=-1,n,i=c(()=>{let u={type:e.type,incoming:{id:r,window:nc,packetSize:ic,state:"open"},outgoing:{id:e.sender,window:e.window,packetSize:e.packetSize,state:"open"}},l=new P_(t,u);return t._chanMgr.update(r,l),t._protocol.channelOpenConfirm(e.sender,r,nc,ic),l},"accept"),o=c(()=>{n===void 0&&(r===-1?n=ms.RESOURCE_SHORTAGE:n=ms.CONNECT_FAILED),r!==-1&&t._chanMgr.remove(r),t._protocol.channelOpenFail(e.sender,n,"")},"reject"),s=c(()=>(r=t._chanMgr.add(),r===-1&&(n=ms.RESOURCE_SHORTAGE,t.config.debug&&t.config.debug("Client: Automatic rejection of incoming channel open: no channels available")),r!==-1),"reserveChannel"),a=e.data;switch(e.type){case"forwarded-tcpip":{let u=t._forwarding[`${a.destIP}:${a.destPort}`];if(u!==void 0&&s()){a.destPort===0&&(a.destPort=u),t.emit("tcp connection",a,i,o);return}break}case"forwarded-streamlocal@openssh.com":if(t._forwardingUnix[a.socketPath]!==void 0&&s()){t.emit("unix connection",a,i,o);return}break;case"auth-agent@openssh.com":if(t._agentFwdEnabled&&typeof t._agent.getStream=="function"&&s()){t._agent.getStream((u,l)=>{if(u)return o();let d=i();d.pipe(l).pipe(d)});return}break;case"x11":if(t._acceptX11!==0&&s()){t.emit("x11",a,i,o);return}break;default:n=ms.UNKNOWN_CHANNEL_TYPE,t.config.debug&&t.config.debug(`Client: Automatic rejection of unsupported incoming channel open type: ${e.type}`)}n===void 0&&(n=ms.ADMINISTRATIVELY_PROHIBITED,t.config.debug&&t.config.debug("Client: Automatic rejection of unexpected incoming channel open for: "+e.type)),o()}c(kS,"onCHANNEL_OPEN");var RS=(()=>{let t=Buffer.allocUnsafe(16);return()=>(aS(t,0,16),t.hexSlice(0,16))})();function v_(t){if(!Array.isArray(t))throw new Error("authList must be an array");let e=0;return(r,n,i)=>e===t.length?!1:t[e++]}c(v_,"makeSimpleAuthHandler");function NS(t,e,r){if(!t._sock||!nr(t._sock))return;if(typeof r!="function"&&(r=pf),!Array.isArray(e))throw new TypeError("Invalid keys argument type");let n=[];for(let i of e){let o=rc(i);if(o instanceof Error)throw o;n.push(o)}if(!t.config.strictVendor||t.config.strictVendor&&ys.test(t._remoteVer)){t._callbacks.push((i,o)=>{if(i){r(i!==!0?i:new Error("Server failed to prove supplied keys"));return}let s=[],a=0;for(ec.init(o,0);ec.avail()&&a!==n.length;){let u=n[a++],l=u.getPublicSSH(),d=ec.readString();tc.init(d,0);let p=tc.readString(!0),g=tc.readString(),h;if(p!==u.type)if(u.type==="ssh-rsa")switch(p){case"rsa-sha2-256":h="sha256";break;case"rsa-sha2-512":h="sha512";break;default:continue}else continue;let _=t._protocol._kex.sessionID,b=Buffer.allocUnsafe(37+_.length+4+l.length),E=0;ff(b,29,E),b.utf8Write("hostkeys-prove-00@openssh.com",E+=4,29),ff(b,_.length,E+=29),p_(_,b,0,_.length,E+=4),ff(b,l.length,E+=_.length),p_(l,b,0,l.length,E+=4),(g=vS(g,p))&&u.verify(b,g,h)===!0&&s.push(u)}tc.clear(),ec.clear(),r(null,s)}),t._protocol.openssh_hostKeysProve(n);return}process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}c(NS,"hostKeysProve");function df(t,e,r){switch(e.type){case"ssh-rsa":if(t._protocol._compatFlags&S_.IMPLY_RSA_SHA2_SIGALGS&&(Array.isArray(r)?r=["rsa-sha2-256","rsa-sha2-512",...r]:r=["rsa-sha2-256","rsa-sha2-512"]),Array.isArray(r)){if(r.indexOf("rsa-sha2-256")!==-1)return[["rsa-sha2-256","sha256"]];if(r.indexOf("rsa-sha2-512")!==-1)return[["rsa-sha2-512","sha512"]];if(r.indexOf("ssh-rsa")===-1)return[]}return[["ssh-rsa","sha1"]]}}c(df,"getKeyAlgos");T_.exports=hf});var k_=le(C_=>{"use strict";var{Agent:_f}=require("http"),{Agent:OS}=require("https"),{connect:$S}=require("tls"),mf;for(let t of[_f,OS]){class e extends t{static{c(this,"SSHAgent")}constructor(n,i){super(i),this._connectCfg=n,this._defaultSrcIP=i&&i.srcIP||"localhost"}createConnection(n,i){let o=n&&n.localAddress||this._defaultSrcIP,s=n&&n.localPort||0,a=n.host,u=n.port;mf===void 0&&(mf=gf());let l=new mf,d=!1;l.on("ready",()=>{l.forwardOut(o,s,a,u,(p,g)=>{if(d=!0,p)return l.end(),i(p);g.once("close",()=>l.end()),i(null,DS(g,t,n))})}).on("error",i).on("close",()=>{d||i(new Error("Unexpected connection close"))}).connect(this._connectCfg)}}C_[t===_f?"SSHTTPAgent":"SSHTTPSAgent"]=e}function Es(){}c(Es,"noop");function DS(t,e,r){if(e===_f)return t.setKeepAlive=Es,t.setNoDelay=Es,t.setTimeout=Es,t.ref=Es,t.unref=Es,t.destroySoon=t.destroy,t;r.socket=t;let n=$S(r),i=(()=>{let o=!1;return()=>{o||(o=!0,t.isPaused()&&t.resume())}})();return n.on("end",i).on("close",i),n}c(DS,"decorateStream")});var N_=le((i5,bf)=>{"use strict";var{Server:BS}=require("net"),bs=require("events"),{listenerCount:Er}=bs,{CHANNEL_OPEN_FAILURE:ao,DEFAULT_CIPHER:US,DEFAULT_COMPRESSION:LS,DEFAULT_KEX:zS,DEFAULT_MAC:MS,DEFAULT_SERVER_HOST_KEY:FS,DISCONNECT_REASON:co,DISCONNECT_REASON_BY_VALUE:HS,SUPPORTED_CIPHER:jS,SUPPORTED_COMPRESSION:WS,SUPPORTED_KEX:qS,SUPPORTED_MAC:QS,SUPPORTED_SERVER_HOST_KEY:VS}=An(),{init:KS}=Mn(),{KexInit:GS}=Fa(),{parseKey:R_}=jn(),ZS=Wl(),{SFTP:YS}=ps(),{writeUInt32BE:XS}=Vr(),{Channel:uo,MAX_WINDOW:Qn,PACKET_SIZE:Vn,windowAdjust:JS,WINDOW_THRESHOLD:ew}=af(),{ChannelManager:tw,generateAlgorithmList:As,isWritable:oc,onChannelOpenFailure:rw,onCHANNEL_CLOSE:nw}=lf(),iw=10,Kn=class extends bs{static{c(this,"AuthContext")}constructor(e,r,n,i,o){super(),this.username=this.user=r,this.service=n,this.method=i,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=(s,a,u)=>{this._finalResponse||(this._finalResponse=!0,o(this,s,a,u))},this._protocol=e}accept(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)}reject(e,r){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,e,r)}},sc=class extends Kn{static{c(this,"KeyboardAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this._multistep=!0,this._cb=void 0,this._onInfoResponse=a=>{let u=this._cb;u&&(this._cb=void 0,u(a))},this.submethods=o,this.on("abort",()=>{this._cb&&this._cb(new Error("Authentication request aborted"))})}prompt(e,r,n,i){Array.isArray(e)||(e=[e]),typeof r=="function"?(i=r,r=n=void 0):typeof n=="function"?(i=n,n=void 0):typeof i!="function"&&(i=void 0);for(let o=0;o<e.length;++o)typeof e[o]=="string"&&(e[o]={prompt:e[o],echo:!0});this._cb=i,this._initialResponse=!0,this._protocol.authInfoReq(r,n,e)}},Ef=class extends Kn{static{c(this,"PKAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob}accept(){this.signature?Kn.prototype.accept.call(this):(this._initialResponse=!0,this._protocol.authPKOK(this.key.algo,this.key.data))}},Af=class extends Kn{static{c(this,"HostbasedAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob,this.localHostname=o.localHostname,this.localUsername=o.localUsername}},ac=class extends Kn{static{c(this,"PwdAuthContext")}constructor(e,r,n,i,o,s){super(e,r,n,i,s),this.password=o,this._changeCb=void 0}requestChange(e,r){if(this._changeCb)throw new Error("Change request already in progress");if(typeof e!="string")throw new Error("prompt argument must be a string");if(typeof r!="function")throw new Error("Callback argument must be a function");this._changeCb=r,this._protocol.authPasswdChg(e)}},an=class extends bs{static{c(this,"Session")}constructor(e,r,n){super(),this.type="session",this.subtype=void 0,this.server=!0,this._ending=!1,this._channel=void 0,this._chanInfo={type:"session",incoming:{id:n,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:r.sender,window:r.window,packetSize:r.packetSize,state:"open"}}}},Dr=class extends bs{static{c(this,"Server")}constructor(e,r){if(super(),typeof e!="object"||e===null)throw new Error("Missing configuration object");let n=Object.create(null),i=[],o=e.hostKeys;if(!Array.isArray(o))throw new Error("hostKeys must be an array");let s=typeof e.algorithms=="object"&&e.algorithms!==null?e.algorithms:{},a=As(s.serverHostKey,FS,VS);for(let g=0;g<o.length;++g){let h;if(Buffer.isBuffer(o[g])||typeof o[g]=="string"?h=R_(o[g]):h=R_(o[g].key,o[g].passphrase),h instanceof Error)throw new Error(`Cannot parse privateKey: ${h.message}`);if(Array.isArray(h)&&(h=h[0]),h.getPrivatePEM()===null)throw new Error("privateKey value contains an invalid private key");if(!i.includes(h.type))if(h.type==="ssh-rsa"){let _=a.indexOf("ssh-rsa"),b=a.indexOf("rsa-sha2-256"),E=a.indexOf("rsa-sha2-512");_===-1&&(_=1/0),[_,b,E].sort(ow).forEach(v=>{if(v===-1)return;let w;switch(v){case _:w="ssh-rsa";break;case b:w="rsa-sha2-256";break;case E:w="rsa-sha2-512";break;default:return}n[w]=h,i.push(w)})}else n[h.type]=h,i.push(h.type)}let u={kex:As(s.kex,zS,qS).concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:i,cs:{cipher:As(s.cipher,US,jS),mac:As(s.hmac,MS,QS),compress:As(s.compress,LS,WS),lang:[]},sc:void 0};u.sc=u.cs,typeof r=="function"&&this.on("connection",r);let l=typeof e.debug=="function"?e.debug:void 0,d=e.ident?Buffer.from(e.ident):void 0,p=new GS(u);this._srv=new BS(g=>{if(this._connections>=this.maxConnections){g.destroy();return}++this._connections,g.once("close",()=>{--this._connections});let h;if(l){let _=`[${process.hrtime().join(".")}] `;h=c(b=>{l(`${_}${b}`)},"debug")}new cc(g,n,d,p,h,this,e)}).on("error",g=>{this.emit("error",g)}).on("listening",()=>{this.emit("listening")}).on("close",()=>{this.emit("close")}),this._connections=0,this.maxConnections=1/0}injectSocket(e){this._srv.emit("connection",e)}listen(...e){return this._srv.listen(...e),this}address(){return this._srv.address()}getConnections(e){return this._srv.getConnections(e),this}close(e){return this._srv.close(e),this}ref(){return this._srv.ref(),this}unref(){return this._srv.unref(),this}};Dr.KEEPALIVE_CLIENT_INTERVAL=15e3;Dr.KEEPALIVE_CLIENT_COUNT_MAX=3;var cc=class extends bs{static{c(this,"Client")}constructor(e,r,n,i,o,s,a){super();let u=0,l=!1,d=[],p,g,h,_=[];this._sock=e,this._chanMgr=new tw(this),this._debug=o,this.noMoreSessions=!1,this.authenticated=!1;function b(X){}c(b,"onClientPreHeaderError"),this.on("error",b);let E=o?(X,P,C)=>{o(`Debug output from client: ${JSON.stringify(C)}`)}:void 0,v=typeof a.keepaliveInterval=="number"&&isFinite(a.keepaliveInterval)&&a.keepaliveInterval>0?a.keepaliveInterval:typeof Dr.KEEPALIVE_CLIENT_INTERVAL=="number"&&isFinite(Dr.KEEPALIVE_CLIENT_INTERVAL)&&Dr.KEEPALIVE_CLIENT_INTERVAL>0?Dr.KEEPALIVE_CLIENT_INTERVAL:-1,w=typeof a.keepaliveCountMax=="number"&&isFinite(a.keepaliveCountMax)&&a.keepaliveCountMax>=0?a.keepaliveCountMax:typeof Dr.KEEPALIVE_CLIENT_COUNT_MAX=="number"&&isFinite(Dr.KEEPALIVE_CLIENT_COUNT_MAX)&&Dr.KEEPALIVE_CLIENT_COUNT_MAX>=0?Dr.KEEPALIVE_CLIENT_COUNT_MAX:-1,H=0;v!==-1&&w!==-1&&(this.once("ready",()=>{let X=c(()=>{clearInterval(g)},"onClose");this.on("close",X).on("end",X),g=setInterval(()=>{if(++H>w){clearInterval(g);let P=new Error("Keepalive timeout");P.level="client-timeout",this.emit("error",P),this.end()}else D.ping()},v)}),h=c(()=>{g&&g.refresh(),H=0},"onPacket"));let D=this._protocol=new ZS({server:!0,hostKeys:r,ident:n,offer:i,onPacket:h,greeting:a.greeting,banner:a.banner,onWrite:c(X=>{oc(e)&&e.write(X)},"onWrite"),onError:c(X=>{D._destruct||e.removeAllListeners("data"),this.emit("error",X);try{e.end()}catch{}},"onError"),onHeader:c(X=>{this.removeListener("error",b);let P={ip:e.remoteAddress,family:e.remoteFamily,port:e.remotePort,header:X};if(!s.emit("connection",this,P)){D.disconnect(co.BY_APPLICATION),e.end();return}X.greeting&&this.emit("greeting",X.greeting)},"onHeader"),onHandshakeComplete:c(X=>{++u>1&&this.emit("rekey"),this.emit("handshake",X)},"onHandshakeComplete"),debug:o,messageHandlers:{DEBUG:E,DISCONNECT:c((X,P,C)=>{if(P!==co.BY_APPLICATION){C||(C=HS[P],C===void 0&&(C=`Unexpected disconnection reason: ${P}`));let M=new Error(C);M.code=P,this.emit("error",M)}e.end()},"DISCONNECT"),CHANNEL_OPEN:c((X,P)=>{if(P.type==="session"&&this.noMoreSessions||!this.authenticated){let Z=ao.ADMINISTRATIVELY_PROHIBITED;return D.channelOpenFail(P.sender,Z)}let C=-1,M,L=!1,T,F=c(()=>{L||(L=!0,M===void 0&&(C===-1?M=ao.RESOURCE_SHORTAGE:M=ao.CONNECT_FAILED),C!==-1&&this._chanMgr.remove(C),D.channelOpenFail(P.sender,M,""))},"reject"),j=c(()=>(C=this._chanMgr.add(),C===-1&&(M=ao.RESOURCE_SHORTAGE,o&&o("Automatic rejection of incoming channel open: no channels available")),C!==-1),"reserveChannel"),B=P.data;switch(P.type){case"session":if(Er(this,"session")&&j()){T=c(()=>{if(L)return;L=!0;let Z=new an(this,P,C);return this._chanMgr.update(C,Z),D.channelOpenConfirm(P.sender,C,Qn,Vn),Z},"accept"),this.emit("session",T,F);return}break;case"direct-tcpip":if(Er(this,"tcpip")&&j()){T=c(()=>{if(L)return;L=!0;let Z={type:void 0,incoming:{id:C,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},te=new uo(this,Z,{server:!0});return this._chanMgr.update(C,te),D.channelOpenConfirm(P.sender,C,Qn,Vn),te},"accept"),this.emit("tcpip",T,F,B);return}break;case"direct-streamlocal@openssh.com":if(Er(this,"openssh.streamlocal")&&j()){T=c(()=>{if(L)return;L=!0;let Z={type:void 0,incoming:{id:C,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},te=new uo(this,Z,{server:!0});return this._chanMgr.update(C,te),D.channelOpenConfirm(P.sender,C,Qn,Vn),te},"accept"),this.emit("openssh.streamlocal",T,F,B);return}break;default:M=ao.UNKNOWN_CHANNEL_TYPE,o&&o(`Automatic rejection of unsupported incoming channel open type: ${P.type}`)}M===void 0&&(M=ao.ADMINISTRATIVELY_PROHIBITED,o&&o(`Automatic rejection of unexpected incoming channel open for: ${P.type}`)),F()},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:c((X,P)=>{let C=this._chanMgr.get(P.recipient);if(typeof C!="function")return;let M={type:C.type,incoming:{id:P.recipient,window:Qn,packetSize:Vn,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},L=new uo(this,M,{server:!0});this._chanMgr.update(P.recipient,L),C(void 0,L)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:c((X,P,C,M)=>{let L=this._chanMgr.get(P);if(typeof L!="function")return;rw(this,P,{reason:C,description:M},L)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:c((X,P,C)=>{let M=this._chanMgr.get(P);if(!(typeof M!="object"||M===null)&&!(M.constructor===an&&(M=M._channel,!M))&&M.incoming.window!==0){if(M.incoming.window-=C.length,M.push(C)===!1){M._waitChanDrain=!0;return}M.incoming.window<=ew&&JS(M)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:c((X,P,C,M)=>{},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:c((X,P,C)=>{let M=this._chanMgr.get(P);typeof M!="object"||M===null||M.constructor===an&&(M=M._channel,!M)||(M.outgoing.window+=C,M._waitWindow&&(M._waitWindow=!1,M._chunk?M._write(M._chunk,null,M._chunkcb):M._chunkcb?M._chunkcb():M._chunkErr?M.stderr._write(M._chunkErr,null,M._chunkcbErr):M._chunkcbErr&&M._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!1)},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!0)},"CHANNEL_FAILURE"),CHANNEL_REQUEST:c((X,P,C,M,L)=>{let T=this._chanMgr.get(P);if(typeof T!="object"||T===null)return;let F=!1,j,B;if(T.constructor!==an){M&&D.channelFailure(T.outgoing.id);return}if(M&&(C!=="shell"&&C!=="exec"&&C!=="subsystem"&&(j=c(()=>{F||T._ending||T._channel||(F=!0,D.channelSuccess(T._chanInfo.outgoing.id))},"accept")),B=c(()=>{F||T._ending||T._channel||(F=!0,D.channelFailure(T._chanInfo.outgoing.id))},"reject")),T._ending){B&&B();return}switch(C){case"env":if(Er(T,"env")){T.emit("env",j,B,{key:L.name,val:L.value});return}break;case"pty-req":if(Er(T,"pty")){T.emit("pty",j,B,L);return}break;case"window-change":Er(T,"window-change")?T.emit("window-change",j,B,L):B&&B();break;case"x11-req":if(Er(T,"x11")){T.emit("x11",j,B,L);return}break;case"signal":if(Er(T,"signal")){T.emit("signal",j,B,{name:L});return}break;case"auth-agent-req@openssh.com":if(Er(T,"auth-agent")){T.emit("auth-agent",j,B);return}break;case"shell":if(Er(T,"shell")){j=c(()=>{if(F||T._ending||T._channel)return;F=!0,M&&D.channelSuccess(T._chanInfo.outgoing.id);let Z=new uo(this,T._chanInfo,{server:!0});return Z.subtype=T.subtype=C,T._channel=Z,Z},"accept"),T.emit("shell",j,B);return}break;case"exec":if(Er(T,"exec")){j=c(()=>{if(F||T._ending||T._channel)return;F=!0,M&&D.channelSuccess(T._chanInfo.outgoing.id);let Z=new uo(this,T._chanInfo,{server:!0});return Z.subtype=T.subtype=C,T._channel=Z,Z},"accept"),T.emit("exec",j,B,{command:L});return}break;case"subsystem":{let Z=L==="sftp";if(j=c(()=>{if(F||T._ending||T._channel)return;F=!0,M&&D.channelSuccess(T._chanInfo.outgoing.id);let te;return Z?te=new YS(this,T._chanInfo,{server:!0,debug:o}):(te=new uo(this,T._chanInfo,{server:!0}),te.subtype=T.subtype=`${C}:${L}`),T._channel=te,te},"accept"),L==="sftp"){if(Er(T,"sftp")){T.emit("sftp",j,B);return}Z=!1}if(Er(T,"subsystem")){T.emit("subsystem",j,B,{name:L});return}break}}o&&o(`Automatic rejection of incoming channel request: ${C}`),B&&B()},"CHANNEL_REQUEST"),CHANNEL_EOF:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C._ending||(C._ending=!0,C.emit("eof"),C.emit("end")),C=C._channel,!C)||C.incoming.state==="open"&&(C.incoming.state="eof",C.readable&&C.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:c((X,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===an&&(C._ending=!0,C.emit("close"),C=C._channel,!C)||nw(this,P,C)},"CHANNEL_CLOSE"),SERVICE_REQUEST:c((X,P)=>{if(u===0||l||this.authenticated||P!=="ssh-userauth"){D.disconnect(co.SERVICE_NOT_AVAILABLE),e.end();return}l=!0,D.serviceAccept(P)},"SERVICE_REQUEST"),USERAUTH_REQUEST:c((X,P,C,M,L)=>{if(u===0||this.authenticated||p&&(p.username!==P||p.service!==C)||M!=="password"&&M!=="publickey"&&M!=="hostbased"&&M!=="keyboard-interactive"&&M!=="none"||d.length===iw){D.disconnect(co.PROTOCOL_ERROR),e.end();return}else if(C!=="ssh-connection"){D.disconnect(co.SERVICE_NOT_AVAILABLE),e.end();return}let T;switch(M){case"keyboard-interactive":T=new sc(D,P,C,M,L,J);break;case"publickey":T=new Ef(D,P,C,M,L,J);break;case"hostbased":T=new Af(D,P,C,M,L,J);break;case"password":if(p&&p instanceof ac&&p._changeCb){let F=p._changeCb;p._changeCb=void 0,F(L.newPassword);return}T=new ac(D,P,C,M,L,J);break;case"none":T=new Kn(D,P,C,M,J);break}if(p)if(p._initialResponse)p._multistep&&!p._finalResponse&&(p._cleanup&&p._cleanup(),p.emit("abort"));else return d.push(T);p=T,Er(this,"authentication")?this.emit("authentication",p):p.reject()},"USERAUTH_REQUEST"),USERAUTH_INFO_RESPONSE:c((X,P)=>{p&&p instanceof sc&&p._onInfoResponse(P)},"USERAUTH_INFO_RESPONSE"),GLOBAL_REQUEST:c((X,P,C,M)=>{let L={type:null,buf:null};function T(F,j){L.type=F,L.buf=j,Y()}if(c(T,"setReply"),C&&_.push(L),(P==="tcpip-forward"||P==="cancel-tcpip-forward"||P==="no-more-sessions@openssh.com"||P==="streamlocal-forward@openssh.com"||P==="cancel-streamlocal-forward@openssh.com")&&Er(this,"request")&&this.authenticated){let F,j;if(C){let B=!1;F=c(Z=>{if(B)return;B=!0;let te;P==="tcpip-forward"&&M.bindPort===0&&typeof Z=="number"&&(te=Buffer.allocUnsafe(4),XS(te,Z,0)),T("SUCCESS",te)},"accept"),j=c(()=>{B||(B=!0,T("FAILURE"))},"reject")}if(P==="no-more-sessions@openssh.com"){this.noMoreSessions=!0,F&&F();return}this.emit("request",F,j,P,M)}else C&&T("FAILURE")},"GLOBAL_REQUEST")}});e.pause(),KS.then(()=>{D.start(),e.on("data",X=>{try{D.parse(X,0,X.length)}catch(P){this.emit("error",P);try{oc(e)&&e.end()}catch{}}}),e.resume()}).catch(X=>{this.emit("error",X);try{oc(e)&&e.end()}catch{}}),e.on("error",X=>{X.level="socket",this.emit("error",X)}).once("end",()=>{o&&o("Socket ended"),D.cleanup(),this.emit("end")}).once("close",()=>{o&&o("Socket closed"),D.cleanup(),this.emit("close");let X=new Error("No response from server");this._chanMgr.cleanup(X)});let J=c((X,P,C,M)=>{p===X&&!this.authenticated&&(P?(p=void 0,this.authenticated=!0,D.authSuccess(),d=[],this.emit("ready")):(D.authFailure(C,M),d.length&&(p=d.pop(),Er(this,"authentication")?this.emit("authentication",p):p.reject())))},"onAuthDecide");function Y(){for(;_.length>0&&_[0].type;){let X=_.shift();X.type==="SUCCESS"&&D.requestSuccess(X.buf),X.type==="FAILURE"&&D.requestFailure()}}c(Y,"sendReplies")}end(){return this._sock&&oc(this._sock)&&(this._protocol.disconnect(co.BY_APPLICATION),this._sock.end()),this}x11(e,r,n){return yf(this,"x11",{originAddr:e,originPort:r},n),this}forwardOut(e,r,n,i,o){return yf(this,"forwarded-tcpip",{boundAddr:e,boundPort:r,remoteAddr:n,remotePort:i},o),this}openssh_forwardOutStreamLocal(e,r){return yf(this,"forwarded-streamlocal@openssh.com",{socketPath:e},r),this}rekey(e){let r;try{this._protocol.rekey()}catch(n){r=n}typeof e=="function"&&(r?process.nextTick(e,r):this.once("rekey",e))}setNoDelay(e){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(e),this}};function yf(t,e,r,n){let i=Qn,o=Vn;typeof r=="function"&&(n=r,r={});let s=c((u,l)=>{n(u,l)},"wrapper");s.type=e;let a=t._chanMgr.add(s);if(a===-1){n(new Error("No free channels available"));return}switch(e){case"forwarded-tcpip":t._protocol.forwardedTcpip(a,i,o,r);break;case"x11":t._protocol.x11(a,i,o,r);break;case"forwarded-streamlocal@openssh.com":t._protocol.openssh_forwardedStreamLocal(a,i,o,r);break;default:throw new Error(`Unsupported channel type: ${e}`)}}c(yf,"openChannel");function ow(t,e){return t-e}c(ow,"compareNumbers");bf.exports=Dr;bf.exports.IncomingClient=cc});var U_=le((s5,B_)=>{"use strict";var{createCipheriv:sw,generateKeyPair:aw,generateKeyPairSync:cw,getCurves:uw,randomBytes:O_}=require("crypto"),{Ber:Ot}=Ko(),lw=Fu().pbkdf,{CIPHER_INFO:fw}=Mn(),dw=16,pw=16,hw=uw(),gw=new Map(Object.entries(fw));function $_(t,e){if(typeof t!="string")throw new TypeError("Key type must be a string");let r={type:"spki",format:"der"},n={type:"pkcs8",format:"der"};switch(t.toLowerCase()){case"rsa":{if(typeof e!="object"||e===null)throw new TypeError("Missing options object for RSA key");let i=e.bits;if(!Number.isInteger(i))throw new TypeError("RSA bits must be an integer");if(i<=0||i>16384)throw new RangeError("RSA bits must be non-zero and <= 16384");return["rsa",{modulusLength:i,publicKeyEncoding:r,privateKeyEncoding:n}]}case"ecdsa":{if(typeof e!="object"||e===null)throw new TypeError("Missing options object for ECDSA key");if(!Number.isInteger(e.bits))throw new TypeError("ECDSA bits must be an integer");let i;switch(e.bits){case 256:i="prime256v1";break;case 384:i="secp384r1";break;case 521:i="secp521r1";break;default:throw new Error("ECDSA bits must be 256, 384, or 521")}if(!hw.includes(i))throw new Error("Unsupported ECDSA bits value");return["ec",{namedCurve:i,publicKeyEncoding:r,privateKeyEncoding:n}]}case"ed25519":return["ed25519",{publicKeyEncoding:r,privateKeyEncoding:n}];default:throw new Error(`Unsupported key type: ${t}`)}}c($_,"makeArgs");function mw(t,e,r){switch(t){case"rsa":{let n=new Ot.Reader(r);if(n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in RSA private key");if(n.readSequence(),n.readOID()!=="1.2.840.113549.1.1.1")throw new Error("Bad RSA private OID");if(n.readByte()!==Ot.Null)throw new Error("Malformed RSA private key (expected null)");if(n.readByte()!==0)throw new Error("Malformed RSA private key (expected zero-length null)");if(n=new Ot.Reader(n.readString(Ot.OctetString,!0)),n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in RSA private key");let i=n.readString(Ot.Integer,!0),o=n.readString(Ot.Integer,!0),s=n.readString(Ot.Integer,!0),a=n.readString(Ot.Integer,!0),u=n.readString(Ot.Integer,!0);n.readString(Ot.Integer,!0),n.readString(Ot.Integer,!0);let l=n.readString(Ot.Integer,!0),d=Buffer.from("ssh-rsa"),p=Buffer.allocUnsafe(4+d.length+4+i.length+4+o.length+4+s.length+4+l.length+4+a.length+4+u.length),g=0;p.writeUInt32BE(d.length,g+=0),p.set(d,g+=4),p.writeUInt32BE(i.length,g+=d.length),p.set(i,g+=4),p.writeUInt32BE(o.length,g+=i.length),p.set(o,g+=4),p.writeUInt32BE(s.length,g+=o.length),p.set(s,g+=4),p.writeUInt32BE(l.length,g+=s.length),p.set(l,g+=4),p.writeUInt32BE(a.length,g+=l.length),p.set(a,g+=4),p.writeUInt32BE(u.length,g+=a.length),p.set(u,g+=4);let h=Buffer.allocUnsafe(4+d.length+4+o.length+4+i.length);return g=0,h.writeUInt32BE(d.length,g+=0),h.set(d,g+=4),h.writeUInt32BE(o.length,g+=d.length),h.set(o,g+=4),h.writeUInt32BE(i.length,g+=o.length),h.set(i,g+=4),{sshName:d.toString(),priv:p,pub:h}}case"ec":{let n=new Ot.Reader(e);if(n.readSequence(),n.readSequence(),n.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA public OID");n.readOID();let i=n.readString(Ot.BitString,!0);{let g=0;for(;g<i.length&&i[g]===0;++g);g>0&&(i=i.slice(g))}if(n=new Ot.Reader(r),n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in ECDSA private key");if(n.readSequence(),n.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA private OID");let o=n.readOID(),s;switch(o){case"1.2.840.10045.3.1.7":s="nistp256";break;case"1.3.132.0.34":s="nistp384";break;case"1.3.132.0.35":s="nistp521";break;default:throw new Error("Unsupported curve in ECDSA private key")}if(n=new Ot.Reader(n.readString(Ot.OctetString,!0)),n.readSequence(),n.readInt()!==1)throw new Error("Unsupported version in ECDSA private key");let a=Buffer.concat([Buffer.from([0]),n.readString(Ot.OctetString,!0)]),u=Buffer.from(`ecdsa-sha2-${s}`);s=Buffer.from(s);let l=Buffer.allocUnsafe(4+u.length+4+s.length+4+i.length+4+a.length),d=0;l.writeUInt32BE(u.length,d+=0),l.set(u,d+=4),l.writeUInt32BE(s.length,d+=u.length),l.set(s,d+=4),l.writeUInt32BE(i.length,d+=s.length),l.set(i,d+=4),l.writeUInt32BE(a.length,d+=i.length),l.set(a,d+=4);let p=Buffer.allocUnsafe(4+u.length+4+s.length+4+i.length);return d=0,p.writeUInt32BE(u.length,d+=0),p.set(u,d+=4),p.writeUInt32BE(s.length,d+=u.length),p.set(s,d+=4),p.writeUInt32BE(i.length,d+=s.length),p.set(i,d+=4),{sshName:u.toString(),priv:l,pub:p}}case"ed25519":{let n=new Ot.Reader(e);if(n.readSequence(),n.readSequence(),n.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 public OID");let i=n.readString(Ot.BitString,!0);{let d=0;for(;d<i.length&&i[d]===0;++d);d>0&&(i=i.slice(d))}if(n=new Ot.Reader(r),n.readSequence(),n.readInt()!==0)throw new Error("Unsupported version in ED25519 private key");if(n.readSequence(),n.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 private OID");n=new Ot.Reader(n.readString(Ot.OctetString,!0));let o=n.readString(Ot.OctetString,!0),s=Buffer.from("ssh-ed25519"),a=Buffer.allocUnsafe(4+s.length+4+i.length+4+(o.length+i.length)),u=0;a.writeUInt32BE(s.length,u+=0),a.set(s,u+=4),a.writeUInt32BE(i.length,u+=s.length),a.set(i,u+=4),a.writeUInt32BE(o.length+i.length,u+=i.length),a.set(o,u+=4),a.set(i,u+=o.length);let l=Buffer.allocUnsafe(4+s.length+4+i.length);return u=0,l.writeUInt32BE(s.length,u+=0),l.set(s,u+=4),l.writeUInt32BE(i.length,u+=s.length),l.set(i,u+=4),{sshName:s.toString(),priv:a,pub:l}}}}c(mw,"parseDERs");function D_(t,e,r,n){let i="new",o,s="";if(typeof n=="object"&&n!==null&&(typeof n.comment=="string"&&n.comment&&(s=n.comment),typeof n.format=="string"&&n.format&&(i=n.format),n.passphrase)){let a;if(typeof n.passphrase=="string")a=Buffer.from(n.passphrase);else if(Buffer.isBuffer(n.passphrase))a=n.passphrase;else throw new Error("Invalid passphrase");if(n.cipher===void 0)throw new Error("Missing cipher name");let u=gw.get(n.cipher);if(u===void 0)throw new Error("Invalid cipher name");if(i==="new"){let l=pw;if(n.rounds!==void 0){if(!Number.isInteger(n.rounds))throw new TypeError("rounds must be an integer");n.rounds>0&&(l=n.rounds)}let d=Buffer.allocUnsafe(u.keyLen+u.ivLen),p=O_(dw);if(lw(a,a.length,p,p.length,d,d.length,l)!==0)return new Error("Failed to generate information to encrypt key");let h=Buffer.allocUnsafe(4+p.length+4);{let _=0;h.writeUInt32BE(p.length,_+=0),h.set(p,_+=4),h.writeUInt32BE(l,_+=p.length)}o={cipher:u,cipherName:n.cipher,kdfName:"bcrypt",kdfOptions:h,key:d.slice(0,u.keyLen),iv:d.slice(u.keyLen)}}}switch(i){case"new":{let a=`-----BEGIN OPENSSH PRIVATE KEY-----
20
- `,u,l=Buffer.from(o?o.cipherName:"none"),d=Buffer.from(o?o.kdfName:"none"),p=o?o.kdfOptions:Buffer.alloc(0),g=o?o.cipher.blockLen:8,h=mw(t,e,r),_=O_(4),b=Buffer.from(s),E=8+h.priv.length+4+b.length,v=[];for(let Y=1;(E+v.length)%g;++Y)v.push(Y&255);v=Buffer.from(v);let w=Buffer.allocUnsafe(E+v.length),H;{let Y=0;w.set(_,Y+=0),w.set(_,Y+=4),w.set(h.priv,Y+=4),w.writeUInt32BE(b.length,Y+=h.priv.length),w.set(b,Y+=4),w.set(v,Y+=b.length)}if(o){let Y={authTagLength:o.cipher.authLen},X=sw(o.cipher.sslName,o.key,o.iv,Y);X.setAutoPadding(!1),w=Buffer.concat([X.update(w),X.final()]),o.cipher.authLen>0?H=X.getAuthTag():H=Buffer.alloc(0),o.key.fill(0),o.iv.fill(0)}else H=Buffer.alloc(0);let D=Buffer.from("openssh-key-v1\0"),J=Buffer.allocUnsafe(D.length+4+l.length+4+d.length+4+p.length+4+4+h.pub.length+4+w.length+H.length);{let Y=0;J.set(D,Y+=0),J.writeUInt32BE(l.length,Y+=D.length),J.set(l,Y+=4),J.writeUInt32BE(d.length,Y+=l.length),J.set(d,Y+=4),J.writeUInt32BE(p.length,Y+=d.length),J.set(p,Y+=4),J.writeUInt32BE(1,Y+=p.length),J.writeUInt32BE(h.pub.length,Y+=4),J.set(h.pub,Y+=4),J.writeUInt32BE(w.length,Y+=h.pub.length),J.set(w,Y+=4),J.set(H,Y+=w.length)}{let Y=J.base64Slice(0,J.length),X=Y.replace(/.{64}/g,`$&
21
- `);Y.length&63&&(X+=`
22
- `),a+=X}{let Y=h.pub.base64Slice(0,h.pub.length);u=`${h.sshName} ${Y}${s?` ${s}`:""}`}return a+=`-----END OPENSSH PRIVATE KEY-----
23
- `,{private:a,public:u}}default:throw new Error("Invalid output key format")}}c(D_,"convertKeys");function _w(){}c(_w,"noop");B_.exports={generateKeyPair:c((t,e,r)=>{typeof e=="function"&&(r=e,e=void 0),typeof r!="function"&&(r=_w);let n=$_(t,e);aw(...n,(i,o,s)=>{if(i)return r(i);let a;try{a=D_(n[0],o,s,e)}catch(u){return r(u)}r(null,a)})},"generateKeyPair"),generateKeyPairSync:c((t,e)=>{let r=$_(t,e),{publicKey:n,privateKey:i}=cw(...r);return D_(r[0],n,i,e)},"generateKeyPairSync")}});var z_=le((c5,L_)=>{"use strict";var{AgentProtocol:yw,BaseAgent:Ew,createAgent:Aw,CygwinAgent:bw,OpenSSHAgent:xw,PageantAgent:Iw}=Cl(),{SSHTTPAgent:vw,SSHTTPSAgent:Sw}=k_(),{parseKey:ww}=jn(),{flagsToString:Pw,OPEN_MODE:Tw,STATUS_CODE:Cw,stringToFlags:kw}=ps();L_.exports={AgentProtocol:yw,BaseAgent:Ew,createAgent:Aw,Client:gf(),CygwinAgent:bw,HTTPAgent:vw,HTTPSAgent:Sw,OpenSSHAgent:xw,PageantAgent:Iw,Server:N_(),utils:{parseKey:ww,...U_(),sftp:{flagsToString:Pw,OPEN_MODE:Tw,STATUS_CODE:Cw,stringToFlags:kw}}}});var xf=le((u5,M_)=>{M_.exports=require("stream")});var Q_=le((l5,q_)=>{"use strict";function F_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}c(F_,"ownKeys");function H_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?F_(Object(r),!0).forEach(function(n){Rw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}c(H_,"_objectSpread");function Rw(t,e,r){return e=W_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}c(Rw,"_defineProperty");function Nw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}c(Nw,"_classCallCheck");function j_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W_(n.key),n)}}c(j_,"_defineProperties");function Ow(t,e,r){return e&&j_(t.prototype,e),r&&j_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}c(Ow,"_createClass");function W_(t){var e=$w(t,"string");return typeof e=="symbol"?e:String(e)}c(W_,"_toPropertyKey");function $w(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}c($w,"_toPrimitive");var Dw=require("buffer"),uc=Dw.Buffer,Bw=require("util"),If=Bw.inspect,Uw=If&&If.custom||"inspect";function Lw(t,e,r){uc.prototype.copy.call(t,e,r)}c(Lw,"copyBuffer");q_.exports=(function(){function t(){Nw(this,t),this.head=null,this.tail=null,this.length=0}return c(t,"BufferList"),Ow(t,[{key:"push",value:c(function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},"push")},{key:"unshift",value:c(function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},"unshift")},{key:"shift",value:c(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:c(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:c(function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i},"join")},{key:"concat",value:c(function(r){if(this.length===0)return uc.alloc(0);for(var n=uc.allocUnsafe(r>>>0),i=this.head,o=0;i;)Lw(i.data,n,o),o+=i.data.length,i=i.next;return n},"concat")},{key:"consume",value:c(function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i},"consume")},{key:"first",value:c(function(){return this.head.data},"first")},{key:"_getString",value:c(function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o},"_getString")},{key:"_getBuffer",value:c(function(r){var n=uc.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n},"_getBuffer")},{key:Uw,value:c(function(r,n){return If(this,H_(H_({},n),{},{depth:0,customInspect:!1}))},"value")}]),t})()});var Sf=le((d5,K_)=>{"use strict";function zw(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(vf,this,t)):process.nextTick(vf,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(lc,r):(r._writableState.errorEmitted=!0,process.nextTick(V_,r,o)):process.nextTick(V_,r,o):e?(process.nextTick(lc,r),e(o)):process.nextTick(lc,r)}),this)}c(zw,"destroy");function V_(t,e){vf(t,e),lc(t)}c(V_,"emitErrorAndCloseNT");function lc(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}c(lc,"emitCloseNT");function Mw(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}c(Mw,"undestroy");function vf(t,e){t.emit("error",e)}c(vf,"emitErrorNT");function Fw(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}c(Fw,"errorOrDestroy");K_.exports={destroy:zw,undestroy:Mw,errorOrDestroy:Fw}});var Gn=le((h5,Y_)=>{"use strict";var Z_={};function jr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}c(n,"getMessage");class i extends r{static{c(this,"NodeError")}constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Z_[t]=i}c(jr,"createErrorType");function G_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}c(G_,"oneOf");function Hw(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}c(Hw,"startsWith");function jw(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}c(jw,"endsWith");function Ww(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}c(Ww,"includes");jr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);jr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&Hw(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(jw(t," argument"))i=`The ${t} ${n} ${G_(e,"type")}`;else{let o=Ww(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${G_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);jr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");jr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});jr("ERR_STREAM_PREMATURE_CLOSE","Premature close");jr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});jr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");jr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");jr("ERR_STREAM_WRITE_AFTER_END","write after end");jr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);jr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);jr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Y_.exports.codes=Z_});var wf=le((m5,X_)=>{"use strict";var qw=Gn().codes.ERR_INVALID_OPT_VALUE;function Qw(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}c(Qw,"highWaterMarkFrom");function Vw(t,e,r,n){var i=Qw(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new qw(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}c(Vw,"getHighWaterMark");X_.exports={getHighWaterMark:Vw}});var J_=le((y5,Pf)=>{typeof Object.create=="function"?Pf.exports=c(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Pf.exports=c(function(e,r){if(r){e.super_=r;var n=c(function(){},"TempCtor");n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var di=le((A5,Cf)=>{try{if(Tf=require("util"),typeof Tf.inherits!="function")throw"";Cf.exports=Tf.inherits}catch{Cf.exports=J_()}var Tf});var ty=le((b5,ey)=>{ey.exports=require("util").deprecate});var Nf=le((x5,ay)=>{"use strict";ay.exports=Gt;function ny(t){var e=this;this.next=null,this.entry=null,this.finish=function(){AP(e,t)}}c(ny,"CorkedRequest");var lo;Gt.WritableState=Is;var Kw={deprecate:ty()},iy=xf(),dc=require("buffer").Buffer,Gw=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Zw(t){return dc.from(t)}c(Zw,"_uint8ArrayToBuffer");function Yw(t){return dc.isBuffer(t)||t instanceof Gw}c(Yw,"_isUint8Array");var Rf=Sf(),Xw=wf(),Jw=Xw.getHighWaterMark,Zn=Gn().codes,eP=Zn.ERR_INVALID_ARG_TYPE,tP=Zn.ERR_METHOD_NOT_IMPLEMENTED,rP=Zn.ERR_MULTIPLE_CALLBACK,nP=Zn.ERR_STREAM_CANNOT_PIPE,iP=Zn.ERR_STREAM_DESTROYED,oP=Zn.ERR_STREAM_NULL_VALUES,sP=Zn.ERR_STREAM_WRITE_AFTER_END,aP=Zn.ERR_UNKNOWN_ENCODING,fo=Rf.errorOrDestroy;di()(Gt,iy);function cP(){}c(cP,"nop");function Is(t,e,r){lo=lo||pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof lo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Jw(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){gP(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new ny(this)}c(Is,"WritableState");Is.prototype.getBuffer=c(function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},"getBuffer");(function(){try{Object.defineProperty(Is.prototype,"buffer",{get:Kw.deprecate(c(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var fc;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(fc=Function.prototype[Symbol.hasInstance],Object.defineProperty(Gt,Symbol.hasInstance,{value:c(function(e){return fc.call(this,e)?!0:this!==Gt?!1:e&&e._writableState instanceof Is},"value")})):fc=c(function(e){return e instanceof this},"realHasInstance");function Gt(t){lo=lo||pi();var e=this instanceof lo;if(!e&&!fc.call(Gt,this))return new Gt(t);this._writableState=new Is(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),iy.call(this)}c(Gt,"Writable");Gt.prototype.pipe=function(){fo(this,new nP)};function uP(t,e){var r=new sP;fo(t,r),process.nextTick(e,r)}c(uP,"writeAfterEnd");function lP(t,e,r,n){var i;return r===null?i=new oP:typeof r!="string"&&!e.objectMode&&(i=new eP("chunk",["string","Buffer"],r)),i?(fo(t,i),process.nextTick(n,i),!1):!0}c(lP,"validChunk");Gt.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&Yw(t);return o&&!dc.isBuffer(t)&&(t=Zw(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=cP),n.ending?uP(this,r):(o||lP(this,n,t,r))&&(n.pendingcb++,i=dP(this,n,o,t,e,r)),i};Gt.prototype.cork=function(){this._writableState.corked++};Gt.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&oy(this,t))};Gt.prototype.setDefaultEncoding=c(function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new aP(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");Object.defineProperty(Gt.prototype,"writableBuffer",{enumerable:!1,get:c(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function fP(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=dc.from(e,r)),e}c(fP,"decodeChunk");Object.defineProperty(Gt.prototype,"writableHighWaterMark",{enumerable:!1,get:c(function(){return this._writableState.highWaterMark},"get")});function dP(t,e,r,n,i,o){if(!r){var s=fP(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else kf(t,e,!1,a,n,i,o);return u}c(dP,"writeOrBuffer");function kf(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new iP("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}c(kf,"doWrite");function pP(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(xs,t,e),t._writableState.errorEmitted=!0,fo(t,n)):(i(n),t._writableState.errorEmitted=!0,fo(t,n),xs(t,e))}c(pP,"onwriteError");function hP(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}c(hP,"onwriteStateUpdate");function gP(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new rP;if(hP(r),e)pP(t,r,n,e,i);else{var o=sy(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&oy(t,r),n?process.nextTick(ry,t,r,o,i):ry(t,r,o,i)}}c(gP,"onwrite");function ry(t,e,r,n){r||mP(t,e),e.pendingcb--,n(),xs(t,e)}c(ry,"afterWrite");function mP(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}c(mP,"onwriteDrain");function oy(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,kf(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new ny(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback,p=e.objectMode?1:u.length;if(kf(t,e,!1,p,u,l,d),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}c(oy,"clearBuffer");Gt.prototype._write=function(t,e,r){r(new tP("_write()"))};Gt.prototype._writev=null;Gt.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||EP(this,n,r),this};Object.defineProperty(Gt.prototype,"writableLength",{enumerable:!1,get:c(function(){return this._writableState.length},"get")});function sy(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}c(sy,"needFinish");function _P(t,e){t._final(function(r){e.pendingcb--,r&&fo(t,r),e.prefinished=!0,t.emit("prefinish"),xs(t,e)})}c(_P,"callFinal");function yP(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(_P,t,e)):(e.prefinished=!0,t.emit("prefinish")))}c(yP,"prefinish");function xs(t,e){var r=sy(e);if(r&&(yP(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}c(xs,"finishMaybe");function EP(t,e,r){e.ending=!0,xs(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}c(EP,"endWritable");function AP(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}c(AP,"onCorkedFinish");Object.defineProperty(Gt.prototype,"destroyed",{enumerable:!1,get:c(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:c(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")});Gt.prototype.destroy=Rf.destroy;Gt.prototype._undestroy=Rf.undestroy;Gt.prototype._destroy=function(t,e){e(t)}});var pi=le((v5,uy)=>{"use strict";var bP=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};uy.exports=cn;var cy=Df(),$f=Nf();di()(cn,cy);for(Of=bP($f.prototype),pc=0;pc<Of.length;pc++)hc=Of[pc],cn.prototype[hc]||(cn.prototype[hc]=$f.prototype[hc]);var Of,hc,pc;function cn(t){if(!(this instanceof cn))return new cn(t);cy.call(this,t),$f.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",xP)))}c(cn,"Duplex");Object.defineProperty(cn.prototype,"writableHighWaterMark",{enumerable:!1,get:c(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(cn.prototype,"writableBuffer",{enumerable:!1,get:c(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(cn.prototype,"writableLength",{enumerable:!1,get:c(function(){return this._writableState.length},"get")});function xP(){this._writableState.ended||process.nextTick(IP,this)}c(xP,"onend");function IP(t){t.end()}c(IP,"onEndNT");Object.defineProperty(cn.prototype,"destroyed",{enumerable:!1,get:c(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:c(function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")})});var dy=le((Bf,fy)=>{var gc=require("buffer"),un=gc.Buffer;function ly(t,e){for(var r in t)e[r]=t[r]}c(ly,"copyProps");un.from&&un.alloc&&un.allocUnsafe&&un.allocUnsafeSlow?fy.exports=gc:(ly(gc,Bf),Bf.Buffer=hi);function hi(t,e,r){return un(t,e,r)}c(hi,"SafeBuffer");hi.prototype=Object.create(un.prototype);ly(un,hi);hi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return un(t,e,r)};hi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=un(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};hi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return un(t)};hi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return gc.SlowBuffer(t)}});var zf=le(hy=>{"use strict";var Lf=dy().Buffer,py=Lf.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function vP(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}c(vP,"_normalizeEncoding");function SP(t){var e=vP(t);if(typeof e!="string"&&(Lf.isEncoding===py||!py(t)))throw new Error("Unknown encoding: "+t);return e||t}c(SP,"normalizeEncoding");hy.StringDecoder=vs;function vs(t){this.encoding=SP(t);var e;switch(this.encoding){case"utf16le":this.text=RP,this.end=NP,e=4;break;case"utf8":this.fillLast=TP,e=4;break;case"base64":this.text=OP,this.end=$P,e=3;break;default:this.write=DP,this.end=BP;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Lf.allocUnsafe(e)}c(vs,"StringDecoder");vs.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};vs.prototype.end=kP;vs.prototype.text=CP;vs.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Uf(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}c(Uf,"utf8CheckByte");function wP(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Uf(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Uf(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Uf(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}c(wP,"utf8CheckIncomplete");function PP(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}c(PP,"utf8CheckExtraBytes");function TP(t){var e=this.lastTotal-this.lastNeed,r=PP(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}c(TP,"utf8FillLast");function CP(t,e){var r=wP(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}c(CP,"utf8Text");function kP(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}c(kP,"utf8End");function RP(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}c(RP,"utf16Text");function NP(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}c(NP,"utf16End");function OP(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}c(OP,"base64Text");function $P(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}c($P,"base64End");function DP(t){return t.toString(this.encoding)}c(DP,"simpleWrite");function BP(t){return t&&t.length?this.write(t):""}c(BP,"simpleEnd")});var mc=le((C5,_y)=>{"use strict";var gy=Gn().codes.ERR_STREAM_PREMATURE_CLOSE;function UP(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}c(UP,"once");function LP(){}c(LP,"noop");function zP(t){return t.setHeader&&typeof t.abort=="function"}c(zP,"isRequest");function my(t,e,r){if(typeof e=="function")return my(t,null,e);e||(e={}),r=UP(r||LP);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=c(function(){t.writable||a()},"onlegacyfinish"),s=t._writableState&&t._writableState.finished,a=c(function(){i=!1,s=!0,n||r.call(t)},"onfinish"),u=t._readableState&&t._readableState.endEmitted,l=c(function(){n=!1,u=!0,i||r.call(t)},"onend"),d=c(function(_){r.call(t,_)},"onerror"),p=c(function(){var _;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(_=new gy),r.call(t,_);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(_=new gy),r.call(t,_)},"onclose"),g=c(function(){t.req.on("finish",a)},"onrequest");return zP(t)?(t.on("complete",a),t.on("abort",p),t.req?g():t.on("request",g)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",a),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",d),t.removeListener("close",p)}}c(my,"eos");_y.exports=my});var Ey=le((R5,yy)=>{"use strict";var _c;function Yn(t,e,r){return e=MP(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}c(Yn,"_defineProperty");function MP(t){var e=FP(t,"string");return typeof e=="symbol"?e:String(e)}c(MP,"_toPropertyKey");function FP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}c(FP,"_toPrimitive");var HP=mc(),Xn=Symbol("lastResolve"),gi=Symbol("lastReject"),Ss=Symbol("error"),yc=Symbol("ended"),mi=Symbol("lastPromise"),Mf=Symbol("handlePromise"),_i=Symbol("stream");function Jn(t,e){return{value:t,done:e}}c(Jn,"createIterResult");function jP(t){var e=t[Xn];if(e!==null){var r=t[_i].read();r!==null&&(t[mi]=null,t[Xn]=null,t[gi]=null,e(Jn(r,!1)))}}c(jP,"readAndResolve");function WP(t){process.nextTick(jP,t)}c(WP,"onReadable");function qP(t,e){return function(r,n){t.then(function(){if(e[yc]){r(Jn(void 0,!0));return}e[Mf](r,n)},n)}}c(qP,"wrapForNext");var QP=Object.getPrototypeOf(function(){}),VP=Object.setPrototypeOf((_c={get stream(){return this[_i]},next:c(function(){var e=this,r=this[Ss];if(r!==null)return Promise.reject(r);if(this[yc])return Promise.resolve(Jn(void 0,!0));if(this[_i].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[Ss]?a(e[Ss]):s(Jn(void 0,!0))})});var n=this[mi],i;if(n)i=new Promise(qP(n,this));else{var o=this[_i].read();if(o!==null)return Promise.resolve(Jn(o,!1));i=new Promise(this[Mf])}return this[mi]=i,i},"next")},Yn(_c,Symbol.asyncIterator,function(){return this}),Yn(_c,"return",c(function(){var e=this;return new Promise(function(r,n){e[_i].destroy(null,function(i){if(i){n(i);return}r(Jn(void 0,!0))})})},"_return")),_c),QP),KP=c(function(e){var r,n=Object.create(VP,(r={},Yn(r,_i,{value:e,writable:!0}),Yn(r,Xn,{value:null,writable:!0}),Yn(r,gi,{value:null,writable:!0}),Yn(r,Ss,{value:null,writable:!0}),Yn(r,yc,{value:e._readableState.endEmitted,writable:!0}),Yn(r,Mf,{value:c(function(o,s){var a=n[_i].read();a?(n[mi]=null,n[Xn]=null,n[gi]=null,o(Jn(a,!1))):(n[Xn]=o,n[gi]=s)},"value"),writable:!0}),r));return n[mi]=null,HP(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[gi];o!==null&&(n[mi]=null,n[Xn]=null,n[gi]=null,o(i)),n[Ss]=i;return}var s=n[Xn];s!==null&&(n[mi]=null,n[Xn]=null,n[gi]=null,s(Jn(void 0,!0))),n[yc]=!0}),e.on("readable",WP.bind(null,n)),n},"createReadableStreamAsyncIterator");yy.exports=KP});var Iy=le((O5,xy)=>{"use strict";function Ay(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i)}c(Ay,"asyncGeneratorStep");function GP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){Ay(o,n,i,s,a,"next",u)}c(s,"_next");function a(u){Ay(o,n,i,s,a,"throw",u)}c(a,"_throw"),s(void 0)})}}c(GP,"_asyncToGenerator");function by(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}c(by,"ownKeys");function ZP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?by(Object(r),!0).forEach(function(n){YP(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):by(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}c(ZP,"_objectSpread");function YP(t,e,r){return e=XP(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}c(YP,"_defineProperty");function XP(t){var e=JP(t,"string");return typeof e=="symbol"?e:String(e)}c(XP,"_toPropertyKey");function JP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}c(JP,"_toPrimitive");var eT=Gn().codes.ERR_INVALID_ARG_TYPE;function tT(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new eT("iterable",["Iterable"],e);var i=new t(ZP({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}c(s,"next");function a(){return a=GP(function*(){try{var u=yield n.next(),l=u.value,d=u.done;d?i.push(null):i.push(yield l)?s():o=!1}catch(p){i.destroy(p)}}),a.apply(this,arguments)}return c(a,"_next2"),i}c(tT,"from");xy.exports=tT});var Df=le((B5,Oy)=>{"use strict";Oy.exports=bt;var po;bt.ReadableState=Py;var D5=require("events").EventEmitter,wy=c(function(e,r){return e.listeners(r).length},"EElistenerCount"),Ps=xf(),Ec=require("buffer").Buffer,rT=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function nT(t){return Ec.from(t)}c(nT,"_uint8ArrayToBuffer");function iT(t){return Ec.isBuffer(t)||t instanceof rT}c(iT,"_isUint8Array");var Ff=require("util"),ct;Ff&&Ff.debuglog?ct=Ff.debuglog("stream"):ct=c(function(){},"debug");var oT=Q_(),Kf=Sf(),sT=wf(),aT=sT.getHighWaterMark,Ac=Gn().codes,cT=Ac.ERR_INVALID_ARG_TYPE,uT=Ac.ERR_STREAM_PUSH_AFTER_EOF,lT=Ac.ERR_METHOD_NOT_IMPLEMENTED,fT=Ac.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ho,Hf,jf;di()(bt,Ps);var ws=Kf.errorOrDestroy,Wf=["error","close","destroy","pause","resume"];function dT(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}c(dT,"prependListener");function Py(t,e,r){po=po||pi(),t=t||{},typeof r!="boolean"&&(r=e instanceof po),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=aT(this,t,"readableHighWaterMark",r),this.buffer=new oT,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ho||(ho=zf().StringDecoder),this.decoder=new ho(t.encoding),this.encoding=t.encoding)}c(Py,"ReadableState");function bt(t){if(po=po||pi(),!(this instanceof bt))return new bt(t);var e=this instanceof po;this._readableState=new Py(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Ps.call(this)}c(bt,"Readable");Object.defineProperty(bt.prototype,"destroyed",{enumerable:!1,get:c(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:c(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")});bt.prototype.destroy=Kf.destroy;bt.prototype._undestroy=Kf.undestroy;bt.prototype._destroy=function(t,e){e(t)};bt.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ec.from(t,e),e=""),n=!0),Ty(this,t,e,!1,n)};bt.prototype.unshift=function(t){return Ty(this,t,null,!0,!1)};function Ty(t,e,r,n,i){ct("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,gT(t,o);else{var s;if(i||(s=pT(o,e)),s)ws(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Ec.prototype&&(e=nT(e)),n)o.endEmitted?ws(t,new fT):qf(t,o,e,!0);else if(o.ended)ws(t,new uT);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?qf(t,o,e,!1):Vf(t,o)):qf(t,o,e,!1)}else n||(o.reading=!1,Vf(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}c(Ty,"readableAddChunk");function qf(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&bc(t)),Vf(t,e)}c(qf,"addChunk");function pT(t,e){var r;return!iT(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new cT("chunk",["string","Buffer","Uint8Array"],e)),r}c(pT,"chunkInvalid");bt.prototype.isPaused=function(){return this._readableState.flowing===!1};bt.prototype.setEncoding=function(t){ho||(ho=zf().StringDecoder);var e=new ho(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var vy=1073741824;function hT(t){return t>=vy?t=vy:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}c(hT,"computeNewHighWaterMark");function Sy(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=hT(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}c(Sy,"howMuchToRead");bt.prototype.read=function(t){ct("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ct("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Qf(this):bc(this),null;if(t=Sy(t,e),t===0&&e.ended)return e.length===0&&Qf(this),null;var n=e.needReadable;ct("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ct("length less than watermark",n)),e.ended||e.reading?(n=!1,ct("reading or ended",n)):n&&(ct("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Sy(r,e)));var i;return t>0?i=Ry(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Qf(this)),i!==null&&this.emit("data",i),i};function gT(t,e){if(ct("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?bc(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Cy(t)))}}c(gT,"onEofChunk");function bc(t){var e=t._readableState;ct("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ct("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Cy,t))}c(bc,"emitReadable");function Cy(t){var e=t._readableState;ct("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Gf(t)}c(Cy,"emitReadable_");function Vf(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(mT,t,e))}c(Vf,"maybeReadMore");function mT(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ct("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}c(mT,"maybeReadMore_");bt.prototype._read=function(t){ws(this,new lT("_read()"))};bt.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ct("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:b;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(E,v){ct("onunpipe"),E===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,d())}c(s,"onunpipe");function a(){ct("onend"),t.end()}c(a,"onend");var u=_T(r);t.on("drain",u);var l=!1;function d(){ct("cleanup"),t.removeListener("close",h),t.removeListener("finish",_),t.removeListener("drain",u),t.removeListener("error",g),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",b),r.removeListener("data",p),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}c(d,"cleanup"),r.on("data",p);function p(E){ct("ondata");var v=t.write(E);ct("dest.write",v),v===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&Ny(n.pipes,t)!==-1)&&!l&&(ct("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}c(p,"ondata");function g(E){ct("onerror",E),b(),t.removeListener("error",g),wy(t,"error")===0&&ws(t,E)}c(g,"onerror"),dT(t,"error",g);function h(){t.removeListener("finish",_),b()}c(h,"onclose"),t.once("close",h);function _(){ct("onfinish"),t.removeListener("close",h),b()}c(_,"onfinish"),t.once("finish",_);function b(){ct("unpipe"),r.unpipe(t)}return c(b,"unpipe"),t.emit("pipe",r),n.flowing||(ct("pipe resume"),r.resume()),t};function _T(t){return c(function(){var r=t._readableState;ct("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&wy(t,"data")&&(r.flowing=!0,Gf(t))},"pipeOnDrainFunctionResult")}c(_T,"pipeOnDrain");bt.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Ny(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};bt.prototype.on=function(t,e){var r=Ps.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ct("on readable",n.length,n.reading),n.length?bc(this):n.reading||process.nextTick(yT,this)),r};bt.prototype.addListener=bt.prototype.on;bt.prototype.removeListener=function(t,e){var r=Ps.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(ky,this),r};bt.prototype.removeAllListeners=function(t){var e=Ps.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(ky,this),e};function ky(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}c(ky,"updateReadableListening");function yT(t){ct("readable nexttick read 0"),t.read(0)}c(yT,"nReadingNextTick");bt.prototype.resume=function(){var t=this._readableState;return t.flowing||(ct("resume"),t.flowing=!t.readableListening,ET(this,t)),t.paused=!1,this};function ET(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(AT,t,e))}c(ET,"resume");function AT(t,e){ct("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Gf(t),e.flowing&&!e.reading&&t.read(0)}c(AT,"resume_");bt.prototype.pause=function(){return ct("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ct("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Gf(t){var e=t._readableState;for(ct("flow",e.flowing);e.flowing&&t.read()!==null;);}c(Gf,"flow");bt.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ct("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ct("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=c(function(a){return c(function(){return t[a].apply(t,arguments)},"methodWrapReturnFunction")},"methodWrap")(i));for(var o=0;o<Wf.length;o++)t.on(Wf[o],this.emit.bind(this,Wf[o]));return this._read=function(s){ct("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(bt.prototype[Symbol.asyncIterator]=function(){return Hf===void 0&&(Hf=Ey()),Hf(this)});Object.defineProperty(bt.prototype,"readableHighWaterMark",{enumerable:!1,get:c(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(bt.prototype,"readableBuffer",{enumerable:!1,get:c(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(bt.prototype,"readableFlowing",{enumerable:!1,get:c(function(){return this._readableState.flowing},"get"),set:c(function(e){this._readableState&&(this._readableState.flowing=e)},"set")});bt._fromList=Ry;Object.defineProperty(bt.prototype,"readableLength",{enumerable:!1,get:c(function(){return this._readableState.length},"get")});function Ry(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}c(Ry,"fromList");function Qf(t){var e=t._readableState;ct("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(bT,e,t))}c(Qf,"endReadable");function bT(t,e){if(ct("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}c(bT,"endReadableNT");typeof Symbol=="function"&&(bt.from=function(t,e){return jf===void 0&&(jf=Iy()),jf(bt,t,e)});function Ny(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}c(Ny,"indexOf")});var Zf=le((L5,Dy)=>{"use strict";Dy.exports=Sn;var xc=Gn().codes,xT=xc.ERR_METHOD_NOT_IMPLEMENTED,IT=xc.ERR_MULTIPLE_CALLBACK,vT=xc.ERR_TRANSFORM_ALREADY_TRANSFORMING,ST=xc.ERR_TRANSFORM_WITH_LENGTH_0,Ic=pi();di()(Sn,Ic);function wT(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new IT);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}c(wT,"afterTransform");function Sn(t){if(!(this instanceof Sn))return new Sn(t);Ic.call(this,t),this._transformState={afterTransform:wT.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",PT)}c(Sn,"Transform");function PT(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){$y(t,e,r)}):$y(this,null,null)}c(PT,"prefinish");Sn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Ic.prototype.push.call(this,t,e)};Sn.prototype._transform=function(t,e,r){r(new xT("_transform()"))};Sn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Sn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Sn.prototype._destroy=function(t,e){Ic.prototype._destroy.call(this,t,function(r){e(r)})};function $y(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new ST;if(t._transformState.transforming)throw new vT;return t.push(null)}c($y,"done")});var Ly=le((M5,Uy)=>{"use strict";Uy.exports=Ts;var By=Zf();di()(Ts,By);function Ts(t){if(!(this instanceof Ts))return new Ts(t);By.call(this,t)}c(Ts,"PassThrough");Ts.prototype._transform=function(t,e,r){r(null,t)}});var jy=le((H5,Hy)=>{"use strict";var Yf;function TT(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}c(TT,"once");var Fy=Gn().codes,CT=Fy.ERR_MISSING_ARGS,kT=Fy.ERR_STREAM_DESTROYED;function zy(t){if(t)throw t}c(zy,"noop");function RT(t){return t.setHeader&&typeof t.abort=="function"}c(RT,"isRequest");function NT(t,e,r,n){n=TT(n);var i=!1;t.on("close",function(){i=!0}),Yf===void 0&&(Yf=mc()),Yf(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,RT(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new kT("pipe"))}}}c(NT,"destroyer");function My(t){t()}c(My,"call");function OT(t,e){return t.pipe(e)}c(OT,"pipe");function $T(t){return!t.length||typeof t[t.length-1]!="function"?zy:t.pop()}c($T,"popCallback");function DT(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=$T(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new CT("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,l=a>0;return NT(s,u,l,function(d){i||(i=d),d&&o.forEach(My),!u&&(o.forEach(My),n(i))})});return e.reduce(OT)}c(DT,"pipeline");Hy.exports=DT});var Wy=le((Wr,ks)=>{var Cs=require("stream");process.env.READABLE_STREAM==="disable"&&Cs?(ks.exports=Cs.Readable,Object.assign(ks.exports,Cs),ks.exports.Stream=Cs):(Wr=ks.exports=Df(),Wr.Stream=Cs||Wr,Wr.Readable=Wr,Wr.Writable=Nf(),Wr.Duplex=pi(),Wr.Transform=Zf(),Wr.PassThrough=Ly(),Wr.finished=mc(),Wr.pipeline=jy())});var Qy=le((W5,qy)=>{var BT=Object.prototype.toString,Xf=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function UT(t){return BT.call(t).slice(8,-1)==="ArrayBuffer"}c(UT,"isArrayBuffer");function LT(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 Xf?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}c(LT,"fromArrayBuffer");function zT(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Xf?Buffer.from(t,e):new Buffer(t,e)}c(zT,"fromString");function MT(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return UT(t)?LT(t,e,r):typeof t=="string"?zT(t,e):Xf?Buffer.from(t):new Buffer(t)}c(MT,"bufferFrom");qy.exports=MT});var Xy=le(ze=>{var Vy=void 0,FT=1e5,$t=(function(){var t=Object.prototype.toString,e=Object.prototype.hasOwnProperty;return{Class:c(function(r){return t.call(r).replace(/^\[object *|\]$/g,"")},"Class"),HasProperty:c(function(r,n){return n in r},"HasProperty"),HasOwnProperty:c(function(r,n){return e.call(r,n)},"HasOwnProperty"),IsCallable:c(function(r){return typeof r=="function"},"IsCallable"),ToInt32:c(function(r){return r>>0},"ToInt32"),ToUint32:c(function(r){return r>>>0},"ToUint32")}})(),HT=Math.LN2,jT=Math.abs,vc=Math.floor,WT=Math.log,qT=Math.min,Yr=Math.pow,QT=Math.round;function Jf(t){if(Ky&&go){var e=Ky(t),r;for(r=0;r<e.length;r+=1)go(t,e[r],{value:t[e[r]],writable:!1,enumerable:!1,configurable:!1})}}c(Jf,"configureProperties");var go;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?go=Object.defineProperty:go=c(function(t,e,r){if(!t===Object(t))throw new TypeError("Object.defineProperty called on non-object");return $t.HasProperty(r,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(t,e,r.get),$t.HasProperty(r,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(t,e,r.set),$t.HasProperty(r,"value")&&(t[e]=r.value),t},"defineProp");var Ky=Object.getOwnPropertyNames||function(t){if(t!==Object(t))throw new TypeError("Object.getOwnPropertyNames called on non-object");var e=[],r;for(r in t)$t.HasOwnProperty(t,r)&&e.push(r);return e};function VT(t){if(!go)return;if(t.length>FT)throw new RangeError("Array too large for polyfill");function e(n){go(t,n,{get:c(function(){return t._getter(n)},"get"),set:c(function(i){t._setter(n,i)},"set"),enumerable:!0,configurable:!1})}c(e,"makeArrayAccessor");var r;for(r=0;r<t.length;r+=1)e(r)}c(VT,"makeArrayAccessors");function ed(t,e){var r=32-e;return t<<r>>r}c(ed,"as_signed");function td(t,e){var r=32-e;return t<<r>>>r}c(td,"as_unsigned");function KT(t){return[t&255]}c(KT,"packI8");function GT(t){return ed(t[0],8)}c(GT,"unpackI8");function ZT(t){return[t&255]}c(ZT,"packU8");function Gy(t){return td(t[0],8)}c(Gy,"unpackU8");function YT(t){return t=QT(Number(t)),[t<0?0:t>255?255:t&255]}c(YT,"packU8Clamped");function XT(t){return[t>>8&255,t&255]}c(XT,"packI16");function JT(t){return ed(t[0]<<8|t[1],16)}c(JT,"unpackI16");function e1(t){return[t>>8&255,t&255]}c(e1,"packU16");function t1(t){return td(t[0]<<8|t[1],16)}c(t1,"unpackU16");function r1(t){return[t>>24&255,t>>16&255,t>>8&255,t&255]}c(r1,"packI32");function n1(t){return ed(t[0]<<24|t[1]<<16|t[2]<<8|t[3],32)}c(n1,"unpackI32");function i1(t){return[t>>24&255,t>>16&255,t>>8&255,t&255]}c(i1,"packU32");function o1(t){return td(t[0]<<24|t[1]<<16|t[2]<<8|t[3],32)}c(o1,"unpackU32");function Zy(t,e,r){var n=(1<<e-1)-1,i,o,s,a,u,l,d,p;function g(h){var _=vc(h),b=h-_;return b<.5?_:b>.5||_%2?_+1:_}for(c(g,"roundToEven"),t!==t?(o=(1<<e)-1,s=Yr(2,r-1),i=0):t===1/0||t===-1/0?(o=(1<<e)-1,s=0,i=t<0?1:0):t===0?(o=0,s=0,i=1/t===-1/0?1:0):(i=t<0,t=jT(t),t>=Yr(2,1-n)?(o=qT(vc(WT(t)/HT),1023),s=g(t/Yr(2,o)*Yr(2,r)),s/Yr(2,r)>=2&&(o=o+1,s=1),o>n?(o=(1<<e)-1,s=0):(o=o+n,s=s-Yr(2,r))):(o=0,s=g(t/Yr(2,1-n-r)))),l=[],u=r;u;u-=1)l.push(s%2?1:0),s=vc(s/2);for(u=e;u;u-=1)l.push(o%2?1:0),o=vc(o/2);for(l.push(i?1:0),l.reverse(),d=l.join(""),p=[];d.length;)p.push(parseInt(d.substring(0,8),2)),d=d.substring(8);return p}c(Zy,"packIEEE754");function Yy(t,e,r){var n=[],i,o,s,a,u,l,d,p;for(i=t.length;i;i-=1)for(s=t[i-1],o=8;o;o-=1)n.push(s%2?1:0),s=s>>1;return n.reverse(),a=n.join(""),u=(1<<e-1)-1,l=parseInt(a.substring(0,1),2)?-1:1,d=parseInt(a.substring(1,1+e),2),p=parseInt(a.substring(1+e),2),d===(1<<e)-1?p!==0?NaN:l*(1/0):d>0?l*Yr(2,d-u)*(1+p/Yr(2,r)):p!==0?l*Yr(2,-(u-1))*(p/Yr(2,r)):l<0?-0:0}c(Yy,"unpackIEEE754");function s1(t){return Yy(t,11,52)}c(s1,"unpackF64");function a1(t){return Zy(t,11,52)}c(a1,"packF64");function c1(t){return Yy(t,8,23)}c(c1,"unpackF32");function u1(t){return Zy(t,8,23)}c(u1,"packF32");(function(){var t=c(function(h){if(h=$t.ToInt32(h),h<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=h,this._bytes=[],this._bytes.length=h;var _;for(_=0;_<this.byteLength;_+=1)this._bytes[_]=0;Jf(this)},"ArrayBuffer");ze.ArrayBuffer=ze.ArrayBuffer||t;var e=c(function(){},"ArrayBufferView");function r(g,h,_){var b;return b=c(function(E,v,w){var H,D,J,Y;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=$t.ToInt32(arguments[0]),w<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new t(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===b)for(H=arguments[0],this.length=H.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new t(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)this._setter(J,H._getter(J));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof t||$t.Class(arguments[0])==="ArrayBuffer"))for(D=arguments[0],this.length=$t.ToUint32(D.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new t(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)Y=D[J],this._setter(J,Number(Y));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof t||$t.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=E,this.byteOffset=$t.ToUint32(v),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=$t.ToUint32(w),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=b,Jf(this),VT(this)},"ctor"),b.prototype=new e,b.prototype.BYTES_PER_ELEMENT=g,b.prototype._pack=h,b.prototype._unpack=_,b.BYTES_PER_ELEMENT=g,b.prototype._getter=function(E){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(E=$t.ToUint32(E),E>=this.length)return Vy;var v=[],w,H;for(w=0,H=this.byteOffset+E*this.BYTES_PER_ELEMENT;w<this.BYTES_PER_ELEMENT;w+=1,H+=1)v.push(this.buffer._bytes[H]);return this._unpack(v)},b.prototype.get=b.prototype._getter,b.prototype._setter=function(E,v){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(E=$t.ToUint32(E),E>=this.length)return Vy;var w=this._pack(v),H,D;for(H=0,D=this.byteOffset+E*this.BYTES_PER_ELEMENT;H<this.BYTES_PER_ELEMENT;H+=1,D+=1)this.buffer._bytes[D]=w[H]},b.prototype.set=function(E,v){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var w,H,D,J,Y,X,P,C,M,L;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(w=arguments[0],D=$t.ToUint32(arguments[1]),D+w.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(C=this.byteOffset+D*this.BYTES_PER_ELEMENT,M=w.length*this.BYTES_PER_ELEMENT,w.buffer===this.buffer){for(L=[],Y=0,X=w.byteOffset;Y<M;Y+=1,X+=1)L[Y]=w.buffer._bytes[X];for(Y=0,P=C;Y<M;Y+=1,P+=1)this.buffer._bytes[P]=L[Y]}else for(Y=0,X=w.byteOffset,P=C;Y<M;Y+=1,X+=1,P+=1)this.buffer._bytes[P]=w.buffer._bytes[X]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(H=arguments[0],J=$t.ToUint32(H.length),D=$t.ToUint32(arguments[1]),D+J>this.length)throw new RangeError("Offset plus length of array is out of range");for(Y=0;Y<J;Y+=1)X=H[Y],this._setter(D+Y,Number(X))}else throw new TypeError("Unexpected argument type(s)")},b.prototype.subarray=function(E,v){function w(D,J,Y){return D<J?J:D>Y?Y:D}c(w,"clamp"),E=$t.ToInt32(E),v=$t.ToInt32(v),arguments.length<1&&(E=0),arguments.length<2&&(v=this.length),E<0&&(E=this.length+E),v<0&&(v=this.length+v),E=w(E,0,this.length),v=w(v,0,this.length);var H=v-E;return H<0&&(H=0),new this.constructor(this.buffer,this.byteOffset+E*this.BYTES_PER_ELEMENT,H)},b}c(r,"makeConstructor");var n=r(1,KT,GT),i=r(1,ZT,Gy),o=r(1,YT,Gy),s=r(2,XT,JT),a=r(2,e1,t1),u=r(4,r1,n1),l=r(4,i1,o1),d=r(4,u1,c1),p=r(8,a1,s1);ze.Int8Array=ze.Int8Array||n,ze.Uint8Array=ze.Uint8Array||i,ze.Uint8ClampedArray=ze.Uint8ClampedArray||o,ze.Int16Array=ze.Int16Array||s,ze.Uint16Array=ze.Uint16Array||a,ze.Int32Array=ze.Int32Array||u,ze.Uint32Array=ze.Uint32Array||l,ze.Float32Array=ze.Float32Array||d,ze.Float64Array=ze.Float64Array||p})();(function(){function t(o,s){return $t.IsCallable(o.get)?o.get(s):o[s]}c(t,"r");var e=(function(){var o=new ze.Uint16Array([4660]),s=new ze.Uint8Array(o.buffer);return t(s,0)===18})(),r=c(function(s,a,u){if(arguments.length===0)s=new ze.ArrayBuffer(0);else if(!(s instanceof ze.ArrayBuffer||$t.Class(s)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=s||new ze.ArrayBuffer(0),this.byteOffset=$t.ToUint32(a),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=$t.ToUint32(u),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");Jf(this)},"DataView");function n(o){return function(s,a){if(s=$t.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");s+=this.byteOffset;var u=new ze.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),l=[],d;for(d=0;d<o.BYTES_PER_ELEMENT;d+=1)l.push(t(u,d));return!!a==!!e&&l.reverse(),t(new o(new ze.Uint8Array(l).buffer),0)}}c(n,"makeGetter"),r.prototype.getUint8=n(ze.Uint8Array),r.prototype.getInt8=n(ze.Int8Array),r.prototype.getUint16=n(ze.Uint16Array),r.prototype.getInt16=n(ze.Int16Array),r.prototype.getUint32=n(ze.Uint32Array),r.prototype.getInt32=n(ze.Int32Array),r.prototype.getFloat32=n(ze.Float32Array),r.prototype.getFloat64=n(ze.Float64Array);function i(o){return function(s,a,u){if(s=$t.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var l=new o([a]),d=new ze.Uint8Array(l.buffer),p=[],g,h;for(g=0;g<o.BYTES_PER_ELEMENT;g+=1)p.push(t(d,g));!!u==!!e&&p.reverse(),h=new ze.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),h.set(p)}}c(i,"makeSetter"),r.prototype.setUint8=i(ze.Uint8Array),r.prototype.setInt8=i(ze.Int8Array),r.prototype.setUint16=i(ze.Uint16Array),r.prototype.setInt16=i(ze.Int16Array),r.prototype.setUint32=i(ze.Uint32Array),r.prototype.setInt32=i(ze.Int32Array),r.prototype.setFloat32=i(ze.Float32Array),r.prototype.setFloat64=i(ze.Float64Array),ze.DataView=ze.DataView||r})()});var rE=le((K5,tE)=>{var Jy=Wy().Writable,l1=di(),Rs=Qy();typeof Uint8Array>"u"?Sc=Xy().Uint8Array:Sc=Uint8Array;var Sc;function yi(t,e){if(!(this instanceof yi))return new yi(t,e);typeof t=="function"&&(e=t,t={}),t||(t={});var r=t.encoding,n=!1;r?(r=String(r).toLowerCase(),(r==="u8"||r==="uint8")&&(r="uint8array")):n=!0,Jy.call(this,{objectMode:!0}),this.encoding=r,this.shouldInferEncoding=n,e&&this.on("finish",function(){e(this.getBody())}),this.body=[]}c(yi,"ConcatStream");tE.exports=yi;l1(yi,Jy);yi.prototype._write=function(t,e,r){this.body.push(t),r()};yi.prototype.inferEncoding=function(t){var e=t===void 0?this.body[0]:t;return Buffer.isBuffer(e)?"buffer":typeof Uint8Array<"u"&&e instanceof Uint8Array?"uint8array":Array.isArray(e)?"array":typeof e=="string"?"string":Object.prototype.toString.call(e)==="[object Object]"?"object":"buffer"};yi.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?h1(this.body):this.encoding==="string"?d1(this.body):this.encoding==="buffer"?p1(this.body):this.encoding==="uint8array"?g1(this.body):this.body)};function f1(t){return/Array\]$/.test(Object.prototype.toString.call(t))}c(f1,"isArrayish");function eE(t){return typeof t=="string"||f1(t)||t&&typeof t.subarray=="function"}c(eE,"isBufferish");function d1(t){for(var e=[],r=!1,n=0;n<t.length;n++){var i=t[n];typeof i=="string"||Buffer.isBuffer(i)?e.push(i):eE(i)?e.push(Rs(i)):e.push(Rs(String(i)))}return Buffer.isBuffer(t[0])?(e=Buffer.concat(e),e=e.toString("utf8")):e=e.join(""),e}c(d1,"stringConcat");function p1(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];Buffer.isBuffer(n)?e.push(n):eE(n)?e.push(Rs(n)):e.push(Rs(String(n)))}return Buffer.concat(e)}c(p1,"bufferConcat");function h1(t){for(var e=[],r=0;r<t.length;r++)e.push.apply(e,t[r]);return e}c(h1,"arrayConcat");function g1(t){for(var e=0,r=0;r<t.length;r++)typeof t[r]=="string"&&(t[r]=Rs(t[r])),e+=t[r].length;for(var n=new Sc(e),r=0,i=0;r<t.length;r++)for(var o=t[r],s=0;s<o.length;s++)n[i++]=o[s];return n}c(g1,"u8Concat")});var oE=le((Z5,iE)=>{"use strict";function nE(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}c(nE,"assign");function m1(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=void 0),e!=null&&(r.code=e);try{return nE(t,r)}catch{r.message=t.message,r.stack=t.stack;let i=c(function(){},"ErrClass");return i.prototype=Object.create(Object.getPrototypeOf(t)),nE(new i,r)}}c(m1,"createError");iE.exports=m1});var aE=le((X5,sE)=>{function qr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}c(qr,"RetryOperation");sE.exports=qr;qr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};qr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};qr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};qr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};qr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};qr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};qr.prototype.start=qr.prototype.try;qr.prototype.errors=function(){return this._errors};qr.prototype.attempts=function(){return this._attempts};qr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var cE=le(Ei=>{var _1=aE();Ei.operation=function(t){var e=Ei.timeouts(t);return new _1(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Ei.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};Ei.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Ei.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=c(function(u){var l=Ei.operation(e),d=Array.prototype.slice.call(arguments,1),p=d.pop();d.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),p.apply(this,arguments))}),l.attempt(function(){u.apply(t,d)})},"retryWrapper").bind(t,s),t[o].options=e}}});var lE=le((r8,uE)=>{uE.exports=cE()});var pE=le((n8,dE)=>{"use strict";var y1=oE(),E1=lE(),A1=Object.prototype.hasOwnProperty;function fE(t){return t&&t.code==="EPROMISERETRY"&&A1.call(t,"retried")}c(fE,"isRetryError");function b1(t,e){var r,n;return typeof t=="object"&&typeof e=="function"&&(r=e,e=t,t=r),n=E1.operation(e),new Promise(function(i,o){n.attempt(function(s){Promise.resolve().then(function(){return t(function(a){throw fE(a)&&(a=a.retried),y1(new Error("Retrying"),"EPROMISERETRY",{retried:a})},s)}).then(i,function(a){fE(a)&&(a=a.retried,n.retry(a||new Error))||o(a)})})})}c(b1,"promiseRetry");dE.exports=b1});var rd=le((o8,hE)=>{var x1={generic:"ERR_GENERIC_CLIENT",connect:"ERR_NOT_CONNECTED",badPath:"ERR_BAD_PATH",permission:"EACCES",notexist:"ENOENT",notdir:"ENOTDIR",badAuth:"ERR_BAD_AUTH"},I1={writeFile:1,readFile:2,writeDir:3,readDir:4,readObj:5,writeObj:6};hE.exports={errorCode:x1,targetType:I1}});var AE=le((s8,EE)=>{var Ns=require("fs"),v1=require("path"),{errorCode:gE}=rd();function mE(t,e,r){return c(i=>{if(t.endCalled||t.errorHandled){t.debugMsg(`${e} errorListener - ignoring handled error`);return}t.errorHandled=!0;let o=new Error(`${e}: ${i.message}`);if(o.code=i.code,r)r(o);else throw o},"fn")}c(mE,"errorListener");function S1(t,e){return()=>{t.endCalled||t.errorHandled||t.closeHandled?t.debugMsg(`Global ${e} event: Ignoring expected and handled event`):(t.debugMsg(`Global ${e} event: Handling unexpected event`),t.sftp=void 0)}}c(S1,"globalListener");function _E(t,e,r){return c(function(){if(t.sftp=void 0,t.endCalled||t.endHandled||t.errorHandled){t.debugMsg(`${e} endListener - ignoring handled error`);return}t.endHandled=!0,t.debugMsg(`${e} Unexpected end event - ignoring`)},"fn")}c(_E,"endListener");function yE(t,e,r){return c(function(){if(t.sftp=void 0,t.endCalled||t.closeHandled||t.errorHandled||t.endHandled){t.debugMsg(`${e} closeListener - ignoring handled error`);return}t.closeHandled=!0,t.debugMsg(`${e} Unexpected close event raised - ignoring`)},"fn")}c(yE,"closeListener");function w1(t,e,r){let n={end:_E(t,e,r),close:yE(t,e,r),error:mE(t,e,r)};return t.on("end",n.end),t.on("close",n.close),t.on("error",n.error),t._resetEventFlags(),n}c(w1,"addTempListeners");function P1(t,e,r){try{t.removeListener("end",e.end),t.removeListener("close",e.close),t.removeListener("error",e.error)}catch(n){throw new Error(`${r}: Error removing temp listeners: ${n.message}`)}}c(P1,"removeTempListeners");function nd(t){let e=Ns.statSync(t,{throwIfNoEntry:!1});if(e){if(e.isDirectory())return"d";if(e.isFile())return"-";{let r=new Error(`Bad path: ${t}: target must be a file or directory`);throw r.code=gE.badPath,r}}else return!1}c(nd,"localExists");function id(t,e="r"){let r=Ns.constants.F_OK|e==="w"?Ns.constants.W_OK:Ns.constants.R_OK;try{return Ns.accessSync(t,r),{status:!0,type:nd(t),details:"access OK",code:0}}catch(n){switch(n.errno){case-2:return{status:!1,type:null,details:"not exist",code:-2};case-13:return{status:!1,type:nd(t),details:"permission denied",code:-13};case-20:return{status:!1,type:null,details:"parent not a directory"};default:return{status:!1,type:null,details:n.message}}}}c(id,"haveLocalAccess");function T1(t){let{status:e,details:r,type:n}=id(t,"w");if(!e&&r==="permission denied")return{status:e,details:r,type:n};if(!e){let i=v1.dirname(t),o=id(i,"w");return o.status&&o.type!=="d"?{status:!1,details:`${i}: not a directory`,type:null}:o.status?{status:!0,details:"access OK",type:null,code:0}:{status:o.status,details:`${i}: ${o.details}`,type:null}}return{status:e,details:r,type:n}}c(T1,"haveLocalCreate");async function C1(t,e){try{return e.startsWith("..")?`${await t.realPath("..")}/${e.slice(3)}`:e.startsWith(".")?`${await t.realPath(".")}/${e.slice(2)}`:e}catch(r){throw new Error(`normalizeRemotePath: ${r.message}`)}}c(C1,"normalizeRemotePath");function k1(t,e,r){if(!t.sftp){let n=new Error(`${e}: No SFTP connection available`);if(n.code=gE.connect,r)return r(n),!1;throw n}return!0}c(k1,"haveConnection");function R1(t){return new Promise((e,r)=>{try{isNaN(t)||t<0?r("Argument must be anumber >= 0"):setTimeout(()=>{e(!0)},t)}catch(n){r(n)}})}c(R1,"sleep");EE.exports={globalListener:S1,errorListener:mE,endListener:_E,closeListener:yE,addTempListeners:w1,removeTempListeners:P1,haveLocalAccess:id,haveLocalCreate:T1,normalizeRemotePath:C1,localExists:nd,haveConnection:k1,sleep:R1}});var vE=le((c8,IE)=>{"use strict";var{Client:N1}=z_(),wc=require("fs"),O1=rE(),$1=pE(),{join:Os,parse:D1}=require("path"),{globalListener:od,addTempListeners:Mt,removeTempListeners:Ft,haveConnection:dr,normalizeRemotePath:$s,localExists:bE,haveLocalAccess:xE,haveLocalCreate:sd}=AE(),{errorCode:Dt}=rd(),ad=class{static{c(this,"SftpClient")}constructor(e){this.version="9.0.4",this.client=new N1,this.sftp=void 0,this.clientName=e||"sftp",this.endCalled=!1,this.errorHandled=!1,this.closeHandled=!1,this.endHandled=!1,this.remotePlatform="unix",this.debug=void 0,this.client.on("close",od(this,"close")),this.client.on("end",od(this,"end")),this.client.on("error",od(this,"error"))}debugMsg(e,r){this.debug&&(r?this.debug(`CLIENT[${this.clientName}]: ${e} ${JSON.stringify(r,null," ")}`):this.debug(`CLIENT[${this.clientName}]: ${e}`))}fmtError(e,r="sftp",n,i){let o="",s="",a=i?` after ${i} ${i>1?"attempts":"attempt"}`:"";if(e===void 0)o=`${r}: Undefined error - probably a bug!`,s=Dt.generic;else if(typeof e=="string")o=`${r}: ${e}${a}`,s=n||Dt.generic;else if(e.custom)o=`${r}->${e.message}${a}`,s=e.code;else{switch(e.code){case"ENOTFOUND":o=`${r}: Address lookup failed for host${a}`;break;case"ECONNREFUSED":o=`${r}: Remote host refused connection${a}`;break;case"ECONNRESET":o=`${r}: Remote host has reset the connection: ${e.message}${a}`;break;default:o=`${r}: ${e.message}${a}`}s=e.code?e.code:Dt.generic}let u=new Error(o);return u.code=s,u.custom=!0,this.debugMsg(`${u.message} (${u.code})`),u}on(e,r){this.client.prependListener(e,r)}removeListener(e,r){this.client.removeListener(e,r)}_resetEventFlags(){this.closeHandled=!1,this.endHandled=!1,this.errorHandled=!1}getConnection(e){let r,n;return new Promise((i,o)=>{n=Mt(this,"getConnection",o),r=c(()=>{this.debugMsg("getConnection ready listener: got connection - promise resolved"),i(!0)},"doReady"),this.on("ready",r);try{this.client.connect(e)}catch(s){this.debugMsg(`getConnection: ${s.message}`),o(s)}}).finally(()=>{this.removeListener("ready",r),Ft(this,n,"getConnection")})}getSftpChannel(){return new Promise((e,r)=>{this.client.sftp((n,i)=>{n?r(this.fmtError(n,"getSftpChannel",n.code)):(this.sftp=i,e(i))})})}async connect(e){let r;try{if(r=Mt(this,"connect"),e.debug&&(this.debug=e.debug,this.debugMsg("connect: Debugging turned on"),this.debugMsg(`ssh2-sftp-client Version: ${this.version} `,process.versions)),this.sftp)throw this.fmtError("An existing SFTP connection is already defined","connect",Dt.connect);let n={retries:e.retries??1,factor:e.factor??2,minTimeout:e.retry_minTimeout??25e3};return await $1(n,async(o,s)=>{try{this.debugMsg(`connect: Connect attempt ${s}`),await this.getConnection(e)}catch(a){switch(a.code){case"ENOTFOUND":case"ECONNREFUSED":case"ERR_SOCKET_BAD_PORT":throw a;case void 0:{if(a.message.endsWith("All configured authentication methods failed")||a.message.startsWith("Cannot parse privateKey"))throw a;o(a);break}default:o(a)}}}),await this.getSftpChannel()}catch(n){throw this.end(),n.custom?n:this.fmtError(n,"connect")}finally{Ft(this,r,"connect")}}realPath(e,r=!0){let n;return new Promise((i,o)=>{r&&(n=Mt(this,"realPath",o)),this.debugMsg(`realPath -> ${e}`),this.sftp.realpath(e,(s,a)=>{s&&(s.code===2?(this.debugMsg('realPath <- ""'),i("")):(this.debugMsg(`${s.message} ${e}`,"realPath"),o(this.fmtError(`${s.message} ${e}`,"realPath",s.code)))),this.debugMsg(`realPath <- ${a}`),i(a)})}).finally(()=>{r&&Ft(this,n,"realPath")})}cwd(){return this.realPath(".")}_xstat(e,r,n=!0){let i;return new Promise((o,s)=>{let a=c((u,l)=>{if(u)u.code===2||u.code===4?s(this.fmtError(`No such file: ${r}`,"_xstat",Dt.notexist)):s(this.fmtError(`${u.message} ${r}`,"_xstat",u.code));else{let d={mode:l.mode,uid:l.uid,gid:l.gid,size:l.size,accessTime:l.atime*1e3,modifyTime:l.mtime*1e3,isDirectory:l.isDirectory(),isFile:l.isFile(),isBlockDevice:l.isBlockDevice(),isCharacterDevice:l.isCharacterDevice(),isSymbolicLink:l.isSymbolicLink(),isFIFO:l.isFIFO(),isSocket:l.isSocket()};this.debugMsg("_xstat: result = ",d),o(d)}},"cb");n&&(i=Mt(this,"_xstat",s)),e==="stat"?this.sftp.stat(r,a):this.sftp.lstat(r,a)}).finally(()=>{n&&Ft(this,i,"_xstat")})}async stat(e){try{return dr(this,"stat"),await this._xstat("stat",e)}catch(r){throw r.custom?r:this.fmtError(r,"stat",r.code)}}async lstat(e){try{return dr(this,"lstat"),await this._xstat("lstat",e)}catch(r){throw r.custom?r:this.fmtError(r,"lstat",r.code)}}async exists(e){this.debugMsg(`exists: remotePath = ${e}`);try{if(e===".")return"d";let r=await this.lstat(e);return this.debugMsg("exists: <- ",r),r.isDirectory?"d":r.isSymbolicLink?"l":r.isFile?"-":!1}catch(r){if(r.code===Dt.notexist)return!1;throw r.custom?r:this.fmtError(r.message,"exists",r.code)}}list(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"list",s)),dr(this,"list",s)&&this.sftp.readdir(e,(a,u)=>{if(a)s(this.fmtError(`${a.message} ${e}`,"list",a.code));else{let l=/-/gi,d=u.map(p=>({type:p.longname.slice(0,1),name:p.filename,size:p.attrs.size,modifyTime:p.attrs.mtime*1e3,accessTime:p.attrs.atime*1e3,rights:{user:p.longname.slice(1,4).replace(l,""),group:p.longname.slice(4,7).replace(l,""),other:p.longname.slice(7,10).replace(l,"")},owner:p.attrs.uid,group:p.attrs.gid,longname:p.longname}));o(r?d.filter(p=>r(p)):d)}})}).finally(()=>{n&&Ft(this,i,"list")})}get(e,r,n,i=!0){let o,s,a;return new Promise((u,l)=>{if(i&&(o=Mt(this,"get",l)),dr(this,"get",l)){if(n={readStreamOptions:{...n?.readStreamOptions,autoClose:!0},writeStreamOptions:{...n?.writeStreamOptions,autoClose:!0},pipeOptions:{...n?.pipeOptions,end:!0}},s=this.sftp.createReadStream(e,n.readStreamOptions),s.once("error",d=>{r&&typeof r!="string"&&!r.destroyed&&r.destroy(),l(this.fmtError(`${d.message} ${e}`,"get",d.code))}),r===void 0)this.debugMsg("get resolving buffer of data"),a=O1(d=>{u(d)});else if(typeof r=="string"){this.debugMsg("get returning local file");let d=sd(r);if(d.status)a=wc.createWriteStream(r,n.writeStreamOptions);else{l(this.fmtError(`Bad path: ${r}: ${d.details}`,"get",d.code));return}}else this.debugMsg("get: returning data into supplied stream"),a=r;a.once("error",d=>{l(this.fmtError(`${d.message} ${typeof r=="string"?r:"<stream>"}`,"get",d.code))}),s.once("end",()=>{typeof r=="string"?(this.debugMsg("get: resolving with dst filename"),u(r)):r!==void 0&&(this.debugMsg("get: resolving with writer stream object"),u(a))}),s.pipe(a,n.pipeOptions)}}).finally(()=>{i&&Ft(this,o,"get")})}_fastGet(e,r,n,i=!0){let o;return new Promise((s,a)=>{i&&(o=Mt(this,"_fastGet",a)),dr(this,"_fastGet",a)&&this.sftp.fastGet(e,r,n,u=>{u&&a(this.fmtError(`${u.message} Remote: ${e} Local: ${r}`)),s(`${e} was successfully download to ${r}!`)})}).finally(()=>{i&&Ft(this,o,"_fastGet")})}async fastGet(e,r,n){try{let i=await this.exists(e);if(i!=="-"){let s=`${i?"Not a regular file":"No such file "} ${e}`;throw this.fmtError(s,"fastGet",Dt.badPath)}let o=sd(r);if(!o.status)throw this.fmtError(`Bad path: ${r}: ${o.details}`,"fastGet",Dt.badPath);return await this._fastGet(e,r,n)}catch(i){throw this.fmtError(i,"fastGet")}}_fastPut(e,r,n,i=!0){let o;return new Promise((s,a)=>{i&&(o=Mt(this,"_fastPut",a)),dr(this,"_fastPut",a)&&this.sftp.fastPut(e,r,n,u=>{u&&a(this.fmtError(`${u.message} Local: ${e} Remote: ${r}`,"fastPut",u.code)),s(`${e} was successfully uploaded to ${r}!`)})}).finally(()=>{i&&Ft(this,o,"_fastPut")})}async fastPut(e,r,n){try{this.debugMsg(`fastPut -> local ${e} remote ${r}`);let i=xE(e);if(i.status){if(i.status&&bE(e)==="d")throw this.fmtError(`Bad path: ${e} not a regular file`,"fastgPut",Dt.badPath)}else throw this.fmtError(`Bad path: ${e}: ${i.details}`,"fastPut",i.code);return await this._fastPut(e,r,n)}catch(i){throw i.custom?i:this.fmtError(i.message,"fastPut",i.code)}}_put(e,r,n,i=!0){let o,s,a;return new Promise((u,l)=>{i&&(o=Mt(this,"_put",l)),n={readStreamOptions:{...n?.readStreamOptions,autoClose:!0},writeStreamOptions:{...n?.writeStreamOptions,autoClose:!0},pipeOptions:{...n?.pipeOptions,end:!0}},dr(this,"_put",l)&&(s=this.sftp.createWriteStream(r,n.writeStreamOptions),s.once("error",d=>{l(this.fmtError(`Write stream error: ${d.message} ${r}`,"_put",d.code))}),s.once("close",()=>{u(`Uploaded data stream to ${r}`)}),e instanceof Buffer?(this.debugMsg("put source is a buffer"),s.end(e)):(a=typeof e=="string"?wc.createReadStream(e,n.readStreamOptions):e,a.once("error",d=>{l(this.fmtError(`Read stream error: ${d.message} ${typeof e=="string"?e:"<stream>"}`,"_put",d.code))}),a.pipe(s,n.pipeOptions)))}).finally(()=>{i&&Ft(this,o,"_put")})}async put(e,r,n){try{if(typeof e=="string"){let i=xE(e);if(!i.status)throw this.fmtError(`Bad path: ${e} ${i.details}`,"put",i.code)}return await this._put(e,r,n)}catch(i){throw i.custom?i:this.fmtError(`Re-thrown: ${i.message}`,"put",i.code)}}_append(e,r,n,i=!0){let o;return new Promise((s,a)=>{if(i&&(o=Mt(this,"_append",a)),dr(this,"_append",a)){this.debugMsg(`append -> remote: ${r} `,n),n.flags="a";let u=this.sftp.createWriteStream(r,n);u.on("error",l=>{a(this.fmtError(`${l.message} ${r}`,"append",l.code))}),u.on("close",()=>{s(`Appended data to ${r}`)}),e instanceof Buffer?(u.write(e),u.end()):e.pipe(u)}}).finally(()=>{i&&Ft(this,o,"_append")})}async append(e,r,n={}){try{if(typeof e=="string")throw this.fmtError("Cannot append one file to another","append",Dt.badPath);let i=await this.exists(r);if(i&&i==="d")throw this.fmtError(`Bad path: ${r}: cannot append to a directory`,"append",Dt.badPath);await this._append(e,r,n)}catch(i){throw i.custom?i:this.fmtError(i.message,"append",i.code)}}_doMkdir(e,r=!0){let n;return new Promise((i,o)=>{r&&(n=Mt(this,"_doMkdir",o)),this.sftp.mkdir(e,s=>{s?s.code===4?o(this.fmtError(`Bad path: ${e} permission denied`,"_doMkdir",Dt.badPath)):s.code===2?o(this.fmtError(`Bad path: ${e} parent not a directory or not exist`,"_doMkdir",Dt.badPath)):o(this.fmtError(`${s.message} ${e}`,"_doMkdir",s.code)):i(`${e} directory created`)})}).finally(()=>{r&&Ft(this,n,"_doMkdir")})}async _mkdir(e,r){try{let n=await $s(this,e),i=await this.exists(n);if(i&&i!=="d")throw this.fmtError(`Bad path: ${n} already exists as a file`,"_mkdir",Dt.badPath);if(i)return`${n} already exists`;if(!r)return await this._doMkdir(n);let o=D1(n).dir;if(o){let s=await this.exists(o);if(!s)await this._mkdir(o,!0);else if(s!=="d")throw this.fmtError(`Bad path: ${o} not a directory`,"_mkdir",Dt.badPath)}return await this._doMkdir(n)}catch(n){throw n.custom?n:this.fmtError(`${n.message} ${e}`,"_mkdir",n.code)}}async mkdir(e,r=!1){try{return dr(this,"mkdir"),await this._mkdir(e,r)}catch(n){throw this.fmtError(`${n.message}`,"mkdir",n.code)}}async rmdir(e,r=!1){let n=c(o=>{let s;return new Promise((a,u)=>{s=Mt(this,"_rmdir",u),this.debugMsg(`_rmdir: dir = ${o}`),this.sftp.rmdir(o,l=>{l&&u(this.fmtError(`${l.message} ${o}`,"rmdir",l.code)),a("Successfully removed directory")})}).finally(()=>{Ft(this,s,"_rmdir")})},"_rmdir"),i=c((o,s)=>{let a;return new Promise((u,l)=>{a=Mt(this,"_delFiles",l),this.debugMsg(`_delFiles: path = ${o} fileList = ${s}`);let d=[];for(let p of s)d.push(this.delete(`${o}/${p.name}`,!0,!1));u(d)}).then(u=>Promise.all(u)).finally(()=>{Ft(this,a,"_delFiles")})},"_delFiles");try{this.debugMsg(`rmdir: dir = ${e} recursive = ${r}`);let o=await $s(this,e),s=await this.exists(o);if(this.debugMsg(`rmdir: ${o} existStatus = ${s}`),!s)throw this.fmtError(`Bad Path: ${e}: No such directory`,"rmdir",Dt.badPath);if(s!=="d")throw this.fmtError(`Bad Path: ${e}: Not a directory`,"rmdir",Dt.badPath);if(!r)return this.debugMsg("rmdir: non-recursive - just try to remove it"),await n(o);let a=await this.list(o);if(this.debugMsg(`rmdir: listing count = ${a.length}`),!a.length)return this.debugMsg("rmdir: No sub dir or files, just rmdir"),await n(o);let u=a.filter(d=>d.type!=="d");this.debugMsg(`rmdir: dir content files to remove = ${u.length}`);let l=a.filter(d=>d.type==="d");this.debugMsg(`rmdir: sub-directories to remove = ${l.length}`),await i(o,u);for(let d of l)await this.rmdir(`${o}/${d.name}`,!0);return await n(o),"Successfully removed directory"}catch(o){throw o.custom?o:this.fmtError(`${o.message} ${e}`,"rmdir",o.code)}}delete(e,r=!1,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"delete",s)),this.sftp.unlink(e,a=>{a&&(r&&a.code===2?o(`Successfully deleted ${e}`):s(this.fmtError(`${a.message} ${e}`,"delete",a.code))),o(`Successfully deleted ${e}`)})}).finally(()=>{n&&Ft(this,i,"delete")})}rename(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"rename",s)),dr(this,"rename",s)&&this.sftp.rename(e,r,a=>{a&&s(this.fmtError(`${a.message} From: ${e} To: ${r}`,"_rename",a.code)),o(`Successfully renamed ${e} to ${r}`)})}).finally(()=>{n&&Ft(this,i,"rename")})}posixRename(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"posixRename",s)),dr(this,"posixRename",s)&&this.sftp.ext_openssh_rename(e,r,a=>{a&&s(this.fmtError(`${a.message} From: ${e} To: ${r}`,"_posixRename",a.code)),o(`Successful POSIX rename ${e} to ${r}`)})}).finally(()=>{Ft(this,i,"posixRename")})}chmod(e,r,n=!0){let i;return new Promise((o,s)=>{n&&(i=Mt(this,"chmod",s)),dr(this,"chmod",s)&&this.sftp.chmod(e,r,a=>{a&&s(this.fmtError(`${a.message} ${e}`,"_chmod",a.code)),o("Successfully change file mode")})}).finally(()=>{n&&Ft(this,i,"chmod")})}async uploadDir(e,r,n){let i=c(async a=>{let u=await $s(this,a),l=await this.exists(u);if(l&&l!=="d")throw this.fmtError(`Bad path ${u} Not a directory`,"getRemoteStatus",Dt.badPath);return{remoteDir:u,remoteStatus:l}},"getRemoteStatus"),o=c(a=>{let u=bE(a);if(!u)throw this.fmtError(`Bad path: ${a} not exist`,"getLocalStatus",Dt.badPath);if(u!=="d")throw this.fmtError(`Bad path: ${a}: not a directory`,"getLocalStatus",Dt.badPath);return u},"checkLocalStatus"),s=c((a,u,l,d)=>{let p;return new Promise((g,h)=>{p=Mt(this,"uploadFiles",h);let _=[];for(let b of l){let E=Os(a,b.name),v=`${u}/${b.name}`;b.isFile()?(d?_.push(this._fastPut(E,v,null,!1)):_.push(this._put(E,v,null,!1)),this.client.emit("upload",{source:E,destination:v})):this.debugMsg(`uploadFiles: File ignored: ${b.name} not a regular file`)}g(Promise.all(_))}).then(g=>Promise.all(g)).finally(()=>{Ft(this,p,s)})},"uploadFiles");try{dr(this,"uploadDir"),this.debugMsg(`uploadDir: srcDir = ${e} dstDir = ${r} options = ${n}`);let{remoteDir:a,remoteStatus:u}=await i(r);this.debugMsg(`uploadDir: remoteDir = ${a} remoteStatus = ${u}`),o(e),u||await this._mkdir(a,!0);let l=wc.readdirSync(e,{encoding:"utf8",withFileTypes:!0});this.debugMsg(`uploadDir: dirEntries = ${l}`),n?.filter&&(l=l.filter(g=>n.filter(Os(e,g.name),g.isDirectory())));let d=l.filter(g=>g.isDirectory()),p=l.filter(g=>!g.isDirectory());this.debugMsg(`uploadDir: dirUploads = ${d}`),this.debugMsg(`uploadDir: fileUploads = ${p}`),await s(e,a,p,n?.useFastput);for(let g of d){let h=Os(e,g.name),_=`${a}/${g.name}`;await this.uploadDir(h,_,n)}return`${e} uploaded to ${r}`}catch(a){throw a.custom?a:this.fmtError(`${a.message} ${e}`,"uploadDir",a.code)}}async downloadDir(e,r,n={filter:null,useFastget:!1}){let i=c(async(a,u)=>{try{let l=await this.list(a);return u?l.filter(d=>u(`${a}/${d.name}`,d.type==="d")):l}catch(l){throw l.custom?l:this.fmtError(l.message,"_getDownloadList",l.code)}},"_getDownloadList"),o=c(a=>{try{let u=sd(a);if(!u.status&&u.details==="permission denied")throw this.fmtError(`Bad path: ${a}: ${u.details}`,"prepareDestination",u.code);if(u.status&&!u.type)wc.mkdirSync(a,{recursive:!0});else if(u.status&&u.type!=="d")throw this.fmtError(`Bad path: ${r}: not a directory`,"_prepareDestination",Dt.badPath)}catch(u){throw u.custom?u:this.fmtError(u.message,"_prepareDestination",u.code)}},"_prepareDestination"),s=c((a,u,l,d)=>{let p;return new Promise((g,h)=>{p=Mt(this,"_downloadFIles",h);let _=[];for(let b of l){let E=`${a}/${b.name}`,v=Os(u,b.name);d?_.push(this.fastGet(E,v,!1)):_.push(this.get(E,v,!1)),this.client.emit("download",{source:E,destination:v})}return g(Promise.all(_))}).finally(()=>{Ft(this,p,"_downloadFiles")})},"_downloadFiles");try{dr(this,"downloadDir");let a=await i(e,n.filter);o(r);let u=a.filter(d=>d.type!=="d");u.length&&await s(e,r,u,n.useFastget);let l=a.filter(d=>d.type==="d");for(let d of l){let p=`${e}/${d.name}`,g=Os(r,d.name);await this.downloadDir(p,g)}return`${e} downloaded to ${r}`}catch(a){throw a.custom?a:this.fmtError(`${a.message}: ${e}`,"downloadDir",a.code)}}createReadStream(e,r){let n;try{return n=Mt(this,"createReadStream"),dr(this,"createReadStream"),this.sftp.createReadStream(e,r)}catch(i){throw i.custom?i:this.fmtError(i.message,"createReadStream",i.code)}finally{Ft(this,n,"createReadStreame")}}createWriteStream(e,r){let n;try{return n=Mt(this,"createWriteStream"),dr(this,"createWriteStream"),this.sftp.createWriteStream(e,r)}catch(i){throw i.custom?i:this.fmtError(i.message,"createWriteStream",i.code)}finally{Ft(this,n,"createWriteStream")}}_rcopy(e,r){return new Promise((n,i)=>{let o=this.sftp.createWriteStream(r),s=this.sftp.createReadStream(e);o.on("error",a=>{i(this.fmtError(`${a.message} ${r}`,"_rcopy"))}),s.on("error",a=>{i(this.fmtError(`${a.message} ${e}`,"_rcopy"))}),o.on("close",()=>{n(`${e} copied to ${r}`)}),s.pipe(o)})}async rcopy(e,r){let n;try{n=Mt(this,"rcopy"),dr(this,"rcopy");let i=await $s(this,e),o=await this.exists(i);if(!o)throw this.fmtError(`Source does not exist ${i}`,"rcopy",Dt.badPath);if(o!=="-")throw this.fmtError(`Source not a file ${i}`,"rcopy",Dt.badPath);let s=await $s(this,r);if(await this.exists(s))throw this.fmtError(`Destination already exists ${s}`,"rcopy",Dt.badPath);return this._rcopy(i,s)}catch(i){throw i.custom?i:this.fmtError(i,"rcopy")}finally{Ft(this,n,"rcopy")}}end(){let e,r;return new Promise((n,i)=>{r=Mt(this,"end",i),this.endCalled=!0,e=c(()=>{this.sftp=void 0,this.debugMsg("end: Connection closed"),n(!0)},"endCloseHandler"),this.on("close",e),this.sftp?this.client.end():(this.debugMsg("end: Called when no connection active"),n(!0))}).finally(()=>{Ft(this,r,"end"),this.removeListener("close",e),this.endCalled=!1})}};IE.exports=ad});var BE=le((ud,ld)=>{(function(t,e){typeof ud=="object"&&typeof ld<"u"?ld.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(ud,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",o="minute",s="hour",a="day",u="week",l="month",d="quarter",p="year",g="date",h="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:c(function(L){var T=["th","st","nd","rd"],F=L%100;return"["+L+(T[(F-20)%10]||T[F]||T[0])+"]"},"ordinal")},v=c(function(L,T,F){var j=String(L);return!j||j.length>=T?L:""+Array(T+1-j.length).join(F)+L},"m"),w={s:v,z:c(function(L){var T=-L.utcOffset(),F=Math.abs(T),j=Math.floor(F/60),B=F%60;return(T<=0?"+":"-")+v(j,2,"0")+":"+v(B,2,"0")},"z"),m:c(function L(T,F){if(T.date()<F.date())return-L(F,T);var j=12*(F.year()-T.year())+(F.month()-T.month()),B=T.clone().add(j,l),Z=F-B<0,te=T.clone().add(j+(Z?-1:1),l);return+(-(j+(F-B)/(Z?B-te:te-B))||0)},"t"),a:c(function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},"a"),p:c(function(L){return{M:l,y:p,w:u,d:a,D:g,h:s,m:o,s:i,ms:n,Q:d}[L]||String(L||"").toLowerCase().replace(/s$/,"")},"p"),u:c(function(L){return L===void 0},"u")},H="en",D={};D[H]=E;var J=c(function(L){return L instanceof C},"p"),Y=c(function L(T,F,j){var B;if(!T)return H;if(typeof T=="string"){var Z=T.toLowerCase();D[Z]&&(B=Z),F&&(D[Z]=F,B=Z);var te=T.split("-");if(!B&&te.length>1)return L(te[0])}else{var k=T.name;D[k]=T,B=k}return!j&&B&&(H=B),B||!j&&H},"t"),X=c(function(L,T){if(J(L))return L.clone();var F=typeof T=="object"?T:{};return F.date=L,F.args=arguments,new C(F)},"w"),P=w;P.l=Y,P.i=J,P.w=function(L,T){return X(L,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var C=(function(){function L(F){this.$L=Y(F.locale,null,!0),this.parse(F)}c(L,"M");var T=L.prototype;return T.parse=function(F){this.$d=(function(j){var B=j.date,Z=j.utc;if(B===null)return new Date(NaN);if(P.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var te=B.match(_);if(te){var k=te[2]-1||0,W=(te[7]||"0").substring(0,3);return Z?new Date(Date.UTC(te[1],k,te[3]||1,te[4]||0,te[5]||0,te[6]||0,W)):new Date(te[1],k,te[3]||1,te[4]||0,te[5]||0,te[6]||0,W)}}return new Date(B)})(F),this.$x=F.x||{},this.init()},T.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},T.$utils=function(){return P},T.isValid=function(){return this.$d.toString()!==h},T.isSame=function(F,j){var B=X(F);return this.startOf(j)<=B&&B<=this.endOf(j)},T.isAfter=function(F,j){return X(F)<this.startOf(j)},T.isBefore=function(F,j){return this.endOf(j)<X(F)},T.$g=function(F,j,B){return P.u(F)?this[j]:this.set(B,F)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(F,j){var B=this,Z=!!P.u(j)||j,te=P.p(F),k=c(function(kt,Xt){var Ar=P.w(B.$u?Date.UTC(B.$y,Xt,kt):new Date(B.$y,Xt,kt),B);return Z?Ar:Ar.endOf(a)},"l"),W=c(function(kt,Xt){return P.w(B.toDate()[kt].apply(B.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(Xt)),B)},"$"),q=this.$W,ee=this.$M,ue=this.$D,me="set"+(this.$u?"UTC":"");switch(te){case p:return Z?k(1,0):k(31,11);case l:return Z?k(1,ee):k(0,ee+1);case u:var he=this.$locale().weekStart||0,xt=(q<he?q+7:q)-he;return k(Z?ue-xt:ue+(6-xt),ee);case a:case g:return W(me+"Hours",0);case s:return W(me+"Minutes",1);case o:return W(me+"Seconds",2);case i:return W(me+"Milliseconds",3);default:return this.clone()}},T.endOf=function(F){return this.startOf(F,!1)},T.$set=function(F,j){var B,Z=P.p(F),te="set"+(this.$u?"UTC":""),k=(B={},B[a]=te+"Date",B[g]=te+"Date",B[l]=te+"Month",B[p]=te+"FullYear",B[s]=te+"Hours",B[o]=te+"Minutes",B[i]=te+"Seconds",B[n]=te+"Milliseconds",B)[Z],W=Z===a?this.$D+(j-this.$W):j;if(Z===l||Z===p){var q=this.clone().set(g,1);q.$d[k](W),q.init(),this.$d=q.set(g,Math.min(this.$D,q.daysInMonth())).$d}else k&&this.$d[k](W);return this.init(),this},T.set=function(F,j){return this.clone().$set(F,j)},T.get=function(F){return this[P.p(F)]()},T.add=function(F,j){var B,Z=this;F=Number(F);var te=P.p(j),k=c(function(ee){var ue=X(Z);return P.w(ue.date(ue.date()+Math.round(ee*F)),Z)},"y");if(te===l)return this.set(l,this.$M+F);if(te===p)return this.set(p,this.$y+F);if(te===a)return k(1);if(te===u)return k(7);var W=(B={},B[o]=e,B[s]=r,B[i]=t,B)[te]||1,q=this.$d.getTime()+F*W;return P.w(q,this)},T.subtract=function(F,j){return this.add(-1*F,j)},T.format=function(F){var j=this,B=this.$locale();if(!this.isValid())return B.invalidDate||h;var Z=F||"YYYY-MM-DDTHH:mm:ssZ",te=P.z(this),k=this.$H,W=this.$m,q=this.$M,ee=B.weekdays,ue=B.months,me=B.meridiem,he=c(function(Xt,Ar,Br,Sr){return Xt&&(Xt[Ar]||Xt(j,Z))||Br[Ar].slice(0,Sr)},"h"),xt=c(function(Xt){return P.s(k%12||12,Xt,"0")},"d"),kt=me||function(Xt,Ar,Br){var Sr=Xt<12?"AM":"PM";return Br?Sr.toLowerCase():Sr};return Z.replace(b,(function(Xt,Ar){return Ar||(function(Br){switch(Br){case"YY":return String(j.$y).slice(-2);case"YYYY":return P.s(j.$y,4,"0");case"M":return q+1;case"MM":return P.s(q+1,2,"0");case"MMM":return he(B.monthsShort,q,ue,3);case"MMMM":return he(ue,q);case"D":return j.$D;case"DD":return P.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return he(B.weekdaysMin,j.$W,ee,2);case"ddd":return he(B.weekdaysShort,j.$W,ee,3);case"dddd":return ee[j.$W];case"H":return String(k);case"HH":return P.s(k,2,"0");case"h":return xt(1);case"hh":return xt(2);case"a":return kt(k,W,!0);case"A":return kt(k,W,!1);case"m":return String(W);case"mm":return P.s(W,2,"0");case"s":return String(j.$s);case"ss":return P.s(j.$s,2,"0");case"SSS":return P.s(j.$ms,3,"0");case"Z":return te}return null})(Xt)||te.replace(":","")}))},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(F,j,B){var Z,te=this,k=P.p(j),W=X(F),q=(W.utcOffset()-this.utcOffset())*e,ee=this-W,ue=c(function(){return P.m(te,W)},"D");switch(k){case p:Z=ue()/12;break;case l:Z=ue();break;case d:Z=ue()/3;break;case u:Z=(ee-q)/6048e5;break;case a:Z=(ee-q)/864e5;break;case s:Z=ee/r;break;case o:Z=ee/e;break;case i:Z=ee/t;break;default:Z=ee}return B?Z:P.a(Z)},T.daysInMonth=function(){return this.endOf(l).$D},T.$locale=function(){return D[this.$L]},T.locale=function(F,j){if(!F)return this.$L;var B=this.clone(),Z=Y(F,j,!0);return Z&&(B.$L=Z),B},T.clone=function(){return P.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},L})(),M=C.prototype;return X.prototype=M,[["$ms",n],["$s",i],["$m",o],["$H",s],["$W",a],["$M",l],["$y",p],["$D",g]].forEach((function(L){M[L[1]]=function(T){return this.$g(T,L[0],L[1])}})),X.extend=function(L,T){return L.$i||(L(T,C,X),L.$i=!0),X},X.locale=Y,X.isDayjs=J,X.unix=function(L){return X(1e3*L)},X.en=D[H],X.Ls=D,X.p={},X}))});var tC={};hd(tC,{endClient:()=>Zt,ftpSftp:()=>eC,getClient:()=>Ht,getProtocolBackwardCompatibility:()=>Bt});module.exports=nA(tC);var iA=Object.freeze({status:"aborted"});function xe(t,e,r){function n(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,u);let l=s.prototype,d=Object.keys(l);for(let p=0;p<d.length;p++){let g=d[p];g in a||(a[g]=l[g].bind(a))}}c(n,"init");let i=r?.Parent??Object;class o extends i{static{c(this,"Definition")}}Object.defineProperty(o,"name",{value:t});function s(a){var u;let l=r?.Parent?new o:this;n(l,a),(u=l._zod).deferred??(u.deferred=[]);for(let d of l._zod.deferred)d();return l}return c(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:c(a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t),"value")}),Object.defineProperty(s,"name",{value:t}),s}c(xe,"$constructor");var Jr=class extends Error{static{c(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ls=class extends Error{static{c(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Nc={};function fn(t){return t&&Object.assign(Nc,t),Nc}c(fn,"config");function $c(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}c($c,"getEnumValues");function _d(t,e){return typeof e=="bigint"?e.toString():e}c(_d,"jsonStringifyReplacer");function Ms(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}c(Ms,"cached");function yd(t){return t==null}c(yd,"nullish");function Fs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}c(Fs,"cleanRegex");var md=Symbol("evaluating");function er(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==md)return n===void 0&&(n=md,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}c(er,"defineLazy");var Dc="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function xo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}c(xo,"isObject");var oA=Ms(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Ed(t){if(xo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(xo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}c(Ed,"isPlainObject");var Ad=new Set(["string","number","symbol"]);function wi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}c(wi,"escapeRegex");function Hs(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}c(Hs,"clone");function Rt(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:c(()=>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:c(()=>e.error,"error")}:e}c(Rt,"normalizeParams");function bd(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}c(bd,"optionalKeys");var xd={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]};function Pi(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}c(Pi,"aborted");function wn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}c(wn,"prefixIssues");function zs(t){return typeof t=="string"?t:t?.message}c(zs,"unwrapMessage");function Pn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=zs(t.inst?._zod.def?.error?.(t))??zs(e?.error?.(t))??zs(r.customError?.(t))??zs(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}c(Pn,"finalizeIssue");function Id(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}c(Id,"getLengthableOrigin");function Bc(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}c(Bc,"issue");var vd=c((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,_d,2),Object.defineProperty(t,"toString",{value:c(()=>t.message,"value"),enumerable:!1})},"initializer"),Sd=xe("$ZodError",vd),Io=xe("$ZodError",vd,{Parent:Error});var aA=c(t=>(e,r,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Jr;if(s.issues.length){let a=new(i?.Err??t)(s.issues.map(u=>Pn(u,o,fn())));throw Dc(a,i?.callee),a}return s.value},"_parse"),js=aA(Io),cA=c(t=>async(e,r,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??t)(s.issues.map(u=>Pn(u,o,fn())));throw Dc(a,i?.callee),a}return s.value},"_parseAsync"),Ws=cA(Io),uA=c(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new Jr;return o.issues.length?{success:!1,error:new(t??Sd)(o.issues.map(s=>Pn(s,i,fn())))}:{success:!0,data:o.value}},"_safeParse"),vo=uA(Io),lA=c(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Pn(s,i,fn())))}:{success:!0,data:o.value}},"_safeParseAsync"),So=lA(Io);var fA="(?:(?:\\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])))",dA=new RegExp(`^${fA}$`);var wd=c(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Pd=/^-?\d+n?$/,Td=/^-?\d+$/,Uc=/^-?\d+(?:\.\d+)?$/,Cd=/^(?:true|false)$/i;var Tn=xe("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),pA={number:"number",bigint:"bigint",object:"date"};var kd=xe("$ZodCheckGreaterThan",(t,e)=>{Tn.init(t,e);let r=pA[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var Rd=xe("$ZodCheckNumberFormat",(t,e)=>{Tn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,o]=xd[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=o,r&&(a.pattern=Td)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}});var Nd=xe("$ZodCheckMinLength",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!yd(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let s=Id(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Lc=xe("$ZodCheckStringFormat",(t,e)=>{var r,n;Tn.init(t,e),t._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Od=xe("$ZodCheckRegex",(t,e)=>{Lc.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})}});var Dd={major:4,minor:3,patch:6};var Kt=xe("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Dd;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let o of i._zod.onattach)o(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=c((s,a,u)=>{let l=Pi(s),d;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let g=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&u?.async===!1)throw new Jr;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==g&&(l||(l=Pi(s,g)))});else{if(s.issues.length===g)continue;l||(l=Pi(s,g))}}return d?d.then(()=>s):s},"runChecks"),o=c((s,a,u)=>{if(Pi(s))return s.aborted=!0,s;let l=i(a,n,u);if(l instanceof Promise){if(u.async===!1)throw new Jr;return l.then(d=>t._zod.parse(d,u))}return t._zod.parse(l,u)},"handleCanaryResult");t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let l=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>o(d,s,a)):o(l,s,a)}let u=t._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new Jr;return u.then(l=>i(l,n,a))}return i(u,n,a)}}er(t,"~standard",()=>({validate:c(i=>{try{let o=vo(t,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return So(t,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Vs=xe("$ZodString",(t,e)=>{Kt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??wd(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}}),zc=xe("$ZodStringFormat",(t,e)=>{Lc.init(t,e),Vs.init(t,e)});var Md=xe("$ZodURL",(t,e)=>{zc.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var Mc=xe("$ZodNumber",(t,e)=>{Kt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Uc,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...o?{received:o}:{}}),r}}),Fd=xe("$ZodNumberFormat",(t,e)=>{Rd.init(t,e),Mc.init(t,e)}),Fc=xe("$ZodBoolean",(t,e)=>{Kt.init(t,e),t._zod.pattern=Cd,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),Hd=xe("$ZodBigInt",(t,e)=>{Kt.init(t,e),t._zod.pattern=Pd,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}});var jd=xe("$ZodAny",(t,e)=>{Kt.init(t,e),t._zod.parse=r=>r}),Wd=xe("$ZodUnknown",(t,e)=>{Kt.init(t,e),t._zod.parse=r=>r});var qd=xe("$ZodVoid",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),Qd=xe("$ZodDate",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:t}),r}});function Bd(t,e,r){t.issues.length&&e.issues.push(...wn(r,t.issues)),e.value[r]=t.value}c(Bd,"handleArrayResult");var Vd=xe("$ZodArray",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let o=[];for(let s=0;s<i.length;s++){let a=i[s],u=e.element._zod.run({value:a,issues:[]},n);u instanceof Promise?o.push(u.then(l=>Bd(l,r,s))):Bd(u,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Qs(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...wn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}c(Qs,"handlePropertyResult");function hA(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bd(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}c(hA,"normalizeDef");function gA(t,e,r,n,i,o){let s=[],a=i.keySet,u=i.catchall._zod,l=u.def.type,d=u.optout==="optional";for(let p in e){if(a.has(p))continue;if(l==="never"){s.push(p);continue}let g=u.run({value:e[p],issues:[]},n);g instanceof Promise?t.push(g.then(h=>Qs(h,r,p,e,d))):Qs(g,r,p,e,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}c(gA,"handleCatchall");var Kd=xe("$ZodObject",(t,e)=>{if(Kt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:c(()=>{let u={...a};return Object.defineProperty(e,"shape",{value:u}),u},"get")})}let n=Ms(()=>hA(e));er(t._zod,"propValues",()=>{let a=e.shape,u={};for(let l in a){let d=a[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(let p of d.values)u[l].add(p)}}return u});let i=xo,o=e.catchall,s;t._zod.parse=(a,u)=>{s??(s=n.value);let l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};let d=[],p=s.shape;for(let g of s.keys){let h=p[g],_=h._zod.optout==="optional",b=h._zod.run({value:l[g],issues:[]},u);b instanceof Promise?d.push(b.then(E=>Qs(E,a,g,l,_))):Qs(b,a,g,l,_)}return o?gA(d,l,a,u,n.value,t):d.length?Promise.all(d).then(()=>a):a}});function Ud(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let i=t.filter(o=>!Pi(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Pn(s,n,fn())))}),e)}c(Ud,"handleUnionResults");var Hc=xe("$ZodUnion",(t,e)=>{Kt.init(t,e),er(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),er(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),er(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),er(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Fs(o.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,o)=>{if(r)return n(i,o);let s=!1,a=[];for(let u of e.options){let l=u._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(u=>Ud(u,i,t,o)):Ud(a,i,t,o)}});var Gd=xe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Hc.init(t,e);let r=t._zod.parse;er(t._zod,"propValues",()=>{let i={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,u]of Object.entries(s)){i[a]||(i[a]=new Set);for(let l of u)i[a].add(l)}}return i});let n=Ms(()=>{let i=e.options,o=new Map;for(let s of i){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(i,o)=>{let s=i.value;if(!xo(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;let a=n.value.get(s?.[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),i)}});var Zd=xe("$ZodRecord",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Ed(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let d=e.valueType._zod.run({value:i[l],issues:[]},n);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...wn(l,p.issues)),r.value[l]=p.value})):(d.issues.length&&r.issues.push(...wn(l,d.issues)),r.value[l]=d.value)}let u;for(let l in i)a.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:u})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let u=e.keyType._zod.run({value:a,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Uc.test(a)&&u.issues.length){let p=e.keyType._zod.run({value:Number(a),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){e.mode==="loose"?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Pn(p,n,fn())),input:a,path:[a],inst:t});continue}let d=e.valueType._zod.run({value:i[a],issues:[]},n);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...wn(a,p.issues)),r.value[u.value]=p.value})):(d.issues.length&&r.issues.push(...wn(a,d.issues)),r.value[u.value]=d.value)}}return o.length?Promise.all(o).then(()=>r):r}});var Yd=xe("$ZodEnum",(t,e)=>{Kt.init(t,e);let r=$c(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Ad.has(typeof i)).map(i=>typeof i=="string"?wi(i):i.toString()).join("|")})$`),t._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:t}),i}}),Xd=xe("$ZodLiteral",(t,e)=>{if(Kt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?wi(n):n?wi(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}});var Jd=xe("$ZodTransform",(t,e)=>{Kt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ls(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r));if(i instanceof Promise)throw new Jr;return r.value=i,r}});function Ld(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}c(Ld,"handleOptionalResult");var ep=xe("$ZodOptional",(t,e)=>{Kt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",er(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),er(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Fs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Ld(o,r.value)):Ld(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var tp=xe("$ZodNullable",(t,e)=>{Kt.init(t,e),er(t._zod,"optin",()=>e.innerType._zod.optin),er(t._zod,"optout",()=>e.innerType._zod.optout),er(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Fs(r.source)}|null)$`):void 0}),er(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)});var rp=xe("$ZodPipe",(t,e)=>{Kt.init(t,e),er(t._zod,"values",()=>e.in._zod.values),er(t._zod,"optin",()=>e.in._zod.optin),er(t._zod,"optout",()=>e.out._zod.optout),er(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>qs(s,e.in,n)):qs(o,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(o=>qs(o,e.out,n)):qs(i,e.out,n)}});function qs(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}c(qs,"handlePipeResult");var np=xe("$ZodCustom",(t,e)=>{Tn.init(t,e),Kt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>zd(o,r,n,t));zd(i,r,n,t)}});function zd(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Bc(i))}}c(zd,"handleRefineResult");var op;var jc=class{static{c(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function sp(){return new jc}c(sp,"registry");(op=globalThis).__zod_globalRegistry??(op.__zod_globalRegistry=sp());var Wc=globalThis.__zod_globalRegistry;function ap(t,e){return new t({type:"string",...Rt(e)})}c(ap,"_string");function cp(t,e){return new t({type:"string",coerce:!0,...Rt(e)})}c(cp,"_coercedString");function up(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Rt(e)})}c(up,"_url");function lp(t,e){return new t({type:"number",checks:[],...Rt(e)})}c(lp,"_number");function fp(t,e){return new t({type:"number",coerce:!0,checks:[],...Rt(e)})}c(fp,"_coercedNumber");function dp(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Rt(e)})}c(dp,"_int");function pp(t,e){return new t({type:"boolean",...Rt(e)})}c(pp,"_boolean");function hp(t,e){return new t({type:"boolean",coerce:!0,...Rt(e)})}c(hp,"_coercedBoolean");function gp(t,e){return new t({type:"bigint",coerce:!0,...Rt(e)})}c(gp,"_coercedBigint");function mp(t){return new t({type:"any"})}c(mp,"_any");function _p(t){return new t({type:"unknown"})}c(_p,"_unknown");function yp(t,e){return new t({type:"void",...Rt(e)})}c(yp,"_void");function Ep(t,e){return new t({type:"date",coerce:!0,...Rt(e)})}c(Ep,"_coercedDate");function Ks(t,e){return new kd({check:"greater_than",...Rt(e),value:t,inclusive:!0})}c(Ks,"_gte");function Qr(t,e){return new Nd({check:"min_length",...Rt(e),minimum:t})}c(Qr,"_minLength");function Cn(t,e){return new Od({check:"string_format",format:"regex",...Rt(e),pattern:t})}c(Cn,"_regex");function Ap(t,e,r){let n=Rt(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}c(Ap,"_custom");var tr=xe("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");Kt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>js(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>vo(t,r,n),t.parseAsync=async(r,n)=>Ws(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>So(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)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Hs(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Zs=xe("ZodMiniString",(t,e)=>{Vs.init(t,e),tr.init(t,e)});function I(t){return ap(Zs,t)}c(I,"string");var bp=xe("ZodMiniStringFormat",(t,e)=>{zc.init(t,e),Zs.init(t,e)});var TA=xe("ZodMiniURL",(t,e)=>{Md.init(t,e),bp.init(t,e)});function xp(t){return up(TA,t)}c(xp,"url");var Ys=xe("ZodMiniNumber",(t,e)=>{Mc.init(t,e),tr.init(t,e)});function cr(t){return lp(Ys,t)}c(cr,"number");var CA=xe("ZodMiniNumberFormat",(t,e)=>{Fd.init(t,e),Ys.init(t,e)});function Ip(t){return dp(CA,t)}c(Ip,"int");var qc=xe("ZodMiniBoolean",(t,e)=>{Fc.init(t,e),tr.init(t,e)});function dt(t){return pp(qc,t)}c(dt,"boolean");var vp=xe("ZodMiniBigInt",(t,e)=>{Hd.init(t,e),tr.init(t,e)});var kA=xe("ZodMiniAny",(t,e)=>{jd.init(t,e),tr.init(t,e)});function Po(){return mp(kA)}c(Po,"any");var RA=xe("ZodMiniUnknown",(t,e)=>{Wd.init(t,e),tr.init(t,e)});function Ve(){return _p(RA)}c(Ve,"unknown");var NA=xe("ZodMiniVoid",(t,e)=>{qd.init(t,e),tr.init(t,e)});function Sp(t){return yp(NA,t)}c(Sp,"_void");var wp=xe("ZodMiniDate",(t,e)=>{Qd.init(t,e),tr.init(t,e)});var OA=xe("ZodMiniArray",(t,e)=>{Vd.init(t,e),tr.init(t,e)});function Ue(t,e){return new OA({type:"array",element:t,...Rt(e)})}c(Ue,"array");var $A=xe("ZodMiniObject",(t,e)=>{Kd.init(t,e),tr.init(t,e),er(t,"shape",()=>e.shape)});function N(t,e){let r={type:"object",shape:t??{},...Rt(e)};return new $A(r)}c(N,"object");var DA=xe("ZodMiniUnion",(t,e)=>{Hc.init(t,e),tr.init(t,e)});function tt(t,e){return new DA({type:"union",options:t,...Rt(e)})}c(tt,"union");var BA=xe("ZodMiniDiscriminatedUnion",(t,e)=>{Gd.init(t,e),tr.init(t,e)});function kn(t,e,r){return new BA({type:"union",options:e,discriminator:t,...Rt(r)})}c(kn,"discriminatedUnion");var UA=xe("ZodMiniRecord",(t,e)=>{Zd.init(t,e),tr.init(t,e)});function Ke(t,e,r){return new UA({type:"record",keyType:t,valueType:e,...Rt(r)})}c(Ke,"record");var LA=xe("ZodMiniEnum",(t,e)=>{Yd.init(t,e),tr.init(t,e),t.options=Object.values(e.entries)});function Oe(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new LA({type:"enum",entries:r,...Rt(e)})}c(Oe,"_enum");var zA=xe("ZodMiniLiteral",(t,e)=>{Xd.init(t,e),tr.init(t,e)});function Ce(t,e){return new zA({type:"literal",values:Array.isArray(t)?t:[t],...Rt(e)})}c(Ce,"literal");var MA=xe("ZodMiniTransform",(t,e)=>{Jd.init(t,e),tr.init(t,e)});function Rn(t){return new MA({type:"transform",transform:t})}c(Rn,"transform");var FA=xe("ZodMiniOptional",(t,e)=>{ep.init(t,e),tr.init(t,e)});function V(t){return new FA({type:"optional",innerType:t})}c(V,"optional");var HA=xe("ZodMiniNullable",(t,e)=>{tp.init(t,e),tr.init(t,e)});function To(t){return new HA({type:"nullable",innerType:t})}c(To,"nullable");var jA=xe("ZodMiniPipe",(t,e)=>{rp.init(t,e),tr.init(t,e)});function Nn(t,e){return new jA({type:"pipe",in:t,out:e})}c(Nn,"pipe");var WA=xe("ZodMiniCustom",(t,e)=>{np.init(t,e),tr.init(t,e)});function Xs(t,e){return Ap(WA,t??(()=>!0),e)}c(Xs,"custom");var Co={};hd(Co,{bigint:()=>ZA,boolean:()=>GA,date:()=>YA,number:()=>KA,string:()=>VA});function VA(t){return cp(Zs,t)}c(VA,"string");function KA(t){return fp(Ys,t)}c(KA,"number");function GA(t){return hp(qc,t)}c(GA,"boolean");function ZA(t){return gp(vp,t)}c(ZA,"bigint");function YA(t){return Ep(wp,t)}c(YA,"date");var Vc=N({retryOnFailure:N({defaultValue:V(dt()),hide:V(dt())}),continueOnFailure:N({defaultValue:V(dt()),hide:V(dt())})}),Qc=class{constructor(e,r,n,i,o,s,a,u,l,d,p,g,h){this.name=e;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=o;this.run=s;this.test=a;this.requireAuth=u;this.errorHandlingOptions=l;this.outputSchema=d;this.audience=p;this.aiMetadata=g;this.classification=h}static{c(this,"IAction")}},mr=c(t=>new Qc(t.name,t.displayName,t.description,t.props,t.propertyGroups,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata,t.classification),"createAction");var lt=N({displayName:I(),description:V(I()),advanced:V(dt()),width:V(Oe(["half","full"])),icon:V(I()),placeholder:V(I())}),Ze=c((t,e)=>N({type:Ce(e),required:dt(),defaultValue:V(Po())}),"TPropertyValue");var Nr=N({...lt.shape,...Ze(I(),"SHORT_TEXT").shape}),dn=N({...lt.shape,...Ze(I(),"LONG_TEXT").shape});var Tp=N({label:I(),value:Ve(),description:V(I()),icon:V(I())}),Js=N({disabled:V(dt()),placeholder:V(I()),options:Ue(Tp)});var JA=Oe(["cards"]),Or=N({...lt.shape,options:Js,display:V(JA),...Ze(Ve(),"STATIC_DROPDOWN").shape}),pn=N({...lt.shape,options:Js,...Ze(Ue(Ve()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Kc=N({...lt.shape,...Ze(Ve(),"DROPDOWN").shape,refreshers:Ue(I())}),ko=N({...lt.shape,...Ze(Ue(Ve()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Ue(I())});var hn=N({...lt.shape,reveals:V(Ue(I())),...Ze(dt(),"CHECKBOX").shape});var gn=N({...lt.shape,display:V(Oe(["stepper"])),min:V(cr()),max:V(cr()),step:V(cr()),...Ze(cr(),"NUMBER").shape});var Ro=N({...lt.shape,streaming:V(dt()),...Ze(Ve(),"FILE").shape});var No=N({...lt.shape,...Ze(I(),"DATE_TIME").shape});var Cp=Ke(I(),tt([Nr,dn,Or,ko,pn,hn,gn,Ro,No])),Oo=N({...lt.shape,properties:Cp,...Ze(Ue(Ve()),"ARRAY").shape});var kp=Oe(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Rp=N({preset:V(kp),after:V(I()),before:V(I())}),Gc=N({...lt.shape,display:V(Oe(["dropdown"])),...Ze(Rp,"DATE_RANGE").shape});var $o=N({...lt.shape,...Ze(tt([Ke(I(),Ve())]),"JSON").shape});var Np=tt([Nr,Or,$o,Oo,pn]),e0=Ke(I(),Np),Zc=N({refreshers:Ue(I()),...lt.shape,...Ze(Ve(),"DYNAMIC").shape});var ea=N({...lt.shape,...Ze(Sp(),"MARKDOWN").shape});var Do=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Do||{}),Ti=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ti||{}),Ci=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ci||{});var Bo=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Bo||{}),Yc="both_client_credentials_and_authorization_code";var On=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(On||{}),Uo=(o=>(o.NONE="NONE",o.HEADER_PRESENT="HEADER_PRESENT",o.QUERY_PRESENT="QUERY_PRESENT",o.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",o.HEAD_REQUEST="HEAD_REQUEST",o))(Uo||{}),t0=N({strategy:Oe(Uo),paramName:V(I())}),Lo=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Lo||{});var ta=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(ta||{}),Op=N({status:V(cr()),body:V(Ve()),headers:V(Ke(I(),I()))}),$p=N({type:Ce("DELAY"),resumeDateTime:I(),requestIdToReply:V(I()),handlerId:V(I()),streamStepProgress:V(Oe(ta))}),Dp=N({type:Ce("WEBHOOK"),requestId:I(),requestIdToReply:V(I()),response:Op,handlerId:V(I()),streamStepProgress:V(Oe(ta))}),r0=tt([$p,Dp]);var n0=N({body:Ve(),rawBody:V(Ve()),headers:Ke(I(),I()),queryParams:Ke(I(),I())});function rr(t){return t==null}c(rr,"isNil");var Xc=br(require("crypto"),1);var i0=128,$n,ki,o0=c(t=>{if(t<0)throw new RangeError("Wrong ID size");try{!$n||$n.length<t?($n=Buffer.allocUnsafe(t*i0),Xc.default.randomFillSync($n),ki=0):ki+t>$n.length&&(Xc.default.randomFillSync($n),ki=0)}catch(e){throw $n=void 0,e}ki+=t},"fillPool"),s0=c(t=>(o0(t|=0),$n.subarray(ki-t,ki)),"random"),a0=c((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(o=e)=>{if(o<=0)return"";let s="";for(;;){let a=r(i),u=i;for(;u--;)if(s+=t[a[u]&n]||"",s.length===o)return s}}},"customRandom"),Up=c((t,e=21)=>a0(t,e,s0),"customAlphabet");var c0="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Lp=21,z6=I().check(Cn(new RegExp(`^[0-9a-zA-Z]{${Lp}}$`))),u0=Up(c0,Lp);var Dn=Nn(Rn(t=>t instanceof Date?t.toISOString():t),I()),Lr={id:I(),created:Dn,updated:Dn},Lt=c(t=>V(To(t)),"Nullable");function Jc(t){return V(To(Oe(t)))}c(Jc,"NullableEnum");var H6=Nn(Rn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),V(dt())),ra=c(t=>Nn(Rn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),V(Ue(t))),"OptionalArrayFromQuery");var q6=Ke(I(),Ve());var Ri=(E=>(E.OPENAI="openai",E.OPENROUTER="openrouter",E.ANTHROPIC="anthropic",E.AZURE="azure",E.GOOGLE="google",E.ACTIVEPIECES="activepieces",E.CLOUDFLARE_GATEWAY="cloudflare-gateway",E.CUSTOM="custom",E.BEDROCK="bedrock",E.MISTRAL="mistral",E.XAI="xai",E.DEEPSEEK="deepseek",E.ZAI="zai",E.QWEN="qwen",E.MINIMAX="minimax",E.MOONSHOT="moonshot",E))(Ri||{});var nB=I().check(Cn(/^#[0-9A-Fa-f]{6}$/));var oB=N({filename:I(),data:Ve(),type:Ce("file"),mimetype:V(I())});var l0=br(Mp());var dB=N({...Lr,name:I(),permissions:Ue(I()),platformId:Lt(I()),type:I(),userCount:V(cr())});var Fp=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Fp||{}),eu=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(eu||{}),tu=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(tu||{});var ru=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(ru||{});var nu=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(nu||{});var f0=N({mode:Oe(Fp),value:Ve()}),d0=N({auth:V(I()),fields:Ke(I(),f0)}),p0=N({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:V(d0)}),h0=N({type:Ce("PIECE"),toolName:I().check(Qr(1)),pieceMetadata:p0}),g0=N({type:Ce("none")}),m0=N({type:Ce("access_token"),accessToken:I()}),_0=N({type:Ce("api_key"),apiKey:I(),apiKeyHeader:I()}),y0=N({type:Ce("headers"),headers:Ke(I(),I())}),E0=kn("type",[g0,m0,_0,y0]),Hp=N({type:Ce("FLOW"),toolName:I().check(Qr(1)),externalFlowId:I(),flowDisplayName:V(I())}),jp=N({type:Ce("MCP"),toolName:I().check(Qr(1)),serverUrl:xp(),protocol:Oe(tu),auth:E0}),Wp=N({type:Ce("KNOWLEDGE_BASE"),toolName:I().check(Qr(1)),sourceType:Oe(eu),sourceId:I(),sourceName:I()}),A0=kn("type",[h0,Hp,jp,Wp]),b0=N({displayName:I(),description:V(I()),type:Oe(ru)}),qp=N({type:Ce("MARKDOWN"),markdown:I()}),Ni={type:Ce("TOOL_CALL"),input:Lt(Ke(I(),Ve())),output:V(Ve()),toolName:I(),status:Oe(nu),toolCallId:I(),startTime:I(),endTime:V(I())},jB=N(Ni),Qp=kn("toolCallType",[N({...Ni,toolCallType:Ce("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),N({...Ni,toolCallType:Ce("FLOW"),displayName:I(),externalFlowId:I()}),N({...Ni,toolCallType:Ce("MCP"),displayName:I(),serverUrl:I()}),N({...Ni,toolCallType:Ce("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),N({...Ni,toolCallType:Ce("UNKNOWN"),displayName:I()})]),x0=tt([qp,Qp]);var iu=(r=>(r.IMAGE="image",r.TEXT="text",r))(iu||{}),mn=N({apiKey:I()}),I0=mn,v0=N({apiKey:I(),apiKeyHash:I()}),S0=mn,w0=mn,P0=mn,T0=mn,C0=mn,k0=mn,R0=mn,Yp=N({accessKeyId:I().check(Qr(1)),secretAccessKey:I().check(Qr(1))}),N0=N({}),O0=N({}),$0=N({}),D0=N({}),B0=N({}),U0=N({}),Xp=N({modelId:I(),modelName:I(),modelType:Oe(iu)}),Jp=N({apiKeyHeader:I(),baseUrl:I(),models:Ue(Xp),defaultHeaders:V(Ke(I(),I()))}),eh=N({accountId:I(),gatewayId:I(),models:Ue(Xp),vertexProject:V(I()),vertexRegion:V(I())}),th=N({resourceName:I(),apiVersion:Nn(Rn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),V(I()))}),rh=N({region:I().check(Qr(1))}),nh=N({}),L0=tt([I0,P0,T0,C0,k0,w0,S0,v0,Yp,R0]),ih=tt([Jp,eh,th,rh,N0,$0,D0,B0,O0,U0,nh]),z0=N({id:I(),name:I(),type:Oe(iu)}),M0=N({id:I(),name:I(),provider:Oe(Ri),config:ih,enabledForChat:dt()}),F0=N({provider:Oe(Ri),name:I(),enabledForChat:dt(),keys:Ue(N({id:I(),name:I()}))}),H0=N({provider:Oe(Ri),configId:I(),config:ih,auth:L0,platformId:I()});var VB={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Vp=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],j0=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],W0=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Kp=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],q0=["grok-4.20","grok-4.1-fast"],Q0={openai:Vp,anthropic:j0,google:Kp,activepieces:[...W0.map(t=>`anthropic/${t}`),...Vp.map(t=>`openai/${t}`),...Kp.map(t=>`google/${t}`),...q0.map(t=>`x-ai/${t}`)]};var Gp=128e3,V0={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function K0({provider:t}){return t?V0[t]??Gp:Gp}c(K0,"getMaxContextTokens");var Zp={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},G0={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Z0=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),Y0={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function _r(t){return{chatModels:Q0[t],maxContextTokens:K0({provider:t}),defaultEmbeddingModel:Zp[t],supportsEmbedding:Zp[t]!==void 0,supportsImageGeneration:!Z0.has(t),webSearch:G0[t]}}c(_r,"buildProviderCapabilities");var X0={openai:_r("openai"),anthropic:_r("anthropic"),openrouter:_r("openrouter"),azure:_r("azure"),google:_r("google"),"cloudflare-gateway":_r("cloudflare-gateway"),custom:_r("custom"),bedrock:_r("bedrock"),mistral:_r("mistral"),activepieces:_r("activepieces"),xai:_r("xai"),deepseek:_r("deepseek"),zai:_r("zai"),qwen:_r("qwen"),minimax:_r("minimax"),moonshot:_r("moonshot")};var J0=N({base64Url:I(),fileName:I(),extension:V(I())}),eb=N({mimeType:I(),url:I(),fileName:V(I())}),ou=tt([J0,eb]);var tb=tt([N({type:Ce("file"),value:ou}),N({type:Ce("markdown"),value:I(),files:V(Ue(ou))})]),rb=N({sessionId:I(),message:I(),files:V(Ue(I()))});var sh=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(sh||{}),ah=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ah||{}),su=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(su||{});var nb=tt([N({...Lr,name:I(),externalId:I(),type:Ce("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:N({options:Ue(N({value:I()}))})}),N({...Lr,name:I(),externalId:I(),type:tt([Ce("TEXT"),Ce("NUMBER"),Ce("DATE"),Ce("DATETIME")]),tableId:I(),projectId:I()})]),ib=N({...Lr,name:I(),folderId:Lt(I()),projectId:I(),externalId:I(),status:Jc(ah),trigger:Jc(sh)}),ob=N({...Lr,tableId:I(),projectId:I(),cells:Ke(I(),N({updated:I(),created:I(),value:Ve(),fieldName:I()}))}),sb=N({events:Ue(Oe(su)),webhookUrl:I(),flowId:I()}),ab=N({fields:Ue(N({id:I(),name:I()})),rows:Ue(Ke(I(),I())),name:I()}),cb=N({projectId:I(),limit:V(Co.number()),cursor:V(I()),name:V(I()),externalIds:ra(I()),folderId:V(I()),folderIds:ra(I())}),ub=N({records:Ue(Ue(N({fieldId:I(),value:uh()}))),tableId:I()}),lb=N({cells:V(Ue(N({fieldId:I(),value:uh()}))),tableId:I(),agentUpdate:V(dt())}),ch=kn("operator",[ri("eq"),ri("neq"),ri("gt"),ri("gte"),ri("lt"),ri("lte"),ri("co"),oh("exists"),oh("not_exists")]),fb=N({tableId:I(),limit:V(Co.number()),cursor:V(I()),filters:ra(ch)});function uh(){return Nn(Rn(t=>t==null?t:String(t)),To(I()))}c(uh,"coerceToString");function ri(t){return N({fieldId:I(),operator:Ce(t),value:I()})}c(ri,"valueFilter");function oh(t){return N({fieldId:I(),operator:Ce(t)})}c(oh,"existenceFilter");var db=N({status:V(cr()),body:V(Ve()),headers:V(Ke(I(),I()))}),pb=N({...Lr,deleted:Lt(Dn),ownerId:I(),displayName:I(),platformId:I(),externalId:Lt(I())});var lh=N({name:I(),description:V(I()),type:I(),required:dt()}),hb=N({pieceName:I(),triggerName:I(),input:N({toolName:I(),toolDescription:I(),inputSchema:Ue(lh),returnsResponse:dt()})});var fh="^[0-9]+\\.[0-9]+\\.[0-9]+$",dU=new RegExp(fh),mb="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",pU=I().check(Cn(new RegExp(fh))),hU=I().check(Cn(new RegExp(mb))),_b=N({packageType:Ce("ARCHIVE"),pieceType:Oe(Ti),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),dh=N({packageType:Ce("REGISTRY"),pieceType:Ce("OFFICIAL"),pieceName:I(),pieceVersion:I()}),ph=N({packageType:Ce("REGISTRY"),pieceType:Ce("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),gU=tt([dh,ph]),mU=tt([_b,dh,ph]);var yb=kn("type",[N({type:Ce("CRON_EXPRESSION"),cronExpression:I(),timezone:I()}),N({type:Ce("INTERVAL"),intervalMs:Ip().check(Ks(6e4))})]),_U=N({...Lr,type:Oe(On),projectId:I(),flowId:I(),triggerName:I(),schedule:Lt(yb),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:Lt(I()),simulate:dt()}),hh=(E=>(E.UNKNOWN="UNKNOWN",E.FLOW_RUN_LOG="FLOW_RUN_LOG",E.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",E.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",E.FLOW_STEP_FILE="FLOW_STEP_FILE",E.SAMPLE_DATA="SAMPLE_DATA",E.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",E.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",E.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",E.PROJECT_RELEASE="PROJECT_RELEASE",E.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",E.PLATFORM_ASSET="PLATFORM_ASSET",E.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",E.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",E.KNOWLEDGE_BASE="KNOWLEDGE_BASE",E.FLOW_BUNDLE="FLOW_BUNDLE",E))(hh||{}),gh=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(gh||{}),mh=(r=>(r.S3="S3",r.DB="DB",r))(mh||{}),yU=N({...Lr,projectId:Lt(I()),platformId:Lt(I()),type:Oe(hh),compression:Oe(gh),data:V(Ve()),location:Oe(mh),size:Lt(cr()),fileName:Lt(I()),s3Key:Lt(I()),metadata:Lt(Ke(I(),I()))}),_h=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(_h||{}),yh=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(yh||{}),EU=N({id:I(),email:I(),firstName:I(),status:Oe(yh),externalId:Lt(I()),platformId:Lt(I()),platformRole:Oe(_h),lastName:I(),created:Dn,updated:Dn,lastActiveDate:Lt(Dn),imageUrl:Lt(I())});var cu=N({...lt.shape,...Ze(Ke(I(),Ve()),"OBJECT").shape});var uu=N({...lt.shape,formatProperty:V(I()),...Ze(I(),"RICH_TEXT").shape});var bh=N({...lt.shape,...Ze(I(),"COLOR").shape});var lu=tt([Nr,dn,uu,ea,hn,Or,pn,Kc,ko,Zc,gn,Oo,cu,$o,No,Gc,Ro,bh]),gt={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},RichText(t){return{...t,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},DateRange(t){return{...t,valueSchema:void 0,type:"DATE_RANGE"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var en=N({displayName:I(),description:V(I()),hasConnectionIdentifier:V(dt())});var xh=N({username:I(),password:I()}),fu=N({...en.shape,username:N({displayName:I(),description:V(I())}),password:N({displayName:I(),description:V(I())}),...Ze(xh,"BASIC_AUTH").shape});var xb=Ke(I(),tt([Nr,dn,gn,hn,Or])),du=N({...en.shape,props:xb,...Ze(Ve(),"CUSTOM_AUTH").shape});var ni=N({...en.shape,...Ze(N({auth:I()}),"SECRET_TEXT").shape});var Ib=Ke(I(),tt([Nr,dn,ni,gn,hn,Or,pn,ea])),Ih=N({...en.shape,props:Ib,...Ze(Ve(),"OIDC").shape});var pu=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(pu||{}),vh=tt([Nr,ni,Or]),Sh=Ke(I(),vh),vb=N({props:V(Ke(I(),vh)),authUrl:I(),tokenUrl:I(),scope:Ue(I()),prompt:V(tt([Ce("none"),Ce("consent"),Ce("login"),Ce("omit")])),pkce:V(dt()),pkceMethod:V(tt([Ce("plain"),Ce("S256")])),authorizationMethod:V(Oe(pu)),grantType:V(tt([Oe(Bo),Ce(Yc)])),extra:V(Ke(I(),I()))}),wh=N({access_token:I(),props:V(Sh),data:Ke(I(),Po())}),hu=N({...en.shape,...vb.shape,...Ze(wh,"OAUTH2").shape});var Oi=tt([fu,du,Ih,hu,ni]),zo="Connection",Mo={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||zo}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||zo,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||zo}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||zo}},None(){}};var rz={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var Sb=N({...lt.shape,...Ze(Ve(),"CUSTOM").shape,code:I()});var Pb=tt([lu,Oi]),gu=Ke(I(),Pb),Iz=Ke(I(),lu);var Ph=tt([N({strategy:Ce("CRON"),cronExpression:I()}),N({strategy:Ce("NONE")})]),$i=class{constructor(e,r,n,i,o,s,a,u,l,d,p,g,h,_,b,E,v,w,H,D,J){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=o;this.type=s;this.handshakeConfiguration=a;this.onHandshake=u;this.renewConfiguration=l;this.onRenew=d;this.onEnable=p;this.onDisable=g;this.onStart=h;this.run=_;this.test=b;this.sampleData=E;this.testStrategy=v;this.outputSchema=w;this.aiMetadata=H;this.classification=D;this.propertyGroups=J}static{c(this,"ITrigger")}},Th=c(t=>{switch(t.type){case"WEBHOOK":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"POLLING":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"MANUAL":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups);case"APP_WEBHOOK":return new $i(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,rr(t.sampleData)&&rr(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups)}},"createTrigger");var Ch="2",ia="0.82.0";var mu=class{constructor(e,r,n,i,o,s,a,u,l=ia,d,p="",g){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=a;this.auth=u;this.minimumSupportedRelease=l;this.maximumSupportedRelease=d;this.description=p;this.deprecated=g;this._actions={};this._triggers={};this.getContextInfo=c(()=>({version:Ch}),"getContextInfo");(!Cb(l)||kb(l,ia))&&(this.minimumSupportedRelease=ia),o.forEach(h=>this._actions[h.name]=h),s.forEach(h=>this._triggers[h.name]=h)}static{c(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Tb(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},Rh=c(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(o=>o.type===r.type)))throw new Error("Auth properties must be unique by type");return new mu(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function Tb(t){if(t!==void 0)return Array.isArray(t)?t.map(kh):kh(t)}c(Tb,"withConnectionIdentifierFlag");function kh(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}c(kh,"flagConnectionIdentifier");function Cb(t){return/^\d+\.\d+\.\d+$/.test(t)}c(Cb,"isValidSimpleSemver");function kb(t,e){let[r,n,i]=t.split(".").map(Number),[o,s,a]=e.split(".").map(Number);return r!==o?r<o:n!==s?n<s:i<a}c(kb,"isSemverLessThan");var Rb=V(Ke(I(),Ke(I(),I()))),Nh=N({id:V(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:Ue(I()),platformId:V(I()),directoryPath:V(I()),auth:V(tt([Oi,Ue(Oi)])),version:I(),categories:V(Ue(Oe(Ci))),minimumSupportedRelease:V(I()),maximumSupportedRelease:V(I()),deprecated:V(dt()),i18n:Rb}),Nb=Oe(["human","ai","both"]),Oh=N({description:V(I()),idempotent:V(dt())}),$h=Oe(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Ob=Oe(["tabs","section","summary","builder","footer"]),Dh=N({key:I(),display:Ob,label:V(I()),description:V(I()),icon:V(I()),props:Ue(I())}),Bh=N({name:I(),displayName:I(),description:I(),props:gu,propertyGroups:V(Ue(Dh)),requireAuth:dt(),errorHandlingOptions:V(Vc),outputSchema:V(Xs()),audience:V(Nb),aiMetadata:V(Oh),classification:V($h)}),Uh=N({name:I(),displayName:I(),description:I(),props:gu,propertyGroups:V(Ue(Dh)),errorHandlingOptions:V(Vc),type:Oe(On),sampleData:Ve(),handshakeConfiguration:V(Xs()),renewConfiguration:V(Ph),testStrategy:Oe(Lo),outputSchema:V(Xs()),aiMetadata:V(Oh),classification:V($h)}),$b=N({...Nh.shape,actions:Ke(I(),Bh),triggers:Ke(I(),Uh)}),Db=N({...Nh.shape,actions:cr(),triggers:cr(),suggestedActions:V(Ue(Bh)),suggestedTriggers:V(Ue(Uh))}),Lh=N({projectUsage:cr(),pieceType:Oe(Ti),packageType:Oe(Do),platformId:V(I()),archiveId:V(I())}),SM=N({...$b.shape,...Lh.shape}),wM=N({...Db.shape,...Lh.shape}),PM=N({name:I(),version:I()});var Bb=br(require("path")),Ub=br(require("fs/promises"));var PE=br(nn());var SE=br(vE()),wE=br(nn());async function Bt(t){return rr(t)?"sftp":t}c(Bt,"getProtocolBackwardCompatibility");async function Ht(t){let{protocol:e,host:r,port:n,allow_unauthorized_certificates:i,allow_anonymous_login:o,username:s,password:a,privateKey:u,algorithm:l}=t,d=await Bt(e);if(d==="sftp"){let p=new SE.default;if(u){let g=u.replace(/\\r\\n/g,`
18
+ `;this.message=t===void 0?r:`${t}
19
+ ${r}`}};var ZD=2**32,Sw=(()=>{try{return new Function("return 2n ** 32n")()}catch{}})();wu.ERR_OUT_OF_RANGE=class Pw extends RangeError{static{a(this,"ERR_OUT_OF_RANGE")}constructor(t,r,i,n){super(),Error.captureStackTrace(this,Pw),yp(r,'Missing "range" argument');let o=n?t:`The value of "${t}" is out of range.`,s;Number.isInteger(i)&&Math.abs(i)>ZD?s=Iw(String(i)):typeof i=="bigint"?(s=String(i),(i>Sw||i<-Sw)&&(s=Iw(s)),s+="n"):s=VD(i),o+=` It must be ${r}. Received ${s}`,this.message=o}};var Ep=class e extends TypeError{static{a(this,"ERR_INVALID_ARG_TYPE")}constructor(t,r,i){super(),Error.captureStackTrace(this,e),yp(typeof t=="string","'name' must be a string");let n;typeof r=="string"&&r.startsWith("not ")?(n="must not be",r=r.replace(/^not /,"")):n="must be";let o;if(t.endsWith(" argument"))o=`The ${t} ${n} ${vw(r,"type")}`;else{let s=t.includes(".")?"property":"argument";o=`The "${t}" ${s} ${n} ${vw(r,"type")}`}o+=`. Received type ${typeof i}`,this.message=o}};wu.ERR_INVALID_ARG_TYPE=Ep;wu.validateNumber=a(function(t,r){if(typeof t!="number")throw new Ep(r,"number",t)},"validateNumber")});var Pu=me((r7,Fw)=>{"use strict";var QD=require("events"),Oi=require("fs"),{constants:Kr}=Oi,{Readable:$w,Writable:dA}=require("stream"),{inherits:Dw,types:{isDate:sA}}=require("util"),KD=Buffer[Symbol.species],{bufferCopy:Ri,bufferSlice:Ms,makeBufferParser:GD,writeUInt32BE:Y}=In(),ri={SIZE:1,UIDGID:2,PERMISSIONS:4,ACMODTIME:8,EXTENDED:2147483648},He=Buffer.alloc(28),xt={OK:0,EOF:1,NO_SUCH_FILE:2,PERMISSION_DENIED:3,FAILURE:4,BAD_MESSAGE:5,NO_CONNECTION:6,CONNECTION_LOST:7,OP_UNSUPPORTED:8},YD=new Map(Object.values(xt).map(e=>[e,1])),XD={[xt.OK]:"No error",[xt.EOF]:"End of file",[xt.NO_SUCH_FILE]:"No such file or directory",[xt.PERMISSION_DENIED]:"Permission denied",[xt.FAILURE]:"Failure",[xt.BAD_MESSAGE]:"Bad message",[xt.NO_CONNECTION]:"No connection",[xt.CONNECTION_LOST]:"Connection lost",[xt.OP_UNSUPPORTED]:"Operation unsupported"},Ue={INIT:1,OPEN:3,CLOSE:4,READ:5,WRITE:6,LSTAT:7,FSTAT:8,SETSTAT:9,FSETSTAT:10,OPENDIR:11,READDIR:12,REMOVE:13,MKDIR:14,RMDIR:15,REALPATH:16,STAT:17,RENAME:18,READLINK:19,SYMLINK:20,EXTENDED:200},Gr={VERSION:2,STATUS:101,HANDLE:102,DATA:103,NAME:104,ATTRS:105,EXTENDED:201},$e={READ:1,WRITE:2,APPEND:4,CREAT:8,TRUNC:16,EXCL:32},kw=2*1024,Nt=2**32-1,JD=Buffer.from([0,0,0,5,Ue.INIT,0,0,0,3]),e2=Buffer.from([0,0,0,5,Gr.VERSION,0,0,0,3]),t2=/^SSH-2.0-(?:OpenSSH|dropbear)/,iA=256*1024,L=GD(),r2={readable:!1,writable:!1,push:a(e=>{},"push"),once:a(()=>{},"once"),on:a(()=>{},"on"),emit:a(()=>{},"emit"),end:a(()=>{},"end")};function Bw(){}a(Bw,"noop");var aA=class extends QD{static{a(this,"SFTP")}constructor(t,r,i){super(),(typeof i!="object"||!i)&&(i={});let n=t._protocol._remoteIdentRaw;this.server=!!i.server,this._debug=typeof i.debug=="function"?i.debug:void 0,this._isOpenSSH=n&&t2.test(n),this._version=-1,this._extensions={},this._biOpt=i.biOpt,this._pktLenBytes=0,this._pktLen=0,this._pktPos=0,this._pktType=0,this._pktData=void 0,this._writeReqid=-1,this._requests={},this._maxInPktLen=iA,this._maxOutPktLen=34e3,this._maxReadLen=(this._isOpenSSH?iA:34e3)-kw,this._maxWriteLen=(this._isOpenSSH?iA:34e3)-kw,this.maxOpenHandles=void 0,this._client=t,this._protocol=t._protocol,this._callbacks=[],this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this._waitWindow=!1,this._chunkcb=void 0,this._buffer=[],this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this.stderr=r2,this.readable=!0}push(t){if(t===null){if(Mw(this),!this.readable)return;this.readable=!1,this.emit("end");return}let r=0;for(;r<t.length;){if(this._pktLenBytes<4){let s=Math.min(4-this._pktLenBytes,t.length-r);for(this._pktLenBytes+=s;s--;)this._pktLen=(this._pktLen<<8)+t[r++];if(this._pktLenBytes<4)return;if(this._pktLen===0)return wt(this,"Invalid packet length");if(this._pktLen>this._maxInPktLen){let c=this._maxInPktLen;return wt(this,`Packet length ${this._pktLen} exceeds max length of ${c}`)}if(r>=t.length)return}if(this._pktPos<this._pktLen){let s=Math.min(this._pktLen-this._pktPos,t.length-r);if(r!==0||s!==t.length?s===this._pktLen?this._pkt=new KD(t.buffer,t.byteOffset+r,s):(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(new Uint8Array(t.buffer,t.byteOffset+r,s),this._pktPos)):s===this._pktLen?this._pkt=t:(this._pkt||(this._pkt=Buffer.allocUnsafe(this._pktLen)),this._pkt.set(t,this._pktPos)),r+=s,this._pktPos+=s,this._pktPos<this._pktLen)return}let i=this._pkt[0],n=this._pkt;this._pktLen=0,this._pktLenBytes=0,this._pkt=void 0,this._pktPos=0;let o=this.server?a2[i]:s2[i];if(!o)return wt(this,`Unknown packet type ${i}`);if(this._version===-1){if(this.server){if(i!==Ue.INIT)return wt(this,`Expected INIT packet, got ${i}`)}else if(i!==Gr.VERSION)return wt(this,`Expected VERSION packet, got ${i}`)}if(o(this,n)===!1)return}}end(){this.destroy()}destroy(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._protocol.channelClose(this.outgoing.id))}_init(){this._init=Bw,this.server||_t(this,JD)}createReadStream(t,r){if(this.server)throw new Error("Client-only method called in server mode");return new ni(this,t,r)}createWriteStream(t,r){if(this.server)throw new Error("Client-only method called in server mode");return new gn(this,t,r)}open(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");typeof i=="function"&&(n=i,i=void 0);let o=typeof r=="number"?r:Lw(r);if(o===null)throw new Error(`Unknown flags string: ${r}`);let s=0,c=0;(typeof i=="string"||typeof i=="number")&&(i={mode:i}),typeof i=="object"&&i!==null&&(i=Io(i),s=i.flags,c=i.nb);let u=Buffer.byteLength(t),l=9,f=Buffer.allocUnsafe(13+u+4+4+c);Y(f,f.length-4,0),f[4]=Ue.OPEN;let p=this._writeReqid=this._writeReqid+1&Nt;Y(f,p,5),Y(f,u,l),f.utf8Write(t,l+=4,u),Y(f,o,l+=u),Y(f,s,l+=4),c&&(l+=4,c===He.length?f.set(He,l):Ri(He,f,0,c,l),l+=c),this._requests[p]={cb:n};let g=_t(this,f);this._debug&&this._debug(`SFTP: Outbound: ${g?"Buffered":"Sending"} OPEN`)}close(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let i=t.length,n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.CLOSE;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.set(t,n+=4),this._requests[s]={cb:r};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} CLOSE`)}read(t,r,i,n,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(i>=r.length)throw new Error("offset is out of bounds");if(i+n>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");zw(this,t,r,i,n,o,s)}readData(t,r,i,n,o,s){this.read(t,r,i,n,o,s)}write(t,r,i,n,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");if(!Buffer.isBuffer(r))throw new Error("buffer is not a Buffer");if(i>r.length)throw new Error("offset is out of bounds");if(i+n>r.length)throw new Error("length extends beyond buffer");if(o===null)throw new Error("null position currently unsupported");if(!n){s&&process.nextTick(s,void 0,0);return}let c=this._maxWriteLen,u=Math.max(n-c,0),l=o;u&&(n=c);let f=t.length,p=9,g=Buffer.allocUnsafe(13+f+8+4+n);Y(g,g.length-4,0),g[4]=Ue.WRITE;let h=this._writeReqid=this._writeReqid+1&Nt;Y(g,h,5),Y(g,f,p),g.set(t,p+=4),p+=f;for(let y=7;y>=0;--y)g[p+y]=o&255,o/=256;Y(g,n,p+=8),Ri(r,g,i,i+n,p+=4),this._requests[h]={cb:a(y=>{y?typeof s=="function"&&s(y):u?this.write(t,r,i+n,u,l+n,s):typeof s=="function"&&s(void 0,i+n)},"cb")};let _=_t(this,g);if(this._debug){let y=_?"Sent":"Buffered";this._debug(`SFTP: Outbound: ${y} WRITE (id:${h})`)}}writeData(t,r,i,n,o,s){this.write(t,r,i,n,o,s)}fastGet(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");Cw(this,Oi,t,r,i,n)}fastPut(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");Cw(Oi,this,t,r,i,n)}readFile(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n;if(typeof i=="function"?n=i:typeof r=="function"&&(n=r,r=void 0),typeof r=="string")r={encoding:r,flag:"r"};else if(!r)r={encoding:null,flag:"r"};else if(typeof r!="object")throw new TypeError("Bad arguments");let o=r.encoding;if(o&&!Buffer.isEncoding(o))throw new Error(`Unknown encoding: ${o}`);let s,c,u,l=0,f,p=0,g=r.flag||"r",h=a(()=>{s===0?(c=Buffer.allocUnsafe(8192),this.read(f,c,0,8192,p,_)):this.read(f,c,l,s-l,p,_)},"read"),_=a((b,v)=>{let S;if(b){if(S=b.code===xt.EOF,!S)return this.close(f,()=>n&&n(b))}else S=!1;if(S||s===0&&v===0)return y();p+=v,l+=v,s!==0?l===s?y():h():(u.push(Ms(c,0,v)),h())},"afterRead");_._wantEOFError=!0;let y=a(()=>{this.close(f,b=>(s===0?c=Buffer.concat(u,l):l<s&&(c=Ms(c,0,l)),o&&(c=c.toString(o)),n&&n(b,c)))},"close");this.open(t,g,438,(b,v)=>{if(b)return n&&n(b);f=v;let S=a((M,R)=>{if(M){this.stat(t,(J,te)=>{if(J)return this.close(f,()=>{n&&n(M)});S(null,te)});return}if(s=R.size||0,s===0)return u=[],h();c=Buffer.allocUnsafe(s),h()},"tryStat");this.fstat(f,S)})}writeFile(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof n=="function"?o=n:typeof i=="function"&&(o=i,i=void 0),typeof i=="string")i={encoding:i,mode:438,flag:"w"};else if(!i)i={encoding:"utf8",mode:438,flag:"w"};else if(typeof i!="object")throw new TypeError("Bad arguments");if(i.encoding&&!Buffer.isEncoding(i.encoding))throw new Error(`Unknown encoding: ${i.encoding}`);let s=i.flag||"w";this.open(t,s,i.mode,(c,u)=>{if(c)o&&o(c);else{let l=Buffer.isBuffer(r)?r:Buffer.from(""+r,i.encoding||"utf8"),f=/a/.test(s)?null:0;if(f===null){let p=a((g,h)=>{if(g){this.stat(t,(_,y)=>{if(_)return this.close(u,()=>{o&&o(g)});p(null,y)});return}cA(this,u,l,0,l.length,h.size,o)},"tryStat");this.fstat(u,p);return}cA(this,u,l,0,l.length,f,o)}})}appendFile(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");let o;if(typeof n=="function"?o=n:typeof i=="function"&&(o=i,i=void 0),typeof i=="string")i={encoding:i,mode:438,flag:"a"};else if(!i)i={encoding:"utf8",mode:438,flag:"a"};else if(typeof i!="object")throw new TypeError("Bad arguments");i.flag||(i=Object.assign({flag:"a"},i)),this.writeFile(t,r,i,o)}exists(t,r){if(this.server)throw new Error("Client-only method called in server mode");this.stat(t,i=>{r&&r(!i)})}unlink(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.REMOVE;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} REMOVE`)}rename(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(t),o=Buffer.byteLength(r),s=9,c=Buffer.allocUnsafe(13+n+4+o);Y(c,c.length-4,0),c[4]=Ue.RENAME;let u=this._writeReqid=this._writeReqid+1&Nt;Y(c,u,5),Y(c,n,s),c.utf8Write(t,s+=4,n),Y(c,o,s+=n),c.utf8Write(r,s+=4,o),this._requests[u]={cb:i};let l=_t(this,c);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} RENAME`)}mkdir(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=0,o=0;typeof r=="function"&&(i=r,r=void 0),typeof r=="object"&&r!==null&&(r=Io(r),n=r.flags,o=r.nb);let s=Buffer.byteLength(t),c=9,u=Buffer.allocUnsafe(13+s+4+o);Y(u,u.length-4,0),u[4]=Ue.MKDIR;let l=this._writeReqid=this._writeReqid+1&Nt;Y(u,l,5),Y(u,s,c),u.utf8Write(t,c+=4,s),Y(u,n,c+=s),o&&(c+=4,o===He.length?u.set(He,c):Ri(He,u,0,o,c),c+=o),this._requests[l]={cb:i};let f=_t(this,u);this._debug&&this._debug(`SFTP: Outbound: ${f?"Buffered":"Sending"} MKDIR`)}rmdir(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.RMDIR;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} RMDIR`)}readdir(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");typeof r=="function"&&(i=r,r={}),(typeof r!="object"||r===null)&&(r={});let n=!(r&&r.full);if(!Buffer.isBuffer(t)&&typeof t!="string")throw new Error("missing directory handle or path");if(typeof t=="string"){let f=[],p=0,g=a((h,_)=>{if(h)return i(h);this.readdir(_,r,(y,b)=>{let v=y&&y.code===xt.EOF;if(y&&!v)return this.close(_,()=>i(y));if(v)return this.close(_,S=>{if(S)return i(S);i(void 0,f)});for(let S=0;S<b.length;++S,++p)f[p]=b[S];g(void 0,_)})},"reread");return this.opendir(t,g)}let o=t.length,s=9,c=Buffer.allocUnsafe(13+o);Y(c,c.length-4,0),c[4]=Ue.READDIR;let u=this._writeReqid=this._writeReqid+1&Nt;Y(c,u,5),Y(c,o,s),c.set(t,s+=4),this._requests[u]={cb:n?(f,p)=>{if(typeof i=="function"){if(f)return i(f);for(let g=p.length-1;g>=0;--g)(p[g].filename==="."||p[g].filename==="..")&&p.splice(g,1);i(void 0,p)}}:i};let l=_t(this,c);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} READDIR`)}fstat(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let i=t.length,n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.FSTAT;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.set(t,n+=4),this._requests[s]={cb:r};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} FSTAT`)}stat(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.STAT;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} STAT`)}lstat(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.LSTAT;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} LSTAT`)}opendir(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.OPENDIR;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:r};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} OPENDIR`)}setstat(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=0,o=0;typeof r=="object"&&r!==null?(r=Io(r),n=r.flags,o=r.nb):typeof r=="function"&&(i=r);let s=Buffer.byteLength(t),c=9,u=Buffer.allocUnsafe(13+s+4+o);Y(u,u.length-4,0),u[4]=Ue.SETSTAT;let l=this._writeReqid=this._writeReqid+1&Nt;Y(u,l,5),Y(u,s,c),u.utf8Write(t,c+=4,s),Y(u,n,c+=s),o&&(c+=4,o===He.length?u.set(He,c):Ri(He,u,0,o,c),c+=o),this._requests[l]={cb:i};let f=_t(this,u);this._debug&&this._debug(`SFTP: Outbound: ${f?"Buffered":"Sending"} SETSTAT`)}fsetstat(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let n=0,o=0;typeof r=="object"&&r!==null?(r=Io(r),n=r.flags,o=r.nb):typeof r=="function"&&(i=r);let s=t.length,c=9,u=Buffer.allocUnsafe(13+s+4+o);Y(u,u.length-4,0),u[4]=Ue.FSETSTAT;let l=this._writeReqid=this._writeReqid+1&Nt;Y(u,l,5),Y(u,s,c),u.set(t,c+=4),Y(u,n,c+=s),o&&(c+=4,o===He.length?u.set(He,c):Ri(He,u,0,o,c),c+=o),this._requests[l]={cb:i};let f=_t(this,u);this._debug&&this._debug(`SFTP: Outbound: ${f?"Buffered":"Sending"} FSETSTAT`)}futimes(t,r,i,n){return this.fsetstat(t,{atime:Ls(r),mtime:Ls(i)},n)}utimes(t,r,i,n){return this.setstat(t,{atime:Ls(r),mtime:Ls(i)},n)}fchown(t,r,i,n){return this.fsetstat(t,{uid:r,gid:i},n)}chown(t,r,i,n){return this.setstat(t,{uid:r,gid:i},n)}fchmod(t,r,i){return this.fsetstat(t,{mode:r},i)}chmod(t,r,i){return this.setstat(t,{mode:r},i)}readlink(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.READLINK;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:a((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing link info"));r(void 0,l[0].filename)}},"cb")};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} READLINK`)}symlink(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=Buffer.byteLength(r),o=Buffer.byteLength(t),s=9,c=Buffer.allocUnsafe(13+n+4+o);Y(c,c.length-4,0),c[4]=Ue.SYMLINK;let u=this._writeReqid=this._writeReqid+1&Nt;Y(c,u,5),this._isOpenSSH?(Y(c,o,s),c.utf8Write(t,s+=4,o),Y(c,n,s+=o),c.utf8Write(r,s+=4,n)):(Y(c,n,s),c.utf8Write(r,s+=4,n),Y(c,o,s+=n),c.utf8Write(t,s+=4,o)),this._requests[u]={cb:i};let l=_t(this,c);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} SYMLINK`)}realpath(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=Buffer.byteLength(t),n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Ue.REALPATH;let s=this._writeReqid=this._writeReqid+1&Nt;Y(o,s,5),Y(o,i,n),o.utf8Write(t,n+=4,i),this._requests[s]={cb:a((u,l)=>{if(typeof r=="function"){if(u)return r(u);if(!l||!l.length)return r(new Error("Response missing path info"));r(void 0,l[0].filename)}},"cb")};let c=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} REALPATH`)}ext_openssh_rename(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");let n=this._extensions["posix-rename@openssh.com"];if(!n||n!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(t),s=Buffer.byteLength(r),c=9,u=Buffer.allocUnsafe(41+o+4+s);Y(u,u.length-4,0),u[4]=Ue.EXTENDED;let l=this._writeReqid=this._writeReqid+1&Nt;Y(u,l,5),Y(u,24,c),u.utf8Write("posix-rename@openssh.com",c+=4,24),Y(u,o,c+=24),u.utf8Write(t,c+=4,o),Y(u,s,c+=o),u.utf8Write(r,c+=4,s),this._requests[l]={cb:i};let f=_t(this,u);if(this._debug){let p=f?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} posix-rename@openssh.com`)}}ext_openssh_statvfs(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=this._extensions["statvfs@openssh.com"];if(!i||i!=="2")throw new Error("Server does not support this extended request");let n=Buffer.byteLength(t),o=9,s=Buffer.allocUnsafe(36+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Nt;Y(s,c,5),Y(s,19,o),s.utf8Write("statvfs@openssh.com",o+=4,19),Y(s,n,o+=19),s.utf8Write(t,o+=4,n),this._requests[c]={extended:"statvfs@openssh.com",cb:r};let u=_t(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} statvfs@openssh.com`)}}ext_openssh_fstatvfs(t,r){if(this.server)throw new Error("Client-only method called in server mode");let i=this._extensions["fstatvfs@openssh.com"];if(!i||i!=="2")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let n=t.length,o=9,s=Buffer.allocUnsafe(37+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Nt;Y(s,c,5),Y(s,20,o),s.utf8Write("fstatvfs@openssh.com",o+=4,20),Y(s,n,o+=20),s.set(t,o+=4),this._requests[c]={extended:"fstatvfs@openssh.com",cb:r};let u=_t(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} fstatvfs@openssh.com`)}}ext_openssh_hardlink(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["hardlink@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=Buffer.byteLength(t),s=Buffer.byteLength(r),c=9,u=Buffer.allocUnsafe(37+o+4+s);Y(u,u.length-4,0),u[4]=Ue.EXTENDED;let l=this._writeReqid=this._writeReqid+1&Nt;Y(u,l,5),Y(u,20,c),u.utf8Write("hardlink@openssh.com",c+=4,20),Y(u,o,c+=20),u.utf8Write(t,c+=4,o),Y(u,s,c+=o),u.utf8Write(r,c+=4,s),this._requests[l]={cb:i};let f=_t(this,u);if(this._debug){let p=f?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${p} hardlink@openssh.com`)}}ext_openssh_fsync(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["fsync@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(t))throw new Error("handle is not a Buffer");let n=t.length,o=9,s=Buffer.allocUnsafe(34+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Nt;Y(s,c,5),Y(s,17,o),s.utf8Write("fsync@openssh.com",o+=4,17),Y(s,n,o+=17),s.set(t,o+=4),this._requests[c]={cb:r};let u=_t(this,s);this._debug&&this._debug(`SFTP: Outbound: ${u?"Buffered":"Sending"} fsync@openssh.com`)}ext_openssh_lsetstat(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["lsetstat@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let o=0,s=0;typeof r=="object"&&r!==null?(r=Io(r),o=r.flags,s=r.nb):typeof r=="function"&&(i=r);let c=Buffer.byteLength(t),u=9,l=Buffer.allocUnsafe(37+c+4+s);Y(l,l.length-4,0),l[4]=Ue.EXTENDED;let f=this._writeReqid=this._writeReqid+1&Nt;Y(l,f,5),Y(l,20,u),l.utf8Write("lsetstat@openssh.com",u+=4,20),Y(l,c,u+=20),l.utf8Write(t,u+=4,c),Y(l,o,u+=c),s&&(u+=4,s===He.length?l.set(He,u):Ri(He,l,0,s,u),u+=s),this._requests[f]={cb:i};let p=_t(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} lsetstat@openssh.com`)}}ext_openssh_expandPath(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["expand-path@openssh.com"]!=="1")throw new Error("Server does not support this extended request");let n=Buffer.byteLength(t),o=9,s=Buffer.allocUnsafe(40+n);Y(s,s.length-4,0),s[4]=Ue.EXTENDED;let c=this._writeReqid=this._writeReqid+1&Nt;Y(s,c,5),Y(s,23,o),s.utf8Write("expand-path@openssh.com",o+=4,23),Y(s,n,o+=20),s.utf8Write(t,o+=4,n),this._requests[c]={cb:a((l,f)=>{if(typeof r=="function"){if(l)return r(l);if(!f||!f.length)return r(new Error("Response missing expanded path"));r(void 0,f[0].filename)}},"cb")};let u=_t(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} expand-path@openssh.com`)}}ext_copy_data(t,r,i,n,o,s){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["copy-data"]!=="1")throw new Error("Server does not support this extended request");if(!Buffer.isBuffer(t))throw new Error("Source handle is not a Buffer");if(!Buffer.isBuffer(n))throw new Error("Destination handle is not a Buffer");let u=0,l=Buffer.allocUnsafe(26+t.length+8+8+4+n.length+8);Y(l,l.length-4,u),u+=4,l[u]=Ue.EXTENDED,++u;let f=this._writeReqid=this._writeReqid+1&Nt;Y(l,f,u),u+=4,Y(l,9,u),u+=4,l.utf8Write("copy-data",u,9),u+=9,Y(l,t.length,u),u+=4,l.set(t,u),u+=t.length;for(let g=7;g>=0;--g)l[u+g]=r&255,r/=256;u+=8;for(let g=7;g>=0;--g)l[u+g]=i&255,i/=256;u+=8,Y(l,n.length,u),u+=4,l.set(n,u),u+=n.length;for(let g=7;g>=0;--g)l[u+g]=o&255,o/=256;this._requests[f]={cb:s};let p=_t(this,l);if(this._debug){let g=p?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${g} copy-data`)}}ext_home_dir(t,r){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["home-directory"]!=="1")throw new Error("Server does not support this extended request");if(typeof t!="string")throw new TypeError("username is not a string");let n=0,o=Buffer.byteLength(t),s=Buffer.allocUnsafe(31+o);Y(s,s.length-4,n),n+=4,s[n]=Ue.EXTENDED,++n;let c=this._writeReqid=this._writeReqid+1&Nt;Y(s,c,n),n+=4,Y(s,14,n),n+=4,s.utf8Write("home-directory",n,14),n+=14,Y(s,o,n),n+=4,s.utf8Write(t,n,o),n+=o,this._requests[c]={cb:a((l,f)=>{if(typeof r=="function"){if(l)return r(l);if(!f||!f.length)return r(new Error("Response missing home directory"));r(void 0,f[0].filename)}},"cb")};let u=_t(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} home-directory`)}}ext_users_groups(t,r,i){if(this.server)throw new Error("Client-only method called in server mode");if(this._extensions["users-groups-by-id@openssh.com"]!=="1")throw new Error("Server does not support this extended request");if(!Array.isArray(t))throw new TypeError("uids is not an array");for(let l of t)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("uid values must all be 32-bit unsigned integers");if(!Array.isArray(r))throw new TypeError("gids is not an array");for(let l of r)if(!Number.isInteger(l)||l<0||l>2**32-1)throw new Error("gid values must all be 32-bit unsigned integers");let o=0,s=Buffer.allocUnsafe(47+4*t.length+4+4*r.length);Y(s,s.length-4,o),o+=4,s[o]=Ue.EXTENDED,++o;let c=this._writeReqid=this._writeReqid+1&Nt;Y(s,c,o),o+=4,Y(s,30,o),o+=4,s.utf8Write("users-groups-by-id@openssh.com",o,30),o+=30,Y(s,4*t.length,o),o+=4;for(let l of t)Y(s,l,o),o+=4;Y(s,4*r.length,o),o+=4;for(let l of r)Y(s,l,o),o+=4;this._requests[c]={extended:"users-groups-by-id@openssh.com",cb:i};let u=_t(this,s);if(this._debug){let l=u?"Buffered":"Sending";this._debug(`SFTP: Outbound: ${l} users-groups-by-id@openssh.com`)}}handle(t,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Buffer.isBuffer(r))throw new Error("handle is not a Buffer");let i=r.length;if(i>256)throw new Error("handle too large (> 256 bytes)");let n=9,o=Buffer.allocUnsafe(13+i);Y(o,o.length-4,0),o[4]=Gr.HANDLE,Y(o,t,5),Y(o,i,n),i&&o.set(r,n+=4);let s=_t(this,o);this._debug&&this._debug(`SFTP: Outbound: ${s?"Buffered":"Sending"} HANDLE`)}status(t,r,i){if(!this.server)throw new Error("Server-only method called in client mode");if(!YD.has(r))throw new Error(`Bad status code: ${r}`);i||(i="");let n=Buffer.byteLength(i),o=9,s=Buffer.allocUnsafe(17+n+4);Y(s,s.length-4,0),s[4]=Gr.STATUS,Y(s,t,5),Y(s,r,o),Y(s,n,o+=4),o+=4,n&&(s.utf8Write(i,o,n),o+=n),Y(s,0,o);let c=_t(this,s);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} STATUS`)}data(t,r,i){if(!this.server)throw new Error("Server-only method called in client mode");let n=Buffer.isBuffer(r);if(!n&&typeof r!="string")throw new Error("data is not a Buffer or string");let o;!n&&!i&&(i=void 0,o=!0);let s=n?r.length:Buffer.byteLength(r,i),c=9,u=Buffer.allocUnsafe(13+s);Y(u,u.length-4,0),u[4]=Gr.DATA,Y(u,t,5),Y(u,s,c),s&&(n?u.set(r,c+=4):o?u.utf8Write(r,c+=4,s):u.write(r,c+=4,s,i));let l=_t(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} DATA`)}name(t,r){if(!this.server)throw new Error("Server-only method called in client mode");if(!Array.isArray(r)){if(typeof r!="object"||r===null)throw new Error("names is not an object or array");r=[r]}let i=r.length,n=0,o,s=[];for(let f=0;f<i;++f){let p=r[f],g=!p||!p.filename||typeof p.filename!="string"?"":p.filename;n+=4+Buffer.byteLength(g);let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname;if(n+=4+Buffer.byteLength(h),typeof p.attrs=="object"&&p.attrs!==null){if(o=Io(p.attrs),n+=4+o.nb,o.nb){let _;o.nb===He.length?_=new Uint8Array(He):(_=new Uint8Array(o.nb),Ri(He,_,0,o.nb,0)),o.bytes=_}s.push(o)}else n+=4,s.push(null)}let c=9,u=Buffer.allocUnsafe(13+n);Y(u,u.length-4,0),u[4]=Gr.NAME,Y(u,t,5),Y(u,i,c),c+=4;for(let f=0;f<i;++f){let p=r[f];{let h=!p||!p.filename||typeof p.filename!="string"?"":p.filename,_=Buffer.byteLength(h);Y(u,_,c),c+=4,_&&(u.utf8Write(h,c,_),c+=_)}{let h=!p||!p.longname||typeof p.longname!="string"?"":p.longname,_=Buffer.byteLength(h);Y(u,_,c),c+=4,_&&(u.utf8Write(h,c,_),c+=_)}let g=s[f];g?(Y(u,g.flags,c),c+=4,g.flags&&g.bytes&&(u.set(g.bytes,c),c+=g.nb)):(Y(u,0,c),c+=4)}let l=_t(this,u);this._debug&&this._debug(`SFTP: Outbound: ${l?"Buffered":"Sending"} NAME`)}attrs(t,r){if(!this.server)throw new Error("Server-only method called in client mode");if(typeof r!="object"||r===null)throw new Error("attrs is not an object");r=Io(r);let i=r.flags,n=r.nb,o=9,s=Buffer.allocUnsafe(13+n);Y(s,s.length-4,0),s[4]=Gr.ATTRS,Y(s,t,5),Y(s,i,o),n&&(o+=4,n===He.length?s.set(He,o):Ri(He,s,0,n,o),o+=n);let c=_t(this,s);this._debug&&this._debug(`SFTP: Outbound: ${c?"Buffered":"Sending"} ATTRS`)}};function n2(e){try{return Buffer.allocUnsafe(e)}catch(t){return t}}a(n2,"tryCreateBuffer");function zw(e,t,r,i,n,o,s,c){let u=e._maxReadLen,l=Math.max(n-u,0);l&&(n=u);let f=t.length,p=9,g=o,h=Buffer.allocUnsafe(13+f+8+4);Y(h,h.length-4,0),h[4]=Ue.READ;let _=e._writeReqid=e._writeReqid+1&Nt;Y(h,_,5),Y(h,f,p),h.set(t,p+=4),p+=f;for(let v=7;v>=0;--v)h[p+v]=g&255,g/=256;Y(h,n,p+=8),typeof s!="function"&&(s=Bw);let y=c||{nb:0,position:o,off:i,origOff:i,len:void 0,overflow:void 0,cb:a((v,S,M)=>{let R=y.len,J=y.overflow;if(v){if(s._wantEOFError||v.code!==xt.EOF)return s(v)}else{if(M>R)return s(new Error("Received more data than requested"));if(M===R&&J){y.nb+=M,y.position+=M,y.off+=M,zw(e,t,r,y.off,J,y.position,s,y);return}}M=M||0,y.origOff===0&&r.length===y.nb?S=r:S=Ms(r,y.origOff,y.origOff+y.nb+M),s(void 0,y.nb+M,S,y.position)},"cb"),buffer:void 0};y.len=n,y.overflow=l,y.buffer=Ms(r,i,i+n),e._requests[_]=y;let b=_t(e,h);e._debug&&e._debug(`SFTP: Outbound: ${b?"Buffered":"Sending"} READ`)}a(zw,"read_");function Cw(e,t,r,i,n,o){let s=64,c=32768,u,l,f;typeof n=="function"?o=n:typeof n=="object"&&n!==null&&(typeof n.concurrency=="number"&&n.concurrency>0&&!isNaN(n.concurrency)&&(s=n.concurrency),typeof n.chunkSize=="number"&&n.chunkSize>0&&!isNaN(n.chunkSize)&&(c=n.chunkSize),typeof n.fileSize=="number"&&n.fileSize>0&&!isNaN(n.fileSize)&&(f=n.fileSize),typeof n.step=="function"&&(u=n.step),(typeof n.mode=="string"||typeof n.mode=="number")&&(l=pA(n.mode)));let p,g=0,h=0,_=!1,y,b,v,S=c*s;function M(R){if(_)return;_=!0;let J=0,te;y||b?(te=a(()=>{--J===0&&o(R)},"cbfinal"),y&&(e===Oi||e.outgoing.state==="open")&&++J,b&&(t===Oi||t.outgoing.state==="open")&&++J,y&&(e===Oi||e.outgoing.state==="open")&&e.close(y,te),b&&(t===Oi||t.outgoing.state==="open")&&t.close(b,te)):o(R)}a(M,"onerror"),e.open(r,"r",(R,J)=>{if(R)return M(R);y=J,f===void 0?e.fstat(y,te):te(null,{size:f});function te(ee,P){if(ee){if(e!==Oi){e.stat(r,(C,H)=>{if(C)return M(ee);te(null,H)});return}return M(ee)}p=P.size,t.open(i,"w",(C,H)=>{if(C)return M(C);if(b=H,p<=0)return M();for(;S>p;){if(s===1){S=p;break}S-=c,--s}if(v=n2(S),v instanceof Error)return M(v);l!==void 0?t.fchmod(b,l,a(function z(X){if(X){t.chmod(i,l,ne=>z());return}W()},"tryAgain")):W();function U(z,X,ne,O,q,V){if(z)return M(z);q=q||0,t.write(b,v,q,X,O,re);function re(_e){if(_e)return M(_e);if(h+=X,u&&u(h,X,p),X<V)return j(q,O+X,V-X);if(h===p){t.close(b,xe=>{if(b=void 0,xe)return M(xe);e.close(y,Tt=>{if(y=void 0,Tt)return M(Tt);o()})});return}if(g>=p)return;let ve=g+c>p?p-g:c;j(q,g,ve),g+=ve}a(re,"writeCb")}a(U,"onread");function k(z,X,ne){return(O,q,V)=>{U(O,q,V,X,z,ne)}}a(k,"makeCb");function j(z,X,ne){e.read(y,v,z,ne,X,k(z,X,ne))}a(j,"singleRead");function W(){let z=0,X=0;for(;g<p&&z<s;){let ne=g+c>p?p-g:c;j(X,g,ne),X+=ne,g+=ne,++z}}a(W,"startReads")})}a(te,"tryStat")})}a(Cw,"fastXfer");function cA(e,t,r,i,n,o,s){let c=typeof s=="function"?s:void 0;e.write(t,r,i,n,o,(u,l)=>{if(u)return e.close(t,()=>{c&&c(u)});l===n?e.close(t,c):(i+=l,n-=l,o+=l,cA(e,t,r,i,n,o,c))})}a(cA,"writeAll");var bp=class{static{a(this,"Stats")}constructor(t){this.mode=t&&t.mode,this.uid=t&&t.uid,this.gid=t&&t.gid,this.size=t&&t.size,this.atime=t&&t.atime,this.mtime=t&&t.mtime,this.extended=t&&t.extended}isDirectory(){return(this.mode&Kr.S_IFMT)===Kr.S_IFDIR}isFile(){return(this.mode&Kr.S_IFMT)===Kr.S_IFREG}isBlockDevice(){return(this.mode&Kr.S_IFMT)===Kr.S_IFBLK}isCharacterDevice(){return(this.mode&Kr.S_IFMT)===Kr.S_IFCHR}isSymbolicLink(){return(this.mode&Kr.S_IFMT)===Kr.S_IFLNK}isFIFO(){return(this.mode&Kr.S_IFMT)===Kr.S_IFIFO}isSocket(){return(this.mode&Kr.S_IFMT)===Kr.S_IFSOCK}};function Io(e){let t=0,r=0;if(typeof e=="object"&&e!==null){if(typeof e.size=="number"){t|=ri.SIZE;let i=e.size;He[r++]=i/72057594037927940,He[r++]=i/281474976710656,He[r++]=i/1099511627776,He[r++]=i/4294967296,He[r++]=i/16777216,He[r++]=i/65536,He[r++]=i/256,He[r++]=i}if(typeof e.uid=="number"&&typeof e.gid=="number"){t|=ri.UIDGID;let i=e.uid,n=e.gid;He[r++]=i>>>24,He[r++]=i>>>16,He[r++]=i>>>8,He[r++]=i,He[r++]=n>>>24,He[r++]=n>>>16,He[r++]=n>>>8,He[r++]=n}if(typeof e.mode=="number"||typeof e.mode=="string"){let i=pA(e.mode);t|=ri.PERMISSIONS,He[r++]=i>>>24,He[r++]=i>>>16,He[r++]=i>>>8,He[r++]=i}if((typeof e.atime=="number"||sA(e.atime))&&(typeof e.mtime=="number"||sA(e.mtime))){let i=Ls(e.atime),n=Ls(e.mtime);t|=ri.ACMODTIME,He[r++]=i>>>24,He[r++]=i>>>16,He[r++]=i>>>8,He[r++]=i,He[r++]=n>>>24,He[r++]=n>>>16,He[r++]=n>>>8,He[r++]=n}}return{flags:t,nb:r}}a(Io,"attrsToBytes");function Ls(e){if(typeof e=="number"&&e===e)return e;if(sA(e))return parseInt(e.getTime()/1e3,10);throw new Error(`Cannot parse time: ${e}`)}a(Ls,"toUnixTimestamp");function pA(e){if(typeof e=="number"&&e===e)return e;if(typeof e=="string")return pA(parseInt(e,8));throw new Error(`Cannot parse mode: ${e}`)}a(pA,"modeNum");var uA={r:$e.READ,"r+":$e.READ|$e.WRITE,w:$e.TRUNC|$e.CREAT|$e.WRITE,wx:$e.TRUNC|$e.CREAT|$e.WRITE|$e.EXCL,xw:$e.TRUNC|$e.CREAT|$e.WRITE|$e.EXCL,"w+":$e.TRUNC|$e.CREAT|$e.READ|$e.WRITE,"wx+":$e.TRUNC|$e.CREAT|$e.READ|$e.WRITE|$e.EXCL,"xw+":$e.TRUNC|$e.CREAT|$e.READ|$e.WRITE|$e.EXCL,a:$e.APPEND|$e.CREAT|$e.WRITE,ax:$e.APPEND|$e.CREAT|$e.WRITE|$e.EXCL,xa:$e.APPEND|$e.CREAT|$e.WRITE|$e.EXCL,"a+":$e.APPEND|$e.CREAT|$e.READ|$e.WRITE,"ax+":$e.APPEND|$e.CREAT|$e.READ|$e.WRITE|$e.EXCL,"xa+":$e.APPEND|$e.CREAT|$e.READ|$e.WRITE|$e.EXCL};function Lw(e){let t=uA[e];return t!==void 0?t:null}a(Lw,"stringToFlags");var i2=(()=>{let e=Object.keys(uA);return t=>{for(let r=0;r<e.length;++r){let i=e[r];if(uA[i]===t)return i}return null}})();function Us(e){let t=L.readUInt32BE();if(t===void 0)return;let r=new bp;if(t&ri.SIZE){let i=L.readUInt64BE(e);if(i===void 0)return;r.size=i}if(t&ri.UIDGID){let i=L.readUInt32BE(),n=L.readUInt32BE();if(n===void 0)return;r.uid=i,r.gid=n}if(t&ri.PERMISSIONS){let i=L.readUInt32BE();if(i===void 0)return;r.mode=i}if(t&ri.ACMODTIME){let i=L.readUInt32BE(),n=L.readUInt32BE();if(n===void 0)return;r.atime=i,r.mtime=n}if(t&ri.EXTENDED){let i=L.readUInt32BE();if(i===void 0)return;let n={};for(let o=0;o<i;++o){let s=L.readString(!0),c=L.readString();if(c===void 0)return;n[s]=c}r.extended=n}return r}a(Us,"readAttrs");function _t(e,t){let r=Uw(e,t);return r!==void 0?(e._buffer.push(r),!1):!0}a(_t,"sendOrBuffer");function Uw(e,t){let r=e.outgoing;if(r.state!=="open")return;if(r.window===0)return e._waitWindow=!0,e._chunkcb=Rw,t;let i,n=t.length,o=0;for(;n-o>0&&r.window>0;){let s=Math.min(n-o,r.window,r.packetSize);r.window-=s,r.window===0&&(e._waitWindow=!0,e._chunkcb=Rw),o===0&&s===n?e._protocol.channelData(e.outgoing.id,t):e._protocol.channelData(e.outgoing.id,Ms(t,o,o+s)),o+=s}return n-o>0&&(o>0?i=Ms(t,o,n):i=t),i}a(Uw,"tryWritePayload");function Rw(){this._chunkcb=void 0;let e=this._buffer,t=0;for(;t<e.length;){let r=e[t],i=Uw(this,r);if(i!==void 0){i!==r&&(e[t]=i),t>0&&(this._buffer=e.slice(t));return}++t}t>0&&(this._buffer=[])}a(Rw,"drainBuffer");function wt(e,t,r){let i=new Error(t);return i.level="sftp-protocol",!r&&e._debug&&e._debug(`SFTP: Inbound: ${t}`),e.emit("error",i),e.destroy(),Mw(e),!1}a(wt,"doFatalSFTPError");function Mw(e){let t=Object.keys(e._requests);if(t.length===0)return;let r=e._requests;e._requests={};let i=new Error("No response from server");for(let n=0;n<t.length;++n){let o=r[t[n]];typeof o.cb=="function"&&o.cb(i)}}a(Mw,"cleanupRequests");function o2(e,t){let r=9,i=Buffer.allocUnsafe(31);Y(i,i.length-4,0),i[4]=Ue.EXTENDED;let n=e._writeReqid=e._writeReqid+1&Nt;Y(i,n,5),Y(i,18,r),i.utf8Write("limits@openssh.com",r+=4,18),e._requests[n]={extended:"limits@openssh.com",cb:t};let o=_t(e,i);if(e._debug){let s=o?"Buffered":"Sending";e._debug(`SFTP: Outbound: ${s} limits@openssh.com`)}}a(o2,"requestLimits");var s2={[Gr.VERSION]:(e,t)=>{if(e._version!==-1)return wt(e,"Duplicate VERSION packet");let r={};L.init(t,1);let i=L.readUInt32BE();for(;L.avail();){let n=L.readString(!0),o=L.readString(!0);if(o===void 0){i=void 0;break}r[n]=o}if(L.clear(),i===void 0)return wt(e,"Malformed VERSION packet");if(e._debug){let n=Object.keys(r);n.length?e._debug(`SFTP: Inbound: Received VERSION (v${i}, exts:${n})`):e._debug(`SFTP: Inbound: Received VERSION (v${i})`)}if(e._version=i,e._extensions=r,r["limits@openssh.com"]==="1")return o2(e,(n,o)=>{n||(o.maxPktLen>0&&(e._maxOutPktLen=o.maxPktLen),o.maxReadLen>0&&(e._maxReadLen=o.maxReadLen),o.maxWriteLen>0&&(e._maxWriteLen=o.maxWriteLen),e.maxOpenHandles=o.maxOpenHandles>0?o.maxOpenHandles:1/0),e.emit("ready")});e.emit("ready")},[Gr.STATUS]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readUInt32BE(),n=L.readString(!0);if(L.clear(),e._debug){let s=JSON.stringify(n);e._debug(`SFTP: Inbound: Received STATUS (id:${r}, ${i}, ${s})`)}let o=e._requests[r];if(delete e._requests[r],o&&typeof o.cb=="function"){if(i===xt.OK){o.cb();return}let s=new Error(n||XD[i]||"Unknown status");s.code=i,o.cb(s)}},[Gr.HANDLE]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString();if(L.clear(),i===void 0)return r!==void 0&&delete e._requests[r],wt(e,"Malformed HANDLE packet");e._debug&&e._debug(`SFTP: Inbound: Received HANDLE (id:${r})`);let n=e._requests[r];delete e._requests[r],n&&typeof n.cb=="function"&&n.cb(void 0,i)},[Gr.DATA]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i;if(r!==void 0&&(i=e._requests[r],delete e._requests[r]),i&&typeof i.cb=="function")if(i.buffer){let n=L.readString(i.buffer);if(L.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${n})`),i.cb(void 0,i.buffer,n);return}}else{let n=L.readString();if(L.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${n.length})`),i.cb(void 0,n);return}}else{let n=L.skipString();if(L.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received DATA (id:${r}, ${n})`);return}}return wt(e,"Malformed DATA packet")},[Gr.NAME]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i;r!==void 0&&(i=e._requests[r],delete e._requests[r]);let n=L.readUInt32BE();if(n!==void 0){let o=[];for(let s=0;s<n;++s){let c=L.readString(!0),u=L.readString(!0),l=Us(e._biOpt);if(l===void 0){o=void 0;break}o.push({filename:c,longname:u,attrs:l})}if(o!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received NAME (id:${r}, ${o.length})`),L.clear(),i&&typeof i.cb=="function"&&i.cb(void 0,o);return}}return L.clear(),wt(e,"Malformed NAME packet")},[Gr.ATTRS]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i;r!==void 0&&(i=e._requests[r],delete e._requests[r]);let n=Us(e._biOpt);if(L.clear(),n!==void 0){e._debug&&e._debug(`SFTP: Inbound: Received ATTRS (id:${r})`),i&&typeof i.cb=="function"&&i.cb(void 0,n);return}return wt(e,"Malformed ATTRS packet")},[Gr.EXTENDED]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE();if(r!==void 0){let i=e._requests[r];if(i)switch(delete e._requests[r],i.extended){case"statvfs@openssh.com":case"fstatvfs@openssh.com":{let n=e._biOpt,o={f_bsize:L.readUInt64BE(n),f_frsize:L.readUInt64BE(n),f_blocks:L.readUInt64BE(n),f_bfree:L.readUInt64BE(n),f_bavail:L.readUInt64BE(n),f_files:L.readUInt64BE(n),f_ffree:L.readUInt64BE(n),f_favail:L.readUInt64BE(n),f_sid:L.readUInt64BE(n),f_flag:L.readUInt64BE(n),f_namemax:L.readUInt64BE(n)};if(o.f_namemax===void 0)break;e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${i.extended})`),L.clear(),typeof i.cb=="function"&&i.cb(void 0,o);return}case"limits@openssh.com":{let n={maxPktLen:L.readUInt64BE(),maxReadLen:L.readUInt64BE(),maxWriteLen:L.readUInt64BE(),maxOpenHandles:L.readUInt64BE()};if(n.maxOpenHandles===void 0)break;e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${i.extended})`),L.clear(),typeof i.cb=="function"&&i.cb(void 0,n);return}case"users-groups-by-id@openssh.com":{let n=L.readUInt32BE();if(n===void 0)break;let o=new Array(n);for(let u=0;u<o.length;++u)o[u]=L.readString(!0);let s=L.readUInt32BE();if(s===void 0)break;let c=new Array(s);for(let u=0;u<c.length;++u)c[u]=L.readString(!0);if(c.length>0&&c[c.length-1]===void 0)break;e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ${i.extended})`),L.clear(),typeof i.cb=="function"&&i.cb(void 0,o,c);return}default:e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),L.clear(),typeof i.cb=="function"&&i.cb();return}else{e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED_REPLY (id:${r}, ???)`),L.clear();return}}return L.clear(),wt(e,"Malformed EXTENDED_REPLY packet")}},a2={[Ue.INIT]:(e,t)=>{if(e._version!==-1)return wt(e,"Duplicate INIT packet");let r={};L.init(t,1);let i=L.readUInt32BE();for(;L.avail();){let n=L.readString(!0),o=L.readString(!0);if(o===void 0){i=void 0;break}r[n]=o}if(L.clear(),i===void 0)return wt(e,"Malformed INIT packet");if(e._debug){let n=Object.keys(r);n.length?e._debug(`SFTP: Inbound: Received INIT (v${i}, exts:${n})`):e._debug(`SFTP: Inbound: Received INIT (v${i})`)}_t(e,e2),e._version=i,e._extensions=r,e.emit("ready")},[Ue.OPEN]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0),n=L.readUInt32BE(),o=Us(e._biOpt);if(L.clear(),o===void 0)return wt(e,"Malformed OPEN packet");e._debug&&e._debug(`SFTP: Inbound: Received OPEN (id:${r})`),e.emit("OPEN",r,i,n,o)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.CLOSE]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString();if(L.clear(),i===void 0||i.length>256)return wt(e,"Malformed CLOSE packet");e._debug&&e._debug(`SFTP: Inbound: Received CLOSE (id:${r})`),e.emit("CLOSE",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.READ]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(),n=L.readUInt64BE(e._biOpt),o=L.readUInt32BE();if(L.clear(),o===void 0||i.length>256)return wt(e,"Malformed READ packet");e._debug&&e._debug(`SFTP: Inbound: Received READ (id:${r})`),e.emit("READ",r,i,n,o)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.WRITE]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(),n=L.readUInt64BE(e._biOpt),o=L.readString();if(L.clear(),o===void 0||i.length>256)return wt(e,"Malformed WRITE packet");e._debug&&e._debug(`SFTP: Inbound: Received WRITE (id:${r})`),e.emit("WRITE",r,i,n,o)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.LSTAT]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(L.clear(),i===void 0)return wt(e,"Malformed LSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received LSTAT (id:${r})`),e.emit("LSTAT",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.FSTAT]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString();if(L.clear(),i===void 0||i.length>256)return wt(e,"Malformed FSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received FSTAT (id:${r})`),e.emit("FSTAT",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.SETSTAT]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0),n=Us(e._biOpt);if(L.clear(),n===void 0)return wt(e,"Malformed SETSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received SETSTAT (id:${r})`),e.emit("SETSTAT",r,i,n)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.FSETSTAT]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(),n=Us(e._biOpt);if(L.clear(),n===void 0||i.length>256)return wt(e,"Malformed FSETSTAT packet");e._debug&&e._debug(`SFTP: Inbound: Received FSETSTAT (id:${r})`),e.emit("FSETSTAT",r,i,n)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.OPENDIR]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(L.clear(),i===void 0)return wt(e,"Malformed OPENDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received OPENDIR (id:${r})`),e.emit("OPENDIR",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.READDIR]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString();if(L.clear(),i===void 0||i.length>256)return wt(e,"Malformed READDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received READDIR (id:${r})`),e.emit("READDIR",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.REMOVE]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(L.clear(),i===void 0)return wt(e,"Malformed REMOVE packet");e._debug&&e._debug(`SFTP: Inbound: Received REMOVE (id:${r})`),e.emit("REMOVE",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.MKDIR]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0),n=Us(e._biOpt);if(L.clear(),n===void 0)return wt(e,"Malformed MKDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received MKDIR (id:${r})`),e.emit("MKDIR",r,i,n)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.RMDIR]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(L.clear(),i===void 0)return wt(e,"Malformed RMDIR packet");e._debug&&e._debug(`SFTP: Inbound: Received RMDIR (id:${r})`),e.emit("RMDIR",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.REALPATH]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(L.clear(),i===void 0)return wt(e,"Malformed REALPATH packet");e._debug&&e._debug(`SFTP: Inbound: Received REALPATH (id:${r})`),e.emit("REALPATH",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.STAT]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(L.clear(),i===void 0)return wt(e,"Malformed STAT packet");e._debug&&e._debug(`SFTP: Inbound: Received STAT (id:${r})`),e.emit("STAT",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.RENAME]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0),n=L.readString(!0);if(L.clear(),n===void 0)return wt(e,"Malformed RENAME packet");e._debug&&e._debug(`SFTP: Inbound: Received RENAME (id:${r})`),e.emit("RENAME",r,i,n)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.READLINK]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(L.clear(),i===void 0)return wt(e,"Malformed READLINK packet");e._debug&&e._debug(`SFTP: Inbound: Received READLINK (id:${r})`),e.emit("READLINK",r,i)||e.status(r,xt.OP_UNSUPPORTED)},[Ue.SYMLINK]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0),n=L.readString(!0);if(L.clear(),n===void 0)return wt(e,"Malformed SYMLINK packet");e._debug&&e._debug(`SFTP: Inbound: Received SYMLINK (id:${r})`);let o;e._isOpenSSH?o=e.emit("SYMLINK",r,n,i):o=e.emit("SYMLINK",r,i,n),o||e.status(r,xt.OP_UNSUPPORTED)},[Ue.EXTENDED]:(e,t)=>{L.init(t,1);let r=L.readUInt32BE(),i=L.readString(!0);if(i===void 0)return L.clear(),wt(e,"Malformed EXTENDED packet");let n;L.avail()&&(n=L.readRaw()),L.clear(),e._debug&&e._debug(`SFTP: Inbound: Received EXTENDED (id:${r})`),e.emit("EXTENDED",r,i,n)||e.status(r,xt.OP_UNSUPPORTED)}},{ERR_INVALID_ARG_TYPE:c2,ERR_OUT_OF_RANGE:Ap,validateNumber:u2}=Tw(),Ow=128,Fr,lA=[];function l2(e){lA.length>0?Fr=lA.pop():Fr=Buffer.allocUnsafe(e),Fr.used=0}a(l2,"allocNewPool");function fA(e,t){if(!Number.isSafeInteger(e))throw u2(e,t),Number.isInteger(e)?new Ap(t,">= 0 and <= 2 ** 53 - 1",e):new Ap(t,"an integer",e);if(e<0)throw new Ap(t,">= 0 and <= 2 ** 53 - 1",e)}a(fA,"checkPosition");function oA(e){return e+7&-8}a(oA,"roundUpToMultipleOf8");function ni(e,t,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}if(r.highWaterMark===void 0&&(r.highWaterMark=64*1024),r.emitClose=!1,r.autoDestroy=!1,$w.call(this,r),this.path=t,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesRead=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=e,this._opening=!1,this.start!==void 0&&(fA(this.start,"start"),this.pos=this.start),this.end===void 0)this.end=1/0;else if(this.end!==1/0&&(fA(this.end,"end"),this.start!==void 0&&this.start>this.end))throw new Ap("start",`<= "end" (here: ${this.end})`,this.start);this.on("end",function(){this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}a(ni,"ReadStream");Dw(ni,$w);ni.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(e,t)=>{if(this._opening=!1,e){this.emit("error",e),this.autoClose&&this.destroy();return}this.handle=t,this.emit("open",t),this.emit("ready"),this.read()}))};ni.prototype._read=function(e){if(!Buffer.isBuffer(this.handle))return this.once("open",()=>this._read(e));if(this.destroyed)return;(!Fr||Fr.length-Fr.used<Ow)&&l2(this.readableHighWaterMark||this._readableState.highWaterMark);let t=Fr,r=Math.min(Fr.length-Fr.used,e),i=Fr.used;if(this.end!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);this.sftp.read(this.handle,Fr,Fr.used,r,this.pos,(n,o)=>{if(n){this.emit("error",n),this.autoClose&&this.destroy();return}let s=null;if(i+r===t.used&&t===Fr)t.used=oA(t.used+o-r);else{let c=i+r&-8,u=oA(i+o);c-u>=Ow&&lA.push(t.slice(u,c))}o>0&&(this.bytesRead+=o,s=t.slice(i,i+o)),this.pos+=o,this.push(s)}),Fr.used=oA(Fr.used+r)};ni.prototype._destroy=function(e,t){if(this._opening&&!Buffer.isBuffer(this.handle)){this.once("open",Nw.bind(null,this,t,e));return}Nw(this,t,e),this.handle=null,this._opening=!1};function Nw(e,t,r){if(!e.handle)return i();e.sftp.close(e.handle,i);function i(n){n=n||r,t(n),e.isClosed=!0,n||e.emit("close")}a(i,"onclose")}a(Nw,"closeStream");ni.prototype.close=function(e){this.destroy(null,e)};Object.defineProperty(ni.prototype,"pending",{get(){return this.handle===null},configurable:!0});function gn(e,t,r){if(r===void 0)r={};else if(typeof r=="string")r={encoding:r};else{if(r===null||typeof r!="object")throw new TypeError('"options" argument must be a string or an object');r=Object.create(r)}r.emitClose=!1,r.autoDestroy=!1,dA.call(this,r),this.path=t,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=0,this.bytesWritten=0,this.isClosed=!1,this.handle=r.handle===void 0?null:r.handle,this.sftp=e,this._opening=!1,this.start!==void 0&&(fA(this.start,"start"),this.pos=this.start),r.encoding&&this.setDefaultEncoding(r.encoding),this.on("finish",function(){this._writableState.finalCalled||this.autoClose&&this.destroy()}),Buffer.isBuffer(this.handle)||this.open()}a(gn,"WriteStream");Dw(gn,dA);gn.prototype._final=function(e){this.autoClose&&this.destroy(),e()};gn.prototype.open=function(){this._opening||(this._opening=!0,this.sftp.open(this.path,this.flags,this.mode,(e,t)=>{if(this._opening=!1,e){this.emit("error",e),this.autoClose&&this.destroy();return}this.handle=t;let r=a(i=>{if(i){this.sftp.chmod(this.path,this.mode,n=>r());return}if(this.flags[0]==="a"){let n=a((o,s)=>{if(o){this.sftp.stat(this.path,(c,u)=>{if(c){this.destroy(),this.emit("error",o);return}n(null,u)});return}this.pos=s.size,this.emit("open",t),this.emit("ready")},"tryStat");this.sftp.fstat(t,n);return}this.emit("open",t),this.emit("ready")},"tryAgain");this.sftp.fchmod(t,this.mode,r)}))};gn.prototype._write=function(e,t,r){if(!Buffer.isBuffer(e)){let i=new c2("data","Buffer",e);return this.emit("error",i)}if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._write(e,t,r)});this.sftp.write(this.handle,e,0,e.length,this.pos,(i,n)=>{if(i)return this.autoClose&&this.destroy(),r(i);this.bytesWritten+=n,r()}),this.pos+=e.length};gn.prototype._writev=function(e,t){if(!Buffer.isBuffer(this.handle))return this.once("open",function(){this._writev(e,t)});let r=this.sftp,i=this.handle,n=e.length,o=a((s,c)=>{if(s)return this.destroy(),t(s);this.bytesWritten+=c,--n===0&&t()},"onwrite");for(let s=0;s<e.length;++s){let c=e[s].chunk;r.write(i,c,0,c.length,this.pos,o),this.pos+=c.length}};typeof dA.prototype.destroy!="function"&&(gn.prototype.destroy=ni.prototype.destroy);gn.prototype._destroy=ni.prototype._destroy;gn.prototype.close=function(e){if(e){if(this.isClosed){process.nextTick(e);return}this.on("close",e)}this.autoClose||this.on("finish",this.destroy.bind(this)),this.end()};gn.prototype.destroySoon=gn.prototype.end;Object.defineProperty(gn.prototype,"pending",{get(){return this.handle===null},configurable:!0});Fw.exports={flagsToString:i2,OPEN_MODE:$e,SFTP:aA,Stats:bp,STATUS_CODE:xt,stringToFlags:Lw}});var EA=me((i7,qw)=>{"use strict";var{Duplex:f2,Readable:d2,Writable:p2}=require("stream"),{CHANNEL_EXTENDED_DATATYPE:{STDERR:Hw}}=Jn(),{bufferSlice:xp}=In(),h2=32*1024,Tu=2*1024*1024,_A=Tu/2,hA=class extends d2{static{a(this,"ClientStderr")}constructor(t,r){super(r),this._channel=t}_read(t){this._channel._waitChanDrain&&(this._channel._waitChanDrain=!1,this._channel.incoming.window<=_A&&yA(this._channel))}},gA=class extends p2{static{a(this,"ServerStderr")}constructor(t){super({highWaterMark:Tu}),this._channel=t}_write(t,r,i){let n=this._channel,o=n._client._protocol,s=n.outgoing,c=s.packetSize,u=s.id,l=s.window,f=t.length,p=0;if(s.state==="open"){for(;f-p>0&&l>0;){let g=f-p;g>l&&(g=l),g>c&&(g=c),p===0&&g===f?o.channelExtData(u,t,Hw):o.channelExtData(u,xp(t,p,p+g),Hw),p+=g,l-=g}if(s.window=l,f-p>0){l===0&&(n._waitWindow=!0),p>0?n._chunkErr=xp(t,p,f):n._chunkErr=t,n._chunkcbErr=i;return}i()}}},mA=class extends f2{static{a(this,"Channel")}constructor(t,r,i){let n={highWaterMark:Tu,allowHalfOpen:!i||i&&i.allowHalfOpen!==!1,emitClose:!1};super(n),this.allowHalfOpen=n.allowHalfOpen;let o=!!(i&&i.server);this.server=o,this.type=r.type,this.subtype=void 0,this.incoming=r.incoming,this.outgoing=r.outgoing,this._callbacks=[],this._client=t,this._hasX11=!1,this._exit={code:void 0,signal:void 0,dump:void 0,desc:void 0},this.stdin=this.stdout=this,o?this.stderr=new gA(this):this.stderr=new hA(this,n),this._waitWindow=!1,this._waitChanDrain=!1,this._chunk=void 0,this._chunkcb=void 0,this._chunkErr=void 0,this._chunkcbErr=void 0,this.on("finish",jw).on("prefinish",jw),this.on("end",Ww).on("close",Ww)}_read(t){this._waitChanDrain&&(this._waitChanDrain=!1,this.incoming.window<=_A&&yA(this))}_write(t,r,i){let n=this._client._protocol,o=this.outgoing,s=o.packetSize,c=o.id,u=o.window,l=t.length,f=0;if(o.state==="open"){for(;l-f>0&&u>0;){let p=l-f;p>u&&(p=u),p>s&&(p=s),f===0&&p===l?n.channelData(c,t):n.channelData(c,xp(t,f,f+p)),f+=p,u-=p}if(o.window=u,l-f>0){u===0&&(this._waitWindow=!0),f>0?this._chunk=xp(t,f,l):this._chunk=t,this._chunkcb=i;return}i()}}eof(){this.outgoing.state==="open"&&(this.outgoing.state="eof",this._client._protocol.channelEOF(this.outgoing.id))}close(){(this.outgoing.state==="open"||this.outgoing.state==="eof")&&(this.outgoing.state="closing",this._client._protocol.channelClose(this.outgoing.id))}destroy(){return this.end(),this.close(),this}setWindow(t,r,i,n){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&(this.subtype==="shell"||this.subtype==="exec")&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.windowChange(this.outgoing.id,t,r,i,n)}signal(t){if(this.server)throw new Error("Client-only method called in server mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&this._client._protocol.signal(this.outgoing.id,t)}exit(t,r,i){if(!this.server)throw new Error("Server-only method called in client mode");this.type==="session"&&this.writable&&this.outgoing.state==="open"&&(typeof t=="number"?this._client._protocol.exitStatus(this.outgoing.id,t):this._client._protocol.exitSignal(this.outgoing.id,t,r,i))}};function jw(){this.eof(),(this.server||!this.allowHalfOpen)&&this.close(),this.writable=!1}a(jw,"onFinish");function Ww(){this.readable=!1}a(Ww,"onEnd");function yA(e){if(e.outgoing.state==="closed")return;let t=Tu-e.incoming.window;t<=0||(e.incoming.window+=t,e._client._protocol.channelWindowAdjust(e.outgoing.id,t))}a(yA,"windowAdjust");qw.exports={Channel:mA,MAX_WINDOW:Tu,PACKET_SIZE:h2,windowAdjust:yA,WINDOW_THRESHOLD:_A}});var xA=me((s7,Qw)=>{"use strict";var{SFTP:g2}=Pu(),ku=2**32-1;function Vw(e,t,r,i){if(e._chanMgr.remove(t),typeof i!="function")return;let n;r instanceof Error?n=r:typeof r=="object"&&r!==null?(n=new Error(`(SSH) Channel open failure: ${r.description}`),n.reason=r.reason):(n=new Error("(SSH) Channel open failure: server closed channel unexpectedly"),n.reason=""),i(n)}a(Vw,"onChannelOpenFailure");function Zw(e,t,r,i,n){if(typeof r=="function"){Vw(e,t,i,r);return}if(typeof r!="object"||r===null||r.incoming&&r.incoming.state==="closed"||(e._chanMgr.remove(t),r.server&&r.constructor.name==="Session"))return;r.incoming.state="closed",r.readable&&r.push(null),r.server?r.stderr.writable&&r.stderr.end():r.stderr.readable&&r.stderr.push(null),r.constructor!==g2&&(r.outgoing.state==="open"||r.outgoing.state==="eof")&&!n&&r.close(),r.outgoing.state==="closing"&&(r.outgoing.state="closed");let o=r._readableState,s=r._writableState;s&&!s.ending&&!s.finished&&!n&&r.end();let c=r._callbacks;r._callbacks=[];for(let u=0;u<c.length;++u)c[u](!0);if(r.server)!r.readable||r.destroyed||o&&o.endEmitted?r.emit("close"):r.once("end",()=>r.emit("close"));else{let u;switch(r.type){case"direct-streamlocal@openssh.com":case"direct-tcpip":u=a(()=>r.emit("close"),"doClose");break;default:{let f=r._exit;u=a(()=>{f.code===null?r.emit("close",f.code,f.signal,f.dump,f.desc):r.emit("close",f.code)},"doClose")}}!r.readable||r.destroyed||o&&o.endEmitted?u():r.once("end",u);let l=r.stderr._readableState;!r.stderr.readable||r.stderr.destroyed||l&&l.endEmitted?r.stderr.emit("close"):r.stderr.once("end",()=>r.stderr.emit("close"))}}a(Zw,"onCHANNEL_CLOSE");var bA=class{static{a(this,"ChannelManager")}constructor(t){this._client=t,this._channels={},this._cur=-1,this._count=0}add(t){let r;if(this._cur<ku)r=++this._cur;else if(this._count===0)this._cur=0,r=0;else{let i=this._channels;for(let n=0;n<ku;++n)if(i[n]===void 0){r=n;break}}return r===void 0?-1:(this._channels[r]=t||!0,++this._count,r)}update(t,r){if(typeof t!="number"||t<0||t>=ku||!isFinite(t))throw new Error(`Invalid channel id: ${t}`);r&&this._channels[t]&&(this._channels[t]=r)}get(t){if(typeof t!="number"||t<0||t>=ku||!isFinite(t))throw new Error(`Invalid channel id: ${t}`);return this._channels[t]}remove(t){if(typeof t!="number"||t<0||t>=ku||!isFinite(t))throw new Error(`Invalid channel id: ${t}`);this._channels[t]&&(delete this._channels[t],this._count&&--this._count)}cleanup(t){let r=this._channels;this._channels={},this._cur=-1,this._count=0;let i=Object.keys(r),n=this._client;for(let o=0;o<i.length;++o){let s=+i[o],c=r[s];Zw(n,s,c._channel||c,t,!0)}}},AA=(()=>{let e=Object.prototype.toString;return t=>e.call(t)==="[object RegExp]"})();function m2(e,t,r){if(Array.isArray(e)&&e.length>0){for(let i=0;i<e.length;++i)if(r.indexOf(e[i])===-1)throw new Error(`Unsupported algorithm: ${e[i]}`);return e}if(typeof e=="object"&&e!==null){let i=Object.keys(e),n=t;for(let o=0;o<i.length;++o){let s=i[o],c=e[s];switch(s){case"append":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let u=0;u<c.length;++u){let l=c[u];if(typeof l=="string"){if(!l||n.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);n===t&&(n=n.slice()),n.push(l)}else if(AA(l))for(let f=0;f<r.length;++f){let p=r[f];if(l.test(p)){if(n.indexOf(p)!==-1)continue;n===t&&(n=n.slice()),n.push(p)}}}break;case"prepend":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let u=c.length;u>=0;--u){let l=c[u];if(typeof l=="string"){if(!l||n.indexOf(l)!==-1)continue;if(r.indexOf(l)===-1)throw new Error(`Unsupported algorithm: ${l}`);n===t&&(n=n.slice()),n.unshift(l)}else if(AA(l))for(let f=r.length;f>=0;--f){let p=r[f];if(l.test(p)){if(n.indexOf(p)!==-1)continue;n===t&&(n=n.slice()),n.unshift(p)}}}break;case"remove":if(Array.isArray(c)||(c=[c]),Array.isArray(c))for(let u=0;u<c.length;++u){let l=c[u];if(typeof l=="string"){if(!l)continue;let f=n.indexOf(l);if(f===-1)continue;n===t&&(n=n.slice()),n.splice(f,1)}else if(AA(l))for(let f=0;f<n.length;++f)l.test(n[f])&&(n===t&&(n=n.slice()),n.splice(f,1),--f)}break}}return n}return t}a(m2,"generateAlgorithmList");Qw.exports={ChannelManager:bA,generateAlgorithmList:m2,onChannelOpenFailure:Vw,onCHANNEL_CLOSE:Zw,isWritable:a(e=>e&&e.writable&&e._readableState&&e._readableState.ended===!1,"isWritable")}});var PA=me((c7,mP)=>{"use strict";var{createHash:_2,getHashes:y2,randomFillSync:E2}=require("crypto"),{Socket:A2}=require("net"),{lookup:b2}=require("dns"),x2=require("events"),I2=y2(),{COMPAT:pP,CHANNEL_EXTENDED_DATATYPE:{STDERR:v2},CHANNEL_OPEN_FAILURE:Cu,DEFAULT_CIPHER:Kw,DEFAULT_COMPRESSION:Gw,DEFAULT_KEX:Yw,DEFAULT_MAC:Xw,DEFAULT_SERVER_HOST_KEY:Jw,DISCONNECT_REASON:eP,DISCONNECT_REASON_BY_VALUE:S2,SUPPORTED_CIPHER:w2,SUPPORTED_COMPRESSION:P2,SUPPORTED_KEX:T2,SUPPORTED_MAC:k2,SUPPORTED_SERVER_HOST_KEY:C2}=Jn(),{init:R2}=Pi(),O2=nA(),{parseKey:Sp}=Ci(),{SFTP:N2}=Pu(),{bufferCopy:tP,makeBufferParser:hP,makeError:$2,readUInt32BE:D2,sigSSHToASN1:B2,writeUInt32BE:IA}=In(),{AgentContext:rP,createAgent:nP,isAgent:iP}=HE(),{Channel:gP,MAX_WINDOW:wp,PACKET_SIZE:Pp,windowAdjust:oP,WINDOW_THRESHOLD:sP}=EA(),{ChannelManager:z2,generateAlgorithmList:Ru,isWritable:dr,onChannelOpenFailure:L2,onCHANNEL_CLOSE:U2}=xA(),Ip=hP(),vp=hP(),Ou=/^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/,SA=a(e=>{},"noop"),wA=class extends x2{static{a(this,"Client")}constructor(){super(),this.config={host:void 0,port:void 0,localAddress:void 0,localPort:void 0,forceIPv4:void 0,forceIPv6:void 0,keepaliveCountMax:void 0,keepaliveInterval:void 0,readyTimeout:void 0,ident:void 0,username:void 0,password:void 0,privateKey:void 0,tryKeyboard:void 0,agent:void 0,allowAgentFwd:void 0,authHandler:void 0,hostHashAlgo:void 0,hostHashCb:void 0,strictVendor:void 0,debug:void 0},this._agent=void 0,this._readyTimeout=void 0,this._chanMgr=void 0,this._callbacks=void 0,this._forwarding=void 0,this._forwardingUnix=void 0,this._acceptX11=void 0,this._agentFwdEnabled=void 0,this._remoteVer=void 0,this._protocol=void 0,this._sock=void 0,this._resetKA=void 0}connect(t){if(this._sock&&dr(this._sock))return this.once("close",()=>{this.connect(t)}),this.end(),this;this.config.host=t.hostname||t.host||"localhost",this.config.port=t.port||22,this.config.localAddress=typeof t.localAddress=="string"?t.localAddress:void 0,this.config.localPort=typeof t.localPort=="string"||typeof t.localPort=="number"?t.localPort:void 0,this.config.forceIPv4=t.forceIPv4||!1,this.config.forceIPv6=t.forceIPv6||!1,this.config.keepaliveCountMax=typeof t.keepaliveCountMax=="number"&&t.keepaliveCountMax>=0?t.keepaliveCountMax:3,this.config.keepaliveInterval=typeof t.keepaliveInterval=="number"&&t.keepaliveInterval>0?t.keepaliveInterval:0,this.config.readyTimeout=typeof t.readyTimeout=="number"&&t.readyTimeout>=0?t.readyTimeout:2e4,this.config.ident=typeof t.ident=="string"||Buffer.isBuffer(t.ident)?t.ident:void 0;let r={kex:void 0,serverHostKey:void 0,cs:{cipher:void 0,mac:void 0,compress:void 0,lang:[]},sc:void 0},i=!0;if(typeof t.algorithms=="object"&&t.algorithms!==null&&(r.kex=Ru(t.algorithms.kex,Yw,T2),r.kex!==Yw&&(i=!1),r.serverHostKey=Ru(t.algorithms.serverHostKey,Jw,C2),r.serverHostKey!==Jw&&(i=!1),r.cs.cipher=Ru(t.algorithms.cipher,Kw,w2),r.cs.cipher!==Kw&&(i=!1),r.cs.mac=Ru(t.algorithms.hmac,Xw,k2),r.cs.mac!==Xw&&(i=!1),r.cs.compress=Ru(t.algorithms.compress,Gw,P2),r.cs.compress!==Gw&&(i=!1),i||(r.sc=r.cs)),typeof t.username=="string")this.config.username=t.username;else if(typeof t.user=="string")this.config.username=t.user;else throw new Error("Invalid username");this.config.password=typeof t.password=="string"?t.password:void 0,this.config.privateKey=typeof t.privateKey=="string"||Buffer.isBuffer(t.privateKey)?t.privateKey:void 0,this.config.localHostname=typeof t.localHostname=="string"?t.localHostname:void 0,this.config.localUsername=typeof t.localUsername=="string"?t.localUsername:void 0,this.config.tryKeyboard=t.tryKeyboard===!0,typeof t.agent=="string"&&t.agent.length?this.config.agent=nP(t.agent):iP(t.agent)?this.config.agent=t.agent:this.config.agent=void 0,this.config.allowAgentFwd=t.agentForward===!0&&this.config.agent!==void 0;let n=this.config.authHandler=typeof t.authHandler=="function"||Array.isArray(t.authHandler)?t.authHandler:void 0;this.config.strictVendor=typeof t.strictVendor=="boolean"?t.strictVendor:!0;let o=this.config.debug=typeof t.debug=="function"?t.debug:void 0;if(t.agentForward===!0&&!this.config.allowAgentFwd)throw new Error("You must set a valid agent path to allow agent forwarding");let s=this._callbacks=[];this._chanMgr=new z2(this),this._forwarding={},this._forwardingUnix={},this._acceptX11=0,this._agentFwdEnabled=!1,this._agent=this.config.agent?this.config.agent:void 0,this._remoteVer=void 0;let c;if(this.config.privateKey){if(c=Sp(this.config.privateKey,t.passphrase),c instanceof Error)throw new Error(`Cannot parse privateKey: ${c.message}`);if(Array.isArray(c)&&(c=c[0]),c.getPrivatePEM()===null)throw new Error("privateKey value does not contain a (valid) private key")}let u;if(typeof t.hostVerifier=="function"){let O=t.hostVerifier,q;I2.indexOf(t.hostHash)!==-1&&(q=t.hostHash),u=a((V,re)=>{q&&(V=_2(q).update(V).digest("hex"));let _e=O(V,re);_e!==void 0&&re(_e)},"hostVerifier")}let l=this._sock=t.sock||new A2,f=!1,p=!1;this._protocol&&this._protocol.cleanup();let g=o?(O,q,V)=>{o(`Debug output from server: ${JSON.stringify(V)}`)}:void 0,h,_=this._protocol=new O2({ident:this.config.ident,offer:i?void 0:r,onWrite:a(O=>{dr(l)&&l.write(O)},"onWrite"),onError:a(O=>{O.level==="handshake"&&clearTimeout(this._readyTimeout),_._destruct||l.removeAllListeners("data"),this.emit("error",O);try{l.end()}catch{}},"onError"),onHeader:a(O=>{p=!0,this._remoteVer=O.versions.software,O.greeting&&this.emit("greeting",O.greeting)},"onHeader"),onHandshakeComplete:a(O=>{this.emit("handshake",O),f||(f=!0,_.service("ssh-userauth"))},"onHandshakeComplete"),debug:o,hostVerifier:u,messageHandlers:{DEBUG:g,DISCONNECT:a((O,q,V)=>{if(q!==eP.BY_APPLICATION){V||(V=S2[q],V===void 0&&(V=`Unexpected disconnection reason: ${q}`));let re=new Error(V);re.code=q,this.emit("error",re)}l.end()},"DISCONNECT"),SERVICE_ACCEPT:a((O,q)=>{q==="ssh-userauth"&&z()},"SERVICE_ACCEPT"),EXT_INFO:a((O,q)=>{if(h===void 0){for(let V of q)if(V.name==="server-sig-algs"){h=V.algs;return}h=null}},"EXT_INFO"),USERAUTH_BANNER:a((O,q)=>{this.emit("banner",q)},"USERAUTH_BANNER"),USERAUTH_SUCCESS:a(O=>{R(),clearTimeout(this._readyTimeout),this.emit("ready")},"USERAUTH_SUCCESS"),USERAUTH_FAILURE:a((O,q,V)=>{if(P.keyAlgos){let re=P.keyAlgos[0][0];if(o&&o(`Client: ${P.type} (${re}) auth failed`),P.keyAlgos.shift(),P.keyAlgos.length){let[_e,ve]=P.keyAlgos[0];switch(P.type){case"agent":_.authPK(P.username,P.agentCtx.currentKey(),_e);return;case"publickey":_.authPK(P.username,P.key,_e);return;case"hostbased":_.authHostbased(P.username,P.key,P.localHostname,P.localUsername,_e,(xe,Tt)=>{let Mt=P.key.sign(xe,ve);if(Mt instanceof Error)return Mt.message=`Error while signing with key: ${Mt.message}`,Mt.level="client-authentication",this.emit("error",Mt),z();Tt(Mt)});return}}else P.keyAlgos=void 0}if(P.type==="agent"){let re=P.agentCtx.pos();return o&&o(`Client: Agent key #${re+1} failed`),X()}o&&o(`Client: ${P.type} auth failed`),C=V,H=q,z()},"USERAUTH_FAILURE"),USERAUTH_PASSWD_CHANGEREQ:a((O,q)=>{P.type==="password"&&this.emit("change password",q,V=>{_.authPassword(this.config.username,this.config.password,V)})},"USERAUTH_PASSWD_CHANGEREQ"),USERAUTH_PK_OK:a(O=>{let q,V;if(P.keyAlgos&&([q,V]=P.keyAlgos[0]),P.type==="agent"){let re=P.agentCtx.currentKey();_.authPK(P.username,re,q,(_e,ve)=>{let xe={hash:V};P.agentCtx.sign(re,_e,xe,(Tt,Mt)=>{if(Tt)Tt.level="agent",this.emit("error",Tt);else return ve(Mt);X()})})}else P.type==="publickey"&&_.authPK(P.username,P.key,q,(re,_e)=>{let ve=P.key.sign(re,V);if(ve instanceof Error)return ve.message=`Error signing data with key: ${ve.message}`,ve.level="client-authentication",this.emit("error",ve),z();_e(ve)})},"USERAUTH_PK_OK"),USERAUTH_INFO_REQUEST:a((O,q,V,re)=>{if(P.type==="keyboard-interactive"){if((Array.isArray(re)?re.length:0)===0){o&&o("Client: Sending automatic USERAUTH_INFO_RESPONSE"),_.authInfoRes();return}P.prompt(q,V,"",re,ve=>{_.authInfoRes(ve)})}},"USERAUTH_INFO_REQUEST"),REQUEST_SUCCESS:a((O,q)=>{s.length&&s.shift()(!1,q)},"REQUEST_SUCCESS"),REQUEST_FAILURE:a(O=>{s.length&&s.shift()(!0)},"REQUEST_FAILURE"),GLOBAL_REQUEST:a((O,q,V,re)=>{q==="hostkeys-00@openssh.com"?(W2(this,re,(_e,ve)=>{_e||this.emit("hostkeys",ve)}),V&&_.requestSuccess()):V&&_.requestFailure()},"GLOBAL_REQUEST"),CHANNEL_OPEN:a((O,q)=>{H2(this,q)},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:a((O,q)=>{let V=this._chanMgr.get(q.recipient);if(typeof V!="function")return;let re=V.type==="sftp",ve={type:re?"session":V.type,incoming:{id:q.recipient,window:wp,packetSize:Pp,state:"open"},outgoing:{id:q.sender,window:q.window,packetSize:q.packetSize,state:"open"}},xe=re?new N2(this,ve,{debug:o}):new gP(this,ve);this._chanMgr.update(q.recipient,xe),V(void 0,xe)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:a((O,q,V,re)=>{let _e=this._chanMgr.get(q);if(typeof _e!="function")return;L2(this,q,{reason:V,description:re},_e)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:a((O,q,V)=>{let re=this._chanMgr.get(q);if(!(typeof re!="object"||re===null)&&re.incoming.window!==0){if(re.incoming.window-=V.length,re.push(V)===!1){re._waitChanDrain=!0;return}re.incoming.window<=sP&&oP(re)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:a((O,q,V,re)=>{if(re!==v2)return;let _e=this._chanMgr.get(q);if(!(typeof _e!="object"||_e===null)&&_e.incoming.window!==0){if(_e.incoming.window-=V.length,!_e.stderr.push(V)){_e._waitChanDrain=!0;return}_e.incoming.window<=sP&&oP(_e)}},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:a((O,q,V)=>{let re=this._chanMgr.get(q);typeof re!="object"||re===null||(re.outgoing.window+=V,re._waitWindow&&(re._waitWindow=!1,re._chunk?re._write(re._chunk,null,re._chunkcb):re._chunkcb?re._chunkcb():re._chunkErr?re.stderr._write(re._chunkErr,null,re._chunkcbErr):re._chunkcbErr&&re._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:a((O,q)=>{let V=this._chanMgr.get(q);typeof V!="object"||V===null||(this._resetKA(),V._callbacks.length&&V._callbacks.shift()(!1))},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:a((O,q)=>{let V=this._chanMgr.get(q);typeof V!="object"||V===null||(this._resetKA(),V._callbacks.length&&V._callbacks.shift()(!0))},"CHANNEL_FAILURE"),CHANNEL_REQUEST:a((O,q,V,re,_e)=>{let ve=this._chanMgr.get(q);if(typeof ve!="object"||ve===null)return;let xe=ve._exit;if(xe.code===void 0){switch(V){case"exit-status":ve.emit("exit",xe.code=_e);return;case"exit-signal":ve.emit("exit",xe.code=null,xe.signal=`SIG${_e.signal}`,xe.dump=_e.coreDumped,xe.desc=_e.errorMessage);return}re&&O.channelFailure(ve.outgoing.id)}},"CHANNEL_REQUEST"),CHANNEL_EOF:a((O,q)=>{let V=this._chanMgr.get(q);typeof V!="object"||V===null||V.incoming.state==="open"&&(V.incoming.state="eof",V.readable&&V.push(null),V.stderr.readable&&V.stderr.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:a((O,q)=>{U2(this,q,this._chanMgr.get(q))},"CHANNEL_CLOSE")}});l.pause();let y=this.config.keepaliveInterval,b=this.config.keepaliveCountMax,v=0,S,M=a(()=>{if(++v>b){if(clearInterval(S),l.readable){let O=new Error("Keepalive timeout");O.level="client-timeout",this.emit("error",O),l.destroy()}return}dr(l)?(s.push(R),_.ping()):clearInterval(S)},"sendKA");function R(){y>0&&(v=0,clearInterval(S),dr(l)&&(S=setInterval(M,y)))}a(R,"resetKA"),this._resetKA=R;let J=(()=>{let O=!1;return()=>{if(!O&&(O=!0,ee&&!p)){let q=$2("Connection lost before handshake","protocol",!0);this.emit("error",q)}}})(),te=(()=>{let O=!1;return()=>{O||(O=!0,ee=!0,o&&o("Socket connected"),this.emit("connect"),R2.then(()=>{_.start(),l.on("data",q=>{try{_.parse(q,0,q.length)}catch(V){this.emit("error",V);try{dr(l)&&l.end()}catch{}}}),l.stderr&&typeof l.stderr.resume=="function"&&l.stderr.resume(),l.resume()}).catch(q=>{this.emit("error",q);try{dr(l)&&l.end()}catch{}}))}})(),ee=!1;l.on("connect",te).on("timeout",()=>{this.emit("timeout")}).on("error",O=>{o&&o(`Socket error: ${O.message}`),clearTimeout(this._readyTimeout),O.level="client-socket",this.emit("error",O)}).on("end",()=>{o&&o("Socket ended"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(S),this.emit("end")}).on("close",()=>{o&&o("Socket closed"),J(),_.cleanup(),clearTimeout(this._readyTimeout),clearInterval(S),this.emit("close");let O=s;s=this._callbacks=[];let q=new Error("No response from server");for(let V=0;V<O.length;++V)O[V](q);this._chanMgr.cleanup(q)});let P,C=null,H=null,U=["none"];this.config.password!==void 0&&U.push("password"),c!==void 0&&U.push("publickey"),this._agent!==void 0&&U.push("agent"),this.config.tryKeyboard&&U.push("keyboard-interactive"),c!==void 0&&this.config.localHostname!==void 0&&this.config.localUsername!==void 0&&U.push("hostbased"),Array.isArray(n)?n=dP(n):typeof n!="function"&&(n=dP(U));let k=!1,j=a(O=>{if(!k){if(k=!0,O===!1){let q=new Error("All configured authentication methods failed");q.level="client-authentication",this.emit("error",q),this.end();return}if(typeof O=="string"){let q=O;if(U.indexOf(q)===-1)return W(`Authentication method not allowed: ${q}`);let V=this.config.username;switch(q){case"password":O={type:q,username:V,password:this.config.password};break;case"publickey":O={type:q,username:V,key:c};break;case"hostbased":O={type:q,username:V,key:c,localHostname:this.config.localHostname,localUsername:this.config.localUsername};break;case"agent":O={type:q,username:V,agentCtx:new rP(this._agent)};break;case"keyboard-interactive":O={type:q,username:V,prompt:a((...re)=>this.emit("keyboard-interactive",...re),"prompt")};break;case"none":O={type:q,username:V};break;default:return W(`Skipping unsupported authentication method: ${O}`)}}else{if(typeof O!="object"||O===null)return W(`Skipping invalid authentication attempt: ${O}`);{let q=O.username;if(typeof q!="string")return W(`Skipping invalid authentication attempt: ${O}`);let V=O.type;switch(V){case"password":{let{password:re}=O;if(typeof re!="string"&&!Buffer.isBuffer(re))return W("Skipping invalid password auth attempt");O={type:V,username:q,password:re};break}case"publickey":{let re=Sp(O.key,O.passphrase);if(re instanceof Error)return W("Skipping invalid key auth attempt");if(!re.isPrivateKey())return W("Skipping non-private key");O={type:V,username:q,key:re};break}case"hostbased":{let{localHostname:re,localUsername:_e}=O,ve=Sp(O.key,O.passphrase);if(ve instanceof Error||typeof re!="string"||typeof _e!="string")return W("Skipping invalid hostbased auth attempt");if(!ve.isPrivateKey())return W("Skipping non-private key");O={type:V,username:q,key:ve,localHostname:re,localUsername:_e};break}case"agent":{let re=O.agent;if(typeof re=="string"&&re.length)re=nP(re);else if(!iP(re))return W(`Skipping invalid agent: ${O.agent}`);O={type:V,username:q,agentCtx:new rP(re)};break}case"keyboard-interactive":{let{prompt:re}=O;if(typeof re!="function")return W("Skipping invalid keyboard-interactive auth attempt");O={type:V,username:q,prompt:re};break}case"none":O={type:V,username:q};break;default:return W(`Skipping unsupported authentication method: ${O}`)}}}P=O;try{let q=P.username;switch(P.type){case"password":_.authPassword(q,P.password);break;case"publickey":{let V;if(P.keyAlgos=vA(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)V=P.keyAlgos[0][0];else return W("Skipping key authentication (no mutual hash algorithm)");_.authPK(q,P.key,V);break}case"hostbased":{let V,re;if(P.keyAlgos=vA(this,P.key,h),P.keyAlgos)if(P.keyAlgos.length)[V,re]=P.keyAlgos[0];else return W("Skipping hostbased authentication (no mutual hash algorithm)");_.authHostbased(q,P.key,P.localHostname,P.localUsername,V,(_e,ve)=>{let xe=P.key.sign(_e,re);if(xe instanceof Error)return xe.message=`Error while signing with key: ${xe.message}`,xe.level="client-authentication",this.emit("error",xe),z();ve(xe)});break}case"agent":P.agentCtx.init(V=>{if(V)return V.level="agent",this.emit("error",V),z();X()});break;case"keyboard-interactive":_.authKeyboard(q);break;case"none":_.authNone(q);break}}finally{k=!1}}},"doNextAuth");function W(O){o&&o(O),process.nextTick(z)}a(W,"skipAuth");function z(){k=!1;let O=n(H,C,j);k||O===void 0||j(O)}a(z,"tryNextAuth");let X=a(()=>{if(P.type==="agent"){let O=P.agentCtx.nextKey();if(O===!1)o&&o("Agent: No more keys left to try"),o&&o("Client: agent auth failed"),z();else{let q=P.agentCtx.pos(),V;if(P.keyAlgos=vA(this,O,h),P.keyAlgos)if(P.keyAlgos.length)V=P.keyAlgos[0][0];else{o&&o(`Agent: Skipping key #${q+1} (no mutual hash algorithm)`),X();return}o&&o(`Agent: Trying key #${q+1}`),_.authPK(P.username,O,V)}}},"tryNextAgentKey"),ne=a(()=>{this.config.readyTimeout>0&&(this._readyTimeout=setTimeout(()=>{let O=new Error("Timed out while waiting for handshake");O.level="client-timeout",this.emit("error",O),l.destroy()},this.config.readyTimeout))},"startTimeout");if(t.sock)ne(),typeof l.connecting=="boolean"&&l.connecting||te();else{let O=this.config.host,q=this.config.forceIPv4,V=this.config.forceIPv6;o&&o(`Client: Trying ${O} on port ${this.config.port} ...`);let re=a(()=>{ne(),l.connect({host:O,port:this.config.port,localAddress:this.config.localAddress,localPort:this.config.localPort}),l.setMaxListeners(0),l.setTimeout(typeof t.timeout=="number"?t.timeout:0)},"doConnect");!q&&!V||q&&V?re():b2(O,q?4:6,(_e,ve,xe)=>{if(_e){let Tt=q?"IPv4":"IPv6",Mt=new Error(`Error while looking up ${Tt} address for '${O}': ${_e}`);clearTimeout(this._readyTimeout),Mt.level="client-dns",this.emit("error",Mt),this.emit("close");return}O=ve,re()})}return this}end(){return this._sock&&dr(this._sock)&&(this._protocol.disconnect(eP.BY_APPLICATION),this._sock.end()),this}destroy(){return this._sock&&dr(this._sock)&&this._sock.destroy(),this}exec(t,r,i){if(!this._sock||!dr(this._sock))throw new Error("Not connected");typeof r=="function"&&(i=r,r={});let n={allowHalfOpen:r.allowHalfOpen!==!1};return Fs(this,"session",n,(o,s)=>{if(o){i(o);return}let c=[];function u(l){if(l){s.close(),i(l);return}c.length&&c.shift()()}a(u,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&c.push(()=>uP(s,u)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&lP(s,r.env),(typeof r.pty=="object"&&r.pty!==null||r.pty===!0)&&c.push(()=>cP(s,r.pty,u)),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&c.push(()=>aP(s,r.x11,u))),c.push(()=>F2(s,t,r,i)),c.shift()()}),this}shell(t,r,i){if(!this._sock||!dr(this._sock))throw new Error("Not connected");return typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),t&&(t.x11!==void 0||t.env!==void 0)&&(r=t,t=void 0),Fs(this,"session",(n,o)=>{if(n){i(n);return}let s=[];function c(u){if(u){o.close(),i(u);return}s.length&&s.shift()()}a(c,"reqCb"),(this.config.allowAgentFwd===!0||r&&r.agentForward===!0&&this._agent!==void 0)&&s.push(()=>uP(o,c)),t!==!1&&s.push(()=>cP(o,t,c)),typeof r=="object"&&r!==null&&(typeof r.env=="object"&&r.env!==null&&lP(o,r.env),(typeof r.x11=="object"&&r.x11!==null||r.x11==="number"||r.x11===!0)&&s.push(()=>aP(o,r.x11,c))),s.push(()=>M2(o,i)),s.shift()()}),this}subsys(t,r){if(!this._sock||!dr(this._sock))throw new Error("Not connected");return Fs(this,"session",(i,n)=>{if(i){r(i);return}fP(n,t,(o,s)=>{if(o){r(o);return}r(void 0,s)})}),this}forwardIn(t,r,i){if(!this._sock||!dr(this._sock))throw new Error("Not connected");let n=typeof i=="function";return n&&this._callbacks.push((o,s)=>{if(o){i(o!==!0?o:new Error(`Unable to bind to ${t}:${r}`));return}let c=r;r===0&&s&&s.length>=4&&(c=D2(s,0),this._protocol._compatFlags&pP.DYN_RPORT_BUG||(r=c)),this._forwarding[`${t}:${r}`]=c,i(void 0,c)}),this._protocol.tcpipForward(t,r,n),this}unforwardIn(t,r,i){if(!this._sock||!dr(this._sock))throw new Error("Not connected");let n=typeof i=="function";return n&&this._callbacks.push(o=>{if(o){i(o!==!0?o:new Error(`Unable to unbind from ${t}:${r}`));return}delete this._forwarding[`${t}:${r}`],i()}),this._protocol.cancelTcpipForward(t,r,n),this}forwardOut(t,r,i,n,o){if(!this._sock||!dr(this._sock))throw new Error("Not connected");let s={srcIP:t,srcPort:r,dstIP:i,dstPort:n};return typeof o!="function"&&(o=SA),Fs(this,"direct-tcpip",s,o),this}openssh_noMoreSessions(t){if(!this._sock||!dr(this._sock))throw new Error("Not connected");let r=typeof t=="function";return!this.config.strictVendor||this.config.strictVendor&&Ou.test(this._remoteVer)?(r&&this._callbacks.push(i=>{if(i){t(i!==!0?i:new Error("Unable to disable future sessions"));return}t()}),this._protocol.openssh_noMoreSessions(r),this):r?(process.nextTick(t,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardInStreamLocal(t,r){if(!this._sock||!dr(this._sock))throw new Error("Not connected");let i=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&Ou.test(this._remoteVer)?(i&&this._callbacks.push(n=>{if(n){r(n!==!0?n:new Error(`Unable to bind to ${t}`));return}this._forwardingUnix[t]=!0,r()}),this._protocol.openssh_streamLocalForward(t,i),this):i?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_unforwardInStreamLocal(t,r){if(!this._sock||!dr(this._sock))throw new Error("Not connected");let i=typeof r=="function";return!this.config.strictVendor||this.config.strictVendor&&Ou.test(this._remoteVer)?(i&&this._callbacks.push(n=>{if(n){r(n!==!0?n:new Error(`Unable to unbind from ${t}`));return}delete this._forwardingUnix[t],r()}),this._protocol.openssh_cancelStreamLocalForward(t,i),this):i?(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this):this}openssh_forwardOutStreamLocal(t,r){if(!this._sock||!dr(this._sock))throw new Error("Not connected");return typeof r!="function"&&(r=SA),!this.config.strictVendor||this.config.strictVendor&&Ou.test(this._remoteVer)?(Fs(this,"direct-streamlocal@openssh.com",{socketPath:t},r),this):(process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version")),this)}sftp(t){if(!this._sock||!dr(this._sock))throw new Error("Not connected");return Fs(this,"sftp",(r,i)=>{if(r){t(r);return}fP(i,"sftp",(n,o)=>{if(n){t(n);return}function s(){i.removeListener("ready",c),i.removeListener("error",u),i.removeListener("exit",l),i.removeListener("close",l)}a(s,"removeListeners");function c(){s(),t(void 0,i)}a(c,"onReady");function u(f){s(),t(f)}a(u,"onError");function l(f,p){s();let g;typeof f=="number"?g=`Received exit code ${f} while establishing SFTP session`:p!==void 0?g=`Received signal ${p} while establishing SFTP session`:g="Received unexpected SFTP session termination";let h=new Error(g);h.code=f,h.signal=p,t(h)}a(l,"onExit"),i.on("ready",c).on("error",u).on("exit",l).on("close",l),i._init()})}),this}setNoDelay(t){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(t),this}};function Fs(e,t,r,i){let n=wp,o=Pp;typeof r=="function"&&(i=r,r={});let s=a((u,l)=>{i(u,l)},"wrapper");s.type=t;let c=e._chanMgr.add(s);if(c===-1){i(new Error("No free channels available"));return}switch(t){case"session":case"sftp":e._protocol.session(c,n,o);break;case"direct-tcpip":e._protocol.directTcpip(c,n,o,r);break;case"direct-streamlocal@openssh.com":e._protocol.openssh_directStreamLocal(c,n,o,r);break;default:throw new Error(`Unsupported channel type: ${t}`)}}a(Fs,"openChannel");function aP(e,t,r){let i={single:!1,protocol:"MIT-MAGIC-COOKIE-1",cookie:void 0,screen:0};typeof t=="function"?r=t:typeof t=="object"&&t!==null&&(typeof t.single=="boolean"&&(i.single=t.single),typeof t.screen=="number"&&(i.screen=t.screen),typeof t.protocol=="string"&&(i.protocol=t.protocol),typeof t.cookie=="string"?i.cookie=t.cookie:Buffer.isBuffer(t.cookie)&&(i.cookie=t.cookie.hexSlice(0,t.cookie.length))),i.cookie===void 0&&(i.cookie=j2());let n=typeof r=="function";if(e.outgoing.state!=="open"){n&&r(new Error("Channel is not open"));return}n&&e._callbacks.push(o=>{if(o){r(o!==!0?o:new Error("Unable to request X11"));return}e._hasX11=!0,++e._client._acceptX11,e.once("close",()=>{e._client._acceptX11&&--e._client._acceptX11}),r()}),e._client._protocol.x11Forward(e.outgoing.id,i,n)}a(aP,"reqX11");function cP(e,t,r){let i=24,n=80,o=640,s=480,c="vt100",u=null;typeof t=="function"?r=t:typeof t=="object"&&t!==null&&(typeof t.rows=="number"&&(i=t.rows),typeof t.cols=="number"&&(n=t.cols),typeof t.width=="number"&&(o=t.width),typeof t.height=="number"&&(s=t.height),typeof t.term=="string"&&(c=t.term),typeof t.modes=="object"&&(u=t.modes));let l=typeof r=="function";if(e.outgoing.state!=="open"){l&&r(new Error("Channel is not open"));return}l&&e._callbacks.push(f=>{if(f){r(f!==!0?f:new Error("Unable to request a pseudo-terminal"));return}r()}),e._client._protocol.pty(e.outgoing.id,i,n,s,o,c,u,l)}a(cP,"reqPty");function uP(e,t){let r=typeof t=="function";if(e.outgoing.state!=="open"){r&&t(new Error("Channel is not open"));return}if(e._client._agentFwdEnabled){r&&t(!1);return}e._client._agentFwdEnabled=!0,e._callbacks.push(i=>{if(i){e._client._agentFwdEnabled=!1,r&&t(i!==!0?i:new Error("Unable to request agent forwarding"));return}r&&t()}),e._client._protocol.openssh_agentForward(e.outgoing.id,!0)}a(uP,"reqAgentFwd");function M2(e,t){if(e.outgoing.state!=="open"){t(new Error("Channel is not open"));return}e._callbacks.push(r=>{if(r){t(r!==!0?r:new Error("Unable to open shell"));return}e.subtype="shell",t(void 0,e)}),e._client._protocol.shell(e.outgoing.id,!0)}a(M2,"reqShell");function F2(e,t,r,i){if(e.outgoing.state!=="open"){i(new Error("Channel is not open"));return}e._callbacks.push(n=>{if(n){i(n!==!0?n:new Error("Unable to exec"));return}e.subtype="exec",e.allowHalfOpen=r.allowHalfOpen!==!1,i(void 0,e)}),e._client._protocol.exec(e.outgoing.id,t,!0)}a(F2,"reqExec");function lP(e,t){if(e.outgoing.state!=="open")return;let r=Object.keys(t||{});for(let i=0;i<r.length;++i){let n=r[i],o=t[n];e._client._protocol.env(e.outgoing.id,n,o,!1)}}a(lP,"reqEnv");function fP(e,t,r){if(e.outgoing.state!=="open"){r(new Error("Channel is not open"));return}e._callbacks.push(i=>{if(i){r(i!==!0?i:new Error(`Unable to start subsystem: ${t}`));return}e.subtype="subsystem",r(void 0,e)}),e._client._protocol.subsystem(e.outgoing.id,t,!0)}a(fP,"reqSubsystem");function H2(e,t){let r=-1,i,n=a(()=>{let u={type:t.type,incoming:{id:r,window:wp,packetSize:Pp,state:"open"},outgoing:{id:t.sender,window:t.window,packetSize:t.packetSize,state:"open"}},l=new gP(e,u);return e._chanMgr.update(r,l),e._protocol.channelOpenConfirm(t.sender,r,wp,Pp),l},"accept"),o=a(()=>{i===void 0&&(r===-1?i=Cu.RESOURCE_SHORTAGE:i=Cu.CONNECT_FAILED),r!==-1&&e._chanMgr.remove(r),e._protocol.channelOpenFail(t.sender,i,"")},"reject"),s=a(()=>(r=e._chanMgr.add(),r===-1&&(i=Cu.RESOURCE_SHORTAGE,e.config.debug&&e.config.debug("Client: Automatic rejection of incoming channel open: no channels available")),r!==-1),"reserveChannel"),c=t.data;switch(t.type){case"forwarded-tcpip":{let u=e._forwarding[`${c.destIP}:${c.destPort}`];if(u!==void 0&&s()){c.destPort===0&&(c.destPort=u),e.emit("tcp connection",c,n,o);return}break}case"forwarded-streamlocal@openssh.com":if(e._forwardingUnix[c.socketPath]!==void 0&&s()){e.emit("unix connection",c,n,o);return}break;case"auth-agent@openssh.com":if(e._agentFwdEnabled&&typeof e._agent.getStream=="function"&&s()){e._agent.getStream((u,l)=>{if(u)return o();let f=n();f.pipe(l).pipe(f)});return}break;case"x11":if(e._acceptX11!==0&&s()){e.emit("x11",c,n,o);return}break;default:i=Cu.UNKNOWN_CHANNEL_TYPE,e.config.debug&&e.config.debug(`Client: Automatic rejection of unsupported incoming channel open type: ${t.type}`)}i===void 0&&(i=Cu.ADMINISTRATIVELY_PROHIBITED,e.config.debug&&e.config.debug("Client: Automatic rejection of unexpected incoming channel open for: "+t.type)),o()}a(H2,"onCHANNEL_OPEN");var j2=(()=>{let e=Buffer.allocUnsafe(16);return()=>(E2(e,0,16),e.hexSlice(0,16))})();function dP(e){if(!Array.isArray(e))throw new Error("authList must be an array");let t=0;return(r,i,n)=>t===e.length?!1:e[t++]}a(dP,"makeSimpleAuthHandler");function W2(e,t,r){if(!e._sock||!dr(e._sock))return;if(typeof r!="function"&&(r=SA),!Array.isArray(t))throw new TypeError("Invalid keys argument type");let i=[];for(let n of t){let o=Sp(n);if(o instanceof Error)throw o;i.push(o)}if(!e.config.strictVendor||e.config.strictVendor&&Ou.test(e._remoteVer)){e._callbacks.push((n,o)=>{if(n){r(n!==!0?n:new Error("Server failed to prove supplied keys"));return}let s=[],c=0;for(Ip.init(o,0);Ip.avail()&&c!==i.length;){let u=i[c++],l=u.getPublicSSH(),f=Ip.readString();vp.init(f,0);let p=vp.readString(!0),g=vp.readString(),h;if(p!==u.type)if(u.type==="ssh-rsa")switch(p){case"rsa-sha2-256":h="sha256";break;case"rsa-sha2-512":h="sha512";break;default:continue}else continue;let _=e._protocol._kex.sessionID,y=Buffer.allocUnsafe(37+_.length+4+l.length),b=0;IA(y,29,b),y.utf8Write("hostkeys-prove-00@openssh.com",b+=4,29),IA(y,_.length,b+=29),tP(_,y,0,_.length,b+=4),IA(y,l.length,b+=_.length),tP(l,y,0,l.length,b+=4),(g=B2(g,p))&&u.verify(y,g,h)===!0&&s.push(u)}vp.clear(),Ip.clear(),r(null,s)}),e._protocol.openssh_hostKeysProve(i);return}process.nextTick(r,new Error("strictVendor enabled and server is not OpenSSH or compatible version"))}a(W2,"hostKeysProve");function vA(e,t,r){switch(t.type){case"ssh-rsa":if(e._protocol._compatFlags&pP.IMPLY_RSA_SHA2_SIGALGS&&(Array.isArray(r)?r=["rsa-sha2-256","rsa-sha2-512",...r]:r=["rsa-sha2-256","rsa-sha2-512"]),Array.isArray(r)){if(r.indexOf("rsa-sha2-256")!==-1)return[["rsa-sha2-256","sha256"]];if(r.indexOf("rsa-sha2-512")!==-1)return[["rsa-sha2-512","sha512"]];if(r.indexOf("ssh-rsa")===-1)return[]}return[["ssh-rsa","sha1"]]}}a(vA,"getKeyAlgos");mP.exports=wA});var yP=me(_P=>{"use strict";var{Agent:kA}=require("http"),{Agent:q2}=require("https"),{connect:V2}=require("tls"),TA;for(let e of[kA,q2]){class t extends e{static{a(this,"SSHAgent")}constructor(i,n){super(n),this._connectCfg=i,this._defaultSrcIP=n&&n.srcIP||"localhost"}createConnection(i,n){let o=i&&i.localAddress||this._defaultSrcIP,s=i&&i.localPort||0,c=i.host,u=i.port;TA===void 0&&(TA=PA());let l=new TA,f=!1;l.on("ready",()=>{l.forwardOut(o,s,c,u,(p,g)=>{if(f=!0,p)return l.end(),n(p);g.once("close",()=>l.end()),n(null,Z2(g,e,i))})}).on("error",n).on("close",()=>{f||n(new Error("Unexpected connection close"))}).connect(this._connectCfg)}}_P[e===kA?"SSHTTPAgent":"SSHTTPSAgent"]=t}function Nu(){}a(Nu,"noop");function Z2(e,t,r){if(t===kA)return e.setKeepAlive=Nu,e.setNoDelay=Nu,e.setTimeout=Nu,e.ref=Nu,e.unref=Nu,e.destroySoon=e.destroy,e;r.socket=e;let i=V2(r),n=(()=>{let o=!1;return()=>{o||(o=!0,e.isPaused()&&e.resume())}})();return i.on("end",n).on("close",n),i}a(Z2,"decorateStream")});var AP=me((d7,NA)=>{"use strict";var{Server:Q2}=require("net"),Du=require("events"),{listenerCount:Nr}=Du,{CHANNEL_OPEN_FAILURE:Hs,DEFAULT_CIPHER:K2,DEFAULT_COMPRESSION:G2,DEFAULT_KEX:Y2,DEFAULT_MAC:X2,DEFAULT_SERVER_HOST_KEY:J2,DISCONNECT_REASON:js,DISCONNECT_REASON_BY_VALUE:eB,SUPPORTED_CIPHER:tB,SUPPORTED_COMPRESSION:rB,SUPPORTED_KEX:nB,SUPPORTED_MAC:iB,SUPPORTED_SERVER_HOST_KEY:oB}=Jn(),{init:sB}=Pi(),{KexInit:aB}=lp(),{parseKey:EP}=Ci(),cB=nA(),{SFTP:uB}=Pu(),{writeUInt32BE:lB}=In(),{Channel:Ws,MAX_WINDOW:Ni,PACKET_SIZE:$i,windowAdjust:fB,WINDOW_THRESHOLD:dB}=EA(),{ChannelManager:pB,generateAlgorithmList:$u,isWritable:Tp,onChannelOpenFailure:hB,onCHANNEL_CLOSE:gB}=xA(),mB=10,Di=class extends Du{static{a(this,"AuthContext")}constructor(t,r,i,n,o){super(),this.username=this.user=r,this.service=i,this.method=n,this._initialResponse=!1,this._finalResponse=!1,this._multistep=!1,this._cbfinal=(s,c,u)=>{this._finalResponse||(this._finalResponse=!0,o(this,s,c,u))},this._protocol=t}accept(){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!0)}reject(t,r){this._cleanup&&this._cleanup(),this._initialResponse=!0,this._cbfinal(!1,t,r)}},kp=class extends Di{static{a(this,"KeyboardAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this._multistep=!0,this._cb=void 0,this._onInfoResponse=c=>{let u=this._cb;u&&(this._cb=void 0,u(c))},this.submethods=o,this.on("abort",()=>{this._cb&&this._cb(new Error("Authentication request aborted"))})}prompt(t,r,i,n){Array.isArray(t)||(t=[t]),typeof r=="function"?(n=r,r=i=void 0):typeof i=="function"?(n=i,i=void 0):typeof n!="function"&&(n=void 0);for(let o=0;o<t.length;++o)typeof t[o]=="string"&&(t[o]={prompt:t[o],echo:!0});this._cb=n,this._initialResponse=!0,this._protocol.authInfoReq(r,i,t)}},RA=class extends Di{static{a(this,"PKAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob}accept(){this.signature?Di.prototype.accept.call(this):(this._initialResponse=!0,this._protocol.authPKOK(this.key.algo,this.key.data))}},OA=class extends Di{static{a(this,"HostbasedAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this.key={algo:o.keyAlgo,data:o.key},this.hashAlgo=o.hashAlgo,this.signature=o.signature,this.blob=o.blob,this.localHostname=o.localHostname,this.localUsername=o.localUsername}},Cp=class extends Di{static{a(this,"PwdAuthContext")}constructor(t,r,i,n,o,s){super(t,r,i,n,s),this.password=o,this._changeCb=void 0}requestChange(t,r){if(this._changeCb)throw new Error("Change request already in progress");if(typeof t!="string")throw new Error("prompt argument must be a string");if(typeof r!="function")throw new Error("Callback argument must be a function");this._changeCb=r,this._protocol.authPasswdChg(t)}},Bn=class extends Du{static{a(this,"Session")}constructor(t,r,i){super(),this.type="session",this.subtype=void 0,this.server=!0,this._ending=!1,this._channel=void 0,this._chanInfo={type:"session",incoming:{id:i,window:Ni,packetSize:$i,state:"open"},outgoing:{id:r.sender,window:r.window,packetSize:r.packetSize,state:"open"}}}},on=class extends Du{static{a(this,"Server")}constructor(t,r){if(super(),typeof t!="object"||t===null)throw new Error("Missing configuration object");let i=Object.create(null),n=[],o=t.hostKeys;if(!Array.isArray(o))throw new Error("hostKeys must be an array");let s=typeof t.algorithms=="object"&&t.algorithms!==null?t.algorithms:{},c=$u(s.serverHostKey,J2,oB);for(let g=0;g<o.length;++g){let h;if(Buffer.isBuffer(o[g])||typeof o[g]=="string"?h=EP(o[g]):h=EP(o[g].key,o[g].passphrase),h instanceof Error)throw new Error(`Cannot parse privateKey: ${h.message}`);if(Array.isArray(h)&&(h=h[0]),h.getPrivatePEM()===null)throw new Error("privateKey value contains an invalid private key");if(!n.includes(h.type))if(h.type==="ssh-rsa"){let _=c.indexOf("ssh-rsa"),y=c.indexOf("rsa-sha2-256"),b=c.indexOf("rsa-sha2-512");_===-1&&(_=1/0),[_,y,b].sort(_B).forEach(v=>{if(v===-1)return;let S;switch(v){case _:S="ssh-rsa";break;case y:S="rsa-sha2-256";break;case b:S="rsa-sha2-512";break;default:return}i[S]=h,n.push(S)})}else i[h.type]=h,n.push(h.type)}let u={kex:$u(s.kex,Y2,nB).concat(["kex-strict-s-v00@openssh.com"]),serverHostKey:n,cs:{cipher:$u(s.cipher,K2,tB),mac:$u(s.hmac,X2,iB),compress:$u(s.compress,G2,rB),lang:[]},sc:void 0};u.sc=u.cs,typeof r=="function"&&this.on("connection",r);let l=typeof t.debug=="function"?t.debug:void 0,f=t.ident?Buffer.from(t.ident):void 0,p=new aB(u);this._srv=new Q2(g=>{if(this._connections>=this.maxConnections){g.destroy();return}++this._connections,g.once("close",()=>{--this._connections});let h;if(l){let _=`[${process.hrtime().join(".")}] `;h=a(y=>{l(`${_}${y}`)},"debug")}new Rp(g,i,f,p,h,this,t)}).on("error",g=>{this.emit("error",g)}).on("listening",()=>{this.emit("listening")}).on("close",()=>{this.emit("close")}),this._connections=0,this.maxConnections=1/0}injectSocket(t){this._srv.emit("connection",t)}listen(...t){return this._srv.listen(...t),this}address(){return this._srv.address()}getConnections(t){return this._srv.getConnections(t),this}close(t){return this._srv.close(t),this}ref(){return this._srv.ref(),this}unref(){return this._srv.unref(),this}};on.KEEPALIVE_CLIENT_INTERVAL=15e3;on.KEEPALIVE_CLIENT_COUNT_MAX=3;var Rp=class extends Du{static{a(this,"Client")}constructor(t,r,i,n,o,s,c){super();let u=0,l=!1,f=[],p,g,h,_=[];this._sock=t,this._chanMgr=new pB(this),this._debug=o,this.noMoreSessions=!1,this.authenticated=!1;function y(ee){}a(y,"onClientPreHeaderError"),this.on("error",y);let b=o?(ee,P,C)=>{o(`Debug output from client: ${JSON.stringify(C)}`)}:void 0,v=typeof c.keepaliveInterval=="number"&&isFinite(c.keepaliveInterval)&&c.keepaliveInterval>0?c.keepaliveInterval:typeof on.KEEPALIVE_CLIENT_INTERVAL=="number"&&isFinite(on.KEEPALIVE_CLIENT_INTERVAL)&&on.KEEPALIVE_CLIENT_INTERVAL>0?on.KEEPALIVE_CLIENT_INTERVAL:-1,S=typeof c.keepaliveCountMax=="number"&&isFinite(c.keepaliveCountMax)&&c.keepaliveCountMax>=0?c.keepaliveCountMax:typeof on.KEEPALIVE_CLIENT_COUNT_MAX=="number"&&isFinite(on.KEEPALIVE_CLIENT_COUNT_MAX)&&on.KEEPALIVE_CLIENT_COUNT_MAX>=0?on.KEEPALIVE_CLIENT_COUNT_MAX:-1,M=0;v!==-1&&S!==-1&&(this.once("ready",()=>{let ee=a(()=>{clearInterval(g)},"onClose");this.on("close",ee).on("end",ee),g=setInterval(()=>{if(++M>S){clearInterval(g);let P=new Error("Keepalive timeout");P.level="client-timeout",this.emit("error",P),this.end()}else R.ping()},v)}),h=a(()=>{g&&g.refresh(),M=0},"onPacket"));let R=this._protocol=new cB({server:!0,hostKeys:r,ident:i,offer:n,onPacket:h,greeting:c.greeting,banner:c.banner,onWrite:a(ee=>{Tp(t)&&t.write(ee)},"onWrite"),onError:a(ee=>{R._destruct||t.removeAllListeners("data"),this.emit("error",ee);try{t.end()}catch{}},"onError"),onHeader:a(ee=>{this.removeListener("error",y);let P={ip:t.remoteAddress,family:t.remoteFamily,port:t.remotePort,header:ee};if(!s.emit("connection",this,P)){R.disconnect(js.BY_APPLICATION),t.end();return}ee.greeting&&this.emit("greeting",ee.greeting)},"onHeader"),onHandshakeComplete:a(ee=>{++u>1&&this.emit("rekey"),this.emit("handshake",ee)},"onHandshakeComplete"),debug:o,messageHandlers:{DEBUG:b,DISCONNECT:a((ee,P,C)=>{if(P!==js.BY_APPLICATION){C||(C=eB[P],C===void 0&&(C=`Unexpected disconnection reason: ${P}`));let H=new Error(C);H.code=P,this.emit("error",H)}t.end()},"DISCONNECT"),CHANNEL_OPEN:a((ee,P)=>{if(P.type==="session"&&this.noMoreSessions||!this.authenticated){let X=Hs.ADMINISTRATIVELY_PROHIBITED;return R.channelOpenFail(P.sender,X)}let C=-1,H,U=!1,k,j=a(()=>{U||(U=!0,H===void 0&&(C===-1?H=Hs.RESOURCE_SHORTAGE:H=Hs.CONNECT_FAILED),C!==-1&&this._chanMgr.remove(C),R.channelOpenFail(P.sender,H,""))},"reject"),W=a(()=>(C=this._chanMgr.add(),C===-1&&(H=Hs.RESOURCE_SHORTAGE,o&&o("Automatic rejection of incoming channel open: no channels available")),C!==-1),"reserveChannel"),z=P.data;switch(P.type){case"session":if(Nr(this,"session")&&W()){k=a(()=>{if(U)return;U=!0;let X=new Bn(this,P,C);return this._chanMgr.update(C,X),R.channelOpenConfirm(P.sender,C,Ni,$i),X},"accept"),this.emit("session",k,j);return}break;case"direct-tcpip":if(Nr(this,"tcpip")&&W()){k=a(()=>{if(U)return;U=!0;let X={type:void 0,incoming:{id:C,window:Ni,packetSize:$i,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},ne=new Ws(this,X,{server:!0});return this._chanMgr.update(C,ne),R.channelOpenConfirm(P.sender,C,Ni,$i),ne},"accept"),this.emit("tcpip",k,j,z);return}break;case"direct-streamlocal@openssh.com":if(Nr(this,"openssh.streamlocal")&&W()){k=a(()=>{if(U)return;U=!0;let X={type:void 0,incoming:{id:C,window:Ni,packetSize:$i,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},ne=new Ws(this,X,{server:!0});return this._chanMgr.update(C,ne),R.channelOpenConfirm(P.sender,C,Ni,$i),ne},"accept"),this.emit("openssh.streamlocal",k,j,z);return}break;default:H=Hs.UNKNOWN_CHANNEL_TYPE,o&&o(`Automatic rejection of unsupported incoming channel open type: ${P.type}`)}H===void 0&&(H=Hs.ADMINISTRATIVELY_PROHIBITED,o&&o(`Automatic rejection of unexpected incoming channel open for: ${P.type}`)),j()},"CHANNEL_OPEN"),CHANNEL_OPEN_CONFIRMATION:a((ee,P)=>{let C=this._chanMgr.get(P.recipient);if(typeof C!="function")return;let H={type:C.type,incoming:{id:P.recipient,window:Ni,packetSize:$i,state:"open"},outgoing:{id:P.sender,window:P.window,packetSize:P.packetSize,state:"open"}},U=new Ws(this,H,{server:!0});this._chanMgr.update(P.recipient,U),C(void 0,U)},"CHANNEL_OPEN_CONFIRMATION"),CHANNEL_OPEN_FAILURE:a((ee,P,C,H)=>{let U=this._chanMgr.get(P);if(typeof U!="function")return;hB(this,P,{reason:C,description:H},U)},"CHANNEL_OPEN_FAILURE"),CHANNEL_DATA:a((ee,P,C)=>{let H=this._chanMgr.get(P);if(!(typeof H!="object"||H===null)&&!(H.constructor===Bn&&(H=H._channel,!H))&&H.incoming.window!==0){if(H.incoming.window-=C.length,H.push(C)===!1){H._waitChanDrain=!0;return}H.incoming.window<=dB&&fB(H)}},"CHANNEL_DATA"),CHANNEL_EXTENDED_DATA:a((ee,P,C,H)=>{},"CHANNEL_EXTENDED_DATA"),CHANNEL_WINDOW_ADJUST:a((ee,P,C)=>{let H=this._chanMgr.get(P);typeof H!="object"||H===null||H.constructor===Bn&&(H=H._channel,!H)||(H.outgoing.window+=C,H._waitWindow&&(H._waitWindow=!1,H._chunk?H._write(H._chunk,null,H._chunkcb):H._chunkcb?H._chunkcb():H._chunkErr?H.stderr._write(H._chunkErr,null,H._chunkcbErr):H._chunkcbErr&&H._chunkcbErr()))},"CHANNEL_WINDOW_ADJUST"),CHANNEL_SUCCESS:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===Bn&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!1)},"CHANNEL_SUCCESS"),CHANNEL_FAILURE:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===Bn&&(C=C._channel,!C)||C._callbacks.length&&C._callbacks.shift()(!0)},"CHANNEL_FAILURE"),CHANNEL_REQUEST:a((ee,P,C,H,U)=>{let k=this._chanMgr.get(P);if(typeof k!="object"||k===null)return;let j=!1,W,z;if(k.constructor!==Bn){H&&R.channelFailure(k.outgoing.id);return}if(H&&(C!=="shell"&&C!=="exec"&&C!=="subsystem"&&(W=a(()=>{j||k._ending||k._channel||(j=!0,R.channelSuccess(k._chanInfo.outgoing.id))},"accept")),z=a(()=>{j||k._ending||k._channel||(j=!0,R.channelFailure(k._chanInfo.outgoing.id))},"reject")),k._ending){z&&z();return}switch(C){case"env":if(Nr(k,"env")){k.emit("env",W,z,{key:U.name,val:U.value});return}break;case"pty-req":if(Nr(k,"pty")){k.emit("pty",W,z,U);return}break;case"window-change":Nr(k,"window-change")?k.emit("window-change",W,z,U):z&&z();break;case"x11-req":if(Nr(k,"x11")){k.emit("x11",W,z,U);return}break;case"signal":if(Nr(k,"signal")){k.emit("signal",W,z,{name:U});return}break;case"auth-agent-req@openssh.com":if(Nr(k,"auth-agent")){k.emit("auth-agent",W,z);return}break;case"shell":if(Nr(k,"shell")){W=a(()=>{if(j||k._ending||k._channel)return;j=!0,H&&R.channelSuccess(k._chanInfo.outgoing.id);let X=new Ws(this,k._chanInfo,{server:!0});return X.subtype=k.subtype=C,k._channel=X,X},"accept"),k.emit("shell",W,z);return}break;case"exec":if(Nr(k,"exec")){W=a(()=>{if(j||k._ending||k._channel)return;j=!0,H&&R.channelSuccess(k._chanInfo.outgoing.id);let X=new Ws(this,k._chanInfo,{server:!0});return X.subtype=k.subtype=C,k._channel=X,X},"accept"),k.emit("exec",W,z,{command:U});return}break;case"subsystem":{let X=U==="sftp";if(W=a(()=>{if(j||k._ending||k._channel)return;j=!0,H&&R.channelSuccess(k._chanInfo.outgoing.id);let ne;return X?ne=new uB(this,k._chanInfo,{server:!0,debug:o}):(ne=new Ws(this,k._chanInfo,{server:!0}),ne.subtype=k.subtype=`${C}:${U}`),k._channel=ne,ne},"accept"),U==="sftp"){if(Nr(k,"sftp")){k.emit("sftp",W,z);return}X=!1}if(Nr(k,"subsystem")){k.emit("subsystem",W,z,{name:U});return}break}}o&&o(`Automatic rejection of incoming channel request: ${C}`),z&&z()},"CHANNEL_REQUEST"),CHANNEL_EOF:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===Bn&&(C._ending||(C._ending=!0,C.emit("eof"),C.emit("end")),C=C._channel,!C)||C.incoming.state==="open"&&(C.incoming.state="eof",C.readable&&C.push(null))},"CHANNEL_EOF"),CHANNEL_CLOSE:a((ee,P)=>{let C=this._chanMgr.get(P);typeof C!="object"||C===null||C.constructor===Bn&&(C._ending=!0,C.emit("close"),C=C._channel,!C)||gB(this,P,C)},"CHANNEL_CLOSE"),SERVICE_REQUEST:a((ee,P)=>{if(u===0||l||this.authenticated||P!=="ssh-userauth"){R.disconnect(js.SERVICE_NOT_AVAILABLE),t.end();return}l=!0,R.serviceAccept(P)},"SERVICE_REQUEST"),USERAUTH_REQUEST:a((ee,P,C,H,U)=>{if(u===0||this.authenticated||p&&(p.username!==P||p.service!==C)||H!=="password"&&H!=="publickey"&&H!=="hostbased"&&H!=="keyboard-interactive"&&H!=="none"||f.length===mB){R.disconnect(js.PROTOCOL_ERROR),t.end();return}else if(C!=="ssh-connection"){R.disconnect(js.SERVICE_NOT_AVAILABLE),t.end();return}let k;switch(H){case"keyboard-interactive":k=new kp(R,P,C,H,U,J);break;case"publickey":k=new RA(R,P,C,H,U,J);break;case"hostbased":k=new OA(R,P,C,H,U,J);break;case"password":if(p&&p instanceof Cp&&p._changeCb){let j=p._changeCb;p._changeCb=void 0,j(U.newPassword);return}k=new Cp(R,P,C,H,U,J);break;case"none":k=new Di(R,P,C,H,J);break}if(p)if(p._initialResponse)p._multistep&&!p._finalResponse&&(p._cleanup&&p._cleanup(),p.emit("abort"));else return f.push(k);p=k,Nr(this,"authentication")?this.emit("authentication",p):p.reject()},"USERAUTH_REQUEST"),USERAUTH_INFO_RESPONSE:a((ee,P)=>{p&&p instanceof kp&&p._onInfoResponse(P)},"USERAUTH_INFO_RESPONSE"),GLOBAL_REQUEST:a((ee,P,C,H)=>{let U={type:null,buf:null};function k(j,W){U.type=j,U.buf=W,te()}if(a(k,"setReply"),C&&_.push(U),(P==="tcpip-forward"||P==="cancel-tcpip-forward"||P==="no-more-sessions@openssh.com"||P==="streamlocal-forward@openssh.com"||P==="cancel-streamlocal-forward@openssh.com")&&Nr(this,"request")&&this.authenticated){let j,W;if(C){let z=!1;j=a(X=>{if(z)return;z=!0;let ne;P==="tcpip-forward"&&H.bindPort===0&&typeof X=="number"&&(ne=Buffer.allocUnsafe(4),lB(ne,X,0)),k("SUCCESS",ne)},"accept"),W=a(()=>{z||(z=!0,k("FAILURE"))},"reject")}if(P==="no-more-sessions@openssh.com"){this.noMoreSessions=!0,j&&j();return}this.emit("request",j,W,P,H)}else C&&k("FAILURE")},"GLOBAL_REQUEST")}});t.pause(),sB.then(()=>{R.start(),t.on("data",ee=>{try{R.parse(ee,0,ee.length)}catch(P){this.emit("error",P);try{Tp(t)&&t.end()}catch{}}}),t.resume()}).catch(ee=>{this.emit("error",ee);try{Tp(t)&&t.end()}catch{}}),t.on("error",ee=>{ee.level="socket",this.emit("error",ee)}).once("end",()=>{o&&o("Socket ended"),R.cleanup(),this.emit("end")}).once("close",()=>{o&&o("Socket closed"),R.cleanup(),this.emit("close");let ee=new Error("No response from server");this._chanMgr.cleanup(ee)});let J=a((ee,P,C,H)=>{p===ee&&!this.authenticated&&(P?(p=void 0,this.authenticated=!0,R.authSuccess(),f=[],this.emit("ready")):(R.authFailure(C,H),f.length&&(p=f.pop(),Nr(this,"authentication")?this.emit("authentication",p):p.reject())))},"onAuthDecide");function te(){for(;_.length>0&&_[0].type;){let ee=_.shift();ee.type==="SUCCESS"&&R.requestSuccess(ee.buf),ee.type==="FAILURE"&&R.requestFailure()}}a(te,"sendReplies")}end(){return this._sock&&Tp(this._sock)&&(this._protocol.disconnect(js.BY_APPLICATION),this._sock.end()),this}x11(t,r,i){return CA(this,"x11",{originAddr:t,originPort:r},i),this}forwardOut(t,r,i,n,o){return CA(this,"forwarded-tcpip",{boundAddr:t,boundPort:r,remoteAddr:i,remotePort:n},o),this}openssh_forwardOutStreamLocal(t,r){return CA(this,"forwarded-streamlocal@openssh.com",{socketPath:t},r),this}rekey(t){let r;try{this._protocol.rekey()}catch(i){r=i}typeof t=="function"&&(r?process.nextTick(t,r):this.once("rekey",t))}setNoDelay(t){return this._sock&&typeof this._sock.setNoDelay=="function"&&this._sock.setNoDelay(t),this}};function CA(e,t,r,i){let n=Ni,o=$i;typeof r=="function"&&(i=r,r={});let s=a((u,l)=>{i(u,l)},"wrapper");s.type=t;let c=e._chanMgr.add(s);if(c===-1){i(new Error("No free channels available"));return}switch(t){case"forwarded-tcpip":e._protocol.forwardedTcpip(c,n,o,r);break;case"x11":e._protocol.x11(c,n,o,r);break;case"forwarded-streamlocal@openssh.com":e._protocol.openssh_forwardedStreamLocal(c,n,o,r);break;default:throw new Error(`Unsupported channel type: ${t}`)}}a(CA,"openChannel");function _B(e,t){return e-t}a(_B,"compareNumbers");NA.exports=on;NA.exports.IncomingClient=Rp});var SP=me((h7,vP)=>{"use strict";var{createCipheriv:yB,generateKeyPair:EB,generateKeyPairSync:AB,getCurves:bB,randomBytes:bP}=require("crypto"),{Ber:Ht}=cu(),xB=eE().pbkdf,{CIPHER_INFO:IB}=Pi(),vB=16,SB=16,wB=bB(),PB=new Map(Object.entries(IB));function xP(e,t){if(typeof e!="string")throw new TypeError("Key type must be a string");let r={type:"spki",format:"der"},i={type:"pkcs8",format:"der"};switch(e.toLowerCase()){case"rsa":{if(typeof t!="object"||t===null)throw new TypeError("Missing options object for RSA key");let n=t.bits;if(!Number.isInteger(n))throw new TypeError("RSA bits must be an integer");if(n<=0||n>16384)throw new RangeError("RSA bits must be non-zero and <= 16384");return["rsa",{modulusLength:n,publicKeyEncoding:r,privateKeyEncoding:i}]}case"ecdsa":{if(typeof t!="object"||t===null)throw new TypeError("Missing options object for ECDSA key");if(!Number.isInteger(t.bits))throw new TypeError("ECDSA bits must be an integer");let n;switch(t.bits){case 256:n="prime256v1";break;case 384:n="secp384r1";break;case 521:n="secp521r1";break;default:throw new Error("ECDSA bits must be 256, 384, or 521")}if(!wB.includes(n))throw new Error("Unsupported ECDSA bits value");return["ec",{namedCurve:n,publicKeyEncoding:r,privateKeyEncoding:i}]}case"ed25519":return["ed25519",{publicKeyEncoding:r,privateKeyEncoding:i}];default:throw new Error(`Unsupported key type: ${e}`)}}a(xP,"makeArgs");function TB(e,t,r){switch(e){case"rsa":{let i=new Ht.Reader(r);if(i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in RSA private key");if(i.readSequence(),i.readOID()!=="1.2.840.113549.1.1.1")throw new Error("Bad RSA private OID");if(i.readByte()!==Ht.Null)throw new Error("Malformed RSA private key (expected null)");if(i.readByte()!==0)throw new Error("Malformed RSA private key (expected zero-length null)");if(i=new Ht.Reader(i.readString(Ht.OctetString,!0)),i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in RSA private key");let n=i.readString(Ht.Integer,!0),o=i.readString(Ht.Integer,!0),s=i.readString(Ht.Integer,!0),c=i.readString(Ht.Integer,!0),u=i.readString(Ht.Integer,!0);i.readString(Ht.Integer,!0),i.readString(Ht.Integer,!0);let l=i.readString(Ht.Integer,!0),f=Buffer.from("ssh-rsa"),p=Buffer.allocUnsafe(4+f.length+4+n.length+4+o.length+4+s.length+4+l.length+4+c.length+4+u.length),g=0;p.writeUInt32BE(f.length,g+=0),p.set(f,g+=4),p.writeUInt32BE(n.length,g+=f.length),p.set(n,g+=4),p.writeUInt32BE(o.length,g+=n.length),p.set(o,g+=4),p.writeUInt32BE(s.length,g+=o.length),p.set(s,g+=4),p.writeUInt32BE(l.length,g+=s.length),p.set(l,g+=4),p.writeUInt32BE(c.length,g+=l.length),p.set(c,g+=4),p.writeUInt32BE(u.length,g+=c.length),p.set(u,g+=4);let h=Buffer.allocUnsafe(4+f.length+4+o.length+4+n.length);return g=0,h.writeUInt32BE(f.length,g+=0),h.set(f,g+=4),h.writeUInt32BE(o.length,g+=f.length),h.set(o,g+=4),h.writeUInt32BE(n.length,g+=o.length),h.set(n,g+=4),{sshName:f.toString(),priv:p,pub:h}}case"ec":{let i=new Ht.Reader(t);if(i.readSequence(),i.readSequence(),i.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA public OID");i.readOID();let n=i.readString(Ht.BitString,!0);{let g=0;for(;g<n.length&&n[g]===0;++g);g>0&&(n=n.slice(g))}if(i=new Ht.Reader(r),i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in ECDSA private key");if(i.readSequence(),i.readOID()!=="1.2.840.10045.2.1")throw new Error("Bad ECDSA private OID");let o=i.readOID(),s;switch(o){case"1.2.840.10045.3.1.7":s="nistp256";break;case"1.3.132.0.34":s="nistp384";break;case"1.3.132.0.35":s="nistp521";break;default:throw new Error("Unsupported curve in ECDSA private key")}if(i=new Ht.Reader(i.readString(Ht.OctetString,!0)),i.readSequence(),i.readInt()!==1)throw new Error("Unsupported version in ECDSA private key");let c=Buffer.concat([Buffer.from([0]),i.readString(Ht.OctetString,!0)]),u=Buffer.from(`ecdsa-sha2-${s}`);s=Buffer.from(s);let l=Buffer.allocUnsafe(4+u.length+4+s.length+4+n.length+4+c.length),f=0;l.writeUInt32BE(u.length,f+=0),l.set(u,f+=4),l.writeUInt32BE(s.length,f+=u.length),l.set(s,f+=4),l.writeUInt32BE(n.length,f+=s.length),l.set(n,f+=4),l.writeUInt32BE(c.length,f+=n.length),l.set(c,f+=4);let p=Buffer.allocUnsafe(4+u.length+4+s.length+4+n.length);return f=0,p.writeUInt32BE(u.length,f+=0),p.set(u,f+=4),p.writeUInt32BE(s.length,f+=u.length),p.set(s,f+=4),p.writeUInt32BE(n.length,f+=s.length),p.set(n,f+=4),{sshName:u.toString(),priv:l,pub:p}}case"ed25519":{let i=new Ht.Reader(t);if(i.readSequence(),i.readSequence(),i.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 public OID");let n=i.readString(Ht.BitString,!0);{let f=0;for(;f<n.length&&n[f]===0;++f);f>0&&(n=n.slice(f))}if(i=new Ht.Reader(r),i.readSequence(),i.readInt()!==0)throw new Error("Unsupported version in ED25519 private key");if(i.readSequence(),i.readOID()!=="1.3.101.112")throw new Error("Bad ED25519 private OID");i=new Ht.Reader(i.readString(Ht.OctetString,!0));let o=i.readString(Ht.OctetString,!0),s=Buffer.from("ssh-ed25519"),c=Buffer.allocUnsafe(4+s.length+4+n.length+4+(o.length+n.length)),u=0;c.writeUInt32BE(s.length,u+=0),c.set(s,u+=4),c.writeUInt32BE(n.length,u+=s.length),c.set(n,u+=4),c.writeUInt32BE(o.length+n.length,u+=n.length),c.set(o,u+=4),c.set(n,u+=o.length);let l=Buffer.allocUnsafe(4+s.length+4+n.length);return u=0,l.writeUInt32BE(s.length,u+=0),l.set(s,u+=4),l.writeUInt32BE(n.length,u+=s.length),l.set(n,u+=4),{sshName:s.toString(),priv:c,pub:l}}}}a(TB,"parseDERs");function IP(e,t,r,i){let n="new",o,s="";if(typeof i=="object"&&i!==null&&(typeof i.comment=="string"&&i.comment&&(s=i.comment),typeof i.format=="string"&&i.format&&(n=i.format),i.passphrase)){let c;if(typeof i.passphrase=="string")c=Buffer.from(i.passphrase);else if(Buffer.isBuffer(i.passphrase))c=i.passphrase;else throw new Error("Invalid passphrase");if(i.cipher===void 0)throw new Error("Missing cipher name");let u=PB.get(i.cipher);if(u===void 0)throw new Error("Invalid cipher name");if(n==="new"){let l=SB;if(i.rounds!==void 0){if(!Number.isInteger(i.rounds))throw new TypeError("rounds must be an integer");i.rounds>0&&(l=i.rounds)}let f=Buffer.allocUnsafe(u.keyLen+u.ivLen),p=bP(vB);if(xB(c,c.length,p,p.length,f,f.length,l)!==0)return new Error("Failed to generate information to encrypt key");let h=Buffer.allocUnsafe(4+p.length+4);{let _=0;h.writeUInt32BE(p.length,_+=0),h.set(p,_+=4),h.writeUInt32BE(l,_+=p.length)}o={cipher:u,cipherName:i.cipher,kdfName:"bcrypt",kdfOptions:h,key:f.slice(0,u.keyLen),iv:f.slice(u.keyLen)}}}switch(n){case"new":{let c=`-----BEGIN OPENSSH PRIVATE KEY-----
20
+ `,u,l=Buffer.from(o?o.cipherName:"none"),f=Buffer.from(o?o.kdfName:"none"),p=o?o.kdfOptions:Buffer.alloc(0),g=o?o.cipher.blockLen:8,h=TB(e,t,r),_=bP(4),y=Buffer.from(s),b=8+h.priv.length+4+y.length,v=[];for(let te=1;(b+v.length)%g;++te)v.push(te&255);v=Buffer.from(v);let S=Buffer.allocUnsafe(b+v.length),M;{let te=0;S.set(_,te+=0),S.set(_,te+=4),S.set(h.priv,te+=4),S.writeUInt32BE(y.length,te+=h.priv.length),S.set(y,te+=4),S.set(v,te+=y.length)}if(o){let te={authTagLength:o.cipher.authLen},ee=yB(o.cipher.sslName,o.key,o.iv,te);ee.setAutoPadding(!1),S=Buffer.concat([ee.update(S),ee.final()]),o.cipher.authLen>0?M=ee.getAuthTag():M=Buffer.alloc(0),o.key.fill(0),o.iv.fill(0)}else M=Buffer.alloc(0);let R=Buffer.from("openssh-key-v1\0"),J=Buffer.allocUnsafe(R.length+4+l.length+4+f.length+4+p.length+4+4+h.pub.length+4+S.length+M.length);{let te=0;J.set(R,te+=0),J.writeUInt32BE(l.length,te+=R.length),J.set(l,te+=4),J.writeUInt32BE(f.length,te+=l.length),J.set(f,te+=4),J.writeUInt32BE(p.length,te+=f.length),J.set(p,te+=4),J.writeUInt32BE(1,te+=p.length),J.writeUInt32BE(h.pub.length,te+=4),J.set(h.pub,te+=4),J.writeUInt32BE(S.length,te+=h.pub.length),J.set(S,te+=4),J.set(M,te+=S.length)}{let te=J.base64Slice(0,J.length),ee=te.replace(/.{64}/g,`$&
21
+ `);te.length&63&&(ee+=`
22
+ `),c+=ee}{let te=h.pub.base64Slice(0,h.pub.length);u=`${h.sshName} ${te}${s?` ${s}`:""}`}return c+=`-----END OPENSSH PRIVATE KEY-----
23
+ `,{private:c,public:u}}default:throw new Error("Invalid output key format")}}a(IP,"convertKeys");function kB(){}a(kB,"noop");vP.exports={generateKeyPair:a((e,t,r)=>{typeof t=="function"&&(r=t,t=void 0),typeof r!="function"&&(r=kB);let i=xP(e,t);EB(...i,(n,o,s)=>{if(n)return r(n);let c;try{c=IP(i[0],o,s,t)}catch(u){return r(u)}r(null,c)})},"generateKeyPair"),generateKeyPairSync:a((e,t)=>{let r=xP(e,t),{publicKey:i,privateKey:n}=AB(...r);return IP(r[0],i,n,t)},"generateKeyPairSync")}});var PP=me((m7,wP)=>{"use strict";var{AgentProtocol:CB,BaseAgent:RB,createAgent:OB,CygwinAgent:NB,OpenSSHAgent:$B,PageantAgent:DB}=HE(),{SSHTTPAgent:BB,SSHTTPSAgent:zB}=yP(),{parseKey:LB}=Ci(),{flagsToString:UB,OPEN_MODE:MB,STATUS_CODE:FB,stringToFlags:HB}=Pu();wP.exports={AgentProtocol:CB,BaseAgent:RB,createAgent:OB,Client:PA(),CygwinAgent:NB,HTTPAgent:BB,HTTPSAgent:zB,OpenSSHAgent:$B,PageantAgent:DB,Server:AP(),utils:{parseKey:LB,...SP(),sftp:{flagsToString:UB,OPEN_MODE:MB,STATUS_CODE:FB,stringToFlags:HB}}}});var $A=me((_7,TP)=>{TP.exports=require("stream")});var $P=me((y7,NP)=>{"use strict";function kP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}a(kP,"ownKeys");function CP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kP(Object(r),!0).forEach(function(i){jB(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kP(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}a(CP,"_objectSpread");function jB(e,t,r){return t=OP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}a(jB,"_defineProperty");function WB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}a(WB,"_classCallCheck");function RP(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,OP(i.key),i)}}a(RP,"_defineProperties");function qB(e,t,r){return t&&RP(e.prototype,t),r&&RP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}a(qB,"_createClass");function OP(e){var t=VB(e,"string");return typeof t=="symbol"?t:String(t)}a(OP,"_toPropertyKey");function VB(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}a(VB,"_toPrimitive");var ZB=require("buffer"),Op=ZB.Buffer,QB=require("util"),DA=QB.inspect,KB=DA&&DA.custom||"inspect";function GB(e,t,r){Op.prototype.copy.call(e,t,r)}a(GB,"copyBuffer");NP.exports=(function(){function e(){WB(this,e),this.head=null,this.tail=null,this.length=0}return a(e,"BufferList"),qB(e,[{key:"push",value:a(function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},"push")},{key:"unshift",value:a(function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},"unshift")},{key:"shift",value:a(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:a(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:a(function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},"join")},{key:"concat",value:a(function(r){if(this.length===0)return Op.alloc(0);for(var i=Op.allocUnsafe(r>>>0),n=this.head,o=0;n;)GB(n.data,i,o),o+=n.data.length,n=n.next;return i},"concat")},{key:"consume",value:a(function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n},"consume")},{key:"first",value:a(function(){return this.head.data},"first")},{key:"_getString",value:a(function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,c=r>s.length?s.length:r;if(c===s.length?o+=s:o+=s.slice(0,r),r-=c,r===0){c===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(c));break}++n}return this.length-=n,o},"_getString")},{key:"_getBuffer",value:a(function(r){var i=Op.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,c=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,c),r-=c,r===0){c===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(c));break}++o}return this.length-=o,i},"_getBuffer")},{key:KB,value:a(function(r,i){return DA(this,CP(CP({},i),{},{depth:0,customInspect:!1}))},"value")}]),e})()});var zA=me((A7,BP)=>{"use strict";function YB(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(BA,this,e)):process.nextTick(BA,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Np,r):(r._writableState.errorEmitted=!0,process.nextTick(DP,r,o)):process.nextTick(DP,r,o):t?(process.nextTick(Np,r),t(o)):process.nextTick(Np,r)}),this)}a(YB,"destroy");function DP(e,t){BA(e,t),Np(e)}a(DP,"emitErrorAndCloseNT");function Np(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}a(Np,"emitCloseNT");function XB(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}a(XB,"undestroy");function BA(e,t){e.emit("error",t)}a(BA,"emitErrorNT");function JB(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}a(JB,"errorOrDestroy");BP.exports={destroy:YB,undestroy:XB,errorOrDestroy:JB}});var Bi=me((x7,UP)=>{"use strict";var LP={};function mn(e,t,r){r||(r=Error);function i(o,s,c){return typeof t=="string"?t:t(o,s,c)}a(i,"getMessage");class n extends r{static{a(this,"NodeError")}constructor(s,c,u){super(i(s,c,u))}}n.prototype.name=r.name,n.prototype.code=e,LP[e]=n}a(mn,"createErrorType");function zP(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(i=>String(i)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}a(zP,"oneOf");function e6(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}a(e6,"startsWith");function t6(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}a(t6,"endsWith");function r6(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}a(r6,"includes");mn("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);mn("ERR_INVALID_ARG_TYPE",function(e,t,r){let i;typeof t=="string"&&e6(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";let n;if(t6(e," argument"))n=`The ${e} ${i} ${zP(t,"type")}`;else{let o=r6(e,".")?"property":"argument";n=`The "${e}" ${o} ${i} ${zP(t,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);mn("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");mn("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});mn("ERR_STREAM_PREMATURE_CLOSE","Premature close");mn("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});mn("ERR_MULTIPLE_CALLBACK","Callback called multiple times");mn("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");mn("ERR_STREAM_WRITE_AFTER_END","write after end");mn("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);mn("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);mn("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");UP.exports.codes=LP});var LA=me((v7,MP)=>{"use strict";var n6=Bi().codes.ERR_INVALID_OPT_VALUE;function i6(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}a(i6,"highWaterMarkFrom");function o6(e,t,r,i){var n=i6(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new n6(o,n)}return Math.floor(n)}return e.objectMode?16:16*1024}a(o6,"getHighWaterMark");MP.exports={getHighWaterMark:o6}});var FP=me((w7,UA)=>{typeof Object.create=="function"?UA.exports=a(function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):UA.exports=a(function(t,r){if(r){t.super_=r;var i=a(function(){},"TempCtor");i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}},"inherits")});var vo=me((T7,FA)=>{try{if(MA=require("util"),typeof MA.inherits!="function")throw"";FA.exports=MA.inherits}catch{FA.exports=FP()}var MA});var jP=me((k7,HP)=>{HP.exports=require("util").deprecate});var WA=me((C7,KP)=>{"use strict";KP.exports=or;function qP(e){var t=this;this.next=null,this.entry=null,this.finish=function(){O6(t,e)}}a(qP,"CorkedRequest");var qs;or.WritableState=zu;var s6={deprecate:jP()},VP=$A(),Dp=require("buffer").Buffer,a6=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c6(e){return Dp.from(e)}a(c6,"_uint8ArrayToBuffer");function u6(e){return Dp.isBuffer(e)||e instanceof a6}a(u6,"_isUint8Array");var jA=zA(),l6=LA(),f6=l6.getHighWaterMark,zi=Bi().codes,d6=zi.ERR_INVALID_ARG_TYPE,p6=zi.ERR_METHOD_NOT_IMPLEMENTED,h6=zi.ERR_MULTIPLE_CALLBACK,g6=zi.ERR_STREAM_CANNOT_PIPE,m6=zi.ERR_STREAM_DESTROYED,_6=zi.ERR_STREAM_NULL_VALUES,y6=zi.ERR_STREAM_WRITE_AFTER_END,E6=zi.ERR_UNKNOWN_ENCODING,Vs=jA.errorOrDestroy;vo()(or,VP);function A6(){}a(A6,"nop");function zu(e,t,r){qs=qs||So(),e=e||{},typeof r!="boolean"&&(r=t instanceof qs),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f6(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){P6(t,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new qP(this)}a(zu,"WritableState");zu.prototype.getBuffer=a(function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},"getBuffer");(function(){try{Object.defineProperty(zu.prototype,"buffer",{get:s6.deprecate(a(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var $p;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?($p=Function.prototype[Symbol.hasInstance],Object.defineProperty(or,Symbol.hasInstance,{value:a(function(t){return $p.call(this,t)?!0:this!==or?!1:t&&t._writableState instanceof zu},"value")})):$p=a(function(t){return t instanceof this},"realHasInstance");function or(e){qs=qs||So();var t=this instanceof qs;if(!t&&!$p.call(or,this))return new or(e);this._writableState=new zu(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),VP.call(this)}a(or,"Writable");or.prototype.pipe=function(){Vs(this,new g6)};function b6(e,t){var r=new y6;Vs(e,r),process.nextTick(t,r)}a(b6,"writeAfterEnd");function x6(e,t,r,i){var n;return r===null?n=new _6:typeof r!="string"&&!t.objectMode&&(n=new d6("chunk",["string","Buffer"],r)),n?(Vs(e,n),process.nextTick(i,n),!1):!0}a(x6,"validChunk");or.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&u6(e);return o&&!Dp.isBuffer(e)&&(e=c6(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=A6),i.ending?b6(this,r):(o||x6(this,i,e,r))&&(i.pendingcb++,n=v6(this,i,o,e,t,r)),n};or.prototype.cork=function(){this._writableState.corked++};or.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&ZP(this,e))};or.prototype.setDefaultEncoding=a(function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new E6(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");Object.defineProperty(or.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function I6(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Dp.from(t,r)),t}a(I6,"decodeChunk");Object.defineProperty(or.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});function v6(e,t,r,i,n,o){if(!r){var s=I6(t,i,n);i!==s&&(r=!0,n="buffer",i=s)}var c=t.objectMode?1:i.length;t.length+=c;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else HA(e,t,!1,c,i,n,o);return u}a(v6,"writeOrBuffer");function HA(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m6("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}a(HA,"doWrite");function S6(e,t,r,i,n){--t.pendingcb,r?(process.nextTick(n,i),process.nextTick(Bu,e,t),e._writableState.errorEmitted=!0,Vs(e,i)):(n(i),e._writableState.errorEmitted=!0,Vs(e,i),Bu(e,t))}a(S6,"onwriteError");function w6(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}a(w6,"onwriteStateUpdate");function P6(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new h6;if(w6(r),t)S6(e,r,i,t,n);else{var o=QP(r)||e.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&ZP(e,r),i?process.nextTick(WP,e,r,o,n):WP(e,r,o,n)}}a(P6,"onwrite");function WP(e,t,r,i){r||T6(e,t),t.pendingcb--,i(),Bu(e,t)}a(WP,"afterWrite");function T6(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}a(T6,"onwriteDrain");function ZP(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,c=!0;r;)n[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;n.allBuffers=c,HA(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new qP(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback,p=t.objectMode?1:u.length;if(HA(e,t,!1,p,u,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}a(ZP,"clearBuffer");or.prototype._write=function(e,t,r){r(new p6("_write()"))};or.prototype._writev=null;or.prototype.end=function(e,t,r){var i=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||R6(this,i,r),this};Object.defineProperty(or.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function QP(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}a(QP,"needFinish");function k6(e,t){e._final(function(r){t.pendingcb--,r&&Vs(e,r),t.prefinished=!0,e.emit("prefinish"),Bu(e,t)})}a(k6,"callFinal");function C6(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(k6,e,t)):(t.prefinished=!0,e.emit("prefinish")))}a(C6,"prefinish");function Bu(e,t){var r=QP(t);if(r&&(C6(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}a(Bu,"finishMaybe");function R6(e,t,r){t.ending=!0,Bu(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}a(R6,"endWritable");function O6(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}a(O6,"onCorkedFinish");Object.defineProperty(or.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:a(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")});or.prototype.destroy=jA.destroy;or.prototype._undestroy=jA.undestroy;or.prototype._destroy=function(e,t){t(e)}});var So=me((O7,YP)=>{"use strict";var N6=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};YP.exports=zn;var GP=ZA(),VA=WA();vo()(zn,GP);for(qA=N6(VA.prototype),Bp=0;Bp<qA.length;Bp++)zp=qA[Bp],zn.prototype[zp]||(zn.prototype[zp]=VA.prototype[zp]);var qA,zp,Bp;function zn(e){if(!(this instanceof zn))return new zn(e);GP.call(this,e),VA.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",$6)))}a(zn,"Duplex");Object.defineProperty(zn.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(zn.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(zn.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function $6(){this._writableState.ended||process.nextTick(D6,this)}a($6,"onend");function D6(e){e.end()}a(D6,"onEndNT");Object.defineProperty(zn.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:a(function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")})});var eT=me((QA,JP)=>{var Lp=require("buffer"),Ln=Lp.Buffer;function XP(e,t){for(var r in e)t[r]=e[r]}a(XP,"copyProps");Ln.from&&Ln.alloc&&Ln.allocUnsafe&&Ln.allocUnsafeSlow?JP.exports=Lp:(XP(Lp,QA),QA.Buffer=wo);function wo(e,t,r){return Ln(e,t,r)}a(wo,"SafeBuffer");wo.prototype=Object.create(Ln.prototype);XP(Ln,wo);wo.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Ln(e,t,r)};wo.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=Ln(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};wo.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ln(e)};wo.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Lp.SlowBuffer(e)}});var YA=me(rT=>{"use strict";var GA=eT().Buffer,tT=GA.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function B6(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}a(B6,"_normalizeEncoding");function z6(e){var t=B6(e);if(typeof t!="string"&&(GA.isEncoding===tT||!tT(e)))throw new Error("Unknown encoding: "+e);return t||e}a(z6,"normalizeEncoding");rT.StringDecoder=Lu;function Lu(e){this.encoding=z6(e);var t;switch(this.encoding){case"utf16le":this.text=j6,this.end=W6,t=4;break;case"utf8":this.fillLast=M6,t=4;break;case"base64":this.text=q6,this.end=V6,t=3;break;default:this.write=Z6,this.end=Q6;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=GA.allocUnsafe(t)}a(Lu,"StringDecoder");Lu.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Lu.prototype.end=H6;Lu.prototype.text=F6;Lu.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function KA(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}a(KA,"utf8CheckByte");function L6(e,t,r){var i=t.length-1;if(i<r)return 0;var n=KA(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=KA(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=KA(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}a(L6,"utf8CheckIncomplete");function U6(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}a(U6,"utf8CheckExtraBytes");function M6(e){var t=this.lastTotal-this.lastNeed,r=U6(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}a(M6,"utf8FillLast");function F6(e,t){var r=L6(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}a(F6,"utf8Text");function H6(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}a(H6,"utf8End");function j6(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}a(j6,"utf16Text");function W6(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}a(W6,"utf16End");function q6(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}a(q6,"base64Text");function V6(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}a(V6,"base64End");function Z6(e){return e.toString(this.encoding)}a(Z6,"simpleWrite");function Q6(e){return e&&e.length?this.write(e):""}a(Q6,"simpleEnd")});var Up=me((z7,oT)=>{"use strict";var nT=Bi().codes.ERR_STREAM_PREMATURE_CLOSE;function K6(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}a(K6,"once");function G6(){}a(G6,"noop");function Y6(e){return e.setHeader&&typeof e.abort=="function"}a(Y6,"isRequest");function iT(e,t,r){if(typeof t=="function")return iT(e,null,t);t||(t={}),r=K6(r||G6);var i=t.readable||t.readable!==!1&&e.readable,n=t.writable||t.writable!==!1&&e.writable,o=a(function(){e.writable||c()},"onlegacyfinish"),s=e._writableState&&e._writableState.finished,c=a(function(){n=!1,s=!0,i||r.call(e)},"onfinish"),u=e._readableState&&e._readableState.endEmitted,l=a(function(){i=!1,u=!0,n||r.call(e)},"onend"),f=a(function(_){r.call(e,_)},"onerror"),p=a(function(){var _;if(i&&!u)return(!e._readableState||!e._readableState.ended)&&(_=new nT),r.call(e,_);if(n&&!s)return(!e._writableState||!e._writableState.ended)&&(_=new nT),r.call(e,_)},"onclose"),g=a(function(){e.req.on("finish",c)},"onrequest");return Y6(e)?(e.on("complete",c),e.on("abort",p),e.req?g():e.on("request",g)):n&&!e._writableState&&(e.on("end",o),e.on("close",o)),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",f),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",o),e.removeListener("close",o),e.removeListener("finish",c),e.removeListener("end",l),e.removeListener("error",f),e.removeListener("close",p)}}a(iT,"eos");oT.exports=iT});var aT=me((U7,sT)=>{"use strict";var Mp;function Li(e,t,r){return t=X6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}a(Li,"_defineProperty");function X6(e){var t=J6(e,"string");return typeof t=="symbol"?t:String(t)}a(X6,"_toPropertyKey");function J6(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}a(J6,"_toPrimitive");var ez=Up(),Ui=Symbol("lastResolve"),Po=Symbol("lastReject"),Uu=Symbol("error"),Fp=Symbol("ended"),To=Symbol("lastPromise"),XA=Symbol("handlePromise"),ko=Symbol("stream");function Mi(e,t){return{value:e,done:t}}a(Mi,"createIterResult");function tz(e){var t=e[Ui];if(t!==null){var r=e[ko].read();r!==null&&(e[To]=null,e[Ui]=null,e[Po]=null,t(Mi(r,!1)))}}a(tz,"readAndResolve");function rz(e){process.nextTick(tz,e)}a(rz,"onReadable");function nz(e,t){return function(r,i){e.then(function(){if(t[Fp]){r(Mi(void 0,!0));return}t[XA](r,i)},i)}}a(nz,"wrapForNext");var iz=Object.getPrototypeOf(function(){}),oz=Object.setPrototypeOf((Mp={get stream(){return this[ko]},next:a(function(){var t=this,r=this[Uu];if(r!==null)return Promise.reject(r);if(this[Fp])return Promise.resolve(Mi(void 0,!0));if(this[ko].destroyed)return new Promise(function(s,c){process.nextTick(function(){t[Uu]?c(t[Uu]):s(Mi(void 0,!0))})});var i=this[To],n;if(i)n=new Promise(nz(i,this));else{var o=this[ko].read();if(o!==null)return Promise.resolve(Mi(o,!1));n=new Promise(this[XA])}return this[To]=n,n},"next")},Li(Mp,Symbol.asyncIterator,function(){return this}),Li(Mp,"return",a(function(){var t=this;return new Promise(function(r,i){t[ko].destroy(null,function(n){if(n){i(n);return}r(Mi(void 0,!0))})})},"_return")),Mp),iz),sz=a(function(t){var r,i=Object.create(oz,(r={},Li(r,ko,{value:t,writable:!0}),Li(r,Ui,{value:null,writable:!0}),Li(r,Po,{value:null,writable:!0}),Li(r,Uu,{value:null,writable:!0}),Li(r,Fp,{value:t._readableState.endEmitted,writable:!0}),Li(r,XA,{value:a(function(o,s){var c=i[ko].read();c?(i[To]=null,i[Ui]=null,i[Po]=null,o(Mi(c,!1))):(i[Ui]=o,i[Po]=s)},"value"),writable:!0}),r));return i[To]=null,ez(t,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[Po];o!==null&&(i[To]=null,i[Ui]=null,i[Po]=null,o(n)),i[Uu]=n;return}var s=i[Ui];s!==null&&(i[To]=null,i[Ui]=null,i[Po]=null,s(Mi(void 0,!0))),i[Fp]=!0}),t.on("readable",rz.bind(null,i)),i},"createReadableStreamAsyncIterator");sT.exports=sz});var fT=me((F7,lT)=>{"use strict";function cT(e,t,r,i,n,o,s){try{var c=e[o](s),u=c.value}catch(l){r(l);return}c.done?t(u):Promise.resolve(u).then(i,n)}a(cT,"asyncGeneratorStep");function az(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var o=e.apply(t,r);function s(u){cT(o,i,n,s,c,"next",u)}a(s,"_next");function c(u){cT(o,i,n,s,c,"throw",u)}a(c,"_throw"),s(void 0)})}}a(az,"_asyncToGenerator");function uT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}a(uT,"ownKeys");function cz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uT(Object(r),!0).forEach(function(i){uz(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uT(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}a(cz,"_objectSpread");function uz(e,t,r){return t=lz(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}a(uz,"_defineProperty");function lz(e){var t=fz(e,"string");return typeof t=="symbol"?t:String(t)}a(lz,"_toPropertyKey");function fz(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}a(fz,"_toPrimitive");var dz=Bi().codes.ERR_INVALID_ARG_TYPE;function pz(e,t,r){var i;if(t&&typeof t.next=="function")i=t;else if(t&&t[Symbol.asyncIterator])i=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])i=t[Symbol.iterator]();else throw new dz("iterable",["Iterable"],t);var n=new e(cz({objectMode:!0},r)),o=!1;n._read=function(){o||(o=!0,s())};function s(){return c.apply(this,arguments)}a(s,"next");function c(){return c=az(function*(){try{var u=yield i.next(),l=u.value,f=u.done;f?n.push(null):n.push(yield l)?s():o=!1}catch(p){n.destroy(p)}}),c.apply(this,arguments)}return a(c,"_next2"),n}a(pz,"from");lT.exports=pz});var ZA=me((W7,bT)=>{"use strict";bT.exports=Pt;var Zs;Pt.ReadableState=gT;var j7=require("events").EventEmitter,hT=a(function(t,r){return t.listeners(r).length},"EElistenerCount"),Fu=$A(),Hp=require("buffer").Buffer,hz=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function gz(e){return Hp.from(e)}a(gz,"_uint8ArrayToBuffer");function mz(e){return Hp.isBuffer(e)||e instanceof hz}a(mz,"_isUint8Array");var JA=require("util"),ht;JA&&JA.debuglog?ht=JA.debuglog("stream"):ht=a(function(){},"debug");var _z=$P(),sb=zA(),yz=LA(),Ez=yz.getHighWaterMark,jp=Bi().codes,Az=jp.ERR_INVALID_ARG_TYPE,bz=jp.ERR_STREAM_PUSH_AFTER_EOF,xz=jp.ERR_METHOD_NOT_IMPLEMENTED,Iz=jp.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Qs,eb,tb;vo()(Pt,Fu);var Mu=sb.errorOrDestroy,rb=["error","close","destroy","pause","resume"];function vz(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}a(vz,"prependListener");function gT(e,t,r){Zs=Zs||So(),e=e||{},typeof r!="boolean"&&(r=t instanceof Zs),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Ez(this,e,"readableHighWaterMark",r),this.buffer=new _z,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Qs||(Qs=YA().StringDecoder),this.decoder=new Qs(e.encoding),this.encoding=e.encoding)}a(gT,"ReadableState");function Pt(e){if(Zs=Zs||So(),!(this instanceof Pt))return new Pt(e);var t=this instanceof Zs;this._readableState=new gT(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Fu.call(this)}a(Pt,"Readable");Object.defineProperty(Pt.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:a(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")});Pt.prototype.destroy=sb.destroy;Pt.prototype._undestroy=sb.undestroy;Pt.prototype._destroy=function(e,t){t(e)};Pt.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Hp.from(e,t),t=""),i=!0),mT(this,e,t,!1,i)};Pt.prototype.unshift=function(e){return mT(this,e,null,!0,!1)};function mT(e,t,r,i,n){ht("readableAddChunk",t);var o=e._readableState;if(t===null)o.reading=!1,Pz(e,o);else{var s;if(n||(s=Sz(o,t)),s)Mu(e,s);else if(o.objectMode||t&&t.length>0)if(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Hp.prototype&&(t=gz(t)),i)o.endEmitted?Mu(e,new Iz):nb(e,o,t,!0);else if(o.ended)Mu(e,new bz);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?nb(e,o,t,!1):ob(e,o)):nb(e,o,t,!1)}else i||(o.reading=!1,ob(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}a(mT,"readableAddChunk");function nb(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Wp(e)),ob(e,t)}a(nb,"addChunk");function Sz(e,t){var r;return!mz(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Az("chunk",["string","Buffer","Uint8Array"],t)),r}a(Sz,"chunkInvalid");Pt.prototype.isPaused=function(){return this._readableState.flowing===!1};Pt.prototype.setEncoding=function(e){Qs||(Qs=YA().StringDecoder);var t=new Qs(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var dT=1073741824;function wz(e){return e>=dT?e=dT:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}a(wz,"computeNewHighWaterMark");function pT(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=wz(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}a(pT,"howMuchToRead");Pt.prototype.read=function(e){ht("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return ht("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ib(this):Wp(this),null;if(e=pT(e,t),e===0&&t.ended)return t.length===0&&ib(this),null;var i=t.needReadable;ht("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,ht("length less than watermark",i)),t.ended||t.reading?(i=!1,ht("reading or ended",i)):i&&(ht("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=pT(r,t)));var n;return e>0?n=ET(e,t):n=null,n===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ib(this)),n!==null&&this.emit("data",n),n};function Pz(e,t){if(ht("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Wp(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,_T(e)))}}a(Pz,"onEofChunk");function Wp(e){var t=e._readableState;ht("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(ht("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(_T,e))}a(Wp,"emitReadable");function _T(e){var t=e._readableState;ht("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ab(e)}a(_T,"emitReadable_");function ob(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Tz,e,t))}a(ob,"maybeReadMore");function Tz(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(ht("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}a(Tz,"maybeReadMore_");Pt.prototype._read=function(e){Mu(this,new xz("_read()"))};Pt.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,ht("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=n?c:y;i.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",s);function s(b,v){ht("onunpipe"),b===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,f())}a(s,"onunpipe");function c(){ht("onend"),e.end()}a(c,"onend");var u=kz(r);e.on("drain",u);var l=!1;function f(){ht("cleanup"),e.removeListener("close",h),e.removeListener("finish",_),e.removeListener("drain",u),e.removeListener("error",g),e.removeListener("unpipe",s),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}a(f,"cleanup"),r.on("data",p);function p(b){ht("ondata");var v=e.write(b);ht("dest.write",v),v===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&AT(i.pipes,e)!==-1)&&!l&&(ht("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}a(p,"ondata");function g(b){ht("onerror",b),y(),e.removeListener("error",g),hT(e,"error")===0&&Mu(e,b)}a(g,"onerror"),vz(e,"error",g);function h(){e.removeListener("finish",_),y()}a(h,"onclose"),e.once("close",h);function _(){ht("onfinish"),e.removeListener("close",h),y()}a(_,"onfinish"),e.once("finish",_);function y(){ht("unpipe"),r.unpipe(e)}return a(y,"unpipe"),e.emit("pipe",r),i.flowing||(ht("pipe resume"),r.resume()),e};function kz(e){return a(function(){var r=e._readableState;ht("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&hT(e,"data")&&(r.flowing=!0,ab(e))},"pipeOnDrainFunctionResult")}a(kz,"pipeOnDrain");Pt.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=AT(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Pt.prototype.on=function(e,t){var r=Fu.prototype.on.call(this,e,t),i=this._readableState;return e==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):e==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,ht("on readable",i.length,i.reading),i.length?Wp(this):i.reading||process.nextTick(Cz,this)),r};Pt.prototype.addListener=Pt.prototype.on;Pt.prototype.removeListener=function(e,t){var r=Fu.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(yT,this),r};Pt.prototype.removeAllListeners=function(e){var t=Fu.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(yT,this),t};function yT(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}a(yT,"updateReadableListening");function Cz(e){ht("readable nexttick read 0"),e.read(0)}a(Cz,"nReadingNextTick");Pt.prototype.resume=function(){var e=this._readableState;return e.flowing||(ht("resume"),e.flowing=!e.readableListening,Rz(this,e)),e.paused=!1,this};function Rz(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Oz,e,t))}a(Rz,"resume");function Oz(e,t){ht("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ab(e),t.flowing&&!t.reading&&e.read(0)}a(Oz,"resume_");Pt.prototype.pause=function(){return ht("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ht("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ab(e){var t=e._readableState;for(ht("flow",t.flowing);t.flowing&&e.read()!==null;);}a(ab,"flow");Pt.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(ht("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(ht("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var c=t.push(s);c||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=a(function(c){return a(function(){return e[c].apply(e,arguments)},"methodWrapReturnFunction")},"methodWrap")(n));for(var o=0;o<rb.length;o++)e.on(rb[o],this.emit.bind(this,rb[o]));return this._read=function(s){ht("wrapped _read",s),i&&(i=!1,e.resume())},this};typeof Symbol=="function"&&(Pt.prototype[Symbol.asyncIterator]=function(){return eb===void 0&&(eb=aT()),eb(this)});Object.defineProperty(Pt.prototype,"readableHighWaterMark",{enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(Pt.prototype,"readableBuffer",{enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(Pt.prototype,"readableFlowing",{enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(t){this._readableState&&(this._readableState.flowing=t)},"set")});Pt._fromList=ET;Object.defineProperty(Pt.prototype,"readableLength",{enumerable:!1,get:a(function(){return this._readableState.length},"get")});function ET(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}a(ET,"fromList");function ib(e){var t=e._readableState;ht("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Nz,t,e))}a(ib,"endReadable");function Nz(e,t){if(ht("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}a(Nz,"endReadableNT");typeof Symbol=="function"&&(Pt.from=function(e,t){return tb===void 0&&(tb=fT()),tb(Pt,e,t)});function AT(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}a(AT,"indexOf")});var cb=me((V7,IT)=>{"use strict";IT.exports=ii;var qp=Bi().codes,$z=qp.ERR_METHOD_NOT_IMPLEMENTED,Dz=qp.ERR_MULTIPLE_CALLBACK,Bz=qp.ERR_TRANSFORM_ALREADY_TRANSFORMING,zz=qp.ERR_TRANSFORM_WITH_LENGTH_0,Vp=So();vo()(ii,Vp);function Lz(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new Dz);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}a(Lz,"afterTransform");function ii(e){if(!(this instanceof ii))return new ii(e);Vp.call(this,e),this._transformState={afterTransform:Lz.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Uz)}a(ii,"Transform");function Uz(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){xT(e,t,r)}):xT(this,null,null)}a(Uz,"prefinish");ii.prototype.push=function(e,t){return this._transformState.needTransform=!1,Vp.prototype.push.call(this,e,t)};ii.prototype._transform=function(e,t,r){r(new $z("_transform()"))};ii.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};ii.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ii.prototype._destroy=function(e,t){Vp.prototype._destroy.call(this,e,function(r){t(r)})};function xT(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new zz;if(e._transformState.transforming)throw new Bz;return e.push(null)}a(xT,"done")});var wT=me((Q7,ST)=>{"use strict";ST.exports=Hu;var vT=cb();vo()(Hu,vT);function Hu(e){if(!(this instanceof Hu))return new Hu(e);vT.call(this,e)}a(Hu,"PassThrough");Hu.prototype._transform=function(e,t,r){r(null,e)}});var RT=me((G7,CT)=>{"use strict";var ub;function Mz(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}a(Mz,"once");var kT=Bi().codes,Fz=kT.ERR_MISSING_ARGS,Hz=kT.ERR_STREAM_DESTROYED;function PT(e){if(e)throw e}a(PT,"noop");function jz(e){return e.setHeader&&typeof e.abort=="function"}a(jz,"isRequest");function Wz(e,t,r,i){i=Mz(i);var n=!1;e.on("close",function(){n=!0}),ub===void 0&&(ub=Up()),ub(e,{readable:t,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,jz(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();i(s||new Hz("pipe"))}}}a(Wz,"destroyer");function TT(e){e()}a(TT,"call");function qz(e,t){return e.pipe(t)}a(qz,"pipe");function Vz(e){return!e.length||typeof e[e.length-1]!="function"?PT:e.pop()}a(Vz,"popCallback");function Zz(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=Vz(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Fz("streams");var n,o=t.map(function(s,c){var u=c<t.length-1,l=c>0;return Wz(s,u,l,function(f){n||(n=f),f&&o.forEach(TT),!u&&(o.forEach(TT),i(n))})});return t.reduce(qz)}a(Zz,"pipeline");CT.exports=Zz});var OT=me((_n,Wu)=>{var ju=require("stream");process.env.READABLE_STREAM==="disable"&&ju?(Wu.exports=ju.Readable,Object.assign(Wu.exports,ju),Wu.exports.Stream=ju):(_n=Wu.exports=ZA(),_n.Stream=ju||_n,_n.Readable=_n,_n.Writable=WA(),_n.Duplex=So(),_n.Transform=cb(),_n.PassThrough=wT(),_n.finished=Up(),_n.pipeline=RT())});var $T=me((X7,NT)=>{var Qz=Object.prototype.toString,lb=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Kz(e){return Qz.call(e).slice(8,-1)==="ArrayBuffer"}a(Kz,"isArrayBuffer");function Gz(e,t,r){t>>>=0;var i=e.byteLength-t;if(i<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=i;else if(r>>>=0,r>i)throw new RangeError("'length' is out of bounds");return lb?Buffer.from(e.slice(t,t+r)):new Buffer(new Uint8Array(e.slice(t,t+r)))}a(Gz,"fromArrayBuffer");function Yz(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!Buffer.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return lb?Buffer.from(e,t):new Buffer(e,t)}a(Yz,"fromString");function Xz(e,t,r){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return Kz(e)?Gz(e,t,r):typeof e=="string"?Yz(e,t):lb?Buffer.from(e):new Buffer(e)}a(Xz,"bufferFrom");NT.exports=Xz});var MT=me(Ve=>{var DT=void 0,Jz=1e5,jt=(function(){var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty;return{Class:a(function(r){return e.call(r).replace(/^\[object *|\]$/g,"")},"Class"),HasProperty:a(function(r,i){return i in r},"HasProperty"),HasOwnProperty:a(function(r,i){return t.call(r,i)},"HasOwnProperty"),IsCallable:a(function(r){return typeof r=="function"},"IsCallable"),ToInt32:a(function(r){return r>>0},"ToInt32"),ToUint32:a(function(r){return r>>>0},"ToUint32")}})(),eL=Math.LN2,tL=Math.abs,Zp=Math.floor,rL=Math.log,nL=Math.min,Pn=Math.pow,iL=Math.round;function fb(e){if(BT&&Ks){var t=BT(e),r;for(r=0;r<t.length;r+=1)Ks(e,t[r],{value:e[t[r]],writable:!1,enumerable:!1,configurable:!1})}}a(fb,"configureProperties");var Ks;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?Ks=Object.defineProperty:Ks=a(function(e,t,r){if(!e===Object(e))throw new TypeError("Object.defineProperty called on non-object");return jt.HasProperty(r,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(e,t,r.get),jt.HasProperty(r,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(e,t,r.set),jt.HasProperty(r,"value")&&(e[t]=r.value),e},"defineProp");var BT=Object.getOwnPropertyNames||function(e){if(e!==Object(e))throw new TypeError("Object.getOwnPropertyNames called on non-object");var t=[],r;for(r in e)jt.HasOwnProperty(e,r)&&t.push(r);return t};function oL(e){if(!Ks)return;if(e.length>Jz)throw new RangeError("Array too large for polyfill");function t(i){Ks(e,i,{get:a(function(){return e._getter(i)},"get"),set:a(function(n){e._setter(i,n)},"set"),enumerable:!0,configurable:!1})}a(t,"makeArrayAccessor");var r;for(r=0;r<e.length;r+=1)t(r)}a(oL,"makeArrayAccessors");function db(e,t){var r=32-t;return e<<r>>r}a(db,"as_signed");function pb(e,t){var r=32-t;return e<<r>>>r}a(pb,"as_unsigned");function sL(e){return[e&255]}a(sL,"packI8");function aL(e){return db(e[0],8)}a(aL,"unpackI8");function cL(e){return[e&255]}a(cL,"packU8");function zT(e){return pb(e[0],8)}a(zT,"unpackU8");function uL(e){return e=iL(Number(e)),[e<0?0:e>255?255:e&255]}a(uL,"packU8Clamped");function lL(e){return[e>>8&255,e&255]}a(lL,"packI16");function fL(e){return db(e[0]<<8|e[1],16)}a(fL,"unpackI16");function dL(e){return[e>>8&255,e&255]}a(dL,"packU16");function pL(e){return pb(e[0]<<8|e[1],16)}a(pL,"unpackU16");function hL(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}a(hL,"packI32");function gL(e){return db(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}a(gL,"unpackI32");function mL(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}a(mL,"packU32");function _L(e){return pb(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}a(_L,"unpackU32");function LT(e,t,r){var i=(1<<t-1)-1,n,o,s,c,u,l,f,p;function g(h){var _=Zp(h),y=h-_;return y<.5?_:y>.5||_%2?_+1:_}for(a(g,"roundToEven"),e!==e?(o=(1<<t)-1,s=Pn(2,r-1),n=0):e===1/0||e===-1/0?(o=(1<<t)-1,s=0,n=e<0?1:0):e===0?(o=0,s=0,n=1/e===-1/0?1:0):(n=e<0,e=tL(e),e>=Pn(2,1-i)?(o=nL(Zp(rL(e)/eL),1023),s=g(e/Pn(2,o)*Pn(2,r)),s/Pn(2,r)>=2&&(o=o+1,s=1),o>i?(o=(1<<t)-1,s=0):(o=o+i,s=s-Pn(2,r))):(o=0,s=g(e/Pn(2,1-i-r)))),l=[],u=r;u;u-=1)l.push(s%2?1:0),s=Zp(s/2);for(u=t;u;u-=1)l.push(o%2?1:0),o=Zp(o/2);for(l.push(n?1:0),l.reverse(),f=l.join(""),p=[];f.length;)p.push(parseInt(f.substring(0,8),2)),f=f.substring(8);return p}a(LT,"packIEEE754");function UT(e,t,r){var i=[],n,o,s,c,u,l,f,p;for(n=e.length;n;n-=1)for(s=e[n-1],o=8;o;o-=1)i.push(s%2?1:0),s=s>>1;return i.reverse(),c=i.join(""),u=(1<<t-1)-1,l=parseInt(c.substring(0,1),2)?-1:1,f=parseInt(c.substring(1,1+t),2),p=parseInt(c.substring(1+t),2),f===(1<<t)-1?p!==0?NaN:l*(1/0):f>0?l*Pn(2,f-u)*(1+p/Pn(2,r)):p!==0?l*Pn(2,-(u-1))*(p/Pn(2,r)):l<0?-0:0}a(UT,"unpackIEEE754");function yL(e){return UT(e,11,52)}a(yL,"unpackF64");function EL(e){return LT(e,11,52)}a(EL,"packF64");function AL(e){return UT(e,8,23)}a(AL,"unpackF32");function bL(e){return LT(e,8,23)}a(bL,"packF32");(function(){var e=a(function(h){if(h=jt.ToInt32(h),h<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=h,this._bytes=[],this._bytes.length=h;var _;for(_=0;_<this.byteLength;_+=1)this._bytes[_]=0;fb(this)},"ArrayBuffer");Ve.ArrayBuffer=Ve.ArrayBuffer||e;var t=a(function(){},"ArrayBufferView");function r(g,h,_){var y;return y=a(function(b,v,S){var M,R,J,te;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=jt.ToInt32(arguments[0]),S<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===y)for(M=arguments[0],this.length=M.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)this._setter(J,M._getter(J));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof e||jt.Class(arguments[0])==="ArrayBuffer"))for(R=arguments[0],this.length=jt.ToUint32(R.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new e(this.byteLength),this.byteOffset=0,J=0;J<this.length;J+=1)te=R[J],this._setter(J,Number(te));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof e||jt.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=b,this.byteOffset=jt.ToUint32(v),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=jt.ToUint32(S),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=y,fb(this),oL(this)},"ctor"),y.prototype=new t,y.prototype.BYTES_PER_ELEMENT=g,y.prototype._pack=h,y.prototype._unpack=_,y.BYTES_PER_ELEMENT=g,y.prototype._getter=function(b){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(b=jt.ToUint32(b),b>=this.length)return DT;var v=[],S,M;for(S=0,M=this.byteOffset+b*this.BYTES_PER_ELEMENT;S<this.BYTES_PER_ELEMENT;S+=1,M+=1)v.push(this.buffer._bytes[M]);return this._unpack(v)},y.prototype.get=y.prototype._getter,y.prototype._setter=function(b,v){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(b=jt.ToUint32(b),b>=this.length)return DT;var S=this._pack(v),M,R;for(M=0,R=this.byteOffset+b*this.BYTES_PER_ELEMENT;M<this.BYTES_PER_ELEMENT;M+=1,R+=1)this.buffer._bytes[R]=S[M]},y.prototype.set=function(b,v){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var S,M,R,J,te,ee,P,C,H,U;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(S=arguments[0],R=jt.ToUint32(arguments[1]),R+S.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(C=this.byteOffset+R*this.BYTES_PER_ELEMENT,H=S.length*this.BYTES_PER_ELEMENT,S.buffer===this.buffer){for(U=[],te=0,ee=S.byteOffset;te<H;te+=1,ee+=1)U[te]=S.buffer._bytes[ee];for(te=0,P=C;te<H;te+=1,P+=1)this.buffer._bytes[P]=U[te]}else for(te=0,ee=S.byteOffset,P=C;te<H;te+=1,ee+=1,P+=1)this.buffer._bytes[P]=S.buffer._bytes[ee]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(M=arguments[0],J=jt.ToUint32(M.length),R=jt.ToUint32(arguments[1]),R+J>this.length)throw new RangeError("Offset plus length of array is out of range");for(te=0;te<J;te+=1)ee=M[te],this._setter(R+te,Number(ee))}else throw new TypeError("Unexpected argument type(s)")},y.prototype.subarray=function(b,v){function S(R,J,te){return R<J?J:R>te?te:R}a(S,"clamp"),b=jt.ToInt32(b),v=jt.ToInt32(v),arguments.length<1&&(b=0),arguments.length<2&&(v=this.length),b<0&&(b=this.length+b),v<0&&(v=this.length+v),b=S(b,0,this.length),v=S(v,0,this.length);var M=v-b;return M<0&&(M=0),new this.constructor(this.buffer,this.byteOffset+b*this.BYTES_PER_ELEMENT,M)},y}a(r,"makeConstructor");var i=r(1,sL,aL),n=r(1,cL,zT),o=r(1,uL,zT),s=r(2,lL,fL),c=r(2,dL,pL),u=r(4,hL,gL),l=r(4,mL,_L),f=r(4,bL,AL),p=r(8,EL,yL);Ve.Int8Array=Ve.Int8Array||i,Ve.Uint8Array=Ve.Uint8Array||n,Ve.Uint8ClampedArray=Ve.Uint8ClampedArray||o,Ve.Int16Array=Ve.Int16Array||s,Ve.Uint16Array=Ve.Uint16Array||c,Ve.Int32Array=Ve.Int32Array||u,Ve.Uint32Array=Ve.Uint32Array||l,Ve.Float32Array=Ve.Float32Array||f,Ve.Float64Array=Ve.Float64Array||p})();(function(){function e(o,s){return jt.IsCallable(o.get)?o.get(s):o[s]}a(e,"r");var t=(function(){var o=new Ve.Uint16Array([4660]),s=new Ve.Uint8Array(o.buffer);return e(s,0)===18})(),r=a(function(s,c,u){if(arguments.length===0)s=new Ve.ArrayBuffer(0);else if(!(s instanceof Ve.ArrayBuffer||jt.Class(s)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=s||new Ve.ArrayBuffer(0),this.byteOffset=jt.ToUint32(c),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=jt.ToUint32(u),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");fb(this)},"DataView");function i(o){return function(s,c){if(s=jt.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");s+=this.byteOffset;var u=new Ve.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),l=[],f;for(f=0;f<o.BYTES_PER_ELEMENT;f+=1)l.push(e(u,f));return!!c==!!t&&l.reverse(),e(new o(new Ve.Uint8Array(l).buffer),0)}}a(i,"makeGetter"),r.prototype.getUint8=i(Ve.Uint8Array),r.prototype.getInt8=i(Ve.Int8Array),r.prototype.getUint16=i(Ve.Uint16Array),r.prototype.getInt16=i(Ve.Int16Array),r.prototype.getUint32=i(Ve.Uint32Array),r.prototype.getInt32=i(Ve.Int32Array),r.prototype.getFloat32=i(Ve.Float32Array),r.prototype.getFloat64=i(Ve.Float64Array);function n(o){return function(s,c,u){if(s=jt.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var l=new o([c]),f=new Ve.Uint8Array(l.buffer),p=[],g,h;for(g=0;g<o.BYTES_PER_ELEMENT;g+=1)p.push(e(f,g));!!u==!!t&&p.reverse(),h=new Ve.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),h.set(p)}}a(n,"makeSetter"),r.prototype.setUint8=n(Ve.Uint8Array),r.prototype.setInt8=n(Ve.Int8Array),r.prototype.setUint16=n(Ve.Uint16Array),r.prototype.setInt16=n(Ve.Int16Array),r.prototype.setUint32=n(Ve.Uint32Array),r.prototype.setInt32=n(Ve.Int32Array),r.prototype.setFloat32=n(Ve.Float32Array),r.prototype.setFloat64=n(Ve.Float64Array),Ve.DataView=Ve.DataView||r})()});var WT=me((rK,jT)=>{var FT=OT().Writable,xL=vo(),qu=$T();typeof Uint8Array>"u"?Qp=MT().Uint8Array:Qp=Uint8Array;var Qp;function Co(e,t){if(!(this instanceof Co))return new Co(e,t);typeof e=="function"&&(t=e,e={}),e||(e={});var r=e.encoding,i=!1;r?(r=String(r).toLowerCase(),(r==="u8"||r==="uint8")&&(r="uint8array")):i=!0,FT.call(this,{objectMode:!0}),this.encoding=r,this.shouldInferEncoding=i,t&&this.on("finish",function(){t(this.getBody())}),this.body=[]}a(Co,"ConcatStream");jT.exports=Co;xL(Co,FT);Co.prototype._write=function(e,t,r){this.body.push(e),r()};Co.prototype.inferEncoding=function(e){var t=e===void 0?this.body[0]:e;return Buffer.isBuffer(t)?"buffer":typeof Uint8Array<"u"&&t instanceof Uint8Array?"uint8array":Array.isArray(t)?"array":typeof t=="string"?"string":Object.prototype.toString.call(t)==="[object Object]"?"object":"buffer"};Co.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?wL(this.body):this.encoding==="string"?vL(this.body):this.encoding==="buffer"?SL(this.body):this.encoding==="uint8array"?PL(this.body):this.body)};function IL(e){return/Array\]$/.test(Object.prototype.toString.call(e))}a(IL,"isArrayish");function HT(e){return typeof e=="string"||IL(e)||e&&typeof e.subarray=="function"}a(HT,"isBufferish");function vL(e){for(var t=[],r=!1,i=0;i<e.length;i++){var n=e[i];typeof n=="string"||Buffer.isBuffer(n)?t.push(n):HT(n)?t.push(qu(n)):t.push(qu(String(n)))}return Buffer.isBuffer(e[0])?(t=Buffer.concat(t),t=t.toString("utf8")):t=t.join(""),t}a(vL,"stringConcat");function SL(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];Buffer.isBuffer(i)?t.push(i):HT(i)?t.push(qu(i)):t.push(qu(String(i)))}return Buffer.concat(t)}a(SL,"bufferConcat");function wL(e){for(var t=[],r=0;r<e.length;r++)t.push.apply(t,e[r]);return t}a(wL,"arrayConcat");function PL(e){for(var t=0,r=0;r<e.length;r++)typeof e[r]=="string"&&(e[r]=qu(e[r])),t+=e[r].length;for(var i=new Qp(t),r=0,n=0;r<e.length;r++)for(var o=e[r],s=0;s<o.length;s++)i[n++]=o[s];return i}a(PL,"u8Concat")});var ZT=me((iK,VT)=>{"use strict";function qT(e,t){for(let r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}a(qT,"assign");function TL(e,t,r){if(!e||typeof e=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof t=="object"&&(r=t,t=void 0),t!=null&&(r.code=t);try{return qT(e,r)}catch{r.message=e.message,r.stack=e.stack;let n=a(function(){},"ErrClass");return n.prototype=Object.create(Object.getPrototypeOf(e)),qT(new n,r)}}a(TL,"createError");VT.exports=TL});var KT=me((sK,QT)=>{function yn(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(yn,"RetryOperation");QT.exports=yn;yn.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};yn.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};yn.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var i=this,n=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r);return this._options.unref&&n.unref(),!0};yn.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};yn.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};yn.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};yn.prototype.start=yn.prototype.try;yn.prototype.errors=function(){return this._errors};yn.prototype.attempts=function(){return this._attempts};yn.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,r=0,i=0;i<this._errors.length;i++){var n=this._errors[i],o=n.message,s=(e[o]||0)+1;e[o]=s,s>=r&&(t=n,r=s)}return t}});var GT=me(Ro=>{var kL=KT();Ro.operation=function(e){var t=Ro.timeouts(e);return new kL(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};Ro.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],n=0;n<t.retries;n++)i.push(this.createTimeout(n,t));return e&&e.forever&&!i.length&&i.push(this.createTimeout(n,t)),i.sort(function(o,s){return o-s}),i};Ro.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*Math.pow(t.factor,e));return i=Math.min(i,t.maxTimeout),i};Ro.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var i in e)typeof e[i]=="function"&&r.push(i)}for(var n=0;n<r.length;n++){var o=r[n],s=e[o];e[o]=a(function(u){var l=Ro.operation(t),f=Array.prototype.slice.call(arguments,1),p=f.pop();f.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),p.apply(this,arguments))}),l.attempt(function(){u.apply(e,f)})},"retryWrapper").bind(e,s),e[o].options=t}}});var XT=me((lK,YT)=>{YT.exports=GT()});var tk=me((fK,ek)=>{"use strict";var CL=ZT(),RL=XT(),OL=Object.prototype.hasOwnProperty;function JT(e){return e&&e.code==="EPROMISERETRY"&&OL.call(e,"retried")}a(JT,"isRetryError");function NL(e,t){var r,i;return typeof e=="object"&&typeof t=="function"&&(r=t,t=e,e=r),i=RL.operation(t),new Promise(function(n,o){i.attempt(function(s){Promise.resolve().then(function(){return e(function(c){throw JT(c)&&(c=c.retried),CL(new Error("Retrying"),"EPROMISERETRY",{retried:c})},s)}).then(n,function(c){JT(c)&&(c=c.retried,i.retry(c||new Error))||o(c)})})})}a(NL,"promiseRetry");ek.exports=NL});var hb=me((pK,rk)=>{var $L={generic:"ERR_GENERIC_CLIENT",connect:"ERR_NOT_CONNECTED",badPath:"ERR_BAD_PATH",permission:"EACCES",notexist:"ENOENT",notdir:"ENOTDIR",badAuth:"ERR_BAD_AUTH"},DL={writeFile:1,readFile:2,writeDir:3,readDir:4,readObj:5,writeObj:6};rk.exports={errorCode:$L,targetType:DL}});var ck=me((hK,ak)=>{var Vu=require("fs"),BL=require("path"),{errorCode:nk}=hb();function ik(e,t,r){return a(n=>{if(e.endCalled||e.errorHandled){e.debugMsg(`${t} errorListener - ignoring handled error`);return}e.errorHandled=!0;let o=new Error(`${t}: ${n.message}`);if(o.code=n.code,r)r(o);else throw o},"fn")}a(ik,"errorListener");function zL(e,t){return()=>{e.endCalled||e.errorHandled||e.closeHandled?e.debugMsg(`Global ${t} event: Ignoring expected and handled event`):(e.debugMsg(`Global ${t} event: Handling unexpected event`),e.sftp=void 0)}}a(zL,"globalListener");function ok(e,t,r){return a(function(){if(e.sftp=void 0,e.endCalled||e.endHandled||e.errorHandled){e.debugMsg(`${t} endListener - ignoring handled error`);return}e.endHandled=!0,e.debugMsg(`${t} Unexpected end event - ignoring`)},"fn")}a(ok,"endListener");function sk(e,t,r){return a(function(){if(e.sftp=void 0,e.endCalled||e.closeHandled||e.errorHandled||e.endHandled){e.debugMsg(`${t} closeListener - ignoring handled error`);return}e.closeHandled=!0,e.debugMsg(`${t} Unexpected close event raised - ignoring`)},"fn")}a(sk,"closeListener");function LL(e,t,r){let i={end:ok(e,t,r),close:sk(e,t,r),error:ik(e,t,r)};return e.on("end",i.end),e.on("close",i.close),e.on("error",i.error),e._resetEventFlags(),i}a(LL,"addTempListeners");function UL(e,t,r){try{e.removeListener("end",t.end),e.removeListener("close",t.close),e.removeListener("error",t.error)}catch(i){throw new Error(`${r}: Error removing temp listeners: ${i.message}`)}}a(UL,"removeTempListeners");function gb(e){let t=Vu.statSync(e,{throwIfNoEntry:!1});if(t){if(t.isDirectory())return"d";if(t.isFile())return"-";{let r=new Error(`Bad path: ${e}: target must be a file or directory`);throw r.code=nk.badPath,r}}else return!1}a(gb,"localExists");function mb(e,t="r"){let r=Vu.constants.F_OK|t==="w"?Vu.constants.W_OK:Vu.constants.R_OK;try{return Vu.accessSync(e,r),{status:!0,type:gb(e),details:"access OK",code:0}}catch(i){switch(i.errno){case-2:return{status:!1,type:null,details:"not exist",code:-2};case-13:return{status:!1,type:gb(e),details:"permission denied",code:-13};case-20:return{status:!1,type:null,details:"parent not a directory"};default:return{status:!1,type:null,details:i.message}}}}a(mb,"haveLocalAccess");function ML(e){let{status:t,details:r,type:i}=mb(e,"w");if(!t&&r==="permission denied")return{status:t,details:r,type:i};if(!t){let n=BL.dirname(e),o=mb(n,"w");return o.status&&o.type!=="d"?{status:!1,details:`${n}: not a directory`,type:null}:o.status?{status:!0,details:"access OK",type:null,code:0}:{status:o.status,details:`${n}: ${o.details}`,type:null}}return{status:t,details:r,type:i}}a(ML,"haveLocalCreate");async function FL(e,t){try{return t.startsWith("..")?`${await e.realPath("..")}/${t.slice(3)}`:t.startsWith(".")?`${await e.realPath(".")}/${t.slice(2)}`:t}catch(r){throw new Error(`normalizeRemotePath: ${r.message}`)}}a(FL,"normalizeRemotePath");function HL(e,t,r){if(!e.sftp){let i=new Error(`${t}: No SFTP connection available`);if(i.code=nk.connect,r)return r(i),!1;throw i}return!0}a(HL,"haveConnection");function jL(e){return new Promise((t,r)=>{try{isNaN(e)||e<0?r("Argument must be anumber >= 0"):setTimeout(()=>{t(!0)},e)}catch(i){r(i)}})}a(jL,"sleep");ak.exports={globalListener:zL,errorListener:ik,endListener:ok,closeListener:sk,addTempListeners:LL,removeTempListeners:UL,haveLocalAccess:mb,haveLocalCreate:ML,normalizeRemotePath:FL,localExists:gb,haveConnection:HL,sleep:jL}});var dk=me((mK,fk)=>{"use strict";var{Client:WL}=PP(),Kp=require("fs"),qL=WT(),VL=tk(),{join:Zu,parse:ZL}=require("path"),{globalListener:_b,addTempListeners:Gt,removeTempListeners:Yt,haveConnection:wr,normalizeRemotePath:Qu,localExists:uk,haveLocalAccess:lk,haveLocalCreate:yb}=ck(),{errorCode:Wt}=hb(),Eb=class{static{a(this,"SftpClient")}constructor(t){this.version="9.0.4",this.client=new WL,this.sftp=void 0,this.clientName=t||"sftp",this.endCalled=!1,this.errorHandled=!1,this.closeHandled=!1,this.endHandled=!1,this.remotePlatform="unix",this.debug=void 0,this.client.on("close",_b(this,"close")),this.client.on("end",_b(this,"end")),this.client.on("error",_b(this,"error"))}debugMsg(t,r){this.debug&&(r?this.debug(`CLIENT[${this.clientName}]: ${t} ${JSON.stringify(r,null," ")}`):this.debug(`CLIENT[${this.clientName}]: ${t}`))}fmtError(t,r="sftp",i,n){let o="",s="",c=n?` after ${n} ${n>1?"attempts":"attempt"}`:"";if(t===void 0)o=`${r}: Undefined error - probably a bug!`,s=Wt.generic;else if(typeof t=="string")o=`${r}: ${t}${c}`,s=i||Wt.generic;else if(t.custom)o=`${r}->${t.message}${c}`,s=t.code;else{switch(t.code){case"ENOTFOUND":o=`${r}: Address lookup failed for host${c}`;break;case"ECONNREFUSED":o=`${r}: Remote host refused connection${c}`;break;case"ECONNRESET":o=`${r}: Remote host has reset the connection: ${t.message}${c}`;break;default:o=`${r}: ${t.message}${c}`}s=t.code?t.code:Wt.generic}let u=new Error(o);return u.code=s,u.custom=!0,this.debugMsg(`${u.message} (${u.code})`),u}on(t,r){this.client.prependListener(t,r)}removeListener(t,r){this.client.removeListener(t,r)}_resetEventFlags(){this.closeHandled=!1,this.endHandled=!1,this.errorHandled=!1}getConnection(t){let r,i;return new Promise((n,o)=>{i=Gt(this,"getConnection",o),r=a(()=>{this.debugMsg("getConnection ready listener: got connection - promise resolved"),n(!0)},"doReady"),this.on("ready",r);try{this.client.connect(t)}catch(s){this.debugMsg(`getConnection: ${s.message}`),o(s)}}).finally(()=>{this.removeListener("ready",r),Yt(this,i,"getConnection")})}getSftpChannel(){return new Promise((t,r)=>{this.client.sftp((i,n)=>{i?r(this.fmtError(i,"getSftpChannel",i.code)):(this.sftp=n,t(n))})})}async connect(t){let r;try{if(r=Gt(this,"connect"),t.debug&&(this.debug=t.debug,this.debugMsg("connect: Debugging turned on"),this.debugMsg(`ssh2-sftp-client Version: ${this.version} `,process.versions)),this.sftp)throw this.fmtError("An existing SFTP connection is already defined","connect",Wt.connect);let i={retries:t.retries??1,factor:t.factor??2,minTimeout:t.retry_minTimeout??25e3};return await VL(i,async(o,s)=>{try{this.debugMsg(`connect: Connect attempt ${s}`),await this.getConnection(t)}catch(c){switch(c.code){case"ENOTFOUND":case"ECONNREFUSED":case"ERR_SOCKET_BAD_PORT":throw c;case void 0:{if(c.message.endsWith("All configured authentication methods failed")||c.message.startsWith("Cannot parse privateKey"))throw c;o(c);break}default:o(c)}}}),await this.getSftpChannel()}catch(i){throw this.end(),i.custom?i:this.fmtError(i,"connect")}finally{Yt(this,r,"connect")}}realPath(t,r=!0){let i;return new Promise((n,o)=>{r&&(i=Gt(this,"realPath",o)),this.debugMsg(`realPath -> ${t}`),this.sftp.realpath(t,(s,c)=>{s&&(s.code===2?(this.debugMsg('realPath <- ""'),n("")):(this.debugMsg(`${s.message} ${t}`,"realPath"),o(this.fmtError(`${s.message} ${t}`,"realPath",s.code)))),this.debugMsg(`realPath <- ${c}`),n(c)})}).finally(()=>{r&&Yt(this,i,"realPath")})}cwd(){return this.realPath(".")}_xstat(t,r,i=!0){let n;return new Promise((o,s)=>{let c=a((u,l)=>{if(u)u.code===2||u.code===4?s(this.fmtError(`No such file: ${r}`,"_xstat",Wt.notexist)):s(this.fmtError(`${u.message} ${r}`,"_xstat",u.code));else{let f={mode:l.mode,uid:l.uid,gid:l.gid,size:l.size,accessTime:l.atime*1e3,modifyTime:l.mtime*1e3,isDirectory:l.isDirectory(),isFile:l.isFile(),isBlockDevice:l.isBlockDevice(),isCharacterDevice:l.isCharacterDevice(),isSymbolicLink:l.isSymbolicLink(),isFIFO:l.isFIFO(),isSocket:l.isSocket()};this.debugMsg("_xstat: result = ",f),o(f)}},"cb");i&&(n=Gt(this,"_xstat",s)),t==="stat"?this.sftp.stat(r,c):this.sftp.lstat(r,c)}).finally(()=>{i&&Yt(this,n,"_xstat")})}async stat(t){try{return wr(this,"stat"),await this._xstat("stat",t)}catch(r){throw r.custom?r:this.fmtError(r,"stat",r.code)}}async lstat(t){try{return wr(this,"lstat"),await this._xstat("lstat",t)}catch(r){throw r.custom?r:this.fmtError(r,"lstat",r.code)}}async exists(t){this.debugMsg(`exists: remotePath = ${t}`);try{if(t===".")return"d";let r=await this.lstat(t);return this.debugMsg("exists: <- ",r),r.isDirectory?"d":r.isSymbolicLink?"l":r.isFile?"-":!1}catch(r){if(r.code===Wt.notexist)return!1;throw r.custom?r:this.fmtError(r.message,"exists",r.code)}}list(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Gt(this,"list",s)),wr(this,"list",s)&&this.sftp.readdir(t,(c,u)=>{if(c)s(this.fmtError(`${c.message} ${t}`,"list",c.code));else{let l=/-/gi,f=u.map(p=>({type:p.longname.slice(0,1),name:p.filename,size:p.attrs.size,modifyTime:p.attrs.mtime*1e3,accessTime:p.attrs.atime*1e3,rights:{user:p.longname.slice(1,4).replace(l,""),group:p.longname.slice(4,7).replace(l,""),other:p.longname.slice(7,10).replace(l,"")},owner:p.attrs.uid,group:p.attrs.gid,longname:p.longname}));o(r?f.filter(p=>r(p)):f)}})}).finally(()=>{i&&Yt(this,n,"list")})}get(t,r,i,n=!0){let o,s,c;return new Promise((u,l)=>{if(n&&(o=Gt(this,"get",l)),wr(this,"get",l)){if(i={readStreamOptions:{...i?.readStreamOptions,autoClose:!0},writeStreamOptions:{...i?.writeStreamOptions,autoClose:!0},pipeOptions:{...i?.pipeOptions,end:!0}},s=this.sftp.createReadStream(t,i.readStreamOptions),s.once("error",f=>{r&&typeof r!="string"&&!r.destroyed&&r.destroy(),l(this.fmtError(`${f.message} ${t}`,"get",f.code))}),r===void 0)this.debugMsg("get resolving buffer of data"),c=qL(f=>{u(f)});else if(typeof r=="string"){this.debugMsg("get returning local file");let f=yb(r);if(f.status)c=Kp.createWriteStream(r,i.writeStreamOptions);else{l(this.fmtError(`Bad path: ${r}: ${f.details}`,"get",f.code));return}}else this.debugMsg("get: returning data into supplied stream"),c=r;c.once("error",f=>{l(this.fmtError(`${f.message} ${typeof r=="string"?r:"<stream>"}`,"get",f.code))}),s.once("end",()=>{typeof r=="string"?(this.debugMsg("get: resolving with dst filename"),u(r)):r!==void 0&&(this.debugMsg("get: resolving with writer stream object"),u(c))}),s.pipe(c,i.pipeOptions)}}).finally(()=>{n&&Yt(this,o,"get")})}_fastGet(t,r,i,n=!0){let o;return new Promise((s,c)=>{n&&(o=Gt(this,"_fastGet",c)),wr(this,"_fastGet",c)&&this.sftp.fastGet(t,r,i,u=>{u&&c(this.fmtError(`${u.message} Remote: ${t} Local: ${r}`)),s(`${t} was successfully download to ${r}!`)})}).finally(()=>{n&&Yt(this,o,"_fastGet")})}async fastGet(t,r,i){try{let n=await this.exists(t);if(n!=="-"){let s=`${n?"Not a regular file":"No such file "} ${t}`;throw this.fmtError(s,"fastGet",Wt.badPath)}let o=yb(r);if(!o.status)throw this.fmtError(`Bad path: ${r}: ${o.details}`,"fastGet",Wt.badPath);return await this._fastGet(t,r,i)}catch(n){throw this.fmtError(n,"fastGet")}}_fastPut(t,r,i,n=!0){let o;return new Promise((s,c)=>{n&&(o=Gt(this,"_fastPut",c)),wr(this,"_fastPut",c)&&this.sftp.fastPut(t,r,i,u=>{u&&c(this.fmtError(`${u.message} Local: ${t} Remote: ${r}`,"fastPut",u.code)),s(`${t} was successfully uploaded to ${r}!`)})}).finally(()=>{n&&Yt(this,o,"_fastPut")})}async fastPut(t,r,i){try{this.debugMsg(`fastPut -> local ${t} remote ${r}`);let n=lk(t);if(n.status){if(n.status&&uk(t)==="d")throw this.fmtError(`Bad path: ${t} not a regular file`,"fastgPut",Wt.badPath)}else throw this.fmtError(`Bad path: ${t}: ${n.details}`,"fastPut",n.code);return await this._fastPut(t,r,i)}catch(n){throw n.custom?n:this.fmtError(n.message,"fastPut",n.code)}}_put(t,r,i,n=!0){let o,s,c;return new Promise((u,l)=>{n&&(o=Gt(this,"_put",l)),i={readStreamOptions:{...i?.readStreamOptions,autoClose:!0},writeStreamOptions:{...i?.writeStreamOptions,autoClose:!0},pipeOptions:{...i?.pipeOptions,end:!0}},wr(this,"_put",l)&&(s=this.sftp.createWriteStream(r,i.writeStreamOptions),s.once("error",f=>{l(this.fmtError(`Write stream error: ${f.message} ${r}`,"_put",f.code))}),s.once("close",()=>{u(`Uploaded data stream to ${r}`)}),t instanceof Buffer?(this.debugMsg("put source is a buffer"),s.end(t)):(c=typeof t=="string"?Kp.createReadStream(t,i.readStreamOptions):t,c.once("error",f=>{l(this.fmtError(`Read stream error: ${f.message} ${typeof t=="string"?t:"<stream>"}`,"_put",f.code))}),c.pipe(s,i.pipeOptions)))}).finally(()=>{n&&Yt(this,o,"_put")})}async put(t,r,i){try{if(typeof t=="string"){let n=lk(t);if(!n.status)throw this.fmtError(`Bad path: ${t} ${n.details}`,"put",n.code)}return await this._put(t,r,i)}catch(n){throw n.custom?n:this.fmtError(`Re-thrown: ${n.message}`,"put",n.code)}}_append(t,r,i,n=!0){let o;return new Promise((s,c)=>{if(n&&(o=Gt(this,"_append",c)),wr(this,"_append",c)){this.debugMsg(`append -> remote: ${r} `,i),i.flags="a";let u=this.sftp.createWriteStream(r,i);u.on("error",l=>{c(this.fmtError(`${l.message} ${r}`,"append",l.code))}),u.on("close",()=>{s(`Appended data to ${r}`)}),t instanceof Buffer?(u.write(t),u.end()):t.pipe(u)}}).finally(()=>{n&&Yt(this,o,"_append")})}async append(t,r,i={}){try{if(typeof t=="string")throw this.fmtError("Cannot append one file to another","append",Wt.badPath);let n=await this.exists(r);if(n&&n==="d")throw this.fmtError(`Bad path: ${r}: cannot append to a directory`,"append",Wt.badPath);await this._append(t,r,i)}catch(n){throw n.custom?n:this.fmtError(n.message,"append",n.code)}}_doMkdir(t,r=!0){let i;return new Promise((n,o)=>{r&&(i=Gt(this,"_doMkdir",o)),this.sftp.mkdir(t,s=>{s?s.code===4?o(this.fmtError(`Bad path: ${t} permission denied`,"_doMkdir",Wt.badPath)):s.code===2?o(this.fmtError(`Bad path: ${t} parent not a directory or not exist`,"_doMkdir",Wt.badPath)):o(this.fmtError(`${s.message} ${t}`,"_doMkdir",s.code)):n(`${t} directory created`)})}).finally(()=>{r&&Yt(this,i,"_doMkdir")})}async _mkdir(t,r){try{let i=await Qu(this,t),n=await this.exists(i);if(n&&n!=="d")throw this.fmtError(`Bad path: ${i} already exists as a file`,"_mkdir",Wt.badPath);if(n)return`${i} already exists`;if(!r)return await this._doMkdir(i);let o=ZL(i).dir;if(o){let s=await this.exists(o);if(!s)await this._mkdir(o,!0);else if(s!=="d")throw this.fmtError(`Bad path: ${o} not a directory`,"_mkdir",Wt.badPath)}return await this._doMkdir(i)}catch(i){throw i.custom?i:this.fmtError(`${i.message} ${t}`,"_mkdir",i.code)}}async mkdir(t,r=!1){try{return wr(this,"mkdir"),await this._mkdir(t,r)}catch(i){throw this.fmtError(`${i.message}`,"mkdir",i.code)}}async rmdir(t,r=!1){let i=a(o=>{let s;return new Promise((c,u)=>{s=Gt(this,"_rmdir",u),this.debugMsg(`_rmdir: dir = ${o}`),this.sftp.rmdir(o,l=>{l&&u(this.fmtError(`${l.message} ${o}`,"rmdir",l.code)),c("Successfully removed directory")})}).finally(()=>{Yt(this,s,"_rmdir")})},"_rmdir"),n=a((o,s)=>{let c;return new Promise((u,l)=>{c=Gt(this,"_delFiles",l),this.debugMsg(`_delFiles: path = ${o} fileList = ${s}`);let f=[];for(let p of s)f.push(this.delete(`${o}/${p.name}`,!0,!1));u(f)}).then(u=>Promise.all(u)).finally(()=>{Yt(this,c,"_delFiles")})},"_delFiles");try{this.debugMsg(`rmdir: dir = ${t} recursive = ${r}`);let o=await Qu(this,t),s=await this.exists(o);if(this.debugMsg(`rmdir: ${o} existStatus = ${s}`),!s)throw this.fmtError(`Bad Path: ${t}: No such directory`,"rmdir",Wt.badPath);if(s!=="d")throw this.fmtError(`Bad Path: ${t}: Not a directory`,"rmdir",Wt.badPath);if(!r)return this.debugMsg("rmdir: non-recursive - just try to remove it"),await i(o);let c=await this.list(o);if(this.debugMsg(`rmdir: listing count = ${c.length}`),!c.length)return this.debugMsg("rmdir: No sub dir or files, just rmdir"),await i(o);let u=c.filter(f=>f.type!=="d");this.debugMsg(`rmdir: dir content files to remove = ${u.length}`);let l=c.filter(f=>f.type==="d");this.debugMsg(`rmdir: sub-directories to remove = ${l.length}`),await n(o,u);for(let f of l)await this.rmdir(`${o}/${f.name}`,!0);return await i(o),"Successfully removed directory"}catch(o){throw o.custom?o:this.fmtError(`${o.message} ${t}`,"rmdir",o.code)}}delete(t,r=!1,i=!0){let n;return new Promise((o,s)=>{i&&(n=Gt(this,"delete",s)),this.sftp.unlink(t,c=>{c&&(r&&c.code===2?o(`Successfully deleted ${t}`):s(this.fmtError(`${c.message} ${t}`,"delete",c.code))),o(`Successfully deleted ${t}`)})}).finally(()=>{i&&Yt(this,n,"delete")})}rename(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Gt(this,"rename",s)),wr(this,"rename",s)&&this.sftp.rename(t,r,c=>{c&&s(this.fmtError(`${c.message} From: ${t} To: ${r}`,"_rename",c.code)),o(`Successfully renamed ${t} to ${r}`)})}).finally(()=>{i&&Yt(this,n,"rename")})}posixRename(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Gt(this,"posixRename",s)),wr(this,"posixRename",s)&&this.sftp.ext_openssh_rename(t,r,c=>{c&&s(this.fmtError(`${c.message} From: ${t} To: ${r}`,"_posixRename",c.code)),o(`Successful POSIX rename ${t} to ${r}`)})}).finally(()=>{Yt(this,n,"posixRename")})}chmod(t,r,i=!0){let n;return new Promise((o,s)=>{i&&(n=Gt(this,"chmod",s)),wr(this,"chmod",s)&&this.sftp.chmod(t,r,c=>{c&&s(this.fmtError(`${c.message} ${t}`,"_chmod",c.code)),o("Successfully change file mode")})}).finally(()=>{i&&Yt(this,n,"chmod")})}async uploadDir(t,r,i){let n=a(async c=>{let u=await Qu(this,c),l=await this.exists(u);if(l&&l!=="d")throw this.fmtError(`Bad path ${u} Not a directory`,"getRemoteStatus",Wt.badPath);return{remoteDir:u,remoteStatus:l}},"getRemoteStatus"),o=a(c=>{let u=uk(c);if(!u)throw this.fmtError(`Bad path: ${c} not exist`,"getLocalStatus",Wt.badPath);if(u!=="d")throw this.fmtError(`Bad path: ${c}: not a directory`,"getLocalStatus",Wt.badPath);return u},"checkLocalStatus"),s=a((c,u,l,f)=>{let p;return new Promise((g,h)=>{p=Gt(this,"uploadFiles",h);let _=[];for(let y of l){let b=Zu(c,y.name),v=`${u}/${y.name}`;y.isFile()?(f?_.push(this._fastPut(b,v,null,!1)):_.push(this._put(b,v,null,!1)),this.client.emit("upload",{source:b,destination:v})):this.debugMsg(`uploadFiles: File ignored: ${y.name} not a regular file`)}g(Promise.all(_))}).then(g=>Promise.all(g)).finally(()=>{Yt(this,p,s)})},"uploadFiles");try{wr(this,"uploadDir"),this.debugMsg(`uploadDir: srcDir = ${t} dstDir = ${r} options = ${i}`);let{remoteDir:c,remoteStatus:u}=await n(r);this.debugMsg(`uploadDir: remoteDir = ${c} remoteStatus = ${u}`),o(t),u||await this._mkdir(c,!0);let l=Kp.readdirSync(t,{encoding:"utf8",withFileTypes:!0});this.debugMsg(`uploadDir: dirEntries = ${l}`),i?.filter&&(l=l.filter(g=>i.filter(Zu(t,g.name),g.isDirectory())));let f=l.filter(g=>g.isDirectory()),p=l.filter(g=>!g.isDirectory());this.debugMsg(`uploadDir: dirUploads = ${f}`),this.debugMsg(`uploadDir: fileUploads = ${p}`),await s(t,c,p,i?.useFastput);for(let g of f){let h=Zu(t,g.name),_=`${c}/${g.name}`;await this.uploadDir(h,_,i)}return`${t} uploaded to ${r}`}catch(c){throw c.custom?c:this.fmtError(`${c.message} ${t}`,"uploadDir",c.code)}}async downloadDir(t,r,i={filter:null,useFastget:!1}){let n=a(async(c,u)=>{try{let l=await this.list(c);return u?l.filter(f=>u(`${c}/${f.name}`,f.type==="d")):l}catch(l){throw l.custom?l:this.fmtError(l.message,"_getDownloadList",l.code)}},"_getDownloadList"),o=a(c=>{try{let u=yb(c);if(!u.status&&u.details==="permission denied")throw this.fmtError(`Bad path: ${c}: ${u.details}`,"prepareDestination",u.code);if(u.status&&!u.type)Kp.mkdirSync(c,{recursive:!0});else if(u.status&&u.type!=="d")throw this.fmtError(`Bad path: ${r}: not a directory`,"_prepareDestination",Wt.badPath)}catch(u){throw u.custom?u:this.fmtError(u.message,"_prepareDestination",u.code)}},"_prepareDestination"),s=a((c,u,l,f)=>{let p;return new Promise((g,h)=>{p=Gt(this,"_downloadFIles",h);let _=[];for(let y of l){let b=`${c}/${y.name}`,v=Zu(u,y.name);f?_.push(this.fastGet(b,v,!1)):_.push(this.get(b,v,!1)),this.client.emit("download",{source:b,destination:v})}return g(Promise.all(_))}).finally(()=>{Yt(this,p,"_downloadFiles")})},"_downloadFiles");try{wr(this,"downloadDir");let c=await n(t,i.filter);o(r);let u=c.filter(f=>f.type!=="d");u.length&&await s(t,r,u,i.useFastget);let l=c.filter(f=>f.type==="d");for(let f of l){let p=`${t}/${f.name}`,g=Zu(r,f.name);await this.downloadDir(p,g)}return`${t} downloaded to ${r}`}catch(c){throw c.custom?c:this.fmtError(`${c.message}: ${t}`,"downloadDir",c.code)}}createReadStream(t,r){let i;try{return i=Gt(this,"createReadStream"),wr(this,"createReadStream"),this.sftp.createReadStream(t,r)}catch(n){throw n.custom?n:this.fmtError(n.message,"createReadStream",n.code)}finally{Yt(this,i,"createReadStreame")}}createWriteStream(t,r){let i;try{return i=Gt(this,"createWriteStream"),wr(this,"createWriteStream"),this.sftp.createWriteStream(t,r)}catch(n){throw n.custom?n:this.fmtError(n.message,"createWriteStream",n.code)}finally{Yt(this,i,"createWriteStream")}}_rcopy(t,r){return new Promise((i,n)=>{let o=this.sftp.createWriteStream(r),s=this.sftp.createReadStream(t);o.on("error",c=>{n(this.fmtError(`${c.message} ${r}`,"_rcopy"))}),s.on("error",c=>{n(this.fmtError(`${c.message} ${t}`,"_rcopy"))}),o.on("close",()=>{i(`${t} copied to ${r}`)}),s.pipe(o)})}async rcopy(t,r){let i;try{i=Gt(this,"rcopy"),wr(this,"rcopy");let n=await Qu(this,t),o=await this.exists(n);if(!o)throw this.fmtError(`Source does not exist ${n}`,"rcopy",Wt.badPath);if(o!=="-")throw this.fmtError(`Source not a file ${n}`,"rcopy",Wt.badPath);let s=await Qu(this,r);if(await this.exists(s))throw this.fmtError(`Destination already exists ${s}`,"rcopy",Wt.badPath);return this._rcopy(n,s)}catch(n){throw n.custom?n:this.fmtError(n,"rcopy")}finally{Yt(this,i,"rcopy")}}end(){let t,r;return new Promise((i,n)=>{r=Gt(this,"end",n),this.endCalled=!0,t=a(()=>{this.sftp=void 0,this.debugMsg("end: Connection closed"),i(!0)},"endCloseHandler"),this.on("close",t),this.sftp?this.client.end():(this.debugMsg("end: Called when no connection active"),i(!0))}).finally(()=>{Yt(this,r,"end"),this.removeListener("close",t),this.endCalled=!1})}};fk.exports=Eb});var Nk=me((bb,xb)=>{(function(e,t){typeof bb=="object"&&typeof xb<"u"?xb.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(bb,(function(){"use strict";var e=1e3,t=6e4,r=36e5,i="millisecond",n="second",o="minute",s="hour",c="day",u="week",l="month",f="quarter",p="year",g="date",h="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:a(function(U){var k=["th","st","nd","rd"],j=U%100;return"["+U+(k[(j-20)%10]||k[j]||k[0])+"]"},"ordinal")},v=a(function(U,k,j){var W=String(U);return!W||W.length>=k?U:""+Array(k+1-W.length).join(j)+U},"m"),S={s:v,z:a(function(U){var k=-U.utcOffset(),j=Math.abs(k),W=Math.floor(j/60),z=j%60;return(k<=0?"+":"-")+v(W,2,"0")+":"+v(z,2,"0")},"z"),m:a(function U(k,j){if(k.date()<j.date())return-U(j,k);var W=12*(j.year()-k.year())+(j.month()-k.month()),z=k.clone().add(W,l),X=j-z<0,ne=k.clone().add(W+(X?-1:1),l);return+(-(W+(j-z)/(X?z-ne:ne-z))||0)},"t"),a:a(function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},"a"),p:a(function(U){return{M:l,y:p,w:u,d:c,D:g,h:s,m:o,s:n,ms:i,Q:f}[U]||String(U||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(U){return U===void 0},"u")},M="en",R={};R[M]=b;var J=a(function(U){return U instanceof C},"p"),te=a(function U(k,j,W){var z;if(!k)return M;if(typeof k=="string"){var X=k.toLowerCase();R[X]&&(z=X),j&&(R[X]=j,z=X);var ne=k.split("-");if(!z&&ne.length>1)return U(ne[0])}else{var O=k.name;R[O]=k,z=O}return!W&&z&&(M=z),z||!W&&M},"t"),ee=a(function(U,k){if(J(U))return U.clone();var j=typeof k=="object"?k:{};return j.date=U,j.args=arguments,new C(j)},"w"),P=S;P.l=te,P.i=J,P.w=function(U,k){return ee(U,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var C=(function(){function U(j){this.$L=te(j.locale,null,!0),this.parse(j)}a(U,"M");var k=U.prototype;return k.parse=function(j){this.$d=(function(W){var z=W.date,X=W.utc;if(z===null)return new Date(NaN);if(P.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var ne=z.match(_);if(ne){var O=ne[2]-1||0,q=(ne[7]||"0").substring(0,3);return X?new Date(Date.UTC(ne[1],O,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,q)):new Date(ne[1],O,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,q)}}return new Date(z)})(j),this.$x=j.x||{},this.init()},k.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},k.$utils=function(){return P},k.isValid=function(){return this.$d.toString()!==h},k.isSame=function(j,W){var z=ee(j);return this.startOf(W)<=z&&z<=this.endOf(W)},k.isAfter=function(j,W){return ee(j)<this.startOf(W)},k.isBefore=function(j,W){return this.endOf(W)<ee(j)},k.$g=function(j,W,z){return P.u(j)?this[W]:this.set(z,j)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(j,W){var z=this,X=!!P.u(W)||W,ne=P.p(j),O=a(function(Mt,ur){var $r=P.w(z.$u?Date.UTC(z.$y,ur,Mt):new Date(z.$y,ur,Mt),z);return X?$r:$r.endOf(c)},"l"),q=a(function(Mt,ur){return P.w(z.toDate()[Mt].apply(z.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(ur)),z)},"$"),V=this.$W,re=this.$M,_e=this.$D,ve="set"+(this.$u?"UTC":"");switch(ne){case p:return X?O(1,0):O(31,11);case l:return X?O(1,re):O(0,re+1);case u:var xe=this.$locale().weekStart||0,Tt=(V<xe?V+7:V)-xe;return O(X?_e-Tt:_e+(6-Tt),re);case c:case g:return q(ve+"Hours",0);case s:return q(ve+"Minutes",1);case o:return q(ve+"Seconds",2);case n:return q(ve+"Milliseconds",3);default:return this.clone()}},k.endOf=function(j){return this.startOf(j,!1)},k.$set=function(j,W){var z,X=P.p(j),ne="set"+(this.$u?"UTC":""),O=(z={},z[c]=ne+"Date",z[g]=ne+"Date",z[l]=ne+"Month",z[p]=ne+"FullYear",z[s]=ne+"Hours",z[o]=ne+"Minutes",z[n]=ne+"Seconds",z[i]=ne+"Milliseconds",z)[X],q=X===c?this.$D+(W-this.$W):W;if(X===l||X===p){var V=this.clone().set(g,1);V.$d[O](q),V.init(),this.$d=V.set(g,Math.min(this.$D,V.daysInMonth())).$d}else O&&this.$d[O](q);return this.init(),this},k.set=function(j,W){return this.clone().$set(j,W)},k.get=function(j){return this[P.p(j)]()},k.add=function(j,W){var z,X=this;j=Number(j);var ne=P.p(W),O=a(function(re){var _e=ee(X);return P.w(_e.date(_e.date()+Math.round(re*j)),X)},"y");if(ne===l)return this.set(l,this.$M+j);if(ne===p)return this.set(p,this.$y+j);if(ne===c)return O(1);if(ne===u)return O(7);var q=(z={},z[o]=t,z[s]=r,z[n]=e,z)[ne]||1,V=this.$d.getTime()+j*q;return P.w(V,this)},k.subtract=function(j,W){return this.add(-1*j,W)},k.format=function(j){var W=this,z=this.$locale();if(!this.isValid())return z.invalidDate||h;var X=j||"YYYY-MM-DDTHH:mm:ssZ",ne=P.z(this),O=this.$H,q=this.$m,V=this.$M,re=z.weekdays,_e=z.months,ve=z.meridiem,xe=a(function(ur,$r,sn,Hr){return ur&&(ur[$r]||ur(W,X))||sn[$r].slice(0,Hr)},"h"),Tt=a(function(ur){return P.s(O%12||12,ur,"0")},"d"),Mt=ve||function(ur,$r,sn){var Hr=ur<12?"AM":"PM";return sn?Hr.toLowerCase():Hr};return X.replace(y,(function(ur,$r){return $r||(function(sn){switch(sn){case"YY":return String(W.$y).slice(-2);case"YYYY":return P.s(W.$y,4,"0");case"M":return V+1;case"MM":return P.s(V+1,2,"0");case"MMM":return xe(z.monthsShort,V,_e,3);case"MMMM":return xe(_e,V);case"D":return W.$D;case"DD":return P.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return xe(z.weekdaysMin,W.$W,re,2);case"ddd":return xe(z.weekdaysShort,W.$W,re,3);case"dddd":return re[W.$W];case"H":return String(O);case"HH":return P.s(O,2,"0");case"h":return Tt(1);case"hh":return Tt(2);case"a":return Mt(O,q,!0);case"A":return Mt(O,q,!1);case"m":return String(q);case"mm":return P.s(q,2,"0");case"s":return String(W.$s);case"ss":return P.s(W.$s,2,"0");case"SSS":return P.s(W.$ms,3,"0");case"Z":return ne}return null})(ur)||ne.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(j,W,z){var X,ne=this,O=P.p(W),q=ee(j),V=(q.utcOffset()-this.utcOffset())*t,re=this-q,_e=a(function(){return P.m(ne,q)},"D");switch(O){case p:X=_e()/12;break;case l:X=_e();break;case f:X=_e()/3;break;case u:X=(re-V)/6048e5;break;case c:X=(re-V)/864e5;break;case s:X=re/r;break;case o:X=re/t;break;case n:X=re/e;break;default:X=re}return z?X:P.a(X)},k.daysInMonth=function(){return this.endOf(l).$D},k.$locale=function(){return R[this.$L]},k.locale=function(j,W){if(!j)return this.$L;var z=this.clone(),X=te(j,W,!0);return X&&(z.$L=X),z},k.clone=function(){return P.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},U})(),H=C.prototype;return ee.prototype=H,[["$ms",i],["$s",n],["$m",o],["$H",s],["$W",c],["$M",l],["$y",p],["$D",g]].forEach((function(U){H[U[1]]=function(k){return this.$g(k,U[0],U[1])}})),ee.extend=function(U,k){return U.$i||(U(k,C,ee),U.$i=!0),ee},ee.locale=te,ee.isDayjs=J,ee.unix=function(U){return ee(1e3*U)},ee.en=R[M],ee.Ls=R,ee.p={},ee}))});var gU={};cn(gU,{endClient:()=>sr,ftpSftp:()=>hU,getClient:()=>Xt,getProtocolBackwardCompatibility:()=>qt});module.exports=eC(gU);var en={};cn(en,{$ZodAny:()=>Aa,$ZodArray:()=>va,$ZodAsyncError:()=>En,$ZodBase64:()=>Bl,$ZodBase64URL:()=>zl,$ZodBigInt:()=>Yo,$ZodBigIntFormat:()=>Fl,$ZodBoolean:()=>Qi,$ZodCIDRv4:()=>$l,$ZodCIDRv6:()=>Dl,$ZodCUID:()=>wl,$ZodCUID2:()=>Pl,$ZodCatch:()=>nf,$ZodCheck:()=>$t,$ZodCheckBigIntFormat:()=>Mh,$ZodCheckEndsWith:()=>Xh,$ZodCheckGreaterThan:()=>gl,$ZodCheckIncludes:()=>Gh,$ZodCheckLengthEquals:()=>Vh,$ZodCheckLessThan:()=>hl,$ZodCheckLowerCase:()=>Qh,$ZodCheckMaxLength:()=>Wh,$ZodCheckMaxSize:()=>Fh,$ZodCheckMimeType:()=>eg,$ZodCheckMinLength:()=>qh,$ZodCheckMinSize:()=>Hh,$ZodCheckMultipleOf:()=>Lh,$ZodCheckNumberFormat:()=>Uh,$ZodCheckOverwrite:()=>tg,$ZodCheckProperty:()=>Jh,$ZodCheckRegex:()=>Zh,$ZodCheckSizeEquals:()=>jh,$ZodCheckStartsWith:()=>Yh,$ZodCheckStringFormat:()=>Ko,$ZodCheckUpperCase:()=>Kh,$ZodCodec:()=>Jo,$ZodCustom:()=>Na,$ZodCustomStringFormat:()=>Ml,$ZodDate:()=>Ia,$ZodDefault:()=>Jl,$ZodDiscriminatedUnion:()=>Sa,$ZodE164:()=>Ll,$ZodEmail:()=>Il,$ZodEmoji:()=>vl,$ZodEncodeError:()=>oi,$ZodEnum:()=>Ta,$ZodError:()=>la,$ZodExactOptional:()=>Xl,$ZodFile:()=>Yl,$ZodFunction:()=>cf,$ZodGUID:()=>bl,$ZodIPv4:()=>Rl,$ZodIPv6:()=>Ol,$ZodISODate:()=>ma,$ZodISODateTime:()=>ga,$ZodISODuration:()=>ya,$ZodISOTime:()=>_a,$ZodIntersection:()=>Ql,$ZodJWT:()=>Ul,$ZodKSUID:()=>Cl,$ZodLazy:()=>lf,$ZodLiteral:()=>ka,$ZodMAC:()=>Nl,$ZodMap:()=>Kl,$ZodNaN:()=>of,$ZodNanoID:()=>Sl,$ZodNever:()=>ql,$ZodNonOptional:()=>tf,$ZodNull:()=>Wl,$ZodNullable:()=>Ra,$ZodNumber:()=>Go,$ZodNumberFormat:()=>Ea,$ZodObject:()=>Vl,$ZodObjectJIT:()=>og,$ZodOptional:()=>Xo,$ZodPipe:()=>Oa,$ZodPrefault:()=>ef,$ZodPromise:()=>uf,$ZodReadonly:()=>sf,$ZodRealError:()=>Wr,$ZodRecord:()=>Pa,$ZodRegistry:()=>ff,$ZodSet:()=>Gl,$ZodString:()=>Fn,$ZodStringFormat:()=>Ct,$ZodSuccess:()=>rf,$ZodSymbol:()=>Hl,$ZodTemplateLiteral:()=>af,$ZodTransform:()=>Ca,$ZodTuple:()=>wa,$ZodType:()=>We,$ZodULID:()=>Tl,$ZodURL:()=>ha,$ZodUUID:()=>xl,$ZodUndefined:()=>jl,$ZodUnion:()=>Ki,$ZodUnknown:()=>ba,$ZodVoid:()=>xa,$ZodXID:()=>kl,$ZodXor:()=>Zl,$brand:()=>na,$constructor:()=>T,$input:()=>pf,$output:()=>df,Doc:()=>pa,JSONSchema:()=>Ex,JSONSchemaGenerator:()=>zf,NEVER:()=>Xu,TimePrecision:()=>gf,_any:()=>_c,_array:()=>Xg,_base64:()=>nc,_base64url:()=>ic,_bigint:()=>Af,_boolean:()=>hc,_catch:()=>sR,_check:()=>yx,_cidrv4:()=>tc,_cidrv6:()=>rc,_coercedBigint:()=>mc,_coercedBoolean:()=>gc,_coercedDate:()=>Ac,_coercedNumber:()=>dc,_coercedString:()=>Ma,_cuid:()=>Qa,_cuid2:()=>Ka,_custom:()=>wc,_date:()=>Pf,_decode:()=>ol,_decodeAsync:()=>al,_default:()=>nR,_discriminatedUnion:()=>q1,_e164:()=>oc,_email:()=>Fa,_emoji:()=>Va,_encode:()=>il,_encodeAsync:()=>sl,_endsWith:()=>to,_enum:()=>Y1,_file:()=>kf,_float32:()=>mf,_float64:()=>_f,_gt:()=>bn,_gte:()=>mr,_guid:()=>rs,_includes:()=>Ji,_int:()=>pc,_int32:()=>yf,_int64:()=>bf,_intersection:()=>V1,_ipv4:()=>Ja,_ipv6:()=>ec,_isoDate:()=>cc,_isoDateTime:()=>ac,_isoDuration:()=>lc,_isoTime:()=>uc,_jwt:()=>sc,_ksuid:()=>Xa,_lazy:()=>lR,_length:()=>di,_literal:()=>J1,_lowercase:()=>Yi,_lt:()=>An,_lte:()=>Br,_mac:()=>hf,_map:()=>K1,_max:()=>Br,_maxLength:()=>fi,_maxSize:()=>jn,_mime:()=>ro,_min:()=>mr,_minLength:()=>cr,_minSize:()=>xn,_multipleOf:()=>Hn,_nan:()=>Tf,_nanoid:()=>Za,_nativeEnum:()=>X1,_negative:()=>xc,_never:()=>wf,_nonnegative:()=>vc,_nonoptional:()=>iR,_nonpositive:()=>Ic,_normalize:()=>no,_null:()=>Sf,_nullable:()=>rR,_number:()=>fc,_optional:()=>tR,_overwrite:()=>ln,_parse:()=>jo,_parseAsync:()=>Wo,_pipe:()=>aR,_positive:()=>bc,_promise:()=>fR,_property:()=>Sc,_readonly:()=>cR,_record:()=>Q1,_refine:()=>Pc,_regex:()=>Ir,_safeDecode:()=>ul,_safeDecodeAsync:()=>fl,_safeEncode:()=>cl,_safeEncodeAsync:()=>ll,_safeParse:()=>qo,_safeParseAsync:()=>Zo,_set:()=>G1,_size:()=>li,_slugify:()=>ns,_startsWith:()=>eo,_string:()=>Ua,_stringFormat:()=>ao,_stringbool:()=>Nf,_success:()=>oR,_superRefine:()=>Cf,_symbol:()=>If,_templateLiteral:()=>uR,_toLowerCase:()=>oo,_toUpperCase:()=>so,_transform:()=>eR,_trim:()=>io,_tuple:()=>Z1,_uint32:()=>Ef,_uint64:()=>xf,_ulid:()=>Ga,_undefined:()=>vf,_union:()=>j1,_unknown:()=>yc,_uppercase:()=>Xi,_url:()=>Gi,_uuid:()=>Ha,_uuidv4:()=>ja,_uuidv6:()=>Wa,_uuidv7:()=>qa,_void:()=>Ec,_xid:()=>Ya,_xor:()=>W1,clone:()=>yr,config:()=>Zt,createStandardJSONSchemaMethod:()=>is,createToJSONSchemaMethod:()=>Jg,decode:()=>Ub,decodeAsync:()=>Fb,describe:()=>Rf,encode:()=>Lb,encodeAsync:()=>Mb,extractDefs:()=>hi,finalize:()=>gi,flattenError:()=>Fo,formatError:()=>Ho,globalConfig:()=>ra,globalRegistry:()=>Er,initializeContext:()=>pi,isValidBase64:()=>ig,isValidBase64URL:()=>ux,isValidJWT:()=>lx,locales:()=>ts,meta:()=>Of,parse:()=>qi,parseAsync:()=>Vi,prettifyError:()=>nl,process:()=>Rt,regexes:()=>qr,registry:()=>La,safeDecode:()=>jb,safeDecodeAsync:()=>qb,safeEncode:()=>Hb,safeEncodeAsync:()=>Wb,safeParse:()=>Vo,safeParseAsync:()=>Qo,toDotPath:()=>zb,toJSONSchema:()=>Tc,treeifyError:()=>rl,util:()=>fe,version:()=>rg});var Xu=Object.freeze({status:"aborted"});function T(e,t,r){function i(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let l=s.prototype,f=Object.keys(l);for(let p=0;p<f.length;p++){let g=f[p];g in c||(c[g]=l[g].bind(c))}}a(i,"init");let n=r?.Parent??Object;class o extends n{static{a(this,"Definition")}}Object.defineProperty(o,"name",{value:e});function s(c){var u;let l=r?.Parent?new o:this;i(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let f of l._zod.deferred)f();return l}return a(s,"_"),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a(c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(T,"$constructor");var na=Symbol("zod_brand"),En=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},oi=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ra={};function Zt(e){return e&&Object.assign(ra,e),ra}a(Zt,"config");var fe={};cn(fe,{BIGINT_FORMAT_RANGES:()=>uh,Class:()=>rh,NUMBER_FORMAT_RANGES:()=>ch,aborted:()=>ui,allowsEval:()=>oh,assert:()=>oC,assertEqual:()=>tC,assertIs:()=>nC,assertNever:()=>iC,assertNotEqual:()=>rC,assignProp:()=>ai,base64ToUint8Array:()=>$b,base64urlToUint8Array:()=>mC,cached:()=>Uo,captureStackTrace:()=>el,cleanEnum:()=>gC,cleanRegex:()=>sa,clone:()=>yr,cloneDef:()=>aC,createTransparentProxy:()=>pC,defineLazy:()=>ot,esc:()=>Ju,escapeRegex:()=>un,extend:()=>Cb,finalizeIssue:()=>jr,floatSafeRemainder:()=>nh,getElementAtPath:()=>cC,getEnumValues:()=>oa,getLengthableOrigin:()=>ua,getParsedType:()=>dC,getSizableOrigin:()=>ca,hexToUint8Array:()=>yC,isObject:()=>Wi,isPlainObject:()=>ci,issue:()=>Mo,joinValues:()=>Q,jsonStringifyReplacer:()=>Lo,merge:()=>hC,mergeDefs:()=>Mn,normalizeParams:()=>ue,nullish:()=>si,numKeys:()=>fC,objectClone:()=>sC,omit:()=>kb,optionalKeys:()=>ah,parsedType:()=>pe,partial:()=>Ob,pick:()=>Tb,prefixIssues:()=>Jr,primitiveTypes:()=>sh,promiseAllObject:()=>uC,propertyKeyTypes:()=>aa,randomString:()=>lC,required:()=>Nb,safeExtend:()=>Rb,shallowClone:()=>tl,slugify:()=>ih,stringifyPrimitive:()=>le,uint8ArrayToBase64:()=>Db,uint8ArrayToBase64url:()=>_C,uint8ArrayToHex:()=>EC,unwrapMessage:()=>ia});function tC(e){return e}a(tC,"assertEqual");function rC(e){return e}a(rC,"assertNotEqual");function nC(e){}a(nC,"assertIs");function iC(e){throw new Error("Unexpected value in exhaustive check")}a(iC,"assertNever");function oC(e){}a(oC,"assert");function oa(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}a(oa,"getEnumValues");function Q(e,t="|"){return e.map(r=>le(r)).join(t)}a(Q,"joinValues");function Lo(e,t){return typeof t=="bigint"?t.toString():t}a(Lo,"jsonStringifyReplacer");function Uo(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Uo,"cached");function si(e){return e==null}a(si,"nullish");function sa(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(sa,"cleanRegex");function nh(e,t){let r=(e.toString().split(".")[1]||"").length,i=t.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let u=i.match(/\d?e-(\d?)/);u?.[1]&&(n=Number.parseInt(u[1]))}let o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return s%c/10**o}a(nh,"floatSafeRemainder");var Pb=Symbol("evaluating");function ot(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==Pb)return i===void 0&&(i=Pb,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}a(ot,"defineLazy");function sC(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}a(sC,"objectClone");function ai(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(ai,"assignProp");function Mn(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}a(Mn,"mergeDefs");function aC(e){return Mn(e._zod.def)}a(aC,"cloneDef");function cC(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}a(cC,"getElementAtPath");function uC(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}a(uC,"promiseAllObject");function lC(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}a(lC,"randomString");function Ju(e){return JSON.stringify(e)}a(Ju,"esc");function ih(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(ih,"slugify");var el="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Wi,"isObject");var oh=Uo(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ci(e){if(Wi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Wi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(ci,"isPlainObject");function tl(e){return ci(e)?{...e}:Array.isArray(e)?[...e]:e}a(tl,"shallowClone");function fC(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}a(fC,"numKeys");var dC=a(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),aa=new Set(["string","number","symbol"]),sh=new Set(["string","number","bigint","boolean","symbol","undefined"]);function un(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(un,"escapeRegex");function yr(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}a(yr,"clone");function ue(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(ue,"normalizeParams");function pC(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}a(pC,"createTransparentProxy");function le(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}a(le,"stringifyPrimitive");function ah(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(ah,"optionalKeys");var ch={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]},uh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Tb(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Mn(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(s[c]=r.shape[c])}return ai(this,"shape",s),s},checks:[]});return yr(e,o)}a(Tb,"pick");function kb(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Mn(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete s[c]}return ai(this,"shape",s),s},checks:[]});return yr(e,o)}a(kb,"omit");function Cb(e,t){if(!ci(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Mn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return ai(this,"shape",o),o}});return yr(e,n)}a(Cb,"extend");function Rb(e,t){if(!ci(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Mn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return ai(this,"shape",i),i}});return yr(e,r)}a(Rb,"safeExtend");function hC(e,t){let r=Mn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return ai(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return yr(e,r)}a(hC,"merge");function Ob(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Mn(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(r)for(let l in r){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:c[l]}):c[l])}else for(let l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return ai(this,"shape",u),u},checks:[]});return yr(t,s)}a(Ob,"partial");function Nb(e,t,r){let i=Mn(t._zod.def,{get shape(){let n=t._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 e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return ai(this,"shape",o),o}});return yr(t,i)}a(Nb,"required");function ui(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}a(ui,"aborted");function Jr(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}a(Jr,"prefixIssues");function ia(e){return typeof e=="string"?e:e?.message}a(ia,"unwrapMessage");function jr(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let n=ia(e.inst?._zod.def?.error?.(e))??ia(t?.error?.(e))??ia(r.customError?.(e))??ia(r.localeError?.(e))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}a(jr,"finalizeIssue");function ca(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}a(ca,"getSizableOrigin");function ua(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(ua,"getLengthableOrigin");function pe(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}a(pe,"parsedType");function Mo(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}a(Mo,"issue");function gC(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}a(gC,"cleanEnum");function $b(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}a($b,"base64ToUint8Array");function Db(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}a(Db,"uint8ArrayToBase64");function mC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return $b(t+r)}a(mC,"base64urlToUint8Array");function _C(e){return Db(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(_C,"uint8ArrayToBase64url");function yC(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}a(yC,"hexToUint8Array");function EC(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}a(EC,"uint8ArrayToHex");var rh=class{static{a(this,"Class")}constructor(...t){}};var Bb=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Lo,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),la=T("$ZodError",Bb),Wr=T("$ZodError",Bb,{Parent:Error});function Fo(e,t=r=>r.message){let r={},i=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}a(Fo,"flattenError");function Ho(e,t=r=>r.message){let r={_errors:[]},i=a(n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let s=r,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(t(o))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}},"processError");return i(e),r}a(Ho,"formatError");function rl(e,t=r=>r.message){let r={errors:[]},i=a((n,o=[])=>{var s,c;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},u.path));else if(u.code==="invalid_key")i({issues:u.issues},u.path);else if(u.code==="invalid_element")i({issues:u.issues},u.path);else{let l=[...o,...u.path];if(l.length===0){r.errors.push(t(u));continue}let f=r,p=0;for(;p<l.length;){let g=l[p],h=p===l.length-1;typeof g=="string"?(f.properties??(f.properties={}),(s=f.properties)[g]??(s[g]={errors:[]}),f=f.properties[g]):(f.items??(f.items=[]),(c=f.items)[g]??(c[g]={errors:[]}),f=f.items[g]),h&&f.errors.push(t(u)),p++}}},"processError");return i(e),r}a(rl,"treeifyError");function zb(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}a(zb,"toDotPath");function nl(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${zb(i.path)}`);return t.join(`
24
+ `)}a(nl,"prettifyError");var jo=a(e=>(t,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new En;if(s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>jr(u,o,Zt())));throw el(c,n?.callee),c}return s.value},"_parse"),qi=jo(Wr),Wo=a(e=>async(t,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>jr(u,o,Zt())));throw el(c,n?.callee),c}return s.value},"_parseAsync"),Vi=Wo(Wr),qo=a(e=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new En;return o.issues.length?{success:!1,error:new(e??la)(o.issues.map(s=>jr(s,n,Zt())))}:{success:!0,data:o.value}},"_safeParse"),Vo=qo(Wr),Zo=a(e=>async(t,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>jr(s,n,Zt())))}:{success:!0,data:o.value}},"_safeParseAsync"),Qo=Zo(Wr),il=a(e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return jo(e)(t,r,n)},"_encode"),Lb=il(Wr),ol=a(e=>(t,r,i)=>jo(e)(t,r,i),"_decode"),Ub=ol(Wr),sl=a(e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Wo(e)(t,r,n)},"_encodeAsync"),Mb=sl(Wr),al=a(e=>async(t,r,i)=>Wo(e)(t,r,i),"_decodeAsync"),Fb=al(Wr),cl=a(e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return qo(e)(t,r,n)},"_safeEncode"),Hb=cl(Wr),ul=a(e=>(t,r,i)=>qo(e)(t,r,i),"_safeDecode"),jb=ul(Wr),ll=a(e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Zo(e)(t,r,n)},"_safeEncodeAsync"),Wb=ll(Wr),fl=a(e=>async(t,r,i)=>Zo(e)(t,r,i),"_safeDecodeAsync"),qb=fl(Wr);var qr={};cn(qr,{base64:()=>Sh,base64url:()=>dl,bigint:()=>Rh,boolean:()=>Nh,browserEmail:()=>TC,cidrv4:()=>Ih,cidrv6:()=>vh,cuid:()=>lh,cuid2:()=>fh,date:()=>Ph,datetime:()=>kh,domain:()=>RC,duration:()=>mh,e164:()=>wh,email:()=>yh,emoji:()=>Eh,extendedDuration:()=>bC,guid:()=>_h,hex:()=>OC,hostname:()=>CC,html5Email:()=>SC,idnEmail:()=>PC,integer:()=>Oh,ipv4:()=>Ah,ipv6:()=>bh,ksuid:()=>hh,lowercase:()=>Bh,mac:()=>xh,md5_base64:()=>$C,md5_base64url:()=>DC,md5_hex:()=>NC,nanoid:()=>gh,null:()=>$h,number:()=>pl,rfc5322Email:()=>wC,sha1_base64:()=>zC,sha1_base64url:()=>LC,sha1_hex:()=>BC,sha256_base64:()=>MC,sha256_base64url:()=>FC,sha256_hex:()=>UC,sha384_base64:()=>jC,sha384_base64url:()=>WC,sha384_hex:()=>HC,sha512_base64:()=>VC,sha512_base64url:()=>ZC,sha512_hex:()=>qC,string:()=>Ch,time:()=>Th,ulid:()=>dh,undefined:()=>Dh,unicodeEmail:()=>Vb,uppercase:()=>zh,uuid:()=>Zi,uuid4:()=>xC,uuid6:()=>IC,uuid7:()=>vC,xid:()=>ph});var lh=/^[cC][^\s-]{8,}$/,fh=/^[0-9a-z]+$/,dh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ph=/^[0-9a-vA-V]{20}$/,hh=/^[A-Za-z0-9]{27}$/,gh=/^[a-zA-Z0-9_-]{21}$/,mh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bC=/^[-+]?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)?)??$/,_h=/^([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})$/,Zi=a(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),xC=Zi(4),IC=Zi(6),vC=Zi(7),yh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,SC=/^[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])?)*$/,wC=/^(([^<>()\[\]\\.,;:\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,}))$/,Vb=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,PC=Vb,TC=/^[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])?)*$/,kC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Eh(){return new RegExp(kC,"u")}a(Eh,"emoji");var Ah=/^(?:(?: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])$/,bh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,xh=a(e=>{let t=un(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),Ih=/^((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])$/,vh=/^(([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])$/,Sh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dl=/^[A-Za-z0-9_-]*$/,CC=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,RC=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,wh=/^\+[1-9]\d{6,14}$/,Zb="(?:(?:\\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])))",Ph=new RegExp(`^${Zb}$`);function Qb(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(Qb,"timeSource");function Th(e){return new RegExp(`^${Qb(e)}$`)}a(Th,"time");function kh(e){let t=Qb({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${Zb}T(?:${i})$`)}a(kh,"datetime");var Ch=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Rh=/^-?\d+n?$/,Oh=/^-?\d+$/,pl=/^-?\d+(?:\.\d+)?$/,Nh=/^(?:true|false)$/i,$h=/^null$/i;var Dh=/^undefined$/i;var Bh=/^[^A-Z]*$/,zh=/^[^a-z]*$/,OC=/^[0-9a-fA-F]*$/;function fa(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}a(fa,"fixedBase64");function da(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}a(da,"fixedBase64url");var NC=/^[0-9a-fA-F]{32}$/,$C=fa(22,"=="),DC=da(22),BC=/^[0-9a-fA-F]{40}$/,zC=fa(27,"="),LC=da(27),UC=/^[0-9a-fA-F]{64}$/,MC=fa(43,"="),FC=da(43),HC=/^[0-9a-fA-F]{96}$/,jC=fa(64,""),WC=da(64),qC=/^[0-9a-fA-F]{128}$/,VC=fa(86,"=="),ZC=da(86);var $t=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Gb={number:"number",bigint:"bigint",object:"date"},hl=T("$ZodCheckLessThan",(e,t)=>{$t.init(e,t);let r=Gb[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gl=T("$ZodCheckGreaterThan",(e,t)=>{$t.init(e,t);let r=Gb[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Lh=T("$ZodCheckMultipleOf",(e,t)=>{$t.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):nh(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Uh=T("$ZodCheckNumberFormat",(e,t)=>{$t.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=ch[t.format];e._zod.onattach.push(s=>{let c=s._zod.bag;c.format=t.format,c.minimum=n,c.maximum=o,r&&(c.pattern=Oh)}),e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<n&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Mh=T("$ZodCheckBigIntFormat",(e,t)=>{$t.init(e,t);let[r,i]=uh[t.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Fh=T("$ZodCheckMaxSize",(e,t)=>{var r;$t.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!si(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;n.size<=t.maximum||i.issues.push({origin:ca(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Hh=T("$ZodCheckMinSize",(e,t)=>{var r;$t.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!si(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;n.size>=t.minimum||i.issues.push({origin:ca(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),jh=T("$ZodCheckSizeEquals",(e,t)=>{var r;$t.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!si(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=i=>{let n=i.value,o=n.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:ca(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Wh=T("$ZodCheckMaxLength",(e,t)=>{var r;$t.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!si(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;if(n.length<=t.maximum)return;let s=ua(n);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qh=T("$ZodCheckMinLength",(e,t)=>{var r;$t.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!si(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;if(n.length>=t.minimum)return;let s=ua(n);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Vh=T("$ZodCheckLengthEquals",(e,t)=>{var r;$t.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!si(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=i=>{let n=i.value,o=n.length;if(o===t.length)return;let s=ua(n),c=o>t.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Ko=T("$ZodCheckStringFormat",(e,t)=>{var r,i;$t.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Zh=T("$ZodCheckRegex",(e,t)=>{Ko.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Qh=T("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bh),Ko.init(e,t)}),Kh=T("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zh),Ko.init(e,t)}),Gh=T("$ZodCheckIncludes",(e,t)=>{$t.init(e,t);let r=un(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Yh=T("$ZodCheckStartsWith",(e,t)=>{$t.init(e,t);let r=new RegExp(`^${un(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Xh=T("$ZodCheckEndsWith",(e,t)=>{$t.init(e,t);let r=new RegExp(`.*${un(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Kb(e,t,r){e.issues.length&&t.issues.push(...Jr(r,e.issues))}a(Kb,"handleCheckPropertyResult");var Jh=T("$ZodCheckProperty",(e,t)=>{$t.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>Kb(n,r,t.property));Kb(i,r,t.property)}}),eg=T("$ZodCheckMimeType",(e,t)=>{$t.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),tg=T("$ZodCheckOverwrite",(e,t)=>{$t.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var pa=class{static{a(this,"Doc")}constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
25
+ `).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,n.join(`
26
+ `))}};var rg={major:4,minor:3,patch:6};var We=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rg;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=a((s,c,u)=>{let l=ui(s),f;for(let p of c){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let g=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&u?.async===!1)throw new En;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==g&&(l||(l=ui(s,g)))});else{if(s.issues.length===g)continue;l||(l=ui(s,g))}}return f?f.then(()=>s):s},"runChecks"),o=a((s,c,u)=>{if(ui(s))return s.aborted=!0,s;let l=n(c,i,u);if(l instanceof Promise){if(u.async===!1)throw new En;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)},"handleCanaryResult");e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(f=>o(f,s,c)):o(l,s,c)}let u=e._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new En;return u.then(l=>n(l,i,c))}return n(u,i,c)}}ot(e,"~standard",()=>({validate:a(n=>{try{let o=Vo(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Qo(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Fn=T("$ZodString",(e,t)=>{We.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ch(e._zod.bag),e._zod.parse=(r,i)=>{if(t.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:e}),r}}),Ct=T("$ZodStringFormat",(e,t)=>{Ko.init(e,t),Fn.init(e,t)}),bl=T("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_h),Ct.init(e,t)}),xl=T("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zi(i))}else t.pattern??(t.pattern=Zi());Ct.init(e,t)}),Il=T("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=yh),Ct.init(e,t)}),ha=T("$ZodURL",(e,t)=>{Ct.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),vl=T("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Eh()),Ct.init(e,t)}),Sl=T("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=gh),Ct.init(e,t)}),wl=T("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lh),Ct.init(e,t)}),Pl=T("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fh),Ct.init(e,t)}),Tl=T("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dh),Ct.init(e,t)}),kl=T("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ph),Ct.init(e,t)}),Cl=T("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=hh),Ct.init(e,t)}),ga=T("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=kh(t)),Ct.init(e,t)}),ma=T("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ph),Ct.init(e,t)}),_a=T("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Th(t)),Ct.init(e,t)}),ya=T("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mh),Ct.init(e,t)}),Rl=T("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ah),Ct.init(e,t),e._zod.bag.format="ipv4"}),Ol=T("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=bh),Ct.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Nl=T("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=xh(t.delimiter)),Ct.init(e,t),e._zod.bag.format="mac"}),$l=T("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ih),Ct.init(e,t)}),Dl=T("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vh),Ct.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;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:e,continue:!t.abort})}}});function ig(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}a(ig,"isValidBase64");var Bl=T("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Sh),Ct.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ig(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ux(e){if(!dl.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ig(r)}a(ux,"isValidBase64URL");var zl=T("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=dl),Ct.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{ux(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ll=T("$ZodE164",(e,t)=>{t.pattern??(t.pattern=wh),Ct.init(e,t)});function lx(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}a(lx,"isValidJWT");var Ul=T("$ZodJWT",(e,t)=>{Ct.init(e,t),e._zod.check=r=>{lx(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Ml=T("$ZodCustomStringFormat",(e,t)=>{Ct.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Go=T("$ZodNumber",(e,t)=>{We.init(e,t),e._zod.pattern=e._zod.bag.pattern??pl,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),Ea=T("$ZodNumberFormat",(e,t)=>{Uh.init(e,t),Go.init(e,t)}),Qi=T("$ZodBoolean",(e,t)=>{We.init(e,t),e._zod.pattern=Nh,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Yo=T("$ZodBigInt",(e,t)=>{We.init(e,t),e._zod.pattern=Rh,e._zod.parse=(r,i)=>{if(t.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:e}),r}}),Fl=T("$ZodBigIntFormat",(e,t)=>{Mh.init(e,t),Yo.init(e,t)}),Hl=T("$ZodSymbol",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),jl=T("$ZodUndefined",(e,t)=>{We.init(e,t),e._zod.pattern=Dh,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Wl=T("$ZodNull",(e,t)=>{We.init(e,t),e._zod.pattern=$h,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Aa=T("$ZodAny",(e,t)=>{We.init(e,t),e._zod.parse=r=>r}),ba=T("$ZodUnknown",(e,t)=>{We.init(e,t),e._zod.parse=r=>r}),ql=T("$ZodNever",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),xa=T("$ZodVoid",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Ia=T("$ZodDate",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function Xb(e,t,r){e.issues.length&&t.issues.push(...Jr(r,e.issues)),t.value[r]=e.value}a(Xb,"handleArrayResult");var va=T("$ZodArray",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let c=n[s],u=t.element._zod.run({value:c,issues:[]},i);u instanceof Promise?o.push(u.then(l=>Xb(l,r,s))):Xb(u,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Al(e,t,r,i,n){if(e.issues.length){if(n&&!(r in i))return;t.issues.push(...Jr(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}a(Al,"handlePropertyResult");function fx(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=ah(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(fx,"normalizeDef");function dx(e,t,r,i,n,o){let s=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,f=u.optout==="optional";for(let p in t){if(c.has(p))continue;if(l==="never"){s.push(p);continue}let g=u.run({value:t[p],issues:[]},i);g instanceof Promise?e.push(g.then(h=>Al(h,r,p,t,f))):Al(g,r,p,t,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}a(dx,"handleCatchall");var Vl=T("$ZodObject",(e,t)=>{if(We.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u},"get")})}let i=Uo(()=>fx(t));ot(e._zod,"propValues",()=>{let c=t.shape,u={};for(let l in c){let f=c[l]._zod;if(f.values){u[l]??(u[l]=new Set);for(let p of f.values)u[l].add(p)}}return u});let n=Wi,o=t.catchall,s;e._zod.parse=(c,u)=>{s??(s=i.value);let l=c.value;if(!n(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;c.value={};let f=[],p=s.shape;for(let g of s.keys){let h=p[g],_=h._zod.optout==="optional",y=h._zod.run({value:l[g],issues:[]},u);y instanceof Promise?f.push(y.then(b=>Al(b,c,g,l,_))):Al(y,c,g,l,_)}return o?dx(f,l,c,u,i.value,e):f.length?Promise.all(f).then(()=>c):c}}),og=T("$ZodObjectJIT",(e,t)=>{Vl.init(e,t);let r=e._zod.parse,i=Uo(()=>fx(t)),n=a(g=>{let h=new pa(["shape","payload","ctx"]),_=i.value,y=a(M=>{let R=Ju(M);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`},"parseStr");h.write("const input = payload.value;");let b=Object.create(null),v=0;for(let M of _.keys)b[M]=`key_${v++}`;h.write("const newResult = {};");for(let M of _.keys){let R=b[M],J=Ju(M),ee=g[M]?._zod?.optout==="optional";h.write(`const ${R} = ${y(M)};`),ee?h.write(`
27
+ if (${R}.issues.length) {
28
+ if (${J} in input) {
29
+ payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
30
+ ...iss,
31
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
32
+ })));
33
+ }
34
+ }
35
+
36
+ if (${R}.value === undefined) {
37
+ if (${J} in input) {
38
+ newResult[${J}] = undefined;
39
+ }
40
+ } else {
41
+ newResult[${J}] = ${R}.value;
42
+ }
43
+
44
+ `):h.write(`
45
+ if (${R}.issues.length) {
46
+ payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
47
+ ...iss,
48
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
49
+ })));
50
+ }
51
+
52
+ if (${R}.value === undefined) {
53
+ if (${J} in input) {
54
+ newResult[${J}] = undefined;
55
+ }
56
+ } else {
57
+ newResult[${J}] = ${R}.value;
58
+ }
59
+
60
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");let S=h.compile();return(M,R)=>S(g,M,R)},"generateFastpass"),o,s=Wi,c=!ra.jitless,l=c&&oh.value,f=t.catchall,p;e._zod.parse=(g,h)=>{p??(p=i.value);let _=g.value;return s(_)?c&&l&&h?.async===!1&&h.jitless!==!0?(o||(o=n(t.shape)),g=o(g,h),f?dx([],_,g,h,p,e):g):r(g,h):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function Jb(e,t,r,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let n=e.filter(o=>!ui(o));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>jr(s,i,Zt())))}),t)}a(Jb,"handleUnionResults");var Ki=T("$ZodUnion",(e,t)=>{We.init(e,t),ot(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ot(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ot(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),ot(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>sa(o.source)).join("|")})$`)}});let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let s=!1,c=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)c.push(l),s=!0;else{if(l.issues.length===0)return l;c.push(l)}}return s?Promise.all(c).then(u=>Jb(u,n,e,o)):Jb(c,n,e,o)}});function ex(e,t,r,i){let n=e.filter(o=>o.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>jr(s,i,Zt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}a(ex,"handleExclusiveUnionResults");var Zl=T("$ZodXor",(e,t)=>{Ki.init(e,t),t.inclusive=!1;let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let s=!1,c=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},o);l instanceof Promise?(c.push(l),s=!0):c.push(l)}return s?Promise.all(c).then(u=>ex(u,n,e,o)):ex(c,n,e,o)}}),Sa=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ki.init(e,t);let r=e._zod.parse;ot(e._zod,"propValues",()=>{let n={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[c,u]of Object.entries(s)){n[c]||(n[c]=new Set);for(let l of u)n[c].add(l)}}return n});let i=Uo(()=>{let n=t.options,o=new Map;for(let s of n){let c=s._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});e._zod.parse=(n,o)=>{let s=n.value;if(!Wi(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let c=i.value.get(s?.[t.discriminator]);return c?c._zod.run(n,o):t.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),Ql=T("$ZodIntersection",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,l])=>tx(r,u,l)):tx(r,o,s)}});function ng(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ci(e)&&ci(t)){let r=Object.keys(t),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let s=ng(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let n=e[i],o=t[i],s=ng(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}a(ng,"mergeValues");function tx(e,t,r){let i=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else e.issues.push(c);let o=[...i].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length&&n&&e.issues.push({...n,keys:o}),ui(e))return e;let s=ng(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}a(tx,"handleIntersectionResults");var wa=T("$ZodTuple",(e,t)=>{We.init(e,t);let r=t.items;e._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],c=[...r].reverse().findIndex(f=>f._zod.optin!=="optional"),u=c===-1?0:r.length-c;if(!t.rest){let f=o.length>r.length,p=o.length<u-1;if(f||p)return i.issues.push({...f?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),i}let l=-1;for(let f of r){if(l++,l>=o.length&&l>=u)continue;let p=f._zod.run({value:o[l],issues:[]},n);p instanceof Promise?s.push(p.then(g=>ml(g,i,l))):ml(p,i,l)}if(t.rest){let f=o.slice(r.length);for(let p of f){l++;let g=t.rest._zod.run({value:p,issues:[]},n);g instanceof Promise?s.push(g.then(h=>ml(h,i,l))):ml(g,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function ml(e,t,r){e.issues.length&&t.issues.push(...Jr(r,e.issues)),t.value[r]=e.value}a(ml,"handleTupleResult");var Pa=T("$ZodRecord",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!ci(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s){r.value={};let c=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);let f=t.valueType._zod.run({value:n[l],issues:[]},i);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&r.issues.push(...Jr(l,p.issues)),r.value[l]=p.value})):(f.issues.length&&r.issues.push(...Jr(l,f.issues)),r.value[l]=f.value)}let u;for(let l in n)c.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__")continue;let u=t.keyType._zod.run({value:c,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&pl.test(c)&&u.issues.length){let p=t.keyType._zod.run({value:Number(c),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){t.mode==="loose"?r.value[c]=n[c]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>jr(p,i,Zt())),input:c,path:[c],inst:e});continue}let f=t.valueType._zod.run({value:n[c],issues:[]},i);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&r.issues.push(...Jr(c,p.issues)),r.value[u.value]=p.value})):(f.issues.length&&r.issues.push(...Jr(c,f.issues)),r.value[u.value]=f.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Kl=T("$ZodMap",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[s,c]of n){let u=t.keyType._zod.run({value:s,issues:[]},i),l=t.valueType._zod.run({value:c,issues:[]},i);u instanceof Promise||l instanceof Promise?o.push(Promise.all([u,l]).then(([f,p])=>{rx(f,p,r,s,n,e,i)})):rx(u,l,r,s,n,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function rx(e,t,r,i,n,o,s){e.issues.length&&(aa.has(typeof i)?r.issues.push(...Jr(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(c=>jr(c,s,Zt()))})),t.issues.length&&(aa.has(typeof i)?r.issues.push(...Jr(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map(c=>jr(c,s,Zt()))})),r.value.set(e.value,t.value)}a(rx,"handleMapResult");var Gl=T("$ZodSet",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let c=t.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(u=>nx(u,r))):nx(c,r)}return o.length?Promise.all(o).then(()=>r):r}});function nx(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}a(nx,"handleSetResult");var Ta=T("$ZodEnum",(e,t)=>{We.init(e,t);let r=oa(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(n=>aa.has(typeof n)).map(n=>typeof n=="string"?un(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),ka=T("$ZodLiteral",(e,t)=>{if(We.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?un(i):i?un(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),Yl=T("$ZodFile",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Ca=T("$ZodTransform",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new oi(e.constructor.name);let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new En;return r.value=n,r}});function ix(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(ix,"handleOptionalResult");var Xo=T("$ZodOptional",(e,t)=>{We.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ot(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${sa(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ix(o,r.value)):ix(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),Xl=T("$ZodExactOptional",(e,t)=>{Xo.init(e,t),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Ra=T("$ZodNullable",(e,t)=>{We.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${sa(r.source)}|null)$`):void 0}),ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),Jl=T("$ZodDefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ox(o,t)):ox(n,t)}});function ox(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}a(ox,"handleDefaultResult");var ef=T("$ZodPrefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),tf=T("$ZodNonOptional",(e,t)=>{We.init(e,t),ot(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>sx(o,e)):sx(n,e)}});function sx(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}a(sx,"handleNonOptionalResult");var rf=T("$ZodSuccess",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new oi("ZodSuccess");let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),nf=T("$ZodCatch",(e,t)=>{We.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>jr(s,i,Zt()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(o=>jr(o,i,Zt()))},input:r.value}),r.issues=[]),r)}}),of=T("$ZodNaN",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Oa=T("$ZodPipe",(e,t)=>{We.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(s=>_l(s,t.in,i)):_l(o,t.in,i)}let n=t.in._zod.run(r,i);return n instanceof Promise?n.then(o=>_l(o,t.out,i)):_l(n,t.out,i)}});function _l(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(_l,"handlePipeResult");var Jo=T("$ZodCodec",(e,t)=>{We.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(r,i);return o instanceof Promise?o.then(s=>yl(s,t,i)):yl(o,t,i)}else{let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(s=>yl(s,t,i)):yl(o,t,i)}}});function yl(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(o=>El(e,o,t.out,r)):El(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(o=>El(e,o,t.in,r)):El(e,n,t.in,r)}}a(yl,"handleCodecAResult");function El(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}a(El,"handleCodecTxResult");var sf=T("$ZodReadonly",(e,t)=>{We.init(e,t),ot(e._zod,"propValues",()=>t.innerType._zod.propValues),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"optin",()=>t.innerType?._zod?.optin),ot(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(ax):ax(n)}});function ax(e){return e.value=Object.freeze(e.value),e}a(ax,"handleReadonlyResult");var af=T("$ZodTemplateLiteral",(e,t)=>{We.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||sh.has(typeof i))r.push(un(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),cf=T("$ZodFunction",(e,t)=>(We.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=e._def.input?qi(e._def.input,i):i,o=Reflect.apply(r,this,n);return e._def.output?qi(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=e._def.input?await Vi(e._def.input,i):i,o=await Reflect.apply(r,this,n);return e._def.output?await Vi(e._def.output,o):o}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new wa({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),uf=T("$ZodPromise",(e,t)=>{We.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),lf=T("$ZodLazy",(e,t)=>{We.init(e,t),ot(e._zod,"innerType",()=>t.getter()),ot(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ot(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ot(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ot(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),Na=T("$ZodCustom",(e,t)=>{$t.init(e,t),We.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(o=>cx(o,r,i,e));cx(n,r,i,e)}});function cx(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(Mo(n))}}a(cx,"handleRefineResult");var ts={};cn(ts,{ar:()=>sg,az:()=>ag,be:()=>cg,bg:()=>ug,ca:()=>lg,cs:()=>fg,da:()=>dg,de:()=>pg,en:()=>$a,eo:()=>hg,es:()=>gg,fa:()=>mg,fi:()=>_g,fr:()=>yg,frCA:()=>Eg,he:()=>Ag,hu:()=>bg,hy:()=>xg,id:()=>Ig,is:()=>vg,it:()=>Sg,ja:()=>wg,ka:()=>Pg,kh:()=>Tg,km:()=>Da,ko:()=>kg,lt:()=>Cg,mk:()=>Rg,ms:()=>Og,nl:()=>Ng,no:()=>$g,ota:()=>Dg,pl:()=>zg,ps:()=>Bg,pt:()=>Lg,ru:()=>Ug,sl:()=>Mg,sv:()=>Fg,ta:()=>Hg,th:()=>jg,tr:()=>Wg,ua:()=>qg,uk:()=>za,ur:()=>Vg,uz:()=>Zg,vi:()=>Qg,yo:()=>Yg,zhCN:()=>Kg,zhTW:()=>Gg});var KC=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\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}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":return n.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 ${le(n.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: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${s.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${n.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${r[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${Q(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.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 ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function sg(){return{localeError:KC()}}a(sg,"default");var GC=a(()=>{let e={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 t(n){return e[n]??null}a(t,"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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${c}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${le(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function ag(){return{localeError:GC()}}a(ag,"default");function px(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?r:i}a(px,"getBelarusianPlural");var YC=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":return n.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 ${le(n.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 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=px(c,s.unit.one,s.unit.few,s.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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=px(c,s.unit.one,s.unit.few,s.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 ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.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 ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function cg(){return{localeError:YC()}}a(cg,"default");var XC=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${le(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function ug(){return{localeError:XC()}}a(ug,"default");var JC=a(()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${c}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${le(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Q(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function lg(){return{localeError:JC()}}a(lg,"default");var e1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${c}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${le(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Q(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function fg(){return{localeError:e1()}}a(fg,"default");var t1=a(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${c}`:`Ugyldigt input: forventede ${o}, fik ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${le(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=i[n.origin]??n.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=i[n.origin]??n.origin;return s?`For lille: forventede ${c} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}},"error");function dg(){return{localeError:t1()}}a(dg,"default");var r1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${c}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${le(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function pg(){return{localeError:r1()}}a(pg,"default");var n1=a(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${le(n.values[0])}`:`Invalid option: expected one of ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(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=t(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":""}: ${Q(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 $a(){return{localeError:n1()}}a($a,"default");var i1=a(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}a(t,"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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${c}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${le(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(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=t(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":""}: ${Q(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 hg(){return{localeError:i1()}}a(hg,"default");var o1=a(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${le(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function gg(){return{localeError:o1()}}a(gg,"default");var s1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${le(n.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 ${Q(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??n.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 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Q(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.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 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function mg(){return{localeError:s1()}}a(mg,"default");var a1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${c}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${le(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Q(n.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 _g(){return{localeError:a1()}}a(_g,"default");var c1=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${c} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${le(n.values[0])} attendu`:`Option invalide : une valeur parmi ${Q(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Q(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}},"error");function yg(){return{localeError:c1()}}a(yg,"default");var u1=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${c}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${le(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Q(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Eg(){return{localeError:u1()}}a(Eg,"default");var l1=a(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=a(l=>l?e[l]:void 0,"typeEntry"),i=a(l=>{let f=r(l);return f?f.label:l??e.unknown.label},"typeLabel"),n=a(l=>`\u05D4${i(l)}`,"withDefinite"),o=a(l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),s=a(l=>l?t[l]??null:null,"getSizing"),c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let f=l.expected,p=u[f??""]??i(f),g=pe(l.input),h=u[g]??e[g]?.label??g;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${le(l.values[0])}`;let f=l.values.map(h=>le(h));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f[0]} \u05D0\u05D5 ${f[1]}`;let p=f[f.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let f=s(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${f?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${f?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let _=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(l.origin==="array"||l.origin==="set"){let _=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=l.inclusive?`${l.maximum} ${f?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${f?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let g=l.inclusive?"<=":"<",h=o(l.origin??"value");return f?.unit?`${f.longLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.maximum.toString()} ${f.unit}`:`${f?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.maximum.toString()}`}case"too_small":{let f=s(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${f?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${f?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let _=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(l.origin==="array"||l.origin==="set"){let _=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let b=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let y=l.inclusive?`${l.minimum} ${f?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${f?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let g=l.inclusive?">=":">",h=o(l.origin??"value");return f?.unit?`${f.shortLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.minimum.toString()} ${f.unit}`:`${f?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${h} ${g}${l.minimum.toString()}`}case"invalid_format":{let f=l;if(f.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${f.prefix}"`;if(f.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${f.suffix}"`;if(f.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${f.includes}"`;if(f.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${f.pattern}`;let p=c[f.format],g=p?.label??f.format,_=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${g} \u05DC\u05D0 ${_}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Q(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function Ag(){return{localeError:l1()}}a(Ag,"default");var f1=a(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${le(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function bg(){return{localeError:f1()}}a(bg,"default");function hx(e,t,r){return Math.abs(e)===1?t:r}a(hx,"getArmenianPlural");function es(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}a(es,"withDefiniteArticle");var d1=a(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${le(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=hx(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${es(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${es(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=hx(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${es(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${es(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${Q(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${es(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${es(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function xg(){return{localeError:d1()}}a(xg,"default");var p1=a(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${o}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${le(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}},"error");function Ig(){return{localeError:p1()}}a(Ig,"default");var h1=a(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${le(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}},"error");function vg(){return{localeError:h1()}}a(vg,"default");var g1=a(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${c}`:`Input non valido: atteso ${o}, ricevuto ${c}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${le(n.values[0])}`:`Opzione non valida: atteso uno tra ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}},"error");function Sg(){return{localeError:g1()}}a(Sg,"default");var m1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${le(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Q(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.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${n.keys.length>1?"\u7FA4":""}: ${Q(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function wg(){return{localeError:m1()}}a(wg,"default");var _1=a(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${le(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${Q(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function Pg(){return{localeError:_1()}}a(Pg,"default");var y1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\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} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":return n.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 ${le(n.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 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Q(n.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 ${n.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 ${n.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 Da(){return{localeError:y1()}}a(Da,"default");function Tg(){return Da()}a(Tg,"default");var E1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${le(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Q(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Q(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function kg(){return{localeError:E1()}}a(kg,"default");var Ba=a(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function gx(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}a(gx,"getUnitTypeFromNumber");var A1=a(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,o,s,c){let u=e[n]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[c][s?"inclusive":"notInclusive"]}}a(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${le(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${Q(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=t(n.origin,gx(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Ba(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ba(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=t(n.origin,gx(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Ba(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ba(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${Q(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${Ba(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function Cg(){return{localeError:A1()}}a(Cg,"default");var b1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${le(n.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 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${s.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${r[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`${n.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"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.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 ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function Rg(){return{localeError:b1()}}a(Rg,"default");var x1=a(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${c}`:`Input tidak sah: dijangka ${o}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${le(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Q(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}},"error");function Og(){return{localeError:x1()}}a(Og,"default");var I1=a(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${o}, ontving ${c}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${le(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),c=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),c=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}},"error");function Ng(){return{localeError:I1()}}a(Ng,"default");var v1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${c}`:`Ugyldig input: forventet ${o}, fikk ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${le(n.values[0])}`:`Ugyldig valg: forventet en av ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}},"error");function $g(){return{localeError:v1()}}a($g,"default");var S1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${le(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function Dg(){return{localeError:S1()}}a(Dg,"default");var w1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${le(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Q(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.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 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function Bg(){return{localeError:w1()}}a(Bg,"default");var P1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${c}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${le(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function zg(){return{localeError:P1()}}a(zg,"default");var T1=a(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${le(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}},"error");function Lg(){return{localeError:T1()}}a(Lg,"default");function mx(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?r:i}a(mx,"getRussianPlural");var k1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${le(n.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 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=mx(c,s.unit.one,s.unit.few,s.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=mx(c,s.unit.one,s.unit.few,s.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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.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 Ug(){return{localeError:k1()}}a(Ug,"default");var C1=a(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${c}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${le(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}},"error");function Mg(){return{localeError:C1()}}a(Mg,"default");var R1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${c}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${le(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function Fg(){return{localeError:R1()}}a(Fg,"default");var O1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\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}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":return n.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 ${le(n.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 ${Q(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${s.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\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 ${n.origin} ${o}${n.minimum.toString()} ${s.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 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.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${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.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`${n.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 Hg(){return{localeError:O1()}}a(Hg,"default");var N1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\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} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${le(n.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 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??n.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 ${n.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: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.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 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function jg(){return{localeError:N1()}}a(jg,"default");var $1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${le(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(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=t(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":""}: ${Q(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 Wg(){return{localeError:$1()}}a(Wg,"default");var D1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\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}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":return n.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 ${le(n.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 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.maximum.toString()} ${s.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.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 za(){return{localeError:D1()}}a(za,"default");function qg(){return za()}a(qg,"default");var B1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${le(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Q(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.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${n.keys.length>1?"\u0632":""}: ${Q(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function Vg(){return{localeError:B1()}}a(Vg,"default");var z1=a(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${c}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${le(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function Zg(){return{localeError:z1()}}a(Zg,"default");var L1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${le(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Q(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.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 ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function Qg(){return{localeError:L1()}}a(Qg,"default");var U1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${le(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function Kg(){return{localeError:U1()}}a(Kg,"default");var M1=a(()=>{let e={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 t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${le(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${Q(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function Gg(){return{localeError:M1()}}a(Gg,"default");var F1=a(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=pe(n.input),c=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${le(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${Q(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${Q(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function Yg(){return{localeError:F1()}}a(Yg,"default");var _x,df=Symbol("ZodOutput"),pf=Symbol("ZodInput"),ff=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function La(){return new ff}a(La,"registry");(_x=globalThis).__zod_globalRegistry??(_x.__zod_globalRegistry=La());var Er=globalThis.__zod_globalRegistry;function Ua(e,t){return new e({type:"string",...ue(t)})}a(Ua,"_string");function Ma(e,t){return new e({type:"string",coerce:!0,...ue(t)})}a(Ma,"_coercedString");function Fa(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ue(t)})}a(Fa,"_email");function rs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ue(t)})}a(rs,"_guid");function Ha(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ue(t)})}a(Ha,"_uuid");function ja(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ue(t)})}a(ja,"_uuidv4");function Wa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ue(t)})}a(Wa,"_uuidv6");function qa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ue(t)})}a(qa,"_uuidv7");function Gi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}a(Gi,"_url");function Va(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ue(t)})}a(Va,"_emoji");function Za(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ue(t)})}a(Za,"_nanoid");function Qa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ue(t)})}a(Qa,"_cuid");function Ka(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ue(t)})}a(Ka,"_cuid2");function Ga(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ue(t)})}a(Ga,"_ulid");function Ya(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ue(t)})}a(Ya,"_xid");function Xa(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ue(t)})}a(Xa,"_ksuid");function Ja(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ue(t)})}a(Ja,"_ipv4");function ec(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ue(t)})}a(ec,"_ipv6");function hf(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ue(t)})}a(hf,"_mac");function tc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ue(t)})}a(tc,"_cidrv4");function rc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ue(t)})}a(rc,"_cidrv6");function nc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ue(t)})}a(nc,"_base64");function ic(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ue(t)})}a(ic,"_base64url");function oc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ue(t)})}a(oc,"_e164");function sc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ue(t)})}a(sc,"_jwt");var gf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ac(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ue(t)})}a(ac,"_isoDateTime");function cc(e,t){return new e({type:"string",format:"date",check:"string_format",...ue(t)})}a(cc,"_isoDate");function uc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ue(t)})}a(uc,"_isoTime");function lc(e,t){return new e({type:"string",format:"duration",check:"string_format",...ue(t)})}a(lc,"_isoDuration");function fc(e,t){return new e({type:"number",checks:[],...ue(t)})}a(fc,"_number");function dc(e,t){return new e({type:"number",coerce:!0,checks:[],...ue(t)})}a(dc,"_coercedNumber");function pc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ue(t)})}a(pc,"_int");function mf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ue(t)})}a(mf,"_float32");function _f(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ue(t)})}a(_f,"_float64");function yf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ue(t)})}a(yf,"_int32");function Ef(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ue(t)})}a(Ef,"_uint32");function hc(e,t){return new e({type:"boolean",...ue(t)})}a(hc,"_boolean");function gc(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}a(gc,"_coercedBoolean");function Af(e,t){return new e({type:"bigint",...ue(t)})}a(Af,"_bigint");function mc(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}a(mc,"_coercedBigint");function bf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ue(t)})}a(bf,"_int64");function xf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ue(t)})}a(xf,"_uint64");function If(e,t){return new e({type:"symbol",...ue(t)})}a(If,"_symbol");function vf(e,t){return new e({type:"undefined",...ue(t)})}a(vf,"_undefined");function Sf(e,t){return new e({type:"null",...ue(t)})}a(Sf,"_null");function _c(e){return new e({type:"any"})}a(_c,"_any");function yc(e){return new e({type:"unknown"})}a(yc,"_unknown");function wf(e,t){return new e({type:"never",...ue(t)})}a(wf,"_never");function Ec(e,t){return new e({type:"void",...ue(t)})}a(Ec,"_void");function Pf(e,t){return new e({type:"date",...ue(t)})}a(Pf,"_date");function Ac(e,t){return new e({type:"date",coerce:!0,...ue(t)})}a(Ac,"_coercedDate");function Tf(e,t){return new e({type:"nan",...ue(t)})}a(Tf,"_nan");function An(e,t){return new hl({check:"less_than",...ue(t),value:e,inclusive:!1})}a(An,"_lt");function Br(e,t){return new hl({check:"less_than",...ue(t),value:e,inclusive:!0})}a(Br,"_lte");function bn(e,t){return new gl({check:"greater_than",...ue(t),value:e,inclusive:!1})}a(bn,"_gt");function mr(e,t){return new gl({check:"greater_than",...ue(t),value:e,inclusive:!0})}a(mr,"_gte");function bc(e){return bn(0,e)}a(bc,"_positive");function xc(e){return An(0,e)}a(xc,"_negative");function Ic(e){return Br(0,e)}a(Ic,"_nonpositive");function vc(e){return mr(0,e)}a(vc,"_nonnegative");function Hn(e,t){return new Lh({check:"multiple_of",...ue(t),value:e})}a(Hn,"_multipleOf");function jn(e,t){return new Fh({check:"max_size",...ue(t),maximum:e})}a(jn,"_maxSize");function xn(e,t){return new Hh({check:"min_size",...ue(t),minimum:e})}a(xn,"_minSize");function li(e,t){return new jh({check:"size_equals",...ue(t),size:e})}a(li,"_size");function fi(e,t){return new Wh({check:"max_length",...ue(t),maximum:e})}a(fi,"_maxLength");function cr(e,t){return new qh({check:"min_length",...ue(t),minimum:e})}a(cr,"_minLength");function di(e,t){return new Vh({check:"length_equals",...ue(t),length:e})}a(di,"_length");function Ir(e,t){return new Zh({check:"string_format",format:"regex",...ue(t),pattern:e})}a(Ir,"_regex");function Yi(e){return new Qh({check:"string_format",format:"lowercase",...ue(e)})}a(Yi,"_lowercase");function Xi(e){return new Kh({check:"string_format",format:"uppercase",...ue(e)})}a(Xi,"_uppercase");function Ji(e,t){return new Gh({check:"string_format",format:"includes",...ue(t),includes:e})}a(Ji,"_includes");function eo(e,t){return new Yh({check:"string_format",format:"starts_with",...ue(t),prefix:e})}a(eo,"_startsWith");function to(e,t){return new Xh({check:"string_format",format:"ends_with",...ue(t),suffix:e})}a(to,"_endsWith");function Sc(e,t,r){return new Jh({check:"property",property:e,schema:t,...ue(r)})}a(Sc,"_property");function ro(e,t){return new eg({check:"mime_type",mime:e,...ue(t)})}a(ro,"_mime");function ln(e){return new tg({check:"overwrite",tx:e})}a(ln,"_overwrite");function no(e){return ln(t=>t.normalize(e))}a(no,"_normalize");function io(){return ln(e=>e.trim())}a(io,"_trim");function oo(){return ln(e=>e.toLowerCase())}a(oo,"_toLowerCase");function so(){return ln(e=>e.toUpperCase())}a(so,"_toUpperCase");function ns(){return ln(e=>ih(e))}a(ns,"_slugify");function Xg(e,t,r){return new e({type:"array",element:t,...ue(r)})}a(Xg,"_array");function j1(e,t,r){return new e({type:"union",options:t,...ue(r)})}a(j1,"_union");function W1(e,t,r){return new e({type:"union",options:t,inclusive:!1,...ue(r)})}a(W1,"_xor");function q1(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...ue(i)})}a(q1,"_discriminatedUnion");function V1(e,t,r){return new e({type:"intersection",left:t,right:r})}a(V1,"_intersection");function Z1(e,t,r,i){let n=r instanceof We,o=n?i:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...ue(o)})}a(Z1,"_tuple");function Q1(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...ue(i)})}a(Q1,"_record");function K1(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...ue(i)})}a(K1,"_map");function G1(e,t,r){return new e({type:"set",valueType:t,...ue(r)})}a(G1,"_set");function Y1(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...ue(r)})}a(Y1,"_enum");function X1(e,t,r){return new e({type:"enum",entries:t,...ue(r)})}a(X1,"_nativeEnum");function J1(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ue(r)})}a(J1,"_literal");function kf(e,t){return new e({type:"file",...ue(t)})}a(kf,"_file");function eR(e,t){return new e({type:"transform",transform:t})}a(eR,"_transform");function tR(e,t){return new e({type:"optional",innerType:t})}a(tR,"_optional");function rR(e,t){return new e({type:"nullable",innerType:t})}a(rR,"_nullable");function nR(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():tl(r)}})}a(nR,"_default");function iR(e,t,r){return new e({type:"nonoptional",innerType:t,...ue(r)})}a(iR,"_nonoptional");function oR(e,t){return new e({type:"success",innerType:t})}a(oR,"_success");function sR(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}a(sR,"_catch");function aR(e,t,r){return new e({type:"pipe",in:t,out:r})}a(aR,"_pipe");function cR(e,t){return new e({type:"readonly",innerType:t})}a(cR,"_readonly");function uR(e,t,r){return new e({type:"template_literal",parts:t,...ue(r)})}a(uR,"_templateLiteral");function lR(e,t){return new e({type:"lazy",getter:t})}a(lR,"_lazy");function fR(e,t){return new e({type:"promise",innerType:t})}a(fR,"_promise");function wc(e,t,r){let i=ue(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}a(wc,"_custom");function Pc(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ue(r)})}a(Pc,"_refine");function Cf(e){let t=yx(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Mo(i,r.value,t._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(Mo(n))}},e(r.value,r)));return t}a(Cf,"_superRefine");function yx(e,t){let r=new $t({check:"custom",...ue(t)});return r._zod.check=e,r}a(yx,"_check");function Rf(e){let t=new $t({check:"describe"});return t._zod.onattach=[r=>{let i=Er.get(r)??{};Er.add(r,{...i,description:e})}],t._zod.check=()=>{},t}a(Rf,"describe");function Of(e){let t=new $t({check:"meta"});return t._zod.onattach=[r=>{let i=Er.get(r)??{};Er.add(r,{...i,...e})}],t._zod.check=()=>{},t}a(Of,"meta");function Nf(e,t){let r=ue(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),n=n.map(h=>typeof h=="string"?h.toLowerCase():h));let o=new Set(i),s=new Set(n),c=e.Codec??Jo,u=e.Boolean??Qi,l=e.String??Fn,f=new l({type:"string",error:r.error}),p=new u({type:"boolean",error:r.error}),g=new c({type:"pipe",in:f,out:p,transform:a(((h,_)=>{let y=h;return r.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:_.value,inst:g,continue:!1}),{})}),"transform"),reverseTransform:a(((h,_)=>h===!0?i[0]||"true":n[0]||"false"),"reverseTransform"),error:r.error});return g}a(Nf,"_stringbool");function ao(e,t,r,i={}){let n=ue(i),o={...ue(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...n};return r instanceof RegExp&&(o.pattern=r),new e(o)}a(ao,"_stringFormat");function pi(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Er,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}a(pi,"initializeContext");function Rt(e,t,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,f);else{let g=s.schema,h=t.processors[n.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,g,f)}let p=e._zod.parent;p&&(s.ref||(s.ref=p),Rt(p,t,f),t.seen.get(p).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&zr(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}a(Rt,"process");function hi(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let n=a(s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(s[0])?.id,g=e.external.uri??(_=>_);if(p)return{ref:g(p)};let h=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=h,{defId:h,ref:`${g("__shared")}#/${c}/${h}`}}if(s[1]===r)return{ref:"#"};let l=`#/${c}/`,f=s[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:l+f}},"makeURI"),o=a(s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:l}=n(s);c.def={...c.schema},l&&(c.defId=l);let f=c.schema;for(let p in f)delete f[p];f.$ref=u},"extractToDef");if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
61
+
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1&&e.reused==="ref"){o(s);continue}}}a(hi,"extractDefs");function gi(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a(s=>{let c=e.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){i(f);let g=e.seen.get(f),h=g.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Object.assign(u,h),Object.assign(u,l),s._zod.parent===f)for(let y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(h.$ref&&g.def)for(let y in u)y==="$ref"||y==="allOf"||y in g.def&&JSON.stringify(u[y])===JSON.stringify(g.def[y])&&delete u[y]}let p=s._zod.parent;if(p&&p!==f){i(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let h in u)h==="$ref"||h==="allOf"||h in g.def&&JSON.stringify(u[h])===JSON.stringify(g.def[h])&&delete u[h]}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})},"flattenRef");for(let s of[...e.seen.entries()].reverse())i(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let o=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(o[c.defId]=c.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:is(t,"input",e.processors),output:is(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}a(gi,"finalize");function zr(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return zr(i.element,r);if(i.type==="set")return zr(i.valueType,r);if(i.type==="lazy")return zr(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return zr(i.innerType,r);if(i.type==="intersection")return zr(i.left,r)||zr(i.right,r);if(i.type==="record"||i.type==="map")return zr(i.keyType,r)||zr(i.valueType,r);if(i.type==="pipe")return zr(i.in,r)||zr(i.out,r);if(i.type==="object"){for(let n in i.shape)if(zr(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(zr(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(zr(n,r))return!0;return!!(i.rest&&zr(i.rest,r))}return!1}a(zr,"isTransforming");var Jg=a((e,t={})=>r=>{let i=pi({...r,processors:t});return Rt(e,i),hi(i,e),gi(i,e)},"createToJSONSchemaMethod"),is=a((e,t,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=pi({...n??{},target:o,io:t,processors:r});return Rt(e,s),hi(s,e),gi(s,e)},"createStandardJSONSchemaMethod");var dR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},em=a((e,t,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),c&&(n.format=dR[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){let f=[...u];f.length===1?n.pattern=f[0].source:f.length>1&&(n.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},"stringProcessor"),tm=a((e,t,r,i)=>{let n=r,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:f}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=f,n.exclusiveMinimum=!0):n.exclusiveMinimum=f),typeof o=="number"&&(n.minimum=o,typeof f=="number"&&t.target!=="draft-04"&&(f>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof s=="number"&&(n.maximum=s,typeof l=="number"&&t.target!=="draft-04"&&(l<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},"numberProcessor"),rm=a((e,t,r,i)=>{r.type="boolean"},"booleanProcessor"),nm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),im=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),om=a((e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),sm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),am=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),cm=a((e,t,r,i)=>{r.not={}},"neverProcessor"),um=a((e,t,r,i)=>{},"anyProcessor"),lm=a((e,t,r,i)=>{},"unknownProcessor"),fm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),dm=a((e,t,r,i)=>{let n=e._zod.def,o=oa(n.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},"enumProcessor"),pm=a((e,t,r,i)=>{let n=e._zod.def,o=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},"literalProcessor"),hm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),gm=a((e,t,r,i)=>{let n=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},"templateLiteralProcessor"),mm=a((e,t,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=e._zod.bag;s!==void 0&&(o.minLength=s),c!==void 0&&(o.maxLength=c),u?u.length===1?(o.contentMediaType=u[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(n,o)},"fileProcessor"),_m=a((e,t,r,i)=>{r.type="boolean"},"successProcessor"),ym=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),Em=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),Am=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),bm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),xm=a((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),Im=a((e,t,r,i)=>{let n=r,o=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=Rt(o.element,t,{...i,path:[...i.path,"items"]})},"arrayProcessor"),vm=a((e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object",n.properties={};let s=o.shape;for(let l in s)n.properties[l]=Rt(s[l],t,{...i,path:[...i.path,"properties",l]});let c=new Set(Object.keys(s)),u=new Set([...c].filter(l=>{let f=o.shape[l]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));u.size>0&&(n.required=Array.from(u)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=Rt(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},"objectProcessor"),Df=a((e,t,r,i)=>{let n=e._zod.def,o=n.inclusive===!1,s=n.options.map((c,u)=>Rt(c,t,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?r.oneOf=s:r.anyOf=s},"unionProcessor"),Sm=a((e,t,r,i)=>{let n=e._zod.def,o=Rt(n.left,t,{...i,path:[...i.path,"allOf",0]}),s=Rt(n.right,t,{...i,path:[...i.path,"allOf",1]}),c=a(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];r.allOf=u},"intersectionProcessor"),wm=a((e,t,r,i)=>{let n=r,o=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((g,h)=>Rt(g,t,{...i,path:[...i.path,s,h]})),l=o.rest?Rt(o.rest,t,{...i,path:[...i.path,c,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:u},l&&n.items.anyOf.push(l),n.minItems=u.length,l||(n.maxItems=u.length)):(n.items=u,l&&(n.additionalItems=l));let{minimum:f,maximum:p}=e._zod.bag;typeof f=="number"&&(n.minItems=f),typeof p=="number"&&(n.maxItems=p)},"tupleProcessor"),Pm=a((e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let f=Rt(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let p of u)n.patternProperties[p.source]=f}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Rt(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=Rt(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let f=[...l].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(n.required=f)}},"recordProcessor"),Tm=a((e,t,r,i)=>{let n=e._zod.def,o=Rt(n.innerType,t,i),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},"nullableProcessor"),km=a((e,t,r,i)=>{let n=e._zod.def;Rt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},"nonoptionalProcessor"),Cm=a((e,t,r,i)=>{let n=e._zod.def;Rt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},"defaultProcessor"),Rm=a((e,t,r,i)=>{let n=e._zod.def;Rt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},"prefaultProcessor"),Om=a((e,t,r,i)=>{let n=e._zod.def;Rt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},"catchProcessor"),Nm=a((e,t,r,i)=>{let n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;Rt(o,t,i);let s=t.seen.get(e);s.ref=o},"pipeProcessor"),$m=a((e,t,r,i)=>{let n=e._zod.def;Rt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.readOnly=!0},"readonlyProcessor"),Dm=a((e,t,r,i)=>{let n=e._zod.def;Rt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},"promiseProcessor"),Bf=a((e,t,r,i)=>{let n=e._zod.def;Rt(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},"optionalProcessor"),Bm=a((e,t,r,i)=>{let n=e._zod.innerType;Rt(n,t,i);let o=t.seen.get(e);o.ref=n},"lazyProcessor"),$f={string:em,number:tm,boolean:rm,bigint:nm,symbol:im,null:om,undefined:sm,void:am,never:cm,any:um,unknown:lm,date:fm,enum:dm,literal:pm,nan:hm,template_literal:gm,file:mm,success:_m,custom:ym,function:Em,transform:Am,map:bm,set:xm,array:Im,object:vm,union:Df,intersection:Sm,tuple:wm,record:Pm,nullable:Tm,nonoptional:km,default:Cm,prefault:Rm,catch:Om,pipe:Nm,readonly:$m,promise:Dm,optional:Bf,lazy:Bm};function Tc(e,t){if("_idmap"in e){let i=e,n=pi({...t,processors:$f}),o={};for(let u of i._idmap.entries()){let[l,f]=u;Rt(f,n)}let s={},c={registry:i,uri:t?.uri,defs:o};n.external=c;for(let u of i._idmap.entries()){let[l,f]=u;hi(n,f),s[l]=gi(n,f)}if(Object.keys(o).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let r=pi({...t,processors:$f});return Rt(e,r),hi(r,e),gi(r,e)}a(Tc,"toJSONSchema");var zf=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=pi({processors:$f,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Rt(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),hi(this.ctx,t);let i=gi(this.ctx,t),{"~standard":n,...o}=i;return o}};var Ex={};var fr=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");We.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>qi(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Vo(e,r,i),e.parseAsync=async(r,i)=>Vi(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Qo(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>yr(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.apply=r=>r(e)}),Lf=T("ZodMiniString",(e,t)=>{Fn.init(e,t),fr.init(e,t)});function I(e){return Ua(Lf,e)}a(I,"string");var os=T("ZodMiniStringFormat",(e,t)=>{Ct.init(e,t),Lf.init(e,t)});var gR=T("ZodMiniURL",(e,t)=>{ha.init(e,t),os.init(e,t)});function Ax(e){return Gi(gR,e)}a(Ax,"url");var Uf=T("ZodMiniNumber",(e,t)=>{Go.init(e,t),fr.init(e,t)});function Ar(e){return fc(Uf,e)}a(Ar,"number");var mR=T("ZodMiniNumberFormat",(e,t)=>{Ea.init(e,t),Uf.init(e,t)});function bx(e){return pc(mR,e)}a(bx,"int");var zm=T("ZodMiniBoolean",(e,t)=>{Qi.init(e,t),fr.init(e,t)});function yt(e){return hc(zm,e)}a(yt,"boolean");var xx=T("ZodMiniBigInt",(e,t)=>{Yo.init(e,t),fr.init(e,t)});var _R=T("ZodMiniAny",(e,t)=>{Aa.init(e,t),fr.init(e,t)});function kc(){return _c(_R)}a(kc,"any");var yR=T("ZodMiniUnknown",(e,t)=>{ba.init(e,t),fr.init(e,t)});function Ye(){return yc(yR)}a(Ye,"unknown");var ER=T("ZodMiniVoid",(e,t)=>{xa.init(e,t),fr.init(e,t)});function Ix(e){return Ec(ER,e)}a(Ix,"_void");var vx=T("ZodMiniDate",(e,t)=>{Ia.init(e,t),fr.init(e,t)});var AR=T("ZodMiniArray",(e,t)=>{va.init(e,t),fr.init(e,t)});function Me(e,t){return new AR({type:"array",element:e,...ue(t)})}a(Me,"array");var bR=T("ZodMiniObject",(e,t)=>{Vl.init(e,t),fr.init(e,t),ot(e,"shape",()=>t.shape)});function N(e,t){let r={type:"object",shape:e??{},...ue(t)};return new bR(r)}a(N,"object");var xR=T("ZodMiniUnion",(e,t)=>{Ki.init(e,t),fr.init(e,t)});function st(e,t){return new xR({type:"union",options:e,...ue(t)})}a(st,"union");var IR=T("ZodMiniDiscriminatedUnion",(e,t)=>{Sa.init(e,t),fr.init(e,t)});function mi(e,t,r){return new IR({type:"union",options:t,discriminator:e,...ue(r)})}a(mi,"discriminatedUnion");var vR=T("ZodMiniRecord",(e,t)=>{Pa.init(e,t),fr.init(e,t)});function Xe(e,t,r){return new vR({type:"record",keyType:e,valueType:t,...ue(r)})}a(Xe,"record");var SR=T("ZodMiniEnum",(e,t)=>{Ta.init(e,t),fr.init(e,t),e.options=Object.values(t.entries)});function ze(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new SR({type:"enum",entries:r,...ue(t)})}a(ze,"_enum");var wR=T("ZodMiniLiteral",(e,t)=>{ka.init(e,t),fr.init(e,t)});function De(e,t){return new wR({type:"literal",values:Array.isArray(e)?e:[e],...ue(t)})}a(De,"literal");var PR=T("ZodMiniTransform",(e,t)=>{Ca.init(e,t),fr.init(e,t)});function _i(e){return new PR({type:"transform",transform:e})}a(_i,"transform");var TR=T("ZodMiniOptional",(e,t)=>{Xo.init(e,t),fr.init(e,t)});function Z(e){return new TR({type:"optional",innerType:e})}a(Z,"optional");var kR=T("ZodMiniNullable",(e,t)=>{Ra.init(e,t),fr.init(e,t)});function Cc(e){return new kR({type:"nullable",innerType:e})}a(Cc,"nullable");var CR=T("ZodMiniPipe",(e,t)=>{Oa.init(e,t),fr.init(e,t)});function yi(e,t){return new CR({type:"pipe",in:e,out:t})}a(yi,"pipe");var Sx=T("ZodMiniCustom",(e,t)=>{Na.init(e,t),fr.init(e,t)});function Mf(e,t){return wc(Sx,e??(()=>!0),t)}a(Mf,"custom");function Lm(e,t={}){return Pc(Sx,e,t)}a(Lm,"refine");var Ff={};cn(Ff,{ZodMiniISODate:()=>Mm,ZodMiniISODateTime:()=>Um,ZodMiniISODuration:()=>Hm,ZodMiniISOTime:()=>Fm,date:()=>OR,datetime:()=>RR,duration:()=>$R,time:()=>NR});var Um=T("ZodMiniISODateTime",(e,t)=>{ga.init(e,t),os.init(e,t)});function RR(e){return ac(Um,e)}a(RR,"datetime");var Mm=T("ZodMiniISODate",(e,t)=>{ma.init(e,t),os.init(e,t)});function OR(e){return cc(Mm,e)}a(OR,"date");var Fm=T("ZodMiniISOTime",(e,t)=>{_a.init(e,t),os.init(e,t)});function NR(e){return uc(Fm,e)}a(NR,"time");var Hm=T("ZodMiniISODuration",(e,t)=>{ya.init(e,t),os.init(e,t)});function $R(e){return lc(Hm,e)}a($R,"duration");var Rc={};cn(Rc,{bigint:()=>LR,boolean:()=>zR,date:()=>UR,number:()=>BR,string:()=>DR});function DR(e){return Ma(Lf,e)}a(DR,"string");function BR(e){return dc(Uf,e)}a(BR,"number");function zR(e){return gc(zm,e)}a(zR,"boolean");function LR(e){return mc(xx,e)}a(LR,"bigint");function UR(e){return Ac(vx,e)}a(UR,"date");var Wm=N({retryOnFailure:N({defaultValue:Z(yt()),hide:Z(yt())}),continueOnFailure:N({defaultValue:Z(yt()),hide:Z(yt())})}),jm=class{constructor(t,r,i,n,o,s,c,u,l,f,p,g,h){this.name=t;this.displayName=r;this.description=i;this.props=n;this.propertyGroups=o;this.run=s;this.test=c;this.requireAuth=u;this.errorHandlingOptions=l;this.outputSchema=f;this.audience=p;this.aiMetadata=g;this.classification=h}static{a(this,"IAction")}},Cr=a(e=>new jm(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var mt=N({displayName:I(),description:Z(I()),advanced:Z(yt()),width:Z(ze(["half","full"])),icon:Z(I()),placeholder:Z(I())}),et=a((e,t)=>N({type:De(t),required:yt(),defaultValue:Z(kc())}),"TPropertyValue");var tn=N({...mt.shape,...et(I(),"SHORT_TEXT").shape}),Wn=N({...mt.shape,...et(I(),"LONG_TEXT").shape});var Px=N({label:I(),value:Ye(),description:Z(I()),icon:Z(I())}),Hf=N({disabled:Z(yt()),placeholder:Z(I()),options:Me(Px)});var FR=ze(["cards"]),rn=N({...mt.shape,options:Hf,display:Z(FR),...et(Ye(),"STATIC_DROPDOWN").shape}),qn=N({...mt.shape,options:Hf,...et(Me(Ye()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var qm=N({...mt.shape,...et(Ye(),"DROPDOWN").shape,refreshers:Me(I())}),Oc=N({...mt.shape,...et(Me(Ye()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Me(I())});var Vn=N({...mt.shape,reveals:Z(Me(I())),...et(yt(),"CHECKBOX").shape});var Zn=N({...mt.shape,display:Z(ze(["stepper"])),min:Z(Ar()),max:Z(Ar()),step:Z(Ar()),...et(Ar(),"NUMBER").shape});var Nc=N({...mt.shape,streaming:Z(yt()),...et(Ye(),"FILE").shape});var $c=N({...mt.shape,...et(I(),"DATE_TIME").shape});var Tx=Xe(I(),st([tn,Wn,rn,Oc,qn,Vn,Zn,Nc,$c])),Dc=N({...mt.shape,properties:Tx,...et(Me(Ye()),"ARRAY").shape});var kx=ze(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Cx=N({preset:Z(kx),after:Z(I()),before:Z(I())}),Vm=N({...mt.shape,display:Z(ze(["dropdown"])),...et(Cx,"DATE_RANGE").shape});var Bc=N({...mt.shape,...et(st([Xe(I(),Ye())]),"JSON").shape});var Rx=st([tn,rn,Bc,Dc,qn]),HR=Xe(I(),Rx),Zm=N({refreshers:Me(I()),...mt.shape,...et(Ye(),"DYNAMIC").shape});var jf=N({...mt.shape,...et(Ix(),"MARKDOWN").shape});var zc=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(zc||{}),ss=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ss||{}),as=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(as||{});var Lc=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Lc||{}),Qm="both_client_credentials_and_authorization_code";var Ei=(n=>(n.POLLING="POLLING",n.WEBHOOK="WEBHOOK",n.APP_WEBHOOK="APP_WEBHOOK",n.MANUAL="MANUAL",n))(Ei||{}),Uc=(o=>(o.NONE="NONE",o.HEADER_PRESENT="HEADER_PRESENT",o.QUERY_PRESENT="QUERY_PRESENT",o.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",o.HEAD_REQUEST="HEAD_REQUEST",o))(Uc||{}),jR=N({strategy:ze(Uc),paramName:Z(I())}),Mc=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Mc||{});var Wf=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Wf||{}),Ox=N({status:Z(Ar()),body:Z(Ye()),headers:Z(Xe(I(),I()))}),Nx=N({type:De("DELAY"),resumeDateTime:I(),requestIdToReply:Z(I()),handlerId:Z(I()),streamStepProgress:Z(ze(Wf))}),$x=N({type:De("WEBHOOK"),requestId:I(),requestIdToReply:Z(I()),response:Ox,handlerId:Z(I()),streamStepProgress:Z(ze(Wf))}),WR=st([Nx,$x]);var qR=N({body:Ye(),rawBody:Z(Ye()),headers:Xe(I(),I()),queryParams:Xe(I(),I())});function ir(e){return e==null}a(ir,"isNil");var Gm=Dr(require("crypto"),1);var VR=128,Ai,cs,ZR=a(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!Ai||Ai.length<e?(Ai=Buffer.allocUnsafe(e*VR),Gm.default.randomFillSync(Ai),cs=0):cs+e>Ai.length&&(Gm.default.randomFillSync(Ai),cs=0)}catch(t){throw Ai=void 0,t}cs+=e},"fillPool"),QR=a(e=>(ZR(e|=0),Ai.subarray(cs-e,cs)),"random"),KR=a((e,t,r)=>{let i=(2<<31-Math.clz32(e.length-1|1))-1,n=Math.ceil(1.6*i*t/e.length);return(o=t)=>{if(o<=0)return"";let s="";for(;;){let c=r(n),u=n;for(;u--;)if(s+=e[c[u]&i]||"",s.length===o)return s}}},"customRandom"),Dx=a((e,t=21)=>KR(e,t,QR),"customAlphabet");var GR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bx=21,k8=I().check(Ir(new RegExp(`^[0-9a-zA-Z]{${Bx}}$`))),YR=Dx(GR,Bx);var bi=yi(_i(e=>e instanceof Date?e.toISOString():e),I()),fn={id:I(),created:bi,updated:bi},Qt=a(e=>Z(Cc(e)),"Nullable");function Ym(e){return Z(Cc(ze(e)))}a(Ym,"NullableEnum");var O8=yi(_i(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),Z(yt())),N8=Z(Ff.datetime({offset:!0}).check(Lm(e=>e.slice(0,4)!=="0000"))),qf=a(e=>yi(_i(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),Z(Me(e))),"OptionalArrayFromQuery");var B8=Xe(I(),Ye());var xi=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.VERTEX="vertex",v.MISTRAL="mistral",v.XAI="xai",v.DEEPSEEK="deepseek",v.ZAI="zai",v.QWEN="qwen",v.MINIMAX="minimax",v.MOONSHOT="moonshot",v))(xi||{});var ge={};cn(ge,{$brand:()=>na,$input:()=>pf,$output:()=>df,NEVER:()=>Xu,TimePrecision:()=>gf,ZodAny:()=>b_,ZodArray:()=>S_,ZodBase64:()=>dd,ZodBase64URL:()=>pd,ZodBigInt:()=>gs,ZodBigIntFormat:()=>md,ZodBoolean:()=>hs,ZodCIDRv4:()=>ld,ZodCIDRv6:()=>fd,ZodCUID:()=>nd,ZodCUID2:()=>id,ZodCatch:()=>Z_,ZodCodec:()=>vd,ZodCustom:()=>Xc,ZodCustomStringFormat:()=>ds,ZodDate:()=>Zc,ZodDefault:()=>F_,ZodDiscriminatedUnion:()=>P_,ZodE164:()=>hd,ZodEmail:()=>ed,ZodEmoji:()=>td,ZodEnum:()=>ls,ZodError:()=>XR,ZodExactOptional:()=>L_,ZodFile:()=>B_,ZodFirstPartyTypeKind:()=>oy,ZodFunction:()=>ry,ZodGUID:()=>Hc,ZodIPv4:()=>cd,ZodIPv6:()=>ud,ZodISODate:()=>Qf,ZodISODateTime:()=>Zf,ZodISODuration:()=>Gf,ZodISOTime:()=>Kf,ZodIntersection:()=>T_,ZodIssueCode:()=>eO,ZodJWT:()=>gd,ZodKSUID:()=>ad,ZodLazy:()=>J_,ZodLiteral:()=>D_,ZodMAC:()=>h_,ZodMap:()=>N_,ZodNaN:()=>K_,ZodNanoID:()=>rd,ZodNever:()=>I_,ZodNonOptional:()=>xd,ZodNull:()=>E_,ZodNullable:()=>M_,ZodNumber:()=>ps,ZodNumberFormat:()=>uo,ZodObject:()=>Kc,ZodOptional:()=>bd,ZodPipe:()=>Id,ZodPrefault:()=>j_,ZodPromise:()=>ty,ZodReadonly:()=>G_,ZodRealError:()=>Vr,ZodRecord:()=>Yc,ZodSet:()=>$_,ZodString:()=>fs,ZodStringFormat:()=>Dt,ZodSuccess:()=>V_,ZodSymbol:()=>__,ZodTemplateLiteral:()=>X_,ZodTransform:()=>z_,ZodTuple:()=>C_,ZodType:()=>at,ZodULID:()=>od,ZodURL:()=>Vc,ZodUUID:()=>kn,ZodUndefined:()=>y_,ZodUnion:()=>Gc,ZodUnknown:()=>x_,ZodVoid:()=>v_,ZodXID:()=>sd,ZodXor:()=>w_,_ZodString:()=>Jf,_default:()=>H_,_function:()=>j0,any:()=>b0,array:()=>Qc,base64:()=>i0,base64url:()=>o0,bigint:()=>m0,boolean:()=>m_,catch:()=>Q_,check:()=>W0,cidrv4:()=>r0,cidrv6:()=>n0,clone:()=>yr,codec:()=>M0,coerce:()=>sy,config:()=>Zt,core:()=>en,cuid:()=>Qx,cuid2:()=>Kx,custom:()=>q0,date:()=>I0,decode:()=>a_,decodeAsync:()=>u_,describe:()=>V0,discriminatedUnion:()=>k0,e164:()=>s0,email:()=>Lx,emoji:()=>Vx,encode:()=>s_,encodeAsync:()=>c_,endsWith:()=>to,enum:()=>Ed,exactOptional:()=>U_,file:()=>B0,flattenError:()=>Fo,float32:()=>d0,float64:()=>p0,formatError:()=>Ho,fromJSONSchema:()=>J0,function:()=>j0,getErrorMap:()=>rO,globalRegistry:()=>Er,gt:()=>bn,gte:()=>mr,guid:()=>Ux,hash:()=>f0,hex:()=>l0,hostname:()=>u0,httpUrl:()=>qx,includes:()=>Ji,instanceof:()=>Q0,int:()=>Xf,int32:()=>h0,int64:()=>_0,intersection:()=>k_,ipv4:()=>Jx,ipv6:()=>t0,iso:()=>us,json:()=>G0,jwt:()=>a0,keyof:()=>v0,ksuid:()=>Xx,lazy:()=>ey,length:()=>di,literal:()=>D0,locales:()=>ts,looseObject:()=>P0,looseRecord:()=>R0,lowercase:()=>Yi,lt:()=>An,lte:()=>Br,mac:()=>e0,map:()=>O0,maxLength:()=>fi,maxSize:()=>jn,meta:()=>Z0,mime:()=>ro,minLength:()=>cr,minSize:()=>xn,multipleOf:()=>Hn,nan:()=>U0,nanoid:()=>Zx,nativeEnum:()=>$0,negative:()=>xc,never:()=>_d,nonnegative:()=>vc,nonoptional:()=>q_,nonpositive:()=>Ic,normalize:()=>no,null:()=>A_,nullable:()=>Wc,nullish:()=>z0,number:()=>g_,object:()=>S0,optional:()=>jc,overwrite:()=>ln,parse:()=>r_,parseAsync:()=>n_,partialRecord:()=>C0,pipe:()=>qc,positive:()=>bc,prefault:()=>W_,preprocess:()=>Y0,prettifyError:()=>nl,promise:()=>H0,property:()=>Sc,readonly:()=>Y_,record:()=>O_,refine:()=>ny,regex:()=>Ir,regexes:()=>qr,registry:()=>La,safeDecode:()=>f_,safeDecodeAsync:()=>p_,safeEncode:()=>l_,safeEncodeAsync:()=>d_,safeParse:()=>i_,safeParseAsync:()=>o_,set:()=>N0,setErrorMap:()=>tO,size:()=>li,slugify:()=>ns,startsWith:()=>eo,strictObject:()=>w0,string:()=>Yf,stringFormat:()=>c0,stringbool:()=>K0,success:()=>L0,superRefine:()=>iy,symbol:()=>E0,templateLiteral:()=>F0,toJSONSchema:()=>Tc,toLowerCase:()=>oo,toUpperCase:()=>so,transform:()=>Ad,treeifyError:()=>rl,trim:()=>io,tuple:()=>R_,uint32:()=>g0,uint64:()=>y0,ulid:()=>Gx,undefined:()=>A0,union:()=>yd,unknown:()=>co,uppercase:()=>Xi,url:()=>Wx,util:()=>fe,uuid:()=>Mx,uuidv4:()=>Fx,uuidv6:()=>Hx,uuidv7:()=>jx,void:()=>x0,xid:()=>Yx,xor:()=>T0});var Fc={};cn(Fc,{ZodAny:()=>b_,ZodArray:()=>S_,ZodBase64:()=>dd,ZodBase64URL:()=>pd,ZodBigInt:()=>gs,ZodBigIntFormat:()=>md,ZodBoolean:()=>hs,ZodCIDRv4:()=>ld,ZodCIDRv6:()=>fd,ZodCUID:()=>nd,ZodCUID2:()=>id,ZodCatch:()=>Z_,ZodCodec:()=>vd,ZodCustom:()=>Xc,ZodCustomStringFormat:()=>ds,ZodDate:()=>Zc,ZodDefault:()=>F_,ZodDiscriminatedUnion:()=>P_,ZodE164:()=>hd,ZodEmail:()=>ed,ZodEmoji:()=>td,ZodEnum:()=>ls,ZodExactOptional:()=>L_,ZodFile:()=>B_,ZodFunction:()=>ry,ZodGUID:()=>Hc,ZodIPv4:()=>cd,ZodIPv6:()=>ud,ZodIntersection:()=>T_,ZodJWT:()=>gd,ZodKSUID:()=>ad,ZodLazy:()=>J_,ZodLiteral:()=>D_,ZodMAC:()=>h_,ZodMap:()=>N_,ZodNaN:()=>K_,ZodNanoID:()=>rd,ZodNever:()=>I_,ZodNonOptional:()=>xd,ZodNull:()=>E_,ZodNullable:()=>M_,ZodNumber:()=>ps,ZodNumberFormat:()=>uo,ZodObject:()=>Kc,ZodOptional:()=>bd,ZodPipe:()=>Id,ZodPrefault:()=>j_,ZodPromise:()=>ty,ZodReadonly:()=>G_,ZodRecord:()=>Yc,ZodSet:()=>$_,ZodString:()=>fs,ZodStringFormat:()=>Dt,ZodSuccess:()=>V_,ZodSymbol:()=>__,ZodTemplateLiteral:()=>X_,ZodTransform:()=>z_,ZodTuple:()=>C_,ZodType:()=>at,ZodULID:()=>od,ZodURL:()=>Vc,ZodUUID:()=>kn,ZodUndefined:()=>y_,ZodUnion:()=>Gc,ZodUnknown:()=>x_,ZodVoid:()=>v_,ZodXID:()=>sd,ZodXor:()=>w_,_ZodString:()=>Jf,_default:()=>H_,_function:()=>j0,any:()=>b0,array:()=>Qc,base64:()=>i0,base64url:()=>o0,bigint:()=>m0,boolean:()=>m_,catch:()=>Q_,check:()=>W0,cidrv4:()=>r0,cidrv6:()=>n0,codec:()=>M0,cuid:()=>Qx,cuid2:()=>Kx,custom:()=>q0,date:()=>I0,describe:()=>V0,discriminatedUnion:()=>k0,e164:()=>s0,email:()=>Lx,emoji:()=>Vx,enum:()=>Ed,exactOptional:()=>U_,file:()=>B0,float32:()=>d0,float64:()=>p0,function:()=>j0,guid:()=>Ux,hash:()=>f0,hex:()=>l0,hostname:()=>u0,httpUrl:()=>qx,instanceof:()=>Q0,int:()=>Xf,int32:()=>h0,int64:()=>_0,intersection:()=>k_,ipv4:()=>Jx,ipv6:()=>t0,json:()=>G0,jwt:()=>a0,keyof:()=>v0,ksuid:()=>Xx,lazy:()=>ey,literal:()=>D0,looseObject:()=>P0,looseRecord:()=>R0,mac:()=>e0,map:()=>O0,meta:()=>Z0,nan:()=>U0,nanoid:()=>Zx,nativeEnum:()=>$0,never:()=>_d,nonoptional:()=>q_,null:()=>A_,nullable:()=>Wc,nullish:()=>z0,number:()=>g_,object:()=>S0,optional:()=>jc,partialRecord:()=>C0,pipe:()=>qc,prefault:()=>W_,preprocess:()=>Y0,promise:()=>H0,readonly:()=>Y_,record:()=>O_,refine:()=>ny,set:()=>N0,strictObject:()=>w0,string:()=>Yf,stringFormat:()=>c0,stringbool:()=>K0,success:()=>L0,superRefine:()=>iy,symbol:()=>E0,templateLiteral:()=>F0,transform:()=>Ad,tuple:()=>R_,uint32:()=>g0,uint64:()=>y0,ulid:()=>Gx,undefined:()=>A0,union:()=>yd,unknown:()=>co,url:()=>Wx,uuid:()=>Mx,uuidv4:()=>Fx,uuidv6:()=>Hx,uuidv7:()=>jx,void:()=>x0,xid:()=>Yx,xor:()=>T0});var Vf={};cn(Vf,{endsWith:()=>to,gt:()=>bn,gte:()=>mr,includes:()=>Ji,length:()=>di,lowercase:()=>Yi,lt:()=>An,lte:()=>Br,maxLength:()=>fi,maxSize:()=>jn,mime:()=>ro,minLength:()=>cr,minSize:()=>xn,multipleOf:()=>Hn,negative:()=>xc,nonnegative:()=>vc,nonpositive:()=>Ic,normalize:()=>no,overwrite:()=>ln,positive:()=>bc,property:()=>Sc,regex:()=>Ir,size:()=>li,slugify:()=>ns,startsWith:()=>eo,toLowerCase:()=>oo,toUpperCase:()=>so,trim:()=>io,uppercase:()=>Xi});var us={};cn(us,{ZodISODate:()=>Qf,ZodISODateTime:()=>Zf,ZodISODuration:()=>Gf,ZodISOTime:()=>Kf,date:()=>Jm,datetime:()=>Xm,duration:()=>t_,time:()=>e_});var Zf=T("ZodISODateTime",(e,t)=>{ga.init(e,t),Dt.init(e,t)});function Xm(e){return ac(Zf,e)}a(Xm,"datetime");var Qf=T("ZodISODate",(e,t)=>{ma.init(e,t),Dt.init(e,t)});function Jm(e){return cc(Qf,e)}a(Jm,"date");var Kf=T("ZodISOTime",(e,t)=>{_a.init(e,t),Dt.init(e,t)});function e_(e){return uc(Kf,e)}a(e_,"time");var Gf=T("ZodISODuration",(e,t)=>{ya.init(e,t),Dt.init(e,t)});function t_(e){return lc(Gf,e)}a(t_,"duration");var zx=a((e,t)=>{la.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a(r=>Ho(e,r),"value")},flatten:{value:a(r=>Fo(e,r),"value")},addIssue:{value:a(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Lo,2)},"value")},addIssues:{value:a(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Lo,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),XR=T("ZodError",zx),Vr=T("ZodError",zx,{Parent:Error});var r_=jo(Vr),n_=Wo(Vr),i_=qo(Vr),o_=Zo(Vr),s_=il(Vr),a_=ol(Vr),c_=sl(Vr),u_=al(Vr),l_=cl(Vr),f_=ul(Vr),d_=ll(Vr),p_=fl(Vr);var at=T("ZodType",(e,t)=>(We.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:is(e,"input"),output:is(e,"output")}}),e.toJSONSchema=Jg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(fe.mergeDefs(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(r,i)=>yr(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>r_(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>i_(e,r,i),e.parseAsync=async(r,i)=>n_(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>o_(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>s_(e,r,i),e.decode=(r,i)=>a_(e,r,i),e.encodeAsync=async(r,i)=>c_(e,r,i),e.decodeAsync=async(r,i)=>u_(e,r,i),e.safeEncode=(r,i)=>l_(e,r,i),e.safeDecode=(r,i)=>f_(e,r,i),e.safeEncodeAsync=async(r,i)=>d_(e,r,i),e.safeDecodeAsync=async(r,i)=>p_(e,r,i),e.refine=(r,i)=>e.check(ny(r,i)),e.superRefine=r=>e.check(iy(r)),e.overwrite=r=>e.check(ln(r)),e.optional=()=>jc(e),e.exactOptional=()=>U_(e),e.nullable=()=>Wc(e),e.nullish=()=>jc(Wc(e)),e.nonoptional=r=>q_(e,r),e.array=()=>Qc(e),e.or=r=>yd([e,r]),e.and=r=>k_(e,r),e.transform=r=>qc(e,Ad(r)),e.default=r=>H_(e,r),e.prefault=r=>W_(e,r),e.catch=r=>Q_(e,r),e.pipe=r=>qc(e,r),e.readonly=()=>Y_(e),e.describe=r=>{let i=e.clone();return Er.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return Er.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Er.get(e);let i=e.clone();return Er.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Jf=T("_ZodString",(e,t)=>{Fn.init(e,t),at.init(e,t),e._zod.processJSONSchema=(i,n,o)=>em(e,i,n,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(Ir(...i)),e.includes=(...i)=>e.check(Ji(...i)),e.startsWith=(...i)=>e.check(eo(...i)),e.endsWith=(...i)=>e.check(to(...i)),e.min=(...i)=>e.check(cr(...i)),e.max=(...i)=>e.check(fi(...i)),e.length=(...i)=>e.check(di(...i)),e.nonempty=(...i)=>e.check(cr(1,...i)),e.lowercase=i=>e.check(Yi(i)),e.uppercase=i=>e.check(Xi(i)),e.trim=()=>e.check(io()),e.normalize=(...i)=>e.check(no(...i)),e.toLowerCase=()=>e.check(oo()),e.toUpperCase=()=>e.check(so()),e.slugify=()=>e.check(ns())}),fs=T("ZodString",(e,t)=>{Fn.init(e,t),Jf.init(e,t),e.email=r=>e.check(Fa(ed,r)),e.url=r=>e.check(Gi(Vc,r)),e.jwt=r=>e.check(sc(gd,r)),e.emoji=r=>e.check(Va(td,r)),e.guid=r=>e.check(rs(Hc,r)),e.uuid=r=>e.check(Ha(kn,r)),e.uuidv4=r=>e.check(ja(kn,r)),e.uuidv6=r=>e.check(Wa(kn,r)),e.uuidv7=r=>e.check(qa(kn,r)),e.nanoid=r=>e.check(Za(rd,r)),e.guid=r=>e.check(rs(Hc,r)),e.cuid=r=>e.check(Qa(nd,r)),e.cuid2=r=>e.check(Ka(id,r)),e.ulid=r=>e.check(Ga(od,r)),e.base64=r=>e.check(nc(dd,r)),e.base64url=r=>e.check(ic(pd,r)),e.xid=r=>e.check(Ya(sd,r)),e.ksuid=r=>e.check(Xa(ad,r)),e.ipv4=r=>e.check(Ja(cd,r)),e.ipv6=r=>e.check(ec(ud,r)),e.cidrv4=r=>e.check(tc(ld,r)),e.cidrv6=r=>e.check(rc(fd,r)),e.e164=r=>e.check(oc(hd,r)),e.datetime=r=>e.check(Xm(r)),e.date=r=>e.check(Jm(r)),e.time=r=>e.check(e_(r)),e.duration=r=>e.check(t_(r))});function Yf(e){return Ua(fs,e)}a(Yf,"string");var Dt=T("ZodStringFormat",(e,t)=>{Ct.init(e,t),Jf.init(e,t)}),ed=T("ZodEmail",(e,t)=>{Il.init(e,t),Dt.init(e,t)});function Lx(e){return Fa(ed,e)}a(Lx,"email");var Hc=T("ZodGUID",(e,t)=>{bl.init(e,t),Dt.init(e,t)});function Ux(e){return rs(Hc,e)}a(Ux,"guid");var kn=T("ZodUUID",(e,t)=>{xl.init(e,t),Dt.init(e,t)});function Mx(e){return Ha(kn,e)}a(Mx,"uuid");function Fx(e){return ja(kn,e)}a(Fx,"uuidv4");function Hx(e){return Wa(kn,e)}a(Hx,"uuidv6");function jx(e){return qa(kn,e)}a(jx,"uuidv7");var Vc=T("ZodURL",(e,t)=>{ha.init(e,t),Dt.init(e,t)});function Wx(e){return Gi(Vc,e)}a(Wx,"url");function qx(e){return Gi(Vc,{protocol:/^https?$/,hostname:qr.domain,...fe.normalizeParams(e)})}a(qx,"httpUrl");var td=T("ZodEmoji",(e,t)=>{vl.init(e,t),Dt.init(e,t)});function Vx(e){return Va(td,e)}a(Vx,"emoji");var rd=T("ZodNanoID",(e,t)=>{Sl.init(e,t),Dt.init(e,t)});function Zx(e){return Za(rd,e)}a(Zx,"nanoid");var nd=T("ZodCUID",(e,t)=>{wl.init(e,t),Dt.init(e,t)});function Qx(e){return Qa(nd,e)}a(Qx,"cuid");var id=T("ZodCUID2",(e,t)=>{Pl.init(e,t),Dt.init(e,t)});function Kx(e){return Ka(id,e)}a(Kx,"cuid2");var od=T("ZodULID",(e,t)=>{Tl.init(e,t),Dt.init(e,t)});function Gx(e){return Ga(od,e)}a(Gx,"ulid");var sd=T("ZodXID",(e,t)=>{kl.init(e,t),Dt.init(e,t)});function Yx(e){return Ya(sd,e)}a(Yx,"xid");var ad=T("ZodKSUID",(e,t)=>{Cl.init(e,t),Dt.init(e,t)});function Xx(e){return Xa(ad,e)}a(Xx,"ksuid");var cd=T("ZodIPv4",(e,t)=>{Rl.init(e,t),Dt.init(e,t)});function Jx(e){return Ja(cd,e)}a(Jx,"ipv4");var h_=T("ZodMAC",(e,t)=>{Nl.init(e,t),Dt.init(e,t)});function e0(e){return hf(h_,e)}a(e0,"mac");var ud=T("ZodIPv6",(e,t)=>{Ol.init(e,t),Dt.init(e,t)});function t0(e){return ec(ud,e)}a(t0,"ipv6");var ld=T("ZodCIDRv4",(e,t)=>{$l.init(e,t),Dt.init(e,t)});function r0(e){return tc(ld,e)}a(r0,"cidrv4");var fd=T("ZodCIDRv6",(e,t)=>{Dl.init(e,t),Dt.init(e,t)});function n0(e){return rc(fd,e)}a(n0,"cidrv6");var dd=T("ZodBase64",(e,t)=>{Bl.init(e,t),Dt.init(e,t)});function i0(e){return nc(dd,e)}a(i0,"base64");var pd=T("ZodBase64URL",(e,t)=>{zl.init(e,t),Dt.init(e,t)});function o0(e){return ic(pd,e)}a(o0,"base64url");var hd=T("ZodE164",(e,t)=>{Ll.init(e,t),Dt.init(e,t)});function s0(e){return oc(hd,e)}a(s0,"e164");var gd=T("ZodJWT",(e,t)=>{Ul.init(e,t),Dt.init(e,t)});function a0(e){return sc(gd,e)}a(a0,"jwt");var ds=T("ZodCustomStringFormat",(e,t)=>{Ml.init(e,t),Dt.init(e,t)});function c0(e,t,r={}){return ao(ds,e,t,r)}a(c0,"stringFormat");function u0(e){return ao(ds,"hostname",qr.hostname,e)}a(u0,"hostname");function l0(e){return ao(ds,"hex",qr.hex,e)}a(l0,"hex");function f0(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,n=qr[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return ao(ds,i,n,t)}a(f0,"hash");var ps=T("ZodNumber",(e,t)=>{Go.init(e,t),at.init(e,t),e._zod.processJSONSchema=(i,n,o)=>tm(e,i,n,o),e.gt=(i,n)=>e.check(bn(i,n)),e.gte=(i,n)=>e.check(mr(i,n)),e.min=(i,n)=>e.check(mr(i,n)),e.lt=(i,n)=>e.check(An(i,n)),e.lte=(i,n)=>e.check(Br(i,n)),e.max=(i,n)=>e.check(Br(i,n)),e.int=i=>e.check(Xf(i)),e.safe=i=>e.check(Xf(i)),e.positive=i=>e.check(bn(0,i)),e.nonnegative=i=>e.check(mr(0,i)),e.negative=i=>e.check(An(0,i)),e.nonpositive=i=>e.check(Br(0,i)),e.multipleOf=(i,n)=>e.check(Hn(i,n)),e.step=(i,n)=>e.check(Hn(i,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function g_(e){return fc(ps,e)}a(g_,"number");var uo=T("ZodNumberFormat",(e,t)=>{Ea.init(e,t),ps.init(e,t)});function Xf(e){return pc(uo,e)}a(Xf,"int");function d0(e){return mf(uo,e)}a(d0,"float32");function p0(e){return _f(uo,e)}a(p0,"float64");function h0(e){return yf(uo,e)}a(h0,"int32");function g0(e){return Ef(uo,e)}a(g0,"uint32");var hs=T("ZodBoolean",(e,t)=>{Qi.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rm(e,r,i,n)});function m_(e){return hc(hs,e)}a(m_,"boolean");var gs=T("ZodBigInt",(e,t)=>{Yo.init(e,t),at.init(e,t),e._zod.processJSONSchema=(i,n,o)=>nm(e,i,n,o),e.gte=(i,n)=>e.check(mr(i,n)),e.min=(i,n)=>e.check(mr(i,n)),e.gt=(i,n)=>e.check(bn(i,n)),e.gte=(i,n)=>e.check(mr(i,n)),e.min=(i,n)=>e.check(mr(i,n)),e.lt=(i,n)=>e.check(An(i,n)),e.lte=(i,n)=>e.check(Br(i,n)),e.max=(i,n)=>e.check(Br(i,n)),e.positive=i=>e.check(bn(BigInt(0),i)),e.negative=i=>e.check(An(BigInt(0),i)),e.nonpositive=i=>e.check(Br(BigInt(0),i)),e.nonnegative=i=>e.check(mr(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Hn(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function m0(e){return Af(gs,e)}a(m0,"bigint");var md=T("ZodBigIntFormat",(e,t)=>{Fl.init(e,t),gs.init(e,t)});function _0(e){return bf(md,e)}a(_0,"int64");function y0(e){return xf(md,e)}a(y0,"uint64");var __=T("ZodSymbol",(e,t)=>{Hl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>im(e,r,i,n)});function E0(e){return If(__,e)}a(E0,"symbol");var y_=T("ZodUndefined",(e,t)=>{jl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>sm(e,r,i,n)});function A0(e){return vf(y_,e)}a(A0,"_undefined");var E_=T("ZodNull",(e,t)=>{Wl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>om(e,r,i,n)});function A_(e){return Sf(E_,e)}a(A_,"_null");var b_=T("ZodAny",(e,t)=>{Aa.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>um(e,r,i,n)});function b0(){return _c(b_)}a(b0,"any");var x_=T("ZodUnknown",(e,t)=>{ba.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>lm(e,r,i,n)});function co(){return yc(x_)}a(co,"unknown");var I_=T("ZodNever",(e,t)=>{ql.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>cm(e,r,i,n)});function _d(e){return wf(I_,e)}a(_d,"never");var v_=T("ZodVoid",(e,t)=>{xa.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>am(e,r,i,n)});function x0(e){return Ec(v_,e)}a(x0,"_void");var Zc=T("ZodDate",(e,t)=>{Ia.init(e,t),at.init(e,t),e._zod.processJSONSchema=(i,n,o)=>fm(e,i,n,o),e.min=(i,n)=>e.check(mr(i,n)),e.max=(i,n)=>e.check(Br(i,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function I0(e){return Pf(Zc,e)}a(I0,"date");var S_=T("ZodArray",(e,t)=>{va.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Im(e,r,i,n),e.element=t.element,e.min=(r,i)=>e.check(cr(r,i)),e.nonempty=r=>e.check(cr(1,r)),e.max=(r,i)=>e.check(fi(r,i)),e.length=(r,i)=>e.check(di(r,i)),e.unwrap=()=>e.element});function Qc(e,t){return Xg(S_,e,t)}a(Qc,"array");function v0(e){let t=e._zod.def.shape;return Ed(Object.keys(t))}a(v0,"keyof");var Kc=T("ZodObject",(e,t)=>{og.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>vm(e,r,i,n),fe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Ed(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:co()}),e.loose=()=>e.clone({...e._zod.def,catchall:co()}),e.strict=()=>e.clone({...e._zod.def,catchall:_d()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>fe.extend(e,r),e.safeExtend=r=>fe.safeExtend(e,r),e.merge=r=>fe.merge(e,r),e.pick=r=>fe.pick(e,r),e.omit=r=>fe.omit(e,r),e.partial=(...r)=>fe.partial(bd,e,r[0]),e.required=(...r)=>fe.required(xd,e,r[0])});function S0(e,t){let r={type:"object",shape:e??{},...fe.normalizeParams(t)};return new Kc(r)}a(S0,"object");function w0(e,t){return new Kc({type:"object",shape:e,catchall:_d(),...fe.normalizeParams(t)})}a(w0,"strictObject");function P0(e,t){return new Kc({type:"object",shape:e,catchall:co(),...fe.normalizeParams(t)})}a(P0,"looseObject");var Gc=T("ZodUnion",(e,t)=>{Ki.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Df(e,r,i,n),e.options=t.options});function yd(e,t){return new Gc({type:"union",options:e,...fe.normalizeParams(t)})}a(yd,"union");var w_=T("ZodXor",(e,t)=>{Gc.init(e,t),Zl.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Df(e,r,i,n),e.options=t.options});function T0(e,t){return new w_({type:"union",options:e,inclusive:!1,...fe.normalizeParams(t)})}a(T0,"xor");var P_=T("ZodDiscriminatedUnion",(e,t)=>{Gc.init(e,t),Sa.init(e,t)});function k0(e,t,r){return new P_({type:"union",options:t,discriminator:e,...fe.normalizeParams(r)})}a(k0,"discriminatedUnion");var T_=T("ZodIntersection",(e,t)=>{Ql.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Sm(e,r,i,n)});function k_(e,t){return new T_({type:"intersection",left:e,right:t})}a(k_,"intersection");var C_=T("ZodTuple",(e,t)=>{wa.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>wm(e,r,i,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function R_(e,t,r){let i=t instanceof We,n=i?r:t,o=i?t:null;return new C_({type:"tuple",items:e,rest:o,...fe.normalizeParams(n)})}a(R_,"tuple");var Yc=T("ZodRecord",(e,t)=>{Pa.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Pm(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function O_(e,t,r){return new Yc({type:"record",keyType:e,valueType:t,...fe.normalizeParams(r)})}a(O_,"record");function C0(e,t,r){let i=yr(e);return i._zod.values=void 0,new Yc({type:"record",keyType:i,valueType:t,...fe.normalizeParams(r)})}a(C0,"partialRecord");function R0(e,t,r){return new Yc({type:"record",keyType:e,valueType:t,mode:"loose",...fe.normalizeParams(r)})}a(R0,"looseRecord");var N_=T("ZodMap",(e,t)=>{Kl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>bm(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(xn(...r)),e.nonempty=r=>e.check(xn(1,r)),e.max=(...r)=>e.check(jn(...r)),e.size=(...r)=>e.check(li(...r))});function O0(e,t,r){return new N_({type:"map",keyType:e,valueType:t,...fe.normalizeParams(r)})}a(O0,"map");var $_=T("ZodSet",(e,t)=>{Gl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>xm(e,r,i,n),e.min=(...r)=>e.check(xn(...r)),e.nonempty=r=>e.check(xn(1,r)),e.max=(...r)=>e.check(jn(...r)),e.size=(...r)=>e.check(li(...r))});function N0(e,t){return new $_({type:"set",valueType:e,...fe.normalizeParams(t)})}a(N0,"set");var ls=T("ZodEnum",(e,t)=>{Ta.init(e,t),at.init(e,t),e._zod.processJSONSchema=(i,n,o)=>dm(e,i,n,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ls({...t,checks:[],...fe.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new ls({...t,checks:[],...fe.normalizeParams(n),entries:o})}});function Ed(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ls({type:"enum",entries:r,...fe.normalizeParams(t)})}a(Ed,"_enum");function $0(e,t){return new ls({type:"enum",entries:e,...fe.normalizeParams(t)})}a($0,"nativeEnum");var D_=T("ZodLiteral",(e,t)=>{ka.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>pm(e,r,i,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function D0(e,t){return new D_({type:"literal",values:Array.isArray(e)?e:[e],...fe.normalizeParams(t)})}a(D0,"literal");var B_=T("ZodFile",(e,t)=>{Yl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>mm(e,r,i,n),e.min=(r,i)=>e.check(xn(r,i)),e.max=(r,i)=>e.check(jn(r,i)),e.mime=(r,i)=>e.check(ro(Array.isArray(r)?r:[r],i))});function B0(e){return kf(B_,e)}a(B0,"file");var z_=T("ZodTransform",(e,t)=>{Ca.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Am(e,r,i,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new oi(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(fe.issue(o,r.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(fe.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function Ad(e){return new z_({type:"transform",transform:e})}a(Ad,"transform");var bd=T("ZodOptional",(e,t)=>{Xo.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Bf(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function jc(e){return new bd({type:"optional",innerType:e})}a(jc,"optional");var L_=T("ZodExactOptional",(e,t)=>{Xl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Bf(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function U_(e){return new L_({type:"optional",innerType:e})}a(U_,"exactOptional");var M_=T("ZodNullable",(e,t)=>{Ra.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Tm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Wc(e){return new M_({type:"nullable",innerType:e})}a(Wc,"nullable");function z0(e){return jc(Wc(e))}a(z0,"nullish");var F_=T("ZodDefault",(e,t)=>{Jl.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Cm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function H_(e,t){return new F_({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():fe.shallowClone(t)}})}a(H_,"_default");var j_=T("ZodPrefault",(e,t)=>{ef.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Rm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function W_(e,t){return new j_({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():fe.shallowClone(t)}})}a(W_,"prefault");var xd=T("ZodNonOptional",(e,t)=>{tf.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>km(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function q_(e,t){return new xd({type:"nonoptional",innerType:e,...fe.normalizeParams(t)})}a(q_,"nonoptional");var V_=T("ZodSuccess",(e,t)=>{rf.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>_m(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function L0(e){return new V_({type:"success",innerType:e})}a(L0,"success");var Z_=T("ZodCatch",(e,t)=>{nf.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Om(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Q_(e,t){return new Z_({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}a(Q_,"_catch");var K_=T("ZodNaN",(e,t)=>{of.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>hm(e,r,i,n)});function U0(e){return Tf(K_,e)}a(U0,"nan");var Id=T("ZodPipe",(e,t)=>{Oa.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Nm(e,r,i,n),e.in=t.in,e.out=t.out});function qc(e,t){return new Id({type:"pipe",in:e,out:t})}a(qc,"pipe");var vd=T("ZodCodec",(e,t)=>{Id.init(e,t),Jo.init(e,t)});function M0(e,t,r){return new vd({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}a(M0,"codec");var G_=T("ZodReadonly",(e,t)=>{sf.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>$m(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Y_(e){return new G_({type:"readonly",innerType:e})}a(Y_,"readonly");var X_=T("ZodTemplateLiteral",(e,t)=>{af.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>gm(e,r,i,n)});function F0(e,t){return new X_({type:"template_literal",parts:e,...fe.normalizeParams(t)})}a(F0,"templateLiteral");var J_=T("ZodLazy",(e,t)=>{lf.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Bm(e,r,i,n),e.unwrap=()=>e._zod.def.getter()});function ey(e){return new J_({type:"lazy",getter:e})}a(ey,"lazy");var ty=T("ZodPromise",(e,t)=>{uf.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Dm(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function H0(e){return new ty({type:"promise",innerType:e})}a(H0,"promise");var ry=T("ZodFunction",(e,t)=>{cf.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Em(e,r,i,n)});function j0(e){return new ry({type:"function",input:Array.isArray(e?.input)?R_(e?.input):e?.input??Qc(co()),output:e?.output??co()})}a(j0,"_function");var Xc=T("ZodCustom",(e,t)=>{Na.init(e,t),at.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ym(e,r,i,n)});function W0(e){let t=new $t({check:"custom"});return t._zod.check=e,t}a(W0,"check");function q0(e,t){return wc(Xc,e??(()=>!0),t)}a(q0,"custom");function ny(e,t={}){return Pc(Xc,e,t)}a(ny,"refine");function iy(e){return Cf(e)}a(iy,"superRefine");var V0=Rf,Z0=Of;function Q0(e,t={}){let r=new Xc({type:"custom",check:"custom",fn:a(i=>i instanceof e,"fn"),abort:!0,...fe.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}a(Q0,"_instanceof");var K0=a((...e)=>Nf({Codec:vd,Boolean:hs,String:fs},...e),"stringbool");function G0(e){let t=ey(()=>yd([Yf(e),g_(),m_(),A_(),Qc(t),O_(Yf(),t)]));return t}a(G0,"json");function Y0(e,t){return qc(Ad(e),t)}a(Y0,"preprocess");var eO={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 tO(e){Zt({customError:e})}a(tO,"setErrorMap");function rO(){return Zt().customError}a(rO,"getErrorMap");var oy;oy||(oy={});var ye={...Fc,...Vf,iso:us},nO=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function iO(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}a(iO,"detectVersion");function oO(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}a(oO,"resolveRef");function X0(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ye.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return ye.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=oO(n,t),s=Rr(o,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return ye.null();if(n.length===0)return ye.never();if(n.length===1)return ye.literal(n[0]);if(n.every(s=>typeof s=="string"))return ye.enum(n);let o=n.map(s=>ye.literal(s));return o.length<2?o[0]:ye.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ye.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...e,type:o};return X0(s,t)});return n.length===0?ye.never():n.length===1?n[0]:ye.union(n)}if(!r)return ye.any();let i;switch(r){case"string":{let n=ye.string();if(e.format){let o=e.format;o==="email"?n=n.check(ye.email()):o==="uri"||o==="uri-reference"?n=n.check(ye.url()):o==="uuid"||o==="guid"?n=n.check(ye.uuid()):o==="date-time"?n=n.check(ye.iso.datetime()):o==="date"?n=n.check(ye.iso.date()):o==="time"?n=n.check(ye.iso.time()):o==="duration"?n=n.check(ye.iso.duration()):o==="ipv4"?n=n.check(ye.ipv4()):o==="ipv6"?n=n.check(ye.ipv6()):o==="mac"?n=n.check(ye.mac()):o==="cidr"?n=n.check(ye.cidrv4()):o==="cidr-v6"?n=n.check(ye.cidrv6()):o==="base64"?n=n.check(ye.base64()):o==="base64url"?n=n.check(ye.base64url()):o==="e164"?n=n.check(ye.e164()):o==="jwt"?n=n.check(ye.jwt()):o==="emoji"?n=n.check(ye.emoji()):o==="nanoid"?n=n.check(ye.nanoid()):o==="cuid"?n=n.check(ye.cuid()):o==="cuid2"?n=n.check(ye.cuid2()):o==="ulid"?n=n.check(ye.ulid()):o==="xid"?n=n.check(ye.xid()):o==="ksuid"&&(n=n.check(ye.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?ye.number().int():ye.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),i=n;break}case"boolean":{i=ye.boolean();break}case"null":{i=ye.null();break}case"object":{let n={},o=e.properties||{},s=new Set(e.required||[]);for(let[u,l]of Object.entries(o)){let f=Rr(l,t);n[u]=s.has(u)?f:f.optional()}if(e.propertyNames){let u=Rr(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Rr(e.additionalProperties,t):ye.any();if(Object.keys(n).length===0){i=ye.record(u,l);break}let f=ye.object(n).passthrough(),p=ye.looseRecord(u,l);i=ye.intersection(f,p);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),f=[];for(let g of l){let h=Rr(u[g],t),_=ye.string().regex(new RegExp(g));f.push(ye.looseRecord(_,h))}let p=[];if(Object.keys(n).length>0&&p.push(ye.object(n).passthrough()),p.push(...f),p.length===0)i=ye.object({}).passthrough();else if(p.length===1)i=p[0];else{let g=ye.intersection(p[0],p[1]);for(let h=2;h<p.length;h++)g=ye.intersection(g,p[h]);i=g}break}let c=ye.object(n);e.additionalProperties===!1?i=c.strict():typeof e.additionalProperties=="object"?i=c.catchall(Rr(e.additionalProperties,t)):i=c.passthrough();break}case"array":{let n=e.prefixItems,o=e.items;if(n&&Array.isArray(n)){let s=n.map(u=>Rr(u,t)),c=o&&typeof o=="object"&&!Array.isArray(o)?Rr(o,t):void 0;c?i=ye.tuple(s).rest(c):i=ye.tuple(s),typeof e.minItems=="number"&&(i=i.check(ye.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(ye.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=o.map(u=>Rr(u,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?Rr(e.additionalItems,t):void 0;c?i=ye.tuple(s).rest(c):i=ye.tuple(s),typeof e.minItems=="number"&&(i=i.check(ye.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(ye.maxLength(e.maxItems)))}else if(o!==void 0){let s=Rr(o,t),c=ye.array(s);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),i=c}else i=ye.array(ye.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(i=i.describe(e.description)),e.default!==void 0&&(i=i.default(e.default)),i}a(X0,"convertBaseSchema");function Rr(e,t){if(typeof e=="boolean")return e?ye.any():ye.never();let r=X0(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>Rr(l,t)),u=ye.union(c);r=i?ye.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>Rr(l,t)),u=ye.xor(c);r=i?ye.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:ye.any();else{let c=i?r:Rr(e.allOf[0],t),u=i?0:1;for(let l=u;l<e.allOf.length;l++)c=ye.intersection(c,Rr(e.allOf[l],t));r=c}e.nullable===!0&&t.version==="openapi-3.0"&&(r=ye.nullable(r)),e.readOnly===!0&&(r=ye.readonly(r));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)c in e&&(n[c]=e[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))nO.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(r,n),r}a(Rr,"convertSchema");function J0(e,t){if(typeof e=="boolean")return e?ye.any():ye.never();let r=iO(e,t?.defaultTarget),i=e.$defs||e.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Er};return Rr(e,n)}a(J0,"fromJSONSchema");var sy={};cn(sy,{bigint:()=>uO,boolean:()=>cO,date:()=>lO,number:()=>aO,string:()=>sO});function sO(e){return Ma(fs,e)}a(sO,"string");function aO(e){return dc(ps,e)}a(aO,"number");function cO(e){return gc(hs,e)}a(cO,"boolean");function uO(e){return mc(gs,e)}a(uO,"bigint");function lO(e){return Ac(Zc,e)}a(lO,"date");Zt($a());var ay={required:"required",invalidGitRepoSlug:"invalidGitRepoSlug",invalidGitRepoBranch:"invalidGitRepoBranch",invalidGitRepoRemoteUrl:"invalidGitRepoRemoteUrl",invalidExternalId:"invalidExternalId",invalidFileName:"invalidFileName",messageRequiresContentOrFiles:"messageRequiresContentOrFiles",agentConfigTooLarge:"agentConfigTooLarge",invalidGcpResourceId:"invalidGcpResourceId",duplicateRouteName:"duplicateRouteName",atLeastOne:"atLeastOne",wholeNumber:"wholeNumber",atMostTenThousand:"atMostTenThousand",tierNameTooLong:"tierNameTooLong",tierDescriptionTooLong:"tierDescriptionTooLong",invalidEmoji:"invalidEmoji",tierTooManyModels:"tierTooManyModels",tierDuplicateModel:"tierDuplicateModel",tierThinkingBudgetInvalid:"tierThinkingBudgetInvalid"};var eI=(r=>(r.IMAGE="image",r.TEXT="text",r))(eI||{}),Lr=ge.object({apiKey:ge.string()}),tI=ge.object({serviceAccountJson:ge.string().min(1)}),rI=Lr,nI=Lr.extend({apiKeyHash:ge.string()}),iI=Lr,oI=Lr,sI=Lr,aI=Lr,cI=Lr,uI=Lr,lI=ge.object({accessKeyId:ge.string().min(1),secretAccessKey:ge.string().min(1),sessionToken:ge.string().optional()}),fI=Lr,dI=ge.object({}),pI=ge.object({}),cy=ge.object({modelId:ge.string(),modelName:ge.string(),modelType:ge.enum(eI)}),hI=ge.object({apiKeyHeader:ge.string(),baseUrl:ge.string(),models:ge.array(cy),defaultHeaders:ge.record(ge.string(),ge.string()).optional(),apiStyle:ge.enum(["chat","responses"]).optional()}),gI=ge.object({accountId:ge.string(),gatewayId:ge.string(),models:ge.array(cy),vertexProject:ge.string().optional(),vertexRegion:ge.string().optional()}),mI=ge.object({resourceName:ge.string(),apiVersion:ge.preprocess(e=>typeof e=="string"&&e.trim().length===0?void 0:e,ge.string().optional())}),_I=ge.object({}),yI=ge.object({}),EI=ge.object({}),AI=ge.object({region:ge.string().min(1)}),bI=ge.object({project:ge.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/,ay.invalidGcpResourceId),region:ge.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/,ay.invalidGcpResourceId),models:ge.array(cy)}),xI=ge.object({}),lo=ge.object({}),wH=ge.union([rI,sI,aI,cI,uI,oI,iI,nI,lI,tI,fI]),PH=ge.union([hI,gI,mI,bI,AI,dI,_I,yI,EI,pI,xI,lo]),TH=ge.discriminatedUnion("provider",[ge.object({provider:ge.literal("openai"),config:yI.partial(),auth:cI.partial()}),ge.object({provider:ge.literal("openrouter"),config:EI.partial(),auth:uI.partial()}),ge.object({provider:ge.literal("anthropic"),config:dI.partial(),auth:rI.partial()}),ge.object({provider:ge.literal("azure"),config:mI.partial(),auth:sI.partial()}),ge.object({provider:ge.literal("google"),config:_I.partial(),auth:aI.partial()}),ge.object({provider:ge.literal("cloudflare-gateway"),config:gI.partial(),auth:oI.partial()}),ge.object({provider:ge.literal("custom"),config:hI.partial(),auth:iI.partial()}),ge.object({provider:ge.literal("activepieces"),config:pI.partial(),auth:nI.partial()}),ge.object({provider:ge.literal("bedrock"),config:AI.partial(),auth:lI.partial()}),ge.object({provider:ge.literal("vertex"),config:bI.partial(),auth:tI.partial()}),ge.object({provider:ge.literal("mistral"),config:xI.partial(),auth:fI.partial()}),ge.object({provider:ge.literal("xai"),config:lo.partial(),auth:Lr.partial()}),ge.object({provider:ge.literal("deepseek"),config:lo.partial(),auth:Lr.partial()}),ge.object({provider:ge.literal("zai"),config:lo.partial(),auth:Lr.partial()}),ge.object({provider:ge.literal("qwen"),config:lo.partial(),auth:Lr.partial()}),ge.object({provider:ge.literal("minimax"),config:lo.partial(),auth:Lr.partial()}),ge.object({provider:ge.literal("moonshot"),config:lo.partial(),auth:Lr.partial()})]);var UH=I().check(Ir(/^#[0-9A-Fa-f]{6}$/));var FH=N({filename:I(),data:Ye(),type:De("file"),mimetype:Z(I())});var fO=Dr(vI());var QH=N({...fn,name:I(),permissions:Me(I()),platformId:Qt(I()),type:I(),userCount:Z(Ar())});var ij=ge.enum(["active","out_of_credits","rejected","unreachable"]);var SI=(i=>(i.AGENT_DECIDE="agent-decide",i.CHOOSE_YOURSELF="choose-yourself",i.LEAVE_EMPTY="leave-empty",i))(SI||{}),uy=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(uy||{}),ly=(i=>(i.SSE="sse",i.STREAMABLE_HTTP="streamable-http",i.SIMPLE_HTTP="http",i))(ly||{});var fy=(i=>(i.TEXT="text",i.NUMBER="number",i.BOOLEAN="boolean",i))(fy||{});var dy=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(dy||{});var dO=N({mode:ze(SI),value:Ye()}),pO=N({auth:Z(I()),fields:Xe(I(),dO)}),hO=N({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:Z(pO)}),gO=N({type:De("PIECE"),toolName:I().check(cr(1)),pieceMetadata:hO}),mO=N({type:De("none")}),_O=N({type:De("access_token"),accessToken:I()}),yO=N({type:De("api_key"),apiKey:I(),apiKeyHeader:I()}),EO=N({type:De("headers"),headers:Xe(I(),I())}),AO=mi("type",[mO,_O,yO,EO]),wI=N({type:De("FLOW"),toolName:I().check(cr(1)),externalFlowId:I(),flowDisplayName:Z(I())}),PI=N({type:De("MCP"),toolName:I().check(cr(1)),serverUrl:Ax(),protocol:ze(ly),auth:AO}),TI=N({type:De("KNOWLEDGE_BASE"),toolName:I().check(cr(1)),sourceType:ze(uy),sourceId:I(),sourceName:I()}),bO=mi("type",[gO,wI,PI,TI]),xO=N({displayName:I(),description:Z(I()),type:ze(fy)}),kI=N({type:De("MARKDOWN"),markdown:I()}),ms={type:De("TOOL_CALL"),input:Qt(Xe(I(),Ye())),output:Z(Ye()),toolName:I(),status:ze(dy),toolCallId:I(),startTime:I(),endTime:Z(I())},qj=N(ms),CI=mi("toolCallType",[N({...ms,toolCallType:De("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),N({...ms,toolCallType:De("FLOW"),displayName:I(),externalFlowId:I()}),N({...ms,toolCallType:De("MCP"),displayName:I(),serverUrl:I()}),N({...ms,toolCallType:De("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),N({...ms,toolCallType:De("UNKNOWN"),displayName:I()})]),IO=st([kI,CI]);var vO=10800*1e3,SO=900*1e3;var gy=(r=>(r.IMAGE="image",r.TEXT="text",r))(gy||{}),Qn=N({apiKey:I()}),PO=Qn,TO=N({apiKey:I(),apiKeyHash:I()}),kO=Qn,CO=Qn,RO=Qn,OO=Qn,NO=Qn,$O=Qn,DO=Qn,$I=N({serviceAccountJson:I().check(cr(1))}),DI=N({accessKeyId:I().check(cr(1)),secretAccessKey:I().check(cr(1)),sessionToken:Z(I())}),BO=N({}),zO=N({}),LO=N({}),UO=N({}),MO=N({}),FO=N({}),my=N({modelId:I(),modelName:I(),modelType:ze(gy)}),BI=N({apiKeyHeader:I(),baseUrl:I(),models:Me(my),defaultHeaders:Z(Xe(I(),I())),apiStyle:Z(ze(["chat","responses"]))}),zI=N({accountId:I(),gatewayId:I(),models:Me(my),vertexProject:Z(I()),vertexRegion:Z(I())}),LI=N({resourceName:I(),apiVersion:yi(_i(e=>typeof e=="string"&&e.trim().length===0?void 0:e),Z(I()))}),UI=N({region:I().check(cr(1))}),MI=N({project:I().check(Ir(/^[a-z0-9][a-z0-9-]{0,62}$/)),region:I().check(Ir(/^[a-z0-9][a-z0-9-]{0,62}$/)),models:Me(my)}),FI=N({}),HO=st([PO,RO,OO,NO,$O,CO,kO,TO,DI,$I,DO]),HI=st([BI,zI,LI,MI,UI,BO,LO,UO,MO,zO,FO,FI]),jO=N({id:I(),name:I(),type:ze(gy)}),WO=N({id:I(),name:I(),provider:ze(xi),config:HI,enabledForChat:yt()}),qO=N({provider:ze(xi),name:I(),enabledForChat:yt(),keys:Me(N({id:I(),name:I()}))}),VO=N({provider:ze(xi),configId:I(),config:HI,auth:HO,platformId:I()});var Kj={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},RI=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],ZO=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],jI=["claude-sonnet-4.6","claude-opus-4.7","claude-opus-4.8","claude-haiku-4.5"],py=["gemini-3.7-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],hy=["gemini-2.5-pro","gemini-2.5-flash"],QO=["grok-4.20"],Gj={google:hy,vertex:hy},Yj=jI.map(e=>`anthropic/${e}`),KO={openai:RI,anthropic:ZO,google:py,vertex:py,activepieces:[...jI.map(e=>`anthropic/${e}`),...RI.map(e=>`openai/${e}`),...[...py,...hy].map(e=>`google/${e}`),...QO.map(e=>`x-ai/${e}`)]};var OI=128e3,GO={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,vertex:1048576,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function YO({provider:e}){return e?GO[e]??OI:OI}a(YO,"getMaxContextTokens");var NI={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},XO={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},JO=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),eN={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function vr(e){return{chatModels:KO[e],maxContextTokens:YO({provider:e}),defaultEmbeddingModel:NI[e],supportsEmbedding:NI[e]!==void 0,supportsImageGeneration:!JO.has(e),defaultImageModel:tN[e],webSearch:XO[e]}}a(vr,"buildProviderCapabilities");var WI=[{id:"fast",label:"Fast",modelId:"google/gemini-3.1-flash-lite-image"},{id:"smart",label:"Expert",modelId:"google/gemini-3.1-flash-image"},{id:"premium",label:"Heavy",modelId:"google/gemini-3-pro-image"}],tN={activepieces:WI[0].modelId,openrouter:"google/gemini-3.1-flash-lite-image",openai:"gpt-image-1.5",google:"gemini-3.1-flash-image"},rN={openai:vr("openai"),anthropic:vr("anthropic"),openrouter:vr("openrouter"),azure:vr("azure"),google:vr("google"),"cloudflare-gateway":vr("cloudflare-gateway"),custom:vr("custom"),bedrock:vr("bedrock"),vertex:vr("vertex"),mistral:vr("mistral"),activepieces:vr("activepieces"),xai:vr("xai"),deepseek:vr("deepseek"),zai:vr("zai"),qwen:vr("qwen"),minimax:vr("minimax"),moonshot:vr("moonshot")};var nN=N({base64Url:I(),fileName:I(),extension:Z(I())}),iN=N({mimeType:I(),url:I(),fileName:Z(I())}),_y=st([nN,iN]);var oN=st([N({type:De("file"),value:_y}),N({type:De("markdown"),value:I(),files:Z(Me(_y))})]),sN=N({sessionId:I(),message:I(),files:Z(Me(I()))});var VI=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(VI||{}),ZI=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ZI||{}),yy=(i=>(i.RECORD_CREATED="RECORD_CREATED",i.RECORD_UPDATED="RECORD_UPDATED",i.RECORD_DELETED="RECORD_DELETED",i))(yy||{});var aN=st([N({...fn,name:I(),externalId:I(),type:De("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:N({options:Me(N({value:I()}))})}),N({...fn,name:I(),externalId:I(),type:st([De("TEXT"),De("NUMBER"),De("DATE"),De("DATETIME")]),tableId:I(),projectId:I()})]),cN=N({...fn,name:I(),folderId:Qt(I()),projectId:I(),externalId:I(),status:Ym(ZI),trigger:Ym(VI)}),uN=N({...fn,tableId:I(),projectId:I(),cells:Xe(I(),N({updated:I(),created:I(),value:Ye(),fieldName:I()}))}),lN=N({events:Me(ze(yy)),webhookUrl:I(),flowId:I()}),fN=N({fields:Me(N({id:I(),name:I()})),rows:Me(Xe(I(),I())),name:I()}),dN=N({projectId:I(),limit:Z(Rc.number()),cursor:Z(I()),name:Z(I()),externalIds:qf(I()),folderId:Z(I()),folderIds:qf(I())}),pN=N({records:Me(Me(N({fieldId:I(),value:KI()}))),tableId:I()}),hN=N({cells:Z(Me(N({fieldId:I(),value:KI()}))),tableId:I(),agentUpdate:Z(yt())}),QI=mi("operator",[fo("eq"),fo("neq"),fo("gt"),fo("gte"),fo("lt"),fo("lte"),fo("co"),qI("exists"),qI("not_exists")]),gN=N({tableId:I(),limit:Z(Rc.number()),cursor:Z(I()),filters:qf(QI)});function KI(){return yi(_i(e=>e==null?e:String(e)),Cc(I()))}a(KI,"coerceToString");function fo(e){return N({fieldId:I(),operator:De(e),value:I()})}a(fo,"valueFilter");function qI(e){return N({fieldId:I(),operator:De(e)})}a(qI,"existenceFilter");var mN=N({status:Z(Ar()),body:Z(Ye()),headers:Z(Xe(I(),I()))}),_N=N({...fn,deleted:Qt(bi),ownerId:I(),displayName:I(),platformId:I(),externalId:Qt(I())});var GI=N({name:I(),description:Z(I()),type:I(),required:yt()}),yN=N({pieceName:I(),triggerName:I(),input:N({toolName:I(),toolDescription:I(),inputSchema:Me(GI),returnsResponse:yt()})});var YI="^[0-9]+\\.[0-9]+\\.[0-9]+$",m9=new RegExp(YI),AN="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",_9=I().check(Ir(new RegExp(YI))),y9=I().check(Ir(new RegExp(AN))),bN=N({packageType:De("ARCHIVE"),pieceType:ze(ss),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),XI=N({packageType:De("REGISTRY"),pieceType:De("OFFICIAL"),pieceName:I(),pieceVersion:I()}),JI=N({packageType:De("REGISTRY"),pieceType:De("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),E9=st([XI,JI]),A9=st([bN,XI,JI]);var xN=mi("type",[N({type:De("CRON_EXPRESSION"),cronExpression:I(),timezone:I()}),N({type:De("INTERVAL"),intervalMs:bx().check(mr(6e4))})]),b9=N({...fn,type:ze(Ei),projectId:I(),flowId:I(),triggerName:I(),schedule:Qt(xN),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:Qt(I()),simulate:yt()}),ev=(S=>(S.UNKNOWN="UNKNOWN",S.FLOW_RUN_LOG="FLOW_RUN_LOG",S.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",S.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",S.FLOW_STEP_FILE="FLOW_STEP_FILE",S.SAMPLE_DATA="SAMPLE_DATA",S.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",S.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",S.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",S.PROJECT_RELEASE="PROJECT_RELEASE",S.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",S.PLATFORM_ASSET="PLATFORM_ASSET",S.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",S.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",S.MCP_CALL_PAYLOAD="MCP_CALL_PAYLOAD",S.KNOWLEDGE_BASE="KNOWLEDGE_BASE",S.FLOW_BUNDLE="FLOW_BUNDLE",S.PREWARM_SCOPE="PREWARM_SCOPE",S))(ev||{}),tv=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(tv||{}),rv=(r=>(r.S3="S3",r.DB="DB",r))(rv||{}),x9=N({...fn,projectId:Qt(I()),platformId:Qt(I()),type:ze(ev),compression:ze(tv),data:Z(Ye()),location:ze(rv),size:Qt(Ar()),fileName:Qt(I()),s3Key:Qt(I()),metadata:Qt(Xe(I(),I()))}),nv=(i=>(i.ADMIN="ADMIN",i.MEMBER="MEMBER",i.OPERATOR="OPERATOR",i))(nv||{}),iv=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(iv||{}),I9=N({id:I(),email:I(),firstName:I(),status:ze(iv),externalId:Qt(I()),platformId:Qt(I()),platformRole:ze(nv),lastName:I(),created:bi,updated:bi,lastActiveDate:Qt(bi),imageUrl:Qt(I())});var Ay=N({...mt.shape,...et(Xe(I(),Ye()),"OBJECT").shape});var by=N({...mt.shape,formatProperty:Z(I()),...et(I(),"RICH_TEXT").shape});var av=N({...mt.shape,...et(I(),"COLOR").shape});var xy=st([tn,Wn,by,jf,Vn,rn,qn,qm,Oc,Zm,Zn,Dc,Ay,Bc,$c,Vm,Nc,av]),bt={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Cn=N({displayName:I(),description:Z(I()),hasConnectionIdentifier:Z(yt())});var cv=N({username:I(),password:I()}),Iy=N({...Cn.shape,username:N({displayName:I(),description:Z(I())}),password:N({displayName:I(),description:Z(I())}),...et(cv,"BASIC_AUTH").shape});var wN=Xe(I(),st([tn,Wn,Zn,Vn,rn])),vy=N({...Cn.shape,props:wN,...et(Ye(),"CUSTOM_AUTH").shape});var po=N({...Cn.shape,...et(N({auth:I()}),"SECRET_TEXT").shape});var PN=Xe(I(),st([tn,Wn,po,Zn,Vn,rn,qn,jf])),uv=N({...Cn.shape,props:PN,...et(Ye(),"OIDC").shape});var Sy=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Sy||{}),lv=st([tn,po,rn]),fv=Xe(I(),lv),TN=N({props:Z(Xe(I(),lv)),authUrl:I(),tokenUrl:I(),scope:Me(I()),prompt:Z(st([De("none"),De("consent"),De("login"),De("omit")])),pkce:Z(yt()),pkceMethod:Z(st([De("plain"),De("S256")])),authorizationMethod:Z(ze(Sy)),grantType:Z(st([ze(Lc),De(Qm)])),extra:Z(Xe(I(),I()))}),dv=N({access_token:I(),props:Z(fv),data:Xe(I(),kc())}),wy=N({...Cn.shape,...TN.shape,...et(dv,"OAUTH2").shape});var _s=st([Iy,vy,uv,wy,po]),Jc="Connection",eu={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Jc}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Jc,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Jc}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Jc}},None(){}};var sq={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var kN=N({...mt.shape,...et(Ye(),"CUSTOM").shape,code:I()});var RN=st([xy,_s]),Py=Xe(I(),RN),wq=Xe(I(),xy);var pv=st([N({strategy:De("CRON"),cronExpression:I()}),N({strategy:De("NONE")})]),ys=class{constructor(t,r,i,n,o,s,c,u,l,f,p,g,h,_,y,b,v,S,M,R,J){this.name=t;this.displayName=r;this.description=i;this.requireAuth=n;this.props=o;this.type=s;this.handshakeConfiguration=c;this.onHandshake=u;this.renewConfiguration=l;this.onRenew=f;this.onEnable=p;this.onDisable=g;this.onStart=h;this.run=_;this.test=y;this.sampleData=b;this.testStrategy=v;this.outputSchema=S;this.aiMetadata=M;this.classification=R;this.propertyGroups=J}static{a(this,"ITrigger")}},hv=a(e=>{switch(e.type){case"WEBHOOK":return new ys(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"POLLING":return new ys(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"MANUAL":return new ys(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new ys(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,ir(e.sampleData)&&ir(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var gv="2",wd="0.82.0";var Ty=class{constructor(t,r,i,n,o,s,c,u,l=wd,f,p="",g){this.displayName=t;this.logoUrl=r;this.authors=i;this.events=n;this.categories=c;this.auth=u;this.minimumSupportedRelease=l;this.maximumSupportedRelease=f;this.description=p;this.deprecated=g;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:gv}),"getContextInfo");(!NN(l)||$N(l,wd))&&(this.minimumSupportedRelease=wd),o.forEach(h=>this._actions[h.name]=h),s.forEach(h=>this._triggers[h.name]=h)}static{a(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:ON(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},_v=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,i,n)=>i===n.findIndex(o=>o.type===r.type)))throw new Error("Auth properties must be unique by type");return new Ty(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function ON(e){if(e!==void 0)return Array.isArray(e)?e.map(mv):mv(e)}a(ON,"withConnectionIdentifierFlag");function mv(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}a(mv,"flagConnectionIdentifier");function NN(e){return/^\d+\.\d+\.\d+$/.test(e)}a(NN,"isValidSimpleSemver");function $N(e,t){let[r,i,n]=e.split(".").map(Number),[o,s,c]=t.split(".").map(Number);return r!==o?r<o:i!==s?i<s:n<c}a($N,"isSemverLessThan");var DN=Z(Xe(I(),Xe(I(),I()))),yv=N({id:Z(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:Me(I()),platformId:Z(I()),directoryPath:Z(I()),auth:Z(st([_s,Me(_s)])),version:I(),categories:Z(Me(ze(as))),minimumSupportedRelease:Z(I()),maximumSupportedRelease:Z(I()),deprecated:Z(yt()),i18n:DN}),BN=ze(["human","ai","both"]),Ev=N({description:Z(I()),idempotent:Z(yt())}),Av=ze(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var zN=ze(["tabs","section","summary","builder","footer"]),bv=N({key:I(),display:zN,label:Z(I()),description:Z(I()),icon:Z(I()),props:Me(I())}),xv=N({name:I(),displayName:I(),description:I(),props:Py,propertyGroups:Z(Me(bv)),requireAuth:yt(),errorHandlingOptions:Z(Wm),outputSchema:Z(Mf()),audience:Z(BN),aiMetadata:Z(Ev),classification:Z(Av)}),Iv=N({name:I(),displayName:I(),description:I(),props:Py,propertyGroups:Z(Me(bv)),errorHandlingOptions:Z(Wm),type:ze(Ei),sampleData:Ye(),handshakeConfiguration:Z(Mf()),renewConfiguration:Z(pv),testStrategy:ze(Mc),outputSchema:Z(Mf()),aiMetadata:Z(Ev),classification:Z(Av)}),LN=N({...yv.shape,actions:Xe(I(),xv),triggers:Xe(I(),Iv)}),UN=N({...yv.shape,actions:Ar(),triggers:Ar(),suggestedActions:Z(Me(xv)),suggestedTriggers:Z(Me(Iv))}),vv=N({projectUsage:Ar(),pieceType:ze(ss),packageType:ze(zc),platformId:Z(I()),archiveId:Z(I())}),kV=N({...LN.shape,...vv.shape}),CV=N({...UN.shape,...vv.shape}),RV=N({name:I(),version:I()});var MN=Dr(require("path")),FN=Dr(require("fs/promises"));var vk=Dr(Nn());var pk=Dr(dk()),hk=Dr(Nn());async function qt(e){return ir(e)?"sftp":e}a(qt,"getProtocolBackwardCompatibility");async function Xt(e){let{protocol:t,host:r,port:i,allow_unauthorized_certificates:n,allow_anonymous_login:o,username:s,password:c,privateKey:u,algorithm:l}=e,f=await qt(t);if(f==="sftp"){let p=new pk.default;if(u){let g=u.replace(/\\r\\n/g,`
24
63
  `).replace(/\\n/g,`
25
64
  `).replace(/\r\n/g,`
26
65
  `).replace(/\r/g,`
@@ -30,8 +69,8 @@ ${r}`}};var Dv=2**32,Um=(()=>{try{return new Function("return 2n ** 32n")()}catc
30
69
  `).replace(/(DEK-Info:\s*\S+)\s+/,`$1
31
70
 
32
71
  `).replace(/\s+(-----END [A-Z0-9 ]+ KEY-----)/,`
33
- $1`);let _=g.match(/(-----BEGIN [A-Z0-9 ]+ KEY-----\n(?:Proc-Type:[^\n]+\n)?(?:DEK-Info:[^\n]+\n\n)?)/),b=g.match(/(\n-----END [A-Z0-9 ]+ KEY-----)/);if(_&&b){let E=_[1],v=b[1],H=g.replace(E,"").replace(v,"").replace(/\s+/g,"").match(/.{1,64}/g)||[];g=E+H.join(`
34
- `)+v}}let h={host:r,port:n,username:s,privateKey:g,timeout:1e4};a&&(h.passphrase=a),l&&l.length>0&&(h.algorithms={serverHostKey:l}),await p.connect(h)}else a&&await p.connect({host:r,port:n,username:s,password:a,timeout:1e4});return p}else{let p=new wE.Client;return await p.access({host:r,port:n,user:s,password:a,secure:d==="ftps",secureOptions:{rejectUnauthorized:!(i??!1)}}),p}}c(Ht,"getClient");async function Zt(t,e){await Bt(e)==="sftp"?await t.end():t.close()}c(Zt,"endClient");var ir=Mo.CustomAuth({props:{protocol:gt.StaticDropdown({displayName:"Protocol",description:"The protocol to use",required:!1,options:{options:[{value:"sftp",label:"SFTP"},{value:"ftp",label:"FTP"},{value:"ftps",label:"FTPS"}]}}),allow_unauthorized_certificates:gt.Checkbox({displayName:"Allow Unauthorized Certificates",description:"Allow connections to servers with self-signed certificates",defaultValue:!1,required:!1}),allow_anonymous_login:gt.Checkbox({displayName:"Allow Anonymous Login",description:"Allow anonymous login to FTP servers (only applicable for FTP/FTPS)",defaultValue:!1,required:!1}),host:gt.ShortText({displayName:"Host",description:"The host of the server",required:!0}),port:gt.Number({displayName:"Port",description:"The port of the server",required:!0,defaultValue:22}),username:gt.ShortText({displayName:"Username",description:"The username to authenticate with",required:!0}),password:Mo.SecretText({displayName:"Password",description:"The password to authenticate with. Either this or private key is required. When using a private key, this field is used as the passphrase to decrypt the key.",required:!1}),privateKey:Mo.SecretText({displayName:"Private Key",description:"The private key to authenticate with. Either this or password is required.",required:!1}),algorithm:gt.StaticMultiSelectDropdown({displayName:"Host Key Algorithm",description:"The host key algorithm to use for SFTP connection. Only needed if you want to override the default algorithms (e.g., to support ssh-dss).",required:!1,options:{options:[{value:"ssh-rsa",label:"ssh-rsa"},{value:"ssh-dss",label:"ssh-dss"},{value:"ecdsa-sha2-nistp256",label:"ecdsa-sha2-nistp256"},{value:"ecdsa-sha2-nistp384",label:"ecdsa-sha2-nistp384"},{value:"ecdsa-sha2-nistp521",label:"ecdsa-sha2-nistp521"},{value:"ssh-ed25519",label:"ssh-ed25519"},{value:"rsa-sha2-256",label:"rsa-sha2-256"},{value:"rsa-sha2-512",label:"rsa-sha2-512"}]}})},validate:c(async({auth:t})=>{let e=null,r=await Bt(t.protocol);try{if(!t.privateKey&&!t.password&&!t.allow_anonymous_login)return{valid:!1,error:"Either password or private key must be provided for non-anonymous authentication."};switch(r){case"sftp":{if(t.allow_anonymous_login)return{valid:!1,error:"Anonymous login is not supported for SFTP protocol."};e=await Ht(t);break}default:{e=await Ht(t);break}}return{valid:!0}}catch(n){return{valid:!1,error:n?.message}}finally{e&&await Zt(e,t.protocol)}},"validate"),required:!0});var TE=require("stream");var B1={0:{error:"OK",description:"Indicates successful completion of the operation."},1:{error:"EOF",description:"An attempt to read past the end-of-file was made; or, there are no more directory entries to return."},2:{error:"No such file",description:"A reference was made to a file which does not exist."},3:{error:"Permission denied",description:"The user does not have sufficient permissions to perform the operation."},4:{error:"Failure",description:"An error occurred, but no specific error code exists to describe the failure. This error message should always have meaningful text in the error message field."},5:{error:"Bad message",description:"A badly formatted packet or other SFTP protocol incompatibility was detected."},6:{error:"No connection",description:"There is no connection to the server. This error may be used locally, but must not be returned by a server."},7:{error:"Connection lost",description:"The connection to the server was lost. This error may be used locally, but must not be returned by a server."},8:{error:"Operation unsupported",description:"An attempted operation could not be completed by the server because the server does not support the operation."},9:{error:"Invalid handle",description:"The handle value was invalid."},10:{error:"No such path",description:"The file path does not exist or is invalid."},11:{error:"File already exists",description:"The file already exists."},12:{error:"Write protect",description:"The file is on read-only media, or the media is write protected."},13:{error:"No media",description:"The requested operation cannot be completed because there is no media available in the drive."},14:{error:"No space on file-system",description:"The requested operation cannot be completed because there is insufficient free space on the filesystem."},15:{error:"Quota exceeded",description:"The operation cannot be completed because it would exceed the user\u2019s storage quota."},16:{error:"Unknown principal",description:"A principal referenced by the request (either the owner, group, or who field of an ACL), was unknown."},17:{error:"Lock conflict",description:"The file could not be opened because it is locked by another process."},18:{error:"Directory not empty",description:"The directory is not empty."},19:{error:"Not a directory",description:"The specified file is not a directory."},20:{error:"Invalid filename",description:"The filename is not valid."},21:{error:"Link loop",description:"Too many symbolic links encountered or an SSH_FXF_NOFOLLOW encountered a symbolic link as the final component."},22:{error:"Cannot delete",description:"The file cannot be deleted. One possible reason is that the advisory read-only attribute-bit is set."},23:{error:"Invalid parameter",description:"One of the parameters was out of range or the parameters specified cannot be used together."},24:{error:"File is a directory",description:"The specified file was a directory in a context where a directory cannot be used."},25:{error:"Range lock conflict",description:"A read or write operation failed because another process\u2019s mandatory byte-range lock overlaps with the request."},26:{error:"Range lock refused",description:"A request for a byte range lock was refused."},27:{error:"Delete pending",description:"An operation was attempted on a file for which a delete operation is pending."},28:{error:"File corrupt",description:"The file is corrupt; a filesystem integrity check should be run."},29:{error:"Owner invalid",description:"The principal specified cannot be assigned as an owner of a file."},30:{error:"Group invalid",description:"The principal specified cannot be assigned as the primary group of a file."},31:{error:"No matching byte range lock",description:"The requested operation could not be completed because the specified byte range lock has not been granted."}};function Ut(t){return B1[t]??{error:"Unknown error code"}}c(Ut,"getSftpError");async function U1(t,e,r){if(!await t.exists(e)){let i=e.substring(0,e.lastIndexOf("/"));await t.mkdir(i,!0)}await t.put(Buffer.from(r),e)}c(U1,"createFileWithSFTP");async function L1(t,e,r){let n=e.substring(0,e.lastIndexOf("/"));await t.ensureDir(n);let i=Buffer.from(r);await t.uploadFrom(TE.Readable.from(i),e)}c(L1,"createFileWithFTP");var CE=mr({audience:"both",auth:ir,name:"create_file",classification:"WRITE",displayName:"Create File from Text",description:"Create a new file in the given path",aiMetadata:{description:"Writes a text string to a file at a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Choose this when the content is plain text you already hold as a string; prefer Upload File when the content is a binary or file object produced by an earlier step. Requires the full remote path (e.g. ./myfolder/notes.txt); idempotent, since the same path and content always converge on the same stored file, but note it clobbers whatever was there before.",idempotent:!0},props:{fileName:gt.ShortText({displayName:"File Path",required:!0}),fileContent:gt.LongText({displayName:"File content",required:!0})},async run(t){let e=t.propsValue.fileName,r=t.propsValue.fileContent,n=await Bt(t.auth.props.protocol),i=await Ht(t.auth.props);try{switch(n){case"ftps":case"ftp":await L1(i,e,r);break;default:case"sftp":await U1(i,e,r);break}return{status:"success"}}catch(o){return o instanceof PE.FTPError?(console.error(Ut(o.code)),{status:"error",error:Ut(o.code)}):{status:"error",error:o}}finally{await Zt(i,t.auth.props.protocol)}}});var Ds={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:o,server:s}){switch(t.strategy){case 0:{let a=await e.get("lastPoll");if(rr(a))throw new Error("lastPoll doesn't exist in the store.");let u=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:a,server:s}),l=u.reduce((d,p)=>Math.max(d,p.epochMilliSeconds),a);return await e.put("lastPoll",l),u.filter(d=>d.epochMilliSeconds>a).map(d=>d.data)}case 1:{let a=await e.get("lastItem"),u=await t.items({store:e,auth:r,propsValue:n,lastItemId:a,files:o,server:s}),l=u.findIndex(g=>g.id===a),d=[];rr(a)||l==-1?d=u??[]:d=u?.slice(0,l)??[],rr(i)||(d=d.slice(-i));let p=d?.[0]?.id;return rr(p)||await e.put("lastItem",p),d.map(g=>g.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i,isRepublish:o}){switch(t.strategy){case 0:{if(o&&!rr(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(o&&!rr(await e.get("lastItem")))break;let a=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;rr(a)?await e.delete("lastItem"):await e.put("lastItem",a);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:o}){let s=[];switch(t.strategy){case 0:{s=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:o});break}case 1:{s=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:o});break}}return z1(s.map(a=>a.data))}};function z1(t){return t.length<=5?t:t.slice(0,5)}c(z1,"getFirstFiveOrAll");var kE=require("node:stream");function M1(t){return"body"in t?{body:t.body,size:t.size}:{body:kE.Readable.from(t.data),size:t.data.length}}c(M1,"toStreamingBody");async function*F1({readable:t,chunkSize:e}){let r=[],n=0;for await(let i of t)for(r.push(Buffer.isBuffer(i)?i:Buffer.from(i)),n+=r[r.length-1].length;n>=e;){let o=r.length===1?r[0]:Buffer.concat(r);yield o.subarray(0,e);let s=o.subarray(e);r=s.length>0?[s]:[],n=s.length}n>0&&(yield r.length===1?r[0]:Buffer.concat(r))}c(F1,"readChunks");var RE={readChunks:F1,toStreamingBody:M1};var NE=br(nn());async function H1(t,e,r){let n=e.substring(0,e.lastIndexOf("/"));await t.ensureDir(n),await t.uploadFrom(r,e)}c(H1,"uploadFileToFTP");async function j1(t,e,r){if(!await t.exists(e)){let i=e.substring(0,e.lastIndexOf("/"));await t.mkdir(i,!0)}await t.put(r,e),await t.end()}c(j1,"uploadFileToSFTP");var OE=mr({audience:"both",auth:ir,name:"upload_file",classification:"WRITE",displayName:"Upload File",description:"Upload a file to the given path.",aiMetadata:{description:"Uploads a file object, typically one produced by an earlier step, to a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Use this instead of Create File from Text whenever you have an actual file rather than a string of text. Requires both the file and the destination remote path (e.g. ./myfolder/test.mp3); idempotent, as repeating the upload converges on the same stored file.",idempotent:!0},props:{fileName:gt.ShortText({displayName:"File Path",required:!0,description:"The path on the sftp server to store the file. e.g. `./myfolder/test.mp3`"}),fileContent:gt.File({displayName:"File content",required:!0,streaming:!0})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.fileName,{body:n}=RE.toStreamingBody(t.propsValue.fileContent),i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await H1(e,r,n);break;default:case"sftp":await j1(e,r,n);break}return{status:"success"}}catch(o){return o instanceof NE.FTPError?(console.error(Ut(o.code)),{status:"error",content:null,error:Ut(o.code)}):{status:"error",content:null,error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var $E=br(nn()),cd=require("stream");function W1(t,e){let r=new cd.PassThrough;return t.downloadTo(r,e).catch(n=>r.destroy(n)),r}c(W1,"readFTP");function q1(t,e){let r=new cd.PassThrough;return t.get(e,r).catch(n=>r.destroy(n)),r}c(q1,"readSFTP");var DE=mr({audience:"both",auth:ir,name:"read_file_content",classification:"READ",displayName:"Read File Content",description:"Read the content of a file.",aiMetadata:{description:"Downloads one file from the connected FTP, FTPS or SFTP server by remote path and returns it as a file reference that later steps can consume. Use it to fetch the content of a file whose path you know; run List Folder Contents first when you still need to discover which paths exist. Requires an exact remote file path - it does not glob, search or recurse; read-only and idempotent.",idempotent:!0},props:{filePath:gt.ShortText({displayName:"File Path",required:!0})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.filePath,n=r.split("/").pop()??r,i=await Bt(t.auth.props.protocol);try{let o;switch(i){case"ftps":case"ftp":o=W1(e,r);break;default:case"sftp":o=q1(e,r);break}return{file:await t.files.write({fileName:n,data:o})}}catch(o){return o instanceof $E.FTPError?(console.error(Ut(o.code)),{status:"error",content:null,error:Ut(o.code)}):{status:"error",content:null,error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var Tc=br(BE());function UE(t,e){return e==="sftp"?t.modifyTime:(0,Tc.default)(t.modifiedAt).valueOf()}c(UE,"getModifyTime");var Pc={strategy:0,items:c(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let n=null;try{let i=await Bt(t.props.protocol);n=await Ht(t.props);let s=(await n.list(e.path)).filter(u=>{let l=UE(u,i);return(0,Tc.default)(l).valueOf()>r});return(e.ignoreHiddenFiles?s.filter(u=>!u.name.startsWith(".")):s).map(u=>{let l=UE(u,i);return{data:{...u,path:`${e.path}/${u.name}`},epochMilliSeconds:(0,Tc.default)(l).valueOf()}})}catch{return[]}finally{n&&await Zt(n,t.props.protocol)}},"items")},LE=Th({auth:ir,name:"new_file",classification:"READ",displayName:"New File",description:"Trigger when a new file is created or modified.",aiMetadata:{description:"Fires for each file in a watched directory on an FTP, FTPS or SFTP server whose modification time is newer than the previous poll, so it covers both newly added files and edits to existing ones. Each event represents one such file. Polls a single directory only, without recursing into subfolders, and can optionally skip hidden dotfiles."},props:{path:gt.ShortText({displayName:"Path",description:"The path to watch for new files",required:!0,defaultValue:"./"}),ignoreHiddenFiles:gt.Checkbox({displayName:"Ignore hidden files",description:"Ignore hidden files",required:!1,defaultValue:!1})},type:"POLLING",onEnable:c(async t=>{await Ds.onEnable(Pc,t)},"onEnable"),onDisable:c(async t=>{await Ds.onDisable(Pc,t)},"onDisable"),run:c(async t=>await Ds.poll(Pc,t),"run"),test:c(async t=>await Ds.test(Pc,t),"test"),sampleData:null});var zE=br(nn());async function Q1(t,e,r){r?await t.removeDir(e):await t.removeEmptyDir(e)}c(Q1,"deleteFolderFTP");async function V1(t,e,r){await t.rmdir(e,r)}c(V1,"deleteFolderSFTP");var ME=mr({audience:"both",auth:ir,name:"deleteFolder",classification:"DESTRUCTIVE",displayName:"Delete Folder",description:"Deletes an existing folder at given path.",aiMetadata:{description:"Deletes a directory at a given remote path on the connected FTP, FTPS or SFTP server, either only when it is empty or, with the recursive option enabled, together with every nested subfolder and file. Use this for directories; use Delete File to remove a single file. Recursive deletion is permanent and unrecoverable, so verify the path first; idempotent in that it converges on the folder being absent, and a repeat call on an already-missing path just reports an error.",idempotent:!0},props:{folderPath:gt.ShortText({displayName:"Folder Path",required:!0,description:"The path of the folder to delete e.g. `./myfolder`"}),recursive:gt.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"Enable this option to delete the folder and all its contents, including subfolders and files."})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.folderPath,n=t.propsValue.recursive??!1,i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await Q1(e,r,n);break;default:case"sftp":await V1(e,r,n);break}return{status:"success"}}catch(o){return o instanceof zE.FTPError?(console.error(Ut(o.code)),{status:"error",error:Ut(o.code)}):{status:"error",error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var FE=br(nn());async function K1(t,e){await t.remove(e)}c(K1,"deleteFileFromFTP");async function G1(t,e){await t.delete(e)}c(G1,"deleteFileFromSFTP");var HE=mr({audience:"both",auth:ir,name:"deleteFile",classification:"DESTRUCTIVE",displayName:"Delete file",description:"Deletes a file at given path.",aiMetadata:{description:"Permanently deletes a single file at a given remote path on the connected FTP, FTPS or SFTP server. Use this for one file; use Delete Folder to remove a directory, optionally with all of its contents. Requires the exact remote path (e.g. ./myfolder/test.mp3) and there is no recycle bin or undo; idempotent in that it converges on the file being absent, though a repeat call on an already-missing path reports an error.",idempotent:!0},props:{filePath:gt.ShortText({displayName:"File Path",required:!0,description:"The path of the file to delete e.g. `./myfolder/test.mp3`"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.filePath,n=await Bt(t.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await K1(e,r);break;default:case"sftp":await G1(e,r);break}return{status:"success"}}catch(i){return i instanceof FE.FTPError?(console.error(Ut(i.code)),{status:"error",error:Ut(i.code)}):{status:"error",error:i}}finally{await Zt(e,t.auth.props.protocol)}}});var jE=br(nn());async function Z1(t,e){let r=await t.list(e);return await t.end(),r}c(Z1,"listSFTP");async function Y1(t,e){return(await t.list(e)).map(n=>({type:n.type===1?"d":"-",name:n.name,size:n.size,modifyTime:n.modifiedAt,accessTime:n.modifiedAt,rights:{user:n.permissions||"",group:"",other:""},owner:"",group:""}))}c(Y1,"listFTP");var WE=mr({audience:"both",auth:ir,name:"listFolderContents",classification:"SEARCH",displayName:"List Folder Contents",description:"Lists the contents of a given folder.",aiMetadata:{description:"Lists the immediate entries of one directory on the connected FTP, FTPS or SFTP server. Use it to discover paths before reading, renaming or deleting, and to walk a tree one level at a time; it is not recursive and offers no filtering or search. Requires the directory path (e.g. ./myfolder); read-only and idempotent.",idempotent:!0},props:{directoryPath:gt.ShortText({displayName:"Directory Path",required:!0,description:"The path of the folder to list e.g. `./myfolder`"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.directoryPath,n=await Bt(t.auth.props.protocol);try{let i;switch(n){case"ftps":case"ftp":i=await Y1(e,r);break;default:case"sftp":i=await Z1(e,r);break}return{status:"success",contents:i}}catch(i){return i instanceof jE.FTPError?(console.error(Ut(i.code)),{status:"error",content:null,error:Ut(i.code)}):{status:"error",content:null,error:i}}finally{await Zt(e,t.auth.props.protocol)}}});var qE=br(nn());var QE=mr({audience:"both",auth:ir,name:"createFolder",classification:"WRITE",displayName:"Create Folder",description:"Creates a folder at given path.",aiMetadata:{description:"Creates a directory at a given remote path on the connected FTP, FTPS or SFTP server; on SFTP an optional recursive mode also creates any missing parent directories, while FTP/FTPS always ensures the whole path. Use it to prepare a destination directory, for example before a rename or move, noting that Create File from Text and Upload File already create parent directories themselves. Requires the folder path (e.g. ./myfolder); idempotent because it converges on that directory existing.",idempotent:!0},props:{folderPath:gt.ShortText({displayName:"Folder Path",required:!0,description:"The new folder path e.g. `./myfolder`. For FTP/FTPS, it will create nested folders if necessary."}),recursive:gt.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"For SFTP only: Create parent directories if they do not exist"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.folderPath,n=t.propsValue.recursive??!1,i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await e.ensureDir(r);break;default:case"sftp":await e.mkdir(r,n);break}return{status:"success"}}catch(o){return o instanceof qE.FTPError?(console.error(Ut(o.code)),{status:"error",error:Ut(o.code)}):{status:"error",error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var VE=br(nn());async function X1(t,e,r){await t.rename(e,r)}c(X1,"renameFTP");async function J1(t,e,r){await t.rename(e,r),await t.end()}c(J1,"renameSFTP");var KE=mr({audience:"both",auth:ir,name:"renameFileOrFolder",classification:"WRITE",displayName:"Rename File or Folder",description:"Renames a file or folder at given path.",aiMetadata:{description:"Moves a file or folder on the connected FTP, FTPS or SFTP server from an old remote path to a new one, which covers both renaming in place and, on most servers, relocating the entry into a different directory. Prefer it over reading and re-uploading content, and over a delete-then-create pair, when the bytes do not change. The parent directory of the new path must already exist, so create it with Create Folder first; idempotent in that the entry ends up at the new path, though a repeat call errors because the old path is gone.",idempotent:!0},props:{information:gt.MarkDown({value:"Depending on the server you can also use this to move a file to another directory, as long as the directory exists.",variant:"INFO"}),oldPath:gt.ShortText({displayName:"Old Path",required:!0,description:"The path of the file or folder to rename e.g. `./myfolder/test.mp3`"}),newPath:gt.ShortText({displayName:"New Path",required:!0,description:"The new path of the file or folder e.g. `./myfolder/new-name.mp3`"})},async run(t){let e=await Ht(t.auth.props),r=t.propsValue.oldPath,n=t.propsValue.newPath,i=await Bt(t.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await X1(e,r,n);break;default:case"sftp":await J1(e,r,n);break}return{status:"success"}}catch(o){return o instanceof VE.FTPError?(console.error(Ut(o.code)),{status:"error",content:null,error:Ut(o.code)}):{status:"error",content:null,error:o}}finally{await Zt(e,t.auth.props.protocol)}}});var eC=Rh({displayName:"FTP/SFTP",description:"Connect to FTP, FTPS or SFTP servers",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/new-core/sftp.svg",categories:["CORE","DEVELOPER_TOOLS"],authors:["Abdallah-Alwarawreh","kishanprmr","AbdulTheActivePiecer","khaledmashaly","abuaboud","prasanna2000-max"],auth:ir,actions:[CE,OE,DE,HE,QE,ME,WE,KE],triggers:[LE]});0&&(module.exports={endClient,ftpSftp,getClient,getProtocolBackwardCompatibility});
72
+ $1`);let _=g.match(/(-----BEGIN [A-Z0-9 ]+ KEY-----\n(?:Proc-Type:[^\n]+\n)?(?:DEK-Info:[^\n]+\n\n)?)/),y=g.match(/(\n-----END [A-Z0-9 ]+ KEY-----)/);if(_&&y){let b=_[1],v=y[1],M=g.replace(b,"").replace(v,"").replace(/\s+/g,"").match(/.{1,64}/g)||[];g=b+M.join(`
73
+ `)+v}}let h={host:r,port:i,username:s,privateKey:g,timeout:1e4};c&&(h.passphrase=c),l&&l.length>0&&(h.algorithms={serverHostKey:l}),await p.connect(h)}else c&&await p.connect({host:r,port:i,username:s,password:c,timeout:1e4});return p}else{let p=new hk.Client(void 0,{allowSeparateTransferHost:!0});return await p.access({host:r,port:i,user:s,password:c,secure:f==="ftps",secureOptions:{rejectUnauthorized:!(n??!1)}}),p}}a(Xt,"getClient");async function sr(e,t){await qt(t)==="sftp"?await e.end():e.close()}a(sr,"endClient");var pr=eu.CustomAuth({props:{protocol:bt.StaticDropdown({displayName:"Protocol",description:"The protocol to use",required:!1,options:{options:[{value:"sftp",label:"SFTP"},{value:"ftp",label:"FTP"},{value:"ftps",label:"FTPS"}]}}),allow_unauthorized_certificates:bt.Checkbox({displayName:"Allow Unauthorized Certificates",description:"Allow connections to servers with self-signed certificates",defaultValue:!1,required:!1}),allow_anonymous_login:bt.Checkbox({displayName:"Allow Anonymous Login",description:"Allow anonymous login to FTP servers (only applicable for FTP/FTPS)",defaultValue:!1,required:!1}),host:bt.ShortText({displayName:"Host",description:"The host of the server",required:!0}),port:bt.Number({displayName:"Port",description:"The port of the server",required:!0,defaultValue:22}),username:bt.ShortText({displayName:"Username",description:"The username to authenticate with",required:!0}),password:eu.SecretText({displayName:"Password",description:"The password to authenticate with. Either this or private key is required. When using a private key, this field is used as the passphrase to decrypt the key.",required:!1}),privateKey:eu.SecretText({displayName:"Private Key",description:"The private key to authenticate with. Either this or password is required.",required:!1}),algorithm:bt.StaticMultiSelectDropdown({displayName:"Host Key Algorithm",description:"The host key algorithm to use for SFTP connection. Only needed if you want to override the default algorithms (e.g., to support ssh-dss).",required:!1,options:{options:[{value:"ssh-rsa",label:"ssh-rsa"},{value:"ssh-dss",label:"ssh-dss"},{value:"ecdsa-sha2-nistp256",label:"ecdsa-sha2-nistp256"},{value:"ecdsa-sha2-nistp384",label:"ecdsa-sha2-nistp384"},{value:"ecdsa-sha2-nistp521",label:"ecdsa-sha2-nistp521"},{value:"ssh-ed25519",label:"ssh-ed25519"},{value:"rsa-sha2-256",label:"rsa-sha2-256"},{value:"rsa-sha2-512",label:"rsa-sha2-512"}]}})},validate:a(async({auth:e})=>{let t=null,r=await qt(e.protocol);try{if(!e.privateKey&&!e.password&&!e.allow_anonymous_login)return{valid:!1,error:"Either password or private key must be provided for non-anonymous authentication."};switch(r){case"sftp":{if(e.allow_anonymous_login)return{valid:!1,error:"Anonymous login is not supported for SFTP protocol."};t=await Xt(e);break}default:{t=await Xt(e);break}}return{valid:!0}}catch(i){return{valid:!1,error:i?.message}}finally{t&&await sr(t,e.protocol)}},"validate"),required:!0});var Sk=require("stream");var QL={0:{error:"OK",description:"Indicates successful completion of the operation."},1:{error:"EOF",description:"An attempt to read past the end-of-file was made; or, there are no more directory entries to return."},2:{error:"No such file",description:"A reference was made to a file which does not exist."},3:{error:"Permission denied",description:"The user does not have sufficient permissions to perform the operation."},4:{error:"Failure",description:"An error occurred, but no specific error code exists to describe the failure. This error message should always have meaningful text in the error message field."},5:{error:"Bad message",description:"A badly formatted packet or other SFTP protocol incompatibility was detected."},6:{error:"No connection",description:"There is no connection to the server. This error may be used locally, but must not be returned by a server."},7:{error:"Connection lost",description:"The connection to the server was lost. This error may be used locally, but must not be returned by a server."},8:{error:"Operation unsupported",description:"An attempted operation could not be completed by the server because the server does not support the operation."},9:{error:"Invalid handle",description:"The handle value was invalid."},10:{error:"No such path",description:"The file path does not exist or is invalid."},11:{error:"File already exists",description:"The file already exists."},12:{error:"Write protect",description:"The file is on read-only media, or the media is write protected."},13:{error:"No media",description:"The requested operation cannot be completed because there is no media available in the drive."},14:{error:"No space on file-system",description:"The requested operation cannot be completed because there is insufficient free space on the filesystem."},15:{error:"Quota exceeded",description:"The operation cannot be completed because it would exceed the user\u2019s storage quota."},16:{error:"Unknown principal",description:"A principal referenced by the request (either the owner, group, or who field of an ACL), was unknown."},17:{error:"Lock conflict",description:"The file could not be opened because it is locked by another process."},18:{error:"Directory not empty",description:"The directory is not empty."},19:{error:"Not a directory",description:"The specified file is not a directory."},20:{error:"Invalid filename",description:"The filename is not valid."},21:{error:"Link loop",description:"Too many symbolic links encountered or an SSH_FXF_NOFOLLOW encountered a symbolic link as the final component."},22:{error:"Cannot delete",description:"The file cannot be deleted. One possible reason is that the advisory read-only attribute-bit is set."},23:{error:"Invalid parameter",description:"One of the parameters was out of range or the parameters specified cannot be used together."},24:{error:"File is a directory",description:"The specified file was a directory in a context where a directory cannot be used."},25:{error:"Range lock conflict",description:"A read or write operation failed because another process\u2019s mandatory byte-range lock overlaps with the request."},26:{error:"Range lock refused",description:"A request for a byte range lock was refused."},27:{error:"Delete pending",description:"An operation was attempted on a file for which a delete operation is pending."},28:{error:"File corrupt",description:"The file is corrupt; a filesystem integrity check should be run."},29:{error:"Owner invalid",description:"The principal specified cannot be assigned as an owner of a file."},30:{error:"Group invalid",description:"The principal specified cannot be assigned as the primary group of a file."},31:{error:"No matching byte range lock",description:"The requested operation could not be completed because the specified byte range lock has not been granted."}};function Vt(e){return QL[e]??{error:"Unknown error code"}}a(Vt,"getSftpError");var Fi=[{key:"status",label:"Status",description:'Either "success" or "error". These actions report a failure here instead of failing the step, so check it before relying on the result.'},{key:"error",label:"Error",description:'Only present when Status is "error".',children:[{key:"code",label:"Error Code",description:"On SFTP, the numeric SFTP status code (2 = no such file, 3 = permission denied) or a Node error code such as ERR_BAD_PATH."},{key:"error",label:"Error Detail",description:"Only populated on FTP and FTPS."}]}],KL=[{key:"name",label:"Name",description:"File or folder name, without the directory path."},{key:"type",label:"Type",description:'"-" for a file and "d" for a folder.'},{key:"size",label:"Size",format:"filesize"},{key:"modifyTime",label:"Modified Time",description:"Unix timestamp in milliseconds. Populated on SFTP only; FTP and FTPS servers leave this empty."},{key:"accessTime",label:"Accessed Time",description:"Unix timestamp in milliseconds. Populated on SFTP only; FTP and FTPS servers leave this empty."},{key:"rights",label:"Permissions",children:[{key:"user",label:"Owner"},{key:"group",label:"Group"},{key:"other",label:"Other"}]},{key:"owner",label:"Owner ID"},{key:"group",label:"Group ID"}],GL=[{key:"path",label:"Path",description:"Full path of the file, built from the watched directory and the file name."},{key:"name",label:"Name",description:"File or folder name, without the directory path."},{key:"size",label:"Size",format:"filesize"},{key:"type",label:"Type",description:'On SFTP, "-" for a file and "d" for a folder. On FTP and FTPS, a number: 1 = file, 2 = folder, 3 = symbolic link.'},{key:"modifyTime",label:"Modified Time",description:"Unix timestamp in milliseconds, SFTP only. On FTP and FTPS use Raw Modified Time instead."},{key:"accessTime",label:"Accessed Time",description:"Unix timestamp in milliseconds, SFTP only."},{key:"rawModifiedAt",label:"Raw Modified Time",description:'FTP and FTPS only, as reported by the server without parsing, for example "Sep 07 09:25".'},{key:"rights",label:"Permissions",description:"SFTP only.",children:[{key:"user",label:"Owner"},{key:"group",label:"Group"},{key:"other",label:"Other"}]},{key:"permissions",label:"Unix Permissions",description:"FTP and FTPS only, as octal digits.",children:[{key:"user",label:"Owner",format:"number"},{key:"group",label:"Group",format:"number"},{key:"world",label:"Other",format:"number"}]},{key:"owner",label:"Owner ID",description:"SFTP only. On FTP and FTPS use Owner Name instead."},{key:"user",label:"Owner Name",description:"FTP and FTPS only."},{key:"group",label:"Group",description:"Numeric group ID on SFTP, group name on FTP and FTPS."}],gk={fields:Fi},mk={fields:Fi},_k={fields:Fi},yk={fields:Fi},Ek={fields:Fi},Ak={fields:Fi},bk={fields:[{key:"file",label:"File",format:"url",description:'The downloaded file, ready to pass to a later step. Absent when Status is "error".'},...Fi]},xk={fields:[{key:"contents",label:"Contents",labelKey:"name",description:"Immediate entries of the directory, including hidden dotfiles. Not recursive.",listItems:KL},...Fi]},Ik={fields:GL};async function YL(e,t,r){if(!await e.exists(t)){let n=t.substring(0,t.lastIndexOf("/"));await e.mkdir(n,!0)}await e.put(Buffer.from(r),t)}a(YL,"createFileWithSFTP");async function XL(e,t,r){let i=t.substring(0,t.lastIndexOf("/"));await e.ensureDir(i);let n=Buffer.from(r);await e.uploadFrom(Sk.Readable.from(n),t)}a(XL,"createFileWithFTP");var wk=Cr({audience:"both",auth:pr,name:"create_file",classification:"WRITE",displayName:"Create File from Text",description:"Create a new file in the given path",aiMetadata:{description:"Writes a text string to a file at a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Choose this when the content is plain text you already hold as a string; prefer Upload File when the content is a binary or file object produced by an earlier step. Requires the full remote path (e.g. ./myfolder/notes.txt); idempotent, since the same path and content always converge on the same stored file, but note it clobbers whatever was there before.",idempotent:!0},props:{fileName:bt.ShortText({displayName:"File Path",required:!0}),fileContent:bt.LongText({displayName:"File content",required:!0})},outputSchema:gk,async run(e){let t=e.propsValue.fileName,r=e.propsValue.fileContent,i=await qt(e.auth.props.protocol),n=await Xt(e.auth.props);try{switch(i){case"ftps":case"ftp":await XL(n,t,r);break;default:case"sftp":await YL(n,t,r);break}return{status:"success"}}catch(o){return o instanceof vk.FTPError?(console.error(Vt(o.code)),{status:"error",error:Vt(o.code)}):{status:"error",error:o}}finally{await sr(n,e.auth.props.protocol)}}});var Ku={async poll(e,{store:t,auth:r,propsValue:i,maxItemsToPoll:n,files:o,server:s}){switch(e.strategy){case 0:{let c=await t.get("lastPoll");if(ir(c))throw new Error("lastPoll doesn't exist in the store.");let u=await e.items({store:t,auth:r,propsValue:i,lastFetchEpochMS:c,server:s}),l=u.reduce((f,p)=>Math.max(f,p.epochMilliSeconds),c);return await t.put("lastPoll",l),u.filter(f=>f.epochMilliSeconds>c).map(f=>f.data)}case 1:{let c=await t.get("lastItem"),u=await e.items({store:t,auth:r,propsValue:i,lastItemId:c,files:o,server:s}),l=u.findIndex(g=>g.id===c),f=[];ir(c)||l==-1?f=u??[]:f=u?.slice(0,l)??[],ir(n)||(f=f.slice(-n));let p=f?.[0]?.id;return ir(p)||await t.put("lastItem",p),f.map(g=>g.data)}}},async onEnable(e,{store:t,auth:r,propsValue:i,server:n,isRepublish:o}){switch(e.strategy){case 0:{if(o&&!ir(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(o&&!ir(await t.get("lastItem")))break;let c=(await e.items({store:t,auth:r,propsValue:i,lastItemId:null,server:n}))?.[0]?.id;ir(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:i,files:n,server:o}){let s=[];switch(e.strategy){case 0:{s=await e.items({store:i,auth:t,propsValue:r,lastFetchEpochMS:0,server:o});break}case 1:{s=await e.items({store:i,auth:t,propsValue:r,lastItemId:null,files:n,server:o});break}}return JL(s.map(c=>c.data))}};function JL(e){return e.length<=5?e:e.slice(0,5)}a(JL,"getFirstFiveOrAll");var Pk=require("node:stream");function eU(e){return"body"in e?{body:e.body,size:e.size}:{body:Pk.Readable.from(e.data),size:e.data.length}}a(eU,"toStreamingBody");async function*tU({readable:e,chunkSize:t}){let r=[],i=0;for await(let n of e)for(r.push(Buffer.isBuffer(n)?n:Buffer.from(n)),i+=r[r.length-1].length;i>=t;){let o=r.length===1?r[0]:Buffer.concat(r);yield o.subarray(0,t);let s=o.subarray(t);r=s.length>0?[s]:[],i=s.length}i>0&&(yield r.length===1?r[0]:Buffer.concat(r))}a(tU,"readChunks");var Tk={readChunks:tU,toStreamingBody:eU};var kk=Dr(Nn());async function rU(e,t,r){let i=t.substring(0,t.lastIndexOf("/"));await e.ensureDir(i),await e.uploadFrom(r,t)}a(rU,"uploadFileToFTP");async function nU(e,t,r){if(!await e.exists(t)){let n=t.substring(0,t.lastIndexOf("/"));await e.mkdir(n,!0)}await e.put(r,t),await e.end()}a(nU,"uploadFileToSFTP");var Ck=Cr({audience:"both",auth:pr,name:"upload_file",classification:"WRITE",displayName:"Upload File",description:"Upload a file to the given path.",aiMetadata:{description:"Uploads a file object, typically one produced by an earlier step, to a given path on the connected FTP, FTPS or SFTP server, creating missing parent directories and overwriting any existing file at that path. Use this instead of Create File from Text whenever you have an actual file rather than a string of text. Requires both the file and the destination remote path (e.g. ./myfolder/test.mp3); idempotent, as repeating the upload converges on the same stored file.",idempotent:!0},props:{fileName:bt.ShortText({displayName:"File Path",required:!0,description:"The path on the sftp server to store the file. e.g. `./myfolder/test.mp3`"}),fileContent:bt.File({displayName:"File content",required:!0,streaming:!0})},outputSchema:mk,async run(e){let t=await Xt(e.auth.props),r=e.propsValue.fileName,{body:i}=Tk.toStreamingBody(e.propsValue.fileContent),n=await qt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await rU(t,r,i);break;default:case"sftp":await nU(t,r,i);break}return{status:"success"}}catch(o){return o instanceof kk.FTPError?(console.error(Vt(o.code)),{status:"error",content:null,error:Vt(o.code)}):{status:"error",content:null,error:o}}finally{await sr(t,e.auth.props.protocol)}}});var Rk=Dr(Nn()),Ab=require("stream");function iU(e,t){let r=new Ab.PassThrough;return e.downloadTo(r,t).catch(i=>r.destroy(i)),r}a(iU,"readFTP");function oU(e,t){let r=new Ab.PassThrough;return e.get(t,r).catch(i=>r.destroy(i)),r}a(oU,"readSFTP");var Ok=Cr({audience:"both",auth:pr,name:"read_file_content",classification:"READ",displayName:"Read File Content",description:"Read the content of a file.",aiMetadata:{description:"Downloads one file from the connected FTP, FTPS or SFTP server by remote path and returns it as a file reference that later steps can consume. Use it to fetch the content of a file whose path you know; run List Folder Contents first when you still need to discover which paths exist. Requires an exact remote file path - it does not glob, search or recurse; read-only and idempotent.",idempotent:!0},props:{filePath:bt.ShortText({displayName:"File Path",required:!0})},outputSchema:bk,async run(e){let t=await Xt(e.auth.props),r=e.propsValue.filePath,i=r.split("/").pop()??r,n=await qt(e.auth.props.protocol);try{let o;switch(n){case"ftps":case"ftp":o=iU(t,r);break;default:case"sftp":o=oU(t,r);break}return{file:await e.files.write({fileName:i,data:o})}}catch(o){return o instanceof Rk.FTPError?(console.error(Vt(o.code)),{status:"error",content:null,error:Vt(o.code)}):{status:"error",content:null,error:o}}finally{await sr(t,e.auth.props.protocol)}}});var Yp=Dr(Nk());function $k(e,t){return t==="sftp"?e.modifyTime:(0,Yp.default)(e.modifiedAt).valueOf()}a($k,"getModifyTime");var Gp={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let i=null;try{let n=await qt(e.props.protocol);i=await Xt(e.props);let s=(await i.list(t.path)).filter(u=>{let l=$k(u,n);return(0,Yp.default)(l).valueOf()>r});return(t.ignoreHiddenFiles?s.filter(u=>!u.name.startsWith(".")):s).map(u=>{let l=$k(u,n);return{data:{...u,path:`${t.path}/${u.name}`},epochMilliSeconds:(0,Yp.default)(l).valueOf()}})}catch{return[]}finally{i&&await sr(i,e.props.protocol)}},"items")},Dk=hv({auth:pr,name:"new_file",classification:"READ",displayName:"New File",description:"Trigger when a new file is created or modified.",aiMetadata:{description:"Fires for each file in a watched directory on an FTP, FTPS or SFTP server whose modification time is newer than the previous poll, so it covers both newly added files and edits to existing ones. Each event represents one such file. Polls a single directory only, without recursing into subfolders, and can optionally skip hidden dotfiles."},props:{path:bt.ShortText({displayName:"Path",description:"The path to watch for new files",required:!0,defaultValue:"./"}),ignoreHiddenFiles:bt.Checkbox({displayName:"Ignore hidden files",description:"Ignore hidden files",required:!1,defaultValue:!1})},outputSchema:Ik,type:"POLLING",onEnable:a(async e=>{await Ku.onEnable(Gp,e)},"onEnable"),onDisable:a(async e=>{await Ku.onDisable(Gp,e)},"onDisable"),run:a(async e=>await Ku.poll(Gp,e),"run"),test:a(async e=>await Ku.test(Gp,e),"test"),sampleData:null});var Bk=Dr(Nn());async function sU(e,t,r){r?await e.removeDir(t):await e.removeEmptyDir(t)}a(sU,"deleteFolderFTP");async function aU(e,t,r){await e.rmdir(t,r)}a(aU,"deleteFolderSFTP");var zk=Cr({audience:"both",auth:pr,name:"deleteFolder",classification:"DESTRUCTIVE",displayName:"Delete Folder",description:"Deletes an existing folder at given path.",aiMetadata:{description:"Deletes a directory at a given remote path on the connected FTP, FTPS or SFTP server, either only when it is empty or, with the recursive option enabled, together with every nested subfolder and file. Use this for directories; use Delete File to remove a single file. Recursive deletion is permanent and unrecoverable, so verify the path first; idempotent in that it converges on the folder being absent, and a repeat call on an already-missing path just reports an error.",idempotent:!0},props:{folderPath:bt.ShortText({displayName:"Folder Path",required:!0,description:"The path of the folder to delete e.g. `./myfolder`"}),recursive:bt.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"Enable this option to delete the folder and all its contents, including subfolders and files."})},outputSchema:Ek,async run(e){let t=await Xt(e.auth.props),r=e.propsValue.folderPath,i=e.propsValue.recursive??!1,n=await qt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await sU(t,r,i);break;default:case"sftp":await aU(t,r,i);break}return{status:"success"}}catch(o){return o instanceof Bk.FTPError?(console.error(Vt(o.code)),{status:"error",error:Vt(o.code)}):{status:"error",error:o}}finally{await sr(t,e.auth.props.protocol)}}});var Lk=Dr(Nn());async function cU(e,t){await e.remove(t)}a(cU,"deleteFileFromFTP");async function uU(e,t){await e.delete(t)}a(uU,"deleteFileFromSFTP");var Uk=Cr({audience:"both",auth:pr,name:"deleteFile",classification:"DESTRUCTIVE",displayName:"Delete file",description:"Deletes a file at given path.",aiMetadata:{description:"Permanently deletes a single file at a given remote path on the connected FTP, FTPS or SFTP server. Use this for one file; use Delete Folder to remove a directory, optionally with all of its contents. Requires the exact remote path (e.g. ./myfolder/test.mp3) and there is no recycle bin or undo; idempotent in that it converges on the file being absent, though a repeat call on an already-missing path reports an error.",idempotent:!0},props:{filePath:bt.ShortText({displayName:"File Path",required:!0,description:"The path of the file to delete e.g. `./myfolder/test.mp3`"})},outputSchema:_k,async run(e){let t=await Xt(e.auth.props),r=e.propsValue.filePath,i=await qt(e.auth.props.protocol);try{switch(i){case"ftps":case"ftp":await cU(t,r);break;default:case"sftp":await uU(t,r);break}return{status:"success"}}catch(n){return n instanceof Lk.FTPError?(console.error(Vt(n.code)),{status:"error",error:Vt(n.code)}):{status:"error",error:n}}finally{await sr(t,e.auth.props.protocol)}}});var Mk=Dr(Nn());async function lU(e,t){let r=await e.list(t);return await e.end(),r}a(lU,"listSFTP");async function fU(e,t){return(await e.list(t)).map(i=>({type:i.type===1?"d":"-",name:i.name,size:i.size,modifyTime:i.modifiedAt,accessTime:i.modifiedAt,rights:{user:i.permissions||"",group:"",other:""},owner:"",group:""}))}a(fU,"listFTP");var Fk=Cr({audience:"both",auth:pr,name:"listFolderContents",classification:"SEARCH",displayName:"List Folder Contents",description:"Lists the contents of a given folder.",aiMetadata:{description:"Lists the immediate entries of one directory on the connected FTP, FTPS or SFTP server. Use it to discover paths before reading, renaming or deleting, and to walk a tree one level at a time; it is not recursive and offers no filtering or search. Requires the directory path (e.g. ./myfolder); read-only and idempotent.",idempotent:!0},props:{directoryPath:bt.ShortText({displayName:"Directory Path",required:!0,description:"The path of the folder to list e.g. `./myfolder`"})},outputSchema:xk,async run(e){let t=await Xt(e.auth.props),r=e.propsValue.directoryPath,i=await qt(e.auth.props.protocol);try{let n;switch(i){case"ftps":case"ftp":n=await fU(t,r);break;default:case"sftp":n=await lU(t,r);break}return{status:"success",contents:n}}catch(n){return n instanceof Mk.FTPError?(console.error(Vt(n.code)),{status:"error",content:null,error:Vt(n.code)}):{status:"error",content:null,error:n}}finally{await sr(t,e.auth.props.protocol)}}});var Hk=Dr(Nn());var jk=Cr({audience:"both",auth:pr,name:"createFolder",classification:"WRITE",displayName:"Create Folder",description:"Creates a folder at given path.",aiMetadata:{description:"Creates a directory at a given remote path on the connected FTP, FTPS or SFTP server; on SFTP an optional recursive mode also creates any missing parent directories, while FTP/FTPS always ensures the whole path. Use it to prepare a destination directory, for example before a rename or move, noting that Create File from Text and Upload File already create parent directories themselves. Requires the folder path (e.g. ./myfolder); idempotent because it converges on that directory existing.",idempotent:!0},props:{folderPath:bt.ShortText({displayName:"Folder Path",required:!0,description:"The new folder path e.g. `./myfolder`. For FTP/FTPS, it will create nested folders if necessary."}),recursive:bt.Checkbox({displayName:"Recursive",defaultValue:!1,required:!1,description:"For SFTP only: Create parent directories if they do not exist"})},outputSchema:yk,async run(e){let t=await Xt(e.auth.props),r=e.propsValue.folderPath,i=e.propsValue.recursive??!1,n=await qt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await t.ensureDir(r);break;default:case"sftp":await t.mkdir(r,i);break}return{status:"success"}}catch(o){return o instanceof Hk.FTPError?(console.error(Vt(o.code)),{status:"error",error:Vt(o.code)}):{status:"error",error:o}}finally{await sr(t,e.auth.props.protocol)}}});var Wk=Dr(Nn());async function dU(e,t,r){await e.rename(t,r)}a(dU,"renameFTP");async function pU(e,t,r){await e.rename(t,r),await e.end()}a(pU,"renameSFTP");var qk=Cr({audience:"both",auth:pr,name:"renameFileOrFolder",classification:"WRITE",displayName:"Rename File or Folder",description:"Renames a file or folder at given path.",aiMetadata:{description:"Moves a file or folder on the connected FTP, FTPS or SFTP server from an old remote path to a new one, which covers both renaming in place and, on most servers, relocating the entry into a different directory. Prefer it over reading and re-uploading content, and over a delete-then-create pair, when the bytes do not change. The parent directory of the new path must already exist, so create it with Create Folder first; idempotent in that the entry ends up at the new path, though a repeat call errors because the old path is gone.",idempotent:!0},props:{information:bt.MarkDown({value:"Depending on the server you can also use this to move a file to another directory, as long as the directory exists.",variant:"INFO"}),oldPath:bt.ShortText({displayName:"Old Path",required:!0,description:"The path of the file or folder to rename e.g. `./myfolder/test.mp3`"}),newPath:bt.ShortText({displayName:"New Path",required:!0,description:"The new path of the file or folder e.g. `./myfolder/new-name.mp3`"})},outputSchema:Ak,async run(e){let t=await Xt(e.auth.props),r=e.propsValue.oldPath,i=e.propsValue.newPath,n=await qt(e.auth.props.protocol);try{switch(n){case"ftps":case"ftp":await dU(t,r,i);break;default:case"sftp":await pU(t,r,i);break}return{status:"success"}}catch(o){return o instanceof Wk.FTPError?(console.error(Vt(o.code)),{status:"error",content:null,error:Vt(o.code)}):{status:"error",content:null,error:o}}finally{await sr(t,e.auth.props.protocol)}}});var hU=_v({displayName:"FTP/SFTP",description:"Connect to FTP, FTPS or SFTP servers",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/new-core/sftp.svg",categories:["CORE","DEVELOPER_TOOLS"],authors:["Abdallah-Alwarawreh","kishanprmr","AbdulTheActivePiecer","khaledmashaly","abuaboud","prasanna2000-max"],auth:pr,actions:[wk,Ck,Ok,Uk,jk,zk,Fk,qk],triggers:[Dk]});0&&(module.exports={endClient,ftpSftp,getClient,getProtocolBackwardCompatibility});
35
74
  /*! Bundled license information:
36
75
 
37
76
  safe-buffer/index.js: