eo-client-security-kit-mp 0.0.1-beta.3 → 0.0.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(r){if("default"!==r&&!(r in t)){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})}),Object.freeze(t)}function e(t,e,r,i){return new(r||(r=Promise))(function(n,a){function s(t){try{f(i.next(t))}catch(t){a(t)}}function o(t){try{f(i.throw(t))}catch(t){a(t)}}function f(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,o)}f((i=i.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const r=3e3,i=3001,n=/^attest-[0-9]+$/,a="MAINLAND_CHINA",s=/^s[1-2][A-Za-z0-9+/=]+$/;class o extends Error{constructor(t,e="SDK_ERROR",r){super(t),this.name="SDKError",this.code=e,this.originalError=r,Error.captureStackTrace&&Error.captureStackTrace(this,o)}}class f extends o{constructor(t,e="API_REQUEST_ERROR",r,i){super(t,e,r),this.name="ApiRequestError",this.response=r,this.request=i}}const c="__EO_CLIENT_SECURITY_KIT_DEBUG__";function h(){return("undefined"!=typeof globalThis?globalThis:global)[c]||!1}const d=new class{constructor(){this.prefix="[EOClientSecurityKit]"}static setDebug(t){!function(t){("undefined"!=typeof globalThis?globalThis:global)[c]=t}(t)}static isDebugEnabled(){return h()}log(t,...e){h()&&console.log(this.prefix,t,...e)}info(t,...e){h()&&console.info(this.prefix,t,...e)}warn(t,...e){console.warn(this.prefix,t,...e)}error(t,...e){console.error(this.prefix,t,...e)}};function u(t){return Object.prototype.toString.call(t)}function l(t){return"string"==typeof t}function p(t){return"[object Undefined]"===u(t)}function b(t){return!p(t)&&!function(t){return"[object Null]"===u(t)}(t)}function g(t){const e=t.replace(/^0x/gi,"").replace(/[^0-9a-f]/g,"").toLowerCase();if(e.length%2!=0)throw new Error(`Invalid HEX string length: Expected an even length, but actually got ${e.length} characters.`);const r=e.length/2,i=new Uint8Array(r);for(let t=0;t<r;t++){const r=2*t,n=e.substr(r,2);i[t]=parseInt(n,16)}return i}function y(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);const e=[];for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e.push(i):i<2048?e.push(192|i>>6,128|63&i):i<55296||i>=57344?e.push(224|i>>12,128|i>>6&63,128|63&i):(r++,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),e.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}return new Uint8Array(e)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const v=(()=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256);for(let r=0;r<64;r++)e[t.charCodeAt(r)]=r;return{encode:e=>{let r,i=e.length,n="";for(r=0;r<i;r+=3)n+=t[e[r]>>2],n+=t[(3&e[r])<<4|e[r+1]>>4],n+=t[(15&e[r+1])<<2|e[r+2]>>6],n+=t[63&e[r+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},decode:t=>{let r,i,n,a,s,o=.75*t.length,f=t.length,c=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);let h=new ArrayBuffer(o),d=new Uint8Array(h);for(r=0;r<f;r+=4)i=e[t.charCodeAt(r)],n=e[t.charCodeAt(r+1)],a=e[t.charCodeAt(r+2)],s=e[t.charCodeAt(r+3)],d[c++]=i<<2|n>>4,d[c++]=(15&n)<<4|a>>2,d[c++]=(3&a)<<6|63&s;return new Uint8Array(h)}}})();function m(t,r={}){const{maxRetries:i=3,delay:n=500,shouldRetryOnError:a=()=>!0,shouldRetryOnSuccess:s=()=>!1,delayType:o="fixed"}=r;let f=0,c=n;const h=()=>e(this,void 0,void 0,function*(){try{const e=yield t();return f>=i||!(yield s(e))?e:(f++,h())}catch(t){if(f>=i||!(yield a(t)))throw t;return f++,c="exponential"===o?2*c:n,yield(e=c,new Promise((t,r)=>{setTimeout(t,e)})),h()}var e});return h()}class w{constructor(){this.initStatus="uninitialized",this.initPromise=null}execute(t){return e(this,void 0,void 0,function*(){var r;return this.isSuccess?null===(r=t.getInitializedValue)||void 0===r?void 0:r.call(t):(this.shouldReturnCachedPromise()||(this.setStatus("initializing"),this.initPromise=new Promise((r,i)=>e(this,void 0,void 0,function*(){var e,n;try{const i=yield t.initFn();this.setStatus("success");const n=null===(e=t.onSuccess)||void 0===e?void 0:e.call(t,i);r(p(n)?i:n)}catch(e){this.setStatus("error");const r=null===(n=t.onError)||void 0===n?void 0:n.call(t,e);i(r||e)}finally{this.initPromise=null}}))),this.initPromise)})}shouldReturnCachedPromise(){return!(!this.isInitializing||!this.initPromise)}setStatus(t){this.initStatus=t}get isUninitialized(){return"uninitialized"===this.initStatus}get isSuccess(){return"success"===this.initStatus}get isError(){return"error"===this.initStatus}get isInitializing(){return"initializing"===this.initStatus}getStatus(){return this.initStatus}reset(){this.initStatus="uninitialized",this.initPromise=null}}class _{constructor(){this.queue=[],this.isProcessing=!1}addTask(t,e,r){e=e||function(t=16){let e="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let i=0;i<t;i++)e+=r.charAt(Math.floor(62*Math.random()));return e}(),r=r||1;const i=this.queue.find(t=>t.id===e);if(i)return i.promise;let n,a;const s=new Promise((t,e)=>{n=t,a=e}),o={id:e,taskFn:t,resolve:n,reject:a,promise:s,status:"pending",priority:r};if(r>0){const t=this.queue.findIndex(t=>t.priority<r);t>=0?this.queue.splice(t,0,o):this.queue.push(o)}return this.isProcessing||this.processQueue(),s}cancelTask(t){const e=this.queue.findIndex(e=>e.id===t),r=this.queue[e];return"pending"===(null==r?void 0:r.status)&&(r.status="canceled",this.queue.splice(e,1),!0)}clearQueue(){this.queue=this.queue.filter(t=>"processing"===t.status)}processQueue(){return e(this,void 0,void 0,function*(){for(this.isProcessing=!0;this.queue.length>0;){const t=this.queue[0];if("canceled"!==t.status){t.status="processing";try{const e=yield t.taskFn();t.resolve(e)}catch(e){t.reject(e)}finally{t.status="done",this.queue.shift()}}else this.queue.shift()}this.isProcessing=!1})}}class S{static getInstance(){return S.instance||(S.instance=new _),S.instance}static reset(){S.instance=null}}var M,A;S.instance=null,function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.NONE=4]="NONE"}(M||(M={}));class I{constructor(t="default"){this.domain="",this.protocol="https",this.instanceId=t}setDomain(t){this.domain=t,d.info(`[${this.instanceId}] Domain set to: ${t}`)}getDomain(){return this.domain}setProtocol(t){this.protocol=t,d.info(`[${this.instanceId}] Protocol set to: ${t}`)}getProtocol(){return this.protocol}buildRequestUrl(t){const e=this.domain,r=this.protocol;if(!e)throw new o("Domain is not set. Please call setDomain first.","DOMAIN_NOT_SET");return`${r}://${e}${t}`}request(t){return e(this,void 0,void 0,function*(){if(b(wx)&&("[object Function]"===u(e=wx.request)&&"function"==typeof e)){d.info(`[${this.instanceId}] Using wx.request`);const e=Object.assign({},t.headers),r=this.buildRequestUrl(t.url);return d.info(`[${this.instanceId}] Request URL: ${r}`),new Promise((i,n)=>{wx.request({url:r,method:t.method||"GET",data:t.data,header:e,timeout:t.timeout||6e4,success:t=>{i({data:t.data,status:t.statusCode,headers:t.header||{}})},fail:t=>{n(new o("WeChat request failed","WX_REQUEST_ERROR",t))}})})}var e;throw new o("wx.request is not available in miniprogram plugin environment","WX_REQUEST_NOT_AVAILABLE")})}apiRequest(t){return e(this,arguments,void 0,function*(t,e={},r={},i={}){try{const{SDKVersion:n,Version:a,Url:s}=r,o={SDKVersion:n||"0.0.1-beta.3",Version:a||"2025-03-24"},c=Object.assign(Object.assign(Object.assign({},o),e),{Action:t}),h=s||"/.eo-sec-bot/",u=Object.assign({"Content-Type":"application/json"},i),l={url:h,method:"POST",data:c,headers:u,timeout:3e4};d.info(`[${this.instanceId}] Final request headers:`,JSON.stringify(u));const p=yield this.request(l),{data:b,status:g}=p,y=(null==b?void 0:b.Response)||{},{Error:v}=y,m=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}(y,["Error"]);return g>=200&&g<300&&!v?m:Promise.reject(new f((null==v?void 0:v.Message)||"Request Failed.",(null==v?void 0:v.Code)||"API_REQUEST_ERROR",p,l))}catch(t){const e=t instanceof Error?t.message:"The api request executed error.",r=(null==t?void 0:t.code)||"API_REQUEST_ERROR";return Promise.reject(new f(e,r,t,{}))}})}}!function(t){t.MEMORY="memory",t.PERSISTENT="persistent"}(A||(A={}));class x{constructor(t="eo_memory_"){this.memoryStorage=new Map,this.storagePrefix=t,d.info(`MemoryStorage initialized with prefix: ${t}`)}getPrefixedKey(t){return this.storagePrefix+t}setItem(t,r){return e(this,void 0,void 0,function*(){if(!l(t))throw new o("Storage key must be string","INVALID_STORAGE_KEY");const e=this.getPrefixedKey(t);this.memoryStorage.set(e,r),d.info(`MemoryStorage setItem: ${e}`)})}getItem(t){return e(this,void 0,void 0,function*(){if(!l(t))throw new o("Storage key must be string","INVALID_STORAGE_KEY");const e=this.getPrefixedKey(t),r=this.memoryStorage.get(e);return d.info(`MemoryStorage getItem: ${e}`),r})}removeItem(t){return e(this,void 0,void 0,function*(){if(!l(t))throw new o("Storage key must be string","INVALID_STORAGE_KEY");const e=this.getPrefixedKey(t);this.memoryStorage.delete(e),d.info(`MemoryStorage removeItem: ${e}`)})}clear(){return e(this,void 0,void 0,function*(){this.memoryStorage.clear(),d.info("MemoryStorage cleared")})}getAllKeys(){return e(this,void 0,void 0,function*(){const t=[];for(const e of this.memoryStorage.keys())e.startsWith(this.storagePrefix)&&t.push(e.substring(this.storagePrefix.length));return t})}getType(){return A.MEMORY}size(){return this.memoryStorage.size}}function E(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}new x;var k,C={exports:{}},R={exports:{}};function T(){return k||(k=1,R.exports=function(){var t=t||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),i={},n=i.lib={},a=n.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=n.WordArray=a.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var a=0;a<n;a++){var s=r[a>>>2]>>>24-a%4*8&255;e[i+a>>>2]|=s<<24-(i+a)%4*8}else for(a=0;a<n;a+=4)e[i+a>>>2]=r[a>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,i=[],n=function(e){var r=987654321,i=4294967295;return function(){var n=((r=36969*(65535&r)+(r>>16)&i)<<16)+(e=18e3*(65535&e)+(e>>16)&i)&i;return n/=4294967296,(n+=.5)*(t.random()>.5?1:-1)}},a=0;a<e;a+=4){var o=n(4294967296*(r||t.random()));r=987654071*o(),i.push(4294967296*o()|0)}return new s.init(i,e)}}),o=i.enc={},f=o.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var a=e[n>>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(r,e/2)}},c=o.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var a=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(r,e)}},h=o.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},d=n.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,i=r.words,n=r.sigBytes,a=this.blockSize,o=n/(4*a),f=(o=e?t.ceil(o):t.max((0|o)-this._minBufferSize,0))*a,c=t.min(4*f,n);if(f){for(var h=0;h<f;h+=a)this._doProcessBlock(i,h);var d=i.splice(0,f);r.sigBytes-=c}return new s.init(d,c)},clone:function(){var t=a.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});n.Hasher=d.extend({cfg:a.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new u.HMAC.init(t,r).finalize(e)}}});var u=i.algo={};return i}(Math);return t}()),R.exports}var P,z={exports:{}};function B(){return P||(P=1,z.exports=function(t){return i=(r=t).lib,n=i.Base,a=i.WordArray,(s=r.x64={}).Word=n.extend({init:function(t,e){this.high=t,this.low=e}}),s.WordArray=n.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],i=0;i<e;i++){var n=t[i];r.push(n.high),r.push(n.low)}return a.create(r,this.sigBytes)},clone:function(){for(var t=n.clone.call(this),e=t.words=this.words.slice(0),r=e.length,i=0;i<r;i++)e[i]=e[i].clone();return t}}),t;var e,r,i,n,a,s}(T())),z.exports}var K,D={exports:{}};function H(){return K||(K=1,D.exports=function(t){return function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,r=e.init,i=e.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,i=[],n=0;n<e;n++)i[n>>>2]|=t[n]<<24-n%4*8;r.call(this,i,e)}else r.apply(this,arguments)};i.prototype=e}}(),t.lib.WordArray}(T())),D.exports}var q,N={exports:{}};function O(){return q||(q=1,N.exports=function(t){return function(){var e=t,r=e.lib.WordArray,i=e.enc;function n(t){return t<<8&4278255360|t>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n+=2){var a=e[n>>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n++)i[n>>>1]|=t.charCodeAt(n)<<16-n%2*16;return r.create(i,2*e)}},i.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],a=0;a<r;a+=2){var s=n(e[a>>>2]>>>16-a%4*8&65535);i.push(String.fromCharCode(s))}return i.join("")},parse:function(t){for(var e=t.length,i=[],a=0;a<e;a++)i[a>>>1]|=n(t.charCodeAt(a)<<16-a%2*16);return r.create(i,2*e)}}}(),t.enc.Utf16}(T())),N.exports}var F,L={exports:{}};function U(){return F||(F=1,L.exports=function(t){return function(){var e=t,r=e.lib.WordArray;function i(t,e,i){for(var n=[],a=0,s=0;s<e;s++)if(s%4){var o=i[t.charCodeAt(s-1)]<<s%4*2,f=i[t.charCodeAt(s)]>>>6-s%4*2;n[a>>>2]|=(o|f)<<24-a%4*8,a++}return r.create(n,a)}e.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,i=this._map;t.clamp();for(var n=[],a=0;a<r;a+=3)for(var s=(e[a>>>2]>>>24-a%4*8&255)<<16|(e[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|e[a+2>>>2]>>>24-(a+2)%4*8&255,o=0;o<4&&a+.75*o<r;o++)n.push(i.charAt(s>>>6*(3-o)&63));var f=i.charAt(64);if(f)for(;n.length%4;)n.push(f);return n.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var a=0;a<r.length;a++)n[r.charCodeAt(a)]=a}var s=r.charAt(64);if(s){var o=t.indexOf(s);-1!==o&&(e=o)}return i(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64}(T())),L.exports}var j,$={exports:{}};function W(){return j||(j=1,$.exports=function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,s=r.algo,o=[];!function(){for(var t=0;t<64;t++)o[t]=4294967296*e.abs(e.sin(t+1))|0}();var f=s.MD5=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var a=this._hash.words,s=t[e+0],f=t[e+1],l=t[e+2],p=t[e+3],b=t[e+4],g=t[e+5],y=t[e+6],v=t[e+7],m=t[e+8],w=t[e+9],_=t[e+10],S=t[e+11],M=t[e+12],A=t[e+13],I=t[e+14],x=t[e+15],E=a[0],k=a[1],C=a[2],R=a[3];E=c(E,k,C,R,s,7,o[0]),R=c(R,E,k,C,f,12,o[1]),C=c(C,R,E,k,l,17,o[2]),k=c(k,C,R,E,p,22,o[3]),E=c(E,k,C,R,b,7,o[4]),R=c(R,E,k,C,g,12,o[5]),C=c(C,R,E,k,y,17,o[6]),k=c(k,C,R,E,v,22,o[7]),E=c(E,k,C,R,m,7,o[8]),R=c(R,E,k,C,w,12,o[9]),C=c(C,R,E,k,_,17,o[10]),k=c(k,C,R,E,S,22,o[11]),E=c(E,k,C,R,M,7,o[12]),R=c(R,E,k,C,A,12,o[13]),C=c(C,R,E,k,I,17,o[14]),E=h(E,k=c(k,C,R,E,x,22,o[15]),C,R,f,5,o[16]),R=h(R,E,k,C,y,9,o[17]),C=h(C,R,E,k,S,14,o[18]),k=h(k,C,R,E,s,20,o[19]),E=h(E,k,C,R,g,5,o[20]),R=h(R,E,k,C,_,9,o[21]),C=h(C,R,E,k,x,14,o[22]),k=h(k,C,R,E,b,20,o[23]),E=h(E,k,C,R,w,5,o[24]),R=h(R,E,k,C,I,9,o[25]),C=h(C,R,E,k,p,14,o[26]),k=h(k,C,R,E,m,20,o[27]),E=h(E,k,C,R,A,5,o[28]),R=h(R,E,k,C,l,9,o[29]),C=h(C,R,E,k,v,14,o[30]),E=d(E,k=h(k,C,R,E,M,20,o[31]),C,R,g,4,o[32]),R=d(R,E,k,C,m,11,o[33]),C=d(C,R,E,k,S,16,o[34]),k=d(k,C,R,E,I,23,o[35]),E=d(E,k,C,R,f,4,o[36]),R=d(R,E,k,C,b,11,o[37]),C=d(C,R,E,k,v,16,o[38]),k=d(k,C,R,E,_,23,o[39]),E=d(E,k,C,R,A,4,o[40]),R=d(R,E,k,C,s,11,o[41]),C=d(C,R,E,k,p,16,o[42]),k=d(k,C,R,E,y,23,o[43]),E=d(E,k,C,R,w,4,o[44]),R=d(R,E,k,C,M,11,o[45]),C=d(C,R,E,k,x,16,o[46]),E=u(E,k=d(k,C,R,E,l,23,o[47]),C,R,s,6,o[48]),R=u(R,E,k,C,v,10,o[49]),C=u(C,R,E,k,I,15,o[50]),k=u(k,C,R,E,g,21,o[51]),E=u(E,k,C,R,M,6,o[52]),R=u(R,E,k,C,p,10,o[53]),C=u(C,R,E,k,_,15,o[54]),k=u(k,C,R,E,f,21,o[55]),E=u(E,k,C,R,m,6,o[56]),R=u(R,E,k,C,x,10,o[57]),C=u(C,R,E,k,y,15,o[58]),k=u(k,C,R,E,A,21,o[59]),E=u(E,k,C,R,b,6,o[60]),R=u(R,E,k,C,S,10,o[61]),C=u(C,R,E,k,l,15,o[62]),k=u(k,C,R,E,w,21,o[63]),a[0]=a[0]+E|0,a[1]=a[1]+k|0,a[2]=a[2]+C|0,a[3]=a[3]+R|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;r[n>>>5]|=128<<24-n%32;var a=e.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var o=this._hash,f=o.words,c=0;c<4;c++){var h=f[c];f[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return o},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,r,i,n,a,s){var o=t+(e&r|~e&i)+n+s;return(o<<a|o>>>32-a)+e}function h(t,e,r,i,n,a,s){var o=t+(e&i|r&~i)+n+s;return(o<<a|o>>>32-a)+e}function d(t,e,r,i,n,a,s){var o=t+(e^r^i)+n+s;return(o<<a|o>>>32-a)+e}function u(t,e,r,i,n,a,s){var o=t+(r^(e|~i))+n+s;return(o<<a|o>>>32-a)+e}r.MD5=a._createHelper(f),r.HmacMD5=a._createHmacHelper(f)}(Math),t.MD5}(T())),$.exports}var V,G={exports:{}};function X(){return V||(V=1,G.exports=function(t){return r=(e=t).lib,i=r.WordArray,n=r.Hasher,a=e.algo,s=[],o=a.SHA1=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],f=r[4],c=0;c<80;c++){if(c<16)s[c]=0|t[e+c];else{var h=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=h<<1|h>>>31}var d=(i<<5|i>>>27)+f+s[c];d+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,f=o,o=a,a=n<<30|n>>>2,n=i,i=d}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+f|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA1=n._createHelper(o),e.HmacSHA1=n._createHmacHelper(o),t.SHA1;var e,r,i,n,a,s,o}(T())),G.exports}var Y,Z={exports:{}};function J(){return Y||(Y=1,Z.exports=function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,s=r.algo,o=[],f=[];!function(){function t(t){for(var r=e.sqrt(t),i=2;i<=r;i++)if(!(t%i))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var i=2,n=0;n<64;)t(i)&&(n<8&&(o[n]=r(e.pow(i,.5))),f[n]=r(e.pow(i,1/3)),n++),i++}();var c=[],h=s.SHA256=a.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],s=r[3],o=r[4],h=r[5],d=r[6],u=r[7],l=0;l<64;l++){if(l<16)c[l]=0|t[e+l];else{var p=c[l-15],b=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[l-2],y=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=b+c[l-7]+y+c[l-16]}var v=i&n^i&a^n&a,m=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),w=u+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&h^~o&d)+f[l]+c[l];u=d,d=h,h=o,o=s+w|0,s=a,a=n,n=i,i=w+(m+v)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+o|0,r[5]=r[5]+h|0,r[6]=r[6]+d|0,r[7]=r[7]+u|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=e.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});r.SHA256=a._createHelper(h),r.HmacSHA256=a._createHmacHelper(h)}(Math),t.SHA256}(T())),Z.exports}var Q,tt={exports:{}};var et,rt={exports:{}};function it(){return et||(et=1,rt.exports=function(t){return function(){var e=t,r=e.lib.Hasher,i=e.x64,n=i.Word,a=i.WordArray,s=e.algo;function o(){return n.create.apply(n,arguments)}var f=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=o()}();var h=s.SHA512=r.extend({_doReset:function(){this._hash=new a.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],s=r[3],o=r[4],h=r[5],d=r[6],u=r[7],l=i.high,p=i.low,b=n.high,g=n.low,y=a.high,v=a.low,m=s.high,w=s.low,_=o.high,S=o.low,M=h.high,A=h.low,I=d.high,x=d.low,E=u.high,k=u.low,C=l,R=p,T=b,P=g,z=y,B=v,K=m,D=w,H=_,q=S,N=M,O=A,F=I,L=x,U=E,j=k,$=0;$<80;$++){var W=c[$];if($<16)var V=W.high=0|t[e+2*$],G=W.low=0|t[e+2*$+1];else{var X=c[$-15],Y=X.high,Z=X.low,J=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,Q=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),tt=c[$-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),at=c[$-7],st=at.high,ot=at.low,ft=c[$-16],ct=ft.high,ht=ft.low;V=(V=(V=J+st+((G=Q+ot)>>>0<Q>>>0?1:0))+it+((G+=nt)>>>0<nt>>>0?1:0))+ct+((G+=ht)>>>0<ht>>>0?1:0),W.high=V,W.low=G}var dt,ut=H&N^~H&F,lt=q&O^~q&L,pt=C&T^C&z^T&z,bt=R&P^R&B^P&B,gt=(C>>>28|R<<4)^(C<<30|R>>>2)^(C<<25|R>>>7),yt=(R>>>28|C<<4)^(R<<30|C>>>2)^(R<<25|C>>>7),vt=(H>>>14|q<<18)^(H>>>18|q<<14)^(H<<23|q>>>9),mt=(q>>>14|H<<18)^(q>>>18|H<<14)^(q<<23|H>>>9),wt=f[$],_t=wt.high,St=wt.low,Mt=U+vt+((dt=j+mt)>>>0<j>>>0?1:0),At=yt+bt;U=F,j=L,F=N,L=O,N=H,O=q,H=K+(Mt=(Mt=(Mt=Mt+ut+((dt+=lt)>>>0<lt>>>0?1:0))+_t+((dt+=St)>>>0<St>>>0?1:0))+V+((dt+=G)>>>0<G>>>0?1:0))+((q=D+dt|0)>>>0<D>>>0?1:0)|0,K=z,D=B,z=T,B=P,T=C,P=R,C=Mt+(gt+pt+(At>>>0<yt>>>0?1:0))+((R=dt+At|0)>>>0<dt>>>0?1:0)|0}p=i.low=p+R,i.high=l+C+(p>>>0<R>>>0?1:0),g=n.low=g+P,n.high=b+T+(g>>>0<P>>>0?1:0),v=a.low=v+B,a.high=y+z+(v>>>0<B>>>0?1:0),w=s.low=w+D,s.high=m+K+(w>>>0<D>>>0?1:0),S=o.low=S+q,o.high=_+H+(S>>>0<q>>>0?1:0),A=h.low=A+O,h.high=M+N+(A>>>0<O>>>0?1:0),x=d.low=x+L,d.high=I+F+(x>>>0<L>>>0?1:0),k=u.low=k+j,u.high=E+U+(k>>>0<j>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});e.SHA512=r._createHelper(h),e.HmacSHA512=r._createHmacHelper(h)}(),t.SHA512}(T(),B())),rt.exports}var nt,at={exports:{}};var st,ot={exports:{}};function ft(){return st||(st=1,ot.exports=function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,s=r.x64.Word,o=r.algo,f=[],c=[],h=[];!function(){for(var t=1,e=0,r=0;r<24;r++){f[t+5*e]=(r+1)*(r+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,d=0,u=0;u<7;u++){if(1&n){var l=(1<<u)-1;l<32?d^=1<<l:o^=1<<l-32}128&n?n=n<<1^113:n<<=1}h[a]=s.create(o,d)}}();var d=[];!function(){for(var t=0;t<25;t++)d[t]=s.create()}();var u=o.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var r=this._state,i=this.blockSize/2,n=0;n<i;n++){var a=t[e+2*n],s=t[e+2*n+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(k=r[n]).high^=s,k.low^=a}for(var o=0;o<24;o++){for(var u=0;u<5;u++){for(var l=0,p=0,b=0;b<5;b++)l^=(k=r[u+5*b]).high,p^=k.low;var g=d[u];g.high=l,g.low=p}for(u=0;u<5;u++){var y=d[(u+4)%5],v=d[(u+1)%5],m=v.high,w=v.low;for(l=y.high^(m<<1|w>>>31),p=y.low^(w<<1|m>>>31),b=0;b<5;b++)(k=r[u+5*b]).high^=l,k.low^=p}for(var _=1;_<25;_++){var S=(k=r[_]).high,M=k.low,A=f[_];A<32?(l=S<<A|M>>>32-A,p=M<<A|S>>>32-A):(l=M<<A-32|S>>>64-A,p=S<<A-32|M>>>64-A);var I=d[c[_]];I.high=l,I.low=p}var x=d[0],E=r[0];for(x.high=E.high,x.low=E.low,u=0;u<5;u++)for(b=0;b<5;b++){var k=r[_=u+5*b],C=d[_],R=d[(u+1)%5+5*b],T=d[(u+2)%5+5*b];k.high=C.high^~R.high&T.high,k.low=C.low^~R.low&T.low}k=r[0];var P=h[o];k.high^=P.high,k.low^=P.low}},_doFinalize:function(){var t=this._data,r=t.words;this._nDataBytes;var i=8*t.sigBytes,a=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(e.ceil((i+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,o=this.cfg.outputLength/8,f=o/8,c=[],h=0;h<f;h++){var d=s[h],u=d.high,l=d.low;u=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),c.push(l),c.push(u)}return new n.init(c,o)},clone:function(){for(var t=a.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});r.SHA3=a._createHelper(u),r.HmacSHA3=a._createHmacHelper(u)}(Math),t.SHA3}(T(),B())),ot.exports}var ct,ht={exports:{}};var dt,ut={exports:{}};function lt(){return dt||(dt=1,ut.exports=function(t){var e,r,i;r=(e=t).lib.Base,i=e.enc.Utf8,e.algo.HMAC=r.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=i.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var a=this._oKey=e.clone(),s=this._iKey=e.clone(),o=a.words,f=s.words,c=0;c<r;c++)o[c]^=1549556828,f[c]^=909522486;a.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})}(T())),ut.exports}var pt,bt={exports:{}};var gt,yt={exports:{}};function vt(){return gt||(gt=1,yt.exports=function(t){return r=(e=t).lib,i=r.Base,n=r.WordArray,a=e.algo,s=a.MD5,o=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=r.hasher.create(),a=n.create(),s=a.words,o=r.keySize,f=r.iterations;s.length<o;){c&&i.update(c);var c=i.update(t).finalize(e);i.reset();for(var h=1;h<f;h++)c=i.finalize(c),i.reset();a.concat(c)}return a.sigBytes=4*o,a}}),e.EvpKDF=function(t,e,r){return o.create(r).compute(t,e)},t.EvpKDF;var e,r,i,n,a,s,o}(T(),X(),lt())),yt.exports}var mt,wt={exports:{}};function _t(){return mt||(mt=1,wt.exports=function(t){t.lib.Cipher||function(e){var r=t,i=r.lib,n=i.Base,a=i.WordArray,s=i.BufferedBlockAlgorithm,o=r.enc;o.Utf8;var f=o.Base64,c=r.algo.EvpKDF,h=i.Cipher=s.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?m:y}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()});i.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=r.mode={},u=i.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),l=d.CBC=function(){var t=u.extend();function r(t,r,i){var n=this._iv;if(n){var a=n;this._iv=e}else a=this._prevBlock;for(var s=0;s<i;s++)t[r+s]^=a[s]}return t.Encryptor=t.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize;r.call(this,t,e,n),i.encryptBlock(t,e),this._prevBlock=t.slice(e,e+n)}}),t.Decryptor=t.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,a=t.slice(e,e+n);i.decryptBlock(t,e),r.call(this,t,e,n),this._prevBlock=a}}),t}(),p=(r.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,i=r-t.sigBytes%r,n=i<<24|i<<16|i<<8|i,s=[],o=0;o<i;o+=4)s.push(n);var f=a.create(s,i);t.concat(f)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}};i.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:p}),reset:function(){h.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else i=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==i?this._mode.init(this,e&&e.words):(this._mode=i.call(r,this,e&&e.words),this._mode.__creator=i)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var b=i.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),g=(r.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var i=a.create([1398893684,1701076831]).concat(r).concat(e);else i=e;return i.toString(f)},parse:function(t){var e=f.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var i=a.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return b.create({ciphertext:e,salt:i})}},y=i.SerializableCipher=n.extend({cfg:n.extend({format:g}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),a=n.finalize(e),s=n.cfg;return b.create({ciphertext:a,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),v=(r.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=a.random(8));var n=c.create({keySize:e+r}).compute(t,i),s=a.create(n.words.slice(e),4*r);return n.sigBytes=4*e,b.create({key:n,iv:s,salt:i})}},m=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:v}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var a=y.encrypt.call(this,t,e,n.key,i);return a.mixIn(n),a},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,y.decrypt.call(this,t,e,n.key,i)}})}()}(T(),vt())),wt.exports}var St,Mt={exports:{}};function At(){return St||(St=1,Mt.exports=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function r(t,e,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var s=0;s<r;s++)t[e+s]^=a[s]}return e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize;r.call(this,t,e,n,i),this._prevBlock=t.slice(e,e+n)}}),e.Decryptor=e.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,a=t.slice(e,e+n);r.call(this,t,e,n,i),this._prevBlock=a}}),e}(),t.mode.CFB}(T(),_t())),Mt.exports}var It,xt={exports:{}};function Et(){return It||(It=1,xt.exports=function(t){return t.mode.CTR=(e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,a=this._counter;n&&(a=this._counter=n.slice(0),this._iv=void 0);var s=a.slice(0);r.encryptBlock(s,0),a[i-1]=a[i-1]+1|0;for(var o=0;o<i;o++)t[e+o]^=s[o]}}),e.Decryptor=r,e),t.mode.CTR;var e,r}(T(),_t())),xt.exports}var kt,Ct={exports:{}};function Rt(){return kt||(kt=1,Ct.exports=function(t){return t.mode.CTRGladman=function(){var e=t.lib.BlockCipherMode.extend();function r(t){if(255&~(t>>24))t+=1<<24;else{var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}return t}function i(t){return 0===(t[0]=r(t[0]))&&(t[1]=r(t[1])),t}var n=e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,a=this._iv,s=this._counter;a&&(s=this._counter=a.slice(0),this._iv=void 0),i(s);var o=s.slice(0);r.encryptBlock(o,0);for(var f=0;f<n;f++)t[e+f]^=o[f]}});return e.Decryptor=n,e}(),t.mode.CTRGladman}(T(),_t())),Ct.exports}var Tt,Pt={exports:{}};function zt(){return Tt||(Tt=1,Pt.exports=function(t){return t.mode.OFB=(e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,a=this._keystream;n&&(a=this._keystream=n.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var s=0;s<i;s++)t[e+s]^=a[s]}}),e.Decryptor=r,e),t.mode.OFB;var e,r}(T(),_t())),Pt.exports}var Bt,Kt={exports:{}};var Dt,Ht={exports:{}};var qt,Nt={exports:{}};var Ot,Ft={exports:{}};var Lt,Ut={exports:{}};var jt,$t={exports:{}};var Wt,Vt={exports:{}};var Gt,Xt={exports:{}};var Yt,Zt={exports:{}};var Jt,Qt={exports:{}};var te,ee={exports:{}};var re,ie={exports:{}};var ne;var ae,se=(ne||(ne=1,C.exports=function(t){return t}(T(),B(),H(),O(),U(),W(),X(),J(),Q||(Q=1,tt.exports=function(t){return r=(e=t).lib.WordArray,i=e.algo,n=i.SHA256,a=i.SHA224=n.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}}),e.SHA224=n._createHelper(a),e.HmacSHA224=n._createHmacHelper(a),t.SHA224;var e,r,i,n,a}(T(),J())),it(),nt||(nt=1,at.exports=function(t){return r=(e=t).x64,i=r.Word,n=r.WordArray,a=e.algo,s=a.SHA512,o=a.SHA384=s.extend({_doReset:function(){this._hash=new n.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=16,t}}),e.SHA384=s._createHelper(o),e.HmacSHA384=s._createHmacHelper(o),t.SHA384;var e,r,i,n,a,s,o}(T(),B(),it())),ft(),ct||(ct=1,ht.exports=function(t){return function(){var e=t,r=e.lib,i=r.WordArray,n=r.Hasher,a=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),f=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),u=a.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var a,u,m,w,_,S,M,A,I,x,E,k=this._hash.words,C=h.words,R=d.words,T=s.words,P=o.words,z=f.words,B=c.words;for(S=a=k[0],M=u=k[1],A=m=k[2],I=w=k[3],x=_=k[4],r=0;r<80;r+=1)E=a+t[e+T[r]]|0,E+=r<16?l(u,m,w)+C[0]:r<32?p(u,m,w)+C[1]:r<48?b(u,m,w)+C[2]:r<64?g(u,m,w)+C[3]:y(u,m,w)+C[4],E=(E=v(E|=0,z[r]))+_|0,a=_,_=w,w=v(m,10),m=u,u=E,E=S+t[e+P[r]]|0,E+=r<16?y(M,A,I)+R[0]:r<32?g(M,A,I)+R[1]:r<48?b(M,A,I)+R[2]:r<64?p(M,A,I)+R[3]:l(M,A,I)+R[4],E=(E=v(E|=0,B[r]))+x|0,S=x,x=I,I=v(A,10),A=M,M=E;E=k[1]+m+I|0,k[1]=k[2]+w+x|0,k[2]=k[3]+_+S|0,k[3]=k[4]+a+M|0,k[4]=k[0]+u+A|0,k[0]=E},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,a=n.words,s=0;s<5;s++){var o=a[s];a[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return n},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function l(t,e,r){return t^e^r}function p(t,e,r){return t&e|~t&r}function b(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function y(t,e,r){return t^(e|~r)}function v(t,e){return t<<e|t>>>32-e}e.RIPEMD160=n._createHelper(u),e.HmacRIPEMD160=n._createHmacHelper(u)}(),t.RIPEMD160}(T())),lt(),pt||(pt=1,bt.exports=function(t){return i=(r=(e=t).lib).Base,n=r.WordArray,s=(a=e.algo).SHA1,o=a.HMAC,f=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=o.create(r.hasher,t),a=n.create(),s=n.create([1]),f=a.words,c=s.words,h=r.keySize,d=r.iterations;f.length<h;){var u=i.update(e).finalize(s);i.reset();for(var l=u.words,p=l.length,b=u,g=1;g<d;g++){b=i.finalize(b),i.reset();for(var y=b.words,v=0;v<p;v++)l[v]^=y[v]}a.concat(u),c[0]++}return a.sigBytes=4*h,a}}),e.PBKDF2=function(t,e,r){return f.create(r).compute(t,e)},t.PBKDF2;var e,r,i,n,a,s,o,f}(T(),X(),lt())),vt(),_t(),At(),Et(),Rt(),zt(),Bt||(Bt=1,Kt.exports=function(t){return t.mode.ECB=((e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),e.Decryptor=e.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),e),t.mode.ECB;var e}(T(),_t())),Dt||(Dt=1,Ht.exports=function(t){return t.pad.AnsiX923={pad:function(t,e){var r=t.sigBytes,i=4*e,n=i-r%i,a=r+n-1;t.clamp(),t.words[a>>>2]|=n<<24-a%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Ansix923}(T(),_t())),qt||(qt=1,Nt.exports=function(t){return t.pad.Iso10126={pad:function(e,r){var i=4*r,n=i-e.sigBytes%i;e.concat(t.lib.WordArray.random(n-1)).concat(t.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126}(T(),_t())),Ot||(Ot=1,Ft.exports=function(t){return t.pad.Iso97971={pad:function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971}(T(),_t())),Lt||(Lt=1,Ut.exports=function(t){return t.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1;!(e[r>>>2]>>>24-r%4*8&255);)r--;t.sigBytes=r+1}},t.pad.ZeroPadding}(T(),_t())),jt||(jt=1,$t.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(T(),_t())),Wt||(Wt=1,Vt.exports=function(t){return r=(e=t).lib.CipherParams,i=e.enc.Hex,e.format.Hex={stringify:function(t){return t.ciphertext.toString(i)},parse:function(t){var e=i.parse(t);return r.create({ciphertext:e})}},t.format.Hex;var e,r,i}(T(),_t())),Gt||(Gt=1,Xt.exports=function(t){return function(){var e=t,r=e.lib.BlockCipher,i=e.algo,n=[],a=[],s=[],o=[],f=[],c=[],h=[],d=[],u=[],l=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,i=0;for(e=0;e<256;e++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,n[r]=p,a[p]=r;var b=t[r],g=t[b],y=t[g],v=257*t[p]^16843008*p;s[r]=v<<24|v>>>8,o[r]=v<<16|v>>>16,f[r]=v<<8|v>>>24,c[r]=v,v=16843009*y^65537*g^257*b^16843008*r,h[p]=v<<24|v>>>8,d[p]=v<<16|v>>>16,u[p]=v<<8|v>>>24,l[p]=v,r?(r=b^t[t[t[y^b]]],i^=t[t[i]]):r=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],b=i.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,i=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],s=0;s<i;s++)if(s<r)a[s]=e[s];else{var o=a[s-1];s%r?r>6&&s%r==4&&(o=n[o>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o]):(o=n[(o=o<<8|o>>>24)>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o],o^=p[s/r|0]<<24),a[s]=a[s-r]^o}for(var f=this._invKeySchedule=[],c=0;c<i;c++)s=i-c,o=c%4?a[s]:a[s-4],f[c]=c<4||s<=4?o:h[n[o>>>24]]^d[n[o>>>16&255]]^u[n[o>>>8&255]]^l[n[255&o]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,o,f,c,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,u,l,a),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,a,s,o){for(var f=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],d=t[e+2]^r[2],u=t[e+3]^r[3],l=4,p=1;p<f;p++){var b=i[c>>>24]^n[h>>>16&255]^a[d>>>8&255]^s[255&u]^r[l++],g=i[h>>>24]^n[d>>>16&255]^a[u>>>8&255]^s[255&c]^r[l++],y=i[d>>>24]^n[u>>>16&255]^a[c>>>8&255]^s[255&h]^r[l++],v=i[u>>>24]^n[c>>>16&255]^a[h>>>8&255]^s[255&d]^r[l++];c=b,h=g,d=y,u=v}b=(o[c>>>24]<<24|o[h>>>16&255]<<16|o[d>>>8&255]<<8|o[255&u])^r[l++],g=(o[h>>>24]<<24|o[d>>>16&255]<<16|o[u>>>8&255]<<8|o[255&c])^r[l++],y=(o[d>>>24]<<24|o[u>>>16&255]<<16|o[c>>>8&255]<<8|o[255&h])^r[l++],v=(o[u>>>24]<<24|o[c>>>16&255]<<16|o[h>>>8&255]<<8|o[255&d])^r[l++],t[e]=b,t[e+1]=g,t[e+2]=y,t[e+3]=v},keySize:8});e.AES=r._createHelper(b)}(),t.AES}(T(),U(),W(),vt(),_t())),Yt||(Yt=1,Zt.exports=function(t){return function(){var e=t,r=e.lib,i=r.WordArray,n=r.BlockCipher,a=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],f=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=n.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=s[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var c=n[a]=[],h=f[a];for(r=0;r<24;r++)c[r/6|0]|=e[(o[r]-1+h)%28]<<31-r%6,c[4+(r/6|0)]|=e[28+(o[r+24]-1+h)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],u.call(this,4,252645135),u.call(this,16,65535),l.call(this,2,858993459),l.call(this,8,16711935),u.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,s=this._rBlock,o=0,f=0;f<8;f++)o|=c[f][((s^n[f])&h[f])>>>0];this._lBlock=s,this._rBlock=a^o}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,u.call(this,1,1431655765),l.call(this,8,16711935),l.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function l(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}e.DES=n._createHelper(d);var p=a.TripleDES=n.extend({_doReset:function(){var t=this._key.words;this._des1=d.createEncryptor(i.create(t.slice(0,2))),this._des2=d.createEncryptor(i.create(t.slice(2,4))),this._des3=d.createEncryptor(i.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=n._createHelper(p)}(),t.TripleDES}(T(),U(),W(),vt(),_t())),Jt||(Jt=1,Qt.exports=function(t){return function(){var e=t,r=e.lib.StreamCipher,i=e.algo,n=i.RC4=r.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;n=0;for(var a=0;n<256;n++){var s=n%r,o=e[s>>>2]>>>24-s%4*8&255;a=(a+i[n]+o)%256;var f=i[n];i[n]=i[a],i[a]=f}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+t[e=(e+1)%256])%256;var a=t[e];t[e]=t[r],t[r]=a,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}e.RC4=r._createHelper(n);var s=i.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)a.call(this)}});e.RC4Drop=r._createHelper(s)}(),t.RC4}(T(),U(),W(),vt(),_t())),te||(te=1,ee.exports=function(t){return function(){var e=t,r=e.lib.StreamCipher,i=e.algo,n=[],a=[],s=[],o=i.Rabbit=r.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)f.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var a=e.words,s=a[0],o=a[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),d=c>>>16|4294901760&h,u=h<<16|65535&c;for(n[0]^=c,n[1]^=d,n[2]^=h,n[3]^=u,n[4]^=c,n[5]^=d,n[6]^=h,n[7]^=u,r=0;r<4;r++)f.call(this)}},_doProcessBlock:function(t,e){var r=this._X;f.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function f(){for(var t=this._X,e=this._C,r=0;r<8;r++)a[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<a[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<a[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<a[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<a[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<a[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<a[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<a[6]>>>0?1:0)|0,this._b=e[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,o=i>>>16,f=((n*n>>>17)+n*o>>>15)+o*o,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=f^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=r._createHelper(o)}(),t.Rabbit}(T(),U(),W(),vt(),_t())),re||(re=1,ie.exports=function(t){return function(){var e=t,r=e.lib.StreamCipher,i=e.algo,n=[],a=[],s=[],o=i.RabbitLegacy=r.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)f.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var a=e.words,s=a[0],o=a[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),d=c>>>16|4294901760&h,u=h<<16|65535&c;for(i[0]^=c,i[1]^=d,i[2]^=h,i[3]^=u,i[4]^=c,i[5]^=d,i[6]^=h,i[7]^=u,n=0;n<4;n++)f.call(this)}},_doProcessBlock:function(t,e){var r=this._X;f.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function f(){for(var t=this._X,e=this._C,r=0;r<8;r++)a[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<a[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<a[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<a[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<a[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<a[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<a[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<a[6]>>>0?1:0)|0,this._b=e[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,o=i>>>16,f=((n*n>>>17)+n*o>>>15)+o*o,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=f^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=r._createHelper(o)}(),t.RabbitLegacy}(T(),U(),W(),vt(),_t())))),C.exports),oe=t({__proto__:null,default:E(se)},[se]),fe={exports:{}};function ce(){if(ae)return fe.exports;var t;function e(t){this.rand=t}if(ae=1,fe.exports=function(r){return t||(t=new e(null)),t.generate(r)},fe.exports.Rand=e,e.prototype.generate=function(t){return this._rand(t)},e.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=require("crypto");if("function"!=typeof r.randomBytes)throw new Error("Not supported");e.prototype._rand=function(t){return r.randomBytes(t)}}catch(t){}return fe.exports}var he,de,ue,le=E(ce()),pe={},be="6.6.1",ge={},ye={exports:{}},ve=ye.exports;function me(){return he||(he=1,function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function f(t,e,r,i){for(var n=0,a=Math.min(t.length,r),s=e;s<a;s++){var o=t.charCodeAt(s)-48;n*=i,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){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"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){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 a,s,o=0;if("be"===i)for(n=t.length-1,a=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,a=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=o(t,e,i)<<a,this.words[s]|=67108863&n,a>=18?(a-=18,s+=1,this.words[s]|=n>>>26):a+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=o(t,e,i)<<a,this.words[s]|=67108863&n,a>=18?(a-=18,s+=1,this.words[s]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var a=t.length-r,s=a%i,o=Math.min(a,a-s)+r,c=0,h=r;h<o;h+=i)c=f(t,h,h+i,e),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=f(t,h,t.length,e),h=0;h<s;h++)d*=e;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[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],d=[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 u(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],a=0|e.words[0],s=n*a,o=67108863&s,f=s/67108864|0;r.words[0]=o;for(var c=1;c<i;c++){for(var h=f>>>26,d=67108863&f,u=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=u;l++){var p=c-l|0;h+=(s=(n=0|t.words[p])*(a=0|e.words[l])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,f=0|h}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,a=0,s=0;s<this.length;s++){var o=this.words[s],f=(16777215&(o<<n|a)).toString(16);a=o>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==a||s!==this.length-1?c[6-f.length]+f+i:f+i}for(0!==a&&(i=a.toString(16)+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],l=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);i=(p=p.idivn(l)).isZero()?b+i:c[u-b.length]+b+i}for(this.isZero()&&(i="0"+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,f="le"===e,c=new t(a),h=this.clone();if(f){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),c[o]=s;for(;o<a;o++)c[o]=0}else{for(o=0;o<a-n;o++)c[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),c[a-o-1]=s}return c},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},n.prototype.ior=function(t){return r(0===(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},n.prototype.iand=function(t){return r(0===(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},n.prototype.ixor=function(t){return r(0===(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,a=0;a<i.length;a++)e=(0|r.words[a])+(0|i.words[a])+n,this.words[a]=67108863&e,n=e>>>26;for(;0!==n&&a<r.length;a++)e=(0|r.words[a])+n,this.words[a]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var a=0,s=0;s<i.length;s++)a=(e=(0|r.words[s])-(0|i.words[s])+a)>>26,this.words[s]=67108863&e;for(;0!==a&&s<r.length;s++)a=(e=(0|r.words[s])+a)>>26,this.words[s]=67108863&e;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,a,s=t.words,o=e.words,f=r.words,c=0,h=0|s[0],d=8191&h,u=h>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],y=8191&g,v=g>>>13,m=0|s[3],w=8191&m,_=m>>>13,S=0|s[4],M=8191&S,A=S>>>13,I=0|s[5],x=8191&I,E=I>>>13,k=0|s[6],C=8191&k,R=k>>>13,T=0|s[7],P=8191&T,z=T>>>13,B=0|s[8],K=8191&B,D=B>>>13,H=0|s[9],q=8191&H,N=H>>>13,O=0|o[0],F=8191&O,L=O>>>13,U=0|o[1],j=8191&U,$=U>>>13,W=0|o[2],V=8191&W,G=W>>>13,X=0|o[3],Y=8191&X,Z=X>>>13,J=0|o[4],Q=8191&J,tt=J>>>13,et=0|o[5],rt=8191&et,it=et>>>13,nt=0|o[6],at=8191&nt,st=nt>>>13,ot=0|o[7],ft=8191&ot,ct=ot>>>13,ht=0|o[8],dt=8191&ht,ut=ht>>>13,lt=0|o[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,L))+Math.imul(u,F)|0))<<13)|0;c=((a=Math.imul(u,L))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,L))+Math.imul(b,F)|0,a=Math.imul(b,L);var yt=(c+(i=i+Math.imul(d,j)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(u,j)|0))<<13)|0;c=((a=a+Math.imul(u,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,L))+Math.imul(v,F)|0,a=Math.imul(v,L),i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(b,j)|0,a=a+Math.imul(b,$)|0;var vt=(c+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(u,V)|0))<<13)|0;c=((a=a+Math.imul(u,G)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,L))+Math.imul(_,F)|0,a=Math.imul(_,L),i=i+Math.imul(y,j)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,j)|0,a=a+Math.imul(v,$)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(b,V)|0,a=a+Math.imul(b,G)|0;var mt=(c+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(u,Y)|0))<<13)|0;c=((a=a+Math.imul(u,Z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,L))+Math.imul(A,F)|0,a=Math.imul(A,L),i=i+Math.imul(w,j)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,j)|0,a=a+Math.imul(_,$)|0,i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,G)|0)+Math.imul(v,V)|0,a=a+Math.imul(v,G)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,Z)|0;var wt=(c+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(u,Q)|0))<<13)|0;c=((a=a+Math.imul(u,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,L))+Math.imul(E,F)|0,a=Math.imul(E,L),i=i+Math.imul(M,j)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(A,j)|0,a=a+Math.imul(A,$)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,G)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,Z)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,tt)|0;var _t=(c+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(u,rt)|0))<<13)|0;c=((a=a+Math.imul(u,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,L))+Math.imul(R,F)|0,a=Math.imul(R,L),i=i+Math.imul(x,j)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(E,j)|0,a=a+Math.imul(E,$)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,G)|0)+Math.imul(A,V)|0,a=a+Math.imul(A,G)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,Z)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,a=a+Math.imul(b,it)|0;var St=(c+(i=i+Math.imul(d,at)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(u,at)|0))<<13)|0;c=((a=a+Math.imul(u,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(P,F),n=(n=Math.imul(P,L))+Math.imul(z,F)|0,a=Math.imul(z,L),i=i+Math.imul(C,j)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(R,j)|0,a=a+Math.imul(R,$)|0,i=i+Math.imul(x,V)|0,n=(n=n+Math.imul(x,G)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,G)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,Z)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,it)|0,i=i+Math.imul(p,at)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(b,at)|0,a=a+Math.imul(b,st)|0;var Mt=(c+(i=i+Math.imul(d,ft)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(u,ft)|0))<<13)|0;c=((a=a+Math.imul(u,ct)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(K,F),n=(n=Math.imul(K,L))+Math.imul(D,F)|0,a=Math.imul(D,L),i=i+Math.imul(P,j)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(z,j)|0,a=a+Math.imul(z,$)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(R,V)|0,a=a+Math.imul(R,G)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,Z)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,it)|0,i=i+Math.imul(y,at)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,st)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(b,ft)|0,a=a+Math.imul(b,ct)|0;var At=(c+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ut)|0)+Math.imul(u,dt)|0))<<13)|0;c=((a=a+Math.imul(u,ut)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,L))+Math.imul(N,F)|0,a=Math.imul(N,L),i=i+Math.imul(K,j)|0,n=(n=n+Math.imul(K,$)|0)+Math.imul(D,j)|0,a=a+Math.imul(D,$)|0,i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(z,V)|0,a=a+Math.imul(z,G)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,Z)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,it)|0,i=i+Math.imul(w,at)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,st)|0,i=i+Math.imul(y,ft)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(v,ft)|0,a=a+Math.imul(v,ct)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(b,dt)|0,a=a+Math.imul(b,ut)|0;var It=(c+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,bt)|0)+Math.imul(u,pt)|0))<<13)|0;c=((a=a+Math.imul(u,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,j),n=(n=Math.imul(q,$))+Math.imul(N,j)|0,a=Math.imul(N,$),i=i+Math.imul(K,V)|0,n=(n=n+Math.imul(K,G)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,G)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,Z)|0,i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,it)|0,i=i+Math.imul(M,at)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,st)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ct)|0,i=i+Math.imul(y,dt)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(v,dt)|0,a=a+Math.imul(v,ut)|0;var xt=(c+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((a=a+Math.imul(b,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(N,V)|0,a=Math.imul(N,G),i=i+Math.imul(K,Y)|0,n=(n=n+Math.imul(K,Z)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,Z)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,it)|0,i=i+Math.imul(x,at)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,st)|0,i=i+Math.imul(M,ft)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(A,ft)|0,a=a+Math.imul(A,ct)|0,i=i+Math.imul(w,dt)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,dt)|0,a=a+Math.imul(_,ut)|0;var Et=(c+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,bt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((a=a+Math.imul(v,bt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,Y),n=(n=Math.imul(q,Z))+Math.imul(N,Y)|0,a=Math.imul(N,Z),i=i+Math.imul(K,Q)|0,n=(n=n+Math.imul(K,tt)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,it)|0,i=i+Math.imul(C,at)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,st)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ct)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(A,dt)|0,a=a+Math.imul(A,ut)|0;var kt=(c+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(N,Q)|0,a=Math.imul(N,tt),i=i+Math.imul(K,rt)|0,n=(n=n+Math.imul(K,it)|0)+Math.imul(D,rt)|0,a=a+Math.imul(D,it)|0,i=i+Math.imul(P,at)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,st)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ct)|0,i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(E,dt)|0,a=a+Math.imul(E,ut)|0;var Ct=(c+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,bt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((a=a+Math.imul(A,bt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(N,rt)|0,a=Math.imul(N,it),i=i+Math.imul(K,at)|0,n=(n=n+Math.imul(K,st)|0)+Math.imul(D,at)|0,a=a+Math.imul(D,st)|0,i=i+Math.imul(P,ft)|0,n=(n=n+Math.imul(P,ct)|0)+Math.imul(z,ft)|0,a=a+Math.imul(z,ct)|0,i=i+Math.imul(C,dt)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(R,dt)|0,a=a+Math.imul(R,ut)|0;var Rt=(c+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,bt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((a=a+Math.imul(E,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,at),n=(n=Math.imul(q,st))+Math.imul(N,at)|0,a=Math.imul(N,st),i=i+Math.imul(K,ft)|0,n=(n=n+Math.imul(K,ct)|0)+Math.imul(D,ft)|0,a=a+Math.imul(D,ct)|0,i=i+Math.imul(P,dt)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(z,dt)|0,a=a+Math.imul(z,ut)|0;var Tt=(c+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,bt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((a=a+Math.imul(R,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,ft),n=(n=Math.imul(q,ct))+Math.imul(N,ft)|0,a=Math.imul(N,ct),i=i+Math.imul(K,dt)|0,n=(n=n+Math.imul(K,ut)|0)+Math.imul(D,dt)|0,a=a+Math.imul(D,ut)|0;var Pt=(c+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,bt)|0)+Math.imul(z,pt)|0))<<13)|0;c=((a=a+Math.imul(z,bt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(q,dt),n=(n=Math.imul(q,ut))+Math.imul(N,dt)|0,a=Math.imul(N,ut);var zt=(c+(i=i+Math.imul(K,pt)|0)|0)+((8191&(n=(n=n+Math.imul(K,bt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((a=a+Math.imul(D,bt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Bt=(c+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,bt))+Math.imul(N,pt)|0))<<13)|0;return c=((a=Math.imul(N,bt))+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,f[0]=gt,f[1]=yt,f[2]=vt,f[3]=mt,f[4]=wt,f[5]=_t,f[6]=St,f[7]=Mt,f[8]=At,f[9]=It,f[10]=xt,f[11]=Et,f[12]=kt,f[13]=Ct,f[14]=Rt,f[15]=Tt,f[16]=Pt,f[17]=zt,f[18]=Bt,0!==c&&(f[19]=c,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=u),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?l(this,t,e):i<63?u(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,a=0;a<r.length-1;a++){var s=n;n=0;for(var o=67108863&i,f=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=f;c++){var h=a-c,d=(0|t.words[h])*(0|e.words[c]),u=67108863&d;o=67108863&(u=u+o|0),n+=(s=(s=s+(d/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,t,e):p(this,t,e),r},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=n.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},b.prototype.permute=function(t,e,r,i,n,a){for(var s=0;s<a;s++)i[s]=e[t[s]],n[s]=r[t[s]]},b.prototype.transform=function(t,e,r,i,n,a){this.permute(a,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,f=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),h=0;h<n;h+=o)for(var d=f,u=c,l=0;l<s;l++){var p=r[h+l],b=i[h+l],g=r[h+l+s],y=i[h+l+s],v=d*g-u*y;y=d*y+u*g,g=v,r[h+l]=p+g,i[h+l]=b+y,r[h+l+s]=p-g,i[h+l+s]=b-y,l!==o&&(v=f*d-c*u,u=f*u+c*d,d=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},b.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},b.prototype.convert13b=function(t,e,i,n){for(var a=0,s=0;s<e;s++)a+=0|t[s],i[2*s]=8191&a,a>>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*e;s<n;++s)i[s]=0;r(0===a),r(!(-8192&a))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),a=this.stub(i),s=new Array(i),o=new Array(i),f=new Array(i),c=new Array(i),h=new Array(i),d=new Array(i),u=r.words;u.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,c,i),this.transform(s,a,o,f,i,n),this.transform(c,a,h,d,i,n);for(var l=0;l<i;l++){var p=o[l]*h[l]-f[l]*d[l];f[l]=o[l]*d[l]+f[l]*h[l],o[l]=p}return this.conjugate(o,f,i),this.transform(o,f,u,a,i,n),this.conjugate(u,a,i),this.normalize13b(u,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),p(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,a=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=a>>>26,this.words[i]=67108863&a}return 0!==e&&(this.words[i]=e,this.length++),this.length=0===t?1:this.length,this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var a=r.sqr();i<e.length;i++,a=a.sqr())0!==e[i]&&(r=r.mul(a));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,a=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var o=this.words[e]&a,f=(0|this.words[e])-o<<i;this.words[e]=f|s,s=o>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var a=t%26,s=Math.min((t-a)/26,this.length),o=67108863^67108863>>>a<<a,f=i;if(n-=s,n=Math.max(0,n),f){for(var c=0;c<s;c++)f.words[c]=this.words[c];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var d=0|this.words[c];this.words[c]=h<<26-a|d>>>a,h=d&o}return f&&0!==h&&(f.words[f.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.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)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.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 e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,a,s=t.length+i;this._expand(s);var o=0;for(n=0;n<t.length;n++){a=(0|this.words[n+i])+o;var f=(0|t.words[n])*e;o=((a-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&a}for(;n<this.length-i;n++)o=(a=(0|this.words[n+i])+o)>>26,this.words[n+i]=67108863&a;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n<this.length;n++)o=(a=-(0|this.words[n])+o)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),a=t,s=0|a.words[a.length-1];0!=(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,f=i.length-a.length;if("mod"!==e){(o=new n(null)).length=f+1,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var h=i.clone()._ishlnsubmul(a,1,f);0===h.negative&&(i=h,o&&(o.words[f]=1));for(var d=f-1;d>=0;d--){var u=67108864*(0|i.words[a.length+d])+(0|i.words[a.length+d-1]);for(u=Math.min(u/s|0,67108863),i._ishlnsubmul(a,u,d);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(a,1,d),i.isZero()||(i.negative^=1);o&&(o.words[d]=u)}return o&&o.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:a,mod:s}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!==(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(s=o.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:o.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,s,o},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},n.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new n(1),s=new n(0),o=new n(0),f=new n(1),c=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++c;for(var h=i.clone(),d=e.clone();!e.isZero();){for(var u=0,l=1;0===(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(h),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,b=1;0===(i.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(h),f.isub(d)),o.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(o),s.isub(f)):(i.isub(e),o.isub(a),f.isub(s))}return{a:o,b:f,gcd:i.iushln(c)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,s=new n(1),o=new n(0),f=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,h=1;0===(e.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var d=0,u=1;0===(i.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(i.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(o)):(i.isub(e),o.isub(s))}return(a=0===e.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(t),a},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var a=e;e=r,r=a}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var a=n,s=i;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new S(t)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}y.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=a&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(m,y),i(w,y),i(_,y),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new m;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),f=o.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new n(2*h*h).toRed(this);0!==this.pow(h,c).cmp(f);)h.redIAdd(f);for(var d=this.pow(h,a),u=this.pow(t,a.addn(1).iushrn(1)),l=this.pow(t,a),p=s;0!==l.cmp(o);){for(var b=l,g=0;0!==b.cmp(o);g++)b=b.redSqr();r(g<p);var y=this.pow(d,new n(1).iushln(p-g-1));u=u.redMul(y),d=y.redSqr(),l=l.redMul(d),p=g}return u},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var a=r[0],s=0,o=0,f=e.bitLength()%26;for(0===f&&(f=26),i=e.length-1;i>=0;i--){for(var c=e.words[i],h=f-1;h>=0;h--){var d=c>>h&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===i&&0===h)&&(a=this.mul(a,r[s]),o=0,s=0)):o=0}f=26}return a},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(ye,ve)),ye.exports}function we(){if(ue)return de;function t(t,e){if(!t)throw new Error(e||"Assertion failed")}return ue=1,de=t,t.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)},de}var _e,Se,Me={};function Ae(){return _e||(_e=1,function(){var t=Me;function e(t){return 1===t.length?"0"+t:t}function r(t){for(var r="",i=0;i<t.length;i++)r+=e(t[i].toString(16));return r}t.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),a=n>>8,s=255&n;a?r.push(a,s):r.push(s)}return r},t.zero2=e,t.toHex=r,t.encode=function(t,e){return"hex"===e?r(t):t}}()),Me}function Ie(){return Se||(Se=1,function(){var t=ge,e=me(),r=we(),i=Ae();t.assert=r,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(t,e,r){var i,n=new Array(Math.max(t.bitLength(),r)+1);for(i=0;i<n.length;i+=1)n[i]=0;var a=1<<e+1,s=t.clone();for(i=0;i<n.length;i++){var o,f=s.andln(a-1);s.isOdd()?(o=f>(a>>1)-1?(a>>1)-f:f,s.isubn(o)):o=0,n[i]=o,s.iushrn(1)}return n},t.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,a=0;t.cmpn(-n)>0||e.cmpn(-a)>0;){var s,o,f=t.andln(3)+n&3,c=e.andln(3)+a&3;3===f&&(f=-1),3===c&&(c=-1),s=1&f?3!==(i=t.andln(7)+n&7)&&5!==i||2!==c?f:-f:0,r[0].push(s),o=1&c?3!==(i=e.andln(7)+a&7)&&5!==i||2!==f?c:-c:0,r[1].push(o),2*n===s+1&&(n=1-n),2*a===o+1&&(a=1-a),t.iushrn(1),e.iushrn(1)}return r},t.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(t){return new e(t,"hex","le")}}()),ge}var xe,Ee,ke={};function Ce(){if(Ee)return xe;Ee=1;var t=me(),e=Ie(),r=e.getNAF,i=e.getJSF,n=e.assert;function a(e,r){this.type=e,this.p=new t(r.p,16),this.red=r.prime?t.red(r.prime):t.mont(this.p),this.zero=new t(0).toRed(this.red),this.one=new t(1).toRed(this.red),this.two=new t(2).toRed(this.red),this.n=r.n&&new t(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(t,e){this.curve=t,this.type=e,this.precomputed=null}return xe=a,a.prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(t,e){n(t.precomputed);var i=t._getDoubles(),a=r(e,1,this._bitLength),s=(1<<i.step+1)-(i.step%2==0?2:1);s/=3;var o,f,c=[];for(o=0;o<a.length;o+=i.step){f=0;for(var h=o+i.step-1;h>=o;h--)f=(f<<1)+a[h];c.push(f)}for(var d=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=s;l>0;l--){for(o=0;o<c.length;o++)(f=c[o])===l?u=u.mixedAdd(i.points[o]):f===-l&&(u=u.mixedAdd(i.points[o].neg()));d=d.add(u)}return d.toP()},a.prototype._wnafMul=function(t,e){var i=4,a=t._getNAFPoints(i);i=a.wnd;for(var s=a.points,o=r(e,i,this._bitLength),f=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var h=0;c>=0&&0===o[c];c--)h++;if(c>=0&&h++,f=f.dblp(h),c<0)break;var d=o[c];n(0!==d),f="affine"===t.type?d>0?f.mixedAdd(s[d-1>>1]):f.mixedAdd(s[-d-1>>1].neg()):d>0?f.add(s[d-1>>1]):f.add(s[-d-1>>1].neg())}return"affine"===t.type?f.toP():f},a.prototype._wnafMulAdd=function(t,e,n,a,s){var o,f,c,h=this._wnafT1,d=this._wnafT2,u=this._wnafT3,l=0;for(o=0;o<a;o++){var p=(c=e[o])._getNAFPoints(t);h[o]=p.wnd,d[o]=p.points}for(o=a-1;o>=1;o-=2){var b=o-1,g=o;if(1===h[b]&&1===h[g]){var y=[e[b],null,null,e[g]];0===e[b].y.cmp(e[g].y)?(y[1]=e[b].add(e[g]),y[2]=e[b].toJ().mixedAdd(e[g].neg())):0===e[b].y.cmp(e[g].y.redNeg())?(y[1]=e[b].toJ().mixedAdd(e[g]),y[2]=e[b].add(e[g].neg())):(y[1]=e[b].toJ().mixedAdd(e[g]),y[2]=e[b].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],m=i(n[b],n[g]);for(l=Math.max(m[0].length,l),u[b]=new Array(l),u[g]=new Array(l),f=0;f<l;f++){var w=0|m[0][f],_=0|m[1][f];u[b][f]=v[3*(w+1)+(_+1)],u[g][f]=0,d[b]=y}}else u[b]=r(n[b],h[b],this._bitLength),u[g]=r(n[g],h[g],this._bitLength),l=Math.max(u[b].length,l),l=Math.max(u[g].length,l)}var S=this.jpoint(null,null,null),M=this._wnafT4;for(o=l;o>=0;o--){for(var A=0;o>=0;){var I=!0;for(f=0;f<a;f++)M[f]=0|u[f][o],0!==M[f]&&(I=!1);if(!I)break;A++,o--}if(o>=0&&A++,S=S.dblp(A),o<0)break;for(f=0;f<a;f++){var x=M[f];0!==x&&(x>0?c=d[f][x-1>>1]:x<0&&(c=d[f][-x-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(o=0;o<a;o++)d[o]=null;return s?S:S.toP()},a.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},a.prototype.decodePoint=function(t,r){t=e.toArray(t,r);var i=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*i)return 6===t[0]?n(t[t.length-1]%2==0):7===t[0]&&n(t[t.length-1]%2==1),this.point(t.slice(1,1+i),t.slice(1+i,1+2*i));if((2===t[0]||3===t[0])&&t.length-1===i)return this.pointFromX(t.slice(1,1+i),3===t[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(t){return this.encode(t,!0)},s.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},s.prototype.encode=function(t,r){return e.encode(this._encode(r),t)},s.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},s.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},s.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var a=0;a<t;a++)i=i.dbl();r.push(i)}return{step:t,points:r}},s.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e},xe}var Re,Te,Pe,ze,Be,Ke,De,He,qe,Ne={exports:{}},Oe={exports:{}};function Fe(){if(Te)return Ne.exports;Te=1;try{var t=require("util");if("function"!=typeof t.inherits)throw"";Ne.exports=t.inherits}catch(t){Ne.exports=(Re||(Re=1,"function"==typeof Object.create?Oe.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Oe.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}),Oe.exports)}return Ne.exports}function Le(){return qe||(qe=1,function(t){var e=t;e.base=Ce(),e.short=function(){if(ze)return Pe;ze=1;var t=Ie(),e=me(),r=Fe(),i=Ce(),n=t.assert;function a(t){i.call(this,"short",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function s(t,r,n,a){i.BasePoint.call(this,t,"affine"),null===r&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(r,16),this.y=new e(n,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(t,r,n,a){i.BasePoint.call(this,t,"jacobian"),null===r&&null===n&&null===a?(this.x=this.curve.one,this.y=this.curve.one,this.z=new e(0)):(this.x=new e(r,16),this.y=new e(n,16),this.z=new e(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(a,i),Pe=a,a.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,i;if(t.beta)r=new e(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);r=(r=a[0].cmp(a[1])<0?a[0]:a[1]).toRed(this.red)}if(t.lambda)i=new e(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?i=s[0]:(i=s[1],n(0===this.g.mul(i).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:i,basis:t.basis?t.basis.map(function(t){return{a:new e(t.a,16),b:new e(t.b,16)}}):this._getEndoBasis(i)}}},a.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:e.mont(t),i=new e(2).toRed(r).redInvm(),n=i.redNeg(),a=new e(3).toRed(r).redNeg().redSqrt().redMul(i);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},a.prototype._getEndoBasis=function(t){for(var r,i,n,a,s,o,f,c,h,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=t,l=this.n.clone(),p=new e(1),b=new e(0),g=new e(0),y=new e(1),v=0;0!==u.cmpn(0);){var m=l.div(u);c=l.sub(m.mul(u)),h=g.sub(m.mul(p));var w=y.sub(m.mul(b));if(!n&&c.cmp(d)<0)r=f.neg(),i=p,n=c.neg(),a=h;else if(n&&2===++v)break;f=c,l=u,u=c,g=p,p=h,y=b,b=w}s=c.neg(),o=h;var _=n.sqr().add(a.sqr());return s.sqr().add(o.sqr()).cmp(_)>=0&&(s=r,o=i),n.negative&&(n=n.neg(),a=a.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:a},{a:s,b:o}]},a.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),o=a.mul(i.a),f=n.mul(r.b),c=a.mul(i.b);return{k1:t.sub(s).sub(o),k2:f.add(c).neg()}},a.prototype.pointFromX=function(t,r){(t=new e(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var a=n.fromRed().isOdd();return(r&&!a||!r&&a)&&(n=n.redNeg()),this.point(t,n)},a.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},a.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a<t.length;a++){var s=this._endoSplit(e[a]),o=t[a],f=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*a]=o,i[2*a+1]=f,n[2*a]=s.k1,n[2*a+1]=s.k2}for(var c=this._wnafMulAdd(1,i,n,2*a,r),h=0;h<2*a;h++)i[h]=null,n[h]=null;return c},r(s,i.BasePoint),a.prototype.point=function(t,e,r){return new s(this,t,e,r)},a.prototype.pointFromJSON=function(t,e){return s.fromJSON(this,t,e)},s.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},s.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},s.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var a=e[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(n))}},i},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.inf},s.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},s.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.prototype.mul=function(t){return t=new e(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},s.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},s.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},s.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},s.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(o,i.BasePoint),a.prototype.jpoint=function(t,e,r){return new o(this,t,e,r)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),o=i.redSub(n),f=a.redSub(s);if(0===o.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),h=c.redMul(o),d=i.redMul(c),u=f.redSqr().redIAdd(h).redISub(d).redISub(d),l=f.redMul(d.redISub(u)).redISub(a.redMul(h)),p=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(u,l,p)},o.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,a=t.y.redMul(e).redMul(this.z),s=r.redSub(i),o=n.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),h=r.redMul(f),d=o.redSqr().redIAdd(c).redISub(h).redISub(h),u=o.redMul(h.redISub(d)).redISub(n.redMul(c)),l=this.z.redMul(s);return this.curve.jpoint(d,u,l)},o.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,a=this.x,s=this.y,o=this.z,f=o.redSqr().redSqr(),c=s.redAdd(s);for(e=0;e<t;e++){var h=a.redSqr(),d=c.redSqr(),u=d.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(f)),p=a.redMul(d),b=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),y=l.redMul(g);y=y.redIAdd(y).redISub(u);var v=c.redMul(o);e+1<t&&(f=f.redMul(u)),a=b,o=v,c=y}return this.curve.jpoint(a,c.redMul(n),o)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},o.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i),f=o.redSqr().redISub(s).redISub(s),c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),t=f,e=o.redMul(s.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),d=this.y.redSqr(),u=d.redSqr(),l=this.x.redAdd(d).redSqr().redISub(h).redISub(u);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),b=p.redSqr(),g=u.redIAdd(u);g=(g=g.redIAdd(g)).redIAdd(g),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},o.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),f=o.redSqr().redISub(s).redISub(s);t=f;var c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),e=o.redMul(s.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),d=this.y.redSqr(),u=this.x.redMul(d),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=u.redIAdd(u),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(h);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=l.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},o.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),a=e.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(t.redMul(n)),f=e.redAdd(e),c=(f=f.redIAdd(f)).redMul(s),h=o.redSqr().redISub(c.redAdd(c)),d=c.redISub(h),u=s.redSqr();u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=o.redMul(d).redISub(u),p=r.redAdd(r).redMul(i);return this.curve.jpoint(h,l,p)},o.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),a=n.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(i),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),f=i.redIAdd(i);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var c=n.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(f),h=e.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.x.redMul(o).redISub(h);d=(d=d.redIAdd(d)).redIAdd(d);var u=this.y.redMul(c.redMul(f.redISub(c)).redISub(s.redMul(o)));u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(d,u,l)},o.prototype.mul=function(t,r){return t=new e(t,r),this.curve._wnafMul(this,t)},o.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},o.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},o.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Pe}(),e.mont=function(){if(Ke)return Be;Ke=1;var t=me(),e=Fe(),r=Ce(),i=Ie();function n(e){r.call(this,"mont",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.i4=new t(4).toRed(this.red).redInvm(),this.two=new t(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function a(e,i,n){r.BasePoint.call(this,e,"projective"),null===i&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new t(i,16),this.z=new t(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return e(n,r),Be=n,n.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},e(a,r.BasePoint),n.prototype.decodePoint=function(t,e){return this.point(i.toArray(t,e),1)},n.prototype.point=function(t,e){return new a(this,t,e)},n.prototype.pointFromJSON=function(t){return a.fromJSON(this,t)},a.prototype.precompute=function(){},a.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},a.fromJSON=function(t,e){return new a(t,e[0],e[1]||t.one)},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},a.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},a.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),a=t.x.redSub(t.z).redMul(r),s=n.redMul(i),o=e.z.redMul(a.redAdd(s).redSqr()),f=e.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,f)},a.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},a.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},a.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Be}(),e.edwards=function(){if(He)return De;He=1;var t=Ie(),e=me(),r=Fe(),i=Ce(),n=t.assert;function a(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,i.call(this,"edwards",t),this.a=new e(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new e(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new e(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function s(t,r,n,a,s){i.BasePoint.call(this,t,"projective"),null===r&&null===n&&null===a?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new e(r,16),this.y=new e(n,16),this.z=a?new e(a,16):this.curve.one,this.t=s&&new e(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(a,i),De=a,a.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},a.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},a.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},a.prototype.pointFromX=function(t,r){(t=new e(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),n=this.c2.redSub(this.a.redMul(i)),a=this.one.redSub(this.c2.redMul(this.d).redMul(i)),s=n.redMul(a.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(r&&!f||!r&&f)&&(o=o.redNeg()),this.point(t,o)},a.prototype.pointFromY=function(t,r){(t=new e(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),n=i.redSub(this.c2),a=i.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(a.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==r&&(o=o.redNeg()),this.point(o,t)},a.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},r(s,i.BasePoint),a.prototype.pointFromJSON=function(t){return s.fromJSON(this,t)},a.prototype.point=function(t,e,r,i){return new s(this,t,e,r,i)},s.fromJSON=function(t,e){return new s(t,e[0],e[1],e[2])},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=i.redAdd(e),s=a.redSub(r),o=i.redSub(e),f=n.redMul(s),c=a.redMul(o),h=n.redMul(o),d=s.redMul(a);return this.curve.point(f,c,d,h)},s.prototype._projDbl=function(){var t,e,r,i,n,a,s=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var c=(i=this.curve._mulA(o)).redAdd(f);this.zOne?(t=s.redSub(o).redSub(f).redMul(c.redSub(this.curve.two)),e=c.redMul(i.redSub(f)),r=c.redSqr().redSub(c).redSub(c)):(n=this.z.redSqr(),a=c.redSub(n).redISub(n),t=s.redSub(o).redISub(f).redMul(a),e=c.redMul(i.redSub(f)),r=c.redMul(a))}else i=o.redAdd(f),n=this.curve._mulC(this.z).redSqr(),a=i.redSub(n).redSub(n),t=this.curve._mulC(s.redISub(i)).redMul(a),e=this.curve._mulC(i).redMul(o.redISub(f)),r=i.redMul(a);return this.curve.point(t,e,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),s=n.redSub(i),o=n.redAdd(i),f=r.redAdd(e),c=a.redMul(s),h=o.redMul(f),d=a.redMul(f),u=s.redMul(o);return this.curve.point(c,h,u,d)},s.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),a=this.x.redMul(t.x),s=this.y.redMul(t.y),o=this.curve.d.redMul(a).redMul(s),f=n.redSub(o),c=n.redAdd(o),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(s),d=i.redMul(f).redMul(h);return this.curve.twisted?(e=i.redMul(c).redMul(s.redSub(this.curve._mulA(a))),r=f.redMul(c)):(e=i.redMul(c).redMul(s.redSub(a)),r=this.curve._mulC(f).redMul(c)),this.curve.point(d,e,r)},s.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},s.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},s.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},s.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},s.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,De}()}(ke)),ke}var Ue,je={},$e={},We={};function Ve(){if(Ue)return We;Ue=1;var t=we(),e=Fe();function r(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function i(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function n(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}return We.inherits=e,We.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),a=0;a<t.length;a+=2)i.push(parseInt(t[a]+t[a+1],16))}else for(var n=0,a=0;a<t.length;a++){var s=t.charCodeAt(a);s<128?i[n++]=s:s<2048?(i[n++]=s>>6|192,i[n++]=63&s|128):r(t,a)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++a)),i[n++]=s>>18|240,i[n++]=s>>12&63|128,i[n++]=s>>6&63|128,i[n++]=63&s|128):(i[n++]=s>>12|224,i[n++]=s>>6&63|128,i[n++]=63&s|128)}else for(a=0;a<t.length;a++)i[a]=0|t[a];return i},We.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e},We.htonl=i,We.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var s=t[n];"little"===e&&(s=i(s)),r+=a(s.toString(16))}return r},We.zero2=n,We.zero8=a,We.join32=function(e,r,i,n){var a=i-r;t(a%4==0);for(var s=new Array(a/4),o=0,f=r;o<s.length;o++,f+=4){var c;c="big"===n?e[f]<<24|e[f+1]<<16|e[f+2]<<8|e[f+3]:e[f+3]<<24|e[f+2]<<16|e[f+1]<<8|e[f],s[o]=c>>>0}return s},We.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var a=t[i];"big"===e?(r[n]=a>>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},We.rotr32=function(t,e){return t>>>e|t<<32-e},We.rotl32=function(t,e){return t<<e|t>>>32-e},We.sum32=function(t,e){return t+e>>>0},We.sum32_3=function(t,e,r){return t+e+r>>>0},We.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},We.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},We.sum64=function(t,e,r,i){var n=t[e],a=i+t[e+1]>>>0,s=(a<i?1:0)+r+n;t[e]=s>>>0,t[e+1]=a},We.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},We.sum64_lo=function(t,e,r,i){return e+i>>>0},We.sum64_4_hi=function(t,e,r,i,n,a,s,o){var f=0,c=e;return f+=(c=c+i>>>0)<e?1:0,f+=(c=c+a>>>0)<a?1:0,t+r+n+s+(f+=(c=c+o>>>0)<o?1:0)>>>0},We.sum64_4_lo=function(t,e,r,i,n,a,s,o){return e+i+a+o>>>0},We.sum64_5_hi=function(t,e,r,i,n,a,s,o,f,c){var h=0,d=e;return h+=(d=d+i>>>0)<e?1:0,h+=(d=d+a>>>0)<a?1:0,h+=(d=d+o>>>0)<o?1:0,t+r+n+s+f+(h+=(d=d+c>>>0)<c?1:0)>>>0},We.sum64_5_lo=function(t,e,r,i,n,a,s,o,f,c){return e+i+a+o+c>>>0},We.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},We.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},We.shr64_hi=function(t,e,r){return t>>>r},We.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},We}var Ge,Xe={};function Ye(){if(Ge)return Xe;Ge=1;var t=Ve(),e=we();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return Xe.BlockHash=r,r.prototype.update=function(e,r){if(e=t.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=t.join32(e,0,e.length-i,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},r.prototype.digest=function(t){return this.update(this._pad()),e(null===this.pending),this._digest(t)},r.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a<this.padLength;a++)i[n++]=0;return i},Xe}var Ze,Je,Qe,tr,er,rr,ir,nr,ar,sr,or,fr,cr={},hr={};function dr(){if(Ze)return hr;Ze=1;var t=Ve().rotr32;function e(t,e,r){return t&e^~t&r}function r(t,e,r){return t&e^t&r^e&r}function i(t,e,r){return t^e^r}return hr.ft_1=function(t,n,a,s){return 0===t?e(n,a,s):1===t||3===t?i(n,a,s):2===t?r(n,a,s):void 0},hr.ch32=e,hr.maj32=r,hr.p32=i,hr.s0_256=function(e){return t(e,2)^t(e,13)^t(e,22)},hr.s1_256=function(e){return t(e,6)^t(e,11)^t(e,25)},hr.g0_256=function(e){return t(e,7)^t(e,18)^e>>>3},hr.g1_256=function(e){return t(e,17)^t(e,19)^e>>>10},hr}function ur(){if(er)return tr;er=1;var t=Ve(),e=Ye(),r=dr(),i=we(),n=t.sum32,a=t.sum32_4,s=t.sum32_5,o=r.ch32,f=r.maj32,c=r.s0_256,h=r.s1_256,d=r.g0_256,u=r.g1_256,l=e.BlockHash,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;l.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return t.inherits(b,l),tr=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var r=this.W,l=0;l<16;l++)r[l]=t[e+l];for(;l<r.length;l++)r[l]=a(u(r[l-2]),r[l-7],d(r[l-15]),r[l-16]);var p=this.h[0],b=this.h[1],g=this.h[2],y=this.h[3],v=this.h[4],m=this.h[5],w=this.h[6],_=this.h[7];for(i(this.k.length===r.length),l=0;l<r.length;l++){var S=s(_,h(v),o(v,m,w),this.k[l],r[l]),M=n(c(p),f(p,b,g));_=w,w=m,m=v,v=n(y,S),y=g,g=b,b=p,p=n(S,M)}this.h[0]=n(this.h[0],p),this.h[1]=n(this.h[1],b),this.h[2]=n(this.h[2],g),this.h[3]=n(this.h[3],y),this.h[4]=n(this.h[4],v),this.h[5]=n(this.h[5],m),this.h[6]=n(this.h[6],w),this.h[7]=n(this.h[7],_)},b.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"big"):t.split32(this.h,"big")},tr}function lr(){if(ar)return nr;ar=1;var t=Ve(),e=Ye(),r=we(),i=t.rotr64_hi,n=t.rotr64_lo,a=t.shr64_hi,s=t.shr64_lo,o=t.sum64,f=t.sum64_hi,c=t.sum64_lo,h=t.sum64_4_hi,d=t.sum64_4_lo,u=t.sum64_5_hi,l=t.sum64_5_lo,p=e.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function g(){if(!(this instanceof g))return new g;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function y(t,e,r,i,n){var a=t&r^~t&n;return a<0&&(a+=4294967296),a}function v(t,e,r,i,n,a){var s=e&i^~e&a;return s<0&&(s+=4294967296),s}function m(t,e,r,i,n){var a=t&r^t&n^r&n;return a<0&&(a+=4294967296),a}function w(t,e,r,i,n,a){var s=e&i^e&a^i&a;return s<0&&(s+=4294967296),s}function _(t,e){var r=i(t,e,28)^i(e,t,2)^i(e,t,7);return r<0&&(r+=4294967296),r}function S(t,e){var r=n(t,e,28)^n(e,t,2)^n(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=i(t,e,14)^i(t,e,18)^i(e,t,9);return r<0&&(r+=4294967296),r}function A(t,e){var r=n(t,e,14)^n(t,e,18)^n(e,t,9);return r<0&&(r+=4294967296),r}function I(t,e){var r=i(t,e,1)^i(t,e,8)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=n(t,e,1)^n(t,e,8)^s(t,e,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=i(t,e,19)^i(e,t,29)^a(t,e,6);return r<0&&(r+=4294967296),r}function k(t,e){var r=n(t,e,19)^n(e,t,29)^s(t,e,6);return r<0&&(r+=4294967296),r}return t.inherits(g,p),nr=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=E(r[i-4],r[i-3]),a=k(r[i-4],r[i-3]),s=r[i-14],o=r[i-13],f=I(r[i-30],r[i-29]),c=x(r[i-30],r[i-29]),u=r[i-32],l=r[i-31];r[i]=h(n,a,s,o,f,c,u,l),r[i+1]=d(n,a,s,o,f,c,u,l)}},g.prototype._update=function(t,e){this._prepareBlock(t,e);var i=this.W,n=this.h[0],a=this.h[1],s=this.h[2],h=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],g=this.h[7],I=this.h[8],x=this.h[9],E=this.h[10],k=this.h[11],C=this.h[12],R=this.h[13],T=this.h[14],P=this.h[15];r(this.k.length===i.length);for(var z=0;z<i.length;z+=2){var B=T,K=P,D=M(I,x),H=A(I,x),q=y(I,x,E,k,C),N=v(I,x,E,k,C,R),O=this.k[z],F=this.k[z+1],L=i[z],U=i[z+1],j=u(B,K,D,H,q,N,O,F,L,U),$=l(B,K,D,H,q,N,O,F,L,U);B=_(n,a),K=S(n,a),D=m(n,a,s,h,d),H=w(n,a,s,h,d,p);var W=f(B,K,D,H),V=c(B,K,D,H);T=C,P=R,C=E,R=k,E=I,k=x,I=f(b,g,j,$),x=c(g,g,j,$),b=d,g=p,d=s,p=h,s=n,h=a,n=f(j,$,W,V),a=c(j,$,W,V)}o(this.h,0,n,a),o(this.h,2,s,h),o(this.h,4,d,p),o(this.h,6,b,g),o(this.h,8,I,x),o(this.h,10,E,k),o(this.h,12,C,R),o(this.h,14,T,P)},g.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"big"):t.split32(this.h,"big")},nr}function pr(){return fr||(fr=1,cr.sha1=function(){if(Qe)return Je;Qe=1;var t=Ve(),e=Ye(),r=dr(),i=t.rotl32,n=t.sum32,a=t.sum32_5,s=r.ft_1,o=e.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return t.inherits(c,o),Je=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.W,o=0;o<16;o++)r[o]=t[e+o];for(;o<r.length;o++)r[o]=i(r[o-3]^r[o-8]^r[o-14]^r[o-16],1);var c=this.h[0],h=this.h[1],d=this.h[2],u=this.h[3],l=this.h[4];for(o=0;o<r.length;o++){var p=~~(o/20),b=a(i(c,5),s(p,h,d,u),l,r[o],f[p]);l=u,u=d,d=i(h,30),h=c,c=b}this.h[0]=n(this.h[0],c),this.h[1]=n(this.h[1],h),this.h[2]=n(this.h[2],d),this.h[3]=n(this.h[3],u),this.h[4]=n(this.h[4],l)},c.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"big"):t.split32(this.h,"big")},Je}(),cr.sha224=function(){if(ir)return rr;ir=1;var t=Ve(),e=ur();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return t.inherits(r,e),rr=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h.slice(0,7),"big"):t.split32(this.h.slice(0,7),"big")},rr}(),cr.sha256=ur(),cr.sha384=function(){if(or)return sr;or=1;var t=Ve(),e=lr();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return t.inherits(r,e),sr=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h.slice(0,12),"big"):t.split32(this.h.slice(0,12),"big")},sr}(),cr.sha512=lr()),cr}var br,gr,yr,vr,mr,wr,_r,Sr,Mr,Ar,Ir,xr,Er,kr,Cr,Rr,Tr,Pr,zr,Br,Kr,Dr,Hr={};function qr(){return vr||(vr=1,function(t){var e=t;e.utils=Ve(),e.common=Ye(),e.sha=pr(),e.ripemd=function(){if(br)return Hr;br=1;var t=Ve(),e=Ye(),r=t.rotl32,i=t.sum32,n=t.sum32_3,a=t.sum32_4,s=e.BlockHash;function o(){if(!(this instanceof o))return new o;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function c(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function h(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}t.inherits(o,s),Hr.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(t,e){for(var s=this.h[0],o=this.h[1],b=this.h[2],g=this.h[3],y=this.h[4],v=s,m=o,w=b,_=g,S=y,M=0;M<80;M++){var A=i(r(a(s,f(M,o,b,g),t[d[M]+e],c(M)),l[M]),y);s=y,y=g,g=r(b,10),b=o,o=A,A=i(r(a(v,f(79-M,m,w,_),t[u[M]+e],h(M)),p[M]),S),v=S,S=_,_=r(w,10),w=m,m=A}A=n(this.h[1],b,_),this.h[1]=n(this.h[2],g,S),this.h[2]=n(this.h[3],y,v),this.h[3]=n(this.h[4],s,m),this.h[4]=n(this.h[0],o,w),this.h[0]=A},o.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"little"):t.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return Hr}(),e.hmac=function(){if(yr)return gr;yr=1;var t=Ve(),e=we();function r(e,i,n){if(!(this instanceof r))return new r(e,i,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(t.toArray(i,n))}return gr=r,r.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),e(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=(new this.Hash).update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=(new this.Hash).update(t)},r.prototype.update=function(t,e){return this.inner.update(t,e),this},r.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},gr}(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}($e)),$e}function Nr(){return _r||(_r=1,function(t){var e,r=t,i=qr(),n=Le(),a=Ie().assert;function s(t){"short"===t.type?this.curve=new n.short(t):"edwards"===t.type?this.curve=new n.edwards(t):this.curve=new n.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var i=new s(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=s,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{e=wr?mr:(wr=1,mr={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(t){e=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",e]})}(je)),je}function Or(){if(Cr)return kr;Cr=1;var t=me(),e=function(){if(Mr)return Sr;Mr=1;var t=qr(),e=Ae(),r=we();function i(t){if(!(this instanceof i))return new i(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=e.toArray(t.entropy,t.entropyEnc||"hex"),a=e.toArray(t.nonce,t.nonceEnc||"hex"),s=e.toArray(t.pers,t.persEnc||"hex");r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,a,s)}return Sr=i,i.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new t.hmac(this.hash,this.K)},i.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(t,i,n,a){"string"!=typeof i&&(a=n,n=i,i=null),t=e.toArray(t,i),n=e.toArray(n,a),r(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},i.prototype.generate=function(t,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(n=i,i=r,r=null),i&&(i=e.toArray(i,n||"hex"),this._update(i));for(var a=[];a.length<t;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var s=a.slice(0,t);return this._update(i),this._reseed++,e.encode(s,r)},Sr}(),r=Ie(),i=Nr(),n=ce(),a=r.assert,s=function(){if(Ir)return Ar;Ir=1;var t=me(),e=Ie().assert;function r(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}return Ar=r,r.fromPublic=function(t,e,i){return e instanceof r?e:new r(t,{pub:e,pubEnc:i})},r.fromPrivate=function(t,e,i){return e instanceof r?e:new r(t,{priv:e,privEnc:i})},r.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},r.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(e,r){this.priv=new t(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(t,r){if(t.x||t.y)return"mont"===this.ec.curve.type?e(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||e(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,r)},r.prototype.derive=function(t){return t.validate()||e(t.validate(),"public point not validated"),t.mul(this.priv).getX()},r.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},r.prototype.verify=function(t,e,r){return this.ec.verify(t,e,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Ar}(),o=function(){if(Er)return xr;Er=1;var t=me(),e=Ie(),r=e.assert;function i(e,n){if(e instanceof i)return e;this._importDER(e,n)||(r(e.r&&e.s,"Signature without r or s"),this.r=new t(e.r,16),this.s=new t(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function n(){this.place=0}function a(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===t[e.place])return!1;for(var n=0,a=0,s=e.place;a<i;a++,s++)n<<=8,n|=t[s],n>>>=0;return!(n<=127)&&(e.place=s,n)}function s(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function o(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}return xr=i,i.prototype._importDER=function(r,i){r=e.toArray(r,i);var s=new n;if(48!==r[s.place++])return!1;var o=a(r,s);if(!1===o)return!1;if(o+s.place!==r.length)return!1;if(2!==r[s.place++])return!1;var f=a(r,s);if(!1===f)return!1;if(128&r[s.place])return!1;var c=r.slice(s.place,f+s.place);if(s.place+=f,2!==r[s.place++])return!1;var h=a(r,s);if(!1===h)return!1;if(r.length!==h+s.place)return!1;if(128&r[s.place])return!1;var d=r.slice(s.place,h+s.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new t(c),this.s=new t(d),this.recoveryParam=null,!0},i.prototype.toDER=function(t){var r=this.r.toArray(),i=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&i[0]&&(i=[0].concat(i)),r=s(r),i=s(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];o(n,r.length),(n=n.concat(r)).push(2),o(n,i.length);var a=n.concat(i),f=[48];return o(f,a.length),f=f.concat(a),e.encode(f,t)},xr}();function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(a(Object.prototype.hasOwnProperty.call(i,t),"Unknown curve "+t),t=i[t]),t instanceof i.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}return kr=f,f.prototype.keyPair=function(t){return new s(this,t)},f.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},f.prototype.genKeyPair=function(r){r||(r={});for(var i=new e({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||n(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),a=this.n.byteLength(),s=this.n.sub(new t(2));;){var o=new t(i.generate(a));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},f.prototype._truncateToN=function(e,r,i){var n;if(t.isBN(e)||"number"==typeof e)n=(e=new t(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new t(e,16);else{var a=e.toString();n=a.length+1>>>1,e=new t(a,16)}"number"!=typeof i&&(i=8*n);var s=i-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(r,i,n,s){if("object"==typeof n&&(s=n,n=null),s||(s={}),"string"!=typeof r&&"number"!=typeof r&&!t.isBN(r)){a("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),a(r.length>>>0===r.length);for(var f=0;f<r.length;f++)a((255&r[f])===r[f])}i=this.keyFromPrivate(i,n),r=this._truncateToN(r,!1,s.msgBitLength),a(!r.isNeg(),"Can not sign a negative message");var c=this.n.byteLength(),h=i.getPrivate().toArray("be",c),d=r.toArray("be",c);a(new t(d).eq(r),"Can not sign message");for(var u=new e({hash:this.hash,entropy:h,nonce:d,pers:s.pers,persEnc:s.persEnc||"utf8"}),l=this.n.sub(new t(1)),p=0;;p++){var b=s.k?s.k(p):new t(u.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(l)>=0)){var g=this.g.mul(b);if(!g.isInfinity()){var y=g.getX(),v=y.umod(this.n);if(0!==v.cmpn(0)){var m=b.invm(this.n).mul(v.mul(i.getPrivate()).iadd(r));if(0!==(m=m.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==y.cmp(v)?2:0);return s.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),w^=1),new o({r:v,s:m,recoveryParam:w})}}}}}},f.prototype.verify=function(t,e,r,i,n){n||(n={}),t=this._truncateToN(t,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var a=(e=new o(e,"hex")).r,s=e.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var f,c=s.invm(this.n),h=c.mul(t).umod(this.n),d=c.mul(a).umod(this.n);return this.curve._maxwellTrick?!(f=this.g.jmulAdd(h,r.getPublic(),d)).isInfinity()&&f.eqXToP(a):!(f=this.g.mulAdd(h,r.getPublic(),d)).isInfinity()&&0===f.getX().umod(this.n).cmp(a)},f.prototype.recoverPubKey=function(e,r,i,n){a((3&i)===i,"The recovery param is more than two bits"),r=new o(r,n);var s=this.n,f=new t(e),c=r.r,h=r.s,d=1&i,u=i>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");c=u?this.curve.pointFromX(c.add(this.curve.n),d):this.curve.pointFromX(c,d);var l=r.r.invm(s),p=s.sub(f).mul(l).umod(s),b=h.mul(l).umod(s);return this.g.mulAdd(p,c,b)},f.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new o(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(t,e,n)}catch(t){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")},kr}function Fr(){if(Kr)return Br;Kr=1;var t=qr(),e=Nr(),r=Ie(),i=r.assert,n=r.parseBytes,a=function(){if(Tr)return Rr;Tr=1;var t=Ie(),e=t.assert,r=t.parseBytes,i=t.cachedProperty;function n(t,e){this.eddsa=t,this._secret=r(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=r(e.pub)}return n.fromPublic=function(t,e){return e instanceof n?e:new n(t,{pub:e})},n.fromSecret=function(t,e){return e instanceof n?e:new n(t,{secret:e})},n.prototype.secret=function(){return this._secret},i(n,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(n,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(n,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),i(n,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(n,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(n,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),n.prototype.sign=function(t){return e(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},n.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},n.prototype.getSecret=function(r){return e(this._secret,"KeyPair is public only"),t.encode(this.secret(),r)},n.prototype.getPublic=function(e){return t.encode(this.pubBytes(),e)},Rr=n}(),s=function(){if(zr)return Pr;zr=1;var t=me(),e=Ie(),r=e.assert,i=e.cachedProperty,n=e.parseBytes;function a(e,i){this.eddsa=e,"object"!=typeof i&&(i=n(i)),Array.isArray(i)&&(r(i.length===2*e.encodingLength,"Signature has invalid size"),i={R:i.slice(0,e.encodingLength),S:i.slice(e.encodingLength)}),r(i.R&&i.S,"Signature without R or S"),e.isPoint(i.R)&&(this._R=i.R),i.S instanceof t&&(this._S=i.S),this._Rencoded=Array.isArray(i.R)?i.R:i.Rencoded,this._Sencoded=Array.isArray(i.S)?i.S:i.Sencoded}return i(a,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),i(a,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),i(a,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),i(a,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),a.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},a.prototype.toHex=function(){return e.encode(this.toBytes(),"hex").toUpperCase()},Pr=a}();function o(r){if(i("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof o))return new o(r);r=e[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=t.sha512}return Br=o,o.prototype.sign=function(t,e){t=n(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),a=this.g.mul(i),s=this.encodePoint(a),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),f=i.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:f,Rencoded:s})},o.prototype.verify=function(t,e,r){if(t=n(t),(e=this.makeSignature(e)).S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var i=this.keyFromPublic(r),a=this.hashInt(e.Rencoded(),i.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(i.pub().mul(a)).eq(s)},o.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return r.intFromLE(t.digest()).umod(this.curve.n)},o.prototype.keyFromPublic=function(t){return a.fromPublic(this,t)},o.prototype.keyFromSecret=function(t){return a.fromSecret(this,t)},o.prototype.makeSignature=function(t){return t instanceof s?t:new s(this,t)},o.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},o.prototype.decodePoint=function(t){var e=(t=r.parseBytes(t)).length-1,i=t.slice(0,e).concat(-129&t[e]),n=!!(128&t[e]),a=r.intFromLE(i);return this.curve.pointFromY(a,n)},o.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},o.prototype.decodeInt=function(t){return r.intFromLE(t)},o.prototype.isPoint=function(t){return t instanceof this.pointClass},Br}var Lr=(Dr||(Dr=1,function(t){var e=t;e.version=be,e.utils=Ie(),e.rand=ce(),e.curve=Le(),e.curves=Nr(),e.ec=Or(),e.eddsa=Fr()}(pe)),pe);(()=>{try{if(le&&le.Rand&&!le.Rand.prototype._miniProgramPatched){const t=le.Rand.prototype._rand;le.Rand.prototype._rand=function(e){if(this.rand&&this.rand.getBytes)try{return t.call(this,e)}catch(t){}try{if(oe&&se.lib&&se.lib.WordArray){const t=se.lib.WordArray.random(e),r=new Uint8Array(e);for(let i=0;i<e;i++){const e=Math.floor(i/4),n=i%4,a=t.words[e]||0;r[i]=a>>>24-8*n&255}return console.log("[elliptic-patched] Using crypto-js for secure random generation"),r}}catch(t){console.warn("[elliptic-patched] crypto-js random generation failed:",t)}const r=new Uint8Array(e);for(let t=0;t<r.length;t++)r[t]=Math.floor(256*Math.random());return console.log("[elliptic-patched] Using Math.random as fallback"),r},le.Rand.prototype._miniProgramPatched=!0,console.log("[elliptic-patched] brorand successfully patched for miniprogram with crypto-js support")}}catch(t){console.warn("[elliptic-patched] Failed to patch brorand:",t)}})();class Ur{constructor(){this.currentRegion=a}}const jr=t=>{};class $r extends Ur{constructor(){super(...arguments),this.captchaAppId="",this.securityKitComponent=null}setCaptchaComponent(t){this.securityKitComponent=t}challenge(t){return e(this,arguments,void 0,function*(t,e={}){const r=t||this.captchaAppId;if(!l(r)||!r)throw new o("The CaptCha appId is required.","CAPTCHA_APP_ID_REQUIRED");if(this.captchaAppId=r,this.currentRegion=e.region||this.currentRegion,!this.securityKitComponent)throw new o("Security kit component instance is not set","CAPTCHA_COMPONENT_NOT_SET");if("function"!=typeof this.securityKitComponent.showCaptcha)throw new o("Invalid security kit component: missing showCaptcha method","INVALID_CAPTCHA_COMPONENT");try{d.info("Starting captcha challenge with appId:",r);const t=yield this.securityKitComponent.showCaptcha({appId:r});return d.info("Captcha challenge completed",t),{Ticket:t.ticket,RandStr:t.randstr}}catch(t){const e=t instanceof Error?t.message:"Unknown captcha error",r=new o(e,"CAPTCHA_CHALLENGE_FAILED",t);throw d.error("Captcha challenge failed:",r),r}})}}class Wr extends Ur{constructor(){super(...arguments),this.channelId="",this.turingSDK=null,this.pageInstance=null}setPageInstance(t){this.pageInstance=t,d.info("[RCE] pageInstance set:",t?"exists":"null")}setTuringSDK(t){if(!t)throw new o("turingSDK instance is required. Please check your configuration.","TURING_SDK_REQUIRED");if("function"!=typeof t.init)throw new o('Invalid turingSDK instance: missing "init" method. Please check your turingSDK configuration.',"TURING_SDK_MISSING_INIT");if("function"!=typeof t.getDeviceTokenV3)throw new o('Invalid turingSDK instance: missing "getDeviceTokenV3" method. Please check your turingSDK configuration.',"TURING_SDK_MISSING_GET_DEVICE_TOKEN");d.info("turingSDK instance validated and set successfully"),this.turingSDK=t}challenge(t){return e(this,arguments,void 0,function*(t,e={}){const r=t||this.channelId;if(!r)throw new o("The RCE channelId is required.","RCE_CHANNEL_ID_REQUIRED");if(this.channelId=r,this.currentRegion=e.region||this.currentRegion,!this.turingSDK)throw new o('turingSDK is required for RCE challenge. Please pass rceTuringSDK property to security-kit component. Example: <security-kit rceTuringSDK="{{turingSDK}}" />',"TURING_SDK_NOT_SET");try{d.info("Starting RCE challenge via turingSDK"),yield new Promise((t,e)=>{this.turingSDK.init({channel:r},i=>{if(0===i.ret)d.info("[turingSDK.init] RCE SDK initialized successfully with channel:",r,i),t(!0);else{d.error("RCE SDK init failed:",i);const t=new o(`RCE SDK init failed: ${i.err||"Unknown error"}`,"RCE_INIT_ERROR",i);jr(t),e(t)}})});const t={};this.pageInstance?(t.page=this.pageInstance,d.info("[RCE] getDeviceTokenV3 with page/component instance")):d.warn("[RCE] getDeviceTokenV3 without page instance - this may cause Canvas lookup failure");const e=yield new Promise((e,r)=>{this.turingSDK.getDeviceTokenV3(t=>{if(t&&0===t.ret)d.info("[turingSDK.getDeviceTokenV3] RCE device token obtained successfully",t),e(t);else{d.error("Failed to get device token:",t);const e=new o("Failed to get device token","RCE_GET_TOKEN_ERROR",t);jr(e),r(e)}},!1,t)});return d.info("RCE challenge completed successfully"),{Ticket:e.deviceToken||e.token||"",Seq:e.seq||""}}catch(t){const e=t instanceof Error?t.message:"Unknown RCE error";d.error("RCE challenge failed:",t);throw new o(`RCE challenge failed: ${e}`,"RCE_CHALLENGE_FAILED",t)}})}}var Vr;!function(t){t.CAPTCHA="TC-CAPTCHA",t.RCE="TC-RCE"}(Vr||(Vr={}));class Gr{constructor(t,e,r,i,n){this.cryptoInstance=null,this.channelInstance=null,this.fallbackTokenInstance=null,this.captchaChallengeInstance=null,this.rceChallengeInstance=null,this.attestInfos=[],this.initAttesterManager=new w,this.fallbackTokenInstance=r,this.cryptoInstance=t,this.channelInstance=e,this.apiRequest=i,this.instanceId=n,this.captchaChallengeInstance=new $r,this.rceChallengeInstance=new Wr}setCaptchaComponent(t){this.captchaChallengeInstance.setCaptchaComponent(t)}setTuringSDK(t){this.rceChallengeInstance.setTuringSDK(t)}setPageInstance(t){this.rceChallengeInstance.setPageInstance(t)}challenge(t){return e(this,void 0,void 0,function*(){try{if(!t)throw new o("The attestId is required.","ATTEST_ID_REQUIRED");yield m(()=>this.initAttester(),{shouldRetryOnSuccess:e=>!e.find(e=>e.AttestId===t)&&(this.initAttesterManager.reset(),!0),maxRetries:1}),d.info("The challenge is starting...");const e=function(t,e=0){const r=Math.min(e+1,t.length),i=t.slice(0,r).padEnd(r,"_");let n=0;for(let e=r;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return n=n<<7|n>>>25,n>>>=0,`${i}${n.toString(16)}`}(`${this.instanceId}_${t}`),r=yield Gr.globalChallengeQueue.addTask(()=>m(()=>{const e=this.attestInfos.find(e=>e.AttestId===t);if(!e)throw new o(`The attestId '${t}' could not be found in the configuration.`,"ATTEST_ID_NOT_FOUND");const r=e.AttestType;switch(r){case Vr.CAPTCHA:return this.captchaChallenge(e);case Vr.RCE:return this.rceChallenge(e);default:{const t=Object.keys(Vr).map(t=>Vr[t]).join(", ");throw new o(`Unsupported challenge type: ${r}. Only [${t}] are supported.`,"UNSUPPORTED_CHALLENGE_TYPE")}}},{shouldRetryOnError:this.shouldRetryOnAttesterChanged.bind(this,t),maxRetries:1}),e);return d.info("The challenge is success!"),r}catch(e){d.info("The challenge is failed!");const r=`There was an error in the challenge: ${(null==e?void 0:e.message)||"Unknown error."}`,i=new o(r,"CHALLENGE_FAILED",e);return yield this.processErrorWithFallback(i,(null==e?void 0:e.code)||(null==i?void 0:i.code),{AttestId:t})}})}captchaChallenge(t){return e(this,void 0,void 0,function*(){try{if(!t.CaptchaAppId)throw new o("The CaptchaAppId is required.","CAPTCHA_CHALLENGE_INVALID_PARAM");const e=yield this.captchaChallengeInstance.challenge(t.CaptchaAppId);d.info("Captcha challenge succeeded:",e);return yield this.genToken({ticket:e.Ticket,attestId:t.AttestId,randStr:e.RandStr})}catch(e){if((null==e?void 0:e.code)===i)throw e;const r=`The Captcha challenge failed: ${(null==e?void 0:e.message)||"Unknown error."}`,n=new o(r,"CAPTCHA_CHALLENGE_FAILED",e);return yield this.processErrorWithFallback(n,(null==e?void 0:e.code)||(null==n?void 0:n.code),t)}})}rceChallenge(t){return e(this,void 0,void 0,function*(){try{if(!t.RceChannelId)throw new o("The RCE channelId is required.","RCE_CHALLENGE_INVALID_PARAM");const e=yield this.rceChallengeInstance.challenge(t.RceChannelId);d.info("RCE challenge succeeded:",e);return yield this.genToken({ticket:e.Ticket,attestId:t.AttestId})}catch(e){if((null==e?void 0:e.code)===i)throw e;const r=`The RCE challenge failed: ${(null==e?void 0:e.message)||"Unknown error."}`,n=new o(r,"RCE_CHALLENGE_FAILED",e);return yield this.processErrorWithFallback(n,(null==e?void 0:e.code)||(null==n?void 0:n.code),t)}})}genToken(t){return e(this,void 0,void 0,function*(){const{ticket:r,attestId:n,randStr:a=""}=t;try{if(!r)throw new o("The ticket is required.","GEN_TOKEN_INVALID_PARAM");const t=yield m(()=>e(this,void 0,void 0,function*(){var t;const e=yield this.cryptoInstance.encryptByAES(r);return yield this.apiRequest.apiRequest("RedeemToken",{Platform:"WeixinMP",OS:"wxmp",Ticket:{Data:e,RandStr:a},Key:null===(t=this.channelInstance.getChannelInfo())||void 0===t?void 0:t.SessionKey,AttestId:n})}),{shouldRetryOnError:this.shouldRetryOnSessionKeyExpired.bind(this)});if(!(null==t?void 0:t.Data))throw new o("Missing Data in response.","GEN_TOKEN_FAILED");return yield this.cryptoInstance.decryptByAES(t.Data)}catch(t){if((null==t?void 0:t.code)===i)throw t;const e=`Generate token failed: ${(null==t?void 0:t.message)||"Unknown error."}`,r=new o(e,"GEN_TOKEN_FAILED",t);return yield this.processErrorWithFallback(r,(null==t?void 0:t.code)||(null==r?void 0:r.code),{AttestId:n})}})}processErrorWithFallback(t,r,i){return e(this,void 0,void 0,function*(){d.error(t);return yield this.fallbackTokenInstance.generateFallbackToken({attestId:i.AttestId,errorCode:r})})}setAttesterInfos(t=[]){this.attestInfos=t}initAttester(){return e(this,void 0,void 0,function*(){return this.initAttesterManager.execute({initFn:()=>e(this,void 0,void 0,function*(){var t,e;(null===(t=this.channelInstance.getChannelInfo())||void 0===t?void 0:t.SessionKey)||(yield this.channelInstance.connectChannel());const r=yield m(()=>{var t;return this.apiRequest.apiRequest("InitializeAttester",{Key:null===(t=this.channelInstance.getChannelInfo())||void 0===t?void 0:t.SessionKey,Scope:"cn"})},{shouldRetryOnError:this.shouldRetryOnSessionKeyExpired.bind(this)});if(!(null==r?void 0:r.Data)){const t=new o("Missing Data in response.","INIT_ATTESTER_MISSING_DATA",r);throw d.error(t),t}const i=yield this.cryptoInstance.decryptByAES(r.Data),n=null===(e=null==i?void 0:i.split(";"))||void 0===e?void 0:e.filter(t=>!!t);if(!n||0===n.length){const t=new o("The Data in response is invalid.","INIT_ATTESTER_INVALID_DATA",r);throw d.error(t),t}const a=n.map(t=>{const[e,r,i,n,a]=t.split(",");if(!e||!r||!i&&!n)return null;return{AttestId:e,AttestType:r,CaptchaAppId:i,RceChannelId:n,default:a}}).filter(t=>!!t);return d.info("Attester info:",a),this.setAttesterInfos(a),a}),getInitializedValue:()=>Promise.resolve(this.attestInfos)})})}shouldRetryOnSessionKeyExpired(t){return e(this,void 0,void 0,function*(){try{if((null==t?void 0:t.code)===r)this.cryptoInstance.changeSuit(),yield this.channelInstance.connectChannel(!0);else if((null==t?void 0:t.code)===i)return!1;return!0}catch(t){return!1}})}shouldRetryOnAttesterChanged(t,r){return e(this,void 0,void 0,function*(){try{if((null==r?void 0:r.code)!==i)return!1;const e=null==r?void 0:r.message,n=yield this.cryptoInstance.decryptByAES(e).catch(()=>"");let a=!1;const s=[...this.attestInfos];if(l(n)&&n.length>0){const e=s.find(e=>e.AttestId===t);(null==e?void 0:e.AttestType)===Vr.CAPTCHA?(e.CaptchaAppId=n,a=!0):(null==e?void 0:e.AttestType)===Vr.RCE&&(e.RceChannelId=n,a=!0)}return a?this.setAttesterInfos(s):(this.initAttesterManager.reset(),yield this.initAttester()),!0}catch(t){return!1}})}}Gr.globalChallengeQueue=S.getInstance();class Xr{constructor(t,e){this.channelInfo={},this.cryptoInstance=null,this.channelAsyncInitializer=new w,this.cryptoInstance=t,this.apiRequest=e,this.connectChannel().catch(t=>{d.error(t)})}getChannelInfo(){return this.channelAsyncInitializer.isSuccess?this.channelInfo:null}setChannelInfo(t={}){this.channelInfo=Object.assign(Object.assign({},this.channelInfo),t)}resetChannelInfo(){this.channelInfo={}}connectChannel(t=!1){return t&&(this.channelAsyncInitializer.reset(),this.resetChannelInfo()),this.channelAsyncInitializer.execute({initFn:()=>e(this,void 0,void 0,function*(){d.info("The channel begin connecting..."),yield m(()=>this.connect()),d.info("The channel connect success!")}),getInitializedValue:()=>Promise.resolve(),onError:t=>{const e=t instanceof Error?t.message:"The channel connection failed.";return new o(e,"CHANNEL_CONNECT_ERROR",t)}})}connect(){return e(this,void 0,void 0,function*(){const t=yield this.establishShareKey(),{KDFKey:e,ServerPubKey:r,SessionKey:i}=t;this.setChannelInfo({SessionKey:i}),yield this.cryptoInstance.genAESSharedKey(e,r)})}establishShareKey(){return e(this,void 0,void 0,function*(){const t=this.cryptoInstance.getKDFSuit(),e=yield this.cryptoInstance.getMyECDHPublicKey(),r=this.cryptoInstance.getAESCryptoType(),i=yield this.apiRequest.apiRequest("EstablishShareKey",{Key:`${t};${e};${r}`});if(!(null==i?void 0:i.Key)){throw new o("EstablishShareKey failed: Missing Key in response.","ESTABLISH_SHARE_KEY_FAILED")}const[n="",a="",s=""]=i.Key.split(";");if(!n||!a||!s){throw new o("EstablishShareKey failed: The Key in response is invalid.","ESTABLISH_SHARE_KEY_FAILED")}return{KDFKey:n,ServerPubKey:a,SessionKey:s}})}}class Yr{constructor(){this.myPublicKey="",this.theirPublicKey="",this.originShareKey="",this.ecdhAsyncInitializer=new w}init(){return this.ecdhAsyncInitializer.execute({initFn:()=>e(this,void 0,void 0,function*(){this.ec=new Lr.ec("p256"),this.myKeyPair=this.ec.genKeyPair();const t=g(this.myKeyPair.getPublic("hex"));this.myPublicKey=v.encode(t)}),getInitializedValue:()=>Promise.resolve()})}checkInit(){return this.init()}getMyPublicKey(){return e(this,void 0,void 0,function*(){return yield this.checkInit(),this.myPublicKey})}getTheirPublicKey(){return e(this,void 0,void 0,function*(){return yield this.checkInit(),this.theirPublicKey})}genOriginSharedKey(t){return e(this,void 0,void 0,function*(){try{yield this.checkInit(),this.theirPublicKey=t;const e=this.ec.keyFromPublic(v.decode(this.theirPublicKey)).getPublic(),r=g(this.myKeyPair.derive(e).toString("hex",64)),i=v.encode(r);return this.originShareKey=i,this.originShareKey}catch(t){const e=t instanceof Error?t.message:"ECDHClass.getOriginSharedKey error";throw new o(e,"ECDH_GEN_ORIGIN_SHARED_KEY_ERROR",t)}})}}class Zr{}class Jr extends Zr{constructor(){super(...arguments),this.salt="",this.password="",this.iterations=1e4,this.keyLength=16,this.digest="SHA-256"}setConfig(t,e){this.salt=t,this.password=e}uint8ArrayToWordArray(t){const e=[];for(let r=0;r<t.length;r+=4){let i=0;for(let e=0;e<4&&r+e<t.length;e++)i=i<<8|t[r+e];e.push(i)}return se.lib.WordArray.create(e,t.length)}wordArrayToUint8Array(t){const e=t.words,r=t.sigBytes,i=new Uint8Array(r);for(let t=0;t<r;t++){const r=Math.floor(t/4),n=t%4;i[t]=e[r]>>>24-8*n&255}return i}pbkdf2CryptoJS(t,r,i,n,a){return e(this,void 0,void 0,function*(){try{const e=this.uint8ArrayToWordArray(t),s=this.uint8ArrayToWordArray(r);let o;switch(a){case"SHA3-512":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:64});break;case"SHA3-384":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:48});break;case"SHA3-256":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:32});break;case"SHA3-224":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:28});break;case"SHA-512":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA512});break;case"SHA-384":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA384});break;case"SHA-1":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA1});break;case"MD5":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.MD5});break;default:o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA256})}return this.wordArrayToUint8Array(o)}catch(t){throw console.error("crypto-js PBKDF2 error:",t),t}})}genKey(){return e(this,void 0,void 0,function*(){try{const t=y(this.salt),e=v.decode(this.password),r=yield m(()=>this.pbkdf2CryptoJS(e,t,this.iterations,this.keyLength,this.digest));return v.encode(r)}catch(t){const e="The PBKdf2 genKey error.";return Promise.reject(new o(e,"PBKDF2_GEN_KEY_ERROR",t))}})}}class Qr extends Zr{constructor(){super(...arguments),this.salt="",this.password="",this.keyLength=16,this.digest="SHA-256",this.info=""}setConfig(t,e){this.salt=t,this.password=e}uint8ArrayToWordArray(t){const e=[];for(let r=0;r<t.length;r+=4){let i=0;for(let e=0;e<4&&r+e<t.length;e++)i=i<<8|t[r+e];e.push(i)}return se.lib.WordArray.create(e,t.length)}wordArrayToUint8Array(t){const e=t.words,r=t.sigBytes,i=new Uint8Array(r);for(let t=0;t<r;t++){const r=Math.floor(t/4),n=t%4;i[t]=e[r]>>>24-8*n&255}return i}getHashLength(t){switch(t){case"SHA3-512":case"SHA-512":return 64;case"SHA3-384":case"SHA-384":return 48;case"SHA3-256":case"SHA-256":default:return 32;case"SHA3-224":return 28;case"SHA-1":return 20;case"MD5":return 16}}hkdfExtract(t,e,r){const i=0===t.sigBytes?se.lib.WordArray.create(new Array(this.getHashLength(r)/4).fill(0),this.getHashLength(r)):t;return this.getHmacFunction(r)(e,i)}getHmacFunction(t){switch(t){case"SHA3-512":case"SHA3-384":case"SHA3-256":case"SHA3-224":case"SHA-256":default:return se.HmacSHA256;case"SHA-512":return se.HmacSHA512;case"SHA-384":return se.HmacSHA384;case"SHA-1":return se.HmacSHA1;case"MD5":return se.HmacMD5}}hkdfExpand(t,e,r,i){const n=this.getHashLength(i),a=Math.ceil(r/n),s=this.getHmacFunction(i);if(a>255)throw new Error("HKDF: requested length too large");let o=se.lib.WordArray.create([]),f=se.lib.WordArray.create([]);for(let r=1;r<=a;r++){const i=o.clone().concat(e).concat(se.lib.WordArray.create([r<<24],1));o=s(i,t),f=f.concat(o)}return f.sigBytes=r,f}hkdfCryptoJS(t,r,i,n,a){return e(this,void 0,void 0,function*(){try{const e=this.uint8ArrayToWordArray(t),s=this.uint8ArrayToWordArray(r),o=this.uint8ArrayToWordArray(i),f=this.hkdfExtract(s,e,a),c=this.hkdfExpand(f,o,n,a);return this.wordArrayToUint8Array(c)}catch(t){throw console.error("crypto-js HKDF error:",t),t}})}genKey(){return e(this,void 0,void 0,function*(){try{const t=y(this.salt),e=v.decode(this.password),r=y(this.info),i=yield m(()=>this.hkdfCryptoJS(e,t,r,this.keyLength,this.digest));return v.encode(i)}catch(t){const e="The HKDF genKey error.";return Promise.reject(new o(e,"HKDF_GEN_KEY_ERROR",t))}})}}class ti{constructor(){this.suitSalt="",this.ECDHKey="",this.lastKey="",this.suit=1,this.PBKdf2Instance=new Jr,this.HKdfInstance=new Qr}changeSuit(){const t=this.getSuit(),e=function(t){if(0===t.length)throw new Error("The Array cannot be empty.");return t[Math.floor(Math.random()*t.length)]}([2,1].filter(e=>e!==t));e&&this.setSuit(e)}setSuit(t){this.suit!==t&&(this.lastKey=""),this.suit=t}getSuit(){return Number(this.suit)}setECDHKey(t){this.ECDHKey=t}getECDHKey(){return this.ECDHKey}setSalt(t){this.suitSalt=t}getSalt(){return this.suitSalt}getInstance(){switch(this.suit){case 1:return this.PBKdf2Instance;case 2:return this.HKdfInstance;default:throw new o("Unknown KDF suite.","KDF_SUIT_ERROR")}}genKey(t,r){return e(this,void 0,void 0,function*(){try{if(this.lastKey)return this.lastKey;this.setECDHKey(r),this.setSalt(t);const e=this.getInstance();e.setConfig(this.suitSalt,this.ECDHKey);const i=yield e.genKey();return this.lastKey=i,i}catch(t){const e=t instanceof Error?t.message:"KDFSuit.genKey error. Please check the log.",r=new o(e,"KDF_GEN_KEY_ERROR",t);throw d.error(r),r}})}}class ei{}var ri,ii={exports:{}};var ni,ai=(ri||(ri=1,ni=ii,function(){function t(t){return parseInt(t)===t}function e(e){if(!t(e.length))return!1;for(var r=0;r<e.length;r++)if(!t(e[r])||e[r]<0||e[r]>255)return!1;return!0}function r(r,i){if(r.buffer&&"Uint8Array"===r.name)return i&&(r=r.slice?r.slice():Array.prototype.slice.call(r)),r;if(Array.isArray(r)){if(!e(r))throw new Error("Array contains invalid value: "+r);return new Uint8Array(r)}if(t(r.length)&&e(r))return new Uint8Array(r);throw new Error("unsupported array-like object")}function i(t){return new Uint8Array(t)}function n(t,e,r,i,n){null==i&&null==n||(t=t.slice?t.slice(i,n):Array.prototype.slice.call(t,i,n)),e.set(t,r)}var a,s={toBytes:function(t){var e=[],i=0;for(t=encodeURI(t);i<t.length;){var n=t.charCodeAt(i++);37===n?(e.push(parseInt(t.substr(i,2),16)),i+=2):e.push(n)}return r(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var i=t[r];i<128?(e.push(String.fromCharCode(i)),r++):i>191&&i<224?(e.push(String.fromCharCode((31&i)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&i)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},o=(a="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var i=t[r];e.push(a[(240&i)>>4]+a[15&i])}return e.join("")}}),f={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],u=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],l=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],p=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],v=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],m=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],_=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],S=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],M=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function A(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var I=function(t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:r(t,!0)}),this._prepare()};I.prototype._prepare=function(){var t=f[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,i=4*(t+1),n=this.key.length/4,a=A(this.key);for(e=0;e<n;e++)r=e>>2,this._Ke[r][e%4]=a[e],this._Kd[t-r][e%4]=a[e];for(var s,o=0,d=n;d<i;){if(s=a[n-1],a[0]^=h[s>>16&255]<<24^h[s>>8&255]<<16^h[255&s]<<8^h[s>>24&255]^c[o]<<24,o+=1,8!=n)for(e=1;e<n;e++)a[e]^=a[e-1];else{for(e=1;e<n/2;e++)a[e]^=a[e-1];for(s=a[n/2-1],a[n/2]^=h[255&s]^h[s>>8&255]<<8^h[s>>16&255]<<16^h[s>>24&255]<<24,e=n/2+1;e<n;e++)a[e]^=a[e-1]}for(e=0;e<n&&d<i;)u=d>>2,l=d%4,this._Ke[u][l]=a[e],this._Kd[t-u][l]=a[e++],d++}for(var u=1;u<t;u++)for(var l=0;l<4;l++)s=this._Kd[u][l],this._Kd[u][l]=w[s>>24&255]^_[s>>16&255]^S[s>>8&255]^M[255&s]},I.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=A(t),a=0;a<4;a++)n[a]^=this._Ke[0][a];for(var s=1;s<e;s++){for(a=0;a<4;a++)r[a]=u[n[a]>>24&255]^l[n[(a+1)%4]>>16&255]^p[n[(a+2)%4]>>8&255]^b[255&n[(a+3)%4]]^this._Ke[s][a];n=r.slice()}var o,f=i(16);for(a=0;a<4;a++)o=this._Ke[e][a],f[4*a]=255&(h[n[a]>>24&255]^o>>24),f[4*a+1]=255&(h[n[(a+1)%4]>>16&255]^o>>16),f[4*a+2]=255&(h[n[(a+2)%4]>>8&255]^o>>8),f[4*a+3]=255&(h[255&n[(a+3)%4]]^o);return f},I.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=A(t),a=0;a<4;a++)n[a]^=this._Kd[0][a];for(var s=1;s<e;s++){for(a=0;a<4;a++)r[a]=g[n[a]>>24&255]^y[n[(a+3)%4]>>16&255]^v[n[(a+2)%4]>>8&255]^m[255&n[(a+1)%4]]^this._Kd[s][a];n=r.slice()}var o,f=i(16);for(a=0;a<4;a++)o=this._Kd[e][a],f[4*a]=255&(d[n[a]>>24&255]^o>>24),f[4*a+1]=255&(d[n[(a+3)%4]>>16&255]^o>>16),f[4*a+2]=255&(d[n[(a+2)%4]>>8&255]^o>>8),f[4*a+3]=255&(d[255&n[(a+1)%4]]^o);return f};var x=function(t){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new I(t)};x.prototype.encrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16)n(t,a,0,s,s+16),n(a=this._aes.encrypt(a),e,s);return e},x.prototype.decrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16)n(t,a,0,s,s+16),n(a=this._aes.decrypt(a),e,s);return e};var E=function(t,e){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=i(16);this._lastCipherblock=r(e,!0),this._aes=new I(t)};E.prototype.encrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16){n(t,a,0,s,s+16);for(var o=0;o<16;o++)a[o]^=this._lastCipherblock[o];this._lastCipherblock=this._aes.encrypt(a),n(this._lastCipherblock,e,s)}return e},E.prototype.decrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16){n(t,a,0,s,s+16),a=this._aes.decrypt(a);for(var o=0;o<16;o++)e[s+o]=a[o]^this._lastCipherblock[o];n(t,this._lastCipherblock,0,s,s+16)}return e};var k=function(t,e,n){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 size)")}else e=i(16);n||(n=1),this.segmentSize=n,this._shiftRegister=r(e,!0),this._aes=new I(t)};k.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,i=r(t,!0),a=0;a<i.length;a+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var s=0;s<this.segmentSize;s++)i[a+s]^=e[s];n(this._shiftRegister,this._shiftRegister,0,this.segmentSize),n(i,this._shiftRegister,16-this.segmentSize,a,a+this.segmentSize)}return i},k.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,i=r(t,!0),a=0;a<i.length;a+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var s=0;s<this.segmentSize;s++)i[a+s]^=e[s];n(this._shiftRegister,this._shiftRegister,0,this.segmentSize),n(t,this._shiftRegister,16-this.segmentSize,a,a+this.segmentSize)}return i};var C=function(t,e){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=i(16);this._lastPrecipher=r(e,!0),this._lastPrecipherIndex=16,this._aes=new I(t)};C.prototype.encrypt=function(t){for(var e=r(t,!0),i=0;i<e.length;i++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[i]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},C.prototype.decrypt=C.prototype.encrypt;var R=function(t){if(!(this instanceof R))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=i(16),this.setValue(t)):this.setBytes(t)};R.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");if(t>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var e=15;e>=0;--e)this._counter[e]=t%256,t=parseInt(t/256)},R.prototype.setBytes=function(t){if(16!=(t=r(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},R.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var T=function(t,e){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof R||(e=new R(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new I(t)};T.prototype.encrypt=function(t){for(var e=r(t,!0),i=0;i<e.length;i++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[i]^=this._remainingCounter[this._remainingCounterIndex++];return e},T.prototype.decrypt=T.prototype.encrypt;var P={AES:I,Counter:R,ModeOfOperation:{ecb:x,cbc:E,cfb:k,ofb:C,ctr:T},utils:{hex:o,utf8:s},padding:{pkcs7:{pad:function(t){var e=16-(t=r(t,!0)).length%16,a=i(t.length+e);n(t,a);for(var s=t.length;s<a.length;s++)a[s]=e;return a},strip:function(t){if((t=r(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var a=t.length-e,s=0;s<e;s++)if(t[a+s]!==e)throw new Error("PKCS#7 invalid padding byte");var o=i(a);return n(t,o,0,0,a),o}}},_arrayTest:{coerceArray:r,createArray:i,copyArray:n}};ni.exports=P}()),ii.exports),si=E(ai);class oi extends ei{genIV(){try{if(void 0!==oe&&se.lib&&se.lib.WordArray){const t=se.lib.WordArray.random(16).words,e=new Uint8Array(16);for(let r=0;r<4;r++){const i=t[r];e[4*r]=i>>>24&255,e[4*r+1]=i>>>16&255,e[4*r+2]=i>>>8&255,e[4*r+3]=255&i}return e}}catch(t){console.warn("crypto-js IV generation failed, fallback to native crypto API:",t)}console.warn("Using Math.random for IV generation - not suitable for production");const t=new Uint8Array(16);for(let e=0;e<16;e++)t[e]=Math.floor(256*Math.random());return t}encrypt(t,r){return e(this,void 0,void 0,function*(){try{const e=this.genIV(),i=si.utils.utf8.toBytes(t),n=si.padding.pkcs7.pad(i),a=v.decode(r),s=new si.ModeOfOperation.cbc(a,e).encrypt(n),o=new Uint8Array(e.length+s.length);return o.set(e,0),o.set(s,e.length),v.encode(o)}catch(t){throw new o("AES CBC encryption failed","AES_CBC_ENCRYPT_ERROR",t)}})}decrypt(t,r){return e(this,void 0,void 0,function*(){try{const e=v.decode(r),i=v.decode(t),n=i.slice(0,16),a=i.slice(16),s=new si.ModeOfOperation.cbc(e,n).decrypt(a),o=si.padding.pkcs7.strip(s);return si.utils.utf8.fromBytes(o)}catch(t){throw new o("AES CBC decryption failed","AES_CBC_DECRYPT_ERROR",t)}})}}class fi{constructor(){this.aesType=2,this.cbcInstance=null,this.cbcInstance=new oi}getAESCryptoType(){return this.aesType}getInstance(){if(2===this.getAESCryptoType())return this.cbcInstance;throw new o("The AES type is invalid.","AES_TYPE_INVALID")}encrypt(t,e){if(!e)throw new o("The AES encryption key cannot be empty.","AES_ENCRYPT_ERROR");return this.getInstance().encrypt(t,e)}decrypt(t,e){if(!e)throw new o("The AES decryption key cannot be empty.","AES_DECRYPT_ERROR");return this.getInstance().decrypt(t,e)}}class ci{constructor(){this.originShareKey="",this.aesShareKey="",this.ECDHInstance=new Yr,this.KDFSuitInstance=new ti,this.AESInstance=new fi}changeSuit(){this.KDFSuitInstance.changeSuit()}getMyECDHPublicKey(){return this.ECDHInstance.getMyPublicKey()}getKDFSuit(){return this.KDFSuitInstance.getSuit()}getAESCryptoType(){return this.AESInstance.getAESCryptoType()}genOriginKeyByECDH(t){return e(this,void 0,void 0,function*(){let e=t;if(e||(e=yield this.ECDHInstance.getTheirPublicKey()),!e)throw new o("The PublicKey is required.","ECDH_PUBLIC_KEY_REQUIRED");try{return yield this.ECDHInstance.genOriginSharedKey(e)}catch(t){throw new o("The ECDH origin key gen failed.","ECDH_ORIGIN_KEY_GEN_FAILED",t)}})}genAESKeyByKDF(t){return e(this,void 0,void 0,function*(){if(!(t||this.KDFSuitInstance.getSalt()))throw new o("The KDFSalt is required.","KDF_SALT_REQUIRED");try{return yield this.KDFSuitInstance.genKey(t,this.originShareKey)}catch(t){throw new o("Failed to derive the AES shared key using the KDF suite.","DERIVE_AESSHAREKEY_BYKDF_FAILED",t)}})}genAESSharedKey(t,r){return e(this,void 0,void 0,function*(){try{return this.originShareKey=yield this.genOriginKeyByECDH(r),this.aesShareKey=yield this.genAESKeyByKDF(t),this.aesShareKey}catch(t){throw new o("The AESShareKey gen failed.","AES_SHARED_KEY_GEN_FAILED",t)}})}encryptByAES(t){return e(this,void 0,void 0,function*(){if(!this.aesShareKey)throw new o("The AESKey is not exists. Please call genAESSharedKey() first.","AES_KEY_NOT_EXISTS");try{return yield this.AESInstance.encrypt(t,this.aesShareKey)}catch(t){throw new o("The AES encrypt failed.","AES_ENCRYPT_FAILED",t)}})}decryptByAES(t){return e(this,void 0,void 0,function*(){if(!this.aesShareKey)throw new o("The AESKey is not exists. Please call genAESSharedKey() first.","AES_KEY_NOT_EXISTS");try{return yield this.AESInstance.decrypt(t,this.aesShareKey)}catch(t){throw new o("The AES decrypt failed.","AES_DECRYPT_FAILED",t)}})}}class hi{constructor(){this.prefix="s",this.platform="WeixinMP",this.version=1,this.AESInstance=new fi}generateNonce(){try{return se.lib.WordArray.random(16).toString(se.enc.Base64)}catch(t){d.error("Failed to generate nonce with crypto-js, using fallback method:",t);const e=new Uint8Array(16);for(let t=0;t<16;t++)e[t]=Math.floor(256*Math.random());return v.encode(e)}}generateAesKey(t){const e=y(t.replace(/^attest-/,"")),r=new Uint8Array(16);return r.fill(0),r.set(e.subarray(0,16),0),v.encode(r)}generateFallbackToken(){return e(this,arguments,void 0,function*(t={}){try{let{attestId:e,errorCode:r}=t;if(!e||!n.test(e))return"";r||(r="MPSDK_UNKNOWN_ERROR"),d.info("Starting to generate fallback token...");const i=this.generateAesKey(e),a=parseInt(String((new Date).getTime()/1e3)),s=this.generateNonce(),o=`${this.version},${e},${this.platform},${r},${a},${s}`,f=yield this.AESInstance.encrypt(o,i);return d.info("Fallback token generated successfully..."),`${this.prefix}${this.AESInstance.getAESCryptoType()}${f}`}catch(t){const e=new o(`Generate fallback token failed: ${t instanceof Error?t.message:"Unknown error."}`,"SDK_FALLBACK_TOKEN_GENERATE_FAILED",t);return d.error(e),""}})}}const di="AttesterTokenCaches";let ui=0;class li{constructor(){this.attesterTokens=[],this.turingSDK=null,this.captchaComponent=null,this.pageInstance=null,this.domain="",this.protocol="https",this.instanceId=`instance_${++ui}_${Date.now()}`,d.info(`[${this.instanceId}] Creating new EOClientSecurityKit instance`),this.instanceStorage=new x(`eo_kit_${this.instanceId}_`),d.info(`[${this.instanceId}] Instance storage created with isolated namespace`),this.apiRequest=new I(this.instanceId),d.info(`[${this.instanceId}] API request instance created`),this.fallbackTokenInstance=new hi,this.cryptoInstance=new ci,this.loadTokensFromStorage()}init(t){if(!(null==t?void 0:t.domain)||"string"!=typeof t.domain)throw new o("domain parameter is required for initialization. Please provide a valid domain string.","MISSING_DOMAIN");t.turingSDK&&(this.turingSDK=t.turingSDK),this.domain=t.domain,this.apiRequest.setDomain(t.domain),d.info(`[${this.instanceId}] Domain set to "${t.domain}"`),t.protocol&&(this.protocol=t.protocol,this.apiRequest.setProtocol(t.protocol),d.info(`[${this.instanceId}] Protocol set to "${t.protocol}"`)),this.channelInstance||(d.info(`[${this.instanceId}] Creating Channel and Action instances...`),this.channelInstance=new Xr(this.cryptoInstance,this.apiRequest),this.actionInstance=new Gr(this.cryptoInstance,this.channelInstance,this.fallbackTokenInstance,this.apiRequest,this.instanceId),this.turingSDK&&this.actionInstance.setTuringSDK(this.turingSDK),this.captchaComponent&&this.actionInstance.setCaptchaComponent(this.captchaComponent),this.pageInstance&&this.actionInstance.setPageInstance(this.pageInstance))}updateConfig(t){const{domain:e,protocol:r}=t;if(!this.channelInstance)return void d.warn(`[${this.instanceId}] SDK not initialized yet. Please call init() first.`);const i=void 0!==e&&e!==this.domain,n=void 0!==r&&r!==this.protocol;if(!i&&!n)return void d.info(`[${this.instanceId}] No config changes detected`);const a=this.domain,s=this.protocol;i&&(this.domain=e,this.apiRequest.setDomain(e),d.info(`[${this.instanceId}] Domain changed from "${a}" to "${e}"`)),n&&(this.protocol=r,this.apiRequest.setProtocol(r),d.info(`[${this.instanceId}] Protocol changed from "${s}" to "${r}"`)),d.info(`[${this.instanceId}] Config updated, reinitializing SDK...`),this.reinitialize()}setCaptchaComponent(t){this.captchaComponent=t,this.actionInstance&&this.actionInstance.setCaptchaComponent(t)}setTuringSDK(t){this.turingSDK=t,this.actionInstance&&this.actionInstance.setTuringSDK(t)}setPageInstance(t){this.pageInstance=t,this.actionInstance&&this.actionInstance.setPageInstance(t)}setDomain(t){this.updateConfig({domain:t})}getDomain(){return this.domain}setProtocol(t){this.updateConfig({protocol:t})}getProtocol(){return this.protocol}reinitialize(){d.info(`[${this.instanceId}] Reinitializing SDK due to domain/protocol change...`),this.clearToken(),this.fallbackTokenInstance=new hi,this.cryptoInstance=new ci,this.channelInstance=new Xr(this.cryptoInstance,this.apiRequest),this.actionInstance=new Gr(this.cryptoInstance,this.channelInstance,this.fallbackTokenInstance,this.apiRequest,this.instanceId),this.turingSDK&&this.actionInstance.setTuringSDK(this.turingSDK),this.captchaComponent&&this.actionInstance.setCaptchaComponent(this.captchaComponent),this.pageInstance&&this.actionInstance.setPageInstance(this.pageInstance),d.info(`[${this.instanceId}] SDK reinitialization completed`)}getAttestationToken(){if(this.cleanExpiredTokens(),0===this.attesterTokens.length||this.attesterTokens.every(t=>!t.value))return"";const t=this.attesterTokens.filter(t=>!this.isTokenExpired(t)).map(t=>`${t.key}:${t.value}`),e=t.join(";");return d.info(`[${this.instanceId}] Generated attestation token with ${t.length} valid tokens`),e}challenge(t){return e(this,void 0,void 0,function*(){if(!l(t)||!n.test(t))throw new o(`The attestId is invalid, expect string like "attest-xxx", but got "${t}".`,"INVALID_ATTEST_ID");try{d.info(`[${this.instanceId}] Starting challenge for attestId: ${t}`);const e=yield this.actionInstance.challenge(t);if(l(e)&&e.length>0)return this.addAttesterToken(t,e),d.info(`[${this.instanceId}] Challenge completed successfully for attestId: ${t}`),e;throw new o("Invalid token received from challenge","INVALID_CHALLENGE_TOKEN")}catch(e){throw d.error(`[${this.instanceId}] Challenge failed for attestId: ${t}`,e),e}})}clearToken(){this.instanceStorage.removeItem(di),this.attesterTokens=[],d.info(`[${this.instanceId}] All attestation tokens cleared (memory + storage)`)}addAttesterToken(t,e){const r=this.attesterTokens.find(e=>e.key===t),i=s.test(e),n=Date.now();r?(r.value=e,r.timestamp=n,r.isFallbackToken=i):this.attesterTokens.push({key:t,value:e,isFallbackToken:i,timestamp:n}),this.saveTokensToStorage()}isTokenExpired(t){if(!t.isFallbackToken)return!1;return Date.now()-t.timestamp>3e4}cleanExpiredTokens(){const t=this.attesterTokens.length;this.attesterTokens=this.attesterTokens.filter(t=>!this.isTokenExpired(t));const e=t-this.attesterTokens.length;e>0&&(this.saveTokensToStorage(),d.info(`[${this.instanceId}] Cleaned ${e} expired tokens`))}loadTokensFromStorage(){return e(this,void 0,void 0,function*(){try{const t=yield this.instanceStorage.getItem(di);t&&Array.isArray(t)&&(this.attesterTokens=t.filter(t=>t.key&&t.value),d.info(`[${this.instanceId}] Loaded ${this.attesterTokens.length} tokens from instance storage`))}catch(t){d.error(`[${this.instanceId}] Failed to load tokens from storage:`,t),this.attesterTokens=[]}})}saveTokensToStorage(){return e(this,void 0,void 0,function*(){try{const t=this.attesterTokens.filter(t=>!t.isFallbackToken);yield this.instanceStorage.setItem(di,t)}catch(t){d.error(`[${this.instanceId}] Failed to save tokens to storage:`,t)}})}}Component({behaviors:["wx://component-export"],export(){return{getToken:this.getToken.bind(this),verify:this.verify.bind(this),clearToken:this.clearToken.bind(this)}},properties:{domain:{type:String,value:"",observer:function(t,e){t&&t!==e&&"ready"===this.data.status&&(d.info("Component domain changed from:",e,"to:",t),this.handleDomainChange(t,e))}},protocol:{type:String,value:"https",observer:function(t,e){t&&t!==e&&"ready"===this.data.status&&(d.info("Component protocol changed from:",e,"to:",t),this.handleProtocolChange(t))}},rceTuringSDK:{type:Object,value:null},rcePageInstance:{type:Object,value:null},captchaProperties:{type:Object,value:{size:"normal",lang:"zh-CN",themeColor:"#1A79FF"},observer:function(t){t&&d.info("Captcha properties updated:",t)}}},data:{status:"idle",errorMsg:"",tokenInfo:{attestationToken:"",lastUpdated:0},domainInfo:{domain:"",setTime:0},captchaAppId:""},lifetimes:{attached(){d.info("Component attached"),this.eoKit=new li,this.setData({"domainInfo.domain":this.properties.domain||"","domainInfo.setTime":Date.now()}),setTimeout(()=>{this.autoInitialize()},0)},detached(){d.info("Component detached"),this.cleanup(),this.eoKit&&this.eoKit.clearToken()}},pageLifetimes:{show(){d.info("Page show"),this.refreshTokenDisplay()},hide(){d.info("Page hide")}},methods:{getToken(){return this.eoKit.getAttestationToken()},verify(t){return e(this,void 0,void 0,function*(){try{const e=yield this.eoKit.challenge(t);return this.triggerEvent("verifysuccess",{attestId:t,token:e,timestamp:Date.now()}),e}catch(e){return d.error("Verify failed:",e),this.triggerEvent("verifyfailed",{attestId:t,error:null==e?void 0:e.message,timestamp:Date.now()}),Promise.reject(e)}})},clearToken(){this.eoKit.clearToken()},_init(){return e(this,arguments,void 0,function*(t={}){try{this.setData({status:"initializing"});const e=t.rceTuringSDK||this.properties.rceTuringSDK,r=this.properties.domain;if(!r){const t="domain property is required. Please set the domain property on the security-kit component.";return d.error(t),this.setData({status:"error",errorMsg:t}),Promise.reject(new Error(t))}this.eoKit.init({turingSDK:e||void 0,domain:r,protocol:this.properties.protocol||"https"}),this.eoKit.setCaptchaComponent(this),d.info("Security kit component injected successfully");const i=t.rcePageInstance||this.properties.rcePageInstance||this;return this.eoKit.setPageInstance(i),d.info("RCE page instance set successfully (default: component self)"),this.setData({status:"ready"}),this.triggerEvent("ready",{timestamp:Date.now()}),Promise.resolve()}catch(t){return d.error("Initialization failed:",t),this.setData({status:"error",errorMsg:(null==t?void 0:t.message)||"Unknown error"}),this.triggerEvent("error",{error:t}),Promise.reject(t)}})},handleDomainChange(t,e){d.info("Domain changed from:",e,"to:",t),this._pendingConfigUpdate||(this._pendingConfigUpdate={}),this._pendingConfigUpdate.domain=t,this._configUpdateTimer&&clearTimeout(this._configUpdateTimer),this._configUpdateTimer=setTimeout(()=>{this.flushConfigUpdate()},0)},handleProtocolChange(t){d.info("Protocol changed to:",t),this._pendingConfigUpdate||(this._pendingConfigUpdate={}),this._pendingConfigUpdate.protocol=t,this._configUpdateTimer&&clearTimeout(this._configUpdateTimer),this._configUpdateTimer=setTimeout(()=>{this.flushConfigUpdate()},0)},flushConfigUpdate(){if(!this._pendingConfigUpdate||!this.eoKit)return void(this._pendingConfigUpdate=null);const{domain:t,protocol:e}=this._pendingConfigUpdate;this._pendingConfigUpdate=null,this._configUpdateTimer=null,d.info("Flushing config update:",{domain:t,protocol:e}),this.eoKit.updateConfig({domain:t,protocol:e}),t&&this.setData({"domainInfo.domain":t,"domainInfo.setTime":Date.now(),captchaAppId:"","tokenInfo.attestationToken":"","tokenInfo.lastUpdated":Date.now()})},autoInitialize(){return e(this,void 0,void 0,function*(){try{yield this._init()}catch(t){d.error("Auto initialization failed:",t)}})},showCaptcha(t){return e(this,void 0,void 0,function*(){return new Promise((e,r)=>{this.setData({captchaAppId:t.appId}),setTimeout(()=>{var t;const i=this.selectComponent("#captcha");i?(this._captchaTimeout=setTimeout(()=>{r(new Error("Captcha verification timeout")),this._captchaTimeout=null,this._pendingCaptchaResolve=null,this._pendingCaptchaReject=null},6e4),this._pendingCaptchaResolve=e,this._pendingCaptchaReject=r,null===(t=i.show)||void 0===t||t.call(i)):r(new Error('Captcha component not found. Please inject captcha component via generic:captcha-component="t-captcha"'))},100)})})},refreshTokenDisplay(){const t=this.eoKit.getAttestationToken();t!==this.data.tokenInfo.attestationToken&&this.setData({"tokenInfo.attestationToken":t,"tokenInfo.lastUpdated":Date.now()})},handlerCaptchaVerify(t){0===t.detail.ret&&this._pendingCaptchaResolve&&(this._pendingCaptchaResolve({ticket:t.detail.ticket,randstr:t.detail.randstr}),this._pendingCaptchaResolve=null,this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._captchaTimeout=null)},handlerCaptchaReady(){d.info("Captcha component ready")},handlerCaptchaClose(t){t&&t.detail&&2===t.detail.ret?this._pendingCaptchaReject&&(this._pendingCaptchaReject(new Error("User cancelled captcha")),this._pendingCaptchaReject=null,this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._captchaTimeout=null):d.info("Captcha verification completed")},handlerCaptchaError(t){d.error("Captcha error:",t.detail.errMsg),this._pendingCaptchaReject&&(this._pendingCaptchaReject(new Error(t.detail.errMsg)),this._pendingCaptchaReject=null,this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._captchaTimeout=null)},cleanup(){this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._configUpdateTimer&&clearTimeout(this._configUpdateTimer),this._pendingCaptchaResolve&&(this._pendingCaptchaResolve=null),this._pendingCaptchaReject&&(this._pendingCaptchaReject=null),this._pendingConfigUpdate=null}}});
|
|
1
|
+
"use strict";function t(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(r){if("default"!==r&&!(r in t)){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})}),Object.freeze(t)}function e(t,e,r,i){return new(r||(r=Promise))(function(n,a){function s(t){try{f(i.next(t))}catch(t){a(t)}}function o(t){try{f(i.throw(t))}catch(t){a(t)}}function f(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,o)}f((i=i.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const r=3e3,i=3001,n=/^attest-[0-9]+$/,a="MAINLAND_CHINA",s=/^s[1-2][A-Za-z0-9+/=]+$/;class o extends Error{constructor(t,e="SDK_ERROR",r){super(t),this.name="SDKError",this.code=e,this.originalError=r,Error.captureStackTrace&&Error.captureStackTrace(this,o)}}class f extends o{constructor(t,e="API_REQUEST_ERROR",r,i){super(t,e,r),this.name="ApiRequestError",this.response=r,this.request=i}}const c="__EO_CLIENT_SECURITY_KIT_DEBUG__";function h(){return("undefined"!=typeof globalThis?globalThis:global)[c]||!1}const d=new class{constructor(){this.prefix="[EOClientSecurityKit]"}static setDebug(t){!function(t){("undefined"!=typeof globalThis?globalThis:global)[c]=t}(t)}static isDebugEnabled(){return h()}log(t,...e){h()&&console.log(this.prefix,t,...e)}info(t,...e){h()&&console.info(this.prefix,t,...e)}warn(t,...e){console.warn(this.prefix,t,...e)}error(t,...e){console.error(this.prefix,t,...e)}};function u(t){return Object.prototype.toString.call(t)}function l(t){return"string"==typeof t}function p(t){return"[object Undefined]"===u(t)}function b(t){return!p(t)&&!function(t){return"[object Null]"===u(t)}(t)}function g(t){const e=t.replace(/^0x/gi,"").replace(/[^0-9a-f]/g,"").toLowerCase();if(e.length%2!=0)throw new Error(`Invalid HEX string length: Expected an even length, but actually got ${e.length} characters.`);const r=e.length/2,i=new Uint8Array(r);for(let t=0;t<r;t++){const r=2*t,n=e.substr(r,2);i[t]=parseInt(n,16)}return i}function y(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);const e=[];for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e.push(i):i<2048?e.push(192|i>>6,128|63&i):i<55296||i>=57344?e.push(224|i>>12,128|i>>6&63,128|63&i):(r++,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),e.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}return new Uint8Array(e)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const v=(()=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256);for(let r=0;r<64;r++)e[t.charCodeAt(r)]=r;return{encode:e=>{let r,i=e.length,n="";for(r=0;r<i;r+=3)n+=t[e[r]>>2],n+=t[(3&e[r])<<4|e[r+1]>>4],n+=t[(15&e[r+1])<<2|e[r+2]>>6],n+=t[63&e[r+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},decode:t=>{let r,i,n,a,s,o=.75*t.length,f=t.length,c=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);let h=new ArrayBuffer(o),d=new Uint8Array(h);for(r=0;r<f;r+=4)i=e[t.charCodeAt(r)],n=e[t.charCodeAt(r+1)],a=e[t.charCodeAt(r+2)],s=e[t.charCodeAt(r+3)],d[c++]=i<<2|n>>4,d[c++]=(15&n)<<4|a>>2,d[c++]=(3&a)<<6|63&s;return new Uint8Array(h)}}})();function m(t,r={}){const{maxRetries:i=3,delay:n=500,shouldRetryOnError:a=()=>!0,shouldRetryOnSuccess:s=()=>!1,delayType:o="fixed"}=r;let f=0,c=n;const h=()=>e(this,void 0,void 0,function*(){try{const e=yield t();return f>=i||!(yield s(e))?e:(f++,h())}catch(t){if(f>=i||!(yield a(t)))throw t;return f++,c="exponential"===o?2*c:n,yield(e=c,new Promise((t,r)=>{setTimeout(t,e)})),h()}var e});return h()}class w{constructor(){this.initStatus="uninitialized",this.initPromise=null}execute(t){return e(this,void 0,void 0,function*(){var r;return this.isSuccess?null===(r=t.getInitializedValue)||void 0===r?void 0:r.call(t):(this.shouldReturnCachedPromise()||(this.setStatus("initializing"),this.initPromise=new Promise((r,i)=>e(this,void 0,void 0,function*(){var e,n;try{const i=yield t.initFn();this.setStatus("success");const n=null===(e=t.onSuccess)||void 0===e?void 0:e.call(t,i);r(p(n)?i:n)}catch(e){this.setStatus("error");const r=null===(n=t.onError)||void 0===n?void 0:n.call(t,e);i(r||e)}finally{this.initPromise=null}}))),this.initPromise)})}shouldReturnCachedPromise(){return!(!this.isInitializing||!this.initPromise)}setStatus(t){this.initStatus=t}get isUninitialized(){return"uninitialized"===this.initStatus}get isSuccess(){return"success"===this.initStatus}get isError(){return"error"===this.initStatus}get isInitializing(){return"initializing"===this.initStatus}getStatus(){return this.initStatus}reset(){this.initStatus="uninitialized",this.initPromise=null}}class _{constructor(){this.queue=[],this.isProcessing=!1}addTask(t,e,r){e=e||function(t=16){let e="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let i=0;i<t;i++)e+=r.charAt(Math.floor(62*Math.random()));return e}(),r=r||1;const i=this.queue.find(t=>t.id===e);if(i)return i.promise;let n,a;const s=new Promise((t,e)=>{n=t,a=e}),o={id:e,taskFn:t,resolve:n,reject:a,promise:s,status:"pending",priority:r};if(r>0){const t=this.queue.findIndex(t=>t.priority<r);t>=0?this.queue.splice(t,0,o):this.queue.push(o)}return this.isProcessing||this.processQueue(),s}cancelTask(t){const e=this.queue.findIndex(e=>e.id===t),r=this.queue[e];return"pending"===(null==r?void 0:r.status)&&(r.status="canceled",this.queue.splice(e,1),!0)}clearQueue(){this.queue=this.queue.filter(t=>"processing"===t.status)}processQueue(){return e(this,void 0,void 0,function*(){for(this.isProcessing=!0;this.queue.length>0;){const t=this.queue[0];if("canceled"!==t.status){t.status="processing";try{const e=yield t.taskFn();t.resolve(e)}catch(e){t.reject(e)}finally{t.status="done",this.queue.shift()}}else this.queue.shift()}this.isProcessing=!1})}}class S{static getInstance(){return S.instance||(S.instance=new _),S.instance}static reset(){S.instance=null}}var M,A;S.instance=null,function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.NONE=4]="NONE"}(M||(M={}));class I{constructor(t="default"){this.domain="",this.protocol="https",this.instanceId=t}setDomain(t){this.domain=t,d.info(`[${this.instanceId}] Domain set to: ${t}`)}getDomain(){return this.domain}setProtocol(t){this.protocol=t,d.info(`[${this.instanceId}] Protocol set to: ${t}`)}getProtocol(){return this.protocol}buildRequestUrl(t){const e=this.domain,r=this.protocol;if(!e)throw new o("Domain is not set. Please call setDomain first.","DOMAIN_NOT_SET");return`${r}://${e}${t}`}request(t){return e(this,void 0,void 0,function*(){if(b(wx)&&("[object Function]"===u(e=wx.request)&&"function"==typeof e)){d.info(`[${this.instanceId}] Using wx.request`);const e=Object.assign({},t.headers),r=this.buildRequestUrl(t.url);return d.info(`[${this.instanceId}] Request URL: ${r}`),new Promise((i,n)=>{wx.request({url:r,method:t.method||"GET",data:t.data,header:e,timeout:t.timeout||6e4,success:t=>{i({data:t.data,status:t.statusCode,headers:t.header||{}})},fail:t=>{n(new o("WeChat request failed","WX_REQUEST_ERROR",t))}})})}var e;throw new o("wx.request is not available in miniprogram plugin environment","WX_REQUEST_NOT_AVAILABLE")})}apiRequest(t){return e(this,arguments,void 0,function*(t,e={},r={},i={}){try{const{SDKVersion:n,Version:a,Url:s}=r,o={SDKVersion:n||"0.0.1-beta.4",Version:a||"2025-03-24"},c=Object.assign(Object.assign(Object.assign({},o),e),{Action:t}),h=s||"/.eo-sec-bot/",u=Object.assign({"Content-Type":"application/json"},i),l={url:h,method:"POST",data:c,headers:u,timeout:3e4};d.info(`[${this.instanceId}] Final request headers:`,JSON.stringify(u));const p=yield this.request(l),{data:b,status:g}=p,y=(null==b?void 0:b.Response)||{},{Error:v}=y,m=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r}(y,["Error"]);return g>=200&&g<300&&!v?m:Promise.reject(new f((null==v?void 0:v.Message)||"Request Failed.",(null==v?void 0:v.Code)||"API_REQUEST_ERROR",p,l))}catch(t){const e=t instanceof Error?t.message:"The api request executed error.",r=(null==t?void 0:t.code)||"API_REQUEST_ERROR";return Promise.reject(new f(e,r,t,{}))}})}}!function(t){t.MEMORY="memory",t.PERSISTENT="persistent"}(A||(A={}));class x{constructor(t="eo_memory_"){this.memoryStorage=new Map,this.storagePrefix=t,d.info(`MemoryStorage initialized with prefix: ${t}`)}getPrefixedKey(t){return this.storagePrefix+t}setItem(t,r){return e(this,void 0,void 0,function*(){if(!l(t))throw new o("Storage key must be string","INVALID_STORAGE_KEY");const e=this.getPrefixedKey(t);this.memoryStorage.set(e,r),d.info(`MemoryStorage setItem: ${e}`)})}getItem(t){return e(this,void 0,void 0,function*(){if(!l(t))throw new o("Storage key must be string","INVALID_STORAGE_KEY");const e=this.getPrefixedKey(t),r=this.memoryStorage.get(e);return d.info(`MemoryStorage getItem: ${e}`),r})}removeItem(t){return e(this,void 0,void 0,function*(){if(!l(t))throw new o("Storage key must be string","INVALID_STORAGE_KEY");const e=this.getPrefixedKey(t);this.memoryStorage.delete(e),d.info(`MemoryStorage removeItem: ${e}`)})}clear(){return e(this,void 0,void 0,function*(){this.memoryStorage.clear(),d.info("MemoryStorage cleared")})}getAllKeys(){return e(this,void 0,void 0,function*(){const t=[];for(const e of this.memoryStorage.keys())e.startsWith(this.storagePrefix)&&t.push(e.substring(this.storagePrefix.length));return t})}getType(){return A.MEMORY}size(){return this.memoryStorage.size}}function E(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}new x;var k,C={exports:{}},R={exports:{}};function T(){return k||(k=1,R.exports=function(){var t=t||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),i={},n=i.lib={},a=n.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=n.WordArray=a.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var a=0;a<n;a++){var s=r[a>>>2]>>>24-a%4*8&255;e[i+a>>>2]|=s<<24-(i+a)%4*8}else for(a=0;a<n;a+=4)e[i+a>>>2]=r[a>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,i=[],n=function(e){var r=987654321,i=4294967295;return function(){var n=((r=36969*(65535&r)+(r>>16)&i)<<16)+(e=18e3*(65535&e)+(e>>16)&i)&i;return n/=4294967296,(n+=.5)*(t.random()>.5?1:-1)}},a=0;a<e;a+=4){var o=n(4294967296*(r||t.random()));r=987654071*o(),i.push(4294967296*o()|0)}return new s.init(i,e)}}),o=i.enc={},f=o.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var a=e[n>>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new s.init(r,e/2)}},c=o.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var a=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new s.init(r,e)}},h=o.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},d=n.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,i=r.words,n=r.sigBytes,a=this.blockSize,o=n/(4*a),f=(o=e?t.ceil(o):t.max((0|o)-this._minBufferSize,0))*a,c=t.min(4*f,n);if(f){for(var h=0;h<f;h+=a)this._doProcessBlock(i,h);var d=i.splice(0,f);r.sigBytes-=c}return new s.init(d,c)},clone:function(){var t=a.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});n.Hasher=d.extend({cfg:a.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new u.HMAC.init(t,r).finalize(e)}}});var u=i.algo={};return i}(Math);return t}()),R.exports}var P,z={exports:{}};function B(){return P||(P=1,z.exports=function(t){return i=(r=t).lib,n=i.Base,a=i.WordArray,(s=r.x64={}).Word=n.extend({init:function(t,e){this.high=t,this.low=e}}),s.WordArray=n.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:8*t.length},toX32:function(){for(var t=this.words,e=t.length,r=[],i=0;i<e;i++){var n=t[i];r.push(n.high),r.push(n.low)}return a.create(r,this.sigBytes)},clone:function(){for(var t=n.clone.call(this),e=t.words=this.words.slice(0),r=e.length,i=0;i<r;i++)e[i]=e[i].clone();return t}}),t;var e,r,i,n,a,s}(T())),z.exports}var K,D={exports:{}};function H(){return K||(K=1,D.exports=function(t){return function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,r=e.init,i=e.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,i=[],n=0;n<e;n++)i[n>>>2]|=t[n]<<24-n%4*8;r.call(this,i,e)}else r.apply(this,arguments)};i.prototype=e}}(),t.lib.WordArray}(T())),D.exports}var q,N={exports:{}};function O(){return q||(q=1,N.exports=function(t){return function(){var e=t,r=e.lib.WordArray,i=e.enc;function n(t){return t<<8&4278255360|t>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n+=2){var a=e[n>>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n++)i[n>>>1]|=t.charCodeAt(n)<<16-n%2*16;return r.create(i,2*e)}},i.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],a=0;a<r;a+=2){var s=n(e[a>>>2]>>>16-a%4*8&65535);i.push(String.fromCharCode(s))}return i.join("")},parse:function(t){for(var e=t.length,i=[],a=0;a<e;a++)i[a>>>1]|=n(t.charCodeAt(a)<<16-a%2*16);return r.create(i,2*e)}}}(),t.enc.Utf16}(T())),N.exports}var F,L={exports:{}};function U(){return F||(F=1,L.exports=function(t){return function(){var e=t,r=e.lib.WordArray;function i(t,e,i){for(var n=[],a=0,s=0;s<e;s++)if(s%4){var o=i[t.charCodeAt(s-1)]<<s%4*2,f=i[t.charCodeAt(s)]>>>6-s%4*2;n[a>>>2]|=(o|f)<<24-a%4*8,a++}return r.create(n,a)}e.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,i=this._map;t.clamp();for(var n=[],a=0;a<r;a+=3)for(var s=(e[a>>>2]>>>24-a%4*8&255)<<16|(e[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|e[a+2>>>2]>>>24-(a+2)%4*8&255,o=0;o<4&&a+.75*o<r;o++)n.push(i.charAt(s>>>6*(3-o)&63));var f=i.charAt(64);if(f)for(;n.length%4;)n.push(f);return n.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var a=0;a<r.length;a++)n[r.charCodeAt(a)]=a}var s=r.charAt(64);if(s){var o=t.indexOf(s);-1!==o&&(e=o)}return i(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64}(T())),L.exports}var j,$={exports:{}};function W(){return j||(j=1,$.exports=function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,s=r.algo,o=[];!function(){for(var t=0;t<64;t++)o[t]=4294967296*e.abs(e.sin(t+1))|0}();var f=s.MD5=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var a=this._hash.words,s=t[e+0],f=t[e+1],l=t[e+2],p=t[e+3],b=t[e+4],g=t[e+5],y=t[e+6],v=t[e+7],m=t[e+8],w=t[e+9],_=t[e+10],S=t[e+11],M=t[e+12],A=t[e+13],I=t[e+14],x=t[e+15],E=a[0],k=a[1],C=a[2],R=a[3];E=c(E,k,C,R,s,7,o[0]),R=c(R,E,k,C,f,12,o[1]),C=c(C,R,E,k,l,17,o[2]),k=c(k,C,R,E,p,22,o[3]),E=c(E,k,C,R,b,7,o[4]),R=c(R,E,k,C,g,12,o[5]),C=c(C,R,E,k,y,17,o[6]),k=c(k,C,R,E,v,22,o[7]),E=c(E,k,C,R,m,7,o[8]),R=c(R,E,k,C,w,12,o[9]),C=c(C,R,E,k,_,17,o[10]),k=c(k,C,R,E,S,22,o[11]),E=c(E,k,C,R,M,7,o[12]),R=c(R,E,k,C,A,12,o[13]),C=c(C,R,E,k,I,17,o[14]),E=h(E,k=c(k,C,R,E,x,22,o[15]),C,R,f,5,o[16]),R=h(R,E,k,C,y,9,o[17]),C=h(C,R,E,k,S,14,o[18]),k=h(k,C,R,E,s,20,o[19]),E=h(E,k,C,R,g,5,o[20]),R=h(R,E,k,C,_,9,o[21]),C=h(C,R,E,k,x,14,o[22]),k=h(k,C,R,E,b,20,o[23]),E=h(E,k,C,R,w,5,o[24]),R=h(R,E,k,C,I,9,o[25]),C=h(C,R,E,k,p,14,o[26]),k=h(k,C,R,E,m,20,o[27]),E=h(E,k,C,R,A,5,o[28]),R=h(R,E,k,C,l,9,o[29]),C=h(C,R,E,k,v,14,o[30]),E=d(E,k=h(k,C,R,E,M,20,o[31]),C,R,g,4,o[32]),R=d(R,E,k,C,m,11,o[33]),C=d(C,R,E,k,S,16,o[34]),k=d(k,C,R,E,I,23,o[35]),E=d(E,k,C,R,f,4,o[36]),R=d(R,E,k,C,b,11,o[37]),C=d(C,R,E,k,v,16,o[38]),k=d(k,C,R,E,_,23,o[39]),E=d(E,k,C,R,A,4,o[40]),R=d(R,E,k,C,s,11,o[41]),C=d(C,R,E,k,p,16,o[42]),k=d(k,C,R,E,y,23,o[43]),E=d(E,k,C,R,w,4,o[44]),R=d(R,E,k,C,M,11,o[45]),C=d(C,R,E,k,x,16,o[46]),E=u(E,k=d(k,C,R,E,l,23,o[47]),C,R,s,6,o[48]),R=u(R,E,k,C,v,10,o[49]),C=u(C,R,E,k,I,15,o[50]),k=u(k,C,R,E,g,21,o[51]),E=u(E,k,C,R,M,6,o[52]),R=u(R,E,k,C,p,10,o[53]),C=u(C,R,E,k,_,15,o[54]),k=u(k,C,R,E,f,21,o[55]),E=u(E,k,C,R,m,6,o[56]),R=u(R,E,k,C,x,10,o[57]),C=u(C,R,E,k,y,15,o[58]),k=u(k,C,R,E,A,21,o[59]),E=u(E,k,C,R,b,6,o[60]),R=u(R,E,k,C,S,10,o[61]),C=u(C,R,E,k,l,15,o[62]),k=u(k,C,R,E,w,21,o[63]),a[0]=a[0]+E|0,a[1]=a[1]+k|0,a[2]=a[2]+C|0,a[3]=a[3]+R|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;r[n>>>5]|=128<<24-n%32;var a=e.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var o=this._hash,f=o.words,c=0;c<4;c++){var h=f[c];f[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return o},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,r,i,n,a,s){var o=t+(e&r|~e&i)+n+s;return(o<<a|o>>>32-a)+e}function h(t,e,r,i,n,a,s){var o=t+(e&i|r&~i)+n+s;return(o<<a|o>>>32-a)+e}function d(t,e,r,i,n,a,s){var o=t+(e^r^i)+n+s;return(o<<a|o>>>32-a)+e}function u(t,e,r,i,n,a,s){var o=t+(r^(e|~i))+n+s;return(o<<a|o>>>32-a)+e}r.MD5=a._createHelper(f),r.HmacMD5=a._createHmacHelper(f)}(Math),t.MD5}(T())),$.exports}var V,G={exports:{}};function X(){return V||(V=1,G.exports=function(t){return r=(e=t).lib,i=r.WordArray,n=r.Hasher,a=e.algo,s=[],o=a.SHA1=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],f=r[4],c=0;c<80;c++){if(c<16)s[c]=0|t[e+c];else{var h=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=h<<1|h>>>31}var d=(i<<5|i>>>27)+f+s[c];d+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,f=o,o=a,a=n<<30|n>>>2,n=i,i=d}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+f|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA1=n._createHelper(o),e.HmacSHA1=n._createHmacHelper(o),t.SHA1;var e,r,i,n,a,s,o}(T())),G.exports}var Y,Z={exports:{}};function J(){return Y||(Y=1,Z.exports=function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,s=r.algo,o=[],f=[];!function(){function t(t){for(var r=e.sqrt(t),i=2;i<=r;i++)if(!(t%i))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var i=2,n=0;n<64;)t(i)&&(n<8&&(o[n]=r(e.pow(i,.5))),f[n]=r(e.pow(i,1/3)),n++),i++}();var c=[],h=s.SHA256=a.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],s=r[3],o=r[4],h=r[5],d=r[6],u=r[7],l=0;l<64;l++){if(l<16)c[l]=0|t[e+l];else{var p=c[l-15],b=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[l-2],y=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=b+c[l-7]+y+c[l-16]}var v=i&n^i&a^n&a,m=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),w=u+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&h^~o&d)+f[l]+c[l];u=d,d=h,h=o,o=s+w|0,s=a,a=n,n=i,i=w+(m+v)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+o|0,r[5]=r[5]+h|0,r[6]=r[6]+d|0,r[7]=r[7]+u|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=e.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});r.SHA256=a._createHelper(h),r.HmacSHA256=a._createHmacHelper(h)}(Math),t.SHA256}(T())),Z.exports}var Q,tt={exports:{}};var et,rt={exports:{}};function it(){return et||(et=1,rt.exports=function(t){return function(){var e=t,r=e.lib.Hasher,i=e.x64,n=i.Word,a=i.WordArray,s=e.algo;function o(){return n.create.apply(n,arguments)}var f=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=o()}();var h=s.SHA512=r.extend({_doReset:function(){this._hash=new a.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],s=r[3],o=r[4],h=r[5],d=r[6],u=r[7],l=i.high,p=i.low,b=n.high,g=n.low,y=a.high,v=a.low,m=s.high,w=s.low,_=o.high,S=o.low,M=h.high,A=h.low,I=d.high,x=d.low,E=u.high,k=u.low,C=l,R=p,T=b,P=g,z=y,B=v,K=m,D=w,H=_,q=S,N=M,O=A,F=I,L=x,U=E,j=k,$=0;$<80;$++){var W=c[$];if($<16)var V=W.high=0|t[e+2*$],G=W.low=0|t[e+2*$+1];else{var X=c[$-15],Y=X.high,Z=X.low,J=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,Q=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),tt=c[$-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),at=c[$-7],st=at.high,ot=at.low,ft=c[$-16],ct=ft.high,ht=ft.low;V=(V=(V=J+st+((G=Q+ot)>>>0<Q>>>0?1:0))+it+((G+=nt)>>>0<nt>>>0?1:0))+ct+((G+=ht)>>>0<ht>>>0?1:0),W.high=V,W.low=G}var dt,ut=H&N^~H&F,lt=q&O^~q&L,pt=C&T^C&z^T&z,bt=R&P^R&B^P&B,gt=(C>>>28|R<<4)^(C<<30|R>>>2)^(C<<25|R>>>7),yt=(R>>>28|C<<4)^(R<<30|C>>>2)^(R<<25|C>>>7),vt=(H>>>14|q<<18)^(H>>>18|q<<14)^(H<<23|q>>>9),mt=(q>>>14|H<<18)^(q>>>18|H<<14)^(q<<23|H>>>9),wt=f[$],_t=wt.high,St=wt.low,Mt=U+vt+((dt=j+mt)>>>0<j>>>0?1:0),At=yt+bt;U=F,j=L,F=N,L=O,N=H,O=q,H=K+(Mt=(Mt=(Mt=Mt+ut+((dt+=lt)>>>0<lt>>>0?1:0))+_t+((dt+=St)>>>0<St>>>0?1:0))+V+((dt+=G)>>>0<G>>>0?1:0))+((q=D+dt|0)>>>0<D>>>0?1:0)|0,K=z,D=B,z=T,B=P,T=C,P=R,C=Mt+(gt+pt+(At>>>0<yt>>>0?1:0))+((R=dt+At|0)>>>0<dt>>>0?1:0)|0}p=i.low=p+R,i.high=l+C+(p>>>0<R>>>0?1:0),g=n.low=g+P,n.high=b+T+(g>>>0<P>>>0?1:0),v=a.low=v+B,a.high=y+z+(v>>>0<B>>>0?1:0),w=s.low=w+D,s.high=m+K+(w>>>0<D>>>0?1:0),S=o.low=S+q,o.high=_+H+(S>>>0<q>>>0?1:0),A=h.low=A+O,h.high=M+N+(A>>>0<O>>>0?1:0),x=d.low=x+L,d.high=I+F+(x>>>0<L>>>0?1:0),k=u.low=k+j,u.high=E+U+(k>>>0<j>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});e.SHA512=r._createHelper(h),e.HmacSHA512=r._createHmacHelper(h)}(),t.SHA512}(T(),B())),rt.exports}var nt,at={exports:{}};var st,ot={exports:{}};function ft(){return st||(st=1,ot.exports=function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,s=r.x64.Word,o=r.algo,f=[],c=[],h=[];!function(){for(var t=1,e=0,r=0;r<24;r++){f[t+5*e]=(r+1)*(r+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,d=0,u=0;u<7;u++){if(1&n){var l=(1<<u)-1;l<32?d^=1<<l:o^=1<<l-32}128&n?n=n<<1^113:n<<=1}h[a]=s.create(o,d)}}();var d=[];!function(){for(var t=0;t<25;t++)d[t]=s.create()}();var u=o.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var r=this._state,i=this.blockSize/2,n=0;n<i;n++){var a=t[e+2*n],s=t[e+2*n+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(k=r[n]).high^=s,k.low^=a}for(var o=0;o<24;o++){for(var u=0;u<5;u++){for(var l=0,p=0,b=0;b<5;b++)l^=(k=r[u+5*b]).high,p^=k.low;var g=d[u];g.high=l,g.low=p}for(u=0;u<5;u++){var y=d[(u+4)%5],v=d[(u+1)%5],m=v.high,w=v.low;for(l=y.high^(m<<1|w>>>31),p=y.low^(w<<1|m>>>31),b=0;b<5;b++)(k=r[u+5*b]).high^=l,k.low^=p}for(var _=1;_<25;_++){var S=(k=r[_]).high,M=k.low,A=f[_];A<32?(l=S<<A|M>>>32-A,p=M<<A|S>>>32-A):(l=M<<A-32|S>>>64-A,p=S<<A-32|M>>>64-A);var I=d[c[_]];I.high=l,I.low=p}var x=d[0],E=r[0];for(x.high=E.high,x.low=E.low,u=0;u<5;u++)for(b=0;b<5;b++){var k=r[_=u+5*b],C=d[_],R=d[(u+1)%5+5*b],T=d[(u+2)%5+5*b];k.high=C.high^~R.high&T.high,k.low=C.low^~R.low&T.low}k=r[0];var P=h[o];k.high^=P.high,k.low^=P.low}},_doFinalize:function(){var t=this._data,r=t.words;this._nDataBytes;var i=8*t.sigBytes,a=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(e.ceil((i+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,o=this.cfg.outputLength/8,f=o/8,c=[],h=0;h<f;h++){var d=s[h],u=d.high,l=d.low;u=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),c.push(l),c.push(u)}return new n.init(c,o)},clone:function(){for(var t=a.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});r.SHA3=a._createHelper(u),r.HmacSHA3=a._createHmacHelper(u)}(Math),t.SHA3}(T(),B())),ot.exports}var ct,ht={exports:{}};var dt,ut={exports:{}};function lt(){return dt||(dt=1,ut.exports=function(t){var e,r,i;r=(e=t).lib.Base,i=e.enc.Utf8,e.algo.HMAC=r.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=i.parse(e));var r=t.blockSize,n=4*r;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var a=this._oKey=e.clone(),s=this._iKey=e.clone(),o=a.words,f=s.words,c=0;c<r;c++)o[c]^=1549556828,f[c]^=909522486;a.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,r=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(r))}})}(T())),ut.exports}var pt,bt={exports:{}};var gt,yt={exports:{}};function vt(){return gt||(gt=1,yt.exports=function(t){return r=(e=t).lib,i=r.Base,n=r.WordArray,a=e.algo,s=a.MD5,o=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=r.hasher.create(),a=n.create(),s=a.words,o=r.keySize,f=r.iterations;s.length<o;){c&&i.update(c);var c=i.update(t).finalize(e);i.reset();for(var h=1;h<f;h++)c=i.finalize(c),i.reset();a.concat(c)}return a.sigBytes=4*o,a}}),e.EvpKDF=function(t,e,r){return o.create(r).compute(t,e)},t.EvpKDF;var e,r,i,n,a,s,o}(T(),X(),lt())),yt.exports}var mt,wt={exports:{}};function _t(){return mt||(mt=1,wt.exports=function(t){t.lib.Cipher||function(e){var r=t,i=r.lib,n=i.Base,a=i.WordArray,s=i.BufferedBlockAlgorithm,o=r.enc;o.Utf8;var f=o.Base64,c=r.algo.EvpKDF,h=i.Cipher=s.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?m:y}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()});i.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=r.mode={},u=i.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),l=d.CBC=function(){var t=u.extend();function r(t,r,i){var n=this._iv;if(n){var a=n;this._iv=e}else a=this._prevBlock;for(var s=0;s<i;s++)t[r+s]^=a[s]}return t.Encryptor=t.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize;r.call(this,t,e,n),i.encryptBlock(t,e),this._prevBlock=t.slice(e,e+n)}}),t.Decryptor=t.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,a=t.slice(e,e+n);i.decryptBlock(t,e),r.call(this,t,e,n),this._prevBlock=a}}),t}(),p=(r.pad={}).Pkcs7={pad:function(t,e){for(var r=4*e,i=r-t.sigBytes%r,n=i<<24|i<<16|i<<8|i,s=[],o=0;o<i;o+=4)s.push(n);var f=a.create(s,i);t.concat(f)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}};i.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:p}),reset:function(){h.reset.call(this);var t=this.cfg,e=t.iv,r=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else i=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==i?this._mode.init(this,e&&e.words):(this._mode=i.call(r,this,e&&e.words),this._mode.__creator=i)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var b=i.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),g=(r.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;if(r)var i=a.create([1398893684,1701076831]).concat(r).concat(e);else i=e;return i.toString(f)},parse:function(t){var e=f.parse(t),r=e.words;if(1398893684==r[0]&&1701076831==r[1]){var i=a.create(r.slice(2,4));r.splice(0,4),e.sigBytes-=16}return b.create({ciphertext:e,salt:i})}},y=i.SerializableCipher=n.extend({cfg:n.extend({format:g}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),a=n.finalize(e),s=n.cfg;return b.create({ciphertext:a,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),v=(r.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=a.random(8));var n=c.create({keySize:e+r}).compute(t,i),s=a.create(n.words.slice(e),4*r);return n.sigBytes=4*e,b.create({key:n,iv:s,salt:i})}},m=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:v}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var a=y.encrypt.call(this,t,e,n.key,i);return a.mixIn(n),a},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,y.decrypt.call(this,t,e,n.key,i)}})}()}(T(),vt())),wt.exports}var St,Mt={exports:{}};function At(){return St||(St=1,Mt.exports=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function r(t,e,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var s=0;s<r;s++)t[e+s]^=a[s]}return e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize;r.call(this,t,e,n,i),this._prevBlock=t.slice(e,e+n)}}),e.Decryptor=e.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,a=t.slice(e,e+n);r.call(this,t,e,n,i),this._prevBlock=a}}),e}(),t.mode.CFB}(T(),_t())),Mt.exports}var It,xt={exports:{}};function Et(){return It||(It=1,xt.exports=function(t){return t.mode.CTR=(e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,a=this._counter;n&&(a=this._counter=n.slice(0),this._iv=void 0);var s=a.slice(0);r.encryptBlock(s,0),a[i-1]=a[i-1]+1|0;for(var o=0;o<i;o++)t[e+o]^=s[o]}}),e.Decryptor=r,e),t.mode.CTR;var e,r}(T(),_t())),xt.exports}var kt,Ct={exports:{}};function Rt(){return kt||(kt=1,Ct.exports=function(t){return t.mode.CTRGladman=function(){var e=t.lib.BlockCipherMode.extend();function r(t){if(255&~(t>>24))t+=1<<24;else{var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}return t}function i(t){return 0===(t[0]=r(t[0]))&&(t[1]=r(t[1])),t}var n=e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,n=r.blockSize,a=this._iv,s=this._counter;a&&(s=this._counter=a.slice(0),this._iv=void 0),i(s);var o=s.slice(0);r.encryptBlock(o,0);for(var f=0;f<n;f++)t[e+f]^=o[f]}});return e.Decryptor=n,e}(),t.mode.CTRGladman}(T(),_t())),Ct.exports}var Tt,Pt={exports:{}};function zt(){return Tt||(Tt=1,Pt.exports=function(t){return t.mode.OFB=(e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,a=this._keystream;n&&(a=this._keystream=n.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var s=0;s<i;s++)t[e+s]^=a[s]}}),e.Decryptor=r,e),t.mode.OFB;var e,r}(T(),_t())),Pt.exports}var Bt,Kt={exports:{}};var Dt,Ht={exports:{}};var qt,Nt={exports:{}};var Ot,Ft={exports:{}};var Lt,Ut={exports:{}};var jt,$t={exports:{}};var Wt,Vt={exports:{}};var Gt,Xt={exports:{}};var Yt,Zt={exports:{}};var Jt,Qt={exports:{}};var te,ee={exports:{}};var re,ie={exports:{}};var ne;var ae,se=(ne||(ne=1,C.exports=function(t){return t}(T(),B(),H(),O(),U(),W(),X(),J(),Q||(Q=1,tt.exports=function(t){return r=(e=t).lib.WordArray,i=e.algo,n=i.SHA256,a=i.SHA224=n.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}}),e.SHA224=n._createHelper(a),e.HmacSHA224=n._createHmacHelper(a),t.SHA224;var e,r,i,n,a}(T(),J())),it(),nt||(nt=1,at.exports=function(t){return r=(e=t).x64,i=r.Word,n=r.WordArray,a=e.algo,s=a.SHA512,o=a.SHA384=s.extend({_doReset:function(){this._hash=new n.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=16,t}}),e.SHA384=s._createHelper(o),e.HmacSHA384=s._createHmacHelper(o),t.SHA384;var e,r,i,n,a,s,o}(T(),B(),it())),ft(),ct||(ct=1,ht.exports=function(t){return function(){var e=t,r=e.lib,i=r.WordArray,n=r.Hasher,a=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),f=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),u=a.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var a,u,m,w,_,S,M,A,I,x,E,k=this._hash.words,C=h.words,R=d.words,T=s.words,P=o.words,z=f.words,B=c.words;for(S=a=k[0],M=u=k[1],A=m=k[2],I=w=k[3],x=_=k[4],r=0;r<80;r+=1)E=a+t[e+T[r]]|0,E+=r<16?l(u,m,w)+C[0]:r<32?p(u,m,w)+C[1]:r<48?b(u,m,w)+C[2]:r<64?g(u,m,w)+C[3]:y(u,m,w)+C[4],E=(E=v(E|=0,z[r]))+_|0,a=_,_=w,w=v(m,10),m=u,u=E,E=S+t[e+P[r]]|0,E+=r<16?y(M,A,I)+R[0]:r<32?g(M,A,I)+R[1]:r<48?b(M,A,I)+R[2]:r<64?p(M,A,I)+R[3]:l(M,A,I)+R[4],E=(E=v(E|=0,B[r]))+x|0,S=x,x=I,I=v(A,10),A=M,M=E;E=k[1]+m+I|0,k[1]=k[2]+w+x|0,k[2]=k[3]+_+S|0,k[3]=k[4]+a+M|0,k[4]=k[0]+u+A|0,k[0]=E},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,a=n.words,s=0;s<5;s++){var o=a[s];a[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return n},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function l(t,e,r){return t^e^r}function p(t,e,r){return t&e|~t&r}function b(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function y(t,e,r){return t^(e|~r)}function v(t,e){return t<<e|t>>>32-e}e.RIPEMD160=n._createHelper(u),e.HmacRIPEMD160=n._createHmacHelper(u)}(),t.RIPEMD160}(T())),lt(),pt||(pt=1,bt.exports=function(t){return i=(r=(e=t).lib).Base,n=r.WordArray,s=(a=e.algo).SHA1,o=a.HMAC,f=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=o.create(r.hasher,t),a=n.create(),s=n.create([1]),f=a.words,c=s.words,h=r.keySize,d=r.iterations;f.length<h;){var u=i.update(e).finalize(s);i.reset();for(var l=u.words,p=l.length,b=u,g=1;g<d;g++){b=i.finalize(b),i.reset();for(var y=b.words,v=0;v<p;v++)l[v]^=y[v]}a.concat(u),c[0]++}return a.sigBytes=4*h,a}}),e.PBKDF2=function(t,e,r){return f.create(r).compute(t,e)},t.PBKDF2;var e,r,i,n,a,s,o,f}(T(),X(),lt())),vt(),_t(),At(),Et(),Rt(),zt(),Bt||(Bt=1,Kt.exports=function(t){return t.mode.ECB=((e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),e.Decryptor=e.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),e),t.mode.ECB;var e}(T(),_t())),Dt||(Dt=1,Ht.exports=function(t){return t.pad.AnsiX923={pad:function(t,e){var r=t.sigBytes,i=4*e,n=i-r%i,a=r+n-1;t.clamp(),t.words[a>>>2]|=n<<24-a%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Ansix923}(T(),_t())),qt||(qt=1,Nt.exports=function(t){return t.pad.Iso10126={pad:function(e,r){var i=4*r,n=i-e.sigBytes%i;e.concat(t.lib.WordArray.random(n-1)).concat(t.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126}(T(),_t())),Ot||(Ot=1,Ft.exports=function(t){return t.pad.Iso97971={pad:function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971}(T(),_t())),Lt||(Lt=1,Ut.exports=function(t){return t.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1;!(e[r>>>2]>>>24-r%4*8&255);)r--;t.sigBytes=r+1}},t.pad.ZeroPadding}(T(),_t())),jt||(jt=1,$t.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(T(),_t())),Wt||(Wt=1,Vt.exports=function(t){return r=(e=t).lib.CipherParams,i=e.enc.Hex,e.format.Hex={stringify:function(t){return t.ciphertext.toString(i)},parse:function(t){var e=i.parse(t);return r.create({ciphertext:e})}},t.format.Hex;var e,r,i}(T(),_t())),Gt||(Gt=1,Xt.exports=function(t){return function(){var e=t,r=e.lib.BlockCipher,i=e.algo,n=[],a=[],s=[],o=[],f=[],c=[],h=[],d=[],u=[],l=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,i=0;for(e=0;e<256;e++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,n[r]=p,a[p]=r;var b=t[r],g=t[b],y=t[g],v=257*t[p]^16843008*p;s[r]=v<<24|v>>>8,o[r]=v<<16|v>>>16,f[r]=v<<8|v>>>24,c[r]=v,v=16843009*y^65537*g^257*b^16843008*r,h[p]=v<<24|v>>>8,d[p]=v<<16|v>>>16,u[p]=v<<8|v>>>24,l[p]=v,r?(r=b^t[t[t[y^b]]],i^=t[t[i]]):r=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],b=i.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,i=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],s=0;s<i;s++)if(s<r)a[s]=e[s];else{var o=a[s-1];s%r?r>6&&s%r==4&&(o=n[o>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o]):(o=n[(o=o<<8|o>>>24)>>>24]<<24|n[o>>>16&255]<<16|n[o>>>8&255]<<8|n[255&o],o^=p[s/r|0]<<24),a[s]=a[s-r]^o}for(var f=this._invKeySchedule=[],c=0;c<i;c++)s=i-c,o=c%4?a[s]:a[s-4],f[c]=c<4||s<=4?o:h[n[o>>>24]]^d[n[o>>>16&255]]^u[n[o>>>8&255]]^l[n[255&o]]}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,o,f,c,n)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,u,l,a),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,a,s,o){for(var f=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],d=t[e+2]^r[2],u=t[e+3]^r[3],l=4,p=1;p<f;p++){var b=i[c>>>24]^n[h>>>16&255]^a[d>>>8&255]^s[255&u]^r[l++],g=i[h>>>24]^n[d>>>16&255]^a[u>>>8&255]^s[255&c]^r[l++],y=i[d>>>24]^n[u>>>16&255]^a[c>>>8&255]^s[255&h]^r[l++],v=i[u>>>24]^n[c>>>16&255]^a[h>>>8&255]^s[255&d]^r[l++];c=b,h=g,d=y,u=v}b=(o[c>>>24]<<24|o[h>>>16&255]<<16|o[d>>>8&255]<<8|o[255&u])^r[l++],g=(o[h>>>24]<<24|o[d>>>16&255]<<16|o[u>>>8&255]<<8|o[255&c])^r[l++],y=(o[d>>>24]<<24|o[u>>>16&255]<<16|o[c>>>8&255]<<8|o[255&h])^r[l++],v=(o[u>>>24]<<24|o[c>>>16&255]<<16|o[h>>>8&255]<<8|o[255&d])^r[l++],t[e]=b,t[e+1]=g,t[e+2]=y,t[e+3]=v},keySize:8});e.AES=r._createHelper(b)}(),t.AES}(T(),U(),W(),vt(),_t())),Yt||(Yt=1,Zt.exports=function(t){return function(){var e=t,r=e.lib,i=r.WordArray,n=r.BlockCipher,a=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],f=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=n.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=s[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var c=n[a]=[],h=f[a];for(r=0;r<24;r++)c[r/6|0]|=e[(o[r]-1+h)%28]<<31-r%6,c[4+(r/6|0)]|=e[28+(o[r+24]-1+h)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],u.call(this,4,252645135),u.call(this,16,65535),l.call(this,2,858993459),l.call(this,8,16711935),u.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,s=this._rBlock,o=0,f=0;f<8;f++)o|=c[f][((s^n[f])&h[f])>>>0];this._lBlock=s,this._rBlock=a^o}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,u.call(this,1,1431655765),l.call(this,8,16711935),l.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<<t}function l(t,e){var r=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<<t}e.DES=n._createHelper(d);var p=a.TripleDES=n.extend({_doReset:function(){var t=this._key.words;this._des1=d.createEncryptor(i.create(t.slice(0,2))),this._des2=d.createEncryptor(i.create(t.slice(2,4))),this._des3=d.createEncryptor(i.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=n._createHelper(p)}(),t.TripleDES}(T(),U(),W(),vt(),_t())),Jt||(Jt=1,Qt.exports=function(t){return function(){var e=t,r=e.lib.StreamCipher,i=e.algo,n=i.RC4=r.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;n=0;for(var a=0;n<256;n++){var s=n%r,o=e[s>>>2]>>>24-s%4*8&255;a=(a+i[n]+o)%256;var f=i[n];i[n]=i[a],i[a]=f}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+t[e=(e+1)%256])%256;var a=t[e];t[e]=t[r],t[r]=a,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}e.RC4=r._createHelper(n);var s=i.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)a.call(this)}});e.RC4Drop=r._createHelper(s)}(),t.RC4}(T(),U(),W(),vt(),_t())),te||(te=1,ee.exports=function(t){return function(){var e=t,r=e.lib.StreamCipher,i=e.algo,n=[],a=[],s=[],o=i.Rabbit=r.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)f.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var a=e.words,s=a[0],o=a[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),d=c>>>16|4294901760&h,u=h<<16|65535&c;for(n[0]^=c,n[1]^=d,n[2]^=h,n[3]^=u,n[4]^=c,n[5]^=d,n[6]^=h,n[7]^=u,r=0;r<4;r++)f.call(this)}},_doProcessBlock:function(t,e){var r=this._X;f.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function f(){for(var t=this._X,e=this._C,r=0;r<8;r++)a[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<a[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<a[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<a[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<a[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<a[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<a[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<a[6]>>>0?1:0)|0,this._b=e[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,o=i>>>16,f=((n*n>>>17)+n*o>>>15)+o*o,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=f^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=r._createHelper(o)}(),t.Rabbit}(T(),U(),W(),vt(),_t())),re||(re=1,ie.exports=function(t){return function(){var e=t,r=e.lib.StreamCipher,i=e.algo,n=[],a=[],s=[],o=i.RabbitLegacy=r.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)f.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var a=e.words,s=a[0],o=a[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),d=c>>>16|4294901760&h,u=h<<16|65535&c;for(i[0]^=c,i[1]^=d,i[2]^=h,i[3]^=u,i[4]^=c,i[5]^=d,i[6]^=h,i[7]^=u,n=0;n<4;n++)f.call(this)}},_doProcessBlock:function(t,e){var r=this._X;f.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2});function f(){for(var t=this._X,e=this._C,r=0;r<8;r++)a[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<a[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<a[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<a[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<a[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<a[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<a[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<a[6]>>>0?1:0)|0,this._b=e[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,o=i>>>16,f=((n*n>>>17)+n*o>>>15)+o*o,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[r]=f^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=r._createHelper(o)}(),t.RabbitLegacy}(T(),U(),W(),vt(),_t())))),C.exports),oe=t({__proto__:null,default:E(se)},[se]),fe={exports:{}};function ce(){if(ae)return fe.exports;var t;function e(t){this.rand=t}if(ae=1,fe.exports=function(r){return t||(t=new e(null)),t.generate(r)},fe.exports.Rand=e,e.prototype.generate=function(t){return this._rand(t)},e.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=require("crypto");if("function"!=typeof r.randomBytes)throw new Error("Not supported");e.prototype._rand=function(t){return r.randomBytes(t)}}catch(t){}return fe.exports}var he,de,ue,le=E(ce()),pe={},be="6.6.1",ge={},ye={exports:{}},ve=ye.exports;function me(){return he||(he=1,function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function f(t,e,r,i){for(var n=0,a=Math.min(t.length,r),s=e;s<a;s++){var o=t.charCodeAt(s)-48;n*=i,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,e){return t.cmp(e)>0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,i):(this._parseBase(t,e,n),"le"===i&&this._initArray(this.toArray(),e,i)))},n.prototype._initNumber=function(t,e,i){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"===i&&this._initArray(this.toArray(),e,i)},n.prototype._initArray=function(t,e,i){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 a,s,o=0;if("be"===i)for(n=t.length-1,a=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,a=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=o(t,e,i)<<a,this.words[s]|=67108863&n,a>=18?(a-=18,s+=1,this.words[s]|=n>>>26):a+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=o(t,e,i)<<a,this.words[s]|=67108863&n,a>=18?(a-=18,s+=1,this.words[s]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var a=t.length-r,s=a%i,o=Math.min(a,a-s)+r,c=0,h=r;h<o;h+=i)c=f(t,h,h+i,e),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=f(t,h,t.length,e),h=0;h<s;h++)d*=e;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[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],d=[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 u(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],a=0|e.words[0],s=n*a,o=67108863&s,f=s/67108864|0;r.words[0]=o;for(var c=1;c<i;c++){for(var h=f>>>26,d=67108863&f,u=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=u;l++){var p=c-l|0;h+=(s=(n=0|t.words[p])*(a=0|e.words[l])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,f=0|h}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}n.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,a=0,s=0;s<this.length;s++){var o=this.words[s],f=(16777215&(o<<n|a)).toString(16);a=o>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==a||s!==this.length-1?c[6-f.length]+f+i:f+i}for(0!==a&&(i=a.toString(16)+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],l=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);i=(p=p.idivn(l)).isZero()?b+i:c[u-b.length]+b+i}for(this.isZero()&&(i="0"+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,e){return r(void 0!==a),this.toArrayLike(a,t,e)},n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,f="le"===e,c=new t(a),h=this.clone();if(f){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),c[o]=s;for(;o<a;o++)c[o]=0}else{for(o=0;o<a-n;o++)c[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),c[a-o-1]=s}return c},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},n.prototype.ior=function(t){return r(0===(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},n.prototype.iand=function(t){return r(0===(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},n.prototype.ixor=function(t){return r(0===(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,a=0;a<i.length;a++)e=(0|r.words[a])+(0|i.words[a])+n,this.words[a]=67108863&e,n=e>>>26;for(;0!==n&&a<r.length;a++)e=(0|r.words[a])+n,this.words[a]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},n.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var a=0,s=0;s<i.length;s++)a=(e=(0|r.words[s])-(0|i.words[s])+a)>>26,this.words[s]=67108863&e;for(;0!==a&&s<r.length;s++)a=(e=(0|r.words[s])+a)>>26,this.words[s]=67108863&e;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,a,s=t.words,o=e.words,f=r.words,c=0,h=0|s[0],d=8191&h,u=h>>>13,l=0|s[1],p=8191&l,b=l>>>13,g=0|s[2],y=8191&g,v=g>>>13,m=0|s[3],w=8191&m,_=m>>>13,S=0|s[4],M=8191&S,A=S>>>13,I=0|s[5],x=8191&I,E=I>>>13,k=0|s[6],C=8191&k,R=k>>>13,T=0|s[7],P=8191&T,z=T>>>13,B=0|s[8],K=8191&B,D=B>>>13,H=0|s[9],q=8191&H,N=H>>>13,O=0|o[0],F=8191&O,L=O>>>13,U=0|o[1],j=8191&U,$=U>>>13,W=0|o[2],V=8191&W,G=W>>>13,X=0|o[3],Y=8191&X,Z=X>>>13,J=0|o[4],Q=8191&J,tt=J>>>13,et=0|o[5],rt=8191&et,it=et>>>13,nt=0|o[6],at=8191&nt,st=nt>>>13,ot=0|o[7],ft=8191&ot,ct=ot>>>13,ht=0|o[8],dt=8191&ht,ut=ht>>>13,lt=0|o[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,L))+Math.imul(u,F)|0))<<13)|0;c=((a=Math.imul(u,L))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,L))+Math.imul(b,F)|0,a=Math.imul(b,L);var yt=(c+(i=i+Math.imul(d,j)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(u,j)|0))<<13)|0;c=((a=a+Math.imul(u,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,L))+Math.imul(v,F)|0,a=Math.imul(v,L),i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(b,j)|0,a=a+Math.imul(b,$)|0;var vt=(c+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(u,V)|0))<<13)|0;c=((a=a+Math.imul(u,G)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,L))+Math.imul(_,F)|0,a=Math.imul(_,L),i=i+Math.imul(y,j)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(v,j)|0,a=a+Math.imul(v,$)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(b,V)|0,a=a+Math.imul(b,G)|0;var mt=(c+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(u,Y)|0))<<13)|0;c=((a=a+Math.imul(u,Z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(M,F),n=(n=Math.imul(M,L))+Math.imul(A,F)|0,a=Math.imul(A,L),i=i+Math.imul(w,j)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,j)|0,a=a+Math.imul(_,$)|0,i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,G)|0)+Math.imul(v,V)|0,a=a+Math.imul(v,G)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,Z)|0;var wt=(c+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(u,Q)|0))<<13)|0;c=((a=a+Math.imul(u,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,L))+Math.imul(E,F)|0,a=Math.imul(E,L),i=i+Math.imul(M,j)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(A,j)|0,a=a+Math.imul(A,$)|0,i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,G)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,Z)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,tt)|0;var _t=(c+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(u,rt)|0))<<13)|0;c=((a=a+Math.imul(u,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,L))+Math.imul(R,F)|0,a=Math.imul(R,L),i=i+Math.imul(x,j)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(E,j)|0,a=a+Math.imul(E,$)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,G)|0)+Math.imul(A,V)|0,a=a+Math.imul(A,G)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,Z)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(b,rt)|0,a=a+Math.imul(b,it)|0;var St=(c+(i=i+Math.imul(d,at)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(u,at)|0))<<13)|0;c=((a=a+Math.imul(u,st)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(P,F),n=(n=Math.imul(P,L))+Math.imul(z,F)|0,a=Math.imul(z,L),i=i+Math.imul(C,j)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(R,j)|0,a=a+Math.imul(R,$)|0,i=i+Math.imul(x,V)|0,n=(n=n+Math.imul(x,G)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,G)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,Z)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(v,rt)|0,a=a+Math.imul(v,it)|0,i=i+Math.imul(p,at)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(b,at)|0,a=a+Math.imul(b,st)|0;var Mt=(c+(i=i+Math.imul(d,ft)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(u,ft)|0))<<13)|0;c=((a=a+Math.imul(u,ct)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(K,F),n=(n=Math.imul(K,L))+Math.imul(D,F)|0,a=Math.imul(D,L),i=i+Math.imul(P,j)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(z,j)|0,a=a+Math.imul(z,$)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(R,V)|0,a=a+Math.imul(R,G)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,Z)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,it)|0,i=i+Math.imul(y,at)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(v,at)|0,a=a+Math.imul(v,st)|0,i=i+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(b,ft)|0,a=a+Math.imul(b,ct)|0;var At=(c+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ut)|0)+Math.imul(u,dt)|0))<<13)|0;c=((a=a+Math.imul(u,ut)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(q,F),n=(n=Math.imul(q,L))+Math.imul(N,F)|0,a=Math.imul(N,L),i=i+Math.imul(K,j)|0,n=(n=n+Math.imul(K,$)|0)+Math.imul(D,j)|0,a=a+Math.imul(D,$)|0,i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(z,V)|0,a=a+Math.imul(z,G)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,Z)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,it)|0,i=i+Math.imul(w,at)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,st)|0,i=i+Math.imul(y,ft)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(v,ft)|0,a=a+Math.imul(v,ct)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(b,dt)|0,a=a+Math.imul(b,ut)|0;var It=(c+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,bt)|0)+Math.imul(u,pt)|0))<<13)|0;c=((a=a+Math.imul(u,bt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,j),n=(n=Math.imul(q,$))+Math.imul(N,j)|0,a=Math.imul(N,$),i=i+Math.imul(K,V)|0,n=(n=n+Math.imul(K,G)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,G)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,Z)|0,i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,it)|0,i=i+Math.imul(M,at)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,st)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ct)|0,i=i+Math.imul(y,dt)|0,n=(n=n+Math.imul(y,ut)|0)+Math.imul(v,dt)|0,a=a+Math.imul(v,ut)|0;var xt=(c+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((a=a+Math.imul(b,bt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,V),n=(n=Math.imul(q,G))+Math.imul(N,V)|0,a=Math.imul(N,G),i=i+Math.imul(K,Y)|0,n=(n=n+Math.imul(K,Z)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,Z)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,tt)|0,i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,it)|0,i=i+Math.imul(x,at)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,st)|0,i=i+Math.imul(M,ft)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(A,ft)|0,a=a+Math.imul(A,ct)|0,i=i+Math.imul(w,dt)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,dt)|0,a=a+Math.imul(_,ut)|0;var Et=(c+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,bt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((a=a+Math.imul(v,bt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,Y),n=(n=Math.imul(q,Z))+Math.imul(N,Y)|0,a=Math.imul(N,Z),i=i+Math.imul(K,Q)|0,n=(n=n+Math.imul(K,tt)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,it)|0,i=i+Math.imul(C,at)|0,n=(n=n+Math.imul(C,st)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,st)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ct)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(A,dt)|0,a=a+Math.imul(A,ut)|0;var kt=(c+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,bt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(N,Q)|0,a=Math.imul(N,tt),i=i+Math.imul(K,rt)|0,n=(n=n+Math.imul(K,it)|0)+Math.imul(D,rt)|0,a=a+Math.imul(D,it)|0,i=i+Math.imul(P,at)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,st)|0,i=i+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,ct)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ct)|0,i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(E,dt)|0,a=a+Math.imul(E,ut)|0;var Ct=(c+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,bt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((a=a+Math.imul(A,bt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(N,rt)|0,a=Math.imul(N,it),i=i+Math.imul(K,at)|0,n=(n=n+Math.imul(K,st)|0)+Math.imul(D,at)|0,a=a+Math.imul(D,st)|0,i=i+Math.imul(P,ft)|0,n=(n=n+Math.imul(P,ct)|0)+Math.imul(z,ft)|0,a=a+Math.imul(z,ct)|0,i=i+Math.imul(C,dt)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(R,dt)|0,a=a+Math.imul(R,ut)|0;var Rt=(c+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,bt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((a=a+Math.imul(E,bt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,at),n=(n=Math.imul(q,st))+Math.imul(N,at)|0,a=Math.imul(N,st),i=i+Math.imul(K,ft)|0,n=(n=n+Math.imul(K,ct)|0)+Math.imul(D,ft)|0,a=a+Math.imul(D,ct)|0,i=i+Math.imul(P,dt)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(z,dt)|0,a=a+Math.imul(z,ut)|0;var Tt=(c+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,bt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((a=a+Math.imul(R,bt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(q,ft),n=(n=Math.imul(q,ct))+Math.imul(N,ft)|0,a=Math.imul(N,ct),i=i+Math.imul(K,dt)|0,n=(n=n+Math.imul(K,ut)|0)+Math.imul(D,dt)|0,a=a+Math.imul(D,ut)|0;var Pt=(c+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,bt)|0)+Math.imul(z,pt)|0))<<13)|0;c=((a=a+Math.imul(z,bt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(q,dt),n=(n=Math.imul(q,ut))+Math.imul(N,dt)|0,a=Math.imul(N,ut);var zt=(c+(i=i+Math.imul(K,pt)|0)|0)+((8191&(n=(n=n+Math.imul(K,bt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((a=a+Math.imul(D,bt)|0)+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Bt=(c+(i=Math.imul(q,pt))|0)+((8191&(n=(n=Math.imul(q,bt))+Math.imul(N,pt)|0))<<13)|0;return c=((a=Math.imul(N,bt))+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,f[0]=gt,f[1]=yt,f[2]=vt,f[3]=mt,f[4]=wt,f[5]=_t,f[6]=St,f[7]=Mt,f[8]=At,f[9]=It,f[10]=xt,f[11]=Et,f[12]=kt,f[13]=Ct,f[14]=Rt,f[15]=Tt,f[16]=Pt,f[17]=zt,f[18]=Bt,0!==c&&(f[19]=c,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=u),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?l(this,t,e):i<63?u(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,a=0;a<r.length-1;a++){var s=n;n=0;for(var o=67108863&i,f=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=f;c++){var h=a-c,d=(0|t.words[h])*(0|e.words[c]),u=67108863&d;o=67108863&(u=u+o|0),n+=(s=(s=s+(d/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,t,e):p(this,t,e),r},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=n.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},b.prototype.permute=function(t,e,r,i,n,a){for(var s=0;s<a;s++)i[s]=e[t[s]],n[s]=r[t[s]]},b.prototype.transform=function(t,e,r,i,n,a){this.permute(a,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,f=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),h=0;h<n;h+=o)for(var d=f,u=c,l=0;l<s;l++){var p=r[h+l],b=i[h+l],g=r[h+l+s],y=i[h+l+s],v=d*g-u*y;y=d*y+u*g,g=v,r[h+l]=p+g,i[h+l]=b+y,r[h+l+s]=p-g,i[h+l+s]=b-y,l!==o&&(v=f*d-c*u,u=f*u+c*d,d=v)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},b.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},b.prototype.convert13b=function(t,e,i,n){for(var a=0,s=0;s<e;s++)a+=0|t[s],i[2*s]=8191&a,a>>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*e;s<n;++s)i[s]=0;r(0===a),r(!(-8192&a))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),a=this.stub(i),s=new Array(i),o=new Array(i),f=new Array(i),c=new Array(i),h=new Array(i),d=new Array(i),u=r.words;u.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,c,i),this.transform(s,a,o,f,i,n),this.transform(c,a,h,d,i,n);for(var l=0;l<i;l++){var p=o[l]*h[l]-f[l]*d[l];f[l]=o[l]*d[l]+f[l]*h[l],o[l]=p}return this.conjugate(o,f,i),this.transform(o,f,u,a,i,n),this.conjugate(u,a,i),this.normalize13b(u,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),p(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,i=0;i<this.length;i++){var n=(0|this.words[i])*t,a=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=a>>>26,this.words[i]=67108863&a}return 0!==e&&(this.words[i]=e,this.length++),this.length=0===t?1:this.length,this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var a=r.sqr();i<e.length;i++,a=a.sqr())0!==e[i]&&(r=r.mul(a));return r},n.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,i=t%26,n=(t-i)/26,a=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e<this.length;e++){var o=this.words[e]&a,f=(0|this.words[e])-o<<i;this.words[e]=f|s,s=o>>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,e,i){var n;r("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var a=t%26,s=Math.min((t-a)/26,this.length),o=67108863^67108863>>>a<<a,f=i;if(n-=s,n=Math.max(0,n),f){for(var c=0;c<s;c++)f.words[c]=this.words[c];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var d=0|this.words[c];this.words[c]=h<<26-a|d>>>a,h=d&o}return f&&0!==h&&(f.words[f.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<<e;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.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)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.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 e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,e,i){var n,a,s=t.length+i;this._expand(s);var o=0;for(n=0;n<t.length;n++){a=(0|this.words[n+i])+o;var f=(0|t.words[n])*e;o=((a-=67108863&f)>>26)-(f/67108864|0),this.words[n+i]=67108863&a}for(;n<this.length-i;n++)o=(a=(0|this.words[n+i])+o)>>26,this.words[n+i]=67108863&a;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n<this.length;n++)o=(a=-(0|this.words[n])+o)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),a=t,s=0|a.words[a.length-1];0!=(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,f=i.length-a.length;if("mod"!==e){(o=new n(null)).length=f+1,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var h=i.clone()._ishlnsubmul(a,1,f);0===h.negative&&(i=h,o&&(o.words[f]=1));for(var d=f-1;d>=0;d--){var u=67108864*(0|i.words[a.length+d])+(0|i.words[a.length+d-1]);for(u=Math.min(u/s|0,67108863),i._ishlnsubmul(a,u,d);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(a,1,d),i.isZero()||(i.negative^=1);o&&(o.words[d]=u)}return o&&o.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:a,mod:s}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!==(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(s=o.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:o.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,s,o},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},n.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new n(1),s=new n(0),o=new n(0),f=new n(1),c=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++c;for(var h=i.clone(),d=e.clone();!e.isZero();){for(var u=0,l=1;0===(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(h),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,b=1;0===(i.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(h),f.isub(d)),o.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),a.isub(o),s.isub(f)):(i.isub(e),o.isub(a),f.isub(s))}return{a:o,b:f,gcd:i.iushln(c)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,s=new n(1),o=new n(0),f=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var c=0,h=1;0===(e.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var d=0,u=1;0===(i.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(i.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(o)):(i.isub(e),o.isub(s))}return(a=0===e.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(t),a},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var a=e;e=r,r=a}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var a=n,s=i;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new S(t)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}y.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n<i;n++)e.words[n]=t.words[n];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=a&r,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(m,y),i(w,y),i(_,y),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new m;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),f=o.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new n(2*h*h).toRed(this);0!==this.pow(h,c).cmp(f);)h.redIAdd(f);for(var d=this.pow(h,a),u=this.pow(t,a.addn(1).iushrn(1)),l=this.pow(t,a),p=s;0!==l.cmp(o);){for(var b=l,g=0;0!==b.cmp(o);g++)b=b.redSqr();r(g<p);var y=this.pow(d,new n(1).iushln(p-g-1));u=u.redMul(y),d=y.redSqr(),l=l.redMul(d),p=g}return u},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new n(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var a=r[0],s=0,o=0,f=e.bitLength()%26;for(0===f&&(f=26),i=e.length-1;i>=0;i--){for(var c=e.words[i],h=f-1;h>=0;h--){var d=c>>h&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===i&&0===h)&&(a=this.mul(a,r[s]),o=0,s=0)):o=0}f=26}return a},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(ye,ve)),ye.exports}function we(){if(ue)return de;function t(t,e){if(!t)throw new Error(e||"Assertion failed")}return ue=1,de=t,t.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)},de}var _e,Se,Me={};function Ae(){return _e||(_e=1,function(){var t=Me;function e(t){return 1===t.length?"0"+t:t}function r(t){for(var r="",i=0;i<t.length;i++)r+=e(t[i].toString(16));return r}t.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),a=n>>8,s=255&n;a?r.push(a,s):r.push(s)}return r},t.zero2=e,t.toHex=r,t.encode=function(t,e){return"hex"===e?r(t):t}}()),Me}function Ie(){return Se||(Se=1,function(){var t=ge,e=me(),r=we(),i=Ae();t.assert=r,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(t,e,r){var i,n=new Array(Math.max(t.bitLength(),r)+1);for(i=0;i<n.length;i+=1)n[i]=0;var a=1<<e+1,s=t.clone();for(i=0;i<n.length;i++){var o,f=s.andln(a-1);s.isOdd()?(o=f>(a>>1)-1?(a>>1)-f:f,s.isubn(o)):o=0,n[i]=o,s.iushrn(1)}return n},t.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,a=0;t.cmpn(-n)>0||e.cmpn(-a)>0;){var s,o,f=t.andln(3)+n&3,c=e.andln(3)+a&3;3===f&&(f=-1),3===c&&(c=-1),s=1&f?3!==(i=t.andln(7)+n&7)&&5!==i||2!==c?f:-f:0,r[0].push(s),o=1&c?3!==(i=e.andln(7)+a&7)&&5!==i||2!==f?c:-c:0,r[1].push(o),2*n===s+1&&(n=1-n),2*a===o+1&&(a=1-a),t.iushrn(1),e.iushrn(1)}return r},t.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(t){return new e(t,"hex","le")}}()),ge}var xe,Ee,ke={};function Ce(){if(Ee)return xe;Ee=1;var t=me(),e=Ie(),r=e.getNAF,i=e.getJSF,n=e.assert;function a(e,r){this.type=e,this.p=new t(r.p,16),this.red=r.prime?t.red(r.prime):t.mont(this.p),this.zero=new t(0).toRed(this.red),this.one=new t(1).toRed(this.red),this.two=new t(2).toRed(this.red),this.n=r.n&&new t(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(t,e){this.curve=t,this.type=e,this.precomputed=null}return xe=a,a.prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(t,e){n(t.precomputed);var i=t._getDoubles(),a=r(e,1,this._bitLength),s=(1<<i.step+1)-(i.step%2==0?2:1);s/=3;var o,f,c=[];for(o=0;o<a.length;o+=i.step){f=0;for(var h=o+i.step-1;h>=o;h--)f=(f<<1)+a[h];c.push(f)}for(var d=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=s;l>0;l--){for(o=0;o<c.length;o++)(f=c[o])===l?u=u.mixedAdd(i.points[o]):f===-l&&(u=u.mixedAdd(i.points[o].neg()));d=d.add(u)}return d.toP()},a.prototype._wnafMul=function(t,e){var i=4,a=t._getNAFPoints(i);i=a.wnd;for(var s=a.points,o=r(e,i,this._bitLength),f=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var h=0;c>=0&&0===o[c];c--)h++;if(c>=0&&h++,f=f.dblp(h),c<0)break;var d=o[c];n(0!==d),f="affine"===t.type?d>0?f.mixedAdd(s[d-1>>1]):f.mixedAdd(s[-d-1>>1].neg()):d>0?f.add(s[d-1>>1]):f.add(s[-d-1>>1].neg())}return"affine"===t.type?f.toP():f},a.prototype._wnafMulAdd=function(t,e,n,a,s){var o,f,c,h=this._wnafT1,d=this._wnafT2,u=this._wnafT3,l=0;for(o=0;o<a;o++){var p=(c=e[o])._getNAFPoints(t);h[o]=p.wnd,d[o]=p.points}for(o=a-1;o>=1;o-=2){var b=o-1,g=o;if(1===h[b]&&1===h[g]){var y=[e[b],null,null,e[g]];0===e[b].y.cmp(e[g].y)?(y[1]=e[b].add(e[g]),y[2]=e[b].toJ().mixedAdd(e[g].neg())):0===e[b].y.cmp(e[g].y.redNeg())?(y[1]=e[b].toJ().mixedAdd(e[g]),y[2]=e[b].add(e[g].neg())):(y[1]=e[b].toJ().mixedAdd(e[g]),y[2]=e[b].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],m=i(n[b],n[g]);for(l=Math.max(m[0].length,l),u[b]=new Array(l),u[g]=new Array(l),f=0;f<l;f++){var w=0|m[0][f],_=0|m[1][f];u[b][f]=v[3*(w+1)+(_+1)],u[g][f]=0,d[b]=y}}else u[b]=r(n[b],h[b],this._bitLength),u[g]=r(n[g],h[g],this._bitLength),l=Math.max(u[b].length,l),l=Math.max(u[g].length,l)}var S=this.jpoint(null,null,null),M=this._wnafT4;for(o=l;o>=0;o--){for(var A=0;o>=0;){var I=!0;for(f=0;f<a;f++)M[f]=0|u[f][o],0!==M[f]&&(I=!1);if(!I)break;A++,o--}if(o>=0&&A++,S=S.dblp(A),o<0)break;for(f=0;f<a;f++){var x=M[f];0!==x&&(x>0?c=d[f][x-1>>1]:x<0&&(c=d[f][-x-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(o=0;o<a;o++)d[o]=null;return s?S:S.toP()},a.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},a.prototype.decodePoint=function(t,r){t=e.toArray(t,r);var i=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*i)return 6===t[0]?n(t[t.length-1]%2==0):7===t[0]&&n(t[t.length-1]%2==1),this.point(t.slice(1,1+i),t.slice(1+i,1+2*i));if((2===t[0]||3===t[0])&&t.length-1===i)return this.pointFromX(t.slice(1,1+i),3===t[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(t){return this.encode(t,!0)},s.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},s.prototype.encode=function(t,r){return e.encode(this._encode(r),t)},s.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},s.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},s.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var a=0;a<t;a++)i=i.dbl();r.push(i)}return{step:t,points:r}},s.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e},xe}var Re,Te,Pe,ze,Be,Ke,De,He,qe,Ne={exports:{}},Oe={exports:{}};function Fe(){if(Te)return Ne.exports;Te=1;try{var t=require("util");if("function"!=typeof t.inherits)throw"";Ne.exports=t.inherits}catch(t){Ne.exports=(Re||(Re=1,"function"==typeof Object.create?Oe.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Oe.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}),Oe.exports)}return Ne.exports}function Le(){return qe||(qe=1,function(t){var e=t;e.base=Ce(),e.short=function(){if(ze)return Pe;ze=1;var t=Ie(),e=me(),r=Fe(),i=Ce(),n=t.assert;function a(t){i.call(this,"short",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function s(t,r,n,a){i.BasePoint.call(this,t,"affine"),null===r&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(r,16),this.y=new e(n,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(t,r,n,a){i.BasePoint.call(this,t,"jacobian"),null===r&&null===n&&null===a?(this.x=this.curve.one,this.y=this.curve.one,this.z=new e(0)):(this.x=new e(r,16),this.y=new e(n,16),this.z=new e(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(a,i),Pe=a,a.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,i;if(t.beta)r=new e(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);r=(r=a[0].cmp(a[1])<0?a[0]:a[1]).toRed(this.red)}if(t.lambda)i=new e(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?i=s[0]:(i=s[1],n(0===this.g.mul(i).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:i,basis:t.basis?t.basis.map(function(t){return{a:new e(t.a,16),b:new e(t.b,16)}}):this._getEndoBasis(i)}}},a.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:e.mont(t),i=new e(2).toRed(r).redInvm(),n=i.redNeg(),a=new e(3).toRed(r).redNeg().redSqrt().redMul(i);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},a.prototype._getEndoBasis=function(t){for(var r,i,n,a,s,o,f,c,h,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=t,l=this.n.clone(),p=new e(1),b=new e(0),g=new e(0),y=new e(1),v=0;0!==u.cmpn(0);){var m=l.div(u);c=l.sub(m.mul(u)),h=g.sub(m.mul(p));var w=y.sub(m.mul(b));if(!n&&c.cmp(d)<0)r=f.neg(),i=p,n=c.neg(),a=h;else if(n&&2===++v)break;f=c,l=u,u=c,g=p,p=h,y=b,b=w}s=c.neg(),o=h;var _=n.sqr().add(a.sqr());return s.sqr().add(o.sqr()).cmp(_)>=0&&(s=r,o=i),n.negative&&(n=n.neg(),a=a.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:a},{a:s,b:o}]},a.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),o=a.mul(i.a),f=n.mul(r.b),c=a.mul(i.b);return{k1:t.sub(s).sub(o),k2:f.add(c).neg()}},a.prototype.pointFromX=function(t,r){(t=new e(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var a=n.fromRed().isOdd();return(r&&!a||!r&&a)&&(n=n.redNeg()),this.point(t,n)},a.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},a.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a<t.length;a++){var s=this._endoSplit(e[a]),o=t[a],f=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),i[2*a]=o,i[2*a+1]=f,n[2*a]=s.k1,n[2*a+1]=s.k2}for(var c=this._wnafMulAdd(1,i,n,2*a,r),h=0;h<2*a;h++)i[h]=null,n[h]=null;return c},r(s,i.BasePoint),a.prototype.point=function(t,e,r){return new s(this,t,e,r)},a.prototype.pointFromJSON=function(t,e){return s.fromJSON(this,t,e)},s.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},s.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},s.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var a=e[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(n))}},i},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.inf},s.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},s.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.prototype.mul=function(t){return t=new e(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},s.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},s.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},s.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},s.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(o,i.BasePoint),a.prototype.jpoint=function(t,e,r){return new o(this,t,e,r)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),o=i.redSub(n),f=a.redSub(s);if(0===o.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),h=c.redMul(o),d=i.redMul(c),u=f.redSqr().redIAdd(h).redISub(d).redISub(d),l=f.redMul(d.redISub(u)).redISub(a.redMul(h)),p=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(u,l,p)},o.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,a=t.y.redMul(e).redMul(this.z),s=r.redSub(i),o=n.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),h=r.redMul(f),d=o.redSqr().redIAdd(c).redISub(h).redISub(h),u=o.redMul(h.redISub(d)).redISub(n.redMul(c)),l=this.z.redMul(s);return this.curve.jpoint(d,u,l)},o.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,a=this.x,s=this.y,o=this.z,f=o.redSqr().redSqr(),c=s.redAdd(s);for(e=0;e<t;e++){var h=a.redSqr(),d=c.redSqr(),u=d.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(f)),p=a.redMul(d),b=l.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),y=l.redMul(g);y=y.redIAdd(y).redISub(u);var v=c.redMul(o);e+1<t&&(f=f.redMul(u)),a=b,o=v,c=y}return this.curve.jpoint(a,c.redMul(n),o)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},o.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i),f=o.redSqr().redISub(s).redISub(s),c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),t=f,e=o.redMul(s.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),d=this.y.redSqr(),u=d.redSqr(),l=this.x.redAdd(d).redSqr().redISub(h).redISub(u);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),b=p.redSqr(),g=u.redIAdd(u);g=(g=g.redIAdd(g)).redIAdd(g),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},o.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(a);s=s.redIAdd(s);var o=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),f=o.redSqr().redISub(s).redISub(s);t=f;var c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),e=o.redMul(s.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),d=this.y.redSqr(),u=this.x.redMul(d),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=u.redIAdd(u),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(h);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=l.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},o.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),a=e.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(t.redMul(n)),f=e.redAdd(e),c=(f=f.redIAdd(f)).redMul(s),h=o.redSqr().redISub(c.redAdd(c)),d=c.redISub(h),u=s.redSqr();u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=o.redMul(d).redISub(u),p=r.redAdd(r).redMul(i);return this.curve.jpoint(h,l,p)},o.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),a=n.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(i),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),f=i.redIAdd(i);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var c=n.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(f),h=e.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.x.redMul(o).redISub(h);d=(d=d.redIAdd(d)).redIAdd(d);var u=this.y.redMul(c.redMul(f.redISub(c)).redISub(s.redMul(o)));u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(d,u,l)},o.prototype.mul=function(t,r){return t=new e(t,r),this.curve._wnafMul(this,t)},o.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},o.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},o.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Pe}(),e.mont=function(){if(Ke)return Be;Ke=1;var t=me(),e=Fe(),r=Ce(),i=Ie();function n(e){r.call(this,"mont",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.i4=new t(4).toRed(this.red).redInvm(),this.two=new t(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function a(e,i,n){r.BasePoint.call(this,e,"projective"),null===i&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new t(i,16),this.z=new t(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return e(n,r),Be=n,n.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},e(a,r.BasePoint),n.prototype.decodePoint=function(t,e){return this.point(i.toArray(t,e),1)},n.prototype.point=function(t,e){return new a(this,t,e)},n.prototype.pointFromJSON=function(t){return a.fromJSON(this,t)},a.prototype.precompute=function(){},a.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},a.fromJSON=function(t,e){return new a(t,e[0],e[1]||t.one)},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},a.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},a.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),a=t.x.redSub(t.z).redMul(r),s=n.redMul(i),o=e.z.redMul(a.redAdd(s).redSqr()),f=e.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,f)},a.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},a.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},a.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Be}(),e.edwards=function(){if(He)return De;He=1;var t=Ie(),e=me(),r=Fe(),i=Ce(),n=t.assert;function a(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,i.call(this,"edwards",t),this.a=new e(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new e(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new e(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function s(t,r,n,a,s){i.BasePoint.call(this,t,"projective"),null===r&&null===n&&null===a?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new e(r,16),this.y=new e(n,16),this.z=a?new e(a,16):this.curve.one,this.t=s&&new e(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(a,i),De=a,a.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},a.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},a.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},a.prototype.pointFromX=function(t,r){(t=new e(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),n=this.c2.redSub(this.a.redMul(i)),a=this.one.redSub(this.c2.redMul(this.d).redMul(i)),s=n.redMul(a.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(r&&!f||!r&&f)&&(o=o.redNeg()),this.point(t,o)},a.prototype.pointFromY=function(t,r){(t=new e(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),n=i.redSub(this.c2),a=i.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(a.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==r&&(o=o.redNeg()),this.point(o,t)},a.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},r(s,i.BasePoint),a.prototype.pointFromJSON=function(t){return s.fromJSON(this,t)},a.prototype.point=function(t,e,r,i){return new s(this,t,e,r,i)},s.fromJSON=function(t,e){return new s(t,e[0],e[1],e[2])},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=i.redAdd(e),s=a.redSub(r),o=i.redSub(e),f=n.redMul(s),c=a.redMul(o),h=n.redMul(o),d=s.redMul(a);return this.curve.point(f,c,d,h)},s.prototype._projDbl=function(){var t,e,r,i,n,a,s=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var c=(i=this.curve._mulA(o)).redAdd(f);this.zOne?(t=s.redSub(o).redSub(f).redMul(c.redSub(this.curve.two)),e=c.redMul(i.redSub(f)),r=c.redSqr().redSub(c).redSub(c)):(n=this.z.redSqr(),a=c.redSub(n).redISub(n),t=s.redSub(o).redISub(f).redMul(a),e=c.redMul(i.redSub(f)),r=c.redMul(a))}else i=o.redAdd(f),n=this.curve._mulC(this.z).redSqr(),a=i.redSub(n).redSub(n),t=this.curve._mulC(s.redISub(i)).redMul(a),e=this.curve._mulC(i).redMul(o.redISub(f)),r=i.redMul(a);return this.curve.point(t,e,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),s=n.redSub(i),o=n.redAdd(i),f=r.redAdd(e),c=a.redMul(s),h=o.redMul(f),d=a.redMul(f),u=s.redMul(o);return this.curve.point(c,h,u,d)},s.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),a=this.x.redMul(t.x),s=this.y.redMul(t.y),o=this.curve.d.redMul(a).redMul(s),f=n.redSub(o),c=n.redAdd(o),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(s),d=i.redMul(f).redMul(h);return this.curve.twisted?(e=i.redMul(c).redMul(s.redSub(this.curve._mulA(a))),r=f.redMul(c)):(e=i.redMul(c).redMul(s.redSub(a)),r=this.curve._mulC(f).redMul(c)),this.curve.point(d,e,r)},s.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},s.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},s.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},s.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},s.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,De}()}(ke)),ke}var Ue,je={},$e={},We={};function Ve(){if(Ue)return We;Ue=1;var t=we(),e=Fe();function r(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function i(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function n(t){return 1===t.length?"0"+t:t}function a(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}return We.inherits=e,We.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),a=0;a<t.length;a+=2)i.push(parseInt(t[a]+t[a+1],16))}else for(var n=0,a=0;a<t.length;a++){var s=t.charCodeAt(a);s<128?i[n++]=s:s<2048?(i[n++]=s>>6|192,i[n++]=63&s|128):r(t,a)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++a)),i[n++]=s>>18|240,i[n++]=s>>12&63|128,i[n++]=s>>6&63|128,i[n++]=63&s|128):(i[n++]=s>>12|224,i[n++]=s>>6&63|128,i[n++]=63&s|128)}else for(a=0;a<t.length;a++)i[a]=0|t[a];return i},We.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e},We.htonl=i,We.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var s=t[n];"little"===e&&(s=i(s)),r+=a(s.toString(16))}return r},We.zero2=n,We.zero8=a,We.join32=function(e,r,i,n){var a=i-r;t(a%4==0);for(var s=new Array(a/4),o=0,f=r;o<s.length;o++,f+=4){var c;c="big"===n?e[f]<<24|e[f+1]<<16|e[f+2]<<8|e[f+3]:e[f+3]<<24|e[f+2]<<16|e[f+1]<<8|e[f],s[o]=c>>>0}return s},We.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var a=t[i];"big"===e?(r[n]=a>>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},We.rotr32=function(t,e){return t>>>e|t<<32-e},We.rotl32=function(t,e){return t<<e|t>>>32-e},We.sum32=function(t,e){return t+e>>>0},We.sum32_3=function(t,e,r){return t+e+r>>>0},We.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},We.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},We.sum64=function(t,e,r,i){var n=t[e],a=i+t[e+1]>>>0,s=(a<i?1:0)+r+n;t[e]=s>>>0,t[e+1]=a},We.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},We.sum64_lo=function(t,e,r,i){return e+i>>>0},We.sum64_4_hi=function(t,e,r,i,n,a,s,o){var f=0,c=e;return f+=(c=c+i>>>0)<e?1:0,f+=(c=c+a>>>0)<a?1:0,t+r+n+s+(f+=(c=c+o>>>0)<o?1:0)>>>0},We.sum64_4_lo=function(t,e,r,i,n,a,s,o){return e+i+a+o>>>0},We.sum64_5_hi=function(t,e,r,i,n,a,s,o,f,c){var h=0,d=e;return h+=(d=d+i>>>0)<e?1:0,h+=(d=d+a>>>0)<a?1:0,h+=(d=d+o>>>0)<o?1:0,t+r+n+s+f+(h+=(d=d+c>>>0)<c?1:0)>>>0},We.sum64_5_lo=function(t,e,r,i,n,a,s,o,f,c){return e+i+a+o+c>>>0},We.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},We.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},We.shr64_hi=function(t,e,r){return t>>>r},We.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},We}var Ge,Xe={};function Ye(){if(Ge)return Xe;Ge=1;var t=Ve(),e=we();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return Xe.BlockHash=r,r.prototype.update=function(e,r){if(e=t.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=t.join32(e,0,e.length-i,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},r.prototype.digest=function(t){return this.update(this._pad()),e(null===this.pending),this._digest(t)},r.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a<this.padLength;a++)i[n++]=0;return i},Xe}var Ze,Je,Qe,tr,er,rr,ir,nr,ar,sr,or,fr,cr={},hr={};function dr(){if(Ze)return hr;Ze=1;var t=Ve().rotr32;function e(t,e,r){return t&e^~t&r}function r(t,e,r){return t&e^t&r^e&r}function i(t,e,r){return t^e^r}return hr.ft_1=function(t,n,a,s){return 0===t?e(n,a,s):1===t||3===t?i(n,a,s):2===t?r(n,a,s):void 0},hr.ch32=e,hr.maj32=r,hr.p32=i,hr.s0_256=function(e){return t(e,2)^t(e,13)^t(e,22)},hr.s1_256=function(e){return t(e,6)^t(e,11)^t(e,25)},hr.g0_256=function(e){return t(e,7)^t(e,18)^e>>>3},hr.g1_256=function(e){return t(e,17)^t(e,19)^e>>>10},hr}function ur(){if(er)return tr;er=1;var t=Ve(),e=Ye(),r=dr(),i=we(),n=t.sum32,a=t.sum32_4,s=t.sum32_5,o=r.ch32,f=r.maj32,c=r.s0_256,h=r.s1_256,d=r.g0_256,u=r.g1_256,l=e.BlockHash,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;l.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return t.inherits(b,l),tr=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var r=this.W,l=0;l<16;l++)r[l]=t[e+l];for(;l<r.length;l++)r[l]=a(u(r[l-2]),r[l-7],d(r[l-15]),r[l-16]);var p=this.h[0],b=this.h[1],g=this.h[2],y=this.h[3],v=this.h[4],m=this.h[5],w=this.h[6],_=this.h[7];for(i(this.k.length===r.length),l=0;l<r.length;l++){var S=s(_,h(v),o(v,m,w),this.k[l],r[l]),M=n(c(p),f(p,b,g));_=w,w=m,m=v,v=n(y,S),y=g,g=b,b=p,p=n(S,M)}this.h[0]=n(this.h[0],p),this.h[1]=n(this.h[1],b),this.h[2]=n(this.h[2],g),this.h[3]=n(this.h[3],y),this.h[4]=n(this.h[4],v),this.h[5]=n(this.h[5],m),this.h[6]=n(this.h[6],w),this.h[7]=n(this.h[7],_)},b.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"big"):t.split32(this.h,"big")},tr}function lr(){if(ar)return nr;ar=1;var t=Ve(),e=Ye(),r=we(),i=t.rotr64_hi,n=t.rotr64_lo,a=t.shr64_hi,s=t.shr64_lo,o=t.sum64,f=t.sum64_hi,c=t.sum64_lo,h=t.sum64_4_hi,d=t.sum64_4_lo,u=t.sum64_5_hi,l=t.sum64_5_lo,p=e.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function g(){if(!(this instanceof g))return new g;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function y(t,e,r,i,n){var a=t&r^~t&n;return a<0&&(a+=4294967296),a}function v(t,e,r,i,n,a){var s=e&i^~e&a;return s<0&&(s+=4294967296),s}function m(t,e,r,i,n){var a=t&r^t&n^r&n;return a<0&&(a+=4294967296),a}function w(t,e,r,i,n,a){var s=e&i^e&a^i&a;return s<0&&(s+=4294967296),s}function _(t,e){var r=i(t,e,28)^i(e,t,2)^i(e,t,7);return r<0&&(r+=4294967296),r}function S(t,e){var r=n(t,e,28)^n(e,t,2)^n(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=i(t,e,14)^i(t,e,18)^i(e,t,9);return r<0&&(r+=4294967296),r}function A(t,e){var r=n(t,e,14)^n(t,e,18)^n(e,t,9);return r<0&&(r+=4294967296),r}function I(t,e){var r=i(t,e,1)^i(t,e,8)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=n(t,e,1)^n(t,e,8)^s(t,e,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=i(t,e,19)^i(e,t,29)^a(t,e,6);return r<0&&(r+=4294967296),r}function k(t,e){var r=n(t,e,19)^n(e,t,29)^s(t,e,6);return r<0&&(r+=4294967296),r}return t.inherits(g,p),nr=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=E(r[i-4],r[i-3]),a=k(r[i-4],r[i-3]),s=r[i-14],o=r[i-13],f=I(r[i-30],r[i-29]),c=x(r[i-30],r[i-29]),u=r[i-32],l=r[i-31];r[i]=h(n,a,s,o,f,c,u,l),r[i+1]=d(n,a,s,o,f,c,u,l)}},g.prototype._update=function(t,e){this._prepareBlock(t,e);var i=this.W,n=this.h[0],a=this.h[1],s=this.h[2],h=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],g=this.h[7],I=this.h[8],x=this.h[9],E=this.h[10],k=this.h[11],C=this.h[12],R=this.h[13],T=this.h[14],P=this.h[15];r(this.k.length===i.length);for(var z=0;z<i.length;z+=2){var B=T,K=P,D=M(I,x),H=A(I,x),q=y(I,x,E,k,C),N=v(I,x,E,k,C,R),O=this.k[z],F=this.k[z+1],L=i[z],U=i[z+1],j=u(B,K,D,H,q,N,O,F,L,U),$=l(B,K,D,H,q,N,O,F,L,U);B=_(n,a),K=S(n,a),D=m(n,a,s,h,d),H=w(n,a,s,h,d,p);var W=f(B,K,D,H),V=c(B,K,D,H);T=C,P=R,C=E,R=k,E=I,k=x,I=f(b,g,j,$),x=c(g,g,j,$),b=d,g=p,d=s,p=h,s=n,h=a,n=f(j,$,W,V),a=c(j,$,W,V)}o(this.h,0,n,a),o(this.h,2,s,h),o(this.h,4,d,p),o(this.h,6,b,g),o(this.h,8,I,x),o(this.h,10,E,k),o(this.h,12,C,R),o(this.h,14,T,P)},g.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"big"):t.split32(this.h,"big")},nr}function pr(){return fr||(fr=1,cr.sha1=function(){if(Qe)return Je;Qe=1;var t=Ve(),e=Ye(),r=dr(),i=t.rotl32,n=t.sum32,a=t.sum32_5,s=r.ft_1,o=e.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return t.inherits(c,o),Je=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.W,o=0;o<16;o++)r[o]=t[e+o];for(;o<r.length;o++)r[o]=i(r[o-3]^r[o-8]^r[o-14]^r[o-16],1);var c=this.h[0],h=this.h[1],d=this.h[2],u=this.h[3],l=this.h[4];for(o=0;o<r.length;o++){var p=~~(o/20),b=a(i(c,5),s(p,h,d,u),l,r[o],f[p]);l=u,u=d,d=i(h,30),h=c,c=b}this.h[0]=n(this.h[0],c),this.h[1]=n(this.h[1],h),this.h[2]=n(this.h[2],d),this.h[3]=n(this.h[3],u),this.h[4]=n(this.h[4],l)},c.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"big"):t.split32(this.h,"big")},Je}(),cr.sha224=function(){if(ir)return rr;ir=1;var t=Ve(),e=ur();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return t.inherits(r,e),rr=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h.slice(0,7),"big"):t.split32(this.h.slice(0,7),"big")},rr}(),cr.sha256=ur(),cr.sha384=function(){if(or)return sr;or=1;var t=Ve(),e=lr();function r(){if(!(this instanceof r))return new r;e.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return t.inherits(r,e),sr=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h.slice(0,12),"big"):t.split32(this.h.slice(0,12),"big")},sr}(),cr.sha512=lr()),cr}var br,gr,yr,vr,mr,wr,_r,Sr,Mr,Ar,Ir,xr,Er,kr,Cr,Rr,Tr,Pr,zr,Br,Kr,Dr,Hr={};function qr(){return vr||(vr=1,function(t){var e=t;e.utils=Ve(),e.common=Ye(),e.sha=pr(),e.ripemd=function(){if(br)return Hr;br=1;var t=Ve(),e=Ye(),r=t.rotl32,i=t.sum32,n=t.sum32_3,a=t.sum32_4,s=e.BlockHash;function o(){if(!(this instanceof o))return new o;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function c(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function h(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}t.inherits(o,s),Hr.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(t,e){for(var s=this.h[0],o=this.h[1],b=this.h[2],g=this.h[3],y=this.h[4],v=s,m=o,w=b,_=g,S=y,M=0;M<80;M++){var A=i(r(a(s,f(M,o,b,g),t[d[M]+e],c(M)),l[M]),y);s=y,y=g,g=r(b,10),b=o,o=A,A=i(r(a(v,f(79-M,m,w,_),t[u[M]+e],h(M)),p[M]),S),v=S,S=_,_=r(w,10),w=m,m=A}A=n(this.h[1],b,_),this.h[1]=n(this.h[2],g,S),this.h[2]=n(this.h[3],y,v),this.h[3]=n(this.h[4],s,m),this.h[4]=n(this.h[0],o,w),this.h[0]=A},o.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"little"):t.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return Hr}(),e.hmac=function(){if(yr)return gr;yr=1;var t=Ve(),e=we();function r(e,i,n){if(!(this instanceof r))return new r(e,i,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(t.toArray(i,n))}return gr=r,r.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),e(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=(new this.Hash).update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=(new this.Hash).update(t)},r.prototype.update=function(t,e){return this.inner.update(t,e),this},r.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},gr}(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}($e)),$e}function Nr(){return _r||(_r=1,function(t){var e,r=t,i=qr(),n=Le(),a=Ie().assert;function s(t){"short"===t.type?this.curve=new n.short(t):"edwards"===t.type?this.curve=new n.edwards(t):this.curve=new n.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var i=new s(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=s,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{e=wr?mr:(wr=1,mr={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(t){e=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",e]})}(je)),je}function Or(){if(Cr)return kr;Cr=1;var t=me(),e=function(){if(Mr)return Sr;Mr=1;var t=qr(),e=Ae(),r=we();function i(t){if(!(this instanceof i))return new i(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=e.toArray(t.entropy,t.entropyEnc||"hex"),a=e.toArray(t.nonce,t.nonceEnc||"hex"),s=e.toArray(t.pers,t.persEnc||"hex");r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,a,s)}return Sr=i,i.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new t.hmac(this.hash,this.K)},i.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(t,i,n,a){"string"!=typeof i&&(a=n,n=i,i=null),t=e.toArray(t,i),n=e.toArray(n,a),r(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},i.prototype.generate=function(t,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(n=i,i=r,r=null),i&&(i=e.toArray(i,n||"hex"),this._update(i));for(var a=[];a.length<t;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var s=a.slice(0,t);return this._update(i),this._reseed++,e.encode(s,r)},Sr}(),r=Ie(),i=Nr(),n=ce(),a=r.assert,s=function(){if(Ir)return Ar;Ir=1;var t=me(),e=Ie().assert;function r(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}return Ar=r,r.fromPublic=function(t,e,i){return e instanceof r?e:new r(t,{pub:e,pubEnc:i})},r.fromPrivate=function(t,e,i){return e instanceof r?e:new r(t,{priv:e,privEnc:i})},r.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},r.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(e,r){this.priv=new t(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(t,r){if(t.x||t.y)return"mont"===this.ec.curve.type?e(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||e(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,r)},r.prototype.derive=function(t){return t.validate()||e(t.validate(),"public point not validated"),t.mul(this.priv).getX()},r.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},r.prototype.verify=function(t,e,r){return this.ec.verify(t,e,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Ar}(),o=function(){if(Er)return xr;Er=1;var t=me(),e=Ie(),r=e.assert;function i(e,n){if(e instanceof i)return e;this._importDER(e,n)||(r(e.r&&e.s,"Signature without r or s"),this.r=new t(e.r,16),this.s=new t(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function n(){this.place=0}function a(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===t[e.place])return!1;for(var n=0,a=0,s=e.place;a<i;a++,s++)n<<=8,n|=t[s],n>>>=0;return!(n<=127)&&(e.place=s,n)}function s(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function o(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}return xr=i,i.prototype._importDER=function(r,i){r=e.toArray(r,i);var s=new n;if(48!==r[s.place++])return!1;var o=a(r,s);if(!1===o)return!1;if(o+s.place!==r.length)return!1;if(2!==r[s.place++])return!1;var f=a(r,s);if(!1===f)return!1;if(128&r[s.place])return!1;var c=r.slice(s.place,f+s.place);if(s.place+=f,2!==r[s.place++])return!1;var h=a(r,s);if(!1===h)return!1;if(r.length!==h+s.place)return!1;if(128&r[s.place])return!1;var d=r.slice(s.place,h+s.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new t(c),this.s=new t(d),this.recoveryParam=null,!0},i.prototype.toDER=function(t){var r=this.r.toArray(),i=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&i[0]&&(i=[0].concat(i)),r=s(r),i=s(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];o(n,r.length),(n=n.concat(r)).push(2),o(n,i.length);var a=n.concat(i),f=[48];return o(f,a.length),f=f.concat(a),e.encode(f,t)},xr}();function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(a(Object.prototype.hasOwnProperty.call(i,t),"Unknown curve "+t),t=i[t]),t instanceof i.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}return kr=f,f.prototype.keyPair=function(t){return new s(this,t)},f.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},f.prototype.genKeyPair=function(r){r||(r={});for(var i=new e({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||n(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),a=this.n.byteLength(),s=this.n.sub(new t(2));;){var o=new t(i.generate(a));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},f.prototype._truncateToN=function(e,r,i){var n;if(t.isBN(e)||"number"==typeof e)n=(e=new t(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new t(e,16);else{var a=e.toString();n=a.length+1>>>1,e=new t(a,16)}"number"!=typeof i&&(i=8*n);var s=i-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(r,i,n,s){if("object"==typeof n&&(s=n,n=null),s||(s={}),"string"!=typeof r&&"number"!=typeof r&&!t.isBN(r)){a("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),a(r.length>>>0===r.length);for(var f=0;f<r.length;f++)a((255&r[f])===r[f])}i=this.keyFromPrivate(i,n),r=this._truncateToN(r,!1,s.msgBitLength),a(!r.isNeg(),"Can not sign a negative message");var c=this.n.byteLength(),h=i.getPrivate().toArray("be",c),d=r.toArray("be",c);a(new t(d).eq(r),"Can not sign message");for(var u=new e({hash:this.hash,entropy:h,nonce:d,pers:s.pers,persEnc:s.persEnc||"utf8"}),l=this.n.sub(new t(1)),p=0;;p++){var b=s.k?s.k(p):new t(u.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(l)>=0)){var g=this.g.mul(b);if(!g.isInfinity()){var y=g.getX(),v=y.umod(this.n);if(0!==v.cmpn(0)){var m=b.invm(this.n).mul(v.mul(i.getPrivate()).iadd(r));if(0!==(m=m.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==y.cmp(v)?2:0);return s.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),w^=1),new o({r:v,s:m,recoveryParam:w})}}}}}},f.prototype.verify=function(t,e,r,i,n){n||(n={}),t=this._truncateToN(t,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var a=(e=new o(e,"hex")).r,s=e.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var f,c=s.invm(this.n),h=c.mul(t).umod(this.n),d=c.mul(a).umod(this.n);return this.curve._maxwellTrick?!(f=this.g.jmulAdd(h,r.getPublic(),d)).isInfinity()&&f.eqXToP(a):!(f=this.g.mulAdd(h,r.getPublic(),d)).isInfinity()&&0===f.getX().umod(this.n).cmp(a)},f.prototype.recoverPubKey=function(e,r,i,n){a((3&i)===i,"The recovery param is more than two bits"),r=new o(r,n);var s=this.n,f=new t(e),c=r.r,h=r.s,d=1&i,u=i>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");c=u?this.curve.pointFromX(c.add(this.curve.n),d):this.curve.pointFromX(c,d);var l=r.r.invm(s),p=s.sub(f).mul(l).umod(s),b=h.mul(l).umod(s);return this.g.mulAdd(p,c,b)},f.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new o(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(t,e,n)}catch(t){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")},kr}function Fr(){if(Kr)return Br;Kr=1;var t=qr(),e=Nr(),r=Ie(),i=r.assert,n=r.parseBytes,a=function(){if(Tr)return Rr;Tr=1;var t=Ie(),e=t.assert,r=t.parseBytes,i=t.cachedProperty;function n(t,e){this.eddsa=t,this._secret=r(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=r(e.pub)}return n.fromPublic=function(t,e){return e instanceof n?e:new n(t,{pub:e})},n.fromSecret=function(t,e){return e instanceof n?e:new n(t,{secret:e})},n.prototype.secret=function(){return this._secret},i(n,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(n,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(n,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),i(n,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(n,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(n,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),n.prototype.sign=function(t){return e(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},n.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},n.prototype.getSecret=function(r){return e(this._secret,"KeyPair is public only"),t.encode(this.secret(),r)},n.prototype.getPublic=function(e){return t.encode(this.pubBytes(),e)},Rr=n}(),s=function(){if(zr)return Pr;zr=1;var t=me(),e=Ie(),r=e.assert,i=e.cachedProperty,n=e.parseBytes;function a(e,i){this.eddsa=e,"object"!=typeof i&&(i=n(i)),Array.isArray(i)&&(r(i.length===2*e.encodingLength,"Signature has invalid size"),i={R:i.slice(0,e.encodingLength),S:i.slice(e.encodingLength)}),r(i.R&&i.S,"Signature without R or S"),e.isPoint(i.R)&&(this._R=i.R),i.S instanceof t&&(this._S=i.S),this._Rencoded=Array.isArray(i.R)?i.R:i.Rencoded,this._Sencoded=Array.isArray(i.S)?i.S:i.Sencoded}return i(a,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),i(a,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),i(a,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),i(a,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),a.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},a.prototype.toHex=function(){return e.encode(this.toBytes(),"hex").toUpperCase()},Pr=a}();function o(r){if(i("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof o))return new o(r);r=e[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=t.sha512}return Br=o,o.prototype.sign=function(t,e){t=n(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),a=this.g.mul(i),s=this.encodePoint(a),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),f=i.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:f,Rencoded:s})},o.prototype.verify=function(t,e,r){if(t=n(t),(e=this.makeSignature(e)).S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var i=this.keyFromPublic(r),a=this.hashInt(e.Rencoded(),i.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(i.pub().mul(a)).eq(s)},o.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return r.intFromLE(t.digest()).umod(this.curve.n)},o.prototype.keyFromPublic=function(t){return a.fromPublic(this,t)},o.prototype.keyFromSecret=function(t){return a.fromSecret(this,t)},o.prototype.makeSignature=function(t){return t instanceof s?t:new s(this,t)},o.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},o.prototype.decodePoint=function(t){var e=(t=r.parseBytes(t)).length-1,i=t.slice(0,e).concat(-129&t[e]),n=!!(128&t[e]),a=r.intFromLE(i);return this.curve.pointFromY(a,n)},o.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},o.prototype.decodeInt=function(t){return r.intFromLE(t)},o.prototype.isPoint=function(t){return t instanceof this.pointClass},Br}var Lr=(Dr||(Dr=1,function(t){var e=t;e.version=be,e.utils=Ie(),e.rand=ce(),e.curve=Le(),e.curves=Nr(),e.ec=Or(),e.eddsa=Fr()}(pe)),pe);(()=>{try{if(le&&le.Rand&&!le.Rand.prototype._miniProgramPatched){const t=le.Rand.prototype._rand;le.Rand.prototype._rand=function(e){if(this.rand&&this.rand.getBytes)try{return t.call(this,e)}catch(t){}try{if(oe&&se.lib&&se.lib.WordArray){const t=se.lib.WordArray.random(e),r=new Uint8Array(e);for(let i=0;i<e;i++){const e=Math.floor(i/4),n=i%4,a=t.words[e]||0;r[i]=a>>>24-8*n&255}return console.log("[elliptic-patched] Using crypto-js for secure random generation"),r}}catch(t){console.warn("[elliptic-patched] crypto-js random generation failed:",t)}const r=new Uint8Array(e);for(let t=0;t<r.length;t++)r[t]=Math.floor(256*Math.random());return console.log("[elliptic-patched] Using Math.random as fallback"),r},le.Rand.prototype._miniProgramPatched=!0,console.log("[elliptic-patched] brorand successfully patched for miniprogram with crypto-js support")}}catch(t){console.warn("[elliptic-patched] Failed to patch brorand:",t)}})();class Ur{constructor(){this.currentRegion=a}}const jr=t=>{};class $r extends Ur{constructor(){super(...arguments),this.captchaAppId="",this.securityKitComponent=null}setCaptchaComponent(t){this.securityKitComponent=t}challenge(t){return e(this,arguments,void 0,function*(t,e={}){const r=t||this.captchaAppId;if(!l(r)||!r)throw new o("The CaptCha appId is required.","CAPTCHA_APP_ID_REQUIRED");if(this.captchaAppId=r,this.currentRegion=e.region||this.currentRegion,!this.securityKitComponent)throw new o("Security kit component instance is not set","CAPTCHA_COMPONENT_NOT_SET");if("function"!=typeof this.securityKitComponent.showCaptcha)throw new o("Invalid security kit component: missing showCaptcha method","INVALID_CAPTCHA_COMPONENT");try{d.info("Starting captcha challenge with appId:",r);const t=yield this.securityKitComponent.showCaptcha({appId:r});return d.info("Captcha challenge completed",t),{Ticket:t.ticket,RandStr:t.randstr}}catch(t){const e=t instanceof Error?t.message:"Unknown captcha error",r=new o(e,"CAPTCHA_CHALLENGE_FAILED",t);throw d.error("Captcha challenge failed:",r),r}})}}class Wr extends Ur{constructor(){super(...arguments),this.channelId="",this.turingSDK=null,this.pageInstance=null}setPageInstance(t){this.pageInstance=t,d.info("[RCE] pageInstance set:",t?"exists":"null")}setTuringSDK(t){if(!t)throw new o("turingSDK instance is required. Please check your configuration.","TURING_SDK_REQUIRED");if("function"!=typeof t.init)throw new o('Invalid turingSDK instance: missing "init" method. Please check your turingSDK configuration.',"TURING_SDK_MISSING_INIT");if("function"!=typeof t.getDeviceTokenV3)throw new o('Invalid turingSDK instance: missing "getDeviceTokenV3" method. Please check your turingSDK configuration.',"TURING_SDK_MISSING_GET_DEVICE_TOKEN");d.info("turingSDK instance validated and set successfully"),this.turingSDK=t}challenge(t){return e(this,arguments,void 0,function*(t,e={}){const r=t||this.channelId;if(!r)throw new o("The RCE channelId is required.","RCE_CHANNEL_ID_REQUIRED");if(this.channelId=r,this.currentRegion=e.region||this.currentRegion,!this.turingSDK)throw new o('turingSDK is required for RCE challenge. Please pass rceTuringSDK property to security-kit component. Example: <security-kit rceTuringSDK="{{turingSDK}}" />',"TURING_SDK_NOT_SET");try{d.info("Starting RCE challenge via turingSDK"),yield new Promise((t,e)=>{this.turingSDK.init({channel:r},i=>{if(0===i.ret)d.info("[turingSDK.init] RCE SDK initialized successfully with channel:",r,i),t(!0);else{d.error("RCE SDK init failed:",i);const t=new o(`RCE SDK init failed: ${i.err||"Unknown error"}`,"RCE_INIT_ERROR",i);jr(t),e(t)}})});const t={};this.pageInstance?(t.page=this.pageInstance,d.info("[RCE] getDeviceTokenV3 with page/component instance")):d.warn("[RCE] getDeviceTokenV3 without page instance - this may cause Canvas lookup failure");const e=yield new Promise((e,r)=>{this.turingSDK.getDeviceTokenV3(t=>{if(t&&0===t.ret)d.info("[turingSDK.getDeviceTokenV3] RCE device token obtained successfully",t),e(t);else{d.error("Failed to get device token:",t);const e=new o("Failed to get device token","RCE_GET_TOKEN_ERROR",t);jr(e),r(e)}},!1,t)});return d.info("RCE challenge completed successfully"),{Ticket:e.deviceToken||e.token||"",Seq:e.seq||""}}catch(t){const e=t instanceof Error?t.message:"Unknown RCE error";d.error("RCE challenge failed:",t);throw new o(`RCE challenge failed: ${e}`,"RCE_CHALLENGE_FAILED",t)}})}}var Vr;!function(t){t.CAPTCHA="TC-CAPTCHA",t.RCE="TC-RCE"}(Vr||(Vr={}));class Gr{constructor(t,e,r,i,n){this.cryptoInstance=null,this.channelInstance=null,this.fallbackTokenInstance=null,this.captchaChallengeInstance=null,this.rceChallengeInstance=null,this.attestInfos=[],this.initAttesterManager=new w,this.fallbackTokenInstance=r,this.cryptoInstance=t,this.channelInstance=e,this.apiRequest=i,this.instanceId=n,this.captchaChallengeInstance=new $r,this.rceChallengeInstance=new Wr}setCaptchaComponent(t){this.captchaChallengeInstance.setCaptchaComponent(t)}setTuringSDK(t){this.rceChallengeInstance.setTuringSDK(t)}setPageInstance(t){this.rceChallengeInstance.setPageInstance(t)}challenge(t){return e(this,void 0,void 0,function*(){try{if(!t)throw new o("The attestId is required.","ATTEST_ID_REQUIRED");yield m(()=>this.initAttester(),{shouldRetryOnSuccess:e=>!e.find(e=>e.AttestId===t)&&(this.initAttesterManager.reset(),!0),maxRetries:1}),d.info("The challenge is starting...");const e=function(t,e=0){const r=Math.min(e+1,t.length),i=t.slice(0,r).padEnd(r,"_");let n=0;for(let e=r;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return n=n<<7|n>>>25,n>>>=0,`${i}${n.toString(16)}`}(`${this.instanceId}_${t}`),r=yield Gr.globalChallengeQueue.addTask(()=>m(()=>{const e=this.attestInfos.find(e=>e.AttestId===t);if(!e)throw new o(`The attestId '${t}' could not be found in the configuration.`,"ATTEST_ID_NOT_FOUND");const r=e.AttestType;switch(r){case Vr.CAPTCHA:return this.captchaChallenge(e);case Vr.RCE:return this.rceChallenge(e);default:{const t=Object.keys(Vr).map(t=>Vr[t]).join(", ");throw new o(`Unsupported challenge type: ${r}. Only [${t}] are supported.`,"UNSUPPORTED_CHALLENGE_TYPE")}}},{shouldRetryOnError:this.shouldRetryOnAttesterChanged.bind(this,t),maxRetries:1}),e);return d.info("The challenge is success!"),r}catch(e){d.info("The challenge is failed!");const r=`There was an error in the challenge: ${(null==e?void 0:e.message)||"Unknown error."}`,i=new o(r,"CHALLENGE_FAILED",e);return yield this.processErrorWithFallback(i,(null==e?void 0:e.code)||(null==i?void 0:i.code),{AttestId:t})}})}captchaChallenge(t){return e(this,void 0,void 0,function*(){try{if(!t.CaptchaAppId)throw new o("The CaptchaAppId is required.","CAPTCHA_CHALLENGE_INVALID_PARAM");const e=yield this.captchaChallengeInstance.challenge(t.CaptchaAppId);d.info("Captcha challenge succeeded:",e);return yield this.genToken({ticket:e.Ticket,attestId:t.AttestId,randStr:e.RandStr})}catch(e){if((null==e?void 0:e.code)===i)throw e;const r=`The Captcha challenge failed: ${(null==e?void 0:e.message)||"Unknown error."}`,n=new o(r,"CAPTCHA_CHALLENGE_FAILED",e);return yield this.processErrorWithFallback(n,(null==e?void 0:e.code)||(null==n?void 0:n.code),t)}})}rceChallenge(t){return e(this,void 0,void 0,function*(){try{if(!t.RceChannelId)throw new o("The RCE channelId is required.","RCE_CHALLENGE_INVALID_PARAM");const e=yield this.rceChallengeInstance.challenge(t.RceChannelId);d.info("RCE challenge succeeded:",e);return yield this.genToken({ticket:e.Ticket,attestId:t.AttestId})}catch(e){if((null==e?void 0:e.code)===i)throw e;const r=`The RCE challenge failed: ${(null==e?void 0:e.message)||"Unknown error."}`,n=new o(r,"RCE_CHALLENGE_FAILED",e);return yield this.processErrorWithFallback(n,(null==e?void 0:e.code)||(null==n?void 0:n.code),t)}})}genToken(t){return e(this,void 0,void 0,function*(){const{ticket:r,attestId:n,randStr:a=""}=t;try{if(!r)throw new o("The ticket is required.","GEN_TOKEN_INVALID_PARAM");const t=yield m(()=>e(this,void 0,void 0,function*(){var t;const e=yield this.cryptoInstance.encryptByAES(r);return yield this.apiRequest.apiRequest("RedeemToken",{Platform:"WeixinMP",OS:"wxmp",Ticket:{Data:e,RandStr:a},Key:null===(t=this.channelInstance.getChannelInfo())||void 0===t?void 0:t.SessionKey,AttestId:n})}),{shouldRetryOnError:this.shouldRetryOnSessionKeyExpired.bind(this)});if(!(null==t?void 0:t.Data))throw new o("Missing Data in response.","GEN_TOKEN_FAILED");return yield this.cryptoInstance.decryptByAES(t.Data)}catch(t){if((null==t?void 0:t.code)===i)throw t;const e=`Generate token failed: ${(null==t?void 0:t.message)||"Unknown error."}`,r=new o(e,"GEN_TOKEN_FAILED",t);return yield this.processErrorWithFallback(r,(null==t?void 0:t.code)||(null==r?void 0:r.code),{AttestId:n})}})}processErrorWithFallback(t,r,i){return e(this,void 0,void 0,function*(){d.error(t);return yield this.fallbackTokenInstance.generateFallbackToken({attestId:i.AttestId,errorCode:r})})}setAttesterInfos(t=[]){this.attestInfos=t}initAttester(){return e(this,void 0,void 0,function*(){return this.initAttesterManager.execute({initFn:()=>e(this,void 0,void 0,function*(){var t,e;(null===(t=this.channelInstance.getChannelInfo())||void 0===t?void 0:t.SessionKey)||(yield this.channelInstance.connectChannel());const r=yield m(()=>{var t;return this.apiRequest.apiRequest("InitializeAttester",{Key:null===(t=this.channelInstance.getChannelInfo())||void 0===t?void 0:t.SessionKey,Scope:"cn"})},{shouldRetryOnError:this.shouldRetryOnSessionKeyExpired.bind(this)});if(!(null==r?void 0:r.Data)){const t=new o("Missing Data in response.","INIT_ATTESTER_MISSING_DATA",r);throw d.error(t),t}const i=yield this.cryptoInstance.decryptByAES(r.Data),n=null===(e=null==i?void 0:i.split(";"))||void 0===e?void 0:e.filter(t=>!!t);if(!n||0===n.length){const t=new o("The Data in response is invalid.","INIT_ATTESTER_INVALID_DATA",r);throw d.error(t),t}const a=n.map(t=>{const[e,r,i,n,a]=t.split(",");if(!e||!r||!i&&!n)return null;return{AttestId:e,AttestType:r,CaptchaAppId:i,RceChannelId:n,default:a}}).filter(t=>!!t);return d.info("Attester info:",a),this.setAttesterInfos(a),a}),getInitializedValue:()=>Promise.resolve(this.attestInfos)})})}shouldRetryOnSessionKeyExpired(t){return e(this,void 0,void 0,function*(){try{if((null==t?void 0:t.code)===r)this.cryptoInstance.changeSuit(),yield this.channelInstance.connectChannel(!0);else if((null==t?void 0:t.code)===i)return!1;return!0}catch(t){return!1}})}shouldRetryOnAttesterChanged(t,r){return e(this,void 0,void 0,function*(){try{if((null==r?void 0:r.code)!==i)return!1;const e=null==r?void 0:r.message,n=yield this.cryptoInstance.decryptByAES(e).catch(()=>"");let a=!1;const s=[...this.attestInfos];if(l(n)&&n.length>0){const e=s.find(e=>e.AttestId===t);(null==e?void 0:e.AttestType)===Vr.CAPTCHA?(e.CaptchaAppId=n,a=!0):(null==e?void 0:e.AttestType)===Vr.RCE&&(e.RceChannelId=n,a=!0)}return a?this.setAttesterInfos(s):(this.initAttesterManager.reset(),yield this.initAttester()),!0}catch(t){return!1}})}}Gr.globalChallengeQueue=S.getInstance();class Xr{constructor(t,e){this.channelInfo={},this.cryptoInstance=null,this.channelAsyncInitializer=new w,this.cryptoInstance=t,this.apiRequest=e,this.connectChannel().catch(t=>{d.error(t)})}getChannelInfo(){return this.channelAsyncInitializer.isSuccess?this.channelInfo:null}setChannelInfo(t={}){this.channelInfo=Object.assign(Object.assign({},this.channelInfo),t)}resetChannelInfo(){this.channelInfo={}}connectChannel(t=!1){return t&&(this.channelAsyncInitializer.reset(),this.resetChannelInfo()),this.channelAsyncInitializer.execute({initFn:()=>e(this,void 0,void 0,function*(){d.info("The channel begin connecting..."),yield m(()=>this.connect()),d.info("The channel connect success!")}),getInitializedValue:()=>Promise.resolve(),onError:t=>{const e=t instanceof Error?t.message:"The channel connection failed.";return new o(e,"CHANNEL_CONNECT_ERROR",t)}})}connect(){return e(this,void 0,void 0,function*(){const t=yield this.establishShareKey(),{KDFKey:e,ServerPubKey:r,SessionKey:i}=t;this.setChannelInfo({SessionKey:i}),yield this.cryptoInstance.genAESSharedKey(e,r)})}establishShareKey(){return e(this,void 0,void 0,function*(){const t=this.cryptoInstance.getKDFSuit(),e=yield this.cryptoInstance.getMyECDHPublicKey(),r=this.cryptoInstance.getAESCryptoType(),i=yield this.apiRequest.apiRequest("EstablishShareKey",{Key:`${t};${e};${r}`});if(!(null==i?void 0:i.Key)){throw new o("EstablishShareKey failed: Missing Key in response.","ESTABLISH_SHARE_KEY_FAILED")}const[n="",a="",s=""]=i.Key.split(";");if(!n||!a||!s){throw new o("EstablishShareKey failed: The Key in response is invalid.","ESTABLISH_SHARE_KEY_FAILED")}return{KDFKey:n,ServerPubKey:a,SessionKey:s}})}}class Yr{constructor(){this.myPublicKey="",this.theirPublicKey="",this.originShareKey="",this.ecdhAsyncInitializer=new w}init(){return this.ecdhAsyncInitializer.execute({initFn:()=>e(this,void 0,void 0,function*(){this.ec=new Lr.ec("p256"),this.myKeyPair=this.ec.genKeyPair();const t=g(this.myKeyPair.getPublic("hex"));this.myPublicKey=v.encode(t)}),getInitializedValue:()=>Promise.resolve()})}checkInit(){return this.init()}getMyPublicKey(){return e(this,void 0,void 0,function*(){return yield this.checkInit(),this.myPublicKey})}getTheirPublicKey(){return e(this,void 0,void 0,function*(){return yield this.checkInit(),this.theirPublicKey})}genOriginSharedKey(t){return e(this,void 0,void 0,function*(){try{yield this.checkInit(),this.theirPublicKey=t;const e=this.ec.keyFromPublic(v.decode(this.theirPublicKey)).getPublic(),r=g(this.myKeyPair.derive(e).toString("hex",64)),i=v.encode(r);return this.originShareKey=i,this.originShareKey}catch(t){const e=t instanceof Error?t.message:"ECDHClass.getOriginSharedKey error";throw new o(e,"ECDH_GEN_ORIGIN_SHARED_KEY_ERROR",t)}})}}class Zr{}class Jr extends Zr{constructor(){super(...arguments),this.salt="",this.password="",this.iterations=1e4,this.keyLength=16,this.digest="SHA-256"}setConfig(t,e){this.salt=t,this.password=e}uint8ArrayToWordArray(t){const e=[];for(let r=0;r<t.length;r+=4){let i=0;for(let e=0;e<4&&r+e<t.length;e++)i=i<<8|t[r+e];e.push(i)}return se.lib.WordArray.create(e,t.length)}wordArrayToUint8Array(t){const e=t.words,r=t.sigBytes,i=new Uint8Array(r);for(let t=0;t<r;t++){const r=Math.floor(t/4),n=t%4;i[t]=e[r]>>>24-8*n&255}return i}pbkdf2CryptoJS(t,r,i,n,a){return e(this,void 0,void 0,function*(){try{const e=this.uint8ArrayToWordArray(t),s=this.uint8ArrayToWordArray(r);let o;switch(a){case"SHA3-512":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:64});break;case"SHA3-384":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:48});break;case"SHA3-256":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:32});break;case"SHA3-224":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA3,outputLength:28});break;case"SHA-512":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA512});break;case"SHA-384":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA384});break;case"SHA-1":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA1});break;case"MD5":o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.MD5});break;default:o=se.PBKDF2(e,s,{keySize:n/4,iterations:i,hasher:se.algo.SHA256})}return this.wordArrayToUint8Array(o)}catch(t){throw console.error("crypto-js PBKDF2 error:",t),t}})}genKey(){return e(this,void 0,void 0,function*(){try{const t=y(this.salt),e=v.decode(this.password),r=yield m(()=>this.pbkdf2CryptoJS(e,t,this.iterations,this.keyLength,this.digest));return v.encode(r)}catch(t){const e="The PBKdf2 genKey error.";return Promise.reject(new o(e,"PBKDF2_GEN_KEY_ERROR",t))}})}}class Qr extends Zr{constructor(){super(...arguments),this.salt="",this.password="",this.keyLength=16,this.digest="SHA-256",this.info=""}setConfig(t,e){this.salt=t,this.password=e}uint8ArrayToWordArray(t){const e=[];for(let r=0;r<t.length;r+=4){let i=0;for(let e=0;e<4&&r+e<t.length;e++)i=i<<8|t[r+e];e.push(i)}return se.lib.WordArray.create(e,t.length)}wordArrayToUint8Array(t){const e=t.words,r=t.sigBytes,i=new Uint8Array(r);for(let t=0;t<r;t++){const r=Math.floor(t/4),n=t%4;i[t]=e[r]>>>24-8*n&255}return i}getHashLength(t){switch(t){case"SHA3-512":case"SHA-512":return 64;case"SHA3-384":case"SHA-384":return 48;case"SHA3-256":case"SHA-256":default:return 32;case"SHA3-224":return 28;case"SHA-1":return 20;case"MD5":return 16}}hkdfExtract(t,e,r){const i=0===t.sigBytes?se.lib.WordArray.create(new Array(this.getHashLength(r)/4).fill(0),this.getHashLength(r)):t;return this.getHmacFunction(r)(e,i)}getHmacFunction(t){switch(t){case"SHA3-512":case"SHA3-384":case"SHA3-256":case"SHA3-224":case"SHA-256":default:return se.HmacSHA256;case"SHA-512":return se.HmacSHA512;case"SHA-384":return se.HmacSHA384;case"SHA-1":return se.HmacSHA1;case"MD5":return se.HmacMD5}}hkdfExpand(t,e,r,i){const n=this.getHashLength(i),a=Math.ceil(r/n),s=this.getHmacFunction(i);if(a>255)throw new Error("HKDF: requested length too large");let o=se.lib.WordArray.create([]),f=se.lib.WordArray.create([]);for(let r=1;r<=a;r++){const i=o.clone().concat(e).concat(se.lib.WordArray.create([r<<24],1));o=s(i,t),f=f.concat(o)}return f.sigBytes=r,f}hkdfCryptoJS(t,r,i,n,a){return e(this,void 0,void 0,function*(){try{const e=this.uint8ArrayToWordArray(t),s=this.uint8ArrayToWordArray(r),o=this.uint8ArrayToWordArray(i),f=this.hkdfExtract(s,e,a),c=this.hkdfExpand(f,o,n,a);return this.wordArrayToUint8Array(c)}catch(t){throw console.error("crypto-js HKDF error:",t),t}})}genKey(){return e(this,void 0,void 0,function*(){try{const t=y(this.salt),e=v.decode(this.password),r=y(this.info),i=yield m(()=>this.hkdfCryptoJS(e,t,r,this.keyLength,this.digest));return v.encode(i)}catch(t){const e="The HKDF genKey error.";return Promise.reject(new o(e,"HKDF_GEN_KEY_ERROR",t))}})}}class ti{constructor(){this.suitSalt="",this.ECDHKey="",this.lastKey="",this.suit=1,this.PBKdf2Instance=new Jr,this.HKdfInstance=new Qr}changeSuit(){const t=this.getSuit(),e=function(t){if(0===t.length)throw new Error("The Array cannot be empty.");return t[Math.floor(Math.random()*t.length)]}([2,1].filter(e=>e!==t));e&&this.setSuit(e)}setSuit(t){this.suit!==t&&(this.lastKey=""),this.suit=t}getSuit(){return Number(this.suit)}setECDHKey(t){this.ECDHKey=t}getECDHKey(){return this.ECDHKey}setSalt(t){this.suitSalt=t}getSalt(){return this.suitSalt}getInstance(){switch(this.suit){case 1:return this.PBKdf2Instance;case 2:return this.HKdfInstance;default:throw new o("Unknown KDF suite.","KDF_SUIT_ERROR")}}genKey(t,r){return e(this,void 0,void 0,function*(){try{if(this.lastKey)return this.lastKey;this.setECDHKey(r),this.setSalt(t);const e=this.getInstance();e.setConfig(this.suitSalt,this.ECDHKey);const i=yield e.genKey();return this.lastKey=i,i}catch(t){const e=t instanceof Error?t.message:"KDFSuit.genKey error. Please check the log.",r=new o(e,"KDF_GEN_KEY_ERROR",t);throw d.error(r),r}})}}class ei{}var ri,ii={exports:{}};var ni,ai=(ri||(ri=1,ni=ii,function(){function t(t){return parseInt(t)===t}function e(e){if(!t(e.length))return!1;for(var r=0;r<e.length;r++)if(!t(e[r])||e[r]<0||e[r]>255)return!1;return!0}function r(r,i){if(r.buffer&&"Uint8Array"===r.name)return i&&(r=r.slice?r.slice():Array.prototype.slice.call(r)),r;if(Array.isArray(r)){if(!e(r))throw new Error("Array contains invalid value: "+r);return new Uint8Array(r)}if(t(r.length)&&e(r))return new Uint8Array(r);throw new Error("unsupported array-like object")}function i(t){return new Uint8Array(t)}function n(t,e,r,i,n){null==i&&null==n||(t=t.slice?t.slice(i,n):Array.prototype.slice.call(t,i,n)),e.set(t,r)}var a,s={toBytes:function(t){var e=[],i=0;for(t=encodeURI(t);i<t.length;){var n=t.charCodeAt(i++);37===n?(e.push(parseInt(t.substr(i,2),16)),i+=2):e.push(n)}return r(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var i=t[r];i<128?(e.push(String.fromCharCode(i)),r++):i>191&&i<224?(e.push(String.fromCharCode((31&i)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&i)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},o=(a="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var i=t[r];e.push(a[(240&i)>>4]+a[15&i])}return e.join("")}}),f={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],u=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],l=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],p=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],v=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],m=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],_=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],S=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],M=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function A(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var I=function(t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:r(t,!0)}),this._prepare()};I.prototype._prepare=function(){var t=f[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,i=4*(t+1),n=this.key.length/4,a=A(this.key);for(e=0;e<n;e++)r=e>>2,this._Ke[r][e%4]=a[e],this._Kd[t-r][e%4]=a[e];for(var s,o=0,d=n;d<i;){if(s=a[n-1],a[0]^=h[s>>16&255]<<24^h[s>>8&255]<<16^h[255&s]<<8^h[s>>24&255]^c[o]<<24,o+=1,8!=n)for(e=1;e<n;e++)a[e]^=a[e-1];else{for(e=1;e<n/2;e++)a[e]^=a[e-1];for(s=a[n/2-1],a[n/2]^=h[255&s]^h[s>>8&255]<<8^h[s>>16&255]<<16^h[s>>24&255]<<24,e=n/2+1;e<n;e++)a[e]^=a[e-1]}for(e=0;e<n&&d<i;)u=d>>2,l=d%4,this._Ke[u][l]=a[e],this._Kd[t-u][l]=a[e++],d++}for(var u=1;u<t;u++)for(var l=0;l<4;l++)s=this._Kd[u][l],this._Kd[u][l]=w[s>>24&255]^_[s>>16&255]^S[s>>8&255]^M[255&s]},I.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=A(t),a=0;a<4;a++)n[a]^=this._Ke[0][a];for(var s=1;s<e;s++){for(a=0;a<4;a++)r[a]=u[n[a]>>24&255]^l[n[(a+1)%4]>>16&255]^p[n[(a+2)%4]>>8&255]^b[255&n[(a+3)%4]]^this._Ke[s][a];n=r.slice()}var o,f=i(16);for(a=0;a<4;a++)o=this._Ke[e][a],f[4*a]=255&(h[n[a]>>24&255]^o>>24),f[4*a+1]=255&(h[n[(a+1)%4]>>16&255]^o>>16),f[4*a+2]=255&(h[n[(a+2)%4]>>8&255]^o>>8),f[4*a+3]=255&(h[255&n[(a+3)%4]]^o);return f},I.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=A(t),a=0;a<4;a++)n[a]^=this._Kd[0][a];for(var s=1;s<e;s++){for(a=0;a<4;a++)r[a]=g[n[a]>>24&255]^y[n[(a+3)%4]>>16&255]^v[n[(a+2)%4]>>8&255]^m[255&n[(a+1)%4]]^this._Kd[s][a];n=r.slice()}var o,f=i(16);for(a=0;a<4;a++)o=this._Kd[e][a],f[4*a]=255&(d[n[a]>>24&255]^o>>24),f[4*a+1]=255&(d[n[(a+3)%4]>>16&255]^o>>16),f[4*a+2]=255&(d[n[(a+2)%4]>>8&255]^o>>8),f[4*a+3]=255&(d[255&n[(a+1)%4]]^o);return f};var x=function(t){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new I(t)};x.prototype.encrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16)n(t,a,0,s,s+16),n(a=this._aes.encrypt(a),e,s);return e},x.prototype.decrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16)n(t,a,0,s,s+16),n(a=this._aes.decrypt(a),e,s);return e};var E=function(t,e){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=i(16);this._lastCipherblock=r(e,!0),this._aes=new I(t)};E.prototype.encrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16){n(t,a,0,s,s+16);for(var o=0;o<16;o++)a[o]^=this._lastCipherblock[o];this._lastCipherblock=this._aes.encrypt(a),n(this._lastCipherblock,e,s)}return e},E.prototype.decrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=i(t.length),a=i(16),s=0;s<t.length;s+=16){n(t,a,0,s,s+16),a=this._aes.decrypt(a);for(var o=0;o<16;o++)e[s+o]=a[o]^this._lastCipherblock[o];n(t,this._lastCipherblock,0,s,s+16)}return e};var k=function(t,e,n){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 size)")}else e=i(16);n||(n=1),this.segmentSize=n,this._shiftRegister=r(e,!0),this._aes=new I(t)};k.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,i=r(t,!0),a=0;a<i.length;a+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var s=0;s<this.segmentSize;s++)i[a+s]^=e[s];n(this._shiftRegister,this._shiftRegister,0,this.segmentSize),n(i,this._shiftRegister,16-this.segmentSize,a,a+this.segmentSize)}return i},k.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,i=r(t,!0),a=0;a<i.length;a+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var s=0;s<this.segmentSize;s++)i[a+s]^=e[s];n(this._shiftRegister,this._shiftRegister,0,this.segmentSize),n(t,this._shiftRegister,16-this.segmentSize,a,a+this.segmentSize)}return i};var C=function(t,e){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=i(16);this._lastPrecipher=r(e,!0),this._lastPrecipherIndex=16,this._aes=new I(t)};C.prototype.encrypt=function(t){for(var e=r(t,!0),i=0;i<e.length;i++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[i]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},C.prototype.decrypt=C.prototype.encrypt;var R=function(t){if(!(this instanceof R))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=i(16),this.setValue(t)):this.setBytes(t)};R.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");if(t>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var e=15;e>=0;--e)this._counter[e]=t%256,t=parseInt(t/256)},R.prototype.setBytes=function(t){if(16!=(t=r(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},R.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var T=function(t,e){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof R||(e=new R(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new I(t)};T.prototype.encrypt=function(t){for(var e=r(t,!0),i=0;i<e.length;i++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[i]^=this._remainingCounter[this._remainingCounterIndex++];return e},T.prototype.decrypt=T.prototype.encrypt;var P={AES:I,Counter:R,ModeOfOperation:{ecb:x,cbc:E,cfb:k,ofb:C,ctr:T},utils:{hex:o,utf8:s},padding:{pkcs7:{pad:function(t){var e=16-(t=r(t,!0)).length%16,a=i(t.length+e);n(t,a);for(var s=t.length;s<a.length;s++)a[s]=e;return a},strip:function(t){if((t=r(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var a=t.length-e,s=0;s<e;s++)if(t[a+s]!==e)throw new Error("PKCS#7 invalid padding byte");var o=i(a);return n(t,o,0,0,a),o}}},_arrayTest:{coerceArray:r,createArray:i,copyArray:n}};ni.exports=P}()),ii.exports),si=E(ai);class oi extends ei{genIV(){try{if(void 0!==oe&&se.lib&&se.lib.WordArray){const t=se.lib.WordArray.random(16).words,e=new Uint8Array(16);for(let r=0;r<4;r++){const i=t[r];e[4*r]=i>>>24&255,e[4*r+1]=i>>>16&255,e[4*r+2]=i>>>8&255,e[4*r+3]=255&i}return e}}catch(t){console.warn("crypto-js IV generation failed, fallback to native crypto API:",t)}console.warn("Using Math.random for IV generation - not suitable for production");const t=new Uint8Array(16);for(let e=0;e<16;e++)t[e]=Math.floor(256*Math.random());return t}encrypt(t,r){return e(this,void 0,void 0,function*(){try{const e=this.genIV(),i=si.utils.utf8.toBytes(t),n=si.padding.pkcs7.pad(i),a=v.decode(r),s=new si.ModeOfOperation.cbc(a,e).encrypt(n),o=new Uint8Array(e.length+s.length);return o.set(e,0),o.set(s,e.length),v.encode(o)}catch(t){throw new o("AES CBC encryption failed","AES_CBC_ENCRYPT_ERROR",t)}})}decrypt(t,r){return e(this,void 0,void 0,function*(){try{const e=v.decode(r),i=v.decode(t),n=i.slice(0,16),a=i.slice(16),s=new si.ModeOfOperation.cbc(e,n).decrypt(a),o=si.padding.pkcs7.strip(s);return si.utils.utf8.fromBytes(o)}catch(t){throw new o("AES CBC decryption failed","AES_CBC_DECRYPT_ERROR",t)}})}}class fi{constructor(){this.aesType=2,this.cbcInstance=null,this.cbcInstance=new oi}getAESCryptoType(){return this.aesType}getInstance(){if(2===this.getAESCryptoType())return this.cbcInstance;throw new o("The AES type is invalid.","AES_TYPE_INVALID")}encrypt(t,e){if(!e)throw new o("The AES encryption key cannot be empty.","AES_ENCRYPT_ERROR");return this.getInstance().encrypt(t,e)}decrypt(t,e){if(!e)throw new o("The AES decryption key cannot be empty.","AES_DECRYPT_ERROR");return this.getInstance().decrypt(t,e)}}class ci{constructor(){this.originShareKey="",this.aesShareKey="",this.ECDHInstance=new Yr,this.KDFSuitInstance=new ti,this.AESInstance=new fi}changeSuit(){this.KDFSuitInstance.changeSuit()}getMyECDHPublicKey(){return this.ECDHInstance.getMyPublicKey()}getKDFSuit(){return this.KDFSuitInstance.getSuit()}getAESCryptoType(){return this.AESInstance.getAESCryptoType()}genOriginKeyByECDH(t){return e(this,void 0,void 0,function*(){let e=t;if(e||(e=yield this.ECDHInstance.getTheirPublicKey()),!e)throw new o("The PublicKey is required.","ECDH_PUBLIC_KEY_REQUIRED");try{return yield this.ECDHInstance.genOriginSharedKey(e)}catch(t){throw new o("The ECDH origin key gen failed.","ECDH_ORIGIN_KEY_GEN_FAILED",t)}})}genAESKeyByKDF(t){return e(this,void 0,void 0,function*(){if(!(t||this.KDFSuitInstance.getSalt()))throw new o("The KDFSalt is required.","KDF_SALT_REQUIRED");try{return yield this.KDFSuitInstance.genKey(t,this.originShareKey)}catch(t){throw new o("Failed to derive the AES shared key using the KDF suite.","DERIVE_AESSHAREKEY_BYKDF_FAILED",t)}})}genAESSharedKey(t,r){return e(this,void 0,void 0,function*(){try{return this.originShareKey=yield this.genOriginKeyByECDH(r),this.aesShareKey=yield this.genAESKeyByKDF(t),this.aesShareKey}catch(t){throw new o("The AESShareKey gen failed.","AES_SHARED_KEY_GEN_FAILED",t)}})}encryptByAES(t){return e(this,void 0,void 0,function*(){if(!this.aesShareKey)throw new o("The AESKey is not exists. Please call genAESSharedKey() first.","AES_KEY_NOT_EXISTS");try{return yield this.AESInstance.encrypt(t,this.aesShareKey)}catch(t){throw new o("The AES encrypt failed.","AES_ENCRYPT_FAILED",t)}})}decryptByAES(t){return e(this,void 0,void 0,function*(){if(!this.aesShareKey)throw new o("The AESKey is not exists. Please call genAESSharedKey() first.","AES_KEY_NOT_EXISTS");try{return yield this.AESInstance.decrypt(t,this.aesShareKey)}catch(t){throw new o("The AES decrypt failed.","AES_DECRYPT_FAILED",t)}})}}class hi{constructor(){this.prefix="s",this.platform="WeixinMP",this.version=1,this.AESInstance=new fi}generateNonce(){try{return se.lib.WordArray.random(16).toString(se.enc.Base64)}catch(t){d.error("Failed to generate nonce with crypto-js, using fallback method:",t);const e=new Uint8Array(16);for(let t=0;t<16;t++)e[t]=Math.floor(256*Math.random());return v.encode(e)}}generateAesKey(t){const e=y(t.replace(/^attest-/,"")),r=new Uint8Array(16);return r.fill(0),r.set(e.subarray(0,16),0),v.encode(r)}generateFallbackToken(){return e(this,arguments,void 0,function*(t={}){try{let{attestId:e,errorCode:r}=t;if(!e||!n.test(e))return"";r||(r="MPSDK_UNKNOWN_ERROR"),d.info("Starting to generate fallback token...");const i=this.generateAesKey(e),a=parseInt(String((new Date).getTime()/1e3)),s=this.generateNonce(),o=`${this.version},${e},${this.platform},${r},${a},${s}`,f=yield this.AESInstance.encrypt(o,i);return d.info("Fallback token generated successfully..."),`${this.prefix}${this.AESInstance.getAESCryptoType()}${f}`}catch(t){const e=new o(`Generate fallback token failed: ${t instanceof Error?t.message:"Unknown error."}`,"SDK_FALLBACK_TOKEN_GENERATE_FAILED",t);return d.error(e),""}})}}const di="AttesterTokenCaches";let ui=0;class li{constructor(){this.attesterTokens=[],this.turingSDK=null,this.captchaComponent=null,this.pageInstance=null,this.domain="",this.protocol="https",this.instanceId=`instance_${++ui}_${Date.now()}`,d.info(`[${this.instanceId}] Creating new EOClientSecurityKit instance`),this.instanceStorage=new x(`eo_kit_${this.instanceId}_`),d.info(`[${this.instanceId}] Instance storage created with isolated namespace`),this.apiRequest=new I(this.instanceId),d.info(`[${this.instanceId}] API request instance created`),this.fallbackTokenInstance=new hi,this.cryptoInstance=new ci,this.loadTokensFromStorage()}init(t){if(!(null==t?void 0:t.domain)||"string"!=typeof t.domain)throw new o("domain parameter is required for initialization. Please provide a valid domain string.","MISSING_DOMAIN");t.turingSDK&&(this.turingSDK=t.turingSDK),this.domain=t.domain,this.apiRequest.setDomain(t.domain),d.info(`[${this.instanceId}] Domain set to "${t.domain}"`),t.protocol&&(this.protocol=t.protocol,this.apiRequest.setProtocol(t.protocol),d.info(`[${this.instanceId}] Protocol set to "${t.protocol}"`)),this.channelInstance||(d.info(`[${this.instanceId}] Creating Channel and Action instances...`),this.channelInstance=new Xr(this.cryptoInstance,this.apiRequest),this.actionInstance=new Gr(this.cryptoInstance,this.channelInstance,this.fallbackTokenInstance,this.apiRequest,this.instanceId),this.turingSDK&&this.actionInstance.setTuringSDK(this.turingSDK),this.captchaComponent&&this.actionInstance.setCaptchaComponent(this.captchaComponent),this.pageInstance&&this.actionInstance.setPageInstance(this.pageInstance))}updateConfig(t){const{domain:e,protocol:r}=t;if(!this.channelInstance)return void d.warn(`[${this.instanceId}] SDK not initialized yet. Please call init() first.`);const i=void 0!==e&&e!==this.domain,n=void 0!==r&&r!==this.protocol;if(!i&&!n)return void d.info(`[${this.instanceId}] No config changes detected`);const a=this.domain,s=this.protocol;i&&(this.domain=e,this.apiRequest.setDomain(e),d.info(`[${this.instanceId}] Domain changed from "${a}" to "${e}"`)),n&&(this.protocol=r,this.apiRequest.setProtocol(r),d.info(`[${this.instanceId}] Protocol changed from "${s}" to "${r}"`)),d.info(`[${this.instanceId}] Config updated, reinitializing SDK...`),this.reinitialize()}setCaptchaComponent(t){this.captchaComponent=t,this.actionInstance&&this.actionInstance.setCaptchaComponent(t)}setTuringSDK(t){this.turingSDK=t,this.actionInstance&&this.actionInstance.setTuringSDK(t)}setPageInstance(t){this.pageInstance=t,this.actionInstance&&this.actionInstance.setPageInstance(t)}setDomain(t){this.updateConfig({domain:t})}getDomain(){return this.domain}setProtocol(t){this.updateConfig({protocol:t})}getProtocol(){return this.protocol}reinitialize(){d.info(`[${this.instanceId}] Reinitializing SDK due to domain/protocol change...`),this.clearToken(),this.fallbackTokenInstance=new hi,this.cryptoInstance=new ci,this.channelInstance=new Xr(this.cryptoInstance,this.apiRequest),this.actionInstance=new Gr(this.cryptoInstance,this.channelInstance,this.fallbackTokenInstance,this.apiRequest,this.instanceId),this.turingSDK&&this.actionInstance.setTuringSDK(this.turingSDK),this.captchaComponent&&this.actionInstance.setCaptchaComponent(this.captchaComponent),this.pageInstance&&this.actionInstance.setPageInstance(this.pageInstance),d.info(`[${this.instanceId}] SDK reinitialization completed`)}getAttestationToken(){if(this.cleanExpiredTokens(),0===this.attesterTokens.length||this.attesterTokens.every(t=>!t.value))return"";const t=this.attesterTokens.filter(t=>!this.isTokenExpired(t)).map(t=>`${t.key}:${t.value}`),e=t.join(";");return d.info(`[${this.instanceId}] Generated attestation token with ${t.length} valid tokens`),e}challenge(t){return e(this,void 0,void 0,function*(){if(!l(t)||!n.test(t))throw new o(`The attestId is invalid, expect string like "attest-xxx", but got "${t}".`,"INVALID_ATTEST_ID");try{d.info(`[${this.instanceId}] Starting challenge for attestId: ${t}`);const e=yield this.actionInstance.challenge(t);if(l(e)&&e.length>0)return this.addAttesterToken(t,e),d.info(`[${this.instanceId}] Challenge completed successfully for attestId: ${t}`),e;throw new o("Invalid token received from challenge","INVALID_CHALLENGE_TOKEN")}catch(e){throw d.error(`[${this.instanceId}] Challenge failed for attestId: ${t}`,e),e}})}clearToken(){this.instanceStorage.removeItem(di),this.attesterTokens=[],d.info(`[${this.instanceId}] All attestation tokens cleared (memory + storage)`)}addAttesterToken(t,e){const r=this.attesterTokens.find(e=>e.key===t),i=s.test(e),n=Date.now();r?(r.value=e,r.timestamp=n,r.isFallbackToken=i):this.attesterTokens.push({key:t,value:e,isFallbackToken:i,timestamp:n}),this.saveTokensToStorage()}isTokenExpired(t){if(!t.isFallbackToken)return!1;return Date.now()-t.timestamp>3e4}cleanExpiredTokens(){const t=this.attesterTokens.length;this.attesterTokens=this.attesterTokens.filter(t=>!this.isTokenExpired(t));const e=t-this.attesterTokens.length;e>0&&(this.saveTokensToStorage(),d.info(`[${this.instanceId}] Cleaned ${e} expired tokens`))}loadTokensFromStorage(){return e(this,void 0,void 0,function*(){try{const t=yield this.instanceStorage.getItem(di);t&&Array.isArray(t)&&(this.attesterTokens=t.filter(t=>t.key&&t.value),d.info(`[${this.instanceId}] Loaded ${this.attesterTokens.length} tokens from instance storage`))}catch(t){d.error(`[${this.instanceId}] Failed to load tokens from storage:`,t),this.attesterTokens=[]}})}saveTokensToStorage(){return e(this,void 0,void 0,function*(){try{const t=this.attesterTokens.filter(t=>!t.isFallbackToken);yield this.instanceStorage.setItem(di,t)}catch(t){d.error(`[${this.instanceId}] Failed to save tokens to storage:`,t)}})}}Component({behaviors:["wx://component-export"],export(){return{getToken:this.getToken.bind(this),verify:this.verify.bind(this),clearToken:this.clearToken.bind(this)}},properties:{domain:{type:String,value:"",observer:function(t,e){t&&t!==e&&"ready"===this.data.status&&(d.info("Component domain changed from:",e,"to:",t),this.handleDomainChange(t,e))}},protocol:{type:String,value:"https",observer:function(t,e){t&&t!==e&&"ready"===this.data.status&&(d.info("Component protocol changed from:",e,"to:",t),this.handleProtocolChange(t))}},rceTuringSDK:{type:Object,value:null},rcePageInstance:{type:Object,value:null},captchaProperties:{type:Object,value:{size:"normal",lang:"zh-CN",themeColor:"#1A79FF"},observer:function(t){t&&d.info("Captcha properties updated:",t)}}},data:{status:"idle",errorMsg:"",tokenInfo:{attestationToken:"",lastUpdated:0},domainInfo:{domain:"",setTime:0},captchaAppId:""},lifetimes:{attached(){d.info("Component attached"),this.eoKit=new li,this.setData({"domainInfo.domain":this.properties.domain||"","domainInfo.setTime":Date.now()}),setTimeout(()=>{this.autoInitialize()},0)},detached(){d.info("Component detached"),this.cleanup(),this.eoKit&&this.eoKit.clearToken()}},pageLifetimes:{show(){d.info("Page show"),this.refreshTokenDisplay()},hide(){d.info("Page hide")}},methods:{getToken(){return this.eoKit.getAttestationToken()},verify(t){return e(this,void 0,void 0,function*(){try{const e=yield this.eoKit.challenge(t);return this.triggerEvent("verifysuccess",{attestId:t,token:e,timestamp:Date.now()}),e}catch(e){return d.error("Verify failed:",e),this.triggerEvent("verifyfailed",{attestId:t,error:null==e?void 0:e.message,timestamp:Date.now()}),Promise.reject(e)}})},clearToken(){this.eoKit.clearToken()},_init(){return e(this,arguments,void 0,function*(t={}){try{this.setData({status:"initializing"});const e=t.rceTuringSDK||this.properties.rceTuringSDK,r=this.properties.domain;if(!r){const t="domain property is required. Please set the domain property on the security-kit component.";return d.error(t),this.setData({status:"error",errorMsg:t}),Promise.reject(new Error(t))}this.eoKit.init({turingSDK:e||void 0,domain:r,protocol:this.properties.protocol||"https"}),this.eoKit.setCaptchaComponent(this),d.info("Security kit component injected successfully");const i=t.rcePageInstance||this.properties.rcePageInstance||this;return this.eoKit.setPageInstance(i),d.info("RCE page instance set successfully (default: component self)"),this.setData({status:"ready"}),this.triggerEvent("ready",{timestamp:Date.now()}),Promise.resolve()}catch(t){return d.error("Initialization failed:",t),this.setData({status:"error",errorMsg:(null==t?void 0:t.message)||"Unknown error"}),this.triggerEvent("error",{error:t}),Promise.reject(t)}})},handleDomainChange(t,e){d.info("Domain changed from:",e,"to:",t),this._pendingConfigUpdate||(this._pendingConfigUpdate={}),this._pendingConfigUpdate.domain=t,this._configUpdateTimer&&clearTimeout(this._configUpdateTimer),this._configUpdateTimer=setTimeout(()=>{this.flushConfigUpdate()},0)},handleProtocolChange(t){d.info("Protocol changed to:",t),this._pendingConfigUpdate||(this._pendingConfigUpdate={}),this._pendingConfigUpdate.protocol=t,this._configUpdateTimer&&clearTimeout(this._configUpdateTimer),this._configUpdateTimer=setTimeout(()=>{this.flushConfigUpdate()},0)},flushConfigUpdate(){if(!this._pendingConfigUpdate||!this.eoKit)return void(this._pendingConfigUpdate=null);const{domain:t,protocol:e}=this._pendingConfigUpdate;this._pendingConfigUpdate=null,this._configUpdateTimer=null,d.info("Flushing config update:",{domain:t,protocol:e}),this.eoKit.updateConfig({domain:t,protocol:e}),t&&this.setData({"domainInfo.domain":t,"domainInfo.setTime":Date.now(),captchaAppId:"","tokenInfo.attestationToken":"","tokenInfo.lastUpdated":Date.now()})},autoInitialize(){return e(this,void 0,void 0,function*(){try{yield this._init()}catch(t){d.error("Auto initialization failed:",t)}})},showCaptcha(t){return e(this,void 0,void 0,function*(){return new Promise((e,r)=>{this.setData({captchaAppId:t.appId}),setTimeout(()=>{var t;const i=this.selectComponent("#captcha");i?(this._captchaTimeout=setTimeout(()=>{r(new Error("Captcha verification timeout")),this._captchaTimeout=null,this._pendingCaptchaResolve=null,this._pendingCaptchaReject=null},6e4),this._pendingCaptchaResolve=e,this._pendingCaptchaReject=r,null===(t=i.show)||void 0===t||t.call(i)):r(new Error('Captcha component not found. Please inject captcha component via generic:captcha-component="t-captcha"'))},100)})})},refreshTokenDisplay(){const t=this.eoKit.getAttestationToken();t!==this.data.tokenInfo.attestationToken&&this.setData({"tokenInfo.attestationToken":t,"tokenInfo.lastUpdated":Date.now()})},handlerCaptchaVerify(t){0===t.detail.ret&&this._pendingCaptchaResolve&&(this._pendingCaptchaResolve({ticket:t.detail.ticket,randstr:t.detail.randstr}),this._pendingCaptchaResolve=null,this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._captchaTimeout=null)},handlerCaptchaReady(){d.info("Captcha component ready")},handlerCaptchaClose(t){t&&t.detail&&2===t.detail.ret?this._pendingCaptchaReject&&(this._pendingCaptchaReject(new Error("User cancelled captcha")),this._pendingCaptchaReject=null,this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._captchaTimeout=null):d.info("Captcha verification completed")},handlerCaptchaError(t){d.error("Captcha error:",t.detail.errMsg),this._pendingCaptchaReject&&(this._pendingCaptchaReject(new Error(t.detail.errMsg)),this._pendingCaptchaReject=null,this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._captchaTimeout=null)},cleanup(){this._captchaTimeout&&clearTimeout(this._captchaTimeout),this._configUpdateTimer&&clearTimeout(this._configUpdateTimer),this._pendingCaptchaResolve&&(this._pendingCaptchaResolve=null),this._pendingCaptchaReject&&(this._pendingCaptchaReject=null),this._pendingConfigUpdate=null}}});
|