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

1 line
60 KiB
JavaScript

(("undefined"!=typeof self?self:this).webpackChunk_pezkuwi_apps=("undefined"!=typeof self?self:this).webpackChunk_pezkuwi_apps||[]).push([[9424],{2836(t,i,e){"use strict";function r(t,i){return"bigint"==typeof i?i.toString():i}function n(t,i){return JSON.stringify(t,r,i)}e.d(i,{A:()=>n})},4235(t,i,e){"use strict";e.d(i,{A:()=>s});var r=e(12085);function n(t,i,e){Object.defineProperty(t,i,{configurable:!0,enumerable:!1,value:e})}class s extends Error{code;data;message;name;stack;constructor(t="",i=-99999,e){if(super(),n(this,"message",String(t)),n(this,"name",this.constructor.name),n(this,"data",e),n(this,"code",i),(0,r.T)(Error.captureStackTrace))Error.captureStackTrace(this,this.constructor);else{const{stack:i}=new Error(t);i&&n(this,"stack",i)}}static CODES={ASSERT:-90009,INVALID_JSONRPC:-99998,METHOD_NOT_FOUND:-32601,UNKNOWN:-99999}}},4721(t,i,e){"use strict";e.d(i,{A:()=>r});const r={HTTP_URL:"http://127.0.0.1:9933",WS_URL:"ws://127.0.0.1:9944"}},5557(t,i,e){"use strict";function r(t){return void 0===t}e.d(i,{b:()=>r})},12085(t,i,e){"use strict";function r(t){return"function"==typeof t}e.d(i,{T:()=>r})},20136(t,i,e){"use strict";e.d(i,{Mn:()=>r,pc:()=>n});const r="undefined"!=typeof globalThis?globalThis:void 0!==e.g?e.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this");function n(t,i){return void 0===r[t]?i:r[t]}},34502(t,i,e){"use strict";e.d(i,{E:()=>y});var r=e(27429),n=e(72347),s=e(61734),o=e(12085);function h(...t){return i=>(0,o.T)(i)&&t.every(t=>(0,o.T)(i[t]))}const a=h("isPrototypeOf","hasOwnProperty");var u=e(2836),l=e(5557),c=e(20136),d=e(90338),f=e(64533),m=e(4721),p=e(58602);const g={1e3:"Normal Closure",1001:"Going Away",1002:"Protocol Error",1003:"Unsupported Data",1004:"(For future)",1005:"No Status Received",1006:"Abnormal Closure",1007:"Invalid frame payload data",1008:"Policy Violation",1009:"Message too big",1010:"Missing Extension",1011:"Internal Error",1012:"Service Restart",1013:"Try Again Later",1014:"Bad Gateway",1015:"TLS Handshake"},v={chain_finalisedHead:"chain_finalizedHead",chain_subscribeFinalisedHeads:"chain_subscribeFinalizedHeads",chain_unsubscribeFinalisedHeads:"chain_unsubscribeFinalizedHeads"},M=(0,n.v)("api-ws");function w(t,i){Object.keys(t).forEach(e=>{i&&i(t[e]),delete t[e]})}class y{#t;#i;#e;#r;#n;#s={};#o;#h;#a={};#u;#l;#c;#d;#f;#m=!1;#p={};#g=null;#v;#M;constructor(t=m.A.WS_URL,i=2500,e={},n,o,h){const a=Array.isArray(t)?t:[t];if(0===a.length)throw new Error("WsProvider requires at least one Endpoint");a.forEach(t=>{if(!/^(wss|ws):\/\//.test(t))throw new Error(`Endpoint should start with 'ws://', received '${t}'`)});const u=void 0===h?p.HX:h;this.#t=new p.qK(0===o?0:o||p.bo,u),this.#l=h,this.#u=o||p.bo,this.#n=new r.b,this.#c=i||0,this.#i=new f.$,this.#d=-1,this.#e=a,this.#r=e,this.#v=null,this.#h={active:{requests:0,subscriptions:0},total:{bytesRecv:0,bytesSent:0,cached:0,errors:0,requests:0,subscriptions:0,timeout:0}},this.#f={bytesRecv:0,bytesSent:0,cached:0,errors:0,requests:0,subscriptions:0,timeout:0},this.#M=n||6e4,i&&i>0&&this.connectWithRetry().catch(s.l),this.#o=new Promise(t=>{this.#n.once("connected",()=>{t(this)})})}get hasSubscriptions(){return!0}get isClonable(){return!0}get isConnected(){return this.#m}get isReady(){return this.#o}get endpoint(){return this.#e[this.#d]}clone(){return new y(this.#e)}selectEndpointIndex(t){return(this.#d+1)%t.length}async connect(){if(this.#v)throw new Error("WebSocket is already connected");try{this.#d=this.selectEndpointIndex(this.#e),this.#v=void 0!==c.Mn.WebSocket&&(t=c.Mn.WebSocket,i=d.k,a(i)&&a(t)&&(t===i||t.isPrototypeOf(i)))?new d.k(this.endpoint):new d.k(this.endpoint,void 0,{headers:this.#r}),this.#v&&(this.#v.onclose=this.#w,this.#v.onerror=this.#y,this.#v.onmessage=this.#b,this.#v.onopen=this.#k),this.#g=setInterval(()=>this.#_(),5e3)}catch(t){throw M.error(t),this.#S("error",t),t}var t,i}async connectWithRetry(){if(this.#c>0)try{await this.connect()}catch{setTimeout(()=>{this.connectWithRetry().catch(s.l)},this.#c)}}async disconnect(){this.#c=0;try{this.#v&&this.#v.close(1e3)}catch(t){throw M.error(t),this.#S("error",t),t}}get stats(){return{active:{requests:Object.keys(this.#s).length,subscriptions:Object.keys(this.#p).length},total:this.#h.total}}get ttl(){return this.#l}get endpointStats(){return this.#f}on(t,i){return this.#n.on(t,i),()=>{this.#n.removeListener(t,i)}}send(t,i,e,r){this.#f.requests++,this.#h.total.requests++;const[n,s]=this.#i.encodeJson(t,i);if(0===this.#u)return this.#A(n,s,t,i,r);const o=e?`${t}::${(0,u.A)(i)}`:"";let h=e?this.#t.get(o):null;return h?(this.#f.cached++,this.#h.total.cached++):(h=this.#A(n,s,t,i,r),e&&this.#t.set(o,h)),h}async#A(t,i,e,r,n){return new Promise((s,o)=>{try{if(!this.isConnected||null===this.#v)throw new Error("WebSocket is not connected");const h=(t,i)=>{t?o(t):s(i)};M.debug(()=>["calling",e,i]),this.#s[t]={callback:h,method:e,params:r,start:Date.now(),subscription:n};const a=i.length;this.#f.bytesSent+=a,this.#h.total.bytesSent+=a,this.#v.send(i)}catch(t){this.#f.errors++,this.#h.total.errors++;const i=t,n=`\nFailed WS Request: ${JSON.stringify({method:e,params:r})}`;i.message=`${i.message}${n}`,o(i)}})}subscribe(t,i,e,r){return this.#f.subscriptions++,this.#h.total.subscriptions++,this.send(i,e,!1,{callback:r,type:t})}async unsubscribe(t,i,e){const r=`${t}::${e}`;if((0,l.b)(this.#p[r]))return M.debug(()=>`Unable to find active subscription=${r}`),!1;delete this.#p[r];try{return!this.isConnected||null===this.#v||this.send(i,[e])}catch{return!1}}#S=(t,...i)=>{this.#n.emit(t,...i)};#w=t=>{const i=new Error(`disconnected from ${this.endpoint}: ${t.code}:: ${t.reason||function(t){if(t>=0&&t<=999)return"(Unused)";if(t>=1016){if(t<=1999)return"(For WebSocket standard)";if(t<=2999)return"(For WebSocket extensions)";if(t<=3999)return"(For libraries and frameworks)";if(t<=4999)return"(For applications)"}return g[t]||"(Unknown)"}(t.code)}`);this.#c>0&&M.error(i.message),this.#m=!1,this.#v&&(this.#v.onclose=null,this.#v.onerror=null,this.#v.onmessage=null,this.#v.onopen=null,this.#v=null),this.#g&&(clearInterval(this.#g),this.#g=null),w(this.#s,t=>{try{t.callback(i,void 0)}catch(t){M.error(t)}}),w(this.#a),this.#f={bytesRecv:0,bytesSent:0,cached:0,errors:0,requests:0,subscriptions:0,timeout:0},this.#S("disconnected"),this.#c>0&&setTimeout(()=>{this.connectWithRetry().catch(s.l)},this.#c)};#y=t=>{M.debug(()=>["socket error",t]),this.#S("error",t)};#b=t=>{M.debug(()=>["received",t.data]);const i=t.data.length;this.#f.bytesRecv+=i,this.#h.total.bytesRecv+=i;const e=JSON.parse(t.data);return(0,l.b)(e.method)?this.#x(e):this.#R(e)};#x=t=>{const i=this.#s[t.id];if(i){try{const{method:e,params:r,subscription:n}=i,s=this.#i.decodeResponse(t);if(i.callback(null,s),n){const t=`${n.type}::${s}`;this.#p[t]=function(t,...i){const e=new Set(["__proto__","constructor","prototype"]);for(let r=0,n=i.length;r<n;r++){const n=i[r];if(n)if("function"==typeof n.entries)for(const[i,r]of n.entries())e.has(i)||(t[i]=r);else{const i=Object.create(null);for(const[t,r]of Object.entries(n))e.has(t)||(i[t]=r);Object.assign(t,i)}}return t}({},n,{method:e,params:r}),this.#a[t]&&this.#R(this.#a[t])}}catch(t){this.#f.errors++,this.#h.total.errors++,i.callback(t,void 0)}delete this.#s[t.id]}else M.debug(()=>`Unable to find handler for id=${t.id}`)};#R=t=>{if(!t.method)throw new Error("No method found in JSONRPC response");const i=`${v[t.method]||t.method}::${t.params.subscription}`,e=this.#p[i];if(!e)return this.#a[i]=t,void M.debug(()=>`Unable to find handler for subscription=${i}`);delete this.#a[i];try{const i=this.#i.decodeResponse(t);e.callback(null,i)}catch(t){this.#f.errors++,this.#h.total.errors++,e.callback(t,void 0)}};#k=()=>{if(null===this.#v)throw new Error("WebSocket cannot be null in onOpen");return M.debug(()=>["connected to",this.endpoint]),this.#m=!0,this.#C(),this.#S("connected"),!0};#C=()=>{const t=this.#p;this.#p={},Promise.all(Object.keys(t).map(async i=>{const{callback:e,method:r,params:n,type:s}=t[i];if(!s.startsWith("author_"))try{await this.subscribe(s,r,n,e)}catch(t){M.error(t)}})).catch(M.error)};#_=()=>{const t=Date.now(),i=Object.keys(this.#s);for(let e=0,r=i.length;e<r;e++){const r=this.#s[i[e]];if(t-r.start>this.#M){try{r.callback(new Error(`No response received from RPC endpoint in ${this.#M/1e3}s`),void 0)}catch{}this.#f.timeout++,this.#h.total.timeout++,delete this.#s[i[e]]}}}}},58602(t,i,e){"use strict";e.d(i,{HX:()=>n,bo:()=>r,qK:()=>o});const r=1024,n=3e4;class s{key;#E;#l;createdAt;next;prev;constructor(t,i){this.key=t,this.#l=i,this.#E=Date.now()+i,this.createdAt=Date.now(),this.next=this.prev=this}refresh(){this.#E=Date.now()+this.#l}get expiry(){return this.#E}}class o{capacity;#T=new Map;#$=new Map;#N=0;#I;#q;#l;constructor(t=r,i=n){if(!Number.isInteger(t)||t<0)throw new Error(`LRUCache initialization error: 'capacity' must be a non-negative integer. Received: ${t}`);if(null!==i&&(!Number.isFinite(i)||i<0||i>18e5))throw new Error(`LRUCache initialization error: 'ttl' must be between 0 and 1800000 ms or null to disable. Received: ${i}`);this.capacity=t,this.#l=i||31536e6,this.#I=this.#q=new s("<empty>",this.#l)}get ttl(){return this.#l}get length(){return this.#N}get lengthData(){return this.#T.size}get lengthRefs(){return this.#$.size}entries(){const t=this.keys(),i=t.length,e=new Array(i);for(let r=0;r<i;r++){const i=t[r];e[r]=[i,this.#T.get(i)]}return e}keys(){const t=[];if(this.#N){let i=this.#I;for(;i!==this.#q;)t.push(i.key),i=i.next;t.push(i.key)}return t}get(t){const i=this.#T.get(t);return i?(this.#O(t),this.#L(),i):(this.#L(),null)}set(t,i){if(this.#T.has(t))this.#O(t);else{const i=new s(t,this.#l);this.#$.set(i.key,i),0===this.length?this.#I=this.#q=i:(this.#I.prev=i,i.next=this.#I,this.#I=i),this.#N===this.capacity?(this.#T.delete(this.#q.key),this.#$.delete(this.#q.key),this.#q=this.#q.prev,this.#q.next=this.#I):this.#N+=1}this.#L(),this.#T.set(t,i)}#L(){for(;this.#q.expiry&&this.#q.expiry<Date.now()&&this.#N>0;)this.#$.delete(this.#q.key),this.#T.delete(this.#q.key),this.#N-=1,this.#q=this.#q.prev,this.#q.next=this.#I;0===this.#N&&(this.#I=this.#q=new s("<empty>",this.#l))}#O(t){const i=this.#$.get(t);i&&i!==this.#I&&(i.refresh(),i.prev.next=i.next,i.next.prev=i.prev,i.next=this.#I,this.#I.prev=i,this.#I=i)}}},61734(t,i,e){"use strict";function r(){}e.d(i,{l:()=>r})},63145(t,i,e){"use strict";e.d(i,{e:()=>d});var r=e(72347),n=e(61734),s=e(2836);const o=e(20136).Mn.fetch;var h=e(64533),a=e(4721),u=e(58602);const l="HTTP Provider does not have subscriptions, use WebSockets instead",c=(0,r.v)("api-http");class d{#t;#u;#i;#B;#r;#h;#l;constructor(t=a.A.HTTP_URL,i={},e,r){if(!/^(https|http):\/\//.test(t))throw new Error(`Endpoint should start with 'http://' or 'https://', received '${t}'`);this.#i=new h.$,this.#B=t,this.#r=i,this.#u=0===e?0:e||u.bo;const n=void 0===r?u.HX:r;this.#t=new u.qK(0===e?0:e||u.bo,n),this.#l=r,this.#h={active:{requests:0,subscriptions:0},total:{bytesRecv:0,bytesSent:0,cached:0,errors:0,requests:0,subscriptions:0,timeout:0}}}get hasSubscriptions(){return!1}clone(){return new d(this.#B,this.#r)}async connect(){}async disconnect(){}get stats(){return this.#h}get ttl(){return this.#l}get isClonable(){return!0}get isConnected(){return!0}on(t,i){return c.error("HTTP Provider does not have 'on' emitters, use WebSockets instead"),n.l}async send(t,i,e){this.#h.total.requests++;const[,r]=this.#i.encodeJson(t,i);if(0===this.#u)return this.#A(r);const n=e?`${t}::${(0,s.A)(i)}`:"";let o=e?this.#t.get(n):null;return o?this.#h.total.cached++:(o=this.#A(r),e&&this.#t.set(n,o)),o}async#A(t){this.#h.active.requests++,this.#h.total.bytesSent+=t.length;try{const i=await o(this.#B,{body:t,headers:{Accept:"application/json","Content-Length":`${t.length}`,"Content-Type":"application/json",...this.#r},method:"POST"});if(!i.ok)throw new Error(`[${i.status}]: ${i.statusText}`);const e=await i.text();this.#h.total.bytesRecv+=e.length;const r=this.#i.decodeResponse(JSON.parse(e));return this.#h.active.requests--,r}catch(i){this.#h.active.requests--,this.#h.total.errors++;const{method:e,params:r}=JSON.parse(t),n=i,s=`\nFailed HTTP Request: ${JSON.stringify({method:e,params:r})}`;throw n.message=`${n.message}${s}`,n}}async subscribe(t,i,e,r){throw c.error(l),new Error(l)}async unsubscribe(t,i,e){throw c.error(l),new Error(l)}}},64533(t,i,e){"use strict";e.d(i,{$:()=>u});var r=e(5557);function n(t){return"string"==typeof t||t instanceof String}var s=e(2836);function o(t){return"number"==typeof t}var h=e(4235);function a(t){if(t){const{code:i,data:e,message:o}=t;throw new h.A(`${i}: ${o}${function(t){if((0,r.b)(t))return"";const i=`: ${n(t)?t.replace(/Error\("/g,"").replace(/\("/g,"(").replace(/"\)/g,")").replace(/\(/g,", ").replace(/\)/g,""):(0,s.A)(t)}`;return i.length<=256?i:`${i.substring(0,255)}`}(e)}`,i,e)}}class u{#U=0;decodeResponse(t){if(!t||"2.0"!==t.jsonrpc)throw new Error("Invalid jsonrpc field in decoded object");const i=!(0,r.b)(t.params)&&!(0,r.b)(t.method);if(!(o(t.id)||i&&(o(t.params.subscription)||n(t.params.subscription))))throw new Error("Invalid id field in decoded object");if(a(t.error),void 0===t.result&&!i)throw new Error("No result found in jsonrpc response");return i?(a(t.params.error),t.params.result):t.result}encodeJson(t,i){const[e,r]=this.encodeObject(t,i);return[e,(0,s.A)(r)]}encodeObject(t,i){const e=++this.#U;return[e,{id:e,jsonrpc:"2.0",method:t,params:i}]}}},71343(t,i,e){!function(t,i){"use strict";function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var e=function(){};e.prototype=i.prototype,t.prototype=new e,t.prototype.constructor=t}function s(t,i,e){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(e=i,i=10),this._init(t||0,i||10,e||"be"))}var o;"object"==typeof t?t.exports=s:i.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e(15391).Buffer}catch(t){}function h(t,i){var e=t.charCodeAt(i);return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void r(!1,"Invalid character in "+t)}function a(t,i,e){var r=h(t,e);return e-1>=i&&(r|=h(t,e-1)<<4),r}function u(t,i,e,n){for(var s=0,o=0,h=Math.min(t.length,e),a=i;a<h;a++){var u=t.charCodeAt(a)-48;s*=n,o=u>=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&o<n,"Invalid character"),s+=o}return s}function l(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.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,i){return t.cmp(i)>0?t:i},s.min=function(t,i){return t.cmp(i)<0?t:i},s.prototype._init=function(t,i,e){if("number"==typeof t)return this._initNumber(t,i,e);if("object"==typeof t)return this._initArray(t,i,e);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===i?this._parseHex(t,n,e):(this._parseBase(t,i,n),"le"===e&&this._initArray(this.toArray(),i,e)))},s.prototype._initNumber=function(t,i,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===e&&this._initArray(this.toArray(),i,e)},s.prototype._initArray=function(t,i,e){if(r("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 n=0;n<this.length;n++)this.words[n]=0;var s,o,h=0;if("be"===e)for(n=t.length-1,s=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<<h&67108863,this.words[s+1]=o>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);else if("le"===e)for(n=0,s=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[s]|=o<<h&67108863,this.words[s+1]=o>>>26-h&67108863,(h+=24)>=26&&(h-=26,s++);return this._strip()},s.prototype._parseHex=function(t,i,e){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,s=0,o=0;if("be"===e)for(r=t.length-1;r>=i;r-=2)n=a(t,i,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(r=(t.length-i)%2==0?i+1:i;r<t.length;r+=2)n=a(t,i,r)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,i,e){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=i)r++;r--,n=n/i|0;for(var s=t.length-e,o=s%r,h=Math.min(s,s-o)+e,a=0,l=e;l<h;l+=r)a=u(t,l,l+r,i),this.imuln(n),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==o){var c=1;for(a=u(t,l,t.length,i),l=0;l<o;l++)c*=i;this.imuln(c),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}this._strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype._move=function(t){l(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")]=c}catch(t){s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],f=[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],m=[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 p(t,i,e){e.negative=i.negative^t.negative;var r=t.length+i.length|0;e.length=r,r=r-1|0;var n=0|t.words[0],s=0|i.words[0],o=n*s,h=67108863&o,a=o/67108864|0;e.words[0]=h;for(var u=1;u<r;u++){for(var l=a>>>26,c=67108863&a,d=Math.min(u,i.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var m=u-f|0;l+=(o=(n=0|t.words[m])*(s=0|i.words[f])+c)/67108864|0,c=67108863&o}e.words[u]=0|c,a=0|l}return 0!==a?e.words[u]=0|a:e.length--,e._strip()}s.prototype.toString=function(t,i){var e;if(i=0|i||1,16===(t=t||10)||"hex"===t){e="";for(var n=0,s=0,o=0;o<this.length;o++){var h=this.words[o],a=(16777215&(h<<n|s)).toString(16);s=h>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),e=0!==s||o!==this.length-1?d[6-a.length]+a+e:a+e}for(0!==s&&(e=s.toString(16)+e);e.length%i!==0;)e="0"+e;return 0!==this.negative&&(e="-"+e),e}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],l=m[t];e="";var c=this.clone();for(c.negative=0;!c.isZero();){var p=c.modrn(l).toString(t);e=(c=c.idivn(l)).isZero()?p+e:d[u-p.length]+p+e}for(this.isZero()&&(e="0"+e);e.length%i!==0;)e="0"+e;return 0!==this.negative&&(e="-"+e),e}r(!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&&r(!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,i){return this.toArrayLike(o,t,i)}),s.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},s.prototype.toArrayLike=function(t,i,e){this._strip();var n=this.byteLength(),s=e||Math.max(1,n);r(n<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,s);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(t,i){for(var e=0,r=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|r;t[e++]=255&o,e<t.length&&(t[e++]=o>>8&255),e<t.length&&(t[e++]=o>>16&255),6===s?(e<t.length&&(t[e++]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(e<t.length)for(t[e++]=r;e<t.length;)t[e++]=0},s.prototype._toArrayLikeBE=function(t,i){for(var e=t.length-1,r=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|r;t[e--]=255&o,e>=0&&(t[e--]=o>>8&255),e>=0&&(t[e--]=o>>16&255),6===s?(e>=0&&(t[e--]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(e>=0)for(t[e--]=r;e>=0;)t[e--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var i=t,e=0;return i>=4096&&(e+=13,i>>>=13),i>=64&&(e+=7,i>>>=7),i>=8&&(e+=4,i>>>=4),i>=2&&(e+=2,i>>>=2),e+i},s.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,e=0;return 8191&i||(e+=13,i>>>=13),127&i||(e+=7,i>>>=7),15&i||(e+=4,i>>>=4),3&i||(e+=2,i>>>=2),1&i||e++,e},s.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var e=this._zeroBits(this.words[i]);if(t+=e,26!==e)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 i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this._strip()},s.prototype.ior=function(t){return r(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 i;i=this.length>t.length?t:this;for(var e=0;e<i.length;e++)this.words[e]=this.words[e]&t.words[e];return this.length=i.length,this._strip()},s.prototype.iand=function(t){return r(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 i,e;this.length>t.length?(i=this,e=t):(i=t,e=this);for(var r=0;r<e.length;r++)this.words[r]=i.words[r]^e.words[r];if(this!==i)for(;r<i.length;r++)this.words[r]=i.words[r];return this.length=i.length,this._strip()},s.prototype.ixor=function(t){return r(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){r("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),e=t%26;this._expand(i),e>0&&i--;for(var n=0;n<i;n++)this.words[n]=67108863&~this.words[n];return e>0&&(this.words[n]=~this.words[n]&67108863>>26-e),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var e=t/26|0,n=t%26;return this._expand(e+1),this.words[e]=i?this.words[e]|1<<n:this.words[e]&~(1<<n),this._strip()},s.prototype.iadd=function(t){var i,e,r;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0,s=0;s<r.length;s++)i=(0|e.words[s])+(0|r.words[s])+n,this.words[s]=67108863&i,n=i>>>26;for(;0!==n&&s<e.length;s++)i=(0|e.words[s])+n,this.words[s]=67108863&i,n=i>>>26;if(this.length=e.length,0!==n)this.words[this.length]=n,this.length++;else if(e!==this)for(;s<e.length;s++)this.words[s]=e.words[s];return this},s.prototype.add=function(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):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 i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var e,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(i=(0|e.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&i;for(;0!==s&&o<e.length;o++)s=(i=(0|e.words[o])+s)>>26,this.words[o]=67108863&i;if(0===s&&o<e.length&&e!==this)for(;o<e.length;o++)this.words[o]=e.words[o];return this.length=Math.max(this.length,o),e!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,i,e){var r,n,s,o=t.words,h=i.words,a=e.words,u=0,l=0|o[0],c=8191&l,d=l>>>13,f=0|o[1],m=8191&f,p=f>>>13,g=0|o[2],v=8191&g,M=g>>>13,w=0|o[3],y=8191&w,b=w>>>13,k=0|o[4],_=8191&k,S=k>>>13,A=0|o[5],x=8191&A,R=A>>>13,C=0|o[6],E=8191&C,T=C>>>13,$=0|o[7],N=8191&$,I=$>>>13,q=0|o[8],O=8191&q,L=q>>>13,B=0|o[9],U=8191&B,j=B>>>13,P=0|h[0],F=8191&P,W=P>>>13,H=0|h[1],Z=8191&H,z=H>>>13,D=0|h[2],J=8191&D,K=D>>>13,G=0|h[3],X=8191&G,V=G>>>13,Y=0|h[4],Q=8191&Y,tt=Y>>>13,it=0|h[5],et=8191&it,rt=it>>>13,nt=0|h[6],st=8191&nt,ot=nt>>>13,ht=0|h[7],at=8191&ht,ut=ht>>>13,lt=0|h[8],ct=8191&lt,dt=lt>>>13,ft=0|h[9],mt=8191&ft,pt=ft>>>13;e.negative=t.negative^i.negative,e.length=19;var gt=(u+(r=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,W))+Math.imul(d,F)|0))<<13)|0;u=((s=Math.imul(d,W))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(m,F),n=(n=Math.imul(m,W))+Math.imul(p,F)|0,s=Math.imul(p,W);var vt=(u+(r=r+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,z)|0)+Math.imul(d,Z)|0))<<13)|0;u=((s=s+Math.imul(d,z)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,F),n=(n=Math.imul(v,W))+Math.imul(M,F)|0,s=Math.imul(M,W),r=r+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,z)|0)+Math.imul(p,Z)|0,s=s+Math.imul(p,z)|0;var Mt=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,K)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(y,F),n=(n=Math.imul(y,W))+Math.imul(b,F)|0,s=Math.imul(b,W),r=r+Math.imul(v,Z)|0,n=(n=n+Math.imul(v,z)|0)+Math.imul(M,Z)|0,s=s+Math.imul(M,z)|0,r=r+Math.imul(m,J)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(p,J)|0,s=s+Math.imul(p,K)|0;var wt=(u+(r=r+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,X)|0))<<13)|0;u=((s=s+Math.imul(d,V)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(_,F),n=(n=Math.imul(_,W))+Math.imul(S,F)|0,s=Math.imul(S,W),r=r+Math.imul(y,Z)|0,n=(n=n+Math.imul(y,z)|0)+Math.imul(b,Z)|0,s=s+Math.imul(b,z)|0,r=r+Math.imul(v,J)|0,n=(n=n+Math.imul(v,K)|0)+Math.imul(M,J)|0,s=s+Math.imul(M,K)|0,r=r+Math.imul(m,X)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(p,X)|0,s=s+Math.imul(p,V)|0;var yt=(u+(r=r+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(x,F),n=(n=Math.imul(x,W))+Math.imul(R,F)|0,s=Math.imul(R,W),r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,z)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,z)|0,r=r+Math.imul(y,J)|0,n=(n=n+Math.imul(y,K)|0)+Math.imul(b,J)|0,s=s+Math.imul(b,K)|0,r=r+Math.imul(v,X)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,V)|0,r=r+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(p,Q)|0,s=s+Math.imul(p,tt)|0;var bt=(u+(r=r+Math.imul(c,et)|0)|0)+((8191&(n=(n=n+Math.imul(c,rt)|0)+Math.imul(d,et)|0))<<13)|0;u=((s=s+Math.imul(d,rt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,W))+Math.imul(T,F)|0,s=Math.imul(T,W),r=r+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(R,Z)|0,s=s+Math.imul(R,z)|0,r=r+Math.imul(_,J)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(S,J)|0,s=s+Math.imul(S,K)|0,r=r+Math.imul(y,X)|0,n=(n=n+Math.imul(y,V)|0)+Math.imul(b,X)|0,s=s+Math.imul(b,V)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(M,Q)|0,s=s+Math.imul(M,tt)|0,r=r+Math.imul(m,et)|0,n=(n=n+Math.imul(m,rt)|0)+Math.imul(p,et)|0,s=s+Math.imul(p,rt)|0;var kt=(u+(r=r+Math.imul(c,st)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(N,F),n=(n=Math.imul(N,W))+Math.imul(I,F)|0,s=Math.imul(I,W),r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(T,Z)|0,s=s+Math.imul(T,z)|0,r=r+Math.imul(x,J)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(R,J)|0,s=s+Math.imul(R,K)|0,r=r+Math.imul(_,X)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(S,X)|0,s=s+Math.imul(S,V)|0,r=r+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Q)|0,s=s+Math.imul(b,tt)|0,r=r+Math.imul(v,et)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(M,et)|0,s=s+Math.imul(M,rt)|0,r=r+Math.imul(m,st)|0,n=(n=n+Math.imul(m,ot)|0)+Math.imul(p,st)|0,s=s+Math.imul(p,ot)|0;var _t=(u+(r=r+Math.imul(c,at)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,at)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(O,F),n=(n=Math.imul(O,W))+Math.imul(L,F)|0,s=Math.imul(L,W),r=r+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,z)|0)+Math.imul(I,Z)|0,s=s+Math.imul(I,z)|0,r=r+Math.imul(E,J)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,K)|0,r=r+Math.imul(x,X)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(R,X)|0,s=s+Math.imul(R,V)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,tt)|0,r=r+Math.imul(y,et)|0,n=(n=n+Math.imul(y,rt)|0)+Math.imul(b,et)|0,s=s+Math.imul(b,rt)|0,r=r+Math.imul(v,st)|0,n=(n=n+Math.imul(v,ot)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,ot)|0,r=r+Math.imul(m,at)|0,n=(n=n+Math.imul(m,ut)|0)+Math.imul(p,at)|0,s=s+Math.imul(p,ut)|0;var St=(u+(r=r+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(U,F),n=(n=Math.imul(U,W))+Math.imul(j,F)|0,s=Math.imul(j,W),r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,z)|0)+Math.imul(L,Z)|0,s=s+Math.imul(L,z)|0,r=r+Math.imul(N,J)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,K)|0,r=r+Math.imul(E,X)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,V)|0,r=r+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,tt)|0,r=r+Math.imul(_,et)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(S,et)|0,s=s+Math.imul(S,rt)|0,r=r+Math.imul(y,st)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0,r=r+Math.imul(v,at)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(M,at)|0,s=s+Math.imul(M,ut)|0,r=r+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(p,ct)|0,s=s+Math.imul(p,dt)|0;var At=(u+(r=r+Math.imul(c,mt)|0)|0)+((8191&(n=(n=n+Math.imul(c,pt)|0)+Math.imul(d,mt)|0))<<13)|0;u=((s=s+Math.imul(d,pt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(U,Z),n=(n=Math.imul(U,z))+Math.imul(j,Z)|0,s=Math.imul(j,z),r=r+Math.imul(O,J)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,J)|0,s=s+Math.imul(L,K)|0,r=r+Math.imul(N,X)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,V)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(x,et)|0,n=(n=n+Math.imul(x,rt)|0)+Math.imul(R,et)|0,s=s+Math.imul(R,rt)|0,r=r+Math.imul(_,st)|0,n=(n=n+Math.imul(_,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,r=r+Math.imul(y,at)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(b,at)|0,s=s+Math.imul(b,ut)|0,r=r+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,dt)|0)+Math.imul(M,ct)|0,s=s+Math.imul(M,dt)|0;var xt=(u+(r=r+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,pt)|0)+Math.imul(p,mt)|0))<<13)|0;u=((s=s+Math.imul(p,pt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(U,J),n=(n=Math.imul(U,K))+Math.imul(j,J)|0,s=Math.imul(j,K),r=r+Math.imul(O,X)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,X)|0,s=s+Math.imul(L,V)|0,r=r+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(I,Q)|0,s=s+Math.imul(I,tt)|0,r=r+Math.imul(E,et)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(T,et)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(x,st)|0,n=(n=n+Math.imul(x,ot)|0)+Math.imul(R,st)|0,s=s+Math.imul(R,ot)|0,r=r+Math.imul(_,at)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(S,at)|0,s=s+Math.imul(S,ut)|0,r=r+Math.imul(y,ct)|0,n=(n=n+Math.imul(y,dt)|0)+Math.imul(b,ct)|0,s=s+Math.imul(b,dt)|0;var Rt=(u+(r=r+Math.imul(v,mt)|0)|0)+((8191&(n=(n=n+Math.imul(v,pt)|0)+Math.imul(M,mt)|0))<<13)|0;u=((s=s+Math.imul(M,pt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(U,X),n=(n=Math.imul(U,V))+Math.imul(j,X)|0,s=Math.imul(j,V),r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,s=s+Math.imul(L,tt)|0,r=r+Math.imul(N,et)|0,n=(n=n+Math.imul(N,rt)|0)+Math.imul(I,et)|0,s=s+Math.imul(I,rt)|0,r=r+Math.imul(E,st)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(x,at)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(R,at)|0,s=s+Math.imul(R,ut)|0,r=r+Math.imul(_,ct)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(S,ct)|0,s=s+Math.imul(S,dt)|0;var Ct=(u+(r=r+Math.imul(y,mt)|0)|0)+((8191&(n=(n=n+Math.imul(y,pt)|0)+Math.imul(b,mt)|0))<<13)|0;u=((s=s+Math.imul(b,pt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(j,Q)|0,s=Math.imul(j,tt),r=r+Math.imul(O,et)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,et)|0,s=s+Math.imul(L,rt)|0,r=r+Math.imul(N,st)|0,n=(n=n+Math.imul(N,ot)|0)+Math.imul(I,st)|0,s=s+Math.imul(I,ot)|0,r=r+Math.imul(E,at)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(T,at)|0,s=s+Math.imul(T,ut)|0,r=r+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,dt)|0)+Math.imul(R,ct)|0,s=s+Math.imul(R,dt)|0;var Et=(u+(r=r+Math.imul(_,mt)|0)|0)+((8191&(n=(n=n+Math.imul(_,pt)|0)+Math.imul(S,mt)|0))<<13)|0;u=((s=s+Math.imul(S,pt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(U,et),n=(n=Math.imul(U,rt))+Math.imul(j,et)|0,s=Math.imul(j,rt),r=r+Math.imul(O,st)|0,n=(n=n+Math.imul(O,ot)|0)+Math.imul(L,st)|0,s=s+Math.imul(L,ot)|0,r=r+Math.imul(N,at)|0,n=(n=n+Math.imul(N,ut)|0)+Math.imul(I,at)|0,s=s+Math.imul(I,ut)|0,r=r+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(T,ct)|0,s=s+Math.imul(T,dt)|0;var Tt=(u+(r=r+Math.imul(x,mt)|0)|0)+((8191&(n=(n=n+Math.imul(x,pt)|0)+Math.imul(R,mt)|0))<<13)|0;u=((s=s+Math.imul(R,pt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(U,st),n=(n=Math.imul(U,ot))+Math.imul(j,st)|0,s=Math.imul(j,ot),r=r+Math.imul(O,at)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,at)|0,s=s+Math.imul(L,ut)|0,r=r+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,dt)|0)+Math.imul(I,ct)|0,s=s+Math.imul(I,dt)|0;var $t=(u+(r=r+Math.imul(E,mt)|0)|0)+((8191&(n=(n=n+Math.imul(E,pt)|0)+Math.imul(T,mt)|0))<<13)|0;u=((s=s+Math.imul(T,pt)|0)+(n>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(U,at),n=(n=Math.imul(U,ut))+Math.imul(j,at)|0,s=Math.imul(j,ut),r=r+Math.imul(O,ct)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,ct)|0,s=s+Math.imul(L,dt)|0;var Nt=(u+(r=r+Math.imul(N,mt)|0)|0)+((8191&(n=(n=n+Math.imul(N,pt)|0)+Math.imul(I,mt)|0))<<13)|0;u=((s=s+Math.imul(I,pt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(U,ct),n=(n=Math.imul(U,dt))+Math.imul(j,ct)|0,s=Math.imul(j,dt);var It=(u+(r=r+Math.imul(O,mt)|0)|0)+((8191&(n=(n=n+Math.imul(O,pt)|0)+Math.imul(L,mt)|0))<<13)|0;u=((s=s+Math.imul(L,pt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863;var qt=(u+(r=Math.imul(U,mt))|0)+((8191&(n=(n=Math.imul(U,pt))+Math.imul(j,mt)|0))<<13)|0;return u=((s=Math.imul(j,pt))+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,a[0]=gt,a[1]=vt,a[2]=Mt,a[3]=wt,a[4]=yt,a[5]=bt,a[6]=kt,a[7]=_t,a[8]=St,a[9]=At,a[10]=xt,a[11]=Rt,a[12]=Ct,a[13]=Et,a[14]=Tt,a[15]=$t,a[16]=Nt,a[17]=It,a[18]=qt,0!==u&&(a[19]=u,e.length++),e};function v(t,i,e){e.negative=i.negative^t.negative,e.length=t.length+i.length;for(var r=0,n=0,s=0;s<e.length-1;s++){var o=n;n=0;for(var h=67108863&r,a=Math.min(s,i.length-1),u=Math.max(0,s-t.length+1);u<=a;u++){var l=s-u,c=(0|t.words[l])*(0|i.words[u]),d=67108863&c;h=67108863&(d=d+h|0),n+=(o=(o=o+(c/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}e.words[s]=h,r=o,o=n}return 0!==r?e.words[s]=r:e.length--,e._strip()}function M(t,i,e){return v(t,i,e)}function w(t,i){this.x=t,this.y=i}Math.imul||(g=p),s.prototype.mulTo=function(t,i){var e=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,i):e<63?p(this,t,i):e<1024?v(this,t,i):M(this,t,i)},w.prototype.makeRBT=function(t){for(var i=new Array(t),e=s.prototype._countBits(t)-1,r=0;r<t;r++)i[r]=this.revBin(r,e,t);return i},w.prototype.revBin=function(t,i,e){if(0===t||t===e-1)return t;for(var r=0,n=0;n<i;n++)r|=(1&t)<<i-n-1,t>>=1;return r},w.prototype.permute=function(t,i,e,r,n,s){for(var o=0;o<s;o++)r[o]=i[t[o]],n[o]=e[t[o]]},w.prototype.transform=function(t,i,e,r,n,s){this.permute(s,t,i,e,r,n);for(var o=1;o<n;o<<=1)for(var h=o<<1,a=Math.cos(2*Math.PI/h),u=Math.sin(2*Math.PI/h),l=0;l<n;l+=h)for(var c=a,d=u,f=0;f<o;f++){var m=e[l+f],p=r[l+f],g=e[l+f+o],v=r[l+f+o],M=c*g-d*v;v=c*v+d*g,g=M,e[l+f]=m+g,r[l+f]=p+v,e[l+f+o]=m-g,r[l+f+o]=p-v,f!==h&&(M=a*c-u*d,d=a*d+u*c,c=M)}},w.prototype.guessLen13b=function(t,i){var e=1|Math.max(i,t),r=1&e,n=0;for(e=e/2|0;e;e>>>=1)n++;return 1<<n+1+r},w.prototype.conjugate=function(t,i,e){if(!(e<=1))for(var r=0;r<e/2;r++){var n=t[r];t[r]=t[e-r-1],t[e-r-1]=n,n=i[r],i[r]=-i[e-r-1],i[e-r-1]=-n}},w.prototype.normalize13b=function(t,i){for(var e=0,r=0;r<i/2;r++){var n=8192*Math.round(t[2*r+1]/i)+Math.round(t[2*r]/i)+e;t[r]=67108863&n,e=n<67108864?0:n/67108864|0}return t},w.prototype.convert13b=function(t,i,e,n){for(var s=0,o=0;o<i;o++)s+=0|t[o],e[2*o]=8191&s,s>>>=13,e[2*o+1]=8191&s,s>>>=13;for(o=2*i;o<n;++o)e[o]=0;r(0===s),r(!(-8192&s))},w.prototype.stub=function(t){for(var i=new Array(t),e=0;e<t;e++)i[e]=0;return i},w.prototype.mulp=function(t,i,e){var r=2*this.guessLen13b(t.length,i.length),n=this.makeRBT(r),s=this.stub(r),o=new Array(r),h=new Array(r),a=new Array(r),u=new Array(r),l=new Array(r),c=new Array(r),d=e.words;d.length=r,this.convert13b(t.words,t.length,o,r),this.convert13b(i.words,i.length,u,r),this.transform(o,s,h,a,r,n),this.transform(u,s,l,c,r,n);for(var f=0;f<r;f++){var m=h[f]*l[f]-a[f]*c[f];a[f]=h[f]*c[f]+a[f]*l[f],h[f]=m}return this.conjugate(h,a,r),this.transform(h,a,d,s,r,n),this.conjugate(d,s,r),this.normalize13b(d,r),e.negative=t.negative^i.negative,e.length=t.length+i.length,e._strip()},s.prototype.mul=function(t){var i=new s(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},s.prototype.mulf=function(t){var i=new s(null);return i.words=new Array(this.length+t.length),M(this,t,i)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var i=t<0;i&&(t=-t),r("number"==typeof t),r(t<67108864);for(var e=0,n=0;n<this.length;n++){var s=(0|this.words[n])*t,o=(67108863&s)+(67108863&e);e>>=26,e+=s/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this.length=0===t?1:this.length,i?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 i=function(t){for(var i=new Array(t.bitLength()),e=0;e<i.length;e++){var r=e/26|0,n=e%26;i[e]=t.words[r]>>>n&1}return i}(t);if(0===i.length)return new s(1);for(var e=this,r=0;r<i.length&&0===i[r];r++,e=e.sqr());if(++r<i.length)for(var n=e.sqr();r<i.length;r++,n=n.sqr())0!==i[r]&&(e=e.mul(n));return e},s.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var i,e=t%26,n=(t-e)/26,s=67108863>>>26-e<<26-e;if(0!==e){var o=0;for(i=0;i<this.length;i++){var h=this.words[i]&s,a=(0|this.words[i])-h<<e;this.words[i]=a|o,o=h>>>26-e}o&&(this.words[i]=o,this.length++)}if(0!==n){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i<n;i++)this.words[i]=0;this.length+=n}return this._strip()},s.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,i,e){var n;r("number"==typeof t&&t>=0),n=i?(i-i%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),h=67108863^67108863>>>s<<s,a=e;if(n-=o,n=Math.max(0,n),a){for(var u=0;u<o;u++)a.words[u]=this.words[u];a.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 l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&h}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,i,e){return r(0===this.negative),this.iushrn(t,i,e)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){r("number"==typeof t&&t>=0);var i=t%26,e=(t-i)/26,n=1<<i;return!(this.length<=e||!(this.words[e]&n))},s.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var i=t%26,e=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=e)return this;if(0!==i&&e++,this.length=Math.min(e,this.length),0!==i){var n=67108863^67108863>>>i<<i;this.words[this.length-1]&=n}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return r("number"==typeof t),r(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 i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},s.prototype.isubn=function(t){if(r("number"==typeof t),r(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 i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+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,i,e){var n,s,o=t.length+e;this._expand(o);var h=0;for(n=0;n<t.length;n++){s=(0|this.words[n+e])+h;var a=(0|t.words[n])*i;h=((s-=67108863&a)>>26)-(a/67108864|0),this.words[n+e]=67108863&s}for(;n<this.length-e;n++)h=(s=(0|this.words[n+e])+h)>>26,this.words[n+e]=67108863&s;if(0===h)return this._strip();for(r(-1===h),h=0,n=0;n<this.length;n++)h=(s=-(0|this.words[n])+h)>>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,i){var e=(this.length,t.length),r=this.clone(),n=t,o=0|n.words[n.length-1];0!=(e=26-this._countBits(o))&&(n=n.ushln(e),r.iushln(e),o=0|n.words[n.length-1]);var h,a=r.length-n.length;if("mod"!==i){(h=new s(null)).length=a+1,h.words=new Array(h.length);for(var u=0;u<h.length;u++)h.words[u]=0}var l=r.clone()._ishlnsubmul(n,1,a);0===l.negative&&(r=l,h&&(h.words[a]=1));for(var c=a-1;c>=0;c--){var d=67108864*(0|r.words[n.length+c])+(0|r.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(n,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(n,1,c),r.isZero()||(r.negative^=1);h&&(h.words[c]=d)}return h&&h._strip(),r._strip(),"div"!==i&&0!==e&&r.iushrn(e),{div:h||null,mod:r}},s.prototype.divmod=function(t,i,e){return r(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,i),"mod"!==i&&(n=h.div.neg()),"div"!==i&&(o=h.mod.neg(),e&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),i),"mod"!==i&&(n=h.div.neg()),{div:n,mod:h.mod}):0!==(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),i),"div"!==i&&(o=h.mod.neg(),e&&0!==o.negative&&o.isub(t)),{div:h.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{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,i);var n,o,h},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 i=this.divmod(t);if(i.mod.isZero())return i.div;var e=0!==i.div.negative?i.mod.isub(t):i.mod,r=t.ushrn(1),n=t.andln(1),s=e.cmp(r);return s<0||1===n&&0===s?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},s.prototype.modrn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var e=(1<<26)%t,n=0,s=this.length-1;s>=0;s--)n=(e*n+(0|this.words[s]))%t;return i?-n:n},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var i=t<0;i&&(t=-t),r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*e;this.words[n]=s/t|0,e=s%t}return this._strip(),i?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var i=this,e=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n=new s(1),o=new s(0),h=new s(0),a=new s(1),u=0;i.isEven()&&e.isEven();)i.iushrn(1),e.iushrn(1),++u;for(var l=e.clone(),c=i.clone();!i.isZero();){for(var d=0,f=1;0===(i.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(i.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var m=0,p=1;0===(e.words[0]&p)&&m<26;++m,p<<=1);if(m>0)for(e.iushrn(m);m-- >0;)(h.isOdd()||a.isOdd())&&(h.iadd(l),a.isub(c)),h.iushrn(1),a.iushrn(1);i.cmp(e)>=0?(i.isub(e),n.isub(h),o.isub(a)):(e.isub(i),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:e.iushln(u)}},s.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var i=this,e=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n,o=new s(1),h=new s(0),a=e.clone();i.cmpn(1)>0&&e.cmpn(1)>0;){for(var u=0,l=1;0===(i.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(i.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,d=1;0===(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)h.isOdd()&&h.iadd(a),h.iushrn(1);i.cmp(e)>=0?(i.isub(e),o.isub(h)):(e.isub(i),h.isub(o))}return(n=0===i.cmpn(1)?o:h).cmpn(0)<0&&n.iadd(t),n},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),e=t.clone();i.negative=0,e.negative=0;for(var r=0;i.isEven()&&e.isEven();r++)i.iushrn(1),e.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;e.isEven();)e.iushrn(1);var n=i.cmp(e);if(n<0){var s=i;i=e,e=s}else if(0===n||0===e.cmpn(1))break;i.isub(e)}return e.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){r("number"==typeof t);var i=t%26,e=(t-i)/26,n=1<<i;if(this.length<=e)return this._expand(e+1),this.words[e]|=n,this;for(var s=n,o=e;0!==s&&o<this.length;o++){var h=0|this.words[o];s=(h+=s)>>>26,h&=67108863,this.words[o]=h}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 i,e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;if(this._strip(),this.length>1)i=1;else{e&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];i=n===t?0:n<t?-1:1}return 0!==this.negative?0|-i:i},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,e=this.length-1;e>=0;e--){var r=0|this.words[e],n=0|t.words[e];if(r!==n){r<n?i=-1:r>n&&(i=1);break}}return i},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 x(t)},s.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return r(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 b(t,i){this.name=t,this.p=new s(i,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var i=s._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function R(t){x.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)}b.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var i,e=t;do{this.split(e,this.tmp),i=(e=(e=this.imulK(e)).iadd(this.tmp)).bitLength()}while(i>this.n);var r=i<this.n?-1:e.ucmp(this.p);return 0===r?(e.words[0]=0,e.length=1):r>0?e.isub(this.p):void 0!==e.strip?e.strip():e._strip(),e},b.prototype.split=function(t,i){t.iushrn(this.n,0,i)},b.prototype.imulK=function(t){return t.imul(this.k)},n(k,b),k.prototype.split=function(t,i){for(var e=4194303,r=Math.min(t.length,9),n=0;n<r;n++)i.words[n]=t.words[n];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(i.words[i.length++]=s&e,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&e)<<4|s>>>22,s=o}s>>>=22,t.words[n-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 i=0,e=0;e<t.length;e++){var r=0|t.words[e];i+=977*r,t.words[e]=67108863&i,i=64*r+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(_,b),n(S,b),n(A,b),A.prototype.imulK=function(t){for(var i=0,e=0;e<t.length;e++){var r=19*(0|t.words[e])+i,n=67108863&r;r>>>=26,t.words[e]=n,i=r}return 0!==i&&(t.words[t.length++]=i),t},s._prime=function(t){if(y[t])return y[t];var i;if("k256"===t)i=new k;else if("p224"===t)i=new _;else if("p192"===t)i=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new A}return y[t]=i,i},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,i){r(0===(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,i){this._verify2(t,i);var e=t.add(i);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},x.prototype.iadd=function(t,i){this._verify2(t,i);var e=t.iadd(i);return e.cmp(this.m)>=0&&e.isub(this.m),e},x.prototype.sub=function(t,i){this._verify2(t,i);var e=t.sub(i);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},x.prototype.isub=function(t,i){this._verify2(t,i);var e=t.isub(i);return e.cmpn(0)<0&&e.iadd(this.m),e},x.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},x.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},x.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(r(i%2==1),3===i){var e=this.m.add(new s(1)).iushrn(2);return this.pow(t,e)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);r(!n.isZero());var h=new s(1).toRed(this),a=h.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(a);)l.redIAdd(a);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),m=o;0!==f.cmp(h);){for(var p=f,g=0;0!==p.cmp(h);g++)p=p.redSqr();r(g<m);var v=this.pow(c,new s(1).iushln(m-g-1));d=d.redMul(v),c=v.redSqr(),f=f.redMul(c),m=g}return d},x.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},x.prototype.pow=function(t,i){if(i.isZero())return new s(1).toRed(this);if(0===i.cmpn(1))return t.clone();var e=new Array(16);e[0]=new s(1).toRed(this),e[1]=t;for(var r=2;r<e.length;r++)e[r]=this.mul(e[r-1],t);var n=e[0],o=0,h=0,a=i.bitLength()%26;for(0===a&&(a=26),r=i.length-1;r>=0;r--){for(var u=i.words[r],l=a-1;l>=0;l--){var c=u>>l&1;n!==e[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4===++h||0===r&&0===l)&&(n=this.mul(n,e[o]),h=0,o=0)):h=0}a=26}return n},x.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},x.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},s.mont=function(t){return new R(t)},n(R,x),R.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},R.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},R.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var e=t.imul(i),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=e.isub(r).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},R.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new s(0)._forceRed(this);var e=t.mul(i),r=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=e.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=e.nmd(t),this)},72347(t,i,e){"use strict";e.d(i,{v:()=>C});var r=e(20136);function n(t){return t.toString().padStart(2,"0")}var s=e(71343);function o(){return Number.NaN}const h=(0,r.pc)("BigInt",o),a=("function"==typeof h&&h.asIntN,"function"==typeof r.Mn.Buffer&&"function"==typeof r.Mn.Buffer.isBuffer);r.Mn.process;var u=e(12085);function l(t){return a&&!!t&&(0,u.T)(t.readDoubleLE)&&r.Mn.Buffer.isBuffer(t)}function c(t){return(t&&t.constructor)===Uint8Array||t instanceof Uint8Array}const d=new Array(256),f=new Array(65536);for(let t=0;t<256;t++)d[t]=t.toString(16).padStart(2,"0");for(let t=0;t<256;t++){const i=t<<8;for(let e=0;e<256;e++)f[i|e]=d[t]+d[e]}function m(t,i){const e=t.length%2|0,r=t.length-e|0;for(let e=0;e<r;e+=2)i+=f[t[e]<<8|t[e+1]];return e&&(i+=d[0|t[r]]),i}const p="0123456789abcdef",g=new Uint8Array(256),v=new Uint8Array(65536);for(let t=0,i=16;t<i;t++)g[0|p[t].charCodeAt(0)]=0|t,t>9&&(g[0|p[t].toUpperCase().charCodeAt(0)]=0|t);for(let t=0;t<256;t++){const i=t<<8;for(let e=0;e<256;e++)v[i|e]=g[t]<<4|g[e]}const M=/^0x[\da-fA-F]+$/;class w{encode(t){const i=t.length,e=new Uint8Array(i);for(let r=0;r<i;r++)e[r]=t.charCodeAt(r);return e}}const y=new((0,r.pc)("TextEncoder",w));var b=e(61734);const k={debug:"log",error:"error",log:"log",warn:"warn"};function _(t){return Array.isArray(t)?t.map(_):function(t){return s.isBN(t)}(t)?t.toString():c(t)||l(t)?function(t,i=-1,e=!0){const r=e?"0x":"";if(!t?.length)return r;if(i>0){const e=Math.ceil(i/8);if(t.length>e)return`${m(t.subarray(0,e/2),r)}${m(t.subarray(t.length-e/2),"")}`}return m(t,r)}(function(t,i=!1){if(i&&null==t)throw new Error("u8aToU8a: Expected non-null, non-undefined value");return c(t)?l(t)?new Uint8Array(t):t:function(t,i=-1,e){return"string"==typeof t&&("0x"===t||M.test(t))&&(-1===i?e||t.length%2==0:t.length===2+Math.ceil(i/4))}(t)?function(t,i=-1){if(!t)return new Uint8Array;let e=t.startsWith("0x")?2:0;const r=Math.ceil((t.length-e)/2),n=Math.ceil(-1===i?r:i/8),s=new Uint8Array(n);for(let i=n>r?n-r:0;i<n;i++,e+=2)s[i]=v[t.charCodeAt(e)<<8|t.charCodeAt(e+1)];return s}(t):Array.isArray(t)?new Uint8Array(t):function(t){return t?y.encode(t.toString()):new Uint8Array}(t)}(t)):function(t){if(t&&function(t){return!!t&&"object"==typeof t}(t)&&t.constructor===Object){const i={};for(const[e,r]of Object.entries(t))i[e]=_(r);return i}return t}(t)}function S(t,i,e,r=-1){if(1===e.length&&(0,u.T)(e[0])){const n=e[0]();return S(t,i,Array.isArray(n)?n:[n],r)}var s,o;console[k[t]](`${(o=new Date).getFullYear().toString()}-${n(o.getMonth()+1)}-${n(o.getDate())} ${n(o.getHours())}:${n(o.getMinutes())}:${n(o.getSeconds())}`,i,...e.map(_).map((s=r,t=>{if(s<=0)return t;const i=`${t}`;return i.length<s?t:`${i.substring(0,s)} ...`})))}function A(t,i){return!!t&&("*"===t||i===t||t.endsWith("*")&&i.startsWith(t.slice(0,-1)))}function x(t,i){return!!t&&t.startsWith("-")&&(i===t.slice(1)||t.endsWith("*")&&i.startsWith(t.slice(1,-1)))}function R(t,i){let e=!1;for(const r of t)A(r,i)?e=!0:x(r,i)&&(e=!1);return e}function C(t){const i=`${t.toUpperCase()}:`.padStart(16),[e,n]=function(t){const i=parseInt(r.Mn.process?.env?.DEBUG_MAX||"-1",10);return[R((r.Mn.process?.env?.DEBUG||"").toLowerCase().split(","),t),isNaN(i)?-1:i]}(t.toLowerCase());return{debug:e?(...t)=>S("debug",i,t,n):b.l,error:(...t)=>S("error",i,t),log:(...t)=>S("log",i,t),noop:b.l,warn:(...t)=>S("warn",i,t)}}}}]);