From 87aaf49a6ab5f7d9a109eac59021787b0a7603cd Mon Sep 17 00:00:00 2001 From: TransparentLC Date: Mon, 15 Jul 2024 08:39:44 +0000 Subject: [PATCH] deploy: 4b152a0cd5a29a83e1a648c3c7027f323fe5432c --- ...cy-LMG.js => bn.interface.min-CSLO4CmQ.js} | 2 +- ...{bn.min-DsLKjtAs.js => bn.min-DAU79I_Z.js} | 2 +- ...n-DvUVzpm1.js => elliptic.min-fis8C3PY.js} | 2 +- .../{index-Bixp21LW.js => index-CG0IAS0V.js} | 20 +++++++++---------- index.html | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) rename assets/{bn.interface.min-C3cy-LMG.js => bn.interface.min-CSLO4CmQ.js} (96%) rename assets/{bn.min-DsLKjtAs.js => bn.min-DAU79I_Z.js} (99%) rename assets/{elliptic.min-DvUVzpm1.js => elliptic.min-fis8C3PY.js} (99%) rename assets/{index-Bixp21LW.js => index-CG0IAS0V.js} (88%) diff --git a/assets/bn.interface.min-C3cy-LMG.js b/assets/bn.interface.min-CSLO4CmQ.js similarity index 96% rename from assets/bn.interface.min-C3cy-LMG.js rename to assets/bn.interface.min-CSLO4CmQ.js index a42f0f7..b8f001a 100644 --- a/assets/bn.interface.min-C3cy-LMG.js +++ b/assets/bn.interface.min-CSLO4CmQ.js @@ -1 +1 @@ -import t from"./bn.min-DsLKjtAs.js";import"./index-Bixp21LW.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */class i{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");this.value=new t(e)}clone(){const e=new i(null);return this.value.copy(e.value),e}iinc(){return this.value.iadd(new t(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new t(1)),this}dec(){return this.clone().idec()}iadd(e){return this.value.iadd(e.value),this}add(e){return this.clone().iadd(e)}isub(e){return this.value.isub(e.value),this}sub(e){return this.clone().isub(e)}imul(e){return this.value.imul(e.value),this}mul(e){return this.clone().imul(e)}imod(e){return this.value=this.value.umod(e.value),this}mod(e){return this.clone().imod(e)}modExp(e,r){const n=r.isEven()?t.red(r.value):t.mont(r.value),u=this.clone();return u.value=u.value.toRed(n).redPow(e.value).fromRed(),u}modInv(e){if(!this.gcd(e).isOne())throw Error("Inverse does not exist");return new i(this.value.invm(e.value))}gcd(e){return new i(this.value.gcd(e.value))}ileftShift(e){return this.value.ishln(e.value.toNumber()),this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value.ishrn(e.value.toNumber()),this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value.eq(e.value)}lt(e){return this.value.lt(e.value)}lte(e){return this.value.lte(e.value)}gt(e){return this.value.gt(e.value)}gte(e){return this.value.gte(e.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new t(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const e=this.clone();return e.value=e.value.abs(),e}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(e){return this.value.testn(e)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(e="be",r){return this.value.toArrayLike(Uint8Array,e,r)}}export{i as default}; +import t from"./bn.min-DAU79I_Z.js";import"./index-CG0IAS0V.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */class i{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");this.value=new t(e)}clone(){const e=new i(null);return this.value.copy(e.value),e}iinc(){return this.value.iadd(new t(1)),this}inc(){return this.clone().iinc()}idec(){return this.value.isub(new t(1)),this}dec(){return this.clone().idec()}iadd(e){return this.value.iadd(e.value),this}add(e){return this.clone().iadd(e)}isub(e){return this.value.isub(e.value),this}sub(e){return this.clone().isub(e)}imul(e){return this.value.imul(e.value),this}mul(e){return this.clone().imul(e)}imod(e){return this.value=this.value.umod(e.value),this}mod(e){return this.clone().imod(e)}modExp(e,r){const n=r.isEven()?t.red(r.value):t.mont(r.value),u=this.clone();return u.value=u.value.toRed(n).redPow(e.value).fromRed(),u}modInv(e){if(!this.gcd(e).isOne())throw Error("Inverse does not exist");return new i(this.value.invm(e.value))}gcd(e){return new i(this.value.gcd(e.value))}ileftShift(e){return this.value.ishln(e.value.toNumber()),this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value.ishrn(e.value.toNumber()),this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value.eq(e.value)}lt(e){return this.value.lt(e.value)}lte(e){return this.value.lte(e.value)}gt(e){return this.value.gt(e.value)}gte(e){return this.value.gte(e.value)}isZero(){return this.value.isZero()}isOne(){return this.value.eq(new t(1))}isNegative(){return this.value.isNeg()}isEven(){return this.value.isEven()}abs(){const e=this.clone();return e.value=e.value.abs(),e}toString(){return this.value.toString()}toNumber(){return this.value.toNumber()}getBit(e){return this.value.testn(e)?1:0}bitLength(){return this.value.bitLength()}byteLength(){return this.value.byteLength()}toUint8Array(e="be",r){return this.value.toArrayLike(Uint8Array,e,r)}}export{i as default}; diff --git a/assets/bn.min-DsLKjtAs.js b/assets/bn.min-DAU79I_Z.js similarity index 99% rename from assets/bn.min-DsLKjtAs.js rename to assets/bn.min-DAU79I_Z.js index 55acbbf..002580f 100644 --- a/assets/bn.min-DsLKjtAs.js +++ b/assets/bn.min-DAU79I_Z.js @@ -1 +1 @@ -import{r as ei,t as si}from"./index-Bixp21LW.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var ui=ei(function(ii){(function(qt,ri){function m(t,h){if(!t)throw Error(h||"Assertion failed")}function et(t,h){t.super_=h;var e=function(){};e.prototype=h.prototype,t.prototype=new e,t.prototype.constructor=t}function s(t,h,e){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,t!==null&&(h!=="le"&&h!=="be"||(e=h,h=10),this._init(t||0,h||10,e||"be"))}var ot;typeof qt=="object"?qt.exports=s:ri.BN=s,s.BN=s,s.wordSize=26;try{ot=void 0}catch{}function Bt(t,h,e){for(var r=0,i=Math.min(t.length,e),n=h;n=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return r}function Nt(t,h,e,r){for(var i=0,n=Math.min(t.length,e),o=h;o=49?l-49+10:l>=17?l-17+10:l}return i}s.isBN=function(t){return t instanceof s||t!==null&&typeof t=="object"&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,h){return t.cmp(h)>0?t:h},s.min=function(t,h){return t.cmp(h)<0?t:h},s.prototype._init=function(t,h,e){if(typeof t=="number")return this._initNumber(t,h,e);if(typeof t=="object")return this._initArray(t,h,e);h==="hex"&&(h=16),m(h===(0|h)&&h>=2&&h<=36);var r=0;(t=t.toString().replace(/\s+/g,""))[0]==="-"&&r++,h===16?this._parseHex(t,r):this._parseBase(t,h,r),t[0]==="-"&&(this.negative=1),this.strip(),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initNumber=function(t,h,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(m(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initArray=function(t,h,e){if(m(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var r=0;r=0;r-=3)n=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[i]|=n<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if(e==="le")for(r=0,i=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},s.prototype._parseHex=function(t,h){this.length=Math.ceil((t.length-h)/6),this.words=Array(this.length);for(var e=0;e=h;e-=6)i=Bt(t,e,e+6),this.words[r]|=i<>>26-n&4194303,(n+=24)>=26&&(n-=26,r++);e+6!==h&&(i=Bt(t,h,e+6),this.words[r]|=i<>>26-n&4194303),this.strip()},s.prototype._parseBase=function(t,h,e){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=h)r++;r--,i=i/h|0;for(var n=t.length-e,o=n%r,l=Math.min(n,n-o)+e,a=0,u=e;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var Lt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],hi=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],ni=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function It(t,h,e){e.negative=h.negative^t.negative;var r=t.length+h.length|0;e.length=r,r=r-1|0;var i=0|t.words[0],n=0|h.words[0],o=i*n,l=67108863&o,a=o/67108864|0;e.words[0]=l;for(var u=1;u>>26,d=67108863&a,p=Math.min(u,h.length-1),M=Math.max(0,u-t.length+1);M<=p;M++){var v=u-M|0;f+=(o=(i=0|t.words[v])*(n=0|h.words[M])+d)/67108864|0,d=67108863&o}e.words[u]=0|d,a=0|f}return a!==0?e.words[u]=0|a:e.length--,e.strip()}s.prototype.toString=function(t,h){var e;if(h=0|h||1,(t=t||10)===16||t==="hex"){e="";for(var r=0,i=0,n=0;n>>24-r&16777215)!==0||n!==this.length-1?Lt[6-l.length]+l+e:l+e,(r+=2)>=26&&(r-=26,n--)}for(i!==0&&(e=i.toString(16)+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}if(t===(0|t)&&t>=2&&t<=36){var a=hi[t],u=ni[t];e="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modn(u).toString(t);e=(f=f.idivn(u)).isZero()?d+e:Lt[a-d.length]+d+e}for(this.isZero()&&(e="0"+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}m(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=67108864*this.words[1]:this.length===3&&this.words[2]===1?t+=4503599627370496+67108864*this.words[1]:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,h){return m(ot!==void 0),this.toArrayLike(ot,t,h)},s.prototype.toArray=function(t,h){return this.toArrayLike(Array,t,h)},s.prototype.toArrayLike=function(t,h,e){var r=this.byteLength(),i=e||Math.max(1,r);m(r<=i,"byte array longer than desired length"),m(i>0,"Requested array length <= 0"),this.strip();var n,o,l=h==="le",a=new t(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)n=u.andln(255),u.iushrn(8),a[o]=n;for(;o=4096&&(e+=13,h>>>=13),h>=64&&(e+=7,h>>>=7),h>=8&&(e+=4,h>>>=4),h>=2&&(e+=2,h>>>=2),e+h},s.prototype._zeroBits=function(t){if(t===0)return 26;var h=t,e=0;return!(8191&h)&&(e+=13,h>>>=13),!(127&h)&&(e+=7,h>>>=7),!(15&h)&&(e+=4,h>>>=4),!(3&h)&&(e+=2,h>>>=2),!(1&h)&&e++,e},s.prototype.bitLength=function(){var t=this.words[this.length-1],h=this._countBits(t);return 26*(this.length-1)+h},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,h=0;ht.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var h;h=this.length>t.length?t:this;for(var e=0;et.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var h,e;this.length>t.length?(h=this,e=t):(h=t,e=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){m(typeof t=="number"&&t>=0);var h=0|Math.ceil(t/26),e=t%26;this._expand(h),e>0&&h--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-e),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,h){m(typeof t=="number"&&t>=0);var e=t/26|0,r=t%26;return this._expand(e+1),this.words[e]=h?this.words[e]|1<t.length?(e=this,r=t):(e=t,r=this);for(var i=0,n=0;n>>26;for(;i!==0&&n>>26;if(this.length=e.length,i!==0)this.words[this.length]=i,this.length++;else if(e!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var h=this.iadd(t);return t.negative=1,h._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var e,r,i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var n=0,o=0;o>26,this.words[o]=67108863&h;for(;n!==0&&o>26,this.words[o]=67108863&h;if(n===0&&o>>13,M=0|o[1],v=8191&M,g=M>>>13,rt=0|o[2],c=8191&rt,w=rt>>>13,jt=0|o[3],b=8191&jt,_=jt>>>13,Kt=0|o[4],k=8191&Kt,A=Kt>>>13,Pt=0|o[5],x=8191&Pt,S=Pt>>>13,Ft=0|o[6],Z=8191&Ft,R=Ft>>>13,Ct=0|o[7],q=8191&Ct,B=Ct>>>13,Dt=0|o[8],N=8191&Dt,L=Dt>>>13,Ht=0|o[9],I=8191&Ht,z=Ht>>>13,Jt=0|l[0],E=8191&Jt,T=Jt>>>13,Ut=0|l[1],O=8191&Ut,j=Ut>>>13,Gt=0|l[2],K=8191&Gt,P=Gt>>>13,Qt=0|l[3],F=8191&Qt,C=Qt>>>13,Vt=0|l[4],D=8191&Vt,H=Vt>>>13,Wt=0|l[5],J=8191&Wt,U=Wt>>>13,Xt=0|l[6],G=8191&Xt,Q=Xt>>>13,Yt=0|l[7],V=8191&Yt,W=Yt>>>13,$t=0|l[8],X=8191&$t,Y=$t>>>13,ti=0|l[9],$=8191&ti,tt=ti>>>13;e.negative=t.negative^h.negative,e.length=19;var lt=(u+(r=Math.imul(d,E))|0)+((8191&(i=(i=Math.imul(d,T))+Math.imul(p,E)|0))<<13)|0;u=((n=Math.imul(p,T))+(i>>>13)|0)+(lt>>>26)|0,lt&=67108863,r=Math.imul(v,E),i=(i=Math.imul(v,T))+Math.imul(g,E)|0,n=Math.imul(g,T);var mt=(u+(r=r+Math.imul(d,O)|0)|0)+((8191&(i=(i=i+Math.imul(d,j)|0)+Math.imul(p,O)|0))<<13)|0;u=((n=n+Math.imul(p,j)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(c,E),i=(i=Math.imul(c,T))+Math.imul(w,E)|0,n=Math.imul(w,T),r=r+Math.imul(v,O)|0,i=(i=i+Math.imul(v,j)|0)+Math.imul(g,O)|0,n=n+Math.imul(g,j)|0;var ft=(u+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,P)|0)+Math.imul(p,K)|0))<<13)|0;u=((n=n+Math.imul(p,P)|0)+(i>>>13)|0)+(ft>>>26)|0,ft&=67108863,r=Math.imul(b,E),i=(i=Math.imul(b,T))+Math.imul(_,E)|0,n=Math.imul(_,T),r=r+Math.imul(c,O)|0,i=(i=i+Math.imul(c,j)|0)+Math.imul(w,O)|0,n=n+Math.imul(w,j)|0,r=r+Math.imul(v,K)|0,i=(i=i+Math.imul(v,P)|0)+Math.imul(g,K)|0,n=n+Math.imul(g,P)|0;var dt=(u+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,C)|0)+Math.imul(p,F)|0))<<13)|0;u=((n=n+Math.imul(p,C)|0)+(i>>>13)|0)+(dt>>>26)|0,dt&=67108863,r=Math.imul(k,E),i=(i=Math.imul(k,T))+Math.imul(A,E)|0,n=Math.imul(A,T),r=r+Math.imul(b,O)|0,i=(i=i+Math.imul(b,j)|0)+Math.imul(_,O)|0,n=n+Math.imul(_,j)|0,r=r+Math.imul(c,K)|0,i=(i=i+Math.imul(c,P)|0)+Math.imul(w,K)|0,n=n+Math.imul(w,P)|0,r=r+Math.imul(v,F)|0,i=(i=i+Math.imul(v,C)|0)+Math.imul(g,F)|0,n=n+Math.imul(g,C)|0;var pt=(u+(r=r+Math.imul(d,D)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(p,D)|0))<<13)|0;u=((n=n+Math.imul(p,H)|0)+(i>>>13)|0)+(pt>>>26)|0,pt&=67108863,r=Math.imul(x,E),i=(i=Math.imul(x,T))+Math.imul(S,E)|0,n=Math.imul(S,T),r=r+Math.imul(k,O)|0,i=(i=i+Math.imul(k,j)|0)+Math.imul(A,O)|0,n=n+Math.imul(A,j)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,P)|0)+Math.imul(_,K)|0,n=n+Math.imul(_,P)|0,r=r+Math.imul(c,F)|0,i=(i=i+Math.imul(c,C)|0)+Math.imul(w,F)|0,n=n+Math.imul(w,C)|0,r=r+Math.imul(v,D)|0,i=(i=i+Math.imul(v,H)|0)+Math.imul(g,D)|0,n=n+Math.imul(g,H)|0;var Mt=(u+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(p,J)|0))<<13)|0;u=((n=n+Math.imul(p,U)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(Z,E),i=(i=Math.imul(Z,T))+Math.imul(R,E)|0,n=Math.imul(R,T),r=r+Math.imul(x,O)|0,i=(i=i+Math.imul(x,j)|0)+Math.imul(S,O)|0,n=n+Math.imul(S,j)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,P)|0)+Math.imul(A,K)|0,n=n+Math.imul(A,P)|0,r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,C)|0)+Math.imul(_,F)|0,n=n+Math.imul(_,C)|0,r=r+Math.imul(c,D)|0,i=(i=i+Math.imul(c,H)|0)+Math.imul(w,D)|0,n=n+Math.imul(w,H)|0,r=r+Math.imul(v,J)|0,i=(i=i+Math.imul(v,U)|0)+Math.imul(g,J)|0,n=n+Math.imul(g,U)|0;var vt=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(p,G)|0))<<13)|0;u=((n=n+Math.imul(p,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(q,E),i=(i=Math.imul(q,T))+Math.imul(B,E)|0,n=Math.imul(B,T),r=r+Math.imul(Z,O)|0,i=(i=i+Math.imul(Z,j)|0)+Math.imul(R,O)|0,n=n+Math.imul(R,j)|0,r=r+Math.imul(x,K)|0,i=(i=i+Math.imul(x,P)|0)+Math.imul(S,K)|0,n=n+Math.imul(S,P)|0,r=r+Math.imul(k,F)|0,i=(i=i+Math.imul(k,C)|0)+Math.imul(A,F)|0,n=n+Math.imul(A,C)|0,r=r+Math.imul(b,D)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(_,D)|0,n=n+Math.imul(_,H)|0,r=r+Math.imul(c,J)|0,i=(i=i+Math.imul(c,U)|0)+Math.imul(w,J)|0,n=n+Math.imul(w,U)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(g,G)|0,n=n+Math.imul(g,Q)|0;var gt=(u+(r=r+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(p,V)|0))<<13)|0;u=((n=n+Math.imul(p,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(N,E),i=(i=Math.imul(N,T))+Math.imul(L,E)|0,n=Math.imul(L,T),r=r+Math.imul(q,O)|0,i=(i=i+Math.imul(q,j)|0)+Math.imul(B,O)|0,n=n+Math.imul(B,j)|0,r=r+Math.imul(Z,K)|0,i=(i=i+Math.imul(Z,P)|0)+Math.imul(R,K)|0,n=n+Math.imul(R,P)|0,r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,C)|0)+Math.imul(S,F)|0,n=n+Math.imul(S,C)|0,r=r+Math.imul(k,D)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(A,D)|0,n=n+Math.imul(A,H)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(_,J)|0,n=n+Math.imul(_,U)|0,r=r+Math.imul(c,G)|0,i=(i=i+Math.imul(c,Q)|0)+Math.imul(w,G)|0,n=n+Math.imul(w,Q)|0,r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(g,V)|0,n=n+Math.imul(g,W)|0;var ct=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(p,X)|0))<<13)|0;u=((n=n+Math.imul(p,Y)|0)+(i>>>13)|0)+(ct>>>26)|0,ct&=67108863,r=Math.imul(I,E),i=(i=Math.imul(I,T))+Math.imul(z,E)|0,n=Math.imul(z,T),r=r+Math.imul(N,O)|0,i=(i=i+Math.imul(N,j)|0)+Math.imul(L,O)|0,n=n+Math.imul(L,j)|0,r=r+Math.imul(q,K)|0,i=(i=i+Math.imul(q,P)|0)+Math.imul(B,K)|0,n=n+Math.imul(B,P)|0,r=r+Math.imul(Z,F)|0,i=(i=i+Math.imul(Z,C)|0)+Math.imul(R,F)|0,n=n+Math.imul(R,C)|0,r=r+Math.imul(x,D)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(S,D)|0,n=n+Math.imul(S,H)|0,r=r+Math.imul(k,J)|0,i=(i=i+Math.imul(k,U)|0)+Math.imul(A,J)|0,n=n+Math.imul(A,U)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(_,G)|0,n=n+Math.imul(_,Q)|0,r=r+Math.imul(c,V)|0,i=(i=i+Math.imul(c,W)|0)+Math.imul(w,V)|0,n=n+Math.imul(w,W)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(g,X)|0,n=n+Math.imul(g,Y)|0;var wt=(u+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(p,$)|0))<<13)|0;u=((n=n+Math.imul(p,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,O),i=(i=Math.imul(I,j))+Math.imul(z,O)|0,n=Math.imul(z,j),r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,P)|0)+Math.imul(L,K)|0,n=n+Math.imul(L,P)|0,r=r+Math.imul(q,F)|0,i=(i=i+Math.imul(q,C)|0)+Math.imul(B,F)|0,n=n+Math.imul(B,C)|0,r=r+Math.imul(Z,D)|0,i=(i=i+Math.imul(Z,H)|0)+Math.imul(R,D)|0,n=n+Math.imul(R,H)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,U)|0)+Math.imul(S,J)|0,n=n+Math.imul(S,U)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(A,G)|0,n=n+Math.imul(A,Q)|0,r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,r=r+Math.imul(c,X)|0,i=(i=i+Math.imul(c,Y)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,Y)|0;var yt=(u+(r=r+Math.imul(v,$)|0)|0)+((8191&(i=(i=i+Math.imul(v,tt)|0)+Math.imul(g,$)|0))<<13)|0;u=((n=n+Math.imul(g,tt)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(I,K),i=(i=Math.imul(I,P))+Math.imul(z,K)|0,n=Math.imul(z,P),r=r+Math.imul(N,F)|0,i=(i=i+Math.imul(N,C)|0)+Math.imul(L,F)|0,n=n+Math.imul(L,C)|0,r=r+Math.imul(q,D)|0,i=(i=i+Math.imul(q,H)|0)+Math.imul(B,D)|0,n=n+Math.imul(B,H)|0,r=r+Math.imul(Z,J)|0,i=(i=i+Math.imul(Z,U)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,U)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(S,G)|0,n=n+Math.imul(S,Q)|0,r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,V)|0,n=n+Math.imul(A,W)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0;var bt=(u+(r=r+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(w,$)|0))<<13)|0;u=((n=n+Math.imul(w,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(I,F),i=(i=Math.imul(I,C))+Math.imul(z,F)|0,n=Math.imul(z,C),r=r+Math.imul(N,D)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(L,D)|0,n=n+Math.imul(L,H)|0,r=r+Math.imul(q,J)|0,i=(i=i+Math.imul(q,U)|0)+Math.imul(B,J)|0,n=n+Math.imul(B,U)|0,r=r+Math.imul(Z,G)|0,i=(i=i+Math.imul(Z,Q)|0)+Math.imul(R,G)|0,n=n+Math.imul(R,Q)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(A,X)|0,n=n+Math.imul(A,Y)|0;var _t=(u+(r=r+Math.imul(b,$)|0)|0)+((8191&(i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0))<<13)|0;u=((n=n+Math.imul(_,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,D),i=(i=Math.imul(I,H))+Math.imul(z,D)|0,n=Math.imul(z,H),r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(L,J)|0,n=n+Math.imul(L,U)|0,r=r+Math.imul(q,G)|0,i=(i=i+Math.imul(q,Q)|0)+Math.imul(B,G)|0,n=n+Math.imul(B,Q)|0,r=r+Math.imul(Z,V)|0,i=(i=i+Math.imul(Z,W)|0)+Math.imul(R,V)|0,n=n+Math.imul(R,W)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0;var kt=(u+(r=r+Math.imul(k,$)|0)|0)+((8191&(i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,$)|0))<<13)|0;u=((n=n+Math.imul(A,tt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(I,J),i=(i=Math.imul(I,U))+Math.imul(z,J)|0,n=Math.imul(z,U),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(L,G)|0,n=n+Math.imul(L,Q)|0,r=r+Math.imul(q,V)|0,i=(i=i+Math.imul(q,W)|0)+Math.imul(B,V)|0,n=n+Math.imul(B,W)|0,r=r+Math.imul(Z,X)|0,i=(i=i+Math.imul(Z,Y)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Y)|0;var At=(u+(r=r+Math.imul(x,$)|0)|0)+((8191&(i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0))<<13)|0;u=((n=n+Math.imul(S,tt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(I,G),i=(i=Math.imul(I,Q))+Math.imul(z,G)|0,n=Math.imul(z,Q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,n=n+Math.imul(L,W)|0,r=r+Math.imul(q,X)|0,i=(i=i+Math.imul(q,Y)|0)+Math.imul(B,X)|0,n=n+Math.imul(B,Y)|0;var xt=(u+(r=r+Math.imul(Z,$)|0)|0)+((8191&(i=(i=i+Math.imul(Z,tt)|0)+Math.imul(R,$)|0))<<13)|0;u=((n=n+Math.imul(R,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(I,V),i=(i=Math.imul(I,W))+Math.imul(z,V)|0,n=Math.imul(z,W),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,Y)|0;var St=(u+(r=r+Math.imul(q,$)|0)|0)+((8191&(i=(i=i+Math.imul(q,tt)|0)+Math.imul(B,$)|0))<<13)|0;u=((n=n+Math.imul(B,tt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,X),i=(i=Math.imul(I,Y))+Math.imul(z,X)|0,n=Math.imul(z,Y);var Zt=(u+(r=r+Math.imul(N,$)|0)|0)+((8191&(i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,$)|0))<<13)|0;u=((n=n+Math.imul(L,tt)|0)+(i>>>13)|0)+(Zt>>>26)|0,Zt&=67108863;var Rt=(u+(r=Math.imul(I,$))|0)+((8191&(i=(i=Math.imul(I,tt))+Math.imul(z,$)|0))<<13)|0;return u=((n=Math.imul(z,tt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,a[0]=lt,a[1]=mt,a[2]=ft,a[3]=dt,a[4]=pt,a[5]=Mt,a[6]=vt,a[7]=gt,a[8]=ct,a[9]=wt,a[10]=yt,a[11]=bt,a[12]=_t,a[13]=kt,a[14]=At,a[15]=xt,a[16]=St,a[17]=Zt,a[18]=Rt,u!==0&&(a[19]=u,e.length++),e};function Et(t,h,e){return new ht().mulp(t,h,e)}function ht(t,h){this.x=t,this.y=h}Math.imul||(zt=It),s.prototype.mulTo=function(t,h){var e,r=this.length+t.length;return e=this.length===10&&t.length===10?zt(this,t,h):r<63?It(this,t,h):r<1024?function(i,n,o){o.negative=n.negative^i.negative,o.length=i.length+n.length;for(var l=0,a=0,u=0;u>>26)|0)>>>26,f&=67108863}o.words[u]=d,l=f,f=a}return l!==0?o.words[u]=l:o.length--,o.strip()}(this,t,h):Et(this,t,h),e},ht.prototype.makeRBT=function(t){for(var h=Array(t),e=s.prototype._countBits(t)-1,r=0;r>=1;return r},ht.prototype.permute=function(t,h,e,r,i,n){for(var o=0;o>>=1)i++;return 1<>>=13,e[2*n+1]=8191&i,i>>>=13;for(n=2*h;n>=26,h+=r/67108864|0,h+=i>>>26,this.words[e]=67108863&i}return h!==0&&(this.words[e]=h,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var h=function(n){for(var o=Array(n.bitLength()),l=0;l>>u}return o}(t);if(h.length===0)return new s(1);for(var e=this,r=0;r=0);var h,e=t%26,r=(t-e)/26,i=67108863>>>26-e<<26-e;if(e!==0){var n=0;for(h=0;h>>26-e}n&&(this.words[h]=n,this.length++)}if(r!==0){for(h=this.length-1;h>=0;h--)this.words[h+r]=this.words[h];for(h=0;h=0),r=h?(h-h%26)/26:0;var i=t%26,n=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<n)for(this.length-=n,a=0;a=0&&(u!==0||a>=r);a--){var f=0|this.words[a];this.words[a]=u<<26-i|f>>>i,u=f&o}return l&&u!==0&&(l.words[l.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,h,e){return m(this.negative===0),this.iushrn(t,h,e)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){m(typeof t=="number"&&t>=0);var h=t%26,e=(t-h)/26,r=1<=0);var h=t%26,e=(t-h)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=e)return this;if(h!==0&&e++,this.length=Math.min(e,this.length),h!==0){var r=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(t){if(m(typeof t=="number"),m(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(l/67108864|0),this.words[r+e]=67108863&i}for(;r>26,this.words[r+e]=67108863&i;if(o===0)return this.strip();for(m(o===-1),o=0,r=0;r>26,this.words[r]=67108863&i;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,h){var e=(this.length,t.length),r=this.clone(),i=t,n=0|i.words[i.length-1];(e=26-this._countBits(n))!==0&&(i=i.ushln(e),r.iushln(e),n=0|i.words[i.length-1]);var o,l=r.length-i.length;if(h!=="mod"){(o=new s(null)).length=l+1,o.words=Array(o.length);for(var a=0;a=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/n|0,67108863),r._ishlnsubmul(i,d,f);r.negative!==0;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);o&&(o.words[f]=d)}return o&&o.strip(),r.strip(),h!=="div"&&e!==0&&r.iushrn(e),{div:o||null,mod:r}},s.prototype.divmod=function(t,h,e){return m(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&t.negative===0?(n=this.neg().divmod(t,h),h!=="mod"&&(r=n.div.neg()),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.iadd(t)),{div:r,mod:i}):this.negative===0&&t.negative!==0?(n=this.divmod(t.neg(),h),h!=="mod"&&(r=n.div.neg()),{div:r,mod:n.mod}):this.negative&t.negative?(n=this.neg().divmod(t.neg(),h),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.isub(t)),{div:n.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:t.length===1?h==="div"?{div:this.divn(t.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,h);var r,i,n},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var h=this.divmod(t);if(h.mod.isZero())return h.div;var e=h.div.negative!==0?h.mod.isub(t):h.mod,r=t.ushrn(1),i=t.andln(1),n=e.cmp(r);return n<0||i===1&&n===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modn=function(t){m(t<=67108863);for(var h=(1<<26)%t,e=0,r=this.length-1;r>=0;r--)e=(h*e+(0|this.words[r]))%t;return e},s.prototype.idivn=function(t){m(t<=67108863);for(var h=0,e=this.length-1;e>=0;e--){var r=(0|this.words[e])+67108864*h;this.words[e]=r/t|0,h=r%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r=new s(1),i=new s(0),n=new s(0),o=new s(1),l=0;h.isEven()&&e.isEven();)h.iushrn(1),e.iushrn(1),++l;for(var a=e.clone(),u=h.clone();!h.isZero();){for(var f=0,d=1;!(h.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(h.iushrn(f);f-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(a),i.isub(u)),r.iushrn(1),i.iushrn(1);for(var p=0,M=1;!(e.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(a),o.isub(u)),n.iushrn(1),o.iushrn(1);h.cmp(e)>=0?(h.isub(e),r.isub(n),i.isub(o)):(e.isub(h),n.isub(r),o.isub(i))}return{a:n,b:o,gcd:e.iushln(l)}},s.prototype._invmp=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r,i=new s(1),n=new s(0),o=e.clone();h.cmpn(1)>0&&e.cmpn(1)>0;){for(var l=0,a=1;!(h.words[0]&a)&&l<26;++l,a<<=1);if(l>0)for(h.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(o),i.iushrn(1);for(var u=0,f=1;!(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)n.isOdd()&&n.iadd(o),n.iushrn(1);h.cmp(e)>=0?(h.isub(e),i.isub(n)):(e.isub(h),n.isub(i))}return(r=h.cmpn(1)===0?i:n).cmpn(0)<0&&r.iadd(t),r},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var h=this.clone(),e=t.clone();h.negative=0,e.negative=0;for(var r=0;h.isEven()&&e.isEven();r++)h.iushrn(1),e.iushrn(1);for(;;){for(;h.isEven();)h.iushrn(1);for(;e.isEven();)e.iushrn(1);var i=h.cmp(e);if(i<0){var n=h;h=e,e=n}else if(i===0||e.cmpn(1)===0)break;h.isub(e)}return e.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){m(typeof t=="number");var h=t%26,e=(t-h)/26,r=1<>>26,o&=67108863,this.words[n]=o}return i!==0&&(this.words[n]=i,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(t){var h,e=t<0;if(this.negative!==0&&!e)return-1;if(this.negative===0&&e)return 1;if(this.strip(),this.length>1)h=1;else{e&&(t=-t),m(t<=67108863,"Number is too big");var r=0|this.words[0];h=r===t?0:rt.length)return 1;if(this.length=0;e--){var r=0|this.words[e],i=0|t.words[e];if(r!==i){ri&&(h=1);break}}return h},s.prototype.gtn=function(t){return this.cmpn(t)===1},s.prototype.gt=function(t){return this.cmp(t)===1},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return this.cmpn(t)===-1},s.prototype.lt=function(t){return this.cmp(t)===-1},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return this.cmpn(t)===0},s.prototype.eq=function(t){return this.cmp(t)===0},s.red=function(t){return new y(t)},s.prototype.toRed=function(t){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return m(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return m(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var ut={k256:null,p224:null,p192:null,p25519:null};function it(t,h){this.name=t,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function st(){it.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Tt(){it.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function Ot(){it.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function at(){it.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if(typeof t=="string"){var h=s._prime(t);this.m=h.p,this.prime=h}else m(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function nt(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it.prototype._tmp=function(){var t=new s(null);return t.words=Array(Math.ceil(this.n/13)),t},it.prototype.ireduce=function(t){var h,e=t;do this.split(e,this.tmp),h=(e=(e=this.imulK(e)).iadd(this.tmp)).bitLength();while(h>this.n);var r=h0?e.isub(this.p):e.strip(),e},it.prototype.split=function(t,h){t.iushrn(this.n,0,h)},it.prototype.imulK=function(t){return t.imul(this.k)},et(st,it),st.prototype.split=function(t,h){for(var e=4194303,r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,n===0&&t.length>10?t.length-=10:t.length-=9},st.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var h=0,e=0;e>>=26,t.words[e]=i,h=r}return h!==0&&(t.words[t.length++]=h),t},s._prime=function(t){if(ut[t])return ut[t];var h;if(t==="k256")h=new st;else if(t==="p224")h=new Tt;else if(t==="p192")h=new Ot;else{if(t!=="p25519")throw Error("Unknown prime "+t);h=new at}return ut[t]=h,h},y.prototype._verify1=function(t){m(t.negative===0,"red works only with positives"),m(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,h){m((t.negative|h.negative)==0,"red works only with positives"),m(t.red&&t.red===h.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,h){this._verify2(t,h);var e=t.add(h);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},y.prototype.iadd=function(t,h){this._verify2(t,h);var e=t.iadd(h);return e.cmp(this.m)>=0&&e.isub(this.m),e},y.prototype.sub=function(t,h){this._verify2(t,h);var e=t.sub(h);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},y.prototype.isub=function(t,h){this._verify2(t,h);var e=t.isub(h);return e.cmpn(0)<0&&e.iadd(this.m),e},y.prototype.shl=function(t,h){return this._verify1(t),this.imod(t.ushln(h))},y.prototype.imul=function(t,h){return this._verify2(t,h),this.imod(t.imul(h))},y.prototype.mul=function(t,h){return this._verify2(t,h),this.imod(t.mul(h))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var h=this.m.andln(3);if(m(h%2==1),h===3){var e=this.m.add(new s(1)).iushrn(2);return this.pow(t,e)}for(var r=this.m.subn(1),i=0;!r.isZero()&&r.andln(1)===0;)i++,r.iushrn(1);m(!r.isZero());var n=new s(1).toRed(this),o=n.redNeg(),l=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new s(2*a*a).toRed(this);this.pow(a,l).cmp(o)!==0;)a.redIAdd(o);for(var u=this.pow(a,r),f=this.pow(t,r.addn(1).iushrn(1)),d=this.pow(t,r),p=i;d.cmp(n)!==0;){for(var M=d,v=0;M.cmp(n)!==0;v++)M=M.redSqr();m(v=0;r--){for(var a=h.words[r],u=l-1;u>=0;u--){var f=a>>u&1;i!==e[0]&&(i=this.sqr(i)),f!==0||n!==0?(n<<=1,n|=f,(++o===4||r===0&&u===0)&&(i=this.mul(i,e[n]),o=0,n=0)):o=0}l=26}return i},y.prototype.convertTo=function(t){var h=t.umod(this.m);return h===t?h.clone():h},y.prototype.convertFrom=function(t){var h=t.clone();return h.red=null,h},s.mont=function(t){return new nt(t)},et(nt,y),nt.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},nt.prototype.convertFrom=function(t){var h=this.imod(t.mul(this.rinv));return h.red=null,h},nt.prototype.imul=function(t,h){if(t.isZero()||h.isZero())return t.words[0]=0,t.length=1,t;var e=t.imul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.mul=function(t,h){if(t.isZero()||h.isZero())return new s(0)._forceRed(this);var e=t.mul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}})(ii,si)});export{ui as __moduleExports,ui as default}; +import{r as ei,t as si}from"./index-CG0IAS0V.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var ui=ei(function(ii){(function(qt,ri){function m(t,h){if(!t)throw Error(h||"Assertion failed")}function et(t,h){t.super_=h;var e=function(){};e.prototype=h.prototype,t.prototype=new e,t.prototype.constructor=t}function s(t,h,e){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,t!==null&&(h!=="le"&&h!=="be"||(e=h,h=10),this._init(t||0,h||10,e||"be"))}var ot;typeof qt=="object"?qt.exports=s:ri.BN=s,s.BN=s,s.wordSize=26;try{ot=void 0}catch{}function Bt(t,h,e){for(var r=0,i=Math.min(t.length,e),n=h;n=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return r}function Nt(t,h,e,r){for(var i=0,n=Math.min(t.length,e),o=h;o=49?l-49+10:l>=17?l-17+10:l}return i}s.isBN=function(t){return t instanceof s||t!==null&&typeof t=="object"&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,h){return t.cmp(h)>0?t:h},s.min=function(t,h){return t.cmp(h)<0?t:h},s.prototype._init=function(t,h,e){if(typeof t=="number")return this._initNumber(t,h,e);if(typeof t=="object")return this._initArray(t,h,e);h==="hex"&&(h=16),m(h===(0|h)&&h>=2&&h<=36);var r=0;(t=t.toString().replace(/\s+/g,""))[0]==="-"&&r++,h===16?this._parseHex(t,r):this._parseBase(t,h,r),t[0]==="-"&&(this.negative=1),this.strip(),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initNumber=function(t,h,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(m(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),e==="le"&&this._initArray(this.toArray(),h,e)},s.prototype._initArray=function(t,h,e){if(m(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var r=0;r=0;r-=3)n=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[i]|=n<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if(e==="le")for(r=0,i=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},s.prototype._parseHex=function(t,h){this.length=Math.ceil((t.length-h)/6),this.words=Array(this.length);for(var e=0;e=h;e-=6)i=Bt(t,e,e+6),this.words[r]|=i<>>26-n&4194303,(n+=24)>=26&&(n-=26,r++);e+6!==h&&(i=Bt(t,h,e+6),this.words[r]|=i<>>26-n&4194303),this.strip()},s.prototype._parseBase=function(t,h,e){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=h)r++;r--,i=i/h|0;for(var n=t.length-e,o=n%r,l=Math.min(n,n-o)+e,a=0,u=e;u1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var Lt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],hi=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],ni=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function It(t,h,e){e.negative=h.negative^t.negative;var r=t.length+h.length|0;e.length=r,r=r-1|0;var i=0|t.words[0],n=0|h.words[0],o=i*n,l=67108863&o,a=o/67108864|0;e.words[0]=l;for(var u=1;u>>26,d=67108863&a,p=Math.min(u,h.length-1),M=Math.max(0,u-t.length+1);M<=p;M++){var v=u-M|0;f+=(o=(i=0|t.words[v])*(n=0|h.words[M])+d)/67108864|0,d=67108863&o}e.words[u]=0|d,a=0|f}return a!==0?e.words[u]=0|a:e.length--,e.strip()}s.prototype.toString=function(t,h){var e;if(h=0|h||1,(t=t||10)===16||t==="hex"){e="";for(var r=0,i=0,n=0;n>>24-r&16777215)!==0||n!==this.length-1?Lt[6-l.length]+l+e:l+e,(r+=2)>=26&&(r-=26,n--)}for(i!==0&&(e=i.toString(16)+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}if(t===(0|t)&&t>=2&&t<=36){var a=hi[t],u=ni[t];e="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modn(u).toString(t);e=(f=f.idivn(u)).isZero()?d+e:Lt[a-d.length]+d+e}for(this.isZero()&&(e="0"+e);e.length%h!=0;)e="0"+e;return this.negative!==0&&(e="-"+e),e}m(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=67108864*this.words[1]:this.length===3&&this.words[2]===1?t+=4503599627370496+67108864*this.words[1]:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,h){return m(ot!==void 0),this.toArrayLike(ot,t,h)},s.prototype.toArray=function(t,h){return this.toArrayLike(Array,t,h)},s.prototype.toArrayLike=function(t,h,e){var r=this.byteLength(),i=e||Math.max(1,r);m(r<=i,"byte array longer than desired length"),m(i>0,"Requested array length <= 0"),this.strip();var n,o,l=h==="le",a=new t(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)n=u.andln(255),u.iushrn(8),a[o]=n;for(;o=4096&&(e+=13,h>>>=13),h>=64&&(e+=7,h>>>=7),h>=8&&(e+=4,h>>>=4),h>=2&&(e+=2,h>>>=2),e+h},s.prototype._zeroBits=function(t){if(t===0)return 26;var h=t,e=0;return!(8191&h)&&(e+=13,h>>>=13),!(127&h)&&(e+=7,h>>>=7),!(15&h)&&(e+=4,h>>>=4),!(3&h)&&(e+=2,h>>>=2),!(1&h)&&e++,e},s.prototype.bitLength=function(){var t=this.words[this.length-1],h=this._countBits(t);return 26*(this.length-1)+h},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,h=0;ht.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var h;h=this.length>t.length?t:this;for(var e=0;et.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var h,e;this.length>t.length?(h=this,e=t):(h=t,e=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){m(typeof t=="number"&&t>=0);var h=0|Math.ceil(t/26),e=t%26;this._expand(h),e>0&&h--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-e),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,h){m(typeof t=="number"&&t>=0);var e=t/26|0,r=t%26;return this._expand(e+1),this.words[e]=h?this.words[e]|1<t.length?(e=this,r=t):(e=t,r=this);for(var i=0,n=0;n>>26;for(;i!==0&&n>>26;if(this.length=e.length,i!==0)this.words[this.length]=i,this.length++;else if(e!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var h=this.iadd(t);return t.negative=1,h._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var e,r,i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var n=0,o=0;o>26,this.words[o]=67108863&h;for(;n!==0&&o>26,this.words[o]=67108863&h;if(n===0&&o>>13,M=0|o[1],v=8191&M,g=M>>>13,rt=0|o[2],c=8191&rt,w=rt>>>13,jt=0|o[3],b=8191&jt,_=jt>>>13,Kt=0|o[4],k=8191&Kt,A=Kt>>>13,Pt=0|o[5],x=8191&Pt,S=Pt>>>13,Ft=0|o[6],Z=8191&Ft,R=Ft>>>13,Ct=0|o[7],q=8191&Ct,B=Ct>>>13,Dt=0|o[8],N=8191&Dt,L=Dt>>>13,Ht=0|o[9],I=8191&Ht,z=Ht>>>13,Jt=0|l[0],E=8191&Jt,T=Jt>>>13,Ut=0|l[1],O=8191&Ut,j=Ut>>>13,Gt=0|l[2],K=8191&Gt,P=Gt>>>13,Qt=0|l[3],F=8191&Qt,C=Qt>>>13,Vt=0|l[4],D=8191&Vt,H=Vt>>>13,Wt=0|l[5],J=8191&Wt,U=Wt>>>13,Xt=0|l[6],G=8191&Xt,Q=Xt>>>13,Yt=0|l[7],V=8191&Yt,W=Yt>>>13,$t=0|l[8],X=8191&$t,Y=$t>>>13,ti=0|l[9],$=8191&ti,tt=ti>>>13;e.negative=t.negative^h.negative,e.length=19;var lt=(u+(r=Math.imul(d,E))|0)+((8191&(i=(i=Math.imul(d,T))+Math.imul(p,E)|0))<<13)|0;u=((n=Math.imul(p,T))+(i>>>13)|0)+(lt>>>26)|0,lt&=67108863,r=Math.imul(v,E),i=(i=Math.imul(v,T))+Math.imul(g,E)|0,n=Math.imul(g,T);var mt=(u+(r=r+Math.imul(d,O)|0)|0)+((8191&(i=(i=i+Math.imul(d,j)|0)+Math.imul(p,O)|0))<<13)|0;u=((n=n+Math.imul(p,j)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(c,E),i=(i=Math.imul(c,T))+Math.imul(w,E)|0,n=Math.imul(w,T),r=r+Math.imul(v,O)|0,i=(i=i+Math.imul(v,j)|0)+Math.imul(g,O)|0,n=n+Math.imul(g,j)|0;var ft=(u+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,P)|0)+Math.imul(p,K)|0))<<13)|0;u=((n=n+Math.imul(p,P)|0)+(i>>>13)|0)+(ft>>>26)|0,ft&=67108863,r=Math.imul(b,E),i=(i=Math.imul(b,T))+Math.imul(_,E)|0,n=Math.imul(_,T),r=r+Math.imul(c,O)|0,i=(i=i+Math.imul(c,j)|0)+Math.imul(w,O)|0,n=n+Math.imul(w,j)|0,r=r+Math.imul(v,K)|0,i=(i=i+Math.imul(v,P)|0)+Math.imul(g,K)|0,n=n+Math.imul(g,P)|0;var dt=(u+(r=r+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,C)|0)+Math.imul(p,F)|0))<<13)|0;u=((n=n+Math.imul(p,C)|0)+(i>>>13)|0)+(dt>>>26)|0,dt&=67108863,r=Math.imul(k,E),i=(i=Math.imul(k,T))+Math.imul(A,E)|0,n=Math.imul(A,T),r=r+Math.imul(b,O)|0,i=(i=i+Math.imul(b,j)|0)+Math.imul(_,O)|0,n=n+Math.imul(_,j)|0,r=r+Math.imul(c,K)|0,i=(i=i+Math.imul(c,P)|0)+Math.imul(w,K)|0,n=n+Math.imul(w,P)|0,r=r+Math.imul(v,F)|0,i=(i=i+Math.imul(v,C)|0)+Math.imul(g,F)|0,n=n+Math.imul(g,C)|0;var pt=(u+(r=r+Math.imul(d,D)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(p,D)|0))<<13)|0;u=((n=n+Math.imul(p,H)|0)+(i>>>13)|0)+(pt>>>26)|0,pt&=67108863,r=Math.imul(x,E),i=(i=Math.imul(x,T))+Math.imul(S,E)|0,n=Math.imul(S,T),r=r+Math.imul(k,O)|0,i=(i=i+Math.imul(k,j)|0)+Math.imul(A,O)|0,n=n+Math.imul(A,j)|0,r=r+Math.imul(b,K)|0,i=(i=i+Math.imul(b,P)|0)+Math.imul(_,K)|0,n=n+Math.imul(_,P)|0,r=r+Math.imul(c,F)|0,i=(i=i+Math.imul(c,C)|0)+Math.imul(w,F)|0,n=n+Math.imul(w,C)|0,r=r+Math.imul(v,D)|0,i=(i=i+Math.imul(v,H)|0)+Math.imul(g,D)|0,n=n+Math.imul(g,H)|0;var Mt=(u+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(p,J)|0))<<13)|0;u=((n=n+Math.imul(p,U)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(Z,E),i=(i=Math.imul(Z,T))+Math.imul(R,E)|0,n=Math.imul(R,T),r=r+Math.imul(x,O)|0,i=(i=i+Math.imul(x,j)|0)+Math.imul(S,O)|0,n=n+Math.imul(S,j)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,P)|0)+Math.imul(A,K)|0,n=n+Math.imul(A,P)|0,r=r+Math.imul(b,F)|0,i=(i=i+Math.imul(b,C)|0)+Math.imul(_,F)|0,n=n+Math.imul(_,C)|0,r=r+Math.imul(c,D)|0,i=(i=i+Math.imul(c,H)|0)+Math.imul(w,D)|0,n=n+Math.imul(w,H)|0,r=r+Math.imul(v,J)|0,i=(i=i+Math.imul(v,U)|0)+Math.imul(g,J)|0,n=n+Math.imul(g,U)|0;var vt=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(p,G)|0))<<13)|0;u=((n=n+Math.imul(p,Q)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(q,E),i=(i=Math.imul(q,T))+Math.imul(B,E)|0,n=Math.imul(B,T),r=r+Math.imul(Z,O)|0,i=(i=i+Math.imul(Z,j)|0)+Math.imul(R,O)|0,n=n+Math.imul(R,j)|0,r=r+Math.imul(x,K)|0,i=(i=i+Math.imul(x,P)|0)+Math.imul(S,K)|0,n=n+Math.imul(S,P)|0,r=r+Math.imul(k,F)|0,i=(i=i+Math.imul(k,C)|0)+Math.imul(A,F)|0,n=n+Math.imul(A,C)|0,r=r+Math.imul(b,D)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(_,D)|0,n=n+Math.imul(_,H)|0,r=r+Math.imul(c,J)|0,i=(i=i+Math.imul(c,U)|0)+Math.imul(w,J)|0,n=n+Math.imul(w,U)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(g,G)|0,n=n+Math.imul(g,Q)|0;var gt=(u+(r=r+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(p,V)|0))<<13)|0;u=((n=n+Math.imul(p,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(N,E),i=(i=Math.imul(N,T))+Math.imul(L,E)|0,n=Math.imul(L,T),r=r+Math.imul(q,O)|0,i=(i=i+Math.imul(q,j)|0)+Math.imul(B,O)|0,n=n+Math.imul(B,j)|0,r=r+Math.imul(Z,K)|0,i=(i=i+Math.imul(Z,P)|0)+Math.imul(R,K)|0,n=n+Math.imul(R,P)|0,r=r+Math.imul(x,F)|0,i=(i=i+Math.imul(x,C)|0)+Math.imul(S,F)|0,n=n+Math.imul(S,C)|0,r=r+Math.imul(k,D)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(A,D)|0,n=n+Math.imul(A,H)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(_,J)|0,n=n+Math.imul(_,U)|0,r=r+Math.imul(c,G)|0,i=(i=i+Math.imul(c,Q)|0)+Math.imul(w,G)|0,n=n+Math.imul(w,Q)|0,r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(g,V)|0,n=n+Math.imul(g,W)|0;var ct=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(p,X)|0))<<13)|0;u=((n=n+Math.imul(p,Y)|0)+(i>>>13)|0)+(ct>>>26)|0,ct&=67108863,r=Math.imul(I,E),i=(i=Math.imul(I,T))+Math.imul(z,E)|0,n=Math.imul(z,T),r=r+Math.imul(N,O)|0,i=(i=i+Math.imul(N,j)|0)+Math.imul(L,O)|0,n=n+Math.imul(L,j)|0,r=r+Math.imul(q,K)|0,i=(i=i+Math.imul(q,P)|0)+Math.imul(B,K)|0,n=n+Math.imul(B,P)|0,r=r+Math.imul(Z,F)|0,i=(i=i+Math.imul(Z,C)|0)+Math.imul(R,F)|0,n=n+Math.imul(R,C)|0,r=r+Math.imul(x,D)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(S,D)|0,n=n+Math.imul(S,H)|0,r=r+Math.imul(k,J)|0,i=(i=i+Math.imul(k,U)|0)+Math.imul(A,J)|0,n=n+Math.imul(A,U)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(_,G)|0,n=n+Math.imul(_,Q)|0,r=r+Math.imul(c,V)|0,i=(i=i+Math.imul(c,W)|0)+Math.imul(w,V)|0,n=n+Math.imul(w,W)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(g,X)|0,n=n+Math.imul(g,Y)|0;var wt=(u+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(p,$)|0))<<13)|0;u=((n=n+Math.imul(p,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,O),i=(i=Math.imul(I,j))+Math.imul(z,O)|0,n=Math.imul(z,j),r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,P)|0)+Math.imul(L,K)|0,n=n+Math.imul(L,P)|0,r=r+Math.imul(q,F)|0,i=(i=i+Math.imul(q,C)|0)+Math.imul(B,F)|0,n=n+Math.imul(B,C)|0,r=r+Math.imul(Z,D)|0,i=(i=i+Math.imul(Z,H)|0)+Math.imul(R,D)|0,n=n+Math.imul(R,H)|0,r=r+Math.imul(x,J)|0,i=(i=i+Math.imul(x,U)|0)+Math.imul(S,J)|0,n=n+Math.imul(S,U)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(A,G)|0,n=n+Math.imul(A,Q)|0,r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,r=r+Math.imul(c,X)|0,i=(i=i+Math.imul(c,Y)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,Y)|0;var yt=(u+(r=r+Math.imul(v,$)|0)|0)+((8191&(i=(i=i+Math.imul(v,tt)|0)+Math.imul(g,$)|0))<<13)|0;u=((n=n+Math.imul(g,tt)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(I,K),i=(i=Math.imul(I,P))+Math.imul(z,K)|0,n=Math.imul(z,P),r=r+Math.imul(N,F)|0,i=(i=i+Math.imul(N,C)|0)+Math.imul(L,F)|0,n=n+Math.imul(L,C)|0,r=r+Math.imul(q,D)|0,i=(i=i+Math.imul(q,H)|0)+Math.imul(B,D)|0,n=n+Math.imul(B,H)|0,r=r+Math.imul(Z,J)|0,i=(i=i+Math.imul(Z,U)|0)+Math.imul(R,J)|0,n=n+Math.imul(R,U)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(S,G)|0,n=n+Math.imul(S,Q)|0,r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,V)|0,n=n+Math.imul(A,W)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0;var bt=(u+(r=r+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(w,$)|0))<<13)|0;u=((n=n+Math.imul(w,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(I,F),i=(i=Math.imul(I,C))+Math.imul(z,F)|0,n=Math.imul(z,C),r=r+Math.imul(N,D)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(L,D)|0,n=n+Math.imul(L,H)|0,r=r+Math.imul(q,J)|0,i=(i=i+Math.imul(q,U)|0)+Math.imul(B,J)|0,n=n+Math.imul(B,U)|0,r=r+Math.imul(Z,G)|0,i=(i=i+Math.imul(Z,Q)|0)+Math.imul(R,G)|0,n=n+Math.imul(R,Q)|0,r=r+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(A,X)|0,n=n+Math.imul(A,Y)|0;var _t=(u+(r=r+Math.imul(b,$)|0)|0)+((8191&(i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0))<<13)|0;u=((n=n+Math.imul(_,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(I,D),i=(i=Math.imul(I,H))+Math.imul(z,D)|0,n=Math.imul(z,H),r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,U)|0)+Math.imul(L,J)|0,n=n+Math.imul(L,U)|0,r=r+Math.imul(q,G)|0,i=(i=i+Math.imul(q,Q)|0)+Math.imul(B,G)|0,n=n+Math.imul(B,Q)|0,r=r+Math.imul(Z,V)|0,i=(i=i+Math.imul(Z,W)|0)+Math.imul(R,V)|0,n=n+Math.imul(R,W)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0;var kt=(u+(r=r+Math.imul(k,$)|0)|0)+((8191&(i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,$)|0))<<13)|0;u=((n=n+Math.imul(A,tt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(I,J),i=(i=Math.imul(I,U))+Math.imul(z,J)|0,n=Math.imul(z,U),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(L,G)|0,n=n+Math.imul(L,Q)|0,r=r+Math.imul(q,V)|0,i=(i=i+Math.imul(q,W)|0)+Math.imul(B,V)|0,n=n+Math.imul(B,W)|0,r=r+Math.imul(Z,X)|0,i=(i=i+Math.imul(Z,Y)|0)+Math.imul(R,X)|0,n=n+Math.imul(R,Y)|0;var At=(u+(r=r+Math.imul(x,$)|0)|0)+((8191&(i=(i=i+Math.imul(x,tt)|0)+Math.imul(S,$)|0))<<13)|0;u=((n=n+Math.imul(S,tt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(I,G),i=(i=Math.imul(I,Q))+Math.imul(z,G)|0,n=Math.imul(z,Q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,n=n+Math.imul(L,W)|0,r=r+Math.imul(q,X)|0,i=(i=i+Math.imul(q,Y)|0)+Math.imul(B,X)|0,n=n+Math.imul(B,Y)|0;var xt=(u+(r=r+Math.imul(Z,$)|0)|0)+((8191&(i=(i=i+Math.imul(Z,tt)|0)+Math.imul(R,$)|0))<<13)|0;u=((n=n+Math.imul(R,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(I,V),i=(i=Math.imul(I,W))+Math.imul(z,V)|0,n=Math.imul(z,W),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,Y)|0;var St=(u+(r=r+Math.imul(q,$)|0)|0)+((8191&(i=(i=i+Math.imul(q,tt)|0)+Math.imul(B,$)|0))<<13)|0;u=((n=n+Math.imul(B,tt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,X),i=(i=Math.imul(I,Y))+Math.imul(z,X)|0,n=Math.imul(z,Y);var Zt=(u+(r=r+Math.imul(N,$)|0)|0)+((8191&(i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,$)|0))<<13)|0;u=((n=n+Math.imul(L,tt)|0)+(i>>>13)|0)+(Zt>>>26)|0,Zt&=67108863;var Rt=(u+(r=Math.imul(I,$))|0)+((8191&(i=(i=Math.imul(I,tt))+Math.imul(z,$)|0))<<13)|0;return u=((n=Math.imul(z,tt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,a[0]=lt,a[1]=mt,a[2]=ft,a[3]=dt,a[4]=pt,a[5]=Mt,a[6]=vt,a[7]=gt,a[8]=ct,a[9]=wt,a[10]=yt,a[11]=bt,a[12]=_t,a[13]=kt,a[14]=At,a[15]=xt,a[16]=St,a[17]=Zt,a[18]=Rt,u!==0&&(a[19]=u,e.length++),e};function Et(t,h,e){return new ht().mulp(t,h,e)}function ht(t,h){this.x=t,this.y=h}Math.imul||(zt=It),s.prototype.mulTo=function(t,h){var e,r=this.length+t.length;return e=this.length===10&&t.length===10?zt(this,t,h):r<63?It(this,t,h):r<1024?function(i,n,o){o.negative=n.negative^i.negative,o.length=i.length+n.length;for(var l=0,a=0,u=0;u>>26)|0)>>>26,f&=67108863}o.words[u]=d,l=f,f=a}return l!==0?o.words[u]=l:o.length--,o.strip()}(this,t,h):Et(this,t,h),e},ht.prototype.makeRBT=function(t){for(var h=Array(t),e=s.prototype._countBits(t)-1,r=0;r>=1;return r},ht.prototype.permute=function(t,h,e,r,i,n){for(var o=0;o>>=1)i++;return 1<>>=13,e[2*n+1]=8191&i,i>>>=13;for(n=2*h;n>=26,h+=r/67108864|0,h+=i>>>26,this.words[e]=67108863&i}return h!==0&&(this.words[e]=h,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var h=function(n){for(var o=Array(n.bitLength()),l=0;l>>u}return o}(t);if(h.length===0)return new s(1);for(var e=this,r=0;r=0);var h,e=t%26,r=(t-e)/26,i=67108863>>>26-e<<26-e;if(e!==0){var n=0;for(h=0;h>>26-e}n&&(this.words[h]=n,this.length++)}if(r!==0){for(h=this.length-1;h>=0;h--)this.words[h+r]=this.words[h];for(h=0;h=0),r=h?(h-h%26)/26:0;var i=t%26,n=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<n)for(this.length-=n,a=0;a=0&&(u!==0||a>=r);a--){var f=0|this.words[a];this.words[a]=u<<26-i|f>>>i,u=f&o}return l&&u!==0&&(l.words[l.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,h,e){return m(this.negative===0),this.iushrn(t,h,e)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){m(typeof t=="number"&&t>=0);var h=t%26,e=(t-h)/26,r=1<=0);var h=t%26,e=(t-h)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=e)return this;if(h!==0&&e++,this.length=Math.min(e,this.length),h!==0){var r=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(t){if(m(typeof t=="number"),m(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(l/67108864|0),this.words[r+e]=67108863&i}for(;r>26,this.words[r+e]=67108863&i;if(o===0)return this.strip();for(m(o===-1),o=0,r=0;r>26,this.words[r]=67108863&i;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,h){var e=(this.length,t.length),r=this.clone(),i=t,n=0|i.words[i.length-1];(e=26-this._countBits(n))!==0&&(i=i.ushln(e),r.iushln(e),n=0|i.words[i.length-1]);var o,l=r.length-i.length;if(h!=="mod"){(o=new s(null)).length=l+1,o.words=Array(o.length);for(var a=0;a=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/n|0,67108863),r._ishlnsubmul(i,d,f);r.negative!==0;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);o&&(o.words[f]=d)}return o&&o.strip(),r.strip(),h!=="div"&&e!==0&&r.iushrn(e),{div:o||null,mod:r}},s.prototype.divmod=function(t,h,e){return m(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&t.negative===0?(n=this.neg().divmod(t,h),h!=="mod"&&(r=n.div.neg()),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.iadd(t)),{div:r,mod:i}):this.negative===0&&t.negative!==0?(n=this.divmod(t.neg(),h),h!=="mod"&&(r=n.div.neg()),{div:r,mod:n.mod}):this.negative&t.negative?(n=this.neg().divmod(t.neg(),h),h!=="div"&&(i=n.mod.neg(),e&&i.negative!==0&&i.isub(t)),{div:n.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:t.length===1?h==="div"?{div:this.divn(t.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,h);var r,i,n},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var h=this.divmod(t);if(h.mod.isZero())return h.div;var e=h.div.negative!==0?h.mod.isub(t):h.mod,r=t.ushrn(1),i=t.andln(1),n=e.cmp(r);return n<0||i===1&&n===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modn=function(t){m(t<=67108863);for(var h=(1<<26)%t,e=0,r=this.length-1;r>=0;r--)e=(h*e+(0|this.words[r]))%t;return e},s.prototype.idivn=function(t){m(t<=67108863);for(var h=0,e=this.length-1;e>=0;e--){var r=(0|this.words[e])+67108864*h;this.words[e]=r/t|0,h=r%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r=new s(1),i=new s(0),n=new s(0),o=new s(1),l=0;h.isEven()&&e.isEven();)h.iushrn(1),e.iushrn(1),++l;for(var a=e.clone(),u=h.clone();!h.isZero();){for(var f=0,d=1;!(h.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(h.iushrn(f);f-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(a),i.isub(u)),r.iushrn(1),i.iushrn(1);for(var p=0,M=1;!(e.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(a),o.isub(u)),n.iushrn(1),o.iushrn(1);h.cmp(e)>=0?(h.isub(e),r.isub(n),i.isub(o)):(e.isub(h),n.isub(r),o.isub(i))}return{a:n,b:o,gcd:e.iushln(l)}},s.prototype._invmp=function(t){m(t.negative===0),m(!t.isZero());var h=this,e=t.clone();h=h.negative!==0?h.umod(t):h.clone();for(var r,i=new s(1),n=new s(0),o=e.clone();h.cmpn(1)>0&&e.cmpn(1)>0;){for(var l=0,a=1;!(h.words[0]&a)&&l<26;++l,a<<=1);if(l>0)for(h.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(o),i.iushrn(1);for(var u=0,f=1;!(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)n.isOdd()&&n.iadd(o),n.iushrn(1);h.cmp(e)>=0?(h.isub(e),i.isub(n)):(e.isub(h),n.isub(i))}return(r=h.cmpn(1)===0?i:n).cmpn(0)<0&&r.iadd(t),r},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var h=this.clone(),e=t.clone();h.negative=0,e.negative=0;for(var r=0;h.isEven()&&e.isEven();r++)h.iushrn(1),e.iushrn(1);for(;;){for(;h.isEven();)h.iushrn(1);for(;e.isEven();)e.iushrn(1);var i=h.cmp(e);if(i<0){var n=h;h=e,e=n}else if(i===0||e.cmpn(1)===0)break;h.isub(e)}return e.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){m(typeof t=="number");var h=t%26,e=(t-h)/26,r=1<>>26,o&=67108863,this.words[n]=o}return i!==0&&(this.words[n]=i,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(t){var h,e=t<0;if(this.negative!==0&&!e)return-1;if(this.negative===0&&e)return 1;if(this.strip(),this.length>1)h=1;else{e&&(t=-t),m(t<=67108863,"Number is too big");var r=0|this.words[0];h=r===t?0:rt.length)return 1;if(this.length=0;e--){var r=0|this.words[e],i=0|t.words[e];if(r!==i){ri&&(h=1);break}}return h},s.prototype.gtn=function(t){return this.cmpn(t)===1},s.prototype.gt=function(t){return this.cmp(t)===1},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return this.cmpn(t)===-1},s.prototype.lt=function(t){return this.cmp(t)===-1},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return this.cmpn(t)===0},s.prototype.eq=function(t){return this.cmp(t)===0},s.red=function(t){return new y(t)},s.prototype.toRed=function(t){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return m(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return m(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var ut={k256:null,p224:null,p192:null,p25519:null};function it(t,h){this.name=t,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function st(){it.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Tt(){it.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function Ot(){it.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function at(){it.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if(typeof t=="string"){var h=s._prime(t);this.m=h.p,this.prime=h}else m(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function nt(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}it.prototype._tmp=function(){var t=new s(null);return t.words=Array(Math.ceil(this.n/13)),t},it.prototype.ireduce=function(t){var h,e=t;do this.split(e,this.tmp),h=(e=(e=this.imulK(e)).iadd(this.tmp)).bitLength();while(h>this.n);var r=h0?e.isub(this.p):e.strip(),e},it.prototype.split=function(t,h){t.iushrn(this.n,0,h)},it.prototype.imulK=function(t){return t.imul(this.k)},et(st,it),st.prototype.split=function(t,h){for(var e=4194303,r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,n===0&&t.length>10?t.length-=10:t.length-=9},st.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var h=0,e=0;e>>=26,t.words[e]=i,h=r}return h!==0&&(t.words[t.length++]=h),t},s._prime=function(t){if(ut[t])return ut[t];var h;if(t==="k256")h=new st;else if(t==="p224")h=new Tt;else if(t==="p192")h=new Ot;else{if(t!=="p25519")throw Error("Unknown prime "+t);h=new at}return ut[t]=h,h},y.prototype._verify1=function(t){m(t.negative===0,"red works only with positives"),m(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,h){m((t.negative|h.negative)==0,"red works only with positives"),m(t.red&&t.red===h.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,h){this._verify2(t,h);var e=t.add(h);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},y.prototype.iadd=function(t,h){this._verify2(t,h);var e=t.iadd(h);return e.cmp(this.m)>=0&&e.isub(this.m),e},y.prototype.sub=function(t,h){this._verify2(t,h);var e=t.sub(h);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},y.prototype.isub=function(t,h){this._verify2(t,h);var e=t.isub(h);return e.cmpn(0)<0&&e.iadd(this.m),e},y.prototype.shl=function(t,h){return this._verify1(t),this.imod(t.ushln(h))},y.prototype.imul=function(t,h){return this._verify2(t,h),this.imod(t.imul(h))},y.prototype.mul=function(t,h){return this._verify2(t,h),this.imod(t.mul(h))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var h=this.m.andln(3);if(m(h%2==1),h===3){var e=this.m.add(new s(1)).iushrn(2);return this.pow(t,e)}for(var r=this.m.subn(1),i=0;!r.isZero()&&r.andln(1)===0;)i++,r.iushrn(1);m(!r.isZero());var n=new s(1).toRed(this),o=n.redNeg(),l=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new s(2*a*a).toRed(this);this.pow(a,l).cmp(o)!==0;)a.redIAdd(o);for(var u=this.pow(a,r),f=this.pow(t,r.addn(1).iushrn(1)),d=this.pow(t,r),p=i;d.cmp(n)!==0;){for(var M=d,v=0;M.cmp(n)!==0;v++)M=M.redSqr();m(v=0;r--){for(var a=h.words[r],u=l-1;u>=0;u--){var f=a>>u&1;i!==e[0]&&(i=this.sqr(i)),f!==0||n!==0?(n<<=1,n|=f,(++o===4||r===0&&u===0)&&(i=this.mul(i,e[n]),o=0,n=0)):o=0}l=26}return i},y.prototype.convertTo=function(t){var h=t.umod(this.m);return h===t?h.clone():h},y.prototype.convertFrom=function(t){var h=t.clone();return h.red=null,h},s.mont=function(t){return new nt(t)},et(nt,y),nt.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},nt.prototype.convertFrom=function(t){var h=this.imod(t.mul(this.rinv));return h.red=null,h},nt.prototype.imul=function(t,h){if(t.isZero()||h.isZero())return t.words[0]=0,t.length=1,t;var e=t.imul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.mul=function(t,h){if(t.isZero()||h.isZero())return new s(0)._forceRed(this);var e=t.mul(h),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(r).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},nt.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}})(ii,si)});export{ui as __moduleExports,ui as default}; diff --git a/assets/elliptic.min-DvUVzpm1.js b/assets/elliptic.min-fis8C3PY.js similarity index 99% rename from assets/elliptic.min-DvUVzpm1.js rename to assets/elliptic.min-fis8C3PY.js index b3744be..a8b5210 100644 --- a/assets/elliptic.min-DvUVzpm1.js +++ b/assets/elliptic.min-fis8C3PY.js @@ -1 +1 @@ -import{r as Y,J as ae,i as T,d as j,g as Ie,x as Me,A as xe,M as Be,z as Ce,y as _e,Y as De}from"./index-Bixp21LW.js";import u from"./bn.min-DsLKjtAs.js";/*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */var be,F=Y(function(e,f){var d=f;function t(c){return c.length===1?"0"+c:c}function a(c){for(var r="",b=0;b>8,s=255&n;o?b.push(o,s):b.push(s)}return b},d.zero2=t,d.toHex=a,d.encode=function(c,r){return r==="hex"?a(c):c}}),v=Y(function(e,f){var d=f;d.assert=ae,d.toArray=F.toArray,d.zero2=F.zero2,d.toHex=F.toHex,d.encode=F.encode,d.getNAF=function(t,a){for(var c=[],r=1<=0;){var i;if(b.isOdd()){var n=b.andln(r-1);i=n>(r>>1)-1?(r>>1)-n:n,b.isubn(i)}else i=0;c.push(i);for(var o=b.cmpn(0)!==0&&b.andln(r-1)===0?a+1:1,s=1;s0||a.cmpn(-b)>0;){var i,n,o,s=t.andln(3)+r&3,h=a.andln(3)+b&3;s===3&&(s=-1),h===3&&(h=-1),(1&s)==0?i=0:i=(o=t.andln(7)+r&7)!==3&&o!==5||h!==2?s:-s,c[0].push(i),(1&h)==0?n=0:n=(o=a.andln(7)+b&7)!==3&&o!==5||s!==2?h:-h,c[1].push(n),2*r===i+1&&(r=1-r),2*b===n+1&&(b=1-b),t.iushrn(1),a.iushrn(1)}return c},d.cachedProperty=function(t,a,c){var r="_"+a;t.prototype[a]=function(){return this[r]!==void 0?this[r]:this[r]=c.call(this)}},d.parseBytes=function(t){return typeof t=="string"?d.toArray(t,"hex"):t},d.intFromLE=function(t){return new u(t,"hex","le")}}),ce=function(e){return be||(be=new k(null)),be.generate(e)};function k(e){this.rand=e}var Fe=k;if(k.prototype.generate=function(e){return this._rand(e)},k.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var f=new Uint8Array(e),d=0;d0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var x=N;function _(e,f){this.curve=e,this.type=f,this.precomputed=null}N.prototype.point=function(){throw Error("Not implemented")},N.prototype.validate=function(){throw Error("Not implemented")},N.prototype._fixedNafMul=function(e,f){$(e.precomputed);var d=e._getDoubles(),t=Z(f,1),a=(1<=r;f--)b=(b<<1)+t[f];c.push(b)}for(var i=this.jpoint(null,null,null),n=this.jpoint(null,null,null),o=a;o>0;o--){for(r=0;r=0;b--){for(f=0;b>=0&&c[b]===0;b--)f++;if(b>=0&&f++,r=r.dblp(f),b<0)break;var i=c[b];$(i!==0),r=e.type==="affine"?i>0?r.mixedAdd(a[i-1>>1]):r.mixedAdd(a[-i-1>>1].neg()):i>0?r.add(a[i-1>>1]):r.add(a[-i-1>>1].neg())}return e.type==="affine"?r.toP():r},N.prototype._wnafMulAdd=function(e,f,d,t,a){for(var c=this._wnafT1,r=this._wnafT2,b=this._wnafT3,i=0,n=0;n=1;n-=2){var s=n-1,h=n;if(c[s]===1&&c[h]===1){var p=[f[s],null,null,f[h]];f[s].y.cmp(f[h].y)===0?(p[1]=f[s].add(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg())):f[s].y.cmp(f[h].y.redNeg())===0?(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].add(f[h].neg())):(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=ze(d[s],d[h]);i=Math.max(w[0].length,i),b[s]=Array(i),b[h]=Array(i);for(var l=0;l=0;n--){for(var re=0;n>=0;){var pe=!0;for(l=0;l=0&&re++,R=R.dblp(re),n<0)break;for(l=0;l0?X=r[l][W-1>>1]:W<0&&(X=r[l][-W-1>>1].neg()),R=X.type==="affine"?R.mixedAdd(X):R.add(X))}}for(n=0;n=Math.ceil((e.bitLength()+1)/f.step)},_.prototype._getDoubles=function(e,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var d=[this],t=this,a=0;a=0&&(c=f,r=d),t.negative&&(t=t.neg(),a=a.neg()),c.negative&&(c=c.neg(),r=r.neg()),[{a:t,b:a},{a:c,b:r}]},D.prototype._endoSplit=function(e){var f=this.endo.basis,d=f[0],t=f[1],a=t.b.mul(e).divRound(this.n),c=d.b.neg().mul(e).divRound(this.n),r=a.mul(d.a),b=c.mul(t.a),i=a.mul(d.b),n=c.mul(t.b);return{k1:e.sub(r).sub(b),k2:i.add(n).neg()}},D.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),t=d.redSqrt();if(t.redSqr().redSub(d).cmp(this.zero)!==0)throw Error("invalid point");var a=t.fromRed().isOdd();return(f&&!a||!f&&a)&&(t=t.redNeg()),this.point(e,t)},D.prototype.validate=function(e){if(e.inf)return!0;var f=e.x,d=e.y,t=this.a.redMul(f),a=f.redSqr().redMul(f).redIAdd(t).redIAdd(this.b);return d.redSqr().redISub(a).cmpn(0)===0},D.prototype._endoWnafMulAdd=function(e,f,d){for(var t=this._endoWnafT1,a=this._endoWnafT2,c=0;c":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var f=this.y.redSub(e.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(e.x).redInvm()));var d=f.redSqr().redISub(this.x).redISub(e.x),t=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,t)},A.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var f=this.curve.a,d=this.x.redSqr(),t=e.redInvm(),a=d.redAdd(d).redIAdd(d).redIAdd(f).redMul(t),c=a.redSqr().redISub(this.x.redAdd(this.x)),r=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,r)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new u(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},A.prototype.mulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a):this.curve._wnafMulAdd(1,t,a,2)},A.prototype.jmulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a,!0):this.curve._wnafMulAdd(1,t,a,2,!0)},A.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},A.prototype.neg=function(e){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var d=this.precomputed,t=function(a){return a.neg()};f.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(t)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(t)}}}return f},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},T(I,x.BasePoint),D.prototype.jpoint=function(e,f,d){return new I(this,e,f,d)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),f=e.redSqr(),d=this.x.redMul(f),t=this.y.redMul(f).redMul(e);return this.curve.point(d,t)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var f=e.z.redSqr(),d=this.z.redSqr(),t=this.x.redMul(f),a=e.x.redMul(d),c=this.y.redMul(f.redMul(e.z)),r=e.y.redMul(d.redMul(this.z)),b=t.redSub(a),i=c.redSub(r);if(b.cmpn(0)===0)return i.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var n=b.redSqr(),o=n.redMul(b),s=t.redMul(n),h=i.redSqr().redIAdd(o).redISub(s).redISub(s),p=i.redMul(s.redISub(h)).redISub(c.redMul(o)),y=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(h,p,y)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var f=this.z.redSqr(),d=this.x,t=e.x.redMul(f),a=this.y,c=e.y.redMul(f).redMul(this.z),r=d.redSub(t),b=a.redSub(c);if(r.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),n=i.redMul(r),o=d.redMul(i),s=b.redSqr().redIAdd(n).redISub(o).redISub(o),h=b.redMul(o.redISub(s)).redISub(a.redMul(n)),p=this.z.redMul(r);return this.curve.jpoint(s,h,p)},I.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var f=this,d=0;d=0)return!1;if(d.redIAdd(a),this.x.cmp(d)===0)return!0}},I.prototype.inspect=function(){return this.isInfinity()?"":""},I.prototype.isInfinity=function(){return this.z.cmpn(0)===0},T(K,x);var Pe=K;function g(e,f,d){x.BasePoint.call(this,e,"projective"),f===null&&d===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new u(f,16),this.z=new u(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}K.prototype.validate=function(e){var f=e.normalize().x,d=f.redSqr(),t=d.redMul(f).redAdd(d.redMul(this.a)).redAdd(f);return t.redSqrt().redSqr().cmp(t)===0},T(g,x.BasePoint),K.prototype.decodePoint=function(e,f){if((e=v.toArray(e,f)).length===33&&e[0]===64&&(e=e.slice(1,33).reverse()),e.length!==32)throw Error("Unknown point compression format");return this.point(e,1)},K.prototype.point=function(e,f){return new g(this,e,f)},K.prototype.pointFromJSON=function(e){return g.fromJSON(this,e)},g.prototype.precompute=function(){},g.prototype._encode=function(e){var f=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",f)):this.getX().toArray("be",f)},g.fromJSON=function(e,f){return new g(e,f[0],f[1]||e.one)},g.prototype.inspect=function(){return this.isInfinity()?"":""},g.prototype.isInfinity=function(){return this.z.cmpn(0)===0},g.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),f=this.x.redSub(this.z).redSqr(),d=e.redSub(f),t=e.redMul(f),a=d.redMul(f.redAdd(this.curve.a24.redMul(d)));return this.curve.point(t,a)},g.prototype.add=function(){throw Error("Not supported on Montgomery curve")},g.prototype.diffAdd=function(e,f){var d=this.x.redAdd(this.z),t=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z).redMul(d),r=a.redMul(t),b=f.z.redMul(c.redAdd(r).redSqr()),i=f.x.redMul(c.redISub(r).redSqr());return this.curve.point(b,i)},g.prototype.mul=function(e){for(var f=(e=new u(e,16)).clone(),d=this,t=this.curve.point(null,null),a=[];f.cmpn(0)!==0;f.iushrn(1))a.push(f.andln(1));for(var c=a.length-1;c>=0;c--)a[c]===0?(d=d.diffAdd(t,this),t=t.dbl()):(t=d.diffAdd(t,this),d=d.dbl());return t},g.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},g.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Ne=v.assert;function z(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,x.call(this,"edwards",e),this.a=new u(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new u(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new u(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Ne(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|e.c)==1}T(z,x);var ke=z;function m(e,f,d,t,a){x.BasePoint.call(this,e,"projective"),f===null&&d===null&&t===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new u(f,16),this.y=new u(d,16),this.z=t?new u(t,16):this.curve.one,this.t=a&&new u(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}z.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},z.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},z.prototype.jpoint=function(e,f,d,t){return this.point(e,f,d,t)},z.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=this.c2.redSub(this.a.redMul(d)),a=this.one.redSub(this.c2.redMul(this.d).redMul(d)),c=t.redMul(a.redInvm()),r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");var b=r.fromRed().isOdd();return(f&&!b||!f&&b)&&(r=r.redNeg()),this.point(e,r)},z.prototype.pointFromY=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=d.redSub(this.c2),a=d.redMul(this.d).redMul(this.c2).redSub(this.a),c=t.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(f)throw Error("invalid point");return this.point(this.zero,e)}var r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");return r.fromRed().isOdd()!==f&&(r=r.redNeg()),this.point(r,e)},z.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var f=e.x.redSqr(),d=e.y.redSqr(),t=f.redMul(this.a).redAdd(d),a=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(d)));return t.cmp(a)===0},T(m,x.BasePoint),z.prototype.pointFromJSON=function(e){return m.fromJSON(this,e)},z.prototype.point=function(e,f,d,t){return new m(this,e,f,d,t)},m.fromJSON=function(e,f){return new m(e,f[0],f[1],f[2])},m.prototype.inspect=function(){return this.isInfinity()?"":""},m.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},m.prototype._extDbl=function(){var e=this.x.redSqr(),f=this.y.redSqr(),d=this.z.redSqr();d=d.redIAdd(d);var t=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(f),c=t.redAdd(f),r=c.redSub(d),b=t.redSub(f),i=a.redMul(r),n=c.redMul(b),o=a.redMul(b),s=r.redMul(c);return this.curve.point(i,n,s,o)},m.prototype._projDbl=function(){var e,f,d,t=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var r=(n=this.curve._mulA(a)).redAdd(c);if(this.zOne)e=t.redSub(a).redSub(c).redMul(r.redSub(this.curve.two)),f=r.redMul(n.redSub(c)),d=r.redSqr().redSub(r).redSub(r);else{var b=this.z.redSqr(),i=r.redSub(b).redISub(b);e=t.redSub(a).redISub(c).redMul(i),f=r.redMul(n.redSub(c)),d=r.redMul(i)}}else{var n=a.redAdd(c);b=this.curve._mulC(this.z).redSqr(),i=n.redSub(b).redSub(b),e=this.curve._mulC(t.redISub(n)).redMul(i),f=this.curve._mulC(n).redMul(a.redISub(c)),d=n.redMul(i)}return this.curve.point(e,f,d)},m.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},m.prototype._extAdd=function(e){var f=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),d=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),t=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),c=d.redSub(f),r=a.redSub(t),b=a.redAdd(t),i=d.redAdd(f),n=c.redMul(r),o=b.redMul(i),s=c.redMul(i),h=r.redMul(b);return this.curve.point(n,o,h,s)},m.prototype._projAdd=function(e){var f,d,t=this.z.redMul(e.z),a=t.redSqr(),c=this.x.redMul(e.x),r=this.y.redMul(e.y),b=this.curve.d.redMul(c).redMul(r),i=a.redSub(b),n=a.redAdd(b),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(c).redISub(r),s=t.redMul(i).redMul(o);return this.curve.twisted?(f=t.redMul(n).redMul(r.redSub(this.curve._mulA(c))),d=i.redMul(n)):(f=t.redMul(n).redMul(r.redSub(c)),d=this.curve._mulC(i).redMul(n)),this.curve.point(s,f,d)},m.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},m.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},m.prototype.mulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!1)},m.prototype.jmulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!0)},m.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},m.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},m.prototype.getX=function(){return this.normalize(),this.x.fromRed()},m.prototype.getY=function(){return this.normalize(),this.y.fromRed()},m.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},m.prototype.eqXToP=function(e){var f=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;for(var d=e.clone(),t=this.curve.redN.redMul(this.z);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(t),this.x.cmp(f)===0)return!0}},m.prototype.toP=m.prototype.normalize,m.prototype.mixedAdd=m.prototype.add;var de=Y(function(e,f){var d=f;d.base=x,d.short=Re,d.mont=Pe,d.edwards=ke}),ie=j.rotl32,G=j.sum32,Oe=j.sum32_5,je=xe.ft_1,we=Ie.BlockHash,Le=[1518500249,1859775393,2400959708,3395469782];function q(){if(!(this instanceof q))return new q;we.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}j.inherits(q,we);var Je=q;q.blockSize=512,q.outSize=160,q.hmacStrength=80,q.padLength=64,q.prototype._update=function(e,f){for(var d=this.W,t=0;t<16;t++)d[t]=e[f+t];for(;tthis.blockSize&&(e=new this.Hash().update(e).digest()),ae(e.length<=this.blockSize);for(var f=e.length;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(f,d,t)}var ue=O;O.prototype._init=function(e,f,d){var t=e.concat(f).concat(d);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(d||[])),this._reseed=1},O.prototype.generate=function(e,f,d,t){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");typeof f!="string"&&(t=d,d=f,f=null),d&&(d=F.toArray(d,t||"hex"),this._update(d));for(var a=[];a.length"};var Ke=v.assert;function te(e,f){if(e instanceof te)return e;this._importDER(e,f)||(Ke(e.r&&e.s,"Signature without r or s"),this.r=new u(e.r,16),this.s=new u(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ee=te;function Ue(){this.place=0}function se(e,f){var d=e[f.place++];if(!(128&d))return d;for(var t=15&d,a=0,c=0,r=f.place;c>>3);for(e.push(128|d);--d;)e.push(f>>>(d<<3)&255);e.push(f)}}te.prototype._importDER=function(e,f){e=v.toArray(e,f);var d=new Ue;if(e[d.place++]!==48||se(e,d)+d.place!==e.length||e[d.place++]!==2)return!1;var t=se(e,d),a=e.slice(d.place,t+d.place);if(d.place+=t,e[d.place++]!==2)return!1;var c=se(e,d);if(e.length!==c+d.place)return!1;var r=e.slice(d.place,c+d.place);return a[0]===0&&128&a[1]&&(a=a.slice(1)),r[0]===0&&128&r[1]&&(r=r.slice(1)),this.r=new u(a),this.s=new u(r),this.recoveryParam=null,!0},te.prototype.toDER=function(e){var f=this.r.toArray(),d=this.s.toArray();for(128&f[0]&&(f=[0].concat(f)),128&d[0]&&(d=[0].concat(d)),f=ye(f),d=ye(d);!(d[0]||128&d[1]);)d=d.slice(1);var t=[2];oe(t,f.length),(t=t.concat(f)).push(2),oe(t,d.length);var a=t.concat(d),c=[48];return oe(c,a.length),c=c.concat(a),v.encode(c,e)};var Ee=v.assert;function B(e){if(!(this instanceof B))return new B(e);typeof e=="string"&&(Ee(Q.hasOwnProperty(e),"Unknown curve "+e),e=Q[e]),e instanceof Q.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ye=B;B.prototype.keyPair=function(e){return new ne(this,e)},B.prototype.keyFromPrivate=function(e,f){return ne.fromPrivate(this,e,f)},B.prototype.keyFromPublic=function(e,f){return ne.fromPublic(this,e,f)},B.prototype.genKeyPair=function(e){e||(e={});var f=new ue({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ce(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if(this.curve.type==="mont"){var d=new u(f.generate(32));return this.keyFromPrivate(d)}for(var t=this.n.byteLength(),a=this.n.sub(new u(2));;)if(!((d=new u(f.generate(t))).cmp(a)>0))return d.iaddn(1),this.keyFromPrivate(d)},B.prototype._truncateToN=function(e,f,d){var t=(d=d||8*e.byteLength())-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!f&&e.cmp(this.n)>=0?e.sub(this.n):e},B.prototype.truncateMsg=function(e){var f;return e instanceof Uint8Array?(f=8*e.byteLength,e=this._truncateToN(new u(e,16),!1,f)):typeof e=="string"?(f=4*e.length,e=this._truncateToN(new u(e,16),!1,f)):e=this._truncateToN(new u(e,16)),e},B.prototype.sign=function(e,f,d,t){typeof d=="object"&&(t=d,d=null),t||(t={}),f=this.keyFromPrivate(f,d),e=this.truncateMsg(e);for(var a=this.n.byteLength(),c=f.getPrivate().toArray("be",a),r=e.toArray("be",a),b=new ue({hash:this.hash,entropy:c,nonce:r,pers:t.pers,persEnc:t.persEnc||"utf8"}),i=this.n.sub(new u(1)),n=0;;n++){var o=t.k?t.k(n):new u(b.generate(this.n.byteLength()));if(!((o=this._truncateToN(o,!0)).cmpn(1)<=0||o.cmp(i)>=0)){var s=this.g.mul(o);if(!s.isInfinity()){var h=s.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var y=o.invm(this.n).mul(p.mul(f.getPrivate()).iadd(e));if((y=y.umod(this.n)).cmpn(0)!==0){var w=(s.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return t.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new ee({r:p,s:y,recoveryParam:w})}}}}}},B.prototype.verify=function(e,f,d,t){return d=this.keyFromPublic(d,t),f=new ee(f,"hex"),this._verify(this.truncateMsg(e),f,d)||this._verify(this._truncateToN(new u(e,16)),f,d)},B.prototype._verify=function(e,f,d){var t=f.r,a=f.s;if(t.cmpn(1)<0||t.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c,r=a.invm(this.n),b=r.mul(e).umod(this.n),i=r.mul(t).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(b,d.getPublic(),i)).isInfinity()&&c.eqXToP(t):!(c=this.g.mulAdd(b,d.getPublic(),i)).isInfinity()&&c.getX().umod(this.n).cmp(t)===0},B.prototype.recoverPubKey=function(e,f,d,t){Ee((3&d)===d,"The recovery param is more than two bits"),f=new ee(f,t);var a=this.n,c=new u(e),r=f.r,b=f.s,i=1&d,n=d>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&n)throw Error("Unable to find sencond key candinate");r=n?this.curve.pointFromX(r.add(this.curve.n),i):this.curve.pointFromX(r,i);var o=f.r.invm(a),s=a.sub(c).mul(o).umod(a),h=b.mul(o).umod(a);return this.g.mulAdd(s,r,h)},B.prototype.getKeyRecoveryParam=function(e,f,d,t){if((f=new ee(f,t)).recoveryParam!==null)return f.recoveryParam;for(var a=0;a<4;a++){var c;try{c=this.recoverPubKey(e,f,a)}catch{continue}if(c.eq(d))return a}throw Error("Unable to find valid recovery factor")};var me=v.assert,Ae=v.parseBytes,V=v.cachedProperty;function S(e,f){if(this.eddsa=e,f.hasOwnProperty("secret")&&(this._secret=Ae(f.secret)),e.isPoint(f.pub))this._pub=f.pub;else if(this._pubBytes=Ae(f.pub),this._pubBytes&&this._pubBytes.length===33&&this._pubBytes[0]===64&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&this._pubBytes.length!==32)throw Error("Unknown point compression format")}S.fromPublic=function(e,f){return f instanceof S?f:new S(e,{pub:f})},S.fromSecret=function(e,f){return f instanceof S?f:new S(e,{secret:f})},S.prototype.secret=function(){return this._secret},V(S,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),V(S,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),V(S,"privBytes",function(){var e=this.eddsa,f=this.hash(),d=e.encodingLength-1,t=f.slice(0,e.encodingLength);return t[0]&=248,t[d]&=127,t[d]|=64,t}),V(S,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),V(S,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),V(S,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),S.prototype.sign=function(e){return me(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},S.prototype.verify=function(e,f){return this.eddsa.verify(e,f,this)},S.prototype.getSecret=function(e){return me(this._secret,"KeyPair is public only"),v.encode(this.secret(),e)},S.prototype.getPublic=function(e,f){return v.encode((f?[64]:[]).concat(this.pubBytes()),e)};var he=S,He=v.assert,fe=v.cachedProperty,We=v.parseBytes;function J(e,f){this.eddsa=e,typeof f!="object"&&(f=We(f)),Array.isArray(f)&&(f={R:f.slice(0,e.encodingLength),S:f.slice(e.encodingLength)}),He(f.R&&f.S,"Signature without R or S"),e.isPoint(f.R)&&(this._R=f.R),f.S instanceof u&&(this._S=f.S),this._Rencoded=Array.isArray(f.R)?f.R:f.Rencoded,this._Sencoded=Array.isArray(f.S)?f.S:f.Sencoded}fe(J,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),fe(J,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),fe(J,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),fe(J,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),J.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},J.prototype.toHex=function(){return v.encode(this.toBytes(),"hex").toUpperCase()};var ge=J,Ge=v.assert,Se=v.parseBytes;function M(e){if(Ge(e==="ed25519","only tested with ed25519 so far"),!(this instanceof M))return new M(e);e=Q[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=C.sha512}var Qe=M;M.prototype.sign=function(e,f){e=Se(e);var d=this.keyFromSecret(f),t=this.hashInt(d.messagePrefix(),e),a=this.g.mul(t),c=this.encodePoint(a),r=this.hashInt(c,d.pubBytes(),e).mul(d.priv()),b=t.add(r).umod(this.curve.n);return this.makeSignature({R:a,S:b,Rencoded:c})},M.prototype.verify=function(e,f,d){e=Se(e),f=this.makeSignature(f);var t=this.keyFromPublic(d),a=this.hashInt(f.Rencoded(),t.pubBytes(),e),c=this.g.mul(f.S());return f.R().add(t.pub().mul(a)).eq(c)},M.prototype.hashInt=function(){for(var e=this.hash(),f=0;f>8,s=255&n;o?b.push(o,s):b.push(s)}return b},d.zero2=t,d.toHex=a,d.encode=function(c,r){return r==="hex"?a(c):c}}),v=Y(function(e,f){var d=f;d.assert=ae,d.toArray=F.toArray,d.zero2=F.zero2,d.toHex=F.toHex,d.encode=F.encode,d.getNAF=function(t,a){for(var c=[],r=1<=0;){var i;if(b.isOdd()){var n=b.andln(r-1);i=n>(r>>1)-1?(r>>1)-n:n,b.isubn(i)}else i=0;c.push(i);for(var o=b.cmpn(0)!==0&&b.andln(r-1)===0?a+1:1,s=1;s0||a.cmpn(-b)>0;){var i,n,o,s=t.andln(3)+r&3,h=a.andln(3)+b&3;s===3&&(s=-1),h===3&&(h=-1),(1&s)==0?i=0:i=(o=t.andln(7)+r&7)!==3&&o!==5||h!==2?s:-s,c[0].push(i),(1&h)==0?n=0:n=(o=a.andln(7)+b&7)!==3&&o!==5||s!==2?h:-h,c[1].push(n),2*r===i+1&&(r=1-r),2*b===n+1&&(b=1-b),t.iushrn(1),a.iushrn(1)}return c},d.cachedProperty=function(t,a,c){var r="_"+a;t.prototype[a]=function(){return this[r]!==void 0?this[r]:this[r]=c.call(this)}},d.parseBytes=function(t){return typeof t=="string"?d.toArray(t,"hex"):t},d.intFromLE=function(t){return new u(t,"hex","le")}}),ce=function(e){return be||(be=new k(null)),be.generate(e)};function k(e){this.rand=e}var Fe=k;if(k.prototype.generate=function(e){return this._rand(e)},k.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var f=new Uint8Array(e),d=0;d0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var x=N;function _(e,f){this.curve=e,this.type=f,this.precomputed=null}N.prototype.point=function(){throw Error("Not implemented")},N.prototype.validate=function(){throw Error("Not implemented")},N.prototype._fixedNafMul=function(e,f){$(e.precomputed);var d=e._getDoubles(),t=Z(f,1),a=(1<=r;f--)b=(b<<1)+t[f];c.push(b)}for(var i=this.jpoint(null,null,null),n=this.jpoint(null,null,null),o=a;o>0;o--){for(r=0;r=0;b--){for(f=0;b>=0&&c[b]===0;b--)f++;if(b>=0&&f++,r=r.dblp(f),b<0)break;var i=c[b];$(i!==0),r=e.type==="affine"?i>0?r.mixedAdd(a[i-1>>1]):r.mixedAdd(a[-i-1>>1].neg()):i>0?r.add(a[i-1>>1]):r.add(a[-i-1>>1].neg())}return e.type==="affine"?r.toP():r},N.prototype._wnafMulAdd=function(e,f,d,t,a){for(var c=this._wnafT1,r=this._wnafT2,b=this._wnafT3,i=0,n=0;n=1;n-=2){var s=n-1,h=n;if(c[s]===1&&c[h]===1){var p=[f[s],null,null,f[h]];f[s].y.cmp(f[h].y)===0?(p[1]=f[s].add(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg())):f[s].y.cmp(f[h].y.redNeg())===0?(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].add(f[h].neg())):(p[1]=f[s].toJ().mixedAdd(f[h]),p[2]=f[s].toJ().mixedAdd(f[h].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=ze(d[s],d[h]);i=Math.max(w[0].length,i),b[s]=Array(i),b[h]=Array(i);for(var l=0;l=0;n--){for(var re=0;n>=0;){var pe=!0;for(l=0;l=0&&re++,R=R.dblp(re),n<0)break;for(l=0;l0?X=r[l][W-1>>1]:W<0&&(X=r[l][-W-1>>1].neg()),R=X.type==="affine"?R.mixedAdd(X):R.add(X))}}for(n=0;n=Math.ceil((e.bitLength()+1)/f.step)},_.prototype._getDoubles=function(e,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var d=[this],t=this,a=0;a=0&&(c=f,r=d),t.negative&&(t=t.neg(),a=a.neg()),c.negative&&(c=c.neg(),r=r.neg()),[{a:t,b:a},{a:c,b:r}]},D.prototype._endoSplit=function(e){var f=this.endo.basis,d=f[0],t=f[1],a=t.b.mul(e).divRound(this.n),c=d.b.neg().mul(e).divRound(this.n),r=a.mul(d.a),b=c.mul(t.a),i=a.mul(d.b),n=c.mul(t.b);return{k1:e.sub(r).sub(b),k2:i.add(n).neg()}},D.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),t=d.redSqrt();if(t.redSqr().redSub(d).cmp(this.zero)!==0)throw Error("invalid point");var a=t.fromRed().isOdd();return(f&&!a||!f&&a)&&(t=t.redNeg()),this.point(e,t)},D.prototype.validate=function(e){if(e.inf)return!0;var f=e.x,d=e.y,t=this.a.redMul(f),a=f.redSqr().redMul(f).redIAdd(t).redIAdd(this.b);return d.redSqr().redISub(a).cmpn(0)===0},D.prototype._endoWnafMulAdd=function(e,f,d){for(var t=this._endoWnafT1,a=this._endoWnafT2,c=0;c":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var f=this.y.redSub(e.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(e.x).redInvm()));var d=f.redSqr().redISub(this.x).redISub(e.x),t=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,t)},A.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var f=this.curve.a,d=this.x.redSqr(),t=e.redInvm(),a=d.redAdd(d).redIAdd(d).redIAdd(f).redMul(t),c=a.redSqr().redISub(this.x.redAdd(this.x)),r=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,r)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new u(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},A.prototype.mulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a):this.curve._wnafMulAdd(1,t,a,2)},A.prototype.jmulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a,!0):this.curve._wnafMulAdd(1,t,a,2,!0)},A.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},A.prototype.neg=function(e){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var d=this.precomputed,t=function(a){return a.neg()};f.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(t)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(t)}}}return f},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},T(I,x.BasePoint),D.prototype.jpoint=function(e,f,d){return new I(this,e,f,d)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),f=e.redSqr(),d=this.x.redMul(f),t=this.y.redMul(f).redMul(e);return this.curve.point(d,t)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var f=e.z.redSqr(),d=this.z.redSqr(),t=this.x.redMul(f),a=e.x.redMul(d),c=this.y.redMul(f.redMul(e.z)),r=e.y.redMul(d.redMul(this.z)),b=t.redSub(a),i=c.redSub(r);if(b.cmpn(0)===0)return i.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var n=b.redSqr(),o=n.redMul(b),s=t.redMul(n),h=i.redSqr().redIAdd(o).redISub(s).redISub(s),p=i.redMul(s.redISub(h)).redISub(c.redMul(o)),y=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(h,p,y)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var f=this.z.redSqr(),d=this.x,t=e.x.redMul(f),a=this.y,c=e.y.redMul(f).redMul(this.z),r=d.redSub(t),b=a.redSub(c);if(r.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),n=i.redMul(r),o=d.redMul(i),s=b.redSqr().redIAdd(n).redISub(o).redISub(o),h=b.redMul(o.redISub(s)).redISub(a.redMul(n)),p=this.z.redMul(r);return this.curve.jpoint(s,h,p)},I.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var f=this,d=0;d=0)return!1;if(d.redIAdd(a),this.x.cmp(d)===0)return!0}},I.prototype.inspect=function(){return this.isInfinity()?"":""},I.prototype.isInfinity=function(){return this.z.cmpn(0)===0},T(K,x);var Pe=K;function g(e,f,d){x.BasePoint.call(this,e,"projective"),f===null&&d===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new u(f,16),this.z=new u(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}K.prototype.validate=function(e){var f=e.normalize().x,d=f.redSqr(),t=d.redMul(f).redAdd(d.redMul(this.a)).redAdd(f);return t.redSqrt().redSqr().cmp(t)===0},T(g,x.BasePoint),K.prototype.decodePoint=function(e,f){if((e=v.toArray(e,f)).length===33&&e[0]===64&&(e=e.slice(1,33).reverse()),e.length!==32)throw Error("Unknown point compression format");return this.point(e,1)},K.prototype.point=function(e,f){return new g(this,e,f)},K.prototype.pointFromJSON=function(e){return g.fromJSON(this,e)},g.prototype.precompute=function(){},g.prototype._encode=function(e){var f=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",f)):this.getX().toArray("be",f)},g.fromJSON=function(e,f){return new g(e,f[0],f[1]||e.one)},g.prototype.inspect=function(){return this.isInfinity()?"":""},g.prototype.isInfinity=function(){return this.z.cmpn(0)===0},g.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),f=this.x.redSub(this.z).redSqr(),d=e.redSub(f),t=e.redMul(f),a=d.redMul(f.redAdd(this.curve.a24.redMul(d)));return this.curve.point(t,a)},g.prototype.add=function(){throw Error("Not supported on Montgomery curve")},g.prototype.diffAdd=function(e,f){var d=this.x.redAdd(this.z),t=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z).redMul(d),r=a.redMul(t),b=f.z.redMul(c.redAdd(r).redSqr()),i=f.x.redMul(c.redISub(r).redSqr());return this.curve.point(b,i)},g.prototype.mul=function(e){for(var f=(e=new u(e,16)).clone(),d=this,t=this.curve.point(null,null),a=[];f.cmpn(0)!==0;f.iushrn(1))a.push(f.andln(1));for(var c=a.length-1;c>=0;c--)a[c]===0?(d=d.diffAdd(t,this),t=t.dbl()):(t=d.diffAdd(t,this),d=d.dbl());return t},g.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},g.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},g.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Ne=v.assert;function z(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,x.call(this,"edwards",e),this.a=new u(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new u(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new u(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Ne(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|e.c)==1}T(z,x);var ke=z;function m(e,f,d,t,a){x.BasePoint.call(this,e,"projective"),f===null&&d===null&&t===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new u(f,16),this.y=new u(d,16),this.z=t?new u(t,16):this.curve.one,this.t=a&&new u(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}z.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},z.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},z.prototype.jpoint=function(e,f,d,t){return this.point(e,f,d,t)},z.prototype.pointFromX=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=this.c2.redSub(this.a.redMul(d)),a=this.one.redSub(this.c2.redMul(this.d).redMul(d)),c=t.redMul(a.redInvm()),r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");var b=r.fromRed().isOdd();return(f&&!b||!f&&b)&&(r=r.redNeg()),this.point(e,r)},z.prototype.pointFromY=function(e,f){(e=new u(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=d.redSub(this.c2),a=d.redMul(this.d).redMul(this.c2).redSub(this.a),c=t.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(f)throw Error("invalid point");return this.point(this.zero,e)}var r=c.redSqrt();if(r.redSqr().redSub(c).cmp(this.zero)!==0)throw Error("invalid point");return r.fromRed().isOdd()!==f&&(r=r.redNeg()),this.point(r,e)},z.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var f=e.x.redSqr(),d=e.y.redSqr(),t=f.redMul(this.a).redAdd(d),a=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(d)));return t.cmp(a)===0},T(m,x.BasePoint),z.prototype.pointFromJSON=function(e){return m.fromJSON(this,e)},z.prototype.point=function(e,f,d,t){return new m(this,e,f,d,t)},m.fromJSON=function(e,f){return new m(e,f[0],f[1],f[2])},m.prototype.inspect=function(){return this.isInfinity()?"":""},m.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},m.prototype._extDbl=function(){var e=this.x.redSqr(),f=this.y.redSqr(),d=this.z.redSqr();d=d.redIAdd(d);var t=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(f),c=t.redAdd(f),r=c.redSub(d),b=t.redSub(f),i=a.redMul(r),n=c.redMul(b),o=a.redMul(b),s=r.redMul(c);return this.curve.point(i,n,s,o)},m.prototype._projDbl=function(){var e,f,d,t=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var r=(n=this.curve._mulA(a)).redAdd(c);if(this.zOne)e=t.redSub(a).redSub(c).redMul(r.redSub(this.curve.two)),f=r.redMul(n.redSub(c)),d=r.redSqr().redSub(r).redSub(r);else{var b=this.z.redSqr(),i=r.redSub(b).redISub(b);e=t.redSub(a).redISub(c).redMul(i),f=r.redMul(n.redSub(c)),d=r.redMul(i)}}else{var n=a.redAdd(c);b=this.curve._mulC(this.z).redSqr(),i=n.redSub(b).redSub(b),e=this.curve._mulC(t.redISub(n)).redMul(i),f=this.curve._mulC(n).redMul(a.redISub(c)),d=n.redMul(i)}return this.curve.point(e,f,d)},m.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},m.prototype._extAdd=function(e){var f=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),d=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),t=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),c=d.redSub(f),r=a.redSub(t),b=a.redAdd(t),i=d.redAdd(f),n=c.redMul(r),o=b.redMul(i),s=c.redMul(i),h=r.redMul(b);return this.curve.point(n,o,h,s)},m.prototype._projAdd=function(e){var f,d,t=this.z.redMul(e.z),a=t.redSqr(),c=this.x.redMul(e.x),r=this.y.redMul(e.y),b=this.curve.d.redMul(c).redMul(r),i=a.redSub(b),n=a.redAdd(b),o=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(c).redISub(r),s=t.redMul(i).redMul(o);return this.curve.twisted?(f=t.redMul(n).redMul(r.redSub(this.curve._mulA(c))),d=i.redMul(n)):(f=t.redMul(n).redMul(r.redSub(c)),d=this.curve._mulC(i).redMul(n)),this.curve.point(s,f,d)},m.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},m.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},m.prototype.mulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!1)},m.prototype.jmulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!0)},m.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},m.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},m.prototype.getX=function(){return this.normalize(),this.x.fromRed()},m.prototype.getY=function(){return this.normalize(),this.y.fromRed()},m.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},m.prototype.eqXToP=function(e){var f=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;for(var d=e.clone(),t=this.curve.redN.redMul(this.z);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(t),this.x.cmp(f)===0)return!0}},m.prototype.toP=m.prototype.normalize,m.prototype.mixedAdd=m.prototype.add;var de=Y(function(e,f){var d=f;d.base=x,d.short=Re,d.mont=Pe,d.edwards=ke}),ie=j.rotl32,G=j.sum32,Oe=j.sum32_5,je=xe.ft_1,we=Ie.BlockHash,Le=[1518500249,1859775393,2400959708,3395469782];function q(){if(!(this instanceof q))return new q;we.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}j.inherits(q,we);var Je=q;q.blockSize=512,q.outSize=160,q.hmacStrength=80,q.padLength=64,q.prototype._update=function(e,f){for(var d=this.W,t=0;t<16;t++)d[t]=e[f+t];for(;tthis.blockSize&&(e=new this.Hash().update(e).digest()),ae(e.length<=this.blockSize);for(var f=e.length;f=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(f,d,t)}var ue=O;O.prototype._init=function(e,f,d){var t=e.concat(f).concat(d);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(d||[])),this._reseed=1},O.prototype.generate=function(e,f,d,t){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");typeof f!="string"&&(t=d,d=f,f=null),d&&(d=F.toArray(d,t||"hex"),this._update(d));for(var a=[];a.length"};var Ke=v.assert;function te(e,f){if(e instanceof te)return e;this._importDER(e,f)||(Ke(e.r&&e.s,"Signature without r or s"),this.r=new u(e.r,16),this.s=new u(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ee=te;function Ue(){this.place=0}function se(e,f){var d=e[f.place++];if(!(128&d))return d;for(var t=15&d,a=0,c=0,r=f.place;c>>3);for(e.push(128|d);--d;)e.push(f>>>(d<<3)&255);e.push(f)}}te.prototype._importDER=function(e,f){e=v.toArray(e,f);var d=new Ue;if(e[d.place++]!==48||se(e,d)+d.place!==e.length||e[d.place++]!==2)return!1;var t=se(e,d),a=e.slice(d.place,t+d.place);if(d.place+=t,e[d.place++]!==2)return!1;var c=se(e,d);if(e.length!==c+d.place)return!1;var r=e.slice(d.place,c+d.place);return a[0]===0&&128&a[1]&&(a=a.slice(1)),r[0]===0&&128&r[1]&&(r=r.slice(1)),this.r=new u(a),this.s=new u(r),this.recoveryParam=null,!0},te.prototype.toDER=function(e){var f=this.r.toArray(),d=this.s.toArray();for(128&f[0]&&(f=[0].concat(f)),128&d[0]&&(d=[0].concat(d)),f=ye(f),d=ye(d);!(d[0]||128&d[1]);)d=d.slice(1);var t=[2];oe(t,f.length),(t=t.concat(f)).push(2),oe(t,d.length);var a=t.concat(d),c=[48];return oe(c,a.length),c=c.concat(a),v.encode(c,e)};var Ee=v.assert;function B(e){if(!(this instanceof B))return new B(e);typeof e=="string"&&(Ee(Q.hasOwnProperty(e),"Unknown curve "+e),e=Q[e]),e instanceof Q.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ye=B;B.prototype.keyPair=function(e){return new ne(this,e)},B.prototype.keyFromPrivate=function(e,f){return ne.fromPrivate(this,e,f)},B.prototype.keyFromPublic=function(e,f){return ne.fromPublic(this,e,f)},B.prototype.genKeyPair=function(e){e||(e={});var f=new ue({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ce(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if(this.curve.type==="mont"){var d=new u(f.generate(32));return this.keyFromPrivate(d)}for(var t=this.n.byteLength(),a=this.n.sub(new u(2));;)if(!((d=new u(f.generate(t))).cmp(a)>0))return d.iaddn(1),this.keyFromPrivate(d)},B.prototype._truncateToN=function(e,f,d){var t=(d=d||8*e.byteLength())-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!f&&e.cmp(this.n)>=0?e.sub(this.n):e},B.prototype.truncateMsg=function(e){var f;return e instanceof Uint8Array?(f=8*e.byteLength,e=this._truncateToN(new u(e,16),!1,f)):typeof e=="string"?(f=4*e.length,e=this._truncateToN(new u(e,16),!1,f)):e=this._truncateToN(new u(e,16)),e},B.prototype.sign=function(e,f,d,t){typeof d=="object"&&(t=d,d=null),t||(t={}),f=this.keyFromPrivate(f,d),e=this.truncateMsg(e);for(var a=this.n.byteLength(),c=f.getPrivate().toArray("be",a),r=e.toArray("be",a),b=new ue({hash:this.hash,entropy:c,nonce:r,pers:t.pers,persEnc:t.persEnc||"utf8"}),i=this.n.sub(new u(1)),n=0;;n++){var o=t.k?t.k(n):new u(b.generate(this.n.byteLength()));if(!((o=this._truncateToN(o,!0)).cmpn(1)<=0||o.cmp(i)>=0)){var s=this.g.mul(o);if(!s.isInfinity()){var h=s.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var y=o.invm(this.n).mul(p.mul(f.getPrivate()).iadd(e));if((y=y.umod(this.n)).cmpn(0)!==0){var w=(s.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return t.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new ee({r:p,s:y,recoveryParam:w})}}}}}},B.prototype.verify=function(e,f,d,t){return d=this.keyFromPublic(d,t),f=new ee(f,"hex"),this._verify(this.truncateMsg(e),f,d)||this._verify(this._truncateToN(new u(e,16)),f,d)},B.prototype._verify=function(e,f,d){var t=f.r,a=f.s;if(t.cmpn(1)<0||t.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c,r=a.invm(this.n),b=r.mul(e).umod(this.n),i=r.mul(t).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(b,d.getPublic(),i)).isInfinity()&&c.eqXToP(t):!(c=this.g.mulAdd(b,d.getPublic(),i)).isInfinity()&&c.getX().umod(this.n).cmp(t)===0},B.prototype.recoverPubKey=function(e,f,d,t){Ee((3&d)===d,"The recovery param is more than two bits"),f=new ee(f,t);var a=this.n,c=new u(e),r=f.r,b=f.s,i=1&d,n=d>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&n)throw Error("Unable to find sencond key candinate");r=n?this.curve.pointFromX(r.add(this.curve.n),i):this.curve.pointFromX(r,i);var o=f.r.invm(a),s=a.sub(c).mul(o).umod(a),h=b.mul(o).umod(a);return this.g.mulAdd(s,r,h)},B.prototype.getKeyRecoveryParam=function(e,f,d,t){if((f=new ee(f,t)).recoveryParam!==null)return f.recoveryParam;for(var a=0;a<4;a++){var c;try{c=this.recoverPubKey(e,f,a)}catch{continue}if(c.eq(d))return a}throw Error("Unable to find valid recovery factor")};var me=v.assert,Ae=v.parseBytes,V=v.cachedProperty;function S(e,f){if(this.eddsa=e,f.hasOwnProperty("secret")&&(this._secret=Ae(f.secret)),e.isPoint(f.pub))this._pub=f.pub;else if(this._pubBytes=Ae(f.pub),this._pubBytes&&this._pubBytes.length===33&&this._pubBytes[0]===64&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&this._pubBytes.length!==32)throw Error("Unknown point compression format")}S.fromPublic=function(e,f){return f instanceof S?f:new S(e,{pub:f})},S.fromSecret=function(e,f){return f instanceof S?f:new S(e,{secret:f})},S.prototype.secret=function(){return this._secret},V(S,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),V(S,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),V(S,"privBytes",function(){var e=this.eddsa,f=this.hash(),d=e.encodingLength-1,t=f.slice(0,e.encodingLength);return t[0]&=248,t[d]&=127,t[d]|=64,t}),V(S,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),V(S,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),V(S,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),S.prototype.sign=function(e){return me(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},S.prototype.verify=function(e,f){return this.eddsa.verify(e,f,this)},S.prototype.getSecret=function(e){return me(this._secret,"KeyPair is public only"),v.encode(this.secret(),e)},S.prototype.getPublic=function(e,f){return v.encode((f?[64]:[]).concat(this.pubBytes()),e)};var he=S,He=v.assert,fe=v.cachedProperty,We=v.parseBytes;function J(e,f){this.eddsa=e,typeof f!="object"&&(f=We(f)),Array.isArray(f)&&(f={R:f.slice(0,e.encodingLength),S:f.slice(e.encodingLength)}),He(f.R&&f.S,"Signature without R or S"),e.isPoint(f.R)&&(this._R=f.R),f.S instanceof u&&(this._S=f.S),this._Rencoded=Array.isArray(f.R)?f.R:f.Rencoded,this._Sencoded=Array.isArray(f.S)?f.S:f.Sencoded}fe(J,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),fe(J,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),fe(J,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),fe(J,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),J.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},J.prototype.toHex=function(){return v.encode(this.toBytes(),"hex").toUpperCase()};var ge=J,Ge=v.assert,Se=v.parseBytes;function M(e){if(Ge(e==="ed25519","only tested with ed25519 so far"),!(this instanceof M))return new M(e);e=Q[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=C.sha512}var Qe=M;M.prototype.sign=function(e,f){e=Se(e);var d=this.keyFromSecret(f),t=this.hashInt(d.messagePrefix(),e),a=this.g.mul(t),c=this.encodePoint(a),r=this.hashInt(c,d.pubBytes(),e).mul(d.priv()),b=t.add(r).umod(this.curve.n);return this.makeSignature({R:a,S:b,Rencoded:c})},M.prototype.verify=function(e,f,d){e=Se(e),f=this.makeSignature(f);var t=this.keyFromPublic(d),a=this.hashInt(f.Rencoded(),t.pubBytes(),e),c=this.g.mul(f.S());return f.R().add(t.pub().mul(a)).eq(c)},M.prototype.hashInt=function(){for(var e=this.hash(),f=0;fi.map(i=>d[i]); -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();var s5=Object.defineProperty,o5=(r,e,t)=>e in r?s5(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$r=(r,e,t)=>(o5(r,typeof e!="symbol"?e+"":e,t),t);function c5(r,e){const t=Object.create(null),n=r.split(",");for(let i=0;i!!t[i]}function g2(r){if(he(r)){const e={};for(let t=0;t{if(t){const n=t.split(h5);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function m2(r){let e="";if(Pn(r))e=r;else if(he(r))for(let t=0;t_n(t,e))}const d5=Object.assign,y5=(r,e)=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)},p5=Object.prototype.hasOwnProperty,Na=(r,e)=>p5.call(r,e),he=Array.isArray,H1=r=>w2(r)==="[object Map]",ls=r=>r instanceof Date,Pn=r=>typeof r=="string",Ma=r=>typeof r=="symbol",Lr=r=>r!==null&&typeof r=="object",g5=Object.prototype.toString,w2=r=>g5.call(r),m5=r=>w2(r).slice(8,-1),$a=r=>Pn(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,b2=r=>{const e=Object.create(null);return t=>e[t]||(e[t]=r(t))},w5=/-(\w)/g,b5=b2(r=>r.replace(w5,(e,t)=>t?t.toUpperCase():"")),k5=/\B([A-Z])/g,k2=b2(r=>r.replace(k5,"-$1").toLowerCase()),v5=(r,e)=>!Object.is(r,e),fs=r=>{const e=parseFloat(r);return isNaN(e)?r:e};let _5;function v2(r,e){e=e||_5,e&&e.active&&e.effects.push(r)}const _2=r=>{const e=new Set(r);return e.w=0,e.n=0,e},A2=r=>(r.w&Or)>0,E2=r=>(r.n&Or)>0,A5=({deps:r})=>{if(r.length)for(let e=0;e{const{deps:e}=r;if(e.length){let t=0;for(let n=0;n0?Nn[e-1]:void 0}}stop(){this.active&&(ys(this),this.onStop&&this.onStop(),this.active=!1)}};function ys(r){const{deps:e}=r;if(e.length){for(let t=0;t{(c==="length"||c>=n)&&o.push(u)});else switch(t!==void 0&&o.push(s.get(t)),e){case"add":he(r)?$a(t)&&o.push(s.get("length")):(o.push(s.get(Gi)),H1(r)&&o.push(s.get(ds)));break;case"delete":he(r)||(o.push(s.get(Gi)),H1(r)&&o.push(s.get(ds)));break;case"set":H1(r)&&o.push(s.get(Gi));break}if(o.length===1)o[0]&&ps(o[0]);else{const u=[];for(const c of o)c&&u.push(...c);ps(_2(u))}}function ps(r,e){for(const t of he(r)?r:[...r])(t!==tn||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const I5=c5("__proto__,__v_isRef,__isVue"),P2=new Set(Object.getOwnPropertyNames(Symbol).map(r=>Symbol[r]).filter(Ma)),T5=U2(),B5=U2(!0),gs=R5();function R5(){const r={};return["includes","indexOf","lastIndexOf"].forEach(e=>{r[e]=function(...t){const n=en(this);for(let a=0,s=this.length;a{r[e]=function(...t){K5();const n=en(this)[e].apply(this,t);return S2(),n}}),r}function U2(r=!1,e=!1){return function(t,n,i){if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_raw"&&i===(r?e?j5:x2:e?H5:K2).get(t))return t;const a=he(t);if(!r&&a&&Na(gs,n))return Reflect.get(gs,n,i);const s=Reflect.get(t,n,i);return(Ma(n)?P2.has(n):I5(n))||(r||v1(t,"get",n),e)?s:va(s)?!a||!$a(n)?s.value:s:Lr(s)?r?W5(s):_1(s):s}}const z5=L5();function L5(r=!1){return function(e,t,n,i){let a=e[t];if(!r&&!V5(n)&&(n=en(n),a=en(a),!he(e)&&va(a)&&!va(n)))return a.value=n,!0;const s=he(e)&&$a(t)?Number(t)Z5.then(r),ms=r=>{t1.includes(r)||t1.push(r),_a||(_a=!0,A1(X5))},X5=()=>{for(const r of t1)r();t1.length=0,_a=!1},Y5=/^(spellcheck|draggable|form|list|type)$/,Aa=({el:r,get:e,effect:t,arg:n,modifiers:i})=>{let a;n==="class"&&(r._class=r.className),t(()=>{let s=e();if(n)i?.camel&&(n=b5(n)),j1(r,n,s,a);else{for(const o in s)j1(r,o,s[o],a&&a[o]);for(const o in a)(!s||!(o in s))&&j1(r,o,null)}a=s})},j1=(r,e,t,n)=>{if(e==="class")r.setAttribute("class",m2(r._class?[r._class,t]:t)||"");else if(e==="style"){t=g2(t);const{style:i}=r;if(!t)r.removeAttribute("style");else if(Pn(t))t!==n&&(i.cssText=t);else{for(const a in t)Ea(i,a,t[a]);if(n&&!Pn(n))for(const a in n)t[a]==null&&Ea(i,a,"")}}else!(r instanceof SVGElement)&&e in r&&!Y5.test(e)?(r[e]=t,e==="value"&&(r._value=t)):e==="true-value"?r._trueValue=t:e==="false-value"?r._falseValue=t:t!=null?r.setAttribute(e,t):r.removeAttribute(e)},ws=/\s*!important$/,Ea=(r,e,t)=>{he(t)?t.forEach(n=>Ea(r,e,n)):e.startsWith("--")?r.setProperty(e,t):ws.test(t)?r.setProperty(k2(e),t.replace(ws,""),"important"):r[e]=t},Dr=(r,e)=>{const t=r.getAttribute(e);return t!=null&&r.removeAttribute(e),t},Er=(r,e,t,n)=>{r.addEventListener(e,t,n)},Q5=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,J5=["ctrl","shift","alt","meta"],tc={stop:r=>r.stopPropagation(),prevent:r=>r.preventDefault(),self:r=>r.target!==r.currentTarget,ctrl:r=>!r.ctrlKey,shift:r=>!r.shiftKey,alt:r=>!r.altKey,meta:r=>!r.metaKey,left:r=>"button"in r&&r.button!==0,middle:r=>"button"in r&&r.button!==1,right:r=>"button"in r&&r.button!==2,exact:(r,e)=>J5.some(t=>r[`${t}Key`]&&!e[t])},C2=({el:r,get:e,exp:t,arg:n,modifiers:i})=>{if(!n)return;let a=Q5.test(t)?e(`(e => ${t}(e))`):e(`($event => { ${t} })`);if(n==="vue:mounted"){A1(a);return}else if(n==="vue:unmounted")return()=>a();if(i){n==="click"&&(i.right&&(n="contextmenu"),i.middle&&(n="mouseup"));const s=a;a=o=>{if(!("key"in o&&!(k2(o.key)in i))){for(const u in i){const c=tc[u];if(c&&c(o,i))return}return s(o)}}}Er(r,n,a,i)},ec=({el:r,get:e,effect:t})=>{const n=r.style.display;t(()=>{r.style.display=e()?n:"none"})},I2=({el:r,get:e,effect:t})=>{t(()=>{r.textContent=T2(e())})},T2=r=>r==null?"":Lr(r)?JSON.stringify(r,null,2):String(r),rc=({el:r,get:e,effect:t})=>{t(()=>{r.innerHTML=e()})},nc=({el:r,exp:e,get:t,effect:n,modifiers:i})=>{const a=r.type,s=t(`(val) => { ${e} = val }`),{trim:o,number:u=a==="number"}=i||{};if(r.tagName==="SELECT"){const c=r;Er(r,"change",()=>{const h=Array.prototype.filter.call(c.options,l=>l.selected).map(l=>u?fs(vr(l)):vr(l));s(c.multiple?h:h[0])}),n(()=>{const h=t(),l=c.multiple;for(let w=0,y=c.options.length;w-1:K.selected=h.has(C);else if(_n(vr(K),h)){c.selectedIndex!==w&&(c.selectedIndex=w);return}}!l&&c.selectedIndex!==-1&&(c.selectedIndex=-1)})}else if(a==="checkbox"){Er(r,"change",()=>{const h=t(),l=r.checked;if(he(h)){const w=vr(r),y=F1(h,w),K=y!==-1;if(l&&!K)s(h.concat(w));else if(!l&&K){const C=[...h];C.splice(y,1),s(C)}}else s(bs(r,l))});let c;n(()=>{const h=t();he(h)?r.checked=F1(h,vr(r))>-1:h!==c&&(r.checked=_n(h,bs(r,!0))),c=h})}else if(a==="radio"){Er(r,"change",()=>{s(vr(r))});let c;n(()=>{const h=t();h!==c&&(r.checked=_n(h,vr(r)))})}else{const c=h=>o?h.trim():u?fs(h):h;Er(r,"compositionstart",ic),Er(r,"compositionend",ac),Er(r,i?.lazy?"change":"input",()=>{r.composing||s(c(r.value))}),o&&Er(r,"change",()=>{r.value=r.value.trim()}),n(()=>{if(r.composing)return;const h=r.value,l=t();document.activeElement===r&&c(h)===l||h!==l&&(r.value=l)})}},vr=r=>"_value"in r?r._value:r.value,bs=(r,e)=>{const t=e?"_trueValue":"_falseValue";return t in r?r[t]:e},ic=r=>{r.target.composing=!0},ac=r=>{const e=r.target;e.composing&&(e.composing=!1,sc(e,"input"))},sc=(r,e)=>{const t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),r.dispatchEvent(t)},ks=Object.create(null),di=(r,e,t)=>B2(r,`return(${e})`,t),B2=(r,e,t)=>{const n=ks[e]||(ks[e]=oc(e));try{return n(r,t)}catch(i){console.error(i)}},oc=r=>{try{return new Function("$data","$el",`with($data){${r}}`)}catch(e){return console.error(`${e.message} in expression: ${r}`),()=>{}}},cc=({el:r,ctx:e,exp:t,effect:n})=>{A1(()=>n(()=>B2(e.scope,t,r)))},uc={bind:Aa,on:C2,show:ec,text:I2,html:rc,model:nc,effect:cc},hc=(r,e,t)=>{const n=r.parentElement,i=new Comment("v-if");n.insertBefore(i,r);const a=[{exp:e,el:r}];let s,o;for(;(s=r.nextElementSibling)&&(o=null,Dr(s,"v-else")===""||(o=Dr(s,"v-else-if")));)n.removeChild(s),a.push({exp:o,el:s});const u=r.nextSibling;n.removeChild(r);let c,h=-1;const l=()=>{c&&(n.insertBefore(i,c.el),c.remove(),c=void 0)};return t.effect(()=>{for(let w=0;w{const n=e.match(lc);if(!n)return;const i=r.nextSibling,a=r.parentElement,s=new Text("");a.insertBefore(s,r),a.removeChild(r);const o=n[2].trim();let u=n[1].trim().replace(fc,"").trim(),c,h=!1,l,w,y="key",K=r.getAttribute(y)||r.getAttribute(y=":key")||r.getAttribute(y="v-bind:key");K&&(r.removeAttribute(y),y==="key"&&(K=JSON.stringify(K)));let C;(C=u.match(vs))&&(u=u.replace(vs,"").trim(),l=C[1].trim(),C[2]&&(w=C[2].trim())),(C=u.match(dc))&&(c=C[1].split(",").map(j=>j.trim()),h=u[0]==="[");let O=!1,F,Y,$;const E=j=>{const V=new Map,Z=[];if(he(j))for(let tt=0;tt{const rt={};c?c.forEach((N,ft)=>rt[N]=V[h?ft:N]):rt[u]=V,tt?(l&&(rt[l]=tt),w&&(rt[w]=Z)):l&&(rt[l]=Z);const dt=O2(t,rt),lt=K?di(dt.scope,K):Z;return j.set(lt,Z),dt.key=lt,dt},H=(j,V)=>{const Z=new Ha(r,j);return Z.key=j.key,Z.insert(a,V),Z};return t.effect(()=>{const j=di(t.scope,o),V=$;if([Y,$]=E(j),!O)F=Y.map(Z=>H(Z,s)),O=!0;else{for(let lt=0;lt{let i;return n(()=>{const a=t();e[a]=r,i&&a!==i&&delete e[i],i=a}),()=>{i&&delete e[i]}},pc=/^(?:v-|:|@)/,gc=/\.([\w-]+)/g;let Sa=!1;const z2=(r,e)=>{const t=r.nodeType;if(t===1){const n=r;if(n.hasAttribute("v-pre"))return;Dr(n,"v-cloak");let i;if(i=Dr(n,"v-if"))return hc(n,i,e);if(i=Dr(n,"v-for"))return yc(n,i,e);if((i=Dr(n,"v-scope"))||i===""){const o=i?di(e.scope,i):{};e=O2(e,o),o.$template&&mc(n,o.$template)}const a=Dr(n,"v-once")!=null;a&&(Sa=!0),(i=Dr(n,"ref"))&&Pa(n,R2,`"${i}"`,e),_s(n,e);const s=[];for(const{name:o,value:u}of[...n.attributes])pc.test(o)&&o!=="v-cloak"&&(o==="v-model"?s.unshift([o,u]):o[0]==="@"||/^v-on\b/.test(o)?s.push([o,u]):As(n,o,u,e));for(const[o,u]of s)As(n,o,u,e);a&&(Sa=!1)}else if(t===3){const n=r.data;if(n.includes(e.delimiters[0])){let i=[],a=0,s;for(;s=e.delimitersRE.exec(n);){const o=n.slice(a,s.index);o&&i.push(JSON.stringify(o)),i.push(`$s(${s[1]})`),a=s.index+s[0].length}a{let t=r.firstChild;for(;t;)t=z2(t,e)||t.nextSibling},As=(r,e,t,n)=>{let i,a,s;if(e=e.replace(gc,(o,u)=>((s||(s={}))[u]=!0,"")),e[0]===":")i=Aa,a=e.slice(1);else if(e[0]==="@")i=C2,a=e.slice(1);else{const o=e.indexOf(":"),u=o>0?e.slice(2,o):e.slice(2);i=uc[u]||n.dirs[u],a=o>0?e.slice(o+1):void 0}i&&(i===Aa&&a==="ref"&&(i=R2),Pa(r,i,t,n,a,s),r.removeAttribute(e))},Pa=(r,e,t,n,i,a)=>{const s=e({el:r,get:(o=t)=>di(n.scope,o,r),effect:n.effect,ctx:n,exp:t,arg:i,modifiers:a});s&&n.cleanups.push(s)},mc=(r,e)=>{if(e[0]==="#"){const t=document.querySelector(e);r.appendChild(t.content.cloneNode(!0));return}r.innerHTML=e},L2=r=>{const e={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...r,scope:r?r.scope:_1({}),dirs:r?r.dirs:{},effects:[],blocks:[],cleanups:[],effect:t=>{if(Sa)return ms(t),t;const n=P5(t,{scheduler:()=>ms(n)});return e.effects.push(n),n}};return e},O2=(r,e={})=>{const t=r.scope,n=Object.create(t);Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n.$refs=Object.create(t.$refs);const i=_1(new Proxy(n,{set(a,s,o,u){return u===i&&!a.hasOwnProperty(s)?Reflect.set(t,s,o):Reflect.set(a,s,o,u)}}));return N2(i),{...r,scope:i}},N2=r=>{for(const e of Object.keys(r))typeof r[e]=="function"&&(r[e]=r[e].bind(r))};let Ha=class{constructor(e,t,n=!1){$r(this,"template"),$r(this,"ctx"),$r(this,"key"),$r(this,"parentCtx"),$r(this,"isFragment"),$r(this,"start"),$r(this,"end"),this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=L2(t)),z2(this.template,this.ctx)}get el(){return this.start||this.template}insert(e,t=null){if(this.isFragment)if(this.start){let n=this.start,i;for(;n&&(i=n.nextSibling,e.insertBefore(n,t),n!==this.end);)n=i}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else e.insertBefore(this.template,t)}remove(){if(this.parentCtx&&y5(this.parentCtx.blocks,this),this.start){const e=this.start.parentNode;let t=this.start,n;for(;t&&(n=t.nextSibling,e.removeChild(t),t!==this.end);)t=n}else this.template.parentNode.removeChild(this.template);this.teardown()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(U5),this.ctx.cleanups.forEach(e=>e())}};const Es=r=>r.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),M2=r=>{const e=L2();if(r&&(e.scope=_1(r),N2(e.scope),r.$delimiters)){const[n,i]=e.delimiters=r.$delimiters;e.delimitersRE=new RegExp(Es(n)+"([^]+?)"+Es(i),"g")}e.scope.$s=T2,e.scope.$nextTick=A1,e.scope.$refs=Object.create(null);let t;return{directive(n,i){return i?(e.dirs[n]=i,this):e.dirs[n]},mount(n){if(typeof n=="string"&&(n=document.querySelector(n),!n))return;n=n||document.documentElement;let i;return n.hasAttribute("v-scope")?i=[n]:i=[...n.querySelectorAll("[v-scope]")].filter(a=>!a.matches("[v-scope] [v-scope]")),i.length||(i=[n]),t=i.map(a=>new Ha(a,e,!0)),this},unmount(){t.forEach(n=>n.teardown())}}},Ss=document.currentScript;Ss&&Ss.hasAttribute("init")&&M2().mount();const wc="modulepreload",bc=function(r,e){return new URL(r,e).href},Ps={},Wr=function(e,t,n){let i=Promise.resolve();if(t&&t.length>0){const a=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");i=Promise.all(t.map(u=>{if(u=bc(u,n),u in Ps)return;Ps[u]=!0;const c=u.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(!!n)for(let y=a.length-1;y>=0;y--){const K=a[y];if(K.href===u&&(!c||K.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const w=document.createElement("link");if(w.rel=c?"stylesheet":wc,c||(w.as="script",w.crossOrigin=""),w.href=u,o&&w.setAttribute("nonce",o),document.head.appendChild(w),c)return new Promise((y,K)=>{w.addEventListener("load",y),w.addEventListener("error",()=>K(new Error(`Unable to preload CSS for ${u}`)))})}))}return i.then(()=>e()).catch(a=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a})},Qe=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},bn=Symbol("doneWritingPromise"),$2=Symbol("doneWritingResolve"),F2=Symbol("doneWritingReject"),Mn=Symbol("readingIndex");class Ze extends Array{constructor(){super(),this[bn]=new Promise((e,t)=>{this[$2]=e,this[F2]=t}),this[bn].catch(()=>{})}}function le(r){return r&&r.getReader&&Array.isArray(r)}function Wn(r){if(!le(r)){const e=r.getWriter(),t=e.releaseLock;return e.releaseLock=()=>{e.closed.catch(function(){}),t.call(e)},e}this.stream=r}Ze.prototype.getReader=function(){return this[Mn]===void 0&&(this[Mn]=0),{read:async()=>(await this[bn],this[Mn]===this.length?{value:void 0,done:!0}:{value:this[this[Mn]++],done:!1})}},Ze.prototype.readToEnd=async function(r){await this[bn];const e=r(this.slice(this[Mn]));return this.length=0,e},Ze.prototype.clone=function(){const r=new Ze;return r[bn]=this[bn].then(()=>{r.push(...this)}),r},Wn.prototype.write=async function(r){this.stream.push(r)},Wn.prototype.close=async function(){this.stream[$2]()},Wn.prototype.abort=async function(r){return this.stream[F2](r),r},Wn.prototype.releaseLock=function(){};const E1=typeof Qe.process=="object"&&typeof Qe.process.versions=="object",Us=E1&&void 0;function ve(r){return le(r)?"array":Qe.ReadableStream&&Qe.ReadableStream.prototype.isPrototypeOf(r)?"web":Kn&&Kn.prototype.isPrototypeOf(r)?"ponyfill":Us&&Us.prototype.isPrototypeOf(r)?"node":!(!r||!r.getReader)&&"web-like"}function S1(r){return Uint8Array.prototype.isPrototypeOf(r)}function H2(r){if(r.length===1)return r[0];let e=0;for(let i=0;i{t||(kc.isBuffer(i)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),n.enqueue(i),e.pause())}),e.on("end",()=>{t||n.close()}),e.on("error",i=>n.error(i))},pull(){e.resume()},cancel(n){t=!0,e.destroy(n)}})};class r extends Ks{constructor(t,n){super(n),this._reader=an(t)}async _read(t){try{for(;;){const{done:n,value:i}=await this._reader.read();if(n){this.push(null);break}if(!this.push(i))break}}catch(n){this.destroy(n)}}async _destroy(t,n){this._reader.cancel(t).then(n,n)}}j2=function(e,t){return new r(e,t)}}const xs=new WeakSet,Gt=Symbol("externalBuffer");function He(r){if(this.stream=r,r[Gt]&&(this[Gt]=r[Gt].slice()),le(r)){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let e=ve(r);if(e==="node"&&(r=P1(r)),e){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{n.closed.catch(function(){}),n.releaseLock()},void(this._cancel=n.cancel.bind(n))}let t=!1;this._read=async()=>t||xs.has(r)?{value:void 0,done:!0}:(t=!0,{value:r,done:!1}),this._releaseLock=()=>{if(t)try{xs.add(r)}catch{}}}He.prototype.read=async function(){return this[Gt]&&this[Gt].length?{done:!1,value:this[Gt].shift()}:this._read()},He.prototype.releaseLock=function(){this[Gt]&&(this.stream[Gt]=this[Gt]),this._releaseLock()},He.prototype.cancel=function(r){return this._cancel(r)},He.prototype.readLine=async function(){let r,e=[];for(;!r;){let{done:t,value:n}=await this.read();if(n+="",t)return e.length?Ue(e):void 0;const i=n.indexOf(` -`)+1;i&&(r=Ue(e.concat(n.substr(0,i))),e=[]),i!==n.length&&e.push(n.substr(i))}return this.unshift(...e),r},He.prototype.readByte=async function(){const{done:r,value:e}=await this.read();if(r)return;const t=e[0];return this.unshift(Ae(e,1)),t},He.prototype.readBytes=async function(r){const e=[];let t=0;for(;;){const{done:n,value:i}=await this.read();if(n)return e.length?Ue(e):void 0;if(e.push(i),t+=i.length,t>=r){const a=Ue(e);return this.unshift(Ae(a,r)),Ae(a,0,r)}}},He.prototype.peekBytes=async function(r){const e=await this.readBytes(r);return this.unshift(e),e},He.prototype.unshift=function(...r){this[Gt]||(this[Gt]=[]),r.length===1&&S1(r[0])&&this[Gt].length&&r[0].length&&this[Gt][0].byteOffset>=r[0].length?this[Gt][0]=new Uint8Array(this[Gt][0].buffer,this[Gt][0].byteOffset-r[0].length,this[Gt][0].byteLength+r[0].length):this[Gt].unshift(...r.filter(e=>e&&e.length))},He.prototype.readToEnd=async function(r=Ue){const e=[];for(;;){const{done:t,value:n}=await this.read();if(t)break;e.push(n)}return r(e)};let Ds,{ReadableStream:Kn,WritableStream:vc,TransformStream:ja}=Qe;const ii=E1&&void 0;function qa(r){let e=ve(r);return e==="node"?P1(r):e==="web"&&Ds?Ds(r):e?r:new Kn({start(t){t.enqueue(r),t.close()}})}function q2(r){if(ve(r))return r;const e=new Ze;return(async()=>{const t=Oe(e);await t.write(r),await t.close()})(),e}function Ue(r){return r.some(e=>ve(e)&&!le(e))?function(e){e=e.map(qa);const t=W2(async function(a){await Promise.all(i.map(s=>_c(s,a)))});let n=Promise.resolve();const i=e.map((a,s)=>pi(a,(o,u)=>(n=n.then(()=>yi(o,t.writable,{preventClose:s!==e.length-1})),n)));return t.readable}(r):r.some(e=>le(e))?function(e){const t=new Ze;let n=Promise.resolve();return e.forEach((i,a)=>(n=n.then(()=>yi(i,t,{preventClose:a!==e.length-1})),n)),t}(r):typeof r[0]=="string"?r.join(""):ii&&ii.isBuffer(r[0])?ii.concat(r):H2(r)}function an(r){return new He(r)}function Oe(r){return new Wn(r)}async function yi(r,e,{preventClose:t=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(ve(r)&&!le(r)){r=qa(r);try{if(r[Gt]){const o=Oe(e);for(let u=0;u{e=o,t=u}),e=null,t=null)},close:n.close.bind(n),abort:n.error.bind(n)})}}function Qt(r,e=()=>{},t=()=>{}){if(le(r)){const a=new Ze;return(async()=>{const s=Oe(a);try{const o=await ar(r),u=e(o),c=t();let h;h=u!==void 0&&c!==void 0?Ue([u,c]):u!==void 0?u:c,await s.write(h),await s.close()}catch(o){await s.abort(o)}})(),a}if(ve(r))return G2(r,{async transform(a,s){try{const o=await e(a);o!==void 0&&s.enqueue(o)}catch(o){s.error(o)}},async flush(a){try{const s=await t();s!==void 0&&a.enqueue(s)}catch(s){a.error(s)}}});const n=e(r),i=t();return n!==void 0&&i!==void 0?Ue([n,i]):n!==void 0?n:i}function pi(r,e){if(ve(r)&&!le(r)){let n;const i=new ja({start(o){n=o}}),a=yi(r,i.writable),s=W2(async function(o){n.error(o),await a,await new Promise(setTimeout)});return e(i.readable,s.writable),s.readable}r=q2(r);const t=new Ze;return e(r,t),t}function e1(r){if(le(r))return r.clone();if(ve(r)){const e=function(t){if(le(t))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(ve(t)){const n=qa(t).tee();return n[0][Gt]=n[1][Gt]=t[Gt],n}return[Ae(t),Ae(t)]}(r);return Z2(r,e[0]),e[1]}return Ae(r)}function V2(r){return le(r)?e1(r):ve(r)?new Kn({start(e){const t=pi(r,async(n,i)=>{const a=an(n),s=Oe(i);try{for(;;){await s.ready;const{done:o,value:u}=await a.read();if(o){try{e.close()}catch{}return void await s.close()}try{e.enqueue(u)}catch{}await s.write(u)}}catch(o){e.error(o),await s.abort(o)}});Z2(r,t)}}):Ae(r)}function Z2(r,e){Object.entries(Object.getOwnPropertyDescriptors(r.constructor.prototype)).forEach(([t,n])=>{t!=="constructor"&&(n.value?n.value=n.value.bind(e):n.get=n.get.bind(e),Object.defineProperty(r,t,n))})}function Ae(r,e=0,t=1/0){if(le(r))throw Error("Not implemented");if(ve(r)){if(e>=0&&t>=0){let n=0;return G2(r,{transform(i,a){n=e&&a.enqueue(Ae(i,Math.max(e-n,0),t-n)),n+=i.length):a.terminate()}})}if(e<0&&(t<0||t===1/0)){let n=[];return Qt(r,i=>{i.length>=-e?n=[i]:n.push(i)},()=>Ae(Ue(n),e,t))}if(e===0&&t<0){let n;return Qt(r,i=>{const a=n?Ue([n,i]):i;if(a.length>=-t)return n=Ae(a,t),Ae(a,e,t);n=a})}return console.warn(`stream.slice(input, ${e}, ${t}) not implemented efficiently.`),Ai(async()=>Ae(await ar(r),e,t))}return r[Gt]&&(r=Ue(r[Gt].concat([r]))),!S1(r)||ii&&ii.isBuffer(r)?r.slice(e,t):(t===1/0&&(t=r.length),r.subarray(e,t))}async function ar(r,e=Ue){return le(r)?r.readToEnd(e):ve(r)?an(r).readToEnd(e):r}async function _c(r,e){if(ve(r)){if(r.cancel)return r.cancel(e);if(r.destroy)return r.destroy(e),await new Promise(setTimeout),e}}function Ai(r){const e=new Ze;return(async()=>{const t=Oe(e);try{await t.write(await r()),await t.close()}catch(n){await t.abort(n)}})(),e}class me{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,n=Array(t.length);for(let i=0;iBigInt(0);){const s=n&BigInt(1);n>>=BigInt(1);const o=a*i%t.value;a=s?o:a,i=i*i%t.value}return new me(a)}modInv(e){const{gcd:t,x:n}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return n.add(e).mod(e)}_egcd(e){let t=BigInt(0),n=BigInt(1),i=BigInt(1),a=BigInt(0),s=this.value;for(e=e.value;e!==BigInt(0);){const o=s/e;let u=t;t=i-o*t,i=u,u=n,n=a-o*n,a=u,u=e,e=s%e,s=u}return{x:new me(i),y:new me(a),gcd:new me(s)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const n=e;e=t%e,t=n}return new me(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new me(0),t=new me(1),n=new me(-1),i=this.isNegative()?n:e;let a=1;const s=this.clone();for(;!s.irightShift(t).equal(i);)a++;return a}byteLength(){const e=new me(0),t=new me(-1),n=this.isNegative()?t:e,i=new me(8);let a=1;const s=this.clone();for(;!s.irightShift(i).equal(n);)a++;return a}toUint8Array(e="be",t){let n=this.value.toString(16);n.length%2==1&&(n="0"+n);const i=n.length/2,a=new Uint8Array(t||i),s=t?t-i:0;let o=0;for(;otypeof BigInt<"u",$n=Symbol("byValue");var p={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ed25519Legacy:"ed25519",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",curve25519Legacy:"curve25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,ed25519Legacy:22,eddsa:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(r,e){if(typeof e=="number"&&(e=this.read(r,e)),r[e]!==void 0)return r[e];throw Error("Invalid enum value.")},read:function(r,e){if(r[$n]||(r[$n]=[],Object.entries(r).forEach(([t,n])=>{r[$n][n]=t})),r[$n][e]!==void 0)return r[$n][e];throw Error("Invalid enum value.")}};const Cs=(()=>{try{return!1}catch{}return!1})(),A={isString:function(r){return typeof r=="string"||r instanceof String},isArray:function(r){return r instanceof Array},isUint8Array:S1,isStream:ve,readNumber:function(r){let e=0;for(let t=0;t>8*(e-n-1)&255;return t},readDate:function(r){const e=A.readNumber(r);return new Date(1e3*e)},writeDate:function(r){const e=Math.floor(r.getTime()/1e3);return A.writeNumber(e,4)},normalizeDate:function(r=Date.now()){return r===null||r===1/0?r:new Date(1e3*Math.floor(+r/1e3))},readMPI:function(r){const e=(r[0]<<8|r[1])+7>>>3;return r.subarray(2,2+e)},leftPad(r,e){const t=new Uint8Array(e),n=e-r.length;return t.set(r,n),t},uint8ArrayToMPI:function(r){const e=A.uint8ArrayBitLength(r);if(e===0)throw Error("Zero MPI");const t=r.subarray(r.length-Math.ceil(e/8)),n=new Uint8Array([(65280&e)>>8,255&e]);return A.concatUint8Array([n,t])},uint8ArrayBitLength:function(r){let e;for(e=0;e>1);for(let t=0;t>1;t++)e[t]=parseInt(r.substr(t<<1,2),16);return e},uint8ArrayToHex:function(r){const e=[],t=r.length;let n,i=0;for(;i{if(!A.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let n=0;nt("",!0))},decodeUTF8:function(r){const e=new TextDecoder("utf-8");function t(n,i=!1){return e.decode(n,{stream:!i})}return Qt(r,t,()=>t(new Uint8Array,!0))},concat:Ue,concatUint8Array:H2,equalsUint8Array:function(r,e){if(!A.isUint8Array(r)||!A.isUint8Array(e))throw Error("Data must be in the form of a Uint8Array");if(r.length!==e.length)return!1;for(let t=0;t>>16;return t!==0&&(r=t,e+=16),t=r>>8,t!==0&&(r=t,e+=8),t=r>>4,t!==0&&(r=t,e+=4),t=r>>2,t!==0&&(r=t,e+=2),t=r>>1,t!==0&&(r=t,e+=1),e},double:function(r){const e=new Uint8Array(r.length),t=r.length-1;for(let n=0;n>7;return e[t]=r[t]<<1^135*(r[0]>>7),e},shiftRight:function(r,e){if(e)for(let t=r.length-1;t>=0;t--)r[t]>>=e,t>0&&(r[t]|=r[t-1]<<8-e);return r},getWebCrypto:function(){return Qe!==void 0&&Qe.crypto&&Qe.crypto.subtle},getBigInteger:async function(){if(Ac())return me;{const{default:r}=await Wr(async()=>{const{default:e}=await import("./bn.interface.min-C3cy-LMG.js");return{default:e}},__vite__mapDeps([0,1]),import.meta.url);return r}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return typeof navigator<"u"?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(r){return A.isString(r)?/^(([^<>()[\]\\.,;:\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,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(r):!1},canonicalizeEOL:function(r){let e=!1;return Qt(r,t=>{let n;e&&(t=A.concatUint8Array([new Uint8Array([13]),t])),t[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;const i=[];for(let o=0;n=t.indexOf(10,o)+1,n;o=n)t[n-2]!==13&&i.push(n);if(!i.length)return t;const a=new Uint8Array(t.length+i.length);let s=0;for(let o=0;oe?new Uint8Array([13]):void 0)},nativeEOL:function(r){let e=!1;return Qt(r,t=>{let n;(t=e&&t[0]!==10?A.concatUint8Array([new Uint8Array([13]),t]):new Uint8Array(t))[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;let i=0;for(let a=0;a!==t.length;a=n){n=t.indexOf(13,a)+1,n||(n=t.length);const s=n-(t[n]===10?1:0);a&&t.copyWithin(i,a,s),i+=s-a}return t.subarray(0,i)},()=>e?new Uint8Array([13]):void 0)},removeTrailingSpaces:function(r){return r.split(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./bn.interface.min-CSLO4CmQ.js","./bn.min-DAU79I_Z.js","./elliptic.min-fis8C3PY.js"])))=>i.map(i=>d[i]); +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();var s5=Object.defineProperty,o5=(r,e,t)=>e in r?s5(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$r=(r,e,t)=>(o5(r,typeof e!="symbol"?e+"":e,t),t);function c5(r,e){const t=Object.create(null),n=r.split(",");for(let i=0;i!!t[i]}function g2(r){if(he(r)){const e={};for(let t=0;t{if(t){const n=t.split(h5);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function m2(r){let e="";if(Pn(r))e=r;else if(he(r))for(let t=0;tAn(t,e))}const d5=Object.assign,y5=(r,e)=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)},p5=Object.prototype.hasOwnProperty,Na=(r,e)=>p5.call(r,e),he=Array.isArray,H1=r=>w2(r)==="[object Map]",ls=r=>r instanceof Date,Pn=r=>typeof r=="string",Ma=r=>typeof r=="symbol",Lr=r=>r!==null&&typeof r=="object",g5=Object.prototype.toString,w2=r=>g5.call(r),m5=r=>w2(r).slice(8,-1),$a=r=>Pn(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,b2=r=>{const e=Object.create(null);return t=>e[t]||(e[t]=r(t))},w5=/-(\w)/g,b5=b2(r=>r.replace(w5,(e,t)=>t?t.toUpperCase():"")),k5=/\B([A-Z])/g,k2=b2(r=>r.replace(k5,"-$1").toLowerCase()),v5=(r,e)=>!Object.is(r,e),fs=r=>{const e=parseFloat(r);return isNaN(e)?r:e};let A5;function v2(r,e){e=e||A5,e&&e.active&&e.effects.push(r)}const A2=r=>{const e=new Set(r);return e.w=0,e.n=0,e},_2=r=>(r.w&Or)>0,E2=r=>(r.n&Or)>0,_5=({deps:r})=>{if(r.length)for(let e=0;e{const{deps:e}=r;if(e.length){let t=0;for(let n=0;n0?Nn[e-1]:void 0}}stop(){this.active&&(ys(this),this.onStop&&this.onStop(),this.active=!1)}};function ys(r){const{deps:e}=r;if(e.length){for(let t=0;t{(c==="length"||c>=n)&&o.push(u)});else switch(t!==void 0&&o.push(s.get(t)),e){case"add":he(r)?$a(t)&&o.push(s.get("length")):(o.push(s.get(Gi)),H1(r)&&o.push(s.get(ds)));break;case"delete":he(r)||(o.push(s.get(Gi)),H1(r)&&o.push(s.get(ds)));break;case"set":H1(r)&&o.push(s.get(Gi));break}if(o.length===1)o[0]&&ps(o[0]);else{const u=[];for(const c of o)c&&u.push(...c);ps(A2(u))}}function ps(r,e){for(const t of he(r)?r:[...r])(t!==tn||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const I5=c5("__proto__,__v_isRef,__isVue"),P2=new Set(Object.getOwnPropertyNames(Symbol).map(r=>Symbol[r]).filter(Ma)),T5=U2(),B5=U2(!0),gs=R5();function R5(){const r={};return["includes","indexOf","lastIndexOf"].forEach(e=>{r[e]=function(...t){const n=en(this);for(let a=0,s=this.length;a{r[e]=function(...t){K5();const n=en(this)[e].apply(this,t);return S2(),n}}),r}function U2(r=!1,e=!1){return function(t,n,i){if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_raw"&&i===(r?e?j5:x2:e?H5:K2).get(t))return t;const a=he(t);if(!r&&a&&Na(gs,n))return Reflect.get(gs,n,i);const s=Reflect.get(t,n,i);return(Ma(n)?P2.has(n):I5(n))||(r||v1(t,"get",n),e)?s:va(s)?!a||!$a(n)?s.value:s:Lr(s)?r?W5(s):A1(s):s}}const z5=L5();function L5(r=!1){return function(e,t,n,i){let a=e[t];if(!r&&!V5(n)&&(n=en(n),a=en(a),!he(e)&&va(a)&&!va(n)))return a.value=n,!0;const s=he(e)&&$a(t)?Number(t)Z5.then(r),ms=r=>{t1.includes(r)||t1.push(r),Aa||(Aa=!0,_1(X5))},X5=()=>{for(const r of t1)r();t1.length=0,Aa=!1},Y5=/^(spellcheck|draggable|form|list|type)$/,_a=({el:r,get:e,effect:t,arg:n,modifiers:i})=>{let a;n==="class"&&(r._class=r.className),t(()=>{let s=e();if(n)i?.camel&&(n=b5(n)),j1(r,n,s,a);else{for(const o in s)j1(r,o,s[o],a&&a[o]);for(const o in a)(!s||!(o in s))&&j1(r,o,null)}a=s})},j1=(r,e,t,n)=>{if(e==="class")r.setAttribute("class",m2(r._class?[r._class,t]:t)||"");else if(e==="style"){t=g2(t);const{style:i}=r;if(!t)r.removeAttribute("style");else if(Pn(t))t!==n&&(i.cssText=t);else{for(const a in t)Ea(i,a,t[a]);if(n&&!Pn(n))for(const a in n)t[a]==null&&Ea(i,a,"")}}else!(r instanceof SVGElement)&&e in r&&!Y5.test(e)?(r[e]=t,e==="value"&&(r._value=t)):e==="true-value"?r._trueValue=t:e==="false-value"?r._falseValue=t:t!=null?r.setAttribute(e,t):r.removeAttribute(e)},ws=/\s*!important$/,Ea=(r,e,t)=>{he(t)?t.forEach(n=>Ea(r,e,n)):e.startsWith("--")?r.setProperty(e,t):ws.test(t)?r.setProperty(k2(e),t.replace(ws,""),"important"):r[e]=t},Dr=(r,e)=>{const t=r.getAttribute(e);return t!=null&&r.removeAttribute(e),t},Er=(r,e,t,n)=>{r.addEventListener(e,t,n)},Q5=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,J5=["ctrl","shift","alt","meta"],tc={stop:r=>r.stopPropagation(),prevent:r=>r.preventDefault(),self:r=>r.target!==r.currentTarget,ctrl:r=>!r.ctrlKey,shift:r=>!r.shiftKey,alt:r=>!r.altKey,meta:r=>!r.metaKey,left:r=>"button"in r&&r.button!==0,middle:r=>"button"in r&&r.button!==1,right:r=>"button"in r&&r.button!==2,exact:(r,e)=>J5.some(t=>r[`${t}Key`]&&!e[t])},C2=({el:r,get:e,exp:t,arg:n,modifiers:i})=>{if(!n)return;let a=Q5.test(t)?e(`(e => ${t}(e))`):e(`($event => { ${t} })`);if(n==="vue:mounted"){_1(a);return}else if(n==="vue:unmounted")return()=>a();if(i){n==="click"&&(i.right&&(n="contextmenu"),i.middle&&(n="mouseup"));const s=a;a=o=>{if(!("key"in o&&!(k2(o.key)in i))){for(const u in i){const c=tc[u];if(c&&c(o,i))return}return s(o)}}}Er(r,n,a,i)},ec=({el:r,get:e,effect:t})=>{const n=r.style.display;t(()=>{r.style.display=e()?n:"none"})},I2=({el:r,get:e,effect:t})=>{t(()=>{r.textContent=T2(e())})},T2=r=>r==null?"":Lr(r)?JSON.stringify(r,null,2):String(r),rc=({el:r,get:e,effect:t})=>{t(()=>{r.innerHTML=e()})},nc=({el:r,exp:e,get:t,effect:n,modifiers:i})=>{const a=r.type,s=t(`(val) => { ${e} = val }`),{trim:o,number:u=a==="number"}=i||{};if(r.tagName==="SELECT"){const c=r;Er(r,"change",()=>{const h=Array.prototype.filter.call(c.options,l=>l.selected).map(l=>u?fs(vr(l)):vr(l));s(c.multiple?h:h[0])}),n(()=>{const h=t(),l=c.multiple;for(let w=0,y=c.options.length;w-1:K.selected=h.has(C);else if(An(vr(K),h)){c.selectedIndex!==w&&(c.selectedIndex=w);return}}!l&&c.selectedIndex!==-1&&(c.selectedIndex=-1)})}else if(a==="checkbox"){Er(r,"change",()=>{const h=t(),l=r.checked;if(he(h)){const w=vr(r),y=F1(h,w),K=y!==-1;if(l&&!K)s(h.concat(w));else if(!l&&K){const C=[...h];C.splice(y,1),s(C)}}else s(bs(r,l))});let c;n(()=>{const h=t();he(h)?r.checked=F1(h,vr(r))>-1:h!==c&&(r.checked=An(h,bs(r,!0))),c=h})}else if(a==="radio"){Er(r,"change",()=>{s(vr(r))});let c;n(()=>{const h=t();h!==c&&(r.checked=An(h,vr(r)))})}else{const c=h=>o?h.trim():u?fs(h):h;Er(r,"compositionstart",ic),Er(r,"compositionend",ac),Er(r,i?.lazy?"change":"input",()=>{r.composing||s(c(r.value))}),o&&Er(r,"change",()=>{r.value=r.value.trim()}),n(()=>{if(r.composing)return;const h=r.value,l=t();document.activeElement===r&&c(h)===l||h!==l&&(r.value=l)})}},vr=r=>"_value"in r?r._value:r.value,bs=(r,e)=>{const t=e?"_trueValue":"_falseValue";return t in r?r[t]:e},ic=r=>{r.target.composing=!0},ac=r=>{const e=r.target;e.composing&&(e.composing=!1,sc(e,"input"))},sc=(r,e)=>{const t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),r.dispatchEvent(t)},ks=Object.create(null),di=(r,e,t)=>B2(r,`return(${e})`,t),B2=(r,e,t)=>{const n=ks[e]||(ks[e]=oc(e));try{return n(r,t)}catch(i){console.error(i)}},oc=r=>{try{return new Function("$data","$el",`with($data){${r}}`)}catch(e){return console.error(`${e.message} in expression: ${r}`),()=>{}}},cc=({el:r,ctx:e,exp:t,effect:n})=>{_1(()=>n(()=>B2(e.scope,t,r)))},uc={bind:_a,on:C2,show:ec,text:I2,html:rc,model:nc,effect:cc},hc=(r,e,t)=>{const n=r.parentElement,i=new Comment("v-if");n.insertBefore(i,r);const a=[{exp:e,el:r}];let s,o;for(;(s=r.nextElementSibling)&&(o=null,Dr(s,"v-else")===""||(o=Dr(s,"v-else-if")));)n.removeChild(s),a.push({exp:o,el:s});const u=r.nextSibling;n.removeChild(r);let c,h=-1;const l=()=>{c&&(n.insertBefore(i,c.el),c.remove(),c=void 0)};return t.effect(()=>{for(let w=0;w{const n=e.match(lc);if(!n)return;const i=r.nextSibling,a=r.parentElement,s=new Text("");a.insertBefore(s,r),a.removeChild(r);const o=n[2].trim();let u=n[1].trim().replace(fc,"").trim(),c,h=!1,l,w,y="key",K=r.getAttribute(y)||r.getAttribute(y=":key")||r.getAttribute(y="v-bind:key");K&&(r.removeAttribute(y),y==="key"&&(K=JSON.stringify(K)));let C;(C=u.match(vs))&&(u=u.replace(vs,"").trim(),l=C[1].trim(),C[2]&&(w=C[2].trim())),(C=u.match(dc))&&(c=C[1].split(",").map(j=>j.trim()),h=u[0]==="[");let O=!1,F,Y,$;const E=j=>{const V=new Map,Z=[];if(he(j))for(let tt=0;tt{const rt={};c?c.forEach((N,ft)=>rt[N]=V[h?ft:N]):rt[u]=V,tt?(l&&(rt[l]=tt),w&&(rt[w]=Z)):l&&(rt[l]=Z);const dt=O2(t,rt),lt=K?di(dt.scope,K):Z;return j.set(lt,Z),dt.key=lt,dt},H=(j,V)=>{const Z=new Ha(r,j);return Z.key=j.key,Z.insert(a,V),Z};return t.effect(()=>{const j=di(t.scope,o),V=$;if([Y,$]=E(j),!O)F=Y.map(Z=>H(Z,s)),O=!0;else{for(let lt=0;lt{let i;return n(()=>{const a=t();e[a]=r,i&&a!==i&&delete e[i],i=a}),()=>{i&&delete e[i]}},pc=/^(?:v-|:|@)/,gc=/\.([\w-]+)/g;let Sa=!1;const z2=(r,e)=>{const t=r.nodeType;if(t===1){const n=r;if(n.hasAttribute("v-pre"))return;Dr(n,"v-cloak");let i;if(i=Dr(n,"v-if"))return hc(n,i,e);if(i=Dr(n,"v-for"))return yc(n,i,e);if((i=Dr(n,"v-scope"))||i===""){const o=i?di(e.scope,i):{};e=O2(e,o),o.$template&&mc(n,o.$template)}const a=Dr(n,"v-once")!=null;a&&(Sa=!0),(i=Dr(n,"ref"))&&Pa(n,R2,`"${i}"`,e),As(n,e);const s=[];for(const{name:o,value:u}of[...n.attributes])pc.test(o)&&o!=="v-cloak"&&(o==="v-model"?s.unshift([o,u]):o[0]==="@"||/^v-on\b/.test(o)?s.push([o,u]):_s(n,o,u,e));for(const[o,u]of s)_s(n,o,u,e);a&&(Sa=!1)}else if(t===3){const n=r.data;if(n.includes(e.delimiters[0])){let i=[],a=0,s;for(;s=e.delimitersRE.exec(n);){const o=n.slice(a,s.index);o&&i.push(JSON.stringify(o)),i.push(`$s(${s[1]})`),a=s.index+s[0].length}a{let t=r.firstChild;for(;t;)t=z2(t,e)||t.nextSibling},_s=(r,e,t,n)=>{let i,a,s;if(e=e.replace(gc,(o,u)=>((s||(s={}))[u]=!0,"")),e[0]===":")i=_a,a=e.slice(1);else if(e[0]==="@")i=C2,a=e.slice(1);else{const o=e.indexOf(":"),u=o>0?e.slice(2,o):e.slice(2);i=uc[u]||n.dirs[u],a=o>0?e.slice(o+1):void 0}i&&(i===_a&&a==="ref"&&(i=R2),Pa(r,i,t,n,a,s),r.removeAttribute(e))},Pa=(r,e,t,n,i,a)=>{const s=e({el:r,get:(o=t)=>di(n.scope,o,r),effect:n.effect,ctx:n,exp:t,arg:i,modifiers:a});s&&n.cleanups.push(s)},mc=(r,e)=>{if(e[0]==="#"){const t=document.querySelector(e);r.appendChild(t.content.cloneNode(!0));return}r.innerHTML=e},L2=r=>{const e={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...r,scope:r?r.scope:A1({}),dirs:r?r.dirs:{},effects:[],blocks:[],cleanups:[],effect:t=>{if(Sa)return ms(t),t;const n=P5(t,{scheduler:()=>ms(n)});return e.effects.push(n),n}};return e},O2=(r,e={})=>{const t=r.scope,n=Object.create(t);Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n.$refs=Object.create(t.$refs);const i=A1(new Proxy(n,{set(a,s,o,u){return u===i&&!a.hasOwnProperty(s)?Reflect.set(t,s,o):Reflect.set(a,s,o,u)}}));return N2(i),{...r,scope:i}},N2=r=>{for(const e of Object.keys(r))typeof r[e]=="function"&&(r[e]=r[e].bind(r))};let Ha=class{constructor(e,t,n=!1){$r(this,"template"),$r(this,"ctx"),$r(this,"key"),$r(this,"parentCtx"),$r(this,"isFragment"),$r(this,"start"),$r(this,"end"),this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=L2(t)),z2(this.template,this.ctx)}get el(){return this.start||this.template}insert(e,t=null){if(this.isFragment)if(this.start){let n=this.start,i;for(;n&&(i=n.nextSibling,e.insertBefore(n,t),n!==this.end);)n=i}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else e.insertBefore(this.template,t)}remove(){if(this.parentCtx&&y5(this.parentCtx.blocks,this),this.start){const e=this.start.parentNode;let t=this.start,n;for(;t&&(n=t.nextSibling,e.removeChild(t),t!==this.end);)t=n}else this.template.parentNode.removeChild(this.template);this.teardown()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(U5),this.ctx.cleanups.forEach(e=>e())}};const Es=r=>r.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),M2=r=>{const e=L2();if(r&&(e.scope=A1(r),N2(e.scope),r.$delimiters)){const[n,i]=e.delimiters=r.$delimiters;e.delimitersRE=new RegExp(Es(n)+"([^]+?)"+Es(i),"g")}e.scope.$s=T2,e.scope.$nextTick=_1,e.scope.$refs=Object.create(null);let t;return{directive(n,i){return i?(e.dirs[n]=i,this):e.dirs[n]},mount(n){if(typeof n=="string"&&(n=document.querySelector(n),!n))return;n=n||document.documentElement;let i;return n.hasAttribute("v-scope")?i=[n]:i=[...n.querySelectorAll("[v-scope]")].filter(a=>!a.matches("[v-scope] [v-scope]")),i.length||(i=[n]),t=i.map(a=>new Ha(a,e,!0)),this},unmount(){t.forEach(n=>n.teardown())}}},Ss=document.currentScript;Ss&&Ss.hasAttribute("init")&&M2().mount();const wc="modulepreload",bc=function(r,e){return new URL(r,e).href},Ps={},Wr=function(e,t,n){let i=Promise.resolve();if(t&&t.length>0){const a=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");i=Promise.all(t.map(u=>{if(u=bc(u,n),u in Ps)return;Ps[u]=!0;const c=u.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(!!n)for(let y=a.length-1;y>=0;y--){const K=a[y];if(K.href===u&&(!c||K.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const w=document.createElement("link");if(w.rel=c?"stylesheet":wc,c||(w.as="script",w.crossOrigin=""),w.href=u,o&&w.setAttribute("nonce",o),document.head.appendChild(w),c)return new Promise((y,K)=>{w.addEventListener("load",y),w.addEventListener("error",()=>K(new Error(`Unable to preload CSS for ${u}`)))})}))}return i.then(()=>e()).catch(a=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a})},Qe=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},bn=Symbol("doneWritingPromise"),$2=Symbol("doneWritingResolve"),F2=Symbol("doneWritingReject"),Mn=Symbol("readingIndex");class Ze extends Array{constructor(){super(),this[bn]=new Promise((e,t)=>{this[$2]=e,this[F2]=t}),this[bn].catch(()=>{})}}function le(r){return r&&r.getReader&&Array.isArray(r)}function Wn(r){if(!le(r)){const e=r.getWriter(),t=e.releaseLock;return e.releaseLock=()=>{e.closed.catch(function(){}),t.call(e)},e}this.stream=r}Ze.prototype.getReader=function(){return this[Mn]===void 0&&(this[Mn]=0),{read:async()=>(await this[bn],this[Mn]===this.length?{value:void 0,done:!0}:{value:this[this[Mn]++],done:!1})}},Ze.prototype.readToEnd=async function(r){await this[bn];const e=r(this.slice(this[Mn]));return this.length=0,e},Ze.prototype.clone=function(){const r=new Ze;return r[bn]=this[bn].then(()=>{r.push(...this)}),r},Wn.prototype.write=async function(r){this.stream.push(r)},Wn.prototype.close=async function(){this.stream[$2]()},Wn.prototype.abort=async function(r){return this.stream[F2](r),r},Wn.prototype.releaseLock=function(){};const E1=typeof Qe.process=="object"&&typeof Qe.process.versions=="object",Us=E1&&void 0;function ve(r){return le(r)?"array":Qe.ReadableStream&&Qe.ReadableStream.prototype.isPrototypeOf(r)?"web":Kn&&Kn.prototype.isPrototypeOf(r)?"ponyfill":Us&&Us.prototype.isPrototypeOf(r)?"node":!(!r||!r.getReader)&&"web-like"}function S1(r){return Uint8Array.prototype.isPrototypeOf(r)}function H2(r){if(r.length===1)return r[0];let e=0;for(let i=0;i{t||(kc.isBuffer(i)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),n.enqueue(i),e.pause())}),e.on("end",()=>{t||n.close()}),e.on("error",i=>n.error(i))},pull(){e.resume()},cancel(n){t=!0,e.destroy(n)}})};class r extends Ks{constructor(t,n){super(n),this._reader=an(t)}async _read(t){try{for(;;){const{done:n,value:i}=await this._reader.read();if(n){this.push(null);break}if(!this.push(i))break}}catch(n){this.destroy(n)}}async _destroy(t,n){this._reader.cancel(t).then(n,n)}}j2=function(e,t){return new r(e,t)}}const xs=new WeakSet,Gt=Symbol("externalBuffer");function He(r){if(this.stream=r,r[Gt]&&(this[Gt]=r[Gt].slice()),le(r)){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{},void(this._cancel=async()=>{})}let e=ve(r);if(e==="node"&&(r=P1(r)),e){const n=r.getReader();return this._read=n.read.bind(n),this._releaseLock=()=>{n.closed.catch(function(){}),n.releaseLock()},void(this._cancel=n.cancel.bind(n))}let t=!1;this._read=async()=>t||xs.has(r)?{value:void 0,done:!0}:(t=!0,{value:r,done:!1}),this._releaseLock=()=>{if(t)try{xs.add(r)}catch{}}}He.prototype.read=async function(){return this[Gt]&&this[Gt].length?{done:!1,value:this[Gt].shift()}:this._read()},He.prototype.releaseLock=function(){this[Gt]&&(this.stream[Gt]=this[Gt]),this._releaseLock()},He.prototype.cancel=function(r){return this._cancel(r)},He.prototype.readLine=async function(){let r,e=[];for(;!r;){let{done:t,value:n}=await this.read();if(n+="",t)return e.length?Ue(e):void 0;const i=n.indexOf(` +`)+1;i&&(r=Ue(e.concat(n.substr(0,i))),e=[]),i!==n.length&&e.push(n.substr(i))}return this.unshift(...e),r},He.prototype.readByte=async function(){const{done:r,value:e}=await this.read();if(r)return;const t=e[0];return this.unshift(_e(e,1)),t},He.prototype.readBytes=async function(r){const e=[];let t=0;for(;;){const{done:n,value:i}=await this.read();if(n)return e.length?Ue(e):void 0;if(e.push(i),t+=i.length,t>=r){const a=Ue(e);return this.unshift(_e(a,r)),_e(a,0,r)}}},He.prototype.peekBytes=async function(r){const e=await this.readBytes(r);return this.unshift(e),e},He.prototype.unshift=function(...r){this[Gt]||(this[Gt]=[]),r.length===1&&S1(r[0])&&this[Gt].length&&r[0].length&&this[Gt][0].byteOffset>=r[0].length?this[Gt][0]=new Uint8Array(this[Gt][0].buffer,this[Gt][0].byteOffset-r[0].length,this[Gt][0].byteLength+r[0].length):this[Gt].unshift(...r.filter(e=>e&&e.length))},He.prototype.readToEnd=async function(r=Ue){const e=[];for(;;){const{done:t,value:n}=await this.read();if(t)break;e.push(n)}return r(e)};let Ds,{ReadableStream:Kn,WritableStream:vc,TransformStream:ja}=Qe;const ii=E1&&void 0;function qa(r){let e=ve(r);return e==="node"?P1(r):e==="web"&&Ds?Ds(r):e?r:new Kn({start(t){t.enqueue(r),t.close()}})}function q2(r){if(ve(r))return r;const e=new Ze;return(async()=>{const t=Oe(e);await t.write(r),await t.close()})(),e}function Ue(r){return r.some(e=>ve(e)&&!le(e))?function(e){e=e.map(qa);const t=W2(async function(a){await Promise.all(i.map(s=>Ac(s,a)))});let n=Promise.resolve();const i=e.map((a,s)=>pi(a,(o,u)=>(n=n.then(()=>yi(o,t.writable,{preventClose:s!==e.length-1})),n)));return t.readable}(r):r.some(e=>le(e))?function(e){const t=new Ze;let n=Promise.resolve();return e.forEach((i,a)=>(n=n.then(()=>yi(i,t,{preventClose:a!==e.length-1})),n)),t}(r):typeof r[0]=="string"?r.join(""):ii&&ii.isBuffer(r[0])?ii.concat(r):H2(r)}function an(r){return new He(r)}function Oe(r){return new Wn(r)}async function yi(r,e,{preventClose:t=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(ve(r)&&!le(r)){r=qa(r);try{if(r[Gt]){const o=Oe(e);for(let u=0;u{e=o,t=u}),e=null,t=null)},close:n.close.bind(n),abort:n.error.bind(n)})}}function Qt(r,e=()=>{},t=()=>{}){if(le(r)){const a=new Ze;return(async()=>{const s=Oe(a);try{const o=await ar(r),u=e(o),c=t();let h;h=u!==void 0&&c!==void 0?Ue([u,c]):u!==void 0?u:c,await s.write(h),await s.close()}catch(o){await s.abort(o)}})(),a}if(ve(r))return G2(r,{async transform(a,s){try{const o=await e(a);o!==void 0&&s.enqueue(o)}catch(o){s.error(o)}},async flush(a){try{const s=await t();s!==void 0&&a.enqueue(s)}catch(s){a.error(s)}}});const n=e(r),i=t();return n!==void 0&&i!==void 0?Ue([n,i]):n!==void 0?n:i}function pi(r,e){if(ve(r)&&!le(r)){let n;const i=new ja({start(o){n=o}}),a=yi(r,i.writable),s=W2(async function(o){n.error(o),await a,await new Promise(setTimeout)});return e(i.readable,s.writable),s.readable}r=q2(r);const t=new Ze;return e(r,t),t}function e1(r){if(le(r))return r.clone();if(ve(r)){const e=function(t){if(le(t))throw Error("ArrayStream cannot be tee()d, use clone() instead");if(ve(t)){const n=qa(t).tee();return n[0][Gt]=n[1][Gt]=t[Gt],n}return[_e(t),_e(t)]}(r);return Z2(r,e[0]),e[1]}return _e(r)}function V2(r){return le(r)?e1(r):ve(r)?new Kn({start(e){const t=pi(r,async(n,i)=>{const a=an(n),s=Oe(i);try{for(;;){await s.ready;const{done:o,value:u}=await a.read();if(o){try{e.close()}catch{}return void await s.close()}try{e.enqueue(u)}catch{}await s.write(u)}}catch(o){e.error(o),await s.abort(o)}});Z2(r,t)}}):_e(r)}function Z2(r,e){Object.entries(Object.getOwnPropertyDescriptors(r.constructor.prototype)).forEach(([t,n])=>{t!=="constructor"&&(n.value?n.value=n.value.bind(e):n.get=n.get.bind(e),Object.defineProperty(r,t,n))})}function _e(r,e=0,t=1/0){if(le(r))throw Error("Not implemented");if(ve(r)){if(e>=0&&t>=0){let n=0;return G2(r,{transform(i,a){n=e&&a.enqueue(_e(i,Math.max(e-n,0),t-n)),n+=i.length):a.terminate()}})}if(e<0&&(t<0||t===1/0)){let n=[];return Qt(r,i=>{i.length>=-e?n=[i]:n.push(i)},()=>_e(Ue(n),e,t))}if(e===0&&t<0){let n;return Qt(r,i=>{const a=n?Ue([n,i]):i;if(a.length>=-t)return n=_e(a,t),_e(a,e,t);n=a})}return console.warn(`stream.slice(input, ${e}, ${t}) not implemented efficiently.`),_i(async()=>_e(await ar(r),e,t))}return r[Gt]&&(r=Ue(r[Gt].concat([r]))),!S1(r)||ii&&ii.isBuffer(r)?r.slice(e,t):(t===1/0&&(t=r.length),r.subarray(e,t))}async function ar(r,e=Ue){return le(r)?r.readToEnd(e):ve(r)?an(r).readToEnd(e):r}async function Ac(r,e){if(ve(r)){if(r.cancel)return r.cancel(e);if(r.destroy)return r.destroy(e),await new Promise(setTimeout),e}}function _i(r){const e=new Ze;return(async()=>{const t=Oe(e);try{await t.write(await r()),await t.close()}catch(n){await t.abort(n)}})(),e}class me{constructor(e){if(e===void 0)throw Error("Invalid BigInteger input");if(e instanceof Uint8Array){const t=e,n=Array(t.length);for(let i=0;iBigInt(0);){const s=n&BigInt(1);n>>=BigInt(1);const o=a*i%t.value;a=s?o:a,i=i*i%t.value}return new me(a)}modInv(e){const{gcd:t,x:n}=this._egcd(e);if(!t.isOne())throw Error("Inverse does not exist");return n.add(e).mod(e)}_egcd(e){let t=BigInt(0),n=BigInt(1),i=BigInt(1),a=BigInt(0),s=this.value;for(e=e.value;e!==BigInt(0);){const o=s/e;let u=t;t=i-o*t,i=u,u=n,n=a-o*n,a=u,u=e,e=s%e,s=u}return{x:new me(i),y:new me(a),gcd:new me(s)}}gcd(e){let t=this.value;for(e=e.value;e!==BigInt(0);){const n=e;e=t%e,t=n}return new me(t)}ileftShift(e){return this.value<<=e.value,this}leftShift(e){return this.clone().ileftShift(e)}irightShift(e){return this.value>>=e.value,this}rightShift(e){return this.clone().irightShift(e)}equal(e){return this.value===e.value}lt(e){return this.valuee.value}gte(e){return this.value>=e.value}isZero(){return this.value===BigInt(0)}isOne(){return this.value===BigInt(1)}isNegative(){return this.valueNumber.MAX_SAFE_INTEGER)throw Error("Number can only safely store up to 53 bits");return e}getBit(e){return(this.value>>BigInt(e)&BigInt(1))===BigInt(0)?0:1}bitLength(){const e=new me(0),t=new me(1),n=new me(-1),i=this.isNegative()?n:e;let a=1;const s=this.clone();for(;!s.irightShift(t).equal(i);)a++;return a}byteLength(){const e=new me(0),t=new me(-1),n=this.isNegative()?t:e,i=new me(8);let a=1;const s=this.clone();for(;!s.irightShift(i).equal(n);)a++;return a}toUint8Array(e="be",t){let n=this.value.toString(16);n.length%2==1&&(n="0"+n);const i=n.length/2,a=new Uint8Array(t||i),s=t?t-i:0;let o=0;for(;otypeof BigInt<"u",$n=Symbol("byValue");var p={curve:{p256:"p256","P-256":"p256",secp256r1:"p256",prime256v1:"p256","1.2.840.10045.3.1.7":"p256","2a8648ce3d030107":"p256","2A8648CE3D030107":"p256",p384:"p384","P-384":"p384",secp384r1:"p384","1.3.132.0.34":"p384","2b81040022":"p384","2B81040022":"p384",p521:"p521","P-521":"p521",secp521r1:"p521","1.3.132.0.35":"p521","2b81040023":"p521","2B81040023":"p521",secp256k1:"secp256k1","1.3.132.0.10":"secp256k1","2b8104000a":"secp256k1","2B8104000A":"secp256k1",ed25519Legacy:"ed25519",ED25519:"ed25519",ed25519:"ed25519",Ed25519:"ed25519","1.3.6.1.4.1.11591.15.1":"ed25519","2b06010401da470f01":"ed25519","2B06010401DA470F01":"ed25519",curve25519Legacy:"curve25519",X25519:"curve25519",cv25519:"curve25519",curve25519:"curve25519",Curve25519:"curve25519","1.3.6.1.4.1.3029.1.5.1":"curve25519","2b060104019755010501":"curve25519","2B060104019755010501":"curve25519",brainpoolP256r1:"brainpoolP256r1","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1","2b2403030208010107":"brainpoolP256r1","2B2403030208010107":"brainpoolP256r1",brainpoolP384r1:"brainpoolP384r1","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1","2b240303020801010b":"brainpoolP384r1","2B240303020801010B":"brainpoolP384r1",brainpoolP512r1:"brainpoolP512r1","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1","2b240303020801010d":"brainpoolP512r1","2B240303020801010D":"brainpoolP512r1"},s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsaEncryptSign:1,rsaEncrypt:2,rsaSign:3,elgamal:16,dsa:17,ecdh:18,ecdsa:19,eddsaLegacy:22,ed25519Legacy:22,eddsa:22,aedh:23,aedsa:24,x25519:25,x448:26,ed25519:27,ed448:28},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},webHash:{"SHA-1":2,"SHA-256":8,"SHA-384":9,"SHA-512":10},aead:{eax:1,ocb:2,experimentalGCM:100},packet:{publicKeyEncryptedSessionKey:1,signature:2,symEncryptedSessionKey:3,onePassSignature:4,secretKey:5,publicKey:6,secretSubkey:7,compressedData:8,symmetricallyEncryptedData:9,marker:10,literalData:11,trust:12,userID:13,publicSubkey:14,userAttribute:17,symEncryptedIntegrityProtectedData:18,modificationDetectionCode:19,aeadEncryptedData:20},literal:{binary:98,text:116,utf8:117,mime:109},signature:{binary:0,text:1,standalone:2,certGeneric:16,certPersona:17,certCasual:18,certPositive:19,certRevocation:48,subkeyBinding:24,keyBinding:25,key:31,keyRevocation:32,subkeyRevocation:40,timestamp:64,thirdParty:80},signatureSubpacket:{signatureCreationTime:2,signatureExpirationTime:3,exportableCertification:4,trustSignature:5,regularExpression:6,revocable:7,keyExpirationTime:9,placeholderBackwardsCompatibility:10,preferredSymmetricAlgorithms:11,revocationKey:12,issuer:16,notationData:20,preferredHashAlgorithms:21,preferredCompressionAlgorithms:22,keyServerPreferences:23,preferredKeyServer:24,primaryUserID:25,policyURI:26,keyFlags:27,signersUserID:28,reasonForRevocation:29,features:30,signatureTarget:31,embeddedSignature:32,issuerFingerprint:33,preferredAEADAlgorithms:34},keyFlags:{certifyKeys:1,signData:2,encryptCommunication:4,encryptStorage:8,splitPrivateKey:16,authentication:32,sharedPrivateKey:128},armor:{multipartSection:0,multipartLast:1,signed:2,message:3,publicKey:4,privateKey:5,signature:6},reasonForRevocation:{noReason:0,keySuperseded:1,keyCompromised:2,keyRetired:3,userIDInvalid:32},features:{modificationDetection:1,aead:2,v5Keys:4},write:function(r,e){if(typeof e=="number"&&(e=this.read(r,e)),r[e]!==void 0)return r[e];throw Error("Invalid enum value.")},read:function(r,e){if(r[$n]||(r[$n]=[],Object.entries(r).forEach(([t,n])=>{r[$n][n]=t})),r[$n][e]!==void 0)return r[$n][e];throw Error("Invalid enum value.")}};const Cs=(()=>{try{return!1}catch{}return!1})(),_={isString:function(r){return typeof r=="string"||r instanceof String},isArray:function(r){return r instanceof Array},isUint8Array:S1,isStream:ve,readNumber:function(r){let e=0;for(let t=0;t>8*(e-n-1)&255;return t},readDate:function(r){const e=_.readNumber(r);return new Date(1e3*e)},writeDate:function(r){const e=Math.floor(r.getTime()/1e3);return _.writeNumber(e,4)},normalizeDate:function(r=Date.now()){return r===null||r===1/0?r:new Date(1e3*Math.floor(+r/1e3))},readMPI:function(r){const e=(r[0]<<8|r[1])+7>>>3;return r.subarray(2,2+e)},leftPad(r,e){const t=new Uint8Array(e),n=e-r.length;return t.set(r,n),t},uint8ArrayToMPI:function(r){const e=_.uint8ArrayBitLength(r);if(e===0)throw Error("Zero MPI");const t=r.subarray(r.length-Math.ceil(e/8)),n=new Uint8Array([(65280&e)>>8,255&e]);return _.concatUint8Array([n,t])},uint8ArrayBitLength:function(r){let e;for(e=0;e>1);for(let t=0;t>1;t++)e[t]=parseInt(r.substr(t<<1,2),16);return e},uint8ArrayToHex:function(r){const e=[],t=r.length;let n,i=0;for(;i{if(!_.isString(e))throw Error("stringToUint8Array: Data must be in the form of a string");const t=new Uint8Array(e.length);for(let n=0;nt("",!0))},decodeUTF8:function(r){const e=new TextDecoder("utf-8");function t(n,i=!1){return e.decode(n,{stream:!i})}return Qt(r,t,()=>t(new Uint8Array,!0))},concat:Ue,concatUint8Array:H2,equalsUint8Array:function(r,e){if(!_.isUint8Array(r)||!_.isUint8Array(e))throw Error("Data must be in the form of a Uint8Array");if(r.length!==e.length)return!1;for(let t=0;t>>16;return t!==0&&(r=t,e+=16),t=r>>8,t!==0&&(r=t,e+=8),t=r>>4,t!==0&&(r=t,e+=4),t=r>>2,t!==0&&(r=t,e+=2),t=r>>1,t!==0&&(r=t,e+=1),e},double:function(r){const e=new Uint8Array(r.length),t=r.length-1;for(let n=0;n>7;return e[t]=r[t]<<1^135*(r[0]>>7),e},shiftRight:function(r,e){if(e)for(let t=r.length-1;t>=0;t--)r[t]>>=e,t>0&&(r[t]|=r[t-1]<<8-e);return r},getWebCrypto:function(){return Qe!==void 0&&Qe.crypto&&Qe.crypto.subtle},getBigInteger:async function(){if(_c())return me;{const{default:r}=await Wr(async()=>{const{default:e}=await import("./bn.interface.min-CSLO4CmQ.js");return{default:e}},__vite__mapDeps([0,1]),import.meta.url);return r}},getNodeCrypto:function(){},getNodeZlib:function(){},getNodeBuffer:function(){return{}.Buffer},getHardwareConcurrency:function(){return typeof navigator<"u"?navigator.hardwareConcurrency||1:(void 0).cpus().length},isEmailAddress:function(r){return _.isString(r)?/^(([^<>()[\]\\.,;:\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,}[0-9]*|xn--[a-zA-Z\-0-9]+)))$/.test(r):!1},canonicalizeEOL:function(r){let e=!1;return Qt(r,t=>{let n;e&&(t=_.concatUint8Array([new Uint8Array([13]),t])),t[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;const i=[];for(let o=0;n=t.indexOf(10,o)+1,n;o=n)t[n-2]!==13&&i.push(n);if(!i.length)return t;const a=new Uint8Array(t.length+i.length);let s=0;for(let o=0;oe?new Uint8Array([13]):void 0)},nativeEOL:function(r){let e=!1;return Qt(r,t=>{let n;(t=e&&t[0]!==10?_.concatUint8Array([new Uint8Array([13]),t]):new Uint8Array(t))[t.length-1]===13?(e=!0,t=t.subarray(0,-1)):e=!1;let i=0;for(let a=0;a!==t.length;a=n){n=t.indexOf(13,a)+1,n||(n=t.length);const s=n-(t[n]===10?1:0);a&&t.copyWithin(i,a,s),i+=s-a}return t.subarray(0,i)},()=>e?new Uint8Array([13]):void 0)},removeTrailingSpaces:function(r){return r.split(` `).map(e=>{let t=e.length-1;for(;t>=0&&(e[t]===" "||e[t]===" "||e[t]==="\r");t--);return e.substr(0,t+1)}).join(` -`)},wrapError:function(r,e){if(!e)return Error(r);try{e.message=r+": "+e.message}catch{}return e},constructAllowedPackets:function(r){const e={};return r.forEach(t=>{if(!t.tag)throw Error("Invalid input: expected a packet class");e[t.tag]=t}),e},anyPromise:function(r){return new Promise(async(e,t)=>{let n;await Promise.all(r.map(async i=>{try{e(await i)}catch(a){n=a}})),t(n)})},selectUint8Array:function(r,e,t){const n=Math.max(e.length,t.length),i=new Uint8Array(n);let a=0;for(let s=0;s{e=A.concatUint8Array([e,t]);const n=[],i=Math.floor(e.length/45),a=45*i,s=r1(e.subarray(0,a));for(let o=0;o{if(!t.tag)throw Error("Invalid input: expected a packet class");e[t.tag]=t}),e},anyPromise:function(r){return new Promise(async(e,t)=>{let n;await Promise.all(r.map(async i=>{try{e(await i)}catch(a){n=a}})),t(n)})},selectUint8Array:function(r,e,t){const n=Math.max(e.length,t.length),i=new Uint8Array(n);let a=0;for(let s=0;s{e=_.concatUint8Array([e,t]);const n=[],i=Math.floor(e.length/45),a=45*i,s=r1(e.subarray(0,a));for(let o=0;oe.length?r1(e)+` `:"")}function X2(r){let e="";return Qt(r,t=>{e+=t;let n=0;const i=[" "," ","\r",` -`];for(let o=0;o0&&(a-n)%4!=0;a--)i.includes(e[a])&&n--;const s=n1(e.substr(0,a));return e=e.substr(a),s},()=>n1(e))}function fr(r){return X2(r.replace(/-/g,"+").replace(/_/g,"/"))}function _e(r,e){let t=ur(r).replace(/[\r\n]/g,"");return t=t.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,""),t}q1?(r1=r=>q1.from(r).toString("base64"),n1=r=>{const e=q1.from(r,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}):(r1=r=>btoa(A.uint8ArrayToString(r)),n1=r=>A.stringToUint8Array(atob(r)));var vt={preferredHashAlgorithm:p.hash.sha256,preferredSymmetricAlgorithm:p.symmetric.aes256,preferredCompressionAlgorithm:p.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:p.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([p.symmetric.aes128,p.symmetric.aes192,p.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.2",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd]),rejectMessageHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd,p.hash.sha1]),rejectPublicKeyAlgorithms:new Set([p.publicKey.elgamal,p.publicKey.dsa]),rejectCurves:new Set([p.curve.secp256k1])};function Ec(r){const e=r.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!e)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(e[1])?p.armor.multipartSection:/MESSAGE, PART \d+/.test(e[1])?p.armor.multipartLast:/SIGNED MESSAGE/.test(e[1])?p.armor.signed:/MESSAGE/.test(e[1])?p.armor.message:/PUBLIC KEY BLOCK/.test(e[1])?p.armor.publicKey:/PRIVATE KEY BLOCK/.test(e[1])?p.armor.privateKey:/SIGNATURE/.test(e[1])?p.armor.signature:void 0}function Fr(r,e){let t="";return e.showVersion&&(t+="Version: "+e.versionString+` +`];for(let o=0;o0&&(a-n)%4!=0;a--)i.includes(e[a])&&n--;const s=n1(e.substr(0,a));return e=e.substr(a),s},()=>n1(e))}function fr(r){return X2(r.replace(/-/g,"+").replace(/_/g,"/"))}function Ae(r,e){let t=ur(r).replace(/[\r\n]/g,"");return t=t.replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,""),t}q1?(r1=r=>q1.from(r).toString("base64"),n1=r=>{const e=q1.from(r,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}):(r1=r=>btoa(_.uint8ArrayToString(r)),n1=r=>_.stringToUint8Array(atob(r)));var vt={preferredHashAlgorithm:p.hash.sha256,preferredSymmetricAlgorithm:p.symmetric.aes256,preferredCompressionAlgorithm:p.compression.uncompressed,deflateLevel:6,aeadProtect:!1,preferredAEADAlgorithm:p.aead.eax,aeadChunkSizeByte:12,v5Keys:!1,s2kIterationCountByte:224,allowUnauthenticatedMessages:!1,allowUnauthenticatedStream:!1,checksumRequired:!1,minRSABits:2047,passwordCollisionCheck:!1,revocationsExpire:!1,allowInsecureDecryptionWithSigningKeys:!1,allowInsecureVerificationWithReformattedKeys:!1,constantTimePKCS1Decryption:!1,constantTimePKCS1DecryptionSupportedSymmetricAlgorithms:new Set([p.symmetric.aes128,p.symmetric.aes192,p.symmetric.aes256]),minBytesForWebCrypto:1e3,ignoreUnsupportedPackets:!0,ignoreMalformedPackets:!1,additionalAllowedPackets:[],showVersion:!1,showComment:!1,versionString:"OpenPGP.js 5.11.2",commentString:"https://openpgpjs.org",maxUserIDLength:5120,knownNotations:[],useIndutnyElliptic:!0,rejectHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd]),rejectMessageHashAlgorithms:new Set([p.hash.md5,p.hash.ripemd,p.hash.sha1]),rejectPublicKeyAlgorithms:new Set([p.publicKey.elgamal,p.publicKey.dsa]),rejectCurves:new Set([p.curve.secp256k1])};function Ec(r){const e=r.match(/^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$/m);if(!e)throw Error("Unknown ASCII armor type");return/MESSAGE, PART \d+\/\d+/.test(e[1])?p.armor.multipartSection:/MESSAGE, PART \d+/.test(e[1])?p.armor.multipartLast:/SIGNED MESSAGE/.test(e[1])?p.armor.signed:/MESSAGE/.test(e[1])?p.armor.message:/PUBLIC KEY BLOCK/.test(e[1])?p.armor.publicKey:/PRIVATE KEY BLOCK/.test(e[1])?p.armor.privateKey:/SIGNATURE/.test(e[1])?p.armor.signature:void 0}function Fr(r,e){let t="";return e.showVersion&&(t+="Version: "+e.versionString+` `),e.showComment&&(t+="Comment: "+e.commentString+` `),r&&(t+="Comment: "+r+` `),t+=` -`,t}function Sr(r){return ur(function(e){let t=13501623;return Qt(e,n=>{const i=Sc?Math.floor(n.length/4):0,a=new Uint32Array(n.buffer,n.byteOffset,i);for(let s=0;s>24&255]^se[1][t>>16&255]^se[2][t>>8&255]^se[3][t>>0&255];for(let s=4*i;s>8^se[0][255&t^n[s]]},()=>new Uint8Array([t,t>>8,t>>16]))}(r))}const se=[Array(255),Array(255),Array(255),Array(255)];for(let r=0;r<=255;r++){let e=r<<16;for(let t=0;t<8;t++)e=e<<1^(8388608&e?8801531:0);se[0][r]=(16711680&e)>>16|65280&e|(255&e)<<16}for(let r=0;r<=255;r++)se[1][r]=se[0][r]>>8^se[0][255&se[0][r]];for(let r=0;r<=255;r++)se[2][r]=se[1][r]>>8^se[0][255&se[1][r]];for(let r=0;r<=255;r++)se[3][r]=se[2][r]>>8^se[0][255&se[2][r]];const Sc=function(){const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,255,!0),new Int16Array(r)[0]===255}();function Is(r){for(let e=0;e=0&&n!==r.length-1&&(e=r.slice(0,n),t=r.slice(n+1).substr(0,4)),{body:e,checksum:t}}function Y2(r,e=vt){return new Promise(async(t,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const o=[];let u,c,h,l=o,w=[],y=X2(pi(r,async(K,C)=>{const O=an(K);try{for(;;){let Y=await O.readLine();if(Y===void 0)throw Error("Misformed armored text");if(Y=A.removeTrailingSpaces(Y.replace(/[\r\n]/g,"")),s)if(u)c||s!==2||(i.test(Y)?(w=w.join(`\r -`),c=!0,Is(l),l=[],u=!1):w.push(Y.replace(/^- /,"")));else if(i.test(Y)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(Y)){if(Is(l),u=!0,c||s!==2){t({text:w,data:y,headers:o,type:s});break}}else l.push(Y);else i.test(Y)&&(s=Ec(Y))}}catch(Y){return void n(Y)}const F=Oe(C);try{for(;;){await F.ready;const{done:Y,value:$}=await O.read();if(Y)throw Error("Misformed armored text");const E=$+"";if(E.indexOf("=")!==-1||E.indexOf("-")!==-1){let W=await O.readToEnd();W.length||(W=""),W=E+W,W=A.removeTrailingSpaces(W.replace(/\r/g,""));const H=W.split(i);if(H.length===1)throw Error("Misformed armored text");const j=Pc(H[0].slice(0,-1));h=j.checksum,await F.write(j.body);break}await F.write(E)}await F.ready,await F.close()}catch(Y){await F.abort(Y)}}));y=pi(y,async(K,C)=>{const O=ar(Sr(V2(K)));O.catch(()=>{}),await yi(K,C,{preventClose:!0});const F=Oe(C);try{const Y=(await O).replace(` +`,t}function Sr(r){return ur(function(e){let t=13501623;return Qt(e,n=>{const i=Sc?Math.floor(n.length/4):0,a=new Uint32Array(n.buffer,n.byteOffset,i);for(let s=0;s>24&255]^se[1][t>>16&255]^se[2][t>>8&255]^se[3][t>>0&255];for(let s=4*i;s>8^se[0][255&t^n[s]]},()=>new Uint8Array([t,t>>8,t>>16]))}(r))}const se=[Array(255),Array(255),Array(255),Array(255)];for(let r=0;r<=255;r++){let e=r<<16;for(let t=0;t<8;t++)e=e<<1^(8388608&e?8801531:0);se[0][r]=(16711680&e)>>16|65280&e|(255&e)<<16}for(let r=0;r<=255;r++)se[1][r]=se[0][r]>>8^se[0][255&se[0][r]];for(let r=0;r<=255;r++)se[2][r]=se[1][r]>>8^se[0][255&se[1][r]];for(let r=0;r<=255;r++)se[3][r]=se[2][r]>>8^se[0][255&se[2][r]];const Sc=function(){const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,255,!0),new Int16Array(r)[0]===255}();function Is(r){for(let e=0;e=0&&n!==r.length-1&&(e=r.slice(0,n),t=r.slice(n+1).substr(0,4)),{body:e,checksum:t}}function Y2(r,e=vt){return new Promise(async(t,n)=>{try{const i=/^-----[^-]+-----$/m,a=/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*$/;let s;const o=[];let u,c,h,l=o,w=[],y=X2(pi(r,async(K,C)=>{const O=an(K);try{for(;;){let Y=await O.readLine();if(Y===void 0)throw Error("Misformed armored text");if(Y=_.removeTrailingSpaces(Y.replace(/[\r\n]/g,"")),s)if(u)c||s!==2||(i.test(Y)?(w=w.join(`\r +`),c=!0,Is(l),l=[],u=!1):w.push(Y.replace(/^- /,"")));else if(i.test(Y)&&n(Error("Mandatory blank line missing between armor headers and armor data")),a.test(Y)){if(Is(l),u=!0,c||s!==2){t({text:w,data:y,headers:o,type:s});break}}else l.push(Y);else i.test(Y)&&(s=Ec(Y))}}catch(Y){return void n(Y)}const F=Oe(C);try{for(;;){await F.ready;const{done:Y,value:$}=await O.read();if(Y)throw Error("Misformed armored text");const E=$+"";if(E.indexOf("=")!==-1||E.indexOf("-")!==-1){let W=await O.readToEnd();W.length||(W=""),W=E+W,W=_.removeTrailingSpaces(W.replace(/\r/g,""));const H=W.split(i);if(H.length===1)throw Error("Misformed armored text");const j=Pc(H[0].slice(0,-1));h=j.checksum,await F.write(j.body);break}await F.write(E)}await F.ready,await F.close()}catch(Y){await F.abort(Y)}}));y=pi(y,async(K,C)=>{const O=ar(Sr(V2(K)));O.catch(()=>{}),await yi(K,C,{preventClose:!0});const F=Oe(C);try{const Y=(await O).replace(` `,"");if(h!==Y&&(h||e.checksumRequired))throw Error("Ascii armor integrity check failed");await F.ready,await F.close()}catch(Y){await F.abort(Y)}})}catch(i){n(i)}}).then(async t=>(le(t.data)&&(t.data=await ar(t.data)),t))}function Ga(r,e,t,n,i,a=vt){let s,o;r===p.armor.signed&&(s=e.text,o=e.hash,e=e.data);const u=V2(e),c=[];switch(r){case p.armor.multipartSection:c.push("-----BEGIN PGP MESSAGE, PART "+t+"/"+n+`----- `),c.push(Fr(i,a)),c.push(ur(e)),c.push("=",Sr(u)),c.push("-----END PGP MESSAGE, PART "+t+"/"+n+`----- `);break;case p.armor.multipartLast:c.push("-----BEGIN PGP MESSAGE, PART "+t+`----- @@ -29,8 +29,8 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./bn.interface.min-C3c `),c.push(Fr(i,a)),c.push(ur(e)),c.push("=",Sr(u)),c.push(`-----END PGP PRIVATE KEY BLOCK----- `);break;case p.armor.signature:c.push(`-----BEGIN PGP SIGNATURE----- `),c.push(Fr(i,a)),c.push(ur(e)),c.push("=",Sr(u)),c.push(`-----END PGP SIGNATURE----- -`)}return A.concat(c)}class xn{constructor(){this.bytes=""}read(e){return this.bytes=A.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return A.stringToUint8Array(this.bytes)}toHex(){return A.uint8ArrayToHex(A.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return this.bytes===""}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new xn;return t.read(A.hexToUint8Array(e)),t}static wildcard(){const e=new xn;return e.read(new Uint8Array(8)),e}}var Kt=function(){var r,e,t=!1;function n(l,w){var y=r[(e[l]+e[w])%255];return l!==0&&w!==0||(y=0),y}var i,a,s,o,u=!1;function c(){function l(C){var O,F,Y;for(F=Y=function($){var E=r[255-e[$]];return $===0&&(E=0),E}(C),O=0;O<4;O++)Y^=F=255&(F<<1|F>>>7);return Y^=99}t||function(){r=[],e=[];var C,O,F=1;for(C=0;C<255;C++)r[C]=F,O=128&F,F<<=1,F&=255,O===128&&(F^=27),F^=r[C],e[r[C]]=C;r[255]=r[0],e[0]=0,t=!0}(),i=[],a=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var w=0;w<256;w++){var y=l(w);i[w]=y,a[y]=w,s[0][w]=n(2,y)<<24|y<<16|y<<8|n(3,y),o[0][y]=n(14,w)<<24|n(9,w)<<16|n(13,w)<<8|n(11,w);for(var K=1;K<4;K++)s[K][w]=s[K-1][w]>>>8|s[K-1][w]<<24,o[K][y]=o[K-1][y]>>>8|o[K-1][y]<<24}u=!0}var h=function(l,w){u||c();var y=new Uint32Array(w);y.set(i,512),y.set(a,768);for(var K=0;K<4;K++)y.set(s[K],4096+1024*K>>2),y.set(o[K],8192+1024*K>>2);var C=function(O,F,Y){var $=0,E=0,W=0,H=0,j=0,V=0,Z=0,tt=0,rt=0,dt=0,lt=0,N=0,ft=0,Pt=0,q=0,it=0,mt=0,bt=0,yt=0,pt=0,gt=0,ot=new O.Uint32Array(Y),S=new O.Uint8Array(Y);function M(v,k,nt,at,St,It,zt,Dt){v=v|0,k=k|0,nt=nt|0,at=at|0,St=St|0,It=It|0,zt=zt|0,Dt=Dt|0;var Wt=0,Yt=0,Jt=0,ne=0,xt=0,Nt=0,Lt=0,Et=0;for(Wt=nt|1024,Yt=nt|2048,Jt=nt|3072,St=St^ot[(v|0)>>2],It=It^ot[(v|4)>>2],zt=zt^ot[(v|8)>>2],Dt=Dt^ot[(v|12)>>2],Et=16;(Et|0)<=at<<4;Et=Et+16|0)ne=ot[(nt|St>>22&1020)>>2]^ot[(Wt|It>>14&1020)>>2]^ot[(Yt|zt>>6&1020)>>2]^ot[(Jt|Dt<<2&1020)>>2]^ot[(v|Et|0)>>2],xt=ot[(nt|It>>22&1020)>>2]^ot[(Wt|zt>>14&1020)>>2]^ot[(Yt|Dt>>6&1020)>>2]^ot[(Jt|St<<2&1020)>>2]^ot[(v|Et|4)>>2],Nt=ot[(nt|zt>>22&1020)>>2]^ot[(Wt|Dt>>14&1020)>>2]^ot[(Yt|St>>6&1020)>>2]^ot[(Jt|It<<2&1020)>>2]^ot[(v|Et|8)>>2],Lt=ot[(nt|Dt>>22&1020)>>2]^ot[(Wt|St>>14&1020)>>2]^ot[(Yt|It>>6&1020)>>2]^ot[(Jt|zt<<2&1020)>>2]^ot[(v|Et|12)>>2],St=ne,It=xt,zt=Nt,Dt=Lt;$=ot[(k|St>>22&1020)>>2]<<24^ot[(k|It>>14&1020)>>2]<<16^ot[(k|zt>>6&1020)>>2]<<8^ot[(k|Dt<<2&1020)>>2]^ot[(v|Et|0)>>2],E=ot[(k|It>>22&1020)>>2]<<24^ot[(k|zt>>14&1020)>>2]<<16^ot[(k|Dt>>6&1020)>>2]<<8^ot[(k|St<<2&1020)>>2]^ot[(v|Et|4)>>2],W=ot[(k|zt>>22&1020)>>2]<<24^ot[(k|Dt>>14&1020)>>2]<<16^ot[(k|St>>6&1020)>>2]<<8^ot[(k|It<<2&1020)>>2]^ot[(v|Et|8)>>2],H=ot[(k|Dt>>22&1020)>>2]<<24^ot[(k|St>>14&1020)>>2]<<16^ot[(k|It>>6&1020)>>2]<<8^ot[(k|zt<<2&1020)>>2]^ot[(v|Et|12)>>2]}function b(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,v,k,nt,at)}function f(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0;var St=0;M(1024,3072,8192,gt,v,at,nt,k),St=E,E=H,H=St}function U(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j^v,V^k,Z^nt,tt^at),j=$,V=E,Z=W,tt=H}function G(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0;var St=0;M(1024,3072,8192,gt,v,at,nt,k),St=E,E=H,H=St,$=$^j,E=E^V,W=W^Z,H=H^tt,j=v,V=k,Z=nt,tt=at}function X(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j,V,Z,tt),j=$=$^v,V=E=E^k,Z=W=W^nt,tt=H=H^at}function Q(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j,V,Z,tt),$=$^v,E=E^k,W=W^nt,H=H^at,j=v,V=k,Z=nt,tt=at}function g(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j,V,Z,tt),j=$,V=E,Z=W,tt=H,$=$^v,E=E^k,W=W^nt,H=H^at}function d(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,rt,dt,lt,N),N=~it&N|it&N+1,lt=~q<|q<+((N|0)==0),dt=~Pt&dt|Pt&dt+((lt|0)==0),rt=~ft&rt|ft&rt+((dt|0)==0),$=$^v,E=E^k,W=W^nt,H=H^at}function m(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0;var St=0,It=0,zt=0,Dt=0,Wt=0,Yt=0,Jt=0,ne=0,xt=0,Nt=0;for(v=v^j,k=k^V,nt=nt^Z,at=at^tt,St=mt|0,It=bt|0,zt=yt|0,Dt=pt|0;(xt|0)<128;xt=xt+1|0)St>>>31&&(Wt=Wt^v,Yt=Yt^k,Jt=Jt^nt,ne=ne^at),St=St<<1|It>>>31,It=It<<1|zt>>>31,zt=zt<<1|Dt>>>31,Dt=Dt<<1,Nt=at&1,at=at>>>1|nt<<31,nt=nt>>>1|k<<31,k=k>>>1|v<<31,v=v>>>1,Nt&&(v=v^3774873600);j=Wt,V=Yt,Z=Jt,tt=ne}function _(v){v=v|0,gt=v}function T(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,$=v,E=k,W=nt,H=at}function P(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,j=v,V=k,Z=nt,tt=at}function z(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,rt=v,dt=k,lt=nt,N=at}function ut(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,ft=v,Pt=k,q=nt,it=at}function st(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,N=~it&N|it&at,lt=~q<|q&nt,dt=~Pt&dt|Pt&k,rt=~ft&rt|ft&v}function ht(v){return v=v|0,v&15?-1:(S[v|0]=$>>>24,S[v|1]=$>>>16&255,S[v|2]=$>>>8&255,S[v|3]=$&255,S[v|4]=E>>>24,S[v|5]=E>>>16&255,S[v|6]=E>>>8&255,S[v|7]=E&255,S[v|8]=W>>>24,S[v|9]=W>>>16&255,S[v|10]=W>>>8&255,S[v|11]=W&255,S[v|12]=H>>>24,S[v|13]=H>>>16&255,S[v|14]=H>>>8&255,S[v|15]=H&255,16)}function I(v){return v=v|0,v&15?-1:(S[v|0]=j>>>24,S[v|1]=j>>>16&255,S[v|2]=j>>>8&255,S[v|3]=j&255,S[v|4]=V>>>24,S[v|5]=V>>>16&255,S[v|6]=V>>>8&255,S[v|7]=V&255,S[v|8]=Z>>>24,S[v|9]=Z>>>16&255,S[v|10]=Z>>>8&255,S[v|11]=Z&255,S[v|12]=tt>>>24,S[v|13]=tt>>>16&255,S[v|14]=tt>>>8&255,S[v|15]=tt&255,16)}function x(){b(0,0,0,0),mt=$,bt=E,yt=W,pt=H}function D(v,k,nt){v=v|0,k=k|0,nt=nt|0;var at=0;if(k&15)return-1;for(;(nt|0)>=16;)R[v&7](S[k|0]<<24|S[k|1]<<16|S[k|2]<<8|S[k|3],S[k|4]<<24|S[k|5]<<16|S[k|6]<<8|S[k|7],S[k|8]<<24|S[k|9]<<16|S[k|10]<<8|S[k|11],S[k|12]<<24|S[k|13]<<16|S[k|14]<<8|S[k|15]),S[k|0]=$>>>24,S[k|1]=$>>>16&255,S[k|2]=$>>>8&255,S[k|3]=$&255,S[k|4]=E>>>24,S[k|5]=E>>>16&255,S[k|6]=E>>>8&255,S[k|7]=E&255,S[k|8]=W>>>24,S[k|9]=W>>>16&255,S[k|10]=W>>>8&255,S[k|11]=W&255,S[k|12]=H>>>24,S[k|13]=H>>>16&255,S[k|14]=H>>>8&255,S[k|15]=H&255,at=at+16|0,k=k+16|0,nt=nt-16|0;return at|0}function B(v,k,nt){v=v|0,k=k|0,nt=nt|0;var at=0;if(k&15)return-1;for(;(nt|0)>=16;)L[v&1](S[k|0]<<24|S[k|1]<<16|S[k|2]<<8|S[k|3],S[k|4]<<24|S[k|5]<<16|S[k|6]<<8|S[k|7],S[k|8]<<24|S[k|9]<<16|S[k|10]<<8|S[k|11],S[k|12]<<24|S[k|13]<<16|S[k|14]<<8|S[k|15]),at=at+16|0,k=k+16|0,nt=nt-16|0;return at|0}var R=[b,f,U,G,X,Q,g,d],L=[U,m];return{set_rounds:_,set_state:T,set_iv:P,set_nonce:z,set_mask:ut,set_counter:st,get_state:ht,get_iv:I,gcm_init:x,cipher:D,mac:B}}({Uint8Array,Uint32Array},l,w);return C.set_key=function(O,F,Y,$,E,W,H,j,V){var Z=y.subarray(0,60),tt=y.subarray(256,316);Z.set([F,Y,$,E,W,H,j,V]);for(var rt=O,dt=1;rt<4*O+28;rt++){var lt=Z[rt-1];(rt%O==0||O===8&&rt%O==4)&&(lt=i[lt>>>24]<<24^i[lt>>>16&255]<<16^i[lt>>>8&255]<<8^i[255<]),rt%O==0&&(lt=lt<<8^lt>>>24^dt<<24,dt=dt<<1^(128&dt?27:0)),Z[rt]=Z[rt-O]^lt}for(var N=0;N=rt-4?lt:o[0][i[lt>>>24]]^o[1][i[lt>>>16&255]]^o[2][i[lt>>>8&255]]^o[3][i[255<]];C.set_rounds(O+5)},C};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function Ts(r){return r instanceof Uint8Array}function Wa(r,e){const t=r?r.byteLength:65536;if(4095&t||t<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return r=r||new Uint8Array(new ArrayBuffer(t))}function Vr(r,e,t,n,i){const a=r.length-e,s=ai+a.length,0),t=new Uint8Array(e);let n=0;for(let i=0;i>2,a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12),i>16?a.getUint32(16):0,i>16?a.getUint32(20):0,i>24?a.getUint32(24):0,i>24?a.getUint32(28):0),t!==void 0){if(t.length!==16)throw new pr("illegal iv size");let s=new DataView(t.buffer,t.byteOffset,t.byteLength);n.set_iv(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}else n.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!Ts(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:n}=this.acquire_asm(),i=Kt.ENC[this.mode],a=Kt.HEAP_DATA,s=this.pos,o=this.len,u=0,c=e.length||0,h=0,l=0,w=new Uint8Array(o+c&-16);for(;c>0;)l=Vr(t,s+o,e,u,c),o+=l,u+=l,c-=l,l=n.cipher(i,a+s,o),l&&w.set(t.subarray(s,s+l),h),h+=l,l0;)y=Vr(t,s+o,e,u,c),o+=y,u+=y,c-=y,y=n.cipher(i,a+s,o-(c?0:w)),y&&K.set(t.subarray(s,s+y),h),h+=y,y0){if(s%16){if(this.hasOwnProperty("padding"))throw new pr("data length must be a multiple of the block size");s+=16-s%16}if(t.cipher(n,i+a,s),this.hasOwnProperty("padding")&&this.padding){let c=e[a+o-1];if(c<1||c>16||c>o)throw new Ka("bad padding");let h=0;for(let l=c;l>1;l--)h|=c^e[a+o-l];if(h)throw new Ka("bad padding");o-=c}}const u=new Uint8Array(o);return o>0&&u.set(e.subarray(a,a+o)),this.pos=0,this.len=0,this.release_asm(),u}}class i1{static encrypt(e,t,n=!1){return new i1(t,n).encrypt(e)}static decrypt(e,t,n=!1){return new i1(t,n).decrypt(e)}constructor(e,t=!1,n){this.aes=n||new Ei(e,void 0,t,"ECB")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Va(r){const e=function(t){const n=new i1(t);this.encrypt=function(i){return n.encrypt(i)},this.decrypt=function(i){return n.decrypt(i)}};return e.blockSize=e.prototype.blockSize=16,e.keySize=e.prototype.keySize=r/8,e}function ai(r,e,t,n,i,a){const s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],u=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],w=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],y=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let K,C,O,F,Y,$,E,W,H,j,V=0,Z=e.length;const tt=r.length===32?3:9;W=tt===3?t?[0,32,2]:[30,-2,-2]:t?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],t&&(e=function(lt,N){const ft=8-lt.length%8;let Pt;if(N===2&&ft<8)Pt=32;else if(N===1)Pt=ft;else{if(N||!(ft<8)){if(ft===8)return lt;throw Error("des: invalid padding")}Pt=0}const q=new Uint8Array(lt.length+ft);for(let it=0;it>>4^E),E^=O,$^=O<<4,O=65535&($>>>16^E),E^=O,$^=O<<16,O=858993459&(E>>>2^$),$^=O,E^=O<<2,O=16711935&(E>>>8^$),$^=O,E^=O<<8,O=1431655765&($>>>1^E),E^=O,$^=O<<1,$=$<<1|$>>>31,E=E<<1|E>>>31,C=0;C>>4|E<<28)^r[K+1],O=$,$=E,E=O^(o[F>>>24&63]|c[F>>>16&63]|l[F>>>8&63]|y[63&F]|s[Y>>>24&63]|u[Y>>>16&63]|h[Y>>>8&63]|w[63&Y]);O=$,$=E,E=O}$=$>>>1|$<<31,E=E>>>1|E<<31,O=1431655765&($>>>1^E),E^=O,$^=O<<1,O=16711935&(E>>>8^$),$^=O,E^=O<<8,O=858993459&(E>>>2^$),$^=O,E^=O<<2,O=65535&($>>>16^E),E^=O,$^=O<<16,O=252645135&($>>>4^E),E^=O,$^=O<<4,rt[dt++]=$>>>24,rt[dt++]=$>>>16&255,rt[dt++]=$>>>8&255,rt[dt++]=255&$,rt[dt++]=E>>>24,rt[dt++]=E>>>16&255,rt[dt++]=E>>>8&255,rt[dt++]=255&E}return t||(rt=function(lt,N){let ft,Pt=null;if(N===2)ft=32;else if(N===1)Pt=lt[lt.length-1];else{if(N)throw Error("des: invalid padding");ft=0}if(!Pt){for(Pt=1;lt[lt.length-Pt]===ft;)Pt++;Pt--}return lt.subarray(0,lt.length-Pt)}(rt,a)),rt}function si(r){const e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],t=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],w=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],K=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],C=r.length>8?3:1,O=Array(32*C),F=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Y,$,E,W=0,H=0;for(let j=0;j>>4^Z),Z^=E,V^=E<<4,E=65535&(Z>>>-16^V),V^=E,Z^=E<<-16,E=858993459&(V>>>2^Z),Z^=E,V^=E<<2,E=65535&(Z>>>-16^V),V^=E,Z^=E<<-16,E=1431655765&(V>>>1^Z),Z^=E,V^=E<<1,E=16711935&(Z>>>8^V),V^=E,Z^=E<<8,E=1431655765&(V>>>1^Z),Z^=E,V^=E<<1,E=V<<8|Z>>>20&240,V=Z<<24|Z<<8&16711680|Z>>>8&65280|Z>>>24&240,Z=E;for(let tt=0;tt<16;tt++)F[tt]?(V=V<<2|V>>>26,Z=Z<<2|Z>>>26):(V=V<<1|V>>>27,Z=Z<<1|Z>>>27),V&=-15,Z&=-15,Y=e[V>>>28]|t[V>>>24&15]|n[V>>>20&15]|i[V>>>16&15]|a[V>>>12&15]|s[V>>>8&15]|o[V>>>4&15],$=u[Z>>>28]|c[Z>>>24&15]|h[Z>>>20&15]|l[Z>>>16&15]|w[Z>>>12&15]|y[Z>>>8&15]|K[Z>>>4&15],E=65535&($>>>16^Y),O[H++]=Y^E,O[H++]=$^E<<16}return O}function Vn(r){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(r.subarray(8*e,8*e+8)));this.encrypt=function(e){return ai(si(this.key[2]),ai(si(this.key[1]),ai(si(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function Uc(){this.BlockSize=8,this.KeySize=16,this.setKey=function(s){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),s.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(s),!0},this.reset=function(){for(let s=0;s<16;s++)this.masking[s]=0,this.rotate[s]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>>16&255,o[u+6]=h>>>8&255,o[u+7]=255&h}return o},this.decrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>16&255,o[u+6]=h>>8&255,o[u+7]=255&h}return o};const r=[,,,,];r[0]=[,,,,],r[0][0]=[4,0,13,15,12,14,8],r[0][1]=[5,2,16,18,17,19,10],r[0][2]=[6,3,23,22,21,20,9],r[0][3]=[7,1,26,25,27,24,11],r[1]=[,,,,],r[1][0]=[0,6,21,23,20,22,16],r[1][1]=[1,4,0,2,1,3,18],r[1][2]=[2,5,7,6,5,4,17],r[1][3]=[3,7,10,9,11,8,19],r[2]=[,,,,],r[2][0]=[4,0,13,15,12,14,8],r[2][1]=[5,2,16,18,17,19,10],r[2][2]=[6,3,23,22,21,20,9],r[2][3]=[7,1,26,25,27,24,11],r[3]=[,,,,],r[3][0]=[0,6,21,23,20,22,16],r[3][1]=[1,4,0,2,1,3,18],r[3][2]=[2,5,7,6,5,4,17],r[3][3]=[3,7,10,9,11,8,19];const e=[,,,,];function t(s,o,u){const c=o+s,h=c<>>32-u;return(a[0][h>>>24]^a[1][h>>>16&255])-a[2][h>>>8&255]+a[3][255&h]}function n(s,o,u){const c=o^s,h=c<>>32-u;return a[0][h>>>24]-a[1][h>>>16&255]+a[2][h>>>8&255]^a[3][255&h]}function i(s,o,u){const c=o-s,h=c<>>32-u;return(a[0][h>>>24]+a[1][h>>>16&255]^a[2][h>>>8&255])-a[3][255&h]}e[0]=[,,,,],e[0][0]=[24,25,23,22,18],e[0][1]=[26,27,21,20,22],e[0][2]=[28,29,19,18,25],e[0][3]=[30,31,17,16,28],e[1]=[,,,,],e[1][0]=[3,2,12,13,8],e[1][1]=[1,0,14,15,13],e[1][2]=[7,6,8,9,3],e[1][3]=[5,4,10,11,7],e[2]=[,,,,],e[2][0]=[19,18,28,29,25],e[2][1]=[17,16,30,31,28],e[2][2]=[23,22,24,25,18],e[2][3]=[21,20,26,27,22],e[3]=[,,,,],e[3][0]=[8,9,7,6,3],e[3][1]=[10,11,5,4,7],e[3][2]=[12,13,3,2,8],e[3][3]=[14,15,1,0,13],this.keySchedule=function(s){const o=[,,,,,,,,],u=Array(32);let c;for(let y=0;y<4;y++)c=4*y,o[y]=s[c]<<24|s[c+1]<<16|s[c+2]<<8|s[c+3];const h=[6,7,4,5];let l,w=0;for(let y=0;y<2;y++)for(let K=0;K<4;K++){for(c=0;c<4;c++){const C=r[K][c];l=o[C[1]],l^=a[4][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[5][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[6][o[C[4]>>>2]>>>24-8*(3&C[4])&255],l^=a[7][o[C[5]>>>2]>>>24-8*(3&C[5])&255],l^=a[h[c]][o[C[6]>>>2]>>>24-8*(3&C[6])&255],o[C[0]]=l}for(c=0;c<4;c++){const C=e[K][c];l=a[4][o[C[0]>>>2]>>>24-8*(3&C[0])&255],l^=a[5][o[C[1]>>>2]>>>24-8*(3&C[1])&255],l^=a[6][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[7][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[4+c][o[C[4]>>>2]>>>24-8*(3&C[4])&255],u[w]=l,w++}}for(let y=0;y<16;y++)this.masking[y]=u[y],this.rotate[y]=31&u[16+y]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Zn(r){this.cast5=new Uc,this.cast5.setKey(r),this.encrypt=function(e){return this.cast5.encrypt(e)}}Vn.keySize=Vn.prototype.keySize=24,Vn.blockSize=Vn.prototype.blockSize=8,Zn.blockSize=Zn.prototype.blockSize=8,Zn.keySize=Zn.prototype.keySize=16;const Se=4294967295;function Me(r,e){return(r<>>32-e)&Se}function sr(r,e){return r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24}function _r(r,e,t){r.splice(e,4,255&t,t>>>8&255,t>>>16&255,t>>>24&255)}function At(r,e){return r>>>8*e&255}function Xn(r){this.tf=function(){let e=null,t=null,n=-1,i=[],a=[[],[],[],[]];function s(h){return a[0][At(h,0)]^a[1][At(h,1)]^a[2][At(h,2)]^a[3][At(h,3)]}function o(h){return a[0][At(h,3)]^a[1][At(h,0)]^a[2][At(h,1)]^a[3][At(h,2)]}function u(h,l){let w=s(l[0]),y=o(l[1]);l[2]=Me(l[2]^w+y+i[4*h+8]&Se,31),l[3]=Me(l[3],1)^w+2*y+i[4*h+9]&Se,w=s(l[2]),y=o(l[3]),l[0]=Me(l[0]^w+y+i[4*h+10]&Se,31),l[1]=Me(l[1],1)^w+2*y+i[4*h+11]&Se}function c(h,l){let w=s(l[0]),y=o(l[1]);l[2]=Me(l[2],1)^w+y+i[4*h+10]&Se,l[3]=Me(l[3]^w+2*y+i[4*h+11]&Se,31),w=s(l[2]),y=o(l[3]),l[0]=Me(l[0],1)^w+y+i[4*h+8]&Se,l[1]=Me(l[1]^w+2*y+i[4*h+9]&Se,31)}return{name:"twofish",blocksize:16,open:function(h){let l,w,y,K,C;e=h;const O=[],F=[],Y=[];let $;const E=[];let W,H,j;const V=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],Z=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],tt=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],rt=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],dt=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],lt=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],N=[[],[]],ft=[[],[],[],[]];function Pt(yt){return yt^yt>>2^[0,90,180,238][3&yt]}function q(yt){return yt^yt>>1^yt>>2^[0,238,180,90][3&yt]}function it(yt,pt){let gt,ot,S;for(gt=0;gt<8;gt++)ot=pt>>>24,pt=pt<<8&Se|yt>>>24,yt=yt<<8&Se,S=ot<<1,128&ot&&(S^=333),pt^=ot^S<<16,S^=ot>>>1,1&ot&&(S^=166),pt^=S<<24|S<<8;return pt}function mt(yt,pt){const gt=pt>>4,ot=15&pt,S=V[yt][gt^ot],M=Z[yt][dt[ot]^lt[gt]];return rt[yt][dt[M]^lt[S]]<<4|tt[yt][S^M]}function bt(yt,pt){let gt=At(yt,0),ot=At(yt,1),S=At(yt,2),M=At(yt,3);switch($){case 4:gt=N[1][gt]^At(pt[3],0),ot=N[0][ot]^At(pt[3],1),S=N[0][S]^At(pt[3],2),M=N[1][M]^At(pt[3],3);case 3:gt=N[1][gt]^At(pt[2],0),ot=N[1][ot]^At(pt[2],1),S=N[0][S]^At(pt[2],2),M=N[0][M]^At(pt[2],3);case 2:gt=N[0][N[0][gt]^At(pt[1],0)]^At(pt[0],0),ot=N[0][N[1][ot]^At(pt[1],1)]^At(pt[0],1),S=N[1][N[0][S]^At(pt[1],2)]^At(pt[0],2),M=N[1][N[1][M]^At(pt[1],3)]^At(pt[0],3)}return ft[0][gt]^ft[1][ot]^ft[2][S]^ft[3][M]}for(e=e.slice(0,32),l=e.length;l!==16&&l!==24&&l!==32;)e[l++]=0;for(l=0;l>2]=sr(e,l);for(l=0;l<256;l++)N[0][l]=mt(0,l),N[1][l]=mt(1,l);for(l=0;l<256;l++)W=N[1][l],H=Pt(W),j=q(W),ft[0][l]=W+(H<<8)+(j<<16)+(j<<24),ft[2][l]=H+(j<<8)+(W<<16)+(j<<24),W=N[0][l],H=Pt(W),j=q(W),ft[1][l]=j+(j<<8)+(H<<16)+(W<<24),ft[3][l]=H+(W<<8)+(j<<16)+(H<<24);for($=Y.length/2,l=0;l<$;l++)w=Y[l+l],O[l]=w,y=Y[l+l+1],F[l]=y,E[$-l-1]=it(w,y);for(l=0;l<40;l+=2)w=16843009*l,y=w+16843009,w=bt(w,O),y=Me(bt(y,F),8),i[l]=w+y&Se,i[l+1]=Me(w+2*y,9);for(l=0;l<256;l++)switch(w=y=K=C=l,$){case 4:w=N[1][w]^At(E[3],0),y=N[0][y]^At(E[3],1),K=N[0][K]^At(E[3],2),C=N[1][C]^At(E[3],3);case 3:w=N[1][w]^At(E[2],0),y=N[1][y]^At(E[2],1),K=N[0][K]^At(E[2],2),C=N[0][C]^At(E[2],3);case 2:a[0][l]=ft[0][N[0][N[0][w]^At(E[1],0)]^At(E[0],0)],a[1][l]=ft[1][N[0][N[1][y]^At(E[1],1)]^At(E[0],1)],a[2][l]=ft[2][N[1][N[0][K]^At(E[1],2)]^At(E[0],2)],a[3][l]=ft[3][N[1][N[1][C]^At(E[1],3)]^At(E[0],3)]}},close:function(){i=[],a=[[],[],[],[]]},encrypt:function(h,l){t=h,n=l;const w=[sr(t,n)^i[0],sr(t,n+4)^i[1],sr(t,n+8)^i[2],sr(t,n+12)^i[3]];for(let y=0;y<8;y++)u(y,w);return _r(t,n,w[2]^i[4]),_r(t,n+4,w[3]^i[5]),_r(t,n+8,w[0]^i[6]),_r(t,n+12,w[1]^i[7]),n+=16,t},decrypt:function(h,l){t=h,n=l;const w=[sr(t,n)^i[4],sr(t,n+4)^i[5],sr(t,n+8)^i[6],sr(t,n+12)^i[7]];for(let y=7;y>=0;y--)c(y,w);_r(t,n,w[2]^i[0]),_r(t,n+4,w[3]^i[1]),_r(t,n+8,w[0]^i[2]),_r(t,n+12,w[1]^i[3]),n+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(r),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Be(){}function Yn(r){this.bf=new Be,this.bf.init(r),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Xn.keySize=Xn.prototype.keySize=32,Xn.blockSize=Xn.prototype.blockSize=16,Be.prototype.BLOCKSIZE=8,Be.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Be.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Be.prototype.NN=16,Be.prototype._clean=function(r){return r<0&&(r=(2147483647&r)+2147483648),r},Be.prototype._F=function(r){let e;const t=255&r,n=255&(r>>>=8),i=255&(r>>>=8),a=255&(r>>>=8);return e=this.sboxes[0][a]+this.sboxes[1][i],e^=this.sboxes[2][n],e+=this.sboxes[3][t],e},Be.prototype._encryptBlock=function(r){let e,t=r[0],n=r[1];for(e=0;e>>24-8*e&255,i[e+n]=t[1]>>>24-8*e&255;return i},Be.prototype._decryptBlock=function(r){let e,t=r[0],n=r[1];for(e=this.NN+1;e>1;--e){t^=this.parray[e],n=this._F(t)^n;const i=t;t=n,n=i}t^=this.parray[1],n^=this.parray[0],r[0]=this._clean(n),r[1]=this._clean(t)},Be.prototype.init=function(r){let e,t=0;for(this.parray=[],e=0;e=r.length&&(t=0);this.parray[e]=this.PARRAY[e]^i}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],t=0;t<256;++t)this.sboxes[e][t]=this.SBOXES[e][t];const n=[0,0];for(e=0;e>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=it+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=mt+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=bt+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=yt+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=pt+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=gt+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=ot+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=S+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=M+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=b+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=f+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=U+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=G+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=X+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,z=Q+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=G^S^mt^q,ut=P<<1|P>>>31,z=ut+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=X^M^bt^it,st=P<<1|P>>>31,z=st+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Q^b^yt^mt,ht=P<<1|P>>>31,z=ht+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=ut^f^pt^bt,I=P<<1|P>>>31,z=I+(g<<5|g>>>27)+T+(d&m|~d&_)+1518500249|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=st^U^gt^yt,x=P<<1|P>>>31,z=x+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=ht^G^ot^pt,D=P<<1|P>>>31,z=D+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=I^X^S^gt,B=P<<1|P>>>31,z=B+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=x^Q^M^ot,R=P<<1|P>>>31,z=R+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=D^ut^b^S,L=P<<1|P>>>31,z=L+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=B^st^f^M,v=P<<1|P>>>31,z=v+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=R^ht^U^b,k=P<<1|P>>>31,z=k+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=L^I^G^f,nt=P<<1|P>>>31,z=nt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=v^x^X^U,at=P<<1|P>>>31,z=at+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=k^D^Q^G,St=P<<1|P>>>31,z=St+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=nt^B^ut^X,It=P<<1|P>>>31,z=It+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=at^R^st^Q,zt=P<<1|P>>>31,z=zt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=St^L^ht^ut,Dt=P<<1|P>>>31,z=Dt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=It^v^I^st,Wt=P<<1|P>>>31,z=Wt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=zt^k^x^ht,Yt=P<<1|P>>>31,z=Yt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Dt^nt^D^I,Jt=P<<1|P>>>31,z=Jt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Wt^at^B^x,ne=P<<1|P>>>31,z=ne+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Yt^St^R^D,xt=P<<1|P>>>31,z=xt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Jt^It^L^B,Nt=P<<1|P>>>31,z=Nt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=ne^zt^v^R,Lt=P<<1|P>>>31,z=Lt+(g<<5|g>>>27)+T+(d^m^_)+1859775393|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=xt^Dt^k^L,Et=P<<1|P>>>31,z=Et+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Nt^Wt^nt^v,jt=P<<1|P>>>31,z=jt+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Lt^Yt^at^k,$t=P<<1|P>>>31,z=$t+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Et^Jt^St^nt,Ht=P<<1|P>>>31,z=Ht+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=jt^ne^It^at,J=P<<1|P>>>31,z=J+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=$t^xt^zt^St,et=P<<1|P>>>31,z=et+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ht^Nt^Dt^It,ct=P<<1|P>>>31,z=ct+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=J^Lt^Wt^zt,wt=P<<1|P>>>31,z=wt+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=et^Et^Yt^Dt,kt=P<<1|P>>>31,z=kt+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=ct^jt^Jt^Wt,Ut=P<<1|P>>>31,z=Ut+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=wt^$t^ne^Yt,_t=P<<1|P>>>31,z=_t+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=kt^Ht^xt^Jt,Mt=P<<1|P>>>31,z=Mt+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ut^J^Nt^ne,qt=P<<1|P>>>31,z=qt+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=_t^et^Lt^xt,De=P<<1|P>>>31,z=De+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Mt^ct^Et^Nt,Ce=P<<1|P>>>31,z=Ce+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=qt^wt^jt^Lt,Ie=P<<1|P>>>31,z=Ie+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=De^kt^$t^Et,Ne=P<<1|P>>>31,z=Ne+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ce^Ut^Ht^jt,sn=P<<1|P>>>31,z=sn+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ie^_t^J^$t,on=P<<1|P>>>31,z=on+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ne^Mt^et^Ht,cn=P<<1|P>>>31,z=cn+(g<<5|g>>>27)+T+(d&m|d&_|m&_)-1894007588|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=sn^qt^ct^J,un=P<<1|P>>>31,z=un+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=on^De^wt^et,hn=P<<1|P>>>31,z=hn+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=cn^Ce^kt^ct,ln=P<<1|P>>>31,z=ln+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=un^Ie^Ut^wt,fn=P<<1|P>>>31,z=fn+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=hn^Ne^_t^kt,Ln=P<<1|P>>>31,z=Ln+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=ln^sn^Mt^Ut,On=P<<1|P>>>31,z=On+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=fn^on^qt^_t,Di=P<<1|P>>>31,z=Di+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ln^cn^De^Mt,Ci=P<<1|P>>>31,z=Ci+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=On^un^Ce^qt,Ii=P<<1|P>>>31,z=Ii+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Di^hn^Ie^De,Ti=P<<1|P>>>31,z=Ti+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ci^ln^Ne^Ce,Bi=P<<1|P>>>31,z=Bi+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ii^fn^sn^Ie,Ri=P<<1|P>>>31,z=Ri+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ti^Ln^on^Ne,L1=P<<1|P>>>31,z=L1+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Bi^On^cn^sn,O1=P<<1|P>>>31,z=O1+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=Ri^Di^un^on,N1=P<<1|P>>>31,z=N1+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=L1^Ci^hn^cn,M1=P<<1|P>>>31,z=M1+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=O1^Ii^ln^un,$1=P<<1|P>>>31,z=$1+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=N1^Ti^fn^hn,cs=P<<1|P>>>31,z=cs+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=M1^Bi^Ln^ln,us=P<<1|P>>>31,z=us+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,P=$1^Ri^On^fn,hs=P<<1|P>>>31,z=hs+(g<<5|g>>>27)+T+(d^m^_)-899497514|0,T=_,_=m,m=d<<30|d>>>2,d=g,g=z,n=n+g|0,i=i+d|0,a=a+m|0,s=s+_|0,o=o+T|0}function H(q){q=q|0,W(E[q|0]<<24|E[q|1]<<16|E[q|2]<<8|E[q|3],E[q|4]<<24|E[q|5]<<16|E[q|6]<<8|E[q|7],E[q|8]<<24|E[q|9]<<16|E[q|10]<<8|E[q|11],E[q|12]<<24|E[q|13]<<16|E[q|14]<<8|E[q|15],E[q|16]<<24|E[q|17]<<16|E[q|18]<<8|E[q|19],E[q|20]<<24|E[q|21]<<16|E[q|22]<<8|E[q|23],E[q|24]<<24|E[q|25]<<16|E[q|26]<<8|E[q|27],E[q|28]<<24|E[q|29]<<16|E[q|30]<<8|E[q|31],E[q|32]<<24|E[q|33]<<16|E[q|34]<<8|E[q|35],E[q|36]<<24|E[q|37]<<16|E[q|38]<<8|E[q|39],E[q|40]<<24|E[q|41]<<16|E[q|42]<<8|E[q|43],E[q|44]<<24|E[q|45]<<16|E[q|46]<<8|E[q|47],E[q|48]<<24|E[q|49]<<16|E[q|50]<<8|E[q|51],E[q|52]<<24|E[q|53]<<16|E[q|54]<<8|E[q|55],E[q|56]<<24|E[q|57]<<16|E[q|58]<<8|E[q|59],E[q|60]<<24|E[q|61]<<16|E[q|62]<<8|E[q|63])}function j(q){q=q|0,E[q|0]=n>>>24,E[q|1]=n>>>16&255,E[q|2]=n>>>8&255,E[q|3]=n&255,E[q|4]=i>>>24,E[q|5]=i>>>16&255,E[q|6]=i>>>8&255,E[q|7]=i&255,E[q|8]=a>>>24,E[q|9]=a>>>16&255,E[q|10]=a>>>8&255,E[q|11]=a&255,E[q|12]=s>>>24,E[q|13]=s>>>16&255,E[q|14]=s>>>8&255,E[q|15]=s&255,E[q|16]=o>>>24,E[q|17]=o>>>16&255,E[q|18]=o>>>8&255,E[q|19]=o&255}function V(){n=1732584193,i=4023233417,a=2562383102,s=271733878,o=3285377520,u=c=0}function Z(q,it,mt,bt,yt,pt,gt){q=q|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,n=q,i=it,a=mt,s=bt,o=yt,u=pt,c=gt}function tt(q,it){q=q|0,it=it|0;var mt=0;if(q&63)return-1;for(;(it|0)>=64;)H(q),q=q+64|0,it=it-64|0,mt=mt+64|0;return u=u+mt|0,u>>>0>>0&&(c=c+1|0),mt|0}function rt(q,it,mt){q=q|0,it=it|0,mt=mt|0;var bt=0,yt=0;if(q&63||~mt&&mt&31)return-1;if((it|0)>=64){if(bt=tt(q,it)|0,(bt|0)==-1)return-1;q=q+bt|0,it=it-bt|0}if(bt=bt+it|0,u=u+it|0,u>>>0>>0&&(c=c+1|0),E[q|it]=128,(it|0)>=56){for(yt=it+1|0;(yt|0)<64;yt=yt+1|0)E[q|yt]=0;H(q),it=0,E[q|0]=0}for(yt=it+1|0;(yt|0)<59;yt=yt+1|0)E[q|yt]=0;return E[q|56]=c>>>21&255,E[q|57]=c>>>13&255,E[q|58]=c>>>5&255,E[q|59]=c<<3&255|u>>>29,E[q|60]=u>>>21&255,E[q|61]=u>>>13&255,E[q|62]=u>>>5&255,E[q|63]=u<<3&255,H(q),~mt&&j(mt),bt|0}function dt(){n=h,i=l,a=w,s=y,o=K,u=64,c=0}function lt(){n=C,i=O,a=F,s=Y,o=$,u=64,c=0}function N(q,it,mt,bt,yt,pt,gt,ot,S,M,b,f,U,G,X,Q){q=q|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,ot=ot|0,S=S|0,M=M|0,b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,V(),W(q^1549556828,it^1549556828,mt^1549556828,bt^1549556828,yt^1549556828,pt^1549556828,gt^1549556828,ot^1549556828,S^1549556828,M^1549556828,b^1549556828,f^1549556828,U^1549556828,G^1549556828,X^1549556828,Q^1549556828),C=n,O=i,F=a,Y=s,$=o,V(),W(q^909522486,it^909522486,mt^909522486,bt^909522486,yt^909522486,pt^909522486,gt^909522486,ot^909522486,S^909522486,M^909522486,b^909522486,f^909522486,U^909522486,G^909522486,X^909522486,Q^909522486),h=n,l=i,w=a,y=s,K=o,u=64,c=0}function ft(q,it,mt){q=q|0,it=it|0,mt=mt|0;var bt=0,yt=0,pt=0,gt=0,ot=0,S=0;return q&63||~mt&&mt&31?-1:(S=rt(q,it,-1)|0,bt=n,yt=i,pt=a,gt=s,ot=o,lt(),W(bt,yt,pt,gt,ot,2147483648,0,0,0,0,0,0,0,0,0,672),~mt&&j(mt),S|0)}function Pt(q,it,mt,bt,yt){q=q|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0;var pt=0,gt=0,ot=0,S=0,M=0,b=0,f=0,U=0,G=0,X=0;if(q&63||~yt&&yt&31)return-1;for(E[q+it|0]=mt>>>24,E[q+it+1|0]=mt>>>16&255,E[q+it+2|0]=mt>>>8&255,E[q+it+3|0]=mt&255,ft(q,it+4|0,-1)|0,pt=b=n,gt=f=i,ot=U=a,S=G=s,M=X=o,bt=bt-1|0;(bt|0)>0;)dt(),W(b,f,U,G,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,G=s,X=o,lt(),W(b,f,U,G,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,G=s,X=o,pt=pt^n,gt=gt^i,ot=ot^a,S=S^s,M=M^o,bt=bt-1|0;return n=pt,i=gt,a=ot,s=S,o=M,~yt&&j(yt),0}return{reset:V,init:Z,process:tt,finish:rt,hmac_reset:dt,hmac_init:N,hmac_finish:ft,pbkdf2_generate_block:Pt}};class J2{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(this.result!==null)throw new Ua("state must be reset before processing new data");const{asm:t,heap:n}=this.acquire_asm();let i=this.pos,a=this.len,s=0,o=e.length,u=0;for(;o>0;)u=Vr(n,i+a,e,s,o),a+=u,s+=u,o-=u,u=t.process(i,a),i+=u,a-=u,a||(i=0);return this.pos=i,this.len=a,this}finish(){if(this.result!==null)throw new Ua("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const zs=[],Ls=[];class Zr extends J2{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=zs.pop()||Wa(),this.asm=Ls.pop()||Q2({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(zs.push(this.heap),Ls.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Zr().process(e).finish().result}}Zr.NAME="sha1",Zr.heap_pool=[],Zr.asm_pool=[],Zr.asm_function=Q2;const Os=[],Ns=[];class U1 extends J2{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=Os.pop()||Wa(),this.asm=Ns.pop()||function(e,t,n){var i=0,a=0,s=0,o=0,u=0,c=0,h=0,l=0,w=0,y=0,K=0,C=0,O=0,F=0,Y=0,$=0,E=0,W=0,H=0,j=0,V=0,Z=0,tt=0,rt=0,dt=0,lt=0,N=new e.Uint8Array(n);function ft(b,f,U,G,X,Q,g,d,m,_,T,P,z,ut,st,ht){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,g=g|0,d=d|0,m=m|0,_=_|0,T=T|0,P=P|0,z=z|0,ut=ut|0,st=st|0,ht=ht|0;var I=0,x=0,D=0,B=0,R=0,L=0,v=0,k=0;I=i,x=a,D=s,B=o,R=u,L=c,v=h,k=l,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1116352408|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+1899447441|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+3049323471|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+3921009573|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+961987163|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1508970993|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2453635748|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+2870763221|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3624381080|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=_+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+310598401|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+607225278|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+1426881987|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+1925078388|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+2162078206|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2614888103|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+3248222580|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+b+_|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3835390401|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+T|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+4022224774|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(G>>>7^G>>>18^G>>>3^G<<25^G<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+264347078|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,G=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+G+z|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+604807628|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Q>>>7^Q>>>18^Q>>>3^Q<<25^Q<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ut|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+770255983|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Q=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(G>>>17^G>>>19^G>>>10^G<<15^G<<13)+Q+st|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1249150122|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+ht|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1555081692|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Q>>>17^Q>>>19^Q>>>10^Q<<15^Q<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+1996064986|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,m=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2554220882|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,_=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+_+U|0,v=_+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+2821834349|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,T=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+T+G|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2952996808|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+P+X|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+3210313671|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Q|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+3336571891|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ut+g|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+3584528711|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+113926993|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,ht=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+338241895|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+b+_|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+666307205|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+T|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+773529912|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(G>>>7^G>>>18^G>>>3^G<<25^G<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+1294757372|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,G=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+G+z|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+1396182291|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Q>>>7^Q>>>18^Q>>>3^Q<<25^Q<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ut|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+1695183700|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Q=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(G>>>17^G>>>19^G>>>10^G<<15^G<<13)+Q+st|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1986661051|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+ht|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2177026350|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Q>>>17^Q>>>19^Q>>>10^Q<<15^Q<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+2456956037|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,m=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2730485921|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,_=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+_+U|0,v=_+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+2820302411|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,T=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+T+G|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+3259730800|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+P+X|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+3345764771|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Q|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+3516065817|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ut+g|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+3600352804|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+4094571909|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,ht=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+275423344|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+b+_|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+430227734|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+T|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+506948616|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(G>>>7^G>>>18^G>>>3^G<<25^G<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+659060556|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,G=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+G+z|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+883997877|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Q>>>7^Q>>>18^Q>>>3^Q<<25^Q<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ut|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+958139571|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Q=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(G>>>17^G>>>19^G>>>10^G<<15^G<<13)+Q+st|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1322822218|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+ht|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1537002063|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Q>>>17^Q>>>19^Q>>>10^Q<<15^Q<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+1747873779|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,m=(_>>>7^_>>>18^_>>>3^_<<25^_<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1955562222|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,_=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+_+U|0,v=_+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+2024104815|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,T=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+T+G|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2227730452|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(_>>>17^_>>>19^_>>>10^_<<15^_<<13)+P+X|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+2361852424|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Q|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+2428436474|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ut+g|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+2756734187|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+3204031479|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,ht=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+3329325298|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,i=i+I|0,a=a+x|0,s=s+D|0,o=o+B|0,u=u+R|0,c=c+L|0,h=h+v|0,l=l+k|0}function Pt(b){b=b|0,ft(N[b|0]<<24|N[b|1]<<16|N[b|2]<<8|N[b|3],N[b|4]<<24|N[b|5]<<16|N[b|6]<<8|N[b|7],N[b|8]<<24|N[b|9]<<16|N[b|10]<<8|N[b|11],N[b|12]<<24|N[b|13]<<16|N[b|14]<<8|N[b|15],N[b|16]<<24|N[b|17]<<16|N[b|18]<<8|N[b|19],N[b|20]<<24|N[b|21]<<16|N[b|22]<<8|N[b|23],N[b|24]<<24|N[b|25]<<16|N[b|26]<<8|N[b|27],N[b|28]<<24|N[b|29]<<16|N[b|30]<<8|N[b|31],N[b|32]<<24|N[b|33]<<16|N[b|34]<<8|N[b|35],N[b|36]<<24|N[b|37]<<16|N[b|38]<<8|N[b|39],N[b|40]<<24|N[b|41]<<16|N[b|42]<<8|N[b|43],N[b|44]<<24|N[b|45]<<16|N[b|46]<<8|N[b|47],N[b|48]<<24|N[b|49]<<16|N[b|50]<<8|N[b|51],N[b|52]<<24|N[b|53]<<16|N[b|54]<<8|N[b|55],N[b|56]<<24|N[b|57]<<16|N[b|58]<<8|N[b|59],N[b|60]<<24|N[b|61]<<16|N[b|62]<<8|N[b|63])}function q(b){b=b|0,N[b|0]=i>>>24,N[b|1]=i>>>16&255,N[b|2]=i>>>8&255,N[b|3]=i&255,N[b|4]=a>>>24,N[b|5]=a>>>16&255,N[b|6]=a>>>8&255,N[b|7]=a&255,N[b|8]=s>>>24,N[b|9]=s>>>16&255,N[b|10]=s>>>8&255,N[b|11]=s&255,N[b|12]=o>>>24,N[b|13]=o>>>16&255,N[b|14]=o>>>8&255,N[b|15]=o&255,N[b|16]=u>>>24,N[b|17]=u>>>16&255,N[b|18]=u>>>8&255,N[b|19]=u&255,N[b|20]=c>>>24,N[b|21]=c>>>16&255,N[b|22]=c>>>8&255,N[b|23]=c&255,N[b|24]=h>>>24,N[b|25]=h>>>16&255,N[b|26]=h>>>8&255,N[b|27]=h&255,N[b|28]=l>>>24,N[b|29]=l>>>16&255,N[b|30]=l>>>8&255,N[b|31]=l&255}function it(){i=1779033703,a=3144134277,s=1013904242,o=2773480762,u=1359893119,c=2600822924,h=528734635,l=1541459225,w=y=0}function mt(b,f,U,G,X,Q,g,d,m,_){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,g=g|0,d=d|0,m=m|0,_=_|0,i=b,a=f,s=U,o=G,u=X,c=Q,h=g,l=d,w=m,y=_}function bt(b,f){b=b|0,f=f|0;var U=0;if(b&63)return-1;for(;(f|0)>=64;)Pt(b),b=b+64|0,f=f-64|0,U=U+64|0;return w=w+U|0,w>>>0>>0&&(y=y+1|0),U|0}function yt(b,f,U){b=b|0,f=f|0,U=U|0;var G=0,X=0;if(b&63||~U&&U&31)return-1;if((f|0)>=64){if(G=bt(b,f)|0,(G|0)==-1)return-1;b=b+G|0,f=f-G|0}if(G=G+f|0,w=w+f|0,w>>>0>>0&&(y=y+1|0),N[b|f]=128,(f|0)>=56){for(X=f+1|0;(X|0)<64;X=X+1|0)N[b|X]=0;Pt(b),f=0,N[b|0]=0}for(X=f+1|0;(X|0)<59;X=X+1|0)N[b|X]=0;return N[b|56]=y>>>21&255,N[b|57]=y>>>13&255,N[b|58]=y>>>5&255,N[b|59]=y<<3&255|w>>>29,N[b|60]=w>>>21&255,N[b|61]=w>>>13&255,N[b|62]=w>>>5&255,N[b|63]=w<<3&255,Pt(b),~U&&q(U),G|0}function pt(){i=K,a=C,s=O,o=F,u=Y,c=$,h=E,l=W,w=64,y=0}function gt(){i=H,a=j,s=V,o=Z,u=tt,c=rt,h=dt,l=lt,w=64,y=0}function ot(b,f,U,G,X,Q,g,d,m,_,T,P,z,ut,st,ht){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,g=g|0,d=d|0,m=m|0,_=_|0,T=T|0,P=P|0,z=z|0,ut=ut|0,st=st|0,ht=ht|0,it(),ft(b^1549556828,f^1549556828,U^1549556828,G^1549556828,X^1549556828,Q^1549556828,g^1549556828,d^1549556828,m^1549556828,_^1549556828,T^1549556828,P^1549556828,z^1549556828,ut^1549556828,st^1549556828,ht^1549556828),H=i,j=a,V=s,Z=o,tt=u,rt=c,dt=h,lt=l,it(),ft(b^909522486,f^909522486,U^909522486,G^909522486,X^909522486,Q^909522486,g^909522486,d^909522486,m^909522486,_^909522486,T^909522486,P^909522486,z^909522486,ut^909522486,st^909522486,ht^909522486),K=i,C=a,O=s,F=o,Y=u,$=c,E=h,W=l,w=64,y=0}function S(b,f,U){b=b|0,f=f|0,U=U|0;var G=0,X=0,Q=0,g=0,d=0,m=0,_=0,T=0,P=0;return b&63||~U&&U&31?-1:(P=yt(b,f,-1)|0,G=i,X=a,Q=s,g=o,d=u,m=c,_=h,T=l,gt(),ft(G,X,Q,g,d,m,_,T,2147483648,0,0,0,0,0,0,768),~U&&q(U),P|0)}function M(b,f,U,G,X){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0;var Q=0,g=0,d=0,m=0,_=0,T=0,P=0,z=0,ut=0,st=0,ht=0,I=0,x=0,D=0,B=0,R=0;if(b&63||~X&&X&31)return-1;for(N[b+f|0]=U>>>24,N[b+f+1|0]=U>>>16&255,N[b+f+2|0]=U>>>8&255,N[b+f+3|0]=U&255,S(b,f+4|0,-1)|0,Q=ut=i,g=st=a,d=ht=s,m=I=o,_=x=u,T=D=c,P=B=h,z=R=l,G=G-1|0;(G|0)>0;)pt(),ft(ut,st,ht,I,x,D,B,R,2147483648,0,0,0,0,0,0,768),ut=i,st=a,ht=s,I=o,x=u,D=c,B=h,R=l,gt(),ft(ut,st,ht,I,x,D,B,R,2147483648,0,0,0,0,0,0,768),ut=i,st=a,ht=s,I=o,x=u,D=c,B=h,R=l,Q=Q^i,g=g^a,d=d^s,m=m^o,_=_^u,T=T^c,P=P^h,z=z^l,G=G-1|0;return i=Q,a=g,s=d,o=m,u=_,c=T,h=P,l=z,~X&&q(X),0}return{reset:it,init:mt,process:bt,finish:yt,hmac_reset:pt,hmac_init:ot,hmac_finish:S,pbkdf2_generate_block:M}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(Os.push(this.heap),Ns.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new U1().process(e).finish().result}}U1.NAME="sha256";var K1=to;function to(r,e){if(!r)throw Error(e||"Assertion failed")}to.equal=function(r,e,t){if(r!=e)throw Error(t||"Assertion failed: "+r+" != "+e)};var iu=Qe!==void 0?Qe:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(r,e){return r(e={exports:{}},e.exports),e.exports}function Cc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ic=Za(function(r){r.exports=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),Tc=function(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for((r=r.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(r="0"+r),n=0;n>8,s=255&i;a?t.push(a,s):t.push(s)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(255&r)<<24)>>>0}var Rc=function(r,e){for(var t="",n=0;n>>0}return a},Lc=function(r,e){for(var t=Array(4*r.length),n=0,i=0;n>>24,t[i+1]=a>>>16&255,t[i+2]=a>>>8&255,t[i+3]=255&a):(t[i+3]=a>>>24,t[i+2]=a>>>16&255,t[i+1]=a>>>8&255,t[i]=255&a)}return t},Ct={inherits:Ic,toArray:Tc,toHex:Bc,htonl:eo,toHex32:Rc,zero2:ro,zero8:no,join32:zc,split32:Lc,rotr32:function(r,e){return r>>>e|r<<32-e},rotl32:function(r,e){return r<>>32-e},sum32:function(r,e){return r+e>>>0},sum32_3:function(r,e,t){return r+e+t>>>0},sum32_4:function(r,e,t,n){return r+e+t+n>>>0},sum32_5:function(r,e,t,n,i){return r+e+t+n+i>>>0},sum64:function(r,e,t,n){var i=r[e],a=n+r[e+1]>>>0,s=(a>>0,r[e+1]=a},sum64_hi:function(r,e,t,n){return(e+n>>>0>>0},sum64_lo:function(r,e,t,n){return e+n>>>0},sum64_4_hi:function(r,e,t,n,i,a,s,o){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(r,e,t,n,i,a,s,o){return e+n+a+o>>>0},sum64_5_hi:function(r,e,t,n,i,a,s,o,u,c){var h=0,l=e;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(r,e,t,n,i,a,s,o,u,c){return e+n+a+o+c>>>0},rotr64_hi:function(r,e,t){return(e<<32-t|r>>>t)>>>0},rotr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0},shr64_hi:function(r,e,t){return r>>>t},shr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0}};function Wi(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Oc=Wi;Wi.prototype.update=function(r,e){if(r=Ct.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){var t=(r=this.pending).length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=Ct.join32(r,0,r.length-t,this.endian);for(var n=0;n>>24&255,n[i++]=r>>>16&255,n[i++]=r>>>8&255,n[i++]=255&r}else for(n[i++]=255&r,n[i++]=r>>>8&255,n[i++]=r>>>16&255,n[i++]=r>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},g1_256:function(r){return $e(r,17)^$e(r,19)^r>>>10}},Te=Ct.sum32,Mc=Ct.sum32_4,$c=Ct.sum32_5,Fc=Tn.ch32,Hc=Tn.maj32,jc=Tn.s0_256,qc=Tn.s1_256,Gc=Tn.g0_256,Wc=Tn.g1_256,oo=Xa.BlockHash,Vc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function qe(){if(!(this instanceof qe))return new qe;oo.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Vc,this.W=Array(64)}Ct.inherits(qe,oo);var co=qe;function dr(){if(!(this instanceof dr))return new dr;co.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}qe.blockSize=512,qe.outSize=256,qe.hmacStrength=192,qe.padLength=64,qe.prototype._update=function(r,e){for(var t=this.W,n=0;n<16;n++)t[n]=r[e+n];for(;n>>32-i,t)}function fe(r,e,t,n,i,a,s){return x1(e&t|~e&n,r,e,i,a,s)}function de(r,e,t,n,i,a,s){return x1(e&n|t&~n,r,e,i,a,s)}function ye(r,e,t,n,i,a,s){return x1(e^t^n,r,e,i,a,s)}function pe(r,e,t,n,i,a,s){return x1(t^(e|~n),r,e,i,a,s)}function k3(r){const e=[];let t;for(t=0;t<64;t+=4)e[t>>2]=r.charCodeAt(t)+(r.charCodeAt(t+1)<<8)+(r.charCodeAt(t+2)<<16)+(r.charCodeAt(t+3)<<24);return e}const Hs="0123456789abcdef".split("");function v3(r){let e="",t=0;for(;t<4;t++)e+=Hs[r>>8*t+4&15]+Hs[r>>8*t&15];return e}function Ir(r,e){return r+e&4294967295}const a1=A.getWebCrypto(),s1=A.getNodeCrypto(),_3=s1&&s1.getHashes();function Hr(r){if(s1&&_3.includes(r))return async function(e){const t=s1.createHash(r);return Qt(e,n=>{t.update(n)},()=>new Uint8Array(t.digest()))}}function Li(r,e){return async function(t,n=vt){if(le(t)&&(t=await ar(t)),!A.isStream(t)&&a1&&e&&t.length>=n.minBytesForWebCrypto)return new Uint8Array(await a1.digest(e,t));const i=r();return Qt(t,a=>{i.update(a)},()=>new Uint8Array(i.digest()))}}function js(r,e){return async function(t,n=vt){if(le(t)&&(t=await ar(t)),A.isStream(t)){const i=new r;return Qt(t,a=>{i.process(a)},()=>i.finish().result)}return a1&&e&&t.length>=n.minBytesForWebCrypto?new Uint8Array(await a1.digest(e,t)):r.bytes(t)}}const jr={md5:Hr("md5")||async function(r){const e=function(t){const n=t.length,i=[1732584193,-271733879,-1732584194,271733878];let a;for(a=64;a<=t.length;a+=64)V1(i,k3(t.substring(a-64,a)));t=t.substring(a-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(a=0;a>2]|=t.charCodeAt(a)<<(a%4<<3);if(s[a>>2]|=128<<(a%4<<3),a>55)for(V1(i,s),a=0;a<16;a++)s[a]=0;return s[14]=8*n,V1(i,s),i}(A.uint8ArrayToString(r));return A.hexToUint8Array(function(t){for(let n=0;nnew Uint8Array(O.update(F)))}(r,e,t,n);if(A.isAES(r))return function(l,w,y,K,C){if(A.getWebCrypto()&&w.length!==24&&!A.isStream(y)&&y.length>=3e3*C.minBytesForWebCrypto)return async function(F,Y,$,E){const W="AES-CBC",H=await qs.importKey("raw",Y,{name:W},!1,["encrypt"]),{blockSize:j}=er(F),V=A.concatUint8Array([new Uint8Array(j),$]),Z=new Uint8Array(await qs.encrypt({name:W,iv:E},H,V)).subarray(0,$.length);return function(tt,rt){for(let dt=0;dtO.aes.AES_Encrypt_process(F),()=>O.aes.AES_Encrypt_finish())}(r,e,t,n,i);const s=new(er(r))(e),o=s.blockSize,u=n.slice();let c=new Uint8Array;const h=l=>{l&&(c=A.concatUint8Array([c,l]));const w=new Uint8Array(c.length);let y,K=0;for(;l?c.length>=o:c.length;){const C=s.encrypt(u);for(y=0;ynew Uint8Array(C.update(O)))}(r,e,t,n);if(A.isAES(r))return function(h,l,w,y){if(A.isStream(w)){const K=new An(l,y);return Qt(w,C=>K.aes.AES_Decrypt_process(C),()=>K.aes.AES_Decrypt_finish())}return An.decrypt(w,l,y)}(0,e,t,n);const a=new(er(r))(e),s=a.blockSize;let o=n,u=new Uint8Array;const c=h=>{h&&(u=A.concatUint8Array([u,h]));const l=new Uint8Array(u.length);let w,y=0;for(;h?u.length>=s:u.length;){const K=a.encrypt(o);for(o=u.subarray(0,s),w=0;w48)throw new pr("illegal counter size");let a=Math.pow(2,n)-1;i.set_mask(0,0,a/4294967296|0,0|a)}else n=48,i.set_mask(0,0,65535,4294967295);if(e===void 0)throw Error("nonce is required");{let a=e.length;if(!a||a>16)throw new pr("illegal nonce size");let s=new DataView(new ArrayBuffer(16));new Uint8Array(s.buffer).set(e),i.set_nonce(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}if(t!==void 0){if(t<0||t>=Math.pow(2,n))throw new pr("illegal counter value");i.set_counter(0,0,t/4294967296|0,0|t)}}}class u1{static encrypt(e,t,n=!0,i){return new u1(t,i,n).encrypt(e)}static decrypt(e,t,n=!0,i){return new u1(t,i,n).decrypt(e)}constructor(e,t,n=!0,i){this.aes=i||new Ei(e,t,n,"CBC")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const Gs=A.getWebCrypto(),E3=A.getNodeCrypto(),hr=16;function Ws(r,e){const t=r.length-hr;for(let n=0;n>3),17+(y>>3)),8-(7&y)).subarray(1),F=new Uint8Array(we),Y=new Uint8Array(u.length+Pr);let $,E=0;for($=0;$16)throw new pr("illegal tagSize value");const u=t.length||0,c=new Uint8Array(16);u!==12?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=u>>>29,o[12]=u>>>21&255,o[13]=u>>>13&255,o[14]=u>>>5&255,o[15]=u<<3&255,s.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),s.get_iv(Kt.HEAP_DATA),s.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const h=new DataView(c.buffer);if(this.gamma0=h.getUint32(12),s.set_nonce(h.getUint32(0),h.getUint32(4),h.getUint32(8),0),s.set_mask(0,0,0,4294967295),n!==void 0){if(n.length>X1)throw new pr("illegal adata length");n.length?(this.adata=n,this._gcm_mac_process(n)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");s.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,n,i,a){return new Xr(t,n,i,a).encrypt(e)}static decrypt(e,t,n,i,a){return new Xr(t,n,i,a).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.aes.pos,u=this.aes.len,c=0,h=u+n&-16,l=0;if((s-1<<4)+u+n>X1)throw new RangeError("counter overflow");const w=new Uint8Array(h);for(;n>0;)l=Vr(a,o+u,e,t,n),u+=l,t+=l,n-=l,l=i.cipher(Kt.ENC.CTR,Kt.HEAP_DATA+o,u),l=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+o,l),l&&w.set(a.subarray(o,o+l),c),s+=l>>>4,c+=l,l>>29,t[4]=h>>>21,t[5]=h>>>13&255,t[6]=h>>>5&255,t[7]=h<<3&255,t[8]=t[9]=t[10]=0,t[11]=l>>>29,t[12]=l>>>21&255,t[13]=l>>>13&255,t[14]=l>>>5&255,t[15]=l<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16),u.set(t.subarray(0,i),o),this.counter=1,this.aes.pos=0,this.aes.len=0,u}AES_GCM_Decrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.tagSize,u=this.aes.pos,c=this.aes.len,h=0,l=c+n>o?c+n-o&-16:0,w=c+n-l,y=0;if((s-1<<4)+c+n>X1)throw new RangeError("counter overflow");const K=new Uint8Array(l);for(;n>w;)y=Vr(a,u+c,e,t,n-w),c+=y,t+=y,n-=y,y=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+u,y),y=i.cipher(Kt.DEC.CTR,Kt.HEAP_DATA+u,y),y&&K.set(a.subarray(u,u+y),h),s+=y>>>4,h+=y,u=0,c=0;return n>0&&(c+=Vr(a,0,e,t,n)),this.counter=s,this.aes.pos=u,this.aes.len=c,K}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),n=this.tagSize,i=this.adata,a=this.counter,s=this.aes.pos,o=this.aes.len,u=o-n;if(o>>29,t[4]=w>>>21,t[5]=w>>>13&255,t[6]=w>>>5&255,t[7]=w<<3&255,t[8]=t[9]=t[10]=0,t[11]=y>>>29,t[12]=y>>>21&255,t[13]=y>>>13&255,t[14]=y>>>5&255,t[15]=y<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16);let K=0;for(let C=0;C0;){for(s=Vr(n,0,e,i,a),i+=s,a-=s;15&s;)n[s++]=0;t.mac(Kt.MAC.GCM,Kt.HEAP_DATA,s)}}}const Y1=A.getWebCrypto(),Ys=A.getNodeCrypto(),Qs=A.getNodeBuffer(),wn=16,Q1="AES-GCM";async function kn(r,e){if(r!==p.symmetric.aes128&&r!==p.symmetric.aes192&&r!==p.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(A.getNodeCrypto())return{encrypt:async function(t,n,i=new Uint8Array){const a=new Ys.createCipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i);const s=Qs.concat([a.update(t),a.final(),a.getAuthTag()]);return new Uint8Array(s)},decrypt:async function(t,n,i=new Uint8Array){const a=new Ys.createDecipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i),a.setAuthTag(t.slice(t.length-wn,t.length));const s=Qs.concat([a.update(t.slice(0,t.length-wn)),a.final()]);return new Uint8Array(s)}};if(A.getWebCrypto()&&e.length!==24){const t=await Y1.importKey("raw",e,{name:Q1},!1,["encrypt","decrypt"]);return{encrypt:async function(n,i,a=new Uint8Array){if(!n.length)return Xr.encrypt(n,e,i,a);const s=await Y1.encrypt({name:Q1,iv:i,additionalData:a,tagLength:8*wn},t,n);return new Uint8Array(s)},decrypt:async function(n,i,a=new Uint8Array){if(n.length===wn)return Xr.decrypt(n,e,i,a);const s=await Y1.decrypt({name:Q1,iv:i,additionalData:a,tagLength:8*wn},t,n);return new Uint8Array(s)}}}return{encrypt:async function(t,n,i){return Xr.encrypt(t,e,n,i)},decrypt:async function(t,n,i){return Xr.decrypt(t,e,n,i)}}}kn.getNonce=function(r,e){const t=r.slice();for(let n=0;n>>8)-1}(S,M,b,f,32)}function K(S,M){var b;for(b=0;b<16;b++)S[b]=0|M[b]}function C(S){var M,b,f=1;for(M=0;M<16;M++)b=S[M]+f+65535,f=Math.floor(b/65536),S[M]=b-65536*f;S[0]+=f-1+37*(f-1)}function O(S,M,b){for(var f,U=~(b-1),G=0;G<16;G++)f=U&(S[G]^M[G]),S[G]^=f,M[G]^=f}function F(S,M){var b,f,U,G=t(),X=t();for(b=0;b<16;b++)X[b]=M[b];for(C(X),C(X),C(X),f=0;f<2;f++){for(G[0]=X[0]-65517,b=1;b<15;b++)G[b]=X[b]-65535-(G[b-1]>>16&1),G[b-1]&=65535;G[15]=X[15]-32767-(G[14]>>16&1),U=G[15]>>16&1,G[14]&=65535,O(X,G,1-U)}for(b=0;b<16;b++)S[2*b]=255&X[b],S[2*b+1]=X[b]>>8}function Y(S,M){var b=new Uint8Array(32),f=new Uint8Array(32);return F(b,S),F(f,M),y(b,0,f,0)}function $(S){var M=new Uint8Array(32);return F(M,S),1&M[0]}function E(S,M){var b;for(b=0;b<16;b++)S[b]=M[2*b]+(M[2*b+1]<<8);S[15]&=32767}function W(S,M,b){for(var f=0;f<16;f++)S[f]=M[f]+b[f]}function H(S,M,b){for(var f=0;f<16;f++)S[f]=M[f]-b[f]}function j(S,M,b){var f,U,G=0,X=0,Q=0,g=0,d=0,m=0,_=0,T=0,P=0,z=0,ut=0,st=0,ht=0,I=0,x=0,D=0,B=0,R=0,L=0,v=0,k=0,nt=0,at=0,St=0,It=0,zt=0,Dt=0,Wt=0,Yt=0,Jt=0,ne=0,xt=b[0],Nt=b[1],Lt=b[2],Et=b[3],jt=b[4],$t=b[5],Ht=b[6],J=b[7],et=b[8],ct=b[9],wt=b[10],kt=b[11],Ut=b[12],_t=b[13],Mt=b[14],qt=b[15];G+=(f=M[0])*xt,X+=f*Nt,Q+=f*Lt,g+=f*Et,d+=f*jt,m+=f*$t,_+=f*Ht,T+=f*J,P+=f*et,z+=f*ct,ut+=f*wt,st+=f*kt,ht+=f*Ut,I+=f*_t,x+=f*Mt,D+=f*qt,X+=(f=M[1])*xt,Q+=f*Nt,g+=f*Lt,d+=f*Et,m+=f*jt,_+=f*$t,T+=f*Ht,P+=f*J,z+=f*et,ut+=f*ct,st+=f*wt,ht+=f*kt,I+=f*Ut,x+=f*_t,D+=f*Mt,B+=f*qt,Q+=(f=M[2])*xt,g+=f*Nt,d+=f*Lt,m+=f*Et,_+=f*jt,T+=f*$t,P+=f*Ht,z+=f*J,ut+=f*et,st+=f*ct,ht+=f*wt,I+=f*kt,x+=f*Ut,D+=f*_t,B+=f*Mt,R+=f*qt,g+=(f=M[3])*xt,d+=f*Nt,m+=f*Lt,_+=f*Et,T+=f*jt,P+=f*$t,z+=f*Ht,ut+=f*J,st+=f*et,ht+=f*ct,I+=f*wt,x+=f*kt,D+=f*Ut,B+=f*_t,R+=f*Mt,L+=f*qt,d+=(f=M[4])*xt,m+=f*Nt,_+=f*Lt,T+=f*Et,P+=f*jt,z+=f*$t,ut+=f*Ht,st+=f*J,ht+=f*et,I+=f*ct,x+=f*wt,D+=f*kt,B+=f*Ut,R+=f*_t,L+=f*Mt,v+=f*qt,m+=(f=M[5])*xt,_+=f*Nt,T+=f*Lt,P+=f*Et,z+=f*jt,ut+=f*$t,st+=f*Ht,ht+=f*J,I+=f*et,x+=f*ct,D+=f*wt,B+=f*kt,R+=f*Ut,L+=f*_t,v+=f*Mt,k+=f*qt,_+=(f=M[6])*xt,T+=f*Nt,P+=f*Lt,z+=f*Et,ut+=f*jt,st+=f*$t,ht+=f*Ht,I+=f*J,x+=f*et,D+=f*ct,B+=f*wt,R+=f*kt,L+=f*Ut,v+=f*_t,k+=f*Mt,nt+=f*qt,T+=(f=M[7])*xt,P+=f*Nt,z+=f*Lt,ut+=f*Et,st+=f*jt,ht+=f*$t,I+=f*Ht,x+=f*J,D+=f*et,B+=f*ct,R+=f*wt,L+=f*kt,v+=f*Ut,k+=f*_t,nt+=f*Mt,at+=f*qt,P+=(f=M[8])*xt,z+=f*Nt,ut+=f*Lt,st+=f*Et,ht+=f*jt,I+=f*$t,x+=f*Ht,D+=f*J,B+=f*et,R+=f*ct,L+=f*wt,v+=f*kt,k+=f*Ut,nt+=f*_t,at+=f*Mt,St+=f*qt,z+=(f=M[9])*xt,ut+=f*Nt,st+=f*Lt,ht+=f*Et,I+=f*jt,x+=f*$t,D+=f*Ht,B+=f*J,R+=f*et,L+=f*ct,v+=f*wt,k+=f*kt,nt+=f*Ut,at+=f*_t,St+=f*Mt,It+=f*qt,ut+=(f=M[10])*xt,st+=f*Nt,ht+=f*Lt,I+=f*Et,x+=f*jt,D+=f*$t,B+=f*Ht,R+=f*J,L+=f*et,v+=f*ct,k+=f*wt,nt+=f*kt,at+=f*Ut,St+=f*_t,It+=f*Mt,zt+=f*qt,st+=(f=M[11])*xt,ht+=f*Nt,I+=f*Lt,x+=f*Et,D+=f*jt,B+=f*$t,R+=f*Ht,L+=f*J,v+=f*et,k+=f*ct,nt+=f*wt,at+=f*kt,St+=f*Ut,It+=f*_t,zt+=f*Mt,Dt+=f*qt,ht+=(f=M[12])*xt,I+=f*Nt,x+=f*Lt,D+=f*Et,B+=f*jt,R+=f*$t,L+=f*Ht,v+=f*J,k+=f*et,nt+=f*ct,at+=f*wt,St+=f*kt,It+=f*Ut,zt+=f*_t,Dt+=f*Mt,Wt+=f*qt,I+=(f=M[13])*xt,x+=f*Nt,D+=f*Lt,B+=f*Et,R+=f*jt,L+=f*$t,v+=f*Ht,k+=f*J,nt+=f*et,at+=f*ct,St+=f*wt,It+=f*kt,zt+=f*Ut,Dt+=f*_t,Wt+=f*Mt,Yt+=f*qt,x+=(f=M[14])*xt,D+=f*Nt,B+=f*Lt,R+=f*Et,L+=f*jt,v+=f*$t,k+=f*Ht,nt+=f*J,at+=f*et,St+=f*ct,It+=f*wt,zt+=f*kt,Dt+=f*Ut,Wt+=f*_t,Yt+=f*Mt,Jt+=f*qt,D+=(f=M[15])*xt,X+=38*(R+=f*Lt),Q+=38*(L+=f*Et),g+=38*(v+=f*jt),d+=38*(k+=f*$t),m+=38*(nt+=f*Ht),_+=38*(at+=f*J),T+=38*(St+=f*et),P+=38*(It+=f*ct),z+=38*(zt+=f*wt),ut+=38*(Dt+=f*kt),st+=38*(Wt+=f*Ut),ht+=38*(Yt+=f*_t),I+=38*(Jt+=f*Mt),x+=38*(ne+=f*qt),G=(f=(G+=38*(B+=f*Nt))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Q=(f=Q+U+65535)-65536*(U=Math.floor(f/65536)),g=(f=g+U+65535)-65536*(U=Math.floor(f/65536)),d=(f=d+U+65535)-65536*(U=Math.floor(f/65536)),m=(f=m+U+65535)-65536*(U=Math.floor(f/65536)),_=(f=_+U+65535)-65536*(U=Math.floor(f/65536)),T=(f=T+U+65535)-65536*(U=Math.floor(f/65536)),P=(f=P+U+65535)-65536*(U=Math.floor(f/65536)),z=(f=z+U+65535)-65536*(U=Math.floor(f/65536)),ut=(f=ut+U+65535)-65536*(U=Math.floor(f/65536)),st=(f=st+U+65535)-65536*(U=Math.floor(f/65536)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),x=(f=x+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),G=(f=(G+=U-1+37*(U-1))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Q=(f=Q+U+65535)-65536*(U=Math.floor(f/65536)),g=(f=g+U+65535)-65536*(U=Math.floor(f/65536)),d=(f=d+U+65535)-65536*(U=Math.floor(f/65536)),m=(f=m+U+65535)-65536*(U=Math.floor(f/65536)),_=(f=_+U+65535)-65536*(U=Math.floor(f/65536)),T=(f=T+U+65535)-65536*(U=Math.floor(f/65536)),P=(f=P+U+65535)-65536*(U=Math.floor(f/65536)),z=(f=z+U+65535)-65536*(U=Math.floor(f/65536)),ut=(f=ut+U+65535)-65536*(U=Math.floor(f/65536)),st=(f=st+U+65535)-65536*(U=Math.floor(f/65536)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),x=(f=x+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),G+=U-1+37*(U-1),S[0]=G,S[1]=X,S[2]=Q,S[3]=g,S[4]=d,S[5]=m,S[6]=_,S[7]=T,S[8]=P,S[9]=z,S[10]=ut,S[11]=st,S[12]=ht,S[13]=I,S[14]=x,S[15]=D}function V(S,M){j(S,M,M)}function Z(S,M){var b,f=t();for(b=0;b<16;b++)f[b]=M[b];for(b=253;b>=0;b--)V(f,f),b!==2&&b!==4&&j(f,f,M);for(b=0;b<16;b++)S[b]=f[b]}function tt(S,M,b){var f,U,G=new Uint8Array(32),X=new Float64Array(80),Q=t(),g=t(),d=t(),m=t(),_=t(),T=t();for(U=0;U<31;U++)G[U]=M[U];for(G[31]=127&M[31]|64,G[0]&=248,E(X,b),U=0;U<16;U++)g[U]=X[U],m[U]=Q[U]=d[U]=0;for(Q[0]=m[0]=1,U=254;U>=0;--U)O(Q,g,f=G[U>>>3]>>>(7&U)&1),O(d,m,f),W(_,Q,d),H(Q,Q,d),W(d,g,m),H(g,g,m),V(m,_),V(T,Q),j(Q,d,Q),j(d,g,_),W(_,Q,d),H(Q,Q,d),V(g,Q),H(d,m,T),j(Q,d,o),W(Q,Q,m),j(d,d,Q),j(Q,m,T),j(m,g,X),V(g,_),O(Q,g,f),O(d,m,f);for(U=0;U<16;U++)X[U+16]=Q[U],X[U+32]=d[U],X[U+48]=g[U],X[U+64]=m[U];var P=X.subarray(32),z=X.subarray(16);return Z(P,P),j(z,z,P),F(S,z),0}function rt(S,M){return tt(S,M,i)}function dt(S,M){var b=t(),f=t(),U=t(),G=t(),X=t(),Q=t(),g=t(),d=t(),m=t();H(b,S[1],S[0]),H(m,M[1],M[0]),j(b,b,m),W(f,S[0],S[1]),W(m,M[0],M[1]),j(f,f,m),j(U,S[3],M[3]),j(U,U,c),j(G,S[2],M[2]),W(G,G,G),H(X,f,b),H(Q,G,U),W(g,G,U),W(d,f,b),j(S[0],X,Q),j(S[1],d,g),j(S[2],g,Q),j(S[3],X,d)}function lt(S,M,b){var f;for(f=0;f<4;f++)O(S[f],M[f],b)}function N(S,M){var b=t(),f=t(),U=t();Z(U,M[2]),j(b,M[0],U),j(f,M[1],U),F(S,f),S[31]^=$(b)<<7}function ft(S,M,b){var f,U;for(K(S[0],a),K(S[1],s),K(S[2],s),K(S[3],a),U=255;U>=0;--U)lt(S,M,f=b[U/8|0]>>(7&U)&1),dt(M,S),dt(S,S),lt(S,M,f)}function Pt(S,M){var b=[t(),t(),t(),t()];K(b[0],h),K(b[1],l),K(b[2],s),j(b[3],h,l),ft(S,b,M)}function q(S,M,b){var f,U,G=[t(),t(),t(),t()];for(b||n(M,32),(f=e.hash(M.subarray(0,32)))[0]&=248,f[31]&=127,f[31]|=64,Pt(G,f),N(S,G),U=0;U<32;U++)M[U+32]=S[U];return 0}var it=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 mt(S,M){var b,f,U,G;for(f=63;f>=32;--f){for(b=0,U=f-32,G=f-12;U>4)*it[U],b=M[U]>>8,M[U]&=255;for(U=0;U<32;U++)M[U]-=b*it[U];for(f=0;f<32;f++)M[f+1]+=M[f]>>8,S[f]=255&M[f]}function bt(S){var M,b=new Float64Array(64);for(M=0;M<64;M++)b[M]=S[M];for(M=0;M<64;M++)S[M]=0;mt(S,b)}function yt(S,M){var b=t(),f=t(),U=t(),G=t(),X=t(),Q=t(),g=t();return K(S[2],s),E(S[1],M),V(U,S[1]),j(G,U,u),H(U,U,S[2]),W(G,S[2],G),V(X,G),V(Q,X),j(g,Q,X),j(b,g,U),j(b,b,G),function(d,m){var _,T=t();for(_=0;_<16;_++)T[_]=m[_];for(_=250;_>=0;_--)V(T,T),_!==1&&j(T,T,m);for(_=0;_<16;_++)d[_]=T[_]}(b,b),j(b,b,U),j(b,b,G),j(b,b,G),j(S[0],b,G),V(f,S[0]),j(f,f,G),Y(f,U)&&j(S[0],S[0],w),V(f,S[0]),j(f,f,G),Y(f,U)?-1:($(S[0])===M[31]>>7&&H(S[0],a,S[0]),j(S[3],S[0],S[1]),0)}var pt=64;function gt(){for(var S=0;S=0},e.sign.keyPair=function(){var S=new Uint8Array(32),M=new Uint8Array(64);return q(S,M),{publicKey:S,secretKey:M}},e.sign.keyPair.fromSecretKey=function(S){if(gt(S),S.length!==64)throw Error("bad secret key size");for(var M=new Uint8Array(32),b=0;b"u"||!crypto.getRandomValues)throw Error("No secure random number generator available.");crypto.getRandomValues(e)}return e}async function br(r,e){const t=await A.getBigInteger();if(e.lt(r))throw Error("Illegal parameter value: max <= min");const n=e.sub(r),i=n.byteLength();return new t(await Ee(i+8)).mod(n).add(r)}var I3=Object.freeze({__proto__:null,getRandomBytes:Ee,getRandomBigInteger:br});async function t0(r,e,t){const n=await A.getBigInteger(),i=new n(1),a=i.leftShift(new n(r-1)),s=new n(30),o=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2],u=await br(a,a.leftShift(i));let c=u.mod(s).toNumber();do u.iadd(new n(o[c])),c=(c+o[c])%o.length,u.bitLength()>r&&(u.imod(a.leftShift(i)).iadd(a),c=u.mod(s).toNumber());while(!await mo(u,e,t));return u}async function mo(r,e,t){return!(e&&!r.dec().gcd(e).isOne())&&!!await async function(n){const i=await A.getBigInteger();return T3.every(a=>n.mod(new i(a))!==0)}(r)&&!!await async function(n,i){const a=await A.getBigInteger();return i=i||new a(2),i.modExp(n.dec(),n).isOne()}(r)&&!!await async function(n,i,a){const s=await A.getBigInteger(),o=n.bitLength();i||(i=Math.max(1,o/48|0));const u=n.dec();let c=0;for(;!u.getBit(c);)c++;const h=n.rightShift(new s(c));for(;i>0;i--){let l,w=(await br(new s(2),u)).modExp(h,n);if(!w.isOne()&&!w.equal(u)){for(l=1;le-11)throw Error("Message too long");const n=function(a){const s=new Uint8Array(a);let o=0;for(;o=8&!n;if(e)return A.selectUint8Array(s,a,e);if(s)return a;throw Error("Decryption error")}async function Ca(r,e,t){let n;if(e.length!==Ke.getHashByteLength(r))throw Error("Invalid hash length");const i=new Uint8Array(je[r].length);for(n=0;n{const{default:tt}=await import("./bn.min-DsLKjtAs.js");return{default:tt}},[],import.meta.url),Y=new F(K),$=new F(C),E=new F(y),W=E.mod($.subn(1)),H=E.mod(Y.subn(1)),j=ge.createSign(p.read(p.hash,c));j.write(h),j.end();const V={version:0,modulus:new F(l),publicExponent:new F(w),privateExponent:new F(y),prime1:new F(C),prime2:new F(K),exponent1:W,exponent2:H,coefficient:new F(O)};if(ge.createPrivateKey!==void 0){const tt=yn.encode(V,"der");return new Uint8Array(j.sign({key:tt,format:"der",type:"pkcs1"}))}const Z=yn.encode(V,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(j.sign(Z))}(r,e,t,n,i,a,s,o)}return async function(c,h,l,w){const y=await A.getBigInteger();h=new y(h);const K=new y(await Ca(c,w,h.byteLength()));if(l=new y(l),K.gte(h))throw Error("Message size cannot exceed modulus size");return K.modExp(l,h).toUint8Array("be",h.byteLength())}(r,t,i,u)},verify:async function(r,e,t,n,i,a){if(e&&!A.isStream(e)){if(A.getWebCrypto())try{return await async function(s,o,u,c,h){const l=function(y,K){return{kty:"RSA",n:_e(y,!0),e:_e(K,!0),ext:!0}}(c,h),w=await dn.importKey("jwk",l,{name:"RSASSA-PKCS1-v1_5",hash:{name:s}},!1,["verify"]);return dn.verify("RSASSA-PKCS1-v1_5",w,u,o)}(p.read(p.webHash,r),e,t,n,i)}catch(s){A.printDebugError(s)}else if(A.getNodeCrypto())return async function(s,o,u,c,h){const{default:l}=await Wr(async()=>{const{default:C}=await import("./bn.min-DsLKjtAs.js");return{default:C}},[],import.meta.url),w=ge.createVerify(p.read(p.hash,s));w.write(o),w.end();const y={modulus:new l(c),publicExponent:new l(h)};let K;ge.createPrivateKey!==void 0?K={key:$i.encode(y,"der"),format:"der",type:"pkcs1"}:K=$i.encode(y,"pem",{label:"RSA PUBLIC KEY"});try{return await w.verify(K,u)}catch{return!1}}(r,e,t,n,i)}return async function(s,o,u,c,h){const l=await A.getBigInteger();if(u=new l(u),o=new l(o),c=new l(c),o.gte(u))throw Error("Signature size cannot exceed modulus size");const w=o.modExp(c,u).toUint8Array("be",u.byteLength()),y=await Ca(s,h,u.byteLength());return A.equalsUint8Array(w,y)}(r,t,n,i,a)},encrypt:async function(r,e,t){return A.getNodeCrypto()?async function(n,i,a){const{default:s}=await Wr(async()=>{const{default:c}=await import("./bn.min-DsLKjtAs.js");return{default:c}},[],import.meta.url),o={modulus:new s(i),publicExponent:new s(a)};let u;return ge.createPrivateKey!==void 0?u={key:$i.encode(o,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:u={key:$i.encode(o,"pem",{label:"RSA PUBLIC KEY"}),padding:ge.constants.RSA_PKCS1_PADDING},new Uint8Array(ge.publicEncrypt(u,n))}(r,e,t):async function(n,i,a){const s=await A.getBigInteger();if(i=new s(i),n=new s(Ya(n,i.byteLength())),a=new s(a),n.gte(i))throw Error("Message size cannot exceed modulus size");return n.modExp(a,i).toUint8Array("be",i.byteLength())}(r,e,t)},decrypt:async function(r,e,t,n,i,a,s,o){if(A.getNodeCrypto()&&!o)try{return await async function(u,c,h,l,w,y,K){const{default:C}=await Wr(async()=>{const{default:j}=await import("./bn.min-DsLKjtAs.js");return{default:j}},[],import.meta.url),O=new C(w),F=new C(y),Y=new C(l),$=Y.mod(F.subn(1)),E=Y.mod(O.subn(1)),W={version:0,modulus:new C(c),publicExponent:new C(h),privateExponent:new C(l),prime1:new C(y),prime2:new C(w),exponent1:$,exponent2:E,coefficient:new C(K)};let H;ge.createPrivateKey!==void 0?H={key:yn.encode(W,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:H={key:yn.encode(W,"pem",{label:"RSA PRIVATE KEY"}),padding:ge.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(ge.privateDecrypt(H,u))}catch{throw Error("Decryption error")}}(r,e,t,n,i,a,s)}catch(u){A.printDebugError(u)}return async function(u,c,h,l,w,y,K,C){const O=await A.getBigInteger();if(u=new O(u),c=new O(c),h=new O(h),l=new O(l),w=new O(w),y=new O(y),K=new O(K),u.gte(c))throw Error("Data too large.");const F=l.mod(y.dec()),Y=l.mod(w.dec()),$=(await br(new O(2),c)).mod(c),E=$.modInv(c).modExp(h,c);u=u.mul(E).mod(c);const W=u.modExp(Y,w),H=u.modExp(F,y);let V=K.mul(H.sub(W)).mod(y).mul(w).add(W);return V=V.mul($).mod(c),Qa(V.toUint8Array("be",c.byteLength()),C)}(r,e,t,n,i,a,s,o)},generate:async function(r,e){if(e=new(await A.getBigInteger())(e),A.getWebCrypto()){const s={name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:e.toUint8Array(),hash:{name:"SHA-1"}},o=await dn.generateKey(s,!0,["sign","verify"]),u=await dn.exportKey("jwk",o.privateKey);return{n:fr(u.n),e:e.toUint8Array(),d:fr(u.d),p:fr(u.q),q:fr(u.p),u:fr(u.qi)}}if(A.getNodeCrypto()&&ge.generateKeyPair&&yn){const s={modulusLength:r,publicExponent:e.toNumber(),publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"der"}},o=await new Promise((u,c)=>{ge.generateKeyPair("rsa",s,(h,l,w)=>{h?c(h):u(yn.decode(w,"der"))})});return{n:o.modulus.toArrayLike(Uint8Array),e:o.publicExponent.toArrayLike(Uint8Array),d:o.privateExponent.toArrayLike(Uint8Array),p:o.prime2.toArrayLike(Uint8Array),q:o.prime1.toArrayLike(Uint8Array),u:o.coefficient.toArrayLike(Uint8Array)}}let t,n,i;do n=await t0(r-(r>>1),e,40),t=await t0(r>>1,e,40),i=t.mul(n);while(i.bitLength()!==r);const a=t.dec().imul(n.dec());return n.lt(t)&&([t,n]=[n,t]),{n:i.toUint8Array(),e:e.toUint8Array(),d:e.modInv(a).toUint8Array(),p:t.toUint8Array(),q:n.toUint8Array(),u:t.modInv(n).toUint8Array()}},validateParams:async function(r,e,t,n,i,a){const s=await A.getBigInteger();if(r=new s(r),n=new s(n),i=new s(i),!n.mul(i).equal(r))return!1;const o=new s(2);if(a=new s(a),!n.mul(a).mod(i).isOne())return!1;e=new s(e),t=new s(t);const u=new s(Math.floor(r.bitLength()/3)),c=await br(o,o.leftShift(u)),h=c.mul(t).mul(e);return!(!h.mod(n.dec()).equal(c)||!h.mod(i.dec()).equal(c))}}),z3=Object.freeze({__proto__:null,encrypt:async function(r,e,t,n){const i=await A.getBigInteger();e=new i(e),t=new i(t),n=new i(n);const a=new i(Ya(r,e.byteLength())),s=await br(new i(1),e.dec());return{c1:t.modExp(s,e).toUint8Array(),c2:n.modExp(s,e).imul(a).imod(e).toUint8Array()}},decrypt:async function(r,e,t,n,i){const a=await A.getBigInteger();return r=new a(r),e=new a(e),t=new a(t),n=new a(n),Qa(r.modExp(n,t).modInv(t).imul(e).imod(t).toUint8Array("be",t.byteLength()),i)},validateParams:async function(r,e,t,n){const i=await A.getBigInteger();r=new i(r),e=new i(e),t=new i(t);const a=new i(1);if(e.lte(a)||e.gte(r))return!1;const s=new i(r.bitLength()),o=new i(1023);if(s.lt(o)||!e.modExp(r.dec(),r).isOne())return!1;let u=e;const c=new i(1),h=new i(2).leftShift(new i(17));for(;c.lt(h);){if(u=u.mul(e).imod(r),u.isOne())return!1;c.iinc()}n=new i(n);const l=new i(2),w=await br(l.leftShift(s.dec()),l.leftShift(s)),y=r.dec().imul(w).iadd(n);return!!t.equal(e.modExp(y,r))}});class We{constructor(e){if(e instanceof We)this.oid=e.oid;else if(A.isArray(e)||A.isUint8Array(e)){if((e=new Uint8Array(e))[0]===6){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return A.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return A.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(p.curve[e])return p.write(p.curve,e);throw Error("Unknown curve object identifier.")}}function D1(r,e){return r.keyPair({priv:e})}function C1(r,e){const t=r.keyPair({pub:e});if(t.validate().result!==!0)throw Error("Invalid elliptic public key");return t}async function Bn(r){if(!vt.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:e}=await Wr(async()=>{const{default:t}=await import("./elliptic.min-DvUVzpm1.js");return{default:t}},__vite__mapDeps([2,1]),import.meta.url);return new e.ec(r)}function bo(r){let e,t=0;const n=r[0];return n<192?([t]=r,e=1):n<255?(t=(r[0]-192<<8)+r[1]+192,e=2):n===255&&(t=A.readNumber(r.subarray(1,5)),e=5),{len:t,offset:e}}function Ui(r){return r<192?new Uint8Array([r]):r>191&&r<8384?new Uint8Array([192+(r-192>>8),r-192&255]):A.concatUint8Array([new Uint8Array([255]),A.writeNumber(r,4)])}function L3(r){if(r<0||r>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+r])}function ko(r){return new Uint8Array([192|r])}function e0(r,e){return A.concatUint8Array([ko(r),Ui(e)])}function Vi(r){return[p.packet.literalData,p.packet.compressedData,p.packet.symmetricallyEncryptedData,p.packet.symEncryptedIntegrityProtectedData,p.packet.aeadEncryptedData].includes(r)}async function O3(r,e){const t=an(r);let n,i;try{const a=await t.peekBytes(2);if(!a||a.length<2||!(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const s=await t.readByte();let o,u,c=-1,h=-1;h=0,64&s&&(h=1),h?c=63&s:(c=(63&s)>>2,u=3&s);const l=Vi(c);let w,y=null;if(l){if(A.isStream(r)==="array"){const C=new Ze;n=Oe(C),y=C}else{const C=new ja;n=Oe(C.writable),y=C.readable}i=e({tag:c,packet:y})}else y=[];do{if(h){const C=await t.readByte();if(w=!1,C<192)o=C;else if(C>=192&&C<224)o=(C-192<<8)+await t.readByte()+192;else if(C>223&&C<255){if(o=1<<(31&C),w=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte()}else switch(u){case 0:o=await t.readByte();break;case 1:o=await t.readByte()<<8|await t.readByte();break;case 2:o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte();break;default:o=1/0}if(o>0){let C=0;for(;;){n&&await n.ready;const{done:O,value:F}=await t.read();if(O){if(o===1/0)break;throw Error("Unexpected end of packet")}const Y=o===1/0?F:F.subarray(0,o-C);if(n?await n.write(Y):y.push(Y),C+=F.length,C>=o){t.unshift(F.subarray(o-C+F.length));break}}}}while(w);const K=await t.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(y=A.concatUint8Array(y),await e({tag:c,packet:y})),!K||!K.length}catch(a){if(n)return await n.abort(a),!0;throw a}finally{n&&await i,t.releaseLock()}}class re extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,re),this.name="UnsupportedError"}}class Ia{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const J1=A.getWebCrypto(),h1=A.getNodeCrypto(),rr={p256:"P-256",p384:"P-384",p521:"P-521"},or=h1?h1.getCurves():[],Ur=h1?{secp256k1:or.includes("secp256k1")?"secp256k1":void 0,p256:or.includes("prime256v1")?"prime256v1":void 0,p384:or.includes("secp384r1")?"secp384r1":void 0,p521:or.includes("secp521r1")?"secp521r1":void 0,ed25519:or.includes("ED25519")?"ED25519":void 0,curve25519:or.includes("X25519")?"X25519":void 0,brainpoolP256r1:or.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:or.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:or.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Zi={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Ur.p256,web:rr.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Ur.p384,web:rr.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Ur.p521,web:rr.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Ur.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:p.publicKey.eddsaLegacy,hash:p.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:p.publicKey.ecdh,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Ur.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Ur.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Ur.brainpoolP512r1,payloadSize:64}};class kr{constructor(e,t){try{(A.isArray(e)||A.isUint8Array(e))&&(e=new We(e)),e instanceof We&&(e=e.getName()),this.name=p.write(p.curve,e)}catch{throw new re("Unknown curve")}t=t||Zi[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Zi[this.name],this.web=t.web&&Zi[this.name],this.payloadSize=t.payloadSize,this.web&&A.getWebCrypto()?this.type="web":this.node&&A.getNodeCrypto()?this.type="node":this.name==="curve25519"?this.type="curve25519":this.name==="ed25519"&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(n){const i=await J1.generateKey({name:"ECDSA",namedCurve:rr[n]},!0,["sign","verify"]),a=await J1.exportKey("jwk",i.privateKey),s=await J1.exportKey("jwk",i.publicKey);return{publicKey:_o(s),privateKey:fr(a.d)}}(this.name)}catch(n){A.printDebugError("Browser did not support generating ec key "+n.message);break}case"node":return async function(n){const i=h1.createECDH(Ur[n]);return await i.generateKeys(),{publicKey:new Uint8Array(i.getPublicKey()),privateKey:new Uint8Array(i.getPrivateKey())}}(this.name);case"curve25519":{const n=Ee(32);n[0]=127&n[0]|64,n[31]&=248;const i=n.slice().reverse();return e=ee.box.keyPair.fromSecretKey(i),{publicKey:A.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:n}}case"ed25519":{const n=Ee(32),i=ee.sign.keyPair.fromSeed(n);return{publicKey:A.concatUint8Array([new Uint8Array([64]),i.publicKey]),privateKey:n}}}return e=await(await Bn(this.name)).genKeyPair({entropy:A.uint8ArrayToString(Ee(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function vo(r,e,t,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:r===p.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=e.getName();if(!i[a])return!1;if(a==="curve25519"){n=n.slice().reverse();const{publicKey:o}=ee.box.keyPair.fromSecretKey(n);t=new Uint8Array(t);const u=new Uint8Array([64,...o]);return!!A.equalsUint8Array(u,t)}const s=await Bn(a);try{t=C1(s,t).getPublic()}catch{return!1}return!!D1(s,n).getPublic().eq(t)}function _o(r){const e=fr(r.x),t=fr(r.y),n=new Uint8Array(e.length+t.length+1);return n[0]=4,n.set(e,1),n.set(t,e.length+1),n}function I1(r,e,t){const n=r,i=t.slice(1,n+1),a=t.slice(n+1,2*n+1);return{kty:"EC",crv:e,x:_e(i),y:_e(a),ext:!0}}function Ao(r,e,t,n){const i=I1(r,e,t);return i.d=_e(n),i}const l1=A.getWebCrypto(),Rn=A.getNodeCrypto();async function r0(r,e,t,n,i,a){const s=new kr(r);if(t&&!A.isStream(t)){const o={publicKey:n,privateKey:i};switch(s.type){case"web":try{return await async function(u,c,h,l){const w=u.payloadSize,y=Ao(u.payloadSize,rr[u.name],l.publicKey,l.privateKey),K=await l1.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,u.hash)}},!1,["sign"]),C=new Uint8Array(await l1.sign({name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,c)}},K,h));return{r:C.slice(0,w),s:C.slice(w,w<<1)}}(s,e,t,o)}catch(u){if(s.name!=="p521"&&(u.name==="DataError"||u.name==="OperationError"))throw u;A.printDebugError("Browser did not support signing: "+u.message)}break;case"node":{const u=await async function(c,h,l,w){const y=Rn.createSign(p.read(p.hash,h));y.write(l),y.end();const K=N3.encode({version:1,parameters:c.oid,privateKey:Array.from(w.privateKey),publicKey:{unused:0,data:Array.from(w.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Eo.decode(y.sign(K),"der")}(s,e,t,o);return{r:u.r.toArrayLike(Uint8Array),s:u.s.toArrayLike(Uint8Array)}}}}return async function(o,u,c){const h=await Bn(o.name),l=D1(h,c),w=l.sign(u);return{r:w.r.toArrayLike(Uint8Array),s:w.s.toArrayLike(Uint8Array)}}(s,a,i)}async function n0(r,e,t,n,i,a){const s=new kr(r);if(n&&!A.isStream(n))switch(s.type){case"web":try{return await async function(o,u,{r:c,s:h},l,w){const y=I1(o.payloadSize,rr[o.name],w),K=await l1.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,o.hash)}},!1,["verify"]),C=A.concatUint8Array([c,h]).buffer;return l1.verify({name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,u)}},K,C,l)}(s,e,t,n,i)}catch(o){if(s.name!=="p521"&&(o.name==="DataError"||o.name==="OperationError"))throw o;A.printDebugError("Browser did not support verifying: "+o.message)}break;case"node":return async function(o,u,{r:c,s:h},l,w){const{default:y}=await Wr(async()=>{const{default:F}=await import("./bn.min-DsLKjtAs.js");return{default:F}},[],import.meta.url),K=Rn.createVerify(p.read(p.hash,u));K.write(l),K.end();const C=$3.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:o.oid},subjectPublicKey:{unused:0,data:Array.from(w)}},"pem",{label:"PUBLIC KEY"}),O=Eo.encode({r:new y(c),s:new y(h)},"der");try{return K.verify(C,O)}catch{return!1}}(s,e,t,n,i)}return async function(o,u,c,h){const l=await Bn(o.name);return C1(l,h).verify(c,u)}(s,t,e===void 0?n:a,i)}const T1=void 0,Eo=Rn?T1.define("ECDSASignature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}):void 0,N3=Rn?T1.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())}):void 0,M3=Rn?T1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}):void 0,$3=Rn?T1.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(M3),this.key("subjectPublicKey").bitstr())}):void 0;var F3=Object.freeze({__proto__:null,sign:r0,verify:n0,validateParams:async function(r,e,t){const n=new kr(r);if(n.keyType!==p.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const i=Ee(8),a=p.hash.sha256,s=await Ke.digest(a,i);try{const o=await r0(r,a,i,e,t,s);return await n0(r,a,o,i,e,s)}catch{return!1}}default:return vo(p.publicKey.ecdsa,r,e,t)}}});ee.hash=r=>new Uint8Array(Pi().update(r).digest());var H3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)new Uint8Array(Pi().update(r).digest());var j3=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.ed25519){const e=Ee(32),{publicKey:t}=ee.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)=0;--h)for(let l=o-1;l>=0;--l)u[1]=o*h+(l+1),c[0]=a[0]^u[0],c[1]=a[1]^u[1],c[2]=s[2*l],c[3]=s[2*l+1],c=f1(t.decrypt(d1(c))),a=c.subarray(0,2),s[2*l]=c[2],s[2*l+1]=c[3];if(a[0]===n[0]&&a[1]===n[1])return d1(s);throw Error("Key Data Integrity failed")}function f1(r){const{length:e}=r,t=function(a){if(A.isString(a)){const{length:s}=a,o=new ArrayBuffer(s),u=new Uint8Array(o);for(let c=0;c0){const t=r[e-1];if(t>=1){const n=r.subarray(e-t),i=new Uint8Array(t).fill(t);if(A.equalsUint8Array(n,i))return r.subarray(0,e-t)}}throw Error("Invalid padding")}var G3=Object.freeze({__proto__:null,encode:So,decode:Po});const Tr=A.getWebCrypto(),Uo=A.getNodeCrypto();function i0(r,e,t,n){return A.concatUint8Array([e.write(),new Uint8Array([r]),t.write(),A.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function a0(r,e,t,n,i=!1,a=!1){let s;if(i){for(s=0;s=0&&e[s]===0;s--);e=e.subarray(0,s+1)}return(await Ke.digest(r,A.concatUint8Array([new Uint8Array([0,0,0,1]),e,n]))).subarray(0,t)}async function W3(r,e){switch(r.type){case"curve25519":{const t=Ee(32),{secretKey:n,sharedKey:i}=await Ko(r,e,null,t);let{publicKey:a}=ee.box.keyPair.fromSecretKey(n);return a=A.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(r.web&&A.getWebCrypto())try{return await async function(t,n){const i=I1(t.payloadSize,t.web.web,n);let a=Tr.generateKey({name:"ECDH",namedCurve:t.web.web},!0,["deriveKey","deriveBits"]),s=Tr.importKey("jwk",i,{name:"ECDH",namedCurve:t.web.web},!1,[]);[a,s]=await Promise.all([a,s]);let o=Tr.deriveBits({name:"ECDH",namedCurve:t.web.web,public:s},a.privateKey,t.web.sharedSize),u=Tr.exportKey("jwk",a.publicKey);[o,u]=await Promise.all([o,u]);const c=new Uint8Array(o);return{publicKey:new Uint8Array(_o(u)),sharedKey:c}}(r,e)}catch(t){A.printDebugError(t)}break;case"node":return async function(t,n){const i=Uo.createECDH(t.node.node);i.generateKeys();const a=new Uint8Array(i.computeSecret(n));return{publicKey:new Uint8Array(i.getPublicKey()),sharedKey:a}}(r,e)}return async function(t,n){const i=await Bn(t.name),a=await t.genKeyPair();n=C1(i,n);const s=D1(i,a.privateKey),o=a.publicKey,u=s.derive(n.getPublic()),c=i.curve.p.byteLength(),h=u.toArrayLike(Uint8Array,"be",c);return{publicKey:o,sharedKey:h}}(r,e)}async function Ko(r,e,t,n){if(n.length!==r.payloadSize){const i=new Uint8Array(r.payloadSize);i.set(n,r.payloadSize-n.length),n=i}switch(r.type){case"curve25519":{const i=n.slice().reverse();return{secretKey:i,sharedKey:ee.scalarMult(i,e.subarray(1))}}case"web":if(r.web&&A.getWebCrypto())try{return await async function(i,a,s,o){const u=Ao(i.payloadSize,i.web.web,s,o);let c=Tr.importKey("jwk",u,{name:"ECDH",namedCurve:i.web.web},!0,["deriveKey","deriveBits"]);const h=I1(i.payloadSize,i.web.web,a);let l=Tr.importKey("jwk",h,{name:"ECDH",namedCurve:i.web.web},!0,[]);[c,l]=await Promise.all([c,l]);let w=Tr.deriveBits({name:"ECDH",namedCurve:i.web.web,public:l},c,i.web.sharedSize),y=Tr.exportKey("jwk",c);[w,y]=await Promise.all([w,y]);const K=new Uint8Array(w);return{secretKey:fr(y.d),sharedKey:K}}(r,e,t,n)}catch(i){A.printDebugError(i)}break;case"node":return async function(i,a,s){const o=Uo.createECDH(i.node.node);o.setPrivateKey(s);const u=new Uint8Array(o.computeSecret(a));return{secretKey:new Uint8Array(o.getPrivateKey()),sharedKey:u}}(r,e,n)}return async function(i,a,s){const o=await Bn(i.name);a=C1(o,a),s=D1(o,s);const u=new Uint8Array(s.getPrivate()),c=s.derive(a.getPublic()),h=o.curve.p.byteLength(),l=c.toArrayLike(Uint8Array,"be",h);return{secretKey:u,sharedKey:l}}(r,e,n)}var V3=Object.freeze({__proto__:null,validateParams:async function(r,e,t){return vo(p.publicKey.ecdh,r,e,t)},encrypt:async function(r,e,t,n,i){const a=So(t),s=new kr(r),{publicKey:o,sharedKey:u}=await W3(s,n),c=i0(p.publicKey.ecdh,r,e,i),{keySize:h}=er(e.cipher);return{publicKey:o,wrappedKey:Ja(await a0(e.hash,u,h,c),a)}},decrypt:async function(r,e,t,n,i,a,s){const o=new kr(r),{sharedKey:u}=await Ko(o,t,i,a),c=i0(p.publicKey.ecdh,r,e,s),{keySize:h}=er(e.cipher);let l;for(let w=0;w<3;w++)try{return Po(ts(await a0(e.hash,u,h,c,w===1,w===2),n))}catch(y){l=y}throw l}});const s0=A.getWebCrypto(),oi=A.getNodeCrypto(),o0=oi&&oi.webcrypto&&oi.webcrypto.subtle;async function c0(r,e,t,n,i){const a=p.read(p.webHash,r);if(!a)throw Error("Hash algo not supported with HKDF");if(s0||o0){const s=s0||o0,o=await s.importKey("raw",e,"HKDF",!1,["deriveBits"]),u=await s.deriveBits({name:"HKDF",hash:a,salt:t,info:n},o,8*i);return new Uint8Array(u)}if(oi){const s=p.read(p.hash,r),o=(y,K)=>oi.createHmac(s,y).update(K).digest(),u=o(t,e),c=u.length,h=Math.ceil(i/c),l=new Uint8Array(h*c),w=new Uint8Array(c+n.length+1);w.set(n,c);for(let y=0;y0?w:w.subarray(c));w.set(K,0),l.set(K,y*c)}return l.subarray(0,i)}throw Error("No HKDF implementation available")}const u0={x25519:A.encodeUTF8("OpenPGP X25519")};var Z3=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.x25519){const e=Ee(32),{publicKey:t}=ee.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(r,e,t){if(r===p.publicKey.x25519){const{publicKey:n}=ee.box.keyPair.fromSecretKey(t);return A.equalsUint8Array(e,n)}return!1},encrypt:async function(r,e,t){if(r===p.publicKey.x25519){const n=Ee(32),i=ee.scalarMult(n,t),{publicKey:a}=ee.box.keyPair.fromSecretKey(n),s=A.concatUint8Array([a,t,i]),{keySize:o}=er(p.symmetric.aes128);return{ephemeralPublicKey:a,wrappedKey:Ja(await c0(p.hash.sha256,s,new Uint8Array,u0.x25519,o),e)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(r,e,t,n,i){if(r===p.publicKey.x25519){const a=ee.scalarMult(i,e),s=A.concatUint8Array([e,n,a]),{keySize:o}=er(p.symmetric.aes128);return ts(await c0(p.hash.sha256,s,new Uint8Array,u0.x25519,o),t)}throw Error("Unsupported ECDH algorithm")}}),X3=Object.freeze({__proto__:null,CurveWithOID:kr,ecdh:V3,ecdhX:Z3,ecdsa:F3,eddsaLegacy:H3,eddsa:j3,generate:async function(r){const e=await A.getBigInteger();r=new kr(r);const t=await r.genKeyPair(),n=new e(t.publicKey).toUint8Array(),i=new e(t.privateKey).toUint8Array("be",r.payloadSize);return{oid:r.oid,Q:n,secret:i,hash:r.hash,cipher:r.cipher}},getPreferredHashAlgo:function(r){return Zi[p.write(p.curve,r.toHex())].hash}}),Y3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){const s=await A.getBigInteger(),o=new s(1);let u,c,h,l;n=new s(n),i=new s(i),t=new s(t),a=new s(a),t=t.mod(n),a=a.mod(i);const w=new s(e.subarray(0,i.byteLength())).mod(i);for(;;){if(u=await br(o,i),c=t.modExp(u,n).imod(i),c.isZero())continue;const y=a.mul(c).imod(i);if(l=w.add(y).imod(i),h=u.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:c.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(r,e,t,n,i,a,s,o){const u=await A.getBigInteger(),c=new u(0);if(e=new u(e),t=new u(t),a=new u(a),s=new u(s),i=new u(i),o=new u(o),e.lte(c)||e.gte(s)||t.lte(c)||t.gte(s))return A.printDebug("invalid DSA Signature"),!1;const h=new u(n.subarray(0,s.byteLength())).imod(s),l=t.modInv(s);if(l.isZero())return A.printDebug("invalid DSA Signature"),!1;i=i.mod(a),o=o.mod(a);const w=h.mul(l).imod(s),y=e.mul(l).imod(s),K=i.modExp(w,a),C=o.modExp(y,a);return K.mul(C).imod(a).imod(s).equal(e)},validateParams:async function(r,e,t,n,i){const a=await A.getBigInteger();r=new a(r),e=new a(e),t=new a(t),n=new a(n);const s=new a(1);if(t.lte(s)||t.gte(r)||!r.dec().mod(e).isZero()||!t.modExp(e,r).isOne())return!1;const o=new a(e.bitLength()),u=new a(150);if(o.lt(u)||!await mo(e,null,32))return!1;i=new a(i);const c=new a(2),h=await br(c.leftShift(o.dec()),c.leftShift(o)),l=e.mul(h).add(i);return!!n.equal(t.modExp(l,r))}}),Tt={rsa:R3,elgamal:z3,elliptic:X3,dsa:Y3,nacl:ee},Q3=Object.freeze({__proto__:null,parseSignatureParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:return{s:A.readMPI(e.subarray(t))};case p.publicKey.dsa:case p.publicKey.ecdsa:{const n=A.readMPI(e.subarray(t));return t+=n.length+2,{r:n,s:A.readMPI(e.subarray(t))}}case p.publicKey.eddsaLegacy:{let n=A.readMPI(e.subarray(t));t+=n.length+2,n=A.leftPad(n,32);let i=A.readMPI(e.subarray(t));return i=A.leftPad(i,32),{r:n,s:i}}case p.publicKey.ed25519:{const n=e.subarray(t,t+64);return t+=n.length,{RS:n}}default:throw new re("Unknown signature algorithm.")}},verify:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=n,u=A.leftPad(t.s,s.length);return Tt.rsa.verify(e,i,u,s,o,a)}case p.publicKey.dsa:{const{g:s,p:o,q:u,y:c}=n,{r:h,s:l}=t;return Tt.dsa.verify(e,h,l,a,s,o,u,c)}case p.publicKey.ecdsa:{const{oid:s,Q:o}=n,u=new Tt.elliptic.CurveWithOID(s).payloadSize,c=A.leftPad(t.r,u),h=A.leftPad(t.s,u);return Tt.elliptic.ecdsa.verify(s,e,{r:c,s:h},i,o,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=n;return Tt.elliptic.eddsaLegacy.verify(s,e,t,i,o,a)}case p.publicKey.ed25519:{const{A:s}=n;return Tt.elliptic.eddsa.verify(r,e,t,i,s,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(r,e,t,n,i,a){if(!t||!n)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=t,{d:u,p:c,q:h,u:l}=n;return{s:await Tt.rsa.sign(e,i,s,o,u,c,h,l,a)}}case p.publicKey.dsa:{const{g:s,p:o,q:u}=t,{x:c}=n;return Tt.dsa.sign(e,a,s,o,u,c)}case p.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case p.publicKey.ecdsa:{const{oid:s,Q:o}=t,{d:u}=n;return Tt.elliptic.ecdsa.sign(s,e,i,o,u,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=t,{seed:u}=n;return Tt.elliptic.eddsaLegacy.sign(s,e,i,o,u,a)}case p.publicKey.ed25519:{const{A:s}=t,{seed:o}=n;return Tt.elliptic.eddsa.sign(r,e,i,s,o,a)}default:throw Error("Unknown signature algorithm.")}}});class h0{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return A.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class l0{constructor(e){if(e){const{hash:t,cipher:n}=e;this.hash=t,this.cipher=n}else this.hash=null,this.cipher=null}read(e){if(e.length<4||e[0]!==3||e[1]!==1)throw new re("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class y1{static fromObject({wrappedKey:e,algorithm:t}){const n=new y1;return n.wrappedKey=e,n.algorithm=t,n}read(e){let t=0,n=e[t++];this.algorithm=n%2?e[t++]:null,n-=n%2,this.wrappedKey=e.subarray(t,t+n),t+=n}write(){return A.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function ea(r){try{r.getName()}catch{throw new re("Unknown curve OID")}}var J3=Object.freeze({__proto__:null,publicKeyEncrypt:async function(r,e,t,n,i){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:{const{n:a,e:s}=t;return{c:await Tt.rsa.encrypt(n,a,s)}}case p.publicKey.elgamal:{const{p:a,g:s,y:o}=t;return Tt.elgamal.encrypt(n,a,s,o)}case p.publicKey.ecdh:{const{oid:a,Q:s,kdfParams:o}=t,{publicKey:u,wrappedKey:c}=await Tt.elliptic.ecdh.encrypt(a,o,n,s,i);return{V:u,C:new h0(c)}}case p.publicKey.x25519:{if(!A.isAES(e))throw Error("X25519 keys can only encrypt AES session keys");const{A:a}=t,{ephemeralPublicKey:s,wrappedKey:o}=await Tt.elliptic.ecdhX.encrypt(r,n,a);return{ephemeralPublicKey:s,C:y1.fromObject({algorithm:e,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:{const{c:s}=n,{n:o,e:u}=e,{d:c,p:h,q:l,u:w}=t;return Tt.rsa.decrypt(s,o,u,c,h,l,w,a)}case p.publicKey.elgamal:{const{c1:s,c2:o}=n,u=e.p,c=t.x;return Tt.elgamal.decrypt(s,o,u,c,a)}case p.publicKey.ecdh:{const{oid:s,Q:o,kdfParams:u}=e,{d:c}=t,{V:h,C:l}=n;return Tt.elliptic.ecdh.decrypt(s,u,h,l.data,o,c,i)}case p.publicKey.x25519:{const{A:s}=e,{k:o}=t,{ephemeralPublicKey:u,C:c}=n;if(!A.isAES(c.algorithm))throw Error("AES session key expected");return Tt.elliptic.ecdhX.decrypt(r,u,c.wrappedKey,s,o)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const n=A.readMPI(e.subarray(t));t+=n.length+2;const i=A.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{n,e:i}}}case p.publicKey.dsa:{const n=A.readMPI(e.subarray(t));t+=n.length+2;const i=A.readMPI(e.subarray(t));t+=i.length+2;const a=A.readMPI(e.subarray(t));t+=a.length+2;const s=A.readMPI(e.subarray(t));return t+=s.length+2,{read:t,publicParams:{p:n,q:i,g:a,y:s}}}case p.publicKey.elgamal:{const n=A.readMPI(e.subarray(t));t+=n.length+2;const i=A.readMPI(e.subarray(t));t+=i.length+2;const a=A.readMPI(e.subarray(t));return t+=a.length+2,{read:t,publicParams:{p:n,g:i,y:a}}}case p.publicKey.ecdsa:{const n=new We;t+=n.read(e),ea(n);const i=A.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.eddsaLegacy:{const n=new We;t+=n.read(e),ea(n);let i=A.readMPI(e.subarray(t));return t+=i.length+2,i=A.leftPad(i,33),{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.ecdh:{const n=new We;t+=n.read(e),ea(n);const i=A.readMPI(e.subarray(t));t+=i.length+2;const a=new l0;return t+=a.read(e.subarray(t)),{read:t,publicParams:{oid:n,Q:i,kdfParams:a}}}case p.publicKey.ed25519:case p.publicKey.x25519:{const n=e.subarray(t,t+32);return t+=n.length,{read:t,publicParams:{A:n}}}default:throw new re("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(r,e,t){let n=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const i=A.readMPI(e.subarray(n));n+=i.length+2;const a=A.readMPI(e.subarray(n));n+=a.length+2;const s=A.readMPI(e.subarray(n));n+=s.length+2;const o=A.readMPI(e.subarray(n));return n+=o.length+2,{read:n,privateParams:{d:i,p:a,q:s,u:o}}}case p.publicKey.dsa:case p.publicKey.elgamal:{const i=A.readMPI(e.subarray(n));return n+=i.length+2,{read:n,privateParams:{x:i}}}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const i=new kr(t.oid);let a=A.readMPI(e.subarray(n));return n+=a.length+2,a=A.leftPad(a,i.payloadSize),{read:n,privateParams:{d:a}}}case p.publicKey.eddsaLegacy:{const i=new kr(t.oid);let a=A.readMPI(e.subarray(n));return n+=a.length+2,a=A.leftPad(a,i.payloadSize),{read:n,privateParams:{seed:a}}}case p.publicKey.ed25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{seed:i}}}case p.publicKey.x25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{k:i}}}default:throw new re("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:return{c:A.readMPI(e.subarray(t))};case p.publicKey.elgamal:{const n=A.readMPI(e.subarray(t));return t+=n.length+2,{c1:n,c2:A.readMPI(e.subarray(t))}}case p.publicKey.ecdh:{const n=A.readMPI(e.subarray(t));t+=n.length+2;const i=new h0;return i.read(e.subarray(t)),{V:n,C:i}}case p.publicKey.x25519:{const n=e.subarray(t,t+32);t+=n.length;const i=new y1;return i.read(e.subarray(t)),{ephemeralPublicKey:n,C:i}}default:throw new re("Unknown public key encryption algorithm.")}},serializeParams:function(r,e){const t=new Set([p.publicKey.ed25519,p.publicKey.x25519]),n=Object.keys(e).map(i=>{const a=e[i];return A.isUint8Array(a)?t.has(r)?a:A.uint8ArrayToMPI(a):a.write()});return A.concatUint8Array(n)},generateParams:function(r,e,t){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:return Tt.rsa.generate(e,65537).then(({n,e:i,d:a,p:s,q:o,u})=>({privateParams:{d:a,p:s,q:o,u},publicParams:{n,e:i}}));case p.publicKey.ecdsa:return Tt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{d:a},publicParams:{oid:new We(n),Q:i}}));case p.publicKey.eddsaLegacy:return Tt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{seed:a},publicParams:{oid:new We(n),Q:i}}));case p.publicKey.ecdh:return Tt.elliptic.generate(t).then(({oid:n,Q:i,secret:a,hash:s,cipher:o})=>({privateParams:{d:a},publicParams:{oid:new We(n),Q:i,kdfParams:new l0({hash:s,cipher:o})}}));case p.publicKey.ed25519:return Tt.elliptic.eddsa.generate(r).then(({A:n,seed:i})=>({privateParams:{seed:i},publicParams:{A:n}}));case p.publicKey.x25519:return Tt.elliptic.ecdhX.generate(r).then(({A:n,k:i})=>({privateParams:{k:i},publicParams:{A:n}}));case p.publicKey.dsa:case p.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(r,e,t){if(!e||!t)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const{n,e:i}=e,{d:a,p:s,q:o,u}=t;return Tt.rsa.validateParams(n,i,a,s,o,u)}case p.publicKey.dsa:{const{p:n,q:i,g:a,y:s}=e,{x:o}=t;return Tt.dsa.validateParams(n,i,a,s,o)}case p.publicKey.elgamal:{const{p:n,g:i,y:a}=e,{x:s}=t;return Tt.elgamal.validateParams(n,i,a,s)}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const n=Tt.elliptic[p.read(p.publicKey,r)],{oid:i,Q:a}=e,{d:s}=t;return n.validateParams(i,a,s)}case p.publicKey.eddsaLegacy:{const{Q:n,oid:i}=e,{seed:a}=t;return Tt.elliptic.eddsaLegacy.validateParams(i,n,a)}case p.publicKey.ed25519:{const{A:n}=e,{seed:i}=t;return Tt.elliptic.eddsa.validateParams(r,n,i)}case p.publicKey.x25519:{const{A:n}=e,{k:i}=t;return Tt.elliptic.ecdhX.validateParams(r,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(r){const{blockSize:e}=er(r),t=await Ee(e),n=new Uint8Array([t[t.length-2],t[t.length-1]]);return A.concat([t,n])},generateSessionKey:function(r){const{keySize:e}=er(r);return Ee(e)},getAEADMode:function(r){const e=p.read(p.aead,r);return go[e]},getCipher:er,getPreferredCurveHashAlgo:function(r,e){switch(r){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:return Tt.elliptic.getPreferredHashAlgo(e);case p.publicKey.ed25519:return Tt.elliptic.eddsa.getPreferredHashAlgo(r);default:throw Error("Unknown elliptic signing algo")}}});const Bt={cipher:Si,hash:Ke,mode:go,publicKey:Tt,signature:Q3,random:I3,pkcs1:B3,pkcs5:G3,aesKW:q3};Object.assign(Bt,J3);var Ki=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function xo(r,e){return r.length===e?r:r.subarray?r.subarray(0,e):(r.length=e,r)}const Do={arraySet:function(r,e,t,n,i){if(e.subarray&&r.subarray)r.set(e.subarray(t,t+n),i);else for(let a=0;a=0;)r[e]=0}const i6=0,zo=1,a6=2,rs=29,xi=256,mi=xi+1+rs,En=30,ns=19,g0=2*mi+1,Yr=15,na=16,s6=7,is=256,Lo=16,Oo=17,No=18,Ta=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Xi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o6=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],m0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],lr=Array(2*(mi+2));zn(lr);const ui=Array(2*En);zn(ui);const wi=Array(512);zn(wi);const bi=Array(256);zn(bi);const as=Array(rs);zn(as);const g1=Array(En);function ia(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let w0,b0,k0;function aa(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}function Mo(r){return r<256?wi[r]:wi[256+(r>>>7)]}function ki(r,e){r.pending_buf[r.pending++]=255&e,r.pending_buf[r.pending++]=e>>>8&255}function ke(r,e,t){r.bi_valid>na-t?(r.bi_buf|=e<>na-r.bi_valid,r.bi_valid+=t-na):(r.bi_buf|=e<>>=1,t<<=1;while(--e>0);return t>>>1}function Fo(r,e,t){const n=Array(Yr+1);let i,a,s=0;for(i=1;i<=Yr;i++)n[i]=s=s+t[i-1]<<1;for(a=0;a<=e;a++){const o=r[2*a+1];o!==0&&(r[2*a]=$o(n[o]++,o))}}function Ho(r){let e;for(e=0;e8?ki(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0}function v0(r,e,t,n){const i=2*e,a=2*t;return r[i]>1;s>=1;s--)sa(r,t,s);u=a;do s=r.heap[1],r.heap[1]=r.heap[r.heap_len--],sa(r,t,1),o=r.heap[1],r.heap[--r.heap_max]=s,r.heap[--r.heap_max]=o,t[2*u]=t[2*s]+t[2*o],r.depth[u]=(r.depth[s]>=r.depth[o]?r.depth[s]:r.depth[o])+1,t[2*s+1]=t[2*o+1]=u,r.heap[1]=u++,sa(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],function(h,l){const w=l.dyn_tree,y=l.max_code,K=l.stat_desc.static_tree,C=l.stat_desc.has_stree,O=l.stat_desc.extra_bits,F=l.stat_desc.extra_base,Y=l.stat_desc.max_length;let $,E,W,H,j,V,Z=0;for(H=0;H<=Yr;H++)h.bl_count[H]=0;for(w[2*h.heap[h.heap_max]+1]=0,$=h.heap_max+1;$Y&&(H=Y,Z++),w[2*E+1]=H,E>y||(h.bl_count[H]++,j=0,E>=F&&(j=O[E-F]),V=w[2*E],h.opt_len+=V*(H+j),C&&(h.static_len+=V*(K[2*E+1]+j)));if(Z!==0){do{for(H=Y-1;h.bl_count[H]===0;)H--;h.bl_count[H]--,h.bl_count[H+1]+=2,h.bl_count[Y]--,Z-=2}while(Z>0);for(H=Y;H!==0;H--)for(E=h.bl_count[H];E!==0;)W=h.heap[--$],W>y||(w[2*W+1]!==H&&(h.opt_len+=(H-w[2*W+1])*w[2*W],w[2*W+1]=H),E--)}}(r,e),Fo(t,c,r.bl_count)}function A0(r,e,t){let n,i,a=-1,s=e[1],o=0,u=7,c=4;for(s===0&&(u=138,c=3),e[2*(t+1)+1]=65535,n=0;n<=t;n++)i=s,s=e[2*(n+1)+1],++o>=7;i=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(r)}function h6(r,e,t,n){let i,a,s=0;r.level>0?(r.strm.data_type===Ro&&(r.strm.data_type=function(o){let u,c=4093624447;for(u=0;u<=31;u++,c>>>=1)if(1&c&&o.dyn_ltree[2*u]!==0)return y0;if(o.dyn_ltree[18]!==0||o.dyn_ltree[20]!==0||o.dyn_ltree[26]!==0)return p0;for(u=32;u=3&&o.bl_tree[2*m0[u]+1]===0;u--);return o.opt_len+=3*(u+1)+5+5+4,u}(r),i=r.opt_len+3+7>>>3,a=r.static_len+3+7>>>3,a<=i&&(i=a)):i=a=t+5,t+4<=i&&e!==-1?qo(r,e,t,n):r.strategy===Bo||a===i?(ke(r,(zo<<1)+(n?1:0),3),_0(r,lr,ui)):(ke(r,(a6<<1)+(n?1:0),3),function(o,u,c,h){let l;for(ke(o,u-257,5),ke(o,c-1,5),ke(o,h-4,4),l=0;l>>8&255,r.pending_buf[r.d_buf+2*r.last_lit+1]=255&e,r.pending_buf[r.l_buf+r.last_lit]=255&t,r.last_lit++,e===0?r.dyn_ltree[2*t]++:(r.matches++,e--,r.dyn_ltree[2*(bi[t]+xi+1)]++,r.dyn_dtree[2*Mo(e)]++),r.last_lit===r.lit_bufsize-1}function vi(r,e,t,n){let i=65535&r|0,a=r>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do i=i+e[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}const l6=function(){let r;const e=[];for(let t=0;t<256;t++){r=t;for(let n=0;n<8;n++)r=1&r?3988292384^r>>>1:r>>>1;e[t]=r}return e}();function ie(r,e,t,n){const i=l6,a=n+t;r^=-1;for(let s=n;s>>8^i[255&(r^e[s])];return-1^r}var _i={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};const f6=9,Rt=3,Br=258,Le=Br+Rt+1,d6=32,m1=42,Ba=69,Yi=73,Qi=91,Ji=103,Qr=113,ti=666,ae=1,hi=2,Jr=3,Sn=4,y6=3;function Rr(r,e){return r.msg=_i[e],e}function P0(r){return(r<<1)-(r>4?9:0)}function Cr(r){let e=r.length;for(;--e>=0;)r[e]=0}function Kr(r){const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(nr(r.output,e.pending_buf,e.pending_out,t,r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))}function ue(r,e){h6(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Kr(r.strm)}function Ot(r,e){r.pending_buf[r.pending++]=e}function Hn(r,e){r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=255&e}function p6(r,e,t,n){let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,nr(e,r.input,r.next_in,i,t),r.state.wrap===1?r.adler=vi(r.adler,e,i,t):r.state.wrap===2&&(r.adler=ie(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)}function Go(r,e){let t,n,i=r.max_chain_length,a=r.strstart,s=r.prev_length,o=r.nice_match;const u=r.strstart>r.w_size-Le?r.strstart-(r.w_size-Le):0,c=r.window,h=r.w_mask,l=r.prev,w=r.strstart+Br;let y=c[a+s-1],K=c[a+s];r.prev_length>=r.good_match&&(i>>=2),o>r.lookahead&&(o=r.lookahead);do if(t=e,c[t+s]===K&&c[t+s-1]===y&&c[t]===c[a]&&c[++t]===c[a+1]){a+=2,t++;do;while(c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&as){if(r.match_start=e,s=n,n>=o)break;y=c[a+s-1],K=c[a+s]}}while((e=l[e&h])>u&&--i!=0);return s<=r.lookahead?s:r.lookahead}function nn(r){const e=r.w_size;let t,n,i,a,s;do{if(a=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Le)){nr(r.window,r.window,e,e,0),r.match_start-=e,r.strstart-=e,r.block_start-=e,n=r.hash_size,t=n;do i=r.head[--t],r.head[t]=i>=e?i-e:0;while(--n);n=e,t=n;do i=r.prev[--t],r.prev[t]=i>=e?i-e:0;while(--n);a+=e}if(r.strm.avail_in===0)break;if(n=p6(r.strm,r.window,r.strstart+r.lookahead,a),r.lookahead+=n,r.lookahead+r.insert>=Rt)for(s=r.strstart-r.insert,r.ins_h=r.window[s],r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<=Rt)if(n=zr(r,r.strstart-r.match_start,r.match_length-Rt),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=Rt){r.match_length--;do r.strstart++,r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<4096)&&(r.match_length=Rt-1)),r.prev_length>=Rt&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-Rt,n=zr(r,r.strstart-1-r.prev_match,r.prev_length-Rt),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=(r.ins_h<r.pending_buf_size-5&&(t=r.pending_buf_size-5);;){if(r.lookahead<=1){if(nn(r),r.lookahead===0&&e===ir)return ae;if(r.lookahead===0)break}r.strstart+=r.lookahead,r.lookahead=0;const n=r.block_start+t;if((r.strstart===0||r.strstart>=n)&&(r.lookahead=r.strstart-n,r.strstart=n,ue(r,!1),r.strm.avail_out===0)||r.strstart-r.block_start>=r.w_size-Le&&(ue(r,!1),r.strm.avail_out===0))return ae}return r.insert=0,e===oe?(ue(r,!0),r.strm.avail_out===0?Jr:Sn):(r.strstart>r.block_start&&(ue(r,!1),r.strm.avail_out),ae)}),new Fe(4,4,8,4,ca),new Fe(4,5,16,8,ca),new Fe(4,6,32,32,ca),new Fe(4,4,16,16,pn),new Fe(8,16,32,32,pn),new Fe(8,16,128,128,pn),new Fe(8,32,128,256,pn),new Fe(32,128,258,1024,pn),new Fe(32,258,258,4096,pn)];class g6{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Dn,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Pe(1146),this.dyn_dtree=new Pe(122),this.bl_tree=new Pe(78),Cr(this.dyn_ltree),Cr(this.dyn_dtree),Cr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Pe(16),this.heap=new Pe(573),Cr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Pe(573),Cr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function m6(r){const e=function(t){let n;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Ro,n=t.state,n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?m1:Qr,t.adler=n.wrap===2?0:1,n.last_flush=ir,c6(n),Ft):Rr(t,te)}(r);return e===Ft&&function(t){t.window_size=2*t.w_size,Cr(t.head),t.max_lazy_match=ei[t.level].max_lazy,t.good_match=ei[t.level].good_length,t.nice_match=ei[t.level].nice_length,t.max_chain_length=ei[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Rt-1,t.match_available=0,t.ins_h=0}(r.state),e}function w6(r,e){let t,n,i,a;if(!r||!r.state||e>f0||e<0)return r?Rr(r,te):te;if(n=r.state,!r.output||!r.input&&r.avail_in!==0||n.status===ti&&e!==oe)return Rr(r,r.avail_out===0?ci:te);if(n.strm=r,t=n.last_flush,n.last_flush=e,n.status===m1)if(n.wrap===2)r.adler=0,Ot(n,31),Ot(n,139),Ot(n,8),n.gzhead?(Ot(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ot(n,255&n.gzhead.time),Ot(n,n.gzhead.time>>8&255),Ot(n,n.gzhead.time>>16&255),Ot(n,n.gzhead.time>>24&255),Ot(n,n.level===9?2:n.strategy>=Fi||n.level<2?4:0),Ot(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ot(n,255&n.gzhead.extra.length),Ot(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(r.adler=ie(r.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Ba):(Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,n.level===9?2:n.strategy>=Fi||n.level<2?4:0),Ot(n,y6),n.status=Qr);else{let o=Dn+(n.w_bits-8<<4)<<8,u=-1;u=n.strategy>=Fi||n.level<2?0:n.level<6?1:n.level===6?2:3,o|=u<<6,n.strstart!==0&&(o|=d6),o+=31-o%31,n.status=Qr,Hn(n,o),n.strstart!==0&&(Hn(n,r.adler>>>16),Hn(n,65535&r.adler)),r.adler=1}if(n.status===Ba)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Kr(r),i=n.pending,n.pending!==n.pending_buf_size));)Ot(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Yi)}else n.status=Yi;if(n.status===Yi)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Kr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.gzindex=0,n.status=Qi)}else n.status=Qi;if(n.status===Qi)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Kr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.status=Ji)}else n.status=Ji;if(n.status===Ji&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Kr(r),n.pending+2<=n.pending_buf_size&&(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),r.adler=0,n.status=Qr)):n.status=Qr),n.pending!==0){if(Kr(r),r.avail_out===0)return n.last_flush=-1,Ft}else if(r.avail_in===0&&P0(e)<=P0(t)&&e!==oe)return Rr(r,ci);if(n.status===ti&&r.avail_in!==0)return Rr(r,ci);if(r.avail_in!==0||n.lookahead!==0||e!==ir&&n.status!==ti){var s=n.strategy===Fi?function(o,u){let c;for(;;){if(o.lookahead===0&&(nn(o),o.lookahead===0)){if(u===ir)return ae;break}if(o.match_length=0,c=zr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++,c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?Jr:Sn):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:hi}(n,e):n.strategy===n6?function(o,u){let c,h,l,w;const y=o.window;for(;;){if(o.lookahead<=Br){if(nn(o),o.lookahead<=Br&&u===ir)return ae;if(o.lookahead===0)break}if(o.match_length=0,o.lookahead>=Rt&&o.strstart>0&&(l=o.strstart-1,h=y[l],h===y[++l]&&h===y[++l]&&h===y[++l])){w=o.strstart+Br;do;while(h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&lo.lookahead&&(o.match_length=o.lookahead)}if(o.match_length>=Rt?(c=zr(o,1,o.match_length-Rt),o.lookahead-=o.match_length,o.strstart+=o.match_length,o.match_length=0):(c=zr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++),c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?Jr:Sn):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:hi}(n,e):ei[n.level].func(n,e);if(s!==Jr&&s!==Sn||(n.status=ti),s===ae||s===Jr)return r.avail_out===0&&(n.last_flush=-1),Ft;if(s===hi&&(e===t6?u6(n):e!==f0&&(qo(n,0,0,!1),e===e6&&(Cr(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Kr(r),r.avail_out===0))return n.last_flush=-1,Ft}return e!==oe?Ft:n.wrap<=0?gr:(n.wrap===2?(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),Ot(n,r.adler>>16&255),Ot(n,r.adler>>24&255),Ot(n,255&r.total_in),Ot(n,r.total_in>>8&255),Ot(n,r.total_in>>16&255),Ot(n,r.total_in>>24&255)):(Hn(n,r.adler>>>16),Hn(n,65535&r.adler)),Kr(r),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ft:gr)}try{String.fromCharCode.call(null,0)}catch{}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{}const Ra=new Xe(256);for(let r=0;r<256;r++)Ra[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function za(r){let e,t,n,i,a=0;const s=r.length;for(n=0;n>>6,o[i++]=128|63&e):e<65536?(o[i++]=224|e>>>12,o[i++]=128|e>>>6&63,o[i++]=128|63&e):(o[i++]=240|e>>>18,o[i++]=128|e>>>12&63,o[i++]=128|e>>>6&63,o[i++]=128|63&e);return o}Ra[254]=Ra[254]=1;class Wo{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class b6{constructor(e){this.options={level:d0,method:Dn,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...e||{}};const t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wo,this.strm.avail_out=0;var n,i,a=function(s,o,u,c,h,l){if(!s)return te;let w=1;if(o===d0&&(o=6),c<0?(w=0,c=-c):c>15&&(w=2,c-=16),h<1||h>f6||u!==Dn||c<8||c>15||o<0||o>9||l<0||l>Bo)return Rr(s,te);c===8&&(c=9);const y=new g6;return s.state=y,y.strm=s,y.wrap=w,y.gzhead=null,y.w_bits=c,y.w_size=1<=c.w_size&&(w===0&&(Cr(c.head),c.strstart=0,c.block_start=0,c.insert=0),O=new Xe(c.w_size),nr(O,u,F-c.w_size,c.w_size,0),u=O,F=c.w_size),y=o.avail_in,K=o.next_in,C=o.input,o.avail_in=F,o.next_in=0,o.input=u,nn(c);c.lookahead>=Rt;){h=c.strstart,l=c.lookahead-(Rt-1);do c.ins_h=(c.ins_h<0||n.avail_out===0)&&a!==gr);return s===oe?(a=function(o){let u;return o&&o.state?(u=o.state.status,u!==m1&&u!==Ba&&u!==Yi&&u!==Qi&&u!==Ji&&u!==Qr&&u!==ti?Rr(o,te):(o.state=null,u===Qr?Rr(o,es):Ft)):te}(this.strm),this.onEnd(a),this.ended=!0,a===Ft):s!==gi||(this.onEnd(Ft),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ft&&(this.result=Io(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const Hi=30,k6=12;function v6(r,e){let t,n,i,a,s,o,u,c,h,l;const w=r.state;t=r.next_in;const y=r.input,K=t+(r.avail_in-5);n=r.next_out;const C=r.output,O=n-(e-r.avail_out),F=n+(r.avail_out-257),Y=w.dmax,$=w.wsize,E=w.whave,W=w.wnext,H=w.window;i=w.hold,a=w.bits;const j=w.lencode,V=w.distcode,Z=(1<>>24,i>>>=o,a-=o,o=s>>>16&255,o===0)C[n++]=65535&s;else{if(!(16&o)){if(!(64&o)){s=j[(65535&s)+(i&(1<>>=o,a-=o),a<15&&(i+=y[t++]<>>24,i>>>=o,a-=o,o=s>>>16&255,!(16&o)){if(!(64&o)){s=V[(65535&s)+(i&(1<Y){r.msg="invalid distance too far back",w.mode=Hi;break t}if(i>>>=o,a-=o,o=n-O,c>o){if(o=c-o,o>E&&w.sane){r.msg="invalid distance too far back",w.mode=Hi;break t}if(h=0,l=H,W===0){if(h+=$-o,o2;)C[n++]=l[h++],C[n++]=l[h++],C[n++]=l[h++],u-=3;u&&(C[n++]=l[h++],u>1&&(C[n++]=l[h++]))}else{h=n-c;do C[n++]=C[h++],C[n++]=C[h++],C[n++]=C[h++],u-=3;while(u>2);u&&(C[n++]=C[h++],u>1&&(C[n++]=C[h++]))}break}}break}}while(t>3,t-=u,a-=u<<3,i&=(1<=1&&tt[F]===0;F--);if(Y>F&&(Y=F),F===0)return i[a++]=20971520,i[a++]=20971520,o.bits=1,0;for(O=1;O0&&(r===x0||F!==1))return-1;for(rt[1]=0,K=1;KU0||r===D0&&H>K0)return 1;for(;;){dt=K-E,s[C]y?(lt=ft[Pt+s[C]],N=V[Z+s[C]]):(lt=96,N=0),c=1<>E)+h]=dt<<24|lt<<16|N|0;while(h!==0);for(c=1<>=1;if(c!==0?(j&=c-1,j+=c):j=0,C++,--tt[K]==0){if(K===F)break;K=e[t+s[C]]}if(K>Y&&(j&q)!==l){for(E===0&&(E=Y),w+=O,$=K-E,W=1<<$;$+EU0||r===D0&&H>K0)return 1;l=j&q,i[l]=Y<<24|$<<16|w-a|0}}return j!==0&&(i[w+j]=K-E<<24|64<<16|0),o.bits=Y,0}const P6=0,Vo=1,Zo=2,Xo=1,C0=2,I0=3,T0=4,B0=5,R0=6,z0=7,L0=8,O0=9,N0=10,w1=11,cr=12,ha=13,M0=14,la=15,$0=16,F0=17,H0=18,j0=19,ji=20,qi=21,q0=22,G0=23,W0=24,V0=25,Z0=26,fa=27,X0=28,Y0=29,Zt=30,U6=852,K6=592;function Q0(r){return(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24)}class x6{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Pe(320),this.work=new Pe(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function D6(r){let e;return r&&r.state?(e=r.state,e.wsize=0,e.whave=0,e.wnext=0,function(t){let n;return t&&t.state?(n=t.state,t.total_in=t.total_out=n.total=0,t.msg="",n.wrap&&(t.adler=1&n.wrap),n.mode=Xo,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new p1(U6),n.distcode=n.distdyn=new p1(K6),n.sane=1,n.back=-1,Ft):te}(r)):te}function C6(r,e){let t,n;return r?(n=new x6,r.state=n,n.window=null,t=function(i,a){let s,o;return i&&i.state?(o=i.state,a<0?(s=0,a=-a):(s=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?te:(o.window!==null&&o.wbits!==a&&(o.window=null),o.wrap=s,o.wbits=a,D6(i))):te}(r,e),t!==Ft&&(r.state=null),t):te}let da,ya,J0=!0;function I6(r){if(J0){let e;for(da=new p1(512),ya=new p1(32),e=0;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(li(Vo,r.lens,0,288,da,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;li(Zo,r.lens,0,32,ya,0,r.work,{bits:5}),J0=!1}r.lencode=da,r.lenbits=9,r.distcode=ya,r.distbits=5}function Yo(r,e,t,n){let i;const a=r.state;return a.window===null&&(a.wsize=1<=a.wsize?(nr(a.window,e,t-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),nr(a.window,e,t-n,i,a.wnext),(n-=i)?(nr(a.window,e,t-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,t.check=ie(t.check,rt,2,0),c=0,h=0,t.mode=C0;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&c)<<8)+(c>>8))%31){r.msg="incorrect header check",t.mode=Zt;break}if((15&c)!==Dn){r.msg="unknown compression method",t.mode=Zt;break}if(c>>>=4,h-=4,H=8+(15&c),t.wbits===0)t.wbits=H;else if(H>t.wbits){r.msg="invalid window size",t.mode=Zt;break}t.dmax=1<>8&1),512&t.flags&&(rt[0]=255&c,rt[1]=c>>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0,t.mode=I0;case I0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>8&255,rt[2]=c>>>16&255,rt[3]=c>>>24&255,t.check=ie(t.check,rt,4,0)),c=0,h=0,t.mode=T0;case T0:for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>8),512&t.flags&&(rt[0]=255&c,rt[1]=c>>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0,t.mode=B0;case B0:if(1024&t.flags){for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0}else t.head&&(t.head.extra=null);t.mode=R0;case R0:if(1024&t.flags&&(y=t.length,y>o&&(y=o),y&&(t.head&&(H=t.head.extra_len-t.length,t.head.extra||(t.head.extra=Array(t.head.extra_len)),nr(t.head.extra,n,a,y,H)),512&t.flags&&(t.check=ie(t.check,n,y,a)),o-=y,a+=y,t.length-=y),t.length))break t;t.length=0,t.mode=z0;case z0:if(2048&t.flags){if(o===0)break t;y=0;do H=n[a+y++],t.head&&H&&t.length<65536&&(t.head.name+=String.fromCharCode(H));while(H&&y>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=cr;break;case N0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>=7&h,h-=7&h,t.mode=fa;break}for(;h<3;){if(o===0)break t;o--,c+=n[a++]<>>=1,h-=1,3&c){case 0:t.mode=M0;break;case 1:I6(t),t.mode=ji;break;case 2:t.mode=F0;break;case 3:r.msg="invalid block type",t.mode=Zt}c>>>=2,h-=2;break;case M0:for(c>>>=7&h,h-=7&h;h<32;){if(o===0)break t;o--,c+=n[a++]<>>16^65535)){r.msg="invalid stored block lengths",t.mode=Zt;break}t.length=65535&c,c=0,h=0,t.mode=la;case la:t.mode=$0;case $0:if(y=t.length,y){if(y>o&&(y=o),y>u&&(y=u),y===0)break t;nr(i,n,a,y,s),o-=y,a+=y,u-=y,s+=y,t.length-=y;break}t.mode=cr;break;case F0:for(;h<14;){if(o===0)break t;o--,c+=n[a++]<>>=5,h-=5,t.ndist=1+(31&c),c>>>=5,h-=5,t.ncode=4+(15&c),c>>>=4,h-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Zt;break}t.have=0,t.mode=H0;case H0:for(;t.have>>=3,h-=3}for(;t.have<19;)t.lens[dt[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,V={bits:t.lenbits},j=li(P6,t.lens,0,19,t.lencode,0,t.work,V),t.lenbits=V.bits,j){r.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=j0;case j0:for(;t.have>>24,F=tt>>>16&255,Y=65535&tt,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=O,h-=O,t.lens[t.have++]=Y;else{if(Y===16){for(Z=O+2;h>>=O,h-=O,t.have===0){r.msg="invalid bit length repeat",t.mode=Zt;break}H=t.lens[t.have-1],y=3+(3&c),c>>>=2,h-=2}else if(Y===17){for(Z=O+3;h>>=O,h-=O,H=0,y=3+(7&c),c>>>=3,h-=3}else{for(Z=O+7;h>>=O,h-=O,H=0,y=11+(127&c),c>>>=7,h-=7}if(t.have+y>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Zt;break}for(;y--;)t.lens[t.have++]=H}}if(t.mode===Zt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Zt;break}if(t.lenbits=9,V={bits:t.lenbits},j=li(Vo,t.lens,0,t.nlen,t.lencode,0,t.work,V),t.lenbits=V.bits,j){r.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,V={bits:t.distbits},j=li(Zo,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,V),t.distbits=V.bits,j){r.msg="invalid distances set",t.mode=Zt;break}t.mode=ji;case ji:t.mode=qi;case qi:if(o>=6&&u>=258){r.next_out=s,r.avail_out=u,r.next_in=a,r.avail_in=o,t.hold=c,t.bits=h,v6(r,w),s=r.next_out,i=r.output,u=r.avail_out,a=r.next_in,n=r.input,o=r.avail_in,c=t.hold,h=t.bits,t.mode===cr&&(t.back=-1);break}for(t.back=0;tt=t.lencode[c&(1<>>24,F=tt>>>16&255,Y=65535&tt,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>$)],O=tt>>>24,F=tt>>>16&255,Y=65535&tt,!($+O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=$,h-=$,t.back+=$}if(c>>>=O,h-=O,t.back+=O,t.length=Y,F===0){t.mode=Z0;break}if(32&F){t.back=-1,t.mode=cr;break}if(64&F){r.msg="invalid literal/length code",t.mode=Zt;break}t.extra=15&F,t.mode=q0;case q0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=G0;case G0:for(;tt=t.distcode[c&(1<>>24,F=tt>>>16&255,Y=65535&tt,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>$)],O=tt>>>24,F=tt>>>16&255,Y=65535&tt,!($+O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=$,h-=$,t.back+=$}if(c>>>=O,h-=O,t.back+=O,64&F){r.msg="invalid distance code",t.mode=Zt;break}t.offset=Y,t.extra=15&F,t.mode=W0;case W0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Zt;break}t.mode=V0;case V0:if(u===0)break t;if(y=w-u,t.offset>y){if(y=t.offset-y,y>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Zt;break}y>t.wnext?(y-=t.wnext,K=t.wsize-y):K=t.wnext-y,y>t.length&&(y=t.length),C=t.window}else C=i,K=s-t.offset,y=t.length;y>u&&(y=u),u-=y,t.length-=y;do i[s++]=C[K++];while(--y);t.length===0&&(t.mode=qi);break;case Z0:if(u===0)break t;i[s++]=t.length,u--,t.mode=qi;break;case fa:if(t.wrap){for(;h<32;){if(o===0)break t;o--,c|=n[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wo,this.strm.avail_out=0;let n=C6(this.strm,t.windowBits);if(n!==Ft||(this.header=new B6,function(i,a){let s;i&&i.state&&(s=i.state,!(2&s.wrap)||(s.head=a,a.done=!1))}(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=za(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=t2(this.strm,t.dictionary),n!==Ft))))throw Error(_i[n])}push(e,t){const{strm:n,options:{chunkSize:i,dictionary:a}}=this;let s,o,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?oe:ir,typeof e=="string"?n.input=function(c){const h=new Xe(c.length);for(let l=0,w=h.length;l0||n.avail_out===0)&&s!==gr);return s===gr&&(o=oe),o===oe?(s=function(c){if(!c||!c.state)return te;const h=c.state;return h.window&&(h.window=null),c.state=null,Ft}(this.strm),this.onEnd(s),this.ended=!0,s===Ft):o!==gi||(this.onEnd(Ft),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ft&&(this.result=Io(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var r2=[0,1,3,7,15,31,63,127,255],ri=function(r){this.stream=r,this.bitOffset=0,this.curByte=0,this.hasByte=!1};ri.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},ri.prototype.read=function(r){for(var e=0;r>0;){this._ensureByte();var t=8-this.bitOffset;if(r>=t)e<<=t,e|=r2[t]&this.curByte,this.hasByte=!1,this.bitOffset=0,r-=t;else{e<<=r;var n=t-r;e|=(this.curByte&r2[r]<>n,this.bitOffset+=r,r=0}}return e},ri.prototype.seek=function(r){var e=r%8,t=(r-e)/8;this.bitOffset=e,this.stream.seek(t),this.hasByte=!1},ri.prototype.pi=function(){var r,e=new Uint8Array(6);for(r=0;r("00"+n.toString(16)).slice(-2)).join("")}(e)};var R6=ri,Gr=function(){};Gr.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Gr.prototype.read=function(r,e,t){for(var n=0;n>>0},this.updateCRC=function(e){r=r<<8^pa[255&(r>>>24^e)]},this.updateCRCRun=function(e,t){for(;t-- >0;)r=r<<8^pa[255&(r>>>24^e)]}}),n2=function(r,e){var t,n=r[e];for(t=e;t>0;t--)r[t]=r[t-1];return r[0]=n,n},Xt={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},xr={};xr[Xt.LAST_BLOCK]="Bad file checksum",xr[Xt.NOT_BZIP_DATA]="Not bzip data",xr[Xt.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",xr[Xt.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",xr[Xt.DATA_ERROR]="Data error",xr[Xt.OUT_OF_MEMORY]="Out of memory",xr[Xt.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var ce=function(r,e){var t=xr[r]||"unknown error";e&&(t+=": "+e);var n=new TypeError(t);throw n.errorCode=r,n},ni=function(r,e){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(r,e)};ni.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new z6,!0):(this.writeCount=-1,!1)},ni.prototype._start_bunzip=function(r,e){var t=new Uint8Array(4);r.read(t,0,4)===4&&String.fromCharCode(t[0],t[1],t[2])==="BZh"||ce(Xt.NOT_BZIP_DATA,"bad magic");var n=t[3]-48;(n<1||n>9)&&ce(Xt.NOT_BZIP_DATA,"level out of range"),this.reader=new R6(r),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=e,this.streamCRC=0},ni.prototype._get_next_block=function(){var r,e,t,n=this.reader,i=n.pi();if(i==="177245385090")return!1;i!=="314159265359"&&ce(Xt.NOT_BZIP_DATA),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&ce(Xt.OBSOLETE_INPUT);var a=n.read(24);a>this.dbufSize&&ce(Xt.DATA_ERROR,"initial position out of bounds");var s=n.read(16),o=new Uint8Array(256),u=0;for(r=0;r<16;r++)if(s&1<<15-r){var c=16*r;for(t=n.read(16),e=0;e<16;e++)t&1<<15-e&&(o[u++]=c+e)}var h=n.read(3);(h<2||h>6)&&ce(Xt.DATA_ERROR);var l=n.read(15);l===0&&ce(Xt.DATA_ERROR);var w=new Uint8Array(256);for(r=0;r=h&&ce(Xt.DATA_ERROR);y[r]=n2(w,e)}var K,C=u+2,O=[];for(e=0;e20)&&ce(Xt.DATA_ERROR),n.read(1);)n.read(1)?s--:s++;$[r]=s}for(F=Y=$[0],r=1;rY?Y=$[r]:$[r]=l&&ce(Xt.DATA_ERROR),K=O[y[tt++]]),r=K.minLen,e=n.read(r);r>K.maxLen&&ce(Xt.DATA_ERROR),!(e<=K.limit[r]);r++)e=e<<1|n.read(1);((e-=K.base[r])<0||e>=258)&&ce(Xt.DATA_ERROR);var dt=K.permute[e];if(dt!==0&&dt!==1){if(V)for(V=0,Z+s>this.dbufSize&&ce(Xt.DATA_ERROR),H[j=o[w[0]]]+=s;s--;)rt[Z++]=j;if(dt>u)break;Z>=this.dbufSize&&ce(Xt.DATA_ERROR),H[j=o[j=n2(w,r=dt-1)]]++,rt[Z++]=j}else V||(V=1,s=0),s+=dt===0?V:2*V,V<<=1}for((a<0||a>=Z)&&ce(Xt.DATA_ERROR),e=0,r=0;r<256;r++)t=e+H[r],H[r]=e,e=t;for(r=0;r>=8,ft=-1),this.writePos=lt,this.writeCurrent=N,this.writeCount=Z,this.writeRun=ft,!0},ni.prototype._read_bunzip=function(r,e){var t,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,s=this.writePos,o=this.writeCurrent,u=this.writeCount;this.outputsize;for(var c=this.writeRun;u;){for(u--,n=o,o=255&(s=a[s]),s>>=8,c++==3?(t=o,i=n,o=-1):(t=1,i=o),this.blockCRC.updateCRCRun(i,t);t--;)this.outputStream.writeByte(i),this.nextoutput++;o!=n&&(c=0)}return this.writeCount=u,this.blockCRC.getCRC()!==this.targetBlockCRC&&ce(Xt.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var L6=function(r){if("readByte"in r)return r;var e=new Qo;return e.pos=0,e.readByte=function(){return r[this.pos++]},e.seek=function(t){this.pos=t},e.eof=function(){return this.pos>=r.length},e},O6=function(r){var e=new Qo,t=!0;if(r)if(typeof r=="number")e.buffer=new Uint8Array(r),t=!1;else{if("writeByte"in r)return r;e.buffer=r,t=!1}else e.buffer=new Uint8Array(16384);return e.pos=0,e.writeByte=function(n){if(t&&this.pos>=this.buffer.length){var i=new Uint8Array(2*this.buffer.length);i.set(this.buffer),this.buffer=i}this.buffer[this.pos++]=n},e.getBuffer=function(){if(this.pos!==this.buffer.length){if(!t)throw new TypeError("outputsize does not match decoded input");var n=new Uint8Array(this.pos);n.set(this.buffer.subarray(0,this.pos)),this.buffer=n}return this.buffer},e._coerced=!0,e},i2=function(r,e,t){for(var n=L6(r),i=O6(e),a=new ni(n,i);!("eof"in n)||!n.eof();)if(a._init_block())a._read_bunzip();else{var s=a.reader.read(32)>>>0;if(s!==a.streamCRC&&ce(Xt.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!t||!("eof"in n)||n.eof())break;a._start_bunzip(n,i)}if("getBuffer"in i)return i.getBuffer()};const jn=Symbol("verified"),N6=new Set([p.signatureSubpacket.issuer,p.signatureSubpacket.issuerFingerprint,p.signatureSubpacket.embeddedSignature]);class mr{static get tag(){return p.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new xn,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[jn]=null}read(e){let t=0;if(this.version=e[t++],this.version!==4&&this.version!==5)throw new re(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=Bt.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?Ai(async()=>Bt.serializeParams(this.publicKeyAlgorithm,await this.params)):Bt.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),A.concat(e)}async sign(e,t,n=new Date,i=!1){e.version===5?this.version=5:this.version=4;const a=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=A.normalizeDate(n),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),a.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=A.concat(a);const s=this.toHash(this.signatureType,t,i),o=await this.hash(this.signatureType,t,s,i);this.signedHashValue=Ae(e1(o),0,2);const u=async()=>Bt.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,s,await ar(o));A.isStream(o)?this.params=u():(this.params=await u(),this[jn]=!0)}writeHashedSubPackets(){const e=p.signatureSubpacket,t=[];let n;if(this.created===null)throw Error("Missing signature creation time");t.push(Vt(e.signatureCreationTime,!0,A.writeDate(this.created))),this.signatureExpirationTime!==null&&t.push(Vt(e.signatureExpirationTime,!0,A.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&t.push(Vt(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(n=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Vt(e.trustSignature,!0,n))),this.regularExpression!==null&&t.push(Vt(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&t.push(Vt(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&t.push(Vt(e.keyExpirationTime,!0,A.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(n=A.stringToUint8Array(A.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Vt(e.preferredSymmetricAlgorithms,!1,n))),this.revocationKeyClass!==null&&(n=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),n=A.concat([n,this.revocationKeyFingerprint]),t.push(Vt(e.revocationKey,!1,n))),this.issuerKeyID.isNull()||this.issuerKeyVersion===5||t.push(Vt(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach(({name:s,value:o,humanReadable:u,critical:c})=>{n=[new Uint8Array([u?128:0,0,0,0])];const h=A.encodeUTF8(s);n.push(A.writeNumber(h.length,2)),n.push(A.writeNumber(o.length,2)),n.push(h),n.push(o),n=A.concat(n),t.push(Vt(e.notationData,c,n))}),this.preferredHashAlgorithms!==null&&(n=A.stringToUint8Array(A.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Vt(e.preferredHashAlgorithms,!1,n))),this.preferredCompressionAlgorithms!==null&&(n=A.stringToUint8Array(A.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Vt(e.preferredCompressionAlgorithms,!1,n))),this.keyServerPreferences!==null&&(n=A.stringToUint8Array(A.uint8ArrayToString(this.keyServerPreferences)),t.push(Vt(e.keyServerPreferences,!1,n))),this.preferredKeyServer!==null&&t.push(Vt(e.preferredKeyServer,!1,A.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&t.push(Vt(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&t.push(Vt(e.policyURI,!1,A.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(n=A.stringToUint8Array(A.uint8ArrayToString(this.keyFlags)),t.push(Vt(e.keyFlags,!0,n))),this.signersUserID!==null&&t.push(Vt(e.signersUserID,!1,A.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(n=A.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Vt(e.reasonForRevocation,!0,n))),this.features!==null&&(n=A.stringToUint8Array(A.uint8ArrayToString(this.features)),t.push(Vt(e.features,!1,n))),this.signatureTargetPublicKeyAlgorithm!==null&&(n=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],n.push(A.stringToUint8Array(this.signatureTargetHash)),n=A.concat(n),t.push(Vt(e.signatureTarget,!0,n))),this.embeddedSignature!==null&&t.push(Vt(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(n=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],n=A.concat(n),t.push(Vt(e.issuerFingerprint,this.version===5,n))),this.preferredAEADAlgorithms!==null&&(n=A.stringToUint8Array(A.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Vt(e.preferredAEADAlgorithms,!1,n)));const i=A.concat(t),a=A.writeNumber(i.length,2);return A.concat([a,i])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach(i=>{e.push(Ui(i.length)),e.push(i)});const t=A.concat(e),n=A.writeNumber(t.length,2);return A.concat([n,t])}readSubPacket(e,t=!0){let n=0;const i=!!(128&e[n]),a=127&e[n];if(t||(this.unhashedSubpackets.push(e.subarray(n,e.length)),N6.has(a)))switch(n++,a){case p.signatureSubpacket.signatureCreationTime:this.created=A.readDate(e.subarray(n,e.length));break;case p.signatureSubpacket.signatureExpirationTime:{const s=A.readNumber(e.subarray(n,e.length));this.signatureNeverExpires=s===0,this.signatureExpirationTime=s;break}case p.signatureSubpacket.exportableCertification:this.exportable=e[n++]===1;break;case p.signatureSubpacket.trustSignature:this.trustLevel=e[n++],this.trustAmount=e[n++];break;case p.signatureSubpacket.regularExpression:this.regularExpression=e[n];break;case p.signatureSubpacket.revocable:this.revocable=e[n++]===1;break;case p.signatureSubpacket.keyExpirationTime:{const s=A.readNumber(e.subarray(n,e.length));this.keyExpirationTime=s,this.keyNeverExpires=s===0;break}case p.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.revocationKey:this.revocationKeyClass=e[n++],this.revocationKeyAlgorithm=e[n++],this.revocationKeyFingerprint=e.subarray(n,n+20);break;case p.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(n,e.length));break;case p.signatureSubpacket.notationData:{const s=!!(128&e[n]);n+=4;const o=A.readNumber(e.subarray(n,n+2));n+=2;const u=A.readNumber(e.subarray(n,n+2));n+=2;const c=A.decodeUTF8(e.subarray(n,n+o)),h=e.subarray(n+o,n+o+u);this.rawNotations.push({name:c,humanReadable:s,value:h,critical:i}),s&&(this.notations[c]=A.decodeUTF8(h));break}case p.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=A.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.primaryUserID:this.isPrimaryUserID=e[n++]!==0;break;case p.signatureSubpacket.policyURI:this.policyURI=A.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signersUserID:this.signersUserID=A.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[n++],this.reasonForRevocationString=A.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.features:this.features=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[n++],this.signatureTargetHashAlgorithm=e[n++];const s=Bt.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=A.uint8ArrayToString(e.subarray(n,n+s));break}case p.signatureSubpacket.embeddedSignature:this.embeddedSignature=new mr,this.embeddedSignature.read(e.subarray(n,e.length));break;case p.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[n++],this.issuerFingerprint=e.subarray(n,e.length),this.issuerKeyVersion===5?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case p.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(n,e.length)];break;default:{const s=Error("Unknown signature subpacket type "+a);if(i)throw s;A.printDebug(s)}}}readSubPackets(e,t=!0,n){const i=A.readNumber(e.subarray(0,2));let a=2;for(;a<2+i;){const s=bo(e.subarray(a,e.length));a+=s.offset,this.readSubPacket(e.subarray(a,a+s.len),t,n),a+=s.len}return a}toSign(e,t){const n=p.signature;switch(e){case n.binary:return t.text!==null?A.encodeUTF8(t.getText(!0)):t.getBytes(!0);case n.text:{const i=t.getBytes(!0);return A.canonicalizeEOL(i)}case n.standalone:return new Uint8Array(0);case n.certGeneric:case n.certPersona:case n.certCasual:case n.certPositive:case n.certRevocation:{let i,a;if(t.userID)a=180,i=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");a=209,i=t.userAttribute}const s=i.write();return A.concat([this.toSign(n.key,t),new Uint8Array([a]),A.writeNumber(s.length,4),s])}case n.subkeyBinding:case n.subkeyRevocation:case n.keyBinding:return A.concat([this.toSign(n.key,t),this.toSign(n.key,{key:t.bind})]);case n.key:if(t.key===void 0)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case n.keyRevocation:return this.toSign(n.key,t);case n.timestamp:return new Uint8Array(0);case n.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let n=0;return Qt(e1(this.signatureData),i=>{n+=i.length},()=>{const i=[];return this.version!==5||this.signatureType!==p.signature.binary&&this.signatureType!==p.signature.text||(t?i.push(new Uint8Array(6)):i.push(e.writeHeader())),i.push(new Uint8Array([this.version,255])),this.version===5&&i.push(new Uint8Array(4)),i.push(A.writeNumber(n,4)),A.concat(i)})}toHash(e,t,n=!1){const i=this.toSign(e,t);return A.concat([i,this.signatureData,this.calculateTrailer(t,n)])}async hash(e,t,n,i=!1){return n||(n=this.toHash(e,t,i)),Bt.hash.digest(this.hashAlgorithm,n)}async verify(e,t,n,i=new Date,a=!1,s=vt){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===p.signature.binary||t===p.signature.text;if(!(this[jn]&&!o)){let c,h;if(this.hashed?h=await this.hashed:(c=this.toHash(t,n,a),h=await this.hash(t,n,c)),h=await ar(h),this.signedHashValue[0]!==h[0]||this.signedHashValue[1]!==h[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[jn]=await Bt.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,c,h),!this[jn])throw Error("Signature verification failed")}const u=A.normalizeDate(i);if(u&&this.created>u)throw Error("Signature creation time is in the future");if(u&&u>=this.getExpirationTime())throw Error("Signature is expired");if(s.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(s.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[p.signature.binary,p.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach(({name:c,critical:h})=>{if(h&&s.knownNotations.indexOf(c)<0)throw Error("Unknown critical notation: "+c)}),this.revocationKeyClass!==null)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=A.normalizeDate(e);return t!==null&&!(this.created<=t&&tmr.prototype.calculateTrailer.apply(await this.correspondingSig,e))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==p.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function M6(r,e){if(!e[r]){let t;try{t=p.read(p.packet,r)}catch{throw new re("Unknown packet type with tag: "+r)}throw Error("Packet not allowed in this context: "+t)}return new e[r]}ga.prototype.hash=mr.prototype.hash,ga.prototype.toHash=mr.prototype.toHash,ga.prototype.toSign=mr.prototype.toSign;class xe extends Array{static async fromBinary(e,t,n=vt){const i=new xe;return await i.read(e,t,n),i}async read(e,t,n=vt){n.additionalAllowedPackets.length&&(t={...t,...A.constructAllowedPackets(n.additionalAllowedPackets)}),this.stream=pi(e,async(a,s)=>{const o=Oe(s);try{for(;;)if(await o.ready,await O3(a,async u=>{try{if(u.tag===p.packet.marker||u.tag===p.packet.trust)return;const c=M6(u.tag,t);c.packets=new xe,c.fromStream=A.isStream(u.packet),await c.read(u.packet,n),await o.write(c)}catch(c){const h=!n.ignoreUnsupportedPackets&&c instanceof re,l=!(n.ignoreMalformedPackets||c instanceof re);if(h||l||Vi(u.tag))await o.abort(c);else{const w=new Ia(u.tag,u.packet);await o.write(w)}A.printDebugError(c)}}))return await o.ready,void await o.close()}catch(u){await o.abort(u)}});const i=an(this.stream);for(;;){const{done:a,value:s}=await i.read();if(a?this.stream=null:this.push(s),a||Vi(s.constructor.tag))break}i.releaseLock()}write(){const e=[];for(let t=0;t{if(a.push(u),s+=u.length,s>=o){const c=Math.min(Math.log(s)/Math.LN2|0,30),h=2**c,l=A.concat([L3(c)].concat(a));return a=[l.subarray(1+h)],s=a[0].length,l.subarray(0,1+h)}},()=>A.concat([Ui(s)].concat(a))))}else{if(A.isStream(i)){let a=0;e.push(Qt(e1(i),s=>{a+=s.length},()=>e0(n,a)))}else e.push(e0(n,i.length));e.push(i)}}return A.concat(e)}filterByTag(...e){const t=new xe,n=i=>a=>i===a;for(let i=0;it.constructor.tag===e)}indexOfTag(...e){const t=[],n=this,i=a=>s=>a===s;for(let a=0;aar(n).then(i=>new Promise((a,s)=>{r(i,t,(o,u)=>{if(o)return s(o);a(u)})}))):P1(j2(n).pipe(e(t)))}}function o2(r,e={}){return function(t){const n=new r(e);return Qt(t,i=>{if(i.length)return n.push(i,gi),n.result},()=>{if(r===b6)return n.push([],oe),n.result})}}function c2(r){return function(e){return Ai(async()=>r(await ar(e)))}}qn&&(qn.inflateRaw,qn.createInflateRaw,qn.inflate,qn.createInflate);class ma{constructor(e=vt){this.algorithm=p.hash.sha256,this.type="iterated",this.c=e.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(e){let t=0;try{this.type=p.read(p.s2k,e[t++])}catch{throw new re("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if(A.uint8ArrayToString(e.subarray(t,t+3))!=="GNU")throw new re("Unknown s2k type.");if(t+=3,1e3+e[t++]!==1001)throw new re("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new re("Unknown s2k type.")}return t}write(){if(this.type==="gnu-dummy")return new Uint8Array([101,0,...A.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([p.write(p.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return A.concatUint8Array(e)}async produceKey(e,t){e=A.encodeUTF8(e);const n=[];let i=0,a=0;for(;i{this.privateParams[e].fill(0),delete this.privateParams[e]}),this.privateParams=null,this.isEncrypted=!0)}}async function u2(r,e,t){const{keySize:n}=Bt.getCipher(t);return r.produceKey(e,n)}var $6=Za(function(r){(function(e){function t(i){function a(){return Et0&&(et.semantic=" "),et}}function $(J,et){return function(){var ct,wt,kt,Ut,_t;for(Ut=s(),ct=c("star"),kt=0,_t=et===void 0?0:et;(wt=J())!==null;)kt+=1,l(ct,wt);return kt>=_t?ct:(o(Ut),null)}}function E(J){return J.charCodeAt(0)>=128}function W(){return h("cr",y("\r")())}function H(){return h("crlf",K(W,Z)())}function j(){return h("dquote",y('"')())}function V(){return h("htab",y(" ")())}function Z(){return h("lf",y(` -`)())}function tt(){return h("sp",y(" ")())}function rt(){return h("vchar",w(function(J){var et=J.charCodeAt(0),ct=33<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct}))}function dt(){return h("wsp",C(tt,V)())}function lt(){var J=h("quoted-pair",C(K(y("\\"),C(rt,dt)),x)());return J===null?null:(J.semantic=J.semantic[1],J)}function N(){return h("fws",C(B,K(O(K($(dt),F(H))),$(dt,1)))())}function ft(){return h("ctext",C(function(){return w(function(J){var et=J.charCodeAt(0),ct=33<=et&&et<=39||42<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},ht)())}function Pt(){return h("ccontent",C(ft,lt,q)())}function q(){return h("comment",K(y("("),$(K(O(N),Pt)),O(N),y(")"))())}function it(){return h("cfws",C(K($(K(O(N),q),1),O(N)),N)())}function mt(){return h("atext",w(function(J){var et="a"<=J&&J<="z"||"A"<=J&&J<="Z"||"0"<=J&&J<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(J)>=0;return i.rfc6532&&(et=et||E(J)),et}))}function bt(){return h("atom",K(Y(O(it)),$(mt,1),Y(O(it)))())}function yt(){var J,et;return(J=h("dot-atom-text",$(mt,1)()))===null||(et=$(K(y("."),$(mt,1)))())!==null&&l(J,et),J}function pt(){return h("dot-atom",K(F(O(it)),yt,F(O(it)))())}function gt(){return h("qtext",C(function(){return w(function(J){var et=J.charCodeAt(0),ct=et===33||35<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},I)())}function ot(){return h("qcontent",C(gt,lt)())}function S(){return h("quoted-string",K(F(O(it)),F(j),$(K(O(Y(N)),ot)),O(F(N)),F(j),F(O(it)))())}function M(){return h("word",C(bt,S)())}function b(){return h("address",C(f,X)())}function f(){return h("mailbox",C(U,ut)())}function U(){return h("name-addr",K(O(Q),G)())}function G(){return h("angle-addr",C(K(F(O(it)),y("<"),ut,y(">"),F(O(it))),R)())}function X(){return h("group",K(Q,y(":"),O(m),y(";"),F(O(it)))())}function Q(){return h("display-name",((J=h("phrase",C(D,$(M,1))()))!==null&&(J.semantic=function(et){return et.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(J.semantic)),J));var J}function g(){return h("mailbox-list",C(K(f,$(K(y(","),f))),k)())}function d(){return h("address-list",C(K(b,$(K(y(","),b))),nt)())}function m(){return h("group-list",C(g,F(it),at)())}function _(){return h("local-part",C(St,pt,S)())}function T(){return h("dtext",C(function(){return w(function(J){var et=J.charCodeAt(0),ct=33<=et&&et<=90||94<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},zt)())}function P(){return h("domain-literal",K(F(O(it)),y("["),$(K(O(N),T)),O(N),y("]"),F(O(it)))())}function z(){return h("domain",(J=C(It,pt,P)(),i.rejectTLD&&J&&J.semantic&&J.semantic.indexOf(".")<0?null:(J&&(J.semantic=J.semantic.replace(/\s+/g,"")),J)));var J}function ut(){return h("addr-spec",K(_,y("@"),z)())}function st(){return i.strict?null:h("obs-NO-WS-CTL",w(function(J){var et=J.charCodeAt(0);return 1<=et&&et<=8||et===11||et===12||14<=et&&et<=31||et===127}))}function ht(){return i.strict?null:h("obs-ctext",st())}function I(){return i.strict?null:h("obs-qtext",st())}function x(){return i.strict?null:h("obs-qp",K(y("\\"),C(y("\0"),st,Z,W))())}function D(){return i.strict?null:i.atInDisplayName?h("obs-phrase",K(M,$(C(M,y("."),y("@"),Y(it))))()):h("obs-phrase",K(M,$(C(M,y("."),Y(it))))())}function B(){return i.strict?null:h("obs-FWS",$(K(F(O(H)),dt),1)())}function R(){return i.strict?null:h("obs-angle-addr",K(F(O(it)),y("<"),L,ut,y(">"),F(O(it)))())}function L(){return i.strict?null:h("obs-route",K(v,y(":"))())}function v(){return i.strict?null:h("obs-domain-list",K($(C(F(it),y(","))),y("@"),z,$(K(y(","),F(O(it)),O(K(y("@"),z)))))())}function k(){return i.strict?null:h("obs-mbox-list",K($(K(F(O(it)),y(","))),f,$(K(y(","),O(K(f,F(it))))))())}function nt(){return i.strict?null:h("obs-addr-list",K($(K(F(O(it)),y(","))),b,$(K(y(","),O(K(b,F(it))))))())}function at(){return i.strict?null:h("obs-group-list",K($(K(F(O(it)),y(",")),1),F(O(it)))())}function St(){return i.strict?null:h("obs-local-part",K(M,$(K(y("."),M)))())}function It(){return i.strict?null:h("obs-domain",K(bt,$(K(y("."),bt)))())}function zt(){return i.strict?null:h("obs-dtext",C(st,lt)())}function Dt(J,et){var ct,wt,kt;if(et==null)return null;for(wt=[et];wt.length>0;){if((kt=wt.pop()).name===J)return kt;for(ct=kt.children.length-1;ct>=0;ct-=1)wt.push(kt.children[ct])}return null}function Wt(J,et){var ct,wt,kt,Ut,_t;if(et==null)return null;for(wt=[et],Ut=[],_t={},ct=0;ct0;)if((kt=wt.pop()).name in _t)Ut.push(kt);else for(ct=kt.children.length-1;ct>=0;ct-=1)wt.push(kt.children[ct]);return Ut}function Yt(J){var et,ct,wt,kt,Ut;if(J===null)return null;for(et=[],ct=Wt(["group","mailbox"],J),wt=0;wt1?null:_t.addresses&&_t.addresses[0]}(Ut):i.simple?Ut&&Ut.addresses:Ut}function Jt(J){var et,ct=Dt("display-name",J),wt=[],kt=Wt(["mailbox"],J);for(et=0;et0;)for((Ie=Ce.pop()).name===Mt&&Ne.push(Ie),De=Ie.children.length-1;De>=0;De-=1)Ce.push(Ie.children[De]);return Ne}("cfws",J),kt=Wt(["comment"],J),Ut=Dt("local-part",ct),_t=Dt("domain",ct);return{node:J,parts:{name:et,address:ct,local:Ut,domain:_t,comments:wt},type:J.name,name:xt(et),address:xt(ct),local:xt(Ut),domain:xt(_t),comments:Nt(kt),groupName:xt(J.groupName)}}function xt(J){return J!=null?J.semantic:null}function Nt(J){var et="";if(J)for(var ct=0;ct`),t.userID=n.join(" "),t}read(e,t=vt){const n=A.decodeUTF8(e);if(n.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:i,address:a,comments:s}=$6.parseOneAddress({input:n,atInDisplayName:!0});this.comment=s.replace(/^\(|\)$/g,""),this.name=i,this.email=a}catch{}this.userID=n}write(){return A.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class Jo extends os{static get tag(){return p.packet.secretSubkey}constructor(e=new Date,t=vt){super(e,t)}}async function t5(r,e){const t=new Jo(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve),await t.computeFingerprintAndKeyID(),t}async function F6(r,e){const t=new os(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve,r.config),await t.computeFingerprintAndKeyID(),t}async function ze(r,e,t,n,i=new Date,a){let s,o;for(let u=r.length-1;u>=0;u--)try{(!s||r[u].created>=s.created)&&(await r[u].verify(e,t,n,i,void 0,a),s=r[u])}catch(c){o=c}if(!s)throw A.wrapError(`Could not find valid ${p.read(p.signature,t)} signature in key ${e.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,(u,c,h)=>c+" "+h.toLowerCase()),o);return s}function La(r,e,t=new Date){const n=A.normalizeDate(t);if(n!==null){const i=b1(r,e);return!(r.created<=n&&n0&&(a.keyExpirationTime=t.keyExpirationTime,a.keyNeverExpires=!1),await Mr(i,null,e,a,t.date,void 0,void 0,void 0,n)}async function H6(r,e,t=new Date,n={},i){let a=i.preferredHashAlgorithm,s=a;if(r){const o=await r.getPrimaryUser(t,n,i);o.selfCertification.preferredHashAlgorithms&&([s]=o.selfCertification.preferredHashAlgorithms,a=Bt.hash.getHashByteLength(a)<=Bt.hash.getHashByteLength(s)?s:a)}switch(e.algorithm){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:case p.publicKey.ed25519:s=Bt.getPreferredCurveHashAlgo(e.algorithm,e.publicParams.oid)}return Bt.hash.getHashByteLength(a)<=Bt.hash.getHashByteLength(s)?s:a}async function Mr(r,e,t,n,i,a,s=[],o=!1,u){if(t.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!t.isDecrypted())throw Error("Signing key is not decrypted.");const c=new mr;return Object.assign(c,n),c.publicKeyAlgorithm=t.algorithm,c.hashAlgorithm=await H6(e,t,i,a,u),c.rawNotations=s,await c.sign(t,r,i,o),c}async function rn(r,e,t,n=new Date,i){(r=r[t])&&(e[t].length?await Promise.all(r.map(async function(a){a.isExpired(n)||i&&!await i(a)||e[t].some(function(s){return A.equalsUint8Array(s.writeParams(),a.writeParams())})||e[t].push(a)})):e[t]=r)}async function Cn(r,e,t,n,i,a,s=new Date,o){a=a||r;const u=[];return await Promise.all(n.map(async function(c){try{i&&!c.issuerKeyID.equals(i.issuerKeyID)||(await c.verify(a,e,t,o.revocationsExpire?s:null,!1,o),u.push(c.issuerKeyID))}catch{}})),i?(i.revoked=!!u.some(c=>c.equals(i.issuerKeyID))||i.revoked||!1,i.revoked):u.length>0}function b1(r,e){let t;return e.keyNeverExpires===!1&&(t=r.created.getTime()+1e3*e.keyExpirationTime),t?new Date(t):1/0}function Oa(r,e={}){switch(r.type=r.type||e.type,r.curve=r.curve||e.curve,r.rsaBits=r.rsaBits||e.rsaBits,r.keyExpirationTime=r.keyExpirationTime!==void 0?r.keyExpirationTime:e.keyExpirationTime,r.passphrase=A.isString(r.passphrase)?r.passphrase:e.passphrase,r.date=r.date||e.date,r.sign=r.sign||!1,r.type){case"ecc":try{r.curve=p.write(p.curve,r.curve)}catch{throw Error("Unknown curve")}r.curve!==p.curve.ed25519Legacy&&r.curve!==p.curve.curve25519Legacy||(r.curve=r.sign?p.curve.ed25519Legacy:p.curve.curve25519Legacy),r.sign?r.algorithm=r.curve===p.curve.ed25519Legacy?p.publicKey.eddsaLegacy:p.publicKey.ecdsa:r.algorithm=p.publicKey.ecdh;break;case"rsa":r.algorithm=p.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+r.type)}return r}function h2(r,e){const t=r.algorithm;return t!==p.publicKey.rsaEncrypt&&t!==p.publicKey.elgamal&&t!==p.publicKey.ecdh&&t!==p.publicKey.x25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.signData)!=0)}function l2(r,e){const t=r.algorithm;return t!==p.publicKey.dsa&&t!==p.publicKey.rsaSign&&t!==p.publicKey.ecdsa&&t!==p.publicKey.eddsaLegacy&&t!==p.publicKey.ed25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(e.keyFlags[0]&p.keyFlags.encryptStorage)!=0)}function f2(r,e){return!!e.allowInsecureDecryptionWithSigningKeys||!r.keyFlags||(r.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(r.keyFlags[0]&p.keyFlags.encryptStorage)!=0}function vn(r,e){const t=p.write(p.publicKey,r.algorithm),n=r.getAlgorithmInfo();if(e.rejectPublicKeyAlgorithms.has(t))throw Error(n.algorithm+" keys are considered too weak.");switch(t){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:case p.publicKey.rsaEncrypt:if(n.bitsh.getKeys(u).length>0);return c.length===0?null:(await Promise.all(c.map(async h=>{const l=await h.getSigningKey(u,e.created,void 0,i);if(e.revoked||await a.isRevoked(e,l.keyPacket,n,i))throw Error("User certificate is revoked");try{await e.verify(l.keyPacket,p.signature.certGeneric,o,n,void 0,i)}catch(w){throw A.wrapError("User certificate is invalid",w)}})),!0)}async verifyAllCertifications(e,t=new Date,n){const i=this,a=this.selfCertifications.concat(this.otherCertifications);return Promise.all(a.map(async s=>({keyID:s.issuerKeyID,valid:await i.verifyCertificate(s,e,t,n).catch(()=>!1)})))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const n=this,i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};let s;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const u=this.selfCertifications[o];if(u.revoked||await n.isRevoked(u,void 0,e,t))throw Error("Self-certification is revoked");try{await u.verify(i,p.signature.certGeneric,a,e,void 0,t)}catch(c){throw A.wrapError("Self-certification is invalid",c)}return!0}catch(u){s=u}throw s}async update(e,t,n){const i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};await rn(e,this,"selfCertifications",t,async function(s){try{return await s.verify(i,p.signature.certGeneric,a,t,!1,n),!0}catch{return!1}}),await rn(e,this,"otherCertifications",t),await rn(e,this,"revocationSignatures",t,function(s){return Cn(i,p.signature.certRevocation,a,[s],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new fi(s.userID||s.userAttribute,this.mainKey);return o.revocationSignatures.push(await Mr(s,null,e,{signatureType:p.signature.certRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}}class In{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new xe;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new In(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,n=new Date,i=vt){const a=this.mainKey.keyPacket;return Cn(a,p.signature.subkeyRevocation,{key:a,bind:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verify(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket},a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t);if(a.revoked||await this.isRevoked(a,null,e,t))throw Error("Subkey is revoked");if(La(this.keyPacket,a,e))throw Error("Subkey is expired");return a}async getExpirationTime(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket};let a;try{a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t)}catch{return null}const s=b1(this.keyPacket,a),o=a.getExpirationTime();return sa.bindingSignatures[u].created&&(a.bindingSignatures[u]=o),!1;try{return await o.verify(i,p.signature.subkeyBinding,s,t,void 0,n),!0}catch{return!1}}),await rn(e,this,"revocationSignatures",t,function(o){return Cn(i,p.signature.subkeyRevocation,s,[o],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={key:e,bind:this.keyPacket},o=new In(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await Mr(s,null,e,{signatureType:p.signature.subkeyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach(r=>{In.prototype[r]=function(){return this.keyPacket[r]()}});const j6=A.constructAllowedPackets([mr]),d2=new Set([p.packet.publicKey,p.packet.privateKey]),y2=new Set([p.packet.publicKey,p.packet.privateKey,p.packet.publicSubkey,p.packet.privateSubkey]);class r5{packetListToStructure(e,t=new Set){let n,i,a,s;for(const o of e){if(o instanceof Ia){y2.has(o.tag)&&!s&&(s=d2.has(o.tag)?d2:y2);continue}const u=o.constructor.tag;if(s){if(!s.has(u))continue;s=null}if(t.has(u))throw Error("Unexpected packet type: "+u);switch(u){case p.packet.publicKey:case p.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,i=this.getKeyID(),!i)throw Error("Missing Key ID");break;case p.packet.userID:case p.packet.userAttribute:n=new fi(o,this),this.users.push(n);break;case p.packet.publicSubkey:case p.packet.secretSubkey:n=null,a=new In(o,this),this.subkeys.push(a);break;case p.packet.signature:switch(o.signatureType){case p.signature.certGeneric:case p.signature.certPersona:case p.signature.certCasual:case p.signature.certPositive:if(!n){A.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(i)?n.selfCertifications.push(o):n.otherCertifications.push(o);break;case p.signature.certRevocation:n?n.revocationSignatures.push(o):this.directSignatures.push(o);break;case p.signature.key:this.directSignatures.push(o);break;case p.signature.subkeyBinding:if(!a){A.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}a.bindingSignatures.push(o);break;case p.signature.keyRevocation:this.revocationSignatures.push(o);break;case p.signature.subkeyRevocation:if(!a){A.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}a.revocationSignatures.push(o)}}}}toPacketList(){const e=new xe;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map(t=>e.push(...t.toPacketList())),this.subkeys.map(t=>e.push(...t.toPacketList())),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach(n=>{if(n.keyPacket=Object.create(Object.getPrototypeOf(n.keyPacket),Object.getOwnPropertyDescriptors(n.keyPacket)),!n.keyPacket.isDecrypted())return;const i={};Object.keys(n.keyPacket.privateParams).forEach(a=>{i[a]=new Uint8Array(n.keyPacket.privateParams[a])}),n.keyPacket.privateParams=i}),t}getSubkeys(e=null){return this.subkeys.filter(t=>!e||t.getKeyID().equals(e,!0))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map(e=>e.getKeyID())}getUserIDs(){return this.users.map(e=>e.userID?e.userID.userID:null).filter(e=>e!==null)}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(!h2(u.keyPacket,h))continue;if(!h.embeddedSignature)throw Error("Missing embedded signature");return await ze([h.embeddedSignature],u.keyPacket,p.signature.keyBinding,c,t,i),vn(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&h2(a,u.selfCertification))return vn(a,i),this}catch(u){o=u}throw A.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(l2(u.keyPacket,h))return vn(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&l2(a,u.selfCertification))return vn(a,i),this}catch(u){o=u}throw A.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,n=new Date,i=vt){return Cn(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verifyPrimaryKey(e=new Date,t={},n=vt){const i=this.keyPacket;if(await this.isRevoked(null,null,e,n))throw Error("Primary key is revoked");const{selfCertification:a}=await this.getPrimaryUser(e,t,n);if(La(i,a,e))throw Error("Primary key is expired");const s=await ze(this.directSignatures,i,p.signature.key,{key:i},e,n).catch(()=>{});if(s&&La(i,s,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=vt){let n;try{const{selfCertification:i}=await this.getPrimaryUser(null,e,t),a=b1(this.keyPacket,i),s=i.getExpirationTime(),o=await ze(this.directSignatures,this.keyPacket,p.signature.key,{key:this.keyPacket},null,t).catch(()=>{});if(o){const u=b1(this.keyPacket,o);n=Math.min(a,s,u)}else n=ae.subkeys.some(s=>a.hasSameFingerprintAs(s)))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,n)}const i=this.clone();return await rn(e,i,"revocationSignatures",t,a=>Cn(i.keyPacket,p.signature.keyRevocation,i,[a],null,e.keyPacket,t,n)),await rn(e,i,"directSignatures",t),await Promise.all(e.users.map(async a=>{const s=i.users.filter(o=>a.userID&&a.userID.equals(o.userID)||a.userAttribute&&a.userAttribute.equals(o.userAttribute));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.users.push(o)}})),await Promise.all(e.subkeys.map(async a=>{const s=i.subkeys.filter(o=>o.hasSameFingerprintAs(a));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.subkeys.push(o)}})),i}async getRevocationCertificate(e=new Date,t=vt){const n={key:this.keyPacket},i=await ze(this.revocationSignatures,this.keyPacket,p.signature.keyRevocation,n,e,t),a=new xe;return a.push(i),Ga(p.armor.publicKey,a.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,n=vt){const i=await Y2(e,n),a=(await xe.fromBinary(i.data,j6,n)).findPacket(p.packet.signature);if(!a||a.signatureType!==p.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!a.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await a.verify(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},t,void 0,n)}catch(o){throw A.wrapError("Could not verify revocation signature",o)}const s=this.clone();return s.revocationSignatures.push(a),s}async signPrimaryUser(e,t,n,i=vt){const{index:a,user:s}=await this.getPrimaryUser(t,n,i),o=await s.certify(e,t,i),u=this.clone();return u.users[a]=o,u}async signAllUsers(e,t=new Date,n=vt){const i=this.clone();return i.users=await Promise.all(this.users.map(function(a){return a.certify(e,t,n)})),i}async verifyPrimaryUser(e,t=new Date,n,i=vt){const a=this.keyPacket,{user:s}=await this.getPrimaryUser(t,n,i);return e?await s.verifyAllCertifications(e,t,i):[{keyID:a.getKeyID(),valid:await s.verify(t,i).catch(()=>!1)}]}async verifyAllUsers(e,t=new Date,n=vt){const i=this.keyPacket,a=[];return await Promise.all(this.users.map(async s=>{const o=e?await s.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await s.verify(t,n).catch(()=>!1)}];a.push(...o.map(u=>({userID:s.userID?s.userID.userID:null,userAttribute:s.userAttribute,keyID:u.keyID,valid:u.valid})))})),a}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach(r=>{r5.prototype[r]=In.prototype[r]});class p2 extends r5{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([p.packet.secretKey,p.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=vt){return Ga(p.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class z1 extends p2{constructor(e){if(super(),this.packetListToStructure(e,new Set([p.packet.publicKey,p.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new xe,t=this.toPacketList();for(const n of t)switch(n.constructor.tag){case p.packet.secretKey:{const i=Ye.fromSecretKeyPacket(n);e.push(i);break}case p.packet.secretSubkey:{const i=B1.fromSecretSubkeyPacket(n);e.push(i);break}default:e.push(n)}return new p2(e)}armor(e=vt){return Ga(p.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,n={},i=vt){const a=this.keyPacket,s=[];for(let u=0;ue.isDecrypted())}async validate(e=vt){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const n=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});n&&!n.keyPacket.isDummy()&&(t=n.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const n=this.getKeys();if(n.map(i=>i.keyPacket.isDummy()).every(Boolean))throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(n.map(async i=>i.keyPacket.validate()))}}clearPrivateParams(){this.getKeys().forEach(({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()})}async revoke({flag:e=p.reasonForRevocation.noReason,string:t=""}={},n=new Date,i=vt){if(!this.isPrivate())throw Error("Need private key for revoking");const a={key:this.keyPacket},s=this.clone();return s.revocationSignatures.push(await Mr(a,null,this.keyPacket,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,e),reasonForRevocationString:t},n,void 0,void 0,void 0,i)),s}async addSubkey(e={}){const t={...vt,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBitsK!==y)]}const c=R1.fromObject(s),h={};h.userID=c,h.key=r;const l={};return l.signatureType=p.signature.certGeneric,l.keyFlags=[p.keyFlags.certifyKeys|p.keyFlags.signData],l.preferredSymmetricAlgorithms=u([p.symmetric.aes256,p.symmetric.aes128,p.symmetric.aes192],n.preferredSymmetricAlgorithm),n.aeadProtect&&(l.preferredAEADAlgorithms=u([p.aead.eax,p.aead.ocb],n.preferredAEADAlgorithm)),l.preferredHashAlgorithms=u([p.hash.sha256,p.hash.sha512],n.preferredHashAlgorithm),l.preferredCompressionAlgorithms=u([p.compression.zlib,p.compression.zip,p.compression.uncompressed],n.preferredCompressionAlgorithm),o===0&&(l.isPrimaryUserID=!0),l.features=[0],l.features[0]|=p.features.modificationDetection,n.aeadProtect&&(l.features[0]|=p.features.aead),n.v5Keys&&(l.features[0]|=p.features.v5Keys),t.keyExpirationTime>0&&(l.keyExpirationTime=t.keyExpirationTime,l.keyNeverExpires=!1),{userIDPacket:c,signaturePacket:await Mr(h,null,r,l,t.date,void 0,void 0,void 0,n)}})).then(s=>{s.forEach(({userIDPacket:o,signaturePacket:u})=>{i.push(o),i.push(u)})}),await Promise.all(e.map(async function(s,o){const u=t.subkeys[o];return{secretSubkeyPacket:s,subkeySignaturePacket:await e5(s,r,u,n)}})).then(s=>{s.forEach(({secretSubkeyPacket:o,subkeySignaturePacket:u})=>{i.push(o),i.push(u)})});const a={key:r};return i.push(await Mr(a,null,r,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.reasonForRevocation.noReason,reasonForRevocationString:""},t.date,void 0,void 0,void 0,n)),t.passphrase&&r.clearPrivateParams(),await Promise.all(e.map(async function(s,o){t.subkeys[o].passphrase&&s.clearPrivateParams()})),new z1(i)}async function G6({armoredKey:r,binaryKey:e,config:t,...n}){if(t={...vt,...t},!r&&!e)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(r&&!A.isString(r))throw Error("readPrivateKey: options.armoredKey must be a string");if(e&&!A.isUint8Array(e))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(r){const{type:o,data:u}=await Y2(r,t);if(o!==p.armor.privateKey)throw Error("Armored text not of type private key");a=u}else a=e;const s=await xe.fromBinary(a,q6,t);return new z1(s)}async function W6({userIDs:r=[],passphrase:e,type:t="ecc",rsaBits:n=4096,curve:i="curve25519",keyExpirationTime:a=0,date:s=new Date,subkeys:o=[{}],format:u="armored",config:c,...h}){i5(c={...vt,...c}),r=a5(r);const l=Object.keys(h);if(l.length>0)throw Error("Unknown option: "+l.join(", "));if(r.length===0)throw Error("UserIDs are required for key generation");if(t==="rsa"&&nOa(C.subkeys[H],C));let F=[F6(C,O)];F=F.concat(C.subkeys.map(W=>t5(W,O)));const Y=await Promise.all(F),$=await n5(Y[0],Y.slice(1),C,O),E=await $.getRevocationCertificate(C.date,O);return $.revocationSignatures=[],{key:$,revocationCertificate:E}}(w,c);return y.getKeys().forEach(({keyPacket:C})=>vn(C,c)),{privateKey:k1(y,u,c),publicKey:k1(y.toPublic(),u,c),revocationCertificate:K}}catch(y){throw A.wrapError("Error generating keypair",y)}}async function V6({privateKey:r,userIDs:e=[],passphrase:t,keyExpirationTime:n=0,date:i,format:a="armored",config:s,...o}){i5(s={...vt,...s}),e=a5(e);const u=Object.keys(o);if(u.length>0)throw Error("Unknown option: "+u.join(", "));if(e.length===0)throw Error("UserIDs are required for key reformat");const c={privateKey:r,userIDs:e,passphrase:t,keyExpirationTime:n,date:i};try{const{key:h,revocationCertificate:l}=await async function(w,y){w=$(w);const{privateKey:K}=w;if(!K.isPrivate())throw Error("Cannot reformat a public key");if(K.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!K.getKeys().every(({keyPacket:E})=>E.isDecrypted()))throw Error("Key is not decrypted");const C=K.keyPacket;w.subkeys||(w.subkeys=await Promise.all(K.subkeys.map(async E=>{const W=E.keyPacket,H={key:C,bind:W},j=await ze(E.bindingSignatures,C,p.signature.subkeyBinding,H,null,y).catch(()=>({}));return{sign:j.keyFlags&&j.keyFlags[0]&p.keyFlags.signData}})));const O=K.subkeys.map(E=>E.keyPacket);if(w.subkeys.length!==O.length)throw Error("Number of subkey options does not match number of subkeys");w.subkeys=w.subkeys.map(E=>$(E,w));const F=await n5(C,O,w,y),Y=await F.getRevocationCertificate(w.date,y);return F.revocationSignatures=[],{key:F,revocationCertificate:Y};function $(E,W={}){return E.keyExpirationTime=E.keyExpirationTime||W.keyExpirationTime,E.passphrase=A.isString(E.passphrase)?E.passphrase:W.passphrase,E.date=E.date||W.date,E}}(c,s);return{privateKey:k1(h,a,s),publicKey:k1(h.toPublic(),a,s),revocationCertificate:l}}catch(h){throw A.wrapError("Error reformatting keypair",h)}}const Z6=Object.keys(vt).length;function i5(r){const e=Object.keys(r);if(e.length!==Z6){for(const t of e)if(vt[t]===void 0)throw Error("Unknown config property: "+t)}}function a5(r){return r&&!A.isArray(r)&&(r=[r]),r}function k1(r,e,t){switch(e){case"object":return r;case"armored":return r.armor(t);case"binary":return r.write();default:throw Error("Unsupported format "+e)}}const X6=`#version 300 es +`)}return _.concat(c)}class xn{constructor(){this.bytes=""}read(e){return this.bytes=_.uint8ArrayToString(e.subarray(0,8)),this.bytes.length}write(){return _.stringToUint8Array(this.bytes)}toHex(){return _.uint8ArrayToHex(_.stringToUint8Array(this.bytes))}equals(e,t=!1){return t&&(e.isWildcard()||this.isWildcard())||this.bytes===e.bytes}isNull(){return this.bytes===""}isWildcard(){return/^0+$/.test(this.toHex())}static mapToHex(e){return e.toHex()}static fromID(e){const t=new xn;return t.read(_.hexToUint8Array(e)),t}static wildcard(){const e=new xn;return e.read(new Uint8Array(8)),e}}var Kt=function(){var r,e,t=!1;function n(l,w){var y=r[(e[l]+e[w])%255];return l!==0&&w!==0||(y=0),y}var i,a,s,o,u=!1;function c(){function l(C){var O,F,Y;for(F=Y=function($){var E=r[255-e[$]];return $===0&&(E=0),E}(C),O=0;O<4;O++)Y^=F=255&(F<<1|F>>>7);return Y^=99}t||function(){r=[],e=[];var C,O,F=1;for(C=0;C<255;C++)r[C]=F,O=128&F,F<<=1,F&=255,O===128&&(F^=27),F^=r[C],e[r[C]]=C;r[255]=r[0],e[0]=0,t=!0}(),i=[],a=[],s=[[],[],[],[]],o=[[],[],[],[]];for(var w=0;w<256;w++){var y=l(w);i[w]=y,a[y]=w,s[0][w]=n(2,y)<<24|y<<16|y<<8|n(3,y),o[0][y]=n(14,w)<<24|n(9,w)<<16|n(13,w)<<8|n(11,w);for(var K=1;K<4;K++)s[K][w]=s[K-1][w]>>>8|s[K-1][w]<<24,o[K][y]=o[K-1][y]>>>8|o[K-1][y]<<24}u=!0}var h=function(l,w){u||c();var y=new Uint32Array(w);y.set(i,512),y.set(a,768);for(var K=0;K<4;K++)y.set(s[K],4096+1024*K>>2),y.set(o[K],8192+1024*K>>2);var C=function(O,F,Y){var $=0,E=0,W=0,H=0,j=0,V=0,Z=0,tt=0,rt=0,dt=0,lt=0,N=0,ft=0,Pt=0,q=0,it=0,mt=0,bt=0,yt=0,pt=0,gt=0,ot=new O.Uint32Array(Y),S=new O.Uint8Array(Y);function M(v,k,nt,at,St,It,zt,Dt){v=v|0,k=k|0,nt=nt|0,at=at|0,St=St|0,It=It|0,zt=zt|0,Dt=Dt|0;var Wt=0,Yt=0,Jt=0,ne=0,xt=0,Nt=0,Lt=0,Et=0;for(Wt=nt|1024,Yt=nt|2048,Jt=nt|3072,St=St^ot[(v|0)>>2],It=It^ot[(v|4)>>2],zt=zt^ot[(v|8)>>2],Dt=Dt^ot[(v|12)>>2],Et=16;(Et|0)<=at<<4;Et=Et+16|0)ne=ot[(nt|St>>22&1020)>>2]^ot[(Wt|It>>14&1020)>>2]^ot[(Yt|zt>>6&1020)>>2]^ot[(Jt|Dt<<2&1020)>>2]^ot[(v|Et|0)>>2],xt=ot[(nt|It>>22&1020)>>2]^ot[(Wt|zt>>14&1020)>>2]^ot[(Yt|Dt>>6&1020)>>2]^ot[(Jt|St<<2&1020)>>2]^ot[(v|Et|4)>>2],Nt=ot[(nt|zt>>22&1020)>>2]^ot[(Wt|Dt>>14&1020)>>2]^ot[(Yt|St>>6&1020)>>2]^ot[(Jt|It<<2&1020)>>2]^ot[(v|Et|8)>>2],Lt=ot[(nt|Dt>>22&1020)>>2]^ot[(Wt|St>>14&1020)>>2]^ot[(Yt|It>>6&1020)>>2]^ot[(Jt|zt<<2&1020)>>2]^ot[(v|Et|12)>>2],St=ne,It=xt,zt=Nt,Dt=Lt;$=ot[(k|St>>22&1020)>>2]<<24^ot[(k|It>>14&1020)>>2]<<16^ot[(k|zt>>6&1020)>>2]<<8^ot[(k|Dt<<2&1020)>>2]^ot[(v|Et|0)>>2],E=ot[(k|It>>22&1020)>>2]<<24^ot[(k|zt>>14&1020)>>2]<<16^ot[(k|Dt>>6&1020)>>2]<<8^ot[(k|St<<2&1020)>>2]^ot[(v|Et|4)>>2],W=ot[(k|zt>>22&1020)>>2]<<24^ot[(k|Dt>>14&1020)>>2]<<16^ot[(k|St>>6&1020)>>2]<<8^ot[(k|It<<2&1020)>>2]^ot[(v|Et|8)>>2],H=ot[(k|Dt>>22&1020)>>2]<<24^ot[(k|St>>14&1020)>>2]<<16^ot[(k|It>>6&1020)>>2]<<8^ot[(k|zt<<2&1020)>>2]^ot[(v|Et|12)>>2]}function b(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,v,k,nt,at)}function f(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0;var St=0;M(1024,3072,8192,gt,v,at,nt,k),St=E,E=H,H=St}function U(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j^v,V^k,Z^nt,tt^at),j=$,V=E,Z=W,tt=H}function G(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0;var St=0;M(1024,3072,8192,gt,v,at,nt,k),St=E,E=H,H=St,$=$^j,E=E^V,W=W^Z,H=H^tt,j=v,V=k,Z=nt,tt=at}function X(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j,V,Z,tt),j=$=$^v,V=E=E^k,Z=W=W^nt,tt=H=H^at}function Q(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j,V,Z,tt),$=$^v,E=E^k,W=W^nt,H=H^at,j=v,V=k,Z=nt,tt=at}function g(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,j,V,Z,tt),j=$,V=E,Z=W,tt=H,$=$^v,E=E^k,W=W^nt,H=H^at}function d(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,M(0,2048,4096,gt,rt,dt,lt,N),N=~it&N|it&N+1,lt=~q<|q<+((N|0)==0),dt=~Pt&dt|Pt&dt+((lt|0)==0),rt=~ft&rt|ft&rt+((dt|0)==0),$=$^v,E=E^k,W=W^nt,H=H^at}function m(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0;var St=0,It=0,zt=0,Dt=0,Wt=0,Yt=0,Jt=0,ne=0,xt=0,Nt=0;for(v=v^j,k=k^V,nt=nt^Z,at=at^tt,St=mt|0,It=bt|0,zt=yt|0,Dt=pt|0;(xt|0)<128;xt=xt+1|0)St>>>31&&(Wt=Wt^v,Yt=Yt^k,Jt=Jt^nt,ne=ne^at),St=St<<1|It>>>31,It=It<<1|zt>>>31,zt=zt<<1|Dt>>>31,Dt=Dt<<1,Nt=at&1,at=at>>>1|nt<<31,nt=nt>>>1|k<<31,k=k>>>1|v<<31,v=v>>>1,Nt&&(v=v^3774873600);j=Wt,V=Yt,Z=Jt,tt=ne}function A(v){v=v|0,gt=v}function T(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,$=v,E=k,W=nt,H=at}function P(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,j=v,V=k,Z=nt,tt=at}function z(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,rt=v,dt=k,lt=nt,N=at}function ut(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,ft=v,Pt=k,q=nt,it=at}function st(v,k,nt,at){v=v|0,k=k|0,nt=nt|0,at=at|0,N=~it&N|it&at,lt=~q<|q&nt,dt=~Pt&dt|Pt&k,rt=~ft&rt|ft&v}function ht(v){return v=v|0,v&15?-1:(S[v|0]=$>>>24,S[v|1]=$>>>16&255,S[v|2]=$>>>8&255,S[v|3]=$&255,S[v|4]=E>>>24,S[v|5]=E>>>16&255,S[v|6]=E>>>8&255,S[v|7]=E&255,S[v|8]=W>>>24,S[v|9]=W>>>16&255,S[v|10]=W>>>8&255,S[v|11]=W&255,S[v|12]=H>>>24,S[v|13]=H>>>16&255,S[v|14]=H>>>8&255,S[v|15]=H&255,16)}function I(v){return v=v|0,v&15?-1:(S[v|0]=j>>>24,S[v|1]=j>>>16&255,S[v|2]=j>>>8&255,S[v|3]=j&255,S[v|4]=V>>>24,S[v|5]=V>>>16&255,S[v|6]=V>>>8&255,S[v|7]=V&255,S[v|8]=Z>>>24,S[v|9]=Z>>>16&255,S[v|10]=Z>>>8&255,S[v|11]=Z&255,S[v|12]=tt>>>24,S[v|13]=tt>>>16&255,S[v|14]=tt>>>8&255,S[v|15]=tt&255,16)}function x(){b(0,0,0,0),mt=$,bt=E,yt=W,pt=H}function D(v,k,nt){v=v|0,k=k|0,nt=nt|0;var at=0;if(k&15)return-1;for(;(nt|0)>=16;)R[v&7](S[k|0]<<24|S[k|1]<<16|S[k|2]<<8|S[k|3],S[k|4]<<24|S[k|5]<<16|S[k|6]<<8|S[k|7],S[k|8]<<24|S[k|9]<<16|S[k|10]<<8|S[k|11],S[k|12]<<24|S[k|13]<<16|S[k|14]<<8|S[k|15]),S[k|0]=$>>>24,S[k|1]=$>>>16&255,S[k|2]=$>>>8&255,S[k|3]=$&255,S[k|4]=E>>>24,S[k|5]=E>>>16&255,S[k|6]=E>>>8&255,S[k|7]=E&255,S[k|8]=W>>>24,S[k|9]=W>>>16&255,S[k|10]=W>>>8&255,S[k|11]=W&255,S[k|12]=H>>>24,S[k|13]=H>>>16&255,S[k|14]=H>>>8&255,S[k|15]=H&255,at=at+16|0,k=k+16|0,nt=nt-16|0;return at|0}function B(v,k,nt){v=v|0,k=k|0,nt=nt|0;var at=0;if(k&15)return-1;for(;(nt|0)>=16;)L[v&1](S[k|0]<<24|S[k|1]<<16|S[k|2]<<8|S[k|3],S[k|4]<<24|S[k|5]<<16|S[k|6]<<8|S[k|7],S[k|8]<<24|S[k|9]<<16|S[k|10]<<8|S[k|11],S[k|12]<<24|S[k|13]<<16|S[k|14]<<8|S[k|15]),at=at+16|0,k=k+16|0,nt=nt-16|0;return at|0}var R=[b,f,U,G,X,Q,g,d],L=[U,m];return{set_rounds:A,set_state:T,set_iv:P,set_nonce:z,set_mask:ut,set_counter:st,get_state:ht,get_iv:I,gcm_init:x,cipher:D,mac:B}}({Uint8Array,Uint32Array},l,w);return C.set_key=function(O,F,Y,$,E,W,H,j,V){var Z=y.subarray(0,60),tt=y.subarray(256,316);Z.set([F,Y,$,E,W,H,j,V]);for(var rt=O,dt=1;rt<4*O+28;rt++){var lt=Z[rt-1];(rt%O==0||O===8&&rt%O==4)&&(lt=i[lt>>>24]<<24^i[lt>>>16&255]<<16^i[lt>>>8&255]<<8^i[255<]),rt%O==0&&(lt=lt<<8^lt>>>24^dt<<24,dt=dt<<1^(128&dt?27:0)),Z[rt]=Z[rt-O]^lt}for(var N=0;N=rt-4?lt:o[0][i[lt>>>24]]^o[1][i[lt>>>16&255]]^o[2][i[lt>>>8&255]]^o[3][i[255<]];C.set_rounds(O+5)},C};return h.ENC={ECB:0,CBC:2,CFB:4,OFB:6,CTR:7},h.DEC={ECB:1,CBC:3,CFB:5,OFB:6,CTR:7},h.MAC={CBC:0,GCM:1},h.HEAP_DATA=16384,h}();function Ts(r){return r instanceof Uint8Array}function Wa(r,e){const t=r?r.byteLength:65536;if(4095&t||t<=0)throw Error("heap size must be a positive integer and a multiple of 4096");return r=r||new Uint8Array(new ArrayBuffer(t))}function Vr(r,e,t,n,i){const a=r.length-e,s=ai+a.length,0),t=new Uint8Array(e);let n=0;for(let i=0;i>2,a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12),i>16?a.getUint32(16):0,i>16?a.getUint32(20):0,i>24?a.getUint32(24):0,i>24?a.getUint32(28):0),t!==void 0){if(t.length!==16)throw new pr("illegal iv size");let s=new DataView(t.buffer,t.byteOffset,t.byteLength);n.set_iv(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}else n.set_iv(0,0,0,0)}AES_Encrypt_process(e){if(!Ts(e))throw new TypeError("data isn't of expected type");let{heap:t,asm:n}=this.acquire_asm(),i=Kt.ENC[this.mode],a=Kt.HEAP_DATA,s=this.pos,o=this.len,u=0,c=e.length||0,h=0,l=0,w=new Uint8Array(o+c&-16);for(;c>0;)l=Vr(t,s+o,e,u,c),o+=l,u+=l,c-=l,l=n.cipher(i,a+s,o),l&&w.set(t.subarray(s,s+l),h),h+=l,l0;)y=Vr(t,s+o,e,u,c),o+=y,u+=y,c-=y,y=n.cipher(i,a+s,o-(c?0:w)),y&&K.set(t.subarray(s,s+y),h),h+=y,y0){if(s%16){if(this.hasOwnProperty("padding"))throw new pr("data length must be a multiple of the block size");s+=16-s%16}if(t.cipher(n,i+a,s),this.hasOwnProperty("padding")&&this.padding){let c=e[a+o-1];if(c<1||c>16||c>o)throw new Ka("bad padding");let h=0;for(let l=c;l>1;l--)h|=c^e[a+o-l];if(h)throw new Ka("bad padding");o-=c}}const u=new Uint8Array(o);return o>0&&u.set(e.subarray(a,a+o)),this.pos=0,this.len=0,this.release_asm(),u}}class i1{static encrypt(e,t,n=!1){return new i1(t,n).encrypt(e)}static decrypt(e,t,n=!1){return new i1(t,n).decrypt(e)}constructor(e,t=!1,n){this.aes=n||new Ei(e,void 0,t,"ECB")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Va(r){const e=function(t){const n=new i1(t);this.encrypt=function(i){return n.encrypt(i)},this.decrypt=function(i){return n.decrypt(i)}};return e.blockSize=e.prototype.blockSize=16,e.keySize=e.prototype.keySize=r/8,e}function ai(r,e,t,n,i,a){const s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],u=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],h=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],w=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],y=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let K,C,O,F,Y,$,E,W,H,j,V=0,Z=e.length;const tt=r.length===32?3:9;W=tt===3?t?[0,32,2]:[30,-2,-2]:t?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],t&&(e=function(lt,N){const ft=8-lt.length%8;let Pt;if(N===2&&ft<8)Pt=32;else if(N===1)Pt=ft;else{if(N||!(ft<8)){if(ft===8)return lt;throw Error("des: invalid padding")}Pt=0}const q=new Uint8Array(lt.length+ft);for(let it=0;it>>4^E),E^=O,$^=O<<4,O=65535&($>>>16^E),E^=O,$^=O<<16,O=858993459&(E>>>2^$),$^=O,E^=O<<2,O=16711935&(E>>>8^$),$^=O,E^=O<<8,O=1431655765&($>>>1^E),E^=O,$^=O<<1,$=$<<1|$>>>31,E=E<<1|E>>>31,C=0;C>>4|E<<28)^r[K+1],O=$,$=E,E=O^(o[F>>>24&63]|c[F>>>16&63]|l[F>>>8&63]|y[63&F]|s[Y>>>24&63]|u[Y>>>16&63]|h[Y>>>8&63]|w[63&Y]);O=$,$=E,E=O}$=$>>>1|$<<31,E=E>>>1|E<<31,O=1431655765&($>>>1^E),E^=O,$^=O<<1,O=16711935&(E>>>8^$),$^=O,E^=O<<8,O=858993459&(E>>>2^$),$^=O,E^=O<<2,O=65535&($>>>16^E),E^=O,$^=O<<16,O=252645135&($>>>4^E),E^=O,$^=O<<4,rt[dt++]=$>>>24,rt[dt++]=$>>>16&255,rt[dt++]=$>>>8&255,rt[dt++]=255&$,rt[dt++]=E>>>24,rt[dt++]=E>>>16&255,rt[dt++]=E>>>8&255,rt[dt++]=255&E}return t||(rt=function(lt,N){let ft,Pt=null;if(N===2)ft=32;else if(N===1)Pt=lt[lt.length-1];else{if(N)throw Error("des: invalid padding");ft=0}if(!Pt){for(Pt=1;lt[lt.length-Pt]===ft;)Pt++;Pt--}return lt.subarray(0,lt.length-Pt)}(rt,a)),rt}function si(r){const e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],t=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],w=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],K=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],C=r.length>8?3:1,O=Array(32*C),F=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Y,$,E,W=0,H=0;for(let j=0;j>>4^Z),Z^=E,V^=E<<4,E=65535&(Z>>>-16^V),V^=E,Z^=E<<-16,E=858993459&(V>>>2^Z),Z^=E,V^=E<<2,E=65535&(Z>>>-16^V),V^=E,Z^=E<<-16,E=1431655765&(V>>>1^Z),Z^=E,V^=E<<1,E=16711935&(Z>>>8^V),V^=E,Z^=E<<8,E=1431655765&(V>>>1^Z),Z^=E,V^=E<<1,E=V<<8|Z>>>20&240,V=Z<<24|Z<<8&16711680|Z>>>8&65280|Z>>>24&240,Z=E;for(let tt=0;tt<16;tt++)F[tt]?(V=V<<2|V>>>26,Z=Z<<2|Z>>>26):(V=V<<1|V>>>27,Z=Z<<1|Z>>>27),V&=-15,Z&=-15,Y=e[V>>>28]|t[V>>>24&15]|n[V>>>20&15]|i[V>>>16&15]|a[V>>>12&15]|s[V>>>8&15]|o[V>>>4&15],$=u[Z>>>28]|c[Z>>>24&15]|h[Z>>>20&15]|l[Z>>>16&15]|w[Z>>>12&15]|y[Z>>>8&15]|K[Z>>>4&15],E=65535&($>>>16^Y),O[H++]=Y^E,O[H++]=$^E<<16}return O}function Vn(r){this.key=[];for(let e=0;e<3;e++)this.key.push(new Uint8Array(r.subarray(8*e,8*e+8)));this.encrypt=function(e){return ai(si(this.key[2]),ai(si(this.key[1]),ai(si(this.key[0]),e,!0,0,null,null),!1,0,null,null),!0,0,null,null)}}function Uc(){this.BlockSize=8,this.KeySize=16,this.setKey=function(s){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),s.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(s),!0},this.reset=function(){for(let s=0;s<16;s++)this.masking[s]=0,this.rotate[s]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>>16&255,o[u+6]=h>>>8&255,o[u+7]=255&h}return o},this.decrypt=function(s){const o=Array(s.length);for(let u=0;u>>24&255,o[u+1]=l>>>16&255,o[u+2]=l>>>8&255,o[u+3]=255&l,o[u+4]=h>>>24&255,o[u+5]=h>>16&255,o[u+6]=h>>8&255,o[u+7]=255&h}return o};const r=[,,,,];r[0]=[,,,,],r[0][0]=[4,0,13,15,12,14,8],r[0][1]=[5,2,16,18,17,19,10],r[0][2]=[6,3,23,22,21,20,9],r[0][3]=[7,1,26,25,27,24,11],r[1]=[,,,,],r[1][0]=[0,6,21,23,20,22,16],r[1][1]=[1,4,0,2,1,3,18],r[1][2]=[2,5,7,6,5,4,17],r[1][3]=[3,7,10,9,11,8,19],r[2]=[,,,,],r[2][0]=[4,0,13,15,12,14,8],r[2][1]=[5,2,16,18,17,19,10],r[2][2]=[6,3,23,22,21,20,9],r[2][3]=[7,1,26,25,27,24,11],r[3]=[,,,,],r[3][0]=[0,6,21,23,20,22,16],r[3][1]=[1,4,0,2,1,3,18],r[3][2]=[2,5,7,6,5,4,17],r[3][3]=[3,7,10,9,11,8,19];const e=[,,,,];function t(s,o,u){const c=o+s,h=c<>>32-u;return(a[0][h>>>24]^a[1][h>>>16&255])-a[2][h>>>8&255]+a[3][255&h]}function n(s,o,u){const c=o^s,h=c<>>32-u;return a[0][h>>>24]-a[1][h>>>16&255]+a[2][h>>>8&255]^a[3][255&h]}function i(s,o,u){const c=o-s,h=c<>>32-u;return(a[0][h>>>24]+a[1][h>>>16&255]^a[2][h>>>8&255])-a[3][255&h]}e[0]=[,,,,],e[0][0]=[24,25,23,22,18],e[0][1]=[26,27,21,20,22],e[0][2]=[28,29,19,18,25],e[0][3]=[30,31,17,16,28],e[1]=[,,,,],e[1][0]=[3,2,12,13,8],e[1][1]=[1,0,14,15,13],e[1][2]=[7,6,8,9,3],e[1][3]=[5,4,10,11,7],e[2]=[,,,,],e[2][0]=[19,18,28,29,25],e[2][1]=[17,16,30,31,28],e[2][2]=[23,22,24,25,18],e[2][3]=[21,20,26,27,22],e[3]=[,,,,],e[3][0]=[8,9,7,6,3],e[3][1]=[10,11,5,4,7],e[3][2]=[12,13,3,2,8],e[3][3]=[14,15,1,0,13],this.keySchedule=function(s){const o=[,,,,,,,,],u=Array(32);let c;for(let y=0;y<4;y++)c=4*y,o[y]=s[c]<<24|s[c+1]<<16|s[c+2]<<8|s[c+3];const h=[6,7,4,5];let l,w=0;for(let y=0;y<2;y++)for(let K=0;K<4;K++){for(c=0;c<4;c++){const C=r[K][c];l=o[C[1]],l^=a[4][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[5][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[6][o[C[4]>>>2]>>>24-8*(3&C[4])&255],l^=a[7][o[C[5]>>>2]>>>24-8*(3&C[5])&255],l^=a[h[c]][o[C[6]>>>2]>>>24-8*(3&C[6])&255],o[C[0]]=l}for(c=0;c<4;c++){const C=e[K][c];l=a[4][o[C[0]>>>2]>>>24-8*(3&C[0])&255],l^=a[5][o[C[1]>>>2]>>>24-8*(3&C[1])&255],l^=a[6][o[C[2]>>>2]>>>24-8*(3&C[2])&255],l^=a[7][o[C[3]>>>2]>>>24-8*(3&C[3])&255],l^=a[4+c][o[C[4]>>>2]>>>24-8*(3&C[4])&255],u[w]=l,w++}}for(let y=0;y<16;y++)this.masking[y]=u[y],this.rotate[y]=31&u[16+y]};const a=[,,,,,,,,];a[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],a[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],a[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],a[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],a[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],a[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],a[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],a[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function Zn(r){this.cast5=new Uc,this.cast5.setKey(r),this.encrypt=function(e){return this.cast5.encrypt(e)}}Vn.keySize=Vn.prototype.keySize=24,Vn.blockSize=Vn.prototype.blockSize=8,Zn.blockSize=Zn.prototype.blockSize=8,Zn.keySize=Zn.prototype.keySize=16;const Se=4294967295;function Me(r,e){return(r<>>32-e)&Se}function sr(r,e){return r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24}function Ar(r,e,t){r.splice(e,4,255&t,t>>>8&255,t>>>16&255,t>>>24&255)}function _t(r,e){return r>>>8*e&255}function Xn(r){this.tf=function(){let e=null,t=null,n=-1,i=[],a=[[],[],[],[]];function s(h){return a[0][_t(h,0)]^a[1][_t(h,1)]^a[2][_t(h,2)]^a[3][_t(h,3)]}function o(h){return a[0][_t(h,3)]^a[1][_t(h,0)]^a[2][_t(h,1)]^a[3][_t(h,2)]}function u(h,l){let w=s(l[0]),y=o(l[1]);l[2]=Me(l[2]^w+y+i[4*h+8]&Se,31),l[3]=Me(l[3],1)^w+2*y+i[4*h+9]&Se,w=s(l[2]),y=o(l[3]),l[0]=Me(l[0]^w+y+i[4*h+10]&Se,31),l[1]=Me(l[1],1)^w+2*y+i[4*h+11]&Se}function c(h,l){let w=s(l[0]),y=o(l[1]);l[2]=Me(l[2],1)^w+y+i[4*h+10]&Se,l[3]=Me(l[3]^w+2*y+i[4*h+11]&Se,31),w=s(l[2]),y=o(l[3]),l[0]=Me(l[0],1)^w+y+i[4*h+8]&Se,l[1]=Me(l[1]^w+2*y+i[4*h+9]&Se,31)}return{name:"twofish",blocksize:16,open:function(h){let l,w,y,K,C;e=h;const O=[],F=[],Y=[];let $;const E=[];let W,H,j;const V=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],Z=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],tt=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],rt=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],dt=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],lt=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],N=[[],[]],ft=[[],[],[],[]];function Pt(yt){return yt^yt>>2^[0,90,180,238][3&yt]}function q(yt){return yt^yt>>1^yt>>2^[0,238,180,90][3&yt]}function it(yt,pt){let gt,ot,S;for(gt=0;gt<8;gt++)ot=pt>>>24,pt=pt<<8&Se|yt>>>24,yt=yt<<8&Se,S=ot<<1,128&ot&&(S^=333),pt^=ot^S<<16,S^=ot>>>1,1&ot&&(S^=166),pt^=S<<24|S<<8;return pt}function mt(yt,pt){const gt=pt>>4,ot=15&pt,S=V[yt][gt^ot],M=Z[yt][dt[ot]^lt[gt]];return rt[yt][dt[M]^lt[S]]<<4|tt[yt][S^M]}function bt(yt,pt){let gt=_t(yt,0),ot=_t(yt,1),S=_t(yt,2),M=_t(yt,3);switch($){case 4:gt=N[1][gt]^_t(pt[3],0),ot=N[0][ot]^_t(pt[3],1),S=N[0][S]^_t(pt[3],2),M=N[1][M]^_t(pt[3],3);case 3:gt=N[1][gt]^_t(pt[2],0),ot=N[1][ot]^_t(pt[2],1),S=N[0][S]^_t(pt[2],2),M=N[0][M]^_t(pt[2],3);case 2:gt=N[0][N[0][gt]^_t(pt[1],0)]^_t(pt[0],0),ot=N[0][N[1][ot]^_t(pt[1],1)]^_t(pt[0],1),S=N[1][N[0][S]^_t(pt[1],2)]^_t(pt[0],2),M=N[1][N[1][M]^_t(pt[1],3)]^_t(pt[0],3)}return ft[0][gt]^ft[1][ot]^ft[2][S]^ft[3][M]}for(e=e.slice(0,32),l=e.length;l!==16&&l!==24&&l!==32;)e[l++]=0;for(l=0;l>2]=sr(e,l);for(l=0;l<256;l++)N[0][l]=mt(0,l),N[1][l]=mt(1,l);for(l=0;l<256;l++)W=N[1][l],H=Pt(W),j=q(W),ft[0][l]=W+(H<<8)+(j<<16)+(j<<24),ft[2][l]=H+(j<<8)+(W<<16)+(j<<24),W=N[0][l],H=Pt(W),j=q(W),ft[1][l]=j+(j<<8)+(H<<16)+(W<<24),ft[3][l]=H+(W<<8)+(j<<16)+(H<<24);for($=Y.length/2,l=0;l<$;l++)w=Y[l+l],O[l]=w,y=Y[l+l+1],F[l]=y,E[$-l-1]=it(w,y);for(l=0;l<40;l+=2)w=16843009*l,y=w+16843009,w=bt(w,O),y=Me(bt(y,F),8),i[l]=w+y&Se,i[l+1]=Me(w+2*y,9);for(l=0;l<256;l++)switch(w=y=K=C=l,$){case 4:w=N[1][w]^_t(E[3],0),y=N[0][y]^_t(E[3],1),K=N[0][K]^_t(E[3],2),C=N[1][C]^_t(E[3],3);case 3:w=N[1][w]^_t(E[2],0),y=N[1][y]^_t(E[2],1),K=N[0][K]^_t(E[2],2),C=N[0][C]^_t(E[2],3);case 2:a[0][l]=ft[0][N[0][N[0][w]^_t(E[1],0)]^_t(E[0],0)],a[1][l]=ft[1][N[0][N[1][y]^_t(E[1],1)]^_t(E[0],1)],a[2][l]=ft[2][N[1][N[0][K]^_t(E[1],2)]^_t(E[0],2)],a[3][l]=ft[3][N[1][N[1][C]^_t(E[1],3)]^_t(E[0],3)]}},close:function(){i=[],a=[[],[],[],[]]},encrypt:function(h,l){t=h,n=l;const w=[sr(t,n)^i[0],sr(t,n+4)^i[1],sr(t,n+8)^i[2],sr(t,n+12)^i[3]];for(let y=0;y<8;y++)u(y,w);return Ar(t,n,w[2]^i[4]),Ar(t,n+4,w[3]^i[5]),Ar(t,n+8,w[0]^i[6]),Ar(t,n+12,w[1]^i[7]),n+=16,t},decrypt:function(h,l){t=h,n=l;const w=[sr(t,n)^i[4],sr(t,n+4)^i[5],sr(t,n+8)^i[6],sr(t,n+12)^i[7]];for(let y=7;y>=0;y--)c(y,w);Ar(t,n,w[2]^i[0]),Ar(t,n+4,w[3]^i[1]),Ar(t,n+8,w[0]^i[2]),Ar(t,n+12,w[1]^i[3]),n+=16},finalize:function(){return t}}}(),this.tf.open(Array.from(r),0),this.encrypt=function(e){return this.tf.encrypt(Array.from(e),0)}}function Be(){}function Yn(r){this.bf=new Be,this.bf.init(r),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Xn.keySize=Xn.prototype.keySize=32,Xn.blockSize=Xn.prototype.blockSize=16,Be.prototype.BLOCKSIZE=8,Be.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Be.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Be.prototype.NN=16,Be.prototype._clean=function(r){return r<0&&(r=(2147483647&r)+2147483648),r},Be.prototype._F=function(r){let e;const t=255&r,n=255&(r>>>=8),i=255&(r>>>=8),a=255&(r>>>=8);return e=this.sboxes[0][a]+this.sboxes[1][i],e^=this.sboxes[2][n],e+=this.sboxes[3][t],e},Be.prototype._encryptBlock=function(r){let e,t=r[0],n=r[1];for(e=0;e>>24-8*e&255,i[e+n]=t[1]>>>24-8*e&255;return i},Be.prototype._decryptBlock=function(r){let e,t=r[0],n=r[1];for(e=this.NN+1;e>1;--e){t^=this.parray[e],n=this._F(t)^n;const i=t;t=n,n=i}t^=this.parray[1],n^=this.parray[0],r[0]=this._clean(n),r[1]=this._clean(t)},Be.prototype.init=function(r){let e,t=0;for(this.parray=[],e=0;e=r.length&&(t=0);this.parray[e]=this.PARRAY[e]^i}for(this.sboxes=[],e=0;e<4;++e)for(this.sboxes[e]=[],t=0;t<256;++t)this.sboxes[e][t]=this.SBOXES[e][t];const n=[0,0];for(e=0;e>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=it+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=mt+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=bt+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=yt+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=pt+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=gt+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=ot+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=S+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=M+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=b+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=f+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=U+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=G+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=X+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,z=Q+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=G^S^mt^q,ut=P<<1|P>>>31,z=ut+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=X^M^bt^it,st=P<<1|P>>>31,z=st+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Q^b^yt^mt,ht=P<<1|P>>>31,z=ht+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ut^f^pt^bt,I=P<<1|P>>>31,z=I+(g<<5|g>>>27)+T+(d&m|~d&A)+1518500249|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=st^U^gt^yt,x=P<<1|P>>>31,z=x+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ht^G^ot^pt,D=P<<1|P>>>31,z=D+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=I^X^S^gt,B=P<<1|P>>>31,z=B+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=x^Q^M^ot,R=P<<1|P>>>31,z=R+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=D^ut^b^S,L=P<<1|P>>>31,z=L+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=B^st^f^M,v=P<<1|P>>>31,z=v+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=R^ht^U^b,k=P<<1|P>>>31,z=k+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=L^I^G^f,nt=P<<1|P>>>31,z=nt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=v^x^X^U,at=P<<1|P>>>31,z=at+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=k^D^Q^G,St=P<<1|P>>>31,z=St+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=nt^B^ut^X,It=P<<1|P>>>31,z=It+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=at^R^st^Q,zt=P<<1|P>>>31,z=zt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=St^L^ht^ut,Dt=P<<1|P>>>31,z=Dt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=It^v^I^st,Wt=P<<1|P>>>31,z=Wt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=zt^k^x^ht,Yt=P<<1|P>>>31,z=Yt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Dt^nt^D^I,Jt=P<<1|P>>>31,z=Jt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Wt^at^B^x,ne=P<<1|P>>>31,z=ne+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Yt^St^R^D,xt=P<<1|P>>>31,z=xt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Jt^It^L^B,Nt=P<<1|P>>>31,z=Nt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ne^zt^v^R,Lt=P<<1|P>>>31,z=Lt+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=xt^Dt^k^L,Et=P<<1|P>>>31,z=Et+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Nt^Wt^nt^v,jt=P<<1|P>>>31,z=jt+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Lt^Yt^at^k,$t=P<<1|P>>>31,z=$t+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Et^Jt^St^nt,Ht=P<<1|P>>>31,z=Ht+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=jt^ne^It^at,J=P<<1|P>>>31,z=J+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=$t^xt^zt^St,et=P<<1|P>>>31,z=et+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ht^Nt^Dt^It,ct=P<<1|P>>>31,z=ct+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=J^Lt^Wt^zt,wt=P<<1|P>>>31,z=wt+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=et^Et^Yt^Dt,kt=P<<1|P>>>31,z=kt+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ct^jt^Jt^Wt,Ut=P<<1|P>>>31,z=Ut+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=wt^$t^ne^Yt,At=P<<1|P>>>31,z=At+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=kt^Ht^xt^Jt,Mt=P<<1|P>>>31,z=Mt+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ut^J^Nt^ne,qt=P<<1|P>>>31,z=qt+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=At^et^Lt^xt,De=P<<1|P>>>31,z=De+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Mt^ct^Et^Nt,Ce=P<<1|P>>>31,z=Ce+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=qt^wt^jt^Lt,Ie=P<<1|P>>>31,z=Ie+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=De^kt^$t^Et,Ne=P<<1|P>>>31,z=Ne+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ce^Ut^Ht^jt,sn=P<<1|P>>>31,z=sn+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ie^At^J^$t,on=P<<1|P>>>31,z=on+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ne^Mt^et^Ht,cn=P<<1|P>>>31,z=cn+(g<<5|g>>>27)+T+(d&m|d&A|m&A)-1894007588|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=sn^qt^ct^J,un=P<<1|P>>>31,z=un+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=on^De^wt^et,hn=P<<1|P>>>31,z=hn+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=cn^Ce^kt^ct,ln=P<<1|P>>>31,z=ln+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=un^Ie^Ut^wt,fn=P<<1|P>>>31,z=fn+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=hn^Ne^At^kt,Ln=P<<1|P>>>31,z=Ln+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=ln^sn^Mt^Ut,On=P<<1|P>>>31,z=On+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=fn^on^qt^At,Di=P<<1|P>>>31,z=Di+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ln^cn^De^Mt,Ci=P<<1|P>>>31,z=Ci+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=On^un^Ce^qt,Ii=P<<1|P>>>31,z=Ii+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Di^hn^Ie^De,Ti=P<<1|P>>>31,z=Ti+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ci^ln^Ne^Ce,Bi=P<<1|P>>>31,z=Bi+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ii^fn^sn^Ie,Ri=P<<1|P>>>31,z=Ri+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ti^Ln^on^Ne,L1=P<<1|P>>>31,z=L1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Bi^On^cn^sn,O1=P<<1|P>>>31,z=O1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ri^Di^un^on,N1=P<<1|P>>>31,z=N1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=L1^Ci^hn^cn,M1=P<<1|P>>>31,z=M1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=O1^Ii^ln^un,$1=P<<1|P>>>31,z=$1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=N1^Ti^fn^hn,cs=P<<1|P>>>31,z=cs+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=M1^Bi^Ln^ln,us=P<<1|P>>>31,z=us+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=$1^Ri^On^fn,hs=P<<1|P>>>31,z=hs+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,n=n+g|0,i=i+d|0,a=a+m|0,s=s+A|0,o=o+T|0}function H(q){q=q|0,W(E[q|0]<<24|E[q|1]<<16|E[q|2]<<8|E[q|3],E[q|4]<<24|E[q|5]<<16|E[q|6]<<8|E[q|7],E[q|8]<<24|E[q|9]<<16|E[q|10]<<8|E[q|11],E[q|12]<<24|E[q|13]<<16|E[q|14]<<8|E[q|15],E[q|16]<<24|E[q|17]<<16|E[q|18]<<8|E[q|19],E[q|20]<<24|E[q|21]<<16|E[q|22]<<8|E[q|23],E[q|24]<<24|E[q|25]<<16|E[q|26]<<8|E[q|27],E[q|28]<<24|E[q|29]<<16|E[q|30]<<8|E[q|31],E[q|32]<<24|E[q|33]<<16|E[q|34]<<8|E[q|35],E[q|36]<<24|E[q|37]<<16|E[q|38]<<8|E[q|39],E[q|40]<<24|E[q|41]<<16|E[q|42]<<8|E[q|43],E[q|44]<<24|E[q|45]<<16|E[q|46]<<8|E[q|47],E[q|48]<<24|E[q|49]<<16|E[q|50]<<8|E[q|51],E[q|52]<<24|E[q|53]<<16|E[q|54]<<8|E[q|55],E[q|56]<<24|E[q|57]<<16|E[q|58]<<8|E[q|59],E[q|60]<<24|E[q|61]<<16|E[q|62]<<8|E[q|63])}function j(q){q=q|0,E[q|0]=n>>>24,E[q|1]=n>>>16&255,E[q|2]=n>>>8&255,E[q|3]=n&255,E[q|4]=i>>>24,E[q|5]=i>>>16&255,E[q|6]=i>>>8&255,E[q|7]=i&255,E[q|8]=a>>>24,E[q|9]=a>>>16&255,E[q|10]=a>>>8&255,E[q|11]=a&255,E[q|12]=s>>>24,E[q|13]=s>>>16&255,E[q|14]=s>>>8&255,E[q|15]=s&255,E[q|16]=o>>>24,E[q|17]=o>>>16&255,E[q|18]=o>>>8&255,E[q|19]=o&255}function V(){n=1732584193,i=4023233417,a=2562383102,s=271733878,o=3285377520,u=c=0}function Z(q,it,mt,bt,yt,pt,gt){q=q|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,n=q,i=it,a=mt,s=bt,o=yt,u=pt,c=gt}function tt(q,it){q=q|0,it=it|0;var mt=0;if(q&63)return-1;for(;(it|0)>=64;)H(q),q=q+64|0,it=it-64|0,mt=mt+64|0;return u=u+mt|0,u>>>0>>0&&(c=c+1|0),mt|0}function rt(q,it,mt){q=q|0,it=it|0,mt=mt|0;var bt=0,yt=0;if(q&63||~mt&&mt&31)return-1;if((it|0)>=64){if(bt=tt(q,it)|0,(bt|0)==-1)return-1;q=q+bt|0,it=it-bt|0}if(bt=bt+it|0,u=u+it|0,u>>>0>>0&&(c=c+1|0),E[q|it]=128,(it|0)>=56){for(yt=it+1|0;(yt|0)<64;yt=yt+1|0)E[q|yt]=0;H(q),it=0,E[q|0]=0}for(yt=it+1|0;(yt|0)<59;yt=yt+1|0)E[q|yt]=0;return E[q|56]=c>>>21&255,E[q|57]=c>>>13&255,E[q|58]=c>>>5&255,E[q|59]=c<<3&255|u>>>29,E[q|60]=u>>>21&255,E[q|61]=u>>>13&255,E[q|62]=u>>>5&255,E[q|63]=u<<3&255,H(q),~mt&&j(mt),bt|0}function dt(){n=h,i=l,a=w,s=y,o=K,u=64,c=0}function lt(){n=C,i=O,a=F,s=Y,o=$,u=64,c=0}function N(q,it,mt,bt,yt,pt,gt,ot,S,M,b,f,U,G,X,Q){q=q|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,ot=ot|0,S=S|0,M=M|0,b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,V(),W(q^1549556828,it^1549556828,mt^1549556828,bt^1549556828,yt^1549556828,pt^1549556828,gt^1549556828,ot^1549556828,S^1549556828,M^1549556828,b^1549556828,f^1549556828,U^1549556828,G^1549556828,X^1549556828,Q^1549556828),C=n,O=i,F=a,Y=s,$=o,V(),W(q^909522486,it^909522486,mt^909522486,bt^909522486,yt^909522486,pt^909522486,gt^909522486,ot^909522486,S^909522486,M^909522486,b^909522486,f^909522486,U^909522486,G^909522486,X^909522486,Q^909522486),h=n,l=i,w=a,y=s,K=o,u=64,c=0}function ft(q,it,mt){q=q|0,it=it|0,mt=mt|0;var bt=0,yt=0,pt=0,gt=0,ot=0,S=0;return q&63||~mt&&mt&31?-1:(S=rt(q,it,-1)|0,bt=n,yt=i,pt=a,gt=s,ot=o,lt(),W(bt,yt,pt,gt,ot,2147483648,0,0,0,0,0,0,0,0,0,672),~mt&&j(mt),S|0)}function Pt(q,it,mt,bt,yt){q=q|0,it=it|0,mt=mt|0,bt=bt|0,yt=yt|0;var pt=0,gt=0,ot=0,S=0,M=0,b=0,f=0,U=0,G=0,X=0;if(q&63||~yt&&yt&31)return-1;for(E[q+it|0]=mt>>>24,E[q+it+1|0]=mt>>>16&255,E[q+it+2|0]=mt>>>8&255,E[q+it+3|0]=mt&255,ft(q,it+4|0,-1)|0,pt=b=n,gt=f=i,ot=U=a,S=G=s,M=X=o,bt=bt-1|0;(bt|0)>0;)dt(),W(b,f,U,G,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,G=s,X=o,lt(),W(b,f,U,G,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,G=s,X=o,pt=pt^n,gt=gt^i,ot=ot^a,S=S^s,M=M^o,bt=bt-1|0;return n=pt,i=gt,a=ot,s=S,o=M,~yt&&j(yt),0}return{reset:V,init:Z,process:tt,finish:rt,hmac_reset:dt,hmac_init:N,hmac_finish:ft,pbkdf2_generate_block:Pt}};class J2{constructor(){this.pos=0,this.len=0}reset(){const{asm:e}=this.acquire_asm();return this.result=null,this.pos=0,this.len=0,e.reset(),this}process(e){if(this.result!==null)throw new Ua("state must be reset before processing new data");const{asm:t,heap:n}=this.acquire_asm();let i=this.pos,a=this.len,s=0,o=e.length,u=0;for(;o>0;)u=Vr(n,i+a,e,s,o),a+=u,s+=u,o-=u,u=t.process(i,a),i+=u,a-=u,a||(i=0);return this.pos=i,this.len=a,this}finish(){if(this.result!==null)throw new Ua("state must be reset before processing new data");const{asm:e,heap:t}=this.acquire_asm();return e.finish(this.pos,this.len,0),this.result=new Uint8Array(this.HASH_SIZE),this.result.set(t.subarray(0,this.HASH_SIZE)),this.pos=0,this.len=0,this.release_asm(),this}}const zs=[],Ls=[];class Zr extends J2{constructor(){super(),this.NAME="sha1",this.BLOCK_SIZE=64,this.HASH_SIZE=20,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=zs.pop()||Wa(),this.asm=Ls.pop()||Q2({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(zs.push(this.heap),Ls.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Zr().process(e).finish().result}}Zr.NAME="sha1",Zr.heap_pool=[],Zr.asm_pool=[],Zr.asm_function=Q2;const Os=[],Ns=[];class U1 extends J2{constructor(){super(),this.NAME="sha256",this.BLOCK_SIZE=64,this.HASH_SIZE=32,this.acquire_asm()}acquire_asm(){return this.heap!==void 0&&this.asm!==void 0||(this.heap=Os.pop()||Wa(),this.asm=Ns.pop()||function(e,t,n){var i=0,a=0,s=0,o=0,u=0,c=0,h=0,l=0,w=0,y=0,K=0,C=0,O=0,F=0,Y=0,$=0,E=0,W=0,H=0,j=0,V=0,Z=0,tt=0,rt=0,dt=0,lt=0,N=new e.Uint8Array(n);function ft(b,f,U,G,X,Q,g,d,m,A,T,P,z,ut,st,ht){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,g=g|0,d=d|0,m=m|0,A=A|0,T=T|0,P=P|0,z=z|0,ut=ut|0,st=st|0,ht=ht|0;var I=0,x=0,D=0,B=0,R=0,L=0,v=0,k=0;I=i,x=a,D=s,B=o,R=u,L=c,v=h,k=l,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1116352408|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+1899447441|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+3049323471|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+3921009573|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+961987163|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1508970993|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2453635748|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+2870763221|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3624381080|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,v=A+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+310598401|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+607225278|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+1426881987|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+1925078388|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+2162078206|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2614888103|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+3248222580|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+b+A|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+3835390401|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+T|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+4022224774|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(G>>>7^G>>>18^G>>>3^G<<25^G<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+264347078|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,G=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+G+z|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+604807628|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Q>>>7^Q>>>18^Q>>>3^Q<<25^Q<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ut|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+770255983|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Q=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(G>>>17^G>>>19^G>>>10^G<<15^G<<13)+Q+st|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1249150122|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+ht|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1555081692|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Q>>>17^Q>>>19^Q>>>10^Q<<15^Q<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+1996064986|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2554220882|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+U|0,v=A+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+2821834349|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,T=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+T+G|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2952996808|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+P+X|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+3210313671|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Q|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+3336571891|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ut+g|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+3584528711|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+113926993|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,ht=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+338241895|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+b+A|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+666307205|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+T|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+773529912|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(G>>>7^G>>>18^G>>>3^G<<25^G<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+1294757372|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,G=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+G+z|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+1396182291|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Q>>>7^Q>>>18^Q>>>3^Q<<25^Q<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ut|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+1695183700|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Q=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(G>>>17^G>>>19^G>>>10^G<<15^G<<13)+Q+st|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1986661051|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+ht|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2177026350|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Q>>>17^Q>>>19^Q>>>10^Q<<15^Q<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+2456956037|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+2730485921|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+U|0,v=A+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+2820302411|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,T=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+T+G|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+3259730800|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+P+X|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+3345764771|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Q|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+3516065817|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ut+g|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+3600352804|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+4094571909|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,ht=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+275423344|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(st>>>17^st>>>19^st>>>10^st<<15^st<<13)+b+A|0,k=b+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+430227734|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+f+T|0,v=f+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+506948616|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(G>>>7^G>>>18^G>>>3^G<<25^G<<14)+(b>>>17^b>>>19^b>>>10^b<<15^b<<13)+U+P|0,L=U+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+659060556|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,G=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+G+z|0,R=G+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+883997877|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,X=(Q>>>7^Q>>>18^Q>>>3^Q<<25^Q<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ut|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+958139571|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,Q=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(G>>>17^G>>>19^G>>>10^G<<15^G<<13)+Q+st|0,D=Q+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+1322822218|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,g=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(X>>>17^X>>>19^X>>>10^X<<15^X<<13)+g+ht|0,x=g+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1537002063|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,d=(m>>>7^m>>>18^m>>>3^m<<25^m<<14)+(Q>>>17^Q>>>19^Q>>>10^Q<<15^Q<<13)+d+b|0,I=d+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+1747873779|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,m=(A>>>7^A>>>18^A>>>3^A<<25^A<<14)+(g>>>17^g>>>19^g>>>10^g<<15^g<<13)+m+f|0,k=m+k+(R>>>6^R>>>11^R>>>25^R<<26^R<<21^R<<7)+(v^R&(L^v))+1955562222|0,B=B+k|0,k=k+(I&x^D&(I^x))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,A=(T>>>7^T>>>18^T>>>3^T<<25^T<<14)+(d>>>17^d>>>19^d>>>10^d<<15^d<<13)+A+U|0,v=A+v+(B>>>6^B>>>11^B>>>25^B<<26^B<<21^B<<7)+(L^B&(R^L))+2024104815|0,D=D+v|0,v=v+(k&I^x&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,T=(P>>>7^P>>>18^P>>>3^P<<25^P<<14)+(m>>>17^m>>>19^m>>>10^m<<15^m<<13)+T+G|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2227730452|0,x=x+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,P=(z>>>7^z>>>18^z>>>3^z<<25^z<<14)+(A>>>17^A>>>19^A>>>10^A<<15^A<<13)+P+X|0,R=P+R+(x>>>6^x>>>11^x>>>25^x<<26^x<<21^x<<7)+(B^x&(D^B))+2361852424|0,I=I+R|0,R=R+(L&v^k&(L^v))+(L>>>2^L>>>13^L>>>22^L<<30^L<<19^L<<10)|0,z=(ut>>>7^ut>>>18^ut>>>3^ut<<25^ut<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Q|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(x^D))+2428436474|0,k=k+B|0,B=B+(R&L^v&(R^L))+(R>>>2^R>>>13^R>>>22^R<<30^R<<19^R<<10)|0,ut=(st>>>7^st>>>18^st>>>3^st<<25^st<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ut+g|0,D=ut+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(x^k&(I^x))+2756734187|0,v=v+D|0,D=D+(B&R^L&(B^R))+(B>>>2^B>>>13^B>>>22^B<<30^B<<19^B<<10)|0,st=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+st+d|0,x=st+x+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+3204031479|0,L=L+x|0,x=x+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,ht=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ut>>>17^ut>>>19^ut>>>10^ut<<15^ut<<13)+ht+m|0,I=ht+I+(L>>>6^L>>>11^L>>>25^L<<26^L<<21^L<<7)+(k^L&(v^k))+3329325298|0,R=R+I|0,I=I+(x&D^B&(x^D))+(x>>>2^x>>>13^x>>>22^x<<30^x<<19^x<<10)|0,i=i+I|0,a=a+x|0,s=s+D|0,o=o+B|0,u=u+R|0,c=c+L|0,h=h+v|0,l=l+k|0}function Pt(b){b=b|0,ft(N[b|0]<<24|N[b|1]<<16|N[b|2]<<8|N[b|3],N[b|4]<<24|N[b|5]<<16|N[b|6]<<8|N[b|7],N[b|8]<<24|N[b|9]<<16|N[b|10]<<8|N[b|11],N[b|12]<<24|N[b|13]<<16|N[b|14]<<8|N[b|15],N[b|16]<<24|N[b|17]<<16|N[b|18]<<8|N[b|19],N[b|20]<<24|N[b|21]<<16|N[b|22]<<8|N[b|23],N[b|24]<<24|N[b|25]<<16|N[b|26]<<8|N[b|27],N[b|28]<<24|N[b|29]<<16|N[b|30]<<8|N[b|31],N[b|32]<<24|N[b|33]<<16|N[b|34]<<8|N[b|35],N[b|36]<<24|N[b|37]<<16|N[b|38]<<8|N[b|39],N[b|40]<<24|N[b|41]<<16|N[b|42]<<8|N[b|43],N[b|44]<<24|N[b|45]<<16|N[b|46]<<8|N[b|47],N[b|48]<<24|N[b|49]<<16|N[b|50]<<8|N[b|51],N[b|52]<<24|N[b|53]<<16|N[b|54]<<8|N[b|55],N[b|56]<<24|N[b|57]<<16|N[b|58]<<8|N[b|59],N[b|60]<<24|N[b|61]<<16|N[b|62]<<8|N[b|63])}function q(b){b=b|0,N[b|0]=i>>>24,N[b|1]=i>>>16&255,N[b|2]=i>>>8&255,N[b|3]=i&255,N[b|4]=a>>>24,N[b|5]=a>>>16&255,N[b|6]=a>>>8&255,N[b|7]=a&255,N[b|8]=s>>>24,N[b|9]=s>>>16&255,N[b|10]=s>>>8&255,N[b|11]=s&255,N[b|12]=o>>>24,N[b|13]=o>>>16&255,N[b|14]=o>>>8&255,N[b|15]=o&255,N[b|16]=u>>>24,N[b|17]=u>>>16&255,N[b|18]=u>>>8&255,N[b|19]=u&255,N[b|20]=c>>>24,N[b|21]=c>>>16&255,N[b|22]=c>>>8&255,N[b|23]=c&255,N[b|24]=h>>>24,N[b|25]=h>>>16&255,N[b|26]=h>>>8&255,N[b|27]=h&255,N[b|28]=l>>>24,N[b|29]=l>>>16&255,N[b|30]=l>>>8&255,N[b|31]=l&255}function it(){i=1779033703,a=3144134277,s=1013904242,o=2773480762,u=1359893119,c=2600822924,h=528734635,l=1541459225,w=y=0}function mt(b,f,U,G,X,Q,g,d,m,A){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,g=g|0,d=d|0,m=m|0,A=A|0,i=b,a=f,s=U,o=G,u=X,c=Q,h=g,l=d,w=m,y=A}function bt(b,f){b=b|0,f=f|0;var U=0;if(b&63)return-1;for(;(f|0)>=64;)Pt(b),b=b+64|0,f=f-64|0,U=U+64|0;return w=w+U|0,w>>>0>>0&&(y=y+1|0),U|0}function yt(b,f,U){b=b|0,f=f|0,U=U|0;var G=0,X=0;if(b&63||~U&&U&31)return-1;if((f|0)>=64){if(G=bt(b,f)|0,(G|0)==-1)return-1;b=b+G|0,f=f-G|0}if(G=G+f|0,w=w+f|0,w>>>0>>0&&(y=y+1|0),N[b|f]=128,(f|0)>=56){for(X=f+1|0;(X|0)<64;X=X+1|0)N[b|X]=0;Pt(b),f=0,N[b|0]=0}for(X=f+1|0;(X|0)<59;X=X+1|0)N[b|X]=0;return N[b|56]=y>>>21&255,N[b|57]=y>>>13&255,N[b|58]=y>>>5&255,N[b|59]=y<<3&255|w>>>29,N[b|60]=w>>>21&255,N[b|61]=w>>>13&255,N[b|62]=w>>>5&255,N[b|63]=w<<3&255,Pt(b),~U&&q(U),G|0}function pt(){i=K,a=C,s=O,o=F,u=Y,c=$,h=E,l=W,w=64,y=0}function gt(){i=H,a=j,s=V,o=Z,u=tt,c=rt,h=dt,l=lt,w=64,y=0}function ot(b,f,U,G,X,Q,g,d,m,A,T,P,z,ut,st,ht){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0,Q=Q|0,g=g|0,d=d|0,m=m|0,A=A|0,T=T|0,P=P|0,z=z|0,ut=ut|0,st=st|0,ht=ht|0,it(),ft(b^1549556828,f^1549556828,U^1549556828,G^1549556828,X^1549556828,Q^1549556828,g^1549556828,d^1549556828,m^1549556828,A^1549556828,T^1549556828,P^1549556828,z^1549556828,ut^1549556828,st^1549556828,ht^1549556828),H=i,j=a,V=s,Z=o,tt=u,rt=c,dt=h,lt=l,it(),ft(b^909522486,f^909522486,U^909522486,G^909522486,X^909522486,Q^909522486,g^909522486,d^909522486,m^909522486,A^909522486,T^909522486,P^909522486,z^909522486,ut^909522486,st^909522486,ht^909522486),K=i,C=a,O=s,F=o,Y=u,$=c,E=h,W=l,w=64,y=0}function S(b,f,U){b=b|0,f=f|0,U=U|0;var G=0,X=0,Q=0,g=0,d=0,m=0,A=0,T=0,P=0;return b&63||~U&&U&31?-1:(P=yt(b,f,-1)|0,G=i,X=a,Q=s,g=o,d=u,m=c,A=h,T=l,gt(),ft(G,X,Q,g,d,m,A,T,2147483648,0,0,0,0,0,0,768),~U&&q(U),P|0)}function M(b,f,U,G,X){b=b|0,f=f|0,U=U|0,G=G|0,X=X|0;var Q=0,g=0,d=0,m=0,A=0,T=0,P=0,z=0,ut=0,st=0,ht=0,I=0,x=0,D=0,B=0,R=0;if(b&63||~X&&X&31)return-1;for(N[b+f|0]=U>>>24,N[b+f+1|0]=U>>>16&255,N[b+f+2|0]=U>>>8&255,N[b+f+3|0]=U&255,S(b,f+4|0,-1)|0,Q=ut=i,g=st=a,d=ht=s,m=I=o,A=x=u,T=D=c,P=B=h,z=R=l,G=G-1|0;(G|0)>0;)pt(),ft(ut,st,ht,I,x,D,B,R,2147483648,0,0,0,0,0,0,768),ut=i,st=a,ht=s,I=o,x=u,D=c,B=h,R=l,gt(),ft(ut,st,ht,I,x,D,B,R,2147483648,0,0,0,0,0,0,768),ut=i,st=a,ht=s,I=o,x=u,D=c,B=h,R=l,Q=Q^i,g=g^a,d=d^s,m=m^o,A=A^u,T=T^c,P=P^h,z=z^l,G=G-1|0;return i=Q,a=g,s=d,o=m,u=A,c=T,h=P,l=z,~X&&q(X),0}return{reset:it,init:mt,process:bt,finish:yt,hmac_reset:pt,hmac_init:ot,hmac_finish:S,pbkdf2_generate_block:M}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(Os.push(this.heap),Ns.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new U1().process(e).finish().result}}U1.NAME="sha256";var K1=to;function to(r,e){if(!r)throw Error(e||"Assertion failed")}to.equal=function(r,e,t){if(r!=e)throw Error(t||"Assertion failed: "+r+" != "+e)};var iu=Qe!==void 0?Qe:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(r,e){return r(e={exports:{}},e.exports),e.exports}function Cc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ic=Za(function(r){r.exports=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),Tc=function(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for((r=r.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(r="0"+r),n=0;n>8,s=255&i;a?t.push(a,s):t.push(s)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(255&r)<<24)>>>0}var Rc=function(r,e){for(var t="",n=0;n>>0}return a},Lc=function(r,e){for(var t=Array(4*r.length),n=0,i=0;n>>24,t[i+1]=a>>>16&255,t[i+2]=a>>>8&255,t[i+3]=255&a):(t[i+3]=a>>>24,t[i+2]=a>>>16&255,t[i+1]=a>>>8&255,t[i]=255&a)}return t},Ct={inherits:Ic,toArray:Tc,toHex:Bc,htonl:eo,toHex32:Rc,zero2:ro,zero8:no,join32:zc,split32:Lc,rotr32:function(r,e){return r>>>e|r<<32-e},rotl32:function(r,e){return r<>>32-e},sum32:function(r,e){return r+e>>>0},sum32_3:function(r,e,t){return r+e+t>>>0},sum32_4:function(r,e,t,n){return r+e+t+n>>>0},sum32_5:function(r,e,t,n,i){return r+e+t+n+i>>>0},sum64:function(r,e,t,n){var i=r[e],a=n+r[e+1]>>>0,s=(a>>0,r[e+1]=a},sum64_hi:function(r,e,t,n){return(e+n>>>0>>0},sum64_lo:function(r,e,t,n){return e+n>>>0},sum64_4_hi:function(r,e,t,n,i,a,s,o){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},sum64_4_lo:function(r,e,t,n,i,a,s,o){return e+n+a+o>>>0},sum64_5_hi:function(r,e,t,n,i,a,s,o,u,c){var h=0,l=e;return h+=(l=l+n>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(r,e,t,n,i,a,s,o,u,c){return e+n+a+o+c>>>0},rotr64_hi:function(r,e,t){return(e<<32-t|r>>>t)>>>0},rotr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0},shr64_hi:function(r,e,t){return r>>>t},shr64_lo:function(r,e,t){return(r<<32-t|e>>>t)>>>0}};function Wi(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Oc=Wi;Wi.prototype.update=function(r,e){if(r=Ct.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){var t=(r=this.pending).length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=Ct.join32(r,0,r.length-t,this.endian);for(var n=0;n>>24&255,n[i++]=r>>>16&255,n[i++]=r>>>8&255,n[i++]=255&r}else for(n[i++]=255&r,n[i++]=r>>>8&255,n[i++]=r>>>16&255,n[i++]=r>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3},g1_256:function(r){return $e(r,17)^$e(r,19)^r>>>10}},Te=Ct.sum32,Mc=Ct.sum32_4,$c=Ct.sum32_5,Fc=Tn.ch32,Hc=Tn.maj32,jc=Tn.s0_256,qc=Tn.s1_256,Gc=Tn.g0_256,Wc=Tn.g1_256,oo=Xa.BlockHash,Vc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function qe(){if(!(this instanceof qe))return new qe;oo.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Vc,this.W=Array(64)}Ct.inherits(qe,oo);var co=qe;function dr(){if(!(this instanceof dr))return new dr;co.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}qe.blockSize=512,qe.outSize=256,qe.hmacStrength=192,qe.padLength=64,qe.prototype._update=function(r,e){for(var t=this.W,n=0;n<16;n++)t[n]=r[e+n];for(;n>>32-i,t)}function fe(r,e,t,n,i,a,s){return x1(e&t|~e&n,r,e,i,a,s)}function de(r,e,t,n,i,a,s){return x1(e&n|t&~n,r,e,i,a,s)}function ye(r,e,t,n,i,a,s){return x1(e^t^n,r,e,i,a,s)}function pe(r,e,t,n,i,a,s){return x1(t^(e|~n),r,e,i,a,s)}function k3(r){const e=[];let t;for(t=0;t<64;t+=4)e[t>>2]=r.charCodeAt(t)+(r.charCodeAt(t+1)<<8)+(r.charCodeAt(t+2)<<16)+(r.charCodeAt(t+3)<<24);return e}const Hs="0123456789abcdef".split("");function v3(r){let e="",t=0;for(;t<4;t++)e+=Hs[r>>8*t+4&15]+Hs[r>>8*t&15];return e}function Ir(r,e){return r+e&4294967295}const a1=_.getWebCrypto(),s1=_.getNodeCrypto(),A3=s1&&s1.getHashes();function Hr(r){if(s1&&A3.includes(r))return async function(e){const t=s1.createHash(r);return Qt(e,n=>{t.update(n)},()=>new Uint8Array(t.digest()))}}function Li(r,e){return async function(t,n=vt){if(le(t)&&(t=await ar(t)),!_.isStream(t)&&a1&&e&&t.length>=n.minBytesForWebCrypto)return new Uint8Array(await a1.digest(e,t));const i=r();return Qt(t,a=>{i.update(a)},()=>new Uint8Array(i.digest()))}}function js(r,e){return async function(t,n=vt){if(le(t)&&(t=await ar(t)),_.isStream(t)){const i=new r;return Qt(t,a=>{i.process(a)},()=>i.finish().result)}return a1&&e&&t.length>=n.minBytesForWebCrypto?new Uint8Array(await a1.digest(e,t)):r.bytes(t)}}const jr={md5:Hr("md5")||async function(r){const e=function(t){const n=t.length,i=[1732584193,-271733879,-1732584194,271733878];let a;for(a=64;a<=t.length;a+=64)V1(i,k3(t.substring(a-64,a)));t=t.substring(a-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(a=0;a>2]|=t.charCodeAt(a)<<(a%4<<3);if(s[a>>2]|=128<<(a%4<<3),a>55)for(V1(i,s),a=0;a<16;a++)s[a]=0;return s[14]=8*n,V1(i,s),i}(_.uint8ArrayToString(r));return _.hexToUint8Array(function(t){for(let n=0;nnew Uint8Array(O.update(F)))}(r,e,t,n);if(_.isAES(r))return function(l,w,y,K,C){if(_.getWebCrypto()&&w.length!==24&&!_.isStream(y)&&y.length>=3e3*C.minBytesForWebCrypto)return async function(F,Y,$,E){const W="AES-CBC",H=await qs.importKey("raw",Y,{name:W},!1,["encrypt"]),{blockSize:j}=er(F),V=_.concatUint8Array([new Uint8Array(j),$]),Z=new Uint8Array(await qs.encrypt({name:W,iv:E},H,V)).subarray(0,$.length);return function(tt,rt){for(let dt=0;dtO.aes.AES_Encrypt_process(F),()=>O.aes.AES_Encrypt_finish())}(r,e,t,n,i);const s=new(er(r))(e),o=s.blockSize,u=n.slice();let c=new Uint8Array;const h=l=>{l&&(c=_.concatUint8Array([c,l]));const w=new Uint8Array(c.length);let y,K=0;for(;l?c.length>=o:c.length;){const C=s.encrypt(u);for(y=0;ynew Uint8Array(C.update(O)))}(r,e,t,n);if(_.isAES(r))return function(h,l,w,y){if(_.isStream(w)){const K=new _n(l,y);return Qt(w,C=>K.aes.AES_Decrypt_process(C),()=>K.aes.AES_Decrypt_finish())}return _n.decrypt(w,l,y)}(0,e,t,n);const a=new(er(r))(e),s=a.blockSize;let o=n,u=new Uint8Array;const c=h=>{h&&(u=_.concatUint8Array([u,h]));const l=new Uint8Array(u.length);let w,y=0;for(;h?u.length>=s:u.length;){const K=a.encrypt(o);for(o=u.subarray(0,s),w=0;w48)throw new pr("illegal counter size");let a=Math.pow(2,n)-1;i.set_mask(0,0,a/4294967296|0,0|a)}else n=48,i.set_mask(0,0,65535,4294967295);if(e===void 0)throw Error("nonce is required");{let a=e.length;if(!a||a>16)throw new pr("illegal nonce size");let s=new DataView(new ArrayBuffer(16));new Uint8Array(s.buffer).set(e),i.set_nonce(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}if(t!==void 0){if(t<0||t>=Math.pow(2,n))throw new pr("illegal counter value");i.set_counter(0,0,t/4294967296|0,0|t)}}}class u1{static encrypt(e,t,n=!0,i){return new u1(t,i,n).encrypt(e)}static decrypt(e,t,n=!0,i){return new u1(t,i,n).decrypt(e)}constructor(e,t,n=!0,i){this.aes=i||new Ei(e,t,n,"CBC")}encrypt(e){return Nr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Nr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const Gs=_.getWebCrypto(),E3=_.getNodeCrypto(),hr=16;function Ws(r,e){const t=r.length-hr;for(let n=0;n>3),17+(y>>3)),8-(7&y)).subarray(1),F=new Uint8Array(we),Y=new Uint8Array(u.length+Pr);let $,E=0;for($=0;$16)throw new pr("illegal tagSize value");const u=t.length||0,c=new Uint8Array(16);u!==12?(this._gcm_mac_process(t),o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=u>>>29,o[12]=u>>>21&255,o[13]=u>>>13&255,o[14]=u>>>5&255,o[15]=u<<3&255,s.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),s.get_iv(Kt.HEAP_DATA),s.set_iv(0,0,0,0),c.set(o.subarray(0,16))):(c.set(t),c[15]=1);const h=new DataView(c.buffer);if(this.gamma0=h.getUint32(12),s.set_nonce(h.getUint32(0),h.getUint32(4),h.getUint32(8),0),s.set_mask(0,0,0,4294967295),n!==void 0){if(n.length>X1)throw new pr("illegal adata length");n.length?(this.adata=n,this._gcm_mac_process(n)):this.adata=void 0}else this.adata=void 0;if(this.counter<1||this.counter>4294967295)throw new RangeError("counter must be a positive 32-bit integer");s.set_counter(0,0,0,this.gamma0+this.counter|0)}static encrypt(e,t,n,i,a){return new Xr(t,n,i,a).encrypt(e)}static decrypt(e,t,n,i,a){return new Xr(t,n,i,a).decrypt(e)}encrypt(e){return this.AES_GCM_encrypt(e)}decrypt(e){return this.AES_GCM_decrypt(e)}AES_GCM_Encrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.aes.pos,u=this.aes.len,c=0,h=u+n&-16,l=0;if((s-1<<4)+u+n>X1)throw new RangeError("counter overflow");const w=new Uint8Array(h);for(;n>0;)l=Vr(a,o+u,e,t,n),u+=l,t+=l,n-=l,l=i.cipher(Kt.ENC.CTR,Kt.HEAP_DATA+o,u),l=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+o,l),l&&w.set(a.subarray(o,o+l),c),s+=l>>>4,c+=l,l>>29,t[4]=h>>>21,t[5]=h>>>13&255,t[6]=h>>>5&255,t[7]=h<<3&255,t[8]=t[9]=t[10]=0,t[11]=l>>>29,t[12]=l>>>21&255,t[13]=l>>>13&255,t[14]=l>>>5&255,t[15]=l<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16),u.set(t.subarray(0,i),o),this.counter=1,this.aes.pos=0,this.aes.len=0,u}AES_GCM_Decrypt_process(e){let t=0,n=e.length||0,{asm:i,heap:a}=this.aes.acquire_asm(),s=this.counter,o=this.tagSize,u=this.aes.pos,c=this.aes.len,h=0,l=c+n>o?c+n-o&-16:0,w=c+n-l,y=0;if((s-1<<4)+c+n>X1)throw new RangeError("counter overflow");const K=new Uint8Array(l);for(;n>w;)y=Vr(a,u+c,e,t,n-w),c+=y,t+=y,n-=y,y=i.mac(Kt.MAC.GCM,Kt.HEAP_DATA+u,y),y=i.cipher(Kt.DEC.CTR,Kt.HEAP_DATA+u,y),y&&K.set(a.subarray(u,u+y),h),s+=y>>>4,h+=y,u=0,c=0;return n>0&&(c+=Vr(a,0,e,t,n)),this.counter=s,this.aes.pos=u,this.aes.len=c,K}AES_GCM_Decrypt_finish(){let{asm:e,heap:t}=this.aes.acquire_asm(),n=this.tagSize,i=this.adata,a=this.counter,s=this.aes.pos,o=this.aes.len,u=o-n;if(o>>29,t[4]=w>>>21,t[5]=w>>>13&255,t[6]=w>>>5&255,t[7]=w<<3&255,t[8]=t[9]=t[10]=0,t[11]=y>>>29,t[12]=y>>>21&255,t[13]=y>>>13&255,t[14]=y>>>5&255,t[15]=y<<3&255,e.mac(Kt.MAC.GCM,Kt.HEAP_DATA,16),e.get_iv(Kt.HEAP_DATA),e.set_counter(0,0,0,this.gamma0),e.cipher(Kt.ENC.CTR,Kt.HEAP_DATA,16);let K=0;for(let C=0;C0;){for(s=Vr(n,0,e,i,a),i+=s,a-=s;15&s;)n[s++]=0;t.mac(Kt.MAC.GCM,Kt.HEAP_DATA,s)}}}const Y1=_.getWebCrypto(),Ys=_.getNodeCrypto(),Qs=_.getNodeBuffer(),wn=16,Q1="AES-GCM";async function kn(r,e){if(r!==p.symmetric.aes128&&r!==p.symmetric.aes192&&r!==p.symmetric.aes256)throw Error("GCM mode supports only AES cipher");if(_.getNodeCrypto())return{encrypt:async function(t,n,i=new Uint8Array){const a=new Ys.createCipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i);const s=Qs.concat([a.update(t),a.final(),a.getAuthTag()]);return new Uint8Array(s)},decrypt:async function(t,n,i=new Uint8Array){const a=new Ys.createDecipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i),a.setAuthTag(t.slice(t.length-wn,t.length));const s=Qs.concat([a.update(t.slice(0,t.length-wn)),a.final()]);return new Uint8Array(s)}};if(_.getWebCrypto()&&e.length!==24){const t=await Y1.importKey("raw",e,{name:Q1},!1,["encrypt","decrypt"]);return{encrypt:async function(n,i,a=new Uint8Array){if(!n.length)return Xr.encrypt(n,e,i,a);const s=await Y1.encrypt({name:Q1,iv:i,additionalData:a,tagLength:8*wn},t,n);return new Uint8Array(s)},decrypt:async function(n,i,a=new Uint8Array){if(n.length===wn)return Xr.decrypt(n,e,i,a);const s=await Y1.decrypt({name:Q1,iv:i,additionalData:a,tagLength:8*wn},t,n);return new Uint8Array(s)}}}return{encrypt:async function(t,n,i){return Xr.encrypt(t,e,n,i)},decrypt:async function(t,n,i){return Xr.decrypt(t,e,n,i)}}}kn.getNonce=function(r,e){const t=r.slice();for(let n=0;n>>8)-1}(S,M,b,f,32)}function K(S,M){var b;for(b=0;b<16;b++)S[b]=0|M[b]}function C(S){var M,b,f=1;for(M=0;M<16;M++)b=S[M]+f+65535,f=Math.floor(b/65536),S[M]=b-65536*f;S[0]+=f-1+37*(f-1)}function O(S,M,b){for(var f,U=~(b-1),G=0;G<16;G++)f=U&(S[G]^M[G]),S[G]^=f,M[G]^=f}function F(S,M){var b,f,U,G=t(),X=t();for(b=0;b<16;b++)X[b]=M[b];for(C(X),C(X),C(X),f=0;f<2;f++){for(G[0]=X[0]-65517,b=1;b<15;b++)G[b]=X[b]-65535-(G[b-1]>>16&1),G[b-1]&=65535;G[15]=X[15]-32767-(G[14]>>16&1),U=G[15]>>16&1,G[14]&=65535,O(X,G,1-U)}for(b=0;b<16;b++)S[2*b]=255&X[b],S[2*b+1]=X[b]>>8}function Y(S,M){var b=new Uint8Array(32),f=new Uint8Array(32);return F(b,S),F(f,M),y(b,0,f,0)}function $(S){var M=new Uint8Array(32);return F(M,S),1&M[0]}function E(S,M){var b;for(b=0;b<16;b++)S[b]=M[2*b]+(M[2*b+1]<<8);S[15]&=32767}function W(S,M,b){for(var f=0;f<16;f++)S[f]=M[f]+b[f]}function H(S,M,b){for(var f=0;f<16;f++)S[f]=M[f]-b[f]}function j(S,M,b){var f,U,G=0,X=0,Q=0,g=0,d=0,m=0,A=0,T=0,P=0,z=0,ut=0,st=0,ht=0,I=0,x=0,D=0,B=0,R=0,L=0,v=0,k=0,nt=0,at=0,St=0,It=0,zt=0,Dt=0,Wt=0,Yt=0,Jt=0,ne=0,xt=b[0],Nt=b[1],Lt=b[2],Et=b[3],jt=b[4],$t=b[5],Ht=b[6],J=b[7],et=b[8],ct=b[9],wt=b[10],kt=b[11],Ut=b[12],At=b[13],Mt=b[14],qt=b[15];G+=(f=M[0])*xt,X+=f*Nt,Q+=f*Lt,g+=f*Et,d+=f*jt,m+=f*$t,A+=f*Ht,T+=f*J,P+=f*et,z+=f*ct,ut+=f*wt,st+=f*kt,ht+=f*Ut,I+=f*At,x+=f*Mt,D+=f*qt,X+=(f=M[1])*xt,Q+=f*Nt,g+=f*Lt,d+=f*Et,m+=f*jt,A+=f*$t,T+=f*Ht,P+=f*J,z+=f*et,ut+=f*ct,st+=f*wt,ht+=f*kt,I+=f*Ut,x+=f*At,D+=f*Mt,B+=f*qt,Q+=(f=M[2])*xt,g+=f*Nt,d+=f*Lt,m+=f*Et,A+=f*jt,T+=f*$t,P+=f*Ht,z+=f*J,ut+=f*et,st+=f*ct,ht+=f*wt,I+=f*kt,x+=f*Ut,D+=f*At,B+=f*Mt,R+=f*qt,g+=(f=M[3])*xt,d+=f*Nt,m+=f*Lt,A+=f*Et,T+=f*jt,P+=f*$t,z+=f*Ht,ut+=f*J,st+=f*et,ht+=f*ct,I+=f*wt,x+=f*kt,D+=f*Ut,B+=f*At,R+=f*Mt,L+=f*qt,d+=(f=M[4])*xt,m+=f*Nt,A+=f*Lt,T+=f*Et,P+=f*jt,z+=f*$t,ut+=f*Ht,st+=f*J,ht+=f*et,I+=f*ct,x+=f*wt,D+=f*kt,B+=f*Ut,R+=f*At,L+=f*Mt,v+=f*qt,m+=(f=M[5])*xt,A+=f*Nt,T+=f*Lt,P+=f*Et,z+=f*jt,ut+=f*$t,st+=f*Ht,ht+=f*J,I+=f*et,x+=f*ct,D+=f*wt,B+=f*kt,R+=f*Ut,L+=f*At,v+=f*Mt,k+=f*qt,A+=(f=M[6])*xt,T+=f*Nt,P+=f*Lt,z+=f*Et,ut+=f*jt,st+=f*$t,ht+=f*Ht,I+=f*J,x+=f*et,D+=f*ct,B+=f*wt,R+=f*kt,L+=f*Ut,v+=f*At,k+=f*Mt,nt+=f*qt,T+=(f=M[7])*xt,P+=f*Nt,z+=f*Lt,ut+=f*Et,st+=f*jt,ht+=f*$t,I+=f*Ht,x+=f*J,D+=f*et,B+=f*ct,R+=f*wt,L+=f*kt,v+=f*Ut,k+=f*At,nt+=f*Mt,at+=f*qt,P+=(f=M[8])*xt,z+=f*Nt,ut+=f*Lt,st+=f*Et,ht+=f*jt,I+=f*$t,x+=f*Ht,D+=f*J,B+=f*et,R+=f*ct,L+=f*wt,v+=f*kt,k+=f*Ut,nt+=f*At,at+=f*Mt,St+=f*qt,z+=(f=M[9])*xt,ut+=f*Nt,st+=f*Lt,ht+=f*Et,I+=f*jt,x+=f*$t,D+=f*Ht,B+=f*J,R+=f*et,L+=f*ct,v+=f*wt,k+=f*kt,nt+=f*Ut,at+=f*At,St+=f*Mt,It+=f*qt,ut+=(f=M[10])*xt,st+=f*Nt,ht+=f*Lt,I+=f*Et,x+=f*jt,D+=f*$t,B+=f*Ht,R+=f*J,L+=f*et,v+=f*ct,k+=f*wt,nt+=f*kt,at+=f*Ut,St+=f*At,It+=f*Mt,zt+=f*qt,st+=(f=M[11])*xt,ht+=f*Nt,I+=f*Lt,x+=f*Et,D+=f*jt,B+=f*$t,R+=f*Ht,L+=f*J,v+=f*et,k+=f*ct,nt+=f*wt,at+=f*kt,St+=f*Ut,It+=f*At,zt+=f*Mt,Dt+=f*qt,ht+=(f=M[12])*xt,I+=f*Nt,x+=f*Lt,D+=f*Et,B+=f*jt,R+=f*$t,L+=f*Ht,v+=f*J,k+=f*et,nt+=f*ct,at+=f*wt,St+=f*kt,It+=f*Ut,zt+=f*At,Dt+=f*Mt,Wt+=f*qt,I+=(f=M[13])*xt,x+=f*Nt,D+=f*Lt,B+=f*Et,R+=f*jt,L+=f*$t,v+=f*Ht,k+=f*J,nt+=f*et,at+=f*ct,St+=f*wt,It+=f*kt,zt+=f*Ut,Dt+=f*At,Wt+=f*Mt,Yt+=f*qt,x+=(f=M[14])*xt,D+=f*Nt,B+=f*Lt,R+=f*Et,L+=f*jt,v+=f*$t,k+=f*Ht,nt+=f*J,at+=f*et,St+=f*ct,It+=f*wt,zt+=f*kt,Dt+=f*Ut,Wt+=f*At,Yt+=f*Mt,Jt+=f*qt,D+=(f=M[15])*xt,X+=38*(R+=f*Lt),Q+=38*(L+=f*Et),g+=38*(v+=f*jt),d+=38*(k+=f*$t),m+=38*(nt+=f*Ht),A+=38*(at+=f*J),T+=38*(St+=f*et),P+=38*(It+=f*ct),z+=38*(zt+=f*wt),ut+=38*(Dt+=f*kt),st+=38*(Wt+=f*Ut),ht+=38*(Yt+=f*At),I+=38*(Jt+=f*Mt),x+=38*(ne+=f*qt),G=(f=(G+=38*(B+=f*Nt))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Q=(f=Q+U+65535)-65536*(U=Math.floor(f/65536)),g=(f=g+U+65535)-65536*(U=Math.floor(f/65536)),d=(f=d+U+65535)-65536*(U=Math.floor(f/65536)),m=(f=m+U+65535)-65536*(U=Math.floor(f/65536)),A=(f=A+U+65535)-65536*(U=Math.floor(f/65536)),T=(f=T+U+65535)-65536*(U=Math.floor(f/65536)),P=(f=P+U+65535)-65536*(U=Math.floor(f/65536)),z=(f=z+U+65535)-65536*(U=Math.floor(f/65536)),ut=(f=ut+U+65535)-65536*(U=Math.floor(f/65536)),st=(f=st+U+65535)-65536*(U=Math.floor(f/65536)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),x=(f=x+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),G=(f=(G+=U-1+37*(U-1))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Q=(f=Q+U+65535)-65536*(U=Math.floor(f/65536)),g=(f=g+U+65535)-65536*(U=Math.floor(f/65536)),d=(f=d+U+65535)-65536*(U=Math.floor(f/65536)),m=(f=m+U+65535)-65536*(U=Math.floor(f/65536)),A=(f=A+U+65535)-65536*(U=Math.floor(f/65536)),T=(f=T+U+65535)-65536*(U=Math.floor(f/65536)),P=(f=P+U+65535)-65536*(U=Math.floor(f/65536)),z=(f=z+U+65535)-65536*(U=Math.floor(f/65536)),ut=(f=ut+U+65535)-65536*(U=Math.floor(f/65536)),st=(f=st+U+65535)-65536*(U=Math.floor(f/65536)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),x=(f=x+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),G+=U-1+37*(U-1),S[0]=G,S[1]=X,S[2]=Q,S[3]=g,S[4]=d,S[5]=m,S[6]=A,S[7]=T,S[8]=P,S[9]=z,S[10]=ut,S[11]=st,S[12]=ht,S[13]=I,S[14]=x,S[15]=D}function V(S,M){j(S,M,M)}function Z(S,M){var b,f=t();for(b=0;b<16;b++)f[b]=M[b];for(b=253;b>=0;b--)V(f,f),b!==2&&b!==4&&j(f,f,M);for(b=0;b<16;b++)S[b]=f[b]}function tt(S,M,b){var f,U,G=new Uint8Array(32),X=new Float64Array(80),Q=t(),g=t(),d=t(),m=t(),A=t(),T=t();for(U=0;U<31;U++)G[U]=M[U];for(G[31]=127&M[31]|64,G[0]&=248,E(X,b),U=0;U<16;U++)g[U]=X[U],m[U]=Q[U]=d[U]=0;for(Q[0]=m[0]=1,U=254;U>=0;--U)O(Q,g,f=G[U>>>3]>>>(7&U)&1),O(d,m,f),W(A,Q,d),H(Q,Q,d),W(d,g,m),H(g,g,m),V(m,A),V(T,Q),j(Q,d,Q),j(d,g,A),W(A,Q,d),H(Q,Q,d),V(g,Q),H(d,m,T),j(Q,d,o),W(Q,Q,m),j(d,d,Q),j(Q,m,T),j(m,g,X),V(g,A),O(Q,g,f),O(d,m,f);for(U=0;U<16;U++)X[U+16]=Q[U],X[U+32]=d[U],X[U+48]=g[U],X[U+64]=m[U];var P=X.subarray(32),z=X.subarray(16);return Z(P,P),j(z,z,P),F(S,z),0}function rt(S,M){return tt(S,M,i)}function dt(S,M){var b=t(),f=t(),U=t(),G=t(),X=t(),Q=t(),g=t(),d=t(),m=t();H(b,S[1],S[0]),H(m,M[1],M[0]),j(b,b,m),W(f,S[0],S[1]),W(m,M[0],M[1]),j(f,f,m),j(U,S[3],M[3]),j(U,U,c),j(G,S[2],M[2]),W(G,G,G),H(X,f,b),H(Q,G,U),W(g,G,U),W(d,f,b),j(S[0],X,Q),j(S[1],d,g),j(S[2],g,Q),j(S[3],X,d)}function lt(S,M,b){var f;for(f=0;f<4;f++)O(S[f],M[f],b)}function N(S,M){var b=t(),f=t(),U=t();Z(U,M[2]),j(b,M[0],U),j(f,M[1],U),F(S,f),S[31]^=$(b)<<7}function ft(S,M,b){var f,U;for(K(S[0],a),K(S[1],s),K(S[2],s),K(S[3],a),U=255;U>=0;--U)lt(S,M,f=b[U/8|0]>>(7&U)&1),dt(M,S),dt(S,S),lt(S,M,f)}function Pt(S,M){var b=[t(),t(),t(),t()];K(b[0],h),K(b[1],l),K(b[2],s),j(b[3],h,l),ft(S,b,M)}function q(S,M,b){var f,U,G=[t(),t(),t(),t()];for(b||n(M,32),(f=e.hash(M.subarray(0,32)))[0]&=248,f[31]&=127,f[31]|=64,Pt(G,f),N(S,G),U=0;U<32;U++)M[U+32]=S[U];return 0}var it=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 mt(S,M){var b,f,U,G;for(f=63;f>=32;--f){for(b=0,U=f-32,G=f-12;U>4)*it[U],b=M[U]>>8,M[U]&=255;for(U=0;U<32;U++)M[U]-=b*it[U];for(f=0;f<32;f++)M[f+1]+=M[f]>>8,S[f]=255&M[f]}function bt(S){var M,b=new Float64Array(64);for(M=0;M<64;M++)b[M]=S[M];for(M=0;M<64;M++)S[M]=0;mt(S,b)}function yt(S,M){var b=t(),f=t(),U=t(),G=t(),X=t(),Q=t(),g=t();return K(S[2],s),E(S[1],M),V(U,S[1]),j(G,U,u),H(U,U,S[2]),W(G,S[2],G),V(X,G),V(Q,X),j(g,Q,X),j(b,g,U),j(b,b,G),function(d,m){var A,T=t();for(A=0;A<16;A++)T[A]=m[A];for(A=250;A>=0;A--)V(T,T),A!==1&&j(T,T,m);for(A=0;A<16;A++)d[A]=T[A]}(b,b),j(b,b,U),j(b,b,G),j(b,b,G),j(S[0],b,G),V(f,S[0]),j(f,f,G),Y(f,U)&&j(S[0],S[0],w),V(f,S[0]),j(f,f,G),Y(f,U)?-1:($(S[0])===M[31]>>7&&H(S[0],a,S[0]),j(S[3],S[0],S[1]),0)}var pt=64;function gt(){for(var S=0;S=0},e.sign.keyPair=function(){var S=new Uint8Array(32),M=new Uint8Array(64);return q(S,M),{publicKey:S,secretKey:M}},e.sign.keyPair.fromSecretKey=function(S){if(gt(S),S.length!==64)throw Error("bad secret key size");for(var M=new Uint8Array(32),b=0;b"u"||!crypto.getRandomValues)throw Error("No secure random number generator available.");crypto.getRandomValues(e)}return e}async function br(r,e){const t=await _.getBigInteger();if(e.lt(r))throw Error("Illegal parameter value: max <= min");const n=e.sub(r),i=n.byteLength();return new t(await Ee(i+8)).mod(n).add(r)}var I3=Object.freeze({__proto__:null,getRandomBytes:Ee,getRandomBigInteger:br});async function t0(r,e,t){const n=await _.getBigInteger(),i=new n(1),a=i.leftShift(new n(r-1)),s=new n(30),o=[1,6,5,4,3,2,1,4,3,2,1,2,1,4,3,2,1,2,1,4,3,2,1,6,5,4,3,2,1,2],u=await br(a,a.leftShift(i));let c=u.mod(s).toNumber();do u.iadd(new n(o[c])),c=(c+o[c])%o.length,u.bitLength()>r&&(u.imod(a.leftShift(i)).iadd(a),c=u.mod(s).toNumber());while(!await mo(u,e,t));return u}async function mo(r,e,t){return!(e&&!r.dec().gcd(e).isOne())&&!!await async function(n){const i=await _.getBigInteger();return T3.every(a=>n.mod(new i(a))!==0)}(r)&&!!await async function(n,i){const a=await _.getBigInteger();return i=i||new a(2),i.modExp(n.dec(),n).isOne()}(r)&&!!await async function(n,i,a){const s=await _.getBigInteger(),o=n.bitLength();i||(i=Math.max(1,o/48|0));const u=n.dec();let c=0;for(;!u.getBit(c);)c++;const h=n.rightShift(new s(c));for(;i>0;i--){let l,w=(await br(new s(2),u)).modExp(h,n);if(!w.isOne()&&!w.equal(u)){for(l=1;le-11)throw Error("Message too long");const n=function(a){const s=new Uint8Array(a);let o=0;for(;o=8&!n;if(e)return _.selectUint8Array(s,a,e);if(s)return a;throw Error("Decryption error")}async function Ca(r,e,t){let n;if(e.length!==Ke.getHashByteLength(r))throw Error("Invalid hash length");const i=new Uint8Array(je[r].length);for(n=0;n{const{default:tt}=await import("./bn.min-DAU79I_Z.js");return{default:tt}},[],import.meta.url),Y=new F(K),$=new F(C),E=new F(y),W=E.mod($.subn(1)),H=E.mod(Y.subn(1)),j=ge.createSign(p.read(p.hash,c));j.write(h),j.end();const V={version:0,modulus:new F(l),publicExponent:new F(w),privateExponent:new F(y),prime1:new F(C),prime2:new F(K),exponent1:W,exponent2:H,coefficient:new F(O)};if(ge.createPrivateKey!==void 0){const tt=yn.encode(V,"der");return new Uint8Array(j.sign({key:tt,format:"der",type:"pkcs1"}))}const Z=yn.encode(V,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(j.sign(Z))}(r,e,t,n,i,a,s,o)}return async function(c,h,l,w){const y=await _.getBigInteger();h=new y(h);const K=new y(await Ca(c,w,h.byteLength()));if(l=new y(l),K.gte(h))throw Error("Message size cannot exceed modulus size");return K.modExp(l,h).toUint8Array("be",h.byteLength())}(r,t,i,u)},verify:async function(r,e,t,n,i,a){if(e&&!_.isStream(e)){if(_.getWebCrypto())try{return await async function(s,o,u,c,h){const l=function(y,K){return{kty:"RSA",n:Ae(y,!0),e:Ae(K,!0),ext:!0}}(c,h),w=await dn.importKey("jwk",l,{name:"RSASSA-PKCS1-v1_5",hash:{name:s}},!1,["verify"]);return dn.verify("RSASSA-PKCS1-v1_5",w,u,o)}(p.read(p.webHash,r),e,t,n,i)}catch(s){_.printDebugError(s)}else if(_.getNodeCrypto())return async function(s,o,u,c,h){const{default:l}=await Wr(async()=>{const{default:C}=await import("./bn.min-DAU79I_Z.js");return{default:C}},[],import.meta.url),w=ge.createVerify(p.read(p.hash,s));w.write(o),w.end();const y={modulus:new l(c),publicExponent:new l(h)};let K;ge.createPrivateKey!==void 0?K={key:$i.encode(y,"der"),format:"der",type:"pkcs1"}:K=$i.encode(y,"pem",{label:"RSA PUBLIC KEY"});try{return await w.verify(K,u)}catch{return!1}}(r,e,t,n,i)}return async function(s,o,u,c,h){const l=await _.getBigInteger();if(u=new l(u),o=new l(o),c=new l(c),o.gte(u))throw Error("Signature size cannot exceed modulus size");const w=o.modExp(c,u).toUint8Array("be",u.byteLength()),y=await Ca(s,h,u.byteLength());return _.equalsUint8Array(w,y)}(r,t,n,i,a)},encrypt:async function(r,e,t){return _.getNodeCrypto()?async function(n,i,a){const{default:s}=await Wr(async()=>{const{default:c}=await import("./bn.min-DAU79I_Z.js");return{default:c}},[],import.meta.url),o={modulus:new s(i),publicExponent:new s(a)};let u;return ge.createPrivateKey!==void 0?u={key:$i.encode(o,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:u={key:$i.encode(o,"pem",{label:"RSA PUBLIC KEY"}),padding:ge.constants.RSA_PKCS1_PADDING},new Uint8Array(ge.publicEncrypt(u,n))}(r,e,t):async function(n,i,a){const s=await _.getBigInteger();if(i=new s(i),n=new s(Ya(n,i.byteLength())),a=new s(a),n.gte(i))throw Error("Message size cannot exceed modulus size");return n.modExp(a,i).toUint8Array("be",i.byteLength())}(r,e,t)},decrypt:async function(r,e,t,n,i,a,s,o){if(_.getNodeCrypto()&&!o)try{return await async function(u,c,h,l,w,y,K){const{default:C}=await Wr(async()=>{const{default:j}=await import("./bn.min-DAU79I_Z.js");return{default:j}},[],import.meta.url),O=new C(w),F=new C(y),Y=new C(l),$=Y.mod(F.subn(1)),E=Y.mod(O.subn(1)),W={version:0,modulus:new C(c),publicExponent:new C(h),privateExponent:new C(l),prime1:new C(y),prime2:new C(w),exponent1:$,exponent2:E,coefficient:new C(K)};let H;ge.createPrivateKey!==void 0?H={key:yn.encode(W,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:H={key:yn.encode(W,"pem",{label:"RSA PRIVATE KEY"}),padding:ge.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(ge.privateDecrypt(H,u))}catch{throw Error("Decryption error")}}(r,e,t,n,i,a,s)}catch(u){_.printDebugError(u)}return async function(u,c,h,l,w,y,K,C){const O=await _.getBigInteger();if(u=new O(u),c=new O(c),h=new O(h),l=new O(l),w=new O(w),y=new O(y),K=new O(K),u.gte(c))throw Error("Data too large.");const F=l.mod(y.dec()),Y=l.mod(w.dec()),$=(await br(new O(2),c)).mod(c),E=$.modInv(c).modExp(h,c);u=u.mul(E).mod(c);const W=u.modExp(Y,w),H=u.modExp(F,y);let V=K.mul(H.sub(W)).mod(y).mul(w).add(W);return V=V.mul($).mod(c),Qa(V.toUint8Array("be",c.byteLength()),C)}(r,e,t,n,i,a,s,o)},generate:async function(r,e){if(e=new(await _.getBigInteger())(e),_.getWebCrypto()){const s={name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:e.toUint8Array(),hash:{name:"SHA-1"}},o=await dn.generateKey(s,!0,["sign","verify"]),u=await dn.exportKey("jwk",o.privateKey);return{n:fr(u.n),e:e.toUint8Array(),d:fr(u.d),p:fr(u.q),q:fr(u.p),u:fr(u.qi)}}if(_.getNodeCrypto()&&ge.generateKeyPair&&yn){const s={modulusLength:r,publicExponent:e.toNumber(),publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"der"}},o=await new Promise((u,c)=>{ge.generateKeyPair("rsa",s,(h,l,w)=>{h?c(h):u(yn.decode(w,"der"))})});return{n:o.modulus.toArrayLike(Uint8Array),e:o.publicExponent.toArrayLike(Uint8Array),d:o.privateExponent.toArrayLike(Uint8Array),p:o.prime2.toArrayLike(Uint8Array),q:o.prime1.toArrayLike(Uint8Array),u:o.coefficient.toArrayLike(Uint8Array)}}let t,n,i;do n=await t0(r-(r>>1),e,40),t=await t0(r>>1,e,40),i=t.mul(n);while(i.bitLength()!==r);const a=t.dec().imul(n.dec());return n.lt(t)&&([t,n]=[n,t]),{n:i.toUint8Array(),e:e.toUint8Array(),d:e.modInv(a).toUint8Array(),p:t.toUint8Array(),q:n.toUint8Array(),u:t.modInv(n).toUint8Array()}},validateParams:async function(r,e,t,n,i,a){const s=await _.getBigInteger();if(r=new s(r),n=new s(n),i=new s(i),!n.mul(i).equal(r))return!1;const o=new s(2);if(a=new s(a),!n.mul(a).mod(i).isOne())return!1;e=new s(e),t=new s(t);const u=new s(Math.floor(r.bitLength()/3)),c=await br(o,o.leftShift(u)),h=c.mul(t).mul(e);return!(!h.mod(n.dec()).equal(c)||!h.mod(i.dec()).equal(c))}}),z3=Object.freeze({__proto__:null,encrypt:async function(r,e,t,n){const i=await _.getBigInteger();e=new i(e),t=new i(t),n=new i(n);const a=new i(Ya(r,e.byteLength())),s=await br(new i(1),e.dec());return{c1:t.modExp(s,e).toUint8Array(),c2:n.modExp(s,e).imul(a).imod(e).toUint8Array()}},decrypt:async function(r,e,t,n,i){const a=await _.getBigInteger();return r=new a(r),e=new a(e),t=new a(t),n=new a(n),Qa(r.modExp(n,t).modInv(t).imul(e).imod(t).toUint8Array("be",t.byteLength()),i)},validateParams:async function(r,e,t,n){const i=await _.getBigInteger();r=new i(r),e=new i(e),t=new i(t);const a=new i(1);if(e.lte(a)||e.gte(r))return!1;const s=new i(r.bitLength()),o=new i(1023);if(s.lt(o)||!e.modExp(r.dec(),r).isOne())return!1;let u=e;const c=new i(1),h=new i(2).leftShift(new i(17));for(;c.lt(h);){if(u=u.mul(e).imod(r),u.isOne())return!1;c.iinc()}n=new i(n);const l=new i(2),w=await br(l.leftShift(s.dec()),l.leftShift(s)),y=r.dec().imul(w).iadd(n);return!!t.equal(e.modExp(y,r))}});class We{constructor(e){if(e instanceof We)this.oid=e.oid;else if(_.isArray(e)||_.isUint8Array(e)){if((e=new Uint8Array(e))[0]===6){if(e[1]!==e.length-2)throw Error("Length mismatch in DER encoded oid");e=e.subarray(2)}this.oid=e}else this.oid=""}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.oid=e.subarray(1,1+t),1+this.oid.length}throw Error("Invalid oid")}write(){return _.concatUint8Array([new Uint8Array([this.oid.length]),this.oid])}toHex(){return _.uint8ArrayToHex(this.oid)}getName(){const e=this.toHex();if(p.curve[e])return p.write(p.curve,e);throw Error("Unknown curve object identifier.")}}function D1(r,e){return r.keyPair({priv:e})}function C1(r,e){const t=r.keyPair({pub:e});if(t.validate().result!==!0)throw Error("Invalid elliptic public key");return t}async function Bn(r){if(!vt.useIndutnyElliptic)throw Error("This curve is only supported in the full build of OpenPGP.js");const{default:e}=await Wr(async()=>{const{default:t}=await import("./elliptic.min-fis8C3PY.js");return{default:t}},__vite__mapDeps([2,1]),import.meta.url);return new e.ec(r)}function bo(r){let e,t=0;const n=r[0];return n<192?([t]=r,e=1):n<255?(t=(r[0]-192<<8)+r[1]+192,e=2):n===255&&(t=_.readNumber(r.subarray(1,5)),e=5),{len:t,offset:e}}function Ui(r){return r<192?new Uint8Array([r]):r>191&&r<8384?new Uint8Array([192+(r-192>>8),r-192&255]):_.concatUint8Array([new Uint8Array([255]),_.writeNumber(r,4)])}function L3(r){if(r<0||r>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+r])}function ko(r){return new Uint8Array([192|r])}function e0(r,e){return _.concatUint8Array([ko(r),Ui(e)])}function Vi(r){return[p.packet.literalData,p.packet.compressedData,p.packet.symmetricallyEncryptedData,p.packet.symEncryptedIntegrityProtectedData,p.packet.aeadEncryptedData].includes(r)}async function O3(r,e){const t=an(r);let n,i;try{const a=await t.peekBytes(2);if(!a||a.length<2||!(128&a[0]))throw Error("Error during parsing. This message / key probably does not conform to a valid OpenPGP format.");const s=await t.readByte();let o,u,c=-1,h=-1;h=0,64&s&&(h=1),h?c=63&s:(c=(63&s)>>2,u=3&s);const l=Vi(c);let w,y=null;if(l){if(_.isStream(r)==="array"){const C=new Ze;n=Oe(C),y=C}else{const C=new ja;n=Oe(C.writable),y=C.readable}i=e({tag:c,packet:y})}else y=[];do{if(h){const C=await t.readByte();if(w=!1,C<192)o=C;else if(C>=192&&C<224)o=(C-192<<8)+await t.readByte()+192;else if(C>223&&C<255){if(o=1<<(31&C),w=!0,!l)throw new TypeError("This packet type does not support partial lengths.")}else o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte()}else switch(u){case 0:o=await t.readByte();break;case 1:o=await t.readByte()<<8|await t.readByte();break;case 2:o=await t.readByte()<<24|await t.readByte()<<16|await t.readByte()<<8|await t.readByte();break;default:o=1/0}if(o>0){let C=0;for(;;){n&&await n.ready;const{done:O,value:F}=await t.read();if(O){if(o===1/0)break;throw Error("Unexpected end of packet")}const Y=o===1/0?F:F.subarray(0,o-C);if(n?await n.write(Y):y.push(Y),C+=F.length,C>=o){t.unshift(F.subarray(o-C+F.length));break}}}}while(w);const K=await t.peekBytes(l?1/0:2);return n?(await n.ready,await n.close()):(y=_.concatUint8Array(y),await e({tag:c,packet:y})),!K||!K.length}catch(a){if(n)return await n.abort(a),!0;throw a}finally{n&&await i,t.releaseLock()}}class re extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,re),this.name="UnsupportedError"}}class Ia{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const J1=_.getWebCrypto(),h1=_.getNodeCrypto(),rr={p256:"P-256",p384:"P-384",p521:"P-521"},or=h1?h1.getCurves():[],Ur=h1?{secp256k1:or.includes("secp256k1")?"secp256k1":void 0,p256:or.includes("prime256v1")?"prime256v1":void 0,p384:or.includes("secp384r1")?"secp384r1":void 0,p521:or.includes("secp521r1")?"secp521r1":void 0,ed25519:or.includes("ED25519")?"ED25519":void 0,curve25519:or.includes("X25519")?"X25519":void 0,brainpoolP256r1:or.includes("brainpoolP256r1")?"brainpoolP256r1":void 0,brainpoolP384r1:or.includes("brainpoolP384r1")?"brainpoolP384r1":void 0,brainpoolP512r1:or.includes("brainpoolP512r1")?"brainpoolP512r1":void 0}:{},Zi={p256:{oid:[6,8,42,134,72,206,61,3,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Ur.p256,web:rr.p256,payloadSize:32,sharedSize:256},p384:{oid:[6,5,43,129,4,0,34],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Ur.p384,web:rr.p384,payloadSize:48,sharedSize:384},p521:{oid:[6,5,43,129,4,0,35],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Ur.p521,web:rr.p521,payloadSize:66,sharedSize:528},secp256k1:{oid:[6,5,43,129,4,0,10],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Ur.secp256k1,payloadSize:32},ed25519:{oid:[6,9,43,6,1,4,1,218,71,15,1],keyType:p.publicKey.eddsaLegacy,hash:p.hash.sha512,node:!1,payloadSize:32},curve25519:{oid:[6,10,43,6,1,4,1,151,85,1,5,1],keyType:p.publicKey.ecdh,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:!1,payloadSize:32},brainpoolP256r1:{oid:[6,9,43,36,3,3,2,8,1,1,7],keyType:p.publicKey.ecdsa,hash:p.hash.sha256,cipher:p.symmetric.aes128,node:Ur.brainpoolP256r1,payloadSize:32},brainpoolP384r1:{oid:[6,9,43,36,3,3,2,8,1,1,11],keyType:p.publicKey.ecdsa,hash:p.hash.sha384,cipher:p.symmetric.aes192,node:Ur.brainpoolP384r1,payloadSize:48},brainpoolP512r1:{oid:[6,9,43,36,3,3,2,8,1,1,13],keyType:p.publicKey.ecdsa,hash:p.hash.sha512,cipher:p.symmetric.aes256,node:Ur.brainpoolP512r1,payloadSize:64}};class kr{constructor(e,t){try{(_.isArray(e)||_.isUint8Array(e))&&(e=new We(e)),e instanceof We&&(e=e.getName()),this.name=p.write(p.curve,e)}catch{throw new re("Unknown curve")}t=t||Zi[this.name],this.keyType=t.keyType,this.oid=t.oid,this.hash=t.hash,this.cipher=t.cipher,this.node=t.node&&Zi[this.name],this.web=t.web&&Zi[this.name],this.payloadSize=t.payloadSize,this.web&&_.getWebCrypto()?this.type="web":this.node&&_.getNodeCrypto()?this.type="node":this.name==="curve25519"?this.type="curve25519":this.name==="ed25519"&&(this.type="ed25519")}async genKeyPair(){let e;switch(this.type){case"web":try{return await async function(n){const i=await J1.generateKey({name:"ECDSA",namedCurve:rr[n]},!0,["sign","verify"]),a=await J1.exportKey("jwk",i.privateKey),s=await J1.exportKey("jwk",i.publicKey);return{publicKey:Ao(s),privateKey:fr(a.d)}}(this.name)}catch(n){_.printDebugError("Browser did not support generating ec key "+n.message);break}case"node":return async function(n){const i=h1.createECDH(Ur[n]);return await i.generateKeys(),{publicKey:new Uint8Array(i.getPublicKey()),privateKey:new Uint8Array(i.getPrivateKey())}}(this.name);case"curve25519":{const n=Ee(32);n[0]=127&n[0]|64,n[31]&=248;const i=n.slice().reverse();return e=ee.box.keyPair.fromSecretKey(i),{publicKey:_.concatUint8Array([new Uint8Array([64]),e.publicKey]),privateKey:n}}case"ed25519":{const n=Ee(32),i=ee.sign.keyPair.fromSeed(n);return{publicKey:_.concatUint8Array([new Uint8Array([64]),i.publicKey]),privateKey:n}}}return e=await(await Bn(this.name)).genKeyPair({entropy:_.uint8ArrayToString(Ee(32))}),{publicKey:new Uint8Array(e.getPublic("array",!1)),privateKey:e.getPrivate().toArrayLike(Uint8Array)}}}async function vo(r,e,t,n){const i={p256:!0,p384:!0,p521:!0,secp256k1:!0,curve25519:r===p.publicKey.ecdh,brainpoolP256r1:!0,brainpoolP384r1:!0,brainpoolP512r1:!0},a=e.getName();if(!i[a])return!1;if(a==="curve25519"){n=n.slice().reverse();const{publicKey:o}=ee.box.keyPair.fromSecretKey(n);t=new Uint8Array(t);const u=new Uint8Array([64,...o]);return!!_.equalsUint8Array(u,t)}const s=await Bn(a);try{t=C1(s,t).getPublic()}catch{return!1}return!!D1(s,n).getPublic().eq(t)}function Ao(r){const e=fr(r.x),t=fr(r.y),n=new Uint8Array(e.length+t.length+1);return n[0]=4,n.set(e,1),n.set(t,e.length+1),n}function I1(r,e,t){const n=r,i=t.slice(1,n+1),a=t.slice(n+1,2*n+1);return{kty:"EC",crv:e,x:Ae(i),y:Ae(a),ext:!0}}function _o(r,e,t,n){const i=I1(r,e,t);return i.d=Ae(n),i}const l1=_.getWebCrypto(),Rn=_.getNodeCrypto();async function r0(r,e,t,n,i,a){const s=new kr(r);if(t&&!_.isStream(t)){const o={publicKey:n,privateKey:i};switch(s.type){case"web":try{return await async function(u,c,h,l){const w=u.payloadSize,y=_o(u.payloadSize,rr[u.name],l.publicKey,l.privateKey),K=await l1.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,u.hash)}},!1,["sign"]),C=new Uint8Array(await l1.sign({name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,c)}},K,h));return{r:C.slice(0,w),s:C.slice(w,w<<1)}}(s,e,t,o)}catch(u){if(s.name!=="p521"&&(u.name==="DataError"||u.name==="OperationError"))throw u;_.printDebugError("Browser did not support signing: "+u.message)}break;case"node":{const u=await async function(c,h,l,w){const y=Rn.createSign(p.read(p.hash,h));y.write(l),y.end();const K=N3.encode({version:1,parameters:c.oid,privateKey:Array.from(w.privateKey),publicKey:{unused:0,data:Array.from(w.publicKey)}},"pem",{label:"EC PRIVATE KEY"});return Eo.decode(y.sign(K),"der")}(s,e,t,o);return{r:u.r.toArrayLike(Uint8Array),s:u.s.toArrayLike(Uint8Array)}}}}return async function(o,u,c){const h=await Bn(o.name),l=D1(h,c),w=l.sign(u);return{r:w.r.toArrayLike(Uint8Array),s:w.s.toArrayLike(Uint8Array)}}(s,a,i)}async function n0(r,e,t,n,i,a){const s=new kr(r);if(n&&!_.isStream(n))switch(s.type){case"web":try{return await async function(o,u,{r:c,s:h},l,w){const y=I1(o.payloadSize,rr[o.name],w),K=await l1.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,o.hash)}},!1,["verify"]),C=_.concatUint8Array([c,h]).buffer;return l1.verify({name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,u)}},K,C,l)}(s,e,t,n,i)}catch(o){if(s.name!=="p521"&&(o.name==="DataError"||o.name==="OperationError"))throw o;_.printDebugError("Browser did not support verifying: "+o.message)}break;case"node":return async function(o,u,{r:c,s:h},l,w){const{default:y}=await Wr(async()=>{const{default:F}=await import("./bn.min-DAU79I_Z.js");return{default:F}},[],import.meta.url),K=Rn.createVerify(p.read(p.hash,u));K.write(l),K.end();const C=$3.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:o.oid},subjectPublicKey:{unused:0,data:Array.from(w)}},"pem",{label:"PUBLIC KEY"}),O=Eo.encode({r:new y(c),s:new y(h)},"der");try{return K.verify(C,O)}catch{return!1}}(s,e,t,n,i)}return async function(o,u,c,h){const l=await Bn(o.name);return C1(l,h).verify(c,u)}(s,t,e===void 0?n:a,i)}const T1=void 0,Eo=Rn?T1.define("ECDSASignature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}):void 0,N3=Rn?T1.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().any(),this.key("publicKey").explicit(1).optional().bitstr())}):void 0,M3=Rn?T1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}):void 0,$3=Rn?T1.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(M3),this.key("subjectPublicKey").bitstr())}):void 0;var F3=Object.freeze({__proto__:null,sign:r0,verify:n0,validateParams:async function(r,e,t){const n=new kr(r);if(n.keyType!==p.publicKey.ecdsa)return!1;switch(n.type){case"web":case"node":{const i=Ee(8),a=p.hash.sha256,s=await Ke.digest(a,i);try{const o=await r0(r,a,i,e,t,s);return await n0(r,a,o,i,e,s)}catch{return!1}}default:return vo(p.publicKey.ecdsa,r,e,t)}}});ee.hash=r=>new Uint8Array(Pi().update(r).digest());var H3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)new Uint8Array(Pi().update(r).digest());var j3=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.ed25519){const e=Ee(32),{publicKey:t}=ee.sign.keyPair.fromSeed(e);return{A:t,seed:e}}throw Error("Unsupported EdDSA algorithm")},sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)=0;--h)for(let l=o-1;l>=0;--l)u[1]=o*h+(l+1),c[0]=a[0]^u[0],c[1]=a[1]^u[1],c[2]=s[2*l],c[3]=s[2*l+1],c=f1(t.decrypt(d1(c))),a=c.subarray(0,2),s[2*l]=c[2],s[2*l+1]=c[3];if(a[0]===n[0]&&a[1]===n[1])return d1(s);throw Error("Key Data Integrity failed")}function f1(r){const{length:e}=r,t=function(a){if(_.isString(a)){const{length:s}=a,o=new ArrayBuffer(s),u=new Uint8Array(o);for(let c=0;c0){const t=r[e-1];if(t>=1){const n=r.subarray(e-t),i=new Uint8Array(t).fill(t);if(_.equalsUint8Array(n,i))return r.subarray(0,e-t)}}throw Error("Invalid padding")}var G3=Object.freeze({__proto__:null,encode:So,decode:Po});const Tr=_.getWebCrypto(),Uo=_.getNodeCrypto();function i0(r,e,t,n){return _.concatUint8Array([e.write(),new Uint8Array([r]),t.write(),_.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function a0(r,e,t,n,i=!1,a=!1){let s;if(i){for(s=0;s=0&&e[s]===0;s--);e=e.subarray(0,s+1)}return(await Ke.digest(r,_.concatUint8Array([new Uint8Array([0,0,0,1]),e,n]))).subarray(0,t)}async function W3(r,e){switch(r.type){case"curve25519":{const t=Ee(32),{secretKey:n,sharedKey:i}=await Ko(r,e,null,t);let{publicKey:a}=ee.box.keyPair.fromSecretKey(n);return a=_.concatUint8Array([new Uint8Array([64]),a]),{publicKey:a,sharedKey:i}}case"web":if(r.web&&_.getWebCrypto())try{return await async function(t,n){const i=I1(t.payloadSize,t.web.web,n);let a=Tr.generateKey({name:"ECDH",namedCurve:t.web.web},!0,["deriveKey","deriveBits"]),s=Tr.importKey("jwk",i,{name:"ECDH",namedCurve:t.web.web},!1,[]);[a,s]=await Promise.all([a,s]);let o=Tr.deriveBits({name:"ECDH",namedCurve:t.web.web,public:s},a.privateKey,t.web.sharedSize),u=Tr.exportKey("jwk",a.publicKey);[o,u]=await Promise.all([o,u]);const c=new Uint8Array(o);return{publicKey:new Uint8Array(Ao(u)),sharedKey:c}}(r,e)}catch(t){_.printDebugError(t)}break;case"node":return async function(t,n){const i=Uo.createECDH(t.node.node);i.generateKeys();const a=new Uint8Array(i.computeSecret(n));return{publicKey:new Uint8Array(i.getPublicKey()),sharedKey:a}}(r,e)}return async function(t,n){const i=await Bn(t.name),a=await t.genKeyPair();n=C1(i,n);const s=D1(i,a.privateKey),o=a.publicKey,u=s.derive(n.getPublic()),c=i.curve.p.byteLength(),h=u.toArrayLike(Uint8Array,"be",c);return{publicKey:o,sharedKey:h}}(r,e)}async function Ko(r,e,t,n){if(n.length!==r.payloadSize){const i=new Uint8Array(r.payloadSize);i.set(n,r.payloadSize-n.length),n=i}switch(r.type){case"curve25519":{const i=n.slice().reverse();return{secretKey:i,sharedKey:ee.scalarMult(i,e.subarray(1))}}case"web":if(r.web&&_.getWebCrypto())try{return await async function(i,a,s,o){const u=_o(i.payloadSize,i.web.web,s,o);let c=Tr.importKey("jwk",u,{name:"ECDH",namedCurve:i.web.web},!0,["deriveKey","deriveBits"]);const h=I1(i.payloadSize,i.web.web,a);let l=Tr.importKey("jwk",h,{name:"ECDH",namedCurve:i.web.web},!0,[]);[c,l]=await Promise.all([c,l]);let w=Tr.deriveBits({name:"ECDH",namedCurve:i.web.web,public:l},c,i.web.sharedSize),y=Tr.exportKey("jwk",c);[w,y]=await Promise.all([w,y]);const K=new Uint8Array(w);return{secretKey:fr(y.d),sharedKey:K}}(r,e,t,n)}catch(i){_.printDebugError(i)}break;case"node":return async function(i,a,s){const o=Uo.createECDH(i.node.node);o.setPrivateKey(s);const u=new Uint8Array(o.computeSecret(a));return{secretKey:new Uint8Array(o.getPrivateKey()),sharedKey:u}}(r,e,n)}return async function(i,a,s){const o=await Bn(i.name);a=C1(o,a),s=D1(o,s);const u=new Uint8Array(s.getPrivate()),c=s.derive(a.getPublic()),h=o.curve.p.byteLength(),l=c.toArrayLike(Uint8Array,"be",h);return{secretKey:u,sharedKey:l}}(r,e,n)}var V3=Object.freeze({__proto__:null,validateParams:async function(r,e,t){return vo(p.publicKey.ecdh,r,e,t)},encrypt:async function(r,e,t,n,i){const a=So(t),s=new kr(r),{publicKey:o,sharedKey:u}=await W3(s,n),c=i0(p.publicKey.ecdh,r,e,i),{keySize:h}=er(e.cipher);return{publicKey:o,wrappedKey:Ja(await a0(e.hash,u,h,c),a)}},decrypt:async function(r,e,t,n,i,a,s){const o=new kr(r),{sharedKey:u}=await Ko(o,t,i,a),c=i0(p.publicKey.ecdh,r,e,s),{keySize:h}=er(e.cipher);let l;for(let w=0;w<3;w++)try{return Po(ts(await a0(e.hash,u,h,c,w===1,w===2),n))}catch(y){l=y}throw l}});const s0=_.getWebCrypto(),oi=_.getNodeCrypto(),o0=oi&&oi.webcrypto&&oi.webcrypto.subtle;async function c0(r,e,t,n,i){const a=p.read(p.webHash,r);if(!a)throw Error("Hash algo not supported with HKDF");if(s0||o0){const s=s0||o0,o=await s.importKey("raw",e,"HKDF",!1,["deriveBits"]),u=await s.deriveBits({name:"HKDF",hash:a,salt:t,info:n},o,8*i);return new Uint8Array(u)}if(oi){const s=p.read(p.hash,r),o=(y,K)=>oi.createHmac(s,y).update(K).digest(),u=o(t,e),c=u.length,h=Math.ceil(i/c),l=new Uint8Array(h*c),w=new Uint8Array(c+n.length+1);w.set(n,c);for(let y=0;y0?w:w.subarray(c));w.set(K,0),l.set(K,y*c)}return l.subarray(0,i)}throw Error("No HKDF implementation available")}const u0={x25519:_.encodeUTF8("OpenPGP X25519")};var Z3=Object.freeze({__proto__:null,generate:async function(r){if(r===p.publicKey.x25519){const e=Ee(32),{publicKey:t}=ee.box.keyPair.fromSecretKey(e);return{A:t,k:e}}throw Error("Unsupported ECDH algorithm")},validateParams:async function(r,e,t){if(r===p.publicKey.x25519){const{publicKey:n}=ee.box.keyPair.fromSecretKey(t);return _.equalsUint8Array(e,n)}return!1},encrypt:async function(r,e,t){if(r===p.publicKey.x25519){const n=Ee(32),i=ee.scalarMult(n,t),{publicKey:a}=ee.box.keyPair.fromSecretKey(n),s=_.concatUint8Array([a,t,i]),{keySize:o}=er(p.symmetric.aes128);return{ephemeralPublicKey:a,wrappedKey:Ja(await c0(p.hash.sha256,s,new Uint8Array,u0.x25519,o),e)}}throw Error("Unsupported ECDH algorithm")},decrypt:async function(r,e,t,n,i){if(r===p.publicKey.x25519){const a=ee.scalarMult(i,e),s=_.concatUint8Array([e,n,a]),{keySize:o}=er(p.symmetric.aes128);return ts(await c0(p.hash.sha256,s,new Uint8Array,u0.x25519,o),t)}throw Error("Unsupported ECDH algorithm")}}),X3=Object.freeze({__proto__:null,CurveWithOID:kr,ecdh:V3,ecdhX:Z3,ecdsa:F3,eddsaLegacy:H3,eddsa:j3,generate:async function(r){const e=await _.getBigInteger();r=new kr(r);const t=await r.genKeyPair(),n=new e(t.publicKey).toUint8Array(),i=new e(t.privateKey).toUint8Array("be",r.payloadSize);return{oid:r.oid,Q:n,secret:i,hash:r.hash,cipher:r.cipher}},getPreferredHashAlgo:function(r){return Zi[p.write(p.curve,r.toHex())].hash}}),Y3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){const s=await _.getBigInteger(),o=new s(1);let u,c,h,l;n=new s(n),i=new s(i),t=new s(t),a=new s(a),t=t.mod(n),a=a.mod(i);const w=new s(e.subarray(0,i.byteLength())).mod(i);for(;;){if(u=await br(o,i),c=t.modExp(u,n).imod(i),c.isZero())continue;const y=a.mul(c).imod(i);if(l=w.add(y).imod(i),h=u.modInv(i).imul(l).imod(i),!h.isZero())break}return{r:c.toUint8Array("be",i.byteLength()),s:h.toUint8Array("be",i.byteLength())}},verify:async function(r,e,t,n,i,a,s,o){const u=await _.getBigInteger(),c=new u(0);if(e=new u(e),t=new u(t),a=new u(a),s=new u(s),i=new u(i),o=new u(o),e.lte(c)||e.gte(s)||t.lte(c)||t.gte(s))return _.printDebug("invalid DSA Signature"),!1;const h=new u(n.subarray(0,s.byteLength())).imod(s),l=t.modInv(s);if(l.isZero())return _.printDebug("invalid DSA Signature"),!1;i=i.mod(a),o=o.mod(a);const w=h.mul(l).imod(s),y=e.mul(l).imod(s),K=i.modExp(w,a),C=o.modExp(y,a);return K.mul(C).imod(a).imod(s).equal(e)},validateParams:async function(r,e,t,n,i){const a=await _.getBigInteger();r=new a(r),e=new a(e),t=new a(t),n=new a(n);const s=new a(1);if(t.lte(s)||t.gte(r)||!r.dec().mod(e).isZero()||!t.modExp(e,r).isOne())return!1;const o=new a(e.bitLength()),u=new a(150);if(o.lt(u)||!await mo(e,null,32))return!1;i=new a(i);const c=new a(2),h=await br(c.leftShift(o.dec()),c.leftShift(o)),l=e.mul(h).add(i);return!!n.equal(t.modExp(l,r))}}),Tt={rsa:R3,elgamal:z3,elliptic:X3,dsa:Y3,nacl:ee},Q3=Object.freeze({__proto__:null,parseSignatureParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:return{s:_.readMPI(e.subarray(t))};case p.publicKey.dsa:case p.publicKey.ecdsa:{const n=_.readMPI(e.subarray(t));return t+=n.length+2,{r:n,s:_.readMPI(e.subarray(t))}}case p.publicKey.eddsaLegacy:{let n=_.readMPI(e.subarray(t));t+=n.length+2,n=_.leftPad(n,32);let i=_.readMPI(e.subarray(t));return i=_.leftPad(i,32),{r:n,s:i}}case p.publicKey.ed25519:{const n=e.subarray(t,t+64);return t+=n.length,{RS:n}}default:throw new re("Unknown signature algorithm.")}},verify:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=n,u=_.leftPad(t.s,s.length);return Tt.rsa.verify(e,i,u,s,o,a)}case p.publicKey.dsa:{const{g:s,p:o,q:u,y:c}=n,{r:h,s:l}=t;return Tt.dsa.verify(e,h,l,a,s,o,u,c)}case p.publicKey.ecdsa:{const{oid:s,Q:o}=n,u=new Tt.elliptic.CurveWithOID(s).payloadSize,c=_.leftPad(t.r,u),h=_.leftPad(t.s,u);return Tt.elliptic.ecdsa.verify(s,e,{r:c,s:h},i,o,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=n;return Tt.elliptic.eddsaLegacy.verify(s,e,t,i,o,a)}case p.publicKey.ed25519:{const{A:s}=n;return Tt.elliptic.eddsa.verify(r,e,t,i,s,a)}default:throw Error("Unknown signature algorithm.")}},sign:async function(r,e,t,n,i,a){if(!t||!n)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:case p.publicKey.rsaSign:{const{n:s,e:o}=t,{d:u,p:c,q:h,u:l}=n;return{s:await Tt.rsa.sign(e,i,s,o,u,c,h,l,a)}}case p.publicKey.dsa:{const{g:s,p:o,q:u}=t,{x:c}=n;return Tt.dsa.sign(e,a,s,o,u,c)}case p.publicKey.elgamal:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");case p.publicKey.ecdsa:{const{oid:s,Q:o}=t,{d:u}=n;return Tt.elliptic.ecdsa.sign(s,e,i,o,u,a)}case p.publicKey.eddsaLegacy:{const{oid:s,Q:o}=t,{seed:u}=n;return Tt.elliptic.eddsaLegacy.sign(s,e,i,o,u,a)}case p.publicKey.ed25519:{const{A:s}=t,{seed:o}=n;return Tt.elliptic.eddsa.sign(r,e,i,s,o,a)}default:throw Error("Unknown signature algorithm.")}}});class h0{constructor(e){e&&(this.data=e)}read(e){if(e.length>=1){const t=e[0];if(e.length>=1+t)return this.data=e.subarray(1,1+t),1+this.data.length}throw Error("Invalid symmetric key")}write(){return _.concatUint8Array([new Uint8Array([this.data.length]),this.data])}}class l0{constructor(e){if(e){const{hash:t,cipher:n}=e;this.hash=t,this.cipher=n}else this.hash=null,this.cipher=null}read(e){if(e.length<4||e[0]!==3||e[1]!==1)throw new re("Cannot read KDFParams");return this.hash=e[2],this.cipher=e[3],4}write(){return new Uint8Array([3,1,this.hash,this.cipher])}}class y1{static fromObject({wrappedKey:e,algorithm:t}){const n=new y1;return n.wrappedKey=e,n.algorithm=t,n}read(e){let t=0,n=e[t++];this.algorithm=n%2?e[t++]:null,n-=n%2,this.wrappedKey=e.subarray(t,t+n),t+=n}write(){return _.concatUint8Array([this.algorithm?new Uint8Array([this.wrappedKey.length+1,this.algorithm]):new Uint8Array([this.wrappedKey.length]),this.wrappedKey])}}function ea(r){try{r.getName()}catch{throw new re("Unknown curve OID")}}var J3=Object.freeze({__proto__:null,publicKeyEncrypt:async function(r,e,t,n,i){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:{const{n:a,e:s}=t;return{c:await Tt.rsa.encrypt(n,a,s)}}case p.publicKey.elgamal:{const{p:a,g:s,y:o}=t;return Tt.elgamal.encrypt(n,a,s,o)}case p.publicKey.ecdh:{const{oid:a,Q:s,kdfParams:o}=t,{publicKey:u,wrappedKey:c}=await Tt.elliptic.ecdh.encrypt(a,o,n,s,i);return{V:u,C:new h0(c)}}case p.publicKey.x25519:{if(!_.isAES(e))throw Error("X25519 keys can only encrypt AES session keys");const{A:a}=t,{ephemeralPublicKey:s,wrappedKey:o}=await Tt.elliptic.ecdhX.encrypt(r,n,a);return{ephemeralPublicKey:s,C:y1.fromObject({algorithm:e,wrappedKey:o})}}default:return[]}},publicKeyDecrypt:async function(r,e,t,n,i,a){switch(r){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaEncrypt:{const{c:s}=n,{n:o,e:u}=e,{d:c,p:h,q:l,u:w}=t;return Tt.rsa.decrypt(s,o,u,c,h,l,w,a)}case p.publicKey.elgamal:{const{c1:s,c2:o}=n,u=e.p,c=t.x;return Tt.elgamal.decrypt(s,o,u,c,a)}case p.publicKey.ecdh:{const{oid:s,Q:o,kdfParams:u}=e,{d:c}=t,{V:h,C:l}=n;return Tt.elliptic.ecdh.decrypt(s,u,h,l.data,o,c,i)}case p.publicKey.x25519:{const{A:s}=e,{k:o}=t,{ephemeralPublicKey:u,C:c}=n;if(!_.isAES(c.algorithm))throw Error("AES session key expected");return Tt.elliptic.ecdhX.decrypt(r,u,c.wrappedKey,s,o)}default:throw Error("Unknown public key encryption algorithm.")}},parsePublicKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{n,e:i}}}case p.publicKey.dsa:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=_.readMPI(e.subarray(t));t+=a.length+2;const s=_.readMPI(e.subarray(t));return t+=s.length+2,{read:t,publicParams:{p:n,q:i,g:a,y:s}}}case p.publicKey.elgamal:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=_.readMPI(e.subarray(t));return t+=a.length+2,{read:t,publicParams:{p:n,g:i,y:a}}}case p.publicKey.ecdsa:{const n=new We;t+=n.read(e),ea(n);const i=_.readMPI(e.subarray(t));return t+=i.length+2,{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.eddsaLegacy:{const n=new We;t+=n.read(e),ea(n);let i=_.readMPI(e.subarray(t));return t+=i.length+2,i=_.leftPad(i,33),{read:t,publicParams:{oid:n,Q:i}}}case p.publicKey.ecdh:{const n=new We;t+=n.read(e),ea(n);const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=new l0;return t+=a.read(e.subarray(t)),{read:t,publicParams:{oid:n,Q:i,kdfParams:a}}}case p.publicKey.ed25519:case p.publicKey.x25519:{const n=e.subarray(t,t+32);return t+=n.length,{read:t,publicParams:{A:n}}}default:throw new re("Unknown public key encryption algorithm.")}},parsePrivateKeyParams:function(r,e,t){let n=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const i=_.readMPI(e.subarray(n));n+=i.length+2;const a=_.readMPI(e.subarray(n));n+=a.length+2;const s=_.readMPI(e.subarray(n));n+=s.length+2;const o=_.readMPI(e.subarray(n));return n+=o.length+2,{read:n,privateParams:{d:i,p:a,q:s,u:o}}}case p.publicKey.dsa:case p.publicKey.elgamal:{const i=_.readMPI(e.subarray(n));return n+=i.length+2,{read:n,privateParams:{x:i}}}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const i=new kr(t.oid);let a=_.readMPI(e.subarray(n));return n+=a.length+2,a=_.leftPad(a,i.payloadSize),{read:n,privateParams:{d:a}}}case p.publicKey.eddsaLegacy:{const i=new kr(t.oid);let a=_.readMPI(e.subarray(n));return n+=a.length+2,a=_.leftPad(a,i.payloadSize),{read:n,privateParams:{seed:a}}}case p.publicKey.ed25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{seed:i}}}case p.publicKey.x25519:{const i=e.subarray(n,n+32);return n+=i.length,{read:n,privateParams:{k:i}}}default:throw new re("Unknown public key encryption algorithm.")}},parseEncSessionKeyParams:function(r,e){let t=0;switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:return{c:_.readMPI(e.subarray(t))};case p.publicKey.elgamal:{const n=_.readMPI(e.subarray(t));return t+=n.length+2,{c1:n,c2:_.readMPI(e.subarray(t))}}case p.publicKey.ecdh:{const n=_.readMPI(e.subarray(t));t+=n.length+2;const i=new h0;return i.read(e.subarray(t)),{V:n,C:i}}case p.publicKey.x25519:{const n=e.subarray(t,t+32);t+=n.length;const i=new y1;return i.read(e.subarray(t)),{ephemeralPublicKey:n,C:i}}default:throw new re("Unknown public key encryption algorithm.")}},serializeParams:function(r,e){const t=new Set([p.publicKey.ed25519,p.publicKey.x25519]),n=Object.keys(e).map(i=>{const a=e[i];return _.isUint8Array(a)?t.has(r)?a:_.uint8ArrayToMPI(a):a.write()});return _.concatUint8Array(n)},generateParams:function(r,e,t){switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:return Tt.rsa.generate(e,65537).then(({n,e:i,d:a,p:s,q:o,u})=>({privateParams:{d:a,p:s,q:o,u},publicParams:{n,e:i}}));case p.publicKey.ecdsa:return Tt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{d:a},publicParams:{oid:new We(n),Q:i}}));case p.publicKey.eddsaLegacy:return Tt.elliptic.generate(t).then(({oid:n,Q:i,secret:a})=>({privateParams:{seed:a},publicParams:{oid:new We(n),Q:i}}));case p.publicKey.ecdh:return Tt.elliptic.generate(t).then(({oid:n,Q:i,secret:a,hash:s,cipher:o})=>({privateParams:{d:a},publicParams:{oid:new We(n),Q:i,kdfParams:new l0({hash:s,cipher:o})}}));case p.publicKey.ed25519:return Tt.elliptic.eddsa.generate(r).then(({A:n,seed:i})=>({privateParams:{seed:i},publicParams:{A:n}}));case p.publicKey.x25519:return Tt.elliptic.ecdhX.generate(r).then(({A:n,k:i})=>({privateParams:{k:i},publicParams:{A:n}}));case p.publicKey.dsa:case p.publicKey.elgamal:throw Error("Unsupported algorithm for key generation.");default:throw Error("Unknown public key algorithm.")}},validateParams:async function(r,e,t){if(!e||!t)throw Error("Missing key parameters");switch(r){case p.publicKey.rsaEncrypt:case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:{const{n,e:i}=e,{d:a,p:s,q:o,u}=t;return Tt.rsa.validateParams(n,i,a,s,o,u)}case p.publicKey.dsa:{const{p:n,q:i,g:a,y:s}=e,{x:o}=t;return Tt.dsa.validateParams(n,i,a,s,o)}case p.publicKey.elgamal:{const{p:n,g:i,y:a}=e,{x:s}=t;return Tt.elgamal.validateParams(n,i,a,s)}case p.publicKey.ecdsa:case p.publicKey.ecdh:{const n=Tt.elliptic[p.read(p.publicKey,r)],{oid:i,Q:a}=e,{d:s}=t;return n.validateParams(i,a,s)}case p.publicKey.eddsaLegacy:{const{Q:n,oid:i}=e,{seed:a}=t;return Tt.elliptic.eddsaLegacy.validateParams(i,n,a)}case p.publicKey.ed25519:{const{A:n}=e,{seed:i}=t;return Tt.elliptic.eddsa.validateParams(r,n,i)}case p.publicKey.x25519:{const{A:n}=e,{k:i}=t;return Tt.elliptic.ecdhX.validateParams(r,n,i)}default:throw Error("Unknown public key algorithm.")}},getPrefixRandom:async function(r){const{blockSize:e}=er(r),t=await Ee(e),n=new Uint8Array([t[t.length-2],t[t.length-1]]);return _.concat([t,n])},generateSessionKey:function(r){const{keySize:e}=er(r);return Ee(e)},getAEADMode:function(r){const e=p.read(p.aead,r);return go[e]},getCipher:er,getPreferredCurveHashAlgo:function(r,e){switch(r){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:return Tt.elliptic.getPreferredHashAlgo(e);case p.publicKey.ed25519:return Tt.elliptic.eddsa.getPreferredHashAlgo(r);default:throw Error("Unknown elliptic signing algo")}}});const Bt={cipher:Si,hash:Ke,mode:go,publicKey:Tt,signature:Q3,random:I3,pkcs1:B3,pkcs5:G3,aesKW:q3};Object.assign(Bt,J3);var Ki=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function xo(r,e){return r.length===e?r:r.subarray?r.subarray(0,e):(r.length=e,r)}const Do={arraySet:function(r,e,t,n,i){if(e.subarray&&r.subarray)r.set(e.subarray(t,t+n),i);else for(let a=0;a=0;)r[e]=0}const i6=0,zo=1,a6=2,rs=29,xi=256,mi=xi+1+rs,En=30,ns=19,g0=2*mi+1,Yr=15,na=16,s6=7,is=256,Lo=16,Oo=17,No=18,Ta=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Xi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o6=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],m0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],lr=Array(2*(mi+2));zn(lr);const ui=Array(2*En);zn(ui);const wi=Array(512);zn(wi);const bi=Array(256);zn(bi);const as=Array(rs);zn(as);const g1=Array(En);function ia(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let w0,b0,k0;function aa(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}function Mo(r){return r<256?wi[r]:wi[256+(r>>>7)]}function ki(r,e){r.pending_buf[r.pending++]=255&e,r.pending_buf[r.pending++]=e>>>8&255}function ke(r,e,t){r.bi_valid>na-t?(r.bi_buf|=e<>na-r.bi_valid,r.bi_valid+=t-na):(r.bi_buf|=e<>>=1,t<<=1;while(--e>0);return t>>>1}function Fo(r,e,t){const n=Array(Yr+1);let i,a,s=0;for(i=1;i<=Yr;i++)n[i]=s=s+t[i-1]<<1;for(a=0;a<=e;a++){const o=r[2*a+1];o!==0&&(r[2*a]=$o(n[o]++,o))}}function Ho(r){let e;for(e=0;e8?ki(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0}function v0(r,e,t,n){const i=2*e,a=2*t;return r[i]>1;s>=1;s--)sa(r,t,s);u=a;do s=r.heap[1],r.heap[1]=r.heap[r.heap_len--],sa(r,t,1),o=r.heap[1],r.heap[--r.heap_max]=s,r.heap[--r.heap_max]=o,t[2*u]=t[2*s]+t[2*o],r.depth[u]=(r.depth[s]>=r.depth[o]?r.depth[s]:r.depth[o])+1,t[2*s+1]=t[2*o+1]=u,r.heap[1]=u++,sa(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],function(h,l){const w=l.dyn_tree,y=l.max_code,K=l.stat_desc.static_tree,C=l.stat_desc.has_stree,O=l.stat_desc.extra_bits,F=l.stat_desc.extra_base,Y=l.stat_desc.max_length;let $,E,W,H,j,V,Z=0;for(H=0;H<=Yr;H++)h.bl_count[H]=0;for(w[2*h.heap[h.heap_max]+1]=0,$=h.heap_max+1;$Y&&(H=Y,Z++),w[2*E+1]=H,E>y||(h.bl_count[H]++,j=0,E>=F&&(j=O[E-F]),V=w[2*E],h.opt_len+=V*(H+j),C&&(h.static_len+=V*(K[2*E+1]+j)));if(Z!==0){do{for(H=Y-1;h.bl_count[H]===0;)H--;h.bl_count[H]--,h.bl_count[H+1]+=2,h.bl_count[Y]--,Z-=2}while(Z>0);for(H=Y;H!==0;H--)for(E=h.bl_count[H];E!==0;)W=h.heap[--$],W>y||(w[2*W+1]!==H&&(h.opt_len+=(H-w[2*W+1])*w[2*W],w[2*W+1]=H),E--)}}(r,e),Fo(t,c,r.bl_count)}function _0(r,e,t){let n,i,a=-1,s=e[1],o=0,u=7,c=4;for(s===0&&(u=138,c=3),e[2*(t+1)+1]=65535,n=0;n<=t;n++)i=s,s=e[2*(n+1)+1],++o>=7;i=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(r)}function h6(r,e,t,n){let i,a,s=0;r.level>0?(r.strm.data_type===Ro&&(r.strm.data_type=function(o){let u,c=4093624447;for(u=0;u<=31;u++,c>>>=1)if(1&c&&o.dyn_ltree[2*u]!==0)return y0;if(o.dyn_ltree[18]!==0||o.dyn_ltree[20]!==0||o.dyn_ltree[26]!==0)return p0;for(u=32;u=3&&o.bl_tree[2*m0[u]+1]===0;u--);return o.opt_len+=3*(u+1)+5+5+4,u}(r),i=r.opt_len+3+7>>>3,a=r.static_len+3+7>>>3,a<=i&&(i=a)):i=a=t+5,t+4<=i&&e!==-1?qo(r,e,t,n):r.strategy===Bo||a===i?(ke(r,(zo<<1)+(n?1:0),3),A0(r,lr,ui)):(ke(r,(a6<<1)+(n?1:0),3),function(o,u,c,h){let l;for(ke(o,u-257,5),ke(o,c-1,5),ke(o,h-4,4),l=0;l>>8&255,r.pending_buf[r.d_buf+2*r.last_lit+1]=255&e,r.pending_buf[r.l_buf+r.last_lit]=255&t,r.last_lit++,e===0?r.dyn_ltree[2*t]++:(r.matches++,e--,r.dyn_ltree[2*(bi[t]+xi+1)]++,r.dyn_dtree[2*Mo(e)]++),r.last_lit===r.lit_bufsize-1}function vi(r,e,t,n){let i=65535&r|0,a=r>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do i=i+e[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}const l6=function(){let r;const e=[];for(let t=0;t<256;t++){r=t;for(let n=0;n<8;n++)r=1&r?3988292384^r>>>1:r>>>1;e[t]=r}return e}();function ie(r,e,t,n){const i=l6,a=n+t;r^=-1;for(let s=n;s>>8^i[255&(r^e[s])];return-1^r}var Ai={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};const f6=9,Rt=3,Br=258,Le=Br+Rt+1,d6=32,m1=42,Ba=69,Yi=73,Qi=91,Ji=103,Qr=113,ti=666,ae=1,hi=2,Jr=3,Sn=4,y6=3;function Rr(r,e){return r.msg=Ai[e],e}function P0(r){return(r<<1)-(r>4?9:0)}function Cr(r){let e=r.length;for(;--e>=0;)r[e]=0}function Kr(r){const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(nr(r.output,e.pending_buf,e.pending_out,t,r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))}function ue(r,e){h6(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Kr(r.strm)}function Ot(r,e){r.pending_buf[r.pending++]=e}function Hn(r,e){r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=255&e}function p6(r,e,t,n){let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,nr(e,r.input,r.next_in,i,t),r.state.wrap===1?r.adler=vi(r.adler,e,i,t):r.state.wrap===2&&(r.adler=ie(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)}function Go(r,e){let t,n,i=r.max_chain_length,a=r.strstart,s=r.prev_length,o=r.nice_match;const u=r.strstart>r.w_size-Le?r.strstart-(r.w_size-Le):0,c=r.window,h=r.w_mask,l=r.prev,w=r.strstart+Br;let y=c[a+s-1],K=c[a+s];r.prev_length>=r.good_match&&(i>>=2),o>r.lookahead&&(o=r.lookahead);do if(t=e,c[t+s]===K&&c[t+s-1]===y&&c[t]===c[a]&&c[++t]===c[a+1]){a+=2,t++;do;while(c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&c[++a]===c[++t]&&as){if(r.match_start=e,s=n,n>=o)break;y=c[a+s-1],K=c[a+s]}}while((e=l[e&h])>u&&--i!=0);return s<=r.lookahead?s:r.lookahead}function nn(r){const e=r.w_size;let t,n,i,a,s;do{if(a=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-Le)){nr(r.window,r.window,e,e,0),r.match_start-=e,r.strstart-=e,r.block_start-=e,n=r.hash_size,t=n;do i=r.head[--t],r.head[t]=i>=e?i-e:0;while(--n);n=e,t=n;do i=r.prev[--t],r.prev[t]=i>=e?i-e:0;while(--n);a+=e}if(r.strm.avail_in===0)break;if(n=p6(r.strm,r.window,r.strstart+r.lookahead,a),r.lookahead+=n,r.lookahead+r.insert>=Rt)for(s=r.strstart-r.insert,r.ins_h=r.window[s],r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<=Rt)if(n=zr(r,r.strstart-r.match_start,r.match_length-Rt),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=Rt){r.match_length--;do r.strstart++,r.ins_h=(r.ins_h<=Rt&&(r.ins_h=(r.ins_h<4096)&&(r.match_length=Rt-1)),r.prev_length>=Rt&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-Rt,n=zr(r,r.strstart-1-r.prev_match,r.prev_length-Rt),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=(r.ins_h<r.pending_buf_size-5&&(t=r.pending_buf_size-5);;){if(r.lookahead<=1){if(nn(r),r.lookahead===0&&e===ir)return ae;if(r.lookahead===0)break}r.strstart+=r.lookahead,r.lookahead=0;const n=r.block_start+t;if((r.strstart===0||r.strstart>=n)&&(r.lookahead=r.strstart-n,r.strstart=n,ue(r,!1),r.strm.avail_out===0)||r.strstart-r.block_start>=r.w_size-Le&&(ue(r,!1),r.strm.avail_out===0))return ae}return r.insert=0,e===oe?(ue(r,!0),r.strm.avail_out===0?Jr:Sn):(r.strstart>r.block_start&&(ue(r,!1),r.strm.avail_out),ae)}),new Fe(4,4,8,4,ca),new Fe(4,5,16,8,ca),new Fe(4,6,32,32,ca),new Fe(4,4,16,16,pn),new Fe(8,16,32,32,pn),new Fe(8,16,128,128,pn),new Fe(8,32,128,256,pn),new Fe(32,128,258,1024,pn),new Fe(32,258,258,4096,pn)];class g6{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Dn,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Pe(1146),this.dyn_dtree=new Pe(122),this.bl_tree=new Pe(78),Cr(this.dyn_ltree),Cr(this.dyn_dtree),Cr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Pe(16),this.heap=new Pe(573),Cr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Pe(573),Cr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}}function m6(r){const e=function(t){let n;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Ro,n=t.state,n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?m1:Qr,t.adler=n.wrap===2?0:1,n.last_flush=ir,c6(n),Ft):Rr(t,te)}(r);return e===Ft&&function(t){t.window_size=2*t.w_size,Cr(t.head),t.max_lazy_match=ei[t.level].max_lazy,t.good_match=ei[t.level].good_length,t.nice_match=ei[t.level].nice_length,t.max_chain_length=ei[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Rt-1,t.match_available=0,t.ins_h=0}(r.state),e}function w6(r,e){let t,n,i,a;if(!r||!r.state||e>f0||e<0)return r?Rr(r,te):te;if(n=r.state,!r.output||!r.input&&r.avail_in!==0||n.status===ti&&e!==oe)return Rr(r,r.avail_out===0?ci:te);if(n.strm=r,t=n.last_flush,n.last_flush=e,n.status===m1)if(n.wrap===2)r.adler=0,Ot(n,31),Ot(n,139),Ot(n,8),n.gzhead?(Ot(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ot(n,255&n.gzhead.time),Ot(n,n.gzhead.time>>8&255),Ot(n,n.gzhead.time>>16&255),Ot(n,n.gzhead.time>>24&255),Ot(n,n.level===9?2:n.strategy>=Fi||n.level<2?4:0),Ot(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ot(n,255&n.gzhead.extra.length),Ot(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(r.adler=ie(r.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Ba):(Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,0),Ot(n,n.level===9?2:n.strategy>=Fi||n.level<2?4:0),Ot(n,y6),n.status=Qr);else{let o=Dn+(n.w_bits-8<<4)<<8,u=-1;u=n.strategy>=Fi||n.level<2?0:n.level<6?1:n.level===6?2:3,o|=u<<6,n.strstart!==0&&(o|=d6),o+=31-o%31,n.status=Qr,Hn(n,o),n.strstart!==0&&(Hn(n,r.adler>>>16),Hn(n,65535&r.adler)),r.adler=1}if(n.status===Ba)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Kr(r),i=n.pending,n.pending!==n.pending_buf_size));)Ot(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Yi)}else n.status=Yi;if(n.status===Yi)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Kr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.gzindex=0,n.status=Qi)}else n.status=Qi;if(n.status===Qi)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),Kr(r),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindexi&&(r.adler=ie(r.adler,n.pending_buf,n.pending-i,i)),a===0&&(n.status=Ji)}else n.status=Ji;if(n.status===Ji&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Kr(r),n.pending+2<=n.pending_buf_size&&(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),r.adler=0,n.status=Qr)):n.status=Qr),n.pending!==0){if(Kr(r),r.avail_out===0)return n.last_flush=-1,Ft}else if(r.avail_in===0&&P0(e)<=P0(t)&&e!==oe)return Rr(r,ci);if(n.status===ti&&r.avail_in!==0)return Rr(r,ci);if(r.avail_in!==0||n.lookahead!==0||e!==ir&&n.status!==ti){var s=n.strategy===Fi?function(o,u){let c;for(;;){if(o.lookahead===0&&(nn(o),o.lookahead===0)){if(u===ir)return ae;break}if(o.match_length=0,c=zr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++,c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?Jr:Sn):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:hi}(n,e):n.strategy===n6?function(o,u){let c,h,l,w;const y=o.window;for(;;){if(o.lookahead<=Br){if(nn(o),o.lookahead<=Br&&u===ir)return ae;if(o.lookahead===0)break}if(o.match_length=0,o.lookahead>=Rt&&o.strstart>0&&(l=o.strstart-1,h=y[l],h===y[++l]&&h===y[++l]&&h===y[++l])){w=o.strstart+Br;do;while(h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&h===y[++l]&&lo.lookahead&&(o.match_length=o.lookahead)}if(o.match_length>=Rt?(c=zr(o,1,o.match_length-Rt),o.lookahead-=o.match_length,o.strstart+=o.match_length,o.match_length=0):(c=zr(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++),c&&(ue(o,!1),o.strm.avail_out===0))return ae}return o.insert=0,u===oe?(ue(o,!0),o.strm.avail_out===0?Jr:Sn):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:hi}(n,e):ei[n.level].func(n,e);if(s!==Jr&&s!==Sn||(n.status=ti),s===ae||s===Jr)return r.avail_out===0&&(n.last_flush=-1),Ft;if(s===hi&&(e===t6?u6(n):e!==f0&&(qo(n,0,0,!1),e===e6&&(Cr(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Kr(r),r.avail_out===0))return n.last_flush=-1,Ft}return e!==oe?Ft:n.wrap<=0?gr:(n.wrap===2?(Ot(n,255&r.adler),Ot(n,r.adler>>8&255),Ot(n,r.adler>>16&255),Ot(n,r.adler>>24&255),Ot(n,255&r.total_in),Ot(n,r.total_in>>8&255),Ot(n,r.total_in>>16&255),Ot(n,r.total_in>>24&255)):(Hn(n,r.adler>>>16),Hn(n,65535&r.adler)),Kr(r),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ft:gr)}try{String.fromCharCode.call(null,0)}catch{}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{}const Ra=new Xe(256);for(let r=0;r<256;r++)Ra[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function za(r){let e,t,n,i,a=0;const s=r.length;for(n=0;n>>6,o[i++]=128|63&e):e<65536?(o[i++]=224|e>>>12,o[i++]=128|e>>>6&63,o[i++]=128|63&e):(o[i++]=240|e>>>18,o[i++]=128|e>>>12&63,o[i++]=128|e>>>6&63,o[i++]=128|63&e);return o}Ra[254]=Ra[254]=1;class Wo{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}}class b6{constructor(e){this.options={level:d0,method:Dn,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,...e||{}};const t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wo,this.strm.avail_out=0;var n,i,a=function(s,o,u,c,h,l){if(!s)return te;let w=1;if(o===d0&&(o=6),c<0?(w=0,c=-c):c>15&&(w=2,c-=16),h<1||h>f6||u!==Dn||c<8||c>15||o<0||o>9||l<0||l>Bo)return Rr(s,te);c===8&&(c=9);const y=new g6;return s.state=y,y.strm=s,y.wrap=w,y.gzhead=null,y.w_bits=c,y.w_size=1<=c.w_size&&(w===0&&(Cr(c.head),c.strstart=0,c.block_start=0,c.insert=0),O=new Xe(c.w_size),nr(O,u,F-c.w_size,c.w_size,0),u=O,F=c.w_size),y=o.avail_in,K=o.next_in,C=o.input,o.avail_in=F,o.next_in=0,o.input=u,nn(c);c.lookahead>=Rt;){h=c.strstart,l=c.lookahead-(Rt-1);do c.ins_h=(c.ins_h<0||n.avail_out===0)&&a!==gr);return s===oe?(a=function(o){let u;return o&&o.state?(u=o.state.status,u!==m1&&u!==Ba&&u!==Yi&&u!==Qi&&u!==Ji&&u!==Qr&&u!==ti?Rr(o,te):(o.state=null,u===Qr?Rr(o,es):Ft)):te}(this.strm),this.onEnd(a),this.ended=!0,a===Ft):s!==gi||(this.onEnd(Ft),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ft&&(this.result=Io(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const Hi=30,k6=12;function v6(r,e){let t,n,i,a,s,o,u,c,h,l;const w=r.state;t=r.next_in;const y=r.input,K=t+(r.avail_in-5);n=r.next_out;const C=r.output,O=n-(e-r.avail_out),F=n+(r.avail_out-257),Y=w.dmax,$=w.wsize,E=w.whave,W=w.wnext,H=w.window;i=w.hold,a=w.bits;const j=w.lencode,V=w.distcode,Z=(1<>>24,i>>>=o,a-=o,o=s>>>16&255,o===0)C[n++]=65535&s;else{if(!(16&o)){if(!(64&o)){s=j[(65535&s)+(i&(1<>>=o,a-=o),a<15&&(i+=y[t++]<>>24,i>>>=o,a-=o,o=s>>>16&255,!(16&o)){if(!(64&o)){s=V[(65535&s)+(i&(1<Y){r.msg="invalid distance too far back",w.mode=Hi;break t}if(i>>>=o,a-=o,o=n-O,c>o){if(o=c-o,o>E&&w.sane){r.msg="invalid distance too far back",w.mode=Hi;break t}if(h=0,l=H,W===0){if(h+=$-o,o2;)C[n++]=l[h++],C[n++]=l[h++],C[n++]=l[h++],u-=3;u&&(C[n++]=l[h++],u>1&&(C[n++]=l[h++]))}else{h=n-c;do C[n++]=C[h++],C[n++]=C[h++],C[n++]=C[h++],u-=3;while(u>2);u&&(C[n++]=C[h++],u>1&&(C[n++]=C[h++]))}break}}break}}while(t>3,t-=u,a-=u<<3,i&=(1<=1&&tt[F]===0;F--);if(Y>F&&(Y=F),F===0)return i[a++]=20971520,i[a++]=20971520,o.bits=1,0;for(O=1;O0&&(r===x0||F!==1))return-1;for(rt[1]=0,K=1;KU0||r===D0&&H>K0)return 1;for(;;){dt=K-E,s[C]y?(lt=ft[Pt+s[C]],N=V[Z+s[C]]):(lt=96,N=0),c=1<>E)+h]=dt<<24|lt<<16|N|0;while(h!==0);for(c=1<>=1;if(c!==0?(j&=c-1,j+=c):j=0,C++,--tt[K]==0){if(K===F)break;K=e[t+s[C]]}if(K>Y&&(j&q)!==l){for(E===0&&(E=Y),w+=O,$=K-E,W=1<<$;$+EU0||r===D0&&H>K0)return 1;l=j&q,i[l]=Y<<24|$<<16|w-a|0}}return j!==0&&(i[w+j]=K-E<<24|64<<16|0),o.bits=Y,0}const P6=0,Vo=1,Zo=2,Xo=1,C0=2,I0=3,T0=4,B0=5,R0=6,z0=7,L0=8,O0=9,N0=10,w1=11,cr=12,ha=13,M0=14,la=15,$0=16,F0=17,H0=18,j0=19,ji=20,qi=21,q0=22,G0=23,W0=24,V0=25,Z0=26,fa=27,X0=28,Y0=29,Zt=30,U6=852,K6=592;function Q0(r){return(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24)}class x6{constructor(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Pe(320),this.work=new Pe(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}}function D6(r){let e;return r&&r.state?(e=r.state,e.wsize=0,e.whave=0,e.wnext=0,function(t){let n;return t&&t.state?(n=t.state,t.total_in=t.total_out=n.total=0,t.msg="",n.wrap&&(t.adler=1&n.wrap),n.mode=Xo,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new p1(U6),n.distcode=n.distdyn=new p1(K6),n.sane=1,n.back=-1,Ft):te}(r)):te}function C6(r,e){let t,n;return r?(n=new x6,r.state=n,n.window=null,t=function(i,a){let s,o;return i&&i.state?(o=i.state,a<0?(s=0,a=-a):(s=1+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?te:(o.window!==null&&o.wbits!==a&&(o.window=null),o.wrap=s,o.wbits=a,D6(i))):te}(r,e),t!==Ft&&(r.state=null),t):te}let da,ya,J0=!0;function I6(r){if(J0){let e;for(da=new p1(512),ya=new p1(32),e=0;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(li(Vo,r.lens,0,288,da,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;li(Zo,r.lens,0,32,ya,0,r.work,{bits:5}),J0=!1}r.lencode=da,r.lenbits=9,r.distcode=ya,r.distbits=5}function Yo(r,e,t,n){let i;const a=r.state;return a.window===null&&(a.wsize=1<=a.wsize?(nr(a.window,e,t-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),nr(a.window,e,t-n,i,a.wnext),(n-=i)?(nr(a.window,e,t-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,t.check=ie(t.check,rt,2,0),c=0,h=0,t.mode=C0;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&c)<<8)+(c>>8))%31){r.msg="incorrect header check",t.mode=Zt;break}if((15&c)!==Dn){r.msg="unknown compression method",t.mode=Zt;break}if(c>>>=4,h-=4,H=8+(15&c),t.wbits===0)t.wbits=H;else if(H>t.wbits){r.msg="invalid window size",t.mode=Zt;break}t.dmax=1<>8&1),512&t.flags&&(rt[0]=255&c,rt[1]=c>>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0,t.mode=I0;case I0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>8&255,rt[2]=c>>>16&255,rt[3]=c>>>24&255,t.check=ie(t.check,rt,4,0)),c=0,h=0,t.mode=T0;case T0:for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>8),512&t.flags&&(rt[0]=255&c,rt[1]=c>>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0,t.mode=B0;case B0:if(1024&t.flags){for(;h<16;){if(o===0)break t;o--,c+=n[a++]<>>8&255,t.check=ie(t.check,rt,2,0)),c=0,h=0}else t.head&&(t.head.extra=null);t.mode=R0;case R0:if(1024&t.flags&&(y=t.length,y>o&&(y=o),y&&(t.head&&(H=t.head.extra_len-t.length,t.head.extra||(t.head.extra=Array(t.head.extra_len)),nr(t.head.extra,n,a,y,H)),512&t.flags&&(t.check=ie(t.check,n,y,a)),o-=y,a+=y,t.length-=y),t.length))break t;t.length=0,t.mode=z0;case z0:if(2048&t.flags){if(o===0)break t;y=0;do H=n[a+y++],t.head&&H&&t.length<65536&&(t.head.name+=String.fromCharCode(H));while(H&&y>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=cr;break;case N0:for(;h<32;){if(o===0)break t;o--,c+=n[a++]<>>=7&h,h-=7&h,t.mode=fa;break}for(;h<3;){if(o===0)break t;o--,c+=n[a++]<>>=1,h-=1,3&c){case 0:t.mode=M0;break;case 1:I6(t),t.mode=ji;break;case 2:t.mode=F0;break;case 3:r.msg="invalid block type",t.mode=Zt}c>>>=2,h-=2;break;case M0:for(c>>>=7&h,h-=7&h;h<32;){if(o===0)break t;o--,c+=n[a++]<>>16^65535)){r.msg="invalid stored block lengths",t.mode=Zt;break}t.length=65535&c,c=0,h=0,t.mode=la;case la:t.mode=$0;case $0:if(y=t.length,y){if(y>o&&(y=o),y>u&&(y=u),y===0)break t;nr(i,n,a,y,s),o-=y,a+=y,u-=y,s+=y,t.length-=y;break}t.mode=cr;break;case F0:for(;h<14;){if(o===0)break t;o--,c+=n[a++]<>>=5,h-=5,t.ndist=1+(31&c),c>>>=5,h-=5,t.ncode=4+(15&c),c>>>=4,h-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Zt;break}t.have=0,t.mode=H0;case H0:for(;t.have>>=3,h-=3}for(;t.have<19;)t.lens[dt[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,V={bits:t.lenbits},j=li(P6,t.lens,0,19,t.lencode,0,t.work,V),t.lenbits=V.bits,j){r.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=j0;case j0:for(;t.have>>24,F=tt>>>16&255,Y=65535&tt,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=O,h-=O,t.lens[t.have++]=Y;else{if(Y===16){for(Z=O+2;h>>=O,h-=O,t.have===0){r.msg="invalid bit length repeat",t.mode=Zt;break}H=t.lens[t.have-1],y=3+(3&c),c>>>=2,h-=2}else if(Y===17){for(Z=O+3;h>>=O,h-=O,H=0,y=3+(7&c),c>>>=3,h-=3}else{for(Z=O+7;h>>=O,h-=O,H=0,y=11+(127&c),c>>>=7,h-=7}if(t.have+y>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Zt;break}for(;y--;)t.lens[t.have++]=H}}if(t.mode===Zt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Zt;break}if(t.lenbits=9,V={bits:t.lenbits},j=li(Vo,t.lens,0,t.nlen,t.lencode,0,t.work,V),t.lenbits=V.bits,j){r.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,V={bits:t.distbits},j=li(Zo,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,V),t.distbits=V.bits,j){r.msg="invalid distances set",t.mode=Zt;break}t.mode=ji;case ji:t.mode=qi;case qi:if(o>=6&&u>=258){r.next_out=s,r.avail_out=u,r.next_in=a,r.avail_in=o,t.hold=c,t.bits=h,v6(r,w),s=r.next_out,i=r.output,u=r.avail_out,a=r.next_in,n=r.input,o=r.avail_in,c=t.hold,h=t.bits,t.mode===cr&&(t.back=-1);break}for(t.back=0;tt=t.lencode[c&(1<>>24,F=tt>>>16&255,Y=65535&tt,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>$)],O=tt>>>24,F=tt>>>16&255,Y=65535&tt,!($+O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=$,h-=$,t.back+=$}if(c>>>=O,h-=O,t.back+=O,t.length=Y,F===0){t.mode=Z0;break}if(32&F){t.back=-1,t.mode=cr;break}if(64&F){r.msg="invalid literal/length code",t.mode=Zt;break}t.extra=15&F,t.mode=q0;case q0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=G0;case G0:for(;tt=t.distcode[c&(1<>>24,F=tt>>>16&255,Y=65535&tt,!(O<=h);){if(o===0)break t;o--,c+=n[a++]<>$)],O=tt>>>24,F=tt>>>16&255,Y=65535&tt,!($+O<=h);){if(o===0)break t;o--,c+=n[a++]<>>=$,h-=$,t.back+=$}if(c>>>=O,h-=O,t.back+=O,64&F){r.msg="invalid distance code",t.mode=Zt;break}t.offset=Y,t.extra=15&F,t.mode=W0;case W0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Zt;break}t.mode=V0;case V0:if(u===0)break t;if(y=w-u,t.offset>y){if(y=t.offset-y,y>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Zt;break}y>t.wnext?(y-=t.wnext,K=t.wsize-y):K=t.wnext-y,y>t.length&&(y=t.length),C=t.window}else C=i,K=s-t.offset,y=t.length;y>u&&(y=u),u-=y,t.length-=y;do i[s++]=C[K++];while(--y);t.length===0&&(t.mode=qi);break;case Z0:if(u===0)break t;i[s++]=t.length,u--,t.mode=qi;break;case fa:if(t.wrap){for(;h<32;){if(o===0)break t;o--,c|=n[a++]<=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wo,this.strm.avail_out=0;let n=C6(this.strm,t.windowBits);if(n!==Ft||(this.header=new B6,function(i,a){let s;i&&i.state&&(s=i.state,!(2&s.wrap)||(s.head=a,a.done=!1))}(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=za(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=t2(this.strm,t.dictionary),n!==Ft))))throw Error(Ai[n])}push(e,t){const{strm:n,options:{chunkSize:i,dictionary:a}}=this;let s,o,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?oe:ir,typeof e=="string"?n.input=function(c){const h=new Xe(c.length);for(let l=0,w=h.length;l0||n.avail_out===0)&&s!==gr);return s===gr&&(o=oe),o===oe?(s=function(c){if(!c||!c.state)return te;const h=c.state;return h.window&&(h.window=null),c.state=null,Ft}(this.strm),this.onEnd(s),this.ended=!0,s===Ft):o!==gi||(this.onEnd(Ft),n.avail_out=0,!0)}onData(e){this.chunks.push(e)}onEnd(e){e===Ft&&(this.result=Io(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var r2=[0,1,3,7,15,31,63,127,255],ri=function(r){this.stream=r,this.bitOffset=0,this.curByte=0,this.hasByte=!1};ri.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)},ri.prototype.read=function(r){for(var e=0;r>0;){this._ensureByte();var t=8-this.bitOffset;if(r>=t)e<<=t,e|=r2[t]&this.curByte,this.hasByte=!1,this.bitOffset=0,r-=t;else{e<<=r;var n=t-r;e|=(this.curByte&r2[r]<>n,this.bitOffset+=r,r=0}}return e},ri.prototype.seek=function(r){var e=r%8,t=(r-e)/8;this.bitOffset=e,this.stream.seek(t),this.hasByte=!1},ri.prototype.pi=function(){var r,e=new Uint8Array(6);for(r=0;r("00"+n.toString(16)).slice(-2)).join("")}(e)};var R6=ri,Gr=function(){};Gr.prototype.readByte=function(){throw Error("abstract method readByte() not implemented")},Gr.prototype.read=function(r,e,t){for(var n=0;n>>0},this.updateCRC=function(e){r=r<<8^pa[255&(r>>>24^e)]},this.updateCRCRun=function(e,t){for(;t-- >0;)r=r<<8^pa[255&(r>>>24^e)]}}),n2=function(r,e){var t,n=r[e];for(t=e;t>0;t--)r[t]=r[t-1];return r[0]=n,n},Xt={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},xr={};xr[Xt.LAST_BLOCK]="Bad file checksum",xr[Xt.NOT_BZIP_DATA]="Not bzip data",xr[Xt.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",xr[Xt.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",xr[Xt.DATA_ERROR]="Data error",xr[Xt.OUT_OF_MEMORY]="Out of memory",xr[Xt.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var ce=function(r,e){var t=xr[r]||"unknown error";e&&(t+=": "+e);var n=new TypeError(t);throw n.errorCode=r,n},ni=function(r,e){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(r,e)};ni.prototype._init_block=function(){return this._get_next_block()?(this.blockCRC=new z6,!0):(this.writeCount=-1,!1)},ni.prototype._start_bunzip=function(r,e){var t=new Uint8Array(4);r.read(t,0,4)===4&&String.fromCharCode(t[0],t[1],t[2])==="BZh"||ce(Xt.NOT_BZIP_DATA,"bad magic");var n=t[3]-48;(n<1||n>9)&&ce(Xt.NOT_BZIP_DATA,"level out of range"),this.reader=new R6(r),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=e,this.streamCRC=0},ni.prototype._get_next_block=function(){var r,e,t,n=this.reader,i=n.pi();if(i==="177245385090")return!1;i!=="314159265359"&&ce(Xt.NOT_BZIP_DATA),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&ce(Xt.OBSOLETE_INPUT);var a=n.read(24);a>this.dbufSize&&ce(Xt.DATA_ERROR,"initial position out of bounds");var s=n.read(16),o=new Uint8Array(256),u=0;for(r=0;r<16;r++)if(s&1<<15-r){var c=16*r;for(t=n.read(16),e=0;e<16;e++)t&1<<15-e&&(o[u++]=c+e)}var h=n.read(3);(h<2||h>6)&&ce(Xt.DATA_ERROR);var l=n.read(15);l===0&&ce(Xt.DATA_ERROR);var w=new Uint8Array(256);for(r=0;r=h&&ce(Xt.DATA_ERROR);y[r]=n2(w,e)}var K,C=u+2,O=[];for(e=0;e20)&&ce(Xt.DATA_ERROR),n.read(1);)n.read(1)?s--:s++;$[r]=s}for(F=Y=$[0],r=1;rY?Y=$[r]:$[r]=l&&ce(Xt.DATA_ERROR),K=O[y[tt++]]),r=K.minLen,e=n.read(r);r>K.maxLen&&ce(Xt.DATA_ERROR),!(e<=K.limit[r]);r++)e=e<<1|n.read(1);((e-=K.base[r])<0||e>=258)&&ce(Xt.DATA_ERROR);var dt=K.permute[e];if(dt!==0&&dt!==1){if(V)for(V=0,Z+s>this.dbufSize&&ce(Xt.DATA_ERROR),H[j=o[w[0]]]+=s;s--;)rt[Z++]=j;if(dt>u)break;Z>=this.dbufSize&&ce(Xt.DATA_ERROR),H[j=o[j=n2(w,r=dt-1)]]++,rt[Z++]=j}else V||(V=1,s=0),s+=dt===0?V:2*V,V<<=1}for((a<0||a>=Z)&&ce(Xt.DATA_ERROR),e=0,r=0;r<256;r++)t=e+H[r],H[r]=e,e=t;for(r=0;r>=8,ft=-1),this.writePos=lt,this.writeCurrent=N,this.writeCount=Z,this.writeRun=ft,!0},ni.prototype._read_bunzip=function(r,e){var t,n,i;if(this.writeCount<0)return 0;var a=this.dbuf,s=this.writePos,o=this.writeCurrent,u=this.writeCount;this.outputsize;for(var c=this.writeRun;u;){for(u--,n=o,o=255&(s=a[s]),s>>=8,c++==3?(t=o,i=n,o=-1):(t=1,i=o),this.blockCRC.updateCRCRun(i,t);t--;)this.outputStream.writeByte(i),this.nextoutput++;o!=n&&(c=0)}return this.writeCount=u,this.blockCRC.getCRC()!==this.targetBlockCRC&&ce(Xt.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var L6=function(r){if("readByte"in r)return r;var e=new Qo;return e.pos=0,e.readByte=function(){return r[this.pos++]},e.seek=function(t){this.pos=t},e.eof=function(){return this.pos>=r.length},e},O6=function(r){var e=new Qo,t=!0;if(r)if(typeof r=="number")e.buffer=new Uint8Array(r),t=!1;else{if("writeByte"in r)return r;e.buffer=r,t=!1}else e.buffer=new Uint8Array(16384);return e.pos=0,e.writeByte=function(n){if(t&&this.pos>=this.buffer.length){var i=new Uint8Array(2*this.buffer.length);i.set(this.buffer),this.buffer=i}this.buffer[this.pos++]=n},e.getBuffer=function(){if(this.pos!==this.buffer.length){if(!t)throw new TypeError("outputsize does not match decoded input");var n=new Uint8Array(this.pos);n.set(this.buffer.subarray(0,this.pos)),this.buffer=n}return this.buffer},e._coerced=!0,e},i2=function(r,e,t){for(var n=L6(r),i=O6(e),a=new ni(n,i);!("eof"in n)||!n.eof();)if(a._init_block())a._read_bunzip();else{var s=a.reader.read(32)>>>0;if(s!==a.streamCRC&&ce(Xt.DATA_ERROR,"Bad stream CRC (got "+a.streamCRC.toString(16)+" expected "+s.toString(16)+")"),!t||!("eof"in n)||n.eof())break;a._start_bunzip(n,i)}if("getBuffer"in i)return i.getBuffer()};const jn=Symbol("verified"),N6=new Set([p.signatureSubpacket.issuer,p.signatureSubpacket.issuerFingerprint,p.signatureSubpacket.embeddedSignature]);class mr{static get tag(){return p.packet.signature}constructor(){this.version=null,this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.unhashedSubpackets=[],this.signedHashValue=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=!0,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyID=new xn,this.rawNotations=[],this.notations={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserID=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.features=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.issuerKeyVersion=null,this.issuerFingerprint=null,this.preferredAEADAlgorithms=null,this.revoked=null,this[jn]=null}read(e){let t=0;if(this.version=e[t++],this.version!==4&&this.version!==5)throw new re(`Version ${this.version} of the signature packet is unsupported.`);if(this.signatureType=e[t++],this.publicKeyAlgorithm=e[t++],this.hashAlgorithm=e[t++],t+=this.readSubPackets(e.subarray(t,e.length),!0),!this.created)throw Error("Missing signature creation time subpacket.");this.signatureData=e.subarray(0,t),t+=this.readSubPackets(e.subarray(t,e.length),!1),this.signedHashValue=e.subarray(t,t+2),t+=2,this.params=Bt.signature.parseSignatureParams(this.publicKeyAlgorithm,e.subarray(t,e.length))}writeParams(){return this.params instanceof Promise?_i(async()=>Bt.serializeParams(this.publicKeyAlgorithm,await this.params)):Bt.serializeParams(this.publicKeyAlgorithm,this.params)}write(){const e=[];return e.push(this.signatureData),e.push(this.writeUnhashedSubPackets()),e.push(this.signedHashValue),e.push(this.writeParams()),_.concat(e)}async sign(e,t,n=new Date,i=!1){e.version===5?this.version=5:this.version=4;const a=[new Uint8Array([this.version,this.signatureType,this.publicKeyAlgorithm,this.hashAlgorithm])];this.created=_.normalizeDate(n),this.issuerKeyVersion=e.version,this.issuerFingerprint=e.getFingerprintBytes(),this.issuerKeyID=e.getKeyID(),a.push(this.writeHashedSubPackets()),this.unhashedSubpackets=[],this.signatureData=_.concat(a);const s=this.toHash(this.signatureType,t,i),o=await this.hash(this.signatureType,t,s,i);this.signedHashValue=_e(e1(o),0,2);const u=async()=>Bt.signature.sign(this.publicKeyAlgorithm,this.hashAlgorithm,e.publicParams,e.privateParams,s,await ar(o));_.isStream(o)?this.params=u():(this.params=await u(),this[jn]=!0)}writeHashedSubPackets(){const e=p.signatureSubpacket,t=[];let n;if(this.created===null)throw Error("Missing signature creation time");t.push(Vt(e.signatureCreationTime,!0,_.writeDate(this.created))),this.signatureExpirationTime!==null&&t.push(Vt(e.signatureExpirationTime,!0,_.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&t.push(Vt(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(n=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Vt(e.trustSignature,!0,n))),this.regularExpression!==null&&t.push(Vt(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&t.push(Vt(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&t.push(Vt(e.keyExpirationTime,!0,_.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Vt(e.preferredSymmetricAlgorithms,!1,n))),this.revocationKeyClass!==null&&(n=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),n=_.concat([n,this.revocationKeyFingerprint]),t.push(Vt(e.revocationKey,!1,n))),this.issuerKeyID.isNull()||this.issuerKeyVersion===5||t.push(Vt(e.issuer,!0,this.issuerKeyID.write())),this.rawNotations.forEach(({name:s,value:o,humanReadable:u,critical:c})=>{n=[new Uint8Array([u?128:0,0,0,0])];const h=_.encodeUTF8(s);n.push(_.writeNumber(h.length,2)),n.push(_.writeNumber(o.length,2)),n.push(h),n.push(o),n=_.concat(n),t.push(Vt(e.notationData,c,n))}),this.preferredHashAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Vt(e.preferredHashAlgorithms,!1,n))),this.preferredCompressionAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Vt(e.preferredCompressionAlgorithms,!1,n))),this.keyServerPreferences!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyServerPreferences)),t.push(Vt(e.keyServerPreferences,!1,n))),this.preferredKeyServer!==null&&t.push(Vt(e.preferredKeyServer,!1,_.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&t.push(Vt(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&t.push(Vt(e.policyURI,!1,_.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyFlags)),t.push(Vt(e.keyFlags,!0,n))),this.signersUserID!==null&&t.push(Vt(e.signersUserID,!1,_.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(n=_.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Vt(e.reasonForRevocation,!0,n))),this.features!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.features)),t.push(Vt(e.features,!1,n))),this.signatureTargetPublicKeyAlgorithm!==null&&(n=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],n.push(_.stringToUint8Array(this.signatureTargetHash)),n=_.concat(n),t.push(Vt(e.signatureTarget,!0,n))),this.embeddedSignature!==null&&t.push(Vt(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(n=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],n=_.concat(n),t.push(Vt(e.issuerFingerprint,this.version===5,n))),this.preferredAEADAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Vt(e.preferredAEADAlgorithms,!1,n)));const i=_.concat(t),a=_.writeNumber(i.length,2);return _.concat([a,i])}writeUnhashedSubPackets(){const e=[];this.unhashedSubpackets.forEach(i=>{e.push(Ui(i.length)),e.push(i)});const t=_.concat(e),n=_.writeNumber(t.length,2);return _.concat([n,t])}readSubPacket(e,t=!0){let n=0;const i=!!(128&e[n]),a=127&e[n];if(t||(this.unhashedSubpackets.push(e.subarray(n,e.length)),N6.has(a)))switch(n++,a){case p.signatureSubpacket.signatureCreationTime:this.created=_.readDate(e.subarray(n,e.length));break;case p.signatureSubpacket.signatureExpirationTime:{const s=_.readNumber(e.subarray(n,e.length));this.signatureNeverExpires=s===0,this.signatureExpirationTime=s;break}case p.signatureSubpacket.exportableCertification:this.exportable=e[n++]===1;break;case p.signatureSubpacket.trustSignature:this.trustLevel=e[n++],this.trustAmount=e[n++];break;case p.signatureSubpacket.regularExpression:this.regularExpression=e[n];break;case p.signatureSubpacket.revocable:this.revocable=e[n++]===1;break;case p.signatureSubpacket.keyExpirationTime:{const s=_.readNumber(e.subarray(n,e.length));this.keyExpirationTime=s,this.keyNeverExpires=s===0;break}case p.signatureSubpacket.preferredSymmetricAlgorithms:this.preferredSymmetricAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.revocationKey:this.revocationKeyClass=e[n++],this.revocationKeyAlgorithm=e[n++],this.revocationKeyFingerprint=e.subarray(n,n+20);break;case p.signatureSubpacket.issuer:this.issuerKeyID.read(e.subarray(n,e.length));break;case p.signatureSubpacket.notationData:{const s=!!(128&e[n]);n+=4;const o=_.readNumber(e.subarray(n,n+2));n+=2;const u=_.readNumber(e.subarray(n,n+2));n+=2;const c=_.decodeUTF8(e.subarray(n,n+o)),h=e.subarray(n+o,n+o+u);this.rawNotations.push({name:c,humanReadable:s,value:h,critical:i}),s&&(this.notations[c]=_.decodeUTF8(h));break}case p.signatureSubpacket.preferredHashAlgorithms:this.preferredHashAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredCompressionAlgorithms:this.preferredCompressionAlgorithms=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.keyServerPreferences:this.keyServerPreferences=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.preferredKeyServer:this.preferredKeyServer=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.primaryUserID:this.isPrimaryUserID=e[n++]!==0;break;case p.signatureSubpacket.policyURI:this.policyURI=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.keyFlags:this.keyFlags=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signersUserID:this.signersUserID=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.reasonForRevocation:this.reasonForRevocationFlag=e[n++],this.reasonForRevocationString=_.decodeUTF8(e.subarray(n,e.length));break;case p.signatureSubpacket.features:this.features=[...e.subarray(n,e.length)];break;case p.signatureSubpacket.signatureTarget:{this.signatureTargetPublicKeyAlgorithm=e[n++],this.signatureTargetHashAlgorithm=e[n++];const s=Bt.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=_.uint8ArrayToString(e.subarray(n,n+s));break}case p.signatureSubpacket.embeddedSignature:this.embeddedSignature=new mr,this.embeddedSignature.read(e.subarray(n,e.length));break;case p.signatureSubpacket.issuerFingerprint:this.issuerKeyVersion=e[n++],this.issuerFingerprint=e.subarray(n,e.length),this.issuerKeyVersion===5?this.issuerKeyID.read(this.issuerFingerprint):this.issuerKeyID.read(this.issuerFingerprint.subarray(-8));break;case p.signatureSubpacket.preferredAEADAlgorithms:this.preferredAEADAlgorithms=[...e.subarray(n,e.length)];break;default:{const s=Error("Unknown signature subpacket type "+a);if(i)throw s;_.printDebug(s)}}}readSubPackets(e,t=!0,n){const i=_.readNumber(e.subarray(0,2));let a=2;for(;a<2+i;){const s=bo(e.subarray(a,e.length));a+=s.offset,this.readSubPacket(e.subarray(a,a+s.len),t,n),a+=s.len}return a}toSign(e,t){const n=p.signature;switch(e){case n.binary:return t.text!==null?_.encodeUTF8(t.getText(!0)):t.getBytes(!0);case n.text:{const i=t.getBytes(!0);return _.canonicalizeEOL(i)}case n.standalone:return new Uint8Array(0);case n.certGeneric:case n.certPersona:case n.certCasual:case n.certPositive:case n.certRevocation:{let i,a;if(t.userID)a=180,i=t.userID;else{if(!t.userAttribute)throw Error("Either a userID or userAttribute packet needs to be supplied for certification.");a=209,i=t.userAttribute}const s=i.write();return _.concat([this.toSign(n.key,t),new Uint8Array([a]),_.writeNumber(s.length,4),s])}case n.subkeyBinding:case n.subkeyRevocation:case n.keyBinding:return _.concat([this.toSign(n.key,t),this.toSign(n.key,{key:t.bind})]);case n.key:if(t.key===void 0)throw Error("Key packet is required for this signature.");return t.key.writeForHash(this.version);case n.keyRevocation:return this.toSign(n.key,t);case n.timestamp:return new Uint8Array(0);case n.thirdParty:throw Error("Not implemented");default:throw Error("Unknown signature type.")}}calculateTrailer(e,t){let n=0;return Qt(e1(this.signatureData),i=>{n+=i.length},()=>{const i=[];return this.version!==5||this.signatureType!==p.signature.binary&&this.signatureType!==p.signature.text||(t?i.push(new Uint8Array(6)):i.push(e.writeHeader())),i.push(new Uint8Array([this.version,255])),this.version===5&&i.push(new Uint8Array(4)),i.push(_.writeNumber(n,4)),_.concat(i)})}toHash(e,t,n=!1){const i=this.toSign(e,t);return _.concat([i,this.signatureData,this.calculateTrailer(t,n)])}async hash(e,t,n,i=!1){return n||(n=this.toHash(e,t,i)),Bt.hash.digest(this.hashAlgorithm,n)}async verify(e,t,n,i=new Date,a=!1,s=vt){if(!this.issuerKeyID.equals(e.getKeyID()))throw Error("Signature was not issued by the given public key");if(this.publicKeyAlgorithm!==e.algorithm)throw Error("Public key algorithm used to sign signature does not match issuer key algorithm.");const o=t===p.signature.binary||t===p.signature.text;if(!(this[jn]&&!o)){let c,h;if(this.hashed?h=await this.hashed:(c=this.toHash(t,n,a),h=await this.hash(t,n,c)),h=await ar(h),this.signedHashValue[0]!==h[0]||this.signedHashValue[1]!==h[1])throw Error("Signed digest did not match");if(this.params=await this.params,this[jn]=await Bt.signature.verify(this.publicKeyAlgorithm,this.hashAlgorithm,this.params,e.publicParams,c,h),!this[jn])throw Error("Signature verification failed")}const u=_.normalizeDate(i);if(u&&this.created>u)throw Error("Signature creation time is in the future");if(u&&u>=this.getExpirationTime())throw Error("Signature is expired");if(s.rejectHashAlgorithms.has(this.hashAlgorithm))throw Error("Insecure hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(s.rejectMessageHashAlgorithms.has(this.hashAlgorithm)&&[p.signature.binary,p.signature.text].includes(this.signatureType))throw Error("Insecure message hash algorithm: "+p.read(p.hash,this.hashAlgorithm).toUpperCase());if(this.rawNotations.forEach(({name:c,critical:h})=>{if(h&&s.knownNotations.indexOf(c)<0)throw Error("Unknown critical notation: "+c)}),this.revocationKeyClass!==null)throw Error("This key is intended to be revoked with an authorized key, which OpenPGP.js does not support.")}isExpired(e=new Date){const t=_.normalizeDate(e);return t!==null&&!(this.created<=t&&tmr.prototype.calculateTrailer.apply(await this.correspondingSig,e))}async verify(){const e=await this.correspondingSig;if(!e||e.constructor.tag!==p.packet.signature)throw Error("Corresponding signature packet missing");if(e.signatureType!==this.signatureType||e.hashAlgorithm!==this.hashAlgorithm||e.publicKeyAlgorithm!==this.publicKeyAlgorithm||!e.issuerKeyID.equals(this.issuerKeyID))throw Error("Corresponding signature packet does not match one-pass signature packet");return e.hashed=this.hashed,e.verify.apply(e,arguments)}}function M6(r,e){if(!e[r]){let t;try{t=p.read(p.packet,r)}catch{throw new re("Unknown packet type with tag: "+r)}throw Error("Packet not allowed in this context: "+t)}return new e[r]}ga.prototype.hash=mr.prototype.hash,ga.prototype.toHash=mr.prototype.toHash,ga.prototype.toSign=mr.prototype.toSign;class xe extends Array{static async fromBinary(e,t,n=vt){const i=new xe;return await i.read(e,t,n),i}async read(e,t,n=vt){n.additionalAllowedPackets.length&&(t={...t,..._.constructAllowedPackets(n.additionalAllowedPackets)}),this.stream=pi(e,async(a,s)=>{const o=Oe(s);try{for(;;)if(await o.ready,await O3(a,async u=>{try{if(u.tag===p.packet.marker||u.tag===p.packet.trust)return;const c=M6(u.tag,t);c.packets=new xe,c.fromStream=_.isStream(u.packet),await c.read(u.packet,n),await o.write(c)}catch(c){const h=!n.ignoreUnsupportedPackets&&c instanceof re,l=!(n.ignoreMalformedPackets||c instanceof re);if(h||l||Vi(u.tag))await o.abort(c);else{const w=new Ia(u.tag,u.packet);await o.write(w)}_.printDebugError(c)}}))return await o.ready,void await o.close()}catch(u){await o.abort(u)}});const i=an(this.stream);for(;;){const{done:a,value:s}=await i.read();if(a?this.stream=null:this.push(s),a||Vi(s.constructor.tag))break}i.releaseLock()}write(){const e=[];for(let t=0;t{if(a.push(u),s+=u.length,s>=o){const c=Math.min(Math.log(s)/Math.LN2|0,30),h=2**c,l=_.concat([L3(c)].concat(a));return a=[l.subarray(1+h)],s=a[0].length,l.subarray(0,1+h)}},()=>_.concat([Ui(s)].concat(a))))}else{if(_.isStream(i)){let a=0;e.push(Qt(e1(i),s=>{a+=s.length},()=>e0(n,a)))}else e.push(e0(n,i.length));e.push(i)}}return _.concat(e)}filterByTag(...e){const t=new xe,n=i=>a=>i===a;for(let i=0;it.constructor.tag===e)}indexOfTag(...e){const t=[],n=this,i=a=>s=>a===s;for(let a=0;aar(n).then(i=>new Promise((a,s)=>{r(i,t,(o,u)=>{if(o)return s(o);a(u)})}))):P1(j2(n).pipe(e(t)))}}function o2(r,e={}){return function(t){const n=new r(e);return Qt(t,i=>{if(i.length)return n.push(i,gi),n.result},()=>{if(r===b6)return n.push([],oe),n.result})}}function c2(r){return function(e){return _i(async()=>r(await ar(e)))}}qn&&(qn.inflateRaw,qn.createInflateRaw,qn.inflate,qn.createInflate);class ma{constructor(e=vt){this.algorithm=p.hash.sha256,this.type="iterated",this.c=e.s2kIterationCountByte,this.salt=null}getCount(){return 16+(15&this.c)<<6+(this.c>>4)}read(e){let t=0;try{this.type=p.read(p.s2k,e[t++])}catch{throw new re("Unknown S2K type.")}switch(this.algorithm=e[t++],this.type){case"simple":break;case"salted":this.salt=e.subarray(t,t+8),t+=8;break;case"iterated":this.salt=e.subarray(t,t+8),t+=8,this.c=e[t++];break;case"gnu":if(_.uint8ArrayToString(e.subarray(t,t+3))!=="GNU")throw new re("Unknown s2k type.");if(t+=3,1e3+e[t++]!==1001)throw new re("Unknown s2k gnu protection mode.");this.type="gnu-dummy";break;default:throw new re("Unknown s2k type.")}return t}write(){if(this.type==="gnu-dummy")return new Uint8Array([101,0,..._.stringToUint8Array("GNU"),1]);const e=[new Uint8Array([p.write(p.s2k,this.type),this.algorithm])];switch(this.type){case"simple":break;case"salted":e.push(this.salt);break;case"iterated":e.push(this.salt),e.push(new Uint8Array([this.c]));break;case"gnu":throw Error("GNU s2k type not supported.");default:throw Error("Unknown s2k type.")}return _.concatUint8Array(e)}async produceKey(e,t){e=_.encodeUTF8(e);const n=[];let i=0,a=0;for(;i{this.privateParams[e].fill(0),delete this.privateParams[e]}),this.privateParams=null,this.isEncrypted=!0)}}async function u2(r,e,t){const{keySize:n}=Bt.getCipher(t);return r.produceKey(e,n)}var $6=Za(function(r){(function(e){function t(i){function a(){return Et0&&(et.semantic=" "),et}}function $(J,et){return function(){var ct,wt,kt,Ut,At;for(Ut=s(),ct=c("star"),kt=0,At=et===void 0?0:et;(wt=J())!==null;)kt+=1,l(ct,wt);return kt>=At?ct:(o(Ut),null)}}function E(J){return J.charCodeAt(0)>=128}function W(){return h("cr",y("\r")())}function H(){return h("crlf",K(W,Z)())}function j(){return h("dquote",y('"')())}function V(){return h("htab",y(" ")())}function Z(){return h("lf",y(` +`)())}function tt(){return h("sp",y(" ")())}function rt(){return h("vchar",w(function(J){var et=J.charCodeAt(0),ct=33<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct}))}function dt(){return h("wsp",C(tt,V)())}function lt(){var J=h("quoted-pair",C(K(y("\\"),C(rt,dt)),x)());return J===null?null:(J.semantic=J.semantic[1],J)}function N(){return h("fws",C(B,K(O(K($(dt),F(H))),$(dt,1)))())}function ft(){return h("ctext",C(function(){return w(function(J){var et=J.charCodeAt(0),ct=33<=et&&et<=39||42<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},ht)())}function Pt(){return h("ccontent",C(ft,lt,q)())}function q(){return h("comment",K(y("("),$(K(O(N),Pt)),O(N),y(")"))())}function it(){return h("cfws",C(K($(K(O(N),q),1),O(N)),N)())}function mt(){return h("atext",w(function(J){var et="a"<=J&&J<="z"||"A"<=J&&J<="Z"||"0"<=J&&J<="9"||["!","#","$","%","&","'","*","+","-","/","=","?","^","_","`","{","|","}","~"].indexOf(J)>=0;return i.rfc6532&&(et=et||E(J)),et}))}function bt(){return h("atom",K(Y(O(it)),$(mt,1),Y(O(it)))())}function yt(){var J,et;return(J=h("dot-atom-text",$(mt,1)()))===null||(et=$(K(y("."),$(mt,1)))())!==null&&l(J,et),J}function pt(){return h("dot-atom",K(F(O(it)),yt,F(O(it)))())}function gt(){return h("qtext",C(function(){return w(function(J){var et=J.charCodeAt(0),ct=et===33||35<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},I)())}function ot(){return h("qcontent",C(gt,lt)())}function S(){return h("quoted-string",K(F(O(it)),F(j),$(K(O(Y(N)),ot)),O(F(N)),F(j),F(O(it)))())}function M(){return h("word",C(bt,S)())}function b(){return h("address",C(f,X)())}function f(){return h("mailbox",C(U,ut)())}function U(){return h("name-addr",K(O(Q),G)())}function G(){return h("angle-addr",C(K(F(O(it)),y("<"),ut,y(">"),F(O(it))),R)())}function X(){return h("group",K(Q,y(":"),O(m),y(";"),F(O(it)))())}function Q(){return h("display-name",((J=h("phrase",C(D,$(M,1))()))!==null&&(J.semantic=function(et){return et.replace(/([ \t]|\r\n)+/g," ").replace(/^\s*/,"").replace(/\s*$/,"")}(J.semantic)),J));var J}function g(){return h("mailbox-list",C(K(f,$(K(y(","),f))),k)())}function d(){return h("address-list",C(K(b,$(K(y(","),b))),nt)())}function m(){return h("group-list",C(g,F(it),at)())}function A(){return h("local-part",C(St,pt,S)())}function T(){return h("dtext",C(function(){return w(function(J){var et=J.charCodeAt(0),ct=33<=et&&et<=90||94<=et&&et<=126;return i.rfc6532&&(ct=ct||E(J)),ct})},zt)())}function P(){return h("domain-literal",K(F(O(it)),y("["),$(K(O(N),T)),O(N),y("]"),F(O(it)))())}function z(){return h("domain",(J=C(It,pt,P)(),i.rejectTLD&&J&&J.semantic&&J.semantic.indexOf(".")<0?null:(J&&(J.semantic=J.semantic.replace(/\s+/g,"")),J)));var J}function ut(){return h("addr-spec",K(A,y("@"),z)())}function st(){return i.strict?null:h("obs-NO-WS-CTL",w(function(J){var et=J.charCodeAt(0);return 1<=et&&et<=8||et===11||et===12||14<=et&&et<=31||et===127}))}function ht(){return i.strict?null:h("obs-ctext",st())}function I(){return i.strict?null:h("obs-qtext",st())}function x(){return i.strict?null:h("obs-qp",K(y("\\"),C(y("\0"),st,Z,W))())}function D(){return i.strict?null:i.atInDisplayName?h("obs-phrase",K(M,$(C(M,y("."),y("@"),Y(it))))()):h("obs-phrase",K(M,$(C(M,y("."),Y(it))))())}function B(){return i.strict?null:h("obs-FWS",$(K(F(O(H)),dt),1)())}function R(){return i.strict?null:h("obs-angle-addr",K(F(O(it)),y("<"),L,ut,y(">"),F(O(it)))())}function L(){return i.strict?null:h("obs-route",K(v,y(":"))())}function v(){return i.strict?null:h("obs-domain-list",K($(C(F(it),y(","))),y("@"),z,$(K(y(","),F(O(it)),O(K(y("@"),z)))))())}function k(){return i.strict?null:h("obs-mbox-list",K($(K(F(O(it)),y(","))),f,$(K(y(","),O(K(f,F(it))))))())}function nt(){return i.strict?null:h("obs-addr-list",K($(K(F(O(it)),y(","))),b,$(K(y(","),O(K(b,F(it))))))())}function at(){return i.strict?null:h("obs-group-list",K($(K(F(O(it)),y(",")),1),F(O(it)))())}function St(){return i.strict?null:h("obs-local-part",K(M,$(K(y("."),M)))())}function It(){return i.strict?null:h("obs-domain",K(bt,$(K(y("."),bt)))())}function zt(){return i.strict?null:h("obs-dtext",C(st,lt)())}function Dt(J,et){var ct,wt,kt;if(et==null)return null;for(wt=[et];wt.length>0;){if((kt=wt.pop()).name===J)return kt;for(ct=kt.children.length-1;ct>=0;ct-=1)wt.push(kt.children[ct])}return null}function Wt(J,et){var ct,wt,kt,Ut,At;if(et==null)return null;for(wt=[et],Ut=[],At={},ct=0;ct0;)if((kt=wt.pop()).name in At)Ut.push(kt);else for(ct=kt.children.length-1;ct>=0;ct-=1)wt.push(kt.children[ct]);return Ut}function Yt(J){var et,ct,wt,kt,Ut;if(J===null)return null;for(et=[],ct=Wt(["group","mailbox"],J),wt=0;wt1?null:At.addresses&&At.addresses[0]}(Ut):i.simple?Ut&&Ut.addresses:Ut}function Jt(J){var et,ct=Dt("display-name",J),wt=[],kt=Wt(["mailbox"],J);for(et=0;et0;)for((Ie=Ce.pop()).name===Mt&&Ne.push(Ie),De=Ie.children.length-1;De>=0;De-=1)Ce.push(Ie.children[De]);return Ne}("cfws",J),kt=Wt(["comment"],J),Ut=Dt("local-part",ct),At=Dt("domain",ct);return{node:J,parts:{name:et,address:ct,local:Ut,domain:At,comments:wt},type:J.name,name:xt(et),address:xt(ct),local:xt(Ut),domain:xt(At),comments:Nt(kt),groupName:xt(J.groupName)}}function xt(J){return J!=null?J.semantic:null}function Nt(J){var et="";if(J)for(var ct=0;ct`),t.userID=n.join(" "),t}read(e,t=vt){const n=_.decodeUTF8(e);if(n.length>t.maxUserIDLength)throw Error("User ID string is too long");try{const{name:i,address:a,comments:s}=$6.parseOneAddress({input:n,atInDisplayName:!0});this.comment=s.replace(/^\(|\)$/g,""),this.name=i,this.email=a}catch{}this.userID=n}write(){return _.encodeUTF8(this.userID)}equals(e){return e&&e.userID===this.userID}}class Jo extends os{static get tag(){return p.packet.secretSubkey}constructor(e=new Date,t=vt){super(e,t)}}async function t5(r,e){const t=new Jo(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve),await t.computeFingerprintAndKeyID(),t}async function F6(r,e){const t=new os(r.date,e);return t.packets=null,t.algorithm=p.write(p.publicKey,r.algorithm),await t.generate(r.rsaBits,r.curve,r.config),await t.computeFingerprintAndKeyID(),t}async function ze(r,e,t,n,i=new Date,a){let s,o;for(let u=r.length-1;u>=0;u--)try{(!s||r[u].created>=s.created)&&(await r[u].verify(e,t,n,i,void 0,a),s=r[u])}catch(c){o=c}if(!s)throw _.wrapError(`Could not find valid ${p.read(p.signature,t)} signature in key ${e.getKeyID().toHex()}`.replace("certGeneric ","self-").replace(/([a-z])([A-Z])/g,(u,c,h)=>c+" "+h.toLowerCase()),o);return s}function La(r,e,t=new Date){const n=_.normalizeDate(t);if(n!==null){const i=b1(r,e);return!(r.created<=n&&n0&&(a.keyExpirationTime=t.keyExpirationTime,a.keyNeverExpires=!1),await Mr(i,null,e,a,t.date,void 0,void 0,void 0,n)}async function H6(r,e,t=new Date,n={},i){let a=i.preferredHashAlgorithm,s=a;if(r){const o=await r.getPrimaryUser(t,n,i);o.selfCertification.preferredHashAlgorithms&&([s]=o.selfCertification.preferredHashAlgorithms,a=Bt.hash.getHashByteLength(a)<=Bt.hash.getHashByteLength(s)?s:a)}switch(e.algorithm){case p.publicKey.ecdsa:case p.publicKey.eddsaLegacy:case p.publicKey.ed25519:s=Bt.getPreferredCurveHashAlgo(e.algorithm,e.publicParams.oid)}return Bt.hash.getHashByteLength(a)<=Bt.hash.getHashByteLength(s)?s:a}async function Mr(r,e,t,n,i,a,s=[],o=!1,u){if(t.isDummy())throw Error("Cannot sign with a gnu-dummy key.");if(!t.isDecrypted())throw Error("Signing key is not decrypted.");const c=new mr;return Object.assign(c,n),c.publicKeyAlgorithm=t.algorithm,c.hashAlgorithm=await H6(e,t,i,a,u),c.rawNotations=s,await c.sign(t,r,i,o),c}async function rn(r,e,t,n=new Date,i){(r=r[t])&&(e[t].length?await Promise.all(r.map(async function(a){a.isExpired(n)||i&&!await i(a)||e[t].some(function(s){return _.equalsUint8Array(s.writeParams(),a.writeParams())})||e[t].push(a)})):e[t]=r)}async function Cn(r,e,t,n,i,a,s=new Date,o){a=a||r;const u=[];return await Promise.all(n.map(async function(c){try{i&&!c.issuerKeyID.equals(i.issuerKeyID)||(await c.verify(a,e,t,o.revocationsExpire?s:null,!1,o),u.push(c.issuerKeyID))}catch{}})),i?(i.revoked=!!u.some(c=>c.equals(i.issuerKeyID))||i.revoked||!1,i.revoked):u.length>0}function b1(r,e){let t;return e.keyNeverExpires===!1&&(t=r.created.getTime()+1e3*e.keyExpirationTime),t?new Date(t):1/0}function Oa(r,e={}){switch(r.type=r.type||e.type,r.curve=r.curve||e.curve,r.rsaBits=r.rsaBits||e.rsaBits,r.keyExpirationTime=r.keyExpirationTime!==void 0?r.keyExpirationTime:e.keyExpirationTime,r.passphrase=_.isString(r.passphrase)?r.passphrase:e.passphrase,r.date=r.date||e.date,r.sign=r.sign||!1,r.type){case"ecc":try{r.curve=p.write(p.curve,r.curve)}catch{throw Error("Unknown curve")}r.curve!==p.curve.ed25519Legacy&&r.curve!==p.curve.curve25519Legacy||(r.curve=r.sign?p.curve.ed25519Legacy:p.curve.curve25519Legacy),r.sign?r.algorithm=r.curve===p.curve.ed25519Legacy?p.publicKey.eddsaLegacy:p.publicKey.ecdsa:r.algorithm=p.publicKey.ecdh;break;case"rsa":r.algorithm=p.publicKey.rsaEncryptSign;break;default:throw Error("Unsupported key type "+r.type)}return r}function h2(r,e){const t=r.algorithm;return t!==p.publicKey.rsaEncrypt&&t!==p.publicKey.elgamal&&t!==p.publicKey.ecdh&&t!==p.publicKey.x25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.signData)!=0)}function l2(r,e){const t=r.algorithm;return t!==p.publicKey.dsa&&t!==p.publicKey.rsaSign&&t!==p.publicKey.ecdsa&&t!==p.publicKey.eddsaLegacy&&t!==p.publicKey.ed25519&&(!e.keyFlags||(e.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(e.keyFlags[0]&p.keyFlags.encryptStorage)!=0)}function f2(r,e){return!!e.allowInsecureDecryptionWithSigningKeys||!r.keyFlags||(r.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(r.keyFlags[0]&p.keyFlags.encryptStorage)!=0}function vn(r,e){const t=p.write(p.publicKey,r.algorithm),n=r.getAlgorithmInfo();if(e.rejectPublicKeyAlgorithms.has(t))throw Error(n.algorithm+" keys are considered too weak.");switch(t){case p.publicKey.rsaEncryptSign:case p.publicKey.rsaSign:case p.publicKey.rsaEncrypt:if(n.bitsh.getKeys(u).length>0);return c.length===0?null:(await Promise.all(c.map(async h=>{const l=await h.getSigningKey(u,e.created,void 0,i);if(e.revoked||await a.isRevoked(e,l.keyPacket,n,i))throw Error("User certificate is revoked");try{await e.verify(l.keyPacket,p.signature.certGeneric,o,n,void 0,i)}catch(w){throw _.wrapError("User certificate is invalid",w)}})),!0)}async verifyAllCertifications(e,t=new Date,n){const i=this,a=this.selfCertifications.concat(this.otherCertifications);return Promise.all(a.map(async s=>({keyID:s.issuerKeyID,valid:await i.verifyCertificate(s,e,t,n).catch(()=>!1)})))}async verify(e=new Date,t){if(!this.selfCertifications.length)throw Error("No self-certifications found");const n=this,i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};let s;for(let o=this.selfCertifications.length-1;o>=0;o--)try{const u=this.selfCertifications[o];if(u.revoked||await n.isRevoked(u,void 0,e,t))throw Error("Self-certification is revoked");try{await u.verify(i,p.signature.certGeneric,a,e,void 0,t)}catch(c){throw _.wrapError("Self-certification is invalid",c)}return!0}catch(u){s=u}throw s}async update(e,t,n){const i=this.mainKey.keyPacket,a={userID:this.userID,userAttribute:this.userAttribute,key:i};await rn(e,this,"selfCertifications",t,async function(s){try{return await s.verify(i,p.signature.certGeneric,a,t,!1,n),!0}catch{return!1}}),await rn(e,this,"otherCertifications",t),await rn(e,this,"revocationSignatures",t,function(s){return Cn(i,p.signature.certRevocation,a,[s],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={userID:this.userID,userAttribute:this.userAttribute,key:e},o=new fi(s.userID||s.userAttribute,this.mainKey);return o.revocationSignatures.push(await Mr(s,null,e,{signatureType:p.signature.certRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}}class In{constructor(e,t){this.keyPacket=e,this.bindingSignatures=[],this.revocationSignatures=[],this.mainKey=t}toPacketList(){const e=new xe;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.bindingSignatures),e}clone(){const e=new In(this.keyPacket,this.mainKey);return e.bindingSignatures=[...this.bindingSignatures],e.revocationSignatures=[...this.revocationSignatures],e}async isRevoked(e,t,n=new Date,i=vt){const a=this.mainKey.keyPacket;return Cn(a,p.signature.subkeyRevocation,{key:a,bind:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verify(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket},a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t);if(a.revoked||await this.isRevoked(a,null,e,t))throw Error("Subkey is revoked");if(La(this.keyPacket,a,e))throw Error("Subkey is expired");return a}async getExpirationTime(e=new Date,t=vt){const n=this.mainKey.keyPacket,i={key:n,bind:this.keyPacket};let a;try{a=await ze(this.bindingSignatures,n,p.signature.subkeyBinding,i,e,t)}catch{return null}const s=b1(this.keyPacket,a),o=a.getExpirationTime();return sa.bindingSignatures[u].created&&(a.bindingSignatures[u]=o),!1;try{return await o.verify(i,p.signature.subkeyBinding,s,t,void 0,n),!0}catch{return!1}}),await rn(e,this,"revocationSignatures",t,function(o){return Cn(i,p.signature.subkeyRevocation,s,[o],void 0,void 0,t,n)})}async revoke(e,{flag:t=p.reasonForRevocation.noReason,string:n=""}={},i=new Date,a=vt){const s={key:e,bind:this.keyPacket},o=new In(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await Mr(s,null,e,{signatureType:p.signature.subkeyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,t),reasonForRevocationString:n},i,void 0,void 0,!1,a)),await o.update(this),o}hasSameFingerprintAs(e){return this.keyPacket.hasSameFingerprintAs(e.keyPacket||e)}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","isDecrypted"].forEach(r=>{In.prototype[r]=function(){return this.keyPacket[r]()}});const j6=_.constructAllowedPackets([mr]),d2=new Set([p.packet.publicKey,p.packet.privateKey]),y2=new Set([p.packet.publicKey,p.packet.privateKey,p.packet.publicSubkey,p.packet.privateSubkey]);class r5{packetListToStructure(e,t=new Set){let n,i,a,s;for(const o of e){if(o instanceof Ia){y2.has(o.tag)&&!s&&(s=d2.has(o.tag)?d2:y2);continue}const u=o.constructor.tag;if(s){if(!s.has(u))continue;s=null}if(t.has(u))throw Error("Unexpected packet type: "+u);switch(u){case p.packet.publicKey:case p.packet.secretKey:if(this.keyPacket)throw Error("Key block contains multiple keys");if(this.keyPacket=o,i=this.getKeyID(),!i)throw Error("Missing Key ID");break;case p.packet.userID:case p.packet.userAttribute:n=new fi(o,this),this.users.push(n);break;case p.packet.publicSubkey:case p.packet.secretSubkey:n=null,a=new In(o,this),this.subkeys.push(a);break;case p.packet.signature:switch(o.signatureType){case p.signature.certGeneric:case p.signature.certPersona:case p.signature.certCasual:case p.signature.certPositive:if(!n){_.printDebug("Dropping certification signatures without preceding user packet");continue}o.issuerKeyID.equals(i)?n.selfCertifications.push(o):n.otherCertifications.push(o);break;case p.signature.certRevocation:n?n.revocationSignatures.push(o):this.directSignatures.push(o);break;case p.signature.key:this.directSignatures.push(o);break;case p.signature.subkeyBinding:if(!a){_.printDebug("Dropping subkey binding signature without preceding subkey packet");continue}a.bindingSignatures.push(o);break;case p.signature.keyRevocation:this.revocationSignatures.push(o);break;case p.signature.subkeyRevocation:if(!a){_.printDebug("Dropping subkey revocation signature without preceding subkey packet");continue}a.revocationSignatures.push(o)}}}}toPacketList(){const e=new xe;return e.push(this.keyPacket),e.push(...this.revocationSignatures),e.push(...this.directSignatures),this.users.map(t=>e.push(...t.toPacketList())),this.subkeys.map(t=>e.push(...t.toPacketList())),e}clone(e=!1){const t=new this.constructor(this.toPacketList());return e&&t.getKeys().forEach(n=>{if(n.keyPacket=Object.create(Object.getPrototypeOf(n.keyPacket),Object.getOwnPropertyDescriptors(n.keyPacket)),!n.keyPacket.isDecrypted())return;const i={};Object.keys(n.keyPacket.privateParams).forEach(a=>{i[a]=new Uint8Array(n.keyPacket.privateParams[a])}),n.keyPacket.privateParams=i}),t}getSubkeys(e=null){return this.subkeys.filter(t=>!e||t.getKeyID().equals(e,!0))}getKeys(e=null){const t=[];return e&&!this.getKeyID().equals(e,!0)||t.push(this),t.concat(this.getSubkeys(e))}getKeyIDs(){return this.getKeys().map(e=>e.getKeyID())}getUserIDs(){return this.users.map(e=>e.userID?e.userID.userID:null).filter(e=>e!==null)}write(){return this.toPacketList().write()}async getSigningKey(e=null,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(!h2(u.keyPacket,h))continue;if(!h.embeddedSignature)throw Error("Missing embedded signature");return await ze([h.embeddedSignature],u.keyPacket,p.signature.keyBinding,c,t,i),vn(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&h2(a,u.selfCertification))return vn(a,i),this}catch(u){o=u}throw _.wrapError("Could not find valid signing key packet in key "+this.getKeyID().toHex(),o)}async getEncryptionKey(e,t=new Date,n={},i=vt){await this.verifyPrimaryKey(t,n,i);const a=this.keyPacket,s=this.subkeys.slice().sort((u,c)=>c.keyPacket.created-u.keyPacket.created);let o;for(const u of s)if(!e||u.getKeyID().equals(e))try{await u.verify(t,i);const c={key:a,bind:u.keyPacket},h=await ze(u.bindingSignatures,a,p.signature.subkeyBinding,c,t,i);if(l2(u.keyPacket,h))return vn(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&l2(a,u.selfCertification))return vn(a,i),this}catch(u){o=u}throw _.wrapError("Could not find valid encryption key packet in key "+this.getKeyID().toHex(),o)}async isRevoked(e,t,n=new Date,i=vt){return Cn(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},this.revocationSignatures,e,t,n,i)}async verifyPrimaryKey(e=new Date,t={},n=vt){const i=this.keyPacket;if(await this.isRevoked(null,null,e,n))throw Error("Primary key is revoked");const{selfCertification:a}=await this.getPrimaryUser(e,t,n);if(La(i,a,e))throw Error("Primary key is expired");const s=await ze(this.directSignatures,i,p.signature.key,{key:i},e,n).catch(()=>{});if(s&&La(i,s,e))throw Error("Primary key is expired")}async getExpirationTime(e,t=vt){let n;try{const{selfCertification:i}=await this.getPrimaryUser(null,e,t),a=b1(this.keyPacket,i),s=i.getExpirationTime(),o=await ze(this.directSignatures,this.keyPacket,p.signature.key,{key:this.keyPacket},null,t).catch(()=>{});if(o){const u=b1(this.keyPacket,o);n=Math.min(a,s,u)}else n=ae.subkeys.some(s=>a.hasSameFingerprintAs(s)))))throw Error("Cannot update public key with private key if subkeys mismatch");return e.update(this,n)}const i=this.clone();return await rn(e,i,"revocationSignatures",t,a=>Cn(i.keyPacket,p.signature.keyRevocation,i,[a],null,e.keyPacket,t,n)),await rn(e,i,"directSignatures",t),await Promise.all(e.users.map(async a=>{const s=i.users.filter(o=>a.userID&&a.userID.equals(o.userID)||a.userAttribute&&a.userAttribute.equals(o.userAttribute));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.users.push(o)}})),await Promise.all(e.subkeys.map(async a=>{const s=i.subkeys.filter(o=>o.hasSameFingerprintAs(a));if(s.length>0)await Promise.all(s.map(o=>o.update(a,t,n)));else{const o=a.clone();o.mainKey=i,i.subkeys.push(o)}})),i}async getRevocationCertificate(e=new Date,t=vt){const n={key:this.keyPacket},i=await ze(this.revocationSignatures,this.keyPacket,p.signature.keyRevocation,n,e,t),a=new xe;return a.push(i),Ga(p.armor.publicKey,a.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,n=vt){const i=await Y2(e,n),a=(await xe.fromBinary(i.data,j6,n)).findPacket(p.packet.signature);if(!a||a.signatureType!==p.signature.keyRevocation)throw Error("Could not find revocation signature packet");if(!a.issuerKeyID.equals(this.getKeyID()))throw Error("Revocation signature does not match key");try{await a.verify(this.keyPacket,p.signature.keyRevocation,{key:this.keyPacket},t,void 0,n)}catch(o){throw _.wrapError("Could not verify revocation signature",o)}const s=this.clone();return s.revocationSignatures.push(a),s}async signPrimaryUser(e,t,n,i=vt){const{index:a,user:s}=await this.getPrimaryUser(t,n,i),o=await s.certify(e,t,i),u=this.clone();return u.users[a]=o,u}async signAllUsers(e,t=new Date,n=vt){const i=this.clone();return i.users=await Promise.all(this.users.map(function(a){return a.certify(e,t,n)})),i}async verifyPrimaryUser(e,t=new Date,n,i=vt){const a=this.keyPacket,{user:s}=await this.getPrimaryUser(t,n,i);return e?await s.verifyAllCertifications(e,t,i):[{keyID:a.getKeyID(),valid:await s.verify(t,i).catch(()=>!1)}]}async verifyAllUsers(e,t=new Date,n=vt){const i=this.keyPacket,a=[];return await Promise.all(this.users.map(async s=>{const o=e?await s.verifyAllCertifications(e,t,n):[{keyID:i.getKeyID(),valid:await s.verify(t,n).catch(()=>!1)}];a.push(...o.map(u=>({userID:s.userID?s.userID.userID:null,userAttribute:s.userAttribute,keyID:u.keyID,valid:u.valid})))})),a}}["getKeyID","getFingerprint","getAlgorithmInfo","getCreationTime","hasSameFingerprintAs"].forEach(r=>{r5.prototype[r]=In.prototype[r]});class p2 extends r5{constructor(e){if(super(),this.keyPacket=null,this.revocationSignatures=[],this.directSignatures=[],this.users=[],this.subkeys=[],e&&(this.packetListToStructure(e,new Set([p.packet.secretKey,p.packet.secretSubkey])),!this.keyPacket))throw Error("Invalid key: missing public-key packet")}isPrivate(){return!1}toPublic(){return this}armor(e=vt){return Ga(p.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class z1 extends p2{constructor(e){if(super(),this.packetListToStructure(e,new Set([p.packet.publicKey,p.packet.publicSubkey])),!this.keyPacket)throw Error("Invalid key: missing private-key packet")}isPrivate(){return!0}toPublic(){const e=new xe,t=this.toPacketList();for(const n of t)switch(n.constructor.tag){case p.packet.secretKey:{const i=Ye.fromSecretKeyPacket(n);e.push(i);break}case p.packet.secretSubkey:{const i=B1.fromSecretSubkeyPacket(n);e.push(i);break}default:e.push(n)}return new p2(e)}armor(e=vt){return Ga(p.armor.privateKey,this.toPacketList().write(),void 0,void 0,void 0,e)}async getDecryptionKeys(e,t=new Date,n={},i=vt){const a=this.keyPacket,s=[];for(let u=0;ue.isDecrypted())}async validate(e=vt){if(!this.isPrivate())throw Error("Cannot validate a public key");let t;if(this.keyPacket.isDummy()){const n=await this.getSigningKey(null,null,void 0,{...e,rejectPublicKeyAlgorithms:new Set,minRSABits:0});n&&!n.keyPacket.isDummy()&&(t=n.keyPacket)}else t=this.keyPacket;if(t)return t.validate();{const n=this.getKeys();if(n.map(i=>i.keyPacket.isDummy()).every(Boolean))throw Error("Cannot validate an all-gnu-dummy key");return Promise.all(n.map(async i=>i.keyPacket.validate()))}}clearPrivateParams(){this.getKeys().forEach(({keyPacket:e})=>{e.isDecrypted()&&e.clearPrivateParams()})}async revoke({flag:e=p.reasonForRevocation.noReason,string:t=""}={},n=new Date,i=vt){if(!this.isPrivate())throw Error("Need private key for revoking");const a={key:this.keyPacket},s=this.clone();return s.revocationSignatures.push(await Mr(a,null,this.keyPacket,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.write(p.reasonForRevocation,e),reasonForRevocationString:t},n,void 0,void 0,void 0,i)),s}async addSubkey(e={}){const t={...vt,...e.config};if(e.passphrase)throw Error("Subkey could not be encrypted here, please encrypt whole key");if(e.rsaBitsK!==y)]}const c=R1.fromObject(s),h={};h.userID=c,h.key=r;const l={};return l.signatureType=p.signature.certGeneric,l.keyFlags=[p.keyFlags.certifyKeys|p.keyFlags.signData],l.preferredSymmetricAlgorithms=u([p.symmetric.aes256,p.symmetric.aes128,p.symmetric.aes192],n.preferredSymmetricAlgorithm),n.aeadProtect&&(l.preferredAEADAlgorithms=u([p.aead.eax,p.aead.ocb],n.preferredAEADAlgorithm)),l.preferredHashAlgorithms=u([p.hash.sha256,p.hash.sha512],n.preferredHashAlgorithm),l.preferredCompressionAlgorithms=u([p.compression.zlib,p.compression.zip,p.compression.uncompressed],n.preferredCompressionAlgorithm),o===0&&(l.isPrimaryUserID=!0),l.features=[0],l.features[0]|=p.features.modificationDetection,n.aeadProtect&&(l.features[0]|=p.features.aead),n.v5Keys&&(l.features[0]|=p.features.v5Keys),t.keyExpirationTime>0&&(l.keyExpirationTime=t.keyExpirationTime,l.keyNeverExpires=!1),{userIDPacket:c,signaturePacket:await Mr(h,null,r,l,t.date,void 0,void 0,void 0,n)}})).then(s=>{s.forEach(({userIDPacket:o,signaturePacket:u})=>{i.push(o),i.push(u)})}),await Promise.all(e.map(async function(s,o){const u=t.subkeys[o];return{secretSubkeyPacket:s,subkeySignaturePacket:await e5(s,r,u,n)}})).then(s=>{s.forEach(({secretSubkeyPacket:o,subkeySignaturePacket:u})=>{i.push(o),i.push(u)})});const a={key:r};return i.push(await Mr(a,null,r,{signatureType:p.signature.keyRevocation,reasonForRevocationFlag:p.reasonForRevocation.noReason,reasonForRevocationString:""},t.date,void 0,void 0,void 0,n)),t.passphrase&&r.clearPrivateParams(),await Promise.all(e.map(async function(s,o){t.subkeys[o].passphrase&&s.clearPrivateParams()})),new z1(i)}async function G6({armoredKey:r,binaryKey:e,config:t,...n}){if(t={...vt,...t},!r&&!e)throw Error("readPrivateKey: must pass options object containing `armoredKey` or `binaryKey`");if(r&&!_.isString(r))throw Error("readPrivateKey: options.armoredKey must be a string");if(e&&!_.isUint8Array(e))throw Error("readPrivateKey: options.binaryKey must be a Uint8Array");const i=Object.keys(n);if(i.length>0)throw Error("Unknown option: "+i.join(", "));let a;if(r){const{type:o,data:u}=await Y2(r,t);if(o!==p.armor.privateKey)throw Error("Armored text not of type private key");a=u}else a=e;const s=await xe.fromBinary(a,q6,t);return new z1(s)}async function W6({userIDs:r=[],passphrase:e,type:t="ecc",rsaBits:n=4096,curve:i="curve25519",keyExpirationTime:a=0,date:s=new Date,subkeys:o=[{}],format:u="armored",config:c,...h}){i5(c={...vt,...c}),r=a5(r);const l=Object.keys(h);if(l.length>0)throw Error("Unknown option: "+l.join(", "));if(r.length===0)throw Error("UserIDs are required for key generation");if(t==="rsa"&&nOa(C.subkeys[H],C));let F=[F6(C,O)];F=F.concat(C.subkeys.map(W=>t5(W,O)));const Y=await Promise.all(F),$=await n5(Y[0],Y.slice(1),C,O),E=await $.getRevocationCertificate(C.date,O);return $.revocationSignatures=[],{key:$,revocationCertificate:E}}(w,c);return y.getKeys().forEach(({keyPacket:C})=>vn(C,c)),{privateKey:k1(y,u,c),publicKey:k1(y.toPublic(),u,c),revocationCertificate:K}}catch(y){throw _.wrapError("Error generating keypair",y)}}async function V6({privateKey:r,userIDs:e=[],passphrase:t,keyExpirationTime:n=0,date:i,format:a="armored",config:s,...o}){i5(s={...vt,...s}),e=a5(e);const u=Object.keys(o);if(u.length>0)throw Error("Unknown option: "+u.join(", "));if(e.length===0)throw Error("UserIDs are required for key reformat");const c={privateKey:r,userIDs:e,passphrase:t,keyExpirationTime:n,date:i};try{const{key:h,revocationCertificate:l}=await async function(w,y){w=$(w);const{privateKey:K}=w;if(!K.isPrivate())throw Error("Cannot reformat a public key");if(K.keyPacket.isDummy())throw Error("Cannot reformat a gnu-dummy primary key");if(!K.getKeys().every(({keyPacket:E})=>E.isDecrypted()))throw Error("Key is not decrypted");const C=K.keyPacket;w.subkeys||(w.subkeys=await Promise.all(K.subkeys.map(async E=>{const W=E.keyPacket,H={key:C,bind:W},j=await ze(E.bindingSignatures,C,p.signature.subkeyBinding,H,null,y).catch(()=>({}));return{sign:j.keyFlags&&j.keyFlags[0]&p.keyFlags.signData}})));const O=K.subkeys.map(E=>E.keyPacket);if(w.subkeys.length!==O.length)throw Error("Number of subkey options does not match number of subkeys");w.subkeys=w.subkeys.map(E=>$(E,w));const F=await n5(C,O,w,y),Y=await F.getRevocationCertificate(w.date,y);return F.revocationSignatures=[],{key:F,revocationCertificate:Y};function $(E,W={}){return E.keyExpirationTime=E.keyExpirationTime||W.keyExpirationTime,E.passphrase=_.isString(E.passphrase)?E.passphrase:W.passphrase,E.date=E.date||W.date,E}}(c,s);return{privateKey:k1(h,a,s),publicKey:k1(h.toPublic(),a,s),revocationCertificate:l}}catch(h){throw _.wrapError("Error reformatting keypair",h)}}const Z6=Object.keys(vt).length;function i5(r){const e=Object.keys(r);if(e.length!==Z6){for(const t of e)if(vt[t]===void 0)throw Error("Unknown config property: "+t)}}function a5(r){return r&&!_.isArray(r)&&(r=[r]),r}function k1(r,e,t){switch(e){case"object":return r;case"armored":return r.armor(t);case"binary":return r.write();default:throw Error("Unsupported format "+e)}}const X6=`#version 300 es in vec4 pos;void main(){gl_Position=pos;}`,Y6=`#version 300 es precision highp float;precision highp int; #define ROTL(x,n)(((x)<<(n))|((x)>>(32-(n)))) @@ -40,4 +40,4 @@ precision highp float;precision highp int; #define FILTER(h)(false) #endif uniform uint thread,iteration,hashData[LENGTH];out vec4 outColor;void main(){uint i[LENGTH];for(int f=0;fu)break;uint x[]=uint[](1732584193u,4023233417u,2562383102u,271733878u,3285377520u);for(int f=0;f>0&255u)/255.,float(i[1]>>8&255u)/255.,float(i[1]>>16&255u)/255.,float(i[1]>>24&255u)/255.);return;}}outColor=vec4(0);}`,Q6=async(r,e)=>(r=await G6({armoredKey:r.armor()}),r.keyPacket.created=e,await r.keyPacket.computeFingerprintAndKeyID(),r.subkeys.forEach(t=>t.keyPacket.created=e),await V6({privateKey:r,userIDs:r.users.map(t=>t.userID),date:e,format:"object"})),J6=r=>((r&255)<<24|(r&65280)<<8|r>>8&65280|r>>24&255)>>>0,tu=async(r,e,t,n,i=()=>{},a=()=>!1)=>{if(e=e.replaceAll(" ",""),e.length!=40)throw new Error("Invalid pattern");const s=[0,8,16,24,32].map((H,j)=>{const V=e.substring(H,H+8);let Z="",tt="";for(let rt=0;rt<8;rt++)V[rt].match(/[\da-f]/gi)?(Z+="F",tt+=V[rt].toUpperCase()):(Z+="0",tt+="0");return Z&&tt?`(h[${j}] & 0x${Z}u) == 0x${tt}u`:""}).filter(Boolean).join(" && ")||"true",o=new OffscreenCanvas(t,1),u=o.getContext("webgl2");let c=!1,h,l,w=new Uint8Array,y=new Uint8Array,K=new ArrayBuffer(0),C=new Uint8Array,O=new Uint32Array;const F=new ArrayBuffer(o.width*4),Y=new Uint8Array(F),$=new Uint32Array(F);let E=0;const W=performance.now();return await new Promise((H,j)=>{const V=async()=>{try{const Z=await W6({...r,format:"object"});if(w=Z.publicKey.keyPacket.write(),!c){y=new Uint8Array(w.length+3),y[0]=153,K=new ArrayBuffer(Math.ceil((y.length+1+8)/64)*64),C=new Uint8Array(K),O=new Uint32Array(K);const rt=u.createShader(u.VERTEX_SHADER),dt=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(rt,X6),u.shaderSource(dt,Y6.replaceAll("#define __INJECTS__",Object.entries({"FILTER(h)":s,LENGTH:O.length}).map(([ft,Pt])=>`#define ${ft} (${Pt})`).join(` -`))),u.compileShader(rt),u.compileShader(dt),h=u.createProgram(),u.attachShader(h,rt),u.attachShader(h,dt),u.linkProgram(h),u.useProgram(h),u.uniform1ui(u.getUniformLocation(h,"thread"),o.width),u.uniform1ui(u.getUniformLocation(h,"iteration"),n),l=u.getUniformLocation(h,"hashData");const lt=u.getAttribLocation(h,"pos");u.enableVertexAttribArray(lt),u.bindBuffer(u.ARRAY_BUFFER,u.createBuffer());const N=new Float32Array([-1,1]);u.bufferData(u.ARRAY_BUFFER,N,u.STATIC_DRAW),u.vertexAttribPointer(lt,1,u.FLOAT,!1,0,0),u.clearColor(0,0,0,0),u.clear(u.COLOR_BUFFER_BIT),c=!0}y.set([w.length>>8&255,w.length&255],1),y.set(w,3),O[y.length>>2]=0,C.set(y),C[y.length]=128;for(let rt=0;rt"0123456789ABCDEFabcdef".includes(r)).length)},running:!1,generatedKey:void 0,hashCount:0,runningTime:0,mounted(){this.patternHelper()},addUserID(){!this.userIDInput.name||!this.userIDInput.email||(this.userID.push({...this.userIDInput}),this.userIDInput.name=this.userIDInput.email="")},patternHelper(){this.pattern=("*".repeat(40-this.patternLength)+this.patternNumber.repeat(this.patternLength)).match(/[^]{1,4}/g).join(" ")},async toggleKeygen(){if(this.running){this.running=!1;return}(!this.userID.length||this.userIDInput.name&&this.userIDInput.email)&&this.addUserID(),this.hashCount=0,this.runningTime=0,this.running=!0;try{const r={userIDs:this.userID};switch(this.keyType){case"curve25519":case"p256":case"p384":case"p521":case"brainpoolP256r1":case"brainpoolP384r1":case"brainpoolP512r1":r.type="ecc",r.curve=this.keyType;break;case"2048":case"3072":case"4096":r.type="rsa",r.rsaBits=parseInt(this.keyType);break}this.generatedKey=await tu(r,this.pattern,this.thread,this.iteration,(e,t)=>{this.hashCount=e,this.runningTime=t},()=>!this.running)}catch(r){alert(r)}finally{this.running=!1}}};M2(eu).mount();export{Tn as A,K1 as J,Zc as M,Pi as Y,Ct as d,Xa as g,Ic as i,Za as r,iu as t,au as x,d3 as y,co as z}; +`))),u.compileShader(rt),u.compileShader(dt),h=u.createProgram(),u.attachShader(h,rt),u.attachShader(h,dt),u.linkProgram(h),u.useProgram(h),u.uniform1ui(u.getUniformLocation(h,"thread"),o.width),u.uniform1ui(u.getUniformLocation(h,"iteration"),n),l=u.getUniformLocation(h,"hashData");const lt=u.getAttribLocation(h,"pos");u.enableVertexAttribArray(lt),u.bindBuffer(u.ARRAY_BUFFER,u.createBuffer());const N=new Float32Array([-1,1]);u.bufferData(u.ARRAY_BUFFER,N,u.STATIC_DRAW),u.vertexAttribPointer(lt,1,u.FLOAT,!1,0,0),u.clearColor(0,0,0,0),u.clear(u.COLOR_BUFFER_BIT),c=!0}y.set([w.length>>8&255,w.length&255],1),y.set(w,3),O[y.length>>2]=0,C.set(y),C[y.length]=128;for(let rt=0;rt"0123456789ABCDEFabcdef".includes(r)).length)},running:!1,generatedKey:void 0,hashCount:0,runningTime:0,mounted(){this.patternHelper(),/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)&&(this.thread=1024,this.iteration=256)},addUserID(){!this.userIDInput.name||!this.userIDInput.email||(this.userID.push({...this.userIDInput}),this.userIDInput.name=this.userIDInput.email="")},patternHelper(){this.pattern=("*".repeat(40-this.patternLength)+this.patternNumber.repeat(this.patternLength)).match(/[^]{1,4}/g).join(" ")},async toggleKeygen(){if(this.running){this.running=!1;return}(!this.userID.length||this.userIDInput.name&&this.userIDInput.email)&&this.addUserID(),this.generatedKey=void 0,this.hashCount=0,this.runningTime=0,this.running=!0;try{const r={userIDs:this.userID};switch(this.keyType){case"curve25519":case"p256":case"p384":case"p521":case"brainpoolP256r1":case"brainpoolP384r1":case"brainpoolP512r1":r.type="ecc",r.curve=this.keyType;break;case"2048":case"3072":case"4096":r.type="rsa",r.rsaBits=parseInt(this.keyType);break}this.generatedKey=await tu(r,this.pattern,this.thread,this.iteration,(e,t)=>{this.hashCount=e,this.runningTime=t},()=>!this.running)}catch(r){alert(r)}finally{this.running=!1}}};M2(eu).mount();export{Tn as A,K1 as J,Zc as M,Pi as Y,Ct as d,Xa as g,Ic as i,Za as r,iu as t,au as x,d3 as y,co as z}; diff --git a/index.html b/index.html index 9b84067..217b9ea 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -webgl-vanity-gpg

使用 GPU(WebGL)快速生成带有“靓号”的 PGP 密钥!

“靓号”指的是带有连号等特定格式的密钥指纹或 ID(例如以 77777777 结尾),具体介绍和生成原理请参见:

密钥使用 OpenPGP.js 在浏览器中生成,不会发送到其他地方。如果仍然担心这一点,可以检查源代码、查看浏览器开发者工具的“网络”部分、或在页面加载完成后断网使用。


可以按 Enter 添加更多的用户 ID。

  • {{ e.name }} <{{ e.email }}> [x]

如果发现 GPU 占用率不够高,请增大这两个值。

你会得到一个生效时间距离现在 {{ (backTime > 2592000) ? `${Math.ceil(backTime / 2592000)} 个月` : `${Math.ceil(backTime / 86400)} 天` }}之内(最早为 {{ (new Date(Date.now() - backTime * 1000)).toISOString() }})的密钥。

40 个十六进制数字,不区分大小写。空格会被忽略,其他 [\dA-F] 以外的字符表示对该位数字没有要求。

最后 个数字为 快速设置

预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍。


已计算 hash:{{ hashCount }}
耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s
速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s

私钥
公钥

生效时间:{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}

指纹:{{ (generatedKey?.publicKey.getFingerprint().toUpperCase() || '*'.repeat(40)).match(/[^]{1,4}/g).join(' ') }}


\ No newline at end of file +webgl-vanity-gpg

使用 GPU(WebGL)快速生成带有“靓号”的 PGP 密钥!

“靓号”指的是带有连号等特定格式的密钥指纹或 ID(例如以 77777777 结尾),具体介绍和生成原理请参见:

密钥使用 OpenPGP.js 在浏览器中生成,不会发送到其他地方。如果仍然担心这一点,可以检查源代码、查看浏览器开发者工具的“网络”部分、或在页面加载完成后断网使用。


可以按 Enter 添加更多的用户 ID。

  • {{ e.name }} <{{ e.email }}> [x]

如果发现 GPU 占用率不够高,请增大这两个值。

你会得到一个生效时间距离现在 {{ (backTime > 2592000) ? `${Math.ceil(backTime / 2592000)} 个月` : `${Math.ceil(backTime / 86400)} 天` }}之内(最早为 {{ (new Date(Date.now() - backTime * 1000)).toISOString() }})的密钥。

40 个十六进制数字,不区分大小写。空格会被忽略,其他 [\dA-F] 以外的字符表示对该位数字没有要求。

最后 个数字为 快速设置

预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍。


已计算 hash:{{ hashCount }}
耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s
速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s

私钥
公钥

生效时间:{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}

指纹:{{ (generatedKey?.publicKey.getFingerprint().toUpperCase() || '*'.repeat(40)).match(/[^]{1,4}/g).join(' ') }}


\ No newline at end of file