import { h as head } from './index2-CzosXNJA.js';
import { p as page, g as goto } from './index3-DWsxdehH.js';
import { A as AgentSidebar } from './AgentSidebar-DRTSgEv8.js';
import { T as Tabs, a as Tab } from './Tab-Bkjowzww.js';
import { g as getAgentsContext } from './agents-context-BFekPmHw.js';
import './context-BZ_07CFR.js';
import './state.svelte-Yu4RD6aK.js';
import './utils-KcIDVAAe.js';
import './index-FgxKh3J4.js';
import './Link-BxAwzNX6.js';
import './html-FW6Ia4bL.js';

function _page($$renderer, $$props) {
  $$renderer.component(($$renderer2) => {
    const { data } = $$props;
    const { onAgentSelect } = getAgentsContext();
    let sidebarCollapsed = false;
    const activeTopTab = (() => {
      return page.url.pathname.split("/")[1];
    })();
    function handleAgentClick(agentId) {
      onAgentSelect(agentId);
      const [proj, ag] = (agentId || "").split("/");
      if (proj && ag) {
        goto();
      }
    }
    function handleTabChange({ value }) {
      if (value === activeTopTab) return;
      if (value === "traces") return goto();
      if (value === "roleplay") return goto();
      goto();
    }
    head($$renderer2, ($$renderer3) => {
      $$renderer3.title(($$renderer4) => {
        $$renderer4.push(`<title>Recombine Agents Hub: Tests</title>`);
      });
    });
    $$renderer2.push(`<div class="flex h-screen">`);
    AgentSidebar($$renderer2, {
      className: "flex-none",
      agents: data.agents,
      currentAgent: "",
      onAgentClick: handleAgentClick,
      onToggle: () => sidebarCollapsed = !sidebarCollapsed,
      isCollapsed: sidebarCollapsed
    });
    $$renderer2.push(`<!----> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-700 py-2 pr-lg"><nav class="flex h-14 flex-none items-center justify-between bg-rc-gray-700"><div class="flex items-center">`);
    Tabs($$renderer2, {
      value: activeTopTab,
      ariaLabel: "Top tabs",
      onChange: handleTabChange,
      children: ($$renderer3) => {
        Tab($$renderer3, {
          value: "roleplay",
          children: ($$renderer4) => {
            $$renderer4.push(`<!---->Roleplay`);
          }
        });
        $$renderer3.push(`<!----> `);
        Tab($$renderer3, {
          value: "tests",
          children: ($$renderer4) => {
            $$renderer4.push(`<!---->Tests`);
          }
        });
        $$renderer3.push(`<!----> `);
        Tab($$renderer3, {
          value: "traces",
          children: ($$renderer4) => {
            $$renderer4.push(`<!---->Traces`);
          }
        });
        $$renderer3.push(`<!---->`);
      },
      $$slots: { default: true }
    });
    $$renderer2.push(`<!----></div></nav> <div class="flex-1 border-thin border-gray-700 border-rc-gray-300/40 pt-40"><div class="flex h-full items-start justify-center text-rc-gray-200">Select an agent on the left panel to start testing</div></div></div> `);
    {
      $$renderer2.push("<!--[!-->");
    }
    $$renderer2.push(`<!--]--></div>`);
  });
}

export { _page as default };
//# sourceMappingURL=_page.svelte-gOKW9OPa.js.map
