import{r as u,b3 as y,b4 as A,b5 as B,aB as N,aC as O,j,b6 as H,b7 as k,N as M}from"./index-n-59FgrC.js";import{g as $}from"./get-env-uyVen0u2.js";import{O as Y}from"./useTaskTypesData-CgG6u01U.js";var G=u.useLayoutEffect,K=function(e){var r=y.useRef(e);return G(function(){r.current=e}),r},L=function(e,r){if(typeof e=="function"){e(r);return}e.current=r},Z=function(e,r){var n=y.useRef();return y.useCallback(function(i){e.current=i,n.current&&L(n.current,null),n.current=r,r&&L(r,i)},[r])},R={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},D=function(e){Object.keys(R).forEach(function(r){e.style.setProperty(r,R[r],"important")})},E=D,o=null,w=function(e,r){var n=e.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function U(t,e,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),o||(o=document.createElement("textarea"),o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),E(o)),o.parentNode===null&&document.body.appendChild(o);var i=t.paddingSize,s=t.borderSize,a=t.sizingStyle,f=a.boxSizing;Object.keys(a).forEach(function(g){var v=g;o.style[v]=a[v]}),E(o),o.value=e;var d=w(o,t);o.value=e,d=w(o,t),o.value="x";var c=o.scrollHeight-i,l=c*r;f==="border-box"&&(l=l+i+s),d=Math.max(l,d);var h=c*n;return f==="border-box"&&(h=h+i+s),d=Math.min(h,d),[d,c]}var C=function(){},X=function(e,r){return e.reduce(function(n,i){return n[i]=r[i],n},{})},q=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],J=!!document.documentElement.currentStyle,Q=function(e){var r=window.getComputedStyle(e);if(r===null)return null;var n=X(q,r),i=n.boxSizing;if(i==="")return null;J&&i==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var s=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:s,borderSize:a}},V=Q;function I(t,e,r){var n=K(r);u.useLayoutEffect(function(){var i=function(a){return n.current(a)};if(t)return t.addEventListener(e,i),function(){return t.removeEventListener(e,i)}},[])}var ee=function(e){I(window,"resize",e)},te=function(e){I(document.fonts,"loadingdone",e)},re=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],ne=function(e,r){var n=e.cacheMeasurements,i=e.maxRows,s=e.minRows,a=e.onChange,f=a===void 0?C:a,d=e.onHeightChange,c=d===void 0?C:d,l=A(e,re),h=l.value!==void 0,g=u.useRef(null),v=Z(g,r),z=u.useRef(0),b=u.useRef(),m=function(){var p=g.current,x=n&&b.current?b.current:V(p);if(x){b.current=x;var T=U(x,p.value||p.placeholder||"x",s,i),S=T[0],P=T[1];z.current!==S&&(z.current=S,p.style.setProperty("height",S+"px","important"),c(S,{rowHeight:P}))}},_=function(p){h||m(),f(p)};return u.useLayoutEffect(m),ee(m),te(m),u.createElement("textarea",B({},l,{onChange:_,ref:v}))},ie=u.forwardRef(ne);const ae={},F=N((t,e)=>{const{autosize:r,maxRows:n,minRows:i,__staticSelector:s,resize:a,...f}=O("Textarea",ae,t),d=r&&$()!=="test",c=d?{maxRows:n,minRows:i}:{};return j.jsx(H,{component:d?ie:"textarea",ref:e,...f,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":r&&n===void 0||void 0,__vars:{"--input-resize":a},...c})});F.classes=H.classes;F.displayName="@mantine/core/Textarea";function ce({tasks:t,statuses:e}){const r=oe(e),n=k(e,"Id");return t==null?void 0:t.map(i=>{var s;return{...i,Status:((s=n[i.Status])==null?void 0:s.Id)||(r==null?void 0:r.Id)||0}})}function oe(t){return t.find(e=>e.Type===M.IStatusType.BeExecuted)||t[0]}const fe=(t,e)=>t.FromId!==e?Y[t.Type]:t.Type,le=(t,e,r)=>{const{status:n,order:i,incrementOrder:s=!1}=r||{},a={sprint:e,Order:i!==void 0?s?i+1:i:void 0};return n&&(a.Status=n.Id),t.type==="type"?{...a,TypeId:t.taskType.Id}:t.type==="priority"?{...a,Priority:t.priority}:t.type==="performer"?{...a,performers:t.user??[]}:t.type==="status"?{...a,Status:t.status.Id}:a};export{F as T,fe as a,le as g,ce as p};
