import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { notFound } from 'next/navigation';
import { resolve } from '../../../../lib/server-container.js';
import { getFeatureFlags } from '../../../../lib/feature-flags.js';
import { SupervisorConfigForm } from '../../../../components/supervisor/supervisor-config-form.js';
/** Skip static pre-rendering — the page resolves a runtime DI container. */
export const dynamic = 'force-dynamic';
export default async function SupervisorRoute({ params, searchParams }) {
    const flags = getFeatureFlags();
    if (!flags.collaboration) {
        notFound();
    }
    const { id } = await params;
    const { feature } = await searchParams;
    const featureId = feature?.trim() ? feature : undefined;
    const useCase = resolve('GetSupervisorPolicyUseCase');
    const policy = await useCase.execute({ scopeType: 'app', scopeId: id, featureId });
    return (_jsxs("div", { className: "flex h-full flex-col gap-6 p-6", children: [_jsxs("header", { children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Supervisor" }), _jsxs("p", { className: "text-muted-foreground text-sm", children: ["Configure a delegated guardian agent for this scope", featureId ? ' (feature override)' : '', "."] })] }), _jsx(SupervisorConfigForm, { scopeType: "app", scopeId: id, featureId: featureId, initialPolicy: policy })] }));
}
