import{u as D,j as r,P as E,a as P,r as l,S as k,D as I,o as T}from"./index-n-59FgrC.js";import{E as v}from"./useTaskTypesData-CgG6u01U.js";import{u as A}from"./useClearSelectedTasksBeforeUnload-DN10KOjz.js";import{u as C,S as y,T as L}from"./useSprintDnd-CJDVVJPx.js";import{u as M,A as N,N as H,a as R,S as B,b as O,c as b,d as w,E as U}from"./useSprintPage--OQBPn1w.js";import"./useDnd-BLM6vUjp.js";import"./tasks-CZQGFm5u.js";import"./get-env-uyVen0u2.js";import"./useTasksData-B6wVLlCr.js";import"./use-resize-observer-Bh8oaK16.js";import"./TasksSearchInput-5LSyivTU.js";import"./GenericViewSettings-0aFJmnZF.js";import"./IconChevronLeft-CyT72r93.js";import"./IconGripVertical-Ce_4nROx.js";import"./IconUser-BvK8eLe8.js";import"./modifiers.esm-V6KF7boE.js";import"./IconSortDescending-DCVZ-bvF.js";import"./const-C6xp0SqX.js";const ir=()=>{A();const{factSprint:e,sprint:s,isFetching:a}=M(),{project:t,isFetching:o}=D(s==null?void 0:s.ProjectId);return a||o?r.jsx(E,{h:"calc(100vh - 81px)"}):!s||!t?e?r.jsx(N,{}):r.jsx(H,{}):r.jsx(P,{projectId:t.Id,children:r.jsx(V,{sprintData:s,projectData:t})})},V=e=>{const{sprintData:s,search:a,setSearch:t,error:o,performerIds:d,handleAssign:i,handleFiltersApply:n,isFetching:m,isError:p,isLoading:u,groupedBySprint:j,withFilters:x}=R(e),{handleDragMove:S,handleDragEnd:f,sensors:g}=C({}),[h,c]=l.useState([]);l.useEffect(()=>{t("")},[s.Id]);const F=()=>{i([]),t(""),c([]),n(U)};return p?r.jsx(v,{error:o}):r.jsxs(r.Fragment,{children:[r.jsx(B,{sprint:s}),r.jsxs(k,{gap:"lg",flex:1,children:[r.jsx(O,{sprintData:s,search:a,setSearch:t,performerIds:d,setPerformerIds:i,loading:m,onFiltersApply:n,filters:h,setFilters:c}),r.jsxs(I,{onDragMove:S,onDragEnd:f,sensors:g,children:[r.jsx(y,{sprint:s,isError:p,isLoading:u,tasks:j[s.Id],emptyState:x?r.jsx(b,{onClick:F}):r.jsx(w,{onClick:()=>T({defaultValues:{sprint:s}})})}),r.jsx(L,{})]})]})]})};export{ir as default};
