import{l as p,d as P,aK as R,j as t,aT as C,ap as k,aW as A,bg as E,aX as M,bh as w,bi as H,C as G,bj as I,a as v,r as j,H as S,N as F,o as B,aa as L,S as K,p as Q,a_ as U,aL as V,bk as z}from"./index-DTC0Ed21.js";import{H as N}from"./tasks-ClycqzjK.js";import{T as y}from"./TasksSearchInput-CjnnmYfA.js";import{G as O,P as f}from"./index-Ckr8pn3D.js";import{u as W}from"./useTasksData-Vq9uamq9.js";const $=({sprint:s})=>{const{t:e}=p(),{taskKey:a}=P(i=>i.taskModalSlice),{data:n}=R(a);return t.jsx(N,{children:t.jsxs("title",{children:[n?n.Title:s.Name," | ",e("appName."+C)]})})},D=({onClick:s})=>{const{t:e}=p();return t.jsx(k,{illustration:"noResults",title:e("nodata.noResults.title"),description:e("nodata.noResults.description"),buttons:[{buttonText:e("nodata.noResults.action"),handleClick:s}]})},ss=()=>{const{t:s}=p();return t.jsxs(t.Fragment,{children:[t.jsx(N,{children:t.jsxs("title",{children:["404 | ",s("appName."+C)]})}),t.jsx(k,{title:s("404.title"),description:s("404.description",{entity:s("404.entities.page")}),illustration:"404",buttons:[{buttonText:s("404.goHome"),handleClick:()=>A.navigate("/")}]})]})},ts=({onClick:s})=>{const{t:e}=p(),a=E();return t.jsx(k,{illustration:"noTasks",title:e("nodata.noTasks2.title"),description:e("nodata.noTasks2.description"),buttons:a.tasks.create?[{buttonText:e("nodata.noTasks2.action"),handleClick:s}]:[]})},es=({sprintData:s,search:e,setSearch:a,performerIds:n,setPerformerIds:i,loading:c})=>{const{t:r}=p(),l=M(s.rootProjectId),x=w(),u=!!H(G.sprintTimeline,x.pathname),h=I("(max-width: 768px)"),m=I("(max-width: 576px)"),{project:o}=v(s.ProjectId),d=j.useMemo(()=>t.jsxs(S,{gap:16,children:[l.tasks.create&&t.jsx(F,{leftSection:!m&&t.jsx(L,{size:16}),onClick:()=>B({defaultValues:{sprint:s}}),children:r("sidebar.action.addTask")}),!u&&t.jsx(O,{})]}),[l.tasks.create,u,s,m,r]);return h?t.jsxs(K,{gap:16,children:[t.jsx(y,{value:e,onChange:a,loading:c}),t.jsxs(S,{gap:16,justify:"space-between",children:[(o==null?void 0:o.rootProjectId)&&t.jsx(f,{projectId:o.rootProjectId,selected:n,onSelect:i}),d]})]}):t.jsxs(S,{justify:"space-between",gap:16,align:"flex-start",children:[t.jsxs(S,{style:{gap:"16px 24px"},flex:1,children:[t.jsx(y,{value:e,onChange:a,loading:c}),(o==null?void 0:o.rootProjectId)&&t.jsx(f,{projectId:o.rootProjectId,selected:n,onSelect:i})]}),d]})},X=s=>Q.useGetAvailableStatusesQuery({entityType:(s==null?void 0:s.statusesEntityType)||0,entityIds:[(s==null?void 0:s.statusesEntityId)||0]},{skip:!s}),ns=({sprintData:s,projectData:e})=>{const a=U(),n=P(g=>{var T,b;return(b=(T=g.settingsSlice.sprints)==null?void 0:T[s.Id])==null?void 0:b.performerIds}),[i,c]=V(""),{groupedBySprint:r,error:l,isError:x,isLoading:u,isFetching:h,isSearching:m}=W({sprintId:s.Id,performerIds:n,search:i}),o=!!(n!=null&&n.length)||m,d=j.useCallback(g=>{a(z({sprintId:s.Id.toString(),settings:{performerIds:g}}))},[a,s.Id]);return X(e),j.useMemo(()=>({sprintData:s,search:i,setSearch:c,error:l,performerIds:n,handleAssign:d,isFetching:h,isError:x,isLoading:u,groupedBySprint:r,withFilters:o}),[l,r,d,x,h,u,n,i,c,s,o])};export{ss as N,$ as S,es as a,D as b,ts as c,ns as u};
