@capagents/forgeqe 3.2.6 → 3.2.7

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 (166) hide show
  1. package/HOW_TO_USE.md +4 -1
  2. package/dist/docs-site/CREDITS.md +3 -3
  3. package/dist/docs-site/{LICENSE.dm-sans.txt → LICENSE.geist.txt} +1 -1
  4. package/dist/docs-site/app-look.css +72 -32
  5. package/dist/docs-site/architecture-map/arch-theme.css +31 -40
  6. package/dist/docs-site/docs/app-theme.css +109 -108
  7. package/dist/docs-site/docs/area-api/index.html +3 -3
  8. package/dist/docs-site/docs/area-browser/index.html +2 -0
  9. package/dist/docs-site/docs/area-setup/index.html +1 -0
  10. package/dist/docs-site/docs/search.js +1 -1
  11. package/dist/docs-site/docs/web-app/index.html +2 -2
  12. package/dist/docs-site/security/security-theme.css +66 -69
  13. package/dist/forgeqe.js +1870 -1847
  14. package/dist/web/THIRD_PARTY_NOTICES.md +0 -101
  15. package/dist/web/assets/{3d-force-graph-CNVqakzA.js → 3d-force-graph-CUGt_TSW.js} +1 -1
  16. package/dist/web/assets/Agent-DiX8ljlC.js +8 -0
  17. package/dist/web/assets/AgentWork-BpfMY_xu.js +2 -0
  18. package/dist/web/assets/ApiTests-4jfzlfVd.js +15 -0
  19. package/dist/web/assets/Browse-ByDemInL.js +1 -0
  20. package/dist/web/assets/Chat-C3wKV0CI.js +3 -0
  21. package/dist/web/assets/CommandPalette-CKJHtRjo.js +1 -0
  22. package/dist/web/assets/Compare-DtW2g-qb.js +1 -0
  23. package/dist/web/assets/Cost-DW-kVEL8.js +1 -0
  24. package/dist/web/assets/Data--HGneNun.js +6 -0
  25. package/dist/web/assets/Desktop-DQf5gv7D.js +1 -0
  26. package/dist/web/assets/DesktopReview-BaPYt0kl.js +2 -0
  27. package/dist/web/assets/DeviceScreen-DzVNfMwl.js +1 -0
  28. package/dist/web/assets/Evidence-CxRMnZch.js +1 -0
  29. package/dist/web/assets/Explore-ChpAuezG.js +2 -0
  30. package/dist/web/assets/Features-VsLb8QTH.js +1 -0
  31. package/dist/web/assets/Flags-Do-pvmCF.js +2 -0
  32. package/dist/web/assets/Flaky-CyhTszAg.js +1 -0
  33. package/dist/web/assets/Impact-BWBAXRuw.js +3 -0
  34. package/dist/web/assets/Jobs-C_MjXv0_.js +5 -0
  35. package/dist/web/assets/KindPage-Bb3Kp4-q.js +6 -0
  36. package/dist/web/assets/LiveDevice-OyxEiqBt.js +1 -0
  37. package/dist/web/assets/Migration-C80mGA3h.js +8 -0
  38. package/dist/web/assets/Mobile-C4wVBYfr.js +1 -0
  39. package/dist/web/assets/Observability-DdTOLp2C.js +1 -0
  40. package/dist/web/assets/PageAgent-Bi53-H99.js +1 -0
  41. package/dist/web/assets/Product-0LXndvp-.js +12 -0
  42. package/dist/web/assets/Production-oTXhv40a.js +1 -0
  43. package/dist/web/assets/Quality-CY0CJF9e.js +1 -0
  44. package/dist/web/assets/Readiness-Bv9uTTiI.js +1 -0
  45. package/dist/web/assets/Record-C-kyOkYq.js +1 -0
  46. package/dist/web/assets/Regression-CwKxvG1h.js +5 -0
  47. package/dist/web/assets/RelationGraph-BQl3M4zd.js +1 -0
  48. package/dist/web/assets/Reports-Ck8rc3br.js +2 -0
  49. package/dist/web/assets/Responsive-COmV2NXo.js +3 -0
  50. package/dist/web/assets/RunDiff-BBT1sQLh.js +1 -0
  51. package/dist/web/assets/Settings-7aMk9Sqx.js +21 -0
  52. package/dist/web/assets/Steps-C_vL6-8p.js +3 -0
  53. package/dist/web/assets/TestData-KzMy9N9f.js +2 -0
  54. package/dist/web/assets/TestManagement-BCEhOGB9.js +4 -0
  55. package/dist/web/assets/WhatsNew-DTcaqdOJ.js +1 -0
  56. package/dist/web/assets/agentSettingsSheet-DM1aa237.js +1 -0
  57. package/dist/web/assets/choice-B6z9CWyZ.js +1 -0
  58. package/dist/web/assets/code-DzYywAs5.js +1 -0
  59. package/dist/web/assets/{coverage-xSRsKFL6.js → coverage-BhtF065n.js} +4 -4
  60. package/dist/web/assets/dataParts-BNDVxwFb.js +3 -0
  61. package/dist/web/assets/desktopAppPath-D4hHP56R.js +1 -0
  62. package/dist/web/assets/frame-CNYHTG4T.js +13 -0
  63. package/dist/web/assets/index-B1Q2Dlqw.js +56 -0
  64. package/dist/web/assets/index-sxUpjgyw.css +2 -0
  65. package/dist/web/assets/markdown-BhU7ng6c.js +8 -0
  66. package/dist/web/assets/pageBack-BoSbGSU6.js +3 -0
  67. package/dist/web/assets/palette-BsY8OLxd.js +1 -0
  68. package/dist/web/assets/{paletteCommands-CwHwpVqt.js → paletteCommands-DflHQ05x.js} +1 -1
  69. package/dist/web/assets/parts-C4QMgN_N.js +1 -0
  70. package/dist/web/assets/preload-helper-qorOEK5q.js +1 -0
  71. package/dist/web/assets/productParts-Dxl-TQKY.js +1 -0
  72. package/dist/web/assets/qualityParts-ClGKtjEv.js +1 -0
  73. package/dist/web/assets/radio-DDxnnflQ.js +1 -0
  74. package/dist/web/assets/recordTest-B33rIncn.js +1 -0
  75. package/dist/web/assets/route-D9uPlFWw.js +1 -0
  76. package/dist/web/assets/{sectionList-BlwEtA8S.js → sectionList-e5mFDaS2.js} +1 -1
  77. package/dist/web/assets/stepper-DSDz0uu8.js +1 -0
  78. package/dist/web/index.html +10 -9
  79. package/docs/WEB_APP.md +2 -2
  80. package/docs/user-guide.html +13 -7
  81. package/package.json +1 -1
  82. package/prompts/api-scenarios.md +1 -0
  83. package/prompts/brain.md +1 -0
  84. package/py/forgeqe_desktop/replay.py +3 -1
  85. package/py/forgeqe_desktop/workflow.py +19 -0
  86. package/py/forgeqe_engine/capture.py +19 -4
  87. package/py/forgeqe_engine/cli.py +12 -10
  88. package/py/forgeqe_engine/clientcert.py +28 -0
  89. package/py/forgeqe_engine/d365.py +182 -0
  90. package/py/forgeqe_engine/logins.py +20 -16
  91. package/py/forgeqe_engine/memory.py +9 -3
  92. package/py/forgeqe_engine/recordsession.py +23 -3
  93. package/py/forgeqe_engine/webrecord.py +16 -0
  94. package/py/forgeqe_engine/webrecord_page.py +26 -1
  95. package/py/forgeqe_mobile/appium_driver.py +26 -0
  96. package/py/forgeqe_mobile/maestro.py +2 -1
  97. package/dist/web/assets/Agent-CAp1dIHx.js +0 -8
  98. package/dist/web/assets/AgentWork-DxO8FN6U.js +0 -2
  99. package/dist/web/assets/ApiTests-XQ8wXCBj.js +0 -14
  100. package/dist/web/assets/Browse-BP1oToo4.js +0 -1
  101. package/dist/web/assets/Chat-DjIdHvHj.js +0 -3
  102. package/dist/web/assets/CommandPalette-rNWxEO_C.js +0 -1
  103. package/dist/web/assets/Compare-DwUP21-2.js +0 -1
  104. package/dist/web/assets/Cost-qZ-gGn2T.js +0 -1
  105. package/dist/web/assets/Data-AlbKk5zW.js +0 -6
  106. package/dist/web/assets/Desktop-yGPlxyBz.js +0 -1
  107. package/dist/web/assets/DesktopReview-BlpxN07L.js +0 -2
  108. package/dist/web/assets/DeviceScreen-BQKsJonx.js +0 -1
  109. package/dist/web/assets/Evidence-BCodp0GV.js +0 -1
  110. package/dist/web/assets/Explore-Ck5EEDy7.js +0 -2
  111. package/dist/web/assets/Features-BOQomaU8.js +0 -1
  112. package/dist/web/assets/Flags-DjolLE4S.js +0 -2
  113. package/dist/web/assets/Flaky-D-xnPfil.js +0 -1
  114. package/dist/web/assets/Impact-CoNLaNwy.js +0 -3
  115. package/dist/web/assets/Jobs-_kBd2W3F.js +0 -5
  116. package/dist/web/assets/KindPage-DfnkzpPj.js +0 -6
  117. package/dist/web/assets/LiveDevice-DRAN4Gl4.js +0 -1
  118. package/dist/web/assets/Migration-PETc1Ckc.js +0 -8
  119. package/dist/web/assets/Mobile-B193VBXu.js +0 -1
  120. package/dist/web/assets/Observability-CvdV37XD.js +0 -1
  121. package/dist/web/assets/PageAgent-BJguufGW.js +0 -1
  122. package/dist/web/assets/Product-Cmgcj9fr.js +0 -12
  123. package/dist/web/assets/Production-DM62n03j.js +0 -1
  124. package/dist/web/assets/Quality-DbgAAeel.js +0 -1
  125. package/dist/web/assets/Readiness-CojmD235.js +0 -1
  126. package/dist/web/assets/Record-C4VFM97k.js +0 -1
  127. package/dist/web/assets/Regression-5mma_vyD.js +0 -5
  128. package/dist/web/assets/RelationGraph-bDvvcead.js +0 -1
  129. package/dist/web/assets/Reports-BeSrlzKk.js +0 -2
  130. package/dist/web/assets/Responsive-B4CkMBwF.js +0 -3
  131. package/dist/web/assets/RunDiff-DGThx7bk.js +0 -1
  132. package/dist/web/assets/Settings-IjfPYiuf.js +0 -21
  133. package/dist/web/assets/Steps-BPSNI3aY.js +0 -3
  134. package/dist/web/assets/TestCases-hIuP5BLu.js +0 -1
  135. package/dist/web/assets/TestData-DpAMEMLP.js +0 -2
  136. package/dist/web/assets/TestDebt-D6UjJCpY.js +0 -1
  137. package/dist/web/assets/TestManagement-CTWh-aA8.js +0 -4
  138. package/dist/web/assets/WhatsNew-DMDg1zmv.js +0 -1
  139. package/dist/web/assets/agentSettingsSheet-CUogAKga.js +0 -1
  140. package/dist/web/assets/dataParts-s8iIR3Ad.js +0 -3
  141. package/dist/web/assets/desktopAppPath-CnmfVr-s.js +0 -1
  142. package/dist/web/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
  143. package/dist/web/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
  144. package/dist/web/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
  145. package/dist/web/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
  146. package/dist/web/assets/dm-sans-latin-600-normal-Aqo67rzb.woff2 +0 -0
  147. package/dist/web/assets/dm-sans-latin-600-normal-BmdmIIQ2.woff +0 -0
  148. package/dist/web/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff +0 -0
  149. package/dist/web/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2 +0 -0
  150. package/dist/web/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2 +0 -0
  151. package/dist/web/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff +0 -0
  152. package/dist/web/assets/dm-sans-latin-ext-600-normal-4vooXBpG.woff2 +0 -0
  153. package/dist/web/assets/dm-sans-latin-ext-600-normal-DRtaDpgU.woff +0 -0
  154. package/dist/web/assets/frame-DNgVKrlp.js +0 -13
  155. package/dist/web/assets/index-BBJ_SKdO.js +0 -56
  156. package/dist/web/assets/index-hysPD6U9.css +0 -2
  157. package/dist/web/assets/input-FbzQKk3L.js +0 -1
  158. package/dist/web/assets/markdown-1z66EzBR.js +0 -8
  159. package/dist/web/assets/pageBack-B6bY6ZUl.js +0 -3
  160. package/dist/web/assets/palette-C5Ok5Zd1.js +0 -1
  161. package/dist/web/assets/parts-Dqq6noWp.js +0 -1
  162. package/dist/web/assets/productParts-DNSo4bn5.js +0 -1
  163. package/dist/web/assets/qualityParts-kh6SukEP.js +0 -1
  164. package/dist/web/assets/recordTest-BCxsm3gC.js +0 -1
  165. package/dist/web/assets/route-D8G-pTdk.js +0 -1
  166. package/dist/web/assets/stepper-ByKrM1LP.js +0 -1
