import { g as getCategoryTree } from '../../chunks/category-manager_oFBF0xlN.mjs';
export { renderers } from '../../renderers.mjs';

const GET = async ({ url }) => {
  try {
    const dimension = url.searchParams.get("dimension") || void 0;
    const tree = await getCategoryTree(dimension);
    return new Response(JSON.stringify({ categories: tree }), {
      headers: { "Content-Type": "application/json" }
    });
  } catch (e) {
    return new Response(JSON.stringify({ error: e.message }), { status: 500 });
  }
};

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  GET
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
