From 2872c5f8433e617e04342061233e1be93b2e0ee2 Mon Sep 17 00:00:00 2001 From: Wenty Li Date: Wed, 25 Oct 2023 15:34:55 +0800 Subject: [PATCH 1/2] docs: Fix docs typos --- website/src/pages/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/pages/index.mdx b/website/src/pages/index.mdx index c5158113..95e6e027 100644 --- a/website/src/pages/index.mdx +++ b/website/src/pages/index.mdx @@ -165,7 +165,7 @@ import { tokenPocket, trustWallet, walletConnect, -} from '@totejs/walletkit'; +} from '@totejs/walletkit/wallets'; const config = createConfig( getDefaultConfig({ @@ -241,7 +241,7 @@ type ThemeVariant = 'base'; ; ``` -light mode configuration for the base theme. +An exmaple for customTheme ```tsx live=false const customTheme = { From 11d1f15667765b0252f85f4ecfe3431e8a756295 Mon Sep 17 00:00:00 2001 From: Wenty Li Date: Thu, 26 Oct 2023 10:26:44 +0800 Subject: [PATCH 2/2] docs: Update readme --- README.md | 27 ++++++++++++++++++- .../{ccip-a4f5f9d3.js => ccip-8d672838.js} | 2 +- .../{index-91c61dda.js => index-38c5da10.js} | 2 +- .../{index-1fcc0f57.js => index-73f7d853.js} | 2 +- .../{index-a2ce8660.js => index-afc47151.js} | 2 +- .../{index-5090a415.js => index-d8f85335.js} | 14 +++++----- ...ex.es-e7c93c26.js => index.es-fd9b4c72.js} | 4 +-- website/dist/index.html | 2 +- website/src/pages/index.mdx | 4 +-- 9 files changed, 42 insertions(+), 17 deletions(-) rename website/dist/assets/{ccip-a4f5f9d3.js => ccip-8d672838.js} (97%) rename website/dist/assets/{index-91c61dda.js => index-38c5da10.js} (99%) rename website/dist/assets/{index-1fcc0f57.js => index-73f7d853.js} (98%) rename website/dist/assets/{index-a2ce8660.js => index-afc47151.js} (99%) rename website/dist/assets/{index-5090a415.js => index-d8f85335.js} (99%) rename website/dist/assets/{index.es-e7c93c26.js => index.es-fd9b4c72.js} (99%) diff --git a/README.md b/README.md index 585b92d1..afd287c6 100644 --- a/README.md +++ b/README.md @@ -1 +1,26 @@ -# walletkit \ No newline at end of file +# WalletKit + +WalletKit is a React component library for easily connecting a wallet to your dApp. + +## Main Features + +- 💡 Typescript — Get types straight out of the box. +- 🌱 Ecosystem Standards — Built on top of [wagmi](https://wagmi.sh) and [viem](https://viem.sh) +- 🎨 Customization — Easily customizing wallets and themes + +## Documentation + +For full documentation, visit [here](https://node-real.github.io/walletkit/website/dist/#/index). + +## Examples + +The following examples are provided in the [examples](./examples/) folder of this repo. + +- [vite](https://github.com/node-real/walletkit/tree/main/examples/vite) + +## Installation + +```bash +npm i @totejs/walletkit wagmi viem + +``` diff --git a/website/dist/assets/ccip-a4f5f9d3.js b/website/dist/assets/ccip-8d672838.js similarity index 97% rename from website/dist/assets/ccip-a4f5f9d3.js rename to website/dist/assets/ccip-8d672838.js index 5e0b9135..8bd96920 100644 --- a/website/dist/assets/ccip-a4f5f9d3.js +++ b/website/dist/assets/ccip-8d672838.js @@ -1 +1 @@ -import{aA as f,aB as w,aC as y,aD as p,aE as h,aF as g,aG as k,aH as O,aI as E,aJ as m,aK as L}from"./index-5090a415.js";class x extends f{constructor({callbackSelector:e,cause:t,data:n,extraData:c,sender:d,urls:a}){var i;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(i=t.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(u=>` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends f{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends f{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(s,e){if(!p(s))throw new h({address:s});if(!p(e))throw new h({address:e});return s.toLowerCase()===e.toLowerCase()}const v="0x556f1830",A={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function D(s,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:d}=g({data:n,abi:[A]}),[a,i,u,r,o]=d;try{if(!$(c,a))throw new R({sender:a,to:c});const l=await S({data:u,sender:a,urls:i}),{data:b}=await k(s,{blockNumber:e,blockTag:t,data:O([r,E([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return b}catch(l){throw new x({callbackSelector:r,cause:l,data:n,extraData:o,sender:a,urls:i})}}async function S({data:s,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends f{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends f{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(s,e){if(!p(s))throw new h({address:s});if(!p(e))throw new h({address:e});return s.toLowerCase()===e.toLowerCase()}const v="0x556f1830",A={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function D(s,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:d}=g({data:n,abi:[A]}),[a,i,u,r,o]=d;try{if(!$(c,a))throw new R({sender:a,to:c});const l=await S({data:u,sender:a,urls:i}),{data:b}=await k(s,{blockNumber:e,blockTag:t,data:O([r,E([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return b}catch(l){throw new x({callbackSelector:r,cause:l,data:n,extraData:o,sender:a,urls:i})}}async function S({data:s,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let d=0;de&&(F.has(e)?F.get(e):Z(e)===Object.prototype||Z(e)===Array.prototype),ge=e=>me(e)&&e[fe]||null,ee=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,he=(e=Object.is,t=(o,h)=>new Proxy(o,h),s=o=>J(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,h,I=r)=>{const b=l.get(o);if((b==null?void 0:b[0])===h)return b[1];const y=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return ee(y,!0),l.set(o,[h,y]),Reflect.ownKeys(o).forEach(P=>{if(Object.getOwnPropertyDescriptor(y,P))return;const L=Reflect.get(o,P),D={value:L,enumerable:!0,configurable:!0};if(x.has(L))ee(L,!1);else if(L instanceof Promise)delete D.value,D.get=()=>I(L);else if(C.has(L)){const[v,z]=C.get(L);D.value=c(v,z(),I)}Object.defineProperty(y,P,D)}),Object.preventExtensions(y)},m=new WeakMap,f=[1,1],W=o=>{if(!J(o))throw new Error("object required");const h=m.get(o);if(h)return h;let I=f[0];const b=new Set,y=(i,a=++f[0])=>{I!==a&&(I=a,b.forEach(n=>n(i,a)))};let P=f[1];const L=(i=++f[1])=>(P!==i&&!b.size&&(P=i,v.forEach(([a])=>{const n=a[1](i);n>I&&(I=n)})),I),D=i=>(a,n)=>{const g=[...a];g[1]=[i,...g[1]],y(g,n)},v=new Map,z=(i,a)=>{if(b.size){const n=a[3](D(i));v.set(i,[a,n])}else v.set(i,[a])},Y=i=>{var a;const n=v.get(i);n&&(v.delete(i),(a=n[1])==null||a.call(n))},de=i=>(b.add(i),b.size===1&&v.forEach(([n,g],R)=>{const N=n[3](D(R));v.set(R,[n,N])}),()=>{b.delete(i),b.size===0&&v.forEach(([n,g],R)=>{g&&(g(),v.set(R,[n]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),V=t(H,{deleteProperty(i,a){const n=Reflect.get(i,a);Y(a);const g=Reflect.deleteProperty(i,a);return g&&y(["delete",[a],n]),g},set(i,a,n,g){const R=Reflect.has(i,a),N=Reflect.get(i,a,g);if(R&&(e(N,n)||m.has(n)&&e(N,m.get(n))))return!0;Y(a),J(n)&&(n=ge(n)||n);let $=n;if(n instanceof Promise)n.then(A=>{n.status="fulfilled",n.value=A,y(["resolve",[a],A])}).catch(A=>{n.status="rejected",n.reason=A,y(["reject",[a],A])});else{!C.has(n)&&s(n)&&($=W(n));const A=!x.has($)&&C.get($);A&&z(a,A)}return Reflect.set(i,a,$,g),y(["set",[a],n,N]),!0}});m.set(o,V);const ue=[H,L,c,de];return C.set(V,ue),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(V[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(H,i,a)}),V})=>[W,C,x,e,t,s,r,l,c,m,f],[be]=he();function S(e={}){return be(e)}function U(e,t,s){const r=C.get(e);let l;const c=[],m=r[3];let f=!1;const o=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function ye(e,t){const s=C.get(e),[r,l,c]=s;return c(r,l(),t)}const d=S({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ce={state:d,subscribe(e){return U(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ce.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},ve=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=S({enabled:ve,userSessionId:"",events:[],connectedWalletId:void 0}),we={state:u,subscribe(e){return U(u.events,()=>e(ye(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},E=S({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:E,subscribe(e){return U(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},B=S({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),k={state:B,subscribe(e){return U(B,()=>e(B))},setConfig(e){var t,s;we.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,te=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,se=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&se(e,s,t[s]);if(te)for(var s of te(t))Oe.call(t,s)&&se(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.6.2";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),r=new URL(e,G);return r.searchParams.append("projectId",k.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const j={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${k.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${k.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var We=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&ne(e,s,t[s]);if(oe)for(var s of oe(t))Ce.call(t,s)&&ne(e,s,t[s]);return e};const re=p.isMobile(),O=S({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=k.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await j.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=w.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=re?await j.getMobileListings(m):await j.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=k.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=re?await j.getMobileListings(t):await j.getDesktopListings(t),o=Object.values(f),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return j.getWalletImageUrl(e)},getAssetImageUrl(e){return j.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},_=S({open:!1}),q={state:_,subscribe(e){return U(_,()=>e(_))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=w.state;if(p.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),ce.reset("ConnectWallet"),s&&r)_.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),_.open=!0,t())},200)}})},close(){_.open=!1}};var De=Object.defineProperty,ae=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,ie=(e,t,s)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))je.call(t,s)&&ie(e,s,t[s]);if(ae)for(var s of ae(t))Me.call(t,s)&&ie(e,s,t[s]);return e};function Pe(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=S({themeMode:Pe()?"dark":"light"}),le={state:T,subscribe(e){return U(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=Ue({},s))}},M=S({open:!1,message:"",variant:"success"}),Te={state:M,subscribe(e){return U(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class Re{constructor(t){this.openModal=q.open,this.closeModal=q.close,this.subscribeModal=q.subscribe,this.setTheme=le.setThemeConfig,le.setThemeConfig(t),k.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-91c61dda.js"),["./index-91c61dda.js","./index-5090a415.js","./index-ec4d6aa8.css"],import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Re},Symbol.toStringTag,{value:"Module"}));export{we as R,ce as T,p as a,Ve as i,le as n,Te as o,w as p,q as s,Ne as t,k as y}; +import{az as pe}from"./index-d8f85335.js";const fe=Symbol(),Z=Object.getPrototypeOf,F=new WeakMap,me=e=>e&&(F.has(e)?F.get(e):Z(e)===Object.prototype||Z(e)===Array.prototype),ge=e=>me(e)&&e[fe]||null,ee=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,he=(e=Object.is,t=(o,h)=>new Proxy(o,h),s=o=>J(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,h,I=r)=>{const b=l.get(o);if((b==null?void 0:b[0])===h)return b[1];const y=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return ee(y,!0),l.set(o,[h,y]),Reflect.ownKeys(o).forEach(P=>{if(Object.getOwnPropertyDescriptor(y,P))return;const L=Reflect.get(o,P),D={value:L,enumerable:!0,configurable:!0};if(x.has(L))ee(L,!1);else if(L instanceof Promise)delete D.value,D.get=()=>I(L);else if(C.has(L)){const[v,z]=C.get(L);D.value=c(v,z(),I)}Object.defineProperty(y,P,D)}),Object.preventExtensions(y)},m=new WeakMap,f=[1,1],W=o=>{if(!J(o))throw new Error("object required");const h=m.get(o);if(h)return h;let I=f[0];const b=new Set,y=(i,a=++f[0])=>{I!==a&&(I=a,b.forEach(n=>n(i,a)))};let P=f[1];const L=(i=++f[1])=>(P!==i&&!b.size&&(P=i,v.forEach(([a])=>{const n=a[1](i);n>I&&(I=n)})),I),D=i=>(a,n)=>{const g=[...a];g[1]=[i,...g[1]],y(g,n)},v=new Map,z=(i,a)=>{if(b.size){const n=a[3](D(i));v.set(i,[a,n])}else v.set(i,[a])},Y=i=>{var a;const n=v.get(i);n&&(v.delete(i),(a=n[1])==null||a.call(n))},de=i=>(b.add(i),b.size===1&&v.forEach(([n,g],R)=>{const N=n[3](D(R));v.set(R,[n,N])}),()=>{b.delete(i),b.size===0&&v.forEach(([n,g],R)=>{g&&(g(),v.set(R,[n]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),V=t(H,{deleteProperty(i,a){const n=Reflect.get(i,a);Y(a);const g=Reflect.deleteProperty(i,a);return g&&y(["delete",[a],n]),g},set(i,a,n,g){const R=Reflect.has(i,a),N=Reflect.get(i,a,g);if(R&&(e(N,n)||m.has(n)&&e(N,m.get(n))))return!0;Y(a),J(n)&&(n=ge(n)||n);let $=n;if(n instanceof Promise)n.then(A=>{n.status="fulfilled",n.value=A,y(["resolve",[a],A])}).catch(A=>{n.status="rejected",n.reason=A,y(["reject",[a],A])});else{!C.has(n)&&s(n)&&($=W(n));const A=!x.has($)&&C.get($);A&&z(a,A)}return Reflect.set(i,a,$,g),y(["set",[a],n,N]),!0}});m.set(o,V);const ue=[H,L,c,de];return C.set(V,ue),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(V[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(H,i,a)}),V})=>[W,C,x,e,t,s,r,l,c,m,f],[be]=he();function S(e={}){return be(e)}function U(e,t,s){const r=C.get(e);let l;const c=[],m=r[3];let f=!1;const o=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function ye(e,t){const s=C.get(e),[r,l,c]=s;return c(r,l(),t)}const d=S({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ce={state:d,subscribe(e){return U(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ce.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},ve=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=S({enabled:ve,userSessionId:"",events:[],connectedWalletId:void 0}),we={state:u,subscribe(e){return U(u.events,()=>e(ye(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},E=S({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:E,subscribe(e){return U(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},B=S({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),k={state:B,subscribe(e){return U(B,()=>e(B))},setConfig(e){var t,s;we.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,te=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,se=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&se(e,s,t[s]);if(te)for(var s of te(t))Oe.call(t,s)&&se(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.6.2";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),r=new URL(e,G);return r.searchParams.append("projectId",k.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const j={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${k.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${k.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var We=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&ne(e,s,t[s]);if(oe)for(var s of oe(t))Ce.call(t,s)&&ne(e,s,t[s]);return e};const re=p.isMobile(),O=S({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=k.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await j.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=w.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=re?await j.getMobileListings(m):await j.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=k.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=re?await j.getMobileListings(t):await j.getDesktopListings(t),o=Object.values(f),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return j.getWalletImageUrl(e)},getAssetImageUrl(e){return j.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},_=S({open:!1}),q={state:_,subscribe(e){return U(_,()=>e(_))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=w.state;if(p.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),ce.reset("ConnectWallet"),s&&r)_.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),_.open=!0,t())},200)}})},close(){_.open=!1}};var De=Object.defineProperty,ae=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,ie=(e,t,s)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))je.call(t,s)&&ie(e,s,t[s]);if(ae)for(var s of ae(t))Me.call(t,s)&&ie(e,s,t[s]);return e};function Pe(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=S({themeMode:Pe()?"dark":"light"}),le={state:T,subscribe(e){return U(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=Ue({},s))}},M=S({open:!1,message:"",variant:"success"}),Te={state:M,subscribe(e){return U(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class Re{constructor(t){this.openModal=q.open,this.closeModal=q.close,this.subscribeModal=q.subscribe,this.setTheme=le.setThemeConfig,le.setThemeConfig(t),k.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-38c5da10.js"),["./index-38c5da10.js","./index-d8f85335.js","./index-ec4d6aa8.css"],import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Re},Symbol.toStringTag,{value:"Module"}));export{we as R,ce as T,p as a,Ve as i,le as n,Te as o,w as p,q as s,Ne as t,k as y}; diff --git a/website/dist/assets/index-a2ce8660.js b/website/dist/assets/index-afc47151.js similarity index 99% rename from website/dist/assets/index-a2ce8660.js rename to website/dist/assets/index-afc47151.js index 074e23b5..37ec926d 100644 --- a/website/dist/assets/index-a2ce8660.js +++ b/website/dist/assets/index-afc47151.js @@ -1 +1 @@ -import{g as se,a as fe,b as Be,c as Qe,d as Ee,l as ae,n as he}from"./index-5090a415.js";function IA(A){let e=0;function t(){return A[e++]<<8|A[e++]}let l=t(),C=1,o=[0,1];for(let Q=1;Q>--r&1}const I=31,f=2**I,i=f>>>1,d=i>>1,E=f-1;let w=0;for(let Q=0;Q1;){let H=u+T>>>1;Q>>1|s(),a=a<<1^i,M=(M^i)<<1|i|1;O=a,k=1+M-a}let V=l-4;return j.map(Q=>{switch(Q-V){case 3:return V+65792+(A[g++]<<16|A[g++]<<8|A[g++]);case 2:return V+256+(A[g++]<<8|A[g++]);case 1:return V+A[g++];default:return Q-1}})}function DA(A){let e=0;return()=>A[e++]}function eA(A){return DA(IA(pA(A)))}function pA(A){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((C,o)=>e[C.charCodeAt(0)]=o);let t=A.length,l=new Uint8Array(6*t>>3);for(let C=0,o=0,n=0,g=0;C=8&&(l[o++]=g>>(n-=8));return l}function UA(A){return A&1?~A>>1:A>>1}function dA(A,e){let t=Array(A);for(let l=0,C=0;l{let e=h(A);if(e.length)return e})}function CA(A){let e=[];for(;;){let t=A();if(t==0)break;e.push(NA(t,A))}for(;;){let t=A()-1;if(t<0)break;e.push(RA(t,A))}return e.flat()}function L(A){let e=[];for(;;){let t=A(e.length);if(!t)break;e.push(t)}return e}function oA(A,e,t){let l=Array(A).fill().map(()=>[]);for(let C=0;Cl[n].push(o));return l}function NA(A,e){let t=1+e(),l=e(),C=L(e);return oA(C.length,1+A,e).flatMap((n,g)=>{let[r,...c]=n;return Array(C[g]).fill().map((s,I)=>{let f=I*l;return[r+I*t,c.map(i=>i+f)]})})}function RA(A,e){let t=1+e();return oA(t,1+A,e).map(C=>[C[0],C.slice(1)])}function LA(A){let e=[],t=h(A);return C(l([]),[]),e;function l(o){let n=A(),g=L(()=>{let r=h(A).map(c=>t[c]);if(r.length)return l(r)});return{S:n,B:g,Q:o}}function C({S:o,B:n},g,r){if(!(o&4&&r===g[g.length-1])){o&2&&(r=g[g.length-1]),o&1&&e.push(g);for(let c of n)for(let s of c.Q)C(c,[...g,s],r)}}}var B=eA("AEITLAk1DSsBxwKEAQMBOQDpATAAngDUAHsAoABoAM4AagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXBOcF2QEXE943ygXaALgArkYBbgCsCAPMAK6GNjY2NgE/rgwQ8gAEB0YG6zgFXgVfAD0yOQf2vRgFDc/IABUDz546AswKNgKOqAKG3z+Vb5ACxdICg/kBJuYQAPK0AUgCNJQKRpYA6gDpChwAHtvAzxMSRKQEIn4BBAJAGMQP8hAGMPAMBIhuDSIHNACyAHCY76ychgBiBpoCKgbwACIAQgyaFwKqAspCINYIwjADuBRCAPc0cqoAqIQfAB4ELALeHQEkAMAZ1AUBECBTPgmeCY8lIlZgTOqDSQAaABMAHAAVclsAKAAVAE71HN89+gI5X8qc5jUKFyRfVAJfPfMAGgATABwAFXIgY0CeAMPyACIAQAzMFsKqAgHavwViBekC0KYCxLcCClMjpGwUehp0TPwAwhRuAugAEjQ0kBfQmAKBggETIgDEFG4C6AASNAFPUCyYTBEDLgIFLxDecB60Ad5KAHgyEn4COBYoAy4uwD5yAEDoAfwsAM4O0rwBImqIALgMAAwCAIraUAUi3HIeAKgu2AGoBgYGBgYrNAOiAG4BCiA+9Dd7BB8eALEBzgIoAgDmMhJ6OvpQtzOoLjVPBQAGAS4FYAVftr8FcDtkQhlBWEiee5pmZqH/EhoDzA4s+H4qBKpSAlpaAnwisi4BlqqsPGIDTB4EimgQANgCBrJGNioCBzACQGQAcgFoJngAiiQgAJwBUL4ALnAeAbbMAz40KEoEWgF2YAZsAmwA+FAeAzAIDABQSACyAABkAHoAMrwGDvr2IJSGBgAQKAAwALoiTgHYAeIOEjiXf4HvABEAGAA7AEQAPzp3gNrHEGYQYwgFT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z6JOsV0e1Xfw7VGavtHACLwn0tTG9e3lf++w1MCVjFIyU57uOlbTkUSnxAjzmA71qvjTzHeMDWcK099tm9rS8cnfuwxq+YRWANkfmLbCl+74mg4bccPsNY5zz7cjbaFAL0hAwId61yM5uqhMBr4Wcew3b2spG5tkKFOnADeXkGkH4vk+f+an92mWXemOFCpjRsFeEnPEAIsLemM3QfMoME5/w+7Y48y/SvkBN6/KSRVmB7/rHiW7iVkXF6Y1T853OaDg66cIfWkD5TqCDugrlaXlEL1fFjxPoKRHkP5GD/xDiscNH+Dp2fXEKUpwAvC8JTNC+k9JpaMXUB7oj4p77qiAOjXD2pT4v/v0Ukid02LpuYsS7/ScDL1SxB9hxxbkeGOMyPyL4HZPAbyagOgP5Xe2pCqMPyj/KJ0blDHzFVBqzeLIO5D4yq7IpSi9p/QlHa50sCHzGoMqrBS8l9IfRyhq8IDQtOZzjgdvgQDwH7cqa/sybwdfcQse9THS08maKkkgnOi0ShO8Gyf+WL4K9DX11CF9uIbVwJUaCv8r/6FDVOdsEjeumisIJlLJQsjjkEL2QfEc68oqsevnNAEdp4YMJivwBJnE0R2GiBFRTJZNkq/MHDP9O5unQoRoivMJkPm+A0K8CQNXL6V3apC4ROBTyJSW9oOGNF4YrwoTFyz/pexIkeWQADpi+M7q8gBlmGRUune0k7cXyacdbOsD0Q1JQat9T8nmHhyO8PNd2k4qjZsQCs6lEcmaThpVUzGzWOJQGGf2oz7+F/bMfUMARo1PD0/yIhVDK+8MGRo/uByG5UAwPfNeHAd09gkMFpZmTN2rZgoqdSjwv1SbFnFRAqYuzwW8P4+Rk9fE3PVu80HKcXyIEvPfit+o+pnlHDUKKo32HapcVtQhsNiIdH80j/lRnJ2y5RYRbECyY4vl20j/NiBAD0Z5jxWWiL6xAZIonSEJb1qhwmdRp3hISLL9Q1QYOt6C/OixU3eUtXblgBu+fGPAQE0o");const Z=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),W=4;function mA(A){return A.toString(16).toUpperCase().padStart(2,"0")}function lA(A){return`{${mA(A)}}`}function SA(A){let e=[];for(let t=0,l=A.length;t>24&255}function nA(A){return A&16777215}const FA=new Map(tA(X).flatMap((A,e)=>A.map(t=>[t,e+1<<24]))),OA=new Set(h(X)),gA=new Map,x=new Map;for(let[A,e]of CA(X)){if(!OA.has(A)&&e.length==2){let[t,l]=e,C=x.get(t);C||(C=new Map,x.set(t,C)),C.set(l,A)}gA.set(A,e.reverse())}const m=44032,b=4352,J=4449,G=4519,rA=19,cA=21,p=28,Y=cA*p,kA=rA*Y,VA=m+kA,bA=b+rA,JA=J+cA,GA=G+p;function iA(A){return A>=m&&A=b&&A=J&&eG&&e0&&C(G+c)}else{let n=gA.get(o);n?t.push(...n):C(o)}if(!t.length)break;o=t.pop()}if(l&&e.length>1){let o=N(e[0]);for(let n=1;n0&&C>=n)n==0?(e.push(l,...t),t.length=0,l=g):t.push(g),C=n;else{let r=YA(l,g);r>=0?l=r:C==0&&n==0?(e.push(l),l=g):(t.push(g),C=n)}}return l>=0&&e.push(l,...t),e}function sA(A){return wA(A).map(nA)}function zA(A){return KA(wA(A))}const fA=65039,BA=".",QA=1,v=45;function U(){return new Set(h(B))}const TA=new Map(CA(B)),HA=U(),K=U(),_=new Set(h(B).map(function(A){return this[A]},[...K])),xA=U();U();const XA=tA(B);function $(){return new Set([h(B).map(A=>XA[A]),h(B)].flat(2))}const qA=B(),S=L(A=>{let e=L(B).map(t=>t+96);if(e.length){let t=A>=qA;e[0]-=32,e=D(e),t&&(e=`Restricted[${e}]`);let l=$(),C=$(),o=[...l,...C].sort((g,r)=>g-r),n=!B();return{N:e,P:l,M:n,R:t,V:new Set(o)}}}),AA=U(),P=new Map;[...AA,...U()].sort((A,e)=>A-e).map((A,e,t)=>{let l=B(),C=t[e]=l?t[e-l]:{V:[],M:new Map};C.V.push(A),AA.has(A)||P.set(A,C)});for(let{V:A,M:e}of new Set(P.values())){let t=[];for(let C of A){let o=S.filter(g=>g.V.has(C)),n=t.find(({G:g})=>o.some(r=>g.has(r)));n||(n={G:new Set,V:[]},t.push(n)),n.V.push(C),o.forEach(g=>n.G.add(g))}let l=t.flatMap(({G:C})=>[...C]);for(let{G:C,V:o}of t){let n=new Set(l.filter(g=>!C.has(g)));for(let g of o)e.set(g,n)}}let F=new Set,EA=new Set;for(let A of S)for(let e of A.V)(F.has(e)?EA:F).add(e);for(let A of F)!P.has(A)&&!EA.has(A)&&P.set(A,QA);const yA=new Set([...F,...sA(F)]);class jA extends Array{get is_emoji(){return!0}}const ZA=LA(B).map(A=>jA.from(A)).sort(PA),aA=new Map;for(let A of ZA){let e=[aA];for(let t of A){let l=e.map(C=>{let o=C.get(t);return o||(o=new Map,C.set(t,o)),o});t===fA?e.push(...l):e=l}for(let t of e)t.V=A}function z(A,e=lA){let t=[];$A(A[0])&&t.push("◌");let l=0,C=A.length;for(let o=0;o=4&&A[2]==v&&A[3]==v)throw new Error(`invalid label extension: "${D(A.slice(0,4))}"`)}function vA(A){for(let t=A.lastIndexOf(95);t>0;)if(A[--t]!==95)throw new Error("underscore allowed only at start")}function _A(A){let e=A[0],t=Z.get(e);if(t)throw R(`leading ${t}`);let l=A.length,C=-1;for(let o=1;o{let o=SA(C),n={input:o,offset:l};l+=o.length+1;let g;try{let r=n.tokens=ne(o,e,t),c=r.length,s;if(c)if(g=r.flat(),vA(g),!(n.emoji=c>1||r[0].is_emoji)&&g.every(f=>f<128))WA(g),s="ASCII";else{let f=r.flatMap(i=>i.is_emoji?[]:i);if(!f.length)s="Emoji";else{if(K.has(g[0]))throw R("leading combining mark");for(let E=1;En.has(g)):[...n],!t.length)return}else l.push(C)}if(t){for(let C of t)if(l.every(o=>C.V.has(o)))throw new Error(`whole-script confusable: ${A.N}/${C.N}`)}}function Ce(A){let e=S;for(let t of A){let l=e.filter(C=>C.V.has(t));if(!l.length)throw S.some(C=>C.V.has(t))?MA(e[0],t):uA(t);if(e=l,l.length==1)break}return e}function oe(A){return A.map(({input:e,error:t,output:l})=>{if(t){let C=t.message;throw new Error(A.length==1?C:`Invalid label ${y(z(e))}: ${C}`)}return D(l)}).join(BA)}function uA(A){return new Error(`disallowed character: ${q(A)}`)}function MA(A,e){let t=q(e),l=S.find(C=>C.P.has(e));return l&&(t=`${l.N} ${t}`),new Error(`illegal mixture: ${A.N} + ${t}`)}function R(A){return new Error(`illegal placement: ${A}`)}function le(A,e){let{V:t,M:l}=A;for(let C of e)if(!t.has(C))throw MA(A,C);if(l){let C=sA(e);for(let o=1,n=C.length;oW)throw new Error(`excessive non-spacing marks: ${y(z(C.slice(o-1,g)))} (${g-o}/${W})`);o=g}}}function ne(A,e,t){let l=[],C=[];for(A=A.slice().reverse();A.length;){let o=re(A);if(o)C.length&&(l.push(e(C)),C=[]),l.push(t(o));else{let n=A.pop();if(yA.has(n))C.push(n);else{let g=TA.get(n);if(g)C.push(...g);else if(!HA.has(n))throw uA(n)}}}return C.length&&l.push(e(C)),l}function ge(A){return A.filter(e=>e!=fA)}function re(A,e){let t=aA,l,C=A.length;for(;C&&(t=t.get(A[--C]),!!t);){let{V:o}=t;o&&(l=o,e&&e.push(...A.slice(C).reverse()),A.length=C)}return l}function ce(A){return Ae(A)}export{se as getEnsAddress,fe as getEnsAvatar,Be as getEnsName,Qe as getEnsResolver,Ee as getEnsText,ae as labelhash,he as namehash,ce as normalize}; +import{g as se,a as fe,b as Be,c as Qe,d as Ee,l as ae,n as he}from"./index-d8f85335.js";function IA(A){let e=0;function t(){return A[e++]<<8|A[e++]}let l=t(),C=1,o=[0,1];for(let Q=1;Q>--r&1}const I=31,f=2**I,i=f>>>1,d=i>>1,E=f-1;let w=0;for(let Q=0;Q1;){let H=u+T>>>1;Q>>1|s(),a=a<<1^i,M=(M^i)<<1|i|1;O=a,k=1+M-a}let V=l-4;return j.map(Q=>{switch(Q-V){case 3:return V+65792+(A[g++]<<16|A[g++]<<8|A[g++]);case 2:return V+256+(A[g++]<<8|A[g++]);case 1:return V+A[g++];default:return Q-1}})}function DA(A){let e=0;return()=>A[e++]}function eA(A){return DA(IA(pA(A)))}function pA(A){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((C,o)=>e[C.charCodeAt(0)]=o);let t=A.length,l=new Uint8Array(6*t>>3);for(let C=0,o=0,n=0,g=0;C=8&&(l[o++]=g>>(n-=8));return l}function UA(A){return A&1?~A>>1:A>>1}function dA(A,e){let t=Array(A);for(let l=0,C=0;l{let e=h(A);if(e.length)return e})}function CA(A){let e=[];for(;;){let t=A();if(t==0)break;e.push(NA(t,A))}for(;;){let t=A()-1;if(t<0)break;e.push(RA(t,A))}return e.flat()}function L(A){let e=[];for(;;){let t=A(e.length);if(!t)break;e.push(t)}return e}function oA(A,e,t){let l=Array(A).fill().map(()=>[]);for(let C=0;Cl[n].push(o));return l}function NA(A,e){let t=1+e(),l=e(),C=L(e);return oA(C.length,1+A,e).flatMap((n,g)=>{let[r,...c]=n;return Array(C[g]).fill().map((s,I)=>{let f=I*l;return[r+I*t,c.map(i=>i+f)]})})}function RA(A,e){let t=1+e();return oA(t,1+A,e).map(C=>[C[0],C.slice(1)])}function LA(A){let e=[],t=h(A);return C(l([]),[]),e;function l(o){let n=A(),g=L(()=>{let r=h(A).map(c=>t[c]);if(r.length)return l(r)});return{S:n,B:g,Q:o}}function C({S:o,B:n},g,r){if(!(o&4&&r===g[g.length-1])){o&2&&(r=g[g.length-1]),o&1&&e.push(g);for(let c of n)for(let s of c.Q)C(c,[...g,s],r)}}}var B=eA("AEITLAk1DSsBxwKEAQMBOQDpATAAngDUAHsAoABoAM4AagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXBOcF2QEXE943ygXaALgArkYBbgCsCAPMAK6GNjY2NgE/rgwQ8gAEB0YG6zgFXgVfAD0yOQf2vRgFDc/IABUDz546AswKNgKOqAKG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4v/v0Ukid02LpuYsS7/ScDL1SxB9hxxbkeGOMyPyL4HZPAbyagOgP5Xe2pCqMPyj/KJ0blDHzFVBqzeLIO5D4yq7IpSi9p/QlHa50sCHzGoMqrBS8l9IfRyhq8IDQtOZzjgdvgQDwH7cqa/sybwdfcQse9THS08maKkkgnOi0ShO8Gyf+WL4K9DX11CF9uIbVwJUaCv8r/6FDVOdsEjeumisIJlLJQsjjkEL2QfEc68oqsevnNAEdp4YMJivwBJnE0R2GiBFRTJZNkq/MHDP9O5unQoRoivMJkPm+A0K8CQNXL6V3apC4ROBTyJSW9oOGNF4YrwoTFyz/pexIkeWQADpi+M7q8gBlmGRUune0k7cXyacdbOsD0Q1JQat9T8nmHhyO8PNd2k4qjZsQCs6lEcmaThpVUzGzWOJQGGf2oz7+F/bMfUMARo1PD0/yIhVDK+8MGRo/uByG5UAwPfNeHAd09gkMFpZmTN2rZgoqdSjwv1SbFnFRAqYuzwW8P4+Rk9fE3PVu80HKcXyIEvPfit+o+pnlHDUKKo32HapcVtQhsNiIdH80j/lRnJ2y5RYRbECyY4vl20j/NiBAD0Z5jxWWiL6xAZIonSEJb1qhwmdRp3hISLL9Q1QYOt6C/OixU3eUtXblgBu+fGPAQE0o");const Z=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),W=4;function mA(A){return A.toString(16).toUpperCase().padStart(2,"0")}function lA(A){return`{${mA(A)}}`}function SA(A){let e=[];for(let t=0,l=A.length;t>24&255}function nA(A){return A&16777215}const FA=new Map(tA(X).flatMap((A,e)=>A.map(t=>[t,e+1<<24]))),OA=new Set(h(X)),gA=new Map,x=new Map;for(let[A,e]of CA(X)){if(!OA.has(A)&&e.length==2){let[t,l]=e,C=x.get(t);C||(C=new Map,x.set(t,C)),C.set(l,A)}gA.set(A,e.reverse())}const m=44032,b=4352,J=4449,G=4519,rA=19,cA=21,p=28,Y=cA*p,kA=rA*Y,VA=m+kA,bA=b+rA,JA=J+cA,GA=G+p;function iA(A){return A>=m&&A=b&&A=J&&eG&&e0&&C(G+c)}else{let n=gA.get(o);n?t.push(...n):C(o)}if(!t.length)break;o=t.pop()}if(l&&e.length>1){let o=N(e[0]);for(let n=1;n0&&C>=n)n==0?(e.push(l,...t),t.length=0,l=g):t.push(g),C=n;else{let r=YA(l,g);r>=0?l=r:C==0&&n==0?(e.push(l),l=g):(t.push(g),C=n)}}return l>=0&&e.push(l,...t),e}function sA(A){return wA(A).map(nA)}function zA(A){return KA(wA(A))}const fA=65039,BA=".",QA=1,v=45;function U(){return new Set(h(B))}const TA=new Map(CA(B)),HA=U(),K=U(),_=new Set(h(B).map(function(A){return this[A]},[...K])),xA=U();U();const XA=tA(B);function $(){return new Set([h(B).map(A=>XA[A]),h(B)].flat(2))}const qA=B(),S=L(A=>{let e=L(B).map(t=>t+96);if(e.length){let t=A>=qA;e[0]-=32,e=D(e),t&&(e=`Restricted[${e}]`);let l=$(),C=$(),o=[...l,...C].sort((g,r)=>g-r),n=!B();return{N:e,P:l,M:n,R:t,V:new Set(o)}}}),AA=U(),P=new Map;[...AA,...U()].sort((A,e)=>A-e).map((A,e,t)=>{let l=B(),C=t[e]=l?t[e-l]:{V:[],M:new Map};C.V.push(A),AA.has(A)||P.set(A,C)});for(let{V:A,M:e}of new Set(P.values())){let t=[];for(let C of A){let o=S.filter(g=>g.V.has(C)),n=t.find(({G:g})=>o.some(r=>g.has(r)));n||(n={G:new Set,V:[]},t.push(n)),n.V.push(C),o.forEach(g=>n.G.add(g))}let l=t.flatMap(({G:C})=>[...C]);for(let{G:C,V:o}of t){let n=new Set(l.filter(g=>!C.has(g)));for(let g of o)e.set(g,n)}}let F=new Set,EA=new Set;for(let A of S)for(let e of A.V)(F.has(e)?EA:F).add(e);for(let A of F)!P.has(A)&&!EA.has(A)&&P.set(A,QA);const yA=new Set([...F,...sA(F)]);class jA extends Array{get is_emoji(){return!0}}const ZA=LA(B).map(A=>jA.from(A)).sort(PA),aA=new Map;for(let A of ZA){let e=[aA];for(let t of A){let l=e.map(C=>{let o=C.get(t);return o||(o=new Map,C.set(t,o)),o});t===fA?e.push(...l):e=l}for(let t of e)t.V=A}function z(A,e=lA){let t=[];$A(A[0])&&t.push("◌");let l=0,C=A.length;for(let o=0;o=4&&A[2]==v&&A[3]==v)throw new Error(`invalid label extension: "${D(A.slice(0,4))}"`)}function vA(A){for(let t=A.lastIndexOf(95);t>0;)if(A[--t]!==95)throw new Error("underscore allowed only at start")}function _A(A){let e=A[0],t=Z.get(e);if(t)throw R(`leading ${t}`);let l=A.length,C=-1;for(let o=1;o{let o=SA(C),n={input:o,offset:l};l+=o.length+1;let g;try{let r=n.tokens=ne(o,e,t),c=r.length,s;if(c)if(g=r.flat(),vA(g),!(n.emoji=c>1||r[0].is_emoji)&&g.every(f=>f<128))WA(g),s="ASCII";else{let f=r.flatMap(i=>i.is_emoji?[]:i);if(!f.length)s="Emoji";else{if(K.has(g[0]))throw R("leading combining mark");for(let E=1;En.has(g)):[...n],!t.length)return}else l.push(C)}if(t){for(let C of t)if(l.every(o=>C.V.has(o)))throw new Error(`whole-script confusable: ${A.N}/${C.N}`)}}function Ce(A){let e=S;for(let t of A){let l=e.filter(C=>C.V.has(t));if(!l.length)throw S.some(C=>C.V.has(t))?MA(e[0],t):uA(t);if(e=l,l.length==1)break}return e}function oe(A){return A.map(({input:e,error:t,output:l})=>{if(t){let C=t.message;throw new Error(A.length==1?C:`Invalid label ${y(z(e))}: ${C}`)}return D(l)}).join(BA)}function uA(A){return new Error(`disallowed character: ${q(A)}`)}function MA(A,e){let t=q(e),l=S.find(C=>C.P.has(e));return l&&(t=`${l.N} ${t}`),new Error(`illegal mixture: ${A.N} + ${t}`)}function R(A){return new Error(`illegal placement: ${A}`)}function le(A,e){let{V:t,M:l}=A;for(let C of e)if(!t.has(C))throw MA(A,C);if(l){let C=sA(e);for(let o=1,n=C.length;oW)throw new Error(`excessive non-spacing marks: ${y(z(C.slice(o-1,g)))} (${g-o}/${W})`);o=g}}}function ne(A,e,t){let l=[],C=[];for(A=A.slice().reverse();A.length;){let o=re(A);if(o)C.length&&(l.push(e(C)),C=[]),l.push(t(o));else{let n=A.pop();if(yA.has(n))C.push(n);else{let g=TA.get(n);if(g)C.push(...g);else if(!HA.has(n))throw uA(n)}}}return C.length&&l.push(e(C)),l}function ge(A){return A.filter(e=>e!=fA)}function re(A,e){let t=aA,l,C=A.length;for(;C&&(t=t.get(A[--C]),!!t);){let{V:o}=t;o&&(l=o,e&&e.push(...A.slice(C).reverse()),A.length=C)}return l}function ce(A){return Ae(A)}export{se as getEnsAddress,fe as getEnsAvatar,Be as getEnsName,Qe as getEnsResolver,Ee as getEnsText,ae as labelhash,he as namehash,ce as normalize}; diff --git a/website/dist/assets/index-5090a415.js b/website/dist/assets/index-d8f85335.js similarity index 99% rename from website/dist/assets/index-5090a415.js rename to website/dist/assets/index-d8f85335.js index 42c22357..d72d34de 100644 --- a/website/dist/assets/index-5090a415.js +++ b/website/dist/assets/index-d8f85335.js @@ -1406,8 +1406,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `),zo=(0,Ut.bGB)("i"),(0,Ut.YCL)(Xo.$$.fragment),Ss=(0,Ut.DhX)(),Rs&&Rs.c(),ws=(0,Ut.DhX)(),$s=(0,Ut.bGB)("div"),rs=(0,Ut.bGB)("pre"),bs=(0,Ut.fLW)(Su),(0,Ut.Ljt)(pr,"class","vc-table-col vc-table-col-4"),(0,Ut.Ljt)(Er,"class","vc-table-col"),(0,Ut.Ljt)(Rr,"class","vc-table-col"),(0,Ut.Ljt)(Lr,"class","vc-table-col"),(0,Ut.Ljt)(dr,"class","vc-table-row vc-group-preview"),(0,Ut.VHj)(dr,"vc-table-row-error",Cr[10].status>=400),(0,Ut.Ljt)(Xn,"class","vc-table-row-icon"),(0,Ut.Ljt)(Sn,"class","vc-table-col vc-table-col-title"),(0,Ut.Ljt)(gn,"class","vc-table-row vc-left-border"),(0,Ut.Ljt)(vo,"class","vc-table-col vc-table-col-2"),(0,Ut.Ljt)(Fo,"class","vc-table-col vc-table-col-4 vc-table-col-value vc-max-height-line"),(0,Ut.Ljt)(wo,"class","vc-table-row vc-left-border vc-small"),(0,Ut.Ljt)(Vo,"class","vc-table-col vc-table-col-2"),(0,Ut.Ljt)(Go,"class","vc-table-col vc-table-col-4 vc-table-col-value vc-max-height-line"),(0,Ut.Ljt)(Eo,"class","vc-table-row vc-left-border vc-small"),(0,Ut.Ljt)(ho,"class","vc-table-col vc-table-col-2"),(0,Ut.Ljt)(oo,"class","vc-table-col vc-table-col-4 vc-table-col-value vc-max-height-line"),(0,Ut.Ljt)(lo,"class","vc-table-row vc-left-border vc-small"),(0,Ut.Ljt)(Oo,"class","vc-table-col vc-table-col-2"),(0,Ut.Ljt)(ts,"class","vc-table-col vc-table-col-4 vc-table-col-value vc-max-height-line"),(0,Ut.Ljt)(go,"class","vc-table-row vc-left-border vc-small"),(0,Ut.Ljt)(as,"class","vc-table-col vc-table-col-2"),(0,Ut.Ljt)(es,"class","vc-table-col vc-table-col-4 vc-table-col-value vc-max-height-line"),(0,Ut.Ljt)(Es,"class","vc-table-row vc-left-border vc-small"),(0,Ut.Ljt)(zo,"class","vc-table-row-icon"),(0,Ut.Ljt)(Po,"class","vc-table-col vc-table-col-title"),(0,Ut.Ljt)(Io,"class","vc-table-row vc-left-border"),(0,Ut.Ljt)(rs,"class","vc-table-col vc-max-height vc-min-height"),(0,Ut.Ljt)(rs,"data-scrollable","1"),(0,Ut.Ljt)($s,"class","vc-table-row vc-left-border vc-small"),(0,Ut.Ljt)(zr,"class","vc-group-detail"),(0,Ut.Ljt)(mr,"slot","item"),(0,Ut.Ljt)(mr,"class","vc-group"),(0,Ut.Ljt)(mr,"id",Us=Cr[10].id),(0,Ut.VHj)(mr,"vc-actived",Cr[10].actived)},m:function(ks,Yo){(0,Ut.$Tr)(ks,mr,Yo),(0,Ut.R3I)(mr,dr),(0,Ut.R3I)(dr,pr),(0,Ut.R3I)(pr,xr),(0,Ut.R3I)(dr,Er),(0,Ut.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ut.yef)(Xo,zo,null),(0,Ut.R3I)(fo,Ss),Rs&&Rs.m(fo,null),(0,Ut.R3I)(fo,ws),(0,Ut.R3I)(fo,$s),(0,Ut.R3I)($s,rs),(0,Ut.R3I)(rs,bs),xs=!0,zu||(k1=(0,Ut.oLt)(dr,"click",Sp),zu=!0)},p:function(ks,Yo){Cr=ks,(!xs||1024&Yo)&&yu!==(yu=Cr[10].name+"")&&(0,Ut.rTO)(xr,yu),(!xs||1024&Yo)&&bu!==(bu=Cr[10].method+"")&&(0,Ut.rTO)(jr,bu),(!xs||1024&Yo)&&xu!==(xu=Cr[10].statusText+"")&&(0,Ut.rTO)(Ar,xu),(!xs||1024&Yo)&&Cu!==(Cu=Cr[10].costTime+"")&&(0,Ut.rTO)(Vr,Cu),1024&Yo&&(0,Ut.VHj)(dr,"vc-table-row-error",Cr[10].status>=400);var D1={};1024&Yo&&(D1.content=Cr[10]),ro.$set(D1),(!xs||1024&Yo)&&Eu!==(Eu=Cr[10].url+"")&&(0,Ut.rTO)(Uo,Eu),(!xs||1024&Yo)&&_u!==(_u=Cr[10].method+"")&&(0,Ut.rTO)(No,_u),(!xs||1024&Yo)&&wu!==(wu=Cr[10].requestType+"")&&(0,Ut.rTO)(yo,wu),(!xs||1024&Yo)&&$u!==($u=Cr[10].status+"")&&(0,Ut.rTO)(ss,$u),(!xs||1024&Yo)&&ju!==(ju=Cr[10].startTimeText+"")&&(0,Ut.rTO)(js,ju),Cr[10].requestHeader!==null?fs?(fs.p(Cr,Yo),1024&Yo&&(0,Ut.Ui)(fs,1)):((fs=Jl(Cr)).c(),(0,Ut.Ui)(fs,1),fs.m(zr,Ms)):fs&&((0,Ut.dvw)(),(0,Ut.etI)(fs,1,1,function(){fs=null}),(0,Ut.gbL)()),Cr[10].getData!==null?ps?(ps.p(Cr,Yo),1024&Yo&&(0,Ut.Ui)(ps,1)):((ps=t1(Cr)).c(),(0,Ut.Ui)(ps,1),ps.m(zr,Hs)):ps&&((0,Ut.dvw)(),(0,Ut.etI)(ps,1,1,function(){ps=null}),(0,Ut.gbL)()),Cr[10].postData!==null?hs?(hs.p(Cr,Yo),1024&Yo&&(0,Ut.Ui)(hs,1)):((hs=n1(Cr)).c(),(0,Ut.Ui)(hs,1),hs.m(zr,_a)):hs&&((0,Ut.dvw)(),(0,Ut.etI)(hs,1,1,function(){hs=null}),(0,Ut.gbL)()),Cr[10].header!==null?ms?(ms.p(Cr,Yo),1024&Yo&&(0,Ut.Ui)(ms,1)):((ms=i1(Cr)).c(),(0,Ut.Ui)(ms,1),ms.m(zr,iu)):ms&&((0,Ut.dvw)(),(0,Ut.etI)(ms,1,1,function(){ms=null}),(0,Ut.gbL)());var O1={};1024&Yo&&(O1.content=Cr[10].response),Xo.$set(O1),Cr[10].responseSize>0?Rs?Rs.p(Cr,Yo):((Rs=a1(Cr)).c(),Rs.m(fo,ws)):Rs&&(Rs.d(1),Rs=null),(!xs||1024&Yo)&&Su!==(Su=(Cr[10].response||"")+"")&&(0,Ut.rTO)(bs,Su),(!xs||1024&Yo&&Us!==(Us=Cr[10].id))&&(0,Ut.Ljt)(mr,"id",Us),1024&Yo&&(0,Ut.VHj)(mr,"vc-actived",Cr[10].actived)},i:function(ks){xs||((0,Ut.Ui)(ro.$$.fragment,ks),(0,Ut.Ui)(fs),(0,Ut.Ui)(ps),(0,Ut.Ui)(hs),(0,Ut.Ui)(ms),(0,Ut.Ui)(Xo.$$.fragment,ks),xs=!0)},o:function(ks){(0,Ut.etI)(ro.$$.fragment,ks),(0,Ut.etI)(fs),(0,Ut.etI)(ps),(0,Ut.etI)(hs),(0,Ut.etI)(ms),(0,Ut.etI)(Xo.$$.fragment,ks),xs=!1},d:function(ks){ks&&(0,Ut.ogt)(mr),(0,Ut.vpE)(ro),fs&&fs.d(),ps&&ps.d(),hs&&hs.d(),ms&&ms.d(),(0,Ut.vpE)(Xo),Rs&&Rs.d(),zu=!1,k1()}}}function Q0(Cr){var mr,dr,pr,xr;return pr=new Ol({props:{items:Cr[1],itemKey:"id",itemHeight:30,buffer:100,stickToBottom:!0,scrollbar:!0,$$slots:{item:[Z0,function(Er){return{10:Er.item}},function(Er){return Er.item?1024:0}],empty:[z0],header:[q0]},$$scope:{ctx:Cr}}}),{c:function(){mr=(0,Ut.bGB)("div"),dr=(0,Ut.bGB)("div"),(0,Ut.YCL)(pr.$$.fragment),(0,Ut.Ljt)(dr,"class","vc-plugin-content"),(0,Ut.Ljt)(mr,"class","vc-table")},m:function(Er,jr){(0,Ut.$Tr)(Er,mr,jr),(0,Ut.R3I)(mr,dr),(0,Ut.yef)(pr,dr,null),xr=!0},p:function(Er,jr){var Rr=jr[0],Ar={};2&Rr&&(Ar.items=Er[1]),2098177&Rr&&(Ar.$$scope={dirty:Rr,ctx:Er}),pr.$set(Ar)},i:function(Er){xr||((0,Ut.Ui)(pr.$$.fragment,Er),xr=!0)},o:function(Er){(0,Ut.etI)(pr.$$.fragment,Er),xr=!1},d:function(Er){Er&&(0,Ut.ogt)(mr),(0,Ut.vpE)(pr)}}}function X0(Cr,mr,dr){var pr;(0,Ut.FIv)(Cr,Ws,function(Lr){return dr(6,pr=Lr)});var xr=0,Er=function(Lr){dr(0,xr=Object.keys(Lr).length)},jr=Ws.subscribe(Er);Er(pr);var Rr=[],Ar=function(Lr){(0,Ut.fxP)(Ws,pr[Lr].actived=!pr[Lr].actived,pr)};return(0,rr.H3)(function(){Wl.use()}),(0,rr.ev)(function(){jr(),Wl.unuse()}),Cr.$$.update=function(){64&Cr.$$.dirty&&dr(1,Rr=Object.values(pr))},[xr,Rr,Ar,function(Lr){var Vr="curl -X "+Lr.method;return typeof Lr.postData=="string"?Vr+=" -d '"+Lr.postData+"'":typeof Lr.postData=="object"&&Lr.postData!==null&&(Vr+=" -d '"+s.hZ(Lr.postData)+"'"),Vr+" '"+Lr.url+"'"},function(Lr){return s.Kn(Lr)||s.kJ(Lr)?s.hZ(Lr,{maxDepth:10,keyMaxLen:1e4,pretty:!0}):Lr},{fixedHeight:!0},pr,function(Lr){return Ar(Lr.id)}]}var Y0=function(Cr){function mr(dr){var pr;return pr=Cr.call(this)||this,(0,Ut.S1n)((0,ot.Z)(pr),dr,X0,Q0,Ut.N8,{options:5}),pr}return(0,tr.Z)(mr,Cr),(0,o.Z)(mr,[{key:"options",get:function(){return this.$$.ctx[5]}}]),mr}(Ut.f_C),J0=Y0,ep=function(Cr){function mr(){for(var pr,xr=arguments.length,Er=new Array(xr),jr=0;jr0&&!--qu&&(Gu(),Gu=null)};var c1=ou;function l1(Cr,mr,dr){var pr=Cr.slice();return pr[8]=mr[dr],pr}function d1(Cr,mr,dr){var pr=Cr.slice();return pr[11]=mr[dr],pr}function f1(Cr){var mr,dr,pr,xr=Cr[0].nodeType===Node.ELEMENT_NODE&&p1(Cr),Er=Cr[0].nodeType===Node.TEXT_NODE&&x1(Cr);return{c:function(){mr=(0,Ut.bGB)("div"),xr&&xr.c(),dr=(0,Ut.DhX)(),Er&&Er.c(),(0,Ut.Ljt)(mr,"class","vcelm-l"),(0,Ut.VHj)(mr,"vc-actived",Cr[0]._isActived),(0,Ut.VHj)(mr,"vc-toggle",Cr[0]._isExpand),(0,Ut.VHj)(mr,"vcelm-noc",Cr[0]._isSingleLine)},m:function(jr,Rr){(0,Ut.$Tr)(jr,mr,Rr),xr&&xr.m(mr,null),(0,Ut.R3I)(mr,dr),Er&&Er.m(mr,null),pr=!0},p:function(jr,Rr){jr[0].nodeType===Node.ELEMENT_NODE?xr?(xr.p(jr,Rr),1&Rr&&(0,Ut.Ui)(xr,1)):((xr=p1(jr)).c(),(0,Ut.Ui)(xr,1),xr.m(mr,dr)):xr&&((0,Ut.dvw)(),(0,Ut.etI)(xr,1,1,function(){xr=null}),(0,Ut.gbL)()),jr[0].nodeType===Node.TEXT_NODE?Er?Er.p(jr,Rr):((Er=x1(jr)).c(),Er.m(mr,null)):Er&&(Er.d(1),Er=null),1&Rr&&(0,Ut.VHj)(mr,"vc-actived",jr[0]._isActived),1&Rr&&(0,Ut.VHj)(mr,"vc-toggle",jr[0]._isExpand),1&Rr&&(0,Ut.VHj)(mr,"vcelm-noc",jr[0]._isSingleLine)},i:function(jr){pr||((0,Ut.Ui)(xr),pr=!0)},o:function(jr){(0,Ut.etI)(xr),pr=!1},d:function(jr){jr&&(0,Ut.ogt)(mr),xr&&xr.d(),Er&&Er.d()}}}function p1(Cr){var mr,dr,pr,xr,Er,jr,Rr,Ar,Lr,Vr,Zr=Cr[0].nodeName+"",zr=(Cr[0].className||Cr[0].attributes.length)&&h1(Cr),_n=Cr[0]._isNullEndTag&&g1(),gn=Cr[0].childNodes.length>0&&v1(Cr),Sn=!Cr[0]._isNullEndTag&&b1(Cr);return{c:function(){mr=(0,Ut.bGB)("span"),dr=(0,Ut.fLW)("<"),pr=(0,Ut.fLW)(Zr),zr&&zr.c(),xr=(0,Ut.cSb)(),_n&&_n.c(),Er=(0,Ut.fLW)(">"),gn&&gn.c(),jr=(0,Ut.cSb)(),Sn&&Sn.c(),Rr=(0,Ut.cSb)(),(0,Ut.Ljt)(mr,"class","vcelm-node")},m:function(Tn,Xn){(0,Ut.$Tr)(Tn,mr,Xn),(0,Ut.R3I)(mr,dr),(0,Ut.R3I)(mr,pr),zr&&zr.m(mr,null),(0,Ut.R3I)(mr,xr),_n&&_n.m(mr,null),(0,Ut.R3I)(mr,Er),gn&&gn.m(Tn,Xn),(0,Ut.$Tr)(Tn,jr,Xn),Sn&&Sn.m(Tn,Xn),(0,Ut.$Tr)(Tn,Rr,Xn),Ar=!0,Lr||(Vr=(0,Ut.oLt)(mr,"click",Cr[2]),Lr=!0)},p:function(Tn,Xn){(!Ar||1&Xn)&&Zr!==(Zr=Tn[0].nodeName+"")&&(0,Ut.rTO)(pr,Zr),Tn[0].className||Tn[0].attributes.length?zr?zr.p(Tn,Xn):((zr=h1(Tn)).c(),zr.m(mr,xr)):zr&&(zr.d(1),zr=null),Tn[0]._isNullEndTag?_n||((_n=g1()).c(),_n.m(mr,Er)):_n&&(_n.d(1),_n=null),Tn[0].childNodes.length>0?gn?(gn.p(Tn,Xn),1&Xn&&(0,Ut.Ui)(gn,1)):((gn=v1(Tn)).c(),(0,Ut.Ui)(gn,1),gn.m(jr.parentNode,jr)):gn&&((0,Ut.dvw)(),(0,Ut.etI)(gn,1,1,function(){gn=null}),(0,Ut.gbL)()),Tn[0]._isNullEndTag?Sn&&(Sn.d(1),Sn=null):Sn?Sn.p(Tn,Xn):((Sn=b1(Tn)).c(),Sn.m(Rr.parentNode,Rr))},i:function(Tn){Ar||((0,Ut.Ui)(gn),Ar=!0)},o:function(Tn){(0,Ut.etI)(gn),Ar=!1},d:function(Tn){Tn&&(0,Ut.ogt)(mr),zr&&zr.d(),_n&&_n.d(),gn&&gn.d(Tn),Tn&&(0,Ut.ogt)(jr),Sn&&Sn.d(Tn),Tn&&(0,Ut.ogt)(Rr),Lr=!1,Vr()}}}function h1(Cr){for(var mr,dr=Cr[0].attributes,pr=[],xr=0;xr"),(0,Ut.Ljt)(mr,"class","vcelm-node")},m:function(jr,Rr){(0,Ut.$Tr)(jr,mr,Rr),(0,Ut.R3I)(mr,dr),(0,Ut.R3I)(mr,pr),(0,Ut.R3I)(mr,xr)},p:function(jr,Rr){1&Rr&&Er!==(Er=jr[0].nodeName+"")&&(0,Ut.rTO)(pr,Er)},d:function(jr){jr&&(0,Ut.ogt)(mr)}}}function x1(Cr){var mr,dr,pr=Cr[1](Cr[0].textContent)+"";return{c:function(){mr=(0,Ut.bGB)("span"),dr=(0,Ut.fLW)(pr),(0,Ut.Ljt)(mr,"class","vcelm-t vcelm-noc")},m:function(xr,Er){(0,Ut.$Tr)(xr,mr,Er),(0,Ut.R3I)(mr,dr)},p:function(xr,Er){1&Er&&pr!==(pr=xr[1](xr[0].textContent)+"")&&(0,Ut.rTO)(dr,pr)},d:function(xr){xr&&(0,Ut.ogt)(mr)}}}function ap(Cr){var mr,dr,pr=Cr[0]&&f1(Cr);return{c:function(){pr&&pr.c(),mr=(0,Ut.cSb)()},m:function(xr,Er){pr&&pr.m(xr,Er),(0,Ut.$Tr)(xr,mr,Er),dr=!0},p:function(xr,Er){var jr=Er[0];xr[0]?pr?(pr.p(xr,jr),1&jr&&(0,Ut.Ui)(pr,1)):((pr=f1(xr)).c(),(0,Ut.Ui)(pr,1),pr.m(mr.parentNode,mr)):pr&&((0,Ut.dvw)(),(0,Ut.etI)(pr,1,1,function(){pr=null}),(0,Ut.gbL)())},i:function(xr){dr||((0,Ut.Ui)(pr),dr=!0)},o:function(xr){(0,Ut.etI)(pr),dr=!1},d:function(xr){pr&&pr.d(xr),xr&&(0,Ut.ogt)(mr)}}}function up(Cr,mr,dr){var pr;(0,Ut.FIv)(Cr,nu,function(Rr){return dr(3,pr=Rr)});var xr=mr.node,Er=(0,rr.x)(),jr=["br","hr","img","input","link","meta"];return(0,rr.H3)(function(){c1.use()}),(0,rr.ev)(function(){c1.unuse()}),Cr.$$set=function(Rr){"node"in Rr&&dr(0,xr=Rr.node)},Cr.$$.update=function(){9&Cr.$$.dirty&&xr&&(dr(0,xr._isActived=xr===pr,xr),dr(0,xr._isNullEndTag=function(Rr){return jr.indexOf(Rr.nodeName)>-1}(xr),xr),dr(0,xr._isSingleLine=xr.childNodes.length===0||xr._isNullEndTag,xr))},[xr,function(Rr){return Rr.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},function(){xr._isNullEndTag||(dr(0,xr._isExpand=!xr._isExpand,xr),Er("toggleNode",{node:xr}))},pr,function(Rr){Ut.cKT.call(this,Cr,Rr)}]}var C1=function(Cr){function mr(dr){var pr;return pr=Cr.call(this)||this,(0,Ut.S1n)((0,ot.Z)(pr),dr,up,ap,Ut.N8,{node:0}),pr}return(0,tr.Z)(mr,Cr),(0,o.Z)(mr,[{key:"node",get:function(){return this.$$.ctx[0]},set:function(dr){this.$$set({node:dr}),(0,Ut.yl1)()}}]),mr}(Ut.f_C),cp=C1;function lp(Cr){var mr,dr,pr;return(dr=new cp({props:{node:Cr[0]}})).$on("toggleNode",Cr[1]),{c:function(){mr=(0,Ut.bGB)("div"),(0,Ut.YCL)(dr.$$.fragment),(0,Ut.Ljt)(mr,"class","vc-plugin-content")},m:function(xr,Er){(0,Ut.$Tr)(xr,mr,Er),(0,Ut.yef)(dr,mr,null),pr=!0},p:function(xr,Er){var jr={};1&Er[0]&&(jr.node=xr[0]),dr.$set(jr)},i:function(xr){pr||((0,Ut.Ui)(dr.$$.fragment,xr),pr=!0)},o:function(xr){(0,Ut.etI)(dr.$$.fragment,xr),pr=!1},d:function(xr){xr&&(0,Ut.ogt)(mr),(0,Ut.vpE)(dr)}}}function dp(Cr,mr,dr){var pr;return(0,Ut.FIv)(Cr,mu,function(xr){return dr(0,pr=xr)}),[pr,function(xr){Ut.cKT.call(this,Cr,xr)}]}var fp=function(Cr){function mr(dr){var pr;return pr=Cr.call(this)||this,(0,Ut.S1n)((0,ot.Z)(pr),dr,dp,lp,Ut.N8,{}),pr}return(0,tr.Z)(mr,Cr),mr}(Ut.f_C),hp=fp,E1=function(Cr){function mr(pr,xr,Er){var jr;return Er===void 0&&(Er={}),(jr=Cr.call(this,pr,xr,hp,Er)||this).isInited=!1,jr.observer=void 0,jr.nodeMap=void 0,jr}(0,tr.Z)(mr,Cr);var dr=mr.prototype;return dr.onShow=function(){this.isInited||this._init()},dr.onRemove=function(){Cr.prototype.onRemove.call(this),this.isInited&&(this.observer.disconnect(),this.isInited=!1,this.nodeMap=void 0,mu.set(void 0))},dr.onAddTool=function(pr){var xr=this;pr([{name:"Expand",global:!1,onClick:function(Er){xr._expandActivedNode()}},{name:"Collapse",global:!1,onClick:function(Er){xr._collapseActivedNode()}}])},dr._init=function(){var pr=this;this.isInited=!0,this.nodeMap=new WeakMap;var xr=this._generateVNode(document.documentElement);xr._isExpand=!0,nu.set(xr),mu.set(xr),this.compInstance.$on("toggleNode",function(Er){nu.set(Er.detail.node)}),this.observer=new(rp())(function(Er){for(var jr=0;jr0&&this._onChildRemove(pr),pr.addedNodes.length>0&&this._onChildAdd(pr);break;case"attributes":this._onAttributesChange(pr);break;case"characterData":this._onCharacterDataChange(pr)}},dr._onChildRemove=function(pr){var xr=this.nodeMap.get(pr.target);if(xr){for(var Er=0;Er0){xr.childNodes=[];for(var Er=0;Er-1?Lr:null;return[Er==null?"":";path="+Er,jr==null?"":";domain="+jr,Rr==null?"":";expires="+Rr.toUTCString(),Ar===void 0||Ar===!1?"":";secure",Vr===null?"":";SameSite="+Vr].join("")}(dr))},R1=function(){return typeof document>"u"||document.cookie===void 0?"":document.cookie},gp=function(){function Cr(){}var mr=Cr.prototype;return mr.key=function(dr){return dr1;)jr.push(Rr.join(".")),Rr.shift();for(var Ar=0;Ar0;){zr+=(zr==="/"?"":"/")+Zr.shift();var _n=$1($1({},pr),{},{path:zr,domain:jr[Ar],expires:new Date(0)});S1(dr,"",_n)}},mr.clear=function(){for(var dr=[].concat(this.keys),pr=0;pr0&&Er.indexOf(xr)===-1&&ds.activedName.set(Er[0])}),ds.defaultStorages.subscribe(function(xr){xr.indexOf((0,ls.U2)(ds.activedName))===-1&&ds.activedName.set(xr[0]),pr.updateEnabledStorages()}),pr}(0,tr.Z)(mr,Cr);var dr=mr.prototype;return dr.getItem=function(){var pr=xa(Qo().mark(function xr(Er){return Qo().wrap(function(jr){for(;;)switch(jr.prev=jr.next){case 0:if(this.activedStorage){jr.next=2;break}return jr.abrupt("return","");case 2:return jr.next=4,this.promisify(this.activedStorage.getItem(Er));case 4:return jr.abrupt("return",jr.sent);case 5:case"end":return jr.stop()}},xr,this)}));return function(xr){return pr.apply(this,arguments)}}(),dr.setItem=function(){var pr=xa(Qo().mark(function xr(Er,jr){var Rr;return Qo().wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:if(this.activedStorage){Ar.next=2;break}return Ar.abrupt("return");case 2:return Ar.next=4,this.promisify(this.activedStorage.setItem(Er,jr));case 4:return Rr=Ar.sent,this.refresh(),Ar.abrupt("return",Rr);case 7:case"end":return Ar.stop()}},xr,this)}));return function(xr,Er){return pr.apply(this,arguments)}}(),dr.removeItem=function(){var pr=xa(Qo().mark(function xr(Er){var jr;return Qo().wrap(function(Rr){for(;;)switch(Rr.prev=Rr.next){case 0:if(this.activedStorage){Rr.next=2;break}return Rr.abrupt("return");case 2:return Rr.next=4,this.promisify(this.activedStorage.removeItem(Er));case 4:return jr=Rr.sent,this.refresh(),Rr.abrupt("return",jr);case 7:case"end":return Rr.stop()}},xr,this)}));return function(xr){return pr.apply(this,arguments)}}(),dr.clear=function(){var pr=xa(Qo().mark(function xr(){var Er;return Qo().wrap(function(jr){for(;;)switch(jr.prev=jr.next){case 0:if(this.activedStorage){jr.next=2;break}return jr.abrupt("return");case 2:return jr.next=4,this.promisify(this.activedStorage.clear());case 4:return Er=jr.sent,this.refresh(),jr.abrupt("return",Er);case 7:case"end":return jr.stop()}},xr,this)}));return function(){return pr.apply(this,arguments)}}(),dr.refresh=function(){ds.updateTime.set(Date.now())},dr.getEntries=function(){var pr=xa(Qo().mark(function xr(){var Er,jr,Rr,Ar,Lr;return Qo().wrap(function(Vr){for(;;)switch(Vr.prev=Vr.next){case 0:if(Er=this.activedStorage){Vr.next=3;break}return Vr.abrupt("return",[]);case 3:if(typeof Er.prepare!="function"){Vr.next=6;break}return Vr.next=6,Er.prepare();case 6:jr=[],Rr=0;case 8:if(!(Rr-1?document.cookie!==void 0&&this.storage.set("cookies",new gp):this.deleteStorage("cookies"),pr.indexOf("localStorage")>-1?window.localStorage&&this.storage.set("localStorage",window.localStorage):this.deleteStorage("localStorage"),pr.indexOf("sessionStorage")>-1?window.sessionStorage&&this.storage.set("sessionStorage",window.sessionStorage):this.deleteStorage("sessionStorage"),pr.indexOf("wxStorage")>-1?(0,s.H_)()&&this.storage.set("wxStorage",new vp):this.deleteStorage("wxStorage")},dr.promisify=function(pr){return typeof pr=="string"||pr==null?Promise.resolve(pr):pr},dr.deleteStorage=function(pr){this.storage.has(pr)&&this.storage.delete(pr)},(0,o.Z)(mr,[{key:"activedStorage",get:function(){return this.storage.get((0,ls.U2)(ds.activedName))}}]),mr}(Nl.N);function A1(Cr,mr,dr){var pr=Cr.slice();return pr[20]=mr[dr][0],pr[21]=mr[dr][1],pr[23]=dr,pr}function T1(Cr){var mr;return{c:function(){(mr=(0,Ut.bGB)("div")).textContent="Empty",(0,Ut.Ljt)(mr,"class","vc-plugin-empty")},m:function(dr,pr){(0,Ut.$Tr)(dr,mr,pr)},p:Ut.ZTd,d:function(dr){dr&&(0,Ut.ogt)(mr)}}}function yp(Cr){var mr,dr,pr,xr,Er,jr=Cr[20]+"",Rr=Cr[5](Cr[21])+"";return{c:function(){mr=(0,Ut.bGB)("div"),dr=(0,Ut.fLW)(jr),pr=(0,Ut.DhX)(),xr=(0,Ut.bGB)("div"),Er=(0,Ut.fLW)(Rr),(0,Ut.Ljt)(mr,"class","vc-table-col"),(0,Ut.Ljt)(xr,"class","vc-table-col vc-table-col-2")},m:function(Ar,Lr){(0,Ut.$Tr)(Ar,mr,Lr),(0,Ut.R3I)(mr,dr),(0,Ut.$Tr)(Ar,pr,Lr),(0,Ut.$Tr)(Ar,xr,Lr),(0,Ut.R3I)(xr,Er)},p:function(Ar,Lr){1&Lr&&jr!==(jr=Ar[20]+"")&&(0,Ut.rTO)(dr,jr),1&Lr&&Rr!==(Rr=Ar[5](Ar[21])+"")&&(0,Ut.rTO)(Er,Rr)},d:function(Ar){Ar&&(0,Ut.ogt)(mr),Ar&&(0,Ut.ogt)(pr),Ar&&(0,Ut.ogt)(xr)}}}function bp(Cr){var mr,dr,pr,xr,Er,jr,Rr;return{c:function(){mr=(0,Ut.bGB)("div"),dr=(0,Ut.bGB)("textarea"),pr=(0,Ut.DhX)(),xr=(0,Ut.bGB)("div"),Er=(0,Ut.bGB)("textarea"),(0,Ut.Ljt)(dr,"class","vc-table-input"),(0,Ut.Ljt)(mr,"class","vc-table-col"),(0,Ut.Ljt)(Er,"class","vc-table-input"),(0,Ut.Ljt)(xr,"class","vc-table-col vc-table-col-2")},m:function(Ar,Lr){(0,Ut.$Tr)(Ar,mr,Lr),(0,Ut.R3I)(mr,dr),(0,Ut.BmG)(dr,Cr[2]),(0,Ut.$Tr)(Ar,pr,Lr),(0,Ut.$Tr)(Ar,xr,Lr),(0,Ut.R3I)(xr,Er),(0,Ut.BmG)(Er,Cr[3]),jr||(Rr=[(0,Ut.oLt)(dr,"input",Cr[11]),(0,Ut.oLt)(Er,"input",Cr[12])],jr=!0)},p:function(Ar,Lr){4&Lr&&(0,Ut.BmG)(dr,Ar[2]),8&Lr&&(0,Ut.BmG)(Er,Ar[3])},d:function(Ar){Ar&&(0,Ut.ogt)(mr),Ar&&(0,Ut.ogt)(pr),Ar&&(0,Ut.ogt)(xr),jr=!1,(0,Ut.j7q)(Rr)}}}function xp(Cr){var mr,dr,pr,xr,Er,jr;return(mr=new _o.Z({props:{name:"delete"}})).$on("click",function(){return Cr[14](Cr[20])}),pr=new Ao({props:{content:[Cr[20],Cr[21]].join("=")}}),(Er=new _o.Z({props:{name:"edit"}})).$on("click",function(){return Cr[15](Cr[20],Cr[21],Cr[23])}),{c:function(){(0,Ut.YCL)(mr.$$.fragment),dr=(0,Ut.DhX)(),(0,Ut.YCL)(pr.$$.fragment),xr=(0,Ut.DhX)(),(0,Ut.YCL)(Er.$$.fragment)},m:function(Rr,Ar){(0,Ut.yef)(mr,Rr,Ar),(0,Ut.$Tr)(Rr,dr,Ar),(0,Ut.yef)(pr,Rr,Ar),(0,Ut.$Tr)(Rr,xr,Ar),(0,Ut.yef)(Er,Rr,Ar),jr=!0},p:function(Rr,Ar){Cr=Rr;var Lr={};1&Ar&&(Lr.content=[Cr[20],Cr[21]].join("=")),pr.$set(Lr)},i:function(Rr){jr||((0,Ut.Ui)(mr.$$.fragment,Rr),(0,Ut.Ui)(pr.$$.fragment,Rr),(0,Ut.Ui)(Er.$$.fragment,Rr),jr=!0)},o:function(Rr){(0,Ut.etI)(mr.$$.fragment,Rr),(0,Ut.etI)(pr.$$.fragment,Rr),(0,Ut.etI)(Er.$$.fragment,Rr),jr=!1},d:function(Rr){(0,Ut.vpE)(mr,Rr),Rr&&(0,Ut.ogt)(dr),(0,Ut.vpE)(pr,Rr),Rr&&(0,Ut.ogt)(xr),(0,Ut.vpE)(Er,Rr)}}}function Cp(Cr){var mr,dr,pr,xr;return(mr=new _o.Z({props:{name:"cancel"}})).$on("click",Cr[9]),(pr=new _o.Z({props:{name:"done"}})).$on("click",function(){return Cr[13](Cr[20])}),{c:function(){(0,Ut.YCL)(mr.$$.fragment),dr=(0,Ut.DhX)(),(0,Ut.YCL)(pr.$$.fragment)},m:function(Er,jr){(0,Ut.yef)(mr,Er,jr),(0,Ut.$Tr)(Er,dr,jr),(0,Ut.yef)(pr,Er,jr),xr=!0},p:function(Er,jr){Cr=Er},i:function(Er){xr||((0,Ut.Ui)(mr.$$.fragment,Er),(0,Ut.Ui)(pr.$$.fragment,Er),xr=!0)},o:function(Er){(0,Ut.etI)(mr.$$.fragment,Er),(0,Ut.etI)(pr.$$.fragment,Er),xr=!1},d:function(Er){(0,Ut.vpE)(mr,Er),Er&&(0,Ut.ogt)(dr),(0,Ut.vpE)(pr,Er)}}}function P1(Cr){var mr,dr,pr,xr,Er,jr,Rr;function Ar(gn,Sn){return gn[1]===gn[23]?bp:yp}var Lr=Ar(Cr),Vr=Lr(Cr),Zr=[Cp,xp],zr=[];function _n(gn,Sn){return gn[1]===gn[23]?0:1}return xr=_n(Cr),Er=zr[xr]=Zr[xr](Cr),{c:function(){mr=(0,Ut.bGB)("div"),Vr.c(),dr=(0,Ut.DhX)(),pr=(0,Ut.bGB)("div"),Er.c(),jr=(0,Ut.DhX)(),(0,Ut.Ljt)(pr,"class","vc-table-col vc-table-col-1 vc-table-action"),(0,Ut.Ljt)(mr,"class","vc-table-row")},m:function(gn,Sn){(0,Ut.$Tr)(gn,mr,Sn),Vr.m(mr,null),(0,Ut.R3I)(mr,dr),(0,Ut.R3I)(mr,pr),zr[xr].m(pr,null),(0,Ut.R3I)(mr,jr),Rr=!0},p:function(gn,Sn){Lr===(Lr=Ar(gn))&&Vr?Vr.p(gn,Sn):(Vr.d(1),(Vr=Lr(gn))&&(Vr.c(),Vr.m(mr,dr)));var Tn=xr;(xr=_n(gn))===Tn?zr[xr].p(gn,Sn):((0,Ut.dvw)(),(0,Ut.etI)(zr[Tn],1,1,function(){zr[Tn]=null}),(0,Ut.gbL)(),(Er=zr[xr])?Er.p(gn,Sn):(Er=zr[xr]=Zr[xr](gn)).c(),(0,Ut.Ui)(Er,1),Er.m(pr,null))},i:function(gn){Rr||((0,Ut.Ui)(Er),Rr=!0)},o:function(gn){(0,Ut.etI)(Er),Rr=!1},d:function(gn){gn&&(0,Ut.ogt)(mr),Vr.d(),zr[xr].d()}}}function Ep(Cr){for(var mr,dr,pr,xr,Er=Cr[0],jr=[],Rr=0;RrKey
Value
-
`,pr=(0,Ut.DhX)();for(var Vr=0;Vr0?xr:["cookies"])!==(0,ls.U2)(ds.defaultStorages)&&(ds.defaultStorages.set(xr),ds.activedName.set(xr[0]),this.updateTopBar())},dr.updateTopBar=function(){var pr=this;if(typeof this.onAddTopBarCallback=="function"){for(var xr=(0,ls.U2)(ds.defaultStorages),Er=[],jr=0;jr0&&this.showPlugin(dr[0])},mr.triggerEvent=function(dr,pr){var xr=this;dr="on"+dr.charAt(0).toUpperCase()+dr.slice(1),s.mf(this.option[dr])&&setTimeout(function(){xr.option[dr].apply(xr,pr)},0)},mr._initPlugin=function(dr){var pr=this;dr.vConsole=this,this.compInstance.pluginList[dr.id]={id:dr.id,name:dr.name,hasTabPanel:!1,tabOptions:void 0,topbarList:[],toolbarList:[],content:void 0,contentContainer:void 0},this.compInstance.pluginList=this._reorderPluginList(this.compInstance.pluginList),dr.trigger("init"),dr.trigger("renderTab",function(xr,Er){Er===void 0&&(Er={});var jr=pr.compInstance.pluginList[dr.id];jr.hasTabPanel=!0,jr.tabOptions=Er,xr&&(pr.compInstance.pluginList[dr.id].content=xr),pr.compInstance.pluginList=pr.compInstance.pluginList}),dr.trigger("addTopBar",function(xr){if(xr){for(var Er=[],jr=0;jr=0;pr--)this.removePlugin(dr[pr]);this.compInstance.$destroy()}},(0,o.Z)(Cr,null,[{key:"instance",get:function(){return window.__VCONSOLE_INSTANCE},set:function(dr){dr===void 0||dr instanceof Cr?window.__VCONSOLE_INSTANCE=dr:console.debug("[vConsole] Cannot set `VConsole.instance` because the value is not the instance of VConsole.")}}]),Cr}();ys.VConsolePlugin=void 0,ys.VConsoleLogPlugin=void 0,ys.VConsoleDefaultPlugin=void 0,ys.VConsoleSystemPlugin=void 0,ys.VConsoleNetworkPlugin=void 0,ys.VConsoleElementPlugin=void 0,ys.VConsoleStoragePlugin=void 0,ys.VConsolePlugin=to,ys.VConsoleLogPlugin=Du,ys.VConsoleDefaultPlugin=Ml,ys.VConsoleSystemPlugin=Fl,ys.VConsoleNetworkPlugin=u1,ys.VConsoleElementPlugin=E1,ys.VConsoleStoragePlugin=I1;var jp=ys}(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__}()})})(vconsole_min);var vconsole_minExports=vconsole_min.exports;const VConsole=getDefaultExportFromCjs(vconsole_minExports),theme$5={config:{useSystemColorMode:!1,initialColorMode:"system",storageType:"localStorage",storageKey:"walletkit-color-mode"}},GitHubIcon=o=>jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 20 20",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{d:"M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"})});function SwitchColorMode(){const{colorMode:o,toggleColorMode:s}=useColorMode();return jsxRuntimeExports.jsxs(Flex,{borderRadius:24,w:72,h:40,bg:"bg.bottom",px:4,alignItems:"center",justifyContent:"space-between",onClick:s,cursor:"pointer",children:[jsxRuntimeExports.jsx(Circle,{boxSize:32,bg:o==="light"?"scene.primary.normal":void 0,color:"dark.readable.normal",children:jsxRuntimeExports.jsx(SunIcon,{})}),jsxRuntimeExports.jsx(Circle,{boxSize:32,bg:o==="dark"?"scene.primary.normal":void 0,color:o==="dark"?"dark.readable.normal":void 0,children:jsxRuntimeExports.jsx(MoonIcon,{})})]})}function Header(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Flex,{h:68}),jsxRuntimeExports.jsxs(Flex,{h:68,right:0,left:0,top:0,position:"fixed",zIndex:9,bg:"bg.middle",justifyContent:"space-between",alignItems:"center",borderLeft:"1px solid",borderBottom:"1px solid",borderColor:"readable.border",px:16,children:[jsxRuntimeExports.jsx(Heading,{fontSize:20,children:"WalletKit"}),jsxRuntimeExports.jsxs(HStack,{spacing:16,children:[jsxRuntimeExports.jsx(Link$1,{href:"https://github.com/node-real/walletkit/tree/main",isExternal:!0,display:"inline-flex",children:jsxRuntimeExports.jsx(IconButton$1,{variant:"text",icon:jsxRuntimeExports.jsx(GitHubIcon,{}),color:"readable.normal"})}),jsxRuntimeExports.jsx(SwitchColorMode,{})]})]})]})}function Layout(){return jsxRuntimeExports.jsx(Flex,{minH:"100vh",children:jsxRuntimeExports.jsxs(Box$1,{flex:1,overflowX:"hidden",children:[jsxRuntimeExports.jsx(Header,{}),jsxRuntimeExports.jsx(Box$1,{m:32,p:24,bg:"bg.middle",borderRadius:16,children:jsxRuntimeExports.jsx(Outlet,{})})]})})}function _createMdxContent(o){const s=Object.assign({h1:"h1",h2:"h2",pre:"pre",code:"code",ul:"ul",li:"li",a:"a",h3:"h3",p:"p"},o.components),{WalletKitExample:a}=s;return a||_missingMdxReference("WalletKitExample",!0),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(s.h1,{children:"Getting Started"}),` -`,jsxRuntimeExports.jsx(s.h2,{children:"Install"}),` +
`,pr=(0,Ut.DhX)();for(var Vr=0;Vr0?xr:["cookies"])!==(0,ls.U2)(ds.defaultStorages)&&(ds.defaultStorages.set(xr),ds.activedName.set(xr[0]),this.updateTopBar())},dr.updateTopBar=function(){var pr=this;if(typeof this.onAddTopBarCallback=="function"){for(var xr=(0,ls.U2)(ds.defaultStorages),Er=[],jr=0;jr0&&this.showPlugin(dr[0])},mr.triggerEvent=function(dr,pr){var xr=this;dr="on"+dr.charAt(0).toUpperCase()+dr.slice(1),s.mf(this.option[dr])&&setTimeout(function(){xr.option[dr].apply(xr,pr)},0)},mr._initPlugin=function(dr){var pr=this;dr.vConsole=this,this.compInstance.pluginList[dr.id]={id:dr.id,name:dr.name,hasTabPanel:!1,tabOptions:void 0,topbarList:[],toolbarList:[],content:void 0,contentContainer:void 0},this.compInstance.pluginList=this._reorderPluginList(this.compInstance.pluginList),dr.trigger("init"),dr.trigger("renderTab",function(xr,Er){Er===void 0&&(Er={});var jr=pr.compInstance.pluginList[dr.id];jr.hasTabPanel=!0,jr.tabOptions=Er,xr&&(pr.compInstance.pluginList[dr.id].content=xr),pr.compInstance.pluginList=pr.compInstance.pluginList}),dr.trigger("addTopBar",function(xr){if(xr){for(var Er=[],jr=0;jr=0;pr--)this.removePlugin(dr[pr]);this.compInstance.$destroy()}},(0,o.Z)(Cr,null,[{key:"instance",get:function(){return window.__VCONSOLE_INSTANCE},set:function(dr){dr===void 0||dr instanceof Cr?window.__VCONSOLE_INSTANCE=dr:console.debug("[vConsole] Cannot set `VConsole.instance` because the value is not the instance of VConsole.")}}]),Cr}();ys.VConsolePlugin=void 0,ys.VConsoleLogPlugin=void 0,ys.VConsoleDefaultPlugin=void 0,ys.VConsoleSystemPlugin=void 0,ys.VConsoleNetworkPlugin=void 0,ys.VConsoleElementPlugin=void 0,ys.VConsoleStoragePlugin=void 0,ys.VConsolePlugin=to,ys.VConsoleLogPlugin=Du,ys.VConsoleDefaultPlugin=Ml,ys.VConsoleSystemPlugin=Fl,ys.VConsoleNetworkPlugin=u1,ys.VConsoleElementPlugin=E1,ys.VConsoleStoragePlugin=I1;var jp=ys}(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__}()})})(vconsole_min);var vconsole_minExports=vconsole_min.exports;const VConsole=getDefaultExportFromCjs(vconsole_minExports),theme$5={config:{useSystemColorMode:!1,initialColorMode:"system",storageType:"localStorage",storageKey:"walletkit-color-mode"}},GitHubIcon=o=>jsxRuntimeExports.jsx(Icon,{viewBox:"0 0 20 20",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{d:"M10 0a10 10 0 0 0-3.16 19.49c.5.1.68-.22.68-.48l-.01-1.7c-2.78.6-3.37-1.34-3.37-1.34-.46-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.1-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.1.39-1.99 1.03-2.69a3.6 3.6 0 0 1 .1-2.64s.84-.27 2.75 1.02a9.58 9.58 0 0 1 5 0c1.91-1.3 2.75-1.02 2.75-1.02.55 1.37.2 2.4.1 2.64.64.7 1.03 1.6 1.03 2.69 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85l-.01 2.75c0 .26.18.58.69.48A10 10 0 0 0 10 0"})});function SwitchColorMode(){const{colorMode:o,toggleColorMode:s}=useColorMode();return jsxRuntimeExports.jsxs(Flex,{borderRadius:24,w:72,h:40,bg:"bg.bottom",px:4,alignItems:"center",justifyContent:"space-between",onClick:s,cursor:"pointer",children:[jsxRuntimeExports.jsx(Circle,{boxSize:32,bg:o==="light"?"scene.primary.normal":void 0,color:"dark.readable.normal",children:jsxRuntimeExports.jsx(SunIcon,{})}),jsxRuntimeExports.jsx(Circle,{boxSize:32,bg:o==="dark"?"scene.primary.normal":void 0,color:o==="dark"?"dark.readable.normal":void 0,children:jsxRuntimeExports.jsx(MoonIcon,{})})]})}function Header(){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Flex,{h:68}),jsxRuntimeExports.jsxs(Flex,{h:68,right:0,left:0,top:0,position:"fixed",zIndex:9,bg:"bg.middle",justifyContent:"space-between",alignItems:"center",borderLeft:"1px solid",borderBottom:"1px solid",borderColor:"readable.border",px:16,children:[jsxRuntimeExports.jsx(Heading,{fontSize:20,children:"WalletKit"}),jsxRuntimeExports.jsxs(HStack,{spacing:16,children:[jsxRuntimeExports.jsx(Link$1,{href:"https://github.com/node-real/walletkit/tree/main",isExternal:!0,display:"inline-flex",children:jsxRuntimeExports.jsx(IconButton$1,{variant:"text",icon:jsxRuntimeExports.jsx(GitHubIcon,{}),color:"readable.normal"})}),jsxRuntimeExports.jsx(SwitchColorMode,{})]})]})]})}function Layout(){return jsxRuntimeExports.jsx(Flex,{minH:"100vh",children:jsxRuntimeExports.jsxs(Box$1,{flex:1,overflowX:"hidden",children:[jsxRuntimeExports.jsx(Header,{}),jsxRuntimeExports.jsx(Box$1,{m:32,p:24,bg:"bg.middle",borderRadius:16,children:jsxRuntimeExports.jsx(Outlet,{})})]})})}function _createMdxContent(o){const s=Object.assign({h1:"h1",h2:"h2",pre:"pre",code:"code",ul:"ul",li:"li",a:"a",h3:"h3",p:"p"},o.components),{WalletKitExample:a}=s;return a||_missingMdxReference("WalletKitExample",!0),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(s.h1,{children:"Quick start"}),` +`,jsxRuntimeExports.jsx(s.h2,{children:"Installation"}),` `,jsxRuntimeExports.jsx(s.pre,{children:jsxRuntimeExports.jsx(s.code,{className:"language-bash",children:`npm i @totejs/walletkit wagmi viem `})}),` `,jsxRuntimeExports.jsxs(s.ul,{children:[` @@ -1559,7 +1559,7 @@ function ConnectButton() { tokenPocket, trustWallet, walletConnect, -} from '@totejs/walletkit'; +} from '@totejs/walletkit/wallets'; const config = createConfig( getDefaultConfig({ @@ -1625,7 +1625,7 @@ type ThemeVariant = 'base'; ; `})}),` -`,jsxRuntimeExports.jsx(s.p,{children:"light mode configuration for the base theme."}),` +`,jsxRuntimeExports.jsx(s.p,{children:"An exmaple for customTheme"}),` `,jsxRuntimeExports.jsx(s.pre,{children:jsxRuntimeExports.jsx(s.code,{className:"language-tsx",live:"false",children:`const customTheme = { colors: { text: '#1e2026', @@ -1932,10 +1932,10 @@ const options = { `):`The contract function "${rt}" reverted.`,{cause:tr,metaMessages:rr}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=Ut,this.reason=nr,this.signature=ir}},ContractFunctionZeroDataError$1=class extends BaseError$2{constructor({functionName:s}){super(`The contract function "${s}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${s}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}},RawContractError$1=class extends BaseError$2{constructor({data:s,message:a}){super(a||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s}},HttpRequestError$1=class extends BaseError$2{constructor({body:s,details:a,headers:rt,status:ot,url:tr}){super("HTTP request failed.",{details:a,metaMessages:[ot&&`Status: ${ot}`,`URL: ${getUrl$1(tr)}`,s&&`Request body: ${stringify$2(s)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=s,this.headers=rt,this.status=ot,this.url=tr}},WebSocketRequestError$1=class extends BaseError$2{constructor({body:s,details:a,url:rt}){super("WebSocket request failed.",{details:a,metaMessages:[`URL: ${getUrl$1(rt)}`,`Request body: ${stringify$2(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}},RpcRequestError$1=class extends BaseError$2{constructor({body:s,error:a,url:rt}){super("RPC Request failed.",{cause:a,details:a.message,metaMessages:[`URL: ${getUrl$1(rt)}`,`Request body: ${stringify$2(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=a.code}},TimeoutError$1=class extends BaseError$2{constructor({body:s,url:a}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl$1(a)}`,`Request body: ${stringify$2(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}};const unknownErrorCode$1=-1;let RpcError$1=class extends BaseError$2{constructor(s,{code:a,docsPath:rt,metaMessages:ot,shortMessage:tr}){super(tr,{cause:s,docsPath:rt,metaMessages:ot||(s==null?void 0:s.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s.name,this.code=s instanceof RpcRequestError$1?s.code:a??unknownErrorCode$1}},ProviderRpcError$1=class extends RpcError$1{constructor(s,a){super(s,a),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a.data}},ParseRpcError$1=class L1 extends RpcError$1{constructor(s){super(s,{code:L1.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}};Object.defineProperty(ParseRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});let InvalidRequestRpcError$1=class B1 extends RpcError$1{constructor(s){super(s,{code:B1.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}};Object.defineProperty(InvalidRequestRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});let MethodNotFoundRpcError$1=class M1 extends RpcError$1{constructor(s){super(s,{code:M1.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}};Object.defineProperty(MethodNotFoundRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});let InvalidParamsRpcError$1=class F1 extends RpcError$1{constructor(s){super(s,{code:F1.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}};Object.defineProperty(InvalidParamsRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});let InternalRpcError$1=class N1 extends RpcError$1{constructor(s){super(s,{code:N1.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}};Object.defineProperty(InternalRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});let InvalidInputRpcError$1=class H1 extends RpcError$1{constructor(s){super(s,{code:H1.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}};Object.defineProperty(InvalidInputRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});let ResourceNotFoundRpcError$1=class U1 extends RpcError$1{constructor(s){super(s,{code:U1.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(ResourceNotFoundRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});let ResourceUnavailableRpcError$1=class V1 extends RpcError$1{constructor(s){super(s,{code:V1.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}};Object.defineProperty(ResourceUnavailableRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});let TransactionRejectedRpcError$1=class G1 extends RpcError$1{constructor(s){super(s,{code:G1.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}};Object.defineProperty(TransactionRejectedRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});let MethodNotSupportedRpcError$1=class q1 extends RpcError$1{constructor(s){super(s,{code:q1.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}};Object.defineProperty(MethodNotSupportedRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});let LimitExceededRpcError$1=class z1 extends RpcError$1{constructor(s){super(s,{code:z1.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}};Object.defineProperty(LimitExceededRpcError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});let JsonRpcVersionUnsupportedError$1=class W1 extends RpcError$1{constructor(s){super(s,{code:W1.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}};Object.defineProperty(JsonRpcVersionUnsupportedError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});let UserRejectedRequestError$1=class K1 extends ProviderRpcError$1{constructor(s){super(s,{code:K1.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}};Object.defineProperty(UserRejectedRequestError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});let UnauthorizedProviderError$1=class Z1 extends ProviderRpcError$1{constructor(s){super(s,{code:Z1.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}};Object.defineProperty(UnauthorizedProviderError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});let UnsupportedProviderMethodError$1=class Q1 extends ProviderRpcError$1{constructor(s){super(s,{code:Q1.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}};Object.defineProperty(UnsupportedProviderMethodError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});let ProviderDisconnectedError$1=class X1 extends ProviderRpcError$1{constructor(s){super(s,{code:X1.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}};Object.defineProperty(ProviderDisconnectedError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});let ChainDisconnectedError$1=class Y1 extends ProviderRpcError$1{constructor(s){super(s,{code:Y1.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}};Object.defineProperty(ChainDisconnectedError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});let SwitchChainError$1=class J1 extends ProviderRpcError$1{constructor(s){super(s,{code:J1.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}};Object.defineProperty(SwitchChainError$1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});let UnknownRpcError$1=class extends RpcError$1{constructor(s){super(s,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}};const EXECUTION_REVERTED_ERROR_CODE$1=3;function getContractError$2(o,{abi:s,address:a,args:rt,docsPath:ot,functionName:tr,sender:Ut}){const{code:rr,data:nr,message:ir,shortMessage:sr}=o instanceof RawContractError$1?o:o instanceof BaseError$2?o.walk(ur=>"data"in ur)||o.walk():{},ar=(()=>o instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError$1({functionName:tr}):[EXECUTION_REVERTED_ERROR_CODE$1,InternalRpcError$1.code].includes(rr)&&(nr||ir||sr)?new ContractFunctionRevertedError$1({abi:s,data:typeof nr=="object"?nr.data:nr,functionName:tr,message:sr??ir}):o)();return new ContractFunctionExecutionError$1(ar,{abi:s,args:rt,contractAddress:a,docsPath:ot,functionName:tr,sender:Ut})}let AccountNotFoundError$1=class extends BaseError$2{constructor({docsPath:s}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` -`),{docsPath:s,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}},EstimateGasExecutionError$1=class extends BaseError$2{constructor(s,{account:a,docsPath:rt,chain:ot,data:tr,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur}){const cr=prettyPrint$1({from:a==null?void 0:a.address,to:ar,value:typeof ur<"u"&&`${formatEther$2(ur)} ${(ot==null?void 0:ot.nativeCurrency.symbol)||"ETH"}`,data:tr,gas:Ut,gasPrice:typeof rr<"u"&&`${formatGwei$2(rr)} gwei`,maxFeePerGas:typeof nr<"u"&&`${formatGwei$2(nr)} gwei`,maxPriorityFeePerGas:typeof ir<"u"&&`${formatGwei$2(ir)} gwei`,nonce:sr});super(s.shortMessage,{cause:s,docsPath:rt,metaMessages:[...s.metaMessages?[...s.metaMessages," "]:[],"Estimate Gas Arguments:",cr].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=s}};function getNodeError$2(o,s){const a=(o.details||"").toLowerCase(),rt=o.walk(ot=>ot.code===ExecutionRevertedError$1.code);return rt instanceof BaseError$2?new ExecutionRevertedError$1({cause:o,message:rt.details}):ExecutionRevertedError$1.nodeMessage.test(a)?new ExecutionRevertedError$1({cause:o,message:o.details}):FeeCapTooHighError$1.nodeMessage.test(a)?new FeeCapTooHighError$1({cause:o,maxFeePerGas:s==null?void 0:s.maxFeePerGas}):FeeCapTooLowError$1.nodeMessage.test(a)?new FeeCapTooLowError$1({cause:o,maxFeePerGas:s==null?void 0:s.maxFeePerGas}):NonceTooHighError$1.nodeMessage.test(a)?new NonceTooHighError$1({cause:o,nonce:s==null?void 0:s.nonce}):NonceTooLowError$1.nodeMessage.test(a)?new NonceTooLowError$1({cause:o,nonce:s==null?void 0:s.nonce}):NonceMaxValueError$1.nodeMessage.test(a)?new NonceMaxValueError$1({cause:o,nonce:s==null?void 0:s.nonce}):InsufficientFundsError$1.nodeMessage.test(a)?new InsufficientFundsError$1({cause:o}):IntrinsicGasTooHighError$1.nodeMessage.test(a)?new IntrinsicGasTooHighError$1({cause:o,gas:s==null?void 0:s.gas}):IntrinsicGasTooLowError$1.nodeMessage.test(a)?new IntrinsicGasTooLowError$1({cause:o,gas:s==null?void 0:s.gas}):TransactionTypeNotSupportedError$1.nodeMessage.test(a)?new TransactionTypeNotSupportedError$1({cause:o}):TipAboveFeeCapError$1.nodeMessage.test(a)?new TipAboveFeeCapError$1({cause:o,maxFeePerGas:s==null?void 0:s.maxFeePerGas,maxPriorityFeePerGas:s==null?void 0:s.maxPriorityFeePerGas}):new UnknownNodeError$1({cause:o})}function getEstimateGasError$2(o,{docsPath:s,...a}){const rt=(()=>{const ot=getNodeError$2(o,a);return ot instanceof UnknownNodeError$1?o:ot})();return new EstimateGasExecutionError$1(rt,{docsPath:s,...a})}function extract$2(o,{format:s}){return s?Object.keys(s({})).reduce((rt,ot)=>(o!=null&&o.hasOwnProperty(ot)&&(rt[ot]=o[ot]),rt),{}):{}}function assertRequest$2(o){const{account:s,gasPrice:a,maxFeePerGas:rt,maxPriorityFeePerGas:ot,to:tr}=o,Ut=s?parseAccount$2(s):void 0;if(Ut&&!isAddress$2(Ut.address))throw new InvalidAddressError$1({address:Ut.address});if(tr&&!isAddress$2(tr))throw new InvalidAddressError$1({address:tr});if(typeof a<"u"&&(typeof rt<"u"||typeof ot<"u"))throw new FeeConflictError$1;if(rt&&rt>2n**256n-1n)throw new FeeCapTooHighError$1({maxFeePerGas:rt});if(ot&&rt&&ot>rt)throw new TipAboveFeeCapError$1({maxFeePerGas:rt,maxPriorityFeePerGas:ot})}let BaseFeeScalarError$1=class extends BaseError$2{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}},Eip1559FeesNotSupportedError$1=class extends BaseError$2{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}},MaxFeePerGasTooLowError$1=class extends BaseError$2{constructor({maxPriorityFeePerGas:s}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei$2(s)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}},BlockNotFoundError$1=class extends BaseError$2{constructor({blockHash:s,blockNumber:a}){let rt="Block";s&&(rt=`Block at hash "${s}"`),a&&(rt=`Block at number "${a}"`),super(`${rt} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}};async function getBlock$2(o,{blockHash:s,blockNumber:a,blockTag:rt,includeTransactions:ot}={}){var sr,ar,ur;const tr=rt??"latest",Ut=ot??!1,rr=a!==void 0?numberToHex(a):void 0;let nr=null;if(s?nr=await o.request({method:"eth_getBlockByHash",params:[s,Ut]}):nr=await o.request({method:"eth_getBlockByNumber",params:[rr||tr,Ut]}),!nr)throw new BlockNotFoundError$1({blockHash:s,blockNumber:a});return(((ur=(ar=(sr=o.chain)==null?void 0:sr.formatters)==null?void 0:ar.block)==null?void 0:ur.format)||formatBlock$1)(nr)}async function getGasPrice$2(o){const s=await o.request({method:"eth_gasPrice"});return BigInt(s)}async function estimateMaxPriorityFeePerGas$2(o,s){return internal_estimateMaxPriorityFeePerGas$1(o,s)}async function internal_estimateMaxPriorityFeePerGas$1(o,s){var tr,Ut,rr;const{block:a,chain:rt=o.chain,request:ot}=s||{};if(typeof((tr=rt==null?void 0:rt.fees)==null?void 0:tr.defaultPriorityFee)=="function"){const nr=a||await getBlock$2(o);return rt.fees.defaultPriorityFee({block:nr,client:o,request:ot})}else if(typeof((Ut=rt==null?void 0:rt.fees)==null?void 0:Ut.defaultPriorityFee)<"u")return(rr=rt==null?void 0:rt.fees)==null?void 0:rr.defaultPriorityFee;try{const nr=await o.request({method:"eth_maxPriorityFeePerGas"});return hexToBigInt(nr)}catch{const[nr,ir]=await Promise.all([a?Promise.resolve(a):getBlock$2(o),getGasPrice$2(o)]);if(typeof nr.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError$1;const sr=ir-nr.baseFeePerGas;return sr<0n?0n:sr}}async function estimateFeesPerGas$2(o,s){return internal_estimateFeesPerGas$1(o,s)}async function internal_estimateFeesPerGas$1(o,s){var ur,cr;const{block:a,chain:rt=o.chain,request:ot,type:tr="eip1559"}=s||{},Ut=await(async()=>{var lr,hr;return typeof((lr=rt==null?void 0:rt.fees)==null?void 0:lr.baseFeeMultiplier)=="function"?rt.fees.baseFeeMultiplier({block:a,client:o,request:ot}):((hr=rt==null?void 0:rt.fees)==null?void 0:hr.baseFeeMultiplier)??1.2})();if(Ut<1)throw new BaseFeeScalarError$1;const nr=10**(((ur=Ut.toString().split(".")[1])==null?void 0:ur.length)??0),ir=lr=>lr*BigInt(Math.ceil(Ut*nr))/BigInt(nr),sr=a||await getBlock$2(o);if(typeof((cr=rt==null?void 0:rt.fees)==null?void 0:cr.estimateFeesPerGas)=="function")return rt.fees.estimateFeesPerGas({block:a,client:o,multiply:ir,request:ot,type:tr});if(tr==="eip1559"){if(typeof sr.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError$1;const lr=ot!=null&&ot.maxPriorityFeePerGas?ot.maxPriorityFeePerGas:await internal_estimateMaxPriorityFeePerGas$1(o,{block:sr,chain:rt,request:ot}),hr=ir(sr.baseFeePerGas);return{maxFeePerGas:(ot==null?void 0:ot.maxFeePerGas)??hr+lr,maxPriorityFeePerGas:lr}}return{gasPrice:(ot==null?void 0:ot.gasPrice)??ir(await getGasPrice$2(o))}}async function getTransactionCount$2(o,{address:s,blockTag:a="latest",blockNumber:rt}){const ot=await o.request({method:"eth_getTransactionCount",params:[s,rt?numberToHex(rt):a]});return hexToNumber$1(ot)}function getTransactionType$2(o){if(o.type)return o.type;if(typeof o.maxFeePerGas<"u"||typeof o.maxPriorityFeePerGas<"u")return"eip1559";if(typeof o.gasPrice<"u")return typeof o.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError$1({transaction:o})}async function prepareTransactionRequest$1(o,s){const{account:a=o.account,chain:rt,gas:ot,nonce:tr,type:Ut}=s;if(!a)throw new AccountNotFoundError$1;const rr=parseAccount$2(a),nr=await getBlock$2(o,{blockTag:"latest"}),ir={...s,from:rr.address};if(typeof tr>"u"&&(ir.nonce=await getTransactionCount$2(o,{address:rr.address,blockTag:"pending"})),typeof Ut>"u")try{ir.type=getTransactionType$2(ir)}catch{ir.type=typeof nr.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(ir.type==="eip1559"){const{maxFeePerGas:sr,maxPriorityFeePerGas:ar}=await internal_estimateFeesPerGas$1(o,{block:nr,chain:rt,request:ir});if(typeof s.maxPriorityFeePerGas>"u"&&s.maxFeePerGas&&s.maxFeePerGas"u"&&(ir.gas=await estimateGas$2(o,{...ir,account:{address:rr.address,type:"json-rpc"}})),assertRequest$2(ir),ir}async function estimateGas$2(o,s){var ot,tr,Ut;const a=s.account??o.account;if(!a)throw new AccountNotFoundError$1({docsPath:"/docs/actions/public/estimateGas"});const rt=parseAccount$2(a);try{const{accessList:rr,blockNumber:nr,blockTag:ir,data:sr,gas:ar,gasPrice:ur,maxFeePerGas:cr,maxPriorityFeePerGas:lr,nonce:hr,to:gr,value:vr,...fr}=rt.type==="local"?await prepareTransactionRequest$1(o,s):s,wr=(nr?numberToHex(nr):void 0)||ir;assertRequest$2(s);const $r=((Ut=(tr=(ot=o.chain)==null?void 0:ot.formatters)==null?void 0:tr.transactionRequest)==null?void 0:Ut.format)||formatTransactionRequest,_r=$r({...extract$2(fr,{format:$r}),from:rt.address,accessList:rr,data:sr,gas:ar,gasPrice:ur,maxFeePerGas:cr,maxPriorityFeePerGas:lr,nonce:hr,to:gr,value:vr}),yr=await o.request({method:"eth_estimateGas",params:wr?[_r,wr]:[_r]});return BigInt(yr)}catch(rr){throw getEstimateGasError$2(rr,{...s,account:rt,chain:o.chain})}}async function estimateContractGas$2(o,{abi:s,address:a,args:rt,functionName:ot,...tr}){const Ut=encodeFunctionData$2({abi:s,args:rt,functionName:ot});try{return await estimateGas$2(o,{data:Ut,to:a,...tr})}catch(rr){const nr=tr.account?parseAccount$2(tr.account):void 0;throw getContractError$2(rr,{abi:s,address:a,args:rt,docsPath:"/docs/contract/estimateContractGas",functionName:ot,sender:nr==null?void 0:nr.address})}}const docsPath$8="/docs/contract/decodeEventLog";function decodeEventLog$2({abi:o,data:s,strict:a,topics:rt}){const ot=a??!0,[tr,...Ut]=rt;if(!tr)throw new AbiEventSignatureEmptyTopicsError({docsPath:docsPath$8});const rr=o.find(lr=>lr.type==="event"&&tr===getEventSelector$2(formatAbiItem$1(lr)));if(!(rr&&"name"in rr)||rr.type!=="event")throw new AbiEventSignatureNotFoundError(tr,{docsPath:docsPath$8});const{name:nr,inputs:ir}=rr,sr=ir==null?void 0:ir.some(lr=>!("name"in lr&&lr.name));let ar=sr?[]:{};const ur=ir.filter(lr=>"indexed"in lr&&lr.indexed);for(let lr=0;lr!("indexed"in lr&&lr.indexed));if(cr.length>0){if(s&&s!=="0x")try{const lr=decodeAbiParameters$2(cr,s);if(lr)if(sr)ar=[...ar,...lr];else for(let hr=0;hr0?ar:void 0}}function decodeTopic$1({param:o,value:s}){return o.type==="string"||o.type==="bytes"||o.type==="tuple"||o.type.match(/^(.*)\[(\d+)?\]$/)?s:(decodeAbiParameters$2([o],s)||[])[0]}async function getLogs$2(o,{address:s,blockHash:a,fromBlock:rt,toBlock:ot,event:tr,events:Ut,args:rr,strict:nr}={}){const ir=nr??!1,sr=Ut??(tr?[tr]:void 0);let ar=[];sr&&(ar=[sr.flatMap(cr=>encodeEventTopics$2({abi:[cr],eventName:cr.name,args:rr}))],tr&&(ar=ar[0]));let ur;return a?ur=await o.request({method:"eth_getLogs",params:[{address:s,topics:ar,blockHash:a}]}):ur=await o.request({method:"eth_getLogs",params:[{address:s,topics:ar,fromBlock:typeof rt=="bigint"?numberToHex(rt):rt,toBlock:typeof ot=="bigint"?numberToHex(ot):ot}]}),ur.map(cr=>{var lr;try{const{eventName:hr,args:gr}=sr?decodeEventLog$2({abi:sr,data:cr.data,topics:cr.topics,strict:ir}):{eventName:void 0,args:void 0};return formatLog$1(cr,{args:gr,eventName:hr})}catch(hr){let gr,vr;if(hr instanceof DecodeLogDataMismatch||hr instanceof DecodeLogTopicsMismatch){if(ir)return;gr=hr.abiItem.name,vr=(lr=hr.abiItem.inputs)==null?void 0:lr.some(fr=>!("name"in fr&&fr.name))}return formatLog$1(cr,{args:vr?[]:{},eventName:gr})}}).filter(Boolean)}async function getContractEvents$2(o,{abi:s,address:a,args:rt,blockHash:ot,eventName:tr,fromBlock:Ut,toBlock:rr,strict:nr}){const ir=tr?getAbiItem$2({abi:s,name:tr}):void 0,sr=ir?void 0:s.filter(ar=>ar.type==="event");return getLogs$2(o,{address:a,args:rt,blockHash:ot,event:ir,events:sr,fromBlock:Ut,toBlock:rr,strict:nr})}const docsPath$7="/docs/contract/decodeFunctionResult";function decodeFunctionResult$2({abi:o,args:s,functionName:a,data:rt}){let ot=o[0];if(a&&(ot=getAbiItem$2({abi:o,args:s,name:a}),!ot))throw new AbiFunctionNotFoundError(a,{docsPath:docsPath$7});if(ot.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$7});if(!ot.outputs)throw new AbiFunctionOutputsNotFoundError(ot.name,{docsPath:docsPath$7});const tr=decodeAbiParameters$2(ot.outputs,rt);if(tr&&tr.length>1)return tr;if(tr&&tr.length===1)return tr[0]}const scriptRel="modulepreload",assetsURL=function(o,s){return new URL(o,s).href},seen={},__vitePreload=function o(s,a,rt){if(!a||a.length===0)return s();const ot=document.getElementsByTagName("link");return Promise.all(a.map(tr=>{if(tr=assetsURL(tr,rt),tr in seen)return;seen[tr]=!0;const Ut=tr.endsWith(".css"),rr=Ut?'[rel="stylesheet"]':"";if(!!rt)for(let sr=ot.length-1;sr>=0;sr--){const ar=ot[sr];if(ar.href===tr&&(!Ut||ar.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${tr}"]${rr}`))return;const ir=document.createElement("link");if(ir.rel=Ut?"stylesheet":scriptRel,Ut||(ir.as="script",ir.crossOrigin=""),ir.href=tr,document.head.appendChild(ir),Ut)return new Promise((sr,ar)=>{ir.addEventListener("load",sr),ir.addEventListener("error",()=>ar(new Error(`Unable to preload CSS for ${tr}`)))})})).then(()=>s()).catch(tr=>{const Ut=new Event("vite:preloadError",{cancelable:!0});if(Ut.payload=tr,window.dispatchEvent(Ut),!Ut.defaultPrevented)throw tr})},multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],universalResolverErrors$1=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],universalResolverResolveAbi=[...universalResolverErrors$1,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],universalResolverReverseAbi=[...universalResolverErrors$1,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],addressResolverAbi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],universalSignatureValidatorAbi=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],aggregate3Signature="0x82ad56cb";function getCallError$2(o,{docsPath:s,...a}){const rt=(()=>{const ot=getNodeError$2(o,a);return ot instanceof UnknownNodeError$1?o:ot})();return new CallExecutionError$1(rt,{docsPath:s,...a})}const schedulerCache$1=new Map;function createBatchScheduler$2({fn:o,id:s,shouldSplitBatch:a,wait:rt=0}){const ot=async()=>{const ir=rr();tr();const sr=ir.map(({args:ar})=>ar);sr.length!==0&&o(sr).then(ar=>{ir.forEach(({pendingPromise:ur},cr)=>{var lr;return(lr=ur.resolve)==null?void 0:lr.call(ur,[ar[cr],ar])})}).catch(ar=>{ir.forEach(({pendingPromise:ur})=>{var cr;return(cr=ur.reject)==null?void 0:cr.call(ur,ar)})})},tr=()=>schedulerCache$1.delete(s),Ut=()=>rr().map(({args:ir})=>ir),rr=()=>schedulerCache$1.get(s)||[],nr=ir=>schedulerCache$1.set(s,[...rr(),ir]);return{flush:tr,async schedule(ir){const sr={},ar=new Promise((lr,hr)=>{sr.resolve=lr,sr.reject=hr});return(a==null?void 0:a([...Ut(),ir]))&&ot(),rr().length>0?(nr({args:ir,pendingPromise:sr}),ar):(nr({args:ir,pendingPromise:sr}),setTimeout(ot,rt),ar)}}}async function call$1(o,s){var vr,fr,br,wr;const{account:a=o.account,batch:rt=!!((vr=o.batch)!=null&&vr.multicall),blockNumber:ot,blockTag:tr="latest",accessList:Ut,data:rr,gas:nr,gasPrice:ir,maxFeePerGas:sr,maxPriorityFeePerGas:ar,nonce:ur,to:cr,value:lr,...hr}=s,gr=a?parseAccount$2(a):void 0;try{assertRequest$2(s);const _r=(ot?numberToHex(ot):void 0)||tr,yr=((wr=(br=(fr=o.chain)==null?void 0:fr.formatters)==null?void 0:br.transactionRequest)==null?void 0:wr.format)||formatTransactionRequest,Sr=yr({...extract$2(hr,{format:yr}),from:gr==null?void 0:gr.address,accessList:Ut,data:rr,gas:nr,gasPrice:ir,maxFeePerGas:sr,maxPriorityFeePerGas:ar,nonce:ur,to:cr,value:lr});if(rt&&shouldPerformMulticall({request:Sr}))try{return await scheduleMulticall(o,{...Sr,blockNumber:ot,blockTag:tr})}catch(Ir){if(!(Ir instanceof ClientChainNotConfiguredError$1)&&!(Ir instanceof ChainDoesNotSupportContract$1))throw Ir}const kr=await o.request({method:"eth_call",params:_r?[Sr,_r]:[Sr]});return kr==="0x"?{data:void 0}:{data:kr}}catch($r){const _r=getRevertErrorData($r),{offchainLookup:yr,offchainLookupSignature:Sr}=await __vitePreload(()=>import("./ccip-a4f5f9d3.js"),[],import.meta.url);if((_r==null?void 0:_r.slice(0,10))===Sr&&cr)return{data:await yr(o,{data:_r,to:cr})};throw getCallError$2($r,{...s,account:gr,chain:o.chain})}}function shouldPerformMulticall({request:o}){const{data:s,to:a,...rt}=o;return!(!s||s.startsWith(aggregate3Signature)||!a||Object.values(rt).filter(ot=>typeof ot<"u").length>0)}async function scheduleMulticall(o,s){var hr;const{batchSize:a=1024,wait:rt=0}=typeof((hr=o.batch)==null?void 0:hr.multicall)=="object"?o.batch.multicall:{},{blockNumber:ot,blockTag:tr="latest",data:Ut,multicallAddress:rr,to:nr}=s;let ir=rr;if(!ir){if(!o.chain)throw new ClientChainNotConfiguredError$1;ir=getChainContractAddress$1({blockNumber:ot,chain:o.chain,contract:"multicall3"})}const ar=(ot?numberToHex(ot):void 0)||tr,{schedule:ur}=createBatchScheduler$2({id:`${o.uid}.${ar}`,wait:rt,shouldSplitBatch(gr){return gr.reduce((fr,{data:br})=>fr+(br.length-2),0)>a*2},fn:async gr=>{const vr=gr.map(wr=>({allowFailure:!0,callData:wr.data,target:wr.to})),fr=encodeFunctionData$2({abi:multicall3Abi,args:[vr],functionName:"aggregate3"}),br=await o.request({method:"eth_call",params:[{data:fr,to:ir},ar]});return decodeFunctionResult$2({abi:multicall3Abi,args:[vr],functionName:"aggregate3",data:br||"0x"})}}),[{returnData:cr,success:lr}]=await ur({data:Ut,to:nr});if(!lr)throw new RawContractError$1({data:cr});return cr==="0x"?{data:void 0}:{data:cr}}function getRevertErrorData(o){if(!(o instanceof BaseError$2))return;const s=o.walk();return typeof s.data=="object"?s.data.data:s.data}async function readContract$3(o,{abi:s,address:a,args:rt,functionName:ot,...tr}){const Ut=encodeFunctionData$2({abi:s,args:rt,functionName:ot});try{const{data:rr}=await call$1(o,{data:Ut,to:a,...tr});return decodeFunctionResult$2({abi:s,args:rt,functionName:ot,data:rr||"0x"})}catch(rr){throw getContractError$2(rr,{abi:s,address:a,args:rt,docsPath:"/docs/contract/readContract",functionName:ot})}}async function simulateContract$2(o,{abi:s,address:a,args:rt,dataSuffix:ot,functionName:tr,...Ut}){const rr=Ut.account?parseAccount$2(Ut.account):void 0,nr=encodeFunctionData$2({abi:s,args:rt,functionName:tr});try{const{data:ir}=await call$1(o,{batch:!1,data:`${nr}${ot?ot.replace("0x",""):""}`,to:a,...Ut});return{result:decodeFunctionResult$2({abi:s,args:rt,functionName:tr,data:ir||"0x"}),request:{abi:s,address:a,args:rt,dataSuffix:ot,functionName:tr,...Ut}}}catch(ir){throw getContractError$2(ir,{abi:s,address:a,args:rt,docsPath:"/docs/contract/simulateContract",functionName:tr,sender:rr==null?void 0:rr.address})}}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe$1(o,s,a){const rt=++callbackCount,ot=()=>listenersCache.get(o)||[],tr=()=>{const sr=ot();listenersCache.set(o,sr.filter(ar=>ar.id!==rt))},Ut=()=>{const sr=cleanupCache.get(o);ot().length===1&&sr&&sr(),tr()},rr=ot();if(listenersCache.set(o,[...rr,{id:rt,fns:s}]),rr&&rr.length>0)return Ut;const nr={};for(const sr in s)nr[sr]=(...ar)=>{const ur=ot();ur.length!==0&&ur.forEach(cr=>{var lr,hr;return(hr=(lr=cr.fns)[sr])==null?void 0:hr.call(lr,...ar)})};const ir=a(nr);return typeof ir=="function"&&cleanupCache.set(o,ir),Ut}async function wait$2(o){return new Promise(s=>setTimeout(s,o))}function poll$2(o,{emitOnBegin:s,initialWaitTime:a,interval:rt}){let ot=!0;const tr=()=>ot=!1;return(async()=>{let rr;s&&(rr=await o({unpoll:tr}));const nr=await(a==null?void 0:a(rr))??rt;await wait$2(nr);const ir=async()=>{ot&&(await o({unpoll:tr}),await wait$2(rt),ir())};ir()})(),tr}const promiseCache=new Map,responseCache=new Map;function getCache(o){const s=(ot,tr)=>({clear:()=>tr.delete(ot),get:()=>tr.get(ot),set:Ut=>tr.set(ot,Ut)}),a=s(o,promiseCache),rt=s(o,responseCache);return{clear:()=>{a.clear(),rt.clear()},promise:a,response:rt}}async function withCache$1(o,{cacheKey:s,cacheTime:a=1/0}){const rt=getCache(s),ot=rt.response.get();if(ot&&a>0&&new Date().getTime()-ot.created.getTime()`blockNumber.${o}`;async function getBlockNumber$2(o,{cacheTime:s=o.cacheTime,maxAge:a}={}){const rt=await withCache$1(()=>o.request({method:"eth_blockNumber"}),{cacheKey:cacheKey$1(o.uid),cacheTime:a??s});return BigInt(rt)}async function getFilterChanges$2(o,{filter:s}){const a="strict"in s&&s.strict;return(await s.request({method:"eth_getFilterChanges",params:[s.id]})).map(ot=>{var tr;if(typeof ot=="string")return ot;try{const{eventName:Ut,args:rr}="abi"in s&&s.abi?decodeEventLog$2({abi:s.abi,data:ot.data,topics:ot.topics,strict:a}):{eventName:void 0,args:void 0};return formatLog$1(ot,{args:rr,eventName:Ut})}catch(Ut){let rr,nr;if(Ut instanceof DecodeLogDataMismatch||Ut instanceof DecodeLogTopicsMismatch){if("strict"in s&&s.strict)return;rr=Ut.abiItem.name,nr=(tr=Ut.abiItem.inputs)==null?void 0:tr.some(ir=>!("name"in ir&&ir.name))}return formatLog$1(ot,{args:nr?[]:{},eventName:rr})}}).filter(Boolean)}async function uninstallFilter$2(o,{filter:s}){return s.request({method:"eth_uninstallFilter",params:[s.id]})}function watchContractEvent$2(o,{abi:s,address:a,args:rt,batch:ot=!0,eventName:tr,onError:Ut,onLogs:rr,poll:nr,pollingInterval:ir=o.pollingInterval,strict:sr}){return(typeof nr<"u"?nr:o.transport.type!=="webSocket")?(()=>{const lr=stringify$2(["watchContractEvent",a,rt,ot,o.uid,tr,ir]),hr=sr??!1;return observe$1(lr,{onLogs:rr,onError:Ut},gr=>{let vr,fr,br=!1;const wr=poll$2(async()=>{var $r;if(!br){try{fr=await createContractEventFilter$2(o,{abi:s,address:a,args:rt,eventName:tr,strict:hr})}catch{}br=!0;return}try{let _r;if(fr)_r=await getFilterChanges$2(o,{filter:fr});else{const yr=await getBlockNumber$2(o);vr&&vr!==yr?_r=await getContractEvents$2(o,{abi:s,address:a,args:rt,fromBlock:vr+1n,toBlock:yr,strict:hr}):_r=[],vr=yr}if(_r.length===0)return;ot?gr.onLogs(_r):_r.forEach(yr=>gr.onLogs([yr]))}catch(_r){fr&&_r instanceof InvalidInputRpcError$1&&(br=!1),($r=gr.onError)==null||$r.call(gr,_r)}},{emitOnBegin:!0,interval:ir});return async()=>{fr&&await uninstallFilter$2(o,{filter:fr}),wr()}})})():(()=>{let lr=!0,hr=()=>lr=!1;return(async()=>{try{const gr=tr?encodeEventTopics$2({abi:s,eventName:tr,args:rt}):[],{unsubscribe:vr}=await o.transport.subscribe({params:["logs",{address:a,topics:gr}],onData(fr){var wr;if(!lr)return;const br=fr.result;try{const{eventName:$r,args:_r}=decodeEventLog$2({abi:s,data:br.data,topics:br.topics,strict:sr}),yr=formatLog$1(br,{args:_r,eventName:$r});rr([yr])}catch($r){let _r,yr;if($r instanceof DecodeLogDataMismatch||$r instanceof DecodeLogTopicsMismatch){if(sr)return;_r=$r.abiItem.name,yr=(wr=$r.abiItem.inputs)==null?void 0:wr.some(kr=>!("name"in kr&&kr.name))}const Sr=formatLog$1(br,{args:yr?[]:{},eventName:_r});rr([Sr])}},onError(fr){Ut==null||Ut(fr)}});hr=vr,lr||hr()}catch(gr){Ut==null||Ut(gr)}})(),hr})()}function getTransactionError$2(o,{docsPath:s,...a}){const rt=(()=>{const ot=getNodeError$2(o,a);return ot instanceof UnknownNodeError$1?o:ot})();return new TransactionExecutionError$1(rt,{docsPath:s,...a})}async function getChainId$2(o){const s=await o.request({method:"eth_chainId"});return hexToNumber$1(s)}async function sendRawTransaction$2(o,{serializedTransaction:s}){return o.request({method:"eth_sendRawTransaction",params:[s]})}async function sendTransaction$3(o,s){var hr,gr,vr;const{account:a=o.account,chain:rt=o.chain,accessList:ot,data:tr,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur,...cr}=s;if(!a)throw new AccountNotFoundError$1({docsPath:"/docs/actions/wallet/sendTransaction"});const lr=parseAccount$2(a);try{assertRequest$2(s);let fr;if(rt!==null&&(fr=await getChainId$2(o),assertCurrentChain$1({currentChainId:fr,chain:rt})),lr.type==="local"){const $r=await prepareTransactionRequest$1(o,{account:lr,accessList:ot,chain:rt,data:tr,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur,...cr});fr||(fr=await getChainId$2(o));const _r=(hr=rt==null?void 0:rt.serializers)==null?void 0:hr.transaction,yr=await lr.signTransaction({...$r,chainId:fr},{serializer:_r});return await sendRawTransaction$2(o,{serializedTransaction:yr})}const br=((vr=(gr=rt==null?void 0:rt.formatters)==null?void 0:gr.transactionRequest)==null?void 0:vr.format)||formatTransactionRequest,wr=br({...extract$2(cr,{format:br}),accessList:ot,data:tr,from:lr.address,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur});return await o.request({method:"eth_sendTransaction",params:[wr]})}catch(fr){throw getTransactionError$2(fr,{...s,account:lr,chain:s.chain||void 0})}}async function writeContract$3(o,{abi:s,address:a,args:rt,dataSuffix:ot,functionName:tr,...Ut}){const rr=encodeFunctionData$2({abi:s,args:rt,functionName:tr});return await sendTransaction$3(o,{data:`${rr}${ot?ot.replace("0x",""):""}`,to:a,...Ut})}async function addChain$2(o,{chain:s}){const{id:a,name:rt,nativeCurrency:ot,rpcUrls:tr,blockExplorers:Ut}=s;await o.request({method:"wallet_addEthereumChain",params:[{chainId:numberToHex(a),chainName:rt,nativeCurrency:ot,rpcUrls:tr.default.http,blockExplorerUrls:Ut?Object.values(Ut).map(({url:rr})=>rr):void 0}]})}const size$3=256;let index$1=size$3,buffer$1;function uid$2(o=11){if(!buffer$1||index$1+o>size$3*2){buffer$1="",index$1=0;for(let s=0;s{const vr=gr(hr);for(const br in cr)delete vr[br];const fr={...hr,...vr};return Object.assign(fr,{extend:lr(fr)})}}return Object.assign(cr,{extend:lr(cr)})}function withRetry$2(o,{delay:s=100,retryCount:a=2,shouldRetry:rt=()=>!0}={}){return new Promise((ot,tr)=>{const Ut=async({count:rr=0}={})=>{const nr=async({error:ir})=>{const sr=typeof s=="function"?s({count:rr,error:ir}):s;sr&&await wait$2(sr),Ut({count:rr+1})};try{const ir=await o();ot(ir)}catch(ir){if(rr"code"in o?o.code!==-1&&o.code!==-32004&&o.code!==-32005&&o.code!==-32042&&o.code!==-32603:o instanceof HttpRequestError$1&&o.status?o.status!==403&&o.status!==408&&o.status!==413&&o.status!==429&&o.status!==500&&o.status!==502&&o.status!==503&&o.status!==504:!1;function buildRequest$1(o,{retryDelay:s=150,retryCount:a=3}={}){return async rt=>withRetry$2(async()=>{try{return await o(rt)}catch(ot){const tr=ot;switch(tr.code){case ParseRpcError$1.code:throw new ParseRpcError$1(tr);case InvalidRequestRpcError$1.code:throw new InvalidRequestRpcError$1(tr);case MethodNotFoundRpcError$1.code:throw new MethodNotFoundRpcError$1(tr);case InvalidParamsRpcError$1.code:throw new InvalidParamsRpcError$1(tr);case InternalRpcError$1.code:throw new InternalRpcError$1(tr);case InvalidInputRpcError$1.code:throw new InvalidInputRpcError$1(tr);case ResourceNotFoundRpcError$1.code:throw new ResourceNotFoundRpcError$1(tr);case ResourceUnavailableRpcError$1.code:throw new ResourceUnavailableRpcError$1(tr);case TransactionRejectedRpcError$1.code:throw new TransactionRejectedRpcError$1(tr);case MethodNotSupportedRpcError$1.code:throw new MethodNotSupportedRpcError$1(tr);case LimitExceededRpcError$1.code:throw new LimitExceededRpcError$1(tr);case JsonRpcVersionUnsupportedError$1.code:throw new JsonRpcVersionUnsupportedError$1(tr);case UserRejectedRequestError$1.code:throw new UserRejectedRequestError$1(tr);case UnauthorizedProviderError$1.code:throw new UnauthorizedProviderError$1(tr);case UnsupportedProviderMethodError$1.code:throw new UnsupportedProviderMethodError$1(tr);case ProviderDisconnectedError$1.code:throw new ProviderDisconnectedError$1(tr);case ChainDisconnectedError$1.code:throw new ChainDisconnectedError$1(tr);case SwitchChainError$1.code:throw new SwitchChainError$1(tr);case 5e3:throw new UserRejectedRequestError$1(tr);default:throw ot instanceof BaseError$2?ot:new UnknownRpcError$1(tr)}}},{delay:({count:ot,error:tr})=>{var Ut;if(tr&&tr instanceof HttpRequestError$1){const rr=(Ut=tr==null?void 0:tr.headers)==null?void 0:Ut.get("Retry-After");if(rr!=null&&rr.match(/\d/))return parseInt(rr)*1e3}return~~(1<!isDeterministicError(ot)})}function createTransport$2({key:o,name:s,request:a,retryCount:rt=3,retryDelay:ot=150,timeout:tr,type:Ut},rr){return{config:{key:o,name:s,request:a,retryCount:rt,retryDelay:ot,timeout:tr,type:Ut},request:buildRequest$1(a,{retryCount:rt,retryDelay:ot}),value:rr}}function custom$2(o,s={}){const{key:a="custom",name:rt="Custom Provider",retryDelay:ot}=s;return({retryCount:tr})=>createTransport$2({key:a,name:rt,request:o.request.bind(o),retryCount:s.retryCount??tr,retryDelay:ot,type:"custom"})}function fallback$2(o,s={}){const{key:a="fallback",name:rt="Fallback",rank:ot=!1,retryCount:tr,retryDelay:Ut}=s;return({chain:rr,pollingInterval:nr=4e3,timeout:ir})=>{let sr=o,ar=()=>{};const ur=createTransport$2({key:a,name:rt,async request({method:cr,params:lr}){const hr=async(gr=0)=>{const vr=sr[gr]({chain:rr,retryCount:0,timeout:ir});try{const fr=await vr.request({method:cr,params:lr});return ar({method:cr,params:lr,response:fr,transport:vr,status:"success"}),fr}catch(fr){if(ar({error:fr,method:cr,params:lr,transport:vr,status:"error"}),isDeterministicError(fr)||gr===sr.length-1)throw fr;return hr(gr+1)}};return hr()},retryCount:tr,retryDelay:Ut,type:"fallback"},{onResponse:cr=>ar=cr,transports:sr.map(cr=>cr({chain:rr,retryCount:0}))});if(ot){const cr=typeof ot=="object"?ot:{};rankTransports$1({chain:rr,interval:cr.interval??nr,onTransports:lr=>sr=lr,sampleCount:cr.sampleCount,timeout:cr.timeout,transports:sr,weights:cr.weights})}return ur}}function rankTransports$1({chain:o,interval:s=4e3,onTransports:a,sampleCount:rt=10,timeout:ot=1e3,transports:tr,weights:Ut={}}){const{stability:rr=.7,latency:nr=.3}=Ut,ir=[],sr=async()=>{const ar=await Promise.all(tr.map(async lr=>{const hr=lr({chain:o,retryCount:0,timeout:ot}),gr=Date.now();let vr,fr;try{await hr.request({method:"net_listening"}),fr=1}catch{fr=0}finally{vr=Date.now()}return{latency:vr-gr,success:fr}}));ir.push(ar),ir.length>rt&&ir.shift();const ur=Math.max(...ir.map(lr=>Math.max(...lr.map(({latency:hr})=>hr)))),cr=tr.map((lr,hr)=>{const gr=ir.map($r=>$r[hr].latency),fr=1-gr.reduce(($r,_r)=>$r+_r,0)/gr.length/ur,br=ir.map($r=>$r[hr].success),wr=br.reduce(($r,_r)=>$r+_r,0)/br.length;return wr===0?[0,hr]:[nr*fr+rr*wr,hr]}).sort((lr,hr)=>hr[0]-lr[0]);a(cr.map(([,lr])=>tr[lr])),await wait$2(s),sr()};sr()}let UrlRequiredError$1=class extends BaseError$2{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}};function getNativeWebSocket(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const WebSocket$1=getNativeWebSocket(),native=Object.freeze(Object.defineProperty({__proto__:null,WebSocket:WebSocket$1},Symbol.toStringTag,{value:"Module"}));function withTimeout$2(o,{errorInstance:s=new Error("timed out"),timeout:a,signal:rt}){return new Promise((ot,tr)=>{(async()=>{let Ut;try{const rr=new AbortController;a>0&&(Ut=setTimeout(()=>{rt?rr.abort():tr(s)},a)),ot(await o({signal:rr==null?void 0:rr.signal}))}catch(rr){rr.name==="AbortError"&&tr(s),tr(rr)}finally{clearTimeout(Ut)}})()})}let id=0;async function http$3(o,{body:s,fetchOptions:a={},timeout:rt=1e4}){var rr;const{headers:ot,method:tr,signal:Ut}=a;try{const nr=await withTimeout$2(async({signal:sr})=>await fetch(o,{...a,body:Array.isArray(s)?stringify$2(s.map(ur=>({jsonrpc:"2.0",id:ur.id??id++,...ur}))):stringify$2({jsonrpc:"2.0",id:s.id??id++,...s}),headers:{...ot,"Content-Type":"application/json"},method:tr||"POST",signal:Ut||(rt>0?sr:void 0)}),{errorInstance:new TimeoutError$1({body:s,url:o}),timeout:rt,signal:!0});let ir;if((rr=nr.headers.get("Content-Type"))!=null&&rr.startsWith("application/json")?ir=await nr.json():ir=await nr.text(),!nr.ok)throw new HttpRequestError$1({body:s,details:stringify$2(ir.error)||nr.statusText,headers:nr.headers,status:nr.status,url:o});return ir}catch(nr){throw nr instanceof HttpRequestError$1||nr instanceof TimeoutError$1?nr:new HttpRequestError$1({body:s,details:nr.message,url:o})}}const socketsCache=new Map;async function getSocket(o){let s=socketsCache.get(o);if(s)return s;const{schedule:a}=createBatchScheduler$2({id:o,fn:async()=>{const tr=new WebSocket$1(o),Ut=new Map,rr=new Map,nr=({data:sr})=>{const ar=JSON.parse(sr),ur=ar.method==="eth_subscription",cr=ur?ar.params.subscription:ar.id,lr=ur?rr:Ut,hr=lr.get(cr);hr&&hr({data:sr}),ur||lr.delete(cr)},ir=()=>{socketsCache.delete(o),tr.removeEventListener("close",ir),tr.removeEventListener("message",nr)};return tr.addEventListener("close",ir),tr.addEventListener("message",nr),tr.readyState===WebSocket$1.CONNECTING&&await new Promise((sr,ar)=>{tr&&(tr.onopen=sr,tr.onerror=ar)}),s=Object.assign(tr,{requests:Ut,subscriptions:rr}),socketsCache.set(o,s),[s]}}),[rt,[ot]]=await a();return ot}function webSocket$3(o,{body:s,onResponse:a}){if(o.readyState===o.CLOSED||o.readyState===o.CLOSING)throw new WebSocketRequestError$1({body:s,url:o.url,details:"Socket is closed."});const rt=id++,ot=({data:tr})=>{var rr;const Ut=JSON.parse(tr);typeof Ut.id=="number"&&rt!==Ut.id||(a==null||a(Ut),s.method==="eth_subscribe"&&typeof Ut.result=="string"&&o.subscriptions.set(Ut.result,ot),s.method==="eth_unsubscribe"&&o.subscriptions.delete((rr=s.params)==null?void 0:rr[0]))};return o.requests.set(rt,ot),o.send(JSON.stringify({jsonrpc:"2.0",...s,id:rt})),o}async function webSocketAsync(o,{body:s,timeout:a=1e4}){return withTimeout$2(()=>new Promise(rt=>rpc$3.webSocket(o,{body:s,onResponse:rt})),{errorInstance:new TimeoutError$1({body:s,url:o.url}),timeout:a})}const rpc$3={http:http$3,webSocket:webSocket$3,webSocketAsync};function http$2(o,s={}){const{batch:a,fetchOptions:rt,key:ot="http",name:tr="HTTP JSON-RPC",retryDelay:Ut}=s;return({chain:rr,retryCount:nr,timeout:ir})=>{const{batchSize:sr=1e3,wait:ar=0}=typeof a=="object"?a:{},ur=s.retryCount??nr,cr=ir??s.timeout??1e4,lr=o||(rr==null?void 0:rr.rpcUrls.default.http[0]);if(!lr)throw new UrlRequiredError$1;return createTransport$2({key:ot,name:tr,async request({method:hr,params:gr}){const vr={method:hr,params:gr},{schedule:fr}=createBatchScheduler$2({id:`${o}`,wait:ar,shouldSplitBatch(_r){return _r.length>sr},fn:_r=>rpc$3.http(lr,{body:_r,fetchOptions:rt,timeout:cr})}),br=async _r=>a?fr(_r):[await rpc$3.http(lr,{body:_r,fetchOptions:rt,timeout:cr})],[{error:wr,result:$r}]=await br(vr);if(wr)throw new RpcRequestError$1({body:vr,error:wr,url:lr});return $r},retryCount:ur,retryDelay:Ut,timeout:cr,type:"http"},{fetchOptions:rt,url:o})}}function isNullUniversalResolverError$1(o,s){var rt,ot,tr;if(!(o instanceof BaseError$2))return!1;const a=o.walk(Ut=>Ut instanceof ContractFunctionRevertedError$1);return a instanceof ContractFunctionRevertedError$1?!!(((rt=a.data)==null?void 0:rt.errorName)==="ResolverNotFound"||((ot=a.data)==null?void 0:ot.errorName)==="ResolverWildcardNotSupported"||(tr=a.reason)!=null&&tr.includes("Wildcard on non-extended resolvers is not supported")||s==="reverse"&&a.reason===panicReasons[50]):!1}function encodedLabelToLabelhash$2(o){if(o.length!==66||o.indexOf("[")!==0||o.indexOf("]")!==65)return null;const s=`0x${o.slice(1,65)}`;return isHex$2(s)?s:null}function namehash$2(o){let s=new Uint8Array(32).fill(0);if(!o)return bytesToHex$1(s);const a=o.split(".");for(let rt=a.length-1;rt>=0;rt-=1){const ot=encodedLabelToLabelhash$2(a[rt]),tr=ot?toBytes$2(ot):keccak256$2(stringToBytes(a[rt]),"bytes");s=keccak256$2(concat$3([s,tr]),"bytes")}return bytesToHex$1(s)}function encodeLabelhash$2(o){return`[${o.slice(2)}]`}function labelhash$2(o){const s=new Uint8Array(32).fill(0);return o?encodedLabelToLabelhash$2(o)||keccak256$2(stringToBytes(o)):bytesToHex$1(s)}function packetToBytes$2(o){const s=o.replace(/^\.|\.$/gm,"");if(s.length===0)return new Uint8Array(1);const a=new Uint8Array(stringToBytes(s).byteLength+2);let rt=0;const ot=s.split(".");for(let tr=0;tr255&&(Ut=stringToBytes(encodeLabelhash$2(labelhash$2(ot[tr])))),a[rt]=Ut.length,a.set(Ut,rt+1),rt+=Ut.length+1}return a.byteLength!==rt+1?a.slice(0,rt+1):a}async function getEnsAddress$2(o,{blockNumber:s,blockTag:a,coinType:rt,name:ot,universalResolverAddress:tr}){let Ut=tr;if(!Ut){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");Ut=getChainContractAddress$1({blockNumber:s,chain:o.chain,contract:"ensUniversalResolver"})}try{const rr=encodeFunctionData$2({abi:addressResolverAbi,functionName:"addr",...rt!=null?{args:[namehash$2(ot),BigInt(rt)]}:{args:[namehash$2(ot)]}}),nr=await readContract$3(o,{address:Ut,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex$1(packetToBytes$2(ot)),rr],blockNumber:s,blockTag:a});if(nr[0]==="0x")return null;const ir=decodeFunctionResult$2({abi:addressResolverAbi,args:rt!=null?[namehash$2(ot),BigInt(rt)]:void 0,functionName:"addr",data:nr[0]});return ir==="0x"||trim$2(ir)==="0x00"?null:ir}catch(rr){if(isNullUniversalResolverError$1(rr,"resolve"))return null;throw rr}}let EnsAvatarInvalidMetadataError$1=class extends BaseError$2{constructor({data:s}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},EnsAvatarInvalidNftUriError$1=class extends BaseError$2{constructor({reason:s}){super(`ENS NFT avatar URI is invalid. ${s}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},EnsAvatarUriResolutionError$1=class extends BaseError$2{constructor({uri:s}){super(`Unable to resolve ENS avatar URI "${s}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},EnsAvatarUnsupportedNamespaceError$1=class extends BaseError$2{constructor({namespace:s}){super(`ENS NFT avatar namespace "${s}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};const networkRegex$1=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ipfsHashRegex$1=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,base64Regex$1=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex$1=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri$1(o){try{const s=await fetch(o,{method:"HEAD"});if(s.status===200){const a=s.headers.get("content-type");return a==null?void 0:a.startsWith("image/")}return!1}catch(s){return typeof s=="object"&&typeof s.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(a=>{const rt=new Image;rt.onload=()=>{a(!0)},rt.onerror=()=>{a(!1)},rt.src=o})}}function getGateway$1(o,s){return o?o.endsWith("/")?o.slice(0,-1):o:s}function resolveAvatarUri$1({uri:o,gatewayUrls:s}){const a=base64Regex$1.test(o);if(a)return{uri:o,isOnChain:!0,isEncoded:a};const rt=getGateway$1(s==null?void 0:s.ipfs,"https://ipfs.io"),ot=getGateway$1(s==null?void 0:s.arweave,"https://arweave.net"),tr=o.match(networkRegex$1),{protocol:Ut,subpath:rr,target:nr,subtarget:ir=""}=(tr==null?void 0:tr.groups)||{},sr=Ut==="ipns:/"||rr==="ipns/",ar=Ut==="ipfs:/"||rr==="ipfs/"||ipfsHashRegex$1.test(o);if(o.startsWith("http")&&!sr&&!ar){let cr=o;return s!=null&&s.arweave&&(cr=o.replace(/https:\/\/arweave.net/g,s==null?void 0:s.arweave)),{uri:cr,isOnChain:!1,isEncoded:!1}}if((sr||ar)&&nr)return{uri:`${rt}/${sr?"ipns":"ipfs"}/${nr}${ir}`,isOnChain:!1,isEncoded:!1};if(Ut==="ar:/"&&nr)return{uri:`${ot}/${nr}${ir||""}`,isOnChain:!1,isEncoded:!1};let ur=o.replace(dataURIRegex$1,"");if(ur.startsWith("ot.json());return await parseAvatarUri$1({gatewayUrls:o,uri:getJsonImage$1(a)})}catch{throw new EnsAvatarUriResolutionError$1({uri:s})}}async function parseAvatarUri$1({gatewayUrls:o,uri:s}){const{uri:a,isOnChain:rt}=resolveAvatarUri$1({uri:s,gatewayUrls:o});if(rt||await isImageUri$1(a))return a;throw new EnsAvatarUriResolutionError$1({uri:s})}function parseNftUri$1(o){let s=o;s.startsWith("did:nft:")&&(s=s.replace("did:nft:","").replace(/_/g,"/"));const[a,rt,ot]=s.split("/"),[tr,Ut]=a.split(":"),[rr,nr]=rt.split(":");if(!tr||tr.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError$1({reason:"Only EIP-155 supported"});if(!Ut)throw new EnsAvatarInvalidNftUriError$1({reason:"Chain ID not found"});if(!nr)throw new EnsAvatarInvalidNftUriError$1({reason:"Contract address not found"});if(!ot)throw new EnsAvatarInvalidNftUriError$1({reason:"Token ID not found"});if(!rr)throw new EnsAvatarInvalidNftUriError$1({reason:"ERC namespace not found"});return{chainID:parseInt(Ut),namespace:rr.toLowerCase(),contractAddress:nr,tokenID:ot}}async function getNftTokenUri$1(o,{nft:s}){if(s.namespace==="erc721")return readContract$3(o,{address:s.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(s.tokenID)]});if(s.namespace==="erc1155")return readContract$3(o,{address:s.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(s.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError$1({namespace:s.namespace})}async function parseAvatarRecord$2(o,{gatewayUrls:s,record:a}){return/eip155:/i.test(a)?parseNftAvatarUri$1(o,{gatewayUrls:s,record:a}):parseAvatarUri$1({uri:a,gatewayUrls:s})}async function parseNftAvatarUri$1(o,{gatewayUrls:s,record:a}){const rt=parseNftUri$1(a),ot=await getNftTokenUri$1(o,{nft:rt}),{uri:tr,isOnChain:Ut,isEncoded:rr}=resolveAvatarUri$1({uri:ot,gatewayUrls:s});if(Ut&&(tr.includes("data:application/json;base64,")||tr.startsWith("{"))){const ir=rr?atob(tr.replace("data:application/json;base64,","")):tr,sr=JSON.parse(ir);return parseAvatarUri$1({uri:getJsonImage$1(sr),gatewayUrls:s})}let nr=rt.tokenID;return rt.namespace==="erc1155"&&(nr=nr.replace("0x","").padStart(64,"0")),getMetadataAvatarUri$1({gatewayUrls:s,uri:tr.replace(/(?:0x)?{id}/,nr)})}async function getEnsText$2(o,{blockNumber:s,blockTag:a,name:rt,key:ot,universalResolverAddress:tr}){let Ut=tr;if(!Ut){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");Ut=getChainContractAddress$1({blockNumber:s,chain:o.chain,contract:"ensUniversalResolver"})}try{const rr=await readContract$3(o,{address:Ut,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex$1(packetToBytes$2(rt)),encodeFunctionData$2({abi:textResolverAbi,functionName:"text",args:[namehash$2(rt),ot]})],blockNumber:s,blockTag:a});if(rr[0]==="0x")return null;const nr=decodeFunctionResult$2({abi:textResolverAbi,functionName:"text",data:rr[0]});return nr===""?null:nr}catch(rr){if(isNullUniversalResolverError$1(rr,"resolve"))return null;throw rr}}async function getEnsAvatar$2(o,{blockNumber:s,blockTag:a,gatewayUrls:rt,name:ot,universalResolverAddress:tr}){const Ut=await getEnsText$2(o,{blockNumber:s,blockTag:a,key:"avatar",name:ot,universalResolverAddress:tr});if(!Ut)return null;try{return await parseAvatarRecord$2(o,{record:Ut,gatewayUrls:rt})}catch{return null}}async function getEnsName$2(o,{address:s,blockNumber:a,blockTag:rt,universalResolverAddress:ot}){let tr=ot;if(!tr){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");tr=getChainContractAddress$1({blockNumber:a,chain:o.chain,contract:"ensUniversalResolver"})}const Ut=`${s.toLowerCase().substring(2)}.addr.reverse`;try{return(await readContract$3(o,{address:tr,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex$1(packetToBytes$2(Ut))],blockNumber:a,blockTag:rt}))[0]}catch(rr){if(isNullUniversalResolverError$1(rr,"reverse"))return null;throw rr}}async function getEnsResolver$2(o,{blockNumber:s,blockTag:a,name:rt,universalResolverAddress:ot}){let tr=ot;if(!tr){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");tr=getChainContractAddress$1({blockNumber:s,chain:o.chain,contract:"ensUniversalResolver"})}const[Ut]=await readContract$3(o,{address:tr,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[toHex$1(packetToBytes$2(rt))],blockNumber:s,blockTag:a});return Ut}async function createBlockFilter$2(o){const s=createFilterRequestScope$2(o,{method:"eth_newBlockFilter"}),a=await o.request({method:"eth_newBlockFilter"});return{id:a,request:s(a),type:"block"}}async function createEventFilter$2(o,{address:s,args:a,event:rt,events:ot,fromBlock:tr,strict:Ut,toBlock:rr}={}){const nr=ot??(rt?[rt]:void 0),ir=createFilterRequestScope$2(o,{method:"eth_newFilter"});let sr=[];nr&&(sr=[nr.flatMap(ur=>encodeEventTopics$2({abi:[ur],eventName:ur.name,args:a}))],rt&&(sr=sr[0]));const ar=await o.request({method:"eth_newFilter",params:[{address:s,fromBlock:typeof tr=="bigint"?numberToHex(tr):tr,toBlock:typeof rr=="bigint"?numberToHex(rr):rr,...sr.length?{topics:sr}:{}}]});return{abi:nr,args:a,eventName:rt?rt.name:void 0,fromBlock:tr,id:ar,request:ir(ar),strict:Ut,toBlock:rr,type:"event"}}async function createPendingTransactionFilter$2(o){const s=createFilterRequestScope$2(o,{method:"eth_newPendingTransactionFilter"}),a=await o.request({method:"eth_newPendingTransactionFilter"});return{id:a,request:s(a),type:"transaction"}}async function getBalance$2(o,{address:s,blockNumber:a,blockTag:rt="latest"}){const ot=a?numberToHex(a):void 0,tr=await o.request({method:"eth_getBalance",params:[s,ot||rt]});return BigInt(tr)}async function getBlockTransactionCount$2(o,{blockHash:s,blockNumber:a,blockTag:rt="latest"}={}){const ot=a!==void 0?numberToHex(a):void 0;let tr;return s?tr=await o.request({method:"eth_getBlockTransactionCountByHash",params:[s]}):tr=await o.request({method:"eth_getBlockTransactionCountByNumber",params:[ot||rt]}),hexToNumber$1(tr)}async function getBytecode$2(o,{address:s,blockNumber:a,blockTag:rt="latest"}){const ot=a!==void 0?numberToHex(a):void 0,tr=await o.request({method:"eth_getCode",params:[s,ot||rt]});if(tr!=="0x")return tr}function formatFeeHistory$1(o){var s;return{baseFeePerGas:o.baseFeePerGas.map(a=>BigInt(a)),gasUsedRatio:o.gasUsedRatio,oldestBlock:BigInt(o.oldestBlock),reward:(s=o.reward)==null?void 0:s.map(a=>a.map(rt=>BigInt(rt)))}}async function getFeeHistory$2(o,{blockCount:s,blockNumber:a,blockTag:rt="latest",rewardPercentiles:ot}){const tr=a?numberToHex(a):void 0,Ut=await o.request({method:"eth_feeHistory",params:[numberToHex(s),tr||rt,ot]});return formatFeeHistory$1(Ut)}async function getFilterLogs$2(o,{filter:s}){const a=s.strict??!1;return(await s.request({method:"eth_getFilterLogs",params:[s.id]})).map(ot=>{var tr;try{const{eventName:Ut,args:rr}="abi"in s&&s.abi?decodeEventLog$2({abi:s.abi,data:ot.data,topics:ot.topics,strict:a}):{eventName:void 0,args:void 0};return formatLog$1(ot,{args:rr,eventName:Ut})}catch(Ut){let rr,nr;if(Ut instanceof DecodeLogDataMismatch||Ut instanceof DecodeLogTopicsMismatch){if("strict"in s&&s.strict)return;rr=Ut.abiItem.name,nr=(tr=Ut.abiItem.inputs)==null?void 0:tr.some(ir=>!("name"in ir&&ir.name))}return formatLog$1(ot,{args:nr?[]:{},eventName:rr})}}).filter(Boolean)}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function hashTypedData$1({domain:o,message:s,primaryType:a,types:rt}){const ot=typeof o>"u"?{}:o,tr={EIP712Domain:getTypesForEIP712Domain({domain:ot}),...rt};validateTypedData({domain:ot,message:s,primaryType:a,types:tr});const Ut=["0x1901"];return ot&&Ut.push(hashDomain({domain:ot,types:tr})),a!=="EIP712Domain"&&Ut.push(hashStruct({data:s,primaryType:a,types:tr})),keccak256$2(concat$3(Ut))}function hashDomain({domain:o,types:s}){return hashStruct({data:o,primaryType:"EIP712Domain",types:s})}function hashStruct({data:o,primaryType:s,types:a}){const rt=encodeData({data:o,primaryType:s,types:a});return keccak256$2(rt)}function encodeData({data:o,primaryType:s,types:a}){const rt=[{type:"bytes32"}],ot=[hashType({primaryType:s,types:a})];for(const tr of a[s]){const[Ut,rr]=encodeField({types:a,name:tr.name,type:tr.type,value:o[tr.name]});rt.push(Ut),ot.push(rr)}return encodeAbiParameters$2(rt,ot)}function hashType({primaryType:o,types:s}){const a=toHex$1(encodeType({primaryType:o,types:s}));return keccak256$2(a)}function encodeType({primaryType:o,types:s}){let a="";const rt=findTypeDependencies({primaryType:o,types:s});rt.delete(o);const ot=[o,...Array.from(rt).sort()];for(const tr of ot)a+=`${tr}(${s[tr].map(({name:Ut,type:rr})=>`${rr} ${Ut}`).join(",")})`;return a}function findTypeDependencies({primaryType:o,types:s},a=new Set){const rt=o.match(/^\w*/u),ot=rt==null?void 0:rt[0];if(a.has(ot)||s[ot]===void 0)return a;a.add(ot);for(const tr of s[ot])findTypeDependencies({primaryType:tr.type,types:s},a);return a}function encodeField({types:o,name:s,type:a,value:rt}){if(o[a]!==void 0)return[{type:"bytes32"},keccak256$2(encodeData({data:rt,primaryType:a,types:o}))];if(a==="bytes")return rt=`0x${(rt.length%2?"0":"")+rt.slice(2)}`,[{type:"bytes32"},keccak256$2(rt)];if(a==="string")return[{type:"bytes32"},keccak256$2(toHex$1(rt))];if(a.lastIndexOf("]")===a.length-1){const ot=a.slice(0,a.lastIndexOf("[")),tr=rt.map(Ut=>encodeField({name:s,type:ot,types:o,value:Ut}));return[{type:"bytes32"},keccak256$2(encodeAbiParameters$2(tr.map(([Ut])=>Ut),tr.map(([,Ut])=>Ut)))]}return[{type:a},rt]}function validateTypedData({domain:o,message:s,primaryType:a,types:rt}){const ot=rt,tr=(Ut,rr)=>{for(const nr of Ut){const{name:ir,type:sr}=nr,ar=sr,ur=rr[ir],cr=ar.match(integerRegex);if(cr&&(typeof ur=="number"||typeof ur=="bigint")){const[gr,vr,fr]=cr;numberToHex(ur,{signed:vr==="int",size:parseInt(fr)/8})}if(ar==="address"&&typeof ur=="string"&&!isAddress$2(ur))throw new InvalidAddressError$1({address:ur});const lr=ar.match(bytesRegex);if(lr){const[gr,vr]=lr;if(vr&&size$4(ur)!==parseInt(vr))throw new BytesSizeMismatchError({expectedSize:parseInt(vr),givenSize:size$4(ur)})}const hr=ot[ar];hr&&tr(hr,ur)}};if(ot.EIP712Domain&&o&&tr(ot.EIP712Domain,o),a!=="EIP712Domain"){const Ut=ot[a];tr(Ut,s)}}function getTypesForEIP712Domain({domain:o}){return[typeof(o==null?void 0:o.name)=="string"&&{name:"name",type:"string"},(o==null?void 0:o.version)&&{name:"version",type:"string"},typeof(o==null?void 0:o.chainId)=="number"&&{name:"chainId",type:"uint256"},(o==null?void 0:o.verifyingContract)&&{name:"verifyingContract",type:"address"},(o==null?void 0:o.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const docsPath$6="/docs/contract/encodeDeployData";function encodeDeployData$2({abi:o,args:s,bytecode:a}){if(!s||s.length===0)return a;const rt=o.find(tr=>"type"in tr&&tr.type==="constructor");if(!rt)throw new AbiConstructorNotFoundError({docsPath:docsPath$6});if(!("inputs"in rt))throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$6});if(!rt.inputs||rt.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$6});const ot=encodeAbiParameters$2(rt.inputs,s);return concatHex$1([a,ot])}function hashMessage$2(o,s){const a=(()=>typeof o=="string"?stringToBytes(o):o.raw instanceof Uint8Array?o.raw:toBytes$2(o.raw))(),rt=stringToBytes(`Ethereum Signed Message: +`),{docsPath:s,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}},EstimateGasExecutionError$1=class extends BaseError$2{constructor(s,{account:a,docsPath:rt,chain:ot,data:tr,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur}){const cr=prettyPrint$1({from:a==null?void 0:a.address,to:ar,value:typeof ur<"u"&&`${formatEther$2(ur)} ${(ot==null?void 0:ot.nativeCurrency.symbol)||"ETH"}`,data:tr,gas:Ut,gasPrice:typeof rr<"u"&&`${formatGwei$2(rr)} gwei`,maxFeePerGas:typeof nr<"u"&&`${formatGwei$2(nr)} gwei`,maxPriorityFeePerGas:typeof ir<"u"&&`${formatGwei$2(ir)} gwei`,nonce:sr});super(s.shortMessage,{cause:s,docsPath:rt,metaMessages:[...s.metaMessages?[...s.metaMessages," "]:[],"Estimate Gas Arguments:",cr].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=s}};function getNodeError$2(o,s){const a=(o.details||"").toLowerCase(),rt=o.walk(ot=>ot.code===ExecutionRevertedError$1.code);return rt instanceof BaseError$2?new ExecutionRevertedError$1({cause:o,message:rt.details}):ExecutionRevertedError$1.nodeMessage.test(a)?new ExecutionRevertedError$1({cause:o,message:o.details}):FeeCapTooHighError$1.nodeMessage.test(a)?new FeeCapTooHighError$1({cause:o,maxFeePerGas:s==null?void 0:s.maxFeePerGas}):FeeCapTooLowError$1.nodeMessage.test(a)?new FeeCapTooLowError$1({cause:o,maxFeePerGas:s==null?void 0:s.maxFeePerGas}):NonceTooHighError$1.nodeMessage.test(a)?new NonceTooHighError$1({cause:o,nonce:s==null?void 0:s.nonce}):NonceTooLowError$1.nodeMessage.test(a)?new NonceTooLowError$1({cause:o,nonce:s==null?void 0:s.nonce}):NonceMaxValueError$1.nodeMessage.test(a)?new NonceMaxValueError$1({cause:o,nonce:s==null?void 0:s.nonce}):InsufficientFundsError$1.nodeMessage.test(a)?new InsufficientFundsError$1({cause:o}):IntrinsicGasTooHighError$1.nodeMessage.test(a)?new IntrinsicGasTooHighError$1({cause:o,gas:s==null?void 0:s.gas}):IntrinsicGasTooLowError$1.nodeMessage.test(a)?new IntrinsicGasTooLowError$1({cause:o,gas:s==null?void 0:s.gas}):TransactionTypeNotSupportedError$1.nodeMessage.test(a)?new TransactionTypeNotSupportedError$1({cause:o}):TipAboveFeeCapError$1.nodeMessage.test(a)?new TipAboveFeeCapError$1({cause:o,maxFeePerGas:s==null?void 0:s.maxFeePerGas,maxPriorityFeePerGas:s==null?void 0:s.maxPriorityFeePerGas}):new UnknownNodeError$1({cause:o})}function getEstimateGasError$2(o,{docsPath:s,...a}){const rt=(()=>{const ot=getNodeError$2(o,a);return ot instanceof UnknownNodeError$1?o:ot})();return new EstimateGasExecutionError$1(rt,{docsPath:s,...a})}function extract$2(o,{format:s}){return s?Object.keys(s({})).reduce((rt,ot)=>(o!=null&&o.hasOwnProperty(ot)&&(rt[ot]=o[ot]),rt),{}):{}}function assertRequest$2(o){const{account:s,gasPrice:a,maxFeePerGas:rt,maxPriorityFeePerGas:ot,to:tr}=o,Ut=s?parseAccount$2(s):void 0;if(Ut&&!isAddress$2(Ut.address))throw new InvalidAddressError$1({address:Ut.address});if(tr&&!isAddress$2(tr))throw new InvalidAddressError$1({address:tr});if(typeof a<"u"&&(typeof rt<"u"||typeof ot<"u"))throw new FeeConflictError$1;if(rt&&rt>2n**256n-1n)throw new FeeCapTooHighError$1({maxFeePerGas:rt});if(ot&&rt&&ot>rt)throw new TipAboveFeeCapError$1({maxFeePerGas:rt,maxPriorityFeePerGas:ot})}let BaseFeeScalarError$1=class extends BaseError$2{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}},Eip1559FeesNotSupportedError$1=class extends BaseError$2{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}},MaxFeePerGasTooLowError$1=class extends BaseError$2{constructor({maxPriorityFeePerGas:s}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei$2(s)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}},BlockNotFoundError$1=class extends BaseError$2{constructor({blockHash:s,blockNumber:a}){let rt="Block";s&&(rt=`Block at hash "${s}"`),a&&(rt=`Block at number "${a}"`),super(`${rt} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}};async function getBlock$2(o,{blockHash:s,blockNumber:a,blockTag:rt,includeTransactions:ot}={}){var sr,ar,ur;const tr=rt??"latest",Ut=ot??!1,rr=a!==void 0?numberToHex(a):void 0;let nr=null;if(s?nr=await o.request({method:"eth_getBlockByHash",params:[s,Ut]}):nr=await o.request({method:"eth_getBlockByNumber",params:[rr||tr,Ut]}),!nr)throw new BlockNotFoundError$1({blockHash:s,blockNumber:a});return(((ur=(ar=(sr=o.chain)==null?void 0:sr.formatters)==null?void 0:ar.block)==null?void 0:ur.format)||formatBlock$1)(nr)}async function getGasPrice$2(o){const s=await o.request({method:"eth_gasPrice"});return BigInt(s)}async function estimateMaxPriorityFeePerGas$2(o,s){return internal_estimateMaxPriorityFeePerGas$1(o,s)}async function internal_estimateMaxPriorityFeePerGas$1(o,s){var tr,Ut,rr;const{block:a,chain:rt=o.chain,request:ot}=s||{};if(typeof((tr=rt==null?void 0:rt.fees)==null?void 0:tr.defaultPriorityFee)=="function"){const nr=a||await getBlock$2(o);return rt.fees.defaultPriorityFee({block:nr,client:o,request:ot})}else if(typeof((Ut=rt==null?void 0:rt.fees)==null?void 0:Ut.defaultPriorityFee)<"u")return(rr=rt==null?void 0:rt.fees)==null?void 0:rr.defaultPriorityFee;try{const nr=await o.request({method:"eth_maxPriorityFeePerGas"});return hexToBigInt(nr)}catch{const[nr,ir]=await Promise.all([a?Promise.resolve(a):getBlock$2(o),getGasPrice$2(o)]);if(typeof nr.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError$1;const sr=ir-nr.baseFeePerGas;return sr<0n?0n:sr}}async function estimateFeesPerGas$2(o,s){return internal_estimateFeesPerGas$1(o,s)}async function internal_estimateFeesPerGas$1(o,s){var ur,cr;const{block:a,chain:rt=o.chain,request:ot,type:tr="eip1559"}=s||{},Ut=await(async()=>{var lr,hr;return typeof((lr=rt==null?void 0:rt.fees)==null?void 0:lr.baseFeeMultiplier)=="function"?rt.fees.baseFeeMultiplier({block:a,client:o,request:ot}):((hr=rt==null?void 0:rt.fees)==null?void 0:hr.baseFeeMultiplier)??1.2})();if(Ut<1)throw new BaseFeeScalarError$1;const nr=10**(((ur=Ut.toString().split(".")[1])==null?void 0:ur.length)??0),ir=lr=>lr*BigInt(Math.ceil(Ut*nr))/BigInt(nr),sr=a||await getBlock$2(o);if(typeof((cr=rt==null?void 0:rt.fees)==null?void 0:cr.estimateFeesPerGas)=="function")return rt.fees.estimateFeesPerGas({block:a,client:o,multiply:ir,request:ot,type:tr});if(tr==="eip1559"){if(typeof sr.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError$1;const lr=ot!=null&&ot.maxPriorityFeePerGas?ot.maxPriorityFeePerGas:await internal_estimateMaxPriorityFeePerGas$1(o,{block:sr,chain:rt,request:ot}),hr=ir(sr.baseFeePerGas);return{maxFeePerGas:(ot==null?void 0:ot.maxFeePerGas)??hr+lr,maxPriorityFeePerGas:lr}}return{gasPrice:(ot==null?void 0:ot.gasPrice)??ir(await getGasPrice$2(o))}}async function getTransactionCount$2(o,{address:s,blockTag:a="latest",blockNumber:rt}){const ot=await o.request({method:"eth_getTransactionCount",params:[s,rt?numberToHex(rt):a]});return hexToNumber$1(ot)}function getTransactionType$2(o){if(o.type)return o.type;if(typeof o.maxFeePerGas<"u"||typeof o.maxPriorityFeePerGas<"u")return"eip1559";if(typeof o.gasPrice<"u")return typeof o.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError$1({transaction:o})}async function prepareTransactionRequest$1(o,s){const{account:a=o.account,chain:rt,gas:ot,nonce:tr,type:Ut}=s;if(!a)throw new AccountNotFoundError$1;const rr=parseAccount$2(a),nr=await getBlock$2(o,{blockTag:"latest"}),ir={...s,from:rr.address};if(typeof tr>"u"&&(ir.nonce=await getTransactionCount$2(o,{address:rr.address,blockTag:"pending"})),typeof Ut>"u")try{ir.type=getTransactionType$2(ir)}catch{ir.type=typeof nr.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(ir.type==="eip1559"){const{maxFeePerGas:sr,maxPriorityFeePerGas:ar}=await internal_estimateFeesPerGas$1(o,{block:nr,chain:rt,request:ir});if(typeof s.maxPriorityFeePerGas>"u"&&s.maxFeePerGas&&s.maxFeePerGas"u"&&(ir.gas=await estimateGas$2(o,{...ir,account:{address:rr.address,type:"json-rpc"}})),assertRequest$2(ir),ir}async function estimateGas$2(o,s){var ot,tr,Ut;const a=s.account??o.account;if(!a)throw new AccountNotFoundError$1({docsPath:"/docs/actions/public/estimateGas"});const rt=parseAccount$2(a);try{const{accessList:rr,blockNumber:nr,blockTag:ir,data:sr,gas:ar,gasPrice:ur,maxFeePerGas:cr,maxPriorityFeePerGas:lr,nonce:hr,to:gr,value:vr,...fr}=rt.type==="local"?await prepareTransactionRequest$1(o,s):s,wr=(nr?numberToHex(nr):void 0)||ir;assertRequest$2(s);const $r=((Ut=(tr=(ot=o.chain)==null?void 0:ot.formatters)==null?void 0:tr.transactionRequest)==null?void 0:Ut.format)||formatTransactionRequest,_r=$r({...extract$2(fr,{format:$r}),from:rt.address,accessList:rr,data:sr,gas:ar,gasPrice:ur,maxFeePerGas:cr,maxPriorityFeePerGas:lr,nonce:hr,to:gr,value:vr}),yr=await o.request({method:"eth_estimateGas",params:wr?[_r,wr]:[_r]});return BigInt(yr)}catch(rr){throw getEstimateGasError$2(rr,{...s,account:rt,chain:o.chain})}}async function estimateContractGas$2(o,{abi:s,address:a,args:rt,functionName:ot,...tr}){const Ut=encodeFunctionData$2({abi:s,args:rt,functionName:ot});try{return await estimateGas$2(o,{data:Ut,to:a,...tr})}catch(rr){const nr=tr.account?parseAccount$2(tr.account):void 0;throw getContractError$2(rr,{abi:s,address:a,args:rt,docsPath:"/docs/contract/estimateContractGas",functionName:ot,sender:nr==null?void 0:nr.address})}}const docsPath$8="/docs/contract/decodeEventLog";function decodeEventLog$2({abi:o,data:s,strict:a,topics:rt}){const ot=a??!0,[tr,...Ut]=rt;if(!tr)throw new AbiEventSignatureEmptyTopicsError({docsPath:docsPath$8});const rr=o.find(lr=>lr.type==="event"&&tr===getEventSelector$2(formatAbiItem$1(lr)));if(!(rr&&"name"in rr)||rr.type!=="event")throw new AbiEventSignatureNotFoundError(tr,{docsPath:docsPath$8});const{name:nr,inputs:ir}=rr,sr=ir==null?void 0:ir.some(lr=>!("name"in lr&&lr.name));let ar=sr?[]:{};const ur=ir.filter(lr=>"indexed"in lr&&lr.indexed);for(let lr=0;lr!("indexed"in lr&&lr.indexed));if(cr.length>0){if(s&&s!=="0x")try{const lr=decodeAbiParameters$2(cr,s);if(lr)if(sr)ar=[...ar,...lr];else for(let hr=0;hr0?ar:void 0}}function decodeTopic$1({param:o,value:s}){return o.type==="string"||o.type==="bytes"||o.type==="tuple"||o.type.match(/^(.*)\[(\d+)?\]$/)?s:(decodeAbiParameters$2([o],s)||[])[0]}async function getLogs$2(o,{address:s,blockHash:a,fromBlock:rt,toBlock:ot,event:tr,events:Ut,args:rr,strict:nr}={}){const ir=nr??!1,sr=Ut??(tr?[tr]:void 0);let ar=[];sr&&(ar=[sr.flatMap(cr=>encodeEventTopics$2({abi:[cr],eventName:cr.name,args:rr}))],tr&&(ar=ar[0]));let ur;return a?ur=await o.request({method:"eth_getLogs",params:[{address:s,topics:ar,blockHash:a}]}):ur=await o.request({method:"eth_getLogs",params:[{address:s,topics:ar,fromBlock:typeof rt=="bigint"?numberToHex(rt):rt,toBlock:typeof ot=="bigint"?numberToHex(ot):ot}]}),ur.map(cr=>{var lr;try{const{eventName:hr,args:gr}=sr?decodeEventLog$2({abi:sr,data:cr.data,topics:cr.topics,strict:ir}):{eventName:void 0,args:void 0};return formatLog$1(cr,{args:gr,eventName:hr})}catch(hr){let gr,vr;if(hr instanceof DecodeLogDataMismatch||hr instanceof DecodeLogTopicsMismatch){if(ir)return;gr=hr.abiItem.name,vr=(lr=hr.abiItem.inputs)==null?void 0:lr.some(fr=>!("name"in fr&&fr.name))}return formatLog$1(cr,{args:vr?[]:{},eventName:gr})}}).filter(Boolean)}async function getContractEvents$2(o,{abi:s,address:a,args:rt,blockHash:ot,eventName:tr,fromBlock:Ut,toBlock:rr,strict:nr}){const ir=tr?getAbiItem$2({abi:s,name:tr}):void 0,sr=ir?void 0:s.filter(ar=>ar.type==="event");return getLogs$2(o,{address:a,args:rt,blockHash:ot,event:ir,events:sr,fromBlock:Ut,toBlock:rr,strict:nr})}const docsPath$7="/docs/contract/decodeFunctionResult";function decodeFunctionResult$2({abi:o,args:s,functionName:a,data:rt}){let ot=o[0];if(a&&(ot=getAbiItem$2({abi:o,args:s,name:a}),!ot))throw new AbiFunctionNotFoundError(a,{docsPath:docsPath$7});if(ot.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$7});if(!ot.outputs)throw new AbiFunctionOutputsNotFoundError(ot.name,{docsPath:docsPath$7});const tr=decodeAbiParameters$2(ot.outputs,rt);if(tr&&tr.length>1)return tr;if(tr&&tr.length===1)return tr[0]}const scriptRel="modulepreload",assetsURL=function(o,s){return new URL(o,s).href},seen={},__vitePreload=function o(s,a,rt){if(!a||a.length===0)return s();const ot=document.getElementsByTagName("link");return Promise.all(a.map(tr=>{if(tr=assetsURL(tr,rt),tr in seen)return;seen[tr]=!0;const Ut=tr.endsWith(".css"),rr=Ut?'[rel="stylesheet"]':"";if(!!rt)for(let sr=ot.length-1;sr>=0;sr--){const ar=ot[sr];if(ar.href===tr&&(!Ut||ar.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${tr}"]${rr}`))return;const ir=document.createElement("link");if(ir.rel=Ut?"stylesheet":scriptRel,Ut||(ir.as="script",ir.crossOrigin=""),ir.href=tr,document.head.appendChild(ir),Ut)return new Promise((sr,ar)=>{ir.addEventListener("load",sr),ir.addEventListener("error",()=>ar(new Error(`Unable to preload CSS for ${tr}`)))})})).then(()=>s()).catch(tr=>{const Ut=new Event("vite:preloadError",{cancelable:!0});if(Ut.payload=tr,window.dispatchEvent(Ut),!Ut.defaultPrevented)throw tr})},multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],universalResolverErrors$1=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],universalResolverResolveAbi=[...universalResolverErrors$1,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],universalResolverReverseAbi=[...universalResolverErrors$1,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],addressResolverAbi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],universalSignatureValidatorAbi=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],aggregate3Signature="0x82ad56cb";function getCallError$2(o,{docsPath:s,...a}){const rt=(()=>{const ot=getNodeError$2(o,a);return ot instanceof UnknownNodeError$1?o:ot})();return new CallExecutionError$1(rt,{docsPath:s,...a})}const schedulerCache$1=new Map;function createBatchScheduler$2({fn:o,id:s,shouldSplitBatch:a,wait:rt=0}){const ot=async()=>{const ir=rr();tr();const sr=ir.map(({args:ar})=>ar);sr.length!==0&&o(sr).then(ar=>{ir.forEach(({pendingPromise:ur},cr)=>{var lr;return(lr=ur.resolve)==null?void 0:lr.call(ur,[ar[cr],ar])})}).catch(ar=>{ir.forEach(({pendingPromise:ur})=>{var cr;return(cr=ur.reject)==null?void 0:cr.call(ur,ar)})})},tr=()=>schedulerCache$1.delete(s),Ut=()=>rr().map(({args:ir})=>ir),rr=()=>schedulerCache$1.get(s)||[],nr=ir=>schedulerCache$1.set(s,[...rr(),ir]);return{flush:tr,async schedule(ir){const sr={},ar=new Promise((lr,hr)=>{sr.resolve=lr,sr.reject=hr});return(a==null?void 0:a([...Ut(),ir]))&&ot(),rr().length>0?(nr({args:ir,pendingPromise:sr}),ar):(nr({args:ir,pendingPromise:sr}),setTimeout(ot,rt),ar)}}}async function call$1(o,s){var vr,fr,br,wr;const{account:a=o.account,batch:rt=!!((vr=o.batch)!=null&&vr.multicall),blockNumber:ot,blockTag:tr="latest",accessList:Ut,data:rr,gas:nr,gasPrice:ir,maxFeePerGas:sr,maxPriorityFeePerGas:ar,nonce:ur,to:cr,value:lr,...hr}=s,gr=a?parseAccount$2(a):void 0;try{assertRequest$2(s);const _r=(ot?numberToHex(ot):void 0)||tr,yr=((wr=(br=(fr=o.chain)==null?void 0:fr.formatters)==null?void 0:br.transactionRequest)==null?void 0:wr.format)||formatTransactionRequest,Sr=yr({...extract$2(hr,{format:yr}),from:gr==null?void 0:gr.address,accessList:Ut,data:rr,gas:nr,gasPrice:ir,maxFeePerGas:sr,maxPriorityFeePerGas:ar,nonce:ur,to:cr,value:lr});if(rt&&shouldPerformMulticall({request:Sr}))try{return await scheduleMulticall(o,{...Sr,blockNumber:ot,blockTag:tr})}catch(Ir){if(!(Ir instanceof ClientChainNotConfiguredError$1)&&!(Ir instanceof ChainDoesNotSupportContract$1))throw Ir}const kr=await o.request({method:"eth_call",params:_r?[Sr,_r]:[Sr]});return kr==="0x"?{data:void 0}:{data:kr}}catch($r){const _r=getRevertErrorData($r),{offchainLookup:yr,offchainLookupSignature:Sr}=await __vitePreload(()=>import("./ccip-8d672838.js"),[],import.meta.url);if((_r==null?void 0:_r.slice(0,10))===Sr&&cr)return{data:await yr(o,{data:_r,to:cr})};throw getCallError$2($r,{...s,account:gr,chain:o.chain})}}function shouldPerformMulticall({request:o}){const{data:s,to:a,...rt}=o;return!(!s||s.startsWith(aggregate3Signature)||!a||Object.values(rt).filter(ot=>typeof ot<"u").length>0)}async function scheduleMulticall(o,s){var hr;const{batchSize:a=1024,wait:rt=0}=typeof((hr=o.batch)==null?void 0:hr.multicall)=="object"?o.batch.multicall:{},{blockNumber:ot,blockTag:tr="latest",data:Ut,multicallAddress:rr,to:nr}=s;let ir=rr;if(!ir){if(!o.chain)throw new ClientChainNotConfiguredError$1;ir=getChainContractAddress$1({blockNumber:ot,chain:o.chain,contract:"multicall3"})}const ar=(ot?numberToHex(ot):void 0)||tr,{schedule:ur}=createBatchScheduler$2({id:`${o.uid}.${ar}`,wait:rt,shouldSplitBatch(gr){return gr.reduce((fr,{data:br})=>fr+(br.length-2),0)>a*2},fn:async gr=>{const vr=gr.map(wr=>({allowFailure:!0,callData:wr.data,target:wr.to})),fr=encodeFunctionData$2({abi:multicall3Abi,args:[vr],functionName:"aggregate3"}),br=await o.request({method:"eth_call",params:[{data:fr,to:ir},ar]});return decodeFunctionResult$2({abi:multicall3Abi,args:[vr],functionName:"aggregate3",data:br||"0x"})}}),[{returnData:cr,success:lr}]=await ur({data:Ut,to:nr});if(!lr)throw new RawContractError$1({data:cr});return cr==="0x"?{data:void 0}:{data:cr}}function getRevertErrorData(o){if(!(o instanceof BaseError$2))return;const s=o.walk();return typeof s.data=="object"?s.data.data:s.data}async function readContract$3(o,{abi:s,address:a,args:rt,functionName:ot,...tr}){const Ut=encodeFunctionData$2({abi:s,args:rt,functionName:ot});try{const{data:rr}=await call$1(o,{data:Ut,to:a,...tr});return decodeFunctionResult$2({abi:s,args:rt,functionName:ot,data:rr||"0x"})}catch(rr){throw getContractError$2(rr,{abi:s,address:a,args:rt,docsPath:"/docs/contract/readContract",functionName:ot})}}async function simulateContract$2(o,{abi:s,address:a,args:rt,dataSuffix:ot,functionName:tr,...Ut}){const rr=Ut.account?parseAccount$2(Ut.account):void 0,nr=encodeFunctionData$2({abi:s,args:rt,functionName:tr});try{const{data:ir}=await call$1(o,{batch:!1,data:`${nr}${ot?ot.replace("0x",""):""}`,to:a,...Ut});return{result:decodeFunctionResult$2({abi:s,args:rt,functionName:tr,data:ir||"0x"}),request:{abi:s,address:a,args:rt,dataSuffix:ot,functionName:tr,...Ut}}}catch(ir){throw getContractError$2(ir,{abi:s,address:a,args:rt,docsPath:"/docs/contract/simulateContract",functionName:tr,sender:rr==null?void 0:rr.address})}}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe$1(o,s,a){const rt=++callbackCount,ot=()=>listenersCache.get(o)||[],tr=()=>{const sr=ot();listenersCache.set(o,sr.filter(ar=>ar.id!==rt))},Ut=()=>{const sr=cleanupCache.get(o);ot().length===1&&sr&&sr(),tr()},rr=ot();if(listenersCache.set(o,[...rr,{id:rt,fns:s}]),rr&&rr.length>0)return Ut;const nr={};for(const sr in s)nr[sr]=(...ar)=>{const ur=ot();ur.length!==0&&ur.forEach(cr=>{var lr,hr;return(hr=(lr=cr.fns)[sr])==null?void 0:hr.call(lr,...ar)})};const ir=a(nr);return typeof ir=="function"&&cleanupCache.set(o,ir),Ut}async function wait$2(o){return new Promise(s=>setTimeout(s,o))}function poll$2(o,{emitOnBegin:s,initialWaitTime:a,interval:rt}){let ot=!0;const tr=()=>ot=!1;return(async()=>{let rr;s&&(rr=await o({unpoll:tr}));const nr=await(a==null?void 0:a(rr))??rt;await wait$2(nr);const ir=async()=>{ot&&(await o({unpoll:tr}),await wait$2(rt),ir())};ir()})(),tr}const promiseCache=new Map,responseCache=new Map;function getCache(o){const s=(ot,tr)=>({clear:()=>tr.delete(ot),get:()=>tr.get(ot),set:Ut=>tr.set(ot,Ut)}),a=s(o,promiseCache),rt=s(o,responseCache);return{clear:()=>{a.clear(),rt.clear()},promise:a,response:rt}}async function withCache$1(o,{cacheKey:s,cacheTime:a=1/0}){const rt=getCache(s),ot=rt.response.get();if(ot&&a>0&&new Date().getTime()-ot.created.getTime()`blockNumber.${o}`;async function getBlockNumber$2(o,{cacheTime:s=o.cacheTime,maxAge:a}={}){const rt=await withCache$1(()=>o.request({method:"eth_blockNumber"}),{cacheKey:cacheKey$1(o.uid),cacheTime:a??s});return BigInt(rt)}async function getFilterChanges$2(o,{filter:s}){const a="strict"in s&&s.strict;return(await s.request({method:"eth_getFilterChanges",params:[s.id]})).map(ot=>{var tr;if(typeof ot=="string")return ot;try{const{eventName:Ut,args:rr}="abi"in s&&s.abi?decodeEventLog$2({abi:s.abi,data:ot.data,topics:ot.topics,strict:a}):{eventName:void 0,args:void 0};return formatLog$1(ot,{args:rr,eventName:Ut})}catch(Ut){let rr,nr;if(Ut instanceof DecodeLogDataMismatch||Ut instanceof DecodeLogTopicsMismatch){if("strict"in s&&s.strict)return;rr=Ut.abiItem.name,nr=(tr=Ut.abiItem.inputs)==null?void 0:tr.some(ir=>!("name"in ir&&ir.name))}return formatLog$1(ot,{args:nr?[]:{},eventName:rr})}}).filter(Boolean)}async function uninstallFilter$2(o,{filter:s}){return s.request({method:"eth_uninstallFilter",params:[s.id]})}function watchContractEvent$2(o,{abi:s,address:a,args:rt,batch:ot=!0,eventName:tr,onError:Ut,onLogs:rr,poll:nr,pollingInterval:ir=o.pollingInterval,strict:sr}){return(typeof nr<"u"?nr:o.transport.type!=="webSocket")?(()=>{const lr=stringify$2(["watchContractEvent",a,rt,ot,o.uid,tr,ir]),hr=sr??!1;return observe$1(lr,{onLogs:rr,onError:Ut},gr=>{let vr,fr,br=!1;const wr=poll$2(async()=>{var $r;if(!br){try{fr=await createContractEventFilter$2(o,{abi:s,address:a,args:rt,eventName:tr,strict:hr})}catch{}br=!0;return}try{let _r;if(fr)_r=await getFilterChanges$2(o,{filter:fr});else{const yr=await getBlockNumber$2(o);vr&&vr!==yr?_r=await getContractEvents$2(o,{abi:s,address:a,args:rt,fromBlock:vr+1n,toBlock:yr,strict:hr}):_r=[],vr=yr}if(_r.length===0)return;ot?gr.onLogs(_r):_r.forEach(yr=>gr.onLogs([yr]))}catch(_r){fr&&_r instanceof InvalidInputRpcError$1&&(br=!1),($r=gr.onError)==null||$r.call(gr,_r)}},{emitOnBegin:!0,interval:ir});return async()=>{fr&&await uninstallFilter$2(o,{filter:fr}),wr()}})})():(()=>{let lr=!0,hr=()=>lr=!1;return(async()=>{try{const gr=tr?encodeEventTopics$2({abi:s,eventName:tr,args:rt}):[],{unsubscribe:vr}=await o.transport.subscribe({params:["logs",{address:a,topics:gr}],onData(fr){var wr;if(!lr)return;const br=fr.result;try{const{eventName:$r,args:_r}=decodeEventLog$2({abi:s,data:br.data,topics:br.topics,strict:sr}),yr=formatLog$1(br,{args:_r,eventName:$r});rr([yr])}catch($r){let _r,yr;if($r instanceof DecodeLogDataMismatch||$r instanceof DecodeLogTopicsMismatch){if(sr)return;_r=$r.abiItem.name,yr=(wr=$r.abiItem.inputs)==null?void 0:wr.some(kr=>!("name"in kr&&kr.name))}const Sr=formatLog$1(br,{args:yr?[]:{},eventName:_r});rr([Sr])}},onError(fr){Ut==null||Ut(fr)}});hr=vr,lr||hr()}catch(gr){Ut==null||Ut(gr)}})(),hr})()}function getTransactionError$2(o,{docsPath:s,...a}){const rt=(()=>{const ot=getNodeError$2(o,a);return ot instanceof UnknownNodeError$1?o:ot})();return new TransactionExecutionError$1(rt,{docsPath:s,...a})}async function getChainId$2(o){const s=await o.request({method:"eth_chainId"});return hexToNumber$1(s)}async function sendRawTransaction$2(o,{serializedTransaction:s}){return o.request({method:"eth_sendRawTransaction",params:[s]})}async function sendTransaction$3(o,s){var hr,gr,vr;const{account:a=o.account,chain:rt=o.chain,accessList:ot,data:tr,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur,...cr}=s;if(!a)throw new AccountNotFoundError$1({docsPath:"/docs/actions/wallet/sendTransaction"});const lr=parseAccount$2(a);try{assertRequest$2(s);let fr;if(rt!==null&&(fr=await getChainId$2(o),assertCurrentChain$1({currentChainId:fr,chain:rt})),lr.type==="local"){const $r=await prepareTransactionRequest$1(o,{account:lr,accessList:ot,chain:rt,data:tr,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur,...cr});fr||(fr=await getChainId$2(o));const _r=(hr=rt==null?void 0:rt.serializers)==null?void 0:hr.transaction,yr=await lr.signTransaction({...$r,chainId:fr},{serializer:_r});return await sendRawTransaction$2(o,{serializedTransaction:yr})}const br=((vr=(gr=rt==null?void 0:rt.formatters)==null?void 0:gr.transactionRequest)==null?void 0:vr.format)||formatTransactionRequest,wr=br({...extract$2(cr,{format:br}),accessList:ot,data:tr,from:lr.address,gas:Ut,gasPrice:rr,maxFeePerGas:nr,maxPriorityFeePerGas:ir,nonce:sr,to:ar,value:ur});return await o.request({method:"eth_sendTransaction",params:[wr]})}catch(fr){throw getTransactionError$2(fr,{...s,account:lr,chain:s.chain||void 0})}}async function writeContract$3(o,{abi:s,address:a,args:rt,dataSuffix:ot,functionName:tr,...Ut}){const rr=encodeFunctionData$2({abi:s,args:rt,functionName:tr});return await sendTransaction$3(o,{data:`${rr}${ot?ot.replace("0x",""):""}`,to:a,...Ut})}async function addChain$2(o,{chain:s}){const{id:a,name:rt,nativeCurrency:ot,rpcUrls:tr,blockExplorers:Ut}=s;await o.request({method:"wallet_addEthereumChain",params:[{chainId:numberToHex(a),chainName:rt,nativeCurrency:ot,rpcUrls:tr.default.http,blockExplorerUrls:Ut?Object.values(Ut).map(({url:rr})=>rr):void 0}]})}const size$3=256;let index$1=size$3,buffer$1;function uid$2(o=11){if(!buffer$1||index$1+o>size$3*2){buffer$1="",index$1=0;for(let s=0;s{const vr=gr(hr);for(const br in cr)delete vr[br];const fr={...hr,...vr};return Object.assign(fr,{extend:lr(fr)})}}return Object.assign(cr,{extend:lr(cr)})}function withRetry$2(o,{delay:s=100,retryCount:a=2,shouldRetry:rt=()=>!0}={}){return new Promise((ot,tr)=>{const Ut=async({count:rr=0}={})=>{const nr=async({error:ir})=>{const sr=typeof s=="function"?s({count:rr,error:ir}):s;sr&&await wait$2(sr),Ut({count:rr+1})};try{const ir=await o();ot(ir)}catch(ir){if(rr"code"in o?o.code!==-1&&o.code!==-32004&&o.code!==-32005&&o.code!==-32042&&o.code!==-32603:o instanceof HttpRequestError$1&&o.status?o.status!==403&&o.status!==408&&o.status!==413&&o.status!==429&&o.status!==500&&o.status!==502&&o.status!==503&&o.status!==504:!1;function buildRequest$1(o,{retryDelay:s=150,retryCount:a=3}={}){return async rt=>withRetry$2(async()=>{try{return await o(rt)}catch(ot){const tr=ot;switch(tr.code){case ParseRpcError$1.code:throw new ParseRpcError$1(tr);case InvalidRequestRpcError$1.code:throw new InvalidRequestRpcError$1(tr);case MethodNotFoundRpcError$1.code:throw new MethodNotFoundRpcError$1(tr);case InvalidParamsRpcError$1.code:throw new InvalidParamsRpcError$1(tr);case InternalRpcError$1.code:throw new InternalRpcError$1(tr);case InvalidInputRpcError$1.code:throw new InvalidInputRpcError$1(tr);case ResourceNotFoundRpcError$1.code:throw new ResourceNotFoundRpcError$1(tr);case ResourceUnavailableRpcError$1.code:throw new ResourceUnavailableRpcError$1(tr);case TransactionRejectedRpcError$1.code:throw new TransactionRejectedRpcError$1(tr);case MethodNotSupportedRpcError$1.code:throw new MethodNotSupportedRpcError$1(tr);case LimitExceededRpcError$1.code:throw new LimitExceededRpcError$1(tr);case JsonRpcVersionUnsupportedError$1.code:throw new JsonRpcVersionUnsupportedError$1(tr);case UserRejectedRequestError$1.code:throw new UserRejectedRequestError$1(tr);case UnauthorizedProviderError$1.code:throw new UnauthorizedProviderError$1(tr);case UnsupportedProviderMethodError$1.code:throw new UnsupportedProviderMethodError$1(tr);case ProviderDisconnectedError$1.code:throw new ProviderDisconnectedError$1(tr);case ChainDisconnectedError$1.code:throw new ChainDisconnectedError$1(tr);case SwitchChainError$1.code:throw new SwitchChainError$1(tr);case 5e3:throw new UserRejectedRequestError$1(tr);default:throw ot instanceof BaseError$2?ot:new UnknownRpcError$1(tr)}}},{delay:({count:ot,error:tr})=>{var Ut;if(tr&&tr instanceof HttpRequestError$1){const rr=(Ut=tr==null?void 0:tr.headers)==null?void 0:Ut.get("Retry-After");if(rr!=null&&rr.match(/\d/))return parseInt(rr)*1e3}return~~(1<!isDeterministicError(ot)})}function createTransport$2({key:o,name:s,request:a,retryCount:rt=3,retryDelay:ot=150,timeout:tr,type:Ut},rr){return{config:{key:o,name:s,request:a,retryCount:rt,retryDelay:ot,timeout:tr,type:Ut},request:buildRequest$1(a,{retryCount:rt,retryDelay:ot}),value:rr}}function custom$2(o,s={}){const{key:a="custom",name:rt="Custom Provider",retryDelay:ot}=s;return({retryCount:tr})=>createTransport$2({key:a,name:rt,request:o.request.bind(o),retryCount:s.retryCount??tr,retryDelay:ot,type:"custom"})}function fallback$2(o,s={}){const{key:a="fallback",name:rt="Fallback",rank:ot=!1,retryCount:tr,retryDelay:Ut}=s;return({chain:rr,pollingInterval:nr=4e3,timeout:ir})=>{let sr=o,ar=()=>{};const ur=createTransport$2({key:a,name:rt,async request({method:cr,params:lr}){const hr=async(gr=0)=>{const vr=sr[gr]({chain:rr,retryCount:0,timeout:ir});try{const fr=await vr.request({method:cr,params:lr});return ar({method:cr,params:lr,response:fr,transport:vr,status:"success"}),fr}catch(fr){if(ar({error:fr,method:cr,params:lr,transport:vr,status:"error"}),isDeterministicError(fr)||gr===sr.length-1)throw fr;return hr(gr+1)}};return hr()},retryCount:tr,retryDelay:Ut,type:"fallback"},{onResponse:cr=>ar=cr,transports:sr.map(cr=>cr({chain:rr,retryCount:0}))});if(ot){const cr=typeof ot=="object"?ot:{};rankTransports$1({chain:rr,interval:cr.interval??nr,onTransports:lr=>sr=lr,sampleCount:cr.sampleCount,timeout:cr.timeout,transports:sr,weights:cr.weights})}return ur}}function rankTransports$1({chain:o,interval:s=4e3,onTransports:a,sampleCount:rt=10,timeout:ot=1e3,transports:tr,weights:Ut={}}){const{stability:rr=.7,latency:nr=.3}=Ut,ir=[],sr=async()=>{const ar=await Promise.all(tr.map(async lr=>{const hr=lr({chain:o,retryCount:0,timeout:ot}),gr=Date.now();let vr,fr;try{await hr.request({method:"net_listening"}),fr=1}catch{fr=0}finally{vr=Date.now()}return{latency:vr-gr,success:fr}}));ir.push(ar),ir.length>rt&&ir.shift();const ur=Math.max(...ir.map(lr=>Math.max(...lr.map(({latency:hr})=>hr)))),cr=tr.map((lr,hr)=>{const gr=ir.map($r=>$r[hr].latency),fr=1-gr.reduce(($r,_r)=>$r+_r,0)/gr.length/ur,br=ir.map($r=>$r[hr].success),wr=br.reduce(($r,_r)=>$r+_r,0)/br.length;return wr===0?[0,hr]:[nr*fr+rr*wr,hr]}).sort((lr,hr)=>hr[0]-lr[0]);a(cr.map(([,lr])=>tr[lr])),await wait$2(s),sr()};sr()}let UrlRequiredError$1=class extends BaseError$2{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}};function getNativeWebSocket(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const WebSocket$1=getNativeWebSocket(),native=Object.freeze(Object.defineProperty({__proto__:null,WebSocket:WebSocket$1},Symbol.toStringTag,{value:"Module"}));function withTimeout$2(o,{errorInstance:s=new Error("timed out"),timeout:a,signal:rt}){return new Promise((ot,tr)=>{(async()=>{let Ut;try{const rr=new AbortController;a>0&&(Ut=setTimeout(()=>{rt?rr.abort():tr(s)},a)),ot(await o({signal:rr==null?void 0:rr.signal}))}catch(rr){rr.name==="AbortError"&&tr(s),tr(rr)}finally{clearTimeout(Ut)}})()})}let id=0;async function http$3(o,{body:s,fetchOptions:a={},timeout:rt=1e4}){var rr;const{headers:ot,method:tr,signal:Ut}=a;try{const nr=await withTimeout$2(async({signal:sr})=>await fetch(o,{...a,body:Array.isArray(s)?stringify$2(s.map(ur=>({jsonrpc:"2.0",id:ur.id??id++,...ur}))):stringify$2({jsonrpc:"2.0",id:s.id??id++,...s}),headers:{...ot,"Content-Type":"application/json"},method:tr||"POST",signal:Ut||(rt>0?sr:void 0)}),{errorInstance:new TimeoutError$1({body:s,url:o}),timeout:rt,signal:!0});let ir;if((rr=nr.headers.get("Content-Type"))!=null&&rr.startsWith("application/json")?ir=await nr.json():ir=await nr.text(),!nr.ok)throw new HttpRequestError$1({body:s,details:stringify$2(ir.error)||nr.statusText,headers:nr.headers,status:nr.status,url:o});return ir}catch(nr){throw nr instanceof HttpRequestError$1||nr instanceof TimeoutError$1?nr:new HttpRequestError$1({body:s,details:nr.message,url:o})}}const socketsCache=new Map;async function getSocket(o){let s=socketsCache.get(o);if(s)return s;const{schedule:a}=createBatchScheduler$2({id:o,fn:async()=>{const tr=new WebSocket$1(o),Ut=new Map,rr=new Map,nr=({data:sr})=>{const ar=JSON.parse(sr),ur=ar.method==="eth_subscription",cr=ur?ar.params.subscription:ar.id,lr=ur?rr:Ut,hr=lr.get(cr);hr&&hr({data:sr}),ur||lr.delete(cr)},ir=()=>{socketsCache.delete(o),tr.removeEventListener("close",ir),tr.removeEventListener("message",nr)};return tr.addEventListener("close",ir),tr.addEventListener("message",nr),tr.readyState===WebSocket$1.CONNECTING&&await new Promise((sr,ar)=>{tr&&(tr.onopen=sr,tr.onerror=ar)}),s=Object.assign(tr,{requests:Ut,subscriptions:rr}),socketsCache.set(o,s),[s]}}),[rt,[ot]]=await a();return ot}function webSocket$3(o,{body:s,onResponse:a}){if(o.readyState===o.CLOSED||o.readyState===o.CLOSING)throw new WebSocketRequestError$1({body:s,url:o.url,details:"Socket is closed."});const rt=id++,ot=({data:tr})=>{var rr;const Ut=JSON.parse(tr);typeof Ut.id=="number"&&rt!==Ut.id||(a==null||a(Ut),s.method==="eth_subscribe"&&typeof Ut.result=="string"&&o.subscriptions.set(Ut.result,ot),s.method==="eth_unsubscribe"&&o.subscriptions.delete((rr=s.params)==null?void 0:rr[0]))};return o.requests.set(rt,ot),o.send(JSON.stringify({jsonrpc:"2.0",...s,id:rt})),o}async function webSocketAsync(o,{body:s,timeout:a=1e4}){return withTimeout$2(()=>new Promise(rt=>rpc$3.webSocket(o,{body:s,onResponse:rt})),{errorInstance:new TimeoutError$1({body:s,url:o.url}),timeout:a})}const rpc$3={http:http$3,webSocket:webSocket$3,webSocketAsync};function http$2(o,s={}){const{batch:a,fetchOptions:rt,key:ot="http",name:tr="HTTP JSON-RPC",retryDelay:Ut}=s;return({chain:rr,retryCount:nr,timeout:ir})=>{const{batchSize:sr=1e3,wait:ar=0}=typeof a=="object"?a:{},ur=s.retryCount??nr,cr=ir??s.timeout??1e4,lr=o||(rr==null?void 0:rr.rpcUrls.default.http[0]);if(!lr)throw new UrlRequiredError$1;return createTransport$2({key:ot,name:tr,async request({method:hr,params:gr}){const vr={method:hr,params:gr},{schedule:fr}=createBatchScheduler$2({id:`${o}`,wait:ar,shouldSplitBatch(_r){return _r.length>sr},fn:_r=>rpc$3.http(lr,{body:_r,fetchOptions:rt,timeout:cr})}),br=async _r=>a?fr(_r):[await rpc$3.http(lr,{body:_r,fetchOptions:rt,timeout:cr})],[{error:wr,result:$r}]=await br(vr);if(wr)throw new RpcRequestError$1({body:vr,error:wr,url:lr});return $r},retryCount:ur,retryDelay:Ut,timeout:cr,type:"http"},{fetchOptions:rt,url:o})}}function isNullUniversalResolverError$1(o,s){var rt,ot,tr;if(!(o instanceof BaseError$2))return!1;const a=o.walk(Ut=>Ut instanceof ContractFunctionRevertedError$1);return a instanceof ContractFunctionRevertedError$1?!!(((rt=a.data)==null?void 0:rt.errorName)==="ResolverNotFound"||((ot=a.data)==null?void 0:ot.errorName)==="ResolverWildcardNotSupported"||(tr=a.reason)!=null&&tr.includes("Wildcard on non-extended resolvers is not supported")||s==="reverse"&&a.reason===panicReasons[50]):!1}function encodedLabelToLabelhash$2(o){if(o.length!==66||o.indexOf("[")!==0||o.indexOf("]")!==65)return null;const s=`0x${o.slice(1,65)}`;return isHex$2(s)?s:null}function namehash$2(o){let s=new Uint8Array(32).fill(0);if(!o)return bytesToHex$1(s);const a=o.split(".");for(let rt=a.length-1;rt>=0;rt-=1){const ot=encodedLabelToLabelhash$2(a[rt]),tr=ot?toBytes$2(ot):keccak256$2(stringToBytes(a[rt]),"bytes");s=keccak256$2(concat$3([s,tr]),"bytes")}return bytesToHex$1(s)}function encodeLabelhash$2(o){return`[${o.slice(2)}]`}function labelhash$2(o){const s=new Uint8Array(32).fill(0);return o?encodedLabelToLabelhash$2(o)||keccak256$2(stringToBytes(o)):bytesToHex$1(s)}function packetToBytes$2(o){const s=o.replace(/^\.|\.$/gm,"");if(s.length===0)return new Uint8Array(1);const a=new Uint8Array(stringToBytes(s).byteLength+2);let rt=0;const ot=s.split(".");for(let tr=0;tr255&&(Ut=stringToBytes(encodeLabelhash$2(labelhash$2(ot[tr])))),a[rt]=Ut.length,a.set(Ut,rt+1),rt+=Ut.length+1}return a.byteLength!==rt+1?a.slice(0,rt+1):a}async function getEnsAddress$2(o,{blockNumber:s,blockTag:a,coinType:rt,name:ot,universalResolverAddress:tr}){let Ut=tr;if(!Ut){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");Ut=getChainContractAddress$1({blockNumber:s,chain:o.chain,contract:"ensUniversalResolver"})}try{const rr=encodeFunctionData$2({abi:addressResolverAbi,functionName:"addr",...rt!=null?{args:[namehash$2(ot),BigInt(rt)]}:{args:[namehash$2(ot)]}}),nr=await readContract$3(o,{address:Ut,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex$1(packetToBytes$2(ot)),rr],blockNumber:s,blockTag:a});if(nr[0]==="0x")return null;const ir=decodeFunctionResult$2({abi:addressResolverAbi,args:rt!=null?[namehash$2(ot),BigInt(rt)]:void 0,functionName:"addr",data:nr[0]});return ir==="0x"||trim$2(ir)==="0x00"?null:ir}catch(rr){if(isNullUniversalResolverError$1(rr,"resolve"))return null;throw rr}}let EnsAvatarInvalidMetadataError$1=class extends BaseError$2{constructor({data:s}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},EnsAvatarInvalidNftUriError$1=class extends BaseError$2{constructor({reason:s}){super(`ENS NFT avatar URI is invalid. ${s}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},EnsAvatarUriResolutionError$1=class extends BaseError$2{constructor({uri:s}){super(`Unable to resolve ENS avatar URI "${s}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},EnsAvatarUnsupportedNamespaceError$1=class extends BaseError$2{constructor({namespace:s}){super(`ENS NFT avatar namespace "${s}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};const networkRegex$1=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ipfsHashRegex$1=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,base64Regex$1=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex$1=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri$1(o){try{const s=await fetch(o,{method:"HEAD"});if(s.status===200){const a=s.headers.get("content-type");return a==null?void 0:a.startsWith("image/")}return!1}catch(s){return typeof s=="object"&&typeof s.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(a=>{const rt=new Image;rt.onload=()=>{a(!0)},rt.onerror=()=>{a(!1)},rt.src=o})}}function getGateway$1(o,s){return o?o.endsWith("/")?o.slice(0,-1):o:s}function resolveAvatarUri$1({uri:o,gatewayUrls:s}){const a=base64Regex$1.test(o);if(a)return{uri:o,isOnChain:!0,isEncoded:a};const rt=getGateway$1(s==null?void 0:s.ipfs,"https://ipfs.io"),ot=getGateway$1(s==null?void 0:s.arweave,"https://arweave.net"),tr=o.match(networkRegex$1),{protocol:Ut,subpath:rr,target:nr,subtarget:ir=""}=(tr==null?void 0:tr.groups)||{},sr=Ut==="ipns:/"||rr==="ipns/",ar=Ut==="ipfs:/"||rr==="ipfs/"||ipfsHashRegex$1.test(o);if(o.startsWith("http")&&!sr&&!ar){let cr=o;return s!=null&&s.arweave&&(cr=o.replace(/https:\/\/arweave.net/g,s==null?void 0:s.arweave)),{uri:cr,isOnChain:!1,isEncoded:!1}}if((sr||ar)&&nr)return{uri:`${rt}/${sr?"ipns":"ipfs"}/${nr}${ir}`,isOnChain:!1,isEncoded:!1};if(Ut==="ar:/"&&nr)return{uri:`${ot}/${nr}${ir||""}`,isOnChain:!1,isEncoded:!1};let ur=o.replace(dataURIRegex$1,"");if(ur.startsWith("ot.json());return await parseAvatarUri$1({gatewayUrls:o,uri:getJsonImage$1(a)})}catch{throw new EnsAvatarUriResolutionError$1({uri:s})}}async function parseAvatarUri$1({gatewayUrls:o,uri:s}){const{uri:a,isOnChain:rt}=resolveAvatarUri$1({uri:s,gatewayUrls:o});if(rt||await isImageUri$1(a))return a;throw new EnsAvatarUriResolutionError$1({uri:s})}function parseNftUri$1(o){let s=o;s.startsWith("did:nft:")&&(s=s.replace("did:nft:","").replace(/_/g,"/"));const[a,rt,ot]=s.split("/"),[tr,Ut]=a.split(":"),[rr,nr]=rt.split(":");if(!tr||tr.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError$1({reason:"Only EIP-155 supported"});if(!Ut)throw new EnsAvatarInvalidNftUriError$1({reason:"Chain ID not found"});if(!nr)throw new EnsAvatarInvalidNftUriError$1({reason:"Contract address not found"});if(!ot)throw new EnsAvatarInvalidNftUriError$1({reason:"Token ID not found"});if(!rr)throw new EnsAvatarInvalidNftUriError$1({reason:"ERC namespace not found"});return{chainID:parseInt(Ut),namespace:rr.toLowerCase(),contractAddress:nr,tokenID:ot}}async function getNftTokenUri$1(o,{nft:s}){if(s.namespace==="erc721")return readContract$3(o,{address:s.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(s.tokenID)]});if(s.namespace==="erc1155")return readContract$3(o,{address:s.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(s.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError$1({namespace:s.namespace})}async function parseAvatarRecord$2(o,{gatewayUrls:s,record:a}){return/eip155:/i.test(a)?parseNftAvatarUri$1(o,{gatewayUrls:s,record:a}):parseAvatarUri$1({uri:a,gatewayUrls:s})}async function parseNftAvatarUri$1(o,{gatewayUrls:s,record:a}){const rt=parseNftUri$1(a),ot=await getNftTokenUri$1(o,{nft:rt}),{uri:tr,isOnChain:Ut,isEncoded:rr}=resolveAvatarUri$1({uri:ot,gatewayUrls:s});if(Ut&&(tr.includes("data:application/json;base64,")||tr.startsWith("{"))){const ir=rr?atob(tr.replace("data:application/json;base64,","")):tr,sr=JSON.parse(ir);return parseAvatarUri$1({uri:getJsonImage$1(sr),gatewayUrls:s})}let nr=rt.tokenID;return rt.namespace==="erc1155"&&(nr=nr.replace("0x","").padStart(64,"0")),getMetadataAvatarUri$1({gatewayUrls:s,uri:tr.replace(/(?:0x)?{id}/,nr)})}async function getEnsText$2(o,{blockNumber:s,blockTag:a,name:rt,key:ot,universalResolverAddress:tr}){let Ut=tr;if(!Ut){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");Ut=getChainContractAddress$1({blockNumber:s,chain:o.chain,contract:"ensUniversalResolver"})}try{const rr=await readContract$3(o,{address:Ut,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex$1(packetToBytes$2(rt)),encodeFunctionData$2({abi:textResolverAbi,functionName:"text",args:[namehash$2(rt),ot]})],blockNumber:s,blockTag:a});if(rr[0]==="0x")return null;const nr=decodeFunctionResult$2({abi:textResolverAbi,functionName:"text",data:rr[0]});return nr===""?null:nr}catch(rr){if(isNullUniversalResolverError$1(rr,"resolve"))return null;throw rr}}async function getEnsAvatar$2(o,{blockNumber:s,blockTag:a,gatewayUrls:rt,name:ot,universalResolverAddress:tr}){const Ut=await getEnsText$2(o,{blockNumber:s,blockTag:a,key:"avatar",name:ot,universalResolverAddress:tr});if(!Ut)return null;try{return await parseAvatarRecord$2(o,{record:Ut,gatewayUrls:rt})}catch{return null}}async function getEnsName$2(o,{address:s,blockNumber:a,blockTag:rt,universalResolverAddress:ot}){let tr=ot;if(!tr){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");tr=getChainContractAddress$1({blockNumber:a,chain:o.chain,contract:"ensUniversalResolver"})}const Ut=`${s.toLowerCase().substring(2)}.addr.reverse`;try{return(await readContract$3(o,{address:tr,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex$1(packetToBytes$2(Ut))],blockNumber:a,blockTag:rt}))[0]}catch(rr){if(isNullUniversalResolverError$1(rr,"reverse"))return null;throw rr}}async function getEnsResolver$2(o,{blockNumber:s,blockTag:a,name:rt,universalResolverAddress:ot}){let tr=ot;if(!tr){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");tr=getChainContractAddress$1({blockNumber:s,chain:o.chain,contract:"ensUniversalResolver"})}const[Ut]=await readContract$3(o,{address:tr,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[toHex$1(packetToBytes$2(rt))],blockNumber:s,blockTag:a});return Ut}async function createBlockFilter$2(o){const s=createFilterRequestScope$2(o,{method:"eth_newBlockFilter"}),a=await o.request({method:"eth_newBlockFilter"});return{id:a,request:s(a),type:"block"}}async function createEventFilter$2(o,{address:s,args:a,event:rt,events:ot,fromBlock:tr,strict:Ut,toBlock:rr}={}){const nr=ot??(rt?[rt]:void 0),ir=createFilterRequestScope$2(o,{method:"eth_newFilter"});let sr=[];nr&&(sr=[nr.flatMap(ur=>encodeEventTopics$2({abi:[ur],eventName:ur.name,args:a}))],rt&&(sr=sr[0]));const ar=await o.request({method:"eth_newFilter",params:[{address:s,fromBlock:typeof tr=="bigint"?numberToHex(tr):tr,toBlock:typeof rr=="bigint"?numberToHex(rr):rr,...sr.length?{topics:sr}:{}}]});return{abi:nr,args:a,eventName:rt?rt.name:void 0,fromBlock:tr,id:ar,request:ir(ar),strict:Ut,toBlock:rr,type:"event"}}async function createPendingTransactionFilter$2(o){const s=createFilterRequestScope$2(o,{method:"eth_newPendingTransactionFilter"}),a=await o.request({method:"eth_newPendingTransactionFilter"});return{id:a,request:s(a),type:"transaction"}}async function getBalance$2(o,{address:s,blockNumber:a,blockTag:rt="latest"}){const ot=a?numberToHex(a):void 0,tr=await o.request({method:"eth_getBalance",params:[s,ot||rt]});return BigInt(tr)}async function getBlockTransactionCount$2(o,{blockHash:s,blockNumber:a,blockTag:rt="latest"}={}){const ot=a!==void 0?numberToHex(a):void 0;let tr;return s?tr=await o.request({method:"eth_getBlockTransactionCountByHash",params:[s]}):tr=await o.request({method:"eth_getBlockTransactionCountByNumber",params:[ot||rt]}),hexToNumber$1(tr)}async function getBytecode$2(o,{address:s,blockNumber:a,blockTag:rt="latest"}){const ot=a!==void 0?numberToHex(a):void 0,tr=await o.request({method:"eth_getCode",params:[s,ot||rt]});if(tr!=="0x")return tr}function formatFeeHistory$1(o){var s;return{baseFeePerGas:o.baseFeePerGas.map(a=>BigInt(a)),gasUsedRatio:o.gasUsedRatio,oldestBlock:BigInt(o.oldestBlock),reward:(s=o.reward)==null?void 0:s.map(a=>a.map(rt=>BigInt(rt)))}}async function getFeeHistory$2(o,{blockCount:s,blockNumber:a,blockTag:rt="latest",rewardPercentiles:ot}){const tr=a?numberToHex(a):void 0,Ut=await o.request({method:"eth_feeHistory",params:[numberToHex(s),tr||rt,ot]});return formatFeeHistory$1(Ut)}async function getFilterLogs$2(o,{filter:s}){const a=s.strict??!1;return(await s.request({method:"eth_getFilterLogs",params:[s.id]})).map(ot=>{var tr;try{const{eventName:Ut,args:rr}="abi"in s&&s.abi?decodeEventLog$2({abi:s.abi,data:ot.data,topics:ot.topics,strict:a}):{eventName:void 0,args:void 0};return formatLog$1(ot,{args:rr,eventName:Ut})}catch(Ut){let rr,nr;if(Ut instanceof DecodeLogDataMismatch||Ut instanceof DecodeLogTopicsMismatch){if("strict"in s&&s.strict)return;rr=Ut.abiItem.name,nr=(tr=Ut.abiItem.inputs)==null?void 0:tr.some(ir=>!("name"in ir&&ir.name))}return formatLog$1(ot,{args:nr?[]:{},eventName:rr})}}).filter(Boolean)}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function hashTypedData$1({domain:o,message:s,primaryType:a,types:rt}){const ot=typeof o>"u"?{}:o,tr={EIP712Domain:getTypesForEIP712Domain({domain:ot}),...rt};validateTypedData({domain:ot,message:s,primaryType:a,types:tr});const Ut=["0x1901"];return ot&&Ut.push(hashDomain({domain:ot,types:tr})),a!=="EIP712Domain"&&Ut.push(hashStruct({data:s,primaryType:a,types:tr})),keccak256$2(concat$3(Ut))}function hashDomain({domain:o,types:s}){return hashStruct({data:o,primaryType:"EIP712Domain",types:s})}function hashStruct({data:o,primaryType:s,types:a}){const rt=encodeData({data:o,primaryType:s,types:a});return keccak256$2(rt)}function encodeData({data:o,primaryType:s,types:a}){const rt=[{type:"bytes32"}],ot=[hashType({primaryType:s,types:a})];for(const tr of a[s]){const[Ut,rr]=encodeField({types:a,name:tr.name,type:tr.type,value:o[tr.name]});rt.push(Ut),ot.push(rr)}return encodeAbiParameters$2(rt,ot)}function hashType({primaryType:o,types:s}){const a=toHex$1(encodeType({primaryType:o,types:s}));return keccak256$2(a)}function encodeType({primaryType:o,types:s}){let a="";const rt=findTypeDependencies({primaryType:o,types:s});rt.delete(o);const ot=[o,...Array.from(rt).sort()];for(const tr of ot)a+=`${tr}(${s[tr].map(({name:Ut,type:rr})=>`${rr} ${Ut}`).join(",")})`;return a}function findTypeDependencies({primaryType:o,types:s},a=new Set){const rt=o.match(/^\w*/u),ot=rt==null?void 0:rt[0];if(a.has(ot)||s[ot]===void 0)return a;a.add(ot);for(const tr of s[ot])findTypeDependencies({primaryType:tr.type,types:s},a);return a}function encodeField({types:o,name:s,type:a,value:rt}){if(o[a]!==void 0)return[{type:"bytes32"},keccak256$2(encodeData({data:rt,primaryType:a,types:o}))];if(a==="bytes")return rt=`0x${(rt.length%2?"0":"")+rt.slice(2)}`,[{type:"bytes32"},keccak256$2(rt)];if(a==="string")return[{type:"bytes32"},keccak256$2(toHex$1(rt))];if(a.lastIndexOf("]")===a.length-1){const ot=a.slice(0,a.lastIndexOf("[")),tr=rt.map(Ut=>encodeField({name:s,type:ot,types:o,value:Ut}));return[{type:"bytes32"},keccak256$2(encodeAbiParameters$2(tr.map(([Ut])=>Ut),tr.map(([,Ut])=>Ut)))]}return[{type:a},rt]}function validateTypedData({domain:o,message:s,primaryType:a,types:rt}){const ot=rt,tr=(Ut,rr)=>{for(const nr of Ut){const{name:ir,type:sr}=nr,ar=sr,ur=rr[ir],cr=ar.match(integerRegex);if(cr&&(typeof ur=="number"||typeof ur=="bigint")){const[gr,vr,fr]=cr;numberToHex(ur,{signed:vr==="int",size:parseInt(fr)/8})}if(ar==="address"&&typeof ur=="string"&&!isAddress$2(ur))throw new InvalidAddressError$1({address:ur});const lr=ar.match(bytesRegex);if(lr){const[gr,vr]=lr;if(vr&&size$4(ur)!==parseInt(vr))throw new BytesSizeMismatchError({expectedSize:parseInt(vr),givenSize:size$4(ur)})}const hr=ot[ar];hr&&tr(hr,ur)}};if(ot.EIP712Domain&&o&&tr(ot.EIP712Domain,o),a!=="EIP712Domain"){const Ut=ot[a];tr(Ut,s)}}function getTypesForEIP712Domain({domain:o}){return[typeof(o==null?void 0:o.name)=="string"&&{name:"name",type:"string"},(o==null?void 0:o.version)&&{name:"version",type:"string"},typeof(o==null?void 0:o.chainId)=="number"&&{name:"chainId",type:"uint256"},(o==null?void 0:o.verifyingContract)&&{name:"verifyingContract",type:"address"},(o==null?void 0:o.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const docsPath$6="/docs/contract/encodeDeployData";function encodeDeployData$2({abi:o,args:s,bytecode:a}){if(!s||s.length===0)return a;const rt=o.find(tr=>"type"in tr&&tr.type==="constructor");if(!rt)throw new AbiConstructorNotFoundError({docsPath:docsPath$6});if(!("inputs"in rt))throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$6});if(!rt.inputs||rt.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$6});const ot=encodeAbiParameters$2(rt.inputs,s);return concatHex$1([a,ot])}function hashMessage$2(o,s){const a=(()=>typeof o=="string"?stringToBytes(o):o.raw instanceof Uint8Array?o.raw:toBytes$2(o.raw))(),rt=stringToBytes(`Ethereum Signed Message: ${a.length}`);return keccak256$2(concat$3([rt,a]),s)}function parseUnits$2(o,s){let[a,rt="0"]=o.split(".");const ot=a.startsWith("-");if(ot&&(a=a.slice(1)),rt=rt.replace(/(0+)$/,""),s===0)Math.round(+`.${rt}`)===1&&(a=`${BigInt(a)+1n}`),rt="";else if(rt.length>s){const[tr,Ut,rr]=[rt.slice(0,s-1),rt.slice(s-1,s),rt.slice(s)],nr=Math.round(+`${Ut}.${rr}`);nr>9?rt=`${BigInt(tr)+BigInt(1)}0`.padStart(tr.length+1,"0"):rt=`${tr}${nr}`,rt.length>s&&(rt=rt.slice(1),a=`${BigInt(a)+1n}`),rt=rt.slice(0,s)}else rt=rt.padEnd(s,"0");return BigInt(`${ot?"-":""}${a}${rt}`)}function parseGwei$2(o,s="wei"){return parseUnits$2(o,gweiUnits[s])}function formatStorageProof(o){return o.map(s=>({...s,value:BigInt(s.value)}))}function formatProof(o){return{...o,balance:o.balance?BigInt(o.balance):void 0,nonce:o.nonce?hexToNumber$1(o.nonce):void 0,storageProof:o.storageProof?formatStorageProof(o.storageProof):void 0}}async function getProof$1(o,{address:s,blockNumber:a,blockTag:rt,storageKeys:ot}){const tr=rt??"latest",Ut=a!==void 0?numberToHex(a):void 0,rr=await o.request({method:"eth_getProof",params:[s,ot,Ut||tr]});return formatProof(rr)}async function getStorageAt$2(o,{address:s,blockNumber:a,blockTag:rt="latest",slot:ot}){const tr=a!==void 0?numberToHex(a):void 0;return await o.request({method:"eth_getStorageAt",params:[s,ot,tr||rt]})}async function getTransaction$2(o,{blockHash:s,blockNumber:a,blockTag:rt,hash:ot,index:tr}){var sr,ar,ur;const Ut=rt||"latest",rr=a!==void 0?numberToHex(a):void 0;let nr=null;if(ot?nr=await o.request({method:"eth_getTransactionByHash",params:[ot]}):s?nr=await o.request({method:"eth_getTransactionByBlockHashAndIndex",params:[s,numberToHex(tr)]}):(rr||Ut)&&(nr=await o.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[rr||Ut,numberToHex(tr)]})),!nr)throw new TransactionNotFoundError$1({blockHash:s,blockNumber:a,blockTag:Ut,hash:ot,index:tr});return(((ur=(ar=(sr=o.chain)==null?void 0:sr.formatters)==null?void 0:ar.transaction)==null?void 0:ur.format)||formatTransaction)(nr)}async function getTransactionConfirmations$2(o,{hash:s,transactionReceipt:a}){const[rt,ot]=await Promise.all([getBlockNumber$2(o),s?getTransaction$2(o,{hash:s}):void 0]),tr=(a==null?void 0:a.blockNumber)||(ot==null?void 0:ot.blockNumber);return tr?rt-tr+1n:0n}async function getTransactionReceipt$2(o,{hash:s}){var ot,tr,Ut;const a=await o.request({method:"eth_getTransactionReceipt",params:[s]});if(!a)throw new TransactionReceiptNotFoundError$1({hash:s});return(((Ut=(tr=(ot=o.chain)==null?void 0:ot.formatters)==null?void 0:tr.transactionReceipt)==null?void 0:Ut.format)||formatTransactionReceipt$1)(a)}async function multicall$3(o,s){var hr;const{allowFailure:a=!0,batchSize:rt,blockNumber:ot,blockTag:tr,contracts:Ut,multicallAddress:rr}=s,nr=rt??(typeof((hr=o.batch)==null?void 0:hr.multicall)=="object"&&o.batch.multicall.batchSize||1024);let ir=rr;if(!ir){if(!o.chain)throw new Error("client chain not configured. multicallAddress is required.");ir=getChainContractAddress$1({blockNumber:ot,chain:o.chain,contract:"multicall3"})}const sr=[[]];let ar=0,ur=0;for(let gr=0;gr0&&ur>nr&&sr[ar].length>0&&(ar++,ur=($r.length-2)/2,sr[ar]=[]),sr[ar]=[...sr[ar],{allowFailure:!0,callData:$r,target:fr}]}catch($r){const _r=getContractError$2($r,{abi:vr,address:fr,args:br,docsPath:"/docs/contract/multicall",functionName:wr});if(!a)throw _r;sr[ar]=[...sr[ar],{allowFailure:!0,callData:"0x",target:fr}]}}const cr=await Promise.allSettled(sr.map(gr=>readContract$3(o,{abi:multicall3Abi,address:ir,args:[gr],blockNumber:ot,blockTag:tr,functionName:"aggregate3"}))),lr=[];for(let gr=0;gro instanceof Uint8Array,hexes=Array.from({length:256},(o,s)=>s.toString(16).padStart(2,"0"));function bytesToHex(o){if(!u8a(o))throw new Error("Uint8Array expected");let s="";for(let a=0;art+ot.length,0));let a=0;return o.forEach(rt=>{if(!u8a(rt))throw new Error("Uint8Array expected");s.set(rt,a),a+=rt.length}),s}function equalBytes(o,s){if(o.length!==s.length)return!1;for(let a=0;a_0n$4;o>>=_1n$4,s+=1);return s}function bitGet(o,s){return o>>BigInt(s)&_1n$4}const bitSet=(o,s,a)=>o|(a?_1n$4:_0n$4)<(_2n$3<new Uint8Array(o),u8fr=o=>Uint8Array.from(o);function createHmacDrbg(o,s,a){if(typeof o!="number"||o<2)throw new Error("hashLen must be a number");if(typeof s!="number"||s<2)throw new Error("qByteLen must be a number");if(typeof a!="function")throw new Error("hmacFn must be a function");let rt=u8n(o),ot=u8n(o),tr=0;const Ut=()=>{rt.fill(1),ot.fill(0),tr=0},rr=(...ar)=>a(ot,rt,...ar),nr=(ar=u8n())=>{ot=rr(u8fr([0]),ar),rt=rr(),ar.length!==0&&(ot=rr(u8fr([1]),ar),rt=rr())},ir=()=>{if(tr++>=1e3)throw new Error("drbg: tried 1000 values");let ar=0;const ur=[];for(;ar{Ut(),nr(ar);let cr;for(;!(cr=ur(ir()));)nr();return Ut(),cr}}const validatorFns={bigint:o=>typeof o=="bigint",function:o=>typeof o=="function",boolean:o=>typeof o=="boolean",string:o=>typeof o=="string",stringOrUint8Array:o=>typeof o=="string"||o instanceof Uint8Array,isSafeInteger:o=>Number.isSafeInteger(o),array:o=>Array.isArray(o),field:(o,s)=>s.Fp.isValid(o),hash:o=>typeof o=="function"&&Number.isSafeInteger(o.outputLen)};function validateObject(o,s,a={}){const rt=(ot,tr,Ut)=>{const rr=validatorFns[tr];if(typeof rr!="function")throw new Error(`Invalid validator "${tr}", expected function`);const nr=o[ot];if(!(Ut&&nr===void 0)&&!rr(nr,o))throw new Error(`Invalid param ${String(ot)}=${nr} (${typeof nr}), expected ${tr}`)};for(const[ot,tr]of Object.entries(s))rt(ot,tr,!1);for(const[ot,tr]of Object.entries(a))rt(ot,tr,!0);return o}const utils$8=Object.freeze(Object.defineProperty({__proto__:null,bitGet,bitLen,bitMask,bitSet,bytesToHex,bytesToNumberBE,bytesToNumberLE,concatBytes:concatBytes$1,createHmacDrbg,ensureBytes,equalBytes,hexToBytes,hexToNumber,numberToBytesBE,numberToBytesLE,numberToHexUnpadded,numberToVarBytesBE,utf8ToBytes,validateObject},Symbol.toStringTag,{value:"Module"}));function isBytesEqual$2(o,s){const a=isHex$2(o)?toBytes$2(o):o,rt=isHex$2(s)?toBytes$2(s):s;return equalBytes(a,rt)}async function verifyHash$1(o,{address:s,hash:a,signature:rt,...ot}){const tr=isHex$2(rt)?rt:toHex$1(rt);try{const{data:Ut}=await call$1(o,{data:encodeDeployData$2({abi:universalSignatureValidatorAbi,args:[s,a,tr],bytecode:universalSignatureValidatorByteCode}),...ot});return isBytesEqual$2(Ut??"0x0","0x1")}catch(Ut){if(Ut instanceof CallExecutionError$1)return!1;throw Ut}}async function verifyMessage$3(o,{address:s,message:a,signature:rt,...ot}){const tr=hashMessage$2(a);return verifyHash$1(o,{address:s,hash:tr,signature:rt,...ot})}async function verifyTypedData$3(o,{address:s,signature:a,message:rt,primaryType:ot,types:tr,domain:Ut,...rr}){const nr=hashTypedData$1({message:rt,primaryType:ot,types:tr,domain:Ut});return verifyHash$1(o,{address:s,hash:nr,signature:a,...rr})}function watchBlockNumber$2(o,{emitOnBegin:s=!1,emitMissed:a=!1,onBlockNumber:rt,onError:ot,poll:tr,pollingInterval:Ut=o.pollingInterval}){const rr=typeof tr<"u"?tr:o.transport.type!=="webSocket";let nr;return rr?(()=>{const ar=stringify$2(["watchBlockNumber",o.uid,s,a,Ut]);return observe$1(ar,{onBlockNumber:rt,onError:ot},ur=>poll$2(async()=>{var cr;try{const lr=await getBlockNumber$2(o,{cacheTime:0});if(nr){if(lr===nr)return;if(lr-nr>1&&a)for(let hr=nr+1n;hrnr)&&(ur.onBlockNumber(lr,nr),nr=lr)}catch(lr){(cr=ur.onError)==null||cr.call(ur,lr)}},{emitOnBegin:s,interval:Ut}))})():(()=>{let ar=!0,ur=()=>ar=!1;return(async()=>{try{const{unsubscribe:cr}=await o.transport.subscribe({params:["newHeads"],onData(lr){var gr;if(!ar)return;const hr=hexToBigInt((gr=lr.result)==null?void 0:gr.number);rt(hr,nr),nr=hr},onError(lr){ot==null||ot(lr)}});ur=cr,ar||ur()}catch(cr){ot==null||ot(cr)}})(),ur})()}async function waitForTransactionReceipt$2(o,{confirmations:s=1,hash:a,onReplaced:rt,pollingInterval:ot=o.pollingInterval,timeout:tr}){const Ut=stringify$2(["waitForTransactionReceipt",o.uid,a]);let rr,nr,ir,sr=!1;return new Promise((ar,ur)=>{tr&&setTimeout(()=>ur(new WaitForTransactionReceiptTimeoutError$1({hash:a})),tr);const cr=observe$1(Ut,{onReplaced:rt,resolve:ar,reject:ur},lr=>{const hr=watchBlockNumber$2(o,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:ot,async onBlockNumber(gr){if(sr)return;let vr=gr;const fr=br=>{hr(),br(),cr()};try{if(ir){if(s>1&&(!ir.blockNumber||vr-ir.blockNumber+1nlr.resolve(ir));return}if(rr||(sr=!0,await withRetry$2(async()=>{rr=await getTransaction$2(o,{hash:a}),rr.blockNumber&&(vr=rr.blockNumber)},{delay:({count:br})=>~~(1<1&&(!ir.blockNumber||vr-ir.blockNumber+1nlr.resolve(ir))}catch(br){if(rr&&(br instanceof TransactionNotFoundError$1||br instanceof TransactionReceiptNotFoundError$1))try{nr=rr;const $r=(await getBlock$2(o,{blockNumber:vr,includeTransactions:!0})).transactions.find(({from:yr,nonce:Sr})=>yr===nr.from&&Sr===nr.nonce);if(!$r||(ir=await getTransactionReceipt$2(o,{hash:$r.hash}),s>1&&(!ir.blockNumber||vr-ir.blockNumber+1n{var yr;(yr=lr.onReplaced)==null||yr.call(lr,{reason:_r,replacedTransaction:nr,transaction:$r,transactionReceipt:ir}),lr.resolve(ir)})}catch(wr){fr(()=>lr.reject(wr))}else fr(()=>lr.reject(br))}}})})})}function watchBlocks$2(o,{blockTag:s="latest",emitMissed:a=!1,emitOnBegin:rt=!1,onBlock:ot,onError:tr,includeTransactions:Ut,poll:rr,pollingInterval:nr=o.pollingInterval}){const ir=typeof rr<"u"?rr:o.transport.type!=="webSocket",sr=Ut??!1;let ar;return ir?(()=>{const lr=stringify$2(["watchBlocks",o.uid,a,rt,sr,nr]);return observe$1(lr,{onBlock:ot,onError:tr},hr=>poll$2(async()=>{var gr;try{const vr=await getBlock$2(o,{blockTag:s,includeTransactions:sr});if(vr.number&&(ar!=null&&ar.number)){if(vr.number===ar.number)return;if(vr.number-ar.number>1&&a)for(let fr=(ar==null?void 0:ar.number)+1n;frar.number)&&(hr.onBlock(vr,ar),ar=vr)}catch(vr){(gr=hr.onError)==null||gr.call(hr,vr)}},{emitOnBegin:rt,interval:nr}))})():(()=>{let lr=!0,hr=()=>lr=!1;return(async()=>{try{const{unsubscribe:gr}=await o.transport.subscribe({params:["newHeads"],onData(vr){var wr,$r,_r;if(!lr)return;const br=(((_r=($r=(wr=o.chain)==null?void 0:wr.formatters)==null?void 0:$r.block)==null?void 0:_r.format)||formatBlock$1)(vr.result);ot(br,ar),ar=br},onError(vr){tr==null||tr(vr)}});hr=gr,lr||hr()}catch(gr){tr==null||tr(gr)}})(),hr})()}function watchEvent$1(o,{address:s,args:a,batch:rt=!0,event:ot,events:tr,onError:Ut,onLogs:rr,poll:nr,pollingInterval:ir=o.pollingInterval,strict:sr}){const ar=typeof nr<"u"?nr:o.transport.type!=="webSocket",ur=sr??!1;return ar?(()=>{const hr=stringify$2(["watchEvent",s,a,rt,o.uid,ot,ir]);return observe$1(hr,{onLogs:rr,onError:Ut},gr=>{let vr,fr,br=!1;const wr=poll$2(async()=>{var $r;if(!br){try{fr=await createEventFilter$2(o,{address:s,args:a,event:ot,events:tr,strict:ur})}catch{}br=!0;return}try{let _r;if(fr)_r=await getFilterChanges$2(o,{filter:fr});else{const yr=await getBlockNumber$2(o);vr&&vr!==yr?_r=await getLogs$2(o,{address:s,args:a,event:ot,events:tr,fromBlock:vr+1n,toBlock:yr}):_r=[],vr=yr}if(_r.length===0)return;rt?gr.onLogs(_r):_r.forEach(yr=>gr.onLogs([yr]))}catch(_r){fr&&_r instanceof InvalidInputRpcError$1&&(br=!1),($r=gr.onError)==null||$r.call(gr,_r)}},{emitOnBegin:!0,interval:ir});return async()=>{fr&&await uninstallFilter$2(o,{filter:fr}),wr()}})})():(()=>{let hr=!0,gr=()=>hr=!1;return(async()=>{try{const vr=tr??(ot?[ot]:void 0);let fr=[];vr&&(fr=[vr.flatMap(wr=>encodeEventTopics$2({abi:[wr],eventName:wr.name,args:a}))],ot&&(fr=fr[0]));const{unsubscribe:br}=await o.transport.subscribe({params:["logs",{address:s,topics:fr}],onData(wr){var _r;if(!hr)return;const $r=wr.result;try{const{eventName:yr,args:Sr}=decodeEventLog$2({abi:vr,data:$r.data,topics:$r.topics,strict:ur}),kr=formatLog$1($r,{args:Sr,eventName:yr});rr([kr])}catch(yr){let Sr,kr;if(yr instanceof DecodeLogDataMismatch||yr instanceof DecodeLogTopicsMismatch){if(sr)return;Sr=yr.abiItem.name,kr=(_r=yr.abiItem.inputs)==null?void 0:_r.some(Dr=>!("name"in Dr&&Dr.name))}const Ir=formatLog$1($r,{args:kr?[]:{},eventName:Sr});rr([Ir])}},onError(wr){Ut==null||Ut(wr)}});gr=br,hr||gr()}catch(vr){Ut==null||Ut(vr)}})(),gr})()}function watchPendingTransactions$2(o,{batch:s=!0,onError:a,onTransactions:rt,poll:ot,pollingInterval:tr=o.pollingInterval}){return(typeof ot<"u"?ot:o.transport.type!=="webSocket")?(()=>{const ir=stringify$2(["watchPendingTransactions",o.uid,s,tr]);return observe$1(ir,{onTransactions:rt,onError:a},sr=>{let ar;const ur=poll$2(async()=>{var cr;try{if(!ar)try{ar=await createPendingTransactionFilter$2(o);return}catch(hr){throw ur(),hr}const lr=await getFilterChanges$2(o,{filter:ar});if(lr.length===0)return;s?sr.onTransactions(lr):lr.forEach(hr=>sr.onTransactions([hr]))}catch(lr){(cr=sr.onError)==null||cr.call(sr,lr)}},{emitOnBegin:!0,interval:tr});return async()=>{ar&&await uninstallFilter$2(o,{filter:ar}),ur()}})})():(()=>{let ir=!0,sr=()=>ir=!1;return(async()=>{try{const{unsubscribe:ar}=await o.transport.subscribe({params:["newPendingTransactions"],onData(ur){if(!ir)return;const cr=ur.result;rt([cr])},onError(ur){a==null||a(ur)}});sr=ar,ir||sr()}catch(ar){a==null||a(ar)}})(),sr})()}function publicActions(o){return{call:s=>call$1(o,s),createBlockFilter:()=>createBlockFilter$2(o),createContractEventFilter:s=>createContractEventFilter$2(o,s),createEventFilter:s=>createEventFilter$2(o,s),createPendingTransactionFilter:()=>createPendingTransactionFilter$2(o),estimateContractGas:s=>estimateContractGas$2(o,s),estimateGas:s=>estimateGas$2(o,s),getBalance:s=>getBalance$2(o,s),getBlock:s=>getBlock$2(o,s),getBlockNumber:s=>getBlockNumber$2(o,s),getBlockTransactionCount:s=>getBlockTransactionCount$2(o,s),getBytecode:s=>getBytecode$2(o,s),getChainId:()=>getChainId$2(o),getContractEvents:s=>getContractEvents$2(o,s),getEnsAddress:s=>getEnsAddress$2(o,s),getEnsAvatar:s=>getEnsAvatar$2(o,s),getEnsName:s=>getEnsName$2(o,s),getEnsResolver:s=>getEnsResolver$2(o,s),getEnsText:s=>getEnsText$2(o,s),getFeeHistory:s=>getFeeHistory$2(o,s),estimateFeesPerGas:s=>estimateFeesPerGas$2(o,s),getFilterChanges:s=>getFilterChanges$2(o,s),getFilterLogs:s=>getFilterLogs$2(o,s),getGasPrice:()=>getGasPrice$2(o),getLogs:s=>getLogs$2(o,s),getProof:s=>getProof$1(o,s),estimateMaxPriorityFeePerGas:s=>estimateMaxPriorityFeePerGas$2(o,s),getStorageAt:s=>getStorageAt$2(o,s),getTransaction:s=>getTransaction$2(o,s),getTransactionConfirmations:s=>getTransactionConfirmations$2(o,s),getTransactionCount:s=>getTransactionCount$2(o,s),getTransactionReceipt:s=>getTransactionReceipt$2(o,s),multicall:s=>multicall$3(o,s),prepareTransactionRequest:s=>prepareTransactionRequest$1(o,s),readContract:s=>readContract$3(o,s),sendRawTransaction:s=>sendRawTransaction$2(o,s),simulateContract:s=>simulateContract$2(o,s),verifyMessage:s=>verifyMessage$3(o,s),verifyTypedData:s=>verifyTypedData$3(o,s),uninstallFilter:s=>uninstallFilter$2(o,s),waitForTransactionReceipt:s=>waitForTransactionReceipt$2(o,s),watchBlocks:s=>watchBlocks$2(o,s),watchBlockNumber:s=>watchBlockNumber$2(o,s),watchContractEvent:s=>watchContractEvent$2(o,s),watchEvent:s=>watchEvent$1(o,s),watchPendingTransactions:s=>watchPendingTransactions$2(o,s)}}function createPublicClient$1(o){const{key:s="public",name:a="Public Client"}=o;return createClient$2({...o,key:s,name:a,type:"publicClient"}).extend(publicActions)}function deployContract$2(o,{abi:s,args:a,bytecode:rt,...ot}){const tr=encodeDeployData$2({abi:s,args:a,bytecode:rt});return sendTransaction$3(o,{...ot,data:tr})}async function getAddresses$2(o){var a;return((a=o.account)==null?void 0:a.type)==="local"?[o.account.address]:(await o.request({method:"eth_accounts"})).map(rt=>checksumAddress$1(rt))}async function getPermissions$2(o){return await o.request({method:"wallet_getPermissions"})}async function requestAddresses$2(o){return(await o.request({method:"eth_requestAccounts"})).map(a=>getAddress$2(a))}async function requestPermissions$2(o,s){return o.request({method:"wallet_requestPermissions",params:[s]})}async function signMessage$3(o,{account:s=o.account,message:a}){if(!s)throw new AccountNotFoundError$1({docsPath:"/docs/actions/wallet/signMessage"});const rt=parseAccount$2(s);if(rt.type==="local")return rt.signMessage({message:a});const ot=(()=>typeof a=="string"?stringToHex(a):a.raw instanceof Uint8Array?toHex$1(a.raw):a.raw)();return o.request({method:"personal_sign",params:[ot,rt.address]})}async function signTransaction$1(o,s){var ir,sr,ar,ur;const{account:a=o.account,chain:rt=o.chain,...ot}=s;if(!a)throw new AccountNotFoundError$1({docsPath:"/docs/actions/wallet/signTransaction"});const tr=parseAccount$2(a);assertRequest$2({account:tr,...s});const Ut=await getChainId$2(o);rt!==null&&assertCurrentChain$1({currentChainId:Ut,chain:rt});const rr=(rt==null?void 0:rt.formatters)||((ir=o.chain)==null?void 0:ir.formatters),nr=((sr=rr==null?void 0:rr.transactionRequest)==null?void 0:sr.format)||formatTransactionRequest;return tr.type==="local"?tr.signTransaction({...ot,chainId:Ut},{serializer:(ur=(ar=o.chain)==null?void 0:ar.serializers)==null?void 0:ur.transaction}):await o.request({method:"eth_signTransaction",params:[{...nr(ot),chainId:numberToHex(Ut),from:tr.address}]})}async function signTypedData$3(o,{account:s=o.account,domain:a,message:rt,primaryType:ot,types:tr}){if(!s)throw new AccountNotFoundError$1({docsPath:"/docs/actions/wallet/signTypedData"});const Ut=parseAccount$2(s),rr={EIP712Domain:getTypesForEIP712Domain({domain:a}),...tr};if(validateTypedData({domain:a,message:rt,primaryType:ot,types:rr}),Ut.type==="local")return Ut.signTypedData({domain:a,primaryType:ot,types:rr,message:rt});const nr=stringify$2({domain:a??{},primaryType:ot,types:rr,message:rt},(ir,sr)=>isHex$2(sr)?sr.toLowerCase():sr);return o.request({method:"eth_signTypedData_v4",params:[Ut.address,nr]})}async function switchChain$2(o,{id:s}){await o.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(s)}]})}async function watchAsset$2(o,s){return await o.request({method:"wallet_watchAsset",params:s})}function walletActions(o){return{addChain:s=>addChain$2(o,s),deployContract:s=>deployContract$2(o,s),getAddresses:()=>getAddresses$2(o),getChainId:()=>getChainId$2(o),getPermissions:()=>getPermissions$2(o),prepareTransactionRequest:s=>prepareTransactionRequest$1(o,s),requestAddresses:()=>requestAddresses$2(o),requestPermissions:s=>requestPermissions$2(o,s),sendRawTransaction:s=>sendRawTransaction$2(o,s),sendTransaction:s=>sendTransaction$3(o,s),signMessage:s=>signMessage$3(o,s),signTransaction:s=>signTransaction$1(o,s),signTypedData:s=>signTypedData$3(o,s),switchChain:s=>switchChain$2(o,s),watchAsset:s=>watchAsset$2(o,s),writeContract:s=>writeContract$3(o,s)}}function createWalletClient$1(o){const{key:s="wallet",name:a="Wallet Client",transport:rt}=o;return createClient$2({...o,key:s,name:a,transport:tr=>rt({...tr,retryCount:0}),type:"walletClient"}).extend(walletActions)}function webSocket$2(o,s={}){const{key:a="webSocket",name:rt="WebSocket JSON-RPC",retryDelay:ot}=s;return({chain:tr,retryCount:Ut,timeout:rr})=>{var ar;const nr=s.retryCount??Ut,ir=rr??s.timeout??1e4,sr=o||((ar=tr==null?void 0:tr.rpcUrls.default.webSocket)==null?void 0:ar[0]);if(!sr)throw new UrlRequiredError$1;return createTransport$2({key:a,name:rt,async request({method:ur,params:cr}){const lr={method:ur,params:cr},hr=await getSocket(sr),{error:gr,result:vr}=await rpc$3.webSocketAsync(hr,{body:lr,timeout:ir});if(gr)throw new RpcRequestError$1({body:lr,error:gr,url:sr});return vr},retryCount:nr,retryDelay:ot,timeout:ir,type:"webSocket"},{getSocket(){return getSocket(sr)},async subscribe({params:ur,onData:cr,onError:lr}){const hr=await getSocket(sr),{result:gr}=await new Promise((vr,fr)=>rpc$3.webSocket(hr,{body:{method:"eth_subscribe",params:ur},onResponse(br){if(br.error){fr(br.error),lr==null||lr(br.error);return}if(typeof br.id=="number"){vr(br);return}br.method==="eth_subscription"&&cr(br.params)}}));return{subscriptionId:gr,async unsubscribe(){return new Promise(vr=>rpc$3.webSocket(hr,{body:{method:"eth_unsubscribe",params:[gr]},onResponse:vr}))}}}})}}function setBigUint64(o,s,a,rt){if(typeof o.setBigUint64=="function")return o.setBigUint64(s,a,rt);const ot=BigInt(32),tr=BigInt(4294967295),Ut=Number(a>>ot&tr),rr=Number(a&tr),nr=rt?4:0,ir=rt?0:4;o.setUint32(s+nr,Ut,rt),o.setUint32(s+ir,rr,rt)}class SHA2 extends Hash{constructor(s,a,rt,ot){super(),this.blockLen=s,this.outputLen=a,this.padOffset=rt,this.isLE=ot,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(s),this.view=createView(this.buffer)}update(s){exists(this);const{view:a,buffer:rt,blockLen:ot}=this;s=toBytes$1(s);const tr=s.length;for(let Ut=0;Utot-Ut&&(this.process(rt,0),Ut=0);for(let ar=Ut;arsr.length)throw new Error("_sha2: outputLen bigger than state");for(let ar=0;aro&s^~o&a,Maj=(o,s,a)=>o&s^o&a^s&a,SHA256_K=new Uint32Array([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]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:s,B:a,C:rt,D:ot,E:tr,F:Ut,G:rr,H:nr}=this;return[s,a,rt,ot,tr,Ut,rr,nr]}set(s,a,rt,ot,tr,Ut,rr,nr){this.A=s|0,this.B=a|0,this.C=rt|0,this.D=ot|0,this.E=tr|0,this.F=Ut|0,this.G=rr|0,this.H=nr|0}process(s,a){for(let ar=0;ar<16;ar++,a+=4)SHA256_W[ar]=s.getUint32(a,!1);for(let ar=16;ar<64;ar++){const ur=SHA256_W[ar-15],cr=SHA256_W[ar-2],lr=rotr(ur,7)^rotr(ur,18)^ur>>>3,hr=rotr(cr,17)^rotr(cr,19)^cr>>>10;SHA256_W[ar]=hr+SHA256_W[ar-7]+lr+SHA256_W[ar-16]|0}let{A:rt,B:ot,C:tr,D:Ut,E:rr,F:nr,G:ir,H:sr}=this;for(let ar=0;ar<64;ar++){const ur=rotr(rr,6)^rotr(rr,11)^rotr(rr,25),cr=sr+ur+Chi(rr,nr,ir)+SHA256_K[ar]+SHA256_W[ar]|0,hr=(rotr(rt,2)^rotr(rt,13)^rotr(rt,22))+Maj(rt,ot,tr)|0;sr=ir,ir=nr,nr=rr,rr=Ut+cr|0,Ut=tr,tr=ot,ot=rt,rt=cr+hr|0}rt=rt+this.A|0,ot=ot+this.B|0,tr=tr+this.C|0,Ut=Ut+this.D|0,rr=rr+this.E|0,nr=nr+this.F|0,ir=ir+this.G|0,sr=sr+this.H|0,this.set(rt,ot,tr,Ut,rr,nr,ir,sr)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const sha256$1=wrapConstructor(()=>new SHA256);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$3=BigInt(0),_1n$3=BigInt(1),_2n$2=BigInt(2),_3n$1=BigInt(3),_4n$1=BigInt(4),_5n=BigInt(5),_8n=BigInt(8);BigInt(9);BigInt(16);function mod(o,s){const a=o%s;return a>=_0n$3?a:s+a}function pow(o,s,a){if(a<=_0n$3||s<_0n$3)throw new Error("Expected power/modulo > 0");if(a===_1n$3)return _0n$3;let rt=_1n$3;for(;s>_0n$3;)s&_1n$3&&(rt=rt*o%a),o=o*o%a,s>>=_1n$3;return rt}function pow2(o,s,a){let rt=o;for(;s-- >_0n$3;)rt*=rt,rt%=a;return rt}function invert(o,s){if(o===_0n$3||s<=_0n$3)throw new Error(`invert: expected positive integers, got n=${o} mod=${s}`);let a=mod(o,s),rt=s,ot=_0n$3,tr=_1n$3;for(;a!==_0n$3;){const rr=rt/a,nr=rt%a,ir=ot-tr*rr;rt=a,a=nr,ot=tr,tr=ir}if(rt!==_1n$3)throw new Error("invert: does not exist");return mod(ot,s)}function tonelliShanks(o){const s=(o-_1n$3)/_2n$2;let a,rt,ot;for(a=o-_1n$3,rt=0;a%_2n$2===_0n$3;a/=_2n$2,rt++);for(ot=_2n$2;ot(rt[ot]="function",rt),s);return validateObject(o,a)}function FpPow(o,s,a){if(a<_0n$3)throw new Error("Expected power > 0");if(a===_0n$3)return o.ONE;if(a===_1n$3)return s;let rt=o.ONE,ot=s;for(;a>_0n$3;)a&_1n$3&&(rt=o.mul(rt,ot)),ot=o.sqr(ot),a>>=_1n$3;return rt}function FpInvertBatch(o,s){const a=new Array(s.length),rt=s.reduce((tr,Ut,rr)=>o.is0(Ut)?tr:(a[rr]=tr,o.mul(tr,Ut)),o.ONE),ot=o.inv(rt);return s.reduceRight((tr,Ut,rr)=>o.is0(Ut)?tr:(a[rr]=o.mul(tr,a[rr]),o.mul(tr,Ut)),ot),a}function nLength(o,s){const a=s!==void 0?s:o.toString(2).length,rt=Math.ceil(a/8);return{nBitLength:a,nByteLength:rt}}function Field(o,s,a=!1,rt={}){if(o<=_0n$3)throw new Error(`Expected Field ORDER > 0, got ${o}`);const{nBitLength:ot,nByteLength:tr}=nLength(o,s);if(tr>2048)throw new Error("Field lengths over 2048 bytes are not supported");const Ut=FpSqrt(o),rr=Object.freeze({ORDER:o,BITS:ot,BYTES:tr,MASK:bitMask(ot),ZERO:_0n$3,ONE:_1n$3,create:nr=>mod(nr,o),isValid:nr=>{if(typeof nr!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof nr}`);return _0n$3<=nr&&nrnr===_0n$3,isOdd:nr=>(nr&_1n$3)===_1n$3,neg:nr=>mod(-nr,o),eql:(nr,ir)=>nr===ir,sqr:nr=>mod(nr*nr,o),add:(nr,ir)=>mod(nr+ir,o),sub:(nr,ir)=>mod(nr-ir,o),mul:(nr,ir)=>mod(nr*ir,o),pow:(nr,ir)=>FpPow(rr,nr,ir),div:(nr,ir)=>mod(nr*invert(ir,o),o),sqrN:nr=>nr*nr,addN:(nr,ir)=>nr+ir,subN:(nr,ir)=>nr-ir,mulN:(nr,ir)=>nr*ir,inv:nr=>invert(nr,o),sqrt:rt.sqrt||(nr=>Ut(rr,nr)),invertBatch:nr=>FpInvertBatch(rr,nr),cmov:(nr,ir,sr)=>sr?ir:nr,toBytes:nr=>a?numberToBytesLE(nr,tr):numberToBytesBE(nr,tr),fromBytes:nr=>{if(nr.length!==tr)throw new Error(`Fp.fromBytes: expected ${tr}, got ${nr.length}`);return a?bytesToNumberLE(nr):bytesToNumberBE(nr)}});return Object.freeze(rr)}function getFieldBytesLength(o){if(typeof o!="bigint")throw new Error("field order must be bigint");const s=o.toString(2).length;return Math.ceil(s/8)}function getMinHashLength(o){const s=getFieldBytesLength(o);return s+Math.ceil(s/2)}function mapHashToField(o,s,a=!1){const rt=o.length,ot=getFieldBytesLength(s),tr=getMinHashLength(s);if(rt<16||rt1024)throw new Error(`expected ${tr}-1024 bytes of input, got ${rt}`);const Ut=a?bytesToNumberBE(o):bytesToNumberLE(o),rr=mod(Ut,s-_1n$3)+_1n$3;return a?numberToBytesLE(rr,ot):numberToBytesBE(rr,ot)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$2=BigInt(1);function wNAF(o,s){const a=(ot,tr)=>{const Ut=tr.negate();return ot?Ut:tr},rt=ot=>{const tr=Math.ceil(s/ot)+1,Ut=2**(ot-1);return{windows:tr,windowSize:Ut}};return{constTimeNegate:a,unsafeLadder(ot,tr){let Ut=o.ZERO,rr=ot;for(;tr>_0n$2;)tr&_1n$2&&(Ut=Ut.add(rr)),rr=rr.double(),tr>>=_1n$2;return Ut},precomputeWindow(ot,tr){const{windows:Ut,windowSize:rr}=rt(tr),nr=[];let ir=ot,sr=ir;for(let ar=0;ar>=cr,gr>nr&&(gr-=ur,Ut+=_1n$2);const vr=hr,fr=hr+Math.abs(gr)-1,br=lr%2!==0,wr=gr<0;gr===0?sr=sr.add(a(br,tr[vr])):ir=ir.add(a(wr,tr[fr]))}return{p:ir,f:sr}},wNAFCached(ot,tr,Ut,rr){const nr=ot._WINDOW_SIZE||1;let ir=tr.get(ot);return ir||(ir=this.precomputeWindow(ot,nr),nr!==1&&tr.set(ot,rr(ir))),this.wNAF(nr,ir,Ut)}}}function validateBasic(o){return validateField(o.Fp),validateObject(o,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(o.n,o.nBitLength),...o,p:o.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts(o){const s=validateBasic(o);validateObject(s,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:a,Fp:rt,a:ot}=s;if(a){if(!rt.eql(ot,rt.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof a!="object"||typeof a.beta!="bigint"||typeof a.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...s})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=utils$8,DER={Err:class extends Error{constructor(s=""){super(s)}},_parseInt(o){const{Err:s}=DER;if(o.length<2||o[0]!==2)throw new s("Invalid signature integer tag");const a=o[1],rt=o.subarray(2,a+2);if(!a||rt.length!==a)throw new s("Invalid signature integer: wrong length");if(rt[0]&128)throw new s("Invalid signature integer: negative");if(rt[0]===0&&!(rt[1]&128))throw new s("Invalid signature integer: unnecessary leading zero");return{d:b2n(rt),l:o.subarray(a+2)}},toSig(o){const{Err:s}=DER,a=typeof o=="string"?h2b(o):o;if(!(a instanceof Uint8Array))throw new Error("ui8a expected");let rt=a.length;if(rt<2||a[0]!=48)throw new s("Invalid signature tag");if(a[1]!==rt-2)throw new s("Invalid signature: incorrect length");const{d:ot,l:tr}=DER._parseInt(a.subarray(2)),{d:Ut,l:rr}=DER._parseInt(tr);if(rr.length)throw new s("Invalid signature: left bytes after parsing");return{r:ot,s:Ut}},hexFromSig(o){const s=ir=>Number.parseInt(ir[0],16)&8?"00"+ir:ir,a=ir=>{const sr=ir.toString(16);return sr.length&1?`0${sr}`:sr},rt=s(a(o.s)),ot=s(a(o.r)),tr=rt.length/2,Ut=ot.length/2,rr=a(tr),nr=a(Ut);return`30${a(Ut+tr+4)}02${nr}${ot}02${rr}${rt}`}},_0n$1=BigInt(0),_1n$1=BigInt(1),_2n$1=BigInt(2),_3n=BigInt(3),_4n=BigInt(4);function weierstrassPoints(o){const s=validatePointOpts(o),{Fp:a}=s,rt=s.toBytes||((lr,hr,gr)=>{const vr=hr.toAffine();return concatBytes$1(Uint8Array.from([4]),a.toBytes(vr.x),a.toBytes(vr.y))}),ot=s.fromBytes||(lr=>{const hr=lr.subarray(1),gr=a.fromBytes(hr.subarray(0,a.BYTES)),vr=a.fromBytes(hr.subarray(a.BYTES,2*a.BYTES));return{x:gr,y:vr}});function tr(lr){const{a:hr,b:gr}=s,vr=a.sqr(lr),fr=a.mul(vr,lr);return a.add(a.add(fr,a.mul(lr,hr)),gr)}if(!a.eql(a.sqr(s.Gy),tr(s.Gx)))throw new Error("bad generator point: equation left != right");function Ut(lr){return typeof lr=="bigint"&&_0n$1a.eql(br,a.ZERO);return fr(gr)&&fr(vr)?ar.ZERO:new ar(gr,vr,a.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(hr){const gr=a.invertBatch(hr.map(vr=>vr.pz));return hr.map((vr,fr)=>vr.toAffine(gr[fr])).map(ar.fromAffine)}static fromHex(hr){const gr=ar.fromAffine(ot(ensureBytes("pointHex",hr)));return gr.assertValidity(),gr}static fromPrivateKey(hr){return ar.BASE.multiply(nr(hr))}_setWindowSize(hr){this._WINDOW_SIZE=hr,ir.delete(this)}assertValidity(){if(this.is0()){if(s.allowInfinityPoint&&!a.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:hr,y:gr}=this.toAffine();if(!a.isValid(hr)||!a.isValid(gr))throw new Error("bad point: x or y not FE");const vr=a.sqr(gr),fr=tr(hr);if(!a.eql(vr,fr))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:hr}=this.toAffine();if(a.isOdd)return!a.isOdd(hr);throw new Error("Field doesn't support isOdd")}equals(hr){sr(hr);const{px:gr,py:vr,pz:fr}=this,{px:br,py:wr,pz:$r}=hr,_r=a.eql(a.mul(gr,$r),a.mul(br,fr)),yr=a.eql(a.mul(vr,$r),a.mul(wr,fr));return _r&&yr}negate(){return new ar(this.px,a.neg(this.py),this.pz)}double(){const{a:hr,b:gr}=s,vr=a.mul(gr,_3n),{px:fr,py:br,pz:wr}=this;let $r=a.ZERO,_r=a.ZERO,yr=a.ZERO,Sr=a.mul(fr,fr),kr=a.mul(br,br),Ir=a.mul(wr,wr),Dr=a.m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),Dr=a.mul(Gr,Mr),yr=a.add(yr,Dr),Dr=a.mul(Nr,Mr),_r=a.mul(Ur,_r),_r=a.sub(_r,Dr),Dr=a.mul(Ur,Gr),Sr=a.mul(Nr,Sr),Sr=a.add(Sr,Dr),new ar(_r,yr,Sr)}subtract(hr){return this.add(hr.negate())}is0(){return this.equals(ar.ZERO)}wNAF(hr){return cr.wNAFCached(this,ir,hr,gr=>{const vr=a.invertBatch(gr.map(fr=>fr.pz));return gr.map((fr,br)=>fr.toAffine(vr[br])).map(ar.fromAffine)})}multiplyUnsafe(hr){const gr=ar.ZERO;if(hr===_0n$1)return gr;if(rr(hr),hr===_1n$1)return this;const{endo:vr}=s;if(!vr)return cr.unsafeLadder(this,hr);let{k1neg:fr,k1:br,k2neg:wr,k2:$r}=vr.splitScalar(hr),_r=gr,yr=gr,Sr=this;for(;br>_0n$1||$r>_0n$1;)br&_1n$1&&(_r=_r.add(Sr)),$r&_1n$1&&(yr=yr.add(Sr)),Sr=Sr.double(),br>>=_1n$1,$r>>=_1n$1;return fr&&(_r=_r.negate()),wr&&(yr=yr.negate()),yr=new ar(a.mul(yr.px,vr.beta),yr.py,yr.pz),_r.add(yr)}multiply(hr){rr(hr);let gr=hr,vr,fr;const{endo:br}=s;if(br){const{k1neg:wr,k1:$r,k2neg:_r,k2:yr}=br.splitScalar(gr);let{p:Sr,f:kr}=this.wNAF($r),{p:Ir,f:Dr}=this.wNAF(yr);Sr=cr.constTimeNegate(wr,Sr),Ir=cr.constTimeNegate(_r,Ir),Ir=new ar(a.mul(Ir.px,br.beta),Ir.py,Ir.pz),vr=Sr.add(Ir),fr=kr.add(Dr)}else{const{p:wr,f:$r}=this.wNAF(gr);vr=wr,fr=$r}return ar.normalizeZ([vr,fr])[0]}multiplyAndAddUnsafe(hr,gr,vr){const fr=ar.BASE,br=($r,_r)=>_r===_0n$1||_r===_1n$1||!$r.equals(fr)?$r.multiplyUnsafe(_r):$r.multiply(_r),wr=br(this,gr).add(br(hr,vr));return wr.is0()?void 0:wr}toAffine(hr){const{px:gr,py:vr,pz:fr}=this,br=this.is0();hr==null&&(hr=br?a.ONE:a.inv(fr));const wr=a.mul(gr,hr),$r=a.mul(vr,hr),_r=a.mul(fr,hr);if(br)return{x:a.ZERO,y:a.ZERO};if(!a.eql(_r,a.ONE))throw new Error("invZ was invalid");return{x:wr,y:$r}}isTorsionFree(){const{h:hr,isTorsionFree:gr}=s;if(hr===_1n$1)return!0;if(gr)return gr(ar,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:hr,clearCofactor:gr}=s;return hr===_1n$1?this:gr?gr(ar,this):this.multiplyUnsafe(s.h)}toRawBytes(hr=!0){return this.assertValidity(),rt(ar,this,hr)}toHex(hr=!0){return bytesToHex(this.toRawBytes(hr))}}ar.BASE=new ar(s.Gx,s.Gy,a.ONE),ar.ZERO=new ar(a.ZERO,a.ONE,a.ZERO);const ur=s.nBitLength,cr=wNAF(ar,s.endo?Math.ceil(ur/2):ur);return{CURVE:s,ProjectivePoint:ar,normPrivateKeyToScalar:nr,weierstrassEquation:tr,isWithinCurveOrder:Ut}}function validateOpts(o){const s=validateBasic(o);return validateObject(s,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...s})}function weierstrass(o){const s=validateOpts(o),{Fp:a,n:rt}=s,ot=a.BYTES+1,tr=2*a.BYTES+1;function Ut(Mr){return _0n$1bytesToHex(numberToBytesBE(Mr,s.nByteLength));function lr(Mr){const Nr=rt>>_1n$1;return Mr>Nr}function hr(Mr){return lr(Mr)?rr(-Mr):Mr}const gr=(Mr,Nr,Pr)=>bytesToNumberBE(Mr.slice(Nr,Pr));class vr{constructor(Nr,Pr,Tr){this.r=Nr,this.s=Pr,this.recovery=Tr,this.assertValidity()}static fromCompact(Nr){const Pr=s.nByteLength;return Nr=ensureBytes("compactSignature",Nr,Pr*2),new vr(gr(Nr,0,Pr),gr(Nr,Pr,2*Pr))}static fromDER(Nr){const{r:Pr,s:Tr}=DER.toSig(ensureBytes("DER",Nr));return new vr(Pr,Tr)}assertValidity(){if(!ur(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!ur(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Nr){return new vr(this.r,this.s,Nr)}recoverPublicKey(Nr){const{r:Pr,s:Tr,recovery:Hr}=this,Wr=yr(ensureBytes("msgHash",Nr));if(Hr==null||![0,1,2,3].includes(Hr))throw new Error("recovery id invalid");const Jr=Hr===2||Hr===3?Pr+s.n:Pr;if(Jr>=a.ORDER)throw new Error("recovery id 2 or 3 invalid");const Xr=Hr&1?"03":"02",Br=ir.fromHex(Xr+cr(Jr)),Kr=nr(Jr),hn=rr(-Wr*Kr),wn=rr(Tr*Kr),Gn=ir.BASE.multiplyAndAddUnsafe(Br,hn,wn);if(!Gn)throw new Error("point at infinify");return Gn.assertValidity(),Gn}hasHighS(){return lr(this.s)}normalizeS(){return this.hasHighS()?new vr(this.r,rr(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return cr(this.r)+cr(this.s)}}const fr={isValidPrivateKey(Mr){try{return sr(Mr),!0}catch{return!1}},normPrivateKeyToScalar:sr,randomPrivateKey:()=>{const Mr=getMinHashLength(s.n);return mapHashToField(s.randomBytes(Mr),s.n)},precompute(Mr=8,Nr=ir.BASE){return Nr._setWindowSize(Mr),Nr.multiply(BigInt(3)),Nr}};function br(Mr,Nr=!0){return ir.fromPrivateKey(Mr).toRawBytes(Nr)}function wr(Mr){const Nr=Mr instanceof Uint8Array,Pr=typeof Mr=="string",Tr=(Nr||Pr)&&Mr.length;return Nr?Tr===ot||Tr===tr:Pr?Tr===2*ot||Tr===2*tr:Mr instanceof ir}function $r(Mr,Nr,Pr=!0){if(wr(Mr))throw new Error("first arg must be private key");if(!wr(Nr))throw new Error("second arg must be public key");return ir.fromHex(Nr).multiply(sr(Mr)).toRawBytes(Pr)}const _r=s.bits2int||function(Mr){const Nr=bytesToNumberBE(Mr),Pr=Mr.length*8-s.nBitLength;return Pr>0?Nr>>BigInt(Pr):Nr},yr=s.bits2int_modN||function(Mr){return rr(_r(Mr))},Sr=bitMask(s.nBitLength);function kr(Mr){if(typeof Mr!="bigint")throw new Error("bigint expected");if(!(_0n$1<=Mr&&Mreo in Pr))throw new Error("sign() legacy options not supported");const{hash:Tr,randomBytes:Hr}=s;let{lowS:Wr,prehash:Jr,extraEntropy:Xr}=Pr;Wr==null&&(Wr=!0),Mr=ensureBytes("msgHash",Mr),Jr&&(Mr=ensureBytes("prehashed msgHash",Tr(Mr)));const Br=yr(Mr),Kr=sr(Nr),hn=[kr(Kr),kr(Br)];if(Xr!=null){const eo=Xr===!0?Hr(a.BYTES):Xr;hn.push(ensureBytes("extraEntropy",eo))}const wn=concatBytes$1(...hn),Gn=Br;function Yn(eo){const Wn=_r(eo);if(!ur(Wn))return;const In=nr(Wn),En=ir.BASE.multiply(Wn).toAffine(),io=rr(En.x);if(io===_0n$1)return;const uo=rr(In*rr(Gn+io*Kr));if(uo===_0n$1)return;let xo=(En.x===io?0:2)|Number(En.y&_1n$1),qr=uo;return Wr&&lr(uo)&&(qr=hr(uo),xo^=1),new vr(io,qr,xo)}return{seed:wn,k2sig:Yn}}const Dr={lowS:s.lowS,prehash:!1},Gr={lowS:s.lowS,prehash:!1};function Fr(Mr,Nr,Pr=Dr){const{seed:Tr,k2sig:Hr}=Ir(Mr,Nr,Pr),Wr=s;return createHmacDrbg(Wr.hash.outputLen,Wr.nByteLength,Wr.hmac)(Tr,Hr)}ir.BASE._setWindowSize(8);function Ur(Mr,Nr,Pr,Tr=Gr){var En;const Hr=Mr;if(Nr=ensureBytes("msgHash",Nr),Pr=ensureBytes("publicKey",Pr),"strict"in Tr)throw new Error("options.strict was renamed to lowS");const{lowS:Wr,prehash:Jr}=Tr;let Xr,Br;try{if(typeof Hr=="string"||Hr instanceof Uint8Array)try{Xr=vr.fromDER(Hr)}catch(io){if(!(io instanceof DER.Err))throw io;Xr=vr.fromCompact(Hr)}else if(typeof Hr=="object"&&typeof Hr.r=="bigint"&&typeof Hr.s=="bigint"){const{r:io,s:uo}=Hr;Xr=new vr(io,uo)}else throw new Error("PARSE");Br=ir.fromHex(Pr)}catch(io){if(io.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Wr&&Xr.hasHighS())return!1;Jr&&(Nr=s.hash(Nr));const{r:Kr,s:hn}=Xr,wn=yr(Nr),Gn=nr(hn),Yn=rr(wn*Gn),eo=rr(Kr*Gn),Wn=(En=ir.BASE.multiplyAndAddUnsafe(Br,Yn,eo))==null?void 0:En.toAffine();return Wn?rr(Wn.x)===Kr:!1}return{CURVE:s,getPublicKey:br,getSharedSecret:$r,sign:Fr,verify:Ur,ProjectivePoint:ir,Signature:vr,utils:fr}}function SWUFpSqrtRatio(o,s){const a=o.ORDER;let rt=_0n$1;for(let lr=a-_1n$1;lr%_2n$1===_0n$1;lr/=_2n$1)rt+=_1n$1;const ot=rt,tr=_2n$1<{let gr=ar,vr=o.pow(hr,ir),fr=o.sqr(vr);fr=o.mul(fr,hr);let br=o.mul(lr,fr);br=o.pow(br,nr),br=o.mul(br,vr),vr=o.mul(br,hr),fr=o.mul(br,lr);let wr=o.mul(fr,vr);br=o.pow(wr,sr);let $r=o.eql(br,o.ONE);vr=o.mul(fr,ur),br=o.mul(wr,gr),fr=o.cmov(vr,fr,$r),wr=o.cmov(br,wr,$r);for(let _r=ot;_r>_1n$1;_r--){let yr=_r-_2n$1;yr=_2n$1<{let fr=o.sqr(vr);const br=o.mul(gr,vr);fr=o.mul(fr,br);let wr=o.pow(fr,lr);wr=o.mul(wr,br);const $r=o.mul(wr,hr),_r=o.mul(o.sqr(wr),vr),yr=o.eql(_r,gr);let Sr=o.cmov($r,wr,yr);return{isValid:yr,value:Sr}}}return cr}function mapToCurveSimpleSWU(o,s){if(validateField(o),!o.isValid(s.A)||!o.isValid(s.B)||!o.isValid(s.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const a=SWUFpSqrtRatio(o,s.Z);if(!o.isOdd)throw new Error("Fp.isOdd is not implemented!");return rt=>{let ot,tr,Ut,rr,nr,ir,sr,ar;ot=o.sqr(rt),ot=o.mul(ot,s.Z),tr=o.sqr(ot),tr=o.add(tr,ot),Ut=o.add(tr,o.ONE),Ut=o.mul(Ut,s.B),rr=o.cmov(s.Z,o.neg(tr),!o.eql(tr,o.ZERO)),rr=o.mul(rr,s.A),tr=o.sqr(Ut),ir=o.sqr(rr),nr=o.mul(ir,s.A),tr=o.add(tr,nr),tr=o.mul(tr,Ut),ir=o.mul(ir,rr),nr=o.mul(ir,s.B),tr=o.add(tr,nr),sr=o.mul(ot,Ut);const{isValid:ur,value:cr}=a(tr,ir);ar=o.mul(ot,rt),ar=o.mul(ar,cr),sr=o.cmov(sr,Ut,ur),ar=o.cmov(ar,cr,ur);const lr=o.isOdd(rt)===o.isOdd(ar);return ar=o.cmov(o.neg(ar),ar,lr),sr=o.div(sr,rr),{x:sr,y:ar}}}function validateDST(o){if(o instanceof Uint8Array)return o;if(typeof o=="string")return utf8ToBytes(o);throw new Error("DST must be Uint8Array or string")}const os2ip=bytesToNumberBE;function i2osp(o,s){if(o<0||o>=1<<8*s)throw new Error(`bad I2OSP call: value=${o} length=${s}`);const a=Array.from({length:s}).fill(0);for(let rt=s-1;rt>=0;rt--)a[rt]=o&255,o>>>=8;return new Uint8Array(a)}function strxor(o,s){const a=new Uint8Array(o.length);for(let rt=0;rt255&&(s=rt(concatBytes$1(utf8ToBytes("H2C-OVERSIZE-DST-"),s)));const{outputLen:ot,blockLen:tr}=rt,Ut=Math.ceil(a/ot);if(Ut>255)throw new Error("Invalid xmd length");const rr=concatBytes$1(s,i2osp(s.length,1)),nr=i2osp(0,tr),ir=i2osp(a,2),sr=new Array(Ut),ar=rt(concatBytes$1(nr,o,ir,i2osp(0,1),rr));sr[0]=rt(concatBytes$1(ar,i2osp(1,1),rr));for(let cr=1;cr<=Ut;cr++){const lr=[strxor(ar,sr[cr-1]),i2osp(cr+1,1),rr];sr[cr]=rt(concatBytes$1(...lr))}return concatBytes$1(...sr).slice(0,a)}function expand_message_xof(o,s,a,rt,ot){if(isBytes$2(o),isBytes$2(s),isNum(a),s.length>255){const tr=Math.ceil(2*rt/8);s=ot.create({dkLen:tr}).update(utf8ToBytes("H2C-OVERSIZE-DST-")).update(s).digest()}if(a>65535||s.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return ot.create({dkLen:a}).update(o).update(i2osp(a,2)).update(s).update(i2osp(s.length,1)).digest()}function hash_to_field(o,s,a){validateObject(a,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:rt,k:ot,m:tr,hash:Ut,expand:rr,DST:nr}=a;isBytes$2(o),isNum(s);const ir=validateDST(nr),sr=rt.toString(2).length,ar=Math.ceil((sr+ot)/8),ur=s*tr*ar;let cr;if(rr==="xmd")cr=expand_message_xmd(o,ir,ur,Ut);else if(rr==="xof")cr=expand_message_xof(o,ir,ur,ot,Ut);else if(rr==="_internal_pass")cr=o;else throw new Error('expand must be "xmd" or "xof"');const lr=new Array(s);for(let hr=0;hrArray.from(rt).reverse());return(rt,ot)=>{const[tr,Ut,rr,nr]=a.map(ir=>ir.reduce((sr,ar)=>o.add(o.mul(sr,rt),ar)));return rt=o.div(tr,Ut),ot=o.mul(ot,o.div(rr,nr)),{x:rt,y:ot}}}function createHasher(o,s,a){if(typeof s!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(rt,ot){const tr=hash_to_field(rt,2,{...a,DST:a.DST,...ot}),Ut=o.fromAffine(s(tr[0])),rr=o.fromAffine(s(tr[1])),nr=Ut.add(rr).clearCofactor();return nr.assertValidity(),nr},encodeToCurve(rt,ot){const tr=hash_to_field(rt,1,{...a,DST:a.encodeDST,...ot}),Ut=o.fromAffine(s(tr[0])).clearCofactor();return Ut.assertValidity(),Ut}}}let HMAC$1=class extends Hash{constructor(s,a){super(),this.finished=!1,this.destroyed=!1,hash$5(s);const rt=toBytes$1(a);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const ot=this.blockLen,tr=new Uint8Array(ot);tr.set(rt.length>ot?s.create().update(rt).digest():rt);for(let Ut=0;Utnew HMAC$1(o,s).update(a).digest();hmac$2.create=(o,s)=>new HMAC$1(o,s);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(o){return{hash:o,hmac:(s,...a)=>hmac$2(o,s,concatBytes$2(...a)),randomBytes}}function createCurve(o,s){const a=rt=>weierstrass({...o,...getHash(rt)});return Object.freeze({...a(s),create:a})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n=BigInt(1),_2n=BigInt(2),divNearest=(o,s)=>(o+s/_2n)/s;function sqrtMod(o){const s=secp256k1P,a=BigInt(3),rt=BigInt(6),ot=BigInt(11),tr=BigInt(22),Ut=BigInt(23),rr=BigInt(44),nr=BigInt(88),ir=o*o*o%s,sr=ir*ir*o%s,ar=pow2(sr,a,s)*sr%s,ur=pow2(ar,a,s)*sr%s,cr=pow2(ur,_2n,s)*ir%s,lr=pow2(cr,ot,s)*cr%s,hr=pow2(lr,tr,s)*lr%s,gr=pow2(hr,rr,s)*hr%s,vr=pow2(gr,nr,s)*gr%s,fr=pow2(vr,rr,s)*hr%s,br=pow2(fr,a,s)*sr%s,wr=pow2(br,Ut,s)*lr%s,$r=pow2(wr,rt,s)*ir%s,_r=pow2($r,_2n,s);if(!Fp.eql(Fp.sqr(_r),o))throw new Error("Cannot find square root");return _r}const Fp=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:o=>{const s=secp256k1N,a=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),rt=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ot=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),tr=a,Ut=BigInt("0x100000000000000000000000000000000"),rr=divNearest(tr*o,s),nr=divNearest(-rt*o,s);let ir=mod(o-rr*a-nr*ot,s),sr=mod(-rr*rt-nr*tr,s);const ar=ir>Ut,ur=sr>Ut;if(ar&&(ir=s-ir),ur&&(sr=s-sr),ir>Ut||sr>Ut)throw new Error("splitScalar: Endomorphism failed, k="+o);return{k1neg:ar,k1:ir,k2neg:ur,k2:sr}}}},sha256$1),_0n=BigInt(0),fe=o=>typeof o=="bigint"&&_0ntypeof o=="bigint"&&_0not.charCodeAt(0)));a=concatBytes$1(rt,rt),TAGGED_HASH_PREFIXES[o]=a}return sha256$1(concatBytes$1(a,...s))}const pointToBytes=o=>o.toRawBytes(!0).slice(1),numTo32b=o=>numberToBytesBE(o,32),modP=o=>mod(o,secp256k1P),modN=o=>mod(o,secp256k1N),Point=secp256k1.ProjectivePoint,GmulAdd=(o,s,a)=>Point.BASE.multiplyAndAddUnsafe(o,s,a);function schnorrGetExtPubKey(o){let s=secp256k1.utils.normPrivateKeyToScalar(o),a=Point.fromPrivateKey(s);return{scalar:a.hasEvenY()?s:modN(-s),bytes:pointToBytes(a)}}function lift_x(o){if(!fe(o))throw new Error("bad x: need 0 < x < p");const s=modP(o*o),a=modP(s*o+BigInt(7));let rt=sqrtMod(a);rt%_2n!==_0n&&(rt=modP(-rt));const ot=new Point(o,rt,_1n);return ot.assertValidity(),ot}function challenge(...o){return modN(bytesToNumberBE(taggedHash("BIP0340/challenge",...o)))}function schnorrGetPublicKey(o){return schnorrGetExtPubKey(o).bytes}function schnorrSign(o,s,a=randomBytes(32)){const rt=ensureBytes("message",o),{bytes:ot,scalar:tr}=schnorrGetExtPubKey(s),Ut=ensureBytes("auxRand",a,32),rr=numTo32b(tr^bytesToNumberBE(taggedHash("BIP0340/aux",Ut))),nr=taggedHash("BIP0340/nonce",rr,ot,rt),ir=modN(bytesToNumberBE(nr));if(ir===_0n)throw new Error("sign failed: k is zero");const{bytes:sr,scalar:ar}=schnorrGetExtPubKey(ir),ur=challenge(sr,ot,rt),cr=new Uint8Array(64);if(cr.set(sr,0),cr.set(numTo32b(modN(ar+ur*tr)),32),!schnorrVerify(cr,rt,ot))throw new Error("sign: Invalid signature produced");return cr}function schnorrVerify(o,s,a){const rt=ensureBytes("signature",o,64),ot=ensureBytes("message",s),tr=ensureBytes("publicKey",a,32);try{const Ut=lift_x(bytesToNumberBE(tr)),rr=bytesToNumberBE(rt.subarray(0,32));if(!fe(rr))return!1;const nr=bytesToNumberBE(rt.subarray(32,64));if(!ge(nr))return!1;const ir=challenge(numTo32b(rr),pointToBytes(Ut),ot),sr=GmulAdd(Ut,nr,modN(-ir));return!(!sr||!sr.hasEvenY()||sr.toAffine().x!==rr)}catch{return!1}}const schnorr=(()=>({getPublicKey:schnorrGetPublicKey,sign:schnorrSign,verify:schnorrVerify,utils:{randomPrivateKey:secp256k1.utils.randomPrivateKey,lift_x,pointToBytes,numberToBytesBE,bytesToNumberBE,taggedHash,mod}}))(),isoMap=(()=>isogenyMap(Fp,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(o=>o.map(s=>BigInt(s)))))(),mapSWU=(()=>mapToCurveSimpleSWU(Fp,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Fp.create(BigInt("-11"))}))(),htf=(()=>createHasher(secp256k1.ProjectivePoint,o=>{const{x:s,y:a}=mapSWU(Fp.create(o[0]));return isoMap(s,a)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Fp.ORDER,m:1,k:128,expand:"xmd",hash:sha256$1}))(),hashToCurve=(()=>htf.hashToCurve)(),encodeToCurve=(()=>htf.encodeToCurve)(),secp256k1$1=Object.freeze(Object.defineProperty({__proto__:null,encodeToCurve,hashToCurve,schnorr,secp256k1},Symbol.toStringTag,{value:"Module"})),goerli=defineChain$1({id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),mainnet=defineChain$1({id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),sepolia=defineChain$1({id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x21B000Fd62a880b2125A61e36a284BB757b76025",blockCreated:3914906}},testnet:!0});var ChainNotConfiguredForConnectorError=class extends Error{constructor({chainId:o,connectorId:s}){super(`Chain "${o}" not configured for connector "${s}".`),this.name="ChainNotConfiguredForConnectorError"}},ConnectorNotFoundError=class extends Error{constructor(){super(...arguments),this.name="ConnectorNotFoundError",this.message="Connector not found"}};function normalizeChainId(o){return typeof o=="string"?Number.parseInt(o,o.trim().substring(0,2)==="0x"?16:10):typeof o=="bigint"?Number(o):o}var eventemitter3={exports:{}};(function(o){var s=Object.prototype.hasOwnProperty,a="~";function rt(){}Object.create&&(rt.prototype=Object.create(null),new rt().__proto__||(a=!1));function ot(nr,ir,sr){this.fn=nr,this.context=ir,this.once=sr||!1}function tr(nr,ir,sr,ar,ur){if(typeof sr!="function")throw new TypeError("The listener must be a function");var cr=new ot(sr,ar||nr,ur),lr=a?a+ir:ir;return nr._events[lr]?nr._events[lr].fn?nr._events[lr]=[nr._events[lr],cr]:nr._events[lr].push(cr):(nr._events[lr]=cr,nr._eventsCount++),nr}function Ut(nr,ir){--nr._eventsCount===0?nr._events=new rt:delete nr._events[ir]}function rr(){this._events=new rt,this._eventsCount=0}rr.prototype.eventNames=function(){var ir=[],sr,ar;if(this._eventsCount===0)return ir;for(ar in sr=this._events)s.call(sr,ar)&&ir.push(a?ar.slice(1):ar);return Object.getOwnPropertySymbols?ir.concat(Object.getOwnPropertySymbols(sr)):ir},rr.prototype.listeners=function(ir){var sr=a?a+ir:ir,ar=this._events[sr];if(!ar)return[];if(ar.fn)return[ar.fn];for(var ur=0,cr=ar.length,lr=new Array(cr);ur{if(!s.has(o))throw TypeError("Cannot "+a)},__privateGet$1=(o,s,a)=>(__accessCheck$1(o,s,"read from private field"),a?a.call(o):s.get(o)),__privateAdd$1=(o,s,a)=>{if(s.has(o))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(o):s.set(o,a)},__privateSet$1=(o,s,a,rt)=>(__accessCheck$1(o,s,"write to private field"),rt?rt.call(o,a):s.set(o,a),a),__privateMethod$1=(o,s,a)=>(__accessCheck$1(o,s,"access private method"),a),Connector=class extends EventEmitter$1{constructor({chains:o=[mainnet,goerli],options:s}){super(),this.chains=o,this.options=s}getBlockExplorerUrls(o){const{default:s,...a}=o.blockExplorers??{};if(s)return[s.url,...Object.values(a).map(rt=>rt.url)]}isChainUnsupported(o){return!this.chains.some(s=>s.id===o)}setStorage(o){this.storage=o}};function getInjectedName(o){var a;if(!o)return"Injected";const s=rt=>{if(rt.isApexWallet)return"Apex Wallet";if(rt.isAvalanche)return"Core Wallet";if(rt.isBackpack)return"Backpack";if(rt.isBifrost)return"Bifrost Wallet";if(rt.isBitKeep)return"BitKeep";if(rt.isBitski)return"Bitski";if(rt.isBlockWallet)return"BlockWallet";if(rt.isBraveWallet)return"Brave Wallet";if(rt.isCoin98)return"Coin98 Wallet";if(rt.isCoinbaseWallet)return"Coinbase Wallet";if(rt.isDawn)return"Dawn Wallet";if(rt.isDefiant)return"Defiant";if(rt.isDesig)return"Desig Wallet";if(rt.isEnkrypt)return"Enkrypt";if(rt.isExodus)return"Exodus";if(rt.isFordefi)return"Fordefi";if(rt.isFrame)return"Frame";if(rt.isFrontier)return"Frontier Wallet";if(rt.isGamestop)return"GameStop Wallet";if(rt.isHaqqWallet)return"HAQQ Wallet";if(rt.isHyperPay)return"HyperPay Wallet";if(rt.isImToken)return"ImToken";if(rt.isHaloWallet)return"Halo Wallet";if(rt.isKuCoinWallet)return"KuCoin Wallet";if(rt.isMathWallet)return"MathWallet";if(rt.isNovaWallet)return"Nova Wallet";if(rt.isOkxWallet||rt.isOKExWallet)return"OKX Wallet";if(rt.isOneInchIOSWallet||rt.isOneInchAndroidWallet)return"1inch Wallet";if(rt.isOpera)return"Opera";if(rt.isPhantom)return"Phantom";if(rt.isPortal)return"Ripio Portal";if(rt.isRabby)return"Rabby Wallet";if(rt.isRainbow)return"Rainbow";if(rt.isStatus)return"Status";if(rt.isSubWallet)return"SubWallet";if(rt.isTalisman)return"Talisman";if(rt.isTally)return"Taho";if(rt.isTokenPocket)return"TokenPocket";if(rt.isTokenary)return"Tokenary";if(rt.isTrust||rt.isTrustWallet)return"Trust Wallet";if(rt.isTTWallet)return"TTWallet";if(rt.isXDEFI)return"XDEFI Wallet";if(rt.isZeal)return"Zeal";if(rt.isZerion)return"Zerion";if(rt.isMetaMask)return"MetaMask"};if((a=o.providers)!=null&&a.length){const rt=new Set;let ot=1;for(const Ut of o.providers){let rr=s(Ut);rr||(rr=`Unknown Wallet #${ot}`,ot+=1),rt.add(rr)}const tr=[...rt];return tr.length?tr:tr[0]??"Injected"}return s(o)??"Injected"}var _provider$2,InjectedConnector=class extends Connector{constructor({chains:o,options:s}={}){const a={shimDisconnect:!0,getProvider(){if(typeof window>"u")return;const ot=window.ethereum;return ot!=null&&ot.providers?ot.providers[0]:ot},...s};super({chains:o,options:a}),this.id="injected",__privateAdd$1(this,_provider$2,void 0),this.shimDisconnectKey=`${this.id}.shimDisconnect`,this.onAccountsChanged=ot=>{ot.length===0?this.emit("disconnect"):this.emit("change",{account:getAddress$2(ot[0])})},this.onChainChanged=ot=>{const tr=normalizeChainId(ot),Ut=this.isChainUnsupported(tr);this.emit("change",{chain:{id:tr,unsupported:Ut}})},this.onDisconnect=async ot=>{var tr;ot.code===1013&&await this.getProvider()&&await this.getAccount()||(this.emit("disconnect"),this.options.shimDisconnect&&((tr=this.storage)==null||tr.removeItem(this.shimDisconnectKey)))};const rt=a.getProvider();if(typeof a.name=="string")this.name=a.name;else if(rt){const ot=getInjectedName(rt);a.name?this.name=a.name(ot):typeof ot=="string"?this.name=ot:this.name=ot[0]}else this.name="Injected";this.ready=!!rt}async connect({chainId:o}={}){var s;try{const a=await this.getProvider();if(!a)throw new ConnectorNotFoundError;a.on&&(a.on("accountsChanged",this.onAccountsChanged),a.on("chainChanged",this.onChainChanged),a.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const rt=await a.request({method:"eth_requestAccounts"}),ot=getAddress$2(rt[0]);let tr=await this.getChainId(),Ut=this.isChainUnsupported(tr);return o&&tr!==o&&(tr=(await this.switchChain(o)).id,Ut=this.isChainUnsupported(tr)),this.options.shimDisconnect&&((s=this.storage)==null||s.setItem(this.shimDisconnectKey,!0)),{account:ot,chain:{id:tr,unsupported:Ut}}}catch(a){throw this.isUserRejectedRequestError(a)?new UserRejectedRequestError$1(a):a.code===-32002?new ResourceUnavailableRpcError$1(a):a}}async disconnect(){var s;const o=await this.getProvider();o!=null&&o.removeListener&&(o.removeListener("accountsChanged",this.onAccountsChanged),o.removeListener("chainChanged",this.onChainChanged),o.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&((s=this.storage)==null||s.removeItem(this.shimDisconnectKey)))}async getAccount(){const o=await this.getProvider();if(!o)throw new ConnectorNotFoundError;const s=await o.request({method:"eth_accounts"});return getAddress$2(s[0])}async getChainId(){const o=await this.getProvider();if(!o)throw new ConnectorNotFoundError;return o.request({method:"eth_chainId"}).then(normalizeChainId)}async getProvider(){const o=this.options.getProvider();return o&&__privateSet$1(this,_provider$2,o),__privateGet$1(this,_provider$2)}async getWalletClient({chainId:o}={}){const[s,a]=await Promise.all([this.getProvider(),this.getAccount()]),rt=this.chains.find(ot=>ot.id===o);if(!s)throw new Error("provider is required.");return createWalletClient$1({account:a,chain:rt,transport:custom$2(s)})}async isAuthorized(){var o;try{if(this.options.shimDisconnect&&!((o=this.storage)!=null&&o.getItem(this.shimDisconnectKey)))return!1;if(!await this.getProvider())throw new ConnectorNotFoundError;return!!await this.getAccount()}catch{return!1}}async switchChain(o){var rt,ot,tr;const s=await this.getProvider();if(!s)throw new ConnectorNotFoundError;const a=numberToHex(o);try{return await Promise.all([s.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]}),new Promise(Ut=>this.on("change",({chain:rr})=>{(rr==null?void 0:rr.id)===o&&Ut()}))]),this.chains.find(Ut=>Ut.id===o)??{id:o,name:`Chain ${a}`,network:`${a}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(Ut){const rr=this.chains.find(nr=>nr.id===o);if(!rr)throw new ChainNotConfiguredForConnectorError({chainId:o,connectorId:this.id});if(Ut.code===4902||((ot=(rt=Ut==null?void 0:Ut.data)==null?void 0:rt.originalError)==null?void 0:ot.code)===4902)try{if(await s.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:rr.name,nativeCurrency:rr.nativeCurrency,rpcUrls:[((tr=rr.rpcUrls.public)==null?void 0:tr.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(rr)}]}),await this.getChainId()!==o)throw new UserRejectedRequestError$1(new Error("User rejected switch after adding network."));return rr}catch(nr){throw new UserRejectedRequestError$1(nr)}throw this.isUserRejectedRequestError(Ut)?new UserRejectedRequestError$1(Ut):new SwitchChainError$1(Ut)}}async watchAsset({address:o,decimals:s=18,image:a,symbol:rt}){const ot=await this.getProvider();if(!ot)throw new ConnectorNotFoundError;return ot.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:o,decimals:s,image:a,symbol:rt}}})}isUserRejectedRequestError(o){return o.code===4001}};_provider$2=new WeakMap;var __accessCheck=(o,s,a)=>{if(!s.has(o))throw TypeError("Cannot "+a)},__privateGet=(o,s,a)=>(__accessCheck(o,s,"read from private field"),a?a.call(o):s.get(o)),__privateAdd=(o,s,a)=>{if(s.has(o))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(o):s.set(o,a)},__privateSet=(o,s,a,rt)=>(__accessCheck(o,s,"write to private field"),rt?rt.call(o,a):s.set(o,a),a),__privateMethod=(o,s,a)=>(__accessCheck(o,s,"access private method"),a);const subscribeWithSelectorImpl=o=>(s,a,rt)=>{const ot=rt.subscribe;return rt.subscribe=(Ut,rr,nr)=>{let ir=Ut;if(rr){const sr=(nr==null?void 0:nr.equalityFn)||Object.is;let ar=Ut(rt.getState());ir=ur=>{const cr=Ut(ur);if(!sr(ar,cr)){const lr=ar;rr(ar=cr,lr)}},nr!=null&&nr.fireImmediately&&rr(ar,ar)}return ot(ir)},o(s,a,rt)},subscribeWithSelector=subscribeWithSelectorImpl;function createJSONStorage(o,s){let a;try{a=o()}catch{return}return{getItem:ot=>{var tr;const Ut=nr=>nr===null?null:JSON.parse(nr,s==null?void 0:s.reviver),rr=(tr=a.getItem(ot))!=null?tr:null;return rr instanceof Promise?rr.then(Ut):Ut(rr)},setItem:(ot,tr)=>a.setItem(ot,JSON.stringify(tr,s==null?void 0:s.replacer)),removeItem:ot=>a.removeItem(ot)}}const toThenable=o=>s=>{try{const a=o(s);return a instanceof Promise?a:{then(rt){return toThenable(rt)(a)},catch(rt){return this}}}catch(a){return{then(rt){return this},catch(rt){return toThenable(rt)(a)}}}},oldImpl=(o,s)=>(a,rt,ot)=>{let tr={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:gr=>gr,version:0,merge:(gr,vr)=>({...vr,...gr}),...s},Ut=!1;const rr=new Set,nr=new Set;let ir;try{ir=tr.getStorage()}catch{}if(!ir)return o((...gr)=>{console.warn(`[zustand persist middleware] Unable to update item '${tr.name}', the given storage is currently unavailable.`),a(...gr)},rt,ot);const sr=toThenable(tr.serialize),ar=()=>{const gr=tr.partialize({...rt()});let vr;const fr=sr({state:gr,version:tr.version}).then(br=>ir.setItem(tr.name,br)).catch(br=>{vr=br});if(vr)throw vr;return fr},ur=ot.setState;ot.setState=(gr,vr)=>{ur(gr,vr),ar()};const cr=o((...gr)=>{a(...gr),ar()},rt,ot);let lr;const hr=()=>{var gr;if(!ir)return;Ut=!1,rr.forEach(fr=>fr(rt()));const vr=((gr=tr.onRehydrateStorage)==null?void 0:gr.call(tr,rt()))||void 0;return toThenable(ir.getItem.bind(ir))(tr.name).then(fr=>{if(fr)return tr.deserialize(fr)}).then(fr=>{if(fr)if(typeof fr.version=="number"&&fr.version!==tr.version){if(tr.migrate)return tr.migrate(fr.state,fr.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return fr.state}).then(fr=>{var br;return lr=tr.merge(fr,(br=rt())!=null?br:cr),a(lr,!0),ar()}).then(()=>{vr==null||vr(lr,void 0),Ut=!0,nr.forEach(fr=>fr(lr))}).catch(fr=>{vr==null||vr(void 0,fr)})};return ot.persist={setOptions:gr=>{tr={...tr,...gr},gr.getStorage&&(ir=gr.getStorage())},clearStorage:()=>{ir==null||ir.removeItem(tr.name)},getOptions:()=>tr,rehydrate:()=>hr(),hasHydrated:()=>Ut,onHydrate:gr=>(rr.add(gr),()=>{rr.delete(gr)}),onFinishHydration:gr=>(nr.add(gr),()=>{nr.delete(gr)})},hr(),lr||cr},newImpl=(o,s)=>(a,rt,ot)=>{let tr={storage:createJSONStorage(()=>localStorage),partialize:hr=>hr,version:0,merge:(hr,gr)=>({...gr,...hr}),...s},Ut=!1;const rr=new Set,nr=new Set;let ir=tr.storage;if(!ir)return o((...hr)=>{console.warn(`[zustand persist middleware] Unable to update item '${tr.name}', the given storage is currently unavailable.`),a(...hr)},rt,ot);const sr=()=>{const hr=tr.partialize({...rt()});return ir.setItem(tr.name,{state:hr,version:tr.version})},ar=ot.setState;ot.setState=(hr,gr)=>{ar(hr,gr),sr()};const ur=o((...hr)=>{a(...hr),sr()},rt,ot);let cr;const lr=()=>{var hr,gr;if(!ir)return;Ut=!1,rr.forEach(fr=>{var br;return fr((br=rt())!=null?br:ur)});const vr=((gr=tr.onRehydrateStorage)==null?void 0:gr.call(tr,(hr=rt())!=null?hr:ur))||void 0;return toThenable(ir.getItem.bind(ir))(tr.name).then(fr=>{if(fr)if(typeof fr.version=="number"&&fr.version!==tr.version){if(tr.migrate)return tr.migrate(fr.state,fr.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return fr.state}).then(fr=>{var br;return cr=tr.merge(fr,(br=rt())!=null?br:ur),a(cr,!0),sr()}).then(()=>{vr==null||vr(cr,void 0),cr=rt(),Ut=!0,nr.forEach(fr=>fr(cr))}).catch(fr=>{vr==null||vr(void 0,fr)})};return ot.persist={setOptions:hr=>{tr={...tr,...hr},hr.storage&&(ir=hr.storage)},clearStorage:()=>{ir==null||ir.removeItem(tr.name)},getOptions:()=>tr,rehydrate:()=>lr(),hasHydrated:()=>Ut,onHydrate:hr=>(rr.add(hr),()=>{rr.delete(hr)}),onFinishHydration:hr=>(nr.add(hr),()=>{nr.delete(hr)})},tr.skipHydration||lr(),cr||ur},persistImpl=(o,s)=>"getStorage"in s||"serialize"in s||"deserialize"in s?oldImpl(o,s):newImpl(o,s),persist=persistImpl,createStoreImpl=o=>{let s;const a=new Set,rt=(nr,ir)=>{const sr=typeof nr=="function"?nr(s):nr;if(!Object.is(sr,s)){const ar=s;s=ir??typeof sr!="object"?sr:Object.assign({},s,sr),a.forEach(ur=>ur(s,ar))}},ot=()=>s,rr={setState:rt,getState:ot,subscribe:nr=>(a.add(nr),()=>a.delete(nr)),destroy:()=>{a.clear()}};return s=o(rt,ot,rr),rr},createStore=o=>o?createStoreImpl(o):createStoreImpl;function shallow$1(o,s){if(Object.is(o,s))return!0;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return!1;if(o instanceof Map&&s instanceof Map){if(o.size!==s.size)return!1;for(const[rt,ot]of o)if(!Object.is(ot,s.get(rt)))return!1;return!0}if(o instanceof Set&&s instanceof Set){if(o.size!==s.size)return!1;for(const rt of o)if(!s.has(rt))return!1;return!0}const a=Object.keys(o);if(a.length!==Object.keys(s).length)return!1;for(let rt=0;rthr===ar.id)||(nr=[...nr,lr.chain]),ir[ar.id]=[...ir[ar.id]||[],...lr.rpcUrls.http],lr.rpcUrls.webSocket&&(sr[ar.id]=[...sr[ar.id]||[],...lr.rpcUrls.webSocket]))}if(!ur)throw new Error([`Could not find valid provider configuration for chain "${ar.name}". `,"You may need to add `jsonRpcProvider` to `configureChains` with the chain's RPC URLs.","Read more: https://wagmi.sh/core/providers/jsonRpc"].join(` -`))}return{chains:nr,publicClient:({chainId:ar})=>{const ur=nr.find(hr=>hr.id===ar)??o[0],cr=ir[ur.id];if(!cr||!cr[0])throw new Error(`No providers configured for chain "${ur.id}"`);const lr=createPublicClient$1({batch:a,chain:ur,transport:fallback$2(cr.map(hr=>http$2(hr,{timeout:rr})),{rank:ot,retryCount:tr,retryDelay:Ut}),pollingInterval:rt});return Object.assign(lr,{chains:nr})},webSocketPublicClient:({chainId:ar})=>{const ur=nr.find(hr=>hr.id===ar)??o[0],cr=sr[ur.id];if(!cr||!cr[0])return;const lr=createPublicClient$1({batch:a,chain:ur,transport:fallback$2(cr.map(hr=>webSocket$2(hr,{timeout:rr})),{rank:ot,retryCount:tr,retryDelay:Ut}),pollingInterval:rt});return Object.assign(lr,{chains:nr})}}}var ChainMismatchError$1=class extends Error{constructor({activeChain:s,targetChain:a}){super(`Chain mismatch: Expected "${a}", received "${s}".`),this.name="ChainMismatchError"}},ChainNotConfiguredError=class extends Error{constructor({chainId:o,connectorId:s}){super(`Chain "${o}" not configured${s?` for connector "${s}"`:""}.`),this.name="ChainNotConfigured"}},ConnectorAlreadyConnectedError=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},ConfigChainsNotFound=class extends Error{constructor(){super(...arguments),this.name="ConfigChainsNotFound",this.message="No chains were found on the wagmi config. Some functions that require a chain may not work."}},SwitchChainNotSupportedError=class extends Error{constructor({connector:o}){super(`"${o.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}};function deepEqual(o,s){if(o===s)return!0;if(o&&s&&typeof o=="object"&&typeof s=="object"){if(o.constructor!==s.constructor)return!1;let a,rt;if(Array.isArray(o)&&Array.isArray(s)){if(a=o.length,a!=s.length)return!1;for(rt=a;rt--!==0;)if(!deepEqual(o[rt],s[rt]))return!1;return!0}if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===s.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===s.toString();const ot=Object.keys(o);if(a=ot.length,a!==Object.keys(s).length)return!1;for(rt=a;rt--!==0;)if(!Object.prototype.hasOwnProperty.call(s,ot[rt]))return!1;for(rt=a;rt--!==0;){const tr=ot[rt];if(tr&&!deepEqual(o[tr],s[tr]))return!1}return!0}return o!==o&&s!==s}var findAndReplace=(o,{find:s,replace:a})=>o&&s(o)?a(o):typeof o!="object"?o:Array.isArray(o)?o.map(rt=>findAndReplace(rt,{find:s,replace:a})):o instanceof Object?Object.entries(o).reduce((rt,[ot,tr])=>({...rt,[ot]:findAndReplace(tr,{find:s,replace:a})}),{}):o;function deserialize(o){const s=JSON.parse(o);return findAndReplace(s,{find:rt=>typeof rt=="string"&&rt.startsWith("#bigint."),replace:rt=>BigInt(rt.replace("#bigint.",""))})}function getCallParameters(o){return{accessList:o.accessList,account:o.account,blockNumber:o.blockNumber,blockTag:o.blockTag,data:o.data,gas:o.gas,gasPrice:o.gasPrice,maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas,nonce:o.nonce,to:o.to,value:o.value}}function getSendTransactionParameters(o){return{accessList:o.accessList,account:o.account,data:o.data,gas:o.gas,gasPrice:o.gasPrice,maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas,nonce:o.nonce,to:o.to,value:o.value}}function getUnit(o){return typeof o=="number"?o:o==="wei"?0:Math.abs(weiUnits[o])}function getReferenceKey(o,s){return o.slice(0,s).join(".")||"."}function getCutoff(o,s){const{length:a}=o;for(let rt=0;rt{const Ut=typeof tr=="bigint"?`#bigint.${tr.toString()}`:tr;return(s==null?void 0:s(ot,Ut))||Ut},rt),a??void 0)}var noopStorage={getItem:o=>"",setItem:(o,s)=>null,removeItem:o=>null};function createStorage({deserialize:o=deserialize,key:s="wagmi",serialize:a=serialize,storage:rt}){return{...rt,getItem:(ot,tr=null)=>{const Ut=rt.getItem(`${s}.${ot}`);try{return Ut?o(Ut):tr}catch(rr){return console.warn(rr),tr}},setItem:(ot,tr)=>{if(tr===null)rt.removeItem(`${s}.${ot}`);else try{rt.setItem(`${s}.${ot}`,a(tr))}catch(Ut){console.error(Ut)}},removeItem:ot=>rt.removeItem(`${s}.${ot}`)}}var storeKey="store",_isAutoConnecting,_lastUsedConnector,_addEffects,addEffects_fn,Config=class{constructor({autoConnect:o=!1,connectors:s=[new InjectedConnector],publicClient:a,storage:rt=createStorage({storage:typeof window<"u"?window.localStorage:noopStorage}),logger:ot={warn:console.warn},webSocketPublicClient:tr}){var ir,sr;__privateAdd(this,_addEffects),this.publicClients=new Map,this.webSocketPublicClients=new Map,__privateAdd(this,_isAutoConnecting,void 0),__privateAdd(this,_lastUsedConnector,void 0),this.args={autoConnect:o,connectors:s,logger:ot,publicClient:a,storage:rt,webSocketPublicClient:tr};let Ut="disconnected",rr;if(o)try{const ar=rt.getItem(storeKey),ur=(ir=ar==null?void 0:ar.state)==null?void 0:ir.data;Ut=ur!=null&&ur.account?"reconnecting":"connecting",rr=(sr=ur==null?void 0:ur.chain)==null?void 0:sr.id}catch{}const nr=typeof s=="function"?s():s;nr.forEach(ar=>ar.setStorage(rt)),this.store=createStore(subscribeWithSelector(persist(()=>({connectors:nr,publicClient:this.getPublicClient({chainId:rr}),status:Ut,webSocketPublicClient:this.getWebSocketPublicClient({chainId:rr})}),{name:storeKey,storage:rt,partialize:ar=>{var ur,cr;return{...o&&{data:{account:(ur=ar==null?void 0:ar.data)==null?void 0:ur.account,chain:(cr=ar==null?void 0:ar.data)==null?void 0:cr.chain}},chains:ar==null?void 0:ar.chains}},version:2}))),this.storage=rt,__privateSet(this,_lastUsedConnector,rt==null?void 0:rt.getItem("wallet")),__privateMethod(this,_addEffects,addEffects_fn).call(this),o&&typeof window<"u"&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var o,s;return(s=(o=this.data)==null?void 0:o.chain)==null?void 0:s.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(o){const s=typeof o=="function"?o(this.store.getState()):o;this.store.setState(s,!0)}clearState(){this.setState(o=>({...o,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var o,s;this.connector&&await((s=(o=this.connector).disconnect)==null?void 0:s.call(o)),__privateSet(this,_isAutoConnecting,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(__privateGet(this,_isAutoConnecting))return;__privateSet(this,_isAutoConnecting,!0),this.setState(a=>{var rt;return{...a,status:(rt=a.data)!=null&&rt.account?"reconnecting":"connecting"}});const o=__privateGet(this,_lastUsedConnector)?[...this.connectors].sort(a=>a.id===__privateGet(this,_lastUsedConnector)?-1:1):this.connectors;let s=!1;for(const a of o){if(!a.ready||!a.isAuthorized||!await a.isAuthorized())continue;const ot=await a.connect();this.setState(tr=>({...tr,connector:a,chains:a==null?void 0:a.chains,data:ot,status:"connected"})),s=!0;break}return s||this.setState(a=>({...a,data:void 0,status:"disconnected"})),__privateSet(this,_isAutoConnecting,!1),this.data}setConnectors(o){this.args={...this.args,connectors:o};const s=typeof o=="function"?o():o;s.forEach(a=>a.setStorage(this.args.storage)),this.setState(a=>({...a,connectors:s}))}getPublicClient({chainId:o}={}){let s=this.publicClients.get(-1);if(s&&(s==null?void 0:s.chain.id)===o||(s=this.publicClients.get(o??-1),s))return s;const{publicClient:a}=this.args;return s=typeof a=="function"?a({chainId:o}):a,this.publicClients.set(o??-1,s),s}setPublicClient(o){var a,rt;const s=(rt=(a=this.data)==null?void 0:a.chain)==null?void 0:rt.id;this.args={...this.args,publicClient:o},this.publicClients.clear(),this.setState(ot=>({...ot,publicClient:this.getPublicClient({chainId:s})}))}getWebSocketPublicClient({chainId:o}={}){let s=this.webSocketPublicClients.get(-1);if(s&&(s==null?void 0:s.chain.id)===o||(s=this.webSocketPublicClients.get(o??-1),s))return s;const{webSocketPublicClient:a}=this.args;return s=typeof a=="function"?a({chainId:o}):a,s&&this.webSocketPublicClients.set(o??-1,s),s}setWebSocketPublicClient(o){var a,rt;const s=(rt=(a=this.data)==null?void 0:a.chain)==null?void 0:rt.id;this.args={...this.args,webSocketPublicClient:o},this.webSocketPublicClients.clear(),this.setState(ot=>({...ot,webSocketPublicClient:this.getWebSocketPublicClient({chainId:s})}))}setLastUsedConnector(o=null){var s;(s=this.storage)==null||s.setItem("wallet",o)}};_isAutoConnecting=new WeakMap;_lastUsedConnector=new WeakMap;_addEffects=new WeakSet;addEffects_fn=function(){const o=rr=>{this.setState(nr=>({...nr,data:{...nr.data,...rr}}))},s=()=>{this.clearState()},a=rr=>{this.setState(nr=>({...nr,error:rr}))};this.store.subscribe(({connector:rr})=>rr,(rr,nr)=>{var ir,sr,ar,ur,cr,lr;(ir=nr==null?void 0:nr.off)==null||ir.call(nr,"change",o),(sr=nr==null?void 0:nr.off)==null||sr.call(nr,"disconnect",s),(ar=nr==null?void 0:nr.off)==null||ar.call(nr,"error",a),rr&&((ur=rr.on)==null||ur.call(rr,"change",o),(cr=rr.on)==null||cr.call(rr,"disconnect",s),(lr=rr.on)==null||lr.call(rr,"error",a))});const{publicClient:rt,webSocketPublicClient:ot}=this.args;(typeof rt=="function"||typeof ot=="function")&&this.store.subscribe(({data:rr})=>{var nr;return(nr=rr==null?void 0:rr.chain)==null?void 0:nr.id},rr=>{this.setState(nr=>({...nr,publicClient:this.getPublicClient({chainId:rr}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:rr})}))})};var config$2;function createConfig$1(o){const s=new Config(o);return config$2=s,s}function getConfig(){if(!config$2)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return config$2}async function connect({chainId:o,connector:s}){const a=getConfig(),rt=a.connector;if(rt&&s.id===rt.id)throw new ConnectorAlreadyConnectedError;try{a.setState(tr=>({...tr,status:"connecting"}));const ot=await s.connect({chainId:o});return a.setLastUsedConnector(s.id),a.setState(tr=>({...tr,connector:s,chains:s==null?void 0:s.chains,data:ot,status:"connected"})),a.storage.setItem("connected",!0),{...ot,connector:s}}catch(ot){throw a.setState(tr=>({...tr,status:tr.connector?"connected":"disconnected"})),ot}}async function disconnect(){const o=getConfig();o.connector&&await o.connector.disconnect(),o.clearState(),o.storage.removeItem("connected")}var erc20ABI=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],erc20ABI_bytes32=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],erc721ABI=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokeId",type:"uint256"}],outputs:[]}],erc4626ABI=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}];async function fetchToken({address:o,chainId:s,formatUnits:a=18}){async function rt({abi:ot}){const tr={address:o,abi:ot,chainId:s},[Ut,rr,nr,ir]=await readContracts({allowFailure:!1,contracts:[{...tr,functionName:"decimals"},{...tr,functionName:"name"},{...tr,functionName:"symbol"},{...tr,functionName:"totalSupply"}]});return{address:o,decimals:Ut,name:rr,symbol:nr,totalSupply:{formatted:formatUnits$2(ir,getUnit(a)),value:ir}}}try{return await rt({abi:erc20ABI})}catch(ot){if(ot instanceof ContractFunctionExecutionError$1){const{name:tr,symbol:Ut,...rr}=await rt({abi:erc20ABI_bytes32});return{name:hexToString(trim$2(tr,{dir:"right"})),symbol:hexToString(trim$2(Ut,{dir:"right"})),...rr}}throw ot}}function getPublicClient({chainId:o}={}){const s=getConfig();return o&&s.getPublicClient({chainId:o})||s.publicClient}async function getWalletClient({chainId:o}={}){var rt,ot;return await((ot=(rt=getConfig().connector)==null?void 0:rt.getWalletClient)==null?void 0:ot.call(rt,{chainId:o}))||null}function getWebSocketPublicClient({chainId:o}={}){const s=getConfig();return o&&s.getWebSocketPublicClient({chainId:o})||s.webSocketPublicClient}function watchPublicClient(o,s){const a=getConfig(),rt=async()=>s(getPublicClient(o));return a.subscribe(({publicClient:tr})=>tr,rt)}function watchWalletClient({chainId:o},s){const a=getConfig(),rt=async({chainId:tr})=>{if(o&&tr&&o!==tr)return;const Ut=await getWalletClient({chainId:o});return getConfig().connector?s(Ut):s(null)};return a.subscribe(({data:tr,connector:Ut})=>{var rr;return{account:tr==null?void 0:tr.account,chainId:(rr=tr==null?void 0:tr.chain)==null?void 0:rr.id,connector:Ut}},rt,{equalityFn:shallow$1})}function watchWebSocketPublicClient(o,s){const a=getConfig(),rt=async()=>s(getWebSocketPublicClient(o));return a.subscribe(({webSocketPublicClient:tr})=>tr,rt)}async function prepareWriteContract({abi:o,address:s,args:a,chainId:rt,dataSuffix:ot,functionName:tr,walletClient:Ut,...rr}){const nr=getPublicClient({chainId:rt}),ir=Ut??await getWalletClient({chainId:rt});if(!ir)throw new ConnectorNotFoundError;rt&&assertActiveChain({chainId:rt});const{account:sr,accessList:ar,blockNumber:ur,blockTag:cr,gas:lr,gasPrice:hr,maxFeePerGas:gr,maxPriorityFeePerGas:vr,nonce:fr,value:br}=getCallParameters(rr),{result:wr,request:$r}=await nr.simulateContract({abi:o,address:s,functionName:tr,args:a,account:sr||ir.account,accessList:ar,blockNumber:ur,blockTag:cr,dataSuffix:ot,gas:lr,gasPrice:hr,maxFeePerGas:gr,maxPriorityFeePerGas:vr,nonce:fr,value:br}),_r=o.filter(yr=>"name"in yr&&yr.name===tr);return{mode:"prepared",request:{...$r,abi:_r,chainId:rt},result:wr}}async function multicall$2({chainId:o,contracts:s,blockNumber:a,blockTag:rt,...ot}){const tr=getPublicClient({chainId:o});if(!tr.chains)throw new ConfigChainsNotFound;if(o&&tr.chain.id!==o)throw new ChainNotConfiguredError({chainId:o});return tr.multicall({allowFailure:ot.allowFailure??!0,blockNumber:a,blockTag:rt,contracts:s})}async function readContract$2({address:o,account:s,chainId:a,abi:rt,args:ot,functionName:tr,blockNumber:Ut,blockTag:rr}){return getPublicClient({chainId:a}).readContract({abi:rt,address:o,account:s,functionName:tr,args:ot,blockNumber:Ut,blockTag:rr})}async function readContracts({contracts:o,blockNumber:s,blockTag:a,...rt}){const{allowFailure:ot=!0}=rt;try{const tr=getPublicClient(),Ut=o.reduce((sr,ar,ur)=>{const cr=ar.chainId??tr.chain.id;return{...sr,[cr]:[...sr[cr]||[],{contract:ar,index:ur}]}},{}),rr=()=>Object.entries(Ut).map(([sr,ar])=>multicall$2({allowFailure:ot,chainId:parseInt(sr),contracts:ar.map(({contract:ur})=>ur),blockNumber:s,blockTag:a})),nr=(await Promise.all(rr())).flat(),ir=Object.values(Ut).flatMap(sr=>sr.map(({index:ar})=>ar));return nr.reduce((sr,ar,ur)=>(sr&&(sr[ir[ur]]=ar),sr),[])}catch(tr){if(tr instanceof ContractFunctionExecutionError$1)throw tr;const Ut=()=>o.map(rr=>readContract$2({...rr,blockNumber:s,blockTag:a}));return ot?(await Promise.allSettled(Ut())).map(rr=>rr.status==="fulfilled"?{result:rr.value,status:"success"}:{error:rr.reason,result:void 0,status:"failure"}):await Promise.all(Ut())}}async function writeContract$2(o){const s=await getWalletClient({chainId:o.chainId});if(!s)throw new ConnectorNotFoundError;o.chainId&&assertActiveChain({chainId:o.chainId});let a;if(o.mode==="prepared")a=o.request;else{const{chainId:ot,mode:tr,...Ut}=o;a=(await prepareWriteContract(Ut)).request}return{hash:await s.writeContract({...a,chain:o.chainId?{id:o.chainId}:null})}}async function fetchBalance({address:o,chainId:s,formatUnits:a,token:rt}){const ot=getConfig(),tr=getPublicClient({chainId:s});if(rt){const ir=async({abi:sr})=>{const ar={abi:sr,address:rt,chainId:s},[ur,cr,lr]=await readContracts({allowFailure:!1,contracts:[{...ar,functionName:"balanceOf",args:[o]},{...ar,functionName:"decimals"},{...ar,functionName:"symbol"}]});return{decimals:cr,formatted:formatUnits$2(ur??"0",getUnit(a??cr)),symbol:lr,value:ur}};try{return await ir({abi:erc20ABI})}catch(sr){if(sr instanceof ContractFunctionExecutionError$1){const{symbol:ar,...ur}=await ir({abi:erc20ABI_bytes32});return{symbol:hexToString(trim$2(ar,{dir:"right"})),...ur}}throw sr}}const Ut=[...ot.publicClient.chains||[],...ot.chains??[]],rr=await tr.getBalance({address:o}),nr=Ut.find(ir=>ir.id===tr.chain.id);return{decimals:(nr==null?void 0:nr.nativeCurrency.decimals)??18,formatted:formatUnits$2(rr??"0",getUnit(a??18)),symbol:(nr==null?void 0:nr.nativeCurrency.symbol)??"ETH",value:rr}}function getAccount(){const{data:o,connector:s,status:a}=getConfig();switch(a){case"connected":return{address:o==null?void 0:o.account,connector:s,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:a};case"reconnecting":return{address:o==null?void 0:o.account,connector:s,isConnected:!!(o!=null&&o.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:a};case"connecting":return{address:o==null?void 0:o.account,connector:s,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:a};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:a}}}function getNetwork(){var ot,tr,Ut,rr;const o=getConfig(),s=(tr=(ot=o.data)==null?void 0:ot.chain)==null?void 0:tr.id,a=o.chains??[],rt=[...((Ut=o.publicClient)==null?void 0:Ut.chains)||[],...a].find(nr=>nr.id===s)??{id:s,name:`Chain ${s}`,network:`${s}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:s?{...rt,...(rr=o.data)==null?void 0:rr.chain,id:s}:void 0,chains:a}}async function signMessage$2(o){const s=await getWalletClient();if(!s)throw new ConnectorNotFoundError;return await s.signMessage({message:o.message})}async function signTypedData$2({domain:o,message:s,primaryType:a,types:rt}){const ot=await getWalletClient();if(!ot)throw new ConnectorNotFoundError;const{chainId:tr}=o;return tr&&assertActiveChain({chainId:tr}),ot.signTypedData({message:s,primaryType:a,types:rt,domain:o})}async function switchNetwork({chainId:o}){const{connector:s}=getConfig();if(!s)throw new ConnectorNotFoundError;if(!s.switchChain)throw new SwitchChainNotSupportedError({connector:s});return s.switchChain(o)}function watchAccount(o,{selector:s=a=>a}={}){const a=getConfig(),rt=()=>o(getAccount());return a.subscribe(({data:tr,connector:Ut,status:rr})=>s({address:tr==null?void 0:tr.account,connector:Ut,status:rr}),rt,{equalityFn:shallow$1})}function watchNetwork(o,{selector:s=a=>a}={}){const a=getConfig(),rt=()=>o(getNetwork());return a.subscribe(({data:tr,chains:Ut})=>{var rr;return s({chainId:(rr=tr==null?void 0:tr.chain)==null?void 0:rr.id,chains:Ut})},rt,{equalityFn:shallow$1})}async function fetchEnsAddress({chainId:o,name:s}){const{normalize:a}=await __vitePreload(()=>import("./index-a2ce8660.js"),[],import.meta.url),ot=await getPublicClient({chainId:o}).getEnsAddress({name:a(s)});try{return ot==="0x0000000000000000000000000000000000000000"?null:ot?getAddress$2(ot):null}catch{return null}}async function fetchEnsAvatar({name:o,chainId:s}){const{normalize:a}=await __vitePreload(()=>import("./index-a2ce8660.js"),[],import.meta.url);return await getPublicClient({chainId:s}).getEnsAvatar({name:a(o)})}async function fetchEnsName({address:o,chainId:s}){return getPublicClient({chainId:s}).getEnsName({address:getAddress$2(o)})}async function fetchEnsResolver({chainId:o,name:s}){const{normalize:a}=await __vitePreload(()=>import("./index-a2ce8660.js"),[],import.meta.url);return await getPublicClient({chainId:o}).getEnsResolver({name:a(s)})}async function fetchBlockNumber({chainId:o}={}){return await getPublicClient({chainId:o}).getBlockNumber()}async function fetchFeeData({chainId:o,formatUnits:s="gwei"}={}){const a=getPublicClient({chainId:o}),rt=await a.getBlock();let ot=null;try{ot=await a.getGasPrice()}catch{}let tr=null,Ut=null,rr=null;rt!=null&&rt.baseFeePerGas&&(tr=rt.baseFeePerGas,rr=parseGwei$2("1"),Ut=rt.baseFeePerGas*2n+rr);const nr=getUnit(s),ir={gasPrice:ot?formatUnits$2(ot,nr):null,maxFeePerGas:Ut?formatUnits$2(Ut,nr):null,maxPriorityFeePerGas:rr?formatUnits$2(rr,nr):null};return{lastBaseFeePerGas:tr,gasPrice:ot,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,formatted:ir}}async function fetchTransaction({chainId:o,hash:s}){return getPublicClient({chainId:o}).getTransaction({hash:s})}async function prepareSendTransaction({accessList:o,account:s,chainId:a,data:rt,gas:ot,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:nr,to:ir,value:sr,walletClient:ar}){const ur=getPublicClient({chainId:a}),cr=ar??await getWalletClient({chainId:a});if(!cr)throw new ConnectorNotFoundError;a&&assertActiveChain({chainId:a});const lr=(ir&&!isAddress$2(ir)?await fetchEnsAddress({name:ir}):ir)||void 0;if(lr&&!isAddress$2(lr))throw new Error("Invalid address");const hr=typeof ot>"u"?await ur.estimateGas({accessList:o,account:cr.account,data:rt,gas:ot??void 0,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:nr,to:lr,value:sr}):ot||void 0;return{accessList:o,account:s,data:rt,gas:hr,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,mode:"prepared",nonce:nr,to:lr,value:sr,...a?{chainId:a}:{}}}async function sendTransaction$2({accessList:o,account:s,chainId:a,data:rt,gas:ot,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,mode:nr,nonce:ir,to:sr,value:ar}){const ur=await getWalletClient({chainId:a});if(!ur)throw new ConnectorNotFoundError;a&&assertActiveChain({chainId:a});let cr;return nr==="prepared"?cr={account:s,accessList:o,chain:null,data:rt,gas:ot,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:ir,to:sr,value:ar}:cr=await prepareSendTransaction({accessList:o,account:s,chainId:a,data:rt,gas:ot||null,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:ir,to:sr,value:ar}),{hash:await ur.sendTransaction({...cr,chain:a?{id:a}:null})}}async function waitForTransaction({chainId:o,confirmations:s=1,hash:a,onReplaced:rt,timeout:ot=0}){const tr=getPublicClient({chainId:o}),Ut=await tr.waitForTransactionReceipt({hash:a,confirmations:s,onReplaced:rt,timeout:ot});if(Ut.status==="reverted"){const rr=await tr.getTransaction({hash:Ut.transactionHash}),nr=await tr.call({...rr,gasPrice:rr.type!=="eip1559"?rr.gasPrice:void 0,maxFeePerGas:rr.type==="eip1559"?rr.maxFeePerGas:void 0,maxPriorityFeePerGas:rr.type==="eip1559"?rr.maxPriorityFeePerGas:void 0}),ir=hexToString(`0x${nr.substring(138)}`);throw new Error(ir)}return Ut}function assertActiveChain({chainId:o}){var ot,tr;const{chain:s,chains:a}=getNetwork(),rt=s==null?void 0:s.id;if(rt&&o!==rt)throw new ChainMismatchError$1({activeChain:((ot=a.find(Ut=>Ut.id===rt))==null?void 0:ot.name)??`Chain ${rt}`,targetChain:((tr=a.find(Ut=>Ut.id===o))==null?void 0:tr.name)??`Chain ${o}`})}var withSelector={exports:{}},withSelector_production_min={};/** +`))}return{chains:nr,publicClient:({chainId:ar})=>{const ur=nr.find(hr=>hr.id===ar)??o[0],cr=ir[ur.id];if(!cr||!cr[0])throw new Error(`No providers configured for chain "${ur.id}"`);const lr=createPublicClient$1({batch:a,chain:ur,transport:fallback$2(cr.map(hr=>http$2(hr,{timeout:rr})),{rank:ot,retryCount:tr,retryDelay:Ut}),pollingInterval:rt});return Object.assign(lr,{chains:nr})},webSocketPublicClient:({chainId:ar})=>{const ur=nr.find(hr=>hr.id===ar)??o[0],cr=sr[ur.id];if(!cr||!cr[0])return;const lr=createPublicClient$1({batch:a,chain:ur,transport:fallback$2(cr.map(hr=>webSocket$2(hr,{timeout:rr})),{rank:ot,retryCount:tr,retryDelay:Ut}),pollingInterval:rt});return Object.assign(lr,{chains:nr})}}}var ChainMismatchError$1=class extends Error{constructor({activeChain:s,targetChain:a}){super(`Chain mismatch: Expected "${a}", received "${s}".`),this.name="ChainMismatchError"}},ChainNotConfiguredError=class extends Error{constructor({chainId:o,connectorId:s}){super(`Chain "${o}" not configured${s?` for connector "${s}"`:""}.`),this.name="ChainNotConfigured"}},ConnectorAlreadyConnectedError=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},ConfigChainsNotFound=class extends Error{constructor(){super(...arguments),this.name="ConfigChainsNotFound",this.message="No chains were found on the wagmi config. Some functions that require a chain may not work."}},SwitchChainNotSupportedError=class extends Error{constructor({connector:o}){super(`"${o.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}};function deepEqual(o,s){if(o===s)return!0;if(o&&s&&typeof o=="object"&&typeof s=="object"){if(o.constructor!==s.constructor)return!1;let a,rt;if(Array.isArray(o)&&Array.isArray(s)){if(a=o.length,a!=s.length)return!1;for(rt=a;rt--!==0;)if(!deepEqual(o[rt],s[rt]))return!1;return!0}if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===s.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===s.toString();const ot=Object.keys(o);if(a=ot.length,a!==Object.keys(s).length)return!1;for(rt=a;rt--!==0;)if(!Object.prototype.hasOwnProperty.call(s,ot[rt]))return!1;for(rt=a;rt--!==0;){const tr=ot[rt];if(tr&&!deepEqual(o[tr],s[tr]))return!1}return!0}return o!==o&&s!==s}var findAndReplace=(o,{find:s,replace:a})=>o&&s(o)?a(o):typeof o!="object"?o:Array.isArray(o)?o.map(rt=>findAndReplace(rt,{find:s,replace:a})):o instanceof Object?Object.entries(o).reduce((rt,[ot,tr])=>({...rt,[ot]:findAndReplace(tr,{find:s,replace:a})}),{}):o;function deserialize(o){const s=JSON.parse(o);return findAndReplace(s,{find:rt=>typeof rt=="string"&&rt.startsWith("#bigint."),replace:rt=>BigInt(rt.replace("#bigint.",""))})}function getCallParameters(o){return{accessList:o.accessList,account:o.account,blockNumber:o.blockNumber,blockTag:o.blockTag,data:o.data,gas:o.gas,gasPrice:o.gasPrice,maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas,nonce:o.nonce,to:o.to,value:o.value}}function getSendTransactionParameters(o){return{accessList:o.accessList,account:o.account,data:o.data,gas:o.gas,gasPrice:o.gasPrice,maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas,nonce:o.nonce,to:o.to,value:o.value}}function getUnit(o){return typeof o=="number"?o:o==="wei"?0:Math.abs(weiUnits[o])}function getReferenceKey(o,s){return o.slice(0,s).join(".")||"."}function getCutoff(o,s){const{length:a}=o;for(let rt=0;rt{const Ut=typeof tr=="bigint"?`#bigint.${tr.toString()}`:tr;return(s==null?void 0:s(ot,Ut))||Ut},rt),a??void 0)}var noopStorage={getItem:o=>"",setItem:(o,s)=>null,removeItem:o=>null};function createStorage({deserialize:o=deserialize,key:s="wagmi",serialize:a=serialize,storage:rt}){return{...rt,getItem:(ot,tr=null)=>{const Ut=rt.getItem(`${s}.${ot}`);try{return Ut?o(Ut):tr}catch(rr){return console.warn(rr),tr}},setItem:(ot,tr)=>{if(tr===null)rt.removeItem(`${s}.${ot}`);else try{rt.setItem(`${s}.${ot}`,a(tr))}catch(Ut){console.error(Ut)}},removeItem:ot=>rt.removeItem(`${s}.${ot}`)}}var storeKey="store",_isAutoConnecting,_lastUsedConnector,_addEffects,addEffects_fn,Config=class{constructor({autoConnect:o=!1,connectors:s=[new InjectedConnector],publicClient:a,storage:rt=createStorage({storage:typeof window<"u"?window.localStorage:noopStorage}),logger:ot={warn:console.warn},webSocketPublicClient:tr}){var ir,sr;__privateAdd(this,_addEffects),this.publicClients=new Map,this.webSocketPublicClients=new Map,__privateAdd(this,_isAutoConnecting,void 0),__privateAdd(this,_lastUsedConnector,void 0),this.args={autoConnect:o,connectors:s,logger:ot,publicClient:a,storage:rt,webSocketPublicClient:tr};let Ut="disconnected",rr;if(o)try{const ar=rt.getItem(storeKey),ur=(ir=ar==null?void 0:ar.state)==null?void 0:ir.data;Ut=ur!=null&&ur.account?"reconnecting":"connecting",rr=(sr=ur==null?void 0:ur.chain)==null?void 0:sr.id}catch{}const nr=typeof s=="function"?s():s;nr.forEach(ar=>ar.setStorage(rt)),this.store=createStore(subscribeWithSelector(persist(()=>({connectors:nr,publicClient:this.getPublicClient({chainId:rr}),status:Ut,webSocketPublicClient:this.getWebSocketPublicClient({chainId:rr})}),{name:storeKey,storage:rt,partialize:ar=>{var ur,cr;return{...o&&{data:{account:(ur=ar==null?void 0:ar.data)==null?void 0:ur.account,chain:(cr=ar==null?void 0:ar.data)==null?void 0:cr.chain}},chains:ar==null?void 0:ar.chains}},version:2}))),this.storage=rt,__privateSet(this,_lastUsedConnector,rt==null?void 0:rt.getItem("wallet")),__privateMethod(this,_addEffects,addEffects_fn).call(this),o&&typeof window<"u"&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var o,s;return(s=(o=this.data)==null?void 0:o.chain)==null?void 0:s.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(o){const s=typeof o=="function"?o(this.store.getState()):o;this.store.setState(s,!0)}clearState(){this.setState(o=>({...o,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var o,s;this.connector&&await((s=(o=this.connector).disconnect)==null?void 0:s.call(o)),__privateSet(this,_isAutoConnecting,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(__privateGet(this,_isAutoConnecting))return;__privateSet(this,_isAutoConnecting,!0),this.setState(a=>{var rt;return{...a,status:(rt=a.data)!=null&&rt.account?"reconnecting":"connecting"}});const o=__privateGet(this,_lastUsedConnector)?[...this.connectors].sort(a=>a.id===__privateGet(this,_lastUsedConnector)?-1:1):this.connectors;let s=!1;for(const a of o){if(!a.ready||!a.isAuthorized||!await a.isAuthorized())continue;const ot=await a.connect();this.setState(tr=>({...tr,connector:a,chains:a==null?void 0:a.chains,data:ot,status:"connected"})),s=!0;break}return s||this.setState(a=>({...a,data:void 0,status:"disconnected"})),__privateSet(this,_isAutoConnecting,!1),this.data}setConnectors(o){this.args={...this.args,connectors:o};const s=typeof o=="function"?o():o;s.forEach(a=>a.setStorage(this.args.storage)),this.setState(a=>({...a,connectors:s}))}getPublicClient({chainId:o}={}){let s=this.publicClients.get(-1);if(s&&(s==null?void 0:s.chain.id)===o||(s=this.publicClients.get(o??-1),s))return s;const{publicClient:a}=this.args;return s=typeof a=="function"?a({chainId:o}):a,this.publicClients.set(o??-1,s),s}setPublicClient(o){var a,rt;const s=(rt=(a=this.data)==null?void 0:a.chain)==null?void 0:rt.id;this.args={...this.args,publicClient:o},this.publicClients.clear(),this.setState(ot=>({...ot,publicClient:this.getPublicClient({chainId:s})}))}getWebSocketPublicClient({chainId:o}={}){let s=this.webSocketPublicClients.get(-1);if(s&&(s==null?void 0:s.chain.id)===o||(s=this.webSocketPublicClients.get(o??-1),s))return s;const{webSocketPublicClient:a}=this.args;return s=typeof a=="function"?a({chainId:o}):a,s&&this.webSocketPublicClients.set(o??-1,s),s}setWebSocketPublicClient(o){var a,rt;const s=(rt=(a=this.data)==null?void 0:a.chain)==null?void 0:rt.id;this.args={...this.args,webSocketPublicClient:o},this.webSocketPublicClients.clear(),this.setState(ot=>({...ot,webSocketPublicClient:this.getWebSocketPublicClient({chainId:s})}))}setLastUsedConnector(o=null){var s;(s=this.storage)==null||s.setItem("wallet",o)}};_isAutoConnecting=new WeakMap;_lastUsedConnector=new WeakMap;_addEffects=new WeakSet;addEffects_fn=function(){const o=rr=>{this.setState(nr=>({...nr,data:{...nr.data,...rr}}))},s=()=>{this.clearState()},a=rr=>{this.setState(nr=>({...nr,error:rr}))};this.store.subscribe(({connector:rr})=>rr,(rr,nr)=>{var ir,sr,ar,ur,cr,lr;(ir=nr==null?void 0:nr.off)==null||ir.call(nr,"change",o),(sr=nr==null?void 0:nr.off)==null||sr.call(nr,"disconnect",s),(ar=nr==null?void 0:nr.off)==null||ar.call(nr,"error",a),rr&&((ur=rr.on)==null||ur.call(rr,"change",o),(cr=rr.on)==null||cr.call(rr,"disconnect",s),(lr=rr.on)==null||lr.call(rr,"error",a))});const{publicClient:rt,webSocketPublicClient:ot}=this.args;(typeof rt=="function"||typeof ot=="function")&&this.store.subscribe(({data:rr})=>{var nr;return(nr=rr==null?void 0:rr.chain)==null?void 0:nr.id},rr=>{this.setState(nr=>({...nr,publicClient:this.getPublicClient({chainId:rr}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:rr})}))})};var config$2;function createConfig$1(o){const s=new Config(o);return config$2=s,s}function getConfig(){if(!config$2)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return config$2}async function connect({chainId:o,connector:s}){const a=getConfig(),rt=a.connector;if(rt&&s.id===rt.id)throw new ConnectorAlreadyConnectedError;try{a.setState(tr=>({...tr,status:"connecting"}));const ot=await s.connect({chainId:o});return a.setLastUsedConnector(s.id),a.setState(tr=>({...tr,connector:s,chains:s==null?void 0:s.chains,data:ot,status:"connected"})),a.storage.setItem("connected",!0),{...ot,connector:s}}catch(ot){throw a.setState(tr=>({...tr,status:tr.connector?"connected":"disconnected"})),ot}}async function disconnect(){const o=getConfig();o.connector&&await o.connector.disconnect(),o.clearState(),o.storage.removeItem("connected")}var erc20ABI=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],erc20ABI_bytes32=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],erc721ABI=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokeId",type:"uint256"}],outputs:[]}],erc4626ABI=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}];async function fetchToken({address:o,chainId:s,formatUnits:a=18}){async function rt({abi:ot}){const tr={address:o,abi:ot,chainId:s},[Ut,rr,nr,ir]=await readContracts({allowFailure:!1,contracts:[{...tr,functionName:"decimals"},{...tr,functionName:"name"},{...tr,functionName:"symbol"},{...tr,functionName:"totalSupply"}]});return{address:o,decimals:Ut,name:rr,symbol:nr,totalSupply:{formatted:formatUnits$2(ir,getUnit(a)),value:ir}}}try{return await rt({abi:erc20ABI})}catch(ot){if(ot instanceof ContractFunctionExecutionError$1){const{name:tr,symbol:Ut,...rr}=await rt({abi:erc20ABI_bytes32});return{name:hexToString(trim$2(tr,{dir:"right"})),symbol:hexToString(trim$2(Ut,{dir:"right"})),...rr}}throw ot}}function getPublicClient({chainId:o}={}){const s=getConfig();return o&&s.getPublicClient({chainId:o})||s.publicClient}async function getWalletClient({chainId:o}={}){var rt,ot;return await((ot=(rt=getConfig().connector)==null?void 0:rt.getWalletClient)==null?void 0:ot.call(rt,{chainId:o}))||null}function getWebSocketPublicClient({chainId:o}={}){const s=getConfig();return o&&s.getWebSocketPublicClient({chainId:o})||s.webSocketPublicClient}function watchPublicClient(o,s){const a=getConfig(),rt=async()=>s(getPublicClient(o));return a.subscribe(({publicClient:tr})=>tr,rt)}function watchWalletClient({chainId:o},s){const a=getConfig(),rt=async({chainId:tr})=>{if(o&&tr&&o!==tr)return;const Ut=await getWalletClient({chainId:o});return getConfig().connector?s(Ut):s(null)};return a.subscribe(({data:tr,connector:Ut})=>{var rr;return{account:tr==null?void 0:tr.account,chainId:(rr=tr==null?void 0:tr.chain)==null?void 0:rr.id,connector:Ut}},rt,{equalityFn:shallow$1})}function watchWebSocketPublicClient(o,s){const a=getConfig(),rt=async()=>s(getWebSocketPublicClient(o));return a.subscribe(({webSocketPublicClient:tr})=>tr,rt)}async function prepareWriteContract({abi:o,address:s,args:a,chainId:rt,dataSuffix:ot,functionName:tr,walletClient:Ut,...rr}){const nr=getPublicClient({chainId:rt}),ir=Ut??await getWalletClient({chainId:rt});if(!ir)throw new ConnectorNotFoundError;rt&&assertActiveChain({chainId:rt});const{account:sr,accessList:ar,blockNumber:ur,blockTag:cr,gas:lr,gasPrice:hr,maxFeePerGas:gr,maxPriorityFeePerGas:vr,nonce:fr,value:br}=getCallParameters(rr),{result:wr,request:$r}=await nr.simulateContract({abi:o,address:s,functionName:tr,args:a,account:sr||ir.account,accessList:ar,blockNumber:ur,blockTag:cr,dataSuffix:ot,gas:lr,gasPrice:hr,maxFeePerGas:gr,maxPriorityFeePerGas:vr,nonce:fr,value:br}),_r=o.filter(yr=>"name"in yr&&yr.name===tr);return{mode:"prepared",request:{...$r,abi:_r,chainId:rt},result:wr}}async function multicall$2({chainId:o,contracts:s,blockNumber:a,blockTag:rt,...ot}){const tr=getPublicClient({chainId:o});if(!tr.chains)throw new ConfigChainsNotFound;if(o&&tr.chain.id!==o)throw new ChainNotConfiguredError({chainId:o});return tr.multicall({allowFailure:ot.allowFailure??!0,blockNumber:a,blockTag:rt,contracts:s})}async function readContract$2({address:o,account:s,chainId:a,abi:rt,args:ot,functionName:tr,blockNumber:Ut,blockTag:rr}){return getPublicClient({chainId:a}).readContract({abi:rt,address:o,account:s,functionName:tr,args:ot,blockNumber:Ut,blockTag:rr})}async function readContracts({contracts:o,blockNumber:s,blockTag:a,...rt}){const{allowFailure:ot=!0}=rt;try{const tr=getPublicClient(),Ut=o.reduce((sr,ar,ur)=>{const cr=ar.chainId??tr.chain.id;return{...sr,[cr]:[...sr[cr]||[],{contract:ar,index:ur}]}},{}),rr=()=>Object.entries(Ut).map(([sr,ar])=>multicall$2({allowFailure:ot,chainId:parseInt(sr),contracts:ar.map(({contract:ur})=>ur),blockNumber:s,blockTag:a})),nr=(await Promise.all(rr())).flat(),ir=Object.values(Ut).flatMap(sr=>sr.map(({index:ar})=>ar));return nr.reduce((sr,ar,ur)=>(sr&&(sr[ir[ur]]=ar),sr),[])}catch(tr){if(tr instanceof ContractFunctionExecutionError$1)throw tr;const Ut=()=>o.map(rr=>readContract$2({...rr,blockNumber:s,blockTag:a}));return ot?(await Promise.allSettled(Ut())).map(rr=>rr.status==="fulfilled"?{result:rr.value,status:"success"}:{error:rr.reason,result:void 0,status:"failure"}):await Promise.all(Ut())}}async function writeContract$2(o){const s=await getWalletClient({chainId:o.chainId});if(!s)throw new ConnectorNotFoundError;o.chainId&&assertActiveChain({chainId:o.chainId});let a;if(o.mode==="prepared")a=o.request;else{const{chainId:ot,mode:tr,...Ut}=o;a=(await prepareWriteContract(Ut)).request}return{hash:await s.writeContract({...a,chain:o.chainId?{id:o.chainId}:null})}}async function fetchBalance({address:o,chainId:s,formatUnits:a,token:rt}){const ot=getConfig(),tr=getPublicClient({chainId:s});if(rt){const ir=async({abi:sr})=>{const ar={abi:sr,address:rt,chainId:s},[ur,cr,lr]=await readContracts({allowFailure:!1,contracts:[{...ar,functionName:"balanceOf",args:[o]},{...ar,functionName:"decimals"},{...ar,functionName:"symbol"}]});return{decimals:cr,formatted:formatUnits$2(ur??"0",getUnit(a??cr)),symbol:lr,value:ur}};try{return await ir({abi:erc20ABI})}catch(sr){if(sr instanceof ContractFunctionExecutionError$1){const{symbol:ar,...ur}=await ir({abi:erc20ABI_bytes32});return{symbol:hexToString(trim$2(ar,{dir:"right"})),...ur}}throw sr}}const Ut=[...ot.publicClient.chains||[],...ot.chains??[]],rr=await tr.getBalance({address:o}),nr=Ut.find(ir=>ir.id===tr.chain.id);return{decimals:(nr==null?void 0:nr.nativeCurrency.decimals)??18,formatted:formatUnits$2(rr??"0",getUnit(a??18)),symbol:(nr==null?void 0:nr.nativeCurrency.symbol)??"ETH",value:rr}}function getAccount(){const{data:o,connector:s,status:a}=getConfig();switch(a){case"connected":return{address:o==null?void 0:o.account,connector:s,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:a};case"reconnecting":return{address:o==null?void 0:o.account,connector:s,isConnected:!!(o!=null&&o.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:a};case"connecting":return{address:o==null?void 0:o.account,connector:s,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:a};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:a}}}function getNetwork(){var ot,tr,Ut,rr;const o=getConfig(),s=(tr=(ot=o.data)==null?void 0:ot.chain)==null?void 0:tr.id,a=o.chains??[],rt=[...((Ut=o.publicClient)==null?void 0:Ut.chains)||[],...a].find(nr=>nr.id===s)??{id:s,name:`Chain ${s}`,network:`${s}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:s?{...rt,...(rr=o.data)==null?void 0:rr.chain,id:s}:void 0,chains:a}}async function signMessage$2(o){const s=await getWalletClient();if(!s)throw new ConnectorNotFoundError;return await s.signMessage({message:o.message})}async function signTypedData$2({domain:o,message:s,primaryType:a,types:rt}){const ot=await getWalletClient();if(!ot)throw new ConnectorNotFoundError;const{chainId:tr}=o;return tr&&assertActiveChain({chainId:tr}),ot.signTypedData({message:s,primaryType:a,types:rt,domain:o})}async function switchNetwork({chainId:o}){const{connector:s}=getConfig();if(!s)throw new ConnectorNotFoundError;if(!s.switchChain)throw new SwitchChainNotSupportedError({connector:s});return s.switchChain(o)}function watchAccount(o,{selector:s=a=>a}={}){const a=getConfig(),rt=()=>o(getAccount());return a.subscribe(({data:tr,connector:Ut,status:rr})=>s({address:tr==null?void 0:tr.account,connector:Ut,status:rr}),rt,{equalityFn:shallow$1})}function watchNetwork(o,{selector:s=a=>a}={}){const a=getConfig(),rt=()=>o(getNetwork());return a.subscribe(({data:tr,chains:Ut})=>{var rr;return s({chainId:(rr=tr==null?void 0:tr.chain)==null?void 0:rr.id,chains:Ut})},rt,{equalityFn:shallow$1})}async function fetchEnsAddress({chainId:o,name:s}){const{normalize:a}=await __vitePreload(()=>import("./index-afc47151.js"),[],import.meta.url),ot=await getPublicClient({chainId:o}).getEnsAddress({name:a(s)});try{return ot==="0x0000000000000000000000000000000000000000"?null:ot?getAddress$2(ot):null}catch{return null}}async function fetchEnsAvatar({name:o,chainId:s}){const{normalize:a}=await __vitePreload(()=>import("./index-afc47151.js"),[],import.meta.url);return await getPublicClient({chainId:s}).getEnsAvatar({name:a(o)})}async function fetchEnsName({address:o,chainId:s}){return getPublicClient({chainId:s}).getEnsName({address:getAddress$2(o)})}async function fetchEnsResolver({chainId:o,name:s}){const{normalize:a}=await __vitePreload(()=>import("./index-afc47151.js"),[],import.meta.url);return await getPublicClient({chainId:o}).getEnsResolver({name:a(s)})}async function fetchBlockNumber({chainId:o}={}){return await getPublicClient({chainId:o}).getBlockNumber()}async function fetchFeeData({chainId:o,formatUnits:s="gwei"}={}){const a=getPublicClient({chainId:o}),rt=await a.getBlock();let ot=null;try{ot=await a.getGasPrice()}catch{}let tr=null,Ut=null,rr=null;rt!=null&&rt.baseFeePerGas&&(tr=rt.baseFeePerGas,rr=parseGwei$2("1"),Ut=rt.baseFeePerGas*2n+rr);const nr=getUnit(s),ir={gasPrice:ot?formatUnits$2(ot,nr):null,maxFeePerGas:Ut?formatUnits$2(Ut,nr):null,maxPriorityFeePerGas:rr?formatUnits$2(rr,nr):null};return{lastBaseFeePerGas:tr,gasPrice:ot,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,formatted:ir}}async function fetchTransaction({chainId:o,hash:s}){return getPublicClient({chainId:o}).getTransaction({hash:s})}async function prepareSendTransaction({accessList:o,account:s,chainId:a,data:rt,gas:ot,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:nr,to:ir,value:sr,walletClient:ar}){const ur=getPublicClient({chainId:a}),cr=ar??await getWalletClient({chainId:a});if(!cr)throw new ConnectorNotFoundError;a&&assertActiveChain({chainId:a});const lr=(ir&&!isAddress$2(ir)?await fetchEnsAddress({name:ir}):ir)||void 0;if(lr&&!isAddress$2(lr))throw new Error("Invalid address");const hr=typeof ot>"u"?await ur.estimateGas({accessList:o,account:cr.account,data:rt,gas:ot??void 0,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:nr,to:lr,value:sr}):ot||void 0;return{accessList:o,account:s,data:rt,gas:hr,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,mode:"prepared",nonce:nr,to:lr,value:sr,...a?{chainId:a}:{}}}async function sendTransaction$2({accessList:o,account:s,chainId:a,data:rt,gas:ot,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,mode:nr,nonce:ir,to:sr,value:ar}){const ur=await getWalletClient({chainId:a});if(!ur)throw new ConnectorNotFoundError;a&&assertActiveChain({chainId:a});let cr;return nr==="prepared"?cr={account:s,accessList:o,chain:null,data:rt,gas:ot,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:ir,to:sr,value:ar}:cr=await prepareSendTransaction({accessList:o,account:s,chainId:a,data:rt,gas:ot||null,gasPrice:tr,maxFeePerGas:Ut,maxPriorityFeePerGas:rr,nonce:ir,to:sr,value:ar}),{hash:await ur.sendTransaction({...cr,chain:a?{id:a}:null})}}async function waitForTransaction({chainId:o,confirmations:s=1,hash:a,onReplaced:rt,timeout:ot=0}){const tr=getPublicClient({chainId:o}),Ut=await tr.waitForTransactionReceipt({hash:a,confirmations:s,onReplaced:rt,timeout:ot});if(Ut.status==="reverted"){const rr=await tr.getTransaction({hash:Ut.transactionHash}),nr=await tr.call({...rr,gasPrice:rr.type!=="eip1559"?rr.gasPrice:void 0,maxFeePerGas:rr.type==="eip1559"?rr.maxFeePerGas:void 0,maxPriorityFeePerGas:rr.type==="eip1559"?rr.maxPriorityFeePerGas:void 0}),ir=hexToString(`0x${nr.substring(138)}`);throw new Error(ir)}return Ut}function assertActiveChain({chainId:o}){var ot,tr;const{chain:s,chains:a}=getNetwork(),rt=s==null?void 0:s.id;if(rt&&o!==rt)throw new ChainMismatchError$1({activeChain:((ot=a.find(Ut=>Ut.id===rt))==null?void 0:ot.name)??`Chain ${rt}`,targetChain:((tr=a.find(Ut=>Ut.id===o))==null?void 0:tr.name)??`Chain ${o}`})}var withSelector={exports:{}},withSelector_production_min={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -1995,7 +1995,7 @@ PERFORMANCE OF THIS SOFTWARE. Required: ${Ut.toString()} Approved: ${rr.toString()}`)),Object.keys(s).forEach(ar=>{if(!ar.includes(":")||rt)return;const ur=A(s[ar].accounts);ur.includes(ar)||(rt=N("NON_CONFORMING_NAMESPACES",`${a} namespaces accounts don't satisfy namespace accounts for ${ar} Required: ${ar} - Approved: ${ur.toString()}`))}),Ut.forEach(ar=>{rt||(O(ot[ar].methods,tr[ar].methods)?O(ot[ar].events,tr[ar].events)||(rt=N("NON_CONFORMING_NAMESPACES",`${a} namespaces events don't satisfy namespace events for ${ar}`)):rt=N("NON_CONFORMING_NAMESPACES",`${a} namespaces methods don't satisfy namespace methods for ${ar}`))}),rt}function Yt(o){const s={};return Object.keys(o).forEach(a=>{var rt;a.includes(":")?s[a]=o[a]:(rt=o[a].chains)==null||rt.forEach(ot=>{s[ot]={methods:o[a].methods,events:o[a].events}})}),s}function ln(o){return[...new Set(o.map(s=>s.includes(":")?s.split(":")[0]:s))]}function Jt(o){const s={};return Object.keys(o).forEach(a=>{if(a.includes(":"))s[a]=o[a];else{const rt=A(o[a].accounts);rt==null||rt.forEach(ot=>{s[ot]={accounts:o[a].accounts.filter(tr=>tr.includes(`${ot}:`)),methods:o[a].methods,events:o[a].events}})}}),s}function Qt(o,s){return G(o,!1)&&o<=s.max&&o>=s.min}function Zt(){const o=R();return new Promise(s=>{switch(o){case m.browser:s(dn());break;case m.reactNative:s(fn());break;case m.node:s(pn());break;default:s(!0)}})}function dn(){return q()&&(navigator==null?void 0:navigator.onLine)}async function fn(){if(H()&&typeof global<"u"&&global!=null&&global.NetInfo){const o=await(global==null?void 0:global.NetInfo.fetch());return o==null?void 0:o.isConnected}return!0}function pn(){return!0}function Xt(o){switch(R()){case m.browser:mn(o);break;case m.reactNative:yn(o);break}}function mn(o){q()&&(window.addEventListener("online",()=>o(!0)),window.addEventListener("offline",()=>o(!1)))}function yn(o){H()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(s=>o(s==null?void 0:s.isConnected)))}const ae={};class er{static get(s){return ae[s]}static set(s,a){ae[s]=a}static delete(s){delete ae[s]}}var NAMESPACE="eip155",STORE_KEY="store",REQUESTED_CHAINS_KEY="requestedChains",ADD_ETH_CHAIN_METHOD="wallet_addEthereumChain",_provider,_initProviderPromise,_createProvider,createProvider_fn,_initProvider,initProvider_fn,_isChainsStale,isChainsStale_fn,_setupListeners,setupListeners_fn,_removeListeners,removeListeners_fn,_setRequestedChainsIds,setRequestedChainsIds_fn,_getRequestedChainsIds,getRequestedChainsIds_fn,_getNamespaceChainsIds,getNamespaceChainsIds_fn,_getNamespaceMethods,getNamespaceMethods_fn,WalletConnectConnector$1=class extends Connector{constructor(s){super({...s,options:{isNewChainsStale:!0,...s.options}}),__privateAdd$1(this,_createProvider),__privateAdd$1(this,_initProvider),__privateAdd$1(this,_isChainsStale),__privateAdd$1(this,_setupListeners),__privateAdd$1(this,_removeListeners),__privateAdd$1(this,_setRequestedChainsIds),__privateAdd$1(this,_getRequestedChainsIds),__privateAdd$1(this,_getNamespaceChainsIds),__privateAdd$1(this,_getNamespaceMethods),this.id="walletConnect",this.name="WalletConnect",this.ready=!0,__privateAdd$1(this,_provider,void 0),__privateAdd$1(this,_initProviderPromise,void 0),this.onAccountsChanged=a=>{a.length===0?this.emit("disconnect"):this.emit("change",{account:getAddress$2(a[0])})},this.onChainChanged=a=>{const rt=Number(a),ot=this.isChainUnsupported(rt);this.emit("change",{chain:{id:rt,unsupported:ot}})},this.onDisconnect=()=>{__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,[]),this.emit("disconnect")},this.onDisplayUri=a=>{this.emit("message",{type:"display_uri",data:a})},this.onConnect=()=>{this.emit("connect",{})},__privateMethod$1(this,_createProvider,createProvider_fn).call(this)}async connect({chainId:s,pairingTopic:a}={}){var rt,ot,tr,Ut,rr;try{let nr=s;if(!nr){const hr=(rt=this.storage)==null?void 0:rt.getItem(STORE_KEY),gr=(Ut=(tr=(ot=hr==null?void 0:hr.state)==null?void 0:ot.data)==null?void 0:tr.chain)==null?void 0:Ut.id;gr&&!this.isChainUnsupported(gr)?nr=gr:nr=(rr=this.chains[0])==null?void 0:rr.id}if(!nr)throw new Error("No chains found on connector.");const ir=await this.getProvider();__privateMethod$1(this,_setupListeners,setupListeners_fn).call(this);const sr=__privateMethod$1(this,_isChainsStale,isChainsStale_fn).call(this);if(ir.session&&sr&&await ir.disconnect(),!ir.session||sr){const hr=this.chains.filter(gr=>gr.id!==nr).map(gr=>gr.id);this.emit("message",{type:"connecting"}),await ir.connect({pairingTopic:a,chains:[nr],optionalChains:hr.length?hr:void 0}),__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,this.chains.map(({id:gr})=>gr))}const ar=await ir.enable(),ur=getAddress$2(ar[0]),cr=await this.getChainId(),lr=this.isChainUnsupported(cr);return{account:ur,chain:{id:cr,unsupported:lr}}}catch(nr){throw/user rejected/i.test(nr==null?void 0:nr.message)?new UserRejectedRequestError$1(nr):nr}}async disconnect(){const s=await this.getProvider();try{await s.disconnect()}catch(a){if(!/No matching key/i.test(a.message))throw a}finally{__privateMethod$1(this,_removeListeners,removeListeners_fn).call(this),__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,[])}}async getAccount(){const{accounts:s}=await this.getProvider();return getAddress$2(s[0])}async getChainId(){const{chainId:s}=await this.getProvider();return s}async getProvider({chainId:s}={}){return __privateGet$1(this,_provider)||await __privateMethod$1(this,_createProvider,createProvider_fn).call(this),s&&await this.switchChain(s),__privateGet$1(this,_provider)}async getWalletClient({chainId:s}={}){const[a,rt]=await Promise.all([this.getProvider({chainId:s}),this.getAccount()]),ot=this.chains.find(tr=>tr.id===s);if(!a)throw new Error("provider is required.");return createWalletClient$1({account:rt,chain:ot,transport:custom$2(a)})}async isAuthorized(){try{const[s,a]=await Promise.all([this.getAccount(),this.getProvider()]),rt=__privateMethod$1(this,_isChainsStale,isChainsStale_fn).call(this);if(!s)return!1;if(rt&&a.session){try{await a.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(s){var rt,ot;const a=this.chains.find(tr=>tr.id===s);if(!a)throw new SwitchChainError$1(new Error("chain not found on connector."));try{const tr=await this.getProvider(),Ut=__privateMethod$1(this,_getNamespaceChainsIds,getNamespaceChainsIds_fn).call(this),rr=__privateMethod$1(this,_getNamespaceMethods,getNamespaceMethods_fn).call(this);if(!Ut.includes(s)&&rr.includes(ADD_ETH_CHAIN_METHOD)){await tr.request({method:ADD_ETH_CHAIN_METHOD,params:[{chainId:numberToHex(a.id),blockExplorerUrls:[(ot=(rt=a.blockExplorers)==null?void 0:rt.default)==null?void 0:ot.url],chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[...a.rpcUrls.default.http]}]});const ir=__privateMethod$1(this,_getRequestedChainsIds,getRequestedChainsIds_fn).call(this);ir.push(s),__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,ir)}return await tr.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(s)}]}),a}catch(tr){const Ut=typeof tr=="string"?tr:tr==null?void 0:tr.message;throw/user rejected request/i.test(Ut)?new UserRejectedRequestError$1(tr):new SwitchChainError$1(tr)}}};_provider=new WeakMap;_initProviderPromise=new WeakMap;_createProvider=new WeakSet;createProvider_fn=async function(){return!__privateGet$1(this,_initProviderPromise)&&typeof window<"u"&&__privateSet$1(this,_initProviderPromise,__privateMethod$1(this,_initProvider,initProvider_fn).call(this)),__privateGet$1(this,_initProviderPromise)};_initProvider=new WeakSet;initProvider_fn=async function(){const{EthereumProvider:o,OPTIONAL_EVENTS:s,OPTIONAL_METHODS:a}=await __vitePreload(()=>import("./index.es-e7c93c26.js"),[],import.meta.url),[rt,...ot]=this.chains.map(({id:tr})=>tr);if(rt){const{projectId:tr,showQrModal:Ut=!0,qrModalOptions:rr,metadata:nr,relayUrl:ir}=this.options;__privateSet$1(this,_provider,await o.init({showQrModal:Ut,qrModalOptions:rr,projectId:tr,optionalMethods:a,optionalEvents:s,chains:[rt],optionalChains:ot.length?ot:void 0,rpcMap:Object.fromEntries(this.chains.map(sr=>[sr.id,sr.rpcUrls.default.http[0]])),metadata:nr,relayUrl:ir}))}};_isChainsStale=new WeakSet;isChainsStale_fn=function(){if(__privateMethod$1(this,_getNamespaceMethods,getNamespaceMethods_fn).call(this).includes(ADD_ETH_CHAIN_METHOD)||!this.options.isNewChainsStale)return!1;const s=__privateMethod$1(this,_getRequestedChainsIds,getRequestedChainsIds_fn).call(this),a=this.chains.map(({id:ot})=>ot),rt=__privateMethod$1(this,_getNamespaceChainsIds,getNamespaceChainsIds_fn).call(this);return rt.length&&!rt.some(ot=>a.includes(ot))?!1:!a.every(ot=>s.includes(ot))};_setupListeners=new WeakSet;setupListeners_fn=function(){__privateGet$1(this,_provider)&&(__privateMethod$1(this,_removeListeners,removeListeners_fn).call(this),__privateGet$1(this,_provider).on("accountsChanged",this.onAccountsChanged),__privateGet$1(this,_provider).on("chainChanged",this.onChainChanged),__privateGet$1(this,_provider).on("disconnect",this.onDisconnect),__privateGet$1(this,_provider).on("session_delete",this.onDisconnect),__privateGet$1(this,_provider).on("display_uri",this.onDisplayUri),__privateGet$1(this,_provider).on("connect",this.onConnect))};_removeListeners=new WeakSet;removeListeners_fn=function(){__privateGet$1(this,_provider)&&(__privateGet$1(this,_provider).removeListener("accountsChanged",this.onAccountsChanged),__privateGet$1(this,_provider).removeListener("chainChanged",this.onChainChanged),__privateGet$1(this,_provider).removeListener("disconnect",this.onDisconnect),__privateGet$1(this,_provider).removeListener("session_delete",this.onDisconnect),__privateGet$1(this,_provider).removeListener("display_uri",this.onDisplayUri),__privateGet$1(this,_provider).removeListener("connect",this.onConnect))};_setRequestedChainsIds=new WeakSet;setRequestedChainsIds_fn=function(o){var s;(s=this.storage)==null||s.setItem(REQUESTED_CHAINS_KEY,o)};_getRequestedChainsIds=new WeakSet;getRequestedChainsIds_fn=function(){var o;return((o=this.storage)==null?void 0:o.getItem(REQUESTED_CHAINS_KEY))??[]};_getNamespaceChainsIds=new WeakSet;getNamespaceChainsIds_fn=function(){var rt,ot,tr;if(!__privateGet$1(this,_provider))return[];const o=(rt=__privateGet$1(this,_provider).session)==null?void 0:rt.namespaces;return o?((tr=(ot=se(o)[NAMESPACE])==null?void 0:ot.chains)==null?void 0:tr.map(Ut=>parseInt(Ut.split(":")[1]||"")))??[]:[]};_getNamespaceMethods=new WeakSet;getNamespaceMethods_fn=function(){var rt,ot;if(!__privateGet$1(this,_provider))return[];const o=(rt=__privateGet$1(this,_provider).session)==null?void 0:rt.namespaces;return o?((ot=se(o)[NAMESPACE])==null?void 0:ot.methods)??[]:[]};let globalData={walletConnectDefaultOptions:{appName:"Connect Wallet"}};const setGlobalData=o=>{globalData={...globalData,...o}},getGlobalData=()=>globalData,InjectedIcon=o=>jsxRuntimeExports.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6505 3.64041C15.6501 3.64062 15.6497 3.64083 15.6493 3.64103L6.05165 8.43985L16.2501 13.5391L26.4484 8.43987L16.8508 3.64103C16.8504 3.64083 16.85 3.64063 16.8496 3.64043C16.6632 3.54806 16.458 3.5 16.25 3.5C16.042 3.5 15.8369 3.54806 15.6505 3.64041ZM28 10.4592L17.5001 15.7091L17.5 28.5205L27.248 23.6465L27.2508 23.6452C27.4757 23.5334 27.665 23.3611 27.7973 23.1477C27.9297 22.9342 27.9999 22.6881 28 22.4369V10.4592ZM15 28.527L15.0001 15.7091L4.50006 10.4591V22.4333C4.49831 22.6849 4.56687 22.9319 4.69807 23.1466C4.82896 23.3608 5.01696 23.5342 5.24095 23.6475C5.24148 23.6477 5.242 23.648 5.24253 23.6483L15 28.527ZM14.5207 31.0824L4.12104 25.8826L4.11759 25.8809C3.47681 25.558 2.93902 25.0625 2.56486 24.4502C2.19154 23.8394 1.99597 23.1365 2.00006 22.4207V10.0486C2.00044 9.33234 2.20062 8.62972 2.5781 8.021C2.95529 7.41274 3.49457 6.92167 4.13537 6.60291C4.13585 6.60267 4.13633 6.60243 4.13681 6.60219L14.534 1.40359L14.5368 1.40221C15.0692 1.13767 15.6556 1 16.25 1C16.8445 1 17.4309 1.13767 17.9633 1.40221L17.966 1.40358L28.3633 6.60219C28.3638 6.60245 28.3643 6.6027 28.3648 6.60295C29.0055 6.92171 29.5448 7.41276 29.922 8.021C30.2994 8.62973 30.4996 9.33168 30.5 10.0479V22.4376C30.4996 23.1538 30.2994 23.8565 29.922 24.4652C29.5448 25.0734 29.0056 25.5644 28.365 25.8831C28.3644 25.8834 28.3638 25.8837 28.3633 25.884L17.9664 31.0824C17.9663 31.0825 17.9665 31.0824 17.9664 31.0824C17.4316 31.3499 16.8415 31.4894 16.2435 31.4894C15.6455 31.4894 15.0554 31.3499 14.5207 31.0824C14.5205 31.0824 14.5208 31.0825 14.5207 31.0824Z",fill:"#CCCCCC"})}),INJECTED_ID="injected";function injected(o={}){const{connectorOptions:s,...a}=o;return{id:INJECTED_ID,name:"Browser Wallet",logos:{default:jsxRuntimeExports.jsx(InjectedIcon,{})},downloadUrls:{default:void 0},installed:isInjected(),createConnector:rt=>new InjectedConnector({chains:rt,options:{name:"Browser Wallet",shimDisconnect:!0,...s}}),getUri:()=>{},...a}}function isInjected(){return typeof window<"u"&&!!window.ethereum}function MetaMaskIcon(o){return jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_827_48434)",children:[jsxRuntimeExports.jsx("path",{d:"M40.6314 10.9688L27.95 20.3874L30.2951 14.8305L40.6314 10.9688Z",fill:"#E2761B"}),jsxRuntimeExports.jsx("path",{d:"M11.3559 10.9688L23.9353 20.4766L21.7049 14.8305L11.3559 10.9688Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M36.0687 32.8011L32.6912 37.9756L39.9177 39.9638L41.9951 32.9158L36.0687 32.8011Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M10.0176 32.9158L12.0823 39.9638L19.3088 37.9756L15.9314 32.8011L10.0176 32.9158Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M18.901 24.058L16.8873 27.104L24.0627 27.4227L23.8078 19.7119L18.901 24.058Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M33.0863 24.058L28.1157 19.6227L27.95 27.4227L35.1127 27.104L33.0863 24.058Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M19.3088 37.9756L23.6167 35.8727L19.8951 32.9668L19.3088 37.9756Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M28.3706 35.8727L32.6912 37.9756L32.0922 32.9668L28.3706 35.8727Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M32.6912 37.9756L28.3706 35.8727L28.7147 38.6893L28.6765 39.8746L32.6912 37.9756Z",fill:"#D7C1B3"}),jsxRuntimeExports.jsx("path",{d:"M19.3088 37.9756L23.3235 39.8746L23.298 38.6893L23.6167 35.8727L19.3088 37.9756Z",fill:"#D7C1B3"}),jsxRuntimeExports.jsx("path",{d:"M23.3873 31.106L19.7931 30.0482L22.3294 28.8884L23.3873 31.106Z",fill:"#233447"}),jsxRuntimeExports.jsx("path",{d:"M28.6 31.106L29.6578 28.8884L32.2068 30.0482L28.6 31.106Z",fill:"#233447"}),jsxRuntimeExports.jsx("path",{d:"M19.3088 37.9756L19.9206 32.8011L15.9314 32.9158L19.3088 37.9756Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M32.0794 32.8011L32.6912 37.9756L36.0686 32.9158L32.0794 32.8011Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M35.1127 27.104L27.95 27.4227L28.6128 31.106L29.6706 28.8884L32.2196 30.0482L35.1127 27.104Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M19.7931 30.0482L22.3422 28.8884L23.3873 31.106L24.0627 27.4227L16.8873 27.104L19.7931 30.0482Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M16.8873 27.104L19.8951 32.9668L19.7931 30.0482L16.8873 27.104Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M32.2196 30.0482L32.0922 32.9668L35.1127 27.104L32.2196 30.0482Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M24.0627 27.4227L23.3873 31.106L24.2284 35.4521L24.4196 29.7295L24.0627 27.4227Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M27.95 27.4227L27.6059 29.7168L27.7588 35.4521L28.6128 31.106L27.95 27.4227Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M28.6128 31.106L27.7588 35.4521L28.3706 35.8727L32.0922 32.9668L32.2196 30.0482L28.6128 31.106Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M19.7931 30.0482L19.8951 32.9668L23.6167 35.8727L24.2284 35.4521L23.3873 31.106L19.7931 30.0482Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M28.6765 39.8746L28.7147 38.6893L28.3961 38.4089H23.5912L23.298 38.6893L23.3235 39.8746L19.3088 37.9756L20.7108 39.1227L23.5529 41.0982H28.4343L31.2892 39.1227L32.6912 37.9756L28.6765 39.8746Z",fill:"#C0AD9E"}),jsxRuntimeExports.jsx("path",{d:"M28.3706 35.8727L27.7588 35.4521H24.2284L23.6167 35.8727L23.298 38.6893L23.5912 38.4089H28.3961L28.7147 38.6893L28.3706 35.8727Z",fill:"#161616"}),jsxRuntimeExports.jsx("path",{d:"M41.1667 20.9991L42.25 15.7991L40.6314 10.9688L28.3706 20.0688L33.0863 24.058L39.752 26.008L41.2304 24.2874L40.5931 23.8286L41.6127 22.8982L40.8225 22.2864L41.8422 21.5089L41.1667 20.9991Z",fill:"#763D16"}),jsxRuntimeExports.jsx("path",{d:"M9.75 15.7991L10.8333 20.9991L10.1451 21.5089L11.1647 22.2864L10.3873 22.8982L11.4069 23.8286L10.7696 24.2874L12.2353 26.008L18.901 24.058L23.6167 20.0688L11.3559 10.9688L9.75 15.7991Z",fill:"#763D16"}),jsxRuntimeExports.jsx("path",{d:"M39.752 26.008L33.0863 24.058L35.1127 27.104L32.0922 32.9668L36.0686 32.9158H41.9951L39.752 26.008Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M18.901 24.058L12.2353 26.008L10.0176 32.9158H15.9314L19.8951 32.9668L16.8873 27.104L18.901 24.058Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M27.95 27.4227L28.3706 20.0688L30.3078 14.8305L21.7049 14.8305L23.6167 20.0688L24.0627 27.4227L24.2157 29.7423L24.2284 35.4521H27.7588L27.7843 29.7423L27.95 27.4227Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2682 10.7855C11.318 10.7617 11.3752 10.7592 11.4269 10.7784L21.7416 14.6274L30.2584 14.6274L40.5603 10.7785C40.6119 10.7592 40.6691 10.7617 40.7188 10.7854C40.7685 10.8091 40.8065 10.852 40.824 10.9042L42.4426 15.7346C42.454 15.7687 42.4562 15.8053 42.4489 15.8406L41.3918 20.9146L41.9645 21.3468C42.0152 21.3851 42.0451 21.4449 42.0453 21.5084C42.0454 21.572 42.0159 21.6319 41.9653 21.6705L41.1559 22.2876L41.7371 22.7375C41.7845 22.7743 41.8133 22.83 41.8157 22.89C41.8181 22.9499 41.794 23.0078 41.7497 23.0482L40.9149 23.8099L41.3491 24.1225C41.3953 24.1558 41.4254 24.2069 41.4321 24.2634C41.4388 24.3199 41.4215 24.3766 41.3845 24.4198L39.9804 26.0538L42.1883 32.8531C42.201 32.892 42.2015 32.9339 42.19 32.9732L40.1125 40.0213C40.0812 40.1275 39.9706 40.1891 39.8638 40.1597L32.7386 38.1993L31.4178 39.2799C31.4136 39.2833 31.4093 39.2866 31.4048 39.2897L28.5499 41.2652C28.5159 41.2887 28.4756 41.3013 28.4343 41.3013H23.5529C23.5115 41.3013 23.471 41.2886 23.437 41.265L20.5949 39.2895C20.5905 39.2864 20.5863 39.2832 20.5822 39.2799L19.2615 38.1993L12.1362 40.1597C12.0293 40.1891 11.9186 40.1274 11.8874 40.021L9.8227 32.9729C9.81128 32.9339 9.81182 32.8924 9.82423 32.8537L12.0073 26.0536L10.615 24.4191C10.5782 24.3759 10.5611 24.3193 10.568 24.2629C10.5748 24.2066 10.6049 24.1557 10.6509 24.1225L11.0851 23.8099L10.2503 23.0482C10.2063 23.008 10.1821 22.9504 10.1843 22.8908C10.1864 22.8311 10.2147 22.7754 10.2616 22.7385L10.833 22.2889L10.0219 21.6705C9.97115 21.6317 9.94153 21.5714 9.94198 21.5075C9.94242 21.4437 9.97287 21.3837 10.0242 21.3457L10.608 20.9133L9.55114 15.8406C9.54383 15.8055 9.54594 15.7691 9.55725 15.7351L11.1631 10.9047C11.1805 10.8523 11.2185 10.8093 11.2682 10.7855ZM12.3958 26.1727L10.2979 32.7072L15.9274 32.598C15.9974 32.5967 16.0632 32.6314 16.1015 32.6901L16.1128 32.7074L19.484 32.6105L16.7065 27.1968C16.673 27.1315 16.6774 27.0532 16.7178 26.992L18.4256 24.4087L12.3958 26.1727ZM19.0544 24.1943L17.2544 26.917L23.8463 27.2097L23.4385 20.4856L19.0544 24.1943ZM23.8209 27.6153L17.3956 27.3299L19.8379 29.8043L22.2449 28.7036C22.2744 28.6902 22.3054 28.6843 22.3357 28.6853C22.4143 28.6828 22.4904 28.7263 22.5259 28.8018L23.3015 30.4475L23.8209 27.6153ZM23.008 30.7826L22.2342 29.1606L20.3735 30.0072L23.008 30.7826ZM20.006 30.3225L20.0886 32.6869C20.1159 32.7271 20.1281 32.7761 20.1223 32.825L20.1157 32.8813L23.6243 35.6209L24.0037 35.3601L23.2113 31.266L20.006 30.3225ZM23.594 31.105L24.0205 33.3089L24.0126 29.7492L23.9676 29.0675L23.594 31.105ZM24.2915 35.6552L23.8081 35.9876L23.5568 38.2087C23.5681 38.2068 23.5796 38.2058 23.5912 38.2058H28.3961C28.4151 38.2058 28.4339 38.2085 28.452 38.2137L28.1801 35.9882L27.6957 35.6552H24.2915ZM27.9838 35.3603L28.363 35.6209L31.8833 32.8722L31.8777 32.825C31.8728 32.7833 31.8809 32.7416 31.9003 32.7054L32.0043 30.323L28.7883 31.2662L27.9838 35.3603ZM32.4192 30.1349L32.3355 32.051L34.3185 28.2021L32.4192 30.1349ZM34.7444 26.9171L32.9331 24.1944L28.5501 20.4867L28.1656 27.2098L34.7444 26.9171ZM33.1873 23.8759L39.6833 25.7762L40.9321 24.3229L40.4744 23.9934C40.4248 23.9576 40.3939 23.9014 40.3904 23.8403C40.3868 23.7792 40.411 23.7198 40.4562 23.6785L41.2974 22.9109L40.6982 22.447C40.6483 22.4084 40.6192 22.3488 40.6194 22.2857C40.6197 22.2225 40.6492 22.1631 40.6994 22.1249L41.5061 21.5098L41.0443 21.1613C40.9816 21.1139 40.9518 21.0347 40.9678 20.9577L42.0399 15.8115L40.5277 11.2988L28.8294 19.9873L33.1873 23.8759ZM39.3568 11.6618L30.4681 14.9827L28.798 19.4985L39.3568 11.6618ZM29.9889 15.0336L22.0036 15.0336L23.7726 19.5118C23.8109 19.5051 23.851 19.5093 23.8882 19.5253C23.9604 19.5564 24.0083 19.6265 24.0109 19.7052L24.0256 20.1524L24.1242 20.402C24.1577 20.4866 24.1307 20.5832 24.0582 20.6383C24.053 20.6423 24.0476 20.646 24.0421 20.6494L24.2654 27.4037L24.6203 29.6985C24.6223 29.711 24.623 29.7237 24.6226 29.7363L24.4385 35.249H27.5502L27.4028 29.7222C27.4025 29.7103 27.4032 29.6984 27.405 29.6867L27.7472 27.4054L27.8921 20.5821C27.8681 20.575 27.8452 20.5633 27.8246 20.5471C27.7525 20.4906 27.7273 20.3928 27.7629 20.3084L27.9051 19.9714L27.9126 19.6184C27.9143 19.5391 27.9619 19.4681 28.0346 19.4364C28.0676 19.422 28.1031 19.417 28.1375 19.4207L29.9889 15.0336ZM27.9715 33.3162L28.3994 31.1382C28.3958 31.1159 28.396 31.093 28.4 31.0705L28.0371 29.0539L27.9874 29.75L27.9715 33.3162ZM28.191 27.6153L28.6975 30.4298L29.4745 28.8009C29.5103 28.7259 29.5862 28.6828 29.6644 28.6853C29.6946 28.6843 29.7254 28.6901 29.7547 28.7035L32.1744 29.8044L34.606 27.3299L28.191 27.6153ZM31.6257 30.0069L29.7658 29.1606L28.9939 30.7788L31.6257 30.0069ZM21.5462 14.9881L12.6288 11.6605L23.1935 19.5017L21.5462 14.9881ZM11.4593 11.3015L9.96002 15.8113L11.0322 20.9577C11.0484 21.0353 11.0179 21.1152 10.9542 21.1624L10.4832 21.5113L11.2879 22.1249C11.3378 22.163 11.3673 22.222 11.3678 22.2848C11.3683 22.3477 11.3397 22.4072 11.2903 22.446L10.7012 22.9096L11.5438 23.6785C11.589 23.7198 11.6132 23.7792 11.6096 23.8403C11.6061 23.9014 11.5752 23.9576 11.5256 23.9934L11.0672 24.3234L12.3046 25.7761L18.8003 23.8758L23.0803 20.085L11.4593 11.3015ZM39.5919 26.1728L33.564 24.4094L35.2818 26.9915C35.3227 27.0529 35.3271 27.1316 35.2933 27.1971L32.5044 32.6101L35.8873 32.7074L35.8986 32.6901C35.9368 32.6315 36.0026 32.5967 36.0726 32.598L41.7138 32.7072L39.5919 26.1728ZM31.9333 33.3486L28.7521 35.8325L32.4453 37.63L31.9333 33.3486ZM32.2217 37.973L28.6175 36.2188L28.9164 38.6647C28.9176 38.6751 28.9181 38.6855 28.9178 38.6959L28.8902 39.5488L32.2217 37.973ZM31.2798 38.8679L28.7634 40.0583C28.6994 40.0885 28.6243 40.0833 28.5651 40.0445C28.5059 40.0057 28.4712 39.9388 28.4735 39.8681L28.5086 38.7786L28.3194 38.6121H23.6727L23.503 38.7743L23.5266 39.8703C23.5281 39.9406 23.4931 40.0068 23.434 40.0451C23.375 40.0834 23.3003 40.0884 23.2367 40.0583L20.7202 38.8679L20.8332 38.9604L23.6166 40.895H28.3709L31.1669 38.9603L31.2798 38.8679ZM19.7778 37.9727L23.1134 39.5505L23.095 38.6937C23.0948 38.6877 23.095 38.6816 23.0954 38.6756C23.0956 38.6726 23.0959 38.6695 23.0962 38.6665L23.3733 36.2175L19.7778 37.9727ZM23.2355 35.8327L19.5542 37.6298L20.0599 33.3531L23.2355 35.8327ZM19.6603 32.0642L17.6716 28.1879L19.5929 30.1345L19.6603 32.0642ZM10.2888 33.1189L12.2211 39.715L18.9837 37.8544L15.8228 33.1189H10.2888ZM19.6672 33.167L16.3852 33.1248L19.1723 37.3948L19.6672 33.167ZM33.0163 37.8544L39.7792 39.7151L41.7235 33.1189H36.1773L33.0163 37.8544ZM35.6148 33.1248L32.3272 33.1669L32.8272 37.3957L35.6148 33.1248Z",fill:"#F6851B"})]}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_827_48434",children:jsxRuntimeExports.jsx("rect",{width:"52",height:"52",rx:"24",fill:"white"})})})]})}const TokenPocketIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1_2",maskUnits:"userSpaceOnUse",x:"8",y:"14",width:"36",height:"24",children:jsxRuntimeExports.jsx("path",{d:"M44 14H8V37.2274H44V14Z",fill:"white"})}),jsxRuntimeExports.jsxs("g",{mask:"url(#mask0_1_2)",children:[jsxRuntimeExports.jsx("path",{d:"M19.8012 21.9884H19.8078C19.8012 21.9495 19.8012 21.9042 19.8012 21.8653V21.9884Z",fill:"#29AEFF"}),jsxRuntimeExports.jsx("path",{d:"M32.6906 23.2184H25.5567V36.0945C25.5567 36.7031 26.0487 37.1951 26.6572 37.1951H31.5902C32.1986 37.1951 32.6906 36.7031 32.6906 36.0945V23.2184Z",fill:"#2980FE"}),jsxRuntimeExports.jsx("path",{d:"M22.1125 14H21.873H9.10044C8.49198 14 8 14.492 8 15.1006V19.5673C8 20.176 8.49198 20.668 9.10044 20.668H12.0978H13.289V21.9886V36.127C13.289 36.7355 13.7809 37.2274 14.3896 37.2274H19.0765C19.6849 37.2274 20.1769 36.7355 20.1769 36.127V21.9886V21.8655V20.668H21.3681H21.8537H22.0932C23.9317 20.668 25.427 19.1725 25.427 17.334C25.4465 15.4955 23.951 14 22.1125 14Z",fill:"#2980FE"}),jsxRuntimeExports.jsx("path",{d:"M32.6967 23.2184V32.2039C32.9427 32.2621 33.1952 32.3074 33.4542 32.3463C33.8166 32.3981 34.1921 32.4305 34.5676 32.437C34.587 32.437 34.6065 32.437 34.6324 32.437V25.29C33.5512 25.2189 32.6967 24.319 32.6967 23.2184Z",fill:"url(#paint0_linear_1_2)"}),jsxRuntimeExports.jsx("path",{d:"M34.7752 14C29.6869 14 25.5567 18.1303 25.5567 23.2186C25.5567 27.5948 28.6058 31.2588 32.6972 32.2039V23.2186C32.6972 22.0727 33.6293 21.1404 34.7752 21.1404C35.9211 21.1404 36.8532 22.0727 36.8532 23.2186C36.8532 24.183 36.1993 24.9923 35.306 25.2254C35.1377 25.2707 34.9564 25.2966 34.7752 25.2966V32.437C34.9564 32.437 35.1312 32.4305 35.306 32.4241C40.1483 32.1457 43.9936 28.132 43.9936 23.2186C44.0002 18.1303 39.8699 14 34.7752 14Z",fill:"#2980FE"}),jsxRuntimeExports.jsx("path",{d:"M34.775 32.4369V25.2964C34.7232 25.2964 34.6779 25.2964 34.626 25.2899V32.4369C34.6779 32.4369 34.7297 32.4369 34.775 32.4369Z",fill:"#2980FE"})]}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1_2",x1:"34.7777",y1:"27.8291",x2:"32.6977",y2:"27.8291",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#2980FE"}),jsxRuntimeExports.jsx("stop",{offset:"0.9667",stopColor:"#6CA8FF"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#2980FE"})]})})]});class TokenPocketConnector extends InjectedConnector{constructor({chains:s,options:a}={}){const rt={name:"Token Pocket",shimDisconnect:!0,getProvider:getTokenPocketProvider,...a};super({chains:s,options:rt}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:TOKEN_POCKET_ID}),Object.defineProperty(this,"shimDisconnectKey",{enumerable:!0,configurable:!0,writable:!0,value:`${this.id}.shimDisconnect`})}}function getTokenPocketProvider(){var o;if(!(typeof window>"u"))return(o=window==null?void 0:window.ethereum)!=null&&o.isTokenPocket?window.ethereum:window==null?void 0:window.tokenpocket}const TOKEN_POCKET_ID="tokenPocket";function tokenPocket(o={}){const{connectorOptions:s,...a}=o;return{id:TOKEN_POCKET_ID,name:"TokenPocket",logos:{default:jsxRuntimeExports.jsx(TokenPocketIcon,{})},downloadUrls:{default:"https://www.tokenpocket.pro/en/download/app"},installed:isTokenPocket(),createConnector:rt=>new TokenPocketConnector({chains:rt,options:{shimDisconnect:!0,...s}}),getUri:()=>{const rt={url:window.location.href};return`tpdapp://open?params=${encodeURIComponent(JSON.stringify(rt))}`},...a}}function isTokenPocket(){var o;return typeof window>"u"?!1:((o=window==null?void 0:window.ethereum)==null?void 0:o.isTokenPocket)??!!window.tokenpocket}const META_MASK_ID="metaMask";function metaMask(o={}){const{connectorOptions:s,...a}=o;return{id:META_MASK_ID,name:"MetaMask",logos:{default:jsxRuntimeExports.jsx(MetaMaskIcon,{})},downloadUrls:{default:"https://metamask.io/download/"},installed:isMetaMask(),createConnector:rt=>new MetaMaskConnector({chains:rt,options:{shimDisconnect:!0,UNSTABLE_shimOnConnectSelectAccount:!0,...s}}),getUri:()=>`dapp://${window.location.href.replace(/^https?:\/\//,"")}`,...a}}function isMetaMask(){var o;return typeof window>"u"||isTokenPocket()?!1:(o=window==null?void 0:window.ethereum)==null?void 0:o.isMetaMask}function isMetaMaskConnector(o){return(o==null?void 0:o.id)===META_MASK_ID}const SAFE_ID="safe";function safe(o={}){const{connectorOptions:s,...a}=o;return{id:SAFE_ID,name:"Safe Wallet",logos:{default:jsxRuntimeExports.jsx(InjectedIcon,{})},downloadUrls:{default:void 0},installed:isSafe(),createConnector:rt=>new SafeConnector({chains:rt,options:{allowedDomains:[/gnosis-safe.io$/,/app.safe.global$/],debug:!1,...s}}),getUri:()=>{},...a}}function isSafe(){return!(typeof window>"u")&&(window==null?void 0:window.parent)!==window}const TrustWalletIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_827_48424)",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.1038 9.82664C25.6315 9.38591 26.399 9.38591 26.9267 9.82664C31.5058 13.6509 36.7265 13.6204 38.7219 13.6088C38.8221 13.6082 38.9142 13.6076 38.9976 13.6076C39.3784 13.6076 39.7433 13.7604 40.0106 14.0317C40.2778 14.303 40.4251 14.6702 40.4193 15.051C40.3251 21.2927 40.075 25.7357 39.5864 28.9851C39.0981 32.2328 38.3534 34.4269 37.1725 36.068C35.9843 37.7194 34.4557 38.662 32.7882 39.5835C32.5006 39.7425 32.2067 39.9019 31.9052 40.0654C30.4375 40.8615 28.7927 41.7536 26.844 43.1515C26.3486 43.5068 25.6818 43.5068 25.1865 43.1515C23.2397 41.755 21.597 40.8633 20.1315 40.0677C19.8287 39.9033 19.5334 39.743 19.2445 39.5832C17.5784 38.6615 16.0519 37.7187 14.866 36.0668C13.6877 34.4255 12.9456 32.2316 12.4591 28.9844C11.9723 25.7353 11.7232 21.2925 11.6291 15.051C11.6233 14.6702 11.7706 14.303 12.0378 14.0317C12.3051 13.7604 12.67 13.6076 13.0508 13.6076C13.1333 13.6076 13.2244 13.6082 13.3237 13.6088C15.303 13.6204 20.5243 13.6512 25.1038 9.82664ZM14.4977 16.4475C14.6068 21.8967 14.8504 25.7528 15.2714 28.563C15.7289 31.6165 16.3779 33.2965 17.1761 34.4084C17.9667 35.5096 19.0019 36.1991 20.6211 37.0949C20.8861 37.2415 21.165 37.3927 21.4573 37.5512C22.7316 38.2423 24.2616 39.0721 26.0153 40.2624C27.7713 39.0706 29.3036 38.2403 30.5799 37.5487C30.8709 37.391 31.1487 37.2405 31.4127 37.0946C33.0339 36.1986 34.0715 35.5088 34.8642 34.4071C35.6643 33.2952 36.3152 31.6153 36.7743 28.5623C37.1968 25.7524 37.4414 21.8966 37.5507 16.4477C35.0368 16.3893 30.3736 15.9228 26.0152 12.7234C21.6618 15.9193 17.0048 16.3882 14.4977 16.4475Z",fill:"#3375BB"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_827_48424",children:jsxRuntimeExports.jsx("rect",{width:"52",height:"52",fill:"white"})})})]});class TrustWalletConnector extends MetaMaskConnector{constructor({chains:s,options:a}={}){const rt={name:"Trust Wallet",shimDisconnect:!0,getProvider:getTrustWalletProvider,...a};super({chains:s,options:rt}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:TRUST_WALLET_ID}),Object.defineProperty(this,"shimDisconnectKey",{enumerable:!0,configurable:!0,writable:!0,value:`${this.id}.shimDisconnect`})}}function getTrustWalletProvider(){var a;const o=rt=>!!rt.isTrust;if(typeof window<"u"&&typeof window.ethereum<"u")return o(window.ethereum)?window.ethereum:(a=window.ethereum)!=null&&a.providers?window.ethereum.providers.find(o):(window.trustwallet&&window.trustwallet.removeListener===void 0&&(window.trustwallet.removeListener=window.trustwallet.off),window.trustwallet)}const TRUST_WALLET_ID="trust";function trustWallet(o={}){const{connectorOptions:s,...a}=o;return{id:TRUST_WALLET_ID,name:"Trust Wallet",logos:{default:jsxRuntimeExports.jsx(TrustWalletIcon,{})},downloadUrls:{default:"https://trustwallet.com/"},installed:isTrustWallet(),createConnector:rt=>new TrustWalletConnector({chains:rt,options:{shimDisconnect:!0,...s}}),getUri:()=>`https://link.trustwallet.com/open_url?coin_id=60&url=${encodeURIComponent(window.location.href)}`,...a}}function isTrustWallet(){var s,a;if(typeof window>"u")return!1;const{ethereum:o}=window;return!!(o!=null&&o.isTrust||o!=null&&o.providers&&(o!=null&&o.providers.find(rt=>rt.isTrust))||(s=window==null?void 0:window.trustwallet)!=null&&s.isTrust||(a=window==null?void 0:window.trustWallet)!=null&&a.isTrust)}const WalletConnectIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_2676_92414)",children:jsxRuntimeExports.jsx("path",{d:"M15.3699 19.2984C21.2408 13.5672 30.7592 13.5672 36.6301 19.2984L37.3367 19.9882C37.6301 20.2748 37.6301 20.7393 37.3367 21.0259L34.9196 23.3854C34.7729 23.5287 34.5349 23.5287 34.3881 23.3854L33.4158 22.4363C29.3202 18.438 22.6798 18.438 18.5842 22.4363L17.543 23.4527C17.3962 23.596 17.1582 23.596 17.0114 23.4527L14.5944 21.0932C14.3009 20.8066 14.3009 20.3421 14.5944 20.0555L15.3699 19.2984ZM41.6287 24.1782L43.7798 26.2782C44.0734 26.5647 44.0734 27.0293 43.7798 27.3159L34.0802 36.7851C33.7867 37.0716 33.3107 37.0716 33.0171 36.7851L26.1329 30.0646C26.0595 29.9929 25.9406 29.9929 25.8672 30.0646L18.9831 36.7851C18.6896 37.0716 18.2136 37.0716 17.9201 36.7851L8.22016 27.3158C7.92661 27.0292 7.92661 26.5647 8.22016 26.2781L10.3713 24.1781C10.6648 23.8915 11.1408 23.8915 11.4343 24.1781L18.3187 30.8987C18.3921 30.9704 18.511 30.9704 18.5843 30.8987L25.4684 24.1781C25.7619 23.8915 26.2378 23.8915 26.5313 24.178L33.4157 30.8987C33.4891 30.9704 33.6081 30.9704 33.6814 30.8987L40.5657 24.1782C40.8592 23.8916 41.3351 23.8916 41.6287 24.1782Z",fill:"#3396FF"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_2676_92414",children:jsxRuntimeExports.jsx("rect",{width:"52",height:"52",fill:"white"})})})]});class WalletConnectConnector extends WalletConnectConnector$1{async getWalletClient({chainId:s}={}){const[a,rt]=await Promise.all([this.getProvider(),this.getAccount()]),ot=this.chains.find(tr=>tr.id===s);if(!a)throw new Error("provider is required.");return createWalletClient$1({account:rt,chain:ot,transport:custom$2(a)})}}const WALLET_CONNECT_ID="walletConnect";function walletConnect(o={}){const{connectorOptions:s,...a}=o;return{id:WALLET_CONNECT_ID,name:"WalletConnect",logos:{default:jsxRuntimeExports.jsx(WalletConnectIcon,{})},downloadUrls:{default:void 0},installed:void 0,createConnector:rt=>{const{walletConnectDefaultOptions:ot}=getGlobalData(),{walletConnectProjectId:tr,appName:Ut,appIcon:rr,appDescription:nr,appUrl:ir}=ot,sr=Ut&&rr&&nr&&ir;if(!tr)throw new Error("walletConnectProjectId is required.");return new WalletConnectConnector({chains:rt,options:{showQrModal:!0,projectId:tr,metadata:sr?{name:Ut,description:nr,url:ir,icons:[rr]}:void 0,...s}})},getUri:()=>{},...a}}function isWalletConnectConnector(o){return(o==null?void 0:o.id)===WALLET_CONNECT_ID}function getWalletById(o,s){switch(o){case INJECTED_ID:return injected(s);case META_MASK_ID:return metaMask(s);case SAFE_ID:return safe(s);case TOKEN_POCKET_ID:return tokenPocket(s);case TRUST_WALLET_ID:return trustWallet(s);case WALLET_CONNECT_ID:return walletConnect(s);default:return injected(s)}}const styles_css_ts_vanilla7c1f6529="",styles_css_ts_vanilla9e637951="",styles_css_ts_vanillaBee8ba1c="",styles_css_ts_vanilla24a22718="",styles_css_ts_vanillaC3d3b2e9="",styles_css_ts_vanilla73e53635="",styles_css_ts_vanilla6762e868="",styles_css_ts_vanillaC5e61b8d="",styles_css_ts_vanilla2c7e3db7="",styles_css_ts_vanilla6e095aad="",styles_css_ts_vanilla38d600b1="",styles_css_ts_vanilla40872cfc="",styles_css_ts_vanillaEc15015e="",styles_css_ts_vanilla0ec70b60="",styles_css_ts_vanilla3529c661="",fade_css_ts_vanillaCbe05087="",toastSlide_css_ts_vanilla1b4f2860="",styles_css_ts_vanilla43b3539a="",styles_css_ts_vanillaEb8fdd2f="",styles_css_ts_vanilla8ca5490c="",styles_css_ts_vanilla829d62e4="",WALLET_CONNECT_PROJECT_ID="e68a1816d39726c2afabf05661a32767",getDefaultWallets=()=>{const o=!(typeof window>"u")&&(window==null?void 0:window.parent)!==window;let s=[];return o&&(s=[...s,safe()]),s=[...s,trustWallet(),metaMask(),walletConnect()],s},defaultChains=[mainnet],getDefaultConfig=o=>{const{appName:s="WalletKit",appIcon:a,appDescription:rt,appUrl:ot,walletConnectProjectId:tr=WALLET_CONNECT_PROJECT_ID,alchemyId:Ut,infuraId:rr,chains:nr=defaultChains,connectors:ir,autoConnect:sr=!0,publicClient:ar,webSocketPublicClient:ur,enableWebSocketPublicClient:cr,stallTimeout:lr}=o;setGlobalData({walletConnectDefaultOptions:{walletConnectProjectId:tr,appName:s,appIcon:a,appDescription:rt,appUrl:ot}});const hr=[];Ut&&hr.push(alchemyProvider({apiKey:Ut})),rr&&hr.push(infuraProvider({apiKey:rr})),hr.push(jsonRpcProvider({rpc:$r=>({http:$r.rpcUrls.default.http[0]})})),hr.push(publicProvider());const{publicClient:gr,chains:vr,webSocketPublicClient:fr}=configureChains(nr,hr,{stallTimeout:lr}),br=ir??getDefaultWallets(),wr=createConnectors(br,vr);return{autoConnect:sr,connectors:wr,publicClient:ar??gr,webSocketPublicClient:cr?ur??fr:void 0}};function createConnectors(o=[],s){return o.map(rt=>{if(rt.createConnector){const ot=rt.createConnector(s);return ot._wallet=rt,withHackHandler(ot)}else return rt._wallet=getWalletById(rt.id),withHackHandler(rt)})}function withHackHandler(o){var a,rt;const s=(rt=(a=o==null?void 0:o.options)==null?void 0:a.getProvider)==null?void 0:rt.call(a);if(s&&!s.__hasWrappedRequest&&isMetaMaskConnector(o)){s.__hasWrappedRequest=!0;const ot=s.request,tr=(Ut=0,rr=[],...nr)=>new Promise((ir,sr)=>{const ar=setTimeout(()=>{ot.call(s,...nr).then(ur=>{s.request=ot,rr.forEach(cr=>{clearTimeout(cr)}),ir(ur)}).catch(sr)},Ut);rr.push(ar)});s.request=async function(...Ut){const rr=[0,500,1e3,1500,2e3,3e3],nr=[];return Promise.race(rr.map(ir=>tr(ir,nr,...Ut)))}}return o}const WalletKitContext=reactExports.createContext({});function useWalletKitContext(){return reactExports.useContext(WalletKitContext)}const RouteContext=React$1.createContext({});function useRouter(){return reactExports.useContext(RouteContext)}function cx(...o){if(o.length)return o.filter(Boolean).join(" ")}function cssVar(o,s="colors"){return`var(--wk-${s}-${o.replace(/\./g,"-")})`}function rgba(o,s,a,rt=1){var ot;if(typeof o=="string"&&o.startsWith("#")){const tr=o.slice(1),rr=(ot=(tr.length===3?tr.replace(/[A-F\d]/gi,"$&$&"):tr).match(/.{2}/g))==null?void 0:ot.map(nr=>parseInt(nr,16));if((rr==null?void 0:rr.length)===3)return rgba(rr[0],rr[1],rr[2],s)}return`rgba(${o}, ${s}, ${a}, ${rt})`}var box="styles_box__1cpvnp10";const Box=React$1.forwardRef((o,s)=>{const{as:a="div",className:rt,...ot}=o;return React$1.createElement(a,{ref:s,className:cx(box,rt),...ot})});Box.displayName="Box";var button="styles_button__1bwgl0a0";const Button=React$1.forwardRef((o,s)=>{const{className:a,...rt}=o;return jsxRuntimeExports.jsx(Box,{ref:s,as:"button",className:cx(button,a),...rt})});Button.displayName="Button";var iconButton="styles_iconButton__vjmzmh0";const IconButton=o=>{const{className:s,icon:a,...rt}=o;return jsxRuntimeExports.jsx(Button,{className:cx(iconButton,s),...rt,children:a})};IconButton.displayName="IconButton";const BackIcon=o=>jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 40 40",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.5118 8.82165C25.1627 9.47253 25.1627 10.5278 24.5118 11.1787L15.6904 20.0002L24.5118 28.8217C25.1627 29.4725 25.1627 30.5278 24.5118 31.1787C23.861 31.8295 22.8057 31.8295 22.1548 31.1787L12.1548 21.1787C11.5039 20.5278 11.5039 19.4725 12.1548 18.8217L22.1548 8.82165C22.8057 8.17078 23.861 8.17078 24.5118 8.82165Z"})}),CloseIcon=o=>jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 40 40",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0119 9.51184C11.361 8.86097 10.3057 8.86097 9.65484 9.51184C9.00397 10.1627 9.00397 11.218 9.65484 11.8689L17.643 19.857L9.51187 27.9882C8.86099 28.639 8.86099 29.6943 9.51187 30.3452C10.1627 30.9961 11.218 30.9961 11.8689 30.3452L20 22.214L27.9218 30.1358C28.5726 30.7867 29.6279 30.7867 30.2788 30.1358C30.9297 29.4849 30.9297 28.4296 30.2788 27.7788L22.357 19.857L30.1358 12.0783C30.7867 11.4274 30.7867 10.3721 30.1358 9.72123C29.4849 9.07036 28.4297 9.07036 27.7788 9.72123L20 17.5L12.0119 9.51184Z"})});var navbar="styles_navbar__19bcqvr0";function Navbar(o){const{className:s,showBack:a=!1,onBack:rt,onClose:ot,...tr}=o,{onClose:Ut}=useWalletKitContext(),rr=useRouter(),nr=()=>{rt==null||rt(),rr.back()},ir=()=>{ot==null||ot(),Ut()};return jsxRuntimeExports.jsxs(Box,{className:cx("wk-navbar",navbar,s),...tr,children:[a&&jsxRuntimeExports.jsx(IconButton,{className:"wk-back-button",icon:jsxRuntimeExports.jsx(BackIcon,{}),onClick:nr}),jsxRuntimeExports.jsx(Box,{style:{flex:1}}),jsxRuntimeExports.jsx(IconButton,{className:"wk-close-button",icon:jsxRuntimeExports.jsx(CloseIcon,{}),onClick:ir})]})}var link="styles_link__1luj8ua0";const Link=o=>{const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{as:"a",className:cx(link,s),target:"_blank",rel:"noopener",...a})};Link.displayName="Link";var modal="styles_modal__28jf4v4",modalContent="styles_modalContent__28jf4v6",modalHeader="styles_modalHeader__28jf4v7",modalOverlay="styles_modalOverlay__28jf4v5";function ModalHeader(o){const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-header",modalHeader,s),...a})}const WalletIcon=o=>jsxRuntimeExports.jsx("svg",{width:24,height:24,viewBox:"0 0 40 40",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.16669 12.5C4.16669 9.73858 6.40526 7.5 9.16669 7.5H30.8334C33.5948 7.5 35.8334 9.73858 35.8334 12.5V27.5C35.8334 30.2614 33.5948 32.5 30.8334 32.5H9.16669C6.40526 32.5 4.16669 30.2614 4.16669 27.5V12.5ZM9.16669 10.8333C8.24621 10.8333 7.50002 11.5795 7.50002 12.5V27.5C7.50002 28.4205 8.24621 29.1667 9.16669 29.1667H30.8334C31.7538 29.1667 32.5 28.4205 32.5 27.5V26.4583H24.1667C20.5998 26.4583 17.7084 23.5668 17.7084 20C17.7084 16.4332 20.5998 13.5417 24.1667 13.5417H32.5V12.5C32.5 11.5795 31.7538 10.8333 30.8334 10.8333H9.16669ZM32.5 16.4583H24.1667C22.2107 16.4583 20.625 18.044 20.625 20C20.625 21.956 22.2107 23.5417 24.1667 23.5417H32.5V16.4583ZM26.6667 20C26.6667 21.1506 25.7339 22.0833 24.5834 22.0833C23.4328 22.0833 22.5 21.1506 22.5 20C22.5 18.8494 23.4328 17.9167 24.5834 17.9167C25.7339 17.9167 26.6667 18.8494 26.6667 20Z"})});function useConnectors(){const{connectors:o}=useConnect();return o}function useWalletConfig(o){return o._wallet}const Text=o=>{const{...s}=o;return jsxRuntimeExports.jsx(Box,{as:"p",...s})};Text.displayName="Text";function isAndroid(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function isSmallIOS(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function isLargeIOS(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function isIOS(){return isSmallIOS()||isLargeIOS()}function isMobile(){return isAndroid()||isIOS()}function mergeList(o=[],s=[]){const a=[...o];return s.forEach(rt=>{const ot=o.findIndex(tr=>tr.id===rt.id);ot>-1?a[ot]={...a[ot],...rt}:a.push({...rt})}),a}function commonErrorHandler(o){var tr;const{log:s,handler:a,error:rt}=o;let ot="";if(rt){if(rt.code)switch(rt.code){case 4902:isIOS()&&isTrustWallet()&&(ot="Not supported chainId");break}const Ut=ot||((tr=rt.cause)==null?void 0:tr.message)||rt.message;s("[wallet error]",rt),a==null||a(rt,Ut)}}function isObject(o){return o&&typeof o=="object"&&!Array.isArray(o)&&o!==null}function deepMerge(o,s){if(isObject(o)&&isObject(s))for(const a in s)isObject(s[a])?(o[a]||Object.assign(o,{[a]:{}}),deepMerge(o[a],s[a])):Object.assign(o,{[a]:s[a]});return o}function useWalletKitConnect({...o}={}){const{log:s,options:a}=useWalletKitContext(),rt={chainId:a==null?void 0:a.initialChainId},{connect:ot,connectAsync:tr,connectors:Ut,...rr}=useConnect({...o,onError(nr){var ir;commonErrorHandler({log:s,handler:a.onError,error:nr}),(ir=o==null?void 0:o.onError)==null||ir.call(o,nr)}});return{connect:({...nr})=>ot({...rt,...nr}),connectAsync:async({...nr})=>await tr({...rt,...nr}),connectors:Ut,...rr}}function useWalletConnectModal(){const{connectAsync:o,connectors:s}=useWalletKitConnect(),[a,rt]=reactExports.useState(!1),{log:ot}=useWalletKitContext();return{isOpenWcModal:a,onOpenWcModal:async()=>{const tr=document.createElement("style");tr.innerHTML="#walletconnect-wrapper{z-index:2147483647;}",document.head.appendChild(tr),document.body.style.setProperty("--wcm-z-index","2147483647");const Ut=s.find(rr=>isWalletConnectConnector(rr));rt(!0);try{await o({connector:Ut})}catch(rr){ot("WalletConnect",rr)}rt(!1),document.head.removeChild(tr)}}}function useClickWallet(){const o=useRouter(),{options:s,setSelectedConnector:a,onClose:rt}=useWalletKitContext(),{disconnect:ot}=useDisconnect(),{onOpenWcModal:tr}=useWalletConnectModal(),Ut=reactExports.useRef(),rr=isMobile();return reactExports.useCallback((ir,sr)=>{var ur;((ur=s.onClickWallet)==null?void 0:ur.call(s,ir,sr))!==!1&&(ot(),clearTimeout(Ut.current),Ut.current=setTimeout(()=>{var cr,lr;if(isWalletConnectConnector(ir))tr(),setTimeout(()=>{rt()},1e3);else if(rr&&!ir._wallet.installed){const hr=(lr=(cr=ir._wallet).getUri)==null?void 0:lr.call(cr);hr&&window.open(hr,"_self","noopener noreferrer")}else a(ir),o.push(routes.CONNECTING)},300))},[ot,rr,rt,tr,s,o,a])}var walletOption="styles_walletOption__8fbz320",walletOptionIcon="styles_walletOptionIcon__8fbz322",walletOptionName="styles_walletOptionName__8fbz321";function WalletOption(o){const{connector:s}=o,a=useWalletConfig(s),rt=useClickWallet();return jsxRuntimeExports.jsxs(Button,{className:cx("wk-wallet-option",walletOption),onClick:ot=>rt(s,ot),children:[jsxRuntimeExports.jsx(Text,{className:cx("wk-wallet-option-name",walletOptionName),children:a.name}),jsxRuntimeExports.jsx(Box,{className:cx("wk-wallet-option-logo",walletOptionIcon),children:a.logos.default})]})}var downloadLink="styles_downloadLink__17l0qzv2",footer="styles_footer__17l0qzv1",wallets="styles_wallets__17l0qzv0";function ConnectorsPage(){const o=useConnectors(),{options:s}=useWalletKitContext();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Navbar,{}),jsxRuntimeExports.jsx(ModalHeader,{children:"Connect Wallet"}),jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-body wk-wallets",wallets),children:o==null?void 0:o.map(a=>jsxRuntimeExports.jsx(WalletOption,{connector:a},a.id))}),!s.hideNoWalletCTA&&jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-footer",footer),children:jsxRuntimeExports.jsxs(Link,{className:cx("wk-download-link",downloadLink),href:s.walletDownloadUrl,children:[jsxRuntimeExports.jsx(WalletIcon,{}),"I don’t have a wallet"]})})]})}var content$2="styles_content__xxja170";function Content(o){const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-content",content$2,s),...a})}const AlertIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 15",fill:"none",...o,children:[jsxRuntimeExports.jsx("path",{d:"M1.63937 12.5331L7.6704 2.47023C8.04617 1.84325 8.95383 1.84326 9.3296 2.47023L15.3606 12.5331C15.7475 13.1787 15.283 14 14.531 14H2.46897C1.71695 14 1.25246 13.1787 1.63937 12.5331Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M9.5 11.7231C9.5 12.2754 9.05228 12.7231 8.5 12.7231C7.94772 12.7231 7.5 12.2754 7.5 11.7231C7.5 11.1709 7.94772 10.7231 8.5 10.7231C9.05228 10.7231 9.5 11.1709 9.5 11.7231Z",fill:"currentColor"}),jsxRuntimeExports.jsx("path",{d:"M7.6684 5.65882C7.63842 5.15178 8.01942 4.72314 8.50008 4.72314C8.98075 4.72314 9.36174 5.15178 9.33176 5.65882L9.12831 9.09936C9.10757 9.44999 8.83247 9.72314 8.50008 9.72314C8.16769 9.72314 7.89259 9.44999 7.87186 9.09936L7.6684 5.65882Z",fill:"currentColor"})]});var errorTitle="styles_errorTitle__15jahvi0";function ErrorTitle(o){const{className:s,children:a,...rt}=o;return jsxRuntimeExports.jsxs(Box,{className:cx("wk-error-title",errorTitle,s),...rt,children:[jsxRuntimeExports.jsx(AlertIcon,{}),a]})}var description$1="styles_description__du4o10";function Description(o){const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-description",description$1,s),...a})}var infoTitle="styles_infoTitle__1k1e1vs0";function InfoTitle(o){const{className:s,children:a,...rt}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-info-title",infoTitle,s),...rt,children:a})}function UnsupportedContent(){var s;const{selectedConnector:o}=useWalletKitContext();return typeof window<"u"&&((s=window.ethereum)!=null&&s.isTokenPocket)&&isMetaMaskConnector(o)?jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(ErrorTitle,{children:"Switch Wallet"}),jsxRuntimeExports.jsxs(Description,{children:["Please install the ",o==null?void 0:o._wallet.name," extension first, then switch the wallet manually in the corresponding extension, and refresh the page to log in."]})]}):jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(ErrorTitle,{children:"Unsupported Browser"}),jsxRuntimeExports.jsxs(Description,{children:["To continue, please install ",o==null?void 0:o._wallet.name," extension to your browser."]})]})}function CircleLoadingIcon(o){const{thickness:s,...a}=o,rt=cssVar("modalBackground"),ot=cssVar("primaryActive");return jsxRuntimeExports.jsxs("svg",{width:"52",height:"102",viewBox:"0 0 52 102",fill:"none",...a,children:[jsxRuntimeExports.jsx("path",{d:"M1 101C28.6142 101 51 78.6142 51 51C51 23.3858 28.6142 1 1 1",stroke:"url(#paint0_linear_1252_60553)",strokeWidth:s,strokeLinecap:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1252_60553",x1:"1",y1:"1",x2:"0.999999",y2:"101",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:rt}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:ot})]})})]})}var circleSpinner="styles_circleSpinner__zrc6g80",circleSpinnerInner="styles_circleSpinnerInner__zrc6g81",errorCircle="styles_errorCircle__zrc6g82",loading="styles_loading__zrc6g84";function CircleSpinner(o){const{className:s,isLoading:a=!1,isError:rt=!1,thickness:ot=2,children:tr,...Ut}=o;return jsxRuntimeExports.jsxs(Box,{className:cx("wk-circle-spinner",circleSpinner,s),...Ut,children:[jsxRuntimeExports.jsx(Box,{className:circleSpinnerInner,children:tr}),a&&jsxRuntimeExports.jsx(CircleLoadingIcon,{className:loading,thickness:ot}),rt&&jsxRuntimeExports.jsx(Box,{className:errorCircle})]})}const RefreshIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"24",height:"24",viewBox:"4 0 16 16",fill:"none",...o,children:[jsxRuntimeExports.jsx("g",{filter:"url(#filter0_d_1252_60835)",children:jsxRuntimeExports.jsx("circle",{cx:"12",cy:"8",r:"8",fill:"white"})}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.0606 7.15313L17.4251 4.09755L16.2902 3.96221L16.1688 4.98047C14.9544 3.30339 12.7897 2.46123 10.6705 3.02905C9.26479 3.40571 8.1519 4.32971 7.49968 5.51031C7.38574 5.7162 7.28498 5.93187 7.19881 6.15651C7.12849 6.33959 7.06849 6.52699 7.01932 6.71783C6.31348 9.44732 7.93882 12.2409 10.6676 12.9721C13.4111 13.7072 16.2311 12.0791 16.9662 9.33555L15.8623 9.03976C15.4796 10.4681 14.3704 11.5077 13.0388 11.8676L13.0368 11.8604C10.903 12.4321 8.70963 11.1658 8.13787 9.03195C7.5661 6.89808 8.83243 4.70474 10.9663 4.13297C11.6699 3.94444 12.38 3.95575 13.0362 4.13211M13.0362 4.13211C14.0054 4.39257 14.8573 5.01302 15.3977 5.88139L14.2429 5.93123L14.2921 7.07302L15.9276 7.00244L15.9258 7.01779L17.0606 7.15313",fill:"url(#paint0_linear_1252_60835)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("filter",{id:"filter0_d_1252_60835",x:"0",y:"0",width:"24",height:"24",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsxRuntimeExports.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"4"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"2"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1252_60835"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1252_60835",result:"shape"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1252_60835",x1:"13.1862",y1:"3.58419",x2:"10.8183",y2:"12.4204",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#1D1010"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#26282E",stopOpacity:"0.24"})]})]})]});var center="styles_center__1ttds3e1",content$1="styles_content__1ttds3e0",logoWrapper="styles_logoWrapper__1ttds3e2",refreshIconWrapper="styles_refreshIconWrapper__1ttds3e3";const states={CONNECTED:"connected",CONNECTING:"connecting",FAILED:"failed",REJECTED:"rejected",NOTCONNECTED:"notconnected",UNAVAILABLE:"unavailable"};function ConnectingPage(){const{selectedConnector:o,options:s,connectVariant:a,log:rt}=useWalletKitContext(),ot=useWalletConfig(o),[tr,Ut]=reactExports.useState(ot.installed?states.CONNECTING:states.UNAVAILABLE),{connect:rr}=useWalletKitConnect({onMutate:ir=>{ir.connector?Ut(states.CONNECTING):Ut(states.UNAVAILABLE)},onSettled(ir,sr){var ar;if(sr){if(sr.code)switch(sr.code){case-32002:Ut(states.NOTCONNECTED);break;case 4001:Ut(states.REJECTED);break;default:Ut(states.FAILED);break}else if(sr.message)switch(sr.message){case"User rejected request":Ut(states.REJECTED);break;default:Ut(states.FAILED);break}}else ir&&s.initialChainId&&ir.chain.id===s.initialChainId&&a==="add-network"&&((ar=s.onChainAlreadyAdded)==null||ar.call(s,o,s.initialChainId))}}),nr=reactExports.useCallback(()=>{ot.installed&&(o?rr({connector:o}):Ut(states.UNAVAILABLE))},[rr,o,ot.installed]);return reactExports.useEffect(()=>{if(tr===states.UNAVAILABLE)return;const ir=setTimeout(nr,600);return()=>{clearTimeout(ir)}},[]),rt("[Connect]",tr,o),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Navbar,{showBack:!0}),jsxRuntimeExports.jsx(ModalHeader,{children:ot==null?void 0:ot.name}),jsxRuntimeExports.jsxs(Box,{className:cx("wk-modal-body",content$1),children:[jsxRuntimeExports.jsx(Box,{className:center,children:jsxRuntimeExports.jsxs(CircleSpinner,{isLoading:tr===states.CONNECTING,isError:tr!==states.CONNECTING&&tr!==states.CONNECTED,children:[jsxRuntimeExports.jsx(Box,{className:logoWrapper,onClick:nr,children:ot.logos.default}),(tr===states.FAILED||tr===states.REJECTED)&&jsxRuntimeExports.jsx(Box,{className:refreshIconWrapper,onClick:nr,children:jsxRuntimeExports.jsx(RefreshIcon,{style:{position:"absolute",bottom:6,right:10,width:16,height:16}})})]})}),tr===states.FAILED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(ErrorTitle,{children:"Connection Failed"}),jsxRuntimeExports.jsx(Description,{children:"Sorry, something went wrong. Please try connecting again."})]}),tr===states.REJECTED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(InfoTitle,{children:"Request Cancelled"}),jsxRuntimeExports.jsx(Description,{children:"You cancelled the request. Click above to try again."})]}),tr===states.CONNECTING&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(InfoTitle,{children:"Requesting Connection"}),jsxRuntimeExports.jsxs(Description,{children:["Open the ",ot.name," browser extension to connect your wallet."]})]}),tr===states.CONNECTED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(InfoTitle,{children:"Already Connected"}),jsxRuntimeExports.jsx(Description,{children:"It is now okay to close this popup"})]}),tr===states.NOTCONNECTED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsxs(ErrorTitle,{children:["Login to ",ot.name]}),jsxRuntimeExports.jsxs(Description,{children:["To continue, please login to your ",ot.name," extension."]})]}),tr===states.UNAVAILABLE&&jsxRuntimeExports.jsx(UnsupportedContent,{})]})]})}const routes={CONNECTING:"Connecting",CONNECTORS:"Connectors"};function RouteProvider(o){const{children:s}=o,{onClose:a}=useWalletKitContext(),[rt,ot]=reactExports.useState(""),{current:tr}=reactExports.useRef([]),Ut=reactExports.useMemo(()=>{switch(rt){case routes.CONNECTING:return jsxRuntimeExports.jsx(ConnectingPage,{});case routes.CONNECTORS:return jsxRuntimeExports.jsx(ConnectorsPage,{})}return null},[rt]),rr=reactExports.useCallback(()=>{tr.pop();const ur=tr[tr.length-1];ur&&ot(ur)},[tr]),nr=reactExports.useCallback(ur=>{tr[tr.length-1]!==ur&&(tr.push(ur),ot(ur))},[tr]),ir=reactExports.useCallback(ur=>{tr[tr.length-1]!==ur&&(tr[tr.length-1]=ur,ot(ur))},[tr]),sr=reactExports.useMemo(()=>({route:rt,page:Ut,back:rr,push:nr,replace:ir}),[rr,Ut,nr,ir,rt]),{isConnected:ar}=useAccount();return reactExports.useEffect(()=>{ar&&a()},[ar,a]),jsxRuntimeExports.jsx(RouteContext.Provider,{value:sr,children:s})}function useOpenModal(){const{onOpen:o}=useWalletKitContext(),s=useRouter();return{onOpenModal:reactExports.useCallback(()=>{s.push(routes.CONNECTORS),o()},[o,s])}}var walletkitButton="styles_walletkitButton__1ahflwr0";const ConnectButton=React$1.forwardRef((o,s)=>{const{className:a,children:rt,variant:ot="default",onClick:tr,...Ut}=o,{setConnectVariant:rr}=useWalletKitContext(),{onOpenModal:nr}=useOpenModal(),ir=reactExports.useCallback(sr=>{rr(ot),nr(),tr==null||tr(sr)},[ot,tr,nr,rr]);return jsxRuntimeExports.jsx(Button,{ref:s,className:cx("wk-walletkit-button",walletkitButton,a),onClick:ir,...Ut,children:rt??"Connect Wallet"})});function useIsMounted(){const[o,s]=reactExports.useState(!1);return reactExports.useEffect(()=>{s(!0)},[]),o}function ConnectButtonRenderer(o){const{variant:s="default",children:a}=o,rt=useIsMounted(),{isOpen:ot,onClose:tr,setConnectVariant:Ut}=useWalletKitContext(),{onOpenModal:rr}=useOpenModal(),{chain:nr}=useNetwork(),{address:ir}=useAccount(),sr=reactExports.useCallback(()=>{Ut(s),rr()},[rr,Ut,s]);return!a||!rt?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a({show:sr,hide:tr,chain:nr,unsupported:!!(nr!=null&&nr.unsupported),isConnected:!!ir,isConnecting:ot,address:ir})})}ConnectButton.Custom=ConnectButtonRenderer;const WalletKitButton=ConnectButton;function useDisclosure(){const[o,s]=reactExports.useState(!1),a=reactExports.useCallback(()=>{s(!0)},[]),rt=reactExports.useCallback(()=>{s(!1)},[]);return{isOpen:o,onOpen:a,onClose:rt}}function useChains(){var s;const o=useConnectors();return(s=o==null?void 0:o[0])==null?void 0:s.chains}const ToastManager={listeners:[],toastList:[],autoIncreaseId:0,add(o){const s=this.autoIncreaseId++;return this.toastList.unshift({toastId:s,...o}),this.notify(),s},remove(o){const s=this.toastList.findIndex(a=>a.toastId===o);s>-1&&(this.toastList.splice(s,1),this.notify())},notify(){this.listeners.forEach(o=>{o([...this.toastList])})},subscribe(o){this.listeners.push(o)},unsubscribe(o){const s=this.listeners.findIndex(a=>a===o);s>-1&&this.listeners.splice(s,1)}},toast=o=>{const{variant:s="info",duration:a=3e3,...rt}=o;return ToastManager.add({variant:s,duration:a,...rt})};toast.info=o=>toast({variant:"info",...o});toast.error=o=>toast({variant:"error",...o});function getDefaultProviderOptions(o,s){var ot;const{...a}=o;return{initialChainId:(ot=s==null?void 0:s[0])==null?void 0:ot.id,hideNoWalletCTA:!1,walletDownloadUrl:"https://trustwallet.com/",onError,...a}}function onError(o,s){s&&toast.error({description:s})}const UnknownChainIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",...o,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"black"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"black",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"black"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"black",stopOpacity:"0.7"})]})]})]});function BscIcon(o){return jsxRuntimeExports.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",...o,children:[jsxRuntimeExports.jsx("rect",{x:"0.5",y:"0.5",width:"27",height:"27",fill:"url(#BscIconPattern0)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsx("pattern",{id:"BscIconPattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:jsxRuntimeExports.jsx("use",{xlinkHref:"#image0_2258_278",transform:"translate(0.0514019) scale(0.00934579)"})}),jsxRuntimeExports.jsx("image",{id:"image0_2258_278",width:"96",height:"107",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABrCAYAAACIX4f7AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAk7SURBVHgB7Z1RWhpJEMerB/RzIfsFboAn2HgDfUjU7MPqCaInEE8gniB4gpgTJPuwMZoH3RPoniD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1uy7DcC0Lhb1W9NswrJY372rACOsW5IXMzM2obO3gFqcTH5CKzMwNqqcSDm1kaxNMDGAcPGUqHxwxKlvbtD2QZhdF4htAwguSzNwLN3wv3MLqD/RjJNnasAwndnX0gEjvPzLtFTfYP2tKFT3Fy2kAHfAJvc9vW7YnwGZOPbkOFpgaIKIi8svXtxfLxvVC/e/1a/IRm/TksPCK0PCH5ISTus7vE8ZtGObAcgpyfZ3fFyhtGKbBeVH74To/scWAE2Rg30QwcrAMbRiGRBe1HZxOHhLzfy3F6pszim6Qx1m4FRVebZpfscJtdZiQZ8wL69PW4KK2GP1lvr2HhdIuUm2L/6gzedVVZbMVT1Rbi0e/3OlbjxKosCb0jkvj/Tdi2k84ew8LoZPt3KZ91O7n3C+Yi7EYxLzPcGEIGYgN+77/j19JwtEnmqV/6nBA8RfDXAMgXO9hiaAYYHJMaqv4yCGWcRnAdDHEMkAEl6PmMAA3ZANYXmcyCsRG9X5Y9I+IaDzkC8wXlVUkjIZwJTNjE1TuQE5fEcWmsZxE+QI1D5QtkCRFDPX+EA6ByxCdTmlQ2HtN1ZfGAylZAQ6o+YIJWLQgnQ/GiJozH6zyD7ZC32iBLWs8gx2vLPMFUz8SmHDVccu0l6iTAtsZHa+osOeEXXXcmtdLlLFH6CgkBxsHZ4VZjjpuPbqB4+QGy2jHK8fvIbDNiMVm2HELX/IZSIwfKkAnuoHzxjYVOA2tDBPe4GqKcwNEoOPS+WAVyAEX3O+/SaiD+yiJGQAZPNweeIhpa34uFsW5KbMwQMosDJAy/hlgZaXFXmGtHCyE4RV4iJEcnSQc7+mChN5zRsFbA0RYZeSI6ckk8d4AiMl7uijvOUuDTBggYmZGjtDZME0yZYCI0dIZSv3PAiLYJAoyzv89tWhmDg3RawAAAABJRU5ErkJggg=="})]})]})}function ComboIcon(o){return jsxRuntimeExports.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",...o,children:[jsxRuntimeExports.jsx("rect",{width:"26",height:"26",fill:"url(#ComboIconPattern0)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsx("pattern",{id:"ComboIconPattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:jsxRuntimeExports.jsx("use",{xlinkHref:"#image0_1252_60936",transform:"translate(0 0.066875) scale(0.00125)"})}),jsxRuntimeExports.jsx("image",{id:"image0_1252_60936",width:"800",height:"693",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAK1CAYAAAAwrIosAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAGuXSURBVHgB7d3Jc1zXle/7dTIBEGBnybd8x766I0VREZLvP0BZUk1EqEzfkUKlsKg/4KkZlCQPrij/ASW6pi/iSfYzx9IzbauiHFFkDe7I8UzqhchQj5RFCQRBgGgTTZ48+511EgmCIJpsTrOb7yeKBTWkbFPIzL3OWuu3IwGwrz/+LX5J2vJe9KO6RGMCAEBfzO3EtGc3fzr5xMQVAZCpCYB9RWPR22YhkeSLliTftcVsCgAAPUmLD0lm21Ek9f8lALZRgAD7+Khl3jYryY+7f04hAgDo1Vbx0f3T07+/uvEzAZCJBMADPlozP07L88vtL+IfS8s8+BNGI6k9HImOZgEAsNOu4qPz10SmYhn9ydknogUBAkcHBNiDqcl5s2H2Lj5U+teT9AOm/XmcdUYAAFB7FR8qfeL730aSzVcFAB0QYLes+1GXqWzk6rt2b79IOyL/tSbRQ9T0ABCq/YqPHe62ZPQRuiAIHaclYBdTlw+yr6um91+kHZG0WMk6Iv38OgCAF3ooPtTDo9L6FwECRwEC7JB2P15K24KP6x8PVEhoIdKIWVQHgID0WHx0vXTp6tppAQJGAQLsVJO39UtWPLQG72SQmAUAYeiz+FDE8iJ4FCDAFo3dlUh+nP1JM5/FcgoRAPDXAMVHF7G8CBpL6IDcWzzv/nlWMOSdbkV0LwB4Y4jio/PrieVFwOiAANKJ3b3vz4tYJCe6FwC8MGzxoYjlRcjogCB4u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/u7Jut+vPkUt54jaHRAgN2SrYX0KOr86NVqs9PxWFii+ACAUOkN6XG8399t0P0AKECAB0y++NiV9MsH2Z/UeniJdAuP+YX0Q6e3+V8AgMfW1/caxTJikt9w6SBAAQLsKa5Fr6cfHgsHRvGub1B4AAAetHcqVmPyrWfeEQAUIMBezj7/aCMx8us9OyBaeNy+IzI7R+EBANjb/aNYxO4CO1CAAPtI4s0L6SfG1PZf2Fl4bGwKAAAH2h7FMleI3QXuIQULOMCl//Mvp2Vl7T+yVCuKDgBAv8bGTHzk6H9n9wO45/8Hi/dXXGlvAp0AAAAASUVORK5CYII="})]})]})}const chainsConfig=[{id:56,name:"BNB Smart Chain",logo:jsxRuntimeExports.jsx(BscIcon,{})},{id:97,name:"BNB Smart Chain Testnet",logo:jsxRuntimeExports.jsx(BscIcon,{})},{id:91715,name:"Combo Testnet",logo:jsxRuntimeExports.jsx(ComboIcon,{})}];function getSupportedChains(){return chainsConfig}function getDefaultSupportedChains(o,s){const a=mergeList(getSupportedChains(),o.chainsConfig);return s.map(ot=>{const tr=a.find(Ut=>Ut.id===ot.id);return{id:ot.id,name:ot.name??(tr==null?void 0:tr.name),logo:(tr==null?void 0:tr.logo)??jsxRuntimeExports.jsx(UnknownChainIcon,{})}})}const Portal=o=>{const{children:s}=o,a=reactExports.useRef(),[,rt]=reactExports.useState({});return reactExports.useEffect(()=>{const ot=document.body;a.current=document.createElement("div"),a.current.setAttribute("class","wk-portal"),ot.appendChild(a.current),rt({});const tr=a.current;return()=>{ot.contains(tr)&&ot.removeChild(tr)}},[]),a.current?reactDomExports.createPortal(s,a.current):null};Portal.displayName="Portal";var fadeIn="fade_fadeIn__lawij72",fadeOut="fade_fadeOut__lawij73",toastSlideIn="toastSlide_toastSlideIn__hem89h2",toastSlideOut="toastSlide_toastSlideOut__hem89h3";const animationMap={fade:[fadeOut,fadeIn],"toast-slide":[toastSlideOut,toastSlideIn]},Animation=o=>{const{in:s,children:a,variant:rt="fade",onExit:ot}=o,{className:tr,onAnimationEnd:Ut,...rr}=a.props,[nr,ir]=reactExports.useState(s);reactExports.useEffect(()=>{s&&ir(!0)},[s]);const sr=ar=>{Ut==null||Ut(ar),s||(ot==null||ot(),ir(!1))};return nr?React$1.cloneElement(a,{className:cx(animationMap[rt][Number(s)],tr),onAnimationEnd:sr,...rr}):null};function useKeyDown(o={}){const{key:s="Enter",enabled:a=!0,handler:rt}=o;reactExports.useEffect(()=>{if(!a)return;const ot=tr=>{tr.code===s&&(rt==null||rt())};return window.addEventListener("keydown",ot),()=>{window.removeEventListener("keydown",ot)}},[a,rt,s])}function Modal(o){const{className:s,isOpen:a,onClose:rt,children:ot,contentClassName:tr,closeOnEsc:Ut=!0,closeOnOverlayClick:rr=!0,...nr}=o;return useKeyDown({key:"Escape",enabled:a&&Ut,handler(){rt()}}),jsxRuntimeExports.jsx(Portal,{children:jsxRuntimeExports.jsx(Animation,{in:a,variant:"fade",children:jsxRuntimeExports.jsxs(Box,{className:cx("wk-modal",modal,s),...nr,children:[jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-overlay",modalOverlay),onClick:()=>rr&&rt()}),jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-content",modalContent,tr),children:ot})]})})})}function WalletKitModal(){const{isOpen:o,onClose:s}=useWalletKitContext(),{page:a}=useRouter();return useIsMounted()?jsxRuntimeExports.jsx(Modal,{className:"wk-walletkit-modal",isOpen:o,onClose:s,children:a}):null}const radii={common:"8px",modal:"12px",connectButton:"var(--wk-radii-common)",disconnectButton:"var(--wk-radii-common)",walletOption:"var(--wk-radii-common)",walletOptionIcon:"var(--wk-radii-common)",chainOption:"var(--wk-radii-common)",toast:"var(--wk-radii-common)"},base={light:{colors:{text:"#1e2026",textSecondary:"#76808F",primary:"#9B00FB",primaryActive:"#B845FF",warning:"#F5B631",error:"#FC6E75",border:"#E6E8EA",modalBackground:"#FFFFFF",modalOverlay:"rgba(0, 0, 0, 0.5)",optionText:"#1e2026",optionTextHover:"#1e2026",optionBackground:"#f5f5f5",optionBackgroundHover:rgba("#B845FF",.1),connectButtonText:"#fff",connectButtonTextHover:"#fff",connectButtonBackground:"var(--wk-colors-primary)",connectButtonBackgroundHover:"var(--wk-colors-primaryActive)",walletOptionText:"var(--wk-colors-optionText)",walletOptionTextHover:"var(--wk-colors-optionTextHover)",walletOptionBackground:"var(--wk-colors-optionBackground)",walletOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",chainOptionText:"var(--wk-colors-optionText)",chainOptionTextHover:"var(--wk-colors-optionTextHover)",chainOptionBackground:"var(--wk-colors-optionBackground)",chainOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",closeButtonText:"var(--wk-colors-textSecondary)",closeButtonBackgroundHover:"var(--wk-colors-border)",disconnectButtonBackgroundText:"#fff",disconnectButtonBackgroundTextHover:"#fff",disconnectButtonBackground:"var(--wk-colors-primary)",disconnectButtonBackgroundHover:"var(--wk-colors-primaryActive)",toastBackground:"var(--wk-colors-modalBackground)"},shadows:{toast:"0px 4px 24px rgba(0, 0, 0, 0.08)"},radii},dark:{colors:{text:"#FFF",textSecondary:"#76808F",primary:"#9B00FB",primaryActive:"#B845FF",warning:"#F5B631",error:"#FC6E75",border:"#2e323a",modalBackground:"#1E2026",modalOverlay:rgba("#000",.5),optionText:"#FFF",optionTextHover:"#FFF",optionBackground:"#14151a",optionBackgroundHover:rgba("#B845FF",.1),connectButtonText:"#fff",connectButtonTextHover:"#fff",connectButtonBackground:"var(--wk-colors-primary)",connectButtonBackgroundHover:"var(--wk-colors-primaryActive)",walletOptionText:"var(--wk-colors-optionText)",walletOptionTextHover:"var(--wk-colors-optionTextHover)",walletOptionBackground:"var(--wk-colors-optionBackground)",walletOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",chainOptionText:"var(--wk-colors-optionText)",chainOptionTextHover:"var(--wk-colors-optionTextHover)",chainOptionBackground:"var(--wk-colors-optionBackground)",chainOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",closeButtonText:"var(--wk-colors-textSecondary)",closeButtonBackgroundHover:"var(--wk-colors-border)",disconnectButtonBackgroundText:"#fff",disconnectButtonBackgroundTextHover:"#fff",disconnectButtonBackground:"var(--wk-colors-primary)",disconnectButtonBackgroundHover:"var(--wk-colors-primaryActive)",toastBackground:"var(--wk-colors-modalBackground)"},shadows:{toast:"0px 4px 24px rgba(0, 0, 0, 0.08)"},radii}},themeMap={base};function ThemeProvider(o){const{variant:s,mode:a,customTheme:rt,children:ot}=o,tr=reactExports.useMemo(()=>{const Ut=themeMap[s],rr=deepMerge(Ut.light??Ut,(rt==null?void 0:rt.light)??rt),nr=deepMerge(Ut.dark??Ut,(rt==null?void 0:rt.dark)??rt),ir=createCssVars(rr,"--wk-light"),sr=createCssVars(nr,"--wk-dark"),ar=createPointer(ir),ur=createPointer(sr),cr=createStyleContent(ir),lr=createStyleContent(sr),hr=createStyleContent(ar),gr=createStyleContent(ur);return a==="light"?`body { + Approved: ${ur.toString()}`))}),Ut.forEach(ar=>{rt||(O(ot[ar].methods,tr[ar].methods)?O(ot[ar].events,tr[ar].events)||(rt=N("NON_CONFORMING_NAMESPACES",`${a} namespaces events don't satisfy namespace events for ${ar}`)):rt=N("NON_CONFORMING_NAMESPACES",`${a} namespaces methods don't satisfy namespace methods for ${ar}`))}),rt}function Yt(o){const s={};return Object.keys(o).forEach(a=>{var rt;a.includes(":")?s[a]=o[a]:(rt=o[a].chains)==null||rt.forEach(ot=>{s[ot]={methods:o[a].methods,events:o[a].events}})}),s}function ln(o){return[...new Set(o.map(s=>s.includes(":")?s.split(":")[0]:s))]}function Jt(o){const s={};return Object.keys(o).forEach(a=>{if(a.includes(":"))s[a]=o[a];else{const rt=A(o[a].accounts);rt==null||rt.forEach(ot=>{s[ot]={accounts:o[a].accounts.filter(tr=>tr.includes(`${ot}:`)),methods:o[a].methods,events:o[a].events}})}}),s}function Qt(o,s){return G(o,!1)&&o<=s.max&&o>=s.min}function Zt(){const o=R();return new Promise(s=>{switch(o){case m.browser:s(dn());break;case m.reactNative:s(fn());break;case m.node:s(pn());break;default:s(!0)}})}function dn(){return q()&&(navigator==null?void 0:navigator.onLine)}async function fn(){if(H()&&typeof global<"u"&&global!=null&&global.NetInfo){const o=await(global==null?void 0:global.NetInfo.fetch());return o==null?void 0:o.isConnected}return!0}function pn(){return!0}function Xt(o){switch(R()){case m.browser:mn(o);break;case m.reactNative:yn(o);break}}function mn(o){q()&&(window.addEventListener("online",()=>o(!0)),window.addEventListener("offline",()=>o(!1)))}function yn(o){H()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(s=>o(s==null?void 0:s.isConnected)))}const ae={};class er{static get(s){return ae[s]}static set(s,a){ae[s]=a}static delete(s){delete ae[s]}}var NAMESPACE="eip155",STORE_KEY="store",REQUESTED_CHAINS_KEY="requestedChains",ADD_ETH_CHAIN_METHOD="wallet_addEthereumChain",_provider,_initProviderPromise,_createProvider,createProvider_fn,_initProvider,initProvider_fn,_isChainsStale,isChainsStale_fn,_setupListeners,setupListeners_fn,_removeListeners,removeListeners_fn,_setRequestedChainsIds,setRequestedChainsIds_fn,_getRequestedChainsIds,getRequestedChainsIds_fn,_getNamespaceChainsIds,getNamespaceChainsIds_fn,_getNamespaceMethods,getNamespaceMethods_fn,WalletConnectConnector$1=class extends Connector{constructor(s){super({...s,options:{isNewChainsStale:!0,...s.options}}),__privateAdd$1(this,_createProvider),__privateAdd$1(this,_initProvider),__privateAdd$1(this,_isChainsStale),__privateAdd$1(this,_setupListeners),__privateAdd$1(this,_removeListeners),__privateAdd$1(this,_setRequestedChainsIds),__privateAdd$1(this,_getRequestedChainsIds),__privateAdd$1(this,_getNamespaceChainsIds),__privateAdd$1(this,_getNamespaceMethods),this.id="walletConnect",this.name="WalletConnect",this.ready=!0,__privateAdd$1(this,_provider,void 0),__privateAdd$1(this,_initProviderPromise,void 0),this.onAccountsChanged=a=>{a.length===0?this.emit("disconnect"):this.emit("change",{account:getAddress$2(a[0])})},this.onChainChanged=a=>{const rt=Number(a),ot=this.isChainUnsupported(rt);this.emit("change",{chain:{id:rt,unsupported:ot}})},this.onDisconnect=()=>{__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,[]),this.emit("disconnect")},this.onDisplayUri=a=>{this.emit("message",{type:"display_uri",data:a})},this.onConnect=()=>{this.emit("connect",{})},__privateMethod$1(this,_createProvider,createProvider_fn).call(this)}async connect({chainId:s,pairingTopic:a}={}){var rt,ot,tr,Ut,rr;try{let nr=s;if(!nr){const hr=(rt=this.storage)==null?void 0:rt.getItem(STORE_KEY),gr=(Ut=(tr=(ot=hr==null?void 0:hr.state)==null?void 0:ot.data)==null?void 0:tr.chain)==null?void 0:Ut.id;gr&&!this.isChainUnsupported(gr)?nr=gr:nr=(rr=this.chains[0])==null?void 0:rr.id}if(!nr)throw new Error("No chains found on connector.");const ir=await this.getProvider();__privateMethod$1(this,_setupListeners,setupListeners_fn).call(this);const sr=__privateMethod$1(this,_isChainsStale,isChainsStale_fn).call(this);if(ir.session&&sr&&await ir.disconnect(),!ir.session||sr){const hr=this.chains.filter(gr=>gr.id!==nr).map(gr=>gr.id);this.emit("message",{type:"connecting"}),await ir.connect({pairingTopic:a,chains:[nr],optionalChains:hr.length?hr:void 0}),__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,this.chains.map(({id:gr})=>gr))}const ar=await ir.enable(),ur=getAddress$2(ar[0]),cr=await this.getChainId(),lr=this.isChainUnsupported(cr);return{account:ur,chain:{id:cr,unsupported:lr}}}catch(nr){throw/user rejected/i.test(nr==null?void 0:nr.message)?new UserRejectedRequestError$1(nr):nr}}async disconnect(){const s=await this.getProvider();try{await s.disconnect()}catch(a){if(!/No matching key/i.test(a.message))throw a}finally{__privateMethod$1(this,_removeListeners,removeListeners_fn).call(this),__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,[])}}async getAccount(){const{accounts:s}=await this.getProvider();return getAddress$2(s[0])}async getChainId(){const{chainId:s}=await this.getProvider();return s}async getProvider({chainId:s}={}){return __privateGet$1(this,_provider)||await __privateMethod$1(this,_createProvider,createProvider_fn).call(this),s&&await this.switchChain(s),__privateGet$1(this,_provider)}async getWalletClient({chainId:s}={}){const[a,rt]=await Promise.all([this.getProvider({chainId:s}),this.getAccount()]),ot=this.chains.find(tr=>tr.id===s);if(!a)throw new Error("provider is required.");return createWalletClient$1({account:rt,chain:ot,transport:custom$2(a)})}async isAuthorized(){try{const[s,a]=await Promise.all([this.getAccount(),this.getProvider()]),rt=__privateMethod$1(this,_isChainsStale,isChainsStale_fn).call(this);if(!s)return!1;if(rt&&a.session){try{await a.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(s){var rt,ot;const a=this.chains.find(tr=>tr.id===s);if(!a)throw new SwitchChainError$1(new Error("chain not found on connector."));try{const tr=await this.getProvider(),Ut=__privateMethod$1(this,_getNamespaceChainsIds,getNamespaceChainsIds_fn).call(this),rr=__privateMethod$1(this,_getNamespaceMethods,getNamespaceMethods_fn).call(this);if(!Ut.includes(s)&&rr.includes(ADD_ETH_CHAIN_METHOD)){await tr.request({method:ADD_ETH_CHAIN_METHOD,params:[{chainId:numberToHex(a.id),blockExplorerUrls:[(ot=(rt=a.blockExplorers)==null?void 0:rt.default)==null?void 0:ot.url],chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[...a.rpcUrls.default.http]}]});const ir=__privateMethod$1(this,_getRequestedChainsIds,getRequestedChainsIds_fn).call(this);ir.push(s),__privateMethod$1(this,_setRequestedChainsIds,setRequestedChainsIds_fn).call(this,ir)}return await tr.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(s)}]}),a}catch(tr){const Ut=typeof tr=="string"?tr:tr==null?void 0:tr.message;throw/user rejected request/i.test(Ut)?new UserRejectedRequestError$1(tr):new SwitchChainError$1(tr)}}};_provider=new WeakMap;_initProviderPromise=new WeakMap;_createProvider=new WeakSet;createProvider_fn=async function(){return!__privateGet$1(this,_initProviderPromise)&&typeof window<"u"&&__privateSet$1(this,_initProviderPromise,__privateMethod$1(this,_initProvider,initProvider_fn).call(this)),__privateGet$1(this,_initProviderPromise)};_initProvider=new WeakSet;initProvider_fn=async function(){const{EthereumProvider:o,OPTIONAL_EVENTS:s,OPTIONAL_METHODS:a}=await __vitePreload(()=>import("./index.es-fd9b4c72.js"),[],import.meta.url),[rt,...ot]=this.chains.map(({id:tr})=>tr);if(rt){const{projectId:tr,showQrModal:Ut=!0,qrModalOptions:rr,metadata:nr,relayUrl:ir}=this.options;__privateSet$1(this,_provider,await o.init({showQrModal:Ut,qrModalOptions:rr,projectId:tr,optionalMethods:a,optionalEvents:s,chains:[rt],optionalChains:ot.length?ot:void 0,rpcMap:Object.fromEntries(this.chains.map(sr=>[sr.id,sr.rpcUrls.default.http[0]])),metadata:nr,relayUrl:ir}))}};_isChainsStale=new WeakSet;isChainsStale_fn=function(){if(__privateMethod$1(this,_getNamespaceMethods,getNamespaceMethods_fn).call(this).includes(ADD_ETH_CHAIN_METHOD)||!this.options.isNewChainsStale)return!1;const s=__privateMethod$1(this,_getRequestedChainsIds,getRequestedChainsIds_fn).call(this),a=this.chains.map(({id:ot})=>ot),rt=__privateMethod$1(this,_getNamespaceChainsIds,getNamespaceChainsIds_fn).call(this);return rt.length&&!rt.some(ot=>a.includes(ot))?!1:!a.every(ot=>s.includes(ot))};_setupListeners=new WeakSet;setupListeners_fn=function(){__privateGet$1(this,_provider)&&(__privateMethod$1(this,_removeListeners,removeListeners_fn).call(this),__privateGet$1(this,_provider).on("accountsChanged",this.onAccountsChanged),__privateGet$1(this,_provider).on("chainChanged",this.onChainChanged),__privateGet$1(this,_provider).on("disconnect",this.onDisconnect),__privateGet$1(this,_provider).on("session_delete",this.onDisconnect),__privateGet$1(this,_provider).on("display_uri",this.onDisplayUri),__privateGet$1(this,_provider).on("connect",this.onConnect))};_removeListeners=new WeakSet;removeListeners_fn=function(){__privateGet$1(this,_provider)&&(__privateGet$1(this,_provider).removeListener("accountsChanged",this.onAccountsChanged),__privateGet$1(this,_provider).removeListener("chainChanged",this.onChainChanged),__privateGet$1(this,_provider).removeListener("disconnect",this.onDisconnect),__privateGet$1(this,_provider).removeListener("session_delete",this.onDisconnect),__privateGet$1(this,_provider).removeListener("display_uri",this.onDisplayUri),__privateGet$1(this,_provider).removeListener("connect",this.onConnect))};_setRequestedChainsIds=new WeakSet;setRequestedChainsIds_fn=function(o){var s;(s=this.storage)==null||s.setItem(REQUESTED_CHAINS_KEY,o)};_getRequestedChainsIds=new WeakSet;getRequestedChainsIds_fn=function(){var o;return((o=this.storage)==null?void 0:o.getItem(REQUESTED_CHAINS_KEY))??[]};_getNamespaceChainsIds=new WeakSet;getNamespaceChainsIds_fn=function(){var rt,ot,tr;if(!__privateGet$1(this,_provider))return[];const o=(rt=__privateGet$1(this,_provider).session)==null?void 0:rt.namespaces;return o?((tr=(ot=se(o)[NAMESPACE])==null?void 0:ot.chains)==null?void 0:tr.map(Ut=>parseInt(Ut.split(":")[1]||"")))??[]:[]};_getNamespaceMethods=new WeakSet;getNamespaceMethods_fn=function(){var rt,ot;if(!__privateGet$1(this,_provider))return[];const o=(rt=__privateGet$1(this,_provider).session)==null?void 0:rt.namespaces;return o?((ot=se(o)[NAMESPACE])==null?void 0:ot.methods)??[]:[]};let globalData={walletConnectDefaultOptions:{appName:"Connect Wallet"}};const setGlobalData=o=>{globalData={...globalData,...o}},getGlobalData=()=>globalData,InjectedIcon=o=>jsxRuntimeExports.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6505 3.64041C15.6501 3.64062 15.6497 3.64083 15.6493 3.64103L6.05165 8.43985L16.2501 13.5391L26.4484 8.43987L16.8508 3.64103C16.8504 3.64083 16.85 3.64063 16.8496 3.64043C16.6632 3.54806 16.458 3.5 16.25 3.5C16.042 3.5 15.8369 3.54806 15.6505 3.64041ZM28 10.4592L17.5001 15.7091L17.5 28.5205L27.248 23.6465L27.2508 23.6452C27.4757 23.5334 27.665 23.3611 27.7973 23.1477C27.9297 22.9342 27.9999 22.6881 28 22.4369V10.4592ZM15 28.527L15.0001 15.7091L4.50006 10.4591V22.4333C4.49831 22.6849 4.56687 22.9319 4.69807 23.1466C4.82896 23.3608 5.01696 23.5342 5.24095 23.6475C5.24148 23.6477 5.242 23.648 5.24253 23.6483L15 28.527ZM14.5207 31.0824L4.12104 25.8826L4.11759 25.8809C3.47681 25.558 2.93902 25.0625 2.56486 24.4502C2.19154 23.8394 1.99597 23.1365 2.00006 22.4207V10.0486C2.00044 9.33234 2.20062 8.62972 2.5781 8.021C2.95529 7.41274 3.49457 6.92167 4.13537 6.60291C4.13585 6.60267 4.13633 6.60243 4.13681 6.60219L14.534 1.40359L14.5368 1.40221C15.0692 1.13767 15.6556 1 16.25 1C16.8445 1 17.4309 1.13767 17.9633 1.40221L17.966 1.40358L28.3633 6.60219C28.3638 6.60245 28.3643 6.6027 28.3648 6.60295C29.0055 6.92171 29.5448 7.41276 29.922 8.021C30.2994 8.62973 30.4996 9.33168 30.5 10.0479V22.4376C30.4996 23.1538 30.2994 23.8565 29.922 24.4652C29.5448 25.0734 29.0056 25.5644 28.365 25.8831C28.3644 25.8834 28.3638 25.8837 28.3633 25.884L17.9664 31.0824C17.9663 31.0825 17.9665 31.0824 17.9664 31.0824C17.4316 31.3499 16.8415 31.4894 16.2435 31.4894C15.6455 31.4894 15.0554 31.3499 14.5207 31.0824C14.5205 31.0824 14.5208 31.0825 14.5207 31.0824Z",fill:"#CCCCCC"})}),INJECTED_ID="injected";function injected(o={}){const{connectorOptions:s,...a}=o;return{id:INJECTED_ID,name:"Browser Wallet",logos:{default:jsxRuntimeExports.jsx(InjectedIcon,{})},downloadUrls:{default:void 0},installed:isInjected(),createConnector:rt=>new InjectedConnector({chains:rt,options:{name:"Browser Wallet",shimDisconnect:!0,...s}}),getUri:()=>{},...a}}function isInjected(){return typeof window<"u"&&!!window.ethereum}function MetaMaskIcon(o){return jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_827_48434)",children:[jsxRuntimeExports.jsx("path",{d:"M40.6314 10.9688L27.95 20.3874L30.2951 14.8305L40.6314 10.9688Z",fill:"#E2761B"}),jsxRuntimeExports.jsx("path",{d:"M11.3559 10.9688L23.9353 20.4766L21.7049 14.8305L11.3559 10.9688Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M36.0687 32.8011L32.6912 37.9756L39.9177 39.9638L41.9951 32.9158L36.0687 32.8011Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M10.0176 32.9158L12.0823 39.9638L19.3088 37.9756L15.9314 32.8011L10.0176 32.9158Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M18.901 24.058L16.8873 27.104L24.0627 27.4227L23.8078 19.7119L18.901 24.058Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M33.0863 24.058L28.1157 19.6227L27.95 27.4227L35.1127 27.104L33.0863 24.058Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M19.3088 37.9756L23.6167 35.8727L19.8951 32.9668L19.3088 37.9756Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M28.3706 35.8727L32.6912 37.9756L32.0922 32.9668L28.3706 35.8727Z",fill:"#E4761B"}),jsxRuntimeExports.jsx("path",{d:"M32.6912 37.9756L28.3706 35.8727L28.7147 38.6893L28.6765 39.8746L32.6912 37.9756Z",fill:"#D7C1B3"}),jsxRuntimeExports.jsx("path",{d:"M19.3088 37.9756L23.3235 39.8746L23.298 38.6893L23.6167 35.8727L19.3088 37.9756Z",fill:"#D7C1B3"}),jsxRuntimeExports.jsx("path",{d:"M23.3873 31.106L19.7931 30.0482L22.3294 28.8884L23.3873 31.106Z",fill:"#233447"}),jsxRuntimeExports.jsx("path",{d:"M28.6 31.106L29.6578 28.8884L32.2068 30.0482L28.6 31.106Z",fill:"#233447"}),jsxRuntimeExports.jsx("path",{d:"M19.3088 37.9756L19.9206 32.8011L15.9314 32.9158L19.3088 37.9756Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M32.0794 32.8011L32.6912 37.9756L36.0686 32.9158L32.0794 32.8011Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M35.1127 27.104L27.95 27.4227L28.6128 31.106L29.6706 28.8884L32.2196 30.0482L35.1127 27.104Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M19.7931 30.0482L22.3422 28.8884L23.3873 31.106L24.0627 27.4227L16.8873 27.104L19.7931 30.0482Z",fill:"#CD6116"}),jsxRuntimeExports.jsx("path",{d:"M16.8873 27.104L19.8951 32.9668L19.7931 30.0482L16.8873 27.104Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M32.2196 30.0482L32.0922 32.9668L35.1127 27.104L32.2196 30.0482Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M24.0627 27.4227L23.3873 31.106L24.2284 35.4521L24.4196 29.7295L24.0627 27.4227Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M27.95 27.4227L27.6059 29.7168L27.7588 35.4521L28.6128 31.106L27.95 27.4227Z",fill:"#E4751F"}),jsxRuntimeExports.jsx("path",{d:"M28.6128 31.106L27.7588 35.4521L28.3706 35.8727L32.0922 32.9668L32.2196 30.0482L28.6128 31.106Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M19.7931 30.0482L19.8951 32.9668L23.6167 35.8727L24.2284 35.4521L23.3873 31.106L19.7931 30.0482Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M28.6765 39.8746L28.7147 38.6893L28.3961 38.4089H23.5912L23.298 38.6893L23.3235 39.8746L19.3088 37.9756L20.7108 39.1227L23.5529 41.0982H28.4343L31.2892 39.1227L32.6912 37.9756L28.6765 39.8746Z",fill:"#C0AD9E"}),jsxRuntimeExports.jsx("path",{d:"M28.3706 35.8727L27.7588 35.4521H24.2284L23.6167 35.8727L23.298 38.6893L23.5912 38.4089H28.3961L28.7147 38.6893L28.3706 35.8727Z",fill:"#161616"}),jsxRuntimeExports.jsx("path",{d:"M41.1667 20.9991L42.25 15.7991L40.6314 10.9688L28.3706 20.0688L33.0863 24.058L39.752 26.008L41.2304 24.2874L40.5931 23.8286L41.6127 22.8982L40.8225 22.2864L41.8422 21.5089L41.1667 20.9991Z",fill:"#763D16"}),jsxRuntimeExports.jsx("path",{d:"M9.75 15.7991L10.8333 20.9991L10.1451 21.5089L11.1647 22.2864L10.3873 22.8982L11.4069 23.8286L10.7696 24.2874L12.2353 26.008L18.901 24.058L23.6167 20.0688L11.3559 10.9688L9.75 15.7991Z",fill:"#763D16"}),jsxRuntimeExports.jsx("path",{d:"M39.752 26.008L33.0863 24.058L35.1127 27.104L32.0922 32.9668L36.0686 32.9158H41.9951L39.752 26.008Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M18.901 24.058L12.2353 26.008L10.0176 32.9158H15.9314L19.8951 32.9668L16.8873 27.104L18.901 24.058Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{d:"M27.95 27.4227L28.3706 20.0688L30.3078 14.8305L21.7049 14.8305L23.6167 20.0688L24.0627 27.4227L24.2157 29.7423L24.2284 35.4521H27.7588L27.7843 29.7423L27.95 27.4227Z",fill:"#F6851B"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2682 10.7855C11.318 10.7617 11.3752 10.7592 11.4269 10.7784L21.7416 14.6274L30.2584 14.6274L40.5603 10.7785C40.6119 10.7592 40.6691 10.7617 40.7188 10.7854C40.7685 10.8091 40.8065 10.852 40.824 10.9042L42.4426 15.7346C42.454 15.7687 42.4562 15.8053 42.4489 15.8406L41.3918 20.9146L41.9645 21.3468C42.0152 21.3851 42.0451 21.4449 42.0453 21.5084C42.0454 21.572 42.0159 21.6319 41.9653 21.6705L41.1559 22.2876L41.7371 22.7375C41.7845 22.7743 41.8133 22.83 41.8157 22.89C41.8181 22.9499 41.794 23.0078 41.7497 23.0482L40.9149 23.8099L41.3491 24.1225C41.3953 24.1558 41.4254 24.2069 41.4321 24.2634C41.4388 24.3199 41.4215 24.3766 41.3845 24.4198L39.9804 26.0538L42.1883 32.8531C42.201 32.892 42.2015 32.9339 42.19 32.9732L40.1125 40.0213C40.0812 40.1275 39.9706 40.1891 39.8638 40.1597L32.7386 38.1993L31.4178 39.2799C31.4136 39.2833 31.4093 39.2866 31.4048 39.2897L28.5499 41.2652C28.5159 41.2887 28.4756 41.3013 28.4343 41.3013H23.5529C23.5115 41.3013 23.471 41.2886 23.437 41.265L20.5949 39.2895C20.5905 39.2864 20.5863 39.2832 20.5822 39.2799L19.2615 38.1993L12.1362 40.1597C12.0293 40.1891 11.9186 40.1274 11.8874 40.021L9.8227 32.9729C9.81128 32.9339 9.81182 32.8924 9.82423 32.8537L12.0073 26.0536L10.615 24.4191C10.5782 24.3759 10.5611 24.3193 10.568 24.2629C10.5748 24.2066 10.6049 24.1557 10.6509 24.1225L11.0851 23.8099L10.2503 23.0482C10.2063 23.008 10.1821 22.9504 10.1843 22.8908C10.1864 22.8311 10.2147 22.7754 10.2616 22.7385L10.833 22.2889L10.0219 21.6705C9.97115 21.6317 9.94153 21.5714 9.94198 21.5075C9.94242 21.4437 9.97287 21.3837 10.0242 21.3457L10.608 20.9133L9.55114 15.8406C9.54383 15.8055 9.54594 15.7691 9.55725 15.7351L11.1631 10.9047C11.1805 10.8523 11.2185 10.8093 11.2682 10.7855ZM12.3958 26.1727L10.2979 32.7072L15.9274 32.598C15.9974 32.5967 16.0632 32.6314 16.1015 32.6901L16.1128 32.7074L19.484 32.6105L16.7065 27.1968C16.673 27.1315 16.6774 27.0532 16.7178 26.992L18.4256 24.4087L12.3958 26.1727ZM19.0544 24.1943L17.2544 26.917L23.8463 27.2097L23.4385 20.4856L19.0544 24.1943ZM23.8209 27.6153L17.3956 27.3299L19.8379 29.8043L22.2449 28.7036C22.2744 28.6902 22.3054 28.6843 22.3357 28.6853C22.4143 28.6828 22.4904 28.7263 22.5259 28.8018L23.3015 30.4475L23.8209 27.6153ZM23.008 30.7826L22.2342 29.1606L20.3735 30.0072L23.008 30.7826ZM20.006 30.3225L20.0886 32.6869C20.1159 32.7271 20.1281 32.7761 20.1223 32.825L20.1157 32.8813L23.6243 35.6209L24.0037 35.3601L23.2113 31.266L20.006 30.3225ZM23.594 31.105L24.0205 33.3089L24.0126 29.7492L23.9676 29.0675L23.594 31.105ZM24.2915 35.6552L23.8081 35.9876L23.5568 38.2087C23.5681 38.2068 23.5796 38.2058 23.5912 38.2058H28.3961C28.4151 38.2058 28.4339 38.2085 28.452 38.2137L28.1801 35.9882L27.6957 35.6552H24.2915ZM27.9838 35.3603L28.363 35.6209L31.8833 32.8722L31.8777 32.825C31.8728 32.7833 31.8809 32.7416 31.9003 32.7054L32.0043 30.323L28.7883 31.2662L27.9838 35.3603ZM32.4192 30.1349L32.3355 32.051L34.3185 28.2021L32.4192 30.1349ZM34.7444 26.9171L32.9331 24.1944L28.5501 20.4867L28.1656 27.2098L34.7444 26.9171ZM33.1873 23.8759L39.6833 25.7762L40.9321 24.3229L40.4744 23.9934C40.4248 23.9576 40.3939 23.9014 40.3904 23.8403C40.3868 23.7792 40.411 23.7198 40.4562 23.6785L41.2974 22.9109L40.6982 22.447C40.6483 22.4084 40.6192 22.3488 40.6194 22.2857C40.6197 22.2225 40.6492 22.1631 40.6994 22.1249L41.5061 21.5098L41.0443 21.1613C40.9816 21.1139 40.9518 21.0347 40.9678 20.9577L42.0399 15.8115L40.5277 11.2988L28.8294 19.9873L33.1873 23.8759ZM39.3568 11.6618L30.4681 14.9827L28.798 19.4985L39.3568 11.6618ZM29.9889 15.0336L22.0036 15.0336L23.7726 19.5118C23.8109 19.5051 23.851 19.5093 23.8882 19.5253C23.9604 19.5564 24.0083 19.6265 24.0109 19.7052L24.0256 20.1524L24.1242 20.402C24.1577 20.4866 24.1307 20.5832 24.0582 20.6383C24.053 20.6423 24.0476 20.646 24.0421 20.6494L24.2654 27.4037L24.6203 29.6985C24.6223 29.711 24.623 29.7237 24.6226 29.7363L24.4385 35.249H27.5502L27.4028 29.7222C27.4025 29.7103 27.4032 29.6984 27.405 29.6867L27.7472 27.4054L27.8921 20.5821C27.8681 20.575 27.8452 20.5633 27.8246 20.5471C27.7525 20.4906 27.7273 20.3928 27.7629 20.3084L27.9051 19.9714L27.9126 19.6184C27.9143 19.5391 27.9619 19.4681 28.0346 19.4364C28.0676 19.422 28.1031 19.417 28.1375 19.4207L29.9889 15.0336ZM27.9715 33.3162L28.3994 31.1382C28.3958 31.1159 28.396 31.093 28.4 31.0705L28.0371 29.0539L27.9874 29.75L27.9715 33.3162ZM28.191 27.6153L28.6975 30.4298L29.4745 28.8009C29.5103 28.7259 29.5862 28.6828 29.6644 28.6853C29.6946 28.6843 29.7254 28.6901 29.7547 28.7035L32.1744 29.8044L34.606 27.3299L28.191 27.6153ZM31.6257 30.0069L29.7658 29.1606L28.9939 30.7788L31.6257 30.0069ZM21.5462 14.9881L12.6288 11.6605L23.1935 19.5017L21.5462 14.9881ZM11.4593 11.3015L9.96002 15.8113L11.0322 20.9577C11.0484 21.0353 11.0179 21.1152 10.9542 21.1624L10.4832 21.5113L11.2879 22.1249C11.3378 22.163 11.3673 22.222 11.3678 22.2848C11.3683 22.3477 11.3397 22.4072 11.2903 22.446L10.7012 22.9096L11.5438 23.6785C11.589 23.7198 11.6132 23.7792 11.6096 23.8403C11.6061 23.9014 11.5752 23.9576 11.5256 23.9934L11.0672 24.3234L12.3046 25.7761L18.8003 23.8758L23.0803 20.085L11.4593 11.3015ZM39.5919 26.1728L33.564 24.4094L35.2818 26.9915C35.3227 27.0529 35.3271 27.1316 35.2933 27.1971L32.5044 32.6101L35.8873 32.7074L35.8986 32.6901C35.9368 32.6315 36.0026 32.5967 36.0726 32.598L41.7138 32.7072L39.5919 26.1728ZM31.9333 33.3486L28.7521 35.8325L32.4453 37.63L31.9333 33.3486ZM32.2217 37.973L28.6175 36.2188L28.9164 38.6647C28.9176 38.6751 28.9181 38.6855 28.9178 38.6959L28.8902 39.5488L32.2217 37.973ZM31.2798 38.8679L28.7634 40.0583C28.6994 40.0885 28.6243 40.0833 28.5651 40.0445C28.5059 40.0057 28.4712 39.9388 28.4735 39.8681L28.5086 38.7786L28.3194 38.6121H23.6727L23.503 38.7743L23.5266 39.8703C23.5281 39.9406 23.4931 40.0068 23.434 40.0451C23.375 40.0834 23.3003 40.0884 23.2367 40.0583L20.7202 38.8679L20.8332 38.9604L23.6166 40.895H28.3709L31.1669 38.9603L31.2798 38.8679ZM19.7778 37.9727L23.1134 39.5505L23.095 38.6937C23.0948 38.6877 23.095 38.6816 23.0954 38.6756C23.0956 38.6726 23.0959 38.6695 23.0962 38.6665L23.3733 36.2175L19.7778 37.9727ZM23.2355 35.8327L19.5542 37.6298L20.0599 33.3531L23.2355 35.8327ZM19.6603 32.0642L17.6716 28.1879L19.5929 30.1345L19.6603 32.0642ZM10.2888 33.1189L12.2211 39.715L18.9837 37.8544L15.8228 33.1189H10.2888ZM19.6672 33.167L16.3852 33.1248L19.1723 37.3948L19.6672 33.167ZM33.0163 37.8544L39.7792 39.7151L41.7235 33.1189H36.1773L33.0163 37.8544ZM35.6148 33.1248L32.3272 33.1669L32.8272 37.3957L35.6148 33.1248Z",fill:"#F6851B"})]}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_827_48434",children:jsxRuntimeExports.jsx("rect",{width:"52",height:"52",rx:"24",fill:"white"})})})]})}const TokenPocketIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1_2",maskUnits:"userSpaceOnUse",x:"8",y:"14",width:"36",height:"24",children:jsxRuntimeExports.jsx("path",{d:"M44 14H8V37.2274H44V14Z",fill:"white"})}),jsxRuntimeExports.jsxs("g",{mask:"url(#mask0_1_2)",children:[jsxRuntimeExports.jsx("path",{d:"M19.8012 21.9884H19.8078C19.8012 21.9495 19.8012 21.9042 19.8012 21.8653V21.9884Z",fill:"#29AEFF"}),jsxRuntimeExports.jsx("path",{d:"M32.6906 23.2184H25.5567V36.0945C25.5567 36.7031 26.0487 37.1951 26.6572 37.1951H31.5902C32.1986 37.1951 32.6906 36.7031 32.6906 36.0945V23.2184Z",fill:"#2980FE"}),jsxRuntimeExports.jsx("path",{d:"M22.1125 14H21.873H9.10044C8.49198 14 8 14.492 8 15.1006V19.5673C8 20.176 8.49198 20.668 9.10044 20.668H12.0978H13.289V21.9886V36.127C13.289 36.7355 13.7809 37.2274 14.3896 37.2274H19.0765C19.6849 37.2274 20.1769 36.7355 20.1769 36.127V21.9886V21.8655V20.668H21.3681H21.8537H22.0932C23.9317 20.668 25.427 19.1725 25.427 17.334C25.4465 15.4955 23.951 14 22.1125 14Z",fill:"#2980FE"}),jsxRuntimeExports.jsx("path",{d:"M32.6967 23.2184V32.2039C32.9427 32.2621 33.1952 32.3074 33.4542 32.3463C33.8166 32.3981 34.1921 32.4305 34.5676 32.437C34.587 32.437 34.6065 32.437 34.6324 32.437V25.29C33.5512 25.2189 32.6967 24.319 32.6967 23.2184Z",fill:"url(#paint0_linear_1_2)"}),jsxRuntimeExports.jsx("path",{d:"M34.7752 14C29.6869 14 25.5567 18.1303 25.5567 23.2186C25.5567 27.5948 28.6058 31.2588 32.6972 32.2039V23.2186C32.6972 22.0727 33.6293 21.1404 34.7752 21.1404C35.9211 21.1404 36.8532 22.0727 36.8532 23.2186C36.8532 24.183 36.1993 24.9923 35.306 25.2254C35.1377 25.2707 34.9564 25.2966 34.7752 25.2966V32.437C34.9564 32.437 35.1312 32.4305 35.306 32.4241C40.1483 32.1457 43.9936 28.132 43.9936 23.2186C44.0002 18.1303 39.8699 14 34.7752 14Z",fill:"#2980FE"}),jsxRuntimeExports.jsx("path",{d:"M34.775 32.4369V25.2964C34.7232 25.2964 34.6779 25.2964 34.626 25.2899V32.4369C34.6779 32.4369 34.7297 32.4369 34.775 32.4369Z",fill:"#2980FE"})]}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1_2",x1:"34.7777",y1:"27.8291",x2:"32.6977",y2:"27.8291",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#2980FE"}),jsxRuntimeExports.jsx("stop",{offset:"0.9667",stopColor:"#6CA8FF"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#2980FE"})]})})]});class TokenPocketConnector extends InjectedConnector{constructor({chains:s,options:a}={}){const rt={name:"Token Pocket",shimDisconnect:!0,getProvider:getTokenPocketProvider,...a};super({chains:s,options:rt}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:TOKEN_POCKET_ID}),Object.defineProperty(this,"shimDisconnectKey",{enumerable:!0,configurable:!0,writable:!0,value:`${this.id}.shimDisconnect`})}}function getTokenPocketProvider(){var o;if(!(typeof window>"u"))return(o=window==null?void 0:window.ethereum)!=null&&o.isTokenPocket?window.ethereum:window==null?void 0:window.tokenpocket}const TOKEN_POCKET_ID="tokenPocket";function tokenPocket(o={}){const{connectorOptions:s,...a}=o;return{id:TOKEN_POCKET_ID,name:"TokenPocket",logos:{default:jsxRuntimeExports.jsx(TokenPocketIcon,{})},downloadUrls:{default:"https://www.tokenpocket.pro/en/download/app"},installed:isTokenPocket(),createConnector:rt=>new TokenPocketConnector({chains:rt,options:{shimDisconnect:!0,...s}}),getUri:()=>{const rt={url:window.location.href};return`tpdapp://open?params=${encodeURIComponent(JSON.stringify(rt))}`},...a}}function isTokenPocket(){var o;return typeof window>"u"?!1:((o=window==null?void 0:window.ethereum)==null?void 0:o.isTokenPocket)??!!window.tokenpocket}const META_MASK_ID="metaMask";function metaMask(o={}){const{connectorOptions:s,...a}=o;return{id:META_MASK_ID,name:"MetaMask",logos:{default:jsxRuntimeExports.jsx(MetaMaskIcon,{})},downloadUrls:{default:"https://metamask.io/download/"},installed:isMetaMask(),createConnector:rt=>new MetaMaskConnector({chains:rt,options:{shimDisconnect:!0,UNSTABLE_shimOnConnectSelectAccount:!0,...s}}),getUri:()=>`dapp://${window.location.href.replace(/^https?:\/\//,"")}`,...a}}function isMetaMask(){var o;return typeof window>"u"||isTokenPocket()?!1:(o=window==null?void 0:window.ethereum)==null?void 0:o.isMetaMask}function isMetaMaskConnector(o){return(o==null?void 0:o.id)===META_MASK_ID}const SAFE_ID="safe";function safe(o={}){const{connectorOptions:s,...a}=o;return{id:SAFE_ID,name:"Safe Wallet",logos:{default:jsxRuntimeExports.jsx(InjectedIcon,{})},downloadUrls:{default:void 0},installed:isSafe(),createConnector:rt=>new SafeConnector({chains:rt,options:{allowedDomains:[/gnosis-safe.io$/,/app.safe.global$/],debug:!1,...s}}),getUri:()=>{},...a}}function isSafe(){return!(typeof window>"u")&&(window==null?void 0:window.parent)!==window}const TrustWalletIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_827_48424)",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.1038 9.82664C25.6315 9.38591 26.399 9.38591 26.9267 9.82664C31.5058 13.6509 36.7265 13.6204 38.7219 13.6088C38.8221 13.6082 38.9142 13.6076 38.9976 13.6076C39.3784 13.6076 39.7433 13.7604 40.0106 14.0317C40.2778 14.303 40.4251 14.6702 40.4193 15.051C40.3251 21.2927 40.075 25.7357 39.5864 28.9851C39.0981 32.2328 38.3534 34.4269 37.1725 36.068C35.9843 37.7194 34.4557 38.662 32.7882 39.5835C32.5006 39.7425 32.2067 39.9019 31.9052 40.0654C30.4375 40.8615 28.7927 41.7536 26.844 43.1515C26.3486 43.5068 25.6818 43.5068 25.1865 43.1515C23.2397 41.755 21.597 40.8633 20.1315 40.0677C19.8287 39.9033 19.5334 39.743 19.2445 39.5832C17.5784 38.6615 16.0519 37.7187 14.866 36.0668C13.6877 34.4255 12.9456 32.2316 12.4591 28.9844C11.9723 25.7353 11.7232 21.2925 11.6291 15.051C11.6233 14.6702 11.7706 14.303 12.0378 14.0317C12.3051 13.7604 12.67 13.6076 13.0508 13.6076C13.1333 13.6076 13.2244 13.6082 13.3237 13.6088C15.303 13.6204 20.5243 13.6512 25.1038 9.82664ZM14.4977 16.4475C14.6068 21.8967 14.8504 25.7528 15.2714 28.563C15.7289 31.6165 16.3779 33.2965 17.1761 34.4084C17.9667 35.5096 19.0019 36.1991 20.6211 37.0949C20.8861 37.2415 21.165 37.3927 21.4573 37.5512C22.7316 38.2423 24.2616 39.0721 26.0153 40.2624C27.7713 39.0706 29.3036 38.2403 30.5799 37.5487C30.8709 37.391 31.1487 37.2405 31.4127 37.0946C33.0339 36.1986 34.0715 35.5088 34.8642 34.4071C35.6643 33.2952 36.3152 31.6153 36.7743 28.5623C37.1968 25.7524 37.4414 21.8966 37.5507 16.4477C35.0368 16.3893 30.3736 15.9228 26.0152 12.7234C21.6618 15.9193 17.0048 16.3882 14.4977 16.4475Z",fill:"#3375BB"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_827_48424",children:jsxRuntimeExports.jsx("rect",{width:"52",height:"52",fill:"white"})})})]});class TrustWalletConnector extends MetaMaskConnector{constructor({chains:s,options:a}={}){const rt={name:"Trust Wallet",shimDisconnect:!0,getProvider:getTrustWalletProvider,...a};super({chains:s,options:rt}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:TRUST_WALLET_ID}),Object.defineProperty(this,"shimDisconnectKey",{enumerable:!0,configurable:!0,writable:!0,value:`${this.id}.shimDisconnect`})}}function getTrustWalletProvider(){var a;const o=rt=>!!rt.isTrust;if(typeof window<"u"&&typeof window.ethereum<"u")return o(window.ethereum)?window.ethereum:(a=window.ethereum)!=null&&a.providers?window.ethereum.providers.find(o):(window.trustwallet&&window.trustwallet.removeListener===void 0&&(window.trustwallet.removeListener=window.trustwallet.off),window.trustwallet)}const TRUST_WALLET_ID="trust";function trustWallet(o={}){const{connectorOptions:s,...a}=o;return{id:TRUST_WALLET_ID,name:"Trust Wallet",logos:{default:jsxRuntimeExports.jsx(TrustWalletIcon,{})},downloadUrls:{default:"https://trustwallet.com/"},installed:isTrustWallet(),createConnector:rt=>new TrustWalletConnector({chains:rt,options:{shimDisconnect:!0,...s}}),getUri:()=>`https://link.trustwallet.com/open_url?coin_id=60&url=${encodeURIComponent(window.location.href)}`,...a}}function isTrustWallet(){var s,a;if(typeof window>"u")return!1;const{ethereum:o}=window;return!!(o!=null&&o.isTrust||o!=null&&o.providers&&(o!=null&&o.providers.find(rt=>rt.isTrust))||(s=window==null?void 0:window.trustwallet)!=null&&s.isTrust||(a=window==null?void 0:window.trustWallet)!=null&&a.isTrust)}const WalletConnectIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",...o,children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_2676_92414)",children:jsxRuntimeExports.jsx("path",{d:"M15.3699 19.2984C21.2408 13.5672 30.7592 13.5672 36.6301 19.2984L37.3367 19.9882C37.6301 20.2748 37.6301 20.7393 37.3367 21.0259L34.9196 23.3854C34.7729 23.5287 34.5349 23.5287 34.3881 23.3854L33.4158 22.4363C29.3202 18.438 22.6798 18.438 18.5842 22.4363L17.543 23.4527C17.3962 23.596 17.1582 23.596 17.0114 23.4527L14.5944 21.0932C14.3009 20.8066 14.3009 20.3421 14.5944 20.0555L15.3699 19.2984ZM41.6287 24.1782L43.7798 26.2782C44.0734 26.5647 44.0734 27.0293 43.7798 27.3159L34.0802 36.7851C33.7867 37.0716 33.3107 37.0716 33.0171 36.7851L26.1329 30.0646C26.0595 29.9929 25.9406 29.9929 25.8672 30.0646L18.9831 36.7851C18.6896 37.0716 18.2136 37.0716 17.9201 36.7851L8.22016 27.3158C7.92661 27.0292 7.92661 26.5647 8.22016 26.2781L10.3713 24.1781C10.6648 23.8915 11.1408 23.8915 11.4343 24.1781L18.3187 30.8987C18.3921 30.9704 18.511 30.9704 18.5843 30.8987L25.4684 24.1781C25.7619 23.8915 26.2378 23.8915 26.5313 24.178L33.4157 30.8987C33.4891 30.9704 33.6081 30.9704 33.6814 30.8987L40.5657 24.1782C40.8592 23.8916 41.3351 23.8916 41.6287 24.1782Z",fill:"#3396FF"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_2676_92414",children:jsxRuntimeExports.jsx("rect",{width:"52",height:"52",fill:"white"})})})]});class WalletConnectConnector extends WalletConnectConnector$1{async getWalletClient({chainId:s}={}){const[a,rt]=await Promise.all([this.getProvider(),this.getAccount()]),ot=this.chains.find(tr=>tr.id===s);if(!a)throw new Error("provider is required.");return createWalletClient$1({account:rt,chain:ot,transport:custom$2(a)})}}const WALLET_CONNECT_ID="walletConnect";function walletConnect(o={}){const{connectorOptions:s,...a}=o;return{id:WALLET_CONNECT_ID,name:"WalletConnect",logos:{default:jsxRuntimeExports.jsx(WalletConnectIcon,{})},downloadUrls:{default:void 0},installed:void 0,createConnector:rt=>{const{walletConnectDefaultOptions:ot}=getGlobalData(),{walletConnectProjectId:tr,appName:Ut,appIcon:rr,appDescription:nr,appUrl:ir}=ot,sr=Ut&&rr&&nr&&ir;if(!tr)throw new Error("walletConnectProjectId is required.");return new WalletConnectConnector({chains:rt,options:{showQrModal:!0,projectId:tr,metadata:sr?{name:Ut,description:nr,url:ir,icons:[rr]}:void 0,...s}})},getUri:()=>{},...a}}function isWalletConnectConnector(o){return(o==null?void 0:o.id)===WALLET_CONNECT_ID}function getWalletById(o,s){switch(o){case INJECTED_ID:return injected(s);case META_MASK_ID:return metaMask(s);case SAFE_ID:return safe(s);case TOKEN_POCKET_ID:return tokenPocket(s);case TRUST_WALLET_ID:return trustWallet(s);case WALLET_CONNECT_ID:return walletConnect(s);default:return injected(s)}}const styles_css_ts_vanilla7c1f6529="",styles_css_ts_vanilla9e637951="",styles_css_ts_vanillaBee8ba1c="",styles_css_ts_vanilla24a22718="",styles_css_ts_vanillaC3d3b2e9="",styles_css_ts_vanilla73e53635="",styles_css_ts_vanilla6762e868="",styles_css_ts_vanillaC5e61b8d="",styles_css_ts_vanilla2c7e3db7="",styles_css_ts_vanilla6e095aad="",styles_css_ts_vanilla38d600b1="",styles_css_ts_vanilla40872cfc="",styles_css_ts_vanillaEc15015e="",styles_css_ts_vanilla0ec70b60="",styles_css_ts_vanilla3529c661="",fade_css_ts_vanillaCbe05087="",toastSlide_css_ts_vanilla1b4f2860="",styles_css_ts_vanilla43b3539a="",styles_css_ts_vanillaEb8fdd2f="",styles_css_ts_vanilla8ca5490c="",styles_css_ts_vanilla829d62e4="",WALLET_CONNECT_PROJECT_ID="e68a1816d39726c2afabf05661a32767",getDefaultWallets=()=>{const o=!(typeof window>"u")&&(window==null?void 0:window.parent)!==window;let s=[];return o&&(s=[...s,safe()]),s=[...s,trustWallet(),metaMask(),walletConnect()],s},defaultChains=[mainnet],getDefaultConfig=o=>{const{appName:s="WalletKit",appIcon:a,appDescription:rt,appUrl:ot,walletConnectProjectId:tr=WALLET_CONNECT_PROJECT_ID,alchemyId:Ut,infuraId:rr,chains:nr=defaultChains,connectors:ir,autoConnect:sr=!0,publicClient:ar,webSocketPublicClient:ur,enableWebSocketPublicClient:cr,stallTimeout:lr}=o;setGlobalData({walletConnectDefaultOptions:{walletConnectProjectId:tr,appName:s,appIcon:a,appDescription:rt,appUrl:ot}});const hr=[];Ut&&hr.push(alchemyProvider({apiKey:Ut})),rr&&hr.push(infuraProvider({apiKey:rr})),hr.push(jsonRpcProvider({rpc:$r=>({http:$r.rpcUrls.default.http[0]})})),hr.push(publicProvider());const{publicClient:gr,chains:vr,webSocketPublicClient:fr}=configureChains(nr,hr,{stallTimeout:lr}),br=ir??getDefaultWallets(),wr=createConnectors(br,vr);return{autoConnect:sr,connectors:wr,publicClient:ar??gr,webSocketPublicClient:cr?ur??fr:void 0}};function createConnectors(o=[],s){return o.map(rt=>{if(rt.createConnector){const ot=rt.createConnector(s);return ot._wallet=rt,withHackHandler(ot)}else return rt._wallet=getWalletById(rt.id),withHackHandler(rt)})}function withHackHandler(o){var a,rt;const s=(rt=(a=o==null?void 0:o.options)==null?void 0:a.getProvider)==null?void 0:rt.call(a);if(s&&!s.__hasWrappedRequest&&isMetaMaskConnector(o)){s.__hasWrappedRequest=!0;const ot=s.request,tr=(Ut=0,rr=[],...nr)=>new Promise((ir,sr)=>{const ar=setTimeout(()=>{ot.call(s,...nr).then(ur=>{s.request=ot,rr.forEach(cr=>{clearTimeout(cr)}),ir(ur)}).catch(sr)},Ut);rr.push(ar)});s.request=async function(...Ut){const rr=[0,500,1e3,1500,2e3,3e3],nr=[];return Promise.race(rr.map(ir=>tr(ir,nr,...Ut)))}}return o}const WalletKitContext=reactExports.createContext({});function useWalletKitContext(){return reactExports.useContext(WalletKitContext)}const RouteContext=React$1.createContext({});function useRouter(){return reactExports.useContext(RouteContext)}function cx(...o){if(o.length)return o.filter(Boolean).join(" ")}function cssVar(o,s="colors"){return`var(--wk-${s}-${o.replace(/\./g,"-")})`}function rgba(o,s,a,rt=1){var ot;if(typeof o=="string"&&o.startsWith("#")){const tr=o.slice(1),rr=(ot=(tr.length===3?tr.replace(/[A-F\d]/gi,"$&$&"):tr).match(/.{2}/g))==null?void 0:ot.map(nr=>parseInt(nr,16));if((rr==null?void 0:rr.length)===3)return rgba(rr[0],rr[1],rr[2],s)}return`rgba(${o}, ${s}, ${a}, ${rt})`}var box="styles_box__1cpvnp10";const Box=React$1.forwardRef((o,s)=>{const{as:a="div",className:rt,...ot}=o;return React$1.createElement(a,{ref:s,className:cx(box,rt),...ot})});Box.displayName="Box";var button="styles_button__1bwgl0a0";const Button=React$1.forwardRef((o,s)=>{const{className:a,...rt}=o;return jsxRuntimeExports.jsx(Box,{ref:s,as:"button",className:cx(button,a),...rt})});Button.displayName="Button";var iconButton="styles_iconButton__vjmzmh0";const IconButton=o=>{const{className:s,icon:a,...rt}=o;return jsxRuntimeExports.jsx(Button,{className:cx(iconButton,s),...rt,children:a})};IconButton.displayName="IconButton";const BackIcon=o=>jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 40 40",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.5118 8.82165C25.1627 9.47253 25.1627 10.5278 24.5118 11.1787L15.6904 20.0002L24.5118 28.8217C25.1627 29.4725 25.1627 30.5278 24.5118 31.1787C23.861 31.8295 22.8057 31.8295 22.1548 31.1787L12.1548 21.1787C11.5039 20.5278 11.5039 19.4725 12.1548 18.8217L22.1548 8.82165C22.8057 8.17078 23.861 8.17078 24.5118 8.82165Z"})}),CloseIcon=o=>jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 40 40",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0119 9.51184C11.361 8.86097 10.3057 8.86097 9.65484 9.51184C9.00397 10.1627 9.00397 11.218 9.65484 11.8689L17.643 19.857L9.51187 27.9882C8.86099 28.639 8.86099 29.6943 9.51187 30.3452C10.1627 30.9961 11.218 30.9961 11.8689 30.3452L20 22.214L27.9218 30.1358C28.5726 30.7867 29.6279 30.7867 30.2788 30.1358C30.9297 29.4849 30.9297 28.4296 30.2788 27.7788L22.357 19.857L30.1358 12.0783C30.7867 11.4274 30.7867 10.3721 30.1358 9.72123C29.4849 9.07036 28.4297 9.07036 27.7788 9.72123L20 17.5L12.0119 9.51184Z"})});var navbar="styles_navbar__19bcqvr0";function Navbar(o){const{className:s,showBack:a=!1,onBack:rt,onClose:ot,...tr}=o,{onClose:Ut}=useWalletKitContext(),rr=useRouter(),nr=()=>{rt==null||rt(),rr.back()},ir=()=>{ot==null||ot(),Ut()};return jsxRuntimeExports.jsxs(Box,{className:cx("wk-navbar",navbar,s),...tr,children:[a&&jsxRuntimeExports.jsx(IconButton,{className:"wk-back-button",icon:jsxRuntimeExports.jsx(BackIcon,{}),onClick:nr}),jsxRuntimeExports.jsx(Box,{style:{flex:1}}),jsxRuntimeExports.jsx(IconButton,{className:"wk-close-button",icon:jsxRuntimeExports.jsx(CloseIcon,{}),onClick:ir})]})}var link="styles_link__1luj8ua0";const Link=o=>{const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{as:"a",className:cx(link,s),target:"_blank",rel:"noopener",...a})};Link.displayName="Link";var modal="styles_modal__28jf4v4",modalContent="styles_modalContent__28jf4v6",modalHeader="styles_modalHeader__28jf4v7",modalOverlay="styles_modalOverlay__28jf4v5";function ModalHeader(o){const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-header",modalHeader,s),...a})}const WalletIcon=o=>jsxRuntimeExports.jsx("svg",{width:24,height:24,viewBox:"0 0 40 40",fill:"currentColor",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.16669 12.5C4.16669 9.73858 6.40526 7.5 9.16669 7.5H30.8334C33.5948 7.5 35.8334 9.73858 35.8334 12.5V27.5C35.8334 30.2614 33.5948 32.5 30.8334 32.5H9.16669C6.40526 32.5 4.16669 30.2614 4.16669 27.5V12.5ZM9.16669 10.8333C8.24621 10.8333 7.50002 11.5795 7.50002 12.5V27.5C7.50002 28.4205 8.24621 29.1667 9.16669 29.1667H30.8334C31.7538 29.1667 32.5 28.4205 32.5 27.5V26.4583H24.1667C20.5998 26.4583 17.7084 23.5668 17.7084 20C17.7084 16.4332 20.5998 13.5417 24.1667 13.5417H32.5V12.5C32.5 11.5795 31.7538 10.8333 30.8334 10.8333H9.16669ZM32.5 16.4583H24.1667C22.2107 16.4583 20.625 18.044 20.625 20C20.625 21.956 22.2107 23.5417 24.1667 23.5417H32.5V16.4583ZM26.6667 20C26.6667 21.1506 25.7339 22.0833 24.5834 22.0833C23.4328 22.0833 22.5 21.1506 22.5 20C22.5 18.8494 23.4328 17.9167 24.5834 17.9167C25.7339 17.9167 26.6667 18.8494 26.6667 20Z"})});function useConnectors(){const{connectors:o}=useConnect();return o}function useWalletConfig(o){return o._wallet}const Text=o=>{const{...s}=o;return jsxRuntimeExports.jsx(Box,{as:"p",...s})};Text.displayName="Text";function isAndroid(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function isSmallIOS(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function isLargeIOS(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function isIOS(){return isSmallIOS()||isLargeIOS()}function isMobile(){return isAndroid()||isIOS()}function mergeList(o=[],s=[]){const a=[...o];return s.forEach(rt=>{const ot=o.findIndex(tr=>tr.id===rt.id);ot>-1?a[ot]={...a[ot],...rt}:a.push({...rt})}),a}function commonErrorHandler(o){var tr;const{log:s,handler:a,error:rt}=o;let ot="";if(rt){if(rt.code)switch(rt.code){case 4902:isIOS()&&isTrustWallet()&&(ot="Not supported chainId");break}const Ut=ot||((tr=rt.cause)==null?void 0:tr.message)||rt.message;s("[wallet error]",rt),a==null||a(rt,Ut)}}function isObject(o){return o&&typeof o=="object"&&!Array.isArray(o)&&o!==null}function deepMerge(o,s){if(isObject(o)&&isObject(s))for(const a in s)isObject(s[a])?(o[a]||Object.assign(o,{[a]:{}}),deepMerge(o[a],s[a])):Object.assign(o,{[a]:s[a]});return o}function useWalletKitConnect({...o}={}){const{log:s,options:a}=useWalletKitContext(),rt={chainId:a==null?void 0:a.initialChainId},{connect:ot,connectAsync:tr,connectors:Ut,...rr}=useConnect({...o,onError(nr){var ir;commonErrorHandler({log:s,handler:a.onError,error:nr}),(ir=o==null?void 0:o.onError)==null||ir.call(o,nr)}});return{connect:({...nr})=>ot({...rt,...nr}),connectAsync:async({...nr})=>await tr({...rt,...nr}),connectors:Ut,...rr}}function useWalletConnectModal(){const{connectAsync:o,connectors:s}=useWalletKitConnect(),[a,rt]=reactExports.useState(!1),{log:ot}=useWalletKitContext();return{isOpenWcModal:a,onOpenWcModal:async()=>{const tr=document.createElement("style");tr.innerHTML="#walletconnect-wrapper{z-index:2147483647;}",document.head.appendChild(tr),document.body.style.setProperty("--wcm-z-index","2147483647");const Ut=s.find(rr=>isWalletConnectConnector(rr));rt(!0);try{await o({connector:Ut})}catch(rr){ot("WalletConnect",rr)}rt(!1),document.head.removeChild(tr)}}}function useClickWallet(){const o=useRouter(),{options:s,setSelectedConnector:a,onClose:rt}=useWalletKitContext(),{disconnect:ot}=useDisconnect(),{onOpenWcModal:tr}=useWalletConnectModal(),Ut=reactExports.useRef(),rr=isMobile();return reactExports.useCallback((ir,sr)=>{var ur;((ur=s.onClickWallet)==null?void 0:ur.call(s,ir,sr))!==!1&&(ot(),clearTimeout(Ut.current),Ut.current=setTimeout(()=>{var cr,lr;if(isWalletConnectConnector(ir))tr(),setTimeout(()=>{rt()},1e3);else if(rr&&!ir._wallet.installed){const hr=(lr=(cr=ir._wallet).getUri)==null?void 0:lr.call(cr);hr&&window.open(hr,"_self","noopener noreferrer")}else a(ir),o.push(routes.CONNECTING)},300))},[ot,rr,rt,tr,s,o,a])}var walletOption="styles_walletOption__8fbz320",walletOptionIcon="styles_walletOptionIcon__8fbz322",walletOptionName="styles_walletOptionName__8fbz321";function WalletOption(o){const{connector:s}=o,a=useWalletConfig(s),rt=useClickWallet();return jsxRuntimeExports.jsxs(Button,{className:cx("wk-wallet-option",walletOption),onClick:ot=>rt(s,ot),children:[jsxRuntimeExports.jsx(Text,{className:cx("wk-wallet-option-name",walletOptionName),children:a.name}),jsxRuntimeExports.jsx(Box,{className:cx("wk-wallet-option-logo",walletOptionIcon),children:a.logos.default})]})}var downloadLink="styles_downloadLink__17l0qzv2",footer="styles_footer__17l0qzv1",wallets="styles_wallets__17l0qzv0";function ConnectorsPage(){const o=useConnectors(),{options:s}=useWalletKitContext();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Navbar,{}),jsxRuntimeExports.jsx(ModalHeader,{children:"Connect Wallet"}),jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-body wk-wallets",wallets),children:o==null?void 0:o.map(a=>jsxRuntimeExports.jsx(WalletOption,{connector:a},a.id))}),!s.hideNoWalletCTA&&jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-footer",footer),children:jsxRuntimeExports.jsxs(Link,{className:cx("wk-download-link",downloadLink),href:s.walletDownloadUrl,children:[jsxRuntimeExports.jsx(WalletIcon,{}),"I don’t have a wallet"]})})]})}var content$2="styles_content__xxja170";function Content(o){const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-content",content$2,s),...a})}const AlertIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 15",fill:"none",...o,children:[jsxRuntimeExports.jsx("path",{d:"M1.63937 12.5331L7.6704 2.47023C8.04617 1.84325 8.95383 1.84326 9.3296 2.47023L15.3606 12.5331C15.7475 13.1787 15.283 14 14.531 14H2.46897C1.71695 14 1.25246 13.1787 1.63937 12.5331Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M9.5 11.7231C9.5 12.2754 9.05228 12.7231 8.5 12.7231C7.94772 12.7231 7.5 12.2754 7.5 11.7231C7.5 11.1709 7.94772 10.7231 8.5 10.7231C9.05228 10.7231 9.5 11.1709 9.5 11.7231Z",fill:"currentColor"}),jsxRuntimeExports.jsx("path",{d:"M7.6684 5.65882C7.63842 5.15178 8.01942 4.72314 8.50008 4.72314C8.98075 4.72314 9.36174 5.15178 9.33176 5.65882L9.12831 9.09936C9.10757 9.44999 8.83247 9.72314 8.50008 9.72314C8.16769 9.72314 7.89259 9.44999 7.87186 9.09936L7.6684 5.65882Z",fill:"currentColor"})]});var errorTitle="styles_errorTitle__15jahvi0";function ErrorTitle(o){const{className:s,children:a,...rt}=o;return jsxRuntimeExports.jsxs(Box,{className:cx("wk-error-title",errorTitle,s),...rt,children:[jsxRuntimeExports.jsx(AlertIcon,{}),a]})}var description$1="styles_description__du4o10";function Description(o){const{className:s,...a}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-description",description$1,s),...a})}var infoTitle="styles_infoTitle__1k1e1vs0";function InfoTitle(o){const{className:s,children:a,...rt}=o;return jsxRuntimeExports.jsx(Box,{className:cx("wk-info-title",infoTitle,s),...rt,children:a})}function UnsupportedContent(){var s;const{selectedConnector:o}=useWalletKitContext();return typeof window<"u"&&((s=window.ethereum)!=null&&s.isTokenPocket)&&isMetaMaskConnector(o)?jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(ErrorTitle,{children:"Switch Wallet"}),jsxRuntimeExports.jsxs(Description,{children:["Please install the ",o==null?void 0:o._wallet.name," extension first, then switch the wallet manually in the corresponding extension, and refresh the page to log in."]})]}):jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(ErrorTitle,{children:"Unsupported Browser"}),jsxRuntimeExports.jsxs(Description,{children:["To continue, please install ",o==null?void 0:o._wallet.name," extension to your browser."]})]})}function CircleLoadingIcon(o){const{thickness:s,...a}=o,rt=cssVar("modalBackground"),ot=cssVar("primaryActive");return jsxRuntimeExports.jsxs("svg",{width:"52",height:"102",viewBox:"0 0 52 102",fill:"none",...a,children:[jsxRuntimeExports.jsx("path",{d:"M1 101C28.6142 101 51 78.6142 51 51C51 23.3858 28.6142 1 1 1",stroke:"url(#paint0_linear_1252_60553)",strokeWidth:s,strokeLinecap:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1252_60553",x1:"1",y1:"1",x2:"0.999999",y2:"101",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:rt}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:ot})]})})]})}var circleSpinner="styles_circleSpinner__zrc6g80",circleSpinnerInner="styles_circleSpinnerInner__zrc6g81",errorCircle="styles_errorCircle__zrc6g82",loading="styles_loading__zrc6g84";function CircleSpinner(o){const{className:s,isLoading:a=!1,isError:rt=!1,thickness:ot=2,children:tr,...Ut}=o;return jsxRuntimeExports.jsxs(Box,{className:cx("wk-circle-spinner",circleSpinner,s),...Ut,children:[jsxRuntimeExports.jsx(Box,{className:circleSpinnerInner,children:tr}),a&&jsxRuntimeExports.jsx(CircleLoadingIcon,{className:loading,thickness:ot}),rt&&jsxRuntimeExports.jsx(Box,{className:errorCircle})]})}const RefreshIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"24",height:"24",viewBox:"4 0 16 16",fill:"none",...o,children:[jsxRuntimeExports.jsx("g",{filter:"url(#filter0_d_1252_60835)",children:jsxRuntimeExports.jsx("circle",{cx:"12",cy:"8",r:"8",fill:"white"})}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.0606 7.15313L17.4251 4.09755L16.2902 3.96221L16.1688 4.98047C14.9544 3.30339 12.7897 2.46123 10.6705 3.02905C9.26479 3.40571 8.1519 4.32971 7.49968 5.51031C7.38574 5.7162 7.28498 5.93187 7.19881 6.15651C7.12849 6.33959 7.06849 6.52699 7.01932 6.71783C6.31348 9.44732 7.93882 12.2409 10.6676 12.9721C13.4111 13.7072 16.2311 12.0791 16.9662 9.33555L15.8623 9.03976C15.4796 10.4681 14.3704 11.5077 13.0388 11.8676L13.0368 11.8604C10.903 12.4321 8.70963 11.1658 8.13787 9.03195C7.5661 6.89808 8.83243 4.70474 10.9663 4.13297C11.6699 3.94444 12.38 3.95575 13.0362 4.13211M13.0362 4.13211C14.0054 4.39257 14.8573 5.01302 15.3977 5.88139L14.2429 5.93123L14.2921 7.07302L15.9276 7.00244L15.9258 7.01779L17.0606 7.15313",fill:"url(#paint0_linear_1252_60835)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("filter",{id:"filter0_d_1252_60835",x:"0",y:"0",width:"24",height:"24",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsxRuntimeExports.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"4"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"2"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1252_60835"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1252_60835",result:"shape"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1252_60835",x1:"13.1862",y1:"3.58419",x2:"10.8183",y2:"12.4204",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#1D1010"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#26282E",stopOpacity:"0.24"})]})]})]});var center="styles_center__1ttds3e1",content$1="styles_content__1ttds3e0",logoWrapper="styles_logoWrapper__1ttds3e2",refreshIconWrapper="styles_refreshIconWrapper__1ttds3e3";const states={CONNECTED:"connected",CONNECTING:"connecting",FAILED:"failed",REJECTED:"rejected",NOTCONNECTED:"notconnected",UNAVAILABLE:"unavailable"};function ConnectingPage(){const{selectedConnector:o,options:s,connectVariant:a,log:rt}=useWalletKitContext(),ot=useWalletConfig(o),[tr,Ut]=reactExports.useState(ot.installed?states.CONNECTING:states.UNAVAILABLE),{connect:rr}=useWalletKitConnect({onMutate:ir=>{ir.connector?Ut(states.CONNECTING):Ut(states.UNAVAILABLE)},onSettled(ir,sr){var ar;if(sr){if(sr.code)switch(sr.code){case-32002:Ut(states.NOTCONNECTED);break;case 4001:Ut(states.REJECTED);break;default:Ut(states.FAILED);break}else if(sr.message)switch(sr.message){case"User rejected request":Ut(states.REJECTED);break;default:Ut(states.FAILED);break}}else ir&&s.initialChainId&&ir.chain.id===s.initialChainId&&a==="add-network"&&((ar=s.onChainAlreadyAdded)==null||ar.call(s,o,s.initialChainId))}}),nr=reactExports.useCallback(()=>{ot.installed&&(o?rr({connector:o}):Ut(states.UNAVAILABLE))},[rr,o,ot.installed]);return reactExports.useEffect(()=>{if(tr===states.UNAVAILABLE)return;const ir=setTimeout(nr,600);return()=>{clearTimeout(ir)}},[]),rt("[Connect]",tr,o),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Navbar,{showBack:!0}),jsxRuntimeExports.jsx(ModalHeader,{children:ot==null?void 0:ot.name}),jsxRuntimeExports.jsxs(Box,{className:cx("wk-modal-body",content$1),children:[jsxRuntimeExports.jsx(Box,{className:center,children:jsxRuntimeExports.jsxs(CircleSpinner,{isLoading:tr===states.CONNECTING,isError:tr!==states.CONNECTING&&tr!==states.CONNECTED,children:[jsxRuntimeExports.jsx(Box,{className:logoWrapper,onClick:nr,children:ot.logos.default}),(tr===states.FAILED||tr===states.REJECTED)&&jsxRuntimeExports.jsx(Box,{className:refreshIconWrapper,onClick:nr,children:jsxRuntimeExports.jsx(RefreshIcon,{style:{position:"absolute",bottom:6,right:10,width:16,height:16}})})]})}),tr===states.FAILED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(ErrorTitle,{children:"Connection Failed"}),jsxRuntimeExports.jsx(Description,{children:"Sorry, something went wrong. Please try connecting again."})]}),tr===states.REJECTED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(InfoTitle,{children:"Request Cancelled"}),jsxRuntimeExports.jsx(Description,{children:"You cancelled the request. Click above to try again."})]}),tr===states.CONNECTING&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(InfoTitle,{children:"Requesting Connection"}),jsxRuntimeExports.jsxs(Description,{children:["Open the ",ot.name," browser extension to connect your wallet."]})]}),tr===states.CONNECTED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsx(InfoTitle,{children:"Already Connected"}),jsxRuntimeExports.jsx(Description,{children:"It is now okay to close this popup"})]}),tr===states.NOTCONNECTED&&jsxRuntimeExports.jsxs(Content,{children:[jsxRuntimeExports.jsxs(ErrorTitle,{children:["Login to ",ot.name]}),jsxRuntimeExports.jsxs(Description,{children:["To continue, please login to your ",ot.name," extension."]})]}),tr===states.UNAVAILABLE&&jsxRuntimeExports.jsx(UnsupportedContent,{})]})]})}const routes={CONNECTING:"Connecting",CONNECTORS:"Connectors"};function RouteProvider(o){const{children:s}=o,{onClose:a}=useWalletKitContext(),[rt,ot]=reactExports.useState(""),{current:tr}=reactExports.useRef([]),Ut=reactExports.useMemo(()=>{switch(rt){case routes.CONNECTING:return jsxRuntimeExports.jsx(ConnectingPage,{});case routes.CONNECTORS:return jsxRuntimeExports.jsx(ConnectorsPage,{})}return null},[rt]),rr=reactExports.useCallback(()=>{tr.pop();const ur=tr[tr.length-1];ur&&ot(ur)},[tr]),nr=reactExports.useCallback(ur=>{tr[tr.length-1]!==ur&&(tr.push(ur),ot(ur))},[tr]),ir=reactExports.useCallback(ur=>{tr[tr.length-1]!==ur&&(tr[tr.length-1]=ur,ot(ur))},[tr]),sr=reactExports.useMemo(()=>({route:rt,page:Ut,back:rr,push:nr,replace:ir}),[rr,Ut,nr,ir,rt]),{isConnected:ar}=useAccount();return reactExports.useEffect(()=>{ar&&a()},[ar,a]),jsxRuntimeExports.jsx(RouteContext.Provider,{value:sr,children:s})}function useOpenModal(){const{onOpen:o}=useWalletKitContext(),s=useRouter();return{onOpenModal:reactExports.useCallback(()=>{s.push(routes.CONNECTORS),o()},[o,s])}}var walletkitButton="styles_walletkitButton__1ahflwr0";const ConnectButton=React$1.forwardRef((o,s)=>{const{className:a,children:rt,variant:ot="default",onClick:tr,...Ut}=o,{setConnectVariant:rr}=useWalletKitContext(),{onOpenModal:nr}=useOpenModal(),ir=reactExports.useCallback(sr=>{rr(ot),nr(),tr==null||tr(sr)},[ot,tr,nr,rr]);return jsxRuntimeExports.jsx(Button,{ref:s,className:cx("wk-walletkit-button",walletkitButton,a),onClick:ir,...Ut,children:rt??"Connect Wallet"})});function useIsMounted(){const[o,s]=reactExports.useState(!1);return reactExports.useEffect(()=>{s(!0)},[]),o}function ConnectButtonRenderer(o){const{variant:s="default",children:a}=o,rt=useIsMounted(),{isOpen:ot,onClose:tr,setConnectVariant:Ut}=useWalletKitContext(),{onOpenModal:rr}=useOpenModal(),{chain:nr}=useNetwork(),{address:ir}=useAccount(),sr=reactExports.useCallback(()=>{Ut(s),rr()},[rr,Ut,s]);return!a||!rt?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a({show:sr,hide:tr,chain:nr,unsupported:!!(nr!=null&&nr.unsupported),isConnected:!!ir,isConnecting:ot,address:ir})})}ConnectButton.Custom=ConnectButtonRenderer;const WalletKitButton=ConnectButton;function useDisclosure(){const[o,s]=reactExports.useState(!1),a=reactExports.useCallback(()=>{s(!0)},[]),rt=reactExports.useCallback(()=>{s(!1)},[]);return{isOpen:o,onOpen:a,onClose:rt}}function useChains(){var s;const o=useConnectors();return(s=o==null?void 0:o[0])==null?void 0:s.chains}const ToastManager={listeners:[],toastList:[],autoIncreaseId:0,add(o){const s=this.autoIncreaseId++;return this.toastList.unshift({toastId:s,...o}),this.notify(),s},remove(o){const s=this.toastList.findIndex(a=>a.toastId===o);s>-1&&(this.toastList.splice(s,1),this.notify())},notify(){this.listeners.forEach(o=>{o([...this.toastList])})},subscribe(o){this.listeners.push(o)},unsubscribe(o){const s=this.listeners.findIndex(a=>a===o);s>-1&&this.listeners.splice(s,1)}},toast=o=>{const{variant:s="info",duration:a=3e3,...rt}=o;return ToastManager.add({variant:s,duration:a,...rt})};toast.info=o=>toast({variant:"info",...o});toast.error=o=>toast({variant:"error",...o});function getDefaultProviderOptions(o,s){var ot;const{...a}=o;return{initialChainId:(ot=s==null?void 0:s[0])==null?void 0:ot.id,hideNoWalletCTA:!1,walletDownloadUrl:"https://trustwallet.com/",onError,...a}}function onError(o,s){s&&toast.error({description:s})}const UnknownChainIcon=o=>jsxRuntimeExports.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",...o,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"black"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"black",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"black"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"black",stopOpacity:"0.7"})]})]})]});function BscIcon(o){return jsxRuntimeExports.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",...o,children:[jsxRuntimeExports.jsx("rect",{x:"0.5",y:"0.5",width:"27",height:"27",fill:"url(#BscIconPattern0)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsx("pattern",{id:"BscIconPattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:jsxRuntimeExports.jsx("use",{xlinkHref:"#image0_2258_278",transform:"translate(0.0514019) scale(0.00934579)"})}),jsxRuntimeExports.jsx("image",{id:"image0_2258_278",width:"96",height:"107",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABrCAYAAACIX4f7AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAk7SURBVHgB7Z1RWhpJEMerB/RzIfsFboAn2HgDfUjU7MPqCaInEE8gniB4gpgTJPuwMZoH3RPoniDcAPxWEjY49HY1DAIKTHdVz/Tk4/eUzyj2dLVdXf+qrgHIKLcXvxy0zotfb78UjiDDCMgYzS/P1iGUdSHgt5EvN6SA4/Kr9ilkjMwYoHlRfKEG+xYkrM/4toYMxH755d0VZATvDdD8UCoFhe6RBKjG/Rn113HaC8Pj8nanAZ7jrQH0xD/7cSClqKpVXwILsmAILw2gtpu9wXZjNfETNEQgT5+//HYMHuKVAdDBCimP5uzztnjpqL0wQPNspSJyuXeOJn4Srxx1qgawcbBc+OIfUjEAh4PlIm1DJG4A7WAlYPRaAX9oSNk7KW99r0PCJGYAxw6Wi8QdtXMDuHKw/a1DvFdPsCOEPABeGrIXbiSxLTkzgDMHK+BKhkLt2Q+nGDQyBLmaepg3wEgS/oHdAA4drFqV6vi4Pf34qP/agvwHAPkCGBEB1Hv34YkLQ7AaoHn+646A3lvgdLACWrKn9uWtdmwH2TxTjj5gd/RO/AObAbRaKUGtPqaHxokPxQl08vXybqsFFrAbQo8JDsvbfEbg34LOntVETjlFwvbDufdq/yDyVaqjVlvqCXzP12wXwzScOGFrp/iEg/VjTOG+K0fs9Bg6WH0qeyX/mPOtcx0s55hiOWqHi2H818REpwLv7xs2K2HqXmzhYCfHZCuqzRyT5T6PJ0AohOvlzX8/xv2ZuQaYiGBJ2vrwoQWUKA52Ii9MOp00PxWrIgcH5DGN5zBij2mqAebsmdYPrT+3s9KyfMhZeWFrmZk0ppkSi/woe73DWbvGIwMYBlINef9jt/x79wYcYhJVJ6Vumkgss8Y0ZgC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bMwQMosDJAy/hlgZaXFXmGtHCyE4RV4iJEcnSQc7+mChN5zRsFbA0RYZeSI6ckk8d4AiMl7uijvOUuDTBggYmZGjtDZME0yZYCI0dIZSv3PAiLYJAoyzv89tWhmDg3RawAAAABJRU5ErkJggg=="})]})]})}function ComboIcon(o){return jsxRuntimeExports.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",...o,children:[jsxRuntimeExports.jsx("rect",{width:"26",height:"26",fill:"url(#ComboIconPattern0)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsx("pattern",{id:"ComboIconPattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:jsxRuntimeExports.jsx("use",{xlinkHref:"#image0_1252_60936",transform:"translate(0 0.066875) scale(0.00125)"})}),jsxRuntimeExports.jsx("image",{id:"image0_1252_60936",width:"800",height:"693",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAK1CAYAAAAwrIosAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAGuXSURBVHgB7d3Jc1zXle/7dTIBEGBnybd8x766I0VREZLvP0BZUk1EqEzfkUKlsKg/4KkZlCQPrij/ASW6pi/iSfYzx9IzbauiHFFkDe7I8UzqhchQj5RFCQRBgGgTTZ48+511EgmCIJpsTrOb7yeKBTWkbFPIzL3OWuu3IwGwrz/+LX5J2vJe9KO6RGMCAEBfzO3EtGc3fzr5xMQVAZCpCYB9RWPR22YhkeSLliTftcVsCgAAPUmLD0lm21Ek9f8lALZRgAD7+Khl3jYryY+7f04hAgDo1Vbx0f3T07+/uvEzAZCJBMADPlozP07L88vtL+IfS8s8+BNGI6k9HImOZgEAsNOu4qPz10SmYhn9ydknogUBAkcHBNiDqcl5s2H2Lj5U+teT9AOm/XmcdUYAAFB7FR8qfeL730aSzVcFAB0QYLes+1GXqWzk6rt2b79IOyL/tSbRQ9T0ABCq/YqPHe62ZPQRui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MbxA6tLFG/+Rfnnyvr+4vJo+myro0in90NJ//soKRQcAuO7YsUE658TuIlh0QADRF0LyYBekXsDLg44HAPhnsFQsYncRLAoQIPXsC6eupcXBhfv+Yp5jWBQeAOCv/kextPtxXoBAUYAAW+K49Y4Yc3f7L9RyWESn8ACAMGgBovG8PdDYXbofCBkFCLBFF9IjMfeiEIdJwqLwAIDw6CiWOfT9nthdBI8ldGCXSxev/zV9aTyRfYgsr0jf9NdQdABAmMbGRMbH9/u7Jut+vPkUt54jaHRAgN2SrYX0KOr86NVqs9PxWFii+ACAUOkN6XG8399t0P0AKECAB0y++NiV9MsH2Z/UeniJdAuP+YX0Q6e3+V8AgMfW1/caxTJikt9w6SBAAQLsKa5Fr6cfHgsHRvGub1B4AAAetHcqVmPyrWfeEQAUIMBezj7/aCMx8us9OyBaeNy+IzI7R+EBANjb/aNYxO4CO1CAAPtI4s0L6SfG1PZf2Fl4bGwKAAAH2h7FMleI3QXuIQULOMCl//Mvp2Vl7T+yVCuKDgBAv8bGTHzk6H9n9wO45/8Hi/dXXGlvAp0AAAAASUVORK5CYII="})]})]})}const chainsConfig=[{id:56,name:"BNB Smart Chain",logo:jsxRuntimeExports.jsx(BscIcon,{})},{id:97,name:"BNB Smart Chain Testnet",logo:jsxRuntimeExports.jsx(BscIcon,{})},{id:91715,name:"Combo Testnet",logo:jsxRuntimeExports.jsx(ComboIcon,{})}];function getSupportedChains(){return chainsConfig}function getDefaultSupportedChains(o,s){const a=mergeList(getSupportedChains(),o.chainsConfig);return s.map(ot=>{const tr=a.find(Ut=>Ut.id===ot.id);return{id:ot.id,name:ot.name??(tr==null?void 0:tr.name),logo:(tr==null?void 0:tr.logo)??jsxRuntimeExports.jsx(UnknownChainIcon,{})}})}const Portal=o=>{const{children:s}=o,a=reactExports.useRef(),[,rt]=reactExports.useState({});return reactExports.useEffect(()=>{const ot=document.body;a.current=document.createElement("div"),a.current.setAttribute("class","wk-portal"),ot.appendChild(a.current),rt({});const tr=a.current;return()=>{ot.contains(tr)&&ot.removeChild(tr)}},[]),a.current?reactDomExports.createPortal(s,a.current):null};Portal.displayName="Portal";var fadeIn="fade_fadeIn__lawij72",fadeOut="fade_fadeOut__lawij73",toastSlideIn="toastSlide_toastSlideIn__hem89h2",toastSlideOut="toastSlide_toastSlideOut__hem89h3";const animationMap={fade:[fadeOut,fadeIn],"toast-slide":[toastSlideOut,toastSlideIn]},Animation=o=>{const{in:s,children:a,variant:rt="fade",onExit:ot}=o,{className:tr,onAnimationEnd:Ut,...rr}=a.props,[nr,ir]=reactExports.useState(s);reactExports.useEffect(()=>{s&&ir(!0)},[s]);const sr=ar=>{Ut==null||Ut(ar),s||(ot==null||ot(),ir(!1))};return nr?React$1.cloneElement(a,{className:cx(animationMap[rt][Number(s)],tr),onAnimationEnd:sr,...rr}):null};function useKeyDown(o={}){const{key:s="Enter",enabled:a=!0,handler:rt}=o;reactExports.useEffect(()=>{if(!a)return;const ot=tr=>{tr.code===s&&(rt==null||rt())};return window.addEventListener("keydown",ot),()=>{window.removeEventListener("keydown",ot)}},[a,rt,s])}function Modal(o){const{className:s,isOpen:a,onClose:rt,children:ot,contentClassName:tr,closeOnEsc:Ut=!0,closeOnOverlayClick:rr=!0,...nr}=o;return useKeyDown({key:"Escape",enabled:a&&Ut,handler(){rt()}}),jsxRuntimeExports.jsx(Portal,{children:jsxRuntimeExports.jsx(Animation,{in:a,variant:"fade",children:jsxRuntimeExports.jsxs(Box,{className:cx("wk-modal",modal,s),...nr,children:[jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-overlay",modalOverlay),onClick:()=>rr&&rt()}),jsxRuntimeExports.jsx(Box,{className:cx("wk-modal-content",modalContent,tr),children:ot})]})})})}function WalletKitModal(){const{isOpen:o,onClose:s}=useWalletKitContext(),{page:a}=useRouter();return useIsMounted()?jsxRuntimeExports.jsx(Modal,{className:"wk-walletkit-modal",isOpen:o,onClose:s,children:a}):null}const radii={common:"8px",modal:"12px",connectButton:"var(--wk-radii-common)",disconnectButton:"var(--wk-radii-common)",walletOption:"var(--wk-radii-common)",walletOptionIcon:"var(--wk-radii-common)",chainOption:"var(--wk-radii-common)",toast:"var(--wk-radii-common)"},base={light:{colors:{text:"#1e2026",textSecondary:"#76808F",primary:"#9B00FB",primaryActive:"#B845FF",warning:"#F5B631",error:"#FC6E75",border:"#E6E8EA",modalBackground:"#FFFFFF",modalOverlay:"rgba(0, 0, 0, 0.5)",optionText:"#1e2026",optionTextHover:"#1e2026",optionBackground:"#f5f5f5",optionBackgroundHover:rgba("#B845FF",.1),connectButtonText:"#fff",connectButtonTextHover:"#fff",connectButtonBackground:"var(--wk-colors-primary)",connectButtonBackgroundHover:"var(--wk-colors-primaryActive)",walletOptionText:"var(--wk-colors-optionText)",walletOptionTextHover:"var(--wk-colors-optionTextHover)",walletOptionBackground:"var(--wk-colors-optionBackground)",walletOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",chainOptionText:"var(--wk-colors-optionText)",chainOptionTextHover:"var(--wk-colors-optionTextHover)",chainOptionBackground:"var(--wk-colors-optionBackground)",chainOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",closeButtonText:"var(--wk-colors-textSecondary)",closeButtonBackgroundHover:"var(--wk-colors-border)",disconnectButtonBackgroundText:"#fff",disconnectButtonBackgroundTextHover:"#fff",disconnectButtonBackground:"var(--wk-colors-primary)",disconnectButtonBackgroundHover:"var(--wk-colors-primaryActive)",toastBackground:"var(--wk-colors-modalBackground)"},shadows:{toast:"0px 4px 24px rgba(0, 0, 0, 0.08)"},radii},dark:{colors:{text:"#FFF",textSecondary:"#76808F",primary:"#9B00FB",primaryActive:"#B845FF",warning:"#F5B631",error:"#FC6E75",border:"#2e323a",modalBackground:"#1E2026",modalOverlay:rgba("#000",.5),optionText:"#FFF",optionTextHover:"#FFF",optionBackground:"#14151a",optionBackgroundHover:rgba("#B845FF",.1),connectButtonText:"#fff",connectButtonTextHover:"#fff",connectButtonBackground:"var(--wk-colors-primary)",connectButtonBackgroundHover:"var(--wk-colors-primaryActive)",walletOptionText:"var(--wk-colors-optionText)",walletOptionTextHover:"var(--wk-colors-optionTextHover)",walletOptionBackground:"var(--wk-colors-optionBackground)",walletOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",chainOptionText:"var(--wk-colors-optionText)",chainOptionTextHover:"var(--wk-colors-optionTextHover)",chainOptionBackground:"var(--wk-colors-optionBackground)",chainOptionBackgroundHover:"var(--wk-colors-optionBackgroundHover)",closeButtonText:"var(--wk-colors-textSecondary)",closeButtonBackgroundHover:"var(--wk-colors-border)",disconnectButtonBackgroundText:"#fff",disconnectButtonBackgroundTextHover:"#fff",disconnectButtonBackground:"var(--wk-colors-primary)",disconnectButtonBackgroundHover:"var(--wk-colors-primaryActive)",toastBackground:"var(--wk-colors-modalBackground)"},shadows:{toast:"0px 4px 24px rgba(0, 0, 0, 0.08)"},radii}},themeMap={base};function ThemeProvider(o){const{variant:s,mode:a,customTheme:rt,children:ot}=o,tr=reactExports.useMemo(()=>{const Ut=themeMap[s],rr=deepMerge(Ut.light??Ut,(rt==null?void 0:rt.light)??rt),nr=deepMerge(Ut.dark??Ut,(rt==null?void 0:rt.dark)??rt),ir=createCssVars(rr,"--wk-light"),sr=createCssVars(nr,"--wk-dark"),ar=createPointer(ir),ur=createPointer(sr),cr=createStyleContent(ir),lr=createStyleContent(sr),hr=createStyleContent(ar),gr=createStyleContent(ur);return a==="light"?`body { ${hr}; ${cr}; }`:a==="dark"?`body { diff --git a/website/dist/assets/index.es-e7c93c26.js b/website/dist/assets/index.es-fd9b4c72.js similarity index 99% rename from website/dist/assets/index.es-e7c93c26.js rename to website/dist/assets/index.es-fd9b4c72.js index c91683a5..4215c296 100644 --- a/website/dist/assets/index.es-e7c93c26.js +++ b/website/dist/assets/index.es-fd9b4c72.js @@ -1,4 +1,4 @@ -import{e as ur,r as bi,f as o1,h as se,i as Sr,j as a1,w as ql,k as Ml,m as yc,t as yo,o as c1,p as jl,q as wi,D as u1,s as h1,N as Z,u as l1,v as cc,x as f1,V as p1,R as d1,F as Rh,K as g1,y as y1,L as v1,z as Ch,$ as m1,A as w1,B as Qs,Z as Oh,J as _1,X as b1,C as vc,_ as Ul,E as Fr,G as E1,H as x1,I as us,M as Ft,U as er,O as mi,P as cr,Q as I1,S as hs,T as zl,W as P1,Y as S1,a0 as A1,a1 as kl,a2 as R1,a3 as Hl,a4 as Bl,a5 as fs,a6 as uc,a7 as uo,a8 as ds,a9 as C1,aa as ho,ab as O1,ac as T1,ad as N1,ae as no,af as F1,ag as D1,ah as Ka,ai as Th,aj as L1,ak as $1,al as q1,am as Nh,an as M1,ao as j1,ap as U1,aq as z1,ar as k1,as as H1,at as B1,au as Ks,av as Vl,aw as Ga,ax as V1,ay as K1,az as G1}from"./index-5090a415.js";var vo={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});function W1(u){if(typeof u!="string")throw new Error(`Cannot safe json parse value of type ${typeof u}`);try{return JSON.parse(u)}catch{return u}}Xs.safeJsonParse=W1;function J1(u){return typeof u=="string"?u:JSON.stringify(u,(i,r)=>typeof r>"u"?null:r)}Xs.safeJsonStringify=J1;var $s={exports:{}},Fh;function Q1(){return Fh||(Fh=1,function(){let u;function i(){}u=i,u.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},u.prototype.setItem=function(r,n){this[r]=String(n)},u.prototype.removeItem=function(r){delete this[r]},u.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},u.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},u.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof ur<"u"&&ur.localStorage?$s.exports=ur.localStorage:typeof window<"u"&&window.localStorage?$s.exports=window.localStorage:$s.exports=new i}()),$s.exports}var Wa={},qs={},Dh;function Y1(){if(Dh)return qs;Dh=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.IKeyValueStorage=void 0;class u{}return qs.IKeyValueStorage=u,qs}var Ms={},Lh;function X1(){if(Lh)return Ms;Lh=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.parseEntry=void 0;const u=Xs;function i(r){var n;return[r[0],u.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Ms.parseEntry=i,Ms}var $h;function Z1(){return $h||($h=1,function(u){Object.defineProperty(u,"__esModule",{value:!0});const i=bi;i.__exportStar(Y1(),u),i.__exportStar(X1(),u)}(Wa)),Wa}Object.defineProperty(vo,"__esModule",{value:!0});vo.KeyValueStorage=void 0;const ls=bi,qh=Xs,em=ls.__importDefault(Q1()),tm=Z1();class Kl{constructor(){this.localStorage=em.default}getKeys(){return ls.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return ls.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(tm.parseEntry)})}getItem(i){return ls.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(i);if(r!==null)return qh.safeJsonParse(r)})}setItem(i,r){return ls.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(i,qh.safeJsonStringify(r))})}removeItem(i){return ls.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(i)})}}vo.KeyValueStorage=Kl;var rm=vo.default=Kl,gs={},js={},Ja={},Us={};let Ui=class{};const im=Object.freeze(Object.defineProperty({__proto__:null,IEvents:Ui},Symbol.toStringTag,{value:"Module"})),sm=o1(im);var Mh;function nm(){if(Mh)return Us;Mh=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.IHeartBeat=void 0;const u=sm;class i extends u.IEvents{constructor(n){super()}}return Us.IHeartBeat=i,Us}var jh;function Gl(){return jh||(jh=1,function(u){Object.defineProperty(u,"__esModule",{value:!0}),bi.__exportStar(nm(),u)}(Ja)),Ja}var Qa={},Mi={},Uh;function om(){if(Uh)return Mi;Uh=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.HEARTBEAT_EVENTS=Mi.HEARTBEAT_INTERVAL=void 0;const u=se;return Mi.HEARTBEAT_INTERVAL=u.FIVE_SECONDS,Mi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Mi}var zh;function Wl(){return zh||(zh=1,function(u){Object.defineProperty(u,"__esModule",{value:!0}),bi.__exportStar(om(),u)}(Qa)),Qa}var kh;function am(){if(kh)return js;kh=1,Object.defineProperty(js,"__esModule",{value:!0}),js.HeartBeat=void 0;const u=bi,i=Sr,r=se,n=Gl(),o=Wl();class h extends n.IHeartBeat{constructor(v){super(v),this.events=new i.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=(v==null?void 0:v.interval)||o.HEARTBEAT_INTERVAL}static init(v){return u.__awaiter(this,void 0,void 0,function*(){const _=new h(v);return yield _.init(),_})}init(){return u.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(v,_){this.events.on(v,_)}once(v,_){this.events.once(v,_)}off(v,_){this.events.off(v,_)}removeListener(v,_){this.events.removeListener(v,_)}initialize(){return u.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return js.HeartBeat=h,js}(function(u){Object.defineProperty(u,"__esModule",{value:!0});const i=bi;i.__exportStar(am(),u),i.__exportStar(Gl(),u),i.__exportStar(Wl(),u)})(gs);var Oe={},Ya,Hh;function cm(){if(Hh)return Ya;Hh=1;function u(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}Ya=i;function i(r,n,o){var h=o&&o.stringify||u,d=1;if(typeof r=="object"&&r!==null){var v=n.length+d;if(v===1)return r;var _=new Array(v);_[0]=h(r);for(var S=1;S-1?K:0,r.charCodeAt(W+1)){case 100:case 102:if(B>=F||n[B]==null)break;K=F||n[B]==null)break;K=F||n[B]===void 0)break;K",K=W+2,W++;break}k+=h(n[B]),K=W+2,W++;break;case 115:if(B>=F)break;K-1&&(ue=!1);const Te=["error","fatal","warn","info","debug","trace"];typeof G=="function"&&(G.error=G.fatal=G.warn=G.info=G.debug=G.trace=G),T.enabled===!1&&(T.level="silent");const Ue=T.level||"info",y=Object.create(G);y.log||(y.log=ie),Object.defineProperty(y,"levelVal",{get:Y}),Object.defineProperty(y,"level",{get:ce,set:H});const E={transmit:M,serialize:re,asObject:T.browser.asObject,levels:Te,timestamp:K(T)};y.levels=o.levels,y.level=Ue,y.setMaxListeners=y.getMaxListeners=y.emit=y.addListener=y.on=y.prependListener=y.once=y.prependOnceListener=y.removeListener=y.removeAllListeners=y.listeners=y.listenerCount=y.eventNames=y.write=y.flush=ie,y.serializers=ye,y._serialize=re,y._stdErrSerialize=ue,y.child=j,M&&(y._logEvent=k());function Y(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ce(){return this._level}function H(z){if(z!=="silent"&&!this.levels.values[z])throw Error("unknown level "+z);this._level=z,h(E,y,"error","log"),h(E,y,"fatal","error"),h(E,y,"warn","error"),h(E,y,"info","log"),h(E,y,"debug","log"),h(E,y,"trace","log")}function j(z,V){if(!z)throw new Error("missing bindings for child Pino");V=V||{},re&&z.serializers&&(V.serializers=z.serializers);const Je=V.serializers;if(re&&Je){var He=Object.assign({},ye,Je),Lr=T.browser.serialize===!0?Object.keys(He):re;delete z.serializers,_([z],Lr,He,this._stdErrSerialize)}function xe(xt){this._childLevel=(xt._childLevel|0)+1,this.error=S(xt,z,"error"),this.fatal=S(xt,z,"fatal"),this.warn=S(xt,z,"warn"),this.info=S(xt,z,"info"),this.debug=S(xt,z,"debug"),this.trace=S(xt,z,"trace"),He&&(this.serializers=He,this._serialize=Lr),M&&(this._logEvent=k([].concat(xt._logEvent.bindings,z)))}return xe.prototype=this,new xe(this)}return y}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers=r,o.stdTimeFunctions=Object.assign({},{nullTime:Ee,epochTime:ge,unixTime:pe,isoTime:he});function h(T,M,G,ye){const re=Object.getPrototypeOf(M);M[G]=M.levelVal>M.levels.values[G]?ie:re[G]?re[G]:i[G]||i[ye]||ie,d(T,M,G)}function d(T,M,G){!T.transmit&&M[G]===ie||(M[G]=function(ye){return function(){const ue=T.timestamp(),Te=new Array(arguments.length),Ue=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var y=0;y-1&&ue in G&&(T[re][ue]=G[ue](T[re][ue]))}function S(T,M,G){return function(){const ye=new Array(1+arguments.length);ye[0]=M;for(var re=1;re"u"?S=r(v,_):S=v.bindings().context||"",S}Zt.getLoggerContext=o;function h(v,_,S=u.PINO_CUSTOM_CONTEXT_KEY){const F=o(v,S);return F.trim()?`${F}/${_}`:_}Zt.formatChildLoggerContext=h;function d(v,_,S=u.PINO_CUSTOM_CONTEXT_KEY){const F=h(v,_,S),k=v.child({context:F});return n(k,F,S)}return Zt.generateChildLogger=d,Zt}(function(u){Object.defineProperty(u,"__esModule",{value:!0}),u.pino=void 0;const i=bi,r=i.__importDefault(um());Object.defineProperty(u,"pino",{enumerable:!0,get:function(){return r.default}}),i.__exportStar(Jl(),u),i.__exportStar(hm(),u)})(Oe);class lm extends Ui{constructor(i){super(),this.opts=i,this.protocol="wc",this.version=2}}class fm extends Ui{constructor(i,r){super(),this.core=i,this.logger=r,this.records=new Map}}class pm{constructor(i,r){this.logger=i,this.core=r}}let dm=class extends Ui{constructor(i,r){super(),this.relayer=i,this.logger=r}},gm=class extends Ui{constructor(i){super()}},ym=class{constructor(i,r,n,o){this.core=i,this.logger=r,this.name=n}};class vm extends Ui{constructor(i,r){super(),this.relayer=i,this.logger=r}}let mm=class extends Ui{constructor(i,r){super(),this.core=i,this.logger=r}},wm=class{constructor(i,r){this.projectId=i,this.logger=r}},_m=class{constructor(i){this.opts=i,this.protocol="wc",this.version=2}},bm=class{constructor(i){this.client=i}};const Em=u=>JSON.stringify(u,(i,r)=>typeof r=="bigint"?r.toString()+"n":r),xm=u=>{const i=/([\[:])?(\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,r=u.replace(i,'$1"$2n"$3');return JSON.parse(r,(n,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function mc(u){if(typeof u!="string")throw new Error(`Cannot safe json parse value of type ${typeof u}`);try{return xm(u)}catch{return u}}function Ys(u){return typeof u=="string"?u:Em(u)||""}var wc={},Ql={};(function(u){Object.defineProperty(u,"__esModule",{value:!0});var i=a1,r=ql;u.DIGEST_LENGTH=64,u.BLOCK_SIZE=128;var n=function(){function v(){this.digestLength=u.DIGEST_LENGTH,this.blockSize=u.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},v.prototype.update=function(_,S){if(S===void 0&&(S=_.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var F=0;if(this._bytesHashed+=S,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=_[F++],S--;this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(S>=this.blockSize&&(F=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,_,F,S),S%=this.blockSize);S>0;)this._buffer[this._bufferLength++]=_[F++],S--;return this},v.prototype.finish=function(_){if(!this._finished){var S=this._bytesHashed,F=this._bufferLength,k=S/536870912|0,B=S<<3,K=S%128<112?128:256;this._buffer[F]=128;for(var q=F+1;q0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(_){return this._stateHi.set(_.stateHi),this._stateLo.set(_.stateLo),this._bufferLength=_.bufferLength,_.buffer&&this._buffer.set(_.buffer),this._bytesHashed=_.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(_){r.wipe(_.stateHi),r.wipe(_.stateLo),_.buffer&&r.wipe(_.buffer),_.bufferLength=0,_.bytesHashed=0},v}();u.SHA512=n;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function h(v,_,S,F,k,B,K){for(var q=S[0],W=S[1],ie=S[2],Ee=S[3],ge=S[4],pe=S[5],he=S[6],le=S[7],T=F[0],M=F[1],G=F[2],ye=F[3],re=F[4],ue=F[5],Te=F[6],Ue=F[7],y,E,Y,ce,H,j,z,V;K>=128;){for(var Je=0;Je<16;Je++){var He=8*Je+B;v[Je]=i.readUint32BE(k,He),_[Je]=i.readUint32BE(k,He+4)}for(var Je=0;Je<80;Je++){var Lr=q,xe=W,xt=ie,O=Ee,C=ge,A=pe,c=he,b=le,ee=T,fe=M,_e=G,Ne=ye,De=re,Se=ue,It=Te,vt=Ue;if(y=le,E=Ue,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=(ge>>>14|re<<32-14)^(ge>>>18|re<<32-18)^(re>>>41-32|ge<<32-(41-32)),E=(re>>>14|ge<<32-14)^(re>>>18|ge<<32-18)^(ge>>>41-32|re<<32-(41-32)),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=ge&pe^~ge&he,E=re&ue^~re&Te,H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=o[Je*2],E=o[Je*2+1],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=v[Je%16],E=_[Je%16],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,Y=z&65535|V<<16,ce=H&65535|j<<16,y=Y,E=ce,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=(q>>>28|T<<32-28)^(T>>>34-32|q<<32-(34-32))^(T>>>39-32|q<<32-(39-32)),E=(T>>>28|q<<32-28)^(q>>>34-32|T<<32-(34-32))^(q>>>39-32|T<<32-(39-32)),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=q&W^q&ie^W&ie,E=T&M^T&G^M&G,H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,b=z&65535|V<<16,vt=H&65535|j<<16,y=O,E=Ne,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=Y,E=ce,H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,O=z&65535|V<<16,Ne=H&65535|j<<16,W=Lr,ie=xe,Ee=xt,ge=O,pe=C,he=A,le=c,q=b,M=ee,G=fe,ye=_e,re=Ne,ue=De,Te=Se,Ue=It,T=vt,Je%16===15)for(var He=0;He<16;He++)y=v[He],E=_[He],H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=v[(He+9)%16],E=_[(He+9)%16],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,Y=v[(He+1)%16],ce=_[(He+1)%16],y=(Y>>>1|ce<<32-1)^(Y>>>8|ce<<32-8)^Y>>>7,E=(ce>>>1|Y<<32-1)^(ce>>>8|Y<<32-8)^(ce>>>7|Y<<32-7),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,Y=v[(He+14)%16],ce=_[(He+14)%16],y=(Y>>>19|ce<<32-19)^(ce>>>61-32|Y<<32-(61-32))^Y>>>6,E=(ce>>>19|Y<<32-19)^(Y>>>61-32|ce<<32-(61-32))^(ce>>>6|Y<<32-6),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,v[He]=z&65535|V<<16,_[He]=H&65535|j<<16}y=q,E=T,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[0],E=F[0],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[0]=q=z&65535|V<<16,F[0]=T=H&65535|j<<16,y=W,E=M,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[1],E=F[1],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[1]=W=z&65535|V<<16,F[1]=M=H&65535|j<<16,y=ie,E=G,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[2],E=F[2],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[2]=ie=z&65535|V<<16,F[2]=G=H&65535|j<<16,y=Ee,E=ye,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[3],E=F[3],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[3]=Ee=z&65535|V<<16,F[3]=ye=H&65535|j<<16,y=ge,E=re,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[4],E=F[4],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[4]=ge=z&65535|V<<16,F[4]=re=H&65535|j<<16,y=pe,E=ue,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[5],E=F[5],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[5]=pe=z&65535|V<<16,F[5]=ue=H&65535|j<<16,y=he,E=Te,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[6],E=F[6],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[6]=he=z&65535|V<<16,F[6]=Te=H&65535|j<<16,y=le,E=Ue,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[7],E=F[7],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[7]=le=z&65535|V<<16,F[7]=Ue=H&65535|j<<16,B+=128,K-=128}return B}function d(v){var _=new n;_.update(v);var S=_.digest();return _.clean(),S}u.hash=d})(Ql);(function(u){Object.defineProperty(u,"__esModule",{value:!0}),u.convertSecretKeyToX25519=u.convertPublicKeyToX25519=u.verify=u.sign=u.extractPublicKeyFromSecretKey=u.generateKeyPair=u.generateKeyPairFromSeed=u.SEED_LENGTH=u.SECRET_KEY_LENGTH=u.PUBLIC_KEY_LENGTH=u.SIGNATURE_LENGTH=void 0;const i=Ml,r=Ql,n=ql;u.SIGNATURE_LENGTH=64,u.PUBLIC_KEY_LENGTH=32,u.SECRET_KEY_LENGTH=64,u.SEED_LENGTH=32;function o(O){const C=new Float64Array(16);if(O)for(let A=0;A>16&1),A[fe-1]&=65535;A[15]=c[15]-32767-(A[14]>>16&1);const ee=A[15]>>16&1;A[14]&=65535,W(c,A,1-ee)}for(let b=0;b<16;b++)O[2*b]=c[b]&255,O[2*b+1]=c[b]>>8}function Ee(O,C){let A=0;for(let c=0;c<32;c++)A|=O[c]^C[c];return(1&A-1>>>8)-1}function ge(O,C){const A=new Uint8Array(32),c=new Uint8Array(32);return ie(A,O),ie(c,C),Ee(A,c)}function pe(O){const C=new Uint8Array(32);return ie(C,O),C[0]&1}function he(O,C){for(let A=0;A<16;A++)O[A]=C[2*A]+(C[2*A+1]<<8);O[15]&=32767}function le(O,C,A){for(let c=0;c<16;c++)O[c]=C[c]+A[c]}function T(O,C,A){for(let c=0;c<16;c++)O[c]=C[c]-A[c]}function M(O,C,A){let c,b,ee=0,fe=0,_e=0,Ne=0,De=0,Se=0,It=0,vt=0,nt=0,$e=0,Ye=0,Xe=0,ot=0,ze=0,Ze=0,Fe=0,Be=0,ut=0,Me=0,Pt=0,Dt=0,Ut=0,zt=0,qt=0,Gt=0,tr=0,$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=c*at,ut+=c*it,Me+=c*St,Pt+=c*At,Dt+=c*pt,Ut+=c*Rt,zt+=c*dt,qt+=c*mt,Gt+=c*gt,tr+=c*Qe,$r+=c*Ct,Wt+=c*Ot,c=C[13],ze+=c*ht,Ze+=c*rt,Fe+=c*lt,Be+=c*ft,ut+=c*at,Me+=c*it,Pt+=c*St,Dt+=c*At,Ut+=c*pt,zt+=c*Rt,qt+=c*dt,Gt+=c*mt,tr+=c*gt,$r+=c*Qe,Wt+=c*Ct,Br+=c*Ot,c=C[14],Ze+=c*ht,Fe+=c*rt,Be+=c*lt,ut+=c*ft,Me+=c*at,Pt+=c*it,Dt+=c*St,Ut+=c*At,zt+=c*pt,qt+=c*Rt,Gt+=c*dt,tr+=c*mt,$r+=c*gt,Wt+=c*Qe,Br+=c*Ct,ai+=c*Ot,c=C[15],Fe+=c*ht,Be+=c*rt,ut+=c*lt,Me+=c*ft,Pt+=c*at,Dt+=c*it,Ut+=c*St,zt+=c*At,qt+=c*pt,Gt+=c*Rt,tr+=c*dt,$r+=c*mt,Wt+=c*gt,Br+=c*Qe,ai+=c*Ct,Ii+=c*Ot,ee+=38*Be,fe+=38*ut,_e+=38*Me,Ne+=38*Pt,De+=38*Dt,Se+=38*Ut,It+=38*zt,vt+=38*qt,nt+=38*Gt,$e+=38*tr,Ye+=38*$r,Xe+=38*Wt,ot+=38*Br,ze+=38*ai,Ze+=38*Ii,b=1,c=ee+b+65535,b=Math.floor(c/65536),ee=c-b*65536,c=fe+b+65535,b=Math.floor(c/65536),fe=c-b*65536,c=_e+b+65535,b=Math.floor(c/65536),_e=c-b*65536,c=Ne+b+65535,b=Math.floor(c/65536),Ne=c-b*65536,c=De+b+65535,b=Math.floor(c/65536),De=c-b*65536,c=Se+b+65535,b=Math.floor(c/65536),Se=c-b*65536,c=It+b+65535,b=Math.floor(c/65536),It=c-b*65536,c=vt+b+65535,b=Math.floor(c/65536),vt=c-b*65536,c=nt+b+65535,b=Math.floor(c/65536),nt=c-b*65536,c=$e+b+65535,b=Math.floor(c/65536),$e=c-b*65536,c=Ye+b+65535,b=Math.floor(c/65536),Ye=c-b*65536,c=Xe+b+65535,b=Math.floor(c/65536),Xe=c-b*65536,c=ot+b+65535,b=Math.floor(c/65536),ot=c-b*65536,c=ze+b+65535,b=Math.floor(c/65536),ze=c-b*65536,c=Ze+b+65535,b=Math.floor(c/65536),Ze=c-b*65536,c=Fe+b+65535,b=Math.floor(c/65536),Fe=c-b*65536,ee+=b-1+37*(b-1),b=1,c=ee+b+65535,b=Math.floor(c/65536),ee=c-b*65536,c=fe+b+65535,b=Math.floor(c/65536),fe=c-b*65536,c=_e+b+65535,b=Math.floor(c/65536),_e=c-b*65536,c=Ne+b+65535,b=Math.floor(c/65536),Ne=c-b*65536,c=De+b+65535,b=Math.floor(c/65536),De=c-b*65536,c=Se+b+65535,b=Math.floor(c/65536),Se=c-b*65536,c=It+b+65535,b=Math.floor(c/65536),It=c-b*65536,c=vt+b+65535,b=Math.floor(c/65536),vt=c-b*65536,c=nt+b+65535,b=Math.floor(c/65536),nt=c-b*65536,c=$e+b+65535,b=Math.floor(c/65536),$e=c-b*65536,c=Ye+b+65535,b=Math.floor(c/65536),Ye=c-b*65536,c=Xe+b+65535,b=Math.floor(c/65536),Xe=c-b*65536,c=ot+b+65535,b=Math.floor(c/65536),ot=c-b*65536,c=ze+b+65535,b=Math.floor(c/65536),ze=c-b*65536,c=Ze+b+65535,b=Math.floor(c/65536),Ze=c-b*65536,c=Fe+b+65535,b=Math.floor(c/65536),Fe=c-b*65536,ee+=b-1+37*(b-1),O[0]=ee,O[1]=fe,O[2]=_e,O[3]=Ne,O[4]=De,O[5]=Se,O[6]=It,O[7]=vt,O[8]=nt,O[9]=$e,O[10]=Ye,O[11]=Xe,O[12]=ot,O[13]=ze,O[14]=Ze,O[15]=Fe}function G(O,C){M(O,C,C)}function ye(O,C){const A=o();let c;for(c=0;c<16;c++)A[c]=C[c];for(c=253;c>=0;c--)G(A,A),c!==2&&c!==4&&M(A,A,C);for(c=0;c<16;c++)O[c]=A[c]}function re(O,C){const A=o();let c;for(c=0;c<16;c++)A[c]=C[c];for(c=250;c>=0;c--)G(A,A),c!==1&&M(A,A,C);for(c=0;c<16;c++)O[c]=A[c]}function ue(O,C){const A=o(),c=o(),b=o(),ee=o(),fe=o(),_e=o(),Ne=o(),De=o(),Se=o();T(A,O[1],O[0]),T(Se,C[1],C[0]),M(A,A,Se),le(c,O[0],O[1]),le(Se,C[0],C[1]),M(c,c,Se),M(b,O[3],C[3]),M(b,b,S),M(ee,O[2],C[2]),le(ee,ee,ee),T(fe,c,A),T(_e,ee,b),le(Ne,ee,b),le(De,c,A),M(O[0],fe,_e),M(O[1],De,Ne),M(O[2],Ne,_e),M(O[3],fe,De)}function Te(O,C,A){for(let c=0;c<4;c++)W(O[c],C[c],A)}function Ue(O,C){const A=o(),c=o(),b=o();ye(b,C[2]),M(A,C[0],b),M(c,C[1],b),ie(O,c),O[31]^=pe(A)<<7}function y(O,C,A){K(O[0],d),K(O[1],v),K(O[2],v),K(O[3],d);for(let c=255;c>=0;--c){const b=A[c/8|0]>>(c&7)&1;Te(O,C,b),ue(C,O),ue(O,O),Te(O,C,b)}}function E(O,C){const A=[o(),o(),o(),o()];K(A[0],F),K(A[1],k),K(A[2],v),M(A[3],F,k),y(O,A,C)}function Y(O){if(O.length!==u.SEED_LENGTH)throw new Error(`ed25519: seed must be ${u.SEED_LENGTH} bytes`);const C=(0,r.hash)(O);C[0]&=248,C[31]&=127,C[31]|=64;const A=new Uint8Array(32),c=[o(),o(),o(),o()];E(c,C),Ue(A,c);const b=new Uint8Array(64);return b.set(O),b.set(A,32),{publicKey:A,secretKey:b}}u.generateKeyPairFromSeed=Y;function ce(O){const C=(0,i.randomBytes)(32,O),A=Y(C);return(0,n.wipe)(C),A}u.generateKeyPair=ce;function H(O){if(O.length!==u.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${u.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(O.subarray(32))}u.extractPublicKeyFromSecretKey=H;const j=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function z(O,C){let A,c,b,ee;for(c=63;c>=32;--c){for(A=0,b=c-32,ee=c-12;b>4)*j[b],A=C[b]>>8,C[b]&=255;for(b=0;b<32;b++)C[b]-=A*j[b];for(c=0;c<32;c++)C[c+1]+=C[c]>>8,O[c]=C[c]&255}function V(O){const C=new Float64Array(64);for(let A=0;A<64;A++)C[A]=O[A];for(let A=0;A<64;A++)O[A]=0;z(O,C)}function Je(O,C){const A=new Float64Array(64),c=[o(),o(),o(),o()],b=(0,r.hash)(O.subarray(0,32));b[0]&=248,b[31]&=127,b[31]|=64;const ee=new Uint8Array(64);ee.set(b.subarray(32),32);const fe=new r.SHA512;fe.update(ee.subarray(32)),fe.update(C);const _e=fe.digest();fe.clean(),V(_e),E(c,_e),Ue(ee,c),fe.reset(),fe.update(ee.subarray(0,32)),fe.update(O.subarray(32)),fe.update(C);const Ne=fe.digest();V(Ne);for(let De=0;De<32;De++)A[De]=_e[De];for(let De=0;De<32;De++)for(let Se=0;Se<32;Se++)A[De+Se]+=Ne[De]*b[Se];return z(ee.subarray(32),A),ee}u.sign=Je;function He(O,C){const A=o(),c=o(),b=o(),ee=o(),fe=o(),_e=o(),Ne=o();return K(O[2],v),he(O[1],C),G(b,O[1]),M(ee,b,_),T(b,b,O[2]),le(ee,O[2],ee),G(fe,ee),G(_e,fe),M(Ne,_e,fe),M(A,Ne,b),M(A,A,ee),re(A,A),M(A,A,b),M(A,A,ee),M(A,A,ee),M(O[0],A,ee),G(c,O[0]),M(c,c,ee),ge(c,b)&&M(O[0],O[0],B),G(c,O[0]),M(c,c,ee),ge(c,b)?-1:(pe(O[0])===C[31]>>7&&T(O[0],d,O[0]),M(O[3],O[0],O[1]),0)}function Lr(O,C,A){const c=new Uint8Array(32),b=[o(),o(),o(),o()],ee=[o(),o(),o(),o()];if(A.length!==u.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${u.SIGNATURE_LENGTH} bytes`);if(He(ee,O))return!1;const fe=new r.SHA512;fe.update(A.subarray(0,32)),fe.update(O),fe.update(C);const _e=fe.digest();return V(_e),y(b,ee,_e),E(ee,A.subarray(32)),ue(b,ee),Ue(c,b),!Ee(A,c)}u.verify=Lr;function xe(O){let C=[o(),o(),o(),o()];if(He(C,O))throw new Error("Ed25519: invalid public key");let A=o(),c=o(),b=C[1];le(A,v,b),T(c,v,b),ye(c,c),M(A,A,c);let ee=new Uint8Array(32);return ie(ee,A),ee}u.convertPublicKeyToX25519=xe;function xt(O){const C=(0,r.hash)(O.subarray(0,32));C[0]&=248,C[31]&=127,C[31]|=64;const A=new Uint8Array(C.subarray(0,32));return(0,n.wipe)(C),A}u.convertSecretKeyToX25519=xt})(wc);const Im="EdDSA",Pm="JWT",Yl=".",Xl="base64url",Sm="utf8",Am="utf8",Rm=":",Cm="did",Om="key",Gh="base58btc",Tm="z",Nm="K36",Fm=32;function fo(u){return yo(yc(Ys(u),Sm),Xl)}function Zl(u){const i=yc(Nm,Gh),r=Tm+yo(c1([i,u]),Gh);return[Cm,Om,r].join(Rm)}function Dm(u){return yo(u,Xl)}function Lm(u){return yc([fo(u.header),fo(u.payload)].join(Yl),Am)}function $m(u){return[fo(u.header),fo(u.payload),Dm(u.signature)].join(Yl)}function Wh(u=Ml.randomBytes(Fm)){return wc.generateKeyPairFromSeed(u)}async function qm(u,i,r,n,o=se.fromMiliseconds(Date.now())){const h={alg:Im,typ:Pm},d=Zl(n.publicKey),v=o+r,_={iss:d,sub:u,aud:i,iat:o,exp:v},S=Lm({header:h,payload:_}),F=wc.sign(n.secretKey,S);return $m({header:h,payload:_,signature:F})}const Mm="PARSE_ERROR",jm="INVALID_REQUEST",Um="METHOD_NOT_FOUND",zm="INVALID_PARAMS",ef="INTERNAL_ERROR",_c="SERVER_ERROR",km=[-32700,-32600,-32601,-32602,-32603],Js={[Mm]:{code:-32700,message:"Parse error"},[jm]:{code:-32600,message:"Invalid Request"},[Um]:{code:-32601,message:"Method not found"},[zm]:{code:-32602,message:"Invalid params"},[ef]:{code:-32603,message:"Internal error"},[_c]:{code:-32e3,message:"Server error"}},tf=_c;function Hm(u){return km.includes(u)}function Jh(u){return Object.keys(Js).includes(u)?Js[u]:Js[tf]}function Bm(u){const i=Object.values(Js).find(r=>r.code===u);return i||Js[tf]}function rf(u,i,r){return u.message.includes("getaddrinfo ENOTFOUND")||u.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${i}`):u}var sf={},ri={},Qh;function Vm(){if(Qh)return ri;Qh=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.isBrowserCryptoAvailable=ri.getSubtleCrypto=ri.getBrowerCrypto=void 0;function u(){return(ur===null||ur===void 0?void 0:ur.crypto)||(ur===null||ur===void 0?void 0:ur.msCrypto)||{}}ri.getBrowerCrypto=u;function i(){const n=u();return n.subtle||n.webkitSubtle}ri.getSubtleCrypto=i;function r(){return!!u()&&!!i()}return ri.isBrowserCryptoAvailable=r,ri}var ii={},Yh;function Km(){if(Yh)return ii;Yh=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.isBrowser=ii.isNode=ii.isReactNative=void 0;function u(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ii.isReactNative=u;function i(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}ii.isNode=i;function r(){return!u()&&!i()}return ii.isBrowser=r,ii}(function(u){Object.defineProperty(u,"__esModule",{value:!0});const i=bi;i.__exportStar(Vm(),u),i.__exportStar(Km(),u)})(sf);function bc(u=3){const i=Date.now()*Math.pow(10,u),r=Math.floor(Math.random()*Math.pow(10,u));return i+r}function nf(u=6){return BigInt(bc(u))}function ps(u,i,r){return{id:r||bc(),jsonrpc:"2.0",method:u,params:i}}function Ec(u,i){return{id:u,jsonrpc:"2.0",result:i}}function mo(u,i,r){return{id:u,jsonrpc:"2.0",error:Gm(i,r)}}function Gm(u,i){return typeof u>"u"?Jh(ef):(typeof u=="string"&&(u=Object.assign(Object.assign({},Jh(_c)),{message:u})),typeof i<"u"&&(u.data=i),Hm(u.code)&&(u=Bm(u.code)),u)}class Wm{}class Jm extends Wm{constructor(){super()}}class Qm extends Jm{constructor(i){super()}}const Ym="^https?:",Xm="^wss?:";function Zm(u){const i=u.match(new RegExp(/^\w+:/,"gi"));if(!(!i||!i.length))return i[0]}function of(u,i){const r=Zm(u);return typeof r>"u"?!1:new RegExp(i).test(r)}function Xh(u){return of(u,Ym)}function Zh(u){return of(u,Xm)}function ew(u){return new RegExp("wss?://localhost(:d{2,5})?").test(u)}function af(u){return typeof u=="object"&&"id"in u&&"jsonrpc"in u&&u.jsonrpc==="2.0"}function xc(u){return af(u)&&"method"in u}function wo(u){return af(u)&&(oi(u)||Dr(u))}function oi(u){return"result"in u}function Dr(u){return"error"in u}class Ei extends Qm{constructor(i){super(i),this.events=new Sr.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(i),this.connection.connected&&this.registerEventListeners()}async connect(i=this.connection){await this.open(i)}async disconnect(){await this.close()}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async request(i,r){return this.requestStrict(ps(i.method,i.params||[],i.id||nf().toString()),r)}async requestStrict(i,r){return new Promise(async(n,o)=>{if(!this.connection.connected)try{await this.open()}catch(h){o(h)}this.events.on(`${i.id}`,h=>{Dr(h)?o(h.error):n(h.result)});try{await this.connection.send(i,r)}catch(h){o(h)}})}setConnection(i=this.connection){return i}onPayload(i){this.events.emit("payload",i),wo(i)?this.events.emit(`${i.id}`,i):this.events.emit("message",{type:i.method,data:i.params})}onClose(i){i&&i.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${i.code} ${i.reason?`(${i.reason})`:""}`)),this.events.emit("disconnect")}async open(i=this.connection){this.connection===i&&this.connection.connected||(this.connection.connected&&this.close(),typeof i=="string"&&(await this.connection.open(i),i=this.connection),this.connection=this.setConnection(i),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",i=>this.onPayload(i)),this.connection.on("close",i=>this.onClose(i)),this.connection.on("error",i=>this.events.emit("error",i)),this.connection.on("register_error",i=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const tw=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),rw=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",el=u=>u.split("?")[0],tl=10,iw=tw();class sw{constructor(i){if(this.url=i,this.events=new Sr.EventEmitter,this.registering=!1,!Zh(i))throw new Error(`Provided URL is not compatible with WebSocket connection: ${i}`);this.url=i}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async open(i=this.url){await this.register(i)}async close(){return new Promise((i,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),i()},this.socket.close()})}async send(i,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ys(i))}catch(n){this.onError(i.id,n)}}register(i=this.url){if(!Zh(i))throw new Error(`Provided URL is not compatible with WebSocket connection: ${i}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",h=>{this.resetMaxListeners(),o(h)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=i,this.registering=!0,new Promise((r,n)=>{const o=sf.isReactNative()?void 0:{rejectUnauthorized:!ew(i)},h=new iw(i,[],o);rw()?h.onerror=d=>{const v=d;n(this.emitError(v.error))}:h.on("error",d=>{n(this.emitError(d))}),h.onopen=()=>{this.onOpen(h),r(h)}})}onOpen(i){i.onmessage=r=>this.onPayload(r),i.onclose=r=>this.onClose(r),this.socket=i,this.registering=!1,this.events.emit("open")}onClose(i){this.socket=void 0,this.registering=!1,this.events.emit("close",i)}onPayload(i){if(typeof i.data>"u")return;const r=typeof i.data=="string"?mc(i.data):i.data;this.events.emit("payload",r)}onError(i,r){const n=this.parseError(r),o=n.message||n.toString(),h=mo(i,o);this.events.emit("payload",h)}parseError(i,r=this.url){return rf(i,el(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>tl&&this.events.setMaxListeners(tl)}emitError(i){const r=this.parseError(new Error((i==null?void 0:i.message)||`WebSocket connection failed for host: ${el(this.url)}`));return this.events.emit("register_error",r),r}}var po={exports:{}};po.exports;(function(u,i){var r=200,n="__lodash_hash_undefined__",o=1,h=2,d=9007199254740991,v="[object Arguments]",_="[object Array]",S="[object AsyncFunction]",F="[object Boolean]",k="[object Date]",B="[object Error]",K="[object Function]",q="[object GeneratorFunction]",W="[object Map]",ie="[object Number]",Ee="[object Null]",ge="[object Object]",pe="[object Promise]",he="[object Proxy]",le="[object RegExp]",T="[object Set]",M="[object String]",G="[object Symbol]",ye="[object Undefined]",re="[object WeakMap]",ue="[object ArrayBuffer]",Te="[object DataView]",Ue="[object Float32Array]",y="[object Float64Array]",E="[object Int8Array]",Y="[object Int16Array]",ce="[object Int32Array]",H="[object Uint8Array]",j="[object Uint8ClampedArray]",z="[object Uint16Array]",V="[object Uint32Array]",Je=/[\\^$.*+?()[\]{}|]/g,He=/^\[object .+?Constructor\]$/,Lr=/^(?:0|[1-9]\d*)$/,xe={};xe[Ue]=xe[y]=xe[E]=xe[Y]=xe[ce]=xe[H]=xe[j]=xe[z]=xe[V]=!0,xe[v]=xe[_]=xe[ue]=xe[F]=xe[Te]=xe[k]=xe[B]=xe[K]=xe[W]=xe[ie]=xe[ge]=xe[le]=xe[T]=xe[M]=xe[re]=!1;var xt=typeof ur=="object"&&ur&&ur.Object===Object&&ur,O=typeof self=="object"&&self&&self.Object===Object&&self,C=xt||O||Function("return this")(),A=i&&!i.nodeType&&i,c=A&&!0&&u&&!u.nodeType&&u,b=c&&c.exports===A,ee=b&&xt.process,fe=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),_e=fe&&fe.isTypedArray;function Ne(g,x){for(var $=-1,Q=g==null?0:g.length,Ke=0,ve=[];++$-1}function Co(g,x){var $=this.__data__,Q=Pi($,g);return Q<0?(++this.size,$.push([g,x])):$[Q][1]=x,this}yr.prototype.clear=Po,yr.prototype.delete=So,yr.prototype.get=Ao,yr.prototype.has=Ro,yr.prototype.set=Co;function Vr(g){var x=-1,$=g==null?0:g.length;for(this.clear();++x<$;){var Q=g[x];this.set(Q[0],Q[1])}}function Hi(){this.size=0,this.__data__={hash:new Qe,map:new(rt||yr),string:new Qe}}function Oo(g){var x=ci(this,g).delete(g);return this.size-=x?1:0,x}function Bi(g){return ci(this,g).get(g)}function To(g){return ci(this,g).has(g)}function No(g,x){var $=ci(this,g),Q=$.size;return $.set(g,x),this.size+=$.size==Q?0:1,this}Vr.prototype.clear=Hi,Vr.prototype.delete=Oo,Vr.prototype.get=Bi,Vr.prototype.has=To,Vr.prototype.set=No;function Vi(g){var x=-1,$=g==null?0:g.length;for(this.__data__=new Vr;++x<$;)this.add(g[x])}function en(g){return this.__data__.set(g,n),this}function tn(g){return this.__data__.has(g)}Vi.prototype.add=Vi.prototype.push=en,Vi.prototype.has=tn;function Ar(g){var x=this.__data__=new yr(g);this.size=x.size}function Fo(){this.__data__=new yr,this.size=0}function Do(g){var x=this.__data__,$=x.delete(g);return this.size=x.size,$}function Lo(g){return this.__data__.get(g)}function $o(g){return this.__data__.has(g)}function rn(g,x){var $=this.__data__;if($ instanceof yr){var Q=$.__data__;if(!rt||Q.lengthTt))return!1;var Ge=ve.get(g);if(Ge&&ve.get(x))return Ge==x;var wt=-1,rr=!0,Nt=$&h?new Vi:void 0;for(ve.set(g,x),ve.set(x,g);++wt-1&&g%1==0&&g-1&&g%1==0&&g<=d}function mn(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function Ri(g){return g!=null&&typeof g=="object"}var wn=_e?vt(_e):on;function ko(g){return Uo(g)?sn(g):an(g)}function Ve(){return[]}function ke(){return!1}u.exports=zo})(po,po.exports);var nw=po.exports;const ow=jl(nw);function aw(u,i){if(u.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,he=new Uint8Array(pe);Ee!==ge;){for(var le=q[Ee],T=0,M=pe-1;(le!==0||T>>0,he[M]=le%v>>>0,le=le/v>>>0;if(le!==0)throw new Error("Non-zero carry");ie=T,Ee++}for(var G=pe-ie;G!==pe&&he[G]===0;)G++;for(var ye=_.repeat(W);G>>0,pe=new Uint8Array(ge);q[W];){var he=r[q.charCodeAt(W)];if(he===255)return;for(var le=0,T=ge-1;(he!==0||le>>0,pe[T]=he%256>>>0,he=he/256>>>0;if(he!==0)throw new Error("Non-zero carry");Ee=le,W++}if(q[W]!==" "){for(var M=ge-Ee;M!==ge&&pe[M]===0;)M++;for(var G=new Uint8Array(ie+(ge-M)),ye=ie;M!==ge;)G[ye++]=pe[M++];return G}}}function K(q){var W=B(q);if(W)return W;throw new Error(`Non-${i} character`)}return{encode:k,decodeUnsafe:B,decode:K}}var cw=aw,uw=cw;const cf=u=>{if(u instanceof Uint8Array&&u.constructor.name==="Uint8Array")return u;if(u instanceof ArrayBuffer)return new Uint8Array(u);if(ArrayBuffer.isView(u))return new Uint8Array(u.buffer,u.byteOffset,u.byteLength);throw new Error("Unknown type, must be binary type")},hw=u=>new TextEncoder().encode(u),lw=u=>new TextDecoder().decode(u);class fw{constructor(i,r,n){this.name=i,this.prefix=r,this.baseEncode=n}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}}class pw{constructor(i,r,n){if(this.name=i,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return uf(this,i)}}class dw{constructor(i){this.decoders=i}or(i){return uf(this,i)}decode(i){const r=i[0],n=this.decoders[r];if(n)return n.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const uf=(u,i)=>new dw({...u.decoders||{[u.prefix]:u},...i.decoders||{[i.prefix]:i}});class gw{constructor(i,r,n,o){this.name=i,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new fw(i,r,n),this.decoder=new pw(i,r,o)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}}const _o=({name:u,prefix:i,encode:r,decode:n})=>new gw(u,i,r,n),Zs=({prefix:u,name:i,alphabet:r})=>{const{encode:n,decode:o}=uw(r,i);return _o({prefix:u,name:i,encode:n,decode:h=>cf(o(h))})},yw=(u,i,r,n)=>{const o={};for(let F=0;F=8&&(v-=8,d[S++]=255&_>>v)}if(v>=r||255&_<<8-v)throw new SyntaxError("Unexpected end of data");return d},vw=(u,i,r)=>{const n=i[i.length-1]==="=",o=(1<r;)d-=r,h+=i[o&v>>d];if(d&&(h+=i[o&v<_o({prefix:i,name:u,encode(o){return vw(o,n,r)},decode(o){return yw(o,n,r,u)}}),mw=_o({prefix:"\0",name:"identity",encode:u=>lw(u),decode:u=>hw(u)});var ww=Object.freeze({__proto__:null,identity:mw});const _w=Ht({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var bw=Object.freeze({__proto__:null,base2:_w});const Ew=Ht({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var xw=Object.freeze({__proto__:null,base8:Ew});const Iw=Zs({prefix:"9",name:"base10",alphabet:"0123456789"});var Pw=Object.freeze({__proto__:null,base10:Iw});const Sw=Ht({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Aw=Ht({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Rw=Object.freeze({__proto__:null,base16:Sw,base16upper:Aw});const Cw=Ht({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ow=Ht({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Tw=Ht({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Nw=Ht({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Fw=Ht({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Dw=Ht({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Lw=Ht({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),$w=Ht({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),qw=Ht({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Mw=Object.freeze({__proto__:null,base32:Cw,base32upper:Ow,base32pad:Tw,base32padupper:Nw,base32hex:Fw,base32hexupper:Dw,base32hexpad:Lw,base32hexpadupper:$w,base32z:qw});const jw=Zs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Uw=Zs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var zw=Object.freeze({__proto__:null,base36:jw,base36upper:Uw});const kw=Zs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Hw=Zs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Bw=Object.freeze({__proto__:null,base58btc:kw,base58flickr:Hw});const Vw=Ht({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Kw=Ht({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Gw=Ht({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ww=Ht({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Jw=Object.freeze({__proto__:null,base64:Vw,base64pad:Kw,base64url:Gw,base64urlpad:Ww});const hf=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Qw=hf.reduce((u,i,r)=>(u[r]=i,u),[]),Yw=hf.reduce((u,i,r)=>(u[i.codePointAt(0)]=r,u),[]);function Xw(u){return u.reduce((i,r)=>(i+=Qw[r],i),"")}function Zw(u){const i=[];for(const r of u){const n=Yw[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);i.push(n)}return new Uint8Array(i)}const e_=_o({prefix:"🚀",name:"base256emoji",encode:Xw,decode:Zw});var t_=Object.freeze({__proto__:null,base256emoji:e_}),r_=lf,rl=128,i_=127,s_=~i_,n_=Math.pow(2,31);function lf(u,i,r){i=i||[],r=r||0;for(var n=r;u>=n_;)i[r++]=u&255|rl,u/=128;for(;u&s_;)i[r++]=u&255|rl,u>>>=7;return i[r]=u|0,lf.bytes=r-n+1,i}var o_=hc,a_=128,il=127;function hc(u,n){var r=0,n=n||0,o=0,h=n,d,v=u.length;do{if(h>=v)throw hc.bytes=0,new RangeError("Could not decode varint");d=u[h++],r+=o<28?(d&il)<=a_);return hc.bytes=h-n,r}var c_=Math.pow(2,7),u_=Math.pow(2,14),h_=Math.pow(2,21),l_=Math.pow(2,28),f_=Math.pow(2,35),p_=Math.pow(2,42),d_=Math.pow(2,49),g_=Math.pow(2,56),y_=Math.pow(2,63),v_=function(u){return u(ff.encode(u,i,r),i),nl=u=>ff.encodingLength(u),lc=(u,i)=>{const r=i.byteLength,n=nl(u),o=n+nl(r),h=new Uint8Array(o+r);return sl(u,h,0),sl(r,h,n),h.set(i,o),new w_(u,r,i,h)};class w_{constructor(i,r,n,o){this.code=i,this.size=r,this.digest=n,this.bytes=o}}const pf=({name:u,code:i,encode:r})=>new __(u,i,r);class __{constructor(i,r,n){this.name=i,this.code=r,this.encode=n}digest(i){if(i instanceof Uint8Array){const r=this.encode(i);return r instanceof Uint8Array?lc(this.code,r):r.then(n=>lc(this.code,n))}else throw Error("Unknown type, must be binary type")}}const df=u=>async i=>new Uint8Array(await crypto.subtle.digest(u,i)),b_=pf({name:"sha2-256",code:18,encode:df("SHA-256")}),E_=pf({name:"sha2-512",code:19,encode:df("SHA-512")});var x_=Object.freeze({__proto__:null,sha256:b_,sha512:E_});const gf=0,I_="identity",yf=cf,P_=u=>lc(gf,yf(u)),S_={code:gf,name:I_,encode:yf,digest:P_};var A_=Object.freeze({__proto__:null,identity:S_});new TextEncoder,new TextDecoder;const ol={...ww,...bw,...xw,...Pw,...Rw,...Mw,...zw,...Bw,...Jw,...t_};({...x_,...A_});function vf(u){return globalThis.Buffer!=null?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):u}function R_(u=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vf(globalThis.Buffer.allocUnsafe(u)):new Uint8Array(u)}function mf(u,i,r,n){return{name:u,prefix:i,encoder:{name:u,prefix:i,encode:r},decoder:{decode:n}}}const al=mf("utf8","u",u=>"u"+new TextDecoder("utf8").decode(u),u=>new TextEncoder().encode(u.substring(1))),Za=mf("ascii","a",u=>{let i="a";for(let r=0;r{u=u.substring(1);const i=R_(u.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,o)=>{this.isInitialized(),this.keychain.set(n,o),await this.persist()},this.get=n=>{this.isInitialized();const o=this.keychain.get(n);if(typeof o>"u"){const{message:h}=Z("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(h)}return o},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=i,this.logger=Oe.generateChildLogger(r,this.name)}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(i){await this.core.storage.setItem(this.storageKey,Hl(i))}async getKeyChain(){const i=await this.core.storage.getItem(this.storageKey);return typeof i<"u"?Bl(i):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class ob{constructor(i,r,n){this.core=i,this.logger=r,this.name=D_,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{this.isInitialized();const o=await this.getClientSeed(),h=Wh(o);return Zl(h.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=l1();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const h=await this.getClientSeed(),d=Wh(h),v=cc();return await qm(v,o,L_,d)},this.generateSharedKey=(o,h,d)=>{this.isInitialized();const v=this.getPrivateKey(o),_=f1(v,h);return this.setSymKey(_,d)},this.setSymKey=async(o,h)=>{this.isInitialized();const d=h||p1(o);return await this.keychain.set(d,o),d},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,h,d)=>{this.isInitialized();const v=d1(d),_=Ys(h);if(Rh(v)){const B=v.senderPublicKey,K=v.receiverPublicKey;o=await this.generateSharedKey(B,K)}const S=this.getSymKey(o),{type:F,senderPublicKey:k}=v;return g1({type:F,symKey:S,message:_,senderPublicKey:k})},this.decode=async(o,h,d)=>{this.isInitialized();const v=y1(h,d);if(Rh(v)){const _=v.receiverPublicKey,S=v.senderPublicKey;o=await this.generateSharedKey(_,S)}try{const _=this.getSymKey(o),S=v1({symKey:_,encoded:h});return mc(S)}catch(_){this.logger.error(`Failed to decode message from topic: '${o}', clientId: '${await this.getClientId()}'`),this.logger.error(_)}},this.getPayloadType=o=>{const h=Ch(o);return m1(h.type)},this.getPayloadSenderPublicKey=o=>{const h=Ch(o);return h.senderPublicKey?yo(h.senderPublicKey,w1):void 0},this.core=i,this.logger=Oe.generateChildLogger(r,this.name),this.keychain=n||new nb(this.core,this.logger)}get context(){return Oe.getLoggerContext(this.logger)}async setPrivateKey(i,r){return await this.keychain.set(i,r),i}getPrivateKey(i){return this.keychain.get(i)}async getClientSeed(){let i="";try{i=this.keychain.get(cl)}catch{i=cc(),await this.keychain.set(cl,i)}return O_(i,"base16")}getSymKey(i){return this.keychain.get(i)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class ab extends pm{constructor(i,r){super(i,r),this.logger=i,this.core=r,this.messages=new Map,this.name=M_,this.version=j_,this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,o)=>{this.isInitialized();const h=fs(o);let d=this.messages.get(n);return typeof d>"u"&&(d={}),typeof d[h]<"u"||(d[h]=o,this.messages.set(n,d),await this.persist()),h},this.get=n=>{this.isInitialized();let o=this.messages.get(n);return typeof o>"u"&&(o={}),o},this.has=(n,o)=>{this.isInitialized();const h=this.get(n),d=fs(o);return typeof h[d]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Oe.generateChildLogger(i,this.name),this.core=r}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(i){await this.core.storage.setItem(this.storageKey,Hl(i))}async getRelayerMessages(){const i=await this.core.storage.getItem(this.storageKey);return typeof i<"u"?Bl(i):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class cb extends dm{constructor(i,r){super(i,r),this.relayer=i,this.logger=r,this.events=new Sr.EventEmitter,this.name=z_,this.queue=new Map,this.publishTimeout=se.toMiliseconds(se.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,o,h)=>{var d;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:h}});try{const v=(h==null?void 0:h.ttl)||U_,_=uc(h),S=(h==null?void 0:h.prompt)||!1,F=(h==null?void 0:h.tag)||0,k=(h==null?void 0:h.id)||nf().toString(),B={topic:n,message:o,opts:{ttl:v,relay:_,prompt:S,tag:F,id:k}},K=setTimeout(()=>this.queue.set(k,B),this.publishTimeout);try{await await Qs(this.rpcPublish(n,o,v,_,S,F,k),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(k),this.relayer.events.emit(Kt.publish,B)}catch(q){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(d=h==null?void 0:h.internal)!=null&&d.throwOnFailedPublish)throw this.removeRequestFromQueue(k),q;return}finally{clearTimeout(K)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:h}})}catch(v){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(v),v}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.relayer=i,this.logger=Oe.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return Oe.getLoggerContext(this.logger)}rpcPublish(i,r,n,o,h,d,v){var _,S,F,k;const B={method:uo(o.protocol).publish,params:{topic:i,message:r,ttl:n,prompt:h,tag:d},id:v};return wi((_=B.params)==null?void 0:_.prompt)&&((S=B.params)==null||delete S.prompt),wi((F=B.params)==null?void 0:F.tag)&&((k=B.params)==null||delete k.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:B}),this.relayer.request(B)}removeRequestFromQueue(i){this.queue.delete(i)}checkQueue(){this.queue.forEach(async i=>{const{topic:r,message:n,opts:o}=i;await this.publish(r,n,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Kt.connection_stalled);return}this.checkQueue()}),this.relayer.on(Kt.message_ack,i=>{this.removeRequestFromQueue(i.id.toString())})}}class ub{constructor(){this.map=new Map,this.set=(i,r)=>{const n=this.get(i);this.exists(i,r)||this.map.set(i,[...n,r])},this.get=i=>this.map.get(i)||[],this.exists=(i,r)=>this.get(i).includes(r),this.delete=(i,r)=>{if(typeof r>"u"){this.map.delete(i);return}if(!this.map.has(i))return;const n=this.get(i);if(!this.exists(i,r))return;const o=n.filter(h=>h!==r);if(!o.length){this.map.delete(i);return}this.map.set(i,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var hb=Object.defineProperty,lb=Object.defineProperties,fb=Object.getOwnPropertyDescriptors,ll=Object.getOwnPropertySymbols,pb=Object.prototype.hasOwnProperty,db=Object.prototype.propertyIsEnumerable,fl=(u,i,r)=>i in u?hb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,ks=(u,i)=>{for(var r in i||(i={}))pb.call(i,r)&&fl(u,r,i[r]);if(ll)for(var r of ll(i))db.call(i,r)&&fl(u,r,i[r]);return u},tc=(u,i)=>lb(u,fb(i));class gb extends vm{constructor(i,r){super(i,r),this.relayer=i,this.logger=r,this.subscriptions=new Map,this.topicMap=new ub,this.events=new Sr.EventEmitter,this.name=Q_,this.version=Y_,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=_i,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}});try{const h=uc(o),d={topic:n,relay:h};this.pending.set(n,d);const v=await this.rpcSubscribe(n,h);return this.onSubscribe(v,d),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}}),v}catch(h){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(h),h}},this.unsubscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),typeof(o==null?void 0:o.id)<"u"?await this.unsubscribeById(n,o.id,o):await this.unsubscribeByTopic(n,o)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((o,h)=>{const d=new se.Watch;d.start(this.pendingSubscriptionWatchLabel);const v=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),o(!0)),d.elapsed(this.pendingSubscriptionWatchLabel)>=X_&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),h(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=i,this.logger=Oe.generateChildLogger(r,this.name),this.clientId=""}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(i,r){let n=!1;try{n=this.getSubscription(i).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(i,r){const n=this.topicMap.get(i);await Promise.all(n.map(async o=>await this.unsubscribeById(i,o,r)))}async unsubscribeById(i,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:i,id:r,opts:n}});try{const o=uc(n);await this.rpcUnsubscribe(i,r,o);const h=er("USER_DISCONNECTED",`${this.name}, ${i}`);await this.onUnsubscribe(i,r,h),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:i,id:r,opts:n}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(i,r){const n={method:uo(r.protocol).subscribe,params:{topic:i}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Qs(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Kt.connection_stalled)}return fs(i+this.clientId)}async rpcBatchSubscribe(i){if(!i.length)return;const r=i[0].relay,n={method:uo(r.protocol).batchSubscribe,params:{topics:i.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Qs(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Kt.connection_stalled)}}rpcUnsubscribe(i,r,n){const o={method:uo(n.protocol).unsubscribe,params:{topic:i,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(i,r){this.setSubscription(i,tc(ks({},r),{id:i})),this.pending.delete(r.topic)}onBatchSubscribe(i){i.length&&i.forEach(r=>{this.setSubscription(r.id,ks({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(i,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,i)&&this.deleteSubscription(r,n),await this.relayer.messages.del(i)}async setRelayerSubscriptions(i){await this.relayer.core.storage.setItem(this.storageKey,i)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(i,r){this.subscriptions.has(i)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:i,subscription:r}),this.addSubscription(i,r))}addSubscription(i,r){this.subscriptions.set(i,ks({},r)),this.topicMap.set(r.topic,i),this.events.emit(Hr.created,r)}getSubscription(i){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:i});const r=this.subscriptions.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(n)}return r}deleteSubscription(i,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:i,reason:r});const n=this.getSubscription(i);this.subscriptions.delete(i),this.topicMap.delete(n.topic,i),this.events.emit(Hr.deleted,tc(ks({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Hr.sync)}async reset(){if(this.cached.length){const i=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!i.length)return;if(this.subscriptions.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(i){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(i)}}async batchSubscribe(i){if(!i.length)return;const r=await this.rpcBatchSubscribe(i);ds(r)&&this.onBatchSubscribe(r.map((n,o)=>tc(ks({},i[o]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const i=[];this.pending.forEach(r=>{i.push(r)}),await this.batchSubscribe(i)}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Kt.connect,async()=>{await this.onConnect()}),this.relayer.on(Kt.disconnect,()=>{this.onDisconnect()}),this.events.on(Hr.created,async i=>{const r=Hr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),await this.persist()}),this.events.on(Hr.deleted,async i=>{const r=Hr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}async restartToComplete(){this.restartInProgress&&await new Promise(i=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),i())},this.pollingInterval)})}}var yb=Object.defineProperty,pl=Object.getOwnPropertySymbols,vb=Object.prototype.hasOwnProperty,mb=Object.prototype.propertyIsEnumerable,dl=(u,i,r)=>i in u?yb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,wb=(u,i)=>{for(var r in i||(i={}))vb.call(i,r)&&dl(u,r,i[r]);if(pl)for(var r of pl(i))mb.call(i,r)&&dl(u,r,i[r]);return u};class _b extends gm{constructor(i){super(i),this.protocol="wc",this.version=2,this.events=new Sr.EventEmitter,this.name=H_,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.onPayloadHandler=r=>{this.onProviderPayload(r)},this.onConnectHandler=()=>{this.events.emit(Kt.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Kt.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(si.payload,this.onPayloadHandler),this.provider.on(si.connect,this.onConnectHandler),this.provider.on(si.disconnect,this.onDisconnectHandler),this.provider.on(si.error,this.onProviderErrorHandler)},this.core=i.core,this.logger=typeof i.logger<"u"&&typeof i.logger!="string"?Oe.generateChildLogger(i.logger,this.name):Oe.pino(Oe.getDefaultLoggerOptions({level:i.logger||k_})),this.messages=new ab(this.logger,i.core),this.subscriber=new gb(this,this.logger),this.publisher=new cb(this,this.logger),this.relayUrl=(i==null?void 0:i.relayUrl)||bf,this.projectId=i.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${ul}...`),await this.restartTransport(ul)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},G_)}get context(){return Oe.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(i,r,n){this.isInitialized(),await this.publisher.publish(i,r,n),await this.recordMessageEvent({topic:i,message:r,publishedAt:Date.now()})}async subscribe(i,r){var n;this.isInitialized();let o=((n=this.subscriber.topicMap.get(i))==null?void 0:n[0])||"";return o||(await Promise.all([new Promise(h=>{this.subscriber.once(Hr.created,d=>{d.topic===i&&h()})}),new Promise(async h=>{o=await this.subscriber.subscribe(i,r),h()})]),o)}async unsubscribe(i,r){this.isInitialized(),await this.subscriber.unsubscribe(i,r)}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await Qs(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(i){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){i&&i!==this.relayUrl&&(this.relayUrl=i,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(r=>{if(!this.initialized)return r();this.subscriber.once(Hr.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await Qs(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(o){n(o);return}r()})])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.provider.events.emit(si.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(i){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=i||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Oh())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(i){return this.staleConnectionErrors.some(r=>i.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const i=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ei(new sw(_1({sdkVersion:K_,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:i,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(i){const{topic:r,message:n}=i;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(i){const{topic:r,message:n}=i;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const o=this.messages.has(r,n);return o&&this.logger.debug(`Ignoring duplicate message: ${n}`),o}async onProviderPayload(i){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:i}),xc(i)){if(!i.method.endsWith(B_))return;const r=i.params,{topic:n,message:o,publishedAt:h}=r.data,d={topic:n,message:o,publishedAt:h};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(wb({type:"event",event:r.id},d)),this.events.emit(r.id,d),await this.acknowledgePayload(i),await this.onMessageEvent(d)}else wo(i)&&this.events.emit(Kt.message_ack,i)}async onMessageEvent(i){await this.shouldIgnoreMessageEvent(i)||(this.events.emit(Kt.message,i),await this.recordMessageEvent(i))}async acknowledgePayload(i){const r=Ec(i.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(si.payload,this.onPayloadHandler),this.provider.off(si.connect,this.onConnectHandler),this.provider.off(si.disconnect,this.onDisconnectHandler),this.provider.off(si.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Kt.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let i=await Oh();b1(async r=>{this.initialized&&i!==r&&(i=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(Kt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(i=>this.logger.error(i))},se.toMiliseconds(V_)))}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(i=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),i())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var bb=Object.defineProperty,gl=Object.getOwnPropertySymbols,Eb=Object.prototype.hasOwnProperty,xb=Object.prototype.propertyIsEnumerable,yl=(u,i,r)=>i in u?bb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,vl=(u,i)=>{for(var r in i||(i={}))Eb.call(i,r)&&yl(u,r,i[r]);if(gl)for(var r of gl(i))xb.call(i,r)&&yl(u,r,i[r]);return u};class bo extends ym{constructor(i,r,n,o=_i,h=void 0){super(i,r,n,o),this.core=i,this.logger=r,this.name=n,this.map=new Map,this.version=W_,this.cached=[],this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(d=>{this.getKey&&d!==null&&!wi(d)?this.map.set(this.getKey(d),d):u1(d)?this.map.set(d.id,d):h1(d)&&this.map.set(d.topic,d)}),this.cached=[],this.initialized=!0)},this.set=async(d,v)=>{this.isInitialized(),this.map.has(d)?await this.update(d,v):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:d,value:v}),this.map.set(d,v),await this.persist())},this.get=d=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:d}),this.getData(d)),this.getAll=d=>(this.isInitialized(),d?this.values.filter(v=>Object.keys(d).every(_=>ow(v[_],d[_]))):this.values),this.update=async(d,v)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:d,update:v});const _=vl(vl({},this.getData(d)),v);this.map.set(d,_),await this.persist()},this.delete=async(d,v)=>{this.isInitialized(),this.map.has(d)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:d,reason:v}),this.map.delete(d),await this.persist())},this.logger=Oe.generateChildLogger(r,this.name),this.storagePrefix=o,this.getKey=h}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(i){await this.core.storage.setItem(this.storageKey,i)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(i){const r=this.map.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const i=await this.getDataStore();if(typeof i>"u"||!i.length)return;if(this.map.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(i){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(i)}}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class Ib{constructor(i,r){this.core=i,this.logger=r,this.name=Z_,this.version=eb,this.events=new vc,this.initialized=!1,this.storagePrefix=_i,this.ignoredPayloadTypes=[Ul],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=cc(),o=await this.core.crypto.setSymKey(n),h=Fr(se.FIVE_MINUTES),d={protocol:_f},v={topic:o,expiry:h,relay:d,active:!1},_=E1({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:n,relay:d});return await this.pairings.set(o,v),await this.core.relayer.subscribe(o),this.core.expirer.set(o,h),{topic:o,uri:_}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:o,symKey:h,relay:d}=x1(n.uri);let v;if(this.pairings.keys.includes(o)&&(v=this.pairings.get(o),v.active))throw new Error(`Pairing already exists: ${o}. Please try again with a new connection URI.`);this.core.crypto.keychain.has(o)||(await this.core.crypto.setSymKey(h,o),await this.core.relayer.subscribe(o,{relay:d}));const _=Fr(se.FIVE_MINUTES),S={topic:o,relay:d,expiry:_,active:!1};return await this.pairings.set(o,S),this.core.expirer.set(o,_),n.activatePairing&&await this.activate({topic:o}),this.events.emit(Gs.create,S),S},this.activate=async({topic:n})=>{this.isInitialized();const o=Fr(se.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:o}),this.core.expirer.set(n,o)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:o}=n;if(this.pairings.keys.includes(o)){const h=await this.sendRequest(o,"wc_pairingPing",{}),{done:d,resolve:v,reject:_}=us();this.events.once(Ft("pairing_ping",h),({error:S})=>{S?_(S):v()}),await d()}},this.updateExpiry=async({topic:n,expiry:o})=>{this.isInitialized(),await this.pairings.update(n,{expiry:o})},this.updateMetadata=async({topic:n,metadata:o})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:o}=n;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",er("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(n,o,h)=>{const d=ps(o,h),v=await this.core.crypto.encode(n,d),_=zs[o].req;return this.core.history.set(n,d),this.core.relayer.publish(n,v,_),d.id},this.sendResult=async(n,o,h)=>{const d=Ec(n,h),v=await this.core.crypto.encode(o,d),_=await this.core.history.get(o,n),S=zs[_.request.method].res;await this.core.relayer.publish(o,v,S),await this.core.history.resolve(d)},this.sendError=async(n,o,h)=>{const d=mo(n,h),v=await this.core.crypto.encode(o,d),_=await this.core.history.get(o,n),S=zs[_.request.method]?zs[_.request.method].res:zs.unregistered_method.res;await this.core.relayer.publish(o,v,S),await this.core.history.resolve(d)},this.deletePairing=async(n,o)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,er("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),o?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(o=>mi(o.expiry));await Promise.all(n.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=n=>{const{topic:o,payload:h}=n;switch(h.method){case"wc_pairingPing":return this.onPairingPingRequest(o,h);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,h);default:return this.onUnknownRpcMethodRequest(o,h)}},this.onRelayEventResponse=async n=>{const{topic:o,payload:h}=n,d=(await this.core.history.get(o,h.id)).request.method;switch(d){case"wc_pairingPing":return this.onPairingPingResponse(o,h);default:return this.onUnknownRpcMethodResponse(d)}},this.onPairingPingRequest=async(n,o)=>{const{id:h}=o;try{this.isValidPing({topic:n}),await this.sendResult(h,n,!0),this.events.emit(Gs.ping,{id:h,topic:n})}catch(d){await this.sendError(h,n,d),this.logger.error(d)}},this.onPairingPingResponse=(n,o)=>{const{id:h}=o;setTimeout(()=>{oi(o)?this.events.emit(Ft("pairing_ping",h),{}):Dr(o)&&this.events.emit(Ft("pairing_ping",h),{error:o.error})},500)},this.onPairingDeleteRequest=async(n,o)=>{const{id:h}=o;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Gs.delete,{id:h,topic:n})}catch(d){await this.sendError(h,n,d),this.logger.error(d)}},this.onUnknownRpcMethodRequest=async(n,o)=>{const{id:h,method:d}=o;try{if(this.registeredMethods.includes(d))return;const v=er("WC_METHOD_UNSUPPORTED",d);await this.sendError(h,n,v),this.logger.error(v)}catch(v){await this.sendError(h,n,v),this.logger.error(v)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(er("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!cr(n)){const{message:o}=Z("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(o)}if(!I1(n.uri)){const{message:o}=Z("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(o)}},this.isValidPing=async n=>{if(!cr(n)){const{message:h}=Z("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(h)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidDisconnect=async n=>{if(!cr(n)){const{message:h}=Z("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(h)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async n=>{if(!hs(n,!1)){const{message:o}=Z("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(o)}if(!this.pairings.keys.includes(n)){const{message:o}=Z("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(o)}if(mi(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:o}=Z("EXPIRED",`pairing topic: ${n}`);throw new Error(o)}},this.core=i,this.logger=Oe.generateChildLogger(r,this.name),this.pairings=new bo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Oe.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}registerRelayerEvents(){this.core.relayer.on(Kt.message,async i=>{const{topic:r,message:n}=i;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const o=await this.core.crypto.decode(r,n);try{xc(o)?(this.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o})):wo(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o}),this.core.history.delete(r,o.id))}catch(h){this.logger.error(h)}})}registerExpirerEvents(){this.core.expirer.on(Pr.expired,async i=>{const{topic:r}=zl(i.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Gs.expire,{topic:r}))})}}class Pb extends fm{constructor(i,r){super(i,r),this.core=i,this.logger=r,this.records=new Map,this.events=new Sr.EventEmitter,this.name=tb,this.version=rb,this.cached=[],this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,o,h)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:o,chainId:h}),this.records.has(o.id))return;const d={id:o.id,topic:n,request:{method:o.method,params:o.params||null},chainId:h,expiry:Fr(se.THIRTY_DAYS)};this.records.set(d.id,d),this.events.emit(kr.created,d)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const o=await this.getRecord(n.id);typeof o.response>"u"&&(o.response=Dr(n)?{error:n.error}:{result:n.result},this.records.set(o.id,o),this.events.emit(kr.updated,o))},this.get=async(n,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:o}),await this.getRecord(o)),this.delete=(n,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(h=>{if(h.topic===n){if(typeof o<"u"&&h.id!==o)return;this.records.delete(h.id),this.events.emit(kr.deleted,h)}})},this.exists=async(n,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===n:!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Oe.generateChildLogger(r,this.name)}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const i=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:ps(r.request.method,r.request.params,r.id),chainId:r.chainId};return i.push(n)}),i}async setJsonRpcRecords(i){await this.core.storage.setItem(this.storageKey,i)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(i){this.isInitialized();const r=this.records.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(kr.sync)}async restore(){try{const i=await this.getJsonRpcRecords();if(typeof i>"u"||!i.length)return;if(this.records.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}}registerEventListeners(){this.events.on(kr.created,i=>{const r=kr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:i}),this.persist()}),this.events.on(kr.updated,i=>{const r=kr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:i}),this.persist()}),this.events.on(kr.deleted,i=>{const r=kr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:i}),this.persist()}),this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(i=>{se.toMiliseconds(i.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${i.id}`),this.delete(i.topic,i.id))})}catch(i){this.logger.warn(i)}}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class Sb extends mm{constructor(i,r){super(i,r),this.core=i,this.logger=r,this.expirations=new Map,this.events=new Sr.EventEmitter,this.name=ib,this.version=sb,this.cached=[],this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const o=this.formatTarget(n);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(n,o)=>{this.isInitialized();const h=this.formatTarget(n),d={target:h,expiry:o};this.expirations.set(h,d),this.checkExpiry(h,d),this.events.emit(Pr.created,{target:h,expiration:d})},this.get=n=>{this.isInitialized();const o=this.formatTarget(n);return this.getExpiration(o)},this.del=n=>{if(this.isInitialized(),this.has(n)){const o=this.formatTarget(n),h=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Pr.deleted,{target:o,expiration:h})}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Oe.generateChildLogger(r,this.name)}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(i){if(typeof i=="string")return P1(i);if(typeof i=="number")return S1(i);const{message:r}=Z("UNKNOWN_TYPE",`Target type: ${typeof i}`);throw new Error(r)}async setExpirations(i){await this.core.storage.setItem(this.storageKey,i)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Pr.sync)}async restore(){try{const i=await this.getExpirations();if(typeof i>"u"||!i.length)return;if(this.expirations.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(i){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(i)}}getExpiration(i){const r=this.expirations.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(i,r){const{expiry:n}=r;se.toMiliseconds(n)-Date.now()<=0&&this.expire(i,r)}expire(i,r){this.expirations.delete(i),this.events.emit(Pr.expired,{target:i,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((i,r)=>this.checkExpiry(r,i))}registerEventListeners(){this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Pr.created,i=>{const r=Pr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),this.persist()}),this.events.on(Pr.expired,i=>{const r=Pr.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),this.persist()}),this.events.on(Pr.deleted,i=>{const r=Pr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),this.persist()})}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class Ab extends wm{constructor(i,r){super(i,r),this.projectId=i,this.logger=r,this.name=ec,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||A1()||!kl())return;const o=(n==null?void 0:n.verifyUrl)||lo;this.verifyUrl!==o&&this.removeIframe(),this.verifyUrl=o;try{await this.createIframe()}catch(h){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(h)}if(!this.initialized){this.removeIframe(),this.verifyUrl=hl;try{await this.createIframe()}catch(h){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(h),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const o=(n==null?void 0:n.verifyUrl)||lo;let h;try{h=await this.fetchAttestation(n.attestationId,o)}catch(d){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${o}`),this.logger.info(d),h=await this.fetchAttestation(n.attestationId,hl)}return h},this.fetchAttestation=async(n,o)=>{this.logger.info(`resolving attestation: ${n} from url: ${o}`);const h=this.startAbortTimer(se.ONE_SECOND*2),d=await fetch(`${o}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(h),d.status===200?await d.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var o;try{if(!this.iframe)return;(o=this.iframe.contentWindow)==null||o.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const o=h=>{h.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",o),n())};await Promise.race([new Promise(h=>{if(document.getElementById(ec))return h();window.addEventListener("message",o);const d=document.createElement("iframe");d.id=ec,d.src=`${this.verifyUrl}/${this.projectId}`,d.style.display="none",document.body.append(d),this.iframe=d,n=h}),new Promise((h,d)=>setTimeout(()=>{window.removeEventListener("message",o),d("verify iframe load timeout")},se.toMiliseconds(se.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.logger=Oe.generateChildLogger(r,this.name),this.verifyUrl=lo,this.abortController=new AbortController,this.isDevEnv=R1()&&{}.IS_VITEST}get context(){return Oe.getLoggerContext(this.logger)}startAbortTimer(i){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),se.toMiliseconds(i))}}var Rb=Object.defineProperty,ml=Object.getOwnPropertySymbols,Cb=Object.prototype.hasOwnProperty,Ob=Object.prototype.propertyIsEnumerable,wl=(u,i,r)=>i in u?Rb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,_l=(u,i)=>{for(var r in i||(i={}))Cb.call(i,r)&&wl(u,r,i[r]);if(ml)for(var r of ml(i))Ob.call(i,r)&&wl(u,r,i[r]);return u};class Pc extends lm{constructor(i){super(i),this.protocol=wf,this.version=T_,this.name=Ic,this.events=new Sr.EventEmitter,this.initialized=!1,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.projectId=i==null?void 0:i.projectId,this.relayUrl=(i==null?void 0:i.relayUrl)||bf;const r=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Oe.pino(Oe.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||N_.logger}));this.logger=Oe.generateChildLogger(r,this.name),this.heartbeat=new gs.HeartBeat,this.crypto=new ob(this,this.logger,i==null?void 0:i.keychain),this.history=new Pb(this,this.logger),this.expirer=new Sb(this,this.logger),this.storage=i!=null&&i.storage?i.storage:new rm(_l(_l({},F_),i==null?void 0:i.storageOptions)),this.relayer=new _b({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Ib(this,this.logger),this.verify=new Ab(this.projectId||"",this.logger)}static async init(i){const r=new Pc(i);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(J_,n),r}get context(){return Oe.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(i){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,i),this.logger.error(i.message),i}}}const Tb=Pc,Ef="wc",xf=2,If="client",Sc=`${Ef}@${xf}:${If}:`,rc={name:If,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},bl="WALLETCONNECT_DEEPLINK_CHOICE",Nb="proposal",Pf="Proposal expired",Fb="session",oo=se.SEVEN_DAYS,Db="engine",Hs={wc_sessionPropose:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1104},res:{ttl:se.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1106},res:{ttl:se.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1112},res:{ttl:se.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:se.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:se.THIRTY_SECONDS,prompt:!1,tag:1115}}},ic={min:se.FIVE_MINUTES,max:se.SEVEN_DAYS},ni={idle:"IDLE",active:"ACTIVE"},Lb="request",$b=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var qb=Object.defineProperty,Mb=Object.defineProperties,jb=Object.getOwnPropertyDescriptors,El=Object.getOwnPropertySymbols,Ub=Object.prototype.hasOwnProperty,zb=Object.prototype.propertyIsEnumerable,xl=(u,i,r)=>i in u?qb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,ar=(u,i)=>{for(var r in i||(i={}))Ub.call(i,r)&&xl(u,r,i[r]);if(El)for(var r of El(i))zb.call(i,r)&&xl(u,r,i[r]);return u},Bs=(u,i)=>Mb(u,jb(i));class kb extends bm{constructor(i){super(i),this.name=Db,this.events=new vc,this.initialized=!1,this.ignoredPayloadTypes=[Ul],this.requestQueue={state:ni.idle,queue:[]},this.sessionRequestQueue={state:ni.idle,queue:[]},this.requestQueueDelay=se.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Hs)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},se.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Bs(ar({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:o,requiredNamespaces:h,optionalNamespaces:d,sessionProperties:v,relays:_}=n;let S=o,F,k=!1;if(S&&(k=this.client.core.pairing.pairings.get(S).active),!S||!k){const{topic:pe,uri:he}=await this.client.core.pairing.create();S=pe,F=he}const B=await this.client.core.crypto.generateKeyPair(),K=ar({requiredNamespaces:h,optionalNamespaces:d,relays:_??[{protocol:_f}],proposer:{publicKey:B,metadata:this.client.metadata}},v&&{sessionProperties:v}),{reject:q,resolve:W,done:ie}=us(se.FIVE_MINUTES,Pf);if(this.events.once(Ft("session_connect"),async({error:pe,session:he})=>{if(pe)q(pe);else if(he){he.self.publicKey=B;const le=Bs(ar({},he),{requiredNamespaces:he.requiredNamespaces,optionalNamespaces:he.optionalNamespaces});await this.client.session.set(he.topic,le),await this.setExpiry(he.topic,he.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:he.peer.metadata}),W(le)}}),!S){const{message:pe}=Z("NO_MATCHING_KEY",`connect() pairing topic: ${S}`);throw new Error(pe)}const Ee=await this.sendRequest({topic:S,method:"wc_sessionPropose",params:K}),ge=Fr(se.FIVE_MINUTES);return await this.setProposal(Ee,ar({id:Ee,expiry:ge},K)),{uri:F,approval:ie}},this.pair=async r=>(await this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{await this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:o,namespaces:h,sessionProperties:d}=r,v=this.client.proposal.get(n);let{pairingTopic:_,proposer:S,requiredNamespaces:F,optionalNamespaces:k}=v;_=_||"",ho(F)||(F=O1(h,"approve()"));const B=await this.client.core.crypto.generateKeyPair(),K=S.publicKey,q=await this.client.core.crypto.generateSharedKey(B,K);_&&n&&(await this.client.core.pairing.updateMetadata({topic:_,metadata:S.metadata}),await this.sendResult({id:n,topic:_,result:{relay:{protocol:o??"irn"},responderPublicKey:B}}),await this.client.proposal.delete(n,er("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:_}));const W=ar({relay:{protocol:o??"irn"},namespaces:h,requiredNamespaces:F,optionalNamespaces:k,pairingTopic:_,controller:{publicKey:B,metadata:this.client.metadata},expiry:Fr(oo)},d&&{sessionProperties:d});await this.client.core.relayer.subscribe(q),await this.sendRequest({topic:q,method:"wc_sessionSettle",params:W,throwOnFailedPublish:!0});const ie=Bs(ar({},W),{topic:q,pairingTopic:_,acknowledged:!1,self:W.controller,peer:{publicKey:S.publicKey,metadata:S.metadata},controller:B});return await this.client.session.set(q,ie),await this.setExpiry(q,Fr(oo)),{topic:q,acknowledged:()=>new Promise(Ee=>setTimeout(()=>Ee(this.client.session.get(q)),500))}},this.reject=async r=>{await this.isInitialized(),await this.isValidReject(r);const{id:n,reason:o}=r,{pairingTopic:h}=this.client.proposal.get(n);h&&(await this.sendError(n,h,o),await this.client.proposal.delete(n,er("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:o}=r,h=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:o}}),{done:d,resolve:v,reject:_}=us();return this.events.once(Ft("session_update",h),({error:S})=>{S?_(S):v()}),await this.client.session.update(n,{namespaces:o}),{acknowledged:d}},this.extend=async r=>{await this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,o=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:h,resolve:d,reject:v}=us();return this.events.once(Ft("session_extend",o),({error:_})=>{_?v(_):d()}),await this.setExpiry(n,Fr(oo)),{acknowledged:h}},this.request=async r=>{await this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:o,topic:h,expiry:d}=r,v=bc(),{done:_,resolve:S,reject:F}=us(d);return this.events.once(Ft("session_request",v),({error:k,result:B})=>{k?F(k):S(B)}),await Promise.all([new Promise(async k=>{await this.sendRequest({clientRpcId:v,topic:h,method:"wc_sessionRequest",params:{request:o,chainId:n},expiry:d,throwOnFailedPublish:!0}).catch(B=>F(B)),this.client.events.emit("session_request_sent",{topic:h,request:o,chainId:n,id:v}),k()}),new Promise(async k=>{const B=await this.client.core.storage.getItem(bl);T1({id:v,topic:h,wcDeepLink:B}),k()}),_()]).then(k=>k[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:o}=r,{id:h}=o;oi(o)?await this.sendResult({id:h,topic:n,result:o.result,throwOnFailedPublish:!0}):Dr(o)&&await this.sendError(h,n,o.error),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const o=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:h,resolve:d,reject:v}=us();this.events.once(Ft("session_ping",o),({error:_})=>{_?v(_):d()}),await h()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:o,chainId:h}=r;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:o,chainId:h}})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:er("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>N1(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(h=>{var d,v;return((d=h.peerMetadata)==null?void 0:d.url)&&((v=h.peerMetadata)==null?void 0:v.url)===r.peer.metadata.url&&h.topic&&h.topic!==n.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(h=>this.client.core.pairing.disconnect({topic:h.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,er("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(bl).catch(h=>this.client.logger.warn(h))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,er("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),o?Promise.resolve():this.client.core.expirer.del(r)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(h=>h.id!==r),o&&(this.sessionRequestQueue.state=ni.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=Hs.wc_sessionRequest.req.ttl,{id:o,topic:h,params:d,verifyContext:v}=r;await this.client.pendingRequest.set(o,{id:o,topic:h,params:d,verifyContext:v}),n&&this.client.core.expirer.set(o,Fr(n))},this.sendRequest=async r=>{const{topic:n,method:o,params:h,expiry:d,relayRpcId:v,clientRpcId:_,throwOnFailedPublish:S}=r,F=ps(o,h,_);if(kl()&&$b.includes(o)){const K=fs(JSON.stringify(F));this.client.core.verify.register({attestationId:K})}const k=await this.client.core.crypto.encode(n,F),B=Hs[o].req;return d&&(B.ttl=d),v&&(B.id=v),this.client.core.history.set(n,F),S?(B.internal=Bs(ar({},B.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,k,B)):this.client.core.relayer.publish(n,k,B).catch(K=>this.client.logger.error(K)),F.id},this.sendResult=async r=>{const{id:n,topic:o,result:h,throwOnFailedPublish:d}=r,v=Ec(n,h),_=await this.client.core.crypto.encode(o,v),S=await this.client.core.history.get(o,n),F=Hs[S.request.method].res;d?(F.internal=Bs(ar({},F.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(o,_,F)):this.client.core.relayer.publish(o,_,F).catch(k=>this.client.logger.error(k)),await this.client.core.history.resolve(v)},this.sendError=async(r,n,o)=>{const h=mo(r,o),d=await this.client.core.crypto.encode(n,h),v=await this.client.core.history.get(n,r),_=Hs[v.request.method].res;this.client.core.relayer.publish(n,d,_),await this.client.core.history.resolve(h)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(o=>{mi(o.expiry)&&r.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{mi(o.expiry)&&n.push(o.id)}),await Promise.all([...r.map(o=>this.deleteSession(o)),...n.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===ni.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ni.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=ni.idle},this.processRequest=r=>{const{topic:n,payload:o}=r,h=o.method;switch(h){case"wc_sessionPropose":return this.onSessionProposeRequest(n,o);case"wc_sessionSettle":return this.onSessionSettleRequest(n,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,o);case"wc_sessionExtend":return this.onSessionExtendRequest(n,o);case"wc_sessionPing":return this.onSessionPingRequest(n,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,o);case"wc_sessionRequest":return this.onSessionRequest(n,o);case"wc_sessionEvent":return this.onSessionEventRequest(n,o);default:return this.client.logger.info(`Unsupported request method ${h}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:o}=r,h=(await this.client.core.history.get(n,o.id)).request.method;switch(h){case"wc_sessionPropose":return this.onSessionProposeResponse(n,o);case"wc_sessionSettle":return this.onSessionSettleResponse(n,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,o);case"wc_sessionExtend":return this.onSessionExtendResponse(n,o);case"wc_sessionPing":return this.onSessionPingResponse(n,o);case"wc_sessionRequest":return this.onSessionRequestResponse(n,o);default:return this.client.logger.info(`Unsupported response method ${h}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:o}=Z("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(r,n)=>{const{params:o,id:h}=n;try{this.isValidConnect(ar({},n.params));const d=Fr(se.FIVE_MINUTES),v=ar({id:h,pairingTopic:r,expiry:d},o);await this.setProposal(h,v);const _=fs(JSON.stringify(n)),S=await this.getVerifyContext(_,v.proposer.metadata);this.client.events.emit("session_proposal",{id:h,params:v,verifyContext:S})}catch(d){await this.sendError(h,r,d),this.client.logger.error(d)}},this.onSessionProposeResponse=async(r,n)=>{const{id:o}=n;if(oi(n)){const{result:h}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:h});const d=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:d});const v=d.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:v});const _=h.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:_});const S=await this.client.core.crypto.generateSharedKey(v,_);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:S});const F=await this.client.core.relayer.subscribe(S);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:F}),await this.client.core.pairing.activate({topic:r})}else Dr(n)&&(await this.client.proposal.delete(o,er("USER_DISCONNECTED")),this.events.emit(Ft("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:o,params:h}=n;try{this.isValidSessionSettleRequest(h);const{relay:d,controller:v,expiry:_,namespaces:S,requiredNamespaces:F,optionalNamespaces:k,sessionProperties:B,pairingTopic:K}=n.params,q=ar({topic:r,relay:d,expiry:_,namespaces:S,acknowledged:!0,pairingTopic:K,requiredNamespaces:F,optionalNamespaces:k,controller:v.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:v.publicKey,metadata:v.metadata}},B&&{sessionProperties:B});await this.sendResult({id:n.id,topic:r,result:!0}),this.events.emit(Ft("session_connect"),{session:q}),this.cleanupDuplicatePairings(q)}catch(d){await this.sendError(o,r,d),this.client.logger.error(d)}},this.onSessionSettleResponse=async(r,n)=>{const{id:o}=n;oi(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Ft("session_approve",o),{})):Dr(n)&&(await this.client.session.delete(r,er("USER_DISCONNECTED")),this.events.emit(Ft("session_approve",o),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:o,id:h}=n;try{const d=`${r}_session_update`,v=no.get(d);if(v&&this.isRequestOutOfSync(v,h)){this.client.logger.info(`Discarding out of sync request - ${h}`);return}this.isValidUpdate(ar({topic:r},o)),await this.client.session.update(r,{namespaces:o.namespaces}),await this.sendResult({id:h,topic:r,result:!0}),this.client.events.emit("session_update",{id:h,topic:r,params:o}),no.set(d,h)}catch(d){await this.sendError(h,r,d),this.client.logger.error(d)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:o}=n;oi(n)?this.events.emit(Ft("session_update",o),{}):Dr(n)&&this.events.emit(Ft("session_update",o),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:o}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Fr(oo)),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_extend",{id:o,topic:r})}catch(h){await this.sendError(o,r,h),this.client.logger.error(h)}},this.onSessionExtendResponse=(r,n)=>{const{id:o}=n;oi(n)?this.events.emit(Ft("session_extend",o),{}):Dr(n)&&this.events.emit(Ft("session_extend",o),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:o}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_ping",{id:o,topic:r})}catch(h){await this.sendError(o,r,h),this.client.logger.error(h)}},this.onSessionPingResponse=(r,n)=>{const{id:o}=n;setTimeout(()=>{oi(n)?this.events.emit(Ft("session_ping",o),{}):Dr(n)&&this.events.emit(Ft("session_ping",o),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:o}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(h=>{this.client.core.relayer.once(Kt.publish,async()=>{h(await this.deleteSession(r))})}),this.sendResult({id:o,topic:r,result:!0})]),this.client.events.emit("session_delete",{id:o,topic:r})}catch(h){this.client.logger.error(h)}},this.onSessionRequest=async(r,n)=>{const{id:o,params:h}=n;try{this.isValidRequest(ar({topic:r},h));const d=fs(JSON.stringify(ps("wc_sessionRequest",h,o))),v=this.client.session.get(r),_=await this.getVerifyContext(d,v.peer.metadata),S={id:o,topic:r,params:h,verifyContext:_};await this.setPendingSessionRequest(S),this.addSessionRequestToSessionRequestQueue(S),this.processSessionRequestQueue()}catch(d){await this.sendError(o,r,d),this.client.logger.error(d)}},this.onSessionRequestResponse=(r,n)=>{const{id:o}=n;oi(n)?this.events.emit(Ft("session_request",o),{result:n.result}):Dr(n)&&this.events.emit(Ft("session_request",o),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:o,params:h}=n;try{const d=`${r}_session_event_${h.event.name}`,v=no.get(d);if(v&&this.isRequestOutOfSync(v,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidEmit(ar({topic:r},h)),this.client.events.emit("session_event",{id:o,topic:r,params:h}),no.set(d,o)}catch(d){await this.sendError(o,r,d),this.client.logger.error(d)}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ni.idle,this.processSessionRequestQueue()},se.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ni.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=ni.active,this.client.events.emit("session_request",r)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=r=>{if(r.active)return;const n=this.client.proposal.getAll().find(o=>o.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,ps("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer},n.id))},this.isValidConnect=async r=>{if(!cr(r)){const{message:_}=Z("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(_)}const{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:h,sessionProperties:d,relays:v}=r;if(wi(n)||await this.isValidPairingTopic(n),!F1(v,!0)){const{message:_}=Z("MISSING_OR_INVALID",`connect() relays: ${v}`);throw new Error(_)}!wi(o)&&ho(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!wi(h)&&ho(h)!==0&&this.validateNamespaces(h,"optionalNamespaces"),wi(d)||this.validateSessionProps(d,"sessionProperties")},this.validateNamespaces=(r,n)=>{const o=D1(r,"connect()",n);if(o)throw new Error(o.message)},this.isValidApprove=async r=>{if(!cr(r))throw new Error(Z("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:o,relayProtocol:h,sessionProperties:d}=r;await this.isValidProposalId(n);const v=this.client.proposal.get(n),_=Ka(o,"approve()");if(_)throw new Error(_.message);const S=Th(v.requiredNamespaces,o,"approve()");if(S)throw new Error(S.message);if(!hs(h,!0)){const{message:F}=Z("MISSING_OR_INVALID",`approve() relayProtocol: ${h}`);throw new Error(F)}wi(d)||this.validateSessionProps(d,"sessionProperties")},this.isValidReject=async r=>{if(!cr(r)){const{message:h}=Z("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(h)}const{id:n,reason:o}=r;if(await this.isValidProposalId(n),!L1(o)){const{message:h}=Z("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(h)}},this.isValidSessionSettleRequest=r=>{if(!cr(r)){const{message:S}=Z("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(S)}const{relay:n,controller:o,namespaces:h,expiry:d}=r;if(!$1(n)){const{message:S}=Z("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(S)}const v=q1(o,"onSessionSettleRequest()");if(v)throw new Error(v.message);const _=Ka(h,"onSessionSettleRequest()");if(_)throw new Error(_.message);if(mi(d)){const{message:S}=Z("EXPIRED","onSessionSettleRequest()");throw new Error(S)}},this.isValidUpdate=async r=>{if(!cr(r)){const{message:_}=Z("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(_)}const{topic:n,namespaces:o}=r;await this.isValidSessionTopic(n);const h=this.client.session.get(n),d=Ka(o,"update()");if(d)throw new Error(d.message);const v=Th(h.requiredNamespaces,o,"update()");if(v)throw new Error(v.message)},this.isValidExtend=async r=>{if(!cr(r)){const{message:o}=Z("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(o)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!cr(r)){const{message:_}=Z("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(_)}const{topic:n,request:o,chainId:h,expiry:d}=r;await this.isValidSessionTopic(n);const{namespaces:v}=this.client.session.get(n);if(!Nh(v,h)){const{message:_}=Z("MISSING_OR_INVALID",`request() chainId: ${h}`);throw new Error(_)}if(!M1(o)){const{message:_}=Z("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(_)}if(!j1(v,h,o.method)){const{message:_}=Z("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(_)}if(d&&!U1(d,ic)){const{message:_}=Z("MISSING_OR_INVALID",`request() expiry: ${d}. Expiry must be a number (in seconds) between ${ic.min} and ${ic.max}`);throw new Error(_)}},this.isValidRespond=async r=>{if(!cr(r)){const{message:h}=Z("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(h)}const{topic:n,response:o}=r;if(await this.isValidSessionTopic(n),!z1(o)){const{message:h}=Z("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(h)}},this.isValidPing=async r=>{if(!cr(r)){const{message:o}=Z("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(o)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!cr(r)){const{message:v}=Z("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(v)}const{topic:n,event:o,chainId:h}=r;await this.isValidSessionTopic(n);const{namespaces:d}=this.client.session.get(n);if(!Nh(d,h)){const{message:v}=Z("MISSING_OR_INVALID",`emit() chainId: ${h}`);throw new Error(v)}if(!k1(o)){const{message:v}=Z("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}if(!H1(d,h,o.name)){const{message:v}=Z("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}},this.isValidDisconnect=async r=>{if(!cr(r)){const{message:o}=Z("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(o)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const o={verified:{verifyUrl:n.verifyUrl||lo,validation:"UNKNOWN",origin:n.url||""}};try{const h=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});h&&(o.verified.origin=h.origin,o.verified.isScam=h.isScam,o.verified.validation=h.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(h){this.client.logger.info(h)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(o=>{if(!hs(o,!1)){const{message:h}=Z("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(o)}`);throw new Error(h)}})}}async isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Kt.message,async i=>{const{topic:r,message:n}=i;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const o=await this.client.core.crypto.decode(r,n);try{xc(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o})):wo(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o})}catch(h){this.client.logger.error(h)}})}registerExpirerEvents(){this.client.core.expirer.on(Pr.expired,async i=>{const{topic:r,id:n}=zl(i.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Z("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(Gs.create,i=>this.onPairingCreated(i))}isValidPairingTopic(i){if(!hs(i,!1)){const{message:r}=Z("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(i)){const{message:r}=Z("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(r)}if(mi(this.client.core.pairing.pairings.get(i).expiry)){const{message:r}=Z("EXPIRED",`pairing topic: ${i}`);throw new Error(r)}}async isValidSessionTopic(i){if(!hs(i,!1)){const{message:r}=Z("MISSING_OR_INVALID",`session topic should be a string: ${i}`);throw new Error(r)}if(!this.client.session.keys.includes(i)){const{message:r}=Z("NO_MATCHING_KEY",`session topic doesn't exist: ${i}`);throw new Error(r)}if(mi(this.client.session.get(i).expiry)){await this.deleteSession(i);const{message:r}=Z("EXPIRED",`session topic: ${i}`);throw new Error(r)}}async isValidSessionOrPairingTopic(i){if(this.client.session.keys.includes(i))await this.isValidSessionTopic(i);else if(this.client.core.pairing.pairings.keys.includes(i))this.isValidPairingTopic(i);else if(hs(i,!1)){const{message:r}=Z("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${i}`);throw new Error(r)}else{const{message:r}=Z("MISSING_OR_INVALID",`session or pairing topic should be a string: ${i}`);throw new Error(r)}}async isValidProposalId(i){if(!B1(i)){const{message:r}=Z("MISSING_OR_INVALID",`proposal id should be a number: ${i}`);throw new Error(r)}if(!this.client.proposal.keys.includes(i)){const{message:r}=Z("NO_MATCHING_KEY",`proposal id doesn't exist: ${i}`);throw new Error(r)}if(mi(this.client.proposal.get(i).expiry)){await this.deleteProposal(i);const{message:r}=Z("EXPIRED",`proposal id: ${i}`);throw new Error(r)}}}class Hb extends bo{constructor(i,r){super(i,r,Nb,Sc),this.core=i,this.logger=r}}class Bb extends bo{constructor(i,r){super(i,r,Fb,Sc),this.core=i,this.logger=r}}class Vb extends bo{constructor(i,r){super(i,r,Lb,Sc,n=>n.id),this.core=i,this.logger=r}}let Kb=class Sf extends _m{constructor(i){super(i),this.protocol=Ef,this.version=xf,this.name=rc.name,this.events=new Sr.EventEmitter,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(o){throw this.logger.error(o.message),o}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(o){throw this.logger.error(o.message),o}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(o){throw this.logger.error(o.message),o}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(o){throw this.logger.error(o.message),o}},this.update=async n=>{try{return await this.engine.update(n)}catch(o){throw this.logger.error(o.message),o}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(o){throw this.logger.error(o.message),o}},this.request=async n=>{try{return await this.engine.request(n)}catch(o){throw this.logger.error(o.message),o}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(o){throw this.logger.error(o.message),o}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(o){throw this.logger.error(o.message),o}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(o){throw this.logger.error(o.message),o}},this.find=n=>{try{return this.engine.find(n)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=(i==null?void 0:i.name)||rc.name,this.metadata=(i==null?void 0:i.metadata)||C1();const r=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Oe.pino(Oe.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||rc.logger}));this.core=(i==null?void 0:i.core)||new Tb(i),this.logger=Oe.generateChildLogger(r,this.name),this.session=new Bb(this.core,this.logger),this.proposal=new Hb(this.core,this.logger),this.pendingRequest=new Vb(this.core,this.logger),this.engine=new kb(this)}static async init(i){const r=new Sf(i);return await r.initialize(),r}get context(){return Oe.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(i){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(i.message),i}}};var fc={exports:{}};(function(u,i){var r=typeof self<"u"?self:ur,n=function(){function h(){this.fetch=!1,this.DOMException=r.DOMException}return h.prototype=r,new h}();(function(h){(function(d){var v={searchParams:"URLSearchParams"in h,iterable:"Symbol"in h&&"iterator"in Symbol,blob:"FileReader"in h&&"Blob"in h&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in h,arrayBuffer:"ArrayBuffer"in h};function _(y){return y&&DataView.prototype.isPrototypeOf(y)}if(v.arrayBuffer)var S=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],F=ArrayBuffer.isView||function(y){return y&&S.indexOf(Object.prototype.toString.call(y))>-1};function k(y){if(typeof y!="string"&&(y=String(y)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(y))throw new TypeError("Invalid character in header field name");return y.toLowerCase()}function B(y){return typeof y!="string"&&(y=String(y)),y}function K(y){var E={next:function(){var Y=y.shift();return{done:Y===void 0,value:Y}}};return v.iterable&&(E[Symbol.iterator]=function(){return E}),E}function q(y){this.map={},y instanceof q?y.forEach(function(E,Y){this.append(Y,E)},this):Array.isArray(y)?y.forEach(function(E){this.append(E[0],E[1])},this):y&&Object.getOwnPropertyNames(y).forEach(function(E){this.append(E,y[E])},this)}q.prototype.append=function(y,E){y=k(y),E=B(E);var Y=this.map[y];this.map[y]=Y?Y+", "+E:E},q.prototype.delete=function(y){delete this.map[k(y)]},q.prototype.get=function(y){return y=k(y),this.has(y)?this.map[y]:null},q.prototype.has=function(y){return this.map.hasOwnProperty(k(y))},q.prototype.set=function(y,E){this.map[k(y)]=B(E)},q.prototype.forEach=function(y,E){for(var Y in this.map)this.map.hasOwnProperty(Y)&&y.call(E,this.map[Y],Y,this)},q.prototype.keys=function(){var y=[];return this.forEach(function(E,Y){y.push(Y)}),K(y)},q.prototype.values=function(){var y=[];return this.forEach(function(E){y.push(E)}),K(y)},q.prototype.entries=function(){var y=[];return this.forEach(function(E,Y){y.push([Y,E])}),K(y)},v.iterable&&(q.prototype[Symbol.iterator]=q.prototype.entries);function W(y){if(y.bodyUsed)return Promise.reject(new TypeError("Already read"));y.bodyUsed=!0}function ie(y){return new Promise(function(E,Y){y.onload=function(){E(y.result)},y.onerror=function(){Y(y.error)}})}function Ee(y){var E=new FileReader,Y=ie(E);return E.readAsArrayBuffer(y),Y}function ge(y){var E=new FileReader,Y=ie(E);return E.readAsText(y),Y}function pe(y){for(var E=new Uint8Array(y),Y=new Array(E.length),ce=0;ce-1?E:y}function G(y,E){E=E||{};var Y=E.body;if(y instanceof G){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,E.headers||(this.headers=new q(y.headers)),this.method=y.method,this.mode=y.mode,this.signal=y.signal,!Y&&y._bodyInit!=null&&(Y=y._bodyInit,y.bodyUsed=!0)}else this.url=String(y);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new q(E.headers)),this.method=M(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")&&Y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Y)}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function ye(y){var E=new FormData;return y.trim().split("&").forEach(function(Y){if(Y){var ce=Y.split("="),H=ce.shift().replace(/\+/g," "),j=ce.join("=").replace(/\+/g," ");E.append(decodeURIComponent(H),decodeURIComponent(j))}}),E}function re(y){var E=new q,Y=y.replace(/\r?\n[\t ]+/g," ");return Y.split(/\r?\n/).forEach(function(ce){var H=ce.split(":"),j=H.shift().trim();if(j){var z=H.join(":").trim();E.append(j,z)}}),E}le.call(G.prototype);function ue(y,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 q(E.headers),this.url=E.url||"",this._initBody(y)}le.call(ue.prototype),ue.prototype.clone=function(){return new ue(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new q(this.headers),url:this.url})},ue.error=function(){var y=new ue(null,{status:0,statusText:""});return y.type="error",y};var Te=[301,302,303,307,308];ue.redirect=function(y,E){if(Te.indexOf(E)===-1)throw new RangeError("Invalid status code");return new ue(null,{status:E,headers:{location:y}})},d.DOMException=h.DOMException;try{new d.DOMException}catch{d.DOMException=function(E,Y){this.message=E,this.name=Y;var ce=Error(E);this.stack=ce.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function Ue(y,E){return new Promise(function(Y,ce){var H=new G(y,E);if(H.signal&&H.signal.aborted)return ce(new d.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function z(){j.abort()}j.onload=function(){var V={status:j.status,statusText:j.statusText,headers:re(j.getAllResponseHeaders()||"")};V.url="responseURL"in j?j.responseURL:V.headers.get("X-Request-URL");var Je="response"in j?j.response:j.responseText;Y(new ue(Je,V))},j.onerror=function(){ce(new TypeError("Network request failed"))},j.ontimeout=function(){ce(new TypeError("Network request failed"))},j.onabort=function(){ce(new d.DOMException("Aborted","AbortError"))},j.open(H.method,H.url,!0),H.credentials==="include"?j.withCredentials=!0:H.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&v.blob&&(j.responseType="blob"),H.headers.forEach(function(V,Je){j.setRequestHeader(Je,V)}),H.signal&&(H.signal.addEventListener("abort",z),j.onreadystatechange=function(){j.readyState===4&&H.signal.removeEventListener("abort",z)}),j.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return Ue.polyfill=!0,h.fetch||(h.fetch=Ue,h.Headers=q,h.Request=G,h.Response=ue),d.Headers=q,d.Request=G,d.Response=ue,d.fetch=Ue,Object.defineProperty(d,"__esModule",{value:!0}),d})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;i=o.fetch,i.default=o.fetch,i.fetch=o.fetch,i.Headers=o.Headers,i.Request=o.Request,i.Response=o.Response,u.exports=i})(fc,fc.exports);var Gb=fc.exports;const Il=jl(Gb),Wb={Accept:"application/json","Content-Type":"application/json"},Jb="POST",Pl={headers:Wb,method:Jb},Sl=10;class zi{constructor(i,r=!1){if(this.url=i,this.disableProviderPing=r,this.events=new Sr.EventEmitter,this.isAvailable=!1,this.registering=!1,!Xh(i))throw new Error(`Provided URL is not compatible with HTTP connection: ${i}`);this.url=i,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async open(i=this.url){await this.register(i)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(i,r){this.isAvailable||await this.register();try{const n=Ys(i),h=await(await Il(this.url,Object.assign(Object.assign({},Pl),{body:n}))).json();this.onPayload({data:h})}catch(n){this.onError(i.id,n)}}async register(i=this.url){if(!Xh(i))throw new Error(`Provided URL is not compatible with HTTP connection: ${i}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",h=>{this.resetMaxListeners(),o(h)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));n()})})}this.url=i,this.registering=!0;try{if(!this.disableProviderPing){const r=Ys({id:1,jsonrpc:"2.0",method:"test",params:[]});await Il(i,Object.assign(Object.assign({},Pl),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(i){if(typeof i.data>"u")return;const r=typeof i.data=="string"?mc(i.data):i.data;this.events.emit("payload",r)}onError(i,r){const n=this.parseError(r),o=n.message||n.toString(),h=mo(i,o);this.events.emit("payload",h)}parseError(i,r=this.url){return rf(i,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Sl&&this.events.setMaxListeners(Sl)}}const Al="error",Qb="wss://relay.walletconnect.com",Yb="wc",Xb="universal_provider",Rl=`${Yb}@2:${Xb}:`,Zb="https://rpc.walletconnect.com/v1/",xi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pc={exports:{}};/** +import{e as ur,r as bi,f as o1,h as se,i as Sr,j as a1,w as ql,k as Ml,m as yc,t as yo,o as c1,p as jl,q as wi,D as u1,s as h1,N as Z,u as l1,v as cc,x as f1,V as p1,R as d1,F as Rh,K as g1,y as y1,L as v1,z as Ch,$ as m1,A as w1,B as Qs,Z as Oh,J as _1,X as b1,C as vc,_ as Ul,E as Fr,G as E1,H as x1,I as us,M as Ft,U as er,O as mi,P as cr,Q as I1,S as hs,T as zl,W as P1,Y as S1,a0 as A1,a1 as kl,a2 as R1,a3 as Hl,a4 as Bl,a5 as fs,a6 as uc,a7 as uo,a8 as ds,a9 as C1,aa as ho,ab as O1,ac as T1,ad as N1,ae as no,af as F1,ag as D1,ah as Ka,ai as Th,aj as L1,ak as $1,al as q1,am as Nh,an as M1,ao as j1,ap as U1,aq as z1,ar as k1,as as H1,at as B1,au as Ks,av as Vl,aw as Ga,ax as V1,ay as K1,az as G1}from"./index-d8f85335.js";var vo={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});function W1(u){if(typeof u!="string")throw new Error(`Cannot safe json parse value of type ${typeof u}`);try{return JSON.parse(u)}catch{return u}}Xs.safeJsonParse=W1;function J1(u){return typeof u=="string"?u:JSON.stringify(u,(i,r)=>typeof r>"u"?null:r)}Xs.safeJsonStringify=J1;var $s={exports:{}},Fh;function Q1(){return Fh||(Fh=1,function(){let u;function i(){}u=i,u.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},u.prototype.setItem=function(r,n){this[r]=String(n)},u.prototype.removeItem=function(r){delete this[r]},u.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},u.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},u.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof ur<"u"&&ur.localStorage?$s.exports=ur.localStorage:typeof window<"u"&&window.localStorage?$s.exports=window.localStorage:$s.exports=new i}()),$s.exports}var Wa={},qs={},Dh;function Y1(){if(Dh)return qs;Dh=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.IKeyValueStorage=void 0;class u{}return qs.IKeyValueStorage=u,qs}var Ms={},Lh;function X1(){if(Lh)return Ms;Lh=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.parseEntry=void 0;const u=Xs;function i(r){var n;return[r[0],u.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Ms.parseEntry=i,Ms}var $h;function Z1(){return $h||($h=1,function(u){Object.defineProperty(u,"__esModule",{value:!0});const i=bi;i.__exportStar(Y1(),u),i.__exportStar(X1(),u)}(Wa)),Wa}Object.defineProperty(vo,"__esModule",{value:!0});vo.KeyValueStorage=void 0;const ls=bi,qh=Xs,em=ls.__importDefault(Q1()),tm=Z1();class Kl{constructor(){this.localStorage=em.default}getKeys(){return ls.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return ls.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(tm.parseEntry)})}getItem(i){return ls.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(i);if(r!==null)return qh.safeJsonParse(r)})}setItem(i,r){return ls.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(i,qh.safeJsonStringify(r))})}removeItem(i){return ls.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(i)})}}vo.KeyValueStorage=Kl;var rm=vo.default=Kl,gs={},js={},Ja={},Us={};let Ui=class{};const im=Object.freeze(Object.defineProperty({__proto__:null,IEvents:Ui},Symbol.toStringTag,{value:"Module"})),sm=o1(im);var Mh;function nm(){if(Mh)return Us;Mh=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.IHeartBeat=void 0;const u=sm;class i extends u.IEvents{constructor(n){super()}}return Us.IHeartBeat=i,Us}var jh;function Gl(){return jh||(jh=1,function(u){Object.defineProperty(u,"__esModule",{value:!0}),bi.__exportStar(nm(),u)}(Ja)),Ja}var Qa={},Mi={},Uh;function om(){if(Uh)return Mi;Uh=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.HEARTBEAT_EVENTS=Mi.HEARTBEAT_INTERVAL=void 0;const u=se;return Mi.HEARTBEAT_INTERVAL=u.FIVE_SECONDS,Mi.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Mi}var zh;function Wl(){return zh||(zh=1,function(u){Object.defineProperty(u,"__esModule",{value:!0}),bi.__exportStar(om(),u)}(Qa)),Qa}var kh;function am(){if(kh)return js;kh=1,Object.defineProperty(js,"__esModule",{value:!0}),js.HeartBeat=void 0;const u=bi,i=Sr,r=se,n=Gl(),o=Wl();class h extends n.IHeartBeat{constructor(v){super(v),this.events=new i.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=(v==null?void 0:v.interval)||o.HEARTBEAT_INTERVAL}static init(v){return u.__awaiter(this,void 0,void 0,function*(){const _=new h(v);return yield _.init(),_})}init(){return u.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(v,_){this.events.on(v,_)}once(v,_){this.events.once(v,_)}off(v,_){this.events.off(v,_)}removeListener(v,_){this.events.removeListener(v,_)}initialize(){return u.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return js.HeartBeat=h,js}(function(u){Object.defineProperty(u,"__esModule",{value:!0});const i=bi;i.__exportStar(am(),u),i.__exportStar(Gl(),u),i.__exportStar(Wl(),u)})(gs);var Oe={},Ya,Hh;function cm(){if(Hh)return Ya;Hh=1;function u(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}Ya=i;function i(r,n,o){var h=o&&o.stringify||u,d=1;if(typeof r=="object"&&r!==null){var v=n.length+d;if(v===1)return r;var _=new Array(v);_[0]=h(r);for(var S=1;S-1?K:0,r.charCodeAt(W+1)){case 100:case 102:if(B>=F||n[B]==null)break;K=F||n[B]==null)break;K=F||n[B]===void 0)break;K",K=W+2,W++;break}k+=h(n[B]),K=W+2,W++;break;case 115:if(B>=F)break;K-1&&(ue=!1);const Te=["error","fatal","warn","info","debug","trace"];typeof G=="function"&&(G.error=G.fatal=G.warn=G.info=G.debug=G.trace=G),T.enabled===!1&&(T.level="silent");const Ue=T.level||"info",y=Object.create(G);y.log||(y.log=ie),Object.defineProperty(y,"levelVal",{get:Y}),Object.defineProperty(y,"level",{get:ce,set:H});const E={transmit:M,serialize:re,asObject:T.browser.asObject,levels:Te,timestamp:K(T)};y.levels=o.levels,y.level=Ue,y.setMaxListeners=y.getMaxListeners=y.emit=y.addListener=y.on=y.prependListener=y.once=y.prependOnceListener=y.removeListener=y.removeAllListeners=y.listeners=y.listenerCount=y.eventNames=y.write=y.flush=ie,y.serializers=ye,y._serialize=re,y._stdErrSerialize=ue,y.child=j,M&&(y._logEvent=k());function Y(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ce(){return this._level}function H(z){if(z!=="silent"&&!this.levels.values[z])throw Error("unknown level "+z);this._level=z,h(E,y,"error","log"),h(E,y,"fatal","error"),h(E,y,"warn","error"),h(E,y,"info","log"),h(E,y,"debug","log"),h(E,y,"trace","log")}function j(z,V){if(!z)throw new Error("missing bindings for child Pino");V=V||{},re&&z.serializers&&(V.serializers=z.serializers);const Je=V.serializers;if(re&&Je){var He=Object.assign({},ye,Je),Lr=T.browser.serialize===!0?Object.keys(He):re;delete z.serializers,_([z],Lr,He,this._stdErrSerialize)}function xe(xt){this._childLevel=(xt._childLevel|0)+1,this.error=S(xt,z,"error"),this.fatal=S(xt,z,"fatal"),this.warn=S(xt,z,"warn"),this.info=S(xt,z,"info"),this.debug=S(xt,z,"debug"),this.trace=S(xt,z,"trace"),He&&(this.serializers=He,this._serialize=Lr),M&&(this._logEvent=k([].concat(xt._logEvent.bindings,z)))}return xe.prototype=this,new xe(this)}return y}o.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},o.stdSerializers=r,o.stdTimeFunctions=Object.assign({},{nullTime:Ee,epochTime:ge,unixTime:pe,isoTime:he});function h(T,M,G,ye){const re=Object.getPrototypeOf(M);M[G]=M.levelVal>M.levels.values[G]?ie:re[G]?re[G]:i[G]||i[ye]||ie,d(T,M,G)}function d(T,M,G){!T.transmit&&M[G]===ie||(M[G]=function(ye){return function(){const ue=T.timestamp(),Te=new Array(arguments.length),Ue=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var y=0;y-1&&ue in G&&(T[re][ue]=G[ue](T[re][ue]))}function S(T,M,G){return function(){const ye=new Array(1+arguments.length);ye[0]=M;for(var re=1;re"u"?S=r(v,_):S=v.bindings().context||"",S}Zt.getLoggerContext=o;function h(v,_,S=u.PINO_CUSTOM_CONTEXT_KEY){const F=o(v,S);return F.trim()?`${F}/${_}`:_}Zt.formatChildLoggerContext=h;function d(v,_,S=u.PINO_CUSTOM_CONTEXT_KEY){const F=h(v,_,S),k=v.child({context:F});return n(k,F,S)}return Zt.generateChildLogger=d,Zt}(function(u){Object.defineProperty(u,"__esModule",{value:!0}),u.pino=void 0;const i=bi,r=i.__importDefault(um());Object.defineProperty(u,"pino",{enumerable:!0,get:function(){return r.default}}),i.__exportStar(Jl(),u),i.__exportStar(hm(),u)})(Oe);class lm extends Ui{constructor(i){super(),this.opts=i,this.protocol="wc",this.version=2}}class fm extends Ui{constructor(i,r){super(),this.core=i,this.logger=r,this.records=new Map}}class pm{constructor(i,r){this.logger=i,this.core=r}}let dm=class extends Ui{constructor(i,r){super(),this.relayer=i,this.logger=r}},gm=class extends Ui{constructor(i){super()}},ym=class{constructor(i,r,n,o){this.core=i,this.logger=r,this.name=n}};class vm extends Ui{constructor(i,r){super(),this.relayer=i,this.logger=r}}let mm=class extends Ui{constructor(i,r){super(),this.core=i,this.logger=r}},wm=class{constructor(i,r){this.projectId=i,this.logger=r}},_m=class{constructor(i){this.opts=i,this.protocol="wc",this.version=2}},bm=class{constructor(i){this.client=i}};const Em=u=>JSON.stringify(u,(i,r)=>typeof r=="bigint"?r.toString()+"n":r),xm=u=>{const i=/([\[:])?(\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,r=u.replace(i,'$1"$2n"$3');return JSON.parse(r,(n,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function mc(u){if(typeof u!="string")throw new Error(`Cannot safe json parse value of type ${typeof u}`);try{return xm(u)}catch{return u}}function Ys(u){return typeof u=="string"?u:Em(u)||""}var wc={},Ql={};(function(u){Object.defineProperty(u,"__esModule",{value:!0});var i=a1,r=ql;u.DIGEST_LENGTH=64,u.BLOCK_SIZE=128;var n=function(){function v(){this.digestLength=u.DIGEST_LENGTH,this.blockSize=u.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},v.prototype.update=function(_,S){if(S===void 0&&(S=_.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var F=0;if(this._bytesHashed+=S,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=_[F++],S--;this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(S>=this.blockSize&&(F=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,_,F,S),S%=this.blockSize);S>0;)this._buffer[this._bufferLength++]=_[F++],S--;return this},v.prototype.finish=function(_){if(!this._finished){var S=this._bytesHashed,F=this._bufferLength,k=S/536870912|0,B=S<<3,K=S%128<112?128:256;this._buffer[F]=128;for(var q=F+1;q0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(_){return this._stateHi.set(_.stateHi),this._stateLo.set(_.stateLo),this._bufferLength=_.bufferLength,_.buffer&&this._buffer.set(_.buffer),this._bytesHashed=_.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(_){r.wipe(_.stateHi),r.wipe(_.stateLo),_.buffer&&r.wipe(_.buffer),_.bufferLength=0,_.bytesHashed=0},v}();u.SHA512=n;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function h(v,_,S,F,k,B,K){for(var q=S[0],W=S[1],ie=S[2],Ee=S[3],ge=S[4],pe=S[5],he=S[6],le=S[7],T=F[0],M=F[1],G=F[2],ye=F[3],re=F[4],ue=F[5],Te=F[6],Ue=F[7],y,E,Y,ce,H,j,z,V;K>=128;){for(var Je=0;Je<16;Je++){var He=8*Je+B;v[Je]=i.readUint32BE(k,He),_[Je]=i.readUint32BE(k,He+4)}for(var Je=0;Je<80;Je++){var Lr=q,xe=W,xt=ie,O=Ee,C=ge,A=pe,c=he,b=le,ee=T,fe=M,_e=G,Ne=ye,De=re,Se=ue,It=Te,vt=Ue;if(y=le,E=Ue,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=(ge>>>14|re<<32-14)^(ge>>>18|re<<32-18)^(re>>>41-32|ge<<32-(41-32)),E=(re>>>14|ge<<32-14)^(re>>>18|ge<<32-18)^(ge>>>41-32|re<<32-(41-32)),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=ge&pe^~ge&he,E=re&ue^~re&Te,H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=o[Je*2],E=o[Je*2+1],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=v[Je%16],E=_[Je%16],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,Y=z&65535|V<<16,ce=H&65535|j<<16,y=Y,E=ce,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=(q>>>28|T<<32-28)^(T>>>34-32|q<<32-(34-32))^(T>>>39-32|q<<32-(39-32)),E=(T>>>28|q<<32-28)^(q>>>34-32|T<<32-(34-32))^(q>>>39-32|T<<32-(39-32)),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,y=q&W^q&ie^W&ie,E=T&M^T&G^M&G,H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,b=z&65535|V<<16,vt=H&65535|j<<16,y=O,E=Ne,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=Y,E=ce,H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,O=z&65535|V<<16,Ne=H&65535|j<<16,W=Lr,ie=xe,Ee=xt,ge=O,pe=C,he=A,le=c,q=b,M=ee,G=fe,ye=_e,re=Ne,ue=De,Te=Se,Ue=It,T=vt,Je%16===15)for(var He=0;He<16;He++)y=v[He],E=_[He],H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=v[(He+9)%16],E=_[(He+9)%16],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,Y=v[(He+1)%16],ce=_[(He+1)%16],y=(Y>>>1|ce<<32-1)^(Y>>>8|ce<<32-8)^Y>>>7,E=(ce>>>1|Y<<32-1)^(ce>>>8|Y<<32-8)^(ce>>>7|Y<<32-7),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,Y=v[(He+14)%16],ce=_[(He+14)%16],y=(Y>>>19|ce<<32-19)^(ce>>>61-32|Y<<32-(61-32))^Y>>>6,E=(ce>>>19|Y<<32-19)^(Y>>>61-32|ce<<32-(61-32))^(ce>>>6|Y<<32-6),H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,v[He]=z&65535|V<<16,_[He]=H&65535|j<<16}y=q,E=T,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[0],E=F[0],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[0]=q=z&65535|V<<16,F[0]=T=H&65535|j<<16,y=W,E=M,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[1],E=F[1],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[1]=W=z&65535|V<<16,F[1]=M=H&65535|j<<16,y=ie,E=G,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[2],E=F[2],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[2]=ie=z&65535|V<<16,F[2]=G=H&65535|j<<16,y=Ee,E=ye,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[3],E=F[3],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[3]=Ee=z&65535|V<<16,F[3]=ye=H&65535|j<<16,y=ge,E=re,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[4],E=F[4],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[4]=ge=z&65535|V<<16,F[4]=re=H&65535|j<<16,y=pe,E=ue,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[5],E=F[5],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[5]=pe=z&65535|V<<16,F[5]=ue=H&65535|j<<16,y=he,E=Te,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[6],E=F[6],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[6]=he=z&65535|V<<16,F[6]=Te=H&65535|j<<16,y=le,E=Ue,H=E&65535,j=E>>>16,z=y&65535,V=y>>>16,y=S[7],E=F[7],H+=E&65535,j+=E>>>16,z+=y&65535,V+=y>>>16,j+=H>>>16,z+=j>>>16,V+=z>>>16,S[7]=le=z&65535|V<<16,F[7]=Ue=H&65535|j<<16,B+=128,K-=128}return B}function d(v){var _=new n;_.update(v);var S=_.digest();return _.clean(),S}u.hash=d})(Ql);(function(u){Object.defineProperty(u,"__esModule",{value:!0}),u.convertSecretKeyToX25519=u.convertPublicKeyToX25519=u.verify=u.sign=u.extractPublicKeyFromSecretKey=u.generateKeyPair=u.generateKeyPairFromSeed=u.SEED_LENGTH=u.SECRET_KEY_LENGTH=u.PUBLIC_KEY_LENGTH=u.SIGNATURE_LENGTH=void 0;const i=Ml,r=Ql,n=ql;u.SIGNATURE_LENGTH=64,u.PUBLIC_KEY_LENGTH=32,u.SECRET_KEY_LENGTH=64,u.SEED_LENGTH=32;function o(O){const C=new Float64Array(16);if(O)for(let A=0;A>16&1),A[fe-1]&=65535;A[15]=c[15]-32767-(A[14]>>16&1);const ee=A[15]>>16&1;A[14]&=65535,W(c,A,1-ee)}for(let b=0;b<16;b++)O[2*b]=c[b]&255,O[2*b+1]=c[b]>>8}function Ee(O,C){let A=0;for(let c=0;c<32;c++)A|=O[c]^C[c];return(1&A-1>>>8)-1}function ge(O,C){const A=new Uint8Array(32),c=new Uint8Array(32);return ie(A,O),ie(c,C),Ee(A,c)}function pe(O){const C=new Uint8Array(32);return ie(C,O),C[0]&1}function he(O,C){for(let A=0;A<16;A++)O[A]=C[2*A]+(C[2*A+1]<<8);O[15]&=32767}function le(O,C,A){for(let c=0;c<16;c++)O[c]=C[c]+A[c]}function T(O,C,A){for(let c=0;c<16;c++)O[c]=C[c]-A[c]}function M(O,C,A){let c,b,ee=0,fe=0,_e=0,Ne=0,De=0,Se=0,It=0,vt=0,nt=0,$e=0,Ye=0,Xe=0,ot=0,ze=0,Ze=0,Fe=0,Be=0,ut=0,Me=0,Pt=0,Dt=0,Ut=0,zt=0,qt=0,Gt=0,tr=0,$r=0,Wt=0,Br=0,ai=0,Ii=0,ht=A[0],rt=A[1],lt=A[2],ft=A[3],at=A[4],it=A[5],St=A[6],At=A[7],pt=A[8],Rt=A[9],dt=A[10],mt=A[11],gt=A[12],Qe=A[13],Ct=A[14],Ot=A[15];c=C[0],ee+=c*ht,fe+=c*rt,_e+=c*lt,Ne+=c*ft,De+=c*at,Se+=c*it,It+=c*St,vt+=c*At,nt+=c*pt,$e+=c*Rt,Ye+=c*dt,Xe+=c*mt,ot+=c*gt,ze+=c*Qe,Ze+=c*Ct,Fe+=c*Ot,c=C[1],fe+=c*ht,_e+=c*rt,Ne+=c*lt,De+=c*ft,Se+=c*at,It+=c*it,vt+=c*St,nt+=c*At,$e+=c*pt,Ye+=c*Rt,Xe+=c*dt,ot+=c*mt,ze+=c*gt,Ze+=c*Qe,Fe+=c*Ct,Be+=c*Ot,c=C[2],_e+=c*ht,Ne+=c*rt,De+=c*lt,Se+=c*ft,It+=c*at,vt+=c*it,nt+=c*St,$e+=c*At,Ye+=c*pt,Xe+=c*Rt,ot+=c*dt,ze+=c*mt,Ze+=c*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=c*Ct,Ii+=c*Ot,ee+=38*Be,fe+=38*ut,_e+=38*Me,Ne+=38*Pt,De+=38*Dt,Se+=38*Ut,It+=38*zt,vt+=38*qt,nt+=38*Gt,$e+=38*tr,Ye+=38*$r,Xe+=38*Wt,ot+=38*Br,ze+=38*ai,Ze+=38*Ii,b=1,c=ee+b+65535,b=Math.floor(c/65536),ee=c-b*65536,c=fe+b+65535,b=Math.floor(c/65536),fe=c-b*65536,c=_e+b+65535,b=Math.floor(c/65536),_e=c-b*65536,c=Ne+b+65535,b=Math.floor(c/65536),Ne=c-b*65536,c=De+b+65535,b=Math.floor(c/65536),De=c-b*65536,c=Se+b+65535,b=Math.floor(c/65536),Se=c-b*65536,c=It+b+65535,b=Math.floor(c/65536),It=c-b*65536,c=vt+b+65535,b=Math.floor(c/65536),vt=c-b*65536,c=nt+b+65535,b=Math.floor(c/65536),nt=c-b*65536,c=$e+b+65535,b=Math.floor(c/65536),$e=c-b*65536,c=Ye+b+65535,b=Math.floor(c/65536),Ye=c-b*65536,c=Xe+b+65535,b=Math.floor(c/65536),Xe=c-b*65536,c=ot+b+65535,b=Math.floor(c/65536),ot=c-b*65536,c=ze+b+65535,b=Math.floor(c/65536),ze=c-b*65536,c=Ze+b+65535,b=Math.floor(c/65536),Ze=c-b*65536,c=Fe+b+65535,b=Math.floor(c/65536),Fe=c-b*65536,ee+=b-1+37*(b-1),b=1,c=ee+b+65535,b=Math.floor(c/65536),ee=c-b*65536,c=fe+b+65535,b=Math.floor(c/65536),fe=c-b*65536,c=_e+b+65535,b=Math.floor(c/65536),_e=c-b*65536,c=Ne+b+65535,b=Math.floor(c/65536),Ne=c-b*65536,c=De+b+65535,b=Math.floor(c/65536),De=c-b*65536,c=Se+b+65535,b=Math.floor(c/65536),Se=c-b*65536,c=It+b+65535,b=Math.floor(c/65536),It=c-b*65536,c=vt+b+65535,b=Math.floor(c/65536),vt=c-b*65536,c=nt+b+65535,b=Math.floor(c/65536),nt=c-b*65536,c=$e+b+65535,b=Math.floor(c/65536),$e=c-b*65536,c=Ye+b+65535,b=Math.floor(c/65536),Ye=c-b*65536,c=Xe+b+65535,b=Math.floor(c/65536),Xe=c-b*65536,c=ot+b+65535,b=Math.floor(c/65536),ot=c-b*65536,c=ze+b+65535,b=Math.floor(c/65536),ze=c-b*65536,c=Ze+b+65535,b=Math.floor(c/65536),Ze=c-b*65536,c=Fe+b+65535,b=Math.floor(c/65536),Fe=c-b*65536,ee+=b-1+37*(b-1),O[0]=ee,O[1]=fe,O[2]=_e,O[3]=Ne,O[4]=De,O[5]=Se,O[6]=It,O[7]=vt,O[8]=nt,O[9]=$e,O[10]=Ye,O[11]=Xe,O[12]=ot,O[13]=ze,O[14]=Ze,O[15]=Fe}function G(O,C){M(O,C,C)}function ye(O,C){const A=o();let c;for(c=0;c<16;c++)A[c]=C[c];for(c=253;c>=0;c--)G(A,A),c!==2&&c!==4&&M(A,A,C);for(c=0;c<16;c++)O[c]=A[c]}function re(O,C){const A=o();let c;for(c=0;c<16;c++)A[c]=C[c];for(c=250;c>=0;c--)G(A,A),c!==1&&M(A,A,C);for(c=0;c<16;c++)O[c]=A[c]}function ue(O,C){const A=o(),c=o(),b=o(),ee=o(),fe=o(),_e=o(),Ne=o(),De=o(),Se=o();T(A,O[1],O[0]),T(Se,C[1],C[0]),M(A,A,Se),le(c,O[0],O[1]),le(Se,C[0],C[1]),M(c,c,Se),M(b,O[3],C[3]),M(b,b,S),M(ee,O[2],C[2]),le(ee,ee,ee),T(fe,c,A),T(_e,ee,b),le(Ne,ee,b),le(De,c,A),M(O[0],fe,_e),M(O[1],De,Ne),M(O[2],Ne,_e),M(O[3],fe,De)}function Te(O,C,A){for(let c=0;c<4;c++)W(O[c],C[c],A)}function Ue(O,C){const A=o(),c=o(),b=o();ye(b,C[2]),M(A,C[0],b),M(c,C[1],b),ie(O,c),O[31]^=pe(A)<<7}function y(O,C,A){K(O[0],d),K(O[1],v),K(O[2],v),K(O[3],d);for(let c=255;c>=0;--c){const b=A[c/8|0]>>(c&7)&1;Te(O,C,b),ue(C,O),ue(O,O),Te(O,C,b)}}function E(O,C){const A=[o(),o(),o(),o()];K(A[0],F),K(A[1],k),K(A[2],v),M(A[3],F,k),y(O,A,C)}function Y(O){if(O.length!==u.SEED_LENGTH)throw new Error(`ed25519: seed must be ${u.SEED_LENGTH} bytes`);const C=(0,r.hash)(O);C[0]&=248,C[31]&=127,C[31]|=64;const A=new Uint8Array(32),c=[o(),o(),o(),o()];E(c,C),Ue(A,c);const b=new Uint8Array(64);return b.set(O),b.set(A,32),{publicKey:A,secretKey:b}}u.generateKeyPairFromSeed=Y;function ce(O){const C=(0,i.randomBytes)(32,O),A=Y(C);return(0,n.wipe)(C),A}u.generateKeyPair=ce;function H(O){if(O.length!==u.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${u.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(O.subarray(32))}u.extractPublicKeyFromSecretKey=H;const j=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function z(O,C){let A,c,b,ee;for(c=63;c>=32;--c){for(A=0,b=c-32,ee=c-12;b>4)*j[b],A=C[b]>>8,C[b]&=255;for(b=0;b<32;b++)C[b]-=A*j[b];for(c=0;c<32;c++)C[c+1]+=C[c]>>8,O[c]=C[c]&255}function V(O){const C=new Float64Array(64);for(let A=0;A<64;A++)C[A]=O[A];for(let A=0;A<64;A++)O[A]=0;z(O,C)}function Je(O,C){const A=new Float64Array(64),c=[o(),o(),o(),o()],b=(0,r.hash)(O.subarray(0,32));b[0]&=248,b[31]&=127,b[31]|=64;const ee=new Uint8Array(64);ee.set(b.subarray(32),32);const fe=new r.SHA512;fe.update(ee.subarray(32)),fe.update(C);const _e=fe.digest();fe.clean(),V(_e),E(c,_e),Ue(ee,c),fe.reset(),fe.update(ee.subarray(0,32)),fe.update(O.subarray(32)),fe.update(C);const Ne=fe.digest();V(Ne);for(let De=0;De<32;De++)A[De]=_e[De];for(let De=0;De<32;De++)for(let Se=0;Se<32;Se++)A[De+Se]+=Ne[De]*b[Se];return z(ee.subarray(32),A),ee}u.sign=Je;function He(O,C){const A=o(),c=o(),b=o(),ee=o(),fe=o(),_e=o(),Ne=o();return K(O[2],v),he(O[1],C),G(b,O[1]),M(ee,b,_),T(b,b,O[2]),le(ee,O[2],ee),G(fe,ee),G(_e,fe),M(Ne,_e,fe),M(A,Ne,b),M(A,A,ee),re(A,A),M(A,A,b),M(A,A,ee),M(A,A,ee),M(O[0],A,ee),G(c,O[0]),M(c,c,ee),ge(c,b)&&M(O[0],O[0],B),G(c,O[0]),M(c,c,ee),ge(c,b)?-1:(pe(O[0])===C[31]>>7&&T(O[0],d,O[0]),M(O[3],O[0],O[1]),0)}function Lr(O,C,A){const c=new Uint8Array(32),b=[o(),o(),o(),o()],ee=[o(),o(),o(),o()];if(A.length!==u.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${u.SIGNATURE_LENGTH} bytes`);if(He(ee,O))return!1;const fe=new r.SHA512;fe.update(A.subarray(0,32)),fe.update(O),fe.update(C);const _e=fe.digest();return V(_e),y(b,ee,_e),E(ee,A.subarray(32)),ue(b,ee),Ue(c,b),!Ee(A,c)}u.verify=Lr;function xe(O){let C=[o(),o(),o(),o()];if(He(C,O))throw new Error("Ed25519: invalid public key");let A=o(),c=o(),b=C[1];le(A,v,b),T(c,v,b),ye(c,c),M(A,A,c);let ee=new Uint8Array(32);return ie(ee,A),ee}u.convertPublicKeyToX25519=xe;function xt(O){const C=(0,r.hash)(O.subarray(0,32));C[0]&=248,C[31]&=127,C[31]|=64;const A=new Uint8Array(C.subarray(0,32));return(0,n.wipe)(C),A}u.convertSecretKeyToX25519=xt})(wc);const Im="EdDSA",Pm="JWT",Yl=".",Xl="base64url",Sm="utf8",Am="utf8",Rm=":",Cm="did",Om="key",Gh="base58btc",Tm="z",Nm="K36",Fm=32;function fo(u){return yo(yc(Ys(u),Sm),Xl)}function Zl(u){const i=yc(Nm,Gh),r=Tm+yo(c1([i,u]),Gh);return[Cm,Om,r].join(Rm)}function Dm(u){return yo(u,Xl)}function Lm(u){return yc([fo(u.header),fo(u.payload)].join(Yl),Am)}function $m(u){return[fo(u.header),fo(u.payload),Dm(u.signature)].join(Yl)}function Wh(u=Ml.randomBytes(Fm)){return wc.generateKeyPairFromSeed(u)}async function qm(u,i,r,n,o=se.fromMiliseconds(Date.now())){const h={alg:Im,typ:Pm},d=Zl(n.publicKey),v=o+r,_={iss:d,sub:u,aud:i,iat:o,exp:v},S=Lm({header:h,payload:_}),F=wc.sign(n.secretKey,S);return $m({header:h,payload:_,signature:F})}const Mm="PARSE_ERROR",jm="INVALID_REQUEST",Um="METHOD_NOT_FOUND",zm="INVALID_PARAMS",ef="INTERNAL_ERROR",_c="SERVER_ERROR",km=[-32700,-32600,-32601,-32602,-32603],Js={[Mm]:{code:-32700,message:"Parse error"},[jm]:{code:-32600,message:"Invalid Request"},[Um]:{code:-32601,message:"Method not found"},[zm]:{code:-32602,message:"Invalid params"},[ef]:{code:-32603,message:"Internal error"},[_c]:{code:-32e3,message:"Server error"}},tf=_c;function Hm(u){return km.includes(u)}function Jh(u){return Object.keys(Js).includes(u)?Js[u]:Js[tf]}function Bm(u){const i=Object.values(Js).find(r=>r.code===u);return i||Js[tf]}function rf(u,i,r){return u.message.includes("getaddrinfo ENOTFOUND")||u.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${i}`):u}var sf={},ri={},Qh;function Vm(){if(Qh)return ri;Qh=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.isBrowserCryptoAvailable=ri.getSubtleCrypto=ri.getBrowerCrypto=void 0;function u(){return(ur===null||ur===void 0?void 0:ur.crypto)||(ur===null||ur===void 0?void 0:ur.msCrypto)||{}}ri.getBrowerCrypto=u;function i(){const n=u();return n.subtle||n.webkitSubtle}ri.getSubtleCrypto=i;function r(){return!!u()&&!!i()}return ri.isBrowserCryptoAvailable=r,ri}var ii={},Yh;function Km(){if(Yh)return ii;Yh=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.isBrowser=ii.isNode=ii.isReactNative=void 0;function u(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ii.isReactNative=u;function i(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}ii.isNode=i;function r(){return!u()&&!i()}return ii.isBrowser=r,ii}(function(u){Object.defineProperty(u,"__esModule",{value:!0});const i=bi;i.__exportStar(Vm(),u),i.__exportStar(Km(),u)})(sf);function bc(u=3){const i=Date.now()*Math.pow(10,u),r=Math.floor(Math.random()*Math.pow(10,u));return i+r}function nf(u=6){return BigInt(bc(u))}function ps(u,i,r){return{id:r||bc(),jsonrpc:"2.0",method:u,params:i}}function Ec(u,i){return{id:u,jsonrpc:"2.0",result:i}}function mo(u,i,r){return{id:u,jsonrpc:"2.0",error:Gm(i,r)}}function Gm(u,i){return typeof u>"u"?Jh(ef):(typeof u=="string"&&(u=Object.assign(Object.assign({},Jh(_c)),{message:u})),typeof i<"u"&&(u.data=i),Hm(u.code)&&(u=Bm(u.code)),u)}class Wm{}class Jm extends Wm{constructor(){super()}}class Qm extends Jm{constructor(i){super()}}const Ym="^https?:",Xm="^wss?:";function Zm(u){const i=u.match(new RegExp(/^\w+:/,"gi"));if(!(!i||!i.length))return i[0]}function of(u,i){const r=Zm(u);return typeof r>"u"?!1:new RegExp(i).test(r)}function Xh(u){return of(u,Ym)}function Zh(u){return of(u,Xm)}function ew(u){return new RegExp("wss?://localhost(:d{2,5})?").test(u)}function af(u){return typeof u=="object"&&"id"in u&&"jsonrpc"in u&&u.jsonrpc==="2.0"}function xc(u){return af(u)&&"method"in u}function wo(u){return af(u)&&(oi(u)||Dr(u))}function oi(u){return"result"in u}function Dr(u){return"error"in u}class Ei extends Qm{constructor(i){super(i),this.events=new Sr.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(i),this.connection.connected&&this.registerEventListeners()}async connect(i=this.connection){await this.open(i)}async disconnect(){await this.close()}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async request(i,r){return this.requestStrict(ps(i.method,i.params||[],i.id||nf().toString()),r)}async requestStrict(i,r){return new Promise(async(n,o)=>{if(!this.connection.connected)try{await this.open()}catch(h){o(h)}this.events.on(`${i.id}`,h=>{Dr(h)?o(h.error):n(h.result)});try{await this.connection.send(i,r)}catch(h){o(h)}})}setConnection(i=this.connection){return i}onPayload(i){this.events.emit("payload",i),wo(i)?this.events.emit(`${i.id}`,i):this.events.emit("message",{type:i.method,data:i.params})}onClose(i){i&&i.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${i.code} ${i.reason?`(${i.reason})`:""}`)),this.events.emit("disconnect")}async open(i=this.connection){this.connection===i&&this.connection.connected||(this.connection.connected&&this.close(),typeof i=="string"&&(await this.connection.open(i),i=this.connection),this.connection=this.setConnection(i),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",i=>this.onPayload(i)),this.connection.on("close",i=>this.onClose(i)),this.connection.on("error",i=>this.events.emit("error",i)),this.connection.on("register_error",i=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const tw=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),rw=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",el=u=>u.split("?")[0],tl=10,iw=tw();class sw{constructor(i){if(this.url=i,this.events=new Sr.EventEmitter,this.registering=!1,!Zh(i))throw new Error(`Provided URL is not compatible with WebSocket connection: ${i}`);this.url=i}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async open(i=this.url){await this.register(i)}async close(){return new Promise((i,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),i()},this.socket.close()})}async send(i,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ys(i))}catch(n){this.onError(i.id,n)}}register(i=this.url){if(!Zh(i))throw new Error(`Provided URL is not compatible with WebSocket connection: ${i}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",h=>{this.resetMaxListeners(),o(h)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=i,this.registering=!0,new Promise((r,n)=>{const o=sf.isReactNative()?void 0:{rejectUnauthorized:!ew(i)},h=new iw(i,[],o);rw()?h.onerror=d=>{const v=d;n(this.emitError(v.error))}:h.on("error",d=>{n(this.emitError(d))}),h.onopen=()=>{this.onOpen(h),r(h)}})}onOpen(i){i.onmessage=r=>this.onPayload(r),i.onclose=r=>this.onClose(r),this.socket=i,this.registering=!1,this.events.emit("open")}onClose(i){this.socket=void 0,this.registering=!1,this.events.emit("close",i)}onPayload(i){if(typeof i.data>"u")return;const r=typeof i.data=="string"?mc(i.data):i.data;this.events.emit("payload",r)}onError(i,r){const n=this.parseError(r),o=n.message||n.toString(),h=mo(i,o);this.events.emit("payload",h)}parseError(i,r=this.url){return rf(i,el(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>tl&&this.events.setMaxListeners(tl)}emitError(i){const r=this.parseError(new Error((i==null?void 0:i.message)||`WebSocket connection failed for host: ${el(this.url)}`));return this.events.emit("register_error",r),r}}var po={exports:{}};po.exports;(function(u,i){var r=200,n="__lodash_hash_undefined__",o=1,h=2,d=9007199254740991,v="[object Arguments]",_="[object Array]",S="[object AsyncFunction]",F="[object Boolean]",k="[object Date]",B="[object Error]",K="[object Function]",q="[object GeneratorFunction]",W="[object Map]",ie="[object Number]",Ee="[object Null]",ge="[object Object]",pe="[object Promise]",he="[object Proxy]",le="[object RegExp]",T="[object Set]",M="[object String]",G="[object Symbol]",ye="[object Undefined]",re="[object WeakMap]",ue="[object ArrayBuffer]",Te="[object DataView]",Ue="[object Float32Array]",y="[object Float64Array]",E="[object Int8Array]",Y="[object Int16Array]",ce="[object Int32Array]",H="[object Uint8Array]",j="[object Uint8ClampedArray]",z="[object Uint16Array]",V="[object Uint32Array]",Je=/[\\^$.*+?()[\]{}|]/g,He=/^\[object .+?Constructor\]$/,Lr=/^(?:0|[1-9]\d*)$/,xe={};xe[Ue]=xe[y]=xe[E]=xe[Y]=xe[ce]=xe[H]=xe[j]=xe[z]=xe[V]=!0,xe[v]=xe[_]=xe[ue]=xe[F]=xe[Te]=xe[k]=xe[B]=xe[K]=xe[W]=xe[ie]=xe[ge]=xe[le]=xe[T]=xe[M]=xe[re]=!1;var xt=typeof ur=="object"&&ur&&ur.Object===Object&&ur,O=typeof self=="object"&&self&&self.Object===Object&&self,C=xt||O||Function("return this")(),A=i&&!i.nodeType&&i,c=A&&!0&&u&&!u.nodeType&&u,b=c&&c.exports===A,ee=b&&xt.process,fe=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),_e=fe&&fe.isTypedArray;function Ne(g,x){for(var $=-1,Q=g==null?0:g.length,Ke=0,ve=[];++$-1}function Co(g,x){var $=this.__data__,Q=Pi($,g);return Q<0?(++this.size,$.push([g,x])):$[Q][1]=x,this}yr.prototype.clear=Po,yr.prototype.delete=So,yr.prototype.get=Ao,yr.prototype.has=Ro,yr.prototype.set=Co;function Vr(g){var x=-1,$=g==null?0:g.length;for(this.clear();++x<$;){var Q=g[x];this.set(Q[0],Q[1])}}function Hi(){this.size=0,this.__data__={hash:new Qe,map:new(rt||yr),string:new Qe}}function Oo(g){var x=ci(this,g).delete(g);return this.size-=x?1:0,x}function Bi(g){return ci(this,g).get(g)}function To(g){return ci(this,g).has(g)}function No(g,x){var $=ci(this,g),Q=$.size;return $.set(g,x),this.size+=$.size==Q?0:1,this}Vr.prototype.clear=Hi,Vr.prototype.delete=Oo,Vr.prototype.get=Bi,Vr.prototype.has=To,Vr.prototype.set=No;function Vi(g){var x=-1,$=g==null?0:g.length;for(this.__data__=new Vr;++x<$;)this.add(g[x])}function en(g){return this.__data__.set(g,n),this}function tn(g){return this.__data__.has(g)}Vi.prototype.add=Vi.prototype.push=en,Vi.prototype.has=tn;function Ar(g){var x=this.__data__=new yr(g);this.size=x.size}function Fo(){this.__data__=new yr,this.size=0}function Do(g){var x=this.__data__,$=x.delete(g);return this.size=x.size,$}function Lo(g){return this.__data__.get(g)}function $o(g){return this.__data__.has(g)}function rn(g,x){var $=this.__data__;if($ instanceof yr){var Q=$.__data__;if(!rt||Q.lengthTt))return!1;var Ge=ve.get(g);if(Ge&&ve.get(x))return Ge==x;var wt=-1,rr=!0,Nt=$&h?new Vi:void 0;for(ve.set(g,x),ve.set(x,g);++wt-1&&g%1==0&&g-1&&g%1==0&&g<=d}function mn(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function Ri(g){return g!=null&&typeof g=="object"}var wn=_e?vt(_e):on;function ko(g){return Uo(g)?sn(g):an(g)}function Ve(){return[]}function ke(){return!1}u.exports=zo})(po,po.exports);var nw=po.exports;const ow=jl(nw);function aw(u,i){if(u.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,he=new Uint8Array(pe);Ee!==ge;){for(var le=q[Ee],T=0,M=pe-1;(le!==0||T>>0,he[M]=le%v>>>0,le=le/v>>>0;if(le!==0)throw new Error("Non-zero carry");ie=T,Ee++}for(var G=pe-ie;G!==pe&&he[G]===0;)G++;for(var ye=_.repeat(W);G>>0,pe=new Uint8Array(ge);q[W];){var he=r[q.charCodeAt(W)];if(he===255)return;for(var le=0,T=ge-1;(he!==0||le>>0,pe[T]=he%256>>>0,he=he/256>>>0;if(he!==0)throw new Error("Non-zero carry");Ee=le,W++}if(q[W]!==" "){for(var M=ge-Ee;M!==ge&&pe[M]===0;)M++;for(var G=new Uint8Array(ie+(ge-M)),ye=ie;M!==ge;)G[ye++]=pe[M++];return G}}}function K(q){var W=B(q);if(W)return W;throw new Error(`Non-${i} character`)}return{encode:k,decodeUnsafe:B,decode:K}}var cw=aw,uw=cw;const cf=u=>{if(u instanceof Uint8Array&&u.constructor.name==="Uint8Array")return u;if(u instanceof ArrayBuffer)return new Uint8Array(u);if(ArrayBuffer.isView(u))return new Uint8Array(u.buffer,u.byteOffset,u.byteLength);throw new Error("Unknown type, must be binary type")},hw=u=>new TextEncoder().encode(u),lw=u=>new TextDecoder().decode(u);class fw{constructor(i,r,n){this.name=i,this.prefix=r,this.baseEncode=n}encode(i){if(i instanceof Uint8Array)return`${this.prefix}${this.baseEncode(i)}`;throw Error("Unknown type, must be binary type")}}class pw{constructor(i,r,n){if(this.name=i,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(i){if(typeof i=="string"){if(i.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(i)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(i.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(i){return uf(this,i)}}class dw{constructor(i){this.decoders=i}or(i){return uf(this,i)}decode(i){const r=i[0],n=this.decoders[r];if(n)return n.decode(i);throw RangeError(`Unable to decode multibase string ${JSON.stringify(i)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const uf=(u,i)=>new dw({...u.decoders||{[u.prefix]:u},...i.decoders||{[i.prefix]:i}});class gw{constructor(i,r,n,o){this.name=i,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new fw(i,r,n),this.decoder=new pw(i,r,o)}encode(i){return this.encoder.encode(i)}decode(i){return this.decoder.decode(i)}}const _o=({name:u,prefix:i,encode:r,decode:n})=>new gw(u,i,r,n),Zs=({prefix:u,name:i,alphabet:r})=>{const{encode:n,decode:o}=uw(r,i);return _o({prefix:u,name:i,encode:n,decode:h=>cf(o(h))})},yw=(u,i,r,n)=>{const o={};for(let F=0;F=8&&(v-=8,d[S++]=255&_>>v)}if(v>=r||255&_<<8-v)throw new SyntaxError("Unexpected end of data");return d},vw=(u,i,r)=>{const n=i[i.length-1]==="=",o=(1<r;)d-=r,h+=i[o&v>>d];if(d&&(h+=i[o&v<_o({prefix:i,name:u,encode(o){return vw(o,n,r)},decode(o){return yw(o,n,r,u)}}),mw=_o({prefix:"\0",name:"identity",encode:u=>lw(u),decode:u=>hw(u)});var ww=Object.freeze({__proto__:null,identity:mw});const _w=Ht({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var bw=Object.freeze({__proto__:null,base2:_w});const Ew=Ht({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var xw=Object.freeze({__proto__:null,base8:Ew});const Iw=Zs({prefix:"9",name:"base10",alphabet:"0123456789"});var Pw=Object.freeze({__proto__:null,base10:Iw});const Sw=Ht({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Aw=Ht({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Rw=Object.freeze({__proto__:null,base16:Sw,base16upper:Aw});const Cw=Ht({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ow=Ht({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Tw=Ht({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Nw=Ht({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Fw=Ht({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Dw=Ht({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Lw=Ht({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),$w=Ht({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),qw=Ht({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Mw=Object.freeze({__proto__:null,base32:Cw,base32upper:Ow,base32pad:Tw,base32padupper:Nw,base32hex:Fw,base32hexupper:Dw,base32hexpad:Lw,base32hexpadupper:$w,base32z:qw});const jw=Zs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Uw=Zs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var zw=Object.freeze({__proto__:null,base36:jw,base36upper:Uw});const kw=Zs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Hw=Zs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Bw=Object.freeze({__proto__:null,base58btc:kw,base58flickr:Hw});const Vw=Ht({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Kw=Ht({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Gw=Ht({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Ww=Ht({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Jw=Object.freeze({__proto__:null,base64:Vw,base64pad:Kw,base64url:Gw,base64urlpad:Ww});const hf=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Qw=hf.reduce((u,i,r)=>(u[r]=i,u),[]),Yw=hf.reduce((u,i,r)=>(u[i.codePointAt(0)]=r,u),[]);function Xw(u){return u.reduce((i,r)=>(i+=Qw[r],i),"")}function Zw(u){const i=[];for(const r of u){const n=Yw[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);i.push(n)}return new Uint8Array(i)}const e_=_o({prefix:"🚀",name:"base256emoji",encode:Xw,decode:Zw});var t_=Object.freeze({__proto__:null,base256emoji:e_}),r_=lf,rl=128,i_=127,s_=~i_,n_=Math.pow(2,31);function lf(u,i,r){i=i||[],r=r||0;for(var n=r;u>=n_;)i[r++]=u&255|rl,u/=128;for(;u&s_;)i[r++]=u&255|rl,u>>>=7;return i[r]=u|0,lf.bytes=r-n+1,i}var o_=hc,a_=128,il=127;function hc(u,n){var r=0,n=n||0,o=0,h=n,d,v=u.length;do{if(h>=v)throw hc.bytes=0,new RangeError("Could not decode varint");d=u[h++],r+=o<28?(d&il)<=a_);return hc.bytes=h-n,r}var c_=Math.pow(2,7),u_=Math.pow(2,14),h_=Math.pow(2,21),l_=Math.pow(2,28),f_=Math.pow(2,35),p_=Math.pow(2,42),d_=Math.pow(2,49),g_=Math.pow(2,56),y_=Math.pow(2,63),v_=function(u){return u(ff.encode(u,i,r),i),nl=u=>ff.encodingLength(u),lc=(u,i)=>{const r=i.byteLength,n=nl(u),o=n+nl(r),h=new Uint8Array(o+r);return sl(u,h,0),sl(r,h,n),h.set(i,o),new w_(u,r,i,h)};class w_{constructor(i,r,n,o){this.code=i,this.size=r,this.digest=n,this.bytes=o}}const pf=({name:u,code:i,encode:r})=>new __(u,i,r);class __{constructor(i,r,n){this.name=i,this.code=r,this.encode=n}digest(i){if(i instanceof Uint8Array){const r=this.encode(i);return r instanceof Uint8Array?lc(this.code,r):r.then(n=>lc(this.code,n))}else throw Error("Unknown type, must be binary type")}}const df=u=>async i=>new Uint8Array(await crypto.subtle.digest(u,i)),b_=pf({name:"sha2-256",code:18,encode:df("SHA-256")}),E_=pf({name:"sha2-512",code:19,encode:df("SHA-512")});var x_=Object.freeze({__proto__:null,sha256:b_,sha512:E_});const gf=0,I_="identity",yf=cf,P_=u=>lc(gf,yf(u)),S_={code:gf,name:I_,encode:yf,digest:P_};var A_=Object.freeze({__proto__:null,identity:S_});new TextEncoder,new TextDecoder;const ol={...ww,...bw,...xw,...Pw,...Rw,...Mw,...zw,...Bw,...Jw,...t_};({...x_,...A_});function vf(u){return globalThis.Buffer!=null?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):u}function R_(u=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vf(globalThis.Buffer.allocUnsafe(u)):new Uint8Array(u)}function mf(u,i,r,n){return{name:u,prefix:i,encoder:{name:u,prefix:i,encode:r},decoder:{decode:n}}}const al=mf("utf8","u",u=>"u"+new TextDecoder("utf8").decode(u),u=>new TextEncoder().encode(u.substring(1))),Za=mf("ascii","a",u=>{let i="a";for(let r=0;r{u=u.substring(1);const i=R_(u.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,o)=>{this.isInitialized(),this.keychain.set(n,o),await this.persist()},this.get=n=>{this.isInitialized();const o=this.keychain.get(n);if(typeof o>"u"){const{message:h}=Z("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(h)}return o},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=i,this.logger=Oe.generateChildLogger(r,this.name)}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(i){await this.core.storage.setItem(this.storageKey,Hl(i))}async getKeyChain(){const i=await this.core.storage.getItem(this.storageKey);return typeof i<"u"?Bl(i):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class ob{constructor(i,r,n){this.core=i,this.logger=r,this.name=D_,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{this.isInitialized();const o=await this.getClientSeed(),h=Wh(o);return Zl(h.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=l1();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const h=await this.getClientSeed(),d=Wh(h),v=cc();return await qm(v,o,L_,d)},this.generateSharedKey=(o,h,d)=>{this.isInitialized();const v=this.getPrivateKey(o),_=f1(v,h);return this.setSymKey(_,d)},this.setSymKey=async(o,h)=>{this.isInitialized();const d=h||p1(o);return await this.keychain.set(d,o),d},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,h,d)=>{this.isInitialized();const v=d1(d),_=Ys(h);if(Rh(v)){const B=v.senderPublicKey,K=v.receiverPublicKey;o=await this.generateSharedKey(B,K)}const S=this.getSymKey(o),{type:F,senderPublicKey:k}=v;return g1({type:F,symKey:S,message:_,senderPublicKey:k})},this.decode=async(o,h,d)=>{this.isInitialized();const v=y1(h,d);if(Rh(v)){const _=v.receiverPublicKey,S=v.senderPublicKey;o=await this.generateSharedKey(_,S)}try{const _=this.getSymKey(o),S=v1({symKey:_,encoded:h});return mc(S)}catch(_){this.logger.error(`Failed to decode message from topic: '${o}', clientId: '${await this.getClientId()}'`),this.logger.error(_)}},this.getPayloadType=o=>{const h=Ch(o);return m1(h.type)},this.getPayloadSenderPublicKey=o=>{const h=Ch(o);return h.senderPublicKey?yo(h.senderPublicKey,w1):void 0},this.core=i,this.logger=Oe.generateChildLogger(r,this.name),this.keychain=n||new nb(this.core,this.logger)}get context(){return Oe.getLoggerContext(this.logger)}async setPrivateKey(i,r){return await this.keychain.set(i,r),i}getPrivateKey(i){return this.keychain.get(i)}async getClientSeed(){let i="";try{i=this.keychain.get(cl)}catch{i=cc(),await this.keychain.set(cl,i)}return O_(i,"base16")}getSymKey(i){return this.keychain.get(i)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class ab extends pm{constructor(i,r){super(i,r),this.logger=i,this.core=r,this.messages=new Map,this.name=M_,this.version=j_,this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,o)=>{this.isInitialized();const h=fs(o);let d=this.messages.get(n);return typeof d>"u"&&(d={}),typeof d[h]<"u"||(d[h]=o,this.messages.set(n,d),await this.persist()),h},this.get=n=>{this.isInitialized();let o=this.messages.get(n);return typeof o>"u"&&(o={}),o},this.has=(n,o)=>{this.isInitialized();const h=this.get(n),d=fs(o);return typeof h[d]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Oe.generateChildLogger(i,this.name),this.core=r}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(i){await this.core.storage.setItem(this.storageKey,Hl(i))}async getRelayerMessages(){const i=await this.core.storage.getItem(this.storageKey);return typeof i<"u"?Bl(i):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class cb extends dm{constructor(i,r){super(i,r),this.relayer=i,this.logger=r,this.events=new Sr.EventEmitter,this.name=z_,this.queue=new Map,this.publishTimeout=se.toMiliseconds(se.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,o,h)=>{var d;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:h}});try{const v=(h==null?void 0:h.ttl)||U_,_=uc(h),S=(h==null?void 0:h.prompt)||!1,F=(h==null?void 0:h.tag)||0,k=(h==null?void 0:h.id)||nf().toString(),B={topic:n,message:o,opts:{ttl:v,relay:_,prompt:S,tag:F,id:k}},K=setTimeout(()=>this.queue.set(k,B),this.publishTimeout);try{await await Qs(this.rpcPublish(n,o,v,_,S,F,k),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(k),this.relayer.events.emit(Kt.publish,B)}catch(q){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(d=h==null?void 0:h.internal)!=null&&d.throwOnFailedPublish)throw this.removeRequestFromQueue(k),q;return}finally{clearTimeout(K)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:h}})}catch(v){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(v),v}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.relayer=i,this.logger=Oe.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return Oe.getLoggerContext(this.logger)}rpcPublish(i,r,n,o,h,d,v){var _,S,F,k;const B={method:uo(o.protocol).publish,params:{topic:i,message:r,ttl:n,prompt:h,tag:d},id:v};return wi((_=B.params)==null?void 0:_.prompt)&&((S=B.params)==null||delete S.prompt),wi((F=B.params)==null?void 0:F.tag)&&((k=B.params)==null||delete k.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:B}),this.relayer.request(B)}removeRequestFromQueue(i){this.queue.delete(i)}checkQueue(){this.queue.forEach(async i=>{const{topic:r,message:n,opts:o}=i;await this.publish(r,n,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Kt.connection_stalled);return}this.checkQueue()}),this.relayer.on(Kt.message_ack,i=>{this.removeRequestFromQueue(i.id.toString())})}}class ub{constructor(){this.map=new Map,this.set=(i,r)=>{const n=this.get(i);this.exists(i,r)||this.map.set(i,[...n,r])},this.get=i=>this.map.get(i)||[],this.exists=(i,r)=>this.get(i).includes(r),this.delete=(i,r)=>{if(typeof r>"u"){this.map.delete(i);return}if(!this.map.has(i))return;const n=this.get(i);if(!this.exists(i,r))return;const o=n.filter(h=>h!==r);if(!o.length){this.map.delete(i);return}this.map.set(i,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var hb=Object.defineProperty,lb=Object.defineProperties,fb=Object.getOwnPropertyDescriptors,ll=Object.getOwnPropertySymbols,pb=Object.prototype.hasOwnProperty,db=Object.prototype.propertyIsEnumerable,fl=(u,i,r)=>i in u?hb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,ks=(u,i)=>{for(var r in i||(i={}))pb.call(i,r)&&fl(u,r,i[r]);if(ll)for(var r of ll(i))db.call(i,r)&&fl(u,r,i[r]);return u},tc=(u,i)=>lb(u,fb(i));class gb extends vm{constructor(i,r){super(i,r),this.relayer=i,this.logger=r,this.subscriptions=new Map,this.topicMap=new ub,this.events=new Sr.EventEmitter,this.name=Q_,this.version=Y_,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=_i,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}});try{const h=uc(o),d={topic:n,relay:h};this.pending.set(n,d);const v=await this.rpcSubscribe(n,h);return this.onSubscribe(v,d),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}}),v}catch(h){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(h),h}},this.unsubscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),typeof(o==null?void 0:o.id)<"u"?await this.unsubscribeById(n,o.id,o):await this.unsubscribeByTopic(n,o)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((o,h)=>{const d=new se.Watch;d.start(this.pendingSubscriptionWatchLabel);const v=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),o(!0)),d.elapsed(this.pendingSubscriptionWatchLabel)>=X_&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),h(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=i,this.logger=Oe.generateChildLogger(r,this.name),this.clientId=""}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(i,r){let n=!1;try{n=this.getSubscription(i).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(i,r){const n=this.topicMap.get(i);await Promise.all(n.map(async o=>await this.unsubscribeById(i,o,r)))}async unsubscribeById(i,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:i,id:r,opts:n}});try{const o=uc(n);await this.rpcUnsubscribe(i,r,o);const h=er("USER_DISCONNECTED",`${this.name}, ${i}`);await this.onUnsubscribe(i,r,h),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:i,id:r,opts:n}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(i,r){const n={method:uo(r.protocol).subscribe,params:{topic:i}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Qs(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Kt.connection_stalled)}return fs(i+this.clientId)}async rpcBatchSubscribe(i){if(!i.length)return;const r=i[0].relay,n={method:uo(r.protocol).batchSubscribe,params:{topics:i.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Qs(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Kt.connection_stalled)}}rpcUnsubscribe(i,r,n){const o={method:uo(n.protocol).unsubscribe,params:{topic:i,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(i,r){this.setSubscription(i,tc(ks({},r),{id:i})),this.pending.delete(r.topic)}onBatchSubscribe(i){i.length&&i.forEach(r=>{this.setSubscription(r.id,ks({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(i,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,i)&&this.deleteSubscription(r,n),await this.relayer.messages.del(i)}async setRelayerSubscriptions(i){await this.relayer.core.storage.setItem(this.storageKey,i)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(i,r){this.subscriptions.has(i)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:i,subscription:r}),this.addSubscription(i,r))}addSubscription(i,r){this.subscriptions.set(i,ks({},r)),this.topicMap.set(r.topic,i),this.events.emit(Hr.created,r)}getSubscription(i){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:i});const r=this.subscriptions.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(n)}return r}deleteSubscription(i,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:i,reason:r});const n=this.getSubscription(i);this.subscriptions.delete(i),this.topicMap.delete(n.topic,i),this.events.emit(Hr.deleted,tc(ks({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Hr.sync)}async reset(){if(this.cached.length){const i=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!i.length)return;if(this.subscriptions.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(i){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(i)}}async batchSubscribe(i){if(!i.length)return;const r=await this.rpcBatchSubscribe(i);ds(r)&&this.onBatchSubscribe(r.map((n,o)=>tc(ks({},i[o]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const i=[];this.pending.forEach(r=>{i.push(r)}),await this.batchSubscribe(i)}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Kt.connect,async()=>{await this.onConnect()}),this.relayer.on(Kt.disconnect,()=>{this.onDisconnect()}),this.events.on(Hr.created,async i=>{const r=Hr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),await this.persist()}),this.events.on(Hr.deleted,async i=>{const r=Hr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}async restartToComplete(){this.restartInProgress&&await new Promise(i=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),i())},this.pollingInterval)})}}var yb=Object.defineProperty,pl=Object.getOwnPropertySymbols,vb=Object.prototype.hasOwnProperty,mb=Object.prototype.propertyIsEnumerable,dl=(u,i,r)=>i in u?yb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,wb=(u,i)=>{for(var r in i||(i={}))vb.call(i,r)&&dl(u,r,i[r]);if(pl)for(var r of pl(i))mb.call(i,r)&&dl(u,r,i[r]);return u};class _b extends gm{constructor(i){super(i),this.protocol="wc",this.version=2,this.events=new Sr.EventEmitter,this.name=H_,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.onPayloadHandler=r=>{this.onProviderPayload(r)},this.onConnectHandler=()=>{this.events.emit(Kt.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Kt.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(si.payload,this.onPayloadHandler),this.provider.on(si.connect,this.onConnectHandler),this.provider.on(si.disconnect,this.onDisconnectHandler),this.provider.on(si.error,this.onProviderErrorHandler)},this.core=i.core,this.logger=typeof i.logger<"u"&&typeof i.logger!="string"?Oe.generateChildLogger(i.logger,this.name):Oe.pino(Oe.getDefaultLoggerOptions({level:i.logger||k_})),this.messages=new ab(this.logger,i.core),this.subscriber=new gb(this,this.logger),this.publisher=new cb(this,this.logger),this.relayUrl=(i==null?void 0:i.relayUrl)||bf,this.projectId=i.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${ul}...`),await this.restartTransport(ul)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},G_)}get context(){return Oe.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(i,r,n){this.isInitialized(),await this.publisher.publish(i,r,n),await this.recordMessageEvent({topic:i,message:r,publishedAt:Date.now()})}async subscribe(i,r){var n;this.isInitialized();let o=((n=this.subscriber.topicMap.get(i))==null?void 0:n[0])||"";return o||(await Promise.all([new Promise(h=>{this.subscriber.once(Hr.created,d=>{d.topic===i&&h()})}),new Promise(async h=>{o=await this.subscriber.subscribe(i,r),h()})]),o)}async unsubscribe(i,r){this.isInitialized(),await this.subscriber.unsubscribe(i,r)}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await Qs(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(i){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){i&&i!==this.relayUrl&&(this.relayUrl=i,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(r=>{if(!this.initialized)return r();this.subscriber.once(Hr.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await Qs(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(o){n(o);return}r()})])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.provider.events.emit(si.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(i){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=i||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Oh())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(i){return this.staleConnectionErrors.some(r=>i.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const i=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ei(new sw(_1({sdkVersion:K_,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:i,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(i){const{topic:r,message:n}=i;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(i){const{topic:r,message:n}=i;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const o=this.messages.has(r,n);return o&&this.logger.debug(`Ignoring duplicate message: ${n}`),o}async onProviderPayload(i){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:i}),xc(i)){if(!i.method.endsWith(B_))return;const r=i.params,{topic:n,message:o,publishedAt:h}=r.data,d={topic:n,message:o,publishedAt:h};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(wb({type:"event",event:r.id},d)),this.events.emit(r.id,d),await this.acknowledgePayload(i),await this.onMessageEvent(d)}else wo(i)&&this.events.emit(Kt.message_ack,i)}async onMessageEvent(i){await this.shouldIgnoreMessageEvent(i)||(this.events.emit(Kt.message,i),await this.recordMessageEvent(i))}async acknowledgePayload(i){const r=Ec(i.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(si.payload,this.onPayloadHandler),this.provider.off(si.connect,this.onConnectHandler),this.provider.off(si.disconnect,this.onDisconnectHandler),this.provider.off(si.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Kt.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let i=await Oh();b1(async r=>{this.initialized&&i!==r&&(i=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(Kt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(i=>this.logger.error(i))},se.toMiliseconds(V_)))}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(i=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),i())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var bb=Object.defineProperty,gl=Object.getOwnPropertySymbols,Eb=Object.prototype.hasOwnProperty,xb=Object.prototype.propertyIsEnumerable,yl=(u,i,r)=>i in u?bb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,vl=(u,i)=>{for(var r in i||(i={}))Eb.call(i,r)&&yl(u,r,i[r]);if(gl)for(var r of gl(i))xb.call(i,r)&&yl(u,r,i[r]);return u};class bo extends ym{constructor(i,r,n,o=_i,h=void 0){super(i,r,n,o),this.core=i,this.logger=r,this.name=n,this.map=new Map,this.version=W_,this.cached=[],this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(d=>{this.getKey&&d!==null&&!wi(d)?this.map.set(this.getKey(d),d):u1(d)?this.map.set(d.id,d):h1(d)&&this.map.set(d.topic,d)}),this.cached=[],this.initialized=!0)},this.set=async(d,v)=>{this.isInitialized(),this.map.has(d)?await this.update(d,v):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:d,value:v}),this.map.set(d,v),await this.persist())},this.get=d=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:d}),this.getData(d)),this.getAll=d=>(this.isInitialized(),d?this.values.filter(v=>Object.keys(d).every(_=>ow(v[_],d[_]))):this.values),this.update=async(d,v)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:d,update:v});const _=vl(vl({},this.getData(d)),v);this.map.set(d,_),await this.persist()},this.delete=async(d,v)=>{this.isInitialized(),this.map.has(d)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:d,reason:v}),this.map.delete(d),await this.persist())},this.logger=Oe.generateChildLogger(r,this.name),this.storagePrefix=o,this.getKey=h}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(i){await this.core.storage.setItem(this.storageKey,i)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(i){const r=this.map.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const i=await this.getDataStore();if(typeof i>"u"||!i.length)return;if(this.map.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(i){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(i)}}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class Ib{constructor(i,r){this.core=i,this.logger=r,this.name=Z_,this.version=eb,this.events=new vc,this.initialized=!1,this.storagePrefix=_i,this.ignoredPayloadTypes=[Ul],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=cc(),o=await this.core.crypto.setSymKey(n),h=Fr(se.FIVE_MINUTES),d={protocol:_f},v={topic:o,expiry:h,relay:d,active:!1},_=E1({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:n,relay:d});return await this.pairings.set(o,v),await this.core.relayer.subscribe(o),this.core.expirer.set(o,h),{topic:o,uri:_}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:o,symKey:h,relay:d}=x1(n.uri);let v;if(this.pairings.keys.includes(o)&&(v=this.pairings.get(o),v.active))throw new Error(`Pairing already exists: ${o}. Please try again with a new connection URI.`);this.core.crypto.keychain.has(o)||(await this.core.crypto.setSymKey(h,o),await this.core.relayer.subscribe(o,{relay:d}));const _=Fr(se.FIVE_MINUTES),S={topic:o,relay:d,expiry:_,active:!1};return await this.pairings.set(o,S),this.core.expirer.set(o,_),n.activatePairing&&await this.activate({topic:o}),this.events.emit(Gs.create,S),S},this.activate=async({topic:n})=>{this.isInitialized();const o=Fr(se.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:o}),this.core.expirer.set(n,o)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:o}=n;if(this.pairings.keys.includes(o)){const h=await this.sendRequest(o,"wc_pairingPing",{}),{done:d,resolve:v,reject:_}=us();this.events.once(Ft("pairing_ping",h),({error:S})=>{S?_(S):v()}),await d()}},this.updateExpiry=async({topic:n,expiry:o})=>{this.isInitialized(),await this.pairings.update(n,{expiry:o})},this.updateMetadata=async({topic:n,metadata:o})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:o}=n;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",er("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(n,o,h)=>{const d=ps(o,h),v=await this.core.crypto.encode(n,d),_=zs[o].req;return this.core.history.set(n,d),this.core.relayer.publish(n,v,_),d.id},this.sendResult=async(n,o,h)=>{const d=Ec(n,h),v=await this.core.crypto.encode(o,d),_=await this.core.history.get(o,n),S=zs[_.request.method].res;await this.core.relayer.publish(o,v,S),await this.core.history.resolve(d)},this.sendError=async(n,o,h)=>{const d=mo(n,h),v=await this.core.crypto.encode(o,d),_=await this.core.history.get(o,n),S=zs[_.request.method]?zs[_.request.method].res:zs.unregistered_method.res;await this.core.relayer.publish(o,v,S),await this.core.history.resolve(d)},this.deletePairing=async(n,o)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,er("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),o?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(o=>mi(o.expiry));await Promise.all(n.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=n=>{const{topic:o,payload:h}=n;switch(h.method){case"wc_pairingPing":return this.onPairingPingRequest(o,h);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,h);default:return this.onUnknownRpcMethodRequest(o,h)}},this.onRelayEventResponse=async n=>{const{topic:o,payload:h}=n,d=(await this.core.history.get(o,h.id)).request.method;switch(d){case"wc_pairingPing":return this.onPairingPingResponse(o,h);default:return this.onUnknownRpcMethodResponse(d)}},this.onPairingPingRequest=async(n,o)=>{const{id:h}=o;try{this.isValidPing({topic:n}),await this.sendResult(h,n,!0),this.events.emit(Gs.ping,{id:h,topic:n})}catch(d){await this.sendError(h,n,d),this.logger.error(d)}},this.onPairingPingResponse=(n,o)=>{const{id:h}=o;setTimeout(()=>{oi(o)?this.events.emit(Ft("pairing_ping",h),{}):Dr(o)&&this.events.emit(Ft("pairing_ping",h),{error:o.error})},500)},this.onPairingDeleteRequest=async(n,o)=>{const{id:h}=o;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Gs.delete,{id:h,topic:n})}catch(d){await this.sendError(h,n,d),this.logger.error(d)}},this.onUnknownRpcMethodRequest=async(n,o)=>{const{id:h,method:d}=o;try{if(this.registeredMethods.includes(d))return;const v=er("WC_METHOD_UNSUPPORTED",d);await this.sendError(h,n,v),this.logger.error(v)}catch(v){await this.sendError(h,n,v),this.logger.error(v)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(er("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!cr(n)){const{message:o}=Z("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(o)}if(!I1(n.uri)){const{message:o}=Z("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(o)}},this.isValidPing=async n=>{if(!cr(n)){const{message:h}=Z("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(h)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidDisconnect=async n=>{if(!cr(n)){const{message:h}=Z("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(h)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async n=>{if(!hs(n,!1)){const{message:o}=Z("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(o)}if(!this.pairings.keys.includes(n)){const{message:o}=Z("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(o)}if(mi(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:o}=Z("EXPIRED",`pairing topic: ${n}`);throw new Error(o)}},this.core=i,this.logger=Oe.generateChildLogger(r,this.name),this.pairings=new bo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Oe.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}registerRelayerEvents(){this.core.relayer.on(Kt.message,async i=>{const{topic:r,message:n}=i;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const o=await this.core.crypto.decode(r,n);try{xc(o)?(this.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o})):wo(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o}),this.core.history.delete(r,o.id))}catch(h){this.logger.error(h)}})}registerExpirerEvents(){this.core.expirer.on(Pr.expired,async i=>{const{topic:r}=zl(i.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Gs.expire,{topic:r}))})}}class Pb extends fm{constructor(i,r){super(i,r),this.core=i,this.logger=r,this.records=new Map,this.events=new Sr.EventEmitter,this.name=tb,this.version=rb,this.cached=[],this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,o,h)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:o,chainId:h}),this.records.has(o.id))return;const d={id:o.id,topic:n,request:{method:o.method,params:o.params||null},chainId:h,expiry:Fr(se.THIRTY_DAYS)};this.records.set(d.id,d),this.events.emit(kr.created,d)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const o=await this.getRecord(n.id);typeof o.response>"u"&&(o.response=Dr(n)?{error:n.error}:{result:n.result},this.records.set(o.id,o),this.events.emit(kr.updated,o))},this.get=async(n,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:o}),await this.getRecord(o)),this.delete=(n,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(h=>{if(h.topic===n){if(typeof o<"u"&&h.id!==o)return;this.records.delete(h.id),this.events.emit(kr.deleted,h)}})},this.exists=async(n,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===n:!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Oe.generateChildLogger(r,this.name)}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const i=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:ps(r.request.method,r.request.params,r.id),chainId:r.chainId};return i.push(n)}),i}async setJsonRpcRecords(i){await this.core.storage.setItem(this.storageKey,i)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(i){this.isInitialized();const r=this.records.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(kr.sync)}async restore(){try{const i=await this.getJsonRpcRecords();if(typeof i>"u"||!i.length)return;if(this.records.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}}registerEventListeners(){this.events.on(kr.created,i=>{const r=kr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:i}),this.persist()}),this.events.on(kr.updated,i=>{const r=kr.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:i}),this.persist()}),this.events.on(kr.deleted,i=>{const r=kr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:i}),this.persist()}),this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(i=>{se.toMiliseconds(i.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${i.id}`),this.delete(i.topic,i.id))})}catch(i){this.logger.warn(i)}}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class Sb extends mm{constructor(i,r){super(i,r),this.core=i,this.logger=r,this.expirations=new Map,this.events=new Sr.EventEmitter,this.name=ib,this.version=sb,this.cached=[],this.initialized=!1,this.storagePrefix=_i,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const o=this.formatTarget(n);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(n,o)=>{this.isInitialized();const h=this.formatTarget(n),d={target:h,expiry:o};this.expirations.set(h,d),this.checkExpiry(h,d),this.events.emit(Pr.created,{target:h,expiration:d})},this.get=n=>{this.isInitialized();const o=this.formatTarget(n);return this.getExpiration(o)},this.del=n=>{if(this.isInitialized(),this.has(n)){const o=this.formatTarget(n),h=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Pr.deleted,{target:o,expiration:h})}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Oe.generateChildLogger(r,this.name)}get context(){return Oe.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(i){if(typeof i=="string")return P1(i);if(typeof i=="number")return S1(i);const{message:r}=Z("UNKNOWN_TYPE",`Target type: ${typeof i}`);throw new Error(r)}async setExpirations(i){await this.core.storage.setItem(this.storageKey,i)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Pr.sync)}async restore(){try{const i=await this.getExpirations();if(typeof i>"u"||!i.length)return;if(this.expirations.size){const{message:r}=Z("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=i,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(i){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(i)}}getExpiration(i){const r=this.expirations.get(i);if(!r){const{message:n}=Z("NO_MATCHING_KEY",`${this.name}: ${i}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(i,r){const{expiry:n}=r;se.toMiliseconds(n)-Date.now()<=0&&this.expire(i,r)}expire(i,r){this.expirations.delete(i),this.events.emit(Pr.expired,{target:i,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((i,r)=>this.checkExpiry(r,i))}registerEventListeners(){this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Pr.created,i=>{const r=Pr.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),this.persist()}),this.events.on(Pr.expired,i=>{const r=Pr.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),this.persist()}),this.events.on(Pr.deleted,i=>{const r=Pr.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:i}),this.persist()})}isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}}}class Ab extends wm{constructor(i,r){super(i,r),this.projectId=i,this.logger=r,this.name=ec,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||A1()||!kl())return;const o=(n==null?void 0:n.verifyUrl)||lo;this.verifyUrl!==o&&this.removeIframe(),this.verifyUrl=o;try{await this.createIframe()}catch(h){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(h)}if(!this.initialized){this.removeIframe(),this.verifyUrl=hl;try{await this.createIframe()}catch(h){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(h),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const o=(n==null?void 0:n.verifyUrl)||lo;let h;try{h=await this.fetchAttestation(n.attestationId,o)}catch(d){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${o}`),this.logger.info(d),h=await this.fetchAttestation(n.attestationId,hl)}return h},this.fetchAttestation=async(n,o)=>{this.logger.info(`resolving attestation: ${n} from url: ${o}`);const h=this.startAbortTimer(se.ONE_SECOND*2),d=await fetch(`${o}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(h),d.status===200?await d.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var o;try{if(!this.iframe)return;(o=this.iframe.contentWindow)==null||o.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const o=h=>{h.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",o),n())};await Promise.race([new Promise(h=>{if(document.getElementById(ec))return h();window.addEventListener("message",o);const d=document.createElement("iframe");d.id=ec,d.src=`${this.verifyUrl}/${this.projectId}`,d.style.display="none",document.body.append(d),this.iframe=d,n=h}),new Promise((h,d)=>setTimeout(()=>{window.removeEventListener("message",o),d("verify iframe load timeout")},se.toMiliseconds(se.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.logger=Oe.generateChildLogger(r,this.name),this.verifyUrl=lo,this.abortController=new AbortController,this.isDevEnv=R1()&&{}.IS_VITEST}get context(){return Oe.getLoggerContext(this.logger)}startAbortTimer(i){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),se.toMiliseconds(i))}}var Rb=Object.defineProperty,ml=Object.getOwnPropertySymbols,Cb=Object.prototype.hasOwnProperty,Ob=Object.prototype.propertyIsEnumerable,wl=(u,i,r)=>i in u?Rb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,_l=(u,i)=>{for(var r in i||(i={}))Cb.call(i,r)&&wl(u,r,i[r]);if(ml)for(var r of ml(i))Ob.call(i,r)&&wl(u,r,i[r]);return u};class Pc extends lm{constructor(i){super(i),this.protocol=wf,this.version=T_,this.name=Ic,this.events=new Sr.EventEmitter,this.initialized=!1,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.projectId=i==null?void 0:i.projectId,this.relayUrl=(i==null?void 0:i.relayUrl)||bf;const r=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Oe.pino(Oe.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||N_.logger}));this.logger=Oe.generateChildLogger(r,this.name),this.heartbeat=new gs.HeartBeat,this.crypto=new ob(this,this.logger,i==null?void 0:i.keychain),this.history=new Pb(this,this.logger),this.expirer=new Sb(this,this.logger),this.storage=i!=null&&i.storage?i.storage:new rm(_l(_l({},F_),i==null?void 0:i.storageOptions)),this.relayer=new _b({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Ib(this,this.logger),this.verify=new Ab(this.projectId||"",this.logger)}static async init(i){const r=new Pc(i);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(J_,n),r}get context(){return Oe.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(i){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,i),this.logger.error(i.message),i}}}const Tb=Pc,Ef="wc",xf=2,If="client",Sc=`${Ef}@${xf}:${If}:`,rc={name:If,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},bl="WALLETCONNECT_DEEPLINK_CHOICE",Nb="proposal",Pf="Proposal expired",Fb="session",oo=se.SEVEN_DAYS,Db="engine",Hs={wc_sessionPropose:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1104},res:{ttl:se.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1106},res:{ttl:se.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:se.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:se.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:se.ONE_DAY,prompt:!1,tag:1112},res:{ttl:se.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:se.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:se.THIRTY_SECONDS,prompt:!1,tag:1115}}},ic={min:se.FIVE_MINUTES,max:se.SEVEN_DAYS},ni={idle:"IDLE",active:"ACTIVE"},Lb="request",$b=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var qb=Object.defineProperty,Mb=Object.defineProperties,jb=Object.getOwnPropertyDescriptors,El=Object.getOwnPropertySymbols,Ub=Object.prototype.hasOwnProperty,zb=Object.prototype.propertyIsEnumerable,xl=(u,i,r)=>i in u?qb(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,ar=(u,i)=>{for(var r in i||(i={}))Ub.call(i,r)&&xl(u,r,i[r]);if(El)for(var r of El(i))zb.call(i,r)&&xl(u,r,i[r]);return u},Bs=(u,i)=>Mb(u,jb(i));class kb extends bm{constructor(i){super(i),this.name=Db,this.events=new vc,this.initialized=!1,this.ignoredPayloadTypes=[Ul],this.requestQueue={state:ni.idle,queue:[]},this.sessionRequestQueue={state:ni.idle,queue:[]},this.requestQueueDelay=se.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Hs)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},se.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Bs(ar({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:o,requiredNamespaces:h,optionalNamespaces:d,sessionProperties:v,relays:_}=n;let S=o,F,k=!1;if(S&&(k=this.client.core.pairing.pairings.get(S).active),!S||!k){const{topic:pe,uri:he}=await this.client.core.pairing.create();S=pe,F=he}const B=await this.client.core.crypto.generateKeyPair(),K=ar({requiredNamespaces:h,optionalNamespaces:d,relays:_??[{protocol:_f}],proposer:{publicKey:B,metadata:this.client.metadata}},v&&{sessionProperties:v}),{reject:q,resolve:W,done:ie}=us(se.FIVE_MINUTES,Pf);if(this.events.once(Ft("session_connect"),async({error:pe,session:he})=>{if(pe)q(pe);else if(he){he.self.publicKey=B;const le=Bs(ar({},he),{requiredNamespaces:he.requiredNamespaces,optionalNamespaces:he.optionalNamespaces});await this.client.session.set(he.topic,le),await this.setExpiry(he.topic,he.expiry),S&&await this.client.core.pairing.updateMetadata({topic:S,metadata:he.peer.metadata}),W(le)}}),!S){const{message:pe}=Z("NO_MATCHING_KEY",`connect() pairing topic: ${S}`);throw new Error(pe)}const Ee=await this.sendRequest({topic:S,method:"wc_sessionPropose",params:K}),ge=Fr(se.FIVE_MINUTES);return await this.setProposal(Ee,ar({id:Ee,expiry:ge},K)),{uri:F,approval:ie}},this.pair=async r=>(await this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{await this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:o,namespaces:h,sessionProperties:d}=r,v=this.client.proposal.get(n);let{pairingTopic:_,proposer:S,requiredNamespaces:F,optionalNamespaces:k}=v;_=_||"",ho(F)||(F=O1(h,"approve()"));const B=await this.client.core.crypto.generateKeyPair(),K=S.publicKey,q=await this.client.core.crypto.generateSharedKey(B,K);_&&n&&(await this.client.core.pairing.updateMetadata({topic:_,metadata:S.metadata}),await this.sendResult({id:n,topic:_,result:{relay:{protocol:o??"irn"},responderPublicKey:B}}),await this.client.proposal.delete(n,er("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:_}));const W=ar({relay:{protocol:o??"irn"},namespaces:h,requiredNamespaces:F,optionalNamespaces:k,pairingTopic:_,controller:{publicKey:B,metadata:this.client.metadata},expiry:Fr(oo)},d&&{sessionProperties:d});await this.client.core.relayer.subscribe(q),await this.sendRequest({topic:q,method:"wc_sessionSettle",params:W,throwOnFailedPublish:!0});const ie=Bs(ar({},W),{topic:q,pairingTopic:_,acknowledged:!1,self:W.controller,peer:{publicKey:S.publicKey,metadata:S.metadata},controller:B});return await this.client.session.set(q,ie),await this.setExpiry(q,Fr(oo)),{topic:q,acknowledged:()=>new Promise(Ee=>setTimeout(()=>Ee(this.client.session.get(q)),500))}},this.reject=async r=>{await this.isInitialized(),await this.isValidReject(r);const{id:n,reason:o}=r,{pairingTopic:h}=this.client.proposal.get(n);h&&(await this.sendError(n,h,o),await this.client.proposal.delete(n,er("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:o}=r,h=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:o}}),{done:d,resolve:v,reject:_}=us();return this.events.once(Ft("session_update",h),({error:S})=>{S?_(S):v()}),await this.client.session.update(n,{namespaces:o}),{acknowledged:d}},this.extend=async r=>{await this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,o=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:h,resolve:d,reject:v}=us();return this.events.once(Ft("session_extend",o),({error:_})=>{_?v(_):d()}),await this.setExpiry(n,Fr(oo)),{acknowledged:h}},this.request=async r=>{await this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:o,topic:h,expiry:d}=r,v=bc(),{done:_,resolve:S,reject:F}=us(d);return this.events.once(Ft("session_request",v),({error:k,result:B})=>{k?F(k):S(B)}),await Promise.all([new Promise(async k=>{await this.sendRequest({clientRpcId:v,topic:h,method:"wc_sessionRequest",params:{request:o,chainId:n},expiry:d,throwOnFailedPublish:!0}).catch(B=>F(B)),this.client.events.emit("session_request_sent",{topic:h,request:o,chainId:n,id:v}),k()}),new Promise(async k=>{const B=await this.client.core.storage.getItem(bl);T1({id:v,topic:h,wcDeepLink:B}),k()}),_()]).then(k=>k[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:o}=r,{id:h}=o;oi(o)?await this.sendResult({id:h,topic:n,result:o.result,throwOnFailedPublish:!0}):Dr(o)&&await this.sendError(h,n,o.error),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const o=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:h,resolve:d,reject:v}=us();this.events.once(Ft("session_ping",o),({error:_})=>{_?v(_):d()}),await h()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:o,chainId:h}=r;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:o,chainId:h}})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:er("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>N1(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(h=>{var d,v;return((d=h.peerMetadata)==null?void 0:d.url)&&((v=h.peerMetadata)==null?void 0:v.url)===r.peer.metadata.url&&h.topic&&h.topic!==n.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(h=>this.client.core.pairing.disconnect({topic:h.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:o}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,er("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(bl).catch(h=>this.client.logger.warn(h))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,er("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),o?Promise.resolve():this.client.core.expirer.del(r)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(h=>h.id!==r),o&&(this.sessionRequestQueue.state=ni.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=Hs.wc_sessionRequest.req.ttl,{id:o,topic:h,params:d,verifyContext:v}=r;await this.client.pendingRequest.set(o,{id:o,topic:h,params:d,verifyContext:v}),n&&this.client.core.expirer.set(o,Fr(n))},this.sendRequest=async r=>{const{topic:n,method:o,params:h,expiry:d,relayRpcId:v,clientRpcId:_,throwOnFailedPublish:S}=r,F=ps(o,h,_);if(kl()&&$b.includes(o)){const K=fs(JSON.stringify(F));this.client.core.verify.register({attestationId:K})}const k=await this.client.core.crypto.encode(n,F),B=Hs[o].req;return d&&(B.ttl=d),v&&(B.id=v),this.client.core.history.set(n,F),S?(B.internal=Bs(ar({},B.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,k,B)):this.client.core.relayer.publish(n,k,B).catch(K=>this.client.logger.error(K)),F.id},this.sendResult=async r=>{const{id:n,topic:o,result:h,throwOnFailedPublish:d}=r,v=Ec(n,h),_=await this.client.core.crypto.encode(o,v),S=await this.client.core.history.get(o,n),F=Hs[S.request.method].res;d?(F.internal=Bs(ar({},F.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(o,_,F)):this.client.core.relayer.publish(o,_,F).catch(k=>this.client.logger.error(k)),await this.client.core.history.resolve(v)},this.sendError=async(r,n,o)=>{const h=mo(r,o),d=await this.client.core.crypto.encode(n,h),v=await this.client.core.history.get(n,r),_=Hs[v.request.method].res;this.client.core.relayer.publish(n,d,_),await this.client.core.history.resolve(h)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(o=>{mi(o.expiry)&&r.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{mi(o.expiry)&&n.push(o.id)}),await Promise.all([...r.map(o=>this.deleteSession(o)),...n.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===ni.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ni.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=ni.idle},this.processRequest=r=>{const{topic:n,payload:o}=r,h=o.method;switch(h){case"wc_sessionPropose":return this.onSessionProposeRequest(n,o);case"wc_sessionSettle":return this.onSessionSettleRequest(n,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,o);case"wc_sessionExtend":return this.onSessionExtendRequest(n,o);case"wc_sessionPing":return this.onSessionPingRequest(n,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,o);case"wc_sessionRequest":return this.onSessionRequest(n,o);case"wc_sessionEvent":return this.onSessionEventRequest(n,o);default:return this.client.logger.info(`Unsupported request method ${h}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:o}=r,h=(await this.client.core.history.get(n,o.id)).request.method;switch(h){case"wc_sessionPropose":return this.onSessionProposeResponse(n,o);case"wc_sessionSettle":return this.onSessionSettleResponse(n,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,o);case"wc_sessionExtend":return this.onSessionExtendResponse(n,o);case"wc_sessionPing":return this.onSessionPingResponse(n,o);case"wc_sessionRequest":return this.onSessionRequestResponse(n,o);default:return this.client.logger.info(`Unsupported response method ${h}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:o}=Z("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(r,n)=>{const{params:o,id:h}=n;try{this.isValidConnect(ar({},n.params));const d=Fr(se.FIVE_MINUTES),v=ar({id:h,pairingTopic:r,expiry:d},o);await this.setProposal(h,v);const _=fs(JSON.stringify(n)),S=await this.getVerifyContext(_,v.proposer.metadata);this.client.events.emit("session_proposal",{id:h,params:v,verifyContext:S})}catch(d){await this.sendError(h,r,d),this.client.logger.error(d)}},this.onSessionProposeResponse=async(r,n)=>{const{id:o}=n;if(oi(n)){const{result:h}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:h});const d=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:d});const v=d.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:v});const _=h.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:_});const S=await this.client.core.crypto.generateSharedKey(v,_);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:S});const F=await this.client.core.relayer.subscribe(S);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:F}),await this.client.core.pairing.activate({topic:r})}else Dr(n)&&(await this.client.proposal.delete(o,er("USER_DISCONNECTED")),this.events.emit(Ft("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:o,params:h}=n;try{this.isValidSessionSettleRequest(h);const{relay:d,controller:v,expiry:_,namespaces:S,requiredNamespaces:F,optionalNamespaces:k,sessionProperties:B,pairingTopic:K}=n.params,q=ar({topic:r,relay:d,expiry:_,namespaces:S,acknowledged:!0,pairingTopic:K,requiredNamespaces:F,optionalNamespaces:k,controller:v.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:v.publicKey,metadata:v.metadata}},B&&{sessionProperties:B});await this.sendResult({id:n.id,topic:r,result:!0}),this.events.emit(Ft("session_connect"),{session:q}),this.cleanupDuplicatePairings(q)}catch(d){await this.sendError(o,r,d),this.client.logger.error(d)}},this.onSessionSettleResponse=async(r,n)=>{const{id:o}=n;oi(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Ft("session_approve",o),{})):Dr(n)&&(await this.client.session.delete(r,er("USER_DISCONNECTED")),this.events.emit(Ft("session_approve",o),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:o,id:h}=n;try{const d=`${r}_session_update`,v=no.get(d);if(v&&this.isRequestOutOfSync(v,h)){this.client.logger.info(`Discarding out of sync request - ${h}`);return}this.isValidUpdate(ar({topic:r},o)),await this.client.session.update(r,{namespaces:o.namespaces}),await this.sendResult({id:h,topic:r,result:!0}),this.client.events.emit("session_update",{id:h,topic:r,params:o}),no.set(d,h)}catch(d){await this.sendError(h,r,d),this.client.logger.error(d)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:o}=n;oi(n)?this.events.emit(Ft("session_update",o),{}):Dr(n)&&this.events.emit(Ft("session_update",o),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:o}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Fr(oo)),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_extend",{id:o,topic:r})}catch(h){await this.sendError(o,r,h),this.client.logger.error(h)}},this.onSessionExtendResponse=(r,n)=>{const{id:o}=n;oi(n)?this.events.emit(Ft("session_extend",o),{}):Dr(n)&&this.events.emit(Ft("session_extend",o),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:o}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_ping",{id:o,topic:r})}catch(h){await this.sendError(o,r,h),this.client.logger.error(h)}},this.onSessionPingResponse=(r,n)=>{const{id:o}=n;setTimeout(()=>{oi(n)?this.events.emit(Ft("session_ping",o),{}):Dr(n)&&this.events.emit(Ft("session_ping",o),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:o}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(h=>{this.client.core.relayer.once(Kt.publish,async()=>{h(await this.deleteSession(r))})}),this.sendResult({id:o,topic:r,result:!0})]),this.client.events.emit("session_delete",{id:o,topic:r})}catch(h){this.client.logger.error(h)}},this.onSessionRequest=async(r,n)=>{const{id:o,params:h}=n;try{this.isValidRequest(ar({topic:r},h));const d=fs(JSON.stringify(ps("wc_sessionRequest",h,o))),v=this.client.session.get(r),_=await this.getVerifyContext(d,v.peer.metadata),S={id:o,topic:r,params:h,verifyContext:_};await this.setPendingSessionRequest(S),this.addSessionRequestToSessionRequestQueue(S),this.processSessionRequestQueue()}catch(d){await this.sendError(o,r,d),this.client.logger.error(d)}},this.onSessionRequestResponse=(r,n)=>{const{id:o}=n;oi(n)?this.events.emit(Ft("session_request",o),{result:n.result}):Dr(n)&&this.events.emit(Ft("session_request",o),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:o,params:h}=n;try{const d=`${r}_session_event_${h.event.name}`,v=no.get(d);if(v&&this.isRequestOutOfSync(v,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidEmit(ar({topic:r},h)),this.client.events.emit("session_event",{id:o,topic:r,params:h}),no.set(d,o)}catch(d){await this.sendError(o,r,d),this.client.logger.error(d)}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ni.idle,this.processSessionRequestQueue()},se.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ni.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=ni.active,this.client.events.emit("session_request",r)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=r=>{if(r.active)return;const n=this.client.proposal.getAll().find(o=>o.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,ps("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer},n.id))},this.isValidConnect=async r=>{if(!cr(r)){const{message:_}=Z("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(_)}const{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:h,sessionProperties:d,relays:v}=r;if(wi(n)||await this.isValidPairingTopic(n),!F1(v,!0)){const{message:_}=Z("MISSING_OR_INVALID",`connect() relays: ${v}`);throw new Error(_)}!wi(o)&&ho(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!wi(h)&&ho(h)!==0&&this.validateNamespaces(h,"optionalNamespaces"),wi(d)||this.validateSessionProps(d,"sessionProperties")},this.validateNamespaces=(r,n)=>{const o=D1(r,"connect()",n);if(o)throw new Error(o.message)},this.isValidApprove=async r=>{if(!cr(r))throw new Error(Z("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:o,relayProtocol:h,sessionProperties:d}=r;await this.isValidProposalId(n);const v=this.client.proposal.get(n),_=Ka(o,"approve()");if(_)throw new Error(_.message);const S=Th(v.requiredNamespaces,o,"approve()");if(S)throw new Error(S.message);if(!hs(h,!0)){const{message:F}=Z("MISSING_OR_INVALID",`approve() relayProtocol: ${h}`);throw new Error(F)}wi(d)||this.validateSessionProps(d,"sessionProperties")},this.isValidReject=async r=>{if(!cr(r)){const{message:h}=Z("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(h)}const{id:n,reason:o}=r;if(await this.isValidProposalId(n),!L1(o)){const{message:h}=Z("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(h)}},this.isValidSessionSettleRequest=r=>{if(!cr(r)){const{message:S}=Z("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(S)}const{relay:n,controller:o,namespaces:h,expiry:d}=r;if(!$1(n)){const{message:S}=Z("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(S)}const v=q1(o,"onSessionSettleRequest()");if(v)throw new Error(v.message);const _=Ka(h,"onSessionSettleRequest()");if(_)throw new Error(_.message);if(mi(d)){const{message:S}=Z("EXPIRED","onSessionSettleRequest()");throw new Error(S)}},this.isValidUpdate=async r=>{if(!cr(r)){const{message:_}=Z("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(_)}const{topic:n,namespaces:o}=r;await this.isValidSessionTopic(n);const h=this.client.session.get(n),d=Ka(o,"update()");if(d)throw new Error(d.message);const v=Th(h.requiredNamespaces,o,"update()");if(v)throw new Error(v.message)},this.isValidExtend=async r=>{if(!cr(r)){const{message:o}=Z("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(o)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!cr(r)){const{message:_}=Z("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(_)}const{topic:n,request:o,chainId:h,expiry:d}=r;await this.isValidSessionTopic(n);const{namespaces:v}=this.client.session.get(n);if(!Nh(v,h)){const{message:_}=Z("MISSING_OR_INVALID",`request() chainId: ${h}`);throw new Error(_)}if(!M1(o)){const{message:_}=Z("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(_)}if(!j1(v,h,o.method)){const{message:_}=Z("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(_)}if(d&&!U1(d,ic)){const{message:_}=Z("MISSING_OR_INVALID",`request() expiry: ${d}. Expiry must be a number (in seconds) between ${ic.min} and ${ic.max}`);throw new Error(_)}},this.isValidRespond=async r=>{if(!cr(r)){const{message:h}=Z("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(h)}const{topic:n,response:o}=r;if(await this.isValidSessionTopic(n),!z1(o)){const{message:h}=Z("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(h)}},this.isValidPing=async r=>{if(!cr(r)){const{message:o}=Z("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(o)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!cr(r)){const{message:v}=Z("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(v)}const{topic:n,event:o,chainId:h}=r;await this.isValidSessionTopic(n);const{namespaces:d}=this.client.session.get(n);if(!Nh(d,h)){const{message:v}=Z("MISSING_OR_INVALID",`emit() chainId: ${h}`);throw new Error(v)}if(!k1(o)){const{message:v}=Z("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}if(!H1(d,h,o.name)){const{message:v}=Z("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}},this.isValidDisconnect=async r=>{if(!cr(r)){const{message:o}=Z("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(o)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const o={verified:{verifyUrl:n.verifyUrl||lo,validation:"UNKNOWN",origin:n.url||""}};try{const h=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});h&&(o.verified.origin=h.origin,o.verified.isScam=h.isScam,o.verified.validation=h.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(h){this.client.logger.info(h)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(o=>{if(!hs(o,!1)){const{message:h}=Z("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(o)}`);throw new Error(h)}})}}async isInitialized(){if(!this.initialized){const{message:i}=Z("NOT_INITIALIZED",this.name);throw new Error(i)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Kt.message,async i=>{const{topic:r,message:n}=i;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const o=await this.client.core.crypto.decode(r,n);try{xc(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o})):wo(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o})}catch(h){this.client.logger.error(h)}})}registerExpirerEvents(){this.client.core.expirer.on(Pr.expired,async i=>{const{topic:r,id:n}=zl(i.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Z("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(Gs.create,i=>this.onPairingCreated(i))}isValidPairingTopic(i){if(!hs(i,!1)){const{message:r}=Z("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(i)){const{message:r}=Z("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(r)}if(mi(this.client.core.pairing.pairings.get(i).expiry)){const{message:r}=Z("EXPIRED",`pairing topic: ${i}`);throw new Error(r)}}async isValidSessionTopic(i){if(!hs(i,!1)){const{message:r}=Z("MISSING_OR_INVALID",`session topic should be a string: ${i}`);throw new Error(r)}if(!this.client.session.keys.includes(i)){const{message:r}=Z("NO_MATCHING_KEY",`session topic doesn't exist: ${i}`);throw new Error(r)}if(mi(this.client.session.get(i).expiry)){await this.deleteSession(i);const{message:r}=Z("EXPIRED",`session topic: ${i}`);throw new Error(r)}}async isValidSessionOrPairingTopic(i){if(this.client.session.keys.includes(i))await this.isValidSessionTopic(i);else if(this.client.core.pairing.pairings.keys.includes(i))this.isValidPairingTopic(i);else if(hs(i,!1)){const{message:r}=Z("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${i}`);throw new Error(r)}else{const{message:r}=Z("MISSING_OR_INVALID",`session or pairing topic should be a string: ${i}`);throw new Error(r)}}async isValidProposalId(i){if(!B1(i)){const{message:r}=Z("MISSING_OR_INVALID",`proposal id should be a number: ${i}`);throw new Error(r)}if(!this.client.proposal.keys.includes(i)){const{message:r}=Z("NO_MATCHING_KEY",`proposal id doesn't exist: ${i}`);throw new Error(r)}if(mi(this.client.proposal.get(i).expiry)){await this.deleteProposal(i);const{message:r}=Z("EXPIRED",`proposal id: ${i}`);throw new Error(r)}}}class Hb extends bo{constructor(i,r){super(i,r,Nb,Sc),this.core=i,this.logger=r}}class Bb extends bo{constructor(i,r){super(i,r,Fb,Sc),this.core=i,this.logger=r}}class Vb extends bo{constructor(i,r){super(i,r,Lb,Sc,n=>n.id),this.core=i,this.logger=r}}let Kb=class Sf extends _m{constructor(i){super(i),this.protocol=Ef,this.version=xf,this.name=rc.name,this.events=new Sr.EventEmitter,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(o){throw this.logger.error(o.message),o}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(o){throw this.logger.error(o.message),o}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(o){throw this.logger.error(o.message),o}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(o){throw this.logger.error(o.message),o}},this.update=async n=>{try{return await this.engine.update(n)}catch(o){throw this.logger.error(o.message),o}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(o){throw this.logger.error(o.message),o}},this.request=async n=>{try{return await this.engine.request(n)}catch(o){throw this.logger.error(o.message),o}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(o){throw this.logger.error(o.message),o}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(o){throw this.logger.error(o.message),o}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(o){throw this.logger.error(o.message),o}},this.find=n=>{try{return this.engine.find(n)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=(i==null?void 0:i.name)||rc.name,this.metadata=(i==null?void 0:i.metadata)||C1();const r=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Oe.pino(Oe.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||rc.logger}));this.core=(i==null?void 0:i.core)||new Tb(i),this.logger=Oe.generateChildLogger(r,this.name),this.session=new Bb(this.core,this.logger),this.proposal=new Hb(this.core,this.logger),this.pendingRequest=new Vb(this.core,this.logger),this.engine=new kb(this)}static async init(i){const r=new Sf(i);return await r.initialize(),r}get context(){return Oe.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(i){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(i.message),i}}};var fc={exports:{}};(function(u,i){var r=typeof self<"u"?self:ur,n=function(){function h(){this.fetch=!1,this.DOMException=r.DOMException}return h.prototype=r,new h}();(function(h){(function(d){var v={searchParams:"URLSearchParams"in h,iterable:"Symbol"in h&&"iterator"in Symbol,blob:"FileReader"in h&&"Blob"in h&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in h,arrayBuffer:"ArrayBuffer"in h};function _(y){return y&&DataView.prototype.isPrototypeOf(y)}if(v.arrayBuffer)var S=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],F=ArrayBuffer.isView||function(y){return y&&S.indexOf(Object.prototype.toString.call(y))>-1};function k(y){if(typeof y!="string"&&(y=String(y)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(y))throw new TypeError("Invalid character in header field name");return y.toLowerCase()}function B(y){return typeof y!="string"&&(y=String(y)),y}function K(y){var E={next:function(){var Y=y.shift();return{done:Y===void 0,value:Y}}};return v.iterable&&(E[Symbol.iterator]=function(){return E}),E}function q(y){this.map={},y instanceof q?y.forEach(function(E,Y){this.append(Y,E)},this):Array.isArray(y)?y.forEach(function(E){this.append(E[0],E[1])},this):y&&Object.getOwnPropertyNames(y).forEach(function(E){this.append(E,y[E])},this)}q.prototype.append=function(y,E){y=k(y),E=B(E);var Y=this.map[y];this.map[y]=Y?Y+", "+E:E},q.prototype.delete=function(y){delete this.map[k(y)]},q.prototype.get=function(y){return y=k(y),this.has(y)?this.map[y]:null},q.prototype.has=function(y){return this.map.hasOwnProperty(k(y))},q.prototype.set=function(y,E){this.map[k(y)]=B(E)},q.prototype.forEach=function(y,E){for(var Y in this.map)this.map.hasOwnProperty(Y)&&y.call(E,this.map[Y],Y,this)},q.prototype.keys=function(){var y=[];return this.forEach(function(E,Y){y.push(Y)}),K(y)},q.prototype.values=function(){var y=[];return this.forEach(function(E){y.push(E)}),K(y)},q.prototype.entries=function(){var y=[];return this.forEach(function(E,Y){y.push([Y,E])}),K(y)},v.iterable&&(q.prototype[Symbol.iterator]=q.prototype.entries);function W(y){if(y.bodyUsed)return Promise.reject(new TypeError("Already read"));y.bodyUsed=!0}function ie(y){return new Promise(function(E,Y){y.onload=function(){E(y.result)},y.onerror=function(){Y(y.error)}})}function Ee(y){var E=new FileReader,Y=ie(E);return E.readAsArrayBuffer(y),Y}function ge(y){var E=new FileReader,Y=ie(E);return E.readAsText(y),Y}function pe(y){for(var E=new Uint8Array(y),Y=new Array(E.length),ce=0;ce-1?E:y}function G(y,E){E=E||{};var Y=E.body;if(y instanceof G){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,E.headers||(this.headers=new q(y.headers)),this.method=y.method,this.mode=y.mode,this.signal=y.signal,!Y&&y._bodyInit!=null&&(Y=y._bodyInit,y.bodyUsed=!0)}else this.url=String(y);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new q(E.headers)),this.method=M(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")&&Y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Y)}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function ye(y){var E=new FormData;return y.trim().split("&").forEach(function(Y){if(Y){var ce=Y.split("="),H=ce.shift().replace(/\+/g," "),j=ce.join("=").replace(/\+/g," ");E.append(decodeURIComponent(H),decodeURIComponent(j))}}),E}function re(y){var E=new q,Y=y.replace(/\r?\n[\t ]+/g," ");return Y.split(/\r?\n/).forEach(function(ce){var H=ce.split(":"),j=H.shift().trim();if(j){var z=H.join(":").trim();E.append(j,z)}}),E}le.call(G.prototype);function ue(y,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 q(E.headers),this.url=E.url||"",this._initBody(y)}le.call(ue.prototype),ue.prototype.clone=function(){return new ue(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new q(this.headers),url:this.url})},ue.error=function(){var y=new ue(null,{status:0,statusText:""});return y.type="error",y};var Te=[301,302,303,307,308];ue.redirect=function(y,E){if(Te.indexOf(E)===-1)throw new RangeError("Invalid status code");return new ue(null,{status:E,headers:{location:y}})},d.DOMException=h.DOMException;try{new d.DOMException}catch{d.DOMException=function(E,Y){this.message=E,this.name=Y;var ce=Error(E);this.stack=ce.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function Ue(y,E){return new Promise(function(Y,ce){var H=new G(y,E);if(H.signal&&H.signal.aborted)return ce(new d.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function z(){j.abort()}j.onload=function(){var V={status:j.status,statusText:j.statusText,headers:re(j.getAllResponseHeaders()||"")};V.url="responseURL"in j?j.responseURL:V.headers.get("X-Request-URL");var Je="response"in j?j.response:j.responseText;Y(new ue(Je,V))},j.onerror=function(){ce(new TypeError("Network request failed"))},j.ontimeout=function(){ce(new TypeError("Network request failed"))},j.onabort=function(){ce(new d.DOMException("Aborted","AbortError"))},j.open(H.method,H.url,!0),H.credentials==="include"?j.withCredentials=!0:H.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&v.blob&&(j.responseType="blob"),H.headers.forEach(function(V,Je){j.setRequestHeader(Je,V)}),H.signal&&(H.signal.addEventListener("abort",z),j.onreadystatechange=function(){j.readyState===4&&H.signal.removeEventListener("abort",z)}),j.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return Ue.polyfill=!0,h.fetch||(h.fetch=Ue,h.Headers=q,h.Request=G,h.Response=ue),d.Headers=q,d.Request=G,d.Response=ue,d.fetch=Ue,Object.defineProperty(d,"__esModule",{value:!0}),d})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;i=o.fetch,i.default=o.fetch,i.fetch=o.fetch,i.Headers=o.Headers,i.Request=o.Request,i.Response=o.Response,u.exports=i})(fc,fc.exports);var Gb=fc.exports;const Il=jl(Gb),Wb={Accept:"application/json","Content-Type":"application/json"},Jb="POST",Pl={headers:Wb,method:Jb},Sl=10;class zi{constructor(i,r=!1){if(this.url=i,this.disableProviderPing=r,this.events=new Sr.EventEmitter,this.isAvailable=!1,this.registering=!1,!Xh(i))throw new Error(`Provided URL is not compatible with HTTP connection: ${i}`);this.url=i,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}off(i,r){this.events.off(i,r)}removeListener(i,r){this.events.removeListener(i,r)}async open(i=this.url){await this.register(i)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(i,r){this.isAvailable||await this.register();try{const n=Ys(i),h=await(await Il(this.url,Object.assign(Object.assign({},Pl),{body:n}))).json();this.onPayload({data:h})}catch(n){this.onError(i.id,n)}}async register(i=this.url){if(!Xh(i))throw new Error(`Provided URL is not compatible with HTTP connection: ${i}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",h=>{this.resetMaxListeners(),o(h)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));n()})})}this.url=i,this.registering=!0;try{if(!this.disableProviderPing){const r=Ys({id:1,jsonrpc:"2.0",method:"test",params:[]});await Il(i,Object.assign(Object.assign({},Pl),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(i){if(typeof i.data>"u")return;const r=typeof i.data=="string"?mc(i.data):i.data;this.events.emit("payload",r)}onError(i,r){const n=this.parseError(r),o=n.message||n.toString(),h=mo(i,o);this.events.emit("payload",h)}parseError(i,r=this.url){return rf(i,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Sl&&this.events.setMaxListeners(Sl)}}const Al="error",Qb="wss://relay.walletconnect.com",Yb="wc",Xb="universal_provider",Rl=`${Yb}@2:${Xb}:`,Zb="https://rpc.walletconnect.com/v1/",xi={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors @@ -24,4 +24,4 @@ __p += '`),Ce&&(U+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+U+`return __p -}`;var be=Ph(function(){return Le(p,te+"return "+U).apply(r,m)});if(be.source=U,La(be))throw be;return be}function p0(e){return qe(e).toLowerCase()}function d0(e){return qe(e).toUpperCase()}function g0(e,t,s){if(e=qe(e),e&&(s||t===r))return Dc(e);if(!e||!(t=fr(t)))return e;var a=Cr(e),l=Cr(t),p=Lc(a,l),m=$c(a,l)+1;return yi(a,p,m).join("")}function y0(e,t,s){if(e=qe(e),e&&(s||t===r))return e.slice(0,Mc(e)+1);if(!e||!(t=fr(t)))return e;var a=Cr(e),l=$c(a,Cr(t))+1;return yi(a,0,l).join("")}function v0(e,t,s){if(e=qe(e),e&&(s||t===r))return e.replace(dt,"");if(!e||!(t=fr(t)))return e;var a=Cr(e),l=Lc(a,Cr(t));return yi(a,l).join("")}function m0(e,t){var s=re,a=ue;if(ct(t)){var l="separator"in t?t.separator:l;s="length"in t?we(t.length):s,a="omission"in t?fr(t.omission):a}e=qe(e);var p=e.length;if(Yi(e)){var m=Cr(e);p=m.length}if(s>=p)return e;var w=s-Xi(a);if(w<1)return a;var P=m?yi(m,0,w).join(""):e.slice(0,w);if(l===r)return P+a;if(m&&(w+=P.length-w),$a(l)){if(e.slice(w).search(l)){var D,L=P;for(l.global||(l=Xo(l.source,qe(yr.exec(l))+"g")),l.lastIndex=0;D=l.exec(L);)var U=D.index;P=P.slice(0,U===r?w:U)}}else if(e.indexOf(fr(l),w)!=w){var J=P.lastIndexOf(l);J>-1&&(P=P.slice(0,J))}return P+a}function w0(e){return e=qe(e),e&&ht.test(e)?e.replace(ai,Wf):e}var _0=ns(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ja=Su("toUpperCase");function Ih(e,t,s){return e=qe(e),t=s?r:t,t===r?Hf(e)?Yf(e):Df(e):e.match(t)||[]}var Ph=Ie(function(e,t){try{return Mt(e,r,t)}catch(s){return La(s)?s:new de(s)}}),b0=Yr(function(e,t){return mr(t,function(s){s=zr(s),Jr(e,s,Fa(e[s],e))}),e});function E0(e){var t=e==null?0:e.length,s=ne();return e=t?st(e,function(a){if(typeof a[1]!="function")throw new wr(d);return[s(a[0]),a[1]]}):[],Ie(function(a){for(var l=-1;++lH)return[];var s=V,a=Bt(e,V);t=ne(t),e-=V;for(var l=Jo(a,t);++s0||t<0)?new Ae(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=we(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},Ae.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ae.prototype.toArray=function(){return this.take(V)},jr(Ae.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),l=f[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);l&&(f.prototype[t]=function(){var m=this.__wrapped__,w=a?[1]:arguments,P=m instanceof Ae,D=w[0],L=P||me(m),U=function(Pe){var Ce=l.apply(f,hi([Pe],w));return a&&J?Ce[0]:Ce};L&&s&&typeof D=="function"&&D.length!=1&&(P=L=!1);var J=this.__chain__,te=!!this.__actions__.length,oe=p&&!J,be=P&&!te;if(!p&&L){m=be?m:new Ae(this);var ae=e.apply(m,w);return ae.__actions__.push({func:Yn,args:[U],thisArg:r}),new _r(ae,J)}return oe&&be?e.apply(this,w):(ae=this.thru(U),oe?a?ae.value()[0]:ae.value():ae)})}),mr(["pop","push","shift","sort","splice","unshift"],function(e){var t=xn[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var l=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(me(p)?p:[],l)}return this[s](function(m){return t.apply(me(m)?m:[],l)})}}),jr(Ae.prototype,function(e,t){var s=f[t];if(s){var a=s.name+"";je.call(rs,a)||(rs[a]=[]),rs[a].push({name:t,func:s})}}),rs[Bn(r,Ee).name]=[{name:"wrapper",func:r}],Ae.prototype.clone=wp,Ae.prototype.reverse=_p,Ae.prototype.value=bp,f.prototype.at=Qg,f.prototype.chain=Yg,f.prototype.commit=Xg,f.prototype.next=Zg,f.prototype.plant=ty,f.prototype.reverse=ry,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=iy,f.prototype.first=f.prototype.head,Es&&(f.prototype[Es]=ey),f},Zi=Xf();wt?((wt.exports=Zi)._=Zi,Ge._=Zi):Re._=Zi}).call(Vs)})(pc,pc.exports);var eE=Object.defineProperty,tE=Object.defineProperties,rE=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,sE=Object.prototype.propertyIsEnumerable,Ol=(u,i,r)=>i in u?eE(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,ao=(u,i)=>{for(var r in i||(i={}))iE.call(i,r)&&Ol(u,r,i[r]);if(Cl)for(var r of Cl(i))sE.call(i,r)&&Ol(u,r,i[r]);return u},nE=(u,i)=>tE(u,rE(i));function ys(u,i,r){var n;const o=V1(u);return((n=i.rpcMap)==null?void 0:n[o.reference])||`${Zb}?chainId=${o.namespace}:${o.reference}&projectId=${r}`}function ki(u){return u.includes(":")?u.split(":")[1]:u}function Af(u){return u.map(i=>`${i.split(":")[0]}:${i.split(":")[1]}`)}function oE(u,i){const r=Object.keys(i.namespaces).filter(o=>o.includes(u));if(!r.length)return[];const n=[];return r.forEach(o=>{const h=i.namespaces[o].accounts;n.push(...h)}),n}function aE(u={},i={}){const r=Tl(u),n=Tl(i);return pc.exports.merge(r,n)}function Tl(u){var i,r,n,o;const h={};if(!ho(u))return h;for(const[d,v]of Object.entries(u)){const _=Vl(d)?[d]:v.chains,S=v.methods||[],F=v.events||[],k=v.rpcMap||{},B=Ks(d);h[B]=nE(ao(ao({},h[B]),v),{chains:Ga(_,(i=h[B])==null?void 0:i.chains),methods:Ga(S,(r=h[B])==null?void 0:r.methods),events:Ga(F,(n=h[B])==null?void 0:n.events),rpcMap:ao(ao({},k),(o=h[B])==null?void 0:o.rpcMap)})}return h}function cE(u){return u.includes(":")?u.split(":")[2]:u}function uE(u){const i={};for(const[r,n]of Object.entries(u)){const o=n.methods||[],h=n.events||[],d=n.accounts||[],v=Vl(r)?[r]:n.chains?n.chains:Af(n.accounts);i[r]={chains:v,methods:o,events:h,accounts:d}}return i}function sc(u){return typeof u=="number"?u:u.includes("0x")?parseInt(u,16):u.includes(":")?Number(u.split(":")[1]):Number(u)}const Rf={},Et=u=>Rf[u],nc=(u,i)=>{Rf[u]=i};class hE{constructor(i){this.name="polkadot",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getAccounts(){const i=this.namespace.accounts;return i?i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class lE{constructor(i){this.name="eip155",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(i){switch(i.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(i);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(i.request.method)?await this.client.request(i):this.getHttpProvider().request(i.request)}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(parseInt(i),r),this.chainId=parseInt(i),this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}createHttpProvider(i,r){const n=r||ys(`${this.name}:${i}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=parseInt(ki(r));i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const i=this.chainId,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}async handleSwitchChain(i){var r,n;let o=i.request.params?(r=i.request.params[0])==null?void 0:r.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const h=parseInt(o,16);if(this.isChainApproved(h))this.setDefaultChain(`${h}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:i.topic,request:{method:i.request.method,params:[{chainId:o}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${h}`);else throw new Error(`Failed to switch to chain 'eip155:${h}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(i){return this.namespace.chains.includes(`${this.name}:${i}`)}}class fE{constructor(i){this.name="solana",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class pE{constructor(i){this.name="cosmos",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class dE{constructor(i){this.name="cip34",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),o=ki(r);i[o]=this.createHttpProvider(o,n)}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}getCardanoRPCUrl(i){const r=this.namespace.rpcMap;if(r)return r[i]}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||this.getCardanoRPCUrl(i);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class gE{constructor(i){this.name="elrond",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class yE{constructor(i){this.name="multiversx",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}var vE=Object.defineProperty,mE=Object.defineProperties,wE=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Fl=(u,i,r)=>i in u?vE(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,co=(u,i)=>{for(var r in i||(i={}))_E.call(i,r)&&Fl(u,r,i[r]);if(Nl)for(var r of Nl(i))bE.call(i,r)&&Fl(u,r,i[r]);return u},oc=(u,i)=>mE(u,wE(i));class Ac{constructor(i){this.events=new vc,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=i,this.logger=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Oe.pino(Oe.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||Al})),this.disableProviderPing=(i==null?void 0:i.disableProviderPing)||!1}static async init(i){const r=new Ac(i);return await r.initialize(),r}async request(i,r){const[n,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:co({},i),chainId:`${n}:${o}`,topic:this.session.topic})}sendAsync(i,r,n){this.request(i,n).then(o=>r(null,o)).catch(o=>r(o,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 i;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(i=this.session)==null?void 0:i.topic,reason:er("USER_DISCONNECTED")}),await this.cleanup()}async connect(i){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(i),await this.cleanupPendingPairings(),!i.skipPairing)return await this.pair(i.pairingTopic)}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}removeListener(i,r){this.events.removeListener(i,r)}off(i,r){this.events.off(i,r)}get isWalletConnect(){return!0}async pair(i){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:o}=await this.client.connect({pairingTopic:i,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await o().then(h=>{this.session=h,this.namespaces||(this.namespaces=uE(h.namespaces),this.persist("namespaces",this.namespaces))}).catch(h=>{if(h.message!==Pf)throw h;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(i,r){try{if(!this.session)return;const[n,o]=this.validateChain(i);this.getProvider(n).setDefaultChain(o,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(i={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ds(r)){for(const n of r)i.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.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 i=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[i]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Kb.init({logger:this.providerOpts.logger||Al,relayUrl:this.providerOpts.relayUrl||Qb,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 i=[...new Set(Object.keys(this.session.namespaces).map(r=>Ks(r)))];nc("client",this.client),nc("events",this.events),nc("disableProviderPing",this.disableProviderPing),i.forEach(r=>{if(!this.session)return;const n=oE(r,this.session),o=Af(n),h=aE(this.namespaces,this.optionalNamespaces),d=oc(co({},h[r]),{accounts:n,chains:o});switch(r){case"eip155":this.rpcProviders[r]=new lE({namespace:d});break;case"solana":this.rpcProviders[r]=new fE({namespace:d});break;case"cosmos":this.rpcProviders[r]=new pE({namespace:d});break;case"polkadot":this.rpcProviders[r]=new hE({namespace:d});break;case"cip34":this.rpcProviders[r]=new dE({namespace:d});break;case"elrond":this.rpcProviders[r]=new gE({namespace:d});break;case"multiversx":this.rpcProviders[r]=new yE({namespace:d});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",i=>{this.events.emit("session_ping",i)}),this.client.on("session_event",i=>{const{params:r}=i,{event:n}=r;if(n.name==="accountsChanged"){const o=n.data;o&&ds(o)&&this.events.emit("accountsChanged",o.map(cE))}else if(n.name==="chainChanged"){const o=r.chainId,h=r.event.data,d=Ks(o),v=sc(o)!==sc(h)?`${d}:${sc(h)}`:o;this.onChainChanged(v)}else this.events.emit(n.name,n.data);this.events.emit("session_event",i)}),this.client.on("session_update",({topic:i,params:r})=>{var n;const{namespaces:o}=r,h=(n=this.client)==null?void 0:n.session.get(i);this.session=oc(co({},h),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:i,params:r})}),this.client.on("session_delete",async i=>{await this.cleanup(),this.events.emit("session_delete",i),this.events.emit("disconnect",oc(co({},er("USER_DISCONNECTED")),{data:i.topic}))}),this.on(xi.DEFAULT_CHAIN_CHANGED,i=>{this.onChainChanged(i,!0)})}getProvider(i){if(!this.rpcProviders[i])throw new Error(`Provider not found: ${i}`);return this.rpcProviders[i]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(i=>{var r;this.getProvider(i).updateNamespace((r=this.session)==null?void 0:r.namespaces[i])})}setNamespaces(i){const{namespaces:r,optionalNamespaces:n,sessionProperties:o}=i;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=o,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(i){const[r,n]=(i==null?void 0:i.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(d=>Ks(d)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const o=Ks(Object.keys(this.namespaces)[0]),h=this.rpcProviders[o].getDefaultChain();return[o,h]}async requestAccounts(){const[i]=this.validateChain();return await this.getProvider(i).requestAccounts()}onChainChanged(i,r=!1){var n;if(!this.namespaces)return;const[o,h]=this.validateChain(i);r||this.getProvider(o).setDefaultChain(h),((n=this.namespaces[o])!=null?n:this.namespaces[`${o}:${h}`]).defaultChain=h,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",h)}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(i,r){this.client.core.storage.setItem(`${Rl}/${i}`,r)}async getFromStore(i){return await this.client.core.storage.getItem(`${Rl}/${i}`)}}const EE=Ac,xE="wc",IE="ethereum_provider",PE=`${xE}@2:${IE}:`,SE="https://rpc.walletconnect.com/v1/",dc=["eth_sendTransaction","personal_sign"],AE=["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"],gc=["chainChanged","accountsChanged"],RE=["chainChanged","accountsChanged","message","disconnect","connect"];var CE=Object.defineProperty,OE=Object.defineProperties,TE=Object.getOwnPropertyDescriptors,Dl=Object.getOwnPropertySymbols,NE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,Ll=(u,i,r)=>i in u?CE(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,Ws=(u,i)=>{for(var r in i||(i={}))NE.call(i,r)&&Ll(u,r,i[r]);if(Dl)for(var r of Dl(i))FE.call(i,r)&&Ll(u,r,i[r]);return u},$l=(u,i)=>OE(u,TE(i));function go(u){return Number(u[0].split(":")[1])}function ac(u){return`0x${u.toString(16)}`}function DE(u){const{chains:i,optionalChains:r,methods:n,optionalMethods:o,events:h,optionalEvents:d,rpcMap:v}=u;if(!ds(i))throw new Error("Invalid chains");const _={chains:i,methods:n||dc,events:h||gc,rpcMap:Ws({},i.length?{[go(i)]:v[go(i)]}:{})},S=h==null?void 0:h.filter(K=>!gc.includes(K)),F=n==null?void 0:n.filter(K=>!dc.includes(K));if(!r&&!d&&!o&&!(S!=null&&S.length)&&!(F!=null&&F.length))return{required:i.length?_:void 0};const k=(S==null?void 0:S.length)&&(F==null?void 0:F.length)||!r,B={chains:[...new Set(k?_.chains.concat(r||[]):r)],methods:[...new Set(_.methods.concat(o!=null&&o.length?o:AE))],events:[...new Set(_.events.concat(d!=null&&d.length?d:RE))],rpcMap:v};return{required:i.length?_:void 0,optional:r.length?B:void 0}}class Rc{constructor(){this.events=new Sr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=PE,this.on=(i,r)=>(this.events.on(i,r),this),this.once=(i,r)=>(this.events.once(i,r),this),this.removeListener=(i,r)=>(this.events.removeListener(i,r),this),this.off=(i,r)=>(this.events.off(i,r),this),this.parseAccount=i=>this.isCompatibleChainId(i)?this.parseAccountId(i).address:i,this.signer={},this.rpc={}}static async init(i){const r=new Rc;return await r.initialize(i),r}async request(i){return await this.signer.request(i,this.formatChainId(this.chainId))}sendAsync(i,r){this.signer.sendAsync(i,r,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(i){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(i);const{required:r,optional:n}=DE(this.rpc);try{const o=await new Promise(async(d,v)=>{var _;this.rpc.showQrModal&&((_=this.modal)==null||_.subscribeModal(S=>{!S.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),v(new Error("Connection request reset. Please try again.")))})),await this.signer.connect($l(Ws({namespaces:Ws({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:i==null?void 0:i.pairingTopic})).then(S=>{d(S)}).catch(S=>{v(new Error(S.message))})});if(!o)return;const h=K1(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:h),this.setAccounts(h),this.events.emit("connect",{chainId:ac(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}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",i=>{const{params:r}=i,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",i)}),this.signer.on("chainChanged",i=>{const r=parseInt(i);this.chainId=r,this.events.emit("chainChanged",ac(this.chainId)),this.persist()}),this.signer.on("session_update",i=>{this.events.emit("session_update",i)}),this.signer.on("session_delete",i=>{this.reset(),this.events.emit("session_delete",i),this.events.emit("disconnect",$l(Ws({},er("USER_DISCONNECTED")),{data:i.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",i=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:i})),this.events.emit("display_uri",i)})}switchEthereumChain(i){this.request({method:"wallet_switchEthereumChain",params:[{chainId:i.toString(16)}]})}isCompatibleChainId(i){return typeof i=="string"?i.startsWith(`${this.namespace}:`):!1}formatChainId(i){return`${this.namespace}:${i}`}parseChainId(i){return Number(i.split(":")[1])}setChainIds(i){const r=i.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",ac(this.chainId)),this.persist())}setChainId(i){if(this.isCompatibleChainId(i)){const r=this.parseChainId(i);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(i){const[r,n,o]=i.split(":");return{chainId:`${r}:${n}`,address:o}}setAccounts(i){this.accounts=i.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(i){var r,n;const o=(r=i==null?void 0:i.chains)!=null?r:[],h=(n=i==null?void 0:i.optionalChains)!=null?n:[],d=o.concat(h);if(!d.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const v=o.length?(i==null?void 0:i.methods)||dc:[],_=o.length?(i==null?void 0:i.events)||gc:[],S=(i==null?void 0:i.optionalMethods)||[],F=(i==null?void 0:i.optionalEvents)||[],k=(i==null?void 0:i.rpcMap)||this.buildRpcMap(d,i.projectId),B=(i==null?void 0:i.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(K=>this.formatChainId(K)),optionalChains:h.map(K=>this.formatChainId(K)),methods:v,events:_,optionalMethods:S,optionalEvents:F,rpcMap:k,showQrModal:!!(i!=null&&i.showQrModal),qrModalOptions:B,projectId:i.projectId,metadata:i.metadata}}buildRpcMap(i,r){const n={};return i.forEach(o=>{n[o]=this.getRpcUrl(o,r)}),n}async initialize(i){if(this.rpc=this.getRpcConfig(i),this.chainId=this.rpc.chains.length?go(this.rpc.chains):go(this.rpc.optionalChains),this.signer=await EE.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:i.disableProviderPing,relayUrl:i.relayUrl,storageOptions:i.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await G1(()=>import("./index-1fcc0f57.js").then(o=>o.i),["./index-1fcc0f57.js","./index-5090a415.js","./index-ec4d6aa8.css"],import.meta.url);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Ws({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(i){if(!i)return;const{chains:r,optionalChains:n,rpcMap:o}=i;r&&ds(r)&&(this.rpc.chains=r.map(h=>this.formatChainId(h)),r.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)})),n&&ds(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(h=>this.formatChainId(h)),n.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)}))}getRpcUrl(i,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[i])||`${SE}?chainId=eip155:${i}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const i=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${i}`]?this.session.namespaces[`${this.namespace}:${i}`]:this.session.namespaces[this.namespace];this.setChainIds(i?[this.formatChainId(i)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(i){return typeof i=="string"||i instanceof String?[this.parseAccount(i)]:i.map(r=>this.parseAccount(r))}}const BE=Rc;export{BE as EthereumProvider,RE as OPTIONAL_EVENTS,AE as OPTIONAL_METHODS,gc as REQUIRED_EVENTS,dc as REQUIRED_METHODS,Rc as default}; +}`;var be=Ph(function(){return Le(p,te+"return "+U).apply(r,m)});if(be.source=U,La(be))throw be;return be}function p0(e){return qe(e).toLowerCase()}function d0(e){return qe(e).toUpperCase()}function g0(e,t,s){if(e=qe(e),e&&(s||t===r))return Dc(e);if(!e||!(t=fr(t)))return e;var a=Cr(e),l=Cr(t),p=Lc(a,l),m=$c(a,l)+1;return yi(a,p,m).join("")}function y0(e,t,s){if(e=qe(e),e&&(s||t===r))return e.slice(0,Mc(e)+1);if(!e||!(t=fr(t)))return e;var a=Cr(e),l=$c(a,Cr(t))+1;return yi(a,0,l).join("")}function v0(e,t,s){if(e=qe(e),e&&(s||t===r))return e.replace(dt,"");if(!e||!(t=fr(t)))return e;var a=Cr(e),l=Lc(a,Cr(t));return yi(a,l).join("")}function m0(e,t){var s=re,a=ue;if(ct(t)){var l="separator"in t?t.separator:l;s="length"in t?we(t.length):s,a="omission"in t?fr(t.omission):a}e=qe(e);var p=e.length;if(Yi(e)){var m=Cr(e);p=m.length}if(s>=p)return e;var w=s-Xi(a);if(w<1)return a;var P=m?yi(m,0,w).join(""):e.slice(0,w);if(l===r)return P+a;if(m&&(w+=P.length-w),$a(l)){if(e.slice(w).search(l)){var D,L=P;for(l.global||(l=Xo(l.source,qe(yr.exec(l))+"g")),l.lastIndex=0;D=l.exec(L);)var U=D.index;P=P.slice(0,U===r?w:U)}}else if(e.indexOf(fr(l),w)!=w){var J=P.lastIndexOf(l);J>-1&&(P=P.slice(0,J))}return P+a}function w0(e){return e=qe(e),e&&ht.test(e)?e.replace(ai,Wf):e}var _0=ns(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ja=Su("toUpperCase");function Ih(e,t,s){return e=qe(e),t=s?r:t,t===r?Hf(e)?Yf(e):Df(e):e.match(t)||[]}var Ph=Ie(function(e,t){try{return Mt(e,r,t)}catch(s){return La(s)?s:new de(s)}}),b0=Yr(function(e,t){return mr(t,function(s){s=zr(s),Jr(e,s,Fa(e[s],e))}),e});function E0(e){var t=e==null?0:e.length,s=ne();return e=t?st(e,function(a){if(typeof a[1]!="function")throw new wr(d);return[s(a[0]),a[1]]}):[],Ie(function(a){for(var l=-1;++lH)return[];var s=V,a=Bt(e,V);t=ne(t),e-=V;for(var l=Jo(a,t);++s0||t<0)?new Ae(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=we(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},Ae.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ae.prototype.toArray=function(){return this.take(V)},jr(Ae.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),l=f[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);l&&(f.prototype[t]=function(){var m=this.__wrapped__,w=a?[1]:arguments,P=m instanceof Ae,D=w[0],L=P||me(m),U=function(Pe){var Ce=l.apply(f,hi([Pe],w));return a&&J?Ce[0]:Ce};L&&s&&typeof D=="function"&&D.length!=1&&(P=L=!1);var J=this.__chain__,te=!!this.__actions__.length,oe=p&&!J,be=P&&!te;if(!p&&L){m=be?m:new Ae(this);var ae=e.apply(m,w);return ae.__actions__.push({func:Yn,args:[U],thisArg:r}),new _r(ae,J)}return oe&&be?e.apply(this,w):(ae=this.thru(U),oe?a?ae.value()[0]:ae.value():ae)})}),mr(["pop","push","shift","sort","splice","unshift"],function(e){var t=xn[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var l=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(me(p)?p:[],l)}return this[s](function(m){return t.apply(me(m)?m:[],l)})}}),jr(Ae.prototype,function(e,t){var s=f[t];if(s){var a=s.name+"";je.call(rs,a)||(rs[a]=[]),rs[a].push({name:t,func:s})}}),rs[Bn(r,Ee).name]=[{name:"wrapper",func:r}],Ae.prototype.clone=wp,Ae.prototype.reverse=_p,Ae.prototype.value=bp,f.prototype.at=Qg,f.prototype.chain=Yg,f.prototype.commit=Xg,f.prototype.next=Zg,f.prototype.plant=ty,f.prototype.reverse=ry,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=iy,f.prototype.first=f.prototype.head,Es&&(f.prototype[Es]=ey),f},Zi=Xf();wt?((wt.exports=Zi)._=Zi,Ge._=Zi):Re._=Zi}).call(Vs)})(pc,pc.exports);var eE=Object.defineProperty,tE=Object.defineProperties,rE=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,sE=Object.prototype.propertyIsEnumerable,Ol=(u,i,r)=>i in u?eE(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,ao=(u,i)=>{for(var r in i||(i={}))iE.call(i,r)&&Ol(u,r,i[r]);if(Cl)for(var r of Cl(i))sE.call(i,r)&&Ol(u,r,i[r]);return u},nE=(u,i)=>tE(u,rE(i));function ys(u,i,r){var n;const o=V1(u);return((n=i.rpcMap)==null?void 0:n[o.reference])||`${Zb}?chainId=${o.namespace}:${o.reference}&projectId=${r}`}function ki(u){return u.includes(":")?u.split(":")[1]:u}function Af(u){return u.map(i=>`${i.split(":")[0]}:${i.split(":")[1]}`)}function oE(u,i){const r=Object.keys(i.namespaces).filter(o=>o.includes(u));if(!r.length)return[];const n=[];return r.forEach(o=>{const h=i.namespaces[o].accounts;n.push(...h)}),n}function aE(u={},i={}){const r=Tl(u),n=Tl(i);return pc.exports.merge(r,n)}function Tl(u){var i,r,n,o;const h={};if(!ho(u))return h;for(const[d,v]of Object.entries(u)){const _=Vl(d)?[d]:v.chains,S=v.methods||[],F=v.events||[],k=v.rpcMap||{},B=Ks(d);h[B]=nE(ao(ao({},h[B]),v),{chains:Ga(_,(i=h[B])==null?void 0:i.chains),methods:Ga(S,(r=h[B])==null?void 0:r.methods),events:Ga(F,(n=h[B])==null?void 0:n.events),rpcMap:ao(ao({},k),(o=h[B])==null?void 0:o.rpcMap)})}return h}function cE(u){return u.includes(":")?u.split(":")[2]:u}function uE(u){const i={};for(const[r,n]of Object.entries(u)){const o=n.methods||[],h=n.events||[],d=n.accounts||[],v=Vl(r)?[r]:n.chains?n.chains:Af(n.accounts);i[r]={chains:v,methods:o,events:h,accounts:d}}return i}function sc(u){return typeof u=="number"?u:u.includes("0x")?parseInt(u,16):u.includes(":")?Number(u.split(":")[1]):Number(u)}const Rf={},Et=u=>Rf[u],nc=(u,i)=>{Rf[u]=i};class hE{constructor(i){this.name="polkadot",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getAccounts(){const i=this.namespace.accounts;return i?i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class lE{constructor(i){this.name="eip155",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(i){switch(i.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(i);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(i.request.method)?await this.client.request(i):this.getHttpProvider().request(i.request)}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(parseInt(i),r),this.chainId=parseInt(i),this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}createHttpProvider(i,r){const n=r||ys(`${this.name}:${i}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=parseInt(ki(r));i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const i=this.chainId,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}async handleSwitchChain(i){var r,n;let o=i.request.params?(r=i.request.params[0])==null?void 0:r.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const h=parseInt(o,16);if(this.isChainApproved(h))this.setDefaultChain(`${h}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:i.topic,request:{method:i.request.method,params:[{chainId:o}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${h}`);else throw new Error(`Failed to switch to chain 'eip155:${h}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(i){return this.namespace.chains.includes(`${this.name}:${i}`)}}class fE{constructor(i){this.name="solana",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class pE{constructor(i){this.name="cosmos",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class dE{constructor(i){this.name="cip34",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),o=ki(r);i[o]=this.createHttpProvider(o,n)}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}getCardanoRPCUrl(i){const r=this.namespace.rpcMap;if(r)return r[i]}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||this.getCardanoRPCUrl(i);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class gE{constructor(i){this.name="elrond",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}class yE{constructor(i){this.name="multiversx",this.namespace=i.namespace,this.events=Et("events"),this.client=Et("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(i){this.namespace=Object.assign(this.namespace,i)}requestAccounts(){return this.getAccounts()}request(i){return this.namespace.methods.includes(i.request.method)?this.client.request(i):this.getHttpProvider().request(i.request)}setDefaultChain(i,r){this.httpProviders[i]||this.setHttpProvider(i,r),this.chainId=i,this.events.emit(xi.DEFAULT_CHAIN_CHANGED,`${this.name}:${i}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const i=this.namespace.chains[0];if(!i)throw new Error("ChainId not found");return i.split(":")[1]}getAccounts(){const i=this.namespace.accounts;return i?[...new Set(i.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const i={};return this.namespace.chains.forEach(r=>{var n;const o=ki(r);i[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),i}getHttpProvider(){const i=`${this.name}:${this.chainId}`,r=this.httpProviders[i];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${i} not found`);return r}setHttpProvider(i,r){const n=this.createHttpProvider(i,r);n&&(this.httpProviders[i]=n)}createHttpProvider(i,r){const n=r||ys(i,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${i}`);return new Ei(new zi(n,Et("disableProviderPing")))}}var vE=Object.defineProperty,mE=Object.defineProperties,wE=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Fl=(u,i,r)=>i in u?vE(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,co=(u,i)=>{for(var r in i||(i={}))_E.call(i,r)&&Fl(u,r,i[r]);if(Nl)for(var r of Nl(i))bE.call(i,r)&&Fl(u,r,i[r]);return u},oc=(u,i)=>mE(u,wE(i));class Ac{constructor(i){this.events=new vc,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=i,this.logger=typeof(i==null?void 0:i.logger)<"u"&&typeof(i==null?void 0:i.logger)!="string"?i.logger:Oe.pino(Oe.getDefaultLoggerOptions({level:(i==null?void 0:i.logger)||Al})),this.disableProviderPing=(i==null?void 0:i.disableProviderPing)||!1}static async init(i){const r=new Ac(i);return await r.initialize(),r}async request(i,r){const[n,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:co({},i),chainId:`${n}:${o}`,topic:this.session.topic})}sendAsync(i,r,n){this.request(i,n).then(o=>r(null,o)).catch(o=>r(o,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 i;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(i=this.session)==null?void 0:i.topic,reason:er("USER_DISCONNECTED")}),await this.cleanup()}async connect(i){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(i),await this.cleanupPendingPairings(),!i.skipPairing)return await this.pair(i.pairingTopic)}on(i,r){this.events.on(i,r)}once(i,r){this.events.once(i,r)}removeListener(i,r){this.events.removeListener(i,r)}off(i,r){this.events.off(i,r)}get isWalletConnect(){return!0}async pair(i){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:o}=await this.client.connect({pairingTopic:i,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await o().then(h=>{this.session=h,this.namespaces||(this.namespaces=uE(h.namespaces),this.persist("namespaces",this.namespaces))}).catch(h=>{if(h.message!==Pf)throw h;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(i,r){try{if(!this.session)return;const[n,o]=this.validateChain(i);this.getProvider(n).setDefaultChain(o,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(i={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ds(r)){for(const n of r)i.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.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 i=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[i]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Kb.init({logger:this.providerOpts.logger||Al,relayUrl:this.providerOpts.relayUrl||Qb,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 i=[...new Set(Object.keys(this.session.namespaces).map(r=>Ks(r)))];nc("client",this.client),nc("events",this.events),nc("disableProviderPing",this.disableProviderPing),i.forEach(r=>{if(!this.session)return;const n=oE(r,this.session),o=Af(n),h=aE(this.namespaces,this.optionalNamespaces),d=oc(co({},h[r]),{accounts:n,chains:o});switch(r){case"eip155":this.rpcProviders[r]=new lE({namespace:d});break;case"solana":this.rpcProviders[r]=new fE({namespace:d});break;case"cosmos":this.rpcProviders[r]=new pE({namespace:d});break;case"polkadot":this.rpcProviders[r]=new hE({namespace:d});break;case"cip34":this.rpcProviders[r]=new dE({namespace:d});break;case"elrond":this.rpcProviders[r]=new gE({namespace:d});break;case"multiversx":this.rpcProviders[r]=new yE({namespace:d});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",i=>{this.events.emit("session_ping",i)}),this.client.on("session_event",i=>{const{params:r}=i,{event:n}=r;if(n.name==="accountsChanged"){const o=n.data;o&&ds(o)&&this.events.emit("accountsChanged",o.map(cE))}else if(n.name==="chainChanged"){const o=r.chainId,h=r.event.data,d=Ks(o),v=sc(o)!==sc(h)?`${d}:${sc(h)}`:o;this.onChainChanged(v)}else this.events.emit(n.name,n.data);this.events.emit("session_event",i)}),this.client.on("session_update",({topic:i,params:r})=>{var n;const{namespaces:o}=r,h=(n=this.client)==null?void 0:n.session.get(i);this.session=oc(co({},h),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:i,params:r})}),this.client.on("session_delete",async i=>{await this.cleanup(),this.events.emit("session_delete",i),this.events.emit("disconnect",oc(co({},er("USER_DISCONNECTED")),{data:i.topic}))}),this.on(xi.DEFAULT_CHAIN_CHANGED,i=>{this.onChainChanged(i,!0)})}getProvider(i){if(!this.rpcProviders[i])throw new Error(`Provider not found: ${i}`);return this.rpcProviders[i]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(i=>{var r;this.getProvider(i).updateNamespace((r=this.session)==null?void 0:r.namespaces[i])})}setNamespaces(i){const{namespaces:r,optionalNamespaces:n,sessionProperties:o}=i;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=o,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(i){const[r,n]=(i==null?void 0:i.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(d=>Ks(d)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const o=Ks(Object.keys(this.namespaces)[0]),h=this.rpcProviders[o].getDefaultChain();return[o,h]}async requestAccounts(){const[i]=this.validateChain();return await this.getProvider(i).requestAccounts()}onChainChanged(i,r=!1){var n;if(!this.namespaces)return;const[o,h]=this.validateChain(i);r||this.getProvider(o).setDefaultChain(h),((n=this.namespaces[o])!=null?n:this.namespaces[`${o}:${h}`]).defaultChain=h,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",h)}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(i,r){this.client.core.storage.setItem(`${Rl}/${i}`,r)}async getFromStore(i){return await this.client.core.storage.getItem(`${Rl}/${i}`)}}const EE=Ac,xE="wc",IE="ethereum_provider",PE=`${xE}@2:${IE}:`,SE="https://rpc.walletconnect.com/v1/",dc=["eth_sendTransaction","personal_sign"],AE=["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"],gc=["chainChanged","accountsChanged"],RE=["chainChanged","accountsChanged","message","disconnect","connect"];var CE=Object.defineProperty,OE=Object.defineProperties,TE=Object.getOwnPropertyDescriptors,Dl=Object.getOwnPropertySymbols,NE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,Ll=(u,i,r)=>i in u?CE(u,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[i]=r,Ws=(u,i)=>{for(var r in i||(i={}))NE.call(i,r)&&Ll(u,r,i[r]);if(Dl)for(var r of Dl(i))FE.call(i,r)&&Ll(u,r,i[r]);return u},$l=(u,i)=>OE(u,TE(i));function go(u){return Number(u[0].split(":")[1])}function ac(u){return`0x${u.toString(16)}`}function DE(u){const{chains:i,optionalChains:r,methods:n,optionalMethods:o,events:h,optionalEvents:d,rpcMap:v}=u;if(!ds(i))throw new Error("Invalid chains");const _={chains:i,methods:n||dc,events:h||gc,rpcMap:Ws({},i.length?{[go(i)]:v[go(i)]}:{})},S=h==null?void 0:h.filter(K=>!gc.includes(K)),F=n==null?void 0:n.filter(K=>!dc.includes(K));if(!r&&!d&&!o&&!(S!=null&&S.length)&&!(F!=null&&F.length))return{required:i.length?_:void 0};const k=(S==null?void 0:S.length)&&(F==null?void 0:F.length)||!r,B={chains:[...new Set(k?_.chains.concat(r||[]):r)],methods:[...new Set(_.methods.concat(o!=null&&o.length?o:AE))],events:[...new Set(_.events.concat(d!=null&&d.length?d:RE))],rpcMap:v};return{required:i.length?_:void 0,optional:r.length?B:void 0}}class Rc{constructor(){this.events=new Sr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=PE,this.on=(i,r)=>(this.events.on(i,r),this),this.once=(i,r)=>(this.events.once(i,r),this),this.removeListener=(i,r)=>(this.events.removeListener(i,r),this),this.off=(i,r)=>(this.events.off(i,r),this),this.parseAccount=i=>this.isCompatibleChainId(i)?this.parseAccountId(i).address:i,this.signer={},this.rpc={}}static async init(i){const r=new Rc;return await r.initialize(i),r}async request(i){return await this.signer.request(i,this.formatChainId(this.chainId))}sendAsync(i,r){this.signer.sendAsync(i,r,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(i){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(i);const{required:r,optional:n}=DE(this.rpc);try{const o=await new Promise(async(d,v)=>{var _;this.rpc.showQrModal&&((_=this.modal)==null||_.subscribeModal(S=>{!S.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),v(new Error("Connection request reset. Please try again.")))})),await this.signer.connect($l(Ws({namespaces:Ws({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:i==null?void 0:i.pairingTopic})).then(S=>{d(S)}).catch(S=>{v(new Error(S.message))})});if(!o)return;const h=K1(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:h),this.setAccounts(h),this.events.emit("connect",{chainId:ac(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}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",i=>{const{params:r}=i,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",i)}),this.signer.on("chainChanged",i=>{const r=parseInt(i);this.chainId=r,this.events.emit("chainChanged",ac(this.chainId)),this.persist()}),this.signer.on("session_update",i=>{this.events.emit("session_update",i)}),this.signer.on("session_delete",i=>{this.reset(),this.events.emit("session_delete",i),this.events.emit("disconnect",$l(Ws({},er("USER_DISCONNECTED")),{data:i.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",i=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:i})),this.events.emit("display_uri",i)})}switchEthereumChain(i){this.request({method:"wallet_switchEthereumChain",params:[{chainId:i.toString(16)}]})}isCompatibleChainId(i){return typeof i=="string"?i.startsWith(`${this.namespace}:`):!1}formatChainId(i){return`${this.namespace}:${i}`}parseChainId(i){return Number(i.split(":")[1])}setChainIds(i){const r=i.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",ac(this.chainId)),this.persist())}setChainId(i){if(this.isCompatibleChainId(i)){const r=this.parseChainId(i);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(i){const[r,n,o]=i.split(":");return{chainId:`${r}:${n}`,address:o}}setAccounts(i){this.accounts=i.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(i){var r,n;const o=(r=i==null?void 0:i.chains)!=null?r:[],h=(n=i==null?void 0:i.optionalChains)!=null?n:[],d=o.concat(h);if(!d.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const v=o.length?(i==null?void 0:i.methods)||dc:[],_=o.length?(i==null?void 0:i.events)||gc:[],S=(i==null?void 0:i.optionalMethods)||[],F=(i==null?void 0:i.optionalEvents)||[],k=(i==null?void 0:i.rpcMap)||this.buildRpcMap(d,i.projectId),B=(i==null?void 0:i.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(K=>this.formatChainId(K)),optionalChains:h.map(K=>this.formatChainId(K)),methods:v,events:_,optionalMethods:S,optionalEvents:F,rpcMap:k,showQrModal:!!(i!=null&&i.showQrModal),qrModalOptions:B,projectId:i.projectId,metadata:i.metadata}}buildRpcMap(i,r){const n={};return i.forEach(o=>{n[o]=this.getRpcUrl(o,r)}),n}async initialize(i){if(this.rpc=this.getRpcConfig(i),this.chainId=this.rpc.chains.length?go(this.rpc.chains):go(this.rpc.optionalChains),this.signer=await EE.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:i.disableProviderPing,relayUrl:i.relayUrl,storageOptions:i.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await G1(()=>import("./index-73f7d853.js").then(o=>o.i),["./index-73f7d853.js","./index-d8f85335.js","./index-ec4d6aa8.css"],import.meta.url);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Ws({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(i){if(!i)return;const{chains:r,optionalChains:n,rpcMap:o}=i;r&&ds(r)&&(this.rpc.chains=r.map(h=>this.formatChainId(h)),r.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)})),n&&ds(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(h=>this.formatChainId(h)),n.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)}))}getRpcUrl(i,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[i])||`${SE}?chainId=eip155:${i}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const i=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${i}`]?this.session.namespaces[`${this.namespace}:${i}`]:this.session.namespaces[this.namespace];this.setChainIds(i?[this.formatChainId(i)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(i){return typeof i=="string"||i instanceof String?[this.parseAccount(i)]:i.map(r=>this.parseAccount(r))}}const BE=Rc;export{BE as EthereumProvider,RE as OPTIONAL_EVENTS,AE as OPTIONAL_METHODS,gc as REQUIRED_EVENTS,dc as REQUIRED_METHODS,Rc as default}; diff --git a/website/dist/index.html b/website/dist/index.html index 49ceb0b3..3b842786 100644 --- a/website/dist/index.html +++ b/website/dist/index.html @@ -9,7 +9,7 @@ WalletKit - + diff --git a/website/src/pages/index.mdx b/website/src/pages/index.mdx index 95e6e027..12d06e7d 100644 --- a/website/src/pages/index.mdx +++ b/website/src/pages/index.mdx @@ -1,6 +1,6 @@ -# Getting Started +# Quick start -## Install +## Installation ```bash npm i @totejs/walletkit wagmi viem