@useorgx/openclaw-plugin 0.7.20 → 0.7.24

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/dashboard/dist/assets/B6VftyY6.js +1 -0
  2. package/dashboard/dist/assets/B6VftyY6.js.br +0 -0
  3. package/dashboard/dist/assets/B6VftyY6.js.gz +0 -0
  4. package/dashboard/dist/assets/{Dm0CfDGr.js → BANQdlC4.js} +1 -1
  5. package/dashboard/dist/assets/BANQdlC4.js.br +0 -0
  6. package/dashboard/dist/assets/BANQdlC4.js.gz +0 -0
  7. package/dashboard/dist/assets/{_zpQCpjm.js → BPL4CL3c.js} +1 -1
  8. package/dashboard/dist/assets/BPL4CL3c.js.br +0 -0
  9. package/dashboard/dist/assets/BPL4CL3c.js.gz +0 -0
  10. package/dashboard/dist/assets/{DXVs61e1.js → BZCkOZ20.js} +1 -1
  11. package/dashboard/dist/assets/BZCkOZ20.js.br +0 -0
  12. package/dashboard/dist/assets/BZCkOZ20.js.gz +0 -0
  13. package/dashboard/dist/assets/{BYb6DARX.js → B_LdOJUa.js} +1 -1
  14. package/dashboard/dist/assets/B_LdOJUa.js.br +0 -0
  15. package/dashboard/dist/assets/B_LdOJUa.js.gz +0 -0
  16. package/dashboard/dist/assets/Bfp-wdwb.css +1 -0
  17. package/dashboard/dist/assets/Bfp-wdwb.css.br +0 -0
  18. package/dashboard/dist/assets/Bfp-wdwb.css.gz +0 -0
  19. package/dashboard/dist/assets/{DibzNd0I.js → BvFcH_Iy.js} +1 -1
  20. package/dashboard/dist/assets/BvFcH_Iy.js.br +0 -0
  21. package/dashboard/dist/assets/BvFcH_Iy.js.gz +0 -0
  22. package/dashboard/dist/assets/By0MIBj_.js +1 -0
  23. package/dashboard/dist/assets/By0MIBj_.js.br +0 -0
  24. package/dashboard/dist/assets/By0MIBj_.js.gz +0 -0
  25. package/dashboard/dist/assets/C0i7ABUU.js +212 -0
  26. package/dashboard/dist/assets/C0i7ABUU.js.br +0 -0
  27. package/dashboard/dist/assets/C0i7ABUU.js.gz +0 -0
  28. package/dashboard/dist/assets/CFB0MM7j.js +1 -0
  29. package/dashboard/dist/assets/CFB0MM7j.js.br +0 -0
  30. package/dashboard/dist/assets/CFB0MM7j.js.gz +0 -0
  31. package/dashboard/dist/assets/CQSRb1yu.js +1 -0
  32. package/dashboard/dist/assets/CQSRb1yu.js.br +0 -0
  33. package/dashboard/dist/assets/CQSRb1yu.js.gz +0 -0
  34. package/dashboard/dist/assets/{wa4jJQK9.js → CUoQoSm-.js} +1 -1
  35. package/dashboard/dist/assets/CUoQoSm-.js.br +0 -0
  36. package/dashboard/dist/assets/CUoQoSm-.js.gz +0 -0
  37. package/dashboard/dist/assets/Ckd1R1iE.js +1 -0
  38. package/dashboard/dist/assets/Ckd1R1iE.js.br +0 -0
  39. package/dashboard/dist/assets/Ckd1R1iE.js.gz +0 -0
  40. package/dashboard/dist/assets/{BGY6oI8h.js → CqRNb2EL.js} +1 -1
  41. package/dashboard/dist/assets/CqRNb2EL.js.br +0 -0
  42. package/dashboard/dist/assets/CqRNb2EL.js.gz +0 -0
  43. package/dashboard/dist/assets/{DAr4MfFk.js → DClUc9rw.js} +1 -1
  44. package/dashboard/dist/assets/DClUc9rw.js.br +0 -0
  45. package/dashboard/dist/assets/DClUc9rw.js.gz +0 -0
  46. package/dashboard/dist/assets/DF2PMTwT.js +1 -0
  47. package/dashboard/dist/assets/DF2PMTwT.js.br +0 -0
  48. package/dashboard/dist/assets/DF2PMTwT.js.gz +0 -0
  49. package/dashboard/dist/assets/{B014hrCe.js → DJYl7gyA.js} +2 -2
  50. package/dashboard/dist/assets/DJYl7gyA.js.br +0 -0
  51. package/dashboard/dist/assets/DJYl7gyA.js.gz +0 -0
  52. package/dashboard/dist/assets/{BoDhb8_y.js → DZtNMX0t.js} +2 -2
  53. package/dashboard/dist/assets/DZtNMX0t.js.br +0 -0
  54. package/dashboard/dist/assets/DZtNMX0t.js.gz +0 -0
  55. package/dashboard/dist/assets/DlEa8PI0.js +1 -0
  56. package/dashboard/dist/assets/DlEa8PI0.js.br +0 -0
  57. package/dashboard/dist/assets/DlEa8PI0.js.gz +0 -0
  58. package/dashboard/dist/assets/M4QxcXjh.js +1 -0
  59. package/dashboard/dist/assets/M4QxcXjh.js.br +0 -0
  60. package/dashboard/dist/assets/M4QxcXjh.js.gz +0 -0
  61. package/dashboard/dist/assets/{CV0sWMbv.js → MrW1ixGx.js} +1 -1
  62. package/dashboard/dist/assets/MrW1ixGx.js.br +0 -0
  63. package/dashboard/dist/assets/MrW1ixGx.js.gz +0 -0
  64. package/dashboard/dist/index.html +2 -2
  65. package/dashboard/dist/index.html.br +0 -0
  66. package/dashboard/dist/index.html.gz +0 -0
  67. package/dist/activity-store.js +68 -8
  68. package/dist/agent-run-store.js +162 -24
  69. package/dist/cli/orgx.d.ts +3 -0
  70. package/dist/config/resolution.d.ts +7 -0
  71. package/dist/config/resolution.js +13 -5
  72. package/dist/contracts/onboarding-state.d.ts +2 -0
  73. package/dist/contracts/onboarding-state.js +23 -0
  74. package/dist/contracts/shared-types.d.ts +45 -0
  75. package/dist/http/helpers/auto-continue-engine.d.ts +23 -0
  76. package/dist/http/helpers/auto-continue-engine.js +468 -85
  77. package/dist/http/helpers/autopilot-runtime.js +5 -1
  78. package/dist/http/helpers/autopilot-slice-utils.js +25 -1
  79. package/dist/http/helpers/decision-mapper.d.ts +1 -0
  80. package/dist/http/helpers/decision-mapper.js +19 -2
  81. package/dist/http/helpers/dispatch-lifecycle.js +3 -0
  82. package/dist/http/helpers/mission-control.d.ts +1 -0
  83. package/dist/http/helpers/mission-control.js +5 -2
  84. package/dist/http/helpers/slice-run-projections.d.ts +27 -0
  85. package/dist/http/helpers/slice-run-projections.js +198 -10
  86. package/dist/http/helpers/triage-mapper.js +499 -6
  87. package/dist/http/helpers/value-utils.d.ts +1 -0
  88. package/dist/http/helpers/value-utils.js +17 -0
  89. package/dist/http/index.d.ts +1 -0
  90. package/dist/http/index.js +179 -46
  91. package/dist/http/router.js +64 -9
  92. package/dist/http/routes/live-legacy.d.ts +19 -2
  93. package/dist/http/routes/live-legacy.js +110 -27
  94. package/dist/http/routes/live-snapshot.d.ts +16 -2
  95. package/dist/http/routes/live-snapshot.js +169 -25
  96. package/dist/http/routes/live-triage.js +6 -1
  97. package/dist/http/routes/mission-control-actions.d.ts +9 -0
  98. package/dist/http/routes/mission-control-actions.js +185 -7
  99. package/dist/http/routes/mission-control-read.d.ts +13 -0
  100. package/dist/http/routes/mission-control-read.js +100 -219
  101. package/dist/http/routes/onboarding.d.ts +1 -0
  102. package/dist/http/routes/onboarding.js +17 -0
  103. package/dist/index.d.ts +5 -0
  104. package/dist/index.js +199 -123
  105. package/dist/outbox.d.ts +0 -2
  106. package/dist/outbox.js +259 -148
  107. package/dist/reporting/rollups.js +18 -11
  108. package/dist/runtime-instance-store.js +212 -58
  109. package/dist/stores/materialized-snapshot-store.d.ts +18 -0
  110. package/dist/stores/materialized-snapshot-store.js +91 -0
  111. package/dist/stores/sqlite-state.d.ts +6 -0
  112. package/dist/stores/sqlite-state.js +330 -0
  113. package/package.json +5 -1
  114. package/dashboard/dist/assets/B014hrCe.js.br +0 -0
  115. package/dashboard/dist/assets/B014hrCe.js.gz +0 -0
  116. package/dashboard/dist/assets/BCudUvwg.js +0 -1
  117. package/dashboard/dist/assets/BCudUvwg.js.br +0 -0
  118. package/dashboard/dist/assets/BCudUvwg.js.gz +0 -0
  119. package/dashboard/dist/assets/BGY6oI8h.js.br +0 -0
  120. package/dashboard/dist/assets/BGY6oI8h.js.gz +0 -0
  121. package/dashboard/dist/assets/BJI1Iy5v.css +0 -1
  122. package/dashboard/dist/assets/BJI1Iy5v.css.br +0 -0
  123. package/dashboard/dist/assets/BJI1Iy5v.css.gz +0 -0
  124. package/dashboard/dist/assets/BUvcp_7V.js +0 -1
  125. package/dashboard/dist/assets/BUvcp_7V.js.br +0 -0
  126. package/dashboard/dist/assets/BUvcp_7V.js.gz +0 -0
  127. package/dashboard/dist/assets/BV2Tf8S2.js +0 -212
  128. package/dashboard/dist/assets/BV2Tf8S2.js.br +0 -0
  129. package/dashboard/dist/assets/BV2Tf8S2.js.gz +0 -0
  130. package/dashboard/dist/assets/BYb6DARX.js.br +0 -0
  131. package/dashboard/dist/assets/BYb6DARX.js.gz +0 -0
  132. package/dashboard/dist/assets/BoDhb8_y.js.br +0 -0
  133. package/dashboard/dist/assets/BoDhb8_y.js.gz +0 -0
  134. package/dashboard/dist/assets/Bqk_l0k6.js +0 -1
  135. package/dashboard/dist/assets/Bqk_l0k6.js.br +0 -0
  136. package/dashboard/dist/assets/Bqk_l0k6.js.gz +0 -0
  137. package/dashboard/dist/assets/C-MOJWHs.js +0 -1
  138. package/dashboard/dist/assets/C-MOJWHs.js.br +0 -0
  139. package/dashboard/dist/assets/C-MOJWHs.js.gz +0 -0
  140. package/dashboard/dist/assets/CV0sWMbv.js.br +0 -0
  141. package/dashboard/dist/assets/CV0sWMbv.js.gz +0 -0
  142. package/dashboard/dist/assets/CaAkScfa.js +0 -1
  143. package/dashboard/dist/assets/CaAkScfa.js.br +0 -0
  144. package/dashboard/dist/assets/CaAkScfa.js.gz +0 -0
  145. package/dashboard/dist/assets/Ck5KlsPN.js +0 -1
  146. package/dashboard/dist/assets/Ck5KlsPN.js.br +0 -0
  147. package/dashboard/dist/assets/Ck5KlsPN.js.gz +0 -0
  148. package/dashboard/dist/assets/D2G51wQm.js +0 -1
  149. package/dashboard/dist/assets/D2G51wQm.js.br +0 -0
  150. package/dashboard/dist/assets/D2G51wQm.js.gz +0 -0
  151. package/dashboard/dist/assets/DAr4MfFk.js.br +0 -0
  152. package/dashboard/dist/assets/DAr4MfFk.js.gz +0 -0
  153. package/dashboard/dist/assets/DXVs61e1.js.br +0 -0
  154. package/dashboard/dist/assets/DXVs61e1.js.gz +0 -0
  155. package/dashboard/dist/assets/DibzNd0I.js.br +0 -0
  156. package/dashboard/dist/assets/DibzNd0I.js.gz +0 -0
  157. package/dashboard/dist/assets/Dm0CfDGr.js.br +0 -0
  158. package/dashboard/dist/assets/Dm0CfDGr.js.gz +0 -0
  159. package/dashboard/dist/assets/_zpQCpjm.js.br +0 -0
  160. package/dashboard/dist/assets/_zpQCpjm.js.gz +0 -0
  161. package/dashboard/dist/assets/uNGpYMSH.js +0 -1
  162. package/dashboard/dist/assets/uNGpYMSH.js.br +0 -0
  163. package/dashboard/dist/assets/uNGpYMSH.js.gz +0 -0
  164. package/dashboard/dist/assets/wa4jJQK9.js.br +0 -0
  165. package/dashboard/dist/assets/wa4jJQK9.js.gz +0 -0
