@open-mercato/cezar 0.19.0 → 0.20.0-pr1372.4752

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.
Files changed (115) hide show
  1. package/dist/contract/index.js +4 -1
  2. package/dist/contract/repo.d.ts +3 -1
  3. package/dist/git-worktree.d.ts +2 -1
  4. package/dist/git-worktree.js +7 -2
  5. package/dist/git-worktree.js.map +1 -1
  6. package/dist/index.js +3 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/runs/retention.d.ts +9 -2
  9. package/dist/runs/retention.js +23 -4
  10. package/dist/runs/retention.js.map +1 -1
  11. package/dist/server/server.d.ts +12 -10
  12. package/dist/server/server.js +27 -2
  13. package/dist/server/server.js.map +1 -1
  14. package/dist/worktree-in-use.d.ts +25 -0
  15. package/dist/worktree-in-use.js +274 -0
  16. package/dist/worktree-in-use.js.map +1 -0
  17. package/dist/worktree-lifecycle/coordinator.js +4 -0
  18. package/dist/worktree-lifecycle/coordinator.js.map +1 -1
  19. package/package.json +3 -3
  20. package/web/dist/assets/{agent-task-pickers-C6pdeuHJ.js → agent-task-pickers-C0lbPIio.js} +1 -1
  21. package/web/dist/assets/{alert-dialog-DsAKVB9U.js → alert-dialog-D7_6EawW.js} +1 -1
  22. package/web/dist/assets/arrow-left-Ci5OwIMH.js +1 -0
  23. package/web/dist/assets/{arrow-up-DerG9eQK.js → arrow-up-Pd8kIuRY.js} +1 -1
  24. package/web/dist/assets/{assets-view-COAZvPqm.js → assets-view-Dig8Ow0W.js} +1 -1
  25. package/web/dist/assets/{automation-format-DmmN5Z7N.js → automation-format-MLNn8qnY.js} +1 -1
  26. package/web/dist/assets/{automations-route-C9h3Pe23.js → automations-route-B_hyZJ2Q.js} +1 -1
  27. package/web/dist/assets/{bot-tf6AC27f.js → bot-TU5OTE8D.js} +1 -1
  28. package/web/dist/assets/{button-DhBNRPDb.js → button-jcXhXi-5.js} +1 -1
  29. package/web/dist/assets/{centered-state-DWZ57Ha1.js → centered-state-zjxxQcEb.js} +1 -1
  30. package/web/dist/assets/check-CNVywZ6B.js +1 -0
  31. package/web/dist/assets/chevron-left-D94sZNQc.js +1 -0
  32. package/web/dist/assets/chevron-right-D2EqYt_O.js +1 -0
  33. package/web/dist/assets/circle-check-C09e7mFj.js +1 -0
  34. package/web/dist/assets/{collapsible-BXlCnxCU.js → collapsible-BGyXLTVv.js} +1 -1
  35. package/web/dist/assets/{commit-list-Inz2UHlC.js → commit-list-DxiIebKF.js} +1 -1
  36. package/web/dist/assets/{compare-variants-B66gT_Lp.js → compare-variants-RfJUgKZi.js} +1 -1
  37. package/web/dist/assets/{dashboard-DQ2EsruE.js → dashboard-CPnDqmbf.js} +1 -1
  38. package/web/dist/assets/{diff-NBMGWe9I.js → diff-DpElozOH.js} +2 -2
  39. package/web/dist/assets/{diff-stat-CgvKmRgV.js → diff-stat-YT7Licr1.js} +1 -1
  40. package/web/dist/assets/{diff-view-t0WQPrPT.js → diff-view-mNp6Fo84.js} +1 -1
  41. package/web/dist/assets/{dist-BJiHofth.js → dist-C2IyLYZs.js} +1 -1
  42. package/web/dist/assets/{download-CEvQNLNA.js → download-Cu9ySzL2.js} +1 -1
  43. package/web/dist/assets/{dropdown-menu-R7qzKuR5.js → dropdown-menu-Da8iP-nI.js} +1 -1
  44. package/web/dist/assets/{external-link-OzBGW2PE.js → external-link-CTJbUN9h.js} +1 -1
  45. package/web/dist/assets/{facet-filter-Qbx1pf2T.js → facet-filter-Be0XFoHu.js} +1 -1
  46. package/web/dist/assets/{file-fM0ty7CG.js → file-D9jm2sJ3.js} +1 -1
  47. package/web/dist/assets/{file-preview-vKAohITF.js → file-preview-BIAcYezC.js} +1 -1
  48. package/web/dist/assets/{file-tree-DZ2eXzpR.js → file-tree-hpaNl9qS.js} +1 -1
  49. package/web/dist/assets/{folder-DdjIxY7B.js → folder-Ctd1Xvqx.js} +1 -1
  50. package/web/dist/assets/{follow-up-engine-BSEbPKpI.js → follow-up-engine-WsUFV3Ry.js} +1 -1
  51. package/web/dist/assets/{git-pull-request-D2gvtstb.js → git-pull-request-BAfSEvVb.js} +1 -1
  52. package/web/dist/assets/{git-pull-request-draft-CLy0NzfX.js → git-pull-request-draft-BIgZJsu-.js} +1 -1
  53. package/web/dist/assets/{git-tab-loading-BfHswOkO.js → git-tab-loading-BnU4U-BA.js} +1 -1
  54. package/web/dist/assets/{github-3riSQ6Lm.js → github-DnDrPPfz.js} +1 -1
  55. package/web/dist/assets/{host-usage-7ZdPz-XK.js → host-usage-BeX2ZFmV.js} +1 -1
  56. package/web/dist/assets/{icon-tooltip-DWp0bFCr.js → icon-tooltip-BfI1AC00.js} +1 -1
  57. package/web/dist/assets/{impact-control-C6qnPF32.js → impact-control-Ba9XW3tV.js} +1 -1
  58. package/web/dist/assets/{impact-model-BXkk-8LD.js → impact-model-Bo4KSZmi.js} +1 -1
  59. package/web/dist/assets/{index-BJPVto-W.js → index-Crs_dvXc.js} +5 -5
  60. package/web/dist/assets/{input-Cv2-g500.js → input-vswZUfsf.js} +1 -1
  61. package/web/dist/assets/{layout-cards-rvwV0uTN.js → layout-cards-BxB9Sv6Z.js} +1 -1
  62. package/web/dist/assets/loader-circle-BuBcxAH7.js +1 -0
  63. package/web/dist/assets/{markdown-DpThfUoB.js → markdown--qN61YgZ.js} +1 -1
  64. package/web/dist/assets/{markdown-ugFgDUM5.js → markdown-BiRiR9OM.js} +1 -1
  65. package/web/dist/assets/{message-square-k8K2YFw2.js → message-square-Jt8U2gAH.js} +1 -1
  66. package/web/dist/assets/{picker-pill-DjKsq5S1.js → picker-pill-BFprBA9h.js} +1 -1
  67. package/web/dist/assets/plus-nGmv0BVG.js +1 -0
  68. package/web/dist/assets/{project-router-DXcbRXxc.js → project-router-ByYpf5zi.js} +1 -1
  69. package/web/dist/assets/{queries-DvnoUOE1.js → queries-DbDUaheq.js} +1 -1
  70. package/web/dist/assets/{reasoning-effort-pill-BtWN6FBA.js → reasoning-effort-pill-BMAjcAKk.js} +1 -1
  71. package/web/dist/assets/{repo-git-DQHghYiX.js → repo-git-CpbhUvyL.js} +1 -1
  72. package/web/dist/assets/{run-diff-CymNF6XN.js → run-diff-DTbhZHQE.js} +1 -1
  73. package/web/dist/assets/{save-A5Be1rcj.js → save-DGJET0jv.js} +1 -1
  74. package/web/dist/assets/{scroll-within-DIDO40Ps.js → scroll-within-sbc5xXAl.js} +1 -1
  75. package/web/dist/assets/search-P545ZVzc.js +1 -0
  76. package/web/dist/assets/{search-x-DHAJ1hHA.js → search-x-BI_L6x3P.js} +1 -1
  77. package/web/dist/assets/{settings-2-CT4CHpD0.js → settings-2-CcipoS54.js} +1 -1
  78. package/web/dist/assets/{sheet-D8vk1p4X.js → sheet-DJ7Q8rRA.js} +1 -1
  79. package/web/dist/assets/{skills-BAzH59kW.js → skills-DwnXdnzS.js} +1 -1
  80. package/web/dist/assets/{square-dKpVPAsQ.js → square-CuNOgYBC.js} +1 -1
  81. package/web/dist/assets/{tabs-B_vUNwk9.js → tabs-BCUQqEYa.js} +1 -1
  82. package/web/dist/assets/{tag-BWgO0bkB.js → tag-DHjatodA.js} +1 -1
  83. package/web/dist/assets/{task-commits-rj991QXb.js → task-commits-x21u_XE-.js} +1 -1
  84. package/web/dist/assets/{task-graph-VKJ_lfXL.js → task-graph-DdCE5G3r.js} +1 -1
  85. package/web/dist/assets/{task-notes-CyXwM1jJ.js → task-notes-C6RP3maE.js} +1 -1
  86. package/web/dist/assets/task-workspace-xnZHXFXk.js +29 -0
  87. package/web/dist/assets/terminal-ZT2Z_ALj.js +1 -0
  88. package/web/dist/assets/{terminal-drawer-BZItdxn-.js → terminal-drawer-Dm0kyMmF.js} +1 -1
  89. package/web/dist/assets/{terminal-pane-D4ZoQdKv.js → terminal-pane-CRjYeI78.js} +1 -1
  90. package/web/dist/assets/{textarea-DGt1COuN.js → textarea-Ckx3d0hV.js} +1 -1
  91. package/web/dist/assets/{toaster-DkOynrTr.js → toaster-CejrnYvv.js} +1 -1
  92. package/web/dist/assets/{token-metrics-CH6yTO0m.js → token-metrics-BINGXGrg.js} +1 -1
  93. package/web/dist/assets/{tooltip-DZFNJfGV.js → tooltip-26XdOGj8.js} +1 -1
  94. package/web/dist/assets/{tracker-CfV4FaME.js → tracker-BzXE6yLf.js} +1 -1
  95. package/web/dist/assets/{triangle-alert-DPgo0TAM.js → triangle-alert-CBrg6nYB.js} +1 -1
  96. package/web/dist/assets/{upload-CyWxzeww.js → upload-Cu6NRABh.js} +1 -1
  97. package/web/dist/assets/{use-now-p7SRpNs9.js → use-now-CdtIyF-0.js} +1 -1
  98. package/web/dist/assets/{use-submit-shortcut-DbaZm8p1.js → use-submit-shortcut-B3TJ3HBP.js} +1 -1
  99. package/web/dist/assets/{utils-DujIMO-J.js → utils-Bl_tQdVw.js} +1 -1
  100. package/web/dist/assets/{workflow-graph-Bi8UYX1n.js → workflow-graph-CkCPBwhB.js} +1 -1
  101. package/web/dist/assets/{worktree-lifecycle-operation-D7uIWIl_.js → worktree-lifecycle-operation-UpV9MAuk.js} +1 -1
  102. package/web/dist/assets/x-Qhn_uE86.js +1 -0
  103. package/web/dist/index.html +50 -50
  104. package/dist/telemetry-service.json +0 -1
  105. package/web/dist/assets/arrow-left-D773GDAV.js +0 -1
  106. package/web/dist/assets/check--JMF5pzG.js +0 -1
  107. package/web/dist/assets/chevron-left-BiwkBjqr.js +0 -1
  108. package/web/dist/assets/chevron-right-QEoLhwFQ.js +0 -1
  109. package/web/dist/assets/circle-check-C7cRTvGo.js +0 -1
  110. package/web/dist/assets/loader-circle-wWXhd3lT.js +0 -1
  111. package/web/dist/assets/plus-BCu7YC-w.js +0 -1
  112. package/web/dist/assets/search-_XntIRWA.js +0 -1
  113. package/web/dist/assets/task-workspace-BsOvp8_P.js +0 -29
  114. package/web/dist/assets/terminal-De3oF9fR.js +0 -1
  115. package/web/dist/assets/x-BzTqCf_Q.js +0 -1
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ga as r,hn as i,oa as a,va as o}from"./queries-DvnoUOE1.js";import{t as s}from"./utils-DujIMO-J.js";import{t as c}from"./preload-helper-Czpn1I53.js";import{o as l}from"./host-usage-7ZdPz-XK.js";import{t as u}from"./clipboard-DvCUPLwM.js";var d=e(t(),1),f=n(),p=400,m=`\r
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ga as r,hn as i,oa as a,va as o}from"./queries-DbDUaheq.js";import{t as s}from"./utils-Bl_tQdVw.js";import{t as c}from"./preload-helper-Czpn1I53.js";import{o as l}from"./host-usage-BeX2ZFmV.js";import{t as u}from"./clipboard-DvCUPLwM.js";var d=e(t(),1),f=n(),p=400,m=`\r
2
2
  [... earlier output fell out of the scrollback ...]\r
