"use strict";var d=Object.defineProperty;var l=(t,e,s)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var n=(t,e,s)=>l(t,typeof e!="symbol"?e+"":e,s);const u=require("pino");require("./sl-types.js");require("nanostores");const i=require("./useStreamLayerApp2.js"),c=u.pino({level:"trace",enabled:typeof window<"u"&&!!window.localStorage.getItem("SL_DEBUG"),browser:{write:t=>{console.log(t)}}}),a=(t,e)=>c.child({name:t},e);class v extends Event{constructor(s,r){super(s);n(this,"slEventBus");this.slEventBus=r}}const w=a("event-bus");class E{constructor(e="sl-event-bus"){n(this,"name");n(this,"listeners");n(this,"emit",(e,s)=>{const r=new v(this.name,{...s,type:e});w.debug(r,"Emitting event"),window.dispatchEvent(r)});n(this,"destroy",()=>{this.listeners.forEach(e=>{window.removeEventListener(this.name,e),this.listeners.delete(e)}),this.listeners.clear()});this.name=e,this.listeners=new Set}listen(e){return window.addEventListener(this.name,e),this.listeners.add(e),()=>{this.off(e)}}off(e){window.removeEventListener(this.name,e),this.listeners.delete(e)}}window.slStore=Object.create(null);var o;(function(t){t.ORGANIZATION="ORGANIZATION",t.STREAM="STREAM"})(o||(o={}));i.SdkOverlayType.BETTING+"",i.SdkOverlayType.GAMES+"",i.SdkOverlayType.PUBLIC_CHAT+"",i.SdkOverlayType.TWITTER+"";exports.FeatureStatus=void 0;(function(t){t.Ready="ready",t.Suspended="suspended"})(exports.FeatureStatus||(exports.FeatureStatus={}));exports.EventBus=E;exports.createLogger=a;