@@ -1 +0,0 @@
1
- import{r as l,j as e}from"./Dj2k1r16.js";import{G as Xt,u as Yt,K as g,P as Ot,B as ie,H as bt,T as es,C as I,v as kt,A as Nt,E as je,V as jt,x as ts,e as Ze,h as Oe,D as gt,F as ss,U as ns}from"./BV2Tf8S2.js";import{S as z}from"./DXVs61e1.js";import{A as Ne,m as D,u as St,R as rs,b as is,a as as}from"./eeHXe_OQ.js";import{Q as x,d as os,q as Ue,a as wt,b as yt,c as Ct,e as Je}from"./wa4jJQK9.js";async function It(s,a){var b;const o=await(await fetch(s,a)).json().catch(()=>null),h=((b=o==null?void 0:o.data)==null?void 0:b.url)??(o==null?void 0:o.url)??null;if(typeof h=="string"&&h.trim())return h.trim();throw new Error((o==null?void 0:o.error)??"Billing link unavailable")}async function ls(s){var h;const a=((h=s==null?void 0:s.actions)==null?void 0:h.checkout)??"/orgx/api/billing/checkout",c=((s==null?void 0:s.requiredPlan)??"starter").trim().toLowerCase()||"starter",o=await It(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:c})});window.open(o,"_blank","noopener,noreferrer")}async function cs(s){var o;const a=((o=s==null?void 0:s.actions)==null?void 0:o.portal)??"/orgx/api/billing/portal",c=await It(a,{method:"POST"});window.open(c,"_blank","noopener,noreferrer")}function ds(s){return s==="success"?"border-emerald-400/30 bg-[#0A1210]/95 text-emerald-100":s==="warning"?"border-amber-300/30 bg-[#12100A]/95 text-amber-100":s==="error"?"border-red-400/32 bg-[#120A0A]/95 text-red-100":s==="info"?"border-cyan-300/28 bg-[#0A1012]/95 text-cyan-100":"border-strong bg-[#0B0F16]/95 text-primary"}function us({open:s,tone:a="neutral",title:c,message:o=null,className:h,primaryAction:b=null,secondaryAction:N=null,onDismiss:S=null,autoDismissMs:q=null}){return l.useEffect(()=>{if(!s||!S||!q)return;const Q=window.setTimeout(()=>S(),q);return()=>window.clearTimeout(Q)},[q,S,s,c,o]),e.jsx(Ne,{initial:!1,children:s?e.jsx(D.div,{initial:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.985},transition:{duration:.2,ease:[.22,1,.36,1]},className:`pointer-events-none ${h??""}`,children:e.jsxs("div",{className:`pointer-events-none min-w-[220px] max-w-[420px] rounded-xl border px-3 py-2 shadow-[0_16px_36px_rgba(0,0,0,0.42)] backdrop-blur ${ds(a)}`,children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-caption font-semibold",children:c}),o?e.jsx("p",{className:"mt-0.5 text-caption opacity-85",children:o}):null]}),S?e.jsx("button",{type:"button",onClick:S,className:"pointer-events-auto inline-flex h-6 w-6 items-center justify-center rounded-md text-current/70 transition-colors hover:bg-white/[0.08] hover:text-current","aria-label":"Dismiss toast",title:"Dismiss",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})}):null]}),b||N?e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[N?e.jsx("button",{type:"button",onClick:N.onClick,className:"pointer-events-auto h-7 rounded-md border border-strong bg-white/[0.06] px-2.5 text-micro font-semibold text-current transition-colors hover:bg-white/[0.12]",children:N.label}):null,b?e.jsx("button",{type:"button",onClick:b.onClick,className:"pointer-events-auto h-7 rounded-md border border-white/25 bg-white/[0.14] px-2.5 text-micro font-semibold text-current transition-colors hover:bg-white/[0.2]",children:b.label}):null]}):null]})}):null})}function qt({className:s=""}){return e.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:s,children:e.jsx("path",{d:"M7 5.4v9.2c0 .7.75 1.15 1.38.83l7.6-4.6a.95.95 0 0 0 0-1.62l-7.6-4.64A.95.95 0 0 0 7 5.4Z",fill:"currentColor"})})}function ms({className:s=""}){return e.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:s,children:[e.jsx("path",{d:"M6.2 9.4V6.7c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v2.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M8.4 8.9V5.8c0-.7.5-1.3 1.1-1.3s1.1.6 1.1 1.3v3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M10.6 8.9V6.2c0-.7.5-1.3 1.1-1.3s1.1.6 1.1 1.3v3.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M12.8 9.6V7.2c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v4.2c0 2.7-1.9 4.6-4.6 4.6H9.2c-2.1 0-3.7-1-4.6-2.8l-.9-1.7c-.3-.6 0-1.4.6-1.7.6-.3 1.3 0 1.6.6l.7 1.4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function xs({className:s=""}){return e.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:s,children:[e.jsx("path",{d:"M6.4 9.2V7.4c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v1.3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M8.6 8.9V7c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M10.8 9.2V7.3c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v2.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M13 9.8V8.2c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v3.6c0 2.4-1.7 4-4.1 4H9.7c-2 0-3.4-.9-4.2-2.5l-.8-1.4c-.3-.6 0-1.3.5-1.6.6-.3 1.2-.1 1.6.5l.6 1",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Xe(s){const a=typeof s.sliceTaskCount=="number"&&Number.isFinite(s.sliceTaskCount)?Math.max(0,Math.floor(s.sliceTaskCount)):null,c=s.sliceScope==="task"?"task":s.sliceScope==="milestone"?"milestone slice":"workstream slice",o=a&&a>0?`${a} ${a===1?"task":"tasks"}`:null;return s.queueState===x.RUNNING?o?`Executing ${o} in ${c}.`:"Execution in progress. Task detail will appear as the scheduler advances.":s.queueState===x.BLOCKED?s.blockReason?"Blocked while waiting for dependency resolution.":"Blocked. Waiting for dependency or review.":s.queueState===x.QUEUED?o?`Queued with ${o} in ${c}.`:"Queued at workstream scope. Task detail will populate after dispatch.":s.queueState===x.COMPLETED?"Completed. No queued tasks remain.":"Idle. Ready to dispatch when started."}function Tt(s){const a=typeof s.initiativePriority=="string"?s.initiativePriority.trim().toLowerCase():"",c=typeof s.initiativePriorityNum=="number"&&Number.isFinite(s.initiativePriorityNum)?Math.max(1,Math.min(100,Math.round(s.initiativePriorityNum))):null,o=a==="urgent"||a==="high"||a==="medium"||a==="low"?a:c!==null?c<=12?"urgent":c<=30?"high":c<=60?"medium":"low":null;if(!o)return null;const h=o==="urgent"?"P1":o==="high"?"P2":o==="medium"?"P3":"P4",b=o==="urgent"?"Urgent":o==="high"?"High":o==="medium"?"Medium":"Low",N=o==="urgent"?"border-red-300/35 bg-red-500/[0.14] text-red-100":o==="high"?"border-amber-300/35 bg-amber-500/[0.14] text-amber-100":o==="medium"?"border-[#BFFF00]/35 bg-[#BFFF00]/14 text-[#E1FFB2]":"border-white/[0.2] bg-white/[0.08] text-white/70";return{shortLabel:`${h} ${b}`,longLabel:`Initiative priority ${b} (${h})`,toneClass:N}}function ps(s){const a=s.trim().toLowerCase();if(a.includes("timed out")||a.includes("timeout")||a.includes("request cancelled")||a.includes("signal is aborted"))return"Next Up is still syncing. Keep this panel open and it will repopulate automatically.";if(a.includes("unauthorized")||a.includes("forbidden")||a.includes("api key")||a.includes("auth"))return"Next Up is unavailable until OrgX authentication is reconnected in Settings.";if(a.includes("unknown api endpoint")||a.includes("route is unavailable"))return"This runtime is missing queue routes. Restart and update the plugin build.";const c=s.split("|").map(o=>o.trim()).filter(Boolean).map(o=>o.replace(/^[^:]+:\s*/,"").trim()).filter(Boolean).slice(0,2).join(" ");return Oe(c||s)||"Next Up is temporarily unavailable."}function hs(s){const a=s.trim().toLowerCase();return a.includes("circular")||a.includes("timeline estimate")||a.includes("adjusted accordingly")?null:a.includes("timed out")||a.includes("timeout")||a.includes("request cancelled")||a.includes("signal is aborted")?"Signal is delayed right now. Queue data will appear as soon as sync catches up.":a.includes("fallback")?"Showing fallback queue data while full signal refreshes.":a.includes("unknown api endpoint")||a.includes("route is unavailable")?"Some queue controls are unavailable in this plugin build. Update and restart to restore full controls.":Oe(s.trim())}function Se(s,a,c){const o=typeof s=="string"?s.trim():"";if(o&&!gt(o))return I(o);const h=typeof a=="string"?a.trim():"";return h?gt(h)?`${c} ${ss(h)}`:I(h):c}function $t(s){const a=typeof s.runnerAgentName=="string"?s.runnerAgentName.trim():"";if(!a)return"Unassigned";const c=a.toLowerCase();return c==="undefined"||c==="null"||c==="main"&&(s.runnerAgentId==="unassigned"||s.runnerSource==="fallback")?"Unassigned":a}function Mt(s){return s.runnerSource==="inferred"?"inferred":null}function Bt(s,a){const c=s.runnerSource==="assigned"?"assigned":s.runnerSource==="inferred"?"inferred":"fallback";return a==="Unassigned"?`Runner ${c}`:`${a} · ${c}`}function pe(s,a){return!s||s.trim().length===0?a:Oe(s.trim())||a}function vt(s){return!s||typeof s!="object"||Array.isArray(s)?null:s}function Ye(s,a){const c=I(s.workstreamTitle),o=vt(a),h=o&&typeof o.dispatchMode=="string"?o.dispatchMode:null,b=vt(o==null?void 0:o.run);return(b&&typeof b.stopReason=="string"?b.stopReason:b&&typeof b.stop_reason=="string"?b.stop_reason:null)==="budget_exhausted"?`Dispatch acknowledged for ${c}, but autopilot stopped: budget exhausted.`:h==="pending"?`Dispatching ${c}; waiting for slice start…`:h==="fallback"?`Dispatched ${c} using fallback runner.`:`Dispatched ${c}.`}function Rt({className:s=""}){return e.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:s,children:[e.jsx("circle",{cx:"4.5",cy:"10",r:"1.4",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.4",fill:"currentColor"}),e.jsx("circle",{cx:"15.5",cy:"10",r:"1.4",fill:"currentColor"})]})}function fs({compact:s}){const a=s?3:6;return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 pt-1 text-micro uppercase tracking-[0.12em] text-muted",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#BFFF00]/70 status-breathe"}),e.jsx("span",{children:"Calibrating queue"})]}),Array.from({length:a}).map((c,o)=>e.jsxs("div",{className:"nextup-skeleton-card rounded-2xl border border-white/[0.08] bg-white/[0.02] px-3 py-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-2.5",children:[e.jsx(z,{className:"h-8 w-8 rounded-full"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(z,{className:"h-3 w-40 rounded-md"}),e.jsx(z,{className:"mt-2 h-4 w-56 rounded-md"})]})]}),e.jsx(z,{className:"h-5 w-16 rounded-full"})]}),e.jsxs("div",{className:"mt-3 rounded-lg border border-white/[0.07] bg-black/[0.18] px-2.5 py-2",children:[e.jsx(z,{className:"h-3 w-14 rounded"}),e.jsx(z,{className:"mt-2 h-3 w-full rounded"}),e.jsx(z,{className:"mt-2 h-3 w-3/5 rounded"})]}),e.jsxs("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:[e.jsx(z,{className:"h-8 w-24 rounded-full"}),e.jsx(z,{className:"h-8 w-20 rounded-full"}),e.jsx(z,{className:"h-8 w-24 rounded-full"})]})]},`nextup-skeleton-${o}`))]})}function bs({initiativeId:s=null,projectId:a=null,authToken:c=null,embedMode:o=!1,title:h="Next Up",showHeader:b=!0,compact:N=!1,className:S,disableEnterAnimation:q=!1,allowCompactToggle:Q=!1,onToggleCompact:he,onOpenInitiative:T,onOpenSettings:L,onUpgradeGate:_,onOpenSliceDetail:G,selectionEnabled:W=!0,panelStyle:Ce="card",showQueueSettings:Ie=!0,queueModel:qe,queueActions:Ae,onPlayWorkstream:V,snapshotVersion:Te=null,excludeRunning:$=!1}){var ft;const[ae,fe]=l.useState(N);l.useEffect(()=>fe(N),[N]);const d=Q&&!he?ae:N,oe=t=>{he?he(t):fe(t)},[F,v]=l.useState(null),[y,X]=l.useState("workstream"),le="bottom",[j,ce]=l.useState(null),[P,Y]=l.useState(null),[u,O]=l.useState(null),[H,de]=l.useState(new Set),[$e,ue]=l.useState(null),[be,ge]=l.useState(!1),[Et,Me]=l.useState(!1),K=St(),et=l.useRef(null),tt=l.useRef(null),st=l.useRef(null),Lt=Xt({initiativeId:s,projectId:a,limit:40,authToken:c,embedMode:o,enabled:!qe,snapshotVersion:Te,zoomLevel:y}),Ft=qe??Lt,{items:me,degraded:ee,isLoading:M,isFetching:nt,isFetchingNextPage:Be,hasNextPage:ze,error:Re,refetch:Pt,fetchNextPage:rt,playWorkstream:Ut,startWorkstreamAutoContinue:it,initiativeGroups:De,milestoneGroups:_e}=Ft,At=Yt({authToken:c,embedMode:o}),Z=Ae??At,U=t=>`${t.initiativeId}:${t.workstreamId}`,te=y==="workstream",Ge=l.useMemo(()=>K?{duration:.01}:g.surfaceSwitch,[K]),A=l.useMemo(()=>{if($)return me.filter(r=>r.queueState!==x.RUNNING);const t=me.filter(r=>r.queueState!==x.RUNNING);return t.length>0?t:me},[$,me]),at=l.useMemo(()=>A.length===0?"empty":A.some(t=>t.queueState!==x.RUNNING&&t.queueState!==x.BLOCKED)?x.QUEUED:A.some(t=>t.queueState===x.BLOCKED)?x.BLOCKED:A.some(t=>t.queueState===x.RUNNING)?x.RUNNING:x.QUEUED,[A]),ot=l.useMemo(()=>{if(!$)return De;const t=[];for(const r of De){const i=r.items.filter(n=>n.queueState!==x.RUNNING);i.length!==0&&t.push({...r,items:i,queueState:os(i)})}return t},[$,De]),we=l.useMemo(()=>[...ot].sort((t,r)=>{const i=Ue(t.queueState)-Ue(r.queueState);return i!==0?i:t.initiativeTitle.localeCompare(r.initiativeTitle)}),[ot]),lt=l.useMemo(()=>$?_e.filter(t=>t.item.queueState!==x.RUNNING):_e,[$,_e]),ye=l.useMemo(()=>[...lt].sort((t,r)=>{const i=Ue(t.queueState)-Ue(r.queueState);if(i!==0)return i;const n=t.initiativeTitle.localeCompare(r.initiativeTitle);if(n!==0)return n;const m=t.workstreamTitle.localeCompare(r.workstreamTitle);return m!==0?m:t.milestoneTitle.localeCompare(r.milestoneTitle)}),[lt]),Ke=l.useMemo(()=>d?we.slice(0,5):we,[d,we]),Qe=l.useMemo(()=>d?ye.slice(0,5):ye,[d,ye]),ct=l.useMemo(()=>y==="initiative"?we.length:y==="milestone"?ye.length:A.length,[A.length,we.length,ye.length,y]),zt=[{value:"initiative",label:"Initiative"},{value:"workstream",label:"Workstream"},{value:"milestone",label:"Milestone"}],C=l.useMemo(()=>te?d?A.slice(0,5):A:[],[d,te,A]),Dt=l.useMemo(()=>C.filter(t=>H.has(U(t))),[H,C]),[xe,dt]=l.useState([]),We=l.useRef([]),ut=l.useMemo(()=>{const t=new Map;for(const r of C)t.set(U(r),r);return t},[C]),B=l.useMemo(()=>C.map(U),[C]),_t=l.useMemo(()=>B.join("|"),[B]);l.useEffect(()=>{dt(t=>{if(d)return[];const r=[],i=new Set(B);for(const n of t)i.has(n)&&r.push(n);for(const n of B)r.includes(n)||r.push(n);return r})},[d,_t]),l.useEffect(()=>{We.current=xe},[xe]),l.useEffect(()=>{$e&&(B.includes($e)||ue(null))},[$e,B]),l.useEffect(()=>{de(t=>{if(t.size===0)return t;const r=new Set(C.map(U)),i=new Set;for(const n of t)r.has(n)&&i.add(n);return i.size===t.size?t:i})},[C]),l.useEffect(()=>{if(!u)return;C.some(r=>U(r)===u)||O(null)},[u,C]),l.useEffect(()=>{if(ee.length===0){Me(!1);return}Me(!1)},[ee]),l.useEffect(()=>{W&&!d&&H.size>0&&ge(!1)},[d,H.size,W]),l.useEffect(()=>{if(!be)return;const t=i=>{var m;const n=i.target;n&&((m=et.current)!=null&&m.contains(n)||ge(!1))},r=i=>{i.key==="Escape"&&ge(!1)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t),document.removeEventListener("keydown",r)}},[be]),l.useEffect(()=>{if(!ze)return;const t=tt.current,r=st.current;if(!t||!r)return;const i=new IntersectionObserver(n=>{n.some(m=>m.isIntersecting)&&(M||Be||rt().catch(()=>null))},{root:t,rootMargin:"220px 0px 220px 0px",threshold:0});return i.observe(r),()=>i.disconnect()},[rt,ze,Be,M]);const mt=async t=>{const r=U(t),i=I(t.workstreamTitle);try{await Z.remove({initiativeId:t.initiativeId,workstreamId:t.workstreamId}),de(n=>{if(!n.has(r))return n;const m=new Set(n);return m.delete(r),m}),ue(n=>n===r?null:n),v(`Removed ${i} from queue.`)}catch(n){const m=n instanceof Error?n.message:"";v(pe(m,"Failed to remove from queue"))}},Gt=(t,r,i)=>{const n=d?B:xe.length>0?xe:B;de(m=>{const f=new Set(m),R=$e;if(i&&R&&n.includes(R)){const w=n.indexOf(t),J=n.indexOf(R);if(w>=0&&J>=0){const[Fe,Pe]=w<J?[w,J]:[J,w];for(const ke of n.slice(Fe,Pe+1))r?f.add(ke):f.delete(ke)}else r?f.add(t):f.delete(t)}else r?f.add(t):f.delete(t);return f}),ue(t)},Kt=()=>{de(new Set(B)),ue(B.length>0?B[B.length-1]:null)},Qt=()=>{de(new Set),ue(null)},Ve=async t=>{if(H.size===0){v("Select one or more queue items first.");return}const r=C.map(i=>({key:U(i),item:i})).filter(i=>H.has(i.key));if(r.length===0){v("Selected queue items are no longer visible.");return}Y(`bulk:${t}`),v(null);try{const i=r.map(({item:w})=>({initiativeId:w.initiativeId,workstreamId:w.workstreamId})),n=await Z.bulk({action:t,items:i}),m=typeof(n==null?void 0:n.updated)=="number"?n.updated??0:0,f=typeof(n==null?void 0:n.failed)=="number"?n.failed??0:0,R=Array.isArray(n==null?void 0:n.errors)?n.errors.filter(w=>typeof w=="string").map(w=>w.trim()).filter(Boolean):[],k=t==="remove"?"removed":t==="move_top"?"moved to top":"moved to bottom";m===0&&f>0&&R.length>0?v(pe(R[0],`${f} queue action${f===1?"":"s"} failed.`)):v(f>0?`${m} item${m===1?"":"s"} ${k}; ${f} failed.`:`${m} item${m===1?"":"s"} ${k}.`),de(new Set),ue(null)}catch(i){const n=i instanceof Error?i.message:"";v(pe(n,"Bulk queue action failed"))}finally{Y(null)}},Wt=async()=>{const t=We.current.map(r=>ut.get(r)).filter(Boolean).map(r=>({initiativeId:r.initiativeId,workstreamId:r.workstreamId}));t.length!==0&&await Z.reorder({order:t})},se=async(t,r,i)=>{v(null),ce(null),_==null||_(null),Y(t);try{const n=await r();v(typeof i=="function"?i(n):i)}catch(n){if(n instanceof ns)ce(n),_==null||_(n);else{const m=n instanceof Error?n.message:"";v(pe(m,"Action failed"))}}finally{Y(null)}},Ee=async t=>V?await V(t):await Ut({initiativeId:t.initiativeId,workstreamId:t.workstreamId,agentId:t.runnerAgentId}),Le=j?"upgrade":Re?"error":F?"notice":null,xt=Re?ps(Re):null,ve=ee.length>0?hs(ee[0]):null,Vt=Le!==null,Ht=ee.length>0&&ve!==null&&!Et&&u===null&&!be,ne=Dt.length,Zt=l.useMemo(()=>y==="initiative"?Ke.length>0:y==="milestone"?Qe.length>0:C.length>0,[Ke.length,C.length,Qe.length,y]),pt=W&&te&&!d&&ne>0,He=l.useMemo(()=>{if(!$)return 0;let t=0;for(const r of me)r.queueState===x.RUNNING&&t++;return t},[$,me]),Jt=y==="initiative"?"No initiatives in the queue right now.":y==="milestone"?"No milestone slices in the queue right now.":He>0?`All queued work is in progress (${He} running).`:ee.length>0&&ve?"Queue signal is delayed right now.":"No queued workstreams right now.",ht=e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:Kt,className:"control-pill h-8 px-2.5 text-caption font-semibold",children:"Select all"}),e.jsx("button",{type:"button",onClick:Qt,disabled:H.size===0,className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Clear"}),e.jsx("button",{type:"button",disabled:ne===0||P==="bulk:move_top",onClick:()=>void Ve("move_top"),className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Move top"}),e.jsx("button",{type:"button",disabled:ne===0||P==="bulk:move_bottom",onClick:()=>void Ve("move_bottom"),className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Move bottom"}),e.jsx("button",{type:"button",disabled:ne===0||P==="bulk:remove",onClick:()=>void Ve("remove"),className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Remove"})]});return e.jsxs(Ot,{surface:Ce==="card",className:`flex h-full min-h-0 flex-col overflow-hidden ${q?"":"card-enter"} ${Ce==="flat"?"!rounded-none !border-none !bg-transparent !shadow-none":""} ${S??""}`,children:[b?e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-subtle px-4 py-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("h2",{className:"truncate text-heading font-semibold text-white",children:h}),e.jsx("span",{className:"chip inline-flex min-w-[52px] justify-center text-micro tabular-nums",children:M?e.jsx("span",{"aria-hidden":!0,className:"h-2.5 w-5 rounded bg-white/15 animate-pulse"}):ct}),e.jsx("span",{className:ie("inline-flex min-w-[92px] justify-end text-micro text-muted transition-opacity",nt&&!M?"opacity-100":"opacity-0"),"aria-live":"polite",children:"refreshing…"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"inline-flex items-center rounded-xl border border-white/[0.1] bg-white/[0.03] p-1",role:"tablist","aria-label":"Next Up scope",children:zt.map(t=>{const r=y===t.value;return e.jsxs(D.button,{type:"button",role:"tab","aria-selected":r,onClick:()=>X(t.value),...g.segmentedTap,className:ie("relative h-7 rounded-lg px-2.5 text-caption font-semibold transition-colors",r?"text-[#E8FFD0]":"text-secondary hover:text-white"),title:`Show ${t.label.toLowerCase()} queue`,children:[r?e.jsx(D.span,{layoutId:"next-up-scope-indicator",transition:K?{duration:.01}:g.railMorphSpring,className:"pointer-events-none absolute inset-0 rounded-lg border border-[#BFFF00]/35 bg-[#BFFF00]/16","aria-hidden":!0}):null,e.jsx("span",{className:"relative z-[1]",children:t.label})]},t.value)})}),Q?e.jsx("button",{type:"button",onClick:()=>oe(!d),className:"control-pill h-8 flex-shrink-0 whitespace-nowrap px-3 text-caption font-semibold",title:d?"Switch to expanded cards":"Switch to compact list","aria-label":d?"Expand Next Up queue":"Compact Next Up queue",children:d?"Expand":"Compact"}):null]})]}):null,Vt&&e.jsx("div",{className:"px-3 pt-2",children:e.jsx(Ne,{initial:!1,mode:"wait",children:Le==="upgrade"&&j?e.jsx(D.div,{initial:{opacity:0,y:-4,scale:.99},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.99},transition:Ge,className:"rounded-xl border border-amber-200/25 bg-amber-200/10 px-3 py-2 text-caption text-amber-100",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-full border border-amber-200/25 bg-amber-200/10 px-2 py-0.5 text-micro font-semibold uppercase tracking-[0.08em] text-amber-100/90",children:"Upgrade required"}),e.jsxs("span",{className:"truncate text-micro text-secondary",children:[bt(j.currentPlan)," →"," ",bt(j.requiredPlan)]})]}),e.jsx("div",{className:"mt-1 line-clamp-2 text-caption leading-snug text-amber-50/90",title:j.message,children:j.message}),F?e.jsx("div",{className:"mt-1 text-micro text-rose-50/85",children:F}):null]}),e.jsxs("div",{className:"flex flex-shrink-0 flex-col items-end gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:()=>void ls({actions:j.actions,requiredPlan:j.requiredPlan}).catch(t=>v(pe(t instanceof Error?t.message:"","Checkout failed"))),className:"h-7 rounded-full border border-amber-200/25 bg-amber-200/15 px-3 text-micro font-semibold text-amber-50 transition-colors hover:bg-amber-200/20",children:"Upgrade"}),e.jsx("button",{type:"button",onClick:()=>void cs({actions:j.actions}).catch(t=>v(pe(t instanceof Error?t.message:"","Portal failed"))),className:"h-7 rounded-full border border-strong bg-white/[0.04] px-3 text-micro font-semibold text-primary transition-colors hover:bg-white/[0.08]",children:"Billing"}),L&&e.jsx("button",{type:"button",onClick:L,className:"h-7 rounded-full border border-strong bg-white/[0.04] px-2.5 text-micro font-semibold text-primary transition-colors hover:bg-white/[0.08]",children:"Settings"})]}),(ft=j.actions)!=null&&ft.pricing?e.jsx("a",{href:j.actions.pricing,target:"_blank",rel:"noopener noreferrer",className:"text-micro text-secondary underline decoration-white/20 hover:text-primary",children:"View pricing"}):null]})]})},"upgrade"):Le==="error"&&xt?e.jsx(D.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:Ge,className:"rounded-xl border border-red-400/25 bg-red-500/[0.08] px-3 py-2 text-caption text-red-100",children:xt},"error"):Le==="notice"&&F?e.jsx(D.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:Ge,className:"rounded-xl border border-white/[0.1] bg-white/[0.03] px-3 py-2 text-caption text-primary",children:F},"notice"):null})}),e.jsxs("div",{ref:tt,className:`flex-1 space-y-2.5 overflow-y-auto overscroll-y-contain scroll-smooth px-3 pb-3 ${b?"pt-1":"pt-2.5"}`,children:[!M&&ct>0?e.jsxs("div",{className:"flex flex-col gap-2.5 px-0.5 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-micro uppercase tracking-[0.08em] text-muted",children:y==="initiative"?"Initiatives":y==="milestone"?"Milestone slices":at===x.BLOCKED?"Needs attention":at===x.RUNNING?"Running now":"Next Up"}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[ne>0?e.jsxs("span",{className:"chip text-micro",children:[ne," selected"]}):null,e.jsx("span",{className:ie("inline-flex min-w-[92px] text-micro text-muted transition-opacity",nt&&!M?"opacity-100":"opacity-0"),"aria-live":"polite",children:"refreshing…"}),W&&te&&!d&&ne===0?e.jsx("span",{className:"text-micro text-muted",children:"Shift+select to pick ranges."}):null]})]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5 sm:justify-end",children:[Q?e.jsx("button",{type:"button",onClick:()=>oe(!d),className:"control-pill h-8 px-2.5 text-caption font-semibold",title:d?"Switch to expanded cards":"Switch to compact list","aria-label":d?"Expand Next Up queue":"Compact Next Up queue",children:d?"Expand":"Compact"}):null,pt?e.jsx("div",{className:"flex flex-wrap justify-end gap-1.5",children:ht}):null,!pt&&Ie&&te?e.jsxs("div",{ref:et,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>ge(t=>!t),className:"control-pill h-8 px-2.5 text-caption font-semibold","aria-haspopup":"menu","aria-expanded":be,title:"Queue settings",children:[e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-85","aria-hidden":!0,children:[e.jsx("path",{d:"M4 6h16"}),e.jsx("path",{d:"M7 12h10"}),e.jsx("path",{d:"M10 18h4"})]}),e.jsx("span",{children:"Queue"})]}),be?e.jsx("div",{className:"surface-tier-2 absolute right-0 top-[calc(100%+8px)] z-[280] w-[320px] max-w-[86vw] rounded-xl p-3 shadow-[0_18px_42px_rgba(0,0,0,0.46)] backdrop-blur-xl",children:e.jsxs("div",{className:"space-y-2.5",children:[W&&!d?e.jsxs("div",{children:[e.jsx("p",{className:"section-kicker",children:"Bulk actions"}),e.jsx("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:ht})]}):null,L?e.jsx("button",{type:"button",onClick:()=>{ge(!1),L()},className:"control-pill h-7 px-2.5 text-micro font-semibold",children:"Open settings"}):null]})}):null]}):null]})]}):null,M?e.jsx(fs,{compact:d}):null,!M&&!Zt&&!Re&&e.jsx(es,{icon:"queue",headline:Jt,description:He>0?"Check the In Progress tab to see active work.":ve??"Create an initiative or add workstreams to populate the queue.",primaryAction:ee.length>0&&ve?{label:"Retry now",onClick:()=>{Me(!1),Pt()}}:void 0}),!M&&y==="initiative"?e.jsx(Ne,{initial:!1,children:Ke.map((t,r)=>{const i=t.items.find(k=>k.queueState!==x.RUNNING&&k.queueState!=="completed")??t.items[0]??null,n=Se(t.initiativeTitle,t.initiativeId,"Initiative"),m=wt(t.queueState),f=yt(t.queueState),R=t.items.reduce((k,w)=>k+(w.sliceTaskCount??0),0);return e.jsxs(D.article,{layout:!0,initial:{opacity:0,y:8,scale:.99},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.99},transition:{duration:K?.01:g.surfaceSwitch.duration,delay:K?0:Math.min(r,g.listStaggerMaxItems)*g.listStaggerStep,ease:g.surfaceSwitch.ease},className:"rounded-2xl border border-white/[0.08] bg-white/[0.02] px-3 py-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Initiative"}),e.jsx("p",{className:"mt-0.5 truncate text-body font-semibold text-white",title:n,children:n})]}),e.jsx("span",{className:ie("inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.08em]",f),children:m})]}),e.jsxs("p",{className:"mt-1 text-micro text-secondary",children:[t.workstreamCount," workstreams · ",R," tasks"]}),e.jsx("div",{className:"mt-2 space-y-1",children:t.items.slice(0,3).map((k,w)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-white/[0.06] bg-black/[0.18] px-2.5 py-1.5 text-caption",children:[e.jsx("span",{className:"truncate text-white/84",children:I(k.workstreamTitle)}),e.jsxs("span",{className:"text-micro text-secondary",children:[k.sliceTaskCount??0," tasks"]})]},`${k.workstreamId}:${w}`))}),e.jsxs("div",{className:"mt-2.5 flex items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:()=>T==null?void 0:T(t.initiativeId,t.initiativeTitle),className:"control-pill h-7 px-2.5 text-micro font-semibold",children:"Open"}),e.jsx("button",{type:"button",disabled:!i||P===`initiative:${t.initiativeId}`,onClick:()=>{i&&se(`initiative:${t.initiativeId}`,()=>Ee(i),`Dispatched ${I(i.workstreamTitle)}.`)},className:"control-pill h-7 px-2.5 text-micro font-semibold disabled:opacity-45",children:"Dispatch"})]})]},`initiative-group:${t.initiativeId}`)})}):null,!M&&y==="milestone"?e.jsx(Ne,{initial:!1,children:Qe.map((t,r)=>{const i=t.item,n=`milestone:${t.workstreamId}:${t.milestoneId??"none"}`;return e.jsxs(D.article,{layout:!0,initial:{opacity:0,y:8,scale:.99},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.99},transition:{duration:K?.01:g.surfaceSwitch.duration,delay:K?0:Math.min(r,g.listStaggerMaxItems)*g.listStaggerStep,ease:g.surfaceSwitch.ease},className:"rounded-2xl border border-white/[0.08] bg-white/[0.02] px-3 py-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:[I(t.initiativeTitle)," · ",I(t.workstreamTitle)]}),e.jsx("p",{className:"mt-0.5 truncate text-body font-semibold text-white",title:t.milestoneTitle,children:I(t.milestoneTitle)})]}),e.jsx("span",{className:ie("inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.08em]",yt(t.queueState)),children:wt(t.queueState)})]}),e.jsxs("p",{className:"mt-1 text-micro text-secondary",children:[t.taskCount," tasks in slice"]}),e.jsxs("div",{className:"mt-2.5 flex items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:()=>T==null?void 0:T(t.initiativeId,t.initiativeTitle),className:"control-pill h-7 px-2.5 text-micro font-semibold",children:"Open"}),e.jsx("button",{type:"button",disabled:P===n||t.queueState===x.RUNNING,onClick:()=>void se(n,()=>Ee(i),m=>Ye(i,m)),className:"control-pill h-7 px-2.5 text-micro font-semibold disabled:opacity-45",children:t.queueState===x.RUNNING?"Running":"Start"})]})]},`${t.initiativeId}:${t.workstreamId}:${t.milestoneId??"none"}`)})}):null,!M&&te&&d?e.jsx(Ne,{initial:!1,children:C.map((t,r)=>{const i=U(t),n=P===i,m=t.queueState===x.RUNNING,f=t.nextTaskDueAt?kt(t.nextTaskDueAt):null,R=Se(t.initiativeTitle,t.initiativeId,"Initiative"),k=Se(t.workstreamTitle,t.workstreamId,"Workstream"),w=Tt(t),J=t.nextTaskTitle?I(t.nextTaskTitle):null,Fe=t.blockReason?I(t.blockReason):null,Pe=$t(t),ke=Mt(t);return e.jsxs(D.article,{layout:!0,initial:{opacity:0,y:6,scale:.99},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.99},transition:{duration:K?.01:g.surfaceSwitch.duration,delay:K?0:Math.min(r,g.listStaggerMaxItems)*g.listStaggerStep,ease:g.surfaceSwitch.ease},className:"group relative overflow-visible rounded-2xl border border-white/[0.08] bg-white/[0.02] px-2.5 py-2 cursor-pointer transition-colors hover:border-white/[0.14]",onClick:()=>G==null?void 0:G(t),role:"button",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),G==null||G(t))},children:[e.jsx("div",{className:`pointer-events-none absolute inset-x-2.5 top-0 h-px bg-gradient-to-r ${Ct(t.queueState)}`,"aria-hidden":!0}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[e.jsx(Nt,{name:Pe,hint:Bt(t,Pe),size:"xs"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(je,{type:"initiative",size:11,className:"flex-shrink-0 opacity-85"}),e.jsx("button",{type:"button",onClick:()=>T==null?void 0:T(t.initiativeId,t.initiativeTitle),className:"block min-w-0 flex-1 truncate text-left text-micro uppercase tracking-[0.08em] text-muted transition-colors hover:text-white/72",title:R,children:R}),w?e.jsx("span",{className:ie("inline-flex flex-shrink-0 items-center rounded-full border px-2 py-0.5 text-[9px] font-semibold uppercase tracking-[0.08em]",w.toneClass),title:w.longLabel,children:w.shortLabel}):null]}),e.jsxs("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 text-caption font-semibold leading-snug text-white",title:k,children:[e.jsx(je,{type:"workstream",size:12,className:"flex-shrink-0 opacity-95"}),e.jsx("span",{className:"line-clamp-2",children:k})]}),J?e.jsxs("p",{className:"mt-0.5 line-clamp-2 text-micro leading-snug text-secondary",title:`${Je(t.queueState)}: ${J}${f?` · ${f}`:""}`,children:[Je(t.queueState),": ",J,f?` · ${f}`:""]}):e.jsx("p",{className:"mt-0.5 line-clamp-2 text-micro leading-snug text-secondary",title:Xe(t),children:Xe(t)}),ke?e.jsxs("p",{className:"mt-0.5 text-micro text-muted",children:["Runner ",ke]}):null,t.milestoneBreakdown&&t.milestoneBreakdown.length>0&&e.jsxs("div",{className:"mt-1.5 space-y-1",children:[e.jsx(jt,{milestones:t.milestoneBreakdown}),e.jsxs("p",{className:"text-micro text-secondary",children:[t.milestoneBreakdown.length," milestone",t.milestoneBreakdown.length!==1?"s":""," · ",t.milestoneBreakdown.reduce((p,E)=>p+E.doneTasks,0),"/",t.milestoneBreakdown.reduce((p,E)=>p+E.totalTasks,0)," tasks done"]})]}),t.queueState===x.COMPLETED&&t.milestoneBreakdown&&t.milestoneBreakdown.length>0&&e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-micro",style:{color:ts.done.text},children:[e.jsxs("span",{children:["✓ ",t.milestoneBreakdown.length," milestones"]}),e.jsxs("span",{children:["✓ ",t.milestoneBreakdown.reduce((p,E)=>p+E.totalTasks,0)," tasks"]})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(()=>{const p=t.objectiveScore??t.compositeScore??null;if(p==null)return null;const E=p>=80?"S":p>=60?"A":"B",re=E==="S"?"border-[#BFFF00]/30 bg-[#BFFF00]/[0.12] text-[#d8ffa1]":E==="A"?"border-[#14B8A6]/30 bg-[#14B8A6]/[0.12] text-[#87FFE9]":"border-white/[0.12] bg-white/[0.05] text-white/60";return e.jsxs("span",{className:`chip text-[9px] font-semibold ${re}`,children:[E,"-tier"]})})(),(()=>{const p=t.expectedValueUsd,E=t.sliceTaskCount??0,re=[];return E>0&&re.push(`${E} tasks`),typeof p=="number"&&p>0&&re.push(`$${p.toFixed(2)}`),f&&re.push(f),re.length===0?null:e.jsx("span",{className:"text-micro text-muted",children:re.join(" · ")})})()]})]})]}),(t.sliceTaskCount??0)>0&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-[2px] rounded-b-2xl overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.max(t.queueState===x.COMPLETED?100:t.queueState===x.RUNNING?50:15,4)}%`,background:t.queueState===x.COMPLETED?Ze.teal:`linear-gradient(90deg, ${Ze.lime}, ${Ze.teal})`,opacity:.6}})}),Fe&&e.jsxs("div",{className:"mt-1.5 rounded-lg border border-red-400/24 bg-red-500/[0.08] px-2.5 py-1 text-micro text-red-100/85",children:["Blocked: ",Fe]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",onClick:p=>p.stopPropagation(),children:[e.jsx("button",{type:"button",disabled:n||m,onClick:()=>void se(i,()=>Ee(t),p=>Ye(t,p)),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:m?"Already running":"Start now",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(qt,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:m?"Running":"Start"})]})}),e.jsxs("div",{className:"relative ml-auto",children:[e.jsx("button",{type:"button",disabled:n,onClick:()=>O(p=>p===i?null:i),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:"Queue actions",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Rt,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:"More"})]})}),u===i&&e.jsxs("div",{className:"absolute right-0 top-[calc(100%+6px)] z-[320] min-w-[178px] rounded-xl border border-white/[0.1] bg-[#080d14]/95 p-1.5 shadow-[0_16px_36px_rgba(0,0,0,0.42)] backdrop-blur",children:[e.jsx("button",{type:"button",onClick:()=>{O(null),se(`${i}:top`,()=>Z.move({initiativeId:t.initiativeId,workstreamId:t.workstreamId,placement:"top"}),`Moved ${k} to top of queue.`)},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to top"}),e.jsx("button",{type:"button",onClick:()=>{O(null),se(`${i}:bottom`,()=>Z.move({initiativeId:t.initiativeId,workstreamId:t.workstreamId,placement:"bottom"}),`Moved ${k} to bottom of queue.`)},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to bottom"}),e.jsx("button",{type:"button",onClick:()=>{O(null),se(`${i}:auto`,()=>it({initiativeId:t.initiativeId,workstreamId:t.workstreamId,agentId:t.runnerAgentId,scope:"initiative"}),`Auto enabled for ${R}.`)},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Auto on"}),e.jsx("button",{type:"button",disabled:Z.isRemoving,onClick:()=>{O(null),mt(t)},className:"mt-1 flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-red-100 transition-colors hover:bg-red-500/[0.12] disabled:opacity-45",children:"Remove from queue"})]})]})]})]},i)})}):!M&&te?e.jsx(rs,{axis:"y",values:xe,onReorder:t=>{We.current=t,dt(t)},className:"space-y-2.5",children:xe.map(t=>ut.get(t)).filter(Boolean).map((t,r)=>e.jsx(gs,{item:t,index:r,actionKey:P,setNotice:v,setUpgradeGate:ce,onUpgradeGate:_,onOpenInitiative:T,onOpenSliceDetail:G,selected:H.has(U(t)),selectionEnabled:W,onToggleSelection:Gt,menuKey:u,setMenuKey:O,onPlayWorkstream:Ee,startWorkstreamAutoContinue:it,triagePlacement:le,onPauseWorkstream:(i,n)=>Z.stopTriage({initiativeId:i.initiativeId,workstreamId:i.workstreamId,placement:n,resetToTodo:!1}),onMoveWorkstream:(i,n)=>Z.move({initiativeId:i.initiativeId,workstreamId:i.workstreamId,placement:n}),onCommitReorder:()=>void Wt().catch(()=>null),onDismiss:mt,runAction:se},U(t)))}):null,(ze||Be)&&e.jsx("div",{ref:st,className:"flex h-10 items-center justify-center",children:e.jsx("span",{className:"text-micro text-muted",children:Be?"Loading more queue items…":"Scroll for more"})})]}),e.jsx("div",{className:"pointer-events-none absolute bottom-3 right-3 z-[250]",children:e.jsx(us,{open:Ht,tone:"warning",title:"Limited signal",message:ve,autoDismissMs:6e3,onDismiss:()=>Me(!0)})})]})}function gs({item:s,index:a,actionKey:c,setNotice:o,setUpgradeGate:h,onUpgradeGate:b,onOpenInitiative:N,onOpenSliceDetail:S,selected:q,selectionEnabled:Q,onToggleSelection:he,menuKey:T,setMenuKey:L,onPlayWorkstream:_,startWorkstreamAutoContinue:G,triagePlacement:W,onPauseWorkstream:Ce,onMoveWorkstream:Ie,onCommitReorder:qe,onDismiss:Ae,runAction:V}){const Te=is(),$=St(),[ae,fe]=l.useState(!1),d=`${s.initiativeId}:${s.workstreamId}`,oe=c===d,F=s.queueState===x.RUNNING,v=s.nextTaskDueAt?kt(s.nextTaskDueAt):null,y=Se(s.initiativeTitle,s.initiativeId,"Initiative"),X=Se(s.workstreamTitle,s.workstreamId,"Workstream"),le=Tt(s),j=s.nextTaskTitle?I(s.nextTaskTitle):null,ce=s.blockReason?I(s.blockReason):null,P=$t(s),Y=Mt(s);return e.jsx(as,{value:d,id:d,dragListener:!1,dragControls:Te,onDragStart:()=>fe(!0),onDragEnd:()=>{fe(!1),qe()},whileDrag:{scale:1.02,boxShadow:"0 20px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(191,255,0,0.15)",zIndex:50,cursor:"grabbing"},className:"relative",children:e.jsxs(D.article,{layout:!0,initial:{opacity:0,y:12,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.98},transition:{duration:$?.01:g.surfaceSwitch.duration,ease:g.surfaceSwitch.ease,delay:$?0:Math.min(a,g.listStaggerMaxItems)*g.listStaggerStep,opacity:{duration:$?.01:g.surfaceSwitch.duration,ease:g.surfaceSwitch.ease}},className:"group relative overflow-visible rounded-2xl border border-white/[0.08] bg-white/[0.02] px-3 py-3 cursor-pointer transition-colors hover:border-white/[0.14]",onClick:()=>S==null?void 0:S(s),role:"button",tabIndex:0,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),S==null||S(s))},children:[e.jsx("div",{className:`pointer-events-none absolute inset-x-3 top-0 h-px bg-gradient-to-r ${Ct(s.queueState)}`,"aria-hidden":!0}),e.jsx("div",{className:"flex items-start justify-between gap-2.5",children:e.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-2.5",children:[e.jsxs("div",{className:"relative h-8 w-8 flex-shrink-0",children:[e.jsx("div",{className:`absolute inset-0 transition-[opacity,transform] duration-200 ease-out ${Q?q?"opacity-0 scale-90":"opacity-100 scale-100 group-hover:opacity-0 group-hover:scale-90 group-focus-within:opacity-0 group-focus-within:scale-90":"opacity-100 scale-100"}`,children:e.jsx(Nt,{name:P,hint:Bt(s,P),size:"sm"})}),Q?e.jsx("button",{type:"button",role:"checkbox","aria-checked":q,"aria-label":"Select queue row",title:q?"Selected (Shift+click for range)":"Select (Shift+click for range)",onClick:u=>{u.stopPropagation(),he(d,!q,u.shiftKey)},onMouseDown:u=>u.stopPropagation(),onKeyDown:u=>u.stopPropagation(),className:`absolute inset-0 flex items-center justify-center rounded-full border transition-[opacity,transform,background-color,border-color,color] duration-200 ease-out ${q?"opacity-100 scale-100 border-[#BFFF00]/40 bg-[#BFFF00]/18 text-[#E1FFB2]":"opacity-0 scale-90 border-white/[0.24] bg-black/55 text-white/78 group-hover:opacity-100 group-hover:scale-100 group-focus-within:opacity-100 group-focus-within:scale-100 hover:bg-black/62"}`,children:e.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center rounded-full border border-current/45 bg-black/30",children:q?e.jsx("svg",{viewBox:"0 0 16 16",className:"h-2.5 w-2.5",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M3.2 8.3 6.2 11l6.6-6.1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null})}):null]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(je,{type:"initiative",size:11,className:"flex-shrink-0 opacity-85"}),e.jsx("button",{type:"button",onClick:()=>N==null?void 0:N(s.initiativeId,s.initiativeTitle),className:"block min-w-0 flex-1 truncate text-left text-micro uppercase tracking-[0.08em] text-muted transition-colors hover:text-white/72",title:y,children:y}),le?e.jsx("span",{className:ie("inline-flex flex-shrink-0 items-center rounded-full border px-2 py-0.5 text-[9px] font-semibold uppercase tracking-[0.08em]",le.toneClass),title:le.longLabel,children:le.shortLabel}):null]}),e.jsxs("div",{className:"mt-0.5 flex min-w-0 items-start gap-1.5",children:[e.jsx(je,{type:"workstream",size:12,className:"mt-[3px] flex-shrink-0 opacity-95"}),e.jsx("p",{className:"min-w-0 line-clamp-2 text-body font-semibold leading-snug text-white",title:X,children:X})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-micro text-secondary",children:[e.jsx("span",{className:"rounded-full border border-strong bg-white/[0.03] px-2 py-0.5 text-micro uppercase tracking-[0.08em] text-secondary",children:"Runner"}),e.jsxs("span",{className:"truncate text-white/68",children:[P,Y?` · ${Y}`:""]})]})]})]})}),e.jsx("div",{className:"mt-2 rounded-lg border border-white/[0.07] bg-black/[0.18] px-2.5 py-2 text-caption text-white/68",children:j?e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-micro uppercase tracking-[0.08em] text-white/44",children:[e.jsx(je,{type:"task",size:10,className:"flex-shrink-0 opacity-80"}),e.jsx("span",{children:Je(s.queueState)}),v?e.jsxs("span",{className:"truncate text-micro normal-case tracking-normal text-muted",children:["· ",v]}):null]}),e.jsx("p",{className:"line-clamp-2 break-words text-caption leading-snug text-white/84",title:j,children:j})]}):e.jsx("span",{className:"text-secondary",children:Xe(s)})}),s.milestoneBreakdown&&s.milestoneBreakdown.length>0&&e.jsxs("div",{className:"mt-2 rounded-lg border border-white/[0.07] bg-black/[0.18] px-2.5 py-2",children:[e.jsx(jt,{milestones:s.milestoneBreakdown}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-x-3 gap-y-0.5",children:[s.milestoneBreakdown.slice(0,4).map(u=>e.jsxs("span",{className:"text-micro text-secondary",children:[u.doneTasks===u.totalTasks&&u.totalTasks>0?"✓":"○"," ",u.title,e.jsxs("span",{className:"ml-1 text-muted",children:[u.doneTasks,"/",u.totalTasks]})]},u.id)),s.milestoneBreakdown.length>4&&e.jsxs("span",{className:"text-micro text-muted",children:["+",s.milestoneBreakdown.length-4]})]})]}),ce&&e.jsxs("div",{className:"mt-1.5 rounded-lg border border-red-400/24 bg-red-500/[0.08] px-2.5 py-1 text-micro text-red-100/85",children:["Blocked: ",ce]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",onClick:u=>u.stopPropagation(),children:[e.jsx("button",{type:"button",disabled:oe||F,onClick:()=>void V(d,()=>_(s),u=>Ye(s,u)),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:F?"Already running":"Start this workstream now",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(qt,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:F?"Running":"Start"})]})}),e.jsxs("button",{type:"button",onPointerDown:u=>Te.start(u),"aria-label":"Drag to reorder",title:ae?"Reordering":"Drag to reorder",className:`control-pill flex h-7 items-center justify-center gap-1 px-2 text-micro font-semibold transition-colors ${ae?"border-[#BFFF00]/35 bg-[#BFFF00]/14 text-[#E1FFB2] cursor-grabbing":"cursor-grab hover:bg-white/[0.08] hover:text-bright"}`,children:[ae?e.jsx(xs,{className:"h-3.5 w-3.5 opacity-90"}):e.jsx(ms,{className:"h-3.5 w-3.5 opacity-90"}),e.jsx("span",{children:ae?"Reordering":"Drag"})]}),e.jsxs("div",{className:"relative ml-auto",children:[e.jsx("button",{type:"button",disabled:oe,onClick:()=>L(u=>u===d?null:d),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:"Queue actions",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Rt,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:"More"})]})}),T===d&&e.jsxs("div",{className:"absolute right-0 top-[calc(100%+6px)] z-[320] min-w-[198px] rounded-xl border border-white/[0.1] bg-[#080d14]/95 p-1.5 shadow-[0_16px_36px_rgba(0,0,0,0.42)] backdrop-blur",children:[e.jsx("button",{type:"button",onClick:()=>{L(null),V(`${d}:top`,()=>Ie(s,"top"),`Moved ${X} to top of queue.`)},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to top"}),e.jsx("button",{type:"button",onClick:()=>{L(null),V(`${d}:bottom`,()=>Ie(s,"bottom"),`Moved ${X} to bottom of queue.`)},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to bottom"}),e.jsx("button",{type:"button",onClick:()=>{L(null),V(`${d}:auto`,()=>G({initiativeId:s.initiativeId,workstreamId:s.workstreamId,agentId:s.runnerAgentId,scope:"initiative"}),`Auto enabled for ${y}.`)},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Auto on"}),F?e.jsx("button",{type:"button",onClick:()=>{L(null),V(`${d}:pause`,()=>Ce(s,W),`Paused ${X}.`)},className:"mt-1 flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Pause run"}):null,e.jsx("button",{type:"button",disabled:oe||F,onClick:()=>{L(null),Ae(s)},className:"mt-1 flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-red-100 transition-colors hover:bg-red-500/[0.12] disabled:opacity-45",children:"Remove from queue"})]})]})]})]})})}const js=Object.freeze(Object.defineProperty({__proto__:null,NextUpPanel:bs},Symbol.toStringTag,{value:"Module"}));export{us as I,bs as N,js as a,ls as o};