@dcl/auth-site 0.1.3-7386581352.commit-0ef8d7f → 0.1.3-7397576829.commit-ee5588d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/background-eb69c1f2.svg +89 -0
- package/assets/{index-e6498b45.css → index-17ad8643.css} +3 -3
- package/assets/{index-e1990c9b.js → index-181eb57b.js} +4 -4
- package/assets/{index-e1990c9b.js.map → index-181eb57b.js.map} +1 -1
- package/assets/{index-182c30c0.js → index-9d822deb.js} +2 -2
- package/assets/{index-182c30c0.js.map → index-9d822deb.js.map} +1 -1
- package/assets/{index-5d5f068e.js → index-decd800e.js} +2 -2
- package/assets/{index-5d5f068e.js.map → index-decd800e.js.map} +1 -1
- package/index.html +2 -2
- package/package.json +3 -3
|
@@ -118,7 +118,7 @@ Instead of \``+$+"`, did you mean:",k.map(function(M){return`
|
|
|
118
118
|
border-radius: 0;
|
|
119
119
|
z-index: 2147483647;
|
|
120
120
|
}
|
|
121
|
-
`}])),lN}var A4e=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S4e=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),O4e=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&A4e(e,t,r);return S4e(e,t),e};Object.defineProperty(qS,"__esModule",{value:!0});qS.FortmaticConnector=void 0;const I4e=eae,P4e=Ml,T4e=qs;class R4e extends I4e.AbstractConnector{constructor(e){const r=T4e.getConfiguration()[P4e.ProviderType.FORTMATIC],n=Object.keys(r.apiKeys).map(i=>Number(i));if(!n.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:n}),this.apiKey=r.apiKeys[e],this.chainId=e,this.rpcUrl=r.urls[e]}async activate(){if(!this.fortmatic){const{default:r}=await Promise.resolve().then(()=>O4e(x4e()));this.fortmatic=new r(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(r=>r[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}qS.FortmaticConnector=R4e;var JS={};function V4(){return V4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},V4.apply(this,arguments)}function mk(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function G4(t){return G4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},G4(t)}function kA(t,e){return kA=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},kA(t,e)}function C4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _x(t,e,r){return C4e()?_x=Reflect.construct:_x=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&kA(u,o.prototype),u},_x.apply(null,arguments)}function N4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function LA(t){var e=typeof Map=="function"?new Map:void 0;return LA=function(n){if(n===null||!N4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return _x(n,arguments,G4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),kA(i,n)},LA(t)}function dE(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function p0(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function zc(t){return t.hasOwnProperty("result")?t.result:t}var Ex=function(t){mk(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="No Ethereum provider was found on window.ethereum.",r}return e}(LA(Error)),Uae=function(t){mk(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="The user rejected the request.",r}return e}(LA(Error)),D4e=function(t){mk(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(dE(i)),i.handleChainChanged=i.handleChainChanged.bind(dE(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(dE(i)),i.handleClose=i.handleClose.bind(dE(i)),i}var r=e.prototype;return r.handleChainChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.handleAccountsChanged=function(i){i.length===0?this.emitDeactivate():this.emitUpdate({account:i[0]})},r.handleClose=function(i,a){this.emitDeactivate()},r.handleNetworkChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.activate=function(){try{var i=function(f){if(a)return f;function d(){return V4({provider:window.ethereum},s?{account:s}:{})}var g=function(){if(!s)return Promise.resolve(window.ethereum.enable().then(function(m){return m&&zc(m)[0]})).then(function(m){s=m})}();return g&&g.then?g.then(d):d(g)},a=!1,o=this;if(!window.ethereum)throw new Ex;window.ethereum.on&&(window.ethereum.on("chainChanged",o.handleChainChanged),window.ethereum.on("accountsChanged",o.handleAccountsChanged),window.ethereum.on("close",o.handleClose),window.ethereum.on("networkChanged",o.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var s,c=p0(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return zc(u)[0]})).then(function(u){s=u})},function(u){if(u.code===4001)throw new Uae});return Promise.resolve(c&&c.then?c.then(i):i(c))}catch(u){return Promise.reject(u)}},r.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(i){return Promise.reject(i)}},r.getChainId=function(){try{var i=function(){function c(){if(!a)try{a=zc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=zc(window.ethereum.cachedResults.net_version):a=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.send("net_version").then(zc)).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new Ex;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(zc)).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.getAccount=function(){try{var i=function(){function c(){return a||(a=zc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.enable().then(function(d){return zc(d)[0]})).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new Ex;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(s){return zc(s)[0]})).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},r.isAuthorized=function(){try{return window.ethereum?Promise.resolve(p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return zc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(jS);const $4e=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:D4e,NoEthereumProviderError:Ex,UserRejectedRequestError:Uae},Symbol.toStringTag,{value:"Module"})),M4e=uo($4e);Object.defineProperty(JS,"__esModule",{value:!0});JS.InjectedConnector=void 0;const k4e=M4e;class L4e extends k4e.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}JS.InjectedConnector=L4e;var XS={},U4e="Invariant failed";function OW(t,e){if(!t)throw new Error(U4e)}function Bae(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,x1(t,e)}function W4(t){return W4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},W4(t)}function x1(t,e){return x1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},x1(t,e)}function B4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function xx(t,e,r){return B4e()?xx=Reflect.construct:xx=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&x1(u,o.prototype),u},xx.apply(null,arguments)}function F4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function K4(t){var e=typeof Map=="function"?new Map:void 0;return K4=function(n){if(n===null||!F4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return xx(n,arguments,W4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),x1(i,n)},K4(t)}var Ax=function(t){Bae(e,t);function e(r,n,i){var a;return a=t.call(this)||this,a.code=n,a.data=i,a.name=a.constructor.name,a.message=r,a}return e}(K4(Error)),j4e=function(e,r){var n=this,i=this;this.isMetaMask=!1,this.sendAsync=function(o,s){console.log("sendAsync",o.method,o.params),i.request(o.method,o.params).then(function(c){return s(null,{jsonrpc:"2.0",id:o.id,result:c})}).catch(function(c){return s(c,null)})},this.request=function(o,s){try{return typeof o!="string"&&(s=o.params,o=o.method),Promise.resolve(fetch(n.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:o,params:s}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new Ax(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,d,g;throw new Ax(u==null||(f=u.error)==null?void 0:f.message,u==null||(d=u.error)==null?void 0:d.code,u==null||(g=u.error)==null?void 0:g.data)}else{if("result"in u)return u.result;throw new Ax("Received unexpected JSON-RPC response to "+o+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=e,this.url=r;var a=new URL(r);this.host=a.host,this.path=a.pathname},q4e=function(t){Bae(e,t);function e(n){var i,a=n.urls,o=n.defaultChainId;return o||Object.keys(a).length===1||OW(!1),i=t.call(this,{supportedChainIds:Object.keys(a).map(function(s){return Number(s)})})||this,i.currentChainId=o||Number(Object.keys(a)[0]),i.providers=Object.keys(a).reduce(function(s,c){return s[Number(c)]=new j4e(Number(c),a[Number(c)]),s},{}),i}var r=e.prototype;return r.activate=function(){try{var i=this;return Promise.resolve({provider:i.providers[i.currentChainId],chainId:i.currentChainId,account:null})}catch(a){return Promise.reject(a)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.providers[i.currentChainId])}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.currentChainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){return Promise.resolve(null)},r.deactivate=function(){},r.changeChainId=function(i){Object.keys(this.providers).includes(i.toString())||OW(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(jS);const H4e=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:q4e,RequestError:Ax},Symbol.toStringTag,{value:"Module"})),z4e=uo(H4e);Object.defineProperty(XS,"__esModule",{value:!0});XS.NetworkConnector=void 0;const V4e=Ac,G4e=z4e,W4e=qs;class K4e extends G4e.NetworkConnector{constructor(e){super({urls:W4e.getConfiguration()[V4e.ProviderType.NETWORK].urls,defaultChainId:e})}}XS.NetworkConnector=K4e;var ZS={};const Y4e="modulepreload",Q4e=function(t){return"https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7386581352.commit-0ef8d7f/"+t},IW={},Ty=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=Q4e(a),a in IW)return;IW[a]=!0;const o=a.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const d=i[f];if(d.href===a&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Y4e,o||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})};function Y4(){return Y4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Y4.apply(this,arguments)}function J4e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Q4(t,e)}function Q4(t,e){return Q4=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Q4(t,e)}function PW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var X4e=1,Z4e=function(t){J4e(e,t);function e(n){var i,a=n.url,o=n.appName,s=n.appLogoUrl,c=n.darkMode,u=n.supportedChainIds;return i=t.call(this,{supportedChainIds:u})||this,i.url=a,i.appName=o,i.appLogoUrl=s,i.darkMode=c||!1,i.handleChainChanged=i.handleChainChanged.bind(PW(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(PW(i)),i}var r=e.prototype;return r.activate=function(){try{var i=this,a=function(){return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return i.provider.on("chainChanged",i.handleChainChanged),i.provider.on("accountsChanged",i.handleAccountsChanged),{provider:i.provider,account:u}})},o=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)i.provider=window.ethereum;else{var s=function(){if(!i.walletLink)return Promise.resolve(Ty(()=>import("./index-182c30c0.js").then(c=>c.i),[]).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){i.walletLink=new c(Y4({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,X4e)})}();if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(a):a(o))}catch(s){return Promise.reject(s)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.provider)}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.provider.chainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){try{var i=this;return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(a){return a[0]})}catch(a){return Promise.reject(a)}},r.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},r.close=function(){try{var i=this;return i.provider.close(),i.emitDeactivate(),Promise.resolve()}catch(a){return Promise.reject(a)}},r.handleChainChanged=function(i){this.emitUpdate({chainId:i})},r.handleAccountsChanged=function(i){this.emitUpdate({account:i[0]})},e}(jS);const e5e=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:Z4e},Symbol.toStringTag,{value:"Module"})),t5e=uo(e5e);Object.defineProperty(ZS,"__esModule",{value:!0});ZS.WalletLinkConnector=void 0;const r5e=Ml,n5e=t5e,i5e=qs;class a5e extends n5e.WalletLinkConnector{constructor(e){const r=i5e.getConfiguration()[r5e.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}ZS.WalletLinkConnector=a5e;var eO={};const o5e=Symbol(),TW=Object.getPrototypeOf,J4=new WeakMap,s5e=t=>t&&(J4.has(t)?J4.get(t):TW(t)===Object.prototype||TW(t)===Array.prototype),c5e=t=>s5e(t)&&t[o5e]||null,RW=(t,e=!0)=>{J4.set(t,e)},fN=t=>typeof t=="object"&&t!==null,wf=new WeakMap,hE=new WeakSet,u5e=(t=Object.is,e=(u,f)=>new Proxy(u,f),r=u=>fN(u)&&!hE.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),n=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,a=(u,f,d=n)=>{const g=i.get(u);if((g==null?void 0:g[0])===f)return g[1];const m=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return RW(m,!0),i.set(u,[f,m]),Reflect.ownKeys(u).forEach(w=>{if(Object.getOwnPropertyDescriptor(m,w))return;const v=Reflect.get(u,w),y={value:v,enumerable:!0,configurable:!0};if(hE.has(v))RW(v,!1);else if(v instanceof Promise)delete y.value,y.get=()=>d(v);else if(wf.has(v)){const[_,b]=wf.get(v);y.value=a(_,b(),d)}Object.defineProperty(m,w,y)}),Object.preventExtensions(m)},o=new WeakMap,s=[1,1],c=u=>{if(!fN(u))throw new Error("object required");const f=o.get(u);if(f)return f;let d=s[0];const g=new Set,m=(C,L=++s[0])=>{d!==L&&(d=L,g.forEach(q=>q(C,L)))};let w=s[1];const v=(C=++s[1])=>(w!==C&&!g.size&&(w=C,_.forEach(([L])=>{const q=L[1](C);q>d&&(d=q)})),d),y=C=>(L,q)=>{const le=[...L];le[1]=[C,...le[1]],m(le,q)},_=new Map,b=(C,L)=>{if(g.size){const q=L[3](y(C));_.set(C,[L,q])}else _.set(C,[L])},S=C=>{var L;const q=_.get(C);q&&(_.delete(C),(L=q[1])==null||L.call(q))},x=C=>(g.add(C),g.size===1&&_.forEach(([q,le],pe)=>{const B=q[3](y(pe));_.set(pe,[q,B])}),()=>{g.delete(C),g.size===0&&_.forEach(([q,le],pe)=>{le&&(le(),_.set(pe,[q]))})}),O=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),p=e(O,{deleteProperty(C,L){const q=Reflect.get(C,L);S(L);const le=Reflect.deleteProperty(C,L);return le&&m(["delete",[L],q]),le},set(C,L,q,le){const pe=Reflect.has(C,L),B=Reflect.get(C,L,le);if(pe&&(t(B,q)||o.has(q)&&t(B,o.get(q))))return!0;S(L),fN(q)&&(q=c5e(q)||q);let U=q;if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,m(["resolve",[L],K])}).catch(K=>{q.status="rejected",q.reason=K,m(["reject",[L],K])});else{!wf.has(q)&&r(q)&&(U=c(q));const K=!hE.has(U)&&wf.get(U);K&&b(L,K)}return Reflect.set(C,L,U,le),m(["set",[L],q,B]),!0}});o.set(u,p);const I=[O,v,a,x];return wf.set(p,I),Reflect.ownKeys(u).forEach(C=>{const L=Object.getOwnPropertyDescriptor(u,C);"value"in L&&(p[C]=u[C],delete L.value,delete L.writable),Object.defineProperty(O,C,L)}),p})=>[c,wf,hE,t,e,r,n,i,a,o,s],[l5e]=u5e();function xd(t={}){return l5e(t)}function Ip(t,e,r){const n=wf.get(t);let i;const a=[],o=n[3];let s=!1;const u=o(f=>{if(a.push(f),r){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,s&&e(a.splice(0))}))});return s=!0,()=>{s=!1,u()}}function f5e(t,e){const r=wf.get(t),[n,i,a]=r;return a(n,i(),e)}const Wi=xd({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Fae={state:Wi,subscribe(t){return Ip(Wi,()=>t(Wi))},push(t,e){t!==Wi.view&&(Wi.view=t,e&&(Wi.data=e),Wi.history.push(t))},reset(t){Wi.view=t,Wi.history=[t]},replace(t){Wi.history.length>1&&(Wi.history[Wi.history.length-1]=t,Wi.view=t)},goBack(){if(Wi.history.length>1){Wi.history.pop();const[t]=Wi.history.slice(-1);Wi.view=t}},setData(t){Wi.data=t}},$a={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 $a.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return $a.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if($a.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!$a.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem($a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem($a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem($a.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem($a.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=Fae.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},d5e=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Oa=xd({enabled:d5e,userSessionId:"",events:[],connectedWalletId:void 0}),h5e={state:Oa,subscribe(t){return Ip(Oa.events,()=>t(f5e(Oa.events[Oa.events.length-1])))},initialize(){Oa.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Oa.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Oa.connectedWalletId=t},click(t){if(Oa.enabled){const e={type:"CLICK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},track(t){if(Oa.enabled){const e={type:"TRACK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},view(t){if(Oa.enabled){const e={type:"VIEW",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}}},Vc=xd({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Oc={state:Vc,subscribe(t){return Ip(Vc,()=>t(Vc))},setChains(t){Vc.chains=t},setWalletConnectUri(t){Vc.walletConnectUri=t},setIsCustomDesktop(t){Vc.isCustomDesktop=t},setIsCustomMobile(t){Vc.isCustomMobile=t},setIsDataLoaded(t){Vc.isDataLoaded=t},setIsUiLoaded(t){Vc.isUiLoaded=t},setIsAuth(t){Vc.isAuth=t}},pE=xd({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}),Ry={state:pE,subscribe(t){return Ip(pE,()=>t(pE))},setConfig(t){var e,r;h5e.initialize(),Oc.setChains(t.chains),Oc.setIsAuth(!!t.enableAuthMode),Oc.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),Oc.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),$a.setModalVersionInStorage(),Object.assign(pE,t)}};var p5e=Object.defineProperty,CW=Object.getOwnPropertySymbols,g5e=Object.prototype.hasOwnProperty,y5e=Object.prototype.propertyIsEnumerable,NW=(t,e,r)=>e in t?p5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m5e=(t,e)=>{for(var r in e||(e={}))g5e.call(e,r)&&NW(t,r,e[r]);if(CW)for(var r of CW(e))y5e.call(e,r)&&NW(t,r,e[r]);return t};const X4="https://explorer-api.walletconnect.com",Z4="wcm",e5="js-2.6.2";async function gE(t,e){const r=m5e({sdkType:Z4,sdkVersion:e5},e),n=new URL(t,X4);return n.searchParams.append("projectId",Ry.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Jd={async getDesktopListings(t){return gE("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return gE("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return gE("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return gE("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${X4}/w3m/v1/getWalletImage/${t}?projectId=${Ry.state.projectId}&sdkType=${Z4}&sdkVersion=${e5}`},getAssetImageUrl(t){return`${X4}/w3m/v1/getAssetImage/${t}?projectId=${Ry.state.projectId}&sdkType=${Z4}&sdkVersion=${e5}`}};var v5e=Object.defineProperty,DW=Object.getOwnPropertySymbols,b5e=Object.prototype.hasOwnProperty,w5e=Object.prototype.propertyIsEnumerable,$W=(t,e,r)=>e in t?v5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_5e=(t,e)=>{for(var r in e||(e={}))b5e.call(e,r)&&$W(t,r,e[r]);if(DW)for(var r of DW(e))w5e.call(e,r)&&$W(t,r,e[r]);return t};const MW=$a.isMobile(),Gc=xd({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),iWe={state:Gc,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Ry.state;if(t==="NONE"||e==="ALL"&&!t)return Gc.recomendedWallets;if($a.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await Jd.getAllListings(r),i=Object.values(n);i.sort((a,o)=>{const s=t.indexOf(a.id),c=t.indexOf(o.id);return s-c}),Gc.recomendedWallets=i}else{const{chains:r,isAuth:n}=Oc.state,i=r==null?void 0:r.join(","),a=$a.isArray(e),o={page:1,sdks:n?"auth_v1":void 0,entries:$a.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:s}=MW?await Jd.getMobileListings(o):await Jd.getDesktopListings(o);Gc.recomendedWallets=Object.values(s)}return Gc.recomendedWallets},async getWallets(t){const e=_5e({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=Ry.state,{recomendedWallets:i}=Gc;if(n==="ALL")return Gc.wallets;i.length?e.excludedIds=i.map(d=>d.id).join(","):$a.isArray(r)&&(e.excludedIds=r.join(",")),$a.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Oc.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:o}=t,{listings:s,total:c}=MW?await Jd.getMobileListings(e):await Jd.getDesktopListings(e),u=Object.values(s),f=o?"search":"wallets";return Gc[f]={listings:[...Gc[f].listings,...u],total:c,page:a??1},{listings:u,total:c}},getWalletImageUrl(t){return Jd.getWalletImageUrl(t)},getAssetImageUrl(t){return Jd.getAssetImageUrl(t)},resetSearch(){Gc.search={listings:[],total:0,page:1}}},g0=xd({open:!1}),dN={state:g0,subscribe(t){return Ip(g0,()=>t(g0))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Oc.state;if($a.removeWalletConnectDeepLink(),Oc.setWalletConnectUri(t==null?void 0:t.uri),Oc.setChains(t==null?void 0:t.chains),Fae.reset("ConnectWallet"),r&&n)g0.open=!0,e();else{const i=setInterval(()=>{const a=Oc.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),g0.open=!0,e())},200)}})},close(){g0.open=!1}};var E5e=Object.defineProperty,kW=Object.getOwnPropertySymbols,x5e=Object.prototype.hasOwnProperty,A5e=Object.prototype.propertyIsEnumerable,LW=(t,e,r)=>e in t?E5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S5e=(t,e)=>{for(var r in e||(e={}))x5e.call(e,r)&&LW(t,r,e[r]);if(kW)for(var r of kW(e))A5e.call(e,r)&&LW(t,r,e[r]);return t};function O5e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const xv=xd({themeMode:O5e()?"dark":"light"}),UW={state:xv,subscribe(t){return Ip(xv,()=>t(xv))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(xv.themeMode=e),r&&(xv.themeVariables=S5e({},r))}},Xd=xd({open:!1,message:"",variant:"success"}),aWe={state:Xd,subscribe(t){return Ip(Xd,()=>t(Xd))},openToast(t,e){Xd.open=!0,Xd.message=t,Xd.variant=e},closeToast(){Xd.open=!1}};let I5e=class{constructor(e){this.openModal=dN.open,this.closeModal=dN.close,this.subscribeModal=dN.subscribe,this.setTheme=UW.setThemeConfig,UW.setThemeConfig(e),Ry.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Ty(()=>import("./index-5d5f068e.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Oc.setIsUiLoaded(!0)}}};const P5e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:I5e},Symbol.toStringTag,{value:"Module"})),T5e=uo(P5e);var vk={},tO={},kr={},jae={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,c){var u=s>>>16&65535,f=s&65535,d=c>>>16&65535,g=c&65535;return f*g+(u*g+f*d<<16>>>0)|0}t.mul=Math.imul||e;function r(s,c){return s+c|0}t.add=r;function n(s,c){return s-c|0}t.sub=n;function i(s,c){return s<<c|s>>>32-c}t.rotl=i;function a(s,c){return s<<32-c|s>>>c}t.rotr=a;function o(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(s){return t.isInteger(s)&&s>=-t.MAX_SAFE_INTEGER&&s<=t.MAX_SAFE_INTEGER}})(jae);Object.defineProperty(kr,"__esModule",{value:!0});var qae=jae;function R5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}kr.readInt16BE=R5e;function C5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}kr.readUint16BE=C5e;function N5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}kr.readInt16LE=N5e;function D5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}kr.readUint16LE=D5e;function Hae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}kr.writeUint16BE=Hae;kr.writeInt16BE=Hae;function zae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}kr.writeUint16LE=zae;kr.writeInt16LE=zae;function t5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}kr.readInt32BE=t5;function r5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}kr.readUint32BE=r5;function n5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}kr.readInt32LE=n5;function i5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}kr.readUint32LE=i5;function UA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}kr.writeUint32BE=UA;kr.writeInt32BE=UA;function BA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}kr.writeUint32LE=BA;kr.writeInt32LE=BA;function $5e(t,e){e===void 0&&(e=0);var r=t5(t,e),n=t5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}kr.readInt64BE=$5e;function M5e(t,e){e===void 0&&(e=0);var r=r5(t,e),n=r5(t,e+4);return r*4294967296+n}kr.readUint64BE=M5e;function k5e(t,e){e===void 0&&(e=0);var r=n5(t,e),n=n5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}kr.readInt64LE=k5e;function L5e(t,e){e===void 0&&(e=0);var r=i5(t,e),n=i5(t,e+4);return n*4294967296+r}kr.readUint64LE=L5e;function Vae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),UA(t/4294967296>>>0,e,r),UA(t>>>0,e,r+4),e}kr.writeUint64BE=Vae;kr.writeInt64BE=Vae;function Gae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),BA(t>>>0,e,r),BA(t/4294967296>>>0,e,r+4),e}kr.writeUint64LE=Gae;kr.writeInt64LE=Gae;function U5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}kr.readUintBE=U5e;function B5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}kr.readUintLE=B5e;function F5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!qae.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}kr.writeUintBE=F5e;function j5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!qae.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}kr.writeUintLE=j5e;function q5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}kr.readFloat32BE=q5e;function H5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}kr.readFloat32LE=H5e;function z5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}kr.readFloat64BE=z5e;function V5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}kr.readFloat64LE=V5e;function G5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}kr.writeFloat32BE=G5e;function W5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}kr.writeFloat32LE=W5e;function K5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}kr.writeFloat64BE=K5e;function Y5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}kr.writeFloat64LE=Y5e;var is={};Object.defineProperty(is,"__esModule",{value:!0});function Q5e(t){for(var e=0;e<t.length;e++)t[e]=0;return t}is.wipe=Q5e;Object.defineProperty(tO,"__esModule",{value:!0});var Ia=kr,a5=is,J5e=20;function X5e(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,o=1797285236,s=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],d=r[19]<<24|r[18]<<16|r[17]<<8|r[16],g=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],w=r[31]<<24|r[30]<<16|r[29]<<8|r[28],v=e[3]<<24|e[2]<<16|e[1]<<8|e[0],y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],_=e[11]<<24|e[10]<<16|e[9]<<8|e[8],b=e[15]<<24|e[14]<<16|e[13]<<8|e[12],S=n,x=i,O=a,E=o,p=s,I=c,C=u,L=f,q=d,le=g,pe=m,B=w,U=v,K=y,ne=_,F=b,j=0;j<J5e;j+=2)S=S+p|0,U^=S,U=U>>>32-16|U<<16,q=q+U|0,p^=q,p=p>>>32-12|p<<12,x=x+I|0,K^=x,K=K>>>32-16|K<<16,le=le+K|0,I^=le,I=I>>>32-12|I<<12,O=O+C|0,ne^=O,ne=ne>>>32-16|ne<<16,pe=pe+ne|0,C^=pe,C=C>>>32-12|C<<12,E=E+L|0,F^=E,F=F>>>32-16|F<<16,B=B+F|0,L^=B,L=L>>>32-12|L<<12,O=O+C|0,ne^=O,ne=ne>>>32-8|ne<<8,pe=pe+ne|0,C^=pe,C=C>>>32-7|C<<7,E=E+L|0,F^=E,F=F>>>32-8|F<<8,B=B+F|0,L^=B,L=L>>>32-7|L<<7,x=x+I|0,K^=x,K=K>>>32-8|K<<8,le=le+K|0,I^=le,I=I>>>32-7|I<<7,S=S+p|0,U^=S,U=U>>>32-8|U<<8,q=q+U|0,p^=q,p=p>>>32-7|p<<7,S=S+I|0,F^=S,F=F>>>32-16|F<<16,pe=pe+F|0,I^=pe,I=I>>>32-12|I<<12,x=x+C|0,U^=x,U=U>>>32-16|U<<16,B=B+U|0,C^=B,C=C>>>32-12|C<<12,O=O+L|0,K^=O,K=K>>>32-16|K<<16,q=q+K|0,L^=q,L=L>>>32-12|L<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,le=le+ne|0,p^=le,p=p>>>32-12|p<<12,O=O+L|0,K^=O,K=K>>>32-8|K<<8,q=q+K|0,L^=q,L=L>>>32-7|L<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,le=le+ne|0,p^=le,p=p>>>32-7|p<<7,x=x+C|0,U^=x,U=U>>>32-8|U<<8,B=B+U|0,C^=B,C=C>>>32-7|C<<7,S=S+I|0,F^=S,F=F>>>32-8|F<<8,pe=pe+F|0,I^=pe,I=I>>>32-7|I<<7;Ia.writeUint32LE(S+n|0,t,0),Ia.writeUint32LE(x+i|0,t,4),Ia.writeUint32LE(O+a|0,t,8),Ia.writeUint32LE(E+o|0,t,12),Ia.writeUint32LE(p+s|0,t,16),Ia.writeUint32LE(I+c|0,t,20),Ia.writeUint32LE(C+u|0,t,24),Ia.writeUint32LE(L+f|0,t,28),Ia.writeUint32LE(q+d|0,t,32),Ia.writeUint32LE(le+g|0,t,36),Ia.writeUint32LE(pe+m|0,t,40),Ia.writeUint32LE(B+w|0,t,44),Ia.writeUint32LE(U+v|0,t,48),Ia.writeUint32LE(K+y|0,t,52),Ia.writeUint32LE(ne+_|0,t,56),Ia.writeUint32LE(F+b|0,t,60)}function Wae(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,o;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),o=a.length-e.length,a.set(e,o)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,o=i}for(var s=new Uint8Array(64),c=0;c<r.length;c+=64){X5e(s,a,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^s[u-c];eDe(a,0,o)}return a5.wipe(s),i===0&&a5.wipe(a),n}tO.streamXOR=Wae;function Z5e(t,e,r,n){return n===void 0&&(n=0),a5.wipe(r),Wae(t,e,r,r,n)}tO.stream=Z5e;function eDe(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Kae={},Ad={};Object.defineProperty(Ad,"__esModule",{value:!0});function tDe(t,e,r){return~(t-1)&e|t-1&r}Ad.select=tDe;function rDe(t,e){return(t|0)-(e|0)-1>>>31&1}Ad.lessOrEqual=rDe;function Yae(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}Ad.compare=Yae;function nDe(t,e){return t.length===0||e.length===0?!1:Yae(t,e)!==0}Ad.equal=nDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ad,r=is;t.DIGEST_LENGTH=16;var n=function(){function o(s){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=s[0]|s[1]<<8;this._r[0]=c&8191;var u=s[2]|s[3]<<8;this._r[1]=(c>>>13|u<<3)&8191;var f=s[4]|s[5]<<8;this._r[2]=(u>>>10|f<<6)&7939;var d=s[6]|s[7]<<8;this._r[3]=(f>>>7|d<<9)&8191;var g=s[8]|s[9]<<8;this._r[4]=(d>>>4|g<<12)&255,this._r[5]=g>>>1&8190;var m=s[10]|s[11]<<8;this._r[6]=(g>>>14|m<<2)&8191;var w=s[12]|s[13]<<8;this._r[7]=(m>>>11|w<<5)&8065;var v=s[14]|s[15]<<8;this._r[8]=(w>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=s[16]|s[17]<<8,this._pad[1]=s[18]|s[19]<<8,this._pad[2]=s[20]|s[21]<<8,this._pad[3]=s[22]|s[23]<<8,this._pad[4]=s[24]|s[25]<<8,this._pad[5]=s[26]|s[27]<<8,this._pad[6]=s[28]|s[29]<<8,this._pad[7]=s[30]|s[31]<<8}return o.prototype._blocks=function(s,c,u){for(var f=this._fin?0:2048,d=this._h[0],g=this._h[1],m=this._h[2],w=this._h[3],v=this._h[4],y=this._h[5],_=this._h[6],b=this._h[7],S=this._h[8],x=this._h[9],O=this._r[0],E=this._r[1],p=this._r[2],I=this._r[3],C=this._r[4],L=this._r[5],q=this._r[6],le=this._r[7],pe=this._r[8],B=this._r[9];u>=16;){var U=s[c+0]|s[c+1]<<8;d+=U&8191;var K=s[c+2]|s[c+3]<<8;g+=(U>>>13|K<<3)&8191;var ne=s[c+4]|s[c+5]<<8;m+=(K>>>10|ne<<6)&8191;var F=s[c+6]|s[c+7]<<8;w+=(ne>>>7|F<<9)&8191;var j=s[c+8]|s[c+9]<<8;v+=(F>>>4|j<<12)&8191,y+=j>>>1&8191;var z=s[c+10]|s[c+11]<<8;_+=(j>>>14|z<<2)&8191;var $=s[c+12]|s[c+13]<<8;b+=(z>>>11|$<<5)&8191;var H=s[c+14]|s[c+15]<<8;S+=($>>>8|H<<8)&8191,x+=H>>>5|f;var k=0,M=k;M+=d*O,M+=g*(5*B),M+=m*(5*pe),M+=w*(5*le),M+=v*(5*q),k=M>>>13,M&=8191,M+=y*(5*L),M+=_*(5*C),M+=b*(5*I),M+=S*(5*p),M+=x*(5*E),k+=M>>>13,M&=8191;var G=k;G+=d*E,G+=g*O,G+=m*(5*B),G+=w*(5*pe),G+=v*(5*le),k=G>>>13,G&=8191,G+=y*(5*q),G+=_*(5*L),G+=b*(5*C),G+=S*(5*I),G+=x*(5*p),k+=G>>>13,G&=8191;var ge=k;ge+=d*p,ge+=g*E,ge+=m*O,ge+=w*(5*B),ge+=v*(5*pe),k=ge>>>13,ge&=8191,ge+=y*(5*le),ge+=_*(5*q),ge+=b*(5*L),ge+=S*(5*C),ge+=x*(5*I),k+=ge>>>13,ge&=8191;var Q=k;Q+=d*I,Q+=g*p,Q+=m*E,Q+=w*O,Q+=v*(5*B),k=Q>>>13,Q&=8191,Q+=y*(5*pe),Q+=_*(5*le),Q+=b*(5*q),Q+=S*(5*L),Q+=x*(5*C),k+=Q>>>13,Q&=8191;var te=k;te+=d*C,te+=g*I,te+=m*p,te+=w*E,te+=v*O,k=te>>>13,te&=8191,te+=y*(5*B),te+=_*(5*pe),te+=b*(5*le),te+=S*(5*q),te+=x*(5*L),k+=te>>>13,te&=8191;var ce=k;ce+=d*L,ce+=g*C,ce+=m*I,ce+=w*p,ce+=v*E,k=ce>>>13,ce&=8191,ce+=y*O,ce+=_*(5*B),ce+=b*(5*pe),ce+=S*(5*le),ce+=x*(5*q),k+=ce>>>13,ce&=8191;var T=k;T+=d*q,T+=g*L,T+=m*C,T+=w*I,T+=v*p,k=T>>>13,T&=8191,T+=y*E,T+=_*O,T+=b*(5*B),T+=S*(5*pe),T+=x*(5*le),k+=T>>>13,T&=8191;var fe=k;fe+=d*le,fe+=g*q,fe+=m*L,fe+=w*C,fe+=v*I,k=fe>>>13,fe&=8191,fe+=y*p,fe+=_*E,fe+=b*O,fe+=S*(5*B),fe+=x*(5*pe),k+=fe>>>13,fe&=8191;var ze=k;ze+=d*pe,ze+=g*le,ze+=m*q,ze+=w*L,ze+=v*C,k=ze>>>13,ze&=8191,ze+=y*I,ze+=_*p,ze+=b*E,ze+=S*O,ze+=x*(5*B),k+=ze>>>13,ze&=8191;var tt=k;tt+=d*B,tt+=g*pe,tt+=m*le,tt+=w*q,tt+=v*L,k=tt>>>13,tt&=8191,tt+=y*C,tt+=_*I,tt+=b*p,tt+=S*E,tt+=x*O,k+=tt>>>13,tt&=8191,k=(k<<2)+k|0,k=k+M|0,M=k&8191,k=k>>>13,G+=k,d=M,g=G,m=ge,w=Q,v=te,y=ce,_=T,b=fe,S=ze,x=tt,c+=16,u-=16}this._h[0]=d,this._h[1]=g,this._h[2]=m,this._h[3]=w,this._h[4]=v,this._h[5]=y,this._h[6]=_,this._h[7]=b,this._h[8]=S,this._h[9]=x},o.prototype.finish=function(s,c){c===void 0&&(c=0);var u=new Uint16Array(10),f,d,g,m;if(this._leftover){for(m=this._leftover,this._buffer[m++]=1;m<16;m++)this._buffer[m]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,m=2;m<10;m++)this._h[m]+=f,f=this._h[m]>>>13,this._h[m]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,u[0]=this._h[0]+5,f=u[0]>>>13,u[0]&=8191,m=1;m<10;m++)u[m]=this._h[m]+f,f=u[m]>>>13,u[m]&=8191;for(u[9]-=8192,d=(f^1)-1,m=0;m<10;m++)u[m]&=d;for(d=~d,m=0;m<10;m++)this._h[m]=this._h[m]&d|u[m];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,g=this._h[0]+this._pad[0],this._h[0]=g&65535,m=1;m<8;m++)g=(this._h[m]+this._pad[m]|0)+(g>>>16)|0,this._h[m]=g&65535;return s[c+0]=this._h[0]>>>0,s[c+1]=this._h[0]>>>8,s[c+2]=this._h[1]>>>0,s[c+3]=this._h[1]>>>8,s[c+4]=this._h[2]>>>0,s[c+5]=this._h[2]>>>8,s[c+6]=this._h[3]>>>0,s[c+7]=this._h[3]>>>8,s[c+8]=this._h[4]>>>0,s[c+9]=this._h[4]>>>8,s[c+10]=this._h[5]>>>0,s[c+11]=this._h[5]>>>8,s[c+12]=this._h[6]>>>0,s[c+13]=this._h[6]>>>8,s[c+14]=this._h[7]>>>0,s[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(s){var c=0,u=s.length,f;if(this._leftover){f=16-this._leftover,f>u&&(f=u);for(var d=0;d<f;d++)this._buffer[this._leftover+d]=s[c+d];if(u-=f,c+=f,this._leftover+=f,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(f=u-u%16,this._blocks(s,c,f),c+=f,u-=f),u){for(var d=0;d<u;d++)this._buffer[this._leftover+d]=s[c+d];this._leftover+=u}return this},o.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var s=new Uint8Array(16);return this.finish(s),s},o.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},o}();t.Poly1305=n;function i(o,s){var c=new n(o);c.update(s);var u=c.digest();return c.clean(),u}t.oneTimeAuth=i;function a(o,s){return o.length!==t.DIGEST_LENGTH||s.length!==t.DIGEST_LENGTH?!1:e.equal(o,s)}t.equal=a})(Kae);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=tO,r=Kae,n=is,i=kr,a=Ad;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var o=new Uint8Array(16),s=function(){function c(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return c.prototype.seal=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=f.length+this.tagLength,y;if(g){if(g.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");y=g}else y=new Uint8Array(v);return e.streamXOR(this._key,m,f,y,4),this._authenticate(y.subarray(y.length-this.tagLength,y.length),w,y.subarray(0,y.length-this.tagLength),d),n.wipe(m),y},c.prototype.open=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length<this.tagLength)return null;var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=new Uint8Array(this.tagLength);if(this._authenticate(v,w,f.subarray(0,f.length-this.tagLength),d),!a.equal(v,f.subarray(f.length-this.tagLength,f.length)))return null;var y=f.length-this.tagLength,_;if(g){if(g.length!==y)throw new Error("ChaCha20Poly1305: incorrect destination length");_=g}else _=new Uint8Array(y);return e.streamXOR(this._key,m,f.subarray(0,f.length-this.tagLength),_,4),n.wipe(m),_},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(u,f,d,g){var m=new r.Poly1305(f);g&&(m.update(g),g.length%16>0&&m.update(o.subarray(g.length%16))),m.update(d),d.length%16>0&&m.update(o.subarray(d.length%16));var w=new Uint8Array(8);g&&i.writeUint64LE(g.length,w),m.update(w),i.writeUint64LE(d.length,w),m.update(w);for(var v=m.digest(),y=0;y<v.length;y++)u[y]=v[y];m.clean(),n.wipe(v),n.wipe(w)},c}();t.ChaCha20Poly1305=s})(vk);var Qae={},Iw={},bk={};Object.defineProperty(bk,"__esModule",{value:!0});function iDe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}bk.isSerializableHash=iDe;Object.defineProperty(Iw,"__esModule",{value:!0});var Wc=bk,aDe=Ad,oDe=is,Jae=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Wc.isSerializableHash(this._inner)&&Wc.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),oDe.wipe(n)}return t.prototype.reset=function(){if(!Wc.isSerializableHash(this._inner)||!Wc.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Wc.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Wc.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Wc.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Wc.isSerializableHash(this._inner)||!Wc.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Wc.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Iw.HMAC=Jae;function sDe(t,e,r){var n=new Jae(t,e);n.update(r);var i=n.digest();return n.clean(),i}Iw.hmac=sDe;Iw.equal=aDe.equal;Object.defineProperty(Qae,"__esModule",{value:!0});var BW=Iw,FW=is,cDe=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=BW.hmac(this._hash,n,r);this._hmac=new BW.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),FW.wipe(this._buffer),FW.wipe(this._counter),this._bufpos=0},t}(),uDe=Qae.HKDF=cDe,im={},rO={},nO={};Object.defineProperty(nO,"__esModule",{value:!0});nO.BrowserRandomSource=void 0;const jW=65536;class lDe{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=jW)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,jW)));return r}}nO.BrowserRandomSource=lDe;function o5(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iO={};Object.defineProperty(iO,"__esModule",{value:!0});iO.NodeRandomSource=void 0;const fDe=is;class dDe{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof o5<"u"){const e=X$;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,fDe.wipe)(r),n}}iO.NodeRandomSource=dDe;Object.defineProperty(rO,"__esModule",{value:!0});rO.SystemRandomSource=void 0;const hDe=nO,pDe=iO;class gDe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new hDe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new pDe.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}rO.SystemRandomSource=gDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=rO,r=kr,n=is;t.defaultRandomSource=new e.SystemRandomSource;function i(u,f=t.defaultRandomSource){return f.randomBytes(u)}t.randomBytes=i;function a(u=t.defaultRandomSource){const f=i(4,u),d=(0,r.readUint32LE)(f);return(0,n.wipe)(f),d}t.randomUint32=a;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function s(u,f=o,d=t.defaultRandomSource){if(f.length<2)throw new Error("randomString charset is too short");if(f.length>256)throw new Error("randomString charset is too long");let g="";const m=f.length,w=256-256%m;for(;u>0;){const v=i(Math.ceil(u*256/w),d);for(let y=0;y<v.length&&u>0;y++){const _=v[y];_<w&&(g+=f.charAt(_%m),u--)}(0,n.wipe)(v)}return g}t.randomString=s;function c(u,f=o,d=t.defaultRandomSource){const g=Math.ceil(u/(Math.log(f.length)/Math.LN2));return s(g,f,d)}t.randomStringForEntropy=c})(im);var aO={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=kr,r=is;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function s(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return s.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},s.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},s.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},s.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=a(this._temp,this._state,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},s.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,d=u/536870912|0,g=u<<3,m=u%64<56?64:128;this._buffer[f]=128;for(var w=f+1;w<m-8;w++)this._buffer[w]=0;e.writeUint32BE(d,this._buffer,m-8),e.writeUint32BE(g,this._buffer,m-4),a(this._temp,this._state,this._buffer,0,m),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)e.writeUint32BE(this._state[w],c,w*4);return this},s.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},s.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},s.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},s.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},s}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(s,c,u,f,d){for(;d>=64;){for(var g=c[0],m=c[1],w=c[2],v=c[3],y=c[4],_=c[5],b=c[6],S=c[7],x=0;x<16;x++){var O=f+x*4;s[x]=e.readUint32BE(u,O)}for(var x=16;x<64;x++){var E=s[x-2],p=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=s[x-15];var I=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;s[x]=(p+s[x-7]|0)+(I+s[x-16]|0)}for(var x=0;x<64;x++){var p=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&_^~y&b)|0)+(S+(i[x]+s[x]|0)|0)|0,I=((g>>>2|g<<32-2)^(g>>>13|g<<32-13)^(g>>>22|g<<32-22))+(g&m^g&w^m&w)|0;S=b,b=_,_=y,y=v+p|0,v=w,w=m,m=g,g=p+I|0}c[0]+=g,c[1]+=m,c[2]+=w,c[3]+=v,c[4]+=y,c[5]+=_,c[6]+=b,c[7]+=S,f+=64,d-=64}return f}function o(s){var c=new n;c.update(s);var u=c.digest();return c.clean(),u}t.hash=o})(aO);var wk={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=im,r=is;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(x){const O=new Float64Array(16);if(x)for(let E=0;E<x.length;E++)O[E]=x[E];return O}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function o(x){let O=1;for(let E=0;E<16;E++){let p=x[E]+O+65535;O=Math.floor(p/65536),x[E]=p-O*65536}x[0]+=O-1+37*(O-1)}function s(x,O,E){const p=~(E-1);for(let I=0;I<16;I++){const C=p&(x[I]^O[I]);x[I]^=C,O[I]^=C}}function c(x,O){const E=n(),p=n();for(let I=0;I<16;I++)p[I]=O[I];o(p),o(p),o(p);for(let I=0;I<2;I++){E[0]=p[0]-65517;for(let L=1;L<15;L++)E[L]=p[L]-65535-(E[L-1]>>16&1),E[L-1]&=65535;E[15]=p[15]-32767-(E[14]>>16&1);const C=E[15]>>16&1;E[14]&=65535,s(p,E,1-C)}for(let I=0;I<16;I++)x[2*I]=p[I]&255,x[2*I+1]=p[I]>>8}function u(x,O){for(let E=0;E<16;E++)x[E]=O[2*E]+(O[2*E+1]<<8);x[15]&=32767}function f(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]+E[p]}function d(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]-E[p]}function g(x,O,E){let p,I,C=0,L=0,q=0,le=0,pe=0,B=0,U=0,K=0,ne=0,F=0,j=0,z=0,$=0,H=0,k=0,M=0,G=0,ge=0,Q=0,te=0,ce=0,T=0,fe=0,ze=0,tt=0,mt=0,vt=0,gt=0,Lt=0,Yt=0,wr=0,Rt=E[0],Pt=E[1],kt=E[2],Nt=E[3],Kt=E[4],Ut=E[5],zt=E[6],$t=E[7],Dt=E[8],qt=E[9],Mt=E[10],cr=E[11],tr=E[12],ir=E[13],nr=E[14],mr=E[15];p=O[0],C+=p*Rt,L+=p*Pt,q+=p*kt,le+=p*Nt,pe+=p*Kt,B+=p*Ut,U+=p*zt,K+=p*$t,ne+=p*Dt,F+=p*qt,j+=p*Mt,z+=p*cr,$+=p*tr,H+=p*ir,k+=p*nr,M+=p*mr,p=O[1],L+=p*Rt,q+=p*Pt,le+=p*kt,pe+=p*Nt,B+=p*Kt,U+=p*Ut,K+=p*zt,ne+=p*$t,F+=p*Dt,j+=p*qt,z+=p*Mt,$+=p*cr,H+=p*tr,k+=p*ir,M+=p*nr,G+=p*mr,p=O[2],q+=p*Rt,le+=p*Pt,pe+=p*kt,B+=p*Nt,U+=p*Kt,K+=p*Ut,ne+=p*zt,F+=p*$t,j+=p*Dt,z+=p*qt,$+=p*Mt,H+=p*cr,k+=p*tr,M+=p*ir,G+=p*nr,ge+=p*mr,p=O[3],le+=p*Rt,pe+=p*Pt,B+=p*kt,U+=p*Nt,K+=p*Kt,ne+=p*Ut,F+=p*zt,j+=p*$t,z+=p*Dt,$+=p*qt,H+=p*Mt,k+=p*cr,M+=p*tr,G+=p*ir,ge+=p*nr,Q+=p*mr,p=O[4],pe+=p*Rt,B+=p*Pt,U+=p*kt,K+=p*Nt,ne+=p*Kt,F+=p*Ut,j+=p*zt,z+=p*$t,$+=p*Dt,H+=p*qt,k+=p*Mt,M+=p*cr,G+=p*tr,ge+=p*ir,Q+=p*nr,te+=p*mr,p=O[5],B+=p*Rt,U+=p*Pt,K+=p*kt,ne+=p*Nt,F+=p*Kt,j+=p*Ut,z+=p*zt,$+=p*$t,H+=p*Dt,k+=p*qt,M+=p*Mt,G+=p*cr,ge+=p*tr,Q+=p*ir,te+=p*nr,ce+=p*mr,p=O[6],U+=p*Rt,K+=p*Pt,ne+=p*kt,F+=p*Nt,j+=p*Kt,z+=p*Ut,$+=p*zt,H+=p*$t,k+=p*Dt,M+=p*qt,G+=p*Mt,ge+=p*cr,Q+=p*tr,te+=p*ir,ce+=p*nr,T+=p*mr,p=O[7],K+=p*Rt,ne+=p*Pt,F+=p*kt,j+=p*Nt,z+=p*Kt,$+=p*Ut,H+=p*zt,k+=p*$t,M+=p*Dt,G+=p*qt,ge+=p*Mt,Q+=p*cr,te+=p*tr,ce+=p*ir,T+=p*nr,fe+=p*mr,p=O[8],ne+=p*Rt,F+=p*Pt,j+=p*kt,z+=p*Nt,$+=p*Kt,H+=p*Ut,k+=p*zt,M+=p*$t,G+=p*Dt,ge+=p*qt,Q+=p*Mt,te+=p*cr,ce+=p*tr,T+=p*ir,fe+=p*nr,ze+=p*mr,p=O[9],F+=p*Rt,j+=p*Pt,z+=p*kt,$+=p*Nt,H+=p*Kt,k+=p*Ut,M+=p*zt,G+=p*$t,ge+=p*Dt,Q+=p*qt,te+=p*Mt,ce+=p*cr,T+=p*tr,fe+=p*ir,ze+=p*nr,tt+=p*mr,p=O[10],j+=p*Rt,z+=p*Pt,$+=p*kt,H+=p*Nt,k+=p*Kt,M+=p*Ut,G+=p*zt,ge+=p*$t,Q+=p*Dt,te+=p*qt,ce+=p*Mt,T+=p*cr,fe+=p*tr,ze+=p*ir,tt+=p*nr,mt+=p*mr,p=O[11],z+=p*Rt,$+=p*Pt,H+=p*kt,k+=p*Nt,M+=p*Kt,G+=p*Ut,ge+=p*zt,Q+=p*$t,te+=p*Dt,ce+=p*qt,T+=p*Mt,fe+=p*cr,ze+=p*tr,tt+=p*ir,mt+=p*nr,vt+=p*mr,p=O[12],$+=p*Rt,H+=p*Pt,k+=p*kt,M+=p*Nt,G+=p*Kt,ge+=p*Ut,Q+=p*zt,te+=p*$t,ce+=p*Dt,T+=p*qt,fe+=p*Mt,ze+=p*cr,tt+=p*tr,mt+=p*ir,vt+=p*nr,gt+=p*mr,p=O[13],H+=p*Rt,k+=p*Pt,M+=p*kt,G+=p*Nt,ge+=p*Kt,Q+=p*Ut,te+=p*zt,ce+=p*$t,T+=p*Dt,fe+=p*qt,ze+=p*Mt,tt+=p*cr,mt+=p*tr,vt+=p*ir,gt+=p*nr,Lt+=p*mr,p=O[14],k+=p*Rt,M+=p*Pt,G+=p*kt,ge+=p*Nt,Q+=p*Kt,te+=p*Ut,ce+=p*zt,T+=p*$t,fe+=p*Dt,ze+=p*qt,tt+=p*Mt,mt+=p*cr,vt+=p*tr,gt+=p*ir,Lt+=p*nr,Yt+=p*mr,p=O[15],M+=p*Rt,G+=p*Pt,ge+=p*kt,Q+=p*Nt,te+=p*Kt,ce+=p*Ut,T+=p*zt,fe+=p*$t,ze+=p*Dt,tt+=p*qt,mt+=p*Mt,vt+=p*cr,gt+=p*tr,Lt+=p*ir,Yt+=p*nr,wr+=p*mr,C+=38*G,L+=38*ge,q+=38*Q,le+=38*te,pe+=38*ce,B+=38*T,U+=38*fe,K+=38*ze,ne+=38*tt,F+=38*mt,j+=38*vt,z+=38*gt,$+=38*Lt,H+=38*Yt,k+=38*wr,I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),x[0]=C,x[1]=L,x[2]=q,x[3]=le,x[4]=pe,x[5]=B,x[6]=U,x[7]=K,x[8]=ne,x[9]=F,x[10]=j,x[11]=z,x[12]=$,x[13]=H,x[14]=k,x[15]=M}function m(x,O){g(x,O,O)}function w(x,O){const E=n();for(let p=0;p<16;p++)E[p]=O[p];for(let p=253;p>=0;p--)m(E,E),p!==2&&p!==4&&g(E,E,O);for(let p=0;p<16;p++)x[p]=E[p]}function v(x,O){const E=new Uint8Array(32),p=new Float64Array(80),I=n(),C=n(),L=n(),q=n(),le=n(),pe=n();for(let ne=0;ne<31;ne++)E[ne]=x[ne];E[31]=x[31]&127|64,E[0]&=248,u(p,O);for(let ne=0;ne<16;ne++)C[ne]=p[ne];I[0]=q[0]=1;for(let ne=254;ne>=0;--ne){const F=E[ne>>>3]>>>(ne&7)&1;s(I,C,F),s(L,q,F),f(le,I,L),d(I,I,L),f(L,C,q),d(C,C,q),m(q,le),m(pe,I),g(I,L,I),g(L,C,le),f(le,I,L),d(I,I,L),m(C,I),d(L,q,pe),g(I,L,a),f(I,I,q),g(L,L,I),g(I,q,pe),g(q,C,p),m(C,le),s(I,C,F),s(L,q,F)}for(let ne=0;ne<16;ne++)p[ne+16]=I[ne],p[ne+32]=L[ne],p[ne+48]=C[ne],p[ne+64]=q[ne];const B=p.subarray(32),U=p.subarray(16);w(B,B),g(U,U,B);const K=new Uint8Array(32);return c(K,U),K}t.scalarMult=v;function y(x){return v(x,i)}t.scalarMultBase=y;function _(x){if(x.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const O=new Uint8Array(x);return{publicKey:y(O),secretKey:O}}t.generateKeyPairFromSeed=_;function b(x){const O=(0,e.randomBytes)(32,x),E=_(O);return(0,r.wipe)(O),E}t.generateKeyPair=b;function S(x,O,E=!1){if(x.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(O.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(x,O);if(E){let I=0;for(let C=0;C<p.length;C++)I|=p[C];if(I===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=S})(wk);function _k(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Xae(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?_k(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function s5(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=Xae(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return _k(r)}function yDe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=t.length,c=t.charAt(0),u=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function d(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,y=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var S=(b-_)*f+1>>>0,x=new Uint8Array(S);_!==b;){for(var O=w[_],E=0,p=S-1;(O!==0||E<y)&&p!==-1;p--,E++)O+=256*x[p]>>>0,x[p]=O%s>>>0,O=O/s>>>0;if(O!==0)throw new Error("Non-zero carry");y=E,_++}for(var I=S-y;I!==S&&x[I]===0;)I++;for(var C=c.repeat(v);I<S;++I)C+=t.charAt(x[I]);return C}function g(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var y=0,_=0;w[v]===c;)y++,v++;for(var b=(w.length-v)*u+1>>>0,S=new Uint8Array(b);w[v];){var x=r[w.charCodeAt(v)];if(x===255)return;for(var O=0,E=b-1;(x!==0||O<_)&&E!==-1;E--,O++)x+=s*S[E]>>>0,S[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");_=O,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var I=new Uint8Array(y+(b-p)),C=y;p!==b;)I[C++]=S[p++];return I}}}function m(w){var v=g(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:g,decode:m}}var mDe=yDe,vDe=mDe;const bDe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},wDe=t=>new TextEncoder().encode(t),_De=t=>new TextDecoder().decode(t);class EDe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xDe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zae(this,e)}}class ADe{constructor(e){this.decoders=e}or(e){return Zae(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Zae=(t,e)=>new ADe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class SDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new EDe(e,r,n),this.decoder=new xDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const oO=({name:t,prefix:e,encode:r,decode:n})=>new SDe(t,e,r,n),Pw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=vDe(r,e);return oO({prefix:t,name:e,encode:n,decode:a=>bDe(i(a))})},ODe=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let a=t.length;for(;t[a-1]==="=";)--a;const o=new Uint8Array(a*r/8|0);let s=0,c=0,u=0;for(let f=0;f<a;++f){const d=i[t[f]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,s+=r,s>=8&&(s-=8,o[u++]=255&c>>s)}if(s>=r||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o},IDe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let a="",o=0,s=0;for(let c=0;c<t.length;++c)for(s=s<<8|t[c],o+=8;o>r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},ba=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>oO({prefix:e,name:t,encode(i){return IDe(i,n,r)},decode(i){return ODe(i,n,r,t)}}),PDe=oO({prefix:"\0",name:"identity",encode:t=>_De(t),decode:t=>wDe(t)}),TDe=Object.freeze(Object.defineProperty({__proto__:null,identity:PDe},Symbol.toStringTag,{value:"Module"})),RDe=ba({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),CDe=Object.freeze(Object.defineProperty({__proto__:null,base2:RDe},Symbol.toStringTag,{value:"Module"})),NDe=ba({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),DDe=Object.freeze(Object.defineProperty({__proto__:null,base8:NDe},Symbol.toStringTag,{value:"Module"})),$De=Pw({prefix:"9",name:"base10",alphabet:"0123456789"}),MDe=Object.freeze(Object.defineProperty({__proto__:null,base10:$De},Symbol.toStringTag,{value:"Module"})),kDe=ba({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),LDe=ba({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),UDe=Object.freeze(Object.defineProperty({__proto__:null,base16:kDe,base16upper:LDe},Symbol.toStringTag,{value:"Module"})),BDe=ba({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),FDe=ba({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),jDe=ba({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qDe=ba({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),HDe=ba({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zDe=ba({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),VDe=ba({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),GDe=ba({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),WDe=ba({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),KDe=Object.freeze(Object.defineProperty({__proto__:null,base32:BDe,base32hex:HDe,base32hexpad:VDe,base32hexpadupper:GDe,base32hexupper:zDe,base32pad:jDe,base32padupper:qDe,base32upper:FDe,base32z:WDe},Symbol.toStringTag,{value:"Module"})),YDe=Pw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QDe=Pw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),JDe=Object.freeze(Object.defineProperty({__proto__:null,base36:YDe,base36upper:QDe},Symbol.toStringTag,{value:"Module"})),XDe=Pw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ZDe=Pw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),e$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:XDe,base58flickr:ZDe},Symbol.toStringTag,{value:"Module"})),t$e=ba({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),r$e=ba({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),n$e=ba({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),i$e=ba({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),a$e=Object.freeze(Object.defineProperty({__proto__:null,base64:t$e,base64pad:r$e,base64url:n$e,base64urlpad:i$e},Symbol.toStringTag,{value:"Module"})),eoe=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),o$e=eoe.reduce((t,e,r)=>(t[r]=e,t),[]),s$e=eoe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function c$e(t){return t.reduce((e,r)=>(e+=o$e[r],e),"")}function u$e(t){const e=[];for(const r of t){const n=s$e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const l$e=oO({prefix:"🚀",name:"base256emoji",encode:c$e,decode:u$e}),f$e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:l$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const qW={...TDe,...CDe,...DDe,...MDe,...UDe,...KDe,...JDe,...e$e,...a$e,...f$e};function toe(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const HW=toe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),hN=toe("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Xae(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),roe={utf8:HW,"utf-8":HW,hex:qW.base16,latin1:hN,ascii:hN,binary:hN,...qW};function Co(t,e="utf8"){const r=roe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?_k(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function co(t,e="utf8"){const r=roe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var zW=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},d$e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),h$e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=Ha.platform}return t}(),p$e=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),g$e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),y$e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),m$e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,v$e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,VW=3,b$e=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",m$e]],GW=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function w$e(t){return t?WW(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new y$e:typeof navigator<"u"?WW(navigator.userAgent):x$e()}function _$e(t){return t!==""&&b$e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function WW(t){var e=_$e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new g$e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<VW&&(i=zW(zW([],i,!0),A$e(VW-i.length),!0)):i=[];var a=i.join("."),o=E$e(t),s=v$e.exec(t);return s&&s[1]?new p$e(r,a,o,s[1]):new d$e(r,a,o)}function E$e(t){for(var e=0,r=GW.length;e<r;e++){var n=GW[e],i=n[0],a=n[1],o=a.exec(t);if(o)return i}return null}function x$e(){var t=typeof Ha<"u"&&Ha.version;return t?new h$e(Ha.version.slice(1)):null}function A$e(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Xt={};/*! *****************************************************************************
|
|
121
|
+
`}])),lN}var A4e=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S4e=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),O4e=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&A4e(e,t,r);return S4e(e,t),e};Object.defineProperty(qS,"__esModule",{value:!0});qS.FortmaticConnector=void 0;const I4e=eae,P4e=Ml,T4e=qs;class R4e extends I4e.AbstractConnector{constructor(e){const r=T4e.getConfiguration()[P4e.ProviderType.FORTMATIC],n=Object.keys(r.apiKeys).map(i=>Number(i));if(!n.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:n}),this.apiKey=r.apiKeys[e],this.chainId=e,this.rpcUrl=r.urls[e]}async activate(){if(!this.fortmatic){const{default:r}=await Promise.resolve().then(()=>O4e(x4e()));this.fortmatic=new r(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(r=>r[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}qS.FortmaticConnector=R4e;var JS={};function V4(){return V4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},V4.apply(this,arguments)}function mk(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function G4(t){return G4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},G4(t)}function kA(t,e){return kA=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},kA(t,e)}function C4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _x(t,e,r){return C4e()?_x=Reflect.construct:_x=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&kA(u,o.prototype),u},_x.apply(null,arguments)}function N4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function LA(t){var e=typeof Map=="function"?new Map:void 0;return LA=function(n){if(n===null||!N4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return _x(n,arguments,G4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),kA(i,n)},LA(t)}function dE(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function p0(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function zc(t){return t.hasOwnProperty("result")?t.result:t}var Ex=function(t){mk(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="No Ethereum provider was found on window.ethereum.",r}return e}(LA(Error)),Uae=function(t){mk(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="The user rejected the request.",r}return e}(LA(Error)),D4e=function(t){mk(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(dE(i)),i.handleChainChanged=i.handleChainChanged.bind(dE(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(dE(i)),i.handleClose=i.handleClose.bind(dE(i)),i}var r=e.prototype;return r.handleChainChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.handleAccountsChanged=function(i){i.length===0?this.emitDeactivate():this.emitUpdate({account:i[0]})},r.handleClose=function(i,a){this.emitDeactivate()},r.handleNetworkChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.activate=function(){try{var i=function(f){if(a)return f;function d(){return V4({provider:window.ethereum},s?{account:s}:{})}var g=function(){if(!s)return Promise.resolve(window.ethereum.enable().then(function(m){return m&&zc(m)[0]})).then(function(m){s=m})}();return g&&g.then?g.then(d):d(g)},a=!1,o=this;if(!window.ethereum)throw new Ex;window.ethereum.on&&(window.ethereum.on("chainChanged",o.handleChainChanged),window.ethereum.on("accountsChanged",o.handleAccountsChanged),window.ethereum.on("close",o.handleClose),window.ethereum.on("networkChanged",o.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var s,c=p0(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return zc(u)[0]})).then(function(u){s=u})},function(u){if(u.code===4001)throw new Uae});return Promise.resolve(c&&c.then?c.then(i):i(c))}catch(u){return Promise.reject(u)}},r.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(i){return Promise.reject(i)}},r.getChainId=function(){try{var i=function(){function c(){if(!a)try{a=zc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=zc(window.ethereum.cachedResults.net_version):a=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.send("net_version").then(zc)).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new Ex;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(zc)).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.getAccount=function(){try{var i=function(){function c(){return a||(a=zc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.enable().then(function(d){return zc(d)[0]})).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new Ex;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(s){return zc(s)[0]})).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},r.isAuthorized=function(){try{return window.ethereum?Promise.resolve(p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return zc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(jS);const $4e=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:D4e,NoEthereumProviderError:Ex,UserRejectedRequestError:Uae},Symbol.toStringTag,{value:"Module"})),M4e=uo($4e);Object.defineProperty(JS,"__esModule",{value:!0});JS.InjectedConnector=void 0;const k4e=M4e;class L4e extends k4e.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}JS.InjectedConnector=L4e;var XS={},U4e="Invariant failed";function OW(t,e){if(!t)throw new Error(U4e)}function Bae(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,x1(t,e)}function W4(t){return W4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},W4(t)}function x1(t,e){return x1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},x1(t,e)}function B4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function xx(t,e,r){return B4e()?xx=Reflect.construct:xx=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&x1(u,o.prototype),u},xx.apply(null,arguments)}function F4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function K4(t){var e=typeof Map=="function"?new Map:void 0;return K4=function(n){if(n===null||!F4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return xx(n,arguments,W4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),x1(i,n)},K4(t)}var Ax=function(t){Bae(e,t);function e(r,n,i){var a;return a=t.call(this)||this,a.code=n,a.data=i,a.name=a.constructor.name,a.message=r,a}return e}(K4(Error)),j4e=function(e,r){var n=this,i=this;this.isMetaMask=!1,this.sendAsync=function(o,s){console.log("sendAsync",o.method,o.params),i.request(o.method,o.params).then(function(c){return s(null,{jsonrpc:"2.0",id:o.id,result:c})}).catch(function(c){return s(c,null)})},this.request=function(o,s){try{return typeof o!="string"&&(s=o.params,o=o.method),Promise.resolve(fetch(n.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:o,params:s}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new Ax(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,d,g;throw new Ax(u==null||(f=u.error)==null?void 0:f.message,u==null||(d=u.error)==null?void 0:d.code,u==null||(g=u.error)==null?void 0:g.data)}else{if("result"in u)return u.result;throw new Ax("Received unexpected JSON-RPC response to "+o+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=e,this.url=r;var a=new URL(r);this.host=a.host,this.path=a.pathname},q4e=function(t){Bae(e,t);function e(n){var i,a=n.urls,o=n.defaultChainId;return o||Object.keys(a).length===1||OW(!1),i=t.call(this,{supportedChainIds:Object.keys(a).map(function(s){return Number(s)})})||this,i.currentChainId=o||Number(Object.keys(a)[0]),i.providers=Object.keys(a).reduce(function(s,c){return s[Number(c)]=new j4e(Number(c),a[Number(c)]),s},{}),i}var r=e.prototype;return r.activate=function(){try{var i=this;return Promise.resolve({provider:i.providers[i.currentChainId],chainId:i.currentChainId,account:null})}catch(a){return Promise.reject(a)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.providers[i.currentChainId])}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.currentChainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){return Promise.resolve(null)},r.deactivate=function(){},r.changeChainId=function(i){Object.keys(this.providers).includes(i.toString())||OW(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(jS);const H4e=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:q4e,RequestError:Ax},Symbol.toStringTag,{value:"Module"})),z4e=uo(H4e);Object.defineProperty(XS,"__esModule",{value:!0});XS.NetworkConnector=void 0;const V4e=Ac,G4e=z4e,W4e=qs;class K4e extends G4e.NetworkConnector{constructor(e){super({urls:W4e.getConfiguration()[V4e.ProviderType.NETWORK].urls,defaultChainId:e})}}XS.NetworkConnector=K4e;var ZS={};const Y4e="modulepreload",Q4e=function(t){return"https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7397576829.commit-ee5588d/"+t},IW={},Ty=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=Q4e(a),a in IW)return;IW[a]=!0;const o=a.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const d=i[f];if(d.href===a&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Y4e,o||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})};function Y4(){return Y4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Y4.apply(this,arguments)}function J4e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Q4(t,e)}function Q4(t,e){return Q4=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Q4(t,e)}function PW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var X4e=1,Z4e=function(t){J4e(e,t);function e(n){var i,a=n.url,o=n.appName,s=n.appLogoUrl,c=n.darkMode,u=n.supportedChainIds;return i=t.call(this,{supportedChainIds:u})||this,i.url=a,i.appName=o,i.appLogoUrl=s,i.darkMode=c||!1,i.handleChainChanged=i.handleChainChanged.bind(PW(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(PW(i)),i}var r=e.prototype;return r.activate=function(){try{var i=this,a=function(){return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return i.provider.on("chainChanged",i.handleChainChanged),i.provider.on("accountsChanged",i.handleAccountsChanged),{provider:i.provider,account:u}})},o=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)i.provider=window.ethereum;else{var s=function(){if(!i.walletLink)return Promise.resolve(Ty(()=>import("./index-9d822deb.js").then(c=>c.i),[]).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){i.walletLink=new c(Y4({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,X4e)})}();if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(a):a(o))}catch(s){return Promise.reject(s)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.provider)}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.provider.chainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){try{var i=this;return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(a){return a[0]})}catch(a){return Promise.reject(a)}},r.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},r.close=function(){try{var i=this;return i.provider.close(),i.emitDeactivate(),Promise.resolve()}catch(a){return Promise.reject(a)}},r.handleChainChanged=function(i){this.emitUpdate({chainId:i})},r.handleAccountsChanged=function(i){this.emitUpdate({account:i[0]})},e}(jS);const e5e=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:Z4e},Symbol.toStringTag,{value:"Module"})),t5e=uo(e5e);Object.defineProperty(ZS,"__esModule",{value:!0});ZS.WalletLinkConnector=void 0;const r5e=Ml,n5e=t5e,i5e=qs;class a5e extends n5e.WalletLinkConnector{constructor(e){const r=i5e.getConfiguration()[r5e.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}ZS.WalletLinkConnector=a5e;var eO={};const o5e=Symbol(),TW=Object.getPrototypeOf,J4=new WeakMap,s5e=t=>t&&(J4.has(t)?J4.get(t):TW(t)===Object.prototype||TW(t)===Array.prototype),c5e=t=>s5e(t)&&t[o5e]||null,RW=(t,e=!0)=>{J4.set(t,e)},fN=t=>typeof t=="object"&&t!==null,wf=new WeakMap,hE=new WeakSet,u5e=(t=Object.is,e=(u,f)=>new Proxy(u,f),r=u=>fN(u)&&!hE.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),n=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,a=(u,f,d=n)=>{const g=i.get(u);if((g==null?void 0:g[0])===f)return g[1];const m=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return RW(m,!0),i.set(u,[f,m]),Reflect.ownKeys(u).forEach(w=>{if(Object.getOwnPropertyDescriptor(m,w))return;const v=Reflect.get(u,w),y={value:v,enumerable:!0,configurable:!0};if(hE.has(v))RW(v,!1);else if(v instanceof Promise)delete y.value,y.get=()=>d(v);else if(wf.has(v)){const[_,b]=wf.get(v);y.value=a(_,b(),d)}Object.defineProperty(m,w,y)}),Object.preventExtensions(m)},o=new WeakMap,s=[1,1],c=u=>{if(!fN(u))throw new Error("object required");const f=o.get(u);if(f)return f;let d=s[0];const g=new Set,m=(C,L=++s[0])=>{d!==L&&(d=L,g.forEach(q=>q(C,L)))};let w=s[1];const v=(C=++s[1])=>(w!==C&&!g.size&&(w=C,_.forEach(([L])=>{const q=L[1](C);q>d&&(d=q)})),d),y=C=>(L,q)=>{const le=[...L];le[1]=[C,...le[1]],m(le,q)},_=new Map,b=(C,L)=>{if(g.size){const q=L[3](y(C));_.set(C,[L,q])}else _.set(C,[L])},S=C=>{var L;const q=_.get(C);q&&(_.delete(C),(L=q[1])==null||L.call(q))},x=C=>(g.add(C),g.size===1&&_.forEach(([q,le],pe)=>{const B=q[3](y(pe));_.set(pe,[q,B])}),()=>{g.delete(C),g.size===0&&_.forEach(([q,le],pe)=>{le&&(le(),_.set(pe,[q]))})}),O=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),p=e(O,{deleteProperty(C,L){const q=Reflect.get(C,L);S(L);const le=Reflect.deleteProperty(C,L);return le&&m(["delete",[L],q]),le},set(C,L,q,le){const pe=Reflect.has(C,L),B=Reflect.get(C,L,le);if(pe&&(t(B,q)||o.has(q)&&t(B,o.get(q))))return!0;S(L),fN(q)&&(q=c5e(q)||q);let U=q;if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,m(["resolve",[L],K])}).catch(K=>{q.status="rejected",q.reason=K,m(["reject",[L],K])});else{!wf.has(q)&&r(q)&&(U=c(q));const K=!hE.has(U)&&wf.get(U);K&&b(L,K)}return Reflect.set(C,L,U,le),m(["set",[L],q,B]),!0}});o.set(u,p);const I=[O,v,a,x];return wf.set(p,I),Reflect.ownKeys(u).forEach(C=>{const L=Object.getOwnPropertyDescriptor(u,C);"value"in L&&(p[C]=u[C],delete L.value,delete L.writable),Object.defineProperty(O,C,L)}),p})=>[c,wf,hE,t,e,r,n,i,a,o,s],[l5e]=u5e();function xd(t={}){return l5e(t)}function Ip(t,e,r){const n=wf.get(t);let i;const a=[],o=n[3];let s=!1;const u=o(f=>{if(a.push(f),r){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,s&&e(a.splice(0))}))});return s=!0,()=>{s=!1,u()}}function f5e(t,e){const r=wf.get(t),[n,i,a]=r;return a(n,i(),e)}const Wi=xd({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Fae={state:Wi,subscribe(t){return Ip(Wi,()=>t(Wi))},push(t,e){t!==Wi.view&&(Wi.view=t,e&&(Wi.data=e),Wi.history.push(t))},reset(t){Wi.view=t,Wi.history=[t]},replace(t){Wi.history.length>1&&(Wi.history[Wi.history.length-1]=t,Wi.view=t)},goBack(){if(Wi.history.length>1){Wi.history.pop();const[t]=Wi.history.slice(-1);Wi.view=t}},setData(t){Wi.data=t}},$a={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 $a.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return $a.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if($a.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!$a.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem($a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem($a.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem($a.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem($a.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=Fae.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},d5e=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Oa=xd({enabled:d5e,userSessionId:"",events:[],connectedWalletId:void 0}),h5e={state:Oa,subscribe(t){return Ip(Oa.events,()=>t(f5e(Oa.events[Oa.events.length-1])))},initialize(){Oa.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Oa.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Oa.connectedWalletId=t},click(t){if(Oa.enabled){const e={type:"CLICK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},track(t){if(Oa.enabled){const e={type:"TRACK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},view(t){if(Oa.enabled){const e={type:"VIEW",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}}},Vc=xd({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Oc={state:Vc,subscribe(t){return Ip(Vc,()=>t(Vc))},setChains(t){Vc.chains=t},setWalletConnectUri(t){Vc.walletConnectUri=t},setIsCustomDesktop(t){Vc.isCustomDesktop=t},setIsCustomMobile(t){Vc.isCustomMobile=t},setIsDataLoaded(t){Vc.isDataLoaded=t},setIsUiLoaded(t){Vc.isUiLoaded=t},setIsAuth(t){Vc.isAuth=t}},pE=xd({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}),Ry={state:pE,subscribe(t){return Ip(pE,()=>t(pE))},setConfig(t){var e,r;h5e.initialize(),Oc.setChains(t.chains),Oc.setIsAuth(!!t.enableAuthMode),Oc.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),Oc.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),$a.setModalVersionInStorage(),Object.assign(pE,t)}};var p5e=Object.defineProperty,CW=Object.getOwnPropertySymbols,g5e=Object.prototype.hasOwnProperty,y5e=Object.prototype.propertyIsEnumerable,NW=(t,e,r)=>e in t?p5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m5e=(t,e)=>{for(var r in e||(e={}))g5e.call(e,r)&&NW(t,r,e[r]);if(CW)for(var r of CW(e))y5e.call(e,r)&&NW(t,r,e[r]);return t};const X4="https://explorer-api.walletconnect.com",Z4="wcm",e5="js-2.6.2";async function gE(t,e){const r=m5e({sdkType:Z4,sdkVersion:e5},e),n=new URL(t,X4);return n.searchParams.append("projectId",Ry.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Jd={async getDesktopListings(t){return gE("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return gE("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return gE("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return gE("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${X4}/w3m/v1/getWalletImage/${t}?projectId=${Ry.state.projectId}&sdkType=${Z4}&sdkVersion=${e5}`},getAssetImageUrl(t){return`${X4}/w3m/v1/getAssetImage/${t}?projectId=${Ry.state.projectId}&sdkType=${Z4}&sdkVersion=${e5}`}};var v5e=Object.defineProperty,DW=Object.getOwnPropertySymbols,b5e=Object.prototype.hasOwnProperty,w5e=Object.prototype.propertyIsEnumerable,$W=(t,e,r)=>e in t?v5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_5e=(t,e)=>{for(var r in e||(e={}))b5e.call(e,r)&&$W(t,r,e[r]);if(DW)for(var r of DW(e))w5e.call(e,r)&&$W(t,r,e[r]);return t};const MW=$a.isMobile(),Gc=xd({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),iWe={state:Gc,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Ry.state;if(t==="NONE"||e==="ALL"&&!t)return Gc.recomendedWallets;if($a.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await Jd.getAllListings(r),i=Object.values(n);i.sort((a,o)=>{const s=t.indexOf(a.id),c=t.indexOf(o.id);return s-c}),Gc.recomendedWallets=i}else{const{chains:r,isAuth:n}=Oc.state,i=r==null?void 0:r.join(","),a=$a.isArray(e),o={page:1,sdks:n?"auth_v1":void 0,entries:$a.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:s}=MW?await Jd.getMobileListings(o):await Jd.getDesktopListings(o);Gc.recomendedWallets=Object.values(s)}return Gc.recomendedWallets},async getWallets(t){const e=_5e({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=Ry.state,{recomendedWallets:i}=Gc;if(n==="ALL")return Gc.wallets;i.length?e.excludedIds=i.map(d=>d.id).join(","):$a.isArray(r)&&(e.excludedIds=r.join(",")),$a.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Oc.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:o}=t,{listings:s,total:c}=MW?await Jd.getMobileListings(e):await Jd.getDesktopListings(e),u=Object.values(s),f=o?"search":"wallets";return Gc[f]={listings:[...Gc[f].listings,...u],total:c,page:a??1},{listings:u,total:c}},getWalletImageUrl(t){return Jd.getWalletImageUrl(t)},getAssetImageUrl(t){return Jd.getAssetImageUrl(t)},resetSearch(){Gc.search={listings:[],total:0,page:1}}},g0=xd({open:!1}),dN={state:g0,subscribe(t){return Ip(g0,()=>t(g0))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Oc.state;if($a.removeWalletConnectDeepLink(),Oc.setWalletConnectUri(t==null?void 0:t.uri),Oc.setChains(t==null?void 0:t.chains),Fae.reset("ConnectWallet"),r&&n)g0.open=!0,e();else{const i=setInterval(()=>{const a=Oc.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),g0.open=!0,e())},200)}})},close(){g0.open=!1}};var E5e=Object.defineProperty,kW=Object.getOwnPropertySymbols,x5e=Object.prototype.hasOwnProperty,A5e=Object.prototype.propertyIsEnumerable,LW=(t,e,r)=>e in t?E5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S5e=(t,e)=>{for(var r in e||(e={}))x5e.call(e,r)&&LW(t,r,e[r]);if(kW)for(var r of kW(e))A5e.call(e,r)&&LW(t,r,e[r]);return t};function O5e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const xv=xd({themeMode:O5e()?"dark":"light"}),UW={state:xv,subscribe(t){return Ip(xv,()=>t(xv))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(xv.themeMode=e),r&&(xv.themeVariables=S5e({},r))}},Xd=xd({open:!1,message:"",variant:"success"}),aWe={state:Xd,subscribe(t){return Ip(Xd,()=>t(Xd))},openToast(t,e){Xd.open=!0,Xd.message=t,Xd.variant=e},closeToast(){Xd.open=!1}};let I5e=class{constructor(e){this.openModal=dN.open,this.closeModal=dN.close,this.subscribeModal=dN.subscribe,this.setTheme=UW.setThemeConfig,UW.setThemeConfig(e),Ry.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Ty(()=>import("./index-decd800e.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Oc.setIsUiLoaded(!0)}}};const P5e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:I5e},Symbol.toStringTag,{value:"Module"})),T5e=uo(P5e);var vk={},tO={},kr={},jae={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,c){var u=s>>>16&65535,f=s&65535,d=c>>>16&65535,g=c&65535;return f*g+(u*g+f*d<<16>>>0)|0}t.mul=Math.imul||e;function r(s,c){return s+c|0}t.add=r;function n(s,c){return s-c|0}t.sub=n;function i(s,c){return s<<c|s>>>32-c}t.rotl=i;function a(s,c){return s<<32-c|s>>>c}t.rotr=a;function o(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(s){return t.isInteger(s)&&s>=-t.MAX_SAFE_INTEGER&&s<=t.MAX_SAFE_INTEGER}})(jae);Object.defineProperty(kr,"__esModule",{value:!0});var qae=jae;function R5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}kr.readInt16BE=R5e;function C5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}kr.readUint16BE=C5e;function N5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}kr.readInt16LE=N5e;function D5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}kr.readUint16LE=D5e;function Hae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}kr.writeUint16BE=Hae;kr.writeInt16BE=Hae;function zae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}kr.writeUint16LE=zae;kr.writeInt16LE=zae;function t5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}kr.readInt32BE=t5;function r5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}kr.readUint32BE=r5;function n5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}kr.readInt32LE=n5;function i5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}kr.readUint32LE=i5;function UA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}kr.writeUint32BE=UA;kr.writeInt32BE=UA;function BA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}kr.writeUint32LE=BA;kr.writeInt32LE=BA;function $5e(t,e){e===void 0&&(e=0);var r=t5(t,e),n=t5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}kr.readInt64BE=$5e;function M5e(t,e){e===void 0&&(e=0);var r=r5(t,e),n=r5(t,e+4);return r*4294967296+n}kr.readUint64BE=M5e;function k5e(t,e){e===void 0&&(e=0);var r=n5(t,e),n=n5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}kr.readInt64LE=k5e;function L5e(t,e){e===void 0&&(e=0);var r=i5(t,e),n=i5(t,e+4);return n*4294967296+r}kr.readUint64LE=L5e;function Vae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),UA(t/4294967296>>>0,e,r),UA(t>>>0,e,r+4),e}kr.writeUint64BE=Vae;kr.writeInt64BE=Vae;function Gae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),BA(t>>>0,e,r),BA(t/4294967296>>>0,e,r+4),e}kr.writeUint64LE=Gae;kr.writeInt64LE=Gae;function U5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}kr.readUintBE=U5e;function B5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}kr.readUintLE=B5e;function F5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!qae.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}kr.writeUintBE=F5e;function j5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!qae.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}kr.writeUintLE=j5e;function q5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}kr.readFloat32BE=q5e;function H5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}kr.readFloat32LE=H5e;function z5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}kr.readFloat64BE=z5e;function V5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}kr.readFloat64LE=V5e;function G5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}kr.writeFloat32BE=G5e;function W5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}kr.writeFloat32LE=W5e;function K5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}kr.writeFloat64BE=K5e;function Y5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}kr.writeFloat64LE=Y5e;var is={};Object.defineProperty(is,"__esModule",{value:!0});function Q5e(t){for(var e=0;e<t.length;e++)t[e]=0;return t}is.wipe=Q5e;Object.defineProperty(tO,"__esModule",{value:!0});var Ia=kr,a5=is,J5e=20;function X5e(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,o=1797285236,s=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],d=r[19]<<24|r[18]<<16|r[17]<<8|r[16],g=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],w=r[31]<<24|r[30]<<16|r[29]<<8|r[28],v=e[3]<<24|e[2]<<16|e[1]<<8|e[0],y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],_=e[11]<<24|e[10]<<16|e[9]<<8|e[8],b=e[15]<<24|e[14]<<16|e[13]<<8|e[12],S=n,x=i,O=a,E=o,p=s,I=c,C=u,L=f,q=d,le=g,pe=m,B=w,U=v,K=y,ne=_,F=b,j=0;j<J5e;j+=2)S=S+p|0,U^=S,U=U>>>32-16|U<<16,q=q+U|0,p^=q,p=p>>>32-12|p<<12,x=x+I|0,K^=x,K=K>>>32-16|K<<16,le=le+K|0,I^=le,I=I>>>32-12|I<<12,O=O+C|0,ne^=O,ne=ne>>>32-16|ne<<16,pe=pe+ne|0,C^=pe,C=C>>>32-12|C<<12,E=E+L|0,F^=E,F=F>>>32-16|F<<16,B=B+F|0,L^=B,L=L>>>32-12|L<<12,O=O+C|0,ne^=O,ne=ne>>>32-8|ne<<8,pe=pe+ne|0,C^=pe,C=C>>>32-7|C<<7,E=E+L|0,F^=E,F=F>>>32-8|F<<8,B=B+F|0,L^=B,L=L>>>32-7|L<<7,x=x+I|0,K^=x,K=K>>>32-8|K<<8,le=le+K|0,I^=le,I=I>>>32-7|I<<7,S=S+p|0,U^=S,U=U>>>32-8|U<<8,q=q+U|0,p^=q,p=p>>>32-7|p<<7,S=S+I|0,F^=S,F=F>>>32-16|F<<16,pe=pe+F|0,I^=pe,I=I>>>32-12|I<<12,x=x+C|0,U^=x,U=U>>>32-16|U<<16,B=B+U|0,C^=B,C=C>>>32-12|C<<12,O=O+L|0,K^=O,K=K>>>32-16|K<<16,q=q+K|0,L^=q,L=L>>>32-12|L<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,le=le+ne|0,p^=le,p=p>>>32-12|p<<12,O=O+L|0,K^=O,K=K>>>32-8|K<<8,q=q+K|0,L^=q,L=L>>>32-7|L<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,le=le+ne|0,p^=le,p=p>>>32-7|p<<7,x=x+C|0,U^=x,U=U>>>32-8|U<<8,B=B+U|0,C^=B,C=C>>>32-7|C<<7,S=S+I|0,F^=S,F=F>>>32-8|F<<8,pe=pe+F|0,I^=pe,I=I>>>32-7|I<<7;Ia.writeUint32LE(S+n|0,t,0),Ia.writeUint32LE(x+i|0,t,4),Ia.writeUint32LE(O+a|0,t,8),Ia.writeUint32LE(E+o|0,t,12),Ia.writeUint32LE(p+s|0,t,16),Ia.writeUint32LE(I+c|0,t,20),Ia.writeUint32LE(C+u|0,t,24),Ia.writeUint32LE(L+f|0,t,28),Ia.writeUint32LE(q+d|0,t,32),Ia.writeUint32LE(le+g|0,t,36),Ia.writeUint32LE(pe+m|0,t,40),Ia.writeUint32LE(B+w|0,t,44),Ia.writeUint32LE(U+v|0,t,48),Ia.writeUint32LE(K+y|0,t,52),Ia.writeUint32LE(ne+_|0,t,56),Ia.writeUint32LE(F+b|0,t,60)}function Wae(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,o;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),o=a.length-e.length,a.set(e,o)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,o=i}for(var s=new Uint8Array(64),c=0;c<r.length;c+=64){X5e(s,a,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^s[u-c];eDe(a,0,o)}return a5.wipe(s),i===0&&a5.wipe(a),n}tO.streamXOR=Wae;function Z5e(t,e,r,n){return n===void 0&&(n=0),a5.wipe(r),Wae(t,e,r,r,n)}tO.stream=Z5e;function eDe(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Kae={},Ad={};Object.defineProperty(Ad,"__esModule",{value:!0});function tDe(t,e,r){return~(t-1)&e|t-1&r}Ad.select=tDe;function rDe(t,e){return(t|0)-(e|0)-1>>>31&1}Ad.lessOrEqual=rDe;function Yae(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}Ad.compare=Yae;function nDe(t,e){return t.length===0||e.length===0?!1:Yae(t,e)!==0}Ad.equal=nDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ad,r=is;t.DIGEST_LENGTH=16;var n=function(){function o(s){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=s[0]|s[1]<<8;this._r[0]=c&8191;var u=s[2]|s[3]<<8;this._r[1]=(c>>>13|u<<3)&8191;var f=s[4]|s[5]<<8;this._r[2]=(u>>>10|f<<6)&7939;var d=s[6]|s[7]<<8;this._r[3]=(f>>>7|d<<9)&8191;var g=s[8]|s[9]<<8;this._r[4]=(d>>>4|g<<12)&255,this._r[5]=g>>>1&8190;var m=s[10]|s[11]<<8;this._r[6]=(g>>>14|m<<2)&8191;var w=s[12]|s[13]<<8;this._r[7]=(m>>>11|w<<5)&8065;var v=s[14]|s[15]<<8;this._r[8]=(w>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=s[16]|s[17]<<8,this._pad[1]=s[18]|s[19]<<8,this._pad[2]=s[20]|s[21]<<8,this._pad[3]=s[22]|s[23]<<8,this._pad[4]=s[24]|s[25]<<8,this._pad[5]=s[26]|s[27]<<8,this._pad[6]=s[28]|s[29]<<8,this._pad[7]=s[30]|s[31]<<8}return o.prototype._blocks=function(s,c,u){for(var f=this._fin?0:2048,d=this._h[0],g=this._h[1],m=this._h[2],w=this._h[3],v=this._h[4],y=this._h[5],_=this._h[6],b=this._h[7],S=this._h[8],x=this._h[9],O=this._r[0],E=this._r[1],p=this._r[2],I=this._r[3],C=this._r[4],L=this._r[5],q=this._r[6],le=this._r[7],pe=this._r[8],B=this._r[9];u>=16;){var U=s[c+0]|s[c+1]<<8;d+=U&8191;var K=s[c+2]|s[c+3]<<8;g+=(U>>>13|K<<3)&8191;var ne=s[c+4]|s[c+5]<<8;m+=(K>>>10|ne<<6)&8191;var F=s[c+6]|s[c+7]<<8;w+=(ne>>>7|F<<9)&8191;var j=s[c+8]|s[c+9]<<8;v+=(F>>>4|j<<12)&8191,y+=j>>>1&8191;var z=s[c+10]|s[c+11]<<8;_+=(j>>>14|z<<2)&8191;var $=s[c+12]|s[c+13]<<8;b+=(z>>>11|$<<5)&8191;var H=s[c+14]|s[c+15]<<8;S+=($>>>8|H<<8)&8191,x+=H>>>5|f;var k=0,M=k;M+=d*O,M+=g*(5*B),M+=m*(5*pe),M+=w*(5*le),M+=v*(5*q),k=M>>>13,M&=8191,M+=y*(5*L),M+=_*(5*C),M+=b*(5*I),M+=S*(5*p),M+=x*(5*E),k+=M>>>13,M&=8191;var G=k;G+=d*E,G+=g*O,G+=m*(5*B),G+=w*(5*pe),G+=v*(5*le),k=G>>>13,G&=8191,G+=y*(5*q),G+=_*(5*L),G+=b*(5*C),G+=S*(5*I),G+=x*(5*p),k+=G>>>13,G&=8191;var ge=k;ge+=d*p,ge+=g*E,ge+=m*O,ge+=w*(5*B),ge+=v*(5*pe),k=ge>>>13,ge&=8191,ge+=y*(5*le),ge+=_*(5*q),ge+=b*(5*L),ge+=S*(5*C),ge+=x*(5*I),k+=ge>>>13,ge&=8191;var Q=k;Q+=d*I,Q+=g*p,Q+=m*E,Q+=w*O,Q+=v*(5*B),k=Q>>>13,Q&=8191,Q+=y*(5*pe),Q+=_*(5*le),Q+=b*(5*q),Q+=S*(5*L),Q+=x*(5*C),k+=Q>>>13,Q&=8191;var te=k;te+=d*C,te+=g*I,te+=m*p,te+=w*E,te+=v*O,k=te>>>13,te&=8191,te+=y*(5*B),te+=_*(5*pe),te+=b*(5*le),te+=S*(5*q),te+=x*(5*L),k+=te>>>13,te&=8191;var ce=k;ce+=d*L,ce+=g*C,ce+=m*I,ce+=w*p,ce+=v*E,k=ce>>>13,ce&=8191,ce+=y*O,ce+=_*(5*B),ce+=b*(5*pe),ce+=S*(5*le),ce+=x*(5*q),k+=ce>>>13,ce&=8191;var T=k;T+=d*q,T+=g*L,T+=m*C,T+=w*I,T+=v*p,k=T>>>13,T&=8191,T+=y*E,T+=_*O,T+=b*(5*B),T+=S*(5*pe),T+=x*(5*le),k+=T>>>13,T&=8191;var fe=k;fe+=d*le,fe+=g*q,fe+=m*L,fe+=w*C,fe+=v*I,k=fe>>>13,fe&=8191,fe+=y*p,fe+=_*E,fe+=b*O,fe+=S*(5*B),fe+=x*(5*pe),k+=fe>>>13,fe&=8191;var ze=k;ze+=d*pe,ze+=g*le,ze+=m*q,ze+=w*L,ze+=v*C,k=ze>>>13,ze&=8191,ze+=y*I,ze+=_*p,ze+=b*E,ze+=S*O,ze+=x*(5*B),k+=ze>>>13,ze&=8191;var tt=k;tt+=d*B,tt+=g*pe,tt+=m*le,tt+=w*q,tt+=v*L,k=tt>>>13,tt&=8191,tt+=y*C,tt+=_*I,tt+=b*p,tt+=S*E,tt+=x*O,k+=tt>>>13,tt&=8191,k=(k<<2)+k|0,k=k+M|0,M=k&8191,k=k>>>13,G+=k,d=M,g=G,m=ge,w=Q,v=te,y=ce,_=T,b=fe,S=ze,x=tt,c+=16,u-=16}this._h[0]=d,this._h[1]=g,this._h[2]=m,this._h[3]=w,this._h[4]=v,this._h[5]=y,this._h[6]=_,this._h[7]=b,this._h[8]=S,this._h[9]=x},o.prototype.finish=function(s,c){c===void 0&&(c=0);var u=new Uint16Array(10),f,d,g,m;if(this._leftover){for(m=this._leftover,this._buffer[m++]=1;m<16;m++)this._buffer[m]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,m=2;m<10;m++)this._h[m]+=f,f=this._h[m]>>>13,this._h[m]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,u[0]=this._h[0]+5,f=u[0]>>>13,u[0]&=8191,m=1;m<10;m++)u[m]=this._h[m]+f,f=u[m]>>>13,u[m]&=8191;for(u[9]-=8192,d=(f^1)-1,m=0;m<10;m++)u[m]&=d;for(d=~d,m=0;m<10;m++)this._h[m]=this._h[m]&d|u[m];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,g=this._h[0]+this._pad[0],this._h[0]=g&65535,m=1;m<8;m++)g=(this._h[m]+this._pad[m]|0)+(g>>>16)|0,this._h[m]=g&65535;return s[c+0]=this._h[0]>>>0,s[c+1]=this._h[0]>>>8,s[c+2]=this._h[1]>>>0,s[c+3]=this._h[1]>>>8,s[c+4]=this._h[2]>>>0,s[c+5]=this._h[2]>>>8,s[c+6]=this._h[3]>>>0,s[c+7]=this._h[3]>>>8,s[c+8]=this._h[4]>>>0,s[c+9]=this._h[4]>>>8,s[c+10]=this._h[5]>>>0,s[c+11]=this._h[5]>>>8,s[c+12]=this._h[6]>>>0,s[c+13]=this._h[6]>>>8,s[c+14]=this._h[7]>>>0,s[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(s){var c=0,u=s.length,f;if(this._leftover){f=16-this._leftover,f>u&&(f=u);for(var d=0;d<f;d++)this._buffer[this._leftover+d]=s[c+d];if(u-=f,c+=f,this._leftover+=f,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(f=u-u%16,this._blocks(s,c,f),c+=f,u-=f),u){for(var d=0;d<u;d++)this._buffer[this._leftover+d]=s[c+d];this._leftover+=u}return this},o.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var s=new Uint8Array(16);return this.finish(s),s},o.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},o}();t.Poly1305=n;function i(o,s){var c=new n(o);c.update(s);var u=c.digest();return c.clean(),u}t.oneTimeAuth=i;function a(o,s){return o.length!==t.DIGEST_LENGTH||s.length!==t.DIGEST_LENGTH?!1:e.equal(o,s)}t.equal=a})(Kae);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=tO,r=Kae,n=is,i=kr,a=Ad;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var o=new Uint8Array(16),s=function(){function c(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return c.prototype.seal=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=f.length+this.tagLength,y;if(g){if(g.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");y=g}else y=new Uint8Array(v);return e.streamXOR(this._key,m,f,y,4),this._authenticate(y.subarray(y.length-this.tagLength,y.length),w,y.subarray(0,y.length-this.tagLength),d),n.wipe(m),y},c.prototype.open=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length<this.tagLength)return null;var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=new Uint8Array(this.tagLength);if(this._authenticate(v,w,f.subarray(0,f.length-this.tagLength),d),!a.equal(v,f.subarray(f.length-this.tagLength,f.length)))return null;var y=f.length-this.tagLength,_;if(g){if(g.length!==y)throw new Error("ChaCha20Poly1305: incorrect destination length");_=g}else _=new Uint8Array(y);return e.streamXOR(this._key,m,f.subarray(0,f.length-this.tagLength),_,4),n.wipe(m),_},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(u,f,d,g){var m=new r.Poly1305(f);g&&(m.update(g),g.length%16>0&&m.update(o.subarray(g.length%16))),m.update(d),d.length%16>0&&m.update(o.subarray(d.length%16));var w=new Uint8Array(8);g&&i.writeUint64LE(g.length,w),m.update(w),i.writeUint64LE(d.length,w),m.update(w);for(var v=m.digest(),y=0;y<v.length;y++)u[y]=v[y];m.clean(),n.wipe(v),n.wipe(w)},c}();t.ChaCha20Poly1305=s})(vk);var Qae={},Iw={},bk={};Object.defineProperty(bk,"__esModule",{value:!0});function iDe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}bk.isSerializableHash=iDe;Object.defineProperty(Iw,"__esModule",{value:!0});var Wc=bk,aDe=Ad,oDe=is,Jae=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Wc.isSerializableHash(this._inner)&&Wc.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),oDe.wipe(n)}return t.prototype.reset=function(){if(!Wc.isSerializableHash(this._inner)||!Wc.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Wc.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Wc.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Wc.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Wc.isSerializableHash(this._inner)||!Wc.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Wc.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Iw.HMAC=Jae;function sDe(t,e,r){var n=new Jae(t,e);n.update(r);var i=n.digest();return n.clean(),i}Iw.hmac=sDe;Iw.equal=aDe.equal;Object.defineProperty(Qae,"__esModule",{value:!0});var BW=Iw,FW=is,cDe=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=BW.hmac(this._hash,n,r);this._hmac=new BW.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),FW.wipe(this._buffer),FW.wipe(this._counter),this._bufpos=0},t}(),uDe=Qae.HKDF=cDe,im={},rO={},nO={};Object.defineProperty(nO,"__esModule",{value:!0});nO.BrowserRandomSource=void 0;const jW=65536;class lDe{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=jW)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,jW)));return r}}nO.BrowserRandomSource=lDe;function o5(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var iO={};Object.defineProperty(iO,"__esModule",{value:!0});iO.NodeRandomSource=void 0;const fDe=is;class dDe{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof o5<"u"){const e=X$;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,fDe.wipe)(r),n}}iO.NodeRandomSource=dDe;Object.defineProperty(rO,"__esModule",{value:!0});rO.SystemRandomSource=void 0;const hDe=nO,pDe=iO;class gDe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new hDe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new pDe.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}rO.SystemRandomSource=gDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=rO,r=kr,n=is;t.defaultRandomSource=new e.SystemRandomSource;function i(u,f=t.defaultRandomSource){return f.randomBytes(u)}t.randomBytes=i;function a(u=t.defaultRandomSource){const f=i(4,u),d=(0,r.readUint32LE)(f);return(0,n.wipe)(f),d}t.randomUint32=a;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function s(u,f=o,d=t.defaultRandomSource){if(f.length<2)throw new Error("randomString charset is too short");if(f.length>256)throw new Error("randomString charset is too long");let g="";const m=f.length,w=256-256%m;for(;u>0;){const v=i(Math.ceil(u*256/w),d);for(let y=0;y<v.length&&u>0;y++){const _=v[y];_<w&&(g+=f.charAt(_%m),u--)}(0,n.wipe)(v)}return g}t.randomString=s;function c(u,f=o,d=t.defaultRandomSource){const g=Math.ceil(u/(Math.log(f.length)/Math.LN2));return s(g,f,d)}t.randomStringForEntropy=c})(im);var aO={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=kr,r=is;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function s(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return s.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},s.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},s.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},s.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=a(this._temp,this._state,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},s.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,d=u/536870912|0,g=u<<3,m=u%64<56?64:128;this._buffer[f]=128;for(var w=f+1;w<m-8;w++)this._buffer[w]=0;e.writeUint32BE(d,this._buffer,m-8),e.writeUint32BE(g,this._buffer,m-4),a(this._temp,this._state,this._buffer,0,m),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)e.writeUint32BE(this._state[w],c,w*4);return this},s.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},s.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},s.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},s.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},s}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(s,c,u,f,d){for(;d>=64;){for(var g=c[0],m=c[1],w=c[2],v=c[3],y=c[4],_=c[5],b=c[6],S=c[7],x=0;x<16;x++){var O=f+x*4;s[x]=e.readUint32BE(u,O)}for(var x=16;x<64;x++){var E=s[x-2],p=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=s[x-15];var I=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;s[x]=(p+s[x-7]|0)+(I+s[x-16]|0)}for(var x=0;x<64;x++){var p=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&_^~y&b)|0)+(S+(i[x]+s[x]|0)|0)|0,I=((g>>>2|g<<32-2)^(g>>>13|g<<32-13)^(g>>>22|g<<32-22))+(g&m^g&w^m&w)|0;S=b,b=_,_=y,y=v+p|0,v=w,w=m,m=g,g=p+I|0}c[0]+=g,c[1]+=m,c[2]+=w,c[3]+=v,c[4]+=y,c[5]+=_,c[6]+=b,c[7]+=S,f+=64,d-=64}return f}function o(s){var c=new n;c.update(s);var u=c.digest();return c.clean(),u}t.hash=o})(aO);var wk={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=im,r=is;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(x){const O=new Float64Array(16);if(x)for(let E=0;E<x.length;E++)O[E]=x[E];return O}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function o(x){let O=1;for(let E=0;E<16;E++){let p=x[E]+O+65535;O=Math.floor(p/65536),x[E]=p-O*65536}x[0]+=O-1+37*(O-1)}function s(x,O,E){const p=~(E-1);for(let I=0;I<16;I++){const C=p&(x[I]^O[I]);x[I]^=C,O[I]^=C}}function c(x,O){const E=n(),p=n();for(let I=0;I<16;I++)p[I]=O[I];o(p),o(p),o(p);for(let I=0;I<2;I++){E[0]=p[0]-65517;for(let L=1;L<15;L++)E[L]=p[L]-65535-(E[L-1]>>16&1),E[L-1]&=65535;E[15]=p[15]-32767-(E[14]>>16&1);const C=E[15]>>16&1;E[14]&=65535,s(p,E,1-C)}for(let I=0;I<16;I++)x[2*I]=p[I]&255,x[2*I+1]=p[I]>>8}function u(x,O){for(let E=0;E<16;E++)x[E]=O[2*E]+(O[2*E+1]<<8);x[15]&=32767}function f(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]+E[p]}function d(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]-E[p]}function g(x,O,E){let p,I,C=0,L=0,q=0,le=0,pe=0,B=0,U=0,K=0,ne=0,F=0,j=0,z=0,$=0,H=0,k=0,M=0,G=0,ge=0,Q=0,te=0,ce=0,T=0,fe=0,ze=0,tt=0,mt=0,vt=0,gt=0,Lt=0,Yt=0,wr=0,Rt=E[0],Pt=E[1],kt=E[2],Nt=E[3],Kt=E[4],Ut=E[5],zt=E[6],$t=E[7],Dt=E[8],qt=E[9],Mt=E[10],cr=E[11],tr=E[12],ir=E[13],nr=E[14],mr=E[15];p=O[0],C+=p*Rt,L+=p*Pt,q+=p*kt,le+=p*Nt,pe+=p*Kt,B+=p*Ut,U+=p*zt,K+=p*$t,ne+=p*Dt,F+=p*qt,j+=p*Mt,z+=p*cr,$+=p*tr,H+=p*ir,k+=p*nr,M+=p*mr,p=O[1],L+=p*Rt,q+=p*Pt,le+=p*kt,pe+=p*Nt,B+=p*Kt,U+=p*Ut,K+=p*zt,ne+=p*$t,F+=p*Dt,j+=p*qt,z+=p*Mt,$+=p*cr,H+=p*tr,k+=p*ir,M+=p*nr,G+=p*mr,p=O[2],q+=p*Rt,le+=p*Pt,pe+=p*kt,B+=p*Nt,U+=p*Kt,K+=p*Ut,ne+=p*zt,F+=p*$t,j+=p*Dt,z+=p*qt,$+=p*Mt,H+=p*cr,k+=p*tr,M+=p*ir,G+=p*nr,ge+=p*mr,p=O[3],le+=p*Rt,pe+=p*Pt,B+=p*kt,U+=p*Nt,K+=p*Kt,ne+=p*Ut,F+=p*zt,j+=p*$t,z+=p*Dt,$+=p*qt,H+=p*Mt,k+=p*cr,M+=p*tr,G+=p*ir,ge+=p*nr,Q+=p*mr,p=O[4],pe+=p*Rt,B+=p*Pt,U+=p*kt,K+=p*Nt,ne+=p*Kt,F+=p*Ut,j+=p*zt,z+=p*$t,$+=p*Dt,H+=p*qt,k+=p*Mt,M+=p*cr,G+=p*tr,ge+=p*ir,Q+=p*nr,te+=p*mr,p=O[5],B+=p*Rt,U+=p*Pt,K+=p*kt,ne+=p*Nt,F+=p*Kt,j+=p*Ut,z+=p*zt,$+=p*$t,H+=p*Dt,k+=p*qt,M+=p*Mt,G+=p*cr,ge+=p*tr,Q+=p*ir,te+=p*nr,ce+=p*mr,p=O[6],U+=p*Rt,K+=p*Pt,ne+=p*kt,F+=p*Nt,j+=p*Kt,z+=p*Ut,$+=p*zt,H+=p*$t,k+=p*Dt,M+=p*qt,G+=p*Mt,ge+=p*cr,Q+=p*tr,te+=p*ir,ce+=p*nr,T+=p*mr,p=O[7],K+=p*Rt,ne+=p*Pt,F+=p*kt,j+=p*Nt,z+=p*Kt,$+=p*Ut,H+=p*zt,k+=p*$t,M+=p*Dt,G+=p*qt,ge+=p*Mt,Q+=p*cr,te+=p*tr,ce+=p*ir,T+=p*nr,fe+=p*mr,p=O[8],ne+=p*Rt,F+=p*Pt,j+=p*kt,z+=p*Nt,$+=p*Kt,H+=p*Ut,k+=p*zt,M+=p*$t,G+=p*Dt,ge+=p*qt,Q+=p*Mt,te+=p*cr,ce+=p*tr,T+=p*ir,fe+=p*nr,ze+=p*mr,p=O[9],F+=p*Rt,j+=p*Pt,z+=p*kt,$+=p*Nt,H+=p*Kt,k+=p*Ut,M+=p*zt,G+=p*$t,ge+=p*Dt,Q+=p*qt,te+=p*Mt,ce+=p*cr,T+=p*tr,fe+=p*ir,ze+=p*nr,tt+=p*mr,p=O[10],j+=p*Rt,z+=p*Pt,$+=p*kt,H+=p*Nt,k+=p*Kt,M+=p*Ut,G+=p*zt,ge+=p*$t,Q+=p*Dt,te+=p*qt,ce+=p*Mt,T+=p*cr,fe+=p*tr,ze+=p*ir,tt+=p*nr,mt+=p*mr,p=O[11],z+=p*Rt,$+=p*Pt,H+=p*kt,k+=p*Nt,M+=p*Kt,G+=p*Ut,ge+=p*zt,Q+=p*$t,te+=p*Dt,ce+=p*qt,T+=p*Mt,fe+=p*cr,ze+=p*tr,tt+=p*ir,mt+=p*nr,vt+=p*mr,p=O[12],$+=p*Rt,H+=p*Pt,k+=p*kt,M+=p*Nt,G+=p*Kt,ge+=p*Ut,Q+=p*zt,te+=p*$t,ce+=p*Dt,T+=p*qt,fe+=p*Mt,ze+=p*cr,tt+=p*tr,mt+=p*ir,vt+=p*nr,gt+=p*mr,p=O[13],H+=p*Rt,k+=p*Pt,M+=p*kt,G+=p*Nt,ge+=p*Kt,Q+=p*Ut,te+=p*zt,ce+=p*$t,T+=p*Dt,fe+=p*qt,ze+=p*Mt,tt+=p*cr,mt+=p*tr,vt+=p*ir,gt+=p*nr,Lt+=p*mr,p=O[14],k+=p*Rt,M+=p*Pt,G+=p*kt,ge+=p*Nt,Q+=p*Kt,te+=p*Ut,ce+=p*zt,T+=p*$t,fe+=p*Dt,ze+=p*qt,tt+=p*Mt,mt+=p*cr,vt+=p*tr,gt+=p*ir,Lt+=p*nr,Yt+=p*mr,p=O[15],M+=p*Rt,G+=p*Pt,ge+=p*kt,Q+=p*Nt,te+=p*Kt,ce+=p*Ut,T+=p*zt,fe+=p*$t,ze+=p*Dt,tt+=p*qt,mt+=p*Mt,vt+=p*cr,gt+=p*tr,Lt+=p*ir,Yt+=p*nr,wr+=p*mr,C+=38*G,L+=38*ge,q+=38*Q,le+=38*te,pe+=38*ce,B+=38*T,U+=38*fe,K+=38*ze,ne+=38*tt,F+=38*mt,j+=38*vt,z+=38*gt,$+=38*Lt,H+=38*Yt,k+=38*wr,I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),x[0]=C,x[1]=L,x[2]=q,x[3]=le,x[4]=pe,x[5]=B,x[6]=U,x[7]=K,x[8]=ne,x[9]=F,x[10]=j,x[11]=z,x[12]=$,x[13]=H,x[14]=k,x[15]=M}function m(x,O){g(x,O,O)}function w(x,O){const E=n();for(let p=0;p<16;p++)E[p]=O[p];for(let p=253;p>=0;p--)m(E,E),p!==2&&p!==4&&g(E,E,O);for(let p=0;p<16;p++)x[p]=E[p]}function v(x,O){const E=new Uint8Array(32),p=new Float64Array(80),I=n(),C=n(),L=n(),q=n(),le=n(),pe=n();for(let ne=0;ne<31;ne++)E[ne]=x[ne];E[31]=x[31]&127|64,E[0]&=248,u(p,O);for(let ne=0;ne<16;ne++)C[ne]=p[ne];I[0]=q[0]=1;for(let ne=254;ne>=0;--ne){const F=E[ne>>>3]>>>(ne&7)&1;s(I,C,F),s(L,q,F),f(le,I,L),d(I,I,L),f(L,C,q),d(C,C,q),m(q,le),m(pe,I),g(I,L,I),g(L,C,le),f(le,I,L),d(I,I,L),m(C,I),d(L,q,pe),g(I,L,a),f(I,I,q),g(L,L,I),g(I,q,pe),g(q,C,p),m(C,le),s(I,C,F),s(L,q,F)}for(let ne=0;ne<16;ne++)p[ne+16]=I[ne],p[ne+32]=L[ne],p[ne+48]=C[ne],p[ne+64]=q[ne];const B=p.subarray(32),U=p.subarray(16);w(B,B),g(U,U,B);const K=new Uint8Array(32);return c(K,U),K}t.scalarMult=v;function y(x){return v(x,i)}t.scalarMultBase=y;function _(x){if(x.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const O=new Uint8Array(x);return{publicKey:y(O),secretKey:O}}t.generateKeyPairFromSeed=_;function b(x){const O=(0,e.randomBytes)(32,x),E=_(O);return(0,r.wipe)(O),E}t.generateKeyPair=b;function S(x,O,E=!1){if(x.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(O.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(x,O);if(E){let I=0;for(let C=0;C<p.length;C++)I|=p[C];if(I===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=S})(wk);function _k(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Xae(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?_k(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function s5(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=Xae(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return _k(r)}function yDe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=t.length,c=t.charAt(0),u=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function d(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,y=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var S=(b-_)*f+1>>>0,x=new Uint8Array(S);_!==b;){for(var O=w[_],E=0,p=S-1;(O!==0||E<y)&&p!==-1;p--,E++)O+=256*x[p]>>>0,x[p]=O%s>>>0,O=O/s>>>0;if(O!==0)throw new Error("Non-zero carry");y=E,_++}for(var I=S-y;I!==S&&x[I]===0;)I++;for(var C=c.repeat(v);I<S;++I)C+=t.charAt(x[I]);return C}function g(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var y=0,_=0;w[v]===c;)y++,v++;for(var b=(w.length-v)*u+1>>>0,S=new Uint8Array(b);w[v];){var x=r[w.charCodeAt(v)];if(x===255)return;for(var O=0,E=b-1;(x!==0||O<_)&&E!==-1;E--,O++)x+=s*S[E]>>>0,S[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");_=O,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var I=new Uint8Array(y+(b-p)),C=y;p!==b;)I[C++]=S[p++];return I}}}function m(w){var v=g(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:g,decode:m}}var mDe=yDe,vDe=mDe;const bDe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},wDe=t=>new TextEncoder().encode(t),_De=t=>new TextDecoder().decode(t);class EDe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xDe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zae(this,e)}}class ADe{constructor(e){this.decoders=e}or(e){return Zae(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Zae=(t,e)=>new ADe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class SDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new EDe(e,r,n),this.decoder=new xDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const oO=({name:t,prefix:e,encode:r,decode:n})=>new SDe(t,e,r,n),Pw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=vDe(r,e);return oO({prefix:t,name:e,encode:n,decode:a=>bDe(i(a))})},ODe=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let a=t.length;for(;t[a-1]==="=";)--a;const o=new Uint8Array(a*r/8|0);let s=0,c=0,u=0;for(let f=0;f<a;++f){const d=i[t[f]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,s+=r,s>=8&&(s-=8,o[u++]=255&c>>s)}if(s>=r||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o},IDe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let a="",o=0,s=0;for(let c=0;c<t.length;++c)for(s=s<<8|t[c],o+=8;o>r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},ba=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>oO({prefix:e,name:t,encode(i){return IDe(i,n,r)},decode(i){return ODe(i,n,r,t)}}),PDe=oO({prefix:"\0",name:"identity",encode:t=>_De(t),decode:t=>wDe(t)}),TDe=Object.freeze(Object.defineProperty({__proto__:null,identity:PDe},Symbol.toStringTag,{value:"Module"})),RDe=ba({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),CDe=Object.freeze(Object.defineProperty({__proto__:null,base2:RDe},Symbol.toStringTag,{value:"Module"})),NDe=ba({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),DDe=Object.freeze(Object.defineProperty({__proto__:null,base8:NDe},Symbol.toStringTag,{value:"Module"})),$De=Pw({prefix:"9",name:"base10",alphabet:"0123456789"}),MDe=Object.freeze(Object.defineProperty({__proto__:null,base10:$De},Symbol.toStringTag,{value:"Module"})),kDe=ba({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),LDe=ba({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),UDe=Object.freeze(Object.defineProperty({__proto__:null,base16:kDe,base16upper:LDe},Symbol.toStringTag,{value:"Module"})),BDe=ba({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),FDe=ba({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),jDe=ba({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qDe=ba({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),HDe=ba({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zDe=ba({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),VDe=ba({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),GDe=ba({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),WDe=ba({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),KDe=Object.freeze(Object.defineProperty({__proto__:null,base32:BDe,base32hex:HDe,base32hexpad:VDe,base32hexpadupper:GDe,base32hexupper:zDe,base32pad:jDe,base32padupper:qDe,base32upper:FDe,base32z:WDe},Symbol.toStringTag,{value:"Module"})),YDe=Pw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QDe=Pw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),JDe=Object.freeze(Object.defineProperty({__proto__:null,base36:YDe,base36upper:QDe},Symbol.toStringTag,{value:"Module"})),XDe=Pw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ZDe=Pw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),e$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:XDe,base58flickr:ZDe},Symbol.toStringTag,{value:"Module"})),t$e=ba({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),r$e=ba({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),n$e=ba({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),i$e=ba({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),a$e=Object.freeze(Object.defineProperty({__proto__:null,base64:t$e,base64pad:r$e,base64url:n$e,base64urlpad:i$e},Symbol.toStringTag,{value:"Module"})),eoe=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),o$e=eoe.reduce((t,e,r)=>(t[r]=e,t),[]),s$e=eoe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function c$e(t){return t.reduce((e,r)=>(e+=o$e[r],e),"")}function u$e(t){const e=[];for(const r of t){const n=s$e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const l$e=oO({prefix:"🚀",name:"base256emoji",encode:c$e,decode:u$e}),f$e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:l$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const qW={...TDe,...CDe,...DDe,...MDe,...UDe,...KDe,...JDe,...e$e,...a$e,...f$e};function toe(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const HW=toe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),hN=toe("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Xae(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),roe={utf8:HW,"utf-8":HW,hex:qW.base16,latin1:hN,ascii:hN,binary:hN,...qW};function Co(t,e="utf8"){const r=roe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?_k(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function co(t,e="utf8"){const r=roe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var zW=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},d$e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),h$e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=Ha.platform}return t}(),p$e=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),g$e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),y$e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),m$e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,v$e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,VW=3,b$e=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",m$e]],GW=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function w$e(t){return t?WW(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new y$e:typeof navigator<"u"?WW(navigator.userAgent):x$e()}function _$e(t){return t!==""&&b$e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function WW(t){var e=_$e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new g$e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<VW&&(i=zW(zW([],i,!0),A$e(VW-i.length),!0)):i=[];var a=i.join("."),o=E$e(t),s=v$e.exec(t);return s&&s[1]?new p$e(r,a,o,s[1]):new d$e(r,a,o)}function E$e(t){for(var e=0,r=GW.length;e<r;e++){var n=GW[e],i=n[0],a=n[1],o=a.exec(t);if(o)return i}return null}function x$e(){var t=typeof Ha<"u"&&Ha.version;return t?new h$e(Ha.version.slice(1)):null}function A$e(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Xt={};/*! *****************************************************************************
|
|
122
122
|
Copyright (c) Microsoft Corporation.
|
|
123
123
|
|
|
124
124
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -167,7 +167,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
167
167
|
- Extension \`${r.name}\` supports version(s) \`${n}\``:n||(e+=`
|
|
168
168
|
- Extension \`${r.name}\` does not support ${zn.platform} environments.`)}),new Id(Od.IncompatibleExtensions,e)}function HFe(t){let e=r=>{let n=r+1,i=n%10,a=n%100;return i===1&&a!==11?`${n}st`:i===2&&a!==12?`${n}nd`:i===3&&a!==13?`${n}rd`:`${n}th`};return new Id(Od.InvalidArgument,`Invalid ${e(t.argument)} argument given to \`${t.procedure}\`.
|
|
169
169
|
Expected: \`${t.expected}\`
|
|
170
|
-
Received: \`${t.received}\``)}function zFe(){return new kw(cm.DuplicateIframe,"Duplicate iframes found.")}function VFe(){return new kw(cm.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function GFe(){return new kw(cm.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${zn.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function mg(t){let{method:e,removalVersions:r,useInstead:n}=t,i=r[zn.sdkName],a=n?` Use \`${n}\` instead.`:"",o=`\`${e}\` will be removed from \`${zn.sdkName}\` in version \`${i}\`.${a}`;return new kw(cm.DeprecationNotice,o)}function*WFe(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var KFe=WFe();function wse(){return KFe.next().value}var _se=Symbol("Payload pre-processed by Magic SDK");function Ese(t){return Object.defineProperty(t,_se,{value:!0,enumerable:!1}),t}function YFe(t){return!!t[_se]}function YA(t){var e,r,n;return YFe(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=wse(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],Ese(t)),t}function an(t,e=[]){return Ese({params:e,method:t,jsonrpc:"2.0",id:wse()})}var Fk=class{constructor(t){t instanceof Fk?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):MFe(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}applyError(t){return this._error=t,this}applyResult(t){return this._result=t,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},QFe=HBe(zBe()),JFe=class extends QFe.default{};function xse(){let t=new JFe;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var Ase=Symbol("isPromiEvent");function Sse(t){return!!t[Ase]}function jk(t){let e=Ose(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=xse(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(f,d)=>(...g)=>{let m=d[f].apply(d,g);return c(m)},c=f=>Object.assign(f,{[Ase]:!0,[i]:f[i]||f.then,[a]:f[a]||f.catch,[o]:f[o]||f.finally,then:s(i,f),catch:s(a,f),finally:s(o,f),on:n("on",f),once:n("once",f),addListener:n("addListener",f),off:n("off",f),removeListener:n("removeListener",f),removeAllListeners:n("removeAllListeners",f),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),u=c(e.then(f=>(u.emit("done",f),u.emit("settled"),f),f=>{throw u.emit("error",f),u.emit("settled"),f}));return u}function Ose(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var Np=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(P1.MAGIC_HANDLE_REQUEST,YA(t)),r=jk((i,a)=>{e.then(o=>{if(n(),o.hasError)a(new R1(o.payload.error));else if(o.hasResult)i(o.payload.result);else throw FFe()}).catch(o=>{n(),a(o)})}),n=this.overlay.on(Ah.MAGIC_HANDLE_EVENT,i=>{var a;let{response:o}=i.data;if(o.id===t.id&&((a=o.result)!=null&&a.event)){let{event:s,params:c=[]}=o.result;r.emit(s,...c)}});return r}createIntermediaryEvent(t,e){return r=>{let n=an(vr.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}};function XFe(t,e){let[r]=t.split(".").map(Number);return r>=e}var vg={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},ZFe=class extends Np{loginWithMagicLink(t){let e=zn.sdkName==="@magic-sdk/react-native"||zn.sdkName==="@magic-sdk/react-native-bare"||zn.sdkName==="@magic-sdk/react-native-expo";if(e&&XFe(zn.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");e&&mg({method:"auth.loginWithMagicLink()",removalVersions:vg,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:i,overrides:a}=t,o=an(this.sdk.testMode?vr.LoginWithMagicLinkTestMode:vr.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:i,overrides:a}]);return this.request(o)}loginWithSMS(t){let{phoneNumber:e}=t,r=an(this.sdk.testMode?vr.LoginWithSmsTestMode:vr.LoginWithSms,[{phoneNumber:e,showUI:!0}]);return this.request(r)}loginWithEmailOTP(t){let{email:e,showUI:r,deviceCheckUI:n,overrides:i}=t,a=an(this.sdk.testMode?vr.LoginWithEmailOTPTestMode:vr.LoginWithEmailOTP,[{email:e,showUI:r,deviceCheckUI:n,overrides:i}]),o=this.request(a);return!n&&o&&o.on(WA.Retry,()=>{this.createIntermediaryEvent(WA.Retry,a.id)()}),!r&&o&&(o.on(V0.VerifyEmailOtp,s=>{this.createIntermediaryEvent(V0.VerifyEmailOtp,a.id)(s)}),o.on(V0.Cancel,()=>{this.createIntermediaryEvent(V0.Cancel,a.id)()})),o}loginWithCredential(t){let e=t??"";if(!t&&zn.platform==="web"){e=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=an(this.sdk.testMode?vr.LoginWithCredentialTestMode:vr.LoginWithCredential,[e]);return this.request(r)}setAuthorizationToken(t){let e=an(vr.SetAuthorizationToken,[{jwt:t}]);return this.request(e)}updateEmailWithUI(t){let{email:e,showUI:r=!0}=t,n=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}},Ise={};jBe(Ise,{clear:()=>eje,getItem:()=>$o,iterate:()=>Pse,key:()=>rje,keys:()=>nje,length:()=>tje,removeItem:()=>gO,setItem:()=>Tl});var xE;function Pd(t){return(...e)=>Ci(this,null,function*(){return xE||(xE=yield zn.configureStorage()),yield xE.ready(),xE[t](...e)})}var $o=Pd("getItem"),Tl=Pd("setItem"),gO=Pd("removeItem"),eje=Pd("clear"),tje=Pd("length"),rje=Pd("key"),nje=Pd("keys"),Pse=Pd("iterate");function ije(){let t=window.crypto.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&191|128;let e="";return e+=t[0].toString(16),e+=t[1].toString(16),e+=t[2].toString(16),e+=t[3].toString(16),e+="-",e+=t[4].toString(16),e+=t[5].toString(16),e+="-",e+=t[6].toString(16),e+=t[7].toString(16),e+="-",e+=t[8].toString(16),e+=t[9].toString(16),e+="-",e+=t[10].toString(16),e+=t[11].toString(16),e+=t[12].toString(16),e+=t[13].toString(16),e+=t[14].toString(16),e+=t[15].toString(16),e}var Tse="STORE_KEY_PRIVATE_KEY",E5="STORE_KEY_PUBLIC_JWK",Rse="ECDSA",aje="P-256",oje={name:Rse,namedCurve:aje};function yO(){let t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function sje(){return Ci(this,null,function*(){let t=yield cje();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield $o(Tse);if(!r||!e){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:ije()},i={typ:"dpop+jwt",alg:"ES256",jwk:t},a={protected:DY(JSON.stringify(i)),claims:DY(JSON.stringify(n))},o=lje(`${a.protected}.${a.claims}`),s={name:Rse,hash:{name:"SHA-256"}},c=dje(new Uint8Array(yield e.sign(s,r,o)));return`${a.protected}.${a.claims}.${c}`})}function cje(){return Ci(this,null,function*(){if(!yO()){console.info("webcrypto is not supported");return}return(yield $o(E5))||(yield uje()),$o(E5)})}function uje(){return Ci(this,null,function*(){let{subtle:t}=window.crypto,e=yield t.generateKey(oje,!1,["sign"]),r=yield t.exportKey("jwk",e.publicKey);yield Tl(Tse,e.privateKey),yield Tl(E5,r)})}function DY(t){return Cse(fje(t))}function lje(t){return new TextEncoder().encode(t)}function Cse(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function fje(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function dje(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),Cse(e)}var qk="ds",Hk="ek",zk="iv",Vk="AES-GCM",hje=256;function Gk(){return Ci(this,null,function*(){let t=[];yield Pse((e,r,n)=>{r.startsWith(`${qk}_`)&&t.push(r)});for(let e of t)yield gO(e)})}function Nse(t){let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return window.btoa(e)}function Dse(t){let e=window.atob(t),r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}function pje(){return Ci(this,null,function*(){if(!yO()){console.info("webcrypto is not supported");return}let{crypto:t}=window;return(yield $o(zk))||t.getRandomValues(new Uint8Array(12))})}function gje(){return Ci(this,null,function*(){if(!yO()){console.info("webcrypto is not supported");return}let{subtle:t}=window.crypto;return(yield $o(Hk))||(yield t.generateKey({name:Vk,length:hje},!1,["encrypt","decrypt"]))})}function yje(t,e){return Ci(this,null,function*(){let r=yield pje(),n=yield gje();if(!r||!n||!t)return;let i=Dse(t),{subtle:a}=window.crypto,o=yield a.encrypt({name:Vk,iv:r},n,i),s=Nse(o);yield Tl(`${qk}_${e}`,s),yield Tl(Hk,n),yield Tl(zk,r)})}function mje(t){return Ci(this,null,function*(){let e=yield $o(`${qk}_${t}`),r=yield $o(zk),n=yield $o(Hk);if(!r||!e||!n||!yO())return;let{subtle:i}=window.crypto,a=yield i.decrypt({name:Vk,iv:r},n,Dse(e));return Nse(a)})}var vje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(e){let r=an(this.sdk.testMode?vr.GetIdTokenTestMode:vr.GetIdToken,[e]);return this.request(r)}generateIdToken(e){let r=an(this.sdk.testMode?vr.GenerateIdTokenTestMode:vr.GenerateIdToken,[e]);return this.request(r)}getInfo(){return Ci(this,null,function*(){let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}isLoggedIn(){let e=an(this.sdk.testMode?vr.IsLoggedInTestMode:vr.IsLoggedIn);return this.request(e)}logout(){gO(this.localForageKey),Gk();let e=an(this.sdk.testMode?vr.LogoutTestMode:vr.Logout);return this.request(e)}requestInfoWithUI(e){let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}showSettings(e){let r=an(this.sdk.testMode?vr.UserSettingsTestMode:vr.UserSettings,[e]);return this.request(r)}recoverAccount(e){let r=an(this.sdk.testMode?vr.RecoverAccountTestMode:vr.RecoverAccount,[e]);return this.request(r)}getMetadata(){mg({method:"user.getMetadata()",removalVersions:vg,useInstead:"user.getInfo()"}).log();let e=an(this.sdk.testMode?vr.GetMetadataTestMode:vr.GetMetadata);return this.request(e)}updateEmail(e){mg({method:"user.updateEmail()",removalVersions:vg,useInstead:"auth.updateEmailWithUI()"}).log();let{email:r,showUI:n=!0}=e,i=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:r,showUI:n}]);return this.request(i)}};function QA(t,e){return e?new URL(t,e):new URL(t)}var bje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=jk((r,n)=>Ci(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(_s.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(_s.MetaMask);r(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(_s.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(_s.CoinbaseWallet);r(c);return}let i=this.getUserEnv(),a=an(vr.Login,[i]),o=this.request(a);o.on(Hb.WalletSelected,c=>this.handleWalletSelected(gse(Lk({},c),{payloadId:a.id}))),o.on("id-token-created",c=>{e.emit("id-token-created",c)});let s=yield o;s.error&&n(s),r(s)}catch(i){n(i)}}));return e}showUI(){return this.request(an(vr.ShowUI))}showAddress(){return this.request(an(vr.ShowAddress))}showSendTokensUI(){return this.request(an(vr.ShowSendTokensUI))}showOnRamp(){return this.request(an(vr.ShowOnRamp))}showNFTs(){return this.request(an(vr.ShowNFTs))}showBalances(){return this.request(an(vr.ShowBalances))}sendGaslessTransaction(e,r){return this.request(an(vr.SendGaslessTransaction,[e,r]))}getInfo(){return Ci(this,null,function*(){mg({method:"wallet.getInfo()",removalVersions:vg,useInstead:"user.getInfo()"}).log();let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}disconnect(){mg({method:"wallet.disconnect()",removalVersions:vg,useInstead:"user.logout()"}).log(),gO(this.localForageKey),Gk();let e=an(vr.Disconnect);return this.request(e)}requestUserInfoWithUI(e){mg({method:"wallet.requestUserInfoWithUI()",removalVersions:vg,useInstead:"user.requestUserInfoWithUI()"}).log();let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}getProvider(){return Ci(this,null,function*(){switch(yield $o(this.localForageKey)){case _s.MetaMask:return this.getMetaMaskProvider();case _s.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case _s.MetaMask:return this.connectToMetaMask();case _s.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let r=an("mc_is_wallet_enabled",[{wallet:e}]);return this.request(r)}handleWalletSelected(e){return Ci(this,null,function*(){try{let r=yield this.connectToThirdPartyWallet(e.wallet);yield Tl(this.localForageKey,e.wallet),this.createIntermediaryEvent(Hb.WalletConnected,e.payloadId)(r)}catch(r){console.error(r),this.createIntermediaryEvent(Hb.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return Ci(this,null,function*(){let r;e===_s.MetaMask&&(r=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===_s.CoinbaseWallet&&(r=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield Tl(this.localForageKey,e);let n=an(vr.AutoConnect,[{wallet:e,address:r}]);return this.request(n)})}},{createBoundEmitterMethod:AE,createChainingEmitterMethod:m0}=xse(),wje=class extends Np{constructor(){super(...arguments),this.isMagic=!0,this.on=m0("on",this),this.once=m0("once",this),this.addListener=m0("addListener",this),this.off=m0("off",this),this.removeListener=m0("removeListener",this),this.removeAllListeners=m0("removeAllListeners",this),this.emit=AE("emit"),this.eventNames=AE("eventNames"),this.listeners=AE("listeners"),this.listenerCount=AE("listenerCount")}sendAsync(t,e){if(!e)throw HFe({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(P1.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=YA(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>gse(Lk({},n.payload),{error:n.hasError?new R1(n.payload.error):null})))});else{let r=YA(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(P1.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new R1(n.payload.error):null,n.payload)})}}send(t,e){if(typeof t=="string"){let n=an(t,Array.isArray(e)?e:[]);return this.request(n)}if(Array.isArray(t)||e){this.sendAsync(t,e);return}let r=VFe();return r.log(),new Fk(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=an(vr.Login);return this.request(t)}request(t){return this.prefixPayloadMethodForTestMode(t),super.request(t)}prefixPayloadMethodForTestMode(t){let e="testMode/eth/";this.sdk.testMode&&(t.method=`${e}${t.method}`)}},$Y=["request","overlay","sdk"];function _je(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==Np.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var $se=class extends Np{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:jk,isPromiEvent:Sse,encodeJSON:mse,decodeJSON:DFe,createJsonRpcRequestPayload:an,standardizeJsonRpcRequestPayload:YA,storage:Ise};let t=[this,..._je(this)];$Y.forEach(e=>{let r=t.map(o=>Object.getOwnPropertyDescriptor(o,e)),n=r.findIndex(o=>!!o),i=n>0,a=r[n];a&&(this.__sdk_access_field_descriptors__.set(e,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,e,{configurable:!0,get:()=>{throw jFe(e)}}))})}init(t){this.__is_initialized__||($Y.forEach(e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,r)}}),this.sdk=t,this.__is_initialized__=!0)}createDeprecationWarning(t){let{method:e,removalVersion:r,useInstead:n}=t,i=n?` Use \`${n}\` instead.`:"",a=`\`${e}\` will be removed from this Extension in version \`${r}\`.${i}`;return new _5(this,"DEPRECATION_NOTICE",a)}createWarning(t,e){return new _5(this,t,e)}createError(t,e,r){return new Bk(this,t,e,r)}},Eje=class extends $se{},Xh=class extends $se{};Xh.Internal=Eje,Xh.Anonymous="anonymous extension";var xje=class extends Np{purchase(t){let e=an(vr.NFTPurchase,[t]);return this.request(e)}checkout(t){let e=an(vr.NFTCheckout,[t]);return this.request(e)}transfer(t){let e=an(vr.NFTTransfer,[t]);return this.request(e)}};function MY(t){return t.compat&&t.compat[zn.sdkName]!=null?typeof t.compat[zn.sdkName]=="string"?AFe(PFe(zn.version),t.compat[zn.sdkName]):!!t.compat[zn.sdkName]:!0}function Aje(t,e,r){return!e&&!r?`${t}_eth_mainnet`:r?`${t}_${JSON.stringify(r)}`:e?typeof e=="string"?`${t}_eth_${e}`:`${t}_${e.rpcUrl}_${e.chainId}_${e.chainType}`:`${t}_unknown`}function Sje(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(a=>{MY(a)?(a.init(this),(a.name||a.name!==Xh.Anonymous)&&(this[a.name]=a),a instanceof Xh.Internal&&(KA(a.config)||(n[a.name]=a.config))):i.push(a)}):Object.keys(r).forEach(a=>{if(MY(r[a])){r[a].init(this);let o=r[a];this[a]=o,o instanceof Xh.Internal&&(KA(o.config)||(n[r[a].name]=o.config))}else i.push(r[a])}),i.length)throw qFe(i);return n}var Ix=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw BFe();zn.platform==="react-native"&&(e!=null&&e.endpoint)&&GFe().log();let{defaultEndpoint:n,version:i}=zn;this.testMode=!!(e!=null&&e.testMode),this.endpoint=QA((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.auth=new ZFe(this),this.user=new vje(this),this.wallet=new bje(this),this.nft=new xje(this),this.rpcProvider=new wje(this);let a=Sje.call(this,e);this.parameters=mse(Lk({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:QA(this.endpoint).host,sdk:UFe[zn.sdkName],version:i,ext:KA(a)?void 0:a,locale:(e==null?void 0:e.locale)||"en_US"},zn.bundleId?{bundleId:zn.bundleId}:{})),this.networkHash=Aje(this.apiKey,e==null?void 0:e.network,KA(a)?void 0:a),e!=null&&e.deferPreload||this.preload()}get overlay(){if(!Ix.__overlays__.has(this.parameters)){let t=new zn.ViewController(this.endpoint,this.parameters,this.networkHash);t.init(),Ix.__overlays__.set(this.parameters,t)}return Ix.__overlays__.get(this.parameters)}preload(){return Ci(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Mse=Ix;Mse.__overlays__=new Map;function Oje(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function Ije(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=Oje(t,n);if(n&&i){let a=new Fk(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:a}}return{}}function Pje(t,e,r){return Ci(this,null,function*(){var n;let i=yield $o("rt"),a;if(zn.platform==="web")try{a=(n=yield $o("jwt"))!=null?n:yield sje()}catch(c){console.error("webcrypto error",c)}let o={msgType:t,payload:e};a&&(o.jwt=a),a&&i&&(o.rt=i);let s=yield mje(r);return s&&(o.deviceShare=s),o})}function Tje(t){return Ci(this,null,function*(){!t.data.rt||(yield Tl("rt",t.data.rt))})}var Rje=class{constructor(t,e,r){this.endpoint=t,this.parameters=e,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(t,e){return Ci(this,null,function*(){return Ose((r,n)=>Ci(this,null,function*(){if(!this.isConnectedToInternet){let u=bse();n(u)}this.isReadyForRequest||(yield this.waitForReady());let i=[],a=Array.isArray(e)?e.map(u=>u.id):[],o=yield Pje(`${t}-${this.parameters}`,e,this.networkHash);yield this._post(o);let s=u=>f=>{var d;let{id:g,response:m}=Ije(e,f);if(Tje(f),((d=m==null?void 0:m.payload.error)==null?void 0:d.message)==="User denied account access.")Gk();else if(f.data.deviceShare){let{deviceShare:w}=f.data;yje(w,this.networkHash)}g&&m&&Array.isArray(e)&&a.includes(g)?(i.push(m),i.length===e.length&&(u(),r(i))):g&&m&&!Array.isArray(e)&&g===e.id&&(u(),r(m))},c=this.on(Ah.MAGIC_HANDLE_RESPONSE,s(()=>c()))}))})}on(t,e){let r=e.bind(window),n=i=>{i.data.msgType===`${t}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(t=>{let e=this.on(Ah.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,t(),e()})})}listen(){this.on(Ah.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Ah.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Cje=Object.create,kse=Object.defineProperty,Nje=Object.getOwnPropertyDescriptor,Dje=Object.getOwnPropertyNames,$je=Object.getPrototypeOf,Mje=Object.prototype.hasOwnProperty,SE=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Lse=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kje=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Dje(e))!Mje.call(t,i)&&i!==r&&kse(t,i,{get:()=>e[i],enumerable:!(n=Nje(e,i))||n.enumerable});return t},Use=(t,e,r)=>(r=t!=null?Cje($je(t)):{},kje(e||!t||!t.__esModule?kse(r,"default",{value:t,enumerable:!0}):r,t)),Px=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),Lje=Lse((t,e)=>{(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){return function r(n,i,a){function o(u,f){if(!i[u]){if(!n[u]){var d=typeof SE=="function"&&SE;if(!f&&d)return d(u,!0);if(s)return s(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var m=i[u]={exports:{}};n[u][0].call(m.exports,function(w){var v=n[u][1][w];return o(v||w)},m,m.exports,r,n,i,a)}return i[u].exports}for(var s=typeof SE=="function"&&SE,c=0;c<a.length;c++)o(a[c]);return o}({1:[function(r,n,i){(function(a){var o=a.MutationObserver||a.WebKitMutationObserver,s;if(o){var c=0,u=new o(w),f=a.document.createTextNode("");u.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var d=new a.MessageChannel;d.port1.onmessage=w,s=function(){d.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?s=function(){var y=a.document.createElement("script");y.onreadystatechange=function(){w(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},a.document.documentElement.appendChild(y)}:s=function(){setTimeout(w,0)};var g,m=[];function w(){g=!0;for(var y,_,b=m.length;b;){for(_=m,m=[],y=-1;++y<b;)_[y]();b=m.length}g=!1}n.exports=v;function v(y){m.push(y)===1&&!g&&s()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var a=r(1);function o(){}var s={},c=["REJECTED"],u=["FULFILLED"],f=["PENDING"];n.exports=d;function d(O){if(typeof O!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,O!==o&&v(this,O)}d.prototype.catch=function(O){return this.then(null,O)},d.prototype.then=function(O,E){if(typeof O!="function"&&this.state===u||typeof E!="function"&&this.state===c)return this;var p=new this.constructor(o);if(this.state!==f){var I=this.state===u?O:E;m(p,I,this.outcome)}else this.queue.push(new g(p,O,E));return p};function g(O,E,p){this.promise=O,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof p=="function"&&(this.onRejected=p,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(O){s.resolve(this.promise,O)},g.prototype.otherCallFulfilled=function(O){m(this.promise,this.onFulfilled,O)},g.prototype.callRejected=function(O){s.reject(this.promise,O)},g.prototype.otherCallRejected=function(O){m(this.promise,this.onRejected,O)};function m(O,E,p){a(function(){var I;try{I=E(p)}catch(C){return s.reject(O,C)}I===O?s.reject(O,new TypeError("Cannot resolve promise with itself")):s.resolve(O,I)})}s.resolve=function(O,E){var p=y(w,E);if(p.status==="error")return s.reject(O,p.value);var I=p.value;if(I)v(O,I);else{O.state=u,O.outcome=E;for(var C=-1,L=O.queue.length;++C<L;)O.queue[C].callFulfilled(E)}return O},s.reject=function(O,E){O.state=c,O.outcome=E;for(var p=-1,I=O.queue.length;++p<I;)O.queue[p].callRejected(E);return O};function w(O){var E=O&&O.then;if(O&&(typeof O=="object"||typeof O=="function")&&typeof E=="function")return function(){E.apply(O,arguments)}}function v(O,E){var p=!1;function I(le){p||(p=!0,s.reject(O,le))}function C(le){p||(p=!0,s.resolve(O,le))}function L(){E(C,I)}var q=y(L);q.status==="error"&&I(q.value)}function y(O,E){var p={};try{p.value=O(E),p.status="success"}catch(I){p.status="error",p.value=I}return p}d.resolve=_;function _(O){return O instanceof this?O:s.resolve(new this(o),O)}d.reject=b;function b(O){var E=new this(o);return s.reject(E,O)}d.all=S;function S(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=new Array(p),L=0,q=-1,le=new this(o);++q<p;)pe(O[q],q);return le;function pe(B,U){E.resolve(B).then(K,function(ne){I||(I=!0,s.reject(le,ne))});function K(ne){C[U]=ne,++L===p&&!I&&(I=!0,s.resolve(le,C))}}}d.race=x;function x(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=-1,L=new this(o);++C<p;)q(O[C]);return L;function q(le){E.resolve(le).then(function(pe){I||(I=!0,s.resolve(L,pe))},function(pe){I||(I=!0,s.reject(L,pe))})}}},{1:1}],3:[function(r,n,i){(function(a){typeof a.Promise!="function"&&(a.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X};function o(X,me){if(!(X instanceof me))throw new TypeError("Cannot call a class as a function")}function s(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=s();function u(){try{if(!c||!c.open)return!1;var X=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),me=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!X||me)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(X,me){X=X||[],me=me||{};try{return new Blob(X,me)}catch(Oe){if(Oe.name!=="TypeError")throw Oe;for(var re=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,Ee=new re,be=0;be<X.length;be+=1)Ee.append(X[be]);return Ee.getBlob(me.type)}}typeof Promise>"u"&&r(3);var d=Promise;function g(X,me){me&&X.then(function(re){me(null,re)},function(re){me(re)})}function m(X,me,re){typeof me=="function"&&X.then(me),typeof re=="function"&&X.catch(re)}function w(X){return typeof X!="string"&&(console.warn(X+" used as a key, but it is not a string."),X=String(X)),X}function v(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var y="local-forage-detect-blob-support",_=void 0,b={},S=Object.prototype.toString,x="readonly",O="readwrite";function E(X){for(var me=X.length,re=new ArrayBuffer(me),Ee=new Uint8Array(re),be=0;be<me;be++)Ee[be]=X.charCodeAt(be);return re}function p(X){return new d(function(me){var re=X.transaction(y,O),Ee=f([""]);re.objectStore(y).put(Ee,"key"),re.onabort=function(be){be.preventDefault(),be.stopPropagation(),me(!1)},re.oncomplete=function(){var be=navigator.userAgent.match(/Chrome\/(\d+)/),Oe=navigator.userAgent.match(/Edge\//);me(Oe||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function I(X){return typeof _=="boolean"?d.resolve(_):p(X).then(function(me){return _=me,_})}function C(X){var me=b[X.name],re={};re.promise=new d(function(Ee,be){re.resolve=Ee,re.reject=be}),me.deferredOperations.push(re),me.dbReady?me.dbReady=me.dbReady.then(function(){return re.promise}):me.dbReady=re.promise}function L(X){var me=b[X.name],re=me.deferredOperations.pop();if(re)return re.resolve(),re.promise}function q(X,me){var re=b[X.name],Ee=re.deferredOperations.pop();if(Ee)return Ee.reject(me),Ee.promise}function le(X,me){return new d(function(re,Ee){if(b[X.name]=b[X.name]||H(),X.db)if(me)C(X),X.db.close();else return re(X.db);var be=[X.name];me&&be.push(X.version);var Oe=c.open.apply(c,be);me&&(Oe.onupgradeneeded=function(Qe){var ft=Oe.result;try{ft.createObjectStore(X.storeName),Qe.oldVersion<=1&&ft.createObjectStore(y)}catch(Ye){if(Ye.name==="ConstraintError")console.warn('The database "'+X.name+'" has been upgraded from version '+Qe.oldVersion+" to version "+Qe.newVersion+', but the storage "'+X.storeName+'" already exists.');else throw Ye}}),Oe.onerror=function(Qe){Qe.preventDefault(),Ee(Oe.error)},Oe.onsuccess=function(){var Qe=Oe.result;Qe.onversionchange=function(ft){ft.target.close()},re(Qe),L(X)}})}function pe(X){return le(X,!1)}function B(X){return le(X,!0)}function U(X,me){if(!X.db)return!0;var re=!X.db.objectStoreNames.contains(X.storeName),Ee=X.version<X.db.version,be=X.version>X.db.version;if(Ee&&(X.version!==me&&console.warn('The database "'+X.name+`" can't be downgraded from version `+X.db.version+" to version "+X.version+"."),X.version=X.db.version),be||re){if(re){var Oe=X.db.version+1;Oe>X.version&&(X.version=Oe)}return!0}return!1}function K(X){return new d(function(me,re){var Ee=new FileReader;Ee.onerror=re,Ee.onloadend=function(be){var Oe=btoa(be.target.result||"");me({__local_forage_encoded_blob:!0,data:Oe,type:X.type})},Ee.readAsBinaryString(X)})}function ne(X){var me=E(atob(X.data));return f([me],{type:X.type})}function F(X){return X&&X.__local_forage_encoded_blob}function j(X){var me=this,re=me._initReady().then(function(){var Ee=b[me._dbInfo.name];if(Ee&&Ee.dbReady)return Ee.dbReady});return m(re,X,X),re}function z(X){C(X);for(var me=b[X.name],re=me.forages,Ee=0;Ee<re.length;Ee++){var be=re[Ee];be._dbInfo.db&&(be._dbInfo.db.close(),be._dbInfo.db=null)}return X.db=null,pe(X).then(function(Oe){return X.db=Oe,U(X)?B(X):Oe}).then(function(Oe){X.db=me.db=Oe;for(var Qe=0;Qe<re.length;Qe++)re[Qe]._dbInfo.db=Oe}).catch(function(Oe){throw q(X,Oe),Oe})}function $(X,me,re,Ee){Ee===void 0&&(Ee=1);try{var be=X.db.transaction(X.storeName,me);re(null,be)}catch(Oe){if(Ee>0&&(!X.db||Oe.name==="InvalidStateError"||Oe.name==="NotFoundError"))return d.resolve().then(function(){if(!X.db||Oe.name==="NotFoundError"&&!X.db.objectStoreNames.contains(X.storeName)&&X.version<=X.db.version)return X.db&&(X.version=X.db.version+1),B(X)}).then(function(){return z(X).then(function(){$(X,me,re,Ee-1)})}).catch(re);re(Oe)}}function H(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function k(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=X[Ee];var be=b[re.name];be||(be=H(),b[re.name]=be),be.forages.push(me),me._initReady||(me._initReady=me.ready,me.ready=j);var Oe=[];function Qe(){return d.resolve()}for(var ft=0;ft<be.forages.length;ft++){var Ye=be.forages[ft];Ye!==me&&Oe.push(Ye._initReady().catch(Qe))}var Ve=be.forages.slice(0);return d.all(Oe).then(function(){return re.db=be.db,pe(re)}).then(function(ht){return re.db=ht,U(re,me._defaultConfig.version)?B(re):ht}).then(function(ht){re.db=be.db=ht,me._dbInfo=re;for(var Vt=0;Vt<Ve.length;Vt++){var Tr=Ve[Vt];Tr!==me&&(Tr._dbInfo.db=re.db,Tr._dbInfo.version=re.version)}})}function M(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=Ye.get(X);Ve.onsuccess=function(){var ht=Ve.result;ht===void 0&&(ht=null),F(ht)&&(ht=ne(ht)),be(ht)},Ve.onerror=function(){Oe(Ve.error)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function G(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=Ye.openCursor(),ht=1;Ve.onsuccess=function(){var Vt=Ve.result;if(Vt){var Tr=Vt.value;F(Tr)&&(Tr=ne(Tr));var Wr=X(Tr,Vt.key,ht++);Wr!==void 0?be(Wr):Vt.continue()}else be()},Ve.onerror=function(){Oe(Ve.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function ge(X,me,re){var Ee=this;X=w(X);var be=new d(function(Oe,Qe){var ft;Ee.ready().then(function(){return ft=Ee._dbInfo,S.call(me)==="[object Blob]"?I(ft.db).then(function(Ye){return Ye?me:K(me)}):me}).then(function(Ye){$(Ee._dbInfo,O,function(Ve,ht){if(Ve)return Qe(Ve);try{var Vt=ht.objectStore(Ee._dbInfo.storeName);Ye===null&&(Ye=void 0);var Tr=Vt.put(Ye,X);ht.oncomplete=function(){Ye===void 0&&(Ye=null),Oe(Ye)},ht.onabort=ht.onerror=function(){var Wr=Tr.error?Tr.error:Tr.transaction.error;Qe(Wr)}}catch(Wr){Qe(Wr)}})}).catch(Qe)});return g(be,re),be}function Q(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,O,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=Ye.delete(X);ft.oncomplete=function(){be()},ft.onerror=function(){Oe(Ve.error)},ft.onabort=function(){var ht=Ve.error?Ve.error:Ve.transaction.error;Oe(ht)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function te(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,O,function(Oe,Qe){if(Oe)return be(Oe);try{var ft=Qe.objectStore(me._dbInfo.storeName),Ye=ft.clear();Qe.oncomplete=function(){Ee()},Qe.onabort=Qe.onerror=function(){var Ve=Ye.error?Ye.error:Ye.transaction.error;be(Ve)}}catch(Ve){be(Ve)}})}).catch(be)});return g(re,X),re}function ce(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Qe){if(Oe)return be(Oe);try{var ft=Qe.objectStore(me._dbInfo.storeName),Ye=ft.count();Ye.onsuccess=function(){Ee(Ye.result)},Ye.onerror=function(){be(Ye.error)}}catch(Ve){be(Ve)}})}).catch(be)});return g(re,X),re}function T(X,me){var re=this,Ee=new d(function(be,Oe){if(X<0){be(null);return}re.ready().then(function(){$(re._dbInfo,x,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=!1,ht=Ye.openKeyCursor();ht.onsuccess=function(){var Vt=ht.result;if(!Vt){be(null);return}X===0||Ve?be(Vt.key):(Ve=!0,Vt.advance(X))},ht.onerror=function(){Oe(ht.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function fe(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Qe){if(Oe)return be(Oe);try{var ft=Qe.objectStore(me._dbInfo.storeName),Ye=ft.openKeyCursor(),Ve=[];Ye.onsuccess=function(){var ht=Ye.result;if(!ht){Ee(Ve);return}Ve.push(ht.key),ht.continue()},Ye.onerror=function(){be(Ye.error)}}catch(ht){be(ht)}})}).catch(be)});return g(re,X),re}function ze(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;if(!X.name)be=d.reject("Invalid arguments");else{var Oe=X.name===re.name&&Ee._dbInfo.db,Qe=Oe?d.resolve(Ee._dbInfo.db):pe(X).then(function(ft){var Ye=b[X.name],Ve=Ye.forages;Ye.db=ft;for(var ht=0;ht<Ve.length;ht++)Ve[ht]._dbInfo.db=ft;return ft});X.storeName?be=Qe.then(function(ft){if(ft.objectStoreNames.contains(X.storeName)){var Ye=ft.version+1;C(X);var Ve=b[X.name],ht=Ve.forages;ft.close();for(var Vt=0;Vt<ht.length;Vt++){var Tr=ht[Vt];Tr._dbInfo.db=null,Tr._dbInfo.version=Ye}var Wr=new d(function(Fr,_n){var jr=c.open(X.name,Ye);jr.onerror=function(P){var D=jr.result;D.close(),_n(P)},jr.onupgradeneeded=function(){var P=jr.result;P.deleteObjectStore(X.storeName)},jr.onsuccess=function(){var P=jr.result;P.close(),Fr(P)}});return Wr.then(function(Fr){Ve.db=Fr;for(var _n=0;_n<ht.length;_n++){var jr=ht[_n];jr._dbInfo.db=Fr,L(jr._dbInfo)}}).catch(function(Fr){throw(q(X,Fr)||d.resolve()).catch(function(){}),Fr})}}):be=Qe.then(function(ft){C(X);var Ye=b[X.name],Ve=Ye.forages;ft.close();for(var ht=0;ht<Ve.length;ht++){var Vt=Ve[ht];Vt._dbInfo.db=null}var Tr=new d(function(Wr,Fr){var _n=c.deleteDatabase(X.name);_n.onerror=function(){var jr=_n.result;jr&&jr.close(),Fr(_n.error)},_n.onblocked=function(){console.warn('dropInstance blocked for database "'+X.name+'" until all open connections are closed')},_n.onsuccess=function(){var jr=_n.result;jr&&jr.close(),Wr(jr)}});return Tr.then(function(Wr){Ye.db=Wr;for(var Fr=0;Fr<Ve.length;Fr++){var _n=Ve[Fr];L(_n._dbInfo)}}).catch(function(Wr){throw(q(X,Wr)||d.resolve()).catch(function(){}),Wr})})}return g(be,me),be}var tt={_driver:"asyncStorage",_initStorage:k,_support:u(),iterate:G,getItem:M,setItem:ge,removeItem:Q,clear:te,length:ce,key:T,keys:fe,dropInstance:ze};function mt(){return typeof openDatabase=="function"}var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="~~local_forage_type~",Lt=/^~~local_forage_type~([^~]+)~/,Yt="__lfsc__:",wr=Yt.length,Rt="arbf",Pt="blob",kt="si08",Nt="ui08",Kt="uic8",Ut="si16",zt="si32",$t="ur16",Dt="ui32",qt="fl32",Mt="fl64",cr=wr+Rt.length,tr=Object.prototype.toString;function ir(X){var me=X.length*.75,re=X.length,Ee,be=0,Oe,Qe,ft,Ye;X[X.length-1]==="="&&(me--,X[X.length-2]==="="&&me--);var Ve=new ArrayBuffer(me),ht=new Uint8Array(Ve);for(Ee=0;Ee<re;Ee+=4)Oe=vt.indexOf(X[Ee]),Qe=vt.indexOf(X[Ee+1]),ft=vt.indexOf(X[Ee+2]),Ye=vt.indexOf(X[Ee+3]),ht[be++]=Oe<<2|Qe>>4,ht[be++]=(Qe&15)<<4|ft>>2,ht[be++]=(ft&3)<<6|Ye&63;return Ve}function nr(X){var me=new Uint8Array(X),re="",Ee;for(Ee=0;Ee<me.length;Ee+=3)re+=vt[me[Ee]>>2],re+=vt[(me[Ee]&3)<<4|me[Ee+1]>>4],re+=vt[(me[Ee+1]&15)<<2|me[Ee+2]>>6],re+=vt[me[Ee+2]&63];return me.length%3===2?re=re.substring(0,re.length-1)+"=":me.length%3===1&&(re=re.substring(0,re.length-2)+"=="),re}function mr(X,me){var re="";if(X&&(re=tr.call(X)),X&&(re==="[object ArrayBuffer]"||X.buffer&&tr.call(X.buffer)==="[object ArrayBuffer]")){var Ee,be=Yt;X instanceof ArrayBuffer?(Ee=X,be+=Rt):(Ee=X.buffer,re==="[object Int8Array]"?be+=kt:re==="[object Uint8Array]"?be+=Nt:re==="[object Uint8ClampedArray]"?be+=Kt:re==="[object Int16Array]"?be+=Ut:re==="[object Uint16Array]"?be+=$t:re==="[object Int32Array]"?be+=zt:re==="[object Uint32Array]"?be+=Dt:re==="[object Float32Array]"?be+=qt:re==="[object Float64Array]"?be+=Mt:me(new Error("Failed to get type for BinaryArray"))),me(be+nr(Ee))}else if(re==="[object Blob]"){var Oe=new FileReader;Oe.onload=function(){var Qe=gt+X.type+"~"+nr(this.result);me(Yt+Pt+Qe)},Oe.readAsArrayBuffer(X)}else try{me(JSON.stringify(X))}catch(Qe){console.error("Couldn't convert value into a JSON string: ",X),me(null,Qe)}}function wn(X){if(X.substring(0,wr)!==Yt)return JSON.parse(X);var me=X.substring(cr),re=X.substring(wr,cr),Ee;if(re===Pt&&Lt.test(me)){var be=me.match(Lt);Ee=be[1],me=me.substring(be[0].length)}var Oe=ir(me);switch(re){case Rt:return Oe;case Pt:return f([Oe],{type:Ee});case kt:return new Int8Array(Oe);case Nt:return new Uint8Array(Oe);case Kt:return new Uint8ClampedArray(Oe);case Ut:return new Int16Array(Oe);case $t:return new Uint16Array(Oe);case zt:return new Int32Array(Oe);case Dt:return new Uint32Array(Oe);case qt:return new Float32Array(Oe);case Mt:return new Float64Array(Oe);default:throw new Error("Unkown type: "+re)}}var Yr={serialize:mr,deserialize:wn,stringToBuffer:ir,bufferToString:nr};function ai(X,me,re,Ee){X.executeSql("CREATE TABLE IF NOT EXISTS "+me.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],re,Ee)}function Dn(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=typeof X[Ee]!="string"?X[Ee].toString():X[Ee];var be=new d(function(Oe,Qe){try{re.db=openDatabase(re.name,String(re.version),re.description,re.size)}catch(ft){return Qe(ft)}re.db.transaction(function(ft){ai(ft,re,function(){me._dbInfo=re,Oe()},function(Ye,Ve){Qe(Ve)})},Qe)});return re.serializer=Yr,be}function $n(X,me,re,Ee,be,Oe){X.executeSql(re,Ee,be,function(Qe,ft){ft.code===ft.SYNTAX_ERR?Qe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(Ye,Ve){Ve.rows.length?Oe(Ye,ft):ai(Ye,me,function(){Ye.executeSql(re,Ee,be,Oe)},Oe)},Oe):Oe(Qe,ft)},Oe)}function Kn(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"SELECT * FROM "+Qe.storeName+" WHERE key = ? LIMIT 1",[X],function(Ye,Ve){var ht=Ve.rows.length?Ve.rows.item(0).value:null;ht&&(ht=Qe.serializer.deserialize(ht)),be(ht)},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function xr(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"SELECT * FROM "+Qe.storeName,[],function(Ye,Ve){for(var ht=Ve.rows,Vt=ht.length,Tr=0;Tr<Vt;Tr++){var Wr=ht.item(Tr),Fr=Wr.value;if(Fr&&(Fr=Qe.serializer.deserialize(Fr)),Fr=X(Fr,Wr.key,Tr+1),Fr!==void 0){be(Fr);return}}be()},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function $r(X,me,re,Ee){var be=this;X=w(X);var Oe=new d(function(Qe,ft){be.ready().then(function(){me===void 0&&(me=null);var Ye=me,Ve=be._dbInfo;Ve.serializer.serialize(me,function(ht,Vt){Vt?ft(Vt):Ve.db.transaction(function(Tr){$n(Tr,Ve,"INSERT OR REPLACE INTO "+Ve.storeName+" (key, value) VALUES (?, ?)",[X,ht],function(){Qe(Ye)},function(Wr,Fr){ft(Fr)})},function(Tr){if(Tr.code===Tr.QUOTA_ERR){if(Ee>0){Qe($r.apply(be,[X,Ye,re,Ee-1]));return}ft(Tr)}})})}).catch(ft)});return g(Oe,re),Oe}function _r(X,me,re){return $r.apply(this,[X,me,re,1])}function _e(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"DELETE FROM "+Qe.storeName+" WHERE key = ?",[X],function(){be()},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function ee(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Qe){$n(Qe,Oe,"DELETE FROM "+Oe.storeName,[],function(){Ee()},function(ft,Ye){be(Ye)})})}).catch(be)});return g(re,X),re}function ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Qe){$n(Qe,Oe,"SELECT COUNT(key) as c FROM "+Oe.storeName,[],function(ft,Ye){var Ve=Ye.rows.item(0).c;Ee(Ve)},function(ft,Ye){be(Ye)})})}).catch(be)});return g(re,X),re}function Re(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"SELECT key FROM "+Qe.storeName+" WHERE id = ? LIMIT 1",[X+1],function(Ye,Ve){var ht=Ve.rows.length?Ve.rows.item(0).key:null;be(ht)},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function He(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Qe){$n(Qe,Oe,"SELECT key FROM "+Oe.storeName,[],function(ft,Ye){for(var Ve=[],ht=0;ht<Ye.rows.length;ht++)Ve.push(Ye.rows.item(ht).key);Ee(Ve)},function(ft,Ye){be(Ye)})})}).catch(be)});return g(re,X),re}function Xe(X){return new d(function(me,re){X.transaction(function(Ee){Ee.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(be,Oe){for(var Qe=[],ft=0;ft<Oe.rows.length;ft++)Qe.push(Oe.rows.item(ft).name);me({db:X,storeNames:Qe})},function(be,Oe){re(Oe)})},function(Ee){re(Ee)})})}function st(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;return X.name?be=new d(function(Oe){var Qe;X.name===re.name?Qe=Ee._dbInfo.db:Qe=openDatabase(X.name,"","",0),X.storeName?Oe({db:Qe,storeNames:[X.storeName]}):Oe(Xe(Qe))}).then(function(Oe){return new d(function(Qe,ft){Oe.db.transaction(function(Ye){function Ve(Wr){return new d(function(Fr,_n){Ye.executeSql("DROP TABLE IF EXISTS "+Wr,[],function(){Fr()},function(jr,P){_n(P)})})}for(var ht=[],Vt=0,Tr=Oe.storeNames.length;Vt<Tr;Vt++)ht.push(Ve(Oe.storeNames[Vt]));d.all(ht).then(function(){Qe()}).catch(function(Wr){ft(Wr)})},function(Ye){ft(Ye)})})}):be=d.reject("Invalid arguments"),g(be,me),be}var lt={_driver:"webSQLStorage",_initStorage:Dn,_support:mt(),iterate:xr,getItem:Kn,setItem:_r,removeItem:_e,clear:ee,length:ve,key:Re,keys:He,dropInstance:st};function _t(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ue(X,me){var re=X.name+"/";return X.storeName!==me.storeName&&(re+=X.storeName+"/"),re}function Z(){var X="_localforage_support_test";try{return localStorage.setItem(X,!0),localStorage.removeItem(X),!1}catch{return!0}}function ye(){return!Z()||localStorage.length>0}function Me(X){var me=this,re={};if(X)for(var Ee in X)re[Ee]=X[Ee];return re.keyPrefix=ue(X,me._defaultConfig),ye()?(me._dbInfo=re,re.serializer=Yr,d.resolve()):d.reject()}function Le(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo.keyPrefix,be=localStorage.length-1;be>=0;be--){var Oe=localStorage.key(be);Oe.indexOf(Ee)===0&&localStorage.removeItem(Oe)}});return g(re,X),re}function wt(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo,Oe=localStorage.getItem(be.keyPrefix+X);return Oe&&(Oe=be.serializer.deserialize(Oe)),Oe});return g(Ee,me),Ee}function Ot(X,me){var re=this,Ee=re.ready().then(function(){for(var be=re._dbInfo,Oe=be.keyPrefix,Qe=Oe.length,ft=localStorage.length,Ye=1,Ve=0;Ve<ft;Ve++){var ht=localStorage.key(Ve);if(ht.indexOf(Oe)===0){var Vt=localStorage.getItem(ht);if(Vt&&(Vt=be.serializer.deserialize(Vt)),Vt=X(Vt,ht.substring(Qe),Ye++),Vt!==void 0)return Vt}}});return g(Ee,me),Ee}function pr(X,me){var re=this,Ee=re.ready().then(function(){var be=re._dbInfo,Oe;try{Oe=localStorage.key(X)}catch{Oe=null}return Oe&&(Oe=Oe.substring(be.keyPrefix.length)),Oe});return g(Ee,me),Ee}function lr(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo,be=localStorage.length,Oe=[],Qe=0;Qe<be;Qe++){var ft=localStorage.key(Qe);ft.indexOf(Ee.keyPrefix)===0&&Oe.push(ft.substring(Ee.keyPrefix.length))}return Oe});return g(re,X),re}function en(X){var me=this,re=me.keys().then(function(Ee){return Ee.length});return g(re,X),re}function gr(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo;localStorage.removeItem(be.keyPrefix+X)});return g(Ee,me),Ee}function Er(X,me,re){var Ee=this;X=w(X);var be=Ee.ready().then(function(){me===void 0&&(me=null);var Oe=me;return new d(function(Qe,ft){var Ye=Ee._dbInfo;Ye.serializer.serialize(me,function(Ve,ht){if(ht)ft(ht);else try{localStorage.setItem(Ye.keyPrefix+X,Ve),Qe(Oe)}catch(Vt){(Vt.name==="QuotaExceededError"||Vt.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ft(Vt),ft(Vt)}})})});return g(be,re),be}function on(X,me){if(me=v.apply(this,arguments),X=typeof X!="function"&&X||{},!X.name){var re=this.config();X.name=X.name||re.name,X.storeName=X.storeName||re.storeName}var Ee=this,be;return X.name?be=new d(function(Oe){X.storeName?Oe(ue(X,Ee._defaultConfig)):Oe(X.name+"/")}).then(function(Oe){for(var Qe=localStorage.length-1;Qe>=0;Qe--){var ft=localStorage.key(Qe);ft.indexOf(Oe)===0&&localStorage.removeItem(ft)}}):be=d.reject("Invalid arguments"),g(be,me),be}var sr={_driver:"localStorageWrapper",_initStorage:Me,_support:_t(),iterate:Ot,getItem:wt,setItem:Er,removeItem:gr,clear:Le,length:en,key:pr,keys:lr,dropInstance:on},Lr=function(X,me){return X===me||typeof X=="number"&&typeof me=="number"&&isNaN(X)&&isNaN(me)},gn=function(X,me){for(var re=X.length,Ee=0;Ee<re;){if(Lr(X[Ee],me))return!0;Ee++}return!1},Ur=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"},Zn={},Si={},ei={INDEXEDDB:tt,WEBSQL:lt,LOCALSTORAGE:sr},Oi=[ei.INDEXEDDB._driver,ei.WEBSQL._driver,ei.LOCALSTORAGE._driver],Ii=["dropInstance"],oi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ii),Fn={description:"",driver:Oi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ra(X,me){X[me]=function(){var re=arguments;return X.ready().then(function(){return X[me].apply(X,re)})}}function $i(){for(var X=1;X<arguments.length;X++){var me=arguments[X];if(me)for(var re in me)me.hasOwnProperty(re)&&(Ur(me[re])?arguments[0][re]=me[re].slice():arguments[0][re]=me[re])}return arguments[0]}var _a=function(){function X(me){o(this,X);for(var re in ei)if(ei.hasOwnProperty(re)){var Ee=ei[re],be=Ee._driver;this[re]=be,Zn[be]||this.defineDriver(Ee)}this._defaultConfig=$i({},Fn),this._config=$i({},this._defaultConfig,me),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return X.prototype.config=function(me){if((typeof me>"u"?"undefined":a(me))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var re in me){if(re==="storeName"&&(me[re]=me[re].replace(/\W/g,"_")),re==="version"&&typeof me[re]!="number")return new Error("Database version must be a number.");this._config[re]=me[re]}return"driver"in me&&me.driver?this.setDriver(this._config.driver):!0}else return typeof me=="string"?this._config[me]:this._config},X.prototype.defineDriver=function(me,re,Ee){var be=new d(function(Oe,Qe){try{var ft=me._driver,Ye=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver){Qe(Ye);return}for(var Ve=oi.concat("_initStorage"),ht=0,Vt=Ve.length;ht<Vt;ht++){var Tr=Ve[ht],Wr=!gn(Ii,Tr);if((Wr||me[Tr])&&typeof me[Tr]!="function"){Qe(Ye);return}}var Fr=function(){for(var jr=function(he){return function(){var Se=new Error("Method "+he+" is not implemented by the current driver"),Ce=d.reject(Se);return g(Ce,arguments[arguments.length-1]),Ce}},P=0,D=Ii.length;P<D;P++){var W=Ii[P];me[W]||(me[W]=jr(W))}};Fr();var _n=function(jr){Zn[ft]&&console.info("Redefining LocalForage driver: "+ft),Zn[ft]=me,Si[ft]=jr,Oe()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(_n,Qe):_n(!!me._support):_n(!0)}catch(jr){Qe(jr)}});return m(be,re,Ee),be},X.prototype.driver=function(){return this._driver||null},X.prototype.getDriver=function(me,re,Ee){var be=Zn[me]?d.resolve(Zn[me]):d.reject(new Error("Driver not found."));return m(be,re,Ee),be},X.prototype.getSerializer=function(me){var re=d.resolve(Yr);return m(re,me),re},X.prototype.ready=function(me){var re=this,Ee=re._driverSet.then(function(){return re._ready===null&&(re._ready=re._initDriver()),re._ready});return m(Ee,me,me),Ee},X.prototype.setDriver=function(me,re,Ee){var be=this;Ur(me)||(me=[me]);var Oe=this._getSupportedDrivers(me);function Qe(){be._config.driver=be.driver()}function ft(ht){return be._extend(ht),Qe(),be._ready=be._initStorage(be._config),be._ready}function Ye(ht){return function(){var Vt=0;function Tr(){for(;Vt<ht.length;){var Wr=ht[Vt];return Vt++,be._dbInfo=null,be._ready=null,be.getDriver(Wr).then(ft).catch(Tr)}Qe();var Fr=new Error("No available storage method found.");return be._driverSet=d.reject(Fr),be._driverSet}return Tr()}}var Ve=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=Ve.then(function(){var ht=Oe[0];return be._dbInfo=null,be._ready=null,be.getDriver(ht).then(function(Vt){be._driver=Vt._driver,Qe(),be._wrapLibraryMethodsWithReady(),be._initDriver=Ye(Oe)})}).catch(function(){Qe();var ht=new Error("No available storage method found.");return be._driverSet=d.reject(ht),be._driverSet}),m(this._driverSet,re,Ee),this._driverSet},X.prototype.supports=function(me){return!!Si[me]},X.prototype._extend=function(me){$i(this,me)},X.prototype._getSupportedDrivers=function(me){for(var re=[],Ee=0,be=me.length;Ee<be;Ee++){var Oe=me[Ee];this.supports(Oe)&&re.push(Oe)}return re},X.prototype._wrapLibraryMethodsWithReady=function(){for(var me=0,re=oi.length;me<re;me++)ra(this,oi[me])},X.prototype.createInstance=function(me){return new X(me)},X}(),as=new _a;n.exports=as},{3:3}]},{},[4])(4)})}),Uje=Lse((t,e)=>{(function(r,n){typeof t=="object"&&typeof e<"u"?n(t):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],n):n(r.LocalforageDriverMemory={})})(typeof self<"u"?self:t,function(r){var n="localforage-driver-memory";function i(F){var j=typeof Symbol=="function"&&F[Symbol.iterator],z=0;return j?j.call(F):{next:function(){return F&&z>=F.length&&(F=void 0),{value:F&&F[z++],done:!F}}}}function a(F,j){F=F||[],j=j||{};try{return new Blob(F,j)}catch(k){if(k.name!=="TypeError")throw k;for(var z=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,$=new z,H=0;H<F.length;H+=1)$.append(F[H]);return $.getBlob(j.type)}}var o=/^~~local_forage_type~([^~]+)~/,s=9,c=s+4,u=Object.prototype.toString;function f(F){var j=F.length*.75,z=F.length;F[F.length-1]==="="&&(j--,F[F.length-2]==="="&&j--);for(var $=new ArrayBuffer(j),H=new Uint8Array($),k=0,M=0;k<z;k+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k]),ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+1]),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+2]),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+3]);H[M++]=G<<2|ge>>4,H[M++]=(ge&15)<<4|Q>>2,H[M++]=(Q&3)<<6|te&63}return $}function d(F){for(var j=new Uint8Array(F),z="",$=0;$<j.length;$+=3)z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$]>>2],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$]&3)<<4|j[$+1]>>4],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$+1]&15)<<2|j[$+2]>>6],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$+2]&63];return j.length%3===2?z=z.substring(0,z.length-1)+"=":j.length%3===1&&(z=z.substring(0,z.length-2)+"=="),z}function g(F,j){var z="";if(F&&(z=u.call(F)),F&&(z==="[object ArrayBuffer]"||F.buffer&&u.call(F.buffer)==="[object ArrayBuffer]")){var $=void 0,H="__lfsc__:";F instanceof ArrayBuffer?($=F,H+="arbf"):($=F.buffer,z==="[object Int8Array]"?H+="si08":z==="[object Uint8Array]"?H+="ui08":z==="[object Uint8ClampedArray]"?H+="uic8":z==="[object Int16Array]"?H+="si16":z==="[object Uint16Array]"?H+="ur16":z==="[object Int32Array]"?H+="si32":z==="[object Uint32Array]"?H+="ui32":z==="[object Float32Array]"?H+="fl32":z==="[object Float64Array]"?H+="fl64":j(new Error("Failed to get type for BinaryArray"))),j(H+d($))}else if(z==="[object Blob]"){var k=new FileReader;k.onload=function(){var M="~~local_forage_type~"+F.type+"~"+d(this.result);j("__lfsc__:blob"+M)},k.readAsArrayBuffer(F)}else try{j(JSON.stringify(F))}catch(M){console.error("Couldn't convert value into a JSON string: ",F),j(null,M)}}function m(F){if(F.substring(0,s)!=="__lfsc__:")return JSON.parse(F);var j=F.substring(c),z=F.substring(s,c),$;if(z==="blob"&&o.test(j)){var H=j.match(o);$=H[1],j=j.substring(H[0].length)}var k=f(j);switch(z){case"arbf":return k;case"blob":return a([k],{type:$});case"si08":return new Int8Array(k);case"ui08":return new Uint8Array(k);case"uic8":return new Uint8ClampedArray(k);case"si16":return new Int16Array(k);case"ur16":return new Uint16Array(k);case"si32":return new Int32Array(k);case"ui32":return new Uint32Array(k);case"fl32":return new Float32Array(k);case"fl64":return new Float64Array(k);default:throw new Error("Unkown type: "+z)}}function w(F){var j,z;if(F===null||typeof F!="object"||"isActiveClone"in F)return F;var $=F instanceof Date?new Date(F):F.constructor();try{for(var H=i(Object.keys(F)),k=H.next();!k.done;k=H.next()){var M=k.value;Object.prototype.hasOwnProperty.call(F,M)&&(F.isActiveClone=null,$[M]=w(F[M]),delete F.isActiveClone)}}catch(G){j={error:G}}finally{try{k&&!k.done&&(z=H.return)&&z.call(H)}finally{if(j)throw j.error}}return $}function v(F,j){return(F.name||j.name)+"/"+(F.storeName||j.storeName)+"/"}function y(F,j){j&&F.then(function(z){j(null,z)},function(z){j(z)})}function _(){for(var F=[],j=0;j<arguments.length;j++)F[j]=arguments[j];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function b(F,j){var z=this;if(j=_.apply(this,arguments),F=typeof F!="function"&&F||{},!F.name){var $=this.config();F.name=F.name||$.name,F.storeName=F.storeName||$.storeName}var H;return F.name?H=new Promise(function(k){F.storeName?k(v(F,z._defaultConfig)):k(F.name+"/")}):H=Promise.reject("Invalid arguments"),{promise:H,callback:j}}function S(F){return typeof F!="string"&&(console.warn(F+" used as a key, but it is not a string."),F=String(F)),F}var x={bufferToString:d,deserialize:m,serialize:g,stringToBuffer:f},O={},E=function(){function F(j){this.kp=j,this.data={}}return F.resolve=function(j){return O[j]||(O[j]=new F(j)),O[j]},F.prototype.clear=function(){this.data={}},F.prototype.drop=function(){this.clear(),delete O[this.kp]},F.prototype.get=function(j){return this.data[j]},F.prototype.key=function(j){return this.keys()[j]},F.prototype.keys=function(){return Object.keys(this.data)},F.prototype.rm=function(j){delete this.data[j]},F.prototype.set=function(j,z){this.data[j]=z},F}();function p(F){var j=F?w(F):{},z=v(j,this._defaultConfig),$=E.resolve(z);return this._dbInfo=j,this._dbInfo.serializer=x,this._dbInfo.keyPrefix=z,this._dbInfo.mStore=$,Promise.resolve()}function I(F){var j=this,z=this.ready().then(function(){j._dbInfo.mStore.clear()});return y(z,F),z}function C(F,j){var z=b.apply(this,arguments),$=z.promise,H=z.callback,k=$.then(function(M){E.resolve(M).drop()});return y(k,H),$}function L(F,j){var z=this;F=S(F);var $=this.ready().then(function(){var H=z._dbInfo.mStore.get(F);return H==null?null:z._dbInfo.serializer.deserialize(H)});return y($,j),$}function q(F,j){var z=this,$=this.ready().then(function(){for(var H=z._dbInfo.mStore,k=H.keys(),M=0;M<k.length;M++){var G=H.get(k[M]);if(G&&(G=z._dbInfo.serializer.deserialize(G)),G=F(G,k[M],M+1),G!==void 0)return G}});return y($,j),$}function le(F,j){var z=this,$=this.ready().then(function(){var H;try{H=z._dbInfo.mStore.key(F),H===void 0&&(H=null)}catch{H=null}return H});return y($,j),$}function pe(F){var j=this,z=this.ready().then(function(){return j._dbInfo.mStore.keys()});return y(z,F),z}function B(F){var j=this.keys().then(function(z){return z.length});return y(j,F),j}function U(F,j){var z=this;F=S(F);var $=this.ready().then(function(){z._dbInfo.mStore.rm(F)});return y($,j),$}function K(F,j,z){var $=this;F=S(F);var H=this.ready().then(function(){j===void 0&&(j=null);var k=j;return new Promise(function(M,G){$._dbInfo.serializer.serialize(j,function(ge,Q){if(Q)G(Q);else try{$._dbInfo.mStore.set(F,ge),M(k)}catch(te){G(te)}})})});return y(H,z),H}var ne=!0;r._support=ne,r._driver=n,r._initStorage=p,r.clear=I,r.dropInstance=C,r.getItem=L,r.iterate=q,r.key=le,r.keys=pe,r.length=B,r.removeItem=U,r.setItem=K,Object.defineProperty(r,"__esModule",{value:!0})})}),kN=Use(Lje()),kY=Use(Uje()),Bje={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function Fje(t){for(let[e,r]of Object.entries(Bje))t.style[e]=r}function jje(t){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(r=>r.src.includes(t))}var qje=class extends Rje{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(t=>{let e=()=>{if(jje(encodeURIComponent(this.parameters)))zFe().log();else{let r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=QA(this.endpoint).host,r.title="Secure Modal",r.src=QA(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,Fje(r),document.body.appendChild(r),t(r)}};["loaded","interactive","complete"].includes(document.readyState)?e():window.addEventListener("load",e,!1)}),window.addEventListener("message",t=>{var e;if(t.origin===this.endpoint&&t.data&&t.data.msgType&&this.messageHandlers.size){t.data.response=(e=t.data.response)!=null?e:{};for(let r of this.messageHandlers.values())r(t)}})}showOverlay(){return Px(this,null,function*(){let t=yield this.iframe;t.style.display="block",this.activeElement=document.activeElement,t.focus()})}hideOverlay(){return Px(this,null,function*(){var t;let e=yield this.iframe;e.style.display="none",(t=this.activeElement)!=null&&t.focus&&this.activeElement.focus(),this.activeElement=null})}_post(t){return Px(this,null,function*(){let e=yield this.iframe;if(e&&e.contentWindow)e.contentWindow.postMessage(t,this.endpoint);else throw bse()})}},Hje=LFe(Mse,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:qje,configureStorage:()=>Px(void 0,null,function*(){let t=kN.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(kY),yield t.setDriver([kN.default.INDEXEDDB,kN.default.LOCALSTORAGE,kY._driver]),t})});const Wk=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:sse,DeviceVerificationEventEmit:WA,DeviceVerificationEventOnReceived:fse,EthChainType:dse,Events:Hb,Extension:Xh,ExtensionError:Bk,ExtensionWarning:_5,LoginWithEmailOTPEventEmit:V0,LoginWithEmailOTPEventOnReceived:lse,LoginWithMagicLinkEventEmit:cse,LoginWithMagicLinkEventOnReceived:use,Magic:Hje,MagicIncomingWindowMessage:Ah,MagicOutgoingWindowMessage:P1,MagicPayloadMethod:vr,RPCError:R1,RPCErrorCode:hO,RecoveryMethodType:hse,SDKError:Id,SDKErrorCode:Od,SDKWarning:kw,SDKWarningCode:cm,Wallets:_s,isPromiEvent:Sse},Symbol.toStringTag,{value:"Module"})),zje=uo(Wk);var Bse={exports:{}},LN={exports:{}},LY;function Fse(){return LY||(LY=1,function(t,e){(function(r,n){t.exports=n()})(Ne,function(){var r=r||function(n,i){var a=Object.create||function(){function y(){}return function(_){var b;return y.prototype=_,b=new y,y.prototype=null,b}}(),o={},s=o.lib={},c=s.Base=function(){return{extend:function(y){var _=a(this);return y&&_.mixIn(y),(!_.hasOwnProperty("init")||this.init===_.init)&&(_.init=function(){_.$super.init.apply(this,arguments)}),_.init.prototype=_,_.$super=this,_},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var _ in y)y.hasOwnProperty(_)&&(this[_]=y[_]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=s.WordArray=c.extend({init:function(y,_){y=this.words=y||[],_!=i?this.sigBytes=_:this.sigBytes=y.length*4},toString:function(y){return(y||d).stringify(this)},concat:function(y){var _=this.words,b=y.words,S=this.sigBytes,x=y.sigBytes;if(this.clamp(),S%4)for(var O=0;O<x;O++){var E=b[O>>>2]>>>24-O%4*8&255;_[S+O>>>2]|=E<<24-(S+O)%4*8}else for(var O=0;O<x;O+=4)_[S+O>>>2]=b[O>>>2];return this.sigBytes+=x,this},clamp:function(){var y=this.words,_=this.sigBytes;y[_>>>2]&=4294967295<<32-_%4*8,y.length=n.ceil(_/4)},clone:function(){var y=c.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var _=[],b=function(p){var p=p,I=987654321,C=4294967295;return function(){I=36969*(I&65535)+(I>>16)&C,p=18e3*(p&65535)+(p>>16)&C;var L=(I<<16)+p&C;return L/=4294967296,L+=.5,L*(n.random()>.5?1:-1)}},S=0,x;S<y;S+=4){var O=b((x||n.random())*4294967296);x=O()*987654071,_.push(O()*4294967296|0)}return new u.init(_,y)}}),f=o.enc={},d=f.Hex={stringify:function(y){for(var _=y.words,b=y.sigBytes,S=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;S.push((O>>>4).toString(16)),S.push((O&15).toString(16))}return S.join("")},parse:function(y){for(var _=y.length,b=[],S=0;S<_;S+=2)b[S>>>3]|=parseInt(y.substr(S,2),16)<<24-S%8*4;return new u.init(b,_/2)}},g=f.Latin1={stringify:function(y){for(var _=y.words,b=y.sigBytes,S=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;S.push(String.fromCharCode(O))}return S.join("")},parse:function(y){for(var _=y.length,b=[],S=0;S<_;S++)b[S>>>2]|=(y.charCodeAt(S)&255)<<24-S%4*8;return new u.init(b,_)}},m=f.Utf8={stringify:function(y){try{return decodeURIComponent(escape(g.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return g.parse(unescape(encodeURIComponent(y)))}},w=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var _=this._data,b=_.words,S=_.sigBytes,x=this.blockSize,O=x*4,E=S/O;y?E=n.ceil(E):E=n.max((E|0)-this._minBufferSize,0);var p=E*x,I=n.min(p*4,S);if(p){for(var C=0;C<p;C+=x)this._doProcessBlock(b,C);var L=b.splice(0,p);_.sigBytes-=I}return new u.init(L,I)},clone:function(){var y=c.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});s.Hasher=w.extend({cfg:c.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var _=this._doFinalize();return _},blockSize:16,_createHelper:function(y){return function(_,b){return new y.init(b).finalize(_)}},_createHmacHelper:function(y){return function(_,b){return new v.HMAC.init(y,b).finalize(_)}}});var v=o.algo={};return o}(Math);return r})}(LN)),LN.exports}(function(t,e){(function(r,n){t.exports=n(Fse())})(Ne,function(r){return function(n){var i=r,a=i.lib,o=a.WordArray,s=a.Hasher,c=i.algo,u=[],f=[];(function(){function m(_){for(var b=n.sqrt(_),S=2;S<=b;S++)if(!(_%S))return!1;return!0}function w(_){return(_-(_|0))*4294967296|0}for(var v=2,y=0;y<64;)m(v)&&(y<8&&(u[y]=w(n.pow(v,1/2))),f[y]=w(n.pow(v,1/3)),y++),v++})();var d=[],g=c.SHA256=s.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(m,w){for(var v=this._hash.words,y=v[0],_=v[1],b=v[2],S=v[3],x=v[4],O=v[5],E=v[6],p=v[7],I=0;I<64;I++){if(I<16)d[I]=m[w+I]|0;else{var C=d[I-15],L=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,q=d[I-2],le=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;d[I]=L+d[I-7]+le+d[I-16]}var pe=x&O^~x&E,B=y&_^y&b^_&b,U=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),K=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),ne=p+K+pe+f[I]+d[I],F=U+B;p=E,E=O,O=x,x=S+ne|0,S=b,b=_,_=y,y=ne+F|0}v[0]=v[0]+y|0,v[1]=v[1]+_|0,v[2]=v[2]+b|0,v[3]=v[3]+S|0,v[4]=v[4]+x|0,v[5]=v[5]+O|0,v[6]=v[6]+E|0,v[7]=v[7]+p|0},_doFinalize:function(){var m=this._data,w=m.words,v=this._nDataBytes*8,y=m.sigBytes*8;return w[y>>>5]|=128<<24-y%32,w[(y+64>>>9<<4)+14]=n.floor(v/4294967296),w[(y+64>>>9<<4)+15]=v,m.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});i.SHA256=s._createHelper(g),i.HmacSHA256=s._createHmacHelper(g)}(Math),r.SHA256})})(Bse);var Vje=Bse.exports;const Gje=Nc(Vje);var jse={exports:{}};(function(t,e){(function(r,n){t.exports=n(Fse())})(Ne,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,o=n.enc;o.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var g=[],m=0;m<f;m+=3)for(var w=u[m>>>2]>>>24-m%4*8&255,v=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,_=w<<16|v<<8|y,b=0;b<4&&m+b*.75<f;b++)g.push(d.charAt(_>>>6*(3-b)&63));var S=d.charAt(64);if(S)for(;g.length%4;)g.push(S);return g.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var g=0;g<f.length;g++)d[f.charCodeAt(g)]=g}var m=f.charAt(64);if(m){var w=c.indexOf(m);w!==-1&&(u=w)}return s(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(c,u,f){for(var d=[],g=0,m=0;m<u;m++)if(m%4){var w=f[c.charCodeAt(m-1)]<<m%4*2,v=f[c.charCodeAt(m)]>>>6-m%4*2;d[g>>>2]|=(w|v)<<24-g%4*8,g++}return a.create(d,g)}}(),r.enc.Base64})})(jse);var Wje=jse.exports;const Kje=Nc(Wje);var Lw=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),qse=(t=>(t.ParseRedirectResult="magic_oauth_parse_redirect_result",t))(qse||{}),Hse=(t=>(t.InvalidRequest="invalid_request",t.InvalidClient="invalid_client",t.InvalidScope="invalid_scope",t.InvalidGrant="invalid_grant",t.UnauthorizedClient="unauthorized_client",t.UnsupportedResponseType="unsupported_response_type",t.UnsupportedGrantType="unsupported_grant_type",t.UnsupportedTokenType="unsupported_token_type",t.AccessDenied="access_denied",t.ServerError="server_error",t.TemporarilyUnavailable="temporarily_unavailable",t))(Hse||{}),UY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",zse=typeof window<"u"&&!!window.crypto,Yje=zse&&!!window.crypto.subtle;function Qje(t){return Array.from(t).map(e=>UY[e%UY.length]).join("")}function BY(t){let e=r=>r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");if(t instanceof ArrayBuffer){let r=new Uint8Array(t),n=Array.from(r).map(a=>String.fromCharCode(a)).join(""),i=btoa(n);return e(i)}return e(Kje.stringify(t))}function Jje(t){return Lw(this,null,function*(){if(Yje){let e=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",e).then(BY)}return BY(Gje(t))})}function FY(t){let e=new Uint8Array(t);if(zse)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.floor(Math.random()*Math.floor(255));return Qje(e)}function Xje(){return Lw(this,null,function*(){let t=FY(128),e=FY(128),r=yield Jje(e);return{verifier:e,challenge:r,state:t}})}var Zje=class extends Xh.Internal{constructor(){super(...arguments),this.name="oauth",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1}}loginWithRedirect(t){return this.utils.createPromiEvent(e=>Lw(this,null,function*(){let{provider:r,query:n}=yield eqe.call(this,t);window.location.href=new URL(`/v1/oauth2/${r}/start?${n}`,this.sdk.endpoint).href,e()}))}getRedirectResult(){let t=window.location.search,e=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",e),tqe.call(this,t)}},JA="oauth_redirect_metadata";function eqe(t){return Lw(this,null,function*(){yield this.utils.storage.removeItem(JA);let{provider:e,redirectURI:r,scope:n,loginHint:i}=t,{verifier:a,challenge:o,state:s}=yield Xje(),c=JSON.stringify({verifier:a,state:s});return yield this.utils.storage.setItem(JA,c),{query:[`magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`,`magic_challenge=${encodeURIComponent(o)}`,`state=${encodeURIComponent(s)}`,`platform=${encodeURIComponent("web")}`,n&&`scope=${encodeURIComponent(n.join(" "))}`,r&&`redirect_uri=${encodeURIComponent(r)}`,i&&`login_hint=${encodeURIComponent(i)}`].reduce((u,f)=>f?`${u}&${f}`:u),provider:e,redirectURI:r}})}function tqe(t){return this.utils.createPromiEvent((e,r)=>Lw(this,null,function*(){var n;let i=yield this.utils.storage.getItem(JA),{verifier:a,state:o}=JSON.parse(i);this.utils.storage.removeItem(JA);let s=this.utils.createJsonRpcRequestPayload("magic_oauth_parse_redirect_result",[t,a,o]),c=yield this.request(s),u=c,f=c;f.error&&r(this.createError(f.error,(n=f.error_description)!=null?n:"An error occurred.",{errorURI:f.error_uri,provider:f.provider})),e(u)}))}const Kk=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:Hse,OAuthExtension:Zje,OAuthPayloadMethods:qse},Symbol.toStringTag,{value:"Module"})),rqe=uo(Kk);var nqe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iqe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jY=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&nqe(e,t,r);return iqe(e,t),e};Object.defineProperty(dO,"__esModule",{value:!0});dO.MagicConnector=void 0;const qY=Ml,HY=qs,aqe=FS;class oqe extends aqe.AbstractConnector{constructor(e){super({supportedChainIds:HY.getConfiguration()[qY.ProviderType.MAGIC].chains}),this.activate=async()=>{var r;if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const i=await this.getProvider(),a=await i.request({method:"eth_accounts"});return this.account=(r=a[0])!==null&&r!==void 0?r:null,{provider:i,chainId:this.chainId,account:this.account}},this.getProvider=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const r=await this.magic.wallet.getProvider();return Object.assign(Object.assign({},r),{request:new Proxy(r.request,{apply:async(n,i,a)=>{var o,s,c;if(((o=a[0])===null||o===void 0?void 0:o.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(s=a[0])===null||s===void 0?void 0:s.params[0])===null||c===void 0?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return n.bind(r)(...a)}})})},this.getChainId=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId},this.getAccount=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account},this.deactivate=()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");this.magic.user.logout(),this.emitDeactivate()},this.buildMagicInstance=async r=>{const{Magic:n}=await Promise.resolve().then(()=>jY(zje)),{OAuthExtension:i}=await Promise.resolve().then(()=>jY(rqe)),a=HY.getConfiguration()[qY.ProviderType.MAGIC];return new n(a.apiKey,{extensions:[new i],network:{rpcUrl:a.urls[r],chainId:r}})},this.chainId=e,this.account=null}}dO.MagicConnector=oqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(FS,t),r(qS,t),r(JS,t),r(XS,t),r(ZS,t),r(eO,t),r(dO,t)})(ZM);var Vse={},Uw={};Object.defineProperty(Uw,"__esModule",{value:!0});Uw.Storage=void 0;class sqe{}Uw.Storage=sqe;var mO={};Object.defineProperty(mO,"__esModule",{value:!0});mO.LocalStorage=void 0;const cqe=Uw;class uqe extends cqe.Storage{get(e){const r=window.localStorage.getItem(e);return r===null?void 0:r}set(e,r){window.localStorage.setItem(e,r)}remove(e){window.localStorage.removeItem(e)}removeRegExp(e){for(let r=localStorage.length-1;r>=0;r--){const n=localStorage.key(r);n&&e.test(n)&&localStorage.removeItem(n)}}}mO.LocalStorage=uqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Uw,t),r(mO,t)})(Vse);var vO={};Object.defineProperty(vO,"__esModule",{value:!0});vO.ProviderAdapter=void 0;class Yk{constructor(e){this.provider=e,this.id=0,this.on=(r,n)=>this.provider.on(r,n),this.emit=(r,...n)=>this.provider.emit(r,n),this.removeListener=(r,n)=>this.provider.removeListener(r,n),this.request=async({method:r,params:n})=>this.isModernProvider()?this.provider.request({method:r,params:n}):this.send(r,n),this.sendAsync=async(r,n)=>this.hasSendAsync()?this.provider.sendAsync(r,(i,a)=>{a&&!a.hasOwnProperty("result")?n(i,{id:0,jsonrpc:"2.0",result:a}):n(i,a)}):this.send(r,n)}static adapt(e){const r=new Yk(e);return Object.assign(Object.assign({},e),{on:r.on,emit:r.emit,removeListener:r.removeListener,request:r.request,sendAsync:r.sendAsync,send:r.send.bind(r)})}async send(e,r){let n,i,a;const o=typeof r=="function";if(o){const s=e;i=s.params||[],n=s.method,a=r}else n=e,i=r||[],a=(s,c)=>{if(s)throw s;return c};if(this.isModernProvider()){const[s,c]=await this.provider.request({method:n,params:i}).then(f=>[null,f]).catch(f=>[f,void 0]);return a(s,o?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[s,c]=o?await new Promise(u=>this.provider.send(e,(f,d)=>{u([f,d])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:n,params:i},(f,d)=>{u([d&&d.hasOwnProperty("error")?d.error:f,d&&d.hasOwnProperty("result")?d.result:d])}));return a(s,c)}}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}vO.ProviderAdapter=Yk;Object.defineProperty(Py,"__esModule",{value:!0});Py.connection=Py.ConnectionManager=void 0;const zY=ns(),Vo=Ac,OE=d4e,ff=ZM,lqe=Vse,UN=qs,VY=vO;class Gse{constructor(e){this.storage=e,this.getWalletName=()=>{if(this.connector instanceof ff.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:r}=UN.getConfiguration();this.storage.remove(r),ff.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(OE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(OE.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(e,r=zY.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(e,r),this.connector.on(OE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),e===Vo.ProviderType.MAGIC&&this.connector.on(OE.ConnectorEvent.Update,({chainId:a})=>{a&&this.setConnectionData(e,a)});const{provider:n,account:i}=await this.connector.activate();return this.setConnectionData(e,r),{provider:VY.ProviderAdapter.adapt(n),providerType:e,account:i||"",chainId:r}}async tryPreviousConnection(){const e=this.getConnectionData();if(!e)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const r=await this.connect(e.providerType,e.chainId);if(r.providerType===Vo.ProviderType.INJECTED){const n=await r.provider.request({method:"eth_chainId"}),i=n?parseInt(n,16):null;i&&e.chainId!==i&&this.setConnectionData(e.providerType,i)}return Object.assign(Object.assign({},r),{chainId:this.getConnectionData().chainId})}getAvailableProviders(){const e=[Vo.ProviderType.FORTMATIC,Vo.ProviderType.WALLET_CONNECT,Vo.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?e.unshift(Vo.ProviderType.INJECTED):e.unshift(Vo.ProviderType.METAMASK_MOBILE),e}async disconnect(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async createProvider(e,r=zY.ChainId.ETHEREUM_MAINNET){const i=await this.buildConnector(e,r).getProvider();return VY.ProviderAdapter.adapt(i)}buildConnector(e,r){switch(e){case Vo.ProviderType.INJECTED:return new ff.InjectedConnector(r);case Vo.ProviderType.FORTMATIC:return new ff.FortmaticConnector(r);case Vo.ProviderType.MAGIC:return new ff.MagicConnector(r);case Vo.ProviderType.WALLET_LINK:return new ff.WalletLinkConnector(r);case Vo.ProviderType.NETWORK:return new ff.NetworkConnector(r);case Vo.ProviderType.WALLET_CONNECT_V2:return new ff.WalletConnectV2Connector(r);default:throw new Error(`Invalid provider ${e}`)}}getConnectionData(){const{storageKey:e}=UN.getConfiguration(),r=this.storage.get(e);return r?JSON.parse(r):void 0}setConnectionData(e,r){const{storageKey:n}=UN.getConfiguration(),i=JSON.stringify({providerType:e,chainId:r});this.storage.set(n,i)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}Py.ConnectionManager=Gse;Py.connection=new Gse(new lqe.LocalStorage);var Wse={};Object.defineProperty(Wse,"__esModule",{value:!0});(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Py,t),r(ZM,t),r(qs,t),r(Wse,t)})(Il);const fqe="https://auth-api.decentraland.zone",dqe={AUTH_SERVER_URL:fqe},hqe="https://auth-api.decentraland.org",pqe={AUTH_SERVER_URL:hqe},gqe="https://auth-api.decentraland.today",yqe={AUTH_SERVER_URL:gqe},mqe=H0.createConfig({[H0.Env.DEVELOPMENT]:dqe,[H0.Env.STAGING]:yqe,[H0.Env.PRODUCTION]:pqe},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}}),vqe="_background_19zmp_1",bqe="_main_19zmp_20",wqe="_left_19zmp_30",_qe="_right_19zmp_39",Eqe="_changeAccount_19zmp_53",xqe="_errorLogo_19zmp_59",Aqe="_logo_19zmp_68",Sqe="_title_19zmp_74",Oqe="_description_19zmp_81",Iqe="_code_19zmp_88",Pqe="_buttons_19zmp_95",Tqe="_closeWindow_19zmp_105",zr={background:vqe,main:bqe,left:wqe,right:_qe,changeAccount:Eqe,errorLogo:xqe,logo:Aqe,title:Sqe,description:Oqe,code:Iqe,buttons:Pqe,closeWindow:Tqe},Rqe=()=>{const t=Mye(),e=I2(),[r,n]=Ge.useState(2),i=Ge.useRef(),a=Ge.useRef(),o=Ge.useRef(),s=Ge.useRef(),c=t.requestId??"",u=Ge.useCallback(async()=>new ate(await Il.connection.getProvider()),[]),f=Ge.useCallback(()=>{e(`/login?redirectTo=/auth/requests/${c}&fromRequests=true`)},[]);Ge.useEffect(()=>((async()=>{try{await Il.connection.tryPreviousConnection()}catch{f();return}try{const _=await BN("recover",{requestId:c});i.current=_;const x=await(await(await u()).getSigner()).getAddress();if(s.current=x,_.sender&&_.sender!==x.toLowerCase()){n(1);return}o.current=setTimeout(()=>{n(0)},new Date(_.expiration).getTime()-Date.now()),_.method==="dcl_personal_sign"?n(4):n(8)}catch(_){a.current=_.message,n(3)}})(),()=>{clearTimeout(o.current)}),[]),Ge.useEffect(()=>{r!==4&&r!==8&&clearTimeout(o.current)},[r]);const d=Ge.useCallback(()=>{n(5)},[]),g=Ge.useCallback(async()=>{const b=await(await u()).getSigner(),S=await b.signMessage(i.current.params[0]),x=await BN("outcome",{requestId:c,sender:await b.getAddress(),result:S});x.error?(a.current=x.error,n(6)):n(7)},[u]),m=Ge.useCallback(()=>{n(9)},[]),w=Ge.useCallback(async()=>{const _=await u(),b=await _.getSigner(),S=await _.send(i.current.method,i.current.params),x=await BN("outcome",{requestId:c,sender:await b.getAddress(),result:S});x.error?(a.current=x.error,n(10)):n(11)},[u]),v=Ge.useCallback(async()=>{await Il.connection.disconnect(),f()},[]),y=Ge.useCallback(_=>Je.jsxs("div",{children:[Je.jsx("div",{className:zr.background}),Je.jsxs("div",{className:zr.main,children:[Je.jsx("div",{className:zr.left,children:_.children}),Je.jsx("div",{className:zr.right,children:s.current?Je.jsxs(Je.Fragment,{children:[Je.jsx(Xie,{lockBeta:!0,panning:!1,disableBackground:!0,profile:s.current,dev:!1}),Je.jsx("div",{className:zr.changeAccount,children:Je.jsx(cu.Button,{inverted:!0,onClick:v,children:"Change Account"})})]}):null})]})]}),[]);return r===0?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Looks like you took too long and the request has expired"}),Je.jsx("div",{className:zr.description,children:"Please return to Decentraland's Desktop App to try again."}),Je.jsx(nh,{})]}):r===1?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Looks like you are connected with a different account."}),Je.jsx("div",{className:zr.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):r===2?Je.jsx(y,{children:Je.jsx("div",{className:zr.left,children:Je.jsx(xS,{active:!0,size:"huge"})})}):r===3?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"There was an error recovering the request..."}),Je.jsx("div",{className:zr.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),Je.jsx(nh,{})]}):r===4&&i.current?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"Verify Sign In"}),Je.jsx("div",{className:zr.description,children:"Do you see the same verification number on your Desktop App?"}),Je.jsx("div",{className:zr.code,children:i.current.code}),Je.jsxs("div",{className:zr.buttons,children:[Je.jsx(cu.Button,{inverted:!0,onClick:d,children:"No"}),Je.jsx(cu.Button,{primary:!0,onClick:g,children:"Yes, they are the same"})]})]}):r===5?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Did the number not match, or was this action not taken by you?"}),Je.jsx("div",{className:zr.description,children:"If you're trying to sign in, retry the action. If this action was not initiated by you, dismiss this message."}),Je.jsx(nh,{})]}):r===7?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"Your account is ready!"}),Je.jsx("div",{className:zr.description,children:"Return to the Desktop App and enjoy Decentraland."}),Je.jsx(nh,{})]}):r===8&&i.current?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"The Desktop App wants to interact with your wallet."}),Je.jsx("div",{className:zr.description,children:"Review the following data carefully on your wallet before approving it."}),Je.jsxs("div",{className:zr.buttons,children:[Je.jsx(cu.Button,{inverted:!0,onClick:m,children:"Deny"}),Je.jsx(cu.Button,{primary:!0,onClick:w,children:"Allow"})]})]}):r===9?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Was this action not initiated by you?"}),Je.jsx("div",{className:zr.description,children:"If this action was not initiated by you, dismiss this message."}),Je.jsx(nh,{})]}):r===11?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"Wallet interaction complete"}),Je.jsx("div",{className:zr.description,children:"The action has been executed successfuly."}),Je.jsx(nh,{})]}):r===6||r===10?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"There was an error while trying to submit the request."}),Je.jsx("div",{className:zr.description,children:"Return to the Desktop App to try again, or contant support if the error persists."}),Je.jsx(nh,{})]}):null},nh=()=>Je.jsx("div",{className:zr.closeWindow,children:"You can close this window."}),BN=async(t,e)=>{const r=mqe.get("AUTH_SERVER_URL"),n=ox(r);await new Promise(a=>{n.on("connect",a)});const i=await n.emitWithAck(t,e);if(n.close(),i.error)throw new Error(i.error);return i},Cqe=()=>{const t=I2(),e=cw(),r=Ge.useCallback(async()=>{try{const n=await Il.connection.tryPreviousConnection();return!!(n.account&&n.provider)}catch{return!1}},[]);return Ge.useEffect(()=>{r().then(n=>{n?window.location.href="/":t({pathname:"/login",search:e.search})})},[r,t]),Je.jsx(xS,{active:!0,size:"huge"})},Kse=()=>{const t=cw(),r=new URLSearchParams(t.search).get("redirectTo"),n=r?decodeURIComponent(r):null;if(n!==null)try{let i;return n.startsWith("/")?i=new URL(n,window.location.origin):i=new URL(n),i.hostname!==window.location.hostname?void 0:i.href}catch{console.error("Can't parse redirectTo URL");return}};var bO={},wO=br;bO.__esModule=!0;var Qk=bO.default=void 0,Nqe=wO(Bn()),Dqe=wO(ii);wO(Ln());var $qe=wO(Ge),C0=Wn();function lp(t){var e=t.children,r=t.className,n=t.content,i=t.image,a=t.scrolling,o=(0,Dqe.default)(r,(0,C0.useKeyOnly)(i,"image"),(0,C0.useKeyOnly)(a,"scrolling"),"content"),s=(0,C0.getUnhandledProps)(lp,t),c=(0,C0.getElementType)(lp,t);return $qe.default.createElement(c,(0,Nqe.default)({},s,{className:o}),C0.childrenUtils.isNil(e)?n:e)}lp.handledProps=["as","children","className","content","image","scrolling"];lp.propTypes={};lp.create=(0,C0.createShorthandFactory)(lp,function(t){return{content:t}});var Mqe=lp;Qk=bO.default=Mqe;var Jk={},_O={},FN,GY;function kqe(){if(GY)return FN;GY=1;function t(e,r,n,i){var a=-1,o=e==null?0:e.length;for(i&&o&&(n=e[++a]);++a<o;)n=r(n,e[a],a,e);return n}return FN=t,FN}var jN,WY;function Lqe(){if(WY)return jN;WY=1;function t(e,r,n,i,a){return a(e,function(o,s,c){n=i?(i=!1,o):r(n,o,s,c)}),n}return jN=t,jN}var qN,KY;function Yse(){if(KY)return qN;KY=1;var t=kqe(),e=bw(),r=wd(),n=Lqe(),i=Di();function a(o,s,c){var u=i(o)?t:n,f=arguments.length<3;return u(o,r(s,4),c,f,e)}return qN=a,qN}var HN,YY;function Qse(){return YY||(YY=1,HN=function(e,r,n,i){var a=n?n.call(i,e,r):void 0;if(a!==void 0)return!!a;if(e===r)return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var o=Object.keys(e),s=Object.keys(r);if(o.length!==s.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<o.length;u++){var f=o[u];if(!c(f))return!1;var d=e[f],g=r[f];if(a=n?n.call(i,d,g,f):void 0,a===!1||a===void 0&&d!==g)return!1}return!0}),HN}var IE={},QY;function Uqe(){if(QY)return IE;QY=1;var t=br;IE.__esModule=!0;var e=t(wS());return IE.default=e.default,IE}var Uv={},PE={},JY;function Bqe(){if(JY)return PE;JY=1;var t=br;PE.__esModule=!0;var e=t(H$());return PE.default=e.default,PE}var XY;function Fqe(){if(XY)return Uv;XY=1;var t=Ws,e=br;Uv.__esModule=!0,Uv.default=void 0;var r=e(Bn()),n=e($c()),i=e(bS()),a=e(Ks()),o=e(ii);e(Ln());var s=t(Ge),c=Wn(),u=e(Bqe()),f=function(d){(0,n.default)(g,d);function g(){for(var w,v=arguments.length,y=new Array(v),_=0;_<v;_++)y[_]=arguments[_];return w=d.call.apply(d,[this].concat(y))||this,w.handleButtonOverrides=function(b){return{onClick:function(x,O){(0,a.default)(b,"onClick",x,O),(0,a.default)(w.props,"onActionClick",x,O)}}},w}var m=g.prototype;return m.render=function(){var v=this,y=this.props,_=y.actions,b=y.children,S=y.className,x=y.content,O=(0,o.default)("actions",S),E=(0,c.getUnhandledProps)(g,this.props),p=(0,c.getElementType)(g,this.props);return c.childrenUtils.isNil(b)?c.childrenUtils.isNil(x)?s.default.createElement(p,(0,r.default)({},E,{className:O}),(0,i.default)(_,function(I){return u.default.create(I,{overrideProps:v.handleButtonOverrides})})):s.default.createElement(p,(0,r.default)({},E,{className:O}),x):s.default.createElement(p,(0,r.default)({},E,{className:O}),b)},g}(s.Component);return Uv.default=f,f.handledProps=["actions","as","children","className","content","onActionClick"],f.propTypes={},f.create=(0,c.createShorthandFactory)(f,function(d){return{actions:d}}),Uv}var Bv={},ZY;function jqe(){if(ZY)return Bv;ZY=1;var t=br;Bv.__esModule=!0,Bv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("description",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={};var o=a;return Bv.default=o,Bv}var Fv={},eQ;function qqe(){if(eQ)return Fv;eQ=1;var t=br;Fv.__esModule=!0,Fv.default=void 0;var e=t(Bn()),r=vd,n=t(ii);t(Ln());var i=t(Ge),a=Wn();function o(c){var u=c.blurring,f=c.children,d=c.className,g=c.centered,m=c.content,w=c.inverted,v=c.mountNode,y=c.scrolling,_=i.default.useRef(),b=(0,n.default)("ui",(0,a.useKeyOnly)(w,"inverted"),(0,a.useKeyOnly)(!g,"top aligned"),"page modals dimmer transition visible active",d),S=(0,n.default)("dimmable dimmed",(0,a.useKeyOnly)(u,"blurring"),(0,a.useKeyOnly)(y,"scrolling")),x=(0,a.getUnhandledProps)(o,c),O=(0,a.getElementType)(o,c);return(0,a.useClassNamesOnNode)(v,S),i.default.useEffect(function(){_.current&&_.current.style&&_.current.style.setProperty("display","flex","important")},[]),i.default.createElement(r.Ref,{innerRef:_},i.default.createElement(O,(0,e.default)({},x,{className:b}),a.childrenUtils.isNil(f)?m:f))}o.handledProps=["as","blurring","centered","children","className","content","inverted","mountNode","scrolling"],o.propTypes={},o.create=(0,a.createShorthandFactory)(o,function(c){return{content:c}});var s=o;return Fv.default=s,Fv}var jv={},tQ;function Hqe(){if(tQ)return jv;tQ=1;var t=br;jv.__esModule=!0,jv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("header",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(s){return{content:s}});var o=a;return jv.default=o,jv}var Gu={},rQ;function zqe(){if(rQ)return Gu;rQ=1,Gu.__esModule=!0,Gu.isLegacy=Gu.getLegacyStyles=Gu.canFit=void 0;var t=0,e=50,r=function(o){var s=o.height+t,c=o.height+t,u=window.innerHeight,f=u/2,d=-(c/2),g=e,m=f+d;return m+s+g<u};Gu.canFit=r;var n=function(o,s,c){var u=s&&o?-(c.height/2):0,f=-(c.width/2);return{marginLeft:f,marginTop:u}};Gu.getLegacyStyles=n;var i=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return Gu.isLegacy=i,Gu}var Vqe=Ws,ta=br;_O.__esModule=!0;_O.default=void 0;var v0=ta(Bn()),Gqe=ta($c()),Wqe=ta(vS()),Kqe=ta(U$()),Yqe=ta(F$()),Qqe=ta(Yse()),Jqe=ta(Are()),df=ta(Ks()),nQ=vd,Xqe=ta(ii);ta(Ln());var Wu=Vqe(Ge),Zqe=ta(Qse()),Pa=Wn(),eHe=ta(Uqe()),iQ=ta(q$()),Jse=ta(Fqe()),Xse=ta(bO),tHe=ta(jqe()),Zse=ta(qqe()),ece=ta(Hqe()),zN=zqe(),Iu=function(t){(0,Gqe.default)(e,t);function e(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a))||this,n.legacy=(0,Pa.isBrowser)()&&(0,zN.isLegacy)(),n.ref=(0,Wu.createRef)(),n.dimmerRef=(0,Wu.createRef)(),n.latestDocumentMouseDownEvent=null,n.getMountNode=function(){return(0,Pa.isBrowser)()?n.props.mountNode||document.body:null},n.handleActionsOverrides=function(s){return{onActionClick:function(u,f){(0,df.default)(s,"onActionClick",u,f),(0,df.default)(n.props,"onActionClick",u,n.props),n.handleClose(u)}}},n.handleClose=function(s){n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1}))},n.handleDocumentMouseDown=function(s){n.latestDocumentMouseDownEvent=s},n.handleDocumentClick=function(s){var c=n.props.closeOnDimmerClick,u=n.latestDocumentMouseDownEvent;n.latestDocumentMouseDownEvent=null,!(!c||(0,Pa.doesNodeContainClick)(n.ref.current,u)||(0,Pa.doesNodeContainClick)(n.ref.current,s))&&(n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1})))},n.handleIconOverrides=function(s){return{onClick:function(u){(0,df.default)(s,"onClick",u),n.handleClose(u)}}},n.handleOpen=function(s){(0,df.default)(n.props,"onOpen",s,(0,v0.default)({},n.props,{open:!0})),n.setState({open:!0})},n.handlePortalMount=function(s){var c=n.props.eventPool;n.setState({scrolling:!1}),n.setPositionAndClassNames(),Pa.eventStack.sub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.sub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onMount",s,n.props)},n.handlePortalUnmount=function(s){var c=n.props.eventPool;cancelAnimationFrame(n.animationRequestId),Pa.eventStack.unsub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.unsub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onUnmount",s,n.props)},n.setPositionAndClassNames=function(){var s=n.props.centered,c,u={};if(n.ref.current){var f=n.ref.current.getBoundingClientRect(),d=(0,zN.canFit)(f);c=!d;var g=n.legacy?(0,zN.getLegacyStyles)(d,s,f):{};(0,Zqe.default)(n.state.legacyStyles,g)||(u.legacyStyles=g),n.state.scrolling!==c&&(u.scrolling=c)}(0,Jqe.default)(u)||n.setState(u),n.animationRequestId=requestAnimationFrame(n.setPositionAndClassNames)},n.renderContent=function(s){var c=n.props,u=c.actions,f=c.basic,d=c.children,g=c.className,m=c.closeIcon,w=c.content,v=c.header,y=c.size,_=c.style,b=n.state,S=b.legacyStyles,x=b.scrolling,O=(0,Xqe.default)("ui",y,(0,Pa.useKeyOnly)(f,"basic"),(0,Pa.useKeyOnly)(n.legacy,"legacy"),(0,Pa.useKeyOnly)(x,"scrolling"),"modal transition visible active",g),E=(0,Pa.getElementType)(e,n.props),p=m===!0?"close":m,I=eHe.default.create(p,{overrideProps:n.handleIconOverrides});return Wu.default.createElement(nQ.Ref,{innerRef:n.ref},Wu.default.createElement(E,(0,v0.default)({},s,{className:O,style:(0,v0.default)({},S,_)}),I,Pa.childrenUtils.isNil(d)?Wu.default.createElement(Wu.default.Fragment,null,ece.default.create(v,{autoGenerateKey:!1}),Xse.default.create(w,{autoGenerateKey:!1}),Jse.default.create(u,{overrideProps:n.handleActionsOverrides})):d))},n}var r=e.prototype;return r.componentWillUnmount=function(){this.handlePortalUnmount()},r.render=function(){var i=this.props,a=i.centered,o=i.closeOnDocumentClick,s=i.dimmer,c=i.eventPool,u=i.trigger,f=this.state,d=f.open,g=f.scrolling,m=this.getMountNode();if(!(0,Pa.isBrowser)())return(0,Wu.isValidElement)(u)?u:null;var w=(0,Pa.getUnhandledProps)(e,this.props),v=iQ.default.handledProps,y=(0,Qqe.default)(w,function(b,S,x){return(0,Yqe.default)(v,x)||(b[x]=S),b},{}),_=(0,Kqe.default)(w,v);return Wu.default.createElement(iQ.default,(0,v0.default)({closeOnDocumentClick:o},_,{trigger:u,eventPool:c,mountNode:m,open:d,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),Wu.default.createElement(nQ.Ref,{innerRef:this.dimmerRef},Zse.default.create((0,Wqe.default)(s)?s:{},{autoGenerateKey:!1,defaultProps:{blurring:s==="blurring",inverted:s==="inverted"},overrideProps:{children:this.renderContent(y),centered:a,mountNode:m,scrolling:g}})))},e}(Pa.ModernAutoControlledComponent);Iu.handledProps=["actions","as","basic","centered","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","content","defaultOpen","dimmer","eventPool","header","mountNode","onActionClick","onClose","onMount","onOpen","onUnmount","open","size","style","trigger"];Iu.propTypes={};Iu.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Iu.autoControlledProps=["open"];Iu.Actions=Jse.default;Iu.Content=Xse.default;Iu.Description=tHe.default;Iu.Dimmer=Zse.default;Iu.Header=ece.default;var rHe=Iu;_O.default=rHe;(function(t){var e=Ne&&Ne.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=void 0;var r=_O;Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return e(r).default}})})(Jk);var Xk={};var nHe=Ne&&Ne.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),iHe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),aHe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),oHe=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&iHe(e,t,r);return aHe(e,t),e};Object.defineProperty(Xk,"__esModule",{value:!0});var Zk=Xk.ModalNavigation=void 0,ih=oHe(Ge),sHe=function(t){nHe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var r=this.props,n=r.title,i=r.subtitle,a=r.onBack,o=r.onClose,s=r.onInfo;return ih.createElement("div",{className:"dcl modal-navigation"},ih.createElement("div",{className:"dcl modal-navigation-title"},n),i&&ih.createElement("div",{className:"dcl modal-navigation-subtitle"},i),a&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:a}),s&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:s}),o&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:o}))},e}(ih.PureComponent);Zk=Xk.ModalNavigation=sHe;const cHe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7386581352.commit-0ef8d7f/assets/warning-057948e8.svg";var Ri=(t=>(t.CONNECTING_WALLET="CONNECTING_WALLET",t.WAITING_FOR_SIGNATURE="WAITING_FOR_SIGNATURE",t.ERROR="ERROR",t.LOADING_MAGIC="LOADING_MAGIC",t.VALIDATING_SIGN_IN="VALIDATING_SIGN_IN",t))(Ri||{});function uHe(t,e){switch(t){case Ri.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case Ri.CONNECTING_WALLET:case Ri.WAITING_FOR_SIGNATURE:return e===Ml.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case Ri.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case Ri.LOADING_MAGIC:return"Redirecting..."}}const lHe="_main_1qx1l_1",fHe="_content_1qx1l_8",dHe="_errorImage_1qx1l_16",hHe="_message_1qx1l_22",pHe="_loader_1qx1l_29",qv={main:lHe,content:fHe,errorImage:dHe,message:hHe,loader:pHe},tce=t=>{const{open:e,state:r,providerType:n,onClose:i,onTryAgain:a}=t,o=r===Ri.CONNECTING_WALLET||r===Ri.WAITING_FOR_SIGNATURE||r===Ri.LOADING_MAGIC||r===Ri.VALIDATING_SIGN_IN;return Je.jsxs(Jk.Modal,{size:"tiny",open:e,children:[Je.jsx(Zk,{title:"",onClose:o?void 0:i}),Je.jsx("div",{className:qv.main,children:Je.jsxs("div",{className:qv.content,children:[r===Ri.ERROR&&Je.jsx("img",{className:qv.errorImage,src:cHe}),o&&Je.jsx(xS,{className:qv.loader,size:"huge",inline:!0}),Je.jsx("p",{className:qv.message,children:uHe(r,n)}),r===Ri.ERROR&&Je.jsx(cu.Button,{primary:!0,onClick:a,children:"Try again"})]})}),Je.jsx(Qk,{})]})};var rce={},nce={},x5={exports:{}};(function(t,e){(function(r,n){n(e)})(Ne,function(r){function n(P){if(P.jsonrpc="2.0",!P.id||typeof P.id!="number"||Math.floor(P.id)!==P.id)throw new Error(`Invalid RPC message(invalid id) message: ${JSON.stringify(P)}`);if(!P.method||typeof P.method!="string"||P.method.trim().length===0)throw new Error(`Invalid RPC message(invalid method) message: ${JSON.stringify(P)}`);if(!P.params||typeof P.params!="object")throw new Error(`Invalid RPC message(invalid params) message: ${JSON.stringify(P)}`);return P}var i={};function a(){let P,D;const W=new Promise((he,Se)=>{P=Ce=>{he(Ce),W.isPending=!1},D=Ce=>{Se(Ce),W.isPending=!1}}).catch(he=>Promise.reject(he));return W.resolve=P,W.reject=D,"finally"in W||(W.finally=he=>{W.then(he),W.catch(he)}),W.isPending=!0,W}Object.defineProperty(i,"__esModule",{value:!0});var o=i.future=a;i.default=a;var s={exports:{}};/**
|
|
170
|
+
Received: \`${t.received}\``)}function zFe(){return new kw(cm.DuplicateIframe,"Duplicate iframes found.")}function VFe(){return new kw(cm.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function GFe(){return new kw(cm.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${zn.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function mg(t){let{method:e,removalVersions:r,useInstead:n}=t,i=r[zn.sdkName],a=n?` Use \`${n}\` instead.`:"",o=`\`${e}\` will be removed from \`${zn.sdkName}\` in version \`${i}\`.${a}`;return new kw(cm.DeprecationNotice,o)}function*WFe(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var KFe=WFe();function wse(){return KFe.next().value}var _se=Symbol("Payload pre-processed by Magic SDK");function Ese(t){return Object.defineProperty(t,_se,{value:!0,enumerable:!1}),t}function YFe(t){return!!t[_se]}function YA(t){var e,r,n;return YFe(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=wse(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],Ese(t)),t}function an(t,e=[]){return Ese({params:e,method:t,jsonrpc:"2.0",id:wse()})}var Fk=class{constructor(t){t instanceof Fk?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):MFe(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}applyError(t){return this._error=t,this}applyResult(t){return this._result=t,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},QFe=HBe(zBe()),JFe=class extends QFe.default{};function xse(){let t=new JFe;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var Ase=Symbol("isPromiEvent");function Sse(t){return!!t[Ase]}function jk(t){let e=Ose(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=xse(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(f,d)=>(...g)=>{let m=d[f].apply(d,g);return c(m)},c=f=>Object.assign(f,{[Ase]:!0,[i]:f[i]||f.then,[a]:f[a]||f.catch,[o]:f[o]||f.finally,then:s(i,f),catch:s(a,f),finally:s(o,f),on:n("on",f),once:n("once",f),addListener:n("addListener",f),off:n("off",f),removeListener:n("removeListener",f),removeAllListeners:n("removeAllListeners",f),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),u=c(e.then(f=>(u.emit("done",f),u.emit("settled"),f),f=>{throw u.emit("error",f),u.emit("settled"),f}));return u}function Ose(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var Np=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(P1.MAGIC_HANDLE_REQUEST,YA(t)),r=jk((i,a)=>{e.then(o=>{if(n(),o.hasError)a(new R1(o.payload.error));else if(o.hasResult)i(o.payload.result);else throw FFe()}).catch(o=>{n(),a(o)})}),n=this.overlay.on(Ah.MAGIC_HANDLE_EVENT,i=>{var a;let{response:o}=i.data;if(o.id===t.id&&((a=o.result)!=null&&a.event)){let{event:s,params:c=[]}=o.result;r.emit(s,...c)}});return r}createIntermediaryEvent(t,e){return r=>{let n=an(vr.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}};function XFe(t,e){let[r]=t.split(".").map(Number);return r>=e}var vg={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},ZFe=class extends Np{loginWithMagicLink(t){let e=zn.sdkName==="@magic-sdk/react-native"||zn.sdkName==="@magic-sdk/react-native-bare"||zn.sdkName==="@magic-sdk/react-native-expo";if(e&&XFe(zn.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");e&&mg({method:"auth.loginWithMagicLink()",removalVersions:vg,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:i,overrides:a}=t,o=an(this.sdk.testMode?vr.LoginWithMagicLinkTestMode:vr.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:i,overrides:a}]);return this.request(o)}loginWithSMS(t){let{phoneNumber:e}=t,r=an(this.sdk.testMode?vr.LoginWithSmsTestMode:vr.LoginWithSms,[{phoneNumber:e,showUI:!0}]);return this.request(r)}loginWithEmailOTP(t){let{email:e,showUI:r,deviceCheckUI:n,overrides:i}=t,a=an(this.sdk.testMode?vr.LoginWithEmailOTPTestMode:vr.LoginWithEmailOTP,[{email:e,showUI:r,deviceCheckUI:n,overrides:i}]),o=this.request(a);return!n&&o&&o.on(WA.Retry,()=>{this.createIntermediaryEvent(WA.Retry,a.id)()}),!r&&o&&(o.on(V0.VerifyEmailOtp,s=>{this.createIntermediaryEvent(V0.VerifyEmailOtp,a.id)(s)}),o.on(V0.Cancel,()=>{this.createIntermediaryEvent(V0.Cancel,a.id)()})),o}loginWithCredential(t){let e=t??"";if(!t&&zn.platform==="web"){e=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=an(this.sdk.testMode?vr.LoginWithCredentialTestMode:vr.LoginWithCredential,[e]);return this.request(r)}setAuthorizationToken(t){let e=an(vr.SetAuthorizationToken,[{jwt:t}]);return this.request(e)}updateEmailWithUI(t){let{email:e,showUI:r=!0}=t,n=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}},Ise={};jBe(Ise,{clear:()=>eje,getItem:()=>$o,iterate:()=>Pse,key:()=>rje,keys:()=>nje,length:()=>tje,removeItem:()=>gO,setItem:()=>Tl});var xE;function Pd(t){return(...e)=>Ci(this,null,function*(){return xE||(xE=yield zn.configureStorage()),yield xE.ready(),xE[t](...e)})}var $o=Pd("getItem"),Tl=Pd("setItem"),gO=Pd("removeItem"),eje=Pd("clear"),tje=Pd("length"),rje=Pd("key"),nje=Pd("keys"),Pse=Pd("iterate");function ije(){let t=window.crypto.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&191|128;let e="";return e+=t[0].toString(16),e+=t[1].toString(16),e+=t[2].toString(16),e+=t[3].toString(16),e+="-",e+=t[4].toString(16),e+=t[5].toString(16),e+="-",e+=t[6].toString(16),e+=t[7].toString(16),e+="-",e+=t[8].toString(16),e+=t[9].toString(16),e+="-",e+=t[10].toString(16),e+=t[11].toString(16),e+=t[12].toString(16),e+=t[13].toString(16),e+=t[14].toString(16),e+=t[15].toString(16),e}var Tse="STORE_KEY_PRIVATE_KEY",E5="STORE_KEY_PUBLIC_JWK",Rse="ECDSA",aje="P-256",oje={name:Rse,namedCurve:aje};function yO(){let t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function sje(){return Ci(this,null,function*(){let t=yield cje();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield $o(Tse);if(!r||!e){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:ije()},i={typ:"dpop+jwt",alg:"ES256",jwk:t},a={protected:DY(JSON.stringify(i)),claims:DY(JSON.stringify(n))},o=lje(`${a.protected}.${a.claims}`),s={name:Rse,hash:{name:"SHA-256"}},c=dje(new Uint8Array(yield e.sign(s,r,o)));return`${a.protected}.${a.claims}.${c}`})}function cje(){return Ci(this,null,function*(){if(!yO()){console.info("webcrypto is not supported");return}return(yield $o(E5))||(yield uje()),$o(E5)})}function uje(){return Ci(this,null,function*(){let{subtle:t}=window.crypto,e=yield t.generateKey(oje,!1,["sign"]),r=yield t.exportKey("jwk",e.publicKey);yield Tl(Tse,e.privateKey),yield Tl(E5,r)})}function DY(t){return Cse(fje(t))}function lje(t){return new TextEncoder().encode(t)}function Cse(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function fje(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function dje(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),Cse(e)}var qk="ds",Hk="ek",zk="iv",Vk="AES-GCM",hje=256;function Gk(){return Ci(this,null,function*(){let t=[];yield Pse((e,r,n)=>{r.startsWith(`${qk}_`)&&t.push(r)});for(let e of t)yield gO(e)})}function Nse(t){let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return window.btoa(e)}function Dse(t){let e=window.atob(t),r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}function pje(){return Ci(this,null,function*(){if(!yO()){console.info("webcrypto is not supported");return}let{crypto:t}=window;return(yield $o(zk))||t.getRandomValues(new Uint8Array(12))})}function gje(){return Ci(this,null,function*(){if(!yO()){console.info("webcrypto is not supported");return}let{subtle:t}=window.crypto;return(yield $o(Hk))||(yield t.generateKey({name:Vk,length:hje},!1,["encrypt","decrypt"]))})}function yje(t,e){return Ci(this,null,function*(){let r=yield pje(),n=yield gje();if(!r||!n||!t)return;let i=Dse(t),{subtle:a}=window.crypto,o=yield a.encrypt({name:Vk,iv:r},n,i),s=Nse(o);yield Tl(`${qk}_${e}`,s),yield Tl(Hk,n),yield Tl(zk,r)})}function mje(t){return Ci(this,null,function*(){let e=yield $o(`${qk}_${t}`),r=yield $o(zk),n=yield $o(Hk);if(!r||!e||!n||!yO())return;let{subtle:i}=window.crypto,a=yield i.decrypt({name:Vk,iv:r},n,Dse(e));return Nse(a)})}var vje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(e){let r=an(this.sdk.testMode?vr.GetIdTokenTestMode:vr.GetIdToken,[e]);return this.request(r)}generateIdToken(e){let r=an(this.sdk.testMode?vr.GenerateIdTokenTestMode:vr.GenerateIdToken,[e]);return this.request(r)}getInfo(){return Ci(this,null,function*(){let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}isLoggedIn(){let e=an(this.sdk.testMode?vr.IsLoggedInTestMode:vr.IsLoggedIn);return this.request(e)}logout(){gO(this.localForageKey),Gk();let e=an(this.sdk.testMode?vr.LogoutTestMode:vr.Logout);return this.request(e)}requestInfoWithUI(e){let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}showSettings(e){let r=an(this.sdk.testMode?vr.UserSettingsTestMode:vr.UserSettings,[e]);return this.request(r)}recoverAccount(e){let r=an(this.sdk.testMode?vr.RecoverAccountTestMode:vr.RecoverAccount,[e]);return this.request(r)}getMetadata(){mg({method:"user.getMetadata()",removalVersions:vg,useInstead:"user.getInfo()"}).log();let e=an(this.sdk.testMode?vr.GetMetadataTestMode:vr.GetMetadata);return this.request(e)}updateEmail(e){mg({method:"user.updateEmail()",removalVersions:vg,useInstead:"auth.updateEmailWithUI()"}).log();let{email:r,showUI:n=!0}=e,i=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:r,showUI:n}]);return this.request(i)}};function QA(t,e){return e?new URL(t,e):new URL(t)}var bje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=jk((r,n)=>Ci(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(_s.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(_s.MetaMask);r(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(_s.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(_s.CoinbaseWallet);r(c);return}let i=this.getUserEnv(),a=an(vr.Login,[i]),o=this.request(a);o.on(Hb.WalletSelected,c=>this.handleWalletSelected(gse(Lk({},c),{payloadId:a.id}))),o.on("id-token-created",c=>{e.emit("id-token-created",c)});let s=yield o;s.error&&n(s),r(s)}catch(i){n(i)}}));return e}showUI(){return this.request(an(vr.ShowUI))}showAddress(){return this.request(an(vr.ShowAddress))}showSendTokensUI(){return this.request(an(vr.ShowSendTokensUI))}showOnRamp(){return this.request(an(vr.ShowOnRamp))}showNFTs(){return this.request(an(vr.ShowNFTs))}showBalances(){return this.request(an(vr.ShowBalances))}sendGaslessTransaction(e,r){return this.request(an(vr.SendGaslessTransaction,[e,r]))}getInfo(){return Ci(this,null,function*(){mg({method:"wallet.getInfo()",removalVersions:vg,useInstead:"user.getInfo()"}).log();let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}disconnect(){mg({method:"wallet.disconnect()",removalVersions:vg,useInstead:"user.logout()"}).log(),gO(this.localForageKey),Gk();let e=an(vr.Disconnect);return this.request(e)}requestUserInfoWithUI(e){mg({method:"wallet.requestUserInfoWithUI()",removalVersions:vg,useInstead:"user.requestUserInfoWithUI()"}).log();let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}getProvider(){return Ci(this,null,function*(){switch(yield $o(this.localForageKey)){case _s.MetaMask:return this.getMetaMaskProvider();case _s.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case _s.MetaMask:return this.connectToMetaMask();case _s.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let r=an("mc_is_wallet_enabled",[{wallet:e}]);return this.request(r)}handleWalletSelected(e){return Ci(this,null,function*(){try{let r=yield this.connectToThirdPartyWallet(e.wallet);yield Tl(this.localForageKey,e.wallet),this.createIntermediaryEvent(Hb.WalletConnected,e.payloadId)(r)}catch(r){console.error(r),this.createIntermediaryEvent(Hb.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return Ci(this,null,function*(){let r;e===_s.MetaMask&&(r=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===_s.CoinbaseWallet&&(r=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield Tl(this.localForageKey,e);let n=an(vr.AutoConnect,[{wallet:e,address:r}]);return this.request(n)})}},{createBoundEmitterMethod:AE,createChainingEmitterMethod:m0}=xse(),wje=class extends Np{constructor(){super(...arguments),this.isMagic=!0,this.on=m0("on",this),this.once=m0("once",this),this.addListener=m0("addListener",this),this.off=m0("off",this),this.removeListener=m0("removeListener",this),this.removeAllListeners=m0("removeAllListeners",this),this.emit=AE("emit"),this.eventNames=AE("eventNames"),this.listeners=AE("listeners"),this.listenerCount=AE("listenerCount")}sendAsync(t,e){if(!e)throw HFe({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(P1.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=YA(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>gse(Lk({},n.payload),{error:n.hasError?new R1(n.payload.error):null})))});else{let r=YA(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(P1.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new R1(n.payload.error):null,n.payload)})}}send(t,e){if(typeof t=="string"){let n=an(t,Array.isArray(e)?e:[]);return this.request(n)}if(Array.isArray(t)||e){this.sendAsync(t,e);return}let r=VFe();return r.log(),new Fk(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=an(vr.Login);return this.request(t)}request(t){return this.prefixPayloadMethodForTestMode(t),super.request(t)}prefixPayloadMethodForTestMode(t){let e="testMode/eth/";this.sdk.testMode&&(t.method=`${e}${t.method}`)}},$Y=["request","overlay","sdk"];function _je(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==Np.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var $se=class extends Np{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:jk,isPromiEvent:Sse,encodeJSON:mse,decodeJSON:DFe,createJsonRpcRequestPayload:an,standardizeJsonRpcRequestPayload:YA,storage:Ise};let t=[this,..._je(this)];$Y.forEach(e=>{let r=t.map(o=>Object.getOwnPropertyDescriptor(o,e)),n=r.findIndex(o=>!!o),i=n>0,a=r[n];a&&(this.__sdk_access_field_descriptors__.set(e,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,e,{configurable:!0,get:()=>{throw jFe(e)}}))})}init(t){this.__is_initialized__||($Y.forEach(e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,r)}}),this.sdk=t,this.__is_initialized__=!0)}createDeprecationWarning(t){let{method:e,removalVersion:r,useInstead:n}=t,i=n?` Use \`${n}\` instead.`:"",a=`\`${e}\` will be removed from this Extension in version \`${r}\`.${i}`;return new _5(this,"DEPRECATION_NOTICE",a)}createWarning(t,e){return new _5(this,t,e)}createError(t,e,r){return new Bk(this,t,e,r)}},Eje=class extends $se{},Xh=class extends $se{};Xh.Internal=Eje,Xh.Anonymous="anonymous extension";var xje=class extends Np{purchase(t){let e=an(vr.NFTPurchase,[t]);return this.request(e)}checkout(t){let e=an(vr.NFTCheckout,[t]);return this.request(e)}transfer(t){let e=an(vr.NFTTransfer,[t]);return this.request(e)}};function MY(t){return t.compat&&t.compat[zn.sdkName]!=null?typeof t.compat[zn.sdkName]=="string"?AFe(PFe(zn.version),t.compat[zn.sdkName]):!!t.compat[zn.sdkName]:!0}function Aje(t,e,r){return!e&&!r?`${t}_eth_mainnet`:r?`${t}_${JSON.stringify(r)}`:e?typeof e=="string"?`${t}_eth_${e}`:`${t}_${e.rpcUrl}_${e.chainId}_${e.chainType}`:`${t}_unknown`}function Sje(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(a=>{MY(a)?(a.init(this),(a.name||a.name!==Xh.Anonymous)&&(this[a.name]=a),a instanceof Xh.Internal&&(KA(a.config)||(n[a.name]=a.config))):i.push(a)}):Object.keys(r).forEach(a=>{if(MY(r[a])){r[a].init(this);let o=r[a];this[a]=o,o instanceof Xh.Internal&&(KA(o.config)||(n[r[a].name]=o.config))}else i.push(r[a])}),i.length)throw qFe(i);return n}var Ix=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw BFe();zn.platform==="react-native"&&(e!=null&&e.endpoint)&&GFe().log();let{defaultEndpoint:n,version:i}=zn;this.testMode=!!(e!=null&&e.testMode),this.endpoint=QA((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.auth=new ZFe(this),this.user=new vje(this),this.wallet=new bje(this),this.nft=new xje(this),this.rpcProvider=new wje(this);let a=Sje.call(this,e);this.parameters=mse(Lk({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:QA(this.endpoint).host,sdk:UFe[zn.sdkName],version:i,ext:KA(a)?void 0:a,locale:(e==null?void 0:e.locale)||"en_US"},zn.bundleId?{bundleId:zn.bundleId}:{})),this.networkHash=Aje(this.apiKey,e==null?void 0:e.network,KA(a)?void 0:a),e!=null&&e.deferPreload||this.preload()}get overlay(){if(!Ix.__overlays__.has(this.parameters)){let t=new zn.ViewController(this.endpoint,this.parameters,this.networkHash);t.init(),Ix.__overlays__.set(this.parameters,t)}return Ix.__overlays__.get(this.parameters)}preload(){return Ci(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Mse=Ix;Mse.__overlays__=new Map;function Oje(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function Ije(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=Oje(t,n);if(n&&i){let a=new Fk(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:a}}return{}}function Pje(t,e,r){return Ci(this,null,function*(){var n;let i=yield $o("rt"),a;if(zn.platform==="web")try{a=(n=yield $o("jwt"))!=null?n:yield sje()}catch(c){console.error("webcrypto error",c)}let o={msgType:t,payload:e};a&&(o.jwt=a),a&&i&&(o.rt=i);let s=yield mje(r);return s&&(o.deviceShare=s),o})}function Tje(t){return Ci(this,null,function*(){!t.data.rt||(yield Tl("rt",t.data.rt))})}var Rje=class{constructor(t,e,r){this.endpoint=t,this.parameters=e,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(t,e){return Ci(this,null,function*(){return Ose((r,n)=>Ci(this,null,function*(){if(!this.isConnectedToInternet){let u=bse();n(u)}this.isReadyForRequest||(yield this.waitForReady());let i=[],a=Array.isArray(e)?e.map(u=>u.id):[],o=yield Pje(`${t}-${this.parameters}`,e,this.networkHash);yield this._post(o);let s=u=>f=>{var d;let{id:g,response:m}=Ije(e,f);if(Tje(f),((d=m==null?void 0:m.payload.error)==null?void 0:d.message)==="User denied account access.")Gk();else if(f.data.deviceShare){let{deviceShare:w}=f.data;yje(w,this.networkHash)}g&&m&&Array.isArray(e)&&a.includes(g)?(i.push(m),i.length===e.length&&(u(),r(i))):g&&m&&!Array.isArray(e)&&g===e.id&&(u(),r(m))},c=this.on(Ah.MAGIC_HANDLE_RESPONSE,s(()=>c()))}))})}on(t,e){let r=e.bind(window),n=i=>{i.data.msgType===`${t}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(t=>{let e=this.on(Ah.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,t(),e()})})}listen(){this.on(Ah.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Ah.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Cje=Object.create,kse=Object.defineProperty,Nje=Object.getOwnPropertyDescriptor,Dje=Object.getOwnPropertyNames,$je=Object.getPrototypeOf,Mje=Object.prototype.hasOwnProperty,SE=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Lse=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kje=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Dje(e))!Mje.call(t,i)&&i!==r&&kse(t,i,{get:()=>e[i],enumerable:!(n=Nje(e,i))||n.enumerable});return t},Use=(t,e,r)=>(r=t!=null?Cje($je(t)):{},kje(e||!t||!t.__esModule?kse(r,"default",{value:t,enumerable:!0}):r,t)),Px=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),Lje=Lse((t,e)=>{(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){return function r(n,i,a){function o(u,f){if(!i[u]){if(!n[u]){var d=typeof SE=="function"&&SE;if(!f&&d)return d(u,!0);if(s)return s(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var m=i[u]={exports:{}};n[u][0].call(m.exports,function(w){var v=n[u][1][w];return o(v||w)},m,m.exports,r,n,i,a)}return i[u].exports}for(var s=typeof SE=="function"&&SE,c=0;c<a.length;c++)o(a[c]);return o}({1:[function(r,n,i){(function(a){var o=a.MutationObserver||a.WebKitMutationObserver,s;if(o){var c=0,u=new o(w),f=a.document.createTextNode("");u.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var d=new a.MessageChannel;d.port1.onmessage=w,s=function(){d.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?s=function(){var y=a.document.createElement("script");y.onreadystatechange=function(){w(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},a.document.documentElement.appendChild(y)}:s=function(){setTimeout(w,0)};var g,m=[];function w(){g=!0;for(var y,_,b=m.length;b;){for(_=m,m=[],y=-1;++y<b;)_[y]();b=m.length}g=!1}n.exports=v;function v(y){m.push(y)===1&&!g&&s()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var a=r(1);function o(){}var s={},c=["REJECTED"],u=["FULFILLED"],f=["PENDING"];n.exports=d;function d(O){if(typeof O!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,O!==o&&v(this,O)}d.prototype.catch=function(O){return this.then(null,O)},d.prototype.then=function(O,E){if(typeof O!="function"&&this.state===u||typeof E!="function"&&this.state===c)return this;var p=new this.constructor(o);if(this.state!==f){var I=this.state===u?O:E;m(p,I,this.outcome)}else this.queue.push(new g(p,O,E));return p};function g(O,E,p){this.promise=O,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof p=="function"&&(this.onRejected=p,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(O){s.resolve(this.promise,O)},g.prototype.otherCallFulfilled=function(O){m(this.promise,this.onFulfilled,O)},g.prototype.callRejected=function(O){s.reject(this.promise,O)},g.prototype.otherCallRejected=function(O){m(this.promise,this.onRejected,O)};function m(O,E,p){a(function(){var I;try{I=E(p)}catch(C){return s.reject(O,C)}I===O?s.reject(O,new TypeError("Cannot resolve promise with itself")):s.resolve(O,I)})}s.resolve=function(O,E){var p=y(w,E);if(p.status==="error")return s.reject(O,p.value);var I=p.value;if(I)v(O,I);else{O.state=u,O.outcome=E;for(var C=-1,L=O.queue.length;++C<L;)O.queue[C].callFulfilled(E)}return O},s.reject=function(O,E){O.state=c,O.outcome=E;for(var p=-1,I=O.queue.length;++p<I;)O.queue[p].callRejected(E);return O};function w(O){var E=O&&O.then;if(O&&(typeof O=="object"||typeof O=="function")&&typeof E=="function")return function(){E.apply(O,arguments)}}function v(O,E){var p=!1;function I(le){p||(p=!0,s.reject(O,le))}function C(le){p||(p=!0,s.resolve(O,le))}function L(){E(C,I)}var q=y(L);q.status==="error"&&I(q.value)}function y(O,E){var p={};try{p.value=O(E),p.status="success"}catch(I){p.status="error",p.value=I}return p}d.resolve=_;function _(O){return O instanceof this?O:s.resolve(new this(o),O)}d.reject=b;function b(O){var E=new this(o);return s.reject(E,O)}d.all=S;function S(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=new Array(p),L=0,q=-1,le=new this(o);++q<p;)pe(O[q],q);return le;function pe(B,U){E.resolve(B).then(K,function(ne){I||(I=!0,s.reject(le,ne))});function K(ne){C[U]=ne,++L===p&&!I&&(I=!0,s.resolve(le,C))}}}d.race=x;function x(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=-1,L=new this(o);++C<p;)q(O[C]);return L;function q(le){E.resolve(le).then(function(pe){I||(I=!0,s.resolve(L,pe))},function(pe){I||(I=!0,s.reject(L,pe))})}}},{1:1}],3:[function(r,n,i){(function(a){typeof a.Promise!="function"&&(a.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X};function o(X,me){if(!(X instanceof me))throw new TypeError("Cannot call a class as a function")}function s(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=s();function u(){try{if(!c||!c.open)return!1;var X=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),me=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!X||me)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(X,me){X=X||[],me=me||{};try{return new Blob(X,me)}catch(Oe){if(Oe.name!=="TypeError")throw Oe;for(var re=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,Ee=new re,be=0;be<X.length;be+=1)Ee.append(X[be]);return Ee.getBlob(me.type)}}typeof Promise>"u"&&r(3);var d=Promise;function g(X,me){me&&X.then(function(re){me(null,re)},function(re){me(re)})}function m(X,me,re){typeof me=="function"&&X.then(me),typeof re=="function"&&X.catch(re)}function w(X){return typeof X!="string"&&(console.warn(X+" used as a key, but it is not a string."),X=String(X)),X}function v(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var y="local-forage-detect-blob-support",_=void 0,b={},S=Object.prototype.toString,x="readonly",O="readwrite";function E(X){for(var me=X.length,re=new ArrayBuffer(me),Ee=new Uint8Array(re),be=0;be<me;be++)Ee[be]=X.charCodeAt(be);return re}function p(X){return new d(function(me){var re=X.transaction(y,O),Ee=f([""]);re.objectStore(y).put(Ee,"key"),re.onabort=function(be){be.preventDefault(),be.stopPropagation(),me(!1)},re.oncomplete=function(){var be=navigator.userAgent.match(/Chrome\/(\d+)/),Oe=navigator.userAgent.match(/Edge\//);me(Oe||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function I(X){return typeof _=="boolean"?d.resolve(_):p(X).then(function(me){return _=me,_})}function C(X){var me=b[X.name],re={};re.promise=new d(function(Ee,be){re.resolve=Ee,re.reject=be}),me.deferredOperations.push(re),me.dbReady?me.dbReady=me.dbReady.then(function(){return re.promise}):me.dbReady=re.promise}function L(X){var me=b[X.name],re=me.deferredOperations.pop();if(re)return re.resolve(),re.promise}function q(X,me){var re=b[X.name],Ee=re.deferredOperations.pop();if(Ee)return Ee.reject(me),Ee.promise}function le(X,me){return new d(function(re,Ee){if(b[X.name]=b[X.name]||H(),X.db)if(me)C(X),X.db.close();else return re(X.db);var be=[X.name];me&&be.push(X.version);var Oe=c.open.apply(c,be);me&&(Oe.onupgradeneeded=function(Qe){var ft=Oe.result;try{ft.createObjectStore(X.storeName),Qe.oldVersion<=1&&ft.createObjectStore(y)}catch(Ye){if(Ye.name==="ConstraintError")console.warn('The database "'+X.name+'" has been upgraded from version '+Qe.oldVersion+" to version "+Qe.newVersion+', but the storage "'+X.storeName+'" already exists.');else throw Ye}}),Oe.onerror=function(Qe){Qe.preventDefault(),Ee(Oe.error)},Oe.onsuccess=function(){var Qe=Oe.result;Qe.onversionchange=function(ft){ft.target.close()},re(Qe),L(X)}})}function pe(X){return le(X,!1)}function B(X){return le(X,!0)}function U(X,me){if(!X.db)return!0;var re=!X.db.objectStoreNames.contains(X.storeName),Ee=X.version<X.db.version,be=X.version>X.db.version;if(Ee&&(X.version!==me&&console.warn('The database "'+X.name+`" can't be downgraded from version `+X.db.version+" to version "+X.version+"."),X.version=X.db.version),be||re){if(re){var Oe=X.db.version+1;Oe>X.version&&(X.version=Oe)}return!0}return!1}function K(X){return new d(function(me,re){var Ee=new FileReader;Ee.onerror=re,Ee.onloadend=function(be){var Oe=btoa(be.target.result||"");me({__local_forage_encoded_blob:!0,data:Oe,type:X.type})},Ee.readAsBinaryString(X)})}function ne(X){var me=E(atob(X.data));return f([me],{type:X.type})}function F(X){return X&&X.__local_forage_encoded_blob}function j(X){var me=this,re=me._initReady().then(function(){var Ee=b[me._dbInfo.name];if(Ee&&Ee.dbReady)return Ee.dbReady});return m(re,X,X),re}function z(X){C(X);for(var me=b[X.name],re=me.forages,Ee=0;Ee<re.length;Ee++){var be=re[Ee];be._dbInfo.db&&(be._dbInfo.db.close(),be._dbInfo.db=null)}return X.db=null,pe(X).then(function(Oe){return X.db=Oe,U(X)?B(X):Oe}).then(function(Oe){X.db=me.db=Oe;for(var Qe=0;Qe<re.length;Qe++)re[Qe]._dbInfo.db=Oe}).catch(function(Oe){throw q(X,Oe),Oe})}function $(X,me,re,Ee){Ee===void 0&&(Ee=1);try{var be=X.db.transaction(X.storeName,me);re(null,be)}catch(Oe){if(Ee>0&&(!X.db||Oe.name==="InvalidStateError"||Oe.name==="NotFoundError"))return d.resolve().then(function(){if(!X.db||Oe.name==="NotFoundError"&&!X.db.objectStoreNames.contains(X.storeName)&&X.version<=X.db.version)return X.db&&(X.version=X.db.version+1),B(X)}).then(function(){return z(X).then(function(){$(X,me,re,Ee-1)})}).catch(re);re(Oe)}}function H(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function k(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=X[Ee];var be=b[re.name];be||(be=H(),b[re.name]=be),be.forages.push(me),me._initReady||(me._initReady=me.ready,me.ready=j);var Oe=[];function Qe(){return d.resolve()}for(var ft=0;ft<be.forages.length;ft++){var Ye=be.forages[ft];Ye!==me&&Oe.push(Ye._initReady().catch(Qe))}var Ve=be.forages.slice(0);return d.all(Oe).then(function(){return re.db=be.db,pe(re)}).then(function(ht){return re.db=ht,U(re,me._defaultConfig.version)?B(re):ht}).then(function(ht){re.db=be.db=ht,me._dbInfo=re;for(var Vt=0;Vt<Ve.length;Vt++){var Tr=Ve[Vt];Tr!==me&&(Tr._dbInfo.db=re.db,Tr._dbInfo.version=re.version)}})}function M(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=Ye.get(X);Ve.onsuccess=function(){var ht=Ve.result;ht===void 0&&(ht=null),F(ht)&&(ht=ne(ht)),be(ht)},Ve.onerror=function(){Oe(Ve.error)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function G(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=Ye.openCursor(),ht=1;Ve.onsuccess=function(){var Vt=Ve.result;if(Vt){var Tr=Vt.value;F(Tr)&&(Tr=ne(Tr));var Wr=X(Tr,Vt.key,ht++);Wr!==void 0?be(Wr):Vt.continue()}else be()},Ve.onerror=function(){Oe(Ve.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function ge(X,me,re){var Ee=this;X=w(X);var be=new d(function(Oe,Qe){var ft;Ee.ready().then(function(){return ft=Ee._dbInfo,S.call(me)==="[object Blob]"?I(ft.db).then(function(Ye){return Ye?me:K(me)}):me}).then(function(Ye){$(Ee._dbInfo,O,function(Ve,ht){if(Ve)return Qe(Ve);try{var Vt=ht.objectStore(Ee._dbInfo.storeName);Ye===null&&(Ye=void 0);var Tr=Vt.put(Ye,X);ht.oncomplete=function(){Ye===void 0&&(Ye=null),Oe(Ye)},ht.onabort=ht.onerror=function(){var Wr=Tr.error?Tr.error:Tr.transaction.error;Qe(Wr)}}catch(Wr){Qe(Wr)}})}).catch(Qe)});return g(be,re),be}function Q(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,O,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=Ye.delete(X);ft.oncomplete=function(){be()},ft.onerror=function(){Oe(Ve.error)},ft.onabort=function(){var ht=Ve.error?Ve.error:Ve.transaction.error;Oe(ht)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function te(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,O,function(Oe,Qe){if(Oe)return be(Oe);try{var ft=Qe.objectStore(me._dbInfo.storeName),Ye=ft.clear();Qe.oncomplete=function(){Ee()},Qe.onabort=Qe.onerror=function(){var Ve=Ye.error?Ye.error:Ye.transaction.error;be(Ve)}}catch(Ve){be(Ve)}})}).catch(be)});return g(re,X),re}function ce(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Qe){if(Oe)return be(Oe);try{var ft=Qe.objectStore(me._dbInfo.storeName),Ye=ft.count();Ye.onsuccess=function(){Ee(Ye.result)},Ye.onerror=function(){be(Ye.error)}}catch(Ve){be(Ve)}})}).catch(be)});return g(re,X),re}function T(X,me){var re=this,Ee=new d(function(be,Oe){if(X<0){be(null);return}re.ready().then(function(){$(re._dbInfo,x,function(Qe,ft){if(Qe)return Oe(Qe);try{var Ye=ft.objectStore(re._dbInfo.storeName),Ve=!1,ht=Ye.openKeyCursor();ht.onsuccess=function(){var Vt=ht.result;if(!Vt){be(null);return}X===0||Ve?be(Vt.key):(Ve=!0,Vt.advance(X))},ht.onerror=function(){Oe(ht.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function fe(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Qe){if(Oe)return be(Oe);try{var ft=Qe.objectStore(me._dbInfo.storeName),Ye=ft.openKeyCursor(),Ve=[];Ye.onsuccess=function(){var ht=Ye.result;if(!ht){Ee(Ve);return}Ve.push(ht.key),ht.continue()},Ye.onerror=function(){be(Ye.error)}}catch(ht){be(ht)}})}).catch(be)});return g(re,X),re}function ze(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;if(!X.name)be=d.reject("Invalid arguments");else{var Oe=X.name===re.name&&Ee._dbInfo.db,Qe=Oe?d.resolve(Ee._dbInfo.db):pe(X).then(function(ft){var Ye=b[X.name],Ve=Ye.forages;Ye.db=ft;for(var ht=0;ht<Ve.length;ht++)Ve[ht]._dbInfo.db=ft;return ft});X.storeName?be=Qe.then(function(ft){if(ft.objectStoreNames.contains(X.storeName)){var Ye=ft.version+1;C(X);var Ve=b[X.name],ht=Ve.forages;ft.close();for(var Vt=0;Vt<ht.length;Vt++){var Tr=ht[Vt];Tr._dbInfo.db=null,Tr._dbInfo.version=Ye}var Wr=new d(function(Fr,_n){var jr=c.open(X.name,Ye);jr.onerror=function(P){var D=jr.result;D.close(),_n(P)},jr.onupgradeneeded=function(){var P=jr.result;P.deleteObjectStore(X.storeName)},jr.onsuccess=function(){var P=jr.result;P.close(),Fr(P)}});return Wr.then(function(Fr){Ve.db=Fr;for(var _n=0;_n<ht.length;_n++){var jr=ht[_n];jr._dbInfo.db=Fr,L(jr._dbInfo)}}).catch(function(Fr){throw(q(X,Fr)||d.resolve()).catch(function(){}),Fr})}}):be=Qe.then(function(ft){C(X);var Ye=b[X.name],Ve=Ye.forages;ft.close();for(var ht=0;ht<Ve.length;ht++){var Vt=Ve[ht];Vt._dbInfo.db=null}var Tr=new d(function(Wr,Fr){var _n=c.deleteDatabase(X.name);_n.onerror=function(){var jr=_n.result;jr&&jr.close(),Fr(_n.error)},_n.onblocked=function(){console.warn('dropInstance blocked for database "'+X.name+'" until all open connections are closed')},_n.onsuccess=function(){var jr=_n.result;jr&&jr.close(),Wr(jr)}});return Tr.then(function(Wr){Ye.db=Wr;for(var Fr=0;Fr<Ve.length;Fr++){var _n=Ve[Fr];L(_n._dbInfo)}}).catch(function(Wr){throw(q(X,Wr)||d.resolve()).catch(function(){}),Wr})})}return g(be,me),be}var tt={_driver:"asyncStorage",_initStorage:k,_support:u(),iterate:G,getItem:M,setItem:ge,removeItem:Q,clear:te,length:ce,key:T,keys:fe,dropInstance:ze};function mt(){return typeof openDatabase=="function"}var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="~~local_forage_type~",Lt=/^~~local_forage_type~([^~]+)~/,Yt="__lfsc__:",wr=Yt.length,Rt="arbf",Pt="blob",kt="si08",Nt="ui08",Kt="uic8",Ut="si16",zt="si32",$t="ur16",Dt="ui32",qt="fl32",Mt="fl64",cr=wr+Rt.length,tr=Object.prototype.toString;function ir(X){var me=X.length*.75,re=X.length,Ee,be=0,Oe,Qe,ft,Ye;X[X.length-1]==="="&&(me--,X[X.length-2]==="="&&me--);var Ve=new ArrayBuffer(me),ht=new Uint8Array(Ve);for(Ee=0;Ee<re;Ee+=4)Oe=vt.indexOf(X[Ee]),Qe=vt.indexOf(X[Ee+1]),ft=vt.indexOf(X[Ee+2]),Ye=vt.indexOf(X[Ee+3]),ht[be++]=Oe<<2|Qe>>4,ht[be++]=(Qe&15)<<4|ft>>2,ht[be++]=(ft&3)<<6|Ye&63;return Ve}function nr(X){var me=new Uint8Array(X),re="",Ee;for(Ee=0;Ee<me.length;Ee+=3)re+=vt[me[Ee]>>2],re+=vt[(me[Ee]&3)<<4|me[Ee+1]>>4],re+=vt[(me[Ee+1]&15)<<2|me[Ee+2]>>6],re+=vt[me[Ee+2]&63];return me.length%3===2?re=re.substring(0,re.length-1)+"=":me.length%3===1&&(re=re.substring(0,re.length-2)+"=="),re}function mr(X,me){var re="";if(X&&(re=tr.call(X)),X&&(re==="[object ArrayBuffer]"||X.buffer&&tr.call(X.buffer)==="[object ArrayBuffer]")){var Ee,be=Yt;X instanceof ArrayBuffer?(Ee=X,be+=Rt):(Ee=X.buffer,re==="[object Int8Array]"?be+=kt:re==="[object Uint8Array]"?be+=Nt:re==="[object Uint8ClampedArray]"?be+=Kt:re==="[object Int16Array]"?be+=Ut:re==="[object Uint16Array]"?be+=$t:re==="[object Int32Array]"?be+=zt:re==="[object Uint32Array]"?be+=Dt:re==="[object Float32Array]"?be+=qt:re==="[object Float64Array]"?be+=Mt:me(new Error("Failed to get type for BinaryArray"))),me(be+nr(Ee))}else if(re==="[object Blob]"){var Oe=new FileReader;Oe.onload=function(){var Qe=gt+X.type+"~"+nr(this.result);me(Yt+Pt+Qe)},Oe.readAsArrayBuffer(X)}else try{me(JSON.stringify(X))}catch(Qe){console.error("Couldn't convert value into a JSON string: ",X),me(null,Qe)}}function wn(X){if(X.substring(0,wr)!==Yt)return JSON.parse(X);var me=X.substring(cr),re=X.substring(wr,cr),Ee;if(re===Pt&&Lt.test(me)){var be=me.match(Lt);Ee=be[1],me=me.substring(be[0].length)}var Oe=ir(me);switch(re){case Rt:return Oe;case Pt:return f([Oe],{type:Ee});case kt:return new Int8Array(Oe);case Nt:return new Uint8Array(Oe);case Kt:return new Uint8ClampedArray(Oe);case Ut:return new Int16Array(Oe);case $t:return new Uint16Array(Oe);case zt:return new Int32Array(Oe);case Dt:return new Uint32Array(Oe);case qt:return new Float32Array(Oe);case Mt:return new Float64Array(Oe);default:throw new Error("Unkown type: "+re)}}var Yr={serialize:mr,deserialize:wn,stringToBuffer:ir,bufferToString:nr};function ai(X,me,re,Ee){X.executeSql("CREATE TABLE IF NOT EXISTS "+me.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],re,Ee)}function Dn(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=typeof X[Ee]!="string"?X[Ee].toString():X[Ee];var be=new d(function(Oe,Qe){try{re.db=openDatabase(re.name,String(re.version),re.description,re.size)}catch(ft){return Qe(ft)}re.db.transaction(function(ft){ai(ft,re,function(){me._dbInfo=re,Oe()},function(Ye,Ve){Qe(Ve)})},Qe)});return re.serializer=Yr,be}function $n(X,me,re,Ee,be,Oe){X.executeSql(re,Ee,be,function(Qe,ft){ft.code===ft.SYNTAX_ERR?Qe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(Ye,Ve){Ve.rows.length?Oe(Ye,ft):ai(Ye,me,function(){Ye.executeSql(re,Ee,be,Oe)},Oe)},Oe):Oe(Qe,ft)},Oe)}function Kn(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"SELECT * FROM "+Qe.storeName+" WHERE key = ? LIMIT 1",[X],function(Ye,Ve){var ht=Ve.rows.length?Ve.rows.item(0).value:null;ht&&(ht=Qe.serializer.deserialize(ht)),be(ht)},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function xr(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"SELECT * FROM "+Qe.storeName,[],function(Ye,Ve){for(var ht=Ve.rows,Vt=ht.length,Tr=0;Tr<Vt;Tr++){var Wr=ht.item(Tr),Fr=Wr.value;if(Fr&&(Fr=Qe.serializer.deserialize(Fr)),Fr=X(Fr,Wr.key,Tr+1),Fr!==void 0){be(Fr);return}}be()},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function $r(X,me,re,Ee){var be=this;X=w(X);var Oe=new d(function(Qe,ft){be.ready().then(function(){me===void 0&&(me=null);var Ye=me,Ve=be._dbInfo;Ve.serializer.serialize(me,function(ht,Vt){Vt?ft(Vt):Ve.db.transaction(function(Tr){$n(Tr,Ve,"INSERT OR REPLACE INTO "+Ve.storeName+" (key, value) VALUES (?, ?)",[X,ht],function(){Qe(Ye)},function(Wr,Fr){ft(Fr)})},function(Tr){if(Tr.code===Tr.QUOTA_ERR){if(Ee>0){Qe($r.apply(be,[X,Ye,re,Ee-1]));return}ft(Tr)}})})}).catch(ft)});return g(Oe,re),Oe}function _r(X,me,re){return $r.apply(this,[X,me,re,1])}function _e(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"DELETE FROM "+Qe.storeName+" WHERE key = ?",[X],function(){be()},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function ee(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Qe){$n(Qe,Oe,"DELETE FROM "+Oe.storeName,[],function(){Ee()},function(ft,Ye){be(Ye)})})}).catch(be)});return g(re,X),re}function ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Qe){$n(Qe,Oe,"SELECT COUNT(key) as c FROM "+Oe.storeName,[],function(ft,Ye){var Ve=Ye.rows.item(0).c;Ee(Ve)},function(ft,Ye){be(Ye)})})}).catch(be)});return g(re,X),re}function Re(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Qe=re._dbInfo;Qe.db.transaction(function(ft){$n(ft,Qe,"SELECT key FROM "+Qe.storeName+" WHERE id = ? LIMIT 1",[X+1],function(Ye,Ve){var ht=Ve.rows.length?Ve.rows.item(0).key:null;be(ht)},function(Ye,Ve){Oe(Ve)})})}).catch(Oe)});return g(Ee,me),Ee}function He(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Qe){$n(Qe,Oe,"SELECT key FROM "+Oe.storeName,[],function(ft,Ye){for(var Ve=[],ht=0;ht<Ye.rows.length;ht++)Ve.push(Ye.rows.item(ht).key);Ee(Ve)},function(ft,Ye){be(Ye)})})}).catch(be)});return g(re,X),re}function Xe(X){return new d(function(me,re){X.transaction(function(Ee){Ee.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(be,Oe){for(var Qe=[],ft=0;ft<Oe.rows.length;ft++)Qe.push(Oe.rows.item(ft).name);me({db:X,storeNames:Qe})},function(be,Oe){re(Oe)})},function(Ee){re(Ee)})})}function st(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;return X.name?be=new d(function(Oe){var Qe;X.name===re.name?Qe=Ee._dbInfo.db:Qe=openDatabase(X.name,"","",0),X.storeName?Oe({db:Qe,storeNames:[X.storeName]}):Oe(Xe(Qe))}).then(function(Oe){return new d(function(Qe,ft){Oe.db.transaction(function(Ye){function Ve(Wr){return new d(function(Fr,_n){Ye.executeSql("DROP TABLE IF EXISTS "+Wr,[],function(){Fr()},function(jr,P){_n(P)})})}for(var ht=[],Vt=0,Tr=Oe.storeNames.length;Vt<Tr;Vt++)ht.push(Ve(Oe.storeNames[Vt]));d.all(ht).then(function(){Qe()}).catch(function(Wr){ft(Wr)})},function(Ye){ft(Ye)})})}):be=d.reject("Invalid arguments"),g(be,me),be}var lt={_driver:"webSQLStorage",_initStorage:Dn,_support:mt(),iterate:xr,getItem:Kn,setItem:_r,removeItem:_e,clear:ee,length:ve,key:Re,keys:He,dropInstance:st};function _t(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ue(X,me){var re=X.name+"/";return X.storeName!==me.storeName&&(re+=X.storeName+"/"),re}function Z(){var X="_localforage_support_test";try{return localStorage.setItem(X,!0),localStorage.removeItem(X),!1}catch{return!0}}function ye(){return!Z()||localStorage.length>0}function Me(X){var me=this,re={};if(X)for(var Ee in X)re[Ee]=X[Ee];return re.keyPrefix=ue(X,me._defaultConfig),ye()?(me._dbInfo=re,re.serializer=Yr,d.resolve()):d.reject()}function Le(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo.keyPrefix,be=localStorage.length-1;be>=0;be--){var Oe=localStorage.key(be);Oe.indexOf(Ee)===0&&localStorage.removeItem(Oe)}});return g(re,X),re}function wt(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo,Oe=localStorage.getItem(be.keyPrefix+X);return Oe&&(Oe=be.serializer.deserialize(Oe)),Oe});return g(Ee,me),Ee}function Ot(X,me){var re=this,Ee=re.ready().then(function(){for(var be=re._dbInfo,Oe=be.keyPrefix,Qe=Oe.length,ft=localStorage.length,Ye=1,Ve=0;Ve<ft;Ve++){var ht=localStorage.key(Ve);if(ht.indexOf(Oe)===0){var Vt=localStorage.getItem(ht);if(Vt&&(Vt=be.serializer.deserialize(Vt)),Vt=X(Vt,ht.substring(Qe),Ye++),Vt!==void 0)return Vt}}});return g(Ee,me),Ee}function pr(X,me){var re=this,Ee=re.ready().then(function(){var be=re._dbInfo,Oe;try{Oe=localStorage.key(X)}catch{Oe=null}return Oe&&(Oe=Oe.substring(be.keyPrefix.length)),Oe});return g(Ee,me),Ee}function lr(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo,be=localStorage.length,Oe=[],Qe=0;Qe<be;Qe++){var ft=localStorage.key(Qe);ft.indexOf(Ee.keyPrefix)===0&&Oe.push(ft.substring(Ee.keyPrefix.length))}return Oe});return g(re,X),re}function en(X){var me=this,re=me.keys().then(function(Ee){return Ee.length});return g(re,X),re}function gr(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo;localStorage.removeItem(be.keyPrefix+X)});return g(Ee,me),Ee}function Er(X,me,re){var Ee=this;X=w(X);var be=Ee.ready().then(function(){me===void 0&&(me=null);var Oe=me;return new d(function(Qe,ft){var Ye=Ee._dbInfo;Ye.serializer.serialize(me,function(Ve,ht){if(ht)ft(ht);else try{localStorage.setItem(Ye.keyPrefix+X,Ve),Qe(Oe)}catch(Vt){(Vt.name==="QuotaExceededError"||Vt.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ft(Vt),ft(Vt)}})})});return g(be,re),be}function on(X,me){if(me=v.apply(this,arguments),X=typeof X!="function"&&X||{},!X.name){var re=this.config();X.name=X.name||re.name,X.storeName=X.storeName||re.storeName}var Ee=this,be;return X.name?be=new d(function(Oe){X.storeName?Oe(ue(X,Ee._defaultConfig)):Oe(X.name+"/")}).then(function(Oe){for(var Qe=localStorage.length-1;Qe>=0;Qe--){var ft=localStorage.key(Qe);ft.indexOf(Oe)===0&&localStorage.removeItem(ft)}}):be=d.reject("Invalid arguments"),g(be,me),be}var sr={_driver:"localStorageWrapper",_initStorage:Me,_support:_t(),iterate:Ot,getItem:wt,setItem:Er,removeItem:gr,clear:Le,length:en,key:pr,keys:lr,dropInstance:on},Lr=function(X,me){return X===me||typeof X=="number"&&typeof me=="number"&&isNaN(X)&&isNaN(me)},gn=function(X,me){for(var re=X.length,Ee=0;Ee<re;){if(Lr(X[Ee],me))return!0;Ee++}return!1},Ur=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"},Zn={},Si={},ei={INDEXEDDB:tt,WEBSQL:lt,LOCALSTORAGE:sr},Oi=[ei.INDEXEDDB._driver,ei.WEBSQL._driver,ei.LOCALSTORAGE._driver],Ii=["dropInstance"],oi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ii),Fn={description:"",driver:Oi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ra(X,me){X[me]=function(){var re=arguments;return X.ready().then(function(){return X[me].apply(X,re)})}}function $i(){for(var X=1;X<arguments.length;X++){var me=arguments[X];if(me)for(var re in me)me.hasOwnProperty(re)&&(Ur(me[re])?arguments[0][re]=me[re].slice():arguments[0][re]=me[re])}return arguments[0]}var _a=function(){function X(me){o(this,X);for(var re in ei)if(ei.hasOwnProperty(re)){var Ee=ei[re],be=Ee._driver;this[re]=be,Zn[be]||this.defineDriver(Ee)}this._defaultConfig=$i({},Fn),this._config=$i({},this._defaultConfig,me),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return X.prototype.config=function(me){if((typeof me>"u"?"undefined":a(me))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var re in me){if(re==="storeName"&&(me[re]=me[re].replace(/\W/g,"_")),re==="version"&&typeof me[re]!="number")return new Error("Database version must be a number.");this._config[re]=me[re]}return"driver"in me&&me.driver?this.setDriver(this._config.driver):!0}else return typeof me=="string"?this._config[me]:this._config},X.prototype.defineDriver=function(me,re,Ee){var be=new d(function(Oe,Qe){try{var ft=me._driver,Ye=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver){Qe(Ye);return}for(var Ve=oi.concat("_initStorage"),ht=0,Vt=Ve.length;ht<Vt;ht++){var Tr=Ve[ht],Wr=!gn(Ii,Tr);if((Wr||me[Tr])&&typeof me[Tr]!="function"){Qe(Ye);return}}var Fr=function(){for(var jr=function(he){return function(){var Se=new Error("Method "+he+" is not implemented by the current driver"),Ce=d.reject(Se);return g(Ce,arguments[arguments.length-1]),Ce}},P=0,D=Ii.length;P<D;P++){var W=Ii[P];me[W]||(me[W]=jr(W))}};Fr();var _n=function(jr){Zn[ft]&&console.info("Redefining LocalForage driver: "+ft),Zn[ft]=me,Si[ft]=jr,Oe()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(_n,Qe):_n(!!me._support):_n(!0)}catch(jr){Qe(jr)}});return m(be,re,Ee),be},X.prototype.driver=function(){return this._driver||null},X.prototype.getDriver=function(me,re,Ee){var be=Zn[me]?d.resolve(Zn[me]):d.reject(new Error("Driver not found."));return m(be,re,Ee),be},X.prototype.getSerializer=function(me){var re=d.resolve(Yr);return m(re,me),re},X.prototype.ready=function(me){var re=this,Ee=re._driverSet.then(function(){return re._ready===null&&(re._ready=re._initDriver()),re._ready});return m(Ee,me,me),Ee},X.prototype.setDriver=function(me,re,Ee){var be=this;Ur(me)||(me=[me]);var Oe=this._getSupportedDrivers(me);function Qe(){be._config.driver=be.driver()}function ft(ht){return be._extend(ht),Qe(),be._ready=be._initStorage(be._config),be._ready}function Ye(ht){return function(){var Vt=0;function Tr(){for(;Vt<ht.length;){var Wr=ht[Vt];return Vt++,be._dbInfo=null,be._ready=null,be.getDriver(Wr).then(ft).catch(Tr)}Qe();var Fr=new Error("No available storage method found.");return be._driverSet=d.reject(Fr),be._driverSet}return Tr()}}var Ve=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=Ve.then(function(){var ht=Oe[0];return be._dbInfo=null,be._ready=null,be.getDriver(ht).then(function(Vt){be._driver=Vt._driver,Qe(),be._wrapLibraryMethodsWithReady(),be._initDriver=Ye(Oe)})}).catch(function(){Qe();var ht=new Error("No available storage method found.");return be._driverSet=d.reject(ht),be._driverSet}),m(this._driverSet,re,Ee),this._driverSet},X.prototype.supports=function(me){return!!Si[me]},X.prototype._extend=function(me){$i(this,me)},X.prototype._getSupportedDrivers=function(me){for(var re=[],Ee=0,be=me.length;Ee<be;Ee++){var Oe=me[Ee];this.supports(Oe)&&re.push(Oe)}return re},X.prototype._wrapLibraryMethodsWithReady=function(){for(var me=0,re=oi.length;me<re;me++)ra(this,oi[me])},X.prototype.createInstance=function(me){return new X(me)},X}(),as=new _a;n.exports=as},{3:3}]},{},[4])(4)})}),Uje=Lse((t,e)=>{(function(r,n){typeof t=="object"&&typeof e<"u"?n(t):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],n):n(r.LocalforageDriverMemory={})})(typeof self<"u"?self:t,function(r){var n="localforage-driver-memory";function i(F){var j=typeof Symbol=="function"&&F[Symbol.iterator],z=0;return j?j.call(F):{next:function(){return F&&z>=F.length&&(F=void 0),{value:F&&F[z++],done:!F}}}}function a(F,j){F=F||[],j=j||{};try{return new Blob(F,j)}catch(k){if(k.name!=="TypeError")throw k;for(var z=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,$=new z,H=0;H<F.length;H+=1)$.append(F[H]);return $.getBlob(j.type)}}var o=/^~~local_forage_type~([^~]+)~/,s=9,c=s+4,u=Object.prototype.toString;function f(F){var j=F.length*.75,z=F.length;F[F.length-1]==="="&&(j--,F[F.length-2]==="="&&j--);for(var $=new ArrayBuffer(j),H=new Uint8Array($),k=0,M=0;k<z;k+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k]),ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+1]),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+2]),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+3]);H[M++]=G<<2|ge>>4,H[M++]=(ge&15)<<4|Q>>2,H[M++]=(Q&3)<<6|te&63}return $}function d(F){for(var j=new Uint8Array(F),z="",$=0;$<j.length;$+=3)z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$]>>2],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$]&3)<<4|j[$+1]>>4],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$+1]&15)<<2|j[$+2]>>6],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$+2]&63];return j.length%3===2?z=z.substring(0,z.length-1)+"=":j.length%3===1&&(z=z.substring(0,z.length-2)+"=="),z}function g(F,j){var z="";if(F&&(z=u.call(F)),F&&(z==="[object ArrayBuffer]"||F.buffer&&u.call(F.buffer)==="[object ArrayBuffer]")){var $=void 0,H="__lfsc__:";F instanceof ArrayBuffer?($=F,H+="arbf"):($=F.buffer,z==="[object Int8Array]"?H+="si08":z==="[object Uint8Array]"?H+="ui08":z==="[object Uint8ClampedArray]"?H+="uic8":z==="[object Int16Array]"?H+="si16":z==="[object Uint16Array]"?H+="ur16":z==="[object Int32Array]"?H+="si32":z==="[object Uint32Array]"?H+="ui32":z==="[object Float32Array]"?H+="fl32":z==="[object Float64Array]"?H+="fl64":j(new Error("Failed to get type for BinaryArray"))),j(H+d($))}else if(z==="[object Blob]"){var k=new FileReader;k.onload=function(){var M="~~local_forage_type~"+F.type+"~"+d(this.result);j("__lfsc__:blob"+M)},k.readAsArrayBuffer(F)}else try{j(JSON.stringify(F))}catch(M){console.error("Couldn't convert value into a JSON string: ",F),j(null,M)}}function m(F){if(F.substring(0,s)!=="__lfsc__:")return JSON.parse(F);var j=F.substring(c),z=F.substring(s,c),$;if(z==="blob"&&o.test(j)){var H=j.match(o);$=H[1],j=j.substring(H[0].length)}var k=f(j);switch(z){case"arbf":return k;case"blob":return a([k],{type:$});case"si08":return new Int8Array(k);case"ui08":return new Uint8Array(k);case"uic8":return new Uint8ClampedArray(k);case"si16":return new Int16Array(k);case"ur16":return new Uint16Array(k);case"si32":return new Int32Array(k);case"ui32":return new Uint32Array(k);case"fl32":return new Float32Array(k);case"fl64":return new Float64Array(k);default:throw new Error("Unkown type: "+z)}}function w(F){var j,z;if(F===null||typeof F!="object"||"isActiveClone"in F)return F;var $=F instanceof Date?new Date(F):F.constructor();try{for(var H=i(Object.keys(F)),k=H.next();!k.done;k=H.next()){var M=k.value;Object.prototype.hasOwnProperty.call(F,M)&&(F.isActiveClone=null,$[M]=w(F[M]),delete F.isActiveClone)}}catch(G){j={error:G}}finally{try{k&&!k.done&&(z=H.return)&&z.call(H)}finally{if(j)throw j.error}}return $}function v(F,j){return(F.name||j.name)+"/"+(F.storeName||j.storeName)+"/"}function y(F,j){j&&F.then(function(z){j(null,z)},function(z){j(z)})}function _(){for(var F=[],j=0;j<arguments.length;j++)F[j]=arguments[j];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function b(F,j){var z=this;if(j=_.apply(this,arguments),F=typeof F!="function"&&F||{},!F.name){var $=this.config();F.name=F.name||$.name,F.storeName=F.storeName||$.storeName}var H;return F.name?H=new Promise(function(k){F.storeName?k(v(F,z._defaultConfig)):k(F.name+"/")}):H=Promise.reject("Invalid arguments"),{promise:H,callback:j}}function S(F){return typeof F!="string"&&(console.warn(F+" used as a key, but it is not a string."),F=String(F)),F}var x={bufferToString:d,deserialize:m,serialize:g,stringToBuffer:f},O={},E=function(){function F(j){this.kp=j,this.data={}}return F.resolve=function(j){return O[j]||(O[j]=new F(j)),O[j]},F.prototype.clear=function(){this.data={}},F.prototype.drop=function(){this.clear(),delete O[this.kp]},F.prototype.get=function(j){return this.data[j]},F.prototype.key=function(j){return this.keys()[j]},F.prototype.keys=function(){return Object.keys(this.data)},F.prototype.rm=function(j){delete this.data[j]},F.prototype.set=function(j,z){this.data[j]=z},F}();function p(F){var j=F?w(F):{},z=v(j,this._defaultConfig),$=E.resolve(z);return this._dbInfo=j,this._dbInfo.serializer=x,this._dbInfo.keyPrefix=z,this._dbInfo.mStore=$,Promise.resolve()}function I(F){var j=this,z=this.ready().then(function(){j._dbInfo.mStore.clear()});return y(z,F),z}function C(F,j){var z=b.apply(this,arguments),$=z.promise,H=z.callback,k=$.then(function(M){E.resolve(M).drop()});return y(k,H),$}function L(F,j){var z=this;F=S(F);var $=this.ready().then(function(){var H=z._dbInfo.mStore.get(F);return H==null?null:z._dbInfo.serializer.deserialize(H)});return y($,j),$}function q(F,j){var z=this,$=this.ready().then(function(){for(var H=z._dbInfo.mStore,k=H.keys(),M=0;M<k.length;M++){var G=H.get(k[M]);if(G&&(G=z._dbInfo.serializer.deserialize(G)),G=F(G,k[M],M+1),G!==void 0)return G}});return y($,j),$}function le(F,j){var z=this,$=this.ready().then(function(){var H;try{H=z._dbInfo.mStore.key(F),H===void 0&&(H=null)}catch{H=null}return H});return y($,j),$}function pe(F){var j=this,z=this.ready().then(function(){return j._dbInfo.mStore.keys()});return y(z,F),z}function B(F){var j=this.keys().then(function(z){return z.length});return y(j,F),j}function U(F,j){var z=this;F=S(F);var $=this.ready().then(function(){z._dbInfo.mStore.rm(F)});return y($,j),$}function K(F,j,z){var $=this;F=S(F);var H=this.ready().then(function(){j===void 0&&(j=null);var k=j;return new Promise(function(M,G){$._dbInfo.serializer.serialize(j,function(ge,Q){if(Q)G(Q);else try{$._dbInfo.mStore.set(F,ge),M(k)}catch(te){G(te)}})})});return y(H,z),H}var ne=!0;r._support=ne,r._driver=n,r._initStorage=p,r.clear=I,r.dropInstance=C,r.getItem=L,r.iterate=q,r.key=le,r.keys=pe,r.length=B,r.removeItem=U,r.setItem=K,Object.defineProperty(r,"__esModule",{value:!0})})}),kN=Use(Lje()),kY=Use(Uje()),Bje={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function Fje(t){for(let[e,r]of Object.entries(Bje))t.style[e]=r}function jje(t){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(r=>r.src.includes(t))}var qje=class extends Rje{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(t=>{let e=()=>{if(jje(encodeURIComponent(this.parameters)))zFe().log();else{let r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=QA(this.endpoint).host,r.title="Secure Modal",r.src=QA(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,Fje(r),document.body.appendChild(r),t(r)}};["loaded","interactive","complete"].includes(document.readyState)?e():window.addEventListener("load",e,!1)}),window.addEventListener("message",t=>{var e;if(t.origin===this.endpoint&&t.data&&t.data.msgType&&this.messageHandlers.size){t.data.response=(e=t.data.response)!=null?e:{};for(let r of this.messageHandlers.values())r(t)}})}showOverlay(){return Px(this,null,function*(){let t=yield this.iframe;t.style.display="block",this.activeElement=document.activeElement,t.focus()})}hideOverlay(){return Px(this,null,function*(){var t;let e=yield this.iframe;e.style.display="none",(t=this.activeElement)!=null&&t.focus&&this.activeElement.focus(),this.activeElement=null})}_post(t){return Px(this,null,function*(){let e=yield this.iframe;if(e&&e.contentWindow)e.contentWindow.postMessage(t,this.endpoint);else throw bse()})}},Hje=LFe(Mse,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:qje,configureStorage:()=>Px(void 0,null,function*(){let t=kN.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(kY),yield t.setDriver([kN.default.INDEXEDDB,kN.default.LOCALSTORAGE,kY._driver]),t})});const Wk=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:sse,DeviceVerificationEventEmit:WA,DeviceVerificationEventOnReceived:fse,EthChainType:dse,Events:Hb,Extension:Xh,ExtensionError:Bk,ExtensionWarning:_5,LoginWithEmailOTPEventEmit:V0,LoginWithEmailOTPEventOnReceived:lse,LoginWithMagicLinkEventEmit:cse,LoginWithMagicLinkEventOnReceived:use,Magic:Hje,MagicIncomingWindowMessage:Ah,MagicOutgoingWindowMessage:P1,MagicPayloadMethod:vr,RPCError:R1,RPCErrorCode:hO,RecoveryMethodType:hse,SDKError:Id,SDKErrorCode:Od,SDKWarning:kw,SDKWarningCode:cm,Wallets:_s,isPromiEvent:Sse},Symbol.toStringTag,{value:"Module"})),zje=uo(Wk);var Bse={exports:{}},LN={exports:{}},LY;function Fse(){return LY||(LY=1,function(t,e){(function(r,n){t.exports=n()})(Ne,function(){var r=r||function(n,i){var a=Object.create||function(){function y(){}return function(_){var b;return y.prototype=_,b=new y,y.prototype=null,b}}(),o={},s=o.lib={},c=s.Base=function(){return{extend:function(y){var _=a(this);return y&&_.mixIn(y),(!_.hasOwnProperty("init")||this.init===_.init)&&(_.init=function(){_.$super.init.apply(this,arguments)}),_.init.prototype=_,_.$super=this,_},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var _ in y)y.hasOwnProperty(_)&&(this[_]=y[_]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=s.WordArray=c.extend({init:function(y,_){y=this.words=y||[],_!=i?this.sigBytes=_:this.sigBytes=y.length*4},toString:function(y){return(y||d).stringify(this)},concat:function(y){var _=this.words,b=y.words,S=this.sigBytes,x=y.sigBytes;if(this.clamp(),S%4)for(var O=0;O<x;O++){var E=b[O>>>2]>>>24-O%4*8&255;_[S+O>>>2]|=E<<24-(S+O)%4*8}else for(var O=0;O<x;O+=4)_[S+O>>>2]=b[O>>>2];return this.sigBytes+=x,this},clamp:function(){var y=this.words,_=this.sigBytes;y[_>>>2]&=4294967295<<32-_%4*8,y.length=n.ceil(_/4)},clone:function(){var y=c.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var _=[],b=function(p){var p=p,I=987654321,C=4294967295;return function(){I=36969*(I&65535)+(I>>16)&C,p=18e3*(p&65535)+(p>>16)&C;var L=(I<<16)+p&C;return L/=4294967296,L+=.5,L*(n.random()>.5?1:-1)}},S=0,x;S<y;S+=4){var O=b((x||n.random())*4294967296);x=O()*987654071,_.push(O()*4294967296|0)}return new u.init(_,y)}}),f=o.enc={},d=f.Hex={stringify:function(y){for(var _=y.words,b=y.sigBytes,S=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;S.push((O>>>4).toString(16)),S.push((O&15).toString(16))}return S.join("")},parse:function(y){for(var _=y.length,b=[],S=0;S<_;S+=2)b[S>>>3]|=parseInt(y.substr(S,2),16)<<24-S%8*4;return new u.init(b,_/2)}},g=f.Latin1={stringify:function(y){for(var _=y.words,b=y.sigBytes,S=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;S.push(String.fromCharCode(O))}return S.join("")},parse:function(y){for(var _=y.length,b=[],S=0;S<_;S++)b[S>>>2]|=(y.charCodeAt(S)&255)<<24-S%4*8;return new u.init(b,_)}},m=f.Utf8={stringify:function(y){try{return decodeURIComponent(escape(g.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return g.parse(unescape(encodeURIComponent(y)))}},w=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var _=this._data,b=_.words,S=_.sigBytes,x=this.blockSize,O=x*4,E=S/O;y?E=n.ceil(E):E=n.max((E|0)-this._minBufferSize,0);var p=E*x,I=n.min(p*4,S);if(p){for(var C=0;C<p;C+=x)this._doProcessBlock(b,C);var L=b.splice(0,p);_.sigBytes-=I}return new u.init(L,I)},clone:function(){var y=c.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});s.Hasher=w.extend({cfg:c.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var _=this._doFinalize();return _},blockSize:16,_createHelper:function(y){return function(_,b){return new y.init(b).finalize(_)}},_createHmacHelper:function(y){return function(_,b){return new v.HMAC.init(y,b).finalize(_)}}});var v=o.algo={};return o}(Math);return r})}(LN)),LN.exports}(function(t,e){(function(r,n){t.exports=n(Fse())})(Ne,function(r){return function(n){var i=r,a=i.lib,o=a.WordArray,s=a.Hasher,c=i.algo,u=[],f=[];(function(){function m(_){for(var b=n.sqrt(_),S=2;S<=b;S++)if(!(_%S))return!1;return!0}function w(_){return(_-(_|0))*4294967296|0}for(var v=2,y=0;y<64;)m(v)&&(y<8&&(u[y]=w(n.pow(v,1/2))),f[y]=w(n.pow(v,1/3)),y++),v++})();var d=[],g=c.SHA256=s.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(m,w){for(var v=this._hash.words,y=v[0],_=v[1],b=v[2],S=v[3],x=v[4],O=v[5],E=v[6],p=v[7],I=0;I<64;I++){if(I<16)d[I]=m[w+I]|0;else{var C=d[I-15],L=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,q=d[I-2],le=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;d[I]=L+d[I-7]+le+d[I-16]}var pe=x&O^~x&E,B=y&_^y&b^_&b,U=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),K=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),ne=p+K+pe+f[I]+d[I],F=U+B;p=E,E=O,O=x,x=S+ne|0,S=b,b=_,_=y,y=ne+F|0}v[0]=v[0]+y|0,v[1]=v[1]+_|0,v[2]=v[2]+b|0,v[3]=v[3]+S|0,v[4]=v[4]+x|0,v[5]=v[5]+O|0,v[6]=v[6]+E|0,v[7]=v[7]+p|0},_doFinalize:function(){var m=this._data,w=m.words,v=this._nDataBytes*8,y=m.sigBytes*8;return w[y>>>5]|=128<<24-y%32,w[(y+64>>>9<<4)+14]=n.floor(v/4294967296),w[(y+64>>>9<<4)+15]=v,m.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});i.SHA256=s._createHelper(g),i.HmacSHA256=s._createHmacHelper(g)}(Math),r.SHA256})})(Bse);var Vje=Bse.exports;const Gje=Nc(Vje);var jse={exports:{}};(function(t,e){(function(r,n){t.exports=n(Fse())})(Ne,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,o=n.enc;o.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var g=[],m=0;m<f;m+=3)for(var w=u[m>>>2]>>>24-m%4*8&255,v=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,_=w<<16|v<<8|y,b=0;b<4&&m+b*.75<f;b++)g.push(d.charAt(_>>>6*(3-b)&63));var S=d.charAt(64);if(S)for(;g.length%4;)g.push(S);return g.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var g=0;g<f.length;g++)d[f.charCodeAt(g)]=g}var m=f.charAt(64);if(m){var w=c.indexOf(m);w!==-1&&(u=w)}return s(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(c,u,f){for(var d=[],g=0,m=0;m<u;m++)if(m%4){var w=f[c.charCodeAt(m-1)]<<m%4*2,v=f[c.charCodeAt(m)]>>>6-m%4*2;d[g>>>2]|=(w|v)<<24-g%4*8,g++}return a.create(d,g)}}(),r.enc.Base64})})(jse);var Wje=jse.exports;const Kje=Nc(Wje);var Lw=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),qse=(t=>(t.ParseRedirectResult="magic_oauth_parse_redirect_result",t))(qse||{}),Hse=(t=>(t.InvalidRequest="invalid_request",t.InvalidClient="invalid_client",t.InvalidScope="invalid_scope",t.InvalidGrant="invalid_grant",t.UnauthorizedClient="unauthorized_client",t.UnsupportedResponseType="unsupported_response_type",t.UnsupportedGrantType="unsupported_grant_type",t.UnsupportedTokenType="unsupported_token_type",t.AccessDenied="access_denied",t.ServerError="server_error",t.TemporarilyUnavailable="temporarily_unavailable",t))(Hse||{}),UY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",zse=typeof window<"u"&&!!window.crypto,Yje=zse&&!!window.crypto.subtle;function Qje(t){return Array.from(t).map(e=>UY[e%UY.length]).join("")}function BY(t){let e=r=>r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");if(t instanceof ArrayBuffer){let r=new Uint8Array(t),n=Array.from(r).map(a=>String.fromCharCode(a)).join(""),i=btoa(n);return e(i)}return e(Kje.stringify(t))}function Jje(t){return Lw(this,null,function*(){if(Yje){let e=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",e).then(BY)}return BY(Gje(t))})}function FY(t){let e=new Uint8Array(t);if(zse)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.floor(Math.random()*Math.floor(255));return Qje(e)}function Xje(){return Lw(this,null,function*(){let t=FY(128),e=FY(128),r=yield Jje(e);return{verifier:e,challenge:r,state:t}})}var Zje=class extends Xh.Internal{constructor(){super(...arguments),this.name="oauth",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1}}loginWithRedirect(t){return this.utils.createPromiEvent(e=>Lw(this,null,function*(){let{provider:r,query:n}=yield eqe.call(this,t);window.location.href=new URL(`/v1/oauth2/${r}/start?${n}`,this.sdk.endpoint).href,e()}))}getRedirectResult(){let t=window.location.search,e=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",e),tqe.call(this,t)}},JA="oauth_redirect_metadata";function eqe(t){return Lw(this,null,function*(){yield this.utils.storage.removeItem(JA);let{provider:e,redirectURI:r,scope:n,loginHint:i}=t,{verifier:a,challenge:o,state:s}=yield Xje(),c=JSON.stringify({verifier:a,state:s});return yield this.utils.storage.setItem(JA,c),{query:[`magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`,`magic_challenge=${encodeURIComponent(o)}`,`state=${encodeURIComponent(s)}`,`platform=${encodeURIComponent("web")}`,n&&`scope=${encodeURIComponent(n.join(" "))}`,r&&`redirect_uri=${encodeURIComponent(r)}`,i&&`login_hint=${encodeURIComponent(i)}`].reduce((u,f)=>f?`${u}&${f}`:u),provider:e,redirectURI:r}})}function tqe(t){return this.utils.createPromiEvent((e,r)=>Lw(this,null,function*(){var n;let i=yield this.utils.storage.getItem(JA),{verifier:a,state:o}=JSON.parse(i);this.utils.storage.removeItem(JA);let s=this.utils.createJsonRpcRequestPayload("magic_oauth_parse_redirect_result",[t,a,o]),c=yield this.request(s),u=c,f=c;f.error&&r(this.createError(f.error,(n=f.error_description)!=null?n:"An error occurred.",{errorURI:f.error_uri,provider:f.provider})),e(u)}))}const Kk=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:Hse,OAuthExtension:Zje,OAuthPayloadMethods:qse},Symbol.toStringTag,{value:"Module"})),rqe=uo(Kk);var nqe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iqe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jY=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&nqe(e,t,r);return iqe(e,t),e};Object.defineProperty(dO,"__esModule",{value:!0});dO.MagicConnector=void 0;const qY=Ml,HY=qs,aqe=FS;class oqe extends aqe.AbstractConnector{constructor(e){super({supportedChainIds:HY.getConfiguration()[qY.ProviderType.MAGIC].chains}),this.activate=async()=>{var r;if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const i=await this.getProvider(),a=await i.request({method:"eth_accounts"});return this.account=(r=a[0])!==null&&r!==void 0?r:null,{provider:i,chainId:this.chainId,account:this.account}},this.getProvider=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const r=await this.magic.wallet.getProvider();return Object.assign(Object.assign({},r),{request:new Proxy(r.request,{apply:async(n,i,a)=>{var o,s,c;if(((o=a[0])===null||o===void 0?void 0:o.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(s=a[0])===null||s===void 0?void 0:s.params[0])===null||c===void 0?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return n.bind(r)(...a)}})})},this.getChainId=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId},this.getAccount=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account},this.deactivate=()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");this.magic.user.logout(),this.emitDeactivate()},this.buildMagicInstance=async r=>{const{Magic:n}=await Promise.resolve().then(()=>jY(zje)),{OAuthExtension:i}=await Promise.resolve().then(()=>jY(rqe)),a=HY.getConfiguration()[qY.ProviderType.MAGIC];return new n(a.apiKey,{extensions:[new i],network:{rpcUrl:a.urls[r],chainId:r}})},this.chainId=e,this.account=null}}dO.MagicConnector=oqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(FS,t),r(qS,t),r(JS,t),r(XS,t),r(ZS,t),r(eO,t),r(dO,t)})(ZM);var Vse={},Uw={};Object.defineProperty(Uw,"__esModule",{value:!0});Uw.Storage=void 0;class sqe{}Uw.Storage=sqe;var mO={};Object.defineProperty(mO,"__esModule",{value:!0});mO.LocalStorage=void 0;const cqe=Uw;class uqe extends cqe.Storage{get(e){const r=window.localStorage.getItem(e);return r===null?void 0:r}set(e,r){window.localStorage.setItem(e,r)}remove(e){window.localStorage.removeItem(e)}removeRegExp(e){for(let r=localStorage.length-1;r>=0;r--){const n=localStorage.key(r);n&&e.test(n)&&localStorage.removeItem(n)}}}mO.LocalStorage=uqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Uw,t),r(mO,t)})(Vse);var vO={};Object.defineProperty(vO,"__esModule",{value:!0});vO.ProviderAdapter=void 0;class Yk{constructor(e){this.provider=e,this.id=0,this.on=(r,n)=>this.provider.on(r,n),this.emit=(r,...n)=>this.provider.emit(r,n),this.removeListener=(r,n)=>this.provider.removeListener(r,n),this.request=async({method:r,params:n})=>this.isModernProvider()?this.provider.request({method:r,params:n}):this.send(r,n),this.sendAsync=async(r,n)=>this.hasSendAsync()?this.provider.sendAsync(r,(i,a)=>{a&&!a.hasOwnProperty("result")?n(i,{id:0,jsonrpc:"2.0",result:a}):n(i,a)}):this.send(r,n)}static adapt(e){const r=new Yk(e);return Object.assign(Object.assign({},e),{on:r.on,emit:r.emit,removeListener:r.removeListener,request:r.request,sendAsync:r.sendAsync,send:r.send.bind(r)})}async send(e,r){let n,i,a;const o=typeof r=="function";if(o){const s=e;i=s.params||[],n=s.method,a=r}else n=e,i=r||[],a=(s,c)=>{if(s)throw s;return c};if(this.isModernProvider()){const[s,c]=await this.provider.request({method:n,params:i}).then(f=>[null,f]).catch(f=>[f,void 0]);return a(s,o?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[s,c]=o?await new Promise(u=>this.provider.send(e,(f,d)=>{u([f,d])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:n,params:i},(f,d)=>{u([d&&d.hasOwnProperty("error")?d.error:f,d&&d.hasOwnProperty("result")?d.result:d])}));return a(s,c)}}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}vO.ProviderAdapter=Yk;Object.defineProperty(Py,"__esModule",{value:!0});Py.connection=Py.ConnectionManager=void 0;const zY=ns(),Vo=Ac,OE=d4e,ff=ZM,lqe=Vse,UN=qs,VY=vO;class Gse{constructor(e){this.storage=e,this.getWalletName=()=>{if(this.connector instanceof ff.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:r}=UN.getConfiguration();this.storage.remove(r),ff.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(OE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(OE.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(e,r=zY.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(e,r),this.connector.on(OE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),e===Vo.ProviderType.MAGIC&&this.connector.on(OE.ConnectorEvent.Update,({chainId:a})=>{a&&this.setConnectionData(e,a)});const{provider:n,account:i}=await this.connector.activate();return this.setConnectionData(e,r),{provider:VY.ProviderAdapter.adapt(n),providerType:e,account:i||"",chainId:r}}async tryPreviousConnection(){const e=this.getConnectionData();if(!e)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const r=await this.connect(e.providerType,e.chainId);if(r.providerType===Vo.ProviderType.INJECTED){const n=await r.provider.request({method:"eth_chainId"}),i=n?parseInt(n,16):null;i&&e.chainId!==i&&this.setConnectionData(e.providerType,i)}return Object.assign(Object.assign({},r),{chainId:this.getConnectionData().chainId})}getAvailableProviders(){const e=[Vo.ProviderType.FORTMATIC,Vo.ProviderType.WALLET_CONNECT,Vo.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?e.unshift(Vo.ProviderType.INJECTED):e.unshift(Vo.ProviderType.METAMASK_MOBILE),e}async disconnect(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async createProvider(e,r=zY.ChainId.ETHEREUM_MAINNET){const i=await this.buildConnector(e,r).getProvider();return VY.ProviderAdapter.adapt(i)}buildConnector(e,r){switch(e){case Vo.ProviderType.INJECTED:return new ff.InjectedConnector(r);case Vo.ProviderType.FORTMATIC:return new ff.FortmaticConnector(r);case Vo.ProviderType.MAGIC:return new ff.MagicConnector(r);case Vo.ProviderType.WALLET_LINK:return new ff.WalletLinkConnector(r);case Vo.ProviderType.NETWORK:return new ff.NetworkConnector(r);case Vo.ProviderType.WALLET_CONNECT_V2:return new ff.WalletConnectV2Connector(r);default:throw new Error(`Invalid provider ${e}`)}}getConnectionData(){const{storageKey:e}=UN.getConfiguration(),r=this.storage.get(e);return r?JSON.parse(r):void 0}setConnectionData(e,r){const{storageKey:n}=UN.getConfiguration(),i=JSON.stringify({providerType:e,chainId:r});this.storage.set(n,i)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}Py.ConnectionManager=Gse;Py.connection=new Gse(new lqe.LocalStorage);var Wse={};Object.defineProperty(Wse,"__esModule",{value:!0});(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Py,t),r(ZM,t),r(qs,t),r(Wse,t)})(Il);const fqe="https://auth-api.decentraland.zone",dqe={AUTH_SERVER_URL:fqe},hqe="https://auth-api.decentraland.org",pqe={AUTH_SERVER_URL:hqe},gqe="https://auth-api.decentraland.today",yqe={AUTH_SERVER_URL:gqe},mqe=H0.createConfig({[H0.Env.DEVELOPMENT]:dqe,[H0.Env.STAGING]:yqe,[H0.Env.PRODUCTION]:pqe},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}}),vqe="_background_7qb0h_1",bqe="_main_7qb0h_9",wqe="_left_7qb0h_19",_qe="_right_7qb0h_28",Eqe="_changeAccount_7qb0h_42",xqe="_errorLogo_7qb0h_48",Aqe="_logo_7qb0h_57",Sqe="_title_7qb0h_63",Oqe="_description_7qb0h_70",Iqe="_code_7qb0h_77",Pqe="_buttons_7qb0h_84",Tqe="_closeWindow_7qb0h_94",zr={background:vqe,main:bqe,left:wqe,right:_qe,changeAccount:Eqe,errorLogo:xqe,logo:Aqe,title:Sqe,description:Oqe,code:Iqe,buttons:Pqe,closeWindow:Tqe},Rqe=()=>{const t=Mye(),e=I2(),[r,n]=Ge.useState(2),i=Ge.useRef(),a=Ge.useRef(),o=Ge.useRef(),s=Ge.useRef(),c=t.requestId??"",u=Ge.useCallback(async()=>new ate(await Il.connection.getProvider()),[]),f=Ge.useCallback(()=>{e(`/login?redirectTo=/auth/requests/${c}&fromRequests=true`)},[]);Ge.useEffect(()=>((async()=>{try{await Il.connection.tryPreviousConnection()}catch{f();return}try{const _=await BN("recover",{requestId:c});i.current=_;const x=await(await(await u()).getSigner()).getAddress();if(s.current=x,_.sender&&_.sender!==x.toLowerCase()){n(1);return}o.current=setTimeout(()=>{n(0)},new Date(_.expiration).getTime()-Date.now()),_.method==="dcl_personal_sign"?n(4):n(8)}catch(_){a.current=_.message,n(3)}})(),()=>{clearTimeout(o.current)}),[]),Ge.useEffect(()=>{r!==4&&r!==8&&clearTimeout(o.current)},[r]);const d=Ge.useCallback(()=>{n(5)},[]),g=Ge.useCallback(async()=>{const b=await(await u()).getSigner(),S=await b.signMessage(i.current.params[0]),x=await BN("outcome",{requestId:c,sender:await b.getAddress(),result:S});x.error?(a.current=x.error,n(6)):n(7)},[u]),m=Ge.useCallback(()=>{n(9)},[]),w=Ge.useCallback(async()=>{const _=await u(),b=await _.getSigner(),S=await _.send(i.current.method,i.current.params),x=await BN("outcome",{requestId:c,sender:await b.getAddress(),result:S});x.error?(a.current=x.error,n(10)):n(11)},[u]),v=Ge.useCallback(async()=>{await Il.connection.disconnect(),f()},[]),y=Ge.useCallback(_=>Je.jsxs("div",{children:[Je.jsx("div",{className:zr.background}),Je.jsxs("div",{className:zr.main,children:[Je.jsx("div",{className:zr.left,children:_.children}),Je.jsx("div",{className:zr.right,children:s.current?Je.jsxs(Je.Fragment,{children:[Je.jsx(Xie,{lockBeta:!0,panning:!1,disableBackground:!0,profile:s.current,dev:!1}),Je.jsx("div",{className:zr.changeAccount,children:Je.jsx(cu.Button,{inverted:!0,onClick:v,children:"Change Account"})})]}):null})]})]}),[]);return r===0?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Looks like you took too long and the request has expired"}),Je.jsx("div",{className:zr.description,children:"Please return to Decentraland's Desktop App to try again."}),Je.jsx(nh,{})]}):r===1?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Looks like you are connected with a different account."}),Je.jsx("div",{className:zr.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):r===2?Je.jsx(y,{children:Je.jsx("div",{className:zr.left,children:Je.jsx(xS,{active:!0,size:"huge"})})}):r===3?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"There was an error recovering the request..."}),Je.jsx("div",{className:zr.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),Je.jsx(nh,{})]}):r===4&&i.current?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"Verify Sign In"}),Je.jsx("div",{className:zr.description,children:"Do you see the same verification number on your Desktop App?"}),Je.jsx("div",{className:zr.code,children:i.current.code}),Je.jsxs("div",{className:zr.buttons,children:[Je.jsx(cu.Button,{inverted:!0,onClick:d,children:"No"}),Je.jsx(cu.Button,{primary:!0,onClick:g,children:"Yes, they are the same"})]})]}):r===5?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Did the number not match, or was this action not taken by you?"}),Je.jsx("div",{className:zr.description,children:"If you're trying to sign in, retry the action. If this action was not initiated by you, dismiss this message."}),Je.jsx(nh,{})]}):r===7?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"Your account is ready!"}),Je.jsx("div",{className:zr.description,children:"Return to the Desktop App and enjoy Decentraland."}),Je.jsx(nh,{})]}):r===8&&i.current?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"The Desktop App wants to interact with your wallet."}),Je.jsx("div",{className:zr.description,children:"Review the following data carefully on your wallet before approving it."}),Je.jsxs("div",{className:zr.buttons,children:[Je.jsx(cu.Button,{inverted:!0,onClick:m,children:"Deny"}),Je.jsx(cu.Button,{primary:!0,onClick:w,children:"Allow"})]})]}):r===9?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"Was this action not initiated by you?"}),Je.jsx("div",{className:zr.description,children:"If this action was not initiated by you, dismiss this message."}),Je.jsx(nh,{})]}):r===11?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.logo}),Je.jsx("div",{className:zr.title,children:"Wallet interaction complete"}),Je.jsx("div",{className:zr.description,children:"The action has been executed successfuly."}),Je.jsx(nh,{})]}):r===6||r===10?Je.jsxs(y,{children:[Je.jsx("div",{className:zr.errorLogo}),Je.jsx("div",{className:zr.title,children:"There was an error while trying to submit the request."}),Je.jsx("div",{className:zr.description,children:"Return to the Desktop App to try again, or contant support if the error persists."}),Je.jsx(nh,{})]}):null},nh=()=>Je.jsx("div",{className:zr.closeWindow,children:"You can close this window."}),BN=async(t,e)=>{const r=mqe.get("AUTH_SERVER_URL"),n=ox(r);await new Promise(a=>{n.on("connect",a)});const i=await n.emitWithAck(t,e);if(n.close(),i.error)throw new Error(i.error);return i},Cqe=()=>{const t=I2(),e=cw(),r=Ge.useCallback(async()=>{try{const n=await Il.connection.tryPreviousConnection();return!!(n.account&&n.provider)}catch{return!1}},[]);return Ge.useEffect(()=>{r().then(n=>{n?window.location.href="/":t({pathname:"/login",search:e.search})})},[r,t]),Je.jsx(xS,{active:!0,size:"huge"})},Kse=()=>{const t=cw(),r=new URLSearchParams(t.search).get("redirectTo"),n=r?decodeURIComponent(r):null;if(n!==null)try{let i;return n.startsWith("/")?i=new URL(n,window.location.origin):i=new URL(n),i.hostname!==window.location.hostname?void 0:i.href}catch{console.error("Can't parse redirectTo URL");return}};var bO={},wO=br;bO.__esModule=!0;var Qk=bO.default=void 0,Nqe=wO(Bn()),Dqe=wO(ii);wO(Ln());var $qe=wO(Ge),C0=Wn();function lp(t){var e=t.children,r=t.className,n=t.content,i=t.image,a=t.scrolling,o=(0,Dqe.default)(r,(0,C0.useKeyOnly)(i,"image"),(0,C0.useKeyOnly)(a,"scrolling"),"content"),s=(0,C0.getUnhandledProps)(lp,t),c=(0,C0.getElementType)(lp,t);return $qe.default.createElement(c,(0,Nqe.default)({},s,{className:o}),C0.childrenUtils.isNil(e)?n:e)}lp.handledProps=["as","children","className","content","image","scrolling"];lp.propTypes={};lp.create=(0,C0.createShorthandFactory)(lp,function(t){return{content:t}});var Mqe=lp;Qk=bO.default=Mqe;var Jk={},_O={},FN,GY;function kqe(){if(GY)return FN;GY=1;function t(e,r,n,i){var a=-1,o=e==null?0:e.length;for(i&&o&&(n=e[++a]);++a<o;)n=r(n,e[a],a,e);return n}return FN=t,FN}var jN,WY;function Lqe(){if(WY)return jN;WY=1;function t(e,r,n,i,a){return a(e,function(o,s,c){n=i?(i=!1,o):r(n,o,s,c)}),n}return jN=t,jN}var qN,KY;function Yse(){if(KY)return qN;KY=1;var t=kqe(),e=bw(),r=wd(),n=Lqe(),i=Di();function a(o,s,c){var u=i(o)?t:n,f=arguments.length<3;return u(o,r(s,4),c,f,e)}return qN=a,qN}var HN,YY;function Qse(){return YY||(YY=1,HN=function(e,r,n,i){var a=n?n.call(i,e,r):void 0;if(a!==void 0)return!!a;if(e===r)return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var o=Object.keys(e),s=Object.keys(r);if(o.length!==s.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<o.length;u++){var f=o[u];if(!c(f))return!1;var d=e[f],g=r[f];if(a=n?n.call(i,d,g,f):void 0,a===!1||a===void 0&&d!==g)return!1}return!0}),HN}var IE={},QY;function Uqe(){if(QY)return IE;QY=1;var t=br;IE.__esModule=!0;var e=t(wS());return IE.default=e.default,IE}var Uv={},PE={},JY;function Bqe(){if(JY)return PE;JY=1;var t=br;PE.__esModule=!0;var e=t(H$());return PE.default=e.default,PE}var XY;function Fqe(){if(XY)return Uv;XY=1;var t=Ws,e=br;Uv.__esModule=!0,Uv.default=void 0;var r=e(Bn()),n=e($c()),i=e(bS()),a=e(Ks()),o=e(ii);e(Ln());var s=t(Ge),c=Wn(),u=e(Bqe()),f=function(d){(0,n.default)(g,d);function g(){for(var w,v=arguments.length,y=new Array(v),_=0;_<v;_++)y[_]=arguments[_];return w=d.call.apply(d,[this].concat(y))||this,w.handleButtonOverrides=function(b){return{onClick:function(x,O){(0,a.default)(b,"onClick",x,O),(0,a.default)(w.props,"onActionClick",x,O)}}},w}var m=g.prototype;return m.render=function(){var v=this,y=this.props,_=y.actions,b=y.children,S=y.className,x=y.content,O=(0,o.default)("actions",S),E=(0,c.getUnhandledProps)(g,this.props),p=(0,c.getElementType)(g,this.props);return c.childrenUtils.isNil(b)?c.childrenUtils.isNil(x)?s.default.createElement(p,(0,r.default)({},E,{className:O}),(0,i.default)(_,function(I){return u.default.create(I,{overrideProps:v.handleButtonOverrides})})):s.default.createElement(p,(0,r.default)({},E,{className:O}),x):s.default.createElement(p,(0,r.default)({},E,{className:O}),b)},g}(s.Component);return Uv.default=f,f.handledProps=["actions","as","children","className","content","onActionClick"],f.propTypes={},f.create=(0,c.createShorthandFactory)(f,function(d){return{actions:d}}),Uv}var Bv={},ZY;function jqe(){if(ZY)return Bv;ZY=1;var t=br;Bv.__esModule=!0,Bv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("description",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={};var o=a;return Bv.default=o,Bv}var Fv={},eQ;function qqe(){if(eQ)return Fv;eQ=1;var t=br;Fv.__esModule=!0,Fv.default=void 0;var e=t(Bn()),r=vd,n=t(ii);t(Ln());var i=t(Ge),a=Wn();function o(c){var u=c.blurring,f=c.children,d=c.className,g=c.centered,m=c.content,w=c.inverted,v=c.mountNode,y=c.scrolling,_=i.default.useRef(),b=(0,n.default)("ui",(0,a.useKeyOnly)(w,"inverted"),(0,a.useKeyOnly)(!g,"top aligned"),"page modals dimmer transition visible active",d),S=(0,n.default)("dimmable dimmed",(0,a.useKeyOnly)(u,"blurring"),(0,a.useKeyOnly)(y,"scrolling")),x=(0,a.getUnhandledProps)(o,c),O=(0,a.getElementType)(o,c);return(0,a.useClassNamesOnNode)(v,S),i.default.useEffect(function(){_.current&&_.current.style&&_.current.style.setProperty("display","flex","important")},[]),i.default.createElement(r.Ref,{innerRef:_},i.default.createElement(O,(0,e.default)({},x,{className:b}),a.childrenUtils.isNil(f)?m:f))}o.handledProps=["as","blurring","centered","children","className","content","inverted","mountNode","scrolling"],o.propTypes={},o.create=(0,a.createShorthandFactory)(o,function(c){return{content:c}});var s=o;return Fv.default=s,Fv}var jv={},tQ;function Hqe(){if(tQ)return jv;tQ=1;var t=br;jv.__esModule=!0,jv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("header",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(s){return{content:s}});var o=a;return jv.default=o,jv}var Gu={},rQ;function zqe(){if(rQ)return Gu;rQ=1,Gu.__esModule=!0,Gu.isLegacy=Gu.getLegacyStyles=Gu.canFit=void 0;var t=0,e=50,r=function(o){var s=o.height+t,c=o.height+t,u=window.innerHeight,f=u/2,d=-(c/2),g=e,m=f+d;return m+s+g<u};Gu.canFit=r;var n=function(o,s,c){var u=s&&o?-(c.height/2):0,f=-(c.width/2);return{marginLeft:f,marginTop:u}};Gu.getLegacyStyles=n;var i=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return Gu.isLegacy=i,Gu}var Vqe=Ws,ta=br;_O.__esModule=!0;_O.default=void 0;var v0=ta(Bn()),Gqe=ta($c()),Wqe=ta(vS()),Kqe=ta(U$()),Yqe=ta(F$()),Qqe=ta(Yse()),Jqe=ta(Are()),df=ta(Ks()),nQ=vd,Xqe=ta(ii);ta(Ln());var Wu=Vqe(Ge),Zqe=ta(Qse()),Pa=Wn(),eHe=ta(Uqe()),iQ=ta(q$()),Jse=ta(Fqe()),Xse=ta(bO),tHe=ta(jqe()),Zse=ta(qqe()),ece=ta(Hqe()),zN=zqe(),Iu=function(t){(0,Gqe.default)(e,t);function e(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a))||this,n.legacy=(0,Pa.isBrowser)()&&(0,zN.isLegacy)(),n.ref=(0,Wu.createRef)(),n.dimmerRef=(0,Wu.createRef)(),n.latestDocumentMouseDownEvent=null,n.getMountNode=function(){return(0,Pa.isBrowser)()?n.props.mountNode||document.body:null},n.handleActionsOverrides=function(s){return{onActionClick:function(u,f){(0,df.default)(s,"onActionClick",u,f),(0,df.default)(n.props,"onActionClick",u,n.props),n.handleClose(u)}}},n.handleClose=function(s){n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1}))},n.handleDocumentMouseDown=function(s){n.latestDocumentMouseDownEvent=s},n.handleDocumentClick=function(s){var c=n.props.closeOnDimmerClick,u=n.latestDocumentMouseDownEvent;n.latestDocumentMouseDownEvent=null,!(!c||(0,Pa.doesNodeContainClick)(n.ref.current,u)||(0,Pa.doesNodeContainClick)(n.ref.current,s))&&(n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1})))},n.handleIconOverrides=function(s){return{onClick:function(u){(0,df.default)(s,"onClick",u),n.handleClose(u)}}},n.handleOpen=function(s){(0,df.default)(n.props,"onOpen",s,(0,v0.default)({},n.props,{open:!0})),n.setState({open:!0})},n.handlePortalMount=function(s){var c=n.props.eventPool;n.setState({scrolling:!1}),n.setPositionAndClassNames(),Pa.eventStack.sub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.sub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onMount",s,n.props)},n.handlePortalUnmount=function(s){var c=n.props.eventPool;cancelAnimationFrame(n.animationRequestId),Pa.eventStack.unsub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.unsub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onUnmount",s,n.props)},n.setPositionAndClassNames=function(){var s=n.props.centered,c,u={};if(n.ref.current){var f=n.ref.current.getBoundingClientRect(),d=(0,zN.canFit)(f);c=!d;var g=n.legacy?(0,zN.getLegacyStyles)(d,s,f):{};(0,Zqe.default)(n.state.legacyStyles,g)||(u.legacyStyles=g),n.state.scrolling!==c&&(u.scrolling=c)}(0,Jqe.default)(u)||n.setState(u),n.animationRequestId=requestAnimationFrame(n.setPositionAndClassNames)},n.renderContent=function(s){var c=n.props,u=c.actions,f=c.basic,d=c.children,g=c.className,m=c.closeIcon,w=c.content,v=c.header,y=c.size,_=c.style,b=n.state,S=b.legacyStyles,x=b.scrolling,O=(0,Xqe.default)("ui",y,(0,Pa.useKeyOnly)(f,"basic"),(0,Pa.useKeyOnly)(n.legacy,"legacy"),(0,Pa.useKeyOnly)(x,"scrolling"),"modal transition visible active",g),E=(0,Pa.getElementType)(e,n.props),p=m===!0?"close":m,I=eHe.default.create(p,{overrideProps:n.handleIconOverrides});return Wu.default.createElement(nQ.Ref,{innerRef:n.ref},Wu.default.createElement(E,(0,v0.default)({},s,{className:O,style:(0,v0.default)({},S,_)}),I,Pa.childrenUtils.isNil(d)?Wu.default.createElement(Wu.default.Fragment,null,ece.default.create(v,{autoGenerateKey:!1}),Xse.default.create(w,{autoGenerateKey:!1}),Jse.default.create(u,{overrideProps:n.handleActionsOverrides})):d))},n}var r=e.prototype;return r.componentWillUnmount=function(){this.handlePortalUnmount()},r.render=function(){var i=this.props,a=i.centered,o=i.closeOnDocumentClick,s=i.dimmer,c=i.eventPool,u=i.trigger,f=this.state,d=f.open,g=f.scrolling,m=this.getMountNode();if(!(0,Pa.isBrowser)())return(0,Wu.isValidElement)(u)?u:null;var w=(0,Pa.getUnhandledProps)(e,this.props),v=iQ.default.handledProps,y=(0,Qqe.default)(w,function(b,S,x){return(0,Yqe.default)(v,x)||(b[x]=S),b},{}),_=(0,Kqe.default)(w,v);return Wu.default.createElement(iQ.default,(0,v0.default)({closeOnDocumentClick:o},_,{trigger:u,eventPool:c,mountNode:m,open:d,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),Wu.default.createElement(nQ.Ref,{innerRef:this.dimmerRef},Zse.default.create((0,Wqe.default)(s)?s:{},{autoGenerateKey:!1,defaultProps:{blurring:s==="blurring",inverted:s==="inverted"},overrideProps:{children:this.renderContent(y),centered:a,mountNode:m,scrolling:g}})))},e}(Pa.ModernAutoControlledComponent);Iu.handledProps=["actions","as","basic","centered","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","content","defaultOpen","dimmer","eventPool","header","mountNode","onActionClick","onClose","onMount","onOpen","onUnmount","open","size","style","trigger"];Iu.propTypes={};Iu.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Iu.autoControlledProps=["open"];Iu.Actions=Jse.default;Iu.Content=Xse.default;Iu.Description=tHe.default;Iu.Dimmer=Zse.default;Iu.Header=ece.default;var rHe=Iu;_O.default=rHe;(function(t){var e=Ne&&Ne.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=void 0;var r=_O;Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return e(r).default}})})(Jk);var Xk={};var nHe=Ne&&Ne.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),iHe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),aHe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),oHe=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&iHe(e,t,r);return aHe(e,t),e};Object.defineProperty(Xk,"__esModule",{value:!0});var Zk=Xk.ModalNavigation=void 0,ih=oHe(Ge),sHe=function(t){nHe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var r=this.props,n=r.title,i=r.subtitle,a=r.onBack,o=r.onClose,s=r.onInfo;return ih.createElement("div",{className:"dcl modal-navigation"},ih.createElement("div",{className:"dcl modal-navigation-title"},n),i&&ih.createElement("div",{className:"dcl modal-navigation-subtitle"},i),a&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:a}),s&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:s}),o&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:o}))},e}(ih.PureComponent);Zk=Xk.ModalNavigation=sHe;const cHe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7397576829.commit-ee5588d/assets/warning-057948e8.svg";var Ri=(t=>(t.CONNECTING_WALLET="CONNECTING_WALLET",t.WAITING_FOR_SIGNATURE="WAITING_FOR_SIGNATURE",t.ERROR="ERROR",t.LOADING_MAGIC="LOADING_MAGIC",t.VALIDATING_SIGN_IN="VALIDATING_SIGN_IN",t))(Ri||{});function uHe(t,e){switch(t){case Ri.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case Ri.CONNECTING_WALLET:case Ri.WAITING_FOR_SIGNATURE:return e===Ml.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case Ri.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case Ri.LOADING_MAGIC:return"Redirecting..."}}const lHe="_main_1qx1l_1",fHe="_content_1qx1l_8",dHe="_errorImage_1qx1l_16",hHe="_message_1qx1l_22",pHe="_loader_1qx1l_29",qv={main:lHe,content:fHe,errorImage:dHe,message:hHe,loader:pHe},tce=t=>{const{open:e,state:r,providerType:n,onClose:i,onTryAgain:a}=t,o=r===Ri.CONNECTING_WALLET||r===Ri.WAITING_FOR_SIGNATURE||r===Ri.LOADING_MAGIC||r===Ri.VALIDATING_SIGN_IN;return Je.jsxs(Jk.Modal,{size:"tiny",open:e,children:[Je.jsx(Zk,{title:"",onClose:o?void 0:i}),Je.jsx("div",{className:qv.main,children:Je.jsxs("div",{className:qv.content,children:[r===Ri.ERROR&&Je.jsx("img",{className:qv.errorImage,src:cHe}),o&&Je.jsx(xS,{className:qv.loader,size:"huge",inline:!0}),Je.jsx("p",{className:qv.message,children:uHe(r,n)}),r===Ri.ERROR&&Je.jsx(cu.Button,{primary:!0,onClick:a,children:"Try again"})]})}),Je.jsx(Qk,{})]})};var rce={},nce={},x5={exports:{}};(function(t,e){(function(r,n){n(e)})(Ne,function(r){function n(P){if(P.jsonrpc="2.0",!P.id||typeof P.id!="number"||Math.floor(P.id)!==P.id)throw new Error(`Invalid RPC message(invalid id) message: ${JSON.stringify(P)}`);if(!P.method||typeof P.method!="string"||P.method.trim().length===0)throw new Error(`Invalid RPC message(invalid method) message: ${JSON.stringify(P)}`);if(!P.params||typeof P.params!="object")throw new Error(`Invalid RPC message(invalid params) message: ${JSON.stringify(P)}`);return P}var i={};function a(){let P,D;const W=new Promise((he,Se)=>{P=Ce=>{he(Ce),W.isPending=!1},D=Ce=>{Se(Ce),W.isPending=!1}}).catch(he=>Promise.reject(he));return W.resolve=P,W.reject=D,"finally"in W||(W.finally=he=>{W.then(he),W.catch(he)}),W.isPending=!0,W}Object.defineProperty(i,"__esModule",{value:!0});var o=i.future=a;i.default=a;var s={exports:{}};/**
|
|
171
171
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
172
172
|
*
|
|
173
173
|
* @version 0.8.0
|
|
@@ -183,5 +183,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
183
183
|
Copyright (c) 2018 Jed Watson.
|
|
184
184
|
Licensed under the MIT License (MIT), see
|
|
185
185
|
http://jedwatson.github.io/classnames
|
|
186
|
-
*/(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var n=[],i=0;i<arguments.length;i++){var a=arguments[i];if(a){var o=typeof a;if(o==="string"||o==="number")n.push(a);else if(Array.isArray(a)){if(a.length){var s=r.apply(null,a);s&&n.push(s)}}else if(o==="object"){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){n.push(a.toString());continue}for(var c in a)e.call(a,c)&&a[c]&&n.push(c)}}}return n.join(" ")}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(vce);var hze=vce.exports;const dp=Nc(hze);var pze=wS();const gze=Nc(pze),yze="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7386581352.commit-0ef8d7f/assets/logo-9a364aec.svg";var Vv={},GN,cQ;function mze(){if(cQ)return GN;cQ=1;var t=Mc(),e=vS();function r(n){return t(n)&&n.nodeType===1&&!e(n)}return GN=r,GN}var bce=Ge.createContext(),wce=Ge.createContext();function vze(t){var e=t.children,r=Ge.useState(null),n=r[0],i=r[1],a=Ge.useRef(!1);Ge.useEffect(function(){return function(){a.current=!0}},[]);var o=Ge.useCallback(function(s){a.current||i(s)},[]);return Ge.createElement(bce.Provider,{value:n},Ge.createElement(wce.Provider,{value:o},e))}var _ce=function(e){return Array.isArray(e)?e[0]:e},Ece=function(e){if(typeof e=="function"){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e.apply(void 0,n)}},N5=function(e,r){if(typeof e=="function")return Ece(e,r);e!=null&&(e.current=r)},uQ=function(e){return e.reduce(function(r,n){var i=n[0],a=n[1];return r[i]=a,r},{})},lQ=typeof window<"u"&&window.document&&window.document.createElement?Ge.useLayoutEffect:Ge.useEffect,Mo="top",zs="bottom",Vs="right",ko="left",lL="auto",Bw=[Mo,zs,Vs,ko],Ny="start",N1="end",bze="clippingParents",xce="viewport",Gv="popper",wze="reference",fQ=Bw.reduce(function(t,e){return t.concat([e+"-"+Ny,e+"-"+N1])},[]),Ace=[].concat(Bw,[lL]).reduce(function(t,e){return t.concat([e,e+"-"+Ny,e+"-"+N1])},[]),_ze="beforeRead",Eze="read",xze="afterRead",Aze="beforeMain",Sze="main",Oze="afterMain",Ize="beforeWrite",Pze="write",Tze="afterWrite",Rze=[_ze,Eze,xze,Aze,Sze,Oze,Ize,Pze,Tze];function Au(t){return t?(t.nodeName||"").toLowerCase():null}function es(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function hp(t){var e=es(t).Element;return t instanceof e||t instanceof Element}function Bs(t){var e=es(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function fL(t){if(typeof ShadowRoot>"u")return!1;var e=es(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Cze(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},i=e.attributes[r]||{},a=e.elements[r];!Bs(a)||!Au(a)||(Object.assign(a.style,n),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function Nze(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],a=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),s=o.reduce(function(c,u){return c[u]="",c},{});!Bs(i)||!Au(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const Dze={name:"applyStyles",enabled:!0,phase:"write",fn:Cze,effect:Nze,requires:["computeStyles"]};function bu(t){return t.split("-")[0]}var Zh=Math.max,t2=Math.min,Dy=Math.round;function D5(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Sce(){return!/^((?!chrome|android).)*safari/i.test(D5())}function $y(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Bs(t)&&(i=t.offsetWidth>0&&Dy(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&Dy(n.height)/t.offsetHeight||1);var o=hp(t)?es(t):window,s=o.visualViewport,c=!Sce()&&r,u=(n.left+(c&&s?s.offsetLeft:0))/i,f=(n.top+(c&&s?s.offsetTop:0))/a,d=n.width/i,g=n.height/a;return{width:d,height:g,top:f,right:u+d,bottom:f+g,left:u,x:u,y:f}}function dL(t){var e=$y(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Oce(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&fL(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function kl(t){return es(t).getComputedStyle(t)}function $ze(t){return["table","td","th"].indexOf(Au(t))>=0}function Td(t){return((hp(t)?t.ownerDocument:t.document)||window.document).documentElement}function TO(t){return Au(t)==="html"?t:t.assignedSlot||t.parentNode||(fL(t)?t.host:null)||Td(t)}function dQ(t){return!Bs(t)||kl(t).position==="fixed"?null:t.offsetParent}function Mze(t){var e=/firefox/i.test(D5()),r=/Trident/i.test(D5());if(r&&Bs(t)){var n=kl(t);if(n.position==="fixed")return null}var i=TO(t);for(fL(i)&&(i=i.host);Bs(i)&&["html","body"].indexOf(Au(i))<0;){var a=kl(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Fw(t){for(var e=es(t),r=dQ(t);r&&$ze(r)&&kl(r).position==="static";)r=dQ(r);return r&&(Au(r)==="html"||Au(r)==="body"&&kl(r).position==="static")?e:r||Mze(t)||e}function hL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function zb(t,e,r){return Zh(t,t2(e,r))}function kze(t,e,r){var n=zb(t,e,r);return n>r?r:n}function Ice(){return{top:0,right:0,bottom:0,left:0}}function Pce(t){return Object.assign({},Ice(),t)}function Tce(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var Lze=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Pce(typeof e!="number"?e:Tce(e,Bw))};function Uze(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=bu(r.placement),c=hL(s),u=[ko,Vs].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!o)){var d=Lze(i.padding,r),g=dL(a),m=c==="y"?Mo:ko,w=c==="y"?zs:Vs,v=r.rects.reference[f]+r.rects.reference[c]-o[c]-r.rects.popper[f],y=o[c]-r.rects.reference[c],_=Fw(a),b=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-y/2,x=d[m],O=b-g[f]-d[w],E=b/2-g[f]/2+S,p=zb(x,E,O),I=c;r.modifiersData[n]=(e={},e[I]=p,e.centerOffset=p-E,e)}}function Bze(t){var e=t.state,r=t.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Oce(e.elements.popper,i)&&(e.elements.arrow=i))}const Fze={name:"arrow",enabled:!0,phase:"main",fn:Uze,effect:Bze,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function My(t){return t.split("-")[1]}var jze={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qze(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:Dy(r*i)/i||0,y:Dy(n*i)/i||0}}function hQ(t){var e,r=t.popper,n=t.popperRect,i=t.placement,a=t.variation,o=t.offsets,s=t.position,c=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,d=t.isFixed,g=o.x,m=g===void 0?0:g,w=o.y,v=w===void 0?0:w,y=typeof f=="function"?f({x:m,y:v}):{x:m,y:v};m=y.x,v=y.y;var _=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),S=ko,x=Mo,O=window;if(u){var E=Fw(r),p="clientHeight",I="clientWidth";if(E===es(r)&&(E=Td(r),kl(E).position!=="static"&&s==="absolute"&&(p="scrollHeight",I="scrollWidth")),E=E,i===Mo||(i===ko||i===Vs)&&a===N1){x=zs;var C=d&&E===O&&O.visualViewport?O.visualViewport.height:E[p];v-=C-n.height,v*=c?1:-1}if(i===ko||(i===Mo||i===zs)&&a===N1){S=Vs;var L=d&&E===O&&O.visualViewport?O.visualViewport.width:E[I];m-=L-n.width,m*=c?1:-1}}var q=Object.assign({position:s},u&&jze),le=f===!0?qze({x:m,y:v},es(r)):{x:m,y:v};if(m=le.x,v=le.y,c){var pe;return Object.assign({},q,(pe={},pe[x]=b?"0":"",pe[S]=_?"0":"",pe.transform=(O.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",pe))}return Object.assign({},q,(e={},e[x]=b?v+"px":"",e[S]=_?m+"px":"",e.transform="",e))}function Hze(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=n===void 0?!0:n,a=r.adaptive,o=a===void 0?!0:a,s=r.roundOffsets,c=s===void 0?!0:s,u={placement:bu(e.placement),variation:My(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,hQ(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,hQ(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const zze={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Hze,data:{}};var TE={passive:!0};function Vze(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=i===void 0?!0:i,o=n.resize,s=o===void 0?!0:o,c=es(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",r.update,TE)}),s&&c.addEventListener("resize",r.update,TE),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",r.update,TE)}),s&&c.removeEventListener("resize",r.update,TE)}}const Gze={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Vze,data:{}};var Wze={left:"right",right:"left",bottom:"top",top:"bottom"};function Tx(t){return t.replace(/left|right|bottom|top/g,function(e){return Wze[e]})}var Kze={start:"end",end:"start"};function pQ(t){return t.replace(/start|end/g,function(e){return Kze[e]})}function pL(t){var e=es(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function gL(t){return $y(Td(t)).left+pL(t).scrollLeft}function Yze(t,e){var r=es(t),n=Td(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Sce();(u||!u&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+gL(t),y:c}}function Qze(t){var e,r=Td(t),n=pL(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=Zh(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Zh(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+gL(t),c=-n.scrollTop;return kl(i||r).direction==="rtl"&&(s+=Zh(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function yL(t){var e=kl(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Rce(t){return["html","body","#document"].indexOf(Au(t))>=0?t.ownerDocument.body:Bs(t)&&yL(t)?t:Rce(TO(t))}function Vb(t,e){var r;e===void 0&&(e=[]);var n=Rce(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),a=es(n),o=i?[a].concat(a.visualViewport||[],yL(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(Vb(TO(o)))}function $5(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Jze(t,e){var r=$y(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function gQ(t,e,r){return e===xce?$5(Yze(t,r)):hp(e)?Jze(e,r):$5(Qze(Td(t)))}function Xze(t){var e=Vb(TO(t)),r=["absolute","fixed"].indexOf(kl(t).position)>=0,n=r&&Bs(t)?Fw(t):t;return hp(n)?e.filter(function(i){return hp(i)&&Oce(i,n)&&Au(i)!=="body"}):[]}function Zze(t,e,r,n){var i=e==="clippingParents"?Xze(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(c,u){var f=gQ(t,u,n);return c.top=Zh(f.top,c.top),c.right=t2(f.right,c.right),c.bottom=t2(f.bottom,c.bottom),c.left=Zh(f.left,c.left),c},gQ(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Cce(t){var e=t.reference,r=t.element,n=t.placement,i=n?bu(n):null,a=n?My(n):null,o=e.x+e.width/2-r.width/2,s=e.y+e.height/2-r.height/2,c;switch(i){case Mo:c={x:o,y:e.y-r.height};break;case zs:c={x:o,y:e.y+e.height};break;case Vs:c={x:e.x+e.width,y:s};break;case ko:c={x:e.x-r.width,y:s};break;default:c={x:e.x,y:e.y}}var u=i?hL(i):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case Ny:c[u]=c[u]-(e[f]/2-r[f]/2);break;case N1:c[u]=c[u]+(e[f]/2-r[f]/2);break}}return c}function D1(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=n===void 0?t.placement:n,a=r.strategy,o=a===void 0?t.strategy:a,s=r.boundary,c=s===void 0?bze:s,u=r.rootBoundary,f=u===void 0?xce:u,d=r.elementContext,g=d===void 0?Gv:d,m=r.altBoundary,w=m===void 0?!1:m,v=r.padding,y=v===void 0?0:v,_=Pce(typeof y!="number"?y:Tce(y,Bw)),b=g===Gv?wze:Gv,S=t.rects.popper,x=t.elements[w?b:g],O=Zze(hp(x)?x:x.contextElement||Td(t.elements.popper),c,f,o),E=$y(t.elements.reference),p=Cce({reference:E,element:S,strategy:"absolute",placement:i}),I=$5(Object.assign({},S,p)),C=g===Gv?I:E,L={top:O.top-C.top+_.top,bottom:C.bottom-O.bottom+_.bottom,left:O.left-C.left+_.left,right:C.right-O.right+_.right},q=t.modifiersData.offset;if(g===Gv&&q){var le=q[i];Object.keys(L).forEach(function(pe){var B=[Vs,zs].indexOf(pe)>=0?1:-1,U=[Mo,zs].indexOf(pe)>=0?"y":"x";L[pe]+=le[U]*B})}return L}function eVe(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?Ace:c,f=My(n),d=f?s?fQ:fQ.filter(function(w){return My(w)===f}):Bw,g=d.filter(function(w){return u.indexOf(w)>=0});g.length===0&&(g=d);var m=g.reduce(function(w,v){return w[v]=D1(t,{placement:v,boundary:i,rootBoundary:a,padding:o})[bu(v)],w},{});return Object.keys(m).sort(function(w,v){return m[w]-m[v]})}function tVe(t){if(bu(t)===lL)return[];var e=Tx(t);return[pQ(t),e,pQ(e)]}function rVe(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!0:o,c=r.fallbackPlacements,u=r.padding,f=r.boundary,d=r.rootBoundary,g=r.altBoundary,m=r.flipVariations,w=m===void 0?!0:m,v=r.allowedAutoPlacements,y=e.options.placement,_=bu(y),b=_===y,S=c||(b||!w?[Tx(y)]:tVe(y)),x=[y].concat(S).reduce(function(M,G){return M.concat(bu(G)===lL?eVe(e,{placement:G,boundary:f,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:v}):G)},[]),O=e.rects.reference,E=e.rects.popper,p=new Map,I=!0,C=x[0],L=0;L<x.length;L++){var q=x[L],le=bu(q),pe=My(q)===Ny,B=[Mo,zs].indexOf(le)>=0,U=B?"width":"height",K=D1(e,{placement:q,boundary:f,rootBoundary:d,altBoundary:g,padding:u}),ne=B?pe?Vs:ko:pe?zs:Mo;O[U]>E[U]&&(ne=Tx(ne));var F=Tx(ne),j=[];if(a&&j.push(K[le]<=0),s&&j.push(K[ne]<=0,K[F]<=0),j.every(function(M){return M})){C=q,I=!1;break}p.set(q,j)}if(I)for(var z=w?3:1,$=function(G){var ge=x.find(function(Q){var te=p.get(Q);if(te)return te.slice(0,G).every(function(ce){return ce})});if(ge)return C=ge,"break"},H=z;H>0;H--){var k=$(H);if(k==="break")break}e.placement!==C&&(e.modifiersData[n]._skip=!0,e.placement=C,e.reset=!0)}}const nVe={name:"flip",enabled:!0,phase:"main",fn:rVe,requiresIfExists:["offset"],data:{_skip:!1}};function yQ(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function mQ(t){return[Mo,Vs,zs,ko].some(function(e){return t[e]>=0})}function iVe(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=D1(e,{elementContext:"reference"}),s=D1(e,{altBoundary:!0}),c=yQ(o,n),u=yQ(s,i,a),f=mQ(c),d=mQ(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}const aVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iVe};function oVe(t,e,r){var n=bu(t),i=[ko,Mo].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ko,Vs].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function sVe(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=i===void 0?[0,0]:i,o=Ace.reduce(function(f,d){return f[d]=oVe(d,e.rects,a),f},{}),s=o[e.placement],c=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}const cVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:sVe};function uVe(t){var e=t.state,r=t.name;e.modifiersData[r]=Cce({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const lVe={name:"popperOffsets",enabled:!0,phase:"read",fn:uVe,data:{}};function fVe(t){return t==="x"?"y":"x"}function dVe(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!1:o,c=r.boundary,u=r.rootBoundary,f=r.altBoundary,d=r.padding,g=r.tether,m=g===void 0?!0:g,w=r.tetherOffset,v=w===void 0?0:w,y=D1(e,{boundary:c,rootBoundary:u,padding:d,altBoundary:f}),_=bu(e.placement),b=My(e.placement),S=!b,x=hL(_),O=fVe(x),E=e.modifiersData.popperOffsets,p=e.rects.reference,I=e.rects.popper,C=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,L=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,le={x:0,y:0};if(E){if(a){var pe,B=x==="y"?Mo:ko,U=x==="y"?zs:Vs,K=x==="y"?"height":"width",ne=E[x],F=ne+y[B],j=ne-y[U],z=m?-I[K]/2:0,$=b===Ny?p[K]:I[K],H=b===Ny?-I[K]:-p[K],k=e.elements.arrow,M=m&&k?dL(k):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ice(),ge=G[B],Q=G[U],te=zb(0,p[K],M[K]),ce=S?p[K]/2-z-te-ge-L.mainAxis:$-te-ge-L.mainAxis,T=S?-p[K]/2+z+te+Q+L.mainAxis:H+te+Q+L.mainAxis,fe=e.elements.arrow&&Fw(e.elements.arrow),ze=fe?x==="y"?fe.clientTop||0:fe.clientLeft||0:0,tt=(pe=q==null?void 0:q[x])!=null?pe:0,mt=ne+ce-tt-ze,vt=ne+T-tt,gt=zb(m?t2(F,mt):F,ne,m?Zh(j,vt):j);E[x]=gt,le[x]=gt-ne}if(s){var Lt,Yt=x==="x"?Mo:ko,wr=x==="x"?zs:Vs,Rt=E[O],Pt=O==="y"?"height":"width",kt=Rt+y[Yt],Nt=Rt-y[wr],Kt=[Mo,ko].indexOf(_)!==-1,Ut=(Lt=q==null?void 0:q[O])!=null?Lt:0,zt=Kt?kt:Rt-p[Pt]-I[Pt]-Ut+L.altAxis,$t=Kt?Rt+p[Pt]+I[Pt]-Ut-L.altAxis:Nt,Dt=m&&Kt?kze(zt,Rt,$t):zb(m?zt:kt,Rt,m?$t:Nt);E[O]=Dt,le[O]=Dt-Rt}e.modifiersData[n]=le}}const hVe={name:"preventOverflow",enabled:!0,phase:"main",fn:dVe,requiresIfExists:["offset"]};function pVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function gVe(t){return t===es(t)||!Bs(t)?pL(t):pVe(t)}function yVe(t){var e=t.getBoundingClientRect(),r=Dy(e.width)/t.offsetWidth||1,n=Dy(e.height)/t.offsetHeight||1;return r!==1||n!==1}function mVe(t,e,r){r===void 0&&(r=!1);var n=Bs(e),i=Bs(e)&&yVe(e),a=Td(e),o=$y(t,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Au(e)!=="body"||yL(a))&&(s=gVe(e)),Bs(e)?(c=$y(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=gL(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function vVe(t){var e=new Map,r=new Set,n=[];t.forEach(function(a){e.set(a.name,a)});function i(a){r.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!r.has(s)){var c=e.get(s);c&&i(c)}}),n.push(a)}return t.forEach(function(a){r.has(a.name)||i(a)}),n}function bVe(t){var e=vVe(t);return Rze.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function wVe(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function _Ve(t){var e=t.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var vQ={placement:"bottom",modifiers:[],strategy:"absolute"};function bQ(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function EVe(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,a=i===void 0?vQ:i;return function(s,c,u){u===void 0&&(u=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},vQ,a),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},d=[],g=!1,m={state:f,setOptions:function(_){var b=typeof _=="function"?_(f.options):_;v(),f.options=Object.assign({},a,f.options,b),f.scrollParents={reference:hp(s)?Vb(s):s.contextElement?Vb(s.contextElement):[],popper:Vb(c)};var S=bVe(_Ve([].concat(n,f.options.modifiers)));return f.orderedModifiers=S.filter(function(x){return x.enabled}),w(),m.update()},forceUpdate:function(){if(!g){var _=f.elements,b=_.reference,S=_.popper;if(bQ(b,S)){f.rects={reference:mVe(b,Fw(S),f.options.strategy==="fixed"),popper:dL(S)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(L){return f.modifiersData[L.name]=Object.assign({},L.data)});for(var x=0;x<f.orderedModifiers.length;x++){if(f.reset===!0){f.reset=!1,x=-1;continue}var O=f.orderedModifiers[x],E=O.fn,p=O.options,I=p===void 0?{}:p,C=O.name;typeof E=="function"&&(f=E({state:f,options:I,name:C,instance:m})||f)}}}},update:wVe(function(){return new Promise(function(y){m.forceUpdate(),y(f)})}),destroy:function(){v(),g=!0}};if(!bQ(s,c))return m;m.setOptions(u).then(function(y){!g&&u.onFirstUpdate&&u.onFirstUpdate(y)});function w(){f.orderedModifiers.forEach(function(y){var _=y.name,b=y.options,S=b===void 0?{}:b,x=y.effect;if(typeof x=="function"){var O=x({state:f,name:_,instance:m,options:S}),E=function(){};d.push(O||E)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var xVe=[Gze,lVe,zze,Dze,cVe,nVe,hVe,Fze,aVe],AVe=EVe({defaultModifiers:xVe}),SVe=typeof Element<"u",OVe=typeof Map=="function",IVe=typeof Set=="function",PVe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Rx(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Rx(t[n],e[n]))return!1;return!0}var a;if(OVe&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;for(a=t.entries();!(n=a.next()).done;)if(!Rx(n.value[1],e.get(n.value[0])))return!1;return!0}if(IVe&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(PVe&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(SVe&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Rx(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var TVe=function(e,r){try{return Rx(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const RVe=Nc(TVe);var CVe=[],Nce=function(e,r,n){n===void 0&&(n={});var i=Ge.useRef(null),a={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||CVe},o=Ge.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],c=o[1],u=Ge.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var w=m.state,v=Object.keys(w.elements);c1.flushSync(function(){c({styles:uQ(v.map(function(y){return[y,w.styles[y]||{}]})),attributes:uQ(v.map(function(y){return[y,w.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=Ge.useMemo(function(){var g={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return RVe(i.current,g)?i.current||g:(i.current=g,g)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Ge.useRef();return lQ(function(){d.current&&d.current.setOptions(f)},[f]),lQ(function(){if(!(e==null||r==null)){var g=n.createPopper||AVe,m=g(e,r,f);return d.current=m,function(){m.destroy(),d.current=null}}},[e,r,n.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}},NVe=function(){},DVe=function(){return Promise.resolve(null)},$Ve=[];function MVe(t){var e=t.placement,r=e===void 0?"bottom":e,n=t.strategy,i=n===void 0?"absolute":n,a=t.modifiers,o=a===void 0?$Ve:a,s=t.referenceElement,c=t.onFirstUpdate,u=t.innerRef,f=t.children,d=Ge.useContext(bce),g=Ge.useState(null),m=g[0],w=g[1],v=Ge.useState(null),y=v[0],_=v[1];Ge.useEffect(function(){N5(u,m)},[u,m]);var b=Ge.useMemo(function(){return{placement:r,strategy:i,onFirstUpdate:c,modifiers:[].concat(o,[{name:"arrow",enabled:y!=null,options:{element:y}}])}},[r,i,c,o,y]),S=Nce(s||d,m,b),x=S.state,O=S.styles,E=S.forceUpdate,p=S.update,I=Ge.useMemo(function(){return{ref:w,style:O.popper,placement:x?x.placement:r,hasPopperEscaped:x&&x.modifiersData.hide?x.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:x&&x.modifiersData.hide?x.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:O.arrow,ref:_},forceUpdate:E||NVe,update:p||DVe}},[w,_,r,x,O,p,E]);return _ce(f)(I)}var kVe=function(){},LVe=kVe;const UVe=Nc(LVe);function BVe(t){var e=t.children,r=t.innerRef,n=Ge.useContext(wce),i=Ge.useCallback(function(a){N5(r,a),Ece(n,a)},[r,n]);return Ge.useEffect(function(){return function(){return N5(r,null)}},[]),Ge.useEffect(function(){UVe(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),_ce(e)({ref:i})}const FVe=Object.freeze(Object.defineProperty({__proto__:null,Manager:vze,Popper:MVe,Reference:BVe,usePopper:Nce},Symbol.toStringTag,{value:"Module"})),jVe=uo(FVe);var Ku={},WN,wQ;function qVe(){if(wQ)return WN;wQ=1;var t=T$();function e(r,n,i,a){return t(r,function(o,s,c){n(a,i(o),s,c)}),a}return WN=e,WN}var KN,_Q;function HVe(){if(_Q)return KN;_Q=1;var t=qVe();function e(r,n){return function(i,a){return t(i,r,n(a),{})}}return KN=e,KN}var YN,EQ;function zVe(){if(EQ)return YN;EQ=1;var t=Zte(),e=HVe(),r=md(),n=Object.prototype,i=n.toString,a=e(function(o,s,c){s!=null&&typeof s.toString!="function"&&(s=i.call(s)),o[s]=c},t(r));return YN=a,YN}var xQ;function VVe(){if(xQ)return Ku;xQ=1;var t=br;Ku.__esModule=!0,Ku.placementMapping=Ku.positions=Ku.positionsMapping=void 0;var e=t(zVe()),r=t(Hl()),n={"top center":"top","top left":"top-start","top right":"top-end","bottom center":"bottom","bottom left":"bottom-start","bottom right":"bottom-end","right center":"right","left center":"left"};Ku.positionsMapping=n;var i=(0,r.default)(n);Ku.positions=i;var a=(0,e.default)(n);return Ku.placementMapping=a,Ku}var Wv={},QN={exports:{}},JN={exports:{}},XN={exports:{}},AQ;function GVe(){return AQ||(AQ=1,function(t){var e=g$.default;function r(n,i){if(e(n)!=="object"||n===null)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var o=a.call(n,i||"default");if(e(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(XN)),XN.exports}var SQ;function WVe(){return SQ||(SQ=1,function(t){var e=g$.default,r=GVe();function n(i){var a=r(i,"string");return e(a)==="symbol"?a:String(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(JN)),JN.exports}var OQ;function KVe(){return OQ||(OQ=1,function(t){var e=WVe();function r(i,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,e(s.key),s)}}function n(i,a,o){return a&&r(i.prototype,a),o&&r(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(QN)),QN.exports}var IQ;function YVe(){if(IQ)return Wv;IQ=1;var t=br;Wv.__esModule=!0,Wv.default=void 0;var e=t(KVe()),r=t(b$()),n=t(Ks()),i=vd,a=function(){function c(f){this.ref=f}var u=c.prototype;return u.getBoundingClientRect=function(){return(0,n.default)(this.ref.current,"getBoundingClientRect")||{}},(0,e.default)(c,[{key:"clientWidth",get:function(){return this.getBoundingClientRect().width}},{key:"clientHeight",get:function(){return this.getBoundingClientRect().height}},{key:"parentNode",get:function(){return this.ref.current?this.ref.current.parentNode:void 0}}]),c}(),o=(0,r.default)(function(c){return new a((0,i.isRefObject)(c)?c:{current:c})}),s=o;return Wv.default=s,Wv}var RE={},PQ;function QVe(){if(PQ)return RE;PQ=1;var t=br;RE.__esModule=!0,RE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("content",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),RE}var CE={},TQ;function JVe(){if(TQ)return CE;TQ=1;var t=br;CE.__esModule=!0,CE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("header",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),CE}var RQ;function XVe(){if(RQ)return Vv;RQ=1;var t=Ws,e=br;Vv.__esModule=!0,Vv.default=void 0;var r=e(Bn()),n=e($c());e(j$());var i=e(ql()),a=e(O$()),o=e(Ks()),s=e(mze()),c=e(Di()),u=e(U$()),f=e(F$()),d=e(Yse()),g=e(B$()),m=e(ii);e(Ln());var w=t(Ge),v=jVe,y=e(Qse()),_=Wn(),b=e(q$()),S=VVe(),x=e(YVe()),O=e(QVe()),E=e(JVe()),p=function(I){(0,n.default)(C,I);function C(){for(var q,le=arguments.length,pe=new Array(le),B=0;B<le;B++)pe[B]=arguments[B];return q=I.call.apply(I,[this].concat(pe))||this,q.state={},q.open=!1,q.zIndexWasSynced=!1,q.triggerRef=w.default.createRef(),q.elementRef=w.default.createRef(),q.getPortalProps=function(){var U={},K=q.props,ne=K.on,F=K.hoverable,j=(0,c.default)(ne)?ne:[ne];return F&&(U.closeOnPortalMouseLeave=!0,U.mouseLeaveDelay=300),(0,f.default)(j,"hover")&&(U.openOnTriggerClick=!1,U.closeOnTriggerClick=!1,U.openOnTriggerMouseEnter=!0,U.closeOnTriggerMouseLeave=!0,U.mouseLeaveDelay=70,U.mouseEnterDelay=50),(0,f.default)(j,"click")&&(U.openOnTriggerClick=!0,U.closeOnTriggerClick=!0,U.closeOnDocumentClick=!0),(0,f.default)(j,"focus")&&(U.openOnTriggerFocus=!0,U.closeOnTriggerBlur=!0),U},q.hideOnScroll=function(U){(0,s.default)(U.target)&&q.elementRef.current.contains(U.target)||(q.setState({closed:!0}),_.eventStack.unsub("scroll",q.hideOnScroll,{target:window}),q.timeoutId=setTimeout(function(){q.setState({closed:!1})},50),q.handleClose(U))},q.handleClose=function(U){(0,o.default)(q.props,"onClose",U,(0,r.default)({},q.props,{open:!1}))},q.handleOpen=function(U){(0,o.default)(q.props,"onOpen",U,(0,r.default)({},q.props,{open:!0}))},q.handlePortalMount=function(U){(0,o.default)(q.props,"onMount",U,q.props)},q.handlePortalUnmount=function(U){q.positionUpdate=null,(0,o.default)(q.props,"onUnmount",U,q.props)},q.renderContent=function(U){var K=U.placement,ne=U.ref,F=U.update,j=U.style,z=q.props,$=z.basic,H=z.children,k=z.className,M=z.content,G=z.hideOnScroll,ge=z.flowing,Q=z.header,te=z.inverted,ce=z.popper,T=z.size,fe=z.style,ze=z.wide,tt=q.state.contentRestProps;q.positionUpdate=F;var mt=(0,m.default)("ui",S.placementMapping[K],T,(0,_.useKeyOrValueAndKey)(ze,"wide"),(0,_.useKeyOnly)($,"basic"),(0,_.useKeyOnly)(ge,"flowing"),(0,_.useKeyOnly)(te,"inverted"),"popup transition visible",k),vt=(0,_.getElementType)(C,q.props),gt=(0,r.default)({left:"auto",right:"auto",position:"initial"},fe),Lt=w.default.createElement(vt,(0,r.default)({},tt,{className:mt,style:gt,ref:q.elementRef}),_.childrenUtils.isNil(H)?w.default.createElement(w.default.Fragment,null,E.default.create(Q,{autoGenerateKey:!1}),O.default.create(M,{autoGenerateKey:!1})):H,G&&w.default.createElement(g.default,{on:q.hideOnScroll,name:"scroll",target:"window"}));return(0,_.createHTMLDivision)(ce||{},{overrideProps:{children:Lt,ref:ne,style:(0,r.default)({display:"flex"},j)}})},q}C.getDerivedStateFromProps=function(le,pe){if(pe.closed||pe.disabled)return{};var B=(0,_.getUnhandledProps)(C,le),U=(0,d.default)(B,function(ne,F,j){return(0,f.default)(b.default.handledProps,j)||(ne[j]=F),ne},{}),K=(0,u.default)(B,b.default.handledProps);return{contentRestProps:U,portalRestProps:K}};var L=C.prototype;return L.componentDidUpdate=function(le){var pe=(0,y.default)(this.props.popperDependencies,le.popperDependencies);pe||this.handleUpdate()},L.componentWillUnmount=function(){clearTimeout(this.timeoutId)},L.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},L.render=function(){var le=this,pe=this.props,B=pe.context,U=pe.disabled,K=pe.eventsEnabled,ne=pe.offset,F=pe.pinned,j=pe.popper,z=pe.popperModifiers,$=pe.position,H=pe.positionFixed,k=pe.trigger,M=this.state,G=M.closed,ge=M.portalRestProps;if(G||U)return k;var Q=[{name:"arrow",enabled:!1},{name:"eventListeners",options:{scroll:!!K,resize:!!K}},{name:"flip",enabled:!F},{name:"preventOverflow",enabled:!!ne},{name:"offset",enabled:!!ne,options:{offset:ne}}].concat(z,[{name:"syncZIndex",enabled:!0,phase:"beforeRead",fn:function(fe){var ze,tt=fe.state;if(!le.zIndexWasSynced){var mt=j==null||(ze=j.style)==null?void 0:ze.zIndex;(0,a.default)(mt)&&(tt.elements.popper.style.zIndex=window.getComputedStyle(tt.elements.popper.firstChild).zIndex),le.zIndexWasSynced=!0}},effect:function(){return function(){le.zIndexWasSynced=!1}}}]),te=(0,x.default)((0,i.default)(B)?this.triggerRef:B),ce=(0,r.default)({},this.getPortalProps(),ge);return w.default.createElement(b.default,(0,r.default)({},ce,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:k,triggerRef:this.triggerRef}),w.default.createElement(v.Popper,{modifiers:Q,placement:S.positionsMapping[$],strategy:H?"fixed":null,referenceElement:te},this.renderContent))},C}(w.Component);return Vv.default=p,p.handledProps=["as","basic","children","className","content","context","disabled","eventsEnabled","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","pinned","popper","popperDependencies","popperModifiers","position","positionFixed","size","style","trigger","wide"],p.propTypes={},p.defaultProps={disabled:!1,eventsEnabled:!0,on:["click","hover"],pinned:!1,popperModifiers:[],position:"top left"},p.Content=O.default,p.Header=E.default,Vv}var ZVe=br,eGe=ZVe(XVe()),tGe=eGe.default;const rGe="_button_1uvkr_1",nGe="_icon_1uvkr_5",NE={button:rGe,icon:nGe,"icon-metamask-mobile":"_icon-metamask-mobile_1uvkr_13","icon-metamask":"_icon-metamask_1uvkr_13","icon-dapper":"_icon-dapper_1uvkr_18","icon-fortmatic":"_icon-fortmatic_1uvkr_22","icon-wallet-connect":"_icon-wallet-connect_1uvkr_26","icon-samsung-blockchain-wallet":"_icon-samsung-blockchain-wallet_1uvkr_30","icon-coinbase":"_icon-coinbase_1uvkr_34","icon-wallet-link":"_icon-wallet-link_1uvkr_35","icon-google":"_icon-google_1uvkr_39","icon-discord":"_icon-discord_1uvkr_43","icon-apple":"_icon-apple_1uvkr_47","icon-x":"_icon-x_1uvkr_51"},Dce=t=>{const{className:e,children:r,type:n,testId:i,showTooltip:a,tooltipPosition:o,disabled:s,loading:c,onClick:u}=t;return Je.jsx(tGe,{position:a&&o?o:"top center",disabled:!a,trigger:Je.jsxs(cu.Button,{primary:!0,size:"small","data-testid":`${i}-${n}-button`,className:dp(e,NE.button),onClick:()=>u(n),disabled:s,loading:c,children:[c?null:Je.jsx("div",{role:"img","aria-label":n,className:dp(NE.icon,NE[`icon-${n}`],NE.primaryImage)}),r]},n),content:n,on:"hover"})},iGe="social-primary-test-id",aGe="social-secondary-test-id",oGe="web3-primary-test-id",sGe="web3-secondary-test-id",cGe="show-more-button-test-id",uGe="_connection_ge0tp_3",lGe="_dclLogo_ge0tp_9",fGe="_title_ge0tp_15",dGe="_subtitle_ge0tp_20",hGe="_primaryButton_ge0tp_29",pGe="_primaryImage_ge0tp_38",gGe="_primaryMessage_ge0tp_42",yGe="_primaryMagic_ge0tp_50",mGe="_primaryLearnMore_ge0tp_61",vGe="_primary_ge0tp_29",bGe="_showMore_ge0tp_76",wGe="_showMoreButton_ge0tp_80",_Ge="_showMoreSecondaryOptions_ge0tp_89",EGe="_primaryOption_ge0tp_103",xGe="_secondaryOptionButton_ge0tp_107",Za={connection:uGe,dclLogo:lGe,title:fGe,subtitle:dGe,primaryButton:hGe,primaryImage:pGe,primaryMessage:gGe,primaryMagic:yGe,primaryLearnMore:mGe,primary:vGe,showMore:bGe,showMoreButton:wGe,showMoreSecondaryOptions:_Ge,primaryOption:EGe,secondaryOptionButton:xGe},CQ=({message:t,children:e,option:r,testId:n,loadingOption:i,onConnect:a})=>Je.jsxs("div",{className:Za.primary,"data-testid":n,children:[Je.jsx("div",{className:Za.primaryMessage,children:t}),Je.jsx(Dce,{disabled:!!i,loading:i===r,type:r,onClick:a,className:dp(Za.primaryButton,Za.primaryOption),testId:n,children:e})]}),NQ=({options:t,tooltipDirection:e,testId:r,loadingOption:n,onConnect:i})=>Je.jsx("div",{className:Za.showMoreSecondaryOptions,"data-testid":r,children:t.map(a=>Je.jsx(Dce,{className:dp(Za.primaryButton,Za.secondaryOptionButton),showTooltip:!0,tooltipPosition:e,type:a,onClick:i,testId:r,loading:n===a,disabled:!!n},a))}),AGe={i18n:{title:"Unlock Your Virtual World.",subtitle:"Access and start exploring.",accessWith:t=>`Access with ${t}`,connectWith:t=>`Connect with ${t}`,moreOptions:"More Options",socialMessage:t=>Je.jsxs(Je.Fragment,{children:["Access secured by ",t]}),web3Message:t=>Je.jsxs(Je.Fragment,{children:["Curious about wallets? ",t("Learn More")]})}},SGe=t=>{const{i18n:e=AGe.i18n,onConnect:r,onLearnMore:n,socialOptions:i,web3Options:a,className:o,loadingOption:s}=t,[c,u]=Ge.useState(!1),f=Ge.useCallback(()=>{u(!c)},[c]),d=i&&i.secondary&&i.secondary.length>0,g=a&&a.secondary&&a.secondary.length>0;return Je.jsxs("div",{className:dp(o,Za.connection),children:[Je.jsx("img",{className:Za.dclLogo,src:yze,alt:"Decentraland logo"}),Je.jsxs("div",{children:[Je.jsx("h1",{className:Za.title,children:e.title}),Je.jsx("h2",{className:Za.subtitle,children:e.subtitle}),i?Je.jsx(CQ,{onConnect:r,testId:iGe,option:i==null?void 0:i.primary,loadingOption:s,message:Je.jsx(Je.Fragment,{children:e.socialMessage(Je.jsx("div",{className:Za.primaryMagic,role:"img","aria-label":"Magic"}))}),children:Je.jsx(Je.Fragment,{children:e.accessWith(i==null?void 0:i.primary)})}):null,a?Je.jsx(CQ,{onConnect:r,testId:oGe,option:a==null?void 0:a.primary,loadingOption:s,message:e.web3Message(m=>Je.jsx("span",{className:Za.primaryLearnMore,role:"button",onClick:n,children:m})),children:Je.jsx(Je.Fragment,{children:e.connectWith(a==null?void 0:a.primary)})}):null]}),Je.jsxs("div",{className:Za.showMore,children:[(g||d)&&Je.jsxs(cu.Button,{"data-testid":cGe,basic:!0,size:"medium",fluid:!0,className:Za.showMoreButton,onClick:f,children:[e.moreOptions,Je.jsx(gze,{name:c?"chevron up":"chevron down"})]}),c&&d&&Je.jsx(NQ,{testId:aGe,options:i.secondary,onConnect:r,tooltipDirection:"top center",loadingOption:s}),c&&g&&Je.jsx(NQ,{testId:sGe,options:a.secondary,onConnect:r,tooltipDirection:"bottom center",loadingOption:s})]})]})};var Hn=(t=>(t.METAMASK="metamask",t.DAPPER="dapper",t.FORTMATIC="fortmatic",t.COINBASE="coinbase",t.SAMSUNG="samsung-blockchain-wallet",t.WALLET_CONNECT="wallet-connect",t.WALLET_LINK="wallet-link",t.METAMASK_MOBILE="metamask-mobile",t.GOOGLE="google",t.APPLE="apple",t.DISCORD="discord",t.X="x",t))(Hn||{});const OGe=60*24*30,IGe=Il.getConfiguration().magic.apiKey;function $ce(t){switch(t){case Hn.DISCORD:case Hn.X:case Hn.GOOGLE:case Hn.APPLE:return Ac.ProviderType.MAGIC;case Hn.WALLET_CONNECT:case Hn.METAMASK_MOBILE:return Ac.ProviderType.WALLET_CONNECT_V2;case Hn.COINBASE:case Hn.WALLET_LINK:return Ac.ProviderType.WALLET_LINK;case Hn.FORTMATIC:return Ac.ProviderType.FORTMATIC;case Hn.METAMASK:case Hn.DAPPER:case Hn.SAMSUNG:return Ac.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function PGe(t,e){const r=new ate(e),n=S8.createRandom(),i={address:n.address.toString(),publicKey:xt(n.publicKey),privateKey:xt(n.privateKey)},a=await r.getSigner();return rce.Authenticator.initializeAuthChain(t,i,OGe,o=>a.signMessage(o))}async function DQ(t){const e=$ce(t);if(Ac.ProviderType.MAGIC===e){const{Magic:n}=await Ty(()=>Promise.resolve().then(()=>Wk),void 0),{OAuthExtension:i}=await Ty(()=>Promise.resolve().then(()=>Kk),void 0),a=new n(IGe,{extensions:[new i]}),o=new URL(window.location.href);o.pathname="/auth/callback",await a.oauth.loginWithRedirect({provider:t===Hn.X?"twitter":t,redirectURI:o.href})}const r=await Il.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}function TGe(t){return[Hn.APPLE,Hn.GOOGLE,Hn.X,Hn.DISCORD].includes(t)}async function Mce(t,e){let r;const n=O5.localStorageGetIdentity(t);return n?r=n:(r=await PGe(t,e),O5.localStorageStoreIdentity(t,r)),r}const RGe=Il.getConfiguration().magic.apiKey,CGe=()=>{const t=Kse(),e=I2(),[r,n]=Ge.useState(!0),i=Ge.useCallback(async()=>{var s;const o=await Il.connection.connect(Ml.ProviderType.MAGIC);await Mce(((s=o.account)==null?void 0:s.toLowerCase())??"",o.provider)},[]),a=Ge.useCallback(async()=>{const{Magic:o}=await Ty(()=>Promise.resolve().then(()=>Wk),void 0),{OAuthExtension:s}=await Ty(()=>Promise.resolve().then(()=>Kk),void 0),c=new o(RGe,{extensions:[new s]});try{await(c==null?void 0:c.oauth.getRedirectResult()),n(!1),await i(),t?window.location.href=decodeURIComponent(t):window.location.href="/"}catch(u){console.log(u),e("/login")}},[e]);return Ge.useEffect(()=>{a()},[]),Je.jsx(tce,{open:!0,state:r?Ri.VALIDATING_SIGN_IN:Ri.WAITING_FOR_SIGNATURE,onTryAgain:i,providerType:Ml.ProviderType.MAGIC})},NGe="_main_1c8le_1",DGe="_infoModal_1c8le_11",$Ge="_infoContent_1c8le_15",MGe="_info_1c8le_11",kGe="_infoImage_1c8le_26",LGe="_assets_1c8le_34",UGe="_login_1c8le_38",BGe="_goBackButton_1c8le_42",cc={main:NGe,infoModal:DGe,infoContent:$Ge,info:MGe,infoImage:kGe,assets:LGe,login:UGe,goBackButton:BGe},FGe={i18n:{title:"What is a wallet?",assets:{title:"A home for your digital assets",text:"Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, just connect your wallet."},goBack:"Return to log in page"}},jGe=t=>{const{i18n:e=FGe.i18n,onClose:r,open:n}=t;return Je.jsxs(Jk.Modal,{size:"tiny",open:n,className:cc.infoModal,children:[Je.jsx(Zk,{title:"",onClose:r}),Je.jsx(Qk,{className:cc.infoContent,children:Je.jsxs("div",{className:cc.main,children:[Je.jsx("h1",{className:cc.title,children:e==null?void 0:e.title}),Je.jsxs("article",{className:cc.info,children:[Je.jsx("div",{className:dp(cc.infoImage,cc.assets)}),Je.jsx("h3",{children:e==null?void 0:e.assets.title}),Je.jsx("p",{children:e==null?void 0:e.assets.text})]}),Je.jsxs("article",{className:cc.info,children:[Je.jsx("div",{className:dp(cc.infoImage,cc.login)}),Je.jsx("h3",{children:e==null?void 0:e.logIn.title}),Je.jsx("p",{children:e==null?void 0:e.logIn.text})]}),Je.jsx(cu.Button,{className:cc.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},qGe="_main_1vyd9_1",HGe="_left_1vyd9_22",zGe="_leftInfo_1vyd9_32",VGe="_right_1vyd9_41",GGe="_footer_1vyd9_50",WGe="_guestInfo_1vyd9_69",DE={main:qGe,left:HGe,leftInfo:zGe,right:VGe,footer:GGe,guestInfo:WGe},KGe=()=>{const[t]=Zye(),[e,r]=Ge.useState(Ri.CONNECTING_WALLET),[n,i]=Ge.useState(!1),[a,o]=Ge.useState(!1),[s,c]=Ge.useState(),u=Kse(),f=u&&new URL(u).pathname==="/play",d=Ge.useCallback(()=>{i(!n)},[i,n]),g=Ge.useMemo(()=>{if(u){const y=new URL(u);return y.searchParams.append("guest","true"),y.toString()}return""},[u]),m=Ge.useCallback(async y=>{var _;if(c(y),TGe(y))r(Ri.LOADING_MAGIC),await DQ(y);else try{o(!0),r(Ri.CONNECTING_WALLET);const b=await DQ(y);t.get("fromRequests")!=="true"&&(r(Ri.WAITING_FOR_SIGNATURE),await Mce(((_=b.account)==null?void 0:_.toLowerCase())??"",b.provider)),u?window.location.href=decodeURIComponent(u):window.location.href="/",o(!1)}catch{r(Ri.ERROR)}},[r,o,c,u,t]),w=Ge.useCallback(()=>{o(!1),c(void 0),r(Ri.CONNECTING_WALLET)},[o]),v=Ge.useCallback(()=>{s&&m(s)},[s]);return Je.jsxs("main",{className:DE.main,children:[Je.jsx(jGe,{open:n,onClose:d}),Je.jsx(tce,{open:a,state:e,onClose:w,onTryAgain:v,providerType:s?$ce(s):null}),Je.jsx("div",{className:DE.left,children:Je.jsxs("div",{className:DE.leftInfo,children:[Je.jsx(SGe,{onLearnMore:d,onConnect:m,loadingOption:s,socialOptions:{primary:Hn.GOOGLE,secondary:[Hn.DISCORD,Hn.APPLE,Hn.X]},web3Options:{primary:Hn.METAMASK,secondary:[Hn.FORTMATIC,Hn.COINBASE,Hn.WALLET_CONNECT]}}),f&&Je.jsxs("div",{className:DE.guestInfo,children:["Quick dive? ",Je.jsx("a",{href:g,children:"Explore as a guest"})]})]})})]})};aye.render(Je.jsx(QQ.StrictMode,{children:Je.jsx(Xye,{basename:"/auth",children:Je.jsxs(Yye,{children:[Je.jsx(Zv,{path:"/login",element:Je.jsx(KGe,{})}),Je.jsx(Zv,{path:"/callback",element:Je.jsx(CGe,{})}),Je.jsx(Zv,{path:"/requests/:requestId",element:Je.jsx(Rqe,{})}),Je.jsx(Zv,{path:"*",element:Je.jsx(Cqe,{})})]})})}),document.getElementById("root"));export{ut as B,h5e as R,Fae as T,S$e as _,ii as a,Ha as b,Ne as c,Nc as d,fo as e,dN as f,uo as g,$a as h,UW as n,aWe as o,Oc as p,X$ as r,vne as s,iWe as t,Ry as y};
|
|
187
|
-
//# sourceMappingURL=index-
|
|
186
|
+
*/(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var n=[],i=0;i<arguments.length;i++){var a=arguments[i];if(a){var o=typeof a;if(o==="string"||o==="number")n.push(a);else if(Array.isArray(a)){if(a.length){var s=r.apply(null,a);s&&n.push(s)}}else if(o==="object"){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){n.push(a.toString());continue}for(var c in a)e.call(a,c)&&a[c]&&n.push(c)}}}return n.join(" ")}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(vce);var hze=vce.exports;const dp=Nc(hze);var pze=wS();const gze=Nc(pze),yze="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7397576829.commit-ee5588d/assets/logo-9a364aec.svg";var Vv={},GN,cQ;function mze(){if(cQ)return GN;cQ=1;var t=Mc(),e=vS();function r(n){return t(n)&&n.nodeType===1&&!e(n)}return GN=r,GN}var bce=Ge.createContext(),wce=Ge.createContext();function vze(t){var e=t.children,r=Ge.useState(null),n=r[0],i=r[1],a=Ge.useRef(!1);Ge.useEffect(function(){return function(){a.current=!0}},[]);var o=Ge.useCallback(function(s){a.current||i(s)},[]);return Ge.createElement(bce.Provider,{value:n},Ge.createElement(wce.Provider,{value:o},e))}var _ce=function(e){return Array.isArray(e)?e[0]:e},Ece=function(e){if(typeof e=="function"){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e.apply(void 0,n)}},N5=function(e,r){if(typeof e=="function")return Ece(e,r);e!=null&&(e.current=r)},uQ=function(e){return e.reduce(function(r,n){var i=n[0],a=n[1];return r[i]=a,r},{})},lQ=typeof window<"u"&&window.document&&window.document.createElement?Ge.useLayoutEffect:Ge.useEffect,Mo="top",zs="bottom",Vs="right",ko="left",lL="auto",Bw=[Mo,zs,Vs,ko],Ny="start",N1="end",bze="clippingParents",xce="viewport",Gv="popper",wze="reference",fQ=Bw.reduce(function(t,e){return t.concat([e+"-"+Ny,e+"-"+N1])},[]),Ace=[].concat(Bw,[lL]).reduce(function(t,e){return t.concat([e,e+"-"+Ny,e+"-"+N1])},[]),_ze="beforeRead",Eze="read",xze="afterRead",Aze="beforeMain",Sze="main",Oze="afterMain",Ize="beforeWrite",Pze="write",Tze="afterWrite",Rze=[_ze,Eze,xze,Aze,Sze,Oze,Ize,Pze,Tze];function Au(t){return t?(t.nodeName||"").toLowerCase():null}function es(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function hp(t){var e=es(t).Element;return t instanceof e||t instanceof Element}function Bs(t){var e=es(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function fL(t){if(typeof ShadowRoot>"u")return!1;var e=es(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Cze(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},i=e.attributes[r]||{},a=e.elements[r];!Bs(a)||!Au(a)||(Object.assign(a.style,n),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function Nze(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],a=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),s=o.reduce(function(c,u){return c[u]="",c},{});!Bs(i)||!Au(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const Dze={name:"applyStyles",enabled:!0,phase:"write",fn:Cze,effect:Nze,requires:["computeStyles"]};function bu(t){return t.split("-")[0]}var Zh=Math.max,t2=Math.min,Dy=Math.round;function D5(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Sce(){return!/^((?!chrome|android).)*safari/i.test(D5())}function $y(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Bs(t)&&(i=t.offsetWidth>0&&Dy(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&Dy(n.height)/t.offsetHeight||1);var o=hp(t)?es(t):window,s=o.visualViewport,c=!Sce()&&r,u=(n.left+(c&&s?s.offsetLeft:0))/i,f=(n.top+(c&&s?s.offsetTop:0))/a,d=n.width/i,g=n.height/a;return{width:d,height:g,top:f,right:u+d,bottom:f+g,left:u,x:u,y:f}}function dL(t){var e=$y(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Oce(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&fL(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function kl(t){return es(t).getComputedStyle(t)}function $ze(t){return["table","td","th"].indexOf(Au(t))>=0}function Td(t){return((hp(t)?t.ownerDocument:t.document)||window.document).documentElement}function TO(t){return Au(t)==="html"?t:t.assignedSlot||t.parentNode||(fL(t)?t.host:null)||Td(t)}function dQ(t){return!Bs(t)||kl(t).position==="fixed"?null:t.offsetParent}function Mze(t){var e=/firefox/i.test(D5()),r=/Trident/i.test(D5());if(r&&Bs(t)){var n=kl(t);if(n.position==="fixed")return null}var i=TO(t);for(fL(i)&&(i=i.host);Bs(i)&&["html","body"].indexOf(Au(i))<0;){var a=kl(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Fw(t){for(var e=es(t),r=dQ(t);r&&$ze(r)&&kl(r).position==="static";)r=dQ(r);return r&&(Au(r)==="html"||Au(r)==="body"&&kl(r).position==="static")?e:r||Mze(t)||e}function hL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function zb(t,e,r){return Zh(t,t2(e,r))}function kze(t,e,r){var n=zb(t,e,r);return n>r?r:n}function Ice(){return{top:0,right:0,bottom:0,left:0}}function Pce(t){return Object.assign({},Ice(),t)}function Tce(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var Lze=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Pce(typeof e!="number"?e:Tce(e,Bw))};function Uze(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=bu(r.placement),c=hL(s),u=[ko,Vs].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!o)){var d=Lze(i.padding,r),g=dL(a),m=c==="y"?Mo:ko,w=c==="y"?zs:Vs,v=r.rects.reference[f]+r.rects.reference[c]-o[c]-r.rects.popper[f],y=o[c]-r.rects.reference[c],_=Fw(a),b=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-y/2,x=d[m],O=b-g[f]-d[w],E=b/2-g[f]/2+S,p=zb(x,E,O),I=c;r.modifiersData[n]=(e={},e[I]=p,e.centerOffset=p-E,e)}}function Bze(t){var e=t.state,r=t.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Oce(e.elements.popper,i)&&(e.elements.arrow=i))}const Fze={name:"arrow",enabled:!0,phase:"main",fn:Uze,effect:Bze,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function My(t){return t.split("-")[1]}var jze={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qze(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:Dy(r*i)/i||0,y:Dy(n*i)/i||0}}function hQ(t){var e,r=t.popper,n=t.popperRect,i=t.placement,a=t.variation,o=t.offsets,s=t.position,c=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,d=t.isFixed,g=o.x,m=g===void 0?0:g,w=o.y,v=w===void 0?0:w,y=typeof f=="function"?f({x:m,y:v}):{x:m,y:v};m=y.x,v=y.y;var _=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),S=ko,x=Mo,O=window;if(u){var E=Fw(r),p="clientHeight",I="clientWidth";if(E===es(r)&&(E=Td(r),kl(E).position!=="static"&&s==="absolute"&&(p="scrollHeight",I="scrollWidth")),E=E,i===Mo||(i===ko||i===Vs)&&a===N1){x=zs;var C=d&&E===O&&O.visualViewport?O.visualViewport.height:E[p];v-=C-n.height,v*=c?1:-1}if(i===ko||(i===Mo||i===zs)&&a===N1){S=Vs;var L=d&&E===O&&O.visualViewport?O.visualViewport.width:E[I];m-=L-n.width,m*=c?1:-1}}var q=Object.assign({position:s},u&&jze),le=f===!0?qze({x:m,y:v},es(r)):{x:m,y:v};if(m=le.x,v=le.y,c){var pe;return Object.assign({},q,(pe={},pe[x]=b?"0":"",pe[S]=_?"0":"",pe.transform=(O.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",pe))}return Object.assign({},q,(e={},e[x]=b?v+"px":"",e[S]=_?m+"px":"",e.transform="",e))}function Hze(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=n===void 0?!0:n,a=r.adaptive,o=a===void 0?!0:a,s=r.roundOffsets,c=s===void 0?!0:s,u={placement:bu(e.placement),variation:My(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,hQ(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,hQ(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const zze={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Hze,data:{}};var TE={passive:!0};function Vze(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=i===void 0?!0:i,o=n.resize,s=o===void 0?!0:o,c=es(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",r.update,TE)}),s&&c.addEventListener("resize",r.update,TE),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",r.update,TE)}),s&&c.removeEventListener("resize",r.update,TE)}}const Gze={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Vze,data:{}};var Wze={left:"right",right:"left",bottom:"top",top:"bottom"};function Tx(t){return t.replace(/left|right|bottom|top/g,function(e){return Wze[e]})}var Kze={start:"end",end:"start"};function pQ(t){return t.replace(/start|end/g,function(e){return Kze[e]})}function pL(t){var e=es(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function gL(t){return $y(Td(t)).left+pL(t).scrollLeft}function Yze(t,e){var r=es(t),n=Td(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Sce();(u||!u&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+gL(t),y:c}}function Qze(t){var e,r=Td(t),n=pL(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=Zh(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Zh(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+gL(t),c=-n.scrollTop;return kl(i||r).direction==="rtl"&&(s+=Zh(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function yL(t){var e=kl(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Rce(t){return["html","body","#document"].indexOf(Au(t))>=0?t.ownerDocument.body:Bs(t)&&yL(t)?t:Rce(TO(t))}function Vb(t,e){var r;e===void 0&&(e=[]);var n=Rce(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),a=es(n),o=i?[a].concat(a.visualViewport||[],yL(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(Vb(TO(o)))}function $5(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Jze(t,e){var r=$y(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function gQ(t,e,r){return e===xce?$5(Yze(t,r)):hp(e)?Jze(e,r):$5(Qze(Td(t)))}function Xze(t){var e=Vb(TO(t)),r=["absolute","fixed"].indexOf(kl(t).position)>=0,n=r&&Bs(t)?Fw(t):t;return hp(n)?e.filter(function(i){return hp(i)&&Oce(i,n)&&Au(i)!=="body"}):[]}function Zze(t,e,r,n){var i=e==="clippingParents"?Xze(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(c,u){var f=gQ(t,u,n);return c.top=Zh(f.top,c.top),c.right=t2(f.right,c.right),c.bottom=t2(f.bottom,c.bottom),c.left=Zh(f.left,c.left),c},gQ(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Cce(t){var e=t.reference,r=t.element,n=t.placement,i=n?bu(n):null,a=n?My(n):null,o=e.x+e.width/2-r.width/2,s=e.y+e.height/2-r.height/2,c;switch(i){case Mo:c={x:o,y:e.y-r.height};break;case zs:c={x:o,y:e.y+e.height};break;case Vs:c={x:e.x+e.width,y:s};break;case ko:c={x:e.x-r.width,y:s};break;default:c={x:e.x,y:e.y}}var u=i?hL(i):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case Ny:c[u]=c[u]-(e[f]/2-r[f]/2);break;case N1:c[u]=c[u]+(e[f]/2-r[f]/2);break}}return c}function D1(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=n===void 0?t.placement:n,a=r.strategy,o=a===void 0?t.strategy:a,s=r.boundary,c=s===void 0?bze:s,u=r.rootBoundary,f=u===void 0?xce:u,d=r.elementContext,g=d===void 0?Gv:d,m=r.altBoundary,w=m===void 0?!1:m,v=r.padding,y=v===void 0?0:v,_=Pce(typeof y!="number"?y:Tce(y,Bw)),b=g===Gv?wze:Gv,S=t.rects.popper,x=t.elements[w?b:g],O=Zze(hp(x)?x:x.contextElement||Td(t.elements.popper),c,f,o),E=$y(t.elements.reference),p=Cce({reference:E,element:S,strategy:"absolute",placement:i}),I=$5(Object.assign({},S,p)),C=g===Gv?I:E,L={top:O.top-C.top+_.top,bottom:C.bottom-O.bottom+_.bottom,left:O.left-C.left+_.left,right:C.right-O.right+_.right},q=t.modifiersData.offset;if(g===Gv&&q){var le=q[i];Object.keys(L).forEach(function(pe){var B=[Vs,zs].indexOf(pe)>=0?1:-1,U=[Mo,zs].indexOf(pe)>=0?"y":"x";L[pe]+=le[U]*B})}return L}function eVe(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?Ace:c,f=My(n),d=f?s?fQ:fQ.filter(function(w){return My(w)===f}):Bw,g=d.filter(function(w){return u.indexOf(w)>=0});g.length===0&&(g=d);var m=g.reduce(function(w,v){return w[v]=D1(t,{placement:v,boundary:i,rootBoundary:a,padding:o})[bu(v)],w},{});return Object.keys(m).sort(function(w,v){return m[w]-m[v]})}function tVe(t){if(bu(t)===lL)return[];var e=Tx(t);return[pQ(t),e,pQ(e)]}function rVe(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!0:o,c=r.fallbackPlacements,u=r.padding,f=r.boundary,d=r.rootBoundary,g=r.altBoundary,m=r.flipVariations,w=m===void 0?!0:m,v=r.allowedAutoPlacements,y=e.options.placement,_=bu(y),b=_===y,S=c||(b||!w?[Tx(y)]:tVe(y)),x=[y].concat(S).reduce(function(M,G){return M.concat(bu(G)===lL?eVe(e,{placement:G,boundary:f,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:v}):G)},[]),O=e.rects.reference,E=e.rects.popper,p=new Map,I=!0,C=x[0],L=0;L<x.length;L++){var q=x[L],le=bu(q),pe=My(q)===Ny,B=[Mo,zs].indexOf(le)>=0,U=B?"width":"height",K=D1(e,{placement:q,boundary:f,rootBoundary:d,altBoundary:g,padding:u}),ne=B?pe?Vs:ko:pe?zs:Mo;O[U]>E[U]&&(ne=Tx(ne));var F=Tx(ne),j=[];if(a&&j.push(K[le]<=0),s&&j.push(K[ne]<=0,K[F]<=0),j.every(function(M){return M})){C=q,I=!1;break}p.set(q,j)}if(I)for(var z=w?3:1,$=function(G){var ge=x.find(function(Q){var te=p.get(Q);if(te)return te.slice(0,G).every(function(ce){return ce})});if(ge)return C=ge,"break"},H=z;H>0;H--){var k=$(H);if(k==="break")break}e.placement!==C&&(e.modifiersData[n]._skip=!0,e.placement=C,e.reset=!0)}}const nVe={name:"flip",enabled:!0,phase:"main",fn:rVe,requiresIfExists:["offset"],data:{_skip:!1}};function yQ(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function mQ(t){return[Mo,Vs,zs,ko].some(function(e){return t[e]>=0})}function iVe(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=D1(e,{elementContext:"reference"}),s=D1(e,{altBoundary:!0}),c=yQ(o,n),u=yQ(s,i,a),f=mQ(c),d=mQ(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}const aVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iVe};function oVe(t,e,r){var n=bu(t),i=[ko,Mo].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ko,Vs].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function sVe(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=i===void 0?[0,0]:i,o=Ace.reduce(function(f,d){return f[d]=oVe(d,e.rects,a),f},{}),s=o[e.placement],c=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}const cVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:sVe};function uVe(t){var e=t.state,r=t.name;e.modifiersData[r]=Cce({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const lVe={name:"popperOffsets",enabled:!0,phase:"read",fn:uVe,data:{}};function fVe(t){return t==="x"?"y":"x"}function dVe(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!1:o,c=r.boundary,u=r.rootBoundary,f=r.altBoundary,d=r.padding,g=r.tether,m=g===void 0?!0:g,w=r.tetherOffset,v=w===void 0?0:w,y=D1(e,{boundary:c,rootBoundary:u,padding:d,altBoundary:f}),_=bu(e.placement),b=My(e.placement),S=!b,x=hL(_),O=fVe(x),E=e.modifiersData.popperOffsets,p=e.rects.reference,I=e.rects.popper,C=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,L=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,le={x:0,y:0};if(E){if(a){var pe,B=x==="y"?Mo:ko,U=x==="y"?zs:Vs,K=x==="y"?"height":"width",ne=E[x],F=ne+y[B],j=ne-y[U],z=m?-I[K]/2:0,$=b===Ny?p[K]:I[K],H=b===Ny?-I[K]:-p[K],k=e.elements.arrow,M=m&&k?dL(k):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ice(),ge=G[B],Q=G[U],te=zb(0,p[K],M[K]),ce=S?p[K]/2-z-te-ge-L.mainAxis:$-te-ge-L.mainAxis,T=S?-p[K]/2+z+te+Q+L.mainAxis:H+te+Q+L.mainAxis,fe=e.elements.arrow&&Fw(e.elements.arrow),ze=fe?x==="y"?fe.clientTop||0:fe.clientLeft||0:0,tt=(pe=q==null?void 0:q[x])!=null?pe:0,mt=ne+ce-tt-ze,vt=ne+T-tt,gt=zb(m?t2(F,mt):F,ne,m?Zh(j,vt):j);E[x]=gt,le[x]=gt-ne}if(s){var Lt,Yt=x==="x"?Mo:ko,wr=x==="x"?zs:Vs,Rt=E[O],Pt=O==="y"?"height":"width",kt=Rt+y[Yt],Nt=Rt-y[wr],Kt=[Mo,ko].indexOf(_)!==-1,Ut=(Lt=q==null?void 0:q[O])!=null?Lt:0,zt=Kt?kt:Rt-p[Pt]-I[Pt]-Ut+L.altAxis,$t=Kt?Rt+p[Pt]+I[Pt]-Ut-L.altAxis:Nt,Dt=m&&Kt?kze(zt,Rt,$t):zb(m?zt:kt,Rt,m?$t:Nt);E[O]=Dt,le[O]=Dt-Rt}e.modifiersData[n]=le}}const hVe={name:"preventOverflow",enabled:!0,phase:"main",fn:dVe,requiresIfExists:["offset"]};function pVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function gVe(t){return t===es(t)||!Bs(t)?pL(t):pVe(t)}function yVe(t){var e=t.getBoundingClientRect(),r=Dy(e.width)/t.offsetWidth||1,n=Dy(e.height)/t.offsetHeight||1;return r!==1||n!==1}function mVe(t,e,r){r===void 0&&(r=!1);var n=Bs(e),i=Bs(e)&&yVe(e),a=Td(e),o=$y(t,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Au(e)!=="body"||yL(a))&&(s=gVe(e)),Bs(e)?(c=$y(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=gL(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function vVe(t){var e=new Map,r=new Set,n=[];t.forEach(function(a){e.set(a.name,a)});function i(a){r.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!r.has(s)){var c=e.get(s);c&&i(c)}}),n.push(a)}return t.forEach(function(a){r.has(a.name)||i(a)}),n}function bVe(t){var e=vVe(t);return Rze.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function wVe(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function _Ve(t){var e=t.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var vQ={placement:"bottom",modifiers:[],strategy:"absolute"};function bQ(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function EVe(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,a=i===void 0?vQ:i;return function(s,c,u){u===void 0&&(u=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},vQ,a),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},d=[],g=!1,m={state:f,setOptions:function(_){var b=typeof _=="function"?_(f.options):_;v(),f.options=Object.assign({},a,f.options,b),f.scrollParents={reference:hp(s)?Vb(s):s.contextElement?Vb(s.contextElement):[],popper:Vb(c)};var S=bVe(_Ve([].concat(n,f.options.modifiers)));return f.orderedModifiers=S.filter(function(x){return x.enabled}),w(),m.update()},forceUpdate:function(){if(!g){var _=f.elements,b=_.reference,S=_.popper;if(bQ(b,S)){f.rects={reference:mVe(b,Fw(S),f.options.strategy==="fixed"),popper:dL(S)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(L){return f.modifiersData[L.name]=Object.assign({},L.data)});for(var x=0;x<f.orderedModifiers.length;x++){if(f.reset===!0){f.reset=!1,x=-1;continue}var O=f.orderedModifiers[x],E=O.fn,p=O.options,I=p===void 0?{}:p,C=O.name;typeof E=="function"&&(f=E({state:f,options:I,name:C,instance:m})||f)}}}},update:wVe(function(){return new Promise(function(y){m.forceUpdate(),y(f)})}),destroy:function(){v(),g=!0}};if(!bQ(s,c))return m;m.setOptions(u).then(function(y){!g&&u.onFirstUpdate&&u.onFirstUpdate(y)});function w(){f.orderedModifiers.forEach(function(y){var _=y.name,b=y.options,S=b===void 0?{}:b,x=y.effect;if(typeof x=="function"){var O=x({state:f,name:_,instance:m,options:S}),E=function(){};d.push(O||E)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var xVe=[Gze,lVe,zze,Dze,cVe,nVe,hVe,Fze,aVe],AVe=EVe({defaultModifiers:xVe}),SVe=typeof Element<"u",OVe=typeof Map=="function",IVe=typeof Set=="function",PVe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Rx(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Rx(t[n],e[n]))return!1;return!0}var a;if(OVe&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;for(a=t.entries();!(n=a.next()).done;)if(!Rx(n.value[1],e.get(n.value[0])))return!1;return!0}if(IVe&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(PVe&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(SVe&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Rx(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var TVe=function(e,r){try{return Rx(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const RVe=Nc(TVe);var CVe=[],Nce=function(e,r,n){n===void 0&&(n={});var i=Ge.useRef(null),a={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||CVe},o=Ge.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],c=o[1],u=Ge.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var w=m.state,v=Object.keys(w.elements);c1.flushSync(function(){c({styles:uQ(v.map(function(y){return[y,w.styles[y]||{}]})),attributes:uQ(v.map(function(y){return[y,w.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=Ge.useMemo(function(){var g={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return RVe(i.current,g)?i.current||g:(i.current=g,g)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Ge.useRef();return lQ(function(){d.current&&d.current.setOptions(f)},[f]),lQ(function(){if(!(e==null||r==null)){var g=n.createPopper||AVe,m=g(e,r,f);return d.current=m,function(){m.destroy(),d.current=null}}},[e,r,n.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}},NVe=function(){},DVe=function(){return Promise.resolve(null)},$Ve=[];function MVe(t){var e=t.placement,r=e===void 0?"bottom":e,n=t.strategy,i=n===void 0?"absolute":n,a=t.modifiers,o=a===void 0?$Ve:a,s=t.referenceElement,c=t.onFirstUpdate,u=t.innerRef,f=t.children,d=Ge.useContext(bce),g=Ge.useState(null),m=g[0],w=g[1],v=Ge.useState(null),y=v[0],_=v[1];Ge.useEffect(function(){N5(u,m)},[u,m]);var b=Ge.useMemo(function(){return{placement:r,strategy:i,onFirstUpdate:c,modifiers:[].concat(o,[{name:"arrow",enabled:y!=null,options:{element:y}}])}},[r,i,c,o,y]),S=Nce(s||d,m,b),x=S.state,O=S.styles,E=S.forceUpdate,p=S.update,I=Ge.useMemo(function(){return{ref:w,style:O.popper,placement:x?x.placement:r,hasPopperEscaped:x&&x.modifiersData.hide?x.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:x&&x.modifiersData.hide?x.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:O.arrow,ref:_},forceUpdate:E||NVe,update:p||DVe}},[w,_,r,x,O,p,E]);return _ce(f)(I)}var kVe=function(){},LVe=kVe;const UVe=Nc(LVe);function BVe(t){var e=t.children,r=t.innerRef,n=Ge.useContext(wce),i=Ge.useCallback(function(a){N5(r,a),Ece(n,a)},[r,n]);return Ge.useEffect(function(){return function(){return N5(r,null)}},[]),Ge.useEffect(function(){UVe(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),_ce(e)({ref:i})}const FVe=Object.freeze(Object.defineProperty({__proto__:null,Manager:vze,Popper:MVe,Reference:BVe,usePopper:Nce},Symbol.toStringTag,{value:"Module"})),jVe=uo(FVe);var Ku={},WN,wQ;function qVe(){if(wQ)return WN;wQ=1;var t=T$();function e(r,n,i,a){return t(r,function(o,s,c){n(a,i(o),s,c)}),a}return WN=e,WN}var KN,_Q;function HVe(){if(_Q)return KN;_Q=1;var t=qVe();function e(r,n){return function(i,a){return t(i,r,n(a),{})}}return KN=e,KN}var YN,EQ;function zVe(){if(EQ)return YN;EQ=1;var t=Zte(),e=HVe(),r=md(),n=Object.prototype,i=n.toString,a=e(function(o,s,c){s!=null&&typeof s.toString!="function"&&(s=i.call(s)),o[s]=c},t(r));return YN=a,YN}var xQ;function VVe(){if(xQ)return Ku;xQ=1;var t=br;Ku.__esModule=!0,Ku.placementMapping=Ku.positions=Ku.positionsMapping=void 0;var e=t(zVe()),r=t(Hl()),n={"top center":"top","top left":"top-start","top right":"top-end","bottom center":"bottom","bottom left":"bottom-start","bottom right":"bottom-end","right center":"right","left center":"left"};Ku.positionsMapping=n;var i=(0,r.default)(n);Ku.positions=i;var a=(0,e.default)(n);return Ku.placementMapping=a,Ku}var Wv={},QN={exports:{}},JN={exports:{}},XN={exports:{}},AQ;function GVe(){return AQ||(AQ=1,function(t){var e=g$.default;function r(n,i){if(e(n)!=="object"||n===null)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var o=a.call(n,i||"default");if(e(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(XN)),XN.exports}var SQ;function WVe(){return SQ||(SQ=1,function(t){var e=g$.default,r=GVe();function n(i){var a=r(i,"string");return e(a)==="symbol"?a:String(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(JN)),JN.exports}var OQ;function KVe(){return OQ||(OQ=1,function(t){var e=WVe();function r(i,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,e(s.key),s)}}function n(i,a,o){return a&&r(i.prototype,a),o&&r(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(QN)),QN.exports}var IQ;function YVe(){if(IQ)return Wv;IQ=1;var t=br;Wv.__esModule=!0,Wv.default=void 0;var e=t(KVe()),r=t(b$()),n=t(Ks()),i=vd,a=function(){function c(f){this.ref=f}var u=c.prototype;return u.getBoundingClientRect=function(){return(0,n.default)(this.ref.current,"getBoundingClientRect")||{}},(0,e.default)(c,[{key:"clientWidth",get:function(){return this.getBoundingClientRect().width}},{key:"clientHeight",get:function(){return this.getBoundingClientRect().height}},{key:"parentNode",get:function(){return this.ref.current?this.ref.current.parentNode:void 0}}]),c}(),o=(0,r.default)(function(c){return new a((0,i.isRefObject)(c)?c:{current:c})}),s=o;return Wv.default=s,Wv}var RE={},PQ;function QVe(){if(PQ)return RE;PQ=1;var t=br;RE.__esModule=!0,RE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("content",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),RE}var CE={},TQ;function JVe(){if(TQ)return CE;TQ=1;var t=br;CE.__esModule=!0,CE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(Ge),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("header",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),CE}var RQ;function XVe(){if(RQ)return Vv;RQ=1;var t=Ws,e=br;Vv.__esModule=!0,Vv.default=void 0;var r=e(Bn()),n=e($c());e(j$());var i=e(ql()),a=e(O$()),o=e(Ks()),s=e(mze()),c=e(Di()),u=e(U$()),f=e(F$()),d=e(Yse()),g=e(B$()),m=e(ii);e(Ln());var w=t(Ge),v=jVe,y=e(Qse()),_=Wn(),b=e(q$()),S=VVe(),x=e(YVe()),O=e(QVe()),E=e(JVe()),p=function(I){(0,n.default)(C,I);function C(){for(var q,le=arguments.length,pe=new Array(le),B=0;B<le;B++)pe[B]=arguments[B];return q=I.call.apply(I,[this].concat(pe))||this,q.state={},q.open=!1,q.zIndexWasSynced=!1,q.triggerRef=w.default.createRef(),q.elementRef=w.default.createRef(),q.getPortalProps=function(){var U={},K=q.props,ne=K.on,F=K.hoverable,j=(0,c.default)(ne)?ne:[ne];return F&&(U.closeOnPortalMouseLeave=!0,U.mouseLeaveDelay=300),(0,f.default)(j,"hover")&&(U.openOnTriggerClick=!1,U.closeOnTriggerClick=!1,U.openOnTriggerMouseEnter=!0,U.closeOnTriggerMouseLeave=!0,U.mouseLeaveDelay=70,U.mouseEnterDelay=50),(0,f.default)(j,"click")&&(U.openOnTriggerClick=!0,U.closeOnTriggerClick=!0,U.closeOnDocumentClick=!0),(0,f.default)(j,"focus")&&(U.openOnTriggerFocus=!0,U.closeOnTriggerBlur=!0),U},q.hideOnScroll=function(U){(0,s.default)(U.target)&&q.elementRef.current.contains(U.target)||(q.setState({closed:!0}),_.eventStack.unsub("scroll",q.hideOnScroll,{target:window}),q.timeoutId=setTimeout(function(){q.setState({closed:!1})},50),q.handleClose(U))},q.handleClose=function(U){(0,o.default)(q.props,"onClose",U,(0,r.default)({},q.props,{open:!1}))},q.handleOpen=function(U){(0,o.default)(q.props,"onOpen",U,(0,r.default)({},q.props,{open:!0}))},q.handlePortalMount=function(U){(0,o.default)(q.props,"onMount",U,q.props)},q.handlePortalUnmount=function(U){q.positionUpdate=null,(0,o.default)(q.props,"onUnmount",U,q.props)},q.renderContent=function(U){var K=U.placement,ne=U.ref,F=U.update,j=U.style,z=q.props,$=z.basic,H=z.children,k=z.className,M=z.content,G=z.hideOnScroll,ge=z.flowing,Q=z.header,te=z.inverted,ce=z.popper,T=z.size,fe=z.style,ze=z.wide,tt=q.state.contentRestProps;q.positionUpdate=F;var mt=(0,m.default)("ui",S.placementMapping[K],T,(0,_.useKeyOrValueAndKey)(ze,"wide"),(0,_.useKeyOnly)($,"basic"),(0,_.useKeyOnly)(ge,"flowing"),(0,_.useKeyOnly)(te,"inverted"),"popup transition visible",k),vt=(0,_.getElementType)(C,q.props),gt=(0,r.default)({left:"auto",right:"auto",position:"initial"},fe),Lt=w.default.createElement(vt,(0,r.default)({},tt,{className:mt,style:gt,ref:q.elementRef}),_.childrenUtils.isNil(H)?w.default.createElement(w.default.Fragment,null,E.default.create(Q,{autoGenerateKey:!1}),O.default.create(M,{autoGenerateKey:!1})):H,G&&w.default.createElement(g.default,{on:q.hideOnScroll,name:"scroll",target:"window"}));return(0,_.createHTMLDivision)(ce||{},{overrideProps:{children:Lt,ref:ne,style:(0,r.default)({display:"flex"},j)}})},q}C.getDerivedStateFromProps=function(le,pe){if(pe.closed||pe.disabled)return{};var B=(0,_.getUnhandledProps)(C,le),U=(0,d.default)(B,function(ne,F,j){return(0,f.default)(b.default.handledProps,j)||(ne[j]=F),ne},{}),K=(0,u.default)(B,b.default.handledProps);return{contentRestProps:U,portalRestProps:K}};var L=C.prototype;return L.componentDidUpdate=function(le){var pe=(0,y.default)(this.props.popperDependencies,le.popperDependencies);pe||this.handleUpdate()},L.componentWillUnmount=function(){clearTimeout(this.timeoutId)},L.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},L.render=function(){var le=this,pe=this.props,B=pe.context,U=pe.disabled,K=pe.eventsEnabled,ne=pe.offset,F=pe.pinned,j=pe.popper,z=pe.popperModifiers,$=pe.position,H=pe.positionFixed,k=pe.trigger,M=this.state,G=M.closed,ge=M.portalRestProps;if(G||U)return k;var Q=[{name:"arrow",enabled:!1},{name:"eventListeners",options:{scroll:!!K,resize:!!K}},{name:"flip",enabled:!F},{name:"preventOverflow",enabled:!!ne},{name:"offset",enabled:!!ne,options:{offset:ne}}].concat(z,[{name:"syncZIndex",enabled:!0,phase:"beforeRead",fn:function(fe){var ze,tt=fe.state;if(!le.zIndexWasSynced){var mt=j==null||(ze=j.style)==null?void 0:ze.zIndex;(0,a.default)(mt)&&(tt.elements.popper.style.zIndex=window.getComputedStyle(tt.elements.popper.firstChild).zIndex),le.zIndexWasSynced=!0}},effect:function(){return function(){le.zIndexWasSynced=!1}}}]),te=(0,x.default)((0,i.default)(B)?this.triggerRef:B),ce=(0,r.default)({},this.getPortalProps(),ge);return w.default.createElement(b.default,(0,r.default)({},ce,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:k,triggerRef:this.triggerRef}),w.default.createElement(v.Popper,{modifiers:Q,placement:S.positionsMapping[$],strategy:H?"fixed":null,referenceElement:te},this.renderContent))},C}(w.Component);return Vv.default=p,p.handledProps=["as","basic","children","className","content","context","disabled","eventsEnabled","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","pinned","popper","popperDependencies","popperModifiers","position","positionFixed","size","style","trigger","wide"],p.propTypes={},p.defaultProps={disabled:!1,eventsEnabled:!0,on:["click","hover"],pinned:!1,popperModifiers:[],position:"top left"},p.Content=O.default,p.Header=E.default,Vv}var ZVe=br,eGe=ZVe(XVe()),tGe=eGe.default;const rGe="_button_1uvkr_1",nGe="_icon_1uvkr_5",NE={button:rGe,icon:nGe,"icon-metamask-mobile":"_icon-metamask-mobile_1uvkr_13","icon-metamask":"_icon-metamask_1uvkr_13","icon-dapper":"_icon-dapper_1uvkr_18","icon-fortmatic":"_icon-fortmatic_1uvkr_22","icon-wallet-connect":"_icon-wallet-connect_1uvkr_26","icon-samsung-blockchain-wallet":"_icon-samsung-blockchain-wallet_1uvkr_30","icon-coinbase":"_icon-coinbase_1uvkr_34","icon-wallet-link":"_icon-wallet-link_1uvkr_35","icon-google":"_icon-google_1uvkr_39","icon-discord":"_icon-discord_1uvkr_43","icon-apple":"_icon-apple_1uvkr_47","icon-x":"_icon-x_1uvkr_51"},Dce=t=>{const{className:e,children:r,type:n,testId:i,showTooltip:a,tooltipPosition:o,disabled:s,loading:c,onClick:u}=t;return Je.jsx(tGe,{position:a&&o?o:"top center",disabled:!a,trigger:Je.jsxs(cu.Button,{primary:!0,size:"small","data-testid":`${i}-${n}-button`,className:dp(e,NE.button),onClick:()=>u(n),disabled:s,loading:c,children:[c?null:Je.jsx("div",{role:"img","aria-label":n,className:dp(NE.icon,NE[`icon-${n}`],NE.primaryImage)}),r]},n),content:n,on:"hover"})},iGe="social-primary-test-id",aGe="social-secondary-test-id",oGe="web3-primary-test-id",sGe="web3-secondary-test-id",cGe="show-more-button-test-id",uGe="_connection_ge0tp_3",lGe="_dclLogo_ge0tp_9",fGe="_title_ge0tp_15",dGe="_subtitle_ge0tp_20",hGe="_primaryButton_ge0tp_29",pGe="_primaryImage_ge0tp_38",gGe="_primaryMessage_ge0tp_42",yGe="_primaryMagic_ge0tp_50",mGe="_primaryLearnMore_ge0tp_61",vGe="_primary_ge0tp_29",bGe="_showMore_ge0tp_76",wGe="_showMoreButton_ge0tp_80",_Ge="_showMoreSecondaryOptions_ge0tp_89",EGe="_primaryOption_ge0tp_103",xGe="_secondaryOptionButton_ge0tp_107",Za={connection:uGe,dclLogo:lGe,title:fGe,subtitle:dGe,primaryButton:hGe,primaryImage:pGe,primaryMessage:gGe,primaryMagic:yGe,primaryLearnMore:mGe,primary:vGe,showMore:bGe,showMoreButton:wGe,showMoreSecondaryOptions:_Ge,primaryOption:EGe,secondaryOptionButton:xGe},CQ=({message:t,children:e,option:r,testId:n,loadingOption:i,onConnect:a})=>Je.jsxs("div",{className:Za.primary,"data-testid":n,children:[Je.jsx("div",{className:Za.primaryMessage,children:t}),Je.jsx(Dce,{disabled:!!i,loading:i===r,type:r,onClick:a,className:dp(Za.primaryButton,Za.primaryOption),testId:n,children:e})]}),NQ=({options:t,tooltipDirection:e,testId:r,loadingOption:n,onConnect:i})=>Je.jsx("div",{className:Za.showMoreSecondaryOptions,"data-testid":r,children:t.map(a=>Je.jsx(Dce,{className:dp(Za.primaryButton,Za.secondaryOptionButton),showTooltip:!0,tooltipPosition:e,type:a,onClick:i,testId:r,loading:n===a,disabled:!!n},a))}),AGe={i18n:{title:"Unlock Your Virtual World.",subtitle:"Access and start exploring.",accessWith:t=>`Access with ${t}`,connectWith:t=>`Connect with ${t}`,moreOptions:"More Options",socialMessage:t=>Je.jsxs(Je.Fragment,{children:["Access secured by ",t]}),web3Message:t=>Je.jsxs(Je.Fragment,{children:["Curious about wallets? ",t("Learn More")]})}},SGe=t=>{const{i18n:e=AGe.i18n,onConnect:r,onLearnMore:n,socialOptions:i,web3Options:a,className:o,loadingOption:s}=t,[c,u]=Ge.useState(!1),f=Ge.useCallback(()=>{u(!c)},[c]),d=i&&i.secondary&&i.secondary.length>0,g=a&&a.secondary&&a.secondary.length>0;return Je.jsxs("div",{className:dp(o,Za.connection),children:[Je.jsx("img",{className:Za.dclLogo,src:yze,alt:"Decentraland logo"}),Je.jsxs("div",{children:[Je.jsx("h1",{className:Za.title,children:e.title}),Je.jsx("h2",{className:Za.subtitle,children:e.subtitle}),i?Je.jsx(CQ,{onConnect:r,testId:iGe,option:i==null?void 0:i.primary,loadingOption:s,message:Je.jsx(Je.Fragment,{children:e.socialMessage(Je.jsx("div",{className:Za.primaryMagic,role:"img","aria-label":"Magic"}))}),children:Je.jsx(Je.Fragment,{children:e.accessWith(i==null?void 0:i.primary)})}):null,a?Je.jsx(CQ,{onConnect:r,testId:oGe,option:a==null?void 0:a.primary,loadingOption:s,message:e.web3Message(m=>Je.jsx("span",{className:Za.primaryLearnMore,role:"button",onClick:n,children:m})),children:Je.jsx(Je.Fragment,{children:e.connectWith(a==null?void 0:a.primary)})}):null]}),Je.jsxs("div",{className:Za.showMore,children:[(g||d)&&Je.jsxs(cu.Button,{"data-testid":cGe,basic:!0,size:"medium",fluid:!0,className:Za.showMoreButton,onClick:f,children:[e.moreOptions,Je.jsx(gze,{name:c?"chevron up":"chevron down"})]}),c&&d&&Je.jsx(NQ,{testId:aGe,options:i.secondary,onConnect:r,tooltipDirection:"top center",loadingOption:s}),c&&g&&Je.jsx(NQ,{testId:sGe,options:a.secondary,onConnect:r,tooltipDirection:"bottom center",loadingOption:s})]})]})};var Hn=(t=>(t.METAMASK="metamask",t.DAPPER="dapper",t.FORTMATIC="fortmatic",t.COINBASE="coinbase",t.SAMSUNG="samsung-blockchain-wallet",t.WALLET_CONNECT="wallet-connect",t.WALLET_LINK="wallet-link",t.METAMASK_MOBILE="metamask-mobile",t.GOOGLE="google",t.APPLE="apple",t.DISCORD="discord",t.X="x",t))(Hn||{});const OGe=60*24*30,IGe=Il.getConfiguration().magic.apiKey;function $ce(t){switch(t){case Hn.DISCORD:case Hn.X:case Hn.GOOGLE:case Hn.APPLE:return Ac.ProviderType.MAGIC;case Hn.WALLET_CONNECT:case Hn.METAMASK_MOBILE:return Ac.ProviderType.WALLET_CONNECT_V2;case Hn.COINBASE:case Hn.WALLET_LINK:return Ac.ProviderType.WALLET_LINK;case Hn.FORTMATIC:return Ac.ProviderType.FORTMATIC;case Hn.METAMASK:case Hn.DAPPER:case Hn.SAMSUNG:return Ac.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function PGe(t,e){const r=new ate(e),n=S8.createRandom(),i={address:n.address.toString(),publicKey:xt(n.publicKey),privateKey:xt(n.privateKey)},a=await r.getSigner();return rce.Authenticator.initializeAuthChain(t,i,OGe,o=>a.signMessage(o))}async function DQ(t){const e=$ce(t);if(Ac.ProviderType.MAGIC===e){const{Magic:n}=await Ty(()=>Promise.resolve().then(()=>Wk),void 0),{OAuthExtension:i}=await Ty(()=>Promise.resolve().then(()=>Kk),void 0),a=new n(IGe,{extensions:[new i]}),o=new URL(window.location.href);o.pathname="/auth/callback",await a.oauth.loginWithRedirect({provider:t===Hn.X?"twitter":t,redirectURI:o.href})}const r=await Il.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}function TGe(t){return[Hn.APPLE,Hn.GOOGLE,Hn.X,Hn.DISCORD].includes(t)}async function Mce(t,e){let r;const n=O5.localStorageGetIdentity(t);return n?r=n:(r=await PGe(t,e),O5.localStorageStoreIdentity(t,r)),r}const RGe=Il.getConfiguration().magic.apiKey,CGe=()=>{const t=Kse(),e=I2(),[r,n]=Ge.useState(!0),i=Ge.useCallback(async()=>{var s;const o=await Il.connection.connect(Ml.ProviderType.MAGIC);await Mce(((s=o.account)==null?void 0:s.toLowerCase())??"",o.provider)},[]),a=Ge.useCallback(async()=>{const{Magic:o}=await Ty(()=>Promise.resolve().then(()=>Wk),void 0),{OAuthExtension:s}=await Ty(()=>Promise.resolve().then(()=>Kk),void 0),c=new o(RGe,{extensions:[new s]});try{await(c==null?void 0:c.oauth.getRedirectResult()),n(!1),await i(),t?window.location.href=decodeURIComponent(t):window.location.href="/"}catch(u){console.log(u),e("/login")}},[e]);return Ge.useEffect(()=>{a()},[]),Je.jsx(tce,{open:!0,state:r?Ri.VALIDATING_SIGN_IN:Ri.WAITING_FOR_SIGNATURE,onTryAgain:i,providerType:Ml.ProviderType.MAGIC})},NGe="_main_1c8le_1",DGe="_infoModal_1c8le_11",$Ge="_infoContent_1c8le_15",MGe="_info_1c8le_11",kGe="_infoImage_1c8le_26",LGe="_assets_1c8le_34",UGe="_login_1c8le_38",BGe="_goBackButton_1c8le_42",cc={main:NGe,infoModal:DGe,infoContent:$Ge,info:MGe,infoImage:kGe,assets:LGe,login:UGe,goBackButton:BGe},FGe={i18n:{title:"What is a wallet?",assets:{title:"A home for your digital assets",text:"Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, just connect your wallet."},goBack:"Return to log in page"}},jGe=t=>{const{i18n:e=FGe.i18n,onClose:r,open:n}=t;return Je.jsxs(Jk.Modal,{size:"tiny",open:n,className:cc.infoModal,children:[Je.jsx(Zk,{title:"",onClose:r}),Je.jsx(Qk,{className:cc.infoContent,children:Je.jsxs("div",{className:cc.main,children:[Je.jsx("h1",{className:cc.title,children:e==null?void 0:e.title}),Je.jsxs("article",{className:cc.info,children:[Je.jsx("div",{className:dp(cc.infoImage,cc.assets)}),Je.jsx("h3",{children:e==null?void 0:e.assets.title}),Je.jsx("p",{children:e==null?void 0:e.assets.text})]}),Je.jsxs("article",{className:cc.info,children:[Je.jsx("div",{className:dp(cc.infoImage,cc.login)}),Je.jsx("h3",{children:e==null?void 0:e.logIn.title}),Je.jsx("p",{children:e==null?void 0:e.logIn.text})]}),Je.jsx(cu.Button,{className:cc.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},qGe="_main_1vyd9_1",HGe="_left_1vyd9_22",zGe="_leftInfo_1vyd9_32",VGe="_right_1vyd9_41",GGe="_footer_1vyd9_50",WGe="_guestInfo_1vyd9_69",DE={main:qGe,left:HGe,leftInfo:zGe,right:VGe,footer:GGe,guestInfo:WGe},KGe=()=>{const[t]=Zye(),[e,r]=Ge.useState(Ri.CONNECTING_WALLET),[n,i]=Ge.useState(!1),[a,o]=Ge.useState(!1),[s,c]=Ge.useState(),u=Kse(),f=u&&new URL(u).pathname==="/play",d=Ge.useCallback(()=>{i(!n)},[i,n]),g=Ge.useMemo(()=>{if(u){const y=new URL(u);return y.searchParams.append("guest","true"),y.toString()}return""},[u]),m=Ge.useCallback(async y=>{var _;if(c(y),TGe(y))r(Ri.LOADING_MAGIC),await DQ(y);else try{o(!0),r(Ri.CONNECTING_WALLET);const b=await DQ(y);t.get("fromRequests")!=="true"&&(r(Ri.WAITING_FOR_SIGNATURE),await Mce(((_=b.account)==null?void 0:_.toLowerCase())??"",b.provider)),u?window.location.href=decodeURIComponent(u):window.location.href="/",o(!1)}catch{r(Ri.ERROR)}},[r,o,c,u,t]),w=Ge.useCallback(()=>{o(!1),c(void 0),r(Ri.CONNECTING_WALLET)},[o]),v=Ge.useCallback(()=>{s&&m(s)},[s]);return Je.jsxs("main",{className:DE.main,children:[Je.jsx(jGe,{open:n,onClose:d}),Je.jsx(tce,{open:a,state:e,onClose:w,onTryAgain:v,providerType:s?$ce(s):null}),Je.jsx("div",{className:DE.left,children:Je.jsxs("div",{className:DE.leftInfo,children:[Je.jsx(SGe,{onLearnMore:d,onConnect:m,loadingOption:s,socialOptions:{primary:Hn.GOOGLE,secondary:[Hn.DISCORD,Hn.APPLE,Hn.X]},web3Options:{primary:Hn.METAMASK,secondary:[Hn.FORTMATIC,Hn.COINBASE,Hn.WALLET_CONNECT]}}),f&&Je.jsxs("div",{className:DE.guestInfo,children:["Quick dive? ",Je.jsx("a",{href:g,children:"Explore as a guest"})]})]})})]})};aye.render(Je.jsx(QQ.StrictMode,{children:Je.jsx(Xye,{basename:"/auth",children:Je.jsxs(Yye,{children:[Je.jsx(Zv,{path:"/login",element:Je.jsx(KGe,{})}),Je.jsx(Zv,{path:"/callback",element:Je.jsx(CGe,{})}),Je.jsx(Zv,{path:"/requests/:requestId",element:Je.jsx(Rqe,{})}),Je.jsx(Zv,{path:"*",element:Je.jsx(Cqe,{})})]})})}),document.getElementById("root"));export{ut as B,h5e as R,Fae as T,S$e as _,ii as a,Ha as b,Ne as c,Nc as d,fo as e,dN as f,uo as g,$a as h,UW as n,aWe as o,Oc as p,X$ as r,vne as s,iWe as t,Ry as y};
|
|
187
|
+
//# sourceMappingURL=index-181eb57b.js.map
|