@@ -1,13 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/paletteCommands-CwHwpVqt.js","assets/route-D8G-pTdk.js","assets/rolldown-runtime-XKyaHtl9.js","assets/sectionList-BlwEtA8S.js","assets/coverage-xSRsKFL6.js","assets/CommandPalette-rNWxEO_C.js","assets/jsx-runtime-LKYXHABd.js","assets/input-FbzQKk3L.js","assets/palette-C5Ok5Zd1.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$n as t,$t as n,A as r,An as i,At as a,C as o,Cr as s,D as c,Dn as l,En as u,Er as d,Et as f,Fn as p,Gn as m,H as h,Hr as g,I as _,In as v,K as y,Kr as b,Ln as x,Lt as ee,M as S,Mn as C,N as te,Nn as ne,Nt as w,O as re,Ot as ie,Pr as ae,Pt as oe,Q as se,Rr as ce,Rt as le,S as ue,Sn as de,T as fe,Tr as pe,Tt as me,U as he,Un as ge,Ut as _e,Vr as ve,W as ye,Wn as be,X as xe,Xn as Se,Y as Ce,Yt as we,Zn as Te,Zt as Ee,_n as De,_r as Oe,_t as ke,a as Ae,an as je,ar as Me,b as Ne,br as Pe,en as Fe,er as Ie,f as Le,fr as Re,ft as ze,g as Be,gr as Ve,h as He,hn as Ue,ir as We,it as Ge,jn as Ke,jr as qe,kn as Je,kt as Ye,ln as Xe,m as Ze,mr as Qe,mt as $e,nn as et,nr as tt,o as nt,p as rt,q as it,qn as at,r as T,rn as ot,s as st,sn as ct,sr as lt,tn as ut,tt as dt,u as ft,un as pt,v as mt,vr as ht,w as gt,wr as _t,wt as vt,xr as yt,xt as bt,y as xt,yn as St,yt as Ct,z as wt,zt as Tt}from"./route-D8G-pTdk.js";import{M as Et,d as Dt,f as Ot,i as kt,m as E,t as At,x as jt}from"./sectionList-BlwEtA8S.js";import{t as Mt}from"./jsx-runtime-LKYXHABd.js";import{A as D,At as Nt,H as O,Ht as Pt,Mt as Ft,Pt as It,Wt as Lt,Z as Rt,j as zt,l as k,n as Bt,o as Vt,q as Ht,r as Ut,s as Wt,t as Gt,z as Kt}from"./input-FbzQKk3L.js";import{C as qt,E as A,S as Jt,T as Yt,_ as Xt,a as Zt,c as Qt,d as $t,f as en,g as tn,h as nn,l as rn,m as an,p as on,r as sn,u as cn,w as j,y as ln}from"./pageBack-B6bY6ZUl.js";import{F as un,L as dn,R as fn,a as pn,i as mn,j as hn,n as gn,u as M}from"./palette-C5Ok5Zd1.js";var N=e(b(),1),P=Mt();function _n({open:e,onClose:t,title:n,description:r,children:i,footer:a,wide:o}){let s=(0,N.useRef)(null),c=(0,N.useId)(),l=(0,N.useRef)({title:n,description:r,children:i,footer:a});e&&(l.current={title:n,description:r,children:i,footer:a});let[u,d]=(0,N.useState)(!1),f=e?{title:n,description:r,children:i,footer:a}:l.current;return(0,N.useEffect)(()=>{let t=s.current;if(!t)return;if(e){t.classList.remove(`is-closing`),d(!1),t.open||t.showModal();return}if(!t.open)return;if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)return t.close();t.classList.add(`is-closing`),d(!0);let n=setTimeout(()=>{t.classList.remove(`is-closing`),d(!1),t.close()},150);return()=>clearTimeout(n)},[e]),(0,P.jsx)(`dialog`,{ref:s,"aria-labelledby":c,onCancel:e=>{e.target===s.current&&(e.preventDefault(),t())},onClick:e=>{e.target===s.current&&t()},className:D(`sheet fixed inset-y-0 right-0 left-auto m-0 h-[calc(100dvh/var(--ui-zoom))] max-h-none w-full border-0 bg-bg p-0 text-ink shadow-menu backdrop:bg-[rgba(17,25,40,0.28)]`,o?`max-w-[760px]`:`max-w-[480px]`),children:(e||u)&&(0,P.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-4 px-6 pt-6 pb-4`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,P.jsx)(`h2`,{id:c,className:`m-0 text-lg font-semibold`,children:f.title}),f.description&&(0,P.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-muted`,children:f.description})]}),(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Close`,"data-tip":`Close`,onClick:t,className:`-mt-1 -mr-2`,children:(0,P.jsx)(g,{size:20,"aria-hidden":`true`})})]}),(0,P.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 pb-6`,children:f.children}),(0,P.jsx)(`div`,{className:`flex flex-wrap justify-end gap-2 px-6 py-4`,children:f.footer})]})})}var vn=new Map,yn=!1,bn=()=>typeof document>`u`?null:document,xn=()=>bn()?.visibilityState===`hidden`;function Sn(){if(!xn())for(let e of[...vn.values()])e()}function Cn(e,t){let n=setInterval(()=>{xn()||e()},t);vn.set(n,e);let r=bn();return r&&!yn&&(r.addEventListener(`visibilitychange`,Sn),yn=!0),n}function wn(e){if(e==null)return;clearInterval(e),vn.delete(e);let t=bn();t&&yn&&vn.size===0&&(t.removeEventListener(`visibilitychange`,Sn),yn=!1)}function F({open:e,id:t,className:n,children:r}){let[i,a]=(0,N.useState)(e),[o,s]=(0,N.useState)(e),[c,l]=(0,N.useState)(e);return(0,N.useEffect)(()=>{if(e){a(!0);let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>s(!0))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}}s(!1),l(!1);let t=setTimeout(()=>a(!1),320);return()=>clearTimeout(t)},[e]),i?(0,P.jsx)(`div`,{id:t,inert:!e||void 0,className:D(`collapse-box`,o&&`is-open`),onTransitionEnd:t=>{t.target===t.currentTarget&&t.propertyName===`grid-template-rows`&&(e?l(!0):a(!1))},children:(0,P.jsx)(`div`,{className:D(`min-h-0 min-w-0`,c?`overflow-visible`:`overflow-hidden`),children:(0,P.jsx)(`div`,{className:n,children:r})})}):null}var Tn=null,En=e=>void(Tn=e),Dn=/password|secret|token|api.?key|\bkey\b|credential|\bprod(uction)?\b|\bprd\b|\blive\b/i,On=1e3,kn=60,An=e=>e.replace(/[\u0000-\u001f\u007f\u2028\u2029]+/g,` `).replace(/\s+/g,` `).trim();function jn(e){let t=new Set,n=[];for(let r of e){let e=An(r.label).slice(0,kn);if(!e||r.kind===`link`&&!/^#\/[^\s]*$/.test(r.href??``))continue;let i=`${r.kind} ${e.toLowerCase()}`;if(t.has(i)||(t.add(i),(r.kind===`setting`||r.kind===`field`||r.kind===`button`)&&Dn.test(e)))continue;let a=r.value===void 0?void 0:An(r.value).slice(0,kn);if(n.push({ref:`c${n.length+1}`,kind:r.kind,label:e,...a===void 0?{}:{value:a},from:r}),n.length>=120)break}return n}var Mn=e=>e.map(e=>`${e.ref} ${e.kind}: ${e.label}${e.value===void 0?``:` (now: ${e.value||`empty`})`}`).join(`
3
- `);function Nn(e){let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(typeof n.ref!=`string`||!/^c\d{1,3}$/.test(n.ref)||typeof n.label!=`string`)return null;let r=typeof n.text==`string`?An(n.text).slice(0,On):``;return{ref:n.ref,label:An(n.label),text:r}}function Pn(e,t){let n=e.find(e=>e.ref===t.ref);return!n||n.label.toLowerCase()!==t.label.toLowerCase()?`The page changed since it was read: read it again.`:(n.kind===`search`||n.kind===`field`)&&!t.text?`Say what to type into “${n.label}”.`:n.kind===`setting`&&!t.text?`Say what to set “${n.label}” to.`:n.kind!==`search`&&n.kind!==`setting`&&n.kind!==`field`&&t.text?`“${n.label}” takes a click, not text.`:n}var Fn=()=>/^#\/settings(?:\/|$)/.test(location.hash)&&!/^#\/settings\/secrets/.test(location.hash);function In(e){let t=e.id?document.querySelector(`label[for="${CSS.escape(e.id)}"]`):null,n=e.getAttribute(`aria-labelledby`)?.split(/\s+/).map(e=>document.getElementById(e)?.innerText||``).join(` `);return e.getAttribute(`aria-label`)||t?.innerText||n||e.closest(`label`)?.innerText||``}function Ln(e){return e instanceof HTMLInputElement&&e.type===`checkbox`?e.checked?`on`:`off`:e.getAttribute(`role`)===`switch`?e.getAttribute(`aria-checked`)===`true`?`on`:`off`:e instanceof HTMLSelectElement?e.selectedOptions[0]?.text||``:e.value??``}function Rn(){let e=[],t=e=>e.offsetParent!==null&&!e.closest(`[aria-label="Talk"]`)&&!e.closest(`[inert]`),n=e=>e.getAttribute(`aria-label`)||e.innerText||e.getAttribute(`placeholder`)||e.getAttribute(`title`)||``,r=Fn();for(let i of document.querySelectorAll(`a[href^="#/"], [role="tab"], [role="radiogroup"] [role="radio"], input, textarea, select, [role="switch"], button, [role="button"]`)){if(!t(i))continue;let a=i.disabled||i.readOnly||i.getAttribute(`aria-disabled`)===`true`;if(!i.closest(`dialog[open], [role='dialog'], [role='alertdialog']`)||i.matches(`button, [role='button']`)&&/^(cancel|close|no|back|not now)$/i.test(An(n(i)))){if(i instanceof HTMLTextAreaElement)a||e.push({kind:r?`setting`:`field`,label:In(i)||i.placeholder||`Text`,value:r?Ln(i):void 0,el:i});else if(i.matches(`button, [role='button']`)&&!i.matches(`[role='tab'], [role='radio'], [role='switch']`))a||e.push({kind:`button`,label:n(i),el:i});else if(!(i instanceof HTMLInputElement&&[`hidden`,`password`,`file`,`submit`,`button`,`image`,`reset`].includes(i.type))){if(i instanceof HTMLInputElement&&i.type!==`checkbox`&&i.type!==`radio`){let t=`${i.getAttribute(`aria-label`)||``} ${i.placeholder||``} ${i.type}`;if(a)continue;/search|filter|find/i.test(t)?e.push({kind:`search`,label:i.getAttribute(`aria-label`)||i.placeholder||`Search`,el:i}):r?e.push({kind:`setting`,label:In(i),value:Ln(i),el:i}):e.push({kind:`field`,label:In(i)||i.placeholder||`Text`,el:i})}else i instanceof HTMLSelectElement||i.getAttribute(`role`)===`switch`||i instanceof HTMLInputElement&&i.type===`checkbox`?r&&!a&&e.push({kind:`setting`,label:In(i)||n(i),value:Ln(i),el:i}):i.matches(`a`)?e.push({kind:`link`,label:n(i),href:i.getAttribute(`href`)||``,el:i}):i instanceof HTMLInputElement||e.push({kind:i.getAttribute(`role`)===`tab`?`tab`:`option`,label:n(i),el:i})}}}return e}var zn=()=>jn(Rn());function Bn(e){let t=zn(),n=((document.querySelector(`[data-screen]`)??document.body).innerText||``).replace(/[ \t]+/g,` `).replace(/\n{3,}/g,`
4
-
5
- `).trim(),r=Mn(t);return`${r?`Controls (page_act takes a ref and its label):\n${r}\n\n`:``}Page text:\n${n}`.slice(0,e)}function Vn(e,t){if(e instanceof HTMLInputElement&&e.type===`checkbox`){let n=Hn(t);return n===null?`Say on or off.`:(e.checked!==n&&e.click(),null)}if(e.getAttribute(`role`)===`switch`){let n=Hn(t);return n===null?`Say on or off.`:(e.getAttribute(`aria-checked`)===`true`!==n&&e.click(),null)}if(e instanceof HTMLSelectElement){let n=[...e.options].find(e=>e.text.trim().toLowerCase()===t.toLowerCase()||e.value.toLowerCase()===t.toLowerCase());return n?(e.value=n.value,e.dispatchEvent(new Event(`change`,{bubbles:!0})),null):`It is one of: ${[...e.options].map(e=>e.text.trim()).filter(Boolean).slice(0,8).join(`, `)}.`}let n=e;return Object.getOwnPropertyDescriptor(e instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,`value`)?.set?.call(n,t),n.dispatchEvent(new Event(`input`,{bubbles:!0})),n.dispatchEvent(new Event(`change`,{bubbles:!0})),null}var Hn=e=>/^(on|yes|true|enabled?|shown?)$/i.test(e)?!0:!/^(off|no|false|disabled?|hidden)$/i.test(e)&&null;async function Un(e){let t=Nn(e);if(!t)return`That is not a control of this page.`;let n=Pn(zn(),t);if(typeof n==`string`)return n;let r=n.from.el;if(n.kind===`setting`||n.kind===`option`&&Fn()){let e=n.kind===`setting`?t.text:n.label;return Tn?await Tn(n.kind===`setting`?`Change ${n.label} to ${e}?`:`Switch to ${e}?`)?n.kind===`option`?(r.click(),`Switched to ${e}. Settings saves it.`):Vn(r,t.text)??`Changed ${n.label} to ${t.text}. Settings saves it.`:`Not changed: the person did not say yes.`:`Changing a setting needs Talk on: ask the person to change it on the page.`}if(n.kind===`button`)return Tn?await Tn(`Press ${n.label}?`)?(r.click(),`Pressed ${n.label}.`):`Not pressed: the person did not say yes.`:`Pressing a button needs Talk on: ask the person to press it.`;if(n.kind===`field`){let e=r instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype;return Object.getOwnPropertyDescriptor(e,`value`)?.set?.call(r,t.text),r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.focus(),`Typed into ${n.label}.`}return n.kind===`search`&&r instanceof HTMLInputElement?(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set?.call(r,t.text),r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.focus(),`Typed “${t.text}” into ${n.label}.`):(r.click(),n.kind===`link`?`Opened ${n.label}.`:`Picked ${n.label}.`)}var Wn=[`open`,`open_run`,`open_chat`,`search`,`back`,`new_chat`,`set`,`read`,`act`],Gn={theme:[`light`,`dark`,`system`],sidebar:[`open`,`closed`],browser:[`shown`,`hidden`],talk:[`off`]},Kn=8e3,qn=/^(?:latest|last|newest|most recent)?$/i,Jn=/^[A-Za-z0-9_-]{1,80}$/,Yn=e=>e.replace(/[\u0000-\u001f\u007f]+/g,` `).trim().slice(0,1200);function Xn(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.id!=`string`||!Jn.test(t.id)||!Wn.includes(t.action))return null;let n=typeof t.what==`string`?Yn(t.what):void 0;return{id:t.id,action:t.action,...n?{what:n}:{}}}function Zn(e,t){let n=e=>{let t=e.toLowerCase().replace(/[^a-z]/g,``).replace(/c(?=[eiy])/g,`s`).replace(/c/g,`k`).replace(/ph/g,`f`).replace(/sh/g,`s`);return((/^[aeiou]/.test(t)?`a`:``)+t.replace(/[aeiouyhw]/g,``)).replace(/(.)\1+/g,`$1`)},r=t.replace(/^(the|a|an|my)\s+|\s+(page|section|settings?)$/gi,``).toLowerCase().replace(/[^a-z]/g,``),i=n(r);if(i.length<2)return[];let a=e.filter(e=>e.kind!==`field`).map(e=>{let t=e.label.toLowerCase().replace(/[^a-z]/g,``),a=Qn(i,n(t))/Math.max(i.length,n(t).length);return{label:e.label,sound:a,d:a+.5*Math.abs(r.length-t.length)/Math.max(r.length,t.length)}}).filter(e=>e.sound<=.5).sort((e,t)=>e.d-t.d);return[...new Set(a.map(e=>e.label))].slice(0,3)}function Qn(e,t){let n=Array.from({length:t.length+1},(e,t)=>t);for(let r=1;r<=e.length;r++){let i=n[0];n[0]=r;for(let a=1;a<=t.length;a++){let o=n[a];n[a]=Math.min(n[a]+1,n[a-1]+1,i+(e[r-1]===t[a-1]?0:1)),i=o}}return n[t.length]}var $n=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,``);function er(e,t){let n=$n(t),r=n.length>=4?e.filter(e=>e.kind!==`field`&&$n(e.label)===n):[];return r.length===1?r[0]:void 0}var tr=/^(?:settings\s*[›>:/-]\s*(.+)|(?:the\s+)?(.+?)\s+settings?)$/i;async function nr(e,t){let n=(e.what||``).trim();switch(e.action){case`open`:{let e=await t.commands(),r=tr.exec(n),i=r?(r[1]||r[2]||``).trim():``,a=n?i&&gn(e.filter(e=>e.kind===`setting`),i.toLowerCase())||gn(e,n.toLowerCase())||er(e,n):void 0;if(!a){let t=Zn(e,n);return`Nothing in ForgeQE is called “${n}”.${t.length?` The nearest: ${t.join(`, `)}.`:``}`}return t.go(a.href)===!1?`${a.label} is already open.`:`Opened ${a.label}.`}case`open_run`:{let e=await t.runs(),r=qn.test(n)?e[0]:e.find(e=>e.name===n)??e.find(e=>e.title.toLowerCase()===n.toLowerCase());return r?(t.go(T(`runs`,encodeURIComponent(r.name))),`Opened the run “${r.title||r.name}”.`):e.length?`No run is called “${n}”.`:`There are no runs yet.`}case`open_chat`:{let e=await t.chats(),r=qn.test(n)?e.find(e=>e.id!==t.current):e.find(e=>e.id===n)??e.find(e=>e.title.toLowerCase()===n.toLowerCase());return r?(t.go(T(`chats`,r.id)),`Opened the chat “${r.title}”.`):`No chat is called “${n}”.`}case`search`:return n?(t.find(n),`Searching for “${n}”.`):`Nothing to search for.`;case`back`:return t.back(),`Went back.`;case`new_chat`:return t.go(T()),`Opened a new chat.`;case`set`:{let[e,r,...i]=n.split(` `),a=e&&Object.hasOwn(Gn,e)?Gn[e]:void 0;return!a||!r||i.length||!a.includes(r)?`That cannot be changed from here.`:t.set?await t.set(e,r):`That cannot be changed from here.`}case`read`:return(t.screen?.(Kn)??``).slice(0,Kn);case`act`:return t.actOn?await t.actOn(n):`That cannot be done from here.`}}var rr=new Set;function ir(e,t){rr.has(e.id)||(rr.add(e.id),t(e))}function ar(e,t,n,r){let i=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(n&&e){if(i.current!==e){i.current=e;for(let e of t)rr.add(e.id)}else for(let e of t)rr.has(e.id)||(rr.add(e.id),r(e))}},[e,t.length,n])}var or=(0,N.createContext)(null);function sr({pages:e,find:t,set:n,children:r}){let i=(0,N.useRef)(null),a=(0,N.useCallback)(r=>({commands:()=>i.current??=Wt(()=>import(`./paletteCommands-CwHwpVqt.js`).then(t=>t.everyCommand(e)),__vite__mapDeps([0,1,2,3,4])),runs:async()=>(await Nt.list()).runs.map(e=>({name:e.name,title:e.title})),chats:async()=>(await Rt.list()).chats.map(e=>({id:e.id,title:e.title})),find:t,go:e=>location.hash.replace(/^#/,``)===e.replace(/^#/,``)?(window.dispatchEvent(new HashChangeEvent(`hashchange`)),!1):(location.hash=e,!0),back:()=>history.back(),...r?{current:r}:{},...n?{set:(e,t)=>n(e,t,r)}:{},screen:Bn,actOn:Un}),[e,t,n]),o=(0,N.useCallback)(async(e,t)=>{let n=await nr(e,a(t)).catch(e=>`That did not work: ${e.message}`);return t&&/^act_[a-f0-9]{16}$/.test(e.id)&&await Rt.screen(t,e.id,n).catch(()=>{}),n},[a]),s=(0,N.useMemo)(()=>({act:o}),[o]);return(0,P.jsx)(or.Provider,{value:s,children:r})}function cr(){let e=(0,N.useContext)(or);return e?e.act:async()=>``}var lr=16e3;function ur(e,t){if(!e.length||!(t>0))return new Int16Array;let n=t/lr,r=Math.floor(e.length/n),i=new Int16Array(r);for(let t=0;t<r;t++){let r=Math.floor(t*n),a=Math.max(r+1,Math.floor((t+1)*n)),o=0;for(let t=r;t<a;t++)o+=e[t]??0;let s=Math.max(-1,Math.min(1,o/(a-r)));i[t]=Math.round(s<0?s*32768:s*32767)}return i}function dr(e){let t;try{t=atob(e)}catch{return new Float32Array}let n=Math.floor(t.length/2),r=new Float32Array(n);for(let e=0;e<n;e++){let n=t.charCodeAt(2*e)|t.charCodeAt(2*e+1)<<8;n>=32768&&(n-=65536),r[e]=n/32768}return r}var fr=(0,N.createContext)(null);function pr(){let e=(0,N.useContext)(fr);if(!e)throw Error(`useTalk outside TalkProvider`);return e}var mr=e=>{try{return localStorage.getItem(e)}catch{return null}},hr=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},gr=()=>{let e=mr(`forgeqe.voice.eagerness`);return e===`eager`||e===`patient`?e:`normal`},_r=e=>hr(`forgeqe.voice.eagerness`,e),vr=null;function yr(e=!1){return(e||!vr)&&(vr=Pt.status()),vr.catch(()=>vr=null),vr}var br=()=>/^#\/chats\/([a-f0-9]{18})(?:[/?]|$)/.exec(location.hash)?.[1]??null,xr=320;function Sr({children:e}){let[t,n]=(0,N.useState)(`off`),[r,i]=(0,N.useState)(null),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(``),[l,u]=(0,N.useState)(null),d=cr(),f=(0,N.useRef)(null),p=(0,N.useRef)(null),m=(0,N.useRef)(null),h=(0,N.useRef)(null),g=(0,N.useRef)([]),_=(0,N.useRef)(0),v=(0,N.useRef)(0),y=(0,N.useRef)(new Int16Array),b=(0,N.useRef)({hearing:!1,thinking:!1,speaking:!1}),x=(0,N.useRef)(null),ee=(0,N.useRef)(0),S=(0,N.useRef)(new Map),C=(0,N.useCallback)(()=>{let e=b.current;n(e.hearing?`hearing`:e.speaking?`speaking`:e.thinking?`thinking`:`listening`)},[]),te=(0,N.useCallback)(e=>{v.current=e;let t=p.current,n=m.current;if(!t||!n)return;let r=t.currentTime;n.gain.cancelScheduledValues(r),n.gain.setValueAtTime(n.gain.value,r),n.gain.linearRampToValueAtTime(0,r+.08);let i=g.current;g.current=[],_.current=0,setTimeout(()=>{for(let e of i)try{e.stop()}catch{}n.gain.setValueAtTime(1,t.currentTime)},90),b.current.speaking=!1,C()},[C]),ne=(0,N.useCallback)((e,t,n)=>{let r=p.current,i=m.current;if(!r||!i||e<v.current)return;let a=dr(n);if(!a.length||!(t>=8e3&&t<=48e3))return;let o=r.createBuffer(1,a.length,t);o.copyToChannel(a,0);let s=r.createBufferSource();s.buffer=o,s.connect(i),_.current=Math.max(_.current,r.currentTime+.04),s.start(_.current),_.current+=o.duration,g.current.push(s),s.onended=()=>{g.current=g.current.filter(e=>e!==s),g.current.length||(b.current.speaking=!1,C())},b.current.speaking=!0,C()},[C]),w=(0,N.useCallback)(e=>{let t;try{t=JSON.parse(e)}catch{return}let n=e=>typeof e==`string`?e:``;switch(t.type){case`audio`:typeof t.gen==`number`&&typeof t.rate==`number`&&ne(t.gen,t.rate,n(t.pcm));break;case`interrupt`:typeof t.gen==`number`&&te(t.gen);break;case`chat`:{if(t.id===null){x.current=null,i(null),u(null);break}let e=n(t.id);if(!/^[a-f0-9]{18}$/.test(e))break;x.current=e,i(e);break}case`caption`:{let e=n(t.text).slice(0,300);t.who===`you`?u({who:`you`,text:e}):u(t=>({who:`atlas`,text:t?.who===`atlas`?`${t.text} ${e}`.slice(-300):e}));break}case`state`:for(let e of[`hearing`,`thinking`,`speaking`])typeof t[e]==`boolean`&&(b.current[e]=t[e]);typeof t.thinking==`boolean`&&o(t.thinking),C();break;case`app_action`:{let e=Xn(t);e&&(ee.current=Date.now(),ir(e,e=>d(e,x.current??void 0)));break}case`confirmed`:{let e=S.current.get(n(t.id));S.current.delete(n(t.id)),e?.(t.yes===!0);break}case`error`:c(n(t.message).slice(0,300))}},[d,te,ne,C]),re=()=>{En(null);for(let e of S.current.values())e(!1);S.current.clear();try{f.current?.close()}catch{}f.current=null,h.current?.getTracks().forEach(e=>e.stop()),h.current=null,p.current?.close().catch(()=>{}),p.current=null,m.current=null,g.current=[],_.current=0,y.current=new Int16Array},ie=(0,N.useCallback)(()=>{re(),b.current={hearing:!1,thinking:!1,speaking:!1},x.current=null,i(null),u(null),n(`off`),o(!1)},[]),ae=(0,N.useCallback)(async()=>{if(!f.current){c(``),n(`connecting`);try{if(!(await yr()).ready)throw Error(`Speech is not set up on this computer yet: Settings › Voice.`);Pt.warm().catch(()=>{});let e=new AudioContext;p.current=e;let t=e.createGain();t.connect(e.destination),m.current=t;let r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1}});h.current=r;let{default:a}=await Wt(async()=>{let{default:e}=await import(`./capture.worklet-C65DyLpl.js`);return{default:e}},[]);await e.audioWorklet.addModule(a);let o=new AudioWorkletNode(e,`forgeqe-capture`);e.createMediaStreamSource(r).connect(o),o.port.onmessage=t=>{let n=ur(t.data,e.sampleRate),r=new Int16Array(y.current.length+n.length);r.set(y.current),r.set(n,y.current.length);let i=0;for(;r.length-i>=xr;i+=xr)f.current?.readyState===WebSocket.OPEN&&f.current.send(r.slice(i,i+xr).buffer);y.current=r.slice(i)},x.current=br(),i(x.current);let{ticket:s}=await Pt.ticket(x.current,gr()),c=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/api/voice/session?ticket=${s}`);c.binaryType=`arraybuffer`,c.onmessage=e=>typeof e.data==`string`&&w(e.data),c.onopen=()=>{b.current={hearing:!1,thinking:!1,speaking:!1},n(`listening`),En(e=>new Promise(t=>{if(c.readyState!==WebSocket.OPEN)return t(!1);let n=Math.random().toString(36).slice(2,12);S.current.set(n,t),setTimeout(()=>S.current.get(n)===t&&(S.current.delete(n),t(!1)),35e3),c.send(JSON.stringify({type:`confirm`,id:n,text:e.slice(0,200)}))}))},c.onclose=()=>{f.current===c&&(re(),n(`off`))},f.current=c}catch(e){re(),n(`off`),c(e.name===`NotAllowedError`?`The browser was not allowed to use the microphone: allow it in the address bar, then try again.`:e.message)}}},[w]);(0,N.useEffect)(()=>()=>re(),[]),(0,N.useEffect)(()=>{let e=()=>{let e=()=>g.current.length?setTimeout(e,300):ie();setTimeout(e,1500)};return window.addEventListener(`forgeqe:talk-off`,e),()=>window.removeEventListener(`forgeqe:talk-off`,e)},[ie]),(0,N.useEffect)(()=>{if(t===`off`)return;let e=()=>{if(Date.now()-ee.current<3e3)return;let e=br(),t=location.hash===``||location.hash===`#`||location.hash===`#/`;(e||t)&&(e??null)!==x.current&&f.current?.readyState===WebSocket.OPEN&&f.current.send(JSON.stringify({type:`page`,chat:e}))};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[t]);let oe=(0,N.useMemo)(()=>({phase:t,chat:r,working:a,error:s,line:l,start:()=>void ae(),end:ie,dismiss:()=>c(``)}),[t,r,a,s,l,ae,ie]);return(0,P.jsx)(fr.Provider,{value:oe,children:e})}function Cr({chat:e,disabled:t}){let n=pr(),[r,i]=(0,N.useState)(null);(0,N.useEffect)(()=>{yr().then(e=>i(e.ready)).catch(()=>i(!1))},[]);let a=Dr(n,e),o=r===!1;return(0,P.jsx)(A,{variant:`ghost`,className:D(`flex-none px-2 text-[16px] sm:px-2`,a&&`bg-accent-soft text-accent-fg hover:bg-accent-soft`),"aria-label":`Talk`,"aria-pressed":a,disabled:o||t&&!a,"data-tip":o?`Talk needs a one-time setup: Settings › Voice`:a?`End the talk`:`Talk to Atlas: speech stays on this computer`,onClick:()=>{if(a)return n.end();n.phase!==`off`&&n.end(),n.start()},children:(0,P.jsx)(Le,{"aria-hidden":`true`})})}function wr({chat:e}){let t=pr(),n=Dr(t,e);if(!n&&!t.error)return null;let r=n&&t.phase!==`thinking`;return(0,P.jsxs)(`div`,{"aria-live":`polite`,className:`-mt-1 mb-4 flex flex-col gap-2 border-b border-line-soft pb-4 text-[13px]`,children:[(0,P.jsxs)(`div`,{className:`flex min-h-7 flex-wrap items-center gap-x-2 gap-y-1`,children:[r?(0,P.jsx)(qt,{state:kr[t.phase],px:18}):(0,P.jsx)(Le,{size:16,"aria-hidden":`true`,className:`text-muted`}),(0,P.jsx)(`span`,{className:`font-medium`,children:n?Or[t.phase]:`Talk stopped`}),n&&(0,P.jsx)(`span`,{className:`text-muted`,children:`Talk over Atlas any time; it stops and listens.`}),(0,P.jsx)(`span`,{className:`flex-auto`}),n?(0,P.jsx)(A,{size:`sm`,variant:`ghost`,onClick:t.end,children:`End`}):(0,P.jsx)(`button`,{type:`button`,"aria-label":`Close the note`,"data-tip":`Close the note`,onClick:t.dismiss,className:`inline-flex size-7 flex-none cursor-pointer items-center justify-center rounded-[7px] border-0 bg-transparent text-muted hover:bg-surface-strong hover:text-ink`,children:(0,P.jsx)(g,{size:14,"aria-hidden":`true`})})]}),t.error&&(0,P.jsx)(`p`,{className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:t.error})]})}function Tr({rail:e=!1}){let t=pr(),n=t.phase!==`off`,r=()=>n?t.end():t.start();return e?(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Talk`,"aria-pressed":n,"data-tip":`Talk to Atlas`,"data-tip-side":`left`,onClick:r,className:D(`size-9`,n&&`bg-accent-soft text-accent-fg`),children:(0,P.jsx)(Le,{strokeWidth:1.8,"aria-hidden":`true`})}):(0,P.jsxs)(A,{size:`sm`,"aria-pressed":n,onClick:r,className:D(`w-full justify-start px-2`,n&&`bg-accent-soft text-accent-fg`),children:[(0,P.jsx)(Le,{strokeWidth:1.8,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`flex-1 text-left`,children:`Talk`})]})}function Er(){let e=pr(),[t,n]=(0,N.useState)(location.hash);(0,N.useEffect)(()=>{let e=()=>n(location.hash);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let r=t===``||t===`#`||t===`#/`;if(e.phase===`off`||(e.chat?br()===e.chat:r))return null;let i=`inline-flex min-h-7 flex-none items-center rounded-[8px] px-2 font-medium text-muted no-underline hover:bg-surface-strong hover:text-ink`;return(0,P.jsxs)(`div`,{role:`region`,"aria-label":`Talk`,"aria-live":`polite`,className:`fixed right-4 bottom-4 z-30 flex max-w-[min(560px,calc(100vw-32px))] items-center gap-2 rounded-full border border-line bg-bg py-1 pr-1 pl-4 text-[13px] shadow-menu`,children:[e.phase===`thinking`?(0,P.jsx)(Le,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`}):(0,P.jsx)(qt,{state:kr[e.phase],px:18}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.line?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`text-muted`,children:e.line.who===`you`?`You: `:`Atlas: `}),e.line.text]}):(0,P.jsx)(`span`,{className:`font-medium`,children:Or[e.phase]})}),e.chat&&(0,P.jsx)(`a`,{href:T(`chats`,e.chat),className:i,children:`Open the chat`}),(0,P.jsx)(`button`,{type:`button`,onClick:e.end,className:D(i,`cursor-pointer border-0 bg-transparent`),children:`End`})]})}var Dr=(e,t)=>e.phase!==`off`&&(e.chat??null)===t,Or={off:`Talk stopped`,connecting:`Starting Talk…`,listening:`Listening. Just talk.`,hearing:`Hearing you…`,thinking:`Listening while Atlas works.`,speaking:`Speaking.`},kr={off:`idle`,connecting:`waiting`,listening:`waiting`,hearing:`recording`,thinking:`thinking`,speaking:`writing`};function Ar({icon:e,logo:t,pixel:n,size:r=`md`,className:i}){return(0,P.jsx)(`span`,{"aria-hidden":`true`,className:D(`inline-flex flex-none items-center justify-center rounded-[10px]`,t?`border border-line bg-bg`:n||e&&Yt.has(e)?`theme-side border border-line-soft`:`bg-surface-strong text-ink-2`,r===`lg`?`size-10`:`size-9`,i),children:n?(0,P.jsx)(k,{name:n,px:r===`lg`?24:20}):t?(0,P.jsx)(t,{className:r===`lg`?`size-5`:`size-[18px]`}):e?(0,P.jsx)(j,{icon:e,size:r===`lg`?20:18}):null})}var jr=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{};function Mr(e,t){let n=e;for(let e of t)n=jr(n)[e];return n}var Nr=e=>e===void 0||e===``||typeof e==`number`&&Number.isNaN(e);function Pr(e,t,n){let[r,...i]=t;if(r===void 0)return e;let a={...e},o=i.length?Pr(jr(e[r]),i,n):n;return Nr(o)||i.length&&Nr(n)&&!Object.keys(jr(o)).length?delete a[r]:a[r]=o,a}function Fr(e,t,n){let r={};for(let[i,a]of Object.entries(e))r[i===t?n:i]=a;return r}function Ir(e,t){if(!(t in e))return t;for(let n=2;;n++)if(!(`${t}-${n}`in e))return`${t}-${n}`}var Lr=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Rr({checked:e,onChange:t,label:n,id:r,disabled:i}){return(0,P.jsx)(`button`,{type:`button`,role:`switch`,id:r,"aria-checked":e,"aria-label":n,disabled:i,onClick:()=>t(!e),className:D(`relative h-5 w-9 flex-none cursor-pointer rounded-full border-0 p-0 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e?`bg-accent`:`bg-line`),children:(0,P.jsx)(`span`,{"aria-hidden":`true`,className:D(`absolute top-1/2 size-4 -translate-y-1/2 rounded-full bg-white shadow-sm left-0.5 transition-transform`,e&&`translate-x-4`)})})}function zr(e){let t=$t.find(t=>t.agents?.includes(e));return!t||t.id===`agents`?{label:`All agents`,href:T(`agents`)}:{label:t.label,href:an(t)}}var Br=`orchestrator`;function Vr(e){return e.page?Ot(e.page)??kt.find(e=>e.id===`orchestrator`):kt.find(t=>t.agent!==`forgeqe`&&e.title.startsWith(`${E(t.agent).name}: `))??kt.find(e=>e.id===`orchestrator`)}var Hr=(e,t)=>t.filter(t=>Vr(t)?.id===e.id);function Ur(e,t){if(e[0]!==`chats`||!e[1]||!t)return e;let n=Vr(t);return n&&n.agent!==`forgeqe`?[`agents`,n.id]:e}function Wr(e){let t=e[0]===`chats`?e[1]:void 0,[n,r]=(0,N.useState)(null);return(0,N.useEffect)(()=>{if(!t)return;let e=!1;return Rt.events(t,2**53-1,!1).then(n=>!e&&r({id:t,title:n.title,...n.page?{page:n.page}:{}}),()=>{}),()=>{e=!0}},[t]),Ur(e,n&&n.id===t?n:null)}var Gr=`rounded-[12px] bg-bg shadow-sm`;function Kr({as:e=`div`,className:t,children:n,...r}){return(0,P.jsx)(e,{className:D(Gr,t),...r,children:n})}var qr={x:0,y:0,w:0,h:0,on:!1},Jr=(e,t)=>e.on===t.on&&e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h;function Yr(e,t){if(!t||!t.isConnected||t.closest(`[inert]`)||!t.offsetHeight)return qr;let n=0,r=0,i=t;for(;i&&i!==e;)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return i===e?{x:n,y:r,w:t.offsetWidth,h:t.offsetHeight,on:!0}:qr}function Xr(e,t,n){let[r,i]=(0,N.useState)(qr),a=(0,N.useCallback)(()=>{let n=e.current;if(!n)return;let r=Yr(n,n.querySelector(t));i(e=>Jr(e,r)?e:r)},[e,t]);return(0,N.useLayoutEffect)(a,[n,a]),(0,N.useLayoutEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(a);n.observe(t);for(let e of Array.from(t.children))n.observe(e);return()=>n.disconnect()},[a]),r}var Zr=new Map,Qr=1500;function I({pill:e,className:t,memory:n,children:r}){let[i,a]=(0,N.useState)(()=>{let e=n?Zr.get(n):void 0;return e&&Date.now()-e.at<Qr?e.pill:void 0});(0,N.useEffect)(()=>{n&&e.on&&Zr.set(n,{pill:e,at:Date.now()})},[n,e]),(0,N.useEffect)(()=>{if(!i||!e.on)return;let t=0,n=requestAnimationFrame(()=>{t=requestAnimationFrame(()=>a(void 0))});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}},[i,e.on]);let o=i&&e.on?i:e,s=(0,N.useRef)(!1),c=s.current;return o.on&&(s.current=!0),(0,P.jsx)(`span`,{"aria-hidden":`true`,className:D(`pointer-events-none absolute top-0 left-0 z-0 motion-reduce:transition-none`,c&&`transition-[transform,width,height,opacity] duration-(--motion) ease-out`,t),style:{transform:`translate(${o.x}px, ${o.y}px)`,width:o.w,height:o.h,opacity:+!!o.on},children:r})}var $r=`flex w-fit max-w-full flex-wrap gap-1 rounded-[10px] bg-surface-strong p-1`,ei=e=>D(`inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-[7px] border-0 px-4 text-sm font-medium whitespace-nowrap`,e?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`),ti=`rounded-[7px] bg-bg shadow-sm`,ni=(e,t)=>D(ei(e),`relative z-10 transition-colors duration-(--motion-fast)`,e&&t&&`bg-transparent shadow-none`);function ri({icon:e}){return typeof e==`object`&&e&&`pixel`in e?(0,P.jsx)(k,{name:e.pixel,px:18,className:`flex-none`}):(0,P.jsx)(j,{icon:e,size:16,className:`flex-none`})}function ii(e,t,n,r,i){let a=n===`ArrowRight`?e[(t+1)%e.length]:n===`ArrowLeft`?e[(t-1+e.length)%e.length]:void 0;return a?(i(a.id),document.getElementById(`${r}-${a.id}`)?.focus(),!0):!1}function ai({tabs:e,current:t,onPick:n,hrefOf:r,label:i,className:a,prefix:o=`tab`}){let s=o===`tab`?`panel`:`${o}-panel`,c=(0,N.useRef)(null),l=Xr(c,`[aria-selected="true"], [aria-current="page"]`,t);(0,N.useEffect)(()=>{let e=c.current?.querySelector(`[aria-selected="true"], [aria-current="page"]`),t=c.current;if(!e||!t)return;let n=e.offsetLeft-t.offsetLeft;n<t.scrollLeft?t.scrollLeft=n:n+e.offsetWidth>t.scrollLeft+t.clientWidth&&(t.scrollLeft=n+e.offsetWidth-t.clientWidth)},[t]);let u=D(`relative mb-6`,$r,`flex-nowrap overflow-x-auto [scrollbar-width:thin]`,a),d=e=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(ri,{icon:e.icon}),e.label,e.n!==void 0&&e.n!==null&&(0,P.jsx)(`span`,{className:D(`text-[13px] font-normal tabular-nums`,e.tone||`text-muted`),children:e.n})]}),f=e=>D(ni(t===e.id,l.on),`flex-none focus-visible:outline-offset-[-2px]`,e.mono&&`font-mono text-[13px] font-normal`);return r?(0,P.jsxs)(`nav`,{ref:c,"aria-label":i,className:u,children:[(0,P.jsx)(I,{pill:l,className:ti,memory:`tabs:${i}`}),e.map(e=>(0,P.jsx)(`a`,{id:`${o}-${e.id}`,href:r(e.id),"aria-current":t===e.id?`page`:void 0,className:D(f(e),`no-underline hover:no-underline`,t===e.id&&`hover:text-ink`),children:d(e)},e.id))]}):(0,P.jsxs)(`div`,{ref:c,role:`tablist`,"aria-label":i,className:u,children:[(0,P.jsx)(I,{pill:l,className:ti}),e.map((r,i)=>(0,P.jsx)(`button`,{id:`${o}-${r.id}`,type:`button`,role:`tab`,"aria-selected":t===r.id,"aria-controls":`${s}-${r.id}`,tabIndex:t===r.id?0:-1,onClick:()=>n?.(r.id),onKeyDown:t=>{n&&ii(e,i,t.key,o,n)&&t.preventDefault()},className:f(r),children:d(r)},r.id))]})}function oi({tabs:e,current:t,onPick:n,label:r,className:i,prefix:a=`tab`}){let o=a===`tab`?`panel`:`${a}-panel`,s=(0,N.useRef)(null),c=Xr(s,`[aria-selected="true"]`,t);return(0,P.jsxs)(`div`,{ref:s,role:`tablist`,"aria-label":r,className:D(`relative mb-6 flex flex-wrap gap-x-6 border-b border-line-soft`,i),children:[(0,P.jsx)(I,{pill:c,className:`border-b-2 border-ink`}),e.map((r,i)=>(0,P.jsxs)(`button`,{id:`${a}-${r.id}`,type:`button`,role:`tab`,"aria-selected":t===r.id,"aria-controls":`${o}-${r.id}`,tabIndex:t===r.id?0:-1,onClick:()=>n(r.id),onKeyDown:t=>{ii(e,i,t.key,a,n)&&t.preventDefault()},className:D(`relative z-10 -mb-px inline-flex min-h-11 cursor-pointer items-center gap-2 border-0 border-b-2 bg-transparent px-1 text-sm font-medium transition-colors duration-(--motion-fast)`,r.mono&&`font-mono text-[13px] font-normal`,t===r.id?D(`text-ink`,c.on?`border-transparent`:`border-ink`):`border-transparent text-muted hover:text-ink`),children:[r.label,r.n!==void 0&&r.n!==null&&(0,P.jsx)(`span`,{className:D(`text-[13px] font-normal tabular-nums`,r.tone||`text-muted`),children:r.n})]},r.id))]})}function si({links:e,current:t,label:n,className:r}){let i=(0,N.useRef)(null),a=Xr(i,`[aria-current="page"]`,t);return(0,P.jsxs)(`nav`,{ref:i,"aria-label":n,className:D(`relative`,$r,r),children:[(0,P.jsx)(I,{pill:a,className:ti,memory:`links:${n}`}),e.map(e=>(0,P.jsxs)(`a`,{href:e.href,"aria-current":t===e.id?`page`:void 0,className:D(ni(t===e.id,a.on),`no-underline hover:no-underline`,t===e.id&&`hover:text-ink`),children:[(0,P.jsx)(ri,{icon:e.icon}),e.label]},e.id))]})}function ci({options:e,value:t,onChange:n,label:r,labelledBy:i,disabled:a=!1,className:o}){let s=e.filter(e=>!e.disabled&&!a),c=(0,N.useRef)(null),l=Xr(c,`[aria-checked="true"]`,t),u=(e,t)=>{let a=s.findIndex(t=>t.id===e),o=s[(a+t+s.length)%s.length];o&&(n(o.id),document.querySelector(`[data-choice="${CSS.escape(o.id)}"][data-group="${CSS.escape(r||i||``)}"]`)?.focus())};return(0,P.jsxs)(`span`,{ref:c,role:`radiogroup`,"aria-label":r,"aria-labelledby":i,className:D(`relative`,$r,o),children:[(0,P.jsx)(I,{pill:l,className:ti}),e.map(e=>{let o=a||!!e.disabled;return(0,P.jsxs)(`button`,{type:`button`,role:`radio`,"data-choice":e.id,"data-group":r||i||``,"aria-checked":t===e.id,"aria-disabled":o||void 0,tabIndex:t===e.id?0:-1,"data-tip":e.tip,onClick:()=>!o&&n(e.id),onKeyDown:t=>{(t.key===`ArrowRight`||t.key===`ArrowLeft`)&&(t.preventDefault(),u(e.id,t.key===`ArrowRight`?1:-1))},className:D(ni(t===e.id,l.on),o&&`cursor-not-allowed opacity-50`),children:[e.icon,e.label,e.n!==void 0&&e.n!==null&&(0,P.jsx)(`span`,{className:D(`text-[13px] font-normal tabular-nums`,e.tone||`text-muted`),children:e.n})]},e.id)})]})}var li={line:16,inset:24},ui={line:8,inset:16},di=(0,N.createContext)(null),fi=`relative z-10 flex h-8 short:h-7 w-full min-w-0 items-center gap-2 rounded-[8px] px-2 text-[13px] no-underline outline-none select-none focus-visible:ring-2 focus-visible:ring-accent`;function pi({offsets:e,width:t,className:n,style:r}){if(!e.length)return null;let i=e[e.length-1],a=i+1;return(0,P.jsxs)(`svg`,{"aria-hidden":`true`,width:t,height:a,viewBox:`0 0 ${t} ${a}`,fill:`none`,style:r,className:D(`pointer-events-none absolute top-0 z-0 text-line-strong`,n),children:[(0,P.jsx)(`path`,{d:`M0.5 0 V${i-5}`,stroke:`currentColor`,strokeWidth:`1`}),e.map((e,n)=>(0,P.jsx)(`path`,{d:`M0.5 ${e-5} Q0.5 ${e} 5.5 ${e} H${t-.5}`,stroke:`currentColor`,strokeWidth:`1`},n))]})}function mi({lines:e,label:t,className:n,children:r}){let i=(0,N.useRef)(null),[a,o]=(0,N.useState)([]),s=N.Children.count(r),c=(0,N.useCallback)(()=>{let t=i.current;if(!t||!e)return;let n=Array.from(t.children).filter(e=>e.tagName.toLowerCase()!==`svg`&&!e.hasAttribute(`data-tree-group`)).map(e=>{let n=e.matches(`[data-tree-row]`)?e:e.querySelector(`[data-tree-row]`);if(!n)return 0;let r=0,i=n;for(;i&&i!==t;)r+=i.offsetTop,i=i.offsetParent;return i===t?Math.round(r+n.offsetHeight/2):0}).filter(e=>e>0);o(e=>e.join()===n.join()?e:n)},[e]);return(0,N.useLayoutEffect)(()=>{if(c(),!i.current||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(c);return e.observe(i.current),()=>e.disconnect()},[s,c]),(0,P.jsxs)(`div`,{ref:i,role:`group`,"aria-label":t,className:D(`relative flex flex-col gap-px`,n),style:e?{paddingLeft:e.inset}:void 0,children:[e&&(0,P.jsx)(pi,{offsets:a,width:e.inset-e.line,style:{left:e.line}}),r]})}function hi(){let e=(0,N.useContext)(di);return{onPointerEnter:t=>t.pointerType===`mouse`&&e?.hover(t.currentTarget),onFocus:t=>t.currentTarget.matches(`:focus-visible`)&&e?.hover(t.currentTarget)}}function gi({href:e,label:t,current:n,icon:r,badge:i,after:a,tip:o,className:s}){let c=hi(),l=(0,P.jsxs)(`a`,{href:e,"data-tree-row":``,"aria-current":n?`page`:void 0,"data-tip":o,"data-tip-side":o?`right`:void 0,...c,className:D(fi,n?`font-medium text-(--side-current-ink) hover:text-(--side-current-ink)`:`text-ink-2 hover:text-ink`,a&&`pr-8`,s),children:[r??(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`size-[18px] flex-none`}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),i]});return a?(0,P.jsxs)(`div`,{className:`group relative`,children:[l,a]}):l}function _i(e,t,n){let[r,i]=(0,N.useState)(t),a=e??r;return[a,()=>{e===void 0&&i(!a),n?.(!a)}]}function vi({href:e,label:t}){return(0,P.jsx)(`a`,{href:e,"aria-label":t,"data-tip":t,"data-tip-side":`right`,className:`absolute top-1/2 right-[30px] z-20 flex size-6 -translate-y-1/2 items-center justify-center rounded-[6px] bg-surface-strong text-muted no-underline opacity-0 transition-opacity group-hover:opacity-100 hover:text-ink focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-accent`,children:(0,P.jsx)(ft,{size:14,strokeWidth:2,"aria-hidden":`true`})})}function yi({label:e,href:t,current:n,className:r,children:i}){let a=(0,N.useId)(),o=`flex h-7 short:h-6 items-center rounded-[6px] px-2 text-[13px] font-medium text-muted no-underline`;return(0,P.jsxs)(`div`,{"data-tree-group":``,role:`group`,"aria-labelledby":a,className:D(`flex flex-col gap-px`,r),children:[t?(0,P.jsx)(`a`,{id:a,href:t,"aria-current":n?`page`:void 0,className:D(o,`hover:text-ink`,n&&`text-(--side-current-ink)`),children:e}):(0,P.jsx)(`span`,{id:a,className:o,children:e}),i]})}function bi({label:e,icon:t,badge:n,href:r,hrefLabel:i,current:a,open:o,defaultOpen:s=!1,onOpenChange:c,children:l,className:u}){let[d,f]=_i(o,s,c),p=(0,N.useId)(),m=hi();return(0,P.jsxs)(`div`,{className:D(`flex flex-col gap-px`,u),children:[(0,P.jsxs)(`div`,{className:`group relative`,children:[(0,P.jsxs)(`button`,{type:`button`,"data-tree-row":``,"aria-expanded":d,"aria-controls":p,"aria-current":a?`page`:void 0,onClick:f,...m,className:D(fi,`cursor-pointer text-left`,a?`font-medium text-(--side-current-ink)`:`text-ink-2 hover:text-ink`),children:[t,(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),n,(0,P.jsx)(S,{size:14,strokeWidth:2,"aria-hidden":`true`,className:D(`flex-none text-muted transition-transform group-hover:text-ink motion-reduce:transition-none`,d&&`rotate-90`)})]}),r&&(0,P.jsx)(vi,{href:r,label:i||`Open ${e}`})]}),(0,P.jsx)(F,{open:d,id:p,children:(0,P.jsx)(mi,{lines:ui,label:e,children:l})})]})}function xi({label:e,icon:t,href:n,hrefLabel:i,current:a,lines:o,open:s,defaultOpen:c=!0,onOpenChange:l,children:u,className:d}){let[f,p]=_i(s,c,l),m=(0,N.useId)(),h=hi();return(0,P.jsxs)(`div`,{className:D(`flex flex-col gap-px`,d),children:[(0,P.jsxs)(`div`,{className:`group relative`,children:[(0,P.jsxs)(`button`,{type:`button`,"data-tree-row":``,"aria-expanded":f,"aria-controls":m,"aria-current":a?`page`:void 0,onClick:p,...h,className:D(fi,`cursor-pointer text-left font-medium`,a?`text-(--side-current-ink)`:t?`text-ink`:`text-muted hover:text-ink`),children:[t,(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),(0,P.jsx)(r,{size:14,strokeWidth:2,"aria-hidden":`true`,className:D(`flex-none text-muted transition-transform group-hover:text-ink motion-reduce:transition-none`,!f&&`-rotate-90`)})]}),n&&(0,P.jsx)(vi,{href:n,label:i||`Open ${e}`})]}),(0,P.jsx)(F,{open:f,id:m,children:(0,P.jsx)(mi,{lines:o,label:e,children:u})})]})}function Si({routeKey:e,className:t,children:n}){let r=(0,N.useRef)(null),i=(0,N.useRef)(null),[a,o]=(0,N.useState)([]),[s,c]=(0,N.useState)(qr),l=(0,N.useCallback)(()=>{let e=r.current;if(!e)return;let t=[...e.querySelectorAll(`[data-tree-row][aria-current="page"]`)].map(t=>Yr(e,t)).filter(e=>e.on);o(e=>e.length===t.length&&e.every((e,n)=>Jr(e,t[n]))?e:t);let n=i.current?.getAttribute(`aria-current`)===`page`?qr:Yr(e,i.current);c(e=>Jr(e,n)?e:n)},[]);(0,N.useLayoutEffect)(l,[e,l]),(0,N.useLayoutEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(l);t.observe(e);let n=new MutationObserver(l);return n.observe(e,{subtree:!0,attributes:!0,attributeFilter:[`aria-current`,`inert`],childList:!0}),()=>{t.disconnect(),n.disconnect()}},[l]);let u=(0,N.useRef)({hover:e=>{i.current=e,l()}}).current;return(0,P.jsx)(di.Provider,{value:u,children:(0,P.jsxs)(`div`,{ref:r,onPointerLeave:()=>u.hover(null),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||u.hover(null)},className:D(`relative flex w-full flex-col gap-px`,t),children:[(0,P.jsx)(I,{pill:s,className:`rounded-[8px] bg-surface-strong/60`}),a.map((e,t)=>(0,P.jsx)(I,{pill:e,className:`rounded-[8px] bg-(--side-current-bg)`},t)),n]})})}var Ci=`flex h-8 short:h-7 items-center gap-2 rounded-[8px] px-2 text-[13px] no-underline`,wi=e=>e?`bg-(--side-current-bg) font-medium text-(--side-current-ink) hover:text-(--side-current-ink)`:`text-ink-2 hover:bg-surface-strong hover:text-ink`,Ti={good:`pass`,bad:`fail`,same:`neutral`},Ei={good:`text-pass`,bad:`text-fail`,same:`text-muted`};function Di(e){return e.dir===`same`||e.good===void 0?`same`:e.good?`good`:`bad`}function Oi({children:e,label:t,className:n}){return(0,P.jsx)(`section`,{"aria-label":t,className:D(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,150px),1fr))] overflow-hidden rounded-[14px] card border`,n),children:e})}function L({label:e,value:t,note:n,icon:r,period:i,change:a,tone:o,big:s,compact:c,className:l}){let u=a&&Di(a),d=a?.dir===`up`?pe:a?.dir===`down`?_t:void 0;return(0,P.jsxs)(`div`,{className:D(`-mr-px -mb-px flex min-w-0 flex-col border-r border-b border-line-soft`,c?`gap-1 px-4 py-2`:`gap-1 px-6 py-4`,l),children:[(0,P.jsxs)(`span`,{className:D(`flex min-w-0 items-center gap-2 font-medium text-ink`,`text-[13px]`),children:[r&&(0,P.jsx)(j,{icon:r,size:14,className:`flex-none text-muted`}),(0,P.jsx)(`span`,{className:`min-w-0`,children:e})]}),i&&(0,P.jsx)(`span`,{className:`text-[13px] text-muted`,children:i}),(0,P.jsxs)(`span`,{className:D(`flex flex-wrap items-center gap-x-2 gap-y-1`,c?`mt-0`:i?`mt-2`:`mt-1`),children:[(0,P.jsx)(`span`,{className:D(`leading-tight font-semibold tracking-[-0.02em] tabular-nums`,s?`text-[25px]`:c?`text-[20px]`:`text-[25px]`,o),children:t}),a&&u&&(0,P.jsx)(`span`,{"aria-hidden":a.against?!0:void 0,className:`inline-flex`,children:(0,P.jsxs)(Qt,{tone:Ti[u],icon:!1,className:`tabular-nums`,children:[d&&(0,P.jsx)(d,{size:12,strokeWidth:2.5,"aria-hidden":`true`,className:`flex-none`}),a.text]})})]}),(n||a?.against)&&(0,P.jsx)(`span`,{className:D(`text-muted tabular-nums`,c?`truncate text-[13px]`:`text-[13px]`),children:a?.against&&u?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:Ei[u],children:a.amount??a.text}),` `,a.against,n?(0,P.jsxs)(P.Fragment,{children:[` · `,n]}):null]}):n})]})}var ki=`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,Ai=`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,ji=`border-t border-line-soft align-top`,Mi=`cursor-pointer border-t border-line-soft align-top hover:bg-surface-muted`,Ni=`px-4 py-2`,Pi=`px-4 py-2 text-right whitespace-nowrap tabular-nums`,Fi=new Set([`className`,`style`,`key`,`ref`,`id`,`role`,`type`,`colSpan`,`rowSpan`,`scope`,`data-tip-side`]);function Ii(e,t=0){if(e==null||typeof e==`boolean`||typeof e==`function`||t>12)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e))return e.map(e=>Ii(e,t+1)).join(` `);if((0,N.isValidElement)(e))return Ii(e.props,t+1);if(typeof e==`object`){let n=[];for(let[r,i]of Object.entries(e))Fi.has(r)||r.startsWith(`on`)||r.startsWith(`aria-`)||n.push(Ii(i,t+1));return n.join(` `)}return``}function Li({label:e,head:t,children:n,empty:r=`None.`,size:i=25,resetKey:a,fixed:o=!1,minWidth:s,className:c,search:l=!0,placeholder:u,tools:d,height:f}){let p=N.Children.toArray(n),[m,h]=(0,N.useState)(``),g=m.toLowerCase().split(/\s+/).filter(Boolean),_=(0,N.useMemo)(()=>l?p.map(e=>Ii(e).toLowerCase()):[],[n,l]),v=g.length?p.filter((e,t)=>g.every(e=>_[t].includes(e))):p,[y,b]=(0,N.useState)(0);(0,N.useEffect)(()=>b(0),[a,m]);let x=(0,N.useRef)(null);(0,N.useEffect)(()=>{f&&x.current&&(x.current.scrollTop=0)},[y,m,a,f]);let ee=Math.max(1,Math.ceil(v.length/i)),S=Math.min(y,ee-1),C=v.slice(S*i,S*i+i),[te,ne]=(0,N.useState)(!1);(0,N.useEffect)(()=>{let e=x.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>ne(e.scrollWidth>e.clientWidth+1||!!f&&e.scrollHeight>e.clientHeight+1),n=new ResizeObserver(t);return n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),t(),()=>n.disconnect()},[f]);let w=N.Children.toArray((0,N.isValidElement)(t)&&t.type===N.Fragment?t.props.children:t).length;return(0,P.jsxs)(`div`,{className:D(`overflow-hidden border-t border-line`,c),children:[(l||d)&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line-soft px-2 py-2`,children:[l&&(0,P.jsxs)(`label`,{className:`relative flex min-w-0 w-full max-w-[320px] flex-[0_1_320px] items-center`,children:[(0,P.jsx)(Te,{size:14,"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 text-muted`}),(0,P.jsxs)(`span`,{className:`sr-only`,children:[`Find in `,e.toLowerCase()]}),(0,P.jsx)(Gt,{size:`sm`,type:`search`,value:m,spellCheck:!1,placeholder:u??`Find in ${e.toLowerCase()}`,onChange:e=>h(e.target.value),className:`pl-8`})]}),d,g.length>0&&(0,P.jsxs)(`span`,{className:`text-[13px] whitespace-nowrap text-muted`,role:`status`,children:[v.length,` of `,p.length]})]}),(0,P.jsx)(`div`,{ref:x,...te?{tabIndex:0,role:`region`,"aria-label":`${e}, scrolls`}:{},className:D(`relative overflow-x-auto focus-visible:outline-offset-[-2px]`,f&&`overflow-y-auto overscroll-contain`),style:f?{height:f}:void 0,children:(0,P.jsxs)(`table`,{"aria-label":e,className:D(`w-full border-collapse text-[13px]`,o&&`table-fixed`),style:s?{minWidth:s}:void 0,children:[(0,P.jsx)(`thead`,{children:(0,P.jsx)(`tr`,{className:D(`bg-surface-strong text-left text-[13px] text-muted`,f&&`sticky top-0 z-[1]`),children:t})}),(0,P.jsxs)(`tbody`,{children:[C,!v.length&&(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:Math.max(1,w),className:`px-4 py-4 text-center text-muted`,children:g.length&&p.length?`Nothing matches.`:r})})]})]})}),v.length>0&&(0,P.jsx)(Zt,{page:S,size:i,total:v.length,onPage:b,label:`Pages of ${e.toLowerCase()}`})]})}var Ri=(0,N.createContext)({pending:{},set:()=>{},saved:new Set,vars:{},store:`the credential store`}),zi=()=>(0,N.useContext)(Ri);function Bi(e){return/[\\/]/.test(e)?`ForgeQE's private credentials file (readable only by you)`:e}var Vi=/^[A-Za-z_][A-Za-z0-9_]*$/;function Hi(e,t){return t in e.pending?e.pending[t]===null?`removing`:`pending`:e.saved.has(t)?`saved`:e.vars[t]?`environment`:`missing`}var Ui={pending:`Not saved yet`,removing:`Removed when you save`,saved:`Saved`,environment:`Set in the environment`,missing:`Not set`},Wi=(e,t)=>[`pending`,`saved`,`environment`].includes(Hi(e,t));function Gi({name:e}){let t=zi();if(!e)return null;if(!Vi.test(e))return(0,P.jsx)(`span`,{className:`text-[13px] text-fail`,children:`Not a variable name`});let n=Hi(t,e);return(0,P.jsx)(`span`,{className:D(`text-[13px]`,n===`saved`||n===`environment`?`text-pass`:n===`missing`?`text-muted`:`text-accent-fg`),children:Ui[n]})}var Ki=/user|email|login|client_id|account/i;function qi({id:e,name:t,field:n,onRename:r,compact:i}){let a=zi(),o=(0,N.useId)(),c=e||o,[l,u]=(0,N.useState)(!1),d=Hi(a,t),f=typeof a.pending[t]==`string`?a.pending[t]:``,m=Ki.test(n)||Ki.test(t);return(0,P.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(Gt,{id:c,"aria-label":e?void 0:n,type:m?`text`:`password`,autoComplete:`off`,spellCheck:!1,value:f,disabled:!Vi.test(t),placeholder:d===`saved`?`Saved. Type a new value to replace it`:d===`environment`?`Set in the environment. Type a value to save one`:m?`Type it once`:`Paste it once`,onChange:e=>a.set(t,e.target.value||void 0)}),d===`saved`&&(0,P.jsx)(A,{variant:`icon`,size:`icon-sm`,onClick:()=>a.set(t,null),"aria-label":`Remove the saved value of ${t}`,"data-tip":`Remove the saved value of ${t}`,children:(0,P.jsx)(s,{"aria-hidden":`true`})}),d===`removing`&&(0,P.jsxs)(A,{size:`sm`,"data-tip":`Keep the saved value of ${t}`,onClick:()=>a.set(t,void 0),children:[(0,P.jsx)(re,{"aria-hidden":`true`}),`Keep`]})]}),!i&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-muted`,children:[(0,P.jsx)(Gi,{name:t}),(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),l&&r?(0,P.jsx)(Gt,{size:`sm`,"aria-label":`Variable name`,autoFocus:!0,defaultValue:t,spellCheck:!1,onBlur:e=>{let n=e.target.value.trim();n&&Vi.test(n)&&n!==t&&r(n),u(!1)},onKeyDown:e=>mn(e)&&e.target.blur(),className:`max-w-[260px] font-mono`}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{children:[`Kept as `,(0,P.jsx)(`span`,{className:`font-mono text-[13px]`,children:t})]}),r&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>u(!0),"data-tip":`Change the variable's name`,className:`inline-flex min-h-8 cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-[13px] font-medium text-accent-fg hover:text-accent-fg-hover [&>svg]:size-3.5`,children:[(0,P.jsx)(p,{"aria-hidden":`true`}),`Rename`]})]})]})]})}function Ji({name:e}){return(0,P.jsx)(Gi,{name:e})}function Yi({id:e,name:t,field:n,named:r,onName:i}){let a=zi();return(0,P.jsx)(Xi,{onFirstValue:()=>{!r&&t&&i(t)},secrets:a,children:(0,P.jsx)(qi,{id:e,name:t,field:n,onRename:i})})}function Xi({secrets:e,onFirstValue:t,children:n}){return(0,P.jsx)(Ri.Provider,{value:{...e,set:(n,r)=>{r&&t(),e.set(n,r)}},children:n})}function Zi({label:e,help:t,htmlFor:n,children:r,className:i,stacked:a,yamlKey:o}){let s=o?(0,P.jsx)(`code`,{className:`font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:o}):null;return a?(0,P.jsxs)(`div`,{className:D(`flex flex-col gap-4 py-4`,i),children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[n?(0,P.jsx)(`label`,{htmlFor:n,className:`text-[13px] leading-snug font-medium text-ink`,children:e}):(0,P.jsx)(`span`,{className:`text-[13px] leading-snug font-medium text-ink`,children:e}),t&&(0,P.jsx)(`span`,{className:`text-[13px] leading-relaxed text-ink-2`,children:t}),s]}),(0,P.jsx)(`div`,{className:`[&>*]:max-w-none`,children:r})]}):(0,P.jsxs)(`div`,{className:D(`flex min-h-16 flex-wrap items-center gap-x-10 gap-y-4 border-t border-line-soft py-4`,i),children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[n?(0,P.jsx)(`label`,{htmlFor:n,className:`text-[13px] leading-snug font-medium text-ink`,children:e}):(0,P.jsx)(`span`,{className:`text-[13px] leading-snug font-medium text-ink`,children:e}),t&&(0,P.jsx)(`span`,{className:`text-[13px] leading-relaxed text-ink-2`,children:t}),s]}),r!=null&&r!==!1&&(0,P.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,children:r})]})}var Qi=`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,$i={"By how you asked":De,"Test runs":x,"Speech on this computer":Le,Conversation:St,"What went wrong":d,"What ForgeQE found":Ct,Questions:wt,"The bug":o,"What is attached":ne,Send:t,"Test case ids":Pe,"Where runs happen":Ue,"The browser window":st,"Limits and checks":yt,"Remote browser, set here":y,"Where tests go":Ye,"How hard it tries":ge,"Help it gets":ot,Reports:ze,"Memory and replays":ue,Suites:ct,"Flaky tests":We,"Release readiness":be,"Regression packs in a pipeline":l,"Defect analysis":o,Accessibility:Ae,"Performance and visual changes":w,"API tests":ce,"The product":Ne,"Instructions and knowledge":mt,Capabilities:ve,"Project report":c,"Report datasets":Ve,"Running in parallel":xe,Driver:dt,Appium:Me,"Devices on this computer":n,"TestMu AI devices":y,"BrowserStack devices":y,"Browser devices":ut,"Appium on this computer":Me,Maestro:Oe,"Windows desktop apps":de,Runtime:se,"Tests in a container":me,"The coding agents' workspace":it,"Browser in a container":le,"How skills are used":Tt,Budgets:ae,"Project folder":f,"ForgeQE in this folder":ie,Repository:Ye,"Features to download":l,Onboarding:be,"This computer":n,"A model":lt,"Models file":$e,"Default model":lt,"Product knowledge graph":u,Repositories:Ye,"Documents and links":et,"Search service":mt,Documents:et,"The product and its knowledge":Ne,"Building the graph":ve,"The team's knowledge":qe,"Agent names":ht,"Custom agents":xt,"Sign-ins":Ee,"Recent runs":_e,"Saved runs":ge,"Test data":Ve,"Areas of work":at,"Which model a call gets":at,Alerts:He,"When to alert":nt,Apps:ut,"By kind of run":tt,"By run, newest first":_e,Guides:mt,"Last 30 days":fe,"Latest problems":d,"Links in alerts":je,"Model calls":St,Plans:Xe,"Recent requests":we,"Results and bugs":he,"What used the most":vt,"Send a test":t,Services:Ie,"Tools used":ve,"What runs":x,"Check the agent's domain knowledge":rt,"Test cases and bugs":ye,"Browser grids":y,Notifications:Ze,"Other tools":Be},ea=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``),ta=D(`settings-card`,Gr,`px-6 py-6 sm:px-8`);function na({children:e,className:t}){return(0,P.jsx)(`div`,{className:D(ta,t),children:e})}function ra(e){return N.Children.toArray(e).flatMap(e=>(0,N.isValidElement)(e)&&e.type===N.Fragment?ra(e.props.children):[e])}function R({children:e}){let t=[],n=[],r=null,i=()=>{r?.items.length&&n.push((0,P.jsx)(na,{children:r.items},r.key)),r=null};return ra(e).forEach((e,a)=>{(0,N.isValidElement)(e)&&aa.has(e.type)?(i(),n.push(e)):((0,N.isValidElement)(e)&&e.type===z&&i(),r||(r={key:`card-${a}`,items:[]},t.push(r)),r.items.push(e))}),i(),(0,P.jsx)(P.Fragment,{children:n})}var ia=e=>typeof e==`string`?e.trim().replace(/^\d+\.\s*/,``):``;function z({children:e,help:t,first:n,icon:r}){let i=r??$i[ia(e)];return(0,P.jsxs)(`div`,{"data-group-title":``,"data-tour":ea(ia(e)),className:D(`mb-4 flex flex-col gap-2`,n?`mt-0`:`mt-10`),children:[(0,P.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-[16px] leading-snug font-semibold text-ink`,children:[i&&(0,P.jsx)(j,{icon:i,size:18,className:`flex-none text-icon`}),e]}),t&&(0,P.jsx)(`p`,{className:D(`m-0 text-[13px] leading-relaxed text-ink-2`,i&&`pl-8`),children:t})]})}var aa=new Set([R]),oa=e=>Array.isArray(e)?e.map(String).join(`, `):typeof e==`string`?e:``,sa=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean);function ca({id:e,value:t,onChange:n,placeholder:r,mono:i}){let[a,o]=(0,N.useState)(oa(t)),[s,c]=(0,N.useState)(t);return JSON.stringify(s)!==JSON.stringify(t)&&(c(t),o(oa(t))),(0,P.jsx)(Gt,{id:e,value:a,placeholder:r,className:D(i&&`font-mono text-[13px]`),onChange:e=>{o(e.target.value);let t=sa(e.target.value);c(t.length?t:void 0),n(t.length?t:void 0)}})}function la({def:e,edit:t,base:n,stacked:r}){let i=(0,N.useId)(),a=e.key?[...n,...e.key.split(`.`)]:n,o=Mr(t.value,a),s=e=>t.set(Pr(t.value,a,e)),c=`w-full`,l=t.file?a.join(`.`):void 0,u;switch(e.type){case`switch`:{let t=o===void 0?!!e.default:o===!0||o===`true`||o===`on`;return(0,P.jsx)(Zi,{label:e.label,help:e.help,yamlKey:l,children:(0,P.jsx)(Rr,{checked:t,onChange:s,label:e.label})})}case`select`:u=(0,P.jsxs)(Bt,{id:i,value:String(o===void 0?e.default??``:o),onChange:e=>s(e.target.value!==`false`&&e.target.value),className:`w-full`,children:[e.default===void 0&&(0,P.jsx)(`option`,{value:``,children:e.emptyLabel||`Not set`}),e.options.map(e=>(0,P.jsx)(`option`,{value:e.value,children:e.label},e.value))]});break;case`number`:u=(0,P.jsx)(Gt,{id:i,type:`number`,inputMode:`numeric`,value:o==null?``:String(o),placeholder:e.default===void 0?e.placeholder:String(e.default),onChange:e=>s(e.target.value===``?void 0:Number(e.target.value)),className:`w-full`});break;case`list`:u=(0,P.jsx)(`div`,{className:c,children:(0,P.jsx)(ca,{id:i,value:o,onChange:s,placeholder:e.placeholder})});break;case`kv`:u=(0,P.jsx)(`div`,{className:c,children:(0,P.jsx)(ua,{id:i,value:o,onChange:s,placeholder:e.placeholder})});break;case`textarea`:u=(0,P.jsx)(Ut,{id:i,rows:3,value:o===void 0?``:String(o),placeholder:e.placeholder,onChange:e=>s(e.target.value),className:c});break;case`var`:{let t=String(o??e.default??e.placeholder??``);return u=(0,P.jsx)(`div`,{className:c,children:(0,P.jsx)(Yi,{id:i,name:t,field:e.key,named:o!==void 0||e.default!==void 0,onName:e=>s(e)})}),(0,P.jsx)(Zi,{label:e.label.replace(/ variable$/,``),help:e.help,htmlFor:i,stacked:r,yamlKey:l,children:u})}default:u=(0,P.jsx)(Gt,{id:i,type:e.type===`url`?`url`:`text`,value:o===void 0?``:String(o),placeholder:e.placeholder??(e.default===void 0?void 0:String(e.default)),spellCheck:e.type===`text`,onChange:e=>s(e.target.value),className:D(c,e.type===`path`&&`font-mono text-[13px]`)})}return(0,P.jsx)(Zi,{label:e.label,help:e.help,htmlFor:i,stacked:r,yamlKey:l,children:u})}function ua({id:e,value:t,onChange:n,placeholder:r}){let i=e=>Object.entries(e&&typeof e==`object`&&!Array.isArray(e)?e:{}).map(([e,t])=>`${e} = ${typeof t==`object`?JSON.stringify(t):String(t)}`).join(`
6
- `),[a,o]=(0,N.useState)(i(t)),[s,c]=(0,N.useState)(t);return JSON.stringify(s)!==JSON.stringify(t)&&(c(t),o(i(t))),(0,P.jsx)(Ut,{id:e,rows:3,value:a,spellCheck:!1,placeholder:r??`NAME = value`,className:`font-mono`,onChange:e=>{o(e.target.value);let t={};for(let n of e.target.value.split(`
7
- `)){let e=n.indexOf(`=`),r=(e<0?n:n.slice(0,e)).trim();if(!r)continue;let i=e<0?``:n.slice(e+1).trim();t[r]=/^-?\d+(\.\d+)?$/.test(i)?Number(i):i===`true`||i!==`false`&&i}let r=Object.keys(t).length?t:void 0;c(r),n(r)}})}function da({defs:e,edit:t,base:n,stacked:r}){let i=Mr(t.value,n),a=i&&typeof i==`object`&&!Array.isArray(i)?i:{};return(0,P.jsx)(P.Fragment,{children:e.filter(e=>!e.when||e.when(a)).map(e=>(0,P.jsx)(la,{def:e,edit:t,base:n,stacked:r},e.key))})}function fa({title:e,meta:t,state:n,open:i,onToggle:a,lead:o,actions:s,children:c,expandable:l}){let u=(0,N.useId)();return(0,P.jsxs)(`div`,{className:`border-t border-line-soft`,children:[(0,P.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 py-4`,children:[o,l===!1?(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:e}),t&&(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:t})]}):(0,P.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":u,onClick:a,className:`flex min-w-0 flex-[1_1_260px] cursor-pointer items-center gap-4 rounded-[10px] border-0 bg-transparent p-0 text-left text-ink`,children:[(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:e}),t&&(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:t})]}),(0,P.jsx)(r,{size:18,"aria-hidden":`true`,className:D(`flex-none text-muted transition-transform`,i&&`rotate-180`)})]}),n,s]}),l!==!1&&(0,P.jsx)(F,{open:i,id:u,children:(0,P.jsx)(`div`,{className:`mb-4 border-l-2 border-line-soft pb-2 pl-4 sm:pl-6 [&>*:first-child]:border-t-0`,children:c})})]})}function pa(e){let[t,n]=(0,N.useState)(null),[r,i]=(0,N.useState)(``),a=(0,N.useCallback)(()=>{i(``),e().then(n,e=>i(e.message))},[e]);return(0,N.useEffect)(a,[a]),{data:t,error:r,reload:a}}function ma({error:e,reload:t}){return e?(0,P.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-4 rounded-[14px] card border p-6`,children:[(0,P.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e}),(0,P.jsxs)(A,{size:`sm`,onClick:t,children:[(0,P.jsx)(m,{"aria-hidden":`true`}),`Retry`]})]}):(0,P.jsx)(`p`,{role:`status`,className:`m-0 py-4 text-sm text-muted`,children:`Loading…`})}function B({children:e}){return(0,P.jsx)(rn,{className:`py-4`,children:e})}function V(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ha(e){return`${V(e.input)} read${e.cached?` (${V(e.cached)} from cache)`:``} · ${V(e.output)} written`}var H=null;function ga(e){H=e}function U(e,t){if(!t)return`—`;let n=H?.to,r=H?.perEur?.[t],i=n?H?.perEur?.[n]:void 0,[a,o]=n&&n!==t&&r&&i?[e/r*i,n]:[e,t];try{let e=Math.abs(a)>=1e4;return new Intl.NumberFormat(void 0,{style:`currency`,currency:o,...e?{notation:`compact`,maximumFractionDigits:1}:{maximumFractionDigits:Math.abs(a)<1?3:2}}).format(a)}catch{return`${a.toFixed(2)} ${o}`}}function _a(e){if(!H?.perEur||!e||H.to===e||!H.perEur[e])return``;let t=U(1,e);return`Shown in ${H.to}, converted from ${e} at the European Central Bank's rate of ${H.date}: ${new Intl.NumberFormat(void 0,{style:`currency`,currency:e}).format(1)} = ${t}.`}var W=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})},va=e=>e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} bytes`;function G({head:e,children:t,label:n}){return(0,P.jsx)(Li,{label:n,head:e.map((e,t)=>(0,P.jsx)(`th`,{scope:`col`,className:t>0?Ai:ki,children:e},e||t)),children:t})}function K({cells:e}){return(0,P.jsx)(`tr`,{className:`border-t border-line-soft`,children:e.map((e,t)=>(0,P.jsx)(`td`,{className:D(`px-4 py-2 align-top`,t>0?`text-right whitespace-nowrap tabular-nums`:`min-w-[200px]`),children:e},t))})}var ya={title:`How skills are used`,base:[`skills`],fields:[{key:`enabled`,label:`Use skills`,type:`switch`,default:!0},{key:`external`,label:`Also read Claude and agent skills`,help:`~/.claude/skills, ~/.agents/skills, and the repository's own.`,type:`switch`,default:!1},{key:`dirs`,label:`More skill folders`,help:`Comma separated. They win over the others.`,type:`list`,placeholder:`../shared-skills`},{key:`browser_max_chars`,label:`Skill text per browser run`,help:`Characters.`,type:`number`,default:6e3}]},ba={"no match":`not run before`,"not a rerun":`not run before`,"not a recorded goal":`not run before`,"no recorded run matches":`not run before`,"its last run did not pass":`its last run failed`,"marked stale":`its saved steps are out of date`,"more than one recorded start page for this goal":`saved from more than one start page`};function xa(e,t){return e===`tier0`?t===`shadow`?`Test mode: AI ran it, could have replayed`:`Replayed for free`:`AI: ${ba[e]||e}`}function Sa({edit:e}){let{data:t,error:n,reload:i}=pa(O.registry),[a,o]=(0,N.useState)(!1),s=String(Mr(e.value,[`registry`,`mode`])??`on`);return(0,P.jsxs)(R,{children:[(0,P.jsx)(Zi,{label:`Replay passed runs for free`,help:s===`shadow`?`In test mode now: ForgeQE only notes what it would have replayed, and the AI runs everything. Turn it on to use replays.`:`If the page changed, the AI takes over.`,yamlKey:e.file?`registry.mode`:void 0,children:(0,P.jsx)(Rr,{checked:s===`on`,onChange:t=>e.set(Pr(e.value,[`registry`,`mode`],t?`on`:`off`)),label:`Replay passed runs for free`})}),t?!t.exists||t.plans.length===0?(0,P.jsx)(B,{children:`Nothing to replay yet. When a run passes, ForgeQE saves its steps, and running it again is free.`}):(0,P.jsxs)(R,{children:[(0,P.jsxs)(Oi,{label:`Replays`,className:`mt-4`,children:[(0,P.jsx)(L,{icon:ge,label:`Free reruns`,value:String(t.replayed),note:`of ${zt(t.total,`run`)}`}),(0,P.jsx)(L,{icon:v,label:`Tokens saved`,value:V(t.tokensSaved),note:`${zt(t.plans.length,`passed run`)} ready to replay`})]}),(0,P.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":`replay-details`,onClick:()=>o(!a),"data-tip":a?`Hide details`:`Show details`,className:`mt-2 inline-flex min-h-10 cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-sm font-medium text-accent-fg hover:text-accent-fg-hover [&>svg]:size-4`,children:[a?(0,P.jsx)(te,{"aria-hidden":`true`}):(0,P.jsx)(r,{"aria-hidden":`true`}),a?`Less`:`Details`]}),(0,P.jsxs)(F,{open:a,id:`replay-details`,children:[(0,P.jsx)(z,{first:!0,children:`Saved runs`}),(0,P.jsx)(G,{label:`Saved runs`,head:[`Goal`,`Passed`,`Failed`,`Tokens the first time`,`Last used`],children:t.plans.map(e=>(0,P.jsx)(K,{cells:[(0,P.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`line-clamp-2`,children:e.goal}),e.stale&&(0,P.jsx)(`span`,{className:`text-[13px] text-warn`,children:`Out of date: the AI runs it next time`})]}),e.successes,e.failures,e.firstTokens?V(e.firstTokens):`—`,W(e.lastAt)]},e.id))}),(0,P.jsx)(z,{children:`Recent runs`}),t.requests.length===0?(0,P.jsx)(B,{children:`No runs yet.`}):(0,P.jsx)(G,{label:`Recent runs`,head:[`Request`,`How it ran`,`Result`,`Tokens`,`When`],children:t.requests.map(e=>(0,P.jsx)(K,{cells:[(0,P.jsx)(`span`,{className:`line-clamp-2`,children:e.request||e.planGoal||e.id}),xa(e.decision,e.mode),e.outcome||`—`,V(e.tokens),W(e.startedAt)]},e.id))})]})]}):(0,P.jsx)(ma,{error:n,reload:i})]})}function Ca(){let{data:e,error:t,reload:n}=pa(O.logs),[r,i]=(0,N.useState)(null),[a,o]=(0,N.useState)(``);return e?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{className:`mt-0 mb-4 text-sm text-muted`,children:[`Kept in `,(0,P.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.dir}),`. Secrets are replaced with their names before a log is shown.`]}),a&&(0,P.jsx)(`p`,{role:`alert`,className:`mt-0 mb-4 text-sm text-fail`,children:a}),e.logs.length===0?(0,P.jsx)(B,{children:`No session logs yet. ForgeQE writes one for each chat, run and suite.`}):e.logs.map(e=>(0,P.jsxs)(`div`,{className:`flex min-h-[60px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-2`,children:[(0,P.jsx)(Ar,{icon:Se}),(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`font-mono text-[13px] break-all`,children:e.name}),(0,P.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[W(e.modified),`, `,va(e.size)]})]}),(0,P.jsx)(A,{variant:`icon`,size:`icon-sm`,"aria-label":`Open ${e.name}`,"data-tip":`Open ${e.name}`,onClick:()=>{o(``),O.log(e.name).then(i,e=>o(e.message))},children:(0,P.jsx)(Se,{"aria-hidden":`true`})})]},e.name)),(0,P.jsx)(_n,{wide:!0,open:!!r,onClose:()=>i(null),title:r?.name||``,description:r?.truncated?`The end of the log; the start is cut to keep it quick to open.`:void 0,footer:(0,P.jsxs)(A,{onClick:()=>i(null),children:[(0,P.jsx)(g,{"aria-hidden":`true`}),`Close`]}),children:r&&(0,P.jsx)(`pre`,{className:`m-0 mt-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap break-all`,children:(0,P.jsx)(sn,{text:r.text})})})]}):(0,P.jsx)(ma,{error:t,reload:n})}var wa={error:`Error`,tool:`Tool call failed`,run:`Run failed`,engine:`Browser engine stopped`,agent:`Agent error`,model:`Model call failed`},Ta={chat:`Chat`,start:`Shell`,run:`Run`,suite:`Suite`,code:`Write tests`,heal:`Heal`,monitor:`Monitor`,mcp:`MCP`,explore:`Explore`};function Ea(){let[e,t]=(0,N.useState)(null),[n,r]=(0,N.useState)(``);return{show:e=>{r(``),O.log(e).then(t,e=>r(e.message))},error:n,sheet:(0,P.jsx)(_n,{wide:!0,open:!!e,onClose:()=>t(null),title:e?.name||``,description:e?.truncated?`The end of the log; the start is cut to keep it quick to open.`:void 0,footer:(0,P.jsxs)(A,{onClick:()=>t(null),children:[(0,P.jsx)(g,{"aria-hidden":`true`}),`Close`]}),children:e&&(0,P.jsx)(`pre`,{className:`m-0 mt-4 font-mono text-[13px] leading-relaxed break-all whitespace-pre-wrap`,children:(0,P.jsx)(sn,{text:e.text})})})}}function Da({entries:e}){let[t,n]=(0,N.useState)(-1);return e.length?(0,P.jsx)(P.Fragment,{children:e.map((e,r)=>(0,P.jsx)(fa,{lead:(0,P.jsx)(Ar,{icon:_e}),title:`${e.action}: ${e.file}`,meta:`${W(e.at)}, ${e.user} on ${e.machine}, ${e.changes.length} change${e.changes.length===1?``:`s`}`,open:t===r,onToggle:()=>n(t===r?-1:r),children:(0,P.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0 py-4`,children:e.changes.map((e,t)=>(0,P.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-sm`,children:[(0,P.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.key}),(0,P.jsx)(`span`,{className:`text-muted`,children:e.before===void 0?(0,P.jsxs)(P.Fragment,{children:[`added `,(0,P.jsx)(`span`,{className:`text-ink`,children:e.after})]}):e.after===void 0?(0,P.jsxs)(P.Fragment,{children:[`removed `,(0,P.jsx)(`span`,{className:`text-ink line-through`,children:e.before})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`text-ink line-through`,children:e.before}),` → `,(0,P.jsx)(`span`,{className:`text-ink`,children:e.after})]})})]},t))})},r))}):(0,P.jsx)(B,{children:`No changes made in Settings yet.`})}function Oa(){let{data:e,error:t,reload:n}=pa(O.audit),[r,i]=(0,N.useState)(`summary`),a=Ea();if(!e)return(0,P.jsx)(ma,{error:t,reload:n});let o=e.summary,s=o.totals,c=e=>e?`${e} failed`:`None failed`;return(0,P.jsxs)(R,{children:[(0,P.jsx)(`p`,{className:`mt-0 mb-4 text-sm text-muted`,children:`The last 30 days, from the session logs on this machine and its usage ledger. Model calls count every project on this machine.`}),(0,P.jsx)(oi,{label:`Audit`,current:r,onPick:i,tabs:[{id:`summary`,label:`Summary`},{id:`problems`,label:`Problems (${o.problems.length})`},{id:`sessions`,label:`Sessions (${o.sessions.length})`},{id:`changes`,label:`Settings changes (${e.entries.length})`}]}),a.error&&(0,P.jsx)(`p`,{role:`alert`,className:`mt-0 mb-4 text-sm text-fail`,children:a.error}),(0,P.jsxs)(`div`,{id:`panel-${r}`,role:`tabpanel`,"aria-labelledby":`tab-${r}`,children:[r===`summary`&&(0,P.jsxs)(R,{children:[(0,P.jsxs)(Oi,{label:`Activity summary`,children:[(0,P.jsx)(L,{icon:St,label:`Sessions`,value:String(s.sessions),note:s.replays?`${s.replays} request${s.replays===1?``:`s`} replayed without the agent`:void 0}),(0,P.jsx)(L,{icon:ve,label:`Tool calls`,value:String(s.toolCalls),note:c(s.toolErrors)}),(0,P.jsx)(L,{icon:x,label:`Runs`,value:String(s.runs),note:c(s.runsFailed)}),(0,P.jsx)(L,{icon:lt,label:`Model calls`,value:String(s.modelCalls),note:c(s.modelErrors)}),(0,P.jsx)(L,{icon:d,label:`Errors`,value:String(s.errors),note:s.escalations?`${s.escalations} switch${s.escalations===1?``:`es`} to a stronger model`:void 0})]}),o.problems.length>0&&(0,P.jsxs)(R,{children:[(0,P.jsx)(z,{children:`Latest problems`}),(0,P.jsx)(ka,{problems:o.problems.slice(0,5),onLog:a.show}),o.problems.length>5&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>i(`problems`),"data-tip":`All ${o.problems.length} problems`,className:`mt-4 inline-flex min-h-10 cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-sm font-medium text-accent-fg hover:text-accent-fg-hover [&>svg]:size-4`,children:[(0,P.jsx)(ft,{"aria-hidden":`true`}),`All (`,o.problems.length,`)`]})]}),(0,P.jsx)(z,{children:`Tools used`}),o.tools.length===0?(0,P.jsx)(B,{children:`No tool calls logged in the last 30 days.`}):(0,P.jsx)(G,{label:`Tools used`,head:[`Tool`,`Calls`,`Failed`,`Average time`],children:o.tools.map(e=>(0,P.jsx)(K,{cells:[(0,P.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.name}),e.calls,e.errors?(0,P.jsx)(`span`,{className:`text-fail`,children:e.errors}):0,e.calls?`${(e.ms/e.calls/1e3).toFixed(1)} s`:`—`]},e.name))}),(0,P.jsx)(z,{children:`Model calls`}),o.models.length===0?(0,P.jsx)(B,{children:`No model calls in the usage ledger in the last 30 days.`}):(0,P.jsx)(G,{label:`Model calls`,head:[`Model`,`Calls`,`Failed`,`Tokens`],children:o.models.map(e=>(0,P.jsx)(K,{cells:[e.model,e.calls,e.errors?(0,P.jsx)(`span`,{className:`text-fail`,children:e.errors}):0,V(e.tokens)]},e.model))})]}),r===`problems`&&(o.problems.length?(0,P.jsx)(ka,{problems:o.problems,onLog:a.show}):(0,P.jsx)(B,{children:`Nothing failed in the last 30 days.`})),r===`sessions`&&(o.sessions.length?(0,P.jsx)(G,{label:`Sessions`,head:[`Session`,`Tool calls`,`Runs`,`Errors`,`Tokens`,``],children:o.sessions.map(e=>(0,P.jsx)(K,{cells:[(0,P.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:Ta[e.command]||e.command}),(0,P.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[W(e.started),e.model?`, ${e.model}`:``]})]}),e.toolErrors?`${e.tools} (${e.toolErrors} failed)`:e.tools,e.runsFailed?`${e.runs} (${e.runsFailed} failed)`:e.runs,e.errors?(0,P.jsx)(`span`,{className:`text-fail`,children:e.errors}):0,V(e.tokens),(0,P.jsx)(A,{variant:`icon`,size:`icon-sm`,"aria-label":`Open the log of the ${Ta[e.command]||e.command} session at ${W(e.started)}`,"data-tip":`Open the log of the ${Ta[e.command]||e.command} session at ${W(e.started)}`,onClick:()=>a.show(e.log),children:(0,P.jsx)(Se,{"aria-hidden":`true`})})]},e.log))}):(0,P.jsx)(B,{children:`No sessions logged in the last 30 days.`})),r===`changes`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{className:`mt-0 mb-4 text-sm text-muted`,children:[`Every change made in Settings, kept in `,(0,P.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.file}),`. Changes made to the files by hand are not here.`]}),(0,P.jsx)(Da,{entries:e.entries})]})]}),a.sheet]})}function ka({problems:e,onLog:t}){return(0,P.jsx)(P.Fragment,{children:e.map((e,n)=>(0,P.jsxs)(`div`,{className:`flex min-h-[64px] flex-wrap items-center gap-x-4 gap-y-2 border-t border-line-soft py-4`,children:[(0,P.jsx)(Ar,{icon:e.kind===`run`||e.kind===`tool`?h:d,className:`bg-fail-soft text-fail`}),(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:wa[e.kind]}),(0,P.jsx)(`span`,{className:`text-sm break-words text-ink-2`,children:e.text}),(0,P.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[W(e.at),`, `,Ta[e.command]||e.command]})]}),e.log&&(0,P.jsx)(A,{variant:`icon`,size:`icon-sm`,"aria-label":`Open the log for: ${e.text.slice(0,60)}`,"data-tip":`Open the log for: ${e.text.slice(0,60)}`,onClick:()=>t(e.log),children:(0,P.jsx)(Se,{"aria-hidden":`true`})})]},n))})}var Aa={title:`Budgets`,help:`Money in the model's price currency, or GitHub Copilot premium requests. They only warn, at 80, 90 and 100 percent, and never stop a run. Day and month count every ForgeQE process on this machine.`,base:[`budget`],fields:[{key:`run`,label:`Per browser run`,type:`number`},{key:`day`,label:`Per day`,type:`number`},{key:`month`,label:`Per month`,type:`number`},{key:`currency`,label:`Currency`,type:`text`,placeholder:`USD`},{key:`premium_requests.run`,label:`Premium requests per browser run`,help:`GitHub Copilot: each call uses the model's multiplier, 0 for a model included in your plan.`,type:`number`},{key:`premium_requests.day`,label:`Premium requests per day`,type:`number`},{key:`premium_requests.month`,label:`Premium requests per month`,type:`number`}]},ja={suite:`Suites`,monitor:`Monitor rounds`,run:`Browser runs`,explore:`Exploratory`,api:`API tests`,desktop:`Desktop runs`,mobile:`Mobile runs`},Ma={suite:`Suite`,monitor:`Monitor round`,run:`Browser run`,explore:`Exploratory`,api:`API test`,desktop:`Desktop run`,mobile:`Mobile run`,chat:`Chat`,"custom agent":`Custom agent`,talk:`Talk`,"browser test":`Browser run`,"mobile test":`Mobile run`},Na=e=>Ma[e]||e.charAt(0).toUpperCase()+e.slice(1);function Pa({days:e,currency:t}){let[n,r]=(0,N.useState)(-1),i=Math.max(1,...e.map(e=>e.input+e.output)),a=e.reduce((e,t)=>e+t.input+t.output,0),o=e.filter(e=>e.runs>0).length,s=e.reduce((e,t)=>t.input+t.output>e.input+e.output?t:e,e[0]),c=n>=0?e[n]:e[e.length-1],l=e=>new Date(`${e}T12:00:00Z`).toLocaleDateString(void 0,{month:`short`,day:`numeric`});return(0,P.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,P.jsxs)(`p`,{"aria-live":`polite`,className:`m-0 text-sm text-ink-2`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:l(c.day)}),`: `,V(c.input+c.output),` tokens, `,c.runs,` run`,c.runs===1?``:`s`,t?`, ${U(c.amount,t)}`:``]}),(0,P.jsx)(`div`,{role:`img`,"aria-label":`Tokens a day for the last 30 days: ${V(a)} in all, on ${o} days with runs; the busiest was ${l(s.day)} with ${V(s.input+s.output)}.`,className:`flex h-[160px] items-end gap-1 border-b border-line`,onMouseLeave:()=>r(-1),children:e.map((t,a)=>{let o=t.input+t.output;return(0,P.jsx)(`div`,{className:`flex h-full flex-1 cursor-default items-end`,onMouseEnter:()=>r(a),children:(0,P.jsx)(`div`,{className:D(`w-full rounded-t-[4px] transition-[height]`,a===e.length-1||a===n?`bg-accent`:`bg-accent-line`),style:{height:o?`${Math.max(2,o/i*100)}%`:`0`}})},t.day)})}),(0,P.jsxs)(`div`,{"aria-hidden":`true`,className:`flex justify-between text-[13px] text-muted`,children:[(0,P.jsx)(`span`,{children:l(e[0].day)}),(0,P.jsx)(`span`,{children:l(e[e.length-1].day)})]})]})}function Fa({rows:e,currency:t,label:n}){if(!e.length)return(0,P.jsx)(B,{children:`Nothing yet.`});let r=Math.max(1,...e.map(e=>e.sum.input+e.sum.output));return(0,P.jsx)(`ul`,{"aria-label":n,className:`m-0 flex list-none flex-col gap-4 p-0`,children:e.map(e=>{let n=e.sum.input+e.sum.output;return(0,P.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,P.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 text-sm`,children:[(0,P.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,P.jsxs)(`span`,{className:`whitespace-nowrap text-ink-2 tabular-nums`,children:[V(n),` tokens`,t&&e.sum.amount?`, ${U(e.sum.amount,t)}`:``]})]}),(0,P.jsx)(`div`,{"aria-hidden":`true`,className:`h-2 rounded-full bg-surface-strong`,children:(0,P.jsx)(`div`,{className:`h-2 rounded-full bg-accent transition-[width] duration-200 ease-out`,style:{width:`${Math.max(1,n/r*100)}%`}})})]},e.name)})})}var Ia=e=>{let t=Math.round(e*100)/100;return`${t} premium request${t===1?``:`s`}`};function La({label:e,spent:t,limit:n,currency:r,premium:i}){let a=e=>i?Ia(e):U(e,r),o=t/n*100,s=o>=100?`fail`:o>=80?`warn`:`ok`;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 text-sm`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:e}),(0,P.jsxs)(`span`,{className:D(`tabular-nums`,s===`fail`?`text-fail`:s===`warn`?`text-warn`:`text-ink-2`),children:[a(t),` of `,a(n),s===`fail`?`, over budget`:s===`warn`?`, ${Math.round(o)} percent used`:``]})]}),(0,P.jsx)(`div`,{role:`img`,"aria-label":`${e}: ${a(t)} of ${a(n)}, ${Math.round(o)} percent`,className:`h-2 rounded-full bg-surface-strong`,children:(0,P.jsx)(`div`,{className:D(`h-2 rounded-full transition-[width] duration-200 ease-out`,s===`fail`?`bg-fail`:s===`warn`?`bg-warn`:`bg-accent`),style:{width:`${Math.min(100,Math.max(1,o))}%`}})})]})}function Ra({edit:e}){let{data:t,error:n,reload:r}=pa(O.tokenomics),i=(0,P.jsx)(da,{defs:Aa.fields,edit:e,base:Aa.base});if(!t)return(0,P.jsx)(ma,{error:n,reload:r});let a=t,o=a.currency,s=a.totals.input+a.totals.output,c=a.budget,l=c?.currency||a.spent?.currency||o,u=a.project?.days30.calls?a.project:void 0,d=u?u.days30.input+u.days30.output:0;return(0,P.jsxs)(R,{children:[u&&(0,P.jsxs)(R,{children:[(0,P.jsxs)(`p`,{className:`mt-0 mb-4 text-sm text-muted`,children:[`Every model call made for this project from `,a.days[0]?.day,` to today: chats, runs and the agents they started, each priced when it was made. These are the figures the workspace panel shows. `,(0,P.jsx)(`a`,{href:T(`cost`),children:`Cost and model usage`}),` breaks them down by agent, job and model, priced at today's prices.`]}),(0,P.jsxs)(Oi,{label:`All model calls, last 30 days`,children:[(0,P.jsx)(L,{icon:Ce,label:`Tokens`,value:V(d),note:ha(u.days30)}),(0,P.jsx)(L,{icon:ae,label:`Cost`,value:u.currency?U(u.days30.amount,u.currency):`—`,note:u.currency?`When each call was made`:`No prices known`}),(0,P.jsx)(L,{icon:w,label:`Calls`,value:u.days30.calls.toLocaleString(),note:`${V(u.today.input+u.today.output)} tokens today`}),(0,P.jsx)(L,{icon:Ge,label:`Read from cache`,value:u.days30.input?`${Math.round(u.days30.cached/u.days30.input*100)}%`:`—`,note:`Of the tokens read`})]}),_a(u.currency)&&(0,P.jsx)(`p`,{className:`mt-4 mb-0 text-[13px] text-muted`,children:_a(u.currency)}),u.byChannel&&(0,P.jsxs)(R,{children:[(0,P.jsx)(z,{help:`The same calls, by how the request was made: said aloud through Talk, or typed (and everything else ForgeQE ran).`,children:`By how you asked`}),(0,P.jsx)(Fa,{label:`Tokens by how you asked`,currency:u.currency,rows:[{name:`Voice (Talk), ${u.byChannel.voice.calls.toLocaleString()} calls`,sum:{runs:0,...u.byChannel.voice}},{name:`Typed and other, ${u.byChannel.typed.calls.toLocaleString()} calls`,sum:{runs:0,...u.byChannel.typed}}]})]}),!!u.top?.length&&(0,P.jsxs)(R,{children:[(0,P.jsx)(z,{help:`Every chat, custom agent, test run and writing job of the last 30 days, by the model calls it made.`,children:`What used the most`}),(0,P.jsx)(G,{label:`Work that used the most tokens`,head:[`Work`,`Kind`,`Tokens`,`Cost`,`When`],children:u.top.map(e=>(0,P.jsx)(K,{cells:[(0,P.jsxs)(`span`,{className:`line-clamp-2`,children:[e.title,e.voice?(0,P.jsx)(`span`,{className:`text-muted`,children:` · by voice`}):null]}),Na(e.kind),V(e.tokens),e.amount!==void 0&&u.currency?U(e.amount,u.currency):`—`,e.startedAt?W(e.startedAt):`—`]},e.id))})]}),(0,P.jsx)(z,{children:`Test runs`})]}),a.totals.runs===0?(0,P.jsx)(B,{children:`No test runs with token counts in the last 30 days. Every run and suite ForgeQE reports on is counted here; chats are not.`}):(0,P.jsxs)(R,{children:[(0,P.jsxs)(`p`,{className:`mt-0 mb-4 text-sm text-muted`,children:[`From `,a.totals.runs,` run`,a.totals.runs===1?``:`s`,` in this project's reports in the last 30 days`,a.from?`, ${a.from} to ${a.to}`:``,`: test runs only, not chats. Models and agents come from the `,a.totals.withCalls,` run`,a.totals.withCalls===1?``:`s`,` that kept their model calls.`]}),(0,P.jsxs)(Oi,{label:`Test runs, last 30 days`,children:[(0,P.jsx)(L,{icon:Ce,label:`Tokens`,value:V(s),note:ha(a.totals)}),(0,P.jsx)(L,{icon:ae,label:`Cost`,value:U(a.totals.amount,o),note:a.totals.unpriced?`${a.totals.unpriced} run${a.totals.unpriced===1?``:`s`} had no price`:o?`At the models' prices`:`No prices known`}),(0,P.jsx)(L,{icon:w,label:`Per run`,value:V(Math.round(s/a.totals.runs)),note:o?U(a.totals.amount/a.totals.runs,o):void 0}),(0,P.jsx)(L,{icon:Ge,label:`Read from cache`,value:a.totals.input?`${Math.round(a.totals.cached/a.totals.input*100)}%`:`—`,note:`Of the tokens read`})]}),_a(a.currency)&&u?.currency!==a.currency&&(0,P.jsx)(`p`,{className:`mt-4 mb-0 text-[13px] text-muted`,children:_a(a.currency)}),a.otherCurrency>0&&(0,P.jsxs)(`p`,{className:`mt-4 mb-0 text-[13px] text-muted`,children:[a.otherCurrency,` run`,a.otherCurrency===1?` was`:`s were`,` priced in another currency and left out of the cost.`]}),(0,P.jsx)(z,{children:`Last 30 days`}),(0,P.jsx)(Pa,{days:a.days,currency:o}),(0,P.jsxs)(`div`,{className:`mt-8 flex flex-wrap gap-x-10 gap-y-8`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-4`,children:[(0,P.jsx)(`h3`,{className:`m-0 text-base font-semibold`,children:`By model`}),(0,P.jsx)(Fa,{label:`Tokens by model`,rows:a.byModel.map(e=>({name:e.model,sum:e})),currency:o})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-4`,children:[(0,P.jsx)(`h3`,{className:`m-0 text-base font-semibold`,children:`By agent`}),(0,P.jsx)(Fa,{label:`Tokens by agent`,rows:a.byAgent.map(e=>({name:e.agent,sum:e})),currency:o})]})]}),(0,P.jsx)(z,{children:`By kind of run`}),(0,P.jsx)(Fa,{label:`Tokens by kind of run`,rows:a.byKind.map(e=>({name:`${ja[e.kind]||e.kind} (${e.runs})`,sum:e})),currency:o})]}),(0,P.jsx)(z,{help:Aa.help,children:Aa.title}),c&&a.spent&&(c.day||c.month)?(0,P.jsxs)(`div`,{className:`mb-4 flex flex-col gap-4 rounded-[14px] card border p-4`,children:[c.day?(0,P.jsx)(La,{label:`Today`,spent:a.spent.today,limit:c.day,currency:l}):null,c.month?(0,P.jsx)(La,{label:`This month`,spent:a.spent.month,limit:c.month,currency:l}):null]}):null,c?.premium&&a.spent&&(c.premium.day||c.premium.month)?(0,P.jsxs)(`div`,{className:`mb-4 flex flex-col gap-4 rounded-[14px] card border p-4`,children:[c.premium.day?(0,P.jsx)(La,{label:`Premium requests today`,spent:a.spent.premiumToday||0,limit:c.premium.day,premium:!0}):null,c.premium.month?(0,P.jsx)(La,{label:`Premium requests this month`,spent:a.spent.premiumMonth||0,limit:c.premium.month,premium:!0}):null]}):null,i]})}var q=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},J=e=>typeof e==`string`?e:e==null?``:String(e),za=e=>e.replace(/(?:\s*\[(?:They spoke while you were talking; they heard up to: |Running elsewhere in ForgeQE now, as data: )[^\n]*\])+\s*$/,``),Ba=(e,t=400)=>e.length>t?`${e.slice(0,t-1)}…`:e,Y=e=>typeof e==`number`?` in ${Math.round(e/1e3)}s`:``;function X(e,t=400){return Ba(e.replace(/\s+/g,` `).trim(),t).replace(/([\\`*_[\]<>#|~!])/g,`\\$1`)}function Va(e){let t=e.replace(/\s+/g,` `).trim();if(!t)return``;let n=t.includes("`")?"``":"`";return`${n}${n==="``"?` `:``}${t}${n==="``"?` `:``}${n}`}function Ha(e,t){return/^https?:\/\/[^\s)]+$/i.test(t)?`[${X(e||t,120)}](${t})`:X(e)}var Ua=e=>[Va(J(q(e).id)),X(J(q(e).title),200)].filter(Boolean).join(` `);function Wa(e){return e.replace(/<!--[\s\S]*?(?:-->|$)/g,``).trim()}function Ga(e){return e.replace(/\[((?:\\.|[^\]\\])*)\]\(https?:\/\/[^\s)]+\)/g,`$1`).replace(/\\(.)/g,`$1`).replace(/[*`]/g,``)}var Z=(e,t)=>({tone:e,kind:`item`,md:t}),Ka=(e,t)=>({tone:e,kind:`sub`,md:t});function qa(e,t=``){let n=t||(e.agent&&e.agent!==`forgeqe`?`**${X(J(e.agent))}:** `:``);switch(e.kind){case`info`:return Z(`info`,`${n}${X(J(e.text))}`);case`start`:return Z(`dim`,`${n}→ ${Va(J(e.tool))}${e.text&&e.text!==e.tool?` ${X(J(e.text),200)}`:``}`);case`tool`:{let t=q(e.file),r=q(e.shell).exit,i=typeof r==`number`&&r!==0?` (exit code ${r})`:``;return Z(e.ok===!1?`warn`:`dim`,`${n}${e.ok===!1?`⚠`:`✓`} ${X(J(e.text)||J(e.tool),240)}${i}${t.path?` (${X(J(t.action))} ${Va(J(t.path))})`:``}`)}case`say`:{let t=Wa(J(e.text));return t?Z(`say`,`${n}*${X(t)}*`):null}case`test`:return Number(e.attempt)>0?Z(e.ok?`ok`:`fail`,`${n}${e.ok?`✓`:`✗`} **Test, attempt ${X(J(e.attempt))}:** ${X(J(e.text),240)}`):Z(e.ok?`ok`:`fail`,`${n}${e.ok?`✓`:`✗`} ${X(J(e.text),240)}`);case`plan`:{let t=Array.isArray(e.items)?e.items.map(q):[],r=t.find(e=>e.status===`in_progress`);return Z(`info`,`${n}**Plan:** ${t.filter(e=>e.status===`completed`).length} of ${t.length} done${r?`; now: ${X(J(r.text))}`:``}`)}case`review`:return Z(e.approved?`ok`:`warn`,`${n}**Review, attempt ${X(J(e.attempt))}:** ${e.approved?`approved`:`changes asked`}. ${X(J(e.summary),240)}`);case`attempt`:return Z(`warn`,`${n}**Attempt ${X(J(e.attempt))} of ${X(J(e.max))}:** ${X(J(e.why),240)}`);case`answer`:return Z(`dim`,`${n}Attempt ${X(J(e.attempt))}: ${X(J(e.notes)||`changed ${(Array.isArray(e.changed)?e.changed:[]).map(J).join(`, `)}`,240)}`);case`context`:return e.compacted?Z(`info`,`${n}Context compacted: the conversation was summarised to make room.`):null;default:return null}}function Ja(e,t=``){switch(e.type){case`log`:return Z(e.level===`error`?`fail`:e.level===`warn`?`warn`:`dim`,`${t}${e.level===`warn`||e.level===`error`?`⚠ `:``}${X(J(e.text))}`);case`step`:return Z(`dim`,`${t}**Step ${X(J(e.step))}** · ${e.source===`memory`?`from memory`:X(J(e.category))} · ${Ha(J(e.title)||`untitled`,J(e.url))}`);case`memory`:return Z(`info`,`${t}↻ ${X(J(e.text))}`);case`thought`:return Ka(`think`,`*${X(J(e.text))}*`);case`outcome`:return Ka(e.ok?`ok`:`fail`,`${e.ok?`✓`:`✗`} ${X(J(e.text),300)}`);case`done`:{let n=q(e.result);return Z(n.status===`complete`?`ok`:`fail`,`${t}**${X(J(n.status))}:** ${X(J(n.summary))}`)}case`code`:return qa(e,t);default:return null}}function Ya(e){switch(e.type){case`run-start`:return{tone:`info`,kind:`head`,md:`Browser run: ${X(J(e.goal),200)}${e.url?` · ${Ha(J(e.url).replace(/^https?:\/\//,``),J(e.url))}`:``}`};case`run-event`:return Ja(q(e.event));case`run-done`:{let t=q(e.result),n=!e.error&&(t.outcome===`passed`||!t.outcome&&t.status===`complete`);return Z(n?`ok`:`fail`,`${n?`✓`:`✗`} **Run ${n?`passed`:`failed`}**${Y(e.ms)}: ${X(J(e.error)||J(t.summary))}${e.runDir?` · ${Va(J(e.runDir))}`:``}`)}case`suite-start`:return{tone:`info`,kind:`head`,md:`Suite: ${(Array.isArray(e.cases)?e.cases:[]).length} cases, ${X(J(e.parallel))} at once`};case`suite-event`:{let t=q(e.event);if(t.type===`case-start`)return Z(`info`,`**Case ${Number(t.index)+1} of ${X(J(t.total))}:** ${Ua(t.case)}`);if(t.type===`case-event`)return Ja(q(t.event),`${Va(J(q(t.case).id))} `);if(t.type===`case-done`){let e=q(t.result);return Z(e.status===`passed`?`ok`:`fail`,`${e.status===`passed`?`✓`:`✗`} ${Ua(e.case)}: **${X(J(e.status))}**${Y(e.ms)}${e.summary?`. ${X(J(e.summary),240)}`:``}`)}return t.type===`code-start`?Z(`info`,`${Va(J(q(t.case).id))} writing its test`):t.type===`writeback`?Z(`dim`,`Posted the result back: ${X(JSON.stringify(t.item),240)}`):null}case`suite-done`:{let t=(Array.isArray(q(e.suite).results)?q(e.suite).results:[]).map(q),n=t.filter(e=>e.status===`passed`).length;return Z(n===t.length?`ok`:`fail`,`**Suite: ${n} of ${t.length} passed**${Y(q(e.suite).ms)}`)}case`info`:return Z(e.ok===!1?`fail`:e.ok===!0?`ok`:`info`,X(J(e.text)));case`agent`:return qa(q(q(e.event)),`**Quill:** `);case`code-start`:return{tone:`info`,kind:`head`,md:`Writing a test: ${X(J(e.goal),200)}`};case`code-done`:{let t=J(q(e.result).status);return e.error?Z(`fail`,`✗ **Test not written**${Y(e.ms)}: ${X(J(e.error),240)}`):!t||t===`passed`?Z(`ok`,`✓ **Test written**${Y(e.ms)}`):t===`stopped`?Z(`warn`,`**Test writing stopped**${Y(e.ms)}`):Z(`fail`,`✗ **Test not finished**${Y(e.ms)} (${X(t,40)})`)}case`card`:{let t=q(e.card),n=(Array.isArray(t.body)?t.body:[]).map(J).filter(Boolean);return Z(t.status===`ok`?`ok`:t.status===`fail`?`fail`:`info`,`**${X(J(t.title))}**${t.stats?` · ${X(J(t.stats))}`:``}${n.length?`: ${X(n.join(`; `),300)}`:``}`)}case`report`:return Z(`ok`,`✓ Report saved: ${X(J(e.title))}`);case`call-start`:return Z(`dim`,`→ ${X(J(e.text),240)}`);case`call`:return Z(e.ok===!1?`warn`:`dim`,`${e.ok===!1?`⚠`:`✓`} ${X(J(e.text),240)}`);default:return null}}function Xa(e){let t=J(e.at)||J(e.t),n=null;switch(e.type){case`user`:n=Z(`you`,`**You:** ${X(za(J(e.text)),240)}`);break;case`agent`:n=qa(q(e.event));break;case`tool`:n=Ya(q(e.event));break;case`ask`:n=Z(`you`,`**Asked:** ${X(J(q(e.question).title))}`);break;case`wait`:n=Z(`you`,`**Waiting for you:** ${X(J(e.prompt))}`);break;case`answered`:n=Z(`you`,`**You:** ${e.label===void 0?e.ok?`done, continue`:`cancel`:X(J(e.label))}`);break;case`turn_done`:n=Z(e.outcome===`done`?`ok`:e.outcome===`stopped`?`warn`:`fail`,`**${e.outcome===`done`?`Done`:e.outcome===`stopped`?`Stopped`:e.outcome===`needs_input`?`Needs your input`:`Failed`}**${e.error?`: ${X(J(e.error),300)}`:``}`);break;case`settings`:n=Z(`you`,`**Settings:** browser ${e.headed?`shown`:`headless`}, ${e.writeTests?`passed runs become tests`:`no tests written`}`);break;case`model`:n=Z(`you`,`**Model:** ${X(J(q(e.profile).name),80)}`);break;case`settings_applied`:n=Z(`you`,`**Settings:** carried on with the settings as they are on disk now`);break;case`stderr`:n={tone:`dim`,kind:`out`,md:J(e.text)};break;case`error`:n=Z(`warn`,`⚠ ${X(J(e.message))}`);break;case`fatal`:n=Z(`fail`,`✗ **ForgeQE cannot go on:** ${X(J(e.message))}`);break;case`exit`:n=Z(e.code===0?`dim`:`fail`,`ForgeQE stopped${e.code!==null&&e.code!==void 0?` (exit ${X(J(e.code))})`:``}${e.message?`: ${X(J(e.message))}`:``}`)}return n?{at:t,...n,plain:n.kind===`out`?n.md:Ga(n.md)}:null}function Za(e,t){if(!e||!t)return``;let n=Math.max(0,Math.round((Date.parse(t)-Date.parse(e))/1e3));return Number.isFinite(n)?`+${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`:``}function Qa(e,t,n){let r=n?[`## ${X(n,200)}`,``]:[],i=[],a=()=>{if(!i.length)return;let e=Math.max(2,...i.map(e=>Math.max(0,...(e.match(/`+/g)||[]).map(e=>e.length)))),t="`".repeat(e+1);r.push(``,`${t}text`,...i,t,``),i=[]};for(let n of e){let e=Za(t,n.at),o=e?`\`${e}\``:``;n.kind===`out`?i.push(e?`${e} ${n.md}`:n.md):(a(),n.kind===`head`?r.push(``,`#### ${n.md}${o?` ${o}`:``}`,``):n.kind===`sub`?r.push(` - ${n.md}`):r.push(`- ${o?`${o} `:``}${n.md}`))}return a(),r.join(`
8
- `).replace(/\n{3,}/g,`
9
-
10
- `).trim()+`
11
- `}var $a=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0;function eo(e){let t=Q(e),n=$a(t.input),r=$a(t.output);if(n===void 0||r===void 0)return;let i=$a(t.cached),a=$a(t.ms),o=$a(t.premium);return{input:n,output:r,...i?{cached:i}:{},...a===void 0?{}:{ms:a},...o===void 0?t.copilot===!0?{copilot:!0}:{}:{premium:o}}}var to=e=>{let t=Q(e);return typeof t.input==`number`&&typeof t.output==`number`?{input:t.input,output:t.output,cached:typeof t.cached==`number`?t.cached:void 0}:void 0};function no(e,t){let n=(e?.cached||0)+(t?.cached||0);return{input:(e?.input||0)+(t?.input||0),output:(e?.output||0)+(t?.output||0),...n?{cached:n}:{}}}var Q=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},$=e=>typeof e==`string`?e:e==null?``:String(e),ro=[[/^(product_(knowledge|docs|code|runs?)|services|database_schema)$/,`Product knowledge`],[/^page_memory$/,`Memory`],[/^playbook$/,`Playbook`],[/^(requirements_file|trace_criteria)$/,`Requirements`],[/^read_confluence$/,`Confluence pages`],[/^read_mapping_file$/,`Mapping file`]],io={github:`GitHub`,gitlab:`GitLab`,azure_devops:`Azure DevOps`,atlassian:`Jira`,confluence:`Confluence`,notify:`Notifications`,sentry:`Sentry`,browserstack:`BrowserStack`,testmu:`TestMu`,dataverse:`Dataverse`,aws:`AWS`,azure:`Azure`,gcp:`Google Cloud`,postman:`Postman`},ao=20;function oo(e,t,n){let r=(e,t)=>{t&&e.length<ao&&!e.includes(t)&&e.push(t)},i=t.toLowerCase();if(i===`skill`){let t=(n||``).trim();/^[\w.:-]{1,64}$/.test(t)&&r(e.skills,t);return}let a=i.replace(/^forgeqe_/,``),o=ro.find(([e])=>e.test(a));if(o)return r(e.knowledge,o[1]);if(Object.hasOwn(io,a))return r(e.systems,io[a]);let s=yo.find(([e])=>e.test(a))?.[1];s&&r(e.systems,s)}function so(e,t){let n=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0,r=e.sections??=[];for(let e of Array.isArray(t.sections)?t.sections:[]){let t=$(e).replace(/\s+/g,` `).trim().slice(0,160);t&&r.length<ao&&!r.includes(t)&&r.push(t)}let i=e.text??={sent:0,whole:0};i.sent+=n(t.sent),i.whole+=n(t.whole)}var co=[[/find_test_cases|story_test_cases|check_test_cases|list_sprints/,`Finding test cases`,`searching`],[/environment|logins/,`Preparing the environment`,`handing`],[/run_test_cases|browser_run|suite|run_goal|run_direct/,`Running in the browser`,`browsing`],[/comment_on_pr/,`Commenting on the pull request`,`working`],[/write_back|post_result|post_results|file_bugs|create_bugs/,`Posting the result`,`working`],[/heal_api_contracts/,`Healing the API contracts`,`retrying`],[/run_api_contracts/,`Running the API contracts`,`working`],[/run_api_scenarios/,`Running the API scenarios`,`working`],[/run_api_load/,`Load testing the API`,`working`],[/run_api_security/,`Checking the API's security`,`working`],[/api_find_calls/,`Looking up API calls`,`working`],[/api_delete_set/,`Deleting an API`,`working`],[/api_rename_folder/,`Renaming a folder`,`working`],[/api_move_calls/,`Moving calls`,`working`],[/api_contracts|api_new_set|api_add_calls|api_import_collection/,`Making API contracts`,`working`],[/write_test|heal/,`Writing the test`,`writing`],[/run_tests/,`Running the tests`,`working`],[/^(bash|shell)$/,`Running a command`,`working`],[/read_confluence|read|grep|glob|list|webfetch/,`Reading`,`reading`],[/edit|write|patch/,`Changing the code`,`writing`],[/task/,`Handing work to another agent`,`handing`]],lo=/^(test|attempt|info|review)$/,uo=/run_test_cases|browser_run|run_suite|write_test/,fo=[[/(^|_)skill/,`skill`],[/code_element/,`element`],[/code_outline/,`outline`],[/code_references/,`references`],[/code_impact|(^|_)impact/,`impact`],[/code_find|find_tests/,`find`],[/code_test_file/,`testfile`],[/code_command|code_status|run_tests|bash|shell/,`run`],[/find_test_cases|story_test_cases|check_test_cases|list_sprints/,`cases`],[/environment|logins/,`environment`],[/run_test_cases|browser_run|suite|run_goal|run_direct/,`browser`],[/comment_on_pr|write_back|post_result|post_results|file_bugs|create_bugs/,`post`],[/grep|glob|search/,`search`],[/webfetch|websearch|fetch/,`web`],[/(^|_)list/,`list`],[/read/,`read`],[/edit|write|patch/,`edit`],[/task/,`task`]];function po(e){let t=e.toLowerCase();return fo.find(([e])=>e.test(t))?.[1]??`work`}function mo(e){let t=/^(.*?\(attempt \d+\/\d+\))\s*:\s*([\s\S]+)$/.exec(e)??/^([^:\n]{1,160}?):\s+([\s\S]{40,})$/.exec(e),n=(t?t[1]:e).replace(/\s*\(attempt \d+\/\d+\)$/,``).replace(/(^|\s)(?:[\w.-]+[\\/])+([\w.-]+)/g,`$1$2`);return{summary:n.length>140?`${n.slice(0,139)}…`:n,detail:t?t[2].trim():``}}var ho=[[/find_test_cases|story_test_cases|check_test_cases/,`forgeqe-find`],[/run_test_cases|browser_run|run_goal|run_direct|suite|explore_run/,`engine`],[/write_test/,`forgeqe-test`],[/heal(?!_api_contracts)/,`forgeqe-heal`],[/review_pr|pr_review/,`forgeqe-pr-review`],[/api_plan/,`forgeqe-api-plan`],[/write_api|api_test/,`forgeqe-api`],[/explore_plan|plan_charters/,`forgeqe-explore-plan`],[/defect_rca|root_cause/,`forgeqe-defect-rca`],[/insights|forgeqe_bi|defect_intelligence/,`forgeqe-bi`],[/refine/,`forgeqe-refine`]];function go(e){let t=e.toLowerCase();if(!xo(t))return ho.find(([e])=>e.test(t))?.[1]}var _o=[[/write_api_tests/,`forgeqe-api`,`Write the API tests`],[/(?<!run_)api_scenarios$/,`forgeqe-api-plan`,`Plan the API scenarios`]];function vo(e){let t=e.toLowerCase();if(xo(t))return;let n=_o.find(([e])=>e.test(t));return n?{agent:n[1],task:n[2]}:void 0}var yo=[[/^(azure_devops|ado|azuredevops)_/,`Azure DevOps`],[/^(jira|atlassian)_/,`Jira`],[/^confluence_/,`Confluence`],[/^github_/,`GitHub`],[/^xray_/,`Xray`],[/^testrail_/,`TestRail`],[/^zephyr_/,`Zephyr Scale`],[/^qtest_/,`qTest`]],bo=/(^|_)(create|update|add|delete|remove|post|comment|link|unlink|upload|set|assign|transition|edit|merge|close|reopen|queue|trigger|run|push|move|copy|import|write|publish|approve|vote|lock|unlock)(_|$)/;function xo(e){let t=e.toLowerCase();if(!t.startsWith(`forgeqe_`))return yo.find(([e])=>e.test(t))?.[1]}var So=e=>{let t=Q(e);return typeof t.diff==`string`&&t.diff?{diff:t.diff,added:Number(t.added)||0,removed:Number(t.removed)||0}:void 0},Co=e=>Array.isArray(e)?e.map($).filter(Boolean):[];function wo(e,t,n){let r=$(e.status)||(t?`failed`:``);return{status:r,ok:!t&&/^(passed|pass|written|ok|known_defect)$/i.test(r),...$(e.testFile)?{testFile:$(e.testFile)}:{},...$(e.testName)?{testName:$(e.testName)}:{},...$(e.command)?{command:$(e.command)}:{},...typeof e.attempts==`number`?{attempts:e.attempts}:{},...typeof e.maxAttempts==`number`?{maxAttempts:e.maxAttempts}:{},changed:Co(e.changed),reused:Co(e.reused),...n?{runDir:n}:{},...t?{error:t}:{},...$(e.notes)?{notes:$(e.notes)}:{}}}function To(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=Q(n),r=(typeof n==`string`?n:$(e.label)||$(e.request)).replace(/\s+/g,` `).trim(),i=(typeof n==`string`?n:$(e.request)||$(e.label)).trim();r&&i&&!t.some(e=>e.label.toLowerCase()===r.toLowerCase())&&t.push({label:r.length>60?`${r.slice(0,59)}…`:r,request:i})}return t.slice(0,4)}function Eo(e){let t=e.toLowerCase(),n=xo(t);if(n)return bo.test(t.replace(/^[a-z]+_/,``))?{label:`Updating ${n}`,orb:`working`}:{label:`Reading ${n}`,orb:`reading`};for(let[e,n,r]of co)if(e.test(t))return{label:n,orb:r};let r=t.replace(/^forgeqe_/,``).replace(/[_-]+/g,` `).trim();return{label:r?r[0].toUpperCase()+r.slice(1):`Working`,orb:`working`}}function Do(e,t){return{id:e,user:t,steps:[],parts:[],next:[],asks:[],waits:[],log:[],plan:[],changes:[],tests:[],reports:[],actions:[]}}function Oo(e){let t=Q(e);return[$(t.id),$(t.title)].filter(Boolean).join(`: `)}function ko(e){let t=e.split(`
12
- `)[0].trim(),n=e.includes(`
13
- `)?`${t} …`:t;return n.length>80?`${n.slice(0,79)}…`:n}function Ao(e,t,n){let r=Q(e),i=typeof r.command==`string`?r.command:``;if(!i)return;let a=typeof r.exit==`number`&&Number.isInteger(r.exit)?r.exit:void 0,o=typeof r.output==`string`?r.output:``;return{arg:ko(i),step:{command:i,...o?{output:o}:{},shell:{...a===void 0?{}:{exit:a},...t?n===`running`?{started:t}:{ended:t}:{}}}}}function jo(e){let t=[],n=(e,r,i)=>{for(let a of e){let e=a.handoff?.agent||a.agent||r;if(a.shell&&a.command){let n=a.status===`running`?i?`running`:`stopped`:a.status===`fail`?`fail`:a.status===`ok`?`ok`:`stopped`;t.push({key:a.key,command:a.command,status:n,...a.shell.exit===void 0?{}:{exit:a.shell.exit},...e?{agent:e}:{},...a.shell.started?{started:a.shell.started}:{},...a.shell.ended?{ended:a.shell.ended}:{}})}a.children&&n(a.children,e,i)}};for(let t of e.turns)n(t.steps,void 0,!t.outcome&&!e.ended);return t}function Mo(e){let t={turns:[],notes:[]},n=new Map,r=e=>(typeof e==`string`?n.get(e):void 0)??t.turns.at(-1),i=(e,t)=>{let n=e=>{for(let r of e){if(r.key===t)return r;let e=r.children&&n(r.children);if(e)return e}};return n(e.steps)},a=(e,t,n)=>{let r={lines:[],...t};if(n)n.push(r);else{let t=e.plan.find(e=>e.status===`active`)??e.plan.find(e=>e.status===`pending`)??e.plan.at(-1);t&&(r.phase=t.text),e.steps.push(r)}return r},o=(e,t,n)=>{let r=t.parent?i(e,`c:${$(t.parent)}`):void 0;if(r)return r.children??=[];let o=$(t.agent);if(!o&&lo.test($(t.kind))){let t=e.steps.findLast(e=>e.status===`running`&&!!e.agent&&e.agent!==`forgeqe`);return t?s(t):void 0}if(!n||!o||o===`forgeqe`)return;let c=e.steps.findLast(e=>e.status===`running`);return c||=a(e,{key:`ag:${o}:${e.steps.length}`,label:E(o).name,status:`running`,orb:`handing`,agent:o}),c.agent??=o,s(c)},s=e=>{let t=e.children??=[],n=t.at(-1);return n&&n.key.startsWith(`try:`)&&n.status===`running`?n.children??=[]:t},c=(e,t)=>{let n=e?.children?.at(-1);if(!n||!n.key.startsWith(`try:`)||n.status!==`running`)return;let r=[...n.children||[]].reverse().find(e=>e.key.startsWith(`t:`)||!!e.review),i=t??(r?r.review?r.review.approved:r.status===`ok`:void 0);n.status=i===void 0?`info`:i?`ok`:`fail`},l,u=new Map,d=new Map,f=0,p=e=>{let n=t.agents??=[],r=n.find(t=>t.agent===e);return r||n.push(r={agent:e,usage:{input:0,output:0},at:0}),r.at=++f,r},m=(e,n,r,s)=>{let f=$(n.kind),m=$(n.id);if(f===`output`){let t=m?i(e,`c:${m}`):void 0;t?.shell&&t.status===`running`&&typeof n.text==`string`&&n.text&&(t.output=n.text);return}if((f===`start`||f===`tool`)&&uo.test($(n.tool))&&!xo($(n.tool)))return;let h=o(e,n,r),g=Q(n.delegate),_=$(n.tool)||$(n.text),v=$(g.agent)?{agent:$(g.agent),task:$(g.task)}:!r&&!h?vo($(n.tool)):void 0;if(f===`start`){if(v)a(e,{key:`c:${m}`,label:`Hands off to ${jt(E(v.agent).name)}`,arg:v.task||void 0,status:`running`,orb:`handing`,agent:v.agent,handoff:v,children:[]},h);else{let{label:t,orb:r}=Eo(_),i=h?void 0:go($(n.tool)),o=Ao(n.shell,s,`running`);a(e,{key:`c:${m}`,label:t,arg:o?o.arg:$(n.text)&&$(n.text)!==$(n.tool)?$(n.text):void 0,status:`running`,orb:r,icon:po(_),...i?{agent:i}:{},...o?o.step:{}},h)}}else if(f===`tool`){n.ok!==!1&&$(n.tool)&&oo(t.uses??={skills:[],knowledge:[],systems:[]},$(n.tool),$(n.skill));let r=m?i(e,`c:${m}`):void 0,o=Q(n.file),c=So(n.change);if(c&&$(o.path)){let t=e.changes.find(e=>e.path===$(o.path));t?Object.assign(t,{diff:`${t.diff}\n${c.diff}`,added:t.added+c.added,removed:t.removed+c.removed}):e.changes.push({path:$(o.path),...c,...$(n.agent)?{agent:$(n.agent)}:{}})}let l=Ao(n.shell,s,`ended`);if(r)r.status=n.ok===!1?`fail`:`ok`,r.handoff&&$(g.result)&&(r.handoff.result=$(g.result)),l&&(r.command=l.step.command,r.shell={...r.shell,...l.step.shell},l.step.output?r.output=l.step.output:delete r.output);else if(v)a(e,{key:`c:${m||e.steps.length}`,label:`Hands off to ${jt(E(v.agent).name)}`,arg:v.task||void 0,status:n.ok===!1?`fail`:`ok`,orb:`handing`,agent:v.agent,handoff:{...v,...$(g.result)?{result:$(g.result)}:{}},children:[]},h);else{let{label:t,orb:r}=Eo(_),i=h?void 0:go($(n.tool));a(e,{key:`c:${m||e.steps.length}`,label:t,arg:l?l.arg:$(o.path)||$(n.text)||void 0,status:n.ok===!1?`fail`:`ok`,orb:r,icon:po(_),...i?{agent:i}:{},...c?{change:c}:{},...l?l.step:{}},h)}r&&c&&(r.change=c)}else if(f===`stream`||f===`say`){if(r)return;let t=e.parts.find(e=>e.id===m);t?t.text=f===`say`?$(n.text):t.text+$(n.text):e.parts.push({id:m||`p${e.parts.length}`,text:$(n.text)})}else if(f===`plan`){if(h||n.agent&&n.agent!==`forgeqe`)return;let t=Array.isArray(n.items)?n.items.map(Q):[],r=e=>e===`completed`?`done`:e===`in_progress`?`active`:e===`cancelled`?`skipped`:`pending`;e.plan=t.map(e=>({text:$(e.text),status:r(e.status)})).filter(e=>e.text)}else if(f===`test`){let t=Number(n.attempt)||0;if(t>0){let{summary:r,detail:i}=mo($(n.text));a(e,{key:`t:${t}:${e.steps.length}`,label:`Test, attempt ${t}`,arg:r||void 0,status:n.ok?`ok`:`fail`,orb:`retrying`,icon:`test`,...i?{output:i}:{},...l?{command:l}:{}},h),l=void 0}else if(n.ok&&/\bconnected$/i.test($(n.text)))return;else a(e,{key:`t:${e.steps.length}`,label:$(n.text)||(n.ok?`Checked`:`Check failed`),status:n.ok?`ok`:`fail`,orb:/connect|mcp/i.test($(n.text))?`waiting`:`working`},h)}else if(f===`attempt`){let t=e.steps.findLast(e=>e.status===`running`&&!!e.agent&&e.agent!==`forgeqe`);if(!t)return;c(t);let r=$(n.fixing)||$(n.why);(t.children??=[]).push({key:`try:${$(n.attempt)}:${t.children.length}`,label:`Attempt ${$(n.attempt)} of ${$(n.max)}`,arg:r?r.length>120?`${r.slice(0,119)}…`:r:void 0,status:`running`,orb:`retrying`,icon:`retry`,lines:r.length>120?[{text:r}]:[],children:[]})}else if(f===`review`){let t=(Array.isArray(n.issues)?n.issues:[]).map(Q).map(e=>({kind:$(e.kind)===`standards`?`standards`:`correctness`,...$(e.file)?{file:$(e.file)}:{},problem:$(e.problem),...$(e.fix)?{fix:$(e.fix)}:{}})).filter(e=>e.problem).slice(0,20),r=n.approved===!0,i=(h??e.steps).length;a(e,{key:`r:${$(n.attempt)}:${i}`,label:r?`Review approved`:`Review asked for changes`,arg:t.length?`${t.length} ${t.length===1?`issue`:`issues`}`:void 0,status:r?`ok`:`fail`,orb:`thinking`,agent:`forgeqe-review`,icon:`review`,review:{approved:r,summary:$(n.summary),issues:t}},h)}else if(f===`context`||f===`usage`){let e=$(n.agent)||`forgeqe`,r=p(e);f===`context`&&typeof n.tokens==`number`&&typeof n.limit==`number`&&(r.context={tokens:n.tokens,limit:n.limit,compactsAt:typeof n.compactsAt==`number`?n.compactsAt:void 0},e===`forgeqe`&&(t.context=r.context));let i=f===`usage`?to(n.usage):void 0;if(i){let n=u.get(e);n&&(i.input<n.input||i.output<n.output)&&d.set(e,no(d.get(e),n)),u.set(e,i),r.usage=no(d.get(e),i),t.usage=(t.agents||[]).reduce((e,t)=>no(e,t.usage),void 0)}}else if(f===`info`){let t=(h??e.steps).at(-1),r=/^ForgeQE runs the test:\s*([\s\S]+)$/.exec($(n.text));r?l=r[1].trim():t&&t.lines.push({text:$(n.text)})}},h,g=(e,n,r)=>{let o=$(n.type);if(o===`docs`)return so(t.uses??={skills:[],knowledge:[],systems:[]},n);if(o===`ui-action`){let t=Xn(n);t&&!e.actions.some(e=>e.id===t.id)&&e.actions.push(t)}else if(o===`run-start`)a(e,{key:`run:${e.steps.length}`,label:`Running in the browser`,arg:$(n.goal),status:`running`,orb:`browsing`,agent:`engine`});else if(o===`run-event`){let t=e.steps.findLast(e=>e.key.startsWith(`run:`)),r=Q(n.event);if(!t)return;r.type===`outcome`?t.lines.push({text:`Step ${$(r.step)}: ${$(r.action)||$(r.text)}`,ok:r.ok===!0||r.ok!==!1&&void 0}):r.type===`log`&&(r.level!==`info`||r.progress)&&t.lines.push({text:$(r.text),ok:r.level!==`error`&&void 0})}else if(o===`run-done`){let t=e.steps.findLast(e=>e.key.startsWith(`run:`)&&e.status===`running`),r=Q(n.result),i=!n.error&&(r.outcome===`passed`||!r.outcome&&r.status===`complete`);if(t){t.status=i?`ok`:`fail`;let e=$(n.error)||$(r.summary);e&&t.lines.push({text:e,ok:!!i})}$(n.runDir)&&e.reports.push({label:i?`Browser run report`:`Browser run report (failed)`,path:$(n.runDir)})}else if(o===`suite-start`){let t=Array.isArray(n.cases)?n.cases:[];a(e,{key:`suite:${e.steps.length}`,label:`Running ${t.length} test case${t.length===1?``:`s`}`,status:`running`,orb:`working`,agent:`engine`})}else if(o===`suite-event`){let t=e.steps.findLast(e=>e.key.startsWith(`suite:`)),r=Q(n.event);if(t&&r.type===`case-done`){let e=Q(r.result);t.lines.push({text:`${Oo(e.case)}: ${$(e.status)}`,ok:e.status===`passed`})}}else if(o===`suite-done`){let t=e.steps.findLast(e=>e.key.startsWith(`suite:`)),r=Array.isArray(Q(n.suite).results)?Q(n.suite).results.map(Q):[];if(t){let e=r.filter(e=>e.status!==`passed`).length;t.status=e?`fail`:`ok`,t.arg=`${r.length-e} of ${r.length} passed`}}else if(o===`card`){let t=Q(n.card);a(e,{key:`card:${e.steps.length}`,label:$(t.title),arg:$(t.stats)||void 0,status:t.status===`ok`?`ok`:t.status===`fail`?`fail`:`info`,orb:`working`,lines:(Array.isArray(t.body)?t.body:[]).map(e=>({text:$(e)}))})}else if(o===`call-start`&&!n.quiet)a(e,{key:`call:${$(n.id)}`,label:$(n.text),status:`running`,orb:`working`});else if(o===`call`&&!n.quiet){let t=n.id?i(e,`call:${$(n.id)}`):void 0;t?t.status=n.ok===!1?`fail`:`ok`:a(e,{key:`call:${e.steps.length}`,label:$(n.text),status:n.ok===!1?`fail`:`ok`,orb:`working`})}else if(o===`code-start`)h=$(n.runDir)||void 0,a(e,{key:`code:${e.steps.length}`,label:`Hands off to Quill`,arg:$(n.goal),status:`running`,orb:`writing`,agent:`forgeqe-test`,handoff:{agent:`forgeqe-test`,task:$(n.goal)},children:[]});else if(o===`code-done`){let t=e.steps.findLast(e=>e.key.startsWith(`code:`)&&e.status===`running`);c(t),t&&(t.status=n.error?`fail`:`ok`,n.error&&t.lines.push({text:$(n.error),ok:!1}));let r=[],i=(e=[])=>e.forEach(e=>(r.push(e),i(e.children)));i(t?.children);let a=r.filter(e=>e.key.startsWith(`t:`)),o=r.filter(e=>e.review);e.tests.push({...wo(Q(n.result),$(n.error),h),...t?{runs:a.length,failedRuns:a.filter(e=>e.status===`fail`).length,reviews:o.length}:{},...o.length?{review:o.at(-1).review}:{}}),h=void 0}else if(o===`agent`)m(e,Q(n.event),!0,r);else if(o===`info`){let t=e.steps.at(-1);t?t.lines.push({text:$(n.text),ok:n.ok===!0||n.ok!==!1&&void 0}):a(e,{key:`info:${e.steps.length}`,label:$(n.text),status:n.ok===!1?`fail`:`info`,orb:`working`})}else o===`report`&&(a(e,{key:`report:${e.steps.length}`,label:`Report saved`,arg:$(n.title),status:`ok`,orb:`working`}),$(n.html)&&e.reports.push({label:$(n.title)||`Report`,path:$(n.html)}))};for(let r of e){_(r);let e=Xa(r);e&&(typeof r.id==`string`&&n.get(r.id)||typeof r.turn==`string`&&n.get(r.turn)||t.turns.at(-1))?.log.push(e)}return t;function _(e){switch(e.type){case`user`:{let r=Do($(e.id),za($(e.text)));t.turns.push(r),n.set(r.id,r);break}case`ready`:{t.ended=void 0,t.fatal=void 0;let n=Q(e.profile);n.name&&(t.model={name:$(n.name),provider:$(n.provider)}),t.writeTests=e.writeTests!==!1,t.headed=e.headed===!0;break}case`models`:case`model`:{let n=Q(e.profile);n.name&&(t.model={name:$(n.name),provider:$(n.provider)}),e.type===`models`&&Array.isArray(e.models)&&(t.models=e.models.map(e=>({name:$(Q(e).name),provider:$(Q(e).provider)})).filter(e=>e.name));break}case`settings`:typeof e.writeTests==`boolean`&&(t.writeTests=e.writeTests),typeof e.headed==`boolean`&&(t.headed=e.headed);break;case`turn_start`:{let t=r(e.id);t&&(t.started=$(e.t)||$(e.at));break}case`agent`:{let t=r(e.id);t&&m(t,Q(e.event),!1,$(e.t)||void 0);break}case`tool`:{let t=r(e.id);t&&g(t,Q(e.event),$(e.t)||void 0);break}case`ask`:{let t=r(e.turn),n=Q(e.question);t?.asks.push({id:$(e.id),title:$(n.title),detail:$(n.detail)||void 0,lines:Array.isArray(n.lines)?n.lines.map($):[],options:(Array.isArray(n.options)?n.options:[]).map(e=>({id:$(Q(e).id),label:$(Q(e).label)}))});break}case`wait`:r(e.turn)?.waits.push({id:$(e.id),prompt:$(e.prompt)});break;case`answered`:for(let n of t.turns){let t=n.asks.find(t=>t.id===e.ask);t&&(t.answer=$(e.label));let r=n.waits.find(t=>t.id===e.ask);r&&(r.answer=e.ok===!0)}break;case`turn_done`:{let n=r(e.id);if(!n)break;n.outcome=e.outcome,n.reply=$(e.reply),n.next=To(e.next),n.error=$(e.error)||void 0,n.ended=$(e.t)||$(e.at),n.spent=eo(e.spent),t.agents?.length||(t.usage=to(e.usage)??t.usage);let i=e=>{for(let t of e)t.status===`running`&&(t.status=n.outcome===`done`?`ok`:`info`),t.children&&i(t.children)};if(i(n.steps),n.outcome===`done`)for(let e of n.plan)e.status===`active`&&(e.status=`done`);break}case`error`:e.code!==`busy`&&t.notes.push($(e.message));break;case`fatal`:t.fatal=$(e.message);break;case`exit`:t.ended={code:typeof e.code==`number`?e.code:null,stderr:Array.isArray(e.stderr)?e.stderr.map($):void 0,message:$(e.message)||void 0}}}}function No(e){let t=e.asks.find(e=>e.answer===void 0),n=e.waits.find(e=>e.answer===void 0);if(t||n)return{text:`Waiting for you…`,orb:`waiting`};let r=e.steps.findLast(e=>e.status===`running`);return r?{text:`${r.label}…`,orb:r.orb}:e.parts.some(e=>e.text.trim())&&e.steps.length?{text:`Writing a reply…`,orb:`writing`}:{text:`Thinking…`,orb:`thinking`}}function Po(e){if(!e.started||!e.ended)return`Done`;let t=Math.max(1,Math.round((Date.parse(e.ended)-Date.parse(e.started))/1e3)),n=e.outcome===`stopped`?`Stopped after`:`Worked for`;return t<60?`${n} ${t} second${t===1?``:`s`}`:`${n} ${Math.floor(t/60)} min ${t%60} s`}function Fo(e){let t=Math.max(0,Math.round(e));for(let[e,n]of[[1e9,`B`],[1e6,`M`],[1e3,`K`]])if(t>=e*.99995)return`${(t/e).toFixed(1)}${n}`;return String(t)}function Io(e){if(e===0)return`included in your plan`;let t=Number(e.toFixed(2));return`${t} premium request${t===1?``:`s`}`}function Lo(e){if(e<6e4)return`${(Math.max(0,e)/1e3).toFixed(1)}s`;let t=Math.round(e/1e3);return t<3600?`${Math.floor(t/60)}m ${String(t%60).padStart(2,`0`)}s`:`${Math.floor(t/3600)}h ${String(Math.floor(t%3600/60)).padStart(2,`0`)}m`}function Ro(e,t){let n=e?Date.parse(e):NaN;if(Number.isNaN(n))return``;let r=Math.max(0,Math.floor((t-n)/1e3)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=String(r%60).padStart(2,`0`);return i?`${i}:${String(a).padStart(2,`0`)}:${o}`:`${a}:${o}`}var zo={running:`active`,ok:`done`,fail:`failed`,info:`note`};function Bo(e,t){let n=e=>e===`active`&&!t?`done`:e;if(!e.plan.length)return e.steps.map(e=>({key:e.key,label:e.label,status:n(zo[e.status]),steps:[],step:e}));let r=new Set(e.plan.map(e=>e.text)),i=new Map,a=``;for(let t of e.steps)t.phase&&r.has(t.phase)&&(a=t.phase),i.set(a,[...i.get(a)||[],t]);let o=e=>e.some(e=>e.status===`running`),s=[],c=i.get(``)||[];c.length&&s.push({key:`plan:start`,label:`Getting started`,status:n(o(c)?`active`:`done`),steps:c});let l=e.plan.map((e,n)=>{let r=i.get(e.text)||[],a=e.status===`done`?`done`:e.status===`skipped`?`skipped`:e.status===`active`||o(r)?`active`:`pending`;return{key:`plan:${n}`,label:e.text,status:a===`active`&&!t?`pending`:a,steps:r}});return[...s,...Vo(l)]}function Vo(e){let t=e.findIndex(e=>e.status===`active`);return t<0?e:e.map((e,n)=>e.status===`skipped`||e.status===`failed`||n===t?e:{...e,status:n<t?`done`:`pending`})}function Ho(e){let t=e.filter(e=>e.status===`running`).reverse(),n=e.filter(e=>e.status!==`running`).reverse();return[...t,...n].slice(0,Math.max(8,t.length))}var Uo=`forgeqe-sidebar-panels`;function Wo(e,t){let[n,r]=(0,N.useState)(()=>{try{return JSON.parse(localStorage.getItem(Uo)||`{}`)[e]??t}catch{return t}});return[n,()=>{r(!n);try{let t=JSON.parse(localStorage.getItem(Uo)||`{}`);localStorage.setItem(Uo,JSON.stringify({...t,[e]:!n}))}catch{}}]}function Go({id:e,title:t,children:n,initial:i=!0}){let[a,o]=Wo(e,i);return(0,P.jsxs)(`section`,{"aria-labelledby":`panel-${e}`,className:`flex flex-col pt-1`,children:[(0,P.jsx)(`h3`,{id:`panel-${e}`,className:`m-0`,children:(0,P.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:o,className:`flex min-h-8 w-full cursor-pointer items-center gap-1 rounded-[8px] border-0 bg-transparent px-2 text-left text-[13px] font-semibold text-ink hover:bg-surface-muted`,children:[(0,P.jsx)(`span`,{className:`flex-1`,children:t}),(0,P.jsx)(r,{size:14,"aria-hidden":`true`,className:D(`text-muted transition-transform`,!a&&`-rotate-90`)})]})}),(0,P.jsx)(F,{open:a,className:`flex flex-col pt-1 pb-1`,children:n})]})}function Ko({icon:e,label:t,value:n,to:r,title:i}){let a=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(j,{icon:e,size:14,className:`flex-none`}),(0,P.jsx)(`span`,{className:`max-w-[120px] flex-none truncate text-[13px] text-muted`,children:t}),(0,P.jsx)(`span`,{className:`line-clamp-2 min-w-0 flex-1 text-right text-[13px] leading-snug [overflow-wrap:anywhere] text-ink`,children:n})]}),o=`flex min-h-7 items-center gap-2 rounded-[8px] px-2 py-1 no-underline`;return r?(0,P.jsx)(`a`,{href:r,"data-tip":i,className:D(o,`hover:bg-surface-muted`),children:a}):(0,P.jsx)(`div`,{"data-tip":i,className:o,children:a})}function qo({icon:e,label:t,value:n,detail:r,to:i,title:a,onClick:o,open:s,muted:c}){let l=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(j,{icon:e,size:16,className:`mt-1 flex-none text-muted`}),(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,P.jsx)(`span`,{className:`text-[13px] leading-tight text-muted`,children:t}),(0,P.jsx)(`span`,{className:D(`line-clamp-2 text-[13px] leading-snug font-medium [overflow-wrap:anywhere]`,c?`text-muted`:`text-ink`),children:n}),r&&(0,P.jsx)(`span`,{className:`truncate text-[13px] leading-snug text-muted`,children:r})]}),(i||o)&&(0,P.jsx)(S,{size:14,"aria-hidden":`true`,className:D(`mt-1 flex-none text-muted opacity-0 transition-[opacity,transform] group-hover:opacity-100 group-focus-visible:opacity-100`,s&&`rotate-90 opacity-100`)})]}),u=`group flex w-full items-start gap-4 rounded-[10px] px-2 py-2 text-left no-underline`;return o?(0,P.jsx)(`button`,{type:`button`,"aria-expanded":s,"data-tip":a,onClick:o,className:D(u,`cursor-pointer border-0 bg-transparent hover:bg-surface-muted`),children:l}):i?(0,P.jsx)(`a`,{href:i,"data-tip":a,className:D(u,`hover:bg-surface-muted`),children:l}):(0,P.jsx)(`div`,{"data-tip":a,className:u,children:l})}function Jo({title:e,children:t}){return(0,P.jsxs)(`div`,{className:`flex flex-col`,children:[(0,P.jsx)(`span`,{className:`px-2 pt-2 pb-1 text-[13px] font-medium tracking-wide text-muted uppercase`,children:e}),t]})}var Yo=e=>`Tokens used, added up over every model call: ${ha(e)}. Each call reads the conversation so far again, so this grows past the context window.`,Xo=`How much of the model's context window the conversation fills now. It drops when the conversation is compacted.`;function Zo({a:e,working:t}){let n=E(e.agent);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-[8px] px-2 py-1`,children:[(0,P.jsxs)(`span`,{className:`flex min-h-6 items-center gap-2`,"data-tip":Yo(e.usage),children:[(0,P.jsx)(pn,{agent:e.agent,px:16,decorative:!0,working:t}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] text-ink`,children:n.name}),(0,P.jsxs)(`span`,{className:`flex-none text-[13px] text-ink tabular-nums`,children:[V(e.usage.input+e.usage.output),` `,(0,P.jsx)(`span`,{className:`text-muted`,children:`used`})]})]}),e.context&&e.context.limit>0&&(0,P.jsxs)(`span`,{className:`flex flex-col pl-6`,"data-tip":Xo,children:[(0,P.jsxs)(`span`,{className:`flex items-baseline gap-2 text-[13px] text-muted`,children:[(0,P.jsxs)(`span`,{className:`flex-1`,children:[`Context `,Math.round(Math.min(1,e.context.tokens/e.context.limit)*100),`% full`]}),(0,P.jsxs)(`span`,{className:`tabular-nums`,children:[V(e.context.tokens),` of `,V(e.context.limit)]})]}),(0,P.jsx)(Qo,{value:e.context.tokens,max:e.context.limit,warnAt:e.context.compactsAt})]})]})}function Qo({value:e,max:t,warnAt:n}){let r=t>0?Math.min(1,e/t):0,i=n?e>=n*.9:r>.75;return(0,P.jsx)(`span`,{role:`meter`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-label":`Context used`,className:`mt-1 block h-1.5 w-full overflow-hidden rounded-full bg-line`,children:(0,P.jsx)(`span`,{className:D(`block h-full rounded-full transition-[width] duration-200 ease-out`,i?`bg-warn`:`bg-accent`),style:{width:`${Math.max(2,r*100)}%`}})})}var $o=e=>{try{return e?new URL(e).host:``}catch{return``}},es=e=>e.split(/[\\/]/).filter(Boolean).pop()||e;function ts({path:e,icon:t,extra:n}){let[r,i]=(0,N.useState)(``);return(0,P.jsxs)(`li`,{className:`flex flex-col`,children:[(0,P.jsxs)(`button`,{type:`button`,"data-tip":`Open ${e}`,onClick:async()=>i(await Jt(e)),className:`flex min-h-8 w-full cursor-pointer items-center gap-2 rounded-[10px] border-0 bg-transparent px-4 text-left hover:bg-surface-muted`,children:[(0,P.jsx)(j,{icon:t,size:15,className:`flex-none text-muted`}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[13px] text-accent-fg`,children:es(e)}),n]}),r&&(0,P.jsx)(`span`,{className:`px-4 text-[13px] text-fail`,children:r})]})}function ns(e,t){let n=e?Date.parse(e):NaN,r=t?Date.parse(t):NaN;if(Number.isNaN(n)||Number.isNaN(r))return``;let i=Math.max(0,Math.round((r-n)/1e3));return i<60?`${i}s`:`${Math.floor(i/60)} min`}function rs({c:e}){let t=e.status===`running`?is(e.started):ns(e.started,e.ended),n=e.status===`running`?`Running`:e.status===`ok`?`Done`:e.status===`stopped`?`Stopped`:e.exit===void 0?`Failed`:`Exit code ${e.exit}`;return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`div`,{tabIndex:0,"data-tip":e.command,"aria-label":`${e.command}. ${n}${t?`, ${t}`:``}`,className:`flex items-start gap-2 rounded-[10px] px-4 py-2 hover:bg-surface-muted`,children:[e.status===`running`?(0,P.jsx)(pt,{size:15,"aria-hidden":`true`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,P.jsx)(j,{icon:e.status===`ok`?_:h,size:15,className:D(`mt-1 flex-none`,e.status===`ok`?`text-pass`:e.status===`fail`?`text-fail`:`text-muted`)}),(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono text-[13px] text-ink`,children:ko(e.command)}),(0,P.jsx)(`span`,{className:`text-[13px] text-muted`,children:[e.agent?E(e.agent).name:``,n,t].filter(Boolean).join(` · `)})]})]})})}function is(e){let t=e?Date.parse(e):NaN;if(Number.isNaN(t))return``;let n=Math.max(0,Math.round((Date.now()-t)/1e3));return n<60?`${n}s`:`${Math.floor(n/60)} min`}function as({chat:e}){let[t,n]=(0,N.useState)(null),[r,i]=(0,N.useState)(null),[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)([]);(0,N.useEffect)(()=>{let e=!1,t=()=>Ht.list().then(t=>!e&&d(t.tasks),()=>{});t();let n=Cn(t,4e3);return()=>{e=!0,wn(n)}},[]);let p=location.hash.replace(/^#\/?/,``),m=e?.commands??[],h=Ho(m),g=u.filter(e=>e.to!==p);(0,N.useEffect)(()=>{let e=!1,t=()=>Ft.state().then(t=>{if(!e){if(n(t),!t.ready)return i(null);Lt.get().then(t=>!e&&i(t),()=>{})}},()=>{});return t(),window.addEventListener(`hashchange`,t),()=>{e=!0,window.removeEventListener(`hashchange`,t)}},[]),(0,N.useEffect)(()=>{if(!t?.ready)return;let n=!1,r=()=>O.tokenomics().then(e=>!n&&s(e),()=>{});r();let i=Cn(r,e?.busy?3e4:18e4);return()=>{n=!0,wn(i)}},[t?.ready,t?.project,e?.busy]);let _=t?t.project.split(/[\\/]/).filter(Boolean).pop()||t.project:``,v=r?.codeRepo||r?.repo,y=o?.days.find(e=>e.day===new Date().toISOString().slice(0,10)),b=r?.environment,x=(e,t)=>`${V(e.input+e.output)} tokens${t&&e.amount?` · ${U(e.amount,t)}`:``}`,S=o?.project?x(o.project.today,o.project.currency):y?x(y,o?.currency):void 0,C=o?o.project?{tokens:o.project.days30.input+o.project.days30.output,cost:o.project.currency&&o.project.days30.amount?U(o.project.days30.amount,o.project.currency):void 0,title:`Every model call made for this project in the last 30 days.`}:{tokens:o.totals.input+o.totals.output,cost:o.currency&&o.totals.amount?U(o.totals.amount,o.currency):void 0,title:`Test runs of this project in the last 30 days.`}:void 0;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,P.jsx)(Go,{id:`env`,title:`Environment`,initial:!1,children:(0,P.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,P.jsx)(qo,{icon:f,label:`Project`,value:t?.ready?_:`Not set up`,muted:!t?.ready,to:T(`settings`,`setup`),title:t?.project}),r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(qo,{icon:oe,label:r.codeRepo?`Tests go to`:`Repository`,value:v?v.name:`Not a git repository`,muted:!v,detail:v?.branch?`Branch ${v.branch}`:v?.commit?`Commit ${v.commit}`:void 0,title:v?`${v.root}${v.commit?` @ ${v.commit}`:``}`:void 0,to:T(`settings`,`tests`)}),(0,P.jsx)(qo,{icon:Ie,label:`Test environment`,value:b?.active?b.active:b?.names.length?`None active`:`None yet`,muted:!b?.active,detail:b?.active&&$o(b.startUrl)||void 0,title:b?.names.length?`${b.names.length} environment${b.names.length===1?``:`s`}: ${b.names.join(`, `)}${b.apps.length?`. Apps: ${b.apps.join(`, `)}`:``}`:void 0,to:T(`settings`,`environments`)}),(0,P.jsx)(qo,{icon:$e,label:`Files`,value:`${r.files.filter(e=>e.exists).length} in this project`,onClick:()=>l(!c),open:c}),(0,P.jsx)(F,{open:c,children:(0,P.jsx)(`ul`,{className:`m-0 mb-1 ml-10 flex list-none flex-col gap-1 p-0`,children:r.files.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`a`,{href:T(`settings`,`files`),"data-tip":e.path,className:D(`flex flex-col rounded-md px-2 py-1 no-underline hover:bg-surface-muted`,!e.exists&&`opacity-60`),children:[(0,P.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.label}),(0,P.jsx)(`span`,{className:`truncate font-mono text-[13px] text-ink`,children:e.path})]})},e.label))})})]})]})}),t?.ready&&(0,P.jsxs)(Go,{id:`usage`,title:`Context and tokens`,children:[e&&(0,P.jsx)(Jo,{title:`This chat`,children:e.agents?.length&&e.usage?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`flex min-h-7 items-center gap-2 px-2 py-1`,"data-tip":Yo(e.usage),children:[(0,P.jsx)(j,{icon:Ce,size:14,className:`flex-none`}),(0,P.jsx)(`span`,{className:`flex-1 text-[13px] text-muted`,children:`Tokens used, all agents`}),(0,P.jsx)(`span`,{className:`text-[13px] font-medium text-ink tabular-nums`,children:V(e.usage.input+e.usage.output)})]}),(0,P.jsx)(`span`,{className:`px-2 pb-1 pl-8 text-[13px] text-muted tabular-nums`,children:ha(e.usage)}),e.agents.toSorted((e,t)=>t.at-e.at).map((t,n)=>(0,P.jsx)(Zo,{a:t,working:!!e.busy&&n===0},t.agent))]}):(0,P.jsx)(`p`,{className:`m-0 px-2 py-1 text-[13px] text-muted`,children:e.busy?`Counted as soon as the agent's first model call comes back.`:`No model calls in this chat yet.`})}),(0,P.jsxs)(Jo,{title:`This project`,children:[C&&(0,P.jsxs)(`a`,{href:T(`settings`,`tokenomics`),"data-tip":C.title,className:`my-1 flex items-center gap-4 rounded-[10px] px-2 py-2 no-underline hover:bg-surface-muted`,children:[(0,P.jsx)(`span`,{className:`flex size-11 flex-none items-center justify-center rounded-full border-[3px] border-accent-line bg-accent-soft text-accent-fg`,children:(0,P.jsx)(Fe,{size:20,strokeWidth:1.8,"aria-hidden":`true`})}),(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,P.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[(0,P.jsx)(`span`,{className:`text-[20px] leading-tight font-semibold tracking-[-0.01em] text-ink tabular-nums`,children:V(C.tokens)}),` tokens`]}),(0,P.jsx)(`span`,{className:`text-[13px] text-muted`,children:C.cost?`${C.cost} · last 30 days`:`Last 30 days`})]})]}),(0,P.jsx)(Ko,{icon:gt,label:`Today`,value:(0,P.jsx)(`span`,{className:`tabular-nums`,children:S??`Nothing yet`}),title:o?.project?`Every model call made for this project today: chats, runs and the agents they started.`:`Test runs of this project today.`,to:T(`settings`,`tokenomics`)}),o?.spent&&o.budget?.month?(0,P.jsxs)(`div`,{className:`px-2 py-2`,children:[(0,P.jsxs)(`span`,{className:`flex items-baseline gap-2 text-[13px] text-muted`,children:[(0,P.jsx)(`span`,{className:`flex-1`,children:`This month, this computer`}),(0,P.jsxs)(`span`,{className:`text-ink tabular-nums`,children:[U(o.spent.month,o.spent.currency),` of `,U(o.budget.month,o.budget.currency||o.spent.currency)]})]}),(0,P.jsx)(Qo,{value:o.spent.month,max:o.budget.month})]}):null]})]}),g.length>0&&(0,P.jsx)(Go,{id:`background`,title:`Background tasks · ${g.length}`,children:(0,P.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:g.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`a`,{href:T(...e.to.split(`/`).filter(Boolean)),className:`flex items-start gap-2 rounded-[10px] px-4 py-2 no-underline hover:bg-surface-muted`,children:[(0,P.jsx)(pt,{size:15,"aria-hidden":`true`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}),(0,P.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`span`,{className:`truncate text-[13px] text-ink`,children:e.label}),(0,P.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.detail||`Running`,is(e.startedAt)&&` · ${is(e.startedAt)}`]})]})]})},`${e.kind}-${t}`))})}),m.length>0&&(0,P.jsxs)(Go,{id:`commands`,title:`Commands · ${m.length}`,children:[(0,P.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:h.map(e=>(0,P.jsx)(rs,{c:e},e.key))}),m.length>h.length&&(0,P.jsxs)(`span`,{className:`px-4 pb-1 text-[13px] text-muted`,children:[zt(m.length-h.length,`earlier command`),` in the chat`]})]}),e?.changes&&e.changes.length>0&&(0,P.jsxs)(Go,{id:`changes`,title:`Changes · ${e.changes.length}`,children:[(0,P.jsxs)(`span`,{className:`px-4 pb-1 font-mono text-[13px] tabular-nums`,children:[zt(e.changes.length,`file`),` · `,(0,P.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,P.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]}),(0,P.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.changes.map(e=>(0,P.jsx)(ts,{path:e.path,icon:ke,extra:(0,P.jsxs)(`span`,{className:`flex-none font-mono text-[13px] tabular-nums`,children:[(0,P.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,P.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})},e.path))}),e.onCreatePr&&(0,P.jsx)(`div`,{className:`px-2 pt-2 pb-1`,children:(0,P.jsxs)(A,{size:`sm`,variant:`primary`,disabled:e.busy,"data-tip":e.busy?`When ForgeQE has finished`:`Ask ForgeQE to open a pull request with these changes`,onClick:e.onCreatePr,className:`w-full justify-center`,children:[(0,P.jsx)(ee,{"aria-hidden":`true`}),`Pull request`]})})]}),e?.outputs&&e.outputs.length>0&&(0,P.jsx)(Go,{id:`outputs`,title:`Outputs · ${e.outputs.length}`,children:(0,P.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.outputs.map(e=>(0,P.jsx)(ts,{path:e.path,icon:e.kind===`test`?$e:/\.html?$/i.test(e.path)?ze:e.kind===`report`?a:bt,extra:(0,P.jsx)(`span`,{className:`flex-none text-[13px] text-muted`,children:e.label})},e.path))})})]})}var os=24;function ss(e,t,n){if(!t||!n||e.length<t*n*4)return null;let r=(e,n)=>(n*t+e)*4,i=[r(0,0),r(t-1,0),r(0,n-1),r(t-1,n-1)],a=i.every(t=>e[t+3]>=250),o=a&&i.every(t=>[0,1,2].every(n=>Math.abs(e[t+n]-e[i[0]+n])<=os));if(a&&!o)return null;let s=[0,1,2].map(t=>e[i[0]+t]),c=t=>a?[0,1,2].every(n=>Math.abs(e[t+n]-s[n])<=os):e[t+3]<16,l=t,u=n,d=-1,f=-1;for(let e=0;e<n;e++)for(let n=0;n<t;n++)c(r(n,e))||(n<l&&(l=n),n>d&&(d=n),e<u&&(u=e),e>f&&(f=e));if(d<0)return null;let p=Math.round(Math.max(d-l+1,f-u+1)*.02),m={x:Math.max(0,l-p),y:Math.max(0,u-p),w:0,h:0};return m.w=Math.min(t,d+1+p)-m.x,m.h=Math.min(n,f+1+p)-m.y,m.w>=t*.96&&m.h>=n*.96?null:m}function cs(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=()=>n(Error(`The logo could not be read.`)),r.src=e})}function ls(e){let t=e.naturalWidth||0,n=e.naturalHeight||0;if(!t||!n)return null;let r=Math.min(1,1024/Math.max(t,n))||1,i=document.createElement(`canvas`);i.width=Math.max(1,Math.round(t*r)),i.height=Math.max(1,Math.round(n*r));let a=i.getContext(`2d`,{willReadFrequently:!0});return a?(a.drawImage(e,0,0,i.width,i.height),{canvas:i,ctx:a}):null}async function us(e){let t=ls(await cs(e));if(!t)return null;let{canvas:n,ctx:r}=t,i=ss(r.getImageData(0,0,n.width,n.height).data,n.width,n.height);if(!i)return null;let a=document.createElement(`canvas`);return a.width=i.w,a.height=i.h,a.getContext(`2d`)?.drawImage(n,i.x,i.y,i.w,i.h,0,0,i.w,i.h),a}var ds=new Map;function fs(e){return ds.has(e)||ds.set(e,us(e).then(t=>t?t.toDataURL(`image/png`):e).catch(()=>e)),ds.get(e)}var ps=20971520,ms=[1,.75,.5,.35],hs=[[`image/png`,void 0],[`image/webp`,.92],[`image/webp`,.8]];async function gs(e,t){for(let n of ms)for(let[r,i]of hs){let a=await e(n,r,i);if(a&&a.type===r&&a.size<=t)return a}return null}function _s(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(r.error??Error(`the file could not be read`)),r.readAsDataURL(e)})}var vs={"image/png":`.png`,"image/webp":`.webp`};async function ys(e,t){let n=t=>new File([t],e.name.replace(/\.[^.]+$/,``)+vs[t.type],{type:t.type});if(e.size>t){if(e.type===`image/svg+xml`)throw Error(`${e.name} is over ${t/1024} KB.`);if(e.size>20971520)throw Error(`${e.name} is over ${ps/1024/1024} MB: save a smaller copy and upload that.`);let r=await cs(await _s(e)).catch(()=>null),i=r&&ls(r);if(!i)throw Error(`${e.name} could not be read: save it again as PNG or JPEG and upload that.`);let{canvas:a,ctx:o}=i,s=ss(o.getImageData(0,0,a.width,a.height).data,a.width,a.height)??{x:0,y:0,w:a.width,h:a.height},c=await gs((e,t,n)=>{let r=document.createElement(`canvas`);r.width=Math.max(1,Math.round(s.w*e)),r.height=Math.max(1,Math.round(s.h*e));let i=r.getContext(`2d`);return i?(i.imageSmoothingQuality=`high`,i.drawImage(a,s.x,s.y,s.w,s.h,0,0,r.width,r.height),new Promise(e=>r.toBlob(e,t,n))):Promise.resolve(null)},t);if(!c)throw Error(`${e.name} could not be made smaller than ${t/1024} KB: save a smaller copy and upload that.`);return n(c)}try{let r=await us(await _s(e));if(!r)return e;let i=await new Promise(e=>r.toBlob(e,`image/png`));return!i||i.size>t?e:n(i)}catch{return e}}var bs=`/assets/forgeqe-logo-D3CwM2Jl.png`,xs=`/assets/forgeqe-logo-white-CoE-hF2l.png`,Ss=`/assets/forgeqe-mark-ZLd4S3hw.png`;function Cs(e){let[t,n]=(0,N.useState)({});return(0,N.useEffect)(()=>{if(!e)return;let t=!0;return fs(e).then(r=>t&&n({from:e,to:r})),()=>{t=!1}},[e]),e&&t.from===e?t.to:e}var ws=e=>`#${e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``)}`;function Ts(e){try{let t=document.createElement(`canvas`);t.width=t.height=32;let n=t.getContext(`2d`,{willReadFrequently:!0});if(!n)return null;n.drawImage(e,0,0,32,32);let r=n.getImageData(0,0,32,32).data,i=(e,t)=>[...r.subarray((t*32+e)*4,(t*32+e)*4+4)],a=[i(1,1),i(30,1),i(1,30),i(30,30)];if(a.every(e=>e[3]>=200))return{kind:`background`,colour:ws([0,1,2].map(e=>a.reduce((t,n)=>t+n[e],0)/4))};let o=[0,0,0],s=0;for(let e=0;e<r.length;e+=4)if(r[e+3]>=200){for(let t=0;t<3;t++)o[t]+=r[e+t];s++}return s?{kind:`ink`,colour:ws(o.map(e=>e/s))}:null}catch{return null}}var Es=`h-auto w-auto min-h-10 max-h-[112px] max-w-full object-contain`,Ds=`h-11 w-auto max-w-[168px] object-contain object-left`;function Os({aspect:e,alone:t,own:n,size:r,circle:i}){let a=e>1.6,o=a||t;if(n&&(!r||r===`auto`))return o?!a&&(e<=1.25||i)?{cls:i?`size-14 rounded-full object-cover`:`size-14 object-contain`,grow:!1,auto:!0}:{cls:Es,grow:!0,auto:!0}:{cls:i?`size-10 rounded-full object-cover`:`size-10 object-contain`,grow:!1,auto:!0};let s=r===`large`;return i?{cls:`${t?s?`size-16`:`size-11`:s?`size-12`:`size-8`} rounded-full object-cover`,grow:!1,auto:!1}:o?{cls:s?Es:Ds,grow:s,auto:!1}:{cls:s?`size-12 object-contain`:`size-8 object-contain`,grow:!1,auto:!1}}function ks({theme:e,compact:t=!1,onPlate:n}){let{mode:r}=M(),i=r===`dark`?xs:bs,a=Cs(e.logo)||i,[o,s]=(0,N.useState)(e.logo?1:2.1),[c,l]=(0,N.useState)(null),u=o>1.6,d=Os({aspect:o,alone:!!e.logo&&!e.name,own:!!e.logo,size:t?`standard`:e.logoSize,circle:e.logoFrame===`circle`&&!u}),f=d.auto&&!e.logoFrame&&c?.kind===`background`,p=e.logo&&e.logoFrame!==`tile`&&!f?hn(c,un(e,r)):null,m=f&&!!hn(c,un(e,r));(0,N.useEffect)(()=>n?.(!!p),[p,n]);let h=e.logo?e.logoFrame===`circle`&&u?`rounded`:e.logoFrame||(d.auto&&c?.kind===`background`?`rounded`:`plain`):`plain`,g=d.cls,_=(0,P.jsx)(`img`,{src:a,alt:``,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&s(t.naturalWidth/t.naturalHeight),l(Ts(t))},className:D(`block min-w-0`,d.grow?`flex-initial`:`flex-none`,g,h===`rounded`&&`overflow-hidden rounded-[8px]`,m&&`shadow-[0_0_0_1px_rgb(0_0_0/0.12)]`)});return(0,P.jsxs)(`span`,{className:D(`flex min-w-0 items-center gap-2`,d.grow&&`flex-1`),children:[h===`tile`||p?(0,P.jsx)(`span`,{style:p?{background:p}:void 0,className:D(`flex items-center justify-center rounded-[10px] p-2`,!p&&`bg-white shadow-[0_0_0_1px_rgb(0_0_0/0.06)]`,d.grow?`min-w-0 flex-initial`:`flex-none`),children:_}):_,!u&&e.name&&(0,P.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]})}function As({theme:e}){let{mode:t}=M(),[n,r]=(0,N.useState)(1),[i,a]=(0,N.useState)(null),o=Cs(e.logoMark||e.logo),s=!!o&&(!!e.logoMark||n<=1.6),c=s?hn(i,un(e,t)):null;return s?(0,P.jsx)(`span`,{style:c?{background:c}:void 0,className:D(`flex size-9 items-center justify-center rounded-[10px]`,c&&`p-1`),children:(0,P.jsx)(`img`,{src:o,alt:``,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&r(t.naturalWidth/t.naturalHeight),a(Ts(t))},className:D(`block size-full object-contain`,e.logoFrame===`circle`?`rounded-full`:`rounded-[8px]`)})}):(0,P.jsxs)(`span`,{"aria-hidden":`true`,className:`flex size-9 items-center justify-center`,children:[(0,P.jsx)(`img`,{src:Ss,alt:``,className:`block size-9 object-contain`}),o&&!e.logoMark&&(0,P.jsx)(`img`,{src:o,alt:``,className:`hidden`,onLoad:e=>e.currentTarget.naturalHeight&&r(e.currentTarget.naturalWidth/e.currentTarget.naturalHeight)})]})}var js=`/assets/capgemini-mark-D6aZFnD3.png`,Ms=`m 153.2175,21.2782 c 3.4962,0 6.1962,-2.8462 6.2312,-6.225 -0.245,-1.475 -0.7625,-4.2037 -4.585,-4.2037 -4.19,0 -5.5762,5.8487 -8.985,9.6237 -0.2737,2.1438 -2.305,4.0625 -4.8387,4.385 0.62,0.6488 2.0025,1.0013 3.6525,1.0013 3.0175,0 6.67,-0.9088 8.5837,-2.7988 -2.5537,0.035 -4.1937,-1.6062 -4.355,-3.8762 1.245,1.5087 2.6513,2.0937 4.2963,2.0937`,Ns=`m 126.3725,11.972 c 0,-1.86 -0.1125,-3.1 -1.3288,-3.1 -0.5562,0 -0.825,0.1125 -1.3087,0.2725 0.43,6.28 -0.9913,11.8125 -2.7238,11.8125 -2.2712,0 -1.1387,-13.4625 -5.9475,-13.4625 -4.4387,0 -5.0787,10.7475 -5.5812,10.7475 -0.3425,0 -0.395,-2.8225 -0.3763,-4.9763 0.1863,-1.03 0.2888,-1.9575 0.2888,-2.6612 0,-1 -0.41,-2.7288 -2.6813,-1.865 0.079,7.6862 -1.46,12.3287 -3.1937,12.3287 -2.5388,0 -2.5675,-6.9675 -2.5675,-8.8862 0,-1.875 0.1362,-4.38 -2.6513,-3.4913 -0.415,6.7038 -2.1737,11.7625 -3.2812,11.7625 -1.6513,0 -1.3188,-11.5812 -4.8888,-11.5812 -3.2125,0 -4.2037,10.9712 -4.8725,10.9712 -1.1962,0 0.3763,-12.3487 -4.2625,-12.3487 -2.4312,0 -3.3987,4.1212 -4.3512,8.735 -0.185,0.8937 -0.375,0.9237 -0.41,-0.087 -0.024,-0.8588 -0.029,-1.7238 -0.019,-2.5825 1.1663,-4.6388 -0.2587,-6.3525 -2.4075,-5.1175 0.6938,8.56 -3.2375,12.7437 -6.25,12.7437 -1.0887,0 -1.9487,-0.4637 -2.5875,-1.1962 3.6125,-2.2163 5.2188,-4.76 5.2188,-7.2463 0,-2.69 -1.5475,-4.2425 -4.1163,-4.2425 -3.5837,0 -5.59,3.6913 -5.59,6.8313 0,1.6887 0.3175,3.125 0.835,4.3062 -1.2312,0.5863 -2.3925,1.0938 -3.4725,1.5863 -0.098,-3.2275 -0.4587,-6.615 -0.7362,-9.745 -1.91,-0.5275 -2.4663,0.39 -2.6125,2.0887 -0.3425,3.8775 -1.7775,6.285 -3.0475,6.285 -0.9525,0 -1.5375,-1.1625 -1.6063,-2.3975 -0.3562,-6.2162 4.6875,-7.945 7.3288,-7.0412 0.5475,-1.3725 -0.054,-2.3588 -2.4363,-2.3588 -2.8862,0 -5.0437,1.7538 -6.6262,4.0038 -1.0538,1.5 -2.275,2.5637 -3.8963,3.8487 0.044,-0.3662 0.064,-0.7375 0.064,-1.1037 0,-4.38 -2.3738,-6.3038 -4.6388,-6.3038 -1.875,0 -3.0562,1.1225 -3.74,2.8513 -0.1662,-1.7338 -0.5125,-2.48 -1.5187,-2.48 -0.43,0 -1.03,0.1212 -1.67,0.4337 0.2925,0.9675 0.405,3.1113 0.405,4.5175 0,5.2675 -1.5088,7.6313 -2.9588,7.6313 -1.66,0 -1.9237,-6.25 -2.065,-8.6813 -0.2587,-0.098 -0.5325,-0.1512 -0.8112,-0.1512 -1.5038,0 -1.6988,2.0162 -2.07,3.8712 -0.41,2.0563 -1.5913,4.6388 -3.345,4.6388 -1.0588,0 -1.7238,-1.02 -1.8063,-2.8563 -0.1712,-3.725 2.93,-8.14 7.7788,-6.7675 0.6337,-1.4837 -0.3625,-2.6125 -2.3738,-2.6125 -3.545,0 -6.475,2.6513 -7.7537,5.7913 -1.2988,2.8812 -3.57,7.11 -8.1888,7.11 C 6.26,21.7975 3.76,18.95 3.76,12.9787 c 0,-5.1462 3.2462,-10.035 6.7087,-10.035 2.4213,0 2.9838,2.3838 2.7688,4.62 1.255,1.005 3.31,0.067 3.31,-2.4462 0,-1.7338 -1.4063,-4.6738 -5.9513,-4.6738 C 4.9712,0.4437 0,6.055 0,13.4225 0,20.5612 3.6225,24.78 8.75,24.78 c 3.2375,0 6.2887,-1.845 8.3937,-5.2538 0.5325,2.9838 2.5638,4.2388 4.0863,4.2388 2.4662,0 4.0775,-1.5975 4.9562,-3.755 0.5475,2.1625 1.7038,3.765 3.6288,3.765 1.3525,0 2.4112,-0.6888 3.2075,-1.7875 -0.3175,7.5187 -0.7125,12.3137 3.73,11.3725 -0.6875,-2.1388 -0.9075,-6.0313 -0.9075,-9.5275 0,-9.565 1.5775,-12.7138 3.555,-12.7138 1.435,0 1.8987,1.825 1.8987,3.7738 0,1.045 -0.1025,2.2462 -0.3662,3.325 -2.4313,1.5337 -4.37,2.745 -4.37,4.2825 0,1.2162 0.9037,1.3275 1.685,1.3275 1.865,0 4.1112,-1.83 5.3512,-5.2825 1.0838,-0.6588 2.1725,-1.4113 3.2125,-2.4363 -0.034,0.3513 -0.054,0.7025 -0.054,1.0638 0,3.4275 1.4987,5.5037 3.8962,5.5037 1.88,0 3.2863,-1.3337 4.2825,-3.33 0.064,1.1513 0.1025,2.2113 0.1175,3.1825 -3.8087,1.7638 -8.0225,3.55 -8.0225,8.5213 0,2.5725 1.855,4.5062 4.2725,4.5062 5.3075,0 6.5188,-5.6 6.5675,-12.1087 1.7288,-0.7475 3.0125,-1.3238 4.4975,-2.0613 1.2688,1.5925 2.9975,2.3888 4.58,2.3888 2.9925,0 5.2438,-1.5875 7.05,-4.805 0.3175,2.4462 0.9525,4.805 2.2563,4.805 2.3725,0 2.8562,-12.4125 4.6187,-12.4125 1.3525,0 0.245,13.4275 3.8138,13.4275 3.0562,0 3.6275,-11.8163 5.1175,-11.8163 1.055,0 1.1325,10.8013 4.4625,10.8013 1.6362,0 3.4137,-1.9688 4.3012,-6.09 0.42,2.745 1.8025,6.09 4.5075,6.09 1.5775,0 2.935,-1.5975 3.9838,-3.7163 0.2887,2.1825 0.9037,3.7163 2.1,3.7163 3.11,0 3.0075,-12.3838 5.4687,-12.3838 1.9188,0 1.3288,12.3838 5.8988,12.3838 2.1725,0 3.2025,-1.8513 3.8187,-4.18 0.8388,3.4225 2.2013,4.18 3.315,4.18 0.7075,0 1.245,-0.25 1.9488,-1.085 -3.5363,-1.5325 -3.2375,-7.1138 -3.2375,-10.7175 m -74.8438,21.27 c -1.0987,0 -1.68,-1.045 -1.68,-2.2225 0,-3.1788 2.3338,-4.8625 5.205,-6.3125 -0.1275,6.9425 -1.7437,8.535 -3.525,8.535 m 14.2775,-22.51 c 1.0688,0 1.6788,0.9812 1.5713,2.3925 -0.1213,1.655 -1.3275,3.555 -3.4275,5.0437 -1.0938,-3.115 -0.2775,-7.4362 1.8562,-7.4362 M 99.6722,6.035 c 1.0162,-0.034 1.7287,-0.9075 1.7337,-1.9475 0.01,-1.04 -0.6987,-1.8613 -1.7187,-1.8225 -1.02,0.035 -1.85,0.9087 -1.855,1.9487 -0.01,1.04 0.82,1.855 1.84,1.8213 m 25.3325,0.5275 c 0.9275,-0.034 1.685,-0.8638 1.685,-1.855 0,-0.9913 -0.7425,-1.7675 -1.67,-1.7388 -0.9288,0.034 -1.685,0.8688 -1.69,1.86 -0.01,0.9913 0.7475,1.7675 1.675,1.7338 m 34.4387,8.2425 c -0.079,-3.9263 -1.9437,-7.2363 -4.825,-9.8788 -2.1875,-1.9962 -4.785,-3.515 -7.5087,-4.6575 -0.215,-0.092 -0.44,-0.1812 -0.66,-0.2687 -3.3538,4.0187 -14.965,7.0162 -14.965,15.44 0,3.29 2.08,6.3712 5.1312,7.6075 1.7725,0.6687 3.54,0.7025 5.3125,0.1062 1.5775,-0.5175 2.8713,-1.4937 3.95,-2.68 3.4088,-3.775 4.795,-9.6187 8.98,-9.6187 3.8275,0 4.345,2.7237 4.59,4.1987 0,-0.01 0,-0.1075 -0.01,-0.2487`;function Ps({rail:e=!1}){let{mode:t}=M();return e?(0,P.jsx)(`img`,{src:js,alt:`Capgemini`,"data-tip":`Capgemini`,"data-tip-side":`left`,className:`mb-1 size-8 flex-none object-contain`}):(0,P.jsxs)(`svg`,{viewBox:`-1.06668594 -1.06668594 161.58207188 37.68956988`,role:`img`,"aria-label":`Capgemini`,className:`ml-2 h-8 w-auto max-w-[180px] flex-none overflow-visible`,shapeRendering:`geometricPrecision`,children:[(0,P.jsx)(`path`,{fill:t===`dark`?`#fff`:`#12ABDB`,fillRule:`evenodd`,d:Ms}),(0,P.jsx)(`path`,{fill:t===`dark`?`#fff`:`#0070AD`,fillRule:`evenodd`,d:Ns})]})}function Fs({item:e}){return e.agent?(0,P.jsx)(pn,{agent:e.agent,px:18,decorative:!0}):(0,P.jsx)(k,{name:dn[e.id]||fn[e.id]||`feature`,px:18})}var Is={id:`settings`,label:`Settings`};function Ls(){let e=(e,t,n,r,i)=>({id:e,label:t,meta:n,href:r,words:i,kind:`page`});return[...cn.filter(e=>e.item.path[0]!==`settings`).map(t=>e(t.item.id,t.item.label,`${t.category.label} · ${t.area.label}`,nn(t.item),[t.item.words,t.item.about].filter(Boolean).join(` `))),...$t.flatMap(t=>[e(`browse-${t.id}`,t.label,`Category`,an(t),t.about),...t.areas.map(n=>e(`browse-${t.id}-${n.id}`,n.label,t.label,en(t,n),n.about))]),e(`browse`,`ForgeQE`,`Every category`,T(`browse`),`Everything browse all categories home`),e(Is.id,Is.label,`Every setting`,T(Is.id))]}var Rs=Ls(),zs=(0,N.lazy)(()=>Wt(()=>import(`./CommandPalette-rNWxEO_C.js`),__vite__mapDeps([5,2,1,3,6,7,8,0,4]))),Bs=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),Vs=()=>Bs()?`⌘K`:`Ctrl K`;function Hs({route:e}){let{find:t}=(0,N.useContext)(Ks),n=e.length?tn(e):void 0,r=e[0]===`settings`?At.find(t=>t.id===(e[1]||`models`)):void 0,i=e[0]===`agents`&&e[1]&&e[1]!==`category`&&e[1]!==`custom`?Dt(e[1]):void 0,a=i?{href:T(`agents`),label:`Agents`,here:E(i.agent).name}:r?{href:T(`settings`),label:`Settings`,here:r.label}:n?{href:an(n.category),label:n.category.label,here:n.item.label}:void 0;return(0,P.jsxs)(`header`,{className:`hidden h-(--top-bar) flex-none items-center gap-6 bg-canvas px-8 md:flex`,children:[(0,P.jsx)(`nav`,{"aria-label":`Where you are`,className:`flex min-w-0 flex-[1_1_0] items-center gap-2 text-sm`,children:a&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`a`,{href:a.href,className:`flex-none text-muted no-underline hover:text-ink`,children:a.label}),(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`/`}),(0,P.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate font-medium text-ink`,children:a.here})]})}),(0,P.jsxs)(`button`,{type:`button`,onClick:t,"aria-keyshortcuts":Bs()?`Meta+K`:`Control+K`,className:`flex h-10 w-full max-w-[560px] flex-[0_1_560px] cursor-pointer items-center gap-2 rounded-full border-0 bg-container px-4 text-sm text-muted hover:bg-line focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,children:[(0,P.jsx)(Te,{size:16,strokeWidth:1.8,"aria-hidden":`true`,className:`text-icon`}),(0,P.jsx)(`span`,{className:`flex-1 truncate text-left`,children:`Search pages, agents and settings`}),(0,P.jsx)(`kbd`,{className:`rounded-[6px] bg-bg px-2 py-px font-sans text-[13px] text-muted`,children:Vs()})]}),(0,P.jsx)(`span`,{className:`flex-[1_1_0]`,"aria-hidden":`true`})]})}function Us(){let{find:e}=(0,N.useContext)(Ks);return(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Search (${Vs()})`,"data-tip":`Search`,onClick:e,className:`size-9 flex-none`,children:(0,P.jsx)(Te,{strokeWidth:1.8,"aria-hidden":`true`})})}var Ws=Ci,Gs=wi,Ks=(0,N.createContext)({hidden:!1,open:()=>{},setChat:()=>{},find:()=>{}});function qs(e){let{setChat:t}=(0,N.useContext)(Ks),n=JSON.stringify(e);(0,N.useEffect)(()=>(t(e),()=>t(null)),[n,t])}var Js=`forgeqe-sidebar`,Ys=()=>{try{return localStorage.getItem(Js)===`closed`}catch{return!1}};function Xs({className:e}){let{open:t}=(0,N.useContext)(Ks);return(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Open the sidebar`,"data-tip":`Open the sidebar`,onClick:t,className:D(`inline-flex md:hidden`,e),children:(0,P.jsx)(i,{strokeWidth:1.8,"aria-hidden":`true`})})}function Zs(){return(0,P.jsxs)(`div`,{className:`theme-side sticky top-0 z-20 flex items-center gap-1 px-4 py-2 md:hidden`,children:[(0,P.jsx)(Xs,{}),(0,P.jsx)(`span`,{className:`ml-1 flex min-w-0 flex-1`,children:(0,P.jsx)(gc,{compact:!0})}),(0,P.jsx)(Us,{})]})}function Qs({item:e,current:t}){let n=t===e.id;return(0,P.jsxs)(`a`,{href:T(e.id),"aria-current":n?`page`:void 0,className:D(Ws,Gs(n)),children:[(0,P.jsx)(Fs,{item:e}),(0,P.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]})}function $s({current:e,rail:t=!1}){let n=!e;return t?(0,P.jsx)(`a`,{href:T(),"aria-label":`New chat`,"data-tip":`New chat`,"data-tip-side":`right`,"aria-current":n?`page`:void 0,className:D(cc,`mt-2`,n?`bg-(--side-current-bg) text-(--side-current-ink) hover:text-(--side-current-ink)`:`text-ink-2 hover:bg-surface-strong hover:text-ink`),children:(0,P.jsx)(Re,{strokeWidth:1.8,"aria-hidden":`true`,className:`size-[18px]`})}):(0,P.jsxs)(`a`,{href:T(),"aria-current":n?`page`:void 0,className:D(Ws,Gs(n)),children:[(0,P.jsx)(Re,{strokeWidth:1.8,"aria-hidden":`true`,className:`size-[18px]`}),`New chat`]})}function ec(e){let t=on(e);if(t.category)return{category:t.category.id,area:t.area?.id};let n=tn(e);return n&&n.item.path.length?{category:n.category.id,area:n.area.id}:{}}var tc=`forgeqe-sidebar-open`;function nc(e){let t=new Set([...$t.flatMap(e=>[`c:${e.id}`,...e.areas.map(t=>`a:${e.id}/${t.id}`)])]);try{let n=JSON.parse(e||`[]`);return Array.isArray(n)?[...new Set(n.filter(e=>typeof e==`string`&&t.has(e)))]:[]}catch{return[]}}var rc=()=>{try{return nc(localStorage.getItem(tc))}catch{return[]}};function ic(e){let t=ec(e);return[t.category&&`c:${t.category}`,t.category&&t.area&&`a:${t.category}/${t.area}`].filter(e=>!!e)}function ac({current:e,route:t,place:n=t,onClose:r,stats:i}){let a=t.join(`/`),o=n.join(`/`),[s,c]=(0,N.useState)(()=>new Set([...rc(),...ic(n)]));(0,N.useEffect)(()=>c(e=>ic(n).every(t=>e.has(t))?e:new Set([...e,...ic(n)])),[a,o]);let l=e=>t=>c(n=>{let r=new Set(n);t?r.add(e):r.delete(e);try{localStorage.setItem(tc,JSON.stringify([...r]))}catch{}return r}),{pins:u,toggle:d}=ln(),f=tn(n)?.item.id,p=on(t),m=u.map(e=>cn.find(t=>t.item.id===e)).filter(e=>!!e),h=e=>f===e.id&&!(e.id===`chats`&&t[1]),g=e=>(0,P.jsx)(gi,{href:nn(e),label:e.label,current:h(e),icon:(0,P.jsx)(k,{name:e.icon,px:18})},e.id),_=e=>(0,P.jsx)(gi,{href:nn(e),label:e.label,current:f===e.id,icon:(0,P.jsx)(k,{name:e.icon,px:18}),after:(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Unpin ${e.label}`,"data-tip":`Unpin ${e.label}`,"data-tip-side":`right`,onClick:()=>d(e.id),className:`absolute top-1/2 right-1 z-20 size-6 -translate-y-1/2 text-muted opacity-0 group-hover:opacity-100 hover:text-ink focus-visible:opacity-100`,children:(0,P.jsx)(Qe,{size:13,strokeWidth:1.8,fill:`currentColor`,"aria-hidden":`true`})})},e.id);return(0,P.jsxs)(`nav`,{"aria-label":`ForgeQE`,className:`theme-side flex h-full w-[248px] min-[1440px]:w-[264px] flex-col px-4 py-4 short:py-2`,children:[(0,P.jsxs)(`div`,{className:`flex min-h-10 items-center gap-1 pl-2`,children:[(0,P.jsx)(gc,{}),(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Close the sidebar`,"data-tip":`Close the sidebar`,onClick:r,className:`size-8 flex-none`,children:(0,P.jsx)(Je,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,P.jsx)(`div`,{className:`mt-4 flex flex-col gap-px short:mt-2`,children:(0,P.jsx)($s,{current:e})}),(0,P.jsx)(`div`,{className:`-mx-4 mt-2 flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-6 [mask-image:linear-gradient(to_bottom,black_calc(100%-28px),transparent)]`,children:(0,P.jsxs)(Si,{routeKey:`${a}|${o}`,className:`gap-4 short:gap-2`,children:[(0,P.jsx)(yi,{label:`Pinned`,children:m.length?m.map(e=>_(e.item)):(0,P.jsx)(`span`,{className:`px-2 text-[13px] text-muted`,children:`Star a page on Browse to pin it.`})}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-px`,children:[(0,P.jsx)(`a`,{href:T(`browse`),"aria-current":t[0]===`browse`&&!p.category?`page`:void 0,className:`flex h-7 short:h-6 items-center rounded-[6px] px-2 text-[13px] font-medium text-muted no-underline hover:text-ink`,children:`Browse`}),$t.map(e=>(0,P.jsx)(xi,{label:e.label,icon:(0,P.jsx)(k,{name:e.icon,px:18}),href:an(e),hrefLabel:`Open the ${e.label} page`,current:p.category?.id===e.id&&!p.area,lines:li,open:s.has(`c:${e.id}`),onOpenChange:l(`c:${e.id}`),children:e.areas.map(t=>(0,P.jsx)(bi,{label:t.label,badge:!s.has(`a:${e.id}/${t.id}`)&&(0,P.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:t.items.length}),href:en(e,t),hrefLabel:`Open the ${t.label} page`,current:p.category?.id===e.id&&p.area?.id===t.id,open:s.has(`a:${e.id}/${t.id}`),onOpenChange:l(`a:${e.id}/${t.id}`),children:t.items.map(g)},t.id))},e.id))]}),t[0]===`chats`&&t[1]&&(0,P.jsx)(sc,{uses:i?.uses})]})}),(0,P.jsxs)(`div`,{className:`flex flex-none items-center gap-1 pt-2 short:pt-1`,children:[(0,P.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,P.jsx)(Qs,{item:Is,current:e})}),(0,P.jsx)(dc,{}),(0,P.jsx)(pc,{icon:!0})]})]})}var oc=[{id:`knowledge`,label:`Knowledge`,icon:`knowledge-base`,to:T(`knowledge`,`notes`)},{id:`sections`,label:`Document sections`,icon:`wikis`,to:T(`knowledge`,`notes`)},{id:`skills`,label:`Skills`,icon:`feature`,to:T(`skills`)},{id:`systems`,label:`Systems`,icon:`columns`}];function sc({uses:e}){let t=oc.map(t=>({...t,names:e?.[t.id]||[]}));return(0,P.jsxs)(`div`,{role:`group`,"aria-labelledby":`nav-in-chat`,className:`mt-4 flex flex-col gap-px short:mt-2`,children:[(0,P.jsx)(`span`,{id:`nav-in-chat`,className:`flex h-7 short:h-6 items-center px-2 text-[13px] font-medium text-muted`,children:`In this chat`}),t.every(e=>!e.names.length)?(0,P.jsx)(`span`,{className:`px-2 text-[13px] text-muted`,children:`No knowledge, documents, skills or systems used yet.`}):t.filter(e=>e.names.length).map(t=>{let n=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(k,{name:t.icon,px:18}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.label}),(0,P.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:t.names.length})]});return(0,P.jsxs)(`div`,{className:`flex flex-col`,children:[t.to?(0,P.jsx)(`a`,{href:t.to,className:D(Ws,Gs(!1)),children:n}):(0,P.jsx)(`span`,{className:D(Ws,`text-ink-2`),children:n}),(0,P.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0 pl-8`,children:[t.names.map(e=>(0,P.jsx)(`li`,{"data-tip":e,className:`truncate px-2 py-1 text-[13px] text-muted`,children:e},e)),t.id===`sections`&&e?.text&&e.text.whole>e.text.sent&&(0,P.jsxs)(`li`,{"data-tip":`${e.text.sent.toLocaleString()} of ${e.text.whole.toLocaleString()} characters`,className:`truncate px-2 py-1 text-[13px] text-muted`,children:[Math.round((1-e.text.sent/e.text.whole)*100),`% less text than the whole documents`]})]})]},t.id)})]})}var cc=`flex size-9 flex-none items-center justify-center rounded-[8px] no-underline`;function lc({item:e,current:t}){let n=t===e.id;return(0,P.jsx)(`a`,{href:T(e.id),"aria-current":n?`page`:void 0,"aria-label":e.label,"data-tip":e.label,"data-tip-side":`right`,className:D(cc,n?`bg-(--side-current-bg) text-(--side-current-ink) hover:text-(--side-current-ink)`:`text-ink-2 hover:bg-surface-strong hover:text-ink`),children:(0,P.jsx)(Fs,{item:e})})}function uc({current:e,route:t,onOpen:n}){let{theme:r}=M(),{pins:a}=ln(),o=r.name||`ForgeQE`,s=tn(t),c=on(t).category?.id||(s?.item.path.length?s.category.id:``),l=(e,t,n,r)=>(0,P.jsx)(`a`,{href:e,"aria-current":r?`page`:void 0,"aria-label":t,"data-tip":t,"data-tip-side":`right`,className:D(cc,r?`bg-(--side-current-bg) text-(--side-current-ink) hover:text-(--side-current-ink)`:`text-ink-2 hover:bg-surface-strong hover:text-ink`),children:(0,P.jsx)(k,{name:n,px:18})},e),u=a.map(e=>cn.find(t=>t.item.id===e)).filter(e=>!!e);return(0,P.jsxs)(`nav`,{"aria-label":`ForgeQE`,className:`theme-side flex h-full w-16 flex-col items-center gap-px py-4`,children:[(0,P.jsx)(`a`,{href:T(),"aria-label":`${o}, home`,"data-tip":o,"data-tip-side":`right`,className:`mb-1 flex min-h-10 items-center justify-center no-underline`,children:(0,P.jsx)(As,{theme:r})}),(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Open the sidebar`,"data-tip":`Open the sidebar`,"data-tip-side":`right`,onClick:n,className:`size-9`,children:(0,P.jsx)(i,{strokeWidth:1.8,"aria-hidden":`true`})}),(0,P.jsx)($s,{current:e,rail:!0}),(0,P.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center gap-px overflow-y-auto`,children:[(0,P.jsxs)(`div`,{role:`group`,"aria-label":`Browse`,className:`flex flex-col items-center gap-px`,children:[(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`my-2 h-px w-6 bg-line`}),$t.map(e=>l(an(e),e.label,e.icon,c===e.id))]}),u.length>0&&(0,P.jsxs)(`div`,{role:`group`,"aria-label":`Pinned`,className:`flex flex-col items-center gap-px`,children:[(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`my-2 h-px w-6 bg-line`}),u.map(e=>l(nn(e.item),e.item.label,e.item.icon,s?.item.id===e.item.id))]})]}),(0,P.jsxs)(`div`,{className:`flex flex-none flex-col items-center gap-px pt-2`,children:[(0,P.jsx)(dc,{rail:!0}),(0,P.jsx)(pc,{icon:!0,rail:!0}),(0,P.jsx)(lc,{item:Is,current:e})]})]})}function dc({rail:e=!1}){return(0,P.jsx)(`a`,{href:`/help/guide`,target:`_blank`,rel:`noreferrer noopener`,"aria-label":`Help`,"data-tip":`Help`,"data-tip-side":e?`right`:void 0,className:D(cc,`text-ink-2 hover:bg-surface-strong hover:text-ink`),children:(0,P.jsx)(k,{name:dn.help,px:18})})}var fc=[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}];function pc({icon:e=!1,rail:t=!1}){let{choice:n,setChoice:r}=M(),i=fc.findIndex(e=>e.id===n),a=fc[i],o=fc[(i+1)%fc.length],s=`Dark/Light: now ${a.label===`System`?`as the computer is`:a.label.toLowerCase()}. Switch to ${o.label===`System`?`as the computer is`:o.label.toLowerCase()}`;return(0,P.jsxs)(`button`,{type:`button`,"aria-label":s,"data-tip":s,"data-tip-side":t?`right`:void 0,onClick:()=>r(o.id),className:D(e?cc:Ws,`w-full cursor-pointer border-0 bg-transparent text-left text-ink-2 hover:bg-surface-strong hover:text-ink`,e&&`w-auto`),children:[(0,P.jsx)(k,{name:dn.theme,px:18}),!e&&(0,P.jsxs)(`span`,{className:`flex flex-1 items-baseline justify-between gap-2`,children:[`Dark/Light`,(0,P.jsx)(`span`,{className:`text-[13px] text-muted`,children:a.label===`System`?`Auto`:a.label})]})]})}function mc(e){return[{id:`env`,label:`Environment`},{id:`usage`,label:`Context and tokens`},...e?.commands?.length?[{id:`commands`,label:`Commands · ${e.commands.length}`}]:[],...e?.changes?.length?[{id:`changes`,label:`Changes · ${e.changes.length}`}]:[],...e?.outputs?.length?[{id:`outputs`,label:`Outputs · ${e.outputs.length}`}]:[]]}function hc({stats:e,onOpen:t}){return(0,P.jsxs)(`aside`,{"aria-label":`Workspace`,className:`flex h-full w-14 flex-col items-center gap-1 bg-canvas py-4`,children:[(0,P.jsx)(Ps,{rail:!0}),(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Show the workspace panel`,"data-tip":`Show the workspace panel`,"data-tip-side":`left`,onClick:()=>t(),children:(0,P.jsx)(C,{strokeWidth:1.8,"aria-hidden":`true`})}),(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`my-1 h-px w-6 bg-line`}),mc(e).map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-label":e.label,"data-tip":e.label,"data-tip-side":`left`,onClick:()=>t(e.id),className:D(cc,`cursor-pointer border-0 bg-transparent text-ink-2 hover:bg-surface-strong hover:text-ink`),children:(0,P.jsx)(Fs,{item:e})},e.id)),(0,P.jsx)(`span`,{className:`flex-1`}),(0,P.jsx)(Tr,{rail:!0})]})}function gc({compact:e=!1}){let{theme:t}=M(),n=t.name||`ForgeQE`;return(0,P.jsx)(`a`,{href:T(),"aria-label":`${n}, home`,className:`-ml-2 flex min-h-9 min-w-0 flex-1 items-center gap-2 rounded-[8px] pl-2 text-base font-semibold text-ink no-underline hover:bg-surface-strong hover:text-ink`,children:(0,P.jsx)(ks,{theme:t,compact:e})})}function _c(){let[e,t]=(0,N.useState)(!1);return(0,N.useEffect)(()=>{let e=()=>t(!0);return window.addEventListener(Kt,e),()=>window.removeEventListener(Kt,e)},[]),e?(0,P.jsx)(`p`,{role:`alert`,className:`mx-4 mt-4 mb-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:It()}):null}function vc({stats:e,onClose:t,focus:n}){let r=(0,N.useRef)(null);return(0,N.useEffect)(()=>{n&&(r.current?.querySelector(`#panel-${n.id}`))?.scrollIntoView({block:`start`,behavior:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`})},[n]),(0,P.jsxs)(`aside`,{"aria-label":`Workspace`,className:`flex h-full w-[264px] flex-col bg-canvas`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-4`,children:[(0,P.jsx)(Ps,{}),(0,P.jsx)(`span`,{className:`flex-1`}),(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Close the workspace panel`,"data-tip":`Close the workspace panel`,"data-tip-side":`left`,onClick:t,children:(0,P.jsx)(Ke,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,P.jsx)(`div`,{ref:r,className:`min-h-0 flex-1 overflow-y-auto px-4 pt-1 pb-4`,children:(0,P.jsx)(as,{chat:e})}),(0,P.jsx)(`div`,{className:`px-4 py-4`,children:(0,P.jsx)(Tr,{})})]})}var yc=`forgeqe-workspace-panel`,bc=`forgeqe:workspace-fold`,xc=()=>{try{return localStorage.getItem(yc)!==`closed`}catch{return!0}},Sc=220;function Cc({open:e,side:t,label:n,wideAt:r,onClose:i,className:a,children:o}){let s=(0,N.useRef)(null),c=Vt(e,150);(0,N.useEffect)(()=>{let t=s.current;t&&(e&&!t.open?t.showModal():!c&&t.open&&t.close())},[e,c]),(0,N.useEffect)(()=>{if(!e)return;let t=window.matchMedia(r);if(t.matches)return i();let n=()=>t.matches&&i();return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e,r,i]);let l=t===`left`?`aside`:`div`;return(0,P.jsx)(`dialog`,{ref:s,"aria-label":n,onCancel:e=>{e.target===s.current&&(e.preventDefault(),i())},className:D(`drawer fixed inset-0 z-40 m-0 h-auto max-h-none w-auto max-w-none overflow-hidden border-0 bg-transparent p-0 text-ink backdrop:bg-transparent`,!e&&`is-closing`,a),children:c&&(0,P.jsxs)(`div`,{inert:!e||void 0,className:`absolute inset-0`,children:[(0,P.jsx)(`div`,{"aria-hidden":`true`,className:`drawer-dim absolute inset-0 bg-[rgba(17,25,40,0.28)]`,onClick:i}),(0,P.jsx)(l,{className:D(`drawer-box absolute inset-y-0 max-w-[85vw] shadow-menu`,t===`left`?`drawer-left left-0`:`right-0`),children:o})]})})}function wc(e,t,n){let r=(e??``).replace(/\s+/g,` `).trim().slice(0,80);return n||!r?t:`${r} · ${t}`}function Tc(e,t,n){(0,N.useEffect)(()=>{let e=document.querySelector(`[data-screen]`);if(!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`h1`),r=wc(n?.textContent,Et(),!!n?.hasAttribute(`data-app-title`));document.title!==r&&(document.title=r)},r=()=>t||=requestAnimationFrame(n);r();let i=new MutationObserver(r);return i.observe(e,{subtree:!0,childList:!0,characterData:!0}),()=>{i.disconnect(),t&&cancelAnimationFrame(t)}},[e,t,n])}function Ec(e){e.preventDefault();let t=document.querySelector(`[data-screen] main`)??document.querySelector(`[data-screen]`);t&&(t.hasAttribute(`tabindex`)||t.setAttribute(`tabindex`,`-1`),t.focus())}function Dc({current:e,route:t=e?[e]:[],children:n}){let[r,i]=(0,N.useState)(Ys),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),[l,u]=(0,N.useState)(xc),[d,f]=(0,N.useState)(!1),p=(0,N.useCallback)(()=>c(!1),[]),m=(0,N.useCallback)(()=>f(!1),[]),[h,g]=(0,N.useState)(!1),[_,v]=(0,N.useState)(!1),[y,b]=(0,N.useState)(``),x=t.join(`/`);(0,N.useEffect)(()=>Xt(t),[x]);let{theme:ee}=M();Tc(e,x,ee.appName);let S=Wr(t),te=()=>{c(!1),b(``),v(!0),g(!0)},ne=(0,N.useCallback)(e=>{c(!1),b(e),v(!0),g(!0)},[]);(0,N.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),b(``),v(!0),g(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let w=Vt(!r,Sc),re=Vt(l,Sc),[ie,ae]=(0,N.useState)(null),oe=()=>window.matchMedia(`(min-width: 1600px)`).matches,se=e=>{u(e);try{localStorage.setItem(yc,e?`open`:`closed`)}catch{}};(0,N.useEffect)(()=>{let e=e=>u(e.detail!==!0&&xc());return window.addEventListener(bc,e),()=>window.removeEventListener(bc,e)},[]),(0,N.useEffect)(()=>{if(!d)return;let e=()=>f(!1);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[d]);let ce=e=>{i(e);try{localStorage.setItem(Js,e?`closed`:`open`)}catch{}};(0,N.useEffect)(()=>{if(!s)return;let e=()=>c(!1);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[s]);let le=()=>window.matchMedia(`(min-width: 768px)`).matches,{setChoice:ue}=M(),de=async(e,t,n)=>e===`theme`?(ue(t),`The look is ${t} now.`):e===`talk`?(window.dispatchEvent(new Event(`forgeqe:talk-off`)),`Talk is ending.`):e===`sidebar`?(le()?ce(t===`closed`):c(t===`open`),`The sidebar is ${t}.`):n?(await Rt.settings(n,{headed:t===`shown`}),`Browser runs in this chat are ${t} now.`):`Browser runs are set per chat: open one first.`,fe=e===`settings`||e===`welcome`,pe=e=>{oe()?se(!0):f(!0),ae(e?{id:e,at:Date.now()}:null)};return(0,P.jsx)(Ks.Provider,{value:{hidden:r,open:()=>le()?ce(!1):c(!0),setChat:o,find:te},children:(0,P.jsx)(sr,{pages:Rs,find:ne,set:de,children:(0,P.jsx)(Sr,{children:(0,P.jsxs)(`div`,{className:`flex min-h-(--screen) bg-canvas`,children:[(0,P.jsx)(`a`,{href:`#content`,onClick:Ec,className:`sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70] focus:rounded-[8px] focus:bg-accent focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-accent-ink focus:no-underline`,children:`Skip to content`}),(0,P.jsxs)(`aside`,{style:{viewTransitionName:`app-sidebar`},className:D(`side-box sticky top-0 h-(--screen) flex-none overflow-hidden`,r?`w-16`:`w-[248px] min-[1440px]:w-[264px]`,fe?`hidden`:`hidden md:block`),children:[(0,P.jsx)(`div`,{className:D(`side-layer absolute inset-y-0 left-0`,r&&`invisible opacity-0`),children:w&&(0,P.jsx)(ac,{current:e,route:t,place:S,stats:a,onClose:()=>ce(!0)})}),(0,P.jsx)(`div`,{className:D(`side-layer absolute inset-y-0 left-0`,!r&&`invisible opacity-0`),children:(0,P.jsx)(uc,{current:e,route:S,onOpen:()=>ce(!1)})})]}),(0,P.jsx)(Cc,{open:s,side:`left`,label:`Sidebar`,wideAt:`(min-width: 768px)`,onClose:p,className:`md:hidden`,children:(0,P.jsx)(ac,{current:e,route:t,place:S,stats:a,onClose:()=>c(!1)})}),(0,P.jsxs)(`div`,{"data-screen":!0,className:`relative flex min-w-0 flex-1 flex-col`,children:[e!==`welcome`&&(0,P.jsx)(Hs,{route:t}),(0,P.jsx)(_c,{}),(0,P.jsx)(`div`,{"data-page-area":!0,className:`flex min-w-0 flex-1 flex-col`,children:n}),(0,P.jsx)(A,{variant:`icon`,size:`icon`,"aria-label":`Show the workspace panel`,"data-tip":`Show the workspace panel`,onClick:()=>pe(),className:D(`absolute top-2 right-3 z-30 md:hidden`,fe&&`hidden`),children:(0,P.jsx)(C,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,P.jsxs)(`div`,{style:{viewTransitionName:`app-panel`},className:D(`side-box sticky top-0 h-(--screen) w-14 flex-none overflow-hidden`,l&&`min-[1600px]:w-[264px]`,fe?`hidden`:`hidden md:block`),children:[(0,P.jsx)(`div`,{className:D(`side-layer absolute inset-y-0 right-0 hidden min-[1600px]:block`,!l&&`invisible opacity-0`),children:re&&(0,P.jsx)(vc,{stats:a,focus:ie,onClose:()=>se(!1)})}),(0,P.jsx)(`div`,{className:D(`side-layer absolute inset-y-0 right-0`,l&&`min-[1600px]:invisible min-[1600px]:opacity-0`),children:(0,P.jsx)(hc,{stats:a,onOpen:pe})})]}),_&&(0,P.jsx)(N.Suspense,{fallback:null,children:(0,P.jsx)(zs,{open:h,onClose:()=>g(!1),pages:Rs,query:y})}),(0,P.jsx)(Cc,{open:d,side:`right`,label:`Workspace panel`,wideAt:`(min-width: 1600px)`,onClose:m,className:`min-[1600px]:hidden`,children:(0,P.jsx)(vc,{stats:a,focus:ie,onClose:()=>f(!1)})}),(0,P.jsx)(Er,{})]})})})})}var Oc=`mx-auto box-border flex w-full max-w-[1320px] flex-col px-6 pt-8 pb-10 md:px-12 short:pt-6 short:pb-6`,kc=`box-border flex flex-col [--frame-left:max(0px,calc((100cqw_-_1320px)/2))] ml-(--frame-left) mr-auto w-[calc(100%_-_var(--frame-left))] max-w-[1320px] px-6 pt-8 pb-10 md:px-12 short:pt-6 short:pb-6`,Ac=`[--page-w:100cqw]`,jc=`@container [--wide-w:min(var(--wide-max,100000px),calc(var(--page-w)_-_48px))] md:[--wide-w:min(var(--wide-max,100000px),calc(var(--page-w)_-_96px))] w-(--wide-w) max-w-none self-start ml-[calc((100%_-_var(--wide-w))/2)]`;export{Ji as $,B as A,jr as At,ga as B,cr as Bt,Po as C,Br as Ct,Wa as D,Rr as Dt,Za as E,Hr as Et,G as F,Cr as Ft,la as G,_n as Gt,pa as H,F as Ht,Ra as I,wr as It,R as J,da as K,_a as L,_r as Lt,Ca as M,Lr as Mt,Sa as N,Pr as Nt,Oa as O,Ir as Ot,ya as P,Ar as Pt,na as Q,U as R,gr as Rt,Lo as S,Kr as St,Qa as T,Vr as Tt,Qi as U,wn as Ut,V,ar as Vt,fa as W,Cn as Wt,Zi as X,aa as Y,ta as Z,Bo as _,si as _t,bc as a,zi as at,Ro as b,oi as bt,Dc as c,Pi as ct,ks as d,ji as dt,qi as et,As as f,Mi as ft,Mo as g,wi as gt,No as h,Ci as ht,Ac as i,Bi as it,ma as j,Fr as jt,K as k,Mr as kt,Vs as l,ki as lt,ys as m,Oi as mt,kc as n,Ri as nt,Xs as o,Li as ot,ps as p,L as pt,z as q,jc as r,Wi as rt,Zs as s,Ni as st,Oc as t,Gi as tt,qs as u,Ai as ut,jo as v,ai as vt,Xa as w,zr as wt,Fo as x,Gr as xt,Io as y,ci as yt,ha as z,yr as zt};