{"version":3,"file":"store.js","sources":["requirejs/events/store.js"],"sourcesContent":["define([\"require\", \"exports\", \"knockout\"], function (require, exports, ko) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.ComponentEventStore = exports.ScopedEventStore = void 0;\n class ScopedEventStore {\n constructor() {\n this.publish = (event, componentInfo) => {\n this.subscribable.notifySubscribers({ event, componentInfo });\n };\n this.subscribe = (eventType, callback) => {\n return this.subscribable.subscribe((data) => {\n if (data.event instanceof eventType)\n callback(data.event, data.componentInfo);\n });\n };\n this.subscribable = new ko.subscribable();\n }\n }\n exports.ScopedEventStore = ScopedEventStore;\n class ComponentEventStore {\n constructor(componentInfo, masterBus) {\n this.publish = (event) => {\n this.masterBus.publish(event, this.componentInfo);\n };\n this.subscribe = (eventType, callback) => {\n this.subscriptions.push(this.masterBus.subscribe(eventType, (event, ci) => callback(event, ci)));\n };\n this.dispose = () => {\n this.subscriptions.forEach(sub => sub.dispose());\n };\n this.componentInfo = componentInfo;\n this.masterBus = masterBus;\n this.subscriptions = [];\n }\n }\n exports.ComponentEventStore = ComponentEventStore;\n});\n//# sourceMappingURL=store.js.map"],"names":["define","require","exports","ko","Object","defineProperty","value","ComponentEventStore","ScopedEventStore","constructor","this","publish","event","componentInfo","subscribable","notifySubscribers","subscribe","eventType","callback","data","masterBus","subscriptions","push","ci","dispose","forEach","sub"],"mappings":"AAAAA,OAAO,CAAC,UAAW,UAAW,YAAa,SAAUC,EAASC,EAASC,gBAEnEC,OAAOC,eAAeH,EAAS,aAAc,CAAEI,OAAO,IACtDJ,EAAQK,oBAAsBL,EAAQM,sBAAmB,EAezDN,EAAQM,uBAbJC,cACIC,KAAKC,QAAU,CAACC,EAAOC,KACnBH,KAAKI,aAAaC,kBAAkB,CAAEH,MAAAA,EAAOC,cAAAA,KAEjDH,KAAKM,UAAY,CAACC,EAAWC,IAClBR,KAAKI,aAAaE,UAAU,IAC3BG,EAAKP,iBAAiBK,GACtBC,EAASC,EAAKP,MAAOO,EAAKN,iBAGtCH,KAAKI,aAAe,IAAIX,EAAGW,eAoBnCZ,EAAQK,0BAfJE,YAAYI,EAAeO,GACvBV,KAAKC,QAAU,IACXD,KAAKU,UAAUT,QAAQC,EAAOF,KAAKG,gBAEvCH,KAAKM,UAAY,CAACC,EAAWC,KACzBR,KAAKW,cAAcC,KAAKZ,KAAKU,UAAUJ,UAAUC,EAAW,CAACL,EAAOW,IAAOL,EAASN,EAAOW,MAE/Fb,KAAKc,QAAU,KACXd,KAAKW,cAAcI,QAAQC,GAAOA,EAAIF,YAE1Cd,KAAKG,cAAgBA,EACrBH,KAAKU,UAAYA,EACjBV,KAAKW,cAAgB"}