@qodeca/xezar 0.11.1 → 0.11.2
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/README.md +21 -0
- package/dist/core/provider-auth.js +23 -1
- package/dist/core/provider-auth.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{compare-variants-C68kZAYC.js → compare-variants-et0mplGi.js} +1 -1
- package/web/dist/assets/{git-toolbar-CuwdZGjY.js → git-toolbar-Q2kk2F7v.js} +1 -1
- package/web/dist/assets/{github-BjeW9iJb.js → github-DjEYCxwt.js} +1 -1
- package/web/dist/assets/{index-Yp8woQLH.js → index-Cz4GSAqV.js} +3 -3
- package/web/dist/assets/{repo-git-C_w_dYCj.js → repo-git-h1RFfly3.js} +1 -1
- package/web/dist/assets/{skills-DoXLGvuf.js → skills-BqAzyGS3.js} +1 -1
- package/web/dist/assets/{task-changes-DZUO7q_X.js → task-changes-DwXPFXqG.js} +1 -1
- package/web/dist/assets/{task-commits-CRlMB09k.js → task-commits-Bessua-c.js} +1 -1
- package/web/dist/assets/{task-files-CeDPRo86.js → task-files-DxFIhRPP.js} +1 -1
- package/web/dist/assets/{use-desktop-C-tsTFEF.js → use-desktop-Sr1QlxhT.js} +1 -1
- package/web/dist/assets/{workflows-kxdOo5D_.js → workflows-9HC240Wx.js} +1 -1
- package/web/dist/index.html +1 -1
package/README.md
CHANGED
|
@@ -602,6 +602,27 @@ host-local catalog yet, always shows its built-in entries. `auto` — send no
|
|
|
602
602
|
model at all and let the CLI decide — is always available, and a model you
|
|
603
603
|
pinned by hand stays selectable even when it is no longer advertised.
|
|
604
604
|
|
|
605
|
+
**OpenCode connection checks include native model configuration.** A LAN/local
|
|
606
|
+
provider can be configured without stored login credentials. When
|
|
607
|
+
`opencode auth list` reports no stored or environment credentials, xezar also
|
|
608
|
+
runs `opencode models`:
|
|
609
|
+
|
|
610
|
+
- A successful listing with a recognized `provider/model` marks OpenCode as
|
|
611
|
+
configured. Connect recognizes that state without opening a login terminal.
|
|
612
|
+
The Providers card says **Configured**, rather than **Credentials found**.
|
|
613
|
+
- A successful empty listing leaves OpenCode **Not connected**. Connect opens
|
|
614
|
+
`opencode auth login` to configure credentials.
|
|
615
|
+
- A failed, unrecognized or timed-out listing reports **Could not verify**,
|
|
616
|
+
rather than assuming login is needed. Each CLI probe has a ten-second timeout.
|
|
617
|
+
|
|
618
|
+
If OpenCode works directly but xezar asks you to connect, compare
|
|
619
|
+
`opencode auth list` and `opencode models` from the same project directory and
|
|
620
|
+
environment used by xezar. Zero credentials alone does not mean a local provider
|
|
621
|
+
needs login. A model listing establishes configuration, not endpoint health or
|
|
622
|
+
successful inference; an authentication rejection from an actual task still
|
|
623
|
+
overrides the probe result and requires attention. Xezar does not add credentials
|
|
624
|
+
or change OpenCode's provider configuration during these checks.
|
|
625
|
+
|
|
605
626
|
**Pick a backend at three levels** (most specific wins):
|
|
606
627
|
|
|
607
628
|
1. **Config default** — `"defaultRunner": "codex"` in `.xezar/config.json`.
|
|
@@ -2,6 +2,7 @@ import { execFile } from 'node:child_process';
|
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { AGENT_MODELS_LOCKED_ENV } from './agent-model-policy.js';
|
|
4
4
|
import { profileEnv } from './agent-profiles.js';
|
|
5
|
+
import { parseOpencodeModels } from './opencode-model-catalog.js';
|
|
5
6
|
import { withEnvPrefix } from './shell-env.js';
|
|
6
7
|
export const PROVIDER_IDS = ['claude', 'codex', 'opencode', 'pi'];
|
|
7
8
|
/**
|
|
@@ -500,7 +501,28 @@ export class ProviderAuthService {
|
|
|
500
501
|
if (result.errorCode) {
|
|
501
502
|
return { provider: descriptor.id, status: 'unknown', hint: UNKNOWN_HINT };
|
|
502
503
|
}
|
|
503
|
-
|
|
504
|
+
let status = descriptor.parse(result);
|
|
505
|
+
// A LAN/custom provider can be configured entirely in OpenCode's native config,
|
|
506
|
+
// with no auth.json entry or environment credential. Ask its model catalog before
|
|
507
|
+
// sending that user into login. This is configuration evidence, not an inference
|
|
508
|
+
// health check; authoritative runtime auth failures still override this probe.
|
|
509
|
+
if (descriptor.id === 'opencode' && status === 'disconnected') {
|
|
510
|
+
try {
|
|
511
|
+
const models = await (env === undefined
|
|
512
|
+
? this.runCommand(descriptor.executable(), ['models'], COMMAND_TIMEOUT_MS)
|
|
513
|
+
: this.runCommand(descriptor.executable(), ['models'], COMMAND_TIMEOUT_MS, env));
|
|
514
|
+
if (models.timedOut) {
|
|
515
|
+
return { provider: descriptor.id, status: 'unknown', hint: TIMEOUT_HINT };
|
|
516
|
+
}
|
|
517
|
+
if (models.errorCode || models.exitCode !== 0) {
|
|
518
|
+
return { provider: descriptor.id, status: 'unknown', hint: UNKNOWN_HINT };
|
|
519
|
+
}
|
|
520
|
+
status = parseOpencodeModels(models.stdout).length > 0 ? 'connected' : 'disconnected';
|
|
521
|
+
}
|
|
522
|
+
catch {
|
|
523
|
+
return { provider: descriptor.id, status: 'unknown', hint: UNKNOWN_HINT };
|
|
524
|
+
}
|
|
525
|
+
}
|
|
504
526
|
if (status !== null)
|
|
505
527
|
return { provider: descriptor.id, status };
|
|
506
528
|
return { provider: descriptor.id, status: 'unknown', hint: UNKNOWN_HINT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-auth.js","sourceRoot":"","sources":["../../src/core/provider-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAU,CAAC;AA0C3E;;;;;;;GAOG;AAC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AAU,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAC5E,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qodeca/xezar",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@qodeca/xezar-api-client": "^0.11.
|
|
54
|
-
"@qodeca/xezar-contract": "^0.11.
|
|
53
|
+
"@qodeca/xezar-api-client": "^0.11.2",
|
|
54
|
+
"@qodeca/xezar-contract": "^0.11.2",
|
|
55
55
|
"@types/node": "^20.14.0",
|
|
56
56
|
"@types/ws": "^8.18.1",
|
|
57
57
|
"esbuild": "^0.28.1",
|
|
@@ -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{A as r,Pt as i,Ur as a,Vr as o,X as s,Z as c,Zt as l,a as u,i as d,j as f,lr as p,pn as m,qr as h,t as g,tn as _,wn as v}from"./centered-state-B_V_Ai2h.js";import{t as y}from"./utils-Bb8ohcr3.js";import{t as b}from"./chevron-right-CFzn-von.js";import{t as x}from"./search-x-69n_672Y.js";import{n as S,r as C,t as w}from"./collapsible-B_8uYwHb.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog-CGskMvgc.js";import{c as N,t as P}from"./project-router-BbCzrHKs.js";import{n as F,o as I,r as L,t as R}from"./pill-vNzaaYxj.js";import{t as z}from"./markdown-5FuCZDA4.js";import{m as B,v as V}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{A as r,Pt as i,Ur as a,Vr as o,X as s,Z as c,Zt as l,a as u,i as d,j as f,lr as p,pn as m,qr as h,t as g,tn as _,wn as v}from"./centered-state-B_V_Ai2h.js";import{t as y}from"./utils-Bb8ohcr3.js";import{t as b}from"./chevron-right-CFzn-von.js";import{t as x}from"./search-x-69n_672Y.js";import{n as S,r as C,t as w}from"./collapsible-B_8uYwHb.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog-CGskMvgc.js";import{c as N,t as P}from"./project-router-BbCzrHKs.js";import{n as F,o as I,r as L,t as R}from"./pill-vNzaaYxj.js";import{t as z}from"./markdown-5FuCZDA4.js";import{m as B,v as V}from"./index-Cz4GSAqV.js";import{t as H}from"./run-diff-Bq9vkSNK.js";var U=e(t(),1),W=n();function G(){let{groupId:e}=o(),t=s(e),n=F(c().data),r=h();if((0,U.useEffect)(()=>{e&&r.invalidateQueries({queryKey:f.groups.detail(e)})},[r,e,(i().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,W.jsx)(B,{});if(t.isError){let e=t.error instanceof v&&t.error.status===404;return(0,W.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,W.jsx)(g,{icon:e?(0,W.jsx)(x,{}):(0,W.jsx)(V,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,W.jsx)(u,{asChild:!0,variant:`outline`,children:(0,W.jsx)(P,{to:`/`,children:`Back to tasks`})})})})}return(0,W.jsx)(K,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function K({groupId:e,variants:t,showTokens:n,showCost:i}){let o=N(),s=h(),[c,u]=(0,U.useState)(null),g=t.every(e=>l.has(e.status)),_=t[0]?m(t[0]):``,v=a({mutationFn:t=>p(e,t),onSuccess:(t,n)=>{s.invalidateQueries({queryKey:f.runs.all}),s.invalidateQueries({queryKey:f.groups.detail(e)}),o(`/tasks/${t.winner?.id??n}`)},onError:e=>d(e.message,{tone:`danger`})});return(0,W.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,W.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,W.jsx)(V,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,title:_,children:_})]}),(0,W.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,W.jsx)(`div`,{"data-slot":`compare-columns`,className:y(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,W.jsx)(q,{variant:e,allTerminal:g,pickPending:v.isPending,onPick:()=>u(e),showTokens:n,showCost:i},e.id))}),(0,W.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,W.jsx)(J,{variant:e},e.id))}),(0,W.jsx)(M,{open:c!==null,onOpenChange:e=>!e&&u(null),children:(0,W.jsxs)(D,{children:[(0,W.jsxs)(j,{children:[(0,W.jsxs)(E,{children:[`Pick variant `,c?.variant,`?`]}),(0,W.jsxs)(T,{children:[`Variant `,c?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,W.jsxs)(k,{children:[(0,W.jsx)(A,{children:`Keep comparing`}),(0,W.jsxs)(O,{"data-slot":`confirm-pick`,onClick:()=>{c&&v.mutate(c.id),u(null)},children:[(0,W.jsx)(r,{"aria-hidden":`true`}),`Pick variant `,c?.variant]})]})]})})]})}function q({variant:e,allTerminal:t,pickPending:n,onPick:i,showTokens:a,showCost:o}){let s=I(e),c=_(e.costUsd),l=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,W.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,W.jsx)(R,{dot:s.tone,pulse:s.pulse,children:s.label}),a&&l||o&&c?(0,W.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] text-soft-foreground`,children:[a?(0,W.jsx)(L,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,a&&l&&o&&c?(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,o&&c?(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:c}):null]}):null]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,W.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,W.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,W.jsx)(z,{children:e.handoffExcerpt})}):(0,W.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,W.jsxs)(u,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:i,children:[(0,W.jsx)(r,{"aria-hidden":`true`}),`Pick this one`]})]})}function J({variant:e}){let[t,n]=(0,U.useState)(!1);return(0,W.jsxs)(w,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,W.jsxs)(C,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,W.jsx)(b,{className:y(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,W.jsx)(S,{children:(0,W.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,W.jsx)(H,{runId:e.id})})})]})}export{G as CompareVariantsRoute};
|
|
@@ -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{a as r}from"./centered-state-B_V_Ai2h.js";import{n as i,t as a}from"./utils-Bb8ohcr3.js";import{t as o}from"./chevron-right-CFzn-von.js";import{b as s,c,n as l,r as u,t as d,y as f}from"./dropdown-menu-Z80KMInL.js";import{t as p}from"./ellipsis-vertical-Bmi2u2TG.js";import{t as m}from"./file-DKoYWRsv.js";import{t as h}from"./folder-u01HScRT.js";import{i as g,n as _,r as v}from"./use-desktop-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r}from"./centered-state-B_V_Ai2h.js";import{n as i,t as a}from"./utils-Bb8ohcr3.js";import{t as o}from"./chevron-right-CFzn-von.js";import{b as s,c,n as l,r as u,t as d,y as f}from"./dropdown-menu-Z80KMInL.js";import{t as p}from"./ellipsis-vertical-Bmi2u2TG.js";import{t as m}from"./file-DKoYWRsv.js";import{t as h}from"./folder-u01HScRT.js";import{i as g,n as _,r as v}from"./use-desktop-Sr1QlxhT.js";import{t as y}from"./square-terminal-Cf4Og6ct.js";import{t as b}from"./upload-SnwVxKOA.js";import{t as x}from"./diff-stat-btAmKFJr.js";var S=e(t(),1),C=n();function w({root:e,selected:t,onSelect:n}){return(0,C.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,C.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,C.jsx)(E,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,C.jsx)(O,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function T({adds:e,dels:t}){return(0,C.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,C.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,C.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function E({dir:e,depth:t,selected:n,onSelect:r}){let[i,s]=(0,S.useState)(!0);return(0,C.jsxs)(`li`,{children:[(0,C.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":i?`open`:`closed`,"aria-expanded":i,onClick:()=>s(e=>!e),className:`flex 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,C.jsx)(o,{"aria-hidden":`true`,className:a(`size-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,C.jsx)(h,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,C.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,C.jsx)(T,{adds:e.adds,dels:e.dels})]}),i?(0,C.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,C.jsx)(E,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,C.jsx)(O,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var D={added:`text-success`,deleted:`text-danger`};function O({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,C.jsx)(`li`,{children:(0,C.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:a(`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,C.jsx)(m,{"aria-hidden":`true`,className:a(`size-3.5 shrink-0`,D[e.status])}),(0,C.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,C.jsx)(T,{adds:e.adds,dels:e.dels})]})})}function k(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function A(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(A)}}var j=(e,t)=>e.name.localeCompare(t.name);function M(e){let t=k(``,``),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=k(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(j),e.files.sort(j)};return i(t),{...t,dirs:t.dirs.map(A)}}function N({bar:e,branch:t,stat:n,mode:i,wrap:a,onModeChange:o,onWrapChange:s,onAction:f}){return(0,C.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[t?(0,C.jsx)(_,{branch:t}):null,n?(0,C.jsx)(I,{stat:n}):null,(0,C.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,C.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,C.jsx)(v,{mode:i,wrap:a,onModeChange:o,onWrapChange:s})}),e.secondary.map(e=>(0,C.jsx)(F,{action:e,variant:`outline`,onAction:f},e.id)),(0,C.jsx)(F,{action:e.primary,variant:`primary`,onAction:f}),e.menu.length>0?(0,C.jsxs)(d,{children:[(0,C.jsx)(c,{asChild:!0,children:(0,C.jsx)(r,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,C.jsx)(p,{"aria-hidden":`true`})})}),(0,C.jsx)(l,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,C.jsxs)(u,{disabled:!e.enabled,title:e.reason,onSelect:()=>f(e.id),children:[P[e.id],e.label]},e.id))})]}):null]})]})}var P={commit:(0,C.jsx)(g,{"aria-hidden":`true`}),push:(0,C.jsx)(b,{"aria-hidden":`true`}),"create-pr":(0,C.jsx)(f,{"aria-hidden":`true`}),"view-pr":(0,C.jsx)(s,{"aria-hidden":`true`}),"open-terminal":(0,C.jsx)(y,{"aria-hidden":`true`})};function F({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,C.jsx)(r,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,C.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[P[e.id],e.label]})}):(0,C.jsxs)(r,{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:[P[e.id],e.label]}):(0,C.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[P[e.id],e.label]})}function I({stat:e}){return(0,C.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,C.jsx)(x,{stat:{adds:L(e.adds),dels:L(e.dels),files:e.files}})})}function L(e){let[t,n]=(0,S.useState)(e),r=(0,S.useRef)(e);return(0,S.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{w as i,N as n,M as r,I 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{A as r,G as i,J as a,Jn as o,K as s,Rn as c,Rt as l,Ur as u,Vr as d,Vt as f,Wr as p,Wt as m,Xn as h,Y as g,Yn as _,Z as v,a as y,i as b,j as x,k as S,ni as C,nr as w,pr as ee,q as T,qn as te,qr as ne,t as E}from"./centered-state-B_V_Ai2h.js";import{n as D,r as O,t as k}from"./utils-Bb8ohcr3.js";import{t as A}from"./arrow-left-BJsIW6A0.js";import{C as j,S as re,b as ie,g as M,h as N,p as P,v as ae,x as oe,y as se}from"./new-task-form-BydHBbef.js";import{t as ce}from"./chevron-right-CFzn-von.js";import{b as F,x as le,y as ue}from"./dropdown-menu-Z80KMInL.js";import{C as de,S as fe,_ as I,a as pe,g as L,h as me,n as R,o as he,p as z,r as ge,u as B,v as V,y as H}from"./prompt-templates-B7Fs2b1S.js";import{t as _e}from"./refresh-cw-DGliez3E.js";import{t as U}from"./sparkles-B8agSxBZ.js";import{t as ve}from"./triangle-alert-D5tJwRD2.js";import{n as ye,t as W}from"./textarea--cpYshee.js";import{a as be,c as G,l as xe,n as K,o as Se,r as q,s as Ce,t as J}from"./use-submit-shortcut-JY8M_MPL.js";import{r as we,t as Y}from"./project-router-BbCzrHKs.js";import{r as X,t as Z}from"./markdown-5FuCZDA4.js";import{c as Te,d as Ee,f as De,i as Oe,s as ke,t as Ae,u as je}from"./skills-D4P-Hgey.js";import{_ as Me,d as Ne,f as Pe,h as Fe,l as Ie,p as Le,s as Re,u as ze}from"./index-Yp8woQLH.js";import{t as Be}from"./diff-CbozNUJq.js";import{t as Ve}from"./tab-link-Cp2-CJS8.js";var He=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ue=O(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),We=O(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Q=e(t(),1),$=n();function Ge({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`skeleton`,className:k(`animate-pulse rounded-md bg-accent`,e),...t})}function Ke(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function qe(e,t=[]){let n=Ke(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=Je(t)),n}function Je(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function Ye(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function Xe(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function Ze(e,t,n){let r=(n??``).trim();if(!r)return qe(e,t);let i=Ke(e),a=r.startsWith(i)?i+Ye(r.slice(i.length),e):Ye(r,e),o=Xe(a,e)?a:`${i}\n\n${a}`;return t.length?o+Je(t):o}function Qe(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function $e(e,t,n,r,i={}){return t?{...i,workflow:t,task:Ze(e,n,r)}:n.length?{...i,steps:Qe(n),task:Ze(e,[],r)}:{...i,workflow:`quick-task`,task:Ze(e,[],r)}}function et(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function tt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function nt(e,t){return e.trim()!==``&&t===0}function rt(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var it={workflow:null,skills:[]},at=`xez-followup-selection`;function ot(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function st(){try{let e=localStorage.getItem(at);return e?ot(JSON.parse(e)):{...it}}catch{return{...it}}}function ct(e){try{localStorage.setItem(at,JSON.stringify(e))}catch{}}var lt=`xez-followup-prompt:`;function ut(e){try{return localStorage.getItem(lt+e)??``}catch{return``}}function dt(e,t){try{t===``?localStorage.removeItem(lt+e):localStorage.setItem(lt+e,t)}catch{}}function ft({item:e,workflows:t,skills:n,workflow:i,onWorkflowChange:a,selectedSkills:o,onSkillsChange:s,engine:l,onEngineChange:d,queuedRunId:p,onQueued:m}){let h=ne(),g=f(),_=e.kind===`pr`?`PR`:`issue`,v=o.filter(e=>n.some(t=>t.name===e)),[S]=(0,Q.useState)(()=>Ke(e)),[C,w]=(0,Q.useState)(()=>ut(e.url)||S),T=Pe(l),te=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{dt(e.url,C===S?``:C)},[e.url,C,S]);let E=(0,Q.useMemo)(()=>pe(g.data?.promptTemplates),[g.data?.promptTemplates]),D=e=>{let t=te.current,n=C===S?C.length:t?.selectionStart??C.length,r=ge(C,n,e);w(r.text),requestAnimationFrame(()=>{te.current?.focus(),te.current?.setSelectionRange(r.caret,r.caret)})},O=R(E,v),k=(0,Q.useRef)(C);k.current=C;let A=(0,Q.useRef)(``);(0,Q.useEffect)(()=>{let e=he(k.current,A.current,O,S);A.current=e.applied,e.text!==k.current&&w(e.text)},[O,S]);let j=u({mutationFn:async()=>T.canRun?c($e(e,i,v,C,Ne(T))):null,onSuccess:t=>{if(t===null)return;let n=`runs`in t?t.runs[0]:t;n&&m(e.url,n.id),b(`Added to the queue — ${_} #${e.number}`),v.length>0&&g.data!==void 0&&ee({skillUsage:v.reduce((e,t)=>Ae(e,t),g.data.skillUsage)}).then(()=>h.invalidateQueries({queryKey:x.uiState})).catch(()=>{}),dt(e.url,``),w(S),A.current=``,h.invalidateQueries({queryKey:x.runs.all})},onError:e=>b(e.message,{tone:`danger`})}),re=e=>{J({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!j.isPending&&T.canRun&&j.mutate())},ie=e=>s(o.includes(e)?o.filter(t=>t!==e):[...o,e]);return(0,$.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,$.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5 text-violet`}),`Hand this to the agent`]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(pt,{workflows:t,value:i,onChange:a}),(0,$.jsx)(mt,{skills:n,skillUsage:g.data?.skillUsage,selected:v,onToggle:ie}),(0,$.jsx)(ze,{pick:l,onChange:d,disabled:j.isPending||!T.canRun,accounts:!0}),!T.providerPending&&!T.canRun?(0,$.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[T.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,$.jsx)(Y,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null,(0,$.jsx)(Ie,{templates:E,onInsert:D})]}),v.length>0?(0,$.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:v.map(e=>(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>ie(e),title:`Remove this skill`,className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-[11px] font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,$.jsx)(ye,{"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,$.jsx)(W,{ref:te,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:C,onChange:e=>w(e.target.value),onKeyDown:re,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`}),(0,$.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2.5`,children:[(0,$.jsxs)(y,{variant:`contrast`,"data-action":`gh-run`,disabled:j.isPending||!T.canRun,onClick:()=>j.mutate(),children:[(0,$.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,_]}),(0,$.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[10.5px] font-medium text-muted-foreground`,children:K()}),p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,$.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,$.jsx)(Y,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-violet hover:underline`,children:`View task →`})]}):null]})]})}function pt({workflows:e,value:t,onChange:n}){let[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(``),c=(0,Q.useRef)(null),l=Ee(e,o);return(0,$.jsxs)(P,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,$.jsx)(M,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:k(B,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,$.jsx)(Me,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,$.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,$.jsx)(N,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,$.jsxs)(z,{shouldFilter:!1,children:[(0,$.jsx)(I,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,$.jsxs)(H,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,$.jsx)(me,{children:`Nothing matches.`}):null,(0,$.jsx)(L,{children:l.map(e=>{let i=t===e.name;return(0,$.jsxs)(V,{value:`workflow ${e.name}`,keywords:De(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(i?null:e.name),a(!1)},children:[(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,i?(0,$.jsx)(r,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function mt({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(null),d=(0,Q.useRef)(null),{mostUsed:f,project:p,global:m}=Te(je(e,s,t),t),h=(e,t)=>{let a=n.includes(e.name);return(0,$.jsxs)(V,{value:`skill ${e.name} ${e.path}`,keywords:De(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":a?`true`:void 0,onSelect:()=>i(e.name),children:[(0,$.jsx)(`span`,{className:k(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,$.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,$.jsx)(de,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,$.jsx)(r,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Re,{skill:l,onClose:()=>u(null)}),(0,$.jsxs)(P,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,$.jsx)(M,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:k(B,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,$.jsx)(U,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,n.length>0?` · ${n.length}`:``,(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,$.jsx)(N,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,$.jsxs)(z,{shouldFilter:!1,children:[(0,$.jsx)(I,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,$.jsxs)(H,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[f.length===0&&p.length===0&&m.length===0?(0,$.jsx)(me,{children:`Nothing matches.`}):null,f.length>0?(0,$.jsx)(L,{heading:`Most used`,children:f.map(e=>h(e,Oe(e)))}):null,p.length>0?(0,$.jsx)(L,{heading:`Project skills`,children:p.map(e=>h(e,!0))}):null,m.length>0?(0,$.jsx)(L,{heading:`Global`,children:m.map(e=>h(e,!1))}):null]})]})})]})]})}var ht=1e3,gt=100,_t=350;function vt(e,t){let[n,r]=(0,Q.useState)(e);return(0,Q.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function yt({view:e,changes:t=!1,index:n=!1}){let{n:r}=d(),a=i({limit:ht}),c=v().data?.capabilities?.automations===!0,p=a.data,h=r===void 0?null:Number.parseInt(r,10),_=(0,Q.useMemo)(()=>{if(!p?.available)return[];let t=new Set;e===`prs`&&h!==null&&Number.isInteger(h)&&t.add(h);for(let e of p.prs){if(t.size>=gt)break;t.add(e.number)}return[...t]},[p,e,h]),w=s(_,e===`prs`),T=w.data?.available?w.data.checks:void 0,D=ne(),O=e=>{D.setQueryData(x.uiState,t=>({...t,githubView:e})),ee({githubView:e}).then(e=>D.setQueryData(x.uiState,e)).catch(e=>{b(e instanceof Error?e.message:String(e),{tone:`danger`}),D.invalidateQueries({queryKey:x.uiState})})},A=(0,Q.useRef)(null),j=u({mutationFn:()=>te({refresh:!0,limit:ht}),onSuccess:e=>{D.setQueryData(x.github({limit:ht}),e),D.invalidateQueries({queryKey:x.githubChecks(_)});let t=A.current;if(!t){D.removeQueries({queryKey:[`github`,`comments`]});return}let n=x.githubComments(t.kind,t.number);o(t.kind,t.number,{refresh:!0}).then(e=>D.setQueryData(n,e)).catch(()=>{}),D.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==C(n)})},onError:e=>b(e.message,{tone:`danger`})}),re=m(),ie=l(),M=f(),[N,P]=(0,Q.useState)(()=>st().workflow),[ae,se]=(0,Q.useState)(()=>st().skills),[ce,F]=(0,Q.useState)({runner:null,model:null,account:null});(0,Q.useEffect)(()=>{ct({workflow:N,skills:[...ae]})},[N,ae]);let le=re.data?.workflows;(0,Q.useEffect)(()=>{le&&N!==null&&!le.some(e=>e.name===N)&&P(null)},[le,N]);let de=ie.data,I=M.data?.skillUsage,pe=(0,Q.useMemo)(()=>ke(de??[],I),[de,I]),[L,me]=(0,Q.useState)(new Map),[R,he]=(0,Q.useState)(``),[z,ge]=(0,Q.useState)([]),B=vt(R,_t),V=(0,Q.useMemo)(()=>p?.available?e===`issues`?p.issues:p.prs:[],[p,e]),H=nt(B,(0,Q.useMemo)(()=>tt(V,{query:B,labels:z}).length,[V,B,z])),U=g(e===`issues`?`issue`:`pr`,B,H);if(n&&M.data?.githubView===`prs`)return(0,$.jsx)(we,{to:`/github/prs`,replace:!0});if(!p)return a.isError?(0,$.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,$.jsx)(E,{icon:(0,$.jsx)(ve,{}),tone:`danger`,title:`Could not load GitHub`,subtitle:a.error.message})}):(0,$.jsx)(Le,{});if(A.current=null,!p.available)return(0,$.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,$.jsx)(E,{icon:(0,$.jsx)(Fe,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:p.reason??`unknown reason`,actions:(0,$.jsx)(y,{variant:`outline`,"data-action":`gh-retry`,disabled:j.isPending,onClick:()=>j.mutate(),children:`Try again`}),children:(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,$.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,$.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in xezar works without it.`]})})});let ye=V,W=tt(ye,{query:R,labels:z}),be=R.trim()!==``||z.length>0,G=H&&U.data?.available?U.data:null,xe=new Set(W.map(e=>e.number)),K=G?tt(G.items,{labels:z}).filter(e=>!xe.has(e.number)):[],Se=R.trim()!==``&&R.trim()!==B.trim()||H&&U.isPending,q={...G?.labelColors??{},...p.labelColors??{}},Ce=et(ye),J=r===void 0?null:Number.parseInt(r,10),Z=J===null?W[0]??K[0]??null:ye.find(e=>e.number===J)??K.find(e=>e.number===J)??null;A.current=Z?{kind:Z.kind,number:Z.number}:null;let Te=e===`issues`?`/github`:`/github/prs`,Ee=H&&(U.data?.available===!1||U.isError),De=U.data?.available===!1?U.data.reason??`unknown reason`:U.error instanceof Error?U.error.message:`the search request failed`,Oe=be?Se?(0,$.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,R.trim(),`”…`]}):K.length>0?null:Ee?(0,$.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter, and GitHub could not be searched: `,De,`.`]}):G?(0,$.jsxs)(`p`,{children:[`No `,e===`issues`?`issues`:`pull requests`,` match your filter — open, closed or merged.`]}):(0,$.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter.`]}):(0,$.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,`.`]});return(0,$.jsxs)(`div`,{"data-route":`github`,className:`flex h-full min-h-0 items-stretch`,children:[(0,$.jsxs)(`section`,{"data-slot":`gh-list`,className:k(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,r===void 0?`flex`:`hidden`),children:[(0,$.jsxs)(`header`,{"data-slot":`gh-header`,className:`sticky top-0 z-10 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(`h1`,{className:`text-lg font-semibold`,children:`GitHub`}),p.repo?(0,$.jsx)(`span`,{"data-slot":`gh-repo`,className:`min-w-0 truncate font-mono text-[11px] text-soft-foreground`,children:p.repo}):null,c?(0,$.jsx)(Y,{to:`/automations/new`,className:`ml-auto shrink-0 text-[10px] font-medium text-primary hover:underline`,children:`Set up automations`}):null,(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:j.isPending,onClick:()=>j.mutate(),className:k(`flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-px text-[10px] font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,!c&&`ml-auto`),children:[(0,$.jsx)(_e,{"aria-hidden":`true`,className:k(`size-[9px]`,j.isPending&&`motion-safe:animate-spin`)}),p.syncedAt?`synced ${X(p.syncedAt)} ago`:`refresh`]})]}),(0,$.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,$.jsxs)(Ve,{to:`/github`,active:e===`issues`,onClick:()=>O(`issues`),children:[`Issues · `,bt(p.issues.length)]}),(0,$.jsxs)(Ve,{to:`/github/prs`,active:e===`prs`,onClick:()=>O(`prs`),children:[`Pull requests · `,bt(p.prs.length)]})]}),(0,$.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 pb-3`,children:[(0,$.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,$.jsx)(fe,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,$.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:R,onChange:e=>he(e.target.value),className:`w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,$.jsx)(St,{options:Ce,colors:q,selected:z,onChange:ge})]})]}),W.length===0?Oe&&(0,$.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:Oe}):(0,$.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-0.5 px-2 py-2`,children:W.map(t=>(0,$.jsx)(xt,{item:t,view:e,colors:q,active:Z?.url===t.url,queued:L.has(t.url),checks:t.kind===`pr`?T?.[t.number]??t.checks:t.checks},t.url))}),K.length>0?(0,$.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,$.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,G?.truncated?` (first matches)`:``]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:K.map(t=>(0,$.jsx)(xt,{item:t,view:e,colors:q,active:Z?.url===t.url,queued:L.has(t.url),checks:t.kind===`pr`?T?.[t.number]??t.checks:t.checks},t.url))})]}):null]}),(0,$.jsx)(`section`,{"data-slot":`gh-detail`,className:k(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,r===void 0?`hidden md:flex`:`flex`),children:Z?(0,$.jsx)(wt,{item:Z,listPath:Te,colors:q,changes:t,checks:Z.kind===`pr`?T?.[Z.number]??Z.checks:Z.checks,children:(0,$.jsx)(ft,{item:Z,workflows:re.data?.workflows??[],skills:pe,workflow:N,onWorkflowChange:P,selectedSkills:ae,onSkillsChange:se,engine:ce,onEngineChange:F,queuedRunId:L.get(Z.url)??null,onQueued:(e,t)=>me(n=>new Map(n).set(e,t))},Z.url)}):(0,$.jsx)(E,{icon:e===`issues`?(0,$.jsx)(oe,{}):(0,$.jsx)(ue,{}),tone:`neutral`,heading:`h2`,title:J===null?`Nothing selected`:`Not found`,subtitle:J===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${J} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${J} above to look it up on GitHub, closed and merged included.`})})]})}function bt(e){return`${e}${e>=ht?`+`:``}`}function xt({item:e,view:t,colors:n,active:r,queued:i,checks:a}){let s=e.kind===`issue`?oe:ue,c=ne(),l=()=>{c.prefetchQuery({queryKey:x.githubComments(e.kind,e.number),queryFn:({signal:t})=>o(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,$.jsx)(`li`,{children:(0,$.jsxs)(Y,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,qe(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:l,onFocus:l,"data-slot":`gh-row`,"data-number":e.number,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:k(`flex flex-col gap-1 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,r&&`bg-muted`),children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(s,{"aria-hidden":`true`,className:k(`size-3.5 shrink-0`,e.kind===`issue`?`text-success`:`text-violet`)}),(0,$.jsx)(`span`,{className:k(`min-w-0 truncate text-[13px] font-medium`,r&&`font-semibold`),children:e.title})]}),(0,$.jsxs)(`span`,{className:`flex items-center gap-2 pl-[22px] font-mono text-[10.5px] text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[`#`,e.number]}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.author}),(0,$.jsx)(`span`,{children:X(e.createdAt)}),(0,$.jsx)(Ht,{count:e.comments}),a?(0,$.jsx)(Wt,{checks:a}):null,i?(0,$.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-violet`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,$.jsx)(`span`,{className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,$.jsx)(Ct,{label:e,color:n[e]},e))}):null]})})}function St({options:e,colors:t,selected:n,onChange:i}){let[a,o]=(0,Q.useState)(!1),s=e=>i(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,$.jsxs)(P,{open:a,onOpenChange:o,children:[(0,$.jsx)(M,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:k(`flex shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-primary/60 text-foreground`),children:[(0,$.jsx)(We,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,$.jsx)(N,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,$.jsxs)(z,{children:[(0,$.jsx)(I,{placeholder:`Filter labels…`}),(0,$.jsxs)(H,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,$.jsx)(me,{children:`No labels.`}),n.length>0?(0,$.jsxs)(V,{value:`__clear__`,onSelect:()=>i([]),className:`text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let i=n.includes(e);return(0,$.jsxs)(V,{value:e,onSelect:()=>s(e),children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:rt(t[e])}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),i?(0,$.jsx)(r,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e)})]})]})})]})}function Ct({label:e,color:t}){return(0,$.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:rt(t),className:`rounded-full border px-1.5 py-px text-[10px] font-medium`,children:e})}function wt({item:e,listPath:t,colors:n,children:r,changes:i,checks:a}){let o=e.kind===`pr`?`pull request`:`issue`,s=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,$.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,$.jsxs)(Y,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,$.jsx)(A,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,$.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[10.5px] text-soft-foreground`,children:[(0,$.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,$.jsx)(`span`,{children:o}),`·`,(0,$.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,$.jsxs)(`span`,{children:[X(e.createdAt),` ago`]}),e.comments?(0,$.jsxs)($.Fragment,{children:[`·`,(0,$.jsx)(Ht,{count:e.comments})]}):null,s?(0,$.jsxs)($.Fragment,{children:[`·`,(0,$.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,$.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,$.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,D(e.url)?(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,$.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]}),(0,$.jsx)(`h2`,{className:`mt-2 text-xl leading-snug font-semibold`,children:e.title}),e.kind===`pr`?(0,$.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,$.jsx)(Ve,{to:`/github/prs/${e.number}`,active:!i,children:`Conversation`}),(0,$.jsx)(Ve,{to:`/github/prs/${e.number}/changes`,active:i,children:`Changes`})]}):null,e.labels.length>0||a?(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,$.jsx)(Ct,{label:e,color:n[e]},e)),a?(0,$.jsx)(Ut,{checks:a,url:e.url}):null]}):null,i&&e.kind===`pr`?(0,$.jsx)(Ot,{item:e}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,$.jsx)(Z,{children:e.body}):(0,$.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,$.jsx)(kt,{item:e,colors:n}),e.kind===`pr`?(0,$.jsx)(Dt,{number:e.number}):null,r]})]})}var Tt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Et({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,$.jsx)(re,{"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:k(t,`text-success`)}):e===`failing`?(0,$.jsx)(ie,{"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:k(t,`text-danger`)}):e===`pending`?(0,$.jsx)(S,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:k(t,`animate-spin text-warning`)}):(0,$.jsx)(le,{"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:k(t,`text-soft-foreground`)})}function Dt({number:e}){let t=ne(),n=p({queryKey:x.githubMergeState(e),queryFn:({signal:t})=>h(e,{},{signal:t}),retry:!1}),i=n.data?.available?n.data.mergeState:null,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(!1),[l,d]=(0,Q.useState)(!1),f=u({mutationFn:()=>h(e,{refresh:!0}),onSuccess:n=>t.setQueryData(x.githubMergeState(e),n),onError:e=>b(e instanceof Error?e.message:String(e),{tone:`danger`})}),m=a&&i?.methods.includes(a)?a:i?.defaultMethod??i?.methods[0]??null,g=u({mutationFn:()=>{if(!i||!m)throw Error(`No merge method is available.`);return w(e,{method:m,expectedHeadSha:i.headSha,...l&&i.canOverride?{overrideRules:!0}:{}})},onSuccess:()=>{c(!1),b(`Pull request #${e} merged`),t.invalidateQueries({queryKey:x.githubMergeState(e)}),t.invalidateQueries({queryKey:x.github({limit:ht})}),t.invalidateQueries({queryKey:x.githubComments(`pr`,e)})},onError:n=>{b(n instanceof Error?n.message:String(n),{tone:`danger`}),t.invalidateQueries({queryKey:x.githubMergeState(e)})}});if(n.isPending)return(0,$.jsx)(Ge,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`});if(!i)return(0,$.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:n.data?.available===!1?n.data.reason:`GitHub could not load merge requirements.`})]});let _=i.state===`merged`?`Merged`:i.state===`closed`?`Closed`:i.isDraft?`Draft`:i.mergeable===`conflicting`?`Conflicts must be resolved`:i.canMerge?`Ready to merge`:`Merge blocked`,v=i.reviewDecision===`approved`?`passing`:i.reviewDecision===`unknown`?`unknown`:`failing`,S=i.mergeable===`mergeable`?`passing`:i.mergeable===`conflicting`?`failing`:`unknown`,C=!!(m&&(i.canMerge||i.canOverride&&l));return(0,$.jsxs)(`section`,{"data-slot":`gh-merge-box`,"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[i.canMerge?(0,$.jsx)(r,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,$.jsx)(ve,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`h3`,{className:`font-semibold`,children:_}),(0,$.jsxs)(y,{type:`button`,variant:`ghost`,size:`sm`,disabled:f.isPending,onClick:()=>f.mutate(),children:[(0,$.jsx)(_e,{"aria-hidden":`true`,className:k(`size-3.5`,f.isPending&&`animate-spin`)}),`Refresh`]})]}),(0,$.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[i.headRef,` (`,i.headSha.slice(0,7),`) → `,i.baseRef]}),(0,$.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,$.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Et,{state:v}),(0,$.jsxs)(`span`,{children:[`Reviews: `,i.reviewDecision.replaceAll(`-`,` `)]})]}),(0,$.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Et,{state:S}),(0,$.jsxs)(`span`,{children:[`Conflicts: `,i.mergeable===`conflicting`?`present`:i.mergeable===`mergeable`?`none`:`unknown`]})]}),i.checks.length===0?(0,$.jsx)(`li`,{children:`No checks configured`}):i.checks.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Et,{state:e.state}),(0,$.jsxs)(`span`,{children:[e.name,` · `,e.state,e.required===!0?` · required`:e.required===null?` · requiredness unknown`:``]})]}),e.url&&D(e.url)?(0,$.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]},e.name)),i.blockers.map(e=>(0,$.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),i.canOverride?(0,$.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-primary`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,i.state===`open`&&i.methods.length>0?(0,$.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(`select`,{"aria-label":`Merge method`,value:m??``,onChange:e=>o(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:i.methods.map(e=>(0,$.jsx)(`option`,{value:e,children:Tt[e]},e))}),(0,$.jsx)(y,{disabled:!C,onClick:()=>c(!0),children:m?Tt[m]:`Merge`})]}):null]})]}),(0,$.jsx)(q,{open:s,onOpenChange:c,children:(0,$.jsxs)(be,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,$.jsxs)(G,{children:[(0,$.jsxs)(xe,{children:[m?Tt[m]:`Merge`,` pull request #`,e,`?`]}),(0,$.jsxs)(Se,{children:[`This will merge “`,i.title,`” into `,i.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`,l&&i.canOverride?` You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`:``]})]}),g.error?(0,$.jsx)(`p`,{className:`text-sm text-danger`,children:g.error.message}):null,(0,$.jsxs)(Ce,{children:[(0,$.jsx)(y,{variant:`outline`,disabled:g.isPending,onClick:()=>c(!1),children:`Cancel`}),(0,$.jsx)(y,{disabled:g.isPending,onClick:()=>g.mutate(),children:g.isPending?`Merging…`:m?Tt[m]:`Merge`})]})]})})]})}function Ot({item:e}){let t=ne(),n=a(e.number),[r,i]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(null),c=n.data,l=c?.available?c.files.filter(e=>e.path.toLowerCase().includes(r.toLowerCase())):[],u=l.findIndex(e=>e.path===o);(0,Q.useEffect)(()=>{l.length>0&&!l.some(e=>e.path===o)&&s(l[0].path)},[c?.available?c.headSha:``,r]);let d=async()=>{let n=c?.available?c.headSha:null,r=await _(e.number,{refresh:!0});t.setQueryData([`github`,`pr-changes`,e.number],r),r.available&&n&&n!==r.headSha&&(s(r.files[0]?.path??null),b(`The reviewed revision changed.`))};if(n.isPending)return(0,$.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!c)return(0,$.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!c.available)return(0,$.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:c.reason});let f=l.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),p=D(e.url)?`${e.url}/files`:null,m=l.find(e=>e.path===o);return(0,$.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,$.jsxs)(`strong`,{children:[c.files.length,` changed files`]}),(0,$.jsxs)(`span`,{className:`text-success`,children:[`+`,c.additions]}),(0,$.jsxs)(`span`,{className:`text-danger`,children:[`−`,c.deletions]}),(0,$.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:c.headSha,children:[`head `,c.headSha.slice(0,8)]}),(0,$.jsx)(y,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void d(),children:`Refresh`})]}),c.truncated?(0,$.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[c.reason??`This response is incomplete.`,` `,p?(0,$.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,$.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,$.jsxs)(`aside`,{className:`min-w-0`,children:[(0,$.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,$.jsx)(`select`,{"aria-label":`Select changed file`,value:o??``,onChange:e=>s(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:l.map(e=>(0,$.jsx)(`option`,{children:e.path},e.path))}),(0,$.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:l.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:k(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,o===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,$.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,$.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,$.jsx)(y,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<=0,onClick:()=>s(l[u-1]?.path??null),children:(0,$.jsx)(He,{})}),(0,$.jsx)(y,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<0||u>=l.length-1,onClick:()=>s(l[u+1]?.path??null),children:(0,$.jsx)(ce,{})})]}),l.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Be,{files:f.filter(e=>e.path===o),wrap:!0,className:`min-w-0`}),m&&!m.patch?(0,$.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,m.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function kt({item:e,colors:t}){let n=T(e.kind,e.number),r=n.data,i=(0,Q.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(At(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,$.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,$.jsx)(Ge,{className:`mb-3 h-3 w-24`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(Ge,{className:`h-14 w-full`}),(0,$.jsx)(Ge,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,$.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,$.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,$.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,$.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-5`,children:jt(i).map(e=>e.group===`commits`?(0,$.jsx)(Mt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,$.jsx)(Rt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,$.jsx)(Pt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var At=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function jt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Mt({commits:e,colors:t}){let[n,r]=(0,Q.useState)(!1),i=e[0]?.actor??`?`;return n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:Nt.committed}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,$.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,$.jsx)(Pt,{event:e,colors:t},e.id))]}):(0,$.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:Nt.committed}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,$.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,$.jsx)(`span`,{className:`shrink-0`,children:X(e[e.length-1].createdAt)})]})})}var Nt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Pt({event:e,colors:t}){return(0,$.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:k(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Nt[e.kind]}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,$.jsx)(Ft,{event:e,colors:t}),(0,$.jsx)(`span`,{className:`shrink-0`,children:X(e.createdAt)}),e.url?(0,$.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Ft({event:e,colors:t}){switch(e.kind){case`committed`:return(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,$.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,$.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,$.jsx)(It,{checks:e.checks})]});case`labeled`:case`unlabeled`:return(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,$.jsx)(`span`,{"data-slot":`gh-event-label`,style:rt(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[10px]`,children:e.label.name}):null,(0,$.jsx)(`span`,{className:`shrink-0`,children:`label`})]});case`assigned`:case`unassigned`:return(0,$.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]});case`merged`:return(0,$.jsx)(`span`,{children:`merged this`});case`closed`:return(0,$.jsx)(`span`,{children:`closed this`});case`reopened`:return(0,$.jsx)(`span`,{children:`reopened this`});case`head_ref_force_pushed`:return(0,$.jsx)(`span`,{children:`force-pushed`});case`renamed`:return(0,$.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]});case`cross-referenced`:return(0,$.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}}function It({checks:e}){return e?(0,$.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:k(`shrink-0`,Vt[e]),children:Bt[e]}):null}var Lt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Rt({comment:e}){let t=e.reviewState?Lt[e.reviewState]:null;return(0,$.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,$.jsx)(zt,{url:e.avatarUrl,login:e.author}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,$.jsx)(`span`,{children:X(e.createdAt)}),t?(0,$.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:k(`rounded-full border px-1.5 py-px font-sans text-[10px] font-medium`,t.tone),children:t.label}):null,(0,$.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,$.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,$.jsx)(Z,{children:e.body}):(0,$.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function zt({url:e,login:t}){let[n,r]=(0,Q.useState)(!1);return e&&!n?(0,$.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,$.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Bt={passing:`✓`,failing:`✗`,pending:`○`},Vt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Ht({count:e}){return e?(0,$.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,$.jsx)(Ue,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Ut({checks:e,url:t}){let n=k(`text-[11px] font-medium`,Vt[e],t&&`hover:underline`),r=`${Bt[e]} checks ${e}`;return t?(0,$.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,$.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function Wt({checks:e}){return(0,$.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:k(`shrink-0 font-sans text-[11px] font-semibold`,Vt[e]),children:Bt[e]})}export{yt 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{A as r,G as i,J as a,Jn as o,K as s,Rn as c,Rt as l,Ur as u,Vr as d,Vt as f,Wr as p,Wt as m,Xn as h,Y as g,Yn as _,Z as v,a as y,i as b,j as x,k as S,ni as C,nr as w,pr as ee,q as T,qn as te,qr as ne,t as E}from"./centered-state-B_V_Ai2h.js";import{n as D,r as O,t as k}from"./utils-Bb8ohcr3.js";import{t as A}from"./arrow-left-BJsIW6A0.js";import{C as j,S as re,b as ie,g as M,h as N,p as P,v as ae,x as oe,y as se}from"./new-task-form-BydHBbef.js";import{t as ce}from"./chevron-right-CFzn-von.js";import{b as F,x as le,y as ue}from"./dropdown-menu-Z80KMInL.js";import{C as de,S as fe,_ as I,a as pe,g as L,h as me,n as R,o as he,p as z,r as ge,u as B,v as V,y as H}from"./prompt-templates-B7Fs2b1S.js";import{t as _e}from"./refresh-cw-DGliez3E.js";import{t as U}from"./sparkles-B8agSxBZ.js";import{t as ve}from"./triangle-alert-D5tJwRD2.js";import{n as ye,t as W}from"./textarea--cpYshee.js";import{a as be,c as G,l as xe,n as K,o as Se,r as q,s as Ce,t as J}from"./use-submit-shortcut-JY8M_MPL.js";import{r as we,t as Y}from"./project-router-BbCzrHKs.js";import{r as X,t as Z}from"./markdown-5FuCZDA4.js";import{c as Te,d as Ee,f as De,i as Oe,s as ke,t as Ae,u as je}from"./skills-D4P-Hgey.js";import{_ as Me,d as Ne,f as Pe,h as Fe,l as Ie,p as Le,s as Re,u as ze}from"./index-Cz4GSAqV.js";import{t as Be}from"./diff-CbozNUJq.js";import{t as Ve}from"./tab-link-Cp2-CJS8.js";var He=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ue=O(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),We=O(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Q=e(t(),1),$=n();function Ge({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`skeleton`,className:k(`animate-pulse rounded-md bg-accent`,e),...t})}function Ke(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function qe(e,t=[]){let n=Ke(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=Je(t)),n}function Je(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function Ye(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function Xe(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function Ze(e,t,n){let r=(n??``).trim();if(!r)return qe(e,t);let i=Ke(e),a=r.startsWith(i)?i+Ye(r.slice(i.length),e):Ye(r,e),o=Xe(a,e)?a:`${i}\n\n${a}`;return t.length?o+Je(t):o}function Qe(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function $e(e,t,n,r,i={}){return t?{...i,workflow:t,task:Ze(e,n,r)}:n.length?{...i,steps:Qe(n),task:Ze(e,[],r)}:{...i,workflow:`quick-task`,task:Ze(e,[],r)}}function et(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function tt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function nt(e,t){return e.trim()!==``&&t===0}function rt(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var it={workflow:null,skills:[]},at=`xez-followup-selection`;function ot(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function st(){try{let e=localStorage.getItem(at);return e?ot(JSON.parse(e)):{...it}}catch{return{...it}}}function ct(e){try{localStorage.setItem(at,JSON.stringify(e))}catch{}}var lt=`xez-followup-prompt:`;function ut(e){try{return localStorage.getItem(lt+e)??``}catch{return``}}function dt(e,t){try{t===``?localStorage.removeItem(lt+e):localStorage.setItem(lt+e,t)}catch{}}function ft({item:e,workflows:t,skills:n,workflow:i,onWorkflowChange:a,selectedSkills:o,onSkillsChange:s,engine:l,onEngineChange:d,queuedRunId:p,onQueued:m}){let h=ne(),g=f(),_=e.kind===`pr`?`PR`:`issue`,v=o.filter(e=>n.some(t=>t.name===e)),[S]=(0,Q.useState)(()=>Ke(e)),[C,w]=(0,Q.useState)(()=>ut(e.url)||S),T=Pe(l),te=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{dt(e.url,C===S?``:C)},[e.url,C,S]);let E=(0,Q.useMemo)(()=>pe(g.data?.promptTemplates),[g.data?.promptTemplates]),D=e=>{let t=te.current,n=C===S?C.length:t?.selectionStart??C.length,r=ge(C,n,e);w(r.text),requestAnimationFrame(()=>{te.current?.focus(),te.current?.setSelectionRange(r.caret,r.caret)})},O=R(E,v),k=(0,Q.useRef)(C);k.current=C;let A=(0,Q.useRef)(``);(0,Q.useEffect)(()=>{let e=he(k.current,A.current,O,S);A.current=e.applied,e.text!==k.current&&w(e.text)},[O,S]);let j=u({mutationFn:async()=>T.canRun?c($e(e,i,v,C,Ne(T))):null,onSuccess:t=>{if(t===null)return;let n=`runs`in t?t.runs[0]:t;n&&m(e.url,n.id),b(`Added to the queue — ${_} #${e.number}`),v.length>0&&g.data!==void 0&&ee({skillUsage:v.reduce((e,t)=>Ae(e,t),g.data.skillUsage)}).then(()=>h.invalidateQueries({queryKey:x.uiState})).catch(()=>{}),dt(e.url,``),w(S),A.current=``,h.invalidateQueries({queryKey:x.runs.all})},onError:e=>b(e.message,{tone:`danger`})}),re=e=>{J({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!j.isPending&&T.canRun&&j.mutate())},ie=e=>s(o.includes(e)?o.filter(t=>t!==e):[...o,e]);return(0,$.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,$.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5 text-violet`}),`Hand this to the agent`]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(pt,{workflows:t,value:i,onChange:a}),(0,$.jsx)(mt,{skills:n,skillUsage:g.data?.skillUsage,selected:v,onToggle:ie}),(0,$.jsx)(ze,{pick:l,onChange:d,disabled:j.isPending||!T.canRun,accounts:!0}),!T.providerPending&&!T.canRun?(0,$.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[T.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,$.jsx)(Y,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null,(0,$.jsx)(Ie,{templates:E,onInsert:D})]}),v.length>0?(0,$.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:v.map(e=>(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>ie(e),title:`Remove this skill`,className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-[11px] font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,$.jsx)(ye,{"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,$.jsx)(W,{ref:te,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:C,onChange:e=>w(e.target.value),onKeyDown:re,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`}),(0,$.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2.5`,children:[(0,$.jsxs)(y,{variant:`contrast`,"data-action":`gh-run`,disabled:j.isPending||!T.canRun,onClick:()=>j.mutate(),children:[(0,$.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,_]}),(0,$.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[10.5px] font-medium text-muted-foreground`,children:K()}),p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,$.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,$.jsx)(Y,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-violet hover:underline`,children:`View task →`})]}):null]})]})}function pt({workflows:e,value:t,onChange:n}){let[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(``),c=(0,Q.useRef)(null),l=Ee(e,o);return(0,$.jsxs)(P,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,$.jsx)(M,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:k(B,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,$.jsx)(Me,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,$.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,$.jsx)(N,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,$.jsxs)(z,{shouldFilter:!1,children:[(0,$.jsx)(I,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,$.jsxs)(H,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,$.jsx)(me,{children:`Nothing matches.`}):null,(0,$.jsx)(L,{children:l.map(e=>{let i=t===e.name;return(0,$.jsxs)(V,{value:`workflow ${e.name}`,keywords:De(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(i?null:e.name),a(!1)},children:[(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,i?(0,$.jsx)(r,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function mt({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(null),d=(0,Q.useRef)(null),{mostUsed:f,project:p,global:m}=Te(je(e,s,t),t),h=(e,t)=>{let a=n.includes(e.name);return(0,$.jsxs)(V,{value:`skill ${e.name} ${e.path}`,keywords:De(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":a?`true`:void 0,onSelect:()=>i(e.name),children:[(0,$.jsx)(`span`,{className:k(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,$.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,$.jsx)(de,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,$.jsx)(r,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Re,{skill:l,onClose:()=>u(null)}),(0,$.jsxs)(P,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,$.jsx)(M,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:k(B,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,$.jsx)(U,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,n.length>0?` · ${n.length}`:``,(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,$.jsx)(N,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,$.jsxs)(z,{shouldFilter:!1,children:[(0,$.jsx)(I,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,$.jsxs)(H,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[f.length===0&&p.length===0&&m.length===0?(0,$.jsx)(me,{children:`Nothing matches.`}):null,f.length>0?(0,$.jsx)(L,{heading:`Most used`,children:f.map(e=>h(e,Oe(e)))}):null,p.length>0?(0,$.jsx)(L,{heading:`Project skills`,children:p.map(e=>h(e,!0))}):null,m.length>0?(0,$.jsx)(L,{heading:`Global`,children:m.map(e=>h(e,!1))}):null]})]})})]})]})}var ht=1e3,gt=100,_t=350;function vt(e,t){let[n,r]=(0,Q.useState)(e);return(0,Q.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function yt({view:e,changes:t=!1,index:n=!1}){let{n:r}=d(),a=i({limit:ht}),c=v().data?.capabilities?.automations===!0,p=a.data,h=r===void 0?null:Number.parseInt(r,10),_=(0,Q.useMemo)(()=>{if(!p?.available)return[];let t=new Set;e===`prs`&&h!==null&&Number.isInteger(h)&&t.add(h);for(let e of p.prs){if(t.size>=gt)break;t.add(e.number)}return[...t]},[p,e,h]),w=s(_,e===`prs`),T=w.data?.available?w.data.checks:void 0,D=ne(),O=e=>{D.setQueryData(x.uiState,t=>({...t,githubView:e})),ee({githubView:e}).then(e=>D.setQueryData(x.uiState,e)).catch(e=>{b(e instanceof Error?e.message:String(e),{tone:`danger`}),D.invalidateQueries({queryKey:x.uiState})})},A=(0,Q.useRef)(null),j=u({mutationFn:()=>te({refresh:!0,limit:ht}),onSuccess:e=>{D.setQueryData(x.github({limit:ht}),e),D.invalidateQueries({queryKey:x.githubChecks(_)});let t=A.current;if(!t){D.removeQueries({queryKey:[`github`,`comments`]});return}let n=x.githubComments(t.kind,t.number);o(t.kind,t.number,{refresh:!0}).then(e=>D.setQueryData(n,e)).catch(()=>{}),D.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==C(n)})},onError:e=>b(e.message,{tone:`danger`})}),re=m(),ie=l(),M=f(),[N,P]=(0,Q.useState)(()=>st().workflow),[ae,se]=(0,Q.useState)(()=>st().skills),[ce,F]=(0,Q.useState)({runner:null,model:null,account:null});(0,Q.useEffect)(()=>{ct({workflow:N,skills:[...ae]})},[N,ae]);let le=re.data?.workflows;(0,Q.useEffect)(()=>{le&&N!==null&&!le.some(e=>e.name===N)&&P(null)},[le,N]);let de=ie.data,I=M.data?.skillUsage,pe=(0,Q.useMemo)(()=>ke(de??[],I),[de,I]),[L,me]=(0,Q.useState)(new Map),[R,he]=(0,Q.useState)(``),[z,ge]=(0,Q.useState)([]),B=vt(R,_t),V=(0,Q.useMemo)(()=>p?.available?e===`issues`?p.issues:p.prs:[],[p,e]),H=nt(B,(0,Q.useMemo)(()=>tt(V,{query:B,labels:z}).length,[V,B,z])),U=g(e===`issues`?`issue`:`pr`,B,H);if(n&&M.data?.githubView===`prs`)return(0,$.jsx)(we,{to:`/github/prs`,replace:!0});if(!p)return a.isError?(0,$.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,$.jsx)(E,{icon:(0,$.jsx)(ve,{}),tone:`danger`,title:`Could not load GitHub`,subtitle:a.error.message})}):(0,$.jsx)(Le,{});if(A.current=null,!p.available)return(0,$.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,$.jsx)(E,{icon:(0,$.jsx)(Fe,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:p.reason??`unknown reason`,actions:(0,$.jsx)(y,{variant:`outline`,"data-action":`gh-retry`,disabled:j.isPending,onClick:()=>j.mutate(),children:`Try again`}),children:(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,$.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,$.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in xezar works without it.`]})})});let ye=V,W=tt(ye,{query:R,labels:z}),be=R.trim()!==``||z.length>0,G=H&&U.data?.available?U.data:null,xe=new Set(W.map(e=>e.number)),K=G?tt(G.items,{labels:z}).filter(e=>!xe.has(e.number)):[],Se=R.trim()!==``&&R.trim()!==B.trim()||H&&U.isPending,q={...G?.labelColors??{},...p.labelColors??{}},Ce=et(ye),J=r===void 0?null:Number.parseInt(r,10),Z=J===null?W[0]??K[0]??null:ye.find(e=>e.number===J)??K.find(e=>e.number===J)??null;A.current=Z?{kind:Z.kind,number:Z.number}:null;let Te=e===`issues`?`/github`:`/github/prs`,Ee=H&&(U.data?.available===!1||U.isError),De=U.data?.available===!1?U.data.reason??`unknown reason`:U.error instanceof Error?U.error.message:`the search request failed`,Oe=be?Se?(0,$.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,R.trim(),`”…`]}):K.length>0?null:Ee?(0,$.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter, and GitHub could not be searched: `,De,`.`]}):G?(0,$.jsxs)(`p`,{children:[`No `,e===`issues`?`issues`:`pull requests`,` match your filter — open, closed or merged.`]}):(0,$.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter.`]}):(0,$.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,`.`]});return(0,$.jsxs)(`div`,{"data-route":`github`,className:`flex h-full min-h-0 items-stretch`,children:[(0,$.jsxs)(`section`,{"data-slot":`gh-list`,className:k(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,r===void 0?`flex`:`hidden`),children:[(0,$.jsxs)(`header`,{"data-slot":`gh-header`,className:`sticky top-0 z-10 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(`h1`,{className:`text-lg font-semibold`,children:`GitHub`}),p.repo?(0,$.jsx)(`span`,{"data-slot":`gh-repo`,className:`min-w-0 truncate font-mono text-[11px] text-soft-foreground`,children:p.repo}):null,c?(0,$.jsx)(Y,{to:`/automations/new`,className:`ml-auto shrink-0 text-[10px] font-medium text-primary hover:underline`,children:`Set up automations`}):null,(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:j.isPending,onClick:()=>j.mutate(),className:k(`flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-px text-[10px] font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,!c&&`ml-auto`),children:[(0,$.jsx)(_e,{"aria-hidden":`true`,className:k(`size-[9px]`,j.isPending&&`motion-safe:animate-spin`)}),p.syncedAt?`synced ${X(p.syncedAt)} ago`:`refresh`]})]}),(0,$.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,$.jsxs)(Ve,{to:`/github`,active:e===`issues`,onClick:()=>O(`issues`),children:[`Issues · `,bt(p.issues.length)]}),(0,$.jsxs)(Ve,{to:`/github/prs`,active:e===`prs`,onClick:()=>O(`prs`),children:[`Pull requests · `,bt(p.prs.length)]})]}),(0,$.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 pb-3`,children:[(0,$.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,$.jsx)(fe,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,$.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:R,onChange:e=>he(e.target.value),className:`w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,$.jsx)(St,{options:Ce,colors:q,selected:z,onChange:ge})]})]}),W.length===0?Oe&&(0,$.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:Oe}):(0,$.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-0.5 px-2 py-2`,children:W.map(t=>(0,$.jsx)(xt,{item:t,view:e,colors:q,active:Z?.url===t.url,queued:L.has(t.url),checks:t.kind===`pr`?T?.[t.number]??t.checks:t.checks},t.url))}),K.length>0?(0,$.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,$.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,G?.truncated?` (first matches)`:``]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:K.map(t=>(0,$.jsx)(xt,{item:t,view:e,colors:q,active:Z?.url===t.url,queued:L.has(t.url),checks:t.kind===`pr`?T?.[t.number]??t.checks:t.checks},t.url))})]}):null]}),(0,$.jsx)(`section`,{"data-slot":`gh-detail`,className:k(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,r===void 0?`hidden md:flex`:`flex`),children:Z?(0,$.jsx)(wt,{item:Z,listPath:Te,colors:q,changes:t,checks:Z.kind===`pr`?T?.[Z.number]??Z.checks:Z.checks,children:(0,$.jsx)(ft,{item:Z,workflows:re.data?.workflows??[],skills:pe,workflow:N,onWorkflowChange:P,selectedSkills:ae,onSkillsChange:se,engine:ce,onEngineChange:F,queuedRunId:L.get(Z.url)??null,onQueued:(e,t)=>me(n=>new Map(n).set(e,t))},Z.url)}):(0,$.jsx)(E,{icon:e===`issues`?(0,$.jsx)(oe,{}):(0,$.jsx)(ue,{}),tone:`neutral`,heading:`h2`,title:J===null?`Nothing selected`:`Not found`,subtitle:J===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${J} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${J} above to look it up on GitHub, closed and merged included.`})})]})}function bt(e){return`${e}${e>=ht?`+`:``}`}function xt({item:e,view:t,colors:n,active:r,queued:i,checks:a}){let s=e.kind===`issue`?oe:ue,c=ne(),l=()=>{c.prefetchQuery({queryKey:x.githubComments(e.kind,e.number),queryFn:({signal:t})=>o(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,$.jsx)(`li`,{children:(0,$.jsxs)(Y,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,qe(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:l,onFocus:l,"data-slot":`gh-row`,"data-number":e.number,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:k(`flex flex-col gap-1 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,r&&`bg-muted`),children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(s,{"aria-hidden":`true`,className:k(`size-3.5 shrink-0`,e.kind===`issue`?`text-success`:`text-violet`)}),(0,$.jsx)(`span`,{className:k(`min-w-0 truncate text-[13px] font-medium`,r&&`font-semibold`),children:e.title})]}),(0,$.jsxs)(`span`,{className:`flex items-center gap-2 pl-[22px] font-mono text-[10.5px] text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[`#`,e.number]}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.author}),(0,$.jsx)(`span`,{children:X(e.createdAt)}),(0,$.jsx)(Ht,{count:e.comments}),a?(0,$.jsx)(Wt,{checks:a}):null,i?(0,$.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-violet`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,$.jsx)(`span`,{className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,$.jsx)(Ct,{label:e,color:n[e]},e))}):null]})})}function St({options:e,colors:t,selected:n,onChange:i}){let[a,o]=(0,Q.useState)(!1),s=e=>i(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,$.jsxs)(P,{open:a,onOpenChange:o,children:[(0,$.jsx)(M,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:k(`flex shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-primary/60 text-foreground`),children:[(0,$.jsx)(We,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,$.jsx)(N,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,$.jsxs)(z,{children:[(0,$.jsx)(I,{placeholder:`Filter labels…`}),(0,$.jsxs)(H,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,$.jsx)(me,{children:`No labels.`}),n.length>0?(0,$.jsxs)(V,{value:`__clear__`,onSelect:()=>i([]),className:`text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let i=n.includes(e);return(0,$.jsxs)(V,{value:e,onSelect:()=>s(e),children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:rt(t[e])}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),i?(0,$.jsx)(r,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e)})]})]})})]})}function Ct({label:e,color:t}){return(0,$.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:rt(t),className:`rounded-full border px-1.5 py-px text-[10px] font-medium`,children:e})}function wt({item:e,listPath:t,colors:n,children:r,changes:i,checks:a}){let o=e.kind===`pr`?`pull request`:`issue`,s=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,$.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,$.jsxs)(Y,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,$.jsx)(A,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,$.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[10.5px] text-soft-foreground`,children:[(0,$.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,$.jsx)(`span`,{children:o}),`·`,(0,$.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,$.jsxs)(`span`,{children:[X(e.createdAt),` ago`]}),e.comments?(0,$.jsxs)($.Fragment,{children:[`·`,(0,$.jsx)(Ht,{count:e.comments})]}):null,s?(0,$.jsxs)($.Fragment,{children:[`·`,(0,$.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,$.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,$.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,D(e.url)?(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,$.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]}),(0,$.jsx)(`h2`,{className:`mt-2 text-xl leading-snug font-semibold`,children:e.title}),e.kind===`pr`?(0,$.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,$.jsx)(Ve,{to:`/github/prs/${e.number}`,active:!i,children:`Conversation`}),(0,$.jsx)(Ve,{to:`/github/prs/${e.number}/changes`,active:i,children:`Changes`})]}):null,e.labels.length>0||a?(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,$.jsx)(Ct,{label:e,color:n[e]},e)),a?(0,$.jsx)(Ut,{checks:a,url:e.url}):null]}):null,i&&e.kind===`pr`?(0,$.jsx)(Ot,{item:e}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,$.jsx)(Z,{children:e.body}):(0,$.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,$.jsx)(kt,{item:e,colors:n}),e.kind===`pr`?(0,$.jsx)(Dt,{number:e.number}):null,r]})]})}var Tt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Et({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,$.jsx)(re,{"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:k(t,`text-success`)}):e===`failing`?(0,$.jsx)(ie,{"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:k(t,`text-danger`)}):e===`pending`?(0,$.jsx)(S,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:k(t,`animate-spin text-warning`)}):(0,$.jsx)(le,{"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:k(t,`text-soft-foreground`)})}function Dt({number:e}){let t=ne(),n=p({queryKey:x.githubMergeState(e),queryFn:({signal:t})=>h(e,{},{signal:t}),retry:!1}),i=n.data?.available?n.data.mergeState:null,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(!1),[l,d]=(0,Q.useState)(!1),f=u({mutationFn:()=>h(e,{refresh:!0}),onSuccess:n=>t.setQueryData(x.githubMergeState(e),n),onError:e=>b(e instanceof Error?e.message:String(e),{tone:`danger`})}),m=a&&i?.methods.includes(a)?a:i?.defaultMethod??i?.methods[0]??null,g=u({mutationFn:()=>{if(!i||!m)throw Error(`No merge method is available.`);return w(e,{method:m,expectedHeadSha:i.headSha,...l&&i.canOverride?{overrideRules:!0}:{}})},onSuccess:()=>{c(!1),b(`Pull request #${e} merged`),t.invalidateQueries({queryKey:x.githubMergeState(e)}),t.invalidateQueries({queryKey:x.github({limit:ht})}),t.invalidateQueries({queryKey:x.githubComments(`pr`,e)})},onError:n=>{b(n instanceof Error?n.message:String(n),{tone:`danger`}),t.invalidateQueries({queryKey:x.githubMergeState(e)})}});if(n.isPending)return(0,$.jsx)(Ge,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`});if(!i)return(0,$.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:n.data?.available===!1?n.data.reason:`GitHub could not load merge requirements.`})]});let _=i.state===`merged`?`Merged`:i.state===`closed`?`Closed`:i.isDraft?`Draft`:i.mergeable===`conflicting`?`Conflicts must be resolved`:i.canMerge?`Ready to merge`:`Merge blocked`,v=i.reviewDecision===`approved`?`passing`:i.reviewDecision===`unknown`?`unknown`:`failing`,S=i.mergeable===`mergeable`?`passing`:i.mergeable===`conflicting`?`failing`:`unknown`,C=!!(m&&(i.canMerge||i.canOverride&&l));return(0,$.jsxs)(`section`,{"data-slot":`gh-merge-box`,"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[i.canMerge?(0,$.jsx)(r,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,$.jsx)(ve,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`h3`,{className:`font-semibold`,children:_}),(0,$.jsxs)(y,{type:`button`,variant:`ghost`,size:`sm`,disabled:f.isPending,onClick:()=>f.mutate(),children:[(0,$.jsx)(_e,{"aria-hidden":`true`,className:k(`size-3.5`,f.isPending&&`animate-spin`)}),`Refresh`]})]}),(0,$.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[i.headRef,` (`,i.headSha.slice(0,7),`) → `,i.baseRef]}),(0,$.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,$.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Et,{state:v}),(0,$.jsxs)(`span`,{children:[`Reviews: `,i.reviewDecision.replaceAll(`-`,` `)]})]}),(0,$.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Et,{state:S}),(0,$.jsxs)(`span`,{children:[`Conflicts: `,i.mergeable===`conflicting`?`present`:i.mergeable===`mergeable`?`none`:`unknown`]})]}),i.checks.length===0?(0,$.jsx)(`li`,{children:`No checks configured`}):i.checks.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Et,{state:e.state}),(0,$.jsxs)(`span`,{children:[e.name,` · `,e.state,e.required===!0?` · required`:e.required===null?` · requiredness unknown`:``]})]}),e.url&&D(e.url)?(0,$.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]},e.name)),i.blockers.map(e=>(0,$.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),i.canOverride?(0,$.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-primary`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,i.state===`open`&&i.methods.length>0?(0,$.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(`select`,{"aria-label":`Merge method`,value:m??``,onChange:e=>o(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:i.methods.map(e=>(0,$.jsx)(`option`,{value:e,children:Tt[e]},e))}),(0,$.jsx)(y,{disabled:!C,onClick:()=>c(!0),children:m?Tt[m]:`Merge`})]}):null]})]}),(0,$.jsx)(q,{open:s,onOpenChange:c,children:(0,$.jsxs)(be,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,$.jsxs)(G,{children:[(0,$.jsxs)(xe,{children:[m?Tt[m]:`Merge`,` pull request #`,e,`?`]}),(0,$.jsxs)(Se,{children:[`This will merge “`,i.title,`” into `,i.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`,l&&i.canOverride?` You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`:``]})]}),g.error?(0,$.jsx)(`p`,{className:`text-sm text-danger`,children:g.error.message}):null,(0,$.jsxs)(Ce,{children:[(0,$.jsx)(y,{variant:`outline`,disabled:g.isPending,onClick:()=>c(!1),children:`Cancel`}),(0,$.jsx)(y,{disabled:g.isPending,onClick:()=>g.mutate(),children:g.isPending?`Merging…`:m?Tt[m]:`Merge`})]})]})})]})}function Ot({item:e}){let t=ne(),n=a(e.number),[r,i]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(null),c=n.data,l=c?.available?c.files.filter(e=>e.path.toLowerCase().includes(r.toLowerCase())):[],u=l.findIndex(e=>e.path===o);(0,Q.useEffect)(()=>{l.length>0&&!l.some(e=>e.path===o)&&s(l[0].path)},[c?.available?c.headSha:``,r]);let d=async()=>{let n=c?.available?c.headSha:null,r=await _(e.number,{refresh:!0});t.setQueryData([`github`,`pr-changes`,e.number],r),r.available&&n&&n!==r.headSha&&(s(r.files[0]?.path??null),b(`The reviewed revision changed.`))};if(n.isPending)return(0,$.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!c)return(0,$.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!c.available)return(0,$.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:c.reason});let f=l.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),p=D(e.url)?`${e.url}/files`:null,m=l.find(e=>e.path===o);return(0,$.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,$.jsxs)(`strong`,{children:[c.files.length,` changed files`]}),(0,$.jsxs)(`span`,{className:`text-success`,children:[`+`,c.additions]}),(0,$.jsxs)(`span`,{className:`text-danger`,children:[`−`,c.deletions]}),(0,$.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:c.headSha,children:[`head `,c.headSha.slice(0,8)]}),(0,$.jsx)(y,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void d(),children:`Refresh`})]}),c.truncated?(0,$.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[c.reason??`This response is incomplete.`,` `,p?(0,$.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,$.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,$.jsxs)(`aside`,{className:`min-w-0`,children:[(0,$.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,$.jsx)(`select`,{"aria-label":`Select changed file`,value:o??``,onChange:e=>s(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:l.map(e=>(0,$.jsx)(`option`,{children:e.path},e.path))}),(0,$.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:l.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:k(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,o===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,$.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,$.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,$.jsx)(y,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<=0,onClick:()=>s(l[u-1]?.path??null),children:(0,$.jsx)(He,{})}),(0,$.jsx)(y,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<0||u>=l.length-1,onClick:()=>s(l[u+1]?.path??null),children:(0,$.jsx)(ce,{})})]}),l.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Be,{files:f.filter(e=>e.path===o),wrap:!0,className:`min-w-0`}),m&&!m.patch?(0,$.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,m.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function kt({item:e,colors:t}){let n=T(e.kind,e.number),r=n.data,i=(0,Q.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(At(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,$.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,$.jsx)(Ge,{className:`mb-3 h-3 w-24`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(Ge,{className:`h-14 w-full`}),(0,$.jsx)(Ge,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,$.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,$.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,$.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,$.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,$.jsx)(`ul`,{className:`flex flex-col gap-5`,children:jt(i).map(e=>e.group===`commits`?(0,$.jsx)(Mt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,$.jsx)(Rt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,$.jsx)(Pt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var At=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function jt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Mt({commits:e,colors:t}){let[n,r]=(0,Q.useState)(!1),i=e[0]?.actor??`?`;return n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:Nt.committed}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,$.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,$.jsx)(Pt,{event:e,colors:t},e.id))]}):(0,$.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:Nt.committed}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,$.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,$.jsx)(`span`,{className:`shrink-0`,children:X(e[e.length-1].createdAt)})]})})}var Nt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Pt({event:e,colors:t}){return(0,$.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:k(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Nt[e.kind]}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,$.jsx)(Ft,{event:e,colors:t}),(0,$.jsx)(`span`,{className:`shrink-0`,children:X(e.createdAt)}),e.url?(0,$.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Ft({event:e,colors:t}){switch(e.kind){case`committed`:return(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,$.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,$.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,$.jsx)(It,{checks:e.checks})]});case`labeled`:case`unlabeled`:return(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,$.jsx)(`span`,{"data-slot":`gh-event-label`,style:rt(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[10px]`,children:e.label.name}):null,(0,$.jsx)(`span`,{className:`shrink-0`,children:`label`})]});case`assigned`:case`unassigned`:return(0,$.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]});case`merged`:return(0,$.jsx)(`span`,{children:`merged this`});case`closed`:return(0,$.jsx)(`span`,{children:`closed this`});case`reopened`:return(0,$.jsx)(`span`,{children:`reopened this`});case`head_ref_force_pushed`:return(0,$.jsx)(`span`,{children:`force-pushed`});case`renamed`:return(0,$.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]});case`cross-referenced`:return(0,$.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}}function It({checks:e}){return e?(0,$.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:k(`shrink-0`,Vt[e]),children:Bt[e]}):null}var Lt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Rt({comment:e}){let t=e.reviewState?Lt[e.reviewState]:null;return(0,$.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,$.jsx)(zt,{url:e.avatarUrl,login:e.author}),(0,$.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,$.jsx)(`span`,{children:X(e.createdAt)}),t?(0,$.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:k(`rounded-full border px-1.5 py-px font-sans text-[10px] font-medium`,t.tone),children:t.label}):null,(0,$.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,$.jsx)(F,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,$.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,$.jsx)(Z,{children:e.body}):(0,$.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function zt({url:e,login:t}){let[n,r]=(0,Q.useState)(!1);return e&&!n?(0,$.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,$.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Bt={passing:`✓`,failing:`✗`,pending:`○`},Vt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Ht({count:e}){return e?(0,$.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,$.jsx)(Ue,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Ut({checks:e,url:t}){let n=k(`text-[11px] font-medium`,Vt[e],t&&`hover:underline`),r=`${Bt[e]} checks ${e}`;return t?(0,$.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,$.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function Wt({checks:e}){return(0,$.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:k(`shrink-0 font-sans text-[11px] font-semibold`,Vt[e]),children:Bt[e]})}export{yt as GithubRoute};
|