@hearsay-tools/squawk 0.18.0-pr4108.7872 → 0.18.0-pr4109.7875

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 (165) hide show
  1. package/dist/server/brand-file-routes.d.ts +1 -1
  2. package/dist/server/server.d.ts +477 -477
  3. package/dist/server/server.js +28 -26
  4. package/dist/server/server.js.map +1 -1
  5. package/dist/workflows/attachment-path.d.ts +0 -2
  6. package/dist/workflows/attachment-path.js +0 -21
  7. package/dist/workflows/attachment-path.js.map +1 -1
  8. package/package.json +4 -4
  9. package/web/dist/assets/accounts-section-y3LTFLgc.js +1 -0
  10. package/web/dist/assets/activity-motion-D_YA5y3w.js +2 -0
  11. package/web/dist/assets/activity-route-v_h0ReWY.js +1 -0
  12. package/web/dist/assets/agent-config-section-CXP4urrc.js +4 -0
  13. package/web/dist/assets/agent-defaults-section-BqZzdMaf.js +1 -0
  14. package/web/dist/assets/agents-settings-path-7X6_cvUg.js +1 -0
  15. package/web/dist/assets/appearance-Czq53glN.js +1 -0
  16. package/web/dist/assets/archive-on-merge-field-w_cfxV6m.js +1 -0
  17. package/web/dist/assets/attention-BMiaqJnx.js +1 -0
  18. package/web/dist/assets/automation-format-1lHzRTbq.js +1 -0
  19. package/web/dist/assets/automations-route-i2GvbtsA.js +1 -0
  20. package/web/dist/assets/badge-D9JrXe0o.js +1 -0
  21. package/web/dist/assets/bot-TkDIw4y-.js +1 -0
  22. package/web/dist/assets/bundle-mjs-rHxsej31.js +1 -0
  23. package/web/dist/assets/button-BQ2y4XRB.js +1 -0
  24. package/web/dist/assets/centered-state-V15AR_qo.js +1 -0
  25. package/web/dist/assets/chevron-down-CHGyCDBH.js +1 -0
  26. package/web/dist/assets/chevron-right-BENZ-1ZN.js +1 -0
  27. package/web/dist/assets/{chunk-BO2N2NFS-y7WHTKOf.js → chunk-BO2N2NFS-DQrpGzb-.js} +4 -4
  28. package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +3 -0
  29. package/web/dist/assets/collapsible-BEV4FO-1.js +1 -0
  30. package/web/dist/assets/command-Cpm_oVYQ.js +1 -0
  31. package/web/dist/assets/commit-diff-panel-AyKv5AAT.js +1 -0
  32. package/web/dist/assets/dialog-Wfxu1s27.js +1 -0
  33. package/web/dist/assets/diff-CSRy4BhS.js +3 -0
  34. package/web/dist/assets/diff-controls-CKvZO4lB.js +1 -0
  35. package/web/dist/assets/{diff-view-CHj5zMlT.js → diff-view-BSLcXskg.js} +4 -4
  36. package/web/dist/assets/dist-BAoXdNsT.js +1 -0
  37. package/web/dist/assets/dist-BW234Kg5.js +1 -0
  38. package/web/dist/assets/dist-C28wFbz0.js +1 -0
  39. package/web/dist/assets/dist-C5mlVBmd.js +1 -0
  40. package/web/dist/assets/dist-DXO3xwbC.js +1 -0
  41. package/web/dist/assets/dist-Da4ckcJG.js +1 -0
  42. package/web/dist/assets/dropdown-menu-fxMl6nn-.js +1 -0
  43. package/web/dist/assets/es2015-CQth82uv.js +41 -0
  44. package/web/dist/assets/external-link-BE6y205O.js +1 -0
  45. package/web/dist/assets/file-preview-DdHnbBLm.js +2 -0
  46. package/web/dist/assets/folder-browser-CH0gdxd-.js +1 -0
  47. package/web/dist/assets/folder-o-AvL3y3.js +1 -0
  48. package/web/dist/assets/git-toolbar-s2EyRIND.js +1 -0
  49. package/web/dist/assets/github-am7B1OTU.js +1 -0
  50. package/web/dist/assets/global-activity-route-CJVvEpCb.js +1 -0
  51. package/web/dist/assets/{highlighted-body-OFNGDK62-D62LjTH2.js → highlighted-body-OFNGDK62-Cx8MiNVZ.js} +1 -1
  52. package/web/dist/assets/highlighter-DvLzHjjY.js +3 -0
  53. package/web/dist/assets/{image-preview-2AnVvt0e.js → image-preview-CNBuRrK5.js} +1 -1
  54. package/web/dist/assets/index-B4yxoEJK.js +21 -0
  55. package/web/dist/assets/index-F-X4qZSv.css +1 -0
  56. package/web/dist/assets/label-D6DhdNb7.js +1 -0
  57. package/web/dist/assets/markdown-DVb15xv0.js +4 -0
  58. package/web/dist/assets/mermaid-GHXKKRXX-lTc_AjAC.js +1 -0
  59. package/web/dist/assets/moon-CRE9nU5R.js +1 -0
  60. package/web/dist/assets/nav-row-styles-DqKjMToI.js +1 -0
  61. package/web/dist/assets/notifications-section-3ArK0PKI.js +1 -0
  62. package/web/dist/assets/open-in-menu-DM29fYWS.js +1 -0
  63. package/web/dist/assets/own-lookup-DS54wXvD.js +1 -0
  64. package/web/dist/assets/popover-BPgUYFyu.js +1 -0
  65. package/web/dist/assets/preload-helper-Czpn1I53.js +1 -0
  66. package/web/dist/assets/preview-pane-connected-BA3Xqyyf.js +3 -0
  67. package/web/dist/assets/project-location-DQNVSiTC.js +1 -0
  68. package/web/dist/assets/project-order-AcHI4Dcl.js +1 -0
  69. package/web/dist/assets/project-rail-sortable-BmVI4_-T.js +1 -0
  70. package/web/dist/assets/project-router-UyyzK1j2.js +1 -0
  71. package/web/dist/assets/project-scope-context-BRvkKGX1.js +4 -0
  72. package/web/dist/assets/projects-section-D1DPpRSr.js +1 -0
  73. package/web/dist/assets/prompt-templates-section-DOC9iQqi.js +1 -0
  74. package/web/dist/assets/queries-CQWAcH8p.js +1 -0
  75. package/web/dist/assets/reference-chip-C-DmYlZO.js +1 -0
  76. package/web/dist/assets/remote-settings-notice-COH_7lIO.js +1 -0
  77. package/web/dist/assets/repo-git-c0kuphG9.js +1 -0
  78. package/web/dist/assets/report-reader-LKXvj1v7.js +1 -0
  79. package/web/dist/assets/reports-daEsNHH0.js +1 -0
  80. package/web/dist/assets/resources-section-Dl94Cd3B.js +1 -0
  81. package/web/dist/assets/run-header-CmnwrNSD.js +2 -0
  82. package/web/dist/assets/{runners-CKrq5tR_.js → runners-BFhbiSKy.js} +1 -1
  83. package/web/dist/assets/settings-agent-picker-BFbzdgyZ.js +1 -0
  84. package/web/dist/assets/settings-field-Bl6WuvGX.js +1 -0
  85. package/web/dist/assets/settings-shell-BrJuWWQC.js +1 -0
  86. package/web/dist/assets/settings-shell-xK8txSJo.css +1 -0
  87. package/web/dist/assets/sidebar-section-CYKz48EO.js +1 -0
  88. package/web/dist/assets/skills-IrX-lpGi.js +1 -0
  89. package/web/dist/assets/smartphone-Lr8Ug2z_.js +1 -0
  90. package/web/dist/assets/sortable.esm-CAVTYaA3.js +5 -0
  91. package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
  92. package/web/dist/assets/status-dot-DtAOFiIi.js +1 -0
  93. package/web/dist/assets/switch-Bv2Zf1uU.js +1 -0
  94. package/web/dist/assets/tab-link-BmEGnV4R.js +1 -0
  95. package/web/dist/assets/task-changes-1drYHOCN.js +1 -0
  96. package/web/dist/assets/task-commits-CUB3Qk1T.js +1 -0
  97. package/web/dist/assets/task-files-BT0-2aQV.js +1 -0
  98. package/web/dist/assets/task-github-item-lnSyjUng.js +1 -0
  99. package/web/dist/assets/task-groups-Dc7pXgaS.js +1 -0
  100. package/web/dist/assets/task-thread-BH5sL4uL.js +9 -0
  101. package/web/dist/assets/tasks-table-lb5Dy-8O.js +1 -0
  102. package/web/dist/assets/textarea-vJt9undk.js +1 -0
  103. package/web/dist/assets/thread-state-DVsa_E90.js +4 -0
  104. package/web/dist/assets/toaster-Bo5vCbz-.js +1 -0
  105. package/web/dist/assets/use-hand-to-agent-state-CBtuQE84.js +1 -0
  106. package/web/dist/assets/{useInfiniteQuery-BdIIhzMI.js → useInfiniteQuery-rgb-nitU.js} +1 -1
  107. package/web/dist/assets/useQuery-SVV6EtG7.js +1 -0
  108. package/web/dist/assets/utils-DSMR_WLb.js +1 -0
  109. package/web/dist/assets/workflows-JwmUoU0N.js +7 -0
  110. package/web/dist/assets/workspace-tools-aTvE2ahi.js +1 -0
  111. package/web/dist/assets/worktrees-section-BMdpFUOk.js +4 -0
  112. package/web/dist/assets/{ws-DiWUfn_t.js → ws-D3-jE1IB.js} +1 -1
  113. package/web/dist/assets/zoomable-image-CIQl1Wpe.js +1 -0
  114. package/web/dist/index.html +49 -25
  115. package/dist/server/static-assets.d.ts +0 -5
  116. package/dist/server/static-assets.js +0 -109
  117. package/dist/server/static-assets.js.map +0 -1
  118. package/web/dist/assets/activity-motion-BNen0Yj8.js +0 -2
  119. package/web/dist/assets/activity-route-BGQMI1Yu.js +0 -1
  120. package/web/dist/assets/attention-B0IBc2_D.js +0 -1
  121. package/web/dist/assets/bundle-mjs-BT31bpU6.js +0 -1
  122. package/web/dist/assets/button-C1fD-ZFr.js +0 -3
  123. package/web/dist/assets/centered-state-CiiA8Vgw.js +0 -1
  124. package/web/dist/assets/commit-diff-panel-Cr-XVbz_.js +0 -1
  125. package/web/dist/assets/dialog-DSwzMeY3.js +0 -1
  126. package/web/dist/assets/diff-DqLaONaB.js +0 -3
  127. package/web/dist/assets/diff-controls-C8aqhty4.js +0 -1
  128. package/web/dist/assets/dist-Du8mGhoH.js +0 -1
  129. package/web/dist/assets/dropdown-menu-D4zMgwkC.js +0 -1
  130. package/web/dist/assets/es2015-Ch36azR0.js +0 -41
  131. package/web/dist/assets/file-preview-C9yv3267.js +0 -2
  132. package/web/dist/assets/git-toolbar-uHPKACQa.js +0 -1
  133. package/web/dist/assets/github-Fy6-Zf4b.js +0 -1
  134. package/web/dist/assets/global-activity-route-CpAGVfbb.js +0 -1
  135. package/web/dist/assets/index-DXvh46tl.css +0 -1
  136. package/web/dist/assets/index-Dn02NPUV.js +0 -14
  137. package/web/dist/assets/markdown-9j2EqN9q.js +0 -4
  138. package/web/dist/assets/mermaid-GHXKKRXX-C7OP146z.js +0 -1
  139. package/web/dist/assets/nav-row-styles-CFjnD-9J.js +0 -1
  140. package/web/dist/assets/picker-pill-D8SyrTxD.js +0 -15
  141. package/web/dist/assets/preview-pane-connected-CBKK0crt.js +0 -3
  142. package/web/dist/assets/project-router-CcyPWtFH.js +0 -1
  143. package/web/dist/assets/project-scope-context-CX36ze1Q.js +0 -4
  144. package/web/dist/assets/prompt-template-menu-DT_0Pyd5.js +0 -1
  145. package/web/dist/assets/queries-Cb76PEoL.js +0 -1
  146. package/web/dist/assets/reference-chip-DwiE3MIR.js +0 -1
  147. package/web/dist/assets/repo-git-CjKFvYdb.js +0 -1
  148. package/web/dist/assets/report-reader--BXJs1DJ.js +0 -1
  149. package/web/dist/assets/reports-CZw5ztdC.js +0 -1
  150. package/web/dist/assets/run-header-BOEjnB1z.js +0 -2
  151. package/web/dist/assets/skills-aBp_7vVU.js +0 -1
  152. package/web/dist/assets/sortable.esm-zp_qkYGV.js +0 -5
  153. package/web/dist/assets/tab-link-Dn7KFNYr.js +0 -1
  154. package/web/dist/assets/task-changes-B0u392zf.js +0 -1
  155. package/web/dist/assets/task-commits-DzWFfo43.js +0 -1
  156. package/web/dist/assets/task-files-DTWfdMRi.js +0 -1
  157. package/web/dist/assets/task-github-item-CFWE3MpX.js +0 -1
  158. package/web/dist/assets/task-thread-vYwAvLtU.js +0 -9
  159. package/web/dist/assets/thread-state-zGEm4Ym4.js +0 -4
  160. package/web/dist/assets/toaster-Cxgzn9ip.js +0 -1
  161. package/web/dist/assets/use-desktop-DN7wbSS7.js +0 -1
  162. package/web/dist/assets/use-hand-to-agent-state-C9YTgLEG.js +0 -1
  163. package/web/dist/assets/useQuery-Dg1rzYtR.js +0 -1
  164. package/web/dist/assets/workflows-C8EnR0NU.js +0 -7
  165. package/web/dist/assets/zoomable-image-DrDnCL4V.js +0 -1
