Files
pezkuwi-apps/modu.6db8b34b64d5366a.js
T
github-actions[bot] 0a84ef198d Updates
2026-01-22 16:38:22 +00:00

2 lines
272 KiB
JavaScript

/*! For license information please see modu.6db8b34b64d5366a.js.LICENSE.txt */
(("undefined"!=typeof self?self:this).webpackChunk_pezkuwi_apps=("undefined"!=typeof self?self:this).webpackChunk_pezkuwi_apps||[]).push([[3989],{659(t,e,r){"use strict";function n(t){if(t)throw t}r.d(e,{V:()=>n})},1048(t,e,r){"use strict";const n=r(7991),i=r(39318),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=h,e.SlowBuffer=function(t){return+t!=t&&(t=0),h.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,h.prototype),e}function h(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|m(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Z(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(t,SharedArrayBuffer)||t&&Z(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return h.from(n,e,r);const i=function(t){if(h.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return c(t),a(t<0?0:0|p(t))}function f(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,h.prototype),n}function p(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function m(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(i)return n?-1:$(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return R(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let s,o=1,a=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,h/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(s=r;s<a;s++)if(u(t,s)===u(e,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===h)return n*o}else-1!==n&&(s-=s-n),n=-1}else for(r+h>a&&(r=a-h),s=r;s>=0;s--){let r=!0;for(let n=0;n<h;n++)if(u(t,s+n)!==u(e,n)){r=!1;break}if(r)return s}return-1}function v(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const s=e.length;let o;for(n>s/2&&(n=s/2),o=0;o<n;++o){const n=parseInt(e.substr(2*o,2),16);if(X(n))return o;t[r+o]=n}return o}function M(t,e,r,n){return J($(e,t.length-r),t,r,n)}function k(t,e,r,n){return J(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return J(K(e),t,r,n)}function E(t,e,r,n){return J(function(t,e){let r,n,i;const s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function R(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let s=null,o=e>239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,a,h;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[i+1],128==(192&r)&&(h=(31&e)<<6|63&r,h>127&&(s=h));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(h=(15&e)<<12|(63&r)<<6|63&n,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(h=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));return r}(n)}e.kMaxLength=o,h.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),h.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),h.poolSize=8192,h.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(h.prototype,Uint8Array.prototype),Object.setPrototypeOf(h,Uint8Array),h.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},h.allocUnsafe=function(t){return l(t)},h.allocUnsafeSlow=function(t){return l(t)},h.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==h.prototype},h.compare=function(t,e){if(Z(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),Z(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=h.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Z(e,Uint8Array))i+e.length>n.length?(h.isBuffer(e)||(e=h.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!h.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},h.byteLength=m,h.prototype._isBuffer=!0,h.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},h.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},h.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},h.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?R(this,0,t):g.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},s&&(h.prototype[s]=h.prototype.inspect),h.prototype.compare=function(t,e,r,n,i){if(Z(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(s,o),u=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==c[t]){s=u[t],o=c[t];break}return s<o?-1:o<s?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},h.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return k(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function _(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=G[t[n]];return i}function O(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n,i){q(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function N(t,e,r,n,i){q(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function L(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,s){return e=+e,r>>>=0,s||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,s){return e=+e,r>>>=0,s||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,h.prototype),n},h.prototype.readUintLE=h.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,s=0;for(;++s<e&&(i*=256);)n+=this[t+s]*i;return n},h.prototype.readUintBE=h.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUint8=h.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readBigUInt64LE=Q(function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),h.prototype.readBigUInt64BE=Q(function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),h.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,s=0;for(;++s<e&&(i*=256);)n+=this[t+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,s=this[t+--n];for(;n>0&&(i*=256);)s+=this[t+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},h.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readBigInt64LE=Q(function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),h.prototype.readBigInt64BE=Q(function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||V(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),h.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},h.prototype.writeUint8=h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeBigUInt64LE=Q(function(t,e=0){return I(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeBigUInt64BE=Q(function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,s=1,o=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/s|0)-o&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s|0)-o&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeBigInt64LE=Q(function(t,e=0){return I(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeBigInt64BE=Q(function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},h.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const s=h.isBuffer(t)?t:h.from(t,n),o=s.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%o]}return this};const H={};function j(t,e,r){H[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function q(t,e,r,n,i,s){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=s>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new H.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||V(e,t.length-(r+1))}(n,i,s)}function z(t,e){if("number"!=typeof t)throw new H.ERR_INVALID_ARG_TYPE(e,"number",t)}function V(t,e,r){if(Math.floor(t)!==t)throw z(t,r),new H.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),j("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function $(t,e){let r;e=e||1/0;const n=t.length;let i=null;const s=[];for(let o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function K(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const G=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Y:t}function Y(){throw new Error("BigInt not supported")}},1361(t){"use strict";const e=async function(){}.constructor;t.exports=()=>e},1648(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.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=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(46982).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function h(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,i){for(var s=0,o=0,a=Math.min(t.length,r),h=e;h<a;h++){var u=t.charCodeAt(h)-48;s*=i,o=u>=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&o<i,"Invalid character"),s+=o}return s}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},s.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,s=0,o=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,a=Math.min(s,s-o)+r,h=0,c=r;c<a;c+=n)h=u(t,c,c+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var l=1;for(h=u(t,c,t.length,e),c=0;c<o;c++)l*=e;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},s.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},s.prototype._move=function(t){c(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){s.prototype.inspect=l}else s.prototype.inspect=l;function l(){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"],d=[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],p=[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 m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var c=h>>>26,l=67108863&h,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;c+=(o=(i=0|t.words[p])*(s=0|e.words[d])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,h=0|c}return 0!==h?r.words[u]=0|h:r.length--,r._strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<i|s)).toString(16);s=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==s||o!==this.length-1?f[6-h.length]+h+r:h+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=d[t],c=p[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(c).toString(t);r=(l=l.idivn(c)).isZero()?m+r:f[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,i),o},s.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|n;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===s?(r<t.length&&(t[r++]=o>>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},s.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|n;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},s.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.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 e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},s.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.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 e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},s.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var s=0,o=0;o<n.length;o++)s=(e=(0|r.words[o])-(0|n.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,s,o=t.words,a=e.words,h=r.words,u=0,c=0|o[0],l=8191&c,f=c>>>13,d=0|o[1],p=8191&d,m=d>>>13,g=0|o[2],y=8191&g,w=g>>>13,b=0|o[3],v=8191&b,M=b>>>13,k=0|o[4],S=8191&k,E=k>>>13,x=0|o[5],R=8191&x,A=x>>>13,_=0|o[6],B=8191&_,T=_>>>13,O=0|o[7],C=8191&O,P=O>>>13,I=0|o[8],N=8191&I,L=I>>>13,D=0|o[9],U=8191&D,H=D>>>13,j=0|a[0],F=8191&j,q=j>>>13,z=0|a[1],V=8191&z,W=z>>>13,$=0|a[2],K=8191&$,J=$>>>13,Z=0|a[3],X=8191&Z,G=Z>>>13,Q=0|a[4],Y=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,q))+Math.imul(f,F)|0))<<13)|0;u=((s=Math.imul(f,q))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(m,F)|0,s=Math.imul(m,q);var yt=(u+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,W)|0)+Math.imul(f,V)|0))<<13)|0;u=((s=s+Math.imul(f,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,q))+Math.imul(w,F)|0,s=Math.imul(w,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,W)|0;var wt=(u+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((s=s+Math.imul(f,J)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(v,F),i=(i=Math.imul(v,q))+Math.imul(M,F)|0,s=Math.imul(M,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(w,V)|0,s=s+Math.imul(w,W)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,J)|0;var bt=(u+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(f,X)|0))<<13)|0;u=((s=s+Math.imul(f,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,q))+Math.imul(E,F)|0,s=Math.imul(E,q),n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(M,V)|0,s=s+Math.imul(M,W)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(w,K)|0,s=s+Math.imul(w,J)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,X)|0,s=s+Math.imul(m,G)|0;var vt=(u+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Y)|0))<<13)|0;u=((s=s+Math.imul(f,tt)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,q))+Math.imul(A,F)|0,s=Math.imul(A,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(E,V)|0,s=s+Math.imul(E,W)|0,n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,J)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(w,X)|0,s=s+Math.imul(w,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,tt)|0;var Mt=(u+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;u=((s=s+Math.imul(f,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,q))+Math.imul(T,F)|0,s=Math.imul(T,q),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(A,V)|0,s=s+Math.imul(A,W)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,J)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,G)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,s=s+Math.imul(m,nt)|0;var kt=(u+(n=n+Math.imul(l,st)|0)|0)+((8191&(i=(i=i+Math.imul(l,ot)|0)+Math.imul(f,st)|0))<<13)|0;u=((s=s+Math.imul(f,ot)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,q))+Math.imul(P,F)|0,s=Math.imul(P,q),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,W)|0,n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(A,K)|0,s=s+Math.imul(A,J)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,G)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(M,Y)|0,s=s+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(w,rt)|0,s=s+Math.imul(w,nt)|0,n=n+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var St=(u+(n=n+Math.imul(l,ht)|0)|0)+((8191&(i=(i=i+Math.imul(l,ut)|0)+Math.imul(f,ht)|0))<<13)|0;u=((s=s+Math.imul(f,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,q))+Math.imul(L,F)|0,s=Math.imul(L,q),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,W)|0,n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(T,K)|0,s=s+Math.imul(T,J)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(A,X)|0,s=s+Math.imul(A,G)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(M,rt)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(y,st)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(w,st)|0,s=s+Math.imul(w,ot)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var Et=(u+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;u=((s=s+Math.imul(f,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,q))+Math.imul(H,F)|0,s=Math.imul(H,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,s=s+Math.imul(L,W)|0,n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,J)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,G)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(E,rt)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(v,st)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,ot)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ut)|0)+Math.imul(w,ht)|0,s=s+Math.imul(w,ut)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,s=s+Math.imul(m,ft)|0;var xt=(u+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;u=((s=s+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(H,V)|0,s=Math.imul(H,W),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(L,K)|0,s=s+Math.imul(L,J)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,X)|0,s=s+Math.imul(P,G)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,nt)|0,n=n+Math.imul(S,st)|0,i=(i=i+Math.imul(S,ot)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,ot)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ut)|0)+Math.imul(M,ht)|0,s=s+Math.imul(M,ut)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(w,lt)|0,s=s+Math.imul(w,ft)|0;var Rt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,J))+Math.imul(H,K)|0,s=Math.imul(H,J),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(L,X)|0,s=s+Math.imul(L,G)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,nt)|0,n=n+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(E,ht)|0,s=s+Math.imul(E,ut)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,ft)|0;var At=(u+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(w,pt)|0))<<13)|0;u=((s=s+Math.imul(w,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,G))+Math.imul(H,X)|0,s=Math.imul(H,G),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,Y)|0,s=s+Math.imul(L,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(P,rt)|0,s=s+Math.imul(P,nt)|0,n=n+Math.imul(B,st)|0,i=(i=i+Math.imul(B,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(A,ht)|0,s=s+Math.imul(A,ut)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,ft)|0;var _t=(u+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((s=s+Math.imul(M,mt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,tt))+Math.imul(H,Y)|0,s=Math.imul(H,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(L,rt)|0,s=s+Math.imul(L,nt)|0,n=n+Math.imul(C,st)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(A,lt)|0,s=s+Math.imul(A,ft)|0;var Bt=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((s=s+Math.imul(E,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(H,rt)|0,s=Math.imul(H,nt),n=n+Math.imul(N,st)|0,i=(i=i+Math.imul(N,ot)|0)+Math.imul(L,st)|0,s=s+Math.imul(L,ot)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(T,lt)|0,s=s+Math.imul(T,ft)|0;var Tt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((s=s+Math.imul(A,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,st),i=(i=Math.imul(U,ot))+Math.imul(H,st)|0,s=Math.imul(H,ot),n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,ut)|0)+Math.imul(L,ht)|0,s=s+Math.imul(L,ut)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(P,lt)|0,s=s+Math.imul(P,ft)|0;var Ot=(u+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ut))+Math.imul(H,ht)|0,s=Math.imul(H,ut),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(L,lt)|0,s=s+Math.imul(L,ft)|0;var Ct=(u+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(H,lt)|0,s=Math.imul(H,ft);var Pt=(u+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((s=s+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var It=(u+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(H,pt)|0))<<13)|0;return u=((s=Math.imul(H,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,h[0]=gt,h[1]=yt,h[2]=wt,h[3]=bt,h[4]=vt,h[5]=Mt,h[6]=kt,h[7]=St,h[8]=Et,h[9]=xt,h[10]=Rt,h[11]=At,h[12]=_t,h[13]=Bt,h[14]=Tt,h[15]=Ot,h[16]=Ct,h[17]=Pt,h[18]=It,0!==u&&(h[19]=u,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var a=67108863&n,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var c=s-u,l=(0|t.words[c])*(0|e.words[u]),f=67108863&l;a=67108863&(f=f+a|0),i+=(o=(o=o+(l/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r._strip()}function w(t,e,r){return y(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(g=m),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):w(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},b.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var l=h,f=u,d=0;d<o;d++){var p=r[c+d],m=n[c+d],g=r[c+d+o],y=n[c+d+o],w=l*g-f*y;y=l*y+f*g,g=w,r[c+d]=p+g,n[c+d]=m+y,r[c+d+o]=p-g,n[c+d+o]=m-y,d!==a&&(w=h*l-u*f,f=h*f+u*l,l=w)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n(!(-8192&s))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=new Array(n),a=new Array(n),h=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,s,a,h,n,i),this.transform(u,s,c,l,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-h[d]*l[d];h[d]=a[d]*l[d]+h[d]*c[d],a[d]=p}return this.conjugate(a,h,n),this.transform(a,h,f,s,n,i),this.conjugate(f,s,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),w(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var s=(0|this.words[i])*t,o=(67108863&s)+(67108863&r);r>>=26,r+=s/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),this.length=0===t?1:this.length,e?this.ineg():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 e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<r;this.words[e]=h|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=r;if(i-=o,i=Math.max(0,i),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var l=0|this.words[u];this.words[u]=c<<26-s|l>>>s,c=l&a}return h&&0!==c&&(h.words[h.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var h=(0|t.words[i])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,h=n.length-i.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,h);0===c.negative&&(n=c,a&&(a.words[h]=1));for(var l=h-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,o,a},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 e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,s=this.length-1;s>=0;s--)i=(r*i+(0|this.words[s]))%t;return e?-i:i},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*r;this.words[i]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(l)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(c),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(h)):(r.isub(e),a.isub(i),h.isub(o))}return{a,b:h,gcd:r.iushln(u)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new s(1),a=new s(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0===(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(i=0===e.cmpn(1)?o:a).cmpn(0)<0&&i.iadd(t),i},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},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-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},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 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new R(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){R.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)}M.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(k,M),k.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&r,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,t.words[i-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},k.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,M),i(E,M),i(x,M),x.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new k;else if("p224"===t)e=new S;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return v[t]=e,e},R.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},R.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},R.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},R.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},R.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},R.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},R.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},R.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},R.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},R.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},R.prototype.isqr=function(t){return this.imul(t,t.clone())},R.prototype.sqr=function(t){return this.mul(t,t)},R.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(h);)c.redIAdd(h);for(var l=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(l,new s(1).iushln(p-g-1));f=f.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return f},R.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},R.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=h-1;c>=0;c--){var l=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}h=26}return i},R.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},R.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new A(t)},i(A,R),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},2474(t,e,r){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}r.d(e,{A:()=>n})},6460(t,e,r){"use strict";r.d(e,{A:()=>i});var n=r(24586);function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?Object(arguments[e]):{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),i.forEach(function(e){(0,n.A)(t,e,r[e])})}return t}},7991(t,e){"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],h=s[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,h)),c=0,l=h>0?o-4:o;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===h&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===h&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s=[],o=16383,a=0,h=n-i;a<h;a+=o)s.push(u(t,a,a+o>h?h:a+o));return 1===i?(e=t[n-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function u(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),i.push(h(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9688(t,e,r){"use strict";function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)}r.d(e,{A:()=>i})},10638(t,e){"use strict";e.__esModule=!0,e.default=function(t,e){if(t&&e){var r=Array.isArray(e)?e:e.split(",");if(0===r.length)return!0;var n=t.name||"",i=(t.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return r.some(function(t){var e=t.trim().toLowerCase();return"."===e.charAt(0)?n.toLowerCase().endsWith(e):e.endsWith("/*")?s===e.replace(/\/.*$/,""):i===e})}return!0}},11757(t,e,r){"use strict";r.d(e,{$h:()=>sn,cT:()=>G});var n={};r.r(n),r.d(n,{chain_getBlock:()=>Te,chain_getBlockHash:()=>_e,chain_getFinalizedHead:()=>Oe,chain_getHead:()=>Ne,chain_getHeader:()=>Be,chain_subscribeFinalizedHeads:()=>Pe,chain_subscribeNewHead:()=>Ce,chain_subscribeNewHeads:()=>Le,chain_unsubscribeFinalizedHeads:()=>Ue,chain_unsubscribeNewHead:()=>Ie,chain_unsubscribeNewHeads:()=>De});var i={};r.r(i),r.d(i,{archive_unstable_body:()=>He,archive_unstable_call:()=>je,archive_unstable_hashByHeight:()=>Fe});var s={};r.r(s),r.d(s,{archive_v1_body:()=>We,archive_v1_call:()=>$e,archive_v1_finalizedHeight:()=>Ke,archive_v1_genesisHash:()=>Je,archive_v1_hashByHeight:()=>Ze,archive_v1_header:()=>Xe,archive_v1_stopStorage:()=>Ye,archive_v1_storage:()=>Qe});var o={};r.r(o),r.d(o,{chainHead_v1_body:()=>cr,chainHead_v1_call:()=>ar,chainHead_v1_continue:()=>lr,chainHead_v1_follow:()=>rr,chainHead_v1_header:()=>ir,chainHead_v1_stopOperation:()=>fr,chainHead_v1_storage:()=>hr,chainHead_v1_unfollow:()=>nr,chainHead_v1_unpin:()=>dr});var a={};r.r(a),r.d(a,{chainSpec_v1_chainName:()=>pr,chainSpec_v1_genesisHash:()=>mr,chainSpec_v1_properties:()=>gr});var h={};r.r(h),r.d(h,{transaction_v1_broadcast:()=>wr,transaction_v1_stop:()=>br});var u={};r.r(u),r.d(u,{author_pendingExtrinsics:()=>xr,author_submitAndWatchExtrinsic:()=>Sr,author_submitExtrinsic:()=>kr,author_unwatchExtrinsic:()=>Er});var c={};r.r(c),r.d(c,{payment_queryFeeDetails:()=>Rr,payment_queryInfo:()=>Ar});var l={};r.r(l),r.d(l,{childstate_getKeysPaged:()=>jr,childstate_getStorage:()=>Hr,state_call:()=>Ir,state_getKeysPaged:()=>Cr,state_getMetadata:()=>Tr,state_getRuntimeVersion:()=>Br,state_getStorage:()=>Or,state_getStorageAt:()=>Fr,state_queryStorageAt:()=>Pr,state_subscribeRuntimeVersion:()=>Nr,state_subscribeStorage:()=>Dr,state_unsubscribeRuntimeVersion:()=>Lr,state_unsubscribeStorage:()=>Ur});var f={};r.r(f),r.d(f,{system_accountNextIndex:()=>Qr,system_chain:()=>Wr,system_chainType:()=>Zr,system_dryRun:()=>Gr,system_health:()=>Xr,system_localListenAddresses:()=>Vr,system_localPeerId:()=>qr,system_name:()=>Kr,system_nodeRoles:()=>zr,system_properties:()=>$r,system_version:()=>Jr});var d=r(4235),p=r(45250),m=r(44869),g=r(40160),y=r(99128),w=r(20828),b=r(89640),v=r(93658),M=r(83461),k=r(61284),S=r(47695),E=r(46713),x=r(68580),R=r(39907);const A=x.Ik({DISABLE_AUTO_HRMP:x.k5(["true","false"]).default("false").transform(t=>"true"===t),PORT:x.Yj().optional(),DISABLE_PLUGINS:x.k5(["true","false"]).default("false").transform(t=>"true"===t),HTTP_PROXY:x.Yj().optional(),http_proxy:x.Yj().optional(),HTTPS_PROXY:x.Yj().optional(),https_proxy:x.Yj().optional(),LOG_LEVEL:x.k5(["fatal","error","warn","info","debug","trace"]).default("info"),VERBOSE_LOG:x.k5(["true","false"]).default("false").transform(t=>"true"===t),LOG_COMPACT:x.k5(["true","false"]).default("false").transform(t=>"true"===t)}).parse("object"==typeof R?{NODE_ENV:"production",WS_URL:void 0}:{}),_=(0,E.pino)({level:A.LOG_LEVEL,transport:{target:"pino-pretty",options:{ignore:"pid,hostname",hideObject:A.LOG_COMPACT}}}).child({app:"chopsticks"}),B=(t=0)=>e=>{const r=A.VERBOSE_LOG;if(null==e)return e;if(t>(r?10:5))return"( Too Deep )";switch(typeof e){case"string":{const t=r?10240:66;return e.length>t?`${e.slice(0,34)}${e.slice(-32)}`:e}case"object":return Array.isArray(e)?e.map(B(t+1)):Object.fromEntries(Object.entries(e.toJSON?e.toJSON():e).map(([e,r])=>[e,B(t+1)(r)]));default:return e}},T=t=>B(0)(t);r(39907);const O=_.child({name:"executor"});let C;const P=async()=>C||(C=r.e(9563).then(r.bind(r,99563)).then(({startWorker:t})=>t()),C),I=p.memoize(async t=>(await P()).remote.getRuntimeVersion(t).then(t=>(t.specName=(0,b.I)(t.specName),t.implName=(0,b.I)(t.implName),t))),N=async(t,e)=>{const r=await P(),[n,i]=await r.remote.createProof(t,e);return{trieRootHash:n,nodes:i}};let L=0;const D=async(t,e=U,r=!1)=>{const n=L++,i={...t,id:n,storageProofSize:t.storageProofSize??0,mockSignatureHost:r?2:t.mockSignatureHost?1:0},s=await P();O.trace(T(i),`runTask #${n}`);const o=await s.remote.runTask(i,S.BX(e));return"Call"in o?O.trace(T(o.Call),`taskResponse #${n}`):O.trace({response:o},`taskResponse ${n}`),o},U={getStorage:async t=>{throw new Error("Method not implemented")},getNextKey:async(t,e)=>{throw new Error("Method not implemented")},offchainGetStorage:async t=>{throw new Error("Method not implemented")},offchainTimestamp:async()=>{throw new Error("Method not implemented")},offchainRandomSeed:async()=>{throw new Error("Method not implemented")},offchainSubmitTransaction:async t=>{throw new Error("Method not implemented")}},H=p.memoize(async t=>{const e=await D({wasm:t,calls:[["AuraApi_slot_duration",[]]],mockSignatureHost:!1,allowUnresolvedImports:!1,runtimeLogLevel:0});if("Error"in e)throw new Error(e.Error);return(0,v.i)((0,M.V)(e.Call.result).subarray(0,8)).toNumber()});var j=r(30620),F=r(53690),q=r(96330);[{name:"code",key:":code",decodeValue:(t,e)=>`<:code blake2_256 ${(0,q.X)(e,256)} (${e.length/2-1} bytes)>`},{name:"heapPages",key:":heappages",type:"u64"},{name:"extrinsicIndex",key:":extrinsic_index",type:"u32"},{name:"intrablockEntropy",key:":intrablock_entropy",type:"[u8; 32]"},{name:"transactionLevel",key:":transaction_level:",type:"u32"},{name:"grandpaAuthorities",key:":grandpa_authorities",type:"(u8, AuthorityList)"},{name:"relayDispatchQueueRemainingCapacity",prefix:":relay_dispatch_queue_remaining_capacity",decodeKey:(t,e)=>[t.createType("u32",(0,M.V)(e)).toJSON()],type:"(u32, u32)"},{name:"relay_dispatch_queue_size",prefixHex:"0xf5207f03cfdce586301014700e2c2593fad157e461d71fd4c1f936839a5f1f3e",decodeKey:(t,e)=>{const r=`0x${e.slice(-8)}`;return[t.createType("u32",(0,M.V)(r)).toJSON()]},type:"(u32, u32)"}].map(t=>{const e=t.prefixHex??(0,F.i)(t.prefix||t.key);return{name:t.name,prefix:e,decodeKey:t.decodeKey||((t,e)=>[e]),decodeValue:t.decodeValue||(r=t.type,(t,e)=>t.createType(r,(0,M.V)(e)).toJSON())};var r}),_.child({name:"decoder"}),new j.q({max:20});var z=r(55539),V=r(91234);class W{prefixLength;constructor(t){this.prefixLength=t}ranges=[];feed(t){const e=t.filter(t=>t.length>=this.prefixLength);if(0===e.length)return;const r=e[0].slice(this.prefixLength),n=e[e.length-1].slice(this.prefixLength),i=p.groupBy(e,t=>t.slice(0,this.prefixLength));for(const[t,e]of Object.entries(i)){const i=this.ranges.filter(e=>e.prefix===t);if(0===i.length){this.ranges.push({prefix:t,keys:e.map(t=>t.slice(this.prefixLength))});continue}let s=!1;for(const t of i){const i=p.sortedIndex(t.keys,r);if(i>=0&&t.keys[i]===r){t.keys.splice(i,e.length,...e.map(t=>t.slice(this.prefixLength))),s=!0;break}const o=p.sortedIndex(t.keys,n);if(o>=0&&t.keys[o]===n){t.keys.splice(0,o+1,...e.map(t=>t.slice(this.prefixLength))),s=!0;break}}s||this.ranges.push({prefix:t,keys:e.map(t=>t.slice(this.prefixLength))})}}async next(t){if(t.length<this.prefixLength)return;const e=t.slice(0,this.prefixLength),r=t.slice(this.prefixLength);for(const t of this.ranges.filter(t=>t.prefix===e)){if(0===r.length){if(""!==t.keys[0])continue;return[e,t.keys[1]].join("")}const n=p.sortedIndex(t.keys,r);if(t.keys[n]!==r)continue;const i=t.keys[n+1];if(i)return[e,i].join("")}}}const $=_.child({name:"layer"}),K=1e3;var J=function(t){return t.Deleted="Deleted",t.DeletedPrefix="DeletedPrefix",t}({});class Z{#t;#e;#r;#n=new W(rt);#i=new W(et);constructor(t,e,r){this.#t=t,this.#e=e,this.#r=r}deleted(t){return!1}async get(t,e){if(this.#r){const e=await this.#r.queryStorage(this.#e,t);if(e)return e.value??void 0}$.trace({at:this.#e,key:t},"RemoteStorageLayer get");const r=await this.#t.getStorage(t,this.#e);return this.#r?.saveStorage(this.#e,t,r),r??void 0}async getMany(t,e){const r=[];let n=t.map((t,e)=>({key:t,idx:e}));if(this.#r){const t=await Promise.all(n.map(({key:t})=>this.#r.queryStorage(this.#e,t))),e=n;n=[],t.forEach((t,i)=>{t?r[i]=t.value??void 0:n.push({key:e[i].key,idx:i})})}if(n.length){$.trace({at:this.#e,keys:t},"RemoteStorageLayer getMany");const e=await this.#t.getStorageBatch("0x",n.map(({key:t})=>t),this.#e);e.forEach(([,t],e)=>{r[n[e].idx]=t??void 0}),this.#r?.saveStorageBatch?this.#r?.saveStorageBatch(e.map(([t,e])=>({key:t,value:e,blockHash:this.#e}))):this.#r&&e.forEach(([t,e])=>this.#r?.saveStorage(this.#e,t,e))}return r}async findNextKey(t,e,r){return(await this.getKeysPaged(t,1,e))[0]}async getKeysPaged(t,e,r){if(e>K)throw new Error("pageSize must be less or equal to 1000");$.trace({at:this.#e,prefix:t,pageSize:e,startKey:r},"RemoteStorageLayer getKeysPaged");const n=it(t),i=n?et:rt;if(t===r||t.length<i||r.length<i)return this.#t.getKeysPaged(t,e,r,this.#e);let s=!1;const o=[];for(;o.length<e;){const e=n?await this.#i.next(r):await this.#n.next(r);if(e){o.push(e),r=e;continue}if(s)break;const i=await this.#t.getKeysPaged(t,K,r,this.#e);if(s=i.length<K,i.length>0&&(n?this.#i.feed([r,...i]):this.#n.feed([r,...i])),0===i.length)break;if(this.#r){const e=[];for(const t of i)await this.#r.queryStorage(this.#e,t)||e.push(t);e.length>0&&this.#t.getStorageBatch(t,e,this.#e).then(t=>{for(const[e,r]of t)this.#r?.saveStorage(this.#e,e,r)})}}return o}}class X{#s=new Map;#o=[];#a=[];#h;constructor(t){this.#h=t}#u(t){const e=p.sortedIndex(this.#o,t);t!==this.#o[e]&&this.#o.splice(e,0,t)}#c(t){const e=p.sortedIndex(this.#o,t);t===this.#o[e]&&this.#o.splice(e,1)}deleted(t){return this.#s.has(t)?"Deleted"===this.#s.get(t):!!this.#a.some(e=>t.startsWith(e))||!!this.#h&&this.#h.deleted(t)}async get(t,e){if(this.#s.has(t))return this.#s.get(t);if(this.#a.some(e=>t.startsWith(e)))return"Deleted";if(this.#h){const r=this.#h.get(t,!1);return e&&this.#s.set(t,r),r}}async getMany(t,e){const r=[],n=[],i=t.map(async(t,e)=>{this.#s.has(t)?r[e]=await this.#s.get(t):this.#a.some(e=>t.startsWith(e))?r[e]="Deleted":n.push({key:t,idx:e})});return n.length&&this.#h&&(await this.#h.getMany(n.map(t=>t.key),!1)).forEach((t,i)=>{e&&this.#s.set(n[i].key,t),r[n[i].idx]=t}),await Promise.all(i),r}set(t,e){switch(e){case"Deleted":this.#s.set(t,"Deleted"),this.#c(t);break;case"DeletedPrefix":this.#a.push(t);for(const e of this.#o)e.startsWith(t)&&(this.#s.set(e,"Deleted"),this.#c(e));break;case void 0:this.#s.delete(t),this.#c(t);break;default:this.#s.set(t,e),this.#u(t)}}setAll(t){Array.isArray(t)||(t=Object.entries(t));for(const[e,r]of t)this.set(e,r||"Deleted")}async findNextKey(t,e,r){const n=this.#o.find(r=>r.startsWith(t)&&r>e);if(r?n&&n<r&&(r=n):r=n,this.#h&&!this.#a.some(e=>e===t)){const i=await this.#h.findNextKey(t,e,r);if(i){if(!n)return i;if(i<n)return i}}return r}async getKeysPaged(t,e,r){r&&"0x"!==r||(r=t);const n=[];for(;n.length<e;){const e=await this.findNextKey(t,r,void 0);if(!e)break;r=e,this.deleted(e)||n.push(e)}return n}async mergeInto(t){for(const[e,r]of this.#s){const n=await r;t[e]="Deleted"===n?null:n}}}const G=async(t,e,r)=>{const n=await t.getBlock(r);if(!n)throw Error(`Cannot find block ${r||"latest"}`);let i;return i=Array.isArray(e)?e:function(t,e){const r=[];for(const n in e){const i=e[n],s=t.query[(0,V.WH)(n)];if(!s)throw Error(`Cannot find pallet ${n}`);for(const e in i){const o=i[e];if("$removePrefix"===e){for(const t of o){const e=s[(0,V.WH)(t)];if(!e)throw Error(`Cannot find storage ${t} in pallet ${n}`);const i=e.keyPrefix();r.push([(0,m.X)(i),J.DeletedPrefix])}continue}const a=s[(0,V.WH)(e)];if(!a)throw Error(`Cannot find storage ${e} in pallet ${n}`);if(a.meta.type.isPlain){const e=new z.Z(t.registry,[a]);"string"==typeof o&&o.startsWith("0x")?r.push([e.toHex(),o]):r.push([e.toHex(),o?(0,m.X)(t.registry.createType(e.outputType,o).toU8a()):null])}else for(const[e,n]of o){const i=new z.Z(t.registry,[a,e]);"string"==typeof n&&n.startsWith("0x")?r.push([i.toHex(),n]):r.push([i.toHex(),n?(0,m.X)(t.registry.createType(i.outputType,n).toU8a()):null])}}}return r}(await n.meta,e),n.pushStorageLayer().setAll(i),n.hash},Q=t=>(0,m.X)((0,g.a)(t)[1]);function Y(){const t={};return t.promise=new Promise((e,r)=>{t.resolve=e,t.reject=r}),t}const tt="0x3a6368696c645f73746f726167653a64656661756c743a",et=112,rt=66,nt=(t,e)=>t+(0,y.a)(e),it=t=>t.startsWith(tt),st=t=>{if(!t.startsWith(tt))return[];if(t.length<et)return[];const e=t.slice(0,et),r=t.slice(et);return[e,(0,w.d)(r)]},ot=t=>{const[e,r]=st(t);return e?r:t},at=async t=>{const e=await ht(t),r=await ut(t);return Math.floor(Number(e/BigInt(r)))},ht=async t=>{const e=await t.meta,r=await t.read("u64",e.query.timestamp.now);return r?.toBigInt()??BigInt(Date.now())},ut=async t=>{const e=await t.meta;let r;return r??=e.consts.babe?.expectedBlockTime?.toNumber(),r??=e.consts.asyncBacking?.expectedBlockTime?.toNumber(),r||H(await t.wasm).catch(()=>12e3)};class ct{#l;#f;#d;#p;signedExtensions;#m={};constructor(t,e){this.#l=t,this.signedExtensions=e||{}}async disconnect(){return this.#l.disconnect()}get isReady(){return this.#f||(this.#l.isReady?this.#f=this.#l.isReady:this.#f=new Promise(t=>{this.#l.hasSubscriptions?(this.#l.on("connected",t),this.#l.connect()):t()})),this.#f}get chain(){return this.#d||(this.#d=this.getSystemChain()),this.#d}get chainProperties(){return this.#p||(this.#p=this.getSystemProperties()),this.#p}onFetching(t){this.#m.fetching=t}async send(t,e,r){return this.#m?.fetching?.(),this.#l.send(t,e,r)}async getSystemName(){return this.send("system_name",[])}async getSystemProperties(){return this.send("system_properties",[])}async getSystemChain(){return this.send("system_chain",[])}async getBlockHash(t){return this.send("chain_getBlockHash",Number.isInteger(t)?[t]:[],!!t)}async getHeader(t){return this.send("chain_getHeader",t?[t]:[],!!t)}async getFinalizedHead(){return this.send("chain_getFinalizedHead",[])}async getBlock(t){return this.send("chain_getBlock",t?[t]:[],!!t)}async getStorage(t,e){const[r,n]=st(t);if(r){const t=[r,n];return e&&t.push(e),this.send("childstate_getStorage",t,!!e)}const i=[t];return e&&i.push(e),this.send("state_getStorage",i,!!e)}async getKeysPaged(t,e,r,n){const[i,s]=st(t);if(i){const t=[i,s,e,ot(r)];return n&&t.push(n),this.#l.send("childstate_getKeysPaged",t,!!n).then(t=>t.map(t=>nt(i,t)))}const o=[t,e,r];return n&&o.push(n),this.send("state_getKeysPaged",o,!!n)}async getStorageBatch(t,e,r){const n=async n=>{if(n instanceof d.A&&(-32008===n.code||"Response is too big"===n.message)){if(e.length<2)throw n;const i=Math.floor(e.length/2),s=[e.slice(0,i),e.slice(i)];return(await Promise.all(s.map(e=>this.getStorageBatch(t,e,r)))).flat()}throw n},[i]=st(t);if(i){const t=[i,e.map(t=>ot(t))];return r&&t.push(r),this.#l.send("childstate_getStorageEntries",t,!!r).then(t=>p.zip(e,t)).catch(n)}const s=[e];return r&&s.push(r),this.#l.send("state_queryStorageAt",s,!!r).then(t=>t[0]?.changes||[]).catch(n)}async subscribeRemoteNewHeads(t){if(!this.#l.hasSubscriptions)throw new Error("subscribeRemoteNewHeads only works with subscriptions");return this.#l.subscribe("chain_newHead","chain_subscribeNewHeads",[],t)}async subscribeRemoteFinalizedHeads(t){if(!this.#l.hasSubscriptions)throw new Error("subscribeRemoteFinalizedHeads only works with subscriptions");return this.#l.subscribe("chain_finalizedHead","chain_subscribeFinalizedHeads",[],t)}}var lt=r(57584),ft=r(36423);class dt{number;hash;#d;#g;#y;#w;#b;#v;#M;#k;#S;#E;#x;constructor(t,e,r,n,i){this.number=e,this.hash=r,this.#d=t,this.#y=n?new WeakRef(n):void 0,this.#g=i?.header,this.#w=i?.extrinsics,this.#E=i?.storage??new Z(t.api,r,t.db),this.#x=[],this.#v=n?.runtimeVersion,this.#M=n?.metadata,this.#k=n?.registry,this.#S=n?.meta;const s=i?.storageDiff;s&&(s[(0,F.i)(":code")]&&(this.#v=void 0,this.#M=void 0,this.#k=void 0,this.#S=void 0),this.pushStorageLayer().setAll(s))}get chain(){return this.#d}get header(){return this.#g||(this.#g=Promise.all([this.registry,this.#d.api.getHeader(this.hash)]).then(([t,e])=>t.createType("Header",e))),this.#g}get extrinsics(){return this.#w||(this.#w=this.#d.api.getBlock(this.hash).then(t=>{if(!t)throw new Error(`Block ${this.hash} not found`);return t.block.extrinsics})),this.#w}get parentBlock(){if(0===this.number)return Promise.resolve(void 0);const t=async t=>{const e=await t,r=await this.#d.getBlock(e.parentHash.toHex());return r&&(this.#y=new WeakRef(r)),r};if(this.#y instanceof WeakRef){const e=this.#y.deref();if(e)return Promise.resolve(e);this.#y=t(this.header)}else this.#y||(this.#y=t(this.header));return this.#y}get storage(){return this.#x[this.#x.length-1]??this.#E}async get(t){const e=await this.storage.get(t,!0);if(e!==J.Deleted)return e}async getMany(t){return(await this.storage.getMany(t,!0)).map(t=>{if(t!==J.Deleted)return t})}async read(t,e,...r){const n=Q(e(...r)),i=await this.get(n);if(i)return(await this.registry).createType(t,(0,M.V)(i))}async getKeysPaged(t){const e=t.prefix??"0x",r=t.startKey??"0x",n=t.pageSize;return this.storage.getKeysPaged(e,n,r)}pushStorageLayer(){const t=new X(this.storage);return this.#x.push(t),t}popStorageLayer(){this.#x.pop()}async storageDiff(){const t={};for(const e of this.#x)await e.mergeInto(t);return t}get wasm(){return this.#b||(this.#b=(async()=>{const t=(0,F.i)(":code"),e=await this.get(t);if(!e)throw new Error("No wasm found");return e})()),this.#b}setWasm(t){const e=(0,F.i)(":code");this.pushStorageLayer().set(e,t),this.#b=Promise.resolve(t),this.#v=void 0,this.#k=void 0,this.#S=void 0,this.#M=void 0}get registry(){return this.#k||(this.#k=Promise.all([this.metadata,this.runtimeVersion]).then(([t,e])=>this.#d.buildRegistry(t,e))),this.#k}get runtimeVersion(){return this.#v||(this.#v=this.wasm.then(I)),this.#v}get metadata(){return this.#M||(this.#M=this.call("Metadata_metadata",[]).then(t=>Q((0,M.V)(t.result)))),this.#M}get meta(){return this.#S||(this.#S=Promise.all([this.registry,this.metadata]).then(([t,e])=>{const r=new lt.O(t,e);return(0,ft.K8)(t,r)})),this.#S}async call(t,e,r=!1){const n=await this.wasm,i=await D({wasm:n,calls:[[t,e]],mockSignatureHost:this.#d.mockSignatureHost,allowUnresolvedImports:this.#d.allowUnresolvedImports,runtimeLogLevel:this.#d.runtimeLogLevel},(s=this,{getStorage:async t=>s.get(t),getNextKey:async(t,e)=>{const[r]=await s.getKeysPaged({prefix:2===t.length?e.slice(0,rt):t,pageSize:1,startKey:e});return r&&ot(r)},offchainGetStorage:async t=>{if(!s.chain.offchainWorker)throw new Error("offchain worker not found");return s.chain.offchainWorker.get(t)},offchainTimestamp:async()=>Date.now(),offchainRandomSeed:async()=>(0,k.t)(32),offchainSubmitTransaction:async t=>{if(!s.chain.offchainWorker)throw new Error("offchain worker not found");try{const e=await s.chain.offchainWorker.pushExtrinsic(s,t);return O.trace({hash:e},"offchainSubmitTransaction"),!0}catch(t){return O.trace({error:t},"offchainSubmitTransaction"),!1}}}),r);var s;if("Call"in i){if(this.chain.offchainWorker)for(const[t,e]of i.Call.offchainStorageDiff)this.chain.offchainWorker.set(t,e);return i.Call}if(i.Error)throw Error(i.Error);throw Error("Unexpected response")}}var pt=r(48012),mt=r(43075);const gt=_.child({name:"block-builder"}),yt=async(t,e)=>{const r=await t.meta,n=await t.header;let i=t.number?n.digest.logs.toArray():await(async t=>{const e=await t.meta,r=await at(t);if(e.consts.babe){const t=e.registry.createType("Slot",r+1),n=e.registry.createType("ConsensusEngineId","BABE"),i=e.registry.createType("RawBabePreDigest",{SecondaryVRF:{authorityIndex:514,slotNumber:t,vrfOutput:"0x44cadd14aaefbda13ac8d85e1a6d58be082e7e2f56a4f95a3c612c784aaa4063",vrfProof:"0xf5517bf67d93ce633cde2fde7fbcf8ddca80017aaf8cd48436514687c662f60eda0ffa2c4781906416f4e71a196c9783c60c1b83d54c3a29365d03706714570b"}});return[e.registry.createType("DigestItem",{PreRuntime:[n,(0,pt.h)(i.toU8a())]})]}const n=e.registry.createType("Slot",r+1),i=e.registry.createType("ConsensusEngineId","aura");return[e.registry.createType("DigestItem",{PreRuntime:[i,(0,pt.h)(n.toU8a())]})]})(t);return i=await Promise.all(i.map(async e=>{if(e.isPreRuntime){const[i,s]=e.asPreRuntime;if(i.isAura){const e=await at(t),n=(0,pt.h)(r.registry.createType("Slot",e+1).toU8a());return r.registry.createType("DigestItem",{PreRuntime:[i,n]})}if(i.isBabe){const e=await at(t),n=r.registry.createType("RawBabePreDigest",s),o=(0,pt.h)(r.registry.createType("RawBabePreDigest",((t,e)=>t.isPrimary?{primary:{...t.asPrimary.toJSON(),slotNumber:e}}:t.isSecondaryPlain?{secondaryPlain:{...t.asSecondaryPlain.toJSON(),slotNumber:e}}:t.isSecondaryVRF?{secondaryVRF:{...t.asSecondaryVRF.toJSON(),slotNumber:e}}:t.toJSON())(n,e+1)).toU8a());return r.registry.createType("DigestItem",{PreRuntime:[i,o]})}if("nmbs"===i?.toString()){const e=(0,F.i)("nmbs");return r.query.randomness?.notFirstBlock&&t.pushStorageLayer().set(Q(r.query.randomness.notFirstBlock()),J.Deleted),r.registry.createType("DigestItem",{PreRuntime:[i,n.digest.logs.find(t=>t.isPreRuntime&&t.asPreRuntime[0].toHex()===e)?.asPreRuntime[1].toHex()]})}}return e})),r.registry.createType("Header",{parentHash:t.hash,number:e??t.number+1,stateRoot:"0x0000000000000000000000000000000000000000000000000000000000000000",extrinsicsRoot:"0x0000000000000000000000000000000000000000000000000000000000000000",digest:{logs:i}})},wt=async(t,e,r,n,i,s)=>{const o=e.number.toNumber(),a=`0x${Math.round(1e8*Math.random()).toString(16).padEnd(64,"0")}`,h=new dt(t.chain,o,a,t,{header:e,extrinsics:[],storage:i??t.storage});{const r=await h.call("Core_initialize_block",[e.toHex()]);if(h.pushStorageLayer().setAll(r.storageDiff),0===t.number){const e=await t.meta,r=await t.header;h.pushStorageLayer().setAll([[Q(e.query.system.parentHash()),r.hash.toHex()]])}s?.onPhaseApplied?.("initialize",r)}const u=[],c=[];for(const t of r)try{const e=await t.createInherents(h,n);if(0===e.length)continue;const r=await h.call("BlockBuilder_apply_extrinsic",e,!0),i=h.pushStorageLayer();i.setAll(r.storageDiff),c.push(i),u.push(...e),s?.onPhaseApplied?.(c.length-1,r)}catch(t){throw gt.warn("Failed to apply inherents %o %s",t,t),new Error("Failed to apply inherents")}return{block:h,layers:c,inherents:u}},bt=async(t,e,r)=>{const n=await yt(t),{layers:i}=await wt(t,n,e,r),s={};for(const t of i)await t.mergeInto(s);return Object.entries(s)},vt=()=>Math.random().toString(36).substring(2),Mt=_.child({name:"head-state"});class kt{#R={};#A={};#_={};#B;constructor(t){this.#B=t}subscribeHead(t){const e=vt();return this.#R[e]=t,e}unsubscribeHead(t){delete this.#R[t]}async subscribeStorage(t,e){const r=vt();this.#A[r]=[t,e];for(const e of t)this.#_[e]=await this.#B.get(e).then(t=>t||null);return r}unsubscribeStorage(t){delete this.#A[t]}async setHead(t){this.#B=t;for(const e of Object.values(this.#R))try{await e(t)}catch(t){Mt.error(t,"setHead head callback error")}const e=await this.#B.storageDiff();for(const[r,n]of Object.values(this.#A)){const i=r.filter(t=>e[t]).map(t=>[t,e[t]]);if(i.length>0)try{await n(t,i)}catch(t){Mt.error(t,"setHead storage diff callback error")}}Object.assign(this.#_,e)}}var St=r(60374),Et=r(1648);const xt=/^0x[\da-fA-F]+$/,Rt=/^[\da-fA-F]+$/;function At(t){return"function"==typeof t}function _t(...t){return e=>(function(t){return!!t&&"object"==typeof t}(e)||At(e))&&t.every(t=>At(e[t]))}const Bt=_t("toBigInt"),Tt=_t("toBn");function Ot(t){return t?Et.isBN(t)?t:function(t,e=-1,r){return"string"==typeof t&&("0x"===t||xt.test(t))&&(-1===e?r||t.length%2==0:t.length===2+Math.ceil(e/4))}(t)?function(t,{isLe:e=!1,isNegative:r=!1}={}){if(!t||"0x"===t)return new Et(0);const n=function(t){if(!t||"0x"===t)return"";if(xt.test(t))return t.substring(2);if(Rt.test(t))return t;throw new Error(`Expected hex value to convert, found '${t}'`)}(t),i=new Et(n,16,e?"le":"be");return r?i.fromTwos(4*n.length):i}(t.toString()):function(t){return"bigint"==typeof t}(t)?new Et(t.toString()):Tt(t)?t.toBn():Bt(t)?new Et(t.toBigInt().toString()):new Et(t):new Et(0)}const Ct={},Pt={AnchorData:{anchoredBlock:"u64",docRoot:"H256",id:"H256"},DispatchErrorModule:"DispatchErrorModuleU8",PreCommitData:{expirationBlock:"u64",identity:"H256",signingRoot:"H256"},Fee:{key:"Hash",price:"Balance"},MultiAccountData:{deposit:"Balance",depositor:"AccountId",signatories:"Vec<AccountId>",threshold:"u16"},ChainId:"u8",DepositNonce:"u64",ResourceId:"[u8; 32]","chainbridge::ChainId":"u8",RegistryId:"H160",TokenId:"U256",AssetId:{registryId:"RegistryId",tokenId:"TokenId"},AssetInfo:{metadata:"Bytes"},MintInfo:{anchorId:"Hash",proofs:"Vec<ProofMint>",staticHashes:"[Hash; 3]"},Proof:{leafHash:"H256",sortedHashes:"H256"},ProofMint:{hashes:"Vec<Hash>",property:"Bytes",salt:"[u8; 32]",value:"Bytes"},RegistryInfo:{fields:"Vec<Bytes>",ownerCanBurn:"bool"},ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","NonProxy"]}},It={...Pt,AccountInfo:"AccountInfoWithRefCount",Address:"LookupSource",LookupSource:"IndicesLookupSource",Multiplier:"Fixed64",RefCount:"RefCountTo259"},Nt=[{minmax:[240,243],types:{...It,ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","Vesting"]}}},{minmax:[244,999],types:{...It}},{minmax:[1e3,void 0],types:{...Pt}}];var Lt=r(38525);const Dt={CompactAssignments:"CompactAssignmentsWith24",DispatchErrorModule:"DispatchErrorModuleU8",RawSolution:"RawSolutionWith24",Keys:"SessionKeys6",ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","IdentityJudgement","CancelProxy","Auction"]},Weight:"WeightV1"},Ut={AccountInfo:"AccountInfoWithRefCount",Address:"LookupSource",CompactAssignments:"CompactAssignmentsWith16",DispatchErrorModule:"DispatchErrorModuleU8",RawSolution:"RawSolutionWith16",Keys:"SessionKeys5",LookupSource:"IndicesLookupSource",ValidatorPrefs:"ValidatorPrefsWithCommission"},Ht={AccountInfo:"AccountInfoWithRefCount",Address:"AccountId",CompactAssignments:"CompactAssignmentsWith16",DispatchErrorModule:"DispatchErrorModuleU8",RawSolution:"RawSolutionWith16",Keys:"SessionKeys5",LookupSource:"AccountId",ValidatorPrefs:"ValidatorPrefsWithCommission"},jt={CompactAssignments:"CompactAssignmentsWith16",DispatchErrorModule:"DispatchErrorModuleU8",RawSolution:"RawSolutionWith16",Keys:"SessionKeys6",ProxyType:{_enum:{Any:0,NonTransfer:1,Governance:2,Staking:3,UnusedSudoBalances:4,IdentityJudgement:5,CancelProxy:6,Auction:7}},Weight:"WeightV1"},Ft={AccountInfo:"AccountInfoWithRefCount",Address:"AccountId",DispatchErrorModule:"DispatchErrorModuleU8",Keys:"SessionKeys5",LookupSource:"AccountId",ValidatorPrefs:"ValidatorPrefsWithCommission"},qt={DispatchErrorModule:"DispatchErrorModuleU8",FullIdentification:"()",Keys:"SessionKeys7B",Weight:"WeightV1"},zt={DispatchErrorModule:"DispatchErrorModuleU8",TAssetBalance:"u128",ProxyType:{_enum:["Any","NonTransfer","CancelProxy","Assets","AssetOwner","AssetManager","Staking"]},Weight:"WeightV1"},Vt={DispatchErrorModule:"DispatchErrorModuleU8",TAssetBalance:"u128",ProxyType:{_enum:["Any","NonTransfer","CancelProxy","Assets","AssetOwner","AssetManager","Staking"]},Weight:"WeightV1"},Wt={CompactAssignments:"CompactAssignmentsWith16",DispatchErrorModule:"DispatchErrorModuleU8",RawSolution:"RawSolutionWith16",Keys:"SessionKeys6",ProxyType:{_enum:["Any","NonTransfer","Staking","SudoBalances","IdentityJudgement","CancelProxy"]},Weight:"WeightV1"},$t={AccountInfo:"AccountInfoWithRefCount",Address:"AccountId",CompactAssignments:"CompactAssignmentsWith16",DispatchErrorModule:"DispatchErrorModuleU8",LookupSource:"AccountId",Keys:"SessionKeys5",RawSolution:"RawSolutionWith16",ValidatorPrefs:"ValidatorPrefsWithCommission"},Kt={DispatchErrorModule:"DispatchErrorModuleU8",TAssetBalance:"u128",ProxyType:{_enum:["Any","NonTransfer","CancelProxy","Assets","AssetOwner","AssetManager","Staking"]},Weight:"WeightV1"},Jt={"centrifuge-chain":Nt,kusama:[{minmax:[1019,1031],types:{...Ut,BalanceLock:"BalanceLockTo212",CompactAssignments:"CompactAssignmentsTo257",DispatchError:"DispatchErrorTo198",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",IdentityInfo:"IdentityInfoTo198",Keys:"SessionKeys5",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",Scheduled:"ScheduledTo254",SlashingSpans:"SlashingSpansTo204",StakingLedger:"StakingLedgerTo223",Votes:"VotesTo230",Weight:"u32"}},{minmax:[1032,1042],types:{...Ut,BalanceLock:"BalanceLockTo212",CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Keys:"SessionKeys5",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",Scheduled:"ScheduledTo254",SlashingSpans:"SlashingSpansTo204",StakingLedger:"StakingLedgerTo223",Votes:"VotesTo230",Weight:"u32"}},{minmax:[1043,1045],types:{...Ut,BalanceLock:"BalanceLockTo212",CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Keys:"SessionKeys5",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",Scheduled:"ScheduledTo254",StakingLedger:"StakingLedgerTo223",Votes:"VotesTo230",Weight:"u32"}},{minmax:[1046,1049],types:{...Dt,...Ht,CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",Scheduled:"ScheduledTo254",StakingLedger:"StakingLedgerTo223",Weight:"u32"}},{minmax:[1050,1054],types:{...Dt,...Ht,CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",Scheduled:"ScheduledTo254",StakingLedger:"StakingLedgerTo240",Weight:"u32"}},{minmax:[1055,1056],types:{...Dt,...Ht,CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",Scheduled:"ScheduledTo254",StakingLedger:"StakingLedgerTo240",Weight:"u32"}},{minmax:[1057,1061],types:{...Dt,...Ht,CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",Scheduled:"ScheduledTo254"}},{minmax:[1062,2012],types:{...Dt,...Ht,CompactAssignments:"CompactAssignmentsTo257",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259"}},{minmax:[2013,2022],types:{...Dt,...Ht,CompactAssignments:"CompactAssignmentsTo257",RefCount:"RefCountTo259"}},{minmax:[2023,2024],types:{...Dt,...Ht,RefCount:"RefCountTo259"}},{minmax:[2025,2027],types:{...Dt,...Ht}},{minmax:[2028,2029],types:{...Dt,AccountInfo:"AccountInfoWithDualRefCount",CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16"}},{minmax:[2030,9e3],types:{...Dt,CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16"}},{minmax:[9010,9099],types:{...Dt,...(0,Lt._)("V0")}},{minmax:[9100,9105],types:{...Dt,...(0,Lt._)("V1")}},{minmax:[9106,void 0],types:{Weight:"WeightV1"}}],node:[{minmax:[0,void 0],types:{Weight:"WeightV2"}}],"node-template":[{minmax:[0,void 0],types:{Weight:"WeightV2"}}],polkadot:[{minmax:[0,10],types:{...jt,...Ft,CompactAssignments:"CompactAssignmentsTo257",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ElectionResult:"ElectionResultToSpec10"}},{minmax:[11,12],types:{...jt,...Ft,CompactAssignments:"CompactAssignmentsTo257",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259"}},{minmax:[13,22],types:{...jt,...Ft,CompactAssignments:"CompactAssignmentsTo257",RefCount:"RefCountTo259"}},{minmax:[23,24],types:{...jt,...Ft,RefCount:"RefCountTo259"}},{minmax:[25,27],types:{...jt,...Ft}},{minmax:[28,29],types:{...jt,AccountInfo:"AccountInfoWithDualRefCount"}},{minmax:[30,9109],types:{...jt}},{minmax:[9110,void 0],types:{Weight:"WeightV1"}}],rococo:[{minmax:[0,200],types:{...qt,AccountInfo:"AccountInfoWithDualRefCount",Address:"AccountId",LookupSource:"AccountId"}},{minmax:[201,214],types:{...qt,AccountInfo:"AccountInfoWithDualRefCount"}},{minmax:[215,228],types:{...qt,Keys:"SessionKeys6"}},{minmax:[229,9099],types:{...qt,...(0,Lt._)("V0")}},{minmax:[9100,9105],types:{...qt,...(0,Lt._)("V1")}},{minmax:[9106,void 0],types:{Weight:"WeightV1"}}],shell:[{minmax:[0,void 0],types:{}}],statemine:[{minmax:[0,3],types:{DispatchError:"DispatchErrorPre6First",...zt,...(0,Lt._)("V0")}},{minmax:[4,5],types:{DispatchError:"DispatchErrorPre6First",...zt,...(0,Lt._)("V1")}},{minmax:[500,9999],types:{Weight:"WeightV1",TAssetConversion:"Option<AssetId>"}},{minmax:[1e4,void 0],types:{Weight:"WeightV1"}}],statemint:[{minmax:[0,3],types:{DispatchError:"DispatchErrorPre6First",...Vt,...(0,Lt._)("V0")}},{minmax:[4,5],types:{DispatchError:"DispatchErrorPre6First",...Vt,...(0,Lt._)("V1")}},{minmax:[500,1001003],types:{Weight:"WeightV1",TAssetConversion:"Option<AssetId>"}},{minmax:[1002e3,void 0],types:{Weight:"WeightV1",...(0,Lt._)("V4")}}],westend:[{minmax:[1,2],types:{...Wt,...$t,CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",Weight:"u32"}},{minmax:[3,22],types:{...Wt,...$t,CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259"}},{minmax:[23,42],types:{...Wt,...$t,CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",RefCount:"RefCountTo259"}},{minmax:[43,44],types:{...Wt,...$t,DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",RefCount:"RefCountTo259"}},{minmax:[45,47],types:{...Wt,...$t}},{minmax:[48,49],types:{...Wt,AccountInfo:"AccountInfoWithDualRefCount"}},{minmax:[50,9099],types:{...Wt,...(0,Lt._)("V0")}},{minmax:[9100,9105],types:{...Wt,...(0,Lt._)("V1")}},{minmax:[9106,void 0],types:{Weight:"WeightV1"}}],westmint:[{minmax:[0,3],types:{DispatchError:"DispatchErrorPre6First",...Kt,...(0,Lt._)("V0")}},{minmax:[4,5],types:{DispatchError:"DispatchErrorPre6First",...Kt,...(0,Lt._)("V1")}},{minmax:[500,9434],types:{Weight:"WeightV1",TAssetConversion:"Option<AssetId>"}},{minmax:[9435,void 0],types:{Weight:"WeightV1"}}]};function Zt(t,e,r){return r(t.toString(),e.toString())}function Xt(t=[],e){return t.filter(({minmax:[t,r]})=>(null==t||e>=t)&&(null==r||e<=r)).reduce((t,{types:e})=>({...t,...e}),{})}var Gt=r(56639),Qt=r(74274),Yt=r(43428);const te=_.child({name:"offchain"});class ee{pendingExtrinsics=[];offchainStorage=new Map;get(t){return this.offchainStorage.get(t)}set(t,e){this.offchainStorage.set(t,e)}async run(t){te.info({number:t.number,hash:t.hash},`Run Offchain Worker for block #${t.number.toLocaleString()}`);const e=await t.header;await t.call("OffchainWorkerApi_offchain_worker",[e.toHex()]),te.info(`Offchain Worker complete for block #${t.number.toLocaleString()}`);const r=this.pendingExtrinsics.splice(0);r.length>0&&Yt.T.schedule(async e=>{await t.chain.txPool.buildBlock({transactions:e})},100,r)}async pushExtrinsic(t,e){const r=await t.chain.validateExtrinsic(e,"0x01");if(r.isOk)return this.pendingExtrinsics.push(e),(0,q.X)(e,256);throw r.asErr}}var re=r(27429);const ne=_.child({name:"txpool"}),ie="TxPool::ApplyExtrinsicError";var se=function(t){return t.Batch="Batch",t.Instant="Instant",t.Manual="Manual",t}({});class oe{#d;#T=[];#O={};#C=[];#P={};#I;#N;#L=[];event=new re.b;#D=!1;constructor(t,e,r="Batch"){this.#d=t,this.#I=r,this.#N=e}get pendingExtrinsics(){return this.#T.map(({extrinsic:t})=>t)}get ump(){return this.#O}get dmp(){return this.#C}get hrmp(){return this.#P}get mode(){return this.#I}set mode(t){this.#I=t}clear(){this.#T.length=0;for(const t of Object.keys(this.#O))delete this.#O[t];this.#C.length=0;for(const t of Object.keys(this.#P))delete this.#P[t]}pendingExtrinsicsBy(t){return this.#T.filter(({signer:e})=>e===t).map(({extrinsic:t})=>t)}async submitExtrinsic(t){ne.debug({extrinsic:T(t)},"submit extrinsic"),this.#T.push({extrinsic:t,signer:await this.#U(t)}),this.#H()}async#U(t){return(await this.#d.head.registry).createType("GenericExtrinsic",t).signer.toString()}submitUpwardMessages(t,e){ne.debug({id:t,ump:T(e)},"submit upward messages"),this.#O[t]||(this.#O[t]=[]),this.#O[t].push(...e),this.#H()}submitDownwardMessages(t){ne.debug({dmp:T(t)},"submit downward messages"),this.#C.push(...t),this.#H()}submitHorizontalMessages(t,e){ne.debug({id:t,hrmp:T(e)},"submit horizontal messages"),this.#P[t]||(this.#P[t]=[]),this.#P[t].push(...e),this.#H()}#H(){switch(this.#I){case"Batch":this.#j();break;case"Instant":this.buildBlock()}}#j=p.debounce(this.buildBlock,100,{maxWait:1e3});async buildBlockWithParams(t){this.#L.push({params:t,deferred:Y()}),this.#F(),await this.upcomingBlocks()}async buildBlock(t){const e=t?.transactions||this.#T.splice(0).map(({extrinsic:t})=>t),r=t?.upwardMessages||{...this.#O},n=t?.downwardMessages||this.#C.splice(0),i=t?.horizontalMessages||{...this.#P},s=t?.unsafeBlockHeight,o=t?.relayChainStateOverrides,a=t?.relayParentNumber;if(!t?.upwardMessages)for(const t of Object.keys(this.#O))delete this.#O[t];if(!t?.horizontalMessages)for(const t of Object.keys(this.#P))delete this.#P[t];try{if(await this.buildBlockWithParams({transactions:e,upwardMessages:r,downwardMessages:n,horizontalMessages:i,unsafeBlockHeight:s,relayChainStateOverrides:o,relayParentNumber:a}),!this.#d.processQueuedMessages)return;if(p.isEmpty(i)&&p.isEmpty(n))return;const t="0xb8753e9383841da95f7b8871e5de326954e062a2cf8df68178ee2e5dbdf00bff",h=await this.#d.head.meta,u=await this.#d.head.getKeysPaged({prefix:t,pageSize:1e3});for(const t of u){const e=await this.#d.head.get(t);if(!e)continue;const r=h.registry.createType("PalletMessageQueueBookState",(0,M.V)(e)).toJSON();if(r.size>0&&r.end>r.begin)return ne.info("Queued messages detected, building a new block"),void await this.#d.newBlock()}}catch(t){ne.error({err:t},"build block failed")}}async upcomingBlocks(){const t=this.#L.length;return t>0&&await this.#L[t-1].deferred.promise,t}async#F(){if(!this.#D&&0!==this.#L.length){this.#D=!0;try{await this.#q()}catch(t){ne.error({error:t},"build block failed");for(const{deferred:e}of this.#L)e.reject(t);this.#L.length=0}finally{this.#D=!1}this.#F()}}async#q(){await this.#d.api.isReady;const t=this.#L[0];if(!t)throw new Error("Unreachable");const{params:e,deferred:r}=t;ne.trace({params:e},"build block");const[n,i]=await(async(t,e,r,n)=>{const{transactions:i,upwardMessages:s,unsafeBlockHeight:o}=r,a=await t.registry,h=await yt(t,o),u=h.number.toNumber();let c;if(gt.info({number:u,extrinsics:i.map(T),umpCount:Object.keys(s).length},`${await t.chain.api.getSystemChain()} building #${u.toLocaleString()}`),Object.keys(s).length>0){const e=await t.meta;c=new X(t.storage);for(const[t,r]of Object.entries(s)){const n=r.map(t=>(0,M.V)(t)),i=r.length,s=n.map(t=>t.length).reduce((t,e)=>t+e,0);if(e.query.ump){const n=e.registry.createType("(u32, u32)",[i,s]),o=e.registry.createType("Vec<Bytes>",r);c.setAll([[Q(e.query.ump.relayDispatchQueues(t)),o.toHex()],[Q(e.query.ump.relayDispatchQueueSize(t)),n.toHex()]])}else{if(!e.query.messageQueue)throw new Error("Unknown ump storage");{const r={ump:{para:t}};let o=0,a=new Uint8Array(0);for(const t of n){const r=t.length,n=e.registry.createType("(u32, bool)",[r,!1]);o=a.length,a=(0,mt.z)(a,n.toU8a(),t)}c.setAll([[Q(e.query.messageQueue.bookStateFor(r)),e.registry.createType("PalletMessageQueueBookState",{begin:0,end:1,count:1,readyNeighbours:{prev:r,next:r},messageCount:i,size_:s}).toHex()],[Q(e.query.messageQueue.serviceHead(r)),e.registry.createType("PolkadotRuntimeParachainsInclusionAggregateMessageOrigin",r).toHex()],[Q(e.query.messageQueue.pages(r,0)),e.registry.createType("PalletMessageQueuePage",{remaining:i,remaining_size:s,first_index:0,first:0,last:o,heap:(0,pt.h)(a)}).toHex()]])}}gt.trace({paraId:t,upwardMessages:T(r)},"Pushed UMP")}if(e.query.ump){const t=e.registry.createType("Vec<u32>",Object.keys(s));c.set(Q(e.query.ump.needsDispatch()),t.toHex())}}const{block:l,inherents:f}=await wt(t,h,e,r,c),d=[],p=[];for(const t of i)try{const e=await l.call("BlockBuilder_apply_extrinsic",[t]),r=a.createType("ApplyExtrinsicResult",e.result);if(r.isErr){n?.onApplyExtrinsicError?.(t,r.asErr);continue}l.pushStorageLayer().setAll(e.storageDiff),p.push(t),n?.onPhaseApplied?.(p.length-1,e)}catch(e){gt.info("Failed to apply extrinsic %o %s",e,e),d.push(t)}{const t=await l.call("BlockBuilder_finalize_block",[]);l.pushStorageLayer().setAll(t.storageDiff),n?.onPhaseApplied?.("finalize",t)}const m=[...f,...p],g=(0,q.q)((0,mt.z)(...m),256),y=a.createType("Header",{...h.toJSON(),extrinsicsRoot:g}),w=await l.storageDiff();"trace"===gt.level.toLowerCase()&&gt.trace(Object.entries(w).map(([t,e])=>[t,T(e)]),"Final block");const b=new dt(t.chain,l.number,y.hash.toHex(),t,{header:y,extrinsics:m,storage:t.storage,storageDiff:w});return gt.info({number:b.number,hash:b.hash,extrinsics:T(p),pendingExtrinsics:d.map(T),ump:T(s)},`${await t.chain.api.getSystemChain()} new head #${b.number.toLocaleString()}`),[b,d]})(this.#d.head,this.#N,e,{onApplyExtrinsicError:(t,e)=>{this.event.emit(ie,[t,e])},onPhaseApplied:"trace"===ne.level.toLowerCase()?(t,e)=>{switch(t){case"initialize":ne.trace(T(e.storageDiff),"Initialize block");break;case"finalize":ne.trace(T(e.storageDiff),"Finalize block");break;default:ne.trace(T(e.storageDiff),`Apply extrinsic ${t}`)}}:void 0});for(const t of i)this.#T.push({extrinsic:t,signer:await this.#U(t)});await this.#d.onNewBlock(n),this.#L.shift(),r.resolve()}}const ae=_.child({name:"blockchain"});class he{api;db;mockSignatureHost;allowUnresolvedImports;#z;registeredTypes;#V;#N;#B;#W=new Map;#$=new Map;#K={};headState;offchainWorker;#J;processQueuedMessages=!0;saveBlocks;#Z=p.memoize(async(t,e,r)=>{const n=await this.api.chain,i=await this.api.chainProperties,s=new St.O;return s.setKnownTypes(this.registeredTypes),s.setChainProperties(s.createType("ChainProperties",i)),s.register(function({knownTypes:t},e,r,n){const i=Ot(n).toNumber();return Zt(e,r,(e,r)=>({...Xt(Jt[r],i),...Xt(Ct[e],i),...Xt(t.typesBundle?.spec?.[r]?.types,i),...Xt(t.typesBundle?.chain?.[e]?.types,i),...t.typesSpec?.[r]??{},...t.typesChain?.[e]??{},...t.types??{}}))}(s,n,r.specName,r.specVersion)),s.setHasher(function({knownTypes:t},e,r){return Zt(e,r,(e,r)=>t.hasher||t.typesBundle?.chain?.[e]?.hasher||t.typesBundle?.spec?.[r]?.hasher||null)}(s,n,r.specName)),s.setMetadata(new lt.O(s,e),void 0,(0,Gt.b)({},function({knownTypes:t},e,r){return Zt(e,r,(e,r)=>({...t.typesBundle?.spec?.[r]?.signedExtensions??{},...t.typesBundle?.chain?.[e]?.signedExtensions??{}}))}(s,n,r.specName),this.api.signedExtensions),!0),s});constructor({api:t,buildBlockMode:e,inherentProviders:r,db:n,header:i,mockSignatureHost:s=!1,allowUnresolvedImports:o=!1,runtimeLogLevel:a=0,registeredTypes:h={},offchainWorker:u=!1,maxMemoryBlockCount:c=500,processQueuedMessages:l=!0,saveBlocks:f=!0}){this.api=t,this.db=n,this.mockSignatureHost=s,this.allowUnresolvedImports=o,this.#z=a,this.registeredTypes=h,this.#B=new dt(this,i.number,i.hash),this.#X(this.#B),this.#V=new oe(this,r,e),this.#N=r,this.headState=new kt(this.#B),u&&(this.offchainWorker=new ee),this.#J=c,this.processQueuedMessages=l,this.saveBlocks=f}#X(t){if(this.#W.size===this.#J){const{hash:t,number:e}=this.#W.values().next().value;this.#W.delete(e),this.#$.delete(t)}this.#W.set(t.number,t),this.#$.set(t.hash,t)}get head(){return this.#B}get txPool(){return this.#V}get runtimeLogLevel(){return this.#z}set runtimeLogLevel(t){this.#z=t,ae.debug(`Runtime log level set to ${ae.level}`)}async buildRegistry(t,e){const r=`${(0,Qt.E)(t,256)}-${e.specVersion}`;return this.#Z(r,t,e)}async saveBlockToDB(t){if(this.db&&this.saveBlocks){const{hash:e,number:r,header:n,extrinsics:i}=t;await this.db.saveBlock({hash:e,number:r,header:(await n).toHex(),extrinsics:await i,parentHash:(await t.parentBlock)?.hash||null,storageDiff:await t.storageDiff()})}}async loadBlockFromDB(t){if(this.db){const e="number"==typeof t?await this.db.queryBlockByNumber(t):await this.db.queryBlock(t);if(e){const{hash:t,number:r,header:n,extrinsics:i}=e,s=e.parentHash||void 0;let o=s?this.#$.get(s):void 0;o||(o=await this.getBlock(s));const a=e.storageDiff??void 0,h=await this.head.registry,u=new dt(this,r,t,o,{header:h.createType("Header",n),extrinsics:i,storage:o?.storage,storageDiff:a});return this.#X(u),u}}}async getBlockAt(t){if(null==t)return this.head;if(!(t>this.#B.number)){if(!this.#W.has(t)){const e=await this.loadBlockFromDB(t);if(e)return e;const r=await this.api.getBlockHash(t);if(!r)return;const n=new dt(this,t,r);this.#X(n)}return this.#W.get(t)}}async getBlock(t){if(await this.api.isReady,null==t&&(t=this.head.hash),!this.#$.has(t)){const e=this.#K[t];if(e)await e;else{const e=(async()=>{try{if(!await this.loadBlockFromDB(t)){const e=await this.api.getHeader(t);if(!e)throw new Error(`Block ${t} not found`);const r=new dt(this,Number(e.number),t);this.#X(r)}}catch(e){ae.debug(`getBlock(${t}) failed: ${e}`)}})();this.#K[t]=e,await e,delete this.#K[t]}}return this.#$.get(t)}blocksInMemory(){return Array.from(this.#W.values())}async unregisterBlock(t){if(t.hash===this.head.hash)throw new Error("Cannot unregister head block");this.#W.get(t.number)?.hash===t.hash&&this.#W.delete(t.number),this.#$.delete(t.hash),this.db&&await this.db.deleteBlock(t.hash)}async onNewBlock(t){await this.setHead(t),await this.saveBlockToDB(t)}async setHead(t){ae.debug({number:t.number,hash:t.hash},"setHead"),this.#B=t,this.#X(t),await this.headState.setHead(t),this.offchainWorker&&await this.offchainWorker.run(t)}async submitExtrinsic(t){const e=await this.validateExtrinsic(t);if(e.isOk)return await this.#V.submitExtrinsic(t),(0,q.X)(t,256);throw e.asErr}async validateExtrinsic(t,e="0x02"){const r=(0,m.X)((0,mt.z)(e,t,this.head.hash)),n=await this.head.call("TaggedTransactionQueue_validate_transaction",[r]);return(await this.head.registry).createType("TransactionValidity",n.result)}submitUpwardMessages(t,e){this.#V.submitUpwardMessages(t,e),ae.debug({id:t,ump:e},"submitUpwardMessages")}submitDownwardMessages(t){this.#V.submitDownwardMessages(t),ae.debug({dmp:t},"submitDownwardMessages")}submitHorizontalMessages(t,e){this.#V.submitHorizontalMessages(t,e),ae.debug({id:t,hrmp:e},"submitHorizontalMessages")}async newBlock(t){return await this.#V.buildBlock(t),this.#B}async newBlockWithParams(t){return await this.#V.buildBlockWithParams(t),this.#B}async upcomingBlocks(){return this.#V.upcomingBlocks()}async dryRunExtrinsic(t,e){await this.api.isReady;const r=e?await this.getBlock(e):this.head;if(!r)throw new Error(`Cannot find block ${e}`);const n=await r.registry,{result:i,storageDiff:s}=await(async(t,e,r)=>{const n=await t.registry,i=await yt(t),{block:s}=await wt(t,i,e,{transactions:[],downwardMessages:[],upwardMessages:[],horizontalMessages:{}});if("string"!=typeof r){if(!t.chain.mockSignatureHost)throw new Error("Cannot fake signature because mock signature host is not enabled. Start chain with `mockSignatureHost: true`");const e=await t.meta,i=n.createType("Call",(0,M.V)(r.call)),o=n.createType("GenericExtrinsic",i),a=await t.get(Q(e.query.system.account(r.address))),h=n.createType("AccountInfo",(0,M.V)(a));o.signFake(r.address,{blockHash:t.hash,genesisHash:t.hash,runtimeVersion:await t.runtimeVersion,nonce:h.nonce});const u=new Uint8Array(64);return u.fill(205),u.set([222,173,190,239]),o.signature.set(u),gt.debug({call:i.toHuman()},"dry_run_call"),s.call("BlockBuilder_apply_extrinsic",[o.toHex()])}return gt.debug({call:n.createType("GenericExtrinsic",(0,M.V)(r)).toJSON()},"dry_run_extrinsic"),s.call("BlockBuilder_apply_extrinsic",[r])})(r,this.#N,t);return{outcome:n.createType("ApplyExtrinsicResult",i),storageDiff:s}}async dryRunHrmp(t,e){await this.api.isReady;const r=e?await this.getBlock(e):this.head;if(!r)throw new Error(`Cannot find block ${e}`);const n={transactions:[],downwardMessages:[],upwardMessages:[],horizontalMessages:t};return bt(r,this.#N,n)}async dryRunDmp(t,e){await this.api.isReady;const r=e?await this.getBlock(e):this.head;if(!r)throw new Error(`Cannot find block ${e}`);const n={transactions:[],downwardMessages:t,upwardMessages:[],horizontalMessages:{}};return bt(r,this.#N,n)}async dryRunUmp(t,e){await this.api.isReady;const r=e?await this.getBlock(e):this.head;if(!r)throw new Error(`Cannot find block ${e}`);const n=await r.meta,i=n.registry.createType("Vec<u32>",Object.keys(t)),s=[[Q(n.query.ump.needsDispatch()),i.toHex()]];for(const[e,r]of Object.entries(t)){const t=n.registry.createType("Vec<Bytes>",r);if(0===t.length)throw new Error("No upward meesage");const i=n.registry.createType("(u32, u32)",[t.length,t.map(t=>t.byteLength).reduce((t,e)=>t+e,0)]);s.push([Q(n.query.ump.relayDispatchQueues(e)),t.toHex()]),s.push([Q(n.query.ump.relayDispatchQueueSize(e)),i.toHex()])}return r.pushStorageLayer().setAll(s),bt(r,this.#N,{transactions:[],downwardMessages:[],upwardMessages:[],horizontalMessages:{}})}getInherents(){return this.#N}async close(){await this.api.disconnect(),await(this.db?.close())}}var ue=r(4494);const ce={EPOCH_INDEX:"0x1cb6f36e027abb2091cfb5110ab5087f38316cbf8fa0da822a20ac1c55bf1be3",CURRENT_BLOCK_RANDOMNESS:"0x1cb6f36e027abb2091cfb5110ab5087fd077dfdb8adb10f78f10a5df8742c545",ONE_EPOCH_AGO_RANDOMNESS:"0x1cb6f36e027abb2091cfb5110ab5087f7ce678799d3eff024253b90e84927cc6",TWO_EPOCHS_AGO_RANDOMNESS:"0x1cb6f36e027abb2091cfb5110ab5087f7a414cb008e0e61e46722aa60abdd672",CURRENT_SLOT:"0x1cb6f36e027abb2091cfb5110ab5087f06155b3cd9a8c9e5e9a23fd5dc13a5ed",ACTIVE_CONFIG:"0x06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385",AUTHORITIES:"0x1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d"},le=(t,e)=>(0,m.X)((0,mt.z)((0,M.V)(t),(0,Qt.F)(e,64),e)),fe=t=>le("0x6a0da05ca59913bc38a8630590f2627cb6604cff828a6e3f579ca6c59ace013d",t.toU8a()),de=t=>le("0xcd710b30bd2eab0352ddcc26417aa1941b3c252fcb29d88eff4f3de5de4476c3",t.toU8a()),pe=_.child({name:"parachain-validation-data"}),me={validationData:{relayParentNumber:1e3,relayParentStorageRoot:"0x0",maxPovSize:5242880},relayChainState:{trieNodes:["0x5f04b49d95320d9021994c850f25b8e385f902000030000080000008000000000010000000100005000000050000000a0000000a000000000050000000100000e8764817000000040000000400000000000000000000000000000000000000000000000000000000000000000000000800000000200000040000000400000000001000b0040000000000000000000014000000040000000400000000000000010100000000060000006400000002000000c8000000020000001900000000000000020000000200000000c817a804000000","0x80011080ace5323aee784b03389c0e2cc68d81973f8fa26d395f333ecad7399271c781e1808e5db75be813c05205986cbd6fdede707a4d26816063a41eb42ebc262c734fad","0x8004648086a9239b72237f5bf119e2a880c32f5866460632700509cb874c60f67fe815ea80f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc5280c629a7e712d763fe83b35d2a082430af6737a89f23219c0eb3051c83bc5af5ad80fed5ecd6097308a6540f8cf31aeaad186e6898d2ecc0e623767c521c70e39953","0x800804809f3ada68c357b5e0a3ebb39ef181acfa9943af4725c244330a4b2c60837612e88082ad3fbdf392429afeacc70177704b760bb145547c1f152e1fcf651916b43820","0x8008208042793f557c1d003b647e2eda79c2b5088c7d8cab2e82c1dcc87f4343cca91ae4485ead6eef5c4b1c68eaa71ea17a02d9de0400","0x80210280de38445d825563f8e218255a417c16971afa85b4f2ef18fbe08fbc5b976dc0d6801a2ff24096295cfccf1adda80b8dfffe380b9f3b54d7a3cdb67864a4655e62968022a699b2cc90a6654c84163d2a498506b192afe7cd9777227e5288e8ff069c0f","0x80400180ebebd1a1cd0bbc6714b7fb0ac854cca5a4c4e34e69485da48be3c8087b56e09b80128645c79ca6581c248a412fd7b8bc532a187600e6e1cc20c915538ba4df6a79","0x80ffbe80d9302a505e2b1ac931f539aed33bf791d1982906ae64c7197324044f191e9bca80972cd2f703f9c94fd516e14b7013c6f1545095855b6c4b36f21d89dad30aa54d80b2495ce4d07001927bb0857611f8d3a1449e791d0b010e3861c32dec0c44179680f5929c8ef9b0ac6ec8a529c91348d8cd6c169920dd37d055544a6c31c53b11e380402a0bf7ff07cee790d9cc065fc138ff6afa7db016d898d65b2b716af354c6f68042aef1dafffd1d9debbb8e6c4eb48b5c141ddf0aad2b0f3f4ddf53e6b38e65c080b31fa0392c1abdce1aa29d1544c94634ecab87ecaba6409db33aaa7621992a8280b1f4de7c3ac5665016d561a60659cd2d8f2d3e0a97e2ea9749279bd8e35eb1f180816ac87a2893694016b21768137a76ea459190ea0fc3c645d85e1a3d4eb194fe802e563b43e7334454c841953424be8c2b7a1c3295dbc391045cb6b88388ad5e7080b1ed3b02e5989b7d134ca056c778f1f5b6ffd377b2d8064483da6e94b82b0e40800cb3299c44a5db8fdcb4932e1b6ab0385d6ef1c9f8d85e0a75b787b6f4fd6c3c805a44c30e2676dc2d4c17451f51d9502e85064387999f366e6f3d404509a7780f80d6788ca71c6aabe421c352027acdb9532563dc5f1b25e6154b721f431e9990ed","0x9d0da05ca59913bc38a8630590f2627c154080834dda0ba5adf00d798e981a28a13e728cf83e35aefc87318440a61869f724474c5f0a351b6a99a5b21324516e668bb86a570400505f0e7b9012096b41c4eb3aaf947f6ea4290800007c7700e67da63472835bb0b737093a19ad4c63f5a4efb16ffa83d00700000400","0x9e207f03cfdce586301014700e2c25931040505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f0ec2d17a76153ff51817f12d9cfc3c7f0400","0x9e710b30bd2eab0352ddcc26417aa1945fc180699a53b51a9709a3a86039c49b5ef278e9fc244dae27e1a0380c91bff5b0488580c0d4096d94e724b8e86f952e5456c7253776de04c405582d2c350ee172d3eaa77c77081e0bfde17b36573208a06cb5cfba6b63f5a4efb16ffa83d00700000402803d0ae0b8f6832e8fabf0ec62521c2487c58b69eb97060faa8059b00ff6b7262d505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a20400806c8122e0f7f786071d6a51b330d612eccdcbe8d8f79936accabd640506dffdf380a6abfb72ed49b586829cca4ce631c092d45a017ab0d68288d308873025cfe5d280521b868fc212b25f021984cf02ced547cd45952b88360766839dfde7d4683e61","0x9ede3d8a54d27e44a9d5ce189618f22d1008505f0e7b9012096b41c4eb3aaf947f6ea42908010080c74756edffa217dfb07ab596d82753deff985ac215e5cc2997d29afe1d397c16","0x9ef78c98723ddc9073523ef3beefda0c1004505f0e7b9012096b41c4eb3aaf947f6ea4290800007c77095dac46c07a40d91506e7637ec4ba5763f5a4efb16ffa83d00700000400"]},horizontalMessages:[],downwardMessages:[]},ge=async(t,e=!0)=>{const r=await t.meta;if(0===t.number){const{trieRootHash:t,nodes:e}=await N(me.relayChainState.trieNodes,[]);return{...me,relayChainState:{trieNodes:e},validationData:{...me.validationData,relayParentStorageRoot:t}}}try{const e=(await t.extrinsics).find(t=>{const e=r.registry.createType("GenericExtrinsic",t)?.args?.[0];return e&&"validationData"in e});if(!e)throw new Error("Missing validation data from block");return r.registry.createType("GenericExtrinsic",e).args[0].toJSON()}catch(r){if(pe.warn("Failed to get validation data from block %d %s",t.number,r),e){const e=await t.parentBlock;if(e){const t=await ge(e,!1);return{...t,validationData:{...t.validationData,relayParentNumber:t.validationData.relayParentNumber+2}}}throw r}throw r}},ye=[new class{async createInherents(t){const e=await t.parentBlock;if(!e)throw new Error("parent block not found");const r=await e.meta,n=await ut(t),i=await ht(e);return[new ue.b(r.registry,r.tx.timestamp.set(i+BigInt(n))).toHex()]}},new class{async createInherents(t,e){const r=await t.parentBlock;if(!r)throw new Error("parent block not found");const n=await r.meta;if(!n.tx.parachainSystem?.setValidationData)return[];const i=await ge(r);let s=[];const o=[],a={},h=await(async t=>{const e=await t.head.meta,r=await t.head.read("u32",e.query.parachainInfo.parachainId);if(!r)throw new Error("Cannot find parachain id");return r})(r.chain),u=(t=>le("0x63f78c98723ddc9073523ef3beefda0c4d7fefc408aac59dbfe80a72ac8e3ce5",t.toU8a()))(h),c=(t=>le("0x6a0da05ca59913bc38a8630590f2627c1d3719f5b0b12c7105c073c507445948",t.toU8a()))(h),l=(t=>le("0x6a0da05ca59913bc38a8630590f2627cf12b746dcf32e843354583c9702cc020",t.toU8a()))(h),f=await(async(t,e)=>{const r=await P();return(await r.remote.decodeProof(t,e)).reduce((t,[e,r])=>(t[e]=r,t),{})})(i.validationData.relayParentStorageRoot,i.relayChainState.trieNodes),d=await ut(t),g=Math.trunc(d/6e3)||1;for(const t of Object.values(ce))if(t===ce.CURRENT_SLOT){const e=f[t]?n.registry.createType("Slot",(0,M.V)(f[t])).toNumber():await at(r)*g,i=n.registry.createType("Slot",e+g);pe.debug({relayCurrentSlot:e,newSlot:i.toNumber()},"Updating relay current slot"),s.push([t,(0,m.X)(i.toU8a())])}else s.push([t,f[t]]);const y=n.registry.createType("Vec<u32>",(0,M.V)(f[c])),w=n.registry.createType("Vec<u32>",(0,M.V)(f[l]));for(const t in e.horizontalMessages){const e=n.registry.createType("u32",t);if(!y.some(t=>t.eq(e))){const t=p.sortedIndexBy(y,e,t=>t.toNumber());y.splice(t,0,e)}if(!w.some(t=>t.eq(e))){const t=p.sortedIndexBy(w,e,t=>t.toNumber());w.splice(t,0,e)}}s.push([c,y.toHex()]),s.push([l,w.toHex()]);const b=n.registry.createType("HeadData",(await r.header).toHex());s.push([de(h),(0,m.X)(b.toU8a())]);let v=f[u]||"0x0000000000000000000000000000000000000000000000000000000000000000";for(const{msg:t,sentAt:r}of e.downwardMessages)v=(0,q.X)((0,mt.z)(n.registry.createType("Hash",v).toU8a(),n.registry.createType("BlockNumber",r).toU8a(),(0,q.q)(n.registry.createType("Bytes",t).toU8a(),256)),256),o.push({msg:t,sentAt:r});s.push([u,v]);for(const t of y){const r=e.horizontalMessages[t.toNumber()]||e.horizontalMessages[t.toString()]||[],o=n.registry.createType("HrmpChannelId",{sender:t,receiver:h.toNumber()}),u=fe(o),c=f[u],l=c?n.registry.createType("AbridgedHrmpChannel",(0,M.V)(c)).toJSON():{maxCapacity:1e3,maxTotalSize:102400,maxMessageSize:102400,msgCount:0,totalSize:0,mqcHead:0,senderDeposit:5e12,recipientDeposit:5e12},d=[];for(const{data:t,sentAt:e}of r){const e=i.validationData.relayParentNumber+1,r=n.registry.createType("Bytes",t);l.mqcHead=(0,q.X)((0,mt.z)(n.registry.createType("Hash",l.mqcHead).toU8a(),n.registry.createType("BlockNumber",e).toU8a(),(0,q.q)(r.toU8a(),256)),256),l.msgCount=l.msgCount+1,l.totalSize=l.totalSize+r.length,d.push({data:t,sentAt:e})}a[t.toNumber()]=d,s.push([u,n.registry.createType("AbridgedHrmpChannel",l).toHex()])}for(const t of w){const e=n.registry.createType("HrmpChannelId",{sender:h.toNumber(),receiver:t}),r=fe(e),i=f[r],o=i?n.registry.createType("AbridgedHrmpChannel",(0,M.V)(i)).toJSON():{maxCapacity:1e3,maxTotalSize:102400,maxMessageSize:102400,msgCount:0,totalSize:0,mqcHead:0};s.push([r,n.registry.createType("AbridgedHrmpChannel",o).toHex()])}const k=(t=>le("0xcd710b30bd2eab0352ddcc26417aa1949e94c040f5e73d9b7addd6cb603d15d3",t.toU8a()))(h);if(await r.get(Q(n.query.parachainSystem.pendingValidationCode()))){const t=n.registry.createType("UpgradeGoAhead","GoAhead");s.push([k,t.toHex()])}else s.push([k,null]);if(e.relayChainStateOverrides)for(const[t,r]of e.relayChainStateOverrides)s=s.filter(([e,r])=>e!==t),s.push([t,r]);const{trieRootHash:S,nodes:E}=await N(i.relayChainState.trieNodes,s),x=n.tx.parachainSystem.setValidationData.meta.args.length,R=e.relayParentNumber??i.validationData.relayParentNumber+g;if(1===x){const t={...i,downwardMessages:o,horizontalMessages:a,validationData:{...i.validationData,relayParentStorageRoot:S,relayParentNumber:R},relayChainState:{trieNodes:E}};return[new ue.b(n.registry,n.tx.parachainSystem.setValidationData(t)).toHex()]}if(2===x){let t=i.relayParentDescendants;if(t){let e=t[0];if(e){let r;e={...e,number:R,stateRoot:S},t=[e,...t.slice(1)];for(const e of t)r&&(e.parentHash=r.hash,e.number=r.number.toNumber()+1),r=n.registry.createType("Header",e)}}const e={...i,validationData:{...i.validationData,relayParentStorageRoot:S,relayParentNumber:R},relayChainState:{trieNodes:E},relayParentDescendants:t},r={downwardMessages:{full_messages:o,hashed_messages:[]},horizontalMessages:{full_messages:Object.entries(a).flatMap(([t,e])=>e.map(e=>[t,e])),hashed_messages:[]}};return[new ue.b(n.registry,n.tx.parachainSystem.setValidationData(e,r)).toHex()]}throw new Error("Unsupported setValidationData")}},new class{async createInherents(t,e){const r=await t.parentBlock;if(!r)throw new Error("parent block not found");const n=await r.meta;if(!n.tx.paraInherent?.enter)return[];if(0===r.number)return[new ue.b(n.registry,n.tx.paraInherent.enter({parentHeader:(await r.header).toJSON()})).toHex()];const i=(await r.extrinsics).find(t=>{const e=n.registry.createType("GenericExtrinsic",t)?.args?.[0];return e&&"bitfields"in e});if(!i)throw new Error("Missing paraInherent data from block");const s={...n.registry.createType("GenericExtrinsic",i).args[0].toJSON(),bitfields:[],backedCandidates:[],parentHeader:(await r.header).toJSON()};return[new ue.b(n.registry,n.tx.paraInherent.enter(s)).toHex()]}},new class{async createInherents(t,e){const r=await t.parentBlock;if(!r)throw new Error("parent block not found");const n=await r.meta;if(!n.tx.authorInherent?.kickOffAuthorshipValidation)return n.query.authorNoting&&t.pushStorageLayer().set(Q(n.query.authorNoting.didSetContainerAuthorData()),n.registry.createType("bool",!0).toHex()),[];const i=t.pushStorageLayer(),s=n.registry.hasType("NimbusPrimitivesNimbusCryptoPublic")?"NimbusPrimitivesNimbusCryptoPublic":"AccountId",o=n.registry.hasType("NimbusPrimitivesNimbusCryptoPublic")?"0x567b6ddb05396c0a83853b6f40d27450534c7963df8619b8c6064480c4db9703":"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";if(i.set(Q(n.query.authorInherent.author()),n.registry.createType(s,o).toHex()),n.query.authoritiesNoting&&(i.set(Q(n.query.authoritiesNoting.authorities()),n.registry.createType(`Vec<${s}>`,[o]).toHex()),i.set(Q(n.query.authoritiesNoting.didSetOrchestratorAuthorityData()),n.registry.createType("bool",!0).toHex())),n.query.parachainStaking&&i.set(Q(n.query.parachainStaking.selectedCandidates()),n.registry.createType(`Vec<${s}>`,[o]).toHex()),n.query.authorityAssignment&&n.query.session){const e=await t.chain.head.read("u32",n.query.session.currentIndex);e&&(i.set(Q(n.query.authorityAssignment.collatorContainerChain(e)),n.registry.createType("DpCollatorAssignmentAssignedCollatorsPublic",{orchestratorChain:[o]}).toHex()),i.set(Q(n.query.authorityAssignment.collatorContainerChain(e.toBigInt()+1n)),n.registry.createType("DpCollatorAssignmentAssignedCollatorsPublic",{orchestratorChain:[o]}).toHex())),i.set(Q(n.query.authorNoting.didSetContainerAuthorData()),n.registry.createType("bool",!0).toHex())}return[new ue.b(n.registry,n.tx.authorInherent.kickOffAuthorshipValidation()).toHex()]}},new class{async createInherents(t,e){const r=await t.parentBlock;if(!r)throw new Error("parent block not found");const n=await r.meta;return n.tx.randomness?.setBabeRandomnessResults?[new ue.b(n.registry,n.tx.randomness.setBabeRandomnessResults()).toHex()]:[]}}],we=(_.child({name:"rpc"}),x.Ie(t=>/^0x\w+$/.test(t))),be=x.Yj().length(66).and(we);class ve extends Error{code;constructor(t,e){super(e),this.name="ResponseError",this.code=t}toJSON(){return{code:this.code,message:this.message}}}const Me=x.Ik({count:x.ai().optional(),to:x.ai().optional(),dmp:x.YO(x.Ik({sentAt:x.ai(),msg:we})).min(1).optional(),ump:x.g1(x.ai(),x.YO(we).min(1)).optional(),hrmp:x.g1(x.KC([x.ai(),x.Yj()]),x.YO(x.Ik({sentAt:x.ai(),data:we})).min(1)).optional(),transactions:x.YO(we).min(1).optional(),unsafeBlockHeight:x.ai().optional(),relayChainStateOverrides:x.YO(x.PV([we,x.KC([we,x.ch()])])).optional(),relayParentNumber:x.ai().optional()}),ke=be.or(x.ai()),Se={dev_newBlock:async(t,[e])=>{const{count:r,to:n,hrmp:i,ump:s,dmp:o,transactions:a,unsafeBlockHeight:h,relayChainStateOverrides:u,relayParentNumber:c}=Me.parse(e||{}),l=t.chain.head.number,f=n?n-l:r,d=void 0!==f?Math.max(f,1):1;let p;if(void 0!==h&&h<=l)throw new ve(1,"unsafeBlockHeight must be greater than current block height");for(let e=0;e<d;e++){const r=await t.chain.newBlock({transactions:a,horizontalMessages:i,upwardMessages:s,downwardMessages:o,unsafeBlockHeight:0===e?h:void 0,relayChainStateOverrides:u,relayParentNumber:c}).catch(t=>{throw new ve(1,t.toString())});_.debug({hash:r.hash},"dev_newBlock"),p=r.hash}return p},dev_setBlockBuildMode:async(t,[e])=>{if(_.debug({mode:se[e]},"dev_setBlockBuildMode"),void 0===se[e])throw new ve(1,`Invalid mode ${e}`);t.chain.txPool.mode=e},dev_setHead:async(t,[e])=>{const r=ke.parse(e);let n;if("number"==typeof r){const e=r>0?r:t.chain.head.number+r;n=await t.chain.getBlockAt(e)}else n=await t.chain.getBlock(r);if(!n)throw new ve(1,`Block not found ${r}`);return await t.chain.setHead(n),n.hash},dev_setRuntimeLogLevel:async(t,[e])=>{if(_.debug({runtimeLogLevel:e},"dev_setRuntimeLogLevel"),"number"!=typeof e)throw new ve(1,`Invalid runtimeLogLevel ${e}`);t.chain.runtimeLogLevel=e},dev_setStorage:async(t,e)=>{const[r,n]=e,i=await G(t.chain,r,n).catch(t=>{throw new ve(1,t.toString())});return _.debug({hash:i,values:r},"dev_setStorage"),i},dev_timeTravel:async(t,[e])=>{const r="string"==typeof e?Date.parse(e):e;if(Number.isNaN(r))throw new ve(1,"Invalid date");return await(async(t,e)=>{const r=await t.head.meta,n=await ut(t.head),i=Math.floor(e/n),s=[[Q(r.query.timestamp.now()),(0,m.X)(r.registry.createType("u64",e).toU8a())]];if(r.consts.babe){s.push([Q(r.query.babe.currentSlot()),(0,m.X)(r.registry.createType("Slot",i).toU8a())]);const t=r.consts.babe.epochDuration.toNumber(),n=Math.floor(e/t);s.push([Q(r.query.babe.epochIndex()),(0,m.X)(r.registry.createType("u64",n).toU8a())])}else r.query.aura&&s.push([Q(r.query.aura.currentSlot()),(0,m.X)(r.registry.createType("Slot",i).toU8a())]);await G(t,s)})(t.chain,r),r}},Ee=Se;var xe=r(87004),Re=r(44284);const Ae=({parentHash:t,number:e,stateRoot:r,extrinsicsRoot:n,digest:i})=>({parentHash:t.toHex(),number:e.toHex(),stateRoot:r.toHex(),extrinsicsRoot:n.toHex(),digest:{logs:i.logs.map(t=>t.toHex())}}),_e=async(t,[e])=>{const r=Array.isArray(e)?e:[e],n=await Promise.all(r.map(t=>(0,xe.qv)(t,void 0,!0)?(0,Re.M)(t):t).map(e=>t.chain.getBlockAt(e))).then(t=>t.map(t=>t?.hash||null));return Array.isArray(e)?n:n[0]},Be=async(t,[e])=>{const r=await t.chain.getBlock(e);if(!r)throw new ve(1,`Block ${e} not found`);return Ae(await r.header)},Te=async(t,[e])=>{const r=await t.chain.getBlock(e);if(!r)throw new ve(1,`Block ${e} not found`);return{block:{header:Ae(await r.header),extrinsics:await r.extrinsics},justifications:null}},Oe=async t=>t.chain.head.hash,Ce=async(t,e,{subscribe:r})=>{let n=()=>{};const i=t.chain.headState.subscribeHead(()=>n()),s=r("chain_newHead",i,()=>t.chain.headState.unsubscribeHead(i));return n=async()=>{s(Ae(await t.chain.head.header))},setTimeout(n,50),i},Pe=async(t,e,{subscribe:r})=>{let n=()=>{};const i=t.chain.headState.subscribeHead(()=>n()),s=r("chain_finalizedHead",i,()=>t.chain.headState.unsubscribeHead(i));return n=async()=>{s(Ae(await t.chain.head.header))},setTimeout(n,50),i},Ie=async(t,[e],{unsubscribe:r})=>{r(e)},Ne=_e,Le=Ce,De=Ie,Ue=Ie,He=async(t,[e])=>{const r=await t.chain.getBlock(e);if(!r)throw new ve(1,`Block ${e} not found`);return await r.extrinsics},je=async(t,[e,r,n])=>{const i=await t.chain.getBlock(e);if(!i)throw new ve(1,`Block ${e} not found`);return{success:!0,value:(await i.call(r,[n])).result}},Fe=_e;async function qe(t,e){const r=await t.getKeysPaged({...e,pageSize:ze}),n=(await t.getMany(r)).map((t,e)=>({key:r[e],value:t}));return r.length<ze?{items:n,next:null}:{items:n,next:{...e,startKey:r[ze-1]}}}const ze=1e3;async function Ve(t){await new Promise(t=>setTimeout(t,0)),t()}const We=async(...t)=>He(...t).catch(()=>null),$e=async(...t)=>je.call(void 0,...t).then(({value:t})=>({success:!0,value:t}),t=>function(t){return t instanceof ve&&1===t.code}(t)?null:{success:!1,error:t}),Ke=t=>Promise.resolve(t.chain.head.number),Je=async t=>(await t.chain.getBlockAt(0)).hash,Ze=async(t,[e])=>{const r=await t.chain.getBlockAt(e);return r?[r.hash]:[]},Xe=async(t,[e])=>{const r=await t.chain.getBlock(e);return r?(await r.header).toHex():null},Ge=new Map,Qe=async(t,[e,r,n],{subscribe:i})=>{const s=vt(),o=i("chainHead_v1_storageEvent",s,()=>Ge.delete(s));return Ge.set(s,{callback:o,hash:e,params:[],storageDiffs:new Map}),Ve(async()=>{const n=await t.chain.getBlock(e);n?(await Promise.all(r.map(async t=>{switch(t.type){case"value":{const e=await n.get(t.key);return e&&Ge.get(s)?.callback({event:"storage",key:t.key,value:e}),null}case"hash":return await n.get(t.key)&&Ge.get(s)?.callback({event:"storage",key:t.key,hash:e}),null;case"descendantsValues":{let e,r={prefix:t.key,startKey:"0x"};do{({items:e,next:r}=await qe(n,r));for(const{key:t,value:r}of e)Ge.get(s)?.callback({event:"storage",key:t,value:r})}while(null!==r);return null}case"descendantsHashes":{let e,r={prefix:t.key,startKey:"0x"};do{({items:e,next:r}=await qe(n,r));for(const{key:t,value:r}of e)void 0!==r&&Ge.get(s)?.callback({event:"storage",key:t,hash:(0,q.X)(r)})}while(null!==r);return null}case"closestDescendantMerkleValue":{const e=Ge.get(s);return e?(e.storageDiffs.has(t.key)||e.storageDiffs.set(t.key,0),e.callback({event:"storage",operationId:s,items:[{key:t.key,closestDescendantMerkleValue:String(e.storageDiffs.get(t.key))}]}),null):null}}})),Ge.get(s)?.callback({event:"storageDone"})):Ge.get(s)?.callback({event:"storageError",operationId:s,error:"Block not found"})}),s},Ye=async(t,[e],{unsubscribe:r})=>(r(e),null),tr=_.child({name:"rpc-chainHead_v1"}),er=new Map,rr=async(t,[e],{subscribe:r})=>{const n=t.chain.headState.subscribeHead(async t=>{tr.trace({hash:t.hash},"chainHead_v1_follow");const r=e?await(async()=>{const[e,r]=await Promise.all([t.runtimeVersion,t.parentBlock.then(t=>t?.runtimeVersion)]);return e.implVersion!==r?.implVersion||e.specVersion!==r.specVersion?e:null})():null;i({event:"newBlock",blockHash:t.hash,parentBlockHash:(await t.parentBlock)?.hash,newRuntime:r}),i({event:"bestBlockChanged",bestBlockHash:t.hash}),i({event:"finalized",finalizedBlockHashes:[t.hash],prunedBlockHashes:[]});const s=er.get(n)?.storageDiffs;if(s?.size){const e=Object.keys(await t.storageDiff());for(const[t,r]of s.entries())e.some(e=>e.startsWith(t))&&s.set(t,r+1)}}),i=r("chainHead_v1_followEvent",n,()=>{t.chain.headState.unsubscribeHead(n),er.delete(n)});return er.set(n,{callback:i,pendingDescendantValues:new Map,storageDiffs:new Map}),Ve(async()=>{i({event:"initialized",finalizedBlockHashes:[t.chain.head.hash],finalizedBlockRuntime:e?await t.chain.head.runtimeVersion:null}),i({event:"bestBlockChanged",bestBlockHash:t.chain.head.hash})}),n},nr=async(t,[e],{unsubscribe:r})=>(r(e),null),ir=async(t,[e,r])=>{if(!er.has(e))return null;const n=await t.chain.getBlock(r);return n?(await n.header).toHex():null},sr=t=>({result:"started",operationId:t}),or=()=>Math.random().toString(36).substring(2),ar=async(t,[e,r,n,i])=>{const s=or();return Ve(async()=>{const o=await t.chain.getBlock(r);if(o)try{const t=await o.call(n,[i]);er.get(e)?.callback({event:"operationCallDone",operationId:s,output:t.result})}catch(t){er.get(e)?.callback({event:"operationError",operationId:s,error:t.message})}else er.get(e)?.callback({event:"operationError",operationId:s,error:`Block ${r} not found`})}),sr(s)},hr=async(t,[e,r,n,i])=>{const s=or();return Ve(async()=>{const i=await t.chain.getBlock(r);if(!i)return void er.get(e)?.callback({event:"operationError",operationId:s,error:"Block not found"});const o=await Promise.all(n.map(async t=>{switch(t.type){case"value":{const r=await i.get(t.key);return r&&er.get(e)?.callback({event:"operationStorageItems",operationId:s,items:[{key:t.key,value:r}]}),null}case"hash":{const r=await i.get(t.key);return r&&er.get(e)?.callback({event:"operationStorageItems",operationId:s,items:[{key:t.key,hash:(0,q.X)(r)}]}),null}case"descendantsValues":{const{items:r,next:n}=await qe(i,{prefix:t.key,startKey:"0x"});return er.get(e)?.callback({event:"operationStorageItems",operationId:s,items:r}),n}case"descendantsHashes":{const{items:r,next:n}=await qe(i,{prefix:t.key,startKey:"0x"});return er.get(e)?.callback({event:"operationStorageItems",operationId:s,items:r.map(({key:t,value:e})=>({key:t,hash:void 0!==e?(0,q.X)(e):void 0}))}),n?{...n,isDescendantHashes:!0}:null}case"closestDescendantMerkleValue":{const r=er.get(e);return r?(r.storageDiffs.has(t.key)||r.storageDiffs.set(t.key,0),r.callback({event:"operationStorageItems",operationId:s,items:[{key:t.key,closestDescendantMerkleValue:String(r.storageDiffs.get(t.key))}]}),null):null}}})),a=o.filter(t=>null!==t);if(a.length){const t=er.get(e);t&&(t.pendingDescendantValues.set(s,{hash:r,params:a}),t.callback({event:"operationWaitingForContinue",operationId:s}))}else er.get(e)?.callback({event:"operationStorageDone",operationId:s})}),{...sr(s),discardedItems:0}},ur={result:"limitReached"},cr=async(t,[e,r])=>{if(!er.has(e))return ur;const n=await t.chain.getBlock(r);if(!n)throw new ve(-32801,"Block not found");const i=or();return Ve(async()=>{const t=await n.extrinsics;er.get(e)?.callback({event:"operationBodyDone",operationId:i,value:t})}),sr(i)},lr=async(t,[e,r])=>{const n=er.get(e),i=n?.pendingDescendantValues.get(r);if(!i||!n)throw new ve(-32803,"Operation ID doesn't have anything pending");const s=await t.chain.getBlock(i.hash);if(!s)throw new ve(-32801,"Block not found");return Ve(async()=>{const t=(await Promise.all(i.params.map(async t=>{const{items:e,next:i}=await qe(s,t);return n.callback({event:"operationStorageItems",operationId:r,items:t.isDescendantHashes?e.map(({key:t,value:e})=>({key:t,hash:void 0!==e?(0,q.X)(e):e})):e}),i}))).filter(t=>null!==t);t.length?(n.pendingDescendantValues.set(r,{hash:i.hash,params:t}),n.callback({event:"operationWaitingForContinue",operationId:r})):(n.pendingDescendantValues.delete(r),n.callback({event:"operationStorageDone",operationId:r}))}),null},fr=async(t,[e,r])=>(er.get(e)?.pendingDescendantValues.delete(r),null),dr=async(t,[e,r])=>null,pr=async t=>t.chain.api.getSystemChain(),mr=async t=>{const e=await t.chain.api.getBlockHash(0);if(null===e)throw new ve(1,"Unexpected null genesis hash");return e},gr=async t=>t.chain.api.getSystemProperties(),yr=_.child({name:"rpc-transaction_v1"}),wr=async(t,[e])=>(await t.chain.submitExtrinsic(e).catch(t=>{yr.warn("Submit extrinsic failed",t)}),Math.random().toString(36).substring(2)),br=async(t,[e])=>null,vr={...s,...o,...h,...a},Mr=_.child({name:"rpc-author"}),kr=async(t,[e])=>t.chain.submitExtrinsic(e).catch(t=>{const e=t.isInvalid?1010:1011;throw new ve(e,t.toString())}),Sr=async(t,[e],{subscribe:r,unsubscribe:n})=>{let i=t=>{};const s=t.chain.headState.subscribeHead(t=>i(t)),o=r("author_extrinsicUpdate",s,()=>t.chain.headState.unsubscribeHead(s)),a=([t,r])=>{t===e&&(o(r.toJSON()),h(s))};t.chain.txPool.event.on(ie,a);const h=e=>{t.chain.txPool.event.removeListener(ie,a),n(e)};i=async t=>{(await t.extrinsics).includes(e)&&(Mr.debug({block:t.hash},"author_extrinsicUpdate"),o({inBlock:t.hash}),await new Promise(t=>setTimeout(t,100)),o({finalized:t.hash}),h(s))};try{await t.chain.submitExtrinsic(e),setTimeout(()=>{o({ready:null}),o({broadcast:["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"]})},50)}catch(t){Mr.error({error:t},"ExtrinsicFailed");const e=t.isInvalid?1010:1011;throw h(s),new ve(e,t.toString())}return s},Er=async(t,[e],{unsubscribe:r})=>{r(e)},xr=async t=>t.chain.txPool.pendingExtrinsics,Rr=async(t,[e,r])=>{const n=await t.chain.getBlock(r);if(!n)throw new ve(1,`Block ${r} not found`);const i=await n.registry,s=(0,M.V)(e);return(await n.call("TransactionPaymentApi_query_fee_details",[i.createType("Extrinsic",s).toHex(),i.createType("u32",s.byteLength).toHex()])).result},Ar=async(t,[e,r])=>{const n=await t.chain.getBlock(r);if(!n)throw new ve(1,`Block ${r} not found`);const i=await n.registry,s=(0,M.V)(e);return(await n.call("TransactionPaymentApi_query_info",[i.createType("Extrinsic",s).toHex(),i.createType("u32",s.byteLength).toHex()])).result},_r=_.child({name:"rpc-state"}),Br=async(t,[e])=>{const r=await t.chain.getBlock(e);return r?.runtimeVersion||null},Tr=async(t,[e])=>{const r=await t.chain.getBlock(e);return r?.metadata||null},Or=async(t,[e,r])=>{const n=await t.chain.getBlock(r);return await(n?.get(e))||null},Cr=async(t,[e,r,n,i])=>{const s=await t.chain.getBlock(i);return s?.getKeysPaged({prefix:e,pageSize:r,startKey:n})},Pr=async(t,[e,r])=>{const n=await t.chain.getBlock(r);if(!n)return[];const i=await Promise.all(e.map(async t=>[t,await n.get(t).then(t=>t||null)]));return[{block:n.hash,changes:i}]},Ir=async(t,[e,r,n])=>{const i=await t.chain.getBlock(n);if(!i)throw new ve(1,`Block ${n} not found`);return(await i.call(e,[r])).result},Nr=async(t,e,{subscribe:r})=>{let n=t=>{};const i=await t.chain.headState.subscribeStorage([(0,F.i)(":code")],t=>n(t)),s=r("state_runtimeVersion",i,()=>t.chain.headState.unsubscribeStorage(i));return n=async t=>s(await t.runtimeVersion),(async()=>{n(t.chain.head)})(),i},Lr=async(t,[e],{unsubscribe:r})=>{r(e)},Dr=async(t,[e],{subscribe:r})=>{let n=(t,e)=>{};const i=await t.chain.headState.subscribeStorage(e,(t,e)=>n(t,e)),s=r("state_storage",i,()=>t.chain.headState.unsubscribeStorage(i));return n=async(t,e)=>{_r.trace({hash:t.hash},"state_subscribeStorage"),s({block:t.hash,changes:e})},(async()=>{const r=await Promise.all(e.map(async e=>[e,await t.chain.head.get(e)||null]));s({block:t.chain.head.hash,changes:r})})(),i},Ur=async(t,[e],{unsubscribe:r})=>{r(e)},Hr=async(t,[e,r,n])=>{if(!it(e))throw new ve(-32e3,"Client error: Invalid child storage key");const i=await t.chain.getBlock(n);return await(i?.get(nt(e,r)))||null},jr=async(t,[e,r,n,i,s])=>{if(!it(e))throw new ve(-32e3,"Client error: Invalid child storage key");const o=await t.chain.getBlock(s);return o?.getKeysPaged({prefix:nt(e,r),pageSize:n,startKey:nt(e,i)}).then(t=>t.map(ot))},Fr=Or,qr=async()=>"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",zr=async()=>["Full"],Vr=async()=>[],Wr=async t=>t.chain.api.getSystemChain(),$r=async t=>t.chain.api.getSystemProperties(),Kr=async t=>t.chain.api.getSystemName(),Jr=async t=>"chopsticks-v1",Zr=async t=>"Development",Xr=async()=>({peers:0,isSyncing:!1,shouldHavePeers:!1}),Gr=async(t,[e,r])=>{const{outcome:n}=await t.chain.dryRunExtrinsic(e,r);return n.toHex()},Qr=async(t,[e])=>{const r=t.chain.head,n=await r.registry,i=n.createType("AccountId",e),s=await r.call("AccountNonceApi_account_nonce",[i.toHex()]);return n.createType("Index",(0,M.V)(s.result)).toNumber()+t.chain.txPool.pendingExtrinsicsBy(e).length},Yr={...{...i,...u,...n,...c,...l,...f},...vr,...Ee,rpc_methods:async()=>Promise.resolve({version:1,methods:Object.keys(Yr).sort()})};var tn=r(63145),en=r(34502);const rn={...Yr},nn=_.child({name:"[Chopsticks provider]"});class sn{chain;#G=!1;#Q=new re.b;#Y;#tt={};constructor(t){this.chain=t,this.#Y=new Promise((t,e)=>{this.#Q.once("connected",t),this.#Q.once("error",e),this.connect()})}static fromEndpoint=async(t,e,r)=>new sn(await(async t=>{const{api:e,blockHash:r,...n}=await(async t=>{let e;_.debug(t,"Setup options"),e=t.genesis?t.genesis:"string"==typeof t.endpoint&&/^(https|http):\/\//.test(t.endpoint||"")?new tn.e(t.endpoint):new en.E(t.endpoint,3e3,void 0,t.rpcTimeout);const r=new ct(e);let n;if(r.onFetching(t.hooks?.apiFetching),await r.isReady,null==t.block)n=await r.getFinalizedHead().then(t=>{if(!t)throw new Error("Cannot find block hash");return t});else if("string"==typeof t.block&&t.block.startsWith("0x"))n=t.block;else{if(!Number.isInteger(+t.block))throw new Error(`Invalid block number or hash: ${t.block}`);n=await r.getBlockHash(Number(t.block)).then(e=>{if(!e)throw new Error(`Cannot find block hash for ${t.block}`);return e})}return _.debug({...t,blockHash:n},"Args"),{...t,blockHash:n,api:r}})(t),i=await e.getHeader(r);if(!i)throw new Error(`Cannot find header for ${r}`);const s=new he({api:e,buildBlockMode:n.buildBlockMode,inherentProviders:ye,db:n.db,header:{hash:r,number:Number(i.number)},mockSignatureHost:n.mockSignatureHost,allowUnresolvedImports:n.allowUnresolvedImports,runtimeLogLevel:n.runtimeLogLevel,registeredTypes:n.registeredTypes||{},offchainWorker:n.offchainWorker,maxMemoryBlockCount:n.maxMemoryBlockCount,processQueuedMessages:n.processQueuedMessages,saveBlocks:n.saveBlocks});return n.genesis&&await s.newBlock(),s})({endpoint:t,mockSignatureHost:!0,block:e,db:r}));get hasSubscriptions(){return!0}get isClonable(){return!0}get isConnected(){return this.#G}get isReady(){return this.#Y}clone=()=>new sn(this.chain);connect=async()=>{this.#G=!0,this.#Q.emit("connected")};disconnect=async()=>{this.#G=!1,this.#Q.emit("disconnected")};on=(t,e)=>(this.#Q.on(t,e),()=>{this.#Q.removeListener(t,e)});subscriptionManager={subscribe:(t,e,r=()=>{})=>{const n=this.#tt[e];return n&&(n.onCancel=r),r=>{nn.debug("subscribe-callback",t,e,r);const n=this.#tt[e];n?n.callback(null,r):nn.trace(`Unable to find active subscription=${e}`)}},unsubscribe:t=>{nn.debug("unsubscribe-callback",t);const e=this.#tt[t];e?(e.onCancel?.(),delete this.#tt[t]):nn.trace(`Unable to find active subscription=${t}`)}};send=async(t,e,r,n)=>{try{nn.debug("send",{method:t,params:e});const r=rn[t];if(!r)throw nn.error(`Unable to find rpc handler=${t}`),new Error(`Unable to find rpc handler=${t}`);if(n){nn.debug("subscribe",{method:t,params:e});const i=await r({chain:this.chain},e,this.subscriptionManager);if(!i)throw new Error(`Unable to subscribe=${t}`);return this.#tt[i]={callback:n.callback,method:t,params:e,type:n.type},i}return nn.debug("call",{method:t,params:e}),r({chain:this.chain},e,this.subscriptionManager)}catch(t){throw nn.error("send error.",t),t}};subscribe(t,e,r,n){return this.send(e,r,!1,{callback:n,type:t})}async unsubscribe(t,e,r){if(!this.#tt[r])return nn.trace(`Unable to find active subscription=${r}`),!1;try{return this.send(e,[r])}catch{return!1}}}x.Ik({id:x.Yj(),name:x.Yj(),properties:x.Ik({ss58Format:x.ai().optional(),tokenDecimals:x.KC([x.ai(),x.YO(x.ai())]).optional(),tokenSymbol:x.KC([x.Yj(),x.YO(x.Yj())]).optional()}),genesis:x.Ik({raw:x.Ik({top:x.g1(x.Yj())})})}),_.child({name:"xcm"})},14834(t,e,r){"use strict";var n=r(69501),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},17233(t){"use strict";const e=async function*(){}.constructor;t.exports=()=>e},17545(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{A:()=>n})},17826(t,e,r){"use strict";r.d(e,{A:()=>i});var n=r(72715);function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=(0,n.A)(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(arguments.length<3?t:r):s.value}},i.apply(null,arguments)}},24586(t,e,r){"use strict";r.d(e,{A:()=>i});var n=r(68515);function i(t,e,r){return(e=(0,n.A)(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},30414(t,e,r){"use strict";r.d(e,{A:()=>s});var n=r(68515);function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(0,n.A)(i.key),i)}}function s(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}},47048(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=r(93553);if("function"!=typeof s.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){}},47764(t,e,r){"use strict";var n=r(39907),i=r(1048).Buffer;function s(t,e){return function(){return t.apply(e,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:h,toStringTag:u}=Symbol,c=(l=Object.create(null),t=>{const e=o.call(t);return l[e]||(l[e]=e.slice(8,-1).toLowerCase())});var l;const f=t=>(t=t.toLowerCase(),e=>c(e)===t),d=t=>e=>typeof e===t,{isArray:p}=Array,m=d("undefined");function g(t){return null!==t&&!m(t)&&null!==t.constructor&&!m(t.constructor)&&b(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const y=f("ArrayBuffer"),w=d("string"),b=d("function"),v=d("number"),M=t=>null!==t&&"object"==typeof t,k=t=>{if("object"!==c(t))return!1;const e=a(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||u in t||h in t)},S=f("Date"),E=f("File"),x=f("Blob"),R=f("FileList"),A=f("URLSearchParams"),[_,B,T,O]=["ReadableStream","Request","Response","Headers"].map(f);function C(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,i;if("object"!=typeof t&&(t=[t]),p(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(g(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let o;for(n=0;n<s;n++)o=i[n],e.call(null,t[o],o,t)}}function P(t,e){if(g(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n,i=r.length;for(;i-- >0;)if(n=r[i],e===n.toLowerCase())return n;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,N=t=>!m(t)&&t!==I,L=(D="undefined"!=typeof Uint8Array&&a(Uint8Array),t=>D&&t instanceof D);var D;const U=f("HTMLFormElement"),H=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),j=f("RegExp"),F=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};C(r,(r,i)=>{let s;!1!==(s=e(r,i,t))&&(n[i]=s||r)}),Object.defineProperties(t,n)},q=f("AsyncFunction"),z=(V="function"==typeof setImmediate,W=b(I.postMessage),V?setImmediate:W?($=`axios@${Math.random()}`,K=[],I.addEventListener("message",({source:t,data:e})=>{t===I&&e===$&&K.length&&K.shift()()},!1),t=>{K.push(t),I.postMessage($,"*")}):t=>setTimeout(t));var V,W,$,K;const J="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):void 0!==n&&n.nextTick||z;var Z={isArray:p,isArrayBuffer:y,isBuffer:g,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||b(t.append)&&("formdata"===(e=c(t))||"object"===e&&b(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&y(t.buffer),e},isString:w,isNumber:v,isBoolean:t=>!0===t||!1===t,isObject:M,isPlainObject:k,isEmptyObject:t=>{if(!M(t)||g(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:_,isRequest:B,isResponse:T,isHeaders:O,isUndefined:m,isDate:S,isFile:E,isBlob:x,isRegExp:j,isFunction:b,isStream:t=>M(t)&&b(t.pipe),isURLSearchParams:A,isTypedArray:L,isFileList:R,forEach:C,merge:function t(){const{caseless:e,skipUndefined:r}=N(this)&&this||{},n={},i=(i,s)=>{const o=e&&P(n,s)||s;k(n[o])&&k(i)?n[o]=t(n[o],i):k(i)?n[o]=t({},i):p(i)?n[o]=i.slice():r&&m(i)||(n[o]=i)};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&C(arguments[t],i);return n},extend:(t,e,r,{allOwnKeys:n}={})=>(C(e,(e,n)=>{r&&b(e)?t[n]=s(e,r):t[n]=e},{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let i,s,o;const h={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],n&&!n(o,t,e)||h[o]||(e[o]=t[o],h[o]=!0);t=!1!==r&&a(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:c,kindOfTest:f,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(p(t))return t;let e=t.length;if(!v(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[h]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:U,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:F,freezeMethods:t=>{F(t,(e,r)=>{if(b(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];b(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach(t=>{r[t]=!0})};return p(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,r){return e.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:P,global:I,isContextDefined:N,isSpecCompliantForm:function(t){return!!(t&&b(t.append)&&"FormData"===t[u]&&t[h])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(M(t)){if(e.indexOf(t)>=0)return;if(g(t))return t;if(!("toJSON"in t)){e[n]=t;const i=p(t)?[]:{};return C(t,(t,e)=>{const s=r(t,n+1);!m(s)&&(i[e]=s)}),e[n]=void 0,i}}return t};return r(t,0)},isAsyncFn:q,isThenable:t=>t&&(M(t)||b(t))&&b(t.then)&&b(t.catch),setImmediate:z,asap:J,isIterable:t=>null!=t&&b(t[h])};function X(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}Z.inherits(X,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const G=X.prototype,Q={};function Y(t){return Z.isPlainObject(t)||Z.isArray(t)}function tt(t){return Z.endsWith(t,"[]")?t.slice(0,-2):t}function et(t,e,r){return t?t.concat(e).map(function(t,e){return t=tt(t),!r&&e?"["+t+"]":t}).join(r?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Q[t]={value:t}}),Object.defineProperties(X,Q),Object.defineProperty(G,"isAxiosError",{value:!0}),X.from=(t,e,r,n,i,s)=>{const o=Object.create(G);Z.toFlatObject(t,o,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t);const a=t&&t.message?t.message:"Error",h=null==e&&t?t.code:e;return X.call(o,a,h,r,n,i),t&&null==o.cause&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",s&&Object.assign(o,s),o};const rt=Z.toFlatObject(Z,{},null,function(t){return/^is[A-Z]/.test(t)});function nt(t,e,r){if(!Z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=Z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!Z.isUndefined(e[t])})).metaTokens,s=r.visitor||c,o=r.dots,a=r.indexes,h=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(e);if(!Z.isFunction(s))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(Z.isDate(t))return t.toISOString();if(Z.isBoolean(t))return t.toString();if(!h&&Z.isBlob(t))throw new X("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(t)||Z.isTypedArray(t)?h&&"function"==typeof Blob?new Blob([t]):i.from(t):t}function c(t,r,i){let s=t;if(t&&!i&&"object"==typeof t)if(Z.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(Z.isArray(t)&&function(t){return Z.isArray(t)&&!t.some(Y)}(t)||(Z.isFileList(t)||Z.endsWith(r,"[]"))&&(s=Z.toArray(t)))return r=tt(r),s.forEach(function(t,n){!Z.isUndefined(t)&&null!==t&&e.append(!0===a?et([r],n,o):null===a?r:r+"[]",u(t))}),!1;return!!Y(t)||(e.append(et(i,r,o),u(t)),!1)}const l=[],f=Object.assign(rt,{defaultVisitor:c,convertValue:u,isVisitable:Y});if(!Z.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!Z.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Z.forEach(r,function(r,i){!0===(!(Z.isUndefined(r)||null===r)&&s.call(e,r,Z.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])}),l.pop()}}(t),e}function it(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function st(t,e){this._pairs=[],t&&nt(t,this,e)}const ot=st.prototype;function at(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(t,e,r){if(!e)return t;const n=r&&r.encode||at;Z.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(s=i?i(e,r):Z.isURLSearchParams(e)?e.toString():new st(e,r).toString(n),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}ot.append=function(t,e){this._pairs.push([t,e])},ot.toString=function(t){const e=t?function(e){return t.call(this,e,it)}:it;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};var ut=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,function(e){null!==e&&t(e)})}},ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:st,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ft="undefined"!=typeof window&&"undefined"!=typeof document,dt="object"==typeof navigator&&navigator||void 0,pt=ft&&(!dt||["ReactNative","NativeScript","NS"].indexOf(dt.product)<0),mt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,gt=ft&&window.location.href||"http://localhost";var yt={...Object.freeze({__proto__:null,hasBrowserEnv:ft,hasStandardBrowserWebWorkerEnv:mt,hasStandardBrowserEnv:pt,navigator:dt,origin:gt}),...lt};function wt(t){function e(t,r,n,i){let s=t[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=t.length;return s=!s&&Z.isArray(n)?n.length:s,a?(Z.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!o):(n[s]&&Z.isObject(n[s])||(n[s]=[]),e(t,r,n[s],i)&&Z.isArray(n[s])&&(n[s]=function(t){const e={},r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],e[s]=t[s];return e}(n[s])),!o)}if(Z.isFormData(t)&&Z.isFunction(t.entries)){const r={};return Z.forEachEntry(t,(t,n)=>{e(function(t){return Z.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),n,r,0)}),r}return null}const bt={transitional:ct,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,i=Z.isObject(t);if(i&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return n?JSON.stringify(wt(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return nt(t,new yt.classes.URLSearchParams,{visitor:function(t,e,r,n){return yt.isNode&&Z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((s=Z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return nt(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||n?(e.setContentType("application/json",!1),function(t){if(Z.isString(t))try{return(0,JSON.parse)(t),Z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||bt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(t){if(r){if("SyntaxError"===t.name)throw X.from(t,X.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],t=>{bt.headers[t]={}});var vt=bt;const Mt=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kt=Symbol("internals");function St(t){return t&&String(t).trim().toLowerCase()}function Et(t){return!1===t||null==t?t:Z.isArray(t)?t.map(Et):String(t)}function xt(t,e,r,n,i){return Z.isFunction(n)?n.call(this,e,r):(i&&(e=r),Z.isString(e)?Z.isString(n)?-1!==e.indexOf(n):Z.isRegExp(n)?n.test(e):void 0:void 0)}class Rt{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function i(t,e,r){const i=St(e);if(!i)throw new Error("header name must be a non-empty string");const s=Z.findKey(n,i);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||e]=Et(t))}const s=(t,e)=>Z.forEach(t,(t,r)=>i(t,r,e));if(Z.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(Z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let r,n,i;return t&&t.split("\n").forEach(function(t){i=t.indexOf(":"),r=t.substring(0,i).trim().toLowerCase(),n=t.substring(i+1).trim(),!r||e[r]&&Mt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e})(t),e);else if(Z.isObject(t)&&Z.isIterable(t)){let r,n,i={};for(const e of t){if(!Z.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[n=e[0]]=(r=i[n])?Z.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}s(i,e)}else null!=t&&i(e,t,r);return this}get(t,e){if(t=St(t)){const r=Z.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(Z.isFunction(e))return e.call(this,t,r);if(Z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=St(t)){const r=Z.findKey(this,t);return!(!r||void 0===this[r]||e&&!xt(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function i(t){if(t=St(t)){const i=Z.findKey(r,t);!i||e&&!xt(0,r[i],i,e)||(delete r[i],n=!0)}}return Z.isArray(t)?t.forEach(i):i(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const i=e[r];t&&!xt(0,this[i],i,t,!0)||(delete this[i],n=!0)}return n}normalize(t){const e=this,r={};return Z.forEach(this,(n,i)=>{const s=Z.findKey(r,i);if(s)return e[s]=Et(n),void delete e[i];const o=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}(i):String(i).trim();o!==i&&delete e[i],e[o]=Et(n),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Z.forEach(this,(r,n)=>{null!=r&&!1!==r&&(e[n]=t&&Z.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach(t=>r.set(t)),r}static accessor(t){const e=(this[kt]=this[kt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=St(t);e[n]||(function(t,e){const r=Z.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(t,r,i){return this[n].call(this,e,t,r,i)},configurable:!0})})}(r,t),e[n]=!0)}return Z.isArray(t)?t.forEach(n):n(t),this}}Rt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(Rt.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}}),Z.freezeMethods(Rt);var At=Rt;function _t(t,e){const r=this||vt,n=e||r,i=At.from(n.headers);let s=n.data;return Z.forEach(t,function(t){s=t.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Bt(t){return!(!t||!t.__CANCEL__)}function Tt(t,e,r){X.call(this,null==t?"canceled":t,X.ERR_CANCELED,e,r),this.name="CanceledError"}function Ot(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new X("Request failed with status code "+r.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}Z.inherits(Tt,X,{__CANCEL__:!0});const Ct=(t,e,r=3)=>{let n=0;const i=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i,s=0,o=0;return e=void 0!==e?e:1e3,function(a){const h=Date.now(),u=n[o];i||(i=h),r[s]=a,n[s]=h;let c=o,l=0;for(;c!==s;)l+=r[c++],c%=t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),h-i<e)return;const f=u&&h-u;return f?Math.round(1e3*l/f):void 0}}(50,250);return function(r,s){let o,a,h=0,u=1e3/s;const c=(r,s=Date.now())=>{h=s,o=null,a&&(clearTimeout(a),a=null),(r=>{const s=r.loaded,o=r.lengthComputable?r.total:void 0,a=s-n,h=i(a);n=s,t({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:h||void 0,estimated:h&&o&&s<=o?(o-s)/h:void 0,event:r,lengthComputable:null!=o,[e?"download":"upload"]:!0})})(...r)};return[(...t)=>{const e=Date.now(),r=e-h;r>=u?c(t,e):(o=t,a||(a=setTimeout(()=>{a=null,c(o)},u-r)))},()=>o&&c(o)]}(0,r)},Pt=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},It=t=>(...e)=>Z.asap(()=>t(...e));var Nt=yt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,yt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,Lt=yt.hasStandardBrowserEnv?{write(t,e,r,n,i,s,o){if("undefined"==typeof document)return;const a=[`${t}=${encodeURIComponent(e)}`];Z.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),Z.isString(n)&&a.push(`path=${n}`),Z.isString(i)&&a.push(`domain=${i}`),!0===s&&a.push("secure"),Z.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(t){if("undefined"==typeof document)return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Dt(t,e,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Ut=t=>t instanceof At?{...t}:t;function Ht(t,e){e=e||{};const r={};function n(t,e,r,n){return Z.isPlainObject(t)&&Z.isPlainObject(e)?Z.merge.call({caseless:n},t,e):Z.isPlainObject(e)?Z.merge({},e):Z.isArray(e)?e.slice():e}function i(t,e,r,i){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:n(void 0,t,0,i):n(t,e,0,i)}function s(t,e){if(!Z.isUndefined(e))return n(void 0,e)}function o(t,e){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(r,i,s){return s in e?n(r,i):s in t?n(void 0,r):void 0}const h={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(t,e,r)=>i(Ut(t),Ut(e),0,!0)};return Z.forEach(Object.keys({...t,...e}),function(n){const s=h[n]||i,o=s(t[n],e[n],n);Z.isUndefined(o)&&s!==a||(r[n]=o)}),r}var jt=t=>{const e=Ht({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;if(e.headers=o=At.from(o),e.url=ht(Dt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Z.isFormData(r))if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(Z.isFunction(r.getHeaders)){const t=r.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach(([t,r])=>{e.includes(t.toLowerCase())&&o.set(t,r)})}if(yt.hasStandardBrowserEnv&&(n&&Z.isFunction(n)&&(n=n(e)),n||!1!==n&&Nt(e.url))){const t=i&&s&&Lt.read(s);t&&o.set(i,t)}return e},Ft="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,r){const n=jt(t);let i=n.data;const s=At.from(n.headers).normalize();let o,a,h,u,c,{responseType:l,onUploadProgress:f,onDownloadProgress:d}=n;function p(){u&&u(),c&&c(),n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const n=At.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ot(function(t){e(t),p()},function(t){r(t),p()},{data:l&&"text"!==l&&"json"!==l?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:t,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(r(new X("Request aborted",X.ECONNABORTED,t,m)),m=null)},m.onerror=function(e){const n=new X(e&&e.message?e.message:"Network Error",X.ERR_NETWORK,t,m);n.event=e||null,r(n),m=null},m.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||ct;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new X(e,i.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,t,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&Z.forEach(s.toJSON(),function(t,e){m.setRequestHeader(e,t)}),Z.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),l&&"json"!==l&&(m.responseType=n.responseType),d&&([h,c]=Ct(d,!0),m.addEventListener("progress",h)),f&&m.upload&&([a,u]=Ct(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(o=e=>{m&&(r(!e||e.type?new Tt(null,t,m):e),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));const y=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);y&&-1===yt.protocols.indexOf(y)?r(new X("Unsupported protocol "+y+":",X.ERR_BAD_REQUEST,t)):m.send(i||null)})},qt=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const i=function(t){if(!r){r=!0,o();const e=t instanceof Error?t:this.reason;n.abort(e instanceof X?e:new Tt(e instanceof Error?e.message:e))}};let s=e&&setTimeout(()=>{s=null,i(new X(`timeout ${e} of ms exceeded`,X.ETIMEDOUT))},e);const o=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)}),t=null)};t.forEach(t=>t.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=()=>Z.asap(o),a}};const zt=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,i=0;for(;i<r;)n=i+e,yield t.slice(i,n),i=n},Vt=(t,e,r,n)=>{const i=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*zt(r,e)}(t,e);let s,o=0,a=t=>{s||(s=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await i.next();if(e)return a(),void t.close();let s=n.byteLength;if(r){let t=o+=s;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:t=>(a(t),i.return())},{highWaterMark:2})},{isFunction:Wt}=Z,$t=(({Request:t,Response:e})=>({Request:t,Response:e}))(Z.global),{ReadableStream:Kt,TextEncoder:Jt}=Z.global,Zt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Xt=t=>{t=Z.merge.call({skipUndefined:!0},$t,t);const{fetch:e,Request:r,Response:n}=t,i=e?Wt(e):"function"==typeof fetch,s=Wt(r),o=Wt(n);if(!i)return!1;const a=i&&Wt(Kt),h=i&&("function"==typeof Jt?(u=new Jt,t=>u.encode(t)):async t=>new Uint8Array(await new r(t).arrayBuffer()));var u;const c=s&&a&&Zt(()=>{let t=!1;const e=new r(yt.origin,{body:new Kt,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),l=o&&a&&Zt(()=>Z.isReadableStream(new n("").body)),f={stream:l&&(t=>t.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!f[t]&&(f[t]=(e,r)=>{let n=e&&e[t];if(n)return n.call(e);throw new X(`Response type '${t}' is not supported`,X.ERR_NOT_SUPPORT,r)})});return async t=>{let{url:i,method:o,data:a,signal:u,cancelToken:d,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:v}=jt(t),M=e||fetch;y=y?(y+"").toLowerCase():"text";let k=qt([u,d&&d.toAbortSignal()],p),S=null;const E=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let x;try{if(g&&c&&"get"!==o&&"head"!==o&&0!==(x=await(async(t,e)=>{const n=Z.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(Z.isBlob(t))return t.size;if(Z.isSpecCompliantForm(t)){const e=new r(yt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Z.isArrayBufferView(t)||Z.isArrayBuffer(t)?t.byteLength:(Z.isURLSearchParams(t)&&(t+=""),Z.isString(t)?(await h(t)).byteLength:void 0)})(e):n})(w,a))){let t,e=new r(i,{method:"POST",body:a,duplex:"half"});if(Z.isFormData(a)&&(t=e.headers.get("content-type"))&&w.setContentType(t),e.body){const[t,r]=Pt(x,Ct(It(g)));a=Vt(e.body,65536,t,r)}}Z.isString(b)||(b=b?"include":"omit");const e=s&&"credentials"in r.prototype,u={...v,signal:k,method:o.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:e?b:void 0};S=s&&new r(i,u);let d=await(s?M(S,v):M(i,u));const p=l&&("stream"===y||"response"===y);if(l&&(m||p&&E)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=d[e]});const e=Z.toFiniteNumber(d.headers.get("content-length")),[r,i]=m&&Pt(e,Ct(It(m),!0))||[];d=new n(Vt(d.body,65536,r,()=>{i&&i(),E&&E()}),t)}y=y||"text";let R=await f[Z.findKey(f,y)||"text"](d,t);return!p&&E&&E(),await new Promise((e,r)=>{Ot(e,r,{data:R,headers:At.from(d.headers),status:d.status,statusText:d.statusText,config:t,request:S})})}catch(e){if(E&&E(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new X("Network Error",X.ERR_NETWORK,t,S),{cause:e.cause||e});throw X.from(e,e&&e.code,t,S)}}},Gt=new Map,Qt=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:i}=e,s=[n,i,r];let o,a,h=s.length,u=Gt;for(;h--;)o=s[h],a=u.get(o),void 0===a&&u.set(o,a=h?new Map:Xt(e)),u=a;return a};Qt();const Yt={http:null,xhr:Ft,fetch:{get:Qt}};Z.forEach(Yt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const te=t=>`- ${t}`,ee=t=>Z.isFunction(t)||null===t||!1===t;var re=function(t,e){t=Z.isArray(t)?t:[t];const{length:r}=t;let n,i;const s={};for(let o=0;o<r;o++){let r;if(n=t[o],i=n,!ee(n)&&(i=Yt[(r=String(n)).toLowerCase()],void 0===i))throw new X(`Unknown adapter '${r}'`);if(i&&(Z.isFunction(i)||(i=i.get(e))))break;s[r||"#"+o]=i}if(!i){const t=Object.entries(s).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));throw new X("There is no suitable adapter to dispatch the request "+(r?t.length>1?"since :\n"+t.map(te).join("\n"):" "+te(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function ne(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Tt(null,t)}function ie(t){return ne(t),t.headers=At.from(t.headers),t.data=_t.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),re(t.adapter||vt.adapter,t)(t).then(function(e){return ne(t),e.data=_t.call(t,t.transformResponse,e),e.headers=At.from(e.headers),e},function(e){return Bt(e)||(ne(t),e&&e.response&&(e.response.data=_t.call(t,t.transformResponse,e.response),e.response.headers=At.from(e.response.headers))),Promise.reject(e)})}const se="1.13.2",oe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{oe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const ae={};oe.transitional=function(t,e,r){function n(t,e){return"[Axios v"+se+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,i,s)=>{if(!1===t)throw new X(n(i," has been removed"+(e?" in "+e:"")),X.ERR_DEPRECATED);return e&&!ae[i]&&(ae[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,s)}},oe.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};var he={assertOptions:function(t,e,r){if("object"!=typeof t)throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],o=e[s];if(o){const e=t[s],r=void 0===e||o(e,s,t);if(!0!==r)throw new X("option "+s+" must be "+r,X.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new X("Unknown option "+s,X.ERR_BAD_OPTION)}},validators:oe};const ue=he.validators;class ce{constructor(t){this.defaults=t||{},this.interceptors={request:new ut,response:new ut}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ht(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:i}=e;void 0!==r&&he.assertOptions(r,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),null!=n&&(Z.isFunction(n)?e.paramsSerializer={serialize:n}:he.assertOptions(n,{encode:ue.function,serialize:ue.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),he.assertOptions(e,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&Z.merge(i.common,i[e.method]);i&&Z.forEach(["delete","get","head","post","put","patch","common"],t=>{delete i[t]}),e.headers=At.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,o.unshift(t.fulfilled,t.rejected))});const h=[];let u;this.interceptors.response.forEach(function(t){h.push(t.fulfilled,t.rejected)});let c,l=0;if(!a){const t=[ie.bind(this),void 0];for(t.unshift(...o),t.push(...h),c=t.length,u=Promise.resolve(e);l<c;)u=u.then(t[l++],t[l++]);return u}c=o.length;let f=e;for(;l<c;){const t=o[l++],e=o[l++];try{f=t(f)}catch(t){e.call(this,t);break}}try{u=ie.call(this,f)}catch(t){return Promise.reject(t)}for(l=0,c=h.length;l<c;)u=u.then(h[l++],h[l++]);return u}getUri(t){return ht(Dt((t=Ht(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}Z.forEach(["delete","get","head","options"],function(t){ce.prototype[t]=function(e,r){return this.request(Ht(r||{},{method:t,url:e,data:(r||{}).data}))}}),Z.forEach(["post","put","patch"],function(t){function e(e){return function(r,n,i){return this.request(Ht(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ce.prototype[t]=e(),ce.prototype[t+"Form"]=e(!0)});var le=ce;class fe{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const r=this;this.promise.then(t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null}),this.promise.then=t=>{let e;const n=new Promise(t=>{r.subscribe(t),e=t}).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t(function(t,n,i){r.reason||(r.reason=new Tt(t,n,i),e(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new fe(function(e){t=e}),cancel:t}}}var de=fe;const pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pe).forEach(([t,e])=>{pe[e]=t});var me=pe;const ge=function t(e){const r=new le(e),n=s(le.prototype.request,r);return Z.extend(n,le.prototype,r,{allOwnKeys:!0}),Z.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(Ht(e,r))},n}(vt);ge.Axios=le,ge.CanceledError=Tt,ge.CancelToken=de,ge.isCancel=Bt,ge.VERSION=se,ge.toFormData=nt,ge.AxiosError=X,ge.Cancel=ge.CanceledError,ge.all=function(t){return Promise.all(t)},ge.spread=function(t){return function(e){return t.apply(null,e)}},ge.isAxiosError=function(t){return Z.isObject(t)&&!0===t.isAxiosError},ge.mergeConfig=Ht,ge.AxiosHeaders=At,ge.formToJSON=t=>wt(Z.isHTMLForm(t)?new FormData(t):t),ge.getAdapter=re,ge.HttpStatusCode=me,ge.default=ge,t.exports=ge},55152(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{A:()=>n})},63816(t,e,r){"use strict";r.d(e,{A:()=>Me});var n={};function i(t,e){return function(){return t.apply(e,arguments)}}r.r(n),r.d(n,{hasBrowserEnv:()=>mt,hasStandardBrowserEnv:()=>yt,hasStandardBrowserWebWorkerEnv:()=>wt,navigator:()=>gt,origin:()=>bt});var s=r(39907);const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:h,toStringTag:u}=Symbol,c=(l=Object.create(null),t=>{const e=o.call(t);return l[e]||(l[e]=e.slice(8,-1).toLowerCase())});var l;const f=t=>(t=t.toLowerCase(),e=>c(e)===t),d=t=>e=>typeof e===t,{isArray:p}=Array,m=d("undefined");function g(t){return null!==t&&!m(t)&&null!==t.constructor&&!m(t.constructor)&&b(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const y=f("ArrayBuffer"),w=d("string"),b=d("function"),v=d("number"),M=t=>null!==t&&"object"==typeof t,k=t=>{if("object"!==c(t))return!1;const e=a(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||u in t||h in t)},S=f("Date"),E=f("File"),x=f("Blob"),R=f("FileList"),A=f("URLSearchParams"),[_,B,T,O]=["ReadableStream","Request","Response","Headers"].map(f);function C(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,i;if("object"!=typeof t&&(t=[t]),p(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(g(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let o;for(n=0;n<s;n++)o=i[n],e.call(null,t[o],o,t)}}function P(t,e){if(g(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n,i=r.length;for(;i-- >0;)if(n=r[i],e===n.toLowerCase())return n;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,N=t=>!m(t)&&t!==I,L=(D="undefined"!=typeof Uint8Array&&a(Uint8Array),t=>D&&t instanceof D);var D;const U=f("HTMLFormElement"),H=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),j=f("RegExp"),F=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};C(r,(r,i)=>{let s;!1!==(s=e(r,i,t))&&(n[i]=s||r)}),Object.defineProperties(t,n)},q=f("AsyncFunction"),z=(V="function"==typeof setImmediate,W=b(I.postMessage),V?setImmediate:W?($=`axios@${Math.random()}`,K=[],I.addEventListener("message",({source:t,data:e})=>{t===I&&e===$&&K.length&&K.shift()()},!1),t=>{K.push(t),I.postMessage($,"*")}):t=>setTimeout(t));var V,W,$,K;const J="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):void 0!==s&&s.nextTick||z,Z={isArray:p,isArrayBuffer:y,isBuffer:g,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||b(t.append)&&("formdata"===(e=c(t))||"object"===e&&b(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&y(t.buffer),e},isString:w,isNumber:v,isBoolean:t=>!0===t||!1===t,isObject:M,isPlainObject:k,isEmptyObject:t=>{if(!M(t)||g(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:_,isRequest:B,isResponse:T,isHeaders:O,isUndefined:m,isDate:S,isFile:E,isBlob:x,isRegExp:j,isFunction:b,isStream:t=>M(t)&&b(t.pipe),isURLSearchParams:A,isTypedArray:L,isFileList:R,forEach:C,merge:function t(){const{caseless:e,skipUndefined:r}=N(this)&&this||{},n={},i=(i,s)=>{const o=e&&P(n,s)||s;k(n[o])&&k(i)?n[o]=t(n[o],i):k(i)?n[o]=t({},i):p(i)?n[o]=i.slice():r&&m(i)||(n[o]=i)};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&C(arguments[t],i);return n},extend:(t,e,r,{allOwnKeys:n}={})=>(C(e,(e,n)=>{r&&b(e)?t[n]=i(e,r):t[n]=e},{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let i,s,o;const h={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],n&&!n(o,t,e)||h[o]||(e[o]=t[o],h[o]=!0);t=!1!==r&&a(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:c,kindOfTest:f,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(p(t))return t;let e=t.length;if(!v(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[h]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:U,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:F,freezeMethods:t=>{F(t,(e,r)=>{if(b(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];b(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach(t=>{r[t]=!0})};return p(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,r){return e.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:P,global:I,isContextDefined:N,isSpecCompliantForm:function(t){return!!(t&&b(t.append)&&"FormData"===t[u]&&t[h])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(M(t)){if(e.indexOf(t)>=0)return;if(g(t))return t;if(!("toJSON"in t)){e[n]=t;const i=p(t)?[]:{};return C(t,(t,e)=>{const s=r(t,n+1);!m(s)&&(i[e]=s)}),e[n]=void 0,i}}return t};return r(t,0)},isAsyncFn:q,isThenable:t=>t&&(M(t)||b(t))&&b(t.then)&&b(t.catch),setImmediate:z,asap:J,isIterable:t=>null!=t&&b(t[h])};function X(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}Z.inherits(X,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const G=X.prototype,Q={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Q[t]={value:t}}),Object.defineProperties(X,Q),Object.defineProperty(G,"isAxiosError",{value:!0}),X.from=(t,e,r,n,i,s)=>{const o=Object.create(G);Z.toFlatObject(t,o,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t);const a=t&&t.message?t.message:"Error",h=null==e&&t?t.code:e;return X.call(o,a,h,r,n,i),t&&null==o.cause&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",s&&Object.assign(o,s),o};const Y=X;var tt=r(1048).Buffer;function et(t){return Z.isPlainObject(t)||Z.isArray(t)}function rt(t){return Z.endsWith(t,"[]")?t.slice(0,-2):t}function nt(t,e,r){return t?t.concat(e).map(function(t,e){return t=rt(t),!r&&e?"["+t+"]":t}).join(r?".":""):e}const it=Z.toFlatObject(Z,{},null,function(t){return/^is[A-Z]/.test(t)}),st=function(t,e,r){if(!Z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=Z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!Z.isUndefined(e[t])})).metaTokens,i=r.visitor||u,s=r.dots,o=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(e);if(!Z.isFunction(i))throw new TypeError("visitor must be a function");function h(t){if(null===t)return"";if(Z.isDate(t))return t.toISOString();if(Z.isBoolean(t))return t.toString();if(!a&&Z.isBlob(t))throw new Y("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(t)||Z.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):tt.from(t):t}function u(t,r,i){let a=t;if(t&&!i&&"object"==typeof t)if(Z.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(Z.isArray(t)&&function(t){return Z.isArray(t)&&!t.some(et)}(t)||(Z.isFileList(t)||Z.endsWith(r,"[]"))&&(a=Z.toArray(t)))return r=rt(r),a.forEach(function(t,n){!Z.isUndefined(t)&&null!==t&&e.append(!0===o?nt([r],n,s):null===o?r:r+"[]",h(t))}),!1;return!!et(t)||(e.append(nt(i,r,s),h(t)),!1)}const c=[],l=Object.assign(it,{defaultVisitor:u,convertValue:h,isVisitable:et});if(!Z.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!Z.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),Z.forEach(r,function(r,s){!0===(!(Z.isUndefined(r)||null===r)&&i.call(e,r,Z.isString(s)?s.trim():s,n,l))&&t(r,n?n.concat(s):[s])}),c.pop()}}(t),e};function ot(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function at(t,e){this._pairs=[],t&&st(t,this,e)}const ht=at.prototype;ht.append=function(t,e){this._pairs.push([t,e])},ht.toString=function(t){const e=t?function(e){return t.call(this,e,ot)}:ot;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};const ut=at;function ct(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function lt(t,e,r){if(!e)return t;const n=r&&r.encode||ct;Z.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(s=i?i(e,r):Z.isURLSearchParams(e)?e.toString():new ut(e,r).toString(n),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}const ft=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,function(e){null!==e&&t(e)})}},dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ut,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},mt="undefined"!=typeof window&&"undefined"!=typeof document,gt="object"==typeof navigator&&navigator||void 0,yt=mt&&(!gt||["ReactNative","NativeScript","NS"].indexOf(gt.product)<0),wt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,bt=mt&&window.location.href||"http://localhost",vt={...n,...pt},Mt=function(t){function e(t,r,n,i){let s=t[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=t.length;return s=!s&&Z.isArray(n)?n.length:s,a?(Z.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!o):(n[s]&&Z.isObject(n[s])||(n[s]=[]),e(t,r,n[s],i)&&Z.isArray(n[s])&&(n[s]=function(t){const e={},r=Object.keys(t);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],e[s]=t[s];return e}(n[s])),!o)}if(Z.isFormData(t)&&Z.isFunction(t.entries)){const r={};return Z.forEachEntry(t,(t,n)=>{e(function(t){return Z.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),n,r,0)}),r}return null},kt={transitional:dt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,i=Z.isObject(t);if(i&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return n?JSON.stringify(Mt(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return st(t,new vt.classes.URLSearchParams,{visitor:function(t,e,r,n){return vt.isNode&&Z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((s=Z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return st(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||n?(e.setContentType("application/json",!1),function(t){if(Z.isString(t))try{return(0,JSON.parse)(t),Z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||kt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(t){if(r){if("SyntaxError"===t.name)throw Y.from(t,Y.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vt.classes.FormData,Blob:vt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],t=>{kt.headers[t]={}});const St=kt,Et=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xt=Symbol("internals");function Rt(t){return t&&String(t).trim().toLowerCase()}function At(t){return!1===t||null==t?t:Z.isArray(t)?t.map(At):String(t)}function _t(t,e,r,n,i){return Z.isFunction(n)?n.call(this,e,r):(i&&(e=r),Z.isString(e)?Z.isString(n)?-1!==e.indexOf(n):Z.isRegExp(n)?n.test(e):void 0:void 0)}class Bt{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function i(t,e,r){const i=Rt(e);if(!i)throw new Error("header name must be a non-empty string");const s=Z.findKey(n,i);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||e]=At(t))}const s=(t,e)=>Z.forEach(t,(t,r)=>i(t,r,e));if(Z.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(Z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let r,n,i;return t&&t.split("\n").forEach(function(t){i=t.indexOf(":"),r=t.substring(0,i).trim().toLowerCase(),n=t.substring(i+1).trim(),!r||e[r]&&Et[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e})(t),e);else if(Z.isObject(t)&&Z.isIterable(t)){let r,n,i={};for(const e of t){if(!Z.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[n=e[0]]=(r=i[n])?Z.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}s(i,e)}else null!=t&&i(e,t,r);return this}get(t,e){if(t=Rt(t)){const r=Z.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(Z.isFunction(e))return e.call(this,t,r);if(Z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Rt(t)){const r=Z.findKey(this,t);return!(!r||void 0===this[r]||e&&!_t(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function i(t){if(t=Rt(t)){const i=Z.findKey(r,t);!i||e&&!_t(0,r[i],i,e)||(delete r[i],n=!0)}}return Z.isArray(t)?t.forEach(i):i(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const i=e[r];t&&!_t(0,this[i],i,t,!0)||(delete this[i],n=!0)}return n}normalize(t){const e=this,r={};return Z.forEach(this,(n,i)=>{const s=Z.findKey(r,i);if(s)return e[s]=At(n),void delete e[i];const o=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}(i):String(i).trim();o!==i&&delete e[i],e[o]=At(n),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Z.forEach(this,(r,n)=>{null!=r&&!1!==r&&(e[n]=t&&Z.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach(t=>r.set(t)),r}static accessor(t){const e=(this[xt]=this[xt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Rt(t);e[n]||(function(t,e){const r=Z.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(t,r,i){return this[n].call(this,e,t,r,i)},configurable:!0})})}(r,t),e[n]=!0)}return Z.isArray(t)?t.forEach(n):n(t),this}}Bt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(Bt.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}}),Z.freezeMethods(Bt);const Tt=Bt;function Ot(t,e){const r=this||St,n=e||r,i=Tt.from(n.headers);let s=n.data;return Z.forEach(t,function(t){s=t.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Ct(t){return!(!t||!t.__CANCEL__)}function Pt(t,e,r){Y.call(this,null==t?"canceled":t,Y.ERR_CANCELED,e,r),this.name="CanceledError"}Z.inherits(Pt,Y,{__CANCEL__:!0});const It=Pt;function Nt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new Y("Request failed with status code "+r.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const Lt=(t,e,r=3)=>{let n=0;const i=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i,s=0,o=0;return e=void 0!==e?e:1e3,function(a){const h=Date.now(),u=n[o];i||(i=h),r[s]=a,n[s]=h;let c=o,l=0;for(;c!==s;)l+=r[c++],c%=t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),h-i<e)return;const f=u&&h-u;return f?Math.round(1e3*l/f):void 0}}(50,250);return function(t,e){let r,n,i=0,s=1e3/e;const o=(e,s=Date.now())=>{i=s,r=null,n&&(clearTimeout(n),n=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-i;a>=s?o(t,e):(r=t,n||(n=setTimeout(()=>{n=null,o(r)},s-a)))},()=>r&&o(r)]}(r=>{const s=r.loaded,o=r.lengthComputable?r.total:void 0,a=s-n,h=i(a);n=s,t({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:h||void 0,estimated:h&&o&&s<=o?(o-s)/h:void 0,event:r,lengthComputable:null!=o,[e?"download":"upload"]:!0})},r)},Dt=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Ut=t=>(...e)=>Z.asap(()=>t(...e)),Ht=vt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,vt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(vt.origin),vt.navigator&&/(msie|trident)/i.test(vt.navigator.userAgent)):()=>!0,jt=vt.hasStandardBrowserEnv?{write(t,e,r,n,i,s,o){if("undefined"==typeof document)return;const a=[`${t}=${encodeURIComponent(e)}`];Z.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),Z.isString(n)&&a.push(`path=${n}`),Z.isString(i)&&a.push(`domain=${i}`),!0===s&&a.push("secure"),Z.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(t){if("undefined"==typeof document)return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Ft(t,e,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const qt=t=>t instanceof Tt?{...t}:t;function zt(t,e){e=e||{};const r={};function n(t,e,r,n){return Z.isPlainObject(t)&&Z.isPlainObject(e)?Z.merge.call({caseless:n},t,e):Z.isPlainObject(e)?Z.merge({},e):Z.isArray(e)?e.slice():e}function i(t,e,r,i){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:n(void 0,t,0,i):n(t,e,0,i)}function s(t,e){if(!Z.isUndefined(e))return n(void 0,e)}function o(t,e){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(r,i,s){return s in e?n(r,i):s in t?n(void 0,r):void 0}const h={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(t,e,r)=>i(qt(t),qt(e),0,!0)};return Z.forEach(Object.keys({...t,...e}),function(n){const s=h[n]||i,o=s(t[n],e[n],n);Z.isUndefined(o)&&s!==a||(r[n]=o)}),r}const Vt=t=>{const e=zt({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;if(e.headers=o=Tt.from(o),e.url=lt(Ft(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Z.isFormData(r))if(vt.hasStandardBrowserEnv||vt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(Z.isFunction(r.getHeaders)){const t=r.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach(([t,r])=>{e.includes(t.toLowerCase())&&o.set(t,r)})}if(vt.hasStandardBrowserEnv&&(n&&Z.isFunction(n)&&(n=n(e)),n||!1!==n&&Ht(e.url))){const t=i&&s&&jt.read(s);t&&o.set(i,t)}return e},Wt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,r){const n=Vt(t);let i=n.data;const s=Tt.from(n.headers).normalize();let o,a,h,u,c,{responseType:l,onUploadProgress:f,onDownloadProgress:d}=n;function p(){u&&u(),c&&c(),n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const n=Tt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Nt(function(t){e(t),p()},function(t){r(t),p()},{data:l&&"text"!==l&&"json"!==l?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:t,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(r(new Y("Request aborted",Y.ECONNABORTED,t,m)),m=null)},m.onerror=function(e){const n=e&&e.message?e.message:"Network Error",i=new Y(n,Y.ERR_NETWORK,t,m);i.event=e||null,r(i),m=null},m.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||dt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new Y(e,i.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,t,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&Z.forEach(s.toJSON(),function(t,e){m.setRequestHeader(e,t)}),Z.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),l&&"json"!==l&&(m.responseType=n.responseType),d&&([h,c]=Lt(d,!0),m.addEventListener("progress",h)),f&&m.upload&&([a,u]=Lt(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(o=e=>{m&&(r(!e||e.type?new It(null,t,m):e),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));const y=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);y&&-1===vt.protocols.indexOf(y)?r(new Y("Unsupported protocol "+y+":",Y.ERR_BAD_REQUEST,t)):m.send(i||null)})},$t=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const i=function(t){if(!r){r=!0,o();const e=t instanceof Error?t:this.reason;n.abort(e instanceof Y?e:new It(e instanceof Error?e.message:e))}};let s=e&&setTimeout(()=>{s=null,i(new Y(`timeout ${e} of ms exceeded`,Y.ETIMEDOUT))},e);const o=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)}),t=null)};t.forEach(t=>t.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=()=>Z.asap(o),a}},Kt=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,i=0;for(;i<r;)n=i+e,yield t.slice(i,n),i=n},Jt=(t,e,r,n)=>{const i=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*Kt(r,e)}(t,e);let s,o=0,a=t=>{s||(s=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await i.next();if(e)return a(),void t.close();let s=n.byteLength;if(r){let t=o+=s;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:t=>(a(t),i.return())},{highWaterMark:2})},{isFunction:Zt}=Z,Xt=(({Request:t,Response:e})=>({Request:t,Response:e}))(Z.global),{ReadableStream:Gt,TextEncoder:Qt}=Z.global,Yt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},te=t=>{t=Z.merge.call({skipUndefined:!0},Xt,t);const{fetch:e,Request:r,Response:n}=t,i=e?Zt(e):"function"==typeof fetch,s=Zt(r),o=Zt(n);if(!i)return!1;const a=i&&Zt(Gt),h=i&&("function"==typeof Qt?(u=new Qt,t=>u.encode(t)):async t=>new Uint8Array(await new r(t).arrayBuffer()));var u;const c=s&&a&&Yt(()=>{let t=!1;const e=new r(vt.origin,{body:new Gt,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),l=o&&a&&Yt(()=>Z.isReadableStream(new n("").body)),f={stream:l&&(t=>t.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!f[t]&&(f[t]=(e,r)=>{let n=e&&e[t];if(n)return n.call(e);throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,r)})});return async t=>{let{url:i,method:o,data:a,signal:u,cancelToken:d,timeout:p,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:v}=Vt(t),M=e||fetch;y=y?(y+"").toLowerCase():"text";let k=$t([u,d&&d.toAbortSignal()],p),S=null;const E=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let x;try{if(g&&c&&"get"!==o&&"head"!==o&&0!==(x=await(async(t,e)=>{const n=Z.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(Z.isBlob(t))return t.size;if(Z.isSpecCompliantForm(t)){const e=new r(vt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Z.isArrayBufferView(t)||Z.isArrayBuffer(t)?t.byteLength:(Z.isURLSearchParams(t)&&(t+=""),Z.isString(t)?(await h(t)).byteLength:void 0)})(e):n})(w,a))){let t,e=new r(i,{method:"POST",body:a,duplex:"half"});if(Z.isFormData(a)&&(t=e.headers.get("content-type"))&&w.setContentType(t),e.body){const[t,r]=Dt(x,Lt(Ut(g)));a=Jt(e.body,65536,t,r)}}Z.isString(b)||(b=b?"include":"omit");const e=s&&"credentials"in r.prototype,u={...v,signal:k,method:o.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:e?b:void 0};S=s&&new r(i,u);let d=await(s?M(S,v):M(i,u));const p=l&&("stream"===y||"response"===y);if(l&&(m||p&&E)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=d[e]});const e=Z.toFiniteNumber(d.headers.get("content-length")),[r,i]=m&&Dt(e,Lt(Ut(m),!0))||[];d=new n(Jt(d.body,65536,r,()=>{i&&i(),E&&E()}),t)}y=y||"text";let R=await f[Z.findKey(f,y)||"text"](d,t);return!p&&E&&E(),await new Promise((e,r)=>{Nt(e,r,{data:R,headers:Tt.from(d.headers),status:d.status,statusText:d.statusText,config:t,request:S})})}catch(e){if(E&&E(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new Y("Network Error",Y.ERR_NETWORK,t,S),{cause:e.cause||e});throw Y.from(e,e&&e.code,t,S)}}},ee=new Map,re=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:i}=e,s=[n,i,r];let o,a,h=s.length,u=ee;for(;h--;)o=s[h],a=u.get(o),void 0===a&&u.set(o,a=h?new Map:te(e)),u=a;return a},ne=(re(),{http:null,xhr:Wt,fetch:{get:re}});Z.forEach(ne,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const ie=t=>`- ${t}`,se=t=>Z.isFunction(t)||null===t||!1===t,oe=function(t,e){t=Z.isArray(t)?t:[t];const{length:r}=t;let n,i;const s={};for(let o=0;o<r;o++){let r;if(n=t[o],i=n,!se(n)&&(i=ne[(r=String(n)).toLowerCase()],void 0===i))throw new Y(`Unknown adapter '${r}'`);if(i&&(Z.isFunction(i)||(i=i.get(e))))break;s[r||"#"+o]=i}if(!i){const t=Object.entries(s).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));let e=r?t.length>1?"since :\n"+t.map(ie).join("\n"):" "+ie(t[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return i};function ae(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new It(null,t)}function he(t){return ae(t),t.headers=Tt.from(t.headers),t.data=Ot.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),oe(t.adapter||St.adapter,t)(t).then(function(e){return ae(t),e.data=Ot.call(t,t.transformResponse,e),e.headers=Tt.from(e.headers),e},function(e){return Ct(e)||(ae(t),e&&e.response&&(e.response.data=Ot.call(t,t.transformResponse,e.response),e.response.headers=Tt.from(e.response.headers))),Promise.reject(e)})}const ue="1.13.2",ce={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ce[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const le={};ce.transitional=function(t,e,r){function n(t,e){return"[Axios v"+ue+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,i,s)=>{if(!1===t)throw new Y(n(i," has been removed"+(e?" in "+e:"")),Y.ERR_DEPRECATED);return e&&!le[i]&&(le[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,i,s)}},ce.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};const fe={assertOptions:function(t,e,r){if("object"!=typeof t)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const s=n[i],o=e[s];if(o){const e=t[s],r=void 0===e||o(e,s,t);if(!0!==r)throw new Y("option "+s+" must be "+r,Y.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Y("Unknown option "+s,Y.ERR_BAD_OPTION)}},validators:ce},de=fe.validators;class pe{constructor(t){this.defaults=t||{},this.interceptors={request:new ft,response:new ft}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=zt(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:i}=e;void 0!==r&&fe.assertOptions(r,{silentJSONParsing:de.transitional(de.boolean),forcedJSONParsing:de.transitional(de.boolean),clarifyTimeoutError:de.transitional(de.boolean)},!1),null!=n&&(Z.isFunction(n)?e.paramsSerializer={serialize:n}:fe.assertOptions(n,{encode:de.function,serialize:de.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),fe.assertOptions(e,{baseUrl:de.spelling("baseURL"),withXsrfToken:de.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&Z.merge(i.common,i[e.method]);i&&Z.forEach(["delete","get","head","post","put","patch","common"],t=>{delete i[t]}),e.headers=Tt.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,o.unshift(t.fulfilled,t.rejected))});const h=[];let u;this.interceptors.response.forEach(function(t){h.push(t.fulfilled,t.rejected)});let c,l=0;if(!a){const t=[he.bind(this),void 0];for(t.unshift(...o),t.push(...h),c=t.length,u=Promise.resolve(e);l<c;)u=u.then(t[l++],t[l++]);return u}c=o.length;let f=e;for(;l<c;){const t=o[l++],e=o[l++];try{f=t(f)}catch(t){e.call(this,t);break}}try{u=he.call(this,f)}catch(t){return Promise.reject(t)}for(l=0,c=h.length;l<c;)u=u.then(h[l++],h[l++]);return u}getUri(t){return lt(Ft((t=zt(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}Z.forEach(["delete","get","head","options"],function(t){pe.prototype[t]=function(e,r){return this.request(zt(r||{},{method:t,url:e,data:(r||{}).data}))}}),Z.forEach(["post","put","patch"],function(t){function e(e){return function(r,n,i){return this.request(zt(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}pe.prototype[t]=e(),pe.prototype[t+"Form"]=e(!0)});const me=pe;class ge{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const r=this;this.promise.then(t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null}),this.promise.then=t=>{let e;const n=new Promise(t=>{r.subscribe(t),e=t}).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t(function(t,n,i){r.reason||(r.reason=new It(t,n,i),e(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ge(function(e){t=e}),cancel:t}}}const ye=ge,we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(we).forEach(([t,e])=>{we[e]=t});const be=we,ve=function t(e){const r=new me(e),n=i(me.prototype.request,r);return Z.extend(n,me.prototype,r,{allOwnKeys:!0}),Z.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(zt(e,r))},n}(St);ve.Axios=me,ve.CanceledError=It,ve.CancelToken=ye,ve.isCancel=Ct,ve.VERSION=ue,ve.toFormData=st,ve.AxiosError=Y,ve.Cancel=ve.CanceledError,ve.all=function(t){return Promise.all(t)},ve.spread=function(t){return function(e){return t.apply(null,e)}},ve.isAxiosError=function(t){return Z.isObject(t)&&!0===t.isAxiosError},ve.mergeConfig=zt,ve.AxiosHeaders=Tt,ve.formToJSON=t=>Mt(Z.isHTMLForm(t)?new FormData(t):t),ve.getAdapter=oe,ve.HttpStatusCode=be,ve.default=ve;const Me=ve},68515(t,e,r){"use strict";r.d(e,{A:()=>i});var n=r(17545);function i(t){var e=function(t){if("object"!=(0,n.A)(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=(0,n.A)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==(0,n.A)(e)?e:e+""}},69013(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,s,o,a=[],h=!0,u=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;h=!1}else for(;!(h=(n=s.call(r)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){u=!0,i=t}finally{try{if(!h&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}r.d(e,{A:()=>i})},71821(t,e,r){var n=r(25636).Buffer;t.exports={check:function(t){if(t.length<8)return!1;if(t.length>72)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-2)return!1;if(2!==t[2])return!1;var e=t[3];if(0===e)return!1;if(5+e>=t.length)return!1;if(2!==t[4+e])return!1;var r=t[5+e];return!(0===r||6+e+r!==t.length||128&t[4]||e>1&&0===t[4]&&!(128&t[5])||128&t[e+6]||r>1&&0===t[e+6]&&!(128&t[e+7]))},decode:function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},encode:function(t,e){var r=t.length,i=e.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(i>1&&0===e[0]&&!(128&e[1]))throw new Error("S value excessively padded");var s=n.allocUnsafe(6+r+i);return s[0]=48,s[1]=s.length-2,s[2]=2,s[3]=t.length,t.copy(s,4),s[4+r]=2,s[5+r]=e.length,e.copy(s,6+r),s}}},72715(t,e,r){"use strict";function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}r.d(e,{A:()=>n})},82036(t,e,r){"use strict";r.r(e),r.d(e,{AlreadyDestroyedError:()=>i,CrashError:()=>s,JsonRpcDisabledError:()=>o,QueueFullError:()=>a,WellKnownChain:()=>n,createScClient:()=>M});const n={pezkuwi:"pezkuwi",ksmcc3:"ksmcc3",pezkuwichain_v2_2:"pezkuwichain_v2_2",zagros2:"zagros2",paseo:"paseo"};class i extends Error{constructor(){super(),this.name="AlreadyDestroyedError"}}class s extends Error{constructor(t){super(t),this.name="CrashError"}}class o extends Error{constructor(){super(),this.name="JsonRpcDisabledError"}}class a extends Error{constructor(){super(),this.name="QueueFullError"}}const h=new Map,u=![typeof window,typeof document].includes("undefined");let c=class{},l=null,f=null;const d=[];let p=null,m=3;const g=t=>{if(t.maxLogLevel&&t.maxLogLevel>m&&(m=t.maxLogLevel),p)return d.push(t),p instanceof Promise?p:Promise.resolve(p);let e,n;if(t.workerFactory){e=t.workerFactory();const{port1:r,port2:i}=new MessageChannel;e.postMessage(r,[r]),n=i}const i={portToWorker:n,forbidTcp:!0,forbidNonLocalWs:!0,maxLogLevel:9999999,cpuRateLimit:.5,logCallback:(t,e,r)=>{t>m||(t<=1?console.error("[%s] %s",e,r):2===t?console.warn("[%s] %s",e,r):3===t?console.info("[%s] %s",e,r):4===t?console.debug("[%s] %s",e,r):console.trace("[%s] %s",e,r))}},s=e?(f||(f=r.e(9451).then(r.bind(r,29451)).then(t=>t.startWithBytecode),f)).then(t=>t({...i,bytecode:new Promise(t=>{u?e.onmessage=e=>t(e.data):e.on("message",e=>t(e))})})):(l||(l=Promise.all([r.e(9451),r.e(3632)]).then(r.bind(r,23632)).then(t=>(c=t.QueueFullError,t.start)),l)).then(t=>t(i));return p=s,s.then(t=>(p===s?p=t:t.terminate(),t)),d.push(t),p},y=t=>{const e=d.indexOf(t);if(-1===e)throw new Error("Internal error within smoldot");d.splice(e,1),m=3;for(const t of d.values())t.maxLogLevel&&t.maxLogLevel>m&&(m=t.maxLogLevel);0===d.length&&(!p||p instanceof Promise||p.terminate(),p=null)},w=t=>{try{t()}catch(t){const e=t;if("JsonRpcDisabledError"===e?.name)throw new o;if("CrashError"===e?.name)throw new s(e.message);if("AlreadyDestroyedError"===e?.name)throw new i;if(e instanceof c)throw new a;throw new s(t instanceof Error?t.message:`Unexpected error ${t}`)}},b=t=>{const e=t||{maxLogLevel:3},i=async(t,r)=>{const n=await g(e);try{const s=await n.addChain({chainSpec:t,potentialRelayChains:r?.relayChain?[r.relayChain]:void 0,disableJsonRpc:r?.disableJsonRpc,databaseContent:r?.databaseContent});return{sendJsonRpc:t=>{w(()=>s.sendJsonRpc(t))},nextJsonRpcResponse:()=>s.nextJsonRpcResponse(),jsonRpcResponses:s.jsonRpcResponses,remove:()=>{try{w(()=>{s.remove()})}finally{y(e)}},addChain:(t,e)=>i(t,{...e,relayChain:s})}}catch(t){throw y(e),t}};return{addChain:(t,e)=>i(t,e),addWellKnownChain:async(t,s)=>{g(e);try{return await i(await async function(t){if(!Object.keys(n).includes(t))throw new Error("Invalid chain name");const e=t;if(!h.has(e))switch(e){case n.pezkuwi:h.set(n.pezkuwi,r.e(8577).then(r.bind(r,8577)));break;case n.ksmcc3:h.set(n.ksmcc3,r.e(8100).then(r.bind(r,68100)));break;case n.zagros2:h.set(n.zagros2,r.e(2618).then(r.bind(r,32618)));break;case n.pezkuwichain_v2_2:h.set(n.pezkuwichain_v2_2,r.e(3114).then(r.bind(r,13114)));break;case n.paseo:h.set(n.paseo,r.e(3950).then(r.bind(r,3950)))}return(await h.get(e)).chainSpec}(t),s)}finally{y(e)}}}},v=t=>"smoldot-v1"===t.kind,M=t=>{if(t?.forceEmbeddedNode)return b(t?.embeddedNodeConfig);const e=function(){if("object"==typeof document&&"function"==typeof CustomEvent)return(()=>{const t=[];return window.dispatchEvent(new CustomEvent("bizinikiwiDiscovery:requestProvider",{detail:{onProvider(e){t.push(e)}}})),t.slice()})().filter(v).filter(t=>t.info.rdns.startsWith("io.github.pezkuwichain.BizinikiwiConnect")).map(t=>t.provider)[0]}()||b(t?.embeddedNodeConfig);return{addChain:async(t,r)=>(await e).addChain(t,r),addWellKnownChain:async(t,r)=>(await e).addWellKnownChain(t,r)}}},82823(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.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=s:e.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8379).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 h(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},s.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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,s=0,o=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=h(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=h(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,a=Math.min(s,s-o)+r,h=0,c=r;c<a;c+=n)h=u(t,c,c+n,e),this.imuln(i),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==o){var l=1;for(h=u(t,c,t.length,e),c=0;c<o;c++)l*=e;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},s.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},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],l=[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],f=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var c=h>>>26,l=67108863&h,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;c+=(o=(i=0|t.words[p])*(s=0|e.words[d])+l)/67108864|0,l=67108863&o}r.words[u]=0|l,h=0|c}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=(16777215&(a<<i|s)).toString(16);s=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==s||o!==this.length-1?c[6-h.length]+h+r:h+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=l[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var o,a,h="le"===e,u=new t(s),c=this.clone();if(h){for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-i;a++)u[a]=0;for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.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 e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.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 e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var s=0,o=0;o<n.length;o++)s=(e=(0|r.words[o])-(0|n.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,s,o=t.words,a=e.words,h=r.words,u=0,c=0|o[0],l=8191&c,f=c>>>13,d=0|o[1],p=8191&d,m=d>>>13,g=0|o[2],y=8191&g,w=g>>>13,b=0|o[3],v=8191&b,M=b>>>13,k=0|o[4],S=8191&k,E=k>>>13,x=0|o[5],R=8191&x,A=x>>>13,_=0|o[6],B=8191&_,T=_>>>13,O=0|o[7],C=8191&O,P=O>>>13,I=0|o[8],N=8191&I,L=I>>>13,D=0|o[9],U=8191&D,H=D>>>13,j=0|a[0],F=8191&j,q=j>>>13,z=0|a[1],V=8191&z,W=z>>>13,$=0|a[2],K=8191&$,J=$>>>13,Z=0|a[3],X=8191&Z,G=Z>>>13,Q=0|a[4],Y=8191&Q,tt=Q>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],ht=8191&at,ut=at>>>13,ct=0|a[8],lt=8191&ct,ft=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(u+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,q))+Math.imul(f,F)|0))<<13)|0;u=((s=Math.imul(f,q))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(m,F)|0,s=Math.imul(m,q);var yt=(u+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,W)|0)+Math.imul(f,V)|0))<<13)|0;u=((s=s+Math.imul(f,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,q))+Math.imul(w,F)|0,s=Math.imul(w,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,W)|0;var wt=(u+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,K)|0))<<13)|0;u=((s=s+Math.imul(f,J)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(v,F),i=(i=Math.imul(v,q))+Math.imul(M,F)|0,s=Math.imul(M,q),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(w,V)|0,s=s+Math.imul(w,W)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,J)|0;var bt=(u+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(f,X)|0))<<13)|0;u=((s=s+Math.imul(f,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,q))+Math.imul(E,F)|0,s=Math.imul(E,q),n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(M,V)|0,s=s+Math.imul(M,W)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(w,K)|0,s=s+Math.imul(w,J)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,X)|0,s=s+Math.imul(m,G)|0;var vt=(u+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(f,Y)|0))<<13)|0;u=((s=s+Math.imul(f,tt)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,q))+Math.imul(A,F)|0,s=Math.imul(A,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(E,V)|0,s=s+Math.imul(E,W)|0,n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(M,K)|0,s=s+Math.imul(M,J)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(w,X)|0,s=s+Math.imul(w,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,tt)|0;var Mt=(u+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(f,rt)|0))<<13)|0;u=((s=s+Math.imul(f,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,q))+Math.imul(T,F)|0,s=Math.imul(T,q),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(A,V)|0,s=s+Math.imul(A,W)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,J)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,G)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,s=s+Math.imul(m,nt)|0;var kt=(u+(n=n+Math.imul(l,st)|0)|0)+((8191&(i=(i=i+Math.imul(l,ot)|0)+Math.imul(f,st)|0))<<13)|0;u=((s=s+Math.imul(f,ot)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,q))+Math.imul(P,F)|0,s=Math.imul(P,q),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(T,V)|0,s=s+Math.imul(T,W)|0,n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(A,K)|0,s=s+Math.imul(A,J)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,G)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(M,Y)|0,s=s+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(w,rt)|0,s=s+Math.imul(w,nt)|0,n=n+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var St=(u+(n=n+Math.imul(l,ht)|0)|0)+((8191&(i=(i=i+Math.imul(l,ut)|0)+Math.imul(f,ht)|0))<<13)|0;u=((s=s+Math.imul(f,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,q))+Math.imul(L,F)|0,s=Math.imul(L,q),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,W)|0,n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(T,K)|0,s=s+Math.imul(T,J)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(A,X)|0,s=s+Math.imul(A,G)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(M,rt)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(y,st)|0,i=(i=i+Math.imul(y,ot)|0)+Math.imul(w,st)|0,s=s+Math.imul(w,ot)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,ut)|0;var Et=(u+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ft)|0)+Math.imul(f,lt)|0))<<13)|0;u=((s=s+Math.imul(f,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,F),i=(i=Math.imul(U,q))+Math.imul(H,F)|0,s=Math.imul(H,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,s=s+Math.imul(L,W)|0,n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,J)|0,n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,G)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(E,rt)|0,s=s+Math.imul(E,nt)|0,n=n+Math.imul(v,st)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,ot)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,ut)|0)+Math.imul(w,ht)|0,s=s+Math.imul(w,ut)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,lt)|0,s=s+Math.imul(m,ft)|0;var xt=(u+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(f,pt)|0))<<13)|0;u=((s=s+Math.imul(f,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(H,V)|0,s=Math.imul(H,W),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(L,K)|0,s=s+Math.imul(L,J)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,X)|0,s=s+Math.imul(P,G)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,nt)|0,n=n+Math.imul(S,st)|0,i=(i=i+Math.imul(S,ot)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,ot)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ut)|0)+Math.imul(M,ht)|0,s=s+Math.imul(M,ut)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(w,lt)|0,s=s+Math.imul(w,ft)|0;var Rt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,J))+Math.imul(H,K)|0,s=Math.imul(H,J),n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(L,X)|0,s=s+Math.imul(L,G)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,nt)|0,n=n+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(E,ht)|0,s=s+Math.imul(E,ut)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(M,lt)|0,s=s+Math.imul(M,ft)|0;var At=(u+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(w,pt)|0))<<13)|0;u=((s=s+Math.imul(w,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,G))+Math.imul(H,X)|0,s=Math.imul(H,G),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(L,Y)|0,s=s+Math.imul(L,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(P,rt)|0,s=s+Math.imul(P,nt)|0,n=n+Math.imul(B,st)|0,i=(i=i+Math.imul(B,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(A,ht)|0,s=s+Math.imul(A,ut)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(E,lt)|0,s=s+Math.imul(E,ft)|0;var _t=(u+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((s=s+Math.imul(M,mt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,tt))+Math.imul(H,Y)|0,s=Math.imul(H,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(L,rt)|0,s=s+Math.imul(L,nt)|0,n=n+Math.imul(C,st)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,ut)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,ut)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(A,lt)|0,s=s+Math.imul(A,ft)|0;var Bt=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((s=s+Math.imul(E,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(H,rt)|0,s=Math.imul(H,nt),n=n+Math.imul(N,st)|0,i=(i=i+Math.imul(N,ot)|0)+Math.imul(L,st)|0,s=s+Math.imul(L,ot)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,ut)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(T,lt)|0,s=s+Math.imul(T,ft)|0;var Tt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((s=s+Math.imul(A,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,st),i=(i=Math.imul(U,ot))+Math.imul(H,st)|0,s=Math.imul(H,ot),n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,ut)|0)+Math.imul(L,ht)|0,s=s+Math.imul(L,ut)|0,n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(P,lt)|0,s=s+Math.imul(P,ft)|0;var Ot=(u+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,ht),i=(i=Math.imul(U,ut))+Math.imul(H,ht)|0,s=Math.imul(H,ut),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(L,lt)|0,s=s+Math.imul(L,ft)|0;var Ct=(u+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((s=s+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ft))+Math.imul(H,lt)|0,s=Math.imul(H,ft);var Pt=(u+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((s=s+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var It=(u+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(H,pt)|0))<<13)|0;return u=((s=Math.imul(H,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,h[0]=gt,h[1]=yt,h[2]=wt,h[3]=bt,h[4]=vt,h[5]=Mt,h[6]=kt,h[7]=St,h[8]=Et,h[9]=xt,h[10]=Rt,h[11]=At,h[12]=_t,h[13]=Bt,h[14]=Tt,h[15]=Ot,h[16]=Ct,h[17]=Pt,h[18]=It,0!==u&&(h[19]=u,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),s.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var a=67108863&n,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var c=s-u,l=(0|t.words[c])*(0|e.words[u]),f=67108863&l;a=67108863&(f=f+a|0),i+=(o=(o=o+(l/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},g.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var l=h,f=u,d=0;d<o;d++){var p=r[c+d],m=n[c+d],g=r[c+d+o],y=n[c+d+o],w=l*g-f*y;y=l*y+f*g,g=w,r[c+d]=p+g,n[c+d]=m+y,r[c+d+o]=p-g,n[c+d+o]=m-y,d!==a&&(w=h*l-u*f,f=h*f+u*l,l=w)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n(!(-8192&s))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=new Array(n),a=new Array(n),h=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,s,a,h,n,i),this.transform(u,s,c,l,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-h[d]*l[d];h[d]=a[d]*l[d]+h[d]*c[d],a[d]=p}return this.conjugate(a,h,n),this.transform(a,h,f,s,n,i),this.conjugate(f,s,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,s=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this.length=0===t?1: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 e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<r;this.words[e]=h|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=r;if(i-=o,i=Math.max(0,i),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var l=0|this.words[u];this.words[u]=c<<26-s|l>>>s,c=l&a}return h&&0!==c&&(h.words[h.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var h=(0|t.words[i])*e;a=((s-=67108863&h)>>26)-(h/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,h=n.length-i.length;if("mod"!==e){(a=new s(null)).length=h+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,h);0===c.negative&&(n=c,a&&(a.words[h]=1));for(var l=h-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{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,e);var i,o,a},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 e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},s.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var f=0,d=1;0===(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(l)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(c),h.isub(l)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(h)):(r.isub(e),a.isub(i),h.isub(o))}return{a,b:h,gcd:r.iushln(u)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new s(1),a=new s(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0===(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(i=0===e.cmpn(1)?o:a).cmpn(0)<0&&i.iadd(t),i},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},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-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},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 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new S(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.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)}w.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},i(b,w),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&r,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,t.words[i-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,w),i(M,w),i(k,w),k.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new k}return y[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(h);)c.redIAdd(h);for(var l=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(l,new s(1).iushln(p-g-1));f=f.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=h-1;c>=0;c--){var l=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}h=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new E(t)},i(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},89575(t,e,r){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},n.apply(null,arguments)}r.d(e,{A:()=>n})},95309(t,e,r){"use strict";r.d(e,{A:()=>s});var n=r(17545),i=r(2474);function s(t,e){if(e&&("object"==(0,n.A)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.A)(t)}}}]);