import{K as H,c as k,j as r,A as F,a as q,bO as z,G as N,b9 as K,c$ as W,d0 as X,d1 as Y,d2 as Q,d3 as U,d4 as J,u as A,aj as Z,r as M,af as O,b1 as ee,$ as G,d5 as L,aM as te,d6 as se,d7 as ne,d8 as re,S as $,aV as ie,aW as V,aX as le,aY as ae,n as P,d9 as oe,da as ce,a_ as de,db as ue,dc as fe,dd as he,bQ as pe,de as D,f as me}from"./index-26FXPGkN.js";import{I as ge}from"./IconChevronLeft-FAloe5QL.js";import{I as xe}from"./IconGripVertical-COCN8Vqa.js";import{a as ye,I as be}from"./IconUser-CkQmhwMi.js";import{I as je}from"./IconHash-CICnDO3n.js";import{r as _e}from"./modifiers.esm-C9J_M9CQ.js";/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ve=[["path",{d:"M12 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M6 12a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M15 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]],ke=H("outline","adjustments-horizontal","AdjustmentsHorizontal",ve);/**
 * @license @tabler/icons-react v3.36.1 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Se=[["path",{d:"M5 14h14l-4.5 -4.5l4.5 -4.5h-14v16",key:"svg-0"}]],we=H("outline","flag-3","Flag3",Se),Ie=t=>{const e=k.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(ge,{}),e[0]=n):n=e[0];let s;return e[1]!==t?(s=r.jsx(F,{size:"sm",variant:"subtle",color:"gray.5",c:"light-dark(var(--mantine-color-dark-5), var(--mantine-color-dark-0))",...t,children:n}),e[1]=t,e[2]=s):s=e[2],s},Ce=t=>{const e=k.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(q,{}),e[0]=n):n=e[0];let s;return e[1]!==t?(s=r.jsx(F,{size:"sm",variant:"subtle",color:"gray.5",c:"light-dark(var(--mantine-color-dark-5), var(--mantine-color-dark-0))",...t,children:n}),e[1]=t,e[2]=s):s=e[2],s},Te="_menuItem_1igh0_1",Oe="_field_1igh0_15",$e="_icon_1igh0_23",De="_label_1igh0_24",ze="_grip_1igh0_30",Me="_switchInput_1igh0_50",Fe="_switchTrack_1igh0_50",Ne="_switchThumb_1igh0_55",S={menuItem:Te,field:Oe,icon:$e,label:De,switch:"_switch_1igh0_25",grip:ze,switchInput:Me,switchTrack:Fe,switchThumb:Ne},E=t=>{const e=k.c(35);let n,s,o,c,i,l,d,p,y,a;e[0]!==t?({id:c,icon:o,label:l,value:a,disabled:n,keepOrder:i,gripProps:s,ref:p,onChange:d,...y}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=c,e[5]=i,e[6]=l,e[7]=d,e[8]=p,e[9]=y,e[10]=a):(n=e[1],s=e[2],o=e[3],c=e[4],i=e[5],l=e[6],d=e[7],p=e[8],y=e[9],a=e[10]);let u;e[11]!==s||e[12]!==i||e[13]!==a?(u=a&&r.jsx(z,{variant:"transparent",size:"sm",className:S.grip,"data-keep-order":i,...s,children:r.jsx(xe,{})}),e[11]=s,e[12]=i,e[13]=a,e[14]=u):u=e[14];let g;e[15]!==o?(g=r.jsx(z,{variant:"transparent",size:"sm",className:S.icon,children:o}),e[15]=o,e[16]=g):g=e[16];let f;e[17]!==l?(f=r.jsx(K,{className:S.label,children:l}),e[17]=l,e[18]=f):f=e[18];let h;e[19]===Symbol.for("react.memo_cache_sentinel")?(h={input:S.switchInput,track:S.switchTrack,thumb:S.switchThumb},e[19]=h):h=e[19];let m;e[20]!==c||e[21]!==d?(m=j=>d==null?void 0:d(c,j.currentTarget.checked),e[20]=c,e[21]=d,e[22]=m):m=e[22];let b;e[23]!==n||e[24]!==m||e[25]!==a?(b=r.jsx(W,{className:S.switch,classNames:h,size:"xs",checked:a,disabled:n,onChange:m}),e[23]=n,e[24]=m,e[25]=a,e[26]=b):b=e[26];let x;return e[27]!==n||e[28]!==p||e[29]!==y||e[30]!==u||e[31]!==g||e[32]!==f||e[33]!==b?(x=r.jsxs(N,{ref:p,className:S.field,gap:8,"data-disabled":n,...y,children:[u,g,f,b]}),e[27]=n,e[28]=p,e[29]=y,e[30]=u,e[31]=g,e[32]=f,e[33]=b,e[34]=x):x=e[34],x},Ae=()=>{const t=k.c(2),{active:e}=X();if(!(e!=null&&e.data.current))return null;const n=e.data.current;let s;return t[0]!==n?(s=r.jsx(Y,{children:r.jsx(Q,{children:r.jsx(E,{...n})})}),t[0]=n,t[1]=s):s=t[1],s},Ee=t=>{const e=k.c(22);let n,s;if(e[0]!==t){const{onChange:b,ref:x,...j}=t;n=b,s=j,e[0]=t,e[1]=n,e[2]=s}else n=e[1],s=e[2];let o;e[3]!==s?(o={id:s.id,data:s},e[3]=s,e[4]=o):o=e[4];const{attributes:c,listeners:i,setNodeRef:l,transform:d,transition:p,isDragging:y}=U(o);let a;if(e[5]!==c){const{tabIndex:b,...x}=c;a=x,e[5]=c,e[6]=a}else a=e[6];let u;e[7]!==d?(u=J.Transform.toString(d),e[7]=d,e[8]=u):u=e[8];const g=y?.5:1;let f;e[9]!==u||e[10]!==g||e[11]!==p?(f={transform:u,transition:p,opacity:g},e[9]=u,e[10]=g,e[11]=p,e[12]=f):f=e[12];let h;e[13]!==a||e[14]!==i?(h={...a,...i},e[13]=a,e[14]=i,e[15]=h):h=e[15];let m;return e[16]!==n||e[17]!==s||e[18]!==l||e[19]!==f||e[20]!==h?(m=r.jsx(E,{ref:l,style:f,gripProps:h,onChange:n,...s}),e[16]=n,e[17]=s,e[18]=l,e[19]=f,e[20]=h,e[21]=m):m=e[21],m},Ge=()=>{const t=k.c(13),{t:e}=A();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={skipAttributesCheck:!0},t[0]=n):n=t[0];const{generic:s,attributes:o,isKanban:c,onChange:i}=Z(n);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=[],t[1]=l):l=t[1];const[d,p]=M.useState(l);let y,a;t[2]!==o||t[3]!==s||t[4]!==c||t[5]!==e?(y=()=>{const m=Object.entries(Be[c?"kanban":"list"]).map(j=>{const[_,v]=j;return{...v,id:_,label:e(`sprintViewSettings.fields.${_}`),icon:Ve[_]}});m.push(...O(o,"Order").filter(Re).map(He));const x=m.map(Le).map(j=>{const _=s[j.id];return _?{...j,order:_.order,value:_.display}:j});p(O(x,"order"))},a=[o,s,c,e],t[2]=o,t[3]=s,t[4]=c,t[5]=e,t[6]=y,t[7]=a):(y=t[6],a=t[7]),M.useEffect(y,a);let u;t[8]!==i?(u=h=>{p(m=>{const b=typeof h=="function"?h(m):h;return ee(b,m)?m:(i(b.reduce(Pe,{})),O(b,"order"))})},t[8]=i,t[9]=u):u=t[9];const g=u;let f;return t[10]!==d||t[11]!==g?(f=[d,g],t[10]=d,t[11]=g,t[12]=f):f=t[12],f},Ve={type:r.jsx(se,{}),code:r.jsx(je,{}),name:r.jsx(te,{}),status:r.jsx(L,{}),priority:r.jsx(we,{}),performer:r.jsx(ye,{}),startDate:r.jsx(G,{}),dueDate:r.jsx(G,{})},Be={list:{type:{value:!0,keepOrder:!0},code:{value:!0,keepOrder:!0},name:{value:!0,disabled:!0,keepOrder:!0},status:{value:!0},priority:{value:!0},performer:{value:!0},startDate:{value:!1},dueDate:{value:!1}},kanban:{name:{value:!0,disabled:!0,keepOrder:!0},type:{value:!0,keepOrder:!0},code:{value:!0,keepOrder:!0},priority:{value:!0,keepOrder:!0},performer:{value:!0,keepOrder:!0},startDate:{value:!1,keepOrder:!0},dueDate:{value:!0,keepOrder:!0}}};function Re(t){return t.Type!==ne.IType.Collection}function He(t){return{id:String(t.Id),label:t.Name,value:!1,icon:re({type:t.Type,valueType:t.ValueType})}}function Le(t,e){return{...t,order:e}}function Pe(t,e){const{id:n,order:s,value:o}=e;return{...t,[n]:{order:s,display:o}}}const qe="_container_aox8m_1",Ke={container:qe},We=()=>{const t=k.c(23),{t:e}=A(),[n,s]=Ge();let o;t[0]!==n||t[1]!==s?(o=(g,f)=>{const h=Xe(n,{from:g,to:f});s(h)},t[0]=n,t[1]=s,t[2]=o):o=t[2];const c=o;let i;t[3]!==e?(i=e("sprintViewSettings.fieldGroups.visible"),t[3]=e,t[4]=i):i=t[4];let l;t[5]!==n?(l=n.filter(Ue),t[5]=n,t[6]=l):l=t[6];let d;t[7]!==c||t[8]!==s||t[9]!==i||t[10]!==l?(d=r.jsx(B,{title:i,fields:l,onChange:s,onOrder:c}),t[7]=c,t[8]=s,t[9]=i,t[10]=l,t[11]=d):d=t[11];let p;t[12]!==e?(p=e("sprintViewSettings.fieldGroups.hidden"),t[12]=e,t[13]=p):p=t[13];let y;t[14]!==n?(y=n.filter(Je),t[14]=n,t[15]=y):y=t[15];let a;t[16]!==s||t[17]!==p||t[18]!==y?(a=r.jsx(B,{title:p,fields:y,onChange:s}),t[16]=s,t[17]=p,t[18]=y,t[19]=a):a=t[19];let u;return t[20]!==d||t[21]!==a?(u=r.jsxs($,{className:Ke.container,mr:-10,children:[d,a]}),t[20]=d,t[21]=a,t[22]=u):u=t[22],u},B=t=>{const e=k.c(23),{title:n,fields:s,onChange:o,onOrder:c}=t,i=ie(V(ae,Ye),V(le,Qe));let l;e[0]!==o?(l=(x,j)=>{o(_=>_.map(v=>v.id===x?{...v,value:j}:v))},e[0]=o,e[1]=l):l=e[1];const d=l;let p;e[2]!==c?(p=x=>{x.over&&(c==null||c(String(x.active.id),String(x.over.id)))},e[2]=c,e[3]=p):p=e[3];const y=p;if(!s.length)return null;let a;e[4]!==n?(a=r.jsx(P,{fz:12,c:"gray.6",mb:4,children:n}),e[4]=n,e[5]=a):a=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=[_e],e[6]=u):u=e[6];let g;if(e[7]!==s||e[8]!==d){let x;e[10]!==d?(x=j=>{const _=j.keepOrder?E:Ee;return r.jsx(_,{...j,onChange:d},j.id)},e[10]=d,e[11]=x):x=e[11],g=s.map(x),e[7]=s,e[8]=d,e[9]=g}else g=e[9];let f;e[12]!==s||e[13]!==g?(f=r.jsx(oe,{items:s,strategy:ce,children:g}),e[12]=s,e[13]=g,e[14]=f):f=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(Ae,{}),e[15]=h):h=e[15];let m;e[16]!==y||e[17]!==i||e[18]!==f?(m=r.jsxs(de,{sensors:i,onDragEnd:y,modifiers:u,collisionDetection:ue,children:[f,h]}),e[16]=y,e[17]=i,e[18]=f,e[19]=m):m=e[19];let b;return e[20]!==a||e[21]!==m?(b=r.jsxs($,{gap:4,children:[a,m]}),e[20]=a,e[21]=m,e[22]=b):b=e[22],b},Xe=(t,{from:e,to:n})=>{const s=O(t,"order"),o=s.findIndex(l=>l.id===e),c=s.findIndex(l=>l.id===n),i=s[o];return s.splice(o,1),s.splice(c,0,i),s.map((l,d)=>({...l,order:d}))},Ye={activationConstraint:{distance:10}},Qe={activationConstraint:{delay:150,tolerance:5}};function Ue(t){return t.value}function Je(t){return!t.value}const Ze=t=>{const e=k.c(8),{icon:n,label:s,onClick:o}=t;let c;e[0]!==n?(c=r.jsx(z,{variant:"transparent",size:"sm",c:"inherit",children:n}),e[0]=n,e[1]=c):c=e[1];let i;e[2]!==s?(i=r.jsx(P,{fz:14,flex:1,children:s}),e[2]=s,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==c||e[6]!==i?(l=r.jsxs(N,{gap:8,className:S.menuItem,onClick:o,children:[c,i]}),e[4]=o,e[5]=c,e[6]=i,e[7]=l):l=e[7],l},ot=()=>{const t=k.c(37),{t:e}=A(),n=fe(),s=n??void 0;let o;t[0]!==s?(o={sprint:s,applyLastArgs:!0},t[0]=s,t[1]=o):o=t[1];const{handleDownload:c}=he(o),[i,l]=M.useState(n?"root":"fields");let d;t[2]!==n?(d={onClose:()=>{n&&setTimeout(()=>l("root"),100)}},t[2]=n,t[3]=d):d=t[3];const[p,y]=pe(!1,d),{toggle:a,close:u}=y;let g;t[4]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(ke,{style:{width:"50%",height:"50%"},stroke:1.5}),t[4]=g):g=t[4];let f;t[5]!==a?(f=r.jsx(D.Target,{children:r.jsx(F,{variant:"default",size:"lg","aria-label":"Settings",onClick:a,children:g})}),t[5]=a,t[6]=f):f=t[6];let h;t[7]!==n||t[8]!==i?(h=n&&i!=="root"&&r.jsx(Ie,{onClick:()=>l("root")}),t[7]=n,t[8]=i,t[9]=h):h=t[9];const m=`sprintViewSettings.tabs.${i}`;let b;t[10]!==e||t[11]!==m?(b=e(m),t[10]=e,t[11]=m,t[12]=b):b=t[12];let x;t[13]!==b?(x=r.jsx(me,{order:3,fz:16,fw:500,children:b}),t[13]=b,t[14]=x):x=t[14];let j;t[15]!==u?(j=r.jsx(Ce,{onClick:u}),t[15]=u,t[16]=j):j=t[16];let _;t[17]!==j||t[18]!==h||t[19]!==x?(_=r.jsxs(N,{justify:"space-between",children:[h,x,j]}),t[17]=j,t[18]=h,t[19]=x,t[20]=_):_=t[20];let v;t[21]!==u||t[22]!==c||t[23]!==e||t[24]!==i?(v=i==="root"&&r.jsx($,{gap:0,children:["fields","export"].map(C=>r.jsx(Ze,{icon:et[C],label:e(`sprintViewSettings.tabs.${C}`),onClick:()=>{C==="export"?(c(),u()):l(C)}},C))}),t[21]=u,t[22]=c,t[23]=e,t[24]=i,t[25]=v):v=t[25];let w;t[26]!==i?(w=i==="fields"&&r.jsx(We,{}),t[26]=i,t[27]=w):w=t[27];let I;t[28]!==_||t[29]!==v||t[30]!==w?(I=r.jsx(D.Dropdown,{children:r.jsxs($,{gap:16,h:"100%",children:[_,v,w]})}),t[28]=_,t[29]=v,t[30]=w,t[31]=I):I=t[31];let T;return t[32]!==p||t[33]!==I||t[34]!==f||t[35]!==a?(T=r.jsxs(D,{opened:p,onChange:a,width:300,floatingStrategy:"fixed",middlewares:tt,children:[f,I]}),t[32]=p,t[33]=I,t[34]=f,t[35]=a,t[36]=T):T=t[36],T},et={fields:r.jsx(L,{}),export:r.jsx(be,{})},R=t=>{const s=t.y+t.height+8;return Math.max(65,s)},tt={shift:{padding:0,crossAxis:!0,limiter:{fn:({x:t,rects:e})=>({x:t,y:R(e.reference)})}},size:{apply:async({elements:t,platform:e,strategy:n,rects:s})=>{const o=await e.getClippingRect({element:t.floating,boundary:"clippingAncestors",rootBoundary:"viewport",strategy:n}),c=R(s.reference);Object.assign(t.floating.style,{height:`${o.height-c}px`})}}};export{ot as G,we as I,ke as a};
