"use strict";var f=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},p=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},s;let d;const l=new Set;function w(e){i=void 0,l.add(e)}function h(e){i=void 0,l.delete(e)}const a={};function g(){if(d||(d=Object.freeze({register:c,get:y,on:E}),typeof window>"u"))return d;const e=Object.freeze({register:c});try{window.addEventListener("wallet-standard:register-wallet",({detail:t})=>t(e))}catch(t){console.error(`wallet-standard:register-wallet event listener could not be added
`,t)}try{window.dispatchEvent(new b(e))}catch(t){console.error(`wallet-standard:app-ready event could not be dispatched
`,t)}return d}function c(...e){return e=e.filter(t=>!l.has(t)),e.length?(e.forEach(t=>w(t)),a.register?.forEach(t=>u(()=>t(...e))),function(){e.forEach(r=>h(r)),a.unregister?.forEach(r=>u(()=>r(...e)))}):()=>{}}let i;function y(){return i||(i=[...l]),i}function E(e,t){return a[e]?.push(t)||(a[e]=[t]),function(){a[e]=a[e]?.filter(n=>t!==n)}}function u(e){try{e()}catch(t){console.error(t)}}class b extends Event{get detail(){return f(this,s,"f")}get type(){return"wallet-standard:app-ready"}constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),s.set(this,void 0),p(this,s,t,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}s=new WeakMap;exports.getWallets=g;
