@hearsay-tools/squawk 0.19.0-dev.9268 → 0.19.0-dev.9269
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.
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-DuKY0R0e.js → accounts-section-uuhrLHok.js} +1 -1
- package/web/dist/assets/{activity-motion-Bv0jvDst.js → activity-motion-CHyZRjxl.js} +1 -1
- package/web/dist/assets/{activity-route-CWOifPU0.js → activity-route-CruXBXE5.js} +1 -1
- package/web/dist/assets/{agent-config-section-CZEDS52H.js → agent-config-section-BUxTgHrB.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-CcqOczfm.js → agent-defaults-section-BXUzcpEv.js} +1 -1
- package/web/dist/assets/{appearance-DDCTbsk6.js → appearance-DnPsNI40.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-C-p4viaA.js → archive-on-merge-field-DR-KA2nj.js} +1 -1
- package/web/dist/assets/{ask-card-UHei4R4L.js → ask-card-DqWVy7zb.js} +1 -1
- package/web/dist/assets/{automations-route-Faqg4frP.js → automations-route-BmCWqncy.js} +1 -1
- package/web/dist/assets/{commit-list-CSwpPZO4.js → commit-list-zMKEapLK.js} +1 -1
- package/web/dist/assets/{diff-DisYhHh3.js → diff-BPw0S-BU.js} +2 -2
- package/web/dist/assets/{diff-controls-DkyweW3f.js → diff-controls-DbkfJxfp.js} +1 -1
- package/web/dist/assets/{diff-view-DtUdo67K.js → diff-view-Cl7rXVa_.js} +1 -1
- package/web/dist/assets/{discard-changes-dialog-BPvjnxpM.js → discard-changes-dialog-BYLEBMpG.js} +1 -1
- package/web/dist/assets/{file-preview-BgmTQFtU.js → file-preview-CBjQS3sX.js} +1 -1
- package/web/dist/assets/{git-toolbar-B02zsVxC.js → git-toolbar-CAAZ5T8F.js} +1 -1
- package/web/dist/assets/{github-zvfQUSW0.js → github-DehUrgzW.js} +1 -1
- package/web/dist/assets/{global-activity-route-Bv9FvhbW.js → global-activity-route-BQz9m_XA.js} +1 -1
- package/web/dist/assets/{index-DZXi-K2N.css → index-B5vWsR62.css} +1 -1
- package/web/dist/assets/{index-C53kW2ni.js → index-D0RESQCN.js} +4 -4
- package/web/dist/assets/{markdown-BJEVJ9Ul.js → markdown-CcQNTOHx.js} +1 -1
- package/web/dist/assets/{option-select-2gPDYt4P.js → option-select-DGRezng8.js} +1 -1
- package/web/dist/assets/{preferences-section-Dxa2LaOd.js → preferences-section-DfiqoVZx.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-WOsi7F-u.js → preview-pane-connected-Bf6SWOsM.js} +1 -1
- package/web/dist/assets/{project-location-CHzydqJX.js → project-location-8EYHMbCE.js} +1 -1
- package/web/dist/assets/{projects-section-iwZzlaIK.js → projects-section-CaKm84OL.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-BiMRXcpl.js → prompt-templates-section-Bh6YEqh0.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-BXP0WRVg.js → remote-settings-notice-cNffux8C.js} +1 -1
- package/web/dist/assets/{repo-git-YX8mnMa2.js → repo-git-nFi9DHBQ.js} +1 -1
- package/web/dist/assets/{report-reader-BvtW6Ka3.js → report-reader-BbA7ERJe.js} +1 -1
- package/web/dist/assets/{reports-CvpeVBN9.js → reports-iMUK2IiW.js} +1 -1
- package/web/dist/assets/{resources-section-nmoQeDRx.js → resources-section-BsPU-yD9.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-e_6_mzUh.js → review-notes-drafts-BncrXliY.js} +1 -1
- package/web/dist/assets/{review-panel-BZDQutT4.js → review-panel-CTc1ypIJ.js} +1 -1
- package/web/dist/assets/{review-strip-FyBfSEwP.js → review-strip-D1gmgNIH.js} +1 -1
- package/web/dist/assets/{run-diff-BKOEMMI_.js → run-diff-CbyXSgBK.js} +1 -1
- package/web/dist/assets/{run-header-CXH_IIK7.js → run-header-BREol2Ej.js} +1 -1
- package/web/dist/assets/{select-NqOFf6R2.js → select--NKdUD0C.js} +1 -1
- package/web/dist/assets/{session-context-section-DHv-cUbc.js → session-context-section-D02yRmGY.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-Cpb6YPQe.js → settings-agent-picker-GPhOc6Lz.js} +1 -1
- package/web/dist/assets/{settings-save-bar-BzF0VSQt.js → settings-save-bar-CroXxZIi.js} +1 -1
- package/web/dist/assets/{settings-shell-C_30wCRS.js → settings-shell-CEDsPkJW.js} +1 -1
- package/web/dist/assets/{sidebar-section-C2NaKDKY.js → sidebar-section-BOtjR98E.js} +1 -1
- package/web/dist/assets/{skills-C2LYz_BH.js → skills-C7MuiePR.js} +1 -1
- package/web/dist/assets/{task-changes-C9cd2qk2.js → task-changes-CPDdG-BK.js} +1 -1
- package/web/dist/assets/{task-commits-Dp0IHNJS.js → task-commits-BFWXi7xF.js} +1 -1
- package/web/dist/assets/{task-file-scope-BETgcVN5.js → task-file-scope-BfJ7TDbf.js} +1 -1
- package/web/dist/assets/{task-files-CDhvRXZO.js → task-files-CNz4PSKs.js} +1 -1
- package/web/dist/assets/{task-github-item-BJI1XQ2e.js → task-github-item-B0mRxbLm.js} +1 -1
- package/web/dist/assets/{task-thread-2wlNPK9t.js → task-thread-DH9xiw7O.js} +1 -1
- package/web/dist/assets/{thread-state-meq29483.js → thread-state-B_uTIWzc.js} +1 -1
- package/web/dist/assets/{unified-diff-BdwcpVop.js → unified-diff-JD9Q6oCe.js} +1 -1
- package/web/dist/assets/{use-finish-run-C6bWFGLw.js → use-finish-run-D7Ll1bwP.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DjarY58R.js → use-hand-to-agent-state-zwUimLza.js} +1 -1
- package/web/dist/assets/use-path-bases-BmFE7O79.js +1 -0
- package/web/dist/assets/{workflows-CCAH-R8Q.js → workflows-BXDmsEl-.js} +1 -1
- package/web/dist/assets/{workspace-tools-Icdnz3lI.js → workspace-tools-Ehk2KrtT.js} +1 -1
- package/web/dist/assets/{worktrees-section-0hu83JQA.js → worktrees-section-DWZwtc3-.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/use-path-bases-TYaQX2dP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-CCX8mhHc.js";import{j as n,nt as r,u as i,v as a}from"./design-icons-QbNMZniQ.js";import{t as o}from"./createLucideIcon-BHp8sXmF.js";import{t as s}from"./button-BV_AiLj2.js";import{n as c,p as l,r as u,t as d}from"./dropdown-menu-NJZfnQCU.js";import{vr as f}from"./index-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-CCX8mhHc.js";import{j as n,nt as r,u as i,v as a}from"./design-icons-QbNMZniQ.js";import{t as o}from"./createLucideIcon-BHp8sXmF.js";import{t as s}from"./button-BV_AiLj2.js";import{n as c,p as l,r as u,t as d}from"./dropdown-menu-NJZfnQCU.js";import{vr as f}from"./index-D0RESQCN.js";var p=o(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),m=o(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),h=e();function g({mode:e,wrap:t,onModeChange:n,onWrapChange:r,disabled:i=!1}){return(0,h.jsxs)(`span`,{className:`flex items-center gap-1.5 max-md:hidden`,children:[(0,h.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`inline-flex items-center rounded-lg border border-border bg-card p-0.5`,children:[(0,h.jsx)(S,{current:e,value:`unified`,onModeChange:n,disabled:i}),(0,h.jsx)(S,{current:e,value:`split`,onModeChange:n,disabled:i})]}),(0,h.jsx)(b,{wrap:t,onWrapChange:r,disabled:i,labelled:!0,className:`gap-1.5 rounded-lg px-3 text-xs font-medium`})]})}function _({wrap:e,onWrapChange:t,preview:n=!1,onPreviewChange:a,disabled:o=!1}){return(0,h.jsxs)(d,{children:[(0,h.jsx)(l,{asChild:!0,children:(0,h.jsxs)(s,{variant:`outline`,size:`sm`,"data-slot":`diff-view-menu`,className:`gap-1.5 rounded-lg px-3 text-xs font-medium md:hidden`,children:[(0,h.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),`View`,(0,h.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`})]})}),(0,h.jsxs)(u,{align:`end`,"data-slot":`diff-view-menu-content`,children:[(0,h.jsx)(c,{"data-slot":`diff-view-wrap`,className:`min-h-11`,checked:e,disabled:o,onCheckedChange:e=>t(e===!0),children:`Wrap long lines`}),a?(0,h.jsx)(c,{"data-slot":`diff-view-preview`,className:`min-h-11`,checked:n,onCheckedChange:e=>a(e===!0),children:`Preview Markdown`}):null]})]})}var v=`Unavailable while Markdown preview is on`;function y(){return(0,h.jsx)(`span`,{"data-slot":`markdown-preview-hint`,role:`status`,className:`text-xs text-muted-foreground max-sm:sr-only`,children:`Full-document preview — layout and wrap are off`})}function b({wrap:e,onWrapChange:n,className:r=`rounded-lg`,disabled:i=!1,labelled:a=!1}){return(0,h.jsxs)(s,{variant:`outline`,size:a?`default`:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":e,"aria-label":`Wrap long lines`,title:i?v:`Wrap long lines`,disabled:i,className:t(r,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,h.jsx)(m,{"aria-hidden":`true`}),a?(0,h.jsx)(`span`,{"aria-hidden":`true`,children:`Wrap`}):null]})}function x({preview:e,onPreviewChange:n}){return(0,h.jsxs)(s,{variant:`outline`,size:`default`,"data-slot":`markdown-preview-toggle`,"aria-pressed":e,"aria-label":`Preview Markdown`,title:e?`Show Markdown as a diff`:`Preview Markdown`,className:t(`gap-1.5 rounded-lg px-0 text-xs font-medium sm:px-3`,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,h.jsx)(f,{"aria-hidden":`true`,className:`size-4`}),(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`max-sm:hidden`,children:`Preview MD`})]})}function S({current:e,value:n,onModeChange:r,disabled:i}){let o=e===n;return(0,h.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":o,disabled:i,title:i?v:void 0,onClick:()=>r(n),className:t(`inline-flex h-[30px] items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors outline-hidden focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,o?`bg-muted text-foreground`:`text-muted-foreground pointer-hover:text-foreground`),children:[n===`unified`?(0,h.jsx)(p,{"aria-hidden":`true`,className:`size-4`}):(0,h.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function C({branch:e}){return(0,h.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-xs font-medium`,children:[(0,h.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e})]})}export{x as a,y as i,_ as n,b as o,g as r,C as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./button-BV_AiLj2.js";import{t as s}from"./diff-stat-DCO_BkZB.js";import{o as c,rt as l,wn as u}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{t as o}from"./button-BV_AiLj2.js";import{t as s}from"./diff-stat-DCO_BkZB.js";import{o as c,rt as l,wn as u}from"./index-D0RESQCN.js";import{a as d,i as f,r as p}from"./highlighter-Crq-WTmN.js";import{n as m,r as h,t as g}from"./image-preview-CvcSCCBU.js";import{t as _}from"./textarea-BGp28xFr.js";import{n as v,t as y}from"./markdown-BBDDg-4t.js";import{t as b}from"./markdown-CcQNTOHx.js";var x=e(t(),1),S=44;function C(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function ee(e){return C(e)*20+S}function te(e){return e.reduce((e,t)=>e+C(t),0)}function ne(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function w(e){return`${e.oldPath??``}→${e.path}`}function T(e){let t=0;for(let n of e.split(`
|
|
3
3
|
`))n.length>t&&(t=n.length);return t}var E=n();function D({path:e,side:t,line:n,hunk:r}){let i=typeof n==`number`?String(n):`${n.start}-${n.end}`;return`${r?`hunk`:`line`}:${t}:${i}:${e}`}function O(e,t){return t.kind===`del`||t.newLine===void 0?{path:e,side:`old`,line:t.oldLine??0,hunk:!1}:{path:e,side:`new`,line:t.newLine,hunk:!1}}function k(e,t){let[n,r,i]=t.newCount===0?[t.oldStart,t.oldCount,`old`]:[t.newStart,t.newCount,`new`];return{path:e,side:i,line:{start:n,end:n+Math.max(r,1)-1},hunk:!0}}function A(e){return e.hunk?`Add a note on this hunk`:`Add a note on ${e.side===`old`?`old `:``}line ${String(e.line)}`}function j(e){return typeof e.line==`number`?`Note on ${e.side===`old`?`old `:``}line ${e.line} of ${e.path}`:`Note on lines ${e.line.start}–${e.line.end} of ${e.path}`}function re(e){let[t,n]=(0,x.useState)(()=>new Map),r=(0,x.useRef)(null);if(u([...t.values()].some(e=>e.text.trim()!==``)),!e)return;let i=e=>n(t=>{let n=new Map(t);return n.delete(e),n});return{drafts:t,open:e=>{let t=D(e);r.current=t,n(n=>new Map(n).set(t,n.get(t)??{anchor:e,text:``}))},change:(e,t)=>n(n=>{let r=n.get(e);return r?new Map(n).set(e,{...r,text:t}):n}),close:i,save:n=>{let r=t.get(n);!r||r.text.trim()===``||(e(r.anchor,r.text),i(n))},takeFocus:e=>r.current===e?(r.current=null,!0):!1}}var M=r(`cursor-pointer pointer-coarse:min-h-11 pointer-coarse:min-w-11 hover:text-foreground hover:underline`,`focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`);function N({noteKey:e,draft:t,notes:n}){let r=(0,x.useRef)(null);(0,x.useEffect)(()=>{n.takeFocus(e)&&r.current?.focus()});let i=t.text.trim()===``;return(0,E.jsxs)(`div`,{"data-slot":`diff-note-editor`,className:`sticky left-0 flex w-full max-w-[100cqi] flex-col gap-2 border-y border-border bg-card px-3 py-2 font-sans`,children:[(0,E.jsx)(_,{ref:r,"data-slot":`diff-note-text`,"aria-label":j(t.anchor),placeholder:`What should change here?`,rows:2,value:t.text,onChange:t=>n.change(e,t.target.value),onKeyDown:t=>{if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),n.close(e);return}l(t)&&(t.preventDefault(),n.save(e))},className:`min-h-11 text-base md:text-[13px]`}),(0,E.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,E.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`diff-note-cancel`,onClick:()=>n.close(e),children:`Cancel`}),(0,E.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,"data-slot":`diff-note-save`,disabled:i,onClick:()=>n.save(e),children:`Save`})]})]})}var P=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,F=300,I=.3;function L(e,t){if(e===t)return null;let n=e.match(P)??[],r=t.match(P)??[];if(n.length===0||r.length===0||n.length>F||r.length>F)return null;let i=ie(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<I?null:ae(n,r,i)}function ie(e,t){let n=t.length+1,r=new Uint16Array((e.length+1)*n);for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++)r[i*n+a]=e[i-1]===t[a-1]?(r[(i-1)*n+(a-1)]??0)+1:Math.max(r[(i-1)*n+a]??0,r[i*n+(a-1)]??0);return r}function ae(e,t,n){let r=t.length+1,i=Array.from({length:e.length},()=>!1),a=Array.from({length:t.length},()=>!1),o=e.length,s=t.length;for(;o>0&&s>0;)e[o-1]===t[s-1]?(i[o-1]=!0,a[s-1]=!0,o--,s--):(n[(o-1)*r+s]??0)>=(n[o*r+(s-1)]??0)?o--:s--;return{del:R(e,i),add:R(t,a)}}function R(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function oe(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var se=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,ce=`… (patch truncated)`;function z(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
4
|
`);o.at(-1)===``&&o.pop();for(let e of o){let o=se.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(ce)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function le(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function ue(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function de(e,t){let n=Array.from({length:e.length}),r=Array.from({length:t.length}),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=L(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function B(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(de(t,i))}else t(i),r++}}function fe(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),B(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function pe(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),B(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}function me({file:e,loadFileText:t,imageSrc:n}){let r=(0,x.useMemo)(()=>he(e),[e]),i=(0,x.useRef)(t);i.current=t;let a=(0,x.useRef)(n);a.current=n;let o=t!==void 0,[s,c]=(0,x.useState)(null);(0,x.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&c({path:e.path,text:t}),()=>!n&&c({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,o]);let l=(0,x.useCallback)(t=>{let n=a.current,r=n?v(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),u=s?.path===e.path?s:null;if(o&&u===null)return(0,E.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Loading preview…`});let d=u?.text??null;if(d===null&&r.text===``)return(0,E.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes to preview.`});let f=d!==null||r.complete?null:o?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,E.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,E.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[f?(0,E.jsx)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:f}):null,(0,E.jsx)(b,{document:!0,imageSrc:l,children:d??r.text})]})})}function he(e){let t=z(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
|
package/web/dist/assets/{discard-changes-dialog-BPvjnxpM.js → discard-changes-dialog-BYLEBMpG.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{$t as t,an as n,en as r,in as i,nn as a,on as o,rn as s,tn as c}from"./index-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{$t as t,an as n,en as r,in as i,nn as a,on as o,rn as s,tn as c}from"./index-D0RESQCN.js";var l=e();function u({open:e,subject:u,onKeep:d,onDiscard:f}){return(0,l.jsx)(t,{open:e,onOpenChange:e=>!e&&d(),children:(0,l.jsxs)(a,{"data-slot":`discard-changes-dialog`,className:`sm:max-w-[560px]`,children:[(0,l.jsxs)(n,{children:[(0,l.jsx)(o,{children:`Discard unsaved changes?`}),(0,l.jsxs)(s,{children:[`Your edits to `,(0,l.jsx)(`span`,{className:`font-medium text-foreground`,children:u}),` are not saved. They are lost if you continue.`]})]}),(0,l.jsxs)(i,{children:[(0,l.jsx)(c,{"data-slot":`discard-changes-keep`,children:`Keep editing`}),(0,l.jsx)(r,{"data-slot":`discard-changes-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:f,children:`Discard changes`})]})]})})}export{u as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Jt as r}from"./queries-Byfl3YoC.js";import{Kt as i,wn as a}from"./project-scope-context-BWHk0niI.js";import{d as o,m as s,p as c}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as l}from"./dist-CCX8mhHc.js";import{T as u,ct as d}from"./design-icons-QbNMZniQ.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";import{o as p}from"./diff-controls-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Jt as r}from"./queries-Byfl3YoC.js";import{Kt as i,wn as a}from"./project-scope-context-BWHk0niI.js";import{d as o,m as s,p as c}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as l}from"./dist-CCX8mhHc.js";import{T as u,ct as d}from"./design-icons-QbNMZniQ.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";import{o as p}from"./diff-controls-DbkfJxfp.js";import{t as m}from"./centered-state-N8vWM_Hw.js";import{r as h}from"./html-report-BX3msvci.js";import{a as g,i as _,r as v}from"./highlighter-Crq-WTmN.js";import{n as y,t as b}from"./markdown-CcQNTOHx.js";import{t as x}from"./html-report-frame-Bk6UkqKa.js";var S=f(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),C=f(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),w=f(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),T=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function E(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:T.has(t.slice(n+1).toLowerCase())}function D(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return E(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}var O=e(t(),1);function k(e){return e.tooLarge?`too-large`:D(e.path)?`image`:e.binary?`binary`:`text`}function A(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var j=n();function M({runId:e,path:t,className:n}){let i=r(e,t??void 0);if(t===null)return(0,j.jsx)(z,{className:n,children:(0,j.jsx)(m,{icon:(0,j.jsx)(u,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(i.isPending)return(0,j.jsx)(z,{className:n,children:(0,j.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(i.isError){let e=i.error instanceof a&&i.error.status===409;return(0,j.jsx)(z,{className:n,children:(0,j.jsx)(m,{icon:e?(0,j.jsx)(w,{}):(0,j.jsx)(d,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:i.error.message})})}return i.data.type===`file`?(0,j.jsx)(F,{runId:e,entry:i.data,className:n}):(0,j.jsx)(z,{className:n,children:(0,j.jsx)(m,{icon:(0,j.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function N(e,t,n){let r=t?.replace(/\/+$/,``);if(r&&e.startsWith(`${r}/`))return e.slice(r.length+1);let i=/^.*\/\.ai\/(?:cezar|squawk)\/worktrees\/[^/]+\/(.+)$/.exec(e);if(i?.[1])return i[1];if(e.startsWith(`/`)&&n&&!n.startsWith(`/`)){let t=n.replace(/^\.?\//,``);if(t&&(e===`/${t}`||e.endsWith(`/${t}`)))return t}return e}function P(e,t,n){let r=t&&/\.(?:md|markdown)$/i.test(e.path),i=t&&h(e.path),a=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(e.path),o=t&&a&&e.size<=10*1024*1024?`image`:k(e);return{html:i,kind:o,toggle:(r||i)&&o===`text`,showImage:o===`image`&&(!t||a),rendered:n?null:r?`markdown`:i?`html`:null}}function F({runId:e,entry:t,displayPath:n,className:r,imageUrl:i,downloadUrl:a,snapshot:o,readerHref:s,documentPreview:c=!1}){let[u,d]=(0,O.useState)(!1),[f,m]=(0,O.useState)(!0),h=n??N(t.path),g=P(t,c,u),_=!!(o||a||g.toggle),v=!g.showImage&&g.kind===`text`&&g.rendered===null;return(0,j.jsxs)(z,{className:r,children:[(0,j.jsxs)(`header`,{"data-slot":`file-preview-head`,className:l(`flex min-h-11 items-center gap-2 border-b border-border bg-muted/40 ps-4 text-xs`,v?`pe-2 py-1`:`pe-4 py-2.5`),children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium text-foreground`,title:h,children:h}),(0,j.jsx)(`span`,{"data-slot":`file-preview-size`,className:`ml-auto shrink-0 font-mono text-xs tabular-nums text-muted-foreground`,children:A(t.size)}),v?(0,j.jsx)(p,{wrap:f,onWrapChange:m,className:`rounded-md`}):null]}),_?(0,j.jsx)(L,{snapshot:o,downloadUrl:a,source:g.toggle?u:null,onSource:()=>d(e=>!e),readerHref:g.html&&g.kind===`text`?s:void 0}):null,(0,j.jsx)(I,{runId:e,entry:t,kind:g.kind,showImage:g.showImage,rendered:g.rendered,imageUrl:i,wrap:f})]})}function I({runId:e,entry:t,kind:n,showImage:r,rendered:a,imageUrl:o,wrap:s}){return r?(0,j.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,j.jsx)(`img`,{"data-slot":`file-preview-image`,src:o??i(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,j.jsx)(m,{icon:(0,j.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${A(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,j.jsx)(m,{icon:(0,j.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${A(t.size)} of binary data — no text preview.`}):a===`markdown`?(0,j.jsx)(`div`,{className:`p-4`,children:(0,j.jsx)(b,{document:!0,children:t.content??``})}):a===`html`?(0,j.jsx)(x,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,j.jsx)(H,{path:t.path,text:t.content??``,wrap:s})}function L({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,j.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,j.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,j.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,j.jsx)(R,{href:i}):null]})}function R({href:e}){let t=s(),n=c();return(0,j.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:o(e),onClick:r=>y(r,t,e,n),children:`Open reader`})}function z({className:e,children:t}){return(0,j.jsx)(`section`,{"data-slot":`file-preview`,className:l(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var B=1500;function V(e,t){let n=(0,O.useMemo)(()=>t.split(`
|
|
2
2
|
`).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>g(e),[e]),i=n.length>B,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return v(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:_(t,r)?.tokens??n}function H({path:e,text:t,wrap:n=!1}){let r=V(e,t);return(0,j.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":g(e)??`plaintext`,className:`overflow-x-auto overscroll-x-contain py-2 font-mono text-xs leading-[1.7] [scrollbar-width:thin]`,children:(0,j.jsx)(`div`,{className:n?`min-w-0`:`w-max min-w-full`,children:r.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex`,children:[(0,j.jsx)(`span`,{className:`sticky left-0 w-14 shrink-0 select-none bg-card pr-3 pl-4 text-right tabular-nums text-muted-foreground`,children:t+1}),(0,j.jsx)(`span`,{className:l(`min-w-0 flex-1 pr-6`,n?`whitespace-pre-wrap wrap-anywhere`:`whitespace-pre`),children:e.map((e,t)=>(0,j.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})})}export{A as a,C as c,N as i,S as l,F as n,D as o,M as r,w as s,H as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,s as i}from"./dist-CCX8mhHc.js";import{E as a,I as o,M as s,d as c,lt as l}from"./design-icons-QbNMZniQ.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./external-link-BE6y205O.js";import{a as f,i as p,n as m,r as h,t as g}from"./diff-controls-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r,s as i}from"./dist-CCX8mhHc.js";import{E as a,I as o,M as s,d as c,lt as l}from"./design-icons-QbNMZniQ.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./external-link-BE6y205O.js";import{a as f,i as p,n as m,r as h,t as g}from"./diff-controls-DbkfJxfp.js";import{t as _}from"./square-terminal-B6RYYieR.js";import{t as v}from"./button-BV_AiLj2.js";import{i as y,p as b,r as x,t as S}from"./dropdown-menu-NJZfnQCU.js";import{t as C}from"./diff-stat-DCO_BkZB.js";import{t as w}from"./middle-truncated-name-jUQS2QzL.js";var T=u(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),E=u(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),D=e(t(),1),O=n();function k({root:e,selected:t,onSelect:n}){return(0,O.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,O.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,O.jsx)(j,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,O.jsx)(N,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function A({adds:e,dels:t}){return(0,O.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs font-medium tabular-nums`,children:[e>0?(0,O.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,O.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,t]}):null]})}function j({dir:e,depth:t,selected:n,onSelect:i}){let[o,s]=(0,D.useState)(!0);return(0,O.jsxs)(`li`,{children:[(0,O.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,O.jsx)(c,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,o&&`rotate-90`)}),(0,O.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,O.jsx)(`span`,{title:e.path,className:`min-w-0 truncate font-medium`,children:e.name}),(0,O.jsx)(A,{adds:e.adds,dels:e.dels})]}),o?(0,O.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,O.jsx)(j,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,O.jsx)(N,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var M={added:`text-semantic-green`,deleted:`text-semantic-red`};function N({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,O.jsx)(`li`,{children:(0,O.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,O.jsx)(E,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,M[e.status])}),(0,O.jsx)(w,{name:e.name,path:e.path}),(0,O.jsx)(A,{adds:e.adds,dels:e.dels})]})})}function P(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function F(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(F)}}var I=(e,t)=>e.name.localeCompare(t.name);function L(e){let t=P(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=P(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(I),e.files.sort(I)};return i(t),{...t,dirs:t.dirs.map(F)}}function R({bar:e,healthReady:t,branch:n,stat:i,mode:a,wrap:o,preview:s=!1,onModeChange:c,onWrapChange:l,onPreviewChange:u,onAction:d}){let _=s&&u!==void 0;return(0,O.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-4 md:px-9 [&_button:not([data-button-size])]:min-h-11`,children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[n?(0,O.jsx)(g,{branch:n}):null,i?(0,O.jsx)(V,{stat:i}):null]}),(0,O.jsxs)(`span`,{className:r(`ml-auto flex items-center gap-1.5`,!u&&`md:hidden`),children:[(0,O.jsx)(m,{wrap:o,onWrapChange:l,preview:s,onPreviewChange:u,disabled:_}),_?(0,O.jsx)(p,{}):null,u?(0,O.jsx)(`span`,{className:`max-md:hidden`,children:(0,O.jsx)(f,{preview:s,onPreviewChange:u})}):null]}),(0,O.jsxs)(`span`,{className:r(`flex items-center gap-2 max-md:w-full`,!u&&`md:ml-auto`),children:[(0,O.jsx)(h,{mode:a,wrap:o,onModeChange:c,onWrapChange:l,disabled:_}),(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`hidden h-5 w-px bg-border md:block`}),(0,O.jsxs)(`span`,{"data-slot":`git-toolbar-actions`,className:`flex items-center gap-1.5 max-md:flex-1 max-md:[&>*]:flex-1`,children:[e.secondary.map(e=>(0,O.jsx)(B,{action:e,variant:`outline`,onAction:d},e.id)),(0,O.jsx)(B,{action:e.primary,variant:e.primaryVariant,onAction:d})]}),e.menu.length>0?(0,O.jsxs)(S,{children:[(0,O.jsx)(b,{asChild:!0,children:(0,O.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,className:`max-md:border max-md:border-border max-md:bg-card`,children:(0,O.jsx)(T,{"aria-hidden":`true`})})}),(0,O.jsx)(x,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,O.jsxs)(y,{disabled:!e.enabled,title:e.reason,onSelect:()=>d(e.id),children:[z[e.id],e.label]},e.id))})]}):null]})]})}var z={commit:(0,O.jsx)(s,{size:16,"aria-hidden":`true`}),push:(0,O.jsx)(l,{size:16,"aria-hidden":`true`}),"create-pr":(0,O.jsx)(o,{size:16,"aria-hidden":`true`}),"view-pr":(0,O.jsx)(d,{"aria-hidden":`true`}),"open-terminal":(0,O.jsx)(_,{"aria-hidden":`true`})};function B({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,O.jsx)(v,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,O.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[z[e.id],e.label]})}):(0,O.jsxs)(v,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[z[e.id],e.label]}):(0,O.jsxs)(v,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[z[e.id],e.label]})}function V({stat:e}){return(0,O.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,O.jsx)(C,{stat:{adds:H(e.adds),dels:H(e.dels),files:e.files}})})}function H(e){let[t,n]=(0,D.useState)(e),r=(0,D.useRef)(e);return(0,D.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{k as i,R as n,L as r,V as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Et as r,In as i,O as a,Un as o,a as s,c,d as l,i as u,lt as d,n as f,o as p,on as m,r as h,ut as g,wt as _,yr as v}from"./queries-Byfl3YoC.js";import{g as y}from"./host-context-KsSKxKbI.js";import{G as b,J as x,R as S,Ti as C,Y as w,a as T,ea as E,q as D,sa as O}from"./project-scope-context-BWHk0niI.js";import{g as ee,p as te}from"./chunk-KS7C4IRE-BdLLx37K.js";import{c as k,i as ne,t as re}from"./reference-chip-rDOAte2y.js";import{o as A}from"./dist-CCX8mhHc.js";import{I as j,L as M,Q as ie,Z as N,ct as P,i as ae,l as F,m as I,r as oe,u as se,ut as ce}from"./design-icons-QbNMZniQ.js";import{t as le}from"./chevron-down-CHGyCDBH.js";import{t as ue}from"./chevron-right-BENZ-1ZN.js";import{t as L}from"./loader-circle-CPBhhDbB.js";import{t as de}from"./play-CmVAj_fu.js";import{t as R}from"./button-BV_AiLj2.js";import{a as fe,i as pe,n as me,r as z,t as he}from"./select-NqOFf6R2.js";import{i as B,r as V,t as H}from"./popover-BQolmvDR.js";import{r as ge,t as U}from"./project-router-TP6DSj1S.js";import{t as _e}from"./status-dot-Bn3O77El.js";import{c as W,d as G,f as ve,m as ye}from"./page-shell-BdjH5hyc.js";import{a as be,o as xe,r as Se,s as Ce,t as we}from"./command-4D8sPZJy.js";import{t as K}from"./centered-state-N8vWM_Hw.js";import{t as Te}from"./use-search-params-writer-DD5PEEZw.js";import{At as q,Ct as Ee,Dn as De,Dt as Oe,Et as ke,Fn as Ae,Ft as je,It as Me,Kn as Ne,Lt as Pe,Mt as Fe,Nt as Ie,Ot as Le,Pt as Re,St as ze,Tt as Be,ir as Ve,jt as He,kt as Ue,o as We,pt as Ge,sr as Ke,wt as qe,xt as Je,zn as Ye}from"./index-C53kW2ni.js";import{t as Xe}from"./markdown-BJEVJ9Ul.js";import{a as Ze,c as Qe,f as $e,h as et,i as tt,l as nt,m as rt,n as it,o as at,p as J,r as ot,s as st,t as ct,u as lt}from"./use-hand-to-agent-state-DjarY58R.js";import{t as ut}from"./tab-link-BeONvGY1.js";var Y=e(t(),1),X=n();function dt({number:e,repo:t}){let n=y();return(0,X.jsx)(ft,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function ft({number:e,repo:t,scope:n}){let a=(0,Y.useId)(),s=(0,Y.useId)(),[c,l]=(0,Y.useState)(!1),u=c?le:ue,d=_(n,!0,n==="default"),f=r(`#${e}`,!0),p=(0,Y.useMemo)(()=>Ie(o(d.data??[],f.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[d.data,f.data,e,t,n]);return(0,X.jsxs)(`section`,{"aria-labelledby":a,className:A(`mt-4 min-w-0 rounded-lg border border-border`,c?`p-3`:`p-0.5`),children:[(0,X.jsx)(`h3`,{id:a,className:`text-xs font-semibold text-muted-foreground`,children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":s,onClick:()=>l(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(u,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,X.jsxs)(`span`,{children:[`Linked tasks`,d.data?` (${p.length}${f.hasNextPage||f.isError?`+`:``})`:``]})]})}),(0,X.jsx)(`div`,{id:s,children:c?(0,X.jsxs)(X.Fragment,{children:[d.isPending?(0,X.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,d.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,X.jsx)(R,{variant:`outline`,className:`mt-2`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry linked tasks`})]}):null,d.data&&p.length===0&&!d.isError?(0,X.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,p.length>0?(0,X.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:p.map(e=>{let t=Ae(e,C(e));return(0,X.jsx)(`li`,{children:(0,X.jsxs)(U,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:i(e)}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(_e,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,X.jsx)(Ve,{"data-slot":`linked-task-archived`,dot:De.tone,shape:De.shape,className:`px-2 py-px`,children:De.label}):null,(0,X.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,f.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,X.jsx)(R,{variant:`outline`,className:`mt-2`,onClick:()=>void f.refetch(),disabled:f.isFetching,children:`Retry older linked tasks`})]}):f.hasNextPage?(0,X.jsx)(R,{variant:`outline`,className:`mt-2`,onClick:()=>void f.fetchNextPage(),disabled:f.isFetchingNextPage,children:f.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var pt=`w-44 max-w-full`,Z=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-ring disabled:opacity-60`,Q=`__all__`;function mt(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function ht(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function gt(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function _t(e){return[e.viewerLogin?``:`GitHub login unavailable.`,gt(e)].filter(Boolean).join(` `)}function vt({options:e,assignees:t,onAssigneesChange:n}){return(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:`${Z} inline-flex items-center gap-1.5`,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,X.jsx)(se,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(V,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,X.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,X.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,X.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,X.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function yt({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,X.jsxs)(he,{value:t||Q,onValueChange:e=>n(e===Q?``:e),children:[(0,X.jsx)(pe,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${Z} ${pt} justify-between`,children:(0,X.jsx)(fe,{placeholder:`All boards`})}),(0,X.jsxs)(me,{align:`start`,children:[(0,X.jsx)(z,{value:Q,children:`All boards`}),e.projects.map(e=>(0,X.jsx)(z,{value:e.id,"data-board":e.id,children:e.title},e.id))]})]});if(e.projects||e.projectsState){let t=e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`;return(0,X.jsxs)(he,{disabled:!0,value:Q,children:[(0,X.jsx)(pe,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${Z} ${pt} justify-between`,children:(0,X.jsx)(fe,{placeholder:t,children:t})}),(0,X.jsx)(me,{align:`start`,children:(0,X.jsx)(z,{value:Q,children:t})})]})}return null}function bt({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,X.jsxs)(H,{open:i,onOpenChange:a,children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsx)(`button`,{ref:o,type:`button`,className:`${Z} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,X.jsx)(N,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,X.jsx)(P,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,X.jsx)(V,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function xt({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,Y.useState)(!1),s=(0,Y.useRef)(null),c=(0,Y.useRef)(null),l=(0,Y.useRef)(null),u=(0,Y.useRef)(null),d=mt(e.issues,t),f=ht(e.viewerLogin,t),p=_t(e),m=p!==``,h=(0,Y.useRef)(p);m&&(h.current=p);let g=(0,Y.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,Y.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,Y.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,X.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,X.jsx)(vt,{options:d,assignees:t,onAssigneesChange:r}),(0,X.jsxs)(`button`,{ref:u,type:`button`,"data-slot":`gh-assigned-me`,className:`${Z} inline-flex items-center gap-1.5 rounded-full aria-pressed:border-accent-strong aria-pressed:bg-accent-strong aria-pressed:text-accent-strong-foreground aria-pressed:hover:bg-accent-strong`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,X.jsx)(ce,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,X.jsx)(yt,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,X.jsx)(bt,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function St({onRefresh:e,refreshing:t}){let n=Je(y());return(0,X.jsx)(G,{route:`github`,density:`full`,headerSpacing:`compact`,header:{title:`GitHub`,secondaryActions:(0,X.jsx)(W,{type:`button`,variant:`ghost`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,children:(0,X.jsx)(N,{size:17,"aria-hidden":`true`,className:A(`size-[17px]`,t&&`motion-safe:animate-spin`)})})},children:(0,X.jsx)(`div`,{"data-slot":`github-filter-screen`,children:(0,X.jsx)(ze,{model:n,variant:`screen`})})})}function Ct({view:e,activeFilter:t,isDesktop:n,listInUrl:r,n:i,gh:a,actions:o}){return{headerSlot:`gh-masthead`,title:n?e===`issues`?`Issues`:`Pull requests`:`GitHub`,scope:n?Ee[t]:void 0,scopeSlot:`gh-title-qualifier`,subtitle:a.repo?(0,X.jsxs)(`span`,{className:`block min-w-0 truncate`,children:[(0,X.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,X.jsxs)(`span`,{"data-slot":`gh-synced`,title:a.syncedAt?new Date(a.syncedAt).toLocaleString():void 0,children:[` `,`· `,a.syncedAt?(0,X.jsx)(Ye,{iso:a.syncedAt,prefix:`Synced `}):`Not synced yet`]})]}):void 0,secondaryActions:(0,X.jsx)(wt,{...o}),headerExtra:r&&i===void 0?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`mt-1 flex min-w-0 items-center gap-3 md:hidden`,children:[(0,X.jsxs)(U,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,X.jsx)(oe,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,X.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-muted-foreground`,children:[...ke,...Oe].find(e=>e.id===t)?.label})]}):void 0}}function wt({automationsAvailable:e,refreshing:t,onRefresh:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-page-actions`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[e?(0,X.jsx)(W,{variant:`outline`,asChild:!0,children:(0,X.jsx)(U,{to:`/automations/new`,children:`Set up automations`})}):null,(0,X.jsxs)(W,{type:`button`,variant:`outline`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,children:[(0,X.jsx)(N,{size:16,"aria-hidden":`true`,className:A(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Tt({view:e,number:t}){return(0,X.jsx)(K,{icon:e===`issues`?(0,X.jsx)(I,{size:16}):(0,X.jsx)(j,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Go back to the list and search for ${t} to look it up on GitHub, closed and merged included.`})}var Et=/^(\[[^\]\n]{1,24}\]:?)\s+(\S.*)$/s;function Dt(e){let t=Et.exec(e);return t?{prefix:t[1],rest:t[2]}:{prefix:null,rest:e}}function Ot(e,t){if(!t)return e.kind===`issue`?`open`:e.isDraft?`draft`:void 0}function kt(e){let t=e.reduce((e,t)=>Math.max(e,String(t.number).length),1);return Math.ceil(28+(t+1)*7.2)}var At=2;function jt({item:e,view:t,filter:n,narrows:r,colors:i,expanded:a,onToggle:o,queuedRunId:s,checks:c,comments:l,status:u,task:f,referenceWidth:p}){let h=E(),_=`gh-row-summary-${e.kind}-${e.number}`,v=e.kind===`pr`?`PR`:`Issue`,y=k(v,e.number),b=(v===`PR`&&y.conflicting===!0?d:g(u??y.status))?.label,S=Dt(e.title),C=()=>{h.prefetchQuery({queryKey:m.githubComments(e.kind,e.number),queryFn:({signal:t})=>x(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,X.jsxs)(`div`,{"data-slot":`gh-row-shell`,"data-expanded":a||void 0,style:{"--gh-ref-width":`${p}px`},className:A(`@container rounded-md`,a&&`bg-sidebar-row-selected`),children:[(0,X.jsxs)(`button`,{type:`button`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,ot(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:C,onFocus:C,onClick:o,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-expanded":a,"aria-controls":a?_:void 0,title:`Drag into the composer to prefill a task`,className:`grid w-full grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-1.5 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 @4xl:grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto_auto]`,children:[(0,X.jsxs)(`span`,{"data-slot":`gh-row-ref`,title:b,className:`flex h-[18px] items-center`,children:[(0,X.jsx)(re,{reference:{kind:v,number:e.number},taskTitle:e.title,status:u,compact:!0,inert:!0}),b?(0,X.jsx)(`span`,{className:`sr-only`,children:b}):null]}),(0,X.jsxs)(`span`,{"data-slot":`gh-row-title`,className:A(`line-clamp-2 min-w-0 text-[13px] leading-[18px] font-medium text-foreground [overflow-wrap:anywhere] @4xl:line-clamp-none`,a&&`font-semibold`),children:[S.prefix?(0,X.jsxs)(`span`,{"data-slot":`gh-row-title-prefix`,className:`font-normal text-soft-foreground`,children:[S.prefix,` `]}):null,S.rest]}),(0,X.jsx)(se,{"data-slot":`gh-row-cue`,"aria-hidden":`true`,className:A(`col-start-3 row-start-1 mt-px size-4 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none @4xl:col-start-4`,a&&`rotate-180`)}),e.labels.length>0?(0,X.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap gap-1 @4xl:col-end-3`,children:e.labels.map(e=>(0,X.jsx)(lt,{label:e,color:i[e],className:`max-w-full truncate`},e))}):null,(0,X.jsx)(Mt,{item:e,view:t,task:f,queuedRunId:s,checks:c,comments:l})]}),a?(0,X.jsx)(Pt,{id:_,item:e,checks:c,detailPath:Ue(t,n,e.number,``,r),queuedRunId:s}):null]})}function Mt({item:e,view:t,task:n,queuedRunId:r,checks:i,comments:a}){let o=e.assignees??[];return(0,X.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground @4xl:col-start-3 @4xl:col-end-4 @4xl:row-start-1 @4xl:h-[18px] @4xl:flex-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`gh-row-task`,className:$.task,children:n?(0,X.jsx)(Ve,{dot:n.status.tone,shape:n.status.shape,pulse:n.status.pulse,title:`Newest task: ${n.status.label}`,className:`max-w-full py-0.5`,children:(0,X.jsx)(`span`,{className:`truncate`,children:n.status.label})}):r?(0,X.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`}):null}),(0,X.jsx)(`span`,{"data-slot":`gh-row-assignees`,className:$.assignees,children:o.length>0?(0,X.jsx)(Nt,{logins:o}):null}),t===`prs`?(0,X.jsx)(`span`,{"data-slot":`gh-row-checks-slot`,className:$.checks,children:i?(0,X.jsx)(at,{checks:i}):null}):null,(0,X.jsx)(`span`,{"data-slot":`gh-row-comments`,className:$.comments,children:a?(0,X.jsx)(st,{count:a}):null}),(0,X.jsx)(Ye,{iso:e.createdAt,className:`shrink-0 @4xl:w-9 @4xl:text-right`})]})}var $={task:`flex min-w-0 max-w-full empty:hidden @4xl:w-44 @4xl:empty:block`,assignees:`flex shrink-0 items-center empty:hidden @4xl:w-12 @4xl:justify-center @4xl:empty:block`,checks:`flex shrink-0 empty:hidden @4xl:w-4 @4xl:justify-center @4xl:empty:block`,comments:`flex shrink-0 empty:hidden @4xl:w-10 @4xl:empty:block`};function Nt({logins:e}){let t=e.join(`, `);return(0,X.jsxs)(`span`,{title:`Assigned to ${t}`,className:`flex items-center -space-x-1`,children:[e.slice(0,At).map(e=>(0,X.jsx)(tt,{login:e},e)),e.length>At?(0,X.jsxs)(`span`,{"aria-hidden":`true`,className:`pl-2 tabular-nums`,children:[`+`,e.length-At]}):null,(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Assigned to `,t]})]})}function Pt({id:e,item:t,checks:n,detailPath:r,queuedRunId:i}){let a=u(t.kind,t.number),o=(a.data?.detail?.body??t.body)?.trim(),s=t.kind===`pr`?`PR`:`issue`;return(0,X.jsxs)(`div`,{id:e,"data-slot":`gh-row-summary`,className:`flex flex-col gap-3 px-3 pb-4 @4xl:pl-[calc(var(--gh-ref-width)+1.5rem)]`,children:[(0,X.jsx)(`div`,{"data-slot":`gh-row-body`,className:`text-[13px] leading-relaxed text-soft-foreground`,children:o?(0,X.jsx)(`div`,{"data-slot":`gh-row-excerpt`,inert:!0,className:Ft,children:(0,X.jsx)(Xe,{document:!0,children:o})}):a.isPending?(0,X.jsx)(Ke,{className:`h-4 w-2/3`}):a.isError||a.data?.available===!1?(0,X.jsx)(`p`,{"data-slot":`gh-row-body-unavailable`,className:`text-muted-foreground`,children:`Description unavailable. Use Refresh to try again.`}):(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,X.jsxs)(`div`,{"data-slot":`gh-row-facts`,className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Opened by `,(0,X.jsx)(`span`,{"data-slot":`gh-row-author`,className:`font-medium`,children:t.author})]}),n?(0,X.jsx)(Ze,{checks:n,url:t.url}):null]}),(0,X.jsxs)(`div`,{"data-slot":`gh-row-actions`,className:`flex flex-wrap items-center gap-2`,children:[i?(0,X.jsx)(R,{asChild:!0,variant:`outline`,size:`sm`,children:(0,X.jsxs)(U,{to:`/tasks/${i}`,"data-action":`gh-row-view-task`,children:[(0,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsx)(R,{asChild:!0,variant:`primary`,size:`sm`,children:(0,X.jsxs)(U,{to:r,state:{focusHandoff:!0},"data-action":`gh-row-handoff`,title:`Open this ${s} and write the prompt for an agent`,children:[(0,X.jsx)(de,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}),(0,X.jsx)(R,{asChild:!0,variant:`outline`,size:`sm`,children:(0,X.jsxs)(U,{to:r,"data-action":`gh-row-open`,children:[`Open `,s,(0,X.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3.5`})]})})]})]})}var Ft=A(`max-h-[calc(3lh)] overflow-hidden [overflow-wrap:anywhere]`,`[&_*]:!my-0 [&_p+*]:!mt-1 [&_ul]:list-inside [&_ol]:list-inside`,`[&_:is(h1,h2,h3,h4,h5,h6,pre,img,table,hr,[data-streamdown="code-block"],[data-streamdown="table-wrapper"],[data-streamdown="image-wrapper"],[data-streamdown="mermaid-block"])]:hidden`);function It(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function Lt(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(It(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function Rt(e,t){let[n,r]=(0,Y.useState)(0);return(0,Y.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function zt(e,t,n){let[r,i]=(0,Y.useState)(null),a=(0,Y.useRef)(n);return(0,Y.useEffect)(()=>{a.current=n}),(0,Y.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function Bt(e,t,n,r,i){let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),l=Lt(a),u=(0,Y.useRef)(null);u.current=l;let d=Rt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:zt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function Vt({item:e,queuedRunId:t}){return t?(0,X.jsx)(R,{asChild:!0,variant:`outline`,size:`sm`,children:(0,X.jsxs)(U,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsxs)(R,{type:`button`,variant:`primary`,size:`sm`,"data-action":`gh-header-handoff`,title:`Write the prompt and pick the workflow and runner for this ${e.kind===`pr`?`PR`:`issue`}`,onClick:Ht,children:[(0,X.jsx)(de,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function Ht(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var Ut=100;function Wt(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=Ut)break;a.add(t.number)}return[...a]}function Gt(e,t,n,r,i,a){let o=Wt(n,e,r,i,a),s=f(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=h(e===`issues`?`issue`:`pr`,(0,Y.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),u=(0,Y.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>l[e.number]??(u.has(e.number)?void 0:e.comments)}}function Kt(e){let t=y(),n=_(t,!0,t==="default").data,r=(0,Y.useMemo)(()=>n?Re(n,e,t):null,[n,e,t]);return(0,Y.useCallback)(e=>{let t=e.kind===`issue`?r?.get(e.number):void 0;return t?{runId:t.id,status:Ae(t)}:null},[r])}function qt(e){let[t,n]=Te(),r=t.get(`filter`),i=je(e,r),a=i??`all`,o=e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n}),s=q(t);return{rawFilterParam:r,filter:i,activeFilter:a,setFilterParam:o,narrows:s,url:(0,Y.useMemo)(()=>{let t=new URLSearchParams(s);return{query:t.get(`q`)??``,labels:t.getAll(`label`),assignees:e===`issues`?t.getAll(`assignee`):[],board:e===`issues`?t.get(`board`)??``:``}},[s,e]),writeNarrows:(0,Y.useCallback)(e=>n(t=>{let n=e(t);return(t.has(`filter`)||q(t)!==``)&&!n.has(`filter`)&&q(n)===``&&n.set(`filter`,`all`),n}),[n])}}function Jt(e,t){return n=>{let r=new URLSearchParams(n);r.delete(e);for(let n of t)r.append(e,n);return r}}function Yt(e,t,{rawFilterParam:n,filter:r,activeFilter:i,setFilterParam:a,narrows:o,url:s,writeNarrows:c}){let l=Zt(s.query,n!==null||o!==``,c),{query:u,setQuery:d}=l,f=s.labels,p=s.assignees,m=e=>c(Jt(`label`,e)),{setProjectFilter:h,activeProject:g}=Qt(t,s.board,c),_=e===`issues`&&i===`assigned`,v=_?t?.viewerLogin?[t.viewerLogin]:[]:p;return{query:u,setQuery:d,labelFilter:f,setLabelFilter:m,setProjectFilter:h,activeProject:g,isAssignedFilter:_,effectiveAssignees:v,changeAssignees:e=>{c(Jt(`assignee`,e)),_&&a(`all`)},clearFilters:()=>{l.clear(),c(e=>{let t=new URLSearchParams(e);for(let e of Be)t.delete(e);return r!==null&&r!==`all`&&t.set(`filter`,`all`),t})},filtering:u.trim()!==``||f.length>0||e===`issues`&&(v.length>0||g!==``)||r!==null&&r!==`all`,narrowing:u.trim()!==``||f.length>0||e===`issues`&&(!_&&p.length>0||g!==``)}}var Xt=250;function Zt(e,t,n){let r=`${te().pathname}${t?``:`#entry`}`,[i,a]=(0,Y.useState)(e),o=(0,Y.useRef)(e),s=(0,Y.useRef)(void 0),c=(0,Y.useRef)(r);return(0,Y.useEffect)(()=>{e===o.current&&r===c.current||(clearTimeout(s.current),c.current=r,o.current=e,a(e))},[e,r]),(0,Y.useEffect)(()=>()=>clearTimeout(s.current),[]),{query:i,setQuery:e=>{a(e),clearTimeout(s.current),s.current=setTimeout(()=>{let t=e.trim();o.current=t,n(e=>{let n=new URLSearchParams(e);return t===``?n.delete(`q`):n.set(`q`,t),n})},Xt)},clear:()=>{clearTimeout(s.current),o.current=``,a(``)}}}function Qt(e,t,n){let r=e=>n(t=>{let n=new URLSearchParams(t);return e===``?n.delete(`board`):n.set(`board`,e),n}),i=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,a=i||e?.projects?.some(e=>e.id===t)===!0,o=e?.available===!0&&!i&&t!==``&&!a,[s,c]=(0,Y.useState)(``);s!==``&&s!==t&&c(``),o&&s!==t&&c(t);let l=o||s!==``&&s===t,u=a&&!l?t:``;return(0,Y.useEffect)(()=>{l&&n(e=>{let t=new URLSearchParams(e);return t.delete(`board`),t})},[l,n]),{setProjectFilter:r,activeProject:u}}function $t(e,t,{filter:n,activeFilter:r},i){let a=y(),o=e===`issues`&&(r===`no-task`||r===`has-task`),s=_(a,o,a==="default"),l=(0,Y.useMemo)(()=>s.data?Fe(s.data,t?.repo,a):null,[s.data,t?.repo,a]),u=He(e,n)?Pe(n):null,d=c(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,Y.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,Y.useMemo)(()=>f?Me(f,p):null,[f,p]),h=en({view:e,gh:t,activeFilter:r,isAssignedFilter:i,taskFilter:o,taskNumbers:l,runsQuery:s,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,Y.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,Y.useMemo)(()=>e===`issues`?r===`no-task`&&l?{excludeNumbers:l}:r===`has-task`&&l?{includeNumbers:l}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,r,l,t?.viewerLogin,f])}}function en({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?l.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${l.data.reason??`unknown reason`}.`}:l.isError?{kind:`blocked`,message:`GitHub could not be searched: ${l.error instanceof Error?l.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null}function tn(e,t){return t?w(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function nn(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=m.github()[0],s=t===void 0?null:Number.parseInt(t,10),c=!r&&n.data?.available?n.data.items.find(e=>e.number===s):void 0,l=i&&s!==null&&!a.some(e=>e.number===s)?i.find(e=>e.number===s):void 0,u=c??l,[d,f]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{u&&f({scope:o,view:e,item:u})},[o,e,u]),{selectedNumber:s,remoteDetail:u??(d?.scope===o&&d.view===e&&d.item.number===s?d.item:null)}}function rn(e,t,n,{fullList:r,filterRows:i},a){let o=E(),c=(0,Y.useRef)(null),l=e===`issues`?`issue`:`pr`,u=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,d=s(l,n??0,u),f=u&&d.data?.available&&d.data.item?.kind===l?d.data.item:null;c.current=u&&n!==null?{kind:l,number:n,key:m.githubItem(l,n)}:null;let[p,h]=(0,Y.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:f,exactTargetRef:c,retryingExact:p,retryExact:()=>{h(!0),tn(o,c.current).then(e=>{h(!1),e||T(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function an(e,t,n){let r=E(),i=(0,Y.useRef)(null);return{refresh:v({mutationFn:e=>(tn(r,e),b({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:m.githubPages(50),exact:!0}),r.setQueryData(m.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:m.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),c=m.githubCommentCounts(o,s);r.removeQueries({queryKey:m.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==O(c)}),a.available&&a.commentsDeferred&&s.length>0&&D(o,s,{refresh:!0}).then(e=>r.setQueryData(c,e)).catch(()=>{}),r.invalidateQueries({queryKey:m.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:m.githubSearch(`pr`,Le)}),r.invalidateQueries({queryKey:m.githubSearch(`pr`,qe)});let l=i.current,u=m.githubComments(`issue`,0).slice(0,3);if(!l){r.removeQueries({queryKey:u});return}let d=m.githubComments(l.kind,l.number);x(l.kind,l.number,{refresh:!0}).then(e=>r.setQueryData(d,e)).catch(()=>{}),r.removeQueries({queryKey:u,predicate:e=>e.queryHash!==O(d)})},onError:e=>T(e.message,{tone:`danger`})}),openThreadRef:i}}var on=350;function sn(e,t){let[n,r]=(0,Y.useState)(e);return(0,Y.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function cn(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:l}){let u=sn(n,on),d=(0,Y.useMemo)(()=>J(o,{query:u,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,u,r,e,i,a,s]),f=n.trim()===u.trim(),p=t?.available===!0&&!l&&f&&et(u,d),m=c(e===`issues`?`issue`:`pr`,u,p),h=J(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),g=p&&m.data?.available?m.data:null,_=new Set(h.map(e=>e.number)),v=ln(e,g,a,i);return{debouncedQuery:u,searchWanted:p,forgeSearch:m,items:h,searchPayload:g,metadataFailure:v,searchHits:g&&!v?J(g.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!_.has(e.number)):[],...un(n,f,p,m)}}function ln(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function un(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function dn({view:e,changes:t=!1,index:n=!1}){let{n:r}=ee(),i=qt(e),{rawFilterParam:o,activeFilter:s,narrows:c}=i,l=o!==null||c!==``,u=ye(),{pages:d,data:f}=p(50),m=Ne(),h=pn(),g=ct(),_=fn({index:n,isDesktop:u,listInUrl:l,n:r,rememberedView:a().data?.githubView}),[v,y]=(0,Y.useState)(null),b=Yt(e,f,i),x=$t(e,f,i,b.isAssignedFilter),S=cn(e,f,b,x),C=nn(e,r,S.forgeSearch,x),w=rn(e,f,C.selectedNumber,x,C.remoteDetail),T=Gt(e,d,f,C.selectedNumber,S.searchHits,x.openItems),{refresh:E,openThreadRef:D}=an(e,T.checkPrNumbers,S.debouncedQuery),O=Bt(e,d,f,x.backedQuery,b.narrowing),te=Kt(f?.available?f.repo:void 0);if(_.restorePrs)return(0,X.jsx)(ge,{to:`/github/prs`,replace:!0});if(!f)return d.isError?(0,X.jsx)(G,{route:`github`,density:`empty`,children:(0,X.jsx)(K,{icon:(0,X.jsx)(P,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:d.error.message})}):(0,X.jsx)(Ge,{});D.current=null;let k=()=>E.mutate(w.exactTargetRef.current);if(_.filterScreen&&f.available)return(0,X.jsx)(St,{onRefresh:k,refreshing:E.isPending});if(!f.available)return(0,X.jsx)(vn,{reason:f.reason,refreshing:E.isPending,onRetry:k});let{labelColors:ne,labelOptions:re}=mn(f,S.searchPayload,x.openItems,x.fullList),A=hn({number:C.selectedNumber,fullList:x.fullList,filterRows:x.filterRows,remoteDetail:C.remoteDetail,exactDetail:w.exactDetail}),j=r===void 0?[...S.items,...S.searchHits].find(e=>e.url===v)??null:null,M=A??j;D.current=M?{kind:M.kind,number:M.number}:null;let{linkFilter:ie,listPath:N}=gn(e,o,s,u,c),ae={view:e,filter:ie,narrows:c,colors:ne,expandedUrl:j?.url??null,onToggle:e=>y(t=>t===e.url?null:e.url),queued:g.queued,checksMap:T.checksMap,commentsOf:T.commentsOf,taskOf:te,referenceWidth:kt([...S.items,...S.searchHits])},F=_n(e,b,x.filterGate,S),I=Ct({view:e,activeFilter:s,isDesktop:u,listInUrl:l,n:r,gh:f,actions:{automationsAvailable:m,refreshing:E.isPending,onRefresh:k}});return r===void 0?(0,X.jsxs)(G,{route:`github`,density:ve(S.items.length+S.searchHits.length),headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,bodyClassName:`gap-2.5`,header:I,children:[(0,X.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-4`,children:[(0,X.jsx)(yn,{view:e,isDesktop:u,gh:f,onSaveView:h}),(0,X.jsx)(bn,{view:e,gh:f,filters:b,labelOptions:re,labelColors:ne,searchPayload:S.searchPayload})]}),(0,X.jsx)(Cn,{view:e,rows:ae,verdict:F,search:S,sidebar:x,list:d,paging:O})]}):(0,X.jsx)(G,{route:`github`,density:`full`,headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,header:I,children:(0,X.jsx)(On,{view:e,selected:A,selectedNumber:C.selectedNumber,exact:w,repo:f.repo,rows:ae,listPath:N,changes:t,handToAgent:g})})}function fn({index:e,isDesktop:t,listInUrl:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&!n&&r===void 0,restorePrs:e&&t&&!n&&i===`prs`}}function pn(){let e=E();return t=>{e.setQueryData(m.uiState,e=>({...e,githubView:t})),S({githubView:t}).then(t=>e.setQueryData(m.uiState,t)).catch(t=>{T(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:m.uiState})})}}function mn(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:$e([...n,...r,...t?.items??[]])}}function hn({number:e,fullList:t,filterRows:n,remoteDetail:r,exactDetail:i}){return e===null?null:t.find(t=>t.number===e)??n?.find(t=>t.number===e)??r??i??null}function gn(e,t,n,r,i){let a=t===null?null:n;return{linkFilter:a,listPath:Ue(e,a??(e===`issues`&&!r?`all`:null),void 0,``,i)}}function _n(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,X.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,X.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,X.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,X.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,X.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,X.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,X.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,X.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,X.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,`.`]})}function vn({reason:e,refreshing:t,onRetry:n}){return(0,X.jsx)(G,{route:`github`,density:`empty`,children:(0,X.jsx)(K,{icon:(0,X.jsx)(M,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,X.jsx)(R,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:n,children:`Try again`}),children:(0,X.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`The tab needs the `,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in Squawk works without it.`]})})})}function yn({view:e,isDesktop:t,gh:n,onSaveView:r}){return(0,X.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,X.jsxs)(ut,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,X.jsxs)(ut,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function bn({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,X.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,X.jsx)(ie,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 w-full rounded-lg border border-card-edge bg-card shadow-card py-1 pr-2.5 pl-8 text-[13px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,X.jsx)(jn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,X.jsx)(xt,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,X.jsx)(`button`,{type:`button`,disabled:!n.filtering,"data-slot":`gh-clear-filters`,className:`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:border-border disabled:bg-transparent disabled:text-muted-foreground`,onClick:n.clearFilters,children:`Clear filters`})]})}function xn(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Sn(e,t,n=!1){return(0,X.jsx)(jt,{item:e,view:t.view,filter:t.filter,narrows:t.narrows,colors:t.colors,expanded:t.expandedUrl===e.url,onToggle:()=>t.onToggle(e),queuedRunId:t.queued.get(e.url)??null,checks:xn(e,t.checksMap),comments:t.commentsOf(e),status:Ot(e,n),task:t.taskOf(e),referenceWidth:t.referenceWidth})}function Cn({view:e,rows:t,verdict:n,search:r,sidebar:i,list:a,paging:o}){let{items:s,searchHits:c}=r;return(0,X.jsxs)(`section`,{ref:o.setListEl,"data-slot":`gh-list`,className:`relative flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card p-3`,children:[s.length===0?n&&(0,X.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):(0,X.jsx)(wn,{items:s,rows:t,paging:o}),o.pagingAvailable?(0,X.jsx)(Tn,{view:e,list:a,paging:o}):null,(0,X.jsx)(En,{backedQuery:i.backedQuery,filterSearch:i.filterSearch}),s.length>0&&r.searchWanted&&n?(0,X.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):null,c.length>0?(0,X.jsx)(Dn,{hits:c,searchPayload:r.searchPayload,rows:t}):null]})}function wn({items:e,rows:t,paging:n}){let{setRowsEl:r,scrollOwner:i,listEl:a,scrollOwnerRef:o,startMargin:s}=n,c=(0,Y.useRef)(null),l=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{if(l.current||!i)return;l.current=!0;let n=e.findIndex(e=>e.url===t.expandedUrl);n>=0&&c.current?.scrollToIndex(n,{align:`start`})},[i,e,t.expandedUrl]);let u=e.map((e,n)=>(0,X.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":n>0||void 0,children:Sn(e,t)},e.url));return(0,X.jsx)(`div`,{ref:r,"data-slot":`gh-rows`,"data-virtualized":i?`true`:void 0,role:`list`,children:i?(0,X.jsx)(We,{ref:c,scrollRef:o,startMargin:s,children:u},i===a?`list`:`main`):u})}function Tn({view:e,list:t,paging:n}){return(0,X.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-muted-foreground`,children:t.isFetchingNextPage?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,X.jsxs)(X.Fragment,{children:[`Could not load more.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,X.jsxs)(X.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function En({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-muted-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function Dn({hits:e,searchPayload:t,rows:n}){let r=(0,Y.useRef)(null),i=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{i.current||(i.current=!0,(r.current?.querySelector(`[data-slot="gh-row"][aria-expanded="true"]`))?.scrollIntoView({block:`start`}))},[]);let a=l();return(0,X.jsx)(ne,{projectId:a,requests:a?e.map(e=>({projectId:a,kind:e.kind===`pr`?`PR`:`Issue`,number:e.number})):[],children:(0,X.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,X.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,X.jsx)(`ul`,{ref:r,className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,X.jsx)(`li`,{children:Sn(e,n,!0)},e.url))})]})})}function On({view:e,selected:t,selectedNumber:n,exact:r,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}){let{exactWanted:l,exactItem:u}=r;return(0,X.jsxs)(`section`,{"data-slot":`gh-detail`,className:`flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card`,children:[t?null:(0,X.jsx)(`div`,{className:`px-4 pt-4 md:px-7 md:pt-5`,children:(0,X.jsx)(Qe,{backLink:{to:o}})}),t?(0,X.jsx)(kn,{item:t,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}):l&&u.isPending?(0,X.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex flex-1 flex-col`,children:(0,X.jsx)(K,{icon:(0,X.jsx)(L,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${n}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):l&&(u.isError||u.data?.available===!1)?(0,X.jsx)(An,{number:n,exact:r}):(0,X.jsx)(Tt,{view:e,number:n})]})}function kn({item:e,repo:t,rows:n,listPath:r,changes:i,handToAgent:a}){let{workflows:o,skillList:s,workflow:c,setWorkflow:l,selectedSkills:u,setSelectedSkills:d,engine:f,setEngine:p,queued:m,onQueued:h}=a,g=te().state?.focusHandoff===!0;return(0,Y.useEffect)(()=>{g&&Ht()},[g,e.url]),(0,X.jsx)(nt,{item:e,comments:n.commentsOf(e),afterHeading:e.kind===`issue`?(0,X.jsx)(dt,{number:e.number,repo:t},e.url):void 0,backLink:{to:r},subNav:{filter:n.filter,narrows:n.narrows,changes:i},onRunAgent:Ht,headerAction:(0,X.jsx)(Vt,{item:e,queuedRunId:m.get(e.url)??null}),colors:n.colors,checks:xn(e,n.checksMap),children:(0,X.jsx)(it,{item:e,workflows:o.data?.workflows??[],skills:s,workflow:c,onWorkflowChange:l,selectedSkills:u,onSkillsChange:d,engine:f,onEngineChange:p,queuedRunId:m.get(e.url)??null,onQueued:h},e.url)})}function An({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,X.jsx)(K,{icon:(0,X.jsx)(P,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,X.jsx)(R,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function jn({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,Y.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,X.jsxs)(H,{open:i,onOpenChange:a,children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:A(`inline-flex min-h-11 min-w-11 shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,X.jsx)(se,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(V,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(we,{children:[(0,X.jsx)(be,{placeholder:`Filter labels…`}),(0,X.jsxs)(Ce,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,X.jsx)(Se,{children:`No labels.`}),n.length>0?(0,X.jsxs)(xe,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,X.jsxs)(xe,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`gh-label-dot`,className:`size-2.5 shrink-0 rounded-full ring-1 ring-foreground/30`,style:rt(t[e])}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{dn as GithubRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Et as r,In as i,O as a,Un as o,a as s,c,d as l,i as u,lt as d,n as f,o as p,on as m,r as h,ut as g,wt as _,yr as v}from"./queries-Byfl3YoC.js";import{g as y}from"./host-context-KsSKxKbI.js";import{G as b,J as x,R as S,Ti as C,Y as w,a as T,ea as E,q as D,sa as O}from"./project-scope-context-BWHk0niI.js";import{g as ee,p as te}from"./chunk-KS7C4IRE-BdLLx37K.js";import{c as k,i as ne,t as re}from"./reference-chip-rDOAte2y.js";import{o as A}from"./dist-CCX8mhHc.js";import{I as j,L as M,Q as ie,Z as N,ct as P,i as ae,l as F,m as I,r as oe,u as se,ut as ce}from"./design-icons-QbNMZniQ.js";import{t as le}from"./chevron-down-CHGyCDBH.js";import{t as ue}from"./chevron-right-BENZ-1ZN.js";import{t as L}from"./loader-circle-CPBhhDbB.js";import{t as de}from"./play-CmVAj_fu.js";import{t as R}from"./button-BV_AiLj2.js";import{a as fe,i as pe,n as me,r as z,t as he}from"./select--NKdUD0C.js";import{i as B,r as V,t as H}from"./popover-BQolmvDR.js";import{r as ge,t as U}from"./project-router-TP6DSj1S.js";import{t as _e}from"./status-dot-Bn3O77El.js";import{c as W,d as G,f as ve,m as ye}from"./page-shell-BdjH5hyc.js";import{a as be,o as xe,r as Se,s as Ce,t as we}from"./command-4D8sPZJy.js";import{t as K}from"./centered-state-N8vWM_Hw.js";import{t as Te}from"./use-search-params-writer-DD5PEEZw.js";import{At as q,Ct as Ee,Dn as De,Dt as Oe,Et as ke,Fn as Ae,Ft as je,It as Me,Kn as Ne,Lt as Pe,Mt as Fe,Nt as Ie,Ot as Le,Pt as Re,St as ze,Tt as Be,ir as Ve,jt as He,kt as Ue,o as We,pt as Ge,sr as Ke,wt as qe,xt as Je,zn as Ye}from"./index-D0RESQCN.js";import{t as Xe}from"./markdown-CcQNTOHx.js";import{a as Ze,c as Qe,f as $e,h as et,i as tt,l as nt,m as rt,n as it,o as at,p as J,r as ot,s as st,t as ct,u as lt}from"./use-hand-to-agent-state-zwUimLza.js";import{t as ut}from"./tab-link-BeONvGY1.js";var Y=e(t(),1),X=n();function dt({number:e,repo:t}){let n=y();return(0,X.jsx)(ft,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function ft({number:e,repo:t,scope:n}){let a=(0,Y.useId)(),s=(0,Y.useId)(),[c,l]=(0,Y.useState)(!1),u=c?le:ue,d=_(n,!0,n==="default"),f=r(`#${e}`,!0),p=(0,Y.useMemo)(()=>Ie(o(d.data??[],f.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[d.data,f.data,e,t,n]);return(0,X.jsxs)(`section`,{"aria-labelledby":a,className:A(`mt-4 min-w-0 rounded-lg border border-border`,c?`p-3`:`p-0.5`),children:[(0,X.jsx)(`h3`,{id:a,className:`text-xs font-semibold text-muted-foreground`,children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":s,onClick:()=>l(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(u,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,X.jsxs)(`span`,{children:[`Linked tasks`,d.data?` (${p.length}${f.hasNextPage||f.isError?`+`:``})`:``]})]})}),(0,X.jsx)(`div`,{id:s,children:c?(0,X.jsxs)(X.Fragment,{children:[d.isPending?(0,X.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,d.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,X.jsx)(R,{variant:`outline`,className:`mt-2`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry linked tasks`})]}):null,d.data&&p.length===0&&!d.isError?(0,X.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,p.length>0?(0,X.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:p.map(e=>{let t=Ae(e,C(e));return(0,X.jsx)(`li`,{children:(0,X.jsxs)(U,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:i(e)}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(_e,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,X.jsx)(Ve,{"data-slot":`linked-task-archived`,dot:De.tone,shape:De.shape,className:`px-2 py-px`,children:De.label}):null,(0,X.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,f.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,X.jsx)(R,{variant:`outline`,className:`mt-2`,onClick:()=>void f.refetch(),disabled:f.isFetching,children:`Retry older linked tasks`})]}):f.hasNextPage?(0,X.jsx)(R,{variant:`outline`,className:`mt-2`,onClick:()=>void f.fetchNextPage(),disabled:f.isFetchingNextPage,children:f.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var pt=`w-44 max-w-full`,Z=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-ring disabled:opacity-60`,Q=`__all__`;function mt(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function ht(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function gt(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function _t(e){return[e.viewerLogin?``:`GitHub login unavailable.`,gt(e)].filter(Boolean).join(` `)}function vt({options:e,assignees:t,onAssigneesChange:n}){return(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:`${Z} inline-flex items-center gap-1.5`,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,X.jsx)(se,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(V,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,X.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,X.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,X.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,X.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function yt({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,X.jsxs)(he,{value:t||Q,onValueChange:e=>n(e===Q?``:e),children:[(0,X.jsx)(pe,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${Z} ${pt} justify-between`,children:(0,X.jsx)(fe,{placeholder:`All boards`})}),(0,X.jsxs)(me,{align:`start`,children:[(0,X.jsx)(z,{value:Q,children:`All boards`}),e.projects.map(e=>(0,X.jsx)(z,{value:e.id,"data-board":e.id,children:e.title},e.id))]})]});if(e.projects||e.projectsState){let t=e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`;return(0,X.jsxs)(he,{disabled:!0,value:Q,children:[(0,X.jsx)(pe,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${Z} ${pt} justify-between`,children:(0,X.jsx)(fe,{placeholder:t,children:t})}),(0,X.jsx)(me,{align:`start`,children:(0,X.jsx)(z,{value:Q,children:t})})]})}return null}function bt({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,X.jsxs)(H,{open:i,onOpenChange:a,children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsx)(`button`,{ref:o,type:`button`,className:`${Z} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,X.jsx)(N,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,X.jsx)(P,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,X.jsx)(V,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function xt({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,Y.useState)(!1),s=(0,Y.useRef)(null),c=(0,Y.useRef)(null),l=(0,Y.useRef)(null),u=(0,Y.useRef)(null),d=mt(e.issues,t),f=ht(e.viewerLogin,t),p=_t(e),m=p!==``,h=(0,Y.useRef)(p);m&&(h.current=p);let g=(0,Y.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,Y.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,Y.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,X.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,X.jsx)(vt,{options:d,assignees:t,onAssigneesChange:r}),(0,X.jsxs)(`button`,{ref:u,type:`button`,"data-slot":`gh-assigned-me`,className:`${Z} inline-flex items-center gap-1.5 rounded-full aria-pressed:border-accent-strong aria-pressed:bg-accent-strong aria-pressed:text-accent-strong-foreground aria-pressed:hover:bg-accent-strong`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,X.jsx)(ce,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,X.jsx)(yt,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,X.jsx)(bt,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function St({onRefresh:e,refreshing:t}){let n=Je(y());return(0,X.jsx)(G,{route:`github`,density:`full`,headerSpacing:`compact`,header:{title:`GitHub`,secondaryActions:(0,X.jsx)(W,{type:`button`,variant:`ghost`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,children:(0,X.jsx)(N,{size:17,"aria-hidden":`true`,className:A(`size-[17px]`,t&&`motion-safe:animate-spin`)})})},children:(0,X.jsx)(`div`,{"data-slot":`github-filter-screen`,children:(0,X.jsx)(ze,{model:n,variant:`screen`})})})}function Ct({view:e,activeFilter:t,isDesktop:n,listInUrl:r,n:i,gh:a,actions:o}){return{headerSlot:`gh-masthead`,title:n?e===`issues`?`Issues`:`Pull requests`:`GitHub`,scope:n?Ee[t]:void 0,scopeSlot:`gh-title-qualifier`,subtitle:a.repo?(0,X.jsxs)(`span`,{className:`block min-w-0 truncate`,children:[(0,X.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,X.jsxs)(`span`,{"data-slot":`gh-synced`,title:a.syncedAt?new Date(a.syncedAt).toLocaleString():void 0,children:[` `,`· `,a.syncedAt?(0,X.jsx)(Ye,{iso:a.syncedAt,prefix:`Synced `}):`Not synced yet`]})]}):void 0,secondaryActions:(0,X.jsx)(wt,{...o}),headerExtra:r&&i===void 0?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`mt-1 flex min-w-0 items-center gap-3 md:hidden`,children:[(0,X.jsxs)(U,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,X.jsx)(oe,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,X.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-muted-foreground`,children:[...ke,...Oe].find(e=>e.id===t)?.label})]}):void 0}}function wt({automationsAvailable:e,refreshing:t,onRefresh:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-page-actions`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[e?(0,X.jsx)(W,{variant:`outline`,asChild:!0,children:(0,X.jsx)(U,{to:`/automations/new`,children:`Set up automations`})}):null,(0,X.jsxs)(W,{type:`button`,variant:`outline`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,children:[(0,X.jsx)(N,{size:16,"aria-hidden":`true`,className:A(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Tt({view:e,number:t}){return(0,X.jsx)(K,{icon:e===`issues`?(0,X.jsx)(I,{size:16}):(0,X.jsx)(j,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Go back to the list and search for ${t} to look it up on GitHub, closed and merged included.`})}var Et=/^(\[[^\]\n]{1,24}\]:?)\s+(\S.*)$/s;function Dt(e){let t=Et.exec(e);return t?{prefix:t[1],rest:t[2]}:{prefix:null,rest:e}}function Ot(e,t){if(!t)return e.kind===`issue`?`open`:e.isDraft?`draft`:void 0}function kt(e){let t=e.reduce((e,t)=>Math.max(e,String(t.number).length),1);return Math.ceil(28+(t+1)*7.2)}var At=2;function jt({item:e,view:t,filter:n,narrows:r,colors:i,expanded:a,onToggle:o,queuedRunId:s,checks:c,comments:l,status:u,task:f,referenceWidth:p}){let h=E(),_=`gh-row-summary-${e.kind}-${e.number}`,v=e.kind===`pr`?`PR`:`Issue`,y=k(v,e.number),b=(v===`PR`&&y.conflicting===!0?d:g(u??y.status))?.label,S=Dt(e.title),C=()=>{h.prefetchQuery({queryKey:m.githubComments(e.kind,e.number),queryFn:({signal:t})=>x(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,X.jsxs)(`div`,{"data-slot":`gh-row-shell`,"data-expanded":a||void 0,style:{"--gh-ref-width":`${p}px`},className:A(`@container rounded-md`,a&&`bg-sidebar-row-selected`),children:[(0,X.jsxs)(`button`,{type:`button`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,ot(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:C,onFocus:C,onClick:o,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-expanded":a,"aria-controls":a?_:void 0,title:`Drag into the composer to prefill a task`,className:`grid w-full grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto] items-start gap-x-3 gap-y-1.5 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 @4xl:grid-cols-[var(--gh-ref-width)_minmax(0,1fr)_auto_auto]`,children:[(0,X.jsxs)(`span`,{"data-slot":`gh-row-ref`,title:b,className:`flex h-[18px] items-center`,children:[(0,X.jsx)(re,{reference:{kind:v,number:e.number},taskTitle:e.title,status:u,compact:!0,inert:!0}),b?(0,X.jsx)(`span`,{className:`sr-only`,children:b}):null]}),(0,X.jsxs)(`span`,{"data-slot":`gh-row-title`,className:A(`line-clamp-2 min-w-0 text-[13px] leading-[18px] font-medium text-foreground [overflow-wrap:anywhere] @4xl:line-clamp-none`,a&&`font-semibold`),children:[S.prefix?(0,X.jsxs)(`span`,{"data-slot":`gh-row-title-prefix`,className:`font-normal text-soft-foreground`,children:[S.prefix,` `]}):null,S.rest]}),(0,X.jsx)(se,{"data-slot":`gh-row-cue`,"aria-hidden":`true`,className:A(`col-start-3 row-start-1 mt-px size-4 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none @4xl:col-start-4`,a&&`rotate-180`)}),e.labels.length>0?(0,X.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap gap-1 @4xl:col-end-3`,children:e.labels.map(e=>(0,X.jsx)(lt,{label:e,color:i[e],className:`max-w-full truncate`},e))}):null,(0,X.jsx)(Mt,{item:e,view:t,task:f,queuedRunId:s,checks:c,comments:l})]}),a?(0,X.jsx)(Pt,{id:_,item:e,checks:c,detailPath:Ue(t,n,e.number,``,r),queuedRunId:s}):null]})}function Mt({item:e,view:t,task:n,queuedRunId:r,checks:i,comments:a}){let o=e.assignees??[];return(0,X.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`col-start-2 col-end-4 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground @4xl:col-start-3 @4xl:col-end-4 @4xl:row-start-1 @4xl:h-[18px] @4xl:flex-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`gh-row-task`,className:$.task,children:n?(0,X.jsx)(Ve,{dot:n.status.tone,shape:n.status.shape,pulse:n.status.pulse,title:`Newest task: ${n.status.label}`,className:`max-w-full py-0.5`,children:(0,X.jsx)(`span`,{className:`truncate`,children:n.status.label})}):r?(0,X.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`}):null}),(0,X.jsx)(`span`,{"data-slot":`gh-row-assignees`,className:$.assignees,children:o.length>0?(0,X.jsx)(Nt,{logins:o}):null}),t===`prs`?(0,X.jsx)(`span`,{"data-slot":`gh-row-checks-slot`,className:$.checks,children:i?(0,X.jsx)(at,{checks:i}):null}):null,(0,X.jsx)(`span`,{"data-slot":`gh-row-comments`,className:$.comments,children:a?(0,X.jsx)(st,{count:a}):null}),(0,X.jsx)(Ye,{iso:e.createdAt,className:`shrink-0 @4xl:w-9 @4xl:text-right`})]})}var $={task:`flex min-w-0 max-w-full empty:hidden @4xl:w-44 @4xl:empty:block`,assignees:`flex shrink-0 items-center empty:hidden @4xl:w-12 @4xl:justify-center @4xl:empty:block`,checks:`flex shrink-0 empty:hidden @4xl:w-4 @4xl:justify-center @4xl:empty:block`,comments:`flex shrink-0 empty:hidden @4xl:w-10 @4xl:empty:block`};function Nt({logins:e}){let t=e.join(`, `);return(0,X.jsxs)(`span`,{title:`Assigned to ${t}`,className:`flex items-center -space-x-1`,children:[e.slice(0,At).map(e=>(0,X.jsx)(tt,{login:e},e)),e.length>At?(0,X.jsxs)(`span`,{"aria-hidden":`true`,className:`pl-2 tabular-nums`,children:[`+`,e.length-At]}):null,(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Assigned to `,t]})]})}function Pt({id:e,item:t,checks:n,detailPath:r,queuedRunId:i}){let a=u(t.kind,t.number),o=(a.data?.detail?.body??t.body)?.trim(),s=t.kind===`pr`?`PR`:`issue`;return(0,X.jsxs)(`div`,{id:e,"data-slot":`gh-row-summary`,className:`flex flex-col gap-3 px-3 pb-4 @4xl:pl-[calc(var(--gh-ref-width)+1.5rem)]`,children:[(0,X.jsx)(`div`,{"data-slot":`gh-row-body`,className:`text-[13px] leading-relaxed text-soft-foreground`,children:o?(0,X.jsx)(`div`,{"data-slot":`gh-row-excerpt`,inert:!0,className:Ft,children:(0,X.jsx)(Xe,{document:!0,children:o})}):a.isPending?(0,X.jsx)(Ke,{className:`h-4 w-2/3`}):a.isError||a.data?.available===!1?(0,X.jsx)(`p`,{"data-slot":`gh-row-body-unavailable`,className:`text-muted-foreground`,children:`Description unavailable. Use Refresh to try again.`}):(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,X.jsxs)(`div`,{"data-slot":`gh-row-facts`,className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Opened by `,(0,X.jsx)(`span`,{"data-slot":`gh-row-author`,className:`font-medium`,children:t.author})]}),n?(0,X.jsx)(Ze,{checks:n,url:t.url}):null]}),(0,X.jsxs)(`div`,{"data-slot":`gh-row-actions`,className:`flex flex-wrap items-center gap-2`,children:[i?(0,X.jsx)(R,{asChild:!0,variant:`outline`,size:`sm`,children:(0,X.jsxs)(U,{to:`/tasks/${i}`,"data-action":`gh-row-view-task`,children:[(0,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsx)(R,{asChild:!0,variant:`primary`,size:`sm`,children:(0,X.jsxs)(U,{to:r,state:{focusHandoff:!0},"data-action":`gh-row-handoff`,title:`Open this ${s} and write the prompt for an agent`,children:[(0,X.jsx)(de,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}),(0,X.jsx)(R,{asChild:!0,variant:`outline`,size:`sm`,children:(0,X.jsxs)(U,{to:r,"data-action":`gh-row-open`,children:[`Open `,s,(0,X.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3.5`})]})})]})]})}var Ft=A(`max-h-[calc(3lh)] overflow-hidden [overflow-wrap:anywhere]`,`[&_*]:!my-0 [&_p+*]:!mt-1 [&_ul]:list-inside [&_ol]:list-inside`,`[&_:is(h1,h2,h3,h4,h5,h6,pre,img,table,hr,[data-streamdown="code-block"],[data-streamdown="table-wrapper"],[data-streamdown="image-wrapper"],[data-streamdown="mermaid-block"])]:hidden`);function It(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function Lt(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(It(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function Rt(e,t){let[n,r]=(0,Y.useState)(0);return(0,Y.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function zt(e,t,n){let[r,i]=(0,Y.useState)(null),a=(0,Y.useRef)(n);return(0,Y.useEffect)(()=>{a.current=n}),(0,Y.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function Bt(e,t,n,r,i){let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),l=Lt(a),u=(0,Y.useRef)(null);u.current=l;let d=Rt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:zt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function Vt({item:e,queuedRunId:t}){return t?(0,X.jsx)(R,{asChild:!0,variant:`outline`,size:`sm`,children:(0,X.jsxs)(U,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsxs)(R,{type:`button`,variant:`primary`,size:`sm`,"data-action":`gh-header-handoff`,title:`Write the prompt and pick the workflow and runner for this ${e.kind===`pr`?`PR`:`issue`}`,onClick:Ht,children:[(0,X.jsx)(de,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function Ht(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var Ut=100;function Wt(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=Ut)break;a.add(t.number)}return[...a]}function Gt(e,t,n,r,i,a){let o=Wt(n,e,r,i,a),s=f(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=h(e===`issues`?`issue`:`pr`,(0,Y.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),u=(0,Y.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>l[e.number]??(u.has(e.number)?void 0:e.comments)}}function Kt(e){let t=y(),n=_(t,!0,t==="default").data,r=(0,Y.useMemo)(()=>n?Re(n,e,t):null,[n,e,t]);return(0,Y.useCallback)(e=>{let t=e.kind===`issue`?r?.get(e.number):void 0;return t?{runId:t.id,status:Ae(t)}:null},[r])}function qt(e){let[t,n]=Te(),r=t.get(`filter`),i=je(e,r),a=i??`all`,o=e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n}),s=q(t);return{rawFilterParam:r,filter:i,activeFilter:a,setFilterParam:o,narrows:s,url:(0,Y.useMemo)(()=>{let t=new URLSearchParams(s);return{query:t.get(`q`)??``,labels:t.getAll(`label`),assignees:e===`issues`?t.getAll(`assignee`):[],board:e===`issues`?t.get(`board`)??``:``}},[s,e]),writeNarrows:(0,Y.useCallback)(e=>n(t=>{let n=e(t);return(t.has(`filter`)||q(t)!==``)&&!n.has(`filter`)&&q(n)===``&&n.set(`filter`,`all`),n}),[n])}}function Jt(e,t){return n=>{let r=new URLSearchParams(n);r.delete(e);for(let n of t)r.append(e,n);return r}}function Yt(e,t,{rawFilterParam:n,filter:r,activeFilter:i,setFilterParam:a,narrows:o,url:s,writeNarrows:c}){let l=Zt(s.query,n!==null||o!==``,c),{query:u,setQuery:d}=l,f=s.labels,p=s.assignees,m=e=>c(Jt(`label`,e)),{setProjectFilter:h,activeProject:g}=Qt(t,s.board,c),_=e===`issues`&&i===`assigned`,v=_?t?.viewerLogin?[t.viewerLogin]:[]:p;return{query:u,setQuery:d,labelFilter:f,setLabelFilter:m,setProjectFilter:h,activeProject:g,isAssignedFilter:_,effectiveAssignees:v,changeAssignees:e=>{c(Jt(`assignee`,e)),_&&a(`all`)},clearFilters:()=>{l.clear(),c(e=>{let t=new URLSearchParams(e);for(let e of Be)t.delete(e);return r!==null&&r!==`all`&&t.set(`filter`,`all`),t})},filtering:u.trim()!==``||f.length>0||e===`issues`&&(v.length>0||g!==``)||r!==null&&r!==`all`,narrowing:u.trim()!==``||f.length>0||e===`issues`&&(!_&&p.length>0||g!==``)}}var Xt=250;function Zt(e,t,n){let r=`${te().pathname}${t?``:`#entry`}`,[i,a]=(0,Y.useState)(e),o=(0,Y.useRef)(e),s=(0,Y.useRef)(void 0),c=(0,Y.useRef)(r);return(0,Y.useEffect)(()=>{e===o.current&&r===c.current||(clearTimeout(s.current),c.current=r,o.current=e,a(e))},[e,r]),(0,Y.useEffect)(()=>()=>clearTimeout(s.current),[]),{query:i,setQuery:e=>{a(e),clearTimeout(s.current),s.current=setTimeout(()=>{let t=e.trim();o.current=t,n(e=>{let n=new URLSearchParams(e);return t===``?n.delete(`q`):n.set(`q`,t),n})},Xt)},clear:()=>{clearTimeout(s.current),o.current=``,a(``)}}}function Qt(e,t,n){let r=e=>n(t=>{let n=new URLSearchParams(t);return e===``?n.delete(`board`):n.set(`board`,e),n}),i=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,a=i||e?.projects?.some(e=>e.id===t)===!0,o=e?.available===!0&&!i&&t!==``&&!a,[s,c]=(0,Y.useState)(``);s!==``&&s!==t&&c(``),o&&s!==t&&c(t);let l=o||s!==``&&s===t,u=a&&!l?t:``;return(0,Y.useEffect)(()=>{l&&n(e=>{let t=new URLSearchParams(e);return t.delete(`board`),t})},[l,n]),{setProjectFilter:r,activeProject:u}}function $t(e,t,{filter:n,activeFilter:r},i){let a=y(),o=e===`issues`&&(r===`no-task`||r===`has-task`),s=_(a,o,a==="default"),l=(0,Y.useMemo)(()=>s.data?Fe(s.data,t?.repo,a):null,[s.data,t?.repo,a]),u=He(e,n)?Pe(n):null,d=c(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,Y.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,Y.useMemo)(()=>f?Me(f,p):null,[f,p]),h=en({view:e,gh:t,activeFilter:r,isAssignedFilter:i,taskFilter:o,taskNumbers:l,runsQuery:s,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,Y.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,Y.useMemo)(()=>e===`issues`?r===`no-task`&&l?{excludeNumbers:l}:r===`has-task`&&l?{includeNumbers:l}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,r,l,t?.viewerLogin,f])}}function en({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?l.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${l.data.reason??`unknown reason`}.`}:l.isError?{kind:`blocked`,message:`GitHub could not be searched: ${l.error instanceof Error?l.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null}function tn(e,t){return t?w(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function nn(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=m.github()[0],s=t===void 0?null:Number.parseInt(t,10),c=!r&&n.data?.available?n.data.items.find(e=>e.number===s):void 0,l=i&&s!==null&&!a.some(e=>e.number===s)?i.find(e=>e.number===s):void 0,u=c??l,[d,f]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{u&&f({scope:o,view:e,item:u})},[o,e,u]),{selectedNumber:s,remoteDetail:u??(d?.scope===o&&d.view===e&&d.item.number===s?d.item:null)}}function rn(e,t,n,{fullList:r,filterRows:i},a){let o=E(),c=(0,Y.useRef)(null),l=e===`issues`?`issue`:`pr`,u=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,d=s(l,n??0,u),f=u&&d.data?.available&&d.data.item?.kind===l?d.data.item:null;c.current=u&&n!==null?{kind:l,number:n,key:m.githubItem(l,n)}:null;let[p,h]=(0,Y.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:f,exactTargetRef:c,retryingExact:p,retryExact:()=>{h(!0),tn(o,c.current).then(e=>{h(!1),e||T(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function an(e,t,n){let r=E(),i=(0,Y.useRef)(null);return{refresh:v({mutationFn:e=>(tn(r,e),b({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:m.githubPages(50),exact:!0}),r.setQueryData(m.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:m.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),c=m.githubCommentCounts(o,s);r.removeQueries({queryKey:m.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==O(c)}),a.available&&a.commentsDeferred&&s.length>0&&D(o,s,{refresh:!0}).then(e=>r.setQueryData(c,e)).catch(()=>{}),r.invalidateQueries({queryKey:m.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:m.githubSearch(`pr`,Le)}),r.invalidateQueries({queryKey:m.githubSearch(`pr`,qe)});let l=i.current,u=m.githubComments(`issue`,0).slice(0,3);if(!l){r.removeQueries({queryKey:u});return}let d=m.githubComments(l.kind,l.number);x(l.kind,l.number,{refresh:!0}).then(e=>r.setQueryData(d,e)).catch(()=>{}),r.removeQueries({queryKey:u,predicate:e=>e.queryHash!==O(d)})},onError:e=>T(e.message,{tone:`danger`})}),openThreadRef:i}}var on=350;function sn(e,t){let[n,r]=(0,Y.useState)(e);return(0,Y.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function cn(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:l}){let u=sn(n,on),d=(0,Y.useMemo)(()=>J(o,{query:u,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,u,r,e,i,a,s]),f=n.trim()===u.trim(),p=t?.available===!0&&!l&&f&&et(u,d),m=c(e===`issues`?`issue`:`pr`,u,p),h=J(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),g=p&&m.data?.available?m.data:null,_=new Set(h.map(e=>e.number)),v=ln(e,g,a,i);return{debouncedQuery:u,searchWanted:p,forgeSearch:m,items:h,searchPayload:g,metadataFailure:v,searchHits:g&&!v?J(g.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!_.has(e.number)):[],...un(n,f,p,m)}}function ln(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function un(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function dn({view:e,changes:t=!1,index:n=!1}){let{n:r}=ee(),i=qt(e),{rawFilterParam:o,activeFilter:s,narrows:c}=i,l=o!==null||c!==``,u=ye(),{pages:d,data:f}=p(50),m=Ne(),h=pn(),g=ct(),_=fn({index:n,isDesktop:u,listInUrl:l,n:r,rememberedView:a().data?.githubView}),[v,y]=(0,Y.useState)(null),b=Yt(e,f,i),x=$t(e,f,i,b.isAssignedFilter),S=cn(e,f,b,x),C=nn(e,r,S.forgeSearch,x),w=rn(e,f,C.selectedNumber,x,C.remoteDetail),T=Gt(e,d,f,C.selectedNumber,S.searchHits,x.openItems),{refresh:E,openThreadRef:D}=an(e,T.checkPrNumbers,S.debouncedQuery),O=Bt(e,d,f,x.backedQuery,b.narrowing),te=Kt(f?.available?f.repo:void 0);if(_.restorePrs)return(0,X.jsx)(ge,{to:`/github/prs`,replace:!0});if(!f)return d.isError?(0,X.jsx)(G,{route:`github`,density:`empty`,children:(0,X.jsx)(K,{icon:(0,X.jsx)(P,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:d.error.message})}):(0,X.jsx)(Ge,{});D.current=null;let k=()=>E.mutate(w.exactTargetRef.current);if(_.filterScreen&&f.available)return(0,X.jsx)(St,{onRefresh:k,refreshing:E.isPending});if(!f.available)return(0,X.jsx)(vn,{reason:f.reason,refreshing:E.isPending,onRetry:k});let{labelColors:ne,labelOptions:re}=mn(f,S.searchPayload,x.openItems,x.fullList),A=hn({number:C.selectedNumber,fullList:x.fullList,filterRows:x.filterRows,remoteDetail:C.remoteDetail,exactDetail:w.exactDetail}),j=r===void 0?[...S.items,...S.searchHits].find(e=>e.url===v)??null:null,M=A??j;D.current=M?{kind:M.kind,number:M.number}:null;let{linkFilter:ie,listPath:N}=gn(e,o,s,u,c),ae={view:e,filter:ie,narrows:c,colors:ne,expandedUrl:j?.url??null,onToggle:e=>y(t=>t===e.url?null:e.url),queued:g.queued,checksMap:T.checksMap,commentsOf:T.commentsOf,taskOf:te,referenceWidth:kt([...S.items,...S.searchHits])},F=_n(e,b,x.filterGate,S),I=Ct({view:e,activeFilter:s,isDesktop:u,listInUrl:l,n:r,gh:f,actions:{automationsAvailable:m,refreshing:E.isPending,onRefresh:k}});return r===void 0?(0,X.jsxs)(G,{route:`github`,density:ve(S.items.length+S.searchHits.length),headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,bodyClassName:`gap-2.5`,header:I,children:[(0,X.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-4`,children:[(0,X.jsx)(yn,{view:e,isDesktop:u,gh:f,onSaveView:h}),(0,X.jsx)(bn,{view:e,gh:f,filters:b,labelOptions:re,labelColors:ne,searchPayload:S.searchPayload})]}),(0,X.jsx)(Cn,{view:e,rows:ae,verdict:F,search:S,sidebar:x,list:d,paging:O})]}):(0,X.jsx)(G,{route:`github`,density:`full`,headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,header:I,children:(0,X.jsx)(On,{view:e,selected:A,selectedNumber:C.selectedNumber,exact:w,repo:f.repo,rows:ae,listPath:N,changes:t,handToAgent:g})})}function fn({index:e,isDesktop:t,listInUrl:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&!n&&r===void 0,restorePrs:e&&t&&!n&&i===`prs`}}function pn(){let e=E();return t=>{e.setQueryData(m.uiState,e=>({...e,githubView:t})),S({githubView:t}).then(t=>e.setQueryData(m.uiState,t)).catch(t=>{T(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:m.uiState})})}}function mn(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:$e([...n,...r,...t?.items??[]])}}function hn({number:e,fullList:t,filterRows:n,remoteDetail:r,exactDetail:i}){return e===null?null:t.find(t=>t.number===e)??n?.find(t=>t.number===e)??r??i??null}function gn(e,t,n,r,i){let a=t===null?null:n;return{linkFilter:a,listPath:Ue(e,a??(e===`issues`&&!r?`all`:null),void 0,``,i)}}function _n(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,X.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,X.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,X.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,X.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,X.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,X.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,X.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,X.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,X.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,`.`]})}function vn({reason:e,refreshing:t,onRetry:n}){return(0,X.jsx)(G,{route:`github`,density:`empty`,children:(0,X.jsx)(K,{icon:(0,X.jsx)(M,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,X.jsx)(R,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:n,children:`Try again`}),children:(0,X.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`The tab needs the `,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in Squawk works without it.`]})})})}function yn({view:e,isDesktop:t,gh:n,onSaveView:r}){return(0,X.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,X.jsxs)(ut,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,X.jsxs)(ut,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function bn({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,X.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,X.jsx)(ie,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 w-full rounded-lg border border-card-edge bg-card shadow-card py-1 pr-2.5 pl-8 text-[13px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,X.jsx)(jn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,X.jsx)(xt,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,X.jsx)(`button`,{type:`button`,disabled:!n.filtering,"data-slot":`gh-clear-filters`,className:`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:border-border disabled:bg-transparent disabled:text-muted-foreground`,onClick:n.clearFilters,children:`Clear filters`})]})}function xn(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Sn(e,t,n=!1){return(0,X.jsx)(jt,{item:e,view:t.view,filter:t.filter,narrows:t.narrows,colors:t.colors,expanded:t.expandedUrl===e.url,onToggle:()=>t.onToggle(e),queuedRunId:t.queued.get(e.url)??null,checks:xn(e,t.checksMap),comments:t.commentsOf(e),status:Ot(e,n),task:t.taskOf(e),referenceWidth:t.referenceWidth})}function Cn({view:e,rows:t,verdict:n,search:r,sidebar:i,list:a,paging:o}){let{items:s,searchHits:c}=r;return(0,X.jsxs)(`section`,{ref:o.setListEl,"data-slot":`gh-list`,className:`relative flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card p-3`,children:[s.length===0?n&&(0,X.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):(0,X.jsx)(wn,{items:s,rows:t,paging:o}),o.pagingAvailable?(0,X.jsx)(Tn,{view:e,list:a,paging:o}):null,(0,X.jsx)(En,{backedQuery:i.backedQuery,filterSearch:i.filterSearch}),s.length>0&&r.searchWanted&&n?(0,X.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-muted-foreground`,children:n}):null,c.length>0?(0,X.jsx)(Dn,{hits:c,searchPayload:r.searchPayload,rows:t}):null]})}function wn({items:e,rows:t,paging:n}){let{setRowsEl:r,scrollOwner:i,listEl:a,scrollOwnerRef:o,startMargin:s}=n,c=(0,Y.useRef)(null),l=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{if(l.current||!i)return;l.current=!0;let n=e.findIndex(e=>e.url===t.expandedUrl);n>=0&&c.current?.scrollToIndex(n,{align:`start`})},[i,e,t.expandedUrl]);let u=e.map((e,n)=>(0,X.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":n>0||void 0,children:Sn(e,t)},e.url));return(0,X.jsx)(`div`,{ref:r,"data-slot":`gh-rows`,"data-virtualized":i?`true`:void 0,role:`list`,children:i?(0,X.jsx)(We,{ref:c,scrollRef:o,startMargin:s,children:u},i===a?`list`:`main`):u})}function Tn({view:e,list:t,paging:n}){return(0,X.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-muted-foreground`,children:t.isFetchingNextPage?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,X.jsxs)(X.Fragment,{children:[`Could not load more.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,X.jsxs)(X.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function En({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-muted-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function Dn({hits:e,searchPayload:t,rows:n}){let r=(0,Y.useRef)(null),i=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{i.current||(i.current=!0,(r.current?.querySelector(`[data-slot="gh-row"][aria-expanded="true"]`))?.scrollIntoView({block:`start`}))},[]);let a=l();return(0,X.jsx)(ne,{projectId:a,requests:a?e.map(e=>({projectId:a,kind:e.kind===`pr`?`PR`:`Issue`,number:e.number})):[],children:(0,X.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,X.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,X.jsx)(`ul`,{ref:r,className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,X.jsx)(`li`,{children:Sn(e,n,!0)},e.url))})]})})}function On({view:e,selected:t,selectedNumber:n,exact:r,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}){let{exactWanted:l,exactItem:u}=r;return(0,X.jsxs)(`section`,{"data-slot":`gh-detail`,className:`flex w-full min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card`,children:[t?null:(0,X.jsx)(`div`,{className:`px-4 pt-4 md:px-7 md:pt-5`,children:(0,X.jsx)(Qe,{backLink:{to:o}})}),t?(0,X.jsx)(kn,{item:t,repo:i,rows:a,listPath:o,changes:s,handToAgent:c}):l&&u.isPending?(0,X.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex flex-1 flex-col`,children:(0,X.jsx)(K,{icon:(0,X.jsx)(L,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${n}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):l&&(u.isError||u.data?.available===!1)?(0,X.jsx)(An,{number:n,exact:r}):(0,X.jsx)(Tt,{view:e,number:n})]})}function kn({item:e,repo:t,rows:n,listPath:r,changes:i,handToAgent:a}){let{workflows:o,skillList:s,workflow:c,setWorkflow:l,selectedSkills:u,setSelectedSkills:d,engine:f,setEngine:p,queued:m,onQueued:h}=a,g=te().state?.focusHandoff===!0;return(0,Y.useEffect)(()=>{g&&Ht()},[g,e.url]),(0,X.jsx)(nt,{item:e,comments:n.commentsOf(e),afterHeading:e.kind===`issue`?(0,X.jsx)(dt,{number:e.number,repo:t},e.url):void 0,backLink:{to:r},subNav:{filter:n.filter,narrows:n.narrows,changes:i},onRunAgent:Ht,headerAction:(0,X.jsx)(Vt,{item:e,queuedRunId:m.get(e.url)??null}),colors:n.colors,checks:xn(e,n.checksMap),children:(0,X.jsx)(it,{item:e,workflows:o.data?.workflows??[],skills:s,workflow:c,onWorkflowChange:l,selectedSkills:u,onSkillsChange:d,engine:f,onEngineChange:p,queuedRunId:m.get(e.url)??null,onQueued:h},e.url)})}function An({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,X.jsx)(K,{icon:(0,X.jsx)(P,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,X.jsx)(R,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function jn({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,Y.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,X.jsxs)(H,{open:i,onOpenChange:a,children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:A(`inline-flex min-h-11 min-w-11 shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,X.jsx)(se,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(V,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(we,{children:[(0,X.jsx)(be,{placeholder:`Filter labels…`}),(0,X.jsxs)(Ce,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,X.jsx)(Se,{children:`No labels.`}),n.length>0?(0,X.jsxs)(xe,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,X.jsxs)(xe,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`gh-label-dot`,className:`size-2.5 shrink-0 rounded-full ring-1 ring-foreground/30`,style:rt(t[e])}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{dn as GithubRoute};
|
package/web/dist/assets/{global-activity-route-Bv9FvhbW.js → global-activity-route-BQz9m_XA.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{B as r,U as i}from"./queries-Byfl3YoC.js";import{n as a,p as o}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as s}from"./dist-CCX8mhHc.js";import{A as c,C as l,D as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,R as ee,S as v,T as y,_ as b,a as x,b as S,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as se,k as ce,l as le,m as ue,n as de,o as fe,p as pe,r as me,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"./activity-motion-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{B as r,U as i}from"./queries-Byfl3YoC.js";import{n as a,p as o}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as s}from"./dist-CCX8mhHc.js";import{A as c,C as l,D as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,R as ee,S as v,T as y,_ as b,a as x,b as S,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as se,k as ce,l as le,m as ue,n as de,o as fe,p as pe,r as me,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"./activity-motion-CHyZRjxl.js";import{t as A}from"./button-BV_AiLj2.js";import{a as j,f as M,n as N,t as P}from"./page-shell-BdjH5hyc.js";import{i as F}from"./project-order-AcHI4Dcl.js";import{En as I}from"./index-D0RESQCN.js";var L=e(t(),1),R=(e,t)=>({x0:Math.min(e.x,t.x),y0:Math.min(e.y,t.y),x1:Math.max(e.x,t.x),y1:Math.max(e.y,t.y)});function z(e,t,n=1){return t.some(t=>t.x+n<e.x1&&e.x0<t.x+t.w-n&&t.y+n<e.y1&&e.y0<t.y+t.h-n)}var he=(e,...t)=>e.filter(e=>!t.some(t=>ge(e,t))),ge=(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h,B=e=>Math.round(e*10)/10,V=e=>`${B(e.x)} ${B(e.y)}`;function _e(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&e.x===n.x&&e.y===n.y)continue;let r=t[t.length-2];r&&e&&(r.x===e.x&&e.x===n.x||r.y===e.y&&e.y===n.y)&&t.pop(),t.push(n)}return t}function ve(e,t=8){let n=_e(e),r=n[0];if(!r)return``;let i=`M${V(r)}`;for(let e=1;e<n.length;e++){let r=n[e],a=n[e-1],o=n[e+1];if(!o){i+=` L ${V(r)}`;continue}let s=Math.min(t,Math.hypot(r.x-a.x,r.y-a.y)/2,Math.hypot(o.x-r.x,o.y-r.y)/2),c=(e,t,n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y)||1;return{x:e.x+(t.x-e.x)/r*n,y:e.y+(t.y-e.y)/r*n}};i+=` L ${V(c(r,a,s))} Q ${V(r)}, ${V(c(r,o,s))}`}return i}function H(e,t,n){let r=[];for(let i of[...e].sort((e,n)=>t(e)-t(n))){let e=r[r.length-1];e&&Math.abs(t(i)-e.from)<=2?e.to=Math.max(e.to,n(i)):r.push({from:t(i),to:n(i)})}return r}function ye(e){return{rows:H(e,e=>e.y,e=>e.y+e.h).map(({from:e,to:t})=>({top:e,bottom:t})),cols:H(e,e=>e.x,e=>e.x+e.w).map(({from:e,to:t})=>({left:e,right:t}))}}var U=(e,t,n)=>Math.max(0,e.findIndex(e=>Math.abs(t(e)-n)<=2)),W=(e,t)=>((e.rows[t]?.bottom??0)+(e.rows[t+1]?.top??(e.rows[t]?.bottom??0)+16))/2;function be(e,t,n){let r=e.cols,i=e=>((r[e]?.right??0)+(r[e+1]?.left??0))/2;return t<n?i(t):t>n?i(t-1):t+1<r.length?i(t):t>0?i(t-1):(r[t]?.right??0)+8}function xe(e,t,n,r=0){let i=ye(n),a=U(i.rows,e=>e.top,e.y),o=U(i.rows,e=>e.top,t.y),s=o>a,c=e.x+e.w/2+r,l=t.x+t.w/2+r,u=(s?W(i,a):W(i,a-1))+r/2,d=(s?W(i,o-1):W(i,o))+r/2,f=be(i,U(i.cols,e=>e.left,e.x),U(i.cols,e=>e.left,t.x))+r/2,p={x:c,y:s?e.y+e.h+1:e.y-1},m={x:l,y:s?t.y-3:t.y+t.h+3};return{points:[p,{x:c,y:u},{x:f,y:u},{x:f,y:d},{x:l,y:d},m],label:{x:(c+f)/2,y:u}}}function Se(e){let t=new Map;for(let n of e){let e=[n.senderRunId,n.recipientRunId].sort().join(`
|
|
2
2
|
`);t.set(e,[...t.get(e)??[],n.requestId])}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,(r-(e.length-1)/2)*12));return n}function Ce(e,t,n,r=4){let i=[],a=new Map;for(let{id:o,at:s}of e){let e={...s};for(let a=0;a<=i.length;a++){let a=i.find(n=>Math.abs(e.x-n.x)<t.w+r&&Math.abs(e.y-n.y)<t.h+r);if(!a)break;n===`x`?e.x=a.x+t.w+r:e.y=a.y+t.h+r}i.push(e),a.set(o,e)}return a}var G=e=>Math.round(e*10)/10,K=e=>`${G(e.x)} ${G(e.y)}`;function we(e,t,n=[],r=0){let i=e.x+e.w/2+r,a=t.x+t.w/2+r;if(t.y>=e.y+e.h||t.y+t.h<=e.y){let o=t.y>e.y,s=o?e.y+e.h+1:e.y-1,c=o?t.y-3:t.y+t.h+3,l=(c-s)/2;if(z(R({x:i,y:s},{x:a,y:c}),he(n,e,t))){let i=xe(e,t,n,r);return{d:ve(i.points),label:i.label}}return{d:`M${K({x:i,y:s})} C ${K({x:i,y:s+l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:c})}`,label:{x:(i+a)/2,y:(s+c)/2}}}let o=e.y-1,s=t.y-1,c=Math.min(o,s),l=Math.max(8,Math.min(30,18+Math.abs(a-i)*.05)+r);return{d:`M${K({x:i,y:o})} C ${K({x:i,y:c-l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:s-3})}`,label:{x:(i+a)/2,y:c-l*.75}}}function Te(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}}function Ee(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function De(e){let t=[],n=[];for(let r of e)v(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function Oe(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function ke(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function Ae(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>m(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function je(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=n(),Me={w:104,h:20};function Ne(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,Te(r.getBoundingClientRect(),t))}return n}function Pe(e,t,n=[]){let r=Ne(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...re(e),kind:`wait`}))],o=Se(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...we(t,n,i,o.get(e.requestId))})}let c=Ce(s.map(e=>({id:e.id,at:e.label})),Me,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function Fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-xs whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function Ie({arc:e,wait:t,now:n,motion:r}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:s(J,`border-dashed border-message-peer-accent`,t.id in r.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,_(f(t.since,n))]})}function Le({arc:e,request:t,now:n,motion:r}){let i=te(r,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:s(J,i?`border-success`:`border-message-peer-accent`,C(r,e.id)===`fade`&&`activity-line-out`),children:[i?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,_(f(t.createdAt,n))]})}var Re=[],ze=new Set;function Be({arcs:e,waits:t=Re,active:n=ze,layoutKey:r,now:i,motion:a=b,paused:o=!1}){let c=L.useRef(null),l=T(c,L.useCallback(n=>Pe(n,e,t),[e,t]),Fe,`[data-activity-pill]`,r),u=L.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=ne(a.comets,u,o),f=new Map(e.map(e=>[e.requestId,e])),p=new Map(t.map(e=>[e.id,e])),m=L.useId().replace(/[^a-zA-Z0-9_-]/g,``),h=`activity-arrow-arc-${m}`,g=`activity-ring-arc-${m}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:h,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(x,{id:g})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${g})`,className:s(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,le(a,e.id))},e.id)}let t=C(a,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${h})`,className:s(`stroke-message-peer-accent`,fe(t,e.id in a.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?p.get(e.id):void 0;if(t)return(0,q.jsx)(Ie,{arc:e,wait:t,now:i,motion:a},e.id);let n=f.get(e.id);return n?(0,q.jsx)(Le,{arc:e,request:n,now:i,motion:a},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,Ve=[],He=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function Ue({task:e}){let t=e.workers.filter(e=>m(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(c,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function We({projectId:e,task:t,requests:n,waits:r=Ve,index:i,ctx:o,motion:l=b,linked:u=!1,onHover:g}){let _=h(t,o);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":_.action,"data-linked":u?`true`:void 0,...ae(t.runId,g),className:s(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,_.action?_.tone===`info`?`border-info/70`:`border-pending/70`:t.rung===`running`&&m(t.status)?`border-status-running/60`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in l.entering&&`activity-card-enter`),children:[(0,q.jsx)(pe,{task:t,motion:l,glow:_.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(c,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(a,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(ce,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-[3px] ml-[19px] flex items-center gap-2`,children:[(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums`,children:[(0,q.jsx)(se,{"data-slot":`activity-verb`,tone:_.tone,className:`font-semibold`,children:_.verb}),_.action&&_.since?(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsx)(`span`,{"data-slot":`activity-pill-age`,title:d(_.since),children:p(f(_.since,o.now))})]}):null,` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:s(_.mono&&`font-mono text-xs`),children:_.main})]}),_.action?(0,q.jsx)(A,{asChild:!0,size:`sm`,variant:_.action===`answer`?`primary`:`outline`,className:`relative z-[1] px-2 text-[12px]`,children:(0,q.jsx)(a,{"data-slot":`activity-pill-action`,to:Y(e,t.runId),children:_.action===`answer`?`Answer`:`Open task`})}):null]}),(0,q.jsx)(ue,{texts:k(t.runId,n,i,r)}),(0,q.jsx)(Ue,{task:t}),(0,q.jsx)(ie,{runId:t.runId,requests:n,waits:r,index:i,link:a,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:He})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Ge=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-card-edge bg-card shadow-card px-4 pt-3.5 pb-4`,Q=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function $({project:e,headingId:t,detail:n,to:r,label:i}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,q.jsx)(a,{to:r,className:Q,children:i})]})}function Ke({project:e,notice:t}){let n=L.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)($,{project:e,headingId:n,detail:t,to:Ge(e.projectId),label:`Open project →`})})}function qe(e,t){return L.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return Oe({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Je({project:e,now:t,motion:n=b,paused:r=!1}){let i=L.useId(),a=L.useMemo(()=>l(e),[e]),o=qe(e,n),c=L.useMemo(()=>O(e.tasks),[e.tasks]),u=L.useMemo(()=>ke(e.tasks,[...c,...E(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=oe(c),f={now:t,titleOf:e=>S(a,e)},p=`${e.tasks.map(e=>e.runId).join(`,`)}:${o.map(e=>e.requestId).join(`,`)}:${u.map(e=>e.id).join(`,`)}`,m=o.length>0||u.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":i,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)($,{project:e,headingId:i,detail:Ae(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:s(`relative mt-3`,m&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:s(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,300px),1fr))] items-start gap-3.5`,m&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(We,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:a,ctx:f,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),m?(0,q.jsx)(Be,{arcs:o,waits:u,active:d.active,layoutKey:p,now:t,motion:n,paused:r}):null]})]})}function Ye(e){let t=v(e.project);return t===void 0?(0,q.jsx)(Je,{...e}):(0,q.jsx)(Ke,{project:e.project,notice:t})}function Xe({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[je(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(L.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(a,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Ze={kind:`workspace`};function Qe(){let e=i().data?.projects,{order:t}=I();return L.useMemo(()=>e?F(e,t).map(e=>e.id):void 0,[e,t])}function $e(){let e=i().data,t=r(),n=o().state?.activityProjectId,a=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:a;return{id:s,name:e?.projects.find(e=>e.id===s)?.name,projects:e?.projects}}function et(){let e=ee(Ze),t=$e(),n=Qe(),[r,i]=L.useState(!1),o=w(e.data?.generatedAt,e.dataUpdatedAt),s=e.data?.projects,c=L.useMemo(()=>Ee(s??[],n),[s,n]),l=L.useMemo(()=>De(c),[c]),d=L.useMemo(()=>l.panels.filter(e=>v(e)===void 0),[l.panels]),f=L.useMemo(()=>l.panels.filter(e=>v(e)!==void 0),[l.panels]),p=L.useMemo(()=>c.map(e=>e.projectId),[c]),{motion:m,feed:h,paused:_,reduced:b}=de(e.data,`workspace`),x=d.reduce((e,t)=>e+t.tasks.length,0);return(0,q.jsxs)(j,{route:`activity-global`,density:s?M(x+f.length):`full`,headerSpacing:`compact`,rootProps:{"data-activity-paused":_?`true`:void 0},bodyClassName:`gap-3.5`,header:g({name:`All projects`,now:e.data?o:void 0,updatedAt:e.data?.generatedAt,stale:e.isError,scopeSwitch:(0,q.jsx)(y,{scope:`all`,projects:t.projects,projectId:t.id,projectName:t.name,grouped:r,onToggleGroup:()=>i(e=>!e)})}),sparseFooter:s&&l.panels.length>0?(0,q.jsx)(N,{summary:`${d.length} active ${d.length===1?`project`:`projects`} with live work.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(a,{to:`/tasks`,children:`View all tasks`})})}):void 0,children:[s?(0,q.jsx)(u,{summary:D(s),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!s?(0,q.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-xl border border-border bg-card p-5 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(A,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),children:`Retry`})]}):null,s&&l.panels.length===0&&l.idle.length===0?(0,q.jsx)(P,{slot:`activity-empty`,title:`No projects to show.`,description:`Register a project in Workspace tools to monitor live agent work across repositories.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(a,{to:`/tools`,children:`Open workspace tools`})})}):null,d.length>0||h.length>0?(0,q.jsx)(me,{projects:d,now:o,global:!0,grouped:r,projectOrder:p,motion:m,feed:h,still:b,paused:_}):null,f.length>0?(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3`,children:f.map(e=>(0,q.jsx)(Ye,{project:e,now:o,motion:m,paused:_||b},e.projectId))}):null,(0,q.jsx)(Xe,{projects:l.idle,belowPanels:l.panels.length>0})]})}export{et as GlobalActivityRoute};
|