@dubusoft/toodo-linux-arm64 1.6.1-dev.95 → 1.6.1-dev.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{i as e,n as t,r as n,s as r,t as i}from"./dist-ZmB2kPfR.js";import{B as a,F as o,L as s,M as c,N as l,P as u,Y as d,ct as f,g as p,lt as m,n as h,o as ee}from"./queries-CJ5m8_aN.js";import{a as g}from"./workspace-list-DK1jdO2h.js";import{A as _,C as te,D as v,E as y,It as b,K as ne,Lt as re,M as ie,Mt as x,N as S,O as C,P as ae,Pt as w,Rt as oe,S as se,T,Tt as E,V as D,_ as ce,b as O,bt as k,c as le,d as ue,f as A,g as j,h as M,ht as N,j as de,jt as P,k as fe,l as F,m as I,p as L,q as pe,s as me,u as R,v as z,vt as B,w as he,wt as V,x as H,xt as ge,y as U,yt as W}from"./index-CSNYP-Lh.js";import{t as G}from"./opener-DWhHPoCL.js";var K={name:`calendar-check`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]};K.node;var _e=t(K),q=r(e(),1),J=n(),ve={completed:w.success,opened_for_review:w.review,started:w.progress,worked_on:w.progress,planned:w.neutral},ye=i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,P.neutral),be=[{kind:`week`,label:`Week`},{kind:`month`,label:`Month`},{kind:`quarter`,label:`Quarter`},{kind:`year`,label:`Year`},{kind:`custom`,label:`Custom`}];function xe(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}function Se({disabled:e,children:t}){let[n,r]=(0,q.useState)(!1),i=(0,q.useRef)(null);return(0,q.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)},t=e=>e.key===`Escape`&&r(!1);return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[n]),(0,J.jsxs)(`div`,{ref:i,className:`relative`,children:[(0,J.jsxs)(m,{size:`sm`,"aria-haspopup":`menu`,"aria-expanded":n,disabled:e,onClick:()=>r(!n),children:[(0,J.jsx)(b,{}),(0,J.jsx)(`span`,{className:`max-md:sr-only`,children:`Export`})]}),n&&(0,J.jsx)(`div`,{role:`menu`,"aria-label":`Export review`,className:`absolute right-0 z-10 mt-1 flex w-48 flex-col rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:t(()=>r(!1))})]})}function Y(e,t){return`${e} ${t}${e===1?``:`s`}`}function X({onSelect:e,children:t}){return(0,J.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:e,className:`rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted max-md:min-h-11`,children:t})}function Ce(){let e=o(),t=a(),[n,r]=(0,q.useState)(!1),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(null),d=typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[];async function f(e){u(null);try{await t.mutateAsync(e),r(!1)}catch(e){u(e instanceof Error?e.message:String(e))}}if(!e.data)return null;let{timeZone:p,configured:h}=e.data;return n?(0,J.jsxs)(`form`,{"aria-label":`Review time zone`,className:`flex flex-wrap items-center gap-2 print:hidden`,onSubmit:e=>{e.preventDefault(),f(s)},children:[(0,J.jsx)(`label`,{htmlFor:`review-time-zone`,className:`text-xs`,children:`Time zone for every device`}),(0,J.jsx)(`input`,{id:`review-time-zone`,list:`review-time-zones`,required:!0,className:i(g,`w-56`),value:s,onChange:e=>c(e.target.value)}),(0,J.jsx)(`datalist`,{id:`review-time-zones`,children:d.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsx)(m,{size:`sm`,type:`submit`,disabled:t.isPending,children:`Save`}),h!==null&&(0,J.jsx)(m,{size:`sm`,type:`button`,variant:`outline`,onClick:()=>void f(null),children:`Use the server's`}),(0,J.jsx)(m,{size:`sm`,type:`button`,variant:`ghost`,onClick:()=>r(!1),children:`Cancel`}),l&&(0,J.jsx)(`span`,{role:`alert`,className:`w-full text-xs text-destructive`,children:l})]}):(0,J.jsxs)(`span`,{children:[`Days are in `,p,h===null&&` (the server's time zone)`,`.`,` `,(0,J.jsx)(`button`,{type:`button`,className:`text-primary underline underline-offset-2 hover:no-underline print:hidden`,onClick:()=>{c(h??p),r(!0)},children:`Change time zone`})]})}function Z({onShowTask:e}){let[t,n]=(0,q.useState)(()=>H(`week`,k(Date.now()/1e3))),[r,a]=(0,q.useState)(null),[o,y]=(0,q.useState)(U),[b,x]=(0,q.useState)(null),[S,C]=(0,q.useState)(null),w=c(t.from,t.to),T=u(),E=l(S),A=s(),j=p(),M=S!==null,N=M?E:w,de=d(),F=ee(),I=M?E.data?.workspaces??[]:[...de.data??[],...F.data?.workspaces??[]],L=new Map(I.map(e=>[e.id,e.name])),R=M?E.data&&{period:{kind:E.data.summary.period,from:E.data.summary.from,to:E.data.summary.to},entries:E.data.entries,start:E.data.summary.start,end:E.data.summary.end,timeZone:E.data.summary.timeZone,now:E.data.summary.savedAt}:w.data&&{period:t,entries:w.data.entries,start:w.data.start,end:w.data.end,timeZone:w.data.timeZone,now:Date.now()/1e3},z=R?.period??t,V=R&&ue(R.entries,o),W=fe(R?.entries??[]);o.label!==null&&!W.includes(o.label)&&W.push(o.label);let G=[o.workspaceId===null?`across all workspaces`:`in ${L.get(o.workspaceId)??`workspace ${o.workspaceId}`}`,o.label!==null&&`labelled ${o.label}`].filter(Boolean).join(`, `),K=te[z.kind];function Z(e){a(null),n(e)}function Q(e){a(null),x(null),C(e)}async function ke(){try{let e=await A.mutateAsync({period:t.kind,from:t.from,to:t.kind===`custom`?t.to:null,workspaceId:o.workspaceId,label:o.label,title:null});a(`Saved "${e.title}" with ${Y(e.entryCount,`task`)}; reopen it from Saved reviews.`)}catch(e){a(`Could not save the review: ${e instanceof Error?e.message:String(e)}`)}}async function Ae(e){try{await j.mutateAsync(e),Q(null),a(`Deleted the saved review.`)}catch(e){a(`Could not delete the saved review: ${e instanceof Error?e.message:String(e)}`)}}function je(e){e!==t.kind&&Z(e===`custom`?{...t,kind:e}:H(e,t.from))}function Me(e){return M?E.data?Promise.resolve(e===`csv`?E.data.csv:E.data.markdown):Promise.reject(Error(`the saved review is still loading`)):h(f.reviewReport({period:t.kind,date:null,from:t.from,to:t.kind===`custom`?t.to:null,format:e,timeZone:null,workspaceId:o.workspaceId,label:o.label}))}async function Ne(){try{let e=Me(`markdown`);if(typeof ClipboardItem>`u`)await navigator.clipboard.writeText((await e).contents);else{let t=e.then(({contents:e})=>new Blob([e],{type:`text/plain`}));await navigator.clipboard.write([new ClipboardItem({"text/plain":t})])}a(`Copied as Markdown.`)}catch(e){a(`Could not copy: ${String(e)}`)}}async function $(e){try{let t=await Me(e);xe(t.fileName,t.contents,t.mediaType),a(`Downloaded ${t.fileName}`)}catch(e){a(`Could not export: ${String(e)}`)}}return(0,J.jsxs)(`section`,{"aria-labelledby":`review-heading`,className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h2`,{id:`review-heading`,className:`text-xl font-semibold tracking-tight`,children:M&&E.data?E.data.summary.title:he[z.kind]}),(0,J.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Work recorded from `,z.from,` to `,z.to,` `,G,`.`,` `,M?E.data&&(0,J.jsxs)(`span`,{children:[`Saved `,ge(E.data.summary.savedAt),`, with days in `,E.data.summary.timeZone,`; it stays as it was when saved.`]}):(0,J.jsx)(Ce,{})]})]}),(M||(T.data?.length??0)>0)&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,J.jsxs)(`select`,{"aria-label":`Saved reviews`,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-auto max-md:min-w-0 max-md:flex-1`),value:S??``,onChange:e=>Q(e.target.value===``?null:Number(e.target.value)),children:[(0,J.jsx)(`option`,{value:``,children:`Live review`}),T.data?.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[e.title,` (saved `,k(e.savedAt),`)`]},e.id))]}),S!==null&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(m,{size:`sm`,variant:`outline`,onClick:()=>Q(null),children:`Back to the live review`}),(0,J.jsx)(m,{size:`sm`,variant:`ghost`,disabled:j.isPending,onClick:()=>void Ae(S),children:`Delete saved review`})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 print:hidden`,children:[!M&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{role:`group`,"aria-label":`Review period`,className:`flex rounded-md border p-0.5 max-md:w-full`,children:be.map(({kind:e,label:n})=>(0,J.jsx)(m,{size:`sm`,variant:t.kind===e?`default`:`ghost`,"aria-pressed":t.kind===e,onClick:()=>je(e),children:n},e))}),t.kind===`week`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`label`,{htmlFor:`week-start`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`Week starting`}),(0,J.jsx)(`input`,{id:`week-start`,type:`date`,required:!0,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40 max-md:w-0 max-md:min-w-0 max-md:flex-1`),value:t.from,onChange:e=>e.target.value&&Z(ie(e.target.value))})]}),t.kind===`custom`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`label`,{htmlFor:`review-from`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`From`}),(0,J.jsx)(`input`,{id:`review-from`,type:`date`,required:!0,max:t.to,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.from,onChange:e=>e.target.value&&e.target.value<=t.to&&Z({...t,from:e.target.value})}),(0,J.jsx)(`label`,{htmlFor:`review-to`,className:`text-xs text-muted-foreground max-md:sr-only`,children:`To`}),(0,J.jsx)(`input`,{id:`review-to`,type:`date`,required:!0,min:t.from,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-40`),value:t.to,onChange:e=>e.target.value&&e.target.value>=t.from&&Z({...t,to:e.target.value})})]}),t.kind!==`week`&&t.kind!==`custom`&&(0,J.jsx)(`span`,{className:`px-1 text-sm font-medium`,children:se(t)}),(0,J.jsx)(m,{size:`icon-sm`,variant:`outline`,"aria-label":`Previous ${K}`,title:`Previous ${K}`,onClick:()=>Z(_(t,-1)),children:(0,J.jsx)(re,{})}),(0,J.jsx)(m,{size:`icon-sm`,variant:`outline`,"aria-label":`Next ${K}`,title:`Next ${K}`,onClick:()=>Z(_(t,1)),children:(0,J.jsx)(oe,{})}),t.kind!==`custom`&&(0,J.jsxs)(m,{size:`sm`,variant:`ghost`,onClick:()=>Z(H(t.kind,k(Date.now()/1e3))),children:[(0,J.jsx)(_e,{className:`md:hidden`,"aria-hidden":!0}),(0,J.jsxs)(`span`,{className:`max-md:sr-only`,children:[`This `,K]})]})]}),(0,J.jsx)(`div`,{className:`ml-auto`,children:(0,J.jsx)(Se,{disabled:!V,children:e=>(0,J.jsxs)(J.Fragment,{children:[!M&&(0,J.jsx)(X,{onSelect:()=>{e(),ke()},children:`Save as snapshot`}),(0,J.jsx)(X,{onSelect:()=>{e(),Ne()},children:`Copy as Markdown`}),(0,J.jsx)(X,{onSelect:()=>{e(),$(`markdown`)},children:`Save as Markdown`}),(0,J.jsx)(X,{onSelect:()=>{e(),$(`csv`)},children:`Save as CSV`}),(0,J.jsx)(X,{onSelect:()=>{e(),window.print()},children:`Print or save as PDF`})]})})})]}),(0,J.jsxs)(`div`,{role:`group`,"aria-label":`Review filters`,className:`flex flex-wrap items-center gap-2 print:hidden`,children:[(0,J.jsxs)(`select`,{"aria-label":`Workspace`,className:i(g,`w-auto max-md:min-w-0 max-md:flex-1`),value:o.workspaceId??``,onChange:e=>y({...o,workspaceId:e.target.value===``?null:Number(e.target.value)}),children:[(0,J.jsx)(`option`,{value:``,children:`All workspaces`}),I.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,J.jsxs)(`select`,{"aria-label":`Label`,className:i(g,`w-auto max-md:min-w-0 max-md:flex-1`),value:o.label??``,onChange:e=>y({...o,label:e.target.value===``?null:e.target.value}),children:[(0,J.jsx)(`option`,{value:``,children:W.length===0?`No labels in this period`:`Any label`}),W.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))]}),(o.workspaceId!==null||o.label!==null)&&(0,J.jsx)(m,{size:`sm`,variant:`ghost`,onClick:()=>y(U),children:`Clear filters`})]}),r&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground print:hidden`,children:r}),(0,J.jsx)(`p`,{role:`status`,className:i(`text-sm text-muted-foreground`,!N.isPending&&`sr-only`),children:N.isPending?`Loading the review...`:V?`Showing ${V.length} ${V.length===1?`task`:`tasks`} with activity in this ${K}.`:``}),N.isError&&(0,J.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load the review: `,N.error.message]}),V?.length===0&&(0,J.jsx)(me,{title:R?.entries.length===0?`No recorded activity in this ${K}.`:`No recorded activity in this ${K} matches the filters.`,hint:M?`This saved review keeps the tasks it had when it was saved.`:R?.entries.length===0?`Toodo records each task as it is planned, started, moved to review, and completed, so reviews fill up as you work.`:`Pick another period or change the filters to look at other work.`,action:M?void 0:(0,J.jsx)(`div`,{className:`flex flex-wrap justify-center gap-2 print:hidden`,children:(0,J.jsxs)(m,{size:`sm`,variant:`outline`,onClick:()=>Z(_(t,-1)),children:[`Show the `,K,` before`]})})}),R&&V&&V.length>0&&(0,J.jsx)(Oe,{shown:R,entries:V,workspaces:I}),R&&V&&(0,J.jsx)(De,{shown:R,entries:V,editable:!M}),z.kind===`year`&&V&&(0,J.jsx)(Ee,{entries:V}),V&&ce(V).map(t=>(0,J.jsxs)(`section`,{"aria-label":O[t.outcome],className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`h3`,{className:i(`text-sm font-semibold`,ve[t.outcome]),children:[O[t.outcome],` `,(0,J.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.entries.length,`)`]})]}),(0,J.jsx)(`ul`,{className:`flex flex-col divide-y rounded-lg border`,children:t.entries.map(({task:t,at:n,commits:r,archived:a,pullRequest:o})=>(0,J.jsxs)(`li`,{className:`flex flex-col gap-1 px-3 py-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(D,{type:t.taskType}),(0,J.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`#`,t.id]}),(0,J.jsx)(`button`,{type:`button`,"aria-label":`Open #${t.id} ${t.title}`,title:t.title,onClick:()=>e?.(t.id),className:`min-w-0 flex-1 truncate text-left text-sm font-medium hover:underline max-md:min-h-11`,children:t.title}),t.resolution===`not_adopted`&&(0,J.jsx)(`span`,{className:ye,children:`Not adopted`}),a&&(0,J.jsx)(`span`,{className:ye,children:`Archived`}),t.resolution===`completed`&&(0,J.jsx)(`span`,{className:i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,P.success),children:`Completed`}),v(t)&&(0,J.jsx)(Te,{url:v(t),stats:o}),(0,J.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground max-md:hidden print:inline`,children:[L.get(t.workspaceId)??`Workspace ${t.workspaceId}`,` · `,(0,J.jsx)(B,{at:n})]})]}),(0,J.jsx)(pe,{task:t}),a||M?null:b?.id===t.id?(0,J.jsx)(ae,{task:t,focusPlan:b.field,onDone:()=>x(null)}):(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground empty:hidden print:hidden`,children:(0,J.jsx)(ne,{task:t,onEdit:e=>x({id:t.id,field:e})})}),t.completionNote&&(0,J.jsx)(`p`,{"aria-label":`Completion note of #${t.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:t.completionNote}),R&&(0,J.jsx)(we,{task:t,shown:R}),r.length>0&&(0,J.jsx)(`ul`,{"aria-label":`Commits of #${t.id} this ${K}`,className:`flex flex-col gap-0.5`,children:r.map(e=>(0,J.jsxs)(`li`,{className:`flex gap-2 text-xs`,title:e.author,children:[(0,J.jsx)(`code`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}),(0,J.jsx)(`span`,{className:`truncate`,children:le(e.message)})]},e.sha))})]},t.id))})]},t.outcome))]})}function Q(e){return e===0?`0h`:I(e)}function we({task:e,shown:t}){let{start:n,end:r,now:i}=t,a=W(e.timeline,i),o=V(e.timeline,i);if(a===null||o===null)return null;let s=E(e.timeline).filter(e=>e.state===`paused`&&e.start<r&&(e.end??i)>n);return(0,J.jsxs)(`div`,{"aria-label":`Time of #${e.id}`,className:`flex flex-col gap-0.5 text-xs text-muted-foreground`,children:[(0,J.jsxs)(`p`,{children:[Q(a),` active, `,Q(o),` waiting`]}),s.length>0&&(0,J.jsx)(`ul`,{"aria-label":`Waits of #${e.id}`,className:`flex flex-col gap-0.5`,children:s.map(e=>(0,J.jsxs)(`li`,{className:`break-words-keep`,children:[`Waiting `,Q(Math.max((e.end??i)-e.start,0)),` from `,k(e.start),e.end===null&&`, still waiting`,`: `,e.reason??`no reason recorded`]},e.start))})]})}function Te({url:e,stats:t}){let n=y(e),r=t=>{t.preventDefault(),G(e).catch(t=>console.error(`Failed to open ${e}`,t))};return(0,J.jsx)(`a`,{href:e,title:t?`${e} \u00b7 ${C(t)}`:e,"aria-label":n?`Pull request #${n}`:`Pull request`,onClick:r,onAuxClick:r,className:`shrink-0 text-xs text-primary underline underline-offset-2 hover:no-underline max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:n?`#${n}`:`PR`})}function Ee({entries:e}){let t=S(e);return t===null?null:(0,J.jsxs)(`section`,{"aria-labelledby":`year-in-review-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,J.jsx)(`h3`,{id:`year-in-review-heading`,className:`text-sm font-semibold`,children:`Year in review`}),t.pullRequests&&(0,J.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Merged pull requests`}),(0,J.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.pullRequests})]}),(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Lines changed`}),(0,J.jsxs)(`dd`,{className:`text-lg font-semibold`,children:[(0,J.jsxs)(`span`,{children:[`+`,t.pullRequests.additions]}),(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,J.jsxs)(`span`,{children:[`-`,t.pullRequests.deletions]})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Files changed`}),(0,J.jsx)(`dd`,{className:`text-lg font-semibold`,children:t.pullRequests.changedFiles})]}),(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Reviews`}),(0,J.jsxs)(`dd`,{className:`text-lg font-semibold`,title:j(t.pullRequests),children:[t.pullRequests.reviews,(0,J.jsxs)(`span`,{className:`ml-1 text-xs font-normal text-muted-foreground`,children:[`on `,t.pullRequests.reviewed,` of `,t.pullRequests.pullRequests]})]})]})]}),t.largest.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest pull requests`}),(0,J.jsx)(`ol`,{"aria-label":`Largest pull requests`,className:`flex flex-col gap-1`,children:t.largest.map(({task:e,pullRequest:t})=>(0,J.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,J.jsx)(D,{type:e.taskType}),(0,J.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,J.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:C(t)})]},e.id))})]}),t.research.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Research conclusions`}),(0,J.jsx)(`ul`,{"aria-label":`Research conclusions`,className:`flex flex-col divide-y rounded-md border`,children:t.research.map(({task:e,at:t,adopted:n})=>(0,J.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,J.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,J.jsx)(`span`,{className:i(`shrink-0 rounded-full px-2 py-0.5 text-xs font-medium`,n?P.success:P.neutral),children:n?`Adopted`:`Not adopted`}),(0,J.jsx)(B,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,at:t})]}),(0,J.jsx)(`p`,{"aria-label":`Research conclusion of #${e.id}`,className:`whitespace-pre-line break-words-keep text-xs`,children:e.completionNote??(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`No conclusion written.`})})]},e.id))})]}),t.overruns.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Largest estimate overruns`}),(0,J.jsx)(`ol`,{"aria-label":`Largest estimate overruns`,className:`flex flex-col gap-1`,children:t.overruns.map(({task:e,estimated:t,actual:n})=>(0,J.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,J.jsx)(D,{type:e.taskType}),(0,J.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,J.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[`estimated `,I(t),`, `,I(n),` active`]})]},e.id))})]})]})}function De({shown:e,entries:t,editable:n}){let r=T(e.end,t,e.now),a=n?t.filter(({archived:e})=>!e).map(({task:e})=>N(e)):[],o=a.filter(e=>e.includes(`estimate`)).length,s=a.filter(e=>e.includes(`dueDate`)).length;if(r===null&&o+s===0)return null;let c=(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted-foreground`,children:`Missing plan`}),(0,J.jsxs)(`dd`,{children:[[o>0&&`${Y(o,`task`)} without an estimate`,s>0&&`${Y(s,`task`)} without a due date`].filter(Boolean).join(`, `),`; add them from the marks on the tasks below`]})]});return(0,J.jsxs)(`section`,{"aria-labelledby":`plan-heading`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,J.jsx)(`h3`,{id:`plan-heading`,className:`text-sm font-semibold`,children:`Plan vs actual`}),r===null?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`text-sm`,children:`No reviewed task has an estimate or a due date, so there is nothing to compare yet.`}),(0,J.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:c})]}):(0,J.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted-foreground`,children:`Estimate vs active time`}),(0,J.jsx)(`dd`,{children:r.time?M(r.time):`No completed task had an estimate`})]}),(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted-foreground`,children:`Due dates met`}),(0,J.jsx)(`dd`,{children:r.dueDates?L(r.dueDates):`No completed task had a due date`})]}),o+s>0&&c]}),r!==null&&r.late.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h4`,{className:`text-xs text-muted-foreground`,children:`Late tasks`}),(0,J.jsx)(`ul`,{"aria-label":`Late tasks`,className:`flex flex-col gap-1`,children:r.late.map(e=>(0,J.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-sm`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 max-w-full items-center gap-2`,children:[(0,J.jsx)(D,{type:e.task.taskType}),(0,J.jsx)(`span`,{className:`truncate font-medium`,children:e.task.title})]}),(0,J.jsx)(`span`,{className:i(`ml-auto shrink-0 text-xs`,w.danger),children:z(e)})]},e.task.id))})]})]})}function Oe({shown:e,entries:t,workspaces:n}){let r=de(e.period,t,n,e.timeZone),a=Math.max(1,...(r.completedPerMonth??[]).map(({count:e})=>e));return(0,J.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,J.jsxs)(`dl`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[r.outcomes.map(({outcome:e,count:t})=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:O[e]}),(0,J.jsx)(`dd`,{className:`text-lg font-semibold`,children:t})]},e)),r.notAdopted>0&&(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Not adopted`}),(0,J.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.notAdopted})]}),(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Commits`}),(0,J.jsx)(`dd`,{className:`text-lg font-semibold`,children:r.commits})]})]}),(0,J.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[auto_1fr]`,children:[F.map(e=>{let t=r[e];return(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted-foreground`,children:R[e]}),(0,J.jsx)(`dd`,{children:t===null?`No data`:`${I(t.median)} (${t.tasks} ${t.tasks===1?`task`:`tasks`})`})]},e)}),r.changes&&(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted-foreground`,children:`Changes in completed pull requests`}),(0,J.jsx)(`dd`,{children:A(r.changes)})]}),r.completedByType.length>0&&(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by type`}),(0,J.jsx)(`dd`,{children:r.completedByType.map(({taskType:e,count:t})=>`${e} ${t}`).join(`, `)})]}),r.completedByWorkspace.length>0&&(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-muted-foreground`,children:`Completed by workspace`}),(0,J.jsx)(`dd`,{children:r.completedByWorkspace.map(({workspace:e,count:t})=>`${e} ${t}`).join(`, `)})]})]}),r.completedPerMonth&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Completed per month`}),(0,J.jsx)(`ul`,{"aria-label":`Completed per month`,className:`flex flex-col gap-0.5`,children:r.completedPerMonth.map(({month:e,count:t})=>(0,J.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,J.jsx)(`span`,{className:`w-16 shrink-0 font-mono text-muted-foreground`,children:e}),(0,J.jsx)(`span`,{"aria-hidden":!0,className:i(`h-2 rounded-sm`,x.success),style:{width:`${t/a*60}%`,minWidth:t>0?4:0}}),(0,J.jsx)(`span`,{children:t})]},e))})]})]})}export{Z as Review};