import { i as defineEventHandler, t as getProvider, T as statusesForFilter } from '../../../nitro/nitro.mjs';
import 'node:path';
import 'node:module';
import 'node:fs';
import 'node:os';
import 'dotenv';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:crypto';
import 'node:async_hooks';
import 'node:url';
import 'node:net';
import '@iconify/utils';
import 'consola';

const statuses_get = defineEventHandler(async (event) => {
  var _a;
  const { provider, config } = getProvider(event);
  if (typeof provider.fetchAvailableStatuses === "function") {
    try {
      const statuses2 = await provider.fetchAvailableStatuses();
      if (statuses2.length > 0) return { statuses: statuses2 };
    } catch {
    }
  }
  const seen = /* @__PURE__ */ new Set();
  const statuses = [];
  const add = (s) => {
    if (typeof s === "string" && s.trim() && !seen.has(s)) {
      seen.add(s);
      statuses.push(s);
    }
  };
  for (const filter of ["open", "pending", "inprogress", "review", "done"]) {
    for (const s of (_a = statusesForFilter(config, filter)) != null ? _a : []) add(s);
  }
  return { statuses };
});

export { statuses_get as default };
//# sourceMappingURL=statuses.get.mjs.map
