import { y as defineEventHandler, aC as publicSettings, a3 as getMaxLastModifieds, af as handleCache, aD as publicSettingsLastModified } from '../../nitro/nitro.mjs';
import 'luxon';
import '@sequelize/core';
import 'html-to-text';
import 'zod';
import 'crypto';
import 'node:fs';
import 'sharp';
import 'path';
import 'node:stream';
import 'jsdom';
import 'dompurify';
import 'mime-types';
import 'fs';
import 'fs/promises';
import 'linkify-html';
import '@peertube/http-signature';
import 'jsonld';
import 'lodash.intersection';
import 'email-templates';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'node:events';
import 'node:buffer';
import 'node:path';
import 'vue';
import 'vue-router';
import 'dotenv';
import 'url';
import 'bcryptjs';
import 'slugify';
import 'umzug';
import 'consola';
import '@sequelize/core/decorators-legacy';
import 'util';
import 'mitt';
import 'ical.js';
import 'node:url';
import 'fast-xml-parser';

const index = defineEventHandler(async (evt) => {
  const nodeinfo = {
    links: [
      { href: `${publicSettings.baseurl}/.well-known/nodeinfo/2.0`, rel: "http://nodeinfo.diaspora.software/ns/schema/2.0" },
      { href: `${publicSettings.baseurl}/.well-known/nodeinfo/2.1`, rel: "http://nodeinfo.diaspora.software/ns/schema/2.1" },
      ...publicSettings.enable_federation ? [{
        rel: "https://www.w3.org/ns/activitystreams#Application",
        href: `${publicSettings.baseurl}/federation/u/${publicSettings?.instance_name ?? "relay"}`
      }] : []
    ]
  };
  const lastModified = getMaxLastModifieds([
    publicSettingsLastModified.instance_name,
    publicSettingsLastModified.baseurl,
    publicSettingsLastModified.enable_federation
  ]);
  if (await handleCache(evt, lastModified)) return;
  return nodeinfo;
});

export { index as default };
