function createActivityStore() {
  const active = /* @__PURE__ */ new Map();
  const listeners = /* @__PURE__ */ new Set();
  const fire = () => listeners.forEach((l) => l());
  return {
    begin(label) {
      const key = Symbol(label);
      active.set(key, label);
      fire();
      return () => {
        if (active.delete(key)) fire();
      };
    },
    busy: () => active.size > 0,
    labels: () => Array.from(active.values()),
    subscribe: (fn) => {
      listeners.add(fn);
      return () => {
        listeners.delete(fn);
      };
    }
  };
}
export {
  createActivityStore
};
//# sourceMappingURL=activity-store.js.map