{"version":3,"file":"EventsManager.cjs","sources":["../../src/core/EventsManager.js"],"sourcesContent":["/**\n * Manager for delegated events.\n * @private\n */\nclass EventsManager {\n    constructor() {\n        this.listeners = [];\n        this.types = new Set();\n        this.previousSize = 0;\n    }\n\n    /**\n     * Add a listener to the events manager.\n     * @param {Function} listener The listener to add.\n     * @param {string} type The type of event.\n     * @return {number} The index of the listener.\n     */\n    addListener(listener, type) {\n        this.types.add(type);\n        this.listeners.push(listener);\n        return this.listeners.length - 1;\n    }\n\n    /**\n     * Reset the events manager.\n     */\n    reset() {\n        this.listeners = [];\n        this.previousSize = this.types.size;\n    }\n\n    /**\n     * Check if there are pending types.\n     * @return {boolean} True if there are pending types, false otherwise.\n     */\n    hasPendingTypes() {\n        return this.types.size > this.previousSize;\n    }\n}\n\nexport default EventsManager;\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA,MAAM,aAAa,CAAC;AACpB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,SAAS,GAAG,EAAE;AAC3B,QAAQ,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE;AAC9B,QAAQ,IAAI,CAAC,YAAY,GAAG,CAAC;AAC7B,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE;AAChC,QAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAC5B,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AACrC,QAAQ,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;AACxC,IAAI;;AAEJ;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,SAAS,GAAG,EAAE;AAC3B,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI;AAC3C,IAAI;;AAEJ;AACA;AACA;AACA;AACA,IAAI,eAAe,GAAG;AACtB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY;AAClD,IAAI;AACJ;;;;"}