"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const s="aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906";let e=null;const a=window,i=()=>{e==null&&(e=a.metahub?a.metahub:a.scatter)};document.addEventListener("metahubLoaded",i),document.addEventListener("scatterLoaded",i),(a.metahub||a.scatter)&&i();class d{constructor(){this.appName="",this.network={}}get identity(){return e.identity}async connect(t="",n={}){return t&&(this.appName=t),n.network?this.network=Object.assign(this.network,n.network):n.chainId&&(this.network.chainId=n.chainId),new Promise(function(r){if(e!=null)r(!0);else{let c=0,o=setInterval(function(){(e!=null||++c==30)&&(clearInterval(o),r(e!=null))},100)}})}async login(t={}){return t.appName||(t.appName=this.appName||(location?location.host:"")),t.chainId||(t.chainId=this.network&&this.network.chainId?this.network.chainId:s),await e.login(t)}async hasAccountFor(t){return await e.hasAccountFor(t)}async getIdentity(t={}){return await e.getIdentity(t)}async logout(t=void 0){return await e.logout(t)}async forgetIdentity(t=void 0){return await e.forgetIdentity(t)}async getIdentityFromPermissions(){return await e.getIdentityFromPermissions()}async suggestNetwork(t){return await e.suggestNetwork(t)}async addToken(t){return await e.addToken(t)}async getArbitrarySignature(t,n){return await e.getArbitrarySignature(t,n)}eos(t,n,r){return e.eos(t,n,r)}eosHook(t){return e.eosHook(t)}async getVersion(){return await e.getVersion()}isMetahub(){return typeof e.isMetahub=="function"?e.isMetahub():!1}}const u=new d;exports.EOS_CHAIN_ID=s,exports.MetahubJS=u,exports.default=u;