crypt4gh_js
Version:
Crypt4GH Version JavaScript
2 lines • 1.27 MB
JavaScript
/*! For license information please see main.js.LICENSE.txt */
(()=>{var __webpack_modules__={972:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4512);function A(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}function n(t,e,r){return void 0===e&&(e=new Uint8Array(2)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}function o(t,e){return void 0===e&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function a(t,e){return void 0===e&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function s(t,e){return void 0===e&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}function h(t,e){return void 0===e&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}function f(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}function u(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}function c(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),f(t/4294967296>>>0,e,r),f(t>>>0,e,r+4),e}function g(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),u(t>>>0,e,r),u(t/4294967296>>>0,e,r+4),e}e.readInt16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16},e.readUint16BE=function(t,e){return void 0===e&&(e=0),(t[e+0]<<8|t[e+1])>>>0},e.readInt16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])<<16>>16},e.readUint16LE=function(t,e){return void 0===e&&(e=0),(t[e+1]<<8|t[e])>>>0},e.writeUint16BE=A,e.writeInt16BE=A,e.writeUint16LE=n,e.writeInt16LE=n,e.readInt32BE=o,e.readUint32BE=a,e.readInt32LE=s,e.readUint32LE=h,e.writeUint32BE=f,e.writeInt32BE=f,e.writeUint32LE=u,e.writeInt32LE=u,e.readInt64BE=function(t,e){void 0===e&&(e=0);var r=o(t,e),i=o(t,e+4);return 4294967296*r+i-4294967296*(i>>31)},e.readUint64BE=function(t,e){return void 0===e&&(e=0),4294967296*a(t,e)+a(t,e+4)},e.readInt64LE=function(t,e){void 0===e&&(e=0);var r=s(t,e);return 4294967296*s(t,e+4)+r-4294967296*(r>>31)},e.readUint64LE=function(t,e){void 0===e&&(e=0);var r=h(t,e);return 4294967296*h(t,e+4)+r},e.writeUint64BE=c,e.writeInt64BE=c,e.writeUint64LE=g,e.writeInt64LE=g,e.readUintBE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,A=1,n=t/8+r-1;n>=r;n--)i+=e[n]*A,A*=256;return i},e.readUintLE=function(t,e,r){if(void 0===r&&(r=0),t%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,A=1,n=r;n<r+t/8;n++)i+=e[n]*A,A*=256;return i},e.writeUintBE=function(t,e,r,A){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===A&&(A=0),t%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var n=1,o=t/8+A-1;o>=A;o--)r[o]=e/n&255,n*=256;return r},e.writeUintLE=function(t,e,r,A){if(void 0===r&&(r=new Uint8Array(t/8)),void 0===A&&(A=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!i.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,o=A;o<A+t/8;o++)r[o]=e/n&255,n*=256;return r},e.readFloat32BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e)},e.readFloat32LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},e.readFloat64BE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e)},e.readFloat64LE=function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},e.writeFloat32BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t),e},e.writeFloat32LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(4)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat32(r,t,!0),e},e.writeFloat64BE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t),e},e.writeFloat64LE=function(t,e,r){return void 0===e&&(e=new Uint8Array(8)),void 0===r&&(r=0),new DataView(e.buffer,e.byteOffset,e.byteLength).setFloat64(r,t,!0),e}},9444:(t,e,r)=>{"use strict";var i=r(972),A=r(6228);e.cS=128,e.On=64,e.J4=64,e.Cc=16,e.wU=16,e.wm=Math.pow(2,32)-1,e.np=255,e._n=255;var n=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],a=function(){function t(t,r){if(void 0===t&&(t=64),this.digestLength=t,this.blockSize=e.cS,this._state=new Int32Array(n),this._buffer=new Uint8Array(e.cS),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),t<1||t>e.On)throw new Error("blake2b: wrong digest length");r&&this.validateConfig(r);var A=0;r&&r.key&&(A=r.key.length);var o=1,a=1;r&&r.tree&&(o=r.tree.fanout,a=r.tree.maxDepth),this._state[0]^=t|A<<8|o<<16|a<<24,r&&r.tree&&(this._state[1]^=r.tree.leafSize,this._state[2]^=r.tree.nodeOffsetLowBits,this._state[3]^=r.tree.nodeOffsetHighBits,this._state[4]^=r.tree.nodeDepth|r.tree.innerDigestLength<<8,this._lastNode=r.tree.lastNode),r&&r.salt&&(this._state[8]^=i.readUint32LE(r.salt,0),this._state[9]^=i.readUint32LE(r.salt,4),this._state[10]^=i.readUint32LE(r.salt,8),this._state[11]^=i.readUint32LE(r.salt,12)),r&&r.personalization&&(this._state[12]^=i.readUint32LE(r.personalization,0),this._state[13]^=i.readUint32LE(r.personalization,4),this._state[14]^=i.readUint32LE(r.personalization,8),this._state[15]^=i.readUint32LE(r.personalization,12)),this._initialState=new Uint32Array(this._state),r&&r.key&&A>0&&(this._paddedKey=new Uint8Array(e.cS),this._paddedKey.set(r.key),this._buffer.set(this._paddedKey),this._bufferLength=e.cS)}return t.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=e.cS):this._bufferLength=0,A.wipe(this._ctr),A.wipe(this._flag),this._finished=!1,this},t.prototype.validateConfig=function(t){if(t.key&&t.key.length>e.J4)throw new Error("blake2b: wrong key length");if(t.salt&&t.salt.length!==e.wU)throw new Error("blake2b: wrong salt length");if(t.personalization&&t.personalization.length!==e.Cc)throw new Error("blake2b: wrong personalization length");if(t.tree){if(t.tree.fanout<0||t.tree.fanout>e.np)throw new Error("blake2b: wrong tree fanout");if(t.tree.maxDepth<0||t.tree.maxDepth>e._n)throw new Error("blake2b: wrong tree depth");if(t.tree.leafSize<0||t.tree.leafSize>e.wm)throw new Error("blake2b: wrong leaf size");if(t.tree.innerDigestLength<0||t.tree.innerDigestLength>e.On)throw new Error("blake2b: wrong tree inner digest length")}},t.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var i=e.cS-this._bufferLength,A=0;if(0===r)return this;if(r>i){for(var n=0;n<i;n++)this._buffer[this._bufferLength+n]=t[A+n];this._processBlock(e.cS),A+=i,r-=i,this._bufferLength=0}for(;r>e.cS;){for(n=0;n<e.cS;n++)this._buffer[n]=t[A+n];this._processBlock(e.cS),A+=e.cS,r-=e.cS,this._bufferLength=0}for(n=0;n<r;n++)this._buffer[this._bufferLength+n]=t[A+n];return this._bufferLength+=r,this},t.prototype.finish=function(t){if(!this._finished){for(var r=this._bufferLength;r<e.cS;r++)this._buffer[r]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}var A=this._buffer.subarray(0,64);for(r=0;r<16;r++)i.writeUint32LE(this._state[r],A,4*r);return t.set(A.subarray(0,t.length)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t.prototype.clean=function(){A.wipe(this._vtmp),A.wipe(this._mtmp),A.wipe(this._state),A.wipe(this._buffer),A.wipe(this._initialState),this._paddedKey&&A.wipe(this._paddedKey),this._bufferLength=0,A.wipe(this._ctr),A.wipe(this._flag),this._lastNode=!1,this._finished=!1},t.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},t.prototype.restoreState=function(t){return this._state.set(t.state),this._buffer.set(t.buffer),this._bufferLength=t.bufferLength,this._ctr.set(t.ctr),this._flag.set(t.flag),this._lastNode=t.lastNode,this._paddedKey&&A.wipe(this._paddedKey),this._paddedKey=t.paddedKey?new Uint8Array(t.paddedKey):void 0,this._initialState.set(t.initialState),this},t.prototype.cleanSavedState=function(t){A.wipe(t.state),A.wipe(t.buffer),A.wipe(t.initialState),t.paddedKey&&A.wipe(t.paddedKey),t.bufferLength=0,A.wipe(t.ctr),A.wipe(t.flag),t.lastNode=!1},t.prototype._G=function(t,e,r,i,A,n,o,a,s,h,f,u,c){var g=t[e],l=t[n],d=t[r],p=t[o],I=t[i],y=t[a],C=t[A],B=t[s],m=65535&g,_=g>>>16,v=65535&l,b=l>>>16;_+=d>>>16,v+=65535&p,b+=p>>>16,v+=(_+=(m+=65535&d)>>>16)>>>16,m=65535&(g=65535&m|_<<16),_=g>>>16,v=65535&(l=65535&v|(b+=v>>>16)<<16),b=l>>>16,_+=h>>>16,v+=65535&f,b+=f>>>16,g=65535&(m+=65535&h)|(_+=m>>>16)<<16,m=B^=l=65535&(v+=_>>>16)|(b+=v>>>16)<<16,B=C^=g,C=m,m=65535&I,_=I>>>16,v=65535&y,b=y>>>16,_+=C>>>16,v+=65535&B,b+=B>>>16,m=(d^=I=65535&(m+=65535&C)|(_+=m>>>16)<<16)<<8|(p^=y=65535&(v+=_>>>16)|(b+=v>>>16)<<16)>>>24,d=p<<8|d>>>24,p=m,m=65535&g,_=g>>>16,v=65535&l,b=l>>>16,_+=d>>>16,v+=65535&p,b+=p>>>16,v+=(_+=(m+=65535&d)>>>16)>>>16,m=65535&(g=65535&m|_<<16),_=g>>>16,v=65535&(l=65535&v|(b+=v>>>16)<<16),b=l>>>16,_+=u>>>16,v+=65535&c,b+=c>>>16,m=(C^=g=65535&(m+=65535&u)|(_+=m>>>16)<<16)<<16|(B^=l=65535&(v+=_>>>16)|(b+=v>>>16)<<16)>>>16,C=B<<16|C>>>16,B=m,m=65535&I,_=I>>>16,v=65535&y,b=y>>>16,_+=C>>>16,v+=65535&B,b+=B>>>16,m=(p^=y=65535&(v+=(_+=(m+=65535&C)>>>16)>>>16)|(b+=v>>>16)<<16)<<1|(d^=I=65535&m|_<<16)>>>31,d=d<<1|p>>>31,p=m,t[e]=g,t[n]=l,t[r]=d,t[o]=p,t[i]=I,t[a]=y,t[A]=C,t[s]=B},t.prototype._incrementCounter=function(t){for(var e=0;e<3;e++){var r=this._ctr[e]+t;if(this._ctr[e]=r>>>0,this._ctr[e]===r)return;t=1}},t.prototype._processBlock=function(t){this._incrementCounter(t);var e=this._vtmp;e.set(this._state),e.set(n,16),e[24]^=this._ctr[0],e[25]^=this._ctr[1],e[26]^=this._ctr[2],e[27]^=this._ctr[3],e[28]^=this._flag[0],e[29]^=this._flag[1],e[30]^=this._flag[2],e[31]^=this._flag[3];for(var r=this._mtmp,A=0;A<32;A++)r[A]=i.readUint32LE(this._buffer,4*A);for(var a=0;a<12;a++)this._G(e,0,8,16,24,1,9,17,25,r[o[a][0]],r[o[a][0]+1],r[o[a][1]],r[o[a][1]+1]),this._G(e,2,10,18,26,3,11,19,27,r[o[a][2]],r[o[a][2]+1],r[o[a][3]],r[o[a][3]+1]),this._G(e,4,12,20,28,5,13,21,29,r[o[a][4]],r[o[a][4]+1],r[o[a][5]],r[o[a][5]+1]),this._G(e,6,14,22,30,7,15,23,31,r[o[a][6]],r[o[a][6]+1],r[o[a][7]],r[o[a][7]+1]),this._G(e,0,10,20,30,1,11,21,31,r[o[a][8]],r[o[a][8]+1],r[o[a][9]],r[o[a][9]+1]),this._G(e,2,12,22,24,3,13,23,25,r[o[a][10]],r[o[a][10]+1],r[o[a][11]],r[o[a][11]+1]),this._G(e,4,14,16,26,5,15,17,27,r[o[a][12]],r[o[a][12]+1],r[o[a][13]],r[o[a][13]+1]),this._G(e,6,8,18,28,7,9,19,29,r[o[a][14]],r[o[a][14]+1],r[o[a][15]],r[o[a][15]+1]);for(A=0;A<16;A++)this._state[A]^=e[A]^e[A+16]},t}();e.yL=a},4512:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mul=Math.imul||function(t,e){var r=65535&t,i=65535&e;return r*i+((t>>>16&65535)*i+r*(e>>>16&65535)<<16>>>0)|0},e.add=function(t,e){return t+e|0},e.sub=function(t,e){return t-e|0},e.rotl=function(t,e){return t<<e|t>>>32-e},e.rotr=function(t,e){return t<<32-e|t>>>e},e.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}},7052:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const i=r(5492),A=r(972),n=r(6228);function o(t,r=e.defaultRandomSource){return r.randomBytes(t)}e.defaultRandomSource=new i.SystemRandomSource,e.randomBytes=o,e.randomUint32=function(t=e.defaultRandomSource){const r=o(4,t),i=(0,A.readUint32LE)(r);return(0,n.wipe)(r),i};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function s(t,r=a,i=e.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let A="";const s=r.length,h=256-256%s;for(;t>0;){const e=o(Math.ceil(256*t/h),i);for(let i=0;i<e.length&&t>0;i++){const n=e[i];n<h&&(A+=r.charAt(n%s),t--)}(0,n.wipe)(e)}return A}e.randomString=s,e.randomStringForEntropy=function(t,r=a,i=e.defaultRandomSource){return s(Math.ceil(t/(Math.log(r.length)/Math.LN2)),r,i)}},7029:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserRandomSource=void 0,e.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const e=new Uint8Array(t);for(let t=0;t<e.length;t+=65536)this._crypto.getRandomValues(e.subarray(t,t+Math.min(e.length-t,65536)));return e}}},5821:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;const i=r(6228);e.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const t=r(9432);t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let e=this._crypto.randomBytes(t);if(e.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(t);for(let t=0;t<r.length;t++)r[t]=e[t];return(0,i.wipe)(e),r}}},5492:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;const i=r(7029),A=r(5821);e.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new i.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new A.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}},6228:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wipe=function(t){for(var e=0;e<t.length;e++)t[e]=0;return t}},774:(t,e,r)=>{"use strict";e.Tc=e.TZ=e.K=e.wE=e.Xx=void 0;const i=r(7052),A=r(6228);function n(t){const e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}e.Xx=32,e.wE=32;const o=new Uint8Array(32);o[0]=9;const a=n([56129,1]);function s(t){let e=1;for(let r=0;r<16;r++){let i=t[r]+e+65535;e=Math.floor(i/65536),t[r]=i-65536*e}t[0]+=e-1+37*(e-1)}function h(t,e,r){const i=~(r-1);for(let r=0;r<16;r++){const A=i&(t[r]^e[r]);t[r]^=A,e[r]^=A}}function f(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]+r[i]}function u(t,e,r){for(let i=0;i<16;i++)t[i]=e[i]-r[i]}function c(t,e,r){let i,A,n=0,o=0,a=0,s=0,h=0,f=0,u=0,c=0,g=0,l=0,d=0,p=0,I=0,y=0,C=0,B=0,m=0,_=0,v=0,b=0,w=0,E=0,Q=0,M=0,k=0,D=0,S=0,x=0,F=0,N=0,U=0,H=r[0],G=r[1],R=r[2],Y=r[3],K=r[4],P=r[5],L=r[6],J=r[7],T=r[8],q=r[9],j=r[10],O=r[11],z=r[12],X=r[13],Z=r[14],V=r[15];i=e[0],n+=i*H,o+=i*G,a+=i*R,s+=i*Y,h+=i*K,f+=i*P,u+=i*L,c+=i*J,g+=i*T,l+=i*q,d+=i*j,p+=i*O,I+=i*z,y+=i*X,C+=i*Z,B+=i*V,i=e[1],o+=i*H,a+=i*G,s+=i*R,h+=i*Y,f+=i*K,u+=i*P,c+=i*L,g+=i*J,l+=i*T,d+=i*q,p+=i*j,I+=i*O,y+=i*z,C+=i*X,B+=i*Z,m+=i*V,i=e[2],a+=i*H,s+=i*G,h+=i*R,f+=i*Y,u+=i*K,c+=i*P,g+=i*L,l+=i*J,d+=i*T,p+=i*q,I+=i*j,y+=i*O,C+=i*z,B+=i*X,m+=i*Z,_+=i*V,i=e[3],s+=i*H,h+=i*G,f+=i*R,u+=i*Y,c+=i*K,g+=i*P,l+=i*L,d+=i*J,p+=i*T,I+=i*q,y+=i*j,C+=i*O,B+=i*z,m+=i*X,_+=i*Z,v+=i*V,i=e[4],h+=i*H,f+=i*G,u+=i*R,c+=i*Y,g+=i*K,l+=i*P,d+=i*L,p+=i*J,I+=i*T,y+=i*q,C+=i*j,B+=i*O,m+=i*z,_+=i*X,v+=i*Z,b+=i*V,i=e[5],f+=i*H,u+=i*G,c+=i*R,g+=i*Y,l+=i*K,d+=i*P,p+=i*L,I+=i*J,y+=i*T,C+=i*q,B+=i*j,m+=i*O,_+=i*z,v+=i*X,b+=i*Z,w+=i*V,i=e[6],u+=i*H,c+=i*G,g+=i*R,l+=i*Y,d+=i*K,p+=i*P,I+=i*L,y+=i*J,C+=i*T,B+=i*q,m+=i*j,_+=i*O,v+=i*z,b+=i*X,w+=i*Z,E+=i*V,i=e[7],c+=i*H,g+=i*G,l+=i*R,d+=i*Y,p+=i*K,I+=i*P,y+=i*L,C+=i*J,B+=i*T,m+=i*q,_+=i*j,v+=i*O,b+=i*z,w+=i*X,E+=i*Z,Q+=i*V,i=e[8],g+=i*H,l+=i*G,d+=i*R,p+=i*Y,I+=i*K,y+=i*P,C+=i*L,B+=i*J,m+=i*T,_+=i*q,v+=i*j,b+=i*O,w+=i*z,E+=i*X,Q+=i*Z,M+=i*V,i=e[9],l+=i*H,d+=i*G,p+=i*R,I+=i*Y,y+=i*K,C+=i*P,B+=i*L,m+=i*J,_+=i*T,v+=i*q,b+=i*j,w+=i*O,E+=i*z,Q+=i*X,M+=i*Z,k+=i*V,i=e[10],d+=i*H,p+=i*G,I+=i*R,y+=i*Y,C+=i*K,B+=i*P,m+=i*L,_+=i*J,v+=i*T,b+=i*q,w+=i*j,E+=i*O,Q+=i*z,M+=i*X,k+=i*Z,D+=i*V,i=e[11],p+=i*H,I+=i*G,y+=i*R,C+=i*Y,B+=i*K,m+=i*P,_+=i*L,v+=i*J,b+=i*T,w+=i*q,E+=i*j,Q+=i*O,M+=i*z,k+=i*X,D+=i*Z,S+=i*V,i=e[12],I+=i*H,y+=i*G,C+=i*R,B+=i*Y,m+=i*K,_+=i*P,v+=i*L,b+=i*J,w+=i*T,E+=i*q,Q+=i*j,M+=i*O,k+=i*z,D+=i*X,S+=i*Z,x+=i*V,i=e[13],y+=i*H,C+=i*G,B+=i*R,m+=i*Y,_+=i*K,v+=i*P,b+=i*L,w+=i*J,E+=i*T,Q+=i*q,M+=i*j,k+=i*O,D+=i*z,S+=i*X,x+=i*Z,F+=i*V,i=e[14],C+=i*H,B+=i*G,m+=i*R,_+=i*Y,v+=i*K,b+=i*P,w+=i*L,E+=i*J,Q+=i*T,M+=i*q,k+=i*j,D+=i*O,S+=i*z,x+=i*X,F+=i*Z,N+=i*V,i=e[15],B+=i*H,m+=i*G,_+=i*R,v+=i*Y,b+=i*K,w+=i*P,E+=i*L,Q+=i*J,M+=i*T,k+=i*q,D+=i*j,S+=i*O,x+=i*z,F+=i*X,N+=i*Z,U+=i*V,n+=38*m,o+=38*_,a+=38*v,s+=38*b,h+=38*w,f+=38*E,u+=38*Q,c+=38*M,g+=38*k,l+=38*D,d+=38*S,p+=38*x,I+=38*F,y+=38*N,C+=38*U,A=1,i=n+A+65535,A=Math.floor(i/65536),n=i-65536*A,i=o+A+65535,A=Math.floor(i/65536),o=i-65536*A,i=a+A+65535,A=Math.floor(i/65536),a=i-65536*A,i=s+A+65535,A=Math.floor(i/65536),s=i-65536*A,i=h+A+65535,A=Math.floor(i/65536),h=i-65536*A,i=f+A+65535,A=Math.floor(i/65536),f=i-65536*A,i=u+A+65535,A=Math.floor(i/65536),u=i-65536*A,i=c+A+65535,A=Math.floor(i/65536),c=i-65536*A,i=g+A+65535,A=Math.floor(i/65536),g=i-65536*A,i=l+A+65535,A=Math.floor(i/65536),l=i-65536*A,i=d+A+65535,A=Math.floor(i/65536),d=i-65536*A,i=p+A+65535,A=Math.floor(i/65536),p=i-65536*A,i=I+A+65535,A=Math.floor(i/65536),I=i-65536*A,i=y+A+65535,A=Math.floor(i/65536),y=i-65536*A,i=C+A+65535,A=Math.floor(i/65536),C=i-65536*A,i=B+A+65535,A=Math.floor(i/65536),B=i-65536*A,n+=A-1+37*(A-1),A=1,i=n+A+65535,A=Math.floor(i/65536),n=i-65536*A,i=o+A+65535,A=Math.floor(i/65536),o=i-65536*A,i=a+A+65535,A=Math.floor(i/65536),a=i-65536*A,i=s+A+65535,A=Math.floor(i/65536),s=i-65536*A,i=h+A+65535,A=Math.floor(i/65536),h=i-65536*A,i=f+A+65535,A=Math.floor(i/65536),f=i-65536*A,i=u+A+65535,A=Math.floor(i/65536),u=i-65536*A,i=c+A+65535,A=Math.floor(i/65536),c=i-65536*A,i=g+A+65535,A=Math.floor(i/65536),g=i-65536*A,i=l+A+65535,A=Math.floor(i/65536),l=i-65536*A,i=d+A+65535,A=Math.floor(i/65536),d=i-65536*A,i=p+A+65535,A=Math.floor(i/65536),p=i-65536*A,i=I+A+65535,A=Math.floor(i/65536),I=i-65536*A,i=y+A+65535,A=Math.floor(i/65536),y=i-65536*A,i=C+A+65535,A=Math.floor(i/65536),C=i-65536*A,i=B+A+65535,A=Math.floor(i/65536),B=i-65536*A,n+=A-1+37*(A-1),t[0]=n,t[1]=o,t[2]=a,t[3]=s,t[4]=h,t[5]=f,t[6]=u,t[7]=c,t[8]=g,t[9]=l,t[10]=d,t[11]=p,t[12]=I,t[13]=y,t[14]=C,t[15]=B}function g(t,e){c(t,e,e)}function l(t,e){const r=new Uint8Array(32),i=new Float64Array(80),A=n(),o=n(),l=n(),d=n(),p=n(),I=n();for(let e=0;e<31;e++)r[e]=t[e];r[31]=127&t[31]|64,r[0]&=248,function(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(i,e);for(let t=0;t<16;t++)o[t]=i[t];A[0]=d[0]=1;for(let t=254;t>=0;--t){const e=r[t>>>3]>>>(7&t)&1;h(A,o,e),h(l,d,e),f(p,A,l),u(A,A,l),f(l,o,d),u(o,o,d),g(d,p),g(I,A),c(A,l,A),c(l,o,p),f(p,A,l),u(A,A,l),g(o,A),u(l,d,I),c(A,l,a),f(A,A,d),c(l,l,A),c(A,d,I),c(d,o,i),g(o,p),h(A,o,e),h(l,d,e)}for(let t=0;t<16;t++)i[t+16]=A[t],i[t+32]=l[t],i[t+48]=o[t],i[t+64]=d[t];const y=i.subarray(32),C=i.subarray(16);!function(t,e){const r=n();for(let t=0;t<16;t++)r[t]=e[t];for(let t=253;t>=0;t--)g(r,r),2!==t&&4!==t&&c(r,r,e);for(let e=0;e<16;e++)t[e]=r[e]}(y,y),c(C,C,y);const B=new Uint8Array(32);return function(t,e){const r=n(),i=n();for(let t=0;t<16;t++)i[t]=e[t];s(i),s(i),s(i);for(let t=0;t<2;t++){r[0]=i[0]-65517;for(let t=1;t<15;t++)r[t]=i[t]-65535-(r[t-1]>>16&1),r[t-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);const t=r[15]>>16&1;r[14]&=65535,h(i,r,1-t)}for(let e=0;e<16;e++)t[2*e]=255&i[e],t[2*e+1]=i[e]>>8}(B,C),B}function d(t){if(t.length!==e.wE)throw new Error(`x25519: seed must be ${e.wE} bytes`);const r=new Uint8Array(t);return{publicKey:(i=r,l(i,o)),secretKey:r};var i}e.K=d,e.TZ=function(t){const e=(0,i.randomBytes)(32,t),r=d(e);return(0,A.wipe)(e),r},e.Tc=function(t,r,i=!1){if(t.length!==e.Xx)throw new Error("X25519: incorrect secret key length");if(r.length!==e.Xx)throw new Error("X25519: incorrect public key length");const A=l(t,r);if(i){let t=0;for(let e=0;e<A.length;e++)t|=A[e];if(0===t)throw new Error("X25519: invalid shared key")}return A}},7568:(t,e,r)=>{var i=e;i.bignum=r(2344),i.define=r(7363).define,i.base=r(9673),i.constants=r(2153),i.decoders=r(2853),i.encoders=r(4669)},7363:(t,e,r)=>{var i=r(7568),A=r(6698);function n(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new n(t,e)},n.prototype._createNamed=function(t){var e;try{e=r(7828).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){e=function(t){this._initNamed(t)}}return A(e,t),e.prototype._initNamed=function(e){t.call(this,e)},new e(this)},n.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i.decoders[t])),this.decoders[t]},n.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},n.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i.encoders[t])),this.encoders[t]},n.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},7227:(t,e,r)=>{var i=r(6698),A=r(9673).Reporter,n=r(8287).Buffer;function o(t,e){A.call(this,e),n.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return t instanceof a||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=n.byteLength(t);else{if(!n.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(o,A),e.t=o,o.prototype.save=function(){return{offset:this.offset,reporter:A.prototype.save.call(this)}},o.prototype.restore=function(t){var e=new o(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,A.prototype.restore.call(this,t.reporter),e},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},o.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.d=a,a.prototype.join=function(t,e){return t||(t=new n(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):n.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},9673:(t,e,r)=>{var i=e;i.Reporter=r(9220).a,i.DecoderBuffer=r(7227).t,i.EncoderBuffer=r(7227).d,i.Node=r(993)},993:(t,e,r)=>{var i=r(9673).Reporter,A=r(9673).EncoderBuffer,n=r(9673).DecoderBuffer,o=r(3349),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],s=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function h(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=h;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];h.prototype.clone=function(){var t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},h.prototype._wrap=function(){var t=this._baseState;s.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},h.prototype._init=function(t){var e=this._baseState;o(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),o.equal(e.children.length,1,"Root node can have only one child")},h.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(o(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(o(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){h.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){h.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===e.tag),e.tag=t,this._useArgs(r),this}})),h.prototype.use=function(t){o(t);var e=this._baseState;return o(null===e.use),e.use=t,this},h.prototype.optional=function(){return this._baseState.optional=!0,this},h.prototype.def=function(t){var e=this._baseState;return o(null===e.default),e.default=t,e.optional=!0,this},h.prototype.explicit=function(t){var e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.explicit=t,this},h.prototype.implicit=function(t){var e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.implicit=t,this},h.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},h.prototype.key=function(t){var e=this._baseState;return o(null===e.key),e.key=t,this},h.prototype.any=function(){return this._baseState.any=!0,this},h.prototype.choice=function(t){var e=this._baseState;return o(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},h.prototype.contains=function(t){var e=this._baseState;return o(null===e.use),e.contains=t,this},h.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var i,A=r.default,o=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){var s=null;if(null!==r.explicit?s=r.explicit:null!==r.implicit?s=r.implicit:null!==r.tag&&(s=r.tag),null!==s||r.any){if(o=this._peekTag(t,s,r.any),t.isError(o))return o}else{var h=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(h)}}if(r.obj&&o&&(i=t.enterObject()),o){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var u=t.offset;if(null===r.use&&null===r.choice){r.any&&(h=t.save());var c=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(c))return c;r.any?A=t.raw(h):t=c}if(e&&e.track&&null!==r.tag&&e.track(t.path(),u,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(A=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(A))return A;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var g=new n(A);A=this._getUse(r.contains,t._reporterState.obj)._decode(g,e)}}return r.obj&&o&&(A=t.leaveObject(i)),null===r.key||null===A&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,A),A},h.prototype._decodeGeneric=function(t,e,r){var i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},h.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),o(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},h.prototype._decodeChoice=function(t,e){var r=this._baseState,i=null,A=!1;return Object.keys(r.choice).some((function(n){var o=t.save(),a=r.choice[n];try{var s=a._decode(t,e);if(t.isError(s))return!1;i={type:n,value:s},A=!0}catch(e){return t.restore(o),!1}return!0}),this),A?i:t.error("Choice not matched")},h.prototype._createEncoderBuffer=function(t){return new A(t,this.reporter)},h.prototype._encode=function(t,e,r){var i=this._baseState;if(null===i.default||i.default!==t){var A=this._encodeValue(t,e,r);if(void 0!==A&&!this._skipDefault(A,e,r))return A}},h.prototype._encodeValue=function(t,e,r){var A=this._baseState;if(null===A.parent)return A.children[0]._encode(t,e||new i);var n=null;if(this.reporter=e,A.optional&&void 0===t){if(null===A.default)return;t=A.default}var o=null,a=!1;if(A.any)n=this._createEncoderBuffer(t);else if(A.choice)n=this._encodeChoice(t,e);else if(A.contains)o=this._getUse(A.contains,r)._encode(t,e),a=!0;else if(A.children)o=A.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var i=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var A=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),A}),this).filter((function(t){return t})),o=this._createEncoderBuffer(o);else if("seqof"===A.tag||"setof"===A.tag){if(!A.args||1!==A.args.length)return e.error("Too many args for : "+A.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var s=this.clone();s._baseState.implicit=null,o=this._createEncoderBuffer(t.map((function(r){var i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),s))}else null!==A.use?n=this._getUse(A.use,r)._encode(t,e):(o=this._encodePrimitive(A.tag,t),a=!0);if(!A.any&&null===A.choice){var h=null!==A.implicit?A.implicit:A.tag,f=null===A.implicit?"universal":"context";null===h?null===A.use&&e.error("Tag could be omitted only for .use()"):null===A.use&&(n=this._encodeComposite(h,a,f,o))}return null!==A.explicit&&(n=this._encodeComposite(A.explicit,!1,"context",n)),n},h.prototype._encodeChoice=function(t,e){var r=this._baseState,i=r.choice[t.type];return i||o(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},h.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},h.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},h.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},9220:(t,e,r)=>{var i=r(6698);function A(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function n(t,e){this.path=t,this.rethrow(e)}e.a=A,A.prototype.isError=function(t){return t instanceof n},A.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},A.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},A.prototype.enterKey=function(t){return this._reporterState.path.push(t)},A.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},A.prototype.leaveKey=function(t,e,r){var i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},A.prototype.path=function(){return this._reporterState.path.join("/")},A.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},A.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},A.prototype.error=function(t){var e,r=this._reporterState,i=t instanceof n;if(e=i?t:new n(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},A.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(n,Error),n.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,n),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},4598:(t,e,r)=>{var i=r(2153);e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=i._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=i._reverse(e.tag)},2153:(t,e,r)=>{var i=e;i._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var i=t[r];e[i]=r})),e},i.der=r(4598)},2010:(t,e,r)=>{var i=r(6698),A=r(7568),n=A.base,o=A.bignum,a=A.constants.der;function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){n.Node.call(this,"der",t)}function f(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var i=a.tagClass[r>>6],A=!(32&r);if(31&~r)r&=31;else{var n=r;for(r=0;!(128&~n);){if(n=t.readUInt8(e),t.isError(n))return n;r<<=7,r|=127&n}}return{cls:i,primitive:A,tag:r,tagStr:a.tag[r]}}function u(t,e,r){var i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(!(128&i))return i;var A=127&i;if(A>4)return t.error("length octect is too long");i=0;for(var n=0;n<A;n++){i<<=8;var o=t.readUInt8(r);if(t.isError(o))return o;i|=o}return i}t.exports=s,s.prototype.decode=function(t,e){return t instanceof n.DecoderBuffer||(t=new n.DecoderBuffer(t,e)),this.tree._decode(t,e)},i(h,n.Node),h.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;var i=t.save(),A=f(t,'Failed to peek tag: "'+e+'"');return t.isError(A)?A:(t.restore(i),A.tag===e||A.tagStr===e||A.tagStr+"of"===e||r)},h.prototype._decodeTag=function(t,e,r){var i=f(t,'Failed to decode tag of "'+e+'"');if(t.isError(i))return i;var A=u(t,i.primitive,'Failed to get length of "'+e+'"');if(t.isError(A))return A;if(!r&&i.tag!==e&&i.tagStr!==e&&i.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(i.primitive||null!==A)return t.skip(A,'Failed to match body of: "'+e+'"');var n=t.save(),o=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(o)?o:(A=t.offset-n.offset,t.restore(n),t.skip(A,'Failed to match body of: "'+e+'"'))},h.prototype._skipUntilEnd=function(t,e){for(;;){var r=f(t,e);if(t.isError(r))return r;var i,A=u(t,r.primitive,e);if(t.isError(A))return A;if(i=r.primitive||null!==A?t.skip(A):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},h.prototype._decodeList=function(t,e,r,i){for(var A=[];!t.isEmpty();){var n=this._peekTag(t,"end");if(t.isError(n))return n;var o=r.decode(t,"der",i);if(t.isError(o)&&n)break;A.push(o)}return A},h.prototype._decodeStr=function(t,e){if("bitstr"===e){var r=t.readUInt8();return t.isError(r)?r:{unused:r,data:t.raw()}}if("bmpstr"===e){var i=t.raw();if(i.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");for(var A="",n=0;n<i.length/2;n++)A+=String.fromCharCode(i.readUInt16BE(2*n));return A}if("numstr"===e){var o=t.raw().toString("ascii");return this._isNumstr(o)?o:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){var a=t.raw().toString("ascii");return this._isPrintstr(a)?a:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},h.prototype._decodeObjid=function(t,e,r){for(var i,A=[],n=0;!t.isEmpty();){var o=t.readUInt8();n<<=7,n|=127&o,128&o||(A.push(n),n=0)}128&o&&A.push(n);var a=A[0]/40|0,s=A[0]%40;if(i=r?A:[a,s].concat(A.slice(1)),e){var h=e[i.join(" ")];void 0===h&&(h=e[i.join(".")]),void 0!==h&&(i=h)}return i},h.prototype._decodeTime=function(t,e){var r=t.raw().toString();if("gentime"===e)var i=0|r.slice(0,4),A=0|r.slice(4,6),n=0|r.slice(6,8),o=0|r.slice(8,10),a=0|r.slice(10,12),s=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");i=0|r.slice(0,2),A=0|r.slice(2,4),n=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),i=i<70?2e3+i:1900+i}return Date.UTC(i,A-1,n,o,a,s,0)},h.prototype._decodeNull=function(t){return null},h.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},h.prototype._decodeInt=function(t,e){var r=t.raw(),i=new o(r);return e&&(i=e[i.toString(10)]||i),i},h.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},2853:(t,e,r)=>{var i=e;i.der=r(2010),i.pem=r(8903)},8903:(t,e,r)=>{var i=r(6698),A=r(8287).Buffer,n=r(2010);function o(t){n.call(this,t),this.enc="pem"}i(o,n),t.exports=o,o.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),i=e.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,s=-1,h=0;h<r.length;h++){var f=r[h].match(o);if(null!==f&&f[2]===i){if(-1!==a){if("END"!==f[1])break;s=h;break}if("BEGIN"!==f[1])break;a=h}}if(-1===a||-1===s)throw new Error("PEM section not found for: "+i);var u=r.slice(a+1,s).join("");u.replace(/[^a-z0-9\+\/=]+/gi,"");var c=new A(u,"base64");return n.prototype.decode.call(this,c,e)}},82:(t,e,r)=>{var i=r(6698),A=r(8287).Buffer,n=r(7568),o=n.base,a=n.constants.der;function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){o.Node.call(this,"der",t)}function f(t){return t<10?"0"+t:t}t.exports=s,s.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},i(h,o.Node),h.prototype._encodeComposite=function(t,e,r,i){var n,o=function(t,e,r,i){var A;if("seqof"===t?t="seq":"setof"===t&&(t="set"),a.tagByName.hasOwnProperty(t))A=a.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);A=t}return A>=31?i.error("Multi-octet tag encoding unsupported"):(e||(A|=32),A|=a.tagClassByName[r||"universal"]<<6)}(t,e,r,this.reporter);if(i.length<128)return(n=new A(2))[0]=o,n[1]=i.length,this._createEncoderBuffer([n,i]);for(var s=1,h=i.length;h>=256;h>>=8)s++;(n=new A(2+s))[0]=o,n[1]=128|s,h=1+s;for(var f=i.length;f>0;h--,f>>=8)n[h]=255&f;return this._createEncoderBuffer([n,i])},h.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new A(2*t.length),i=0;i<t.length;i++)r.writeUInt16BE(t.charCodeAt(i),2*i);return this._createEncoderBuffer(r)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},h.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s\.]+/g);for(var i=0;i<t.length;i++)t[i]|=0}else if(Array.isArray(t))for(t=t.slice(),i=0;i<t.length;i++)t[i]|=0;if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var n=0;for(i=0;i<t.length;i++){var o=t[i];for(n++;o>=128;o>>=7)n++}var a=new A(n),s=a.length-1;for(i=t.length-1;i>=0;i--)for(o=t[i],a[s--]=127&o;(o>>=7)>0;)a[s--]=128|127&o;return this._createEncoderBuffer(a)},h.prototype._encodeTime=function(t,e){var r,i=new Date(t);return"gentime"===e?r=[f(i.getFullYear()),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[f(i.getFullYear()%100),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!A.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new A(r)}if(A.isBuffer(t)){var i=t.length;0===t.length&&i++;var n=new A(i);return t.copy(n),0===t.length&&(n[0]=0),this._createEncoderBuffer(n)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);i=1;for(var o=t;o>=256;o>>=8)i++;for(o=(n=new Array(i)).length-1;o>=0;o--)n[o]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new A(n))},h.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},h.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},h.prototype._skipDefault=function(t,e,r){var i,A=this._baseState;if(null===A.default)return!1;var n=t.join();if(void 0===A.defaultBuffer&&(A.defaultBuffer=this._encodeValue(A.default,e,r).join()),n.length!==A.defaultBuffer.length)return!1;for(i=0;i<n.length;i++)if(n[i]!==A.defaultBuffer[i])return!1;return!0}},4669:(t,e,r)=>{var i=e;i.der=r(82),i.pem=r(735)},735:(t,e,r)=>{var i=r(6698),A=r(82);function n(t){A.call(this,t),this.enc="pem"}i(n,A),t.exports=n,n.prototype.encode=function(t,e){for(var r=A.prototype.encode.call(this,t).toString("base64"),i=["-----BEGIN "+e.label+"-----"],n=0;n<r.length;n+=64)i.push(r.slice(n,n+64));return i.push("-----END "+e.label+"-----"),i.join("\n")}},2344:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function A(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8982).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var A=0,n=Math.min(t.length,r),o=e;o<n;o++){var a=t.charCodeAt(o)-48;A*=i,A+=a>=49?a-49+10:a>=17?a-17+10:a}return A}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var A=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(A++,this.negative=1),A<t.length&&(16===e?this._parseHex(t,A,r):(this._parseBase(t,e,A),"le"===r&&this._initArray(this.toArray(),e,r)))},n.prototype._initNumber=function(t,e,r){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):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},n.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var A=0;A<this.length;A++)this.words[A]=0;var n,o,a=0;if("be"===r)for(A=t.length-1,n=0;A>=0;A-=3)o=t[A]|t[A-1]<<8|t[A-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(A=0,n=0;A<t.length;A+=3)o=t[A]|t[A+1]<<8|t[A+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var A,n=0,o=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)A=s(t,e,i)<<n,this.words[o]|=67108863&A,n>=18?(n-=18,o+=1,this.words[o]|=A>>>26):n+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)A=s(t,e,i)<<n,this.words[o]|=67108863&A,n>=18?(n-=18,o+=1,this.words[o]|=A>>>26):n+=8;this.strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,A=1;A<=67108863;A*=e)i++;i--,A=A/e|0;for(var n=t.length-r,o=n%i,a=Math.min(n,n-o)+r,s=0,f=r;f<a;f+=i)s=h(t,f,f+i,e),this.imuln(A),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var u=1;for(s=h(t,f,t.length,e),f=0;f<o;f++)u*=e;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this.strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","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"],u=[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],c=[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,97656