'use strict'; const createEmitter = () => { const listens = /* @__PURE__ */ new Map(); const off = (type, handler) => { const handlers = listens.get(type); if (handlers) { handler ? handlers.delete(handler) : handlers.clear(); } }; const on = (type, handler) => { const handlers = listens.get(type); handlers ? handlers.add(handler) : listens.set(type, /* @__PURE__ */ new Set([handler])); return () => off(type, handler); }; const emit = (type, ...event) => { const handlers = listens.get(type); if (handlers) { handlers.forEach((handler) => handler(...event)); } }; return { on, emit, off, listens }; }; exports.createEmitter = createEmitter;