@dcl/builder-site 7.2.1 → 7.2.2
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.
- package/assets/{Back-BJi2deng.js → Back-DtK6x4Bn.js} +1 -1
- package/assets/{CollectionProvider.container-S7TwnaYa.js → CollectionProvider.container-CXdA94fU.js} +1 -1
- package/assets/{CollectionStatus.container-Bt_3fJiK.js → CollectionStatus.container-CKYVdJgB.js} +1 -1
- package/assets/{ConfirmDelete-t9nvFRtI.js → ConfirmDelete-BE0vH5uM.js} +1 -1
- package/assets/{FileSaver.min-CLucrmh1.js → FileSaver.min-dYVWgoJI.js} +1 -1
- package/assets/{ItemProvider.container-BxFpMAym.js → ItemProvider.container-C_ird2Zu.js} +1 -1
- package/assets/{JumpIn.container-BDuzzlQd.js → JumpIn.container-DjpgxX_c.js} +1 -1
- package/assets/{LandAction-6prp6OtG.js → LandAction-33UdtFZb.js} +1 -1
- package/assets/{LandProviderPage-uQEQcWUB.js → LandProviderPage-fMqWevKT.js} +1 -1
- package/assets/{LoggedInDetailPage.container-Cp2VcxxY.js → LoggedInDetailPage.container-BLvSpUqS.js} +1 -1
- package/assets/{Navigation-N5s3jc7p.css → Navigation-CumA_dnJ.css} +1 -1
- package/assets/{Navigation.container-CPkNf2QL.js → Navigation.container-C54rXpIm.js} +1 -1
- package/assets/{NotFound-D4LnQbRF.js → NotFound-CWDykcSQ.js} +1 -1
- package/assets/{OptionsDropdown-C6_LhYKO.js → OptionsDropdown-C7AtDOm3.js} +1 -1
- package/assets/{RentalPeriod-BbEOmAsT.js → RentalPeriod-BqEjSl0y.js} +1 -1
- package/assets/{SDKTag-mgVMhaWr.js → SDKTag-BLT7PlWy.js} +1 -1
- package/assets/{SceneStats.container-B6dn3bXo.js → SceneStats.container-DA0XO8U0.js} +1 -1
- package/assets/{SignInRequired-C13PYv-8.js → SignInRequired-vn0lyw6H.js} +1 -1
- package/assets/{ThirdPartyKindBadge-DfcaD8hC.js → ThirdPartyKindBadge-DSlG5fJU.js} +1 -1
- package/assets/{dataReader-Cfy83NJj.js → dataReader-Cpr013wV.js} +1 -1
- package/assets/{date-Dp-8ZdTY.js → date-BhOAIsCu.js} +1 -1
- package/assets/{fortmatic-BppYrTpx.js → fortmatic-CM_hH-QZ.js} +1 -1
- package/assets/{index-C262n0GR.js → index-23gqgSsS.js} +1 -1
- package/assets/{index-CKmaAyse.js → index-4bvVCOPT.js} +1 -1
- package/assets/{index-67k0pvNC.js → index-9p_FZzqu.js} +1 -1
- package/assets/{index-CHS_1sWp.css → index-AmjEp0WZ.css} +1 -1
- package/assets/{index-B2uoPAxz.js → index-B15QgiWh.js} +1 -1
- package/assets/{index-BDG2fKsI.js → index-B1Z5dXCr.js} +1 -1
- package/assets/{index-DRnk3O3P.css → index-B4QUye_p.css} +1 -1
- package/assets/{index-CsIw7b3W.js → index-B6iImHgG.js} +1 -1
- package/assets/{index-CuC-vTv3.js → index-BJBJoWZs.js} +1 -1
- package/assets/{index-BqzNNfxh.js → index-BL8f4n87.js} +1 -1
- package/assets/{index-lGt2UflX.js → index-BMiurEtO.js} +1 -1
- package/assets/{index-gh0L5vcZ.js → index-BU1OApef.js} +1 -1
- package/assets/{index-CPTxkxGa.js → index-BeJeXmKD.js} +1 -1
- package/assets/index-CCILTcNe.js +1 -0
- package/assets/{index-B_Ecssie.js → index-CIkGNRAR.js} +1 -1
- package/assets/{index-oIZ2KZpv.js → index-CK--OQ83.js} +1 -1
- package/assets/{index-xvdZIeP3.js → index-CdSybgoG.js} +1 -1
- package/assets/{index-Di4WYmvS.css → index-CfU_ubdu.css} +1 -1
- package/assets/{index-DStnZvAp.js → index-CqmX90TP.js} +1 -1
- package/assets/{index-C6Sem-h_.css → index-CtM7ULBP.css} +7 -7
- package/assets/{index-BhgxnmSa.js → index-CwkP6MWv.js} +1 -1
- package/assets/{index-D44ywto_.js → index-Cwkr6Bc-.js} +1 -1
- package/assets/{index-CpGwIWGz.js → index-Cxg8OEsE.js} +1 -1
- package/assets/{index-QkSdK4RR.js → index-CxhDJKuk.js} +1 -1
- package/assets/{index-ME6Lx47Y.css → index-CyHCxbg4.css} +1 -1
- package/assets/{index-D6Wpyxlx.js → index-D2pe819n.js} +1 -1
- package/assets/{index-DhuRBTPq.js → index-D5p2T3o2.js} +1 -1
- package/assets/{index-DH_2Hr1M.js → index-DFMQLpF2.js} +1 -1
- package/assets/{index-DFDW3vrM.js → index-DIlb7NGo.js} +1 -1
- package/assets/{index-DtME10H2.js → index-DK322CRN.js} +1 -1
- package/assets/{index-BLQYfQ3K.js → index-DLcC_YRz.js} +1 -1
- package/assets/{index-D_zTHEk6.css → index-DPcTJN54.css} +1 -1
- package/assets/{index-DoA3dxJB.js → index-DREoEfuJ.js} +2 -2
- package/assets/{index-DJZN1aUR.js → index-DTaWDFyZ.js} +1 -1
- package/assets/{index-BUd-6xMj.js → index-Db2yXUSb.js} +1 -1
- package/assets/{index-Dr_fA8K6.js → index-DhUm7yG5.js} +1 -1
- package/assets/index-DkTMwtTI.js +1 -0
- package/assets/{index-A3_hfI9n.js → index-Dmo3kwAH.js} +1 -1
- package/assets/{index-BH4cF3_2.js → index-DoqbeoQw.js} +1 -1
- package/assets/{index-NrQFL8FO.js → index-DqpTosSn.js} +1 -1
- package/assets/{index-DuKm-a73.js → index-DvloJJ3K.js} +1 -1
- package/assets/{index-drR7groY.js → index-Ff3ES8h5.js} +1 -1
- package/assets/{index-TA6XUFTz.js → index-JS6japPI.js} +1 -1
- package/assets/{index-DixQ4Vhj.js → index-L3D6xA3L.js} +1 -1
- package/assets/{index-DnGApJNY.css → index-W_enwN_T.css} +1 -1
- package/assets/{index-eRzQAiun.js → index-YPAJmkCB.js} +24 -24
- package/assets/{index-CJ4F6eK1.js → index-mhnh9pfu.js} +1 -1
- package/assets/{index-BfrPcxy-.js → index-oH5zVeed.js} +1 -1
- package/assets/{index-Bx5VEAGf.js → index-obn1Zrh9.js} +1 -1
- package/assets/{index.es-Dquh_Hol.js → index.es-BmduyGx6.js} +4 -4
- package/assets/{selectors-BKBiSwJX.js → selectors-CoHvSlLI.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-CusOxEAD.js +0 -1
- package/assets/index-sD7BkER8.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{p as _i,g as Bp,c as e2,r as t2,b as gc,a as r2,d as Fp,m as i2,u as n2,i as ou,h as Hp,e as Kp,f as s2,j as ks,t as Tc,k as a2,B as ai,l as o2,n as jp,o as ci,q as kp,s as cu,v as Cd,_ as c2}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DREoEfuJ.js","assets/index-YPAJmkCB.js","assets/index-CtM7ULBP.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{p as _i,g as Bp,c as e2,r as t2,b as gc,a as r2,d as Fp,m as i2,u as n2,i as ou,h as Hp,e as Kp,f as s2,j as ks,t as Tc,k as a2,B as ai,l as o2,n as jp,o as ci,q as kp,s as cu,v as Cd,_ as c2}from"./index-YPAJmkCB.js";var Nd=function(r,e,t){if(t||arguments.length===2)for(var i=0,s=e.length,o;i<s;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return r.concat(o||Array.prototype.slice.call(e))},f2=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),h2=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=_i.platform}return r}(),u2=function(){function r(e,t,i,s){this.name=e,this.version=t,this.os=i,this.bot=s,this.type="bot-device"}return r}(),l2=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),d2=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),p2=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,g2=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,$d=3,b2=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",p2]],Ld=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function v2(r){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new d2:typeof navigator<"u"?y2(navigator.userAgent):_2()}function m2(r){return r!==""&&b2.reduce(function(e,t){var i=t[0],s=t[1];if(e)return e;var o=s.exec(r);return!!o&&[i,o]},!1)}function y2(r){var e=m2(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new l2;var s=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);s?s.length<$d&&(s=Nd(Nd([],s,!0),E2($d-s.length),!0)):s=[];var o=s.join("."),f=w2(r),h=g2.exec(r);return h&&h[1]?new u2(t,o,f,h[1]):new f2(t,o,f)}function w2(r){for(var e=0,t=Ld.length;e<t;e++){var i=Ld[e],s=i[0],o=i[1],f=o.exec(r);if(f)return s}return null}function _2(){var r=typeof _i<"u"&&_i.version;return r?new h2(_i.version.slice(1)):null}function E2(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var be={};/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var qh=function(r,e){return qh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},qh(r,e)};function S2(r,e){qh(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Uh=function(){return Uh=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Uh.apply(this,arguments)};function I2(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function x2(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var h=r.length-1;h>=0;h--)(f=r[h])&&(o=(s<3?f(o):s>3?f(e,t,o):f(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function P2(r,e){return function(t,i){e(t,i,r)}}function M2(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function A2(r,e,t,i){function s(o){return o instanceof t?o:new t(function(f){f(o)})}return new(t||(t=Promise))(function(o,f){function h(m){try{l(i.next(m))}catch(_){f(_)}}function p(m){try{l(i.throw(m))}catch(_){f(_)}}function l(m){m.done?o(m.value):s(m.value).then(h,p)}l((i=i.apply(r,e||[])).next())})}function O2(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,s,o,f;return f={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(l){return function(m){return p([l,m])}}function p(l){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(o=l[0]&2?s.return:l[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,l[1])).done)return o;switch(s=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,s=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(l[0]===6&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(m){l=[6,m],s=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function R2(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function T2(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function zh(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,o=[],f;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(h){f={error:h}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(f)throw f.error}}return o}function C2(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Wp(arguments[e]));return r}function N2(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var o=arguments[e],f=0,h=o.length;f<h;f++,s++)i[s]=o[f];return i}function Ca(r){return this instanceof Ca?(this.v=r,this):new Ca(r)}function $2(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,o=[];return s={},f("next"),f("throw"),f("return"),s[Symbol.asyncIterator]=function(){return this},s;function f(P){i[P]&&(s[P]=function(x){return new Promise(function(T,j){o.push([P,x,T,j])>1||h(P,x)})})}function h(P,x){try{p(i[P](x))}catch(T){_(o[0][3],T)}}function p(P){P.value instanceof Ca?Promise.resolve(P.value.v).then(l,m):_(o[0][2],P)}function l(P){h("next",P)}function m(P){h("throw",P)}function _(P,x){P(x),o.shift(),o.length&&h(o[0][0],o[0][1])}}function L2(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,o){e[s]=r[s]?function(f){return(t=!t)?{value:Ca(r[s](f)),done:s==="return"}:o?o(f):f}:o}}function D2(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof zh=="function"?zh(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=r[o]&&function(f){return new Promise(function(h,p){f=r[o](f),s(h,p,f.done,f.value)})}}function s(o,f,h,p){Promise.resolve(p).then(function(l){o({value:l,done:h})},f)}}function q2(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function U2(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function z2(r){return r&&r.__esModule?r:{default:r}}function B2(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function F2(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const H2=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Uh},__asyncDelegator:L2,__asyncGenerator:$2,__asyncValues:D2,__await:Ca,__awaiter:A2,__classPrivateFieldGet:B2,__classPrivateFieldSet:F2,__createBinding:R2,__decorate:x2,__exportStar:T2,__extends:S2,__generator:O2,__importDefault:z2,__importStar:U2,__makeTemplateObject:q2,__metadata:M2,__param:P2,__read:Wp,__rest:I2,__spread:C2,__spreadArrays:N2,__values:zh},Symbol.toStringTag,{value:"Module"})),Cc=Bp(H2);var uh={},ma={},Dd;function K2(){if(Dd)return ma;Dd=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return ma.delay=r,ma}var Xn={},lh={},Zn={},qd;function j2(){return qd||(qd=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.ONE_THOUSAND=Zn.ONE_HUNDRED=void 0,Zn.ONE_HUNDRED=100,Zn.ONE_THOUSAND=1e3),Zn}var dh={},Ud;function k2(){return Ud||(Ud=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(dh)),dh}var zd;function Gp(){return zd||(zd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Cc;e.__exportStar(j2(),r),e.__exportStar(k2(),r)}(lh)),lh}var Bd;function W2(){if(Bd)return Xn;Bd=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fromMiliseconds=Xn.toMiliseconds=void 0;const r=Gp();function e(i){return i*r.ONE_THOUSAND}Xn.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return Xn.fromMiliseconds=t,Xn}var Fd;function G2(){return Fd||(Fd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Cc;e.__exportStar(K2(),r),e.__exportStar(W2(),r)}(uh)),uh}var $s={},Hd;function V2(){if(Hd)return $s;Hd=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const s=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:s})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return $s.Watch=r,$s.default=r,$s}var ph={},ya={},Kd;function Y2(){if(Kd)return ya;Kd=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.IWatch=void 0;class r{}return ya.IWatch=r,ya}var jd;function J2(){return jd||(jd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Cc.__exportStar(Y2(),r)}(ph)),ph}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Cc;e.__exportStar(G2(),r),e.__exportStar(V2(),r),e.__exportStar(J2(),r),e.__exportStar(Gp(),r)})(be);var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.getLocalStorage=Tt.getLocalStorageOrThrow=Tt.getCrypto=Tt.getCryptoOrThrow=Vp=Tt.getLocation=Tt.getLocationOrThrow=fu=Tt.getNavigator=Tt.getNavigatorOrThrow=Ba=Tt.getDocument=Tt.getDocumentOrThrow=Tt.getFromWindowOrThrow=Tt.getFromWindow=void 0;function hs(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Tt.getFromWindow=hs;function Ws(r){const e=hs(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Tt.getFromWindowOrThrow=Ws;function X2(){return Ws("document")}Tt.getDocumentOrThrow=X2;function Z2(){return hs("document")}var Ba=Tt.getDocument=Z2;function Q2(){return Ws("navigator")}Tt.getNavigatorOrThrow=Q2;function e_(){return hs("navigator")}var fu=Tt.getNavigator=e_;function t_(){return Ws("location")}Tt.getLocationOrThrow=t_;function r_(){return hs("location")}var Vp=Tt.getLocation=r_;function i_(){return Ws("crypto")}Tt.getCryptoOrThrow=i_;function n_(){return hs("crypto")}Tt.getCrypto=n_;function s_(){return Ws("localStorage")}Tt.getLocalStorageOrThrow=s_;function a_(){return hs("localStorage")}Tt.getLocalStorage=a_;var hu={};Object.defineProperty(hu,"__esModule",{value:!0});var Yp=hu.getWindowMetadata=void 0;const kd=Tt;function o_(){let r,e;try{r=kd.getDocumentOrThrow(),e=kd.getLocationOrThrow()}catch{return null}function t(){const _=r.getElementsByTagName("link"),P=[];for(let x=0;x<_.length;x++){const T=_[x],j=T.getAttribute("rel");if(j&&j.toLowerCase().indexOf("icon")>-1){const G=T.getAttribute("href");if(G)if(G.toLowerCase().indexOf("https:")===-1&&G.toLowerCase().indexOf("http:")===-1&&G.indexOf("//")!==0){let X=e.protocol+"//"+e.host;if(G.indexOf("/")===0)X+=G;else{const U=e.pathname.split("/");U.pop();const V=U.join("/");X+=V+"/"+G}P.push(X)}else if(G.indexOf("//")===0){const X=e.protocol+G;P.push(X)}else P.push(G)}}return P}function i(..._){const P=r.getElementsByTagName("meta");for(let x=0;x<P.length;x++){const T=P[x],j=["itemprop","property","name"].map(G=>T.getAttribute(G)).filter(G=>G?_.includes(G):!1);if(j.length&&j){const G=T.getAttribute("content");if(G)return G}}return""}function s(){let _=i("name","og:site_name","og:title","twitter:title");return _||(_=r.title),_}function o(){return i("description","og:description","twitter:description","keywords")}const f=s(),h=o(),p=e.origin,l=t();return{description:h,url:p,icons:l,name:f}}Yp=hu.getWindowMetadata=o_;var Na={},c_=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Jp="%[a-f0-9]{2}",Wd=new RegExp("("+Jp+")|([^%]+?)","gi"),Gd=new RegExp("("+Jp+")+","gi");function Bh(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),i=r.slice(e);return Array.prototype.concat.call([],Bh(t),Bh(i))}function f_(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(Wd)||[],t=1;t<e.length;t++)r=Bh(e,t).join(""),e=r.match(Wd)||[];return r}}function h_(r){for(var e={"%FE%FF":"��","%FF%FE":"��"},t=Gd.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var i=f_(t[0]);i!==t[0]&&(e[t[0]]=i)}t=Gd.exec(r)}e["%C2"]="�";for(var s=Object.keys(e),o=0;o<s.length;o++){var f=s[o];r=r.replace(new RegExp(f,"g"),e[f])}return r}var u_=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return h_(r)}},l_=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},d_=function(r,e){for(var t={},i=Object.keys(r),s=Array.isArray(e),o=0;o<i.length;o++){var f=i[o],h=r[f];(s?e.indexOf(f)!==-1:e(f,h,r))&&(t[f]=h)}return t};(function(r){const e=c_,t=u_,i=l_,s=d_,o=U=>U==null,f=Symbol("encodeFragmentIdentifier");function h(U){switch(U.arrayFormat){case"index":return V=>(D,B)=>{const F=D.length;return B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,[m(V,U),"[",F,"]"].join("")]:[...D,[m(V,U),"[",m(F,U),"]=",m(B,U)].join("")]};case"bracket":return V=>(D,B)=>B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,[m(V,U),"[]"].join("")]:[...D,[m(V,U),"[]=",m(B,U)].join("")];case"colon-list-separator":return V=>(D,B)=>B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,[m(V,U),":list="].join("")]:[...D,[m(V,U),":list=",m(B,U)].join("")];case"comma":case"separator":case"bracket-separator":{const V=U.arrayFormat==="bracket-separator"?"[]=":"=";return D=>(B,F)=>F===void 0||U.skipNull&&F===null||U.skipEmptyString&&F===""?B:(F=F===null?"":F,B.length===0?[[m(D,U),V,m(F,U)].join("")]:[[B,m(F,U)].join(U.arrayFormatSeparator)])}default:return V=>(D,B)=>B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,m(V,U)]:[...D,[m(V,U),"=",m(B,U)].join("")]}}function p(U){let V;switch(U.arrayFormat){case"index":return(D,B,F)=>{if(V=/\[(\d*)\]$/.exec(D),D=D.replace(/\[\d*\]$/,""),!V){F[D]=B;return}F[D]===void 0&&(F[D]={}),F[D][V[1]]=B};case"bracket":return(D,B,F)=>{if(V=/(\[\])$/.exec(D),D=D.replace(/\[\]$/,""),!V){F[D]=B;return}if(F[D]===void 0){F[D]=[B];return}F[D]=[].concat(F[D],B)};case"colon-list-separator":return(D,B,F)=>{if(V=/(:list)$/.exec(D),D=D.replace(/:list$/,""),!V){F[D]=B;return}if(F[D]===void 0){F[D]=[B];return}F[D]=[].concat(F[D],B)};case"comma":case"separator":return(D,B,F)=>{const b=typeof B=="string"&&B.includes(U.arrayFormatSeparator),N=typeof B=="string"&&!b&&_(B,U).includes(U.arrayFormatSeparator);B=N?_(B,U):B;const re=b||N?B.split(U.arrayFormatSeparator).map(de=>_(de,U)):B===null?B:_(B,U);F[D]=re};case"bracket-separator":return(D,B,F)=>{const b=/(\[\])$/.test(D);if(D=D.replace(/\[\]$/,""),!b){F[D]=B&&_(B,U);return}const N=B===null?[]:B.split(U.arrayFormatSeparator).map(re=>_(re,U));if(F[D]===void 0){F[D]=N;return}F[D]=[].concat(F[D],N)};default:return(D,B,F)=>{if(F[D]===void 0){F[D]=B;return}F[D]=[].concat(F[D],B)}}}function l(U){if(typeof U!="string"||U.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(U,V){return V.encode?V.strict?e(U):encodeURIComponent(U):U}function _(U,V){return V.decode?t(U):U}function P(U){return Array.isArray(U)?U.sort():typeof U=="object"?P(Object.keys(U)).sort((V,D)=>Number(V)-Number(D)).map(V=>U[V]):U}function x(U){const V=U.indexOf("#");return V!==-1&&(U=U.slice(0,V)),U}function T(U){let V="";const D=U.indexOf("#");return D!==-1&&(V=U.slice(D)),V}function j(U){U=x(U);const V=U.indexOf("?");return V===-1?"":U.slice(V+1)}function G(U,V){return V.parseNumbers&&!Number.isNaN(Number(U))&&typeof U=="string"&&U.trim()!==""?U=Number(U):V.parseBooleans&&U!==null&&(U.toLowerCase()==="true"||U.toLowerCase()==="false")&&(U=U.toLowerCase()==="true"),U}function X(U,V){V=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},V),l(V.arrayFormatSeparator);const D=p(V),B=Object.create(null);if(typeof U!="string"||(U=U.trim().replace(/^[?#&]/,""),!U))return B;for(const F of U.split("&")){if(F==="")continue;let[b,N]=i(V.decode?F.replace(/\+/g," "):F,"=");N=N===void 0?null:["comma","separator","bracket-separator"].includes(V.arrayFormat)?N:_(N,V),D(_(b,V),N,B)}for(const F of Object.keys(B)){const b=B[F];if(typeof b=="object"&&b!==null)for(const N of Object.keys(b))b[N]=G(b[N],V);else B[F]=G(b,V)}return V.sort===!1?B:(V.sort===!0?Object.keys(B).sort():Object.keys(B).sort(V.sort)).reduce((F,b)=>{const N=B[b];return N&&typeof N=="object"&&!Array.isArray(N)?F[b]=P(N):F[b]=N,F},Object.create(null))}r.extract=j,r.parse=X,r.stringify=(U,V)=>{if(!U)return"";V=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},V),l(V.arrayFormatSeparator);const D=N=>V.skipNull&&o(U[N])||V.skipEmptyString&&U[N]==="",B=h(V),F={};for(const N of Object.keys(U))D(N)||(F[N]=U[N]);const b=Object.keys(F);return V.sort!==!1&&b.sort(V.sort),b.map(N=>{const re=U[N];return re===void 0?"":re===null?m(N,V):Array.isArray(re)?re.length===0&&V.arrayFormat==="bracket-separator"?m(N,V)+"[]":re.reduce(B(N),[]).join("&"):m(N,V)+"="+m(re,V)}).filter(N=>N.length>0).join("&")},r.parseUrl=(U,V)=>{V=Object.assign({decode:!0},V);const[D,B]=i(U,"#");return Object.assign({url:D.split("?")[0]||"",query:X(j(U),V)},V&&V.parseFragmentIdentifier&&B?{fragmentIdentifier:_(B,V)}:{})},r.stringifyUrl=(U,V)=>{V=Object.assign({encode:!0,strict:!0,[f]:!0},V);const D=x(U.url).split("?")[0]||"",B=r.extract(U.url),F=r.parse(B,{sort:!1}),b=Object.assign(F,U.query);let N=r.stringify(b,V);N&&(N=`?${N}`);let re=T(U.url);return U.fragmentIdentifier&&(re=`#${V[f]?m(U.fragmentIdentifier,V):U.fragmentIdentifier}`),`${D}${N}${re}`},r.pick=(U,V,D)=>{D=Object.assign({parseFragmentIdentifier:!0,[f]:!1},D);const{url:B,query:F,fragmentIdentifier:b}=r.parseUrl(U,D);return r.stringifyUrl({url:B,query:s(F,V),fragmentIdentifier:b},D)},r.exclude=(U,V,D)=>{const B=Array.isArray(V)?F=>!V.includes(F):(F,b)=>!V(F,b);return r.pick(U,B,D)}})(Na);var uu={},Nc={},et={},Xp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(h,p){var l=h>>>16&65535,m=h&65535,_=p>>>16&65535,P=p&65535;return m*P+(l*P+m*_<<16>>>0)|0}r.mul=Math.imul||e;function t(h,p){return h+p|0}r.add=t;function i(h,p){return h-p|0}r.sub=i;function s(h,p){return h<<p|h>>>32-p}r.rotl=s;function o(h,p){return h<<32-p|h>>>p}r.rotr=o;function f(h){return typeof h=="number"&&isFinite(h)&&Math.floor(h)===h}r.isInteger=Number.isInteger||f,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(h){return r.isInteger(h)&&h>=-r.MAX_SAFE_INTEGER&&h<=r.MAX_SAFE_INTEGER}})(Xp);Object.defineProperty(et,"__esModule",{value:!0});var Zp=Xp;function p_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}et.readInt16BE=p_;function g_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}et.readUint16BE=g_;function b_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}et.readInt16LE=b_;function v_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}et.readUint16LE=v_;function Qp(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}et.writeUint16BE=Qp;et.writeInt16BE=Qp;function eg(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}et.writeUint16LE=eg;et.writeInt16LE=eg;function Fh(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}et.readInt32BE=Fh;function Hh(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}et.readUint32BE=Hh;function Kh(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}et.readInt32LE=Kh;function jh(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}et.readUint32LE=jh;function bc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}et.writeUint32BE=bc;et.writeInt32BE=bc;function vc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}et.writeUint32LE=vc;et.writeInt32LE=vc;function m_(r,e){e===void 0&&(e=0);var t=Fh(r,e),i=Fh(r,e+4);return t*4294967296+i-(i>>31)*4294967296}et.readInt64BE=m_;function y_(r,e){e===void 0&&(e=0);var t=Hh(r,e),i=Hh(r,e+4);return t*4294967296+i}et.readUint64BE=y_;function w_(r,e){e===void 0&&(e=0);var t=Kh(r,e),i=Kh(r,e+4);return i*4294967296+t-(t>>31)*4294967296}et.readInt64LE=w_;function __(r,e){e===void 0&&(e=0);var t=jh(r,e),i=jh(r,e+4);return i*4294967296+t}et.readUint64LE=__;function tg(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),bc(r/4294967296>>>0,e,t),bc(r>>>0,e,t+4),e}et.writeUint64BE=tg;et.writeInt64BE=tg;function rg(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),vc(r>>>0,e,t),vc(r/4294967296>>>0,e,t+4),e}et.writeUint64LE=rg;et.writeInt64LE=rg;function E_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,s=1,o=r/8+t-1;o>=t;o--)i+=e[o]*s,s*=256;return i}et.readUintBE=E_;function S_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,s=1,o=t;o<t+r/8;o++)i+=e[o]*s,s*=256;return i}et.readUintLE=S_;function I_(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Zp.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,o=r/8+i-1;o>=i;o--)t[o]=e/s&255,s*=256;return t}et.writeUintBE=I_;function x_(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Zp.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,o=i;o<i+r/8;o++)t[o]=e/s&255,s*=256;return t}et.writeUintLE=x_;function P_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}et.readFloat32BE=P_;function M_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}et.readFloat32LE=M_;function A_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}et.readFloat64BE=A_;function O_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}et.readFloat64LE=O_;function R_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r),e}et.writeFloat32BE=R_;function T_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r,!0),e}et.writeFloat32LE=T_;function C_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r),e}et.writeFloat64BE=C_;function N_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r,!0),e}et.writeFloat64LE=N_;var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});function $_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}Wr.wipe=$_;Object.defineProperty(Nc,"__esModule",{value:!0});var vr=et,kh=Wr,L_=20;function D_(r,e,t){for(var i=1634760805,s=857760878,o=2036477234,f=1797285236,h=t[3]<<24|t[2]<<16|t[1]<<8|t[0],p=t[7]<<24|t[6]<<16|t[5]<<8|t[4],l=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],_=t[19]<<24|t[18]<<16|t[17]<<8|t[16],P=t[23]<<24|t[22]<<16|t[21]<<8|t[20],x=t[27]<<24|t[26]<<16|t[25]<<8|t[24],T=t[31]<<24|t[30]<<16|t[29]<<8|t[28],j=e[3]<<24|e[2]<<16|e[1]<<8|e[0],G=e[7]<<24|e[6]<<16|e[5]<<8|e[4],X=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],V=i,D=s,B=o,F=f,b=h,N=p,re=l,de=m,$=_,u=P,y=x,w=T,E=j,O=G,L=X,C=U,I=0;I<L_;I+=2)V=V+b|0,E^=V,E=E>>>16|E<<16,$=$+E|0,b^=$,b=b>>>20|b<<12,D=D+N|0,O^=D,O=O>>>16|O<<16,u=u+O|0,N^=u,N=N>>>20|N<<12,B=B+re|0,L^=B,L=L>>>16|L<<16,y=y+L|0,re^=y,re=re>>>20|re<<12,F=F+de|0,C^=F,C=C>>>16|C<<16,w=w+C|0,de^=w,de=de>>>20|de<<12,B=B+re|0,L^=B,L=L>>>24|L<<8,y=y+L|0,re^=y,re=re>>>25|re<<7,F=F+de|0,C^=F,C=C>>>24|C<<8,w=w+C|0,de^=w,de=de>>>25|de<<7,D=D+N|0,O^=D,O=O>>>24|O<<8,u=u+O|0,N^=u,N=N>>>25|N<<7,V=V+b|0,E^=V,E=E>>>24|E<<8,$=$+E|0,b^=$,b=b>>>25|b<<7,V=V+N|0,C^=V,C=C>>>16|C<<16,y=y+C|0,N^=y,N=N>>>20|N<<12,D=D+re|0,E^=D,E=E>>>16|E<<16,w=w+E|0,re^=w,re=re>>>20|re<<12,B=B+de|0,O^=B,O=O>>>16|O<<16,$=$+O|0,de^=$,de=de>>>20|de<<12,F=F+b|0,L^=F,L=L>>>16|L<<16,u=u+L|0,b^=u,b=b>>>20|b<<12,B=B+de|0,O^=B,O=O>>>24|O<<8,$=$+O|0,de^=$,de=de>>>25|de<<7,F=F+b|0,L^=F,L=L>>>24|L<<8,u=u+L|0,b^=u,b=b>>>25|b<<7,D=D+re|0,E^=D,E=E>>>24|E<<8,w=w+E|0,re^=w,re=re>>>25|re<<7,V=V+N|0,C^=V,C=C>>>24|C<<8,y=y+C|0,N^=y,N=N>>>25|N<<7;vr.writeUint32LE(V+i|0,r,0),vr.writeUint32LE(D+s|0,r,4),vr.writeUint32LE(B+o|0,r,8),vr.writeUint32LE(F+f|0,r,12),vr.writeUint32LE(b+h|0,r,16),vr.writeUint32LE(N+p|0,r,20),vr.writeUint32LE(re+l|0,r,24),vr.writeUint32LE(de+m|0,r,28),vr.writeUint32LE($+_|0,r,32),vr.writeUint32LE(u+P|0,r,36),vr.writeUint32LE(y+x|0,r,40),vr.writeUint32LE(w+T|0,r,44),vr.writeUint32LE(E+j|0,r,48),vr.writeUint32LE(O+G|0,r,52),vr.writeUint32LE(L+X|0,r,56),vr.writeUint32LE(C+U|0,r,60)}function ig(r,e,t,i,s){if(s===void 0&&(s=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<t.length)throw new Error("ChaCha: destination is shorter than source");var o,f;if(s===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),f=o.length-e.length,o.set(e,f)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,f=s}for(var h=new Uint8Array(64),p=0;p<t.length;p+=64){D_(h,o,r);for(var l=p;l<p+64&&l<t.length;l++)i[l]=t[l]^h[l-p];U_(o,0,f)}return kh.wipe(h),s===0&&kh.wipe(o),i}Nc.streamXOR=ig;function q_(r,e,t,i){return i===void 0&&(i=0),kh.wipe(t),ig(r,e,t,t,i)}Nc.stream=q_;function U_(r,e,t){for(var i=1;t--;)i=i+(r[e]&255)|0,r[e]=i&255,i>>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var ng={},In={};Object.defineProperty(In,"__esModule",{value:!0});function z_(r,e,t){return~(r-1)&e|r-1&t}In.select=z_;function B_(r,e){return(r|0)-(e|0)-1>>>31&1}In.lessOrEqual=B_;function sg(r,e){if(r.length!==e.length)return 0;for(var t=0,i=0;i<r.length;i++)t|=r[i]^e[i];return 1&t-1>>>8}In.compare=sg;function F_(r,e){return r.length===0||e.length===0?!1:sg(r,e)!==0}In.equal=F_;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=In,t=Wr;r.DIGEST_LENGTH=16;var i=function(){function f(h){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var p=h[0]|h[1]<<8;this._r[0]=p&8191;var l=h[2]|h[3]<<8;this._r[1]=(p>>>13|l<<3)&8191;var m=h[4]|h[5]<<8;this._r[2]=(l>>>10|m<<6)&7939;var _=h[6]|h[7]<<8;this._r[3]=(m>>>7|_<<9)&8191;var P=h[8]|h[9]<<8;this._r[4]=(_>>>4|P<<12)&255,this._r[5]=P>>>1&8190;var x=h[10]|h[11]<<8;this._r[6]=(P>>>14|x<<2)&8191;var T=h[12]|h[13]<<8;this._r[7]=(x>>>11|T<<5)&8065;var j=h[14]|h[15]<<8;this._r[8]=(T>>>8|j<<8)&8191,this._r[9]=j>>>5&127,this._pad[0]=h[16]|h[17]<<8,this._pad[1]=h[18]|h[19]<<8,this._pad[2]=h[20]|h[21]<<8,this._pad[3]=h[22]|h[23]<<8,this._pad[4]=h[24]|h[25]<<8,this._pad[5]=h[26]|h[27]<<8,this._pad[6]=h[28]|h[29]<<8,this._pad[7]=h[30]|h[31]<<8}return f.prototype._blocks=function(h,p,l){for(var m=this._fin?0:2048,_=this._h[0],P=this._h[1],x=this._h[2],T=this._h[3],j=this._h[4],G=this._h[5],X=this._h[6],U=this._h[7],V=this._h[8],D=this._h[9],B=this._r[0],F=this._r[1],b=this._r[2],N=this._r[3],re=this._r[4],de=this._r[5],$=this._r[6],u=this._r[7],y=this._r[8],w=this._r[9];l>=16;){var E=h[p+0]|h[p+1]<<8;_+=E&8191;var O=h[p+2]|h[p+3]<<8;P+=(E>>>13|O<<3)&8191;var L=h[p+4]|h[p+5]<<8;x+=(O>>>10|L<<6)&8191;var C=h[p+6]|h[p+7]<<8;T+=(L>>>7|C<<9)&8191;var I=h[p+8]|h[p+9]<<8;j+=(C>>>4|I<<12)&8191,G+=I>>>1&8191;var d=h[p+10]|h[p+11]<<8;X+=(I>>>14|d<<2)&8191;var M=h[p+12]|h[p+13]<<8;U+=(d>>>11|M<<5)&8191;var ne=h[p+14]|h[p+15]<<8;V+=(M>>>8|ne<<8)&8191,D+=ne>>>5|m;var ee=0,fe=ee;fe+=_*B,fe+=P*(5*w),fe+=x*(5*y),fe+=T*(5*u),fe+=j*(5*$),ee=fe>>>13,fe&=8191,fe+=G*(5*de),fe+=X*(5*re),fe+=U*(5*N),fe+=V*(5*b),fe+=D*(5*F),ee+=fe>>>13,fe&=8191;var pe=ee;pe+=_*F,pe+=P*B,pe+=x*(5*w),pe+=T*(5*y),pe+=j*(5*u),ee=pe>>>13,pe&=8191,pe+=G*(5*$),pe+=X*(5*de),pe+=U*(5*re),pe+=V*(5*N),pe+=D*(5*b),ee+=pe>>>13,pe&=8191;var he=ee;he+=_*b,he+=P*F,he+=x*B,he+=T*(5*w),he+=j*(5*y),ee=he>>>13,he&=8191,he+=G*(5*u),he+=X*(5*$),he+=U*(5*de),he+=V*(5*re),he+=D*(5*N),ee+=he>>>13,he&=8191;var W=ee;W+=_*N,W+=P*b,W+=x*F,W+=T*B,W+=j*(5*w),ee=W>>>13,W&=8191,W+=G*(5*y),W+=X*(5*u),W+=U*(5*$),W+=V*(5*de),W+=D*(5*re),ee+=W>>>13,W&=8191;var Q=ee;Q+=_*re,Q+=P*N,Q+=x*b,Q+=T*F,Q+=j*B,ee=Q>>>13,Q&=8191,Q+=G*(5*w),Q+=X*(5*y),Q+=U*(5*u),Q+=V*(5*$),Q+=D*(5*de),ee+=Q>>>13,Q&=8191;var K=ee;K+=_*de,K+=P*re,K+=x*N,K+=T*b,K+=j*F,ee=K>>>13,K&=8191,K+=G*B,K+=X*(5*w),K+=U*(5*y),K+=V*(5*u),K+=D*(5*$),ee+=K>>>13,K&=8191;var v=ee;v+=_*$,v+=P*de,v+=x*re,v+=T*N,v+=j*b,ee=v>>>13,v&=8191,v+=G*F,v+=X*B,v+=U*(5*w),v+=V*(5*y),v+=D*(5*u),ee+=v>>>13,v&=8191;var H=ee;H+=_*u,H+=P*$,H+=x*de,H+=T*re,H+=j*N,ee=H>>>13,H&=8191,H+=G*b,H+=X*F,H+=U*B,H+=V*(5*w),H+=D*(5*y),ee+=H>>>13,H&=8191;var oe=ee;oe+=_*y,oe+=P*u,oe+=x*$,oe+=T*de,oe+=j*re,ee=oe>>>13,oe&=8191,oe+=G*N,oe+=X*b,oe+=U*F,oe+=V*B,oe+=D*(5*w),ee+=oe>>>13,oe&=8191;var le=ee;le+=_*w,le+=P*y,le+=x*u,le+=T*$,le+=j*de,ee=le>>>13,le&=8191,le+=G*re,le+=X*N,le+=U*b,le+=V*F,le+=D*B,ee+=le>>>13,le&=8191,ee=(ee<<2)+ee|0,ee=ee+fe|0,fe=ee&8191,ee=ee>>>13,pe+=ee,_=fe,P=pe,x=he,T=W,j=Q,G=K,X=v,U=H,V=oe,D=le,p+=16,l-=16}this._h[0]=_,this._h[1]=P,this._h[2]=x,this._h[3]=T,this._h[4]=j,this._h[5]=G,this._h[6]=X,this._h[7]=U,this._h[8]=V,this._h[9]=D},f.prototype.finish=function(h,p){p===void 0&&(p=0);var l=new Uint16Array(10),m,_,P,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=m,m=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,l[0]=this._h[0]+5,m=l[0]>>>13,l[0]&=8191,x=1;x<10;x++)l[x]=this._h[x]+m,m=l[x]>>>13,l[x]&=8191;for(l[9]-=8192,_=(m^1)-1,x=0;x<10;x++)l[x]&=_;for(_=~_,x=0;x<10;x++)this._h[x]=this._h[x]&_|l[x];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,P=this._h[0]+this._pad[0],this._h[0]=P&65535,x=1;x<8;x++)P=(this._h[x]+this._pad[x]|0)+(P>>>16)|0,this._h[x]=P&65535;return h[p+0]=this._h[0]>>>0,h[p+1]=this._h[0]>>>8,h[p+2]=this._h[1]>>>0,h[p+3]=this._h[1]>>>8,h[p+4]=this._h[2]>>>0,h[p+5]=this._h[2]>>>8,h[p+6]=this._h[3]>>>0,h[p+7]=this._h[3]>>>8,h[p+8]=this._h[4]>>>0,h[p+9]=this._h[4]>>>8,h[p+10]=this._h[5]>>>0,h[p+11]=this._h[5]>>>8,h[p+12]=this._h[6]>>>0,h[p+13]=this._h[6]>>>8,h[p+14]=this._h[7]>>>0,h[p+15]=this._h[7]>>>8,this._finished=!0,this},f.prototype.update=function(h){var p=0,l=h.length,m;if(this._leftover){m=16-this._leftover,m>l&&(m=l);for(var _=0;_<m;_++)this._buffer[this._leftover+_]=h[p+_];if(l-=m,p+=m,this._leftover+=m,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(l>=16&&(m=l-l%16,this._blocks(h,p,m),p+=m,l-=m),l){for(var _=0;_<l;_++)this._buffer[this._leftover+_]=h[p+_];this._leftover+=l}return this},f.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var h=new Uint8Array(16);return this.finish(h),h},f.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},f}();r.Poly1305=i;function s(f,h){var p=new i(f);p.update(h);var l=p.digest();return p.clean(),l}r.oneTimeAuth=s;function o(f,h){return f.length!==r.DIGEST_LENGTH||h.length!==r.DIGEST_LENGTH?!1:e.equal(f,h)}r.equal=o})(ng);(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Nc,t=ng,i=Wr,s=et,o=In;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var f=new Uint8Array(16),h=function(){function p(l){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,l.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(l)}return p.prototype.seal=function(l,m,_,P){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(l,x.length-l.length);var T=new Uint8Array(32);e.stream(this._key,x,T,4);var j=m.length+this.tagLength,G;if(P){if(P.length!==j)throw new Error("ChaCha20Poly1305: incorrect destination length");G=P}else G=new Uint8Array(j);return e.streamXOR(this._key,x,m,G,4),this._authenticate(G.subarray(G.length-this.tagLength,G.length),T,G.subarray(0,G.length-this.tagLength),_),i.wipe(x),G},p.prototype.open=function(l,m,_,P){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(l,x.length-l.length);var T=new Uint8Array(32);e.stream(this._key,x,T,4);var j=new Uint8Array(this.tagLength);if(this._authenticate(j,T,m.subarray(0,m.length-this.tagLength),_),!o.equal(j,m.subarray(m.length-this.tagLength,m.length)))return null;var G=m.length-this.tagLength,X;if(P){if(P.length!==G)throw new Error("ChaCha20Poly1305: incorrect destination length");X=P}else X=new Uint8Array(G);return e.streamXOR(this._key,x,m.subarray(0,m.length-this.tagLength),X,4),i.wipe(x),X},p.prototype.clean=function(){return i.wipe(this._key),this},p.prototype._authenticate=function(l,m,_,P){var x=new t.Poly1305(m);P&&(x.update(P),P.length%16>0&&x.update(f.subarray(P.length%16))),x.update(_),_.length%16>0&&x.update(f.subarray(_.length%16));var T=new Uint8Array(8);P&&s.writeUint64LE(P.length,T),x.update(T),s.writeUint64LE(_.length,T),x.update(T);for(var j=x.digest(),G=0;G<j.length;G++)l[G]=j[G];x.clean(),i.wipe(j),i.wipe(T)},p}();r.ChaCha20Poly1305=h})(uu);var ag={},Fa={},lu={};Object.defineProperty(lu,"__esModule",{value:!0});function H_(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}lu.isSerializableHash=H_;Object.defineProperty(Fa,"__esModule",{value:!0});var Ni=lu,K_=In,j_=Wr,og=function(){function r(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var s=0;s<i.length;s++)i[s]^=54;this._inner.update(i);for(var s=0;s<i.length;s++)i[s]^=106;this._outer.update(i),Ni.isSerializableHash(this._inner)&&Ni.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),j_.wipe(i)}return r.prototype.reset=function(){if(!Ni.isSerializableHash(this._inner)||!Ni.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.clean=function(){Ni.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ni.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},r.prototype.update=function(e){return this._inner.update(e),this},r.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(!Ni.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},r.prototype.restoreState=function(e){if(!Ni.isSerializableHash(this._inner)||!Ni.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.cleanSavedState=function(e){if(!Ni.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},r}();Fa.HMAC=og;function k_(r,e,t){var i=new og(r,e);i.update(t);var s=i.digest();return i.clean(),s}Fa.hmac=k_;Fa.equal=K_.equal;Object.defineProperty(ag,"__esModule",{value:!0});var Vd=Fa,Yd=Wr,W_=function(){function r(e,t,i,s){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=s;var o=Vd.hmac(this._hash,i,t);this._hmac=new Vd.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},r.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i<t.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[i]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),Yd.wipe(this._buffer),Yd.wipe(this._counter),this._bufpos=0},r}(),G_=ag.HKDF=W_,xn={},$c={},Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.BrowserRandomSource=void 0;const Jd=65536;class V_{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let i=0;i<t.length;i+=Jd)this._crypto.getRandomValues(t.subarray(i,i+Math.min(t.length-i,Jd)));return t}}Lc.BrowserRandomSource=V_;var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.NodeRandomSource=void 0;const Y_=Wr;class J_{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof e2<"u"){const e=t2();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(e);for(let s=0;s<i.length;s++)i[s]=t[s];return(0,Y_.wipe)(t),i}}Dc.NodeRandomSource=J_;Object.defineProperty($c,"__esModule",{value:!0});$c.SystemRandomSource=void 0;const X_=Lc,Z_=Dc;class Q_{constructor(){if(this.isAvailable=!1,this.name="",this._source=new X_.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Z_.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}$c.SystemRandomSource=Q_;(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=$c,t=et,i=Wr;r.defaultRandomSource=new e.SystemRandomSource;function s(l,m=r.defaultRandomSource){return m.randomBytes(l)}r.randomBytes=s;function o(l=r.defaultRandomSource){const m=s(4,l),_=(0,t.readUint32LE)(m);return(0,i.wipe)(m),_}r.randomUint32=o;const f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function h(l,m=f,_=r.defaultRandomSource){if(m.length<2)throw new Error("randomString charset is too short");if(m.length>256)throw new Error("randomString charset is too long");let P="";const x=m.length,T=256-256%x;for(;l>0;){const j=s(Math.ceil(l*256/T),_);for(let G=0;G<j.length&&l>0;G++){const X=j[G];X<T&&(P+=m.charAt(X%x),l--)}(0,i.wipe)(j)}return P}r.randomString=h;function p(l,m=f,_=r.defaultRandomSource){const P=Math.ceil(l/(Math.log(m.length)/Math.LN2));return h(P,m,_)}r.randomStringForEntropy=p})(xn);var Ha={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=et,t=Wr;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var i=function(){function h(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return h.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},h.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},h.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},h.prototype.update=function(p,l){if(l===void 0&&(l=p.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var m=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&l>0;)this._buffer[this._bufferLength++]=p[m++],l--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(m=o(this._temp,this._state,p,m,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=p[m++],l--;return this},h.prototype.finish=function(p){if(!this._finished){var l=this._bytesHashed,m=this._bufferLength,_=l/536870912|0,P=l<<3,x=l%64<56?64:128;this._buffer[m]=128;for(var T=m+1;T<x-8;T++)this._buffer[T]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(P,this._buffer,x-4),o(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var T=0;T<this.digestLength/4;T++)e.writeUint32BE(this._state[T],p,T*4);return this},h.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},h.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},h.prototype.restoreState=function(p){return this._state.set(p.state),this._bufferLength=p.bufferLength,p.buffer&&this._buffer.set(p.buffer),this._bytesHashed=p.bytesHashed,this._finished=!1,this},h.prototype.cleanSavedState=function(p){t.wipe(p.state),p.buffer&&t.wipe(p.buffer),p.bufferLength=0,p.bytesHashed=0},h}();r.SHA256=i;var s=new Int32Array([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 o(h,p,l,m,_){for(;_>=64;){for(var P=p[0],x=p[1],T=p[2],j=p[3],G=p[4],X=p[5],U=p[6],V=p[7],D=0;D<16;D++){var B=m+D*4;h[D]=e.readUint32BE(l,B)}for(var D=16;D<64;D++){var F=h[D-2],b=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10;F=h[D-15];var N=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3;h[D]=(b+h[D-7]|0)+(N+h[D-16]|0)}for(var D=0;D<64;D++){var b=(((G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7))+(G&X^~G&U)|0)+(V+(s[D]+h[D]|0)|0)|0,N=((P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10))+(P&x^P&T^x&T)|0;V=U,U=X,X=G,G=j+b|0,j=T,T=x,x=P,P=b+N|0}p[0]+=P,p[1]+=x,p[2]+=T,p[3]+=j,p[4]+=G,p[5]+=X,p[6]+=U,p[7]+=V,m+=64,_-=64}return m}function f(h){var p=new i;p.update(h);var l=p.digest();return p.clean(),l}r.hash=f})(Ha);var du={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=xn,t=Wr;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i(D){const B=new Float64Array(16);if(D)for(let F=0;F<D.length;F++)B[F]=D[F];return B}const s=new Uint8Array(32);s[0]=9;const o=i([56129,1]);function f(D){let B=1;for(let F=0;F<16;F++){let b=D[F]+B+65535;B=Math.floor(b/65536),D[F]=b-B*65536}D[0]+=B-1+37*(B-1)}function h(D,B,F){const b=~(F-1);for(let N=0;N<16;N++){const re=b&(D[N]^B[N]);D[N]^=re,B[N]^=re}}function p(D,B){const F=i(),b=i();for(let N=0;N<16;N++)b[N]=B[N];f(b),f(b),f(b);for(let N=0;N<2;N++){F[0]=b[0]-65517;for(let de=1;de<15;de++)F[de]=b[de]-65535-(F[de-1]>>16&1),F[de-1]&=65535;F[15]=b[15]-32767-(F[14]>>16&1);const re=F[15]>>16&1;F[14]&=65535,h(b,F,1-re)}for(let N=0;N<16;N++)D[2*N]=b[N]&255,D[2*N+1]=b[N]>>8}function l(D,B){for(let F=0;F<16;F++)D[F]=B[2*F]+(B[2*F+1]<<8);D[15]&=32767}function m(D,B,F){for(let b=0;b<16;b++)D[b]=B[b]+F[b]}function _(D,B,F){for(let b=0;b<16;b++)D[b]=B[b]-F[b]}function P(D,B,F){let b,N,re=0,de=0,$=0,u=0,y=0,w=0,E=0,O=0,L=0,C=0,I=0,d=0,M=0,ne=0,ee=0,fe=0,pe=0,he=0,W=0,Q=0,K=0,v=0,H=0,oe=0,le=0,je=0,we=0,Pe=0,ut=0,Ne=0,ze=0,st=F[0],Me=F[1],me=F[2],Be=F[3],Ie=F[4],Ae=F[5],qe=F[6],xe=F[7],Se=F[8],Fe=F[9],Re=F[10],Ee=F[11],at=F[12],Te=F[13],Ce=F[14],lt=F[15];b=B[0],re+=b*st,de+=b*Me,$+=b*me,u+=b*Be,y+=b*Ie,w+=b*Ae,E+=b*qe,O+=b*xe,L+=b*Se,C+=b*Fe,I+=b*Re,d+=b*Ee,M+=b*at,ne+=b*Te,ee+=b*Ce,fe+=b*lt,b=B[1],de+=b*st,$+=b*Me,u+=b*me,y+=b*Be,w+=b*Ie,E+=b*Ae,O+=b*qe,L+=b*xe,C+=b*Se,I+=b*Fe,d+=b*Re,M+=b*Ee,ne+=b*at,ee+=b*Te,fe+=b*Ce,pe+=b*lt,b=B[2],$+=b*st,u+=b*Me,y+=b*me,w+=b*Be,E+=b*Ie,O+=b*Ae,L+=b*qe,C+=b*xe,I+=b*Se,d+=b*Fe,M+=b*Re,ne+=b*Ee,ee+=b*at,fe+=b*Te,pe+=b*Ce,he+=b*lt,b=B[3],u+=b*st,y+=b*Me,w+=b*me,E+=b*Be,O+=b*Ie,L+=b*Ae,C+=b*qe,I+=b*xe,d+=b*Se,M+=b*Fe,ne+=b*Re,ee+=b*Ee,fe+=b*at,pe+=b*Te,he+=b*Ce,W+=b*lt,b=B[4],y+=b*st,w+=b*Me,E+=b*me,O+=b*Be,L+=b*Ie,C+=b*Ae,I+=b*qe,d+=b*xe,M+=b*Se,ne+=b*Fe,ee+=b*Re,fe+=b*Ee,pe+=b*at,he+=b*Te,W+=b*Ce,Q+=b*lt,b=B[5],w+=b*st,E+=b*Me,O+=b*me,L+=b*Be,C+=b*Ie,I+=b*Ae,d+=b*qe,M+=b*xe,ne+=b*Se,ee+=b*Fe,fe+=b*Re,pe+=b*Ee,he+=b*at,W+=b*Te,Q+=b*Ce,K+=b*lt,b=B[6],E+=b*st,O+=b*Me,L+=b*me,C+=b*Be,I+=b*Ie,d+=b*Ae,M+=b*qe,ne+=b*xe,ee+=b*Se,fe+=b*Fe,pe+=b*Re,he+=b*Ee,W+=b*at,Q+=b*Te,K+=b*Ce,v+=b*lt,b=B[7],O+=b*st,L+=b*Me,C+=b*me,I+=b*Be,d+=b*Ie,M+=b*Ae,ne+=b*qe,ee+=b*xe,fe+=b*Se,pe+=b*Fe,he+=b*Re,W+=b*Ee,Q+=b*at,K+=b*Te,v+=b*Ce,H+=b*lt,b=B[8],L+=b*st,C+=b*Me,I+=b*me,d+=b*Be,M+=b*Ie,ne+=b*Ae,ee+=b*qe,fe+=b*xe,pe+=b*Se,he+=b*Fe,W+=b*Re,Q+=b*Ee,K+=b*at,v+=b*Te,H+=b*Ce,oe+=b*lt,b=B[9],C+=b*st,I+=b*Me,d+=b*me,M+=b*Be,ne+=b*Ie,ee+=b*Ae,fe+=b*qe,pe+=b*xe,he+=b*Se,W+=b*Fe,Q+=b*Re,K+=b*Ee,v+=b*at,H+=b*Te,oe+=b*Ce,le+=b*lt,b=B[10],I+=b*st,d+=b*Me,M+=b*me,ne+=b*Be,ee+=b*Ie,fe+=b*Ae,pe+=b*qe,he+=b*xe,W+=b*Se,Q+=b*Fe,K+=b*Re,v+=b*Ee,H+=b*at,oe+=b*Te,le+=b*Ce,je+=b*lt,b=B[11],d+=b*st,M+=b*Me,ne+=b*me,ee+=b*Be,fe+=b*Ie,pe+=b*Ae,he+=b*qe,W+=b*xe,Q+=b*Se,K+=b*Fe,v+=b*Re,H+=b*Ee,oe+=b*at,le+=b*Te,je+=b*Ce,we+=b*lt,b=B[12],M+=b*st,ne+=b*Me,ee+=b*me,fe+=b*Be,pe+=b*Ie,he+=b*Ae,W+=b*qe,Q+=b*xe,K+=b*Se,v+=b*Fe,H+=b*Re,oe+=b*Ee,le+=b*at,je+=b*Te,we+=b*Ce,Pe+=b*lt,b=B[13],ne+=b*st,ee+=b*Me,fe+=b*me,pe+=b*Be,he+=b*Ie,W+=b*Ae,Q+=b*qe,K+=b*xe,v+=b*Se,H+=b*Fe,oe+=b*Re,le+=b*Ee,je+=b*at,we+=b*Te,Pe+=b*Ce,ut+=b*lt,b=B[14],ee+=b*st,fe+=b*Me,pe+=b*me,he+=b*Be,W+=b*Ie,Q+=b*Ae,K+=b*qe,v+=b*xe,H+=b*Se,oe+=b*Fe,le+=b*Re,je+=b*Ee,we+=b*at,Pe+=b*Te,ut+=b*Ce,Ne+=b*lt,b=B[15],fe+=b*st,pe+=b*Me,he+=b*me,W+=b*Be,Q+=b*Ie,K+=b*Ae,v+=b*qe,H+=b*xe,oe+=b*Se,le+=b*Fe,je+=b*Re,we+=b*Ee,Pe+=b*at,ut+=b*Te,Ne+=b*Ce,ze+=b*lt,re+=38*pe,de+=38*he,$+=38*W,u+=38*Q,y+=38*K,w+=38*v,E+=38*H,O+=38*oe,L+=38*le,C+=38*je,I+=38*we,d+=38*Pe,M+=38*ut,ne+=38*Ne,ee+=38*ze,N=1,b=re+N+65535,N=Math.floor(b/65536),re=b-N*65536,b=de+N+65535,N=Math.floor(b/65536),de=b-N*65536,b=$+N+65535,N=Math.floor(b/65536),$=b-N*65536,b=u+N+65535,N=Math.floor(b/65536),u=b-N*65536,b=y+N+65535,N=Math.floor(b/65536),y=b-N*65536,b=w+N+65535,N=Math.floor(b/65536),w=b-N*65536,b=E+N+65535,N=Math.floor(b/65536),E=b-N*65536,b=O+N+65535,N=Math.floor(b/65536),O=b-N*65536,b=L+N+65535,N=Math.floor(b/65536),L=b-N*65536,b=C+N+65535,N=Math.floor(b/65536),C=b-N*65536,b=I+N+65535,N=Math.floor(b/65536),I=b-N*65536,b=d+N+65535,N=Math.floor(b/65536),d=b-N*65536,b=M+N+65535,N=Math.floor(b/65536),M=b-N*65536,b=ne+N+65535,N=Math.floor(b/65536),ne=b-N*65536,b=ee+N+65535,N=Math.floor(b/65536),ee=b-N*65536,b=fe+N+65535,N=Math.floor(b/65536),fe=b-N*65536,re+=N-1+37*(N-1),N=1,b=re+N+65535,N=Math.floor(b/65536),re=b-N*65536,b=de+N+65535,N=Math.floor(b/65536),de=b-N*65536,b=$+N+65535,N=Math.floor(b/65536),$=b-N*65536,b=u+N+65535,N=Math.floor(b/65536),u=b-N*65536,b=y+N+65535,N=Math.floor(b/65536),y=b-N*65536,b=w+N+65535,N=Math.floor(b/65536),w=b-N*65536,b=E+N+65535,N=Math.floor(b/65536),E=b-N*65536,b=O+N+65535,N=Math.floor(b/65536),O=b-N*65536,b=L+N+65535,N=Math.floor(b/65536),L=b-N*65536,b=C+N+65535,N=Math.floor(b/65536),C=b-N*65536,b=I+N+65535,N=Math.floor(b/65536),I=b-N*65536,b=d+N+65535,N=Math.floor(b/65536),d=b-N*65536,b=M+N+65535,N=Math.floor(b/65536),M=b-N*65536,b=ne+N+65535,N=Math.floor(b/65536),ne=b-N*65536,b=ee+N+65535,N=Math.floor(b/65536),ee=b-N*65536,b=fe+N+65535,N=Math.floor(b/65536),fe=b-N*65536,re+=N-1+37*(N-1),D[0]=re,D[1]=de,D[2]=$,D[3]=u,D[4]=y,D[5]=w,D[6]=E,D[7]=O,D[8]=L,D[9]=C,D[10]=I,D[11]=d,D[12]=M,D[13]=ne,D[14]=ee,D[15]=fe}function x(D,B){P(D,B,B)}function T(D,B){const F=i();for(let b=0;b<16;b++)F[b]=B[b];for(let b=253;b>=0;b--)x(F,F),b!==2&&b!==4&&P(F,F,B);for(let b=0;b<16;b++)D[b]=F[b]}function j(D,B){const F=new Uint8Array(32),b=new Float64Array(80),N=i(),re=i(),de=i(),$=i(),u=i(),y=i();for(let L=0;L<31;L++)F[L]=D[L];F[31]=D[31]&127|64,F[0]&=248,l(b,B);for(let L=0;L<16;L++)re[L]=b[L];N[0]=$[0]=1;for(let L=254;L>=0;--L){const C=F[L>>>3]>>>(L&7)&1;h(N,re,C),h(de,$,C),m(u,N,de),_(N,N,de),m(de,re,$),_(re,re,$),x($,u),x(y,N),P(N,de,N),P(de,re,u),m(u,N,de),_(N,N,de),x(re,N),_(de,$,y),P(N,de,o),m(N,N,$),P(de,de,N),P(N,$,y),P($,re,b),x(re,u),h(N,re,C),h(de,$,C)}for(let L=0;L<16;L++)b[L+16]=N[L],b[L+32]=de[L],b[L+48]=re[L],b[L+64]=$[L];const w=b.subarray(32),E=b.subarray(16);T(w,w),P(E,E,w);const O=new Uint8Array(32);return p(O,E),O}r.scalarMult=j;function G(D){return j(D,s)}r.scalarMultBase=G;function X(D){if(D.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const B=new Uint8Array(D);return{publicKey:G(B),secretKey:B}}r.generateKeyPairFromSeed=X;function U(D){const B=(0,e.randomBytes)(32,D),F=X(B);return(0,t.wipe)(B),F}r.generateKeyPair=U;function V(D,B,F=!1){if(D.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(B.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const b=j(D,B);if(F){let N=0;for(let re=0;re<b.length;re++)N|=b[re];if(N===0)throw new Error("X25519: invalid shared key")}return b}r.sharedKey=V})(du);function cg(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function gh(r,e){e||(e=r.reduce((s,o)=>s+o.length,0));const t=cg(e);let i=0;for(const s of r)t.set(s,i),i+=s.length;return t}function fg(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const Xd=fg("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),bh=fg("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=cg(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),hg={utf8:Xd,"utf-8":Xd,hex:gc.base16,latin1:bh,ascii:bh,binary:bh,...gc};function si(r,e="utf8"){const t=hg[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):t.decoder.decode(`${t.prefix}${r}`)}function kr(r,e="utf8"){const t=hg[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var ug={};const e3="elliptic",t3="6.5.7",r3="EC cryptography",i3="lib/elliptic.js",n3=["lib"],s3={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},a3={type:"git",url:"git@github.com:indutny/elliptic"},o3=["EC","Elliptic","curve","Cryptography"],c3="Fedor Indutny <fedor@indutny.com>",f3="MIT",h3={url:"https://github.com/indutny/elliptic/issues"},u3="https://github.com/indutny/elliptic",l3={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},d3={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},p3={name:e3,version:t3,description:r3,main:i3,files:n3,scripts:s3,repository:a3,keywords:o3,author:c3,license:f3,bugs:h3,homepage:u3,devDependencies:l3,dependencies:d3};var Gr={},pu={exports:{}};pu.exports;(function(r){(function(e,t){function i($,u){if(!$)throw new Error(u||"Assertion failed")}function s($,u){$.super_=u;var y=function(){};y.prototype=u.prototype,$.prototype=new y,$.prototype.constructor=$}function o($,u,y){if(o.isBN($))return $;this.negative=0,this.words=null,this.length=0,this.red=null,$!==null&&((u==="le"||u==="be")&&(y=u,u=10),this._init($||0,u||10,y||"be"))}typeof e=="object"?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=r2.Buffer}catch{}o.isBN=function(u){return u instanceof o?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===o.wordSize&&Array.isArray(u.words)},o.max=function(u,y){return u.cmp(y)>0?u:y},o.min=function(u,y){return u.cmp(y)<0?u:y},o.prototype._init=function(u,y,w){if(typeof u=="number")return this._initNumber(u,y,w);if(typeof u=="object")return this._initArray(u,y,w);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),u=u.toString().replace(/\s+/g,"");var E=0;u[0]==="-"&&(E++,this.negative=1),E<u.length&&(y===16?this._parseHex(u,E,w):(this._parseBase(u,y,E),w==="le"&&this._initArray(this.toArray(),y,w)))},o.prototype._initNumber=function(u,y,w){u<0&&(this.negative=1,u=-u),u<67108864?(this.words=[u&67108863],this.length=1):u<4503599627370496?(this.words=[u&67108863,u/67108864&67108863],this.length=2):(i(u<9007199254740992),this.words=[u&67108863,u/67108864&67108863,1],this.length=3),w==="le"&&this._initArray(this.toArray(),y,w)},o.prototype._initArray=function(u,y,w){if(i(typeof u.length=="number"),u.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(u.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var O,L,C=0;if(w==="be")for(E=u.length-1,O=0;E>=0;E-=3)L=u[E]|u[E-1]<<8|u[E-2]<<16,this.words[O]|=L<<C&67108863,this.words[O+1]=L>>>26-C&67108863,C+=24,C>=26&&(C-=26,O++);else if(w==="le")for(E=0,O=0;E<u.length;E+=3)L=u[E]|u[E+1]<<8|u[E+2]<<16,this.words[O]|=L<<C&67108863,this.words[O+1]=L>>>26-C&67108863,C+=24,C>=26&&(C-=26,O++);return this.strip()};function h($,u){var y=$.charCodeAt(u);return y>=65&&y<=70?y-55:y>=97&&y<=102?y-87:y-48&15}function p($,u,y){var w=h($,y);return y-1>=u&&(w|=h($,y-1)<<4),w}o.prototype._parseHex=function(u,y,w){this.length=Math.ceil((u.length-y)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var O=0,L=0,C;if(w==="be")for(E=u.length-1;E>=y;E-=2)C=p(u,y,E)<<O,this.words[L]|=C&67108863,O>=18?(O-=18,L+=1,this.words[L]|=C>>>26):O+=8;else{var I=u.length-y;for(E=I%2===0?y+1:y;E<u.length;E+=2)C=p(u,y,E)<<O,this.words[L]|=C&67108863,O>=18?(O-=18,L+=1,this.words[L]|=C>>>26):O+=8}this.strip()};function l($,u,y,w){for(var E=0,O=Math.min($.length,y),L=u;L<O;L++){var C=$.charCodeAt(L)-48;E*=w,C>=49?E+=C-49+10:C>=17?E+=C-17+10:E+=C}return E}o.prototype._parseBase=function(u,y,w){this.words=[0],this.length=1;for(var E=0,O=1;O<=67108863;O*=y)E++;E--,O=O/y|0;for(var L=u.length-w,C=L%E,I=Math.min(L,L-C)+w,d=0,M=w;M<I;M+=E)d=l(u,M,M+E,y),this.imuln(O),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var ne=1;for(d=l(u,M,u.length,y),M=0;M<C;M++)ne*=y;this.imuln(ne),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},o.prototype.copy=function(u){u.words=new Array(this.length);for(var y=0;y<this.length;y++)u.words[y]=this.words[y];u.length=this.length,u.negative=this.negative,u.red=this.red},o.prototype.clone=function(){var u=new o(null);return this.copy(u),u},o.prototype._expand=function(u){for(;this.length<u;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var m=["","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"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(u,y){u=u||10,y=y|0||1;var w;if(u===16||u==="hex"){w="";for(var E=0,O=0,L=0;L<this.length;L++){var C=this.words[L],I=((C<<E|O)&16777215).toString(16);O=C>>>24-E&16777215,O!==0||L!==this.length-1?w=m[6-I.length]+I+w:w=I+w,E+=2,E>=26&&(E-=26,L--)}for(O!==0&&(w=O.toString(16)+w);w.length%y!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(u===(u|0)&&u>=2&&u<=36){var d=_[u],M=P[u];w="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var ee=ne.modn(M).toString(u);ne=ne.idivn(M),ne.isZero()?w=ee+w:w=m[d-ee.length]+ee+w}for(this.isZero()&&(w="0"+w);w.length%y!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(u,y){return i(typeof f<"u"),this.toArrayLike(f,u,y)},o.prototype.toArray=function(u,y){return this.toArrayLike(Array,u,y)},o.prototype.toArrayLike=function(u,y,w){var E=this.byteLength(),O=w||Math.max(1,E);i(E<=O,"byte array longer than desired length"),i(O>0,"Requested array length <= 0"),this.strip();var L=y==="le",C=new u(O),I,d,M=this.clone();if(L){for(d=0;!M.isZero();d++)I=M.andln(255),M.iushrn(8),C[d]=I;for(;d<O;d++)C[d]=0}else{for(d=0;d<O-E;d++)C[d]=0;for(d=0;!M.isZero();d++)I=M.andln(255),M.iushrn(8),C[O-d-1]=I}return C},Math.clz32?o.prototype._countBits=function(u){return 32-Math.clz32(u)}:o.prototype._countBits=function(u){var y=u,w=0;return y>=4096&&(w+=13,y>>>=13),y>=64&&(w+=7,y>>>=7),y>=8&&(w+=4,y>>>=4),y>=2&&(w+=2,y>>>=2),w+y},o.prototype._zeroBits=function(u){if(u===0)return 26;var y=u,w=0;return y&8191||(w+=13,y>>>=13),y&127||(w+=7,y>>>=7),y&15||(w+=4,y>>>=4),y&3||(w+=2,y>>>=2),y&1||w++,w},o.prototype.bitLength=function(){var u=this.words[this.length-1],y=this._countBits(u);return(this.length-1)*26+y};function x($){for(var u=new Array($.bitLength()),y=0;y<u.length;y++){var w=y/26|0,E=y%26;u[y]=($.words[w]&1<<E)>>>E}return u}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,y=0;y<this.length;y++){var w=this._zeroBits(this.words[y]);if(u+=w,w!==26)break}return u},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(u){return this.negative!==0?this.abs().inotn(u).iaddn(1):this.clone()},o.prototype.fromTwos=function(u){return this.testn(u-1)?this.notn(u).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(u){for(;this.length<u.length;)this.words[this.length++]=0;for(var y=0;y<u.length;y++)this.words[y]=this.words[y]|u.words[y];return this.strip()},o.prototype.ior=function(u){return i((this.negative|u.negative)===0),this.iuor(u)},o.prototype.or=function(u){return this.length>u.length?this.clone().ior(u):u.clone().ior(this)},o.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},o.prototype.iuand=function(u){var y;this.length>u.length?y=u:y=this;for(var w=0;w<y.length;w++)this.words[w]=this.words[w]&u.words[w];return this.length=y.length,this.strip()},o.prototype.iand=function(u){return i((this.negative|u.negative)===0),this.iuand(u)},o.prototype.and=function(u){return this.length>u.length?this.clone().iand(u):u.clone().iand(this)},o.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},o.prototype.iuxor=function(u){var y,w;this.length>u.length?(y=this,w=u):(y=u,w=this);for(var E=0;E<w.length;E++)this.words[E]=y.words[E]^w.words[E];if(this!==y)for(;E<y.length;E++)this.words[E]=y.words[E];return this.length=y.length,this.strip()},o.prototype.ixor=function(u){return i((this.negative|u.negative)===0),this.iuxor(u)},o.prototype.xor=function(u){return this.length>u.length?this.clone().ixor(u):u.clone().ixor(this)},o.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},o.prototype.inotn=function(u){i(typeof u=="number"&&u>=0);var y=Math.ceil(u/26)|0,w=u%26;this._expand(y),w>0&&y--;for(var E=0;E<y;E++)this.words[E]=~this.words[E]&67108863;return w>0&&(this.words[E]=~this.words[E]&67108863>>26-w),this.strip()},o.prototype.notn=function(u){return this.clone().inotn(u)},o.prototype.setn=function(u,y){i(typeof u=="number"&&u>=0);var w=u/26|0,E=u%26;return this._expand(w+1),y?this.words[w]=this.words[w]|1<<E:this.words[w]=this.words[w]&~(1<<E),this.strip()},o.prototype.iadd=function(u){var y;if(this.negative!==0&&u.negative===0)return this.negative=0,y=this.isub(u),this.negative^=1,this._normSign();if(this.negative===0&&u.negative!==0)return u.negative=0,y=this.isub(u),u.negative=1,y._normSign();var w,E;this.length>u.length?(w=this,E=u):(w=u,E=this);for(var O=0,L=0;L<E.length;L++)y=(w.words[L]|0)+(E.words[L]|0)+O,this.words[L]=y&67108863,O=y>>>26;for(;O!==0&&L<w.length;L++)y=(w.words[L]|0)+O,this.words[L]=y&67108863,O=y>>>26;if(this.length=w.length,O!==0)this.words[this.length]=O,this.length++;else if(w!==this)for(;L<w.length;L++)this.words[L]=w.words[L];return this},o.prototype.add=function(u){var y;return u.negative!==0&&this.negative===0?(u.negative=0,y=this.sub(u),u.negative^=1,y):u.negative===0&&this.negative!==0?(this.negative=0,y=u.sub(this),this.negative=1,y):this.length>u.length?this.clone().iadd(u):u.clone().iadd(this)},o.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var y=this.iadd(u);return u.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var w=this.cmp(u);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,O;w>0?(E=this,O=u):(E=u,O=this);for(var L=0,C=0;C<O.length;C++)y=(E.words[C]|0)-(O.words[C]|0)+L,L=y>>26,this.words[C]=y&67108863;for(;L!==0&&C<E.length;C++)y=(E.words[C]|0)+L,L=y>>26,this.words[C]=y&67108863;if(L===0&&C<E.length&&E!==this)for(;C<E.length;C++)this.words[C]=E.words[C];return this.length=Math.max(this.length,C),E!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(u){return this.clone().isub(u)};function T($,u,y){y.negative=u.negative^$.negative;var w=$.length+u.length|0;y.length=w,w=w-1|0;var E=$.words[0]|0,O=u.words[0]|0,L=E*O,C=L&67108863,I=L/67108864|0;y.words[0]=C;for(var d=1;d<w;d++){for(var M=I>>>26,ne=I&67108863,ee=Math.min(d,u.length-1),fe=Math.max(0,d-$.length+1);fe<=ee;fe++){var pe=d-fe|0;E=$.words[pe]|0,O=u.words[fe]|0,L=E*O+ne,M+=L/67108864|0,ne=L&67108863}y.words[d]=ne|0,I=M|0}return I!==0?y.words[d]=I|0:y.length--,y.strip()}var j=function(u,y,w){var E=u.words,O=y.words,L=w.words,C=0,I,d,M,ne=E[0]|0,ee=ne&8191,fe=ne>>>13,pe=E[1]|0,he=pe&8191,W=pe>>>13,Q=E[2]|0,K=Q&8191,v=Q>>>13,H=E[3]|0,oe=H&8191,le=H>>>13,je=E[4]|0,we=je&8191,Pe=je>>>13,ut=E[5]|0,Ne=ut&8191,ze=ut>>>13,st=E[6]|0,Me=st&8191,me=st>>>13,Be=E[7]|0,Ie=Be&8191,Ae=Be>>>13,qe=E[8]|0,xe=qe&8191,Se=qe>>>13,Fe=E[9]|0,Re=Fe&8191,Ee=Fe>>>13,at=O[0]|0,Te=at&8191,Ce=at>>>13,lt=O[1]|0,ct=lt&8191,pt=lt>>>13,dr=O[2]|0,yt=dr&8191,gt=dr>>>13,ui=O[3]|0,It=ui&8191,Ze=ui>>>13,Nt=O[4]|0,He=Nt&8191,Ge=Nt>>>13,$t=O[5]|0,ke=$t&8191,Ke=$t>>>13,Ft=O[6]|0,tt=Ft&8191,Ve=Ft>>>13,Ht=O[7]|0,Ye=Ht&8191,Qe=Ht>>>13,Lt=O[8]|0,Ue=Lt&8191,rt=Lt>>>13,bs=O[9]|0,Ut=bs&8191,zt=bs>>>13;w.negative=u.negative^y.negative,w.length=19,I=Math.imul(ee,Te),d=Math.imul(ee,Ce),d=d+Math.imul(fe,Te)|0,M=Math.imul(fe,Ce);var Mn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,I=Math.imul(he,Te),d=Math.imul(he,Ce),d=d+Math.imul(W,Te)|0,M=Math.imul(W,Ce),I=I+Math.imul(ee,ct)|0,d=d+Math.imul(ee,pt)|0,d=d+Math.imul(fe,ct)|0,M=M+Math.imul(fe,pt)|0;var pr=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(pr>>>26)|0,pr&=67108863,I=Math.imul(K,Te),d=Math.imul(K,Ce),d=d+Math.imul(v,Te)|0,M=Math.imul(v,Ce),I=I+Math.imul(he,ct)|0,d=d+Math.imul(he,pt)|0,d=d+Math.imul(W,ct)|0,M=M+Math.imul(W,pt)|0,I=I+Math.imul(ee,yt)|0,d=d+Math.imul(ee,gt)|0,d=d+Math.imul(fe,yt)|0,M=M+Math.imul(fe,gt)|0;var An=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(An>>>26)|0,An&=67108863,I=Math.imul(oe,Te),d=Math.imul(oe,Ce),d=d+Math.imul(le,Te)|0,M=Math.imul(le,Ce),I=I+Math.imul(K,ct)|0,d=d+Math.imul(K,pt)|0,d=d+Math.imul(v,ct)|0,M=M+Math.imul(v,pt)|0,I=I+Math.imul(he,yt)|0,d=d+Math.imul(he,gt)|0,d=d+Math.imul(W,yt)|0,M=M+Math.imul(W,gt)|0,I=I+Math.imul(ee,It)|0,d=d+Math.imul(ee,Ze)|0,d=d+Math.imul(fe,It)|0,M=M+Math.imul(fe,Ze)|0;var On=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(On>>>26)|0,On&=67108863,I=Math.imul(we,Te),d=Math.imul(we,Ce),d=d+Math.imul(Pe,Te)|0,M=Math.imul(Pe,Ce),I=I+Math.imul(oe,ct)|0,d=d+Math.imul(oe,pt)|0,d=d+Math.imul(le,ct)|0,M=M+Math.imul(le,pt)|0,I=I+Math.imul(K,yt)|0,d=d+Math.imul(K,gt)|0,d=d+Math.imul(v,yt)|0,M=M+Math.imul(v,gt)|0,I=I+Math.imul(he,It)|0,d=d+Math.imul(he,Ze)|0,d=d+Math.imul(W,It)|0,M=M+Math.imul(W,Ze)|0,I=I+Math.imul(ee,He)|0,d=d+Math.imul(ee,Ge)|0,d=d+Math.imul(fe,He)|0,M=M+Math.imul(fe,Ge)|0;var Rn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,I=Math.imul(Ne,Te),d=Math.imul(Ne,Ce),d=d+Math.imul(ze,Te)|0,M=Math.imul(ze,Ce),I=I+Math.imul(we,ct)|0,d=d+Math.imul(we,pt)|0,d=d+Math.imul(Pe,ct)|0,M=M+Math.imul(Pe,pt)|0,I=I+Math.imul(oe,yt)|0,d=d+Math.imul(oe,gt)|0,d=d+Math.imul(le,yt)|0,M=M+Math.imul(le,gt)|0,I=I+Math.imul(K,It)|0,d=d+Math.imul(K,Ze)|0,d=d+Math.imul(v,It)|0,M=M+Math.imul(v,Ze)|0,I=I+Math.imul(he,He)|0,d=d+Math.imul(he,Ge)|0,d=d+Math.imul(W,He)|0,M=M+Math.imul(W,Ge)|0,I=I+Math.imul(ee,ke)|0,d=d+Math.imul(ee,Ke)|0,d=d+Math.imul(fe,ke)|0,M=M+Math.imul(fe,Ke)|0;var Tn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,I=Math.imul(Me,Te),d=Math.imul(Me,Ce),d=d+Math.imul(me,Te)|0,M=Math.imul(me,Ce),I=I+Math.imul(Ne,ct)|0,d=d+Math.imul(Ne,pt)|0,d=d+Math.imul(ze,ct)|0,M=M+Math.imul(ze,pt)|0,I=I+Math.imul(we,yt)|0,d=d+Math.imul(we,gt)|0,d=d+Math.imul(Pe,yt)|0,M=M+Math.imul(Pe,gt)|0,I=I+Math.imul(oe,It)|0,d=d+Math.imul(oe,Ze)|0,d=d+Math.imul(le,It)|0,M=M+Math.imul(le,Ze)|0,I=I+Math.imul(K,He)|0,d=d+Math.imul(K,Ge)|0,d=d+Math.imul(v,He)|0,M=M+Math.imul(v,Ge)|0,I=I+Math.imul(he,ke)|0,d=d+Math.imul(he,Ke)|0,d=d+Math.imul(W,ke)|0,M=M+Math.imul(W,Ke)|0,I=I+Math.imul(ee,tt)|0,d=d+Math.imul(ee,Ve)|0,d=d+Math.imul(fe,tt)|0,M=M+Math.imul(fe,Ve)|0;var Cn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,I=Math.imul(Ie,Te),d=Math.imul(Ie,Ce),d=d+Math.imul(Ae,Te)|0,M=Math.imul(Ae,Ce),I=I+Math.imul(Me,ct)|0,d=d+Math.imul(Me,pt)|0,d=d+Math.imul(me,ct)|0,M=M+Math.imul(me,pt)|0,I=I+Math.imul(Ne,yt)|0,d=d+Math.imul(Ne,gt)|0,d=d+Math.imul(ze,yt)|0,M=M+Math.imul(ze,gt)|0,I=I+Math.imul(we,It)|0,d=d+Math.imul(we,Ze)|0,d=d+Math.imul(Pe,It)|0,M=M+Math.imul(Pe,Ze)|0,I=I+Math.imul(oe,He)|0,d=d+Math.imul(oe,Ge)|0,d=d+Math.imul(le,He)|0,M=M+Math.imul(le,Ge)|0,I=I+Math.imul(K,ke)|0,d=d+Math.imul(K,Ke)|0,d=d+Math.imul(v,ke)|0,M=M+Math.imul(v,Ke)|0,I=I+Math.imul(he,tt)|0,d=d+Math.imul(he,Ve)|0,d=d+Math.imul(W,tt)|0,M=M+Math.imul(W,Ve)|0,I=I+Math.imul(ee,Ye)|0,d=d+Math.imul(ee,Qe)|0,d=d+Math.imul(fe,Ye)|0,M=M+Math.imul(fe,Qe)|0;var qr=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(qr>>>26)|0,qr&=67108863,I=Math.imul(xe,Te),d=Math.imul(xe,Ce),d=d+Math.imul(Se,Te)|0,M=Math.imul(Se,Ce),I=I+Math.imul(Ie,ct)|0,d=d+Math.imul(Ie,pt)|0,d=d+Math.imul(Ae,ct)|0,M=M+Math.imul(Ae,pt)|0,I=I+Math.imul(Me,yt)|0,d=d+Math.imul(Me,gt)|0,d=d+Math.imul(me,yt)|0,M=M+Math.imul(me,gt)|0,I=I+Math.imul(Ne,It)|0,d=d+Math.imul(Ne,Ze)|0,d=d+Math.imul(ze,It)|0,M=M+Math.imul(ze,Ze)|0,I=I+Math.imul(we,He)|0,d=d+Math.imul(we,Ge)|0,d=d+Math.imul(Pe,He)|0,M=M+Math.imul(Pe,Ge)|0,I=I+Math.imul(oe,ke)|0,d=d+Math.imul(oe,Ke)|0,d=d+Math.imul(le,ke)|0,M=M+Math.imul(le,Ke)|0,I=I+Math.imul(K,tt)|0,d=d+Math.imul(K,Ve)|0,d=d+Math.imul(v,tt)|0,M=M+Math.imul(v,Ve)|0,I=I+Math.imul(he,Ye)|0,d=d+Math.imul(he,Qe)|0,d=d+Math.imul(W,Ye)|0,M=M+Math.imul(W,Qe)|0,I=I+Math.imul(ee,Ue)|0,d=d+Math.imul(ee,rt)|0,d=d+Math.imul(fe,Ue)|0,M=M+Math.imul(fe,rt)|0;var xi=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(xi>>>26)|0,xi&=67108863,I=Math.imul(Re,Te),d=Math.imul(Re,Ce),d=d+Math.imul(Ee,Te)|0,M=Math.imul(Ee,Ce),I=I+Math.imul(xe,ct)|0,d=d+Math.imul(xe,pt)|0,d=d+Math.imul(Se,ct)|0,M=M+Math.imul(Se,pt)|0,I=I+Math.imul(Ie,yt)|0,d=d+Math.imul(Ie,gt)|0,d=d+Math.imul(Ae,yt)|0,M=M+Math.imul(Ae,gt)|0,I=I+Math.imul(Me,It)|0,d=d+Math.imul(Me,Ze)|0,d=d+Math.imul(me,It)|0,M=M+Math.imul(me,Ze)|0,I=I+Math.imul(Ne,He)|0,d=d+Math.imul(Ne,Ge)|0,d=d+Math.imul(ze,He)|0,M=M+Math.imul(ze,Ge)|0,I=I+Math.imul(we,ke)|0,d=d+Math.imul(we,Ke)|0,d=d+Math.imul(Pe,ke)|0,M=M+Math.imul(Pe,Ke)|0,I=I+Math.imul(oe,tt)|0,d=d+Math.imul(oe,Ve)|0,d=d+Math.imul(le,tt)|0,M=M+Math.imul(le,Ve)|0,I=I+Math.imul(K,Ye)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(v,Ye)|0,M=M+Math.imul(v,Qe)|0,I=I+Math.imul(he,Ue)|0,d=d+Math.imul(he,rt)|0,d=d+Math.imul(W,Ue)|0,M=M+Math.imul(W,rt)|0,I=I+Math.imul(ee,Ut)|0,d=d+Math.imul(ee,zt)|0,d=d+Math.imul(fe,Ut)|0,M=M+Math.imul(fe,zt)|0;var Nn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,I=Math.imul(Re,ct),d=Math.imul(Re,pt),d=d+Math.imul(Ee,ct)|0,M=Math.imul(Ee,pt),I=I+Math.imul(xe,yt)|0,d=d+Math.imul(xe,gt)|0,d=d+Math.imul(Se,yt)|0,M=M+Math.imul(Se,gt)|0,I=I+Math.imul(Ie,It)|0,d=d+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ae,It)|0,M=M+Math.imul(Ae,Ze)|0,I=I+Math.imul(Me,He)|0,d=d+Math.imul(Me,Ge)|0,d=d+Math.imul(me,He)|0,M=M+Math.imul(me,Ge)|0,I=I+Math.imul(Ne,ke)|0,d=d+Math.imul(Ne,Ke)|0,d=d+Math.imul(ze,ke)|0,M=M+Math.imul(ze,Ke)|0,I=I+Math.imul(we,tt)|0,d=d+Math.imul(we,Ve)|0,d=d+Math.imul(Pe,tt)|0,M=M+Math.imul(Pe,Ve)|0,I=I+Math.imul(oe,Ye)|0,d=d+Math.imul(oe,Qe)|0,d=d+Math.imul(le,Ye)|0,M=M+Math.imul(le,Qe)|0,I=I+Math.imul(K,Ue)|0,d=d+Math.imul(K,rt)|0,d=d+Math.imul(v,Ue)|0,M=M+Math.imul(v,rt)|0,I=I+Math.imul(he,Ut)|0,d=d+Math.imul(he,zt)|0,d=d+Math.imul(W,Ut)|0,M=M+Math.imul(W,zt)|0;var Pi=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,I=Math.imul(Re,yt),d=Math.imul(Re,gt),d=d+Math.imul(Ee,yt)|0,M=Math.imul(Ee,gt),I=I+Math.imul(xe,It)|0,d=d+Math.imul(xe,Ze)|0,d=d+Math.imul(Se,It)|0,M=M+Math.imul(Se,Ze)|0,I=I+Math.imul(Ie,He)|0,d=d+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ae,He)|0,M=M+Math.imul(Ae,Ge)|0,I=I+Math.imul(Me,ke)|0,d=d+Math.imul(Me,Ke)|0,d=d+Math.imul(me,ke)|0,M=M+Math.imul(me,Ke)|0,I=I+Math.imul(Ne,tt)|0,d=d+Math.imul(Ne,Ve)|0,d=d+Math.imul(ze,tt)|0,M=M+Math.imul(ze,Ve)|0,I=I+Math.imul(we,Ye)|0,d=d+Math.imul(we,Qe)|0,d=d+Math.imul(Pe,Ye)|0,M=M+Math.imul(Pe,Qe)|0,I=I+Math.imul(oe,Ue)|0,d=d+Math.imul(oe,rt)|0,d=d+Math.imul(le,Ue)|0,M=M+Math.imul(le,rt)|0,I=I+Math.imul(K,Ut)|0,d=d+Math.imul(K,zt)|0,d=d+Math.imul(v,Ut)|0,M=M+Math.imul(v,zt)|0;var $n=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+($n>>>26)|0,$n&=67108863,I=Math.imul(Re,It),d=Math.imul(Re,Ze),d=d+Math.imul(Ee,It)|0,M=Math.imul(Ee,Ze),I=I+Math.imul(xe,He)|0,d=d+Math.imul(xe,Ge)|0,d=d+Math.imul(Se,He)|0,M=M+Math.imul(Se,Ge)|0,I=I+Math.imul(Ie,ke)|0,d=d+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ae,ke)|0,M=M+Math.imul(Ae,Ke)|0,I=I+Math.imul(Me,tt)|0,d=d+Math.imul(Me,Ve)|0,d=d+Math.imul(me,tt)|0,M=M+Math.imul(me,Ve)|0,I=I+Math.imul(Ne,Ye)|0,d=d+Math.imul(Ne,Qe)|0,d=d+Math.imul(ze,Ye)|0,M=M+Math.imul(ze,Qe)|0,I=I+Math.imul(we,Ue)|0,d=d+Math.imul(we,rt)|0,d=d+Math.imul(Pe,Ue)|0,M=M+Math.imul(Pe,rt)|0,I=I+Math.imul(oe,Ut)|0,d=d+Math.imul(oe,zt)|0,d=d+Math.imul(le,Ut)|0,M=M+Math.imul(le,zt)|0;var Ln=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,I=Math.imul(Re,He),d=Math.imul(Re,Ge),d=d+Math.imul(Ee,He)|0,M=Math.imul(Ee,Ge),I=I+Math.imul(xe,ke)|0,d=d+Math.imul(xe,Ke)|0,d=d+Math.imul(Se,ke)|0,M=M+Math.imul(Se,Ke)|0,I=I+Math.imul(Ie,tt)|0,d=d+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ae,tt)|0,M=M+Math.imul(Ae,Ve)|0,I=I+Math.imul(Me,Ye)|0,d=d+Math.imul(Me,Qe)|0,d=d+Math.imul(me,Ye)|0,M=M+Math.imul(me,Qe)|0,I=I+Math.imul(Ne,Ue)|0,d=d+Math.imul(Ne,rt)|0,d=d+Math.imul(ze,Ue)|0,M=M+Math.imul(ze,rt)|0,I=I+Math.imul(we,Ut)|0,d=d+Math.imul(we,zt)|0,d=d+Math.imul(Pe,Ut)|0,M=M+Math.imul(Pe,zt)|0;var Mi=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,I=Math.imul(Re,ke),d=Math.imul(Re,Ke),d=d+Math.imul(Ee,ke)|0,M=Math.imul(Ee,Ke),I=I+Math.imul(xe,tt)|0,d=d+Math.imul(xe,Ve)|0,d=d+Math.imul(Se,tt)|0,M=M+Math.imul(Se,Ve)|0,I=I+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ae,Ye)|0,M=M+Math.imul(Ae,Qe)|0,I=I+Math.imul(Me,Ue)|0,d=d+Math.imul(Me,rt)|0,d=d+Math.imul(me,Ue)|0,M=M+Math.imul(me,rt)|0,I=I+Math.imul(Ne,Ut)|0,d=d+Math.imul(Ne,zt)|0,d=d+Math.imul(ze,Ut)|0,M=M+Math.imul(ze,zt)|0;var cn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(cn>>>26)|0,cn&=67108863,I=Math.imul(Re,tt),d=Math.imul(Re,Ve),d=d+Math.imul(Ee,tt)|0,M=Math.imul(Ee,Ve),I=I+Math.imul(xe,Ye)|0,d=d+Math.imul(xe,Qe)|0,d=d+Math.imul(Se,Ye)|0,M=M+Math.imul(Se,Qe)|0,I=I+Math.imul(Ie,Ue)|0,d=d+Math.imul(Ie,rt)|0,d=d+Math.imul(Ae,Ue)|0,M=M+Math.imul(Ae,rt)|0,I=I+Math.imul(Me,Ut)|0,d=d+Math.imul(Me,zt)|0,d=d+Math.imul(me,Ut)|0,M=M+Math.imul(me,zt)|0;var fn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(fn>>>26)|0,fn&=67108863,I=Math.imul(Re,Ye),d=Math.imul(Re,Qe),d=d+Math.imul(Ee,Ye)|0,M=Math.imul(Ee,Qe),I=I+Math.imul(xe,Ue)|0,d=d+Math.imul(xe,rt)|0,d=d+Math.imul(Se,Ue)|0,M=M+Math.imul(Se,rt)|0,I=I+Math.imul(Ie,Ut)|0,d=d+Math.imul(Ie,zt)|0,d=d+Math.imul(Ae,Ut)|0,M=M+Math.imul(Ae,zt)|0;var yr=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(yr>>>26)|0,yr&=67108863,I=Math.imul(Re,Ue),d=Math.imul(Re,rt),d=d+Math.imul(Ee,Ue)|0,M=Math.imul(Ee,rt),I=I+Math.imul(xe,Ut)|0,d=d+Math.imul(xe,zt)|0,d=d+Math.imul(Se,Ut)|0,M=M+Math.imul(Se,zt)|0;var Dn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,I=Math.imul(Re,Ut),d=Math.imul(Re,zt),d=d+Math.imul(Ee,Ut)|0,M=Math.imul(Ee,zt);var qn=(C+I|0)+((d&8191)<<13)|0;return C=(M+(d>>>13)|0)+(qn>>>26)|0,qn&=67108863,L[0]=Mn,L[1]=pr,L[2]=An,L[3]=On,L[4]=Rn,L[5]=Tn,L[6]=Cn,L[7]=qr,L[8]=xi,L[9]=Nn,L[10]=Pi,L[11]=$n,L[12]=Ln,L[13]=Mi,L[14]=cn,L[15]=fn,L[16]=yr,L[17]=Dn,L[18]=qn,C!==0&&(L[19]=C,w.length++),w};Math.imul||(j=T);function G($,u,y){y.negative=u.negative^$.negative,y.length=$.length+u.length;for(var w=0,E=0,O=0;O<y.length-1;O++){var L=E;E=0;for(var C=w&67108863,I=Math.min(O,u.length-1),d=Math.max(0,O-$.length+1);d<=I;d++){var M=O-d,ne=$.words[M]|0,ee=u.words[d]|0,fe=ne*ee,pe=fe&67108863;L=L+(fe/67108864|0)|0,pe=pe+C|0,C=pe&67108863,L=L+(pe>>>26)|0,E+=L>>>26,L&=67108863}y.words[O]=C,w=L,L=E}return w!==0?y.words[O]=w:y.length--,y.strip()}function X($,u,y){var w=new U;return w.mulp($,u,y)}o.prototype.mulTo=function(u,y){var w,E=this.length+u.length;return this.length===10&&u.length===10?w=j(this,u,y):E<63?w=T(this,u,y):E<1024?w=G(this,u,y):w=X(this,u,y),w};function U($,u){this.x=$,this.y=u}U.prototype.makeRBT=function(u){for(var y=new Array(u),w=o.prototype._countBits(u)-1,E=0;E<u;E++)y[E]=this.revBin(E,w,u);return y},U.prototype.revBin=function(u,y,w){if(u===0||u===w-1)return u;for(var E=0,O=0;O<y;O++)E|=(u&1)<<y-O-1,u>>=1;return E},U.prototype.permute=function(u,y,w,E,O,L){for(var C=0;C<L;C++)E[C]=y[u[C]],O[C]=w[u[C]]},U.prototype.transform=function(u,y,w,E,O,L){this.permute(L,u,y,w,E,O);for(var C=1;C<O;C<<=1)for(var I=C<<1,d=Math.cos(2*Math.PI/I),M=Math.sin(2*Math.PI/I),ne=0;ne<O;ne+=I)for(var ee=d,fe=M,pe=0;pe<C;pe++){var he=w[ne+pe],W=E[ne+pe],Q=w[ne+pe+C],K=E[ne+pe+C],v=ee*Q-fe*K;K=ee*K+fe*Q,Q=v,w[ne+pe]=he+Q,E[ne+pe]=W+K,w[ne+pe+C]=he-Q,E[ne+pe+C]=W-K,pe!==I&&(v=d*ee-M*fe,fe=d*fe+M*ee,ee=v)}},U.prototype.guessLen13b=function(u,y){var w=Math.max(y,u)|1,E=w&1,O=0;for(w=w/2|0;w;w=w>>>1)O++;return 1<<O+1+E},U.prototype.conjugate=function(u,y,w){if(!(w<=1))for(var E=0;E<w/2;E++){var O=u[E];u[E]=u[w-E-1],u[w-E-1]=O,O=y[E],y[E]=-y[w-E-1],y[w-E-1]=-O}},U.prototype.normalize13b=function(u,y){for(var w=0,E=0;E<y/2;E++){var O=Math.round(u[2*E+1]/y)*8192+Math.round(u[2*E]/y)+w;u[E]=O&67108863,O<67108864?w=0:w=O/67108864|0}return u},U.prototype.convert13b=function(u,y,w,E){for(var O=0,L=0;L<y;L++)O=O+(u[L]|0),w[2*L]=O&8191,O=O>>>13,w[2*L+1]=O&8191,O=O>>>13;for(L=2*y;L<E;++L)w[L]=0;i(O===0),i((O&-8192)===0)},U.prototype.stub=function(u){for(var y=new Array(u),w=0;w<u;w++)y[w]=0;return y},U.prototype.mulp=function(u,y,w){var E=2*this.guessLen13b(u.length,y.length),O=this.makeRBT(E),L=this.stub(E),C=new Array(E),I=new Array(E),d=new Array(E),M=new Array(E),ne=new Array(E),ee=new Array(E),fe=w.words;fe.length=E,this.convert13b(u.words,u.length,C,E),this.convert13b(y.words,y.length,M,E),this.transform(C,L,I,d,E,O),this.transform(M,L,ne,ee,E,O);for(var pe=0;pe<E;pe++){var he=I[pe]*ne[pe]-d[pe]*ee[pe];d[pe]=I[pe]*ee[pe]+d[pe]*ne[pe],I[pe]=he}return this.conjugate(I,d,E),this.transform(I,d,fe,L,E,O),this.conjugate(fe,L,E),this.normalize13b(fe,E),w.negative=u.negative^y.negative,w.length=u.length+y.length,w.strip()},o.prototype.mul=function(u){var y=new o(null);return y.words=new Array(this.length+u.length),this.mulTo(u,y)},o.prototype.mulf=function(u){var y=new o(null);return y.words=new Array(this.length+u.length),X(this,u,y)},o.prototype.imul=function(u){return this.clone().mulTo(u,this)},o.prototype.imuln=function(u){i(typeof u=="number"),i(u<67108864);for(var y=0,w=0;w<this.length;w++){var E=(this.words[w]|0)*u,O=(E&67108863)+(y&67108863);y>>=26,y+=E/67108864|0,y+=O>>>26,this.words[w]=O&67108863}return y!==0&&(this.words[w]=y,this.length++),this},o.prototype.muln=function(u){return this.clone().imuln(u)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(u){var y=x(u);if(y.length===0)return new o(1);for(var w=this,E=0;E<y.length&&y[E]===0;E++,w=w.sqr());if(++E<y.length)for(var O=w.sqr();E<y.length;E++,O=O.sqr())y[E]!==0&&(w=w.mul(O));return w},o.prototype.iushln=function(u){i(typeof u=="number"&&u>=0);var y=u%26,w=(u-y)/26,E=67108863>>>26-y<<26-y,O;if(y!==0){var L=0;for(O=0;O<this.length;O++){var C=this.words[O]&E,I=(this.words[O]|0)-C<<y;this.words[O]=I|L,L=C>>>26-y}L&&(this.words[O]=L,this.length++)}if(w!==0){for(O=this.length-1;O>=0;O--)this.words[O+w]=this.words[O];for(O=0;O<w;O++)this.words[O]=0;this.length+=w}return this.strip()},o.prototype.ishln=function(u){return i(this.negative===0),this.iushln(u)},o.prototype.iushrn=function(u,y,w){i(typeof u=="number"&&u>=0);var E;y?E=(y-y%26)/26:E=0;var O=u%26,L=Math.min((u-O)/26,this.length),C=67108863^67108863>>>O<<O,I=w;if(E-=L,E=Math.max(0,E),I){for(var d=0;d<L;d++)I.words[d]=this.words[d];I.length=L}if(L!==0)if(this.length>L)for(this.length-=L,d=0;d<this.length;d++)this.words[d]=this.words[d+L];else this.words[0]=0,this.length=1;var M=0;for(d=this.length-1;d>=0&&(M!==0||d>=E);d--){var ne=this.words[d]|0;this.words[d]=M<<26-O|ne>>>O,M=ne&C}return I&&M!==0&&(I.words[I.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(u,y,w){return i(this.negative===0),this.iushrn(u,y,w)},o.prototype.shln=function(u){return this.clone().ishln(u)},o.prototype.ushln=function(u){return this.clone().iushln(u)},o.prototype.shrn=function(u){return this.clone().ishrn(u)},o.prototype.ushrn=function(u){return this.clone().iushrn(u)},o.prototype.testn=function(u){i(typeof u=="number"&&u>=0);var y=u%26,w=(u-y)/26,E=1<<y;if(this.length<=w)return!1;var O=this.words[w];return!!(O&E)},o.prototype.imaskn=function(u){i(typeof u=="number"&&u>=0);var y=u%26,w=(u-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(y!==0&&w++,this.length=Math.min(w,this.length),y!==0){var E=67108863^67108863>>>y<<y;this.words[this.length-1]&=E}return this.strip()},o.prototype.maskn=function(u){return this.clone().imaskn(u)},o.prototype.iaddn=function(u){return i(typeof u=="number"),i(u<67108864),u<0?this.isubn(-u):this.negative!==0?this.length===1&&(this.words[0]|0)<u?(this.words[0]=u-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(u),this.negative=1,this):this._iaddn(u)},o.prototype._iaddn=function(u){this.words[0]+=u;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(u){if(i(typeof u=="number"),i(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(u){return this.clone().iaddn(u)},o.prototype.subn=function(u){return this.clone().isubn(u)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(u,y,w){var E=u.length+w,O;this._expand(E);var L,C=0;for(O=0;O<u.length;O++){L=(this.words[O+w]|0)+C;var I=(u.words[O]|0)*y;L-=I&67108863,C=(L>>26)-(I/67108864|0),this.words[O+w]=L&67108863}for(;O<this.length-w;O++)L=(this.words[O+w]|0)+C,C=L>>26,this.words[O+w]=L&67108863;if(C===0)return this.strip();for(i(C===-1),C=0,O=0;O<this.length;O++)L=-(this.words[O]|0)+C,C=L>>26,this.words[O]=L&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(u,y){var w=this.length-u.length,E=this.clone(),O=u,L=O.words[O.length-1]|0,C=this._countBits(L);w=26-C,w!==0&&(O=O.ushln(w),E.iushln(w),L=O.words[O.length-1]|0);var I=E.length-O.length,d;if(y!=="mod"){d=new o(null),d.length=I+1,d.words=new Array(d.length);for(var M=0;M<d.length;M++)d.words[M]=0}var ne=E.clone()._ishlnsubmul(O,1,I);ne.negative===0&&(E=ne,d&&(d.words[I]=1));for(var ee=I-1;ee>=0;ee--){var fe=(E.words[O.length+ee]|0)*67108864+(E.words[O.length+ee-1]|0);for(fe=Math.min(fe/L|0,67108863),E._ishlnsubmul(O,fe,ee);E.negative!==0;)fe--,E.negative=0,E._ishlnsubmul(O,1,ee),E.isZero()||(E.negative^=1);d&&(d.words[ee]=fe)}return d&&d.strip(),E.strip(),y!=="div"&&w!==0&&E.iushrn(w),{div:d||null,mod:E}},o.prototype.divmod=function(u,y,w){if(i(!u.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var E,O,L;return this.negative!==0&&u.negative===0?(L=this.neg().divmod(u,y),y!=="mod"&&(E=L.div.neg()),y!=="div"&&(O=L.mod.neg(),w&&O.negative!==0&&O.iadd(u)),{div:E,mod:O}):this.negative===0&&u.negative!==0?(L=this.divmod(u.neg(),y),y!=="mod"&&(E=L.div.neg()),{div:E,mod:L.mod}):this.negative&u.negative?(L=this.neg().divmod(u.neg(),y),y!=="div"&&(O=L.mod.neg(),w&&O.negative!==0&&O.isub(u)),{div:L.div,mod:O}):u.length>this.length||this.cmp(u)<0?{div:new o(0),mod:this}:u.length===1?y==="div"?{div:this.divn(u.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new o(this.modn(u.words[0]))}:this._wordDiv(u,y)},o.prototype.div=function(u){return this.divmod(u,"div",!1).div},o.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},o.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},o.prototype.divRound=function(u){var y=this.divmod(u);if(y.mod.isZero())return y.div;var w=y.div.negative!==0?y.mod.isub(u):y.mod,E=u.ushrn(1),O=u.andln(1),L=w.cmp(E);return L<0||O===1&&L===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(u){i(u<=67108863);for(var y=(1<<26)%u,w=0,E=this.length-1;E>=0;E--)w=(y*w+(this.words[E]|0))%u;return w},o.prototype.idivn=function(u){i(u<=67108863);for(var y=0,w=this.length-1;w>=0;w--){var E=(this.words[w]|0)+y*67108864;this.words[w]=E/u|0,y=E%u}return this.strip()},o.prototype.divn=function(u){return this.clone().idivn(u)},o.prototype.egcd=function(u){i(u.negative===0),i(!u.isZero());var y=this,w=u.clone();y.negative!==0?y=y.umod(u):y=y.clone();for(var E=new o(1),O=new o(0),L=new o(0),C=new o(1),I=0;y.isEven()&&w.isEven();)y.iushrn(1),w.iushrn(1),++I;for(var d=w.clone(),M=y.clone();!y.isZero();){for(var ne=0,ee=1;!(y.words[0]&ee)&&ne<26;++ne,ee<<=1);if(ne>0)for(y.iushrn(ne);ne-- >0;)(E.isOdd()||O.isOdd())&&(E.iadd(d),O.isub(M)),E.iushrn(1),O.iushrn(1);for(var fe=0,pe=1;!(w.words[0]&pe)&&fe<26;++fe,pe<<=1);if(fe>0)for(w.iushrn(fe);fe-- >0;)(L.isOdd()||C.isOdd())&&(L.iadd(d),C.isub(M)),L.iushrn(1),C.iushrn(1);y.cmp(w)>=0?(y.isub(w),E.isub(L),O.isub(C)):(w.isub(y),L.isub(E),C.isub(O))}return{a:L,b:C,gcd:w.iushln(I)}},o.prototype._invmp=function(u){i(u.negative===0),i(!u.isZero());var y=this,w=u.clone();y.negative!==0?y=y.umod(u):y=y.clone();for(var E=new o(1),O=new o(0),L=w.clone();y.cmpn(1)>0&&w.cmpn(1)>0;){for(var C=0,I=1;!(y.words[0]&I)&&C<26;++C,I<<=1);if(C>0)for(y.iushrn(C);C-- >0;)E.isOdd()&&E.iadd(L),E.iushrn(1);for(var d=0,M=1;!(w.words[0]&M)&&d<26;++d,M<<=1);if(d>0)for(w.iushrn(d);d-- >0;)O.isOdd()&&O.iadd(L),O.iushrn(1);y.cmp(w)>=0?(y.isub(w),E.isub(O)):(w.isub(y),O.isub(E))}var ne;return y.cmpn(1)===0?ne=E:ne=O,ne.cmpn(0)<0&&ne.iadd(u),ne},o.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var y=this.clone(),w=u.clone();y.negative=0,w.negative=0;for(var E=0;y.isEven()&&w.isEven();E++)y.iushrn(1),w.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;w.isEven();)w.iushrn(1);var O=y.cmp(w);if(O<0){var L=y;y=w,w=L}else if(O===0||w.cmpn(1)===0)break;y.isub(w)}while(!0);return w.iushln(E)},o.prototype.invm=function(u){return this.egcd(u).a.umod(u)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(u){return this.words[0]&u},o.prototype.bincn=function(u){i(typeof u=="number");var y=u%26,w=(u-y)/26,E=1<<y;if(this.length<=w)return this._expand(w+1),this.words[w]|=E,this;for(var O=E,L=w;O!==0&&L<this.length;L++){var C=this.words[L]|0;C+=O,O=C>>>26,C&=67108863,this.words[L]=C}return O!==0&&(this.words[L]=O,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(u){var y=u<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var w;if(this.length>1)w=1;else{y&&(u=-u),i(u<=67108863,"Number is too big");var E=this.words[0]|0;w=E===u?0:E<u?-1:1}return this.negative!==0?-w|0:w},o.prototype.cmp=function(u){if(this.negative!==0&&u.negative===0)return-1;if(this.negative===0&&u.negative!==0)return 1;var y=this.ucmp(u);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(u){if(this.length>u.length)return 1;if(this.length<u.length)return-1;for(var y=0,w=this.length-1;w>=0;w--){var E=this.words[w]|0,O=u.words[w]|0;if(E!==O){E<O?y=-1:E>O&&(y=1);break}}return y},o.prototype.gtn=function(u){return this.cmpn(u)===1},o.prototype.gt=function(u){return this.cmp(u)===1},o.prototype.gten=function(u){return this.cmpn(u)>=0},o.prototype.gte=function(u){return this.cmp(u)>=0},o.prototype.ltn=function(u){return this.cmpn(u)===-1},o.prototype.lt=function(u){return this.cmp(u)===-1},o.prototype.lten=function(u){return this.cmpn(u)<=0},o.prototype.lte=function(u){return this.cmp(u)<=0},o.prototype.eqn=function(u){return this.cmpn(u)===0},o.prototype.eq=function(u){return this.cmp(u)===0},o.red=function(u){return new re(u)},o.prototype.toRed=function(u){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(u){return this.red=u,this},o.prototype.forceRed=function(u){return i(!this.red,"Already a number in reduction context"),this._forceRed(u)},o.prototype.redAdd=function(u){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},o.prototype.redIAdd=function(u){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},o.prototype.redSub=function(u){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},o.prototype.redISub=function(u){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},o.prototype.redShl=function(u){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},o.prototype.redMul=function(u){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},o.prototype.redIMul=function(u){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(u){return i(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var V={k256:null,p224:null,p192:null,p25519:null};function D($,u){this.name=$,this.p=new o(u,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var u=new o(null);return u.words=new Array(Math.ceil(this.n/13)),u},D.prototype.ireduce=function(u){var y=u,w;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),w=y.bitLength();while(w>this.n);var E=w<this.n?-1:y.ucmp(this.p);return E===0?(y.words[0]=0,y.length=1):E>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},D.prototype.split=function(u,y){u.iushrn(this.n,0,y)},D.prototype.imulK=function(u){return u.imul(this.k)};function B(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(B,D),B.prototype.split=function(u,y){for(var w=4194303,E=Math.min(u.length,9),O=0;O<E;O++)y.words[O]=u.words[O];if(y.length=E,u.length<=9){u.words[0]=0,u.length=1;return}var L=u.words[9];for(y.words[y.length++]=L&w,O=10;O<u.length;O++){var C=u.words[O]|0;u.words[O-10]=(C&w)<<4|L>>>22,L=C}L>>>=22,u.words[O-10]=L,L===0&&u.length>10?u.length-=10:u.length-=9},B.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var y=0,w=0;w<u.length;w++){var E=u.words[w]|0;y+=E*977,u.words[w]=y&67108863,y=E*64+(y/67108864|0)}return u.words[u.length-1]===0&&(u.length--,u.words[u.length-1]===0&&u.length--),u};function F(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(F,D);function b(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(b,D);function N(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(N,D),N.prototype.imulK=function(u){for(var y=0,w=0;w<u.length;w++){var E=(u.words[w]|0)*19+y,O=E&67108863;E>>>=26,u.words[w]=O,y=E}return y!==0&&(u.words[u.length++]=y),u},o._prime=function(u){if(V[u])return V[u];var y;if(u==="k256")y=new B;else if(u==="p224")y=new F;else if(u==="p192")y=new b;else if(u==="p25519")y=new N;else throw new Error("Unknown prime "+u);return V[u]=y,y};function re($){if(typeof $=="string"){var u=o._prime($);this.m=u.p,this.prime=u}else i($.gtn(1),"modulus must be greater than 1"),this.m=$,this.prime=null}re.prototype._verify1=function(u){i(u.negative===0,"red works only with positives"),i(u.red,"red works only with red numbers")},re.prototype._verify2=function(u,y){i((u.negative|y.negative)===0,"red works only with positives"),i(u.red&&u.red===y.red,"red works only with red numbers")},re.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):u.umod(this.m)._forceRed(this)},re.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},re.prototype.add=function(u,y){this._verify2(u,y);var w=u.add(y);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},re.prototype.iadd=function(u,y){this._verify2(u,y);var w=u.iadd(y);return w.cmp(this.m)>=0&&w.isub(this.m),w},re.prototype.sub=function(u,y){this._verify2(u,y);var w=u.sub(y);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},re.prototype.isub=function(u,y){this._verify2(u,y);var w=u.isub(y);return w.cmpn(0)<0&&w.iadd(this.m),w},re.prototype.shl=function(u,y){return this._verify1(u),this.imod(u.ushln(y))},re.prototype.imul=function(u,y){return this._verify2(u,y),this.imod(u.imul(y))},re.prototype.mul=function(u,y){return this._verify2(u,y),this.imod(u.mul(y))},re.prototype.isqr=function(u){return this.imul(u,u.clone())},re.prototype.sqr=function(u){return this.mul(u,u)},re.prototype.sqrt=function(u){if(u.isZero())return u.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var w=this.m.add(new o(1)).iushrn(2);return this.pow(u,w)}for(var E=this.m.subn(1),O=0;!E.isZero()&&E.andln(1)===0;)O++,E.iushrn(1);i(!E.isZero());var L=new o(1).toRed(this),C=L.redNeg(),I=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new o(2*d*d).toRed(this);this.pow(d,I).cmp(C)!==0;)d.redIAdd(C);for(var M=this.pow(d,E),ne=this.pow(u,E.addn(1).iushrn(1)),ee=this.pow(u,E),fe=O;ee.cmp(L)!==0;){for(var pe=ee,he=0;pe.cmp(L)!==0;he++)pe=pe.redSqr();i(he<fe);var W=this.pow(M,new o(1).iushln(fe-he-1));ne=ne.redMul(W),M=W.redSqr(),ee=ee.redMul(M),fe=he}return ne},re.prototype.invm=function(u){var y=u._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},re.prototype.pow=function(u,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return u.clone();var w=4,E=new Array(1<<w);E[0]=new o(1).toRed(this),E[1]=u;for(var O=2;O<E.length;O++)E[O]=this.mul(E[O-1],u);var L=E[0],C=0,I=0,d=y.bitLength()%26;for(d===0&&(d=26),O=y.length-1;O>=0;O--){for(var M=y.words[O],ne=d-1;ne>=0;ne--){var ee=M>>ne&1;if(L!==E[0]&&(L=this.sqr(L)),ee===0&&C===0){I=0;continue}C<<=1,C|=ee,I++,!(I!==w&&(O!==0||ne!==0))&&(L=this.mul(L,E[C]),I=0,C=0)}d=26}return L},re.prototype.convertTo=function(u){var y=u.umod(this.m);return y===u?y.clone():y},re.prototype.convertFrom=function(u){var y=u.clone();return y.red=null,y},o.mont=function(u){return new de(u)};function de($){re.call(this,$),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}s(de,re),de.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},de.prototype.convertFrom=function(u){var y=this.imod(u.mul(this.rinv));return y.red=null,y},de.prototype.imul=function(u,y){if(u.isZero()||y.isZero())return u.words[0]=0,u.length=1,u;var w=u.imul(y),E=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=w.isub(E).iushrn(this.shift),L=O;return O.cmp(this.m)>=0?L=O.isub(this.m):O.cmpn(0)<0&&(L=O.iadd(this.m)),L._forceRed(this)},de.prototype.mul=function(u,y){if(u.isZero()||y.isZero())return new o(0)._forceRed(this);var w=u.mul(y),E=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=w.isub(E).iushrn(this.shift),L=O;return O.cmp(this.m)>=0?L=O.isub(this.m):O.cmpn(0)<0&&(L=O.iadd(this.m)),L._forceRed(this)},de.prototype.invm=function(u){var y=this.imod(u._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(r,Fp)})(pu);var on=pu.exports;(function(r){var e=r,t=on,i=i2,s=n2;e.assert=i,e.toArray=s.toArray,e.zero2=s.zero2,e.toHex=s.toHex,e.encode=s.encode;function o(m,_,P){var x=new Array(Math.max(m.bitLength(),P)+1),T;for(T=0;T<x.length;T+=1)x[T]=0;var j=1<<_+1,G=m.clone();for(T=0;T<x.length;T++){var X,U=G.andln(j-1);G.isOdd()?(U>(j>>1)-1?X=(j>>1)-U:X=U,G.isubn(X)):X=0,x[T]=X,G.iushrn(1)}return x}e.getNAF=o;function f(m,_){var P=[[],[]];m=m.clone(),_=_.clone();for(var x=0,T=0,j;m.cmpn(-x)>0||_.cmpn(-T)>0;){var G=m.andln(3)+x&3,X=_.andln(3)+T&3;G===3&&(G=-1),X===3&&(X=-1);var U;G&1?(j=m.andln(7)+x&7,(j===3||j===5)&&X===2?U=-G:U=G):U=0,P[0].push(U);var V;X&1?(j=_.andln(7)+T&7,(j===3||j===5)&&G===2?V=-X:V=X):V=0,P[1].push(V),2*x===U+1&&(x=1-x),2*T===V+1&&(T=1-T),m.iushrn(1),_.iushrn(1)}return P}e.getJSF=f;function h(m,_,P){var x="_"+_;m.prototype[_]=function(){return this[x]!==void 0?this[x]:this[x]=P.call(this)}}e.cachedProperty=h;function p(m){return typeof m=="string"?e.toArray(m,"hex"):m}e.parseBytes=p;function l(m){return new t(m,"hex","le")}e.intFromLE=l})(Gr);var gu={},Qn=on,Ka=Gr,mc=Ka.getNAF,g3=Ka.getJSF,yc=Ka.assert;function Pn(r,e){this.type=r,this.p=new Qn(e.p,16),this.red=e.prime?Qn.red(e.prime):Qn.mont(this.p),this.zero=new Qn(0).toRed(this.red),this.one=new Qn(1).toRed(this.red),this.two=new Qn(2).toRed(this.red),this.n=e.n&&new Qn(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var qc=Pn;Pn.prototype.point=function(){throw new Error("Not implemented")};Pn.prototype.validate=function(){throw new Error("Not implemented")};Pn.prototype._fixedNafMul=function(e,t){yc(e.precomputed);var i=e._getDoubles(),s=mc(t,1,this._bitLength),o=(1<<i.step+1)-(i.step%2===0?2:1);o/=3;var f=[],h,p;for(h=0;h<s.length;h+=i.step){p=0;for(var l=h+i.step-1;l>=h;l--)p=(p<<1)+s[l];f.push(p)}for(var m=this.jpoint(null,null,null),_=this.jpoint(null,null,null),P=o;P>0;P--){for(h=0;h<f.length;h++)p=f[h],p===P?_=_.mixedAdd(i.points[h]):p===-P&&(_=_.mixedAdd(i.points[h].neg()));m=m.add(_)}return m.toP()};Pn.prototype._wnafMul=function(e,t){var i=4,s=e._getNAFPoints(i);i=s.wnd;for(var o=s.points,f=mc(t,i,this._bitLength),h=this.jpoint(null,null,null),p=f.length-1;p>=0;p--){for(var l=0;p>=0&&f[p]===0;p--)l++;if(p>=0&&l++,h=h.dblp(l),p<0)break;var m=f[p];yc(m!==0),e.type==="affine"?m>0?h=h.mixedAdd(o[m-1>>1]):h=h.mixedAdd(o[-m-1>>1].neg()):m>0?h=h.add(o[m-1>>1]):h=h.add(o[-m-1>>1].neg())}return e.type==="affine"?h.toP():h};Pn.prototype._wnafMulAdd=function(e,t,i,s,o){var f=this._wnafT1,h=this._wnafT2,p=this._wnafT3,l=0,m,_,P;for(m=0;m<s;m++){P=t[m];var x=P._getNAFPoints(e);f[m]=x.wnd,h[m]=x.points}for(m=s-1;m>=1;m-=2){var T=m-1,j=m;if(f[T]!==1||f[j]!==1){p[T]=mc(i[T],f[T],this._bitLength),p[j]=mc(i[j],f[j],this._bitLength),l=Math.max(p[T].length,l),l=Math.max(p[j].length,l);continue}var G=[t[T],null,null,t[j]];t[T].y.cmp(t[j].y)===0?(G[1]=t[T].add(t[j]),G[2]=t[T].toJ().mixedAdd(t[j].neg())):t[T].y.cmp(t[j].y.redNeg())===0?(G[1]=t[T].toJ().mixedAdd(t[j]),G[2]=t[T].add(t[j].neg())):(G[1]=t[T].toJ().mixedAdd(t[j]),G[2]=t[T].toJ().mixedAdd(t[j].neg()));var X=[-3,-1,-5,-7,0,7,5,1,3],U=g3(i[T],i[j]);for(l=Math.max(U[0].length,l),p[T]=new Array(l),p[j]=new Array(l),_=0;_<l;_++){var V=U[0][_]|0,D=U[1][_]|0;p[T][_]=X[(V+1)*3+(D+1)],p[j][_]=0,h[T]=G}}var B=this.jpoint(null,null,null),F=this._wnafT4;for(m=l;m>=0;m--){for(var b=0;m>=0;){var N=!0;for(_=0;_<s;_++)F[_]=p[_][m]|0,F[_]!==0&&(N=!1);if(!N)break;b++,m--}if(m>=0&&b++,B=B.dblp(b),m<0)break;for(_=0;_<s;_++){var re=F[_];re!==0&&(re>0?P=h[_][re-1>>1]:re<0&&(P=h[_][-re-1>>1].neg()),P.type==="affine"?B=B.mixedAdd(P):B=B.add(P))}}for(m=0;m<s;m++)h[m]=null;return o?B:B.toP()};function fi(r,e){this.curve=r,this.type=e,this.precomputed=null}Pn.BasePoint=fi;fi.prototype.eq=function(){throw new Error("Not implemented")};fi.prototype.validate=function(){return this.curve.validate(this)};Pn.prototype.decodePoint=function(e,t){e=Ka.toArray(e,t);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?yc(e[e.length-1]%2===0):e[0]===7&&yc(e[e.length-1]%2===1);var s=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return s}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")};fi.prototype.encodeCompressed=function(e){return this.encode(e,!0)};fi.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))};fi.prototype.encode=function(e,t){return Ka.encode(this._encode(t),e)};fi.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this};fi.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1};fi.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],s=this,o=0;o<t;o+=e){for(var f=0;f<e;f++)s=s.dbl();i.push(s)}return{step:e,points:i}};fi.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,s=i===1?null:this.dbl(),o=1;o<i;o++)t[o]=t[o-1].add(s);return{wnd:e,points:t}};fi.prototype._getBeta=function(){return null};fi.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t};var b3=Gr,Gt=on,bu=ou,Gs=qc,v3=b3.assert;function hi(r){Gs.call(this,"short",r),this.a=new Gt(r.a,16).toRed(this.red),this.b=new Gt(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}bu(hi,Gs);var m3=hi;hi.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,i;if(e.beta)t=new Gt(e.beta,16).toRed(this.red);else{var s=this._getEndoRoots(this.p);t=s[0].cmp(s[1])<0?s[0]:s[1],t=t.toRed(this.red)}if(e.lambda)i=new Gt(e.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))===0?i=o[0]:(i=o[1],v3(this.g.mul(i).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(h){return{a:new Gt(h.a,16),b:new Gt(h.b,16)}}):f=this._getEndoBasis(i),{beta:t,lambda:i,basis:f}}};hi.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Gt.mont(e),i=new Gt(2).toRed(t).redInvm(),s=i.redNeg(),o=new Gt(3).toRed(t).redNeg().redSqrt().redMul(i),f=s.redAdd(o).fromRed(),h=s.redSub(o).fromRed();return[f,h]};hi.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,s=this.n.clone(),o=new Gt(1),f=new Gt(0),h=new Gt(0),p=new Gt(1),l,m,_,P,x,T,j,G=0,X,U;i.cmpn(0)!==0;){var V=s.div(i);X=s.sub(V.mul(i)),U=h.sub(V.mul(o));var D=p.sub(V.mul(f));if(!_&&X.cmp(t)<0)l=j.neg(),m=o,_=X.neg(),P=U;else if(_&&++G===2)break;j=X,s=i,i=X,h=o,o=U,p=f,f=D}x=X.neg(),T=U;var B=_.sqr().add(P.sqr()),F=x.sqr().add(T.sqr());return F.cmp(B)>=0&&(x=l,T=m),_.negative&&(_=_.neg(),P=P.neg()),x.negative&&(x=x.neg(),T=T.neg()),[{a:_,b:P},{a:x,b:T}]};hi.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],s=t[1],o=s.b.mul(e).divRound(this.n),f=i.b.neg().mul(e).divRound(this.n),h=o.mul(i.a),p=f.mul(s.a),l=o.mul(i.b),m=f.mul(s.b),_=e.sub(h).sub(p),P=l.add(m).neg();return{k1:_,k2:P}};hi.prototype.pointFromX=function(e,t){e=new Gt(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),s=i.redSqrt();if(s.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var o=s.fromRed().isOdd();return(t&&!o||!t&&o)&&(s=s.redNeg()),this.point(e,s)};hi.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,s=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(s).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0};hi.prototype._endoWnafMulAdd=function(e,t,i){for(var s=this._endoWnafT1,o=this._endoWnafT2,f=0;f<e.length;f++){var h=this._endoSplit(t[f]),p=e[f],l=p._getBeta();h.k1.negative&&(h.k1.ineg(),p=p.neg(!0)),h.k2.negative&&(h.k2.ineg(),l=l.neg(!0)),s[f*2]=p,s[f*2+1]=l,o[f*2]=h.k1,o[f*2+1]=h.k2}for(var m=this._wnafMulAdd(1,s,o,f*2,i),_=0;_<f*2;_++)s[_]=null,o[_]=null;return m};function fr(r,e,t,i){Gs.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Gt(e,16),this.y=new Gt(t,16),i&&(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)}bu(fr,Gs.BasePoint);hi.prototype.point=function(e,t,i){return new fr(this,e,t,i)};hi.prototype.pointFromJSON=function(e,t){return fr.fromJSON(this,e,t)};fr.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,s=function(o){return i.point(o.x.redMul(i.endo.beta),o.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(s)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(s)}}}return t}};fr.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]};fr.fromJSON=function(e,t,i){typeof t=="string"&&(t=JSON.parse(t));var s=e.point(t[0],t[1],i);if(!t[2])return s;function o(h){return e.point(h[0],h[1],i)}var f=t[2];return s.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[s].concat(f.doubles.points.map(o))},naf:f.naf&&{wnd:f.naf.wnd,points:[s].concat(f.naf.points.map(o))}},s};fr.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)+">"};fr.prototype.isInfinity=function(){return this.inf};fr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),s=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)};fr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),s=e.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(s),f=o.redSqr().redISub(this.x.redAdd(this.x)),h=o.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,h)};fr.prototype.getX=function(){return this.x.fromRed()};fr.prototype.getY=function(){return this.y.fromRed()};fr.prototype.mul=function(e){return e=new Gt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};fr.prototype.mulAdd=function(e,t,i){var s=[this,t],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(s,o):this.curve._wnafMulAdd(1,s,o,2)};fr.prototype.jmulAdd=function(e,t,i){var s=[this,t],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(s,o,!0):this.curve._wnafMulAdd(1,s,o,2,!0)};fr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};fr.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,s=function(o){return o.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(s)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(s)}}}return t};fr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ur(r,e,t,i){Gs.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Gt(0)):(this.x=new Gt(e,16),this.y=new Gt(t,16),this.z=new Gt(i,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}bu(ur,Gs.BasePoint);hi.prototype.jpoint=function(e,t,i){return new ur(this,e,t,i)};ur.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),s=this.y.redMul(t).redMul(e);return this.curve.point(i,s)};ur.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ur.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(t),o=e.x.redMul(i),f=this.y.redMul(t.redMul(e.z)),h=e.y.redMul(i.redMul(this.z)),p=s.redSub(o),l=f.redSub(h);if(p.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=p.redSqr(),_=m.redMul(p),P=s.redMul(m),x=l.redSqr().redIAdd(_).redISub(P).redISub(P),T=l.redMul(P.redISub(x)).redISub(f.redMul(_)),j=this.z.redMul(e.z).redMul(p);return this.curve.jpoint(x,T,j)};ur.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,s=e.x.redMul(t),o=this.y,f=e.y.redMul(t).redMul(this.z),h=i.redSub(s),p=o.redSub(f);if(h.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=h.redSqr(),m=l.redMul(h),_=i.redMul(l),P=p.redSqr().redIAdd(m).redISub(_).redISub(_),x=p.redMul(_.redISub(P)).redISub(o.redMul(m)),T=this.z.redMul(h);return this.curve.jpoint(P,x,T)};ur.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var s=this.curve.a,o=this.curve.tinv,f=this.x,h=this.y,p=this.z,l=p.redSqr().redSqr(),m=h.redAdd(h);for(t=0;t<e;t++){var _=f.redSqr(),P=m.redSqr(),x=P.redSqr(),T=_.redAdd(_).redIAdd(_).redIAdd(s.redMul(l)),j=f.redMul(P),G=T.redSqr().redISub(j.redAdd(j)),X=j.redISub(G),U=T.redMul(X);U=U.redIAdd(U).redISub(x);var V=m.redMul(p);t+1<e&&(l=l.redMul(x)),f=G,p=V,m=U}return this.curve.jpoint(f,m.redMul(o),p)};ur.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ur.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var s=this.x.redSqr(),o=this.y.redSqr(),f=o.redSqr(),h=this.x.redAdd(o).redSqr().redISub(s).redISub(f);h=h.redIAdd(h);var p=s.redAdd(s).redIAdd(s),l=p.redSqr().redISub(h).redISub(h),m=f.redIAdd(f);m=m.redIAdd(m),m=m.redIAdd(m),e=l,t=p.redMul(h.redISub(l)).redISub(m),i=this.y.redAdd(this.y)}else{var _=this.x.redSqr(),P=this.y.redSqr(),x=P.redSqr(),T=this.x.redAdd(P).redSqr().redISub(_).redISub(x);T=T.redIAdd(T);var j=_.redAdd(_).redIAdd(_),G=j.redSqr(),X=x.redIAdd(x);X=X.redIAdd(X),X=X.redIAdd(X),e=G.redISub(T).redISub(T),t=j.redMul(T.redISub(e)).redISub(X),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,t,i)};ur.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var s=this.x.redSqr(),o=this.y.redSqr(),f=o.redSqr(),h=this.x.redAdd(o).redSqr().redISub(s).redISub(f);h=h.redIAdd(h);var p=s.redAdd(s).redIAdd(s).redIAdd(this.curve.a),l=p.redSqr().redISub(h).redISub(h);e=l;var m=f.redIAdd(f);m=m.redIAdd(m),m=m.redIAdd(m),t=p.redMul(h.redISub(l)).redISub(m),i=this.y.redAdd(this.y)}else{var _=this.z.redSqr(),P=this.y.redSqr(),x=this.x.redMul(P),T=this.x.redSub(_).redMul(this.x.redAdd(_));T=T.redAdd(T).redIAdd(T);var j=x.redIAdd(x);j=j.redIAdd(j);var G=j.redAdd(j);e=T.redSqr().redISub(G),i=this.y.redAdd(this.z).redSqr().redISub(P).redISub(_);var X=P.redSqr();X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X),t=T.redMul(j.redISub(e)).redISub(X)}return this.curve.jpoint(e,t,i)};ur.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,s=this.z,o=s.redSqr().redSqr(),f=t.redSqr(),h=i.redSqr(),p=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(o)),l=t.redAdd(t);l=l.redIAdd(l);var m=l.redMul(h),_=p.redSqr().redISub(m.redAdd(m)),P=m.redISub(_),x=h.redSqr();x=x.redIAdd(x),x=x.redIAdd(x),x=x.redIAdd(x);var T=p.redMul(P).redISub(x),j=i.redAdd(i).redMul(s);return this.curve.jpoint(_,T,j)};ur.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),s=t.redSqr(),o=e.redAdd(e).redIAdd(e),f=o.redSqr(),h=this.x.redAdd(t).redSqr().redISub(e).redISub(s);h=h.redIAdd(h),h=h.redAdd(h).redIAdd(h),h=h.redISub(f);var p=h.redSqr(),l=s.redIAdd(s);l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var m=o.redIAdd(h).redSqr().redISub(f).redISub(p).redISub(l),_=t.redMul(m);_=_.redIAdd(_),_=_.redIAdd(_);var P=this.x.redMul(p).redISub(_);P=P.redIAdd(P),P=P.redIAdd(P);var x=this.y.redMul(m.redMul(l.redISub(m)).redISub(h.redMul(p)));x=x.redIAdd(x),x=x.redIAdd(x),x=x.redIAdd(x);var T=this.z.redAdd(h).redSqr().redISub(i).redISub(p);return this.curve.jpoint(P,x,T)};ur.prototype.mul=function(e,t){return e=new Gt(e,t),this.curve._wnafMul(this,e)};ur.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var s=t.redMul(this.z),o=i.redMul(e.z);return this.y.redMul(o).redISub(e.y.redMul(s)).cmpn(0)===0};ur.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(i)===0)return!0;for(var s=e.clone(),o=this.curve.redN.redMul(t);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}};ur.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)+">"};ur.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Fs=on,lg=ou,Uc=qc,y3=Gr;function Vs(r){Uc.call(this,"mont",r),this.a=new Fs(r.a,16).toRed(this.red),this.b=new Fs(r.b,16).toRed(this.red),this.i4=new Fs(4).toRed(this.red).redInvm(),this.two=new Fs(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}lg(Vs,Uc);var w3=Vs;Vs.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),s=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t),o=s.redSqrt();return o.redSqr().cmp(s)===0};function cr(r,e,t){Uc.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Fs(e,16),this.z=new Fs(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}lg(cr,Uc.BasePoint);Vs.prototype.decodePoint=function(e,t){return this.point(y3.toArray(e,t),1)};Vs.prototype.point=function(e,t){return new cr(this,e,t)};Vs.prototype.pointFromJSON=function(e){return cr.fromJSON(this,e)};cr.prototype.precompute=function(){};cr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};cr.fromJSON=function(e,t){return new cr(e,t[0],t[1]||e.one)};cr.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)+">"};cr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};cr.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),i=this.x.redSub(this.z),s=i.redSqr(),o=t.redSub(s),f=t.redMul(s),h=o.redMul(s.redAdd(this.curve.a24.redMul(o)));return this.curve.point(f,h)};cr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};cr.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),s=this.x.redSub(this.z),o=e.x.redAdd(e.z),f=e.x.redSub(e.z),h=f.redMul(i),p=o.redMul(s),l=t.z.redMul(h.redAdd(p).redSqr()),m=t.x.redMul(h.redISub(p).redSqr());return this.curve.point(l,m)};cr.prototype.mul=function(e){for(var t=e.clone(),i=this,s=this.curve.point(null,null),o=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var h=f.length-1;h>=0;h--)f[h]===0?(i=i.diffAdd(s,o),s=s.dbl()):(s=i.diffAdd(s,o),i=i.dbl());return s};cr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};cr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};cr.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};cr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};cr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var _3=Gr,nn=on,dg=ou,zc=qc,E3=_3.assert;function Fi(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,zc.call(this,"edwards",r),this.a=new nn(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new nn(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new nn(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),E3(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}dg(Fi,zc);var S3=Fi;Fi.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Fi.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Fi.prototype.jpoint=function(e,t,i,s){return this.point(e,t,i,s)};Fi.prototype.pointFromX=function(e,t){e=new nn(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),s=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),f=s.redMul(o.redInvm()),h=f.redSqrt();if(h.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var p=h.fromRed().isOdd();return(t&&!p||!t&&p)&&(h=h.redNeg()),this.point(e,h)};Fi.prototype.pointFromY=function(e,t){e=new nn(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),s=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),f=s.redMul(o.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var h=f.redSqrt();if(h.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return h.fromRed().isOdd()!==t&&(h=h.redNeg()),this.point(h,e)};Fi.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),s=t.redMul(this.a).redAdd(i),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return s.cmp(o)===0};function Ct(r,e,t,i,s){zc.BasePoint.call(this,r,"projective"),e===null&&t===null&&i===null?(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 nn(e,16),this.y=new nn(t,16),this.z=i?new nn(i,16):this.curve.one,this.t=s&&new nn(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()))))}dg(Ct,zc.BasePoint);Fi.prototype.pointFromJSON=function(e){return Ct.fromJSON(this,e)};Fi.prototype.point=function(e,t,i,s){return new Ct(this,e,t,i,s)};Ct.fromJSON=function(e,t){return new Ct(e,t[0],t[1],t[2])};Ct.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)+">"};Ct.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Ct.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var s=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),f=s.redAdd(t),h=f.redSub(i),p=s.redSub(t),l=o.redMul(h),m=f.redMul(p),_=o.redMul(p),P=h.redMul(f);return this.curve.point(l,m,P,_)};Ct.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),i=this.y.redSqr(),s,o,f,h,p,l;if(this.curve.twisted){h=this.curve._mulA(t);var m=h.redAdd(i);this.zOne?(s=e.redSub(t).redSub(i).redMul(m.redSub(this.curve.two)),o=m.redMul(h.redSub(i)),f=m.redSqr().redSub(m).redSub(m)):(p=this.z.redSqr(),l=m.redSub(p).redISub(p),s=e.redSub(t).redISub(i).redMul(l),o=m.redMul(h.redSub(i)),f=m.redMul(l))}else h=t.redAdd(i),p=this.curve._mulC(this.z).redSqr(),l=h.redSub(p).redSub(p),s=this.curve._mulC(e.redISub(h)).redMul(l),o=this.curve._mulC(h).redMul(t.redISub(i)),f=h.redMul(l);return this.curve.point(s,o,f)};Ct.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Ct.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),s=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),f=i.redSub(t),h=o.redSub(s),p=o.redAdd(s),l=i.redAdd(t),m=f.redMul(h),_=p.redMul(l),P=f.redMul(l),x=h.redMul(p);return this.curve.point(m,_,x,P)};Ct.prototype._projAdd=function(e){var t=this.z.redMul(e.z),i=t.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),f=this.curve.d.redMul(s).redMul(o),h=i.redSub(f),p=i.redAdd(f),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),m=t.redMul(h).redMul(l),_,P;return this.curve.twisted?(_=t.redMul(p).redMul(o.redSub(this.curve._mulA(s))),P=h.redMul(p)):(_=t.redMul(p).redMul(o.redSub(s)),P=this.curve._mulC(h).redMul(p)),this.curve.point(m,_,P)};Ct.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Ct.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Ct.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)};Ct.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)};Ct.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Ct.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Ct.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Ct.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Ct.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Ct.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(s),this.x.cmp(t)===0)return!0}};Ct.prototype.toP=Ct.prototype.normalize;Ct.prototype.mixedAdd=Ct.prototype.add;(function(r){var e=r;e.base=qc,e.short=m3,e.mont=w3,e.edwards=S3})(gu);var Bc={},vh,Zd;function I3(){return Zd||(Zd=1,vh={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"]]}}),vh}(function(r){var e=r,t=Hp,i=gu,s=Gr,o=s.assert;function f(l){l.type==="short"?this.curve=new i.short(l):l.type==="edwards"?this.curve=new i.edwards(l):this.curve=new i.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=f;function h(l,m){Object.defineProperty(e,l,{configurable:!0,enumerable:!0,get:function(){var _=new f(m);return Object.defineProperty(e,l,{configurable:!0,enumerable:!0,value:_}),_}})}h("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:t.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("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:t.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("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:t.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("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:t.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"]}),h("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:t.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"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["9"]}),h("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:t.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var p;try{p=I3()}catch{p=void 0}h("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:t.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",p]})})(Bc);var x3=on,P3=Gr,Wh=P3.assert;function mr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var M3=mr;mr.fromPublic=function(e,t,i){return t instanceof mr?t:new mr(e,{pub:t,pubEnc:i})};mr.fromPrivate=function(e,t,i){return t instanceof mr?t:new mr(e,{priv:t,privEnc:i})};mr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}};mr.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub};mr.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};mr.prototype._importPrivate=function(e,t){this.priv=new x3(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)};mr.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?Wh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Wh(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};mr.prototype.derive=function(e){return e.validate()||Wh(e.validate(),"public point not validated"),e.mul(this.priv).getX()};mr.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)};mr.prototype.verify=function(e,t){return this.ec.verify(e,t,this)};mr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var wc=on,vu=Gr,A3=vu.assert;function Fc(r,e){if(r instanceof Fc)return r;this._importDER(r,e)||(A3(r.r&&r.s,"Signature without r or s"),this.r=new wc(r.r,16),this.s=new wc(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var O3=Fc;function R3(){this.place=0}function mh(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4||r[e.place]===0)return!1;for(var s=0,o=0,f=e.place;o<i;o++,f++)s<<=8,s|=r[f],s>>>=0;return s<=127?!1:(e.place=f,s)}function Qd(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}Fc.prototype._importDER=function(e,t){e=vu.toArray(e,t);var i=new R3;if(e[i.place++]!==48)return!1;var s=mh(e,i);if(s===!1||s+i.place!==e.length||e[i.place++]!==2)return!1;var o=mh(e,i);if(o===!1||e[i.place]&128)return!1;var f=e.slice(i.place,o+i.place);if(i.place+=o,e[i.place++]!==2)return!1;var h=mh(e,i);if(h===!1||e.length!==h+i.place||e[i.place]&128)return!1;var p=e.slice(i.place,h+i.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(p[0]===0)if(p[1]&128)p=p.slice(1);else return!1;return this.r=new wc(f),this.s=new wc(p),this.recoveryParam=null,!0};function yh(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Fc.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),i[0]&128&&(i=[0].concat(i)),t=Qd(t),i=Qd(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var s=[2];yh(s,t.length),s=s.concat(t),s.push(2),yh(s,i.length);var o=s.concat(i),f=[48];return yh(f,o.length),f=f.concat(o),vu.encode(f,e)};var as=on,pg=s2,T3=Gr,wh=Bc,C3=Kp(),gg=T3.assert,mu=M3,Hc=O3;function oi(r){if(!(this instanceof oi))return new oi(r);typeof r=="string"&&(gg(Object.prototype.hasOwnProperty.call(wh,r),"Unknown curve "+r),r=wh[r]),r instanceof wh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var N3=oi;oi.prototype.keyPair=function(e){return new mu(this,e)};oi.prototype.keyFromPrivate=function(e,t){return mu.fromPrivate(this,e,t)};oi.prototype.keyFromPublic=function(e,t){return mu.fromPublic(this,e,t)};oi.prototype.genKeyPair=function(e){e||(e={});for(var t=new pg({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||C3(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),s=this.n.sub(new as(2));;){var o=new as(t.generate(i));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}};oi.prototype._truncateToN=function(e,t){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};oi.prototype.sign=function(e,t,i,s){typeof i=="object"&&(s=i,i=null),s||(s={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new as(e,16));for(var o=this.n.byteLength(),f=t.getPrivate().toArray("be",o),h=e.toArray("be",o),p=new pg({hash:this.hash,entropy:f,nonce:h,pers:s.pers,persEnc:s.persEnc||"utf8"}),l=this.n.sub(new as(1)),m=0;;m++){var _=s.k?s.k(m):new as(p.generate(this.n.byteLength()));if(_=this._truncateToN(_,!0),!(_.cmpn(1)<=0||_.cmp(l)>=0)){var P=this.g.mul(_);if(!P.isInfinity()){var x=P.getX(),T=x.umod(this.n);if(T.cmpn(0)!==0){var j=_.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(j=j.umod(this.n),j.cmpn(0)!==0){var G=(P.getY().isOdd()?1:0)|(x.cmp(T)!==0?2:0);return s.canonical&&j.cmp(this.nh)>0&&(j=this.n.sub(j),G^=1),new Hc({r:T,s:j,recoveryParam:G})}}}}}};oi.prototype.verify=function(e,t,i,s){e=this._truncateToN(new as(e,16)),i=this.keyFromPublic(i,s),t=new Hc(t,"hex");var o=t.r,f=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var h=f.invm(this.n),p=h.mul(e).umod(this.n),l=h.mul(o).umod(this.n),m;return this.curve._maxwellTrick?(m=this.g.jmulAdd(p,i.getPublic(),l),m.isInfinity()?!1:m.eqXToP(o)):(m=this.g.mulAdd(p,i.getPublic(),l),m.isInfinity()?!1:m.getX().umod(this.n).cmp(o)===0)};oi.prototype.recoverPubKey=function(r,e,t,i){gg((3&t)===t,"The recovery param is more than two bits"),e=new Hc(e,i);var s=this.n,o=new as(r),f=e.r,h=e.s,p=t&1,l=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?f=this.curve.pointFromX(f.add(this.curve.n),p):f=this.curve.pointFromX(f,p);var m=e.r.invm(s),_=s.sub(o).mul(m).umod(s),P=h.mul(m).umod(s);return this.g.mulAdd(_,f,P)};oi.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Hc(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var s=0;s<4;s++){var o;try{o=this.recoverPubKey(r,e,s)}catch{continue}if(o.eq(t))return s}throw new Error("Unable to find valid recovery factor")};var ja=Gr,bg=ja.assert,e0=ja.parseBytes,Ys=ja.cachedProperty;function or(r,e){this.eddsa=r,this._secret=e0(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=e0(e.pub)}or.fromPublic=function(e,t){return t instanceof or?t:new or(e,{pub:t})};or.fromSecret=function(e,t){return t instanceof or?t:new or(e,{secret:t})};or.prototype.secret=function(){return this._secret};Ys(or,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Ys(or,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Ys(or,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,s=t.slice(0,e.encodingLength);return s[0]&=248,s[i]&=127,s[i]|=64,s});Ys(or,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Ys(or,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Ys(or,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});or.prototype.sign=function(e){return bg(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};or.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)};or.prototype.getSecret=function(e){return bg(this._secret,"KeyPair is public only"),ja.encode(this.secret(),e)};or.prototype.getPublic=function(e){return ja.encode(this.pubBytes(),e)};var $3=or,L3=on,Kc=Gr,t0=Kc.assert,jc=Kc.cachedProperty,D3=Kc.parseBytes;function us(r,e){this.eddsa=r,typeof e!="object"&&(e=D3(e)),Array.isArray(e)&&(t0(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),t0(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof L3&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}jc(us,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});jc(us,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});jc(us,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});jc(us,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});us.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};us.prototype.toHex=function(){return Kc.encode(this.toBytes(),"hex").toUpperCase()};var q3=us,U3=Hp,z3=Bc,js=Gr,B3=js.assert,vg=js.parseBytes,mg=$3,r0=q3;function Lr(r){if(B3(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Lr))return new Lr(r);r=z3[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=U3.sha512}var F3=Lr;Lr.prototype.sign=function(e,t){e=vg(e);var i=this.keyFromSecret(t),s=this.hashInt(i.messagePrefix(),e),o=this.g.mul(s),f=this.encodePoint(o),h=this.hashInt(f,i.pubBytes(),e).mul(i.priv()),p=s.add(h).umod(this.curve.n);return this.makeSignature({R:o,S:p,Rencoded:f})};Lr.prototype.verify=function(e,t,i){if(e=vg(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var s=this.keyFromPublic(i),o=this.hashInt(t.Rencoded(),s.pubBytes(),e),f=this.g.mul(t.S()),h=t.R().add(s.pub().mul(o));return h.eq(f)};Lr.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return js.intFromLE(e.digest()).umod(this.curve.n)};Lr.prototype.keyFromPublic=function(e){return mg.fromPublic(this,e)};Lr.prototype.keyFromSecret=function(e){return mg.fromSecret(this,e)};Lr.prototype.makeSignature=function(e){return e instanceof r0?e:new r0(this,e)};Lr.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t};Lr.prototype.decodePoint=function(e){e=js.parseBytes(e);var t=e.length-1,i=e.slice(0,t).concat(e[t]&-129),s=(e[t]&128)!==0,o=js.intFromLE(i);return this.curve.pointFromY(o,s)};Lr.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};Lr.prototype.decodeInt=function(e){return js.intFromLE(e)};Lr.prototype.isPoint=function(e){return e instanceof this.pointClass};(function(r){var e=r;e.version=p3.version,e.utils=Gr,e.rand=Kp(),e.curve=gu,e.curves=Bc,e.ec=N3,e.eddsa=F3})(ug);var yu={},yg={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=et,t=Wr;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var i=function(){function h(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return h.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},h.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},h.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},h.prototype.update=function(p,l){if(l===void 0&&(l=p.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var m=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&l>0;)this._buffer[this._bufferLength++]=p[m++],l--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(m=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,p,m,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=p[m++],l--;return this},h.prototype.finish=function(p){if(!this._finished){var l=this._bytesHashed,m=this._bufferLength,_=l/536870912|0,P=l<<3,x=l%128<112?128:256;this._buffer[m]=128;for(var T=m+1;T<x-8;T++)this._buffer[T]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(P,this._buffer,x-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var T=0;T<this.digestLength/8;T++)e.writeUint32BE(this._stateHi[T],p,T*8),e.writeUint32BE(this._stateLo[T],p,T*8+4);return this},h.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},h.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},h.prototype.restoreState=function(p){return this._stateHi.set(p.stateHi),this._stateLo.set(p.stateLo),this._bufferLength=p.bufferLength,p.buffer&&this._buffer.set(p.buffer),this._bytesHashed=p.bytesHashed,this._finished=!1,this},h.prototype.cleanSavedState=function(p){t.wipe(p.stateHi),t.wipe(p.stateLo),p.buffer&&t.wipe(p.buffer),p.bufferLength=0,p.bytesHashed=0},h}();r.SHA512=i;var s=new Int32Array([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 o(h,p,l,m,_,P,x){for(var T=l[0],j=l[1],G=l[2],X=l[3],U=l[4],V=l[5],D=l[6],B=l[7],F=m[0],b=m[1],N=m[2],re=m[3],de=m[4],$=m[5],u=m[6],y=m[7],w,E,O,L,C,I,d,M;x>=128;){for(var ne=0;ne<16;ne++){var ee=8*ne+P;h[ne]=e.readUint32BE(_,ee),p[ne]=e.readUint32BE(_,ee+4)}for(var ne=0;ne<80;ne++){var fe=T,pe=j,he=G,W=X,Q=U,K=V,v=D,H=B,oe=F,le=b,je=N,we=re,Pe=de,ut=$,Ne=u,ze=y;if(w=B,E=y,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=(U>>>14|de<<18)^(U>>>18|de<<14)^(de>>>9|U<<23),E=(de>>>14|U<<18)^(de>>>18|U<<14)^(U>>>9|de<<23),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=U&V^~U&D,E=de&$^~de&u,C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=s[ne*2],E=s[ne*2+1],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=h[ne%16],E=p[ne%16],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,O=d&65535|M<<16,L=C&65535|I<<16,w=O,E=L,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25),E=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=T&j^T&G^j&G,E=F&b^F&N^b&N,C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,H=d&65535|M<<16,ze=C&65535|I<<16,w=W,E=we,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=O,E=L,C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,W=d&65535|M<<16,we=C&65535|I<<16,j=fe,G=pe,X=he,U=W,V=Q,D=K,B=v,T=H,b=oe,N=le,re=je,de=we,$=Pe,u=ut,y=Ne,F=ze,ne%16===15)for(var ee=0;ee<16;ee++)w=h[ee],E=p[ee],C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=h[(ee+9)%16],E=p[(ee+9)%16],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,O=h[(ee+1)%16],L=p[(ee+1)%16],w=(O>>>1|L<<31)^(O>>>8|L<<24)^O>>>7,E=(L>>>1|O<<31)^(L>>>8|O<<24)^(L>>>7|O<<25),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,O=h[(ee+14)%16],L=p[(ee+14)%16],w=(O>>>19|L<<13)^(L>>>29|O<<3)^O>>>6,E=(L>>>19|O<<13)^(O>>>29|L<<3)^(L>>>6|O<<26),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,h[ee]=d&65535|M<<16,p[ee]=C&65535|I<<16}w=T,E=F,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[0],E=m[0],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[0]=T=d&65535|M<<16,m[0]=F=C&65535|I<<16,w=j,E=b,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[1],E=m[1],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[1]=j=d&65535|M<<16,m[1]=b=C&65535|I<<16,w=G,E=N,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[2],E=m[2],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[2]=G=d&65535|M<<16,m[2]=N=C&65535|I<<16,w=X,E=re,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[3],E=m[3],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[3]=X=d&65535|M<<16,m[3]=re=C&65535|I<<16,w=U,E=de,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[4],E=m[4],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[4]=U=d&65535|M<<16,m[4]=de=C&65535|I<<16,w=V,E=$,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[5],E=m[5],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[5]=V=d&65535|M<<16,m[5]=$=C&65535|I<<16,w=D,E=u,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[6],E=m[6],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[6]=D=d&65535|M<<16,m[6]=u=C&65535|I<<16,w=B,E=y,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[7],E=m[7],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[7]=B=d&65535|M<<16,m[7]=y=C&65535|I<<16,P+=128,x-=128}return P}function f(h){var p=new i;p.update(h);var l=p.digest();return p.clean(),l}r.hash=f})(yg);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=xn,t=yg,i=Wr;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function s(W){const Q=new Float64Array(16);if(W)for(let K=0;K<W.length;K++)Q[K]=W[K];return Q}const o=new Uint8Array(32);o[0]=9;const f=s(),h=s([1]),p=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),P=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(W,Q){for(let K=0;K<16;K++)W[K]=Q[K]|0}function T(W){let Q=1;for(let K=0;K<16;K++){let v=W[K]+Q+65535;Q=Math.floor(v/65536),W[K]=v-Q*65536}W[0]+=Q-1+37*(Q-1)}function j(W,Q,K){const v=~(K-1);for(let H=0;H<16;H++){const oe=v&(W[H]^Q[H]);W[H]^=oe,Q[H]^=oe}}function G(W,Q){const K=s(),v=s();for(let H=0;H<16;H++)v[H]=Q[H];T(v),T(v),T(v);for(let H=0;H<2;H++){K[0]=v[0]-65517;for(let le=1;le<15;le++)K[le]=v[le]-65535-(K[le-1]>>16&1),K[le-1]&=65535;K[15]=v[15]-32767-(K[14]>>16&1);const oe=K[15]>>16&1;K[14]&=65535,j(v,K,1-oe)}for(let H=0;H<16;H++)W[2*H]=v[H]&255,W[2*H+1]=v[H]>>8}function X(W,Q){let K=0;for(let v=0;v<32;v++)K|=W[v]^Q[v];return(1&K-1>>>8)-1}function U(W,Q){const K=new Uint8Array(32),v=new Uint8Array(32);return G(K,W),G(v,Q),X(K,v)}function V(W){const Q=new Uint8Array(32);return G(Q,W),Q[0]&1}function D(W,Q){for(let K=0;K<16;K++)W[K]=Q[2*K]+(Q[2*K+1]<<8);W[15]&=32767}function B(W,Q,K){for(let v=0;v<16;v++)W[v]=Q[v]+K[v]}function F(W,Q,K){for(let v=0;v<16;v++)W[v]=Q[v]-K[v]}function b(W,Q,K){let v,H,oe=0,le=0,je=0,we=0,Pe=0,ut=0,Ne=0,ze=0,st=0,Me=0,me=0,Be=0,Ie=0,Ae=0,qe=0,xe=0,Se=0,Fe=0,Re=0,Ee=0,at=0,Te=0,Ce=0,lt=0,ct=0,pt=0,dr=0,yt=0,gt=0,ui=0,It=0,Ze=K[0],Nt=K[1],He=K[2],Ge=K[3],$t=K[4],ke=K[5],Ke=K[6],Ft=K[7],tt=K[8],Ve=K[9],Ht=K[10],Ye=K[11],Qe=K[12],Lt=K[13],Ue=K[14],rt=K[15];v=Q[0],oe+=v*Ze,le+=v*Nt,je+=v*He,we+=v*Ge,Pe+=v*$t,ut+=v*ke,Ne+=v*Ke,ze+=v*Ft,st+=v*tt,Me+=v*Ve,me+=v*Ht,Be+=v*Ye,Ie+=v*Qe,Ae+=v*Lt,qe+=v*Ue,xe+=v*rt,v=Q[1],le+=v*Ze,je+=v*Nt,we+=v*He,Pe+=v*Ge,ut+=v*$t,Ne+=v*ke,ze+=v*Ke,st+=v*Ft,Me+=v*tt,me+=v*Ve,Be+=v*Ht,Ie+=v*Ye,Ae+=v*Qe,qe+=v*Lt,xe+=v*Ue,Se+=v*rt,v=Q[2],je+=v*Ze,we+=v*Nt,Pe+=v*He,ut+=v*Ge,Ne+=v*$t,ze+=v*ke,st+=v*Ke,Me+=v*Ft,me+=v*tt,Be+=v*Ve,Ie+=v*Ht,Ae+=v*Ye,qe+=v*Qe,xe+=v*Lt,Se+=v*Ue,Fe+=v*rt,v=Q[3],we+=v*Ze,Pe+=v*Nt,ut+=v*He,Ne+=v*Ge,ze+=v*$t,st+=v*ke,Me+=v*Ke,me+=v*Ft,Be+=v*tt,Ie+=v*Ve,Ae+=v*Ht,qe+=v*Ye,xe+=v*Qe,Se+=v*Lt,Fe+=v*Ue,Re+=v*rt,v=Q[4],Pe+=v*Ze,ut+=v*Nt,Ne+=v*He,ze+=v*Ge,st+=v*$t,Me+=v*ke,me+=v*Ke,Be+=v*Ft,Ie+=v*tt,Ae+=v*Ve,qe+=v*Ht,xe+=v*Ye,Se+=v*Qe,Fe+=v*Lt,Re+=v*Ue,Ee+=v*rt,v=Q[5],ut+=v*Ze,Ne+=v*Nt,ze+=v*He,st+=v*Ge,Me+=v*$t,me+=v*ke,Be+=v*Ke,Ie+=v*Ft,Ae+=v*tt,qe+=v*Ve,xe+=v*Ht,Se+=v*Ye,Fe+=v*Qe,Re+=v*Lt,Ee+=v*Ue,at+=v*rt,v=Q[6],Ne+=v*Ze,ze+=v*Nt,st+=v*He,Me+=v*Ge,me+=v*$t,Be+=v*ke,Ie+=v*Ke,Ae+=v*Ft,qe+=v*tt,xe+=v*Ve,Se+=v*Ht,Fe+=v*Ye,Re+=v*Qe,Ee+=v*Lt,at+=v*Ue,Te+=v*rt,v=Q[7],ze+=v*Ze,st+=v*Nt,Me+=v*He,me+=v*Ge,Be+=v*$t,Ie+=v*ke,Ae+=v*Ke,qe+=v*Ft,xe+=v*tt,Se+=v*Ve,Fe+=v*Ht,Re+=v*Ye,Ee+=v*Qe,at+=v*Lt,Te+=v*Ue,Ce+=v*rt,v=Q[8],st+=v*Ze,Me+=v*Nt,me+=v*He,Be+=v*Ge,Ie+=v*$t,Ae+=v*ke,qe+=v*Ke,xe+=v*Ft,Se+=v*tt,Fe+=v*Ve,Re+=v*Ht,Ee+=v*Ye,at+=v*Qe,Te+=v*Lt,Ce+=v*Ue,lt+=v*rt,v=Q[9],Me+=v*Ze,me+=v*Nt,Be+=v*He,Ie+=v*Ge,Ae+=v*$t,qe+=v*ke,xe+=v*Ke,Se+=v*Ft,Fe+=v*tt,Re+=v*Ve,Ee+=v*Ht,at+=v*Ye,Te+=v*Qe,Ce+=v*Lt,lt+=v*Ue,ct+=v*rt,v=Q[10],me+=v*Ze,Be+=v*Nt,Ie+=v*He,Ae+=v*Ge,qe+=v*$t,xe+=v*ke,Se+=v*Ke,Fe+=v*Ft,Re+=v*tt,Ee+=v*Ve,at+=v*Ht,Te+=v*Ye,Ce+=v*Qe,lt+=v*Lt,ct+=v*Ue,pt+=v*rt,v=Q[11],Be+=v*Ze,Ie+=v*Nt,Ae+=v*He,qe+=v*Ge,xe+=v*$t,Se+=v*ke,Fe+=v*Ke,Re+=v*Ft,Ee+=v*tt,at+=v*Ve,Te+=v*Ht,Ce+=v*Ye,lt+=v*Qe,ct+=v*Lt,pt+=v*Ue,dr+=v*rt,v=Q[12],Ie+=v*Ze,Ae+=v*Nt,qe+=v*He,xe+=v*Ge,Se+=v*$t,Fe+=v*ke,Re+=v*Ke,Ee+=v*Ft,at+=v*tt,Te+=v*Ve,Ce+=v*Ht,lt+=v*Ye,ct+=v*Qe,pt+=v*Lt,dr+=v*Ue,yt+=v*rt,v=Q[13],Ae+=v*Ze,qe+=v*Nt,xe+=v*He,Se+=v*Ge,Fe+=v*$t,Re+=v*ke,Ee+=v*Ke,at+=v*Ft,Te+=v*tt,Ce+=v*Ve,lt+=v*Ht,ct+=v*Ye,pt+=v*Qe,dr+=v*Lt,yt+=v*Ue,gt+=v*rt,v=Q[14],qe+=v*Ze,xe+=v*Nt,Se+=v*He,Fe+=v*Ge,Re+=v*$t,Ee+=v*ke,at+=v*Ke,Te+=v*Ft,Ce+=v*tt,lt+=v*Ve,ct+=v*Ht,pt+=v*Ye,dr+=v*Qe,yt+=v*Lt,gt+=v*Ue,ui+=v*rt,v=Q[15],xe+=v*Ze,Se+=v*Nt,Fe+=v*He,Re+=v*Ge,Ee+=v*$t,at+=v*ke,Te+=v*Ke,Ce+=v*Ft,lt+=v*tt,ct+=v*Ve,pt+=v*Ht,dr+=v*Ye,yt+=v*Qe,gt+=v*Lt,ui+=v*Ue,It+=v*rt,oe+=38*Se,le+=38*Fe,je+=38*Re,we+=38*Ee,Pe+=38*at,ut+=38*Te,Ne+=38*Ce,ze+=38*lt,st+=38*ct,Me+=38*pt,me+=38*dr,Be+=38*yt,Ie+=38*gt,Ae+=38*ui,qe+=38*It,H=1,v=oe+H+65535,H=Math.floor(v/65536),oe=v-H*65536,v=le+H+65535,H=Math.floor(v/65536),le=v-H*65536,v=je+H+65535,H=Math.floor(v/65536),je=v-H*65536,v=we+H+65535,H=Math.floor(v/65536),we=v-H*65536,v=Pe+H+65535,H=Math.floor(v/65536),Pe=v-H*65536,v=ut+H+65535,H=Math.floor(v/65536),ut=v-H*65536,v=Ne+H+65535,H=Math.floor(v/65536),Ne=v-H*65536,v=ze+H+65535,H=Math.floor(v/65536),ze=v-H*65536,v=st+H+65535,H=Math.floor(v/65536),st=v-H*65536,v=Me+H+65535,H=Math.floor(v/65536),Me=v-H*65536,v=me+H+65535,H=Math.floor(v/65536),me=v-H*65536,v=Be+H+65535,H=Math.floor(v/65536),Be=v-H*65536,v=Ie+H+65535,H=Math.floor(v/65536),Ie=v-H*65536,v=Ae+H+65535,H=Math.floor(v/65536),Ae=v-H*65536,v=qe+H+65535,H=Math.floor(v/65536),qe=v-H*65536,v=xe+H+65535,H=Math.floor(v/65536),xe=v-H*65536,oe+=H-1+37*(H-1),H=1,v=oe+H+65535,H=Math.floor(v/65536),oe=v-H*65536,v=le+H+65535,H=Math.floor(v/65536),le=v-H*65536,v=je+H+65535,H=Math.floor(v/65536),je=v-H*65536,v=we+H+65535,H=Math.floor(v/65536),we=v-H*65536,v=Pe+H+65535,H=Math.floor(v/65536),Pe=v-H*65536,v=ut+H+65535,H=Math.floor(v/65536),ut=v-H*65536,v=Ne+H+65535,H=Math.floor(v/65536),Ne=v-H*65536,v=ze+H+65535,H=Math.floor(v/65536),ze=v-H*65536,v=st+H+65535,H=Math.floor(v/65536),st=v-H*65536,v=Me+H+65535,H=Math.floor(v/65536),Me=v-H*65536,v=me+H+65535,H=Math.floor(v/65536),me=v-H*65536,v=Be+H+65535,H=Math.floor(v/65536),Be=v-H*65536,v=Ie+H+65535,H=Math.floor(v/65536),Ie=v-H*65536,v=Ae+H+65535,H=Math.floor(v/65536),Ae=v-H*65536,v=qe+H+65535,H=Math.floor(v/65536),qe=v-H*65536,v=xe+H+65535,H=Math.floor(v/65536),xe=v-H*65536,oe+=H-1+37*(H-1),W[0]=oe,W[1]=le,W[2]=je,W[3]=we,W[4]=Pe,W[5]=ut,W[6]=Ne,W[7]=ze,W[8]=st,W[9]=Me,W[10]=me,W[11]=Be,W[12]=Ie,W[13]=Ae,W[14]=qe,W[15]=xe}function N(W,Q){b(W,Q,Q)}function re(W,Q){const K=s();let v;for(v=0;v<16;v++)K[v]=Q[v];for(v=253;v>=0;v--)N(K,K),v!==2&&v!==4&&b(K,K,Q);for(v=0;v<16;v++)W[v]=K[v]}function de(W,Q){const K=s();let v;for(v=0;v<16;v++)K[v]=Q[v];for(v=250;v>=0;v--)N(K,K),v!==1&&b(K,K,Q);for(v=0;v<16;v++)W[v]=K[v]}function $(W,Q){const K=s(),v=s(),H=s(),oe=s(),le=s(),je=s(),we=s(),Pe=s(),ut=s();F(K,W[1],W[0]),F(ut,Q[1],Q[0]),b(K,K,ut),B(v,W[0],W[1]),B(ut,Q[0],Q[1]),b(v,v,ut),b(H,W[3],Q[3]),b(H,H,l),b(oe,W[2],Q[2]),B(oe,oe,oe),F(le,v,K),F(je,oe,H),B(we,oe,H),B(Pe,v,K),b(W[0],le,je),b(W[1],Pe,we),b(W[2],we,je),b(W[3],le,Pe)}function u(W,Q,K){for(let v=0;v<4;v++)j(W[v],Q[v],K)}function y(W,Q){const K=s(),v=s(),H=s();re(H,Q[2]),b(K,Q[0],H),b(v,Q[1],H),G(W,v),W[31]^=V(K)<<7}function w(W,Q,K){x(W[0],f),x(W[1],h),x(W[2],h),x(W[3],f);for(let v=255;v>=0;--v){const H=K[v/8|0]>>(v&7)&1;u(W,Q,H),$(Q,W),$(W,W),u(W,Q,H)}}function E(W,Q){const K=[s(),s(),s(),s()];x(K[0],m),x(K[1],_),x(K[2],h),b(K[3],m,_),w(W,K,Q)}function O(W){if(W.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const Q=(0,t.hash)(W);Q[0]&=248,Q[31]&=127,Q[31]|=64;const K=new Uint8Array(32),v=[s(),s(),s(),s()];E(v,Q),y(K,v);const H=new Uint8Array(64);return H.set(W),H.set(K,32),{publicKey:K,secretKey:H}}r.generateKeyPairFromSeed=O;function L(W){const Q=(0,e.randomBytes)(32,W),K=O(Q);return(0,i.wipe)(Q),K}r.generateKeyPair=L;function C(W){if(W.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(W.subarray(32))}r.extractPublicKeyFromSecretKey=C;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function d(W,Q){let K,v,H,oe;for(v=63;v>=32;--v){for(K=0,H=v-32,oe=v-12;H<oe;++H)Q[H]+=K-16*Q[v]*I[H-(v-32)],K=Math.floor((Q[H]+128)/256),Q[H]-=K*256;Q[H]+=K,Q[v]=0}for(K=0,H=0;H<32;H++)Q[H]+=K-(Q[31]>>4)*I[H],K=Q[H]>>8,Q[H]&=255;for(H=0;H<32;H++)Q[H]-=K*I[H];for(v=0;v<32;v++)Q[v+1]+=Q[v]>>8,W[v]=Q[v]&255}function M(W){const Q=new Float64Array(64);for(let K=0;K<64;K++)Q[K]=W[K];for(let K=0;K<64;K++)W[K]=0;d(W,Q)}function ne(W,Q){const K=new Float64Array(64),v=[s(),s(),s(),s()],H=(0,t.hash)(W.subarray(0,32));H[0]&=248,H[31]&=127,H[31]|=64;const oe=new Uint8Array(64);oe.set(H.subarray(32),32);const le=new t.SHA512;le.update(oe.subarray(32)),le.update(Q);const je=le.digest();le.clean(),M(je),E(v,je),y(oe,v),le.reset(),le.update(oe.subarray(0,32)),le.update(W.subarray(32)),le.update(Q);const we=le.digest();M(we);for(let Pe=0;Pe<32;Pe++)K[Pe]=je[Pe];for(let Pe=0;Pe<32;Pe++)for(let ut=0;ut<32;ut++)K[Pe+ut]+=we[Pe]*H[ut];return d(oe.subarray(32),K),oe}r.sign=ne;function ee(W,Q){const K=s(),v=s(),H=s(),oe=s(),le=s(),je=s(),we=s();return x(W[2],h),D(W[1],Q),N(H,W[1]),b(oe,H,p),F(H,H,W[2]),B(oe,W[2],oe),N(le,oe),N(je,le),b(we,je,le),b(K,we,H),b(K,K,oe),de(K,K),b(K,K,H),b(K,K,oe),b(K,K,oe),b(W[0],K,oe),N(v,W[0]),b(v,v,oe),U(v,H)&&b(W[0],W[0],P),N(v,W[0]),b(v,v,oe),U(v,H)?-1:(V(W[0])===Q[31]>>7&&F(W[0],f,W[0]),b(W[3],W[0],W[1]),0)}function fe(W,Q,K){const v=new Uint8Array(32),H=[s(),s(),s(),s()],oe=[s(),s(),s(),s()];if(K.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(ee(oe,W))return!1;const le=new t.SHA512;le.update(K.subarray(0,32)),le.update(W),le.update(Q);const je=le.digest();return M(je),w(H,oe,je),E(oe,K.subarray(32)),$(H,oe),y(v,H),!X(K,v)}r.verify=fe;function pe(W){let Q=[s(),s(),s(),s()];if(ee(Q,W))throw new Error("Ed25519: invalid public key");let K=s(),v=s(),H=Q[1];B(K,h,H),F(v,h,H),re(v,v),b(K,K,v);let oe=new Uint8Array(32);return G(oe,K),oe}r.convertPublicKeyToX25519=pe;function he(W){const Q=(0,t.hash)(W.subarray(0,32));Q[0]&=248,Q[31]&=127,Q[31]|=64;const K=new Uint8Array(Q.subarray(0,32));return(0,i.wipe)(Q),K}r.convertSecretKeyToX25519=he})(yu);const H3="EdDSA",K3="JWT",_c=".",kc="base64url",wg="utf8",_g="utf8",j3=":",k3="did",W3="key",i0="base58btc",G3="z",V3="K36",Y3=32,J3=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),X3=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function os(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return X3(r)}catch{return r}}function an(r){return typeof r=="string"?r:J3(r)||""}function n0(r){return os(Tc(ks(r,kc),wg))}function Ec(r){return Tc(ks(an(r),wg),kc)}function Eg(r){const e=ks(V3,i0),t=G3+Tc(a2([e,r]),i0);return[k3,W3,t].join(j3)}function Z3(r){return Tc(r,kc)}function Q3(r){return ks(r,kc)}function e5(r){return ks([Ec(r.header),Ec(r.payload)].join(_c),_g)}function t5(r){return[Ec(r.header),Ec(r.payload),Z3(r.signature)].join(_c)}function Gh(r){const e=r.split(_c),t=n0(e[0]),i=n0(e[1]),s=Q3(e[2]),o=ks(e.slice(0,2).join(_c),_g);return{header:t,payload:i,signature:s,data:o}}function s0(r=xn.randomBytes(Y3)){return yu.generateKeyPairFromSeed(r)}async function r5(r,e,t,i,s=be.fromMiliseconds(Date.now())){const o={alg:H3,typ:K3},f=Eg(i.publicKey),h=s+t,p={iss:f,sub:r,aud:e,iat:s,exp:h},l=e5({header:o,payload:p}),m=yu.sign(i.secretKey,l);return t5({header:o,payload:p,signature:m})}const i5={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var Wt={},n5={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.2.1"};const s5=":";function Hs(r){const[e,t]=r.split(s5);return{namespace:e,reference:t}}function a0(r,e=[]){const t=[];return Object.keys(r).forEach(i=>{if(e.length&&!e.includes(i))return;const s=r[i];t.push(...s.accounts)}),t}function Sg(r,e){return r.includes(":")?[r]:e.chains||[]}var a5=Object.defineProperty,o0=Object.getOwnPropertySymbols,o5=Object.prototype.hasOwnProperty,c5=Object.prototype.propertyIsEnumerable,c0=(r,e,t)=>e in r?a5(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,f0=(r,e)=>{for(var t in e||(e={}))o5.call(e,t)&&c0(r,t,e[t]);if(o0)for(var t of o0(e))c5.call(e,t)&&c0(r,t,e[t]);return r};const f5="ReactNative",jr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},h5="js";function Sc(){return typeof _i<"u"&&typeof _i.versions<"u"&&typeof _i.versions.node<"u"}function Js(){return!Ba()&&!!fu()&&navigator.product===f5}function ka(){return!Sc()&&!!fu()&&!!Ba()}function Wa(){return Js()?jr.reactNative:Sc()?jr.node:ka()?jr.browser:jr.unknown}function u5(){var r;try{return Js()&&typeof Wt<"u"&&typeof(Wt==null?void 0:Wt.Application)<"u"?(r=Wt.Application)==null?void 0:r.applicationId:void 0}catch{return}}function l5(r,e){let t=Na.parse(r);return t=f0(f0({},t),e),r=Na.stringify(t),r}function Ig(){return Yp()||{name:"",description:"",url:"",icons:[""]}}function d5(){if(Wa()===jr.reactNative&&typeof Wt<"u"&&typeof(Wt==null?void 0:Wt.Platform)<"u"){const{OS:t,Version:i}=Wt.Platform;return[t,i].join("-")}const r=v2();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function p5(){var r;const e=Wa();return e===jr.browser?[e,((r=Vp())==null?void 0:r.host)||"unknown"].join(":"):e}function xg(r,e,t){const i=d5(),s=p5();return[[r,e].join("-"),[h5,t].join("-"),i,s].join("/")}function g5({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:s,projectId:o,useOnCloseEvent:f,bundleId:h}){const p=t.split("?"),l=xg(r,e,i),m={auth:s,ua:l,projectId:o,useOnCloseEvent:f||void 0,origin:h||void 0},_=l5(p[1]||"",m);return p[0]+"?"+_}function ns(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Pg(r){return Object.fromEntries(r.entries())}function Mg(r){return new Map(Object.entries(r))}function rs(r=be.FIVE_MINUTES,e){const t=be.toMiliseconds(r||be.FIVE_MINUTES);let i,s,o;return{resolve:f=>{o&&i&&(clearTimeout(o),i(f))},reject:f=>{o&&s&&(clearTimeout(o),s(f))},done:()=>new Promise((f,h)=>{o=setTimeout(()=>{h(new Error(e))},t),i=f,s=h})}}function Ks(r,e,t){return new Promise(async(i,s)=>{const o=setTimeout(()=>s(new Error(t)),e);try{const f=await r;i(f)}catch(f){s(f)}clearTimeout(o)})}function Ag(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function b5(r){return Ag("topic",r)}function v5(r){return Ag("id",r)}function Og(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function rr(r,e){return be.fromMiliseconds(Date.now()+be.toMiliseconds(r))}function wn(r){return Date.now()>=be.toMiliseconds(r)}function ht(r,e){return`${r}${e?`:${e}`:""}`}function fc(r=[],e=[]){return[...new Set([...r,...e])]}async function m5({id:r,topic:e,wcDeepLink:t}){var i;try{if(!t)return;const s=typeof t=="string"?JSON.parse(t):t,o=s==null?void 0:s.href;if(typeof o!="string")return;const f=y5(o,r,e),h=Wa();if(h===jr.browser){if(!((i=Ba())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}f.startsWith("https://")||f.startsWith("http://")?window.open(f,"_blank","noreferrer noopener"):window.open(f,_5()?"_blank":"_self","noreferrer noopener")}else h===jr.reactNative&&typeof(Wt==null?void 0:Wt.Linking)<"u"&&await Wt.Linking.openURL(f)}catch(s){console.error(s)}}function y5(r,e,t){const i=`requestId=${e}&sessionTopic=${t}`;r.endsWith("/")&&(r=r.slice(0,-1));let s=`${r}`;if(r.startsWith("https://t.me")){const o=r.includes("?")?"&startapp=":"?startapp=";s=`${s}${o}${E5(i,!0)}`}else s=`${s}/wc?${i}`;return s}async function w5(r,e){let t="";try{if(ka()&&(t=localStorage.getItem(e),t))return t;t=await r.getItem(e)}catch(i){console.error(i)}return t}function h0(r,e){if(!r.includes(e))return null;const t=r.split(/([&,?,=])/),i=t.indexOf(e);return t[i+2]}function u0(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function wu(){return typeof _i<"u"&&n5.IS_VITEST==="true"}function _5(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function E5(r,e=!1){const t=ai.from(r).toString("base64");return e?t.replace(/[=]/g,""):t}function Rg(r){return ai.from(r,"base64").toString("utf-8")}const S5="https://rpc.walletconnect.org/v1";async function I5(r,e,t,i,s,o){switch(t.t){case"eip191":return x5(r,e,t.s);case"eip1271":return await P5(r,e,t.s,i,s,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}function x5(r,e,t){return o2(jp(e),t).toLowerCase()===r.toLowerCase()}async function P5(r,e,t,i,s,o){const f=Hs(i);if(!f.namespace||!f.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${i}`);try{const h="0x1626ba7e",p="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",m=t.substring(2),_=jp(e).substring(2),P=h+_+p+l+m,x=await fetch(`${o||S5}/?chainId=${i}&projectId=${s}`,{method:"POST",body:JSON.stringify({id:M5(),jsonrpc:"2.0",method:"eth_call",params:[{to:r,data:P},"latest"]})}),{result:T}=await x.json();return T?T.slice(0,h.length).toLowerCase()===h.toLowerCase():!1}catch(h){return console.error("isValidEip1271Signature: ",h),!1}}function M5(){return Date.now()+Math.floor(Math.random()*1e3)}var A5=Object.defineProperty,O5=Object.defineProperties,R5=Object.getOwnPropertyDescriptors,l0=Object.getOwnPropertySymbols,T5=Object.prototype.hasOwnProperty,C5=Object.prototype.propertyIsEnumerable,d0=(r,e,t)=>e in r?A5(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,N5=(r,e)=>{for(var t in e||(e={}))T5.call(e,t)&&d0(r,t,e[t]);if(l0)for(var t of l0(e))C5.call(e,t)&&d0(r,t,e[t]);return r},$5=(r,e)=>O5(r,R5(e));const L5="did:pkh:",_u=r=>r==null?void 0:r.split(":"),D5=r=>{const e=r&&_u(r);if(e)return r.includes(L5)?e[3]:e[1]},Vh=r=>{const e=r&&_u(r);if(e)return e[2]+":"+e[3]},Ic=r=>{const e=r&&_u(r);if(e)return e.pop()};async function p0(r){const{cacao:e,projectId:t}=r,{s:i,p:s}=e,o=Tg(s,s.iss),f=Ic(s.iss);return await I5(f,o,i,Vh(s.iss),t)}const Tg=(r,e)=>{const t=`${r.domain} wants you to sign in with your Ethereum account:`,i=Ic(e);if(!r.aud&&!r.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=r.statement||void 0;const o=`URI: ${r.aud||r.uri}`,f=`Version: ${r.version}`,h=`Chain ID: ${D5(e)}`,p=`Nonce: ${r.nonce}`,l=`Issued At: ${r.iat}`,m=r.exp?`Expiration Time: ${r.exp}`:void 0,_=r.nbf?`Not Before: ${r.nbf}`:void 0,P=r.requestId?`Request ID: ${r.requestId}`:void 0,x=r.resources?`Resources:${r.resources.map(j=>`
|
|
15
|
+
***************************************************************************** */var qh=function(r,e){return qh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},qh(r,e)};function S2(r,e){qh(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Uh=function(){return Uh=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Uh.apply(this,arguments)};function I2(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function x2(r,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var h=r.length-1;h>=0;h--)(f=r[h])&&(o=(s<3?f(o):s>3?f(e,t,o):f(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function P2(r,e){return function(t,i){e(t,i,r)}}function M2(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function A2(r,e,t,i){function s(o){return o instanceof t?o:new t(function(f){f(o)})}return new(t||(t=Promise))(function(o,f){function h(m){try{l(i.next(m))}catch(_){f(_)}}function p(m){try{l(i.throw(m))}catch(_){f(_)}}function l(m){m.done?o(m.value):s(m.value).then(h,p)}l((i=i.apply(r,e||[])).next())})}function O2(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,s,o,f;return f={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(l){return function(m){return p([l,m])}}function p(l){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(o=l[0]&2?s.return:l[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,l[1])).done)return o;switch(s=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,s=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(l[0]===6&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(m){l=[6,m],s=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function R2(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function T2(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function zh(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wp(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,o=[],f;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(h){f={error:h}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(f)throw f.error}}return o}function C2(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Wp(arguments[e]));return r}function N2(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var o=arguments[e],f=0,h=o.length;f<h;f++,s++)i[s]=o[f];return i}function Ca(r){return this instanceof Ca?(this.v=r,this):new Ca(r)}function $2(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,o=[];return s={},f("next"),f("throw"),f("return"),s[Symbol.asyncIterator]=function(){return this},s;function f(P){i[P]&&(s[P]=function(x){return new Promise(function(T,j){o.push([P,x,T,j])>1||h(P,x)})})}function h(P,x){try{p(i[P](x))}catch(T){_(o[0][3],T)}}function p(P){P.value instanceof Ca?Promise.resolve(P.value.v).then(l,m):_(o[0][2],P)}function l(P){h("next",P)}function m(P){h("throw",P)}function _(P,x){P(x),o.shift(),o.length&&h(o[0][0],o[0][1])}}function L2(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,o){e[s]=r[s]?function(f){return(t=!t)?{value:Ca(r[s](f)),done:s==="return"}:o?o(f):f}:o}}function D2(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof zh=="function"?zh(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=r[o]&&function(f){return new Promise(function(h,p){f=r[o](f),s(h,p,f.done,f.value)})}}function s(o,f,h,p){Promise.resolve(p).then(function(l){o({value:l,done:h})},f)}}function q2(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function U2(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function z2(r){return r&&r.__esModule?r:{default:r}}function B2(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function F2(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const H2=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Uh},__asyncDelegator:L2,__asyncGenerator:$2,__asyncValues:D2,__await:Ca,__awaiter:A2,__classPrivateFieldGet:B2,__classPrivateFieldSet:F2,__createBinding:R2,__decorate:x2,__exportStar:T2,__extends:S2,__generator:O2,__importDefault:z2,__importStar:U2,__makeTemplateObject:q2,__metadata:M2,__param:P2,__read:Wp,__rest:I2,__spread:C2,__spreadArrays:N2,__values:zh},Symbol.toStringTag,{value:"Module"})),Cc=Bp(H2);var uh={},ma={},Dd;function K2(){if(Dd)return ma;Dd=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return ma.delay=r,ma}var Xn={},lh={},Zn={},qd;function j2(){return qd||(qd=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.ONE_THOUSAND=Zn.ONE_HUNDRED=void 0,Zn.ONE_HUNDRED=100,Zn.ONE_THOUSAND=1e3),Zn}var dh={},Ud;function k2(){return Ud||(Ud=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(dh)),dh}var zd;function Gp(){return zd||(zd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Cc;e.__exportStar(j2(),r),e.__exportStar(k2(),r)}(lh)),lh}var Bd;function W2(){if(Bd)return Xn;Bd=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.fromMiliseconds=Xn.toMiliseconds=void 0;const r=Gp();function e(i){return i*r.ONE_THOUSAND}Xn.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return Xn.fromMiliseconds=t,Xn}var Fd;function G2(){return Fd||(Fd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Cc;e.__exportStar(K2(),r),e.__exportStar(W2(),r)}(uh)),uh}var $s={},Hd;function V2(){if(Hd)return $s;Hd=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const s=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:s})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return $s.Watch=r,$s.default=r,$s}var ph={},ya={},Kd;function Y2(){if(Kd)return ya;Kd=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.IWatch=void 0;class r{}return ya.IWatch=r,ya}var jd;function J2(){return jd||(jd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Cc.__exportStar(Y2(),r)}(ph)),ph}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Cc;e.__exportStar(G2(),r),e.__exportStar(V2(),r),e.__exportStar(J2(),r),e.__exportStar(Gp(),r)})(be);var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.getLocalStorage=Tt.getLocalStorageOrThrow=Tt.getCrypto=Tt.getCryptoOrThrow=Vp=Tt.getLocation=Tt.getLocationOrThrow=fu=Tt.getNavigator=Tt.getNavigatorOrThrow=Ba=Tt.getDocument=Tt.getDocumentOrThrow=Tt.getFromWindowOrThrow=Tt.getFromWindow=void 0;function hs(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Tt.getFromWindow=hs;function Ws(r){const e=hs(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Tt.getFromWindowOrThrow=Ws;function X2(){return Ws("document")}Tt.getDocumentOrThrow=X2;function Z2(){return hs("document")}var Ba=Tt.getDocument=Z2;function Q2(){return Ws("navigator")}Tt.getNavigatorOrThrow=Q2;function e_(){return hs("navigator")}var fu=Tt.getNavigator=e_;function t_(){return Ws("location")}Tt.getLocationOrThrow=t_;function r_(){return hs("location")}var Vp=Tt.getLocation=r_;function i_(){return Ws("crypto")}Tt.getCryptoOrThrow=i_;function n_(){return hs("crypto")}Tt.getCrypto=n_;function s_(){return Ws("localStorage")}Tt.getLocalStorageOrThrow=s_;function a_(){return hs("localStorage")}Tt.getLocalStorage=a_;var hu={};Object.defineProperty(hu,"__esModule",{value:!0});var Yp=hu.getWindowMetadata=void 0;const kd=Tt;function o_(){let r,e;try{r=kd.getDocumentOrThrow(),e=kd.getLocationOrThrow()}catch{return null}function t(){const _=r.getElementsByTagName("link"),P=[];for(let x=0;x<_.length;x++){const T=_[x],j=T.getAttribute("rel");if(j&&j.toLowerCase().indexOf("icon")>-1){const G=T.getAttribute("href");if(G)if(G.toLowerCase().indexOf("https:")===-1&&G.toLowerCase().indexOf("http:")===-1&&G.indexOf("//")!==0){let X=e.protocol+"//"+e.host;if(G.indexOf("/")===0)X+=G;else{const U=e.pathname.split("/");U.pop();const V=U.join("/");X+=V+"/"+G}P.push(X)}else if(G.indexOf("//")===0){const X=e.protocol+G;P.push(X)}else P.push(G)}}return P}function i(..._){const P=r.getElementsByTagName("meta");for(let x=0;x<P.length;x++){const T=P[x],j=["itemprop","property","name"].map(G=>T.getAttribute(G)).filter(G=>G?_.includes(G):!1);if(j.length&&j){const G=T.getAttribute("content");if(G)return G}}return""}function s(){let _=i("name","og:site_name","og:title","twitter:title");return _||(_=r.title),_}function o(){return i("description","og:description","twitter:description","keywords")}const f=s(),h=o(),p=e.origin,l=t();return{description:h,url:p,icons:l,name:f}}Yp=hu.getWindowMetadata=o_;var Na={},c_=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Jp="%[a-f0-9]{2}",Wd=new RegExp("("+Jp+")|([^%]+?)","gi"),Gd=new RegExp("("+Jp+")+","gi");function Bh(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),i=r.slice(e);return Array.prototype.concat.call([],Bh(t),Bh(i))}function f_(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(Wd)||[],t=1;t<e.length;t++)r=Bh(e,t).join(""),e=r.match(Wd)||[];return r}}function h_(r){for(var e={"%FE%FF":"��","%FF%FE":"��"},t=Gd.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var i=f_(t[0]);i!==t[0]&&(e[t[0]]=i)}t=Gd.exec(r)}e["%C2"]="�";for(var s=Object.keys(e),o=0;o<s.length;o++){var f=s[o];r=r.replace(new RegExp(f,"g"),e[f])}return r}var u_=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return h_(r)}},l_=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},d_=function(r,e){for(var t={},i=Object.keys(r),s=Array.isArray(e),o=0;o<i.length;o++){var f=i[o],h=r[f];(s?e.indexOf(f)!==-1:e(f,h,r))&&(t[f]=h)}return t};(function(r){const e=c_,t=u_,i=l_,s=d_,o=U=>U==null,f=Symbol("encodeFragmentIdentifier");function h(U){switch(U.arrayFormat){case"index":return V=>(D,B)=>{const F=D.length;return B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,[m(V,U),"[",F,"]"].join("")]:[...D,[m(V,U),"[",m(F,U),"]=",m(B,U)].join("")]};case"bracket":return V=>(D,B)=>B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,[m(V,U),"[]"].join("")]:[...D,[m(V,U),"[]=",m(B,U)].join("")];case"colon-list-separator":return V=>(D,B)=>B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,[m(V,U),":list="].join("")]:[...D,[m(V,U),":list=",m(B,U)].join("")];case"comma":case"separator":case"bracket-separator":{const V=U.arrayFormat==="bracket-separator"?"[]=":"=";return D=>(B,F)=>F===void 0||U.skipNull&&F===null||U.skipEmptyString&&F===""?B:(F=F===null?"":F,B.length===0?[[m(D,U),V,m(F,U)].join("")]:[[B,m(F,U)].join(U.arrayFormatSeparator)])}default:return V=>(D,B)=>B===void 0||U.skipNull&&B===null||U.skipEmptyString&&B===""?D:B===null?[...D,m(V,U)]:[...D,[m(V,U),"=",m(B,U)].join("")]}}function p(U){let V;switch(U.arrayFormat){case"index":return(D,B,F)=>{if(V=/\[(\d*)\]$/.exec(D),D=D.replace(/\[\d*\]$/,""),!V){F[D]=B;return}F[D]===void 0&&(F[D]={}),F[D][V[1]]=B};case"bracket":return(D,B,F)=>{if(V=/(\[\])$/.exec(D),D=D.replace(/\[\]$/,""),!V){F[D]=B;return}if(F[D]===void 0){F[D]=[B];return}F[D]=[].concat(F[D],B)};case"colon-list-separator":return(D,B,F)=>{if(V=/(:list)$/.exec(D),D=D.replace(/:list$/,""),!V){F[D]=B;return}if(F[D]===void 0){F[D]=[B];return}F[D]=[].concat(F[D],B)};case"comma":case"separator":return(D,B,F)=>{const b=typeof B=="string"&&B.includes(U.arrayFormatSeparator),N=typeof B=="string"&&!b&&_(B,U).includes(U.arrayFormatSeparator);B=N?_(B,U):B;const re=b||N?B.split(U.arrayFormatSeparator).map(de=>_(de,U)):B===null?B:_(B,U);F[D]=re};case"bracket-separator":return(D,B,F)=>{const b=/(\[\])$/.test(D);if(D=D.replace(/\[\]$/,""),!b){F[D]=B&&_(B,U);return}const N=B===null?[]:B.split(U.arrayFormatSeparator).map(re=>_(re,U));if(F[D]===void 0){F[D]=N;return}F[D]=[].concat(F[D],N)};default:return(D,B,F)=>{if(F[D]===void 0){F[D]=B;return}F[D]=[].concat(F[D],B)}}}function l(U){if(typeof U!="string"||U.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(U,V){return V.encode?V.strict?e(U):encodeURIComponent(U):U}function _(U,V){return V.decode?t(U):U}function P(U){return Array.isArray(U)?U.sort():typeof U=="object"?P(Object.keys(U)).sort((V,D)=>Number(V)-Number(D)).map(V=>U[V]):U}function x(U){const V=U.indexOf("#");return V!==-1&&(U=U.slice(0,V)),U}function T(U){let V="";const D=U.indexOf("#");return D!==-1&&(V=U.slice(D)),V}function j(U){U=x(U);const V=U.indexOf("?");return V===-1?"":U.slice(V+1)}function G(U,V){return V.parseNumbers&&!Number.isNaN(Number(U))&&typeof U=="string"&&U.trim()!==""?U=Number(U):V.parseBooleans&&U!==null&&(U.toLowerCase()==="true"||U.toLowerCase()==="false")&&(U=U.toLowerCase()==="true"),U}function X(U,V){V=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},V),l(V.arrayFormatSeparator);const D=p(V),B=Object.create(null);if(typeof U!="string"||(U=U.trim().replace(/^[?#&]/,""),!U))return B;for(const F of U.split("&")){if(F==="")continue;let[b,N]=i(V.decode?F.replace(/\+/g," "):F,"=");N=N===void 0?null:["comma","separator","bracket-separator"].includes(V.arrayFormat)?N:_(N,V),D(_(b,V),N,B)}for(const F of Object.keys(B)){const b=B[F];if(typeof b=="object"&&b!==null)for(const N of Object.keys(b))b[N]=G(b[N],V);else B[F]=G(b,V)}return V.sort===!1?B:(V.sort===!0?Object.keys(B).sort():Object.keys(B).sort(V.sort)).reduce((F,b)=>{const N=B[b];return N&&typeof N=="object"&&!Array.isArray(N)?F[b]=P(N):F[b]=N,F},Object.create(null))}r.extract=j,r.parse=X,r.stringify=(U,V)=>{if(!U)return"";V=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},V),l(V.arrayFormatSeparator);const D=N=>V.skipNull&&o(U[N])||V.skipEmptyString&&U[N]==="",B=h(V),F={};for(const N of Object.keys(U))D(N)||(F[N]=U[N]);const b=Object.keys(F);return V.sort!==!1&&b.sort(V.sort),b.map(N=>{const re=U[N];return re===void 0?"":re===null?m(N,V):Array.isArray(re)?re.length===0&&V.arrayFormat==="bracket-separator"?m(N,V)+"[]":re.reduce(B(N),[]).join("&"):m(N,V)+"="+m(re,V)}).filter(N=>N.length>0).join("&")},r.parseUrl=(U,V)=>{V=Object.assign({decode:!0},V);const[D,B]=i(U,"#");return Object.assign({url:D.split("?")[0]||"",query:X(j(U),V)},V&&V.parseFragmentIdentifier&&B?{fragmentIdentifier:_(B,V)}:{})},r.stringifyUrl=(U,V)=>{V=Object.assign({encode:!0,strict:!0,[f]:!0},V);const D=x(U.url).split("?")[0]||"",B=r.extract(U.url),F=r.parse(B,{sort:!1}),b=Object.assign(F,U.query);let N=r.stringify(b,V);N&&(N=`?${N}`);let re=T(U.url);return U.fragmentIdentifier&&(re=`#${V[f]?m(U.fragmentIdentifier,V):U.fragmentIdentifier}`),`${D}${N}${re}`},r.pick=(U,V,D)=>{D=Object.assign({parseFragmentIdentifier:!0,[f]:!1},D);const{url:B,query:F,fragmentIdentifier:b}=r.parseUrl(U,D);return r.stringifyUrl({url:B,query:s(F,V),fragmentIdentifier:b},D)},r.exclude=(U,V,D)=>{const B=Array.isArray(V)?F=>!V.includes(F):(F,b)=>!V(F,b);return r.pick(U,B,D)}})(Na);var uu={},Nc={},et={},Xp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(h,p){var l=h>>>16&65535,m=h&65535,_=p>>>16&65535,P=p&65535;return m*P+(l*P+m*_<<16>>>0)|0}r.mul=Math.imul||e;function t(h,p){return h+p|0}r.add=t;function i(h,p){return h-p|0}r.sub=i;function s(h,p){return h<<p|h>>>32-p}r.rotl=s;function o(h,p){return h<<32-p|h>>>p}r.rotr=o;function f(h){return typeof h=="number"&&isFinite(h)&&Math.floor(h)===h}r.isInteger=Number.isInteger||f,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(h){return r.isInteger(h)&&h>=-r.MAX_SAFE_INTEGER&&h<=r.MAX_SAFE_INTEGER}})(Xp);Object.defineProperty(et,"__esModule",{value:!0});var Zp=Xp;function p_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}et.readInt16BE=p_;function g_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}et.readUint16BE=g_;function b_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}et.readInt16LE=b_;function v_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}et.readUint16LE=v_;function Qp(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}et.writeUint16BE=Qp;et.writeInt16BE=Qp;function eg(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}et.writeUint16LE=eg;et.writeInt16LE=eg;function Fh(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}et.readInt32BE=Fh;function Hh(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}et.readUint32BE=Hh;function Kh(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}et.readInt32LE=Kh;function jh(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}et.readUint32LE=jh;function bc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}et.writeUint32BE=bc;et.writeInt32BE=bc;function vc(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}et.writeUint32LE=vc;et.writeInt32LE=vc;function m_(r,e){e===void 0&&(e=0);var t=Fh(r,e),i=Fh(r,e+4);return t*4294967296+i-(i>>31)*4294967296}et.readInt64BE=m_;function y_(r,e){e===void 0&&(e=0);var t=Hh(r,e),i=Hh(r,e+4);return t*4294967296+i}et.readUint64BE=y_;function w_(r,e){e===void 0&&(e=0);var t=Kh(r,e),i=Kh(r,e+4);return i*4294967296+t-(t>>31)*4294967296}et.readInt64LE=w_;function __(r,e){e===void 0&&(e=0);var t=jh(r,e),i=jh(r,e+4);return i*4294967296+t}et.readUint64LE=__;function tg(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),bc(r/4294967296>>>0,e,t),bc(r>>>0,e,t+4),e}et.writeUint64BE=tg;et.writeInt64BE=tg;function rg(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),vc(r>>>0,e,t),vc(r/4294967296>>>0,e,t+4),e}et.writeUint64LE=rg;et.writeInt64LE=rg;function E_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,s=1,o=r/8+t-1;o>=t;o--)i+=e[o]*s,s*=256;return i}et.readUintBE=E_;function S_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,s=1,o=t;o<t+r/8;o++)i+=e[o]*s,s*=256;return i}et.readUintLE=S_;function I_(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Zp.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,o=r/8+i-1;o>=i;o--)t[o]=e/s&255,s*=256;return t}et.writeUintBE=I_;function x_(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Zp.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,o=i;o<i+r/8;o++)t[o]=e/s&255,s*=256;return t}et.writeUintLE=x_;function P_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}et.readFloat32BE=P_;function M_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}et.readFloat32LE=M_;function A_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}et.readFloat64BE=A_;function O_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}et.readFloat64LE=O_;function R_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r),e}et.writeFloat32BE=R_;function T_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r,!0),e}et.writeFloat32LE=T_;function C_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r),e}et.writeFloat64BE=C_;function N_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r,!0),e}et.writeFloat64LE=N_;var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});function $_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}Wr.wipe=$_;Object.defineProperty(Nc,"__esModule",{value:!0});var vr=et,kh=Wr,L_=20;function D_(r,e,t){for(var i=1634760805,s=857760878,o=2036477234,f=1797285236,h=t[3]<<24|t[2]<<16|t[1]<<8|t[0],p=t[7]<<24|t[6]<<16|t[5]<<8|t[4],l=t[11]<<24|t[10]<<16|t[9]<<8|t[8],m=t[15]<<24|t[14]<<16|t[13]<<8|t[12],_=t[19]<<24|t[18]<<16|t[17]<<8|t[16],P=t[23]<<24|t[22]<<16|t[21]<<8|t[20],x=t[27]<<24|t[26]<<16|t[25]<<8|t[24],T=t[31]<<24|t[30]<<16|t[29]<<8|t[28],j=e[3]<<24|e[2]<<16|e[1]<<8|e[0],G=e[7]<<24|e[6]<<16|e[5]<<8|e[4],X=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],V=i,D=s,B=o,F=f,b=h,N=p,re=l,de=m,$=_,u=P,y=x,w=T,E=j,O=G,L=X,C=U,I=0;I<L_;I+=2)V=V+b|0,E^=V,E=E>>>16|E<<16,$=$+E|0,b^=$,b=b>>>20|b<<12,D=D+N|0,O^=D,O=O>>>16|O<<16,u=u+O|0,N^=u,N=N>>>20|N<<12,B=B+re|0,L^=B,L=L>>>16|L<<16,y=y+L|0,re^=y,re=re>>>20|re<<12,F=F+de|0,C^=F,C=C>>>16|C<<16,w=w+C|0,de^=w,de=de>>>20|de<<12,B=B+re|0,L^=B,L=L>>>24|L<<8,y=y+L|0,re^=y,re=re>>>25|re<<7,F=F+de|0,C^=F,C=C>>>24|C<<8,w=w+C|0,de^=w,de=de>>>25|de<<7,D=D+N|0,O^=D,O=O>>>24|O<<8,u=u+O|0,N^=u,N=N>>>25|N<<7,V=V+b|0,E^=V,E=E>>>24|E<<8,$=$+E|0,b^=$,b=b>>>25|b<<7,V=V+N|0,C^=V,C=C>>>16|C<<16,y=y+C|0,N^=y,N=N>>>20|N<<12,D=D+re|0,E^=D,E=E>>>16|E<<16,w=w+E|0,re^=w,re=re>>>20|re<<12,B=B+de|0,O^=B,O=O>>>16|O<<16,$=$+O|0,de^=$,de=de>>>20|de<<12,F=F+b|0,L^=F,L=L>>>16|L<<16,u=u+L|0,b^=u,b=b>>>20|b<<12,B=B+de|0,O^=B,O=O>>>24|O<<8,$=$+O|0,de^=$,de=de>>>25|de<<7,F=F+b|0,L^=F,L=L>>>24|L<<8,u=u+L|0,b^=u,b=b>>>25|b<<7,D=D+re|0,E^=D,E=E>>>24|E<<8,w=w+E|0,re^=w,re=re>>>25|re<<7,V=V+N|0,C^=V,C=C>>>24|C<<8,y=y+C|0,N^=y,N=N>>>25|N<<7;vr.writeUint32LE(V+i|0,r,0),vr.writeUint32LE(D+s|0,r,4),vr.writeUint32LE(B+o|0,r,8),vr.writeUint32LE(F+f|0,r,12),vr.writeUint32LE(b+h|0,r,16),vr.writeUint32LE(N+p|0,r,20),vr.writeUint32LE(re+l|0,r,24),vr.writeUint32LE(de+m|0,r,28),vr.writeUint32LE($+_|0,r,32),vr.writeUint32LE(u+P|0,r,36),vr.writeUint32LE(y+x|0,r,40),vr.writeUint32LE(w+T|0,r,44),vr.writeUint32LE(E+j|0,r,48),vr.writeUint32LE(O+G|0,r,52),vr.writeUint32LE(L+X|0,r,56),vr.writeUint32LE(C+U|0,r,60)}function ig(r,e,t,i,s){if(s===void 0&&(s=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<t.length)throw new Error("ChaCha: destination is shorter than source");var o,f;if(s===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),f=o.length-e.length,o.set(e,f)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,f=s}for(var h=new Uint8Array(64),p=0;p<t.length;p+=64){D_(h,o,r);for(var l=p;l<p+64&&l<t.length;l++)i[l]=t[l]^h[l-p];U_(o,0,f)}return kh.wipe(h),s===0&&kh.wipe(o),i}Nc.streamXOR=ig;function q_(r,e,t,i){return i===void 0&&(i=0),kh.wipe(t),ig(r,e,t,t,i)}Nc.stream=q_;function U_(r,e,t){for(var i=1;t--;)i=i+(r[e]&255)|0,r[e]=i&255,i>>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var ng={},In={};Object.defineProperty(In,"__esModule",{value:!0});function z_(r,e,t){return~(r-1)&e|r-1&t}In.select=z_;function B_(r,e){return(r|0)-(e|0)-1>>>31&1}In.lessOrEqual=B_;function sg(r,e){if(r.length!==e.length)return 0;for(var t=0,i=0;i<r.length;i++)t|=r[i]^e[i];return 1&t-1>>>8}In.compare=sg;function F_(r,e){return r.length===0||e.length===0?!1:sg(r,e)!==0}In.equal=F_;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=In,t=Wr;r.DIGEST_LENGTH=16;var i=function(){function f(h){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var p=h[0]|h[1]<<8;this._r[0]=p&8191;var l=h[2]|h[3]<<8;this._r[1]=(p>>>13|l<<3)&8191;var m=h[4]|h[5]<<8;this._r[2]=(l>>>10|m<<6)&7939;var _=h[6]|h[7]<<8;this._r[3]=(m>>>7|_<<9)&8191;var P=h[8]|h[9]<<8;this._r[4]=(_>>>4|P<<12)&255,this._r[5]=P>>>1&8190;var x=h[10]|h[11]<<8;this._r[6]=(P>>>14|x<<2)&8191;var T=h[12]|h[13]<<8;this._r[7]=(x>>>11|T<<5)&8065;var j=h[14]|h[15]<<8;this._r[8]=(T>>>8|j<<8)&8191,this._r[9]=j>>>5&127,this._pad[0]=h[16]|h[17]<<8,this._pad[1]=h[18]|h[19]<<8,this._pad[2]=h[20]|h[21]<<8,this._pad[3]=h[22]|h[23]<<8,this._pad[4]=h[24]|h[25]<<8,this._pad[5]=h[26]|h[27]<<8,this._pad[6]=h[28]|h[29]<<8,this._pad[7]=h[30]|h[31]<<8}return f.prototype._blocks=function(h,p,l){for(var m=this._fin?0:2048,_=this._h[0],P=this._h[1],x=this._h[2],T=this._h[3],j=this._h[4],G=this._h[5],X=this._h[6],U=this._h[7],V=this._h[8],D=this._h[9],B=this._r[0],F=this._r[1],b=this._r[2],N=this._r[3],re=this._r[4],de=this._r[5],$=this._r[6],u=this._r[7],y=this._r[8],w=this._r[9];l>=16;){var E=h[p+0]|h[p+1]<<8;_+=E&8191;var O=h[p+2]|h[p+3]<<8;P+=(E>>>13|O<<3)&8191;var L=h[p+4]|h[p+5]<<8;x+=(O>>>10|L<<6)&8191;var C=h[p+6]|h[p+7]<<8;T+=(L>>>7|C<<9)&8191;var I=h[p+8]|h[p+9]<<8;j+=(C>>>4|I<<12)&8191,G+=I>>>1&8191;var d=h[p+10]|h[p+11]<<8;X+=(I>>>14|d<<2)&8191;var M=h[p+12]|h[p+13]<<8;U+=(d>>>11|M<<5)&8191;var ne=h[p+14]|h[p+15]<<8;V+=(M>>>8|ne<<8)&8191,D+=ne>>>5|m;var ee=0,fe=ee;fe+=_*B,fe+=P*(5*w),fe+=x*(5*y),fe+=T*(5*u),fe+=j*(5*$),ee=fe>>>13,fe&=8191,fe+=G*(5*de),fe+=X*(5*re),fe+=U*(5*N),fe+=V*(5*b),fe+=D*(5*F),ee+=fe>>>13,fe&=8191;var pe=ee;pe+=_*F,pe+=P*B,pe+=x*(5*w),pe+=T*(5*y),pe+=j*(5*u),ee=pe>>>13,pe&=8191,pe+=G*(5*$),pe+=X*(5*de),pe+=U*(5*re),pe+=V*(5*N),pe+=D*(5*b),ee+=pe>>>13,pe&=8191;var he=ee;he+=_*b,he+=P*F,he+=x*B,he+=T*(5*w),he+=j*(5*y),ee=he>>>13,he&=8191,he+=G*(5*u),he+=X*(5*$),he+=U*(5*de),he+=V*(5*re),he+=D*(5*N),ee+=he>>>13,he&=8191;var W=ee;W+=_*N,W+=P*b,W+=x*F,W+=T*B,W+=j*(5*w),ee=W>>>13,W&=8191,W+=G*(5*y),W+=X*(5*u),W+=U*(5*$),W+=V*(5*de),W+=D*(5*re),ee+=W>>>13,W&=8191;var Q=ee;Q+=_*re,Q+=P*N,Q+=x*b,Q+=T*F,Q+=j*B,ee=Q>>>13,Q&=8191,Q+=G*(5*w),Q+=X*(5*y),Q+=U*(5*u),Q+=V*(5*$),Q+=D*(5*de),ee+=Q>>>13,Q&=8191;var K=ee;K+=_*de,K+=P*re,K+=x*N,K+=T*b,K+=j*F,ee=K>>>13,K&=8191,K+=G*B,K+=X*(5*w),K+=U*(5*y),K+=V*(5*u),K+=D*(5*$),ee+=K>>>13,K&=8191;var v=ee;v+=_*$,v+=P*de,v+=x*re,v+=T*N,v+=j*b,ee=v>>>13,v&=8191,v+=G*F,v+=X*B,v+=U*(5*w),v+=V*(5*y),v+=D*(5*u),ee+=v>>>13,v&=8191;var H=ee;H+=_*u,H+=P*$,H+=x*de,H+=T*re,H+=j*N,ee=H>>>13,H&=8191,H+=G*b,H+=X*F,H+=U*B,H+=V*(5*w),H+=D*(5*y),ee+=H>>>13,H&=8191;var oe=ee;oe+=_*y,oe+=P*u,oe+=x*$,oe+=T*de,oe+=j*re,ee=oe>>>13,oe&=8191,oe+=G*N,oe+=X*b,oe+=U*F,oe+=V*B,oe+=D*(5*w),ee+=oe>>>13,oe&=8191;var le=ee;le+=_*w,le+=P*y,le+=x*u,le+=T*$,le+=j*de,ee=le>>>13,le&=8191,le+=G*re,le+=X*N,le+=U*b,le+=V*F,le+=D*B,ee+=le>>>13,le&=8191,ee=(ee<<2)+ee|0,ee=ee+fe|0,fe=ee&8191,ee=ee>>>13,pe+=ee,_=fe,P=pe,x=he,T=W,j=Q,G=K,X=v,U=H,V=oe,D=le,p+=16,l-=16}this._h[0]=_,this._h[1]=P,this._h[2]=x,this._h[3]=T,this._h[4]=j,this._h[5]=G,this._h[6]=X,this._h[7]=U,this._h[8]=V,this._h[9]=D},f.prototype.finish=function(h,p){p===void 0&&(p=0);var l=new Uint16Array(10),m,_,P,x;if(this._leftover){for(x=this._leftover,this._buffer[x++]=1;x<16;x++)this._buffer[x]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,x=2;x<10;x++)this._h[x]+=m,m=this._h[x]>>>13,this._h[x]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,l[0]=this._h[0]+5,m=l[0]>>>13,l[0]&=8191,x=1;x<10;x++)l[x]=this._h[x]+m,m=l[x]>>>13,l[x]&=8191;for(l[9]-=8192,_=(m^1)-1,x=0;x<10;x++)l[x]&=_;for(_=~_,x=0;x<10;x++)this._h[x]=this._h[x]&_|l[x];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,P=this._h[0]+this._pad[0],this._h[0]=P&65535,x=1;x<8;x++)P=(this._h[x]+this._pad[x]|0)+(P>>>16)|0,this._h[x]=P&65535;return h[p+0]=this._h[0]>>>0,h[p+1]=this._h[0]>>>8,h[p+2]=this._h[1]>>>0,h[p+3]=this._h[1]>>>8,h[p+4]=this._h[2]>>>0,h[p+5]=this._h[2]>>>8,h[p+6]=this._h[3]>>>0,h[p+7]=this._h[3]>>>8,h[p+8]=this._h[4]>>>0,h[p+9]=this._h[4]>>>8,h[p+10]=this._h[5]>>>0,h[p+11]=this._h[5]>>>8,h[p+12]=this._h[6]>>>0,h[p+13]=this._h[6]>>>8,h[p+14]=this._h[7]>>>0,h[p+15]=this._h[7]>>>8,this._finished=!0,this},f.prototype.update=function(h){var p=0,l=h.length,m;if(this._leftover){m=16-this._leftover,m>l&&(m=l);for(var _=0;_<m;_++)this._buffer[this._leftover+_]=h[p+_];if(l-=m,p+=m,this._leftover+=m,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(l>=16&&(m=l-l%16,this._blocks(h,p,m),p+=m,l-=m),l){for(var _=0;_<l;_++)this._buffer[this._leftover+_]=h[p+_];this._leftover+=l}return this},f.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var h=new Uint8Array(16);return this.finish(h),h},f.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},f}();r.Poly1305=i;function s(f,h){var p=new i(f);p.update(h);var l=p.digest();return p.clean(),l}r.oneTimeAuth=s;function o(f,h){return f.length!==r.DIGEST_LENGTH||h.length!==r.DIGEST_LENGTH?!1:e.equal(f,h)}r.equal=o})(ng);(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Nc,t=ng,i=Wr,s=et,o=In;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var f=new Uint8Array(16),h=function(){function p(l){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,l.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(l)}return p.prototype.seal=function(l,m,_,P){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var x=new Uint8Array(16);x.set(l,x.length-l.length);var T=new Uint8Array(32);e.stream(this._key,x,T,4);var j=m.length+this.tagLength,G;if(P){if(P.length!==j)throw new Error("ChaCha20Poly1305: incorrect destination length");G=P}else G=new Uint8Array(j);return e.streamXOR(this._key,x,m,G,4),this._authenticate(G.subarray(G.length-this.tagLength,G.length),T,G.subarray(0,G.length-this.tagLength),_),i.wipe(x),G},p.prototype.open=function(l,m,_,P){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length<this.tagLength)return null;var x=new Uint8Array(16);x.set(l,x.length-l.length);var T=new Uint8Array(32);e.stream(this._key,x,T,4);var j=new Uint8Array(this.tagLength);if(this._authenticate(j,T,m.subarray(0,m.length-this.tagLength),_),!o.equal(j,m.subarray(m.length-this.tagLength,m.length)))return null;var G=m.length-this.tagLength,X;if(P){if(P.length!==G)throw new Error("ChaCha20Poly1305: incorrect destination length");X=P}else X=new Uint8Array(G);return e.streamXOR(this._key,x,m.subarray(0,m.length-this.tagLength),X,4),i.wipe(x),X},p.prototype.clean=function(){return i.wipe(this._key),this},p.prototype._authenticate=function(l,m,_,P){var x=new t.Poly1305(m);P&&(x.update(P),P.length%16>0&&x.update(f.subarray(P.length%16))),x.update(_),_.length%16>0&&x.update(f.subarray(_.length%16));var T=new Uint8Array(8);P&&s.writeUint64LE(P.length,T),x.update(T),s.writeUint64LE(_.length,T),x.update(T);for(var j=x.digest(),G=0;G<j.length;G++)l[G]=j[G];x.clean(),i.wipe(j),i.wipe(T)},p}();r.ChaCha20Poly1305=h})(uu);var ag={},Fa={},lu={};Object.defineProperty(lu,"__esModule",{value:!0});function H_(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}lu.isSerializableHash=H_;Object.defineProperty(Fa,"__esModule",{value:!0});var Ni=lu,K_=In,j_=Wr,og=function(){function r(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var s=0;s<i.length;s++)i[s]^=54;this._inner.update(i);for(var s=0;s<i.length;s++)i[s]^=106;this._outer.update(i),Ni.isSerializableHash(this._inner)&&Ni.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),j_.wipe(i)}return r.prototype.reset=function(){if(!Ni.isSerializableHash(this._inner)||!Ni.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.clean=function(){Ni.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ni.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},r.prototype.update=function(e){return this._inner.update(e),this},r.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(!Ni.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},r.prototype.restoreState=function(e){if(!Ni.isSerializableHash(this._inner)||!Ni.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.cleanSavedState=function(e){if(!Ni.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},r}();Fa.HMAC=og;function k_(r,e,t){var i=new og(r,e);i.update(t);var s=i.digest();return i.clean(),s}Fa.hmac=k_;Fa.equal=K_.equal;Object.defineProperty(ag,"__esModule",{value:!0});var Vd=Fa,Yd=Wr,W_=function(){function r(e,t,i,s){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=s;var o=Vd.hmac(this._hash,i,t);this._hmac=new Vd.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},r.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i<t.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[i]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),Yd.wipe(this._buffer),Yd.wipe(this._counter),this._bufpos=0},r}(),G_=ag.HKDF=W_,xn={},$c={},Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.BrowserRandomSource=void 0;const Jd=65536;class V_{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let i=0;i<t.length;i+=Jd)this._crypto.getRandomValues(t.subarray(i,i+Math.min(t.length-i,Jd)));return t}}Lc.BrowserRandomSource=V_;var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.NodeRandomSource=void 0;const Y_=Wr;class J_{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof e2<"u"){const e=t2();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(e);for(let s=0;s<i.length;s++)i[s]=t[s];return(0,Y_.wipe)(t),i}}Dc.NodeRandomSource=J_;Object.defineProperty($c,"__esModule",{value:!0});$c.SystemRandomSource=void 0;const X_=Lc,Z_=Dc;class Q_{constructor(){if(this.isAvailable=!1,this.name="",this._source=new X_.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Z_.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}$c.SystemRandomSource=Q_;(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=$c,t=et,i=Wr;r.defaultRandomSource=new e.SystemRandomSource;function s(l,m=r.defaultRandomSource){return m.randomBytes(l)}r.randomBytes=s;function o(l=r.defaultRandomSource){const m=s(4,l),_=(0,t.readUint32LE)(m);return(0,i.wipe)(m),_}r.randomUint32=o;const f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function h(l,m=f,_=r.defaultRandomSource){if(m.length<2)throw new Error("randomString charset is too short");if(m.length>256)throw new Error("randomString charset is too long");let P="";const x=m.length,T=256-256%x;for(;l>0;){const j=s(Math.ceil(l*256/T),_);for(let G=0;G<j.length&&l>0;G++){const X=j[G];X<T&&(P+=m.charAt(X%x),l--)}(0,i.wipe)(j)}return P}r.randomString=h;function p(l,m=f,_=r.defaultRandomSource){const P=Math.ceil(l/(Math.log(m.length)/Math.LN2));return h(P,m,_)}r.randomStringForEntropy=p})(xn);var Ha={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=et,t=Wr;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var i=function(){function h(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return h.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},h.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},h.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},h.prototype.update=function(p,l){if(l===void 0&&(l=p.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var m=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&l>0;)this._buffer[this._bufferLength++]=p[m++],l--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(m=o(this._temp,this._state,p,m,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=p[m++],l--;return this},h.prototype.finish=function(p){if(!this._finished){var l=this._bytesHashed,m=this._bufferLength,_=l/536870912|0,P=l<<3,x=l%64<56?64:128;this._buffer[m]=128;for(var T=m+1;T<x-8;T++)this._buffer[T]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(P,this._buffer,x-4),o(this._temp,this._state,this._buffer,0,x),this._finished=!0}for(var T=0;T<this.digestLength/4;T++)e.writeUint32BE(this._state[T],p,T*4);return this},h.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},h.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},h.prototype.restoreState=function(p){return this._state.set(p.state),this._bufferLength=p.bufferLength,p.buffer&&this._buffer.set(p.buffer),this._bytesHashed=p.bytesHashed,this._finished=!1,this},h.prototype.cleanSavedState=function(p){t.wipe(p.state),p.buffer&&t.wipe(p.buffer),p.bufferLength=0,p.bytesHashed=0},h}();r.SHA256=i;var s=new Int32Array([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 o(h,p,l,m,_){for(;_>=64;){for(var P=p[0],x=p[1],T=p[2],j=p[3],G=p[4],X=p[5],U=p[6],V=p[7],D=0;D<16;D++){var B=m+D*4;h[D]=e.readUint32BE(l,B)}for(var D=16;D<64;D++){var F=h[D-2],b=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10;F=h[D-15];var N=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3;h[D]=(b+h[D-7]|0)+(N+h[D-16]|0)}for(var D=0;D<64;D++){var b=(((G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7))+(G&X^~G&U)|0)+(V+(s[D]+h[D]|0)|0)|0,N=((P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10))+(P&x^P&T^x&T)|0;V=U,U=X,X=G,G=j+b|0,j=T,T=x,x=P,P=b+N|0}p[0]+=P,p[1]+=x,p[2]+=T,p[3]+=j,p[4]+=G,p[5]+=X,p[6]+=U,p[7]+=V,m+=64,_-=64}return m}function f(h){var p=new i;p.update(h);var l=p.digest();return p.clean(),l}r.hash=f})(Ha);var du={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=xn,t=Wr;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i(D){const B=new Float64Array(16);if(D)for(let F=0;F<D.length;F++)B[F]=D[F];return B}const s=new Uint8Array(32);s[0]=9;const o=i([56129,1]);function f(D){let B=1;for(let F=0;F<16;F++){let b=D[F]+B+65535;B=Math.floor(b/65536),D[F]=b-B*65536}D[0]+=B-1+37*(B-1)}function h(D,B,F){const b=~(F-1);for(let N=0;N<16;N++){const re=b&(D[N]^B[N]);D[N]^=re,B[N]^=re}}function p(D,B){const F=i(),b=i();for(let N=0;N<16;N++)b[N]=B[N];f(b),f(b),f(b);for(let N=0;N<2;N++){F[0]=b[0]-65517;for(let de=1;de<15;de++)F[de]=b[de]-65535-(F[de-1]>>16&1),F[de-1]&=65535;F[15]=b[15]-32767-(F[14]>>16&1);const re=F[15]>>16&1;F[14]&=65535,h(b,F,1-re)}for(let N=0;N<16;N++)D[2*N]=b[N]&255,D[2*N+1]=b[N]>>8}function l(D,B){for(let F=0;F<16;F++)D[F]=B[2*F]+(B[2*F+1]<<8);D[15]&=32767}function m(D,B,F){for(let b=0;b<16;b++)D[b]=B[b]+F[b]}function _(D,B,F){for(let b=0;b<16;b++)D[b]=B[b]-F[b]}function P(D,B,F){let b,N,re=0,de=0,$=0,u=0,y=0,w=0,E=0,O=0,L=0,C=0,I=0,d=0,M=0,ne=0,ee=0,fe=0,pe=0,he=0,W=0,Q=0,K=0,v=0,H=0,oe=0,le=0,je=0,we=0,Pe=0,ut=0,Ne=0,ze=0,st=F[0],Me=F[1],me=F[2],Be=F[3],Ie=F[4],Ae=F[5],qe=F[6],xe=F[7],Se=F[8],Fe=F[9],Re=F[10],Ee=F[11],at=F[12],Te=F[13],Ce=F[14],lt=F[15];b=B[0],re+=b*st,de+=b*Me,$+=b*me,u+=b*Be,y+=b*Ie,w+=b*Ae,E+=b*qe,O+=b*xe,L+=b*Se,C+=b*Fe,I+=b*Re,d+=b*Ee,M+=b*at,ne+=b*Te,ee+=b*Ce,fe+=b*lt,b=B[1],de+=b*st,$+=b*Me,u+=b*me,y+=b*Be,w+=b*Ie,E+=b*Ae,O+=b*qe,L+=b*xe,C+=b*Se,I+=b*Fe,d+=b*Re,M+=b*Ee,ne+=b*at,ee+=b*Te,fe+=b*Ce,pe+=b*lt,b=B[2],$+=b*st,u+=b*Me,y+=b*me,w+=b*Be,E+=b*Ie,O+=b*Ae,L+=b*qe,C+=b*xe,I+=b*Se,d+=b*Fe,M+=b*Re,ne+=b*Ee,ee+=b*at,fe+=b*Te,pe+=b*Ce,he+=b*lt,b=B[3],u+=b*st,y+=b*Me,w+=b*me,E+=b*Be,O+=b*Ie,L+=b*Ae,C+=b*qe,I+=b*xe,d+=b*Se,M+=b*Fe,ne+=b*Re,ee+=b*Ee,fe+=b*at,pe+=b*Te,he+=b*Ce,W+=b*lt,b=B[4],y+=b*st,w+=b*Me,E+=b*me,O+=b*Be,L+=b*Ie,C+=b*Ae,I+=b*qe,d+=b*xe,M+=b*Se,ne+=b*Fe,ee+=b*Re,fe+=b*Ee,pe+=b*at,he+=b*Te,W+=b*Ce,Q+=b*lt,b=B[5],w+=b*st,E+=b*Me,O+=b*me,L+=b*Be,C+=b*Ie,I+=b*Ae,d+=b*qe,M+=b*xe,ne+=b*Se,ee+=b*Fe,fe+=b*Re,pe+=b*Ee,he+=b*at,W+=b*Te,Q+=b*Ce,K+=b*lt,b=B[6],E+=b*st,O+=b*Me,L+=b*me,C+=b*Be,I+=b*Ie,d+=b*Ae,M+=b*qe,ne+=b*xe,ee+=b*Se,fe+=b*Fe,pe+=b*Re,he+=b*Ee,W+=b*at,Q+=b*Te,K+=b*Ce,v+=b*lt,b=B[7],O+=b*st,L+=b*Me,C+=b*me,I+=b*Be,d+=b*Ie,M+=b*Ae,ne+=b*qe,ee+=b*xe,fe+=b*Se,pe+=b*Fe,he+=b*Re,W+=b*Ee,Q+=b*at,K+=b*Te,v+=b*Ce,H+=b*lt,b=B[8],L+=b*st,C+=b*Me,I+=b*me,d+=b*Be,M+=b*Ie,ne+=b*Ae,ee+=b*qe,fe+=b*xe,pe+=b*Se,he+=b*Fe,W+=b*Re,Q+=b*Ee,K+=b*at,v+=b*Te,H+=b*Ce,oe+=b*lt,b=B[9],C+=b*st,I+=b*Me,d+=b*me,M+=b*Be,ne+=b*Ie,ee+=b*Ae,fe+=b*qe,pe+=b*xe,he+=b*Se,W+=b*Fe,Q+=b*Re,K+=b*Ee,v+=b*at,H+=b*Te,oe+=b*Ce,le+=b*lt,b=B[10],I+=b*st,d+=b*Me,M+=b*me,ne+=b*Be,ee+=b*Ie,fe+=b*Ae,pe+=b*qe,he+=b*xe,W+=b*Se,Q+=b*Fe,K+=b*Re,v+=b*Ee,H+=b*at,oe+=b*Te,le+=b*Ce,je+=b*lt,b=B[11],d+=b*st,M+=b*Me,ne+=b*me,ee+=b*Be,fe+=b*Ie,pe+=b*Ae,he+=b*qe,W+=b*xe,Q+=b*Se,K+=b*Fe,v+=b*Re,H+=b*Ee,oe+=b*at,le+=b*Te,je+=b*Ce,we+=b*lt,b=B[12],M+=b*st,ne+=b*Me,ee+=b*me,fe+=b*Be,pe+=b*Ie,he+=b*Ae,W+=b*qe,Q+=b*xe,K+=b*Se,v+=b*Fe,H+=b*Re,oe+=b*Ee,le+=b*at,je+=b*Te,we+=b*Ce,Pe+=b*lt,b=B[13],ne+=b*st,ee+=b*Me,fe+=b*me,pe+=b*Be,he+=b*Ie,W+=b*Ae,Q+=b*qe,K+=b*xe,v+=b*Se,H+=b*Fe,oe+=b*Re,le+=b*Ee,je+=b*at,we+=b*Te,Pe+=b*Ce,ut+=b*lt,b=B[14],ee+=b*st,fe+=b*Me,pe+=b*me,he+=b*Be,W+=b*Ie,Q+=b*Ae,K+=b*qe,v+=b*xe,H+=b*Se,oe+=b*Fe,le+=b*Re,je+=b*Ee,we+=b*at,Pe+=b*Te,ut+=b*Ce,Ne+=b*lt,b=B[15],fe+=b*st,pe+=b*Me,he+=b*me,W+=b*Be,Q+=b*Ie,K+=b*Ae,v+=b*qe,H+=b*xe,oe+=b*Se,le+=b*Fe,je+=b*Re,we+=b*Ee,Pe+=b*at,ut+=b*Te,Ne+=b*Ce,ze+=b*lt,re+=38*pe,de+=38*he,$+=38*W,u+=38*Q,y+=38*K,w+=38*v,E+=38*H,O+=38*oe,L+=38*le,C+=38*je,I+=38*we,d+=38*Pe,M+=38*ut,ne+=38*Ne,ee+=38*ze,N=1,b=re+N+65535,N=Math.floor(b/65536),re=b-N*65536,b=de+N+65535,N=Math.floor(b/65536),de=b-N*65536,b=$+N+65535,N=Math.floor(b/65536),$=b-N*65536,b=u+N+65535,N=Math.floor(b/65536),u=b-N*65536,b=y+N+65535,N=Math.floor(b/65536),y=b-N*65536,b=w+N+65535,N=Math.floor(b/65536),w=b-N*65536,b=E+N+65535,N=Math.floor(b/65536),E=b-N*65536,b=O+N+65535,N=Math.floor(b/65536),O=b-N*65536,b=L+N+65535,N=Math.floor(b/65536),L=b-N*65536,b=C+N+65535,N=Math.floor(b/65536),C=b-N*65536,b=I+N+65535,N=Math.floor(b/65536),I=b-N*65536,b=d+N+65535,N=Math.floor(b/65536),d=b-N*65536,b=M+N+65535,N=Math.floor(b/65536),M=b-N*65536,b=ne+N+65535,N=Math.floor(b/65536),ne=b-N*65536,b=ee+N+65535,N=Math.floor(b/65536),ee=b-N*65536,b=fe+N+65535,N=Math.floor(b/65536),fe=b-N*65536,re+=N-1+37*(N-1),N=1,b=re+N+65535,N=Math.floor(b/65536),re=b-N*65536,b=de+N+65535,N=Math.floor(b/65536),de=b-N*65536,b=$+N+65535,N=Math.floor(b/65536),$=b-N*65536,b=u+N+65535,N=Math.floor(b/65536),u=b-N*65536,b=y+N+65535,N=Math.floor(b/65536),y=b-N*65536,b=w+N+65535,N=Math.floor(b/65536),w=b-N*65536,b=E+N+65535,N=Math.floor(b/65536),E=b-N*65536,b=O+N+65535,N=Math.floor(b/65536),O=b-N*65536,b=L+N+65535,N=Math.floor(b/65536),L=b-N*65536,b=C+N+65535,N=Math.floor(b/65536),C=b-N*65536,b=I+N+65535,N=Math.floor(b/65536),I=b-N*65536,b=d+N+65535,N=Math.floor(b/65536),d=b-N*65536,b=M+N+65535,N=Math.floor(b/65536),M=b-N*65536,b=ne+N+65535,N=Math.floor(b/65536),ne=b-N*65536,b=ee+N+65535,N=Math.floor(b/65536),ee=b-N*65536,b=fe+N+65535,N=Math.floor(b/65536),fe=b-N*65536,re+=N-1+37*(N-1),D[0]=re,D[1]=de,D[2]=$,D[3]=u,D[4]=y,D[5]=w,D[6]=E,D[7]=O,D[8]=L,D[9]=C,D[10]=I,D[11]=d,D[12]=M,D[13]=ne,D[14]=ee,D[15]=fe}function x(D,B){P(D,B,B)}function T(D,B){const F=i();for(let b=0;b<16;b++)F[b]=B[b];for(let b=253;b>=0;b--)x(F,F),b!==2&&b!==4&&P(F,F,B);for(let b=0;b<16;b++)D[b]=F[b]}function j(D,B){const F=new Uint8Array(32),b=new Float64Array(80),N=i(),re=i(),de=i(),$=i(),u=i(),y=i();for(let L=0;L<31;L++)F[L]=D[L];F[31]=D[31]&127|64,F[0]&=248,l(b,B);for(let L=0;L<16;L++)re[L]=b[L];N[0]=$[0]=1;for(let L=254;L>=0;--L){const C=F[L>>>3]>>>(L&7)&1;h(N,re,C),h(de,$,C),m(u,N,de),_(N,N,de),m(de,re,$),_(re,re,$),x($,u),x(y,N),P(N,de,N),P(de,re,u),m(u,N,de),_(N,N,de),x(re,N),_(de,$,y),P(N,de,o),m(N,N,$),P(de,de,N),P(N,$,y),P($,re,b),x(re,u),h(N,re,C),h(de,$,C)}for(let L=0;L<16;L++)b[L+16]=N[L],b[L+32]=de[L],b[L+48]=re[L],b[L+64]=$[L];const w=b.subarray(32),E=b.subarray(16);T(w,w),P(E,E,w);const O=new Uint8Array(32);return p(O,E),O}r.scalarMult=j;function G(D){return j(D,s)}r.scalarMultBase=G;function X(D){if(D.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const B=new Uint8Array(D);return{publicKey:G(B),secretKey:B}}r.generateKeyPairFromSeed=X;function U(D){const B=(0,e.randomBytes)(32,D),F=X(B);return(0,t.wipe)(B),F}r.generateKeyPair=U;function V(D,B,F=!1){if(D.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(B.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const b=j(D,B);if(F){let N=0;for(let re=0;re<b.length;re++)N|=b[re];if(N===0)throw new Error("X25519: invalid shared key")}return b}r.sharedKey=V})(du);function cg(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function gh(r,e){e||(e=r.reduce((s,o)=>s+o.length,0));const t=cg(e);let i=0;for(const s of r)t.set(s,i),i+=s.length;return t}function fg(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const Xd=fg("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),bh=fg("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=cg(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),hg={utf8:Xd,"utf-8":Xd,hex:gc.base16,latin1:bh,ascii:bh,binary:bh,...gc};function si(r,e="utf8"){const t=hg[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):t.decoder.decode(`${t.prefix}${r}`)}function kr(r,e="utf8"){const t=hg[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var ug={};const e3="elliptic",t3="6.5.7",r3="EC cryptography",i3="lib/elliptic.js",n3=["lib"],s3={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},a3={type:"git",url:"git@github.com:indutny/elliptic"},o3=["EC","Elliptic","curve","Cryptography"],c3="Fedor Indutny <fedor@indutny.com>",f3="MIT",h3={url:"https://github.com/indutny/elliptic/issues"},u3="https://github.com/indutny/elliptic",l3={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},d3={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},p3={name:e3,version:t3,description:r3,main:i3,files:n3,scripts:s3,repository:a3,keywords:o3,author:c3,license:f3,bugs:h3,homepage:u3,devDependencies:l3,dependencies:d3};var Gr={},pu={exports:{}};pu.exports;(function(r){(function(e,t){function i($,u){if(!$)throw new Error(u||"Assertion failed")}function s($,u){$.super_=u;var y=function(){};y.prototype=u.prototype,$.prototype=new y,$.prototype.constructor=$}function o($,u,y){if(o.isBN($))return $;this.negative=0,this.words=null,this.length=0,this.red=null,$!==null&&((u==="le"||u==="be")&&(y=u,u=10),this._init($||0,u||10,y||"be"))}typeof e=="object"?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=r2.Buffer}catch{}o.isBN=function(u){return u instanceof o?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===o.wordSize&&Array.isArray(u.words)},o.max=function(u,y){return u.cmp(y)>0?u:y},o.min=function(u,y){return u.cmp(y)<0?u:y},o.prototype._init=function(u,y,w){if(typeof u=="number")return this._initNumber(u,y,w);if(typeof u=="object")return this._initArray(u,y,w);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),u=u.toString().replace(/\s+/g,"");var E=0;u[0]==="-"&&(E++,this.negative=1),E<u.length&&(y===16?this._parseHex(u,E,w):(this._parseBase(u,y,E),w==="le"&&this._initArray(this.toArray(),y,w)))},o.prototype._initNumber=function(u,y,w){u<0&&(this.negative=1,u=-u),u<67108864?(this.words=[u&67108863],this.length=1):u<4503599627370496?(this.words=[u&67108863,u/67108864&67108863],this.length=2):(i(u<9007199254740992),this.words=[u&67108863,u/67108864&67108863,1],this.length=3),w==="le"&&this._initArray(this.toArray(),y,w)},o.prototype._initArray=function(u,y,w){if(i(typeof u.length=="number"),u.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(u.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var O,L,C=0;if(w==="be")for(E=u.length-1,O=0;E>=0;E-=3)L=u[E]|u[E-1]<<8|u[E-2]<<16,this.words[O]|=L<<C&67108863,this.words[O+1]=L>>>26-C&67108863,C+=24,C>=26&&(C-=26,O++);else if(w==="le")for(E=0,O=0;E<u.length;E+=3)L=u[E]|u[E+1]<<8|u[E+2]<<16,this.words[O]|=L<<C&67108863,this.words[O+1]=L>>>26-C&67108863,C+=24,C>=26&&(C-=26,O++);return this.strip()};function h($,u){var y=$.charCodeAt(u);return y>=65&&y<=70?y-55:y>=97&&y<=102?y-87:y-48&15}function p($,u,y){var w=h($,y);return y-1>=u&&(w|=h($,y-1)<<4),w}o.prototype._parseHex=function(u,y,w){this.length=Math.ceil((u.length-y)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var O=0,L=0,C;if(w==="be")for(E=u.length-1;E>=y;E-=2)C=p(u,y,E)<<O,this.words[L]|=C&67108863,O>=18?(O-=18,L+=1,this.words[L]|=C>>>26):O+=8;else{var I=u.length-y;for(E=I%2===0?y+1:y;E<u.length;E+=2)C=p(u,y,E)<<O,this.words[L]|=C&67108863,O>=18?(O-=18,L+=1,this.words[L]|=C>>>26):O+=8}this.strip()};function l($,u,y,w){for(var E=0,O=Math.min($.length,y),L=u;L<O;L++){var C=$.charCodeAt(L)-48;E*=w,C>=49?E+=C-49+10:C>=17?E+=C-17+10:E+=C}return E}o.prototype._parseBase=function(u,y,w){this.words=[0],this.length=1;for(var E=0,O=1;O<=67108863;O*=y)E++;E--,O=O/y|0;for(var L=u.length-w,C=L%E,I=Math.min(L,L-C)+w,d=0,M=w;M<I;M+=E)d=l(u,M,M+E,y),this.imuln(O),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var ne=1;for(d=l(u,M,u.length,y),M=0;M<C;M++)ne*=y;this.imuln(ne),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},o.prototype.copy=function(u){u.words=new Array(this.length);for(var y=0;y<this.length;y++)u.words[y]=this.words[y];u.length=this.length,u.negative=this.negative,u.red=this.red},o.prototype.clone=function(){var u=new o(null);return this.copy(u),u},o.prototype._expand=function(u){for(;this.length<u;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var m=["","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"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(u,y){u=u||10,y=y|0||1;var w;if(u===16||u==="hex"){w="";for(var E=0,O=0,L=0;L<this.length;L++){var C=this.words[L],I=((C<<E|O)&16777215).toString(16);O=C>>>24-E&16777215,O!==0||L!==this.length-1?w=m[6-I.length]+I+w:w=I+w,E+=2,E>=26&&(E-=26,L--)}for(O!==0&&(w=O.toString(16)+w);w.length%y!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(u===(u|0)&&u>=2&&u<=36){var d=_[u],M=P[u];w="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var ee=ne.modn(M).toString(u);ne=ne.idivn(M),ne.isZero()?w=ee+w:w=m[d-ee.length]+ee+w}for(this.isZero()&&(w="0"+w);w.length%y!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(u,y){return i(typeof f<"u"),this.toArrayLike(f,u,y)},o.prototype.toArray=function(u,y){return this.toArrayLike(Array,u,y)},o.prototype.toArrayLike=function(u,y,w){var E=this.byteLength(),O=w||Math.max(1,E);i(E<=O,"byte array longer than desired length"),i(O>0,"Requested array length <= 0"),this.strip();var L=y==="le",C=new u(O),I,d,M=this.clone();if(L){for(d=0;!M.isZero();d++)I=M.andln(255),M.iushrn(8),C[d]=I;for(;d<O;d++)C[d]=0}else{for(d=0;d<O-E;d++)C[d]=0;for(d=0;!M.isZero();d++)I=M.andln(255),M.iushrn(8),C[O-d-1]=I}return C},Math.clz32?o.prototype._countBits=function(u){return 32-Math.clz32(u)}:o.prototype._countBits=function(u){var y=u,w=0;return y>=4096&&(w+=13,y>>>=13),y>=64&&(w+=7,y>>>=7),y>=8&&(w+=4,y>>>=4),y>=2&&(w+=2,y>>>=2),w+y},o.prototype._zeroBits=function(u){if(u===0)return 26;var y=u,w=0;return y&8191||(w+=13,y>>>=13),y&127||(w+=7,y>>>=7),y&15||(w+=4,y>>>=4),y&3||(w+=2,y>>>=2),y&1||w++,w},o.prototype.bitLength=function(){var u=this.words[this.length-1],y=this._countBits(u);return(this.length-1)*26+y};function x($){for(var u=new Array($.bitLength()),y=0;y<u.length;y++){var w=y/26|0,E=y%26;u[y]=($.words[w]&1<<E)>>>E}return u}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,y=0;y<this.length;y++){var w=this._zeroBits(this.words[y]);if(u+=w,w!==26)break}return u},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(u){return this.negative!==0?this.abs().inotn(u).iaddn(1):this.clone()},o.prototype.fromTwos=function(u){return this.testn(u-1)?this.notn(u).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(u){for(;this.length<u.length;)this.words[this.length++]=0;for(var y=0;y<u.length;y++)this.words[y]=this.words[y]|u.words[y];return this.strip()},o.prototype.ior=function(u){return i((this.negative|u.negative)===0),this.iuor(u)},o.prototype.or=function(u){return this.length>u.length?this.clone().ior(u):u.clone().ior(this)},o.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},o.prototype.iuand=function(u){var y;this.length>u.length?y=u:y=this;for(var w=0;w<y.length;w++)this.words[w]=this.words[w]&u.words[w];return this.length=y.length,this.strip()},o.prototype.iand=function(u){return i((this.negative|u.negative)===0),this.iuand(u)},o.prototype.and=function(u){return this.length>u.length?this.clone().iand(u):u.clone().iand(this)},o.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},o.prototype.iuxor=function(u){var y,w;this.length>u.length?(y=this,w=u):(y=u,w=this);for(var E=0;E<w.length;E++)this.words[E]=y.words[E]^w.words[E];if(this!==y)for(;E<y.length;E++)this.words[E]=y.words[E];return this.length=y.length,this.strip()},o.prototype.ixor=function(u){return i((this.negative|u.negative)===0),this.iuxor(u)},o.prototype.xor=function(u){return this.length>u.length?this.clone().ixor(u):u.clone().ixor(this)},o.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},o.prototype.inotn=function(u){i(typeof u=="number"&&u>=0);var y=Math.ceil(u/26)|0,w=u%26;this._expand(y),w>0&&y--;for(var E=0;E<y;E++)this.words[E]=~this.words[E]&67108863;return w>0&&(this.words[E]=~this.words[E]&67108863>>26-w),this.strip()},o.prototype.notn=function(u){return this.clone().inotn(u)},o.prototype.setn=function(u,y){i(typeof u=="number"&&u>=0);var w=u/26|0,E=u%26;return this._expand(w+1),y?this.words[w]=this.words[w]|1<<E:this.words[w]=this.words[w]&~(1<<E),this.strip()},o.prototype.iadd=function(u){var y;if(this.negative!==0&&u.negative===0)return this.negative=0,y=this.isub(u),this.negative^=1,this._normSign();if(this.negative===0&&u.negative!==0)return u.negative=0,y=this.isub(u),u.negative=1,y._normSign();var w,E;this.length>u.length?(w=this,E=u):(w=u,E=this);for(var O=0,L=0;L<E.length;L++)y=(w.words[L]|0)+(E.words[L]|0)+O,this.words[L]=y&67108863,O=y>>>26;for(;O!==0&&L<w.length;L++)y=(w.words[L]|0)+O,this.words[L]=y&67108863,O=y>>>26;if(this.length=w.length,O!==0)this.words[this.length]=O,this.length++;else if(w!==this)for(;L<w.length;L++)this.words[L]=w.words[L];return this},o.prototype.add=function(u){var y;return u.negative!==0&&this.negative===0?(u.negative=0,y=this.sub(u),u.negative^=1,y):u.negative===0&&this.negative!==0?(this.negative=0,y=u.sub(this),this.negative=1,y):this.length>u.length?this.clone().iadd(u):u.clone().iadd(this)},o.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var y=this.iadd(u);return u.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var w=this.cmp(u);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,O;w>0?(E=this,O=u):(E=u,O=this);for(var L=0,C=0;C<O.length;C++)y=(E.words[C]|0)-(O.words[C]|0)+L,L=y>>26,this.words[C]=y&67108863;for(;L!==0&&C<E.length;C++)y=(E.words[C]|0)+L,L=y>>26,this.words[C]=y&67108863;if(L===0&&C<E.length&&E!==this)for(;C<E.length;C++)this.words[C]=E.words[C];return this.length=Math.max(this.length,C),E!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(u){return this.clone().isub(u)};function T($,u,y){y.negative=u.negative^$.negative;var w=$.length+u.length|0;y.length=w,w=w-1|0;var E=$.words[0]|0,O=u.words[0]|0,L=E*O,C=L&67108863,I=L/67108864|0;y.words[0]=C;for(var d=1;d<w;d++){for(var M=I>>>26,ne=I&67108863,ee=Math.min(d,u.length-1),fe=Math.max(0,d-$.length+1);fe<=ee;fe++){var pe=d-fe|0;E=$.words[pe]|0,O=u.words[fe]|0,L=E*O+ne,M+=L/67108864|0,ne=L&67108863}y.words[d]=ne|0,I=M|0}return I!==0?y.words[d]=I|0:y.length--,y.strip()}var j=function(u,y,w){var E=u.words,O=y.words,L=w.words,C=0,I,d,M,ne=E[0]|0,ee=ne&8191,fe=ne>>>13,pe=E[1]|0,he=pe&8191,W=pe>>>13,Q=E[2]|0,K=Q&8191,v=Q>>>13,H=E[3]|0,oe=H&8191,le=H>>>13,je=E[4]|0,we=je&8191,Pe=je>>>13,ut=E[5]|0,Ne=ut&8191,ze=ut>>>13,st=E[6]|0,Me=st&8191,me=st>>>13,Be=E[7]|0,Ie=Be&8191,Ae=Be>>>13,qe=E[8]|0,xe=qe&8191,Se=qe>>>13,Fe=E[9]|0,Re=Fe&8191,Ee=Fe>>>13,at=O[0]|0,Te=at&8191,Ce=at>>>13,lt=O[1]|0,ct=lt&8191,pt=lt>>>13,dr=O[2]|0,yt=dr&8191,gt=dr>>>13,ui=O[3]|0,It=ui&8191,Ze=ui>>>13,Nt=O[4]|0,He=Nt&8191,Ge=Nt>>>13,$t=O[5]|0,ke=$t&8191,Ke=$t>>>13,Ft=O[6]|0,tt=Ft&8191,Ve=Ft>>>13,Ht=O[7]|0,Ye=Ht&8191,Qe=Ht>>>13,Lt=O[8]|0,Ue=Lt&8191,rt=Lt>>>13,bs=O[9]|0,Ut=bs&8191,zt=bs>>>13;w.negative=u.negative^y.negative,w.length=19,I=Math.imul(ee,Te),d=Math.imul(ee,Ce),d=d+Math.imul(fe,Te)|0,M=Math.imul(fe,Ce);var Mn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,I=Math.imul(he,Te),d=Math.imul(he,Ce),d=d+Math.imul(W,Te)|0,M=Math.imul(W,Ce),I=I+Math.imul(ee,ct)|0,d=d+Math.imul(ee,pt)|0,d=d+Math.imul(fe,ct)|0,M=M+Math.imul(fe,pt)|0;var pr=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(pr>>>26)|0,pr&=67108863,I=Math.imul(K,Te),d=Math.imul(K,Ce),d=d+Math.imul(v,Te)|0,M=Math.imul(v,Ce),I=I+Math.imul(he,ct)|0,d=d+Math.imul(he,pt)|0,d=d+Math.imul(W,ct)|0,M=M+Math.imul(W,pt)|0,I=I+Math.imul(ee,yt)|0,d=d+Math.imul(ee,gt)|0,d=d+Math.imul(fe,yt)|0,M=M+Math.imul(fe,gt)|0;var An=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(An>>>26)|0,An&=67108863,I=Math.imul(oe,Te),d=Math.imul(oe,Ce),d=d+Math.imul(le,Te)|0,M=Math.imul(le,Ce),I=I+Math.imul(K,ct)|0,d=d+Math.imul(K,pt)|0,d=d+Math.imul(v,ct)|0,M=M+Math.imul(v,pt)|0,I=I+Math.imul(he,yt)|0,d=d+Math.imul(he,gt)|0,d=d+Math.imul(W,yt)|0,M=M+Math.imul(W,gt)|0,I=I+Math.imul(ee,It)|0,d=d+Math.imul(ee,Ze)|0,d=d+Math.imul(fe,It)|0,M=M+Math.imul(fe,Ze)|0;var On=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(On>>>26)|0,On&=67108863,I=Math.imul(we,Te),d=Math.imul(we,Ce),d=d+Math.imul(Pe,Te)|0,M=Math.imul(Pe,Ce),I=I+Math.imul(oe,ct)|0,d=d+Math.imul(oe,pt)|0,d=d+Math.imul(le,ct)|0,M=M+Math.imul(le,pt)|0,I=I+Math.imul(K,yt)|0,d=d+Math.imul(K,gt)|0,d=d+Math.imul(v,yt)|0,M=M+Math.imul(v,gt)|0,I=I+Math.imul(he,It)|0,d=d+Math.imul(he,Ze)|0,d=d+Math.imul(W,It)|0,M=M+Math.imul(W,Ze)|0,I=I+Math.imul(ee,He)|0,d=d+Math.imul(ee,Ge)|0,d=d+Math.imul(fe,He)|0,M=M+Math.imul(fe,Ge)|0;var Rn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,I=Math.imul(Ne,Te),d=Math.imul(Ne,Ce),d=d+Math.imul(ze,Te)|0,M=Math.imul(ze,Ce),I=I+Math.imul(we,ct)|0,d=d+Math.imul(we,pt)|0,d=d+Math.imul(Pe,ct)|0,M=M+Math.imul(Pe,pt)|0,I=I+Math.imul(oe,yt)|0,d=d+Math.imul(oe,gt)|0,d=d+Math.imul(le,yt)|0,M=M+Math.imul(le,gt)|0,I=I+Math.imul(K,It)|0,d=d+Math.imul(K,Ze)|0,d=d+Math.imul(v,It)|0,M=M+Math.imul(v,Ze)|0,I=I+Math.imul(he,He)|0,d=d+Math.imul(he,Ge)|0,d=d+Math.imul(W,He)|0,M=M+Math.imul(W,Ge)|0,I=I+Math.imul(ee,ke)|0,d=d+Math.imul(ee,Ke)|0,d=d+Math.imul(fe,ke)|0,M=M+Math.imul(fe,Ke)|0;var Tn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,I=Math.imul(Me,Te),d=Math.imul(Me,Ce),d=d+Math.imul(me,Te)|0,M=Math.imul(me,Ce),I=I+Math.imul(Ne,ct)|0,d=d+Math.imul(Ne,pt)|0,d=d+Math.imul(ze,ct)|0,M=M+Math.imul(ze,pt)|0,I=I+Math.imul(we,yt)|0,d=d+Math.imul(we,gt)|0,d=d+Math.imul(Pe,yt)|0,M=M+Math.imul(Pe,gt)|0,I=I+Math.imul(oe,It)|0,d=d+Math.imul(oe,Ze)|0,d=d+Math.imul(le,It)|0,M=M+Math.imul(le,Ze)|0,I=I+Math.imul(K,He)|0,d=d+Math.imul(K,Ge)|0,d=d+Math.imul(v,He)|0,M=M+Math.imul(v,Ge)|0,I=I+Math.imul(he,ke)|0,d=d+Math.imul(he,Ke)|0,d=d+Math.imul(W,ke)|0,M=M+Math.imul(W,Ke)|0,I=I+Math.imul(ee,tt)|0,d=d+Math.imul(ee,Ve)|0,d=d+Math.imul(fe,tt)|0,M=M+Math.imul(fe,Ve)|0;var Cn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,I=Math.imul(Ie,Te),d=Math.imul(Ie,Ce),d=d+Math.imul(Ae,Te)|0,M=Math.imul(Ae,Ce),I=I+Math.imul(Me,ct)|0,d=d+Math.imul(Me,pt)|0,d=d+Math.imul(me,ct)|0,M=M+Math.imul(me,pt)|0,I=I+Math.imul(Ne,yt)|0,d=d+Math.imul(Ne,gt)|0,d=d+Math.imul(ze,yt)|0,M=M+Math.imul(ze,gt)|0,I=I+Math.imul(we,It)|0,d=d+Math.imul(we,Ze)|0,d=d+Math.imul(Pe,It)|0,M=M+Math.imul(Pe,Ze)|0,I=I+Math.imul(oe,He)|0,d=d+Math.imul(oe,Ge)|0,d=d+Math.imul(le,He)|0,M=M+Math.imul(le,Ge)|0,I=I+Math.imul(K,ke)|0,d=d+Math.imul(K,Ke)|0,d=d+Math.imul(v,ke)|0,M=M+Math.imul(v,Ke)|0,I=I+Math.imul(he,tt)|0,d=d+Math.imul(he,Ve)|0,d=d+Math.imul(W,tt)|0,M=M+Math.imul(W,Ve)|0,I=I+Math.imul(ee,Ye)|0,d=d+Math.imul(ee,Qe)|0,d=d+Math.imul(fe,Ye)|0,M=M+Math.imul(fe,Qe)|0;var qr=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(qr>>>26)|0,qr&=67108863,I=Math.imul(xe,Te),d=Math.imul(xe,Ce),d=d+Math.imul(Se,Te)|0,M=Math.imul(Se,Ce),I=I+Math.imul(Ie,ct)|0,d=d+Math.imul(Ie,pt)|0,d=d+Math.imul(Ae,ct)|0,M=M+Math.imul(Ae,pt)|0,I=I+Math.imul(Me,yt)|0,d=d+Math.imul(Me,gt)|0,d=d+Math.imul(me,yt)|0,M=M+Math.imul(me,gt)|0,I=I+Math.imul(Ne,It)|0,d=d+Math.imul(Ne,Ze)|0,d=d+Math.imul(ze,It)|0,M=M+Math.imul(ze,Ze)|0,I=I+Math.imul(we,He)|0,d=d+Math.imul(we,Ge)|0,d=d+Math.imul(Pe,He)|0,M=M+Math.imul(Pe,Ge)|0,I=I+Math.imul(oe,ke)|0,d=d+Math.imul(oe,Ke)|0,d=d+Math.imul(le,ke)|0,M=M+Math.imul(le,Ke)|0,I=I+Math.imul(K,tt)|0,d=d+Math.imul(K,Ve)|0,d=d+Math.imul(v,tt)|0,M=M+Math.imul(v,Ve)|0,I=I+Math.imul(he,Ye)|0,d=d+Math.imul(he,Qe)|0,d=d+Math.imul(W,Ye)|0,M=M+Math.imul(W,Qe)|0,I=I+Math.imul(ee,Ue)|0,d=d+Math.imul(ee,rt)|0,d=d+Math.imul(fe,Ue)|0,M=M+Math.imul(fe,rt)|0;var xi=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(xi>>>26)|0,xi&=67108863,I=Math.imul(Re,Te),d=Math.imul(Re,Ce),d=d+Math.imul(Ee,Te)|0,M=Math.imul(Ee,Ce),I=I+Math.imul(xe,ct)|0,d=d+Math.imul(xe,pt)|0,d=d+Math.imul(Se,ct)|0,M=M+Math.imul(Se,pt)|0,I=I+Math.imul(Ie,yt)|0,d=d+Math.imul(Ie,gt)|0,d=d+Math.imul(Ae,yt)|0,M=M+Math.imul(Ae,gt)|0,I=I+Math.imul(Me,It)|0,d=d+Math.imul(Me,Ze)|0,d=d+Math.imul(me,It)|0,M=M+Math.imul(me,Ze)|0,I=I+Math.imul(Ne,He)|0,d=d+Math.imul(Ne,Ge)|0,d=d+Math.imul(ze,He)|0,M=M+Math.imul(ze,Ge)|0,I=I+Math.imul(we,ke)|0,d=d+Math.imul(we,Ke)|0,d=d+Math.imul(Pe,ke)|0,M=M+Math.imul(Pe,Ke)|0,I=I+Math.imul(oe,tt)|0,d=d+Math.imul(oe,Ve)|0,d=d+Math.imul(le,tt)|0,M=M+Math.imul(le,Ve)|0,I=I+Math.imul(K,Ye)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(v,Ye)|0,M=M+Math.imul(v,Qe)|0,I=I+Math.imul(he,Ue)|0,d=d+Math.imul(he,rt)|0,d=d+Math.imul(W,Ue)|0,M=M+Math.imul(W,rt)|0,I=I+Math.imul(ee,Ut)|0,d=d+Math.imul(ee,zt)|0,d=d+Math.imul(fe,Ut)|0,M=M+Math.imul(fe,zt)|0;var Nn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,I=Math.imul(Re,ct),d=Math.imul(Re,pt),d=d+Math.imul(Ee,ct)|0,M=Math.imul(Ee,pt),I=I+Math.imul(xe,yt)|0,d=d+Math.imul(xe,gt)|0,d=d+Math.imul(Se,yt)|0,M=M+Math.imul(Se,gt)|0,I=I+Math.imul(Ie,It)|0,d=d+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ae,It)|0,M=M+Math.imul(Ae,Ze)|0,I=I+Math.imul(Me,He)|0,d=d+Math.imul(Me,Ge)|0,d=d+Math.imul(me,He)|0,M=M+Math.imul(me,Ge)|0,I=I+Math.imul(Ne,ke)|0,d=d+Math.imul(Ne,Ke)|0,d=d+Math.imul(ze,ke)|0,M=M+Math.imul(ze,Ke)|0,I=I+Math.imul(we,tt)|0,d=d+Math.imul(we,Ve)|0,d=d+Math.imul(Pe,tt)|0,M=M+Math.imul(Pe,Ve)|0,I=I+Math.imul(oe,Ye)|0,d=d+Math.imul(oe,Qe)|0,d=d+Math.imul(le,Ye)|0,M=M+Math.imul(le,Qe)|0,I=I+Math.imul(K,Ue)|0,d=d+Math.imul(K,rt)|0,d=d+Math.imul(v,Ue)|0,M=M+Math.imul(v,rt)|0,I=I+Math.imul(he,Ut)|0,d=d+Math.imul(he,zt)|0,d=d+Math.imul(W,Ut)|0,M=M+Math.imul(W,zt)|0;var Pi=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,I=Math.imul(Re,yt),d=Math.imul(Re,gt),d=d+Math.imul(Ee,yt)|0,M=Math.imul(Ee,gt),I=I+Math.imul(xe,It)|0,d=d+Math.imul(xe,Ze)|0,d=d+Math.imul(Se,It)|0,M=M+Math.imul(Se,Ze)|0,I=I+Math.imul(Ie,He)|0,d=d+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ae,He)|0,M=M+Math.imul(Ae,Ge)|0,I=I+Math.imul(Me,ke)|0,d=d+Math.imul(Me,Ke)|0,d=d+Math.imul(me,ke)|0,M=M+Math.imul(me,Ke)|0,I=I+Math.imul(Ne,tt)|0,d=d+Math.imul(Ne,Ve)|0,d=d+Math.imul(ze,tt)|0,M=M+Math.imul(ze,Ve)|0,I=I+Math.imul(we,Ye)|0,d=d+Math.imul(we,Qe)|0,d=d+Math.imul(Pe,Ye)|0,M=M+Math.imul(Pe,Qe)|0,I=I+Math.imul(oe,Ue)|0,d=d+Math.imul(oe,rt)|0,d=d+Math.imul(le,Ue)|0,M=M+Math.imul(le,rt)|0,I=I+Math.imul(K,Ut)|0,d=d+Math.imul(K,zt)|0,d=d+Math.imul(v,Ut)|0,M=M+Math.imul(v,zt)|0;var $n=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+($n>>>26)|0,$n&=67108863,I=Math.imul(Re,It),d=Math.imul(Re,Ze),d=d+Math.imul(Ee,It)|0,M=Math.imul(Ee,Ze),I=I+Math.imul(xe,He)|0,d=d+Math.imul(xe,Ge)|0,d=d+Math.imul(Se,He)|0,M=M+Math.imul(Se,Ge)|0,I=I+Math.imul(Ie,ke)|0,d=d+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ae,ke)|0,M=M+Math.imul(Ae,Ke)|0,I=I+Math.imul(Me,tt)|0,d=d+Math.imul(Me,Ve)|0,d=d+Math.imul(me,tt)|0,M=M+Math.imul(me,Ve)|0,I=I+Math.imul(Ne,Ye)|0,d=d+Math.imul(Ne,Qe)|0,d=d+Math.imul(ze,Ye)|0,M=M+Math.imul(ze,Qe)|0,I=I+Math.imul(we,Ue)|0,d=d+Math.imul(we,rt)|0,d=d+Math.imul(Pe,Ue)|0,M=M+Math.imul(Pe,rt)|0,I=I+Math.imul(oe,Ut)|0,d=d+Math.imul(oe,zt)|0,d=d+Math.imul(le,Ut)|0,M=M+Math.imul(le,zt)|0;var Ln=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,I=Math.imul(Re,He),d=Math.imul(Re,Ge),d=d+Math.imul(Ee,He)|0,M=Math.imul(Ee,Ge),I=I+Math.imul(xe,ke)|0,d=d+Math.imul(xe,Ke)|0,d=d+Math.imul(Se,ke)|0,M=M+Math.imul(Se,Ke)|0,I=I+Math.imul(Ie,tt)|0,d=d+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ae,tt)|0,M=M+Math.imul(Ae,Ve)|0,I=I+Math.imul(Me,Ye)|0,d=d+Math.imul(Me,Qe)|0,d=d+Math.imul(me,Ye)|0,M=M+Math.imul(me,Qe)|0,I=I+Math.imul(Ne,Ue)|0,d=d+Math.imul(Ne,rt)|0,d=d+Math.imul(ze,Ue)|0,M=M+Math.imul(ze,rt)|0,I=I+Math.imul(we,Ut)|0,d=d+Math.imul(we,zt)|0,d=d+Math.imul(Pe,Ut)|0,M=M+Math.imul(Pe,zt)|0;var Mi=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,I=Math.imul(Re,ke),d=Math.imul(Re,Ke),d=d+Math.imul(Ee,ke)|0,M=Math.imul(Ee,Ke),I=I+Math.imul(xe,tt)|0,d=d+Math.imul(xe,Ve)|0,d=d+Math.imul(Se,tt)|0,M=M+Math.imul(Se,Ve)|0,I=I+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ae,Ye)|0,M=M+Math.imul(Ae,Qe)|0,I=I+Math.imul(Me,Ue)|0,d=d+Math.imul(Me,rt)|0,d=d+Math.imul(me,Ue)|0,M=M+Math.imul(me,rt)|0,I=I+Math.imul(Ne,Ut)|0,d=d+Math.imul(Ne,zt)|0,d=d+Math.imul(ze,Ut)|0,M=M+Math.imul(ze,zt)|0;var cn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(cn>>>26)|0,cn&=67108863,I=Math.imul(Re,tt),d=Math.imul(Re,Ve),d=d+Math.imul(Ee,tt)|0,M=Math.imul(Ee,Ve),I=I+Math.imul(xe,Ye)|0,d=d+Math.imul(xe,Qe)|0,d=d+Math.imul(Se,Ye)|0,M=M+Math.imul(Se,Qe)|0,I=I+Math.imul(Ie,Ue)|0,d=d+Math.imul(Ie,rt)|0,d=d+Math.imul(Ae,Ue)|0,M=M+Math.imul(Ae,rt)|0,I=I+Math.imul(Me,Ut)|0,d=d+Math.imul(Me,zt)|0,d=d+Math.imul(me,Ut)|0,M=M+Math.imul(me,zt)|0;var fn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(fn>>>26)|0,fn&=67108863,I=Math.imul(Re,Ye),d=Math.imul(Re,Qe),d=d+Math.imul(Ee,Ye)|0,M=Math.imul(Ee,Qe),I=I+Math.imul(xe,Ue)|0,d=d+Math.imul(xe,rt)|0,d=d+Math.imul(Se,Ue)|0,M=M+Math.imul(Se,rt)|0,I=I+Math.imul(Ie,Ut)|0,d=d+Math.imul(Ie,zt)|0,d=d+Math.imul(Ae,Ut)|0,M=M+Math.imul(Ae,zt)|0;var yr=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(yr>>>26)|0,yr&=67108863,I=Math.imul(Re,Ue),d=Math.imul(Re,rt),d=d+Math.imul(Ee,Ue)|0,M=Math.imul(Ee,rt),I=I+Math.imul(xe,Ut)|0,d=d+Math.imul(xe,zt)|0,d=d+Math.imul(Se,Ut)|0,M=M+Math.imul(Se,zt)|0;var Dn=(C+I|0)+((d&8191)<<13)|0;C=(M+(d>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,I=Math.imul(Re,Ut),d=Math.imul(Re,zt),d=d+Math.imul(Ee,Ut)|0,M=Math.imul(Ee,zt);var qn=(C+I|0)+((d&8191)<<13)|0;return C=(M+(d>>>13)|0)+(qn>>>26)|0,qn&=67108863,L[0]=Mn,L[1]=pr,L[2]=An,L[3]=On,L[4]=Rn,L[5]=Tn,L[6]=Cn,L[7]=qr,L[8]=xi,L[9]=Nn,L[10]=Pi,L[11]=$n,L[12]=Ln,L[13]=Mi,L[14]=cn,L[15]=fn,L[16]=yr,L[17]=Dn,L[18]=qn,C!==0&&(L[19]=C,w.length++),w};Math.imul||(j=T);function G($,u,y){y.negative=u.negative^$.negative,y.length=$.length+u.length;for(var w=0,E=0,O=0;O<y.length-1;O++){var L=E;E=0;for(var C=w&67108863,I=Math.min(O,u.length-1),d=Math.max(0,O-$.length+1);d<=I;d++){var M=O-d,ne=$.words[M]|0,ee=u.words[d]|0,fe=ne*ee,pe=fe&67108863;L=L+(fe/67108864|0)|0,pe=pe+C|0,C=pe&67108863,L=L+(pe>>>26)|0,E+=L>>>26,L&=67108863}y.words[O]=C,w=L,L=E}return w!==0?y.words[O]=w:y.length--,y.strip()}function X($,u,y){var w=new U;return w.mulp($,u,y)}o.prototype.mulTo=function(u,y){var w,E=this.length+u.length;return this.length===10&&u.length===10?w=j(this,u,y):E<63?w=T(this,u,y):E<1024?w=G(this,u,y):w=X(this,u,y),w};function U($,u){this.x=$,this.y=u}U.prototype.makeRBT=function(u){for(var y=new Array(u),w=o.prototype._countBits(u)-1,E=0;E<u;E++)y[E]=this.revBin(E,w,u);return y},U.prototype.revBin=function(u,y,w){if(u===0||u===w-1)return u;for(var E=0,O=0;O<y;O++)E|=(u&1)<<y-O-1,u>>=1;return E},U.prototype.permute=function(u,y,w,E,O,L){for(var C=0;C<L;C++)E[C]=y[u[C]],O[C]=w[u[C]]},U.prototype.transform=function(u,y,w,E,O,L){this.permute(L,u,y,w,E,O);for(var C=1;C<O;C<<=1)for(var I=C<<1,d=Math.cos(2*Math.PI/I),M=Math.sin(2*Math.PI/I),ne=0;ne<O;ne+=I)for(var ee=d,fe=M,pe=0;pe<C;pe++){var he=w[ne+pe],W=E[ne+pe],Q=w[ne+pe+C],K=E[ne+pe+C],v=ee*Q-fe*K;K=ee*K+fe*Q,Q=v,w[ne+pe]=he+Q,E[ne+pe]=W+K,w[ne+pe+C]=he-Q,E[ne+pe+C]=W-K,pe!==I&&(v=d*ee-M*fe,fe=d*fe+M*ee,ee=v)}},U.prototype.guessLen13b=function(u,y){var w=Math.max(y,u)|1,E=w&1,O=0;for(w=w/2|0;w;w=w>>>1)O++;return 1<<O+1+E},U.prototype.conjugate=function(u,y,w){if(!(w<=1))for(var E=0;E<w/2;E++){var O=u[E];u[E]=u[w-E-1],u[w-E-1]=O,O=y[E],y[E]=-y[w-E-1],y[w-E-1]=-O}},U.prototype.normalize13b=function(u,y){for(var w=0,E=0;E<y/2;E++){var O=Math.round(u[2*E+1]/y)*8192+Math.round(u[2*E]/y)+w;u[E]=O&67108863,O<67108864?w=0:w=O/67108864|0}return u},U.prototype.convert13b=function(u,y,w,E){for(var O=0,L=0;L<y;L++)O=O+(u[L]|0),w[2*L]=O&8191,O=O>>>13,w[2*L+1]=O&8191,O=O>>>13;for(L=2*y;L<E;++L)w[L]=0;i(O===0),i((O&-8192)===0)},U.prototype.stub=function(u){for(var y=new Array(u),w=0;w<u;w++)y[w]=0;return y},U.prototype.mulp=function(u,y,w){var E=2*this.guessLen13b(u.length,y.length),O=this.makeRBT(E),L=this.stub(E),C=new Array(E),I=new Array(E),d=new Array(E),M=new Array(E),ne=new Array(E),ee=new Array(E),fe=w.words;fe.length=E,this.convert13b(u.words,u.length,C,E),this.convert13b(y.words,y.length,M,E),this.transform(C,L,I,d,E,O),this.transform(M,L,ne,ee,E,O);for(var pe=0;pe<E;pe++){var he=I[pe]*ne[pe]-d[pe]*ee[pe];d[pe]=I[pe]*ee[pe]+d[pe]*ne[pe],I[pe]=he}return this.conjugate(I,d,E),this.transform(I,d,fe,L,E,O),this.conjugate(fe,L,E),this.normalize13b(fe,E),w.negative=u.negative^y.negative,w.length=u.length+y.length,w.strip()},o.prototype.mul=function(u){var y=new o(null);return y.words=new Array(this.length+u.length),this.mulTo(u,y)},o.prototype.mulf=function(u){var y=new o(null);return y.words=new Array(this.length+u.length),X(this,u,y)},o.prototype.imul=function(u){return this.clone().mulTo(u,this)},o.prototype.imuln=function(u){i(typeof u=="number"),i(u<67108864);for(var y=0,w=0;w<this.length;w++){var E=(this.words[w]|0)*u,O=(E&67108863)+(y&67108863);y>>=26,y+=E/67108864|0,y+=O>>>26,this.words[w]=O&67108863}return y!==0&&(this.words[w]=y,this.length++),this},o.prototype.muln=function(u){return this.clone().imuln(u)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(u){var y=x(u);if(y.length===0)return new o(1);for(var w=this,E=0;E<y.length&&y[E]===0;E++,w=w.sqr());if(++E<y.length)for(var O=w.sqr();E<y.length;E++,O=O.sqr())y[E]!==0&&(w=w.mul(O));return w},o.prototype.iushln=function(u){i(typeof u=="number"&&u>=0);var y=u%26,w=(u-y)/26,E=67108863>>>26-y<<26-y,O;if(y!==0){var L=0;for(O=0;O<this.length;O++){var C=this.words[O]&E,I=(this.words[O]|0)-C<<y;this.words[O]=I|L,L=C>>>26-y}L&&(this.words[O]=L,this.length++)}if(w!==0){for(O=this.length-1;O>=0;O--)this.words[O+w]=this.words[O];for(O=0;O<w;O++)this.words[O]=0;this.length+=w}return this.strip()},o.prototype.ishln=function(u){return i(this.negative===0),this.iushln(u)},o.prototype.iushrn=function(u,y,w){i(typeof u=="number"&&u>=0);var E;y?E=(y-y%26)/26:E=0;var O=u%26,L=Math.min((u-O)/26,this.length),C=67108863^67108863>>>O<<O,I=w;if(E-=L,E=Math.max(0,E),I){for(var d=0;d<L;d++)I.words[d]=this.words[d];I.length=L}if(L!==0)if(this.length>L)for(this.length-=L,d=0;d<this.length;d++)this.words[d]=this.words[d+L];else this.words[0]=0,this.length=1;var M=0;for(d=this.length-1;d>=0&&(M!==0||d>=E);d--){var ne=this.words[d]|0;this.words[d]=M<<26-O|ne>>>O,M=ne&C}return I&&M!==0&&(I.words[I.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(u,y,w){return i(this.negative===0),this.iushrn(u,y,w)},o.prototype.shln=function(u){return this.clone().ishln(u)},o.prototype.ushln=function(u){return this.clone().iushln(u)},o.prototype.shrn=function(u){return this.clone().ishrn(u)},o.prototype.ushrn=function(u){return this.clone().iushrn(u)},o.prototype.testn=function(u){i(typeof u=="number"&&u>=0);var y=u%26,w=(u-y)/26,E=1<<y;if(this.length<=w)return!1;var O=this.words[w];return!!(O&E)},o.prototype.imaskn=function(u){i(typeof u=="number"&&u>=0);var y=u%26,w=(u-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(y!==0&&w++,this.length=Math.min(w,this.length),y!==0){var E=67108863^67108863>>>y<<y;this.words[this.length-1]&=E}return this.strip()},o.prototype.maskn=function(u){return this.clone().imaskn(u)},o.prototype.iaddn=function(u){return i(typeof u=="number"),i(u<67108864),u<0?this.isubn(-u):this.negative!==0?this.length===1&&(this.words[0]|0)<u?(this.words[0]=u-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(u),this.negative=1,this):this._iaddn(u)},o.prototype._iaddn=function(u){this.words[0]+=u;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(u){if(i(typeof u=="number"),i(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(u){return this.clone().iaddn(u)},o.prototype.subn=function(u){return this.clone().isubn(u)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(u,y,w){var E=u.length+w,O;this._expand(E);var L,C=0;for(O=0;O<u.length;O++){L=(this.words[O+w]|0)+C;var I=(u.words[O]|0)*y;L-=I&67108863,C=(L>>26)-(I/67108864|0),this.words[O+w]=L&67108863}for(;O<this.length-w;O++)L=(this.words[O+w]|0)+C,C=L>>26,this.words[O+w]=L&67108863;if(C===0)return this.strip();for(i(C===-1),C=0,O=0;O<this.length;O++)L=-(this.words[O]|0)+C,C=L>>26,this.words[O]=L&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(u,y){var w=this.length-u.length,E=this.clone(),O=u,L=O.words[O.length-1]|0,C=this._countBits(L);w=26-C,w!==0&&(O=O.ushln(w),E.iushln(w),L=O.words[O.length-1]|0);var I=E.length-O.length,d;if(y!=="mod"){d=new o(null),d.length=I+1,d.words=new Array(d.length);for(var M=0;M<d.length;M++)d.words[M]=0}var ne=E.clone()._ishlnsubmul(O,1,I);ne.negative===0&&(E=ne,d&&(d.words[I]=1));for(var ee=I-1;ee>=0;ee--){var fe=(E.words[O.length+ee]|0)*67108864+(E.words[O.length+ee-1]|0);for(fe=Math.min(fe/L|0,67108863),E._ishlnsubmul(O,fe,ee);E.negative!==0;)fe--,E.negative=0,E._ishlnsubmul(O,1,ee),E.isZero()||(E.negative^=1);d&&(d.words[ee]=fe)}return d&&d.strip(),E.strip(),y!=="div"&&w!==0&&E.iushrn(w),{div:d||null,mod:E}},o.prototype.divmod=function(u,y,w){if(i(!u.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var E,O,L;return this.negative!==0&&u.negative===0?(L=this.neg().divmod(u,y),y!=="mod"&&(E=L.div.neg()),y!=="div"&&(O=L.mod.neg(),w&&O.negative!==0&&O.iadd(u)),{div:E,mod:O}):this.negative===0&&u.negative!==0?(L=this.divmod(u.neg(),y),y!=="mod"&&(E=L.div.neg()),{div:E,mod:L.mod}):this.negative&u.negative?(L=this.neg().divmod(u.neg(),y),y!=="div"&&(O=L.mod.neg(),w&&O.negative!==0&&O.isub(u)),{div:L.div,mod:O}):u.length>this.length||this.cmp(u)<0?{div:new o(0),mod:this}:u.length===1?y==="div"?{div:this.divn(u.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new o(this.modn(u.words[0]))}:this._wordDiv(u,y)},o.prototype.div=function(u){return this.divmod(u,"div",!1).div},o.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},o.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},o.prototype.divRound=function(u){var y=this.divmod(u);if(y.mod.isZero())return y.div;var w=y.div.negative!==0?y.mod.isub(u):y.mod,E=u.ushrn(1),O=u.andln(1),L=w.cmp(E);return L<0||O===1&&L===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(u){i(u<=67108863);for(var y=(1<<26)%u,w=0,E=this.length-1;E>=0;E--)w=(y*w+(this.words[E]|0))%u;return w},o.prototype.idivn=function(u){i(u<=67108863);for(var y=0,w=this.length-1;w>=0;w--){var E=(this.words[w]|0)+y*67108864;this.words[w]=E/u|0,y=E%u}return this.strip()},o.prototype.divn=function(u){return this.clone().idivn(u)},o.prototype.egcd=function(u){i(u.negative===0),i(!u.isZero());var y=this,w=u.clone();y.negative!==0?y=y.umod(u):y=y.clone();for(var E=new o(1),O=new o(0),L=new o(0),C=new o(1),I=0;y.isEven()&&w.isEven();)y.iushrn(1),w.iushrn(1),++I;for(var d=w.clone(),M=y.clone();!y.isZero();){for(var ne=0,ee=1;!(y.words[0]&ee)&&ne<26;++ne,ee<<=1);if(ne>0)for(y.iushrn(ne);ne-- >0;)(E.isOdd()||O.isOdd())&&(E.iadd(d),O.isub(M)),E.iushrn(1),O.iushrn(1);for(var fe=0,pe=1;!(w.words[0]&pe)&&fe<26;++fe,pe<<=1);if(fe>0)for(w.iushrn(fe);fe-- >0;)(L.isOdd()||C.isOdd())&&(L.iadd(d),C.isub(M)),L.iushrn(1),C.iushrn(1);y.cmp(w)>=0?(y.isub(w),E.isub(L),O.isub(C)):(w.isub(y),L.isub(E),C.isub(O))}return{a:L,b:C,gcd:w.iushln(I)}},o.prototype._invmp=function(u){i(u.negative===0),i(!u.isZero());var y=this,w=u.clone();y.negative!==0?y=y.umod(u):y=y.clone();for(var E=new o(1),O=new o(0),L=w.clone();y.cmpn(1)>0&&w.cmpn(1)>0;){for(var C=0,I=1;!(y.words[0]&I)&&C<26;++C,I<<=1);if(C>0)for(y.iushrn(C);C-- >0;)E.isOdd()&&E.iadd(L),E.iushrn(1);for(var d=0,M=1;!(w.words[0]&M)&&d<26;++d,M<<=1);if(d>0)for(w.iushrn(d);d-- >0;)O.isOdd()&&O.iadd(L),O.iushrn(1);y.cmp(w)>=0?(y.isub(w),E.isub(O)):(w.isub(y),O.isub(E))}var ne;return y.cmpn(1)===0?ne=E:ne=O,ne.cmpn(0)<0&&ne.iadd(u),ne},o.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var y=this.clone(),w=u.clone();y.negative=0,w.negative=0;for(var E=0;y.isEven()&&w.isEven();E++)y.iushrn(1),w.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;w.isEven();)w.iushrn(1);var O=y.cmp(w);if(O<0){var L=y;y=w,w=L}else if(O===0||w.cmpn(1)===0)break;y.isub(w)}while(!0);return w.iushln(E)},o.prototype.invm=function(u){return this.egcd(u).a.umod(u)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(u){return this.words[0]&u},o.prototype.bincn=function(u){i(typeof u=="number");var y=u%26,w=(u-y)/26,E=1<<y;if(this.length<=w)return this._expand(w+1),this.words[w]|=E,this;for(var O=E,L=w;O!==0&&L<this.length;L++){var C=this.words[L]|0;C+=O,O=C>>>26,C&=67108863,this.words[L]=C}return O!==0&&(this.words[L]=O,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(u){var y=u<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var w;if(this.length>1)w=1;else{y&&(u=-u),i(u<=67108863,"Number is too big");var E=this.words[0]|0;w=E===u?0:E<u?-1:1}return this.negative!==0?-w|0:w},o.prototype.cmp=function(u){if(this.negative!==0&&u.negative===0)return-1;if(this.negative===0&&u.negative!==0)return 1;var y=this.ucmp(u);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(u){if(this.length>u.length)return 1;if(this.length<u.length)return-1;for(var y=0,w=this.length-1;w>=0;w--){var E=this.words[w]|0,O=u.words[w]|0;if(E!==O){E<O?y=-1:E>O&&(y=1);break}}return y},o.prototype.gtn=function(u){return this.cmpn(u)===1},o.prototype.gt=function(u){return this.cmp(u)===1},o.prototype.gten=function(u){return this.cmpn(u)>=0},o.prototype.gte=function(u){return this.cmp(u)>=0},o.prototype.ltn=function(u){return this.cmpn(u)===-1},o.prototype.lt=function(u){return this.cmp(u)===-1},o.prototype.lten=function(u){return this.cmpn(u)<=0},o.prototype.lte=function(u){return this.cmp(u)<=0},o.prototype.eqn=function(u){return this.cmpn(u)===0},o.prototype.eq=function(u){return this.cmp(u)===0},o.red=function(u){return new re(u)},o.prototype.toRed=function(u){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(u){return this.red=u,this},o.prototype.forceRed=function(u){return i(!this.red,"Already a number in reduction context"),this._forceRed(u)},o.prototype.redAdd=function(u){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},o.prototype.redIAdd=function(u){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},o.prototype.redSub=function(u){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},o.prototype.redISub=function(u){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},o.prototype.redShl=function(u){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},o.prototype.redMul=function(u){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},o.prototype.redIMul=function(u){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(u){return i(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var V={k256:null,p224:null,p192:null,p25519:null};function D($,u){this.name=$,this.p=new o(u,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var u=new o(null);return u.words=new Array(Math.ceil(this.n/13)),u},D.prototype.ireduce=function(u){var y=u,w;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),w=y.bitLength();while(w>this.n);var E=w<this.n?-1:y.ucmp(this.p);return E===0?(y.words[0]=0,y.length=1):E>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},D.prototype.split=function(u,y){u.iushrn(this.n,0,y)},D.prototype.imulK=function(u){return u.imul(this.k)};function B(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(B,D),B.prototype.split=function(u,y){for(var w=4194303,E=Math.min(u.length,9),O=0;O<E;O++)y.words[O]=u.words[O];if(y.length=E,u.length<=9){u.words[0]=0,u.length=1;return}var L=u.words[9];for(y.words[y.length++]=L&w,O=10;O<u.length;O++){var C=u.words[O]|0;u.words[O-10]=(C&w)<<4|L>>>22,L=C}L>>>=22,u.words[O-10]=L,L===0&&u.length>10?u.length-=10:u.length-=9},B.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var y=0,w=0;w<u.length;w++){var E=u.words[w]|0;y+=E*977,u.words[w]=y&67108863,y=E*64+(y/67108864|0)}return u.words[u.length-1]===0&&(u.length--,u.words[u.length-1]===0&&u.length--),u};function F(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(F,D);function b(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(b,D);function N(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(N,D),N.prototype.imulK=function(u){for(var y=0,w=0;w<u.length;w++){var E=(u.words[w]|0)*19+y,O=E&67108863;E>>>=26,u.words[w]=O,y=E}return y!==0&&(u.words[u.length++]=y),u},o._prime=function(u){if(V[u])return V[u];var y;if(u==="k256")y=new B;else if(u==="p224")y=new F;else if(u==="p192")y=new b;else if(u==="p25519")y=new N;else throw new Error("Unknown prime "+u);return V[u]=y,y};function re($){if(typeof $=="string"){var u=o._prime($);this.m=u.p,this.prime=u}else i($.gtn(1),"modulus must be greater than 1"),this.m=$,this.prime=null}re.prototype._verify1=function(u){i(u.negative===0,"red works only with positives"),i(u.red,"red works only with red numbers")},re.prototype._verify2=function(u,y){i((u.negative|y.negative)===0,"red works only with positives"),i(u.red&&u.red===y.red,"red works only with red numbers")},re.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):u.umod(this.m)._forceRed(this)},re.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},re.prototype.add=function(u,y){this._verify2(u,y);var w=u.add(y);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},re.prototype.iadd=function(u,y){this._verify2(u,y);var w=u.iadd(y);return w.cmp(this.m)>=0&&w.isub(this.m),w},re.prototype.sub=function(u,y){this._verify2(u,y);var w=u.sub(y);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},re.prototype.isub=function(u,y){this._verify2(u,y);var w=u.isub(y);return w.cmpn(0)<0&&w.iadd(this.m),w},re.prototype.shl=function(u,y){return this._verify1(u),this.imod(u.ushln(y))},re.prototype.imul=function(u,y){return this._verify2(u,y),this.imod(u.imul(y))},re.prototype.mul=function(u,y){return this._verify2(u,y),this.imod(u.mul(y))},re.prototype.isqr=function(u){return this.imul(u,u.clone())},re.prototype.sqr=function(u){return this.mul(u,u)},re.prototype.sqrt=function(u){if(u.isZero())return u.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var w=this.m.add(new o(1)).iushrn(2);return this.pow(u,w)}for(var E=this.m.subn(1),O=0;!E.isZero()&&E.andln(1)===0;)O++,E.iushrn(1);i(!E.isZero());var L=new o(1).toRed(this),C=L.redNeg(),I=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new o(2*d*d).toRed(this);this.pow(d,I).cmp(C)!==0;)d.redIAdd(C);for(var M=this.pow(d,E),ne=this.pow(u,E.addn(1).iushrn(1)),ee=this.pow(u,E),fe=O;ee.cmp(L)!==0;){for(var pe=ee,he=0;pe.cmp(L)!==0;he++)pe=pe.redSqr();i(he<fe);var W=this.pow(M,new o(1).iushln(fe-he-1));ne=ne.redMul(W),M=W.redSqr(),ee=ee.redMul(M),fe=he}return ne},re.prototype.invm=function(u){var y=u._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},re.prototype.pow=function(u,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return u.clone();var w=4,E=new Array(1<<w);E[0]=new o(1).toRed(this),E[1]=u;for(var O=2;O<E.length;O++)E[O]=this.mul(E[O-1],u);var L=E[0],C=0,I=0,d=y.bitLength()%26;for(d===0&&(d=26),O=y.length-1;O>=0;O--){for(var M=y.words[O],ne=d-1;ne>=0;ne--){var ee=M>>ne&1;if(L!==E[0]&&(L=this.sqr(L)),ee===0&&C===0){I=0;continue}C<<=1,C|=ee,I++,!(I!==w&&(O!==0||ne!==0))&&(L=this.mul(L,E[C]),I=0,C=0)}d=26}return L},re.prototype.convertTo=function(u){var y=u.umod(this.m);return y===u?y.clone():y},re.prototype.convertFrom=function(u){var y=u.clone();return y.red=null,y},o.mont=function(u){return new de(u)};function de($){re.call(this,$),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}s(de,re),de.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},de.prototype.convertFrom=function(u){var y=this.imod(u.mul(this.rinv));return y.red=null,y},de.prototype.imul=function(u,y){if(u.isZero()||y.isZero())return u.words[0]=0,u.length=1,u;var w=u.imul(y),E=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=w.isub(E).iushrn(this.shift),L=O;return O.cmp(this.m)>=0?L=O.isub(this.m):O.cmpn(0)<0&&(L=O.iadd(this.m)),L._forceRed(this)},de.prototype.mul=function(u,y){if(u.isZero()||y.isZero())return new o(0)._forceRed(this);var w=u.mul(y),E=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=w.isub(E).iushrn(this.shift),L=O;return O.cmp(this.m)>=0?L=O.isub(this.m):O.cmpn(0)<0&&(L=O.iadd(this.m)),L._forceRed(this)},de.prototype.invm=function(u){var y=this.imod(u._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(r,Fp)})(pu);var on=pu.exports;(function(r){var e=r,t=on,i=i2,s=n2;e.assert=i,e.toArray=s.toArray,e.zero2=s.zero2,e.toHex=s.toHex,e.encode=s.encode;function o(m,_,P){var x=new Array(Math.max(m.bitLength(),P)+1),T;for(T=0;T<x.length;T+=1)x[T]=0;var j=1<<_+1,G=m.clone();for(T=0;T<x.length;T++){var X,U=G.andln(j-1);G.isOdd()?(U>(j>>1)-1?X=(j>>1)-U:X=U,G.isubn(X)):X=0,x[T]=X,G.iushrn(1)}return x}e.getNAF=o;function f(m,_){var P=[[],[]];m=m.clone(),_=_.clone();for(var x=0,T=0,j;m.cmpn(-x)>0||_.cmpn(-T)>0;){var G=m.andln(3)+x&3,X=_.andln(3)+T&3;G===3&&(G=-1),X===3&&(X=-1);var U;G&1?(j=m.andln(7)+x&7,(j===3||j===5)&&X===2?U=-G:U=G):U=0,P[0].push(U);var V;X&1?(j=_.andln(7)+T&7,(j===3||j===5)&&G===2?V=-X:V=X):V=0,P[1].push(V),2*x===U+1&&(x=1-x),2*T===V+1&&(T=1-T),m.iushrn(1),_.iushrn(1)}return P}e.getJSF=f;function h(m,_,P){var x="_"+_;m.prototype[_]=function(){return this[x]!==void 0?this[x]:this[x]=P.call(this)}}e.cachedProperty=h;function p(m){return typeof m=="string"?e.toArray(m,"hex"):m}e.parseBytes=p;function l(m){return new t(m,"hex","le")}e.intFromLE=l})(Gr);var gu={},Qn=on,Ka=Gr,mc=Ka.getNAF,g3=Ka.getJSF,yc=Ka.assert;function Pn(r,e){this.type=r,this.p=new Qn(e.p,16),this.red=e.prime?Qn.red(e.prime):Qn.mont(this.p),this.zero=new Qn(0).toRed(this.red),this.one=new Qn(1).toRed(this.red),this.two=new Qn(2).toRed(this.red),this.n=e.n&&new Qn(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var qc=Pn;Pn.prototype.point=function(){throw new Error("Not implemented")};Pn.prototype.validate=function(){throw new Error("Not implemented")};Pn.prototype._fixedNafMul=function(e,t){yc(e.precomputed);var i=e._getDoubles(),s=mc(t,1,this._bitLength),o=(1<<i.step+1)-(i.step%2===0?2:1);o/=3;var f=[],h,p;for(h=0;h<s.length;h+=i.step){p=0;for(var l=h+i.step-1;l>=h;l--)p=(p<<1)+s[l];f.push(p)}for(var m=this.jpoint(null,null,null),_=this.jpoint(null,null,null),P=o;P>0;P--){for(h=0;h<f.length;h++)p=f[h],p===P?_=_.mixedAdd(i.points[h]):p===-P&&(_=_.mixedAdd(i.points[h].neg()));m=m.add(_)}return m.toP()};Pn.prototype._wnafMul=function(e,t){var i=4,s=e._getNAFPoints(i);i=s.wnd;for(var o=s.points,f=mc(t,i,this._bitLength),h=this.jpoint(null,null,null),p=f.length-1;p>=0;p--){for(var l=0;p>=0&&f[p]===0;p--)l++;if(p>=0&&l++,h=h.dblp(l),p<0)break;var m=f[p];yc(m!==0),e.type==="affine"?m>0?h=h.mixedAdd(o[m-1>>1]):h=h.mixedAdd(o[-m-1>>1].neg()):m>0?h=h.add(o[m-1>>1]):h=h.add(o[-m-1>>1].neg())}return e.type==="affine"?h.toP():h};Pn.prototype._wnafMulAdd=function(e,t,i,s,o){var f=this._wnafT1,h=this._wnafT2,p=this._wnafT3,l=0,m,_,P;for(m=0;m<s;m++){P=t[m];var x=P._getNAFPoints(e);f[m]=x.wnd,h[m]=x.points}for(m=s-1;m>=1;m-=2){var T=m-1,j=m;if(f[T]!==1||f[j]!==1){p[T]=mc(i[T],f[T],this._bitLength),p[j]=mc(i[j],f[j],this._bitLength),l=Math.max(p[T].length,l),l=Math.max(p[j].length,l);continue}var G=[t[T],null,null,t[j]];t[T].y.cmp(t[j].y)===0?(G[1]=t[T].add(t[j]),G[2]=t[T].toJ().mixedAdd(t[j].neg())):t[T].y.cmp(t[j].y.redNeg())===0?(G[1]=t[T].toJ().mixedAdd(t[j]),G[2]=t[T].add(t[j].neg())):(G[1]=t[T].toJ().mixedAdd(t[j]),G[2]=t[T].toJ().mixedAdd(t[j].neg()));var X=[-3,-1,-5,-7,0,7,5,1,3],U=g3(i[T],i[j]);for(l=Math.max(U[0].length,l),p[T]=new Array(l),p[j]=new Array(l),_=0;_<l;_++){var V=U[0][_]|0,D=U[1][_]|0;p[T][_]=X[(V+1)*3+(D+1)],p[j][_]=0,h[T]=G}}var B=this.jpoint(null,null,null),F=this._wnafT4;for(m=l;m>=0;m--){for(var b=0;m>=0;){var N=!0;for(_=0;_<s;_++)F[_]=p[_][m]|0,F[_]!==0&&(N=!1);if(!N)break;b++,m--}if(m>=0&&b++,B=B.dblp(b),m<0)break;for(_=0;_<s;_++){var re=F[_];re!==0&&(re>0?P=h[_][re-1>>1]:re<0&&(P=h[_][-re-1>>1].neg()),P.type==="affine"?B=B.mixedAdd(P):B=B.add(P))}}for(m=0;m<s;m++)h[m]=null;return o?B:B.toP()};function fi(r,e){this.curve=r,this.type=e,this.precomputed=null}Pn.BasePoint=fi;fi.prototype.eq=function(){throw new Error("Not implemented")};fi.prototype.validate=function(){return this.curve.validate(this)};Pn.prototype.decodePoint=function(e,t){e=Ka.toArray(e,t);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?yc(e[e.length-1]%2===0):e[0]===7&&yc(e[e.length-1]%2===1);var s=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return s}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")};fi.prototype.encodeCompressed=function(e){return this.encode(e,!0)};fi.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))};fi.prototype.encode=function(e,t){return Ka.encode(this._encode(t),e)};fi.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this};fi.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1};fi.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],s=this,o=0;o<t;o+=e){for(var f=0;f<e;f++)s=s.dbl();i.push(s)}return{step:e,points:i}};fi.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,s=i===1?null:this.dbl(),o=1;o<i;o++)t[o]=t[o-1].add(s);return{wnd:e,points:t}};fi.prototype._getBeta=function(){return null};fi.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t};var b3=Gr,Gt=on,bu=ou,Gs=qc,v3=b3.assert;function hi(r){Gs.call(this,"short",r),this.a=new Gt(r.a,16).toRed(this.red),this.b=new Gt(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}bu(hi,Gs);var m3=hi;hi.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,i;if(e.beta)t=new Gt(e.beta,16).toRed(this.red);else{var s=this._getEndoRoots(this.p);t=s[0].cmp(s[1])<0?s[0]:s[1],t=t.toRed(this.red)}if(e.lambda)i=new Gt(e.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))===0?i=o[0]:(i=o[1],v3(this.g.mul(i).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(h){return{a:new Gt(h.a,16),b:new Gt(h.b,16)}}):f=this._getEndoBasis(i),{beta:t,lambda:i,basis:f}}};hi.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Gt.mont(e),i=new Gt(2).toRed(t).redInvm(),s=i.redNeg(),o=new Gt(3).toRed(t).redNeg().redSqrt().redMul(i),f=s.redAdd(o).fromRed(),h=s.redSub(o).fromRed();return[f,h]};hi.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,s=this.n.clone(),o=new Gt(1),f=new Gt(0),h=new Gt(0),p=new Gt(1),l,m,_,P,x,T,j,G=0,X,U;i.cmpn(0)!==0;){var V=s.div(i);X=s.sub(V.mul(i)),U=h.sub(V.mul(o));var D=p.sub(V.mul(f));if(!_&&X.cmp(t)<0)l=j.neg(),m=o,_=X.neg(),P=U;else if(_&&++G===2)break;j=X,s=i,i=X,h=o,o=U,p=f,f=D}x=X.neg(),T=U;var B=_.sqr().add(P.sqr()),F=x.sqr().add(T.sqr());return F.cmp(B)>=0&&(x=l,T=m),_.negative&&(_=_.neg(),P=P.neg()),x.negative&&(x=x.neg(),T=T.neg()),[{a:_,b:P},{a:x,b:T}]};hi.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],s=t[1],o=s.b.mul(e).divRound(this.n),f=i.b.neg().mul(e).divRound(this.n),h=o.mul(i.a),p=f.mul(s.a),l=o.mul(i.b),m=f.mul(s.b),_=e.sub(h).sub(p),P=l.add(m).neg();return{k1:_,k2:P}};hi.prototype.pointFromX=function(e,t){e=new Gt(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),s=i.redSqrt();if(s.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var o=s.fromRed().isOdd();return(t&&!o||!t&&o)&&(s=s.redNeg()),this.point(e,s)};hi.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,s=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(s).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0};hi.prototype._endoWnafMulAdd=function(e,t,i){for(var s=this._endoWnafT1,o=this._endoWnafT2,f=0;f<e.length;f++){var h=this._endoSplit(t[f]),p=e[f],l=p._getBeta();h.k1.negative&&(h.k1.ineg(),p=p.neg(!0)),h.k2.negative&&(h.k2.ineg(),l=l.neg(!0)),s[f*2]=p,s[f*2+1]=l,o[f*2]=h.k1,o[f*2+1]=h.k2}for(var m=this._wnafMulAdd(1,s,o,f*2,i),_=0;_<f*2;_++)s[_]=null,o[_]=null;return m};function fr(r,e,t,i){Gs.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Gt(e,16),this.y=new Gt(t,16),i&&(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)}bu(fr,Gs.BasePoint);hi.prototype.point=function(e,t,i){return new fr(this,e,t,i)};hi.prototype.pointFromJSON=function(e,t){return fr.fromJSON(this,e,t)};fr.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,s=function(o){return i.point(o.x.redMul(i.endo.beta),o.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(s)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(s)}}}return t}};fr.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]};fr.fromJSON=function(e,t,i){typeof t=="string"&&(t=JSON.parse(t));var s=e.point(t[0],t[1],i);if(!t[2])return s;function o(h){return e.point(h[0],h[1],i)}var f=t[2];return s.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[s].concat(f.doubles.points.map(o))},naf:f.naf&&{wnd:f.naf.wnd,points:[s].concat(f.naf.points.map(o))}},s};fr.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)+">"};fr.prototype.isInfinity=function(){return this.inf};fr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),s=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)};fr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),s=e.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(s),f=o.redSqr().redISub(this.x.redAdd(this.x)),h=o.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,h)};fr.prototype.getX=function(){return this.x.fromRed()};fr.prototype.getY=function(){return this.y.fromRed()};fr.prototype.mul=function(e){return e=new Gt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};fr.prototype.mulAdd=function(e,t,i){var s=[this,t],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(s,o):this.curve._wnafMulAdd(1,s,o,2)};fr.prototype.jmulAdd=function(e,t,i){var s=[this,t],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(s,o,!0):this.curve._wnafMulAdd(1,s,o,2,!0)};fr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};fr.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,s=function(o){return o.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(s)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(s)}}}return t};fr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ur(r,e,t,i){Gs.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Gt(0)):(this.x=new Gt(e,16),this.y=new Gt(t,16),this.z=new Gt(i,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}bu(ur,Gs.BasePoint);hi.prototype.jpoint=function(e,t,i){return new ur(this,e,t,i)};ur.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),s=this.y.redMul(t).redMul(e);return this.curve.point(i,s)};ur.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ur.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(t),o=e.x.redMul(i),f=this.y.redMul(t.redMul(e.z)),h=e.y.redMul(i.redMul(this.z)),p=s.redSub(o),l=f.redSub(h);if(p.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=p.redSqr(),_=m.redMul(p),P=s.redMul(m),x=l.redSqr().redIAdd(_).redISub(P).redISub(P),T=l.redMul(P.redISub(x)).redISub(f.redMul(_)),j=this.z.redMul(e.z).redMul(p);return this.curve.jpoint(x,T,j)};ur.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,s=e.x.redMul(t),o=this.y,f=e.y.redMul(t).redMul(this.z),h=i.redSub(s),p=o.redSub(f);if(h.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=h.redSqr(),m=l.redMul(h),_=i.redMul(l),P=p.redSqr().redIAdd(m).redISub(_).redISub(_),x=p.redMul(_.redISub(P)).redISub(o.redMul(m)),T=this.z.redMul(h);return this.curve.jpoint(P,x,T)};ur.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var s=this.curve.a,o=this.curve.tinv,f=this.x,h=this.y,p=this.z,l=p.redSqr().redSqr(),m=h.redAdd(h);for(t=0;t<e;t++){var _=f.redSqr(),P=m.redSqr(),x=P.redSqr(),T=_.redAdd(_).redIAdd(_).redIAdd(s.redMul(l)),j=f.redMul(P),G=T.redSqr().redISub(j.redAdd(j)),X=j.redISub(G),U=T.redMul(X);U=U.redIAdd(U).redISub(x);var V=m.redMul(p);t+1<e&&(l=l.redMul(x)),f=G,p=V,m=U}return this.curve.jpoint(f,m.redMul(o),p)};ur.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ur.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var s=this.x.redSqr(),o=this.y.redSqr(),f=o.redSqr(),h=this.x.redAdd(o).redSqr().redISub(s).redISub(f);h=h.redIAdd(h);var p=s.redAdd(s).redIAdd(s),l=p.redSqr().redISub(h).redISub(h),m=f.redIAdd(f);m=m.redIAdd(m),m=m.redIAdd(m),e=l,t=p.redMul(h.redISub(l)).redISub(m),i=this.y.redAdd(this.y)}else{var _=this.x.redSqr(),P=this.y.redSqr(),x=P.redSqr(),T=this.x.redAdd(P).redSqr().redISub(_).redISub(x);T=T.redIAdd(T);var j=_.redAdd(_).redIAdd(_),G=j.redSqr(),X=x.redIAdd(x);X=X.redIAdd(X),X=X.redIAdd(X),e=G.redISub(T).redISub(T),t=j.redMul(T.redISub(e)).redISub(X),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,t,i)};ur.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var s=this.x.redSqr(),o=this.y.redSqr(),f=o.redSqr(),h=this.x.redAdd(o).redSqr().redISub(s).redISub(f);h=h.redIAdd(h);var p=s.redAdd(s).redIAdd(s).redIAdd(this.curve.a),l=p.redSqr().redISub(h).redISub(h);e=l;var m=f.redIAdd(f);m=m.redIAdd(m),m=m.redIAdd(m),t=p.redMul(h.redISub(l)).redISub(m),i=this.y.redAdd(this.y)}else{var _=this.z.redSqr(),P=this.y.redSqr(),x=this.x.redMul(P),T=this.x.redSub(_).redMul(this.x.redAdd(_));T=T.redAdd(T).redIAdd(T);var j=x.redIAdd(x);j=j.redIAdd(j);var G=j.redAdd(j);e=T.redSqr().redISub(G),i=this.y.redAdd(this.z).redSqr().redISub(P).redISub(_);var X=P.redSqr();X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X),t=T.redMul(j.redISub(e)).redISub(X)}return this.curve.jpoint(e,t,i)};ur.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,s=this.z,o=s.redSqr().redSqr(),f=t.redSqr(),h=i.redSqr(),p=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(o)),l=t.redAdd(t);l=l.redIAdd(l);var m=l.redMul(h),_=p.redSqr().redISub(m.redAdd(m)),P=m.redISub(_),x=h.redSqr();x=x.redIAdd(x),x=x.redIAdd(x),x=x.redIAdd(x);var T=p.redMul(P).redISub(x),j=i.redAdd(i).redMul(s);return this.curve.jpoint(_,T,j)};ur.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),s=t.redSqr(),o=e.redAdd(e).redIAdd(e),f=o.redSqr(),h=this.x.redAdd(t).redSqr().redISub(e).redISub(s);h=h.redIAdd(h),h=h.redAdd(h).redIAdd(h),h=h.redISub(f);var p=h.redSqr(),l=s.redIAdd(s);l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var m=o.redIAdd(h).redSqr().redISub(f).redISub(p).redISub(l),_=t.redMul(m);_=_.redIAdd(_),_=_.redIAdd(_);var P=this.x.redMul(p).redISub(_);P=P.redIAdd(P),P=P.redIAdd(P);var x=this.y.redMul(m.redMul(l.redISub(m)).redISub(h.redMul(p)));x=x.redIAdd(x),x=x.redIAdd(x),x=x.redIAdd(x);var T=this.z.redAdd(h).redSqr().redISub(i).redISub(p);return this.curve.jpoint(P,x,T)};ur.prototype.mul=function(e,t){return e=new Gt(e,t),this.curve._wnafMul(this,e)};ur.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var s=t.redMul(this.z),o=i.redMul(e.z);return this.y.redMul(o).redISub(e.y.redMul(s)).cmpn(0)===0};ur.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(i)===0)return!0;for(var s=e.clone(),o=this.curve.redN.redMul(t);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}};ur.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)+">"};ur.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Fs=on,lg=ou,Uc=qc,y3=Gr;function Vs(r){Uc.call(this,"mont",r),this.a=new Fs(r.a,16).toRed(this.red),this.b=new Fs(r.b,16).toRed(this.red),this.i4=new Fs(4).toRed(this.red).redInvm(),this.two=new Fs(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}lg(Vs,Uc);var w3=Vs;Vs.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),s=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t),o=s.redSqrt();return o.redSqr().cmp(s)===0};function cr(r,e,t){Uc.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Fs(e,16),this.z=new Fs(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}lg(cr,Uc.BasePoint);Vs.prototype.decodePoint=function(e,t){return this.point(y3.toArray(e,t),1)};Vs.prototype.point=function(e,t){return new cr(this,e,t)};Vs.prototype.pointFromJSON=function(e){return cr.fromJSON(this,e)};cr.prototype.precompute=function(){};cr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};cr.fromJSON=function(e,t){return new cr(e,t[0],t[1]||e.one)};cr.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)+">"};cr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};cr.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),i=this.x.redSub(this.z),s=i.redSqr(),o=t.redSub(s),f=t.redMul(s),h=o.redMul(s.redAdd(this.curve.a24.redMul(o)));return this.curve.point(f,h)};cr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};cr.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),s=this.x.redSub(this.z),o=e.x.redAdd(e.z),f=e.x.redSub(e.z),h=f.redMul(i),p=o.redMul(s),l=t.z.redMul(h.redAdd(p).redSqr()),m=t.x.redMul(h.redISub(p).redSqr());return this.curve.point(l,m)};cr.prototype.mul=function(e){for(var t=e.clone(),i=this,s=this.curve.point(null,null),o=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var h=f.length-1;h>=0;h--)f[h]===0?(i=i.diffAdd(s,o),s=s.dbl()):(s=i.diffAdd(s,o),i=i.dbl());return s};cr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};cr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};cr.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};cr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};cr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var _3=Gr,nn=on,dg=ou,zc=qc,E3=_3.assert;function Fi(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,zc.call(this,"edwards",r),this.a=new nn(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new nn(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new nn(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),E3(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}dg(Fi,zc);var S3=Fi;Fi.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Fi.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Fi.prototype.jpoint=function(e,t,i,s){return this.point(e,t,i,s)};Fi.prototype.pointFromX=function(e,t){e=new nn(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),s=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),f=s.redMul(o.redInvm()),h=f.redSqrt();if(h.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var p=h.fromRed().isOdd();return(t&&!p||!t&&p)&&(h=h.redNeg()),this.point(e,h)};Fi.prototype.pointFromY=function(e,t){e=new nn(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),s=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),f=s.redMul(o.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var h=f.redSqrt();if(h.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return h.fromRed().isOdd()!==t&&(h=h.redNeg()),this.point(h,e)};Fi.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),s=t.redMul(this.a).redAdd(i),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return s.cmp(o)===0};function Ct(r,e,t,i,s){zc.BasePoint.call(this,r,"projective"),e===null&&t===null&&i===null?(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 nn(e,16),this.y=new nn(t,16),this.z=i?new nn(i,16):this.curve.one,this.t=s&&new nn(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()))))}dg(Ct,zc.BasePoint);Fi.prototype.pointFromJSON=function(e){return Ct.fromJSON(this,e)};Fi.prototype.point=function(e,t,i,s){return new Ct(this,e,t,i,s)};Ct.fromJSON=function(e,t){return new Ct(e,t[0],t[1],t[2])};Ct.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)+">"};Ct.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Ct.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var s=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),f=s.redAdd(t),h=f.redSub(i),p=s.redSub(t),l=o.redMul(h),m=f.redMul(p),_=o.redMul(p),P=h.redMul(f);return this.curve.point(l,m,P,_)};Ct.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),i=this.y.redSqr(),s,o,f,h,p,l;if(this.curve.twisted){h=this.curve._mulA(t);var m=h.redAdd(i);this.zOne?(s=e.redSub(t).redSub(i).redMul(m.redSub(this.curve.two)),o=m.redMul(h.redSub(i)),f=m.redSqr().redSub(m).redSub(m)):(p=this.z.redSqr(),l=m.redSub(p).redISub(p),s=e.redSub(t).redISub(i).redMul(l),o=m.redMul(h.redSub(i)),f=m.redMul(l))}else h=t.redAdd(i),p=this.curve._mulC(this.z).redSqr(),l=h.redSub(p).redSub(p),s=this.curve._mulC(e.redISub(h)).redMul(l),o=this.curve._mulC(h).redMul(t.redISub(i)),f=h.redMul(l);return this.curve.point(s,o,f)};Ct.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Ct.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),s=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),f=i.redSub(t),h=o.redSub(s),p=o.redAdd(s),l=i.redAdd(t),m=f.redMul(h),_=p.redMul(l),P=f.redMul(l),x=h.redMul(p);return this.curve.point(m,_,x,P)};Ct.prototype._projAdd=function(e){var t=this.z.redMul(e.z),i=t.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),f=this.curve.d.redMul(s).redMul(o),h=i.redSub(f),p=i.redAdd(f),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),m=t.redMul(h).redMul(l),_,P;return this.curve.twisted?(_=t.redMul(p).redMul(o.redSub(this.curve._mulA(s))),P=h.redMul(p)):(_=t.redMul(p).redMul(o.redSub(s)),P=this.curve._mulC(h).redMul(p)),this.curve.point(m,_,P)};Ct.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Ct.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Ct.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)};Ct.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)};Ct.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Ct.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Ct.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Ct.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Ct.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Ct.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(s),this.x.cmp(t)===0)return!0}};Ct.prototype.toP=Ct.prototype.normalize;Ct.prototype.mixedAdd=Ct.prototype.add;(function(r){var e=r;e.base=qc,e.short=m3,e.mont=w3,e.edwards=S3})(gu);var Bc={},vh,Zd;function I3(){return Zd||(Zd=1,vh={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"]]}}),vh}(function(r){var e=r,t=Hp,i=gu,s=Gr,o=s.assert;function f(l){l.type==="short"?this.curve=new i.short(l):l.type==="edwards"?this.curve=new i.edwards(l):this.curve=new i.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=f;function h(l,m){Object.defineProperty(e,l,{configurable:!0,enumerable:!0,get:function(){var _=new f(m);return Object.defineProperty(e,l,{configurable:!0,enumerable:!0,value:_}),_}})}h("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:t.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("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:t.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("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:t.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("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:t.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"]}),h("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:t.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"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["9"]}),h("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:t.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var p;try{p=I3()}catch{p=void 0}h("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:t.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",p]})})(Bc);var x3=on,P3=Gr,Wh=P3.assert;function mr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var M3=mr;mr.fromPublic=function(e,t,i){return t instanceof mr?t:new mr(e,{pub:t,pubEnc:i})};mr.fromPrivate=function(e,t,i){return t instanceof mr?t:new mr(e,{priv:t,privEnc:i})};mr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}};mr.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub};mr.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};mr.prototype._importPrivate=function(e,t){this.priv=new x3(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)};mr.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?Wh(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Wh(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};mr.prototype.derive=function(e){return e.validate()||Wh(e.validate(),"public point not validated"),e.mul(this.priv).getX()};mr.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)};mr.prototype.verify=function(e,t){return this.ec.verify(e,t,this)};mr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var wc=on,vu=Gr,A3=vu.assert;function Fc(r,e){if(r instanceof Fc)return r;this._importDER(r,e)||(A3(r.r&&r.s,"Signature without r or s"),this.r=new wc(r.r,16),this.s=new wc(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var O3=Fc;function R3(){this.place=0}function mh(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4||r[e.place]===0)return!1;for(var s=0,o=0,f=e.place;o<i;o++,f++)s<<=8,s|=r[f],s>>>=0;return s<=127?!1:(e.place=f,s)}function Qd(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}Fc.prototype._importDER=function(e,t){e=vu.toArray(e,t);var i=new R3;if(e[i.place++]!==48)return!1;var s=mh(e,i);if(s===!1||s+i.place!==e.length||e[i.place++]!==2)return!1;var o=mh(e,i);if(o===!1||e[i.place]&128)return!1;var f=e.slice(i.place,o+i.place);if(i.place+=o,e[i.place++]!==2)return!1;var h=mh(e,i);if(h===!1||e.length!==h+i.place||e[i.place]&128)return!1;var p=e.slice(i.place,h+i.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(p[0]===0)if(p[1]&128)p=p.slice(1);else return!1;return this.r=new wc(f),this.s=new wc(p),this.recoveryParam=null,!0};function yh(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Fc.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),i[0]&128&&(i=[0].concat(i)),t=Qd(t),i=Qd(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var s=[2];yh(s,t.length),s=s.concat(t),s.push(2),yh(s,i.length);var o=s.concat(i),f=[48];return yh(f,o.length),f=f.concat(o),vu.encode(f,e)};var as=on,pg=s2,T3=Gr,wh=Bc,C3=Kp(),gg=T3.assert,mu=M3,Hc=O3;function oi(r){if(!(this instanceof oi))return new oi(r);typeof r=="string"&&(gg(Object.prototype.hasOwnProperty.call(wh,r),"Unknown curve "+r),r=wh[r]),r instanceof wh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var N3=oi;oi.prototype.keyPair=function(e){return new mu(this,e)};oi.prototype.keyFromPrivate=function(e,t){return mu.fromPrivate(this,e,t)};oi.prototype.keyFromPublic=function(e,t){return mu.fromPublic(this,e,t)};oi.prototype.genKeyPair=function(e){e||(e={});for(var t=new pg({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||C3(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),s=this.n.sub(new as(2));;){var o=new as(t.generate(i));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}};oi.prototype._truncateToN=function(e,t){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};oi.prototype.sign=function(e,t,i,s){typeof i=="object"&&(s=i,i=null),s||(s={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new as(e,16));for(var o=this.n.byteLength(),f=t.getPrivate().toArray("be",o),h=e.toArray("be",o),p=new pg({hash:this.hash,entropy:f,nonce:h,pers:s.pers,persEnc:s.persEnc||"utf8"}),l=this.n.sub(new as(1)),m=0;;m++){var _=s.k?s.k(m):new as(p.generate(this.n.byteLength()));if(_=this._truncateToN(_,!0),!(_.cmpn(1)<=0||_.cmp(l)>=0)){var P=this.g.mul(_);if(!P.isInfinity()){var x=P.getX(),T=x.umod(this.n);if(T.cmpn(0)!==0){var j=_.invm(this.n).mul(T.mul(t.getPrivate()).iadd(e));if(j=j.umod(this.n),j.cmpn(0)!==0){var G=(P.getY().isOdd()?1:0)|(x.cmp(T)!==0?2:0);return s.canonical&&j.cmp(this.nh)>0&&(j=this.n.sub(j),G^=1),new Hc({r:T,s:j,recoveryParam:G})}}}}}};oi.prototype.verify=function(e,t,i,s){e=this._truncateToN(new as(e,16)),i=this.keyFromPublic(i,s),t=new Hc(t,"hex");var o=t.r,f=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var h=f.invm(this.n),p=h.mul(e).umod(this.n),l=h.mul(o).umod(this.n),m;return this.curve._maxwellTrick?(m=this.g.jmulAdd(p,i.getPublic(),l),m.isInfinity()?!1:m.eqXToP(o)):(m=this.g.mulAdd(p,i.getPublic(),l),m.isInfinity()?!1:m.getX().umod(this.n).cmp(o)===0)};oi.prototype.recoverPubKey=function(r,e,t,i){gg((3&t)===t,"The recovery param is more than two bits"),e=new Hc(e,i);var s=this.n,o=new as(r),f=e.r,h=e.s,p=t&1,l=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?f=this.curve.pointFromX(f.add(this.curve.n),p):f=this.curve.pointFromX(f,p);var m=e.r.invm(s),_=s.sub(o).mul(m).umod(s),P=h.mul(m).umod(s);return this.g.mulAdd(_,f,P)};oi.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Hc(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var s=0;s<4;s++){var o;try{o=this.recoverPubKey(r,e,s)}catch{continue}if(o.eq(t))return s}throw new Error("Unable to find valid recovery factor")};var ja=Gr,bg=ja.assert,e0=ja.parseBytes,Ys=ja.cachedProperty;function or(r,e){this.eddsa=r,this._secret=e0(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=e0(e.pub)}or.fromPublic=function(e,t){return t instanceof or?t:new or(e,{pub:t})};or.fromSecret=function(e,t){return t instanceof or?t:new or(e,{secret:t})};or.prototype.secret=function(){return this._secret};Ys(or,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Ys(or,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Ys(or,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,s=t.slice(0,e.encodingLength);return s[0]&=248,s[i]&=127,s[i]|=64,s});Ys(or,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Ys(or,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Ys(or,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});or.prototype.sign=function(e){return bg(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};or.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)};or.prototype.getSecret=function(e){return bg(this._secret,"KeyPair is public only"),ja.encode(this.secret(),e)};or.prototype.getPublic=function(e){return ja.encode(this.pubBytes(),e)};var $3=or,L3=on,Kc=Gr,t0=Kc.assert,jc=Kc.cachedProperty,D3=Kc.parseBytes;function us(r,e){this.eddsa=r,typeof e!="object"&&(e=D3(e)),Array.isArray(e)&&(t0(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),t0(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof L3&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}jc(us,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});jc(us,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});jc(us,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});jc(us,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});us.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};us.prototype.toHex=function(){return Kc.encode(this.toBytes(),"hex").toUpperCase()};var q3=us,U3=Hp,z3=Bc,js=Gr,B3=js.assert,vg=js.parseBytes,mg=$3,r0=q3;function Lr(r){if(B3(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Lr))return new Lr(r);r=z3[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=U3.sha512}var F3=Lr;Lr.prototype.sign=function(e,t){e=vg(e);var i=this.keyFromSecret(t),s=this.hashInt(i.messagePrefix(),e),o=this.g.mul(s),f=this.encodePoint(o),h=this.hashInt(f,i.pubBytes(),e).mul(i.priv()),p=s.add(h).umod(this.curve.n);return this.makeSignature({R:o,S:p,Rencoded:f})};Lr.prototype.verify=function(e,t,i){if(e=vg(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var s=this.keyFromPublic(i),o=this.hashInt(t.Rencoded(),s.pubBytes(),e),f=this.g.mul(t.S()),h=t.R().add(s.pub().mul(o));return h.eq(f)};Lr.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return js.intFromLE(e.digest()).umod(this.curve.n)};Lr.prototype.keyFromPublic=function(e){return mg.fromPublic(this,e)};Lr.prototype.keyFromSecret=function(e){return mg.fromSecret(this,e)};Lr.prototype.makeSignature=function(e){return e instanceof r0?e:new r0(this,e)};Lr.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t};Lr.prototype.decodePoint=function(e){e=js.parseBytes(e);var t=e.length-1,i=e.slice(0,t).concat(e[t]&-129),s=(e[t]&128)!==0,o=js.intFromLE(i);return this.curve.pointFromY(o,s)};Lr.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};Lr.prototype.decodeInt=function(e){return js.intFromLE(e)};Lr.prototype.isPoint=function(e){return e instanceof this.pointClass};(function(r){var e=r;e.version=p3.version,e.utils=Gr,e.rand=Kp(),e.curve=gu,e.curves=Bc,e.ec=N3,e.eddsa=F3})(ug);var yu={},yg={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=et,t=Wr;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var i=function(){function h(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return h.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},h.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},h.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},h.prototype.update=function(p,l){if(l===void 0&&(l=p.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var m=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&l>0;)this._buffer[this._bufferLength++]=p[m++],l--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(m=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,p,m,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=p[m++],l--;return this},h.prototype.finish=function(p){if(!this._finished){var l=this._bytesHashed,m=this._bufferLength,_=l/536870912|0,P=l<<3,x=l%128<112?128:256;this._buffer[m]=128;for(var T=m+1;T<x-8;T++)this._buffer[T]=0;e.writeUint32BE(_,this._buffer,x-8),e.writeUint32BE(P,this._buffer,x-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,x),this._finished=!0}for(var T=0;T<this.digestLength/8;T++)e.writeUint32BE(this._stateHi[T],p,T*8),e.writeUint32BE(this._stateLo[T],p,T*8+4);return this},h.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},h.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},h.prototype.restoreState=function(p){return this._stateHi.set(p.stateHi),this._stateLo.set(p.stateLo),this._bufferLength=p.bufferLength,p.buffer&&this._buffer.set(p.buffer),this._bytesHashed=p.bytesHashed,this._finished=!1,this},h.prototype.cleanSavedState=function(p){t.wipe(p.stateHi),t.wipe(p.stateLo),p.buffer&&t.wipe(p.buffer),p.bufferLength=0,p.bytesHashed=0},h}();r.SHA512=i;var s=new Int32Array([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 o(h,p,l,m,_,P,x){for(var T=l[0],j=l[1],G=l[2],X=l[3],U=l[4],V=l[5],D=l[6],B=l[7],F=m[0],b=m[1],N=m[2],re=m[3],de=m[4],$=m[5],u=m[6],y=m[7],w,E,O,L,C,I,d,M;x>=128;){for(var ne=0;ne<16;ne++){var ee=8*ne+P;h[ne]=e.readUint32BE(_,ee),p[ne]=e.readUint32BE(_,ee+4)}for(var ne=0;ne<80;ne++){var fe=T,pe=j,he=G,W=X,Q=U,K=V,v=D,H=B,oe=F,le=b,je=N,we=re,Pe=de,ut=$,Ne=u,ze=y;if(w=B,E=y,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=(U>>>14|de<<18)^(U>>>18|de<<14)^(de>>>9|U<<23),E=(de>>>14|U<<18)^(de>>>18|U<<14)^(U>>>9|de<<23),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=U&V^~U&D,E=de&$^~de&u,C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=s[ne*2],E=s[ne*2+1],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=h[ne%16],E=p[ne%16],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,O=d&65535|M<<16,L=C&65535|I<<16,w=O,E=L,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25),E=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,w=T&j^T&G^j&G,E=F&b^F&N^b&N,C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,H=d&65535|M<<16,ze=C&65535|I<<16,w=W,E=we,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=O,E=L,C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,W=d&65535|M<<16,we=C&65535|I<<16,j=fe,G=pe,X=he,U=W,V=Q,D=K,B=v,T=H,b=oe,N=le,re=je,de=we,$=Pe,u=ut,y=Ne,F=ze,ne%16===15)for(var ee=0;ee<16;ee++)w=h[ee],E=p[ee],C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=h[(ee+9)%16],E=p[(ee+9)%16],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,O=h[(ee+1)%16],L=p[(ee+1)%16],w=(O>>>1|L<<31)^(O>>>8|L<<24)^O>>>7,E=(L>>>1|O<<31)^(L>>>8|O<<24)^(L>>>7|O<<25),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,O=h[(ee+14)%16],L=p[(ee+14)%16],w=(O>>>19|L<<13)^(L>>>29|O<<3)^O>>>6,E=(L>>>19|O<<13)^(O>>>29|L<<3)^(L>>>6|O<<26),C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,h[ee]=d&65535|M<<16,p[ee]=C&65535|I<<16}w=T,E=F,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[0],E=m[0],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[0]=T=d&65535|M<<16,m[0]=F=C&65535|I<<16,w=j,E=b,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[1],E=m[1],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[1]=j=d&65535|M<<16,m[1]=b=C&65535|I<<16,w=G,E=N,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[2],E=m[2],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[2]=G=d&65535|M<<16,m[2]=N=C&65535|I<<16,w=X,E=re,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[3],E=m[3],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[3]=X=d&65535|M<<16,m[3]=re=C&65535|I<<16,w=U,E=de,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[4],E=m[4],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[4]=U=d&65535|M<<16,m[4]=de=C&65535|I<<16,w=V,E=$,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[5],E=m[5],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[5]=V=d&65535|M<<16,m[5]=$=C&65535|I<<16,w=D,E=u,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[6],E=m[6],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[6]=D=d&65535|M<<16,m[6]=u=C&65535|I<<16,w=B,E=y,C=E&65535,I=E>>>16,d=w&65535,M=w>>>16,w=l[7],E=m[7],C+=E&65535,I+=E>>>16,d+=w&65535,M+=w>>>16,I+=C>>>16,d+=I>>>16,M+=d>>>16,l[7]=B=d&65535|M<<16,m[7]=y=C&65535|I<<16,P+=128,x-=128}return P}function f(h){var p=new i;p.update(h);var l=p.digest();return p.clean(),l}r.hash=f})(yg);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=xn,t=yg,i=Wr;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function s(W){const Q=new Float64Array(16);if(W)for(let K=0;K<W.length;K++)Q[K]=W[K];return Q}const o=new Uint8Array(32);o[0]=9;const f=s(),h=s([1]),p=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),P=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(W,Q){for(let K=0;K<16;K++)W[K]=Q[K]|0}function T(W){let Q=1;for(let K=0;K<16;K++){let v=W[K]+Q+65535;Q=Math.floor(v/65536),W[K]=v-Q*65536}W[0]+=Q-1+37*(Q-1)}function j(W,Q,K){const v=~(K-1);for(let H=0;H<16;H++){const oe=v&(W[H]^Q[H]);W[H]^=oe,Q[H]^=oe}}function G(W,Q){const K=s(),v=s();for(let H=0;H<16;H++)v[H]=Q[H];T(v),T(v),T(v);for(let H=0;H<2;H++){K[0]=v[0]-65517;for(let le=1;le<15;le++)K[le]=v[le]-65535-(K[le-1]>>16&1),K[le-1]&=65535;K[15]=v[15]-32767-(K[14]>>16&1);const oe=K[15]>>16&1;K[14]&=65535,j(v,K,1-oe)}for(let H=0;H<16;H++)W[2*H]=v[H]&255,W[2*H+1]=v[H]>>8}function X(W,Q){let K=0;for(let v=0;v<32;v++)K|=W[v]^Q[v];return(1&K-1>>>8)-1}function U(W,Q){const K=new Uint8Array(32),v=new Uint8Array(32);return G(K,W),G(v,Q),X(K,v)}function V(W){const Q=new Uint8Array(32);return G(Q,W),Q[0]&1}function D(W,Q){for(let K=0;K<16;K++)W[K]=Q[2*K]+(Q[2*K+1]<<8);W[15]&=32767}function B(W,Q,K){for(let v=0;v<16;v++)W[v]=Q[v]+K[v]}function F(W,Q,K){for(let v=0;v<16;v++)W[v]=Q[v]-K[v]}function b(W,Q,K){let v,H,oe=0,le=0,je=0,we=0,Pe=0,ut=0,Ne=0,ze=0,st=0,Me=0,me=0,Be=0,Ie=0,Ae=0,qe=0,xe=0,Se=0,Fe=0,Re=0,Ee=0,at=0,Te=0,Ce=0,lt=0,ct=0,pt=0,dr=0,yt=0,gt=0,ui=0,It=0,Ze=K[0],Nt=K[1],He=K[2],Ge=K[3],$t=K[4],ke=K[5],Ke=K[6],Ft=K[7],tt=K[8],Ve=K[9],Ht=K[10],Ye=K[11],Qe=K[12],Lt=K[13],Ue=K[14],rt=K[15];v=Q[0],oe+=v*Ze,le+=v*Nt,je+=v*He,we+=v*Ge,Pe+=v*$t,ut+=v*ke,Ne+=v*Ke,ze+=v*Ft,st+=v*tt,Me+=v*Ve,me+=v*Ht,Be+=v*Ye,Ie+=v*Qe,Ae+=v*Lt,qe+=v*Ue,xe+=v*rt,v=Q[1],le+=v*Ze,je+=v*Nt,we+=v*He,Pe+=v*Ge,ut+=v*$t,Ne+=v*ke,ze+=v*Ke,st+=v*Ft,Me+=v*tt,me+=v*Ve,Be+=v*Ht,Ie+=v*Ye,Ae+=v*Qe,qe+=v*Lt,xe+=v*Ue,Se+=v*rt,v=Q[2],je+=v*Ze,we+=v*Nt,Pe+=v*He,ut+=v*Ge,Ne+=v*$t,ze+=v*ke,st+=v*Ke,Me+=v*Ft,me+=v*tt,Be+=v*Ve,Ie+=v*Ht,Ae+=v*Ye,qe+=v*Qe,xe+=v*Lt,Se+=v*Ue,Fe+=v*rt,v=Q[3],we+=v*Ze,Pe+=v*Nt,ut+=v*He,Ne+=v*Ge,ze+=v*$t,st+=v*ke,Me+=v*Ke,me+=v*Ft,Be+=v*tt,Ie+=v*Ve,Ae+=v*Ht,qe+=v*Ye,xe+=v*Qe,Se+=v*Lt,Fe+=v*Ue,Re+=v*rt,v=Q[4],Pe+=v*Ze,ut+=v*Nt,Ne+=v*He,ze+=v*Ge,st+=v*$t,Me+=v*ke,me+=v*Ke,Be+=v*Ft,Ie+=v*tt,Ae+=v*Ve,qe+=v*Ht,xe+=v*Ye,Se+=v*Qe,Fe+=v*Lt,Re+=v*Ue,Ee+=v*rt,v=Q[5],ut+=v*Ze,Ne+=v*Nt,ze+=v*He,st+=v*Ge,Me+=v*$t,me+=v*ke,Be+=v*Ke,Ie+=v*Ft,Ae+=v*tt,qe+=v*Ve,xe+=v*Ht,Se+=v*Ye,Fe+=v*Qe,Re+=v*Lt,Ee+=v*Ue,at+=v*rt,v=Q[6],Ne+=v*Ze,ze+=v*Nt,st+=v*He,Me+=v*Ge,me+=v*$t,Be+=v*ke,Ie+=v*Ke,Ae+=v*Ft,qe+=v*tt,xe+=v*Ve,Se+=v*Ht,Fe+=v*Ye,Re+=v*Qe,Ee+=v*Lt,at+=v*Ue,Te+=v*rt,v=Q[7],ze+=v*Ze,st+=v*Nt,Me+=v*He,me+=v*Ge,Be+=v*$t,Ie+=v*ke,Ae+=v*Ke,qe+=v*Ft,xe+=v*tt,Se+=v*Ve,Fe+=v*Ht,Re+=v*Ye,Ee+=v*Qe,at+=v*Lt,Te+=v*Ue,Ce+=v*rt,v=Q[8],st+=v*Ze,Me+=v*Nt,me+=v*He,Be+=v*Ge,Ie+=v*$t,Ae+=v*ke,qe+=v*Ke,xe+=v*Ft,Se+=v*tt,Fe+=v*Ve,Re+=v*Ht,Ee+=v*Ye,at+=v*Qe,Te+=v*Lt,Ce+=v*Ue,lt+=v*rt,v=Q[9],Me+=v*Ze,me+=v*Nt,Be+=v*He,Ie+=v*Ge,Ae+=v*$t,qe+=v*ke,xe+=v*Ke,Se+=v*Ft,Fe+=v*tt,Re+=v*Ve,Ee+=v*Ht,at+=v*Ye,Te+=v*Qe,Ce+=v*Lt,lt+=v*Ue,ct+=v*rt,v=Q[10],me+=v*Ze,Be+=v*Nt,Ie+=v*He,Ae+=v*Ge,qe+=v*$t,xe+=v*ke,Se+=v*Ke,Fe+=v*Ft,Re+=v*tt,Ee+=v*Ve,at+=v*Ht,Te+=v*Ye,Ce+=v*Qe,lt+=v*Lt,ct+=v*Ue,pt+=v*rt,v=Q[11],Be+=v*Ze,Ie+=v*Nt,Ae+=v*He,qe+=v*Ge,xe+=v*$t,Se+=v*ke,Fe+=v*Ke,Re+=v*Ft,Ee+=v*tt,at+=v*Ve,Te+=v*Ht,Ce+=v*Ye,lt+=v*Qe,ct+=v*Lt,pt+=v*Ue,dr+=v*rt,v=Q[12],Ie+=v*Ze,Ae+=v*Nt,qe+=v*He,xe+=v*Ge,Se+=v*$t,Fe+=v*ke,Re+=v*Ke,Ee+=v*Ft,at+=v*tt,Te+=v*Ve,Ce+=v*Ht,lt+=v*Ye,ct+=v*Qe,pt+=v*Lt,dr+=v*Ue,yt+=v*rt,v=Q[13],Ae+=v*Ze,qe+=v*Nt,xe+=v*He,Se+=v*Ge,Fe+=v*$t,Re+=v*ke,Ee+=v*Ke,at+=v*Ft,Te+=v*tt,Ce+=v*Ve,lt+=v*Ht,ct+=v*Ye,pt+=v*Qe,dr+=v*Lt,yt+=v*Ue,gt+=v*rt,v=Q[14],qe+=v*Ze,xe+=v*Nt,Se+=v*He,Fe+=v*Ge,Re+=v*$t,Ee+=v*ke,at+=v*Ke,Te+=v*Ft,Ce+=v*tt,lt+=v*Ve,ct+=v*Ht,pt+=v*Ye,dr+=v*Qe,yt+=v*Lt,gt+=v*Ue,ui+=v*rt,v=Q[15],xe+=v*Ze,Se+=v*Nt,Fe+=v*He,Re+=v*Ge,Ee+=v*$t,at+=v*ke,Te+=v*Ke,Ce+=v*Ft,lt+=v*tt,ct+=v*Ve,pt+=v*Ht,dr+=v*Ye,yt+=v*Qe,gt+=v*Lt,ui+=v*Ue,It+=v*rt,oe+=38*Se,le+=38*Fe,je+=38*Re,we+=38*Ee,Pe+=38*at,ut+=38*Te,Ne+=38*Ce,ze+=38*lt,st+=38*ct,Me+=38*pt,me+=38*dr,Be+=38*yt,Ie+=38*gt,Ae+=38*ui,qe+=38*It,H=1,v=oe+H+65535,H=Math.floor(v/65536),oe=v-H*65536,v=le+H+65535,H=Math.floor(v/65536),le=v-H*65536,v=je+H+65535,H=Math.floor(v/65536),je=v-H*65536,v=we+H+65535,H=Math.floor(v/65536),we=v-H*65536,v=Pe+H+65535,H=Math.floor(v/65536),Pe=v-H*65536,v=ut+H+65535,H=Math.floor(v/65536),ut=v-H*65536,v=Ne+H+65535,H=Math.floor(v/65536),Ne=v-H*65536,v=ze+H+65535,H=Math.floor(v/65536),ze=v-H*65536,v=st+H+65535,H=Math.floor(v/65536),st=v-H*65536,v=Me+H+65535,H=Math.floor(v/65536),Me=v-H*65536,v=me+H+65535,H=Math.floor(v/65536),me=v-H*65536,v=Be+H+65535,H=Math.floor(v/65536),Be=v-H*65536,v=Ie+H+65535,H=Math.floor(v/65536),Ie=v-H*65536,v=Ae+H+65535,H=Math.floor(v/65536),Ae=v-H*65536,v=qe+H+65535,H=Math.floor(v/65536),qe=v-H*65536,v=xe+H+65535,H=Math.floor(v/65536),xe=v-H*65536,oe+=H-1+37*(H-1),H=1,v=oe+H+65535,H=Math.floor(v/65536),oe=v-H*65536,v=le+H+65535,H=Math.floor(v/65536),le=v-H*65536,v=je+H+65535,H=Math.floor(v/65536),je=v-H*65536,v=we+H+65535,H=Math.floor(v/65536),we=v-H*65536,v=Pe+H+65535,H=Math.floor(v/65536),Pe=v-H*65536,v=ut+H+65535,H=Math.floor(v/65536),ut=v-H*65536,v=Ne+H+65535,H=Math.floor(v/65536),Ne=v-H*65536,v=ze+H+65535,H=Math.floor(v/65536),ze=v-H*65536,v=st+H+65535,H=Math.floor(v/65536),st=v-H*65536,v=Me+H+65535,H=Math.floor(v/65536),Me=v-H*65536,v=me+H+65535,H=Math.floor(v/65536),me=v-H*65536,v=Be+H+65535,H=Math.floor(v/65536),Be=v-H*65536,v=Ie+H+65535,H=Math.floor(v/65536),Ie=v-H*65536,v=Ae+H+65535,H=Math.floor(v/65536),Ae=v-H*65536,v=qe+H+65535,H=Math.floor(v/65536),qe=v-H*65536,v=xe+H+65535,H=Math.floor(v/65536),xe=v-H*65536,oe+=H-1+37*(H-1),W[0]=oe,W[1]=le,W[2]=je,W[3]=we,W[4]=Pe,W[5]=ut,W[6]=Ne,W[7]=ze,W[8]=st,W[9]=Me,W[10]=me,W[11]=Be,W[12]=Ie,W[13]=Ae,W[14]=qe,W[15]=xe}function N(W,Q){b(W,Q,Q)}function re(W,Q){const K=s();let v;for(v=0;v<16;v++)K[v]=Q[v];for(v=253;v>=0;v--)N(K,K),v!==2&&v!==4&&b(K,K,Q);for(v=0;v<16;v++)W[v]=K[v]}function de(W,Q){const K=s();let v;for(v=0;v<16;v++)K[v]=Q[v];for(v=250;v>=0;v--)N(K,K),v!==1&&b(K,K,Q);for(v=0;v<16;v++)W[v]=K[v]}function $(W,Q){const K=s(),v=s(),H=s(),oe=s(),le=s(),je=s(),we=s(),Pe=s(),ut=s();F(K,W[1],W[0]),F(ut,Q[1],Q[0]),b(K,K,ut),B(v,W[0],W[1]),B(ut,Q[0],Q[1]),b(v,v,ut),b(H,W[3],Q[3]),b(H,H,l),b(oe,W[2],Q[2]),B(oe,oe,oe),F(le,v,K),F(je,oe,H),B(we,oe,H),B(Pe,v,K),b(W[0],le,je),b(W[1],Pe,we),b(W[2],we,je),b(W[3],le,Pe)}function u(W,Q,K){for(let v=0;v<4;v++)j(W[v],Q[v],K)}function y(W,Q){const K=s(),v=s(),H=s();re(H,Q[2]),b(K,Q[0],H),b(v,Q[1],H),G(W,v),W[31]^=V(K)<<7}function w(W,Q,K){x(W[0],f),x(W[1],h),x(W[2],h),x(W[3],f);for(let v=255;v>=0;--v){const H=K[v/8|0]>>(v&7)&1;u(W,Q,H),$(Q,W),$(W,W),u(W,Q,H)}}function E(W,Q){const K=[s(),s(),s(),s()];x(K[0],m),x(K[1],_),x(K[2],h),b(K[3],m,_),w(W,K,Q)}function O(W){if(W.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const Q=(0,t.hash)(W);Q[0]&=248,Q[31]&=127,Q[31]|=64;const K=new Uint8Array(32),v=[s(),s(),s(),s()];E(v,Q),y(K,v);const H=new Uint8Array(64);return H.set(W),H.set(K,32),{publicKey:K,secretKey:H}}r.generateKeyPairFromSeed=O;function L(W){const Q=(0,e.randomBytes)(32,W),K=O(Q);return(0,i.wipe)(Q),K}r.generateKeyPair=L;function C(W){if(W.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(W.subarray(32))}r.extractPublicKeyFromSecretKey=C;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function d(W,Q){let K,v,H,oe;for(v=63;v>=32;--v){for(K=0,H=v-32,oe=v-12;H<oe;++H)Q[H]+=K-16*Q[v]*I[H-(v-32)],K=Math.floor((Q[H]+128)/256),Q[H]-=K*256;Q[H]+=K,Q[v]=0}for(K=0,H=0;H<32;H++)Q[H]+=K-(Q[31]>>4)*I[H],K=Q[H]>>8,Q[H]&=255;for(H=0;H<32;H++)Q[H]-=K*I[H];for(v=0;v<32;v++)Q[v+1]+=Q[v]>>8,W[v]=Q[v]&255}function M(W){const Q=new Float64Array(64);for(let K=0;K<64;K++)Q[K]=W[K];for(let K=0;K<64;K++)W[K]=0;d(W,Q)}function ne(W,Q){const K=new Float64Array(64),v=[s(),s(),s(),s()],H=(0,t.hash)(W.subarray(0,32));H[0]&=248,H[31]&=127,H[31]|=64;const oe=new Uint8Array(64);oe.set(H.subarray(32),32);const le=new t.SHA512;le.update(oe.subarray(32)),le.update(Q);const je=le.digest();le.clean(),M(je),E(v,je),y(oe,v),le.reset(),le.update(oe.subarray(0,32)),le.update(W.subarray(32)),le.update(Q);const we=le.digest();M(we);for(let Pe=0;Pe<32;Pe++)K[Pe]=je[Pe];for(let Pe=0;Pe<32;Pe++)for(let ut=0;ut<32;ut++)K[Pe+ut]+=we[Pe]*H[ut];return d(oe.subarray(32),K),oe}r.sign=ne;function ee(W,Q){const K=s(),v=s(),H=s(),oe=s(),le=s(),je=s(),we=s();return x(W[2],h),D(W[1],Q),N(H,W[1]),b(oe,H,p),F(H,H,W[2]),B(oe,W[2],oe),N(le,oe),N(je,le),b(we,je,le),b(K,we,H),b(K,K,oe),de(K,K),b(K,K,H),b(K,K,oe),b(K,K,oe),b(W[0],K,oe),N(v,W[0]),b(v,v,oe),U(v,H)&&b(W[0],W[0],P),N(v,W[0]),b(v,v,oe),U(v,H)?-1:(V(W[0])===Q[31]>>7&&F(W[0],f,W[0]),b(W[3],W[0],W[1]),0)}function fe(W,Q,K){const v=new Uint8Array(32),H=[s(),s(),s(),s()],oe=[s(),s(),s(),s()];if(K.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(ee(oe,W))return!1;const le=new t.SHA512;le.update(K.subarray(0,32)),le.update(W),le.update(Q);const je=le.digest();return M(je),w(H,oe,je),E(oe,K.subarray(32)),$(H,oe),y(v,H),!X(K,v)}r.verify=fe;function pe(W){let Q=[s(),s(),s(),s()];if(ee(Q,W))throw new Error("Ed25519: invalid public key");let K=s(),v=s(),H=Q[1];B(K,h,H),F(v,h,H),re(v,v),b(K,K,v);let oe=new Uint8Array(32);return G(oe,K),oe}r.convertPublicKeyToX25519=pe;function he(W){const Q=(0,t.hash)(W.subarray(0,32));Q[0]&=248,Q[31]&=127,Q[31]|=64;const K=new Uint8Array(Q.subarray(0,32));return(0,i.wipe)(Q),K}r.convertSecretKeyToX25519=he})(yu);const H3="EdDSA",K3="JWT",_c=".",kc="base64url",wg="utf8",_g="utf8",j3=":",k3="did",W3="key",i0="base58btc",G3="z",V3="K36",Y3=32,J3=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),X3=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function os(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return X3(r)}catch{return r}}function an(r){return typeof r=="string"?r:J3(r)||""}function n0(r){return os(Tc(ks(r,kc),wg))}function Ec(r){return Tc(ks(an(r),wg),kc)}function Eg(r){const e=ks(V3,i0),t=G3+Tc(a2([e,r]),i0);return[k3,W3,t].join(j3)}function Z3(r){return Tc(r,kc)}function Q3(r){return ks(r,kc)}function e5(r){return ks([Ec(r.header),Ec(r.payload)].join(_c),_g)}function t5(r){return[Ec(r.header),Ec(r.payload),Z3(r.signature)].join(_c)}function Gh(r){const e=r.split(_c),t=n0(e[0]),i=n0(e[1]),s=Q3(e[2]),o=ks(e.slice(0,2).join(_c),_g);return{header:t,payload:i,signature:s,data:o}}function s0(r=xn.randomBytes(Y3)){return yu.generateKeyPairFromSeed(r)}async function r5(r,e,t,i,s=be.fromMiliseconds(Date.now())){const o={alg:H3,typ:K3},f=Eg(i.publicKey),h=s+t,p={iss:f,sub:r,aud:e,iat:s,exp:h},l=e5({header:o,payload:p}),m=yu.sign(i.secretKey,l);return t5({header:o,payload:p,signature:m})}const i5={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var Wt={},n5={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.2.2"};const s5=":";function Hs(r){const[e,t]=r.split(s5);return{namespace:e,reference:t}}function a0(r,e=[]){const t=[];return Object.keys(r).forEach(i=>{if(e.length&&!e.includes(i))return;const s=r[i];t.push(...s.accounts)}),t}function Sg(r,e){return r.includes(":")?[r]:e.chains||[]}var a5=Object.defineProperty,o0=Object.getOwnPropertySymbols,o5=Object.prototype.hasOwnProperty,c5=Object.prototype.propertyIsEnumerable,c0=(r,e,t)=>e in r?a5(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,f0=(r,e)=>{for(var t in e||(e={}))o5.call(e,t)&&c0(r,t,e[t]);if(o0)for(var t of o0(e))c5.call(e,t)&&c0(r,t,e[t]);return r};const f5="ReactNative",jr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},h5="js";function Sc(){return typeof _i<"u"&&typeof _i.versions<"u"&&typeof _i.versions.node<"u"}function Js(){return!Ba()&&!!fu()&&navigator.product===f5}function ka(){return!Sc()&&!!fu()&&!!Ba()}function Wa(){return Js()?jr.reactNative:Sc()?jr.node:ka()?jr.browser:jr.unknown}function u5(){var r;try{return Js()&&typeof Wt<"u"&&typeof(Wt==null?void 0:Wt.Application)<"u"?(r=Wt.Application)==null?void 0:r.applicationId:void 0}catch{return}}function l5(r,e){let t=Na.parse(r);return t=f0(f0({},t),e),r=Na.stringify(t),r}function Ig(){return Yp()||{name:"",description:"",url:"",icons:[""]}}function d5(){if(Wa()===jr.reactNative&&typeof Wt<"u"&&typeof(Wt==null?void 0:Wt.Platform)<"u"){const{OS:t,Version:i}=Wt.Platform;return[t,i].join("-")}const r=v2();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function p5(){var r;const e=Wa();return e===jr.browser?[e,((r=Vp())==null?void 0:r.host)||"unknown"].join(":"):e}function xg(r,e,t){const i=d5(),s=p5();return[[r,e].join("-"),[h5,t].join("-"),i,s].join("/")}function g5({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:s,projectId:o,useOnCloseEvent:f,bundleId:h}){const p=t.split("?"),l=xg(r,e,i),m={auth:s,ua:l,projectId:o,useOnCloseEvent:f||void 0,origin:h||void 0},_=l5(p[1]||"",m);return p[0]+"?"+_}function ns(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Pg(r){return Object.fromEntries(r.entries())}function Mg(r){return new Map(Object.entries(r))}function rs(r=be.FIVE_MINUTES,e){const t=be.toMiliseconds(r||be.FIVE_MINUTES);let i,s,o;return{resolve:f=>{o&&i&&(clearTimeout(o),i(f))},reject:f=>{o&&s&&(clearTimeout(o),s(f))},done:()=>new Promise((f,h)=>{o=setTimeout(()=>{h(new Error(e))},t),i=f,s=h})}}function Ks(r,e,t){return new Promise(async(i,s)=>{const o=setTimeout(()=>s(new Error(t)),e);try{const f=await r;i(f)}catch(f){s(f)}clearTimeout(o)})}function Ag(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function b5(r){return Ag("topic",r)}function v5(r){return Ag("id",r)}function Og(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function rr(r,e){return be.fromMiliseconds(Date.now()+be.toMiliseconds(r))}function wn(r){return Date.now()>=be.toMiliseconds(r)}function ht(r,e){return`${r}${e?`:${e}`:""}`}function fc(r=[],e=[]){return[...new Set([...r,...e])]}async function m5({id:r,topic:e,wcDeepLink:t}){var i;try{if(!t)return;const s=typeof t=="string"?JSON.parse(t):t,o=s==null?void 0:s.href;if(typeof o!="string")return;const f=y5(o,r,e),h=Wa();if(h===jr.browser){if(!((i=Ba())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}f.startsWith("https://")||f.startsWith("http://")?window.open(f,"_blank","noreferrer noopener"):window.open(f,_5()?"_blank":"_self","noreferrer noopener")}else h===jr.reactNative&&typeof(Wt==null?void 0:Wt.Linking)<"u"&&await Wt.Linking.openURL(f)}catch(s){console.error(s)}}function y5(r,e,t){const i=`requestId=${e}&sessionTopic=${t}`;r.endsWith("/")&&(r=r.slice(0,-1));let s=`${r}`;if(r.startsWith("https://t.me")){const o=r.includes("?")?"&startapp=":"?startapp=";s=`${s}${o}${E5(i,!0)}`}else s=`${s}/wc?${i}`;return s}async function w5(r,e){let t="";try{if(ka()&&(t=localStorage.getItem(e),t))return t;t=await r.getItem(e)}catch(i){console.error(i)}return t}function h0(r,e){if(!r.includes(e))return null;const t=r.split(/([&,?,=])/),i=t.indexOf(e);return t[i+2]}function u0(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function wu(){return typeof _i<"u"&&n5.IS_VITEST==="true"}function _5(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function E5(r,e=!1){const t=ai.from(r).toString("base64");return e?t.replace(/[=]/g,""):t}function Rg(r){return ai.from(r,"base64").toString("utf-8")}const S5="https://rpc.walletconnect.org/v1";async function I5(r,e,t,i,s,o){switch(t.t){case"eip191":return x5(r,e,t.s);case"eip1271":return await P5(r,e,t.s,i,s,o);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}function x5(r,e,t){return o2(jp(e),t).toLowerCase()===r.toLowerCase()}async function P5(r,e,t,i,s,o){const f=Hs(i);if(!f.namespace||!f.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${i}`);try{const h="0x1626ba7e",p="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",m=t.substring(2),_=jp(e).substring(2),P=h+_+p+l+m,x=await fetch(`${o||S5}/?chainId=${i}&projectId=${s}`,{method:"POST",body:JSON.stringify({id:M5(),jsonrpc:"2.0",method:"eth_call",params:[{to:r,data:P},"latest"]})}),{result:T}=await x.json();return T?T.slice(0,h.length).toLowerCase()===h.toLowerCase():!1}catch(h){return console.error("isValidEip1271Signature: ",h),!1}}function M5(){return Date.now()+Math.floor(Math.random()*1e3)}var A5=Object.defineProperty,O5=Object.defineProperties,R5=Object.getOwnPropertyDescriptors,l0=Object.getOwnPropertySymbols,T5=Object.prototype.hasOwnProperty,C5=Object.prototype.propertyIsEnumerable,d0=(r,e,t)=>e in r?A5(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,N5=(r,e)=>{for(var t in e||(e={}))T5.call(e,t)&&d0(r,t,e[t]);if(l0)for(var t of l0(e))C5.call(e,t)&&d0(r,t,e[t]);return r},$5=(r,e)=>O5(r,R5(e));const L5="did:pkh:",_u=r=>r==null?void 0:r.split(":"),D5=r=>{const e=r&&_u(r);if(e)return r.includes(L5)?e[3]:e[1]},Vh=r=>{const e=r&&_u(r);if(e)return e[2]+":"+e[3]},Ic=r=>{const e=r&&_u(r);if(e)return e.pop()};async function p0(r){const{cacao:e,projectId:t}=r,{s:i,p:s}=e,o=Tg(s,s.iss),f=Ic(s.iss);return await I5(f,o,i,Vh(s.iss),t)}const Tg=(r,e)=>{const t=`${r.domain} wants you to sign in with your Ethereum account:`,i=Ic(e);if(!r.aud&&!r.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=r.statement||void 0;const o=`URI: ${r.aud||r.uri}`,f=`Version: ${r.version}`,h=`Chain ID: ${D5(e)}`,p=`Nonce: ${r.nonce}`,l=`Issued At: ${r.iat}`,m=r.exp?`Expiration Time: ${r.exp}`:void 0,_=r.nbf?`Not Before: ${r.nbf}`:void 0,P=r.requestId?`Request ID: ${r.requestId}`:void 0,x=r.resources?`Resources:${r.resources.map(j=>`
|
|
16
16
|
- ${j}`).join("")}`:void 0,T=hc(r.resources);if(T){const j=$a(T);s=k5(s,j)}return[t,i,"",s,"",o,f,h,p,l,m,_,P,x].filter(j=>j!=null).join(`
|
|
17
17
|
`)};function q5(r){return ai.from(JSON.stringify(r)).toString("base64")}function U5(r){return JSON.parse(ai.from(r,"base64").toString("utf-8"))}function cs(r){if(!r)throw new Error("No recap provided, value is undefined");if(!r.att)throw new Error("No `att` property found");const e=Object.keys(r.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(t=>{const i=r.att[t];if(Array.isArray(i))throw new Error(`Resource must be an object: ${t}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(i).forEach(s=>{const o=i[s];if(!Array.isArray(o))throw new Error(`Ability limits ${s} must be an array of objects, found: ${o}`);if(!o.length)throw new Error(`Value of ${s} is empty array, must be an array with objects`);o.forEach(f=>{if(typeof f!="object")throw new Error(`Ability limits (${s}) must be an array of objects, found: ${f}`)})})})}function z5(r,e,t,i={}){return t==null||t.sort((s,o)=>s.localeCompare(o)),{att:{[r]:B5(e,t,i)}}}function B5(r,e,t={}){e=e==null?void 0:e.sort((s,o)=>s.localeCompare(o));const i=e.map(s=>({[`${r}/${s}`]:[t]}));return Object.assign({},...i)}function Cg(r){return cs(r),`urn:recap:${q5(r).replace(/=/g,"")}`}function $a(r){const e=U5(r.replace("urn:recap:",""));return cs(e),e}function F5(r,e,t){const i=z5(r,e,t);return Cg(i)}function H5(r){return r&&r.includes("urn:recap:")}function K5(r,e){const t=$a(r),i=$a(e),s=j5(t,i);return Cg(s)}function j5(r,e){cs(r),cs(e);const t=Object.keys(r.att).concat(Object.keys(e.att)).sort((s,o)=>s.localeCompare(o)),i={att:{}};return t.forEach(s=>{var o,f;Object.keys(((o=r.att)==null?void 0:o[s])||{}).concat(Object.keys(((f=e.att)==null?void 0:f[s])||{})).sort((h,p)=>h.localeCompare(p)).forEach(h=>{var p,l;i.att[s]=$5(N5({},i.att[s]),{[h]:((p=r.att[s])==null?void 0:p[h])||((l=e.att[s])==null?void 0:l[h])})})}),i}function k5(r="",e){cs(e);const t="I further authorize the stated URI to perform the following actions on my behalf: ";if(r.includes(t))return r;const i=[];let s=0;Object.keys(e.att).forEach(h=>{const p=Object.keys(e.att[h]).map(_=>({ability:_.split("/")[0],action:_.split("/")[1]}));p.sort((_,P)=>_.action.localeCompare(P.action));const l={};p.forEach(_=>{l[_.ability]||(l[_.ability]=[]),l[_.ability].push(_.action)});const m=Object.keys(l).map(_=>(s++,`(${s}) '${_}': '${l[_].join("', '")}' for '${h}'.`));i.push(m.join(", ").replace(".,","."))});const o=i.join(" "),f=`${t}${o}`;return`${r?r+" ":""}${f}`}function g0(r){var e;const t=$a(r);cs(t);const i=(e=t.att)==null?void 0:e.eip155;return i?Object.keys(i).map(s=>s.split("/")[1]):[]}function b0(r){const e=$a(r);cs(e);const t=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(s=>{var o;(o=s==null?void 0:s[0])!=null&&o.chains&&t.push(s[0].chains)})}),[...new Set(t.flat())]}function hc(r){if(!r)return;const e=r==null?void 0:r[r.length-1];return H5(e)?e:void 0}const Ng="base10",xr="base16",En="base64pad",wa="base64url",Ga="utf8",$g=0,sn=1,Va=2,W5=0,v0=1,Aa=12,Eu=32;function G5(){const r=du.generateKeyPair();return{privateKey:kr(r.secretKey,xr),publicKey:kr(r.publicKey,xr)}}function Yh(){const r=xn.randomBytes(Eu);return kr(r,xr)}function V5(r,e){const t=du.sharedKey(si(r,xr),si(e,xr),!0),i=new G_(Ha.SHA256,t).expand(Eu);return kr(i,xr)}function uc(r){const e=Ha.hash(si(r,xr));return kr(e,xr)}function rn(r){const e=Ha.hash(si(r,Ga));return kr(e,xr)}function Lg(r){return si(`${r}`,Ng)}function fs(r){return Number(kr(r,Ng))}function Y5(r){const e=Lg(typeof r.type<"u"?r.type:$g);if(fs(e)===sn&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?si(r.senderPublicKey,xr):void 0,i=typeof r.iv<"u"?si(r.iv,xr):xn.randomBytes(Aa),s=new uu.ChaCha20Poly1305(si(r.symKey,xr)).seal(i,si(r.message,Ga));return Dg({type:e,sealed:s,iv:i,senderPublicKey:t,encoding:r.encoding})}function J5(r,e){const t=Lg(Va),i=xn.randomBytes(Aa),s=si(r,Ga);return Dg({type:t,sealed:s,iv:i,encoding:e})}function X5(r){const e=new uu.ChaCha20Poly1305(si(r.symKey,xr)),{sealed:t,iv:i}=La({encoded:r.encoded,encoding:r==null?void 0:r.encoding}),s=e.open(i,t);if(s===null)throw new Error("Failed to decrypt");return kr(s,Ga)}function Z5(r,e){const{sealed:t}=La({encoded:r,encoding:e});return kr(t,Ga)}function Dg(r){const{encoding:e=En}=r;if(fs(r.type)===Va)return kr(gh([r.type,r.sealed]),e);if(fs(r.type)===sn){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return kr(gh([r.type,r.senderPublicKey,r.iv,r.sealed]),e)}return kr(gh([r.type,r.iv,r.sealed]),e)}function La(r){const{encoded:e,encoding:t=En}=r,i=si(e,t),s=i.slice(W5,v0),o=v0;if(fs(s)===sn){const l=o+Eu,m=l+Aa,_=i.slice(o,l),P=i.slice(l,m),x=i.slice(m);return{type:s,sealed:x,iv:P,senderPublicKey:_}}if(fs(s)===Va){const l=i.slice(o),m=xn.randomBytes(Aa);return{type:s,sealed:l,iv:m}}const f=o+Aa,h=i.slice(o,f),p=i.slice(f);return{type:s,sealed:p,iv:h}}function Q5(r,e){const t=La({encoded:r,encoding:e==null?void 0:e.encoding});return qg({type:fs(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?kr(t.senderPublicKey,xr):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function qg(r){const e=(r==null?void 0:r.type)||$g;if(e===sn){if(typeof(r==null?void 0:r.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(r==null?void 0:r.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r==null?void 0:r.senderPublicKey,receiverPublicKey:r==null?void 0:r.receiverPublicKey}}function m0(r){return r.type===sn&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}function y0(r){return r.type===Va}function e4(r){return new ug.ec("p256").keyFromPublic({x:ai.from(r.x,"base64").toString("hex"),y:ai.from(r.y,"base64").toString("hex")},"hex")}function t4(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");const t=e.length%4;return t>0&&(e+="=".repeat(4-t)),e}function r4(r){return ai.from(t4(r),"base64")}function i4(r,e){const[t,i,s]=r.split("."),o=r4(s);if(o.length!==64)throw new Error("Invalid signature length");const f=o.slice(0,32).toString("hex"),h=o.slice(32,64).toString("hex"),p=`${t}.${i}`,l=new Ha.SHA256().update(ai.from(p)).digest(),m=e4(e),_=ai.from(l).toString("hex");if(!m.verify(_,{r:f,s:h}))throw new Error("Invalid signature");return Gh(r).payload}const n4="irn";function Jh(r){return(r==null?void 0:r.relay)||{protocol:n4}}function Pa(r){const e=i5[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var s4=Object.defineProperty,a4=Object.defineProperties,o4=Object.getOwnPropertyDescriptors,w0=Object.getOwnPropertySymbols,c4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,_0=(r,e,t)=>e in r?s4(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E0=(r,e)=>{for(var t in e||(e={}))c4.call(e,t)&&_0(r,t,e[t]);if(w0)for(var t of w0(e))f4.call(e,t)&&_0(r,t,e[t]);return r},h4=(r,e)=>a4(r,o4(e));function u4(r,e="-"){const t={},i="relay"+e;return Object.keys(r).forEach(s=>{if(s.startsWith(i)){const o=s.replace(i,""),f=r[s];t[o]=f}}),t}function S0(r){if(!r.includes("wc:")){const p=Rg(r);p!=null&&p.includes("wc:")&&(r=p)}r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,i=r.substring(0,e),s=r.substring(e+1,t).split("@"),o=typeof t<"u"?r.substring(t):"",f=Na.parse(o),h=typeof f.methods=="string"?f.methods.split(","):void 0;return{protocol:i,topic:l4(s[0]),version:parseInt(s[1],10),symKey:f.symKey,relay:u4(f),methods:h,expiryTimestamp:f.expiryTimestamp?parseInt(f.expiryTimestamp,10):void 0}}function l4(r){return r.startsWith("//")?r.substring(2):r}function d4(r,e="-"){const t="relay",i={};return Object.keys(r).forEach(s=>{const o=t+e+s;r[s]&&(i[o]=r[s])}),i}function I0(r){return`${r.protocol}:${r.topic}@${r.version}?`+Na.stringify(E0(h4(E0({symKey:r.symKey},d4(r.relay)),{expiryTimestamp:r.expiryTimestamp}),r.methods?{methods:r.methods.join(",")}:{}))}function rc(r,e,t){return`${r}?wc_ev=${t}&topic=${e}`}function Xs(r){const e=[];return r.forEach(t=>{const[i,s]=t.split(":");e.push(`${i}:${s}`)}),e}function p4(r){const e=[];return Object.values(r).forEach(t=>{e.push(...Xs(t.accounts))}),e}function g4(r,e){const t=[];return Object.values(r).forEach(i=>{Xs(i.accounts).includes(e)&&t.push(...i.methods)}),t}function b4(r,e){const t=[];return Object.values(r).forEach(i=>{Xs(i.accounts).includes(e)&&t.push(...i.events)}),t}function Su(r){return r.includes(":")}function Ma(r){return Su(r)?r.split(":")[0]:r}function v4(r){const e={};return r==null||r.forEach(t=>{const[i,s]=t.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(t),e[i].chains.push(`${i}:${s}`)}),e}function x0(r,e){e=e.map(i=>i.replace("did:pkh:",""));const t=v4(e);for(const[i,s]of Object.entries(t))s.methods?s.methods=fc(s.methods,r):s.methods=r,s.events=["chainChanged","accountsChanged"];return t}const m4={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},y4={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ge(r,e){const{message:t,code:i}=y4[r];return{message:e?`${t} ${e}`:t,code:i}}function St(r,e){const{message:t,code:i}=m4[r];return{message:e?`${t} ${e}`:t,code:i}}function zi(r,e){return!!Array.isArray(r)}function Da(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function $r(r){return typeof r>"u"}function Xt(r,e){return e&&$r(r)?!0:typeof r=="string"&&!!r.trim().length}function Iu(r,e){return typeof r=="number"&&!isNaN(r)}function w4(r,e){const{requiredNamespaces:t}=e,i=Object.keys(r.namespaces),s=Object.keys(t);let o=!0;return ns(s,i)?(i.forEach(f=>{const{accounts:h,methods:p,events:l}=r.namespaces[f],m=Xs(h),_=t[f];(!ns(Sg(f,_),m)||!ns(_.methods,p)||!ns(_.events,l))&&(o=!1)}),o):!1}function xc(r){return Xt(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function _4(r){if(Xt(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&xc(t)}}return!1}function E4(r){function e(t){try{return typeof new URL(t)<"u"}catch{return!1}}try{if(Xt(r,!1)){if(e(r))return!0;const t=Rg(r);return e(t)}}catch{}return!1}function S4(r){var e;return(e=r==null?void 0:r.proposer)==null?void 0:e.publicKey}function I4(r){return r==null?void 0:r.topic}function x4(r,e){let t=null;return Xt(r==null?void 0:r.publicKey,!1)||(t=ge("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function P0(r){let e=!0;return zi(r)?r.length&&(e=r.every(t=>Xt(t,!1))):e=!1,e}function P4(r,e,t){let i=null;return zi(e)&&e.length?e.forEach(s=>{i||xc(s)||(i=St("UNSUPPORTED_CHAINS",`${t}, chain ${s} should be a string and conform to "namespace:chainId" format`))}):xc(r)||(i=St("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function M4(r,e,t){let i=null;return Object.entries(r).forEach(([s,o])=>{if(i)return;const f=P4(s,Sg(s,o),`${e} ${t}`);f&&(i=f)}),i}function A4(r,e){let t=null;return zi(r)?r.forEach(i=>{t||_4(i)||(t=St("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):t=St("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function O4(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const s=A4(i==null?void 0:i.accounts,`${e} namespace`);s&&(t=s)}),t}function R4(r,e){let t=null;return P0(r==null?void 0:r.methods)?P0(r==null?void 0:r.events)||(t=St("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=St("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function Ug(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const s=R4(i,`${e}, namespace`);s&&(t=s)}),t}function T4(r,e,t){let i=null;if(r&&Da(r)){const s=Ug(r,e);s&&(i=s);const o=M4(r,e,t);o&&(i=o)}else i=ge("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return i}function _h(r,e){let t=null;if(r&&Da(r)){const i=Ug(r,e);i&&(t=i);const s=O4(r,e);s&&(t=s)}else t=ge("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function zg(r){return Xt(r.protocol,!0)}function C4(r,e){let t=!1;return r?r&&zi(r)&&r.length&&r.forEach(i=>{t=zg(i)}):t=!0,t}function N4(r){return typeof r=="number"}function Nr(r){return typeof r<"u"&&typeof r!==null}function $4(r){return!(!r||typeof r!="object"||!r.code||!Iu(r.code)||!r.message||!Xt(r.message,!1))}function L4(r){return!($r(r)||!Xt(r.method,!1))}function D4(r){return!($r(r)||$r(r.result)&&$r(r.error)||!Iu(r.id)||!Xt(r.jsonrpc,!1))}function q4(r){return!($r(r)||!Xt(r.name,!1))}function M0(r,e){return!(!xc(e)||!p4(r).includes(e))}function U4(r,e,t){return Xt(t,!1)?g4(r,e).includes(t):!1}function z4(r,e,t){return Xt(t,!1)?b4(r,e).includes(t):!1}function A0(r,e,t){let i=null;const s=B4(r),o=F4(e),f=Object.keys(s),h=Object.keys(o),p=O0(Object.keys(r)),l=O0(Object.keys(e)),m=p.filter(_=>!l.includes(_));return m.length&&(i=ge("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces.
|
|
18
18
|
Required: ${m.toString()}
|
|
@@ -52,4 +52,4 @@ __p += '`),vt&&(ue+=`' +
|
|
|
52
52
|
function print() { __p += __j.call(arguments, '') }
|
|
53
53
|
`:`;
|
|
54
54
|
`)+ue+`return __p
|
|
55
|
-
}`;var nt=Od(function(){return mt(R,Oe+"return "+ue).apply(i,z)});if(nt.source=ue,eh(nt))throw nt;return nt}function o6(n){return wt(n).toLowerCase()}function c6(n){return wt(n).toUpperCase()}function f6(n,a,c){if(n=wt(n),n&&(c||a===i))return Uu(n);if(!n||!(a=Br(a)))return n;var g=di(n),S=di(a),R=zu(g,S),z=Bu(g,S)+1;return mn(g,R,z).join("")}function h6(n,a,c){if(n=wt(n),n&&(c||a===i))return n.slice(0,Hu(n)+1);if(!n||!(a=Br(a)))return n;var g=di(n),S=Bu(g,di(a))+1;return mn(g,0,S).join("")}function u6(n,a,c){if(n=wt(n),n&&(c||a===i))return n.replace(Ye,"");if(!n||!(a=Br(a)))return n;var g=di(n),S=zu(g,di(a));return mn(g,S).join("")}function l6(n,a){var c=$,g=u;if(Kt(a)){var S="separator"in a?a.separator:S;c="length"in a?it(a.length):c,g="omission"in a?Br(a.omission):g}n=wt(n);var R=n.length;if(Es(n)){var z=di(n);R=z.length}if(c>=R)return n;var k=c-Ss(g);if(k<1)return g;var Z=z?mn(z,0,k).join(""):n.slice(0,k);if(S===i)return Z+g;if(z&&(k+=Z.length-k),th(S)){if(n.slice(k).search(S)){var se,ae=Z;for(S.global||(S=vf(S.source,wt(pr.exec(S))+"g")),S.lastIndex=0;se=S.exec(ae);)var ue=se.index;Z=Z.slice(0,ue===i?k:ue)}}else if(n.indexOf(Br(S),k)!=k){var ve=Z.lastIndexOf(S);ve>-1&&(Z=Z.slice(0,ve))}return Z+g}function d6(n){return n=wt(n),n&&Nt.test(n)?n.replace(It,H1):n}var p6=Rs(function(n,a,c){return n+(c?" ":"")+a.toUpperCase()}),nh=Rl("toUpperCase");function Ad(n,a,c){return n=wt(n),a=c?i:a,a===i?q1(n)?k1(n):A1(n):n.match(a)||[]}var Od=ot(function(n,a){try{return ir(n,i,a)}catch(c){return eh(c)?c:new We(c)}}),g6=Vi(function(n,a){return Yr(a,function(c){c=Ci(c),Wi(n,c,Zf(n[c],n))}),n});function b6(n){var a=n==null?0:n.length,c=$e();return n=a?Bt(n,function(g){if(typeof g[1]!="function")throw new Jr(h);return[c(g[0]),g[1]]}):[],ot(function(g){for(var S=-1;++S<a;){var R=n[S];if(ir(R[0],this,g))return ir(R[1],this,g)}})}function v6(n){return Hb(Zr(n,P))}function sh(n){return function(){return n}}function m6(n,a){return n==null||n!==n?a:n}var y6=Cl(),w6=Cl(!0);function Tr(n){return n}function ah(n){return cl(typeof n=="function"?n:Zr(n,P))}function _6(n){return hl(Zr(n,P))}function E6(n,a){return ul(n,Zr(a,P))}var S6=ot(function(n,a){return function(c){return ua(c,n,a)}}),I6=ot(function(n,a){return function(c){return ua(n,c,a)}});function oh(n,a,c){var g=nr(a),S=Do(a,g);c==null&&!(Kt(a)&&(S.length||!g.length))&&(c=a,a=n,n=this,S=Do(a,nr(a)));var R=!(Kt(c)&&"chain"in c)||!!c.chain,z=Ji(n);return Yr(S,function(k){var Z=a[k];n[k]=Z,z&&(n.prototype[k]=function(){var se=this.__chain__;if(R||se){var ae=n(this.__wrapped__),ue=ae.__actions__=Ar(this.__actions__);return ue.push({func:Z,args:arguments,thisArg:n}),ae.__chain__=se,ae}return Z.apply(n,ln([this.value()],arguments))})}),n}function x6(){return bt._===this&&(bt._=X1),this}function ch(){}function P6(n){return n=it(n),ot(function(a){return ll(a,n)})}var M6=zf(Bt),A6=zf(Nu),O6=zf(hf);function Rd(n){return Wf(n)?uf(Ci(n)):sv(n)}function R6(n){return function(a){return n==null?i:Gn(n,a)}}var T6=$l(),C6=$l(!0);function fh(){return[]}function hh(){return!1}function N6(){return{}}function $6(){return""}function L6(){return!0}function D6(n,a){if(n=it(n),n<1||n>I)return[];var c=ne,g=gr(n,ne);a=$e(a),n-=ne;for(var S=pf(g,a);++c<n;)a(c);return S}function q6(n){return Xe(n)?Bt(n,Ci):Fr(n)?[n]:Ar(Jl(wt(n)))}function U6(n){var a=++Y1;return wt(n)+a}var z6=Ho(function(n,a){return n+a},0),B6=Bf("ceil"),F6=Ho(function(n,a){return n/a},1),H6=Bf("floor");function K6(n){return n&&n.length?Lo(n,Tr,xf):i}function j6(n,a){return n&&n.length?Lo(n,$e(a,2),xf):i}function k6(n){return Du(n,Tr)}function W6(n,a){return Du(n,$e(a,2))}function G6(n){return n&&n.length?Lo(n,Tr,Of):i}function V6(n,a){return n&&n.length?Lo(n,$e(a,2),Of):i}var Y6=Ho(function(n,a){return n*a},1),J6=Bf("round"),X6=Ho(function(n,a){return n-a},0);function Z6(n){return n&&n.length?df(n,Tr):0}function Q6(n,a){return n&&n.length?df(n,$e(a,2)):0}return A.after=_y,A.ary=od,A.assign=cw,A.assignIn=_d,A.assignInWith=tc,A.assignWith=fw,A.at=hw,A.before=cd,A.bind=Zf,A.bindAll=g6,A.bindKey=fd,A.castArray=Ny,A.chain=nd,A.chunk=Hv,A.compact=Kv,A.concat=jv,A.cond=b6,A.conforms=v6,A.constant=sh,A.countBy=Zm,A.create=uw,A.curry=hd,A.curryRight=ud,A.debounce=ld,A.defaults=lw,A.defaultsDeep=dw,A.defer=Ey,A.delay=Sy,A.difference=kv,A.differenceBy=Wv,A.differenceWith=Gv,A.drop=Vv,A.dropRight=Yv,A.dropRightWhile=Jv,A.dropWhile=Xv,A.fill=Zv,A.filter=ey,A.flatMap=iy,A.flatMapDeep=ny,A.flatMapDepth=sy,A.flatten=ed,A.flattenDeep=Qv,A.flattenDepth=em,A.flip=Iy,A.flow=y6,A.flowRight=w6,A.fromPairs=tm,A.functions=ww,A.functionsIn=_w,A.groupBy=ay,A.initial=im,A.intersection=nm,A.intersectionBy=sm,A.intersectionWith=am,A.invert=Sw,A.invertBy=Iw,A.invokeMap=cy,A.iteratee=ah,A.keyBy=fy,A.keys=nr,A.keysIn=Rr,A.map=Yo,A.mapKeys=Pw,A.mapValues=Mw,A.matches=_6,A.matchesProperty=E6,A.memoize=Xo,A.merge=Aw,A.mergeWith=Ed,A.method=S6,A.methodOf=I6,A.mixin=oh,A.negate=Zo,A.nthArg=P6,A.omit=Ow,A.omitBy=Rw,A.once=xy,A.orderBy=hy,A.over=M6,A.overArgs=Py,A.overEvery=A6,A.overSome=O6,A.partial=Qf,A.partialRight=dd,A.partition=uy,A.pick=Tw,A.pickBy=Sd,A.property=Rd,A.propertyOf=R6,A.pull=hm,A.pullAll=rd,A.pullAllBy=um,A.pullAllWith=lm,A.pullAt=dm,A.range=T6,A.rangeRight=C6,A.rearg=My,A.reject=py,A.remove=pm,A.rest=Ay,A.reverse=Jf,A.sampleSize=by,A.set=Nw,A.setWith=$w,A.shuffle=vy,A.slice=gm,A.sortBy=wy,A.sortedUniq=Em,A.sortedUniqBy=Sm,A.split=i6,A.spread=Oy,A.tail=Im,A.take=xm,A.takeRight=Pm,A.takeRightWhile=Mm,A.takeWhile=Am,A.tap=Km,A.throttle=Ry,A.thru=Vo,A.toArray=md,A.toPairs=Id,A.toPairsIn=xd,A.toPath=q6,A.toPlainObject=wd,A.transform=Lw,A.unary=Ty,A.union=Om,A.unionBy=Rm,A.unionWith=Tm,A.uniq=Cm,A.uniqBy=Nm,A.uniqWith=$m,A.unset=Dw,A.unzip=Xf,A.unzipWith=id,A.update=qw,A.updateWith=Uw,A.values=Ns,A.valuesIn=zw,A.without=Lm,A.words=Ad,A.wrap=Cy,A.xor=Dm,A.xorBy=qm,A.xorWith=Um,A.zip=zm,A.zipObject=Bm,A.zipObjectDeep=Fm,A.zipWith=Hm,A.entries=Id,A.entriesIn=xd,A.extend=_d,A.extendWith=tc,oh(A,A),A.add=z6,A.attempt=Od,A.camelCase=Kw,A.capitalize=Pd,A.ceil=B6,A.clamp=Bw,A.clone=$y,A.cloneDeep=Dy,A.cloneDeepWith=qy,A.cloneWith=Ly,A.conformsTo=Uy,A.deburr=Md,A.defaultTo=m6,A.divide=F6,A.endsWith=jw,A.eq=gi,A.escape=kw,A.escapeRegExp=Ww,A.every=Qm,A.find=ty,A.findIndex=Zl,A.findKey=pw,A.findLast=ry,A.findLastIndex=Ql,A.findLastKey=gw,A.floor=H6,A.forEach=sd,A.forEachRight=ad,A.forIn=bw,A.forInRight=vw,A.forOwn=mw,A.forOwnRight=yw,A.get=rh,A.gt=zy,A.gte=By,A.has=Ew,A.hasIn=ih,A.head=td,A.identity=Tr,A.includes=oy,A.indexOf=rm,A.inRange=Fw,A.invoke=xw,A.isArguments=Jn,A.isArray=Xe,A.isArrayBuffer=Fy,A.isArrayLike=Or,A.isArrayLikeObject=Yt,A.isBoolean=Hy,A.isBuffer=yn,A.isDate=Ky,A.isElement=jy,A.isEmpty=ky,A.isEqual=Wy,A.isEqualWith=Gy,A.isError=eh,A.isFinite=Vy,A.isFunction=Ji,A.isInteger=pd,A.isLength=Qo,A.isMap=gd,A.isMatch=Yy,A.isMatchWith=Jy,A.isNaN=Xy,A.isNative=Zy,A.isNil=ew,A.isNull=Qy,A.isNumber=bd,A.isObject=Kt,A.isObjectLike=jt,A.isPlainObject=va,A.isRegExp=th,A.isSafeInteger=tw,A.isSet=vd,A.isString=ec,A.isSymbol=Fr,A.isTypedArray=Cs,A.isUndefined=rw,A.isWeakMap=iw,A.isWeakSet=nw,A.join=om,A.kebabCase=Gw,A.last=ei,A.lastIndexOf=cm,A.lowerCase=Vw,A.lowerFirst=Yw,A.lt=sw,A.lte=aw,A.max=K6,A.maxBy=j6,A.mean=k6,A.meanBy=W6,A.min=G6,A.minBy=V6,A.stubArray=fh,A.stubFalse=hh,A.stubObject=N6,A.stubString=$6,A.stubTrue=L6,A.multiply=Y6,A.nth=fm,A.noConflict=x6,A.noop=ch,A.now=Jo,A.pad=Jw,A.padEnd=Xw,A.padStart=Zw,A.parseInt=Qw,A.random=Hw,A.reduce=ly,A.reduceRight=dy,A.repeat=e6,A.replace=t6,A.result=Cw,A.round=J6,A.runInContext=Y,A.sample=gy,A.size=my,A.snakeCase=r6,A.some=yy,A.sortedIndex=bm,A.sortedIndexBy=vm,A.sortedIndexOf=mm,A.sortedLastIndex=ym,A.sortedLastIndexBy=wm,A.sortedLastIndexOf=_m,A.startCase=n6,A.startsWith=s6,A.subtract=X6,A.sum=Z6,A.sumBy=Q6,A.template=a6,A.times=D6,A.toFinite=Xi,A.toInteger=it,A.toLength=yd,A.toLower=o6,A.toNumber=ti,A.toSafeInteger=ow,A.toString=wt,A.toUpper=c6,A.trim=f6,A.trimEnd=h6,A.trimStart=u6,A.truncate=l6,A.unescape=d6,A.uniqueId=U6,A.upperCase=p6,A.upperFirst=nh,A.each=sd,A.eachRight=ad,A.first=td,oh(A,function(){var n={};return Ri(A,function(a,c){Et.call(A.prototype,c)||(n[c]=a)}),n}(),{chain:!1}),A.VERSION=s,Yr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){A[n].placeholder=A}),Yr(["drop","take"],function(n,a){dt.prototype[n]=function(c){c=c===i?1:tr(it(c),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=gr(c,g.__takeCount__):g.__views__.push({size:gr(c,ne),type:n+(g.__dir__<0?"Right":"")}),g},dt.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),Yr(["filter","map","takeWhile"],function(n,a){var c=a+1,g=c==E||c==L;dt.prototype[n]=function(S){var R=this.clone();return R.__iteratees__.push({iteratee:$e(S,3),type:c}),R.__filtered__=R.__filtered__||g,R}}),Yr(["head","last"],function(n,a){var c="take"+(a?"Right":"");dt.prototype[n]=function(){return this[c](1).value()[0]}}),Yr(["initial","tail"],function(n,a){var c="drop"+(a?"":"Right");dt.prototype[n]=function(){return this.__filtered__?new dt(this):this[c](1)}}),dt.prototype.compact=function(){return this.filter(Tr)},dt.prototype.find=function(n){return this.filter(n).head()},dt.prototype.findLast=function(n){return this.reverse().find(n)},dt.prototype.invokeMap=ot(function(n,a){return typeof n=="function"?new dt(this):this.map(function(c){return ua(c,n,a)})}),dt.prototype.reject=function(n){return this.filter(Zo($e(n)))},dt.prototype.slice=function(n,a){n=it(n);var c=this;return c.__filtered__&&(n>0||a<0)?new dt(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),a!==i&&(a=it(a),c=a<0?c.dropRight(-a):c.take(a-n)),c)},dt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},dt.prototype.toArray=function(){return this.take(ne)},Ri(dt.prototype,function(n,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),S=A[g?"take"+(a=="last"?"Right":""):a],R=g||/^find/.test(a);S&&(A.prototype[a]=function(){var z=this.__wrapped__,k=g?[1]:arguments,Z=z instanceof dt,se=k[0],ae=Z||Xe(z),ue=function(ft){var vt=S.apply(A,ln([ft],k));return g&&ve?vt[0]:vt};ae&&c&&typeof se=="function"&&se.length!=1&&(Z=ae=!1);var ve=this.__chain__,Oe=!!this.__actions__.length,Le=R&&!ve,nt=Z&&!Oe;if(!R&&ae){z=nt?z:new dt(this);var De=n.apply(z,k);return De.__actions__.push({func:Vo,args:[ue],thisArg:i}),new Xr(De,ve)}return Le&&nt?n.apply(this,k):(De=this.thru(ue),Le?g?De.value()[0]:De.value():De)})}),Yr(["pop","push","shift","sort","splice","unshift"],function(n){var a=wo[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",g=/^(?:pop|shift)$/.test(n);A.prototype[n]=function(){var S=arguments;if(g&&!this.__chain__){var R=this.value();return a.apply(Xe(R)?R:[],S)}return this[c](function(z){return a.apply(Xe(z)?z:[],S)})}}),Ri(dt.prototype,function(n,a){var c=A[a];if(c){var g=c.name+"";Et.call(Ms,g)||(Ms[g]=[]),Ms[g].push({name:a,func:c})}}),Ms[Fo(i,U).name]=[{name:"wrapper",func:i}],dt.prototype.clone=db,dt.prototype.reverse=pb,dt.prototype.value=gb,A.prototype.at=jm,A.prototype.chain=km,A.prototype.commit=Wm,A.prototype.next=Gm,A.prototype.plant=Ym,A.prototype.reverse=Jm,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=Xm,A.prototype.first=A.prototype.head,na&&(A.prototype[na]=Vm),A},Is=W1();Vt?((Vt.exports=Is)._=Is,At._=Is):bt._=Is}).call(Fp)})(Oc,Oc.exports);var dI=Oc.exports,pI=Object.defineProperty,gI=Object.defineProperties,bI=Object.getOwnPropertyDescriptors,wp=Object.getOwnPropertySymbols,vI=Object.prototype.hasOwnProperty,mI=Object.prototype.propertyIsEnumerable,_p=(r,e,t)=>e in r?pI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ep=(r,e)=>{for(var t in e||(e={}))vI.call(e,t)&&_p(r,t,e[t]);if(wp)for(var t of wp(e))mI.call(e,t)&&_p(r,t,e[t]);return r},Sp=(r,e)=>gI(r,bI(e));const yI={Accept:"application/json","Content-Type":"application/json"},wI="POST",Ip={headers:yI,method:wI},xp=10;let Hi=class{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new ci.EventEmitter,this.isAvailable=!1,this.registering=!1,!k0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=an(e),i=await(await Cd(this.url,Sp(Ep({},Ip),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!k0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,s)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),s(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return s(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=an({id:1,jsonrpc:"2.0",method:"test",params:[]});await Cd(e,Sp(Ep({},Ip),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?os(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),s=i.message||i.toString(),o=Yc(e,s);this.events.emit("payload",o)}parseError(e,t=this.url){return Yg(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>xp&&this.events.setMaxListeners(xp)}};const Pp="error",_I="wss://relay.walletconnect.org",EI="wc",SI="universal_provider",Mp=`${EI}@2:${SI}:`,y1="https://rpc.walletconnect.org/v1/",zs="generic",II=`${y1}bundler`,Ii={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var xI=Object.defineProperty,PI=Object.defineProperties,MI=Object.getOwnPropertyDescriptors,Ap=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,OI=Object.prototype.propertyIsEnumerable,Op=(r,e,t)=>e in r?xI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ac=(r,e)=>{for(var t in e||(e={}))AI.call(e,t)&&Op(r,t,e[t]);if(Ap)for(var t of Ap(e))OI.call(e,t)&&Op(r,t,e[t]);return r},RI=(r,e)=>PI(r,MI(e));function Ei(r,e,t){var i;const s=Hs(r);return((i=e.rpcMap)==null?void 0:i[s.reference])||`${y1}?chainId=${s.namespace}:${s.reference}&projectId=${t}`}function gs(r){return r.includes(":")?r.split(":")[1]:r}function w1(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function TI(r,e){const t=Object.keys(e.namespaces).filter(s=>s.includes(r));if(!t.length)return[];const i=[];return t.forEach(s=>{const o=e.namespaces[s].accounts;i.push(...o)}),i}function Ch(r={},e={}){const t=Rp(r),i=Rp(e);return dI.merge(t,i)}function Rp(r){var e,t,i,s;const o={};if(!Da(r))return o;for(const[f,h]of Object.entries(r)){const p=Su(f)?[f]:h.chains,l=h.methods||[],m=h.events||[],_=h.rpcMap||{},P=Ma(f);o[P]=RI(ac(ac({},o[P]),h),{chains:fc(p,(e=o[P])==null?void 0:e.chains),methods:fc(l,(t=o[P])==null?void 0:t.methods),events:fc(m,(i=o[P])==null?void 0:i.events),rpcMap:ac(ac({},_),(s=o[P])==null?void 0:s.rpcMap)})}return o}function CI(r){return r.includes(":")?r.split(":")[2]:r}function Tp(r){const e={};for(const[t,i]of Object.entries(r)){const s=i.methods||[],o=i.events||[],f=i.accounts||[],h=Su(t)?[t]:i.chains?i.chains:w1(i.accounts);e[t]={chains:h,methods:s,events:o,accounts:f}}return e}function Nh(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const _1={},_t=r=>_1[r],$h=(r,e)=>{_1[r]=e};class NI{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}var $I=Object.defineProperty,LI=Object.defineProperties,DI=Object.getOwnPropertyDescriptors,Cp=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,UI=Object.prototype.propertyIsEnumerable,Np=(r,e,t)=>e in r?$I(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$p=(r,e)=>{for(var t in e||(e={}))qI.call(e,t)&&Np(r,t,e[t]);if(Cp)for(var t of Cp(e))UI.call(e,t)&&Np(r,t,e[t]);return r},Lp=(r,e)=>LI(r,DI(e));class zI{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||Ei(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=parseInt(gs(t));e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let s=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const o=parseInt(s,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:s}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,s;const o=(i=(t=e.request)==null?void 0:t.params)==null?void 0:i[0];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const f=this.client.session.get(e.topic),h=((s=f==null?void 0:f.sessionProperties)==null?void 0:s.capabilities)||{};if(h!=null&&h[o])return h==null?void 0:h[o];const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:Lp($p({},f.sessionProperties||{}),{capabilities:Lp($p({},h||{}),{[o]:p})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return p}async getCallStatus(e){var t,i;const s=this.client.session.get(e.topic),o=(t=s.sessionProperties)==null?void 0:t.bundler_name;if(o){const h=this.getBundlerUrl(e.chainId,o);try{return await this.getUserOperationReceipt(h,e)}catch(p){console.warn("Failed to fetch call status from bundler",p,h)}}const f=(i=s.sessionProperties)==null?void 0:i.bundler_url;if(f)try{return await this.getUserOperationReceipt(f,e)}catch(h){console.warn("Failed to fetch call status from custom bundler",h,f)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;const s=new URL(e),o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Sn("eth_getUserOperationReceipt",[(i=t.request.params)==null?void 0:i[0]]))});if(!o.ok)throw new Error(`Failed to fetch user operation receipt - ${o.status}`);return await o.json()}getBundlerUrl(e,t){return`${II}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class BI{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class FI{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class HI{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const i=t||Ei(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new Si(new Hi(i,_t("disableProviderPing")))}}class KI{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),s=gs(t);e[s]=this.createHttpProvider(s,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class jI{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class kI{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class WI{constructor(e){this.name="near",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||Ei(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace);return typeof i>"u"?void 0:new Si(new Hi(i,_t("disableProviderPing")))}}class GI{constructor(e){this.name=zs,this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const i={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(s=>{const o=Hs(s);i[`${o.namespace}:${o.reference}`]=this.createHttpProvider(s)}),i}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}var VI=Object.defineProperty,YI=Object.defineProperties,JI=Object.getOwnPropertyDescriptors,Dp=Object.getOwnPropertySymbols,XI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable,qp=(r,e,t)=>e in r?VI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,oc=(r,e)=>{for(var t in e||(e={}))XI.call(e,t)&&qp(r,t,e[t]);if(Dp)for(var t of Dp(e))ZI.call(e,t)&&qp(r,t,e[t]);return r},Lh=(r,e)=>YI(r,JI(e));let QI=class E1{constructor(e){this.events=new cu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Ja(Gc({level:(e==null?void 0:e.logger)||Pp})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new E1(e);return await t.initialize(),t}async request(e,t,i){const[s,o]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:oc({},e),chainId:`${s}:${o}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,s){const o=new Date().getTime();this.request(e,i,s).then(f=>t(null,Vc(o,f))).catch(f=>t(f,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:St("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:i,response:s}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));const o=await s();if(this.session=o.session,this.session){const f=Tp(this.session.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces),this.onConnect()}return o}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:s}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await s().then(o=>{this.session=o;const f=Tp(o.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==m1)throw o;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,s]=this.validateChain(e),o=this.getProvider(i);o.name===zs?o.setDefaultChain(`${i}:${s}`,t):o.setDefaultChain(s,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(zi(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Tu.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Pp,relayUrl:this.providerOpts.relayUrl||_I,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>Ma(t)))];$h("client",this.client),$h("events",this.events),$h("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=TI(t,this.session),s=w1(i),o=Ch(this.namespaces,this.optionalNamespaces),f=Lh(oc({},o[t]),{accounts:i,chains:s});switch(t){case"eip155":this.rpcProviders[t]=new zI({namespace:f});break;case"algorand":this.rpcProviders[t]=new HI({namespace:f});break;case"solana":this.rpcProviders[t]=new BI({namespace:f});break;case"cosmos":this.rpcProviders[t]=new FI({namespace:f});break;case"polkadot":this.rpcProviders[t]=new NI({namespace:f});break;case"cip34":this.rpcProviders[t]=new KI({namespace:f});break;case"elrond":this.rpcProviders[t]=new jI({namespace:f});break;case"multiversx":this.rpcProviders[t]=new kI({namespace:f});break;case"near":this.rpcProviders[t]=new WI({namespace:f});break;default:this.rpcProviders[zs]?this.rpcProviders[zs].updateNamespace(f):this.rpcProviders[zs]=new GI({namespace:f})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const s=i.data;s&&zi(s)&&this.events.emit("accountsChanged",s.map(CI))}else if(i.name==="chainChanged"){const s=t.chainId,o=t.event.data,f=Ma(s),h=Nh(s)!==Nh(o)?`${f}:${Nh(o)}`:s;this.onChainChanged(h)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:s}=t,o=(i=this.client)==null?void 0:i.session.get(e);this.session=Lh(oc({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Lh(oc({},St("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ii.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[zs]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:s}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=s,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(f=>Ma(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const s=Ma(Object.keys(this.namespaces)[0]),o=this.rpcProviders[s].getDefaultChain();return[s,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[i,s]=this.validateChain(e);s&&(t||this.getProvider(i).setDefaultChain(s),this.namespaces[i]?this.namespaces[i].defaultChain=s:this.namespaces[`${i}:${s}`]?this.namespaces[`${i}:${s}`].defaultChain=s:this.namespaces[`${i}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Mp}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Mp}/${e}`)}};const ex=QI,tx="wc",rx="ethereum_provider",ix=`${tx}@2:${rx}:`,nx="https://rpc.walletconnect.org/v1/",su=["eth_sendTransaction","personal_sign"],sx=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],au=["chainChanged","accountsChanged"],ax=["chainChanged","accountsChanged","message","disconnect","connect"];var ox=Object.defineProperty,cx=Object.defineProperties,fx=Object.getOwnPropertyDescriptors,Up=Object.getOwnPropertySymbols,hx=Object.prototype.hasOwnProperty,ux=Object.prototype.propertyIsEnumerable,zp=(r,e,t)=>e in r?ox(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Bs=(r,e)=>{for(var t in e||(e={}))hx.call(e,t)&&zp(r,t,e[t]);if(Up)for(var t of Up(e))ux.call(e,t)&&zp(r,t,e[t]);return r},Dh=(r,e)=>cx(r,fx(e));function Rc(r){return Number(r[0].split(":")[1])}function cc(r){return`0x${r.toString(16)}`}function lx(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:s,events:o,optionalEvents:f,rpcMap:h}=r;if(!zi(e))throw new Error("Invalid chains");const p={chains:e,methods:i||su,events:o||au,rpcMap:Bs({},e.length?{[Rc(e)]:h[Rc(e)]}:{})},l=o==null?void 0:o.filter(x=>!au.includes(x)),m=i==null?void 0:i.filter(x=>!su.includes(x));if(!t&&!f&&!s&&!(l!=null&&l.length)&&!(m!=null&&m.length))return{required:e.length?p:void 0};const _=(l==null?void 0:l.length)&&(m==null?void 0:m.length)||!t,P={chains:[...new Set(_?p.chains.concat(t||[]):t)],methods:[...new Set(p.methods.concat(s!=null&&s.length?s:sx))],events:[...new Set(p.events.concat(f!=null&&f.length?f:ax))],rpcMap:h};return{required:e.length?p:void 0,optional:t.length?P:void 0}}class Cu{constructor(){this.events=new ci.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=ix,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new Cu;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,i){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=lx(this.rpc);try{const s=await new Promise(async(f,h)=>{var p;this.rpc.showQrModal&&((p=this.modal)==null||p.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),h(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Dh(Bs({namespaces:Bs({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{f(l)}).catch(l=>{h(new Error(l.message))})});if(!s)return;const o=a0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:cc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(o,f)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Dh(Bs({},e),{chains:this.rpc.chains}),t).then(p=>{o(p)}).catch(p=>{f(new Error(p.message))})}),s=i.session;if(s){const o=a0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:cc(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",cc(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Dh(Bs({},St("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",cc(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,s]=e.split(":");return{chainId:`${t}:${i}`,address:s}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const s=(t=e==null?void 0:e.chains)!=null?t:[],o=(i=e==null?void 0:e.optionalChains)!=null?i:[],f=s.concat(o);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const h=s.length?(e==null?void 0:e.methods)||su:[],p=s.length?(e==null?void 0:e.events)||au:[],l=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],_=(e==null?void 0:e.rpcMap)||this.buildRpcMap(f,e.projectId),P=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(x=>this.formatChainId(x)),optionalChains:o.map(x=>this.formatChainId(x)),methods:h,events:p,optionalMethods:l,optionalEvents:m,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:P,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(s=>{i[s]=this.getRpcUrl(s,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Rc(this.rpc.chains):Rc(this.rpc.optionalChains),this.signer=await ex.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:i}=await c2(()=>import("./index-DoA3dxJB.js").then(s=>s.i),__vite__mapDeps([0,1,2]));t=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Bs({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:s}=e;t&&zi(t)&&(this.rpc.chains=t.map(o=>this.formatChainId(o)),t.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)})),i&&zi(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(o=>this.formatChainId(o)),i.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${nx}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const Fx=Cu;export{Fx as EthereumProvider,ax as OPTIONAL_EVENTS,sx as OPTIONAL_METHODS,au as REQUIRED_EVENTS,su as REQUIRED_METHODS,Cu as default};
|
|
55
|
+
}`;var nt=Od(function(){return mt(R,Oe+"return "+ue).apply(i,z)});if(nt.source=ue,eh(nt))throw nt;return nt}function o6(n){return wt(n).toLowerCase()}function c6(n){return wt(n).toUpperCase()}function f6(n,a,c){if(n=wt(n),n&&(c||a===i))return Uu(n);if(!n||!(a=Br(a)))return n;var g=di(n),S=di(a),R=zu(g,S),z=Bu(g,S)+1;return mn(g,R,z).join("")}function h6(n,a,c){if(n=wt(n),n&&(c||a===i))return n.slice(0,Hu(n)+1);if(!n||!(a=Br(a)))return n;var g=di(n),S=Bu(g,di(a))+1;return mn(g,0,S).join("")}function u6(n,a,c){if(n=wt(n),n&&(c||a===i))return n.replace(Ye,"");if(!n||!(a=Br(a)))return n;var g=di(n),S=zu(g,di(a));return mn(g,S).join("")}function l6(n,a){var c=$,g=u;if(Kt(a)){var S="separator"in a?a.separator:S;c="length"in a?it(a.length):c,g="omission"in a?Br(a.omission):g}n=wt(n);var R=n.length;if(Es(n)){var z=di(n);R=z.length}if(c>=R)return n;var k=c-Ss(g);if(k<1)return g;var Z=z?mn(z,0,k).join(""):n.slice(0,k);if(S===i)return Z+g;if(z&&(k+=Z.length-k),th(S)){if(n.slice(k).search(S)){var se,ae=Z;for(S.global||(S=vf(S.source,wt(pr.exec(S))+"g")),S.lastIndex=0;se=S.exec(ae);)var ue=se.index;Z=Z.slice(0,ue===i?k:ue)}}else if(n.indexOf(Br(S),k)!=k){var ve=Z.lastIndexOf(S);ve>-1&&(Z=Z.slice(0,ve))}return Z+g}function d6(n){return n=wt(n),n&&Nt.test(n)?n.replace(It,H1):n}var p6=Rs(function(n,a,c){return n+(c?" ":"")+a.toUpperCase()}),nh=Rl("toUpperCase");function Ad(n,a,c){return n=wt(n),a=c?i:a,a===i?q1(n)?k1(n):A1(n):n.match(a)||[]}var Od=ot(function(n,a){try{return ir(n,i,a)}catch(c){return eh(c)?c:new We(c)}}),g6=Vi(function(n,a){return Yr(a,function(c){c=Ci(c),Wi(n,c,Zf(n[c],n))}),n});function b6(n){var a=n==null?0:n.length,c=$e();return n=a?Bt(n,function(g){if(typeof g[1]!="function")throw new Jr(h);return[c(g[0]),g[1]]}):[],ot(function(g){for(var S=-1;++S<a;){var R=n[S];if(ir(R[0],this,g))return ir(R[1],this,g)}})}function v6(n){return Hb(Zr(n,P))}function sh(n){return function(){return n}}function m6(n,a){return n==null||n!==n?a:n}var y6=Cl(),w6=Cl(!0);function Tr(n){return n}function ah(n){return cl(typeof n=="function"?n:Zr(n,P))}function _6(n){return hl(Zr(n,P))}function E6(n,a){return ul(n,Zr(a,P))}var S6=ot(function(n,a){return function(c){return ua(c,n,a)}}),I6=ot(function(n,a){return function(c){return ua(n,c,a)}});function oh(n,a,c){var g=nr(a),S=Do(a,g);c==null&&!(Kt(a)&&(S.length||!g.length))&&(c=a,a=n,n=this,S=Do(a,nr(a)));var R=!(Kt(c)&&"chain"in c)||!!c.chain,z=Ji(n);return Yr(S,function(k){var Z=a[k];n[k]=Z,z&&(n.prototype[k]=function(){var se=this.__chain__;if(R||se){var ae=n(this.__wrapped__),ue=ae.__actions__=Ar(this.__actions__);return ue.push({func:Z,args:arguments,thisArg:n}),ae.__chain__=se,ae}return Z.apply(n,ln([this.value()],arguments))})}),n}function x6(){return bt._===this&&(bt._=X1),this}function ch(){}function P6(n){return n=it(n),ot(function(a){return ll(a,n)})}var M6=zf(Bt),A6=zf(Nu),O6=zf(hf);function Rd(n){return Wf(n)?uf(Ci(n)):sv(n)}function R6(n){return function(a){return n==null?i:Gn(n,a)}}var T6=$l(),C6=$l(!0);function fh(){return[]}function hh(){return!1}function N6(){return{}}function $6(){return""}function L6(){return!0}function D6(n,a){if(n=it(n),n<1||n>I)return[];var c=ne,g=gr(n,ne);a=$e(a),n-=ne;for(var S=pf(g,a);++c<n;)a(c);return S}function q6(n){return Xe(n)?Bt(n,Ci):Fr(n)?[n]:Ar(Jl(wt(n)))}function U6(n){var a=++Y1;return wt(n)+a}var z6=Ho(function(n,a){return n+a},0),B6=Bf("ceil"),F6=Ho(function(n,a){return n/a},1),H6=Bf("floor");function K6(n){return n&&n.length?Lo(n,Tr,xf):i}function j6(n,a){return n&&n.length?Lo(n,$e(a,2),xf):i}function k6(n){return Du(n,Tr)}function W6(n,a){return Du(n,$e(a,2))}function G6(n){return n&&n.length?Lo(n,Tr,Of):i}function V6(n,a){return n&&n.length?Lo(n,$e(a,2),Of):i}var Y6=Ho(function(n,a){return n*a},1),J6=Bf("round"),X6=Ho(function(n,a){return n-a},0);function Z6(n){return n&&n.length?df(n,Tr):0}function Q6(n,a){return n&&n.length?df(n,$e(a,2)):0}return A.after=_y,A.ary=od,A.assign=cw,A.assignIn=_d,A.assignInWith=tc,A.assignWith=fw,A.at=hw,A.before=cd,A.bind=Zf,A.bindAll=g6,A.bindKey=fd,A.castArray=Ny,A.chain=nd,A.chunk=Hv,A.compact=Kv,A.concat=jv,A.cond=b6,A.conforms=v6,A.constant=sh,A.countBy=Zm,A.create=uw,A.curry=hd,A.curryRight=ud,A.debounce=ld,A.defaults=lw,A.defaultsDeep=dw,A.defer=Ey,A.delay=Sy,A.difference=kv,A.differenceBy=Wv,A.differenceWith=Gv,A.drop=Vv,A.dropRight=Yv,A.dropRightWhile=Jv,A.dropWhile=Xv,A.fill=Zv,A.filter=ey,A.flatMap=iy,A.flatMapDeep=ny,A.flatMapDepth=sy,A.flatten=ed,A.flattenDeep=Qv,A.flattenDepth=em,A.flip=Iy,A.flow=y6,A.flowRight=w6,A.fromPairs=tm,A.functions=ww,A.functionsIn=_w,A.groupBy=ay,A.initial=im,A.intersection=nm,A.intersectionBy=sm,A.intersectionWith=am,A.invert=Sw,A.invertBy=Iw,A.invokeMap=cy,A.iteratee=ah,A.keyBy=fy,A.keys=nr,A.keysIn=Rr,A.map=Yo,A.mapKeys=Pw,A.mapValues=Mw,A.matches=_6,A.matchesProperty=E6,A.memoize=Xo,A.merge=Aw,A.mergeWith=Ed,A.method=S6,A.methodOf=I6,A.mixin=oh,A.negate=Zo,A.nthArg=P6,A.omit=Ow,A.omitBy=Rw,A.once=xy,A.orderBy=hy,A.over=M6,A.overArgs=Py,A.overEvery=A6,A.overSome=O6,A.partial=Qf,A.partialRight=dd,A.partition=uy,A.pick=Tw,A.pickBy=Sd,A.property=Rd,A.propertyOf=R6,A.pull=hm,A.pullAll=rd,A.pullAllBy=um,A.pullAllWith=lm,A.pullAt=dm,A.range=T6,A.rangeRight=C6,A.rearg=My,A.reject=py,A.remove=pm,A.rest=Ay,A.reverse=Jf,A.sampleSize=by,A.set=Nw,A.setWith=$w,A.shuffle=vy,A.slice=gm,A.sortBy=wy,A.sortedUniq=Em,A.sortedUniqBy=Sm,A.split=i6,A.spread=Oy,A.tail=Im,A.take=xm,A.takeRight=Pm,A.takeRightWhile=Mm,A.takeWhile=Am,A.tap=Km,A.throttle=Ry,A.thru=Vo,A.toArray=md,A.toPairs=Id,A.toPairsIn=xd,A.toPath=q6,A.toPlainObject=wd,A.transform=Lw,A.unary=Ty,A.union=Om,A.unionBy=Rm,A.unionWith=Tm,A.uniq=Cm,A.uniqBy=Nm,A.uniqWith=$m,A.unset=Dw,A.unzip=Xf,A.unzipWith=id,A.update=qw,A.updateWith=Uw,A.values=Ns,A.valuesIn=zw,A.without=Lm,A.words=Ad,A.wrap=Cy,A.xor=Dm,A.xorBy=qm,A.xorWith=Um,A.zip=zm,A.zipObject=Bm,A.zipObjectDeep=Fm,A.zipWith=Hm,A.entries=Id,A.entriesIn=xd,A.extend=_d,A.extendWith=tc,oh(A,A),A.add=z6,A.attempt=Od,A.camelCase=Kw,A.capitalize=Pd,A.ceil=B6,A.clamp=Bw,A.clone=$y,A.cloneDeep=Dy,A.cloneDeepWith=qy,A.cloneWith=Ly,A.conformsTo=Uy,A.deburr=Md,A.defaultTo=m6,A.divide=F6,A.endsWith=jw,A.eq=gi,A.escape=kw,A.escapeRegExp=Ww,A.every=Qm,A.find=ty,A.findIndex=Zl,A.findKey=pw,A.findLast=ry,A.findLastIndex=Ql,A.findLastKey=gw,A.floor=H6,A.forEach=sd,A.forEachRight=ad,A.forIn=bw,A.forInRight=vw,A.forOwn=mw,A.forOwnRight=yw,A.get=rh,A.gt=zy,A.gte=By,A.has=Ew,A.hasIn=ih,A.head=td,A.identity=Tr,A.includes=oy,A.indexOf=rm,A.inRange=Fw,A.invoke=xw,A.isArguments=Jn,A.isArray=Xe,A.isArrayBuffer=Fy,A.isArrayLike=Or,A.isArrayLikeObject=Yt,A.isBoolean=Hy,A.isBuffer=yn,A.isDate=Ky,A.isElement=jy,A.isEmpty=ky,A.isEqual=Wy,A.isEqualWith=Gy,A.isError=eh,A.isFinite=Vy,A.isFunction=Ji,A.isInteger=pd,A.isLength=Qo,A.isMap=gd,A.isMatch=Yy,A.isMatchWith=Jy,A.isNaN=Xy,A.isNative=Zy,A.isNil=ew,A.isNull=Qy,A.isNumber=bd,A.isObject=Kt,A.isObjectLike=jt,A.isPlainObject=va,A.isRegExp=th,A.isSafeInteger=tw,A.isSet=vd,A.isString=ec,A.isSymbol=Fr,A.isTypedArray=Cs,A.isUndefined=rw,A.isWeakMap=iw,A.isWeakSet=nw,A.join=om,A.kebabCase=Gw,A.last=ei,A.lastIndexOf=cm,A.lowerCase=Vw,A.lowerFirst=Yw,A.lt=sw,A.lte=aw,A.max=K6,A.maxBy=j6,A.mean=k6,A.meanBy=W6,A.min=G6,A.minBy=V6,A.stubArray=fh,A.stubFalse=hh,A.stubObject=N6,A.stubString=$6,A.stubTrue=L6,A.multiply=Y6,A.nth=fm,A.noConflict=x6,A.noop=ch,A.now=Jo,A.pad=Jw,A.padEnd=Xw,A.padStart=Zw,A.parseInt=Qw,A.random=Hw,A.reduce=ly,A.reduceRight=dy,A.repeat=e6,A.replace=t6,A.result=Cw,A.round=J6,A.runInContext=Y,A.sample=gy,A.size=my,A.snakeCase=r6,A.some=yy,A.sortedIndex=bm,A.sortedIndexBy=vm,A.sortedIndexOf=mm,A.sortedLastIndex=ym,A.sortedLastIndexBy=wm,A.sortedLastIndexOf=_m,A.startCase=n6,A.startsWith=s6,A.subtract=X6,A.sum=Z6,A.sumBy=Q6,A.template=a6,A.times=D6,A.toFinite=Xi,A.toInteger=it,A.toLength=yd,A.toLower=o6,A.toNumber=ti,A.toSafeInteger=ow,A.toString=wt,A.toUpper=c6,A.trim=f6,A.trimEnd=h6,A.trimStart=u6,A.truncate=l6,A.unescape=d6,A.uniqueId=U6,A.upperCase=p6,A.upperFirst=nh,A.each=sd,A.eachRight=ad,A.first=td,oh(A,function(){var n={};return Ri(A,function(a,c){Et.call(A.prototype,c)||(n[c]=a)}),n}(),{chain:!1}),A.VERSION=s,Yr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){A[n].placeholder=A}),Yr(["drop","take"],function(n,a){dt.prototype[n]=function(c){c=c===i?1:tr(it(c),0);var g=this.__filtered__&&!a?new dt(this):this.clone();return g.__filtered__?g.__takeCount__=gr(c,g.__takeCount__):g.__views__.push({size:gr(c,ne),type:n+(g.__dir__<0?"Right":"")}),g},dt.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),Yr(["filter","map","takeWhile"],function(n,a){var c=a+1,g=c==E||c==L;dt.prototype[n]=function(S){var R=this.clone();return R.__iteratees__.push({iteratee:$e(S,3),type:c}),R.__filtered__=R.__filtered__||g,R}}),Yr(["head","last"],function(n,a){var c="take"+(a?"Right":"");dt.prototype[n]=function(){return this[c](1).value()[0]}}),Yr(["initial","tail"],function(n,a){var c="drop"+(a?"":"Right");dt.prototype[n]=function(){return this.__filtered__?new dt(this):this[c](1)}}),dt.prototype.compact=function(){return this.filter(Tr)},dt.prototype.find=function(n){return this.filter(n).head()},dt.prototype.findLast=function(n){return this.reverse().find(n)},dt.prototype.invokeMap=ot(function(n,a){return typeof n=="function"?new dt(this):this.map(function(c){return ua(c,n,a)})}),dt.prototype.reject=function(n){return this.filter(Zo($e(n)))},dt.prototype.slice=function(n,a){n=it(n);var c=this;return c.__filtered__&&(n>0||a<0)?new dt(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),a!==i&&(a=it(a),c=a<0?c.dropRight(-a):c.take(a-n)),c)},dt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},dt.prototype.toArray=function(){return this.take(ne)},Ri(dt.prototype,function(n,a){var c=/^(?:filter|find|map|reject)|While$/.test(a),g=/^(?:head|last)$/.test(a),S=A[g?"take"+(a=="last"?"Right":""):a],R=g||/^find/.test(a);S&&(A.prototype[a]=function(){var z=this.__wrapped__,k=g?[1]:arguments,Z=z instanceof dt,se=k[0],ae=Z||Xe(z),ue=function(ft){var vt=S.apply(A,ln([ft],k));return g&&ve?vt[0]:vt};ae&&c&&typeof se=="function"&&se.length!=1&&(Z=ae=!1);var ve=this.__chain__,Oe=!!this.__actions__.length,Le=R&&!ve,nt=Z&&!Oe;if(!R&&ae){z=nt?z:new dt(this);var De=n.apply(z,k);return De.__actions__.push({func:Vo,args:[ue],thisArg:i}),new Xr(De,ve)}return Le&&nt?n.apply(this,k):(De=this.thru(ue),Le?g?De.value()[0]:De.value():De)})}),Yr(["pop","push","shift","sort","splice","unshift"],function(n){var a=wo[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",g=/^(?:pop|shift)$/.test(n);A.prototype[n]=function(){var S=arguments;if(g&&!this.__chain__){var R=this.value();return a.apply(Xe(R)?R:[],S)}return this[c](function(z){return a.apply(Xe(z)?z:[],S)})}}),Ri(dt.prototype,function(n,a){var c=A[a];if(c){var g=c.name+"";Et.call(Ms,g)||(Ms[g]=[]),Ms[g].push({name:a,func:c})}}),Ms[Fo(i,U).name]=[{name:"wrapper",func:i}],dt.prototype.clone=db,dt.prototype.reverse=pb,dt.prototype.value=gb,A.prototype.at=jm,A.prototype.chain=km,A.prototype.commit=Wm,A.prototype.next=Gm,A.prototype.plant=Ym,A.prototype.reverse=Jm,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=Xm,A.prototype.first=A.prototype.head,na&&(A.prototype[na]=Vm),A},Is=W1();Vt?((Vt.exports=Is)._=Is,At._=Is):bt._=Is}).call(Fp)})(Oc,Oc.exports);var dI=Oc.exports,pI=Object.defineProperty,gI=Object.defineProperties,bI=Object.getOwnPropertyDescriptors,wp=Object.getOwnPropertySymbols,vI=Object.prototype.hasOwnProperty,mI=Object.prototype.propertyIsEnumerable,_p=(r,e,t)=>e in r?pI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ep=(r,e)=>{for(var t in e||(e={}))vI.call(e,t)&&_p(r,t,e[t]);if(wp)for(var t of wp(e))mI.call(e,t)&&_p(r,t,e[t]);return r},Sp=(r,e)=>gI(r,bI(e));const yI={Accept:"application/json","Content-Type":"application/json"},wI="POST",Ip={headers:yI,method:wI},xp=10;let Hi=class{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new ci.EventEmitter,this.isAvailable=!1,this.registering=!1,!k0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=an(e),i=await(await Cd(this.url,Sp(Ep({},Ip),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!k0(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,s)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),s(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return s(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=an({id:1,jsonrpc:"2.0",method:"test",params:[]});await Cd(e,Sp(Ep({},Ip),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?os(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),s=i.message||i.toString(),o=Yc(e,s);this.events.emit("payload",o)}parseError(e,t=this.url){return Yg(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>xp&&this.events.setMaxListeners(xp)}};const Pp="error",_I="wss://relay.walletconnect.org",EI="wc",SI="universal_provider",Mp=`${EI}@2:${SI}:`,y1="https://rpc.walletconnect.org/v1/",zs="generic",II=`${y1}bundler`,Ii={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var xI=Object.defineProperty,PI=Object.defineProperties,MI=Object.getOwnPropertyDescriptors,Ap=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,OI=Object.prototype.propertyIsEnumerable,Op=(r,e,t)=>e in r?xI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ac=(r,e)=>{for(var t in e||(e={}))AI.call(e,t)&&Op(r,t,e[t]);if(Ap)for(var t of Ap(e))OI.call(e,t)&&Op(r,t,e[t]);return r},RI=(r,e)=>PI(r,MI(e));function Ei(r,e,t){var i;const s=Hs(r);return((i=e.rpcMap)==null?void 0:i[s.reference])||`${y1}?chainId=${s.namespace}:${s.reference}&projectId=${t}`}function gs(r){return r.includes(":")?r.split(":")[1]:r}function w1(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function TI(r,e){const t=Object.keys(e.namespaces).filter(s=>s.includes(r));if(!t.length)return[];const i=[];return t.forEach(s=>{const o=e.namespaces[s].accounts;i.push(...o)}),i}function Ch(r={},e={}){const t=Rp(r),i=Rp(e);return dI.merge(t,i)}function Rp(r){var e,t,i,s;const o={};if(!Da(r))return o;for(const[f,h]of Object.entries(r)){const p=Su(f)?[f]:h.chains,l=h.methods||[],m=h.events||[],_=h.rpcMap||{},P=Ma(f);o[P]=RI(ac(ac({},o[P]),h),{chains:fc(p,(e=o[P])==null?void 0:e.chains),methods:fc(l,(t=o[P])==null?void 0:t.methods),events:fc(m,(i=o[P])==null?void 0:i.events),rpcMap:ac(ac({},_),(s=o[P])==null?void 0:s.rpcMap)})}return o}function CI(r){return r.includes(":")?r.split(":")[2]:r}function Tp(r){const e={};for(const[t,i]of Object.entries(r)){const s=i.methods||[],o=i.events||[],f=i.accounts||[],h=Su(t)?[t]:i.chains?i.chains:w1(i.accounts);e[t]={chains:h,methods:s,events:o,accounts:f}}return e}function Nh(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const _1={},_t=r=>_1[r],$h=(r,e)=>{_1[r]=e};class NI{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}var $I=Object.defineProperty,LI=Object.defineProperties,DI=Object.getOwnPropertyDescriptors,Cp=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,UI=Object.prototype.propertyIsEnumerable,Np=(r,e,t)=>e in r?$I(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$p=(r,e)=>{for(var t in e||(e={}))qI.call(e,t)&&Np(r,t,e[t]);if(Cp)for(var t of Cp(e))UI.call(e,t)&&Np(r,t,e[t]);return r},Lp=(r,e)=>LI(r,DI(e));class zI{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||Ei(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=parseInt(gs(t));e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let s=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const o=parseInt(s,16);if(this.isChainApproved(o))this.setDefaultChain(`${o}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:s}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${o}`);else throw new Error(`Failed to switch to chain 'eip155:${o}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,s;const o=(i=(t=e.request)==null?void 0:t.params)==null?void 0:i[0];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const f=this.client.session.get(e.topic),h=((s=f==null?void 0:f.sessionProperties)==null?void 0:s.capabilities)||{};if(h!=null&&h[o])return h==null?void 0:h[o];const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:Lp($p({},f.sessionProperties||{}),{capabilities:Lp($p({},h||{}),{[o]:p})})})}catch(l){console.warn("Failed to update session with capabilities",l)}return p}async getCallStatus(e){var t,i;const s=this.client.session.get(e.topic),o=(t=s.sessionProperties)==null?void 0:t.bundler_name;if(o){const h=this.getBundlerUrl(e.chainId,o);try{return await this.getUserOperationReceipt(h,e)}catch(p){console.warn("Failed to fetch call status from bundler",p,h)}}const f=(i=s.sessionProperties)==null?void 0:i.bundler_url;if(f)try{return await this.getUserOperationReceipt(f,e)}catch(h){console.warn("Failed to fetch call status from custom bundler",h,f)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;const s=new URL(e),o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Sn("eth_getUserOperationReceipt",[(i=t.request.params)==null?void 0:i[0]]))});if(!o.ok)throw new Error(`Failed to fetch user operation receipt - ${o.status}`);return await o.json()}getBundlerUrl(e,t){return`${II}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class BI{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class FI{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class HI{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const i=t||Ei(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new Si(new Hi(i,_t("disableProviderPing")))}}class KI{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),s=gs(t);e[s]=this.createHttpProvider(s,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class jI{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class kI{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=gs(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}class WI{constructor(e){this.name="near",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||Ei(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace);return typeof i>"u"?void 0:new Si(new Hi(i,_t("disableProviderPing")))}}class GI{constructor(e){this.name=zs,this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const i={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(s=>{const o=Hs(s);i[`${o.namespace}:${o.reference}`]=this.createHttpProvider(s)}),i}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Ei(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new Hi(i,_t("disableProviderPing")))}}var VI=Object.defineProperty,YI=Object.defineProperties,JI=Object.getOwnPropertyDescriptors,Dp=Object.getOwnPropertySymbols,XI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable,qp=(r,e,t)=>e in r?VI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,oc=(r,e)=>{for(var t in e||(e={}))XI.call(e,t)&&qp(r,t,e[t]);if(Dp)for(var t of Dp(e))ZI.call(e,t)&&qp(r,t,e[t]);return r},Lh=(r,e)=>YI(r,JI(e));let QI=class E1{constructor(e){this.events=new cu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Ja(Gc({level:(e==null?void 0:e.logger)||Pp})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new E1(e);return await t.initialize(),t}async request(e,t,i){const[s,o]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:oc({},e),chainId:`${s}:${o}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,s){const o=new Date().getTime();this.request(e,i,s).then(f=>t(null,Vc(o,f))).catch(f=>t(f,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:St("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:i,response:s}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));const o=await s();if(this.session=o.session,this.session){const f=Tp(this.session.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces),this.onConnect()}return o}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:s}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await s().then(o=>{this.session=o;const f=Tp(o.namespaces);this.namespaces=Ch(this.namespaces,f),this.persist("namespaces",this.namespaces)}).catch(o=>{if(o.message!==m1)throw o;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,s]=this.validateChain(e),o=this.getProvider(i);o.name===zs?o.setDefaultChain(`${i}:${s}`,t):o.setDefaultChain(s,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(zi(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Tu.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Pp,relayUrl:this.providerOpts.relayUrl||_I,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>Ma(t)))];$h("client",this.client),$h("events",this.events),$h("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=TI(t,this.session),s=w1(i),o=Ch(this.namespaces,this.optionalNamespaces),f=Lh(oc({},o[t]),{accounts:i,chains:s});switch(t){case"eip155":this.rpcProviders[t]=new zI({namespace:f});break;case"algorand":this.rpcProviders[t]=new HI({namespace:f});break;case"solana":this.rpcProviders[t]=new BI({namespace:f});break;case"cosmos":this.rpcProviders[t]=new FI({namespace:f});break;case"polkadot":this.rpcProviders[t]=new NI({namespace:f});break;case"cip34":this.rpcProviders[t]=new KI({namespace:f});break;case"elrond":this.rpcProviders[t]=new jI({namespace:f});break;case"multiversx":this.rpcProviders[t]=new kI({namespace:f});break;case"near":this.rpcProviders[t]=new WI({namespace:f});break;default:this.rpcProviders[zs]?this.rpcProviders[zs].updateNamespace(f):this.rpcProviders[zs]=new GI({namespace:f})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const s=i.data;s&&zi(s)&&this.events.emit("accountsChanged",s.map(CI))}else if(i.name==="chainChanged"){const s=t.chainId,o=t.event.data,f=Ma(s),h=Nh(s)!==Nh(o)?`${f}:${Nh(o)}`:s;this.onChainChanged(h)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:s}=t,o=(i=this.client)==null?void 0:i.session.get(e);this.session=Lh(oc({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Lh(oc({},St("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ii.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[zs]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:s}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=s,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(f=>Ma(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const s=Ma(Object.keys(this.namespaces)[0]),o=this.rpcProviders[s].getDefaultChain();return[s,o]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[i,s]=this.validateChain(e);s&&(t||this.getProvider(i).setDefaultChain(s),this.namespaces[i]?this.namespaces[i].defaultChain=s:this.namespaces[`${i}:${s}`]?this.namespaces[`${i}:${s}`].defaultChain=s:this.namespaces[`${i}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Mp}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Mp}/${e}`)}};const ex=QI,tx="wc",rx="ethereum_provider",ix=`${tx}@2:${rx}:`,nx="https://rpc.walletconnect.org/v1/",su=["eth_sendTransaction","personal_sign"],sx=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],au=["chainChanged","accountsChanged"],ax=["chainChanged","accountsChanged","message","disconnect","connect"];var ox=Object.defineProperty,cx=Object.defineProperties,fx=Object.getOwnPropertyDescriptors,Up=Object.getOwnPropertySymbols,hx=Object.prototype.hasOwnProperty,ux=Object.prototype.propertyIsEnumerable,zp=(r,e,t)=>e in r?ox(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Bs=(r,e)=>{for(var t in e||(e={}))hx.call(e,t)&&zp(r,t,e[t]);if(Up)for(var t of Up(e))ux.call(e,t)&&zp(r,t,e[t]);return r},Dh=(r,e)=>cx(r,fx(e));function Rc(r){return Number(r[0].split(":")[1])}function cc(r){return`0x${r.toString(16)}`}function lx(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:s,events:o,optionalEvents:f,rpcMap:h}=r;if(!zi(e))throw new Error("Invalid chains");const p={chains:e,methods:i||su,events:o||au,rpcMap:Bs({},e.length?{[Rc(e)]:h[Rc(e)]}:{})},l=o==null?void 0:o.filter(x=>!au.includes(x)),m=i==null?void 0:i.filter(x=>!su.includes(x));if(!t&&!f&&!s&&!(l!=null&&l.length)&&!(m!=null&&m.length))return{required:e.length?p:void 0};const _=(l==null?void 0:l.length)&&(m==null?void 0:m.length)||!t,P={chains:[...new Set(_?p.chains.concat(t||[]):t)],methods:[...new Set(p.methods.concat(s!=null&&s.length?s:sx))],events:[...new Set(p.events.concat(f!=null&&f.length?f:ax))],rpcMap:h};return{required:e.length?p:void 0,optional:t.length?P:void 0}}class Cu{constructor(){this.events=new ci.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=ix,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new Cu;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,i){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=lx(this.rpc);try{const s=await new Promise(async(f,h)=>{var p;this.rpc.showQrModal&&((p=this.modal)==null||p.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),h(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Dh(Bs({namespaces:Bs({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{f(l)}).catch(l=>{h(new Error(l.message))})});if(!s)return;const o=a0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:cc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(o,f)=>{var h;this.rpc.showQrModal&&((h=this.modal)==null||h.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Dh(Bs({},e),{chains:this.rpc.chains}),t).then(p=>{o(p)}).catch(p=>{f(new Error(p.message))})}),s=i.session;if(s){const o=a0(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:o),this.setAccounts(o),this.events.emit("connect",{chainId:cc(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",cc(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Dh(Bs({},St("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",cc(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,s]=e.split(":");return{chainId:`${t}:${i}`,address:s}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const s=(t=e==null?void 0:e.chains)!=null?t:[],o=(i=e==null?void 0:e.optionalChains)!=null?i:[],f=s.concat(o);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const h=s.length?(e==null?void 0:e.methods)||su:[],p=s.length?(e==null?void 0:e.events)||au:[],l=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],_=(e==null?void 0:e.rpcMap)||this.buildRpcMap(f,e.projectId),P=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(x=>this.formatChainId(x)),optionalChains:o.map(x=>this.formatChainId(x)),methods:h,events:p,optionalMethods:l,optionalEvents:m,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:P,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(s=>{i[s]=this.getRpcUrl(s,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Rc(this.rpc.chains):Rc(this.rpc.optionalChains),this.signer=await ex.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:i}=await c2(()=>import("./index-DREoEfuJ.js").then(s=>s.i),__vite__mapDeps([0,1,2]));t=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Bs({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:s}=e;t&&zi(t)&&(this.rpc.chains=t.map(o=>this.formatChainId(o)),t.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)})),i&&zi(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(o=>this.formatChainId(o)),i.forEach(o=>{this.rpc.rpcMap[o]=(s==null?void 0:s[o])||this.getRpcUrl(o)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${nx}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const Fx=Cu;export{Fx as EthereumProvider,ax as OPTIONAL_EVENTS,sx as OPTIONAL_METHODS,au as REQUIRED_EVENTS,su as REQUIRED_METHODS,Cu as default};
|