import{o as e}from"./rolldown-runtime-C_s2cVnS.js";import{m as t,n}from"./vendor-react-nmZsNlRz.js";import{t as r}from"./utils-BRwGVQJx.js";import{t as i}from"./tab-dropdown-Buzc7hcg.js";import{t as a}from"./search-field-CFmQT00V.js";var o=n(),s=e(t(),1);function c(e){let t=(0,o.c)(6),{tabs:n,activeTab:r,onTabChange:a}=e,c;t[0]===a?c=t[1]:(c=e=>a?.(e),t[0]=a,t[1]=c);let l=r??n[0]?.id??``,u;return t[2]!==c||t[3]!==l||t[4]!==n?(u=(0,s.jsx)(i,{onChange:c,tabs:n,value:l,wideClassName:`justify-center`}),t[2]=c,t[3]=l,t[4]=n,t[5]=u):u=t[5],u}function l({children:e,className:t,tabs:n,activeTab:i,onTabChange:o,filters:l,onSearchChange:u,searchPlaceholder:d,searchHints:f,searchValue:p,searchHidden:m=!1,searchTrailingAction:h,...g}){let _=(n?.length??0)>0;return(0,s.jsxs)(`section`,{...g,className:r(`flex h-full min-w-0 flex-col overflow-hidden bg-(--ui-chat-surface-background)`,t),children:[(0,s.jsxs)(`div`,{className:`shrink-0`,children:[(_||!m)&&(0,s.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 px-3 pb-2 pt-[calc(var(--titlebar-height)+0.5rem)]`,children:[(0,s.jsx)(`div`,{className:`flex min-w-0 items-center justify-start`,children:!m&&(0,s.jsx)(a,{containerClassName:`max-w-[45vw]`,hints:f,onChange:u,placeholder:d,value:p})}),_?(0,s.jsx)(`div`,{className:`flex min-w-0 items-center justify-center`,"data-tour":`page-tabs`,children:(0,s.jsx)(c,{activeTab:i,onTabChange:o,tabs:n})}):(0,s.jsx)(`span`,{}),(0,s.jsx)(`div`,{className:`flex min-w-0 items-center justify-end`,children:h})]}),l?(0,s.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-3 pb-2`,children:l}):null]}),(0,s.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden bg-(--ui-chat-surface-background)`,children:e})]})}export{l as t};