@wormhole-foundation/wormhole-connect 0.3.3-beta.1-development → 0.3.3-beta.3-development
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/dist/main.js +86 -86
- package/dist/src/config/mainnet/gasEstimates.d.ts.map +1 -1
- package/dist/src/config/mainnet/nttGroups.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/routes/utils.d.ts.map +1 -1
- package/dist/src/views/Bridge/Bridge.d.ts.map +1 -1
- package/lib/{aptos-zqw8CE0g.js → aptos-Gl7Lvx33.js} +1 -1
- package/lib/{aptos-cjiLVgwc.mjs → aptos-wWY9cYKb.mjs} +1 -1
- package/lib/{ccip-3qscPCG4.mjs → ccip-U0O--jNe.mjs} +3 -3
- package/lib/{ccip-zP2Pn-k1.js → ccip-ZIQJfzGP.js} +1 -1
- package/lib/{cosmos-3CuMYWTB.js → cosmos-FDC9IzRr.js} +1 -1
- package/lib/{cosmos-LZbcmh28.mjs → cosmos-c0ODp2pR.mjs} +3 -3
- package/lib/{evm-Kp2uR9Fe.js → evm-HSpaYhQP.js} +3 -3
- package/lib/{evm-2aMPlWl0.mjs → evm-wgq2htQK.mjs} +4 -4
- package/lib/{index-soixhS2C.js → index-4Y1uNAAU.js} +3 -3
- package/lib/{index-zgwtG0wU.js → index-Mg5q9ZMw.js} +1 -1
- package/lib/{index-p4cvTk2e.js → index-Mk7LYYdN.js} +1 -1
- package/lib/{index-pbA6ePf7.mjs → index-MoMbeAKz.mjs} +1 -1
- package/lib/{index-9CzlFlmy.js → index-MvsxOCsW.js} +1 -1
- package/lib/{index-Hgi51M-G.mjs → index-TdxYLzGx.mjs} +3 -3
- package/lib/{index-dEADQOcf.js → index-iJmUtx_H.js} +1 -1
- package/lib/{index-HBwOgLYJ.mjs → index-oliZI3Bw.mjs} +82 -23
- package/lib/{index-WEpJeYUB.mjs → index-vsAk8D8-.mjs} +2 -2
- package/lib/{index-AzuDRjt4.mjs → index-zXvuSp6M.mjs} +1 -1
- package/lib/{index.es-P2W5Cy73.mjs → index.es-9kvKUYIv.mjs} +2 -2
- package/lib/{index.es-siSLzXPl.mjs → index.es-CueUNOIp.mjs} +1 -1
- package/lib/{index.es-jza9AjyO.js → index.es-MjAXWJbv.js} +2 -2
- package/lib/{index.es-j9OF4RCQ.js → index.es-NIfnGwYn.js} +1 -1
- package/lib/{index.es-FpKwGSlX.js → index.es-dKB91XRm.js} +1 -1
- package/lib/{index.es-NVLYuEEG.mjs → index.es-l5YUjdFo.mjs} +4 -4
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-QUuw9ka0.js → libsodium-wrappers-9aCJqlW5.js} +1 -1
- package/lib/{libsodium-wrappers-RbcWfPuP.mjs → libsodium-wrappers-t-G4VebW.mjs} +1 -1
- package/lib/{sei-y7SngMRu.js → sei-LCVHAbJP.js} +1 -1
- package/lib/{sei-jqCqxgBA.mjs → sei-kAT23rRb.mjs} +2 -2
- package/lib/{solana-N7jROrW3.mjs → solana-9cEEFpYk.mjs} +3 -3
- package/lib/{solana-x57BQ6qu.js → solana-iA5G1mT6.js} +1 -1
- package/lib/{solanaEmbed.esm-ck9jvWiL.mjs → solanaEmbed.esm-83vVt6e1.mjs} +2 -2
- package/lib/{solanaEmbed.esm-hNvP2iQv.js → solanaEmbed.esm-IF6HXU18.js} +1 -1
- package/lib/src/config/mainnet/gasEstimates.d.ts.map +1 -1
- package/lib/src/config/mainnet/nttGroups.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/routes/utils.d.ts.map +1 -1
- package/lib/src/views/Bridge/Bridge.d.ts.map +1 -1
- package/lib/{sui-F-C4vaHz.js → sui-2auVkRE6.js} +1 -1
- package/lib/{sui-DtGG5GWD.mjs → sui-MKTbT49-.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as _t, s as ce, T as N, o as ot, R as Do, a as C, t as U, p as q, y as gt } from "./index-
|
|
1
|
+
import { n as _t, s as ce, T as N, o as ot, R as Do, a as C, t as U, p as q, y as gt } from "./index-zXvuSp6M.mjs";
|
|
2
2
|
import { d as Uo } from "./dijkstra-_4avdlbo.mjs";
|
|
3
|
-
import { d as Wo } from "./index-
|
|
3
|
+
import { d as Wo } from "./index-oliZI3Bw.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
var jo = function(t) {
|
|
@@ -396,7 +396,7 @@ class ke {
|
|
|
396
396
|
}
|
|
397
397
|
async initUi() {
|
|
398
398
|
if (typeof window < "u") {
|
|
399
|
-
await import("./index-
|
|
399
|
+
await import("./index-vsAk8D8-.mjs");
|
|
400
400
|
const t = document.createElement("wcm-modal");
|
|
401
401
|
document.body.insertAdjacentElement("beforeend", t), w.setIsUiLoaded(!0);
|
|
402
402
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as Ze, p as ci, F as yt, q as gt, g as Er, aX as xr } from "./index-
|
|
2
|
-
import { c as M, b as so, w as Ir, r as Sr, f as as, t as Oi, d as ro, g as Nt, V as no, M as oo, N, h as ao, i as Gi, j as co, K as ho, A as lo, q as Os, x as uo, H as fo, F as po, l as Rs, $ as go, p as yo, J as mo, u as ri, m as Ts, X as wo, n as bo, _ as Pr, y as ut, I as _o, C as Ns, D as Ut, E as Ie, U as rt, G as Tt, L as Xe, O as vo, P as Kt, Q as Or, R as Eo, T as xo, W as Io, Y as Rr, Z as So, a0 as Tr, a1 as Nr, a2 as Bt, a3 as ki, a4 as Ei, k as Po, a5 as Oo, B as $i, a6 as Ro, a7 as To, a8 as No, a9 as Ao, aa as wi, ab as Fo, ac as $o, ad as Ci, ae as As, af as Co, ag as Lo, ah as Do, ai as Fs, aj as Mo, ak as qo, al as zo, am as jo, an as Uo, ao as Ko, ap as Vo } from "./index.es-
|
|
1
|
+
import { d as Ze, p as ci, F as yt, q as gt, g as Er, aX as xr } from "./index-oliZI3Bw.mjs";
|
|
2
|
+
import { c as M, b as so, w as Ir, r as Sr, f as as, t as Oi, d as ro, g as Nt, V as no, M as oo, N, h as ao, i as Gi, j as co, K as ho, A as lo, q as Os, x as uo, H as fo, F as po, l as Rs, $ as go, p as yo, J as mo, u as ri, m as Ts, X as wo, n as bo, _ as Pr, y as ut, I as _o, C as Ns, D as Ut, E as Ie, U as rt, G as Tt, L as Xe, O as vo, P as Kt, Q as Or, R as Eo, T as xo, W as Io, Y as Rr, Z as So, a0 as Tr, a1 as Nr, a2 as Bt, a3 as ki, a4 as Ei, k as Po, a5 as Oo, B as $i, a6 as Ro, a7 as To, a8 as No, a9 as Ao, aa as wi, ab as Fo, ac as $o, ad as Ci, ae as As, af as Co, ag as Lo, ah as Do, ai as Fs, aj as Mo, ak as qo, al as zo, am as jo, an as Uo, ao as Ko, ap as Vo } from "./index.es-CueUNOIp.mjs";
|
|
3
3
|
const Bo = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, Ho = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, Go = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
4
4
|
function ko(r, e) {
|
|
5
5
|
if (r === "__proto__" || r === "constructor" && e && typeof e == "object" && "prototype" in e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("./index-soixhS2C.js"),nt=require("./index.es-j9OF4RCQ.js"),pt=require("./index.es-FpKwGSlX.js");require("react");require("react-dom");var es={exports:{}};(function(b,s){var i=typeof self<"u"?self:ke.commonjsGlobal,f=function(){function P(){this.fetch=!1,this.DOMException=i.DOMException}return P.prototype=i,new P}();(function(P){(function(O){var N={searchParams:"URLSearchParams"in P,iterable:"Symbol"in P&&"iterator"in Symbol,blob:"FileReader"in P&&"Blob"in P&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in P,arrayBuffer:"ArrayBuffer"in P};function ut(v){return v&&DataView.prototype.isPrototypeOf(v)}if(N.arrayBuffer)var st=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],dt=ArrayBuffer.isView||function(v){return v&&st.indexOf(Object.prototype.toString.call(v))>-1};function it(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function vt(v){return typeof v!="string"&&(v=String(v)),v}function ct(v){var E={next:function(){var $=v.shift();return{done:$===void 0,value:$}}};return N.iterable&&(E[Symbol.iterator]=function(){return E}),E}function J(v){this.map={},v instanceof J?v.forEach(function(E,$){this.append($,E)},this):Array.isArray(v)?v.forEach(function(E){this.append(E[0],E[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(E){this.append(E,v[E])},this)}J.prototype.append=function(v,E){v=it(v),E=vt(E);var $=this.map[v];this.map[v]=$?$+", "+E:E},J.prototype.delete=function(v){delete this.map[it(v)]},J.prototype.get=function(v){return v=it(v),this.has(v)?this.map[v]:null},J.prototype.has=function(v){return this.map.hasOwnProperty(it(v))},J.prototype.set=function(v,E){this.map[it(v)]=vt(E)},J.prototype.forEach=function(v,E){for(var $ in this.map)this.map.hasOwnProperty($)&&v.call(E,this.map[$],$,this)},J.prototype.keys=function(){var v=[];return this.forEach(function(E,$){v.push($)}),ct(v)},J.prototype.values=function(){var v=[];return this.forEach(function(E){v.push(E)}),ct(v)},J.prototype.entries=function(){var v=[];return this.forEach(function(E,$){v.push([$,E])}),ct(v)},N.iterable&&(J.prototype[Symbol.iterator]=J.prototype.entries);function ve(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function yt(v){return new Promise(function(E,$){v.onload=function(){E(v.result)},v.onerror=function(){$(v.error)}})}function ee(v){var E=new FileReader,$=yt(E);return E.readAsArrayBuffer(v),$}function jr(v){var E=new FileReader,$=yt(E);return E.readAsText(v),$}function Ht(v){for(var E=new Uint8Array(v),$=new Array(E.length),K=0;K<E.length;K++)$[K]=String.fromCharCode(E[K]);return $.join("")}function re(v){if(v.slice)return v.slice(0);var E=new Uint8Array(v.byteLength);return E.set(new Uint8Array(v)),E.buffer}function Ot(){return this.bodyUsed=!1,this._initBody=function(v){this._bodyInit=v,v?typeof v=="string"?this._bodyText=v:N.blob&&Blob.prototype.isPrototypeOf(v)?this._bodyBlob=v:N.formData&&FormData.prototype.isPrototypeOf(v)?this._bodyFormData=v:N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)?this._bodyText=v.toString():N.arrayBuffer&&N.blob&&ut(v)?(this._bodyArrayBuffer=re(v.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):N.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(v)||dt(v))?this._bodyArrayBuffer=re(v):this._bodyText=v=Object.prototype.toString.call(v):this._bodyText="",this.headers.get("content-type")||(typeof v=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},N.blob&&(this.blob=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?ve(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(ee)}),this.text=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return jr(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ht(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},N.formData&&(this.formData=function(){return this.text().then(er)}),this.json=function(){return this.text().then(JSON.parse)},this}var ge=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Wt(v){var E=v.toUpperCase();return ge.indexOf(E)>-1?E:v}function jt(v,E){E=E||{};var $=E.body;if(v instanceof jt){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,E.headers||(this.headers=new J(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!$&&v._bodyInit!=null&&($=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new J(E.headers)),this.method=Wt(E.method||this.method||"GET"),this.mode=E.mode||this.mode||null,this.signal=E.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&$)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody($)}jt.prototype.clone=function(){return new jt(this,{body:this._bodyInit})};function er(v){var E=new FormData;return v.trim().split("&").forEach(function($){if($){var K=$.split("="),G=K.shift().replace(/\+/g," "),F=K.join("=").replace(/\+/g," ");E.append(decodeURIComponent(G),decodeURIComponent(F))}}),E}function jn(v){var E=new J,$=v.replace(/\r?\n[\t ]+/g," ");return $.split(/\r?\n/).forEach(function(K){var G=K.split(":"),F=G.shift().trim();if(F){var ne=G.join(":").trim();E.append(F,ne)}}),E}Ot.call(jt.prototype);function qt(v,E){E||(E={}),this.type="default",this.status=E.status===void 0?200:E.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in E?E.statusText:"OK",this.headers=new J(E.headers),this.url=E.url||"",this._initBody(v)}Ot.call(qt.prototype),qt.prototype.clone=function(){return new qt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new J(this.headers),url:this.url})},qt.error=function(){var v=new qt(null,{status:0,statusText:""});return v.type="error",v};var xn=[301,302,303,307,308];qt.redirect=function(v,E){if(xn.indexOf(E)===-1)throw new RangeError("Invalid status code");return new qt(null,{status:E,headers:{location:v}})},O.DOMException=P.DOMException;try{new O.DOMException}catch{O.DOMException=function(E,$){this.message=E,this.name=$;var K=Error(E);this.stack=K.stack},O.DOMException.prototype=Object.create(Error.prototype),O.DOMException.prototype.constructor=O.DOMException}function rr(v,E){return new Promise(function($,K){var G=new jt(v,E);if(G.signal&&G.signal.aborted)return K(new O.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function ne(){F.abort()}F.onload=function(){var gt={status:F.status,statusText:F.statusText,headers:jn(F.getAllResponseHeaders()||"")};gt.url="responseURL"in F?F.responseURL:gt.headers.get("X-Request-URL");var nr="response"in F?F.response:F.responseText;$(new qt(nr,gt))},F.onerror=function(){K(new TypeError("Network request failed"))},F.ontimeout=function(){K(new TypeError("Network request failed"))},F.onabort=function(){K(new O.DOMException("Aborted","AbortError"))},F.open(G.method,G.url,!0),G.credentials==="include"?F.withCredentials=!0:G.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&N.blob&&(F.responseType="blob"),G.headers.forEach(function(gt,nr){F.setRequestHeader(nr,gt)}),G.signal&&(G.signal.addEventListener("abort",ne),F.onreadystatechange=function(){F.readyState===4&&G.signal.removeEventListener("abort",ne)}),F.send(typeof G._bodyInit>"u"?null:G._bodyInit)})}return rr.polyfill=!0,P.fetch||(P.fetch=rr,P.Headers=J,P.Request=jt,P.Response=qt),O.Headers=J,O.Request=jt,O.Response=qt,O.fetch=rr,Object.defineProperty(O,"__esModule",{value:!0}),O})({})})(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var g=f;s=g.fetch,s.default=g.fetch,s.fetch=g.fetch,s.Headers=g.Headers,s.Request=g.Request,s.Response=g.Response,b.exports=s})(es,es.exports);var Uv=es.exports;const qo=ke.getDefaultExportFromCjs(Uv),Fv=b=>JSON.stringify(b,(s,i)=>typeof i=="bigint"?i.toString()+"n":i),zv=b=>{const s=/([\[:])?(\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,i=b.replace(s,'$1"$2n"$3');return JSON.parse(i,(f,g)=>typeof g=="string"&&g.match(/^\d+n$/)?BigInt(g.substring(0,g.length-1)):g)};function Wv(b){if(typeof b!="string")throw new Error(`Cannot safe json parse value of type ${typeof b}`);try{return zv(b)}catch{return b}}function ko(b){return typeof b=="string"?b:Fv(b)||""}const Jv={Accept:"application/json","Content-Type":"application/json"},Gv="POST",Mo={headers:Jv,method:Gv},Bo=10;class Oe{constructor(s,i=!1){if(this.url=s,this.disableProviderPing=i,this.events=new ke.eventsExports.EventEmitter,this.isAvailable=!1,this.registering=!1,!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);this.url=s,this.disableProviderPing=i}get connected(){return this.isAvailable}get connecting(){return this.registering}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}off(s,i){this.events.off(s,i)}removeListener(s,i){this.events.removeListener(s,i)}async open(s=this.url){await this.register(s)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(s,i){this.isAvailable||await this.register();try{const f=ko(s),P=await(await qo(this.url,Object.assign(Object.assign({},Mo),{body:f}))).json();this.onPayload({data:P})}catch(f){this.onError(s.id,f)}}async register(s=this.url){if(!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((f,g)=>{this.events.once("register_error",P=>{this.resetMaxListeners(),g(P)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return g(new Error("HTTP connection is missing or invalid"));f()})})}this.url=s,this.registering=!0;try{if(!this.disableProviderPing){const i=ko({id:1,jsonrpc:"2.0",method:"test",params:[]});await qo(s,Object.assign(Object.assign({},Mo),{body:i}))}this.onOpen()}catch(i){const f=this.parseError(i);throw this.events.emit("register_error",f),this.onClose(),f}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(s){if(typeof s.data>"u")return;const i=typeof s.data=="string"?Wv(s.data):s.data;this.events.emit("payload",i)}onError(s,i){const f=this.parseError(i),g=f.message||f.toString(),P=pt.formatJsonRpcError(s,g);this.events.emit("payload",P)}parseError(s,i=this.url){return pt.parseConnectionError(s,i,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Bo&&this.events.setMaxListeners(Bo)}}const No="error",Qv="wss://relay.walletconnect.com",Vv="wc",Kv="universal_provider",Lo=`${Vv}@2:${Kv}:`,Zv="https://rpc.walletconnect.com/v1/",de={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ke.dist.global<"u"?ke.dist.global:typeof self<"u"?self:{},rs={exports:{}};/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("./index-4Y1uNAAU.js"),nt=require("./index.es-NIfnGwYn.js"),pt=require("./index.es-dKB91XRm.js");require("react");require("react-dom");var es={exports:{}};(function(b,s){var i=typeof self<"u"?self:ke.commonjsGlobal,f=function(){function P(){this.fetch=!1,this.DOMException=i.DOMException}return P.prototype=i,new P}();(function(P){(function(O){var N={searchParams:"URLSearchParams"in P,iterable:"Symbol"in P&&"iterator"in Symbol,blob:"FileReader"in P&&"Blob"in P&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in P,arrayBuffer:"ArrayBuffer"in P};function ut(v){return v&&DataView.prototype.isPrototypeOf(v)}if(N.arrayBuffer)var st=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],dt=ArrayBuffer.isView||function(v){return v&&st.indexOf(Object.prototype.toString.call(v))>-1};function it(v){if(typeof v!="string"&&(v=String(v)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(v))throw new TypeError("Invalid character in header field name");return v.toLowerCase()}function vt(v){return typeof v!="string"&&(v=String(v)),v}function ct(v){var E={next:function(){var $=v.shift();return{done:$===void 0,value:$}}};return N.iterable&&(E[Symbol.iterator]=function(){return E}),E}function J(v){this.map={},v instanceof J?v.forEach(function(E,$){this.append($,E)},this):Array.isArray(v)?v.forEach(function(E){this.append(E[0],E[1])},this):v&&Object.getOwnPropertyNames(v).forEach(function(E){this.append(E,v[E])},this)}J.prototype.append=function(v,E){v=it(v),E=vt(E);var $=this.map[v];this.map[v]=$?$+", "+E:E},J.prototype.delete=function(v){delete this.map[it(v)]},J.prototype.get=function(v){return v=it(v),this.has(v)?this.map[v]:null},J.prototype.has=function(v){return this.map.hasOwnProperty(it(v))},J.prototype.set=function(v,E){this.map[it(v)]=vt(E)},J.prototype.forEach=function(v,E){for(var $ in this.map)this.map.hasOwnProperty($)&&v.call(E,this.map[$],$,this)},J.prototype.keys=function(){var v=[];return this.forEach(function(E,$){v.push($)}),ct(v)},J.prototype.values=function(){var v=[];return this.forEach(function(E){v.push(E)}),ct(v)},J.prototype.entries=function(){var v=[];return this.forEach(function(E,$){v.push([$,E])}),ct(v)},N.iterable&&(J.prototype[Symbol.iterator]=J.prototype.entries);function ve(v){if(v.bodyUsed)return Promise.reject(new TypeError("Already read"));v.bodyUsed=!0}function yt(v){return new Promise(function(E,$){v.onload=function(){E(v.result)},v.onerror=function(){$(v.error)}})}function ee(v){var E=new FileReader,$=yt(E);return E.readAsArrayBuffer(v),$}function jr(v){var E=new FileReader,$=yt(E);return E.readAsText(v),$}function Ht(v){for(var E=new Uint8Array(v),$=new Array(E.length),K=0;K<E.length;K++)$[K]=String.fromCharCode(E[K]);return $.join("")}function re(v){if(v.slice)return v.slice(0);var E=new Uint8Array(v.byteLength);return E.set(new Uint8Array(v)),E.buffer}function Ot(){return this.bodyUsed=!1,this._initBody=function(v){this._bodyInit=v,v?typeof v=="string"?this._bodyText=v:N.blob&&Blob.prototype.isPrototypeOf(v)?this._bodyBlob=v:N.formData&&FormData.prototype.isPrototypeOf(v)?this._bodyFormData=v:N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)?this._bodyText=v.toString():N.arrayBuffer&&N.blob&&ut(v)?(this._bodyArrayBuffer=re(v.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):N.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(v)||dt(v))?this._bodyArrayBuffer=re(v):this._bodyText=v=Object.prototype.toString.call(v):this._bodyText="",this.headers.get("content-type")||(typeof v=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):N.searchParams&&URLSearchParams.prototype.isPrototypeOf(v)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},N.blob&&(this.blob=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?ve(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(ee)}),this.text=function(){var v=ve(this);if(v)return v;if(this._bodyBlob)return jr(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ht(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},N.formData&&(this.formData=function(){return this.text().then(er)}),this.json=function(){return this.text().then(JSON.parse)},this}var ge=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Wt(v){var E=v.toUpperCase();return ge.indexOf(E)>-1?E:v}function jt(v,E){E=E||{};var $=E.body;if(v instanceof jt){if(v.bodyUsed)throw new TypeError("Already read");this.url=v.url,this.credentials=v.credentials,E.headers||(this.headers=new J(v.headers)),this.method=v.method,this.mode=v.mode,this.signal=v.signal,!$&&v._bodyInit!=null&&($=v._bodyInit,v.bodyUsed=!0)}else this.url=String(v);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new J(E.headers)),this.method=Wt(E.method||this.method||"GET"),this.mode=E.mode||this.mode||null,this.signal=E.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&$)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody($)}jt.prototype.clone=function(){return new jt(this,{body:this._bodyInit})};function er(v){var E=new FormData;return v.trim().split("&").forEach(function($){if($){var K=$.split("="),G=K.shift().replace(/\+/g," "),F=K.join("=").replace(/\+/g," ");E.append(decodeURIComponent(G),decodeURIComponent(F))}}),E}function jn(v){var E=new J,$=v.replace(/\r?\n[\t ]+/g," ");return $.split(/\r?\n/).forEach(function(K){var G=K.split(":"),F=G.shift().trim();if(F){var ne=G.join(":").trim();E.append(F,ne)}}),E}Ot.call(jt.prototype);function qt(v,E){E||(E={}),this.type="default",this.status=E.status===void 0?200:E.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in E?E.statusText:"OK",this.headers=new J(E.headers),this.url=E.url||"",this._initBody(v)}Ot.call(qt.prototype),qt.prototype.clone=function(){return new qt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new J(this.headers),url:this.url})},qt.error=function(){var v=new qt(null,{status:0,statusText:""});return v.type="error",v};var xn=[301,302,303,307,308];qt.redirect=function(v,E){if(xn.indexOf(E)===-1)throw new RangeError("Invalid status code");return new qt(null,{status:E,headers:{location:v}})},O.DOMException=P.DOMException;try{new O.DOMException}catch{O.DOMException=function(E,$){this.message=E,this.name=$;var K=Error(E);this.stack=K.stack},O.DOMException.prototype=Object.create(Error.prototype),O.DOMException.prototype.constructor=O.DOMException}function rr(v,E){return new Promise(function($,K){var G=new jt(v,E);if(G.signal&&G.signal.aborted)return K(new O.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function ne(){F.abort()}F.onload=function(){var gt={status:F.status,statusText:F.statusText,headers:jn(F.getAllResponseHeaders()||"")};gt.url="responseURL"in F?F.responseURL:gt.headers.get("X-Request-URL");var nr="response"in F?F.response:F.responseText;$(new qt(nr,gt))},F.onerror=function(){K(new TypeError("Network request failed"))},F.ontimeout=function(){K(new TypeError("Network request failed"))},F.onabort=function(){K(new O.DOMException("Aborted","AbortError"))},F.open(G.method,G.url,!0),G.credentials==="include"?F.withCredentials=!0:G.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&N.blob&&(F.responseType="blob"),G.headers.forEach(function(gt,nr){F.setRequestHeader(nr,gt)}),G.signal&&(G.signal.addEventListener("abort",ne),F.onreadystatechange=function(){F.readyState===4&&G.signal.removeEventListener("abort",ne)}),F.send(typeof G._bodyInit>"u"?null:G._bodyInit)})}return rr.polyfill=!0,P.fetch||(P.fetch=rr,P.Headers=J,P.Request=jt,P.Response=qt),O.Headers=J,O.Request=jt,O.Response=qt,O.fetch=rr,Object.defineProperty(O,"__esModule",{value:!0}),O})({})})(f),f.fetch.ponyfill=!0,delete f.fetch.polyfill;var g=f;s=g.fetch,s.default=g.fetch,s.fetch=g.fetch,s.Headers=g.Headers,s.Request=g.Request,s.Response=g.Response,b.exports=s})(es,es.exports);var Uv=es.exports;const qo=ke.getDefaultExportFromCjs(Uv),Fv=b=>JSON.stringify(b,(s,i)=>typeof i=="bigint"?i.toString()+"n":i),zv=b=>{const s=/([\[:])?(\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,i=b.replace(s,'$1"$2n"$3');return JSON.parse(i,(f,g)=>typeof g=="string"&&g.match(/^\d+n$/)?BigInt(g.substring(0,g.length-1)):g)};function Wv(b){if(typeof b!="string")throw new Error(`Cannot safe json parse value of type ${typeof b}`);try{return zv(b)}catch{return b}}function ko(b){return typeof b=="string"?b:Fv(b)||""}const Jv={Accept:"application/json","Content-Type":"application/json"},Gv="POST",Mo={headers:Jv,method:Gv},Bo=10;class Oe{constructor(s,i=!1){if(this.url=s,this.disableProviderPing=i,this.events=new ke.eventsExports.EventEmitter,this.isAvailable=!1,this.registering=!1,!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);this.url=s,this.disableProviderPing=i}get connected(){return this.isAvailable}get connecting(){return this.registering}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}off(s,i){this.events.off(s,i)}removeListener(s,i){this.events.removeListener(s,i)}async open(s=this.url){await this.register(s)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(s,i){this.isAvailable||await this.register();try{const f=ko(s),P=await(await qo(this.url,Object.assign(Object.assign({},Mo),{body:f}))).json();this.onPayload({data:P})}catch(f){this.onError(s.id,f)}}async register(s=this.url){if(!pt.isHttpUrl(s))throw new Error(`Provided URL is not compatible with HTTP connection: ${s}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((f,g)=>{this.events.once("register_error",P=>{this.resetMaxListeners(),g(P)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return g(new Error("HTTP connection is missing or invalid"));f()})})}this.url=s,this.registering=!0;try{if(!this.disableProviderPing){const i=ko({id:1,jsonrpc:"2.0",method:"test",params:[]});await qo(s,Object.assign(Object.assign({},Mo),{body:i}))}this.onOpen()}catch(i){const f=this.parseError(i);throw this.events.emit("register_error",f),this.onClose(),f}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(s){if(typeof s.data>"u")return;const i=typeof s.data=="string"?Wv(s.data):s.data;this.events.emit("payload",i)}onError(s,i){const f=this.parseError(i),g=f.message||f.toString(),P=pt.formatJsonRpcError(s,g);this.events.emit("payload",P)}parseError(s,i=this.url){return pt.parseConnectionError(s,i,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Bo&&this.events.setMaxListeners(Bo)}}const No="error",Qv="wss://relay.walletconnect.com",Vv="wc",Kv="universal_provider",Lo=`${Vv}@2:${Kv}:`,Zv="https://rpc.walletconnect.com/v1/",de={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ke.dist.global<"u"?ke.dist.global:typeof self<"u"?self:{},rs={exports:{}};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Lodash <https://lodash.com/>
|
|
4
4
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -24,4 +24,4 @@ __p += '`),B&&(w+=`' +
|
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+w+`return __p
|
|
27
|
-
}`;var H=To(function(){return L(u,A+"return "+w).apply(i,c)});if(H.source=w,Ni(H))throw H;return H}function Vd(t){return U(t).toLowerCase()}function Kd(t){return U(t).toUpperCase()}function Zd(t,e,r){if(t=U(t),t&&(r||e===i))return Ls(t);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Qt(e),u=Us(n,a),c=Fs(n,a)+1;return Ce(n,u,c).join("")}function Yd(t,e,r){if(t=U(t),t&&(r||e===i))return t.slice(0,Ws(t)+1);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Fs(n,Qt(e))+1;return Ce(n,0,a).join("")}function Xd(t,e,r){if(t=U(t),t&&(r||e===i))return t.replace(Nn,"");if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Us(n,Qt(e));return Ce(n,a).join("")}function tv(t,e){var r=jn,n=qt;if(X(e)){var a="separator"in e?e.separator:a;r="length"in e?T(e.length):r,n="omission"in e?Dt(e.omission):n}t=U(t);var u=t.length;if(Fe(t)){var c=Qt(t);u=c.length}if(r>=u)return t;var h=r-ze(n);if(h<1)return n;var p=c?Ce(c,0,h).join(""):t.slice(0,h);if(a===i)return p+n;if(c&&(h+=p.length-h),Li(a)){if(t.slice(h).search(a)){var m,y=p;for(a.global||(a=ni(a.source,U(cs.exec(a))+"g")),a.lastIndex=0;m=a.exec(y);)var w=m.index;p=p.slice(0,w===i?h:w)}}else if(t.indexOf(Dt(a),h)!=h){var C=p.lastIndexOf(a);C>-1&&(p=p.slice(0,C))}return p+n}function ev(t){return t=U(t),t&&fu.test(t)?t.replace(as,xc):t}var rv=Ze(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),zi=Ta("toUpperCase");function Ro(t,e,r){return t=U(t),e=r?i:e,e===i?Cc(t)?Rc(t):vc(t):t.match(e)||[]}var To=q(function(t,e){try{return xt(t,i,e)}catch(r){return Ni(r)?r:new D(r)}}),nv=ce(function(t,e){return Mt(e,function(r){r=te(r),oe(t,r,Mi(t[r],t))}),t});function iv(t){var e=t==null?0:t.length,r=j();return t=e?Z(t,function(n){if(typeof n[1]!="function")throw new Bt(O);return[r(n[0]),n[1]]}):[],q(function(n){for(var a=-1;++a<e;){var u=t[a];if(xt(u[0],this,n))return xt(u[1],this,n)}})}function sv(t){return xh(Lt(t,it))}function Wi(t){return function(){return t}}function av(t,e){return t==null||t!==t?e:t}var ov=Ha(),uv=Ha(!0);function At(t){return t}function Ji(t){return fa(typeof t=="function"?t:Lt(t,it))}function cv(t){return pa(Lt(t,it))}function hv(t,e){return da(t,Lt(e,it))}var fv=q(function(t,e){return function(r){return yr(r,t,e)}}),lv=q(function(t,e){return function(r){return yr(t,r,e)}});function Gi(t,e,r){var n=ht(e),a=en(e,n);r==null&&!(X(e)&&(a.length||!n.length))&&(r=e,e=t,t=this,a=en(e,ht(e)));var u=!(X(r)&&"chain"in r)||!!r.chain,c=fe(t);return Mt(a,function(h){var p=e[h];t[h]=p,c&&(t.prototype[h]=function(){var m=this.__chain__;if(u||m){var y=t(this.__wrapped__),w=y.__actions__=Et(this.__actions__);return w.push({func:p,args:arguments,thisArg:t}),y.__chain__=m,y}return p.apply(t,me([this.value()],arguments))})}),t}function pv(){return ft._===this&&(ft._=Mc),this}function Qi(){}function dv(t){return t=T(t),q(function(e){return va(e,t)})}var vv=Ii(Z),gv=Ii(qs),_v=Ii(Kn);function $o(t){return Ri(t)?Zn(te(t)):Jh(t)}function mv(t){return function(e){return t==null?i:Te(t,e)}}var yv=ka(),wv=ka(!0);function Vi(){return[]}function Ki(){return!1}function bv(){return{}}function Pv(){return""}function Ev(){return!0}function Cv(t,e){if(t=T(t),t<1||t>G)return[];var r=gt,n=_t(t,gt);e=j(e),t-=gt;for(var a=ti(n,e);++r<t;)e(r);return a}function Iv(t){return R(t)?Z(t,te):Rt(t)?[t]:Et(Xa(U(t)))}function Av(t){var e=++qc;return U(t)+e}var Ov=un(function(t,e){return t+e},0),jv=Ai("ceil"),xv=un(function(t,e){return t/e},1),Sv=Ai("floor");function Dv(t){return t&&t.length?tn(t,At,fi):i}function Rv(t,e){return t&&t.length?tn(t,j(e,2),fi):i}function Tv(t){return Bs(t,At)}function $v(t,e){return Bs(t,j(e,2))}function Hv(t){return t&&t.length?tn(t,At,vi):i}function qv(t,e){return t&&t.length?tn(t,j(e,2),vi):i}var kv=un(function(t,e){return t*e},1),Mv=Ai("round"),Bv=un(function(t,e){return t-e},0);function Nv(t){return t&&t.length?Xn(t,At):0}function Lv(t,e){return t&&t.length?Xn(t,j(e,2)):0}return o.after=cp,o.ary=ho,o.assign=Kp,o.assignIn=Io,o.assignInWith=bn,o.assignWith=Zp,o.at=Yp,o.before=fo,o.bind=Mi,o.bindAll=nv,o.bindKey=lo,o.castArray=bp,o.chain=oo,o.chunk=Sf,o.compact=Df,o.concat=Rf,o.cond=iv,o.conforms=sv,o.constant=Wi,o.countBy=Nl,o.create=Xp,o.curry=po,o.curryRight=vo,o.debounce=go,o.defaults=td,o.defaultsDeep=ed,o.defer=hp,o.delay=fp,o.difference=Tf,o.differenceBy=$f,o.differenceWith=Hf,o.drop=qf,o.dropRight=kf,o.dropRightWhile=Mf,o.dropWhile=Bf,o.fill=Nf,o.filter=Ul,o.flatMap=Wl,o.flatMapDeep=Jl,o.flatMapDepth=Gl,o.flatten=no,o.flattenDeep=Lf,o.flattenDepth=Uf,o.flip=lp,o.flow=ov,o.flowRight=uv,o.fromPairs=Ff,o.functions=ud,o.functionsIn=cd,o.groupBy=Ql,o.initial=Wf,o.intersection=Jf,o.intersectionBy=Gf,o.intersectionWith=Qf,o.invert=fd,o.invertBy=ld,o.invokeMap=Kl,o.iteratee=Ji,o.keyBy=Zl,o.keys=ht,o.keysIn=It,o.map=vn,o.mapKeys=dd,o.mapValues=vd,o.matches=cv,o.matchesProperty=hv,o.memoize=_n,o.merge=gd,o.mergeWith=Ao,o.method=fv,o.methodOf=lv,o.mixin=Gi,o.negate=mn,o.nthArg=dv,o.omit=_d,o.omitBy=md,o.once=pp,o.orderBy=Yl,o.over=vv,o.overArgs=dp,o.overEvery=gv,o.overSome=_v,o.partial=Bi,o.partialRight=_o,o.partition=Xl,o.pick=yd,o.pickBy=Oo,o.property=$o,o.propertyOf=mv,o.pull=Yf,o.pullAll=so,o.pullAllBy=Xf,o.pullAllWith=tl,o.pullAt=el,o.range=yv,o.rangeRight=wv,o.rearg=vp,o.reject=rp,o.remove=rl,o.rest=gp,o.reverse=qi,o.sampleSize=ip,o.set=bd,o.setWith=Pd,o.shuffle=sp,o.slice=nl,o.sortBy=up,o.sortedUniq=hl,o.sortedUniqBy=fl,o.split=Wd,o.spread=_p,o.tail=ll,o.take=pl,o.takeRight=dl,o.takeRightWhile=vl,o.takeWhile=gl,o.tap=Dl,o.throttle=mp,o.thru=dn,o.toArray=Po,o.toPairs=jo,o.toPairsIn=xo,o.toPath=Iv,o.toPlainObject=Co,o.transform=Ed,o.unary=yp,o.union=_l,o.unionBy=ml,o.unionWith=yl,o.uniq=wl,o.uniqBy=bl,o.uniqWith=Pl,o.unset=Cd,o.unzip=ki,o.unzipWith=ao,o.update=Id,o.updateWith=Ad,o.values=tr,o.valuesIn=Od,o.without=El,o.words=Ro,o.wrap=wp,o.xor=Cl,o.xorBy=Il,o.xorWith=Al,o.zip=Ol,o.zipObject=jl,o.zipObjectDeep=xl,o.zipWith=Sl,o.entries=jo,o.entriesIn=xo,o.extend=Io,o.extendWith=bn,Gi(o,o),o.add=Ov,o.attempt=To,o.camelCase=Dd,o.capitalize=So,o.ceil=jv,o.clamp=jd,o.clone=Pp,o.cloneDeep=Cp,o.cloneDeepWith=Ip,o.cloneWith=Ep,o.conformsTo=Ap,o.deburr=Do,o.defaultTo=av,o.divide=xv,o.endsWith=Rd,o.eq=Kt,o.escape=Td,o.escapeRegExp=$d,o.every=Ll,o.find=Fl,o.findIndex=eo,o.findKey=rd,o.findLast=zl,o.findLastIndex=ro,o.findLastKey=nd,o.floor=Sv,o.forEach=uo,o.forEachRight=co,o.forIn=id,o.forInRight=sd,o.forOwn=ad,o.forOwnRight=od,o.get=Ui,o.gt=Op,o.gte=jp,o.has=hd,o.hasIn=Fi,o.head=io,o.identity=At,o.includes=Vl,o.indexOf=zf,o.inRange=xd,o.invoke=pd,o.isArguments=qe,o.isArray=R,o.isArrayBuffer=xp,o.isArrayLike=Ct,o.isArrayLikeObject=et,o.isBoolean=Sp,o.isBuffer=Ie,o.isDate=Dp,o.isElement=Rp,o.isEmpty=Tp,o.isEqual=$p,o.isEqualWith=Hp,o.isError=Ni,o.isFinite=qp,o.isFunction=fe,o.isInteger=mo,o.isLength=yn,o.isMap=yo,o.isMatch=kp,o.isMatchWith=Mp,o.isNaN=Bp,o.isNative=Np,o.isNil=Up,o.isNull=Lp,o.isNumber=wo,o.isObject=X,o.isObjectLike=tt,o.isPlainObject=Ir,o.isRegExp=Li,o.isSafeInteger=Fp,o.isSet=bo,o.isString=wn,o.isSymbol=Rt,o.isTypedArray=Xe,o.isUndefined=zp,o.isWeakMap=Wp,o.isWeakSet=Jp,o.join=Vf,o.kebabCase=Hd,o.last=Ft,o.lastIndexOf=Kf,o.lowerCase=qd,o.lowerFirst=kd,o.lt=Gp,o.lte=Qp,o.max=Dv,o.maxBy=Rv,o.mean=Tv,o.meanBy=$v,o.min=Hv,o.minBy=qv,o.stubArray=Vi,o.stubFalse=Ki,o.stubObject=bv,o.stubString=Pv,o.stubTrue=Ev,o.multiply=kv,o.nth=Zf,o.noConflict=pv,o.noop=Qi,o.now=gn,o.pad=Md,o.padEnd=Bd,o.padStart=Nd,o.parseInt=Ld,o.random=Sd,o.reduce=tp,o.reduceRight=ep,o.repeat=Ud,o.replace=Fd,o.result=wd,o.round=Mv,o.runInContext=l,o.sample=np,o.size=ap,o.snakeCase=zd,o.some=op,o.sortedIndex=il,o.sortedIndexBy=sl,o.sortedIndexOf=al,o.sortedLastIndex=ol,o.sortedLastIndexBy=ul,o.sortedLastIndexOf=cl,o.startCase=Jd,o.startsWith=Gd,o.subtract=Bv,o.sum=Nv,o.sumBy=Lv,o.template=Qd,o.times=Cv,o.toFinite=le,o.toInteger=T,o.toLength=Eo,o.toLower=Vd,o.toNumber=zt,o.toSafeInteger=Vp,o.toString=U,o.toUpper=Kd,o.trim=Zd,o.trimEnd=Yd,o.trimStart=Xd,o.truncate=tv,o.unescape=ev,o.uniqueId=Av,o.upperCase=rv,o.upperFirst=zi,o.each=uo,o.eachRight=co,o.first=io,Gi(o,function(){var t={};return Yt(o,function(e,r){z.call(o.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),o.VERSION=f,Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){o[t].placeholder=o}),Mt(["drop","take"],function(t,e){M.prototype[t]=function(r){r=r===i?1:ot(T(r),0);var n=this.__filtered__&&!e?new M(this):this.clone();return n.__filtered__?n.__takeCount__=_t(r,n.__takeCount__):n.__views__.push({size:_t(r,gt),type:t+(n.__dir__<0?"Right":"")}),n},M.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),Mt(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==v||r==$;M.prototype[t]=function(a){var u=this.clone();return u.__iteratees__.push({iteratee:j(a,3),type:r}),u.__filtered__=u.__filtered__||n,u}}),Mt(["head","last"],function(t,e){var r="take"+(e?"Right":"");M.prototype[t]=function(){return this[r](1).value()[0]}}),Mt(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");M.prototype[t]=function(){return this.__filtered__?new M(this):this[r](1)}}),M.prototype.compact=function(){return this.filter(At)},M.prototype.find=function(t){return this.filter(t).head()},M.prototype.findLast=function(t){return this.reverse().find(t)},M.prototype.invokeMap=q(function(t,e){return typeof t=="function"?new M(this):this.map(function(r){return yr(r,t,e)})}),M.prototype.reject=function(t){return this.filter(mn(j(t)))},M.prototype.slice=function(t,e){t=T(t);var r=this;return r.__filtered__&&(t>0||e<0)?new M(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(e=T(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},M.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},M.prototype.toArray=function(){return this.take(gt)},Yt(M.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),a=o[n?"take"+(e=="last"?"Right":""):e],u=n||/^find/.test(e);a&&(o.prototype[e]=function(){var c=this.__wrapped__,h=n?[1]:arguments,p=c instanceof M,m=h[0],y=p||R(c),w=function(k){var B=a.apply(o,me([k],h));return n&&C?B[0]:B};y&&r&&typeof m=="function"&&m.length!=1&&(p=y=!1);var C=this.__chain__,A=!!this.__actions__.length,x=u&&!C,H=p&&!A;if(!u&&y){c=H?c:new M(this);var S=t.apply(c,h);return S.__actions__.push({func:dn,args:[w],thisArg:i}),new Nt(S,C)}return x&&H?t.apply(this,h):(S=this.thru(w),x?n?S.value()[0]:S.value():S)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(t){var e=Br[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);o.prototype[t]=function(){var a=arguments;if(n&&!this.__chain__){var u=this.value();return e.apply(R(u)?u:[],a)}return this[r](function(c){return e.apply(R(c)?c:[],a)})}}),Yt(M.prototype,function(t,e){var r=o[e];if(r){var n=r.name+"";z.call(Qe,n)||(Qe[n]=[]),Qe[n].push({name:e,func:r})}}),Qe[on(i,ee).name]=[{name:"wrapper",func:i}],M.prototype.clone=th,M.prototype.reverse=eh,M.prototype.value=rh,o.prototype.at=Rl,o.prototype.chain=Tl,o.prototype.commit=$l,o.prototype.next=Hl,o.prototype.plant=kl,o.prototype.reverse=Ml,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=Bl,o.prototype.first=o.prototype.head,lr&&(o.prototype[lr]=ql),o},We=Tc();je?((je.exports=We)._=We,Jn._=We):ft._=We}).call(Ar)})(rs,rs.exports);var Yv=Object.defineProperty,Xv=Object.defineProperties,tg=Object.getOwnPropertyDescriptors,Uo=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,rg=Object.prototype.propertyIsEnumerable,Fo=(b,s,i)=>s in b?Yv(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Pn=(b,s)=>{for(var i in s||(s={}))eg.call(s,i)&&Fo(b,i,s[i]);if(Uo)for(var i of Uo(s))rg.call(s,i)&&Fo(b,i,s[i]);return b},ng=(b,s)=>Xv(b,tg(s));function Ae(b,s,i){var f;const g=nt.ve(b);return((f=s.rpcMap)==null?void 0:f[g.reference])||`${Zv}?chainId=${g.namespace}:${g.reference}&projectId=${i}`}function Me(b){return b.includes(":")?b.split(":")[1]:b}function Ko(b){return b.map(s=>`${s.split(":")[0]}:${s.split(":")[1]}`)}function ig(b,s){const i=Object.keys(s.namespaces).filter(g=>g.includes(b));if(!i.length)return[];const f=[];return i.forEach(g=>{const P=s.namespaces[g].accounts;f.push(...P)}),f}function sg(b={},s={}){const i=zo(b),f=zo(s);return rs.exports.merge(i,f)}function zo(b){var s,i,f,g;const P={};if(!nt.B(b))return P;for(const[O,N]of Object.entries(b)){const ut=nt.oe(O)?[O]:N.chains,st=N.methods||[],dt=N.events||[],it=N.rpcMap||{},vt=nt.en(O);P[vt]=ng(Pn(Pn({},P[vt]),N),{chains:nt.S(ut,(s=P[vt])==null?void 0:s.chains),methods:nt.S(st,(i=P[vt])==null?void 0:i.methods),events:nt.S(dt,(f=P[vt])==null?void 0:f.events),rpcMap:Pn(Pn({},it),(g=P[vt])==null?void 0:g.rpcMap)})}return P}function ag(b){return b.includes(":")?b.split(":")[2]:b}function og(b){const s={};for(const[i,f]of Object.entries(b)){const g=f.methods||[],P=f.events||[],O=f.accounts||[],N=nt.oe(i)?[i]:f.chains?f.chains:Ko(f.accounts);s[i]={chains:N,methods:g,events:P,accounts:O}}return s}function Zi(b){return typeof b=="number"?b:b.includes("0x")?parseInt(b,16):b.includes(":")?Number(b.split(":")[1]):Number(b)}const Zo={},Y=b=>Zo[b],Yi=(b,s)=>{Zo[b]=s};class ug{constructor(s){this.name="polkadot",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class cg{constructor(s){this.name="eip155",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(s){switch(s.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(s);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(s.request.method)?await this.client.request(s):this.getHttpProvider().request(s.request)}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(parseInt(s),i),this.chainId=parseInt(s),this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}createHttpProvider(s,i){const f=i||Ae(`${this.name}:${s}`,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=parseInt(Me(i));s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}getHttpProvider(){const s=this.chainId,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}async handleSwitchChain(s){var i,f;let g=s.request.params?(i=s.request.params[0])==null?void 0:i.chainId:"0x0";g=g.startsWith("0x")?g:`0x${g}`;const P=parseInt(g,16);if(this.isChainApproved(P))this.setDefaultChain(`${P}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:s.topic,request:{method:s.request.method,params:[{chainId:g}]},chainId:(f=this.namespace.chains)==null?void 0:f[0]}),this.setDefaultChain(`${P}`);else throw new Error(`Failed to switch to chain 'eip155:${P}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(s){return this.namespace.chains.includes(`${this.name}:${s}`)}}class hg{constructor(s){this.name="solana",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class fg{constructor(s){this.name="cosmos",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class lg{constructor(s){this.name="cip34",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{const f=this.getCardanoRPCUrl(i),g=Me(i);s[g]=this.createHttpProvider(g,f)}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}getCardanoRPCUrl(s){const i=this.namespace.rpcMap;if(i)return i[s]}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||this.getCardanoRPCUrl(s);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class pg{constructor(s){this.name="elrond",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class dg{constructor(s){this.name="multiversx",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class vg{constructor(s){this.name="near",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){if(this.chainId=s,!this.httpProviders[s]){const f=i||Ae(`${this.name}:${s}`,this.namespace);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);this.setHttpProvider(s,f)}this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;s[i]=this.createHttpProvider(i,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace);return typeof f>"u"?void 0:new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}var gg=Object.defineProperty,_g=Object.defineProperties,mg=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,yg=Object.prototype.hasOwnProperty,wg=Object.prototype.propertyIsEnumerable,Jo=(b,s,i)=>s in b?gg(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,En=(b,s)=>{for(var i in s||(s={}))yg.call(s,i)&&Jo(b,i,s[i]);if(Wo)for(var i of Wo(s))wg.call(s,i)&&Jo(b,i,s[i]);return b},Xi=(b,s)=>_g(b,mg(s));class ns{constructor(s){this.events=new ke.EventEmitter,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=s,this.logger=typeof(s==null?void 0:s.logger)<"u"&&typeof(s==null?void 0:s.logger)!="string"?s.logger:pt.cjs.pino(pt.cjs.getDefaultLoggerOptions({level:(s==null?void 0:s.logger)||No})),this.disableProviderPing=(s==null?void 0:s.disableProviderPing)||!1}static async init(s){const i=new ns(s);return await i.initialize(),i}async request(s,i){const[f,g]=this.validateChain(i);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(f).request({request:En({},s),chainId:`${f}:${g}`,topic:this.session.topic})}sendAsync(s,i,f){const g=new Date().getTime();this.request(s,f).then(P=>i(null,pt.formatJsonRpcResult(g,P))).catch(P=>i(P,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 s;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(s=this.session)==null?void 0:s.topic,reason:nt.U("USER_DISCONNECTED")}),await this.cleanup()}async connect(s){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(s),await this.cleanupPendingPairings(),!s.skipPairing)return await this.pair(s.pairingTopic)}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}removeListener(s,i){this.events.removeListener(s,i)}off(s,i){this.events.off(s,i)}get isWalletConnect(){return!0}async pair(s){this.shouldAbortPairingAttempt=!1;let i=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(i>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:f,approval:g}=await this.client.connect({pairingTopic:s,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});f&&(this.uri=f,this.events.emit("display_uri",f)),await g().then(P=>{this.session=P,this.namespaces||(this.namespaces=og(P.namespaces),this.persist("namespaces",this.namespaces))}).catch(P=>{if(P.message!==pt.oe)throw P;i++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(s,i){try{if(!this.session)return;const[f,g]=this.validateChain(s);this.getProvider(f).setDefaultChain(g,i)}catch(f){if(!/Please call connect/.test(f.message))throw f}}async cleanupPendingPairings(s={}){this.logger.info("Cleaning up inactive pairings...");const i=this.client.pairing.getAll();if(nt.k(i)){for(const f of i)s.deletePairings?this.client.core.expirer.set(f.topic,0):await this.client.core.relayer.subscriber.unsubscribe(f.topic);this.logger.info(`Inactive pairings cleared: ${i.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 s=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[s]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await pt.Q.init({logger:this.providerOpts.logger||No,relayUrl:this.providerOpts.relayUrl||Qv,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),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 s=[...new Set(Object.keys(this.session.namespaces).map(i=>nt.en(i)))];Yi("client",this.client),Yi("events",this.events),Yi("disableProviderPing",this.disableProviderPing),s.forEach(i=>{if(!this.session)return;const f=ig(i,this.session),g=Ko(f),P=sg(this.namespaces,this.optionalNamespaces),O=Xi(En({},P[i]),{accounts:f,chains:g});switch(i){case"eip155":this.rpcProviders[i]=new cg({namespace:O});break;case"solana":this.rpcProviders[i]=new hg({namespace:O});break;case"cosmos":this.rpcProviders[i]=new fg({namespace:O});break;case"polkadot":this.rpcProviders[i]=new ug({namespace:O});break;case"cip34":this.rpcProviders[i]=new lg({namespace:O});break;case"elrond":this.rpcProviders[i]=new pg({namespace:O});break;case"multiversx":this.rpcProviders[i]=new dg({namespace:O});break;case"near":this.rpcProviders[i]=new vg({namespace:O});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",s=>{this.events.emit("session_ping",s)}),this.client.on("session_event",s=>{const{params:i}=s,{event:f}=i;if(f.name==="accountsChanged"){const g=f.data;g&&nt.k(g)&&this.events.emit("accountsChanged",g.map(ag))}else if(f.name==="chainChanged"){const g=i.chainId,P=i.event.data,O=nt.en(g),N=Zi(g)!==Zi(P)?`${O}:${Zi(P)}`:g;this.onChainChanged(N)}else this.events.emit(f.name,f.data);this.events.emit("session_event",s)}),this.client.on("session_update",({topic:s,params:i})=>{var f;const{namespaces:g}=i,P=(f=this.client)==null?void 0:f.session.get(s);this.session=Xi(En({},P),{namespaces:g}),this.onSessionUpdate(),this.events.emit("session_update",{topic:s,params:i})}),this.client.on("session_delete",async s=>{await this.cleanup(),this.events.emit("session_delete",s),this.events.emit("disconnect",Xi(En({},nt.U("USER_DISCONNECTED")),{data:s.topic}))}),this.on(de.DEFAULT_CHAIN_CHANGED,s=>{this.onChainChanged(s,!0)})}getProvider(s){if(!this.rpcProviders[s])throw new Error(`Provider not found: ${s}`);return this.rpcProviders[s]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(s=>{var i;this.getProvider(s).updateNamespace((i=this.session)==null?void 0:i.namespaces[s])})}setNamespaces(s){const{namespaces:i,optionalNamespaces:f,sessionProperties:g}=s;i&&Object.keys(i).length&&(this.namespaces=i),f&&Object.keys(f).length&&(this.optionalNamespaces=f),this.sessionProperties=g,this.persist("namespaces",i),this.persist("optionalNamespaces",f)}validateChain(s){const[i,f]=(s==null?void 0:s.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,f];if(i&&!Object.keys(this.namespaces||{}).map(O=>nt.en(O)).includes(i))throw new Error(`Namespace '${i}' is not configured. Please call connect() first with namespace config.`);if(i&&f)return[i,f];const g=nt.en(Object.keys(this.namespaces)[0]),P=this.rpcProviders[g].getDefaultChain();return[g,P]}async requestAccounts(){const[s]=this.validateChain();return await this.getProvider(s).requestAccounts()}onChainChanged(s,i=!1){var f;if(!this.namespaces)return;const[g,P]=this.validateChain(s);i||this.getProvider(g).setDefaultChain(P),((f=this.namespaces[g])!=null?f:this.namespaces[`${g}:${P}`]).defaultChain=P,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",P)}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(s,i){this.client.core.storage.setItem(`${Lo}/${s}`,i)}async getFromStore(s){return await this.client.core.storage.getItem(`${Lo}/${s}`)}}const bg=ns,Pg="wc",Eg="ethereum_provider",Cg=`${Pg}@2:${Eg}:`,Ig="https://rpc.walletconnect.com/v1/",Cn=["eth_sendTransaction","personal_sign"],Yo=["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"],In=["chainChanged","accountsChanged"],Xo=["chainChanged","accountsChanged","message","disconnect","connect"];var Ag=Object.defineProperty,Og=Object.defineProperties,jg=Object.getOwnPropertyDescriptors,Go=Object.getOwnPropertySymbols,xg=Object.prototype.hasOwnProperty,Sg=Object.prototype.propertyIsEnumerable,Qo=(b,s,i)=>s in b?Ag(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Or=(b,s)=>{for(var i in s||(s={}))xg.call(s,i)&&Qo(b,i,s[i]);if(Go)for(var i of Go(s))Sg.call(s,i)&&Qo(b,i,s[i]);return b},Vo=(b,s)=>Og(b,jg(s));function An(b){return Number(b[0].split(":")[1])}function ts(b){return`0x${b.toString(16)}`}function Dg(b){const{chains:s,optionalChains:i,methods:f,optionalMethods:g,events:P,optionalEvents:O,rpcMap:N}=b;if(!nt.k(s))throw new Error("Invalid chains");const ut={chains:s,methods:f||Cn,events:P||In,rpcMap:Or({},s.length?{[An(s)]:N[An(s)]}:{})},st=P==null?void 0:P.filter(ct=>!In.includes(ct)),dt=f==null?void 0:f.filter(ct=>!Cn.includes(ct));if(!i&&!O&&!g&&!(st!=null&&st.length)&&!(dt!=null&&dt.length))return{required:s.length?ut:void 0};const it=(st==null?void 0:st.length)&&(dt==null?void 0:dt.length)||!i,vt={chains:[...new Set(it?ut.chains.concat(i||[]):i)],methods:[...new Set(ut.methods.concat(g!=null&&g.length?g:Yo))],events:[...new Set(ut.events.concat(O!=null&&O.length?O:Xo))],rpcMap:N};return{required:s.length?ut:void 0,optional:i.length?vt:void 0}}class On{constructor(){this.events=new ke.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Cg,this.on=(s,i)=>(this.events.on(s,i),this),this.once=(s,i)=>(this.events.once(s,i),this),this.removeListener=(s,i)=>(this.events.removeListener(s,i),this),this.off=(s,i)=>(this.events.off(s,i),this),this.parseAccount=s=>this.isCompatibleChainId(s)?this.parseAccountId(s).address:s,this.signer={},this.rpc={}}static async init(s){const i=new On;return await i.initialize(s),i}async request(s){return await this.signer.request(s,this.formatChainId(this.chainId))}sendAsync(s,i){this.signer.sendAsync(s,i,this.formatChainId(this.chainId))}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(s){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(s);const{required:i,optional:f}=Dg(this.rpc);try{const g=await new Promise(async(O,N)=>{var ut;this.rpc.showQrModal&&((ut=this.modal)==null||ut.subscribeModal(st=>{!st.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),N(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Vo(Or({namespaces:Or({},i&&{[this.namespace]:i})},f&&{optionalNamespaces:{[this.namespace]:f}}),{pairingTopic:s==null?void 0:s.pairingTopic})).then(st=>{O(st)}).catch(st=>{N(new Error(st.message))})});if(!g)return;const P=nt.Un(g.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:P),this.setAccounts(P),this.events.emit("connect",{chainId:ts(this.chainId)})}catch(g){throw this.signer.logger.error(g),g}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",s=>{const{params:i}=s,{event:f}=i;f.name==="accountsChanged"?(this.accounts=this.parseAccounts(f.data),this.events.emit("accountsChanged",this.accounts)):f.name==="chainChanged"?this.setChainId(this.formatChainId(f.data)):this.events.emit(f.name,f.data),this.events.emit("session_event",s)}),this.signer.on("chainChanged",s=>{const i=parseInt(s);this.chainId=i,this.events.emit("chainChanged",ts(this.chainId)),this.persist()}),this.signer.on("session_update",s=>{this.events.emit("session_update",s)}),this.signer.on("session_delete",s=>{this.reset(),this.events.emit("session_delete",s),this.events.emit("disconnect",Vo(Or({},nt.U("USER_DISCONNECTED")),{data:s.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",s=>{var i,f;this.rpc.showQrModal&&((i=this.modal)==null||i.closeModal(),(f=this.modal)==null||f.openModal({uri:s})),this.events.emit("display_uri",s)})}switchEthereumChain(s){this.request({method:"wallet_switchEthereumChain",params:[{chainId:s.toString(16)}]})}isCompatibleChainId(s){return typeof s=="string"?s.startsWith(`${this.namespace}:`):!1}formatChainId(s){return`${this.namespace}:${s}`}parseChainId(s){return Number(s.split(":")[1])}setChainIds(s){const i=s.filter(f=>this.isCompatibleChainId(f)).map(f=>this.parseChainId(f));i.length&&(this.chainId=i[0],this.events.emit("chainChanged",ts(this.chainId)),this.persist())}setChainId(s){if(this.isCompatibleChainId(s)){const i=this.parseChainId(s);this.chainId=i,this.switchEthereumChain(i)}}parseAccountId(s){const[i,f,g]=s.split(":");return{chainId:`${i}:${f}`,address:g}}setAccounts(s){this.accounts=s.filter(i=>this.parseChainId(this.parseAccountId(i).chainId)===this.chainId).map(i=>this.parseAccountId(i).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(s){var i,f;const g=(i=s==null?void 0:s.chains)!=null?i:[],P=(f=s==null?void 0:s.optionalChains)!=null?f:[],O=g.concat(P);if(!O.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const N=g.length?(s==null?void 0:s.methods)||Cn:[],ut=g.length?(s==null?void 0:s.events)||In:[],st=(s==null?void 0:s.optionalMethods)||[],dt=(s==null?void 0:s.optionalEvents)||[],it=(s==null?void 0:s.rpcMap)||this.buildRpcMap(O,s.projectId),vt=(s==null?void 0:s.qrModalOptions)||void 0;return{chains:g==null?void 0:g.map(ct=>this.formatChainId(ct)),optionalChains:P.map(ct=>this.formatChainId(ct)),methods:N,events:ut,optionalMethods:st,optionalEvents:dt,rpcMap:it,showQrModal:!!(s!=null&&s.showQrModal),qrModalOptions:vt,projectId:s.projectId,metadata:s.metadata}}buildRpcMap(s,i){const f={};return s.forEach(g=>{f[g]=this.getRpcUrl(g,i)}),f}async initialize(s){if(this.rpc=this.getRpcConfig(s),this.chainId=this.rpc.chains.length?An(this.rpc.chains):An(this.rpc.optionalChains),this.signer=await bg.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:s.disableProviderPing,relayUrl:s.relayUrl,storageOptions:s.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let i;try{const{WalletConnectModal:f}=await Promise.resolve().then(()=>require("./index-dEADQOcf.js")).then(g=>g.index);i=f}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(i)try{this.modal=new i(Or({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(f){throw this.signer.logger.error(f),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(s){if(!s)return;const{chains:i,optionalChains:f,rpcMap:g}=s;i&&nt.k(i)&&(this.rpc.chains=i.map(P=>this.formatChainId(P)),i.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)})),f&&nt.k(f)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=f==null?void 0:f.map(P=>this.formatChainId(P)),f.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)}))}getRpcUrl(s,i){var f;return((f=this.rpc.rpcMap)==null?void 0:f[s])||`${Ig}?chainId=eip155:${s}&projectId=${i||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const s=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),i=this.session.namespaces[`${this.namespace}:${s}`]?this.session.namespaces[`${this.namespace}:${s}`]:this.session.namespaces[this.namespace];this.setChainIds(s?[this.formatChainId(s)]:i==null?void 0:i.accounts),this.setAccounts(i==null?void 0:i.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(s){return typeof s=="string"||s instanceof String?[this.parseAccount(s)]:s.map(i=>this.parseAccount(i))}}const Rg=On;exports.EthereumProvider=Rg;exports.OPTIONAL_EVENTS=Xo;exports.OPTIONAL_METHODS=Yo;exports.REQUIRED_EVENTS=In;exports.REQUIRED_METHODS=Cn;exports.default=On;
|
|
27
|
+
}`;var H=To(function(){return L(u,A+"return "+w).apply(i,c)});if(H.source=w,Ni(H))throw H;return H}function Vd(t){return U(t).toLowerCase()}function Kd(t){return U(t).toUpperCase()}function Zd(t,e,r){if(t=U(t),t&&(r||e===i))return Ls(t);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Qt(e),u=Us(n,a),c=Fs(n,a)+1;return Ce(n,u,c).join("")}function Yd(t,e,r){if(t=U(t),t&&(r||e===i))return t.slice(0,Ws(t)+1);if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Fs(n,Qt(e))+1;return Ce(n,0,a).join("")}function Xd(t,e,r){if(t=U(t),t&&(r||e===i))return t.replace(Nn,"");if(!t||!(e=Dt(e)))return t;var n=Qt(t),a=Us(n,Qt(e));return Ce(n,a).join("")}function tv(t,e){var r=jn,n=qt;if(X(e)){var a="separator"in e?e.separator:a;r="length"in e?T(e.length):r,n="omission"in e?Dt(e.omission):n}t=U(t);var u=t.length;if(Fe(t)){var c=Qt(t);u=c.length}if(r>=u)return t;var h=r-ze(n);if(h<1)return n;var p=c?Ce(c,0,h).join(""):t.slice(0,h);if(a===i)return p+n;if(c&&(h+=p.length-h),Li(a)){if(t.slice(h).search(a)){var m,y=p;for(a.global||(a=ni(a.source,U(cs.exec(a))+"g")),a.lastIndex=0;m=a.exec(y);)var w=m.index;p=p.slice(0,w===i?h:w)}}else if(t.indexOf(Dt(a),h)!=h){var C=p.lastIndexOf(a);C>-1&&(p=p.slice(0,C))}return p+n}function ev(t){return t=U(t),t&&fu.test(t)?t.replace(as,xc):t}var rv=Ze(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),zi=Ta("toUpperCase");function Ro(t,e,r){return t=U(t),e=r?i:e,e===i?Cc(t)?Rc(t):vc(t):t.match(e)||[]}var To=q(function(t,e){try{return xt(t,i,e)}catch(r){return Ni(r)?r:new D(r)}}),nv=ce(function(t,e){return Mt(e,function(r){r=te(r),oe(t,r,Mi(t[r],t))}),t});function iv(t){var e=t==null?0:t.length,r=j();return t=e?Z(t,function(n){if(typeof n[1]!="function")throw new Bt(O);return[r(n[0]),n[1]]}):[],q(function(n){for(var a=-1;++a<e;){var u=t[a];if(xt(u[0],this,n))return xt(u[1],this,n)}})}function sv(t){return xh(Lt(t,it))}function Wi(t){return function(){return t}}function av(t,e){return t==null||t!==t?e:t}var ov=Ha(),uv=Ha(!0);function At(t){return t}function Ji(t){return fa(typeof t=="function"?t:Lt(t,it))}function cv(t){return pa(Lt(t,it))}function hv(t,e){return da(t,Lt(e,it))}var fv=q(function(t,e){return function(r){return yr(r,t,e)}}),lv=q(function(t,e){return function(r){return yr(t,r,e)}});function Gi(t,e,r){var n=ht(e),a=en(e,n);r==null&&!(X(e)&&(a.length||!n.length))&&(r=e,e=t,t=this,a=en(e,ht(e)));var u=!(X(r)&&"chain"in r)||!!r.chain,c=fe(t);return Mt(a,function(h){var p=e[h];t[h]=p,c&&(t.prototype[h]=function(){var m=this.__chain__;if(u||m){var y=t(this.__wrapped__),w=y.__actions__=Et(this.__actions__);return w.push({func:p,args:arguments,thisArg:t}),y.__chain__=m,y}return p.apply(t,me([this.value()],arguments))})}),t}function pv(){return ft._===this&&(ft._=Mc),this}function Qi(){}function dv(t){return t=T(t),q(function(e){return va(e,t)})}var vv=Ii(Z),gv=Ii(qs),_v=Ii(Kn);function $o(t){return Ri(t)?Zn(te(t)):Jh(t)}function mv(t){return function(e){return t==null?i:Te(t,e)}}var yv=ka(),wv=ka(!0);function Vi(){return[]}function Ki(){return!1}function bv(){return{}}function Pv(){return""}function Ev(){return!0}function Cv(t,e){if(t=T(t),t<1||t>G)return[];var r=gt,n=_t(t,gt);e=j(e),t-=gt;for(var a=ti(n,e);++r<t;)e(r);return a}function Iv(t){return R(t)?Z(t,te):Rt(t)?[t]:Et(Xa(U(t)))}function Av(t){var e=++qc;return U(t)+e}var Ov=un(function(t,e){return t+e},0),jv=Ai("ceil"),xv=un(function(t,e){return t/e},1),Sv=Ai("floor");function Dv(t){return t&&t.length?tn(t,At,fi):i}function Rv(t,e){return t&&t.length?tn(t,j(e,2),fi):i}function Tv(t){return Bs(t,At)}function $v(t,e){return Bs(t,j(e,2))}function Hv(t){return t&&t.length?tn(t,At,vi):i}function qv(t,e){return t&&t.length?tn(t,j(e,2),vi):i}var kv=un(function(t,e){return t*e},1),Mv=Ai("round"),Bv=un(function(t,e){return t-e},0);function Nv(t){return t&&t.length?Xn(t,At):0}function Lv(t,e){return t&&t.length?Xn(t,j(e,2)):0}return o.after=cp,o.ary=ho,o.assign=Kp,o.assignIn=Io,o.assignInWith=bn,o.assignWith=Zp,o.at=Yp,o.before=fo,o.bind=Mi,o.bindAll=nv,o.bindKey=lo,o.castArray=bp,o.chain=oo,o.chunk=Sf,o.compact=Df,o.concat=Rf,o.cond=iv,o.conforms=sv,o.constant=Wi,o.countBy=Nl,o.create=Xp,o.curry=po,o.curryRight=vo,o.debounce=go,o.defaults=td,o.defaultsDeep=ed,o.defer=hp,o.delay=fp,o.difference=Tf,o.differenceBy=$f,o.differenceWith=Hf,o.drop=qf,o.dropRight=kf,o.dropRightWhile=Mf,o.dropWhile=Bf,o.fill=Nf,o.filter=Ul,o.flatMap=Wl,o.flatMapDeep=Jl,o.flatMapDepth=Gl,o.flatten=no,o.flattenDeep=Lf,o.flattenDepth=Uf,o.flip=lp,o.flow=ov,o.flowRight=uv,o.fromPairs=Ff,o.functions=ud,o.functionsIn=cd,o.groupBy=Ql,o.initial=Wf,o.intersection=Jf,o.intersectionBy=Gf,o.intersectionWith=Qf,o.invert=fd,o.invertBy=ld,o.invokeMap=Kl,o.iteratee=Ji,o.keyBy=Zl,o.keys=ht,o.keysIn=It,o.map=vn,o.mapKeys=dd,o.mapValues=vd,o.matches=cv,o.matchesProperty=hv,o.memoize=_n,o.merge=gd,o.mergeWith=Ao,o.method=fv,o.methodOf=lv,o.mixin=Gi,o.negate=mn,o.nthArg=dv,o.omit=_d,o.omitBy=md,o.once=pp,o.orderBy=Yl,o.over=vv,o.overArgs=dp,o.overEvery=gv,o.overSome=_v,o.partial=Bi,o.partialRight=_o,o.partition=Xl,o.pick=yd,o.pickBy=Oo,o.property=$o,o.propertyOf=mv,o.pull=Yf,o.pullAll=so,o.pullAllBy=Xf,o.pullAllWith=tl,o.pullAt=el,o.range=yv,o.rangeRight=wv,o.rearg=vp,o.reject=rp,o.remove=rl,o.rest=gp,o.reverse=qi,o.sampleSize=ip,o.set=bd,o.setWith=Pd,o.shuffle=sp,o.slice=nl,o.sortBy=up,o.sortedUniq=hl,o.sortedUniqBy=fl,o.split=Wd,o.spread=_p,o.tail=ll,o.take=pl,o.takeRight=dl,o.takeRightWhile=vl,o.takeWhile=gl,o.tap=Dl,o.throttle=mp,o.thru=dn,o.toArray=Po,o.toPairs=jo,o.toPairsIn=xo,o.toPath=Iv,o.toPlainObject=Co,o.transform=Ed,o.unary=yp,o.union=_l,o.unionBy=ml,o.unionWith=yl,o.uniq=wl,o.uniqBy=bl,o.uniqWith=Pl,o.unset=Cd,o.unzip=ki,o.unzipWith=ao,o.update=Id,o.updateWith=Ad,o.values=tr,o.valuesIn=Od,o.without=El,o.words=Ro,o.wrap=wp,o.xor=Cl,o.xorBy=Il,o.xorWith=Al,o.zip=Ol,o.zipObject=jl,o.zipObjectDeep=xl,o.zipWith=Sl,o.entries=jo,o.entriesIn=xo,o.extend=Io,o.extendWith=bn,Gi(o,o),o.add=Ov,o.attempt=To,o.camelCase=Dd,o.capitalize=So,o.ceil=jv,o.clamp=jd,o.clone=Pp,o.cloneDeep=Cp,o.cloneDeepWith=Ip,o.cloneWith=Ep,o.conformsTo=Ap,o.deburr=Do,o.defaultTo=av,o.divide=xv,o.endsWith=Rd,o.eq=Kt,o.escape=Td,o.escapeRegExp=$d,o.every=Ll,o.find=Fl,o.findIndex=eo,o.findKey=rd,o.findLast=zl,o.findLastIndex=ro,o.findLastKey=nd,o.floor=Sv,o.forEach=uo,o.forEachRight=co,o.forIn=id,o.forInRight=sd,o.forOwn=ad,o.forOwnRight=od,o.get=Ui,o.gt=Op,o.gte=jp,o.has=hd,o.hasIn=Fi,o.head=io,o.identity=At,o.includes=Vl,o.indexOf=zf,o.inRange=xd,o.invoke=pd,o.isArguments=qe,o.isArray=R,o.isArrayBuffer=xp,o.isArrayLike=Ct,o.isArrayLikeObject=et,o.isBoolean=Sp,o.isBuffer=Ie,o.isDate=Dp,o.isElement=Rp,o.isEmpty=Tp,o.isEqual=$p,o.isEqualWith=Hp,o.isError=Ni,o.isFinite=qp,o.isFunction=fe,o.isInteger=mo,o.isLength=yn,o.isMap=yo,o.isMatch=kp,o.isMatchWith=Mp,o.isNaN=Bp,o.isNative=Np,o.isNil=Up,o.isNull=Lp,o.isNumber=wo,o.isObject=X,o.isObjectLike=tt,o.isPlainObject=Ir,o.isRegExp=Li,o.isSafeInteger=Fp,o.isSet=bo,o.isString=wn,o.isSymbol=Rt,o.isTypedArray=Xe,o.isUndefined=zp,o.isWeakMap=Wp,o.isWeakSet=Jp,o.join=Vf,o.kebabCase=Hd,o.last=Ft,o.lastIndexOf=Kf,o.lowerCase=qd,o.lowerFirst=kd,o.lt=Gp,o.lte=Qp,o.max=Dv,o.maxBy=Rv,o.mean=Tv,o.meanBy=$v,o.min=Hv,o.minBy=qv,o.stubArray=Vi,o.stubFalse=Ki,o.stubObject=bv,o.stubString=Pv,o.stubTrue=Ev,o.multiply=kv,o.nth=Zf,o.noConflict=pv,o.noop=Qi,o.now=gn,o.pad=Md,o.padEnd=Bd,o.padStart=Nd,o.parseInt=Ld,o.random=Sd,o.reduce=tp,o.reduceRight=ep,o.repeat=Ud,o.replace=Fd,o.result=wd,o.round=Mv,o.runInContext=l,o.sample=np,o.size=ap,o.snakeCase=zd,o.some=op,o.sortedIndex=il,o.sortedIndexBy=sl,o.sortedIndexOf=al,o.sortedLastIndex=ol,o.sortedLastIndexBy=ul,o.sortedLastIndexOf=cl,o.startCase=Jd,o.startsWith=Gd,o.subtract=Bv,o.sum=Nv,o.sumBy=Lv,o.template=Qd,o.times=Cv,o.toFinite=le,o.toInteger=T,o.toLength=Eo,o.toLower=Vd,o.toNumber=zt,o.toSafeInteger=Vp,o.toString=U,o.toUpper=Kd,o.trim=Zd,o.trimEnd=Yd,o.trimStart=Xd,o.truncate=tv,o.unescape=ev,o.uniqueId=Av,o.upperCase=rv,o.upperFirst=zi,o.each=uo,o.eachRight=co,o.first=io,Gi(o,function(){var t={};return Yt(o,function(e,r){z.call(o.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),o.VERSION=f,Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){o[t].placeholder=o}),Mt(["drop","take"],function(t,e){M.prototype[t]=function(r){r=r===i?1:ot(T(r),0);var n=this.__filtered__&&!e?new M(this):this.clone();return n.__filtered__?n.__takeCount__=_t(r,n.__takeCount__):n.__views__.push({size:_t(r,gt),type:t+(n.__dir__<0?"Right":"")}),n},M.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),Mt(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==v||r==$;M.prototype[t]=function(a){var u=this.clone();return u.__iteratees__.push({iteratee:j(a,3),type:r}),u.__filtered__=u.__filtered__||n,u}}),Mt(["head","last"],function(t,e){var r="take"+(e?"Right":"");M.prototype[t]=function(){return this[r](1).value()[0]}}),Mt(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");M.prototype[t]=function(){return this.__filtered__?new M(this):this[r](1)}}),M.prototype.compact=function(){return this.filter(At)},M.prototype.find=function(t){return this.filter(t).head()},M.prototype.findLast=function(t){return this.reverse().find(t)},M.prototype.invokeMap=q(function(t,e){return typeof t=="function"?new M(this):this.map(function(r){return yr(r,t,e)})}),M.prototype.reject=function(t){return this.filter(mn(j(t)))},M.prototype.slice=function(t,e){t=T(t);var r=this;return r.__filtered__&&(t>0||e<0)?new M(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(e=T(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},M.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},M.prototype.toArray=function(){return this.take(gt)},Yt(M.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),a=o[n?"take"+(e=="last"?"Right":""):e],u=n||/^find/.test(e);a&&(o.prototype[e]=function(){var c=this.__wrapped__,h=n?[1]:arguments,p=c instanceof M,m=h[0],y=p||R(c),w=function(k){var B=a.apply(o,me([k],h));return n&&C?B[0]:B};y&&r&&typeof m=="function"&&m.length!=1&&(p=y=!1);var C=this.__chain__,A=!!this.__actions__.length,x=u&&!C,H=p&&!A;if(!u&&y){c=H?c:new M(this);var S=t.apply(c,h);return S.__actions__.push({func:dn,args:[w],thisArg:i}),new Nt(S,C)}return x&&H?t.apply(this,h):(S=this.thru(w),x?n?S.value()[0]:S.value():S)})}),Mt(["pop","push","shift","sort","splice","unshift"],function(t){var e=Br[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);o.prototype[t]=function(){var a=arguments;if(n&&!this.__chain__){var u=this.value();return e.apply(R(u)?u:[],a)}return this[r](function(c){return e.apply(R(c)?c:[],a)})}}),Yt(M.prototype,function(t,e){var r=o[e];if(r){var n=r.name+"";z.call(Qe,n)||(Qe[n]=[]),Qe[n].push({name:e,func:r})}}),Qe[on(i,ee).name]=[{name:"wrapper",func:i}],M.prototype.clone=th,M.prototype.reverse=eh,M.prototype.value=rh,o.prototype.at=Rl,o.prototype.chain=Tl,o.prototype.commit=$l,o.prototype.next=Hl,o.prototype.plant=kl,o.prototype.reverse=Ml,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=Bl,o.prototype.first=o.prototype.head,lr&&(o.prototype[lr]=ql),o},We=Tc();je?((je.exports=We)._=We,Jn._=We):ft._=We}).call(Ar)})(rs,rs.exports);var Yv=Object.defineProperty,Xv=Object.defineProperties,tg=Object.getOwnPropertyDescriptors,Uo=Object.getOwnPropertySymbols,eg=Object.prototype.hasOwnProperty,rg=Object.prototype.propertyIsEnumerable,Fo=(b,s,i)=>s in b?Yv(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Pn=(b,s)=>{for(var i in s||(s={}))eg.call(s,i)&&Fo(b,i,s[i]);if(Uo)for(var i of Uo(s))rg.call(s,i)&&Fo(b,i,s[i]);return b},ng=(b,s)=>Xv(b,tg(s));function Ae(b,s,i){var f;const g=nt.ve(b);return((f=s.rpcMap)==null?void 0:f[g.reference])||`${Zv}?chainId=${g.namespace}:${g.reference}&projectId=${i}`}function Me(b){return b.includes(":")?b.split(":")[1]:b}function Ko(b){return b.map(s=>`${s.split(":")[0]}:${s.split(":")[1]}`)}function ig(b,s){const i=Object.keys(s.namespaces).filter(g=>g.includes(b));if(!i.length)return[];const f=[];return i.forEach(g=>{const P=s.namespaces[g].accounts;f.push(...P)}),f}function sg(b={},s={}){const i=zo(b),f=zo(s);return rs.exports.merge(i,f)}function zo(b){var s,i,f,g;const P={};if(!nt.B(b))return P;for(const[O,N]of Object.entries(b)){const ut=nt.oe(O)?[O]:N.chains,st=N.methods||[],dt=N.events||[],it=N.rpcMap||{},vt=nt.en(O);P[vt]=ng(Pn(Pn({},P[vt]),N),{chains:nt.S(ut,(s=P[vt])==null?void 0:s.chains),methods:nt.S(st,(i=P[vt])==null?void 0:i.methods),events:nt.S(dt,(f=P[vt])==null?void 0:f.events),rpcMap:Pn(Pn({},it),(g=P[vt])==null?void 0:g.rpcMap)})}return P}function ag(b){return b.includes(":")?b.split(":")[2]:b}function og(b){const s={};for(const[i,f]of Object.entries(b)){const g=f.methods||[],P=f.events||[],O=f.accounts||[],N=nt.oe(i)?[i]:f.chains?f.chains:Ko(f.accounts);s[i]={chains:N,methods:g,events:P,accounts:O}}return s}function Zi(b){return typeof b=="number"?b:b.includes("0x")?parseInt(b,16):b.includes(":")?Number(b.split(":")[1]):Number(b)}const Zo={},Y=b=>Zo[b],Yi=(b,s)=>{Zo[b]=s};class ug{constructor(s){this.name="polkadot",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class cg{constructor(s){this.name="eip155",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(s){switch(s.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(s);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(s.request.method)?await this.client.request(s):this.getHttpProvider().request(s.request)}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(parseInt(s),i),this.chainId=parseInt(s),this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}createHttpProvider(s,i){const f=i||Ae(`${this.name}:${s}`,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=parseInt(Me(i));s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}getHttpProvider(){const s=this.chainId,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}async handleSwitchChain(s){var i,f;let g=s.request.params?(i=s.request.params[0])==null?void 0:i.chainId:"0x0";g=g.startsWith("0x")?g:`0x${g}`;const P=parseInt(g,16);if(this.isChainApproved(P))this.setDefaultChain(`${P}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:s.topic,request:{method:s.request.method,params:[{chainId:g}]},chainId:(f=this.namespace.chains)==null?void 0:f[0]}),this.setDefaultChain(`${P}`);else throw new Error(`Failed to switch to chain 'eip155:${P}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(s){return this.namespace.chains.includes(`${this.name}:${s}`)}}class hg{constructor(s){this.name="solana",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class fg{constructor(s){this.name="cosmos",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class lg{constructor(s){this.name="cip34",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{const f=this.getCardanoRPCUrl(i),g=Me(i);s[g]=this.createHttpProvider(g,f)}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}getCardanoRPCUrl(s){const i=this.namespace.rpcMap;if(i)return i[s]}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||this.getCardanoRPCUrl(s);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class pg{constructor(s){this.name="elrond",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class dg{constructor(s){this.name="multiversx",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){this.httpProviders[s]||this.setHttpProvider(s,i),this.chainId=s,this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${s}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}getAccounts(){const s=this.namespace.accounts;return s?[...new Set(s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;const g=Me(i);s[g]=this.createHttpProvider(g,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace,this.client.core.projectId);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);return new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}class vg{constructor(s){this.name="near",this.namespace=s.namespace,this.events=Y("events"),this.client=Y("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(s){this.namespace=Object.assign(this.namespace,s)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const s=this.namespace.chains[0];if(!s)throw new Error("ChainId not found");return s.split(":")[1]}request(s){return this.namespace.methods.includes(s.request.method)?this.client.request(s):this.getHttpProvider().request(s.request)}setDefaultChain(s,i){if(this.chainId=s,!this.httpProviders[s]){const f=i||Ae(`${this.name}:${s}`,this.namespace);if(!f)throw new Error(`No RPC url provided for chainId: ${s}`);this.setHttpProvider(s,f)}this.events.emit(de.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const s=this.namespace.accounts;return s?s.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const s={};return this.namespace.chains.forEach(i=>{var f;s[i]=this.createHttpProvider(i,(f=this.namespace.rpcMap)==null?void 0:f[i])}),s}getHttpProvider(){const s=`${this.name}:${this.chainId}`,i=this.httpProviders[s];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${s} not found`);return i}setHttpProvider(s,i){const f=this.createHttpProvider(s,i);f&&(this.httpProviders[s]=f)}createHttpProvider(s,i){const f=i||Ae(s,this.namespace);return typeof f>"u"?void 0:new pt.JsonRpcProvider(new Oe(f,Y("disableProviderPing")))}}var gg=Object.defineProperty,_g=Object.defineProperties,mg=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,yg=Object.prototype.hasOwnProperty,wg=Object.prototype.propertyIsEnumerable,Jo=(b,s,i)=>s in b?gg(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,En=(b,s)=>{for(var i in s||(s={}))yg.call(s,i)&&Jo(b,i,s[i]);if(Wo)for(var i of Wo(s))wg.call(s,i)&&Jo(b,i,s[i]);return b},Xi=(b,s)=>_g(b,mg(s));class ns{constructor(s){this.events=new ke.EventEmitter,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=s,this.logger=typeof(s==null?void 0:s.logger)<"u"&&typeof(s==null?void 0:s.logger)!="string"?s.logger:pt.cjs.pino(pt.cjs.getDefaultLoggerOptions({level:(s==null?void 0:s.logger)||No})),this.disableProviderPing=(s==null?void 0:s.disableProviderPing)||!1}static async init(s){const i=new ns(s);return await i.initialize(),i}async request(s,i){const[f,g]=this.validateChain(i);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(f).request({request:En({},s),chainId:`${f}:${g}`,topic:this.session.topic})}sendAsync(s,i,f){const g=new Date().getTime();this.request(s,f).then(P=>i(null,pt.formatJsonRpcResult(g,P))).catch(P=>i(P,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 s;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(s=this.session)==null?void 0:s.topic,reason:nt.U("USER_DISCONNECTED")}),await this.cleanup()}async connect(s){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(s),await this.cleanupPendingPairings(),!s.skipPairing)return await this.pair(s.pairingTopic)}on(s,i){this.events.on(s,i)}once(s,i){this.events.once(s,i)}removeListener(s,i){this.events.removeListener(s,i)}off(s,i){this.events.off(s,i)}get isWalletConnect(){return!0}async pair(s){this.shouldAbortPairingAttempt=!1;let i=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(i>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:f,approval:g}=await this.client.connect({pairingTopic:s,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});f&&(this.uri=f,this.events.emit("display_uri",f)),await g().then(P=>{this.session=P,this.namespaces||(this.namespaces=og(P.namespaces),this.persist("namespaces",this.namespaces))}).catch(P=>{if(P.message!==pt.oe)throw P;i++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(s,i){try{if(!this.session)return;const[f,g]=this.validateChain(s);this.getProvider(f).setDefaultChain(g,i)}catch(f){if(!/Please call connect/.test(f.message))throw f}}async cleanupPendingPairings(s={}){this.logger.info("Cleaning up inactive pairings...");const i=this.client.pairing.getAll();if(nt.k(i)){for(const f of i)s.deletePairings?this.client.core.expirer.set(f.topic,0):await this.client.core.relayer.subscriber.unsubscribe(f.topic);this.logger.info(`Inactive pairings cleared: ${i.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 s=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[s]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await pt.Q.init({logger:this.providerOpts.logger||No,relayUrl:this.providerOpts.relayUrl||Qv,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),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 s=[...new Set(Object.keys(this.session.namespaces).map(i=>nt.en(i)))];Yi("client",this.client),Yi("events",this.events),Yi("disableProviderPing",this.disableProviderPing),s.forEach(i=>{if(!this.session)return;const f=ig(i,this.session),g=Ko(f),P=sg(this.namespaces,this.optionalNamespaces),O=Xi(En({},P[i]),{accounts:f,chains:g});switch(i){case"eip155":this.rpcProviders[i]=new cg({namespace:O});break;case"solana":this.rpcProviders[i]=new hg({namespace:O});break;case"cosmos":this.rpcProviders[i]=new fg({namespace:O});break;case"polkadot":this.rpcProviders[i]=new ug({namespace:O});break;case"cip34":this.rpcProviders[i]=new lg({namespace:O});break;case"elrond":this.rpcProviders[i]=new pg({namespace:O});break;case"multiversx":this.rpcProviders[i]=new dg({namespace:O});break;case"near":this.rpcProviders[i]=new vg({namespace:O});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",s=>{this.events.emit("session_ping",s)}),this.client.on("session_event",s=>{const{params:i}=s,{event:f}=i;if(f.name==="accountsChanged"){const g=f.data;g&&nt.k(g)&&this.events.emit("accountsChanged",g.map(ag))}else if(f.name==="chainChanged"){const g=i.chainId,P=i.event.data,O=nt.en(g),N=Zi(g)!==Zi(P)?`${O}:${Zi(P)}`:g;this.onChainChanged(N)}else this.events.emit(f.name,f.data);this.events.emit("session_event",s)}),this.client.on("session_update",({topic:s,params:i})=>{var f;const{namespaces:g}=i,P=(f=this.client)==null?void 0:f.session.get(s);this.session=Xi(En({},P),{namespaces:g}),this.onSessionUpdate(),this.events.emit("session_update",{topic:s,params:i})}),this.client.on("session_delete",async s=>{await this.cleanup(),this.events.emit("session_delete",s),this.events.emit("disconnect",Xi(En({},nt.U("USER_DISCONNECTED")),{data:s.topic}))}),this.on(de.DEFAULT_CHAIN_CHANGED,s=>{this.onChainChanged(s,!0)})}getProvider(s){if(!this.rpcProviders[s])throw new Error(`Provider not found: ${s}`);return this.rpcProviders[s]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(s=>{var i;this.getProvider(s).updateNamespace((i=this.session)==null?void 0:i.namespaces[s])})}setNamespaces(s){const{namespaces:i,optionalNamespaces:f,sessionProperties:g}=s;i&&Object.keys(i).length&&(this.namespaces=i),f&&Object.keys(f).length&&(this.optionalNamespaces=f),this.sessionProperties=g,this.persist("namespaces",i),this.persist("optionalNamespaces",f)}validateChain(s){const[i,f]=(s==null?void 0:s.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,f];if(i&&!Object.keys(this.namespaces||{}).map(O=>nt.en(O)).includes(i))throw new Error(`Namespace '${i}' is not configured. Please call connect() first with namespace config.`);if(i&&f)return[i,f];const g=nt.en(Object.keys(this.namespaces)[0]),P=this.rpcProviders[g].getDefaultChain();return[g,P]}async requestAccounts(){const[s]=this.validateChain();return await this.getProvider(s).requestAccounts()}onChainChanged(s,i=!1){var f;if(!this.namespaces)return;const[g,P]=this.validateChain(s);i||this.getProvider(g).setDefaultChain(P),((f=this.namespaces[g])!=null?f:this.namespaces[`${g}:${P}`]).defaultChain=P,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",P)}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(s,i){this.client.core.storage.setItem(`${Lo}/${s}`,i)}async getFromStore(s){return await this.client.core.storage.getItem(`${Lo}/${s}`)}}const bg=ns,Pg="wc",Eg="ethereum_provider",Cg=`${Pg}@2:${Eg}:`,Ig="https://rpc.walletconnect.com/v1/",Cn=["eth_sendTransaction","personal_sign"],Yo=["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"],In=["chainChanged","accountsChanged"],Xo=["chainChanged","accountsChanged","message","disconnect","connect"];var Ag=Object.defineProperty,Og=Object.defineProperties,jg=Object.getOwnPropertyDescriptors,Go=Object.getOwnPropertySymbols,xg=Object.prototype.hasOwnProperty,Sg=Object.prototype.propertyIsEnumerable,Qo=(b,s,i)=>s in b?Ag(b,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):b[s]=i,Or=(b,s)=>{for(var i in s||(s={}))xg.call(s,i)&&Qo(b,i,s[i]);if(Go)for(var i of Go(s))Sg.call(s,i)&&Qo(b,i,s[i]);return b},Vo=(b,s)=>Og(b,jg(s));function An(b){return Number(b[0].split(":")[1])}function ts(b){return`0x${b.toString(16)}`}function Dg(b){const{chains:s,optionalChains:i,methods:f,optionalMethods:g,events:P,optionalEvents:O,rpcMap:N}=b;if(!nt.k(s))throw new Error("Invalid chains");const ut={chains:s,methods:f||Cn,events:P||In,rpcMap:Or({},s.length?{[An(s)]:N[An(s)]}:{})},st=P==null?void 0:P.filter(ct=>!In.includes(ct)),dt=f==null?void 0:f.filter(ct=>!Cn.includes(ct));if(!i&&!O&&!g&&!(st!=null&&st.length)&&!(dt!=null&&dt.length))return{required:s.length?ut:void 0};const it=(st==null?void 0:st.length)&&(dt==null?void 0:dt.length)||!i,vt={chains:[...new Set(it?ut.chains.concat(i||[]):i)],methods:[...new Set(ut.methods.concat(g!=null&&g.length?g:Yo))],events:[...new Set(ut.events.concat(O!=null&&O.length?O:Xo))],rpcMap:N};return{required:s.length?ut:void 0,optional:i.length?vt:void 0}}class On{constructor(){this.events=new ke.eventsExports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Cg,this.on=(s,i)=>(this.events.on(s,i),this),this.once=(s,i)=>(this.events.once(s,i),this),this.removeListener=(s,i)=>(this.events.removeListener(s,i),this),this.off=(s,i)=>(this.events.off(s,i),this),this.parseAccount=s=>this.isCompatibleChainId(s)?this.parseAccountId(s).address:s,this.signer={},this.rpc={}}static async init(s){const i=new On;return await i.initialize(s),i}async request(s){return await this.signer.request(s,this.formatChainId(this.chainId))}sendAsync(s,i){this.signer.sendAsync(s,i,this.formatChainId(this.chainId))}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(s){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(s);const{required:i,optional:f}=Dg(this.rpc);try{const g=await new Promise(async(O,N)=>{var ut;this.rpc.showQrModal&&((ut=this.modal)==null||ut.subscribeModal(st=>{!st.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),N(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Vo(Or({namespaces:Or({},i&&{[this.namespace]:i})},f&&{optionalNamespaces:{[this.namespace]:f}}),{pairingTopic:s==null?void 0:s.pairingTopic})).then(st=>{O(st)}).catch(st=>{N(new Error(st.message))})});if(!g)return;const P=nt.Un(g.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:P),this.setAccounts(P),this.events.emit("connect",{chainId:ts(this.chainId)})}catch(g){throw this.signer.logger.error(g),g}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",s=>{const{params:i}=s,{event:f}=i;f.name==="accountsChanged"?(this.accounts=this.parseAccounts(f.data),this.events.emit("accountsChanged",this.accounts)):f.name==="chainChanged"?this.setChainId(this.formatChainId(f.data)):this.events.emit(f.name,f.data),this.events.emit("session_event",s)}),this.signer.on("chainChanged",s=>{const i=parseInt(s);this.chainId=i,this.events.emit("chainChanged",ts(this.chainId)),this.persist()}),this.signer.on("session_update",s=>{this.events.emit("session_update",s)}),this.signer.on("session_delete",s=>{this.reset(),this.events.emit("session_delete",s),this.events.emit("disconnect",Vo(Or({},nt.U("USER_DISCONNECTED")),{data:s.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",s=>{var i,f;this.rpc.showQrModal&&((i=this.modal)==null||i.closeModal(),(f=this.modal)==null||f.openModal({uri:s})),this.events.emit("display_uri",s)})}switchEthereumChain(s){this.request({method:"wallet_switchEthereumChain",params:[{chainId:s.toString(16)}]})}isCompatibleChainId(s){return typeof s=="string"?s.startsWith(`${this.namespace}:`):!1}formatChainId(s){return`${this.namespace}:${s}`}parseChainId(s){return Number(s.split(":")[1])}setChainIds(s){const i=s.filter(f=>this.isCompatibleChainId(f)).map(f=>this.parseChainId(f));i.length&&(this.chainId=i[0],this.events.emit("chainChanged",ts(this.chainId)),this.persist())}setChainId(s){if(this.isCompatibleChainId(s)){const i=this.parseChainId(s);this.chainId=i,this.switchEthereumChain(i)}}parseAccountId(s){const[i,f,g]=s.split(":");return{chainId:`${i}:${f}`,address:g}}setAccounts(s){this.accounts=s.filter(i=>this.parseChainId(this.parseAccountId(i).chainId)===this.chainId).map(i=>this.parseAccountId(i).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(s){var i,f;const g=(i=s==null?void 0:s.chains)!=null?i:[],P=(f=s==null?void 0:s.optionalChains)!=null?f:[],O=g.concat(P);if(!O.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const N=g.length?(s==null?void 0:s.methods)||Cn:[],ut=g.length?(s==null?void 0:s.events)||In:[],st=(s==null?void 0:s.optionalMethods)||[],dt=(s==null?void 0:s.optionalEvents)||[],it=(s==null?void 0:s.rpcMap)||this.buildRpcMap(O,s.projectId),vt=(s==null?void 0:s.qrModalOptions)||void 0;return{chains:g==null?void 0:g.map(ct=>this.formatChainId(ct)),optionalChains:P.map(ct=>this.formatChainId(ct)),methods:N,events:ut,optionalMethods:st,optionalEvents:dt,rpcMap:it,showQrModal:!!(s!=null&&s.showQrModal),qrModalOptions:vt,projectId:s.projectId,metadata:s.metadata}}buildRpcMap(s,i){const f={};return s.forEach(g=>{f[g]=this.getRpcUrl(g,i)}),f}async initialize(s){if(this.rpc=this.getRpcConfig(s),this.chainId=this.rpc.chains.length?An(this.rpc.chains):An(this.rpc.optionalChains),this.signer=await bg.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:s.disableProviderPing,relayUrl:s.relayUrl,storageOptions:s.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let i;try{const{WalletConnectModal:f}=await Promise.resolve().then(()=>require("./index-iJmUtx_H.js")).then(g=>g.index);i=f}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(i)try{this.modal=new i(Or({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(f){throw this.signer.logger.error(f),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(s){if(!s)return;const{chains:i,optionalChains:f,rpcMap:g}=s;i&&nt.k(i)&&(this.rpc.chains=i.map(P=>this.formatChainId(P)),i.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)})),f&&nt.k(f)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=f==null?void 0:f.map(P=>this.formatChainId(P)),f.forEach(P=>{this.rpc.rpcMap[P]=(g==null?void 0:g[P])||this.getRpcUrl(P)}))}getRpcUrl(s,i){var f;return((f=this.rpc.rpcMap)==null?void 0:f[s])||`${Ig}?chainId=eip155:${s}&projectId=${i||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const s=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),i=this.session.namespaces[`${this.namespace}:${s}`]?this.session.namespaces[`${this.namespace}:${s}`]:this.session.namespaces[this.namespace];this.setChainIds(s?[this.formatChainId(s)]:i==null?void 0:i.accounts),this.setAccounts(i==null?void 0:i.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(s){return typeof s=="string"||s instanceof String?[this.parseAccount(s)]:s.map(i=>this.parseAccount(i))}}const Rg=On;exports.EthereumProvider=Rg;exports.OPTIONAL_EVENTS=Xo;exports.OPTIONAL_METHODS=Yo;exports.REQUIRED_EVENTS=In;exports.REQUIRED_METHODS=Cn;exports.default=On;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const H=require("./index-soixhS2C.js");var Tt={},nt={},M={},gr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,l){var _=u>>>16&65535,D=u&65535,w=l>>>16&65535,y=l&65535;return D*y+(_*y+D*w<<16>>>0)|0}e.mul=Math.imul||t;function r(u,l){return u+l|0}e.add=r;function i(u,l){return u-l|0}e.sub=i;function o(u,l){return u<<l|u>>>32-l}e.rotl=o;function s(u,l){return u<<32-l|u>>>l}e.rotr=s;function b(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}e.isInteger=Number.isInteger||b,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(u){return e.isInteger(u)&&u>=-e.MAX_SAFE_INTEGER&&u<=e.MAX_SAFE_INTEGER}})(gr);Object.defineProperty(M,"__esModule",{value:!0});var pr=gr;function Qr(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}M.readInt16BE=Qr;function Zr(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])>>>0}M.readUint16BE=Zr;function en(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])<<16>>16}M.readInt16LE=en;function tn(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])>>>0}M.readUint16LE=tn;function mr(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}M.writeUint16BE=mr;M.writeInt16BE=mr;function Sr(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}M.writeUint16LE=Sr;M.writeInt16LE=Sr;function wt(e,t){return t===void 0&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}M.readInt32BE=wt;function vt(e,t){return t===void 0&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}M.readUint32BE=vt;function yt(e,t){return t===void 0&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}M.readInt32LE=yt;function gt(e,t){return t===void 0&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}M.readUint32LE=gt;function et(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}M.writeUint32BE=et;M.writeInt32BE=et;function tt(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}M.writeUint32LE=tt;M.writeInt32LE=tt;function rn(e,t){t===void 0&&(t=0);var r=wt(e,t),i=wt(e,t+4);return r*4294967296+i-(i>>31)*4294967296}M.readInt64BE=rn;function nn(e,t){t===void 0&&(t=0);var r=vt(e,t),i=vt(e,t+4);return r*4294967296+i}M.readUint64BE=nn;function on(e,t){t===void 0&&(t=0);var r=yt(e,t),i=yt(e,t+4);return i*4294967296+r-(r>>31)*4294967296}M.readInt64LE=on;function an(e,t){t===void 0&&(t=0);var r=gt(e,t),i=gt(e,t+4);return i*4294967296+r}M.readUint64LE=an;function Or(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),et(e/4294967296>>>0,t,r),et(e>>>0,t,r+4),t}M.writeUint64BE=Or;M.writeInt64BE=Or;function Cr(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),tt(e>>>0,t,r),tt(e/4294967296>>>0,t,r+4),t}M.writeUint64LE=Cr;M.writeInt64LE=Cr;function un(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,o=1,s=e/8+r-1;s>=r;s--)i+=t[s]*o,o*=256;return i}M.readUintBE=un;function sn(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,o=1,s=r;s<r+e/8;s++)i+=t[s]*o,o*=256;return i}M.readUintLE=sn;function cn(e,t,r,i){if(r===void 0&&(r=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!pr.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)r[s]=t/o&255,o*=256;return r}M.writeUintBE=cn;function fn(e,t,r,i){if(r===void 0&&(r=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!pr.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)r[s]=t/o&255,o*=256;return r}M.writeUintLE=fn;function hn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t)}M.readFloat32BE=hn;function ln(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t,!0)}M.readFloat32LE=ln;function dn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t)}M.readFloat64BE=dn;function Dn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t,!0)}M.readFloat64LE=Dn;function bn(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat32(r,e),t}M.writeFloat32BE=bn;function _n(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat32(r,e,!0),t}M.writeFloat32LE=_n;function En(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat64(r,e),t}M.writeFloat64BE=En;function wn(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat64(r,e,!0),t}M.writeFloat64LE=wn;var pe={};Object.defineProperty(pe,"__esModule",{value:!0});function vn(e){for(var t=0;t<e.length;t++)e[t]=0;return e}pe.wipe=vn;Object.defineProperty(nt,"__esModule",{value:!0});var _e=M,pt=pe,yn=20;function gn(e,t,r){for(var i=1634760805,o=857760878,s=2036477234,b=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],_=r[11]<<24|r[10]<<16|r[9]<<8|r[8],D=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],y=r[23]<<24|r[22]<<16|r[21]<<8|r[20],v=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],S=t[3]<<24|t[2]<<16|t[1]<<8|t[0],p=t[7]<<24|t[6]<<16|t[5]<<8|t[4],A=t[11]<<24|t[10]<<16|t[9]<<8|t[8],d=t[15]<<24|t[14]<<16|t[13]<<8|t[12],E=i,c=o,h=s,f=b,n=u,a=l,m=_,C=D,N=w,P=y,R=v,j=g,I=S,F=p,O=A,T=d,Y=0;Y<yn;Y+=2)E=E+n|0,I^=E,I=I>>>16|I<<16,N=N+I|0,n^=N,n=n>>>20|n<<12,c=c+a|0,F^=c,F=F>>>16|F<<16,P=P+F|0,a^=P,a=a>>>20|a<<12,h=h+m|0,O^=h,O=O>>>16|O<<16,R=R+O|0,m^=R,m=m>>>20|m<<12,f=f+C|0,T^=f,T=T>>>16|T<<16,j=j+T|0,C^=j,C=C>>>20|C<<12,h=h+m|0,O^=h,O=O>>>24|O<<8,R=R+O|0,m^=R,m=m>>>25|m<<7,f=f+C|0,T^=f,T=T>>>24|T<<8,j=j+T|0,C^=j,C=C>>>25|C<<7,c=c+a|0,F^=c,F=F>>>24|F<<8,P=P+F|0,a^=P,a=a>>>25|a<<7,E=E+n|0,I^=E,I=I>>>24|I<<8,N=N+I|0,n^=N,n=n>>>25|n<<7,E=E+a|0,T^=E,T=T>>>16|T<<16,R=R+T|0,a^=R,a=a>>>20|a<<12,c=c+m|0,I^=c,I=I>>>16|I<<16,j=j+I|0,m^=j,m=m>>>20|m<<12,h=h+C|0,F^=h,F=F>>>16|F<<16,N=N+F|0,C^=N,C=C>>>20|C<<12,f=f+n|0,O^=f,O=O>>>16|O<<16,P=P+O|0,n^=P,n=n>>>20|n<<12,h=h+C|0,F^=h,F=F>>>24|F<<8,N=N+F|0,C^=N,C=C>>>25|C<<7,f=f+n|0,O^=f,O=O>>>24|O<<8,P=P+O|0,n^=P,n=n>>>25|n<<7,c=c+m|0,I^=c,I=I>>>24|I<<8,j=j+I|0,m^=j,m=m>>>25|m<<7,E=E+a|0,T^=E,T=T>>>24|T<<8,R=R+T|0,a^=R,a=a>>>25|a<<7;_e.writeUint32LE(E+i|0,e,0),_e.writeUint32LE(c+o|0,e,4),_e.writeUint32LE(h+s|0,e,8),_e.writeUint32LE(f+b|0,e,12),_e.writeUint32LE(n+u|0,e,16),_e.writeUint32LE(a+l|0,e,20),_e.writeUint32LE(m+_|0,e,24),_e.writeUint32LE(C+D|0,e,28),_e.writeUint32LE(N+w|0,e,32),_e.writeUint32LE(P+y|0,e,36),_e.writeUint32LE(R+v|0,e,40),_e.writeUint32LE(j+g|0,e,44),_e.writeUint32LE(I+S|0,e,48),_e.writeUint32LE(F+p|0,e,52),_e.writeUint32LE(O+A|0,e,56),_e.writeUint32LE(T+d|0,e,60)}function Ur(e,t,r,i,o){if(o===void 0&&(o=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,b;if(o===0){if(t.length!==8&&t.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),b=s.length-t.length,s.set(t,b)}else{if(t.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=t,b=o}for(var u=new Uint8Array(64),l=0;l<r.length;l+=64){gn(u,s,e);for(var _=l;_<l+64&&_<r.length;_++)i[_]=r[_]^u[_-l];mn(s,0,b)}return pt.wipe(u),o===0&&pt.wipe(s),i}nt.streamXOR=Ur;function pn(e,t,r,i){return i===void 0&&(i=0),pt.wipe(r),Ur(e,t,r,r,i)}nt.stream=pn;function mn(e,t,r){for(var i=1;r--;)i=i+(e[t]&255)|0,e[t]=i&255,i>>>=8,t++;if(i>0)throw new Error("ChaCha: counter overflow")}var Ar={},Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});function Sn(e,t,r){return~(e-1)&t|e-1&r}Ue.select=Sn;function On(e,t){return(e|0)-(t|0)-1>>>31&1}Ue.lessOrEqual=On;function Nr(e,t){if(e.length!==t.length)return 0;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 1&r-1>>>8}Ue.compare=Nr;function Cn(e,t){return e.length===0||t.length===0?!1:Nr(e,t)!==0}Ue.equal=Cn;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ue,r=pe;e.DIGEST_LENGTH=16;var i=function(){function b(u){this.digestLength=e.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 l=u[0]|u[1]<<8;this._r[0]=l&8191;var _=u[2]|u[3]<<8;this._r[1]=(l>>>13|_<<3)&8191;var D=u[4]|u[5]<<8;this._r[2]=(_>>>10|D<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(D>>>7|w<<9)&8191;var y=u[8]|u[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var v=u[10]|u[11]<<8;this._r[6]=(y>>>14|v<<2)&8191;var g=u[12]|u[13]<<8;this._r[7]=(v>>>11|g<<5)&8065;var S=u[14]|u[15]<<8;this._r[8]=(g>>>8|S<<8)&8191,this._r[9]=S>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return b.prototype._blocks=function(u,l,_){for(var D=this._fin?0:2048,w=this._h[0],y=this._h[1],v=this._h[2],g=this._h[3],S=this._h[4],p=this._h[5],A=this._h[6],d=this._h[7],E=this._h[8],c=this._h[9],h=this._r[0],f=this._r[1],n=this._r[2],a=this._r[3],m=this._r[4],C=this._r[5],N=this._r[6],P=this._r[7],R=this._r[8],j=this._r[9];_>=16;){var I=u[l+0]|u[l+1]<<8;w+=I&8191;var F=u[l+2]|u[l+3]<<8;y+=(I>>>13|F<<3)&8191;var O=u[l+4]|u[l+5]<<8;v+=(F>>>10|O<<6)&8191;var T=u[l+6]|u[l+7]<<8;g+=(O>>>7|T<<9)&8191;var Y=u[l+8]|u[l+9]<<8;S+=(T>>>4|Y<<12)&8191,p+=Y>>>1&8191;var Q=u[l+10]|u[l+11]<<8;A+=(Y>>>14|Q<<2)&8191;var J=u[l+12]|u[l+13]<<8;d+=(Q>>>11|J<<5)&8191;var X=u[l+14]|u[l+15]<<8;E+=(J>>>8|X<<8)&8191,c+=X>>>5|D;var U=0,L=U;L+=w*h,L+=y*(5*j),L+=v*(5*R),L+=g*(5*P),L+=S*(5*N),U=L>>>13,L&=8191,L+=p*(5*C),L+=A*(5*m),L+=d*(5*a),L+=E*(5*n),L+=c*(5*f),U+=L>>>13,L&=8191;var B=U;B+=w*f,B+=y*h,B+=v*(5*j),B+=g*(5*R),B+=S*(5*P),U=B>>>13,B&=8191,B+=p*(5*N),B+=A*(5*C),B+=d*(5*m),B+=E*(5*a),B+=c*(5*n),U+=B>>>13,B&=8191;var x=U;x+=w*n,x+=y*f,x+=v*h,x+=g*(5*j),x+=S*(5*R),U=x>>>13,x&=8191,x+=p*(5*P),x+=A*(5*N),x+=d*(5*C),x+=E*(5*m),x+=c*(5*a),U+=x>>>13,x&=8191;var $=U;$+=w*a,$+=y*n,$+=v*f,$+=g*h,$+=S*(5*j),U=$>>>13,$&=8191,$+=p*(5*R),$+=A*(5*P),$+=d*(5*N),$+=E*(5*C),$+=c*(5*m),U+=$>>>13,$&=8191;var K=U;K+=w*m,K+=y*a,K+=v*n,K+=g*f,K+=S*h,U=K>>>13,K&=8191,K+=p*(5*j),K+=A*(5*R),K+=d*(5*P),K+=E*(5*N),K+=c*(5*C),U+=K>>>13,K&=8191;var W=U;W+=w*C,W+=y*m,W+=v*a,W+=g*n,W+=S*f,U=W>>>13,W&=8191,W+=p*h,W+=A*(5*j),W+=d*(5*R),W+=E*(5*P),W+=c*(5*N),U+=W>>>13,W&=8191;var V=U;V+=w*N,V+=y*C,V+=v*m,V+=g*a,V+=S*n,U=V>>>13,V&=8191,V+=p*f,V+=A*h,V+=d*(5*j),V+=E*(5*R),V+=c*(5*P),U+=V>>>13,V&=8191;var q=U;q+=w*P,q+=y*N,q+=v*C,q+=g*m,q+=S*a,U=q>>>13,q&=8191,q+=p*n,q+=A*f,q+=d*h,q+=E*(5*j),q+=c*(5*R),U+=q>>>13,q&=8191;var G=U;G+=w*R,G+=y*P,G+=v*N,G+=g*C,G+=S*m,U=G>>>13,G&=8191,G+=p*a,G+=A*n,G+=d*f,G+=E*h,G+=c*(5*j),U+=G>>>13,G&=8191;var k=U;k+=w*j,k+=y*R,k+=v*P,k+=g*N,k+=S*C,U=k>>>13,k&=8191,k+=p*m,k+=A*a,k+=d*n,k+=E*f,k+=c*h,U+=k>>>13,k&=8191,U=(U<<2)+U|0,U=U+L|0,L=U&8191,U=U>>>13,B+=U,w=L,y=B,v=x,g=$,S=K,p=W,A=V,d=q,E=G,c=k,l+=16,_-=16}this._h[0]=w,this._h[1]=y,this._h[2]=v,this._h[3]=g,this._h[4]=S,this._h[5]=p,this._h[6]=A,this._h[7]=d,this._h[8]=E,this._h[9]=c},b.prototype.finish=function(u,l){l===void 0&&(l=0);var _=new Uint16Array(10),D,w,y,v;if(this._leftover){for(v=this._leftover,this._buffer[v++]=1;v<16;v++)this._buffer[v]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(D=this._h[1]>>>13,this._h[1]&=8191,v=2;v<10;v++)this._h[v]+=D,D=this._h[v]>>>13,this._h[v]&=8191;for(this._h[0]+=D*5,D=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=D,D=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=D,_[0]=this._h[0]+5,D=_[0]>>>13,_[0]&=8191,v=1;v<10;v++)_[v]=this._h[v]+D,D=_[v]>>>13,_[v]&=8191;for(_[9]-=8192,w=(D^1)-1,v=0;v<10;v++)_[v]&=w;for(w=~w,v=0;v<10;v++)this._h[v]=this._h[v]&w|_[v];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,y=this._h[0]+this._pad[0],this._h[0]=y&65535,v=1;v<8;v++)y=(this._h[v]+this._pad[v]|0)+(y>>>16)|0,this._h[v]=y&65535;return u[l+0]=this._h[0]>>>0,u[l+1]=this._h[0]>>>8,u[l+2]=this._h[1]>>>0,u[l+3]=this._h[1]>>>8,u[l+4]=this._h[2]>>>0,u[l+5]=this._h[2]>>>8,u[l+6]=this._h[3]>>>0,u[l+7]=this._h[3]>>>8,u[l+8]=this._h[4]>>>0,u[l+9]=this._h[4]>>>8,u[l+10]=this._h[5]>>>0,u[l+11]=this._h[5]>>>8,u[l+12]=this._h[6]>>>0,u[l+13]=this._h[6]>>>8,u[l+14]=this._h[7]>>>0,u[l+15]=this._h[7]>>>8,this._finished=!0,this},b.prototype.update=function(u){var l=0,_=u.length,D;if(this._leftover){D=16-this._leftover,D>_&&(D=_);for(var w=0;w<D;w++)this._buffer[this._leftover+w]=u[l+w];if(_-=D,l+=D,this._leftover+=D,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(_>=16&&(D=_-_%16,this._blocks(u,l,D),l+=D,_-=D),_){for(var w=0;w<_;w++)this._buffer[this._leftover+w]=u[l+w];this._leftover+=_}return this},b.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},b.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},b}();e.Poly1305=i;function o(b,u){var l=new i(b);l.update(u);var _=l.digest();return l.clean(),_}e.oneTimeAuth=o;function s(b,u){return b.length!==e.DIGEST_LENGTH||u.length!==e.DIGEST_LENGTH?!1:t.equal(b,u)}e.equal=s})(Ar);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=nt,r=Ar,i=pe,o=M,s=Ue;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var b=new Uint8Array(16),u=function(){function l(_){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,_.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(_)}return l.prototype.seal=function(_,D,w,y){if(_.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var v=new Uint8Array(16);v.set(_,v.length-_.length);var g=new Uint8Array(32);t.stream(this._key,v,g,4);var S=D.length+this.tagLength,p;if(y){if(y.length!==S)throw new Error("ChaCha20Poly1305: incorrect destination length");p=y}else p=new Uint8Array(S);return t.streamXOR(this._key,v,D,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),g,p.subarray(0,p.length-this.tagLength),w),i.wipe(v),p},l.prototype.open=function(_,D,w,y){if(_.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(D.length<this.tagLength)return null;var v=new Uint8Array(16);v.set(_,v.length-_.length);var g=new Uint8Array(32);t.stream(this._key,v,g,4);var S=new Uint8Array(this.tagLength);if(this._authenticate(S,g,D.subarray(0,D.length-this.tagLength),w),!s.equal(S,D.subarray(D.length-this.tagLength,D.length)))return null;var p=D.length-this.tagLength,A;if(y){if(y.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");A=y}else A=new Uint8Array(p);return t.streamXOR(this._key,v,D.subarray(0,D.length-this.tagLength),A,4),i.wipe(v),A},l.prototype.clean=function(){return i.wipe(this._key),this},l.prototype._authenticate=function(_,D,w,y){var v=new r.Poly1305(D);y&&(v.update(y),y.length%16>0&&v.update(b.subarray(y.length%16))),v.update(w),w.length%16>0&&v.update(b.subarray(w.length%16));var g=new Uint8Array(8);y&&o.writeUint64LE(y.length,g),v.update(g),o.writeUint64LE(w.length,g),v.update(g);for(var S=v.digest(),p=0;p<S.length;p++)_[p]=S[p];v.clean(),i.wipe(S),i.wipe(g)},l}();e.ChaCha20Poly1305=u})(Tt);var Tr={},qe={},It={};Object.defineProperty(It,"__esModule",{value:!0});function Un(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}It.isSerializableHash=Un;Object.defineProperty(qe,"__esModule",{value:!0});var me=It,An=Ue,Nn=pe,Ir=function(){function e(t,r){this._finished=!1,this._inner=new t,this._outer=new t,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(i).clean():i.set(r);for(var o=0;o<i.length;o++)i[o]^=54;this._inner.update(i);for(var o=0;o<i.length;o++)i[o]^=106;this._outer.update(i),me.isSerializableHash(this._inner)&&me.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Nn.wipe(i)}return e.prototype.reset=function(){if(!me.isSerializableHash(this._inner)||!me.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},e.prototype.clean=function(){me.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),me.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(t){return this._inner.update(t),this},e.prototype.finish=function(t){return this._finished?(this._outer.finish(t),this):(this._inner.finish(t),this._outer.update(t.subarray(0,this.digestLength)).finish(t),this._finished=!0,this)},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype.saveState=function(){if(!me.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(t){if(!me.isSerializableHash(this._inner)||!me.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(t),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(t){if(!me.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(t)},e}();qe.HMAC=Ir;function Tn(e,t,r){var i=new Ir(e,t);i.update(r);var o=i.digest();return i.clean(),o}qe.hmac=Tn;qe.equal=An.equal;Object.defineProperty(Tr,"__esModule",{value:!0});var Vt=qe,qt=pe,In=function(){function e(t,r,i,o){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=o;var s=Vt.hmac(this._hash,i,r);this._hmac=new Vt.HMAC(t,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var t=this._counter[0];if(t===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),t>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},e.prototype.expand=function(t){for(var r=new Uint8Array(t),i=0;i<r.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[i]=this._buffer[this._bufpos++];return r},e.prototype.clean=function(){this._hmac.clean(),qt.wipe(this._buffer),qt.wipe(this._counter),this._bufpos=0},e}(),Fn=Tr.HKDF=In,ze={},it={},ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.BrowserRandomSource=void 0;const zt=65536;class Mn{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t=typeof self<"u"?self.crypto||self.msCrypto:null;t&&t.getRandomValues!==void 0&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(t);for(let i=0;i<r.length;i+=zt)this._crypto.getRandomValues(r.subarray(i,i+Math.min(r.length-i,zt)));return r}}ot.BrowserRandomSource=Mn;var at={};Object.defineProperty(at,"__esModule",{value:!0});at.NodeRandomSource=void 0;const Pn=pe;class jn{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof H.commonjsRequire<"u"){const t=H.requireCryptoBrowserify();t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(t);if(r.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(t);for(let o=0;o<i.length;o++)i[o]=r[o];return(0,Pn.wipe)(r),i}}at.NodeRandomSource=jn;Object.defineProperty(it,"__esModule",{value:!0});it.SystemRandomSource=void 0;const Rn=ot,Ln=at;class Bn{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Rn.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Ln.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}it.SystemRandomSource=Bn;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=it,r=M,i=pe;e.defaultRandomSource=new t.SystemRandomSource;function o(_,D=e.defaultRandomSource){return D.randomBytes(_)}e.randomBytes=o;function s(_=e.defaultRandomSource){const D=o(4,_),w=(0,r.readUint32LE)(D);return(0,i.wipe)(D),w}e.randomUint32=s;const b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(_,D=b,w=e.defaultRandomSource){if(D.length<2)throw new Error("randomString charset is too short");if(D.length>256)throw new Error("randomString charset is too long");let y="";const v=D.length,g=256-256%v;for(;_>0;){const S=o(Math.ceil(_*256/g),w);for(let p=0;p<S.length&&_>0;p++){const A=S[p];A<g&&(y+=D.charAt(A%v),_--)}(0,i.wipe)(S)}return y}e.randomString=u;function l(_,D=b,w=e.defaultRandomSource){const y=Math.ceil(_/(Math.log(D.length)/Math.LN2));return u(y,D,w)}e.randomStringForEntropy=l})(ze);var ut={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=M,r=pe;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},u.prototype.update=function(l,_){if(_===void 0&&(_=l.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var D=0;if(this._bytesHashed+=_,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&_>0;)this._buffer[this._bufferLength++]=l[D++],_--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(_>=this.blockSize&&(D=s(this._temp,this._state,l,D,_),_%=this.blockSize);_>0;)this._buffer[this._bufferLength++]=l[D++],_--;return this},u.prototype.finish=function(l){if(!this._finished){var _=this._bytesHashed,D=this._bufferLength,w=_/536870912|0,y=_<<3,v=_%64<56?64:128;this._buffer[D]=128;for(var g=D+1;g<v-8;g++)this._buffer[g]=0;t.writeUint32BE(w,this._buffer,v-8),t.writeUint32BE(y,this._buffer,v-4),s(this._temp,this._state,this._buffer,0,v),this._finished=!0}for(var g=0;g<this.digestLength/4;g++)t.writeUint32BE(this._state[g],l,g*4);return this},u.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},u.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}},u.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},u}();e.SHA256=i;var o=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 s(u,l,_,D,w){for(;w>=64;){for(var y=l[0],v=l[1],g=l[2],S=l[3],p=l[4],A=l[5],d=l[6],E=l[7],c=0;c<16;c++){var h=D+c*4;u[c]=t.readUint32BE(_,h)}for(var c=16;c<64;c++){var f=u[c-2],n=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10;f=u[c-15];var a=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;u[c]=(n+u[c-7]|0)+(a+u[c-16]|0)}for(var c=0;c<64;c++){var n=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&A^~p&d)|0)+(E+(o[c]+u[c]|0)|0)|0,a=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&v^y&g^v&g)|0;E=d,d=A,A=p,p=S+n|0,S=g,g=v,v=y,y=n+a|0}l[0]+=y,l[1]+=v,l[2]+=g,l[3]+=S,l[4]+=p,l[5]+=A,l[6]+=d,l[7]+=E,D+=64,w-=64}return D}function b(u){var l=new i;l.update(u);var _=l.digest();return l.clean(),_}e.hash=b})(ut);var Ft={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=ze,r=pe;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function i(c){const h=new Float64Array(16);if(c)for(let f=0;f<c.length;f++)h[f]=c[f];return h}const o=new Uint8Array(32);o[0]=9;const s=i([56129,1]);function b(c){let h=1;for(let f=0;f<16;f++){let n=c[f]+h+65535;h=Math.floor(n/65536),c[f]=n-h*65536}c[0]+=h-1+37*(h-1)}function u(c,h,f){const n=~(f-1);for(let a=0;a<16;a++){const m=n&(c[a]^h[a]);c[a]^=m,h[a]^=m}}function l(c,h){const f=i(),n=i();for(let a=0;a<16;a++)n[a]=h[a];b(n),b(n),b(n);for(let a=0;a<2;a++){f[0]=n[0]-65517;for(let C=1;C<15;C++)f[C]=n[C]-65535-(f[C-1]>>16&1),f[C-1]&=65535;f[15]=n[15]-32767-(f[14]>>16&1);const m=f[15]>>16&1;f[14]&=65535,u(n,f,1-m)}for(let a=0;a<16;a++)c[2*a]=n[a]&255,c[2*a+1]=n[a]>>8}function _(c,h){for(let f=0;f<16;f++)c[f]=h[2*f]+(h[2*f+1]<<8);c[15]&=32767}function D(c,h,f){for(let n=0;n<16;n++)c[n]=h[n]+f[n]}function w(c,h,f){for(let n=0;n<16;n++)c[n]=h[n]-f[n]}function y(c,h,f){let n,a,m=0,C=0,N=0,P=0,R=0,j=0,I=0,F=0,O=0,T=0,Y=0,Q=0,J=0,X=0,U=0,L=0,B=0,x=0,$=0,K=0,W=0,V=0,q=0,G=0,k=0,Ae=0,Pe=0,$e=0,Qe=0,ht=0,Wt=0,ee=f[0],te=f[1],re=f[2],ne=f[3],ie=f[4],oe=f[5],ae=f[6],ue=f[7],se=f[8],ce=f[9],fe=f[10],he=f[11],le=f[12],de=f[13],De=f[14],be=f[15];n=h[0],m+=n*ee,C+=n*te,N+=n*re,P+=n*ne,R+=n*ie,j+=n*oe,I+=n*ae,F+=n*ue,O+=n*se,T+=n*ce,Y+=n*fe,Q+=n*he,J+=n*le,X+=n*de,U+=n*De,L+=n*be,n=h[1],C+=n*ee,N+=n*te,P+=n*re,R+=n*ne,j+=n*ie,I+=n*oe,F+=n*ae,O+=n*ue,T+=n*se,Y+=n*ce,Q+=n*fe,J+=n*he,X+=n*le,U+=n*de,L+=n*De,B+=n*be,n=h[2],N+=n*ee,P+=n*te,R+=n*re,j+=n*ne,I+=n*ie,F+=n*oe,O+=n*ae,T+=n*ue,Y+=n*se,Q+=n*ce,J+=n*fe,X+=n*he,U+=n*le,L+=n*de,B+=n*De,x+=n*be,n=h[3],P+=n*ee,R+=n*te,j+=n*re,I+=n*ne,F+=n*ie,O+=n*oe,T+=n*ae,Y+=n*ue,Q+=n*se,J+=n*ce,X+=n*fe,U+=n*he,L+=n*le,B+=n*de,x+=n*De,$+=n*be,n=h[4],R+=n*ee,j+=n*te,I+=n*re,F+=n*ne,O+=n*ie,T+=n*oe,Y+=n*ae,Q+=n*ue,J+=n*se,X+=n*ce,U+=n*fe,L+=n*he,B+=n*le,x+=n*de,$+=n*De,K+=n*be,n=h[5],j+=n*ee,I+=n*te,F+=n*re,O+=n*ne,T+=n*ie,Y+=n*oe,Q+=n*ae,J+=n*ue,X+=n*se,U+=n*ce,L+=n*fe,B+=n*he,x+=n*le,$+=n*de,K+=n*De,W+=n*be,n=h[6],I+=n*ee,F+=n*te,O+=n*re,T+=n*ne,Y+=n*ie,Q+=n*oe,J+=n*ae,X+=n*ue,U+=n*se,L+=n*ce,B+=n*fe,x+=n*he,$+=n*le,K+=n*de,W+=n*De,V+=n*be,n=h[7],F+=n*ee,O+=n*te,T+=n*re,Y+=n*ne,Q+=n*ie,J+=n*oe,X+=n*ae,U+=n*ue,L+=n*se,B+=n*ce,x+=n*fe,$+=n*he,K+=n*le,W+=n*de,V+=n*De,q+=n*be,n=h[8],O+=n*ee,T+=n*te,Y+=n*re,Q+=n*ne,J+=n*ie,X+=n*oe,U+=n*ae,L+=n*ue,B+=n*se,x+=n*ce,$+=n*fe,K+=n*he,W+=n*le,V+=n*de,q+=n*De,G+=n*be,n=h[9],T+=n*ee,Y+=n*te,Q+=n*re,J+=n*ne,X+=n*ie,U+=n*oe,L+=n*ae,B+=n*ue,x+=n*se,$+=n*ce,K+=n*fe,W+=n*he,V+=n*le,q+=n*de,G+=n*De,k+=n*be,n=h[10],Y+=n*ee,Q+=n*te,J+=n*re,X+=n*ne,U+=n*ie,L+=n*oe,B+=n*ae,x+=n*ue,$+=n*se,K+=n*ce,W+=n*fe,V+=n*he,q+=n*le,G+=n*de,k+=n*De,Ae+=n*be,n=h[11],Q+=n*ee,J+=n*te,X+=n*re,U+=n*ne,L+=n*ie,B+=n*oe,x+=n*ae,$+=n*ue,K+=n*se,W+=n*ce,V+=n*fe,q+=n*he,G+=n*le,k+=n*de,Ae+=n*De,Pe+=n*be,n=h[12],J+=n*ee,X+=n*te,U+=n*re,L+=n*ne,B+=n*ie,x+=n*oe,$+=n*ae,K+=n*ue,W+=n*se,V+=n*ce,q+=n*fe,G+=n*he,k+=n*le,Ae+=n*de,Pe+=n*De,$e+=n*be,n=h[13],X+=n*ee,U+=n*te,L+=n*re,B+=n*ne,x+=n*ie,$+=n*oe,K+=n*ae,W+=n*ue,V+=n*se,q+=n*ce,G+=n*fe,k+=n*he,Ae+=n*le,Pe+=n*de,$e+=n*De,Qe+=n*be,n=h[14],U+=n*ee,L+=n*te,B+=n*re,x+=n*ne,$+=n*ie,K+=n*oe,W+=n*ae,V+=n*ue,q+=n*se,G+=n*ce,k+=n*fe,Ae+=n*he,Pe+=n*le,$e+=n*de,Qe+=n*De,ht+=n*be,n=h[15],L+=n*ee,B+=n*te,x+=n*re,$+=n*ne,K+=n*ie,W+=n*oe,V+=n*ae,q+=n*ue,G+=n*se,k+=n*ce,Ae+=n*fe,Pe+=n*he,$e+=n*le,Qe+=n*de,ht+=n*De,Wt+=n*be,m+=38*B,C+=38*x,N+=38*$,P+=38*K,R+=38*W,j+=38*V,I+=38*q,F+=38*G,O+=38*k,T+=38*Ae,Y+=38*Pe,Q+=38*$e,J+=38*Qe,X+=38*ht,U+=38*Wt,a=1,n=m+a+65535,a=Math.floor(n/65536),m=n-a*65536,n=C+a+65535,a=Math.floor(n/65536),C=n-a*65536,n=N+a+65535,a=Math.floor(n/65536),N=n-a*65536,n=P+a+65535,a=Math.floor(n/65536),P=n-a*65536,n=R+a+65535,a=Math.floor(n/65536),R=n-a*65536,n=j+a+65535,a=Math.floor(n/65536),j=n-a*65536,n=I+a+65535,a=Math.floor(n/65536),I=n-a*65536,n=F+a+65535,a=Math.floor(n/65536),F=n-a*65536,n=O+a+65535,a=Math.floor(n/65536),O=n-a*65536,n=T+a+65535,a=Math.floor(n/65536),T=n-a*65536,n=Y+a+65535,a=Math.floor(n/65536),Y=n-a*65536,n=Q+a+65535,a=Math.floor(n/65536),Q=n-a*65536,n=J+a+65535,a=Math.floor(n/65536),J=n-a*65536,n=X+a+65535,a=Math.floor(n/65536),X=n-a*65536,n=U+a+65535,a=Math.floor(n/65536),U=n-a*65536,n=L+a+65535,a=Math.floor(n/65536),L=n-a*65536,m+=a-1+37*(a-1),a=1,n=m+a+65535,a=Math.floor(n/65536),m=n-a*65536,n=C+a+65535,a=Math.floor(n/65536),C=n-a*65536,n=N+a+65535,a=Math.floor(n/65536),N=n-a*65536,n=P+a+65535,a=Math.floor(n/65536),P=n-a*65536,n=R+a+65535,a=Math.floor(n/65536),R=n-a*65536,n=j+a+65535,a=Math.floor(n/65536),j=n-a*65536,n=I+a+65535,a=Math.floor(n/65536),I=n-a*65536,n=F+a+65535,a=Math.floor(n/65536),F=n-a*65536,n=O+a+65535,a=Math.floor(n/65536),O=n-a*65536,n=T+a+65535,a=Math.floor(n/65536),T=n-a*65536,n=Y+a+65535,a=Math.floor(n/65536),Y=n-a*65536,n=Q+a+65535,a=Math.floor(n/65536),Q=n-a*65536,n=J+a+65535,a=Math.floor(n/65536),J=n-a*65536,n=X+a+65535,a=Math.floor(n/65536),X=n-a*65536,n=U+a+65535,a=Math.floor(n/65536),U=n-a*65536,n=L+a+65535,a=Math.floor(n/65536),L=n-a*65536,m+=a-1+37*(a-1),c[0]=m,c[1]=C,c[2]=N,c[3]=P,c[4]=R,c[5]=j,c[6]=I,c[7]=F,c[8]=O,c[9]=T,c[10]=Y,c[11]=Q,c[12]=J,c[13]=X,c[14]=U,c[15]=L}function v(c,h){y(c,h,h)}function g(c,h){const f=i();for(let n=0;n<16;n++)f[n]=h[n];for(let n=253;n>=0;n--)v(f,f),n!==2&&n!==4&&y(f,f,h);for(let n=0;n<16;n++)c[n]=f[n]}function S(c,h){const f=new Uint8Array(32),n=new Float64Array(80),a=i(),m=i(),C=i(),N=i(),P=i(),R=i();for(let O=0;O<31;O++)f[O]=c[O];f[31]=c[31]&127|64,f[0]&=248,_(n,h);for(let O=0;O<16;O++)m[O]=n[O];a[0]=N[0]=1;for(let O=254;O>=0;--O){const T=f[O>>>3]>>>(O&7)&1;u(a,m,T),u(C,N,T),D(P,a,C),w(a,a,C),D(C,m,N),w(m,m,N),v(N,P),v(R,a),y(a,C,a),y(C,m,P),D(P,a,C),w(a,a,C),v(m,a),w(C,N,R),y(a,C,s),D(a,a,N),y(C,C,a),y(a,N,R),y(N,m,n),v(m,P),u(a,m,T),u(C,N,T)}for(let O=0;O<16;O++)n[O+16]=a[O],n[O+32]=C[O],n[O+48]=m[O],n[O+64]=N[O];const j=n.subarray(32),I=n.subarray(16);g(j,j),y(I,I,j);const F=new Uint8Array(32);return l(F,I),F}e.scalarMult=S;function p(c){return S(c,o)}e.scalarMultBase=p;function A(c){if(c.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const h=new Uint8Array(c);return{publicKey:p(h),secretKey:h}}e.generateKeyPairFromSeed=A;function d(c){const h=(0,t.randomBytes)(32,c),f=A(h);return(0,r.wipe)(h),f}e.generateKeyPair=d;function E(c,h,f=!1){if(c.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(h.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const n=S(c,h);if(f){let a=0;for(let m=0;m<n.length;m++)a|=n[m];if(a===0)throw new Error("X25519: invalid shared key")}return n}e.sharedKey=E})(Ft);function Mt(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Fr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Mt(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function mt(e,t){t||(t=e.reduce((o,s)=>o+s.length,0));const r=Fr(t);let i=0;for(const o of e)r.set(o,i),i+=o.length;return Mt(r)}function xn(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var o=0;o<e.length;o++){var s=e.charAt(o),b=s.charCodeAt(0);if(r[b]!==255)throw new TypeError(s+" is ambiguous");r[b]=o}var u=e.length,l=e.charAt(0),_=Math.log(u)/Math.log(256),D=Math.log(256)/Math.log(u);function w(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var S=0,p=0,A=0,d=g.length;A!==d&&g[A]===0;)A++,S++;for(var E=(d-A)*D+1>>>0,c=new Uint8Array(E);A!==d;){for(var h=g[A],f=0,n=E-1;(h!==0||f<p)&&n!==-1;n--,f++)h+=256*c[n]>>>0,c[n]=h%u>>>0,h=h/u>>>0;if(h!==0)throw new Error("Non-zero carry");p=f,A++}for(var a=E-p;a!==E&&c[a]===0;)a++;for(var m=l.repeat(S);a<E;++a)m+=e.charAt(c[a]);return m}function y(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var S=0;if(g[S]!==" "){for(var p=0,A=0;g[S]===l;)p++,S++;for(var d=(g.length-S)*_+1>>>0,E=new Uint8Array(d);g[S];){var c=r[g.charCodeAt(S)];if(c===255)return;for(var h=0,f=d-1;(c!==0||h<A)&&f!==-1;f--,h++)c+=u*E[f]>>>0,E[f]=c%256>>>0,c=c/256>>>0;if(c!==0)throw new Error("Non-zero carry");A=h,S++}if(g[S]!==" "){for(var n=d-A;n!==d&&E[n]===0;)n++;for(var a=new Uint8Array(p+(d-n)),m=p;n!==d;)a[m++]=E[n++];return a}}}function v(g){var S=y(g);if(S)return S;throw new Error(`Non-${t} character`)}return{encode:w,decodeUnsafe:y,decode:v}}var $n=xn,Hn=$n;const Kn=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Wn=e=>new TextEncoder().encode(e),Vn=e=>new TextDecoder().decode(e);class qn{constructor(t,r,i){this.name=t,this.prefix=r,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class zn{constructor(t,r,i){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Mr(this,t)}}class Gn{constructor(t){this.decoders=t}or(t){return Mr(this,t)}decode(t){const r=t[0],i=this.decoders[r];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Mr=(e,t)=>new Gn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Yn{constructor(t,r,i,o){this.name=t,this.prefix=r,this.baseEncode=i,this.baseDecode=o,this.encoder=new qn(t,r,i),this.decoder=new zn(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const st=({name:e,prefix:t,encode:r,decode:i})=>new Yn(e,t,r,i),Ge=({prefix:e,name:t,alphabet:r})=>{const{encode:i,decode:o}=Hn(r,t);return st({prefix:e,name:t,encode:i,decode:s=>Kn(o(s))})},kn=(e,t,r,i)=>{const o={};for(let D=0;D<t.length;++D)o[t[D]]=D;let s=e.length;for(;e[s-1]==="=";)--s;const b=new Uint8Array(s*r/8|0);let u=0,l=0,_=0;for(let D=0;D<s;++D){const w=o[e[D]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<r|w,u+=r,u>=8&&(u-=8,b[_++]=255&l>>u)}if(u>=r||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return b},Xn=(e,t,r)=>{const i=t[t.length-1]==="=",o=(1<<r)-1;let s="",b=0,u=0;for(let l=0;l<e.length;++l)for(u=u<<8|e[l],b+=8;b>r;)b-=r,s+=t[o&u>>b];if(b&&(s+=t[o&u<<r-b]),i)for(;s.length*r&7;)s+="=";return s},Z=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>st({prefix:t,name:e,encode(o){return Xn(o,i,r)},decode(o){return kn(o,i,r,e)}}),Jn=st({prefix:"\0",name:"identity",encode:e=>Vn(e),decode:e=>Wn(e)}),Qn=Object.freeze(Object.defineProperty({__proto__:null,identity:Jn},Symbol.toStringTag,{value:"Module"})),Zn=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ei=Object.freeze(Object.defineProperty({__proto__:null,base2:Zn},Symbol.toStringTag,{value:"Module"})),ti=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),ri=Object.freeze(Object.defineProperty({__proto__:null,base8:ti},Symbol.toStringTag,{value:"Module"})),ni=Ge({prefix:"9",name:"base10",alphabet:"0123456789"}),ii=Object.freeze(Object.defineProperty({__proto__:null,base10:ni},Symbol.toStringTag,{value:"Module"})),oi=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ai=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),ui=Object.freeze(Object.defineProperty({__proto__:null,base16:oi,base16upper:ai},Symbol.toStringTag,{value:"Module"})),si=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ci=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),fi=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),hi=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),li=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),di=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Di=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),bi=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_i=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Ei=Object.freeze(Object.defineProperty({__proto__:null,base32:si,base32hex:li,base32hexpad:Di,base32hexpadupper:bi,base32hexupper:di,base32pad:fi,base32padupper:hi,base32upper:ci,base32z:_i},Symbol.toStringTag,{value:"Module"})),wi=Ge({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),vi=Ge({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),yi=Object.freeze(Object.defineProperty({__proto__:null,base36:wi,base36upper:vi},Symbol.toStringTag,{value:"Module"})),gi=Ge({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pi=Ge({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),mi=Object.freeze(Object.defineProperty({__proto__:null,base58btc:gi,base58flickr:pi},Symbol.toStringTag,{value:"Module"})),Si=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Oi=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ci=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ui=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Ai=Object.freeze(Object.defineProperty({__proto__:null,base64:Si,base64pad:Oi,base64url:Ci,base64urlpad:Ui},Symbol.toStringTag,{value:"Module"})),Pr=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ni=Pr.reduce((e,t,r)=>(e[r]=t,e),[]),Ti=Pr.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Ii(e){return e.reduce((t,r)=>(t+=Ni[r],t),"")}function Fi(e){const t=[];for(const r of e){const i=Ti[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(i)}return new Uint8Array(t)}const Mi=st({prefix:"🚀",name:"base256emoji",encode:Ii,decode:Fi}),Pi=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Mi},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Gt={...Qn,...ei,...ri,...ii,...ui,...Ei,...yi,...mi,...Ai,...Pi};function jr(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}const Yt=jr("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),lt=jr("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Fr(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Rr={utf8:Yt,"utf-8":Yt,hex:Gt.base16,latin1:lt,ascii:lt,binary:lt,...Gt};function ye(e,t="utf8"){const r=Rr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Mt(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function ge(e,t="utf8"){const r=Rr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var kt=function(e,t,r){if(r||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},ji=function(){function e(t,r,i){this.name=t,this.version=r,this.os=i,this.type="browser"}return e}(),Ri=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=H.dist.process.platform}return e}(),Li=function(){function e(t,r,i,o){this.name=t,this.version=r,this.os=i,this.bot=o,this.type="bot-device"}return e}(),Bi=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),xi=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),$i=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Hi=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Xt=3,Ki=[["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",$i]],Jt=[["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 Wi(e){return e?Qt(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new xi:typeof navigator<"u"?Qt(navigator.userAgent):zi()}function Vi(e){return e!==""&&Ki.reduce(function(t,r){var i=r[0],o=r[1];if(t)return t;var s=o.exec(e);return!!s&&[i,s]},!1)}function Qt(e){var t=Vi(e);if(!t)return null;var r=t[0],i=t[1];if(r==="searchbot")return new Bi;var o=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);o?o.length<Xt&&(o=kt(kt([],o,!0),Gi(Xt-o.length),!0)):o=[];var s=o.join("."),b=qi(e),u=Hi.exec(e);return u&&u[1]?new Li(r,s,b,u[1]):new ji(r,s,b)}function qi(e){for(var t=0,r=Jt.length;t<r;t++){var i=Jt[t],o=i[0],s=i[1],b=s.exec(e);if(b)return o}return null}function zi(){var e=typeof H.dist.process<"u"&&H.dist.process.version;return e?new Ri(H.dist.process.version.slice(1)):null}function Gi(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var Oe={};/*! *****************************************************************************
|
|
1
|
+
"use strict";const H=require("./index-4Y1uNAAU.js");var Tt={},nt={},M={},gr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,l){var _=u>>>16&65535,D=u&65535,w=l>>>16&65535,y=l&65535;return D*y+(_*y+D*w<<16>>>0)|0}e.mul=Math.imul||t;function r(u,l){return u+l|0}e.add=r;function i(u,l){return u-l|0}e.sub=i;function o(u,l){return u<<l|u>>>32-l}e.rotl=o;function s(u,l){return u<<32-l|u>>>l}e.rotr=s;function b(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}e.isInteger=Number.isInteger||b,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(u){return e.isInteger(u)&&u>=-e.MAX_SAFE_INTEGER&&u<=e.MAX_SAFE_INTEGER}})(gr);Object.defineProperty(M,"__esModule",{value:!0});var pr=gr;function Qr(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}M.readInt16BE=Qr;function Zr(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])>>>0}M.readUint16BE=Zr;function en(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])<<16>>16}M.readInt16LE=en;function tn(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])>>>0}M.readUint16LE=tn;function mr(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}M.writeUint16BE=mr;M.writeInt16BE=mr;function Sr(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}M.writeUint16LE=Sr;M.writeInt16LE=Sr;function wt(e,t){return t===void 0&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}M.readInt32BE=wt;function vt(e,t){return t===void 0&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}M.readUint32BE=vt;function yt(e,t){return t===void 0&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}M.readInt32LE=yt;function gt(e,t){return t===void 0&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}M.readUint32LE=gt;function et(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}M.writeUint32BE=et;M.writeInt32BE=et;function tt(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}M.writeUint32LE=tt;M.writeInt32LE=tt;function rn(e,t){t===void 0&&(t=0);var r=wt(e,t),i=wt(e,t+4);return r*4294967296+i-(i>>31)*4294967296}M.readInt64BE=rn;function nn(e,t){t===void 0&&(t=0);var r=vt(e,t),i=vt(e,t+4);return r*4294967296+i}M.readUint64BE=nn;function on(e,t){t===void 0&&(t=0);var r=yt(e,t),i=yt(e,t+4);return i*4294967296+r-(r>>31)*4294967296}M.readInt64LE=on;function an(e,t){t===void 0&&(t=0);var r=gt(e,t),i=gt(e,t+4);return i*4294967296+r}M.readUint64LE=an;function Or(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),et(e/4294967296>>>0,t,r),et(e>>>0,t,r+4),t}M.writeUint64BE=Or;M.writeInt64BE=Or;function Cr(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),tt(e>>>0,t,r),tt(e/4294967296>>>0,t,r+4),t}M.writeUint64LE=Cr;M.writeInt64LE=Cr;function un(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,o=1,s=e/8+r-1;s>=r;s--)i+=t[s]*o,o*=256;return i}M.readUintBE=un;function sn(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,o=1,s=r;s<r+e/8;s++)i+=t[s]*o,o*=256;return i}M.readUintLE=sn;function cn(e,t,r,i){if(r===void 0&&(r=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!pr.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)r[s]=t/o&255,o*=256;return r}M.writeUintBE=cn;function fn(e,t,r,i){if(r===void 0&&(r=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!pr.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)r[s]=t/o&255,o*=256;return r}M.writeUintLE=fn;function hn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t)}M.readFloat32BE=hn;function ln(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t,!0)}M.readFloat32LE=ln;function dn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t)}M.readFloat64BE=dn;function Dn(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t,!0)}M.readFloat64LE=Dn;function bn(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat32(r,e),t}M.writeFloat32BE=bn;function _n(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat32(r,e,!0),t}M.writeFloat32LE=_n;function En(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat64(r,e),t}M.writeFloat64BE=En;function wn(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.setFloat64(r,e,!0),t}M.writeFloat64LE=wn;var pe={};Object.defineProperty(pe,"__esModule",{value:!0});function vn(e){for(var t=0;t<e.length;t++)e[t]=0;return e}pe.wipe=vn;Object.defineProperty(nt,"__esModule",{value:!0});var _e=M,pt=pe,yn=20;function gn(e,t,r){for(var i=1634760805,o=857760878,s=2036477234,b=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],_=r[11]<<24|r[10]<<16|r[9]<<8|r[8],D=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],y=r[23]<<24|r[22]<<16|r[21]<<8|r[20],v=r[27]<<24|r[26]<<16|r[25]<<8|r[24],g=r[31]<<24|r[30]<<16|r[29]<<8|r[28],S=t[3]<<24|t[2]<<16|t[1]<<8|t[0],p=t[7]<<24|t[6]<<16|t[5]<<8|t[4],A=t[11]<<24|t[10]<<16|t[9]<<8|t[8],d=t[15]<<24|t[14]<<16|t[13]<<8|t[12],E=i,c=o,h=s,f=b,n=u,a=l,m=_,C=D,N=w,P=y,R=v,j=g,I=S,F=p,O=A,T=d,Y=0;Y<yn;Y+=2)E=E+n|0,I^=E,I=I>>>16|I<<16,N=N+I|0,n^=N,n=n>>>20|n<<12,c=c+a|0,F^=c,F=F>>>16|F<<16,P=P+F|0,a^=P,a=a>>>20|a<<12,h=h+m|0,O^=h,O=O>>>16|O<<16,R=R+O|0,m^=R,m=m>>>20|m<<12,f=f+C|0,T^=f,T=T>>>16|T<<16,j=j+T|0,C^=j,C=C>>>20|C<<12,h=h+m|0,O^=h,O=O>>>24|O<<8,R=R+O|0,m^=R,m=m>>>25|m<<7,f=f+C|0,T^=f,T=T>>>24|T<<8,j=j+T|0,C^=j,C=C>>>25|C<<7,c=c+a|0,F^=c,F=F>>>24|F<<8,P=P+F|0,a^=P,a=a>>>25|a<<7,E=E+n|0,I^=E,I=I>>>24|I<<8,N=N+I|0,n^=N,n=n>>>25|n<<7,E=E+a|0,T^=E,T=T>>>16|T<<16,R=R+T|0,a^=R,a=a>>>20|a<<12,c=c+m|0,I^=c,I=I>>>16|I<<16,j=j+I|0,m^=j,m=m>>>20|m<<12,h=h+C|0,F^=h,F=F>>>16|F<<16,N=N+F|0,C^=N,C=C>>>20|C<<12,f=f+n|0,O^=f,O=O>>>16|O<<16,P=P+O|0,n^=P,n=n>>>20|n<<12,h=h+C|0,F^=h,F=F>>>24|F<<8,N=N+F|0,C^=N,C=C>>>25|C<<7,f=f+n|0,O^=f,O=O>>>24|O<<8,P=P+O|0,n^=P,n=n>>>25|n<<7,c=c+m|0,I^=c,I=I>>>24|I<<8,j=j+I|0,m^=j,m=m>>>25|m<<7,E=E+a|0,T^=E,T=T>>>24|T<<8,R=R+T|0,a^=R,a=a>>>25|a<<7;_e.writeUint32LE(E+i|0,e,0),_e.writeUint32LE(c+o|0,e,4),_e.writeUint32LE(h+s|0,e,8),_e.writeUint32LE(f+b|0,e,12),_e.writeUint32LE(n+u|0,e,16),_e.writeUint32LE(a+l|0,e,20),_e.writeUint32LE(m+_|0,e,24),_e.writeUint32LE(C+D|0,e,28),_e.writeUint32LE(N+w|0,e,32),_e.writeUint32LE(P+y|0,e,36),_e.writeUint32LE(R+v|0,e,40),_e.writeUint32LE(j+g|0,e,44),_e.writeUint32LE(I+S|0,e,48),_e.writeUint32LE(F+p|0,e,52),_e.writeUint32LE(O+A|0,e,56),_e.writeUint32LE(T+d|0,e,60)}function Ur(e,t,r,i,o){if(o===void 0&&(o=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,b;if(o===0){if(t.length!==8&&t.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),b=s.length-t.length,s.set(t,b)}else{if(t.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=t,b=o}for(var u=new Uint8Array(64),l=0;l<r.length;l+=64){gn(u,s,e);for(var _=l;_<l+64&&_<r.length;_++)i[_]=r[_]^u[_-l];mn(s,0,b)}return pt.wipe(u),o===0&&pt.wipe(s),i}nt.streamXOR=Ur;function pn(e,t,r,i){return i===void 0&&(i=0),pt.wipe(r),Ur(e,t,r,r,i)}nt.stream=pn;function mn(e,t,r){for(var i=1;r--;)i=i+(e[t]&255)|0,e[t]=i&255,i>>>=8,t++;if(i>0)throw new Error("ChaCha: counter overflow")}var Ar={},Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});function Sn(e,t,r){return~(e-1)&t|e-1&r}Ue.select=Sn;function On(e,t){return(e|0)-(t|0)-1>>>31&1}Ue.lessOrEqual=On;function Nr(e,t){if(e.length!==t.length)return 0;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 1&r-1>>>8}Ue.compare=Nr;function Cn(e,t){return e.length===0||t.length===0?!1:Nr(e,t)!==0}Ue.equal=Cn;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ue,r=pe;e.DIGEST_LENGTH=16;var i=function(){function b(u){this.digestLength=e.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 l=u[0]|u[1]<<8;this._r[0]=l&8191;var _=u[2]|u[3]<<8;this._r[1]=(l>>>13|_<<3)&8191;var D=u[4]|u[5]<<8;this._r[2]=(_>>>10|D<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(D>>>7|w<<9)&8191;var y=u[8]|u[9]<<8;this._r[4]=(w>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var v=u[10]|u[11]<<8;this._r[6]=(y>>>14|v<<2)&8191;var g=u[12]|u[13]<<8;this._r[7]=(v>>>11|g<<5)&8065;var S=u[14]|u[15]<<8;this._r[8]=(g>>>8|S<<8)&8191,this._r[9]=S>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return b.prototype._blocks=function(u,l,_){for(var D=this._fin?0:2048,w=this._h[0],y=this._h[1],v=this._h[2],g=this._h[3],S=this._h[4],p=this._h[5],A=this._h[6],d=this._h[7],E=this._h[8],c=this._h[9],h=this._r[0],f=this._r[1],n=this._r[2],a=this._r[3],m=this._r[4],C=this._r[5],N=this._r[6],P=this._r[7],R=this._r[8],j=this._r[9];_>=16;){var I=u[l+0]|u[l+1]<<8;w+=I&8191;var F=u[l+2]|u[l+3]<<8;y+=(I>>>13|F<<3)&8191;var O=u[l+4]|u[l+5]<<8;v+=(F>>>10|O<<6)&8191;var T=u[l+6]|u[l+7]<<8;g+=(O>>>7|T<<9)&8191;var Y=u[l+8]|u[l+9]<<8;S+=(T>>>4|Y<<12)&8191,p+=Y>>>1&8191;var Q=u[l+10]|u[l+11]<<8;A+=(Y>>>14|Q<<2)&8191;var J=u[l+12]|u[l+13]<<8;d+=(Q>>>11|J<<5)&8191;var X=u[l+14]|u[l+15]<<8;E+=(J>>>8|X<<8)&8191,c+=X>>>5|D;var U=0,L=U;L+=w*h,L+=y*(5*j),L+=v*(5*R),L+=g*(5*P),L+=S*(5*N),U=L>>>13,L&=8191,L+=p*(5*C),L+=A*(5*m),L+=d*(5*a),L+=E*(5*n),L+=c*(5*f),U+=L>>>13,L&=8191;var B=U;B+=w*f,B+=y*h,B+=v*(5*j),B+=g*(5*R),B+=S*(5*P),U=B>>>13,B&=8191,B+=p*(5*N),B+=A*(5*C),B+=d*(5*m),B+=E*(5*a),B+=c*(5*n),U+=B>>>13,B&=8191;var x=U;x+=w*n,x+=y*f,x+=v*h,x+=g*(5*j),x+=S*(5*R),U=x>>>13,x&=8191,x+=p*(5*P),x+=A*(5*N),x+=d*(5*C),x+=E*(5*m),x+=c*(5*a),U+=x>>>13,x&=8191;var $=U;$+=w*a,$+=y*n,$+=v*f,$+=g*h,$+=S*(5*j),U=$>>>13,$&=8191,$+=p*(5*R),$+=A*(5*P),$+=d*(5*N),$+=E*(5*C),$+=c*(5*m),U+=$>>>13,$&=8191;var K=U;K+=w*m,K+=y*a,K+=v*n,K+=g*f,K+=S*h,U=K>>>13,K&=8191,K+=p*(5*j),K+=A*(5*R),K+=d*(5*P),K+=E*(5*N),K+=c*(5*C),U+=K>>>13,K&=8191;var W=U;W+=w*C,W+=y*m,W+=v*a,W+=g*n,W+=S*f,U=W>>>13,W&=8191,W+=p*h,W+=A*(5*j),W+=d*(5*R),W+=E*(5*P),W+=c*(5*N),U+=W>>>13,W&=8191;var V=U;V+=w*N,V+=y*C,V+=v*m,V+=g*a,V+=S*n,U=V>>>13,V&=8191,V+=p*f,V+=A*h,V+=d*(5*j),V+=E*(5*R),V+=c*(5*P),U+=V>>>13,V&=8191;var q=U;q+=w*P,q+=y*N,q+=v*C,q+=g*m,q+=S*a,U=q>>>13,q&=8191,q+=p*n,q+=A*f,q+=d*h,q+=E*(5*j),q+=c*(5*R),U+=q>>>13,q&=8191;var G=U;G+=w*R,G+=y*P,G+=v*N,G+=g*C,G+=S*m,U=G>>>13,G&=8191,G+=p*a,G+=A*n,G+=d*f,G+=E*h,G+=c*(5*j),U+=G>>>13,G&=8191;var k=U;k+=w*j,k+=y*R,k+=v*P,k+=g*N,k+=S*C,U=k>>>13,k&=8191,k+=p*m,k+=A*a,k+=d*n,k+=E*f,k+=c*h,U+=k>>>13,k&=8191,U=(U<<2)+U|0,U=U+L|0,L=U&8191,U=U>>>13,B+=U,w=L,y=B,v=x,g=$,S=K,p=W,A=V,d=q,E=G,c=k,l+=16,_-=16}this._h[0]=w,this._h[1]=y,this._h[2]=v,this._h[3]=g,this._h[4]=S,this._h[5]=p,this._h[6]=A,this._h[7]=d,this._h[8]=E,this._h[9]=c},b.prototype.finish=function(u,l){l===void 0&&(l=0);var _=new Uint16Array(10),D,w,y,v;if(this._leftover){for(v=this._leftover,this._buffer[v++]=1;v<16;v++)this._buffer[v]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(D=this._h[1]>>>13,this._h[1]&=8191,v=2;v<10;v++)this._h[v]+=D,D=this._h[v]>>>13,this._h[v]&=8191;for(this._h[0]+=D*5,D=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=D,D=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=D,_[0]=this._h[0]+5,D=_[0]>>>13,_[0]&=8191,v=1;v<10;v++)_[v]=this._h[v]+D,D=_[v]>>>13,_[v]&=8191;for(_[9]-=8192,w=(D^1)-1,v=0;v<10;v++)_[v]&=w;for(w=~w,v=0;v<10;v++)this._h[v]=this._h[v]&w|_[v];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,y=this._h[0]+this._pad[0],this._h[0]=y&65535,v=1;v<8;v++)y=(this._h[v]+this._pad[v]|0)+(y>>>16)|0,this._h[v]=y&65535;return u[l+0]=this._h[0]>>>0,u[l+1]=this._h[0]>>>8,u[l+2]=this._h[1]>>>0,u[l+3]=this._h[1]>>>8,u[l+4]=this._h[2]>>>0,u[l+5]=this._h[2]>>>8,u[l+6]=this._h[3]>>>0,u[l+7]=this._h[3]>>>8,u[l+8]=this._h[4]>>>0,u[l+9]=this._h[4]>>>8,u[l+10]=this._h[5]>>>0,u[l+11]=this._h[5]>>>8,u[l+12]=this._h[6]>>>0,u[l+13]=this._h[6]>>>8,u[l+14]=this._h[7]>>>0,u[l+15]=this._h[7]>>>8,this._finished=!0,this},b.prototype.update=function(u){var l=0,_=u.length,D;if(this._leftover){D=16-this._leftover,D>_&&(D=_);for(var w=0;w<D;w++)this._buffer[this._leftover+w]=u[l+w];if(_-=D,l+=D,this._leftover+=D,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(_>=16&&(D=_-_%16,this._blocks(u,l,D),l+=D,_-=D),_){for(var w=0;w<_;w++)this._buffer[this._leftover+w]=u[l+w];this._leftover+=_}return this},b.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},b.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},b}();e.Poly1305=i;function o(b,u){var l=new i(b);l.update(u);var _=l.digest();return l.clean(),_}e.oneTimeAuth=o;function s(b,u){return b.length!==e.DIGEST_LENGTH||u.length!==e.DIGEST_LENGTH?!1:t.equal(b,u)}e.equal=s})(Ar);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=nt,r=Ar,i=pe,o=M,s=Ue;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var b=new Uint8Array(16),u=function(){function l(_){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,_.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(_)}return l.prototype.seal=function(_,D,w,y){if(_.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var v=new Uint8Array(16);v.set(_,v.length-_.length);var g=new Uint8Array(32);t.stream(this._key,v,g,4);var S=D.length+this.tagLength,p;if(y){if(y.length!==S)throw new Error("ChaCha20Poly1305: incorrect destination length");p=y}else p=new Uint8Array(S);return t.streamXOR(this._key,v,D,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),g,p.subarray(0,p.length-this.tagLength),w),i.wipe(v),p},l.prototype.open=function(_,D,w,y){if(_.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(D.length<this.tagLength)return null;var v=new Uint8Array(16);v.set(_,v.length-_.length);var g=new Uint8Array(32);t.stream(this._key,v,g,4);var S=new Uint8Array(this.tagLength);if(this._authenticate(S,g,D.subarray(0,D.length-this.tagLength),w),!s.equal(S,D.subarray(D.length-this.tagLength,D.length)))return null;var p=D.length-this.tagLength,A;if(y){if(y.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");A=y}else A=new Uint8Array(p);return t.streamXOR(this._key,v,D.subarray(0,D.length-this.tagLength),A,4),i.wipe(v),A},l.prototype.clean=function(){return i.wipe(this._key),this},l.prototype._authenticate=function(_,D,w,y){var v=new r.Poly1305(D);y&&(v.update(y),y.length%16>0&&v.update(b.subarray(y.length%16))),v.update(w),w.length%16>0&&v.update(b.subarray(w.length%16));var g=new Uint8Array(8);y&&o.writeUint64LE(y.length,g),v.update(g),o.writeUint64LE(w.length,g),v.update(g);for(var S=v.digest(),p=0;p<S.length;p++)_[p]=S[p];v.clean(),i.wipe(S),i.wipe(g)},l}();e.ChaCha20Poly1305=u})(Tt);var Tr={},qe={},It={};Object.defineProperty(It,"__esModule",{value:!0});function Un(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}It.isSerializableHash=Un;Object.defineProperty(qe,"__esModule",{value:!0});var me=It,An=Ue,Nn=pe,Ir=function(){function e(t,r){this._finished=!1,this._inner=new t,this._outer=new t,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(i).clean():i.set(r);for(var o=0;o<i.length;o++)i[o]^=54;this._inner.update(i);for(var o=0;o<i.length;o++)i[o]^=106;this._outer.update(i),me.isSerializableHash(this._inner)&&me.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Nn.wipe(i)}return e.prototype.reset=function(){if(!me.isSerializableHash(this._inner)||!me.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},e.prototype.clean=function(){me.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),me.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(t){return this._inner.update(t),this},e.prototype.finish=function(t){return this._finished?(this._outer.finish(t),this):(this._inner.finish(t),this._outer.update(t.subarray(0,this.digestLength)).finish(t),this._finished=!0,this)},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype.saveState=function(){if(!me.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(t){if(!me.isSerializableHash(this._inner)||!me.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(t),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(t){if(!me.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(t)},e}();qe.HMAC=Ir;function Tn(e,t,r){var i=new Ir(e,t);i.update(r);var o=i.digest();return i.clean(),o}qe.hmac=Tn;qe.equal=An.equal;Object.defineProperty(Tr,"__esModule",{value:!0});var Vt=qe,qt=pe,In=function(){function e(t,r,i,o){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=t,this._info=o;var s=Vt.hmac(this._hash,i,r);this._hmac=new Vt.HMAC(t,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var t=this._counter[0];if(t===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),t>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},e.prototype.expand=function(t){for(var r=new Uint8Array(t),i=0;i<r.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[i]=this._buffer[this._bufpos++];return r},e.prototype.clean=function(){this._hmac.clean(),qt.wipe(this._buffer),qt.wipe(this._counter),this._bufpos=0},e}(),Fn=Tr.HKDF=In,ze={},it={},ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.BrowserRandomSource=void 0;const zt=65536;class Mn{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const t=typeof self<"u"?self.crypto||self.msCrypto:null;t&&t.getRandomValues!==void 0&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(t);for(let i=0;i<r.length;i+=zt)this._crypto.getRandomValues(r.subarray(i,i+Math.min(r.length-i,zt)));return r}}ot.BrowserRandomSource=Mn;var at={};Object.defineProperty(at,"__esModule",{value:!0});at.NodeRandomSource=void 0;const Pn=pe;class jn{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof H.commonjsRequire<"u"){const t=H.requireCryptoBrowserify();t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(t);if(r.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(t);for(let o=0;o<i.length;o++)i[o]=r[o];return(0,Pn.wipe)(r),i}}at.NodeRandomSource=jn;Object.defineProperty(it,"__esModule",{value:!0});it.SystemRandomSource=void 0;const Rn=ot,Ln=at;class Bn{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Rn.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Ln.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}}it.SystemRandomSource=Bn;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const t=it,r=M,i=pe;e.defaultRandomSource=new t.SystemRandomSource;function o(_,D=e.defaultRandomSource){return D.randomBytes(_)}e.randomBytes=o;function s(_=e.defaultRandomSource){const D=o(4,_),w=(0,r.readUint32LE)(D);return(0,i.wipe)(D),w}e.randomUint32=s;const b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(_,D=b,w=e.defaultRandomSource){if(D.length<2)throw new Error("randomString charset is too short");if(D.length>256)throw new Error("randomString charset is too long");let y="";const v=D.length,g=256-256%v;for(;_>0;){const S=o(Math.ceil(_*256/g),w);for(let p=0;p<S.length&&_>0;p++){const A=S[p];A<g&&(y+=D.charAt(A%v),_--)}(0,i.wipe)(S)}return y}e.randomString=u;function l(_,D=b,w=e.defaultRandomSource){const y=Math.ceil(_/(Math.log(D.length)/Math.LN2));return u(y,D,w)}e.randomStringForEntropy=l})(ze);var ut={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=M,r=pe;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 u.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},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},u.prototype.update=function(l,_){if(_===void 0&&(_=l.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var D=0;if(this._bytesHashed+=_,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&_>0;)this._buffer[this._bufferLength++]=l[D++],_--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(_>=this.blockSize&&(D=s(this._temp,this._state,l,D,_),_%=this.blockSize);_>0;)this._buffer[this._bufferLength++]=l[D++],_--;return this},u.prototype.finish=function(l){if(!this._finished){var _=this._bytesHashed,D=this._bufferLength,w=_/536870912|0,y=_<<3,v=_%64<56?64:128;this._buffer[D]=128;for(var g=D+1;g<v-8;g++)this._buffer[g]=0;t.writeUint32BE(w,this._buffer,v-8),t.writeUint32BE(y,this._buffer,v-4),s(this._temp,this._state,this._buffer,0,v),this._finished=!0}for(var g=0;g<this.digestLength/4;g++)t.writeUint32BE(this._state[g],l,g*4);return this},u.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},u.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}},u.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},u}();e.SHA256=i;var o=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 s(u,l,_,D,w){for(;w>=64;){for(var y=l[0],v=l[1],g=l[2],S=l[3],p=l[4],A=l[5],d=l[6],E=l[7],c=0;c<16;c++){var h=D+c*4;u[c]=t.readUint32BE(_,h)}for(var c=16;c<64;c++){var f=u[c-2],n=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10;f=u[c-15];var a=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;u[c]=(n+u[c-7]|0)+(a+u[c-16]|0)}for(var c=0;c<64;c++){var n=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&A^~p&d)|0)+(E+(o[c]+u[c]|0)|0)|0,a=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&v^y&g^v&g)|0;E=d,d=A,A=p,p=S+n|0,S=g,g=v,v=y,y=n+a|0}l[0]+=y,l[1]+=v,l[2]+=g,l[3]+=S,l[4]+=p,l[5]+=A,l[6]+=d,l[7]+=E,D+=64,w-=64}return D}function b(u){var l=new i;l.update(u);var _=l.digest();return l.clean(),_}e.hash=b})(ut);var Ft={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const t=ze,r=pe;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function i(c){const h=new Float64Array(16);if(c)for(let f=0;f<c.length;f++)h[f]=c[f];return h}const o=new Uint8Array(32);o[0]=9;const s=i([56129,1]);function b(c){let h=1;for(let f=0;f<16;f++){let n=c[f]+h+65535;h=Math.floor(n/65536),c[f]=n-h*65536}c[0]+=h-1+37*(h-1)}function u(c,h,f){const n=~(f-1);for(let a=0;a<16;a++){const m=n&(c[a]^h[a]);c[a]^=m,h[a]^=m}}function l(c,h){const f=i(),n=i();for(let a=0;a<16;a++)n[a]=h[a];b(n),b(n),b(n);for(let a=0;a<2;a++){f[0]=n[0]-65517;for(let C=1;C<15;C++)f[C]=n[C]-65535-(f[C-1]>>16&1),f[C-1]&=65535;f[15]=n[15]-32767-(f[14]>>16&1);const m=f[15]>>16&1;f[14]&=65535,u(n,f,1-m)}for(let a=0;a<16;a++)c[2*a]=n[a]&255,c[2*a+1]=n[a]>>8}function _(c,h){for(let f=0;f<16;f++)c[f]=h[2*f]+(h[2*f+1]<<8);c[15]&=32767}function D(c,h,f){for(let n=0;n<16;n++)c[n]=h[n]+f[n]}function w(c,h,f){for(let n=0;n<16;n++)c[n]=h[n]-f[n]}function y(c,h,f){let n,a,m=0,C=0,N=0,P=0,R=0,j=0,I=0,F=0,O=0,T=0,Y=0,Q=0,J=0,X=0,U=0,L=0,B=0,x=0,$=0,K=0,W=0,V=0,q=0,G=0,k=0,Ae=0,Pe=0,$e=0,Qe=0,ht=0,Wt=0,ee=f[0],te=f[1],re=f[2],ne=f[3],ie=f[4],oe=f[5],ae=f[6],ue=f[7],se=f[8],ce=f[9],fe=f[10],he=f[11],le=f[12],de=f[13],De=f[14],be=f[15];n=h[0],m+=n*ee,C+=n*te,N+=n*re,P+=n*ne,R+=n*ie,j+=n*oe,I+=n*ae,F+=n*ue,O+=n*se,T+=n*ce,Y+=n*fe,Q+=n*he,J+=n*le,X+=n*de,U+=n*De,L+=n*be,n=h[1],C+=n*ee,N+=n*te,P+=n*re,R+=n*ne,j+=n*ie,I+=n*oe,F+=n*ae,O+=n*ue,T+=n*se,Y+=n*ce,Q+=n*fe,J+=n*he,X+=n*le,U+=n*de,L+=n*De,B+=n*be,n=h[2],N+=n*ee,P+=n*te,R+=n*re,j+=n*ne,I+=n*ie,F+=n*oe,O+=n*ae,T+=n*ue,Y+=n*se,Q+=n*ce,J+=n*fe,X+=n*he,U+=n*le,L+=n*de,B+=n*De,x+=n*be,n=h[3],P+=n*ee,R+=n*te,j+=n*re,I+=n*ne,F+=n*ie,O+=n*oe,T+=n*ae,Y+=n*ue,Q+=n*se,J+=n*ce,X+=n*fe,U+=n*he,L+=n*le,B+=n*de,x+=n*De,$+=n*be,n=h[4],R+=n*ee,j+=n*te,I+=n*re,F+=n*ne,O+=n*ie,T+=n*oe,Y+=n*ae,Q+=n*ue,J+=n*se,X+=n*ce,U+=n*fe,L+=n*he,B+=n*le,x+=n*de,$+=n*De,K+=n*be,n=h[5],j+=n*ee,I+=n*te,F+=n*re,O+=n*ne,T+=n*ie,Y+=n*oe,Q+=n*ae,J+=n*ue,X+=n*se,U+=n*ce,L+=n*fe,B+=n*he,x+=n*le,$+=n*de,K+=n*De,W+=n*be,n=h[6],I+=n*ee,F+=n*te,O+=n*re,T+=n*ne,Y+=n*ie,Q+=n*oe,J+=n*ae,X+=n*ue,U+=n*se,L+=n*ce,B+=n*fe,x+=n*he,$+=n*le,K+=n*de,W+=n*De,V+=n*be,n=h[7],F+=n*ee,O+=n*te,T+=n*re,Y+=n*ne,Q+=n*ie,J+=n*oe,X+=n*ae,U+=n*ue,L+=n*se,B+=n*ce,x+=n*fe,$+=n*he,K+=n*le,W+=n*de,V+=n*De,q+=n*be,n=h[8],O+=n*ee,T+=n*te,Y+=n*re,Q+=n*ne,J+=n*ie,X+=n*oe,U+=n*ae,L+=n*ue,B+=n*se,x+=n*ce,$+=n*fe,K+=n*he,W+=n*le,V+=n*de,q+=n*De,G+=n*be,n=h[9],T+=n*ee,Y+=n*te,Q+=n*re,J+=n*ne,X+=n*ie,U+=n*oe,L+=n*ae,B+=n*ue,x+=n*se,$+=n*ce,K+=n*fe,W+=n*he,V+=n*le,q+=n*de,G+=n*De,k+=n*be,n=h[10],Y+=n*ee,Q+=n*te,J+=n*re,X+=n*ne,U+=n*ie,L+=n*oe,B+=n*ae,x+=n*ue,$+=n*se,K+=n*ce,W+=n*fe,V+=n*he,q+=n*le,G+=n*de,k+=n*De,Ae+=n*be,n=h[11],Q+=n*ee,J+=n*te,X+=n*re,U+=n*ne,L+=n*ie,B+=n*oe,x+=n*ae,$+=n*ue,K+=n*se,W+=n*ce,V+=n*fe,q+=n*he,G+=n*le,k+=n*de,Ae+=n*De,Pe+=n*be,n=h[12],J+=n*ee,X+=n*te,U+=n*re,L+=n*ne,B+=n*ie,x+=n*oe,$+=n*ae,K+=n*ue,W+=n*se,V+=n*ce,q+=n*fe,G+=n*he,k+=n*le,Ae+=n*de,Pe+=n*De,$e+=n*be,n=h[13],X+=n*ee,U+=n*te,L+=n*re,B+=n*ne,x+=n*ie,$+=n*oe,K+=n*ae,W+=n*ue,V+=n*se,q+=n*ce,G+=n*fe,k+=n*he,Ae+=n*le,Pe+=n*de,$e+=n*De,Qe+=n*be,n=h[14],U+=n*ee,L+=n*te,B+=n*re,x+=n*ne,$+=n*ie,K+=n*oe,W+=n*ae,V+=n*ue,q+=n*se,G+=n*ce,k+=n*fe,Ae+=n*he,Pe+=n*le,$e+=n*de,Qe+=n*De,ht+=n*be,n=h[15],L+=n*ee,B+=n*te,x+=n*re,$+=n*ne,K+=n*ie,W+=n*oe,V+=n*ae,q+=n*ue,G+=n*se,k+=n*ce,Ae+=n*fe,Pe+=n*he,$e+=n*le,Qe+=n*de,ht+=n*De,Wt+=n*be,m+=38*B,C+=38*x,N+=38*$,P+=38*K,R+=38*W,j+=38*V,I+=38*q,F+=38*G,O+=38*k,T+=38*Ae,Y+=38*Pe,Q+=38*$e,J+=38*Qe,X+=38*ht,U+=38*Wt,a=1,n=m+a+65535,a=Math.floor(n/65536),m=n-a*65536,n=C+a+65535,a=Math.floor(n/65536),C=n-a*65536,n=N+a+65535,a=Math.floor(n/65536),N=n-a*65536,n=P+a+65535,a=Math.floor(n/65536),P=n-a*65536,n=R+a+65535,a=Math.floor(n/65536),R=n-a*65536,n=j+a+65535,a=Math.floor(n/65536),j=n-a*65536,n=I+a+65535,a=Math.floor(n/65536),I=n-a*65536,n=F+a+65535,a=Math.floor(n/65536),F=n-a*65536,n=O+a+65535,a=Math.floor(n/65536),O=n-a*65536,n=T+a+65535,a=Math.floor(n/65536),T=n-a*65536,n=Y+a+65535,a=Math.floor(n/65536),Y=n-a*65536,n=Q+a+65535,a=Math.floor(n/65536),Q=n-a*65536,n=J+a+65535,a=Math.floor(n/65536),J=n-a*65536,n=X+a+65535,a=Math.floor(n/65536),X=n-a*65536,n=U+a+65535,a=Math.floor(n/65536),U=n-a*65536,n=L+a+65535,a=Math.floor(n/65536),L=n-a*65536,m+=a-1+37*(a-1),a=1,n=m+a+65535,a=Math.floor(n/65536),m=n-a*65536,n=C+a+65535,a=Math.floor(n/65536),C=n-a*65536,n=N+a+65535,a=Math.floor(n/65536),N=n-a*65536,n=P+a+65535,a=Math.floor(n/65536),P=n-a*65536,n=R+a+65535,a=Math.floor(n/65536),R=n-a*65536,n=j+a+65535,a=Math.floor(n/65536),j=n-a*65536,n=I+a+65535,a=Math.floor(n/65536),I=n-a*65536,n=F+a+65535,a=Math.floor(n/65536),F=n-a*65536,n=O+a+65535,a=Math.floor(n/65536),O=n-a*65536,n=T+a+65535,a=Math.floor(n/65536),T=n-a*65536,n=Y+a+65535,a=Math.floor(n/65536),Y=n-a*65536,n=Q+a+65535,a=Math.floor(n/65536),Q=n-a*65536,n=J+a+65535,a=Math.floor(n/65536),J=n-a*65536,n=X+a+65535,a=Math.floor(n/65536),X=n-a*65536,n=U+a+65535,a=Math.floor(n/65536),U=n-a*65536,n=L+a+65535,a=Math.floor(n/65536),L=n-a*65536,m+=a-1+37*(a-1),c[0]=m,c[1]=C,c[2]=N,c[3]=P,c[4]=R,c[5]=j,c[6]=I,c[7]=F,c[8]=O,c[9]=T,c[10]=Y,c[11]=Q,c[12]=J,c[13]=X,c[14]=U,c[15]=L}function v(c,h){y(c,h,h)}function g(c,h){const f=i();for(let n=0;n<16;n++)f[n]=h[n];for(let n=253;n>=0;n--)v(f,f),n!==2&&n!==4&&y(f,f,h);for(let n=0;n<16;n++)c[n]=f[n]}function S(c,h){const f=new Uint8Array(32),n=new Float64Array(80),a=i(),m=i(),C=i(),N=i(),P=i(),R=i();for(let O=0;O<31;O++)f[O]=c[O];f[31]=c[31]&127|64,f[0]&=248,_(n,h);for(let O=0;O<16;O++)m[O]=n[O];a[0]=N[0]=1;for(let O=254;O>=0;--O){const T=f[O>>>3]>>>(O&7)&1;u(a,m,T),u(C,N,T),D(P,a,C),w(a,a,C),D(C,m,N),w(m,m,N),v(N,P),v(R,a),y(a,C,a),y(C,m,P),D(P,a,C),w(a,a,C),v(m,a),w(C,N,R),y(a,C,s),D(a,a,N),y(C,C,a),y(a,N,R),y(N,m,n),v(m,P),u(a,m,T),u(C,N,T)}for(let O=0;O<16;O++)n[O+16]=a[O],n[O+32]=C[O],n[O+48]=m[O],n[O+64]=N[O];const j=n.subarray(32),I=n.subarray(16);g(j,j),y(I,I,j);const F=new Uint8Array(32);return l(F,I),F}e.scalarMult=S;function p(c){return S(c,o)}e.scalarMultBase=p;function A(c){if(c.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const h=new Uint8Array(c);return{publicKey:p(h),secretKey:h}}e.generateKeyPairFromSeed=A;function d(c){const h=(0,t.randomBytes)(32,c),f=A(h);return(0,r.wipe)(h),f}e.generateKeyPair=d;function E(c,h,f=!1){if(c.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(h.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const n=S(c,h);if(f){let a=0;for(let m=0;m<n.length;m++)a|=n[m];if(a===0)throw new Error("X25519: invalid shared key")}return n}e.sharedKey=E})(Ft);function Mt(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Fr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Mt(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function mt(e,t){t||(t=e.reduce((o,s)=>o+s.length,0));const r=Fr(t);let i=0;for(const o of e)r.set(o,i),i+=o.length;return Mt(r)}function xn(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var o=0;o<e.length;o++){var s=e.charAt(o),b=s.charCodeAt(0);if(r[b]!==255)throw new TypeError(s+" is ambiguous");r[b]=o}var u=e.length,l=e.charAt(0),_=Math.log(u)/Math.log(256),D=Math.log(256)/Math.log(u);function w(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var S=0,p=0,A=0,d=g.length;A!==d&&g[A]===0;)A++,S++;for(var E=(d-A)*D+1>>>0,c=new Uint8Array(E);A!==d;){for(var h=g[A],f=0,n=E-1;(h!==0||f<p)&&n!==-1;n--,f++)h+=256*c[n]>>>0,c[n]=h%u>>>0,h=h/u>>>0;if(h!==0)throw new Error("Non-zero carry");p=f,A++}for(var a=E-p;a!==E&&c[a]===0;)a++;for(var m=l.repeat(S);a<E;++a)m+=e.charAt(c[a]);return m}function y(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var S=0;if(g[S]!==" "){for(var p=0,A=0;g[S]===l;)p++,S++;for(var d=(g.length-S)*_+1>>>0,E=new Uint8Array(d);g[S];){var c=r[g.charCodeAt(S)];if(c===255)return;for(var h=0,f=d-1;(c!==0||h<A)&&f!==-1;f--,h++)c+=u*E[f]>>>0,E[f]=c%256>>>0,c=c/256>>>0;if(c!==0)throw new Error("Non-zero carry");A=h,S++}if(g[S]!==" "){for(var n=d-A;n!==d&&E[n]===0;)n++;for(var a=new Uint8Array(p+(d-n)),m=p;n!==d;)a[m++]=E[n++];return a}}}function v(g){var S=y(g);if(S)return S;throw new Error(`Non-${t} character`)}return{encode:w,decodeUnsafe:y,decode:v}}var $n=xn,Hn=$n;const Kn=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Wn=e=>new TextEncoder().encode(e),Vn=e=>new TextDecoder().decode(e);class qn{constructor(t,r,i){this.name=t,this.prefix=r,this.baseEncode=i}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class zn{constructor(t,r,i){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Mr(this,t)}}class Gn{constructor(t){this.decoders=t}or(t){return Mr(this,t)}decode(t){const r=t[0],i=this.decoders[r];if(i)return i.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Mr=(e,t)=>new Gn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Yn{constructor(t,r,i,o){this.name=t,this.prefix=r,this.baseEncode=i,this.baseDecode=o,this.encoder=new qn(t,r,i),this.decoder=new zn(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const st=({name:e,prefix:t,encode:r,decode:i})=>new Yn(e,t,r,i),Ge=({prefix:e,name:t,alphabet:r})=>{const{encode:i,decode:o}=Hn(r,t);return st({prefix:e,name:t,encode:i,decode:s=>Kn(o(s))})},kn=(e,t,r,i)=>{const o={};for(let D=0;D<t.length;++D)o[t[D]]=D;let s=e.length;for(;e[s-1]==="=";)--s;const b=new Uint8Array(s*r/8|0);let u=0,l=0,_=0;for(let D=0;D<s;++D){const w=o[e[D]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<r|w,u+=r,u>=8&&(u-=8,b[_++]=255&l>>u)}if(u>=r||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return b},Xn=(e,t,r)=>{const i=t[t.length-1]==="=",o=(1<<r)-1;let s="",b=0,u=0;for(let l=0;l<e.length;++l)for(u=u<<8|e[l],b+=8;b>r;)b-=r,s+=t[o&u>>b];if(b&&(s+=t[o&u<<r-b]),i)for(;s.length*r&7;)s+="=";return s},Z=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>st({prefix:t,name:e,encode(o){return Xn(o,i,r)},decode(o){return kn(o,i,r,e)}}),Jn=st({prefix:"\0",name:"identity",encode:e=>Vn(e),decode:e=>Wn(e)}),Qn=Object.freeze(Object.defineProperty({__proto__:null,identity:Jn},Symbol.toStringTag,{value:"Module"})),Zn=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ei=Object.freeze(Object.defineProperty({__proto__:null,base2:Zn},Symbol.toStringTag,{value:"Module"})),ti=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),ri=Object.freeze(Object.defineProperty({__proto__:null,base8:ti},Symbol.toStringTag,{value:"Module"})),ni=Ge({prefix:"9",name:"base10",alphabet:"0123456789"}),ii=Object.freeze(Object.defineProperty({__proto__:null,base10:ni},Symbol.toStringTag,{value:"Module"})),oi=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ai=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),ui=Object.freeze(Object.defineProperty({__proto__:null,base16:oi,base16upper:ai},Symbol.toStringTag,{value:"Module"})),si=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ci=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),fi=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),hi=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),li=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),di=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Di=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),bi=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_i=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Ei=Object.freeze(Object.defineProperty({__proto__:null,base32:si,base32hex:li,base32hexpad:Di,base32hexpadupper:bi,base32hexupper:di,base32pad:fi,base32padupper:hi,base32upper:ci,base32z:_i},Symbol.toStringTag,{value:"Module"})),wi=Ge({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),vi=Ge({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),yi=Object.freeze(Object.defineProperty({__proto__:null,base36:wi,base36upper:vi},Symbol.toStringTag,{value:"Module"})),gi=Ge({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pi=Ge({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),mi=Object.freeze(Object.defineProperty({__proto__:null,base58btc:gi,base58flickr:pi},Symbol.toStringTag,{value:"Module"})),Si=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Oi=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ci=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ui=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Ai=Object.freeze(Object.defineProperty({__proto__:null,base64:Si,base64pad:Oi,base64url:Ci,base64urlpad:Ui},Symbol.toStringTag,{value:"Module"})),Pr=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ni=Pr.reduce((e,t,r)=>(e[r]=t,e),[]),Ti=Pr.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Ii(e){return e.reduce((t,r)=>(t+=Ni[r],t),"")}function Fi(e){const t=[];for(const r of e){const i=Ti[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(i)}return new Uint8Array(t)}const Mi=st({prefix:"🚀",name:"base256emoji",encode:Ii,decode:Fi}),Pi=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Mi},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Gt={...Qn,...ei,...ri,...ii,...ui,...Ei,...yi,...mi,...Ai,...Pi};function jr(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}const Yt=jr("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),lt=jr("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Fr(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Rr={utf8:Yt,"utf-8":Yt,hex:Gt.base16,latin1:lt,ascii:lt,binary:lt,...Gt};function ye(e,t="utf8"){const r=Rr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Mt(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function ge(e,t="utf8"){const r=Rr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var kt=function(e,t,r){if(r||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},ji=function(){function e(t,r,i){this.name=t,this.version=r,this.os=i,this.type="browser"}return e}(),Ri=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=H.dist.process.platform}return e}(),Li=function(){function e(t,r,i,o){this.name=t,this.version=r,this.os=i,this.bot=o,this.type="bot-device"}return e}(),Bi=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),xi=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),$i=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Hi=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Xt=3,Ki=[["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",$i]],Jt=[["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 Wi(e){return e?Qt(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new xi:typeof navigator<"u"?Qt(navigator.userAgent):zi()}function Vi(e){return e!==""&&Ki.reduce(function(t,r){var i=r[0],o=r[1];if(t)return t;var s=o.exec(e);return!!s&&[i,s]},!1)}function Qt(e){var t=Vi(e);if(!t)return null;var r=t[0],i=t[1];if(r==="searchbot")return new Bi;var o=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);o?o.length<Xt&&(o=kt(kt([],o,!0),Gi(Xt-o.length),!0)):o=[];var s=o.join("."),b=qi(e),u=Hi.exec(e);return u&&u[1]?new Li(r,s,b,u[1]):new ji(r,s,b)}function qi(e){for(var t=0,r=Jt.length;t<r;t++){var i=Jt[t],o=i[0],s=i[1],b=s.exec(e);if(b)return o}return null}function zi(){var e=typeof H.dist.process<"u"&&H.dist.process.version;return e?new Ri(H.dist.process.version.slice(1)):null}function Gi(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var Oe={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|