@dcl/auth-site 0.1.3-7453122590.commit-211e684 → 0.2.0

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.
@@ -118,7 +118,7 @@ Instead of \``+$+"`, did you mean:",L.map(function(k){return`
118
118
  border-radius: 0;
119
119
  z-index: 2147483647;
120
120
  }
121
- `}])),vN}var G4e=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]}),W4e=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),K4e=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)&&G4e(e,t,r);return W4e(e,t),e};Object.defineProperty(JS,"__esModule",{value:!0});JS.FortmaticConnector=void 0;const Y4e=pae,Q4e=kl,J4e=Hs;class X4e extends Y4e.AbstractConnector{constructor(e){const r=J4e.getConfiguration()[Q4e.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(()=>K4e(V4e()));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()}}JS.FortmaticConnector=X4e;var oI={};function Z4(){return Z4=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},Z4.apply(this,arguments)}function Ok(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function e5(t){return e5=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},e5(t)}function GA(t,e){return GA=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},GA(t,e)}function Z4e(){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 Rx(t,e,r){return Z4e()?Rx=Reflect.construct:Rx=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&GA(u,o.prototype),u},Rx.apply(null,arguments)}function e5e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function WA(t){var e=typeof Map=="function"?new Map:void 0;return WA=function(n){if(n===null||!e5e(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 Rx(n,arguments,e5(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),GA(i,n)},WA(t)}function _E(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 m0(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function Wc(t){return t.hasOwnProperty("result")?t.result:t}var Cx=function(t){Ok(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}(WA(Error)),Xae=function(t){Ok(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}(WA(Error)),t5e=function(t){Ok(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(_E(i)),i.handleChainChanged=i.handleChainChanged.bind(_E(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(_E(i)),i.handleClose=i.handleClose.bind(_E(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 Z4({provider:window.ethereum},s?{account:s}:{})}var g=function(){if(!s)return Promise.resolve(window.ethereum.enable().then(function(m){return m&&Wc(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 Cx;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=m0(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return Wc(u)[0]})).then(function(u){s=u})},function(u){if(u.code===4001)throw new Xae});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=Wc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=Wc(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=m0(function(){return Promise.resolve(window.ethereum.send("net_version").then(Wc)).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 Cx;var a,o=m0(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(Wc)).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=Wc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=m0(function(){return Promise.resolve(window.ethereum.enable().then(function(d){return Wc(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 Cx;var a,o=m0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(s){return Wc(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(m0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return Wc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(QS);const r5e=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:t5e,NoEthereumProviderError:Cx,UserRejectedRequestError:Xae},Symbol.toStringTag,{value:"Module"})),n5e=uo(r5e);Object.defineProperty(oI,"__esModule",{value:!0});oI.InjectedConnector=void 0;const i5e=n5e;class a5e extends i5e.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}oI.InjectedConnector=a5e;var sI={},o5e="Invariant failed";function LW(t,e){if(!t)throw new Error(o5e)}function Zae(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,R1(t,e)}function t5(t){return t5=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},t5(t)}function R1(t,e){return R1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},R1(t,e)}function s5e(){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 Nx(t,e,r){return s5e()?Nx=Reflect.construct:Nx=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&R1(u,o.prototype),u},Nx.apply(null,arguments)}function c5e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function r5(t){var e=typeof Map=="function"?new Map:void 0;return r5=function(n){if(n===null||!c5e(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 Nx(n,arguments,t5(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),R1(i,n)},r5(t)}var Dx=function(t){Zae(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}(r5(Error)),u5e=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 Dx(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,d,g;throw new Dx(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 Dx("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},l5e=function(t){Zae(e,t);function e(n){var i,a=n.urls,o=n.defaultChainId;return o||Object.keys(a).length===1||LW(!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 u5e(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())||LW(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(QS);const f5e=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:l5e,RequestError:Dx},Symbol.toStringTag,{value:"Module"})),d5e=uo(f5e);Object.defineProperty(sI,"__esModule",{value:!0});sI.NetworkConnector=void 0;const h5e=Sc,p5e=d5e,g5e=Hs;class y5e extends p5e.NetworkConnector{constructor(e){super({urls:g5e.getConfiguration()[h5e.ProviderType.NETWORK].urls,defaultChainId:e})}}sI.NetworkConnector=y5e;var cI={};const m5e="modulepreload",v5e=function(t){return"https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/"+t},UW={},Dy=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=v5e(a),a in UW)return;UW[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":m5e,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 n5(){return n5=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},n5.apply(this,arguments)}function b5e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i5(t,e)}function i5(t,e){return i5=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},i5(t,e)}function BW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var w5e=1,_5e=function(t){b5e(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(BW(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(BW(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(Dy(()=>import("./index-bc995c63.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(n5({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,w5e)})}();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}(QS);const E5e=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:_5e},Symbol.toStringTag,{value:"Module"})),x5e=uo(E5e);Object.defineProperty(cI,"__esModule",{value:!0});cI.WalletLinkConnector=void 0;const A5e=kl,S5e=x5e,I5e=Hs;class O5e extends S5e.WalletLinkConnector{constructor(e){const r=I5e.getConfiguration()[A5e.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}cI.WalletLinkConnector=O5e;var uI={};const P5e=Symbol(),FW=Object.getPrototypeOf,a5=new WeakMap,T5e=t=>t&&(a5.has(t)?a5.get(t):FW(t)===Object.prototype||FW(t)===Array.prototype),R5e=t=>T5e(t)&&t[P5e]||null,jW=(t,e=!0)=>{a5.set(t,e)},bN=t=>typeof t=="object"&&t!==null,_f=new WeakMap,EE=new WeakSet,C5e=(t=Object.is,e=(u,f)=>new Proxy(u,f),r=u=>bN(u)&&!EE.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 jW(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(EE.has(v))jW(v,!1);else if(v instanceof Promise)delete y.value,y.get=()=>d(v);else if(_f.has(v)){const[_,b]=_f.get(v);y.value=a(_,b(),d)}Object.defineProperty(m,w,y)}),Object.preventExtensions(m)},o=new WeakMap,s=[1,1],c=u=>{if(!bN(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,M=++s[0])=>{d!==M&&(d=M,g.forEach(j=>j(C,M)))};let w=s[1];const v=(C=++s[1])=>(w!==C&&!g.size&&(w=C,_.forEach(([M])=>{const j=M[1](C);j>d&&(d=j)})),d),y=C=>(M,j)=>{const ce=[...M];ce[1]=[C,...ce[1]],m(ce,j)},_=new Map,b=(C,M)=>{if(g.size){const j=M[3](y(C));_.set(C,[M,j])}else _.set(C,[M])},S=C=>{var M;const j=_.get(C);j&&(_.delete(C),(M=j[1])==null||M.call(j))},x=C=>(g.add(C),g.size===1&&_.forEach(([j,ce],he)=>{const B=j[3](y(he));_.set(he,[j,B])}),()=>{g.delete(C),g.size===0&&_.forEach(([j,ce],he)=>{ce&&(ce(),_.set(he,[j]))})}),I=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),p=e(I,{deleteProperty(C,M){const j=Reflect.get(C,M);S(M);const ce=Reflect.deleteProperty(C,M);return ce&&m(["delete",[M],j]),ce},set(C,M,j,ce){const he=Reflect.has(C,M),B=Reflect.get(C,M,ce);if(he&&(t(B,j)||o.has(j)&&t(B,o.get(j))))return!0;S(M),bN(j)&&(j=R5e(j)||j);let U=j;if(j instanceof Promise)j.then(K=>{j.status="fulfilled",j.value=K,m(["resolve",[M],K])}).catch(K=>{j.status="rejected",j.reason=K,m(["reject",[M],K])});else{!_f.has(j)&&r(j)&&(U=c(j));const K=!EE.has(U)&&_f.get(U);K&&b(M,K)}return Reflect.set(C,M,U,ce),m(["set",[M],j,B]),!0}});o.set(u,p);const O=[I,v,a,x];return _f.set(p,O),Reflect.ownKeys(u).forEach(C=>{const M=Object.getOwnPropertyDescriptor(u,C);"value"in M&&(p[C]=u[C],delete M.value,delete M.writable),Object.defineProperty(I,C,M)}),p})=>[c,_f,EE,t,e,r,n,i,a,o,s],[N5e]=C5e();function Id(t={}){return N5e(t)}function Rp(t,e,r){const n=_f.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 D5e(t,e){const r=_f.get(t),[n,i,a]=r;return a(n,i(),e)}const Wi=Id({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),eoe={state:Wi,subscribe(t){return Rp(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}},Ma={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 Ma.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ma.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(Ma.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(!Ma.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(Ma.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(Ma.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Ma.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=eoe.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},$5e=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Ia=Id({enabled:$5e,userSessionId:"",events:[],connectedWalletId:void 0}),M5e={state:Ia,subscribe(t){return Rp(Ia.events,()=>t(D5e(Ia.events[Ia.events.length-1])))},initialize(){Ia.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Ia.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Ia.connectedWalletId=t},click(t){if(Ia.enabled){const e={type:"CLICK",name:t.name,userSessionId:Ia.userSessionId,timestamp:Date.now(),data:t};Ia.events.push(e)}},track(t){if(Ia.enabled){const e={type:"TRACK",name:t.name,userSessionId:Ia.userSessionId,timestamp:Date.now(),data:t};Ia.events.push(e)}},view(t){if(Ia.enabled){const e={type:"VIEW",name:t.name,userSessionId:Ia.userSessionId,timestamp:Date.now(),data:t};Ia.events.push(e)}}},Kc=Id({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Tc={state:Kc,subscribe(t){return Rp(Kc,()=>t(Kc))},setChains(t){Kc.chains=t},setWalletConnectUri(t){Kc.walletConnectUri=t},setIsCustomDesktop(t){Kc.isCustomDesktop=t},setIsCustomMobile(t){Kc.isCustomMobile=t},setIsDataLoaded(t){Kc.isDataLoaded=t},setIsUiLoaded(t){Kc.isUiLoaded=t},setIsAuth(t){Kc.isAuth=t}},xE=Id({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}),$y={state:xE,subscribe(t){return Rp(xE,()=>t(xE))},setConfig(t){var e,r;M5e.initialize(),Tc.setChains(t.chains),Tc.setIsAuth(!!t.enableAuthMode),Tc.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),Tc.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Ma.setModalVersionInStorage(),Object.assign(xE,t)}};var k5e=Object.defineProperty,qW=Object.getOwnPropertySymbols,L5e=Object.prototype.hasOwnProperty,U5e=Object.prototype.propertyIsEnumerable,HW=(t,e,r)=>e in t?k5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,B5e=(t,e)=>{for(var r in e||(e={}))L5e.call(e,r)&&HW(t,r,e[r]);if(qW)for(var r of qW(e))U5e.call(e,r)&&HW(t,r,e[r]);return t};const o5="https://explorer-api.walletconnect.com",s5="wcm",c5="js-2.6.2";async function AE(t,e){const r=B5e({sdkType:s5,sdkVersion:c5},e),n=new URL(t,o5);return n.searchParams.append("projectId",$y.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const eh={async getDesktopListings(t){return AE("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return AE("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return AE("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return AE("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${o5}/w3m/v1/getWalletImage/${t}?projectId=${$y.state.projectId}&sdkType=${s5}&sdkVersion=${c5}`},getAssetImageUrl(t){return`${o5}/w3m/v1/getAssetImage/${t}?projectId=${$y.state.projectId}&sdkType=${s5}&sdkVersion=${c5}`}};var F5e=Object.defineProperty,zW=Object.getOwnPropertySymbols,j5e=Object.prototype.hasOwnProperty,q5e=Object.prototype.propertyIsEnumerable,VW=(t,e,r)=>e in t?F5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H5e=(t,e)=>{for(var r in e||(e={}))j5e.call(e,r)&&VW(t,r,e[r]);if(zW)for(var r of zW(e))q5e.call(e,r)&&VW(t,r,e[r]);return t};const GW=Ma.isMobile(),Yc=Id({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),cKe={state:Yc,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=$y.state;if(t==="NONE"||e==="ALL"&&!t)return Yc.recomendedWallets;if(Ma.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await eh.getAllListings(r),i=Object.values(n);i.sort((a,o)=>{const s=t.indexOf(a.id),c=t.indexOf(o.id);return s-c}),Yc.recomendedWallets=i}else{const{chains:r,isAuth:n}=Tc.state,i=r==null?void 0:r.join(","),a=Ma.isArray(e),o={page:1,sdks:n?"auth_v1":void 0,entries:Ma.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:s}=GW?await eh.getMobileListings(o):await eh.getDesktopListings(o);Yc.recomendedWallets=Object.values(s)}return Yc.recomendedWallets},async getWallets(t){const e=H5e({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=$y.state,{recomendedWallets:i}=Yc;if(n==="ALL")return Yc.wallets;i.length?e.excludedIds=i.map(d=>d.id).join(","):Ma.isArray(r)&&(e.excludedIds=r.join(",")),Ma.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Tc.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:o}=t,{listings:s,total:c}=GW?await eh.getMobileListings(e):await eh.getDesktopListings(e),u=Object.values(s),f=o?"search":"wallets";return Yc[f]={listings:[...Yc[f].listings,...u],total:c,page:a??1},{listings:u,total:c}},getWalletImageUrl(t){return eh.getWalletImageUrl(t)},getAssetImageUrl(t){return eh.getAssetImageUrl(t)},resetSearch(){Yc.search={listings:[],total:0,page:1}}},v0=Id({open:!1}),wN={state:v0,subscribe(t){return Rp(v0,()=>t(v0))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Tc.state;if(Ma.removeWalletConnectDeepLink(),Tc.setWalletConnectUri(t==null?void 0:t.uri),Tc.setChains(t==null?void 0:t.chains),eoe.reset("ConnectWallet"),r&&n)v0.open=!0,e();else{const i=setInterval(()=>{const a=Tc.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),v0.open=!0,e())},200)}})},close(){v0.open=!1}};var z5e=Object.defineProperty,WW=Object.getOwnPropertySymbols,V5e=Object.prototype.hasOwnProperty,G5e=Object.prototype.propertyIsEnumerable,KW=(t,e,r)=>e in t?z5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W5e=(t,e)=>{for(var r in e||(e={}))V5e.call(e,r)&&KW(t,r,e[r]);if(WW)for(var r of WW(e))G5e.call(e,r)&&KW(t,r,e[r]);return t};function K5e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Ov=Id({themeMode:K5e()?"dark":"light"}),YW={state:Ov,subscribe(t){return Rp(Ov,()=>t(Ov))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Ov.themeMode=e),r&&(Ov.themeVariables=W5e({},r))}},th=Id({open:!1,message:"",variant:"success"}),uKe={state:th,subscribe(t){return Rp(th,()=>t(th))},openToast(t,e){th.open=!0,th.message=t,th.variant=e},closeToast(){th.open=!1}};let Y5e=class{constructor(e){this.openModal=wN.open,this.closeModal=wN.close,this.subscribeModal=wN.subscribe,this.setTheme=YW.setThemeConfig,YW.setThemeConfig(e),$y.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Dy(()=>import("./index-e448f20b.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Tc.setIsUiLoaded(!0)}}};const Q5e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Y5e},Symbol.toStringTag,{value:"Module"})),J5e=uo(Q5e);var Pk={},lI={},Lr={},toe={};(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}})(toe);Object.defineProperty(Lr,"__esModule",{value:!0});var roe=toe;function X5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Lr.readInt16BE=X5e;function Z5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Lr.readUint16BE=Z5e;function eDe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Lr.readInt16LE=eDe;function tDe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Lr.readUint16LE=tDe;function noe(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}Lr.writeUint16BE=noe;Lr.writeInt16BE=noe;function ioe(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}Lr.writeUint16LE=ioe;Lr.writeInt16LE=ioe;function u5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Lr.readInt32BE=u5;function l5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Lr.readUint32BE=l5;function f5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Lr.readInt32LE=f5;function d5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Lr.readUint32LE=d5;function KA(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}Lr.writeUint32BE=KA;Lr.writeInt32BE=KA;function YA(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}Lr.writeUint32LE=YA;Lr.writeInt32LE=YA;function rDe(t,e){e===void 0&&(e=0);var r=u5(t,e),n=u5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Lr.readInt64BE=rDe;function nDe(t,e){e===void 0&&(e=0);var r=l5(t,e),n=l5(t,e+4);return r*4294967296+n}Lr.readUint64BE=nDe;function iDe(t,e){e===void 0&&(e=0);var r=f5(t,e),n=f5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Lr.readInt64LE=iDe;function aDe(t,e){e===void 0&&(e=0);var r=d5(t,e),n=d5(t,e+4);return n*4294967296+r}Lr.readUint64LE=aDe;function aoe(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),KA(t/4294967296>>>0,e,r),KA(t>>>0,e,r+4),e}Lr.writeUint64BE=aoe;Lr.writeInt64BE=aoe;function ooe(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),YA(t>>>0,e,r),YA(t/4294967296>>>0,e,r+4),e}Lr.writeUint64LE=ooe;Lr.writeInt64LE=ooe;function oDe(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}Lr.readUintBE=oDe;function sDe(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}Lr.readUintLE=sDe;function cDe(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(!roe.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}Lr.writeUintBE=cDe;function uDe(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(!roe.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}Lr.writeUintLE=uDe;function lDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Lr.readFloat32BE=lDe;function fDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Lr.readFloat32LE=fDe;function dDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Lr.readFloat64BE=dDe;function hDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Lr.readFloat64LE=hDe;function pDe(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}Lr.writeFloat32BE=pDe;function gDe(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}Lr.writeFloat32LE=gDe;function yDe(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}Lr.writeFloat64BE=yDe;function mDe(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}Lr.writeFloat64LE=mDe;var as={};Object.defineProperty(as,"__esModule",{value:!0});function vDe(t){for(var e=0;e<t.length;e++)t[e]=0;return t}as.wipe=vDe;Object.defineProperty(lI,"__esModule",{value:!0});var Oa=Lr,h5=as,bDe=20;function wDe(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,I=a,E=o,p=s,O=c,C=u,M=f,j=d,ce=g,he=m,B=w,U=v,K=y,ne=_,F=b,q=0;q<bDe;q+=2)S=S+p|0,U^=S,U=U>>>32-16|U<<16,j=j+U|0,p^=j,p=p>>>32-12|p<<12,x=x+O|0,K^=x,K=K>>>32-16|K<<16,ce=ce+K|0,O^=ce,O=O>>>32-12|O<<12,I=I+C|0,ne^=I,ne=ne>>>32-16|ne<<16,he=he+ne|0,C^=he,C=C>>>32-12|C<<12,E=E+M|0,F^=E,F=F>>>32-16|F<<16,B=B+F|0,M^=B,M=M>>>32-12|M<<12,I=I+C|0,ne^=I,ne=ne>>>32-8|ne<<8,he=he+ne|0,C^=he,C=C>>>32-7|C<<7,E=E+M|0,F^=E,F=F>>>32-8|F<<8,B=B+F|0,M^=B,M=M>>>32-7|M<<7,x=x+O|0,K^=x,K=K>>>32-8|K<<8,ce=ce+K|0,O^=ce,O=O>>>32-7|O<<7,S=S+p|0,U^=S,U=U>>>32-8|U<<8,j=j+U|0,p^=j,p=p>>>32-7|p<<7,S=S+O|0,F^=S,F=F>>>32-16|F<<16,he=he+F|0,O^=he,O=O>>>32-12|O<<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,I=I+M|0,K^=I,K=K>>>32-16|K<<16,j=j+K|0,M^=j,M=M>>>32-12|M<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,ce=ce+ne|0,p^=ce,p=p>>>32-12|p<<12,I=I+M|0,K^=I,K=K>>>32-8|K<<8,j=j+K|0,M^=j,M=M>>>32-7|M<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,ce=ce+ne|0,p^=ce,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+O|0,F^=S,F=F>>>32-8|F<<8,he=he+F|0,O^=he,O=O>>>32-7|O<<7;Oa.writeUint32LE(S+n|0,t,0),Oa.writeUint32LE(x+i|0,t,4),Oa.writeUint32LE(I+a|0,t,8),Oa.writeUint32LE(E+o|0,t,12),Oa.writeUint32LE(p+s|0,t,16),Oa.writeUint32LE(O+c|0,t,20),Oa.writeUint32LE(C+u|0,t,24),Oa.writeUint32LE(M+f|0,t,28),Oa.writeUint32LE(j+d|0,t,32),Oa.writeUint32LE(ce+g|0,t,36),Oa.writeUint32LE(he+m|0,t,40),Oa.writeUint32LE(B+w|0,t,44),Oa.writeUint32LE(U+v|0,t,48),Oa.writeUint32LE(K+y|0,t,52),Oa.writeUint32LE(ne+_|0,t,56),Oa.writeUint32LE(F+b|0,t,60)}function soe(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){wDe(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 h5.wipe(s),i===0&&h5.wipe(a),n}lI.streamXOR=soe;function _De(t,e,r,n){return n===void 0&&(n=0),h5.wipe(r),soe(t,e,r,r,n)}lI.stream=_De;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 coe={},Od={};Object.defineProperty(Od,"__esModule",{value:!0});function xDe(t,e,r){return~(t-1)&e|t-1&r}Od.select=xDe;function ADe(t,e){return(t|0)-(e|0)-1>>>31&1}Od.lessOrEqual=ADe;function uoe(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}Od.compare=uoe;function SDe(t,e){return t.length===0||e.length===0?!1:uoe(t,e)!==0}Od.equal=SDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Od,r=as;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],I=this._r[0],E=this._r[1],p=this._r[2],O=this._r[3],C=this._r[4],M=this._r[5],j=this._r[6],ce=this._r[7],he=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 q=s[c+8]|s[c+9]<<8;v+=(F>>>4|q<<12)&8191,y+=q>>>1&8191;var z=s[c+10]|s[c+11]<<8;_+=(q>>>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 L=0,k=L;k+=d*I,k+=g*(5*B),k+=m*(5*he),k+=w*(5*ce),k+=v*(5*j),L=k>>>13,k&=8191,k+=y*(5*M),k+=_*(5*C),k+=b*(5*O),k+=S*(5*p),k+=x*(5*E),L+=k>>>13,k&=8191;var G=L;G+=d*E,G+=g*I,G+=m*(5*B),G+=w*(5*he),G+=v*(5*ce),L=G>>>13,G&=8191,G+=y*(5*j),G+=_*(5*M),G+=b*(5*C),G+=S*(5*O),G+=x*(5*p),L+=G>>>13,G&=8191;var ge=L;ge+=d*p,ge+=g*E,ge+=m*I,ge+=w*(5*B),ge+=v*(5*he),L=ge>>>13,ge&=8191,ge+=y*(5*ce),ge+=_*(5*j),ge+=b*(5*M),ge+=S*(5*C),ge+=x*(5*O),L+=ge>>>13,ge&=8191;var Q=L;Q+=d*O,Q+=g*p,Q+=m*E,Q+=w*I,Q+=v*(5*B),L=Q>>>13,Q&=8191,Q+=y*(5*he),Q+=_*(5*ce),Q+=b*(5*j),Q+=S*(5*M),Q+=x*(5*C),L+=Q>>>13,Q&=8191;var te=L;te+=d*C,te+=g*O,te+=m*p,te+=w*E,te+=v*I,L=te>>>13,te&=8191,te+=y*(5*B),te+=_*(5*he),te+=b*(5*ce),te+=S*(5*j),te+=x*(5*M),L+=te>>>13,te&=8191;var ue=L;ue+=d*M,ue+=g*C,ue+=m*O,ue+=w*p,ue+=v*E,L=ue>>>13,ue&=8191,ue+=y*I,ue+=_*(5*B),ue+=b*(5*he),ue+=S*(5*ce),ue+=x*(5*j),L+=ue>>>13,ue&=8191;var T=L;T+=d*j,T+=g*M,T+=m*C,T+=w*O,T+=v*p,L=T>>>13,T&=8191,T+=y*E,T+=_*I,T+=b*(5*B),T+=S*(5*he),T+=x*(5*ce),L+=T>>>13,T&=8191;var fe=L;fe+=d*ce,fe+=g*j,fe+=m*M,fe+=w*C,fe+=v*O,L=fe>>>13,fe&=8191,fe+=y*p,fe+=_*E,fe+=b*I,fe+=S*(5*B),fe+=x*(5*he),L+=fe>>>13,fe&=8191;var Ge=L;Ge+=d*he,Ge+=g*ce,Ge+=m*j,Ge+=w*M,Ge+=v*C,L=Ge>>>13,Ge&=8191,Ge+=y*O,Ge+=_*p,Ge+=b*E,Ge+=S*I,Ge+=x*(5*B),L+=Ge>>>13,Ge&=8191;var tt=L;tt+=d*B,tt+=g*he,tt+=m*ce,tt+=w*j,tt+=v*M,L=tt>>>13,tt&=8191,tt+=y*C,tt+=_*O,tt+=b*p,tt+=S*E,tt+=x*I,L+=tt>>>13,tt&=8191,L=(L<<2)+L|0,L=L+k|0,k=L&8191,L=L>>>13,G+=L,d=k,g=G,m=ge,w=Q,v=te,y=ue,_=T,b=fe,S=Ge,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})(coe);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=lI,r=coe,n=as,i=Lr,a=Od;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})(Pk);var loe={},$w={},Tk={};Object.defineProperty(Tk,"__esModule",{value:!0});function IDe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}Tk.isSerializableHash=IDe;Object.defineProperty($w,"__esModule",{value:!0});var Qc=Tk,ODe=Od,PDe=as,foe=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),Qc.isSerializableHash(this._inner)&&Qc.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),PDe.wipe(n)}return t.prototype.reset=function(){if(!Qc.isSerializableHash(this._inner)||!Qc.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(){Qc.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Qc.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(!Qc.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(!Qc.isSerializableHash(this._inner)||!Qc.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(!Qc.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();$w.HMAC=foe;function TDe(t,e,r){var n=new foe(t,e);n.update(r);var i=n.digest();return n.clean(),i}$w.hmac=TDe;$w.equal=ODe.equal;Object.defineProperty(loe,"__esModule",{value:!0});var QW=$w,JW=as,RDe=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=QW.hmac(this._hash,n,r);this._hmac=new QW.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(),JW.wipe(this._buffer),JW.wipe(this._counter),this._bufpos=0},t}(),CDe=loe.HKDF=RDe,um={},fI={},dI={};Object.defineProperty(dI,"__esModule",{value:!0});dI.BrowserRandomSource=void 0;const XW=65536;class NDe{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+=XW)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,XW)));return r}}dI.BrowserRandomSource=NDe;function p5(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 hI={};Object.defineProperty(hI,"__esModule",{value:!0});hI.NodeRandomSource=void 0;const DDe=as;class $De{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof p5<"u"){const e=cM;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,DDe.wipe)(r),n}}hI.NodeRandomSource=$De;Object.defineProperty(fI,"__esModule",{value:!0});fI.SystemRandomSource=void 0;const MDe=dI,kDe=hI;class LDe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new MDe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new kDe.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)}}fI.SystemRandomSource=LDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=fI,r=Lr,n=as;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})(um);var pI={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Lr,r=as;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 I=f+x*4;s[x]=e.readUint32BE(u,I)}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 O=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;s[x]=(p+s[x-7]|0)+(O+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,O=((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+O|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})(pI);var Rk={};(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=um,r=as;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(x){const I=new Float64Array(16);if(x)for(let E=0;E<x.length;E++)I[E]=x[E];return I}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function o(x){let I=1;for(let E=0;E<16;E++){let p=x[E]+I+65535;I=Math.floor(p/65536),x[E]=p-I*65536}x[0]+=I-1+37*(I-1)}function s(x,I,E){const p=~(E-1);for(let O=0;O<16;O++){const C=p&(x[O]^I[O]);x[O]^=C,I[O]^=C}}function c(x,I){const E=n(),p=n();for(let O=0;O<16;O++)p[O]=I[O];o(p),o(p),o(p);for(let O=0;O<2;O++){E[0]=p[0]-65517;for(let M=1;M<15;M++)E[M]=p[M]-65535-(E[M-1]>>16&1),E[M-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 O=0;O<16;O++)x[2*O]=p[O]&255,x[2*O+1]=p[O]>>8}function u(x,I){for(let E=0;E<16;E++)x[E]=I[2*E]+(I[2*E+1]<<8);x[15]&=32767}function f(x,I,E){for(let p=0;p<16;p++)x[p]=I[p]+E[p]}function d(x,I,E){for(let p=0;p<16;p++)x[p]=I[p]-E[p]}function g(x,I,E){let p,O,C=0,M=0,j=0,ce=0,he=0,B=0,U=0,K=0,ne=0,F=0,q=0,z=0,$=0,H=0,L=0,k=0,G=0,ge=0,Q=0,te=0,ue=0,T=0,fe=0,Ge=0,tt=0,mt=0,vt=0,gt=0,Lt=0,Yt=0,_r=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],vr=E[15];p=I[0],C+=p*Rt,M+=p*Pt,j+=p*kt,ce+=p*Nt,he+=p*Kt,B+=p*Ut,U+=p*zt,K+=p*$t,ne+=p*Dt,F+=p*qt,q+=p*Mt,z+=p*cr,$+=p*tr,H+=p*ir,L+=p*nr,k+=p*vr,p=I[1],M+=p*Rt,j+=p*Pt,ce+=p*kt,he+=p*Nt,B+=p*Kt,U+=p*Ut,K+=p*zt,ne+=p*$t,F+=p*Dt,q+=p*qt,z+=p*Mt,$+=p*cr,H+=p*tr,L+=p*ir,k+=p*nr,G+=p*vr,p=I[2],j+=p*Rt,ce+=p*Pt,he+=p*kt,B+=p*Nt,U+=p*Kt,K+=p*Ut,ne+=p*zt,F+=p*$t,q+=p*Dt,z+=p*qt,$+=p*Mt,H+=p*cr,L+=p*tr,k+=p*ir,G+=p*nr,ge+=p*vr,p=I[3],ce+=p*Rt,he+=p*Pt,B+=p*kt,U+=p*Nt,K+=p*Kt,ne+=p*Ut,F+=p*zt,q+=p*$t,z+=p*Dt,$+=p*qt,H+=p*Mt,L+=p*cr,k+=p*tr,G+=p*ir,ge+=p*nr,Q+=p*vr,p=I[4],he+=p*Rt,B+=p*Pt,U+=p*kt,K+=p*Nt,ne+=p*Kt,F+=p*Ut,q+=p*zt,z+=p*$t,$+=p*Dt,H+=p*qt,L+=p*Mt,k+=p*cr,G+=p*tr,ge+=p*ir,Q+=p*nr,te+=p*vr,p=I[5],B+=p*Rt,U+=p*Pt,K+=p*kt,ne+=p*Nt,F+=p*Kt,q+=p*Ut,z+=p*zt,$+=p*$t,H+=p*Dt,L+=p*qt,k+=p*Mt,G+=p*cr,ge+=p*tr,Q+=p*ir,te+=p*nr,ue+=p*vr,p=I[6],U+=p*Rt,K+=p*Pt,ne+=p*kt,F+=p*Nt,q+=p*Kt,z+=p*Ut,$+=p*zt,H+=p*$t,L+=p*Dt,k+=p*qt,G+=p*Mt,ge+=p*cr,Q+=p*tr,te+=p*ir,ue+=p*nr,T+=p*vr,p=I[7],K+=p*Rt,ne+=p*Pt,F+=p*kt,q+=p*Nt,z+=p*Kt,$+=p*Ut,H+=p*zt,L+=p*$t,k+=p*Dt,G+=p*qt,ge+=p*Mt,Q+=p*cr,te+=p*tr,ue+=p*ir,T+=p*nr,fe+=p*vr,p=I[8],ne+=p*Rt,F+=p*Pt,q+=p*kt,z+=p*Nt,$+=p*Kt,H+=p*Ut,L+=p*zt,k+=p*$t,G+=p*Dt,ge+=p*qt,Q+=p*Mt,te+=p*cr,ue+=p*tr,T+=p*ir,fe+=p*nr,Ge+=p*vr,p=I[9],F+=p*Rt,q+=p*Pt,z+=p*kt,$+=p*Nt,H+=p*Kt,L+=p*Ut,k+=p*zt,G+=p*$t,ge+=p*Dt,Q+=p*qt,te+=p*Mt,ue+=p*cr,T+=p*tr,fe+=p*ir,Ge+=p*nr,tt+=p*vr,p=I[10],q+=p*Rt,z+=p*Pt,$+=p*kt,H+=p*Nt,L+=p*Kt,k+=p*Ut,G+=p*zt,ge+=p*$t,Q+=p*Dt,te+=p*qt,ue+=p*Mt,T+=p*cr,fe+=p*tr,Ge+=p*ir,tt+=p*nr,mt+=p*vr,p=I[11],z+=p*Rt,$+=p*Pt,H+=p*kt,L+=p*Nt,k+=p*Kt,G+=p*Ut,ge+=p*zt,Q+=p*$t,te+=p*Dt,ue+=p*qt,T+=p*Mt,fe+=p*cr,Ge+=p*tr,tt+=p*ir,mt+=p*nr,vt+=p*vr,p=I[12],$+=p*Rt,H+=p*Pt,L+=p*kt,k+=p*Nt,G+=p*Kt,ge+=p*Ut,Q+=p*zt,te+=p*$t,ue+=p*Dt,T+=p*qt,fe+=p*Mt,Ge+=p*cr,tt+=p*tr,mt+=p*ir,vt+=p*nr,gt+=p*vr,p=I[13],H+=p*Rt,L+=p*Pt,k+=p*kt,G+=p*Nt,ge+=p*Kt,Q+=p*Ut,te+=p*zt,ue+=p*$t,T+=p*Dt,fe+=p*qt,Ge+=p*Mt,tt+=p*cr,mt+=p*tr,vt+=p*ir,gt+=p*nr,Lt+=p*vr,p=I[14],L+=p*Rt,k+=p*Pt,G+=p*kt,ge+=p*Nt,Q+=p*Kt,te+=p*Ut,ue+=p*zt,T+=p*$t,fe+=p*Dt,Ge+=p*qt,tt+=p*Mt,mt+=p*cr,vt+=p*tr,gt+=p*ir,Lt+=p*nr,Yt+=p*vr,p=I[15],k+=p*Rt,G+=p*Pt,ge+=p*kt,Q+=p*Nt,te+=p*Kt,ue+=p*Ut,T+=p*zt,fe+=p*$t,Ge+=p*Dt,tt+=p*qt,mt+=p*Mt,vt+=p*cr,gt+=p*tr,Lt+=p*ir,Yt+=p*nr,_r+=p*vr,C+=38*G,M+=38*ge,j+=38*Q,ce+=38*te,he+=38*ue,B+=38*T,U+=38*fe,K+=38*Ge,ne+=38*tt,F+=38*mt,q+=38*vt,z+=38*gt,$+=38*Lt,H+=38*Yt,L+=38*_r,O=1,p=C+O+65535,O=Math.floor(p/65536),C=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=ce+O+65535,O=Math.floor(p/65536),ce=p-O*65536,p=he+O+65535,O=Math.floor(p/65536),he=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=K+O+65535,O=Math.floor(p/65536),K=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=z+O+65535,O=Math.floor(p/65536),z=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,C+=O-1+37*(O-1),O=1,p=C+O+65535,O=Math.floor(p/65536),C=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=ce+O+65535,O=Math.floor(p/65536),ce=p-O*65536,p=he+O+65535,O=Math.floor(p/65536),he=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=K+O+65535,O=Math.floor(p/65536),K=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=z+O+65535,O=Math.floor(p/65536),z=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,C+=O-1+37*(O-1),x[0]=C,x[1]=M,x[2]=j,x[3]=ce,x[4]=he,x[5]=B,x[6]=U,x[7]=K,x[8]=ne,x[9]=F,x[10]=q,x[11]=z,x[12]=$,x[13]=H,x[14]=L,x[15]=k}function m(x,I){g(x,I,I)}function w(x,I){const E=n();for(let p=0;p<16;p++)E[p]=I[p];for(let p=253;p>=0;p--)m(E,E),p!==2&&p!==4&&g(E,E,I);for(let p=0;p<16;p++)x[p]=E[p]}function v(x,I){const E=new Uint8Array(32),p=new Float64Array(80),O=n(),C=n(),M=n(),j=n(),ce=n(),he=n();for(let ne=0;ne<31;ne++)E[ne]=x[ne];E[31]=x[31]&127|64,E[0]&=248,u(p,I);for(let ne=0;ne<16;ne++)C[ne]=p[ne];O[0]=j[0]=1;for(let ne=254;ne>=0;--ne){const F=E[ne>>>3]>>>(ne&7)&1;s(O,C,F),s(M,j,F),f(ce,O,M),d(O,O,M),f(M,C,j),d(C,C,j),m(j,ce),m(he,O),g(O,M,O),g(M,C,ce),f(ce,O,M),d(O,O,M),m(C,O),d(M,j,he),g(O,M,a),f(O,O,j),g(M,M,O),g(O,j,he),g(j,C,p),m(C,ce),s(O,C,F),s(M,j,F)}for(let ne=0;ne<16;ne++)p[ne+16]=O[ne],p[ne+32]=M[ne],p[ne+48]=C[ne],p[ne+64]=j[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 I=new Uint8Array(x);return{publicKey:y(I),secretKey:I}}t.generateKeyPairFromSeed=_;function b(x){const I=(0,e.randomBytes)(32,x),E=_(I);return(0,r.wipe)(I),E}t.generateKeyPair=b;function S(x,I,E=!1){if(x.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(x,I);if(E){let O=0;for(let C=0;C<p.length;C++)O|=p[C];if(O===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=S})(Rk);function Ck(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function doe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ck(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function g5(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=doe(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return Ck(r)}function UDe(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 I=w[_],E=0,p=S-1;(I!==0||E<y)&&p!==-1;p--,E++)I+=256*x[p]>>>0,x[p]=I%s>>>0,I=I/s>>>0;if(I!==0)throw new Error("Non-zero carry");y=E,_++}for(var O=S-y;O!==S&&x[O]===0;)O++;for(var C=c.repeat(v);O<S;++O)C+=t.charAt(x[O]);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 I=0,E=b-1;(x!==0||I<_)&&E!==-1;E--,I++)x+=s*S[E]>>>0,S[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");_=I,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var O=new Uint8Array(y+(b-p)),C=y;p!==b;)O[C++]=S[p++];return O}}}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 BDe=UDe,FDe=BDe;const jDe=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")},qDe=t=>new TextEncoder().encode(t),HDe=t=>new TextDecoder().decode(t);class zDe{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 VDe{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 hoe(this,e)}}class GDe{constructor(e){this.decoders=e}or(e){return hoe(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 hoe=(t,e)=>new GDe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class WDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new zDe(e,r,n),this.decoder=new VDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const gI=({name:t,prefix:e,encode:r,decode:n})=>new WDe(t,e,r,n),Mw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=FDe(r,e);return gI({prefix:t,name:e,encode:n,decode:a=>jDe(i(a))})},KDe=(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},YDe=(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})=>gI({prefix:e,name:t,encode(i){return YDe(i,n,r)},decode(i){return KDe(i,n,r,t)}}),QDe=gI({prefix:"\0",name:"identity",encode:t=>HDe(t),decode:t=>qDe(t)}),JDe=Object.freeze(Object.defineProperty({__proto__:null,identity:QDe},Symbol.toStringTag,{value:"Module"})),XDe=ba({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ZDe=Object.freeze(Object.defineProperty({__proto__:null,base2:XDe},Symbol.toStringTag,{value:"Module"})),e$e=ba({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),t$e=Object.freeze(Object.defineProperty({__proto__:null,base8:e$e},Symbol.toStringTag,{value:"Module"})),r$e=Mw({prefix:"9",name:"base10",alphabet:"0123456789"}),n$e=Object.freeze(Object.defineProperty({__proto__:null,base10:r$e},Symbol.toStringTag,{value:"Module"})),i$e=ba({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),a$e=ba({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),o$e=Object.freeze(Object.defineProperty({__proto__:null,base16:i$e,base16upper:a$e},Symbol.toStringTag,{value:"Module"})),s$e=ba({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),c$e=ba({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),u$e=ba({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),l$e=ba({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),f$e=ba({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),d$e=ba({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),h$e=ba({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),p$e=ba({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),g$e=ba({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),y$e=Object.freeze(Object.defineProperty({__proto__:null,base32:s$e,base32hex:f$e,base32hexpad:h$e,base32hexpadupper:p$e,base32hexupper:d$e,base32pad:u$e,base32padupper:l$e,base32upper:c$e,base32z:g$e},Symbol.toStringTag,{value:"Module"})),m$e=Mw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),v$e=Mw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),b$e=Object.freeze(Object.defineProperty({__proto__:null,base36:m$e,base36upper:v$e},Symbol.toStringTag,{value:"Module"})),w$e=Mw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),_$e=Mw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),E$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:w$e,base58flickr:_$e},Symbol.toStringTag,{value:"Module"})),x$e=ba({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),A$e=ba({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),S$e=ba({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),I$e=ba({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),O$e=Object.freeze(Object.defineProperty({__proto__:null,base64:x$e,base64pad:A$e,base64url:S$e,base64urlpad:I$e},Symbol.toStringTag,{value:"Module"})),poe=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),P$e=poe.reduce((t,e,r)=>(t[r]=e,t),[]),T$e=poe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function R$e(t){return t.reduce((e,r)=>(e+=P$e[r],e),"")}function C$e(t){const e=[];for(const r of t){const n=T$e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const N$e=gI({prefix:"🚀",name:"base256emoji",encode:R$e,decode:C$e}),D$e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:N$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const ZW={...JDe,...ZDe,...t$e,...n$e,...o$e,...y$e,...b$e,...E$e,...O$e,...D$e};function goe(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const eK=goe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),_N=goe("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=doe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),yoe={utf8:eK,"utf-8":eK,hex:ZW.base16,latin1:_N,ascii:_N,binary:_N,...ZW};function Co(t,e="utf8"){const r=yoe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ck(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function co(t,e="utf8"){const r=yoe[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 tK=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))},$$e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),M$e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=za.platform}return t}(),k$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}(),L$e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),U$e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),B$e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,F$e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,rK=3,j$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",B$e]],nK=[["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 q$e(t){return t?iK(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new U$e:typeof navigator<"u"?iK(navigator.userAgent):V$e()}function H$e(t){return t!==""&&j$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 iK(t){var e=H$e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new L$e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<rK&&(i=tK(tK([],i,!0),G$e(rK-i.length),!0)):i=[];var a=i.join("."),o=z$e(t),s=F$e.exec(t);return s&&s[1]?new k$e(r,a,o,s[1]):new $$e(r,a,o)}function z$e(t){for(var e=0,r=nK.length;e<r;e++){var n=nK[e],i=n[0],a=n[1],o=a.exec(t);if(o)return i}return null}function V$e(){var t=typeof za<"u"&&za.version;return t?new M$e(za.version.slice(1)):null}function G$e(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Xt={};/*! *****************************************************************************
121
+ `}])),vN}var G4e=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]}),W4e=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),K4e=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)&&G4e(e,t,r);return W4e(e,t),e};Object.defineProperty(JS,"__esModule",{value:!0});JS.FortmaticConnector=void 0;const Y4e=pae,Q4e=kl,J4e=Hs;class X4e extends Y4e.AbstractConnector{constructor(e){const r=J4e.getConfiguration()[Q4e.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(()=>K4e(V4e()));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()}}JS.FortmaticConnector=X4e;var oI={};function Z4(){return Z4=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},Z4.apply(this,arguments)}function Ok(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function e5(t){return e5=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},e5(t)}function GA(t,e){return GA=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},GA(t,e)}function Z4e(){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 Rx(t,e,r){return Z4e()?Rx=Reflect.construct:Rx=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&GA(u,o.prototype),u},Rx.apply(null,arguments)}function e5e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function WA(t){var e=typeof Map=="function"?new Map:void 0;return WA=function(n){if(n===null||!e5e(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 Rx(n,arguments,e5(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),GA(i,n)},WA(t)}function _E(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 m0(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function Wc(t){return t.hasOwnProperty("result")?t.result:t}var Cx=function(t){Ok(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}(WA(Error)),Xae=function(t){Ok(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}(WA(Error)),t5e=function(t){Ok(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(_E(i)),i.handleChainChanged=i.handleChainChanged.bind(_E(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(_E(i)),i.handleClose=i.handleClose.bind(_E(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 Z4({provider:window.ethereum},s?{account:s}:{})}var g=function(){if(!s)return Promise.resolve(window.ethereum.enable().then(function(m){return m&&Wc(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 Cx;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=m0(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return Wc(u)[0]})).then(function(u){s=u})},function(u){if(u.code===4001)throw new Xae});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=Wc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=Wc(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=m0(function(){return Promise.resolve(window.ethereum.send("net_version").then(Wc)).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 Cx;var a,o=m0(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(Wc)).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=Wc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=m0(function(){return Promise.resolve(window.ethereum.enable().then(function(d){return Wc(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 Cx;var a,o=m0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(s){return Wc(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(m0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return Wc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(QS);const r5e=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:t5e,NoEthereumProviderError:Cx,UserRejectedRequestError:Xae},Symbol.toStringTag,{value:"Module"})),n5e=uo(r5e);Object.defineProperty(oI,"__esModule",{value:!0});oI.InjectedConnector=void 0;const i5e=n5e;class a5e extends i5e.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}oI.InjectedConnector=a5e;var sI={},o5e="Invariant failed";function LW(t,e){if(!t)throw new Error(o5e)}function Zae(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,R1(t,e)}function t5(t){return t5=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},t5(t)}function R1(t,e){return R1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},R1(t,e)}function s5e(){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 Nx(t,e,r){return s5e()?Nx=Reflect.construct:Nx=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&R1(u,o.prototype),u},Nx.apply(null,arguments)}function c5e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function r5(t){var e=typeof Map=="function"?new Map:void 0;return r5=function(n){if(n===null||!c5e(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 Nx(n,arguments,t5(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),R1(i,n)},r5(t)}var Dx=function(t){Zae(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}(r5(Error)),u5e=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 Dx(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,d,g;throw new Dx(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 Dx("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},l5e=function(t){Zae(e,t);function e(n){var i,a=n.urls,o=n.defaultChainId;return o||Object.keys(a).length===1||LW(!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 u5e(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())||LW(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(QS);const f5e=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:l5e,RequestError:Dx},Symbol.toStringTag,{value:"Module"})),d5e=uo(f5e);Object.defineProperty(sI,"__esModule",{value:!0});sI.NetworkConnector=void 0;const h5e=Sc,p5e=d5e,g5e=Hs;class y5e extends p5e.NetworkConnector{constructor(e){super({urls:g5e.getConfiguration()[h5e.ProviderType.NETWORK].urls,defaultChainId:e})}}sI.NetworkConnector=y5e;var cI={};const m5e="modulepreload",v5e=function(t){return"https://cdn.decentraland.org/@dcl/auth-site/0.2.0/"+t},UW={},Dy=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=v5e(a),a in UW)return;UW[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":m5e,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 n5(){return n5=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},n5.apply(this,arguments)}function b5e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i5(t,e)}function i5(t,e){return i5=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},i5(t,e)}function BW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var w5e=1,_5e=function(t){b5e(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(BW(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(BW(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(Dy(()=>import("./index-4ec88b19.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(n5({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,w5e)})}();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}(QS);const E5e=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:_5e},Symbol.toStringTag,{value:"Module"})),x5e=uo(E5e);Object.defineProperty(cI,"__esModule",{value:!0});cI.WalletLinkConnector=void 0;const A5e=kl,S5e=x5e,I5e=Hs;class O5e extends S5e.WalletLinkConnector{constructor(e){const r=I5e.getConfiguration()[A5e.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}cI.WalletLinkConnector=O5e;var uI={};const P5e=Symbol(),FW=Object.getPrototypeOf,a5=new WeakMap,T5e=t=>t&&(a5.has(t)?a5.get(t):FW(t)===Object.prototype||FW(t)===Array.prototype),R5e=t=>T5e(t)&&t[P5e]||null,jW=(t,e=!0)=>{a5.set(t,e)},bN=t=>typeof t=="object"&&t!==null,_f=new WeakMap,EE=new WeakSet,C5e=(t=Object.is,e=(u,f)=>new Proxy(u,f),r=u=>bN(u)&&!EE.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 jW(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(EE.has(v))jW(v,!1);else if(v instanceof Promise)delete y.value,y.get=()=>d(v);else if(_f.has(v)){const[_,b]=_f.get(v);y.value=a(_,b(),d)}Object.defineProperty(m,w,y)}),Object.preventExtensions(m)},o=new WeakMap,s=[1,1],c=u=>{if(!bN(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,M=++s[0])=>{d!==M&&(d=M,g.forEach(j=>j(C,M)))};let w=s[1];const v=(C=++s[1])=>(w!==C&&!g.size&&(w=C,_.forEach(([M])=>{const j=M[1](C);j>d&&(d=j)})),d),y=C=>(M,j)=>{const ce=[...M];ce[1]=[C,...ce[1]],m(ce,j)},_=new Map,b=(C,M)=>{if(g.size){const j=M[3](y(C));_.set(C,[M,j])}else _.set(C,[M])},S=C=>{var M;const j=_.get(C);j&&(_.delete(C),(M=j[1])==null||M.call(j))},x=C=>(g.add(C),g.size===1&&_.forEach(([j,ce],he)=>{const B=j[3](y(he));_.set(he,[j,B])}),()=>{g.delete(C),g.size===0&&_.forEach(([j,ce],he)=>{ce&&(ce(),_.set(he,[j]))})}),I=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),p=e(I,{deleteProperty(C,M){const j=Reflect.get(C,M);S(M);const ce=Reflect.deleteProperty(C,M);return ce&&m(["delete",[M],j]),ce},set(C,M,j,ce){const he=Reflect.has(C,M),B=Reflect.get(C,M,ce);if(he&&(t(B,j)||o.has(j)&&t(B,o.get(j))))return!0;S(M),bN(j)&&(j=R5e(j)||j);let U=j;if(j instanceof Promise)j.then(K=>{j.status="fulfilled",j.value=K,m(["resolve",[M],K])}).catch(K=>{j.status="rejected",j.reason=K,m(["reject",[M],K])});else{!_f.has(j)&&r(j)&&(U=c(j));const K=!EE.has(U)&&_f.get(U);K&&b(M,K)}return Reflect.set(C,M,U,ce),m(["set",[M],j,B]),!0}});o.set(u,p);const O=[I,v,a,x];return _f.set(p,O),Reflect.ownKeys(u).forEach(C=>{const M=Object.getOwnPropertyDescriptor(u,C);"value"in M&&(p[C]=u[C],delete M.value,delete M.writable),Object.defineProperty(I,C,M)}),p})=>[c,_f,EE,t,e,r,n,i,a,o,s],[N5e]=C5e();function Id(t={}){return N5e(t)}function Rp(t,e,r){const n=_f.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 D5e(t,e){const r=_f.get(t),[n,i,a]=r;return a(n,i(),e)}const Wi=Id({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),eoe={state:Wi,subscribe(t){return Rp(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}},Ma={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 Ma.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ma.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(Ma.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(!Ma.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(Ma.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(Ma.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Ma.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=eoe.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},$5e=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Ia=Id({enabled:$5e,userSessionId:"",events:[],connectedWalletId:void 0}),M5e={state:Ia,subscribe(t){return Rp(Ia.events,()=>t(D5e(Ia.events[Ia.events.length-1])))},initialize(){Ia.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Ia.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Ia.connectedWalletId=t},click(t){if(Ia.enabled){const e={type:"CLICK",name:t.name,userSessionId:Ia.userSessionId,timestamp:Date.now(),data:t};Ia.events.push(e)}},track(t){if(Ia.enabled){const e={type:"TRACK",name:t.name,userSessionId:Ia.userSessionId,timestamp:Date.now(),data:t};Ia.events.push(e)}},view(t){if(Ia.enabled){const e={type:"VIEW",name:t.name,userSessionId:Ia.userSessionId,timestamp:Date.now(),data:t};Ia.events.push(e)}}},Kc=Id({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Tc={state:Kc,subscribe(t){return Rp(Kc,()=>t(Kc))},setChains(t){Kc.chains=t},setWalletConnectUri(t){Kc.walletConnectUri=t},setIsCustomDesktop(t){Kc.isCustomDesktop=t},setIsCustomMobile(t){Kc.isCustomMobile=t},setIsDataLoaded(t){Kc.isDataLoaded=t},setIsUiLoaded(t){Kc.isUiLoaded=t},setIsAuth(t){Kc.isAuth=t}},xE=Id({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}),$y={state:xE,subscribe(t){return Rp(xE,()=>t(xE))},setConfig(t){var e,r;M5e.initialize(),Tc.setChains(t.chains),Tc.setIsAuth(!!t.enableAuthMode),Tc.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),Tc.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Ma.setModalVersionInStorage(),Object.assign(xE,t)}};var k5e=Object.defineProperty,qW=Object.getOwnPropertySymbols,L5e=Object.prototype.hasOwnProperty,U5e=Object.prototype.propertyIsEnumerable,HW=(t,e,r)=>e in t?k5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,B5e=(t,e)=>{for(var r in e||(e={}))L5e.call(e,r)&&HW(t,r,e[r]);if(qW)for(var r of qW(e))U5e.call(e,r)&&HW(t,r,e[r]);return t};const o5="https://explorer-api.walletconnect.com",s5="wcm",c5="js-2.6.2";async function AE(t,e){const r=B5e({sdkType:s5,sdkVersion:c5},e),n=new URL(t,o5);return n.searchParams.append("projectId",$y.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const eh={async getDesktopListings(t){return AE("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return AE("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return AE("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return AE("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${o5}/w3m/v1/getWalletImage/${t}?projectId=${$y.state.projectId}&sdkType=${s5}&sdkVersion=${c5}`},getAssetImageUrl(t){return`${o5}/w3m/v1/getAssetImage/${t}?projectId=${$y.state.projectId}&sdkType=${s5}&sdkVersion=${c5}`}};var F5e=Object.defineProperty,zW=Object.getOwnPropertySymbols,j5e=Object.prototype.hasOwnProperty,q5e=Object.prototype.propertyIsEnumerable,VW=(t,e,r)=>e in t?F5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H5e=(t,e)=>{for(var r in e||(e={}))j5e.call(e,r)&&VW(t,r,e[r]);if(zW)for(var r of zW(e))q5e.call(e,r)&&VW(t,r,e[r]);return t};const GW=Ma.isMobile(),Yc=Id({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),cKe={state:Yc,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=$y.state;if(t==="NONE"||e==="ALL"&&!t)return Yc.recomendedWallets;if(Ma.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await eh.getAllListings(r),i=Object.values(n);i.sort((a,o)=>{const s=t.indexOf(a.id),c=t.indexOf(o.id);return s-c}),Yc.recomendedWallets=i}else{const{chains:r,isAuth:n}=Tc.state,i=r==null?void 0:r.join(","),a=Ma.isArray(e),o={page:1,sdks:n?"auth_v1":void 0,entries:Ma.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:s}=GW?await eh.getMobileListings(o):await eh.getDesktopListings(o);Yc.recomendedWallets=Object.values(s)}return Yc.recomendedWallets},async getWallets(t){const e=H5e({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=$y.state,{recomendedWallets:i}=Yc;if(n==="ALL")return Yc.wallets;i.length?e.excludedIds=i.map(d=>d.id).join(","):Ma.isArray(r)&&(e.excludedIds=r.join(",")),Ma.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Tc.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:o}=t,{listings:s,total:c}=GW?await eh.getMobileListings(e):await eh.getDesktopListings(e),u=Object.values(s),f=o?"search":"wallets";return Yc[f]={listings:[...Yc[f].listings,...u],total:c,page:a??1},{listings:u,total:c}},getWalletImageUrl(t){return eh.getWalletImageUrl(t)},getAssetImageUrl(t){return eh.getAssetImageUrl(t)},resetSearch(){Yc.search={listings:[],total:0,page:1}}},v0=Id({open:!1}),wN={state:v0,subscribe(t){return Rp(v0,()=>t(v0))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Tc.state;if(Ma.removeWalletConnectDeepLink(),Tc.setWalletConnectUri(t==null?void 0:t.uri),Tc.setChains(t==null?void 0:t.chains),eoe.reset("ConnectWallet"),r&&n)v0.open=!0,e();else{const i=setInterval(()=>{const a=Tc.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),v0.open=!0,e())},200)}})},close(){v0.open=!1}};var z5e=Object.defineProperty,WW=Object.getOwnPropertySymbols,V5e=Object.prototype.hasOwnProperty,G5e=Object.prototype.propertyIsEnumerable,KW=(t,e,r)=>e in t?z5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W5e=(t,e)=>{for(var r in e||(e={}))V5e.call(e,r)&&KW(t,r,e[r]);if(WW)for(var r of WW(e))G5e.call(e,r)&&KW(t,r,e[r]);return t};function K5e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Ov=Id({themeMode:K5e()?"dark":"light"}),YW={state:Ov,subscribe(t){return Rp(Ov,()=>t(Ov))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Ov.themeMode=e),r&&(Ov.themeVariables=W5e({},r))}},th=Id({open:!1,message:"",variant:"success"}),uKe={state:th,subscribe(t){return Rp(th,()=>t(th))},openToast(t,e){th.open=!0,th.message=t,th.variant=e},closeToast(){th.open=!1}};let Y5e=class{constructor(e){this.openModal=wN.open,this.closeModal=wN.close,this.subscribeModal=wN.subscribe,this.setTheme=YW.setThemeConfig,YW.setThemeConfig(e),$y.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Dy(()=>import("./index-7117d32b.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Tc.setIsUiLoaded(!0)}}};const Q5e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Y5e},Symbol.toStringTag,{value:"Module"})),J5e=uo(Q5e);var Pk={},lI={},Lr={},toe={};(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}})(toe);Object.defineProperty(Lr,"__esModule",{value:!0});var roe=toe;function X5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Lr.readInt16BE=X5e;function Z5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Lr.readUint16BE=Z5e;function eDe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Lr.readInt16LE=eDe;function tDe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Lr.readUint16LE=tDe;function noe(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}Lr.writeUint16BE=noe;Lr.writeInt16BE=noe;function ioe(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}Lr.writeUint16LE=ioe;Lr.writeInt16LE=ioe;function u5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Lr.readInt32BE=u5;function l5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Lr.readUint32BE=l5;function f5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Lr.readInt32LE=f5;function d5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Lr.readUint32LE=d5;function KA(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}Lr.writeUint32BE=KA;Lr.writeInt32BE=KA;function YA(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}Lr.writeUint32LE=YA;Lr.writeInt32LE=YA;function rDe(t,e){e===void 0&&(e=0);var r=u5(t,e),n=u5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Lr.readInt64BE=rDe;function nDe(t,e){e===void 0&&(e=0);var r=l5(t,e),n=l5(t,e+4);return r*4294967296+n}Lr.readUint64BE=nDe;function iDe(t,e){e===void 0&&(e=0);var r=f5(t,e),n=f5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Lr.readInt64LE=iDe;function aDe(t,e){e===void 0&&(e=0);var r=d5(t,e),n=d5(t,e+4);return n*4294967296+r}Lr.readUint64LE=aDe;function aoe(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),KA(t/4294967296>>>0,e,r),KA(t>>>0,e,r+4),e}Lr.writeUint64BE=aoe;Lr.writeInt64BE=aoe;function ooe(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),YA(t>>>0,e,r),YA(t/4294967296>>>0,e,r+4),e}Lr.writeUint64LE=ooe;Lr.writeInt64LE=ooe;function oDe(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}Lr.readUintBE=oDe;function sDe(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}Lr.readUintLE=sDe;function cDe(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(!roe.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}Lr.writeUintBE=cDe;function uDe(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(!roe.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}Lr.writeUintLE=uDe;function lDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Lr.readFloat32BE=lDe;function fDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Lr.readFloat32LE=fDe;function dDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Lr.readFloat64BE=dDe;function hDe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Lr.readFloat64LE=hDe;function pDe(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}Lr.writeFloat32BE=pDe;function gDe(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}Lr.writeFloat32LE=gDe;function yDe(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}Lr.writeFloat64BE=yDe;function mDe(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}Lr.writeFloat64LE=mDe;var as={};Object.defineProperty(as,"__esModule",{value:!0});function vDe(t){for(var e=0;e<t.length;e++)t[e]=0;return t}as.wipe=vDe;Object.defineProperty(lI,"__esModule",{value:!0});var Oa=Lr,h5=as,bDe=20;function wDe(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,I=a,E=o,p=s,O=c,C=u,M=f,j=d,ce=g,he=m,B=w,U=v,K=y,ne=_,F=b,q=0;q<bDe;q+=2)S=S+p|0,U^=S,U=U>>>32-16|U<<16,j=j+U|0,p^=j,p=p>>>32-12|p<<12,x=x+O|0,K^=x,K=K>>>32-16|K<<16,ce=ce+K|0,O^=ce,O=O>>>32-12|O<<12,I=I+C|0,ne^=I,ne=ne>>>32-16|ne<<16,he=he+ne|0,C^=he,C=C>>>32-12|C<<12,E=E+M|0,F^=E,F=F>>>32-16|F<<16,B=B+F|0,M^=B,M=M>>>32-12|M<<12,I=I+C|0,ne^=I,ne=ne>>>32-8|ne<<8,he=he+ne|0,C^=he,C=C>>>32-7|C<<7,E=E+M|0,F^=E,F=F>>>32-8|F<<8,B=B+F|0,M^=B,M=M>>>32-7|M<<7,x=x+O|0,K^=x,K=K>>>32-8|K<<8,ce=ce+K|0,O^=ce,O=O>>>32-7|O<<7,S=S+p|0,U^=S,U=U>>>32-8|U<<8,j=j+U|0,p^=j,p=p>>>32-7|p<<7,S=S+O|0,F^=S,F=F>>>32-16|F<<16,he=he+F|0,O^=he,O=O>>>32-12|O<<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,I=I+M|0,K^=I,K=K>>>32-16|K<<16,j=j+K|0,M^=j,M=M>>>32-12|M<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,ce=ce+ne|0,p^=ce,p=p>>>32-12|p<<12,I=I+M|0,K^=I,K=K>>>32-8|K<<8,j=j+K|0,M^=j,M=M>>>32-7|M<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,ce=ce+ne|0,p^=ce,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+O|0,F^=S,F=F>>>32-8|F<<8,he=he+F|0,O^=he,O=O>>>32-7|O<<7;Oa.writeUint32LE(S+n|0,t,0),Oa.writeUint32LE(x+i|0,t,4),Oa.writeUint32LE(I+a|0,t,8),Oa.writeUint32LE(E+o|0,t,12),Oa.writeUint32LE(p+s|0,t,16),Oa.writeUint32LE(O+c|0,t,20),Oa.writeUint32LE(C+u|0,t,24),Oa.writeUint32LE(M+f|0,t,28),Oa.writeUint32LE(j+d|0,t,32),Oa.writeUint32LE(ce+g|0,t,36),Oa.writeUint32LE(he+m|0,t,40),Oa.writeUint32LE(B+w|0,t,44),Oa.writeUint32LE(U+v|0,t,48),Oa.writeUint32LE(K+y|0,t,52),Oa.writeUint32LE(ne+_|0,t,56),Oa.writeUint32LE(F+b|0,t,60)}function soe(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){wDe(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 h5.wipe(s),i===0&&h5.wipe(a),n}lI.streamXOR=soe;function _De(t,e,r,n){return n===void 0&&(n=0),h5.wipe(r),soe(t,e,r,r,n)}lI.stream=_De;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 coe={},Od={};Object.defineProperty(Od,"__esModule",{value:!0});function xDe(t,e,r){return~(t-1)&e|t-1&r}Od.select=xDe;function ADe(t,e){return(t|0)-(e|0)-1>>>31&1}Od.lessOrEqual=ADe;function uoe(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}Od.compare=uoe;function SDe(t,e){return t.length===0||e.length===0?!1:uoe(t,e)!==0}Od.equal=SDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Od,r=as;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],I=this._r[0],E=this._r[1],p=this._r[2],O=this._r[3],C=this._r[4],M=this._r[5],j=this._r[6],ce=this._r[7],he=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 q=s[c+8]|s[c+9]<<8;v+=(F>>>4|q<<12)&8191,y+=q>>>1&8191;var z=s[c+10]|s[c+11]<<8;_+=(q>>>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 L=0,k=L;k+=d*I,k+=g*(5*B),k+=m*(5*he),k+=w*(5*ce),k+=v*(5*j),L=k>>>13,k&=8191,k+=y*(5*M),k+=_*(5*C),k+=b*(5*O),k+=S*(5*p),k+=x*(5*E),L+=k>>>13,k&=8191;var G=L;G+=d*E,G+=g*I,G+=m*(5*B),G+=w*(5*he),G+=v*(5*ce),L=G>>>13,G&=8191,G+=y*(5*j),G+=_*(5*M),G+=b*(5*C),G+=S*(5*O),G+=x*(5*p),L+=G>>>13,G&=8191;var ge=L;ge+=d*p,ge+=g*E,ge+=m*I,ge+=w*(5*B),ge+=v*(5*he),L=ge>>>13,ge&=8191,ge+=y*(5*ce),ge+=_*(5*j),ge+=b*(5*M),ge+=S*(5*C),ge+=x*(5*O),L+=ge>>>13,ge&=8191;var Q=L;Q+=d*O,Q+=g*p,Q+=m*E,Q+=w*I,Q+=v*(5*B),L=Q>>>13,Q&=8191,Q+=y*(5*he),Q+=_*(5*ce),Q+=b*(5*j),Q+=S*(5*M),Q+=x*(5*C),L+=Q>>>13,Q&=8191;var te=L;te+=d*C,te+=g*O,te+=m*p,te+=w*E,te+=v*I,L=te>>>13,te&=8191,te+=y*(5*B),te+=_*(5*he),te+=b*(5*ce),te+=S*(5*j),te+=x*(5*M),L+=te>>>13,te&=8191;var ue=L;ue+=d*M,ue+=g*C,ue+=m*O,ue+=w*p,ue+=v*E,L=ue>>>13,ue&=8191,ue+=y*I,ue+=_*(5*B),ue+=b*(5*he),ue+=S*(5*ce),ue+=x*(5*j),L+=ue>>>13,ue&=8191;var T=L;T+=d*j,T+=g*M,T+=m*C,T+=w*O,T+=v*p,L=T>>>13,T&=8191,T+=y*E,T+=_*I,T+=b*(5*B),T+=S*(5*he),T+=x*(5*ce),L+=T>>>13,T&=8191;var fe=L;fe+=d*ce,fe+=g*j,fe+=m*M,fe+=w*C,fe+=v*O,L=fe>>>13,fe&=8191,fe+=y*p,fe+=_*E,fe+=b*I,fe+=S*(5*B),fe+=x*(5*he),L+=fe>>>13,fe&=8191;var Ge=L;Ge+=d*he,Ge+=g*ce,Ge+=m*j,Ge+=w*M,Ge+=v*C,L=Ge>>>13,Ge&=8191,Ge+=y*O,Ge+=_*p,Ge+=b*E,Ge+=S*I,Ge+=x*(5*B),L+=Ge>>>13,Ge&=8191;var tt=L;tt+=d*B,tt+=g*he,tt+=m*ce,tt+=w*j,tt+=v*M,L=tt>>>13,tt&=8191,tt+=y*C,tt+=_*O,tt+=b*p,tt+=S*E,tt+=x*I,L+=tt>>>13,tt&=8191,L=(L<<2)+L|0,L=L+k|0,k=L&8191,L=L>>>13,G+=L,d=k,g=G,m=ge,w=Q,v=te,y=ue,_=T,b=fe,S=Ge,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})(coe);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=lI,r=coe,n=as,i=Lr,a=Od;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})(Pk);var loe={},$w={},Tk={};Object.defineProperty(Tk,"__esModule",{value:!0});function IDe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}Tk.isSerializableHash=IDe;Object.defineProperty($w,"__esModule",{value:!0});var Qc=Tk,ODe=Od,PDe=as,foe=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),Qc.isSerializableHash(this._inner)&&Qc.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),PDe.wipe(n)}return t.prototype.reset=function(){if(!Qc.isSerializableHash(this._inner)||!Qc.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(){Qc.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Qc.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(!Qc.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(!Qc.isSerializableHash(this._inner)||!Qc.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(!Qc.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();$w.HMAC=foe;function TDe(t,e,r){var n=new foe(t,e);n.update(r);var i=n.digest();return n.clean(),i}$w.hmac=TDe;$w.equal=ODe.equal;Object.defineProperty(loe,"__esModule",{value:!0});var QW=$w,JW=as,RDe=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=QW.hmac(this._hash,n,r);this._hmac=new QW.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(),JW.wipe(this._buffer),JW.wipe(this._counter),this._bufpos=0},t}(),CDe=loe.HKDF=RDe,um={},fI={},dI={};Object.defineProperty(dI,"__esModule",{value:!0});dI.BrowserRandomSource=void 0;const XW=65536;class NDe{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+=XW)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,XW)));return r}}dI.BrowserRandomSource=NDe;function p5(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 hI={};Object.defineProperty(hI,"__esModule",{value:!0});hI.NodeRandomSource=void 0;const DDe=as;class $De{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof p5<"u"){const e=cM;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,DDe.wipe)(r),n}}hI.NodeRandomSource=$De;Object.defineProperty(fI,"__esModule",{value:!0});fI.SystemRandomSource=void 0;const MDe=dI,kDe=hI;class LDe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new MDe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new kDe.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)}}fI.SystemRandomSource=LDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=fI,r=Lr,n=as;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})(um);var pI={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Lr,r=as;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 I=f+x*4;s[x]=e.readUint32BE(u,I)}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 O=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;s[x]=(p+s[x-7]|0)+(O+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,O=((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+O|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})(pI);var Rk={};(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=um,r=as;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(x){const I=new Float64Array(16);if(x)for(let E=0;E<x.length;E++)I[E]=x[E];return I}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function o(x){let I=1;for(let E=0;E<16;E++){let p=x[E]+I+65535;I=Math.floor(p/65536),x[E]=p-I*65536}x[0]+=I-1+37*(I-1)}function s(x,I,E){const p=~(E-1);for(let O=0;O<16;O++){const C=p&(x[O]^I[O]);x[O]^=C,I[O]^=C}}function c(x,I){const E=n(),p=n();for(let O=0;O<16;O++)p[O]=I[O];o(p),o(p),o(p);for(let O=0;O<2;O++){E[0]=p[0]-65517;for(let M=1;M<15;M++)E[M]=p[M]-65535-(E[M-1]>>16&1),E[M-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 O=0;O<16;O++)x[2*O]=p[O]&255,x[2*O+1]=p[O]>>8}function u(x,I){for(let E=0;E<16;E++)x[E]=I[2*E]+(I[2*E+1]<<8);x[15]&=32767}function f(x,I,E){for(let p=0;p<16;p++)x[p]=I[p]+E[p]}function d(x,I,E){for(let p=0;p<16;p++)x[p]=I[p]-E[p]}function g(x,I,E){let p,O,C=0,M=0,j=0,ce=0,he=0,B=0,U=0,K=0,ne=0,F=0,q=0,z=0,$=0,H=0,L=0,k=0,G=0,ge=0,Q=0,te=0,ue=0,T=0,fe=0,Ge=0,tt=0,mt=0,vt=0,gt=0,Lt=0,Yt=0,_r=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],vr=E[15];p=I[0],C+=p*Rt,M+=p*Pt,j+=p*kt,ce+=p*Nt,he+=p*Kt,B+=p*Ut,U+=p*zt,K+=p*$t,ne+=p*Dt,F+=p*qt,q+=p*Mt,z+=p*cr,$+=p*tr,H+=p*ir,L+=p*nr,k+=p*vr,p=I[1],M+=p*Rt,j+=p*Pt,ce+=p*kt,he+=p*Nt,B+=p*Kt,U+=p*Ut,K+=p*zt,ne+=p*$t,F+=p*Dt,q+=p*qt,z+=p*Mt,$+=p*cr,H+=p*tr,L+=p*ir,k+=p*nr,G+=p*vr,p=I[2],j+=p*Rt,ce+=p*Pt,he+=p*kt,B+=p*Nt,U+=p*Kt,K+=p*Ut,ne+=p*zt,F+=p*$t,q+=p*Dt,z+=p*qt,$+=p*Mt,H+=p*cr,L+=p*tr,k+=p*ir,G+=p*nr,ge+=p*vr,p=I[3],ce+=p*Rt,he+=p*Pt,B+=p*kt,U+=p*Nt,K+=p*Kt,ne+=p*Ut,F+=p*zt,q+=p*$t,z+=p*Dt,$+=p*qt,H+=p*Mt,L+=p*cr,k+=p*tr,G+=p*ir,ge+=p*nr,Q+=p*vr,p=I[4],he+=p*Rt,B+=p*Pt,U+=p*kt,K+=p*Nt,ne+=p*Kt,F+=p*Ut,q+=p*zt,z+=p*$t,$+=p*Dt,H+=p*qt,L+=p*Mt,k+=p*cr,G+=p*tr,ge+=p*ir,Q+=p*nr,te+=p*vr,p=I[5],B+=p*Rt,U+=p*Pt,K+=p*kt,ne+=p*Nt,F+=p*Kt,q+=p*Ut,z+=p*zt,$+=p*$t,H+=p*Dt,L+=p*qt,k+=p*Mt,G+=p*cr,ge+=p*tr,Q+=p*ir,te+=p*nr,ue+=p*vr,p=I[6],U+=p*Rt,K+=p*Pt,ne+=p*kt,F+=p*Nt,q+=p*Kt,z+=p*Ut,$+=p*zt,H+=p*$t,L+=p*Dt,k+=p*qt,G+=p*Mt,ge+=p*cr,Q+=p*tr,te+=p*ir,ue+=p*nr,T+=p*vr,p=I[7],K+=p*Rt,ne+=p*Pt,F+=p*kt,q+=p*Nt,z+=p*Kt,$+=p*Ut,H+=p*zt,L+=p*$t,k+=p*Dt,G+=p*qt,ge+=p*Mt,Q+=p*cr,te+=p*tr,ue+=p*ir,T+=p*nr,fe+=p*vr,p=I[8],ne+=p*Rt,F+=p*Pt,q+=p*kt,z+=p*Nt,$+=p*Kt,H+=p*Ut,L+=p*zt,k+=p*$t,G+=p*Dt,ge+=p*qt,Q+=p*Mt,te+=p*cr,ue+=p*tr,T+=p*ir,fe+=p*nr,Ge+=p*vr,p=I[9],F+=p*Rt,q+=p*Pt,z+=p*kt,$+=p*Nt,H+=p*Kt,L+=p*Ut,k+=p*zt,G+=p*$t,ge+=p*Dt,Q+=p*qt,te+=p*Mt,ue+=p*cr,T+=p*tr,fe+=p*ir,Ge+=p*nr,tt+=p*vr,p=I[10],q+=p*Rt,z+=p*Pt,$+=p*kt,H+=p*Nt,L+=p*Kt,k+=p*Ut,G+=p*zt,ge+=p*$t,Q+=p*Dt,te+=p*qt,ue+=p*Mt,T+=p*cr,fe+=p*tr,Ge+=p*ir,tt+=p*nr,mt+=p*vr,p=I[11],z+=p*Rt,$+=p*Pt,H+=p*kt,L+=p*Nt,k+=p*Kt,G+=p*Ut,ge+=p*zt,Q+=p*$t,te+=p*Dt,ue+=p*qt,T+=p*Mt,fe+=p*cr,Ge+=p*tr,tt+=p*ir,mt+=p*nr,vt+=p*vr,p=I[12],$+=p*Rt,H+=p*Pt,L+=p*kt,k+=p*Nt,G+=p*Kt,ge+=p*Ut,Q+=p*zt,te+=p*$t,ue+=p*Dt,T+=p*qt,fe+=p*Mt,Ge+=p*cr,tt+=p*tr,mt+=p*ir,vt+=p*nr,gt+=p*vr,p=I[13],H+=p*Rt,L+=p*Pt,k+=p*kt,G+=p*Nt,ge+=p*Kt,Q+=p*Ut,te+=p*zt,ue+=p*$t,T+=p*Dt,fe+=p*qt,Ge+=p*Mt,tt+=p*cr,mt+=p*tr,vt+=p*ir,gt+=p*nr,Lt+=p*vr,p=I[14],L+=p*Rt,k+=p*Pt,G+=p*kt,ge+=p*Nt,Q+=p*Kt,te+=p*Ut,ue+=p*zt,T+=p*$t,fe+=p*Dt,Ge+=p*qt,tt+=p*Mt,mt+=p*cr,vt+=p*tr,gt+=p*ir,Lt+=p*nr,Yt+=p*vr,p=I[15],k+=p*Rt,G+=p*Pt,ge+=p*kt,Q+=p*Nt,te+=p*Kt,ue+=p*Ut,T+=p*zt,fe+=p*$t,Ge+=p*Dt,tt+=p*qt,mt+=p*Mt,vt+=p*cr,gt+=p*tr,Lt+=p*ir,Yt+=p*nr,_r+=p*vr,C+=38*G,M+=38*ge,j+=38*Q,ce+=38*te,he+=38*ue,B+=38*T,U+=38*fe,K+=38*Ge,ne+=38*tt,F+=38*mt,q+=38*vt,z+=38*gt,$+=38*Lt,H+=38*Yt,L+=38*_r,O=1,p=C+O+65535,O=Math.floor(p/65536),C=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=ce+O+65535,O=Math.floor(p/65536),ce=p-O*65536,p=he+O+65535,O=Math.floor(p/65536),he=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=K+O+65535,O=Math.floor(p/65536),K=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=z+O+65535,O=Math.floor(p/65536),z=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,C+=O-1+37*(O-1),O=1,p=C+O+65535,O=Math.floor(p/65536),C=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=ce+O+65535,O=Math.floor(p/65536),ce=p-O*65536,p=he+O+65535,O=Math.floor(p/65536),he=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=K+O+65535,O=Math.floor(p/65536),K=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=z+O+65535,O=Math.floor(p/65536),z=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,C+=O-1+37*(O-1),x[0]=C,x[1]=M,x[2]=j,x[3]=ce,x[4]=he,x[5]=B,x[6]=U,x[7]=K,x[8]=ne,x[9]=F,x[10]=q,x[11]=z,x[12]=$,x[13]=H,x[14]=L,x[15]=k}function m(x,I){g(x,I,I)}function w(x,I){const E=n();for(let p=0;p<16;p++)E[p]=I[p];for(let p=253;p>=0;p--)m(E,E),p!==2&&p!==4&&g(E,E,I);for(let p=0;p<16;p++)x[p]=E[p]}function v(x,I){const E=new Uint8Array(32),p=new Float64Array(80),O=n(),C=n(),M=n(),j=n(),ce=n(),he=n();for(let ne=0;ne<31;ne++)E[ne]=x[ne];E[31]=x[31]&127|64,E[0]&=248,u(p,I);for(let ne=0;ne<16;ne++)C[ne]=p[ne];O[0]=j[0]=1;for(let ne=254;ne>=0;--ne){const F=E[ne>>>3]>>>(ne&7)&1;s(O,C,F),s(M,j,F),f(ce,O,M),d(O,O,M),f(M,C,j),d(C,C,j),m(j,ce),m(he,O),g(O,M,O),g(M,C,ce),f(ce,O,M),d(O,O,M),m(C,O),d(M,j,he),g(O,M,a),f(O,O,j),g(M,M,O),g(O,j,he),g(j,C,p),m(C,ce),s(O,C,F),s(M,j,F)}for(let ne=0;ne<16;ne++)p[ne+16]=O[ne],p[ne+32]=M[ne],p[ne+48]=C[ne],p[ne+64]=j[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 I=new Uint8Array(x);return{publicKey:y(I),secretKey:I}}t.generateKeyPairFromSeed=_;function b(x){const I=(0,e.randomBytes)(32,x),E=_(I);return(0,r.wipe)(I),E}t.generateKeyPair=b;function S(x,I,E=!1){if(x.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(x,I);if(E){let O=0;for(let C=0;C<p.length;C++)O|=p[C];if(O===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=S})(Rk);function Ck(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function doe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ck(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function g5(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=doe(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return Ck(r)}function UDe(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 I=w[_],E=0,p=S-1;(I!==0||E<y)&&p!==-1;p--,E++)I+=256*x[p]>>>0,x[p]=I%s>>>0,I=I/s>>>0;if(I!==0)throw new Error("Non-zero carry");y=E,_++}for(var O=S-y;O!==S&&x[O]===0;)O++;for(var C=c.repeat(v);O<S;++O)C+=t.charAt(x[O]);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 I=0,E=b-1;(x!==0||I<_)&&E!==-1;E--,I++)x+=s*S[E]>>>0,S[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");_=I,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var O=new Uint8Array(y+(b-p)),C=y;p!==b;)O[C++]=S[p++];return O}}}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 BDe=UDe,FDe=BDe;const jDe=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")},qDe=t=>new TextEncoder().encode(t),HDe=t=>new TextDecoder().decode(t);class zDe{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 VDe{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 hoe(this,e)}}class GDe{constructor(e){this.decoders=e}or(e){return hoe(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 hoe=(t,e)=>new GDe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class WDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new zDe(e,r,n),this.decoder=new VDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const gI=({name:t,prefix:e,encode:r,decode:n})=>new WDe(t,e,r,n),Mw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=FDe(r,e);return gI({prefix:t,name:e,encode:n,decode:a=>jDe(i(a))})},KDe=(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},YDe=(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})=>gI({prefix:e,name:t,encode(i){return YDe(i,n,r)},decode(i){return KDe(i,n,r,t)}}),QDe=gI({prefix:"\0",name:"identity",encode:t=>HDe(t),decode:t=>qDe(t)}),JDe=Object.freeze(Object.defineProperty({__proto__:null,identity:QDe},Symbol.toStringTag,{value:"Module"})),XDe=ba({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ZDe=Object.freeze(Object.defineProperty({__proto__:null,base2:XDe},Symbol.toStringTag,{value:"Module"})),e$e=ba({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),t$e=Object.freeze(Object.defineProperty({__proto__:null,base8:e$e},Symbol.toStringTag,{value:"Module"})),r$e=Mw({prefix:"9",name:"base10",alphabet:"0123456789"}),n$e=Object.freeze(Object.defineProperty({__proto__:null,base10:r$e},Symbol.toStringTag,{value:"Module"})),i$e=ba({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),a$e=ba({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),o$e=Object.freeze(Object.defineProperty({__proto__:null,base16:i$e,base16upper:a$e},Symbol.toStringTag,{value:"Module"})),s$e=ba({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),c$e=ba({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),u$e=ba({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),l$e=ba({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),f$e=ba({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),d$e=ba({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),h$e=ba({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),p$e=ba({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),g$e=ba({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),y$e=Object.freeze(Object.defineProperty({__proto__:null,base32:s$e,base32hex:f$e,base32hexpad:h$e,base32hexpadupper:p$e,base32hexupper:d$e,base32pad:u$e,base32padupper:l$e,base32upper:c$e,base32z:g$e},Symbol.toStringTag,{value:"Module"})),m$e=Mw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),v$e=Mw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),b$e=Object.freeze(Object.defineProperty({__proto__:null,base36:m$e,base36upper:v$e},Symbol.toStringTag,{value:"Module"})),w$e=Mw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),_$e=Mw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),E$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:w$e,base58flickr:_$e},Symbol.toStringTag,{value:"Module"})),x$e=ba({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),A$e=ba({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),S$e=ba({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),I$e=ba({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),O$e=Object.freeze(Object.defineProperty({__proto__:null,base64:x$e,base64pad:A$e,base64url:S$e,base64urlpad:I$e},Symbol.toStringTag,{value:"Module"})),poe=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),P$e=poe.reduce((t,e,r)=>(t[r]=e,t),[]),T$e=poe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function R$e(t){return t.reduce((e,r)=>(e+=P$e[r],e),"")}function C$e(t){const e=[];for(const r of t){const n=T$e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const N$e=gI({prefix:"🚀",name:"base256emoji",encode:R$e,decode:C$e}),D$e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:N$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const ZW={...JDe,...ZDe,...t$e,...n$e,...o$e,...y$e,...b$e,...E$e,...O$e,...D$e};function goe(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const eK=goe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),_N=goe("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=doe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),yoe={utf8:eK,"utf-8":eK,hex:ZW.base16,latin1:_N,ascii:_N,binary:_N,...ZW};function Co(t,e="utf8"){const r=yoe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ck(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function co(t,e="utf8"){const r=yoe[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 tK=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))},$$e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),M$e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=za.platform}return t}(),k$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}(),L$e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),U$e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),B$e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,F$e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,rK=3,j$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",B$e]],nK=[["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 q$e(t){return t?iK(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new U$e:typeof navigator<"u"?iK(navigator.userAgent):V$e()}function H$e(t){return t!==""&&j$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 iK(t){var e=H$e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new L$e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<rK&&(i=tK(tK([],i,!0),G$e(rK-i.length),!0)):i=[];var a=i.join("."),o=z$e(t),s=F$e.exec(t);return s&&s[1]?new k$e(r,a,o,s[1]):new $$e(r,a,o)}function z$e(t){for(var e=0,r=nK.length;e<r;e++){var n=nK[e],i=n[0],a=n[1],o=a.exec(t);if(o)return i}return null}function V$e(){var t=typeof za<"u"&&za.version;return t?new M$e(za.version.slice(1)):null}function G$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 Rd(Td.IncompatibleExtensions,e)}function fje(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 Rd(Td.InvalidArgument,`Invalid ${e(t.argument)} argument given to \`${t.procedure}\`.
169
169
  Expected: \`${t.expected}\`
170
- Received: \`${t.received}\``)}function dje(){return new Hw(hm.DuplicateIframe,"Duplicate iframes found.")}function hje(){return new Hw(hm.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 pje(){return new Hw(hm.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 _g(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 Hw(hm.DeprecationNotice,o)}function*gje(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var yje=gje();function $se(){return yje.next().value}var Mse=Symbol("Payload pre-processed by Magic SDK");function kse(t){return Object.defineProperty(t,Mse,{value:!0,enumerable:!1}),t}function mje(t){return!!t[Mse]}function a2(t){var e,r,n;return mje(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=$se(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],kse(t)),t}function an(t,e=[]){return kse({params:e,method:t,jsonrpc:"2.0",id:$se()})}var Qk=class{constructor(t){t instanceof Qk?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):nje(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}}},vje=fFe(dFe()),bje=class extends vje.default{};function Lse(){let t=new bje;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var Use=Symbol("isPromiEvent");function Bse(t){return!!t[Use]}function Jk(t){let e=Fse(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=Lse(),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,{[Use]:!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 Fse(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var Mp=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(M1.MAGIC_HANDLE_REQUEST,a2(t)),r=Jk((i,a)=>{e.then(o=>{if(n(),o.hasError)a(new L1(o.payload.error));else if(o.hasResult)i(o.payload.result);else throw cje()}).catch(o=>{n(),a(o)})}),n=this.overlay.on(Oh.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(br.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}};function wje(t,e){let[r]=t.split(".").map(Number);return r>=e}var Eg={"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"},_je=class extends Mp{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&&wje(zn.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");e&&_g({method:"auth.loginWithMagicLink()",removalVersions:Eg,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:i,overrides:a}=t,o=an(this.sdk.testMode?br.LoginWithMagicLinkTestMode:br.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:i,overrides:a}]);return this.request(o)}loginWithSMS(t){let{phoneNumber:e}=t,r=an(this.sdk.testMode?br.LoginWithSmsTestMode:br.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?br.LoginWithEmailOTPTestMode:br.LoginWithEmailOTP,[{email:e,showUI:r,deviceCheckUI:n,overrides:i}]),o=this.request(a);return!n&&o&&o.on(n2.Retry,()=>{this.createIntermediaryEvent(n2.Retry,a.id)()}),!r&&o&&(o.on(K0.VerifyEmailOtp,s=>{this.createIntermediaryEvent(K0.VerifyEmailOtp,a.id)(s)}),o.on(K0.Cancel,()=>{this.createIntermediaryEvent(K0.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?br.LoginWithCredentialTestMode:br.LoginWithCredential,[e]);return this.request(r)}setAuthorizationToken(t){let e=an(br.SetAuthorizationToken,[{jwt:t}]);return this.request(e)}updateEmailWithUI(t){let{email:e,showUI:r=!0}=t,n=an(this.sdk.testMode?br.UpdateEmailTestMode:br.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}},jse={};uFe(jse,{clear:()=>Eje,getItem:()=>$o,iterate:()=>qse,key:()=>Aje,keys:()=>Sje,length:()=>xje,removeItem:()=>AI,setItem:()=>Rl});var NE;function Cd(t){return(...e)=>Ci(this,null,function*(){return NE||(NE=yield zn.configureStorage()),yield NE.ready(),NE[t](...e)})}var $o=Cd("getItem"),Rl=Cd("setItem"),AI=Cd("removeItem"),Eje=Cd("clear"),xje=Cd("length"),Aje=Cd("key"),Sje=Cd("keys"),qse=Cd("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 Hse="STORE_KEY_PRIVATE_KEY",R5="STORE_KEY_PUBLIC_JWK",zse="ECDSA",Oje="P-256",Pje={name:zse,namedCurve:Oje};function SI(){let t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function Tje(){return Ci(this,null,function*(){let t=yield Rje();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield $o(Hse);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:zY(JSON.stringify(i)),claims:zY(JSON.stringify(n))},o=Nje(`${a.protected}.${a.claims}`),s={name:zse,hash:{name:"SHA-256"}},c=$je(new Uint8Array(yield e.sign(s,r,o)));return`${a.protected}.${a.claims}.${c}`})}function Rje(){return Ci(this,null,function*(){if(!SI()){console.info("webcrypto is not supported");return}return(yield $o(R5))||(yield Cje()),$o(R5)})}function Cje(){return Ci(this,null,function*(){let{subtle:t}=window.crypto,e=yield t.generateKey(Pje,!1,["sign"]),r=yield t.exportKey("jwk",e.publicKey);yield Rl(Hse,e.privateKey),yield Rl(R5,r)})}function zY(t){return Vse(Dje(t))}function Nje(t){return new TextEncoder().encode(t)}function Vse(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function Dje(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function $je(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),Vse(e)}var Xk="ds",Zk="ek",eL="iv",tL="AES-GCM",Mje=256;function rL(){return Ci(this,null,function*(){let t=[];yield qse((e,r,n)=>{r.startsWith(`${Xk}_`)&&t.push(r)});for(let e of t)yield AI(e)})}function Gse(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 Wse(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 kje(){return Ci(this,null,function*(){if(!SI()){console.info("webcrypto is not supported");return}let{crypto:t}=window;return(yield $o(eL))||t.getRandomValues(new Uint8Array(12))})}function Lje(){return Ci(this,null,function*(){if(!SI()){console.info("webcrypto is not supported");return}let{subtle:t}=window.crypto;return(yield $o(Zk))||(yield t.generateKey({name:tL,length:Mje},!1,["encrypt","decrypt"]))})}function Uje(t,e){return Ci(this,null,function*(){let r=yield kje(),n=yield Lje();if(!r||!n||!t)return;let i=Wse(t),{subtle:a}=window.crypto,o=yield a.encrypt({name:tL,iv:r},n,i),s=Gse(o);yield Rl(`${Xk}_${e}`,s),yield Rl(Zk,n),yield Rl(eL,r)})}function Bje(t){return Ci(this,null,function*(){let e=yield $o(`${Xk}_${t}`),r=yield $o(eL),n=yield $o(Zk);if(!r||!e||!n||!SI())return;let{subtle:i}=window.crypto,a=yield i.decrypt({name:tL,iv:r},n,Wse(e));return Gse(a)})}var Fje=class extends Mp{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(e){let r=an(this.sdk.testMode?br.GetIdTokenTestMode:br.GetIdToken,[e]);return this.request(r)}generateIdToken(e){let r=an(this.sdk.testMode?br.GenerateIdTokenTestMode:br.GenerateIdToken,[e]);return this.request(r)}getInfo(){return Ci(this,null,function*(){let e=yield $o(this.localForageKey),r=an(br.GetInfo,[{walletType:e}]);return this.request(r)})}isLoggedIn(){let e=an(this.sdk.testMode?br.IsLoggedInTestMode:br.IsLoggedIn);return this.request(e)}logout(){AI(this.localForageKey),rL();let e=an(this.sdk.testMode?br.LogoutTestMode:br.Logout);return this.request(e)}requestInfoWithUI(e){let r=an(br.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}showSettings(e){let r=an(this.sdk.testMode?br.UserSettingsTestMode:br.UserSettings,[e]);return this.request(r)}recoverAccount(e){let r=an(this.sdk.testMode?br.RecoverAccountTestMode:br.RecoverAccount,[e]);return this.request(r)}getMetadata(){_g({method:"user.getMetadata()",removalVersions:Eg,useInstead:"user.getInfo()"}).log();let e=an(this.sdk.testMode?br.GetMetadataTestMode:br.GetMetadata);return this.request(e)}updateEmail(e){_g({method:"user.updateEmail()",removalVersions:Eg,useInstead:"auth.updateEmailWithUI()"}).log();let{email:r,showUI:n=!0}=e,i=an(this.sdk.testMode?br.UpdateEmailTestMode:br.UpdateEmail,[{email:r,showUI:n}]);return this.request(i)}};function o2(t,e){return e?new URL(t,e):new URL(t)}var jje=class extends Mp{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(Es.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(Es.MetaMask);r(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(Es.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(Es.CoinbaseWallet);r(c);return}let i=this.getUserEnv(),a=an(br.Login,[i]),o=this.request(a);o.on(Qb.WalletSelected,c=>this.handleWalletSelected(Tse(Wk({},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(br.ShowUI))}showAddress(){return this.request(an(br.ShowAddress))}showSendTokensUI(){return this.request(an(br.ShowSendTokensUI))}showOnRamp(){return this.request(an(br.ShowOnRamp))}showNFTs(){return this.request(an(br.ShowNFTs))}showBalances(){return this.request(an(br.ShowBalances))}sendGaslessTransaction(e,r){return this.request(an(br.SendGaslessTransaction,[e,r]))}getInfo(){return Ci(this,null,function*(){_g({method:"wallet.getInfo()",removalVersions:Eg,useInstead:"user.getInfo()"}).log();let e=yield $o(this.localForageKey),r=an(br.GetInfo,[{walletType:e}]);return this.request(r)})}disconnect(){_g({method:"wallet.disconnect()",removalVersions:Eg,useInstead:"user.logout()"}).log(),AI(this.localForageKey),rL();let e=an(br.Disconnect);return this.request(e)}requestUserInfoWithUI(e){_g({method:"wallet.requestUserInfoWithUI()",removalVersions:Eg,useInstead:"user.requestUserInfoWithUI()"}).log();let r=an(br.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}getProvider(){return Ci(this,null,function*(){switch(yield $o(this.localForageKey)){case Es.MetaMask:return this.getMetaMaskProvider();case Es.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 Es.MetaMask:return this.connectToMetaMask();case Es.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 Rl(this.localForageKey,e.wallet),this.createIntermediaryEvent(Qb.WalletConnected,e.payloadId)(r)}catch(r){console.error(r),this.createIntermediaryEvent(Qb.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return Ci(this,null,function*(){let r;e===Es.MetaMask&&(r=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===Es.CoinbaseWallet&&(r=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield Rl(this.localForageKey,e);let n=an(br.AutoConnect,[{wallet:e,address:r}]);return this.request(n)})}},{createBoundEmitterMethod:DE,createChainingEmitterMethod:w0}=Lse(),qje=class extends Mp{constructor(){super(...arguments),this.isMagic=!0,this.on=w0("on",this),this.once=w0("once",this),this.addListener=w0("addListener",this),this.off=w0("off",this),this.removeListener=w0("removeListener",this),this.removeAllListeners=w0("removeAllListeners",this),this.emit=DE("emit"),this.eventNames=DE("eventNames"),this.listeners=DE("listeners"),this.listenerCount=DE("listenerCount")}sendAsync(t,e){if(!e)throw fje({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(M1.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=a2(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>Tse(Wk({},n.payload),{error:n.hasError?new L1(n.payload.error):null})))});else{let r=a2(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(M1.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new L1(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=hje();return r.log(),new Qk(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=an(br.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}`)}},VY=["request","overlay","sdk"];function Hje(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==Mp.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var Kse=class extends Mp{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Jk,isPromiEvent:Bse,encodeJSON:Cse,decodeJSON:tje,createJsonRpcRequestPayload:an,standardizeJsonRpcRequestPayload:a2,storage:jse};let t=[this,...Hje(this)];VY.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 uje(e)}}))})}init(t){this.__is_initialized__||(VY.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 T5(this,"DEPRECATION_NOTICE",a)}createWarning(t,e){return new T5(this,t,e)}createError(t,e,r){return new Yk(this,t,e,r)}},zje=class extends Kse{},tp=class extends Kse{};tp.Internal=zje,tp.Anonymous="anonymous extension";var Vje=class extends Mp{purchase(t){let e=an(br.NFTPurchase,[t]);return this.request(e)}checkout(t){let e=an(br.NFTCheckout,[t]);return this.request(e)}transfer(t){let e=an(br.NFTTransfer,[t]);return this.request(e)}};function GY(t){return t.compat&&t.compat[zn.sdkName]!=null?typeof t.compat[zn.sdkName]=="string"?GFe(QFe(zn.version),t.compat[zn.sdkName]):!!t.compat[zn.sdkName]:!0}function Gje(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 Wje(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(a=>{GY(a)?(a.init(this),(a.name||a.name!==tp.Anonymous)&&(this[a.name]=a),a instanceof tp.Internal&&(i2(a.config)||(n[a.name]=a.config))):i.push(a)}):Object.keys(r).forEach(a=>{if(GY(r[a])){r[a].init(this);let o=r[a];this[a]=o,o instanceof tp.Internal&&(i2(o.config)||(n[r[a].name]=o.config))}else i.push(r[a])}),i.length)throw lje(i);return n}var kx=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw sje();zn.platform==="react-native"&&(e!=null&&e.endpoint)&&pje().log();let{defaultEndpoint:n,version:i}=zn;this.testMode=!!(e!=null&&e.testMode),this.endpoint=o2((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.auth=new _je(this),this.user=new Fje(this),this.wallet=new jje(this),this.nft=new Vje(this),this.rpcProvider=new qje(this);let a=Wje.call(this,e);this.parameters=Cse(Wk({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:o2(this.endpoint).host,sdk:oje[zn.sdkName],version:i,ext:i2(a)?void 0:a,locale:(e==null?void 0:e.locale)||"en_US"},zn.bundleId?{bundleId:zn.bundleId}:{})),this.networkHash=Gje(this.apiKey,e==null?void 0:e.network,i2(a)?void 0:a),e!=null&&e.deferPreload||this.preload()}get overlay(){if(!kx.__overlays__.has(this.parameters)){let t=new zn.ViewController(this.endpoint,this.parameters,this.networkHash);t.init(),kx.__overlays__.set(this.parameters,t)}return kx.__overlays__.get(this.parameters)}preload(){return Ci(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Yse=kx;Yse.__overlays__=new Map;function Kje(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function Yje(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=Kje(t,n);if(n&&i){let a=new Qk(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:a}}return{}}function Qje(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 Tje()}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 Bje(r);return s&&(o.deviceShare=s),o})}function Jje(t){return Ci(this,null,function*(){!t.data.rt||(yield Rl("rt",t.data.rt))})}var Xje=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 Fse((r,n)=>Ci(this,null,function*(){if(!this.isConnectedToInternet){let u=Dse();n(u)}this.isReadyForRequest||(yield this.waitForReady());let i=[],a=Array.isArray(e)?e.map(u=>u.id):[],o=yield Qje(`${t}-${this.parameters}`,e,this.networkHash);yield this._post(o);let s=u=>f=>{var d;let{id:g,response:m}=Yje(e,f);if(Jje(f),((d=m==null?void 0:m.payload.error)==null?void 0:d.message)==="User denied account access.")rL();else if(f.data.deviceShare){let{deviceShare:w}=f.data;Uje(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(Oh.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(Oh.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,t(),e()})})}listen(){this.on(Oh.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Oh.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Zje=Object.create,Qse=Object.defineProperty,eqe=Object.getOwnPropertyDescriptor,tqe=Object.getOwnPropertyNames,rqe=Object.getPrototypeOf,nqe=Object.prototype.hasOwnProperty,$E=(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')}),Jse=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),iqe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tqe(e))!nqe.call(t,i)&&i!==r&&Qse(t,i,{get:()=>e[i],enumerable:!(n=eqe(e,i))||n.enumerable});return t},Xse=(t,e,r)=>(r=t!=null?Zje(rqe(t)):{},iqe(e||!t||!t.__esModule?Qse(r,"default",{value:t,enumerable:!0}):r,t)),Lx=(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())}),aqe=Jse((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 $E=="function"&&$E;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 $E=="function"&&$E,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(I){if(typeof I!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,I!==o&&v(this,I)}d.prototype.catch=function(I){return this.then(null,I)},d.prototype.then=function(I,E){if(typeof I!="function"&&this.state===u||typeof E!="function"&&this.state===c)return this;var p=new this.constructor(o);if(this.state!==f){var O=this.state===u?I:E;m(p,O,this.outcome)}else this.queue.push(new g(p,I,E));return p};function g(I,E,p){this.promise=I,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof p=="function"&&(this.onRejected=p,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(I){s.resolve(this.promise,I)},g.prototype.otherCallFulfilled=function(I){m(this.promise,this.onFulfilled,I)},g.prototype.callRejected=function(I){s.reject(this.promise,I)},g.prototype.otherCallRejected=function(I){m(this.promise,this.onRejected,I)};function m(I,E,p){a(function(){var O;try{O=E(p)}catch(C){return s.reject(I,C)}O===I?s.reject(I,new TypeError("Cannot resolve promise with itself")):s.resolve(I,O)})}s.resolve=function(I,E){var p=y(w,E);if(p.status==="error")return s.reject(I,p.value);var O=p.value;if(O)v(I,O);else{I.state=u,I.outcome=E;for(var C=-1,M=I.queue.length;++C<M;)I.queue[C].callFulfilled(E)}return I},s.reject=function(I,E){I.state=c,I.outcome=E;for(var p=-1,O=I.queue.length;++p<O;)I.queue[p].callRejected(E);return I};function w(I){var E=I&&I.then;if(I&&(typeof I=="object"||typeof I=="function")&&typeof E=="function")return function(){E.apply(I,arguments)}}function v(I,E){var p=!1;function O(ce){p||(p=!0,s.reject(I,ce))}function C(ce){p||(p=!0,s.resolve(I,ce))}function M(){E(C,O)}var j=y(M);j.status==="error"&&O(j.value)}function y(I,E){var p={};try{p.value=I(E),p.status="success"}catch(O){p.status="error",p.value=O}return p}d.resolve=_;function _(I){return I instanceof this?I:s.resolve(new this(o),I)}d.reject=b;function b(I){var E=new this(o);return s.reject(E,I)}d.all=S;function S(I){var E=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=I.length,O=!1;if(!p)return this.resolve([]);for(var C=new Array(p),M=0,j=-1,ce=new this(o);++j<p;)he(I[j],j);return ce;function he(B,U){E.resolve(B).then(K,function(ne){O||(O=!0,s.reject(ce,ne))});function K(ne){C[U]=ne,++M===p&&!O&&(O=!0,s.resolve(ce,C))}}}d.race=x;function x(I){var E=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=I.length,O=!1;if(!p)return this.resolve([]);for(var C=-1,M=new this(o);++C<p;)j(I[C]);return M;function j(ce){E.resolve(ce).then(function(he){O||(O=!0,s.resolve(M,he))},function(he){O||(O=!0,s.reject(M,he))})}}},{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(Ie){if(Ie.name!=="TypeError")throw Ie;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",I="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,I),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+)/),Ie=navigator.userAgent.match(/Edge\//);me(Ie||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function O(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 M(X){var me=b[X.name],re=me.deferredOperations.pop();if(re)return re.resolve(),re.promise}function j(X,me){var re=b[X.name],Ee=re.deferredOperations.pop();if(Ee)return Ee.reject(me),Ee.promise}function ce(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 Ie=c.open.apply(c,be);me&&(Ie.onupgradeneeded=function(Je){var ft=Ie.result;try{ft.createObjectStore(X.storeName),Je.oldVersion<=1&&ft.createObjectStore(y)}catch(Qe){if(Qe.name==="ConstraintError")console.warn('The database "'+X.name+'" has been upgraded from version '+Je.oldVersion+" to version "+Je.newVersion+', but the storage "'+X.storeName+'" already exists.');else throw Qe}}),Ie.onerror=function(Je){Je.preventDefault(),Ee(Ie.error)},Ie.onsuccess=function(){var Je=Ie.result;Je.onversionchange=function(ft){ft.target.close()},re(Je),M(X)}})}function he(X){return ce(X,!1)}function B(X){return ce(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 Ie=X.db.version+1;Ie>X.version&&(X.version=Ie)}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 Ie=btoa(be.target.result||"");me({__local_forage_encoded_blob:!0,data:Ie,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 q(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,he(X).then(function(Ie){return X.db=Ie,U(X)?B(X):Ie}).then(function(Ie){X.db=me.db=Ie;for(var Je=0;Je<re.length;Je++)re[Je]._dbInfo.db=Ie}).catch(function(Ie){throw j(X,Ie),Ie})}function $(X,me,re,Ee){Ee===void 0&&(Ee=1);try{var be=X.db.transaction(X.storeName,me);re(null,be)}catch(Ie){if(Ee>0&&(!X.db||Ie.name==="InvalidStateError"||Ie.name==="NotFoundError"))return d.resolve().then(function(){if(!X.db||Ie.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(Ie)}}function H(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(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=q);var Ie=[];function Je(){return d.resolve()}for(var ft=0;ft<be.forages.length;ft++){var Qe=be.forages[ft];Qe!==me&&Ie.push(Qe._initReady().catch(Je))}var We=be.forages.slice(0);return d.all(Ie).then(function(){return re.db=be.db,he(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<We.length;Vt++){var Rr=We[Vt];Rr!==me&&(Rr._dbInfo.db=re.db,Rr._dbInfo.version=re.version)}})}function k(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=Qe.get(X);We.onsuccess=function(){var ht=We.result;ht===void 0&&(ht=null),F(ht)&&(ht=ne(ht)),be(ht)},We.onerror=function(){Ie(We.error)}}catch(ht){Ie(ht)}})}).catch(Ie)});return g(Ee,me),Ee}function G(X,me){var re=this,Ee=new d(function(be,Ie){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=Qe.openCursor(),ht=1;We.onsuccess=function(){var Vt=We.result;if(Vt){var Rr=Vt.value;F(Rr)&&(Rr=ne(Rr));var Wr=X(Rr,Vt.key,ht++);Wr!==void 0?be(Wr):Vt.continue()}else be()},We.onerror=function(){Ie(We.error)}}catch(Vt){Ie(Vt)}})}).catch(Ie)});return g(Ee,me),Ee}function ge(X,me,re){var Ee=this;X=w(X);var be=new d(function(Ie,Je){var ft;Ee.ready().then(function(){return ft=Ee._dbInfo,S.call(me)==="[object Blob]"?O(ft.db).then(function(Qe){return Qe?me:K(me)}):me}).then(function(Qe){$(Ee._dbInfo,I,function(We,ht){if(We)return Je(We);try{var Vt=ht.objectStore(Ee._dbInfo.storeName);Qe===null&&(Qe=void 0);var Rr=Vt.put(Qe,X);ht.oncomplete=function(){Qe===void 0&&(Qe=null),Ie(Qe)},ht.onabort=ht.onerror=function(){var Wr=Rr.error?Rr.error:Rr.transaction.error;Je(Wr)}}catch(Wr){Je(Wr)}})}).catch(Je)});return g(be,re),be}function Q(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){$(re._dbInfo,I,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=Qe.delete(X);ft.oncomplete=function(){be()},ft.onerror=function(){Ie(We.error)},ft.onabort=function(){var ht=We.error?We.error:We.transaction.error;Ie(ht)}}catch(ht){Ie(ht)}})}).catch(Ie)});return g(Ee,me),Ee}function te(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,I,function(Ie,Je){if(Ie)return be(Ie);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.clear();Je.oncomplete=function(){Ee()},Je.onabort=Je.onerror=function(){var We=Qe.error?Qe.error:Qe.transaction.error;be(We)}}catch(We){be(We)}})}).catch(be)});return g(re,X),re}function ue(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Ie,Je){if(Ie)return be(Ie);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.count();Qe.onsuccess=function(){Ee(Qe.result)},Qe.onerror=function(){be(Qe.error)}}catch(We){be(We)}})}).catch(be)});return g(re,X),re}function T(X,me){var re=this,Ee=new d(function(be,Ie){if(X<0){be(null);return}re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=!1,ht=Qe.openKeyCursor();ht.onsuccess=function(){var Vt=ht.result;if(!Vt){be(null);return}X===0||We?be(Vt.key):(We=!0,Vt.advance(X))},ht.onerror=function(){Ie(ht.error)}}catch(Vt){Ie(Vt)}})}).catch(Ie)});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(Ie,Je){if(Ie)return be(Ie);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.openKeyCursor(),We=[];Qe.onsuccess=function(){var ht=Qe.result;if(!ht){Ee(We);return}We.push(ht.key),ht.continue()},Qe.onerror=function(){be(Qe.error)}}catch(ht){be(ht)}})}).catch(be)});return g(re,X),re}function Ge(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 Ie=X.name===re.name&&Ee._dbInfo.db,Je=Ie?d.resolve(Ee._dbInfo.db):he(X).then(function(ft){var Qe=b[X.name],We=Qe.forages;Qe.db=ft;for(var ht=0;ht<We.length;ht++)We[ht]._dbInfo.db=ft;return ft});X.storeName?be=Je.then(function(ft){if(ft.objectStoreNames.contains(X.storeName)){var Qe=ft.version+1;C(X);var We=b[X.name],ht=We.forages;ft.close();for(var Vt=0;Vt<ht.length;Vt++){var Rr=ht[Vt];Rr._dbInfo.db=null,Rr._dbInfo.version=Qe}var Wr=new d(function(jr,_n){var qr=c.open(X.name,Qe);qr.onerror=function(P){var D=qr.result;D.close(),_n(P)},qr.onupgradeneeded=function(){var P=qr.result;P.deleteObjectStore(X.storeName)},qr.onsuccess=function(){var P=qr.result;P.close(),jr(P)}});return Wr.then(function(jr){We.db=jr;for(var _n=0;_n<ht.length;_n++){var qr=ht[_n];qr._dbInfo.db=jr,M(qr._dbInfo)}}).catch(function(jr){throw(j(X,jr)||d.resolve()).catch(function(){}),jr})}}):be=Je.then(function(ft){C(X);var Qe=b[X.name],We=Qe.forages;ft.close();for(var ht=0;ht<We.length;ht++){var Vt=We[ht];Vt._dbInfo.db=null}var Rr=new d(function(Wr,jr){var _n=c.deleteDatabase(X.name);_n.onerror=function(){var qr=_n.result;qr&&qr.close(),jr(_n.error)},_n.onblocked=function(){console.warn('dropInstance blocked for database "'+X.name+'" until all open connections are closed')},_n.onsuccess=function(){var qr=_n.result;qr&&qr.close(),Wr(qr)}});return Rr.then(function(Wr){Qe.db=Wr;for(var jr=0;jr<We.length;jr++){var _n=We[jr];M(_n._dbInfo)}}).catch(function(Wr){throw(j(X,Wr)||d.resolve()).catch(function(){}),Wr})})}return g(be,me),be}var tt={_driver:"asyncStorage",_initStorage:L,_support:u(),iterate:G,getItem:k,setItem:ge,removeItem:Q,clear:te,length:ue,key:T,keys:fe,dropInstance:Ge};function mt(){return typeof openDatabase=="function"}var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="~~local_forage_type~",Lt=/^~~local_forage_type~([^~]+)~/,Yt="__lfsc__:",_r=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=_r+Rt.length,tr=Object.prototype.toString;function ir(X){var me=X.length*.75,re=X.length,Ee,be=0,Ie,Je,ft,Qe;X[X.length-1]==="="&&(me--,X[X.length-2]==="="&&me--);var We=new ArrayBuffer(me),ht=new Uint8Array(We);for(Ee=0;Ee<re;Ee+=4)Ie=vt.indexOf(X[Ee]),Je=vt.indexOf(X[Ee+1]),ft=vt.indexOf(X[Ee+2]),Qe=vt.indexOf(X[Ee+3]),ht[be++]=Ie<<2|Je>>4,ht[be++]=(Je&15)<<4|ft>>2,ht[be++]=(ft&3)<<6|Qe&63;return We}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 vr(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 Ie=new FileReader;Ie.onload=function(){var Je=gt+X.type+"~"+nr(this.result);me(Yt+Pt+Je)},Ie.readAsArrayBuffer(X)}else try{me(JSON.stringify(X))}catch(Je){console.error("Couldn't convert value into a JSON string: ",X),me(null,Je)}}function wn(X){if(X.substring(0,_r)!==Yt)return JSON.parse(X);var me=X.substring(cr),re=X.substring(_r,cr),Ee;if(re===Pt&&Lt.test(me)){var be=me.match(Lt);Ee=be[1],me=me.substring(be[0].length)}var Ie=ir(me);switch(re){case Rt:return Ie;case Pt:return f([Ie],{type:Ee});case kt:return new Int8Array(Ie);case Nt:return new Uint8Array(Ie);case Kt:return new Uint8ClampedArray(Ie);case Ut:return new Int16Array(Ie);case $t:return new Uint16Array(Ie);case zt:return new Int32Array(Ie);case Dt:return new Uint32Array(Ie);case qt:return new Float32Array(Ie);case Mt:return new Float64Array(Ie);default:throw new Error("Unkown type: "+re)}}var Yr={serialize:vr,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(Ie,Je){try{re.db=openDatabase(re.name,String(re.version),re.description,re.size)}catch(ft){return Je(ft)}re.db.transaction(function(ft){ai(ft,re,function(){me._dbInfo=re,Ie()},function(Qe,We){Je(We)})},Je)});return re.serializer=Yr,be}function $n(X,me,re,Ee,be,Ie){X.executeSql(re,Ee,be,function(Je,ft){ft.code===ft.SYNTAX_ERR?Je.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(Qe,We){We.rows.length?Ie(Qe,ft):ai(Qe,me,function(){Qe.executeSql(re,Ee,be,Ie)},Ie)},Ie):Ie(Je,ft)},Ie)}function Kn(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName+" WHERE key = ? LIMIT 1",[X],function(Qe,We){var ht=We.rows.length?We.rows.item(0).value:null;ht&&(ht=Je.serializer.deserialize(ht)),be(ht)},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function Ar(X,me){var re=this,Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName,[],function(Qe,We){for(var ht=We.rows,Vt=ht.length,Rr=0;Rr<Vt;Rr++){var Wr=ht.item(Rr),jr=Wr.value;if(jr&&(jr=Je.serializer.deserialize(jr)),jr=X(jr,Wr.key,Rr+1),jr!==void 0){be(jr);return}}be()},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function Mr(X,me,re,Ee){var be=this;X=w(X);var Ie=new d(function(Je,ft){be.ready().then(function(){me===void 0&&(me=null);var Qe=me,We=be._dbInfo;We.serializer.serialize(me,function(ht,Vt){Vt?ft(Vt):We.db.transaction(function(Rr){$n(Rr,We,"INSERT OR REPLACE INTO "+We.storeName+" (key, value) VALUES (?, ?)",[X,ht],function(){Je(Qe)},function(Wr,jr){ft(jr)})},function(Rr){if(Rr.code===Rr.QUOTA_ERR){if(Ee>0){Je(Mr.apply(be,[X,Qe,re,Ee-1]));return}ft(Rr)}})})}).catch(ft)});return g(Ie,re),Ie}function Er(X,me,re){return Mr.apply(this,[X,me,re,1])}function _e(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"DELETE FROM "+Je.storeName+" WHERE key = ?",[X],function(){be()},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function ee(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Ie=me._dbInfo;Ie.db.transaction(function(Je){$n(Je,Ie,"DELETE FROM "+Ie.storeName,[],function(){Ee()},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Ie=me._dbInfo;Ie.db.transaction(function(Je){$n(Je,Ie,"SELECT COUNT(key) as c FROM "+Ie.storeName,[],function(ft,Qe){var We=Qe.rows.item(0).c;Ee(We)},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function Re(X,me){var re=this,Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT key FROM "+Je.storeName+" WHERE id = ? LIMIT 1",[X+1],function(Qe,We){var ht=We.rows.length?We.rows.item(0).key:null;be(ht)},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function Ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Ie=me._dbInfo;Ie.db.transaction(function(Je){$n(Je,Ie,"SELECT key FROM "+Ie.storeName,[],function(ft,Qe){for(var We=[],ht=0;ht<Qe.rows.length;ht++)We.push(Qe.rows.item(ht).key);Ee(We)},function(ft,Qe){be(Qe)})})}).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,Ie){for(var Je=[],ft=0;ft<Ie.rows.length;ft++)Je.push(Ie.rows.item(ft).name);me({db:X,storeNames:Je})},function(be,Ie){re(Ie)})},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(Ie){var Je;X.name===re.name?Je=Ee._dbInfo.db:Je=openDatabase(X.name,"","",0),X.storeName?Ie({db:Je,storeNames:[X.storeName]}):Ie(Xe(Je))}).then(function(Ie){return new d(function(Je,ft){Ie.db.transaction(function(Qe){function We(Wr){return new d(function(jr,_n){Qe.executeSql("DROP TABLE IF EXISTS "+Wr,[],function(){jr()},function(qr,P){_n(P)})})}for(var ht=[],Vt=0,Rr=Ie.storeNames.length;Vt<Rr;Vt++)ht.push(We(Ie.storeNames[Vt]));d.all(ht).then(function(){Je()}).catch(function(Wr){ft(Wr)})},function(Qe){ft(Qe)})})}):be=d.reject("Invalid arguments"),g(be,me),be}var lt={_driver:"webSQLStorage",_initStorage:Dn,_support:mt(),iterate:Ar,getItem:Kn,setItem:Er,removeItem:_e,clear:ee,length:ve,key:Re,keys:Ve,dropInstance:st};function _t(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function le(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=le(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 Ie=localStorage.key(be);Ie.indexOf(Ee)===0&&localStorage.removeItem(Ie)}});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,Ie=localStorage.getItem(be.keyPrefix+X);return Ie&&(Ie=be.serializer.deserialize(Ie)),Ie});return g(Ee,me),Ee}function It(X,me){var re=this,Ee=re.ready().then(function(){for(var be=re._dbInfo,Ie=be.keyPrefix,Je=Ie.length,ft=localStorage.length,Qe=1,We=0;We<ft;We++){var ht=localStorage.key(We);if(ht.indexOf(Ie)===0){var Vt=localStorage.getItem(ht);if(Vt&&(Vt=be.serializer.deserialize(Vt)),Vt=X(Vt,ht.substring(Je),Qe++),Vt!==void 0)return Vt}}});return g(Ee,me),Ee}function gr(X,me){var re=this,Ee=re.ready().then(function(){var be=re._dbInfo,Ie;try{Ie=localStorage.key(X)}catch{Ie=null}return Ie&&(Ie=Ie.substring(be.keyPrefix.length)),Ie});return g(Ee,me),Ee}function lr(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo,be=localStorage.length,Ie=[],Je=0;Je<be;Je++){var ft=localStorage.key(Je);ft.indexOf(Ee.keyPrefix)===0&&Ie.push(ft.substring(Ee.keyPrefix.length))}return Ie});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 yr(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 xr(X,me,re){var Ee=this;X=w(X);var be=Ee.ready().then(function(){me===void 0&&(me=null);var Ie=me;return new d(function(Je,ft){var Qe=Ee._dbInfo;Qe.serializer.serialize(me,function(We,ht){if(ht)ft(ht);else try{localStorage.setItem(Qe.keyPrefix+X,We),Je(Ie)}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(Ie){X.storeName?Ie(le(X,Ee._defaultConfig)):Ie(X.name+"/")}).then(function(Ie){for(var Je=localStorage.length-1;Je>=0;Je--){var ft=localStorage.key(Je);ft.indexOf(Ie)===0&&localStorage.removeItem(ft)}}):be=d.reject("Invalid arguments"),g(be,me),be}var sr={_driver:"localStorageWrapper",_initStorage:Me,_support:_t(),iterate:It,getItem:wt,setItem:xr,removeItem:yr,clear:Le,length:en,key:gr,keys:lr,dropInstance:on},Ur=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(Ur(X[Ee],me))return!0;Ee++}return!1},Br=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"},Zn={},Ii={},ei={INDEXEDDB:tt,WEBSQL:lt,LOCALSTORAGE:sr},Oi=[ei.INDEXEDDB._driver,ei.WEBSQL._driver,ei.LOCALSTORAGE._driver],Pi=["dropInstance"],oi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Pi),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)&&(Br(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(Ie,Je){try{var ft=me._driver,Qe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver){Je(Qe);return}for(var We=oi.concat("_initStorage"),ht=0,Vt=We.length;ht<Vt;ht++){var Rr=We[ht],Wr=!gn(Pi,Rr);if((Wr||me[Rr])&&typeof me[Rr]!="function"){Je(Qe);return}}var jr=function(){for(var qr=function(pe){return function(){var Se=new Error("Method "+pe+" is not implemented by the current driver"),Ce=d.reject(Se);return g(Ce,arguments[arguments.length-1]),Ce}},P=0,D=Pi.length;P<D;P++){var W=Pi[P];me[W]||(me[W]=qr(W))}};jr();var _n=function(qr){Zn[ft]&&console.info("Redefining LocalForage driver: "+ft),Zn[ft]=me,Ii[ft]=qr,Ie()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(_n,Je):_n(!!me._support):_n(!0)}catch(qr){Je(qr)}});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;Br(me)||(me=[me]);var Ie=this._getSupportedDrivers(me);function Je(){be._config.driver=be.driver()}function ft(ht){return be._extend(ht),Je(),be._ready=be._initStorage(be._config),be._ready}function Qe(ht){return function(){var Vt=0;function Rr(){for(;Vt<ht.length;){var Wr=ht[Vt];return Vt++,be._dbInfo=null,be._ready=null,be.getDriver(Wr).then(ft).catch(Rr)}Je();var jr=new Error("No available storage method found.");return be._driverSet=d.reject(jr),be._driverSet}return Rr()}}var We=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=We.then(function(){var ht=Ie[0];return be._dbInfo=null,be._ready=null,be.getDriver(ht).then(function(Vt){be._driver=Vt._driver,Je(),be._wrapLibraryMethodsWithReady(),be._initDriver=Qe(Ie)})}).catch(function(){Je();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!!Ii[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 Ie=me[Ee];this.supports(Ie)&&re.push(Ie)}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}(),os=new _a;n.exports=os},{3:3}]},{},[4])(4)})}),oqe=Jse((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 q=typeof Symbol=="function"&&F[Symbol.iterator],z=0;return q?q.call(F):{next:function(){return F&&z>=F.length&&(F=void 0),{value:F&&F[z++],done:!F}}}}function a(F,q){F=F||[],q=q||{};try{return new Blob(F,q)}catch(L){if(L.name!=="TypeError")throw L;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(q.type)}}var o=/^~~local_forage_type~([^~]+)~/,s=9,c=s+4,u=Object.prototype.toString;function f(F){var q=F.length*.75,z=F.length;F[F.length-1]==="="&&(q--,F[F.length-2]==="="&&q--);for(var $=new ArrayBuffer(q),H=new Uint8Array($),L=0,k=0;L<z;L+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L]),ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L+1]),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L+2]),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L+3]);H[k++]=G<<2|ge>>4,H[k++]=(ge&15)<<4|Q>>2,H[k++]=(Q&3)<<6|te&63}return $}function d(F){for(var q=new Uint8Array(F),z="",$=0;$<q.length;$+=3)z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[q[$]>>2],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(q[$]&3)<<4|q[$+1]>>4],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(q[$+1]&15)<<2|q[$+2]>>6],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[q[$+2]&63];return q.length%3===2?z=z.substring(0,z.length-1)+"=":q.length%3===1&&(z=z.substring(0,z.length-2)+"=="),z}function g(F,q){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":q(new Error("Failed to get type for BinaryArray"))),q(H+d($))}else if(z==="[object Blob]"){var L=new FileReader;L.onload=function(){var k="~~local_forage_type~"+F.type+"~"+d(this.result);q("__lfsc__:blob"+k)},L.readAsArrayBuffer(F)}else try{q(JSON.stringify(F))}catch(k){console.error("Couldn't convert value into a JSON string: ",F),q(null,k)}}function m(F){if(F.substring(0,s)!=="__lfsc__:")return JSON.parse(F);var q=F.substring(c),z=F.substring(s,c),$;if(z==="blob"&&o.test(q)){var H=q.match(o);$=H[1],q=q.substring(H[0].length)}var L=f(q);switch(z){case"arbf":return L;case"blob":return a([L],{type:$});case"si08":return new Int8Array(L);case"ui08":return new Uint8Array(L);case"uic8":return new Uint8ClampedArray(L);case"si16":return new Int16Array(L);case"ur16":return new Uint16Array(L);case"si32":return new Int32Array(L);case"ui32":return new Uint32Array(L);case"fl32":return new Float32Array(L);case"fl64":return new Float64Array(L);default:throw new Error("Unkown type: "+z)}}function w(F){var q,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)),L=H.next();!L.done;L=H.next()){var k=L.value;Object.prototype.hasOwnProperty.call(F,k)&&(F.isActiveClone=null,$[k]=w(F[k]),delete F.isActiveClone)}}catch(G){q={error:G}}finally{try{L&&!L.done&&(z=H.return)&&z.call(H)}finally{if(q)throw q.error}}return $}function v(F,q){return(F.name||q.name)+"/"+(F.storeName||q.storeName)+"/"}function y(F,q){q&&F.then(function(z){q(null,z)},function(z){q(z)})}function _(){for(var F=[],q=0;q<arguments.length;q++)F[q]=arguments[q];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function b(F,q){var z=this;if(q=_.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(L){F.storeName?L(v(F,z._defaultConfig)):L(F.name+"/")}):H=Promise.reject("Invalid arguments"),{promise:H,callback:q}}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},I={},E=function(){function F(q){this.kp=q,this.data={}}return F.resolve=function(q){return I[q]||(I[q]=new F(q)),I[q]},F.prototype.clear=function(){this.data={}},F.prototype.drop=function(){this.clear(),delete I[this.kp]},F.prototype.get=function(q){return this.data[q]},F.prototype.key=function(q){return this.keys()[q]},F.prototype.keys=function(){return Object.keys(this.data)},F.prototype.rm=function(q){delete this.data[q]},F.prototype.set=function(q,z){this.data[q]=z},F}();function p(F){var q=F?w(F):{},z=v(q,this._defaultConfig),$=E.resolve(z);return this._dbInfo=q,this._dbInfo.serializer=x,this._dbInfo.keyPrefix=z,this._dbInfo.mStore=$,Promise.resolve()}function O(F){var q=this,z=this.ready().then(function(){q._dbInfo.mStore.clear()});return y(z,F),z}function C(F,q){var z=b.apply(this,arguments),$=z.promise,H=z.callback,L=$.then(function(k){E.resolve(k).drop()});return y(L,H),$}function M(F,q){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($,q),$}function j(F,q){var z=this,$=this.ready().then(function(){for(var H=z._dbInfo.mStore,L=H.keys(),k=0;k<L.length;k++){var G=H.get(L[k]);if(G&&(G=z._dbInfo.serializer.deserialize(G)),G=F(G,L[k],k+1),G!==void 0)return G}});return y($,q),$}function ce(F,q){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($,q),$}function he(F){var q=this,z=this.ready().then(function(){return q._dbInfo.mStore.keys()});return y(z,F),z}function B(F){var q=this.keys().then(function(z){return z.length});return y(q,F),q}function U(F,q){var z=this;F=S(F);var $=this.ready().then(function(){z._dbInfo.mStore.rm(F)});return y($,q),$}function K(F,q,z){var $=this;F=S(F);var H=this.ready().then(function(){q===void 0&&(q=null);var L=q;return new Promise(function(k,G){$._dbInfo.serializer.serialize(q,function(ge,Q){if(Q)G(Q);else try{$._dbInfo.mStore.set(F,ge),k(L)}catch(te){G(te)}})})});return y(H,z),H}var ne=!0;r._support=ne,r._driver=n,r._initStorage=p,r.clear=O,r.dropInstance=C,r.getItem=M,r.iterate=j,r.key=ce,r.keys=he,r.length=B,r.removeItem=U,r.setItem=K,Object.defineProperty(r,"__esModule",{value:!0})})}),zN=Xse(aqe()),WY=Xse(oqe()),sqe={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function cqe(t){for(let[e,r]of Object.entries(sqe))t.style[e]=r}function uqe(t){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(r=>r.src.includes(t))}var lqe=class extends Xje{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(t=>{let e=()=>{if(uqe(encodeURIComponent(this.parameters)))dje().log();else{let r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=o2(this.endpoint).host,r.title="Secure Modal",r.src=o2(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,cqe(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 Lx(this,null,function*(){let t=yield this.iframe;t.style.display="block",this.activeElement=document.activeElement,t.focus()})}hideOverlay(){return Lx(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 Lx(this,null,function*(){let e=yield this.iframe;if(e&&e.contentWindow)e.contentWindow.postMessage(t,this.endpoint);else throw Dse()})}},fqe=aje(Yse,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:lqe,configureStorage:()=>Lx(void 0,null,function*(){let t=zN.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(WY),yield t.setDriver([zN.default.INDEXEDDB,zN.default.LOCALSTORAGE,WY._driver]),t})});const nL=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:_se,DeviceVerificationEventEmit:n2,DeviceVerificationEventOnReceived:Sse,EthChainType:Ise,Events:Qb,Extension:tp,ExtensionError:Yk,ExtensionWarning:T5,LoginWithEmailOTPEventEmit:K0,LoginWithEmailOTPEventOnReceived:Ase,LoginWithMagicLinkEventEmit:Ese,LoginWithMagicLinkEventOnReceived:xse,Magic:fqe,MagicIncomingWindowMessage:Oh,MagicOutgoingWindowMessage:M1,MagicPayloadMethod:br,RPCError:L1,RPCErrorCode:EI,RecoveryMethodType:Ose,SDKError:Rd,SDKErrorCode:Td,SDKWarning:Hw,SDKWarningCode:hm,Wallets:Es,isPromiEvent:Bse},Symbol.toStringTag,{value:"Module"})),dqe=uo(nL);var Zse={exports:{}},VN={exports:{}},KY;function ece(){return KY||(KY=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 I=0;I<x;I++){var E=b[I>>>2]>>>24-I%4*8&255;_[S+I>>>2]|=E<<24-(S+I)%4*8}else for(var I=0;I<x;I+=4)_[S+I>>>2]=b[I>>>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,O=987654321,C=4294967295;return function(){O=36969*(O&65535)+(O>>16)&C,p=18e3*(p&65535)+(p>>16)&C;var M=(O<<16)+p&C;return M/=4294967296,M+=.5,M*(n.random()>.5?1:-1)}},S=0,x;S<y;S+=4){var I=b((x||n.random())*4294967296);x=I()*987654071,_.push(I()*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 I=_[x>>>2]>>>24-x%4*8&255;S.push((I>>>4).toString(16)),S.push((I&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 I=_[x>>>2]>>>24-x%4*8&255;S.push(String.fromCharCode(I))}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,I=x*4,E=S/I;y?E=n.ceil(E):E=n.max((E|0)-this._minBufferSize,0);var p=E*x,O=n.min(p*4,S);if(p){for(var C=0;C<p;C+=x)this._doProcessBlock(b,C);var M=b.splice(0,p);_.sigBytes-=O}return new u.init(M,O)},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})}(VN)),VN.exports}(function(t,e){(function(r,n){t.exports=n(ece())})(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],I=v[5],E=v[6],p=v[7],O=0;O<64;O++){if(O<16)d[O]=m[w+O]|0;else{var C=d[O-15],M=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,j=d[O-2],ce=(j<<15|j>>>17)^(j<<13|j>>>19)^j>>>10;d[O]=M+d[O-7]+ce+d[O-16]}var he=x&I^~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+he+f[O]+d[O],F=U+B;p=E,E=I,I=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]+I|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})})(Zse);var hqe=Zse.exports;const pqe=Mc(hqe);var tce={exports:{}};(function(t,e){(function(r,n){t.exports=n(ece())})(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})})(tce);var gqe=tce.exports;const yqe=Mc(gqe);var zw=(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())}),rce=(t=>(t.ParseRedirectResult="magic_oauth_parse_redirect_result",t))(rce||{}),nce=(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))(nce||{}),YY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",ice=typeof window<"u"&&!!window.crypto,mqe=ice&&!!window.crypto.subtle;function vqe(t){return Array.from(t).map(e=>YY[e%YY.length]).join("")}function QY(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(yqe.stringify(t))}function bqe(t){return zw(this,null,function*(){if(mqe){let e=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",e).then(QY)}return QY(pqe(t))})}function JY(t){let e=new Uint8Array(t);if(ice)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.floor(Math.random()*Math.floor(255));return vqe(e)}function wqe(){return zw(this,null,function*(){let t=JY(128),e=JY(128),r=yield bqe(e);return{verifier:e,challenge:r,state:t}})}var _qe=class extends tp.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=>zw(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),xqe.call(this,t)}},s2="oauth_redirect_metadata";function Eqe(t){return zw(this,null,function*(){yield this.utils.storage.removeItem(s2);let{provider:e,redirectURI:r,scope:n,loginHint:i}=t,{verifier:a,challenge:o,state:s}=yield wqe(),c=JSON.stringify({verifier:a,state:s});return yield this.utils.storage.setItem(s2,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 xqe(t){return this.utils.createPromiEvent((e,r)=>zw(this,null,function*(){var n;let i=yield this.utils.storage.getItem(s2),{verifier:a,state:o}=JSON.parse(i);this.utils.storage.removeItem(s2);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 iL=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:nce,OAuthExtension:_qe,OAuthPayloadMethods:rce},Symbol.toStringTag,{value:"Module"})),Aqe=uo(iL);var Sqe=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}),XY=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)&&Sqe(e,t,r);return Iqe(e,t),e};Object.defineProperty(_I,"__esModule",{value:!0});_I.MagicConnector=void 0;const ZY=kl,eQ=Hs,Oqe=YS;class Pqe extends Oqe.AbstractConnector{constructor(e){super({supportedChainIds:eQ.getConfiguration()[ZY.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(()=>XY(dqe)),{OAuthExtension:i}=await Promise.resolve().then(()=>XY(Aqe)),a=eQ.getConfiguration()[ZY.ProviderType.MAGIC];return new n(a.apiKey,{extensions:[new i],network:{rpcUrl:a.urls[r],chainId:r}})},this.chainId=e,this.account=null}}_I.MagicConnector=Pqe;(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(YS,t),r(JS,t),r(oI,t),r(sI,t),r(cI,t),r(uI,t),r(_I,t)})(uk);var ace={},Vw={};Object.defineProperty(Vw,"__esModule",{value:!0});Vw.Storage=void 0;class Tqe{}Vw.Storage=Tqe;var II={};Object.defineProperty(II,"__esModule",{value:!0});II.LocalStorage=void 0;const Rqe=Vw;class Cqe extends Rqe.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)}}}II.LocalStorage=Cqe;(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(Vw,t),r(II,t)})(ace);var OI={};Object.defineProperty(OI,"__esModule",{value:!0});OI.ProviderAdapter=void 0;class aL{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 aL(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)}}OI.ProviderAdapter=aL;Object.defineProperty(Ny,"__esModule",{value:!0});Ny.connection=Ny.ConnectionManager=void 0;const tQ=is(),Vo=Sc,ME=$4e,df=uk,Nqe=ace,GN=Hs,rQ=OI;class oce{constructor(e){this.storage=e,this.getWalletName=()=>{if(this.connector instanceof df.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:r}=GN.getConfiguration();this.storage.remove(r),df.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(ME.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(ME.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(e,r=tQ.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(e,r),this.connector.on(ME.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),e===Vo.ProviderType.MAGIC&&this.connector.on(ME.ConnectorEvent.Update,({chainId:a})=>{a&&this.setConnectionData(e,a)});const{provider:n,account:i}=await this.connector.activate();return this.setConnectionData(e,r),{provider:rQ.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=tQ.ChainId.ETHEREUM_MAINNET){const i=await this.buildConnector(e,r).getProvider();return rQ.ProviderAdapter.adapt(i)}buildConnector(e,r){switch(e){case Vo.ProviderType.INJECTED:return new df.InjectedConnector(r);case Vo.ProviderType.FORTMATIC:return new df.FortmaticConnector(r);case Vo.ProviderType.MAGIC:return new df.MagicConnector(r);case Vo.ProviderType.WALLET_LINK:return new df.WalletLinkConnector(r);case Vo.ProviderType.NETWORK:return new df.NetworkConnector(r);case Vo.ProviderType.WALLET_CONNECT_V2:return new df.WalletConnectV2Connector(r);default:throw new Error(`Invalid provider ${e}`)}}getConnectionData(){const{storageKey:e}=GN.getConfiguration(),r=this.storage.get(e);return r?JSON.parse(r):void 0}setConnectionData(e,r){const{storageKey:n}=GN.getConfiguration(),i=JSON.stringify({providerType:e,chainId:r});this.storage.set(n,i)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}Ny.ConnectionManager=oce;Ny.connection=new oce(new Nqe.LocalStorage);var sce={};Object.defineProperty(sce,"__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(Ny,t),r(uk,t),r(Hs,t),r(sce,t)})(fd);const Dqe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/ManDefault-cb03f4f3.webp",$qe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/Platform-dfc6309e.webp";function Gw(){return window.analytics}const oL=()=>{qe.useEffect(()=>{const t=Gw();t&&t.page()},[])};var Ic=(t=>(t.LOGIN_CLICK="Click Login Button",t.LOGIN_SUCCESS="Login Success",t.LOGIN_ERROR="Login Error",t.CLICK="Click Button",t))(Ic||{}),Y0=(t=>(t.LEARN_MORE="Learn More",t.DENY_SIGN_IN="Deny Sign In",t.DENY_WALLET_INTERACTION="Deny Wallet Interaction",t.APPROVE_SING_IN="Approve Sign In",t.APPROVE_WALLET_INTERACTION="Approve Wallet Interaction",t))(Y0||{}),C5=(t=>(t.WEB3="web3",t.WEB2="web2",t.GUEST="guest",t))(C5||{});const Mqe="https://auth-api.decentraland.zone",kqe="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",Lqe="https://peer.decentraland.zone",Uqe={AUTH_SERVER_URL:Mqe,SEGMENT_API_KEY:kqe,PEER_URL:Lqe},Bqe="https://auth-api.decentraland.org",Fqe="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",jqe="https://peer.decentraland.org",qqe={AUTH_SERVER_URL:Bqe,SEGMENT_API_KEY:Fqe,PEER_URL:jqe},Hqe="https://auth-api.decentraland.today",zqe="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",Vqe="https://peer.decentraland.org",Gqe={AUTH_SERVER_URL:Hqe,SEGMENT_API_KEY:zqe,PEER_URL:Vqe},sL=G0.createConfig({[G0.Env.DEVELOPMENT]:Uqe,[G0.Env.STAGING]:Gqe,[G0.Env.PRODUCTION]:qqe},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});function Ux(t){return t!=null&&typeof t=="object"&&"message"in t}async function Wqe(t){const e=sL.get("PEER_URL"),r=await fetch(`${e}/content/entities/profile?pointer=${t}`);return r.ok?await r.json():[]}const Kqe="_background_s9giu_1",Yqe="_emptyProfile_s9giu_11",Qqe="_main_s9giu_27",Jqe="_left_s9giu_38",Xqe="_right_s9giu_49",Zqe="_wearablePlatform_s9giu_64",eHe="_changeAccount_s9giu_70",tHe="_errorLogo_s9giu_83",rHe="_logo_s9giu_92",nHe="_title_s9giu_98",iHe="_description_s9giu_105",aHe="_code_s9giu_112",oHe="_buttons_s9giu_119",sHe="_closeWindow_s9giu_129",cHe="_errorMessage_s9giu_135",uHe="_noButton_s9giu_145",lHe="_yesButton_s9giu_147",fHe="_wearableDefaultImg_s9giu_164",dHe="_loading_s9giu_176",hHe="_discordBtn_s9giu_180",pHe="_discordInfo_s9giu_193",pr={background:Kqe,emptyProfile:Yqe,main:Qqe,left:Jqe,right:Xqe,wearablePlatform:Zqe,changeAccount:eHe,errorLogo:tHe,logo:rHe,title:nHe,description:iHe,code:aHe,buttons:oHe,closeWindow:sHe,errorMessage:cHe,noButton:uHe,yesButton:lHe,wearableDefaultImg:fHe,loading:dHe,discordBtn:hHe,discordInfo:pHe},gHe=()=>{oL();const t=Gw(),e=Qye(),r=L2(),n=qe.useRef(),[i,a]=qe.useState(2),[o,s]=qe.useState(!1),[c,u]=qe.useState(null),f=qe.useRef(),[d,g]=qe.useState(),m=qe.useRef(),w=qe.useRef(),v=e.requestId??"",[y,_]=qe.useState(!1),b=qe.useCallback(()=>{r(`/login?redirectTo=/auth/requests/${v}&fromRequests=true`)},[]);qe.useEffect(()=>((async()=>{try{const M=await fd.connection.tryPreviousConnection();n.current=new bte(M.provider)}catch{b();return}try{const j=await(await n.current.getSigner()).getAddress();t.identify({ethAddress:j});const ce=await kE("recover",{requestId:v});f.current=ce;const he=await Wqe(j);if(u(he.length?he[0]:null),w.current=j,_(!0),ce.sender&&ce.sender!==j.toLowerCase()){a(1);return}m.current=setTimeout(()=>{a(0)},new Date(ce.expiration).getTime()-Date.now()),ce.method==="dcl_personal_sign"?a(4):a(8)}catch(M){g(Ux(M)?M.message:"Unknown error"),a(3)}})(),()=>{clearTimeout(m.current)}),[]),qe.useEffect(()=>{i!==4&&i!==8&&clearTimeout(m.current)},[i]);const S=qe.useCallback(()=>{t.track(Ic.CLICK,{action:Y0.DENY_SIGN_IN}),a(5)},[t]),x=qe.useCallback(M=>{w.current&&M.profile===w.current&&_(!1)},[]),I=qe.useCallback(async()=>{t.track(Ic.CLICK,{action:Y0.APPROVE_SING_IN}),s(!0);const M=n.current;try{if(!M)throw new Error("Provider not created");const j=await M.getSigner(),ce=await j.signMessage(f.current.params[0]),he=await kE("outcome",{requestId:v,sender:await j.getAddress(),result:ce});if(he.error)throw new Error(he.error);a(7)}catch(j){g(Ux(j)?j.message:"Unknown error"),a(6)}finally{s(!1)}},[s,t]),E=qe.useCallback(()=>{t.track(Ic.CLICK,{action:Y0.DENY_WALLET_INTERACTION}),a(9)},[t]),p=qe.useCallback(async()=>{var j,ce,he;s(!0);const M=n.current;try{if(!M)throw new Error("Provider not created");const B=await M.getSigner(),U=await M.send(f.current.method,f.current.params);t.track(Ic.CLICK,{action:Y0.APPROVE_WALLET_INTERACTION,method:f.current.method});const K=await kE("outcome",{requestId:v,sender:await B.getAddress(),result:U});if(K.error)throw new Error(K.error);a(11)}catch(B){console.log("Wallet error",JSON.stringify((j=B.info)==null?void 0:j.error));const U=await((ce=n.current)==null?void 0:ce.getSigner());U&&await kE("outcome",{requestId:v,sender:await U.getAddress(),result:((he=B.info)==null?void 0:he.error)??"Unknown error"}),g(Ux(B)?B.message:"Unknown error"),a(10)}},[t]),O=qe.useCallback(async M=>{M.preventDefault(),await fd.connection.disconnect(),b()},[]),C=qe.useCallback(M=>je.jsxs("div",{children:[je.jsx("div",{className:`${pr.background} ${(!w||c===null)&&i!==2?pr.emptyProfile:""}`}),je.jsxs("div",{className:pr.main,children:[je.jsxs("div",{className:pr.left,children:[M.children,M.canChangeAccount?je.jsxs("div",{className:pr.changeAccount,children:["Use another profile?"," ",je.jsx("a",{href:"/auth/login",onClick:O,children:"Return to log in"})]}):null]}),je.jsx("div",{className:`${pr.right} ${y?pr.loading:""}`,children:w.current&&c!==null?je.jsxs(je.Fragment,{children:[je.jsx("img",{src:Dqe,alt:"Avatar",className:pr.wearableDefaultImg}),je.jsx(dae,{lockBeta:!0,panning:!1,disableBackground:!0,profile:w.current,dev:!1,onUpdate:x}),je.jsx("img",{src:$qe,alt:"platform",className:pr.wearablePlatform})]}):null}),je.jsxs("a",{className:pr.discordBtn,href:"https://decentraland.org/discord",target:"about:blank",children:[je.jsx(Bb,{name:"discord"}),je.jsxs("p",{className:pr.discordInfo,children:[je.jsx("span",{children:"Need guidance?"}),je.jsx("span",{children:"MEET THE COMMUNITY"})]})]})]})]}),[y,i]);return i===0?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Looks like you took too long and the request has expired"}),je.jsx("div",{className:pr.description,children:"Please return to Decentraland's Desktop App to try again."}),je.jsx(oh,{})]}):i===1?je.jsxs(C,{canChangeAccount:!0,children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Looks like you are connected with a different account."}),je.jsx("div",{className:pr.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):i===2?je.jsx(C,{children:je.jsx("div",{className:pr.left,children:je.jsx(NS,{active:!0,size:"huge"})})}):i===3?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"There was an error recovering the request..."}),je.jsx("div",{className:pr.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),je.jsx(oh,{}),je.jsx("div",{className:pr.errorMessage,children:d})]}):i===4&&f.current?je.jsxs(C,{canChangeAccount:!0,isLoading:o,children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"Verify Sign In"}),je.jsx("div",{className:pr.description,children:"Do you see the same verification number on your Desktop App?"}),je.jsx("div",{className:pr.code,children:f.current.code}),je.jsxs("div",{className:pr.buttons,children:[je.jsxs(Pc.Button,{inverted:!0,disabled:o,onClick:S,className:pr.noButton,children:[je.jsx(Bb,{name:"times circle"}),"No, it doesn't"]}),je.jsxs(Pc.Button,{inverted:!0,loading:o,disabled:o,onClick:I,className:pr.yesButton,children:[je.jsx(Bb,{name:"check circle"}),"Yes, they are the same"]})]})]}):i===5?je.jsxs(C,{canChangeAccount:!0,children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Did the number not match, or was this action not taken by you?"}),je.jsx("div",{className:pr.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(oh,{})]}):i===7?je.jsxs(C,{children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"Your account is ready!"}),je.jsx("div",{className:pr.description,children:"Return to the Desktop App and enjoy Decentraland."}),je.jsx(oh,{})]}):i===8&&f.current?je.jsxs(C,{canChangeAccount:!0,isLoading:o,children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"The Desktop App wants to interact with your wallet."}),je.jsx("div",{className:pr.description,children:"Review the following data carefully on your wallet before approving it."}),je.jsxs("div",{className:pr.buttons,children:[je.jsx(Pc.Button,{inverted:!0,disabled:o,onClick:E,children:"Deny"}),je.jsx(Pc.Button,{primary:!0,disabled:o,loading:o,onClick:p,children:"Allow"})]})]}):i===9?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Was this action not initiated by you?"}),je.jsx("div",{className:pr.description,children:"If this action was not initiated by you, dismiss this message."}),je.jsx(oh,{})]}):i===11?je.jsxs(C,{children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"Wallet interaction complete"}),je.jsx("div",{className:pr.description,children:"The action has been executed successfully."}),je.jsx(oh,{})]}):i===6||i===10?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"There was an error while trying to submit the request."}),je.jsx("div",{className:pr.description,children:"Return to the Desktop App to try again, or contact support if the error persists."}),je.jsx(oh,{}),je.jsx("div",{className:pr.errorMessage,children:d})]}):null},oh=()=>je.jsx("div",{className:pr.closeWindow,children:"You can close this window."}),kE=async(t,e)=>{const r=sL.get("AUTH_SERVER_URL"),n=gx(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},yHe="_main_qbssu_1",mHe={main:yHe},vHe=()=>{const t=L2(),e=gw(),r=qe.useCallback(async()=>{try{const n=await fd.connection.tryPreviousConnection();return!!(n.account&&n.provider)}catch{return!1}},[]);return qe.useEffect(()=>{r().then(n=>{n?window.location.href="/":t({pathname:"/login",search:e.search})})},[r,t]),je.jsx("div",{className:mHe.main,children:je.jsx(NS,{active:!0,size:"huge"})})};var Ww={},PI={},WN,nQ;function bHe(){if(nQ)return WN;nQ=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 WN=t,WN}var KN,iQ;function wHe(){if(iQ)return KN;iQ=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 KN=t,KN}var YN,aQ;function cce(){if(aQ)return YN;aQ=1;var t=bHe(),e=Iw(),r=_d(),n=wHe(),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 YN=a,YN}var QN,oQ;function uce(){return oQ||(oQ=1,QN=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}),QN}var LE={},sQ;function _He(){if(sQ)return LE;sQ=1;var t=wr;LE.__esModule=!0;var e=t(Zy);return LE.default=e.default,LE}var qv={},UE={},cQ;function EHe(){if(cQ)return UE;cQ=1;var t=wr;UE.__esModule=!0;var e=t(Z$());return UE.default=e.default,UE}var uQ;function xHe(){if(uQ)return qv;uQ=1;var t=Ks,e=wr;qv.__esModule=!0,qv.default=void 0;var r=e(Bn()),n=e(Lc()),i=e(pS()),a=e(Ys()),o=e(ii);e(Ln());var s=t(qe),c=Wn(),u=e(EHe()),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,I){(0,a.default)(b,"onClick",x,I),(0,a.default)(w.props,"onActionClick",x,I)}}},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,I=(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:I}),(0,i.default)(_,function(O){return u.default.create(O,{overrideProps:v.handleButtonOverrides})})):s.default.createElement(p,(0,r.default)({},E,{className:I}),x):s.default.createElement(p,(0,r.default)({},E,{className:I}),b)},g}(s.Component);return qv.default=f,f.handledProps=["actions","as","children","className","content","onActionClick"],f.propTypes={},f.create=(0,c.createShorthandFactory)(f,function(d){return{actions:d}}),qv}var Hv={},lQ;function lce(){if(lQ)return Hv;lQ=1;var t=wr;Hv.__esModule=!0,Hv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=s.image,g=s.scrolling,m=(0,r.default)(u,(0,i.useKeyOnly)(d,"image"),(0,i.useKeyOnly)(g,"scrolling"),"content"),w=(0,i.getUnhandledProps)(a,s),v=(0,i.getElementType)(a,s);return n.default.createElement(v,(0,e.default)({},w,{className:m}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content","image","scrolling"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(s){return{content:s}});var o=a;return Hv.default=o,Hv}var zv={},fQ;function AHe(){if(fQ)return zv;fQ=1;var t=wr;zv.__esModule=!0,zv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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 zv.default=o,zv}var Vv={},dQ;function SHe(){if(dQ)return Vv;dQ=1;var t=wr;Vv.__esModule=!0,Vv.default=void 0;var e=t(Bn()),r=Ed,n=t(ii);t(Ln());var i=t(qe),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),I=(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(I,(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 Vv.default=s,Vv}var Gv={},hQ;function IHe(){if(hQ)return Gv;hQ=1;var t=wr;Gv.__esModule=!0,Gv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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 Gv.default=o,Gv}var Ku={},pQ;function OHe(){if(pQ)return Ku;pQ=1,Ku.__esModule=!0,Ku.isLegacy=Ku.getLegacyStyles=Ku.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};Ku.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}};Ku.getLegacyStyles=n;var i=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return Ku.isLegacy=i,Ku}var PHe=Ks,ta=wr;PI.__esModule=!0;PI.default=void 0;var _0=ta(Bn()),THe=ta(Lc()),RHe=ta(hS()),CHe=ta(U$()),NHe=ta(F$()),DHe=ta(cce()),$He=ta(ore()),hf=ta(Ys()),gQ=Ed,MHe=ta(ii);ta(Ln());var Yu=PHe(qe),kHe=ta(uce()),Pa=Wn(),LHe=ta(_He()),yQ=ta(X$()),fce=ta(xHe()),dce=ta(lce()),UHe=ta(AHe()),hce=ta(SHe()),pce=ta(IHe()),JN=OHe(),Tu=function(t){(0,THe.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,JN.isLegacy)(),n.ref=(0,Yu.createRef)(),n.dimmerRef=(0,Yu.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,hf.default)(s,"onActionClick",u,f),(0,hf.default)(n.props,"onActionClick",u,n.props),n.handleClose(u)}}},n.handleClose=function(s){n.setState({open:!1}),(0,hf.default)(n.props,"onClose",s,(0,_0.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,hf.default)(n.props,"onClose",s,(0,_0.default)({},n.props,{open:!1})))},n.handleIconOverrides=function(s){return{onClick:function(u){(0,hf.default)(s,"onClick",u),n.handleClose(u)}}},n.handleOpen=function(s){(0,hf.default)(n.props,"onOpen",s,(0,_0.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,hf.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,hf.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,JN.canFit)(f);c=!d;var g=n.legacy?(0,JN.getLegacyStyles)(d,s,f):{};(0,kHe.default)(n.state.legacyStyles,g)||(u.legacyStyles=g),n.state.scrolling!==c&&(u.scrolling=c)}(0,$He.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,I=(0,MHe.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,O=LHe.default.create(p,{overrideProps:n.handleIconOverrides});return Yu.default.createElement(gQ.Ref,{innerRef:n.ref},Yu.default.createElement(E,(0,_0.default)({},s,{className:I,style:(0,_0.default)({},S,_)}),O,Pa.childrenUtils.isNil(d)?Yu.default.createElement(Yu.default.Fragment,null,pce.default.create(v,{autoGenerateKey:!1}),dce.default.create(w,{autoGenerateKey:!1}),fce.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,Yu.isValidElement)(u)?u:null;var w=(0,Pa.getUnhandledProps)(e,this.props),v=yQ.default.handledProps,y=(0,DHe.default)(w,function(b,S,x){return(0,NHe.default)(v,x)||(b[x]=S),b},{}),_=(0,CHe.default)(w,v);return Yu.default.createElement(yQ.default,(0,_0.default)({closeOnDocumentClick:o},_,{trigger:u,eventPool:c,mountNode:m,open:d,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),Yu.default.createElement(gQ.Ref,{innerRef:this.dimmerRef},hce.default.create((0,RHe.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);Tu.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"];Tu.propTypes={};Tu.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Tu.autoControlledProps=["open"];Tu.Actions=fce.default;Tu.Content=dce.default;Tu.Description=UHe.default;Tu.Dimmer=hce.default;Tu.Header=pce.default;var BHe=Tu;PI.default=BHe;(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=PI;Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return e(r).default}})})(Ww);const gce=()=>{const t=gw(),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}},N5=t=>new Promise(e=>setTimeout(e,t));var FHe=lce();const cL=Mc(FHe);var uL={};var jHe=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)}}(),qHe=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]}),HHe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zHe=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)&&qHe(e,t,r);return HHe(e,t),e};Object.defineProperty(uL,"__esModule",{value:!0});var TI=uL.ModalNavigation=void 0,sh=zHe(qe),VHe=function(t){jHe(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 sh.createElement("div",{className:"dcl modal-navigation"},sh.createElement("div",{className:"dcl modal-navigation-title"},n),i&&sh.createElement("div",{className:"dcl modal-navigation-subtitle"},i),a&&sh.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:a}),s&&sh.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:s}),o&&sh.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:o}))},e}(sh.PureComponent);TI=uL.ModalNavigation=VHe;const GHe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/warning-057948e8.svg";var fi=(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.WAITING_FOR_CONFIRMATION="WAITING_FOR_CONFIRMATION",t))(fi||{});function WHe(t,e){switch(t){case fi.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case fi.CONNECTING_WALLET:case fi.WAITING_FOR_SIGNATURE:return e===kl.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case fi.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case fi.LOADING_MAGIC:return"Redirecting..."}}const KHe="_main_1qx1l_1",YHe="_content_1qx1l_8",QHe="_errorImage_1qx1l_16",JHe="_message_1qx1l_22",XHe="_loader_1qx1l_29",Wv={main:KHe,content:YHe,errorImage:QHe,message:JHe,loader:XHe},yce=t=>{const{open:e,state:r,providerType:n,onClose:i,onTryAgain:a}=t,o=r===fi.CONNECTING_WALLET||r===fi.WAITING_FOR_SIGNATURE||r===fi.LOADING_MAGIC||r===fi.VALIDATING_SIGN_IN;return je.jsxs(Ww.Modal,{size:"tiny",open:e,children:[je.jsx(TI,{title:"",onClose:o?void 0:i}),je.jsx("div",{className:Wv.main,children:je.jsxs("div",{className:Wv.content,children:[r===fi.ERROR&&je.jsx("img",{className:Wv.errorImage,src:GHe}),o&&je.jsx(NS,{className:Wv.loader,size:"huge",inline:!0}),je.jsx("p",{className:Wv.message,children:WHe(r,n)}),r===fi.ERROR&&je.jsx(Pc.Button,{primary:!0,onClick:a,children:"Try again"})]})}),je.jsx(cL,{})]})};var mce={},vce={},D5={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((pe,Se)=>{P=Ce=>{pe(Ce),W.isPending=!1},D=Ce=>{Se(Ce),W.isPending=!1}}).catch(pe=>Promise.reject(pe));return W.resolve=P,W.reject=D,"finally"in W||(W.finally=pe=>{W.then(pe),W.catch(pe)}),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 dje(){return new Hw(hm.DuplicateIframe,"Duplicate iframes found.")}function hje(){return new Hw(hm.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 pje(){return new Hw(hm.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 _g(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 Hw(hm.DeprecationNotice,o)}function*gje(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var yje=gje();function $se(){return yje.next().value}var Mse=Symbol("Payload pre-processed by Magic SDK");function kse(t){return Object.defineProperty(t,Mse,{value:!0,enumerable:!1}),t}function mje(t){return!!t[Mse]}function a2(t){var e,r,n;return mje(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=$se(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],kse(t)),t}function an(t,e=[]){return kse({params:e,method:t,jsonrpc:"2.0",id:$se()})}var Qk=class{constructor(t){t instanceof Qk?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):nje(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}}},vje=fFe(dFe()),bje=class extends vje.default{};function Lse(){let t=new bje;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var Use=Symbol("isPromiEvent");function Bse(t){return!!t[Use]}function Jk(t){let e=Fse(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=Lse(),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,{[Use]:!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 Fse(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var Mp=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(M1.MAGIC_HANDLE_REQUEST,a2(t)),r=Jk((i,a)=>{e.then(o=>{if(n(),o.hasError)a(new L1(o.payload.error));else if(o.hasResult)i(o.payload.result);else throw cje()}).catch(o=>{n(),a(o)})}),n=this.overlay.on(Oh.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(br.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}};function wje(t,e){let[r]=t.split(".").map(Number);return r>=e}var Eg={"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"},_je=class extends Mp{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&&wje(zn.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");e&&_g({method:"auth.loginWithMagicLink()",removalVersions:Eg,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:i,overrides:a}=t,o=an(this.sdk.testMode?br.LoginWithMagicLinkTestMode:br.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:i,overrides:a}]);return this.request(o)}loginWithSMS(t){let{phoneNumber:e}=t,r=an(this.sdk.testMode?br.LoginWithSmsTestMode:br.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?br.LoginWithEmailOTPTestMode:br.LoginWithEmailOTP,[{email:e,showUI:r,deviceCheckUI:n,overrides:i}]),o=this.request(a);return!n&&o&&o.on(n2.Retry,()=>{this.createIntermediaryEvent(n2.Retry,a.id)()}),!r&&o&&(o.on(K0.VerifyEmailOtp,s=>{this.createIntermediaryEvent(K0.VerifyEmailOtp,a.id)(s)}),o.on(K0.Cancel,()=>{this.createIntermediaryEvent(K0.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?br.LoginWithCredentialTestMode:br.LoginWithCredential,[e]);return this.request(r)}setAuthorizationToken(t){let e=an(br.SetAuthorizationToken,[{jwt:t}]);return this.request(e)}updateEmailWithUI(t){let{email:e,showUI:r=!0}=t,n=an(this.sdk.testMode?br.UpdateEmailTestMode:br.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}},jse={};uFe(jse,{clear:()=>Eje,getItem:()=>$o,iterate:()=>qse,key:()=>Aje,keys:()=>Sje,length:()=>xje,removeItem:()=>AI,setItem:()=>Rl});var NE;function Cd(t){return(...e)=>Ci(this,null,function*(){return NE||(NE=yield zn.configureStorage()),yield NE.ready(),NE[t](...e)})}var $o=Cd("getItem"),Rl=Cd("setItem"),AI=Cd("removeItem"),Eje=Cd("clear"),xje=Cd("length"),Aje=Cd("key"),Sje=Cd("keys"),qse=Cd("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 Hse="STORE_KEY_PRIVATE_KEY",R5="STORE_KEY_PUBLIC_JWK",zse="ECDSA",Oje="P-256",Pje={name:zse,namedCurve:Oje};function SI(){let t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function Tje(){return Ci(this,null,function*(){let t=yield Rje();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield $o(Hse);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:zY(JSON.stringify(i)),claims:zY(JSON.stringify(n))},o=Nje(`${a.protected}.${a.claims}`),s={name:zse,hash:{name:"SHA-256"}},c=$je(new Uint8Array(yield e.sign(s,r,o)));return`${a.protected}.${a.claims}.${c}`})}function Rje(){return Ci(this,null,function*(){if(!SI()){console.info("webcrypto is not supported");return}return(yield $o(R5))||(yield Cje()),$o(R5)})}function Cje(){return Ci(this,null,function*(){let{subtle:t}=window.crypto,e=yield t.generateKey(Pje,!1,["sign"]),r=yield t.exportKey("jwk",e.publicKey);yield Rl(Hse,e.privateKey),yield Rl(R5,r)})}function zY(t){return Vse(Dje(t))}function Nje(t){return new TextEncoder().encode(t)}function Vse(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function Dje(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function $je(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),Vse(e)}var Xk="ds",Zk="ek",eL="iv",tL="AES-GCM",Mje=256;function rL(){return Ci(this,null,function*(){let t=[];yield qse((e,r,n)=>{r.startsWith(`${Xk}_`)&&t.push(r)});for(let e of t)yield AI(e)})}function Gse(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 Wse(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 kje(){return Ci(this,null,function*(){if(!SI()){console.info("webcrypto is not supported");return}let{crypto:t}=window;return(yield $o(eL))||t.getRandomValues(new Uint8Array(12))})}function Lje(){return Ci(this,null,function*(){if(!SI()){console.info("webcrypto is not supported");return}let{subtle:t}=window.crypto;return(yield $o(Zk))||(yield t.generateKey({name:tL,length:Mje},!1,["encrypt","decrypt"]))})}function Uje(t,e){return Ci(this,null,function*(){let r=yield kje(),n=yield Lje();if(!r||!n||!t)return;let i=Wse(t),{subtle:a}=window.crypto,o=yield a.encrypt({name:tL,iv:r},n,i),s=Gse(o);yield Rl(`${Xk}_${e}`,s),yield Rl(Zk,n),yield Rl(eL,r)})}function Bje(t){return Ci(this,null,function*(){let e=yield $o(`${Xk}_${t}`),r=yield $o(eL),n=yield $o(Zk);if(!r||!e||!n||!SI())return;let{subtle:i}=window.crypto,a=yield i.decrypt({name:tL,iv:r},n,Wse(e));return Gse(a)})}var Fje=class extends Mp{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(e){let r=an(this.sdk.testMode?br.GetIdTokenTestMode:br.GetIdToken,[e]);return this.request(r)}generateIdToken(e){let r=an(this.sdk.testMode?br.GenerateIdTokenTestMode:br.GenerateIdToken,[e]);return this.request(r)}getInfo(){return Ci(this,null,function*(){let e=yield $o(this.localForageKey),r=an(br.GetInfo,[{walletType:e}]);return this.request(r)})}isLoggedIn(){let e=an(this.sdk.testMode?br.IsLoggedInTestMode:br.IsLoggedIn);return this.request(e)}logout(){AI(this.localForageKey),rL();let e=an(this.sdk.testMode?br.LogoutTestMode:br.Logout);return this.request(e)}requestInfoWithUI(e){let r=an(br.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}showSettings(e){let r=an(this.sdk.testMode?br.UserSettingsTestMode:br.UserSettings,[e]);return this.request(r)}recoverAccount(e){let r=an(this.sdk.testMode?br.RecoverAccountTestMode:br.RecoverAccount,[e]);return this.request(r)}getMetadata(){_g({method:"user.getMetadata()",removalVersions:Eg,useInstead:"user.getInfo()"}).log();let e=an(this.sdk.testMode?br.GetMetadataTestMode:br.GetMetadata);return this.request(e)}updateEmail(e){_g({method:"user.updateEmail()",removalVersions:Eg,useInstead:"auth.updateEmailWithUI()"}).log();let{email:r,showUI:n=!0}=e,i=an(this.sdk.testMode?br.UpdateEmailTestMode:br.UpdateEmail,[{email:r,showUI:n}]);return this.request(i)}};function o2(t,e){return e?new URL(t,e):new URL(t)}var jje=class extends Mp{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(Es.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(Es.MetaMask);r(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(Es.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(Es.CoinbaseWallet);r(c);return}let i=this.getUserEnv(),a=an(br.Login,[i]),o=this.request(a);o.on(Qb.WalletSelected,c=>this.handleWalletSelected(Tse(Wk({},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(br.ShowUI))}showAddress(){return this.request(an(br.ShowAddress))}showSendTokensUI(){return this.request(an(br.ShowSendTokensUI))}showOnRamp(){return this.request(an(br.ShowOnRamp))}showNFTs(){return this.request(an(br.ShowNFTs))}showBalances(){return this.request(an(br.ShowBalances))}sendGaslessTransaction(e,r){return this.request(an(br.SendGaslessTransaction,[e,r]))}getInfo(){return Ci(this,null,function*(){_g({method:"wallet.getInfo()",removalVersions:Eg,useInstead:"user.getInfo()"}).log();let e=yield $o(this.localForageKey),r=an(br.GetInfo,[{walletType:e}]);return this.request(r)})}disconnect(){_g({method:"wallet.disconnect()",removalVersions:Eg,useInstead:"user.logout()"}).log(),AI(this.localForageKey),rL();let e=an(br.Disconnect);return this.request(e)}requestUserInfoWithUI(e){_g({method:"wallet.requestUserInfoWithUI()",removalVersions:Eg,useInstead:"user.requestUserInfoWithUI()"}).log();let r=an(br.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}getProvider(){return Ci(this,null,function*(){switch(yield $o(this.localForageKey)){case Es.MetaMask:return this.getMetaMaskProvider();case Es.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 Es.MetaMask:return this.connectToMetaMask();case Es.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 Rl(this.localForageKey,e.wallet),this.createIntermediaryEvent(Qb.WalletConnected,e.payloadId)(r)}catch(r){console.error(r),this.createIntermediaryEvent(Qb.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return Ci(this,null,function*(){let r;e===Es.MetaMask&&(r=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===Es.CoinbaseWallet&&(r=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield Rl(this.localForageKey,e);let n=an(br.AutoConnect,[{wallet:e,address:r}]);return this.request(n)})}},{createBoundEmitterMethod:DE,createChainingEmitterMethod:w0}=Lse(),qje=class extends Mp{constructor(){super(...arguments),this.isMagic=!0,this.on=w0("on",this),this.once=w0("once",this),this.addListener=w0("addListener",this),this.off=w0("off",this),this.removeListener=w0("removeListener",this),this.removeAllListeners=w0("removeAllListeners",this),this.emit=DE("emit"),this.eventNames=DE("eventNames"),this.listeners=DE("listeners"),this.listenerCount=DE("listenerCount")}sendAsync(t,e){if(!e)throw fje({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(M1.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=a2(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>Tse(Wk({},n.payload),{error:n.hasError?new L1(n.payload.error):null})))});else{let r=a2(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(M1.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new L1(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=hje();return r.log(),new Qk(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=an(br.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}`)}},VY=["request","overlay","sdk"];function Hje(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==Mp.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var Kse=class extends Mp{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Jk,isPromiEvent:Bse,encodeJSON:Cse,decodeJSON:tje,createJsonRpcRequestPayload:an,standardizeJsonRpcRequestPayload:a2,storage:jse};let t=[this,...Hje(this)];VY.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 uje(e)}}))})}init(t){this.__is_initialized__||(VY.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 T5(this,"DEPRECATION_NOTICE",a)}createWarning(t,e){return new T5(this,t,e)}createError(t,e,r){return new Yk(this,t,e,r)}},zje=class extends Kse{},tp=class extends Kse{};tp.Internal=zje,tp.Anonymous="anonymous extension";var Vje=class extends Mp{purchase(t){let e=an(br.NFTPurchase,[t]);return this.request(e)}checkout(t){let e=an(br.NFTCheckout,[t]);return this.request(e)}transfer(t){let e=an(br.NFTTransfer,[t]);return this.request(e)}};function GY(t){return t.compat&&t.compat[zn.sdkName]!=null?typeof t.compat[zn.sdkName]=="string"?GFe(QFe(zn.version),t.compat[zn.sdkName]):!!t.compat[zn.sdkName]:!0}function Gje(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 Wje(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(a=>{GY(a)?(a.init(this),(a.name||a.name!==tp.Anonymous)&&(this[a.name]=a),a instanceof tp.Internal&&(i2(a.config)||(n[a.name]=a.config))):i.push(a)}):Object.keys(r).forEach(a=>{if(GY(r[a])){r[a].init(this);let o=r[a];this[a]=o,o instanceof tp.Internal&&(i2(o.config)||(n[r[a].name]=o.config))}else i.push(r[a])}),i.length)throw lje(i);return n}var kx=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw sje();zn.platform==="react-native"&&(e!=null&&e.endpoint)&&pje().log();let{defaultEndpoint:n,version:i}=zn;this.testMode=!!(e!=null&&e.testMode),this.endpoint=o2((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.auth=new _je(this),this.user=new Fje(this),this.wallet=new jje(this),this.nft=new Vje(this),this.rpcProvider=new qje(this);let a=Wje.call(this,e);this.parameters=Cse(Wk({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:o2(this.endpoint).host,sdk:oje[zn.sdkName],version:i,ext:i2(a)?void 0:a,locale:(e==null?void 0:e.locale)||"en_US"},zn.bundleId?{bundleId:zn.bundleId}:{})),this.networkHash=Gje(this.apiKey,e==null?void 0:e.network,i2(a)?void 0:a),e!=null&&e.deferPreload||this.preload()}get overlay(){if(!kx.__overlays__.has(this.parameters)){let t=new zn.ViewController(this.endpoint,this.parameters,this.networkHash);t.init(),kx.__overlays__.set(this.parameters,t)}return kx.__overlays__.get(this.parameters)}preload(){return Ci(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Yse=kx;Yse.__overlays__=new Map;function Kje(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function Yje(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=Kje(t,n);if(n&&i){let a=new Qk(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:a}}return{}}function Qje(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 Tje()}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 Bje(r);return s&&(o.deviceShare=s),o})}function Jje(t){return Ci(this,null,function*(){!t.data.rt||(yield Rl("rt",t.data.rt))})}var Xje=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 Fse((r,n)=>Ci(this,null,function*(){if(!this.isConnectedToInternet){let u=Dse();n(u)}this.isReadyForRequest||(yield this.waitForReady());let i=[],a=Array.isArray(e)?e.map(u=>u.id):[],o=yield Qje(`${t}-${this.parameters}`,e,this.networkHash);yield this._post(o);let s=u=>f=>{var d;let{id:g,response:m}=Yje(e,f);if(Jje(f),((d=m==null?void 0:m.payload.error)==null?void 0:d.message)==="User denied account access.")rL();else if(f.data.deviceShare){let{deviceShare:w}=f.data;Uje(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(Oh.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(Oh.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,t(),e()})})}listen(){this.on(Oh.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Oh.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Zje=Object.create,Qse=Object.defineProperty,eqe=Object.getOwnPropertyDescriptor,tqe=Object.getOwnPropertyNames,rqe=Object.getPrototypeOf,nqe=Object.prototype.hasOwnProperty,$E=(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')}),Jse=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),iqe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tqe(e))!nqe.call(t,i)&&i!==r&&Qse(t,i,{get:()=>e[i],enumerable:!(n=eqe(e,i))||n.enumerable});return t},Xse=(t,e,r)=>(r=t!=null?Zje(rqe(t)):{},iqe(e||!t||!t.__esModule?Qse(r,"default",{value:t,enumerable:!0}):r,t)),Lx=(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())}),aqe=Jse((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 $E=="function"&&$E;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 $E=="function"&&$E,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(I){if(typeof I!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,I!==o&&v(this,I)}d.prototype.catch=function(I){return this.then(null,I)},d.prototype.then=function(I,E){if(typeof I!="function"&&this.state===u||typeof E!="function"&&this.state===c)return this;var p=new this.constructor(o);if(this.state!==f){var O=this.state===u?I:E;m(p,O,this.outcome)}else this.queue.push(new g(p,I,E));return p};function g(I,E,p){this.promise=I,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof p=="function"&&(this.onRejected=p,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(I){s.resolve(this.promise,I)},g.prototype.otherCallFulfilled=function(I){m(this.promise,this.onFulfilled,I)},g.prototype.callRejected=function(I){s.reject(this.promise,I)},g.prototype.otherCallRejected=function(I){m(this.promise,this.onRejected,I)};function m(I,E,p){a(function(){var O;try{O=E(p)}catch(C){return s.reject(I,C)}O===I?s.reject(I,new TypeError("Cannot resolve promise with itself")):s.resolve(I,O)})}s.resolve=function(I,E){var p=y(w,E);if(p.status==="error")return s.reject(I,p.value);var O=p.value;if(O)v(I,O);else{I.state=u,I.outcome=E;for(var C=-1,M=I.queue.length;++C<M;)I.queue[C].callFulfilled(E)}return I},s.reject=function(I,E){I.state=c,I.outcome=E;for(var p=-1,O=I.queue.length;++p<O;)I.queue[p].callRejected(E);return I};function w(I){var E=I&&I.then;if(I&&(typeof I=="object"||typeof I=="function")&&typeof E=="function")return function(){E.apply(I,arguments)}}function v(I,E){var p=!1;function O(ce){p||(p=!0,s.reject(I,ce))}function C(ce){p||(p=!0,s.resolve(I,ce))}function M(){E(C,O)}var j=y(M);j.status==="error"&&O(j.value)}function y(I,E){var p={};try{p.value=I(E),p.status="success"}catch(O){p.status="error",p.value=O}return p}d.resolve=_;function _(I){return I instanceof this?I:s.resolve(new this(o),I)}d.reject=b;function b(I){var E=new this(o);return s.reject(E,I)}d.all=S;function S(I){var E=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=I.length,O=!1;if(!p)return this.resolve([]);for(var C=new Array(p),M=0,j=-1,ce=new this(o);++j<p;)he(I[j],j);return ce;function he(B,U){E.resolve(B).then(K,function(ne){O||(O=!0,s.reject(ce,ne))});function K(ne){C[U]=ne,++M===p&&!O&&(O=!0,s.resolve(ce,C))}}}d.race=x;function x(I){var E=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=I.length,O=!1;if(!p)return this.resolve([]);for(var C=-1,M=new this(o);++C<p;)j(I[C]);return M;function j(ce){E.resolve(ce).then(function(he){O||(O=!0,s.resolve(M,he))},function(he){O||(O=!0,s.reject(M,he))})}}},{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(Ie){if(Ie.name!=="TypeError")throw Ie;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",I="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,I),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+)/),Ie=navigator.userAgent.match(/Edge\//);me(Ie||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function O(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 M(X){var me=b[X.name],re=me.deferredOperations.pop();if(re)return re.resolve(),re.promise}function j(X,me){var re=b[X.name],Ee=re.deferredOperations.pop();if(Ee)return Ee.reject(me),Ee.promise}function ce(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 Ie=c.open.apply(c,be);me&&(Ie.onupgradeneeded=function(Je){var ft=Ie.result;try{ft.createObjectStore(X.storeName),Je.oldVersion<=1&&ft.createObjectStore(y)}catch(Qe){if(Qe.name==="ConstraintError")console.warn('The database "'+X.name+'" has been upgraded from version '+Je.oldVersion+" to version "+Je.newVersion+', but the storage "'+X.storeName+'" already exists.');else throw Qe}}),Ie.onerror=function(Je){Je.preventDefault(),Ee(Ie.error)},Ie.onsuccess=function(){var Je=Ie.result;Je.onversionchange=function(ft){ft.target.close()},re(Je),M(X)}})}function he(X){return ce(X,!1)}function B(X){return ce(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 Ie=X.db.version+1;Ie>X.version&&(X.version=Ie)}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 Ie=btoa(be.target.result||"");me({__local_forage_encoded_blob:!0,data:Ie,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 q(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,he(X).then(function(Ie){return X.db=Ie,U(X)?B(X):Ie}).then(function(Ie){X.db=me.db=Ie;for(var Je=0;Je<re.length;Je++)re[Je]._dbInfo.db=Ie}).catch(function(Ie){throw j(X,Ie),Ie})}function $(X,me,re,Ee){Ee===void 0&&(Ee=1);try{var be=X.db.transaction(X.storeName,me);re(null,be)}catch(Ie){if(Ee>0&&(!X.db||Ie.name==="InvalidStateError"||Ie.name==="NotFoundError"))return d.resolve().then(function(){if(!X.db||Ie.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(Ie)}}function H(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(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=q);var Ie=[];function Je(){return d.resolve()}for(var ft=0;ft<be.forages.length;ft++){var Qe=be.forages[ft];Qe!==me&&Ie.push(Qe._initReady().catch(Je))}var We=be.forages.slice(0);return d.all(Ie).then(function(){return re.db=be.db,he(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<We.length;Vt++){var Rr=We[Vt];Rr!==me&&(Rr._dbInfo.db=re.db,Rr._dbInfo.version=re.version)}})}function k(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=Qe.get(X);We.onsuccess=function(){var ht=We.result;ht===void 0&&(ht=null),F(ht)&&(ht=ne(ht)),be(ht)},We.onerror=function(){Ie(We.error)}}catch(ht){Ie(ht)}})}).catch(Ie)});return g(Ee,me),Ee}function G(X,me){var re=this,Ee=new d(function(be,Ie){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=Qe.openCursor(),ht=1;We.onsuccess=function(){var Vt=We.result;if(Vt){var Rr=Vt.value;F(Rr)&&(Rr=ne(Rr));var Wr=X(Rr,Vt.key,ht++);Wr!==void 0?be(Wr):Vt.continue()}else be()},We.onerror=function(){Ie(We.error)}}catch(Vt){Ie(Vt)}})}).catch(Ie)});return g(Ee,me),Ee}function ge(X,me,re){var Ee=this;X=w(X);var be=new d(function(Ie,Je){var ft;Ee.ready().then(function(){return ft=Ee._dbInfo,S.call(me)==="[object Blob]"?O(ft.db).then(function(Qe){return Qe?me:K(me)}):me}).then(function(Qe){$(Ee._dbInfo,I,function(We,ht){if(We)return Je(We);try{var Vt=ht.objectStore(Ee._dbInfo.storeName);Qe===null&&(Qe=void 0);var Rr=Vt.put(Qe,X);ht.oncomplete=function(){Qe===void 0&&(Qe=null),Ie(Qe)},ht.onabort=ht.onerror=function(){var Wr=Rr.error?Rr.error:Rr.transaction.error;Je(Wr)}}catch(Wr){Je(Wr)}})}).catch(Je)});return g(be,re),be}function Q(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){$(re._dbInfo,I,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=Qe.delete(X);ft.oncomplete=function(){be()},ft.onerror=function(){Ie(We.error)},ft.onabort=function(){var ht=We.error?We.error:We.transaction.error;Ie(ht)}}catch(ht){Ie(ht)}})}).catch(Ie)});return g(Ee,me),Ee}function te(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,I,function(Ie,Je){if(Ie)return be(Ie);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.clear();Je.oncomplete=function(){Ee()},Je.onabort=Je.onerror=function(){var We=Qe.error?Qe.error:Qe.transaction.error;be(We)}}catch(We){be(We)}})}).catch(be)});return g(re,X),re}function ue(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Ie,Je){if(Ie)return be(Ie);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.count();Qe.onsuccess=function(){Ee(Qe.result)},Qe.onerror=function(){be(Qe.error)}}catch(We){be(We)}})}).catch(be)});return g(re,X),re}function T(X,me){var re=this,Ee=new d(function(be,Ie){if(X<0){be(null);return}re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Ie(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),We=!1,ht=Qe.openKeyCursor();ht.onsuccess=function(){var Vt=ht.result;if(!Vt){be(null);return}X===0||We?be(Vt.key):(We=!0,Vt.advance(X))},ht.onerror=function(){Ie(ht.error)}}catch(Vt){Ie(Vt)}})}).catch(Ie)});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(Ie,Je){if(Ie)return be(Ie);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.openKeyCursor(),We=[];Qe.onsuccess=function(){var ht=Qe.result;if(!ht){Ee(We);return}We.push(ht.key),ht.continue()},Qe.onerror=function(){be(Qe.error)}}catch(ht){be(ht)}})}).catch(be)});return g(re,X),re}function Ge(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 Ie=X.name===re.name&&Ee._dbInfo.db,Je=Ie?d.resolve(Ee._dbInfo.db):he(X).then(function(ft){var Qe=b[X.name],We=Qe.forages;Qe.db=ft;for(var ht=0;ht<We.length;ht++)We[ht]._dbInfo.db=ft;return ft});X.storeName?be=Je.then(function(ft){if(ft.objectStoreNames.contains(X.storeName)){var Qe=ft.version+1;C(X);var We=b[X.name],ht=We.forages;ft.close();for(var Vt=0;Vt<ht.length;Vt++){var Rr=ht[Vt];Rr._dbInfo.db=null,Rr._dbInfo.version=Qe}var Wr=new d(function(jr,_n){var qr=c.open(X.name,Qe);qr.onerror=function(P){var D=qr.result;D.close(),_n(P)},qr.onupgradeneeded=function(){var P=qr.result;P.deleteObjectStore(X.storeName)},qr.onsuccess=function(){var P=qr.result;P.close(),jr(P)}});return Wr.then(function(jr){We.db=jr;for(var _n=0;_n<ht.length;_n++){var qr=ht[_n];qr._dbInfo.db=jr,M(qr._dbInfo)}}).catch(function(jr){throw(j(X,jr)||d.resolve()).catch(function(){}),jr})}}):be=Je.then(function(ft){C(X);var Qe=b[X.name],We=Qe.forages;ft.close();for(var ht=0;ht<We.length;ht++){var Vt=We[ht];Vt._dbInfo.db=null}var Rr=new d(function(Wr,jr){var _n=c.deleteDatabase(X.name);_n.onerror=function(){var qr=_n.result;qr&&qr.close(),jr(_n.error)},_n.onblocked=function(){console.warn('dropInstance blocked for database "'+X.name+'" until all open connections are closed')},_n.onsuccess=function(){var qr=_n.result;qr&&qr.close(),Wr(qr)}});return Rr.then(function(Wr){Qe.db=Wr;for(var jr=0;jr<We.length;jr++){var _n=We[jr];M(_n._dbInfo)}}).catch(function(Wr){throw(j(X,Wr)||d.resolve()).catch(function(){}),Wr})})}return g(be,me),be}var tt={_driver:"asyncStorage",_initStorage:L,_support:u(),iterate:G,getItem:k,setItem:ge,removeItem:Q,clear:te,length:ue,key:T,keys:fe,dropInstance:Ge};function mt(){return typeof openDatabase=="function"}var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="~~local_forage_type~",Lt=/^~~local_forage_type~([^~]+)~/,Yt="__lfsc__:",_r=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=_r+Rt.length,tr=Object.prototype.toString;function ir(X){var me=X.length*.75,re=X.length,Ee,be=0,Ie,Je,ft,Qe;X[X.length-1]==="="&&(me--,X[X.length-2]==="="&&me--);var We=new ArrayBuffer(me),ht=new Uint8Array(We);for(Ee=0;Ee<re;Ee+=4)Ie=vt.indexOf(X[Ee]),Je=vt.indexOf(X[Ee+1]),ft=vt.indexOf(X[Ee+2]),Qe=vt.indexOf(X[Ee+3]),ht[be++]=Ie<<2|Je>>4,ht[be++]=(Je&15)<<4|ft>>2,ht[be++]=(ft&3)<<6|Qe&63;return We}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 vr(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 Ie=new FileReader;Ie.onload=function(){var Je=gt+X.type+"~"+nr(this.result);me(Yt+Pt+Je)},Ie.readAsArrayBuffer(X)}else try{me(JSON.stringify(X))}catch(Je){console.error("Couldn't convert value into a JSON string: ",X),me(null,Je)}}function wn(X){if(X.substring(0,_r)!==Yt)return JSON.parse(X);var me=X.substring(cr),re=X.substring(_r,cr),Ee;if(re===Pt&&Lt.test(me)){var be=me.match(Lt);Ee=be[1],me=me.substring(be[0].length)}var Ie=ir(me);switch(re){case Rt:return Ie;case Pt:return f([Ie],{type:Ee});case kt:return new Int8Array(Ie);case Nt:return new Uint8Array(Ie);case Kt:return new Uint8ClampedArray(Ie);case Ut:return new Int16Array(Ie);case $t:return new Uint16Array(Ie);case zt:return new Int32Array(Ie);case Dt:return new Uint32Array(Ie);case qt:return new Float32Array(Ie);case Mt:return new Float64Array(Ie);default:throw new Error("Unkown type: "+re)}}var Yr={serialize:vr,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(Ie,Je){try{re.db=openDatabase(re.name,String(re.version),re.description,re.size)}catch(ft){return Je(ft)}re.db.transaction(function(ft){ai(ft,re,function(){me._dbInfo=re,Ie()},function(Qe,We){Je(We)})},Je)});return re.serializer=Yr,be}function $n(X,me,re,Ee,be,Ie){X.executeSql(re,Ee,be,function(Je,ft){ft.code===ft.SYNTAX_ERR?Je.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(Qe,We){We.rows.length?Ie(Qe,ft):ai(Qe,me,function(){Qe.executeSql(re,Ee,be,Ie)},Ie)},Ie):Ie(Je,ft)},Ie)}function Kn(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName+" WHERE key = ? LIMIT 1",[X],function(Qe,We){var ht=We.rows.length?We.rows.item(0).value:null;ht&&(ht=Je.serializer.deserialize(ht)),be(ht)},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function Ar(X,me){var re=this,Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName,[],function(Qe,We){for(var ht=We.rows,Vt=ht.length,Rr=0;Rr<Vt;Rr++){var Wr=ht.item(Rr),jr=Wr.value;if(jr&&(jr=Je.serializer.deserialize(jr)),jr=X(jr,Wr.key,Rr+1),jr!==void 0){be(jr);return}}be()},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function Mr(X,me,re,Ee){var be=this;X=w(X);var Ie=new d(function(Je,ft){be.ready().then(function(){me===void 0&&(me=null);var Qe=me,We=be._dbInfo;We.serializer.serialize(me,function(ht,Vt){Vt?ft(Vt):We.db.transaction(function(Rr){$n(Rr,We,"INSERT OR REPLACE INTO "+We.storeName+" (key, value) VALUES (?, ?)",[X,ht],function(){Je(Qe)},function(Wr,jr){ft(jr)})},function(Rr){if(Rr.code===Rr.QUOTA_ERR){if(Ee>0){Je(Mr.apply(be,[X,Qe,re,Ee-1]));return}ft(Rr)}})})}).catch(ft)});return g(Ie,re),Ie}function Er(X,me,re){return Mr.apply(this,[X,me,re,1])}function _e(X,me){var re=this;X=w(X);var Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"DELETE FROM "+Je.storeName+" WHERE key = ?",[X],function(){be()},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function ee(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Ie=me._dbInfo;Ie.db.transaction(function(Je){$n(Je,Ie,"DELETE FROM "+Ie.storeName,[],function(){Ee()},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Ie=me._dbInfo;Ie.db.transaction(function(Je){$n(Je,Ie,"SELECT COUNT(key) as c FROM "+Ie.storeName,[],function(ft,Qe){var We=Qe.rows.item(0).c;Ee(We)},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function Re(X,me){var re=this,Ee=new d(function(be,Ie){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT key FROM "+Je.storeName+" WHERE id = ? LIMIT 1",[X+1],function(Qe,We){var ht=We.rows.length?We.rows.item(0).key:null;be(ht)},function(Qe,We){Ie(We)})})}).catch(Ie)});return g(Ee,me),Ee}function Ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Ie=me._dbInfo;Ie.db.transaction(function(Je){$n(Je,Ie,"SELECT key FROM "+Ie.storeName,[],function(ft,Qe){for(var We=[],ht=0;ht<Qe.rows.length;ht++)We.push(Qe.rows.item(ht).key);Ee(We)},function(ft,Qe){be(Qe)})})}).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,Ie){for(var Je=[],ft=0;ft<Ie.rows.length;ft++)Je.push(Ie.rows.item(ft).name);me({db:X,storeNames:Je})},function(be,Ie){re(Ie)})},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(Ie){var Je;X.name===re.name?Je=Ee._dbInfo.db:Je=openDatabase(X.name,"","",0),X.storeName?Ie({db:Je,storeNames:[X.storeName]}):Ie(Xe(Je))}).then(function(Ie){return new d(function(Je,ft){Ie.db.transaction(function(Qe){function We(Wr){return new d(function(jr,_n){Qe.executeSql("DROP TABLE IF EXISTS "+Wr,[],function(){jr()},function(qr,P){_n(P)})})}for(var ht=[],Vt=0,Rr=Ie.storeNames.length;Vt<Rr;Vt++)ht.push(We(Ie.storeNames[Vt]));d.all(ht).then(function(){Je()}).catch(function(Wr){ft(Wr)})},function(Qe){ft(Qe)})})}):be=d.reject("Invalid arguments"),g(be,me),be}var lt={_driver:"webSQLStorage",_initStorage:Dn,_support:mt(),iterate:Ar,getItem:Kn,setItem:Er,removeItem:_e,clear:ee,length:ve,key:Re,keys:Ve,dropInstance:st};function _t(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function le(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=le(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 Ie=localStorage.key(be);Ie.indexOf(Ee)===0&&localStorage.removeItem(Ie)}});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,Ie=localStorage.getItem(be.keyPrefix+X);return Ie&&(Ie=be.serializer.deserialize(Ie)),Ie});return g(Ee,me),Ee}function It(X,me){var re=this,Ee=re.ready().then(function(){for(var be=re._dbInfo,Ie=be.keyPrefix,Je=Ie.length,ft=localStorage.length,Qe=1,We=0;We<ft;We++){var ht=localStorage.key(We);if(ht.indexOf(Ie)===0){var Vt=localStorage.getItem(ht);if(Vt&&(Vt=be.serializer.deserialize(Vt)),Vt=X(Vt,ht.substring(Je),Qe++),Vt!==void 0)return Vt}}});return g(Ee,me),Ee}function gr(X,me){var re=this,Ee=re.ready().then(function(){var be=re._dbInfo,Ie;try{Ie=localStorage.key(X)}catch{Ie=null}return Ie&&(Ie=Ie.substring(be.keyPrefix.length)),Ie});return g(Ee,me),Ee}function lr(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo,be=localStorage.length,Ie=[],Je=0;Je<be;Je++){var ft=localStorage.key(Je);ft.indexOf(Ee.keyPrefix)===0&&Ie.push(ft.substring(Ee.keyPrefix.length))}return Ie});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 yr(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 xr(X,me,re){var Ee=this;X=w(X);var be=Ee.ready().then(function(){me===void 0&&(me=null);var Ie=me;return new d(function(Je,ft){var Qe=Ee._dbInfo;Qe.serializer.serialize(me,function(We,ht){if(ht)ft(ht);else try{localStorage.setItem(Qe.keyPrefix+X,We),Je(Ie)}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(Ie){X.storeName?Ie(le(X,Ee._defaultConfig)):Ie(X.name+"/")}).then(function(Ie){for(var Je=localStorage.length-1;Je>=0;Je--){var ft=localStorage.key(Je);ft.indexOf(Ie)===0&&localStorage.removeItem(ft)}}):be=d.reject("Invalid arguments"),g(be,me),be}var sr={_driver:"localStorageWrapper",_initStorage:Me,_support:_t(),iterate:It,getItem:wt,setItem:xr,removeItem:yr,clear:Le,length:en,key:gr,keys:lr,dropInstance:on},Ur=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(Ur(X[Ee],me))return!0;Ee++}return!1},Br=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"},Zn={},Ii={},ei={INDEXEDDB:tt,WEBSQL:lt,LOCALSTORAGE:sr},Oi=[ei.INDEXEDDB._driver,ei.WEBSQL._driver,ei.LOCALSTORAGE._driver],Pi=["dropInstance"],oi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Pi),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)&&(Br(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(Ie,Je){try{var ft=me._driver,Qe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver){Je(Qe);return}for(var We=oi.concat("_initStorage"),ht=0,Vt=We.length;ht<Vt;ht++){var Rr=We[ht],Wr=!gn(Pi,Rr);if((Wr||me[Rr])&&typeof me[Rr]!="function"){Je(Qe);return}}var jr=function(){for(var qr=function(pe){return function(){var Se=new Error("Method "+pe+" is not implemented by the current driver"),Ce=d.reject(Se);return g(Ce,arguments[arguments.length-1]),Ce}},P=0,D=Pi.length;P<D;P++){var W=Pi[P];me[W]||(me[W]=qr(W))}};jr();var _n=function(qr){Zn[ft]&&console.info("Redefining LocalForage driver: "+ft),Zn[ft]=me,Ii[ft]=qr,Ie()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(_n,Je):_n(!!me._support):_n(!0)}catch(qr){Je(qr)}});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;Br(me)||(me=[me]);var Ie=this._getSupportedDrivers(me);function Je(){be._config.driver=be.driver()}function ft(ht){return be._extend(ht),Je(),be._ready=be._initStorage(be._config),be._ready}function Qe(ht){return function(){var Vt=0;function Rr(){for(;Vt<ht.length;){var Wr=ht[Vt];return Vt++,be._dbInfo=null,be._ready=null,be.getDriver(Wr).then(ft).catch(Rr)}Je();var jr=new Error("No available storage method found.");return be._driverSet=d.reject(jr),be._driverSet}return Rr()}}var We=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=We.then(function(){var ht=Ie[0];return be._dbInfo=null,be._ready=null,be.getDriver(ht).then(function(Vt){be._driver=Vt._driver,Je(),be._wrapLibraryMethodsWithReady(),be._initDriver=Qe(Ie)})}).catch(function(){Je();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!!Ii[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 Ie=me[Ee];this.supports(Ie)&&re.push(Ie)}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}(),os=new _a;n.exports=os},{3:3}]},{},[4])(4)})}),oqe=Jse((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 q=typeof Symbol=="function"&&F[Symbol.iterator],z=0;return q?q.call(F):{next:function(){return F&&z>=F.length&&(F=void 0),{value:F&&F[z++],done:!F}}}}function a(F,q){F=F||[],q=q||{};try{return new Blob(F,q)}catch(L){if(L.name!=="TypeError")throw L;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(q.type)}}var o=/^~~local_forage_type~([^~]+)~/,s=9,c=s+4,u=Object.prototype.toString;function f(F){var q=F.length*.75,z=F.length;F[F.length-1]==="="&&(q--,F[F.length-2]==="="&&q--);for(var $=new ArrayBuffer(q),H=new Uint8Array($),L=0,k=0;L<z;L+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L]),ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L+1]),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L+2]),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[L+3]);H[k++]=G<<2|ge>>4,H[k++]=(ge&15)<<4|Q>>2,H[k++]=(Q&3)<<6|te&63}return $}function d(F){for(var q=new Uint8Array(F),z="",$=0;$<q.length;$+=3)z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[q[$]>>2],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(q[$]&3)<<4|q[$+1]>>4],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(q[$+1]&15)<<2|q[$+2]>>6],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[q[$+2]&63];return q.length%3===2?z=z.substring(0,z.length-1)+"=":q.length%3===1&&(z=z.substring(0,z.length-2)+"=="),z}function g(F,q){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":q(new Error("Failed to get type for BinaryArray"))),q(H+d($))}else if(z==="[object Blob]"){var L=new FileReader;L.onload=function(){var k="~~local_forage_type~"+F.type+"~"+d(this.result);q("__lfsc__:blob"+k)},L.readAsArrayBuffer(F)}else try{q(JSON.stringify(F))}catch(k){console.error("Couldn't convert value into a JSON string: ",F),q(null,k)}}function m(F){if(F.substring(0,s)!=="__lfsc__:")return JSON.parse(F);var q=F.substring(c),z=F.substring(s,c),$;if(z==="blob"&&o.test(q)){var H=q.match(o);$=H[1],q=q.substring(H[0].length)}var L=f(q);switch(z){case"arbf":return L;case"blob":return a([L],{type:$});case"si08":return new Int8Array(L);case"ui08":return new Uint8Array(L);case"uic8":return new Uint8ClampedArray(L);case"si16":return new Int16Array(L);case"ur16":return new Uint16Array(L);case"si32":return new Int32Array(L);case"ui32":return new Uint32Array(L);case"fl32":return new Float32Array(L);case"fl64":return new Float64Array(L);default:throw new Error("Unkown type: "+z)}}function w(F){var q,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)),L=H.next();!L.done;L=H.next()){var k=L.value;Object.prototype.hasOwnProperty.call(F,k)&&(F.isActiveClone=null,$[k]=w(F[k]),delete F.isActiveClone)}}catch(G){q={error:G}}finally{try{L&&!L.done&&(z=H.return)&&z.call(H)}finally{if(q)throw q.error}}return $}function v(F,q){return(F.name||q.name)+"/"+(F.storeName||q.storeName)+"/"}function y(F,q){q&&F.then(function(z){q(null,z)},function(z){q(z)})}function _(){for(var F=[],q=0;q<arguments.length;q++)F[q]=arguments[q];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function b(F,q){var z=this;if(q=_.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(L){F.storeName?L(v(F,z._defaultConfig)):L(F.name+"/")}):H=Promise.reject("Invalid arguments"),{promise:H,callback:q}}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},I={},E=function(){function F(q){this.kp=q,this.data={}}return F.resolve=function(q){return I[q]||(I[q]=new F(q)),I[q]},F.prototype.clear=function(){this.data={}},F.prototype.drop=function(){this.clear(),delete I[this.kp]},F.prototype.get=function(q){return this.data[q]},F.prototype.key=function(q){return this.keys()[q]},F.prototype.keys=function(){return Object.keys(this.data)},F.prototype.rm=function(q){delete this.data[q]},F.prototype.set=function(q,z){this.data[q]=z},F}();function p(F){var q=F?w(F):{},z=v(q,this._defaultConfig),$=E.resolve(z);return this._dbInfo=q,this._dbInfo.serializer=x,this._dbInfo.keyPrefix=z,this._dbInfo.mStore=$,Promise.resolve()}function O(F){var q=this,z=this.ready().then(function(){q._dbInfo.mStore.clear()});return y(z,F),z}function C(F,q){var z=b.apply(this,arguments),$=z.promise,H=z.callback,L=$.then(function(k){E.resolve(k).drop()});return y(L,H),$}function M(F,q){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($,q),$}function j(F,q){var z=this,$=this.ready().then(function(){for(var H=z._dbInfo.mStore,L=H.keys(),k=0;k<L.length;k++){var G=H.get(L[k]);if(G&&(G=z._dbInfo.serializer.deserialize(G)),G=F(G,L[k],k+1),G!==void 0)return G}});return y($,q),$}function ce(F,q){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($,q),$}function he(F){var q=this,z=this.ready().then(function(){return q._dbInfo.mStore.keys()});return y(z,F),z}function B(F){var q=this.keys().then(function(z){return z.length});return y(q,F),q}function U(F,q){var z=this;F=S(F);var $=this.ready().then(function(){z._dbInfo.mStore.rm(F)});return y($,q),$}function K(F,q,z){var $=this;F=S(F);var H=this.ready().then(function(){q===void 0&&(q=null);var L=q;return new Promise(function(k,G){$._dbInfo.serializer.serialize(q,function(ge,Q){if(Q)G(Q);else try{$._dbInfo.mStore.set(F,ge),k(L)}catch(te){G(te)}})})});return y(H,z),H}var ne=!0;r._support=ne,r._driver=n,r._initStorage=p,r.clear=O,r.dropInstance=C,r.getItem=M,r.iterate=j,r.key=ce,r.keys=he,r.length=B,r.removeItem=U,r.setItem=K,Object.defineProperty(r,"__esModule",{value:!0})})}),zN=Xse(aqe()),WY=Xse(oqe()),sqe={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function cqe(t){for(let[e,r]of Object.entries(sqe))t.style[e]=r}function uqe(t){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(r=>r.src.includes(t))}var lqe=class extends Xje{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(t=>{let e=()=>{if(uqe(encodeURIComponent(this.parameters)))dje().log();else{let r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=o2(this.endpoint).host,r.title="Secure Modal",r.src=o2(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,cqe(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 Lx(this,null,function*(){let t=yield this.iframe;t.style.display="block",this.activeElement=document.activeElement,t.focus()})}hideOverlay(){return Lx(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 Lx(this,null,function*(){let e=yield this.iframe;if(e&&e.contentWindow)e.contentWindow.postMessage(t,this.endpoint);else throw Dse()})}},fqe=aje(Yse,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:lqe,configureStorage:()=>Lx(void 0,null,function*(){let t=zN.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(WY),yield t.setDriver([zN.default.INDEXEDDB,zN.default.LOCALSTORAGE,WY._driver]),t})});const nL=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:_se,DeviceVerificationEventEmit:n2,DeviceVerificationEventOnReceived:Sse,EthChainType:Ise,Events:Qb,Extension:tp,ExtensionError:Yk,ExtensionWarning:T5,LoginWithEmailOTPEventEmit:K0,LoginWithEmailOTPEventOnReceived:Ase,LoginWithMagicLinkEventEmit:Ese,LoginWithMagicLinkEventOnReceived:xse,Magic:fqe,MagicIncomingWindowMessage:Oh,MagicOutgoingWindowMessage:M1,MagicPayloadMethod:br,RPCError:L1,RPCErrorCode:EI,RecoveryMethodType:Ose,SDKError:Rd,SDKErrorCode:Td,SDKWarning:Hw,SDKWarningCode:hm,Wallets:Es,isPromiEvent:Bse},Symbol.toStringTag,{value:"Module"})),dqe=uo(nL);var Zse={exports:{}},VN={exports:{}},KY;function ece(){return KY||(KY=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 I=0;I<x;I++){var E=b[I>>>2]>>>24-I%4*8&255;_[S+I>>>2]|=E<<24-(S+I)%4*8}else for(var I=0;I<x;I+=4)_[S+I>>>2]=b[I>>>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,O=987654321,C=4294967295;return function(){O=36969*(O&65535)+(O>>16)&C,p=18e3*(p&65535)+(p>>16)&C;var M=(O<<16)+p&C;return M/=4294967296,M+=.5,M*(n.random()>.5?1:-1)}},S=0,x;S<y;S+=4){var I=b((x||n.random())*4294967296);x=I()*987654071,_.push(I()*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 I=_[x>>>2]>>>24-x%4*8&255;S.push((I>>>4).toString(16)),S.push((I&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 I=_[x>>>2]>>>24-x%4*8&255;S.push(String.fromCharCode(I))}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,I=x*4,E=S/I;y?E=n.ceil(E):E=n.max((E|0)-this._minBufferSize,0);var p=E*x,O=n.min(p*4,S);if(p){for(var C=0;C<p;C+=x)this._doProcessBlock(b,C);var M=b.splice(0,p);_.sigBytes-=O}return new u.init(M,O)},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})}(VN)),VN.exports}(function(t,e){(function(r,n){t.exports=n(ece())})(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],I=v[5],E=v[6],p=v[7],O=0;O<64;O++){if(O<16)d[O]=m[w+O]|0;else{var C=d[O-15],M=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,j=d[O-2],ce=(j<<15|j>>>17)^(j<<13|j>>>19)^j>>>10;d[O]=M+d[O-7]+ce+d[O-16]}var he=x&I^~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+he+f[O]+d[O],F=U+B;p=E,E=I,I=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]+I|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})})(Zse);var hqe=Zse.exports;const pqe=Mc(hqe);var tce={exports:{}};(function(t,e){(function(r,n){t.exports=n(ece())})(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})})(tce);var gqe=tce.exports;const yqe=Mc(gqe);var zw=(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())}),rce=(t=>(t.ParseRedirectResult="magic_oauth_parse_redirect_result",t))(rce||{}),nce=(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))(nce||{}),YY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",ice=typeof window<"u"&&!!window.crypto,mqe=ice&&!!window.crypto.subtle;function vqe(t){return Array.from(t).map(e=>YY[e%YY.length]).join("")}function QY(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(yqe.stringify(t))}function bqe(t){return zw(this,null,function*(){if(mqe){let e=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",e).then(QY)}return QY(pqe(t))})}function JY(t){let e=new Uint8Array(t);if(ice)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.floor(Math.random()*Math.floor(255));return vqe(e)}function wqe(){return zw(this,null,function*(){let t=JY(128),e=JY(128),r=yield bqe(e);return{verifier:e,challenge:r,state:t}})}var _qe=class extends tp.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=>zw(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),xqe.call(this,t)}},s2="oauth_redirect_metadata";function Eqe(t){return zw(this,null,function*(){yield this.utils.storage.removeItem(s2);let{provider:e,redirectURI:r,scope:n,loginHint:i}=t,{verifier:a,challenge:o,state:s}=yield wqe(),c=JSON.stringify({verifier:a,state:s});return yield this.utils.storage.setItem(s2,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 xqe(t){return this.utils.createPromiEvent((e,r)=>zw(this,null,function*(){var n;let i=yield this.utils.storage.getItem(s2),{verifier:a,state:o}=JSON.parse(i);this.utils.storage.removeItem(s2);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 iL=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:nce,OAuthExtension:_qe,OAuthPayloadMethods:rce},Symbol.toStringTag,{value:"Module"})),Aqe=uo(iL);var Sqe=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}),XY=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)&&Sqe(e,t,r);return Iqe(e,t),e};Object.defineProperty(_I,"__esModule",{value:!0});_I.MagicConnector=void 0;const ZY=kl,eQ=Hs,Oqe=YS;class Pqe extends Oqe.AbstractConnector{constructor(e){super({supportedChainIds:eQ.getConfiguration()[ZY.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(()=>XY(dqe)),{OAuthExtension:i}=await Promise.resolve().then(()=>XY(Aqe)),a=eQ.getConfiguration()[ZY.ProviderType.MAGIC];return new n(a.apiKey,{extensions:[new i],network:{rpcUrl:a.urls[r],chainId:r}})},this.chainId=e,this.account=null}}_I.MagicConnector=Pqe;(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(YS,t),r(JS,t),r(oI,t),r(sI,t),r(cI,t),r(uI,t),r(_I,t)})(uk);var ace={},Vw={};Object.defineProperty(Vw,"__esModule",{value:!0});Vw.Storage=void 0;class Tqe{}Vw.Storage=Tqe;var II={};Object.defineProperty(II,"__esModule",{value:!0});II.LocalStorage=void 0;const Rqe=Vw;class Cqe extends Rqe.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)}}}II.LocalStorage=Cqe;(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(Vw,t),r(II,t)})(ace);var OI={};Object.defineProperty(OI,"__esModule",{value:!0});OI.ProviderAdapter=void 0;class aL{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 aL(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)}}OI.ProviderAdapter=aL;Object.defineProperty(Ny,"__esModule",{value:!0});Ny.connection=Ny.ConnectionManager=void 0;const tQ=is(),Vo=Sc,ME=$4e,df=uk,Nqe=ace,GN=Hs,rQ=OI;class oce{constructor(e){this.storage=e,this.getWalletName=()=>{if(this.connector instanceof df.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:r}=GN.getConfiguration();this.storage.remove(r),df.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(ME.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(ME.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(e,r=tQ.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(e,r),this.connector.on(ME.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),e===Vo.ProviderType.MAGIC&&this.connector.on(ME.ConnectorEvent.Update,({chainId:a})=>{a&&this.setConnectionData(e,a)});const{provider:n,account:i}=await this.connector.activate();return this.setConnectionData(e,r),{provider:rQ.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=tQ.ChainId.ETHEREUM_MAINNET){const i=await this.buildConnector(e,r).getProvider();return rQ.ProviderAdapter.adapt(i)}buildConnector(e,r){switch(e){case Vo.ProviderType.INJECTED:return new df.InjectedConnector(r);case Vo.ProviderType.FORTMATIC:return new df.FortmaticConnector(r);case Vo.ProviderType.MAGIC:return new df.MagicConnector(r);case Vo.ProviderType.WALLET_LINK:return new df.WalletLinkConnector(r);case Vo.ProviderType.NETWORK:return new df.NetworkConnector(r);case Vo.ProviderType.WALLET_CONNECT_V2:return new df.WalletConnectV2Connector(r);default:throw new Error(`Invalid provider ${e}`)}}getConnectionData(){const{storageKey:e}=GN.getConfiguration(),r=this.storage.get(e);return r?JSON.parse(r):void 0}setConnectionData(e,r){const{storageKey:n}=GN.getConfiguration(),i=JSON.stringify({providerType:e,chainId:r});this.storage.set(n,i)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}Ny.ConnectionManager=oce;Ny.connection=new oce(new Nqe.LocalStorage);var sce={};Object.defineProperty(sce,"__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(Ny,t),r(uk,t),r(Hs,t),r(sce,t)})(fd);const Dqe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/ManDefault-cb03f4f3.webp",$qe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/Platform-dfc6309e.webp";function Gw(){return window.analytics}const oL=()=>{qe.useEffect(()=>{const t=Gw();t&&t.page()},[])};var Ic=(t=>(t.LOGIN_CLICK="Click Login Button",t.LOGIN_SUCCESS="Login Success",t.LOGIN_ERROR="Login Error",t.CLICK="Click Button",t))(Ic||{}),Y0=(t=>(t.LEARN_MORE="Learn More",t.DENY_SIGN_IN="Deny Sign In",t.DENY_WALLET_INTERACTION="Deny Wallet Interaction",t.APPROVE_SING_IN="Approve Sign In",t.APPROVE_WALLET_INTERACTION="Approve Wallet Interaction",t))(Y0||{}),C5=(t=>(t.WEB3="web3",t.WEB2="web2",t.GUEST="guest",t))(C5||{});const Mqe="https://auth-api.decentraland.zone",kqe="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",Lqe="https://peer.decentraland.zone",Uqe={AUTH_SERVER_URL:Mqe,SEGMENT_API_KEY:kqe,PEER_URL:Lqe},Bqe="https://auth-api.decentraland.org",Fqe="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",jqe="https://peer.decentraland.org",qqe={AUTH_SERVER_URL:Bqe,SEGMENT_API_KEY:Fqe,PEER_URL:jqe},Hqe="https://auth-api.decentraland.today",zqe="FQqbzV2KeUKe2RPOeFkedKRPkJAFsU9r",Vqe="https://peer.decentraland.org",Gqe={AUTH_SERVER_URL:Hqe,SEGMENT_API_KEY:zqe,PEER_URL:Vqe},sL=G0.createConfig({[G0.Env.DEVELOPMENT]:Uqe,[G0.Env.STAGING]:Gqe,[G0.Env.PRODUCTION]:qqe},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});function Ux(t){return t!=null&&typeof t=="object"&&"message"in t}async function Wqe(t){const e=sL.get("PEER_URL"),r=await fetch(`${e}/content/entities/profile?pointer=${t}`);return r.ok?await r.json():[]}const Kqe="_background_s9giu_1",Yqe="_emptyProfile_s9giu_11",Qqe="_main_s9giu_27",Jqe="_left_s9giu_38",Xqe="_right_s9giu_49",Zqe="_wearablePlatform_s9giu_64",eHe="_changeAccount_s9giu_70",tHe="_errorLogo_s9giu_83",rHe="_logo_s9giu_92",nHe="_title_s9giu_98",iHe="_description_s9giu_105",aHe="_code_s9giu_112",oHe="_buttons_s9giu_119",sHe="_closeWindow_s9giu_129",cHe="_errorMessage_s9giu_135",uHe="_noButton_s9giu_145",lHe="_yesButton_s9giu_147",fHe="_wearableDefaultImg_s9giu_164",dHe="_loading_s9giu_176",hHe="_discordBtn_s9giu_180",pHe="_discordInfo_s9giu_193",pr={background:Kqe,emptyProfile:Yqe,main:Qqe,left:Jqe,right:Xqe,wearablePlatform:Zqe,changeAccount:eHe,errorLogo:tHe,logo:rHe,title:nHe,description:iHe,code:aHe,buttons:oHe,closeWindow:sHe,errorMessage:cHe,noButton:uHe,yesButton:lHe,wearableDefaultImg:fHe,loading:dHe,discordBtn:hHe,discordInfo:pHe},gHe=()=>{oL();const t=Gw(),e=Qye(),r=L2(),n=qe.useRef(),[i,a]=qe.useState(2),[o,s]=qe.useState(!1),[c,u]=qe.useState(null),f=qe.useRef(),[d,g]=qe.useState(),m=qe.useRef(),w=qe.useRef(),v=e.requestId??"",[y,_]=qe.useState(!1),b=qe.useCallback(()=>{r(`/login?redirectTo=/auth/requests/${v}&fromRequests=true`)},[]);qe.useEffect(()=>((async()=>{try{const M=await fd.connection.tryPreviousConnection();n.current=new bte(M.provider)}catch{b();return}try{const j=await(await n.current.getSigner()).getAddress();t.identify({ethAddress:j});const ce=await kE("recover",{requestId:v});f.current=ce;const he=await Wqe(j);if(u(he.length?he[0]:null),w.current=j,_(!0),ce.sender&&ce.sender!==j.toLowerCase()){a(1);return}m.current=setTimeout(()=>{a(0)},new Date(ce.expiration).getTime()-Date.now()),ce.method==="dcl_personal_sign"?a(4):a(8)}catch(M){g(Ux(M)?M.message:"Unknown error"),a(3)}})(),()=>{clearTimeout(m.current)}),[]),qe.useEffect(()=>{i!==4&&i!==8&&clearTimeout(m.current)},[i]);const S=qe.useCallback(()=>{t.track(Ic.CLICK,{action:Y0.DENY_SIGN_IN}),a(5)},[t]),x=qe.useCallback(M=>{w.current&&M.profile===w.current&&_(!1)},[]),I=qe.useCallback(async()=>{t.track(Ic.CLICK,{action:Y0.APPROVE_SING_IN}),s(!0);const M=n.current;try{if(!M)throw new Error("Provider not created");const j=await M.getSigner(),ce=await j.signMessage(f.current.params[0]),he=await kE("outcome",{requestId:v,sender:await j.getAddress(),result:ce});if(he.error)throw new Error(he.error);a(7)}catch(j){g(Ux(j)?j.message:"Unknown error"),a(6)}finally{s(!1)}},[s,t]),E=qe.useCallback(()=>{t.track(Ic.CLICK,{action:Y0.DENY_WALLET_INTERACTION}),a(9)},[t]),p=qe.useCallback(async()=>{var j,ce,he;s(!0);const M=n.current;try{if(!M)throw new Error("Provider not created");const B=await M.getSigner(),U=await M.send(f.current.method,f.current.params);t.track(Ic.CLICK,{action:Y0.APPROVE_WALLET_INTERACTION,method:f.current.method});const K=await kE("outcome",{requestId:v,sender:await B.getAddress(),result:U});if(K.error)throw new Error(K.error);a(11)}catch(B){console.log("Wallet error",JSON.stringify((j=B.info)==null?void 0:j.error));const U=await((ce=n.current)==null?void 0:ce.getSigner());U&&await kE("outcome",{requestId:v,sender:await U.getAddress(),result:((he=B.info)==null?void 0:he.error)??"Unknown error"}),g(Ux(B)?B.message:"Unknown error"),a(10)}},[t]),O=qe.useCallback(async M=>{M.preventDefault(),await fd.connection.disconnect(),b()},[]),C=qe.useCallback(M=>je.jsxs("div",{children:[je.jsx("div",{className:`${pr.background} ${(!w||c===null)&&i!==2?pr.emptyProfile:""}`}),je.jsxs("div",{className:pr.main,children:[je.jsxs("div",{className:pr.left,children:[M.children,M.canChangeAccount?je.jsxs("div",{className:pr.changeAccount,children:["Use another profile?"," ",je.jsx("a",{href:"/auth/login",onClick:O,children:"Return to log in"})]}):null]}),je.jsx("div",{className:`${pr.right} ${y?pr.loading:""}`,children:w.current&&c!==null?je.jsxs(je.Fragment,{children:[je.jsx("img",{src:Dqe,alt:"Avatar",className:pr.wearableDefaultImg}),je.jsx(dae,{lockBeta:!0,panning:!1,disableBackground:!0,profile:w.current,dev:!1,onUpdate:x}),je.jsx("img",{src:$qe,alt:"platform",className:pr.wearablePlatform})]}):null}),je.jsxs("a",{className:pr.discordBtn,href:"https://decentraland.org/discord",target:"about:blank",children:[je.jsx(Bb,{name:"discord"}),je.jsxs("p",{className:pr.discordInfo,children:[je.jsx("span",{children:"Need guidance?"}),je.jsx("span",{children:"MEET THE COMMUNITY"})]})]})]})]}),[y,i]);return i===0?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Looks like you took too long and the request has expired"}),je.jsx("div",{className:pr.description,children:"Please return to Decentraland's Desktop App to try again."}),je.jsx(oh,{})]}):i===1?je.jsxs(C,{canChangeAccount:!0,children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Looks like you are connected with a different account."}),je.jsx("div",{className:pr.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):i===2?je.jsx(C,{children:je.jsx("div",{className:pr.left,children:je.jsx(NS,{active:!0,size:"huge"})})}):i===3?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"There was an error recovering the request..."}),je.jsx("div",{className:pr.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),je.jsx(oh,{}),je.jsx("div",{className:pr.errorMessage,children:d})]}):i===4&&f.current?je.jsxs(C,{canChangeAccount:!0,isLoading:o,children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"Verify Sign In"}),je.jsx("div",{className:pr.description,children:"Do you see the same verification number on your Desktop App?"}),je.jsx("div",{className:pr.code,children:f.current.code}),je.jsxs("div",{className:pr.buttons,children:[je.jsxs(Pc.Button,{inverted:!0,disabled:o,onClick:S,className:pr.noButton,children:[je.jsx(Bb,{name:"times circle"}),"No, it doesn't"]}),je.jsxs(Pc.Button,{inverted:!0,loading:o,disabled:o,onClick:I,className:pr.yesButton,children:[je.jsx(Bb,{name:"check circle"}),"Yes, they are the same"]})]})]}):i===5?je.jsxs(C,{canChangeAccount:!0,children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Did the number not match, or was this action not taken by you?"}),je.jsx("div",{className:pr.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(oh,{})]}):i===7?je.jsxs(C,{children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"Your account is ready!"}),je.jsx("div",{className:pr.description,children:"Return to the Desktop App and enjoy Decentraland."}),je.jsx(oh,{})]}):i===8&&f.current?je.jsxs(C,{canChangeAccount:!0,isLoading:o,children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"The Desktop App wants to interact with your wallet."}),je.jsx("div",{className:pr.description,children:"Review the following data carefully on your wallet before approving it."}),je.jsxs("div",{className:pr.buttons,children:[je.jsx(Pc.Button,{inverted:!0,disabled:o,onClick:E,children:"Deny"}),je.jsx(Pc.Button,{primary:!0,disabled:o,loading:o,onClick:p,children:"Allow"})]})]}):i===9?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"Was this action not initiated by you?"}),je.jsx("div",{className:pr.description,children:"If this action was not initiated by you, dismiss this message."}),je.jsx(oh,{})]}):i===11?je.jsxs(C,{children:[je.jsx("div",{className:pr.logo}),je.jsx("div",{className:pr.title,children:"Wallet interaction complete"}),je.jsx("div",{className:pr.description,children:"The action has been executed successfully."}),je.jsx(oh,{})]}):i===6||i===10?je.jsxs(C,{children:[je.jsx("div",{className:pr.errorLogo}),je.jsx("div",{className:pr.title,children:"There was an error while trying to submit the request."}),je.jsx("div",{className:pr.description,children:"Return to the Desktop App to try again, or contact support if the error persists."}),je.jsx(oh,{}),je.jsx("div",{className:pr.errorMessage,children:d})]}):null},oh=()=>je.jsx("div",{className:pr.closeWindow,children:"You can close this window."}),kE=async(t,e)=>{const r=sL.get("AUTH_SERVER_URL"),n=gx(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},yHe="_main_qbssu_1",mHe={main:yHe},vHe=()=>{const t=L2(),e=gw(),r=qe.useCallback(async()=>{try{const n=await fd.connection.tryPreviousConnection();return!!(n.account&&n.provider)}catch{return!1}},[]);return qe.useEffect(()=>{r().then(n=>{n?window.location.href="/":t({pathname:"/login",search:e.search})})},[r,t]),je.jsx("div",{className:mHe.main,children:je.jsx(NS,{active:!0,size:"huge"})})};var Ww={},PI={},WN,nQ;function bHe(){if(nQ)return WN;nQ=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 WN=t,WN}var KN,iQ;function wHe(){if(iQ)return KN;iQ=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 KN=t,KN}var YN,aQ;function cce(){if(aQ)return YN;aQ=1;var t=bHe(),e=Iw(),r=_d(),n=wHe(),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 YN=a,YN}var QN,oQ;function uce(){return oQ||(oQ=1,QN=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}),QN}var LE={},sQ;function _He(){if(sQ)return LE;sQ=1;var t=wr;LE.__esModule=!0;var e=t(Zy);return LE.default=e.default,LE}var qv={},UE={},cQ;function EHe(){if(cQ)return UE;cQ=1;var t=wr;UE.__esModule=!0;var e=t(Z$());return UE.default=e.default,UE}var uQ;function xHe(){if(uQ)return qv;uQ=1;var t=Ks,e=wr;qv.__esModule=!0,qv.default=void 0;var r=e(Bn()),n=e(Lc()),i=e(pS()),a=e(Ys()),o=e(ii);e(Ln());var s=t(qe),c=Wn(),u=e(EHe()),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,I){(0,a.default)(b,"onClick",x,I),(0,a.default)(w.props,"onActionClick",x,I)}}},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,I=(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:I}),(0,i.default)(_,function(O){return u.default.create(O,{overrideProps:v.handleButtonOverrides})})):s.default.createElement(p,(0,r.default)({},E,{className:I}),x):s.default.createElement(p,(0,r.default)({},E,{className:I}),b)},g}(s.Component);return qv.default=f,f.handledProps=["actions","as","children","className","content","onActionClick"],f.propTypes={},f.create=(0,c.createShorthandFactory)(f,function(d){return{actions:d}}),qv}var Hv={},lQ;function lce(){if(lQ)return Hv;lQ=1;var t=wr;Hv.__esModule=!0,Hv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=s.image,g=s.scrolling,m=(0,r.default)(u,(0,i.useKeyOnly)(d,"image"),(0,i.useKeyOnly)(g,"scrolling"),"content"),w=(0,i.getUnhandledProps)(a,s),v=(0,i.getElementType)(a,s);return n.default.createElement(v,(0,e.default)({},w,{className:m}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content","image","scrolling"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(s){return{content:s}});var o=a;return Hv.default=o,Hv}var zv={},fQ;function AHe(){if(fQ)return zv;fQ=1;var t=wr;zv.__esModule=!0,zv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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 zv.default=o,zv}var Vv={},dQ;function SHe(){if(dQ)return Vv;dQ=1;var t=wr;Vv.__esModule=!0,Vv.default=void 0;var e=t(Bn()),r=Ed,n=t(ii);t(Ln());var i=t(qe),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),I=(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(I,(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 Vv.default=s,Vv}var Gv={},hQ;function IHe(){if(hQ)return Gv;hQ=1;var t=wr;Gv.__esModule=!0,Gv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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 Gv.default=o,Gv}var Ku={},pQ;function OHe(){if(pQ)return Ku;pQ=1,Ku.__esModule=!0,Ku.isLegacy=Ku.getLegacyStyles=Ku.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};Ku.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}};Ku.getLegacyStyles=n;var i=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return Ku.isLegacy=i,Ku}var PHe=Ks,ta=wr;PI.__esModule=!0;PI.default=void 0;var _0=ta(Bn()),THe=ta(Lc()),RHe=ta(hS()),CHe=ta(U$()),NHe=ta(F$()),DHe=ta(cce()),$He=ta(ore()),hf=ta(Ys()),gQ=Ed,MHe=ta(ii);ta(Ln());var Yu=PHe(qe),kHe=ta(uce()),Pa=Wn(),LHe=ta(_He()),yQ=ta(X$()),fce=ta(xHe()),dce=ta(lce()),UHe=ta(AHe()),hce=ta(SHe()),pce=ta(IHe()),JN=OHe(),Tu=function(t){(0,THe.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,JN.isLegacy)(),n.ref=(0,Yu.createRef)(),n.dimmerRef=(0,Yu.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,hf.default)(s,"onActionClick",u,f),(0,hf.default)(n.props,"onActionClick",u,n.props),n.handleClose(u)}}},n.handleClose=function(s){n.setState({open:!1}),(0,hf.default)(n.props,"onClose",s,(0,_0.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,hf.default)(n.props,"onClose",s,(0,_0.default)({},n.props,{open:!1})))},n.handleIconOverrides=function(s){return{onClick:function(u){(0,hf.default)(s,"onClick",u),n.handleClose(u)}}},n.handleOpen=function(s){(0,hf.default)(n.props,"onOpen",s,(0,_0.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,hf.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,hf.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,JN.canFit)(f);c=!d;var g=n.legacy?(0,JN.getLegacyStyles)(d,s,f):{};(0,kHe.default)(n.state.legacyStyles,g)||(u.legacyStyles=g),n.state.scrolling!==c&&(u.scrolling=c)}(0,$He.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,I=(0,MHe.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,O=LHe.default.create(p,{overrideProps:n.handleIconOverrides});return Yu.default.createElement(gQ.Ref,{innerRef:n.ref},Yu.default.createElement(E,(0,_0.default)({},s,{className:I,style:(0,_0.default)({},S,_)}),O,Pa.childrenUtils.isNil(d)?Yu.default.createElement(Yu.default.Fragment,null,pce.default.create(v,{autoGenerateKey:!1}),dce.default.create(w,{autoGenerateKey:!1}),fce.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,Yu.isValidElement)(u)?u:null;var w=(0,Pa.getUnhandledProps)(e,this.props),v=yQ.default.handledProps,y=(0,DHe.default)(w,function(b,S,x){return(0,NHe.default)(v,x)||(b[x]=S),b},{}),_=(0,CHe.default)(w,v);return Yu.default.createElement(yQ.default,(0,_0.default)({closeOnDocumentClick:o},_,{trigger:u,eventPool:c,mountNode:m,open:d,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),Yu.default.createElement(gQ.Ref,{innerRef:this.dimmerRef},hce.default.create((0,RHe.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);Tu.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"];Tu.propTypes={};Tu.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Tu.autoControlledProps=["open"];Tu.Actions=fce.default;Tu.Content=dce.default;Tu.Description=UHe.default;Tu.Dimmer=hce.default;Tu.Header=pce.default;var BHe=Tu;PI.default=BHe;(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=PI;Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return e(r).default}})})(Ww);const gce=()=>{const t=gw(),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}},N5=t=>new Promise(e=>setTimeout(e,t));var FHe=lce();const cL=Mc(FHe);var uL={};var jHe=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)}}(),qHe=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]}),HHe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zHe=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)&&qHe(e,t,r);return HHe(e,t),e};Object.defineProperty(uL,"__esModule",{value:!0});var TI=uL.ModalNavigation=void 0,sh=zHe(qe),VHe=function(t){jHe(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 sh.createElement("div",{className:"dcl modal-navigation"},sh.createElement("div",{className:"dcl modal-navigation-title"},n),i&&sh.createElement("div",{className:"dcl modal-navigation-subtitle"},i),a&&sh.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:a}),s&&sh.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:s}),o&&sh.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:o}))},e}(sh.PureComponent);TI=uL.ModalNavigation=VHe;const GHe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/warning-057948e8.svg";var fi=(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.WAITING_FOR_CONFIRMATION="WAITING_FOR_CONFIRMATION",t))(fi||{});function WHe(t,e){switch(t){case fi.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case fi.CONNECTING_WALLET:case fi.WAITING_FOR_SIGNATURE:return e===kl.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case fi.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case fi.LOADING_MAGIC:return"Redirecting..."}}const KHe="_main_1qx1l_1",YHe="_content_1qx1l_8",QHe="_errorImage_1qx1l_16",JHe="_message_1qx1l_22",XHe="_loader_1qx1l_29",Wv={main:KHe,content:YHe,errorImage:QHe,message:JHe,loader:XHe},yce=t=>{const{open:e,state:r,providerType:n,onClose:i,onTryAgain:a}=t,o=r===fi.CONNECTING_WALLET||r===fi.WAITING_FOR_SIGNATURE||r===fi.LOADING_MAGIC||r===fi.VALIDATING_SIGN_IN;return je.jsxs(Ww.Modal,{size:"tiny",open:e,children:[je.jsx(TI,{title:"",onClose:o?void 0:i}),je.jsx("div",{className:Wv.main,children:je.jsxs("div",{className:Wv.content,children:[r===fi.ERROR&&je.jsx("img",{className:Wv.errorImage,src:GHe}),o&&je.jsx(NS,{className:Wv.loader,size:"huge",inline:!0}),je.jsx("p",{className:Wv.message,children:WHe(r,n)}),r===fi.ERROR&&je.jsx(Pc.Button,{primary:!0,onClick:a,children:"Try again"})]})}),je.jsx(cL,{})]})};var mce={},vce={},D5={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((pe,Se)=>{P=Ce=>{pe(Ce),W.isPending=!1},D=Ce=>{Se(Ce),W.isPending=!1}}).catch(pe=>Promise.reject(pe));return W.resolve=P,W.reject=D,"finally"in W||(W.finally=pe=>{W.then(pe),W.catch(pe)}),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})()})(Dce);var Jze=Dce.exports;const gp=Mc(Jze),Xze="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/logo-9a364aec.svg";var Qv={},ZN,wQ;function Zze(){if(wQ)return ZN;wQ=1;var t=Uc(),e=hS();function r(n){return t(n)&&n.nodeType===1&&!e(n)}return ZN=r,ZN}var $ce=qe.createContext(),Mce=qe.createContext();function eVe(t){var e=t.children,r=qe.useState(null),n=r[0],i=r[1],a=qe.useRef(!1);qe.useEffect(function(){return function(){a.current=!0}},[]);var o=qe.useCallback(function(s){a.current||i(s)},[]);return qe.createElement($ce.Provider,{value:n},qe.createElement(Mce.Provider,{value:o},e))}var kce=function(e){return Array.isArray(e)?e[0]:e},Lce=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)}},q5=function(e,r){if(typeof e=="function")return Lce(e,r);e!=null&&(e.current=r)},_Q=function(e){return e.reduce(function(r,n){var i=n[0],a=n[1];return r[i]=a,r},{})},EQ=typeof window<"u"&&window.document&&window.document.createElement?qe.useLayoutEffect:qe.useEffect,Mo="top",Vs="bottom",Gs="right",ko="left",wL="auto",Kw=[Mo,Vs,Gs,ko],ky="start",B1="end",tVe="clippingParents",Uce="viewport",Jv="popper",rVe="reference",xQ=Kw.reduce(function(t,e){return t.concat([e+"-"+ky,e+"-"+B1])},[]),Bce=[].concat(Kw,[wL]).reduce(function(t,e){return t.concat([e,e+"-"+ky,e+"-"+B1])},[]),nVe="beforeRead",iVe="read",aVe="afterRead",oVe="beforeMain",sVe="main",cVe="afterMain",uVe="beforeWrite",lVe="write",fVe="afterWrite",dVe=[nVe,iVe,aVe,oVe,sVe,cVe,uVe,lVe,fVe];function Iu(t){return t?(t.nodeName||"").toLowerCase():null}function ts(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function yp(t){var e=ts(t).Element;return t instanceof e||t instanceof Element}function Fs(t){var e=ts(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function _L(t){if(typeof ShadowRoot>"u")return!1;var e=ts(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function hVe(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];!Fs(a)||!Iu(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 pVe(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},{});!Fs(i)||!Iu(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const gVe={name:"applyStyles",enabled:!0,phase:"write",fn:hVe,effect:pVe,requires:["computeStyles"]};function _u(t){return t.split("-")[0]}var rp=Math.max,f2=Math.min,Ly=Math.round;function H5(){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 Fce(){return!/^((?!chrome|android).)*safari/i.test(H5())}function Uy(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Fs(t)&&(i=t.offsetWidth>0&&Ly(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&Ly(n.height)/t.offsetHeight||1);var o=yp(t)?ts(t):window,s=o.visualViewport,c=!Fce()&&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 EL(t){var e=Uy(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 jce(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&_L(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ll(t){return ts(t).getComputedStyle(t)}function yVe(t){return["table","td","th"].indexOf(Iu(t))>=0}function Nd(t){return((yp(t)?t.ownerDocument:t.document)||window.document).documentElement}function LI(t){return Iu(t)==="html"?t:t.assignedSlot||t.parentNode||(_L(t)?t.host:null)||Nd(t)}function AQ(t){return!Fs(t)||Ll(t).position==="fixed"?null:t.offsetParent}function mVe(t){var e=/firefox/i.test(H5()),r=/Trident/i.test(H5());if(r&&Fs(t)){var n=Ll(t);if(n.position==="fixed")return null}var i=LI(t);for(_L(i)&&(i=i.host);Fs(i)&&["html","body"].indexOf(Iu(i))<0;){var a=Ll(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 Yw(t){for(var e=ts(t),r=AQ(t);r&&yVe(r)&&Ll(r).position==="static";)r=AQ(r);return r&&(Iu(r)==="html"||Iu(r)==="body"&&Ll(r).position==="static")?e:r||mVe(t)||e}function xL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Jb(t,e,r){return rp(t,f2(e,r))}function vVe(t,e,r){var n=Jb(t,e,r);return n>r?r:n}function qce(){return{top:0,right:0,bottom:0,left:0}}function Hce(t){return Object.assign({},qce(),t)}function zce(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var bVe=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Hce(typeof e!="number"?e:zce(e,Kw))};function wVe(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=_u(r.placement),c=xL(s),u=[ko,Gs].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!o)){var d=bVe(i.padding,r),g=EL(a),m=c==="y"?Mo:ko,w=c==="y"?Vs:Gs,v=r.rects.reference[f]+r.rects.reference[c]-o[c]-r.rects.popper[f],y=o[c]-r.rects.reference[c],_=Yw(a),b=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-y/2,x=d[m],I=b-g[f]-d[w],E=b/2-g[f]/2+S,p=Jb(x,E,I),O=c;r.modifiersData[n]=(e={},e[O]=p,e.centerOffset=p-E,e)}}function _Ve(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)||jce(e.elements.popper,i)&&(e.elements.arrow=i))}const EVe={name:"arrow",enabled:!0,phase:"main",fn:wVe,effect:_Ve,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function By(t){return t.split("-")[1]}var xVe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function AVe(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:Ly(r*i)/i||0,y:Ly(n*i)/i||0}}function SQ(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,I=window;if(u){var E=Yw(r),p="clientHeight",O="clientWidth";if(E===ts(r)&&(E=Nd(r),Ll(E).position!=="static"&&s==="absolute"&&(p="scrollHeight",O="scrollWidth")),E=E,i===Mo||(i===ko||i===Gs)&&a===B1){x=Vs;var C=d&&E===I&&I.visualViewport?I.visualViewport.height:E[p];v-=C-n.height,v*=c?1:-1}if(i===ko||(i===Mo||i===Vs)&&a===B1){S=Gs;var M=d&&E===I&&I.visualViewport?I.visualViewport.width:E[O];m-=M-n.width,m*=c?1:-1}}var j=Object.assign({position:s},u&&xVe),ce=f===!0?AVe({x:m,y:v},ts(r)):{x:m,y:v};if(m=ce.x,v=ce.y,c){var he;return Object.assign({},j,(he={},he[x]=b?"0":"",he[S]=_?"0":"",he.transform=(I.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",he))}return Object.assign({},j,(e={},e[x]=b?v+"px":"",e[S]=_?m+"px":"",e.transform="",e))}function SVe(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:_u(e.placement),variation:By(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,SQ(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,SQ(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 IVe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:SVe,data:{}};var BE={passive:!0};function OVe(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=ts(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",r.update,BE)}),s&&c.addEventListener("resize",r.update,BE),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",r.update,BE)}),s&&c.removeEventListener("resize",r.update,BE)}}const PVe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:OVe,data:{}};var TVe={left:"right",right:"left",bottom:"top",top:"bottom"};function Bx(t){return t.replace(/left|right|bottom|top/g,function(e){return TVe[e]})}var RVe={start:"end",end:"start"};function IQ(t){return t.replace(/start|end/g,function(e){return RVe[e]})}function AL(t){var e=ts(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function SL(t){return Uy(Nd(t)).left+AL(t).scrollLeft}function CVe(t,e){var r=ts(t),n=Nd(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Fce();(u||!u&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+SL(t),y:c}}function NVe(t){var e,r=Nd(t),n=AL(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=rp(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=rp(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+SL(t),c=-n.scrollTop;return Ll(i||r).direction==="rtl"&&(s+=rp(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function IL(t){var e=Ll(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Vce(t){return["html","body","#document"].indexOf(Iu(t))>=0?t.ownerDocument.body:Fs(t)&&IL(t)?t:Vce(LI(t))}function Xb(t,e){var r;e===void 0&&(e=[]);var n=Vce(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),a=ts(n),o=i?[a].concat(a.visualViewport||[],IL(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(Xb(LI(o)))}function z5(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function DVe(t,e){var r=Uy(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 OQ(t,e,r){return e===Uce?z5(CVe(t,r)):yp(e)?DVe(e,r):z5(NVe(Nd(t)))}function $Ve(t){var e=Xb(LI(t)),r=["absolute","fixed"].indexOf(Ll(t).position)>=0,n=r&&Fs(t)?Yw(t):t;return yp(n)?e.filter(function(i){return yp(i)&&jce(i,n)&&Iu(i)!=="body"}):[]}function MVe(t,e,r,n){var i=e==="clippingParents"?$Ve(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(c,u){var f=OQ(t,u,n);return c.top=rp(f.top,c.top),c.right=f2(f.right,c.right),c.bottom=f2(f.bottom,c.bottom),c.left=rp(f.left,c.left),c},OQ(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 Gce(t){var e=t.reference,r=t.element,n=t.placement,i=n?_u(n):null,a=n?By(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 Vs:c={x:o,y:e.y+e.height};break;case Gs: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?xL(i):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case ky:c[u]=c[u]-(e[f]/2-r[f]/2);break;case B1:c[u]=c[u]+(e[f]/2-r[f]/2);break}}return c}function F1(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?tVe:s,u=r.rootBoundary,f=u===void 0?Uce:u,d=r.elementContext,g=d===void 0?Jv:d,m=r.altBoundary,w=m===void 0?!1:m,v=r.padding,y=v===void 0?0:v,_=Hce(typeof y!="number"?y:zce(y,Kw)),b=g===Jv?rVe:Jv,S=t.rects.popper,x=t.elements[w?b:g],I=MVe(yp(x)?x:x.contextElement||Nd(t.elements.popper),c,f,o),E=Uy(t.elements.reference),p=Gce({reference:E,element:S,strategy:"absolute",placement:i}),O=z5(Object.assign({},S,p)),C=g===Jv?O:E,M={top:I.top-C.top+_.top,bottom:C.bottom-I.bottom+_.bottom,left:I.left-C.left+_.left,right:C.right-I.right+_.right},j=t.modifiersData.offset;if(g===Jv&&j){var ce=j[i];Object.keys(M).forEach(function(he){var B=[Gs,Vs].indexOf(he)>=0?1:-1,U=[Mo,Vs].indexOf(he)>=0?"y":"x";M[he]+=ce[U]*B})}return M}function kVe(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?Bce:c,f=By(n),d=f?s?xQ:xQ.filter(function(w){return By(w)===f}):Kw,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]=F1(t,{placement:v,boundary:i,rootBoundary:a,padding:o})[_u(v)],w},{});return Object.keys(m).sort(function(w,v){return m[w]-m[v]})}function LVe(t){if(_u(t)===wL)return[];var e=Bx(t);return[IQ(t),e,IQ(e)]}function UVe(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,_=_u(y),b=_===y,S=c||(b||!w?[Bx(y)]:LVe(y)),x=[y].concat(S).reduce(function(k,G){return k.concat(_u(G)===wL?kVe(e,{placement:G,boundary:f,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:v}):G)},[]),I=e.rects.reference,E=e.rects.popper,p=new Map,O=!0,C=x[0],M=0;M<x.length;M++){var j=x[M],ce=_u(j),he=By(j)===ky,B=[Mo,Vs].indexOf(ce)>=0,U=B?"width":"height",K=F1(e,{placement:j,boundary:f,rootBoundary:d,altBoundary:g,padding:u}),ne=B?he?Gs:ko:he?Vs:Mo;I[U]>E[U]&&(ne=Bx(ne));var F=Bx(ne),q=[];if(a&&q.push(K[ce]<=0),s&&q.push(K[ne]<=0,K[F]<=0),q.every(function(k){return k})){C=j,O=!1;break}p.set(j,q)}if(O)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(ue){return ue})});if(ge)return C=ge,"break"},H=z;H>0;H--){var L=$(H);if(L==="break")break}e.placement!==C&&(e.modifiersData[n]._skip=!0,e.placement=C,e.reset=!0)}}const BVe={name:"flip",enabled:!0,phase:"main",fn:UVe,requiresIfExists:["offset"],data:{_skip:!1}};function PQ(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 TQ(t){return[Mo,Gs,Vs,ko].some(function(e){return t[e]>=0})}function FVe(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=F1(e,{elementContext:"reference"}),s=F1(e,{altBoundary:!0}),c=PQ(o,n),u=PQ(s,i,a),f=TQ(c),d=TQ(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 jVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:FVe};function qVe(t,e,r){var n=_u(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,Gs].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function HVe(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=i===void 0?[0,0]:i,o=Bce.reduce(function(f,d){return f[d]=qVe(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 zVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:HVe};function VVe(t){var e=t.state,r=t.name;e.modifiersData[r]=Gce({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const GVe={name:"popperOffsets",enabled:!0,phase:"read",fn:VVe,data:{}};function WVe(t){return t==="x"?"y":"x"}function KVe(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=F1(e,{boundary:c,rootBoundary:u,padding:d,altBoundary:f}),_=_u(e.placement),b=By(e.placement),S=!b,x=xL(_),I=WVe(x),E=e.modifiersData.popperOffsets,p=e.rects.reference,O=e.rects.popper,C=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,M=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),j=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ce={x:0,y:0};if(E){if(a){var he,B=x==="y"?Mo:ko,U=x==="y"?Vs:Gs,K=x==="y"?"height":"width",ne=E[x],F=ne+y[B],q=ne-y[U],z=m?-O[K]/2:0,$=b===ky?p[K]:O[K],H=b===ky?-O[K]:-p[K],L=e.elements.arrow,k=m&&L?EL(L):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:qce(),ge=G[B],Q=G[U],te=Jb(0,p[K],k[K]),ue=S?p[K]/2-z-te-ge-M.mainAxis:$-te-ge-M.mainAxis,T=S?-p[K]/2+z+te+Q+M.mainAxis:H+te+Q+M.mainAxis,fe=e.elements.arrow&&Yw(e.elements.arrow),Ge=fe?x==="y"?fe.clientTop||0:fe.clientLeft||0:0,tt=(he=j==null?void 0:j[x])!=null?he:0,mt=ne+ue-tt-Ge,vt=ne+T-tt,gt=Jb(m?f2(F,mt):F,ne,m?rp(q,vt):q);E[x]=gt,ce[x]=gt-ne}if(s){var Lt,Yt=x==="x"?Mo:ko,_r=x==="x"?Vs:Gs,Rt=E[I],Pt=I==="y"?"height":"width",kt=Rt+y[Yt],Nt=Rt-y[_r],Kt=[Mo,ko].indexOf(_)!==-1,Ut=(Lt=j==null?void 0:j[I])!=null?Lt:0,zt=Kt?kt:Rt-p[Pt]-O[Pt]-Ut+M.altAxis,$t=Kt?Rt+p[Pt]+O[Pt]-Ut-M.altAxis:Nt,Dt=m&&Kt?vVe(zt,Rt,$t):Jb(m?zt:kt,Rt,m?$t:Nt);E[I]=Dt,ce[I]=Dt-Rt}e.modifiersData[n]=ce}}const YVe={name:"preventOverflow",enabled:!0,phase:"main",fn:KVe,requiresIfExists:["offset"]};function QVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function JVe(t){return t===ts(t)||!Fs(t)?AL(t):QVe(t)}function XVe(t){var e=t.getBoundingClientRect(),r=Ly(e.width)/t.offsetWidth||1,n=Ly(e.height)/t.offsetHeight||1;return r!==1||n!==1}function ZVe(t,e,r){r===void 0&&(r=!1);var n=Fs(e),i=Fs(e)&&XVe(e),a=Nd(e),o=Uy(t,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Iu(e)!=="body"||IL(a))&&(s=JVe(e)),Fs(e)?(c=Uy(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=SL(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function eGe(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 tGe(t){var e=eGe(t);return dVe.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function rGe(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function nGe(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 RQ={placement:"bottom",modifiers:[],strategy:"absolute"};function CQ(){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 iGe(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,a=i===void 0?RQ:i;return function(s,c,u){u===void 0&&(u=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},RQ,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:yp(s)?Xb(s):s.contextElement?Xb(s.contextElement):[],popper:Xb(c)};var S=tGe(nGe([].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(CQ(b,S)){f.rects={reference:ZVe(b,Yw(S),f.options.strategy==="fixed"),popper:EL(S)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(M){return f.modifiersData[M.name]=Object.assign({},M.data)});for(var x=0;x<f.orderedModifiers.length;x++){if(f.reset===!0){f.reset=!1,x=-1;continue}var I=f.orderedModifiers[x],E=I.fn,p=I.options,O=p===void 0?{}:p,C=I.name;typeof E=="function"&&(f=E({state:f,options:O,name:C,instance:m})||f)}}}},update:rGe(function(){return new Promise(function(y){m.forceUpdate(),y(f)})}),destroy:function(){v(),g=!0}};if(!CQ(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 I=x({state:f,name:_,instance:m,options:S}),E=function(){};d.push(I||E)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var aGe=[PVe,GVe,IVe,gVe,zVe,BVe,YVe,EVe,jVe],oGe=iGe({defaultModifiers:aGe}),sGe=typeof Element<"u",cGe=typeof Map=="function",uGe=typeof Set=="function",lGe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Fx(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(!Fx(t[n],e[n]))return!1;return!0}var a;if(cGe&&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(!Fx(n.value[1],e.get(n.value[0])))return!1;return!0}if(uGe&&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(lGe&&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(sGe&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Fx(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var fGe=function(e,r){try{return Fx(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 dGe=Mc(fGe);var hGe=[],Wce=function(e,r,n){n===void 0&&(n={});var i=qe.useRef(null),a={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||hGe},o=qe.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],c=o[1],u=qe.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var w=m.state,v=Object.keys(w.elements);g1.flushSync(function(){c({styles:_Q(v.map(function(y){return[y,w.styles[y]||{}]})),attributes:_Q(v.map(function(y){return[y,w.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=qe.useMemo(function(){var g={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return dGe(i.current,g)?i.current||g:(i.current=g,g)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=qe.useRef();return EQ(function(){d.current&&d.current.setOptions(f)},[f]),EQ(function(){if(!(e==null||r==null)){var g=n.createPopper||oGe,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}},pGe=function(){},gGe=function(){return Promise.resolve(null)},yGe=[];function mGe(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?yGe:a,s=t.referenceElement,c=t.onFirstUpdate,u=t.innerRef,f=t.children,d=qe.useContext($ce),g=qe.useState(null),m=g[0],w=g[1],v=qe.useState(null),y=v[0],_=v[1];qe.useEffect(function(){q5(u,m)},[u,m]);var b=qe.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=Wce(s||d,m,b),x=S.state,I=S.styles,E=S.forceUpdate,p=S.update,O=qe.useMemo(function(){return{ref:w,style:I.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:I.arrow,ref:_},forceUpdate:E||pGe,update:p||gGe}},[w,_,r,x,I,p,E]);return kce(f)(O)}var vGe=function(){},bGe=vGe;const wGe=Mc(bGe);function _Ge(t){var e=t.children,r=t.innerRef,n=qe.useContext(Mce),i=qe.useCallback(function(a){q5(r,a),Lce(n,a)},[r,n]);return qe.useEffect(function(){return function(){return q5(r,null)}},[]),qe.useEffect(function(){wGe(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),kce(e)({ref:i})}const EGe=Object.freeze(Object.defineProperty({__proto__:null,Manager:eVe,Popper:mGe,Reference:_Ge,usePopper:Wce},Symbol.toStringTag,{value:"Module"})),xGe=uo(EGe);var Qu={},e6,NQ;function AGe(){if(NQ)return e6;NQ=1;var t=N$();function e(r,n,i,a){return t(r,function(o,s,c){n(a,i(o),s,c)}),a}return e6=e,e6}var t6,DQ;function SGe(){if(DQ)return t6;DQ=1;var t=AGe();function e(r,n){return function(i,a){return t(i,r,n(a),{})}}return t6=e,t6}var r6,$Q;function IGe(){if($Q)return r6;$Q=1;var t=Fte(),e=SGe(),r=bd(),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 r6=a,r6}var MQ;function OGe(){if(MQ)return Qu;MQ=1;var t=wr;Qu.__esModule=!0,Qu.placementMapping=Qu.positions=Qu.positionsMapping=void 0;var e=t(IGe()),r=t(zl()),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"};Qu.positionsMapping=n;var i=(0,r.default)(n);Qu.positions=i;var a=(0,e.default)(n);return Qu.placementMapping=a,Qu}var Xv={},n6={exports:{}},i6={exports:{}},a6={exports:{}},kQ;function PGe(){return kQ||(kQ=1,function(t){var e=m$.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}(a6)),a6.exports}var LQ;function TGe(){return LQ||(LQ=1,function(t){var e=m$.default,r=PGe();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}(i6)),i6.exports}var UQ;function RGe(){return UQ||(UQ=1,function(t){var e=TGe();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}(n6)),n6.exports}var BQ;function CGe(){if(BQ)return Xv;BQ=1;var t=wr;Xv.__esModule=!0,Xv.default=void 0;var e=t(RGe()),r=t(I$()),n=t(Ys()),i=Ed,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 Xv.default=s,Xv}var FE={},FQ;function NGe(){if(FQ)return FE;FQ=1;var t=wr;FE.__esModule=!0,FE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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}}),FE}var jE={},jQ;function DGe(){if(jQ)return jE;jQ=1;var t=wr;jE.__esModule=!0,jE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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}}),jE}var qQ;function $Ge(){if(qQ)return Qv;qQ=1;var t=Ks,e=wr;Qv.__esModule=!0,Qv.default=void 0;var r=e(Bn()),n=e(Lc());e(A$());var i=e(Hl()),a=e(R$()),o=e(Ys()),s=e(Zze()),c=e(Di()),u=e(U$()),f=e(F$()),d=e(cce()),g=e(B$()),m=e(ii);e(Ln());var w=t(qe),v=xGe,y=e(uce()),_=Wn(),b=e(X$()),S=OGe(),x=e(CGe()),I=e(NGe()),E=e(DGe()),p=function(O){(0,n.default)(C,O);function C(){for(var j,ce=arguments.length,he=new Array(ce),B=0;B<ce;B++)he[B]=arguments[B];return j=O.call.apply(O,[this].concat(he))||this,j.state={},j.open=!1,j.zIndexWasSynced=!1,j.triggerRef=w.default.createRef(),j.elementRef=w.default.createRef(),j.getPortalProps=function(){var U={},K=j.props,ne=K.on,F=K.hoverable,q=(0,c.default)(ne)?ne:[ne];return F&&(U.closeOnPortalMouseLeave=!0,U.mouseLeaveDelay=300),(0,f.default)(q,"hover")&&(U.openOnTriggerClick=!1,U.closeOnTriggerClick=!1,U.openOnTriggerMouseEnter=!0,U.closeOnTriggerMouseLeave=!0,U.mouseLeaveDelay=70,U.mouseEnterDelay=50),(0,f.default)(q,"click")&&(U.openOnTriggerClick=!0,U.closeOnTriggerClick=!0,U.closeOnDocumentClick=!0),(0,f.default)(q,"focus")&&(U.openOnTriggerFocus=!0,U.closeOnTriggerBlur=!0),U},j.hideOnScroll=function(U){(0,s.default)(U.target)&&j.elementRef.current.contains(U.target)||(j.setState({closed:!0}),_.eventStack.unsub("scroll",j.hideOnScroll,{target:window}),j.timeoutId=setTimeout(function(){j.setState({closed:!1})},50),j.handleClose(U))},j.handleClose=function(U){(0,o.default)(j.props,"onClose",U,(0,r.default)({},j.props,{open:!1}))},j.handleOpen=function(U){(0,o.default)(j.props,"onOpen",U,(0,r.default)({},j.props,{open:!0}))},j.handlePortalMount=function(U){(0,o.default)(j.props,"onMount",U,j.props)},j.handlePortalUnmount=function(U){j.positionUpdate=null,(0,o.default)(j.props,"onUnmount",U,j.props)},j.renderContent=function(U){var K=U.placement,ne=U.ref,F=U.update,q=U.style,z=j.props,$=z.basic,H=z.children,L=z.className,k=z.content,G=z.hideOnScroll,ge=z.flowing,Q=z.header,te=z.inverted,ue=z.popper,T=z.size,fe=z.style,Ge=z.wide,tt=j.state.contentRestProps;j.positionUpdate=F;var mt=(0,m.default)("ui",S.placementMapping[K],T,(0,_.useKeyOrValueAndKey)(Ge,"wide"),(0,_.useKeyOnly)($,"basic"),(0,_.useKeyOnly)(ge,"flowing"),(0,_.useKeyOnly)(te,"inverted"),"popup transition visible",L),vt=(0,_.getElementType)(C,j.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:j.elementRef}),_.childrenUtils.isNil(H)?w.default.createElement(w.default.Fragment,null,E.default.create(Q,{autoGenerateKey:!1}),I.default.create(k,{autoGenerateKey:!1})):H,G&&w.default.createElement(g.default,{on:j.hideOnScroll,name:"scroll",target:"window"}));return(0,_.createHTMLDivision)(ue||{},{overrideProps:{children:Lt,ref:ne,style:(0,r.default)({display:"flex"},q)}})},j}C.getDerivedStateFromProps=function(ce,he){if(he.closed||he.disabled)return{};var B=(0,_.getUnhandledProps)(C,ce),U=(0,d.default)(B,function(ne,F,q){return(0,f.default)(b.default.handledProps,q)||(ne[q]=F),ne},{}),K=(0,u.default)(B,b.default.handledProps);return{contentRestProps:U,portalRestProps:K}};var M=C.prototype;return M.componentDidUpdate=function(ce){var he=(0,y.default)(this.props.popperDependencies,ce.popperDependencies);he||this.handleUpdate()},M.componentWillUnmount=function(){clearTimeout(this.timeoutId)},M.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},M.render=function(){var ce=this,he=this.props,B=he.context,U=he.disabled,K=he.eventsEnabled,ne=he.offset,F=he.pinned,q=he.popper,z=he.popperModifiers,$=he.position,H=he.positionFixed,L=he.trigger,k=this.state,G=k.closed,ge=k.portalRestProps;if(G||U)return L;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 Ge,tt=fe.state;if(!ce.zIndexWasSynced){var mt=q==null||(Ge=q.style)==null?void 0:Ge.zIndex;(0,a.default)(mt)&&(tt.elements.popper.style.zIndex=window.getComputedStyle(tt.elements.popper.firstChild).zIndex),ce.zIndexWasSynced=!0}},effect:function(){return function(){ce.zIndexWasSynced=!1}}}]),te=(0,x.default)((0,i.default)(B)?this.triggerRef:B),ue=(0,r.default)({},this.getPortalProps(),ge);return w.default.createElement(b.default,(0,r.default)({},ue,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:L,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 Qv.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=I.default,p.Header=E.default,Qv}var MGe=wr,kGe=MGe($Ge()),LGe=kGe.default;const UGe=t=>t.charAt(0).toUpperCase()+t.slice(1),BGe="_button_1uvkr_1",FGe="_icon_1uvkr_5",qE={button:BGe,icon:FGe,"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"},Kce=t=>{const{className:e,children:r,type:n,testId:i,showTooltip:a,tooltipPosition:o,disabled:s,loading:c,onClick:u}=t;return je.jsx(LGe,{position:a&&o?o:"top center",disabled:!a,trigger:je.jsxs(Pc.Button,{primary:!0,size:"small","data-testid":`${i}-${n}-button`,className:gp(e,qE.button),onClick:()=>u(n),disabled:s,loading:c,children:[c?null:je.jsx("div",{role:"img","aria-label":n,className:gp(qE.icon,qE[`icon-${n}`],qE.primaryImage)}),r]},n),content:UGe(n),on:"hover"})},jGe="social-primary-test-id",qGe="social-secondary-test-id",HGe="web3-primary-test-id",zGe="web3-secondary-test-id",VGe="show-more-button-test-id",GGe="_connection_tot3a_3",WGe="_dclLogo_tot3a_9",KGe="_title_tot3a_15",YGe="_subtitle_tot3a_20",QGe="_primaryButton_tot3a_29",JGe="_primaryImage_tot3a_38",XGe="_primaryMessage_tot3a_42",ZGe="_primaryMagic_tot3a_51",eWe="_primaryLearnMore_tot3a_60",tWe="_primary_tot3a_29",rWe="_showMore_tot3a_73",nWe="_showMoreButton_tot3a_77",iWe="_showMoreSecondaryOptions_tot3a_86",aWe="_primaryOption_tot3a_100",oWe="_secondaryOptionButton_tot3a_104",Da={connection:GGe,dclLogo:WGe,title:KGe,subtitle:YGe,primaryButton:QGe,primaryImage:JGe,primaryMessage:XGe,primaryMagic:ZGe,primaryLearnMore:eWe,primary:tWe,showMore:rWe,showMoreButton:nWe,showMoreSecondaryOptions:iWe,primaryOption:aWe,secondaryOptionButton:oWe},HQ=({message:t,children:e,option:r,testId:n,loadingOption:i,onConnect:a})=>je.jsxs("div",{className:Da.primary,"data-testid":n,children:[je.jsx("div",{className:Da.primaryMessage,children:t}),je.jsx(Kce,{disabled:!!i,loading:i===r,type:r,onClick:a,className:gp(Da.primaryButton,Da.primaryOption),testId:n,children:e})]}),zQ=({options:t,tooltipDirection:e,testId:r,loadingOption:n,onConnect:i})=>je.jsx("div",{className:Da.showMoreSecondaryOptions,"data-testid":r,children:t.map(a=>je.jsx(Kce,{className:gp(Da.primaryButton,Da.secondaryOptionButton),showTooltip:!0,tooltipPosition:e,type:a,onClick:i,testId:r,loading:n===a,disabled:!!n},a))}),sWe={i18n:{title:"Discover a virtual social world",subtitle:"shaped by its community of creators & explorers.",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:["Have a digital wallet? ",t("Learn More")]})}},cWe=t=>{const{i18n:e=sWe.i18n,onConnect:r,onLearnMore:n,socialOptions:i,web3Options:a,className:o,loadingOption:s}=t,[c,u]=qe.useState(!1),f=qe.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:gp(o,Da.connection),children:[je.jsx("img",{className:Da.dclLogo,src:Xze,alt:"Decentraland logo"}),je.jsxs("div",{children:[je.jsx("h1",{className:Da.title,children:e.title}),je.jsx("h2",{className:Da.subtitle,children:e.subtitle}),i?je.jsx(HQ,{onConnect:r,testId:jGe,option:i==null?void 0:i.primary,loadingOption:s,message:je.jsxs(je.Fragment,{children:[e.socialMessage(je.jsx("div",{className:Da.primaryMagic,role:"img","aria-label":"Magic"})),je.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(i==null?void 0:i.primary),children:"Learn More"})]}),children:je.jsx(je.Fragment,{children:e.accessWith(i==null?void 0:i.primary)})}):null,a?je.jsx(HQ,{onConnect:r,testId:HGe,option:a==null?void 0:a.primary,loadingOption:s,message:e.web3Message(m=>je.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(a.primary),children:m})),children:je.jsx(je.Fragment,{children:e.connectWith(a==null?void 0:a.primary)})}):null]}),je.jsxs("div",{className:Da.showMore,children:[(g||d)&&je.jsxs(Pc.Button,{"data-testid":VGe,basic:!0,size:"medium",fluid:!0,className:Da.showMoreButton,onClick:f,children:[e.moreOptions,je.jsx(Bb,{name:c?"chevron up":"chevron down"})]}),c&&d&&je.jsx(zQ,{testId:qGe,options:i.secondary,onConnect:r,tooltipDirection:"top center",loadingOption:s}),c&&g&&je.jsx(zQ,{testId:zGe,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 uWe=60*24*30,lWe=fd.getConfiguration().magic.apiKey;function Yce(t){switch(t){case Hn.DISCORD:case Hn.X:case Hn.GOOGLE:case Hn.APPLE:return Sc.ProviderType.MAGIC;case Hn.WALLET_CONNECT:case Hn.METAMASK_MOBILE:return Sc.ProviderType.WALLET_CONNECT_V2;case Hn.COINBASE:case Hn.WALLET_LINK:return Sc.ProviderType.WALLET_LINK;case Hn.FORTMATIC:return Sc.ProviderType.FORTMATIC;case Hn.METAMASK:case Hn.DAPPER:case Hn.SAMSUNG:return Sc.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function fWe(t,e){const r=new bte(e),n=D8.createRandom(),i={address:n.address.toString(),publicKey:xt(n.publicKey),privateKey:xt(n.privateKey)},a=await r.getSigner();return mce.Authenticator.initializeAuthChain(t,i,uWe,o=>a.signMessage(o))}async function VQ(t){const e=Yce(t);if(Sc.ProviderType.MAGIC===e){const{Magic:n}=await Dy(()=>Promise.resolve().then(()=>nL),void 0),{OAuthExtension:i}=await Dy(()=>Promise.resolve().then(()=>iL),void 0),a=new n(lWe,{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 fd.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}function GQ(t){return[Hn.APPLE,Hn.GOOGLE,Hn.X,Hn.DISCORD].includes(t)}async function Qce(t,e){let r;const n=k5.localStorageGetIdentity(t);return n?r=n:(r=await fWe(t,e),k5.localStorageStoreIdentity(t,r)),r}const dWe="_container_1jfc2_1",hWe="_info_1jfc2_19",pWe="_title_1jfc2_28",o6={container:dWe,info:hWe,title:pWe},gWe=fd.getConfiguration().magic.apiKey,yWe=()=>{oL();const t=gce(),e=L2(),[r,n]=qe.useState(fi.WAITING_FOR_CONFIRMATION),i=qe.useCallback(async()=>{var c;const s=await fd.connection.connect(kl.ProviderType.MAGIC);return await Qce(((c=s.account)==null?void 0:c.toLowerCase())??"",s.provider),s},[]),a=qe.useCallback(async()=>{const{Magic:s}=await Dy(()=>Promise.resolve().then(()=>nL),void 0),{OAuthExtension:c}=await Dy(()=>Promise.resolve().then(()=>iL),void 0),u=new s(gWe,{extensions:[new c]});try{n(fi.VALIDATING_SIGN_IN),await(u==null?void 0:u.oauth.getRedirectResult()),n(fi.WAITING_FOR_CONFIRMATION)}catch(f){console.log(f),e("/login")}},[e]);qe.useEffect(()=>{a()},[]);const o=qe.useCallback(async()=>{var c;const s=Gw();try{n(fi.WAITING_FOR_SIGNATURE);const f=((c=(await i()).account)==null?void 0:c.toLowerCase())??"";s.identify({ethAddress:f}),s.track(Ic.LOGIN_SUCCESS,{eth_address:f}),await N5(500),t?window.location.href=decodeURIComponent(t):window.location.href="/"}catch(u){console.log(u),e("/login")}},[]);return r===fi.WAITING_FOR_CONFIRMATION?je.jsx(Ww.Modal,{size:"tiny",open:!0,children:je.jsxs("div",{className:o6.container,children:[je.jsx("h3",{className:o6.title,children:"Confirm your login"}),je.jsxs("div",{className:o6.info,children:[je.jsx("span",{children:"This step only verifies your identity."}),je.jsx("span",{children:"No payments or transactions will ocurr without your explicit approval."})]}),je.jsx(Pc.Button,{primary:!0,onClick:o,children:"Continue"})]})}):je.jsx(yce,{open:!0,state:r,onTryAgain:i,providerType:kl.ProviderType.MAGIC})},mWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image1-a4aa795b.webp",vWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image10-c7fbcc61.webp",bWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image2-0af6ed59.webp",wWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image3-c864ad86.webp",_We="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image4-7964be5f.webp",EWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image5-fcca517e.webp",xWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image6-c770bdf5.webp",AWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image7-341595c4.webp",SWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image8-fea9fe85.webp",IWe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7453122590.commit-211e684/assets/image9-714885ef.webp",OWe="_main_qwc0l_1",PWe="_title_qwc0l_11",TWe="_infoModal_qwc0l_15",RWe="_infoContent_qwc0l_19",CWe="_info_qwc0l_15",NWe="_goBackButton_qwc0l_33",E0={main:OWe,title:PWe,infoModal:TWe,infoContent:RWe,info:CWe,goBackButton:NWe},DWe={i18n:{title:"How does Magic work?",subtitle:"Magic handles digital wallet creation & management behind the scenes so you don't have to. Just log into Decentraland with your favorite social account and let Magic handle the rest.<br /> <br />If you'd rather take a more hands-on approach to your digital asset storage (e.g. Wearables, NAMEs, etc.), you can get a digital wallet from a provider such as <a href='https://metamask.io/'>MetaMask</a> and use it to create your Decentraland account.",goBack:"Return to log in page"}},$We=t=>{const{i18n:e=DWe.i18n,onClose:r,open:n}=t;return je.jsxs(Ww.Modal,{size:"tiny",open:n,className:E0.infoModal,onClose:r,children:[je.jsx(TI,{title:"",onClose:r}),je.jsx(cL,{className:E0.infoContent,children:je.jsxs("div",{className:E0.main,children:[je.jsx("h1",{className:E0.title,children:e==null?void 0:e.title}),je.jsx("span",{className:E0.info,dangerouslySetInnerHTML:{__html:e==null?void 0:e.subtitle}}),je.jsx(Pc.Button,{className:E0.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},MWe="_main_1c8le_1",kWe="_infoModal_1c8le_11",LWe="_infoContent_1c8le_15",UWe="_info_1c8le_11",BWe="_infoImage_1c8le_26",FWe="_assets_1c8le_34",jWe="_login_1c8le_38",qWe="_goBackButton_1c8le_42",uc={main:MWe,infoModal:kWe,infoContent:LWe,info:UWe,infoImage:BWe,assets:FWe,login:jWe,goBackButton:qWe},HWe={i18n:{title:"What is a digital wallet?",assets:{title:"A Home For Your Digital Assets",text:"Wallets are used to send, receive, store, and display digital assets, such as your Decentraland Wearables, NAMEs, LANDs, etc."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, in the world of Web3 all you need to do is just connect your digital wallet."},goBack:"Return to log in page"}},zWe=t=>{const{i18n:e=HWe.i18n,onClose:r,open:n}=t;return je.jsxs(Ww.Modal,{size:"tiny",open:n,className:uc.infoModal,onClose:r,children:[je.jsx(TI,{title:"",onClose:r}),je.jsx(cL,{className:uc.infoContent,children:je.jsxs("div",{className:uc.main,children:[je.jsx("h1",{className:uc.title,children:e==null?void 0:e.title}),je.jsxs("article",{className:uc.info,children:[je.jsx("div",{className:gp(uc.infoImage,uc.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:uc.info,children:[je.jsx("div",{className:gp(uc.infoImage,uc.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(Pc.Button,{className:uc.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},VWe="_main_1d9a9_1",GWe="_background_1d9a9_8",WWe="_left_1d9a9_32",KWe="_leftInfo_1d9a9_42",YWe="_right_1d9a9_51",QWe="_footer_1d9a9_60",JWe="_guestInfo_1d9a9_79",Zv={main:VWe,background:GWe,"move-background":"_move-background_1d9a9_1",left:WWe,leftInfo:KWe,right:YWe,footer:QWe,guestInfo:JWe},WQ=[mWe,bWe,wWe,_We,EWe,xWe,AWe,SWe,IWe,vWe],XWe=()=>{oL();const t=Gw(),[e]=pme(),[r,n]=qe.useState(fi.CONNECTING_WALLET),[i,a]=qe.useState(!1),[o,s]=qe.useState(!1),[c,u]=qe.useState(!1),[f,d]=qe.useState(),g=gce(),m=g&&new URL(g).pathname.includes("/play"),[w,v]=qe.useState(0),y=qe.useCallback(O=>{const C=O&&GQ(O);t.track(Ic.CLICK,{action:Y0.LEARN_MORE,type:C?"Learn more about Magic":"Learn more about wallets"}),C?s(!0):a(!0)},[a,s,i,t]),_=qe.useCallback(()=>{a(!1),s(!1)},[a,s]),b=qe.useCallback(()=>{s(!o)},[s,o]),S=qe.useCallback(async()=>{await N5(500),t.track(Ic.LOGIN_CLICK,{type:"guest"})},[t]),x=qe.useMemo(()=>{if(g){const O=new URL(g);return O.searchParams.append("guest","true"),O.toString()}return""},[g]),I=qe.useCallback(async O=>{var M;const C=GQ(O);if(d(O),t.track(Ic.LOGIN_CLICK,{method:O,type:C?C5.WEB2:C5.WEB3}),C)n(fi.LOADING_MAGIC),await VQ(O);else try{u(!0),n(fi.CONNECTING_WALLET);const j=await VQ(O);e.get("fromRequests")!=="true"&&(n(fi.WAITING_FOR_SIGNATURE),await Qce(((M=j.account)==null?void 0:M.toLowerCase())??"",j.provider)),t.track(Ic.LOGIN_SUCCESS,{eth_address:j.account}),t.identify({ethAddress:j.account}),await N5(500),g?window.location.href=decodeURIComponent(g):window.location.href="/",u(!1)}catch(j){console.log("Error",JSON.stringify(j)),t.track(Ic.LOGIN_ERROR,{error:Ux(j)?j.message:j}),n(fi.ERROR)}},[n,u,d,g,e,t]),E=qe.useCallback(()=>{u(!1),d(void 0),n(fi.CONNECTING_WALLET)},[u]),p=qe.useCallback(()=>{f&&I(f)},[f]);return qe.useEffect(()=>{const O=setInterval(()=>{v(C=>C===WQ.length-1?0:C+1)},5e3);return()=>{clearInterval(O)}},[]),je.jsxs("main",{className:Zv.main,children:[je.jsx("div",{className:Zv.background,style:{backgroundImage:`url(${WQ[w]})`}}),je.jsx(zWe,{open:i,onClose:_}),je.jsx($We,{open:o,onClose:b}),je.jsx(yce,{open:c,state:r,onClose:E,onTryAgain:p,providerType:f?Yce(f):null}),je.jsx("div",{className:Zv.left,children:je.jsxs("div",{className:Zv.leftInfo,children:[je.jsx(cWe,{onLearnMore:y,onConnect:I,loadingOption:f,socialOptions:{primary:Hn.GOOGLE,secondary:[Hn.DISCORD,Hn.APPLE,Hn.X]},web3Options:{primary:Hn.METAMASK,secondary:[Hn.FORTMATIC,Hn.COINBASE,Hn.WALLET_CONNECT]}}),m&&je.jsxs("div",{className:Zv.guestInfo,children:["Quick dive?"," ",je.jsx("a",{href:x,onClick:S,children:"Explore as a guest"})]})]})})]})};(function(){const t=window.analytics=window.analytics||[];if(!t.initialize){if(t.invoked){window.console&&console.error&&console.error("Segment snippet included twice.");return}t.invoked=!0,t.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","user","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"],t.factory=function(e){return function(){const r=Array.prototype.slice.call(arguments);return r.unshift(e),t.push(r),t}};for(let e=0;e<t.methods.length;e++){const r=t.methods[e];t[r]=t.factory(r)}t.load=function(e,r){const n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://cdn.segment.com/analytics.js/v1/"+e+"/analytics.min.js";const i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i),t._loadOptions=r},t.SNIPPET_VERSION="4.15.2"}})();Gw().load(sL.get("SEGMENT_API_KEY"));wye.render(je.jsx(lJ.StrictMode,{children:je.jsx(hme,{basename:"/auth",children:je.jsxs(lme,{children:[je.jsx(ab,{path:"/login",element:je.jsx(XWe,{})}),je.jsx(ab,{path:"/callback",element:je.jsx(yWe,{})}),je.jsx(ab,{path:"/requests/:requestId",element:je.jsx(gHe,{})}),je.jsx(ab,{path:"*",element:je.jsx(vHe,{})})]})})}),document.getElementById("root"));export{ut as B,M5e as R,eoe as T,W$e as _,ii as a,za as b,Ne as c,Mc as d,fo as e,wN as f,uo as g,Ma as h,YW as n,uKe as o,Tc as p,cM as r,Nne as s,cKe as t,$y as y};
187
- //# sourceMappingURL=index-53e9e841.js.map
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})()})(Dce);var Jze=Dce.exports;const gp=Mc(Jze),Xze="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/logo-9a364aec.svg";var Qv={},ZN,wQ;function Zze(){if(wQ)return ZN;wQ=1;var t=Uc(),e=hS();function r(n){return t(n)&&n.nodeType===1&&!e(n)}return ZN=r,ZN}var $ce=qe.createContext(),Mce=qe.createContext();function eVe(t){var e=t.children,r=qe.useState(null),n=r[0],i=r[1],a=qe.useRef(!1);qe.useEffect(function(){return function(){a.current=!0}},[]);var o=qe.useCallback(function(s){a.current||i(s)},[]);return qe.createElement($ce.Provider,{value:n},qe.createElement(Mce.Provider,{value:o},e))}var kce=function(e){return Array.isArray(e)?e[0]:e},Lce=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)}},q5=function(e,r){if(typeof e=="function")return Lce(e,r);e!=null&&(e.current=r)},_Q=function(e){return e.reduce(function(r,n){var i=n[0],a=n[1];return r[i]=a,r},{})},EQ=typeof window<"u"&&window.document&&window.document.createElement?qe.useLayoutEffect:qe.useEffect,Mo="top",Vs="bottom",Gs="right",ko="left",wL="auto",Kw=[Mo,Vs,Gs,ko],ky="start",B1="end",tVe="clippingParents",Uce="viewport",Jv="popper",rVe="reference",xQ=Kw.reduce(function(t,e){return t.concat([e+"-"+ky,e+"-"+B1])},[]),Bce=[].concat(Kw,[wL]).reduce(function(t,e){return t.concat([e,e+"-"+ky,e+"-"+B1])},[]),nVe="beforeRead",iVe="read",aVe="afterRead",oVe="beforeMain",sVe="main",cVe="afterMain",uVe="beforeWrite",lVe="write",fVe="afterWrite",dVe=[nVe,iVe,aVe,oVe,sVe,cVe,uVe,lVe,fVe];function Iu(t){return t?(t.nodeName||"").toLowerCase():null}function ts(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function yp(t){var e=ts(t).Element;return t instanceof e||t instanceof Element}function Fs(t){var e=ts(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function _L(t){if(typeof ShadowRoot>"u")return!1;var e=ts(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function hVe(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];!Fs(a)||!Iu(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 pVe(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},{});!Fs(i)||!Iu(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const gVe={name:"applyStyles",enabled:!0,phase:"write",fn:hVe,effect:pVe,requires:["computeStyles"]};function _u(t){return t.split("-")[0]}var rp=Math.max,f2=Math.min,Ly=Math.round;function H5(){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 Fce(){return!/^((?!chrome|android).)*safari/i.test(H5())}function Uy(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Fs(t)&&(i=t.offsetWidth>0&&Ly(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&Ly(n.height)/t.offsetHeight||1);var o=yp(t)?ts(t):window,s=o.visualViewport,c=!Fce()&&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 EL(t){var e=Uy(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 jce(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&_L(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ll(t){return ts(t).getComputedStyle(t)}function yVe(t){return["table","td","th"].indexOf(Iu(t))>=0}function Nd(t){return((yp(t)?t.ownerDocument:t.document)||window.document).documentElement}function LI(t){return Iu(t)==="html"?t:t.assignedSlot||t.parentNode||(_L(t)?t.host:null)||Nd(t)}function AQ(t){return!Fs(t)||Ll(t).position==="fixed"?null:t.offsetParent}function mVe(t){var e=/firefox/i.test(H5()),r=/Trident/i.test(H5());if(r&&Fs(t)){var n=Ll(t);if(n.position==="fixed")return null}var i=LI(t);for(_L(i)&&(i=i.host);Fs(i)&&["html","body"].indexOf(Iu(i))<0;){var a=Ll(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 Yw(t){for(var e=ts(t),r=AQ(t);r&&yVe(r)&&Ll(r).position==="static";)r=AQ(r);return r&&(Iu(r)==="html"||Iu(r)==="body"&&Ll(r).position==="static")?e:r||mVe(t)||e}function xL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Jb(t,e,r){return rp(t,f2(e,r))}function vVe(t,e,r){var n=Jb(t,e,r);return n>r?r:n}function qce(){return{top:0,right:0,bottom:0,left:0}}function Hce(t){return Object.assign({},qce(),t)}function zce(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var bVe=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Hce(typeof e!="number"?e:zce(e,Kw))};function wVe(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=_u(r.placement),c=xL(s),u=[ko,Gs].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!o)){var d=bVe(i.padding,r),g=EL(a),m=c==="y"?Mo:ko,w=c==="y"?Vs:Gs,v=r.rects.reference[f]+r.rects.reference[c]-o[c]-r.rects.popper[f],y=o[c]-r.rects.reference[c],_=Yw(a),b=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-y/2,x=d[m],I=b-g[f]-d[w],E=b/2-g[f]/2+S,p=Jb(x,E,I),O=c;r.modifiersData[n]=(e={},e[O]=p,e.centerOffset=p-E,e)}}function _Ve(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)||jce(e.elements.popper,i)&&(e.elements.arrow=i))}const EVe={name:"arrow",enabled:!0,phase:"main",fn:wVe,effect:_Ve,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function By(t){return t.split("-")[1]}var xVe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function AVe(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:Ly(r*i)/i||0,y:Ly(n*i)/i||0}}function SQ(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,I=window;if(u){var E=Yw(r),p="clientHeight",O="clientWidth";if(E===ts(r)&&(E=Nd(r),Ll(E).position!=="static"&&s==="absolute"&&(p="scrollHeight",O="scrollWidth")),E=E,i===Mo||(i===ko||i===Gs)&&a===B1){x=Vs;var C=d&&E===I&&I.visualViewport?I.visualViewport.height:E[p];v-=C-n.height,v*=c?1:-1}if(i===ko||(i===Mo||i===Vs)&&a===B1){S=Gs;var M=d&&E===I&&I.visualViewport?I.visualViewport.width:E[O];m-=M-n.width,m*=c?1:-1}}var j=Object.assign({position:s},u&&xVe),ce=f===!0?AVe({x:m,y:v},ts(r)):{x:m,y:v};if(m=ce.x,v=ce.y,c){var he;return Object.assign({},j,(he={},he[x]=b?"0":"",he[S]=_?"0":"",he.transform=(I.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",he))}return Object.assign({},j,(e={},e[x]=b?v+"px":"",e[S]=_?m+"px":"",e.transform="",e))}function SVe(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:_u(e.placement),variation:By(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,SQ(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,SQ(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 IVe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:SVe,data:{}};var BE={passive:!0};function OVe(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=ts(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",r.update,BE)}),s&&c.addEventListener("resize",r.update,BE),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",r.update,BE)}),s&&c.removeEventListener("resize",r.update,BE)}}const PVe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:OVe,data:{}};var TVe={left:"right",right:"left",bottom:"top",top:"bottom"};function Bx(t){return t.replace(/left|right|bottom|top/g,function(e){return TVe[e]})}var RVe={start:"end",end:"start"};function IQ(t){return t.replace(/start|end/g,function(e){return RVe[e]})}function AL(t){var e=ts(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function SL(t){return Uy(Nd(t)).left+AL(t).scrollLeft}function CVe(t,e){var r=ts(t),n=Nd(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Fce();(u||!u&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+SL(t),y:c}}function NVe(t){var e,r=Nd(t),n=AL(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=rp(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=rp(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+SL(t),c=-n.scrollTop;return Ll(i||r).direction==="rtl"&&(s+=rp(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function IL(t){var e=Ll(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Vce(t){return["html","body","#document"].indexOf(Iu(t))>=0?t.ownerDocument.body:Fs(t)&&IL(t)?t:Vce(LI(t))}function Xb(t,e){var r;e===void 0&&(e=[]);var n=Vce(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),a=ts(n),o=i?[a].concat(a.visualViewport||[],IL(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(Xb(LI(o)))}function z5(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function DVe(t,e){var r=Uy(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 OQ(t,e,r){return e===Uce?z5(CVe(t,r)):yp(e)?DVe(e,r):z5(NVe(Nd(t)))}function $Ve(t){var e=Xb(LI(t)),r=["absolute","fixed"].indexOf(Ll(t).position)>=0,n=r&&Fs(t)?Yw(t):t;return yp(n)?e.filter(function(i){return yp(i)&&jce(i,n)&&Iu(i)!=="body"}):[]}function MVe(t,e,r,n){var i=e==="clippingParents"?$Ve(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(c,u){var f=OQ(t,u,n);return c.top=rp(f.top,c.top),c.right=f2(f.right,c.right),c.bottom=f2(f.bottom,c.bottom),c.left=rp(f.left,c.left),c},OQ(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 Gce(t){var e=t.reference,r=t.element,n=t.placement,i=n?_u(n):null,a=n?By(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 Vs:c={x:o,y:e.y+e.height};break;case Gs: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?xL(i):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case ky:c[u]=c[u]-(e[f]/2-r[f]/2);break;case B1:c[u]=c[u]+(e[f]/2-r[f]/2);break}}return c}function F1(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?tVe:s,u=r.rootBoundary,f=u===void 0?Uce:u,d=r.elementContext,g=d===void 0?Jv:d,m=r.altBoundary,w=m===void 0?!1:m,v=r.padding,y=v===void 0?0:v,_=Hce(typeof y!="number"?y:zce(y,Kw)),b=g===Jv?rVe:Jv,S=t.rects.popper,x=t.elements[w?b:g],I=MVe(yp(x)?x:x.contextElement||Nd(t.elements.popper),c,f,o),E=Uy(t.elements.reference),p=Gce({reference:E,element:S,strategy:"absolute",placement:i}),O=z5(Object.assign({},S,p)),C=g===Jv?O:E,M={top:I.top-C.top+_.top,bottom:C.bottom-I.bottom+_.bottom,left:I.left-C.left+_.left,right:C.right-I.right+_.right},j=t.modifiersData.offset;if(g===Jv&&j){var ce=j[i];Object.keys(M).forEach(function(he){var B=[Gs,Vs].indexOf(he)>=0?1:-1,U=[Mo,Vs].indexOf(he)>=0?"y":"x";M[he]+=ce[U]*B})}return M}function kVe(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?Bce:c,f=By(n),d=f?s?xQ:xQ.filter(function(w){return By(w)===f}):Kw,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]=F1(t,{placement:v,boundary:i,rootBoundary:a,padding:o})[_u(v)],w},{});return Object.keys(m).sort(function(w,v){return m[w]-m[v]})}function LVe(t){if(_u(t)===wL)return[];var e=Bx(t);return[IQ(t),e,IQ(e)]}function UVe(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,_=_u(y),b=_===y,S=c||(b||!w?[Bx(y)]:LVe(y)),x=[y].concat(S).reduce(function(k,G){return k.concat(_u(G)===wL?kVe(e,{placement:G,boundary:f,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:v}):G)},[]),I=e.rects.reference,E=e.rects.popper,p=new Map,O=!0,C=x[0],M=0;M<x.length;M++){var j=x[M],ce=_u(j),he=By(j)===ky,B=[Mo,Vs].indexOf(ce)>=0,U=B?"width":"height",K=F1(e,{placement:j,boundary:f,rootBoundary:d,altBoundary:g,padding:u}),ne=B?he?Gs:ko:he?Vs:Mo;I[U]>E[U]&&(ne=Bx(ne));var F=Bx(ne),q=[];if(a&&q.push(K[ce]<=0),s&&q.push(K[ne]<=0,K[F]<=0),q.every(function(k){return k})){C=j,O=!1;break}p.set(j,q)}if(O)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(ue){return ue})});if(ge)return C=ge,"break"},H=z;H>0;H--){var L=$(H);if(L==="break")break}e.placement!==C&&(e.modifiersData[n]._skip=!0,e.placement=C,e.reset=!0)}}const BVe={name:"flip",enabled:!0,phase:"main",fn:UVe,requiresIfExists:["offset"],data:{_skip:!1}};function PQ(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 TQ(t){return[Mo,Gs,Vs,ko].some(function(e){return t[e]>=0})}function FVe(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=F1(e,{elementContext:"reference"}),s=F1(e,{altBoundary:!0}),c=PQ(o,n),u=PQ(s,i,a),f=TQ(c),d=TQ(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 jVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:FVe};function qVe(t,e,r){var n=_u(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,Gs].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function HVe(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=i===void 0?[0,0]:i,o=Bce.reduce(function(f,d){return f[d]=qVe(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 zVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:HVe};function VVe(t){var e=t.state,r=t.name;e.modifiersData[r]=Gce({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const GVe={name:"popperOffsets",enabled:!0,phase:"read",fn:VVe,data:{}};function WVe(t){return t==="x"?"y":"x"}function KVe(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=F1(e,{boundary:c,rootBoundary:u,padding:d,altBoundary:f}),_=_u(e.placement),b=By(e.placement),S=!b,x=xL(_),I=WVe(x),E=e.modifiersData.popperOffsets,p=e.rects.reference,O=e.rects.popper,C=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,M=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),j=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ce={x:0,y:0};if(E){if(a){var he,B=x==="y"?Mo:ko,U=x==="y"?Vs:Gs,K=x==="y"?"height":"width",ne=E[x],F=ne+y[B],q=ne-y[U],z=m?-O[K]/2:0,$=b===ky?p[K]:O[K],H=b===ky?-O[K]:-p[K],L=e.elements.arrow,k=m&&L?EL(L):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:qce(),ge=G[B],Q=G[U],te=Jb(0,p[K],k[K]),ue=S?p[K]/2-z-te-ge-M.mainAxis:$-te-ge-M.mainAxis,T=S?-p[K]/2+z+te+Q+M.mainAxis:H+te+Q+M.mainAxis,fe=e.elements.arrow&&Yw(e.elements.arrow),Ge=fe?x==="y"?fe.clientTop||0:fe.clientLeft||0:0,tt=(he=j==null?void 0:j[x])!=null?he:0,mt=ne+ue-tt-Ge,vt=ne+T-tt,gt=Jb(m?f2(F,mt):F,ne,m?rp(q,vt):q);E[x]=gt,ce[x]=gt-ne}if(s){var Lt,Yt=x==="x"?Mo:ko,_r=x==="x"?Vs:Gs,Rt=E[I],Pt=I==="y"?"height":"width",kt=Rt+y[Yt],Nt=Rt-y[_r],Kt=[Mo,ko].indexOf(_)!==-1,Ut=(Lt=j==null?void 0:j[I])!=null?Lt:0,zt=Kt?kt:Rt-p[Pt]-O[Pt]-Ut+M.altAxis,$t=Kt?Rt+p[Pt]+O[Pt]-Ut-M.altAxis:Nt,Dt=m&&Kt?vVe(zt,Rt,$t):Jb(m?zt:kt,Rt,m?$t:Nt);E[I]=Dt,ce[I]=Dt-Rt}e.modifiersData[n]=ce}}const YVe={name:"preventOverflow",enabled:!0,phase:"main",fn:KVe,requiresIfExists:["offset"]};function QVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function JVe(t){return t===ts(t)||!Fs(t)?AL(t):QVe(t)}function XVe(t){var e=t.getBoundingClientRect(),r=Ly(e.width)/t.offsetWidth||1,n=Ly(e.height)/t.offsetHeight||1;return r!==1||n!==1}function ZVe(t,e,r){r===void 0&&(r=!1);var n=Fs(e),i=Fs(e)&&XVe(e),a=Nd(e),o=Uy(t,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Iu(e)!=="body"||IL(a))&&(s=JVe(e)),Fs(e)?(c=Uy(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=SL(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function eGe(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 tGe(t){var e=eGe(t);return dVe.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function rGe(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function nGe(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 RQ={placement:"bottom",modifiers:[],strategy:"absolute"};function CQ(){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 iGe(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,a=i===void 0?RQ:i;return function(s,c,u){u===void 0&&(u=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},RQ,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:yp(s)?Xb(s):s.contextElement?Xb(s.contextElement):[],popper:Xb(c)};var S=tGe(nGe([].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(CQ(b,S)){f.rects={reference:ZVe(b,Yw(S),f.options.strategy==="fixed"),popper:EL(S)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(M){return f.modifiersData[M.name]=Object.assign({},M.data)});for(var x=0;x<f.orderedModifiers.length;x++){if(f.reset===!0){f.reset=!1,x=-1;continue}var I=f.orderedModifiers[x],E=I.fn,p=I.options,O=p===void 0?{}:p,C=I.name;typeof E=="function"&&(f=E({state:f,options:O,name:C,instance:m})||f)}}}},update:rGe(function(){return new Promise(function(y){m.forceUpdate(),y(f)})}),destroy:function(){v(),g=!0}};if(!CQ(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 I=x({state:f,name:_,instance:m,options:S}),E=function(){};d.push(I||E)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var aGe=[PVe,GVe,IVe,gVe,zVe,BVe,YVe,EVe,jVe],oGe=iGe({defaultModifiers:aGe}),sGe=typeof Element<"u",cGe=typeof Map=="function",uGe=typeof Set=="function",lGe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Fx(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(!Fx(t[n],e[n]))return!1;return!0}var a;if(cGe&&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(!Fx(n.value[1],e.get(n.value[0])))return!1;return!0}if(uGe&&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(lGe&&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(sGe&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Fx(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var fGe=function(e,r){try{return Fx(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 dGe=Mc(fGe);var hGe=[],Wce=function(e,r,n){n===void 0&&(n={});var i=qe.useRef(null),a={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||hGe},o=qe.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],c=o[1],u=qe.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var w=m.state,v=Object.keys(w.elements);g1.flushSync(function(){c({styles:_Q(v.map(function(y){return[y,w.styles[y]||{}]})),attributes:_Q(v.map(function(y){return[y,w.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=qe.useMemo(function(){var g={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return dGe(i.current,g)?i.current||g:(i.current=g,g)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=qe.useRef();return EQ(function(){d.current&&d.current.setOptions(f)},[f]),EQ(function(){if(!(e==null||r==null)){var g=n.createPopper||oGe,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}},pGe=function(){},gGe=function(){return Promise.resolve(null)},yGe=[];function mGe(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?yGe:a,s=t.referenceElement,c=t.onFirstUpdate,u=t.innerRef,f=t.children,d=qe.useContext($ce),g=qe.useState(null),m=g[0],w=g[1],v=qe.useState(null),y=v[0],_=v[1];qe.useEffect(function(){q5(u,m)},[u,m]);var b=qe.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=Wce(s||d,m,b),x=S.state,I=S.styles,E=S.forceUpdate,p=S.update,O=qe.useMemo(function(){return{ref:w,style:I.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:I.arrow,ref:_},forceUpdate:E||pGe,update:p||gGe}},[w,_,r,x,I,p,E]);return kce(f)(O)}var vGe=function(){},bGe=vGe;const wGe=Mc(bGe);function _Ge(t){var e=t.children,r=t.innerRef,n=qe.useContext(Mce),i=qe.useCallback(function(a){q5(r,a),Lce(n,a)},[r,n]);return qe.useEffect(function(){return function(){return q5(r,null)}},[]),qe.useEffect(function(){wGe(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),kce(e)({ref:i})}const EGe=Object.freeze(Object.defineProperty({__proto__:null,Manager:eVe,Popper:mGe,Reference:_Ge,usePopper:Wce},Symbol.toStringTag,{value:"Module"})),xGe=uo(EGe);var Qu={},e6,NQ;function AGe(){if(NQ)return e6;NQ=1;var t=N$();function e(r,n,i,a){return t(r,function(o,s,c){n(a,i(o),s,c)}),a}return e6=e,e6}var t6,DQ;function SGe(){if(DQ)return t6;DQ=1;var t=AGe();function e(r,n){return function(i,a){return t(i,r,n(a),{})}}return t6=e,t6}var r6,$Q;function IGe(){if($Q)return r6;$Q=1;var t=Fte(),e=SGe(),r=bd(),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 r6=a,r6}var MQ;function OGe(){if(MQ)return Qu;MQ=1;var t=wr;Qu.__esModule=!0,Qu.placementMapping=Qu.positions=Qu.positionsMapping=void 0;var e=t(IGe()),r=t(zl()),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"};Qu.positionsMapping=n;var i=(0,r.default)(n);Qu.positions=i;var a=(0,e.default)(n);return Qu.placementMapping=a,Qu}var Xv={},n6={exports:{}},i6={exports:{}},a6={exports:{}},kQ;function PGe(){return kQ||(kQ=1,function(t){var e=m$.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}(a6)),a6.exports}var LQ;function TGe(){return LQ||(LQ=1,function(t){var e=m$.default,r=PGe();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}(i6)),i6.exports}var UQ;function RGe(){return UQ||(UQ=1,function(t){var e=TGe();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}(n6)),n6.exports}var BQ;function CGe(){if(BQ)return Xv;BQ=1;var t=wr;Xv.__esModule=!0,Xv.default=void 0;var e=t(RGe()),r=t(I$()),n=t(Ys()),i=Ed,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 Xv.default=s,Xv}var FE={},FQ;function NGe(){if(FQ)return FE;FQ=1;var t=wr;FE.__esModule=!0,FE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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}}),FE}var jE={},jQ;function DGe(){if(jQ)return jE;jQ=1;var t=wr;jE.__esModule=!0,jE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(qe),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}}),jE}var qQ;function $Ge(){if(qQ)return Qv;qQ=1;var t=Ks,e=wr;Qv.__esModule=!0,Qv.default=void 0;var r=e(Bn()),n=e(Lc());e(A$());var i=e(Hl()),a=e(R$()),o=e(Ys()),s=e(Zze()),c=e(Di()),u=e(U$()),f=e(F$()),d=e(cce()),g=e(B$()),m=e(ii);e(Ln());var w=t(qe),v=xGe,y=e(uce()),_=Wn(),b=e(X$()),S=OGe(),x=e(CGe()),I=e(NGe()),E=e(DGe()),p=function(O){(0,n.default)(C,O);function C(){for(var j,ce=arguments.length,he=new Array(ce),B=0;B<ce;B++)he[B]=arguments[B];return j=O.call.apply(O,[this].concat(he))||this,j.state={},j.open=!1,j.zIndexWasSynced=!1,j.triggerRef=w.default.createRef(),j.elementRef=w.default.createRef(),j.getPortalProps=function(){var U={},K=j.props,ne=K.on,F=K.hoverable,q=(0,c.default)(ne)?ne:[ne];return F&&(U.closeOnPortalMouseLeave=!0,U.mouseLeaveDelay=300),(0,f.default)(q,"hover")&&(U.openOnTriggerClick=!1,U.closeOnTriggerClick=!1,U.openOnTriggerMouseEnter=!0,U.closeOnTriggerMouseLeave=!0,U.mouseLeaveDelay=70,U.mouseEnterDelay=50),(0,f.default)(q,"click")&&(U.openOnTriggerClick=!0,U.closeOnTriggerClick=!0,U.closeOnDocumentClick=!0),(0,f.default)(q,"focus")&&(U.openOnTriggerFocus=!0,U.closeOnTriggerBlur=!0),U},j.hideOnScroll=function(U){(0,s.default)(U.target)&&j.elementRef.current.contains(U.target)||(j.setState({closed:!0}),_.eventStack.unsub("scroll",j.hideOnScroll,{target:window}),j.timeoutId=setTimeout(function(){j.setState({closed:!1})},50),j.handleClose(U))},j.handleClose=function(U){(0,o.default)(j.props,"onClose",U,(0,r.default)({},j.props,{open:!1}))},j.handleOpen=function(U){(0,o.default)(j.props,"onOpen",U,(0,r.default)({},j.props,{open:!0}))},j.handlePortalMount=function(U){(0,o.default)(j.props,"onMount",U,j.props)},j.handlePortalUnmount=function(U){j.positionUpdate=null,(0,o.default)(j.props,"onUnmount",U,j.props)},j.renderContent=function(U){var K=U.placement,ne=U.ref,F=U.update,q=U.style,z=j.props,$=z.basic,H=z.children,L=z.className,k=z.content,G=z.hideOnScroll,ge=z.flowing,Q=z.header,te=z.inverted,ue=z.popper,T=z.size,fe=z.style,Ge=z.wide,tt=j.state.contentRestProps;j.positionUpdate=F;var mt=(0,m.default)("ui",S.placementMapping[K],T,(0,_.useKeyOrValueAndKey)(Ge,"wide"),(0,_.useKeyOnly)($,"basic"),(0,_.useKeyOnly)(ge,"flowing"),(0,_.useKeyOnly)(te,"inverted"),"popup transition visible",L),vt=(0,_.getElementType)(C,j.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:j.elementRef}),_.childrenUtils.isNil(H)?w.default.createElement(w.default.Fragment,null,E.default.create(Q,{autoGenerateKey:!1}),I.default.create(k,{autoGenerateKey:!1})):H,G&&w.default.createElement(g.default,{on:j.hideOnScroll,name:"scroll",target:"window"}));return(0,_.createHTMLDivision)(ue||{},{overrideProps:{children:Lt,ref:ne,style:(0,r.default)({display:"flex"},q)}})},j}C.getDerivedStateFromProps=function(ce,he){if(he.closed||he.disabled)return{};var B=(0,_.getUnhandledProps)(C,ce),U=(0,d.default)(B,function(ne,F,q){return(0,f.default)(b.default.handledProps,q)||(ne[q]=F),ne},{}),K=(0,u.default)(B,b.default.handledProps);return{contentRestProps:U,portalRestProps:K}};var M=C.prototype;return M.componentDidUpdate=function(ce){var he=(0,y.default)(this.props.popperDependencies,ce.popperDependencies);he||this.handleUpdate()},M.componentWillUnmount=function(){clearTimeout(this.timeoutId)},M.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},M.render=function(){var ce=this,he=this.props,B=he.context,U=he.disabled,K=he.eventsEnabled,ne=he.offset,F=he.pinned,q=he.popper,z=he.popperModifiers,$=he.position,H=he.positionFixed,L=he.trigger,k=this.state,G=k.closed,ge=k.portalRestProps;if(G||U)return L;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 Ge,tt=fe.state;if(!ce.zIndexWasSynced){var mt=q==null||(Ge=q.style)==null?void 0:Ge.zIndex;(0,a.default)(mt)&&(tt.elements.popper.style.zIndex=window.getComputedStyle(tt.elements.popper.firstChild).zIndex),ce.zIndexWasSynced=!0}},effect:function(){return function(){ce.zIndexWasSynced=!1}}}]),te=(0,x.default)((0,i.default)(B)?this.triggerRef:B),ue=(0,r.default)({},this.getPortalProps(),ge);return w.default.createElement(b.default,(0,r.default)({},ue,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:L,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 Qv.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=I.default,p.Header=E.default,Qv}var MGe=wr,kGe=MGe($Ge()),LGe=kGe.default;const UGe=t=>t.charAt(0).toUpperCase()+t.slice(1),BGe="_button_1uvkr_1",FGe="_icon_1uvkr_5",qE={button:BGe,icon:FGe,"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"},Kce=t=>{const{className:e,children:r,type:n,testId:i,showTooltip:a,tooltipPosition:o,disabled:s,loading:c,onClick:u}=t;return je.jsx(LGe,{position:a&&o?o:"top center",disabled:!a,trigger:je.jsxs(Pc.Button,{primary:!0,size:"small","data-testid":`${i}-${n}-button`,className:gp(e,qE.button),onClick:()=>u(n),disabled:s,loading:c,children:[c?null:je.jsx("div",{role:"img","aria-label":n,className:gp(qE.icon,qE[`icon-${n}`],qE.primaryImage)}),r]},n),content:UGe(n),on:"hover"})},jGe="social-primary-test-id",qGe="social-secondary-test-id",HGe="web3-primary-test-id",zGe="web3-secondary-test-id",VGe="show-more-button-test-id",GGe="_connection_tot3a_3",WGe="_dclLogo_tot3a_9",KGe="_title_tot3a_15",YGe="_subtitle_tot3a_20",QGe="_primaryButton_tot3a_29",JGe="_primaryImage_tot3a_38",XGe="_primaryMessage_tot3a_42",ZGe="_primaryMagic_tot3a_51",eWe="_primaryLearnMore_tot3a_60",tWe="_primary_tot3a_29",rWe="_showMore_tot3a_73",nWe="_showMoreButton_tot3a_77",iWe="_showMoreSecondaryOptions_tot3a_86",aWe="_primaryOption_tot3a_100",oWe="_secondaryOptionButton_tot3a_104",Da={connection:GGe,dclLogo:WGe,title:KGe,subtitle:YGe,primaryButton:QGe,primaryImage:JGe,primaryMessage:XGe,primaryMagic:ZGe,primaryLearnMore:eWe,primary:tWe,showMore:rWe,showMoreButton:nWe,showMoreSecondaryOptions:iWe,primaryOption:aWe,secondaryOptionButton:oWe},HQ=({message:t,children:e,option:r,testId:n,loadingOption:i,onConnect:a})=>je.jsxs("div",{className:Da.primary,"data-testid":n,children:[je.jsx("div",{className:Da.primaryMessage,children:t}),je.jsx(Kce,{disabled:!!i,loading:i===r,type:r,onClick:a,className:gp(Da.primaryButton,Da.primaryOption),testId:n,children:e})]}),zQ=({options:t,tooltipDirection:e,testId:r,loadingOption:n,onConnect:i})=>je.jsx("div",{className:Da.showMoreSecondaryOptions,"data-testid":r,children:t.map(a=>je.jsx(Kce,{className:gp(Da.primaryButton,Da.secondaryOptionButton),showTooltip:!0,tooltipPosition:e,type:a,onClick:i,testId:r,loading:n===a,disabled:!!n},a))}),sWe={i18n:{title:"Discover a virtual social world",subtitle:"shaped by its community of creators & explorers.",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:["Have a digital wallet? ",t("Learn More")]})}},cWe=t=>{const{i18n:e=sWe.i18n,onConnect:r,onLearnMore:n,socialOptions:i,web3Options:a,className:o,loadingOption:s}=t,[c,u]=qe.useState(!1),f=qe.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:gp(o,Da.connection),children:[je.jsx("img",{className:Da.dclLogo,src:Xze,alt:"Decentraland logo"}),je.jsxs("div",{children:[je.jsx("h1",{className:Da.title,children:e.title}),je.jsx("h2",{className:Da.subtitle,children:e.subtitle}),i?je.jsx(HQ,{onConnect:r,testId:jGe,option:i==null?void 0:i.primary,loadingOption:s,message:je.jsxs(je.Fragment,{children:[e.socialMessage(je.jsx("div",{className:Da.primaryMagic,role:"img","aria-label":"Magic"})),je.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(i==null?void 0:i.primary),children:"Learn More"})]}),children:je.jsx(je.Fragment,{children:e.accessWith(i==null?void 0:i.primary)})}):null,a?je.jsx(HQ,{onConnect:r,testId:HGe,option:a==null?void 0:a.primary,loadingOption:s,message:e.web3Message(m=>je.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(a.primary),children:m})),children:je.jsx(je.Fragment,{children:e.connectWith(a==null?void 0:a.primary)})}):null]}),je.jsxs("div",{className:Da.showMore,children:[(g||d)&&je.jsxs(Pc.Button,{"data-testid":VGe,basic:!0,size:"medium",fluid:!0,className:Da.showMoreButton,onClick:f,children:[e.moreOptions,je.jsx(Bb,{name:c?"chevron up":"chevron down"})]}),c&&d&&je.jsx(zQ,{testId:qGe,options:i.secondary,onConnect:r,tooltipDirection:"top center",loadingOption:s}),c&&g&&je.jsx(zQ,{testId:zGe,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 uWe=60*24*30,lWe=fd.getConfiguration().magic.apiKey;function Yce(t){switch(t){case Hn.DISCORD:case Hn.X:case Hn.GOOGLE:case Hn.APPLE:return Sc.ProviderType.MAGIC;case Hn.WALLET_CONNECT:case Hn.METAMASK_MOBILE:return Sc.ProviderType.WALLET_CONNECT_V2;case Hn.COINBASE:case Hn.WALLET_LINK:return Sc.ProviderType.WALLET_LINK;case Hn.FORTMATIC:return Sc.ProviderType.FORTMATIC;case Hn.METAMASK:case Hn.DAPPER:case Hn.SAMSUNG:return Sc.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function fWe(t,e){const r=new bte(e),n=D8.createRandom(),i={address:n.address.toString(),publicKey:xt(n.publicKey),privateKey:xt(n.privateKey)},a=await r.getSigner();return mce.Authenticator.initializeAuthChain(t,i,uWe,o=>a.signMessage(o))}async function VQ(t){const e=Yce(t);if(Sc.ProviderType.MAGIC===e){const{Magic:n}=await Dy(()=>Promise.resolve().then(()=>nL),void 0),{OAuthExtension:i}=await Dy(()=>Promise.resolve().then(()=>iL),void 0),a=new n(lWe,{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 fd.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}function GQ(t){return[Hn.APPLE,Hn.GOOGLE,Hn.X,Hn.DISCORD].includes(t)}async function Qce(t,e){let r;const n=k5.localStorageGetIdentity(t);return n?r=n:(r=await fWe(t,e),k5.localStorageStoreIdentity(t,r)),r}const dWe="_container_1jfc2_1",hWe="_info_1jfc2_19",pWe="_title_1jfc2_28",o6={container:dWe,info:hWe,title:pWe},gWe=fd.getConfiguration().magic.apiKey,yWe=()=>{oL();const t=gce(),e=L2(),[r,n]=qe.useState(fi.WAITING_FOR_CONFIRMATION),i=qe.useCallback(async()=>{var c;const s=await fd.connection.connect(kl.ProviderType.MAGIC);return await Qce(((c=s.account)==null?void 0:c.toLowerCase())??"",s.provider),s},[]),a=qe.useCallback(async()=>{const{Magic:s}=await Dy(()=>Promise.resolve().then(()=>nL),void 0),{OAuthExtension:c}=await Dy(()=>Promise.resolve().then(()=>iL),void 0),u=new s(gWe,{extensions:[new c]});try{n(fi.VALIDATING_SIGN_IN),await(u==null?void 0:u.oauth.getRedirectResult()),n(fi.WAITING_FOR_CONFIRMATION)}catch(f){console.log(f),e("/login")}},[e]);qe.useEffect(()=>{a()},[]);const o=qe.useCallback(async()=>{var c;const s=Gw();try{n(fi.WAITING_FOR_SIGNATURE);const f=((c=(await i()).account)==null?void 0:c.toLowerCase())??"";s.identify({ethAddress:f}),s.track(Ic.LOGIN_SUCCESS,{eth_address:f}),await N5(500),t?window.location.href=decodeURIComponent(t):window.location.href="/"}catch(u){console.log(u),e("/login")}},[]);return r===fi.WAITING_FOR_CONFIRMATION?je.jsx(Ww.Modal,{size:"tiny",open:!0,children:je.jsxs("div",{className:o6.container,children:[je.jsx("h3",{className:o6.title,children:"Confirm your login"}),je.jsxs("div",{className:o6.info,children:[je.jsx("span",{children:"This step only verifies your identity."}),je.jsx("span",{children:"No payments or transactions will ocurr without your explicit approval."})]}),je.jsx(Pc.Button,{primary:!0,onClick:o,children:"Continue"})]})}):je.jsx(yce,{open:!0,state:r,onTryAgain:i,providerType:kl.ProviderType.MAGIC})},mWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image1-a4aa795b.webp",vWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image10-c7fbcc61.webp",bWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image2-0af6ed59.webp",wWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image3-c864ad86.webp",_We="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image4-7964be5f.webp",EWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image5-fcca517e.webp",xWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image6-c770bdf5.webp",AWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image7-341595c4.webp",SWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image8-fea9fe85.webp",IWe="https://cdn.decentraland.org/@dcl/auth-site/0.2.0/assets/image9-714885ef.webp",OWe="_main_qwc0l_1",PWe="_title_qwc0l_11",TWe="_infoModal_qwc0l_15",RWe="_infoContent_qwc0l_19",CWe="_info_qwc0l_15",NWe="_goBackButton_qwc0l_33",E0={main:OWe,title:PWe,infoModal:TWe,infoContent:RWe,info:CWe,goBackButton:NWe},DWe={i18n:{title:"How does Magic work?",subtitle:"Magic handles digital wallet creation & management behind the scenes so you don't have to. Just log into Decentraland with your favorite social account and let Magic handle the rest.<br /> <br />If you'd rather take a more hands-on approach to your digital asset storage (e.g. Wearables, NAMEs, etc.), you can get a digital wallet from a provider such as <a href='https://metamask.io/'>MetaMask</a> and use it to create your Decentraland account.",goBack:"Return to log in page"}},$We=t=>{const{i18n:e=DWe.i18n,onClose:r,open:n}=t;return je.jsxs(Ww.Modal,{size:"tiny",open:n,className:E0.infoModal,onClose:r,children:[je.jsx(TI,{title:"",onClose:r}),je.jsx(cL,{className:E0.infoContent,children:je.jsxs("div",{className:E0.main,children:[je.jsx("h1",{className:E0.title,children:e==null?void 0:e.title}),je.jsx("span",{className:E0.info,dangerouslySetInnerHTML:{__html:e==null?void 0:e.subtitle}}),je.jsx(Pc.Button,{className:E0.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},MWe="_main_1c8le_1",kWe="_infoModal_1c8le_11",LWe="_infoContent_1c8le_15",UWe="_info_1c8le_11",BWe="_infoImage_1c8le_26",FWe="_assets_1c8le_34",jWe="_login_1c8le_38",qWe="_goBackButton_1c8le_42",uc={main:MWe,infoModal:kWe,infoContent:LWe,info:UWe,infoImage:BWe,assets:FWe,login:jWe,goBackButton:qWe},HWe={i18n:{title:"What is a digital wallet?",assets:{title:"A Home For Your Digital Assets",text:"Wallets are used to send, receive, store, and display digital assets, such as your Decentraland Wearables, NAMEs, LANDs, etc."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, in the world of Web3 all you need to do is just connect your digital wallet."},goBack:"Return to log in page"}},zWe=t=>{const{i18n:e=HWe.i18n,onClose:r,open:n}=t;return je.jsxs(Ww.Modal,{size:"tiny",open:n,className:uc.infoModal,onClose:r,children:[je.jsx(TI,{title:"",onClose:r}),je.jsx(cL,{className:uc.infoContent,children:je.jsxs("div",{className:uc.main,children:[je.jsx("h1",{className:uc.title,children:e==null?void 0:e.title}),je.jsxs("article",{className:uc.info,children:[je.jsx("div",{className:gp(uc.infoImage,uc.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:uc.info,children:[je.jsx("div",{className:gp(uc.infoImage,uc.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(Pc.Button,{className:uc.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},VWe="_main_1d9a9_1",GWe="_background_1d9a9_8",WWe="_left_1d9a9_32",KWe="_leftInfo_1d9a9_42",YWe="_right_1d9a9_51",QWe="_footer_1d9a9_60",JWe="_guestInfo_1d9a9_79",Zv={main:VWe,background:GWe,"move-background":"_move-background_1d9a9_1",left:WWe,leftInfo:KWe,right:YWe,footer:QWe,guestInfo:JWe},WQ=[mWe,bWe,wWe,_We,EWe,xWe,AWe,SWe,IWe,vWe],XWe=()=>{oL();const t=Gw(),[e]=pme(),[r,n]=qe.useState(fi.CONNECTING_WALLET),[i,a]=qe.useState(!1),[o,s]=qe.useState(!1),[c,u]=qe.useState(!1),[f,d]=qe.useState(),g=gce(),m=g&&new URL(g).pathname.includes("/play"),[w,v]=qe.useState(0),y=qe.useCallback(O=>{const C=O&&GQ(O);t.track(Ic.CLICK,{action:Y0.LEARN_MORE,type:C?"Learn more about Magic":"Learn more about wallets"}),C?s(!0):a(!0)},[a,s,i,t]),_=qe.useCallback(()=>{a(!1),s(!1)},[a,s]),b=qe.useCallback(()=>{s(!o)},[s,o]),S=qe.useCallback(async()=>{await N5(500),t.track(Ic.LOGIN_CLICK,{type:"guest"})},[t]),x=qe.useMemo(()=>{if(g){const O=new URL(g);return O.searchParams.append("guest","true"),O.toString()}return""},[g]),I=qe.useCallback(async O=>{var M;const C=GQ(O);if(d(O),t.track(Ic.LOGIN_CLICK,{method:O,type:C?C5.WEB2:C5.WEB3}),C)n(fi.LOADING_MAGIC),await VQ(O);else try{u(!0),n(fi.CONNECTING_WALLET);const j=await VQ(O);e.get("fromRequests")!=="true"&&(n(fi.WAITING_FOR_SIGNATURE),await Qce(((M=j.account)==null?void 0:M.toLowerCase())??"",j.provider)),t.track(Ic.LOGIN_SUCCESS,{eth_address:j.account}),t.identify({ethAddress:j.account}),await N5(500),g?window.location.href=decodeURIComponent(g):window.location.href="/",u(!1)}catch(j){console.log("Error",JSON.stringify(j)),t.track(Ic.LOGIN_ERROR,{error:Ux(j)?j.message:j}),n(fi.ERROR)}},[n,u,d,g,e,t]),E=qe.useCallback(()=>{u(!1),d(void 0),n(fi.CONNECTING_WALLET)},[u]),p=qe.useCallback(()=>{f&&I(f)},[f]);return qe.useEffect(()=>{const O=setInterval(()=>{v(C=>C===WQ.length-1?0:C+1)},5e3);return()=>{clearInterval(O)}},[]),je.jsxs("main",{className:Zv.main,children:[je.jsx("div",{className:Zv.background,style:{backgroundImage:`url(${WQ[w]})`}}),je.jsx(zWe,{open:i,onClose:_}),je.jsx($We,{open:o,onClose:b}),je.jsx(yce,{open:c,state:r,onClose:E,onTryAgain:p,providerType:f?Yce(f):null}),je.jsx("div",{className:Zv.left,children:je.jsxs("div",{className:Zv.leftInfo,children:[je.jsx(cWe,{onLearnMore:y,onConnect:I,loadingOption:f,socialOptions:{primary:Hn.GOOGLE,secondary:[Hn.DISCORD,Hn.APPLE,Hn.X]},web3Options:{primary:Hn.METAMASK,secondary:[Hn.FORTMATIC,Hn.COINBASE,Hn.WALLET_CONNECT]}}),m&&je.jsxs("div",{className:Zv.guestInfo,children:["Quick dive?"," ",je.jsx("a",{href:x,onClick:S,children:"Explore as a guest"})]})]})})]})};(function(){const t=window.analytics=window.analytics||[];if(!t.initialize){if(t.invoked){window.console&&console.error&&console.error("Segment snippet included twice.");return}t.invoked=!0,t.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","user","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"],t.factory=function(e){return function(){const r=Array.prototype.slice.call(arguments);return r.unshift(e),t.push(r),t}};for(let e=0;e<t.methods.length;e++){const r=t.methods[e];t[r]=t.factory(r)}t.load=function(e,r){const n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://cdn.segment.com/analytics.js/v1/"+e+"/analytics.min.js";const i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i),t._loadOptions=r},t.SNIPPET_VERSION="4.15.2"}})();Gw().load(sL.get("SEGMENT_API_KEY"));wye.render(je.jsx(lJ.StrictMode,{children:je.jsx(hme,{basename:"/auth",children:je.jsxs(lme,{children:[je.jsx(ab,{path:"/login",element:je.jsx(XWe,{})}),je.jsx(ab,{path:"/callback",element:je.jsx(yWe,{})}),je.jsx(ab,{path:"/requests/:requestId",element:je.jsx(gHe,{})}),je.jsx(ab,{path:"*",element:je.jsx(vHe,{})})]})})}),document.getElementById("root"));export{ut as B,M5e as R,eoe as T,W$e as _,ii as a,za as b,Ne as c,Mc as d,fo as e,wN as f,uo as g,Ma as h,YW as n,uKe as o,Tc as p,cM as r,Nne as s,cKe as t,$y as y};
187
+ //# sourceMappingURL=index-02134da3.js.map