import{u as R,m as V,n as q,o as D,r as n,q as a,T as P,G as W,v as I,w as Z,x as z,y as O,z as B}from"./index-CSWkpG4m.js";import"./splashScene-C8lWNnm4.js";const M=({teamName:s,onClose:c,onPinAsTab:h,sidebarVisible:C,onToggleSidebar:v,onSendMessage:u,onOpenTaskDetail:i,onOpenMemberProfile:d})=>{const T=R(s),{openTeamPage:k,commitOwnerSlotDrop:w,commitOwnerGridOrderDrop:S,setLayoutMode:x}=V(s),{sidebarVisible:m,toggleSidebarVisible:f}=q(),{dialog:G,openCreateTaskDialog:g}=D(s),b=C??m,y=v??f,t=n.useCallback(o=>e=>window.dispatchEvent(new CustomEvent(`graph:${o}`,{detail:{teamName:s,taskId:e}})),[s]),A=n.useMemo(()=>({onStartTask:t("start-task"),onCompleteTask:t("complete-task"),onApproveTask:t("approve-task"),onRequestReview:t("request-review"),onRequestChanges:t("request-changes"),onCancelTask:t("cancel-task"),onMoveBackToDone:t("move-back-to-done"),onDeleteTask:t("delete-task")}),[t]),j=n.useCallback(()=>{k(),c()},[c,k]),H=n.useCallback(()=>{g("")},[g]),E={onNodeDoubleClick:n.useCallback(o=>{o.kind==="task"?i?.(o.taskId):o.kind==="member"&&d?.(o.memberName)},[i,d]),onSendMessage:n.useCallback(o=>u?.(o),[u]),onOpenTaskDetail:n.useCallback(o=>i?.(o),[i]),onOpenMemberProfile:n.useCallback(o=>d?.(o),[d])};return a.jsxs("div",{className:"fixed inset-0 z-50 flex overflow-hidden",style:{background:"#050510"},children:[b?a.jsx(P,{teamName:s,surface:"graph-overlay",isActive:!0,isFocused:!0}):null,a.jsx(W,{data:T,events:E,isSurfaceActive:!0,onRequestClose:c,onRequestPinAsTab:h,onOpenTeamPage:j,onCreateTask:H,onToggleSidebar:y,isSidebarVisible:b,renderTopToolbarContent:()=>a.jsx(B,{teamName:s}),onLayoutModeChange:x,onOwnerSlotDrop:w,onOwnerGridOrderDrop:S,className:"team-graph-view min-w-0 flex-1",renderHud:o=>{const e=o,{getViewportSize:r,focusNodeIds:l,filters:p}=e;return a.jsxs(a.Fragment,{children:[a.jsx(z,{teamName:s,getTransientHandoffSnapshot:e.getTransientHandoffSnapshot,getCameraZoom:e.getCameraZoom,worldToScreen:e.worldToScreen,getNodeWorldPosition:e.getNodeWorldPosition,focusNodeIds:l,focusEdgeIds:e.focusEdgeIds??null}),a.jsx(O,{teamName:s,nodes:T.nodes,getActivityWorldRect:e.getActivityWorldRect,getCameraZoom:e.getCameraZoom,worldToScreen:e.worldToScreen,getNodeWorldPosition:e.getNodeWorldPosition,getViewportSize:r,focusNodeIds:l,enabled:p?.showActivity??!0,onOpenTaskDetail:i,onOpenMemberProfile:d})]})},renderEdgeOverlay:({edge:o,sourceNode:e,targetNode:r,onClose:l,onSelectNode:p})=>a.jsx(Z,{teamName:s,edge:o,sourceNode:e,targetNode:r,onClose:l,onSelectNode:p,onOpenTaskDetail:i}),renderOverlay:({node:o,onClose:e})=>a.jsx(I,{node:o,teamName:s,onClose:e,onSendMessage:r=>{u?.(r),e()},onCreateTask:g,onOpenTaskDetail:r=>{i?.(r),e()},onOpenMemberProfile:r=>{d?.(r),e()},...A})}),G]})};export{M as TeamGraphOverlay};
