From 51555d7dfe35c091f9357b998cf54219cf4f03d0 Mon Sep 17 00:00:00 2001 From: TransparentLC Date: Thu, 18 Jul 2024 14:49:20 +0000 Subject: [PATCH] deploy: 4a2a9631a1df01a4ab5f9f891fbaff25a5623cb3 --- ....min-CNhE0xQO.js => bn.interface.min-Cz-BBNv_.js} | 2 +- assets/{bn.min-CmdOWnPu.js => bn.min-by8sOLd_.js} | 2 +- ...ptic.min-DVCE3zFm.js => elliptic.min-BfLLVq7v.js} | 2 +- assets/{index-CQX_9Ck1.js => index-Bg1fmUJl.js} | 12 ++++++------ index.html | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename assets/{bn.interface.min-CNhE0xQO.js => bn.interface.min-Cz-BBNv_.js} (96%) rename assets/{bn.min-CmdOWnPu.js => bn.min-by8sOLd_.js} (99%) rename assets/{elliptic.min-DVCE3zFm.js => elliptic.min-BfLLVq7v.js} (99%) rename assets/{index-CQX_9Ck1.js => index-Bg1fmUJl.js} (99%) diff --git a/assets/bn.interface.min-CNhE0xQO.js b/assets/bn.interface.min-Cz-BBNv_.js similarity index 96% rename from assets/bn.interface.min-CNhE0xQO.js rename to assets/bn.interface.min-Cz-BBNv_.js index c50df49..809f1f8 100644 --- a/assets/bn.interface.min-CNhE0xQO.js +++ b/assets/bn.interface.min-Cz-BBNv_.js @@ -1 +1 @@ -import t from"./bn.min-CmdOWnPu.js";import"./index-CQX_9Ck1.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-by8sOLd_.js";import"./index-Bg1fmUJl.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-CmdOWnPu.js b/assets/bn.min-by8sOLd_.js similarity index 99% rename from assets/bn.min-CmdOWnPu.js rename to assets/bn.min-by8sOLd_.js index 2045197..4296a6a 100644 --- a/assets/bn.min-CmdOWnPu.js +++ b/assets/bn.min-by8sOLd_.js @@ -1 +1 @@ -import{r as ei,t as si}from"./index-CQX_9Ck1.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-Bg1fmUJl.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-DVCE3zFm.js b/assets/elliptic.min-BfLLVq7v.js similarity index 99% rename from assets/elliptic.min-DVCE3zFm.js rename to assets/elliptic.min-BfLLVq7v.js index 5217fc8..4bd2f7b 100644 --- a/assets/elliptic.min-DVCE3zFm.js +++ b/assets/elliptic.min-BfLLVq7v.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-CQX_9Ck1.js";import u from"./bn.min-CmdOWnPu.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]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./bn.interface.min-Cz-BBNv_.js","./bn.min-by8sOLd_.js","./elliptic.min-BfLLVq7v.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 c5=Object.defineProperty,u5=(r,e,t)=>e in r?c5(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Hr=(r,e,t)=>(u5(r,typeof e!="symbol"?e+"":e,t),t);function h5(r,e){const t=Object.create(null),n=r.split(",");for(let i=0;i!!t[i]}function wo(r){if(he(r)){const e={};for(let t=0;t{if(t){const n=t.split(f5);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function bo(r){let e="";if(Un(r))e=r;else if(he(r))for(let t=0;t_n(t,e))}const p5=Object.assign,g5=(r,e)=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)},m5=Object.prototype.hasOwnProperty,Ms=(r,e)=>m5.call(r,e),he=Array.isArray,$a=r=>ko(r)==="[object Map]",f1=r=>r instanceof Date,Un=r=>typeof r=="string",Ns=r=>typeof r=="symbol",Lr=r=>r!==null&&typeof r=="object",w5=Object.prototype.toString,ko=r=>w5.call(r),b5=r=>ko(r).slice(8,-1),Hs=r=>Un(r)&&r!=="NaN"&&r[0]!=="-"&&""+parseInt(r,10)===r,vo=r=>{const e=Object.create(null);return t=>e[t]||(e[t]=r(t))},k5=/-(\w)/g,v5=vo(r=>r.replace(k5,(e,t)=>t?t.toUpperCase():"")),A5=/\B([A-Z])/g,Ao=vo(r=>r.replace(A5,"-$1").toLowerCase()),_5=(r,e)=>!Object.is(r,e),d1=r=>{const e=parseFloat(r);return isNaN(e)?r:e};let E5;function _o(r,e){e=e||E5,e&&e.active&&e.effects.push(r)}const Eo=r=>{const e=new Set(r);return e.w=0,e.n=0,e},So=r=>(r.w&Or)>0,Po=r=>(r.n&Or)>0,S5=({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?Mn[e-1]:void 0}}stop(){this.active&&(p1(this),this.onStop&&this.onStop(),this.active=!1)}};function p1(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)?Hs(t)&&o.push(s.get("length")):(o.push(s.get(Gi)),$a(r)&&o.push(s.get(y1)));break;case"delete":he(r)||(o.push(s.get(Gi)),$a(r)&&o.push(s.get(y1)));break;case"set":$a(r)&&o.push(s.get(Gi));break}if(o.length===1)o[0]&&g1(o[0]);else{const u=[];for(const c of o)c&&u.push(...c);g1(Eo(u))}}function g1(r,e){for(const t of he(r)?r:[...r])(t!==tn||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const B5=h5("__proto__,__v_isRef,__isVue"),Ko=new Set(Object.getOwnPropertyNames(Symbol).map(r=>Symbol[r]).filter(Ns)),R5=xo(),z5=xo(!0),m1=L5();function L5(){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){C5();const n=en(this)[e].apply(this,t);return Uo(),n}}),r}function xo(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?G5:Do:e?q5:Co).get(t))return t;const a=he(t);if(!r&&a&&Ms(m1,n))return Reflect.get(m1,n,i);const s=Reflect.get(t,n,i);return(Ns(n)?Ko.has(n):B5(n))||(r||va(t,"get",n),e)?s:vs(s)?!a||!Hs(n)?s.value:s:Lr(s)?r?Z5(s):Aa(s):s}}const O5=M5();function M5(r=!1){return function(e,t,n,i){let a=e[t];if(!r&&!Q5(n)&&(n=en(n),a=en(a),!he(e)&&vs(a)&&!vs(n)))return a.value=n,!0;const s=he(e)&&Hs(t)?Number(t)X5.then(r),w1=r=>{ta.includes(r)||ta.push(r),As||(As=!0,_a(Y5))},Y5=()=>{for(const r of ta)r();ta.length=0,As=!1},J5=/^(spellcheck|draggable|form|list|type)$/,_s=({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=v5(n)),ja(r,n,s,a);else{for(const o in s)ja(r,o,s[o],a&&a[o]);for(const o in a)(!s||!(o in s))&&ja(r,o,null)}a=s})},ja=(r,e,t,n)=>{if(e==="class")r.setAttribute("class",bo(r._class?[r._class,t]:t)||"");else if(e==="style"){t=wo(t);const{style:i}=r;if(!t)r.removeAttribute("style");else if(Un(t))t!==n&&(i.cssText=t);else{for(const a in t)Es(i,a,t[a]);if(n&&!Un(n))for(const a in n)t[a]==null&&Es(i,a,"")}}else!(r instanceof SVGElement)&&e in r&&!J5.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)},b1=/\s*!important$/,Es=(r,e,t)=>{he(t)?t.forEach(n=>Es(r,e,n)):e.startsWith("--")?r.setProperty(e,t):b1.test(t)?r.setProperty(Ao(e),t.replace(b1,""),"important"):r[e]=t},Cr=(r,e)=>{const t=r.getAttribute(e);return t!=null&&r.removeAttribute(e),t},Er=(r,e,t,n)=>{r.addEventListener(e,t,n)},tc=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ec=["ctrl","shift","alt","meta"],rc={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)=>ec.some(t=>r[`${t}Key`]&&!e[t])},To=({el:r,get:e,exp:t,arg:n,modifiers:i})=>{if(!n)return;let a=tc.test(t)?e(`(e => ${t}(e))`):e(`($event => { ${t} })`);if(n==="vue:mounted"){_a(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&&!(Ao(o.key)in i))){for(const u in i){const c=rc[u];if(c&&c(o,i))return}return s(o)}}}Er(r,n,a,i)},nc=({el:r,get:e,effect:t})=>{const n=r.style.display;t(()=>{r.style.display=e()?n:"none"})},Bo=({el:r,get:e,effect:t})=>{t(()=>{r.textContent=Ro(e())})},Ro=r=>r==null?"":Lr(r)?JSON.stringify(r,null,2):String(r),ic=({el:r,get:e,effect:t})=>{t(()=>{r.innerHTML=e()})},ac=({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?d1(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(x);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=Fa(h,w),K=y!==-1;if(l&&!K)s(h.concat(w));else if(!l&&K){const x=[...h];x.splice(y,1),s(x)}}else s(k1(r,l))});let c;n(()=>{const h=t();he(h)?r.checked=Fa(h,vr(r))>-1:h!==c&&(r.checked=_n(h,k1(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?d1(h):h;Er(r,"compositionstart",sc),Er(r,"compositionend",oc),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,k1=(r,e)=>{const t=e?"_trueValue":"_falseValue";return t in r?r[t]:e},sc=r=>{r.target.composing=!0},oc=r=>{const e=r.target;e.composing&&(e.composing=!1,cc(e,"input"))},cc=(r,e)=>{const t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),r.dispatchEvent(t)},v1=Object.create(null),di=(r,e,t)=>zo(r,`return(${e})`,t),zo=(r,e,t)=>{const n=v1[e]||(v1[e]=uc(e));try{return n(r,t)}catch(i){console.error(i)}},uc=r=>{try{return new Function("$data","$el",`with($data){${r}}`)}catch(e){return console.error(`${e.message} in expression: ${r}`),()=>{}}},hc=({el:r,ctx:e,exp:t,effect:n})=>{_a(()=>n(()=>zo(e.scope,t,r)))},lc={bind:_s,on:To,show:nc,text:Bo,html:ic,model:ac,effect:hc},fc=(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,Cr(s,"v-else")===""||(o=Cr(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(dc);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(yc,"").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 x;(x=u.match(A1))&&(u=u.replace(A1,"").trim(),l=x[1].trim(),x[2]&&(w=x[2].trim())),(x=u.match(pc))&&(c=x[1].split(",").map(q=>q.trim()),h=u[0]==="[");let M=!1,F,Q,H;const E=q=>{const G=new Map,Z=[];if(he(q))for(let tt=0;tt{const rt={};c?c.forEach((O,ft)=>rt[O]=G[h?ft:O]):rt[u]=G,tt?(l&&(rt[l]=tt),w&&(rt[w]=Z)):l&&(rt[l]=Z);const dt=No(t,rt),it=K?di(dt.scope,K):Z;return q.set(it,Z),dt.key=it,dt},j=(q,G)=>{const Z=new $s(r,q);return Z.key=q.key,Z.insert(a,G),Z};return t.effect(()=>{const q=di(t.scope,o),G=H;if([Q,H]=E(q),!M)F=Q.map(Z=>j(Z,s)),M=!0;else{for(let it=0;it{let i;return n(()=>{const a=t();e[a]=r,i&&a!==i&&delete e[i],i=a}),()=>{i&&delete e[i]}},mc=/^(?:v-|:|@)/,wc=/\.([\w-]+)/g;let Ss=!1;const Oo=(r,e)=>{const t=r.nodeType;if(t===1){const n=r;if(n.hasAttribute("v-pre"))return;Cr(n,"v-cloak");let i;if(i=Cr(n,"v-if"))return fc(n,i,e);if(i=Cr(n,"v-for"))return gc(n,i,e);if((i=Cr(n,"v-scope"))||i===""){const o=i?di(e.scope,i):{};e=No(e,o),o.$template&&bc(n,o.$template)}const a=Cr(n,"v-once")!=null;a&&(Ss=!0),(i=Cr(n,"ref"))&&Ps(n,Lo,`"${i}"`,e),_1(n,e);const s=[];for(const{name:o,value:u}of[...n.attributes])mc.test(o)&&o!=="v-cloak"&&(o==="v-model"?s.unshift([o,u]):o[0]==="@"||/^v-on\b/.test(o)?s.push([o,u]):E1(n,o,u,e));for(const[o,u]of s)E1(n,o,u,e);a&&(Ss=!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=Oo(t,e)||t.nextSibling},E1=(r,e,t,n)=>{let i,a,s;if(e=e.replace(wc,(o,u)=>((s||(s={}))[u]=!0,"")),e[0]===":")i=_s,a=e.slice(1);else if(e[0]==="@")i=To,a=e.slice(1);else{const o=e.indexOf(":"),u=o>0?e.slice(2,o):e.slice(2);i=lc[u]||n.dirs[u],a=o>0?e.slice(o+1):void 0}i&&(i===_s&&a==="ref"&&(i=Lo),Ps(r,i,t,n,a,s),r.removeAttribute(e))},Ps=(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)},bc=(r,e)=>{if(e[0]==="#"){const t=document.querySelector(e);r.appendChild(t.content.cloneNode(!0));return}r.innerHTML=e},Mo=r=>{const e={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...r,scope:r?r.scope:Aa({}),dirs:r?r.dirs:{},effects:[],blocks:[],cleanups:[],effect:t=>{if(Ss)return w1(t),t;const n=K5(t,{scheduler:()=>w1(n)});return e.effects.push(n),n}};return e},No=(r,e={})=>{const t=r.scope,n=Object.create(t);Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n.$refs=Object.create(t.$refs);const i=Aa(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 Ho(i),{...r,scope:i}},Ho=r=>{for(const e of Object.keys(r))typeof r[e]=="function"&&(r[e]=r[e].bind(r))};let $s=class{constructor(e,t,n=!1){Hr(this,"template"),Hr(this,"ctx"),Hr(this,"key"),Hr(this,"parentCtx"),Hr(this,"isFragment"),Hr(this,"start"),Hr(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=Mo(t)),Oo(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&&g5(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(x5),this.ctx.cleanups.forEach(e=>e())}};const S1=r=>r.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),Fo=r=>{const e=Mo();if(r&&(e.scope=Aa(r),Ho(e.scope),r.$delimiters)){const[n,i]=e.delimiters=r.$delimiters;e.delimitersRE=new RegExp(S1(n)+"([^]+?)"+S1(i),"g")}e.scope.$s=Ro,e.scope.$nextTick=_a,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 $s(a,e,!0)),this},unmount(){t.forEach(n=>n.teardown())}}},P1=document.currentScript;P1&&P1.hasAttribute("init")&&Fo().mount();const kc="modulepreload",vc=function(r,e){return new URL(r,e).href},U1={},Vr=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=vc(u,n),u in U1)return;U1[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":kc,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})},Ye=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},kn=Symbol("doneWritingPromise"),$o=Symbol("doneWritingResolve"),jo=Symbol("doneWritingReject"),Nn=Symbol("readingIndex");class Ze extends Array{constructor(){super(),this[kn]=new Promise((e,t)=>{this[$o]=e,this[jo]=t}),this[kn].catch(()=>{})}}function le(r){return r&&r.getReader&&Array.isArray(r)}function Vn(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[Nn]===void 0&&(this[Nn]=0),{read:async()=>(await this[kn],this[Nn]===this.length?{value:void 0,done:!0}:{value:this[this[Nn]++],done:!1})}},Ze.prototype.readToEnd=async function(r){await this[kn];const e=r(this.slice(this[Nn]));return this.length=0,e},Ze.prototype.clone=function(){const r=new Ze;return r[kn]=this[kn].then(()=>{r.push(...this)}),r},Vn.prototype.write=async function(r){this.stream.push(r)},Vn.prototype.close=async function(){this.stream[$o]()},Vn.prototype.abort=async function(r){return this.stream[jo](r),r},Vn.prototype.releaseLock=function(){};const Ea=typeof Ye.process=="object"&&typeof Ye.process.versions=="object",K1=Ea&&void 0;function ve(r){return le(r)?"array":Ye.ReadableStream&&Ye.ReadableStream.prototype.isPrototypeOf(r)?"web":xn&&xn.prototype.isPrototypeOf(r)?"ponyfill":K1&&K1.prototype.isPrototypeOf(r)?"node":!(!r||!r.getReader)&&"web-like"}function Sa(r){return Uint8Array.prototype.isPrototypeOf(r)}function qo(r){if(r.length===1)return r[0];let e=0;for(let i=0;i{t||(Ac.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 x1{constructor(t,n){super(n),this._reader=sn(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)}}Go=function(e,t){return new r(e,t)}}const C1=new WeakSet,Gt=Symbol("externalBuffer");function $e(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=Pa(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||C1.has(r)?{value:void 0,done:!0}:(t=!0,{value:r,done:!1}),this._releaseLock=()=>{if(t)try{C1.add(r)}catch{}}}$e.prototype.read=async function(){return this[Gt]&&this[Gt].length?{done:!1,value:this[Gt].shift()}:this._read()},$e.prototype.releaseLock=function(){this[Gt]&&(this.stream[Gt]=this[Gt]),this._releaseLock()},$e.prototype.cancel=function(r){return this._cancel(r)},$e.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},$e.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},$e.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)}}},$e.prototype.peekBytes=async function(r){const e=await this.readBytes(r);return this.unshift(e),e},$e.prototype.unshift=function(...r){this[Gt]||(this[Gt]=[]),r.length===1&&Sa(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))},$e.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 D1,{ReadableStream:xn,WritableStream:_c,TransformStream:js}=Ye;const ii=Ea&&void 0;function qs(r){let e=ve(r);return e==="node"?Pa(r):e==="web"&&D1?D1(r):e?r:new xn({start(t){t.enqueue(r),t.close()}})}function Vo(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(qs);const t=Zo(async function(a){await Promise.all(i.map(s=>Ec(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):qo(r)}function sn(r){return new $e(r)}function Oe(r){return new Vn(r)}async function yi(r,e,{preventClose:t=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(ve(r)&&!le(r)){r=qs(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 Yt(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 Wo(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 js({start(o){n=o}}),a=yi(r,i.writable),s=Zo(async function(o){n.error(o),await a,await new Promise(setTimeout)});return e(i.readable,s.writable),s.readable}r=Vo(r);const t=new Ze;return e(r,t),t}function ea(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=qs(t).tee();return n[0][Gt]=n[1][Gt]=t[Gt],n}return[_e(t),_e(t)]}(r);return Xo(r,e[0]),e[1]}return _e(r)}function Qo(r){return le(r)?ea(r):ve(r)?new xn({start(e){const t=pi(r,async(n,i)=>{const a=sn(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)}});Xo(r,t)}}):_e(r)}function Xo(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 Wo(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 Yt(r,i=>{i.length>=-e?n=[i]:n.push(i)},()=>_e(Ue(n),e,t))}if(e===0&&t<0){let n;return Yt(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]))),!Sa(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)?sn(r).readToEnd(e):r}async function Ec(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",Hn=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[Hn]||(r[Hn]=[],Object.entries(r).forEach(([t,n])=>{r[Hn][n]=t})),r[Hn][e]!==void 0)return r[Hn][e];throw Error("Invalid enum value.")}};const I1=(()=>{try{return!1}catch{}return!1})(),_={isString:function(r){return typeof r=="string"||r instanceof String},isArray:function(r){return r instanceof Array},isUint8Array:Sa,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 Yt(r,t,()=>t(new Uint8Array,!0))},concat:Ue,concatUint8Array:qo,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 Ye!==void 0&&Ye.crypto&&Ye.crypto.subtle},getBigInteger:async function(){if(Sc())return me;{const{default:r}=await Vr(async()=>{const{default:e}=await import("./bn.interface.min-CNhE0xQO.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 Yt(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 Yt(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(` +`)+1;i&&(r=Ue(e.concat(n.substr(0,i))),e=[]),i!==n.length&&e.push(n.substr(i))}return this.unshift(...e),r},$e.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},$e.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)}}},$e.prototype.peekBytes=async function(r){const e=await this.readBytes(r);return this.unshift(e),e},$e.prototype.unshift=function(...r){this[Gt]||(this[Gt]=[]),r.length===1&&Sa(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))},$e.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 D1,{ReadableStream:xn,WritableStream:_c,TransformStream:js}=Ye;const ii=Ea&&void 0;function qs(r){let e=ve(r);return e==="node"?Pa(r):e==="web"&&D1?D1(r):e?r:new xn({start(t){t.enqueue(r),t.close()}})}function Vo(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(qs);const t=Zo(async function(a){await Promise.all(i.map(s=>Ec(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):qo(r)}function sn(r){return new $e(r)}function Oe(r){return new Vn(r)}async function yi(r,e,{preventClose:t=!1,preventAbort:n=!1,preventCancel:i=!1}={}){if(ve(r)&&!le(r)){r=qs(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 Yt(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 Wo(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 js({start(o){n=o}}),a=yi(r,i.writable),s=Zo(async function(o){n.error(o),await a,await new Promise(setTimeout)});return e(i.readable,s.writable),s.readable}r=Vo(r);const t=new Ze;return e(r,t),t}function ea(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=qs(t).tee();return n[0][Gt]=n[1][Gt]=t[Gt],n}return[_e(t),_e(t)]}(r);return Xo(r,e[0]),e[1]}return _e(r)}function Qo(r){return le(r)?ea(r):ve(r)?new xn({start(e){const t=pi(r,async(n,i)=>{const a=sn(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)}});Xo(r,t)}}):_e(r)}function Xo(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 Wo(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 Yt(r,i=>{i.length>=-e?n=[i]:n.push(i)},()=>_e(Ue(n),e,t))}if(e===0&&t<0){let n;return Yt(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]))),!Sa(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)?sn(r).readToEnd(e):r}async function Ec(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",Hn=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[Hn]||(r[Hn]=[],Object.entries(r).forEach(([t,n])=>{r[Hn][n]=t})),r[Hn][e]!==void 0)return r[Hn][e];throw Error("Invalid enum value.")}};const I1=(()=>{try{return!1}catch{}return!1})(),_={isString:function(r){return typeof r=="string"||r instanceof String},isArray:function(r){return r instanceof Array},isUint8Array:Sa,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 Yt(r,t,()=>t(new Uint8Array,!0))},concat:Ue,concatUint8Array:qo,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 Ye!==void 0&&Ye.crypto&&Ye.crypto.subtle},getBigInteger:async function(){if(Sc())return me;{const{default:r}=await Vr(async()=>{const{default:e}=await import("./bn.interface.min-Cz-BBNv_.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 Yt(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 Yt(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=_.concatUint8Array([e,t]);const n=[],i=Math.floor(e.length/45),a=45*i,s=ra(e.subarray(0,a));for(let o=0;oe.length?ra(e)+` @@ -29,7 +29,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./bn.interface.min-CNh `),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 _.concat(c)}class Cn{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 Cn;return t.read(_.hexToUint8Array(e)),t}static wildcard(){const e=new Cn;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(x){var M,F,Q;for(F=Q=function(H){var E=r[255-e[H]];return H===0&&(E=0),E}(x),M=0;M<4;M++)Q^=F=255&(F<<1|F>>>7);return Q^=99}t||function(){r=[],e=[];var x,M,F=1;for(x=0;x<255;x++)r[x]=F,M=128&F,F<<=1,F&=255,M===128&&(F^=27),F^=r[x],e[r[x]]=x;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 x=function(M,F,Q){var H=0,E=0,V=0,j=0,q=0,G=0,Z=0,tt=0,rt=0,dt=0,it=0,O=0,ft=0,Pt=0,$=0,at=0,mt=0,bt=0,yt=0,pt=0,gt=0,ct=new M.Uint32Array(Q),S=new M.Uint8Array(Q);function N(v,k,nt,st,St,It,zt,Ct){v=v|0,k=k|0,nt=nt|0,st=st|0,St=St|0,It=It|0,zt=zt|0,Ct=Ct|0;var Vt=0,Xt=0,Jt=0,ne=0,xt=0,Mt=0,Lt=0,Et=0;for(Vt=nt|1024,Xt=nt|2048,Jt=nt|3072,St=St^ct[(v|0)>>2],It=It^ct[(v|4)>>2],zt=zt^ct[(v|8)>>2],Ct=Ct^ct[(v|12)>>2],Et=16;(Et|0)<=st<<4;Et=Et+16|0)ne=ct[(nt|St>>22&1020)>>2]^ct[(Vt|It>>14&1020)>>2]^ct[(Xt|zt>>6&1020)>>2]^ct[(Jt|Ct<<2&1020)>>2]^ct[(v|Et|0)>>2],xt=ct[(nt|It>>22&1020)>>2]^ct[(Vt|zt>>14&1020)>>2]^ct[(Xt|Ct>>6&1020)>>2]^ct[(Jt|St<<2&1020)>>2]^ct[(v|Et|4)>>2],Mt=ct[(nt|zt>>22&1020)>>2]^ct[(Vt|Ct>>14&1020)>>2]^ct[(Xt|St>>6&1020)>>2]^ct[(Jt|It<<2&1020)>>2]^ct[(v|Et|8)>>2],Lt=ct[(nt|Ct>>22&1020)>>2]^ct[(Vt|St>>14&1020)>>2]^ct[(Xt|It>>6&1020)>>2]^ct[(Jt|zt<<2&1020)>>2]^ct[(v|Et|12)>>2],St=ne,It=xt,zt=Mt,Ct=Lt;H=ct[(k|St>>22&1020)>>2]<<24^ct[(k|It>>14&1020)>>2]<<16^ct[(k|zt>>6&1020)>>2]<<8^ct[(k|Ct<<2&1020)>>2]^ct[(v|Et|0)>>2],E=ct[(k|It>>22&1020)>>2]<<24^ct[(k|zt>>14&1020)>>2]<<16^ct[(k|Ct>>6&1020)>>2]<<8^ct[(k|St<<2&1020)>>2]^ct[(v|Et|4)>>2],V=ct[(k|zt>>22&1020)>>2]<<24^ct[(k|Ct>>14&1020)>>2]<<16^ct[(k|St>>6&1020)>>2]<<8^ct[(k|It<<2&1020)>>2]^ct[(v|Et|8)>>2],j=ct[(k|Ct>>22&1020)>>2]<<24^ct[(k|St>>14&1020)>>2]<<16^ct[(k|It>>6&1020)>>2]<<8^ct[(k|zt<<2&1020)>>2]^ct[(v|Et|12)>>2]}function b(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,v,k,nt,st)}function f(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0;N(1024,3072,8192,gt,v,st,nt,k),St=E,E=j,j=St}function U(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q^v,G^k,Z^nt,tt^st),q=H,G=E,Z=V,tt=j}function W(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0;N(1024,3072,8192,gt,v,st,nt,k),St=E,E=j,j=St,H=H^q,E=E^G,V=V^Z,j=j^tt,q=v,G=k,Z=nt,tt=st}function X(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q,G,Z,tt),q=H=H^v,G=E=E^k,Z=V=V^nt,tt=j=j^st}function Y(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q,G,Z,tt),H=H^v,E=E^k,V=V^nt,j=j^st,q=v,G=k,Z=nt,tt=st}function g(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q,G,Z,tt),q=H,G=E,Z=V,tt=j,H=H^v,E=E^k,V=V^nt,j=j^st}function d(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,rt,dt,it,O),O=~at&O|at&O+1,it=~$&it|$&it+((O|0)==0),dt=~Pt&dt|Pt&dt+((it|0)==0),rt=~ft&rt|ft&rt+((dt|0)==0),H=H^v,E=E^k,V=V^nt,j=j^st}function m(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0,It=0,zt=0,Ct=0,Vt=0,Xt=0,Jt=0,ne=0,xt=0,Mt=0;for(v=v^q,k=k^G,nt=nt^Z,st=st^tt,St=mt|0,It=bt|0,zt=yt|0,Ct=pt|0;(xt|0)<128;xt=xt+1|0)St>>>31&&(Vt=Vt^v,Xt=Xt^k,Jt=Jt^nt,ne=ne^st),St=St<<1|It>>>31,It=It<<1|zt>>>31,zt=zt<<1|Ct>>>31,Ct=Ct<<1,Mt=st&1,st=st>>>1|nt<<31,nt=nt>>>1|k<<31,k=k>>>1|v<<31,v=v>>>1,Mt&&(v=v^3774873600);q=Vt,G=Xt,Z=Jt,tt=ne}function A(v){v=v|0,gt=v}function T(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,H=v,E=k,V=nt,j=st}function P(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,q=v,G=k,Z=nt,tt=st}function z(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,rt=v,dt=k,it=nt,O=st}function ht(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,ft=v,Pt=k,$=nt,at=st}function ot(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,O=~at&O|at&st,it=~$&it|$&nt,dt=~Pt&dt|Pt&k,rt=~ft&rt|ft&v}function lt(v){return v=v|0,v&15?-1:(S[v|0]=H>>>24,S[v|1]=H>>>16&255,S[v|2]=H>>>8&255,S[v|3]=H&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]=V>>>24,S[v|9]=V>>>16&255,S[v|10]=V>>>8&255,S[v|11]=V&255,S[v|12]=j>>>24,S[v|13]=j>>>16&255,S[v|14]=j>>>8&255,S[v|15]=j&255,16)}function I(v){return v=v|0,v&15?-1:(S[v|0]=q>>>24,S[v|1]=q>>>16&255,S[v|2]=q>>>8&255,S[v|3]=q&255,S[v|4]=G>>>24,S[v|5]=G>>>16&255,S[v|6]=G>>>8&255,S[v|7]=G&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 C(){b(0,0,0,0),mt=H,bt=E,yt=V,pt=j}function D(v,k,nt){v=v|0,k=k|0,nt=nt|0;var st=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]=H>>>24,S[k|1]=H>>>16&255,S[k|2]=H>>>8&255,S[k|3]=H&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]=V>>>24,S[k|9]=V>>>16&255,S[k|10]=V>>>8&255,S[k|11]=V&255,S[k|12]=j>>>24,S[k|13]=j>>>16&255,S[k|14]=j>>>8&255,S[k|15]=j&255,st=st+16|0,k=k+16|0,nt=nt-16|0;return st|0}function B(v,k,nt){v=v|0,k=k|0,nt=nt|0;var st=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]),st=st+16|0,k=k+16|0,nt=nt-16|0;return st|0}var R=[b,f,U,W,X,Y,g,d],L=[U,m];return{set_rounds:A,set_state:T,set_iv:P,set_nonce:z,set_mask:ht,set_counter:ot,get_state:lt,get_iv:I,gcm_init:C,cipher:D,mac:B}}({Uint8Array,Uint32Array},l,w);return x.set_key=function(M,F,Q,H,E,V,j,q,G){var Z=y.subarray(0,60),tt=y.subarray(256,316);Z.set([F,Q,H,E,V,j,q,G]);for(var rt=M,dt=1;rt<4*M+28;rt++){var it=Z[rt-1];(rt%M==0||M===8&&rt%M==4)&&(it=i[it>>>24]<<24^i[it>>>16&255]<<16^i[it>>>8&255]<<8^i[255&it]),rt%M==0&&(it=it<<8^it>>>24^dt<<24,dt=dt<<1^(128&dt?27:0)),Z[rt]=Z[rt-M]^it}for(var O=0;O=rt-4?it:o[0][i[it>>>24]]^o[1][i[it>>>16&255]]^o[2][i[it>>>8&255]]^o[3][i[255&it]];x.set_rounds(M+5)},x};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 B1(r){return r instanceof Uint8Array}function Vs(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 Wr(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(!B1(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=Wr(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=Wr(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 Ks("bad padding");let h=0;for(let l=c;l>1;l--)h|=c^e[a+o-l];if(h)throw new Ks("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 ia{static encrypt(e,t,n=!1){return new ia(t,n).encrypt(e)}static decrypt(e,t,n=!1){return new ia(t,n).decrypt(e)}constructor(e,t=!1,n){this.aes=n||new Ei(e,void 0,t,"ECB")}encrypt(e){return Mr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Mr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Ws(r){const e=function(t){const n=new ia(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,x,M,F,Q,H,E,V,j,q,G=0,Z=e.length;const tt=r.length===32?3:9;V=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(it,O){const ft=8-it.length%8;let Pt;if(O===2&&ft<8)Pt=32;else if(O===1)Pt=ft;else{if(O||!(ft<8)){if(ft===8)return it;throw Error("des: invalid padding")}Pt=0}const $=new Uint8Array(it.length+ft);for(let at=0;at>>4^E),E^=M,H^=M<<4,M=65535&(H>>>16^E),E^=M,H^=M<<16,M=858993459&(E>>>2^H),H^=M,E^=M<<2,M=16711935&(E>>>8^H),H^=M,E^=M<<8,M=1431655765&(H>>>1^E),E^=M,H^=M<<1,H=H<<1|H>>>31,E=E<<1|E>>>31,x=0;x>>4|E<<28)^r[K+1],M=H,H=E,E=M^(o[F>>>24&63]|c[F>>>16&63]|l[F>>>8&63]|y[63&F]|s[Q>>>24&63]|u[Q>>>16&63]|h[Q>>>8&63]|w[63&Q]);M=H,H=E,E=M}H=H>>>1|H<<31,E=E>>>1|E<<31,M=1431655765&(H>>>1^E),E^=M,H^=M<<1,M=16711935&(E>>>8^H),H^=M,E^=M<<8,M=858993459&(E>>>2^H),H^=M,E^=M<<2,M=65535&(H>>>16^E),E^=M,H^=M<<16,M=252645135&(H>>>4^E),E^=M,H^=M<<4,rt[dt++]=H>>>24,rt[dt++]=H>>>16&255,rt[dt++]=H>>>8&255,rt[dt++]=255&H,rt[dt++]=E>>>24,rt[dt++]=E>>>16&255,rt[dt++]=E>>>8&255,rt[dt++]=255&E}return t||(rt=function(it,O){let ft,Pt=null;if(O===2)ft=32;else if(O===1)Pt=it[it.length-1];else{if(O)throw Error("des: invalid padding");ft=0}if(!Pt){for(Pt=1;it[it.length-Pt]===ft;)Pt++;Pt--}return it.subarray(0,it.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],x=r.length>8?3:1,M=Array(32*x),F=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Q,H,E,V=0,j=0;for(let q=0;q>>4^Z),Z^=E,G^=E<<4,E=65535&(Z>>>-16^G),G^=E,Z^=E<<-16,E=858993459&(G>>>2^Z),Z^=E,G^=E<<2,E=65535&(Z>>>-16^G),G^=E,Z^=E<<-16,E=1431655765&(G>>>1^Z),Z^=E,G^=E<<1,E=16711935&(Z>>>8^G),G^=E,Z^=E<<8,E=1431655765&(G>>>1^Z),Z^=E,G^=E<<1,E=G<<8|Z>>>20&240,G=Z<<24|Z<<8&16711680|Z>>>8&65280|Z>>>24&240,Z=E;for(let tt=0;tt<16;tt++)F[tt]?(G=G<<2|G>>>26,Z=Z<<2|Z>>>26):(G=G<<1|G>>>27,Z=Z<<1|Z>>>27),G&=-15,Z&=-15,Q=e[G>>>28]|t[G>>>24&15]|n[G>>>20&15]|i[G>>>16&15]|a[G>>>12&15]|s[G>>>8&15]|o[G>>>4&15],H=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&(H>>>16^Q),M[j++]=Q^E,M[j++]=H^E<<16}return M}function Wn(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 xc(){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 x=r[K][c];l=o[x[1]],l^=a[4][o[x[2]>>>2]>>>24-8*(3&x[2])&255],l^=a[5][o[x[3]>>>2]>>>24-8*(3&x[3])&255],l^=a[6][o[x[4]>>>2]>>>24-8*(3&x[4])&255],l^=a[7][o[x[5]>>>2]>>>24-8*(3&x[5])&255],l^=a[h[c]][o[x[6]>>>2]>>>24-8*(3&x[6])&255],o[x[0]]=l}for(c=0;c<4;c++){const x=e[K][c];l=a[4][o[x[0]>>>2]>>>24-8*(3&x[0])&255],l^=a[5][o[x[1]>>>2]>>>24-8*(3&x[1])&255],l^=a[6][o[x[2]>>>2]>>>24-8*(3&x[2])&255],l^=a[7][o[x[3]>>>2]>>>24-8*(3&x[3])&255],l^=a[4+c][o[x[4]>>>2]>>>24-8*(3&x[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 xc,this.cast5.setKey(r),this.encrypt=function(e){return this.cast5.encrypt(e)}}Wn.keySize=Wn.prototype.keySize=24,Wn.blockSize=Wn.prototype.blockSize=8,Zn.blockSize=Zn.prototype.blockSize=8,Zn.keySize=Zn.prototype.keySize=16;const Se=4294967295;function Ne(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 Qn(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]=Ne(l[2]^w+y+i[4*h+8]&Se,31),l[3]=Ne(l[3],1)^w+2*y+i[4*h+9]&Se,w=s(l[2]),y=o(l[3]),l[0]=Ne(l[0]^w+y+i[4*h+10]&Se,31),l[1]=Ne(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]=Ne(l[2],1)^w+y+i[4*h+10]&Se,l[3]=Ne(l[3]^w+2*y+i[4*h+11]&Se,31),w=s(l[2]),y=o(l[3]),l[0]=Ne(l[0],1)^w+y+i[4*h+8]&Se,l[1]=Ne(l[1]^w+2*y+i[4*h+9]&Se,31)}return{name:"twofish",blocksize:16,open:function(h){let l,w,y,K,x;e=h;const M=[],F=[],Q=[];let H;const E=[];let V,j,q;const G=[[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],it=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],O=[[],[]],ft=[[],[],[],[]];function Pt(yt){return yt^yt>>2^[0,90,180,238][3&yt]}function $(yt){return yt^yt>>1^yt>>2^[0,238,180,90][3&yt]}function at(yt,pt){let gt,ct,S;for(gt=0;gt<8;gt++)ct=pt>>>24,pt=pt<<8&Se|yt>>>24,yt=yt<<8&Se,S=ct<<1,128&ct&&(S^=333),pt^=ct^S<<16,S^=ct>>>1,1&ct&&(S^=166),pt^=S<<24|S<<8;return pt}function mt(yt,pt){const gt=pt>>4,ct=15&pt,S=G[yt][gt^ct],N=Z[yt][dt[ct]^it[gt]];return rt[yt][dt[N]^it[S]]<<4|tt[yt][S^N]}function bt(yt,pt){let gt=_t(yt,0),ct=_t(yt,1),S=_t(yt,2),N=_t(yt,3);switch(H){case 4:gt=O[1][gt]^_t(pt[3],0),ct=O[0][ct]^_t(pt[3],1),S=O[0][S]^_t(pt[3],2),N=O[1][N]^_t(pt[3],3);case 3:gt=O[1][gt]^_t(pt[2],0),ct=O[1][ct]^_t(pt[2],1),S=O[0][S]^_t(pt[2],2),N=O[0][N]^_t(pt[2],3);case 2:gt=O[0][O[0][gt]^_t(pt[1],0)]^_t(pt[0],0),ct=O[0][O[1][ct]^_t(pt[1],1)]^_t(pt[0],1),S=O[1][O[0][S]^_t(pt[1],2)]^_t(pt[0],2),N=O[1][O[1][N]^_t(pt[1],3)]^_t(pt[0],3)}return ft[0][gt]^ft[1][ct]^ft[2][S]^ft[3][N]}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++)O[0][l]=mt(0,l),O[1][l]=mt(1,l);for(l=0;l<256;l++)V=O[1][l],j=Pt(V),q=$(V),ft[0][l]=V+(j<<8)+(q<<16)+(q<<24),ft[2][l]=j+(q<<8)+(V<<16)+(q<<24),V=O[0][l],j=Pt(V),q=$(V),ft[1][l]=q+(q<<8)+(j<<16)+(V<<24),ft[3][l]=j+(V<<8)+(q<<16)+(j<<24);for(H=Q.length/2,l=0;l=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 Xn(r){this.bf=new Be,this.bf.init(r),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Qn.keySize=Qn.prototype.keySize=32,Qn.blockSize=Qn.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=at+(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=ct+(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=N+(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=W+(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=Y+(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=W^S^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=X^N^bt^at,ot=P<<1|P>>>31,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,P=Y^b^yt^mt,lt=P<<1|P>>>31,z=lt+(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=ht^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=ot^U^gt^yt,C=P<<1|P>>>31,z=C+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=lt^W^ct^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=C^Y^N^ct,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^ht^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^ot^f^N,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^lt^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^W^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^C^X^U,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=k^D^Y^W,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^ht^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=st^R^ot^Y,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^lt^ht,Ct=P<<1|P>>>31,z=Ct+(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^ot,Vt=P<<1|P>>>31,z=Vt+(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^C^lt,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=Ct^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=Vt^st^B^C,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=Xt^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,Mt=P<<1|P>>>31,z=Mt+(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^Ct^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=Mt^Vt^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^Xt^st^k,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=Et^Jt^St^nt,$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=jt^ne^It^st,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=Ht^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=$t^Mt^Ct^It,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=J^Lt^Vt^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^Xt^Ct,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=ut^jt^Jt^Vt,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^Ht^ne^Xt,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^$t^xt^Jt,Nt=P<<1|P>>>31,z=Nt+(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^Mt^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,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=Nt^ut^Et^Mt,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=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=Ce^kt^Ht^Et,Me=P<<1|P>>>31,z=Me+(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^Ut^$t^jt,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=Ie^At^J^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=Me^Nt^et^$t,un=P<<1|P>>>31,z=un+(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=on^qt^ut^J,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^wt^et,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^De^kt^ut,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^Ie^Ut^wt,dn=P<<1|P>>>31,z=dn+(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^Me^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=fn^on^Nt^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=dn^cn^qt^At,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=Ln^un^Ce^Nt,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=On^hn^De^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=Ci^ln^Ie^Ce,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=Di^fn^Me^De,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^dn^on^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^cn^Me,La=P<<1|P>>>31,z=La+(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^un^on,Oa=P<<1|P>>>31,z=Oa+(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^Ci^hn^cn,Ma=P<<1|P>>>31,z=Ma+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=La^Di^ln^un,Na=P<<1|P>>>31,z=Na+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Oa^Ii^fn^hn,Ha=P<<1|P>>>31,z=Ha+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ma^Ti^dn^ln,u1=P<<1|P>>>31,z=u1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Na^Bi^Ln^fn,h1=P<<1|P>>>31,z=h1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ha^Ri^On^dn,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,n=n+g|0,i=i+d|0,a=a+m|0,s=s+A|0,o=o+T|0}function j($){$=$|0,V(E[$|0]<<24|E[$|1]<<16|E[$|2]<<8|E[$|3],E[$|4]<<24|E[$|5]<<16|E[$|6]<<8|E[$|7],E[$|8]<<24|E[$|9]<<16|E[$|10]<<8|E[$|11],E[$|12]<<24|E[$|13]<<16|E[$|14]<<8|E[$|15],E[$|16]<<24|E[$|17]<<16|E[$|18]<<8|E[$|19],E[$|20]<<24|E[$|21]<<16|E[$|22]<<8|E[$|23],E[$|24]<<24|E[$|25]<<16|E[$|26]<<8|E[$|27],E[$|28]<<24|E[$|29]<<16|E[$|30]<<8|E[$|31],E[$|32]<<24|E[$|33]<<16|E[$|34]<<8|E[$|35],E[$|36]<<24|E[$|37]<<16|E[$|38]<<8|E[$|39],E[$|40]<<24|E[$|41]<<16|E[$|42]<<8|E[$|43],E[$|44]<<24|E[$|45]<<16|E[$|46]<<8|E[$|47],E[$|48]<<24|E[$|49]<<16|E[$|50]<<8|E[$|51],E[$|52]<<24|E[$|53]<<16|E[$|54]<<8|E[$|55],E[$|56]<<24|E[$|57]<<16|E[$|58]<<8|E[$|59],E[$|60]<<24|E[$|61]<<16|E[$|62]<<8|E[$|63])}function q($){$=$|0,E[$|0]=n>>>24,E[$|1]=n>>>16&255,E[$|2]=n>>>8&255,E[$|3]=n&255,E[$|4]=i>>>24,E[$|5]=i>>>16&255,E[$|6]=i>>>8&255,E[$|7]=i&255,E[$|8]=a>>>24,E[$|9]=a>>>16&255,E[$|10]=a>>>8&255,E[$|11]=a&255,E[$|12]=s>>>24,E[$|13]=s>>>16&255,E[$|14]=s>>>8&255,E[$|15]=s&255,E[$|16]=o>>>24,E[$|17]=o>>>16&255,E[$|18]=o>>>8&255,E[$|19]=o&255}function G(){n=1732584193,i=4023233417,a=2562383102,s=271733878,o=3285377520,u=c=0}function Z($,at,mt,bt,yt,pt,gt){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,n=$,i=at,a=mt,s=bt,o=yt,u=pt,c=gt}function tt($,at){$=$|0,at=at|0;var mt=0;if($&63)return-1;for(;(at|0)>=64;)j($),$=$+64|0,at=at-64|0,mt=mt+64|0;return u=u+mt|0,u>>>0>>0&&(c=c+1|0),mt|0}function rt($,at,mt){$=$|0,at=at|0,mt=mt|0;var bt=0,yt=0;if($&63||~mt&&mt&31)return-1;if((at|0)>=64){if(bt=tt($,at)|0,(bt|0)==-1)return-1;$=$+bt|0,at=at-bt|0}if(bt=bt+at|0,u=u+at|0,u>>>0>>0&&(c=c+1|0),E[$|at]=128,(at|0)>=56){for(yt=at+1|0;(yt|0)<64;yt=yt+1|0)E[$|yt]=0;j($),at=0,E[$|0]=0}for(yt=at+1|0;(yt|0)<59;yt=yt+1|0)E[$|yt]=0;return E[$|56]=c>>>21&255,E[$|57]=c>>>13&255,E[$|58]=c>>>5&255,E[$|59]=c<<3&255|u>>>29,E[$|60]=u>>>21&255,E[$|61]=u>>>13&255,E[$|62]=u>>>5&255,E[$|63]=u<<3&255,j($),~mt&&q(mt),bt|0}function dt(){n=h,i=l,a=w,s=y,o=K,u=64,c=0}function it(){n=x,i=M,a=F,s=Q,o=H,u=64,c=0}function O($,at,mt,bt,yt,pt,gt,ct,S,N,b,f,U,W,X,Y){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,ct=ct|0,S=S|0,N=N|0,b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,G(),V($^1549556828,at^1549556828,mt^1549556828,bt^1549556828,yt^1549556828,pt^1549556828,gt^1549556828,ct^1549556828,S^1549556828,N^1549556828,b^1549556828,f^1549556828,U^1549556828,W^1549556828,X^1549556828,Y^1549556828),x=n,M=i,F=a,Q=s,H=o,G(),V($^909522486,at^909522486,mt^909522486,bt^909522486,yt^909522486,pt^909522486,gt^909522486,ct^909522486,S^909522486,N^909522486,b^909522486,f^909522486,U^909522486,W^909522486,X^909522486,Y^909522486),h=n,l=i,w=a,y=s,K=o,u=64,c=0}function ft($,at,mt){$=$|0,at=at|0,mt=mt|0;var bt=0,yt=0,pt=0,gt=0,ct=0,S=0;return $&63||~mt&&mt&31?-1:(S=rt($,at,-1)|0,bt=n,yt=i,pt=a,gt=s,ct=o,it(),V(bt,yt,pt,gt,ct,2147483648,0,0,0,0,0,0,0,0,0,672),~mt&&q(mt),S|0)}function Pt($,at,mt,bt,yt){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0;var pt=0,gt=0,ct=0,S=0,N=0,b=0,f=0,U=0,W=0,X=0;if($&63||~yt&&yt&31)return-1;for(E[$+at|0]=mt>>>24,E[$+at+1|0]=mt>>>16&255,E[$+at+2|0]=mt>>>8&255,E[$+at+3|0]=mt&255,ft($,at+4|0,-1)|0,pt=b=n,gt=f=i,ct=U=a,S=W=s,N=X=o,bt=bt-1|0;(bt|0)>0;)dt(),V(b,f,U,W,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,W=s,X=o,it(),V(b,f,U,W,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,W=s,X=o,pt=pt^n,gt=gt^i,ct=ct^a,S=S^s,N=N^o,bt=bt-1|0;return n=pt,i=gt,a=ct,s=S,o=N,~yt&&q(yt),0}return{reset:G,init:Z,process:tt,finish:rt,hmac_reset:dt,hmac_init:O,hmac_finish:ft,pbkdf2_generate_block:Pt}};class e2{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 Us("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=Wr(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 Us("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 L1=[],O1=[];class Zr extends e2{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=L1.pop()||Vs(),this.asm=O1.pop()||t2({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(L1.push(this.heap),O1.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=t2;const M1=[],N1=[];class Ua extends e2{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=M1.pop()||Vs(),this.asm=N1.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,x=0,M=0,F=0,Q=0,H=0,E=0,V=0,j=0,q=0,G=0,Z=0,tt=0,rt=0,dt=0,it=0,O=new e.Uint8Array(n);function ft(b,f,U,W,X,Y,g,d,m,A,T,P,z,ht,ot,lt){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,T=T|0,P=P|0,z=z|0,ht=ht|0,ot=ot|0,lt=lt|0;var I=0,C=0,D=0,B=0,R=0,L=0,v=0,k=0;I=i,C=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&C^D&(I^C))+(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^C&(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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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&(C^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=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2453635748|0,L=L+C|0,C=C+(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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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&(C^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=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2614888103|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<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&C^D&(I^C))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<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^C&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(W>>>7^W>>>18^W>>>3^W<<25^W<<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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+ot|0,D=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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+lt|0,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1555081692|0,L=L+C|0,C=C+(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)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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+W|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2952996808|0,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Y|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,D=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+113926993|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<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&C^D&(I^C))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<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^C&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(W>>>7^W>>>18^W>>>3^W<<25^W<<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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+ot|0,D=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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+lt|0,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2177026350|0,L=L+C|0,C=C+(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)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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+W|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+3259730800|0,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Y|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,D=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+4094571909|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<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&C^D&(I^C))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<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^C&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(W>>>7^W>>>18^W>>>3^W<<25^W<<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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+ot|0,D=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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+lt|0,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1537002063|0,L=L+C|0,C=C+(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)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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+W|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2227730452|0,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Y|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,D=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+3204031479|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,i=i+I|0,a=a+C|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(O[b|0]<<24|O[b|1]<<16|O[b|2]<<8|O[b|3],O[b|4]<<24|O[b|5]<<16|O[b|6]<<8|O[b|7],O[b|8]<<24|O[b|9]<<16|O[b|10]<<8|O[b|11],O[b|12]<<24|O[b|13]<<16|O[b|14]<<8|O[b|15],O[b|16]<<24|O[b|17]<<16|O[b|18]<<8|O[b|19],O[b|20]<<24|O[b|21]<<16|O[b|22]<<8|O[b|23],O[b|24]<<24|O[b|25]<<16|O[b|26]<<8|O[b|27],O[b|28]<<24|O[b|29]<<16|O[b|30]<<8|O[b|31],O[b|32]<<24|O[b|33]<<16|O[b|34]<<8|O[b|35],O[b|36]<<24|O[b|37]<<16|O[b|38]<<8|O[b|39],O[b|40]<<24|O[b|41]<<16|O[b|42]<<8|O[b|43],O[b|44]<<24|O[b|45]<<16|O[b|46]<<8|O[b|47],O[b|48]<<24|O[b|49]<<16|O[b|50]<<8|O[b|51],O[b|52]<<24|O[b|53]<<16|O[b|54]<<8|O[b|55],O[b|56]<<24|O[b|57]<<16|O[b|58]<<8|O[b|59],O[b|60]<<24|O[b|61]<<16|O[b|62]<<8|O[b|63])}function $(b){b=b|0,O[b|0]=i>>>24,O[b|1]=i>>>16&255,O[b|2]=i>>>8&255,O[b|3]=i&255,O[b|4]=a>>>24,O[b|5]=a>>>16&255,O[b|6]=a>>>8&255,O[b|7]=a&255,O[b|8]=s>>>24,O[b|9]=s>>>16&255,O[b|10]=s>>>8&255,O[b|11]=s&255,O[b|12]=o>>>24,O[b|13]=o>>>16&255,O[b|14]=o>>>8&255,O[b|15]=o&255,O[b|16]=u>>>24,O[b|17]=u>>>16&255,O[b|18]=u>>>8&255,O[b|19]=u&255,O[b|20]=c>>>24,O[b|21]=c>>>16&255,O[b|22]=c>>>8&255,O[b|23]=c&255,O[b|24]=h>>>24,O[b|25]=h>>>16&255,O[b|26]=h>>>8&255,O[b|27]=h&255,O[b|28]=l>>>24,O[b|29]=l>>>16&255,O[b|30]=l>>>8&255,O[b|31]=l&255}function at(){i=1779033703,a=3144134277,s=1013904242,o=2773480762,u=1359893119,c=2600822924,h=528734635,l=1541459225,w=y=0}function mt(b,f,U,W,X,Y,g,d,m,A){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,i=b,a=f,s=U,o=W,u=X,c=Y,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 W=0,X=0;if(b&63||~U&&U&31)return-1;if((f|0)>=64){if(W=bt(b,f)|0,(W|0)==-1)return-1;b=b+W|0,f=f-W|0}if(W=W+f|0,w=w+f|0,w>>>0>>0&&(y=y+1|0),O[b|f]=128,(f|0)>=56){for(X=f+1|0;(X|0)<64;X=X+1|0)O[b|X]=0;Pt(b),f=0,O[b|0]=0}for(X=f+1|0;(X|0)<59;X=X+1|0)O[b|X]=0;return O[b|56]=y>>>21&255,O[b|57]=y>>>13&255,O[b|58]=y>>>5&255,O[b|59]=y<<3&255|w>>>29,O[b|60]=w>>>21&255,O[b|61]=w>>>13&255,O[b|62]=w>>>5&255,O[b|63]=w<<3&255,Pt(b),~U&&$(U),W|0}function pt(){i=K,a=x,s=M,o=F,u=Q,c=H,h=E,l=V,w=64,y=0}function gt(){i=j,a=q,s=G,o=Z,u=tt,c=rt,h=dt,l=it,w=64,y=0}function ct(b,f,U,W,X,Y,g,d,m,A,T,P,z,ht,ot,lt){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,T=T|0,P=P|0,z=z|0,ht=ht|0,ot=ot|0,lt=lt|0,at(),ft(b^1549556828,f^1549556828,U^1549556828,W^1549556828,X^1549556828,Y^1549556828,g^1549556828,d^1549556828,m^1549556828,A^1549556828,T^1549556828,P^1549556828,z^1549556828,ht^1549556828,ot^1549556828,lt^1549556828),j=i,q=a,G=s,Z=o,tt=u,rt=c,dt=h,it=l,at(),ft(b^909522486,f^909522486,U^909522486,W^909522486,X^909522486,Y^909522486,g^909522486,d^909522486,m^909522486,A^909522486,T^909522486,P^909522486,z^909522486,ht^909522486,ot^909522486,lt^909522486),K=i,x=a,M=s,F=o,Q=u,H=c,E=h,V=l,w=64,y=0}function S(b,f,U){b=b|0,f=f|0,U=U|0;var W=0,X=0,Y=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,W=i,X=a,Y=s,g=o,d=u,m=c,A=h,T=l,gt(),ft(W,X,Y,g,d,m,A,T,2147483648,0,0,0,0,0,0,768),~U&&$(U),P|0)}function N(b,f,U,W,X){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0;var Y=0,g=0,d=0,m=0,A=0,T=0,P=0,z=0,ht=0,ot=0,lt=0,I=0,C=0,D=0,B=0,R=0;if(b&63||~X&&X&31)return-1;for(O[b+f|0]=U>>>24,O[b+f+1|0]=U>>>16&255,O[b+f+2|0]=U>>>8&255,O[b+f+3|0]=U&255,S(b,f+4|0,-1)|0,Y=ht=i,g=ot=a,d=lt=s,m=I=o,A=C=u,T=D=c,P=B=h,z=R=l,W=W-1|0;(W|0)>0;)pt(),ft(ht,ot,lt,I,C,D,B,R,2147483648,0,0,0,0,0,0,768),ht=i,ot=a,lt=s,I=o,C=u,D=c,B=h,R=l,gt(),ft(ht,ot,lt,I,C,D,B,R,2147483648,0,0,0,0,0,0,768),ht=i,ot=a,lt=s,I=o,C=u,D=c,B=h,R=l,Y=Y^i,g=g^a,d=d^s,m=m^o,A=A^u,T=T^c,P=P^h,z=z^l,W=W-1|0;return i=Y,a=g,s=d,o=m,u=A,c=T,h=P,l=z,~X&&$(X),0}return{reset:at,init:mt,process:bt,finish:yt,hmac_reset:pt,hmac_init:ct,hmac_finish:S,pbkdf2_generate_block:N}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(M1.push(this.heap),N1.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Ua().process(e).finish().result}}Ua.NAME="sha256";var Ka=r2;function r2(r,e){if(!r)throw Error(e||"Assertion failed")}r2.equal=function(r,e,t){if(r!=e)throw Error(t||"Assertion failed: "+r+" != "+e)};var s6=Ye!==void 0?Ye:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zs(r,e){return r(e={exports:{}},e.exports),e.exports}function Tc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Bc=Zs(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}}),Rc=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 Lc=function(r,e){for(var t="",n=0;n>>0}return a},Mc=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},Dt={inherits:Bc,toArray:Rc,toHex:zc,htonl:n2,toHex32:Lc,zero2:i2,zero8:a2,join32:Oc,split32:Mc,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 Vi(){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 Nc=Vi;Vi.prototype.update=function(r,e){if(r=Dt.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=Dt.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 He(r,17)^He(r,19)^r>>>10}},Te=Dt.sum32,Fc=Dt.sum32_4,$c=Dt.sum32_5,jc=Tn.ch32,qc=Tn.maj32,Gc=Tn.s0_256,Vc=Tn.s1_256,Wc=Tn.g0_256,Zc=Tn.g1_256,u2=Qs.BlockHash,Qc=[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;u2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Qc,this.W=Array(64)}Dt.inherits(qe,u2);var h2=qe;function dr(){if(!(this instanceof dr))return new dr;h2.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 xa(e&t|~e&n,r,e,i,a,s)}function de(r,e,t,n,i,a,s){return xa(e&n|t&~n,r,e,i,a,s)}function ye(r,e,t,n,i,a,s){return xa(e^t^n,r,e,i,a,s)}function pe(r,e,t,n,i,a,s){return xa(t^(e|~n),r,e,i,a,s)}function A3(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 j1="0123456789abcdef".split("");function _3(r){let e="",t=0;for(;t<4;t++)e+=j1[r>>8*t+4&15]+j1[r>>8*t&15];return e}function Ir(r,e){return r+e&4294967295}const aa=_.getWebCrypto(),sa=_.getNodeCrypto(),E3=sa&&sa.getHashes();function $r(r){if(sa&&E3.includes(r))return async function(e){const t=sa.createHash(r);return Yt(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)&&aa&&e&&t.length>=n.minBytesForWebCrypto)return new Uint8Array(await aa.digest(e,t));const i=r();return Yt(t,a=>{i.update(a)},()=>new Uint8Array(i.digest()))}}function q1(r,e){return async function(t,n=vt){if(le(t)&&(t=await ar(t)),_.isStream(t)){const i=new r;return Yt(t,a=>{i.process(a)},()=>i.finish().result)}return aa&&e&&t.length>=n.minBytesForWebCrypto?new Uint8Array(await aa.digest(e,t)):r.bytes(t)}}const jr={md5:$r("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)Wa(i,A3(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(Wa(i,s),a=0;a<16;a++)s[a]=0;return s[14]=8*n,Wa(i,s),i}(_.uint8ArrayToString(r));return _.hexToUint8Array(function(t){for(let n=0;nnew Uint8Array(M.update(F)))}(r,e,t,n);if(_.isAES(r))return function(l,w,y,K,x){if(_.getWebCrypto()&&w.length!==24&&!_.isStream(y)&&y.length>=3e3*x.minBytesForWebCrypto)return async function(F,Q,H,E){const V="AES-CBC",j=await G1.importKey("raw",Q,{name:V},!1,["encrypt"]),{blockSize:q}=er(F),G=_.concatUint8Array([new Uint8Array(q),H]),Z=new Uint8Array(await G1.encrypt({name:V,iv:E},j,G)).subarray(0,H.length);return function(tt,rt){for(let dt=0;dtM.aes.AES_Encrypt_process(F),()=>M.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 x=s.encrypt(u);for(y=0;ynew Uint8Array(x.update(M)))}(r,e,t,n);if(_.isAES(r))return function(h,l,w,y){if(_.isStream(w)){const K=new En(l,y);return Yt(w,x=>K.aes.AES_Decrypt_process(x),()=>K.aes.AES_Decrypt_finish())}return En.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 ua{static encrypt(e,t,n=!0,i){return new ua(t,i,n).encrypt(e)}static decrypt(e,t,n=!0,i){return new ua(t,i,n).decrypt(e)}constructor(e,t,n=!0,i){this.aes=i||new Ei(e,t,n,"CBC")}encrypt(e){return Mr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Mr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const V1=_.getWebCrypto(),P3=_.getNodeCrypto(),hr=16;function W1(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),Q=new Uint8Array(u.length+Pr);let H,E=0;for(H=0;H16)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>Qa)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 Qr(t,n,i,a).encrypt(e)}static decrypt(e,t,n,i,a){return new Qr(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>Qa)throw new RangeError("counter overflow");const w=new Uint8Array(h);for(;n>0;)l=Wr(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>Qa)throw new RangeError("counter overflow");const K=new Uint8Array(l);for(;n>w;)y=Wr(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+=Wr(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 x=0;x0;){for(s=Wr(n,0,e,i,a),i+=s,a-=s;15&s;)n[s++]=0;t.mac(Kt.MAC.GCM,Kt.HEAP_DATA,s)}}}const Xa=_.getWebCrypto(),Y1=_.getNodeCrypto(),J1=_.getNodeBuffer(),bn=16,Ya="AES-GCM";async function vn(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 Y1.createCipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i);const s=J1.concat([a.update(t),a.final(),a.getAuthTag()]);return new Uint8Array(s)},decrypt:async function(t,n,i=new Uint8Array){const a=new Y1.createDecipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i),a.setAuthTag(t.slice(t.length-bn,t.length));const s=J1.concat([a.update(t.slice(0,t.length-bn)),a.final()]);return new Uint8Array(s)}};if(_.getWebCrypto()&&e.length!==24){const t=await Xa.importKey("raw",e,{name:Ya},!1,["encrypt","decrypt"]);return{encrypt:async function(n,i,a=new Uint8Array){if(!n.length)return Qr.encrypt(n,e,i,a);const s=await Xa.encrypt({name:Ya,iv:i,additionalData:a,tagLength:8*bn},t,n);return new Uint8Array(s)},decrypt:async function(n,i,a=new Uint8Array){if(n.length===bn)return Qr.decrypt(n,e,i,a);const s=await Xa.decrypt({name:Ya,iv:i,additionalData:a,tagLength:8*bn},t,n);return new Uint8Array(s)}}}return{encrypt:async function(t,n,i){return Qr.encrypt(t,e,n,i)},decrypt:async function(t,n,i){return Qr.decrypt(t,e,n,i)}}}vn.getNonce=function(r,e){const t=r.slice();for(let n=0;n>>8)-1}(S,N,b,f,32)}function K(S,N){var b;for(b=0;b<16;b++)S[b]=0|N[b]}function x(S){var N,b,f=1;for(N=0;N<16;N++)b=S[N]+f+65535,f=Math.floor(b/65536),S[N]=b-65536*f;S[0]+=f-1+37*(f-1)}function M(S,N,b){for(var f,U=~(b-1),W=0;W<16;W++)f=U&(S[W]^N[W]),S[W]^=f,N[W]^=f}function F(S,N){var b,f,U,W=t(),X=t();for(b=0;b<16;b++)X[b]=N[b];for(x(X),x(X),x(X),f=0;f<2;f++){for(W[0]=X[0]-65517,b=1;b<15;b++)W[b]=X[b]-65535-(W[b-1]>>16&1),W[b-1]&=65535;W[15]=X[15]-32767-(W[14]>>16&1),U=W[15]>>16&1,W[14]&=65535,M(X,W,1-U)}for(b=0;b<16;b++)S[2*b]=255&X[b],S[2*b+1]=X[b]>>8}function Q(S,N){var b=new Uint8Array(32),f=new Uint8Array(32);return F(b,S),F(f,N),y(b,0,f,0)}function H(S){var N=new Uint8Array(32);return F(N,S),1&N[0]}function E(S,N){var b;for(b=0;b<16;b++)S[b]=N[2*b]+(N[2*b+1]<<8);S[15]&=32767}function V(S,N,b){for(var f=0;f<16;f++)S[f]=N[f]+b[f]}function j(S,N,b){for(var f=0;f<16;f++)S[f]=N[f]-b[f]}function q(S,N,b){var f,U,W=0,X=0,Y=0,g=0,d=0,m=0,A=0,T=0,P=0,z=0,ht=0,ot=0,lt=0,I=0,C=0,D=0,B=0,R=0,L=0,v=0,k=0,nt=0,st=0,St=0,It=0,zt=0,Ct=0,Vt=0,Xt=0,Jt=0,ne=0,xt=b[0],Mt=b[1],Lt=b[2],Et=b[3],jt=b[4],Ht=b[5],$t=b[6],J=b[7],et=b[8],ut=b[9],wt=b[10],kt=b[11],Ut=b[12],At=b[13],Nt=b[14],qt=b[15];W+=(f=N[0])*xt,X+=f*Mt,Y+=f*Lt,g+=f*Et,d+=f*jt,m+=f*Ht,A+=f*$t,T+=f*J,P+=f*et,z+=f*ut,ht+=f*wt,ot+=f*kt,lt+=f*Ut,I+=f*At,C+=f*Nt,D+=f*qt,X+=(f=N[1])*xt,Y+=f*Mt,g+=f*Lt,d+=f*Et,m+=f*jt,A+=f*Ht,T+=f*$t,P+=f*J,z+=f*et,ht+=f*ut,ot+=f*wt,lt+=f*kt,I+=f*Ut,C+=f*At,D+=f*Nt,B+=f*qt,Y+=(f=N[2])*xt,g+=f*Mt,d+=f*Lt,m+=f*Et,A+=f*jt,T+=f*Ht,P+=f*$t,z+=f*J,ht+=f*et,ot+=f*ut,lt+=f*wt,I+=f*kt,C+=f*Ut,D+=f*At,B+=f*Nt,R+=f*qt,g+=(f=N[3])*xt,d+=f*Mt,m+=f*Lt,A+=f*Et,T+=f*jt,P+=f*Ht,z+=f*$t,ht+=f*J,ot+=f*et,lt+=f*ut,I+=f*wt,C+=f*kt,D+=f*Ut,B+=f*At,R+=f*Nt,L+=f*qt,d+=(f=N[4])*xt,m+=f*Mt,A+=f*Lt,T+=f*Et,P+=f*jt,z+=f*Ht,ht+=f*$t,ot+=f*J,lt+=f*et,I+=f*ut,C+=f*wt,D+=f*kt,B+=f*Ut,R+=f*At,L+=f*Nt,v+=f*qt,m+=(f=N[5])*xt,A+=f*Mt,T+=f*Lt,P+=f*Et,z+=f*jt,ht+=f*Ht,ot+=f*$t,lt+=f*J,I+=f*et,C+=f*ut,D+=f*wt,B+=f*kt,R+=f*Ut,L+=f*At,v+=f*Nt,k+=f*qt,A+=(f=N[6])*xt,T+=f*Mt,P+=f*Lt,z+=f*Et,ht+=f*jt,ot+=f*Ht,lt+=f*$t,I+=f*J,C+=f*et,D+=f*ut,B+=f*wt,R+=f*kt,L+=f*Ut,v+=f*At,k+=f*Nt,nt+=f*qt,T+=(f=N[7])*xt,P+=f*Mt,z+=f*Lt,ht+=f*Et,ot+=f*jt,lt+=f*Ht,I+=f*$t,C+=f*J,D+=f*et,B+=f*ut,R+=f*wt,L+=f*kt,v+=f*Ut,k+=f*At,nt+=f*Nt,st+=f*qt,P+=(f=N[8])*xt,z+=f*Mt,ht+=f*Lt,ot+=f*Et,lt+=f*jt,I+=f*Ht,C+=f*$t,D+=f*J,B+=f*et,R+=f*ut,L+=f*wt,v+=f*kt,k+=f*Ut,nt+=f*At,st+=f*Nt,St+=f*qt,z+=(f=N[9])*xt,ht+=f*Mt,ot+=f*Lt,lt+=f*Et,I+=f*jt,C+=f*Ht,D+=f*$t,B+=f*J,R+=f*et,L+=f*ut,v+=f*wt,k+=f*kt,nt+=f*Ut,st+=f*At,St+=f*Nt,It+=f*qt,ht+=(f=N[10])*xt,ot+=f*Mt,lt+=f*Lt,I+=f*Et,C+=f*jt,D+=f*Ht,B+=f*$t,R+=f*J,L+=f*et,v+=f*ut,k+=f*wt,nt+=f*kt,st+=f*Ut,St+=f*At,It+=f*Nt,zt+=f*qt,ot+=(f=N[11])*xt,lt+=f*Mt,I+=f*Lt,C+=f*Et,D+=f*jt,B+=f*Ht,R+=f*$t,L+=f*J,v+=f*et,k+=f*ut,nt+=f*wt,st+=f*kt,St+=f*Ut,It+=f*At,zt+=f*Nt,Ct+=f*qt,lt+=(f=N[12])*xt,I+=f*Mt,C+=f*Lt,D+=f*Et,B+=f*jt,R+=f*Ht,L+=f*$t,v+=f*J,k+=f*et,nt+=f*ut,st+=f*wt,St+=f*kt,It+=f*Ut,zt+=f*At,Ct+=f*Nt,Vt+=f*qt,I+=(f=N[13])*xt,C+=f*Mt,D+=f*Lt,B+=f*Et,R+=f*jt,L+=f*Ht,v+=f*$t,k+=f*J,nt+=f*et,st+=f*ut,St+=f*wt,It+=f*kt,zt+=f*Ut,Ct+=f*At,Vt+=f*Nt,Xt+=f*qt,C+=(f=N[14])*xt,D+=f*Mt,B+=f*Lt,R+=f*Et,L+=f*jt,v+=f*Ht,k+=f*$t,nt+=f*J,st+=f*et,St+=f*ut,It+=f*wt,zt+=f*kt,Ct+=f*Ut,Vt+=f*At,Xt+=f*Nt,Jt+=f*qt,D+=(f=N[15])*xt,X+=38*(R+=f*Lt),Y+=38*(L+=f*Et),g+=38*(v+=f*jt),d+=38*(k+=f*Ht),m+=38*(nt+=f*$t),A+=38*(st+=f*J),T+=38*(St+=f*et),P+=38*(It+=f*ut),z+=38*(zt+=f*wt),ht+=38*(Ct+=f*kt),ot+=38*(Vt+=f*Ut),lt+=38*(Xt+=f*At),I+=38*(Jt+=f*Nt),C+=38*(ne+=f*qt),W=(f=(W+=38*(B+=f*Mt))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Y=(f=Y+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)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),ot=(f=ot+U+65535)-65536*(U=Math.floor(f/65536)),lt=(f=lt+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),C=(f=C+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),W=(f=(W+=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)),Y=(f=Y+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)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),ot=(f=ot+U+65535)-65536*(U=Math.floor(f/65536)),lt=(f=lt+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),C=(f=C+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),W+=U-1+37*(U-1),S[0]=W,S[1]=X,S[2]=Y,S[3]=g,S[4]=d,S[5]=m,S[6]=A,S[7]=T,S[8]=P,S[9]=z,S[10]=ht,S[11]=ot,S[12]=lt,S[13]=I,S[14]=C,S[15]=D}function G(S,N){q(S,N,N)}function Z(S,N){var b,f=t();for(b=0;b<16;b++)f[b]=N[b];for(b=253;b>=0;b--)G(f,f),b!==2&&b!==4&&q(f,f,N);for(b=0;b<16;b++)S[b]=f[b]}function tt(S,N,b){var f,U,W=new Uint8Array(32),X=new Float64Array(80),Y=t(),g=t(),d=t(),m=t(),A=t(),T=t();for(U=0;U<31;U++)W[U]=N[U];for(W[31]=127&N[31]|64,W[0]&=248,E(X,b),U=0;U<16;U++)g[U]=X[U],m[U]=Y[U]=d[U]=0;for(Y[0]=m[0]=1,U=254;U>=0;--U)M(Y,g,f=W[U>>>3]>>>(7&U)&1),M(d,m,f),V(A,Y,d),j(Y,Y,d),V(d,g,m),j(g,g,m),G(m,A),G(T,Y),q(Y,d,Y),q(d,g,A),V(A,Y,d),j(Y,Y,d),G(g,Y),j(d,m,T),q(Y,d,o),V(Y,Y,m),q(d,d,Y),q(Y,m,T),q(m,g,X),G(g,A),M(Y,g,f),M(d,m,f);for(U=0;U<16;U++)X[U+16]=Y[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),q(z,z,P),F(S,z),0}function rt(S,N){return tt(S,N,i)}function dt(S,N){var b=t(),f=t(),U=t(),W=t(),X=t(),Y=t(),g=t(),d=t(),m=t();j(b,S[1],S[0]),j(m,N[1],N[0]),q(b,b,m),V(f,S[0],S[1]),V(m,N[0],N[1]),q(f,f,m),q(U,S[3],N[3]),q(U,U,c),q(W,S[2],N[2]),V(W,W,W),j(X,f,b),j(Y,W,U),V(g,W,U),V(d,f,b),q(S[0],X,Y),q(S[1],d,g),q(S[2],g,Y),q(S[3],X,d)}function it(S,N,b){var f;for(f=0;f<4;f++)M(S[f],N[f],b)}function O(S,N){var b=t(),f=t(),U=t();Z(U,N[2]),q(b,N[0],U),q(f,N[1],U),F(S,f),S[31]^=H(b)<<7}function ft(S,N,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)it(S,N,f=b[U/8|0]>>(7&U)&1),dt(N,S),dt(S,S),it(S,N,f)}function Pt(S,N){var b=[t(),t(),t(),t()];K(b[0],h),K(b[1],l),K(b[2],s),q(b[3],h,l),ft(S,b,N)}function $(S,N,b){var f,U,W=[t(),t(),t(),t()];for(b||n(N,32),(f=e.hash(N.subarray(0,32)))[0]&=248,f[31]&=127,f[31]|=64,Pt(W,f),O(S,W),U=0;U<32;U++)N[U+32]=S[U];return 0}var at=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,N){var b,f,U,W;for(f=63;f>=32;--f){for(b=0,U=f-32,W=f-12;U>4)*at[U],b=N[U]>>8,N[U]&=255;for(U=0;U<32;U++)N[U]-=b*at[U];for(f=0;f<32;f++)N[f+1]+=N[f]>>8,S[f]=255&N[f]}function bt(S){var N,b=new Float64Array(64);for(N=0;N<64;N++)b[N]=S[N];for(N=0;N<64;N++)S[N]=0;mt(S,b)}function yt(S,N){var b=t(),f=t(),U=t(),W=t(),X=t(),Y=t(),g=t();return K(S[2],s),E(S[1],N),G(U,S[1]),q(W,U,u),j(U,U,S[2]),V(W,S[2],W),G(X,W),G(Y,X),q(g,Y,X),q(b,g,U),q(b,b,W),function(d,m){var A,T=t();for(A=0;A<16;A++)T[A]=m[A];for(A=250;A>=0;A--)G(T,T),A!==1&&q(T,T,m);for(A=0;A<16;A++)d[A]=T[A]}(b,b),q(b,b,U),q(b,b,W),q(b,b,W),q(S[0],b,W),G(f,S[0]),q(f,f,W),Q(f,U)&&q(S[0],S[0],w),G(f,S[0]),q(f,f,W),Q(f,U)?-1:(H(S[0])===N[31]>>7&&j(S[0],a,S[0]),q(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),N=new Uint8Array(64);return $(S,N),{publicKey:S,secretKey:N}},e.sign.keyPair.fromSecretKey=function(S){if(gt(S),S.length!==64)throw Error("bad secret key size");for(var N=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 B3=Object.freeze({__proto__:null,getRandomBytes:Ee,getRandomBigInteger:br});async function e0(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 w2(u,e,t));return u}async function w2(r,e,t){return!(e&&!r.dec().gcd(e).isOne())&&!!await async function(n){const i=await _.getBigInteger();return R3.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 Ds(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-CmdOWnPu.js");return{default:tt}},[],import.meta.url),Q=new F(K),H=new F(x),E=new F(y),V=E.mod(H.subn(1)),j=E.mod(Q.subn(1)),q=ge.createSign(p.read(p.hash,c));q.write(h),q.end();const G={version:0,modulus:new F(l),publicExponent:new F(w),privateExponent:new F(y),prime1:new F(x),prime2:new F(K),exponent1:V,exponent2:j,coefficient:new F(M)};if(ge.createPrivateKey!==void 0){const tt=pn.encode(G,"der");return new Uint8Array(q.sign({key:tt,format:"der",type:"pkcs1"}))}const Z=pn.encode(G,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(q.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 Ds(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 yn.importKey("jwk",l,{name:"RSASSA-PKCS1-v1_5",hash:{name:s}},!1,["verify"]);return yn.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 Vr(async()=>{const{default:x}=await import("./bn.min-CmdOWnPu.js");return{default:x}},[],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:Hi.encode(y,"der"),format:"der",type:"pkcs1"}:K=Hi.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 Ds(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 Vr(async()=>{const{default:c}=await import("./bn.min-CmdOWnPu.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:Hi.encode(o,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:u={key:Hi.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(Xs(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:x}=await Vr(async()=>{const{default:q}=await import("./bn.min-CmdOWnPu.js");return{default:q}},[],import.meta.url),M=new x(w),F=new x(y),Q=new x(l),H=Q.mod(F.subn(1)),E=Q.mod(M.subn(1)),V={version:0,modulus:new x(c),publicExponent:new x(h),privateExponent:new x(l),prime1:new x(y),prime2:new x(w),exponent1:H,exponent2:E,coefficient:new x(K)};let j;ge.createPrivateKey!==void 0?j={key:pn.encode(V,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:j={key:pn.encode(V,"pem",{label:"RSA PRIVATE KEY"}),padding:ge.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(ge.privateDecrypt(j,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,x){const M=await _.getBigInteger();if(u=new M(u),c=new M(c),h=new M(h),l=new M(l),w=new M(w),y=new M(y),K=new M(K),u.gte(c))throw Error("Data too large.");const F=l.mod(y.dec()),Q=l.mod(w.dec()),H=(await br(new M(2),c)).mod(c),E=H.modInv(c).modExp(h,c);u=u.mul(E).mod(c);const V=u.modExp(Q,w),j=u.modExp(F,y);let G=K.mul(j.sub(V)).mod(y).mul(w).add(V);return G=G.mul(H).mod(c),Ys(G.toUint8Array("be",c.byteLength()),x)}(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 yn.generateKey(s,!0,["sign","verify"]),u=await yn.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&&pn){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(pn.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 e0(r-(r>>1),e,40),t=await e0(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))}}),O3=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(Xs(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),Ys(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 Ve{constructor(e){if(e instanceof Ve)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 Ca(r,e){return r.keyPair({priv:e})}function Da(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 Vr(async()=>{const{default:t}=await import("./elliptic.min-DVCE3zFm.js");return{default:t}},__vite__mapDeps([2,1]),import.meta.url);return new e.ec(r)}function k2(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 M3(r){if(r<0||r>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+r])}function v2(r){return new Uint8Array([192|r])}function r0(r,e){return _.concatUint8Array([v2(r),Ui(e)])}function Wi(r){return[p.packet.literalData,p.packet.compressedData,p.packet.symmetricallyEncryptedData,p.packet.symEncryptedIntegrityProtectedData,p.packet.aeadEncryptedData].includes(r)}async function N3(r,e){const t=sn(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=Wi(c);let w,y=null;if(l){if(_.isStream(r)==="array"){const x=new Ze;n=Oe(x),y=x}else{const x=new js;n=Oe(x.writable),y=x.readable}i=e({tag:c,packet:y})}else y=[];do{if(h){const x=await t.readByte();if(w=!1,x<192)o=x;else if(x>=192&&x<224)o=(x-192<<8)+await t.readByte()+192;else if(x>223&&x<255){if(o=1<<(31&x),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 x=0;for(;;){n&&await n.ready;const{done:M,value:F}=await t.read();if(M){if(o===1/0)break;throw Error("Unexpected end of packet")}const Q=o===1/0?F:F.subarray(0,o-x);if(n?await n.write(Q):y.push(Q),x+=F.length,x>=o){t.unshift(F.subarray(o-x+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 Is{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const Ja=_.getWebCrypto(),ha=_.getNodeCrypto(),rr={p256:"P-256",p384:"P-384",p521:"P-521"},or=ha?ha.getCurves():[],Ur=ha?{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 Ve(e)),e instanceof Ve&&(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 Ja.generateKey({name:"ECDSA",namedCurve:rr[n]},!0,["sign","verify"]),a=await Ja.exportKey("jwk",i.privateKey),s=await Ja.exportKey("jwk",i.publicKey);return{publicKey:_2(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=ha.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 A2(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=Da(s,t).getPublic()}catch{return!1}return!!Ca(s,n).getPublic().eq(t)}function _2(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 Ia(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 E2(r,e,t,n){const i=Ia(r,e,t);return i.d=Ae(n),i}const la=_.getWebCrypto(),Rn=_.getNodeCrypto();async function n0(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=E2(u.payloadSize,rr[u.name],l.publicKey,l.privateKey),K=await la.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,u.hash)}},!1,["sign"]),x=new Uint8Array(await la.sign({name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,c)}},K,h));return{r:x.slice(0,w),s:x.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=H3.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 S2.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=Ca(h,c),w=l.sign(u);return{r:w.r.toArrayLike(Uint8Array),s:w.s.toArrayLike(Uint8Array)}}(s,a,i)}async function i0(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=Ia(o.payloadSize,rr[o.name],w),K=await la.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,o.hash)}},!1,["verify"]),x=_.concatUint8Array([c,h]).buffer;return la.verify({name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,u)}},K,x,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 Vr(async()=>{const{default:F}=await import("./bn.min-CmdOWnPu.js");return{default:F}},[],import.meta.url),K=Rn.createVerify(p.read(p.hash,u));K.write(l),K.end();const x=$3.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:o.oid},subjectPublicKey:{unused:0,data:Array.from(w)}},"pem",{label:"PUBLIC KEY"}),M=S2.encode({r:new y(c),s:new y(h)},"der");try{return K.verify(x,M)}catch{return!1}}(s,e,t,n,i)}return async function(o,u,c,h){const l=await Bn(o.name);return Da(l,h).verify(c,u)}(s,t,e===void 0?n:a,i)}const Ta=void 0,S2=Rn?Ta.define("ECDSASignature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}):void 0,H3=Rn?Ta.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,F3=Rn?Ta.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}):void 0,$3=Rn?Ta.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(F3),this.key("subjectPublicKey").bitstr())}):void 0;var j3=Object.freeze({__proto__:null,sign:n0,verify:i0,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 n0(r,a,i,e,t,s);return await i0(r,a,o,i,e,s)}catch{return!1}}default:return A2(p.publicKey.ecdsa,r,e,t)}}});ee.hash=r=>new Uint8Array(Pi().update(r).digest());var q3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)new Uint8Array(Pi().update(r).digest());var G3=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=fa(t.decrypt(da(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 da(s);throw Error("Key Data Integrity failed")}function fa(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 W3=Object.freeze({__proto__:null,encode:P2,decode:U2});const Tr=_.getWebCrypto(),K2=_.getNodeCrypto();function a0(r,e,t,n){return _.concatUint8Array([e.write(),new Uint8Array([r]),t.write(),_.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function s0(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 Z3(r,e){switch(r.type){case"curve25519":{const t=Ee(32),{secretKey:n,sharedKey:i}=await x2(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=Ia(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(_2(u)),sharedKey:c}}(r,e)}catch(t){_.printDebugError(t)}break;case"node":return async function(t,n){const i=K2.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=Da(i,n);const s=Ca(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 x2(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=E2(i.payloadSize,i.web.web,s,o);let c=Tr.importKey("jwk",u,{name:"ECDH",namedCurve:i.web.web},!0,["deriveKey","deriveBits"]);const h=Ia(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=K2.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=Da(o,a),s=Ca(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 Q3=Object.freeze({__proto__:null,validateParams:async function(r,e,t){return A2(p.publicKey.ecdh,r,e,t)},encrypt:async function(r,e,t,n,i){const a=P2(t),s=new kr(r),{publicKey:o,sharedKey:u}=await Z3(s,n),c=a0(p.publicKey.ecdh,r,e,i),{keySize:h}=er(e.cipher);return{publicKey:o,wrappedKey:Js(await s0(e.hash,u,h,c),a)}},decrypt:async function(r,e,t,n,i,a,s){const o=new kr(r),{sharedKey:u}=await x2(o,t,i,a),c=a0(p.publicKey.ecdh,r,e,s),{keySize:h}=er(e.cipher);let l;for(let w=0;w<3;w++)try{return U2(t1(await s0(e.hash,u,h,c,w===1,w===2),n))}catch(y){l=y}throw l}});const o0=_.getWebCrypto(),oi=_.getNodeCrypto(),c0=oi&&oi.webcrypto&&oi.webcrypto.subtle;async function u0(r,e,t,n,i){const a=p.read(p.webHash,r);if(!a)throw Error("Hash algo not supported with HKDF");if(o0||c0){const s=o0||c0,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 h0={x25519:_.encodeUTF8("OpenPGP X25519")};var X3=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:Js(await u0(p.hash.sha256,s,new Uint8Array,h0.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 t1(await u0(p.hash.sha256,s,new Uint8Array,h0.x25519,o),t)}throw Error("Unsupported ECDH algorithm")}}),Y3=Object.freeze({__proto__:null,CurveWithOID:kr,ecdh:Q3,ecdhX:X3,ecdsa:j3,eddsaLegacy:q3,eddsa:G3,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}}),J3=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),x=o.modExp(y,a);return K.mul(x).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 w2(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:L3,elgamal:O3,elliptic:Y3,dsa:J3,nacl:ee},tu=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 l0{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 f0{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 ya{static fromObject({wrappedKey:e,algorithm:t}){const n=new ya;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 es(r){try{r.getName()}catch{throw new re("Unknown curve OID")}}var eu=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 l0(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:ya.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 Ve;t+=n.read(e),es(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 Ve;t+=n.read(e),es(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 Ve;t+=n.read(e),es(n);const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=new f0;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 l0;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 ya;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 Ve(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 Ve(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 Ve(n),Q:i,kdfParams:new f0({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 m2[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:m2,publicKey:Tt,signature:tu,random:B3,pkcs1:z3,pkcs5:W3,aesKW:V3};Object.assign(Bt,eu);var Ki=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function C2(r,e){return r.length===e?r:r.subarray?r.subarray(0,e):(r.length=e,r)}const D2={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 su=0,L2=1,ou=2,r1=29,xi=256,mi=xi+1+r1,Sn=30,n1=19,m0=2*mi+1,Xr=15,ns=16,cu=7,i1=256,O2=16,M2=17,N2=18,Ts=[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],Qi=[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],uu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w0=[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*Sn);zn(ui);const wi=Array(512);zn(wi);const bi=Array(256);zn(bi);const a1=Array(r1);zn(a1);const ga=Array(Sn);function is(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 b0,k0,v0;function as(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}function H2(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>ns-t?(r.bi_buf|=e<>ns-r.bi_valid,r.bi_valid+=t-ns):(r.bi_buf|=e<>>=1,t<<=1;while(--e>0);return t>>>1}function $2(r,e,t){const n=Array(Xr+1);let i,a,s=0;for(i=1;i<=Xr;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]=F2(n[o]++,o))}}function j2(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 A0(r,e,t,n){const i=2*e,a=2*t;return r[i]>1;s>=1;s--)ss(r,t,s);u=a;do s=r.heap[1],r.heap[1]=r.heap[r.heap_len--],ss(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++,ss(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,x=l.stat_desc.has_stree,M=l.stat_desc.extra_bits,F=l.stat_desc.extra_base,Q=l.stat_desc.max_length;let H,E,V,j,q,G,Z=0;for(j=0;j<=Xr;j++)h.bl_count[j]=0;for(w[2*h.heap[h.heap_max]+1]=0,H=h.heap_max+1;HQ&&(j=Q,Z++),w[2*E+1]=j,E>y||(h.bl_count[j]++,q=0,E>=F&&(q=M[E-F]),G=w[2*E],h.opt_len+=G*(j+q),x&&(h.static_len+=G*(K[2*E+1]+q)));if(Z!==0){do{for(j=Q-1;h.bl_count[j]===0;)j--;h.bl_count[j]--,h.bl_count[j+1]+=2,h.bl_count[Q]--,Z-=2}while(Z>0);for(j=Q;j!==0;j--)for(E=h.bl_count[j];E!==0;)V=h.heap[--H],V>y||(w[2*V+1]!==j&&(h.opt_len+=(j-w[2*V+1])*w[2*V],w[2*V+1]=j),E--)}}(r,e),$2(t,c,r.bl_count)}function E0(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 fu(r,e,t,n){let i,a,s=0;r.level>0?(r.strm.data_type===z2&&(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 p0;if(o.dyn_ltree[18]!==0||o.dyn_ltree[20]!==0||o.dyn_ltree[26]!==0)return g0;for(u=32;u=3&&o.bl_tree[2*w0[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?G2(r,e,t,n):r.strategy===R2||a===i?(ke(r,(L2<<1)+(n?1:0),3),_0(r,lr,ui)):(ke(r,(ou<<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*H2(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 du=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=du,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 yu=9,Rt=3,Br=258,Le=Br+Rt+1,pu=32,ma=42,Bs=69,Xi=73,Yi=91,Ji=103,Yr=113,ti=666,ae=1,hi=2,Jr=3,Pn=4,gu=3;function Rr(r,e){return r.msg=Ai[e],e}function U0(r){return(r<<1)-(r>4?9:0)}function Dr(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){fu(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 $n(r,e){r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=255&e}function mu(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 V2(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=mu(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:Pn):(r.strstart>r.block_start&&(ue(r,!1),r.strm.avail_out),ae)}),new Fe(4,4,8,4,cs),new Fe(4,5,16,8,cs),new Fe(4,6,32,32,cs),new Fe(4,4,16,16,gn),new Fe(8,16,32,32,gn),new Fe(8,16,128,128,gn),new Fe(8,32,128,256,gn),new Fe(32,128,258,1024,gn),new Fe(32,258,258,4096,gn)];class wu{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),Dr(this.dyn_ltree),Dr(this.dyn_dtree),Dr(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),Dr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Pe(573),Dr(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 bu(r){const e=function(t){let n;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=z2,n=t.state,n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?ma:Yr,t.adler=n.wrap===2?0:1,n.last_flush=ir,hu(n),Ft):Rr(t,te)}(r);return e===Ft&&function(t){t.window_size=2*t.w_size,Dr(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 ku(r,e){let t,n,i,a;if(!r||!r.state||e>d0||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===ma)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=Bs):(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,gu),n.status=Yr);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|=pu),o+=31-o%31,n.status=Yr,$n(n,o),n.strstart!==0&&($n(n,r.adler>>>16),$n(n,65535&r.adler)),r.adler=1}if(n.status===Bs)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=Xi)}else n.status=Xi;if(n.status===Xi)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=Yi)}else n.status=Yi;if(n.status===Yi)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=Yr)):n.status=Yr),n.pending!==0){if(Kr(r),r.avail_out===0)return n.last_flush=-1,Ft}else if(r.avail_in===0&&U0(e)<=U0(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:Pn):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:hi}(n,e):n.strategy===au?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:Pn):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!==Pn||(n.status=ti),s===ae||s===Jr)return r.avail_out===0&&(n.last_flush=-1),Ft;if(s===hi&&(e===ru?lu(n):e!==d0&&(G2(n,0,0,!1),e===nu&&(Dr(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)):($n(n,r.adler>>>16),$n(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 Rs=new Qe(256);for(let r=0;r<256;r++)Rs[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function zs(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}Rs[254]=Rs[254]=1;class W2{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 vu{constructor(e){this.options={level:y0,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 W2,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===y0&&(o=6),c<0?(w=0,c=-c):c>15&&(w=2,c-=16),h<1||h>yu||u!==Dn||c<8||c>15||o<0||o>9||l<0||l>R2)return Rr(s,te);c===8&&(c=9);const y=new wu;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&&(Dr(c.head),c.strstart=0,c.block_start=0,c.insert=0),M=new Qe(c.w_size),nr(M,u,F-c.w_size,c.w_size,0),u=M,F=c.w_size),y=o.avail_in,K=o.next_in,x=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!==ma&&u!==Bs&&u!==Xi&&u!==Yi&&u!==Ji&&u!==Yr&&u!==ti?Rr(o,te):(o.state=null,u===Yr?Rr(o,e1):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=T2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const $i=30,Au=12;function _u(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 x=r.output,M=n-(e-r.avail_out),F=n+(r.avail_out-257),Q=w.dmax,H=w.wsize,E=w.whave,V=w.wnext,j=w.window;i=w.hold,a=w.bits;const q=w.lencode,G=w.distcode,Z=(1<>>24,i>>>=o,a-=o,o=s>>>16&255,o===0)x[n++]=65535&s;else{if(!(16&o)){if(!(64&o)){s=q[(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=G[(65535&s)+(i&(1<Q){r.msg="invalid distance too far back",w.mode=$i;break t}if(i>>>=o,a-=o,o=n-M,c>o){if(o=c-o,o>E&&w.sane){r.msg="invalid distance too far back",w.mode=$i;break t}if(h=0,l=j,V===0){if(h+=H-o,o2;)x[n++]=l[h++],x[n++]=l[h++],x[n++]=l[h++],u-=3;u&&(x[n++]=l[h++],u>1&&(x[n++]=l[h++]))}else{h=n-c;do x[n++]=x[h++],x[n++]=x[h++],x[n++]=x[h++],u-=3;while(u>2);u&&(x[n++]=x[h++],u>1&&(x[n++]=x[h++]))}break}}break}}while(t>3,t-=u,a-=u<<3,i&=(1<=1&&tt[F]===0;F--);if(Q>F&&(Q=F),F===0)return i[a++]=20971520,i[a++]=20971520,o.bits=1,0;for(M=1;M0&&(r===C0||F!==1))return-1;for(rt[1]=0,K=1;KK0||r===D0&&j>x0)return 1;for(;;){dt=K-E,s[x]y?(it=ft[Pt+s[x]],O=G[Z+s[x]]):(it=96,O=0),c=1<>E)+h]=dt<<24|it<<16|O|0;while(h!==0);for(c=1<>=1;if(c!==0?(q&=c-1,q+=c):q=0,x++,--tt[K]==0){if(K===F)break;K=e[t+s[x]]}if(K>Q&&(q&$)!==l){for(E===0&&(E=Q),w+=M,H=K-E,V=1<K0||r===D0&&j>x0)return 1;l=q&$,i[l]=Q<<24|H<<16|w-a|0}}return q!==0&&(i[w+q]=K-E<<24|64<<16|0),o.bits=Q,0}const Ku=0,Z2=1,Q2=2,X2=1,I0=2,T0=3,B0=4,R0=5,z0=6,L0=7,O0=8,M0=9,N0=10,wa=11,cr=12,hs=13,H0=14,ls=15,F0=16,$0=17,j0=18,q0=19,ji=20,qi=21,G0=22,V0=23,W0=24,Z0=25,Q0=26,fs=27,X0=28,Y0=29,Zt=30,xu=852,Cu=592;function J0(r){return(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24)}class Du{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 Iu(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=X2,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new pa(xu),n.distcode=n.distdyn=new pa(Cu),n.sane=1,n.back=-1,Ft):te}(r)):te}function Tu(r,e){let t,n;return r?(n=new Du,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,Iu(i))):te}(r,e),t!==Ft&&(r.state=null),t):te}let ds,ys,to=!0;function Bu(r){if(to){let e;for(ds=new pa(512),ys=new pa(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(Z2,r.lens,0,288,ds,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;li(Q2,r.lens,0,32,ys,0,r.work,{bits:5}),to=!1}r.lencode=ds,r.lenbits=9,r.distcode=ys,r.distbits=5}function Y2(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=I0;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,j=8+(15&c),t.wbits===0)t.wbits=j;else if(j>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=T0;case T0: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=B0;case B0: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=R0;case R0: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=z0;case z0:if(1024&t.flags&&(y=t.length,y>o&&(y=o),y&&(t.head&&(j=t.head.extra_len-t.length,t.head.extra||(t.head.extra=Array(t.head.extra_len)),nr(t.head.extra,n,a,y,j)),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=L0;case L0:if(2048&t.flags){if(o===0)break t;y=0;do j=n[a+y++],t.head&&j&&t.length<65536&&(t.head.name+=String.fromCharCode(j));while(j&&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=fs;break}for(;h<3;){if(o===0)break t;o--,c+=n[a++]<>>=1,h-=1,3&c){case 0:t.mode=H0;break;case 1:Bu(t),t.mode=ji;break;case 2:t.mode=$0;break;case 3:r.msg="invalid block type",t.mode=Zt}c>>>=2,h-=2;break;case H0: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=ls;case ls:t.mode=F0;case F0: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 $0: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=j0;case j0:for(;t.have>>=3,h-=3}for(;t.have<19;)t.lens[dt[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,G={bits:t.lenbits},q=li(Ku,t.lens,0,19,t.lencode,0,t.work,G),t.lenbits=G.bits,q){r.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=q0;case q0:for(;t.have>>24,F=tt>>>16&255,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=M,h-=M,t.lens[t.have++]=Q;else{if(Q===16){for(Z=M+2;h>>=M,h-=M,t.have===0){r.msg="invalid bit length repeat",t.mode=Zt;break}j=t.lens[t.have-1],y=3+(3&c),c>>>=2,h-=2}else if(Q===17){for(Z=M+3;h>>=M,h-=M,j=0,y=3+(7&c),c>>>=3,h-=3}else{for(Z=M+7;h>>=M,h-=M,j=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++]=j}}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,G={bits:t.lenbits},q=li(Z2,t.lens,0,t.nlen,t.lencode,0,t.work,G),t.lenbits=G.bits,q){r.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,G={bits:t.distbits},q=li(Q2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,G),t.distbits=G.bits,q){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,_u(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,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>H)],M=tt>>>24,F=tt>>>16&255,Q=65535&tt,!(H+M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=H,h-=H,t.back+=H}if(c>>>=M,h-=M,t.back+=M,t.length=Q,F===0){t.mode=Q0;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=G0;case G0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=V0;case V0:for(;tt=t.distcode[c&(1<>>24,F=tt>>>16&255,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>H)],M=tt>>>24,F=tt>>>16&255,Q=65535&tt,!(H+M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=H,h-=H,t.back+=H}if(c>>>=M,h-=M,t.back+=M,64&F){r.msg="invalid distance code",t.mode=Zt;break}t.offset=Q,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=Z0;case Z0: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),x=t.window}else x=i,K=s-t.offset,y=t.length;y>u&&(y=u),u-=y,t.length-=y;do i[s++]=x[K++];while(--y);t.length===0&&(t.mode=qi);break;case Q0:if(u===0)break t;i[s++]=t.length,u--,t.mode=qi;break;case fs: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 W2,this.strm.avail_out=0;let n=Tu(this.strm,t.windowBits);if(n!==Ft||(this.header=new zu,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=zs(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=eo(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 Qe(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=T2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var no=[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|=no[t]&this.curByte,this.hasByte=!1,this.bitOffset=0,r-=t;else{e<<=r;var n=t-r;e|=(this.curByte&no[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 Lu=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^ps[255&(r>>>24^e)]},this.updateCRCRun=function(e,t){for(;t-- >0;)r=r<<8^ps[255&(r>>>24^e)]}}),io=function(r,e){var t,n=r[e];for(t=e;t>0;t--)r[t]=r[t-1];return r[0]=n,n},Qt={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[Qt.LAST_BLOCK]="Bad file checksum",xr[Qt.NOT_BZIP_DATA]="Not bzip data",xr[Qt.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",xr[Qt.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",xr[Qt.DATA_ERROR]="Data error",xr[Qt.OUT_OF_MEMORY]="Out of memory",xr[Qt.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 Ou,!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(Qt.NOT_BZIP_DATA,"bad magic");var n=t[3]-48;(n<1||n>9)&&ce(Qt.NOT_BZIP_DATA,"level out of range"),this.reader=new Lu(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(Qt.NOT_BZIP_DATA),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&ce(Qt.OBSOLETE_INPUT);var a=n.read(24);a>this.dbufSize&&ce(Qt.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(Qt.DATA_ERROR);var l=n.read(15);l===0&&ce(Qt.DATA_ERROR);var w=new Uint8Array(256);for(r=0;r=h&&ce(Qt.DATA_ERROR);y[r]=io(w,e)}var K,x=u+2,M=[];for(e=0;e20)&&ce(Qt.DATA_ERROR),n.read(1);)n.read(1)?s--:s++;H[r]=s}for(F=Q=H[0],r=1;rQ?Q=H[r]:H[r]=l&&ce(Qt.DATA_ERROR),K=M[y[tt++]]),r=K.minLen,e=n.read(r);r>K.maxLen&&ce(Qt.DATA_ERROR),!(e<=K.limit[r]);r++)e=e<<1|n.read(1);((e-=K.base[r])<0||e>=258)&&ce(Qt.DATA_ERROR);var dt=K.permute[e];if(dt!==0&&dt!==1){if(G)for(G=0,Z+s>this.dbufSize&&ce(Qt.DATA_ERROR),j[q=o[w[0]]]+=s;s--;)rt[Z++]=q;if(dt>u)break;Z>=this.dbufSize&&ce(Qt.DATA_ERROR),j[q=o[q=io(w,r=dt-1)]]++,rt[Z++]=q}else G||(G=1,s=0),s+=dt===0?G:2*G,G<<=1}for((a<0||a>=Z)&&ce(Qt.DATA_ERROR),e=0,r=0;r<256;r++)t=e+j[r],j[r]=e,e=t;for(r=0;r>=8,ft=-1),this.writePos=it,this.writeCurrent=O,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(Qt.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var Mu=function(r){if("readByte"in r)return r;var e=new J2;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},Nu=function(r){var e=new J2,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},ao=function(r,e,t){for(var n=Mu(r),i=Nu(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(Qt.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"),Hu=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 Cn,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(ea(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(Wt(e.signatureCreationTime,!0,_.writeDate(this.created))),this.signatureExpirationTime!==null&&t.push(Wt(e.signatureExpirationTime,!0,_.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&t.push(Wt(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(n=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Wt(e.trustSignature,!0,n))),this.regularExpression!==null&&t.push(Wt(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&t.push(Wt(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&t.push(Wt(e.keyExpirationTime,!0,_.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Wt(e.preferredSymmetricAlgorithms,!1,n))),this.revocationKeyClass!==null&&(n=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),n=_.concat([n,this.revocationKeyFingerprint]),t.push(Wt(e.revocationKey,!1,n))),this.issuerKeyID.isNull()||this.issuerKeyVersion===5||t.push(Wt(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(Wt(e.notationData,c,n))}),this.preferredHashAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Wt(e.preferredHashAlgorithms,!1,n))),this.preferredCompressionAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Wt(e.preferredCompressionAlgorithms,!1,n))),this.keyServerPreferences!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyServerPreferences)),t.push(Wt(e.keyServerPreferences,!1,n))),this.preferredKeyServer!==null&&t.push(Wt(e.preferredKeyServer,!1,_.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&t.push(Wt(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&t.push(Wt(e.policyURI,!1,_.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyFlags)),t.push(Wt(e.keyFlags,!0,n))),this.signersUserID!==null&&t.push(Wt(e.signersUserID,!1,_.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(n=_.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Wt(e.reasonForRevocation,!0,n))),this.features!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.features)),t.push(Wt(e.features,!1,n))),this.signatureTargetPublicKeyAlgorithm!==null&&(n=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],n.push(_.stringToUint8Array(this.signatureTargetHash)),n=_.concat(n),t.push(Wt(e.signatureTarget,!0,n))),this.embeddedSignature!==null&&t.push(Wt(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(n=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],n=_.concat(n),t.push(Wt(e.issuerFingerprint,this.version===5,n))),this.preferredAEADAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Wt(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)),Hu.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=k2(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 Yt(ea(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 Fu(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]}gs.prototype.hash=mr.prototype.hash,gs.prototype.toHash=mr.prototype.toHash,gs.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 N3(a,async u=>{try{if(u.tag===p.packet.marker||u.tag===p.packet.trust)return;const c=Fu(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||Wi(u.tag))await o.abort(c);else{const w=new Is(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=sn(this.stream);for(;;){const{done:a,value:s}=await i.read();if(a?this.stream=null:this.push(s),a||Wi(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([M3(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(Yt(ea(i),s=>{a+=s.length},()=>r0(n,a)))}else e.push(r0(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)})}))):Pa(Go(n).pipe(e(t)))}}function co(r,e={}){return function(t){const n=new r(e);return Yt(t,i=>{if(i.length)return n.push(i,gi),n.result},()=>{if(r===vu)return n.push([],oe),n.result})}}function uo(r){return function(e){return _i(async()=>r(await ar(e)))}}qn&&(qn.inflateRaw,qn.createInflateRaw,qn.inflate,qn.createInflate);class ms{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 ho(r,e,t){const{keySize:n}=Bt.getCipher(t);return r.produceKey(e,n)}var $u=Zs(function(r){(function(e){function t(i){function a(){return Et0&&(et.semantic=" "),et}}function H(J,et){return function(){var ut,wt,kt,Ut,At;for(Ut=s(),ut=c("star"),kt=0,At=et===void 0?0:et;(wt=J())!==null;)kt+=1,l(ut,wt);return kt>=At?ut:(o(Ut),null)}}function E(J){return J.charCodeAt(0)>=128}function V(){return h("cr",y("\r")())}function j(){return h("crlf",K(V,Z)())}function q(){return h("dquote",y('"')())}function G(){return h("htab",y(" ")())}function Z(){return h("lf",y(` +`)}return _.concat(c)}class Cn{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 Cn;return t.read(_.hexToUint8Array(e)),t}static wildcard(){const e=new Cn;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(x){var M,F,Q;for(F=Q=function(H){var E=r[255-e[H]];return H===0&&(E=0),E}(x),M=0;M<4;M++)Q^=F=255&(F<<1|F>>>7);return Q^=99}t||function(){r=[],e=[];var x,M,F=1;for(x=0;x<255;x++)r[x]=F,M=128&F,F<<=1,F&=255,M===128&&(F^=27),F^=r[x],e[r[x]]=x;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 x=function(M,F,Q){var H=0,E=0,V=0,j=0,q=0,G=0,Z=0,tt=0,rt=0,dt=0,it=0,O=0,ft=0,Pt=0,$=0,at=0,mt=0,bt=0,yt=0,pt=0,gt=0,ct=new M.Uint32Array(Q),S=new M.Uint8Array(Q);function N(v,k,nt,st,St,It,zt,Ct){v=v|0,k=k|0,nt=nt|0,st=st|0,St=St|0,It=It|0,zt=zt|0,Ct=Ct|0;var Vt=0,Xt=0,Jt=0,ne=0,xt=0,Mt=0,Lt=0,Et=0;for(Vt=nt|1024,Xt=nt|2048,Jt=nt|3072,St=St^ct[(v|0)>>2],It=It^ct[(v|4)>>2],zt=zt^ct[(v|8)>>2],Ct=Ct^ct[(v|12)>>2],Et=16;(Et|0)<=st<<4;Et=Et+16|0)ne=ct[(nt|St>>22&1020)>>2]^ct[(Vt|It>>14&1020)>>2]^ct[(Xt|zt>>6&1020)>>2]^ct[(Jt|Ct<<2&1020)>>2]^ct[(v|Et|0)>>2],xt=ct[(nt|It>>22&1020)>>2]^ct[(Vt|zt>>14&1020)>>2]^ct[(Xt|Ct>>6&1020)>>2]^ct[(Jt|St<<2&1020)>>2]^ct[(v|Et|4)>>2],Mt=ct[(nt|zt>>22&1020)>>2]^ct[(Vt|Ct>>14&1020)>>2]^ct[(Xt|St>>6&1020)>>2]^ct[(Jt|It<<2&1020)>>2]^ct[(v|Et|8)>>2],Lt=ct[(nt|Ct>>22&1020)>>2]^ct[(Vt|St>>14&1020)>>2]^ct[(Xt|It>>6&1020)>>2]^ct[(Jt|zt<<2&1020)>>2]^ct[(v|Et|12)>>2],St=ne,It=xt,zt=Mt,Ct=Lt;H=ct[(k|St>>22&1020)>>2]<<24^ct[(k|It>>14&1020)>>2]<<16^ct[(k|zt>>6&1020)>>2]<<8^ct[(k|Ct<<2&1020)>>2]^ct[(v|Et|0)>>2],E=ct[(k|It>>22&1020)>>2]<<24^ct[(k|zt>>14&1020)>>2]<<16^ct[(k|Ct>>6&1020)>>2]<<8^ct[(k|St<<2&1020)>>2]^ct[(v|Et|4)>>2],V=ct[(k|zt>>22&1020)>>2]<<24^ct[(k|Ct>>14&1020)>>2]<<16^ct[(k|St>>6&1020)>>2]<<8^ct[(k|It<<2&1020)>>2]^ct[(v|Et|8)>>2],j=ct[(k|Ct>>22&1020)>>2]<<24^ct[(k|St>>14&1020)>>2]<<16^ct[(k|It>>6&1020)>>2]<<8^ct[(k|zt<<2&1020)>>2]^ct[(v|Et|12)>>2]}function b(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,v,k,nt,st)}function f(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0;N(1024,3072,8192,gt,v,st,nt,k),St=E,E=j,j=St}function U(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q^v,G^k,Z^nt,tt^st),q=H,G=E,Z=V,tt=j}function W(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0;N(1024,3072,8192,gt,v,st,nt,k),St=E,E=j,j=St,H=H^q,E=E^G,V=V^Z,j=j^tt,q=v,G=k,Z=nt,tt=st}function X(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q,G,Z,tt),q=H=H^v,G=E=E^k,Z=V=V^nt,tt=j=j^st}function Y(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q,G,Z,tt),H=H^v,E=E^k,V=V^nt,j=j^st,q=v,G=k,Z=nt,tt=st}function g(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,q,G,Z,tt),q=H,G=E,Z=V,tt=j,H=H^v,E=E^k,V=V^nt,j=j^st}function d(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,N(0,2048,4096,gt,rt,dt,it,O),O=~at&O|at&O+1,it=~$&it|$&it+((O|0)==0),dt=~Pt&dt|Pt&dt+((it|0)==0),rt=~ft&rt|ft&rt+((dt|0)==0),H=H^v,E=E^k,V=V^nt,j=j^st}function m(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0;var St=0,It=0,zt=0,Ct=0,Vt=0,Xt=0,Jt=0,ne=0,xt=0,Mt=0;for(v=v^q,k=k^G,nt=nt^Z,st=st^tt,St=mt|0,It=bt|0,zt=yt|0,Ct=pt|0;(xt|0)<128;xt=xt+1|0)St>>>31&&(Vt=Vt^v,Xt=Xt^k,Jt=Jt^nt,ne=ne^st),St=St<<1|It>>>31,It=It<<1|zt>>>31,zt=zt<<1|Ct>>>31,Ct=Ct<<1,Mt=st&1,st=st>>>1|nt<<31,nt=nt>>>1|k<<31,k=k>>>1|v<<31,v=v>>>1,Mt&&(v=v^3774873600);q=Vt,G=Xt,Z=Jt,tt=ne}function A(v){v=v|0,gt=v}function T(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,H=v,E=k,V=nt,j=st}function P(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,q=v,G=k,Z=nt,tt=st}function z(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,rt=v,dt=k,it=nt,O=st}function ht(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,ft=v,Pt=k,$=nt,at=st}function ot(v,k,nt,st){v=v|0,k=k|0,nt=nt|0,st=st|0,O=~at&O|at&st,it=~$&it|$&nt,dt=~Pt&dt|Pt&k,rt=~ft&rt|ft&v}function lt(v){return v=v|0,v&15?-1:(S[v|0]=H>>>24,S[v|1]=H>>>16&255,S[v|2]=H>>>8&255,S[v|3]=H&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]=V>>>24,S[v|9]=V>>>16&255,S[v|10]=V>>>8&255,S[v|11]=V&255,S[v|12]=j>>>24,S[v|13]=j>>>16&255,S[v|14]=j>>>8&255,S[v|15]=j&255,16)}function I(v){return v=v|0,v&15?-1:(S[v|0]=q>>>24,S[v|1]=q>>>16&255,S[v|2]=q>>>8&255,S[v|3]=q&255,S[v|4]=G>>>24,S[v|5]=G>>>16&255,S[v|6]=G>>>8&255,S[v|7]=G&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 C(){b(0,0,0,0),mt=H,bt=E,yt=V,pt=j}function D(v,k,nt){v=v|0,k=k|0,nt=nt|0;var st=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]=H>>>24,S[k|1]=H>>>16&255,S[k|2]=H>>>8&255,S[k|3]=H&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]=V>>>24,S[k|9]=V>>>16&255,S[k|10]=V>>>8&255,S[k|11]=V&255,S[k|12]=j>>>24,S[k|13]=j>>>16&255,S[k|14]=j>>>8&255,S[k|15]=j&255,st=st+16|0,k=k+16|0,nt=nt-16|0;return st|0}function B(v,k,nt){v=v|0,k=k|0,nt=nt|0;var st=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]),st=st+16|0,k=k+16|0,nt=nt-16|0;return st|0}var R=[b,f,U,W,X,Y,g,d],L=[U,m];return{set_rounds:A,set_state:T,set_iv:P,set_nonce:z,set_mask:ht,set_counter:ot,get_state:lt,get_iv:I,gcm_init:C,cipher:D,mac:B}}({Uint8Array,Uint32Array},l,w);return x.set_key=function(M,F,Q,H,E,V,j,q,G){var Z=y.subarray(0,60),tt=y.subarray(256,316);Z.set([F,Q,H,E,V,j,q,G]);for(var rt=M,dt=1;rt<4*M+28;rt++){var it=Z[rt-1];(rt%M==0||M===8&&rt%M==4)&&(it=i[it>>>24]<<24^i[it>>>16&255]<<16^i[it>>>8&255]<<8^i[255&it]),rt%M==0&&(it=it<<8^it>>>24^dt<<24,dt=dt<<1^(128&dt?27:0)),Z[rt]=Z[rt-M]^it}for(var O=0;O=rt-4?it:o[0][i[it>>>24]]^o[1][i[it>>>16&255]]^o[2][i[it>>>8&255]]^o[3][i[255&it]];x.set_rounds(M+5)},x};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 B1(r){return r instanceof Uint8Array}function Vs(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 Wr(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(!B1(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=Wr(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=Wr(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 Ks("bad padding");let h=0;for(let l=c;l>1;l--)h|=c^e[a+o-l];if(h)throw new Ks("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 ia{static encrypt(e,t,n=!1){return new ia(t,n).encrypt(e)}static decrypt(e,t,n=!1){return new ia(t,n).decrypt(e)}constructor(e,t=!1,n){this.aes=n||new Ei(e,void 0,t,"ECB")}encrypt(e){return Mr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Mr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}function Ws(r){const e=function(t){const n=new ia(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,x,M,F,Q,H,E,V,j,q,G=0,Z=e.length;const tt=r.length===32?3:9;V=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(it,O){const ft=8-it.length%8;let Pt;if(O===2&&ft<8)Pt=32;else if(O===1)Pt=ft;else{if(O||!(ft<8)){if(ft===8)return it;throw Error("des: invalid padding")}Pt=0}const $=new Uint8Array(it.length+ft);for(let at=0;at>>4^E),E^=M,H^=M<<4,M=65535&(H>>>16^E),E^=M,H^=M<<16,M=858993459&(E>>>2^H),H^=M,E^=M<<2,M=16711935&(E>>>8^H),H^=M,E^=M<<8,M=1431655765&(H>>>1^E),E^=M,H^=M<<1,H=H<<1|H>>>31,E=E<<1|E>>>31,x=0;x>>4|E<<28)^r[K+1],M=H,H=E,E=M^(o[F>>>24&63]|c[F>>>16&63]|l[F>>>8&63]|y[63&F]|s[Q>>>24&63]|u[Q>>>16&63]|h[Q>>>8&63]|w[63&Q]);M=H,H=E,E=M}H=H>>>1|H<<31,E=E>>>1|E<<31,M=1431655765&(H>>>1^E),E^=M,H^=M<<1,M=16711935&(E>>>8^H),H^=M,E^=M<<8,M=858993459&(E>>>2^H),H^=M,E^=M<<2,M=65535&(H>>>16^E),E^=M,H^=M<<16,M=252645135&(H>>>4^E),E^=M,H^=M<<4,rt[dt++]=H>>>24,rt[dt++]=H>>>16&255,rt[dt++]=H>>>8&255,rt[dt++]=255&H,rt[dt++]=E>>>24,rt[dt++]=E>>>16&255,rt[dt++]=E>>>8&255,rt[dt++]=255&E}return t||(rt=function(it,O){let ft,Pt=null;if(O===2)ft=32;else if(O===1)Pt=it[it.length-1];else{if(O)throw Error("des: invalid padding");ft=0}if(!Pt){for(Pt=1;it[it.length-Pt]===ft;)Pt++;Pt--}return it.subarray(0,it.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],x=r.length>8?3:1,M=Array(32*x),F=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let Q,H,E,V=0,j=0;for(let q=0;q>>4^Z),Z^=E,G^=E<<4,E=65535&(Z>>>-16^G),G^=E,Z^=E<<-16,E=858993459&(G>>>2^Z),Z^=E,G^=E<<2,E=65535&(Z>>>-16^G),G^=E,Z^=E<<-16,E=1431655765&(G>>>1^Z),Z^=E,G^=E<<1,E=16711935&(Z>>>8^G),G^=E,Z^=E<<8,E=1431655765&(G>>>1^Z),Z^=E,G^=E<<1,E=G<<8|Z>>>20&240,G=Z<<24|Z<<8&16711680|Z>>>8&65280|Z>>>24&240,Z=E;for(let tt=0;tt<16;tt++)F[tt]?(G=G<<2|G>>>26,Z=Z<<2|Z>>>26):(G=G<<1|G>>>27,Z=Z<<1|Z>>>27),G&=-15,Z&=-15,Q=e[G>>>28]|t[G>>>24&15]|n[G>>>20&15]|i[G>>>16&15]|a[G>>>12&15]|s[G>>>8&15]|o[G>>>4&15],H=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&(H>>>16^Q),M[j++]=Q^E,M[j++]=H^E<<16}return M}function Wn(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 xc(){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 x=r[K][c];l=o[x[1]],l^=a[4][o[x[2]>>>2]>>>24-8*(3&x[2])&255],l^=a[5][o[x[3]>>>2]>>>24-8*(3&x[3])&255],l^=a[6][o[x[4]>>>2]>>>24-8*(3&x[4])&255],l^=a[7][o[x[5]>>>2]>>>24-8*(3&x[5])&255],l^=a[h[c]][o[x[6]>>>2]>>>24-8*(3&x[6])&255],o[x[0]]=l}for(c=0;c<4;c++){const x=e[K][c];l=a[4][o[x[0]>>>2]>>>24-8*(3&x[0])&255],l^=a[5][o[x[1]>>>2]>>>24-8*(3&x[1])&255],l^=a[6][o[x[2]>>>2]>>>24-8*(3&x[2])&255],l^=a[7][o[x[3]>>>2]>>>24-8*(3&x[3])&255],l^=a[4+c][o[x[4]>>>2]>>>24-8*(3&x[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 xc,this.cast5.setKey(r),this.encrypt=function(e){return this.cast5.encrypt(e)}}Wn.keySize=Wn.prototype.keySize=24,Wn.blockSize=Wn.prototype.blockSize=8,Zn.blockSize=Zn.prototype.blockSize=8,Zn.keySize=Zn.prototype.keySize=16;const Se=4294967295;function Ne(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 Qn(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]=Ne(l[2]^w+y+i[4*h+8]&Se,31),l[3]=Ne(l[3],1)^w+2*y+i[4*h+9]&Se,w=s(l[2]),y=o(l[3]),l[0]=Ne(l[0]^w+y+i[4*h+10]&Se,31),l[1]=Ne(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]=Ne(l[2],1)^w+y+i[4*h+10]&Se,l[3]=Ne(l[3]^w+2*y+i[4*h+11]&Se,31),w=s(l[2]),y=o(l[3]),l[0]=Ne(l[0],1)^w+y+i[4*h+8]&Se,l[1]=Ne(l[1]^w+2*y+i[4*h+9]&Se,31)}return{name:"twofish",blocksize:16,open:function(h){let l,w,y,K,x;e=h;const M=[],F=[],Q=[];let H;const E=[];let V,j,q;const G=[[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],it=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],O=[[],[]],ft=[[],[],[],[]];function Pt(yt){return yt^yt>>2^[0,90,180,238][3&yt]}function $(yt){return yt^yt>>1^yt>>2^[0,238,180,90][3&yt]}function at(yt,pt){let gt,ct,S;for(gt=0;gt<8;gt++)ct=pt>>>24,pt=pt<<8&Se|yt>>>24,yt=yt<<8&Se,S=ct<<1,128&ct&&(S^=333),pt^=ct^S<<16,S^=ct>>>1,1&ct&&(S^=166),pt^=S<<24|S<<8;return pt}function mt(yt,pt){const gt=pt>>4,ct=15&pt,S=G[yt][gt^ct],N=Z[yt][dt[ct]^it[gt]];return rt[yt][dt[N]^it[S]]<<4|tt[yt][S^N]}function bt(yt,pt){let gt=_t(yt,0),ct=_t(yt,1),S=_t(yt,2),N=_t(yt,3);switch(H){case 4:gt=O[1][gt]^_t(pt[3],0),ct=O[0][ct]^_t(pt[3],1),S=O[0][S]^_t(pt[3],2),N=O[1][N]^_t(pt[3],3);case 3:gt=O[1][gt]^_t(pt[2],0),ct=O[1][ct]^_t(pt[2],1),S=O[0][S]^_t(pt[2],2),N=O[0][N]^_t(pt[2],3);case 2:gt=O[0][O[0][gt]^_t(pt[1],0)]^_t(pt[0],0),ct=O[0][O[1][ct]^_t(pt[1],1)]^_t(pt[0],1),S=O[1][O[0][S]^_t(pt[1],2)]^_t(pt[0],2),N=O[1][O[1][N]^_t(pt[1],3)]^_t(pt[0],3)}return ft[0][gt]^ft[1][ct]^ft[2][S]^ft[3][N]}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++)O[0][l]=mt(0,l),O[1][l]=mt(1,l);for(l=0;l<256;l++)V=O[1][l],j=Pt(V),q=$(V),ft[0][l]=V+(j<<8)+(q<<16)+(q<<24),ft[2][l]=j+(q<<8)+(V<<16)+(q<<24),V=O[0][l],j=Pt(V),q=$(V),ft[1][l]=q+(q<<8)+(j<<16)+(V<<24),ft[3][l]=j+(V<<8)+(q<<16)+(j<<24);for(H=Q.length/2,l=0;l=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 Xn(r){this.bf=new Be,this.bf.init(r),this.encrypt=function(e){return this.bf.encryptBlock(e)}}Qn.keySize=Qn.prototype.keySize=32,Qn.blockSize=Qn.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=at+(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=ct+(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=N+(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=W+(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=Y+(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=W^S^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=X^N^bt^at,ot=P<<1|P>>>31,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,P=Y^b^yt^mt,lt=P<<1|P>>>31,z=lt+(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=ht^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=ot^U^gt^yt,C=P<<1|P>>>31,z=C+(g<<5|g>>>27)+T+(d^m^A)+1859775393|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=lt^W^ct^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=C^Y^N^ct,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^ht^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^ot^f^N,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^lt^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^W^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^C^X^U,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=k^D^Y^W,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^ht^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=st^R^ot^Y,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^lt^ht,Ct=P<<1|P>>>31,z=Ct+(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^ot,Vt=P<<1|P>>>31,z=Vt+(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^C^lt,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=Ct^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=Vt^st^B^C,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=Xt^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,Mt=P<<1|P>>>31,z=Mt+(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^Ct^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=Mt^Vt^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^Xt^st^k,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=Et^Jt^St^nt,$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=jt^ne^It^st,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=Ht^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=$t^Mt^Ct^It,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=J^Lt^Vt^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^Xt^Ct,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=ut^jt^Jt^Vt,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^Ht^ne^Xt,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^$t^xt^Jt,Nt=P<<1|P>>>31,z=Nt+(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^Mt^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,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=Nt^ut^Et^Mt,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=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=Ce^kt^Ht^Et,Me=P<<1|P>>>31,z=Me+(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^Ut^$t^jt,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=Ie^At^J^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=Me^Nt^et^$t,un=P<<1|P>>>31,z=un+(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=on^qt^ut^J,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^wt^et,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^De^kt^ut,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^Ie^Ut^wt,dn=P<<1|P>>>31,z=dn+(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^Me^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=fn^on^Nt^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=dn^cn^qt^At,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=Ln^un^Ce^Nt,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=On^hn^De^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=Ci^ln^Ie^Ce,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=Di^fn^Me^De,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^dn^on^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^cn^Me,La=P<<1|P>>>31,z=La+(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^un^on,Oa=P<<1|P>>>31,z=Oa+(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^Ci^hn^cn,Ma=P<<1|P>>>31,z=Ma+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=La^Di^ln^un,Na=P<<1|P>>>31,z=Na+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Oa^Ii^fn^hn,Ha=P<<1|P>>>31,z=Ha+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ma^Ti^dn^ln,u1=P<<1|P>>>31,z=u1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Na^Bi^Ln^fn,h1=P<<1|P>>>31,z=h1+(g<<5|g>>>27)+T+(d^m^A)-899497514|0,T=A,A=m,m=d<<30|d>>>2,d=g,g=z,P=Ha^Ri^On^dn,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,n=n+g|0,i=i+d|0,a=a+m|0,s=s+A|0,o=o+T|0}function j($){$=$|0,V(E[$|0]<<24|E[$|1]<<16|E[$|2]<<8|E[$|3],E[$|4]<<24|E[$|5]<<16|E[$|6]<<8|E[$|7],E[$|8]<<24|E[$|9]<<16|E[$|10]<<8|E[$|11],E[$|12]<<24|E[$|13]<<16|E[$|14]<<8|E[$|15],E[$|16]<<24|E[$|17]<<16|E[$|18]<<8|E[$|19],E[$|20]<<24|E[$|21]<<16|E[$|22]<<8|E[$|23],E[$|24]<<24|E[$|25]<<16|E[$|26]<<8|E[$|27],E[$|28]<<24|E[$|29]<<16|E[$|30]<<8|E[$|31],E[$|32]<<24|E[$|33]<<16|E[$|34]<<8|E[$|35],E[$|36]<<24|E[$|37]<<16|E[$|38]<<8|E[$|39],E[$|40]<<24|E[$|41]<<16|E[$|42]<<8|E[$|43],E[$|44]<<24|E[$|45]<<16|E[$|46]<<8|E[$|47],E[$|48]<<24|E[$|49]<<16|E[$|50]<<8|E[$|51],E[$|52]<<24|E[$|53]<<16|E[$|54]<<8|E[$|55],E[$|56]<<24|E[$|57]<<16|E[$|58]<<8|E[$|59],E[$|60]<<24|E[$|61]<<16|E[$|62]<<8|E[$|63])}function q($){$=$|0,E[$|0]=n>>>24,E[$|1]=n>>>16&255,E[$|2]=n>>>8&255,E[$|3]=n&255,E[$|4]=i>>>24,E[$|5]=i>>>16&255,E[$|6]=i>>>8&255,E[$|7]=i&255,E[$|8]=a>>>24,E[$|9]=a>>>16&255,E[$|10]=a>>>8&255,E[$|11]=a&255,E[$|12]=s>>>24,E[$|13]=s>>>16&255,E[$|14]=s>>>8&255,E[$|15]=s&255,E[$|16]=o>>>24,E[$|17]=o>>>16&255,E[$|18]=o>>>8&255,E[$|19]=o&255}function G(){n=1732584193,i=4023233417,a=2562383102,s=271733878,o=3285377520,u=c=0}function Z($,at,mt,bt,yt,pt,gt){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,n=$,i=at,a=mt,s=bt,o=yt,u=pt,c=gt}function tt($,at){$=$|0,at=at|0;var mt=0;if($&63)return-1;for(;(at|0)>=64;)j($),$=$+64|0,at=at-64|0,mt=mt+64|0;return u=u+mt|0,u>>>0>>0&&(c=c+1|0),mt|0}function rt($,at,mt){$=$|0,at=at|0,mt=mt|0;var bt=0,yt=0;if($&63||~mt&&mt&31)return-1;if((at|0)>=64){if(bt=tt($,at)|0,(bt|0)==-1)return-1;$=$+bt|0,at=at-bt|0}if(bt=bt+at|0,u=u+at|0,u>>>0>>0&&(c=c+1|0),E[$|at]=128,(at|0)>=56){for(yt=at+1|0;(yt|0)<64;yt=yt+1|0)E[$|yt]=0;j($),at=0,E[$|0]=0}for(yt=at+1|0;(yt|0)<59;yt=yt+1|0)E[$|yt]=0;return E[$|56]=c>>>21&255,E[$|57]=c>>>13&255,E[$|58]=c>>>5&255,E[$|59]=c<<3&255|u>>>29,E[$|60]=u>>>21&255,E[$|61]=u>>>13&255,E[$|62]=u>>>5&255,E[$|63]=u<<3&255,j($),~mt&&q(mt),bt|0}function dt(){n=h,i=l,a=w,s=y,o=K,u=64,c=0}function it(){n=x,i=M,a=F,s=Q,o=H,u=64,c=0}function O($,at,mt,bt,yt,pt,gt,ct,S,N,b,f,U,W,X,Y){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0,pt=pt|0,gt=gt|0,ct=ct|0,S=S|0,N=N|0,b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,G(),V($^1549556828,at^1549556828,mt^1549556828,bt^1549556828,yt^1549556828,pt^1549556828,gt^1549556828,ct^1549556828,S^1549556828,N^1549556828,b^1549556828,f^1549556828,U^1549556828,W^1549556828,X^1549556828,Y^1549556828),x=n,M=i,F=a,Q=s,H=o,G(),V($^909522486,at^909522486,mt^909522486,bt^909522486,yt^909522486,pt^909522486,gt^909522486,ct^909522486,S^909522486,N^909522486,b^909522486,f^909522486,U^909522486,W^909522486,X^909522486,Y^909522486),h=n,l=i,w=a,y=s,K=o,u=64,c=0}function ft($,at,mt){$=$|0,at=at|0,mt=mt|0;var bt=0,yt=0,pt=0,gt=0,ct=0,S=0;return $&63||~mt&&mt&31?-1:(S=rt($,at,-1)|0,bt=n,yt=i,pt=a,gt=s,ct=o,it(),V(bt,yt,pt,gt,ct,2147483648,0,0,0,0,0,0,0,0,0,672),~mt&&q(mt),S|0)}function Pt($,at,mt,bt,yt){$=$|0,at=at|0,mt=mt|0,bt=bt|0,yt=yt|0;var pt=0,gt=0,ct=0,S=0,N=0,b=0,f=0,U=0,W=0,X=0;if($&63||~yt&&yt&31)return-1;for(E[$+at|0]=mt>>>24,E[$+at+1|0]=mt>>>16&255,E[$+at+2|0]=mt>>>8&255,E[$+at+3|0]=mt&255,ft($,at+4|0,-1)|0,pt=b=n,gt=f=i,ct=U=a,S=W=s,N=X=o,bt=bt-1|0;(bt|0)>0;)dt(),V(b,f,U,W,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,W=s,X=o,it(),V(b,f,U,W,X,2147483648,0,0,0,0,0,0,0,0,0,672),b=n,f=i,U=a,W=s,X=o,pt=pt^n,gt=gt^i,ct=ct^a,S=S^s,N=N^o,bt=bt-1|0;return n=pt,i=gt,a=ct,s=S,o=N,~yt&&q(yt),0}return{reset:G,init:Z,process:tt,finish:rt,hmac_reset:dt,hmac_init:O,hmac_finish:ft,pbkdf2_generate_block:Pt}};class e2{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 Us("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=Wr(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 Us("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 L1=[],O1=[];class Zr extends e2{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=L1.pop()||Vs(),this.asm=O1.pop()||t2({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(L1.push(this.heap),O1.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=t2;const M1=[],N1=[];class Ua extends e2{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=M1.pop()||Vs(),this.asm=N1.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,x=0,M=0,F=0,Q=0,H=0,E=0,V=0,j=0,q=0,G=0,Z=0,tt=0,rt=0,dt=0,it=0,O=new e.Uint8Array(n);function ft(b,f,U,W,X,Y,g,d,m,A,T,P,z,ht,ot,lt){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,T=T|0,P=P|0,z=z|0,ht=ht|0,ot=ot|0,lt=lt|0;var I=0,C=0,D=0,B=0,R=0,L=0,v=0,k=0;I=i,C=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&C^D&(I^C))+(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^C&(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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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&(C^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=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2453635748|0,L=L+C|0,C=C+(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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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&(C^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=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2614888103|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<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&C^D&(I^C))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<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^C&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(W>>>7^W>>>18^W>>>3^W<<25^W<<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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+ot|0,D=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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+lt|0,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1555081692|0,L=L+C|0,C=C+(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)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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+W|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2952996808|0,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Y|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,D=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+113926993|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<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&C^D&(I^C))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<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^C&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(W>>>7^W>>>18^W>>>3^W<<25^W<<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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+ot|0,D=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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+lt|0,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+2177026350|0,L=L+C|0,C=C+(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)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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+W|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+3259730800|0,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Y|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,D=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+4094571909|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,b=(f>>>7^f>>>18^f>>>3^f<<25^f<<14)+(ot>>>17^ot>>>19^ot>>>10^ot<<15^ot<<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&C^D&(I^C))+(I>>>2^I>>>13^I>>>22^I<<30^I<<19^I<<10)|0,f=(U>>>7^U>>>18^U>>>3^U<<25^U<<14)+(lt>>>17^lt>>>19^lt>>>10^lt<<15^lt<<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^C&(k^I))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0,U=(W>>>7^W>>>18^W>>>3^W<<25^W<<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,C=C+L|0,L=L+(v&k^I&(v^k))+(v>>>2^v>>>13^v>>>22^v<<30^v<<19^v<<10)|0,W=(X>>>7^X>>>18^X>>>3^X<<25^X<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+W+z|0,R=W+R+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(Y>>>7^Y>>>18^Y>>>3^Y<<25^Y<<14)+(U>>>17^U>>>19^U>>>10^U<<15^U<<13)+X+ht|0,B=X+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,Y=(g>>>7^g>>>18^g>>>3^g<<25^g<<14)+(W>>>17^W>>>19^W>>>10^W<<15^W<<13)+Y+ot|0,D=Y+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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+lt|0,C=g+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+1537002063|0,L=L+C|0,C=C+(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)+(Y>>>17^Y>>>19^Y>>>10^Y<<15^Y<<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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<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&C^D&(I^C))+(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^C&(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+W|0,L=T+L+(D>>>6^D>>>11^D>>>25^D<<26^D<<21^D<<7)+(R^D&(B^R))+2227730452|0,C=C+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+(C>>>6^C>>>11^C>>>25^C<<26^C<<21^C<<7)+(B^C&(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=(ht>>>7^ht>>>18^ht>>>3^ht<<25^ht<<14)+(T>>>17^T>>>19^T>>>10^T<<15^T<<13)+z+Y|0,B=z+B+(I>>>6^I>>>11^I>>>25^I<<26^I<<21^I<<7)+(D^I&(C^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,ht=(ot>>>7^ot>>>18^ot>>>3^ot<<25^ot<<14)+(P>>>17^P>>>19^P>>>10^P<<15^P<<13)+ht+g|0,D=ht+D+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(C^k&(I^C))+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,ot=(lt>>>7^lt>>>18^lt>>>3^lt<<25^lt<<14)+(z>>>17^z>>>19^z>>>10^z<<15^z<<13)+ot+d|0,C=ot+C+(v>>>6^v>>>11^v>>>25^v<<26^v<<21^v<<7)+(I^v&(k^I))+3204031479|0,L=L+C|0,C=C+(D&B^R&(D^B))+(D>>>2^D>>>13^D>>>22^D<<30^D<<19^D<<10)|0,lt=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(ht>>>17^ht>>>19^ht>>>10^ht<<15^ht<<13)+lt+m|0,I=lt+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+(C&D^B&(C^D))+(C>>>2^C>>>13^C>>>22^C<<30^C<<19^C<<10)|0,i=i+I|0,a=a+C|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(O[b|0]<<24|O[b|1]<<16|O[b|2]<<8|O[b|3],O[b|4]<<24|O[b|5]<<16|O[b|6]<<8|O[b|7],O[b|8]<<24|O[b|9]<<16|O[b|10]<<8|O[b|11],O[b|12]<<24|O[b|13]<<16|O[b|14]<<8|O[b|15],O[b|16]<<24|O[b|17]<<16|O[b|18]<<8|O[b|19],O[b|20]<<24|O[b|21]<<16|O[b|22]<<8|O[b|23],O[b|24]<<24|O[b|25]<<16|O[b|26]<<8|O[b|27],O[b|28]<<24|O[b|29]<<16|O[b|30]<<8|O[b|31],O[b|32]<<24|O[b|33]<<16|O[b|34]<<8|O[b|35],O[b|36]<<24|O[b|37]<<16|O[b|38]<<8|O[b|39],O[b|40]<<24|O[b|41]<<16|O[b|42]<<8|O[b|43],O[b|44]<<24|O[b|45]<<16|O[b|46]<<8|O[b|47],O[b|48]<<24|O[b|49]<<16|O[b|50]<<8|O[b|51],O[b|52]<<24|O[b|53]<<16|O[b|54]<<8|O[b|55],O[b|56]<<24|O[b|57]<<16|O[b|58]<<8|O[b|59],O[b|60]<<24|O[b|61]<<16|O[b|62]<<8|O[b|63])}function $(b){b=b|0,O[b|0]=i>>>24,O[b|1]=i>>>16&255,O[b|2]=i>>>8&255,O[b|3]=i&255,O[b|4]=a>>>24,O[b|5]=a>>>16&255,O[b|6]=a>>>8&255,O[b|7]=a&255,O[b|8]=s>>>24,O[b|9]=s>>>16&255,O[b|10]=s>>>8&255,O[b|11]=s&255,O[b|12]=o>>>24,O[b|13]=o>>>16&255,O[b|14]=o>>>8&255,O[b|15]=o&255,O[b|16]=u>>>24,O[b|17]=u>>>16&255,O[b|18]=u>>>8&255,O[b|19]=u&255,O[b|20]=c>>>24,O[b|21]=c>>>16&255,O[b|22]=c>>>8&255,O[b|23]=c&255,O[b|24]=h>>>24,O[b|25]=h>>>16&255,O[b|26]=h>>>8&255,O[b|27]=h&255,O[b|28]=l>>>24,O[b|29]=l>>>16&255,O[b|30]=l>>>8&255,O[b|31]=l&255}function at(){i=1779033703,a=3144134277,s=1013904242,o=2773480762,u=1359893119,c=2600822924,h=528734635,l=1541459225,w=y=0}function mt(b,f,U,W,X,Y,g,d,m,A){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,i=b,a=f,s=U,o=W,u=X,c=Y,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 W=0,X=0;if(b&63||~U&&U&31)return-1;if((f|0)>=64){if(W=bt(b,f)|0,(W|0)==-1)return-1;b=b+W|0,f=f-W|0}if(W=W+f|0,w=w+f|0,w>>>0>>0&&(y=y+1|0),O[b|f]=128,(f|0)>=56){for(X=f+1|0;(X|0)<64;X=X+1|0)O[b|X]=0;Pt(b),f=0,O[b|0]=0}for(X=f+1|0;(X|0)<59;X=X+1|0)O[b|X]=0;return O[b|56]=y>>>21&255,O[b|57]=y>>>13&255,O[b|58]=y>>>5&255,O[b|59]=y<<3&255|w>>>29,O[b|60]=w>>>21&255,O[b|61]=w>>>13&255,O[b|62]=w>>>5&255,O[b|63]=w<<3&255,Pt(b),~U&&$(U),W|0}function pt(){i=K,a=x,s=M,o=F,u=Q,c=H,h=E,l=V,w=64,y=0}function gt(){i=j,a=q,s=G,o=Z,u=tt,c=rt,h=dt,l=it,w=64,y=0}function ct(b,f,U,W,X,Y,g,d,m,A,T,P,z,ht,ot,lt){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0,Y=Y|0,g=g|0,d=d|0,m=m|0,A=A|0,T=T|0,P=P|0,z=z|0,ht=ht|0,ot=ot|0,lt=lt|0,at(),ft(b^1549556828,f^1549556828,U^1549556828,W^1549556828,X^1549556828,Y^1549556828,g^1549556828,d^1549556828,m^1549556828,A^1549556828,T^1549556828,P^1549556828,z^1549556828,ht^1549556828,ot^1549556828,lt^1549556828),j=i,q=a,G=s,Z=o,tt=u,rt=c,dt=h,it=l,at(),ft(b^909522486,f^909522486,U^909522486,W^909522486,X^909522486,Y^909522486,g^909522486,d^909522486,m^909522486,A^909522486,T^909522486,P^909522486,z^909522486,ht^909522486,ot^909522486,lt^909522486),K=i,x=a,M=s,F=o,Q=u,H=c,E=h,V=l,w=64,y=0}function S(b,f,U){b=b|0,f=f|0,U=U|0;var W=0,X=0,Y=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,W=i,X=a,Y=s,g=o,d=u,m=c,A=h,T=l,gt(),ft(W,X,Y,g,d,m,A,T,2147483648,0,0,0,0,0,0,768),~U&&$(U),P|0)}function N(b,f,U,W,X){b=b|0,f=f|0,U=U|0,W=W|0,X=X|0;var Y=0,g=0,d=0,m=0,A=0,T=0,P=0,z=0,ht=0,ot=0,lt=0,I=0,C=0,D=0,B=0,R=0;if(b&63||~X&&X&31)return-1;for(O[b+f|0]=U>>>24,O[b+f+1|0]=U>>>16&255,O[b+f+2|0]=U>>>8&255,O[b+f+3|0]=U&255,S(b,f+4|0,-1)|0,Y=ht=i,g=ot=a,d=lt=s,m=I=o,A=C=u,T=D=c,P=B=h,z=R=l,W=W-1|0;(W|0)>0;)pt(),ft(ht,ot,lt,I,C,D,B,R,2147483648,0,0,0,0,0,0,768),ht=i,ot=a,lt=s,I=o,C=u,D=c,B=h,R=l,gt(),ft(ht,ot,lt,I,C,D,B,R,2147483648,0,0,0,0,0,0,768),ht=i,ot=a,lt=s,I=o,C=u,D=c,B=h,R=l,Y=Y^i,g=g^a,d=d^s,m=m^o,A=A^u,T=T^c,P=P^h,z=z^l,W=W-1|0;return i=Y,a=g,s=d,o=m,u=A,c=T,h=P,l=z,~X&&$(X),0}return{reset:at,init:mt,process:bt,finish:yt,hmac_reset:pt,hmac_init:ct,hmac_finish:S,pbkdf2_generate_block:N}}({Uint8Array},null,this.heap.buffer),this.reset()),{heap:this.heap,asm:this.asm}}release_asm(){this.heap!==void 0&&this.asm!==void 0&&(M1.push(this.heap),N1.push(this.asm)),this.heap=void 0,this.asm=void 0}static bytes(e){return new Ua().process(e).finish().result}}Ua.NAME="sha256";var Ka=r2;function r2(r,e){if(!r)throw Error(e||"Assertion failed")}r2.equal=function(r,e,t){if(r!=e)throw Error(t||"Assertion failed: "+r+" != "+e)};var s6=Ye!==void 0?Ye:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zs(r,e){return r(e={exports:{}},e.exports),e.exports}function Tc(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Bc=Zs(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}}),Rc=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 Lc=function(r,e){for(var t="",n=0;n>>0}return a},Mc=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},Dt={inherits:Bc,toArray:Rc,toHex:zc,htonl:n2,toHex32:Lc,zero2:i2,zero8:a2,join32:Oc,split32:Mc,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 Vi(){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 Nc=Vi;Vi.prototype.update=function(r,e){if(r=Dt.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=Dt.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 He(r,17)^He(r,19)^r>>>10}},Te=Dt.sum32,Fc=Dt.sum32_4,$c=Dt.sum32_5,jc=Tn.ch32,qc=Tn.maj32,Gc=Tn.s0_256,Vc=Tn.s1_256,Wc=Tn.g0_256,Zc=Tn.g1_256,u2=Qs.BlockHash,Qc=[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;u2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Qc,this.W=Array(64)}Dt.inherits(qe,u2);var h2=qe;function dr(){if(!(this instanceof dr))return new dr;h2.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 xa(e&t|~e&n,r,e,i,a,s)}function de(r,e,t,n,i,a,s){return xa(e&n|t&~n,r,e,i,a,s)}function ye(r,e,t,n,i,a,s){return xa(e^t^n,r,e,i,a,s)}function pe(r,e,t,n,i,a,s){return xa(t^(e|~n),r,e,i,a,s)}function A3(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 j1="0123456789abcdef".split("");function _3(r){let e="",t=0;for(;t<4;t++)e+=j1[r>>8*t+4&15]+j1[r>>8*t&15];return e}function Ir(r,e){return r+e&4294967295}const aa=_.getWebCrypto(),sa=_.getNodeCrypto(),E3=sa&&sa.getHashes();function $r(r){if(sa&&E3.includes(r))return async function(e){const t=sa.createHash(r);return Yt(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)&&aa&&e&&t.length>=n.minBytesForWebCrypto)return new Uint8Array(await aa.digest(e,t));const i=r();return Yt(t,a=>{i.update(a)},()=>new Uint8Array(i.digest()))}}function q1(r,e){return async function(t,n=vt){if(le(t)&&(t=await ar(t)),_.isStream(t)){const i=new r;return Yt(t,a=>{i.process(a)},()=>i.finish().result)}return aa&&e&&t.length>=n.minBytesForWebCrypto?new Uint8Array(await aa.digest(e,t)):r.bytes(t)}}const jr={md5:$r("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)Wa(i,A3(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(Wa(i,s),a=0;a<16;a++)s[a]=0;return s[14]=8*n,Wa(i,s),i}(_.uint8ArrayToString(r));return _.hexToUint8Array(function(t){for(let n=0;nnew Uint8Array(M.update(F)))}(r,e,t,n);if(_.isAES(r))return function(l,w,y,K,x){if(_.getWebCrypto()&&w.length!==24&&!_.isStream(y)&&y.length>=3e3*x.minBytesForWebCrypto)return async function(F,Q,H,E){const V="AES-CBC",j=await G1.importKey("raw",Q,{name:V},!1,["encrypt"]),{blockSize:q}=er(F),G=_.concatUint8Array([new Uint8Array(q),H]),Z=new Uint8Array(await G1.encrypt({name:V,iv:E},j,G)).subarray(0,H.length);return function(tt,rt){for(let dt=0;dtM.aes.AES_Encrypt_process(F),()=>M.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 x=s.encrypt(u);for(y=0;ynew Uint8Array(x.update(M)))}(r,e,t,n);if(_.isAES(r))return function(h,l,w,y){if(_.isStream(w)){const K=new En(l,y);return Yt(w,x=>K.aes.AES_Decrypt_process(x),()=>K.aes.AES_Decrypt_finish())}return En.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 ua{static encrypt(e,t,n=!0,i){return new ua(t,i,n).encrypt(e)}static decrypt(e,t,n=!0,i){return new ua(t,i,n).decrypt(e)}constructor(e,t,n=!0,i){this.aes=i||new Ei(e,t,n,"CBC")}encrypt(e){return Mr(this.aes.AES_Encrypt_process(e),this.aes.AES_Encrypt_finish())}decrypt(e){return Mr(this.aes.AES_Decrypt_process(e),this.aes.AES_Decrypt_finish())}}const V1=_.getWebCrypto(),P3=_.getNodeCrypto(),hr=16;function W1(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),Q=new Uint8Array(u.length+Pr);let H,E=0;for(H=0;H16)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>Qa)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 Qr(t,n,i,a).encrypt(e)}static decrypt(e,t,n,i,a){return new Qr(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>Qa)throw new RangeError("counter overflow");const w=new Uint8Array(h);for(;n>0;)l=Wr(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>Qa)throw new RangeError("counter overflow");const K=new Uint8Array(l);for(;n>w;)y=Wr(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+=Wr(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 x=0;x0;){for(s=Wr(n,0,e,i,a),i+=s,a-=s;15&s;)n[s++]=0;t.mac(Kt.MAC.GCM,Kt.HEAP_DATA,s)}}}const Xa=_.getWebCrypto(),Y1=_.getNodeCrypto(),J1=_.getNodeBuffer(),bn=16,Ya="AES-GCM";async function vn(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 Y1.createCipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i);const s=J1.concat([a.update(t),a.final(),a.getAuthTag()]);return new Uint8Array(s)},decrypt:async function(t,n,i=new Uint8Array){const a=new Y1.createDecipheriv("aes-"+8*e.length+"-gcm",e,n);a.setAAD(i),a.setAuthTag(t.slice(t.length-bn,t.length));const s=J1.concat([a.update(t.slice(0,t.length-bn)),a.final()]);return new Uint8Array(s)}};if(_.getWebCrypto()&&e.length!==24){const t=await Xa.importKey("raw",e,{name:Ya},!1,["encrypt","decrypt"]);return{encrypt:async function(n,i,a=new Uint8Array){if(!n.length)return Qr.encrypt(n,e,i,a);const s=await Xa.encrypt({name:Ya,iv:i,additionalData:a,tagLength:8*bn},t,n);return new Uint8Array(s)},decrypt:async function(n,i,a=new Uint8Array){if(n.length===bn)return Qr.decrypt(n,e,i,a);const s=await Xa.decrypt({name:Ya,iv:i,additionalData:a,tagLength:8*bn},t,n);return new Uint8Array(s)}}}return{encrypt:async function(t,n,i){return Qr.encrypt(t,e,n,i)},decrypt:async function(t,n,i){return Qr.decrypt(t,e,n,i)}}}vn.getNonce=function(r,e){const t=r.slice();for(let n=0;n>>8)-1}(S,N,b,f,32)}function K(S,N){var b;for(b=0;b<16;b++)S[b]=0|N[b]}function x(S){var N,b,f=1;for(N=0;N<16;N++)b=S[N]+f+65535,f=Math.floor(b/65536),S[N]=b-65536*f;S[0]+=f-1+37*(f-1)}function M(S,N,b){for(var f,U=~(b-1),W=0;W<16;W++)f=U&(S[W]^N[W]),S[W]^=f,N[W]^=f}function F(S,N){var b,f,U,W=t(),X=t();for(b=0;b<16;b++)X[b]=N[b];for(x(X),x(X),x(X),f=0;f<2;f++){for(W[0]=X[0]-65517,b=1;b<15;b++)W[b]=X[b]-65535-(W[b-1]>>16&1),W[b-1]&=65535;W[15]=X[15]-32767-(W[14]>>16&1),U=W[15]>>16&1,W[14]&=65535,M(X,W,1-U)}for(b=0;b<16;b++)S[2*b]=255&X[b],S[2*b+1]=X[b]>>8}function Q(S,N){var b=new Uint8Array(32),f=new Uint8Array(32);return F(b,S),F(f,N),y(b,0,f,0)}function H(S){var N=new Uint8Array(32);return F(N,S),1&N[0]}function E(S,N){var b;for(b=0;b<16;b++)S[b]=N[2*b]+(N[2*b+1]<<8);S[15]&=32767}function V(S,N,b){for(var f=0;f<16;f++)S[f]=N[f]+b[f]}function j(S,N,b){for(var f=0;f<16;f++)S[f]=N[f]-b[f]}function q(S,N,b){var f,U,W=0,X=0,Y=0,g=0,d=0,m=0,A=0,T=0,P=0,z=0,ht=0,ot=0,lt=0,I=0,C=0,D=0,B=0,R=0,L=0,v=0,k=0,nt=0,st=0,St=0,It=0,zt=0,Ct=0,Vt=0,Xt=0,Jt=0,ne=0,xt=b[0],Mt=b[1],Lt=b[2],Et=b[3],jt=b[4],Ht=b[5],$t=b[6],J=b[7],et=b[8],ut=b[9],wt=b[10],kt=b[11],Ut=b[12],At=b[13],Nt=b[14],qt=b[15];W+=(f=N[0])*xt,X+=f*Mt,Y+=f*Lt,g+=f*Et,d+=f*jt,m+=f*Ht,A+=f*$t,T+=f*J,P+=f*et,z+=f*ut,ht+=f*wt,ot+=f*kt,lt+=f*Ut,I+=f*At,C+=f*Nt,D+=f*qt,X+=(f=N[1])*xt,Y+=f*Mt,g+=f*Lt,d+=f*Et,m+=f*jt,A+=f*Ht,T+=f*$t,P+=f*J,z+=f*et,ht+=f*ut,ot+=f*wt,lt+=f*kt,I+=f*Ut,C+=f*At,D+=f*Nt,B+=f*qt,Y+=(f=N[2])*xt,g+=f*Mt,d+=f*Lt,m+=f*Et,A+=f*jt,T+=f*Ht,P+=f*$t,z+=f*J,ht+=f*et,ot+=f*ut,lt+=f*wt,I+=f*kt,C+=f*Ut,D+=f*At,B+=f*Nt,R+=f*qt,g+=(f=N[3])*xt,d+=f*Mt,m+=f*Lt,A+=f*Et,T+=f*jt,P+=f*Ht,z+=f*$t,ht+=f*J,ot+=f*et,lt+=f*ut,I+=f*wt,C+=f*kt,D+=f*Ut,B+=f*At,R+=f*Nt,L+=f*qt,d+=(f=N[4])*xt,m+=f*Mt,A+=f*Lt,T+=f*Et,P+=f*jt,z+=f*Ht,ht+=f*$t,ot+=f*J,lt+=f*et,I+=f*ut,C+=f*wt,D+=f*kt,B+=f*Ut,R+=f*At,L+=f*Nt,v+=f*qt,m+=(f=N[5])*xt,A+=f*Mt,T+=f*Lt,P+=f*Et,z+=f*jt,ht+=f*Ht,ot+=f*$t,lt+=f*J,I+=f*et,C+=f*ut,D+=f*wt,B+=f*kt,R+=f*Ut,L+=f*At,v+=f*Nt,k+=f*qt,A+=(f=N[6])*xt,T+=f*Mt,P+=f*Lt,z+=f*Et,ht+=f*jt,ot+=f*Ht,lt+=f*$t,I+=f*J,C+=f*et,D+=f*ut,B+=f*wt,R+=f*kt,L+=f*Ut,v+=f*At,k+=f*Nt,nt+=f*qt,T+=(f=N[7])*xt,P+=f*Mt,z+=f*Lt,ht+=f*Et,ot+=f*jt,lt+=f*Ht,I+=f*$t,C+=f*J,D+=f*et,B+=f*ut,R+=f*wt,L+=f*kt,v+=f*Ut,k+=f*At,nt+=f*Nt,st+=f*qt,P+=(f=N[8])*xt,z+=f*Mt,ht+=f*Lt,ot+=f*Et,lt+=f*jt,I+=f*Ht,C+=f*$t,D+=f*J,B+=f*et,R+=f*ut,L+=f*wt,v+=f*kt,k+=f*Ut,nt+=f*At,st+=f*Nt,St+=f*qt,z+=(f=N[9])*xt,ht+=f*Mt,ot+=f*Lt,lt+=f*Et,I+=f*jt,C+=f*Ht,D+=f*$t,B+=f*J,R+=f*et,L+=f*ut,v+=f*wt,k+=f*kt,nt+=f*Ut,st+=f*At,St+=f*Nt,It+=f*qt,ht+=(f=N[10])*xt,ot+=f*Mt,lt+=f*Lt,I+=f*Et,C+=f*jt,D+=f*Ht,B+=f*$t,R+=f*J,L+=f*et,v+=f*ut,k+=f*wt,nt+=f*kt,st+=f*Ut,St+=f*At,It+=f*Nt,zt+=f*qt,ot+=(f=N[11])*xt,lt+=f*Mt,I+=f*Lt,C+=f*Et,D+=f*jt,B+=f*Ht,R+=f*$t,L+=f*J,v+=f*et,k+=f*ut,nt+=f*wt,st+=f*kt,St+=f*Ut,It+=f*At,zt+=f*Nt,Ct+=f*qt,lt+=(f=N[12])*xt,I+=f*Mt,C+=f*Lt,D+=f*Et,B+=f*jt,R+=f*Ht,L+=f*$t,v+=f*J,k+=f*et,nt+=f*ut,st+=f*wt,St+=f*kt,It+=f*Ut,zt+=f*At,Ct+=f*Nt,Vt+=f*qt,I+=(f=N[13])*xt,C+=f*Mt,D+=f*Lt,B+=f*Et,R+=f*jt,L+=f*Ht,v+=f*$t,k+=f*J,nt+=f*et,st+=f*ut,St+=f*wt,It+=f*kt,zt+=f*Ut,Ct+=f*At,Vt+=f*Nt,Xt+=f*qt,C+=(f=N[14])*xt,D+=f*Mt,B+=f*Lt,R+=f*Et,L+=f*jt,v+=f*Ht,k+=f*$t,nt+=f*J,st+=f*et,St+=f*ut,It+=f*wt,zt+=f*kt,Ct+=f*Ut,Vt+=f*At,Xt+=f*Nt,Jt+=f*qt,D+=(f=N[15])*xt,X+=38*(R+=f*Lt),Y+=38*(L+=f*Et),g+=38*(v+=f*jt),d+=38*(k+=f*Ht),m+=38*(nt+=f*$t),A+=38*(st+=f*J),T+=38*(St+=f*et),P+=38*(It+=f*ut),z+=38*(zt+=f*wt),ht+=38*(Ct+=f*kt),ot+=38*(Vt+=f*Ut),lt+=38*(Xt+=f*At),I+=38*(Jt+=f*Nt),C+=38*(ne+=f*qt),W=(f=(W+=38*(B+=f*Mt))+(U=1)+65535)-65536*(U=Math.floor(f/65536)),X=(f=X+U+65535)-65536*(U=Math.floor(f/65536)),Y=(f=Y+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)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),ot=(f=ot+U+65535)-65536*(U=Math.floor(f/65536)),lt=(f=lt+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),C=(f=C+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),W=(f=(W+=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)),Y=(f=Y+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)),ht=(f=ht+U+65535)-65536*(U=Math.floor(f/65536)),ot=(f=ot+U+65535)-65536*(U=Math.floor(f/65536)),lt=(f=lt+U+65535)-65536*(U=Math.floor(f/65536)),I=(f=I+U+65535)-65536*(U=Math.floor(f/65536)),C=(f=C+U+65535)-65536*(U=Math.floor(f/65536)),D=(f=D+U+65535)-65536*(U=Math.floor(f/65536)),W+=U-1+37*(U-1),S[0]=W,S[1]=X,S[2]=Y,S[3]=g,S[4]=d,S[5]=m,S[6]=A,S[7]=T,S[8]=P,S[9]=z,S[10]=ht,S[11]=ot,S[12]=lt,S[13]=I,S[14]=C,S[15]=D}function G(S,N){q(S,N,N)}function Z(S,N){var b,f=t();for(b=0;b<16;b++)f[b]=N[b];for(b=253;b>=0;b--)G(f,f),b!==2&&b!==4&&q(f,f,N);for(b=0;b<16;b++)S[b]=f[b]}function tt(S,N,b){var f,U,W=new Uint8Array(32),X=new Float64Array(80),Y=t(),g=t(),d=t(),m=t(),A=t(),T=t();for(U=0;U<31;U++)W[U]=N[U];for(W[31]=127&N[31]|64,W[0]&=248,E(X,b),U=0;U<16;U++)g[U]=X[U],m[U]=Y[U]=d[U]=0;for(Y[0]=m[0]=1,U=254;U>=0;--U)M(Y,g,f=W[U>>>3]>>>(7&U)&1),M(d,m,f),V(A,Y,d),j(Y,Y,d),V(d,g,m),j(g,g,m),G(m,A),G(T,Y),q(Y,d,Y),q(d,g,A),V(A,Y,d),j(Y,Y,d),G(g,Y),j(d,m,T),q(Y,d,o),V(Y,Y,m),q(d,d,Y),q(Y,m,T),q(m,g,X),G(g,A),M(Y,g,f),M(d,m,f);for(U=0;U<16;U++)X[U+16]=Y[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),q(z,z,P),F(S,z),0}function rt(S,N){return tt(S,N,i)}function dt(S,N){var b=t(),f=t(),U=t(),W=t(),X=t(),Y=t(),g=t(),d=t(),m=t();j(b,S[1],S[0]),j(m,N[1],N[0]),q(b,b,m),V(f,S[0],S[1]),V(m,N[0],N[1]),q(f,f,m),q(U,S[3],N[3]),q(U,U,c),q(W,S[2],N[2]),V(W,W,W),j(X,f,b),j(Y,W,U),V(g,W,U),V(d,f,b),q(S[0],X,Y),q(S[1],d,g),q(S[2],g,Y),q(S[3],X,d)}function it(S,N,b){var f;for(f=0;f<4;f++)M(S[f],N[f],b)}function O(S,N){var b=t(),f=t(),U=t();Z(U,N[2]),q(b,N[0],U),q(f,N[1],U),F(S,f),S[31]^=H(b)<<7}function ft(S,N,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)it(S,N,f=b[U/8|0]>>(7&U)&1),dt(N,S),dt(S,S),it(S,N,f)}function Pt(S,N){var b=[t(),t(),t(),t()];K(b[0],h),K(b[1],l),K(b[2],s),q(b[3],h,l),ft(S,b,N)}function $(S,N,b){var f,U,W=[t(),t(),t(),t()];for(b||n(N,32),(f=e.hash(N.subarray(0,32)))[0]&=248,f[31]&=127,f[31]|=64,Pt(W,f),O(S,W),U=0;U<32;U++)N[U+32]=S[U];return 0}var at=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,N){var b,f,U,W;for(f=63;f>=32;--f){for(b=0,U=f-32,W=f-12;U>4)*at[U],b=N[U]>>8,N[U]&=255;for(U=0;U<32;U++)N[U]-=b*at[U];for(f=0;f<32;f++)N[f+1]+=N[f]>>8,S[f]=255&N[f]}function bt(S){var N,b=new Float64Array(64);for(N=0;N<64;N++)b[N]=S[N];for(N=0;N<64;N++)S[N]=0;mt(S,b)}function yt(S,N){var b=t(),f=t(),U=t(),W=t(),X=t(),Y=t(),g=t();return K(S[2],s),E(S[1],N),G(U,S[1]),q(W,U,u),j(U,U,S[2]),V(W,S[2],W),G(X,W),G(Y,X),q(g,Y,X),q(b,g,U),q(b,b,W),function(d,m){var A,T=t();for(A=0;A<16;A++)T[A]=m[A];for(A=250;A>=0;A--)G(T,T),A!==1&&q(T,T,m);for(A=0;A<16;A++)d[A]=T[A]}(b,b),q(b,b,U),q(b,b,W),q(b,b,W),q(S[0],b,W),G(f,S[0]),q(f,f,W),Q(f,U)&&q(S[0],S[0],w),G(f,S[0]),q(f,f,W),Q(f,U)?-1:(H(S[0])===N[31]>>7&&j(S[0],a,S[0]),q(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),N=new Uint8Array(64);return $(S,N),{publicKey:S,secretKey:N}},e.sign.keyPair.fromSecretKey=function(S){if(gt(S),S.length!==64)throw Error("bad secret key size");for(var N=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 B3=Object.freeze({__proto__:null,getRandomBytes:Ee,getRandomBigInteger:br});async function e0(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 w2(u,e,t));return u}async function w2(r,e,t){return!(e&&!r.dec().gcd(e).isOne())&&!!await async function(n){const i=await _.getBigInteger();return R3.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 Ds(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-by8sOLd_.js");return{default:tt}},[],import.meta.url),Q=new F(K),H=new F(x),E=new F(y),V=E.mod(H.subn(1)),j=E.mod(Q.subn(1)),q=ge.createSign(p.read(p.hash,c));q.write(h),q.end();const G={version:0,modulus:new F(l),publicExponent:new F(w),privateExponent:new F(y),prime1:new F(x),prime2:new F(K),exponent1:V,exponent2:j,coefficient:new F(M)};if(ge.createPrivateKey!==void 0){const tt=pn.encode(G,"der");return new Uint8Array(q.sign({key:tt,format:"der",type:"pkcs1"}))}const Z=pn.encode(G,"pem",{label:"RSA PRIVATE KEY"});return new Uint8Array(q.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 Ds(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 yn.importKey("jwk",l,{name:"RSASSA-PKCS1-v1_5",hash:{name:s}},!1,["verify"]);return yn.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 Vr(async()=>{const{default:x}=await import("./bn.min-by8sOLd_.js");return{default:x}},[],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:Hi.encode(y,"der"),format:"der",type:"pkcs1"}:K=Hi.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 Ds(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 Vr(async()=>{const{default:c}=await import("./bn.min-by8sOLd_.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:Hi.encode(o,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:u={key:Hi.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(Xs(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:x}=await Vr(async()=>{const{default:q}=await import("./bn.min-by8sOLd_.js");return{default:q}},[],import.meta.url),M=new x(w),F=new x(y),Q=new x(l),H=Q.mod(F.subn(1)),E=Q.mod(M.subn(1)),V={version:0,modulus:new x(c),publicExponent:new x(h),privateExponent:new x(l),prime1:new x(y),prime2:new x(w),exponent1:H,exponent2:E,coefficient:new x(K)};let j;ge.createPrivateKey!==void 0?j={key:pn.encode(V,"der"),format:"der",type:"pkcs1",padding:ge.constants.RSA_PKCS1_PADDING}:j={key:pn.encode(V,"pem",{label:"RSA PRIVATE KEY"}),padding:ge.constants.RSA_PKCS1_PADDING};try{return new Uint8Array(ge.privateDecrypt(j,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,x){const M=await _.getBigInteger();if(u=new M(u),c=new M(c),h=new M(h),l=new M(l),w=new M(w),y=new M(y),K=new M(K),u.gte(c))throw Error("Data too large.");const F=l.mod(y.dec()),Q=l.mod(w.dec()),H=(await br(new M(2),c)).mod(c),E=H.modInv(c).modExp(h,c);u=u.mul(E).mod(c);const V=u.modExp(Q,w),j=u.modExp(F,y);let G=K.mul(j.sub(V)).mod(y).mul(w).add(V);return G=G.mul(H).mod(c),Ys(G.toUint8Array("be",c.byteLength()),x)}(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 yn.generateKey(s,!0,["sign","verify"]),u=await yn.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&&pn){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(pn.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 e0(r-(r>>1),e,40),t=await e0(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))}}),O3=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(Xs(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),Ys(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 Ve{constructor(e){if(e instanceof Ve)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 Ca(r,e){return r.keyPair({priv:e})}function Da(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 Vr(async()=>{const{default:t}=await import("./elliptic.min-BfLLVq7v.js");return{default:t}},__vite__mapDeps([2,1]),import.meta.url);return new e.ec(r)}function k2(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 M3(r){if(r<0||r>30)throw Error("Partial Length power must be between 1 and 30");return new Uint8Array([224+r])}function v2(r){return new Uint8Array([192|r])}function r0(r,e){return _.concatUint8Array([v2(r),Ui(e)])}function Wi(r){return[p.packet.literalData,p.packet.compressedData,p.packet.symmetricallyEncryptedData,p.packet.symEncryptedIntegrityProtectedData,p.packet.aeadEncryptedData].includes(r)}async function N3(r,e){const t=sn(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=Wi(c);let w,y=null;if(l){if(_.isStream(r)==="array"){const x=new Ze;n=Oe(x),y=x}else{const x=new js;n=Oe(x.writable),y=x.readable}i=e({tag:c,packet:y})}else y=[];do{if(h){const x=await t.readByte();if(w=!1,x<192)o=x;else if(x>=192&&x<224)o=(x-192<<8)+await t.readByte()+192;else if(x>223&&x<255){if(o=1<<(31&x),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 x=0;for(;;){n&&await n.ready;const{done:M,value:F}=await t.read();if(M){if(o===1/0)break;throw Error("Unexpected end of packet")}const Q=o===1/0?F:F.subarray(0,o-x);if(n?await n.write(Q):y.push(Q),x+=F.length,x>=o){t.unshift(F.subarray(o-x+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 Is{constructor(e,t){this.tag=e,this.rawContent=t}write(){return this.rawContent}}const Ja=_.getWebCrypto(),ha=_.getNodeCrypto(),rr={p256:"P-256",p384:"P-384",p521:"P-521"},or=ha?ha.getCurves():[],Ur=ha?{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 Ve(e)),e instanceof Ve&&(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 Ja.generateKey({name:"ECDSA",namedCurve:rr[n]},!0,["sign","verify"]),a=await Ja.exportKey("jwk",i.privateKey),s=await Ja.exportKey("jwk",i.publicKey);return{publicKey:_2(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=ha.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 A2(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=Da(s,t).getPublic()}catch{return!1}return!!Ca(s,n).getPublic().eq(t)}function _2(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 Ia(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 E2(r,e,t,n){const i=Ia(r,e,t);return i.d=Ae(n),i}const la=_.getWebCrypto(),Rn=_.getNodeCrypto();async function n0(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=E2(u.payloadSize,rr[u.name],l.publicKey,l.privateKey),K=await la.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,u.hash)}},!1,["sign"]),x=new Uint8Array(await la.sign({name:"ECDSA",namedCurve:rr[u.name],hash:{name:p.read(p.webHash,c)}},K,h));return{r:x.slice(0,w),s:x.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=H3.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 S2.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=Ca(h,c),w=l.sign(u);return{r:w.r.toArrayLike(Uint8Array),s:w.s.toArrayLike(Uint8Array)}}(s,a,i)}async function i0(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=Ia(o.payloadSize,rr[o.name],w),K=await la.importKey("jwk",y,{name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,o.hash)}},!1,["verify"]),x=_.concatUint8Array([c,h]).buffer;return la.verify({name:"ECDSA",namedCurve:rr[o.name],hash:{name:p.read(p.webHash,u)}},K,x,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 Vr(async()=>{const{default:F}=await import("./bn.min-by8sOLd_.js");return{default:F}},[],import.meta.url),K=Rn.createVerify(p.read(p.hash,u));K.write(l),K.end();const x=$3.encode({algorithm:{algorithm:[1,2,840,10045,2,1],parameters:o.oid},subjectPublicKey:{unused:0,data:Array.from(w)}},"pem",{label:"PUBLIC KEY"}),M=S2.encode({r:new y(c),s:new y(h)},"der");try{return K.verify(x,M)}catch{return!1}}(s,e,t,n,i)}return async function(o,u,c,h){const l=await Bn(o.name);return Da(l,h).verify(c,u)}(s,t,e===void 0?n:a,i)}const Ta=void 0,S2=Rn?Ta.define("ECDSASignature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}):void 0,H3=Rn?Ta.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,F3=Rn?Ta.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())}):void 0,$3=Rn?Ta.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(F3),this.key("subjectPublicKey").bitstr())}):void 0;var j3=Object.freeze({__proto__:null,sign:n0,verify:i0,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 n0(r,a,i,e,t,s);return await i0(r,a,o,i,e,s)}catch{return!1}}default:return A2(p.publicKey.ecdsa,r,e,t)}}});ee.hash=r=>new Uint8Array(Pi().update(r).digest());var q3=Object.freeze({__proto__:null,sign:async function(r,e,t,n,i,a){if(Ke.getHashByteLength(e)new Uint8Array(Pi().update(r).digest());var G3=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=fa(t.decrypt(da(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 da(s);throw Error("Key Data Integrity failed")}function fa(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 W3=Object.freeze({__proto__:null,encode:P2,decode:U2});const Tr=_.getWebCrypto(),K2=_.getNodeCrypto();function a0(r,e,t,n){return _.concatUint8Array([e.write(),new Uint8Array([r]),t.write(),_.stringToUint8Array("Anonymous Sender "),n.subarray(0,20)])}async function s0(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 Z3(r,e){switch(r.type){case"curve25519":{const t=Ee(32),{secretKey:n,sharedKey:i}=await x2(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=Ia(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(_2(u)),sharedKey:c}}(r,e)}catch(t){_.printDebugError(t)}break;case"node":return async function(t,n){const i=K2.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=Da(i,n);const s=Ca(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 x2(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=E2(i.payloadSize,i.web.web,s,o);let c=Tr.importKey("jwk",u,{name:"ECDH",namedCurve:i.web.web},!0,["deriveKey","deriveBits"]);const h=Ia(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=K2.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=Da(o,a),s=Ca(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 Q3=Object.freeze({__proto__:null,validateParams:async function(r,e,t){return A2(p.publicKey.ecdh,r,e,t)},encrypt:async function(r,e,t,n,i){const a=P2(t),s=new kr(r),{publicKey:o,sharedKey:u}=await Z3(s,n),c=a0(p.publicKey.ecdh,r,e,i),{keySize:h}=er(e.cipher);return{publicKey:o,wrappedKey:Js(await s0(e.hash,u,h,c),a)}},decrypt:async function(r,e,t,n,i,a,s){const o=new kr(r),{sharedKey:u}=await x2(o,t,i,a),c=a0(p.publicKey.ecdh,r,e,s),{keySize:h}=er(e.cipher);let l;for(let w=0;w<3;w++)try{return U2(t1(await s0(e.hash,u,h,c,w===1,w===2),n))}catch(y){l=y}throw l}});const o0=_.getWebCrypto(),oi=_.getNodeCrypto(),c0=oi&&oi.webcrypto&&oi.webcrypto.subtle;async function u0(r,e,t,n,i){const a=p.read(p.webHash,r);if(!a)throw Error("Hash algo not supported with HKDF");if(o0||c0){const s=o0||c0,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 h0={x25519:_.encodeUTF8("OpenPGP X25519")};var X3=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:Js(await u0(p.hash.sha256,s,new Uint8Array,h0.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 t1(await u0(p.hash.sha256,s,new Uint8Array,h0.x25519,o),t)}throw Error("Unsupported ECDH algorithm")}}),Y3=Object.freeze({__proto__:null,CurveWithOID:kr,ecdh:Q3,ecdhX:X3,ecdsa:j3,eddsaLegacy:q3,eddsa:G3,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}}),J3=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),x=o.modExp(y,a);return K.mul(x).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 w2(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:L3,elgamal:O3,elliptic:Y3,dsa:J3,nacl:ee},tu=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 l0{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 f0{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 ya{static fromObject({wrappedKey:e,algorithm:t}){const n=new ya;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 es(r){try{r.getName()}catch{throw new re("Unknown curve OID")}}var eu=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 l0(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:ya.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 Ve;t+=n.read(e),es(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 Ve;t+=n.read(e),es(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 Ve;t+=n.read(e),es(n);const i=_.readMPI(e.subarray(t));t+=i.length+2;const a=new f0;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 l0;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 ya;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 Ve(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 Ve(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 Ve(n),Q:i,kdfParams:new f0({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 m2[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:m2,publicKey:Tt,signature:tu,random:B3,pkcs1:z3,pkcs5:W3,aesKW:V3};Object.assign(Bt,eu);var Ki=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function C2(r,e){return r.length===e?r:r.subarray?r.subarray(0,e):(r.length=e,r)}const D2={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 su=0,L2=1,ou=2,r1=29,xi=256,mi=xi+1+r1,Sn=30,n1=19,m0=2*mi+1,Xr=15,ns=16,cu=7,i1=256,O2=16,M2=17,N2=18,Ts=[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],Qi=[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],uu=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w0=[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*Sn);zn(ui);const wi=Array(512);zn(wi);const bi=Array(256);zn(bi);const a1=Array(r1);zn(a1);const ga=Array(Sn);function is(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 b0,k0,v0;function as(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}function H2(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>ns-t?(r.bi_buf|=e<>ns-r.bi_valid,r.bi_valid+=t-ns):(r.bi_buf|=e<>>=1,t<<=1;while(--e>0);return t>>>1}function $2(r,e,t){const n=Array(Xr+1);let i,a,s=0;for(i=1;i<=Xr;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]=F2(n[o]++,o))}}function j2(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 A0(r,e,t,n){const i=2*e,a=2*t;return r[i]>1;s>=1;s--)ss(r,t,s);u=a;do s=r.heap[1],r.heap[1]=r.heap[r.heap_len--],ss(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++,ss(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,x=l.stat_desc.has_stree,M=l.stat_desc.extra_bits,F=l.stat_desc.extra_base,Q=l.stat_desc.max_length;let H,E,V,j,q,G,Z=0;for(j=0;j<=Xr;j++)h.bl_count[j]=0;for(w[2*h.heap[h.heap_max]+1]=0,H=h.heap_max+1;HQ&&(j=Q,Z++),w[2*E+1]=j,E>y||(h.bl_count[j]++,q=0,E>=F&&(q=M[E-F]),G=w[2*E],h.opt_len+=G*(j+q),x&&(h.static_len+=G*(K[2*E+1]+q)));if(Z!==0){do{for(j=Q-1;h.bl_count[j]===0;)j--;h.bl_count[j]--,h.bl_count[j+1]+=2,h.bl_count[Q]--,Z-=2}while(Z>0);for(j=Q;j!==0;j--)for(E=h.bl_count[j];E!==0;)V=h.heap[--H],V>y||(w[2*V+1]!==j&&(h.opt_len+=(j-w[2*V+1])*w[2*V],w[2*V+1]=j),E--)}}(r,e),$2(t,c,r.bl_count)}function E0(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 fu(r,e,t,n){let i,a,s=0;r.level>0?(r.strm.data_type===z2&&(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 p0;if(o.dyn_ltree[18]!==0||o.dyn_ltree[20]!==0||o.dyn_ltree[26]!==0)return g0;for(u=32;u=3&&o.bl_tree[2*w0[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?G2(r,e,t,n):r.strategy===R2||a===i?(ke(r,(L2<<1)+(n?1:0),3),_0(r,lr,ui)):(ke(r,(ou<<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*H2(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 du=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=du,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 yu=9,Rt=3,Br=258,Le=Br+Rt+1,pu=32,ma=42,Bs=69,Xi=73,Yi=91,Ji=103,Yr=113,ti=666,ae=1,hi=2,Jr=3,Pn=4,gu=3;function Rr(r,e){return r.msg=Ai[e],e}function U0(r){return(r<<1)-(r>4?9:0)}function Dr(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){fu(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 $n(r,e){r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=255&e}function mu(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 V2(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=mu(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:Pn):(r.strstart>r.block_start&&(ue(r,!1),r.strm.avail_out),ae)}),new Fe(4,4,8,4,cs),new Fe(4,5,16,8,cs),new Fe(4,6,32,32,cs),new Fe(4,4,16,16,gn),new Fe(8,16,32,32,gn),new Fe(8,16,128,128,gn),new Fe(8,32,128,256,gn),new Fe(32,128,258,1024,gn),new Fe(32,258,258,4096,gn)];class wu{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),Dr(this.dyn_ltree),Dr(this.dyn_dtree),Dr(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),Dr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Pe(573),Dr(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 bu(r){const e=function(t){let n;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=z2,n=t.state,n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?ma:Yr,t.adler=n.wrap===2?0:1,n.last_flush=ir,hu(n),Ft):Rr(t,te)}(r);return e===Ft&&function(t){t.window_size=2*t.w_size,Dr(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 ku(r,e){let t,n,i,a;if(!r||!r.state||e>d0||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===ma)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=Bs):(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,gu),n.status=Yr);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|=pu),o+=31-o%31,n.status=Yr,$n(n,o),n.strstart!==0&&($n(n,r.adler>>>16),$n(n,65535&r.adler)),r.adler=1}if(n.status===Bs)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=Xi)}else n.status=Xi;if(n.status===Xi)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=Yi)}else n.status=Yi;if(n.status===Yi)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=Yr)):n.status=Yr),n.pending!==0){if(Kr(r),r.avail_out===0)return n.last_flush=-1,Ft}else if(r.avail_in===0&&U0(e)<=U0(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:Pn):o.last_lit&&(ue(o,!1),o.strm.avail_out===0)?ae:hi}(n,e):n.strategy===au?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:Pn):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!==Pn||(n.status=ti),s===ae||s===Jr)return r.avail_out===0&&(n.last_flush=-1),Ft;if(s===hi&&(e===ru?lu(n):e!==d0&&(G2(n,0,0,!1),e===nu&&(Dr(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)):($n(n,r.adler>>>16),$n(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 Rs=new Qe(256);for(let r=0;r<256;r++)Rs[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;function zs(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}Rs[254]=Rs[254]=1;class W2{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 vu{constructor(e){this.options={level:y0,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 W2,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===y0&&(o=6),c<0?(w=0,c=-c):c>15&&(w=2,c-=16),h<1||h>yu||u!==Dn||c<8||c>15||o<0||o>9||l<0||l>R2)return Rr(s,te);c===8&&(c=9);const y=new wu;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&&(Dr(c.head),c.strstart=0,c.block_start=0,c.insert=0),M=new Qe(c.w_size),nr(M,u,F-c.w_size,c.w_size,0),u=M,F=c.w_size),y=o.avail_in,K=o.next_in,x=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!==ma&&u!==Bs&&u!==Xi&&u!==Yi&&u!==Ji&&u!==Yr&&u!==ti?Rr(o,te):(o.state=null,u===Yr?Rr(o,e1):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=T2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}const $i=30,Au=12;function _u(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 x=r.output,M=n-(e-r.avail_out),F=n+(r.avail_out-257),Q=w.dmax,H=w.wsize,E=w.whave,V=w.wnext,j=w.window;i=w.hold,a=w.bits;const q=w.lencode,G=w.distcode,Z=(1<>>24,i>>>=o,a-=o,o=s>>>16&255,o===0)x[n++]=65535&s;else{if(!(16&o)){if(!(64&o)){s=q[(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=G[(65535&s)+(i&(1<Q){r.msg="invalid distance too far back",w.mode=$i;break t}if(i>>>=o,a-=o,o=n-M,c>o){if(o=c-o,o>E&&w.sane){r.msg="invalid distance too far back",w.mode=$i;break t}if(h=0,l=j,V===0){if(h+=H-o,o2;)x[n++]=l[h++],x[n++]=l[h++],x[n++]=l[h++],u-=3;u&&(x[n++]=l[h++],u>1&&(x[n++]=l[h++]))}else{h=n-c;do x[n++]=x[h++],x[n++]=x[h++],x[n++]=x[h++],u-=3;while(u>2);u&&(x[n++]=x[h++],u>1&&(x[n++]=x[h++]))}break}}break}}while(t>3,t-=u,a-=u<<3,i&=(1<=1&&tt[F]===0;F--);if(Q>F&&(Q=F),F===0)return i[a++]=20971520,i[a++]=20971520,o.bits=1,0;for(M=1;M0&&(r===C0||F!==1))return-1;for(rt[1]=0,K=1;KK0||r===D0&&j>x0)return 1;for(;;){dt=K-E,s[x]y?(it=ft[Pt+s[x]],O=G[Z+s[x]]):(it=96,O=0),c=1<>E)+h]=dt<<24|it<<16|O|0;while(h!==0);for(c=1<>=1;if(c!==0?(q&=c-1,q+=c):q=0,x++,--tt[K]==0){if(K===F)break;K=e[t+s[x]]}if(K>Q&&(q&$)!==l){for(E===0&&(E=Q),w+=M,H=K-E,V=1<K0||r===D0&&j>x0)return 1;l=q&$,i[l]=Q<<24|H<<16|w-a|0}}return q!==0&&(i[w+q]=K-E<<24|64<<16|0),o.bits=Q,0}const Ku=0,Z2=1,Q2=2,X2=1,I0=2,T0=3,B0=4,R0=5,z0=6,L0=7,O0=8,M0=9,N0=10,wa=11,cr=12,hs=13,H0=14,ls=15,F0=16,$0=17,j0=18,q0=19,ji=20,qi=21,G0=22,V0=23,W0=24,Z0=25,Q0=26,fs=27,X0=28,Y0=29,Zt=30,xu=852,Cu=592;function J0(r){return(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24)}class Du{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 Iu(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=X2,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new pa(xu),n.distcode=n.distdyn=new pa(Cu),n.sane=1,n.back=-1,Ft):te}(r)):te}function Tu(r,e){let t,n;return r?(n=new Du,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,Iu(i))):te}(r,e),t!==Ft&&(r.state=null),t):te}let ds,ys,to=!0;function Bu(r){if(to){let e;for(ds=new pa(512),ys=new pa(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(Z2,r.lens,0,288,ds,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;li(Q2,r.lens,0,32,ys,0,r.work,{bits:5}),to=!1}r.lencode=ds,r.lenbits=9,r.distcode=ys,r.distbits=5}function Y2(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=I0;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,j=8+(15&c),t.wbits===0)t.wbits=j;else if(j>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=T0;case T0: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=B0;case B0: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=R0;case R0: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=z0;case z0:if(1024&t.flags&&(y=t.length,y>o&&(y=o),y&&(t.head&&(j=t.head.extra_len-t.length,t.head.extra||(t.head.extra=Array(t.head.extra_len)),nr(t.head.extra,n,a,y,j)),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=L0;case L0:if(2048&t.flags){if(o===0)break t;y=0;do j=n[a+y++],t.head&&j&&t.length<65536&&(t.head.name+=String.fromCharCode(j));while(j&&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=fs;break}for(;h<3;){if(o===0)break t;o--,c+=n[a++]<>>=1,h-=1,3&c){case 0:t.mode=H0;break;case 1:Bu(t),t.mode=ji;break;case 2:t.mode=$0;break;case 3:r.msg="invalid block type",t.mode=Zt}c>>>=2,h-=2;break;case H0: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=ls;case ls:t.mode=F0;case F0: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 $0: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=j0;case j0:for(;t.have>>=3,h-=3}for(;t.have<19;)t.lens[dt[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,G={bits:t.lenbits},q=li(Ku,t.lens,0,19,t.lencode,0,t.work,G),t.lenbits=G.bits,q){r.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=q0;case q0:for(;t.have>>24,F=tt>>>16&255,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=M,h-=M,t.lens[t.have++]=Q;else{if(Q===16){for(Z=M+2;h>>=M,h-=M,t.have===0){r.msg="invalid bit length repeat",t.mode=Zt;break}j=t.lens[t.have-1],y=3+(3&c),c>>>=2,h-=2}else if(Q===17){for(Z=M+3;h>>=M,h-=M,j=0,y=3+(7&c),c>>>=3,h-=3}else{for(Z=M+7;h>>=M,h-=M,j=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++]=j}}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,G={bits:t.lenbits},q=li(Z2,t.lens,0,t.nlen,t.lencode,0,t.work,G),t.lenbits=G.bits,q){r.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,G={bits:t.distbits},q=li(Q2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,G),t.distbits=G.bits,q){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,_u(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,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>H)],M=tt>>>24,F=tt>>>16&255,Q=65535&tt,!(H+M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=H,h-=H,t.back+=H}if(c>>>=M,h-=M,t.back+=M,t.length=Q,F===0){t.mode=Q0;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=G0;case G0:if(t.extra){for(Z=t.extra;h>>=t.extra,h-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=V0;case V0:for(;tt=t.distcode[c&(1<>>24,F=tt>>>16&255,Q=65535&tt,!(M<=h);){if(o===0)break t;o--,c+=n[a++]<>H)],M=tt>>>24,F=tt>>>16&255,Q=65535&tt,!(H+M<=h);){if(o===0)break t;o--,c+=n[a++]<>>=H,h-=H,t.back+=H}if(c>>>=M,h-=M,t.back+=M,64&F){r.msg="invalid distance code",t.mode=Zt;break}t.offset=Q,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=Z0;case Z0: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),x=t.window}else x=i,K=s-t.offset,y=t.length;y>u&&(y=u),u-=y,t.length-=y;do i[s++]=x[K++];while(--y);t.length===0&&(t.mode=qi);break;case Q0:if(u===0)break t;i[s++]=t.length,u--,t.mode=qi;break;case fs: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 W2,this.strm.avail_out=0;let n=Tu(this.strm,t.windowBits);if(n!==Ft||(this.header=new zu,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=zs(t.dictionary):t.dictionary instanceof ArrayBuffer&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=eo(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 Qe(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=T2(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}}var no=[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|=no[t]&this.curByte,this.hasByte=!1,this.bitOffset=0,r-=t;else{e<<=r;var n=t-r;e|=(this.curByte&no[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 Lu=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^ps[255&(r>>>24^e)]},this.updateCRCRun=function(e,t){for(;t-- >0;)r=r<<8^ps[255&(r>>>24^e)]}}),io=function(r,e){var t,n=r[e];for(t=e;t>0;t--)r[t]=r[t-1];return r[0]=n,n},Qt={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[Qt.LAST_BLOCK]="Bad file checksum",xr[Qt.NOT_BZIP_DATA]="Not bzip data",xr[Qt.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",xr[Qt.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",xr[Qt.DATA_ERROR]="Data error",xr[Qt.OUT_OF_MEMORY]="Out of memory",xr[Qt.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 Ou,!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(Qt.NOT_BZIP_DATA,"bad magic");var n=t[3]-48;(n<1||n>9)&&ce(Qt.NOT_BZIP_DATA,"level out of range"),this.reader=new Lu(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(Qt.NOT_BZIP_DATA),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&ce(Qt.OBSOLETE_INPUT);var a=n.read(24);a>this.dbufSize&&ce(Qt.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(Qt.DATA_ERROR);var l=n.read(15);l===0&&ce(Qt.DATA_ERROR);var w=new Uint8Array(256);for(r=0;r=h&&ce(Qt.DATA_ERROR);y[r]=io(w,e)}var K,x=u+2,M=[];for(e=0;e20)&&ce(Qt.DATA_ERROR),n.read(1);)n.read(1)?s--:s++;H[r]=s}for(F=Q=H[0],r=1;rQ?Q=H[r]:H[r]=l&&ce(Qt.DATA_ERROR),K=M[y[tt++]]),r=K.minLen,e=n.read(r);r>K.maxLen&&ce(Qt.DATA_ERROR),!(e<=K.limit[r]);r++)e=e<<1|n.read(1);((e-=K.base[r])<0||e>=258)&&ce(Qt.DATA_ERROR);var dt=K.permute[e];if(dt!==0&&dt!==1){if(G)for(G=0,Z+s>this.dbufSize&&ce(Qt.DATA_ERROR),j[q=o[w[0]]]+=s;s--;)rt[Z++]=q;if(dt>u)break;Z>=this.dbufSize&&ce(Qt.DATA_ERROR),j[q=o[q=io(w,r=dt-1)]]++,rt[Z++]=q}else G||(G=1,s=0),s+=dt===0?G:2*G,G<<=1}for((a<0||a>=Z)&&ce(Qt.DATA_ERROR),e=0,r=0;r<256;r++)t=e+j[r],j[r]=e,e=t;for(r=0;r>=8,ft=-1),this.writePos=it,this.writeCurrent=O,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(Qt.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var Mu=function(r){if("readByte"in r)return r;var e=new J2;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},Nu=function(r){var e=new J2,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},ao=function(r,e,t){for(var n=Mu(r),i=Nu(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(Qt.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"),Hu=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 Cn,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(ea(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(Wt(e.signatureCreationTime,!0,_.writeDate(this.created))),this.signatureExpirationTime!==null&&t.push(Wt(e.signatureExpirationTime,!0,_.writeNumber(this.signatureExpirationTime,4))),this.exportable!==null&&t.push(Wt(e.exportableCertification,!0,new Uint8Array([this.exportable?1:0]))),this.trustLevel!==null&&(n=new Uint8Array([this.trustLevel,this.trustAmount]),t.push(Wt(e.trustSignature,!0,n))),this.regularExpression!==null&&t.push(Wt(e.regularExpression,!0,this.regularExpression)),this.revocable!==null&&t.push(Wt(e.revocable,!0,new Uint8Array([this.revocable?1:0]))),this.keyExpirationTime!==null&&t.push(Wt(e.keyExpirationTime,!0,_.writeNumber(this.keyExpirationTime,4))),this.preferredSymmetricAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredSymmetricAlgorithms)),t.push(Wt(e.preferredSymmetricAlgorithms,!1,n))),this.revocationKeyClass!==null&&(n=new Uint8Array([this.revocationKeyClass,this.revocationKeyAlgorithm]),n=_.concat([n,this.revocationKeyFingerprint]),t.push(Wt(e.revocationKey,!1,n))),this.issuerKeyID.isNull()||this.issuerKeyVersion===5||t.push(Wt(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(Wt(e.notationData,c,n))}),this.preferredHashAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredHashAlgorithms)),t.push(Wt(e.preferredHashAlgorithms,!1,n))),this.preferredCompressionAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredCompressionAlgorithms)),t.push(Wt(e.preferredCompressionAlgorithms,!1,n))),this.keyServerPreferences!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyServerPreferences)),t.push(Wt(e.keyServerPreferences,!1,n))),this.preferredKeyServer!==null&&t.push(Wt(e.preferredKeyServer,!1,_.encodeUTF8(this.preferredKeyServer))),this.isPrimaryUserID!==null&&t.push(Wt(e.primaryUserID,!1,new Uint8Array([this.isPrimaryUserID?1:0]))),this.policyURI!==null&&t.push(Wt(e.policyURI,!1,_.encodeUTF8(this.policyURI))),this.keyFlags!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.keyFlags)),t.push(Wt(e.keyFlags,!0,n))),this.signersUserID!==null&&t.push(Wt(e.signersUserID,!1,_.encodeUTF8(this.signersUserID))),this.reasonForRevocationFlag!==null&&(n=_.stringToUint8Array(String.fromCharCode(this.reasonForRevocationFlag)+this.reasonForRevocationString),t.push(Wt(e.reasonForRevocation,!0,n))),this.features!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.features)),t.push(Wt(e.features,!1,n))),this.signatureTargetPublicKeyAlgorithm!==null&&(n=[new Uint8Array([this.signatureTargetPublicKeyAlgorithm,this.signatureTargetHashAlgorithm])],n.push(_.stringToUint8Array(this.signatureTargetHash)),n=_.concat(n),t.push(Wt(e.signatureTarget,!0,n))),this.embeddedSignature!==null&&t.push(Wt(e.embeddedSignature,!0,this.embeddedSignature.write())),this.issuerFingerprint!==null&&(n=[new Uint8Array([this.issuerKeyVersion]),this.issuerFingerprint],n=_.concat(n),t.push(Wt(e.issuerFingerprint,this.version===5,n))),this.preferredAEADAlgorithms!==null&&(n=_.stringToUint8Array(_.uint8ArrayToString(this.preferredAEADAlgorithms)),t.push(Wt(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)),Hu.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=k2(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 Yt(ea(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 Fu(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]}gs.prototype.hash=mr.prototype.hash,gs.prototype.toHash=mr.prototype.toHash,gs.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 N3(a,async u=>{try{if(u.tag===p.packet.marker||u.tag===p.packet.trust)return;const c=Fu(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||Wi(u.tag))await o.abort(c);else{const w=new Is(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=sn(this.stream);for(;;){const{done:a,value:s}=await i.read();if(a?this.stream=null:this.push(s),a||Wi(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([M3(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(Yt(ea(i),s=>{a+=s.length},()=>r0(n,a)))}else e.push(r0(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)})}))):Pa(Go(n).pipe(e(t)))}}function co(r,e={}){return function(t){const n=new r(e);return Yt(t,i=>{if(i.length)return n.push(i,gi),n.result},()=>{if(r===vu)return n.push([],oe),n.result})}}function uo(r){return function(e){return _i(async()=>r(await ar(e)))}}qn&&(qn.inflateRaw,qn.createInflateRaw,qn.inflate,qn.createInflate);class ms{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 ho(r,e,t){const{keySize:n}=Bt.getCipher(t);return r.produceKey(e,n)}var $u=Zs(function(r){(function(e){function t(i){function a(){return Et0&&(et.semantic=" "),et}}function H(J,et){return function(){var ut,wt,kt,Ut,At;for(Ut=s(),ut=c("star"),kt=0,At=et===void 0?0:et;(wt=J())!==null;)kt+=1,l(ut,wt);return kt>=At?ut:(o(Ut),null)}}function E(J){return J.charCodeAt(0)>=128}function V(){return h("cr",y("\r")())}function j(){return h("crlf",K(V,Z)())}function q(){return h("dquote",y('"')())}function G(){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),ut=33<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut}))}function dt(){return h("wsp",x(tt,G)())}function it(){var J=h("quoted-pair",x(K(y("\\"),x(rt,dt)),C)());return J===null?null:(J.semantic=J.semantic[1],J)}function O(){return h("fws",x(B,K(M(K(H(dt),F(j))),H(dt,1)))())}function ft(){return h("ctext",x(function(){return w(function(J){var et=J.charCodeAt(0),ut=33<=et&&et<=39||42<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut})},lt)())}function Pt(){return h("ccontent",x(ft,it,$)())}function $(){return h("comment",K(y("("),H(K(M(O),Pt)),M(O),y(")"))())}function at(){return h("cfws",x(K(H(K(M(O),$),1),M(O)),O)())}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(Q(M(at)),H(mt,1),Q(M(at)))())}function yt(){var J,et;return(J=h("dot-atom-text",H(mt,1)()))===null||(et=H(K(y("."),H(mt,1)))())!==null&&l(J,et),J}function pt(){return h("dot-atom",K(F(M(at)),yt,F(M(at)))())}function gt(){return h("qtext",x(function(){return w(function(J){var et=J.charCodeAt(0),ut=et===33||35<=et&&et<=91||93<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut})},I)())}function ct(){return h("qcontent",x(gt,it)())}function S(){return h("quoted-string",K(F(M(at)),F(q),H(K(M(Q(O)),ct)),M(F(O)),F(q),F(M(at)))())}function N(){return h("word",x(bt,S)())}function b(){return h("address",x(f,X)())}function f(){return h("mailbox",x(U,ht)())}function U(){return h("name-addr",K(M(Y),W)())}function W(){return h("angle-addr",x(K(F(M(at)),y("<"),ht,y(">"),F(M(at))),R)())}function X(){return h("group",K(Y,y(":"),M(m),y(";"),F(M(at)))())}function Y(){return h("display-name",((J=h("phrase",x(D,H(N,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",x(K(f,H(K(y(","),f))),k)())}function d(){return h("address-list",x(K(b,H(K(y(","),b))),nt)())}function m(){return h("group-list",x(g,F(at),st)())}function A(){return h("local-part",x(St,pt,S)())}function T(){return h("dtext",x(function(){return w(function(J){var et=J.charCodeAt(0),ut=33<=et&&et<=90||94<=et&&et<=126;return i.rfc6532&&(ut=ut||E(J)),ut})},zt)())}function P(){return h("domain-literal",K(F(M(at)),y("["),H(K(M(O),T)),M(O),y("]"),F(M(at)))())}function z(){return h("domain",(J=x(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 ht(){return h("addr-spec",K(A,y("@"),z)())}function ot(){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 lt(){return i.strict?null:h("obs-ctext",ot())}function I(){return i.strict?null:h("obs-qtext",ot())}function C(){return i.strict?null:h("obs-qp",K(y("\\"),x(y("\0"),ot,Z,V))())}function D(){return i.strict?null:i.atInDisplayName?h("obs-phrase",K(N,H(x(N,y("."),y("@"),Q(at))))()):h("obs-phrase",K(N,H(x(N,y("."),Q(at))))())}function B(){return i.strict?null:h("obs-FWS",H(K(F(M(j)),dt),1)())}function R(){return i.strict?null:h("obs-angle-addr",K(F(M(at)),y("<"),L,ht,y(">"),F(M(at)))())}function L(){return i.strict?null:h("obs-route",K(v,y(":"))())}function v(){return i.strict?null:h("obs-domain-list",K(H(x(F(at),y(","))),y("@"),z,H(K(y(","),F(M(at)),M(K(y("@"),z)))))())}function k(){return i.strict?null:h("obs-mbox-list",K(H(K(F(M(at)),y(","))),f,H(K(y(","),M(K(f,F(at))))))())}function nt(){return i.strict?null:h("obs-addr-list",K(H(K(F(M(at)),y(","))),b,H(K(y(","),M(K(b,F(at))))))())}function st(){return i.strict?null:h("obs-group-list",K(H(K(F(M(at)),y(",")),1),F(M(at)))())}function St(){return i.strict?null:h("obs-local-part",K(N,H(K(y("."),N)))())}function It(){return i.strict?null:h("obs-domain",K(bt,H(K(y("."),bt)))())}function zt(){return i.strict?null:h("obs-dtext",x(ot,it)())}function Ct(J,et){var ut,wt,kt;if(et==null)return null;for(wt=[et];wt.length>0;){if((kt=wt.pop()).name===J)return kt;for(ut=kt.children.length-1;ut>=0;ut-=1)wt.push(kt.children[ut])}return null}function Vt(J,et){var ut,wt,kt,Ut,At;if(et==null)return null;for(wt=[et],Ut=[],At={},ut=0;ut0;)if((kt=wt.pop()).name in At)Ut.push(kt);else for(ut=kt.children.length-1;ut>=0;ut-=1)wt.push(kt.children[ut]);return Ut}function Xt(J){var et,ut,wt,kt,Ut;if(J===null)return null;for(et=[],ut=Vt(["group","mailbox"],J),wt=0;wt1?null:At.addresses&&At.addresses[0]}(Ut):i.simple?Ut&&Ut.addresses:Ut}function Jt(J){var et,ut=Ct("display-name",J),wt=[],kt=Vt(["mailbox"],J);for(et=0;et0;)for((Ie=De.pop()).name===Nt&&Me.push(Ie),Ce=Ie.children.length-1;Ce>=0;Ce-=1)De.push(Ie.children[Ce]);return Me}("cfws",J),kt=Vt(["comment"],J),Ut=Ct("local-part",ut),At=Ct("domain",ut);return{node:J,parts:{name:et,address:ut,local:Ut,domain:At,comments:wt},type:J.name,name:xt(et),address:xt(ut),local:xt(Ut),domain:xt(At),comments:Mt(kt),groupName:xt(J.groupName)}}function xt(J){return J!=null?J.semantic:null}function Mt(J){var et="";if(J)for(var ut=0;ut`),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}=$u.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 c1 extends o1{static get tag(){return p.packet.secretSubkey}constructor(e=new Date,t=vt){super(e,t)}}async function t5(r,e){const t=new c1(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 ju(r,e){const t=new o1(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 Ls(r,e,t=new Date){const n=_.normalizeDate(t);if(n!==null){const i=ba(r,e);return!(r.created<=n&&n0&&(a.keyExpirationTime=t.keyExpirationTime,a.keyNeverExpires=!1),await Nr(i,null,e,a,t.date,void 0,void 0,void 0,n)}async function qu(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 Nr(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 qu(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 In(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 ba(r,e){let t;return e.keyNeverExpires===!1&&(t=r.created.getTime()+1e3*e.keyExpirationTime),t?new Date(t):1/0}function Os(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 lo(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 fo(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 yo(r,e){return!!e.allowInsecureDecryptionWithSigningKeys||!r.keyFlags||(r.keyFlags[0]&p.keyFlags.encryptCommunication)!=0||(r.keyFlags[0]&p.keyFlags.encryptStorage)!=0}function An(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 In(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 Nr(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 an{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 an(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 In(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(Ls(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=ba(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 In(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 an(this.keyPacket,this.mainKey);return o.revocationSignatures.push(await Nr(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=>{an.prototype[r]=function(){return this.keyPacket[r]()}});const Gu=_.constructAllowedPackets([mr]),po=new Set([p.packet.publicKey,p.packet.privateKey]),go=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 Is){go.has(o.tag)&&!s&&(s=po.has(o.tag)?po:go);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 an(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(!lo(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),An(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&lo(a,u.selfCertification))return An(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(fo(u.keyPacket,h))return An(u.keyPacket,i),u}catch(c){o=c}try{const u=await this.getPrimaryUser(t,n,i);if((!e||a.getKeyID().equals(e))&&fo(a,u.selfCertification))return An(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 In(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(Ls(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&&Ls(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=ba(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=ba(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=>In(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),Gs(p.armor.publicKey,a.write(),null,null,"This is a revocation certificate")}async applyRevocationCertificate(e,t=new Date,n=vt){const i=await Jo(e,n),a=(await xe.fromBinary(i.data,Gu,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]=an.prototype[r]});class mo 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 Gs(p.armor.publicKey,this.toPacketList().write(),void 0,void 0,void 0,e)}}class za extends mo{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=Xe.fromSecretKeyPacket(n);e.push(i);break}case p.packet.secretSubkey:{const i=Ba.fromSecretSubkeyPacket(n);e.push(i);break}default:e.push(n)}return new mo(e)}armor(e=vt){return Gs(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 Nr(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=Ra.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 Nr(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 Nr(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 za(i)}async function i5({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 Jo(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,Vu,t);return new za(s)}async function Wu({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}){s5(c={...vt,...c}),r=o5(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"&&nOs(x.subkeys[j],x));let F=[ju(x,M)];F=F.concat(x.subkeys.map(V=>t5(V,M)));const Q=await Promise.all(F),H=await n5(Q[0],Q.slice(1),x,M),E=await H.getRevocationCertificate(x.date,M);return H.revocationSignatures=[],{key:H,revocationCertificate:E}}(w,c);return y.getKeys().forEach(({keyPacket:x})=>An(x,c)),{privateKey:ka(y,u,c),publicKey:ka(y.toPublic(),u,c),revocationCertificate:K}}catch(y){throw _.wrapError("Error generating keypair",y)}}async function a5({privateKey:r,userIDs:e=[],passphrase:t,keyExpirationTime:n=0,date:i,format:a="armored",config:s,...o}){s5(s={...vt,...s}),e=o5(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=H(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 x=K.keyPacket;w.subkeys||(w.subkeys=await Promise.all(K.subkeys.map(async E=>{const V=E.keyPacket,j={key:x,bind:V},q=await ze(E.bindingSignatures,x,p.signature.subkeyBinding,j,null,y).catch(()=>({}));return{sign:q.keyFlags&&q.keyFlags[0]&p.keyFlags.signData}})));const M=K.subkeys.map(E=>E.keyPacket);if(w.subkeys.length!==M.length)throw Error("Number of subkey options does not match number of subkeys");w.subkeys=w.subkeys.map(E=>H(E,w));const F=await n5(x,M,w,y),Q=await F.getRevocationCertificate(w.date,y);return F.revocationSignatures=[],{key:F,revocationCertificate:Q};function H(E,V={}){return E.keyExpirationTime=E.keyExpirationTime||V.keyExpirationTime,E.passphrase=_.isString(E.passphrase)?E.passphrase:V.passphrase,E.date=E.date||V.date,E}}(c,s);return{privateKey:ka(h,a,s),publicKey:ka(h.toPublic(),a,s),revocationCertificate:l}}catch(h){throw _.wrapError("Error reformatting keypair",h)}}const Zu=Object.keys(vt).length;function s5(r){const e=Object.keys(r);if(e.length!==Zu){for(const t of e)if(vt[t]===void 0)throw Error("Unknown config property: "+t)}}function o5(r){return r&&!_.isArray(r)&&(r=[r]),r}function ka(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 Qu=`#version 300 es in vec4 pos;void main(){gl_Position=pos;}`,Xu=`#version 300 es precision highp float;precision highp int; @@ -40,8 +40,8 @@ precision highp float;precision highp int; #define FILTER(h)(false) #endif uniform uint width,height,iteration,hashData[LENGTH];out vec4 outColor;void main(){uint i[LENGTH];for(int f=0;fu)break;uint n[]=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);}`,Yu=async(r,e)=>(r=await i5({armoredKey:r.armor()}),await Promise.all([r.keyPacket,...r.subkeys.map(t=>t.keyPacket)].map(t=>(t.created=e,t.computeFingerprintAndKeyID()))),await a5({privateKey:r,userIDs:r.users.map(t=>t.userID),date:e,format:"object"})),Ju=r=>((r&255)<<24|(r&65280)<<8|r>>8&65280|r>>24&255)>>>0,t6=async(r,e,t,n,i=()=>{},a=()=>!1,s=!1)=>{if(e=e.replaceAll(" ",""),e.length!=40)throw new Error("Invalid pattern");const o=[...[0,8,16,24,32].map((G,Z)=>{const tt=e.substring(G,G+8);let rt="",dt="",it=!1;for(let O=0;O<8;O++)tt[O].match(/[\da-f]/gi)?(rt+="F",dt+=tt[O].toUpperCase(),it=!0):(rt+="0",dt+="0");return it?`(h[${Z}] & 0x${rt}u) == 0x${dt}u`:""}),...e.split("").map((G,Z)=>G.toUpperCase()==="X"?Z:null).filter(Boolean).reduce((G,Z,tt,rt)=>{const dt=Math.floor(rt[tt-1]/8),it=Math.floor(Z/8),O=7-rt[tt-1]%8,ft=7-Z%8;return tt&&G.push(`((h[${dt}] ${ft>O?"<<":">>"} ${Math.abs(ft-O)*4}) & 0xF${"0".repeat(ft)}u) == (h[${it}] & 0xF${"0".repeat(ft)}u)`),G},[])].filter(Boolean).join(" && ")||"true",u=Math.round(Math.sqrt(t)),c=new OffscreenCanvas(u,u),h=c.getContext("webgl2");let l=!1,w,y,K=new Uint8Array,x=new Uint8Array,M=new ArrayBuffer(0),F=new Uint8Array,Q=new Uint32Array;const H=new ArrayBuffer(c.width*c.height*4),E=new Uint8Array(H),V=new Uint32Array(H);let j=0;const q=performance.now();return await new Promise((G,Z)=>{const tt=async()=>{try{const rt=await Wu({...r,format:"object"});if(K=(s?rt.publicKey.subkeys[0]:rt.publicKey).keyPacket.write(),!l){x=new Uint8Array(K.length+3),x[0]=153,M=new ArrayBuffer(Math.ceil((x.length+1+8)/64)*64),F=new Uint8Array(M),Q=new Uint32Array(M);const it=h.createShader(h.VERTEX_SHADER),O=h.createShader(h.FRAGMENT_SHADER);h.shaderSource(it,Qu),h.shaderSource(O,Xu.replaceAll("#define __INJECTS__",Object.entries({"FILTER(h)":o,LENGTH:Q.length}).map(([Pt,$])=>`#define ${Pt} (${$})`).join(` -`))),h.compileShader(it),h.compileShader(O),w=h.createProgram(),h.attachShader(w,it),h.attachShader(w,O),h.linkProgram(w),h.useProgram(w),h.uniform1ui(h.getUniformLocation(w,"width"),c.width),h.uniform1ui(h.getUniformLocation(w,"height"),c.height),h.uniform1ui(h.getUniformLocation(w,"iteration"),n),y=h.getUniformLocation(w,"hashData");const ft=h.getAttribLocation(w,"pos");h.enableVertexAttribArray(ft),h.bindBuffer(h.ARRAY_BUFFER,h.createBuffer()),h.bufferData(h.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),h.STATIC_DRAW),h.vertexAttribPointer(ft,2,h.FLOAT,!1,0,0),h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),l=!0}x.set([K.length>>8&255,K.length&255],1),x.set(K,3),Q[x.length>>2]=0,F.set(x),F[x.length]=128;for(let it=0;it{this.hashCount=t,this.runningTime=n},()=>!this.running,this.vanitySubkey);if(e){this.generatedKey=e;const t=e.privateKey.armor(),n=e.publicKey.getCreationTime().toISOString(),i=this.formatFingerprint(e.publicKey.getFingerprint());console.log(t),console.log("Created:",n),console.log("Fingerprint:",i),this.notification.sfx&&r6.play(),this.notification.ntfy&&this.notification.ntfyTopic&&fetch("https://ntfy.sh/",{method:"POST",body:JSON.stringify({topic:this.notification.ntfyTopic,markdown:!0,title:"webgl-vanity-gpg 计算出了新的密钥!",message:"Fingerprint: `"+i+`\` +`))),h.compileShader(it),h.compileShader(O),w=h.createProgram(),h.attachShader(w,it),h.attachShader(w,O),h.linkProgram(w),h.useProgram(w),h.uniform1ui(h.getUniformLocation(w,"width"),c.width),h.uniform1ui(h.getUniformLocation(w,"height"),c.height),h.uniform1ui(h.getUniformLocation(w,"iteration"),n),y=h.getUniformLocation(w,"hashData");const ft=h.getAttribLocation(w,"pos");h.enableVertexAttribArray(ft),h.bindBuffer(h.ARRAY_BUFFER,h.createBuffer()),h.bufferData(h.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),h.STATIC_DRAW),h.vertexAttribPointer(ft,2,h.FLOAT,!1,0,0),h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),l=!0}x.set([K.length>>8&255,K.length&255],1),x.set(K,3),Q[x.length>>2]=0,F.set(x),F[x.length]=128;for(let it=0;it{this.hashCount=t,this.runningTime=n},()=>!this.running,this.vanitySubkey);e&&(this.generatedKey=e,this.generatedKeyHistory.push(e),this.notification.sfx&&r6.play(),this.notification.ntfy&&this.notification.ntfyTopic&&fetch("https://ntfy.sh/",{method:"POST",body:JSON.stringify({topic:this.notification.ntfyTopic,markdown:!0,title:"webgl-vanity-gpg 计算出了新的密钥!",message:"Fingerprint: `"+this.formatFingerprint(e.publicKey.getFingerprint())+`\` -Created: `+n+` +Created: `+e.publicKey.getCreationTime().toISOString()+` -请回到打开的 webgl-vanity-gpg 页面,在页面上/控制台中查看生成的密钥。`})})}}while(this.running&&this.nonstopMode)}catch(r){alert(r)}finally{this.running=!1}},async subkeyCombine(){try{const[r,e]=await Promise.all([this.subkeyCombinerArmoredA,this.subkeyCombinerArmoredB].map(i=>i5({armoredKey:i})));r.subkeys.push(new an(Object.assign(new c1,e.keyPacket),r.toPublic()),...e.subkeys);const t=await a5({privateKey:r,userIDs:r.users.map(i=>i.userID),date:r.keyPacket.created,format:"object"}),n=document.createElement("a");n.href=`data:text/plain;charset=utf-8,${encodeURIComponent(t.privateKey.armor())}`,n.download=`${t.privateKey.getFingerprint().toUpperCase()}-sec.asc`,n.click()}catch(r){alert(r)}}};Fo(n6).mount();export{Tn as A,Ka as J,Xc as M,Pi as Y,Dt as d,Qs as g,Bc as i,Zs as r,s6 as t,o6 as x,p3 as y,h2 as z}; +请回到打开的 webgl-vanity-gpg 页面,在页面上/控制台中查看生成的密钥。`})}))}while(this.running&&this.nonstopMode)}catch(r){alert(r)}finally{this.running=!1}},async subkeyCombine(){try{const[r,e]=await Promise.all([this.subkeyCombinerArmoredA,this.subkeyCombinerArmoredB].map(i=>i5({armoredKey:i})));r.subkeys.push(new an(Object.assign(new c1,e.keyPacket),r.toPublic()),...e.subkeys);const t=await a5({privateKey:r,userIDs:r.users.map(i=>i.userID),date:r.keyPacket.created,format:"object"}),n=document.createElement("a");n.href=`data:text/plain;charset=utf-8,${encodeURIComponent(t.privateKey.armor())}`,n.download=`${t.privateKey.getFingerprint().toUpperCase()}-sec.asc`,n.click()}catch(r){alert(r)}}};Fo(n6).mount();export{Tn as A,Ka as J,Xc as M,Pi as Y,Dt as d,Qs as g,Bc as i,Zs as r,s6 as t,o6 as x,p3 as y,h2 as z}; diff --git a/index.html b/index.html index 9a27f03..b1fbf83 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 个十六进制数字,不区分大小写。空格会被忽略,X 表示只要这些位相同即可,其他 [\dA-FX] 以外的字符表示对该位数字没有要求。

最后 个数字为 快速设置

预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍,也许需要一点运气……

把不同密钥的“靓号”合并到一起!
私钥 A
私钥 B

如果你希望生成主密钥和子密钥都是“靓号”的密钥,可以先分别生成两个不同的密钥,然后在这里合并。

私钥 B 的主密钥和子密钥将作为子密钥被附加到私钥 A 上。

然后,请自行使用 gpg --edit-key 编辑私钥,例如删除不需要的子密钥 delkey、修改密钥用途 change-usage 和有效期 expire 等,再输入 save 保存更改。

算号成功后播放提示音
算号成功后使用 ntfy 发送通知
不间断算号(在控制台中查看先前生成的密钥)

已计算 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' }}

指纹(主密钥和子密钥):

  • {{ formatFingerprint(e) }}

\ 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 个十六进制数字,不区分大小写。空格会被忽略,X 表示只要这些位相同即可,其他 [\dA-FX] 以外的字符表示对该位数字没有要求。

最后 个数字为 快速设置

预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍,也许需要一点运气……

把不同密钥的“靓号”合并到一起!
私钥 A
私钥 B

如果你希望生成主密钥和子密钥都是“靓号”的密钥,可以先分别生成两个不同的密钥,然后在这里合并。

私钥 B 的主密钥和子密钥将作为子密钥被附加到私钥 A 上。

然后,请自行使用 gpg --edit-key 编辑私钥,例如删除不需要的子密钥 delkey、修改密钥用途 change-usage 和有效期 expire 等,再输入 save 保存更改。

算号成功后播放提示音
算号成功后使用 ntfy 发送通知
不间断算号

已计算 hash:{{ hashCount }} {{ `(${Number(BigInt(hashCount) * 100n / estimatedHashCount) / 100}x estimated)` }}
耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s
速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s

生成的密钥

[清除生成记录]

私钥
公钥

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

指纹(主密钥和子密钥):

  • {{ formatFingerprint(e) }}

\ No newline at end of file