import { listHappeningTreesWithContext } from "../happening/index.js";
import { createTaskHappeningTreeContext } from "./create-task-happening-context.js";
import { listTasks } from "./list-tasks.js";
import { getAttendee } from "../attendee/index.js";
export async function listTaskTrees(options) {
    const tasks = await listTasks(options);
    const attendeeIds = [...new Set(tasks.flatMap(task => task.attendees))];
    const attendees = await Promise.all(attendeeIds.map(getAttendee));
    const context = createTaskHappeningTreeContext({
        happenings: tasks,
        attendees
    });
    return listHappeningTreesWithContext(context);
}
//# sourceMappingURL=list-task-trees.js.map