3
3
  `;function h(){let e=getComputedStyle(document.documentElement),t=t=>e.getPropertyValue(t).trim(),n=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`],r={};for(let e of n)r[e]=t(`--term-${e}`),r[`bright${e[0].toUpperCase()}${e.slice(1)}`]=t(`--term-bright-${e}`);return{background:t(`--card-2`),foreground:t(`--foreground`),cursor:t(`--primary-strong`),cursorAccent:t(`--card-2`),selectionBackground:t(`--term-selection`),...r}}function g({runId:e,session:t,active:n,io:g}){let _=l(),v=(0,d.useRef)(null);v.current=g??{read:n=>a(e,t.id,n),write:n=>r(e,t.id,n),resize:(n,r)=>o(e,t.id,n,r)};let y=(0,d.useRef)(null),b=(0,d.useRef)(null),x=(0,d.useRef)(null),S=(0,d.useRef)(null),C=(0,d.useRef)(null),w=(0,d.useRef)(0),[T,E]=(0,d.useState)(!1),[D,O]=(0,d.useState)(!1);(0,d.useEffect)(()=>{let e=y.current;if(!e)return;let t=!1,n;return(async()=>{let[{Terminal:r},{FitAddon:i}]=await Promise.all([c(()=>import(`./xterm-U4TA8lIC.js`),[]),c(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);if(t)return;let a=new r({cursorBlink:!0,cursorStyle:`bar`,cursorWidth:2,fontSize:12.5,lineHeight:1.35,letterSpacing:0,fontFamily:`'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`,theme:h(),scrollback:5e3}),o=new MutationObserver(()=>{a.options.theme=h()});o.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-accent`]}),x.current=o;let s=new i;a.loadAddon(s),a.open(e),b.current=a,S.current=()=>{e.clientHeight>0&&e.clientWidth>0&&s.fit()},C.current=()=>a.focus(),a.attachCustomKeyEventHandler(e=>{if(e.type!==`keydown`||!e.metaKey&&!e.ctrlKey)return!0;let t=e.key.toLowerCase();return e.metaKey||e.shiftKey?t===`c`&&a.hasSelection()?(u(a.getSelection()).catch(()=>{}),!1):t!==`v`:!0});let l=({cols:e,rows:t})=>{v.current.resize(e,t).catch(()=>{})};a.onResize(l),a.onData(e=>{v.current.write(e).catch(()=>{})}),S.current(),l({cols:a.cols,rows:a.rows}),E(!0);let d=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>S.current?.());d?.observe(e),n=()=>{d?.disconnect(),a.dispose()}})(),()=>{t=!0,x.current?.disconnect(),x.current=null,b.current=null,S.current=null,C.current=null,E(!1),n?.()}},[e,t.id]),(0,d.useEffect)(()=>{!n||!T||(S.current?.(),C.current?.())},[n,T]);let k=(0,d.useRef)(!1),A=(0,d.useRef)(!1),j=(0,d.useCallback)(async()=>{if(k.current){A.current=!0;return}k.current=!0;try{do{A.current=!1;let e=await v.current.read(w.current);w.current=e.cursor,e.truncated&&b.current?.write(m),e.data&&b.current?.write(e.data)}while(A.current)}finally{k.current=!1}},[e,t.id]);return(0,d.useEffect)(()=>{if(!T||!n||_===void 0)return;let e=!0,r=()=>{e&&j().catch(()=>{})};r();let a=t.topic;if(a===null)return()=>{e=!1};if(_===`local`&&!D){let t=i(a,r,()=>O(!0));return()=>{e=!1,t()}}let o=setInterval(r,p);return()=>{e=!1,clearInterval(o)}},[n,j,T,t.topic,D,_]),(0,f.jsx)(`div`,{"data-slot":`terminal-screen`,"data-session":t.id,className:s(`absolute inset-0 overflow-hidden p-3`,n?`visible`:`invisible pointer-events-none`,t.exitCode!==null&&`opacity-60`),children:(0,f.jsx)(`div`,{ref:y,className:`size-full`})})}export{g as TerminalPane};
@@ -1 +1 @@
1
- import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DujIMO-J.js";import{N as r}from"./button-DhBNRPDb.js";var i=r(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),a=r(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),o=r(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]);e();var s=t();function c({className:e,...t}){return(0,s.jsx)(`textarea`,{"data-slot":`textarea`,className:n(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-card px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-soft-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm`,e),...t})}export{i,o as n,a as r,c as t};
1
+ import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-Bl_tQdVw.js";import{N as r}from"./button-jcXhXi-5.js";var i=r(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),a=r(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),o=r(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]);e();var s=t();function c({className:e,...t}){return(0,s.jsx)(`textarea`,{"data-slot":`textarea`,className:n(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-card px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-soft-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm`,e),...t})}export{i,o as n,a as r,c 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{t as r}from"./utils-DujIMO-J.js";var i=e(t(),1),a=n(),o=5e3,s=200,c=[],l=1,u=new Set,d=new Set;function f(e){c=e;for(let e of u)e()}function p(e){return u.add(e),()=>u.delete(e)}var m=new Set;function h(e){return m.add(e),()=>m.delete(e)}function g(e,t){let n=setTimeout(()=>{d.delete(n),e()},t);d.add(n)}var _=new Set([`Failed to fetch`,`network error`,`Load failed`,`The network connection was lost.`,`NetworkError when attempting to fetch resource.`]),v=`cannot reach the cezar server — check the connection and try again`;function y(e){return _.has(e.trim())?v:e}function b(e,t={}){let n=y(e),r={id:l++,message:n,tone:t.tone??`default`,...t.action?{action:t.action}:{},exiting:!1},i=t.durationMs??o;if(f([...c,r]),r.tone===`danger`&&!t.reported&&!t.expected)for(let e of m)try{e(n)}catch{}g(()=>{f(c.map(e=>e.id===r.id?{...e,exiting:!0}:e)),g(()=>f(c.filter(e=>e.id!==r.id)),s)},i)}function x(){let e=(0,i.useSyncExternalStore)(p,()=>c);return e.length===0?null:(0,a.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed top-[calc(61px+env(safe-area-inset-top))] right-[calc(16px+env(safe-area-inset-right))] z-[60] flex flex-col items-end gap-2 md:top-[calc(16px+env(safe-area-inset-top))]`,children:e.map(e=>(0,a.jsxs)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,"data-state":e.exiting?`closed`:`open`,className:r(`pointer-events-auto max-w-[min(360px,calc(100vw-32px))] rounded-md px-3.5 py-2.5 text-ui font-medium shadow-modal`,`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-200`,`motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:slide-out-to-right-4`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:[e.message,e.action?(0,a.jsxs)(a.Fragment,{children:[` `,(0,a.jsx)(`a`,{"data-slot":`toast-action`,href:e.action.href,target:`_blank`,rel:`noopener noreferrer`,className:`font-semibold underline underline-offset-2 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:e.action.label})]}):null]},e.id))})}export{h as n,b as r,x as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Bl_tQdVw.js";var i=e(t(),1),a=n(),o=5e3,s=200,c=[],l=1,u=new Set,d=new Set;function f(e){c=e;for(let e of u)e()}function p(e){return u.add(e),()=>u.delete(e)}var m=new Set;function h(e){return m.add(e),()=>m.delete(e)}function g(e,t){let n=setTimeout(()=>{d.delete(n),e()},t);d.add(n)}var _=new Set([`Failed to fetch`,`network error`,`Load failed`,`The network connection was lost.`,`NetworkError when attempting to fetch resource.`]),v=`cannot reach the cezar server — check the connection and try again`;function y(e){return _.has(e.trim())?v:e}function b(e,t={}){let n=y(e),r={id:l++,message:n,tone:t.tone??`default`,...t.action?{action:t.action}:{},exiting:!1},i=t.durationMs??o;if(f([...c,r]),r.tone===`danger`&&!t.reported&&!t.expected)for(let e of m)try{e(n)}catch{}g(()=>{f(c.map(e=>e.id===r.id?{...e,exiting:!0}:e)),g(()=>f(c.filter(e=>e.id!==r.id)),s)},i)}function x(){let e=(0,i.useSyncExternalStore)(p,()=>c);return e.length===0?null:(0,a.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed top-[calc(61px+env(safe-area-inset-top))] right-[calc(16px+env(safe-area-inset-right))] z-[60] flex flex-col items-end gap-2 md:top-[calc(16px+env(safe-area-inset-top))]`,children:e.map(e=>(0,a.jsxs)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,"data-state":e.exiting?`closed`:`open`,className:r(`pointer-events-auto max-w-[min(360px,calc(100vw-32px))] rounded-md px-3.5 py-2.5 text-ui font-medium shadow-modal`,`motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-200`,`motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:slide-out-to-right-4`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:[e.message,e.action?(0,a.jsxs)(a.Fragment,{children:[` `,(0,a.jsx)(`a`,{"data-slot":`toast-action`,href:e.action.href,target:`_blank`,rel:`noopener noreferrer`,className:`font-semibold underline underline-offset-2 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:e.action.label})]}):null]},e.id))})}export{h as n,b as r,x as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DujIMO-J.js";import{M as r}from"./button-DhBNRPDb.js";e();var i=t(),a=r(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending`,danger:`bg-danger`,violet:`bg-violet`,neutral:`bg-soft-foreground`,idle:`bg-conflict`},pulse:{true:`animate-pulse`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function o({className:e,tone:t=`neutral`,pulse:r=!1,...o}){return(0,i.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:n(a({tone:t,pulse:r,className:e})),...o})}function s(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}export{o as n,s as t};
1
+ import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-Bl_tQdVw.js";import{M as r}from"./button-jcXhXi-5.js";e();var i=t(),a=r(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending`,danger:`bg-danger`,violet:`bg-violet`,neutral:`bg-soft-foreground`,idle:`bg-conflict`},pulse:{true:`animate-pulse`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function o({className:e,tone:t=`neutral`,pulse:r=!1,...o}){return(0,i.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:n(a({tone:t,pulse:r,className:e})),...o})}function s(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}export{o as n,s 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{t as r}from"./utils-DujIMO-J.js";import{C as i,T as a,_ as o,b as s,h as c,j as l,k as u,w as d,x as f,y as p}from"./button-DhBNRPDb.js";import{a as m,i as h,n as g,r as _,t as v}from"./dist-BJiHofth.js";var y=e(t(),1),b=n(),x=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),S=`VisuallyHidden`,C=y.forwardRef((e,t)=>(0,b.jsx)(a.span,{...e,ref:t,style:{...x,...e.style}}));C.displayName=S;var w=C,[T,E]=d(`Tooltip`,[m]),D=m(),O=`TooltipProvider`,k=700,A=`tooltip.open`,[j,M]=T(O),N=e=>{let{__scopeTooltip:t,delayDuration:n=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,b.jsx)(j,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};N.displayName=O;var P=`Tooltip`,[F,I]=T(P),L=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=M(P,e.__scopeTooltip),l=D(t),[u,d]=y.useState(null),m=p(),g=y.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,x=y.useRef(!1),[S,C]=f({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(A))):c.onClose(),a?.(e)},caller:P}),w=y.useMemo(()=>S?x.current?`delayed-open`:`instant-open`:`closed`,[S]),T=y.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,C(!0)},[C]),E=y.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),O=y.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,C(!0),g.current=0},v)},[v,C]);return y.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]),(0,b.jsx)(h,{...l,children:(0,b.jsx)(F,{scope:t,contentId:m,open:S,stateAttribute:w,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?O():T()},[c.isOpenDelayedRef,O,T]),onTriggerLeave:y.useCallback(()=>{_?E():(window.clearTimeout(g.current),g.current=0)},[E,_]),onOpen:T,onClose:E,disableHoverableContent:_,children:n})})};L.displayName=P;var R=`TooltipTrigger`,z=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=I(R,n),s=M(R,n),c=D(n),u=l(t,y.useRef(null),o.onTriggerChange),d=y.useRef(!1),f=y.useRef(!1),p=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,b.jsx)(v,{asChild:!0,...c,children:(0,b.jsx)(a.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:i(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})});z.displayName=R;var B=`TooltipPortal`,[V,H]=T(B,{forceMount:void 0}),U=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=I(B,t);return(0,b.jsx)(V,{scope:t,forceMount:n,children:(0,b.jsx)(s,{present:n||a.open,children:(0,b.jsx)(c,{asChild:!0,container:i,children:r})})})};U.displayName=B;var W=`TooltipContent`,G=y.forwardRef((e,t)=>{let n=H(W,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=I(W,e.__scopeTooltip);return(0,b.jsx)(s,{present:r||o.open,children:o.disableHoverableContent?(0,b.jsx)(X,{side:i,...a,ref:t}):(0,b.jsx)(K,{side:i,...a,ref:t})})}),K=y.forwardRef((e,t)=>{let n=I(W,e.__scopeTooltip),r=M(W,e.__scopeTooltip),i=y.useRef(null),a=l(t,i),[o,s]=y.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=y.useCallback(()=>{s(null),f(!1)},[f]),m=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ee(r,$(r,n.getBoundingClientRect())),a=te(t.getBoundingClientRect()),o=re([...i,...a]);s(o),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!ne(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,u,p]),(0,b.jsx)(X,{...e,ref:a})}),[q,J]=T(P,{isInside:!1}),Y=u(`TooltipContent`),X=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...c}=e,l=I(W,n),u=D(n),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(A,d),()=>document.removeEventListener(A,d)),[d]),y.useEffect(()=>{if(l.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,b.jsx)(o,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,b.jsxs)(_,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,b.jsx)(Y,{children:r}),(0,b.jsx)(q,{scope:n,isInside:!0,children:(0,b.jsx)(w,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});G.displayName=W;var Z=`TooltipArrow`,Q=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=D(n);return J(Z,n).isInside?null:(0,b.jsx)(g,{...i,...r,ref:t})});Q.displayName=Z;function $(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ee(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function te(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ne(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function re(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ie(t)}function ie(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ae=N,oe=L,se=z,ce=U,le=G,ue=Q;function de({delayDuration:e=0,...t}){return(0,b.jsx)(ae,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function fe({...e}){return(0,b.jsx)(oe,{"data-slot":`tooltip`,...e})}function pe({...e}){return(0,b.jsx)(se,{"data-slot":`tooltip-trigger`,...e})}function me({className:e,sideOffset:t=0,children:n,...i}){return(0,b.jsx)(ce,{children:(0,b.jsxs)(le,{"data-slot":`tooltip-content`,sideOffset:t,className:r(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-contrast px-3 py-1.5 text-xs text-balance text-contrast-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...i,children:[n,(0,b.jsx)(ue,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-contrast fill-contrast`})]})})}export{x as a,pe as i,me as n,de as r,fe as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Bl_tQdVw.js";import{C as i,T as a,_ as o,b as s,h as c,j as l,k as u,w as d,x as f,y as p}from"./button-jcXhXi-5.js";import{a as m,i as h,n as g,r as _,t as v}from"./dist-C2IyLYZs.js";var y=e(t(),1),b=n(),x=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),S=`VisuallyHidden`,C=y.forwardRef((e,t)=>(0,b.jsx)(a.span,{...e,ref:t,style:{...x,...e.style}}));C.displayName=S;var w=C,[T,E]=d(`Tooltip`,[m]),D=m(),O=`TooltipProvider`,k=700,A=`tooltip.open`,[j,M]=T(O),N=e=>{let{__scopeTooltip:t,delayDuration:n=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,b.jsx)(j,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:y.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};N.displayName=O;var P=`Tooltip`,[F,I]=T(P),L=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=M(P,e.__scopeTooltip),l=D(t),[u,d]=y.useState(null),m=p(),g=y.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,x=y.useRef(!1),[S,C]=f({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(A))):c.onClose(),a?.(e)},caller:P}),w=y.useMemo(()=>S?x.current?`delayed-open`:`instant-open`:`closed`,[S]),T=y.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,C(!0)},[C]),E=y.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),O=y.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,C(!0),g.current=0},v)},[v,C]);return y.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]),(0,b.jsx)(h,{...l,children:(0,b.jsx)(F,{scope:t,contentId:m,open:S,stateAttribute:w,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?O():T()},[c.isOpenDelayedRef,O,T]),onTriggerLeave:y.useCallback(()=>{_?E():(window.clearTimeout(g.current),g.current=0)},[E,_]),onOpen:T,onClose:E,disableHoverableContent:_,children:n})})};L.displayName=P;var R=`TooltipTrigger`,z=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=I(R,n),s=M(R,n),c=D(n),u=l(t,y.useRef(null),o.onTriggerChange),d=y.useRef(!1),f=y.useRef(!1),p=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,b.jsx)(v,{asChild:!0,...c,children:(0,b.jsx)(a.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:i(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})});z.displayName=R;var B=`TooltipPortal`,[V,H]=T(B,{forceMount:void 0}),U=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=I(B,t);return(0,b.jsx)(V,{scope:t,forceMount:n,children:(0,b.jsx)(s,{present:n||a.open,children:(0,b.jsx)(c,{asChild:!0,container:i,children:r})})})};U.displayName=B;var W=`TooltipContent`,G=y.forwardRef((e,t)=>{let n=H(W,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=I(W,e.__scopeTooltip);return(0,b.jsx)(s,{present:r||o.open,children:o.disableHoverableContent?(0,b.jsx)(X,{side:i,...a,ref:t}):(0,b.jsx)(K,{side:i,...a,ref:t})})}),K=y.forwardRef((e,t)=>{let n=I(W,e.__scopeTooltip),r=M(W,e.__scopeTooltip),i=y.useRef(null),a=l(t,i),[o,s]=y.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=y.useCallback(()=>{s(null),f(!1)},[f]),m=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ee(r,$(r,n.getBoundingClientRect())),a=te(t.getBoundingClientRect()),o=re([...i,...a]);s(o),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!ne(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,u,p]),(0,b.jsx)(X,{...e,ref:a})}),[q,J]=T(P,{isInside:!1}),Y=u(`TooltipContent`),X=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...c}=e,l=I(W,n),u=D(n),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(A,d),()=>document.removeEventListener(A,d)),[d]),y.useEffect(()=>{if(l.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,b.jsx)(o,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,b.jsxs)(_,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,b.jsx)(Y,{children:r}),(0,b.jsx)(q,{scope:n,isInside:!0,children:(0,b.jsx)(w,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});G.displayName=W;var Z=`TooltipArrow`,Q=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=D(n);return J(Z,n).isInside?null:(0,b.jsx)(g,{...i,...r,ref:t})});Q.displayName=Z;function $(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ee(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function te(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ne(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function re(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ie(t)}function ie(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ae=N,oe=L,se=z,ce=U,le=G,ue=Q;function de({delayDuration:e=0,...t}){return(0,b.jsx)(ae,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function fe({...e}){return(0,b.jsx)(oe,{"data-slot":`tooltip`,...e})}function pe({...e}){return(0,b.jsx)(se,{"data-slot":`tooltip-trigger`,...e})}function me({className:e,sideOffset:t=0,children:n,...i}){return(0,b.jsx)(ce,{children:(0,b.jsxs)(le,{"data-slot":`tooltip-content`,sideOffset:t,className:r(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-contrast px-3 py-1.5 text-xs text-balance text-contrast-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...i,children:[n,(0,b.jsx)(ue,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-contrast fill-contrast`})]})})}export{x as a,pe as i,me as n,de as r,fe as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,F as i,Fr as a,Kt as o,Ti as s,Vi as c,ao as l,cn as u,hn as d,n as f,nn as p,pn as m,r as h,rn as g,sa as _,so as v,t as y,tn as b,ua as x,uo as S}from"./queries-DvnoUOE1.js";import{Tt as C,c as w,t as T}from"./utils-DujIMO-J.js";import{t as E,x as D}from"./project-router-DXcbRXxc.js";import{i as O,o as k,s as A,x as j}from"./use-now-p7SRpNs9.js";import{c as M,f as N,m as P,p as F}from"./sheet-D8vk1p4X.js";import{t as I}from"./use-desktop-BNN3U2y9.js";import{t as L}from"./button-DhBNRPDb.js";import{t as R}from"./arrow-left-D773GDAV.js";import{Et as z,gt as ee}from"./picker-pill-DjKsq5S1.js";import{t as te}from"./check--JMF5pzG.js";import{n as ne,t as re}from"./use-submit-shortcut-DbaZm8p1.js";import{t as B}from"./external-link-OzBGW2PE.js";import{_ as V}from"./impact-model-BXkk-8LD.js";import{t as ie}from"./textarea-DGt1COuN.js";import{n as ae}from"./square-dKpVPAsQ.js";import{t as H}from"./search-_XntIRWA.js";import{t as U}from"./tag-BWgO0bkB.js";import{t as oe}from"./triangle-alert-DPgo0TAM.js";import{t as se}from"./x-BzTqCf_Q.js";import{r as W}from"./toaster-DkOynrTr.js";import{n as G}from"./format-DHK74MwW.js";import{t as ce}from"./centered-state-DWZ57Ha1.js";import{t as le}from"./markdown-DpThfUoB.js";import{Y as K,Z as ue,d as de,et as fe,f as pe,k as me,m as he}from"./index-BJPVto-W.js";import{i as ge,n as _e,r as ve,t as ye}from"./agent-task-pickers-C6pdeuHJ.js";var q=e(t(),1),be=(e,t)=>e?.available&&JSON.stringify([e.items,e.truncated])===JSON.stringify([t.items,t.truncated]);function xe(e,t,n=!0){let r=S(),a=i(),o=w(),s=JSON.stringify([o,e,t]),[l,u]=(0,q.useState)({identity:s,snapshot:null,error:null,pending:null}),f=(0,q.useRef)({refresh:async()=>{},applyChanges:async()=>{}}),p=a.data?a.data.capabilities.localHandoff?`local`:`remote`:null;(0,q.useEffect)(()=>{if(u({identity:s,snapshot:null,error:null,pending:null}),!p||!n)return;let i=t,a=!1,l=()=>{},h=null,g=null,v=null,y=(e=null)=>{a||u({identity:s,snapshot:h,error:e,pending:g})},b=(e,t=!1)=>{let n=r.getQueryData(i),a=r.getQueryState(i)?.fetchStatus===`fetching`;!t&&((n?.pages.length??0)>1||a)?(a&&(v=e),g=be(n?.pages[0],e)?null:e):(g=null,v=null,r.setQueryData(i,{pages:[e],pageParams:[void 0]}))},S=e=>{if(h&&e.version<h.version)return!1;let t=e.result?.available&&!e.checking&&e.checkedAt!==h?.checkedAt;return h=e,t&&e.result?.available&&b(e.result),e.result&&!e.result.available&&[`source_changed`,`credentials_missing`,`not_configured`].includes(e.result.code)&&(g=null,v=null,Promise.all([r.invalidateQueries({queryKey:[`tracker`,o,`association`]}),r.invalidateQueries({queryKey:[`tracker`,o,`connection`]}),r.invalidateQueries({queryKey:m.projects})])),y(),!0},w=r.getQueryCache().subscribe(e=>{if(a||!v||JSON.stringify(e.query.queryKey)!==JSON.stringify(i)||e.query.state.fetchStatus!==`idle`)return;let t=v;v=null,b(t),y()}),T=()=>{if(l(),f.current={refresh:async()=>{},applyChanges:async()=>{}},a||document.visibilityState===`hidden`)return;let t=new AbortController,n=()=>{},s,u=null,m=!1,v=!1,w=()=>!a&&!t.signal.aborted;l=()=>{t.abort(),n(),clearTimeout(s)};let E=e=>w()&&S(e),D=()=>{w()&&(y(`Automatic checking is temporarily unavailable. Retrying…`),n(),clearTimeout(s),s=setTimeout(()=>{w()&&T()},5e3))},O=async()=>{if(!(!w()||!u)){if(m){v=!0;return}m=!0;try{do v=!1,E(await _(o,u.id,t.signal));while(v&&w())}catch{D()}finally{m=!1}}};f.current={refresh:async()=>{if(!(!u||!w()))try{let e=await x(o,u.id,t.signal);if(!w()||h&&e.version<h.version||(await r.cancelQueries({queryKey:i,exact:!0}),!w())||!E(e))return;e.result?.available&&(b(e.result,!0),y())}catch{D()}},applyChanges:async()=>{!g||!w()||(await r.cancelQueries({queryKey:i,exact:!0}),w()&&g&&(b(g,!0),y()))}},(async()=>{try{if(u=await c(o,e,t.signal),!w())return;if(h=null,p===`local`)n=d(u.topic,e=>{C.safeParse(e).success&&O()},D),await O();else{let e=-1;for(;w();){let n=await _(o,u.id,t.signal,Math.max(0,e));if(E(n),e=n.version,n.result&&!n.result.available&&n.result.code===`source_changed`)break}}}catch{D()}})()};return T(),document.addEventListener(`visibilitychange`,T),()=>{a=!0,l(),w(),document.removeEventListener(`visibilitychange`,T)}},[r,s,p,n]);let h=l.identity===s?l:null,g=h?.snapshot;return{ready:g!=null,checkedAt:g?.checkedAt??null,checking:g?.checking??!1,error:h?.error??(g?.result&&!g.result.available?g.result.reason:null),hasChanges:!!h?.pending,refresh:()=>f.current.refresh(),applyChanges:()=>f.current.applyChanges()}}var Se=1e5;function J(e){let t=[];return e.bodyTruncated&&t.push(`The tracker description was truncated by the provider snapshot.`),e.unsupportedContent&&t.push(`The tracker item contains unsupported content that is absent from this snapshot.`),t}function Y(e,t={}){let n=[`Work on tracker ticket [${e.id}]: ${e.title}`,`Source: ${e.url}`,`Status: ${e.status}\nAuthor: ${e.author}\nLabels: ${e.labels.length?e.labels.join(`, `):`(none)`}`,`Description:\n${e.body.trim()||`(No description was provided.)`}`,`Tracker snapshot scope: description only; comments, attachments, and custom fields are not included.`],r=J(e);r.length&&n.push(`Snapshot limitations:\n${r.map(e=>`- ${e}`).join(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,F as i,Fr as a,Kt as o,Ti as s,Vi as c,ao as l,cn as u,hn as d,n as f,nn as p,pn as m,r as h,rn as g,sa as _,so as v,t as y,tn as b,ua as x,uo as S}from"./queries-DbDUaheq.js";import{Tt as C,c as w,t as T}from"./utils-Bl_tQdVw.js";import{t as E,x as D}from"./project-router-ByYpf5zi.js";import{i as O,o as k,s as A,x as j}from"./use-now-CdtIyF-0.js";import{c as M,f as N,m as P,p as F}from"./sheet-DJ7Q8rRA.js";import{t as I}from"./use-desktop-BNN3U2y9.js";import{t as L}from"./button-jcXhXi-5.js";import{t as R}from"./arrow-left-Ci5OwIMH.js";import{Et as z,gt as ee}from"./picker-pill-BFprBA9h.js";import{t as te}from"./check-CNVywZ6B.js";import{n as ne,t as re}from"./use-submit-shortcut-B3TJ3HBP.js";import{t as B}from"./external-link-CTJbUN9h.js";import{_ as V}from"./impact-model-Bo4KSZmi.js";import{t as ie}from"./textarea-Ckx3d0hV.js";import{n as ae}from"./square-CuNOgYBC.js";import{t as H}from"./search-P545ZVzc.js";import{t as U}from"./tag-DHjatodA.js";import{t as oe}from"./triangle-alert-CBrg6nYB.js";import{t as se}from"./x-Qhn_uE86.js";import{r as W}from"./toaster-CejrnYvv.js";import{n as G}from"./format-DHK74MwW.js";import{t as ce}from"./centered-state-zjxxQcEb.js";import{t as le}from"./markdown--qN61YgZ.js";import{Y as K,Z as ue,d as de,et as fe,f as pe,k as me,m as he}from"./index-Crs_dvXc.js";import{i as ge,n as _e,r as ve,t as ye}from"./agent-task-pickers-C0lbPIio.js";var q=e(t(),1),be=(e,t)=>e?.available&&JSON.stringify([e.items,e.truncated])===JSON.stringify([t.items,t.truncated]);function xe(e,t,n=!0){let r=S(),a=i(),o=w(),s=JSON.stringify([o,e,t]),[l,u]=(0,q.useState)({identity:s,snapshot:null,error:null,pending:null}),f=(0,q.useRef)({refresh:async()=>{},applyChanges:async()=>{}}),p=a.data?a.data.capabilities.localHandoff?`local`:`remote`:null;(0,q.useEffect)(()=>{if(u({identity:s,snapshot:null,error:null,pending:null}),!p||!n)return;let i=t,a=!1,l=()=>{},h=null,g=null,v=null,y=(e=null)=>{a||u({identity:s,snapshot:h,error:e,pending:g})},b=(e,t=!1)=>{let n=r.getQueryData(i),a=r.getQueryState(i)?.fetchStatus===`fetching`;!t&&((n?.pages.length??0)>1||a)?(a&&(v=e),g=be(n?.pages[0],e)?null:e):(g=null,v=null,r.setQueryData(i,{pages:[e],pageParams:[void 0]}))},S=e=>{if(h&&e.version<h.version)return!1;let t=e.result?.available&&!e.checking&&e.checkedAt!==h?.checkedAt;return h=e,t&&e.result?.available&&b(e.result),e.result&&!e.result.available&&[`source_changed`,`credentials_missing`,`not_configured`].includes(e.result.code)&&(g=null,v=null,Promise.all([r.invalidateQueries({queryKey:[`tracker`,o,`association`]}),r.invalidateQueries({queryKey:[`tracker`,o,`connection`]}),r.invalidateQueries({queryKey:m.projects})])),y(),!0},w=r.getQueryCache().subscribe(e=>{if(a||!v||JSON.stringify(e.query.queryKey)!==JSON.stringify(i)||e.query.state.fetchStatus!==`idle`)return;let t=v;v=null,b(t),y()}),T=()=>{if(l(),f.current={refresh:async()=>{},applyChanges:async()=>{}},a||document.visibilityState===`hidden`)return;let t=new AbortController,n=()=>{},s,u=null,m=!1,v=!1,w=()=>!a&&!t.signal.aborted;l=()=>{t.abort(),n(),clearTimeout(s)};let E=e=>w()&&S(e),D=()=>{w()&&(y(`Automatic checking is temporarily unavailable. Retrying…`),n(),clearTimeout(s),s=setTimeout(()=>{w()&&T()},5e3))},O=async()=>{if(!(!w()||!u)){if(m){v=!0;return}m=!0;try{do v=!1,E(await _(o,u.id,t.signal));while(v&&w())}catch{D()}finally{m=!1}}};f.current={refresh:async()=>{if(!(!u||!w()))try{let e=await x(o,u.id,t.signal);if(!w()||h&&e.version<h.version||(await r.cancelQueries({queryKey:i,exact:!0}),!w())||!E(e))return;e.result?.available&&(b(e.result,!0),y())}catch{D()}},applyChanges:async()=>{!g||!w()||(await r.cancelQueries({queryKey:i,exact:!0}),w()&&g&&(b(g,!0),y()))}},(async()=>{try{if(u=await c(o,e,t.signal),!w())return;if(h=null,p===`local`)n=d(u.topic,e=>{C.safeParse(e).success&&O()},D),await O();else{let e=-1;for(;w();){let n=await _(o,u.id,t.signal,Math.max(0,e));if(E(n),e=n.version,n.result&&!n.result.available&&n.result.code===`source_changed`)break}}}catch{D()}})()};return T(),document.addEventListener(`visibilitychange`,T),()=>{a=!0,l(),w(),document.removeEventListener(`visibilitychange`,T)}},[r,s,p,n]);let h=l.identity===s?l:null,g=h?.snapshot;return{ready:g!=null,checkedAt:g?.checkedAt??null,checking:g?.checking??!1,error:h?.error??(g?.result&&!g.result.available?g.result.reason:null),hasChanges:!!h?.pending,refresh:()=>f.current.refresh(),applyChanges:()=>f.current.applyChanges()}}var Se=1e5;function J(e){let t=[];return e.bodyTruncated&&t.push(`The tracker description was truncated by the provider snapshot.`),e.unsupportedContent&&t.push(`The tracker item contains unsupported content that is absent from this snapshot.`),t}function Y(e,t={}){let n=[`Work on tracker ticket [${e.id}]: ${e.title}`,`Source: ${e.url}`,`Status: ${e.status}\nAuthor: ${e.author}\nLabels: ${e.labels.length?e.labels.join(`, `):`(none)`}`,`Description:\n${e.body.trim()||`(No description was provided.)`}`,`Tracker snapshot scope: description only; comments, attachments, and custom fields are not included.`],r=J(e);r.length&&n.push(`Snapshot limitations:\n${r.map(e=>`- ${e}`).join(`
2
2
  `)}`),t.skills?.length&&n.push(`Use these skills where relevant: ${t.skills.join(`, `)}.`),t.supplemental?.trim()&&n.push(`Supplemental context:\n${t.supplemental.trim()}`),t.instruction?.trim()&&n.push(t.instruction.trim());let i=n.join(`
3
3
 
4
4
  `);if(i.length>1e5)throw Error(`The final task exceeds the 100,000 character limit. Shorten the supplemental context or instruction.`);return i}function Ce(e,t,n,r,i){if(!t&&n.length>8)throw Error(`A skill chain can contain at most 8 skills. Remove a skill before launching.`);if(J(e).length>0&&!i.acknowledgeLoss)throw Error(`Acknowledge the snapshot limitations before handing this issue to an agent.`);let a=Y(e,{...i,skills:t?n:[]});return t?{...r,workflow:t,task:a}:n.length?{...r,steps:me(n),task:a}:{...r,workflow:`quick-task`,task:a}}var X=n();function we({item:e,workflows:t,skills:n,selection:r,onSelectionChange:i,drafts:o,scopePending:s=!1,detailUnavailable:c=!1}){let l=S(),[u,d]=(0,q.useState)({workflow:null,selectedSkills:[],engine:{runner:null,model:null,account:null}}),{workflow:f,selectedSkills:p,engine:m}=r??u,g=i??d,_=e=>g(t=>({...t,workflow:e})),y=e=>g(t=>({...t,engine:e})),b=e=>g(t=>({...t,selectedSkills:e(t.selectedSkills)})),[x,C]=(0,q.useState)(o?.get(e.url)?.instruction??``),[w,T]=(0,q.useState)(o?.get(e.url)?.supplemental??``),[D,O]=(0,q.useState)(o?.get(e.url)?.acknowledgedSnapshot??null);(0,q.useEffect)(()=>{o?.set(e.url,{instruction:x,supplemental:w,acknowledgedSnapshot:D})},[o,e.url,x,w,D]);let k=JSON.stringify([e.id,e.body,e.bodyTruncated,e.unsupportedContent]),A=D===k,[j,M]=(0,q.useState)(null),N=he(m),P=J(e),F=e.body.trim()===``,I=p.filter(e=>n.some(t=>t.name===e)),R=f===null&&I.length>8,B=(0,q.useMemo)(()=>{try{return{task:Y(e,{skills:f?I:[],instruction:x,supplemental:w}),error:null}}catch(e){return{task:``,error:e.message}}},[e,f,I.join(`\0`),x,w]),V=v({mutationFn:()=>a(Ce(e,f,I,pe(N),{instruction:x,supplemental:w,acknowledgeLoss:A})),onSuccess:t=>{ee(`tracker`);let n=`runs`in t?t.runs[0]:t;M(n?.id??null),l.invalidateQueries({queryKey:h.runs.all}),W(`Added ${e.id} to the queue`)},onError:e=>W(e.message,{tone:`danger`})}),H=e=>b(t=>t.includes(e)?t.filter(t=>t!==e):f===null&&I.length>=8?t:[...t,e]),U=!s&&!c&&!V.isPending&&N.canRun&&B.error===null&&!R&&(P.length===0||A);return(0,X.jsxs)(`section`,{className:`mt-7 rounded-lg border border-border bg-card p-4`,"data-slot":`tracker-handoff`,children:[(0,X.jsxs)(`h2`,{className:`flex items-center gap-1.5 eyebrow text-soft-foreground`,children:[(0,X.jsx)(z,{className:`size-3.5 text-violet`}),` Hand this to the agent`]}),(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(_e,{workflows:t,value:f,onChange:_,slotPrefix:`tracker`}),(0,X.jsx)(ye,{skills:n,skillUsage:void 0,selected:I,onToggle:H,maxSelections:f===null?8:void 0,slotPrefix:`tracker`}),(0,X.jsx)(de,{pick:m,onChange:y,accounts:!0,disabled:V.isPending||!N.canRun}),(0,X.jsx)(ve,{resolved:N,dataSlot:`tracker-provider-gate`})]}),I.length?(0,X.jsx)(`div`,{className:`mt-2.5 flex flex-wrap gap-1.5`,children:I.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-label":`Remove skill ${e}`,onClick:()=>H(e),className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-meta font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,X.jsx)(se,{"aria-hidden":`true`,className:`size-3`})]},e))}):null,f===null&&I.length>=8?(0,X.jsxs)(`p`,{className:`mt-2 text-xs ${R?`text-danger`:`text-muted-foreground`}`,children:[`Skill chains support at most `,8,` skills. Remove one before selecting another.`]}):null,P.length||F?(0,X.jsxs)(`div`,{className:`mt-3 rounded-md border border-warning/50 bg-warning/10 p-3 text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:P.length?`This provider snapshot lost some issue content.`:`This issue has no description.`}),P.length?(0,X.jsx)(`ul`,{className:`mt-1 list-disc pl-5 text-xs`,children:P.map(e=>(0,X.jsx)(`li`,{children:e},e))}):(0,X.jsx)(`p`,{className:`mt-1 text-xs`,children:`Add any context the agent needs before starting.`}),P.length?(0,X.jsx)(`a`,{className:`mt-2 inline-block text-xs text-violet underline underline-offset-4`,href:e.url,target:`_blank`,rel:`noreferrer`,children:`Review the source issue`}):null,(0,X.jsx)(`label`,{className:`mt-3 block text-xs font-medium`,htmlFor:`tracker-supplemental`,children:`Supplemental context`}),(0,X.jsx)(ie,{id:`tracker-supplemental`,value:w,onChange:e=>T(e.target.value),placeholder:`Paste any missing context here…`,className:`mt-1 min-h-20 bg-background`}),P.length?(0,X.jsxs)(`label`,{className:`mt-2 flex items-start gap-2 text-xs`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:A,onChange:e=>O(e.target.checked?k:null)}),`I understand the agent receives this snapshot and the supplemental context above.`]}):null]}):null,(0,X.jsx)(`label`,{className:`mt-3 block text-xs font-medium`,htmlFor:`tracker-instruction`,children:`Custom instruction`}),(0,X.jsx)(ie,{id:`tracker-instruction`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,onKeyDown:e=>{re(e.nativeEvent)&&(e.preventDefault(),U&&V.mutate())},value:x,onChange:e=>C(e.target.value),placeholder:`Optional instructions; these are placed last in the task.`,className:`mt-1 min-h-20 text-ui`}),(0,X.jsxs)(`div`,{className:`mt-1 flex justify-between text-meta text-muted-foreground`,children:[(0,X.jsx)(`span`,{children:B.error??`Full tracker detail and source link are included. Comments, attachments, and custom fields are outside the snapshot.`}),(0,X.jsxs)(`span`,{children:[B.task.length.toLocaleString(),` / `,Se.toLocaleString()]})]}),s?(0,X.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:`Verifying tracker connection…`}):null,c?(0,X.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-danger`,children:`Issue detail could not be verified. Retry successfully before starting the agent; your draft is preserved.`}):null,(0,X.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2.5`,children:[(0,X.jsxs)(L,{variant:`contrast`,onClick:()=>V.mutate(),disabled:!U,children:[(0,X.jsx)(ae,{className:`size-3.5`}),` Run agent on this issue`]}),(0,X.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-micro font-medium text-muted-foreground`,children:ne()}),j?(0,X.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-success`,children:[(0,X.jsx)(te,{className:`size-3`}),` queued · `,(0,X.jsx)(E,{className:`text-violet hover:underline`,to:`/tasks/${j}`,children:`View task →`})]}):null]})]})}function Te({options:e,selected:t,onChange:n}){let[r,i]=(0,q.useState)(``),a=[...new Set([...t,...e])].sort(),o=e=>n(t.includes(e)?t.filter(t=>t!==e):[...t,e]),s=r.trim();return(0,X.jsxs)(O,{onOpenChange:e=>{e||i(``)},children:[(0,X.jsx)(A,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"aria-label":`Filter labels`,className:T(`flex shrink-0 items-center gap-1 rounded-md border border-border px-2 py-1.5 text-xs text-soft-foreground hover:bg-muted`,t.length>0&&`border-primary/60 text-foreground`),children:[(0,X.jsx)(U,{"aria-hidden":`true`,className:`size-3.5`}),`Labels`,t.length?` · ${t.length}`:``]})}),(0,X.jsx)(k,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(M,{label:`Find or add label`,shouldFilter:!1,children:[(0,X.jsx)(N,{"aria-label":`Find or add label`,placeholder:`Find or add label…`,value:r,onValueChange:i,maxLength:256}),(0,X.jsxs)(P,{className:`max-h-64`,children:[t.length?(0,X.jsx)(F,{onSelect:()=>n([]),children:`Clear filters`}):null,a.filter(e=>e.toLowerCase().includes(s.toLowerCase())).map(e=>(0,X.jsxs)(F,{value:e,disabled:!t.includes(e)&&t.length>=20,onSelect:()=>o(e),children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),t.includes(e)?(0,X.jsx)(te,{className:`size-3.5 text-primary`}):null]},e)),s&&!a.includes(s)?(0,X.jsxs)(F,{disabled:t.length>=20,onSelect:()=>{o(s),i(``)},children:[`Use label “`,s,`”`]}):null,(0,X.jsx)(`p`,{className:`px-3 py-2 text-meta text-soft-foreground`,children:`Suggestions come from loaded issues. Type any exact label to filter.`})]})]})})]})}var Ee=()=>({workflow:null,selectedSkills:[],engine:{runner:null,model:null,account:null}});function De(){let{id:e}=D(),{projectId:t}=l(),n=r(),i=b(),a=`${t??`default`}:${n.data?.association?Z(n.data.association):`none`}`,o=(0,q.useMemo)(()=>new Map,[a]),[s,c]=(0,q.useState)(null),u=s?.key===a?s.value:Ee(),d=e=>c(t=>{let n=t?.key===a?t.value:Ee();return{key:a,value:typeof e==`function`?e(n):e}});if(n.isPending)return(0,X.jsx)($,{text:`Loading tracker…`});if(n.isError)return(0,X.jsxs)(`div`,{className:`p-8 text-center text-sm text-danger`,children:[(0,X.jsx)(`p`,{children:n.error.message}),(0,X.jsx)(E,{className:`mt-3 inline-block text-violet underline underline-offset-4`,to:`/settings/tracker`,children:`Open tracker settings`})]});if(!n.data.association)return(0,X.jsx)(Oe,{});if(n.data.association.connectionId){if(i.isPending)return(0,X.jsx)($,{text:`Loading tracker…`});if(i.isError)return(0,X.jsxs)(`div`,{role:`alert`,className:`p-8 text-center text-sm`,children:[(0,X.jsx)(`p`,{children:`Could not verify the tracker connection.`}),(0,X.jsx)(L,{className:`mt-3`,variant:`outline`,onClick:()=>void i.refetch(),children:`Retry connection`})]});if(!i.data.demo&&(i.data.connection?.id!==n.data.association.connectionId||i.data.connection?.kind!==n.data.association.kind))return(0,X.jsx)(Oe,{})}return(0,X.jsx)(ke,{scopePending:n.isFetching||!!n.data.association.connectionId&&i.isFetching,association:n.data.association,selectedId:e,drafts:o,selection:u,setSelection:d},a)}function Z(e){return`${e.kind}:${e.source.id}:${e.source.webUrl}:${e.externalId}:${e.connectionId??`legacy`}`}function Oe(){return(0,X.jsxs)(`div`,{className:`mx-auto flex min-h-[55vh] max-w-lg flex-col items-center justify-center p-6 text-center`,children:[(0,X.jsx)(ue,{className:`size-8 text-muted-foreground`}),(0,X.jsx)(`h1`,{className:`mt-3 text-lg font-semibold`,children:`Connect an issue tracker`}),(0,X.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Choose a project or team from your issue tracker in project settings.`}),(0,X.jsx)(E,{className:`mt-4 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground`,to:`/settings/tracker`,children:`Open tracker settings`})]})}function ke({scopePending:e,association:t,selectedId:n,drafts:r,selection:i,setSelection:a}){let o=S(),s=I(),c=s||n===void 0,[l,u]=(0,q.useState)(null),[d,p]=(0,q.useState)(``),[m,_]=(0,q.useState)(``),[v,y]=(0,q.useState)(`active`),[b,x]=(0,q.useState)(!1),[C,w]=(0,q.useState)([]),D=g(t,{state:v,labels:C,query:m},c),O=xe({association:t,state:v,labels:C,query:m},D.queryKey,c),k=D.data?.pages??[],A=k.find(e=>!e.available),M=k.flatMap(e=>e.available?e.items:[]),N=JSON.stringify([m,v,C]),P=l?.filter===N?l.id:null;(0,q.useEffect)(()=>{P===null&&M[0]&&u({filter:N,id:M[0].id})},[P,M,N]);let F=n??(s?P:null),R=K[t.kind].label,z=async()=>{await(O.ready?O.refresh():D.restart()),F&&o.invalidateQueries({queryKey:h.tracker.detail(t,F)})};return(0,X.jsx)(ge,{name:`tracker`,route:`tracker`,selected:n!==void 0,list:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`header`,{"data-slot":`tracker-header`,className:`sticky top-0 z-10 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,X.jsx)(`h1`,{className:`text-lg font-semibold`,children:R}),(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-meta text-soft-foreground`,title:t.externalName,children:t.externalName}),(0,X.jsx)(E,{to:`/settings/tracker`,"aria-label":`Connection settings`,title:`Connection settings`,className:`ml-auto shrink-0 text-soft-foreground hover:text-foreground`,children:(0,X.jsx)(fe,{className:`size-3.5`})}),(0,X.jsxs)(`button`,{type:`button`,"aria-label":`Refresh`,title:`Refresh from ${R}`,disabled:O.checking||D.isFetching,onClick:()=>void z(),className:`flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-px text-micro font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:T(`size-[9px]`,(O.checking||D.isFetching)&&`motion-safe:animate-spin`)}),O.checkedAt?`synced ${G(O.checkedAt)} ago`:`refresh`]})]}),(0,X.jsxs)(`div`,{className:`mt-2.5 flex items-center justify-between border-b border-border pb-2`,children:[(0,X.jsxs)(`h2`,{className:`text-ui font-medium`,children:[`Issues · `,M.length,D.hasNextPage?`+`:``]}),(0,X.jsxs)(`select`,{"aria-label":`Issue state`,className:`min-w-0 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,value:v,onChange:e=>{y(e.target.value),x(!0)},children:[(0,X.jsx)(`option`,{value:`active`,children:`Active`}),(0,X.jsx)(`option`,{value:`all`,children:`All states`})]})]}),(0,X.jsxs)(`form`,{className:`mt-2.5 flex items-center gap-2 pb-3`,onSubmit:e=>{e.preventDefault();let t=d.trim(),n=b?v:t?`all`:`active`;t===m&&n===v?z():(_(t),y(n))},children:[(0,X.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,X.jsx)(H,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,X.jsx)(`input`,{type:`search`,"aria-label":`Search tracker`,maxLength:256,className:`w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-ui outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,value:d,onChange:e=>p(e.target.value),placeholder:`Search issues…`})]}),(0,X.jsx)(L,{type:`submit`,variant:`outline`,size:`sm`,disabled:D.isFetching,children:`Search`}),(0,X.jsx)(Te,{options:M.flatMap(e=>e.labels),selected:C,onChange:w})]})]}),O.error?(0,X.jsxs)(`p`,{role:`status`,className:`px-4 py-2 text-xs text-danger`,children:[O.error,` The displayed list may be outdated.`]}):null,O.hasChanges?(0,X.jsxs)(`div`,{className:`m-2 rounded-md border border-border bg-muted/40 p-3 text-xs`,children:[(0,X.jsx)(`p`,{children:`New changes are available. Your loaded pages have been preserved.`}),(0,X.jsx)(L,{size:`sm`,className:`mt-2`,variant:`outline`,onClick:()=>void O.applyChanges(),children:`Show changes`})]}):null,D.isPending&&c?(0,X.jsx)($,{text:`Loading issues…`}):null,D.isError?(0,X.jsx)(Q,{reason:D.error.message,generation:D.errorUpdatedAt,retryAfterSeconds:D.error instanceof f&&D.error.failure.code===`rate_limited`?D.error.failure.retryAfterSeconds:void 0,retry:()=>void D.restart()}):null,A&&!A.available?(0,X.jsx)(Q,{reason:A.reason,generation:D.dataUpdatedAt,retryAfterSeconds:A.code===`rate_limited`?A.retryAfterSeconds:void 0,retry:()=>void D.restart()}):null,!D.isPending&&!D.isError&&!A&&M.length===0?(0,X.jsx)($,{text:m.trim()?`No issues match this search.`:`No issues in this view.`}):null,(0,X.jsx)(`ul`,{"data-slot":`tracker-rows`,className:`flex flex-col gap-0.5 px-2 py-2`,children:M.map(n=>(0,X.jsx)(Ae,{scopePending:e,association:t,item:n,active:F===n.id},n.id))}),D.hasNextPage?(0,X.jsx)(L,{className:`mx-4 mb-4 shrink-0`,variant:`outline`,onClick:()=>void D.fetchNextPage(),disabled:D.isFetchingNextPage,children:`Load more`}):null]}),detail:F?(0,X.jsx)(Me,{scopePending:e,association:t,id:F,drafts:r,selection:i,onSelectionChange:a},`${Z(t)}:${F}`):(0,X.jsx)(ce,{icon:(0,X.jsx)(j,{}),tone:`neutral`,heading:`h2`,title:`Nothing selected`,subtitle:`Choose an issue from the list.`})})}function Ae({scopePending:e,association:t,item:n,active:r}){let i=S(),a=h.tracker.detail(t,n.id),o=()=>void i.prefetchQuery({queryKey:a,queryFn:({signal:e})=>s(n.id,{signal:e,association:t}),staleTime:y});return(0,X.jsx)(`li`,{children:(0,X.jsxs)(E,{to:`/tracker/${encodeURIComponent(n.id)}`,draggable:!0,onMouseEnter:o,onFocus:o,onDragStart:t=>{if(e){t.preventDefault();return}let n=i.getQueryState(a),r=je(i,a);if(!r){t.preventDefault(),o(),W(n?.status===`error`?`Full issue detail failed to load. Open the issue to retry.`:`Loading fresh issue detail. Drag again when it is ready.`,n?.status===`error`?{tone:`danger`}:void 0);return}if(J(r.item).length){t.preventDefault(),W(`Open this issue to acknowledge snapshot limitations before handoff.`,{tone:`danger`});return}t.dataTransfer.setData(`text/plain`,Y(r.item)),t.dataTransfer.effectAllowed=`copy`},"data-slot":`tracker-row`,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:T(`flex flex-col gap-1 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,r&&`bg-muted`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(j,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-violet`}),(0,X.jsx)(`span`,{className:T(`min-w-0 truncate text-ui font-medium`,r&&`font-semibold`),children:n.title})]}),(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 pl-[22px] font-mono text-micro text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`shrink-0`,children:n.id}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.author}),(0,X.jsx)(`span`,{className:`shrink-0`,title:new Date(n.updatedAt).toLocaleString(),children:G(n.updatedAt)})]}),(0,X.jsxs)(`span`,{className:`flex flex-wrap gap-1 pl-[22px]`,children:[(0,X.jsx)(`span`,{className:`rounded border border-border px-1.5 py-px text-micro text-muted-foreground`,children:n.status}),n.labels.map(e=>(0,X.jsx)(`span`,{className:`rounded-full border border-border px-1.5 py-px text-micro text-muted-foreground`,children:e},e))]})]})})}function je(e,t,n=Date.now()){let r=e.getQueryState(t);return r?.status!==`success`||r.fetchStatus!==`idle`||r.isInvalidated||r.dataUpdatedAt<=0||n-r.dataUpdatedAt>=6e4||!r.data?.available?null:r.data}function Me({scopePending:e,association:t,id:n,selection:r,onSelectionChange:i,drafts:a}){let s=p(t,n),c=u(),l=o(),[d,f]=(0,q.useState)(null);(0,q.useEffect)(()=>{s.data?.available&&f(s.data.item)},[s.data]);let m=s.isError?(0,X.jsx)(Q,{reason:s.error.message,generation:s.errorUpdatedAt,retry:()=>void s.refetch()}):s.data&&!s.data.available?(0,X.jsx)(Q,{reason:s.data.reason,generation:s.dataUpdatedAt,retryAfterSeconds:s.data.code===`rate_limited`?s.data.retryAfterSeconds:void 0,retry:()=>void s.refetch()}):null,h=s.data?.available?s.data.item:d;return h?(0,X.jsxs)(`article`,{"data-slot":`tracker-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,X.jsx)(Ne,{}),(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 font-mono text-micro text-soft-foreground`,children:[(0,X.jsx)(`span`,{children:h.id}),`·`,(0,X.jsx)(`span`,{children:`issue`}),`·`,(0,X.jsxs)(`span`,{children:[`opened by `,h.author]}),`·`,(0,X.jsxs)(`span`,{title:new Date(h.createdAt).toLocaleString(),children:[G(h.createdAt),` ago`]}),`·`,(0,X.jsxs)(`a`,{className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,href:h.url,target:`_blank`,rel:`noopener noreferrer`,children:[`open on `,K[t.kind].label,(0,X.jsx)(B,{"aria-hidden":`true`,className:`size-2.5`})]})]}),(0,X.jsx)(`h2`,{className:`mt-2 text-xl leading-snug font-semibold`,children:h.title}),(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`rounded border border-border px-1.5 py-px text-micro text-muted-foreground`,children:h.status}),h.labels.map(e=>(0,X.jsx)(`span`,{className:`rounded-full border border-border px-1.5 py-px text-micro text-muted-foreground`,children:e},e))]}),m,J(h).length?(0,X.jsxs)(`div`,{className:`mt-4 rounded-md border border-warning/50 bg-warning/10 p-3 text-sm`,children:[(0,X.jsx)(oe,{className:`mr-2 inline size-4`}),`This snapshot is incomplete. Review the limitations in the handoff panel.`]}):null,(0,X.jsx)(`section`,{"data-slot":`tracker-body`,className:`mt-5 text-sm`,children:(0,X.jsx)(le,{children:h.body.trim()||`*No description was provided.*`})}),(0,X.jsx)(we,{scopePending:e,item:h,detailUnavailable:s.isError||!s.data?.available,drafts:a,selection:r,onSelectionChange:i,workflows:c.data?.workflows??[],skills:l.data??[]},`${Z(t)}:${h.id}`)]}):(0,X.jsxs)(`div`,{className:`p-4`,children:[(0,X.jsx)(Ne,{}),s.isPending?(0,X.jsx)($,{text:`Loading full issue detail…`}):m]})}function Q({reason:e,retry:t,retryAfterSeconds:n=0,generation:r}){let[i,a]=(0,q.useState)(n);return(0,q.useEffect)(()=>a(n),[e,n,r]),(0,q.useEffect)(()=>{if(i<=0)return;let e=window.setInterval(()=>a(e=>Math.max(0,e-1)),1e3);return()=>window.clearInterval(e)},[i>0]),(0,X.jsxs)(`div`,{className:`mt-5 rounded-md border border-danger/30 bg-danger/5 p-4 text-sm`,children:[(0,X.jsx)(`p`,{className:`text-danger`,children:e}),(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,X.jsxs)(L,{variant:`outline`,disabled:i>0,onClick:t,children:[(0,X.jsx)(V,{className:`size-3.5`}),i>0?`Retry in ${i}s`:`Retry`]}),(0,X.jsx)(E,{className:`text-xs text-violet underline underline-offset-4`,to:`/settings/tracker`,children:`Tracker settings`})]})]})}function $({text:e,danger:t=!1}){return(0,X.jsx)(`div`,{className:`p-8 text-center text-sm ${t?`text-danger`:`text-muted-foreground`}`,children:e})}function Ne(){return(0,X.jsxs)(E,{className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,to:`/tracker`,children:[(0,X.jsx)(R,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]})}export{De as TrackerRoute};
@@ -1 +1 @@
1
- import{N as e}from"./button-DhBNRPDb.js";var t=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};
1
+ import{N as e}from"./button-jcXhXi-5.js";var t=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};
@@ -1 +1 @@
1
- import{N as e}from"./button-DhBNRPDb.js";var t=e(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),n=e(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);export{t as n,n as t};
1
+ import{N as e}from"./button-jcXhXi-5.js";var t=e(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),n=e(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);export{t as n,n 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{Ai as r,ao as i,ar as a,at as o,ci as s,co as c,hr as l,ir as u,ki as d,li as f,oo as p,so as m,uo as h}from"./queries-DvnoUOE1.js";import{c as g,n as _,t as v}from"./utils-DujIMO-J.js";import{C as y,N as b,O as x,T as S,_ as C,a as w,b as T,c as E,f as D,g as ee,h as te,i as O,j as ne,l as re,m as ie,o as ae,p as oe,r as se,s as ce,t as le,w as ue,x as de,y as fe}from"./button-DhBNRPDb.js";import{a as k,i as pe,n as me,r as he,t as A}from"./dist-BJiHofth.js";import{t as j}from"./circle-check-C7cRTvGo.js";import{n as ge,t as _e}from"./git-pull-request-D2gvtstb.js";import{t as ve}from"./git-pull-request-draft-CLy0NzfX.js";import{t as ye}from"./triangle-alert-DPgo0TAM.js";import{t as be}from"./x-BzTqCf_Q.js";import{n as xe}from"./token-metrics-CH6yTO0m.js";var M={all:(e=g())=>[`worktree-lifecycle`,e],list:(e=g())=>[...M.all(e),`list`],detail:(e,t=g())=>[...M.all(t),`worktree`,e],operation:(e,t=g())=>[...M.all(t),`operation`,e],output:(e,t=g())=>[...M.all(t),`output`,e]};function Se(){return i(),c({queryKey:M.list(),queryFn:async({signal:e})=>{let t=await d({limit:100},{signal:e}),n=new Map(t.worktrees.map(e=>[e.worktreeId,e])),r=new Set,i=t.nextCursor;for(;i&&!r.has(i);){r.add(i);let t=await d({limit:100,cursor:i},{signal:e});for(let e of t.worktrees)n.set(e.worktreeId,e);i=t.nextCursor}return{worktrees:[...n.values()]}}})}function Ce(e,t=!0){return i(),c({queryKey:M.detail(e),enabled:t,queryFn:({signal:t})=>r(e,{signal:t})})}function we(e){return i(),c({queryKey:M.operation(e),queryFn:({signal:t})=>s(e,{signal:t})})}function Te(e,t){return i(),p({queryKey:M.output(e),enabled:t,initialPageParam:0,queryFn:({signal:t,pageParam:n})=>f(e,n,{signal:t}),getNextPageParam:e=>e.items.length>=100?e.nextSeq:void 0,maxPages:5})}function Ee(e){let t=h();i();let n=g();return m({mutationFn:t=>l(e,t),onSuccess:r=>{t.setQueryData(M.operation(e,n),r),t.invalidateQueries({queryKey:M.all(n)}),t.invalidateQueries({queryKey:[`runs`,n]}),t.invalidateQueries({queryKey:[`worktrees`,n]})},onError:()=>{t.invalidateQueries({queryKey:M.operation(e,n)})}})}var N=b(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=b(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),F=b(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),I=b(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),De=b(`git-pull-request-closed`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`m21 3-6 6`,key:`16nqsk`}],[`path`,{d:`m21 9-6-6`,key:`9j17rh`}],[`path`,{d:`M18 11.5V15`,key:`65xf6f`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),Oe=b(`message-square-warning`,[[`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`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),L=e(t(),1),R=n(),z=`Popover`,[B,ke]=ue(z,[k]),V=k(),[Ae,H]=B(z),U=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=V(t),c=L.useRef(null),[l,u]=L.useState(!1),[d,f]=de({prop:r,defaultProp:i??!1,onChange:a,caller:z});return(0,R.jsx)(pe,{...s,children:(0,R.jsx)(Ae,{scope:t,contentId:fe(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:L.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:L.useCallback(()=>u(!0),[]),onCustomAnchorRemove:L.useCallback(()=>u(!1),[]),modal:o,children:n})})};U.displayName=z;var W=`PopoverAnchor`,G=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=H(W,n),a=V(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return L.useEffect(()=>(o(),()=>s()),[o,s]),(0,R.jsx)(A,{...a,...r,ref:t})});G.displayName=W;var K=`PopoverTrigger`,q=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=H(K,n),a=V(n),o=ne(t,i.triggerRef),s=(0,R.jsx)(S.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":He(i.open),...r,ref:o,onClick:y(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(A,{asChild:!0,...a,children:s})});q.displayName=K;var J=`PopoverPortal`,[je,Me]=B(J,{forceMount:void 0}),Y=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=H(J,t);return(0,R.jsx)(je,{scope:t,forceMount:n,children:(0,R.jsx)(T,{present:n||a.open,children:(0,R.jsx)(te,{asChild:!0,container:i,children:r})})})};Y.displayName=J;var X=`PopoverContent`,Ne=L.forwardRef((e,t)=>{let n=Me(X,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=H(X,e.__scopePopover);return(0,R.jsx)(T,{present:r||a.open,children:a.modal?(0,R.jsx)(Fe,{...i,ref:t}):(0,R.jsx)(Ie,{...i,ref:t})})});Ne.displayName=X;var Pe=x(`PopoverContent.RemoveScroll`),Fe=L.forwardRef((e,t)=>{let n=H(X,e.__scopePopover),r=L.useRef(null),i=ne(t,r),a=L.useRef(!1);return L.useEffect(()=>{let e=r.current;if(e)return D(e)},[]),(0,R.jsx)(oe,{as:Pe,allowPinchZoom:!0,children:(0,R.jsx)(Le,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:y(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ie=L.forwardRef((e,t)=>{let n=H(X,e.__scopePopover),r=L.useRef(!1),i=L.useRef(!1);return(0,R.jsx)(Le,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Le=L.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=H(X,n),p=V(n);return ie(),(0,R.jsx)(ee,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(C,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,R.jsx)(he,{"data-state":He(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),Re=`PopoverClose`,ze=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=H(Re,n);return(0,R.jsx)(S.button,{type:`button`,...r,ref:t,onClick:y(e.onClick,()=>i.onOpenChange(!1))})});ze.displayName=Re;var Be=`PopoverArrow`,Ve=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=V(n);return(0,R.jsx)(me,{...i,...r,ref:t})});Ve.displayName=Be;function He(e){return e?`open`:`closed`}var Ue=U,We=G,Ge=q,Ke=Y,qe=Ne;function Je({...e}){return(0,R.jsx)(se,{"data-slot":`dialog`,...e})}function Ye({...e}){return(0,R.jsx)(E,{"data-slot":`dialog-portal`,...e})}function Xe({className:e,...t}){return(0,R.jsx)(ce,{"data-slot":`dialog-overlay`,className:v(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ze({className:e,children:t,showCloseButton:n=!0,...r}){return(0,R.jsxs)(Ye,{"data-slot":`dialog-portal`,children:[(0,R.jsx)(Xe,{}),(0,R.jsxs)(w,{"data-slot":`dialog-content`,className:v(`fixed top-[50%] left-[50%] z-50 grid w-full grid-cols-1 max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,R.jsxs)(O,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,R.jsx)(be,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Qe({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`dialog-header`,className:v(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function $e({className:e,showCloseButton:t=!1,children:n,...r}){return(0,R.jsxs)(`div`,{"data-slot":`dialog-footer`,className:v(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,R.jsx)(O,{asChild:!0,children:(0,R.jsx)(le,{variant:`outline`,children:`Close`})})]})}function et({className:e,...t}){return(0,R.jsx)(re,{"data-slot":`dialog-title`,className:v(`text-lg leading-none font-semibold`,e),...t})}function tt({className:e,...t}){return(0,R.jsx)(ae,{"data-slot":`dialog-description`,className:v(`text-sm text-muted-foreground`,e),...t})}var nt=(0,L.createContext)(null);function rt({children:e}){let[t,n]=(0,L.useState)(()=>new Map),r=(0,L.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,L.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=o((0,L.useMemo)(()=>[...t.values()].flat(),[t])),s=(0,L.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,R.jsx)(nt.Provider,{value:s,children:e})}var Z=(0,L.createContext)(null);function it({projectId:e,requests:t,children:n}){let r=(0,L.useContext)(nt),i=(0,L.useId)(),a=t.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`),s=r?.publish,c=r?.retract;(0,L.useEffect)(()=>{if(!(!s||!c))return s(i,t),()=>c(i)},[s,c,i,a]);let l=o(r?at:t),u=r?.lookup??l,d=(0,L.useMemo)(()=>({lookup:u,projectId:e}),[u,e]);return(0,R.jsx)(Z.Provider,{value:d,children:n})}var at=[];function ot(e,t,n){let r=(0,L.useContext)(Z),i=n??r?.projectId;return!r||!i||t===void 0?ct:r.lookup({projectId:i,kind:e,number:t})}function st(){let e=(0,L.useContext)(Z);return{lookup:e?.lookup??(()=>ct),projectId:e?.projectId}}var ct=Object.freeze({state:`idle`});function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function lt(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function ut(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function dt(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function ft(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(ut(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function pt(){let[e,t]=(0,L.useState)({top:0,bottom:0});return(0,L.useEffect)(()=>ft(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function mt(e){let t=(0,L.useRef)(e);t.current=e,(0,L.useEffect)(()=>{let e=document.documentElement;return lt(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}function ht({...e}){return(0,R.jsx)(Ue,{"data-slot":`popover`,...e})}function gt({...e}){return(0,R.jsx)(Ge,{"data-slot":`popover-trigger`,...e})}function _t({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,...i}){let a=pt();return(0,R.jsx)(Ke,{children:(0,R.jsx)(qe,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:dt(a,r),className:v(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i})})}function vt({...e}){return(0,R.jsx)(We,{"data-slot":`popover-anchor`,...e})}var yt={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,violet:`border-violet/35 text-violet`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},bt={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,violet:`hover:bg-violet/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},xt={draft:ve,"review-required":_e,"changes-requested":Oe,"checks-pending":null,"checks-failing":I,ready:j,merged:ge,closed:De,open:P,completed:j,"not-planned":F};function St({reference:e,taskTitle:t,status:n,conflicting:r,conflictAction:i,projectId:o,className:s,compact:c=!1}){let{kind:l,number:d,url:f}=e,p=ot(l,d,o),m=n??p.status,h=a(m),g=l===`PR`&&(r??p.conflicting)===!0,y=g?u:h,b=v(`inline-flex h-[22px] items-center gap-1 rounded-full border px-2 font-mono text-meta font-semibold`,yt[y?.tone??`violet`],s),x=Dt(p,y,g?h:void 0),S=d?`${!c&&l===`Issue`?`Issue `:``}#${d}`:l,C=l===`PR`?`pull request`:`issue`,w=`Open the ${C} for ${t}${y?` — ${y.label}`:``}`,T=(0,R.jsxs)(R.Fragment,{children:[g?(0,R.jsx)(ye,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,R.jsx)(kt,{status:y?m:void 0}),S]}),E=!f||!_(f)?(0,R.jsx)(`span`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":m,...g?{"data-conflicting":`true`}:{},"aria-label":y?`${C} ${S} — ${y.label}`:void 0,className:b,children:T}):(0,R.jsxs)(`a`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":m,...g?{"data-conflicting":`true`}:{},href:f,target:`_blank`,rel:`noopener noreferrer`,title:x?void 0:f,"aria-label":w,className:v(b,bt[y?.tone??`violet`]),children:[T,(0,R.jsx)(N,{className:`size-2.5`,"aria-hidden":`true`})]});if(!x)return E;let D=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`block font-medium`,children:[l===`PR`?`Pull request`:`Issue`,d?` #${d}`:``,` · `,x.headline]}),(0,R.jsx)(`span`,{className:`block`,children:x.detail}),x.also?(0,R.jsx)(`span`,{className:`block opacity-70`,children:x.also}):null,f&&_(f)?(0,R.jsx)(`span`,{className:`block opacity-70`,children:f.replace(/^https?:\/\//,``)}):null]});return(0,R.jsx)(Et,{chip:E,action:g?i:void 0,state:p.state,children:D})}var Ct=(0,L.createContext)(()=>{});function wt(){return(0,L.useContext)(Ct)}var Tt=150,$=120;function Et({chip:e,action:t,state:n,children:r}){let[i,a]=(0,L.useState)(!1),o=(0,L.useRef)(null),s=(0,L.useRef)(null),c=(0,L.useRef)(void 0),l=(0,L.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,L.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,L.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,R.jsxs)(ht,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,R.jsx)(vt,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,Tt)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,$)},onFocus:()=>a(!0),onBlur:e=>{d(e.relatedTarget)||u()},onKeyDown:e=>{if(e.key===`Escape`)return u();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,R.jsxs)(_t,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),d(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,$)},children:[(0,R.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,R.jsx)(Ct.Provider,{value:u,children:t}):null]})]})}function Dt(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${Ot(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function Ot(e){return e.charAt(0).toLowerCase()+e.slice(1)}function kt({status:e}){if(!e)return null;if(e===`checks-pending`)return(0,R.jsx)(xe,{tone:`pending`,pulse:!0,className:`size-[6px]`,"aria-hidden":`true`});let t=xt[e];return t?(0,R.jsx)(t,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null}function At(e,t=!0){let[n,r]=L.useState(()=>Date.now());return L.useEffect(()=>{if(!t)return;let n=setInterval(()=>r(Date.now()),e);return()=>clearInterval(n)},[e,t]),n}export{M as C,Ce as D,Te as E,Se as O,N as S,we as T,Qe as _,vt as a,F as b,mt as c,ot as d,st as f,$e as g,tt as h,ht as i,it as l,Ze as m,St as n,_t as o,Je as p,wt as r,gt as s,At as t,rt as u,et as v,Ee as w,P as x,I as y};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ai as r,ao as i,ar as a,at as o,ci as s,co as c,hr as l,ir as u,ki as d,li as f,oo as p,so as m,uo as h}from"./queries-DbDUaheq.js";import{c as g,n as _,t as v}from"./utils-Bl_tQdVw.js";import{C as y,N as b,O as x,T as S,_ as C,a as w,b as T,c as E,f as D,g as ee,h as te,i as O,j as ne,l as re,m as ie,o as ae,p as oe,r as se,s as ce,t as le,w as ue,x as de,y as fe}from"./button-jcXhXi-5.js";import{a as k,i as pe,n as me,r as he,t as A}from"./dist-C2IyLYZs.js";import{t as j}from"./circle-check-C09e7mFj.js";import{n as ge,t as _e}from"./git-pull-request-BAfSEvVb.js";import{t as ve}from"./git-pull-request-draft-BIgZJsu-.js";import{t as ye}from"./triangle-alert-CBrg6nYB.js";import{t as be}from"./x-Qhn_uE86.js";import{n as xe}from"./token-metrics-BINGXGrg.js";var M={all:(e=g())=>[`worktree-lifecycle`,e],list:(e=g())=>[...M.all(e),`list`],detail:(e,t=g())=>[...M.all(t),`worktree`,e],operation:(e,t=g())=>[...M.all(t),`operation`,e],output:(e,t=g())=>[...M.all(t),`output`,e]};function Se(){return i(),c({queryKey:M.list(),queryFn:async({signal:e})=>{let t=await d({limit:100},{signal:e}),n=new Map(t.worktrees.map(e=>[e.worktreeId,e])),r=new Set,i=t.nextCursor;for(;i&&!r.has(i);){r.add(i);let t=await d({limit:100,cursor:i},{signal:e});for(let e of t.worktrees)n.set(e.worktreeId,e);i=t.nextCursor}return{worktrees:[...n.values()]}}})}function Ce(e,t=!0){return i(),c({queryKey:M.detail(e),enabled:t,queryFn:({signal:t})=>r(e,{signal:t})})}function we(e){return i(),c({queryKey:M.operation(e),queryFn:({signal:t})=>s(e,{signal:t})})}function Te(e,t){return i(),p({queryKey:M.output(e),enabled:t,initialPageParam:0,queryFn:({signal:t,pageParam:n})=>f(e,n,{signal:t}),getNextPageParam:e=>e.items.length>=100?e.nextSeq:void 0,maxPages:5})}function Ee(e){let t=h();i();let n=g();return m({mutationFn:t=>l(e,t),onSuccess:r=>{t.setQueryData(M.operation(e,n),r),t.invalidateQueries({queryKey:M.all(n)}),t.invalidateQueries({queryKey:[`runs`,n]}),t.invalidateQueries({queryKey:[`worktrees`,n]})},onError:()=>{t.invalidateQueries({queryKey:M.operation(e,n)})}})}var N=b(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=b(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),F=b(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),I=b(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),De=b(`git-pull-request-closed`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`m21 3-6 6`,key:`16nqsk`}],[`path`,{d:`m21 9-6-6`,key:`9j17rh`}],[`path`,{d:`M18 11.5V15`,key:`65xf6f`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),Oe=b(`message-square-warning`,[[`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`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),L=e(t(),1),R=n(),z=`Popover`,[B,ke]=ue(z,[k]),V=k(),[Ae,H]=B(z),U=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=V(t),c=L.useRef(null),[l,u]=L.useState(!1),[d,f]=de({prop:r,defaultProp:i??!1,onChange:a,caller:z});return(0,R.jsx)(pe,{...s,children:(0,R.jsx)(Ae,{scope:t,contentId:fe(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:L.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:L.useCallback(()=>u(!0),[]),onCustomAnchorRemove:L.useCallback(()=>u(!1),[]),modal:o,children:n})})};U.displayName=z;var W=`PopoverAnchor`,G=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=H(W,n),a=V(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return L.useEffect(()=>(o(),()=>s()),[o,s]),(0,R.jsx)(A,{...a,...r,ref:t})});G.displayName=W;var K=`PopoverTrigger`,q=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=H(K,n),a=V(n),o=ne(t,i.triggerRef),s=(0,R.jsx)(S.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":He(i.open),...r,ref:o,onClick:y(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(A,{asChild:!0,...a,children:s})});q.displayName=K;var J=`PopoverPortal`,[je,Me]=B(J,{forceMount:void 0}),Y=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=H(J,t);return(0,R.jsx)(je,{scope:t,forceMount:n,children:(0,R.jsx)(T,{present:n||a.open,children:(0,R.jsx)(te,{asChild:!0,container:i,children:r})})})};Y.displayName=J;var X=`PopoverContent`,Ne=L.forwardRef((e,t)=>{let n=Me(X,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=H(X,e.__scopePopover);return(0,R.jsx)(T,{present:r||a.open,children:a.modal?(0,R.jsx)(Fe,{...i,ref:t}):(0,R.jsx)(Ie,{...i,ref:t})})});Ne.displayName=X;var Pe=x(`PopoverContent.RemoveScroll`),Fe=L.forwardRef((e,t)=>{let n=H(X,e.__scopePopover),r=L.useRef(null),i=ne(t,r),a=L.useRef(!1);return L.useEffect(()=>{let e=r.current;if(e)return D(e)},[]),(0,R.jsx)(oe,{as:Pe,allowPinchZoom:!0,children:(0,R.jsx)(Le,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:y(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ie=L.forwardRef((e,t)=>{let n=H(X,e.__scopePopover),r=L.useRef(!1),i=L.useRef(!1);return(0,R.jsx)(Le,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Le=L.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=H(X,n),p=V(n);return ie(),(0,R.jsx)(ee,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(C,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,R.jsx)(he,{"data-state":He(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),Re=`PopoverClose`,ze=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=H(Re,n);return(0,R.jsx)(S.button,{type:`button`,...r,ref:t,onClick:y(e.onClick,()=>i.onOpenChange(!1))})});ze.displayName=Re;var Be=`PopoverArrow`,Ve=L.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=V(n);return(0,R.jsx)(me,{...i,...r,ref:t})});Ve.displayName=Be;function He(e){return e?`open`:`closed`}var Ue=U,We=G,Ge=q,Ke=Y,qe=Ne;function Je({...e}){return(0,R.jsx)(se,{"data-slot":`dialog`,...e})}function Ye({...e}){return(0,R.jsx)(E,{"data-slot":`dialog-portal`,...e})}function Xe({className:e,...t}){return(0,R.jsx)(ce,{"data-slot":`dialog-overlay`,className:v(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Ze({className:e,children:t,showCloseButton:n=!0,...r}){return(0,R.jsxs)(Ye,{"data-slot":`dialog-portal`,children:[(0,R.jsx)(Xe,{}),(0,R.jsxs)(w,{"data-slot":`dialog-content`,className:v(`fixed top-[50%] left-[50%] z-50 grid w-full grid-cols-1 max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,R.jsxs)(O,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,R.jsx)(be,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Qe({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`dialog-header`,className:v(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function $e({className:e,showCloseButton:t=!1,children:n,...r}){return(0,R.jsxs)(`div`,{"data-slot":`dialog-footer`,className:v(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,R.jsx)(O,{asChild:!0,children:(0,R.jsx)(le,{variant:`outline`,children:`Close`})})]})}function et({className:e,...t}){return(0,R.jsx)(re,{"data-slot":`dialog-title`,className:v(`text-lg leading-none font-semibold`,e),...t})}function tt({className:e,...t}){return(0,R.jsx)(ae,{"data-slot":`dialog-description`,className:v(`text-sm text-muted-foreground`,e),...t})}var nt=(0,L.createContext)(null);function rt({children:e}){let[t,n]=(0,L.useState)(()=>new Map),r=(0,L.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,L.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=o((0,L.useMemo)(()=>[...t.values()].flat(),[t])),s=(0,L.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,R.jsx)(nt.Provider,{value:s,children:e})}var Z=(0,L.createContext)(null);function it({projectId:e,requests:t,children:n}){let r=(0,L.useContext)(nt),i=(0,L.useId)(),a=t.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`),s=r?.publish,c=r?.retract;(0,L.useEffect)(()=>{if(!(!s||!c))return s(i,t),()=>c(i)},[s,c,i,a]);let l=o(r?at:t),u=r?.lookup??l,d=(0,L.useMemo)(()=>({lookup:u,projectId:e}),[u,e]);return(0,R.jsx)(Z.Provider,{value:d,children:n})}var at=[];function ot(e,t,n){let r=(0,L.useContext)(Z),i=n??r?.projectId;return!r||!i||t===void 0?ct:r.lookup({projectId:i,kind:e,number:t})}function st(){let e=(0,L.useContext)(Z);return{lookup:e?.lookup??(()=>ct),projectId:e?.projectId}}var ct=Object.freeze({state:`idle`});function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function lt(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function ut(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function dt(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function ft(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(ut(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function pt(){let[e,t]=(0,L.useState)({top:0,bottom:0});return(0,L.useEffect)(()=>ft(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function mt(e){let t=(0,L.useRef)(e);t.current=e,(0,L.useEffect)(()=>{let e=document.documentElement;return lt(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}function ht({...e}){return(0,R.jsx)(Ue,{"data-slot":`popover`,...e})}function gt({...e}){return(0,R.jsx)(Ge,{"data-slot":`popover-trigger`,...e})}function _t({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,...i}){let a=pt();return(0,R.jsx)(Ke,{children:(0,R.jsx)(qe,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:dt(a,r),className:v(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i})})}function vt({...e}){return(0,R.jsx)(We,{"data-slot":`popover-anchor`,...e})}var yt={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,violet:`border-violet/35 text-violet`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},bt={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,violet:`hover:bg-violet/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},xt={draft:ve,"review-required":_e,"changes-requested":Oe,"checks-pending":null,"checks-failing":I,ready:j,merged:ge,closed:De,open:P,completed:j,"not-planned":F};function St({reference:e,taskTitle:t,status:n,conflicting:r,conflictAction:i,projectId:o,className:s,compact:c=!1}){let{kind:l,number:d,url:f}=e,p=ot(l,d,o),m=n??p.status,h=a(m),g=l===`PR`&&(r??p.conflicting)===!0,y=g?u:h,b=v(`inline-flex h-[22px] items-center gap-1 rounded-full border px-2 font-mono text-meta font-semibold`,yt[y?.tone??`violet`],s),x=Dt(p,y,g?h:void 0),S=d?`${!c&&l===`Issue`?`Issue `:``}#${d}`:l,C=l===`PR`?`pull request`:`issue`,w=`Open the ${C} for ${t}${y?` — ${y.label}`:``}`,T=(0,R.jsxs)(R.Fragment,{children:[g?(0,R.jsx)(ye,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,R.jsx)(kt,{status:y?m:void 0}),S]}),E=!f||!_(f)?(0,R.jsx)(`span`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":m,...g?{"data-conflicting":`true`}:{},"aria-label":y?`${C} ${S} — ${y.label}`:void 0,className:b,children:T}):(0,R.jsxs)(`a`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":m,...g?{"data-conflicting":`true`}:{},href:f,target:`_blank`,rel:`noopener noreferrer`,title:x?void 0:f,"aria-label":w,className:v(b,bt[y?.tone??`violet`]),children:[T,(0,R.jsx)(N,{className:`size-2.5`,"aria-hidden":`true`})]});if(!x)return E;let D=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`block font-medium`,children:[l===`PR`?`Pull request`:`Issue`,d?` #${d}`:``,` · `,x.headline]}),(0,R.jsx)(`span`,{className:`block`,children:x.detail}),x.also?(0,R.jsx)(`span`,{className:`block opacity-70`,children:x.also}):null,f&&_(f)?(0,R.jsx)(`span`,{className:`block opacity-70`,children:f.replace(/^https?:\/\//,``)}):null]});return(0,R.jsx)(Et,{chip:E,action:g?i:void 0,state:p.state,children:D})}var Ct=(0,L.createContext)(()=>{});function wt(){return(0,L.useContext)(Ct)}var Tt=150,$=120;function Et({chip:e,action:t,state:n,children:r}){let[i,a]=(0,L.useState)(!1),o=(0,L.useRef)(null),s=(0,L.useRef)(null),c=(0,L.useRef)(void 0),l=(0,L.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,L.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,L.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,R.jsxs)(ht,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,R.jsx)(vt,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,Tt)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,$)},onFocus:()=>a(!0),onBlur:e=>{d(e.relatedTarget)||u()},onKeyDown:e=>{if(e.key===`Escape`)return u();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,R.jsxs)(_t,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),d(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,$)},children:[(0,R.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,R.jsx)(Ct.Provider,{value:u,children:t}):null]})]})}function Dt(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${Ot(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function Ot(e){return e.charAt(0).toLowerCase()+e.slice(1)}function kt({status:e}){if(!e)return null;if(e===`checks-pending`)return(0,R.jsx)(xe,{tone:`pending`,pulse:!0,className:`size-[6px]`,"aria-hidden":`true`});let t=xt[e];return t?(0,R.jsx)(t,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null}function At(e,t=!0){let[n,r]=L.useState(()=>Date.now());return L.useEffect(()=>{if(!t)return;let n=setInterval(()=>r(Date.now()),e);return()=>clearInterval(n)},[e,t]),n}export{M as C,Ce as D,Te as E,Se as O,N as S,we as T,Qe as _,vt as a,F as b,mt as c,ot as d,st as f,$e as g,tt as h,ht as i,it as l,Ze as m,St as n,_t as o,Je as p,wt as r,gt as s,At as t,rt as u,et as v,Ee as w,P as x,I as y};
@@ -1 +1 @@
1
- import{N as e}from"./button-DhBNRPDb.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),n=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);function r(e){return!(e.key!==`Enter`||e.shiftKey||e.altKey||e.repeat||e.isComposing)}function i(e=typeof navigator>`u`?``:navigator.platform){return/mac|iphone|ipad|ipod/i.test(e)?`⌘↵`:`Ctrl+↵`}export{t as i,i as n,n as r,r as t};
1
+ import{N as e}from"./button-jcXhXi-5.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),n=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);function r(e){return!(e.key!==`Enter`||e.shiftKey||e.altKey||e.repeat||e.isComposing)}function i(e=typeof navigator>`u`?``:navigator.platform){return/mac|iphone|ipad|ipod/i.test(e)?`⌘↵`:`Ctrl+↵`}export{t as i,i as n,n as r,r as t};