@@ -1,41 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i,s as a}from"./button-C1fD-ZFr.js";var o=e(t(),1),s=e(n(),1),c=r(),l=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=i(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function u(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}function d(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,l=n?.[e]?.[a]||i,u=o.useMemo(()=>s,Object.values(s));return(0,c.jsx)(l.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function l(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,f(i,...t)]}function f(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var m=globalThis?.document?o.useLayoutEffect:()=>{},h=o.useInsertionEffect||m;function g({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=_({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=v(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function _({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return h(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function v(e){return typeof e==`function`}function y(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var b=e=>{let{present:t,children:n}=e,r=x(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=C(r.ref,ee(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};b.displayName=`Presence`;function x(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=y(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??w(r.current),s.current=void 0):a.current=`none`},[c]),m(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=w(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),m(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=w(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=w(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=w(t)}else r.current=null;n(e)},[])}}function S(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function C(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=S(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():S(n[e],null)}}},[])}function w(e){return e?.animationName||`none`}function ee(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var T=o.useId||(()=>void 0),E=0;function te(e){let[t,n]=o.useState(T());return m(()=>{e||n(e=>e??String(E++))},[e]),e||(t?`radix-${t}`:``)}function D(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}var ne=`DismissableLayer`,O=`dismissableLayer.update`,k=`dismissableLayer.pointerDownOutside`,A=`dismissableLayer.focusOutside`,re,j=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ie=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...m}=e,h=o.useContext(j),[g,_]=o.useState(null),v=g?.ownerDocument??globalThis?.document,[,y]=o.useState({}),b=a(t,_),x=Array.from(h.layers),[S]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S?x.indexOf(S):-1,w=g?x.indexOf(g):-1,ee=h.layersWithOutsidePointerEventsDisabled.size>0,T=w>=C,E=o.useRef(!1),te=le(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return T&&!t},[h.branches,T])}),ne=ue(e=>{if(r&&E.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},v),k=g?w===x.length-1:!1,A=D(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return o.useEffect(()=>{if(k)return v.addEventListener(`keydown`,A,{capture:!0}),()=>v.removeEventListener(`keydown`,A,{capture:!0})},[v,k,A]),o.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(re=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),de(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=re))}},[g,v,n,h]),o.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),de())},[g,h]),o.useEffect(()=>{let e=()=>y({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),(0,c.jsx)(l.div,{...m,ref:b,style:{pointerEvents:ee?T?`auto`:`none`:void 0,...e.style},onFocusCapture:p(e.onFocusCapture,ne.onFocusCapture),onBlurCapture:p(e.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:p(e.onPointerDownCapture,te.onPointerDownCapture)})});ie.displayName=ne;var ae=`DismissableLayerBranch`,oe=o.forwardRef((e,t)=>{let n=o.useContext(j),r=o.useRef(null),i=a(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,c.jsx)(l.div,{...e,ref:i})});oe.displayName=ae;function se(){let e=o.useContext(j),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ce=()=>!0;function le(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ce}=t,c=D(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||fe(k,c,p,{discrete:!0})};if(!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:()=>l.current=!0}}function ue(e,t=globalThis?.document){let n=D(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&fe(A,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){let e=new CustomEvent(O);document.dispatchEvent(e)}function fe(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?u(i,a):i.dispatchEvent(a)}var M=`focusScope.autoFocusOnMount`,N=`focusScope.autoFocusOnUnmount`,pe={bubbles:!1,cancelable:!0},me=`FocusScope`,he=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=e,[d,f]=o.useState(null),p=D(i),m=D(s),h=o.useRef(null),g=a(t,f),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(_.paused||!d)return;let t=e.target;d.contains(t)?h.current=t:P(h.current,{select:!0})},t=function(e){if(_.paused||!d)return;let t=e.relatedTarget;t!==null&&(d.contains(t)||P(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&P(d)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return d&&r.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,d,_.paused]),o.useEffect(()=>{if(d){Se.add(_);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(M,pe);d.addEventListener(M,p),d.dispatchEvent(t),t.defaultPrevented||(ge(Te(ve(d)),{select:!0}),document.activeElement===e&&P(d))}return()=>{d.removeEventListener(M,p),setTimeout(()=>{let t=new CustomEvent(N,pe);d.addEventListener(N,m),d.dispatchEvent(t),t.defaultPrevented||P(e??document.body,{select:!0}),d.removeEventListener(N,m),Se.remove(_)},0)}}},[d,p,m,_]);let v=o.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=_e(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&P(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&P(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,c.jsx)(l.div,{tabIndex:-1,...u,ref:g,onKeyDown:v})});he.displayName=me;function ge(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(P(r,{select:t}),document.activeElement!==n)return}function _e(e){let t=ve(e);return[ye(t,e),ye(t.reverse(),e)]}function ve(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):be(r,{upTo:t})))return r}function be(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function xe(e){return e instanceof HTMLInputElement&&`select`in e}function P(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xe(e)&&t&&e.select()}}var Se=Ce();function Ce(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=we(e,t),e.unshift(t)},remove(t){e=we(e,t),e[0]?.resume()}}}function we(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Te(e){return e.filter(e=>e.tagName!==`A`)}var Ee=`Portal`,De=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);m(()=>a(!0),[]);let u=n||i&&globalThis?.document?.body;return u?s.createPortal((0,c.jsx)(l.div,{...r,ref:t}),u):null});De.displayName=Ee;var F=0,I=null;function Oe(){o.useEffect(()=>{I||={start:ke(),end:ke()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}function ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function Ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function je(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var R=`right-scroll-bar-position`,z=`width-before-scroll-bar`,Me=`with-scroll-bars-hidden`,Ne=`--removed-body-scroll-bar-size`;function B(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pe(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fe=typeof window<`u`?o.useLayoutEffect:o.useEffect,Ie=new WeakMap;function Le(e,t){var n=Pe(t||null,function(t){return e.forEach(function(e){return B(e,t)})});return Fe(function(){var t=Ie.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||B(e,null)}),i.forEach(function(e){r.has(e)||B(e,a)})}Ie.set(n,e)},[e]),n}function Re(e){return e}function ze(e,t){t===void 0&&(t=Re);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Be(e){e===void 0&&(e={});var t=ze(null);return t.options=L({async:!0,ssr:!1},e),t}var Ve=function(e){var t=e.sideCar,n=Ae(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,L({},n))};Ve.isSideCarExport=!0;function He(e,t){return e.useMedium(t),Ve}var Ue=Be(),V=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:V,onWheelCapture:V,onTouchMoveCapture:V}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Le([n,t]),w=L(L({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Ue,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),L(L({},w),{ref:C})):o.createElement(y,L({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:z,zeroRight:R};var We,Ge=function(){if(We)return We;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ke(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ge();return t&&e.setAttribute(`nonce`,t),e}function qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Je(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ke())&&(qe(t,n),Je(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xe=function(){var e=Ye();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ze=function(){var e=Xe();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qe={left:0,top:0,right:0,gap:0},U=function(e){return parseInt(e||``,10)||0},$e=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[U(n),U(r),U(i)]},et=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Qe;var t=$e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tt=Ze(),W=`data-scroll-locked`,nt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${Me} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${W}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${R} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${z} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${R} .${R} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${z} .${z} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${W}] {
36
- ${Ne}: ${s}px;
37
- }
38
- `},rt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},it=function(){o.useEffect(function(){return document.body.setAttribute(W,(rt()+1).toString()),function(){var e=rt()-1;e<=0?document.body.removeAttribute(W):document.body.setAttribute(W,e.toString())}},[])},at=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;it();var a=o.useMemo(function(){return et(i)},[i]);return o.createElement(tt,{styles:nt(a,!t,i,n?``:`!important`)})},G=!1;if(typeof window<`u`)try{var K=Object.defineProperty({},"passive",{get:function(){return G=!0,!0}});window.addEventListener(`test`,K,K),window.removeEventListener(`test`,K,K)}catch{G=!1}var q=G?{passive:!1}:!1,ot=function(e){return e.tagName===`TEXTAREA`},st=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ot(e)&&n[t]===`visible`)},ct=function(e){return st(e,`overflowY`)},lt=function(e){return st(e,`overflowX`)},ut=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),pt(e,r)){var i=mt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ft=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},pt=function(e,t){return e===`v`?ct(t):lt(t)},mt=function(e,t){return e===`v`?dt(t):ft(t)},ht=function(e,t){return e===`h`&&t===`rtl`?-1:1},gt=function(e,t,n,r,i){var a=ht(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=mt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&pt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},J=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_t=function(e){return[e.deltaX,e.deltaY]},vt=function(e){return e&&`current`in e?e.current:e},yt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bt=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},xt=0,Y=[];function St(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(xt++)[0],a=o.useState(Ze)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=je([e.lockRef.current],(e.shards||[]).map(vt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=J(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ut(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ut(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return gt(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?_t(n):J(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&yt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var o=(s.current.shards||[]).map(vt).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ct(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=J(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,_t(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,J(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,q),document.addEventListener(`touchmove`,l,q),document.addEventListener(`touchstart`,d,q),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,q),document.removeEventListener(`touchmove`,l,q),document.removeEventListener(`touchstart`,d,q)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:bt(i)}):null,m?o.createElement(at,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var wt=He(Ue,St),Tt=o.forwardRef(function(e,t){return o.createElement(H,L({},e,{ref:t,sideCar:wt}))});Tt.classNames=H.classNames;var Et=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,Z=new WeakMap,Q={},$=0,Dt=function(e){return e&&(e.host||Dt(e.parentNode))},Ot=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Dt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},kt=function(e,t,n,r){var i=Ot(t,Array.isArray(e)?e:[e]);Q[n]||(Q[n]=new WeakMap);var a=Q[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Z.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(Z.has(e)||e.removeAttribute(r),Z.delete(e)),i||e.removeAttribute(n)}),$--,$||(X=new WeakMap,X=new WeakMap,Z=new WeakMap,Q={})}},At=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Et(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),kt(r,i,n,`aria-hidden`)):function(){return null}};export{he as a,D as c,g as d,m as f,u as g,l as h,De as i,te as l,d as m,Tt as n,ie as o,p,Oe as r,se as s,At as t,b as u};
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,l as i,w as a}from"./button-C1fD-ZFr.js";import{i as o,on as s}from"./project-scope-context-CX36ze1Q.js";import{ht as c}from"./queries-Cb76PEoL.js";import{ot as l,w as u}from"./design-icons-B6-0w7Aw.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-CiiA8Vgw.js";import{G as p,K as m,q as h}from"./index-Dn02NPUV.js";import{a as g,c as _,d as v,l as y,n as b,o as x,s as S,t as C,u as w}from"./markdown-9j2EqN9q.js";var T=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=e(t(),1),k=n(),A=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return v(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:n,className:r}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:n,className:r,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:i(`flex min-h-0 flex-col`,r)})}function F({html:e,title:t,fragment:n,className:r,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=_(e,a);return{srcdoc:y(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:i(`flex min-h-0 flex-col`,r),children:[l?(0,k.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:x,allow:g,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=c(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(u,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,k.jsx)(K,{className:n,children:(0,k.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof o&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(l,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??s(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,k.jsx)(G,{href:i}):null]})}function G({href:e}){let t=a(),n=r();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:r=>b(r,t,e,n),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:i(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
2
- `).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>h(e),[e]),i=n.length>q,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return p(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:m(t,r)?.tokens??n}function Y({path:e,text:t}){let n=J(e,t);return(0,k.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":h(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex px-4`,children:[(0,k.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,k.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}export{R as a,E as c,B as i,T as l,H as n,P as o,V as r,D as s,Y as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,t as i,u as a}from"./button-C1fD-ZFr.js";import{tt as o}from"./use-desktop-DN7wbSS7.js";import{F as s,T as c,j as l,st as u,u as d}from"./design-icons-B6-0w7Aw.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";import{n as p,r as m,t as h}from"./diff-controls-C8aqhty4.js";import{i as g,p as _,r as v,t as y}from"./dropdown-menu-D4zMgwkC.js";import{Mt as b,rn as x}from"./index-Dn02NPUV.js";var S=f(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),C=f(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),w=e(t(),1),T=n();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:i}){let[a,o]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(d,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,T.jsx)(c,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),a?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,healthReady:t,branch:n,stat:a,mode:o,wrap:s,preview:c=!1,onModeChange:l,onWrapChange:u,onPreviewChange:d,onAction:f}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[n?(0,T.jsx)(h,{branch:n}):null,a?(0,T.jsx)(R,{stat:a}):null,d?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(m,{preview:c,onPreviewChange:d})}):null,(0,T.jsxs)(`span`,{className:r(`flex items-center gap-1`,d?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(p,{mode:o,wrap:s,onModeChange:l,onWrapChange:u})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:f},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:f}),e.menu.length>0?(0,T.jsxs)(y,{children:[(0,T.jsx)(_,{asChild:!0,children:(0,T.jsx)(i,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(v,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(g,{disabled:!e.enabled,title:e.reason,onSelect:()=>f(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(l,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(u,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(s,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(o,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:t,onAction:n}){return e.id===`view-pr`?a(e.href)?(0,T.jsx)(i,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(i,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(i,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(b,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{E as i,F as n,P as r,R as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,M as i,l as a,t as o}from"./button-C1fD-ZFr.js";import{J as s,Q as c,X as l,Z as u,jn as d,qt as f,ti as p,ui as m}from"./project-scope-context-CX36ze1Q.js";import{D as h,Kt as g,T as _,Tt as ee,Yt as v,j as y,k as te,s as b,t as x,w as S}from"./queries-Cb76PEoL.js";import{G as C,a as w,n as ne,o as T,r as E,z as D}from"./use-desktop-DN7wbSS7.js";import{n as O}from"./toaster-Cxgzn9ip.js";import{F as k,I as A,X as j,Y as M,c as N,l as P,ot as F,p as I,r as re}from"./design-icons-B6-0w7Aw.js";import{l as ie,n as ae}from"./nav-row-styles-CFjnD-9J.js";import{a as L,i as R}from"./format-BNCkW110.js";import{_ as oe,a as se,d as z,f as ce,h as le,i as ue,m as de,n as fe,o as pe,p as me,r as he,v as ge}from"./prompt-template-menu-DT_0Pyd5.js";import{r as _e,t as B}from"./project-router-CcyPWtFH.js";import"./attention-B0IBc2_D.js";import{I as ve,L as V,M as ye,P as be,R as xe}from"./picker-pill-D8SyrTxD.js";import{t as H}from"./centered-state-CiiA8Vgw.js";import{C as Se,Lt as Ce,V as we,X as Te,Y as Ee,Zt as De,gn as Oe,hn as ke,s as Ae}from"./index-Dn02NPUV.js";import{a as je,d as Me,f as Ne,i as Pe,l as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be,u as U}from"./use-hand-to-agent-state-C9YTgLEG.js";import{t as W}from"./tab-link-Dn7KFNYr.js";var G=e(t(),1),K=`cez-github-list-width`;function q(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function Ve(){try{let e=localStorage.getItem(K);return e===null?360:q(e)}catch{return 360}}function He(e){try{localStorage.setItem(K,String(q(e)))}catch{}}var J=n();function Ue({number:e,repo:t}){let n=i();return(0,J.jsx)(We,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function We({number:e,repo:t,scope:n}){let r=(0,G.useId)(),i=(0,G.useId)(),[a,s]=(0,G.useState)(!1),c=a?Oe:ke,l=g(n,!0,n==="default"),u=b(`#${e}`,!0),f=(0,G.useMemo)(()=>de(C(l.data??[],u.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[l.data,u.data,e,t,n]);return(0,J.jsxs)(`section`,{"aria-labelledby":r,className:`mt-4 min-w-0 rounded-lg border border-border p-3`,children:[(0,J.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":i,onClick:()=>s(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,J.jsxs)(`span`,{children:[`Linked tasks`,l.data?` (${f.length}${u.hasNextPage||u.isError?`+`:``})`:``]})]})}),(0,J.jsx)(`div`,{id:i,children:a?(0,J.jsxs)(J.Fragment,{children:[l.isPending?(0,J.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,l.isError?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,J.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,J.jsx)(o,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void l.refetch(),disabled:l.isFetching,children:`Retry linked tasks`})]}):null,l.data&&f.length===0&&!l.isError?(0,J.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,f.length>0?(0,J.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:f.map(e=>{let t=d(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(B,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:D(e)}),(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(De,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,J.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,J.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,u.isError?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,J.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,J.jsx)(o,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void u.refetch(),disabled:u.isFetching,children:`Retry older linked tasks`})]}):u.hasNextPage?(0,J.jsx)(o,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void u.fetchNextPage(),disabled:u.isFetchingNextPage,children:u.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var Y=`w-44 max-w-full`,X=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function Ge(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function Ke(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function qe(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function Je(e){return[e.viewerLogin?``:`GitHub login unavailable.`,qe(e)].filter(Boolean).join(` `)}function Ye({options:e,assignees:t,onAssigneesChange:n}){return(0,J.jsxs)(E,{children:[(0,J.jsx)(T,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,className:X,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,J.jsx)(P,{size:12,"aria-hidden":`true`,className:`ml-1 inline size-3 shrink-0 align-[-1px] text-soft-foreground`})]})}),(0,J.jsx)(w,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,J.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,J.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,J.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,J.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function Xe({data:e,projectId:t,onProjectChange:n,pickerRef:r}){return e.projects?.length?(0,J.jsxs)(`select`,{ref:r,"aria-label":`Project board`,className:`${X} ${Y}`,value:t,onChange:e=>n(e.target.value),children:[(0,J.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects||e.projectsState?(0,J.jsx)(`select`,{ref:r,"aria-label":`Project board`,className:`${X} ${Y}`,disabled:!0,value:``,children:(0,J.jsx)(`option`,{value:``,children:e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`})}):null}function Ze({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,J.jsxs)(E,{open:i,onOpenChange:a,children:[(0,J.jsx)(T,{asChild:!0,children:(0,J.jsx)(`button`,{ref:o,type:`button`,className:`${X} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,J.jsx)(M,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,J.jsx)(F,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,J.jsx)(w,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function Qe({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,G.useState)(!1),s=(0,G.useRef)(null),c=(0,G.useRef)(null),l=(0,G.useRef)(null),u=(0,G.useRef)(null),d=Ge(e.issues,t),f=Ke(e.viewerLogin,t),p=Je(e),m=p!==``,h=(0,G.useRef)(p);m&&(h.current=p);let g=(0,G.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,G.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,G.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,J.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,J.jsx)(Ye,{options:d,assignees:t,onAssigneesChange:r}),(0,J.jsx)(`button`,{ref:u,type:`button`,className:`${X} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:`Assigned to me`}),(0,J.jsx)(Xe,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,J.jsx)(Ze,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function $e({onRefresh:e,refreshing:t}){let n=Ee(i());return(0,J.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:ae,children:[(0,J.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,J.jsx)(`h1`,{className:a(ie,`min-w-0 flex-1`),children:`GitHub`}),(0,J.jsx)(`button`,{type:`button`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,J.jsx)(M,{size:17,"aria-hidden":`true`,className:a(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,J.jsx)(Te,{model:n,variant:`screen`})]})}function et(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function tt(e){let[t,n]=(0,G.useState)(null);return(0,G.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(et(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function nt(e,t){let[n,r]=(0,G.useState)(0);return(0,G.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function rt(e,t,n){let[r,i]=(0,G.useState)(null),a=(0,G.useRef)(n);return(0,G.useEffect)(()=>{a.current=n}),(0,G.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function it(e,t,n,r,i){let[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),l=tt(a),u=(0,G.useRef)(null);u.current=l;let d=nt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:rt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}var at=100;function ot(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=at)break;a.add(t.number)}return[...a]}function st(e,t,n,r,i,a){let o=ot(n,e,r,i,a),s=S(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=_(e===`issues`?`issue`:`pr`,(0,G.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),u=(0,G.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>l[e.number]??(u.has(e.number)?void 0:e.comments)}}function ct(e){let[t,n]=Se(),r=t.get(`filter`),i=le(e,r);return{rawFilterParam:r,filter:i,activeFilter:i??`all`,setFilterParam:e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n})}}function lt(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,G.useState)(``),[s,c]=(0,G.useState)([]),[l,u]=(0,G.useState)([]),{setProjectFilter:d,activeProject:f}=ut(t),p=e===`issues`&&r===`assigned`,m=p?t?.viewerLogin?[t.viewerLogin]:[]:l;return{query:a,setQuery:o,labelFilter:s,setLabelFilter:c,setProjectFilter:d,activeProject:f,isAssignedFilter:p,effectiveAssignees:m,changeAssignees:e=>{u(e),p&&i(`all`)},clearFilters:()=>{o(``),c([]),u([]),d(``),n!==null&&n!==`all`&&i(`all`)},filtering:a.trim()!==``||s.length>0||e===`issues`&&(m.length>0||f!==``)||n!==null&&n!==`all`,narrowing:a.trim()!==``||s.length>0||e===`issues`&&(!p&&l.length>0||f!==``)}}function ut(e){let[t,n]=(0,G.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,G.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function dt(e,t,{filter:n,activeFilter:r},a){let o=i(),s=e===`issues`&&(r===`no-task`||r===`has-task`),c=g(o,s,o==="default"),l=(0,G.useMemo)(()=>c.data?me(c.data,t?.repo,o):null,[c.data,t?.repo,o]),u=ce(e,n)?ge(n):null,d=y(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,G.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,G.useMemo)(()=>f?oe(f,p):null,[f,p]),h=ft({view:e,gh:t,activeFilter:r,isAssignedFilter:a,taskFilter:s,taskNumbers:l,runsQuery:c,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,G.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,G.useMemo)(()=>e===`issues`?r===`no-task`&&l?{excludeNumbers:l}:r===`has-task`&&l?{includeNumbers:l}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,r,l,t?.viewerLogin,f])}}function ft({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?l.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${l.data.reason??`unknown reason`}.`}:l.isError?{kind:`blocked`,message:`GitHub could not be searched: ${l.error instanceof Error?l.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null}function Z(e,t){return t?c(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function pt(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=x.github()[0],s=t===void 0?null:Number.parseInt(t,10),c=!r&&n.data?.available?n.data.items.find(e=>e.number===s):void 0,l=i&&s!==null&&!a.some(e=>e.number===s)?i.find(e=>e.number===s):void 0,u=c??l,[d,f]=(0,G.useState)(null);return(0,G.useEffect)(()=>{u&&f({scope:o,view:e,item:u})},[o,e,u]),{selectedNumber:s,remoteDetail:u??(d?.scope===o&&d.view===e&&d.item.number===s?d.item:null)}}function mt(e,t,n,{fullList:r,filterRows:i},a){let o=p(),s=(0,G.useRef)(null),c=e===`issues`?`issue`:`pr`,l=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,u=h(c,n??0,l),d=l&&u.data?.available&&u.data.item?.kind===c?u.data.item:null;s.current=l&&n!==null?{kind:c,number:n,key:x.githubItem(c,n)}:null;let[f,m]=(0,G.useState)(!1);return{exactWanted:l,exactItem:u,exactDetail:d,exactTargetRef:s,retryingExact:f,retryExact:()=>{m(!0),Z(o,s.current).then(e=>{m(!1),e||O(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function ht(e,t,n){let r=p(),i=(0,G.useRef)(null);return{refresh:v({mutationFn:e=>(Z(r,e),s({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:x.githubPages(50),exact:!0}),r.setQueryData(x.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:x.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),c=x.githubCommentCounts(o,s);r.removeQueries({queryKey:x.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==m(c)}),a.available&&a.commentsDeferred&&s.length>0&&l(o,s,{refresh:!0}).then(e=>r.setQueryData(c,e)).catch(()=>{}),r.invalidateQueries({queryKey:x.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:x.githubSearch(`pr`,pe)}),r.invalidateQueries({queryKey:x.githubSearch(`pr`,he)});let d=i.current;if(!d){r.removeQueries({queryKey:[`github`,`comments`]});return}let f=x.githubComments(d.kind,d.number);u(d.kind,d.number,{refresh:!0}).then(e=>r.setQueryData(f,e)).catch(()=>{}),r.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==m(f)})},onError:e=>O(e.message,{tone:`danger`})}),openThreadRef:i}}var gt=350;function _t(e,t){let[n,r]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function vt(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=_t(n,gt),u=(0,G.useMemo)(()=>U(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),d=n.trim()===l.trim(),f=t?.available===!0&&!c&&d&&Ne(l,u),p=y(e===`issues`?`issue`:`pr`,l,f),m=U(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),h=f&&p.data?.available?p.data:null,g=new Set(m.map(e=>e.number)),_=yt(e,h,a,i);return{debouncedQuery:l,searchWanted:f,forgeSearch:p,items:m,searchPayload:h,metadataFailure:_,searchHits:h&&!_?U(h.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!g.has(e.number)):[],...bt(n,d,f,p)}}function yt(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function bt(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function xt({width:e,onWidthChange:t}){let n=(0,G.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(q(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,J.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(q(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function St({view:e,changes:t=!1,index:n=!1}){let{n:i}=r(),a=ct(e),{rawFilterParam:o,activeFilter:s}=a,c=ne(),{pages:l,data:u}=te(50),d=Ce(),f=wt(),p=Be(),m=Ct({index:n,isDesktop:c,rawFilterParam:o,n:i,rememberedView:ee().data?.githubView}),h=Tt(u?.available===!0&&!m.filterScreen),[g,_]=(0,G.useState)(!1),v=lt(e,u,a),y=dt(e,u,a,v.isAssignedFilter),b=vt(e,u,v,y),x=pt(e,i,b.forgeSearch,y),S=mt(e,u,x.selectedNumber,y,x.remoteDetail),C=st(e,l,u,x.selectedNumber,b.searchHits,y.openItems),{refresh:w,openThreadRef:T}=ht(e,C.checkPrNumbers,b.debouncedQuery),E=it(e,l,u,y.backedQuery,v.narrowing);if(m.restorePrs)return(0,J.jsx)(_e,{to:`/github/prs`,replace:!0});if(!u)return l.isError?(0,J.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,J.jsx)(H,{icon:(0,J.jsx)(F,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:l.error.message})}):(0,J.jsx)(we,{});T.current=null;let D=()=>w.mutate(S.exactTargetRef.current);if(m.filterScreen&&u.available)return(0,J.jsx)($e,{onRefresh:D,refreshing:w.isPending});if(!u.available)return(0,J.jsx)(At,{reason:u.reason,refreshing:w.isPending,onRetry:D});let{labelColors:O,labelOptions:k}=Et(u,b.searchPayload,y.openItems,y.fullList),A=Dt({number:x.selectedNumber,items:b.items,searchHits:b.searchHits,fullList:y.fullList,filterRows:y.filterRows,remoteDetail:x.remoteDetail,exactDetail:S.exactDetail});T.current=A?{kind:A.kind,number:A.number}:null;let{linkFilter:j,listPath:M}=Ot(e,o,s,c),N={view:e,filter:j,colors:O,selected:A,queued:p.queued,checksMap:C.checksMap,commentsOf:C.commentsOf},P=kt(e,v,y.filterGate,b);return(0,J.jsxs)(`div`,{ref:h.routeRef,"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:px-7 md:pt-4 md:pb-4`,children:[(0,J.jsx)(jt,{view:e,activeFilter:s,isDesktop:c,rawFilterParam:o,n:i,gh:u}),(0,J.jsxs)(`div`,{ref:h.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":h.panesStacked,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-[22px]`,children:[(0,J.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-[22px]`,children:[(0,J.jsx)(Mt,{view:e,isDesktop:c,gh:u,automationsAvailable:d,onSaveView:f,refreshing:w.isPending,onRefresh:D}),(0,J.jsx)(Nt,{view:e,gh:u,filters:v,labelOptions:k,labelColors:O,searchPayload:b.searchPayload})]}),(0,J.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,J.jsx)(Pt,{view:e,n:i,rows:N,verdict:P,search:b,sidebar:y,list:l,paging:E,width:h.githubListWidth,onWidthChange:h.changeGithubListWidth,expanded:g,onExpandedChange:_}),(0,J.jsx)(Bt,{view:e,n:i,selected:A,selectedNumber:x.selectedNumber,exact:S,repo:u.repo,rows:N,listPath:M,changes:t,handToAgent:p})]})]})]})}function Ct({index:e,isDesktop:t,rawFilterParam:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&n===null&&r===void 0,restorePrs:e&&t&&n===null&&i===`prs`}}function wt(){let e=p();return t=>{e.setQueryData(x.uiState,e=>({...e,githubView:t})),f({githubView:t}).then(t=>e.setQueryData(x.uiState,t)).catch(t=>{O(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:x.uiState})})}}function Tt(e){let[t,n]=(0,G.useState)(Ve),[r,i]=(0,G.useState)(!0),a=(0,G.useRef)(null),o=(0,G.useRef)(null);return(0,G.useEffect)(()=>{if(!e)return;let n=a.current,r=o.current,s=n?.closest(`[data-slot="main"]`);if(!n||!r||!s)return;let c=window.matchMedia(`(min-width: 768px)`),l=!1,u=()=>{if(l=c.matches&&r.clientWidth>=t+22+360,i(!l),!l||s.clientHeight<1){n.style.removeProperty(`--gh-workspace-height`);return}n.style.setProperty(`--gh-workspace-height`,`${Math.round(s.clientHeight)}px`)};u();let d=new ResizeObserver(u);d.observe(s),d.observe(r);let f=e=>{if(!l||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||r.getBoundingClientRect().top<=s.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let t=e.deltaMode===1?16:e.deltaMode===2?s.clientHeight:1;s.scrollTop+=e.deltaY*t};return r.addEventListener(`wheel`,f,{passive:!1}),c.addEventListener(`change`,u),()=>{r.removeEventListener(`wheel`,f),d.disconnect(),c.removeEventListener(`change`,u)}},[e,t]),{githubListWidth:t,changeGithubListWidth:e=>{let t=q(e);n(t),He(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Et(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:Fe([...n,...r,...t?.items??[]])}}function Dt({number:e,items:t,searchHits:n,fullList:r,filterRows:i,remoteDetail:a,exactDetail:o}){return e===null?t[0]??n[0]??null:r.find(t=>t.number===e)??i?.find(t=>t.number===e)??a??o??null}function Ot(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:z(e,i??(e===`issues`&&!r?`all`:null))}}function kt(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,J.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,J.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,J.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,J.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,J.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,J.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,J.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,J.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,J.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,J.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,J.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,J.jsxs)(`p`,{children:[`No open `,d,`.`]})}function At({reason:e,refreshing:t,onRetry:n}){return(0,J.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,J.jsx)(H,{icon:(0,J.jsx)(A,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,J.jsx)(o,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:n,children:`Try again`}),children:(0,J.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,J.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,J.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in Squawk works without it.`]})})})}function jt({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a}){return(0,J.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col gap-1 md:flex-row md:items-baseline md:gap-3`,children:[(0,J.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:n?`${e===`issues`?`Issues`:`Pull requests`} · ${fe[t]}`:`GitHub`}),r!==null&&i===void 0?(0,J.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`flex min-w-0 items-center gap-3 md:hidden`,children:[(0,J.jsxs)(B,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,J.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,J.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-soft-foreground`,children:[...ue,...se].find(e=>e.id===t)?.label})]}):null,a.repo?(0,J.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground md:text-[11px] md:text-soft-foreground`,children:[(0,J.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,J.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,a.syncedAt?`Synced ${R(a.syncedAt)} ago`:`Not synced yet`]})]}):null]})}function Mt({view:e,isDesktop:t,gh:n,automationsAvailable:r,onSaveView:i,refreshing:o,onRefresh:s}){return(0,J.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,J.jsxs)(W,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>i(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,J.jsxs)(W,{to:`/github/prs`,active:e===`prs`,onClick:()=>i(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]}),r?(0,J.jsx)(B,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,J.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:o,onClick:s,className:`gh-utility`,children:[(0,J.jsx)(M,{size:16,"aria-hidden":`true`,className:a(`size-3.5`,o&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Nt({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,J.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,J.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,J.jsx)(j,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,J.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,J.jsx)(Kt,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,J.jsx)(Qe,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,J.jsx)(`button`,{type:`button`,disabled:!n.filtering,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:n.clearFilters,children:`Clear filters`})]})}function Q(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function $(e,t){return(0,J.jsx)(Gt,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:Q(e,t.checksMap),comments:t.commentsOf(e)})}function Pt({view:e,n:t,rows:n,verdict:r,search:i,sidebar:a,list:o,paging:s,width:c,onWidthChange:l,expanded:u,onExpandedChange:d}){let{items:f,searchHits:p}=i,m=e===`issues`&&t!==void 0&&!u;return(0,J.jsxs)(`section`,{ref:s.setListEl,"data-slot":`gh-list`,"data-mobile-preview":m||void 0,style:{"--github-list-width":`${c}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[f.length===0?r&&(0,J.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):(0,J.jsx)(Ft,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,J.jsx)(It,{view:e,list:o,paging:s}):null,(0,J.jsx)(Lt,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,J.jsx)(Rt,{view:e,n:t,count:f.length,expanded:u,onExpandedChange:d}),f.length>0&&i.searchWanted&&r?(0,J.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):null,p.length>0?(0,J.jsx)(zt,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,J.jsx)(xt,{width:c,onWidthChange:l})]})}function Ft({items:e,rows:t,compactPreview:n,paging:r}){let{setRowsEl:i,scrollOwner:a,listEl:o,scrollOwnerRef:s,startMargin:c}=r,l=e.map((e,r)=>(0,J.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":r>0||void 0,"data-compact-hidden":n&&r>=2&&t.selected?.url!==e.url||void 0,children:$(e,t)},e.url));return(0,J.jsx)(`div`,{ref:i,"data-slot":`gh-rows`,"data-virtualized":a?`true`:void 0,role:`list`,children:a?(0,J.jsx)(Ae,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function It({view:e,list:t,paging:n}){return(0,J.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-soft-foreground`,children:t.isFetchingNextPage?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,J.jsxs)(J.Fragment,{children:[`Could not load more.`,(0,J.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,J.jsxs)(J.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,J.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function Lt({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,J.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-soft-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function Rt({view:e,n:t,count:n,expanded:r,onExpandedChange:i}){return e===`issues`&&t!==void 0&&n>2?(0,J.jsx)(o,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":r,onClick:()=>i(e=>!e),children:r?`Show fewer issues`:`View all ${n} issues`}):null}function zt({hits:e,searchPayload:t,rows:n}){return(0,J.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,J.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,J.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,J.jsx)(`li`,{children:$(e,n)},e.url))})]})}function Bt({view:e,n:t,selected:n,selectedNumber:r,exact:i,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}){let{exactWanted:d,exactItem:f}=i;return(0,J.jsx)(`section`,{"data-slot":`gh-detail`,className:a(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card md:overflow-y-auto`,t===void 0?`hidden md:flex`:`flex`),children:n?(0,J.jsx)(Vt,{item:n,n:t,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}):d&&f.isPending?(0,J.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,J.jsx)(H,{icon:(0,J.jsx)(L,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${r}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):d&&(f.isError||f.data?.available===!1)?(0,J.jsx)(Ht,{number:r,exact:i}):(0,J.jsx)(Ut,{view:e,number:r})})}function Vt({item:e,n:t,repo:n,rows:r,listPath:i,changes:a,handToAgent:o}){let{workflows:s,skillList:c,workflow:l,setWorkflow:u,selectedSkills:d,setSelectedSkills:f,engine:p,setEngine:m,queued:h,onQueued:g}=o;return(0,J.jsx)(Le,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,J.jsx)(Ue,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:Wt,colors:r.colors,checks:Q(e,r.checksMap),children:(0,J.jsx)(Ie,{item:e,workflows:s.data?.workflows??[],skills:c,workflow:l,onWorkflowChange:u,selectedSkills:d,onSkillsChange:f,engine:p,onEngineChange:m,queuedRunId:h.get(e.url)??null,onQueued:g},e.url)})}function Ht({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,J.jsx)(H,{icon:(0,J.jsx)(F,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,J.jsx)(o,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function Ut({view:e,number:t}){return(0,J.jsx)(H,{icon:e===`issues`?(0,J.jsx)(I,{size:16}):(0,J.jsx)(k,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${t} above to look it up on GitHub, closed and merged included.`})}function Wt(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}function Gt({item:e,view:t,filter:n,colors:r,active:i,queued:o,checks:s,comments:c}){let l=e.kind===`issue`?I:k,d=p(),f=()=>{d.prefetchQuery({queryKey:x.githubComments(e.kind,e.number),queryFn:({signal:t})=>u(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,J.jsxs)(B,{to:z(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Re(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:f,onFocus:f,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":i?`page`:void 0,title:`Drag into the composer to prefill a task`,className:a(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,i&&`bg-accent-strong/10 text-accent-text`),children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,J.jsx)(l,{"aria-hidden":`true`,"data-slot":`gh-row-icon`,className:a(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,J.jsx)(`span`,{"data-slot":`gh-row-title`,className:a(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,i&&`font-semibold`),children:e.title})]}),(0,J.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[11px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,J.jsxs)(`span`,{children:[`#`,e.number]}),(0,J.jsx)(`span`,{"data-slot":`gh-row-author`,className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,J.jsx)(`span`,{children:R(e.createdAt)}),(0,J.jsx)(je,{count:c}),s?(0,J.jsx)(Pe,{checks:s}):null,o?(0,J.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,J.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,J.jsx)(ze,{label:e,color:r[e],plain:!0},e))}):null]})}function Kt({options:e,colors:t,selected:n,onChange:r}){let[i,o]=(0,G.useState)(!1),s=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,J.jsxs)(E,{open:i,onOpenChange:o,children:[(0,J.jsx)(T,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:a(`flex min-h-11 min-w-11 shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,J.jsx)(P,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`})]})}),(0,J.jsx)(w,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,J.jsxs)(ye,{children:[(0,J.jsx)(ve,{placeholder:`Filter labels…`}),(0,J.jsxs)(xe,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,J.jsx)(be,{children:`No labels.`}),n.length>0?(0,J.jsxs)(V,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,J.jsxs)(V,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Me(t[e])}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,J.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{St as GithubRoute};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,l as i,p as a,t as o}from"./button-C1fD-ZFr.js";import{M as s,q as c}from"./queries-Cb76PEoL.js";import{A as l,B as u,D as d,F as f,I as p,J as m,K as h,M as g,O as _,P as v,Q as ee,R as te,S as ne,V as y,W as b,X as x,Z as S,_ as re,a as ie,b as ae,d as C,f as oe,h as se,i as w,j as T,k as E,l as D,n as O,o as k,p as A,q as j,r as M,t as N,u as P,v as F,x as I,y as L,z as R}from"./activity-motion-BNen0Yj8.js";import{Ft as z,Pt as B}from"./index-Dn02NPUV.js";var V=e(t(),1);function H(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function U(e){let t=[],n=[];for(let r of e)y(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function W(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function G(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function K(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>j(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function ce(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=n(),le={w:104,h:20};function ue(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,ae(r.getBoundingClientRect(),t))}return n}function de(e,t,n=[]){let r=ue(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...F(e),kind:`wait`}))],o=I(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...L(t,n,i,o.get(e.requestId))})}let c=ne(s.map(e=>({id:e.id,at:e.label})),le,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-[10.5px] whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function pe({arc:e,wait:t,now:n,motion:r}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:i(J,`border-dashed border-message-peer-accent`,t.id in r.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,x(S(t.since,n))]})}function me({arc:e,request:t,now:n,motion:r}){let a=oe(r,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:i(J,a?`border-success`:`border-message-peer-accent`,C(r,e.id)===`fade`&&`activity-line-out`),children:[a?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,x(S(t.createdAt,n))]})}var he=[],ge=new Set;function _e({arcs:e,waits:t=he,active:n=ge,layoutKey:r,now:a,motion:o=f,paused:s=!1}){let c=V.useRef(null),l=se(c,V.useCallback(n=>de(n,e,t),[e,t]),fe,`[data-activity-pill]`,r),u=V.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=re(o.comets,u,s),p=new Map(e.map(e=>[e.requestId,e])),m=new Map(t.map(e=>[e.id,e])),h=V.useId().replace(/[^a-zA-Z0-9_-]/g,``),g=`activity-arrow-arc-${h}`,_=`activity-ring-arc-${h}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:g,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(D,{id:_})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${_})`,className:i(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,A(o,e.id))},e.id)}let t=C(o,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${g})`,className:i(`stroke-message-peer-accent`,P(t,e.id in o.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?m.get(e.id):void 0;if(t)return(0,q.jsx)(pe,{arc:e,wait:t,now:a,motion:o},e.id);let n=p.get(e.id);return n?(0,q.jsx)(me,{arc:e,request:n,now:a,motion:o},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,ve=[],ye=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function be({task:e}){let t=e.workers.filter(e=>j(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(g,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function xe({projectId:e,task:t,requests:n,waits:r=ve,index:o,ctx:s,motion:c=f,linked:u=!1,onHover:p}){let h=m(t,s);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":h.action,"data-linked":u?`true`:void 0,...E(t.runId,p),className:i(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,h.action?`border-pending`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in c.entering&&`activity-card-enter`),children:[(0,q.jsx)(d,{task:t,motion:c,glow:h.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(g,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(a,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(l,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`mt-[3px] ml-[19px] truncate text-[11.5px] text-muted-foreground tabular-nums`,children:[(0,q.jsx)(v,{"data-slot":`activity-verb`,tone:h.tone,className:`font-semibold`,children:h.verb}),` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:i(h.mono&&`font-mono text-[11px]`),children:h.main})]}),(0,q.jsx)(_,{texts:te(t.runId,n,o,r)}),(0,q.jsx)(be,{task:t}),(0,q.jsx)(T,{runId:t.runId,requests:n,waits:r,index:o,link:a,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:ye})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Se=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-border bg-card px-4 pt-3.5 pb-4`,Ce=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function Q({project:e,headingId:t,detail:n,to:r,label:i}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,q.jsx)(a,{to:r,className:Ce,children:i})]})}function $({project:e,notice:t}){let n=V.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)(Q,{project:e,headingId:n,detail:t,to:Se(e.projectId),label:`Open project →`})})}function we(e,t){return V.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return W({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Te({project:e,now:t,motion:n=f,paused:r=!1}){let a=V.useId(),o=V.useMemo(()=>b(e),[e]),s=we(e,n),c=V.useMemo(()=>u(e.tasks),[e.tasks]),l=V.useMemo(()=>G(e.tasks,[...c,...p(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=k(c),m={now:t,titleOf:e=>R(o,e)},h=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${l.map(e=>e.id).join(`,`)}`,g=s.length>0||l.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":a,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)(Q,{project:e,headingId:a,detail:K(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:i(`relative mt-3`,g&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:i(`grid grid-cols-[repeat(auto-fill,minmax(min(100%,220px),1fr))] items-start gap-3.5`,g&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(xe,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:o,ctx:m,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),g?(0,q.jsx)(_e,{arcs:s,waits:l,active:d.active,layoutKey:h,now:t,motion:n,paused:r}):null]})]})}function Ee(e){let t=y(e.project);return t===void 0?(0,q.jsx)(Te,{...e}):(0,q.jsx)($,{project:e.project,notice:t})}function De({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[ce(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(V.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(a,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Oe={kind:`workspace`};function ke(){let e=c().data?.projects,{order:t}=B();return V.useMemo(()=>e?z(e,t).map(e=>e.id):void 0,[e,t])}function Ae(){let e=ee(Oe),t=c(),n=s(),i=r().state?.activityProjectId,a=ke(),l=N(e.data?.generatedAt,e.dataUpdatedAt),u=t.data?.bootProject??n.data?.bootProject??null,d=typeof i==`string`&&t.data?.projects.some(e=>e.id===i&&e.status!==`missing`)?i:u,f=e.data?.projects,p=V.useMemo(()=>U(H(f??[],a)),[f,a]),{motion:m,paused:g,reduced:_}=O(e.data,`workspace`);return(0,q.jsxs)(`div`,{"data-route":`activity-global`,"data-activity-paused":g?`true`:void 0,className:`flex min-h-full w-full flex-col gap-4 px-[18px] py-6 md:px-7`,children:[(0,q.jsx)(M,{name:`All projects`,now:e.data?l:void 0,stale:e.isError,children:(0,q.jsx)(w,{scope:`all`,projectId:d})}),f?(0,q.jsx)(ie,{summary:h(f),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!f?(0,q.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(o,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),className:`max-md:min-h-11`,children:`Retry`})]}):null,f&&p.panels.length===0&&p.idle.length===0?(0,q.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No projects to show.`}):null,(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3.5`,children:p.panels.map(e=>(0,q.jsx)(Ee,{project:e,now:l,motion:m,paused:g||_},e.projectId))}),(0,q.jsx)(De,{projects:p.idle,belowPanels:p.panels.length>0})]})}export{Ae as GlobalActivityRoute};