@simbachain/libsimba-js
Version:
libsimba-js is a library simplifying the use of SIMBAChain APIs. We aim to abstract away the various blockchain concepts, reducing the necessary time needed to get to working code.
1 lines • 365 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.libsimba=t():e.libsimba=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=224)}([function(e,t,r){"use strict";r.r(t);var n=r(3);r.d(t,"isBytesLike",(function(){return s})),r.d(t,"isBytes",(function(){return c})),r.d(t,"arrayify",(function(){return f})),r.d(t,"concat",(function(){return u})),r.d(t,"stripZeros",(function(){return h})),r.d(t,"zeroPad",(function(){return d})),r.d(t,"isHexString",(function(){return l})),r.d(t,"hexlify",(function(){return b})),r.d(t,"hexDataLength",(function(){return m})),r.d(t,"hexDataSlice",(function(){return g})),r.d(t,"hexConcat",(function(){return v})),r.d(t,"hexValue",(function(){return y})),r.d(t,"hexStripZeros",(function(){return w})),r.d(t,"hexZeroPad",(function(){return S})),r.d(t,"splitSignature",(function(){return x})),r.d(t,"joinSignature",(function(){return M}));const i=new n.Logger("bytes/5.0.0-beta.130");function a(e){return!!e.toHexString}function o(e){return e.slice?e:(e.slice=function(){let t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))},e)}function s(e){return l(e)&&!(e.length%2)||c(e)}function c(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(null==e.length)return!1;for(let t=0;t<e.length;t++){let r=e[t];if(r<0||r>=256||r%1)return!1}return!0}function f(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid arrayify value");let t=[];for(;e;)t.unshift(255&e),e/=256;return 0===t.length&&t.push(0),o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e)&&(e=e.toHexString()),l(e)){let r=e.substring(2);!t.allowOddLength&&r.length%2&&i.throwArgumentError("hex data is odd-length","value",e);let n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return o(new Uint8Array(n))}return c(e)?o(new Uint8Array(e)):i.throwArgumentError("invalid arrayify value","value",e)}function u(e){let t=e.map(e=>f(e)),r=t.reduce((e,t)=>e+t.length,0),n=new Uint8Array(r);return t.reduce((e,t)=>(n.set(t,e),e+t.length),0),o(n)}function h(e){let t=f(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function d(e,t){(e=f(e)).length>t&&i.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}function l(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const p="0123456789abcdef";function b(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=p[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e))return e.toHexString();if(l(e))return!t.allowOddLength&&e.length%2&&i.throwArgumentError("hex data is odd-length","value",e),e.toLowerCase();if(c(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=p[(240&n)>>4]+p[15&n]}return t}return i.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!=typeof e)e=b(e);else if(!l(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!=typeof e?e=b(e):(!l(e)||e.length%2)&&i.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function v(e){let t="0x";return e.forEach(e=>{t+=b(e).substring(2)}),t}function y(e){let t=w(b(e,{allowOddLength:!0}));return"0x"===t?"0x0":t}function w(e){"string"!=typeof e&&(e=b(e)),l(e)||i.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function S(e,t){for("string"!=typeof e?e=b(e):l(e)||i.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&i.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function x(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(s(e)){let r=f(e);65!==r.length&&i.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=b(r.slice(0,32)),t.s=b(r.slice(32,64)),t.v=r[64],27!==t.v&&28!==t.v&&(t.v=27+t.v%2),t.recoveryParam=t.v-27,t.recoveryParam&&(r[32]|=128),t._vs=b(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t.v&&27!=t.v&&28!=t.v&&(t.v=27+t.v%2),null==t.recoveryParam&&null!=t.v?t.recoveryParam=1-t.v%2:null!=t.recoveryParam&&null==t.v?t.v=27+t.recoveryParam:null!=t.recoveryParam&&null!=t.v&&t.v!==27+t.recoveryParam&&i.throwArgumentError("signature v mismatch recoveryParam","signature",e),null!=t.r&&(t.r=S(t.r,32)),null!=t.s&&(t.s=S(t.s,32)),null!=t._vs){t._vs=S(t._vs,32),t._vs.length>66&&i.throwArgumentError("signature _vs overflow","signature",e);let r=f(t._vs),n=r[0]>=128?1:0,a=27+t.recoveryParam;r[0]&=127;let o=b(r);null==t.s?t.s=o:t.s!==o&&i.throwArgumentError("signature v mismatch _vs","signature",e),null==t.v?t.v=a:t.v!==a&&i.throwArgumentError("signature v mismatch _vs","signature",e),null==n?t.recoveryParam=n:t.recoveryParam!==n&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",e)}if(null==t.v&&null==t.recoveryParam&&i.throwArgumentError("signature requires at least one of recoveryParam, v or _vs","signature",e),27!==t.v&&28!==t.v&&i.throwArgumentError("signature v not canonical","signature",e),(t.r.length>66||t.s.length>66)&&i.throwArgumentError("signature overflow r or s","signature",e),null==t._vs){let r=f(t.s);r[0]>=128&&i.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128),t._vs=b(r)}}return t}function M(e){return b(u([(e=x(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,r){"use strict";r.r(t);var n=r(3);r.d(t,"defineReadOnly",(function(){return a})),r.d(t,"getStatic",(function(){return o})),r.d(t,"resolveProperties",(function(){return s})),r.d(t,"checkProperties",(function(){return c})),r.d(t,"shallowCopy",(function(){return f})),r.d(t,"deepCopy",(function(){return h})),r.d(t,"Description",(function(){return d}));const i=new n.Logger("properties/5.0.0-beta.132");function a(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function o(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function s(e){let t=Object.keys(e).map(t=>{let r=e[t];return r instanceof Promise?r.then(e=>({key:t,value:e})):Promise.resolve({key:t,value:r})});return Promise.all(t).then(e=>{return e.reduce((e,t)=>(e[t.key]=t.value,e),{})})}function c(e,t){e&&"object"==typeof e||i.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}function f(e){let t={};for(let r in e)t[r]=e[r];return t}let u={bigint:!0,boolean:!0,number:!0,string:!0};function h(e){if(null==e||u[typeof e])return e;if(Array.isArray(e))return Object.freeze(e.map(e=>h(e)));if("object"==typeof e){if(Object.isFrozen(e))return e;let t={};for(let r in e){let n=e[r];void 0!==n&&a(t,r,h(n))}return t}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)}class d{constructor(e){for(let t in e)this[t]=h(e[t]);Object.freeze(this)}}},function(e,t,r){e.exports=r(41)},function(e,t,r){"use strict";r.r(t);const n="logger/5.0.0-beta.130";r.d(t,"Logger",(function(){return u}));let i=!1,a=!1;const o={debug:1,default:2,info:2,warn:3,error:4,off:5};let s=o.default,c=null;let f=function(){try{let e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();class u{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}setLogLevel(e){let t=o[e];null!=t?s=t:this.warn("invliad log level - "+e)}_log(e,t){s>o[e]||console.log.apply(console,t)}debug(...e){this._log(u.levels.DEBUG,e)}info(...e){this._log(u.levels.INFO,e)}warn(...e){this._log(u.levels.WARNING,e)}makeError(e,t,r){if(a)return new Error("unknown error");t||(t=u.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(e=>{try{n.push(e+"="+JSON.stringify(r[e]))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push("version="+this.version);let i=e;n.length&&(e+=" ("+n.join(", ")+")");let o=new Error(e);return o.reason=i,o.code=t,Object.keys(r).forEach((function(e){o[e]=r[e]})),o}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,u.errors.INVALID_ARGUMENT,{argument:t,value:r})}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",u.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,u.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,u.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,u.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,u.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",u.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",u.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",u.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return c||(c=new u(n)),c}static setCensorship(e,t){if(i){if(!e)return;this.globalLogger().throwError("error censorship permanent",u.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!e,i=!!t}}u.errors={UNKNOWN_ERROR:"UNKNOWN_ERROR",NOT_IMPLEMENTED:"NOT_IMPLEMENTED",UNSUPPORTED_OPERATION:"UNSUPPORTED_OPERATION",NETWORK_ERROR:"NETWORK_ERROR",SERVER_ERROR:"SERVER_ERROR",TIMEOUT:"TIMEOUT",BUFFER_OVERRUN:"BUFFER_OVERRUN",NUMERIC_FAULT:"NUMERIC_FAULT",MISSING_NEW:"MISSING_NEW",INVALID_ARGUMENT:"INVALID_ARGUMENT",MISSING_ARGUMENT:"MISSING_ARGUMENT",UNEXPECTED_ARGUMENT:"UNEXPECTED_ARGUMENT",CALL_EXCEPTION:"CALL_EXCEPTION",INSUFFICIENT_FUNDS:"INSUFFICIENT_FUNDS",NONCE_EXPIRED:"NONCE_EXPIRED",REPLACEMENT_UNDERPRICED:"REPLACEMENT_UNDERPRICED",UNPREDICTABLE_GAS_LIMIT:"UNPREDICTABLE_GAS_LIMIT"},u.levels={DEBUG:"DEBUG",INFO:"INFO",WARNING:"WARNING",ERROR:"ERROR",OFF:"OFF"}},function(e,t){function r(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,c,"next",e)}function c(e){r(o,i,a,s,c,"throw",e)}s(void 0)}))}}},function(e,t,r){var n=r(8),i=r(40),a=r(65),o=r(96),s=n.Symbol,c=i("wks");e.exports=function(e){return c[e]||(c[e]=o&&s[e]||(o?s:a)("Symbol."+e))}},function(e,t,r){var n=r(8),i=r(34).f,a=r(22),o=r(27),s=r(64),c=r(142),f=r(94);e.exports=function(e,t){var r,u,h,d,l,p=e.target,b=e.global,m=e.stat;if(r=b?n:m?n[p]||s(p,{}):(n[p]||{}).prototype)for(u in t){if(d=t[u],h=e.noTargetGet?(l=i(r,u))&&l.value:r[u],!f(b?u:p+(m?".":"#")+u,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;c(d,h)}(e.sham||h&&h.sham)&&a(d,"sham",!0),o(r,u,d,e)}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(138),i=r.n(n),a=r(0);function o(e){return"0x"+i.a.keccak_256(Object(a.arrayify)(e))}},function(e,t,r){(function(t){var r="object",n=function(e){return e&&e.Math==Math&&e};e.exports=n(typeof globalThis==r&&globalThis)||n(typeof window==r&&window)||n(typeof self==r&&self)||n(typeof t==r&&t)||Function("return this")()}).call(this,r(31))},function(e,t,r){"use strict";r(61);var n=r(0);const i=new(r(3).Logger)("strings/5.0.0-beta.131");var a;function o(e,t){e=Object(n.arrayify)(e);let r=[],i=0;for(;i<e.length;){let n=e[i++];if(n>>7==0){r.push(n);continue}let a=null,o=null;if(192==(224&n))a=1,o=127;else if(224==(240&n))a=2,o=2047;else{if(240!=(248&n)){if(!t){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}a=3,o=65535}if(i+a>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;i<e.length&&e[i]>>6==2;i++);continue}let s=n&(1<<8-a-1)-1;for(let t=0;t<a;t++){let t=e[i];if(128!=(192&t)){s=null;break}s=s<<6|63&t,i++}if(null!==s)if(s<=o){if(!t)throw new Error("invalid utf8 byte sequence; overlong")}else if(s>1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(s>=55296&&s<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else r.push(s);else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}return r}function s(e,t=a.current){t!=a.current&&(i.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;let i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");n=65536+((1023&n)<<10)+(1023&i),r.push(n>>18|240),r.push(n>>12&63|128),r.push(n>>6&63|128),r.push(63&n|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Object(n.arrayify)(r)}function c(e){return e.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("")}function f(e,t=a.current){return o(s(e,t))}function u(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach(e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])}),n}function h(e){let t=0;return e.split(",").map(e=>{let r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}})}function d(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(e>=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(a||(a={}));const l=h("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),p="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),b=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],m=u("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),g=u("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),v=u("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),y=h("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function w(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=f(e);var r;r=t.map(e=>{if(p.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=d(e,b);if(t)return[e+t.s];let r=m[e];if(r)return r;let n=g[e];if(n)return[e+n[0]];let i=v[e];return i||null}(e);return t||[e]}),(t=f(c(t=r.reduce((e,t)=>(t.forEach(t=>{e.push(t)}),e),[])),a.NFKC)).forEach(e=>{if(function(e){return!!d(e,y)}(e))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(e=>{if(function(e){return!!d(e,l)}(e))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let n=c(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}r.d(t,"c",(function(){return s})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return w}))},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,r){"use strict";var n=r(13),i=r(0),a=r(3);const o="bignumber/5.0.0-beta.131",s=new a.Logger(o),c={},f=9007199254740991;class u{constructor(e,t){s.checkNew(new.target,u),e!==c&&s.throwError("cannot call consturtor directly; use BigNumber.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return d(l(this).fromTwos(e))}toTwos(e){return d(l(this).toTwos(e))}abs(){return"-"===this._hex[0]?u.from(this._hex.substring(1)):this}add(e){return d(l(this).add(l(e)))}sub(e){return d(l(this).sub(l(e)))}div(e){return u.from(e).isZero()&&p("division by zero","div"),d(l(this).div(l(e)))}mul(e){return d(l(this).mul(l(e)))}mod(e){return d(l(this).mod(l(e)))}pow(e){return d(l(this).pow(l(e)))}maskn(e){return d(l(this).maskn(e))}eq(e){return l(this).eq(l(e))}lt(e){return l(this).lt(l(e))}lte(e){return l(this).lte(l(e))}gt(e){return l(this).gt(l(e))}gte(e){return l(this).gte(l(e))}isZero(){return l(this).isZero()}toNumber(){try{return l(this).toNumber()}catch(e){p("overflow","toNumber",this.toString())}return null}toString(){return 0!==arguments.length&&s.throwError("bigNumber.toString does not accept parameters",a.Logger.errors.UNEXPECTED_ARGUMENT,{}),l(this).toString(10)}toHexString(){return this._hex}static from(e){return e instanceof u?e:"string"==typeof e?e.match(/-?0x[0-9a-f]+/i)?new u(c,h(e)):e.match(/^-?[0-9]+$/)?new u(c,h(new n.BN(e))):s.throwArgumentError("invalid BigNumber string","value",e):"number"==typeof e?(e%1&&p("underflow","BigNumber.from",e),(e>=f||e<=-f)&&p("overflow","BigNumber.from",e),u.from(String(e))):"bigint"==typeof e?u.from(e.toString()):Object(i.isBytes)(e)?u.from(Object(i.hexlify)(e)):e._hex&&Object(i.isHexString)(e._hex)?u.from(e._hex):e.toHexString&&"string"==typeof(e=e.toHexString())?u.from(e):s.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function h(e){if("string"!=typeof e)return h(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&s.throwArgumentError("invalid hex","value",e),"0x00"===(e=h(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function d(e){return u.from(h(e))}function l(e){let t=u.from(e).toHexString();return"-"===t[0]?new n.BN("-"+t.substring(3),16):new n.BN(t.substring(2),16)}function p(e,t,r){let n={fault:e,operation:t};return null!=r&&(n.value=r),s.throwError(e,a.Logger.errors.NUMERIC_FAULT,n)}new a.Logger(o),u.from(0),u.from(-1);let b="0";for(;b.length<256;)b+=b;r.d(t,"a",(function(){return u}))},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o=r(189).Buffer}catch(e){}function s(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a<i;a++){var o=e.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function c(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=e.length-6,n=0;r>=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,f=0,u=r;u<s;u+=n)f=c(e,u,u+n,t),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==o){var h=1;for(f=c(e,u,e.length,t),u=0;u<o;u++)h*=t;this.imuln(h),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var u=c>>>26,h=67108863&c,d=Math.min(f,t.length-1),l=Math.max(0,f-e.length+1);l<=d;l++){var p=f-l|0;u+=(o=(i=0|e.words[p])*(a=0|t.words[l])+h)/67108864|0,h=67108863&o}r.words[f]=0|h,c=0|u}return 0!==c?r.words[f]=0|c:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=(16777215&(s<<i|a)).toString(16);r=0!==(a=s>>>24-i&16777215)||o!==this.length-1?f[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,c="le"===t,f=new e(a),u=this.clone();if(c){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),f[s]=o;for(;s<a;s++)f[s]=0}else{for(s=0;s<a-i;s++)f[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),f[a-s-1]=o}return f},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&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()},a.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,a,o=e.words,s=t.words,c=r.words,f=0,u=0|o[0],h=8191&u,d=u>>>13,l=0|o[1],p=8191&l,b=l>>>13,m=0|o[2],g=8191&m,v=m>>>13,y=0|o[3],w=8191&y,S=y>>>13,x=0|o[4],M=8191&x,A=x>>>13,_=0|o[5],E=8191&_,O=_>>>13,k=0|o[6],P=8191&k,j=k>>>13,I=0|o[7],R=8191&I,T=I>>>13,C=0|o[8],B=8191&C,F=C>>>13,N=0|o[9],L=8191&N,z=N>>>13,D=0|s[0],U=8191&D,q=D>>>13,W=0|s[1],K=8191&W,G=W>>>13,H=0|s[2],V=8191&H,J=H>>>13,Z=0|s[3],X=8191&Z,Y=Z>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ce=8191&se,fe=se>>>13,ue=0|s[8],he=8191&ue,de=ue>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,U)|0))<<13)|0;f=((a=Math.imul(d,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,q))+Math.imul(b,U)|0,a=Math.imul(b,q);var ge=(f+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,K)|0))<<13)|0;f=((a=a+Math.imul(d,G)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,U),i=(i=Math.imul(g,q))+Math.imul(v,U)|0,a=Math.imul(v,q),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,G)|0;var ve=(f+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,V)|0))<<13)|0;f=((a=a+Math.imul(d,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,q))+Math.imul(S,U)|0,a=Math.imul(S,q),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(v,K)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,V)|0,a=a+Math.imul(b,J)|0;var ye=(f+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,X)|0))<<13)|0;f=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,q))+Math.imul(A,U)|0,a=Math.imul(A,q),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,V)|0,a=a+Math.imul(v,J)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,X)|0,a=a+Math.imul(b,Y)|0;var we=(f+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,Q)|0))<<13)|0;f=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,q))+Math.imul(O,U)|0,a=Math.imul(O,q),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(S,V)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0;var Se=(f+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,q))+Math.imul(j,U)|0,a=Math.imul(j,q),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,V)|0,a=a+Math.imul(A,J)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(S,X)|0,a=a+Math.imul(S,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0;var xe=(f+(n=n+Math.imul(h,ae)|0)|0)+((8191&(i=(i=i+Math.imul(h,oe)|0)+Math.imul(d,ae)|0))<<13)|0;f=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,q))+Math.imul(T,U)|0,a=Math.imul(T,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(j,K)|0,a=a+Math.imul(j,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(O,V)|0,a=a+Math.imul(O,J)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(A,X)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0;var Me=(f+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(d,ce)|0))<<13)|0;f=((a=a+Math.imul(d,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,q))+Math.imul(F,U)|0,a=Math.imul(F,q),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,G)|0,n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(j,V)|0,a=a+Math.imul(j,J)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(O,X)|0,a=a+Math.imul(O,Y)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ne)|0,n=n+Math.imul(g,ae)|0,i=(i=i+Math.imul(g,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,fe)|0;var Ae=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;f=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,q))+Math.imul(z,U)|0,a=Math.imul(z,q),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(F,K)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(T,V)|0,a=a+Math.imul(T,J)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(j,X)|0,a=a+Math.imul(j,Y)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,ce)|0,a=a+Math.imul(v,fe)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,he)|0,a=a+Math.imul(b,de)|0;var _e=(f+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(d,pe)|0))<<13)|0;f=((a=a+Math.imul(d,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,G))+Math.imul(z,K)|0,a=Math.imul(z,G),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(F,V)|0,a=a+Math.imul(F,J)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(T,X)|0,a=a+Math.imul(T,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(j,Q)|0,a=a+Math.imul(j,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ne)|0,n=n+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,fe)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,he)|0,a=a+Math.imul(v,de)|0;var Ee=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;f=((a=a+Math.imul(b,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,J))+Math.imul(z,V)|0,a=Math.imul(z,J),n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(F,X)|0,a=a+Math.imul(F,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(j,re)|0,a=a+Math.imul(j,ne)|0,n=n+Math.imul(E,ae)|0,i=(i=i+Math.imul(E,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,fe)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(S,he)|0,a=a+Math.imul(S,de)|0;var Oe=(f+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;f=((a=a+Math.imul(v,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,X),i=(i=Math.imul(L,Y))+Math.imul(z,X)|0,a=Math.imul(z,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,Q)|0,a=a+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(P,ae)|0,i=(i=i+Math.imul(P,oe)|0)+Math.imul(j,ae)|0,a=a+Math.imul(j,oe)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,fe)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(A,he)|0,a=a+Math.imul(A,de)|0;var ke=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(S,pe)|0))<<13)|0;f=((a=a+Math.imul(S,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(z,Q)|0,a=Math.imul(z,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,a=a+Math.imul(F,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(j,ce)|0,a=a+Math.imul(j,fe)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(O,he)|0,a=a+Math.imul(O,de)|0;var Pe=(f+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(A,pe)|0))<<13)|0;f=((a=a+Math.imul(A,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(z,re)|0,a=Math.imul(z,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(F,ae)|0,a=a+Math.imul(F,oe)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(T,ce)|0,a=a+Math.imul(T,fe)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(j,he)|0,a=a+Math.imul(j,de)|0;var je=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(O,pe)|0))<<13)|0;f=((a=a+Math.imul(O,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(z,ae)|0,a=Math.imul(z,oe),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(F,ce)|0,a=a+Math.imul(F,fe)|0,n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(T,he)|0,a=a+Math.imul(T,de)|0;var Ie=(f+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(j,pe)|0))<<13)|0;f=((a=a+Math.imul(j,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,ce),i=(i=Math.imul(L,fe))+Math.imul(z,ce)|0,a=Math.imul(z,fe),n=n+Math.imul(B,he)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,he)|0,a=a+Math.imul(F,de)|0;var Re=(f+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(T,pe)|0))<<13)|0;f=((a=a+Math.imul(T,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,he),i=(i=Math.imul(L,de))+Math.imul(z,he)|0,a=Math.imul(z,de);var Te=(f+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(F,pe)|0))<<13)|0;f=((a=a+Math.imul(F,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Ce=(f+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,be))+Math.imul(z,pe)|0))<<13)|0;return f=((a=Math.imul(z,be))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=we,c[5]=Se,c[6]=xe,c[7]=Me,c[8]=Ae,c[9]=_e,c[10]=Ee,c[11]=Oe,c[12]=ke,c[13]=Pe,c[14]=je,c[15]=Ie,c[16]=Re,c[17]=Te,c[18]=Ce,0!==f&&(c[19]=f,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=d),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,c=Math.min(a,t.length-1),f=Math.max(0,a-e.length+1);f<=c;f++){var u=a-f,h=(0|e.words[u])*(0|t.words[f]),d=67108863&h;s=67108863&(d=d+s|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},b.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,c=Math.cos(2*Math.PI/s),f=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var h=c,d=f,l=0;l<o;l++){var p=r[u+l],b=n[u+l],m=r[u+l+o],g=n[u+l+o],v=h*m-d*g;g=h*g+d*m,m=v,r[u+l]=p+m,n[u+l]=b+g,r[u+l+o]=p-m,n[u+l+o]=b-g,l!==s&&(v=c*h-f*d,d=c*d+f*h,h=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(0===a),n(0==(-8192&a))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),c=new Array(n),f=new Array(n),u=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,a,s,c,n,i),this.transform(f,a,u,h,n,i);for(var l=0;l<n;l++){var p=s[l]*u[l]-c[l]*h[l];c[l]=s[l]*h[l]+c[l]*u[l],s[l]=p}return this.conjugate(s,c,n),this.transform(s,c,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),p(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){v