@capagents/forgeqe 3.4.2 → 3.4.3

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 (114) hide show
  1. package/dist/docs-site/docs/search.js +1 -1
  2. package/dist/docs-site/docs/web-app/index.html +11 -2
  3. package/dist/forgeqe.js +1727 -1726
  4. package/dist/template.html +43 -43
  5. package/dist/web/assets/{3d-force-graph-B-g_aIro.js → 3d-force-graph-ChNz5Yhx.js} +1 -1
  6. package/dist/web/assets/{Agent-C5oBtGk7.js → Agent-CTRFDu9M.js} +10 -10
  7. package/dist/web/assets/{AgentWork-DJ8Vs06n.js → AgentWork-D1c_w9rM.js} +1 -1
  8. package/dist/web/assets/ApiTests-CHKwMgxN.js +17 -0
  9. package/dist/web/assets/{Browse-DLECqaFU.js → Browse-CcKh43L5.js} +1 -1
  10. package/dist/web/assets/Chat-CooI13qi.js +3 -0
  11. package/dist/web/assets/CommandPalette-D8AtIocY.js +1 -0
  12. package/dist/web/assets/{Compare-DaIqZceW.js → Compare-DPX2G5oF.js} +1 -1
  13. package/dist/web/assets/Cost-CBGk_xKN.js +1 -0
  14. package/dist/web/assets/{Data-DSoaKTFT.js → Data-CW95KX9u.js} +4 -4
  15. package/dist/web/assets/Desktop-C6-h0ExO.js +1 -0
  16. package/dist/web/assets/DesktopReview-C02n70Wx.js +2 -0
  17. package/dist/web/assets/DeviceScreen-DDERg3YQ.js +1 -0
  18. package/dist/web/assets/Evidence-DqTx1TS1.js +1 -0
  19. package/dist/web/assets/{Explore-CnsxID-z.js → Explore-DgaugrDO.js} +2 -2
  20. package/dist/web/assets/Features-DYr-izEt.js +1 -0
  21. package/dist/web/assets/{Flags-KtTYNU6g.js → Flags-DL-G7YWK.js} +2 -2
  22. package/dist/web/assets/Flaky-DOxneo4i.js +1 -0
  23. package/dist/web/assets/Impact-BuHHY2_3.js +3 -0
  24. package/dist/web/assets/{Jobs-Fj0wBOAO.js → Jobs-DEc49gwq.js} +3 -3
  25. package/dist/web/assets/{KindPage--MHC32ho.js → KindPage-DuLav-l5.js} +3 -3
  26. package/dist/web/assets/LiveDevice-PsN5gnXw.js +1 -0
  27. package/dist/web/assets/Migration-BcxL5Okw.js +8 -0
  28. package/dist/web/assets/Mobile-CBDmyoL5.js +1 -0
  29. package/dist/web/assets/Observability-Cqjko62E.js +1 -0
  30. package/dist/web/assets/{OwnItems-BWX70VhE.js → OwnItems-DXS-CMiC.js} +3 -3
  31. package/dist/web/assets/PageAgent-BzDuRR-t.js +1 -0
  32. package/dist/web/assets/Product-BKIKhNp3.js +6 -0
  33. package/dist/web/assets/Production-DKKynWrp.js +1 -0
  34. package/dist/web/assets/Quality-Dsh07yXp.js +1 -0
  35. package/dist/web/assets/Readiness-BbjzvgVB.js +1 -0
  36. package/dist/web/assets/Record-BIa-SPuU.js +1 -0
  37. package/dist/web/assets/Regression-DeQnXoZ4.js +5 -0
  38. package/dist/web/assets/RelationGraph-C7M_Zcx-.js +1 -0
  39. package/dist/web/assets/Reports-DsWA9Q7H.js +2 -0
  40. package/dist/web/assets/{Requirements-BRXFZQuu.js → Requirements-B-8D5JFY.js} +2 -2
  41. package/dist/web/assets/Responsive-Dl4CLUoF.js +3 -0
  42. package/dist/web/assets/RunDiff-C2knd045.js +1 -0
  43. package/dist/web/assets/Settings-Cmac0LZa.js +21 -0
  44. package/dist/web/assets/SiteScan-D2WMUVcw.js +5 -0
  45. package/dist/web/assets/Steps-DeZhIdc1.js +2 -0
  46. package/dist/web/assets/{TestData-4P28hX0Q.js → TestData-CDOvUmVT.js} +2 -2
  47. package/dist/web/assets/TestManagement-9CTQonHe.js +4 -0
  48. package/dist/web/assets/WhatsNew-BotUU9UF.js +1 -0
  49. package/dist/web/assets/{agentSettingsSheet-ElGgFEeo.js → agentSettingsSheet-BEVtvrGk.js} +1 -1
  50. package/dist/web/assets/answer-BCM85AEe.js +99 -0
  51. package/dist/web/assets/api-DS8XP38R.js +1 -0
  52. package/dist/web/assets/{dataParts-_MZY-U_N.js → dataParts-C5w2uvJZ.js} +3 -3
  53. package/dist/web/assets/desktopAppPath-BN4vYVi4.js +1 -0
  54. package/dist/web/assets/{flowTheme-BcMJKyow.js → flowTheme-dXvSLQHO.js} +1 -1
  55. package/dist/web/assets/frame-BANehQdX.js +139 -0
  56. package/dist/web/assets/index-Db_tsLSf.js +47 -0
  57. package/dist/web/assets/index-iQkL5bWO.css +2 -0
  58. package/dist/web/assets/{nav-DRpijFeN.js → nav-f8SqayfG.js} +1 -1
  59. package/dist/web/assets/{pageBack-CINGjBHZ.js → pageBack-DU3mApVL.js} +7 -7
  60. package/dist/web/assets/palette-D8aKJo_q.js +1 -0
  61. package/dist/web/assets/{paletteCommands-Bx61jZay.js → paletteCommands-DdFd3e0-.js} +1 -1
  62. package/dist/web/assets/parts-B0PK7ewd.js +1 -0
  63. package/dist/web/assets/{productParts-Pp0gh7QX.js → productParts-bcAIT4Ca.js} +1 -1
  64. package/dist/web/assets/qualityParts-C2Y38oFp.js +3 -0
  65. package/dist/web/assets/{recordTest-S5MOLSrL.js → recordTest-Cn4qoyRB.js} +1 -1
  66. package/dist/web/assets/sectionList-B6NF3ZMb.js +1 -0
  67. package/dist/web/assets/{stepper-B7sbuU1Q.js → stepper-CEFz82T4.js} +1 -1
  68. package/dist/web/assets/{preload-helper-BupTYkQW.js → surface-c1kG1KPS.js} +1 -1
  69. package/dist/web/assets/wizardParts-CGHmp8or.js +1 -0
  70. package/dist/web/index.html +9 -9
  71. package/docs/WEB_APP.md +12 -2
  72. package/forgeqe.example.yaml +4 -2
  73. package/package.json +1 -1
  74. package/dist/web/assets/ApiTests-BLCfYh51.js +0 -17
  75. package/dist/web/assets/Chat-Cv8DeS-_.js +0 -3
  76. package/dist/web/assets/CommandPalette-x_RA-vYW.js +0 -1
  77. package/dist/web/assets/Cost-CITIwCiU.js +0 -1
  78. package/dist/web/assets/Desktop-CSaj8gd9.js +0 -1
  79. package/dist/web/assets/DesktopReview-Dz5XOBgo.js +0 -2
  80. package/dist/web/assets/DeviceScreen-BHmTd9Q-.js +0 -1
  81. package/dist/web/assets/Evidence-WRJ5Ocx1.js +0 -1
  82. package/dist/web/assets/Features-Do6F_oaP.js +0 -1
  83. package/dist/web/assets/Flaky-BBPNCZOq.js +0 -1
  84. package/dist/web/assets/Impact-DXpXmLyE.js +0 -3
  85. package/dist/web/assets/LiveDevice-CuJzvCUi.js +0 -1
  86. package/dist/web/assets/Migration-6aYe_2EG.js +0 -8
  87. package/dist/web/assets/Mobile-Dv6f7u3D.js +0 -1
  88. package/dist/web/assets/Observability-Dqb01Eyo.js +0 -1
  89. package/dist/web/assets/PageAgent-CPVv-rb3.js +0 -1
  90. package/dist/web/assets/Product-Bg8GLZO1.js +0 -6
  91. package/dist/web/assets/Production-D_-UKwAW.js +0 -1
  92. package/dist/web/assets/Quality-AK4ooDrk.js +0 -1
  93. package/dist/web/assets/Readiness-oW5ApJNH.js +0 -1
  94. package/dist/web/assets/Record-DB3vbV-C.js +0 -1
  95. package/dist/web/assets/Regression-DuYa0h-o.js +0 -5
  96. package/dist/web/assets/RelationGraph-CrEnF6ZB.js +0 -1
  97. package/dist/web/assets/Reports-1mP0MxVQ.js +0 -2
  98. package/dist/web/assets/Responsive-CnoYMfsl.js +0 -3
  99. package/dist/web/assets/RunDiff-Wro2Olyz.js +0 -1
  100. package/dist/web/assets/Settings-DBCDjRxF.js +0 -21
  101. package/dist/web/assets/SiteScan-BkdOUe_S.js +0 -5
  102. package/dist/web/assets/Steps-ndafqk8T.js +0 -2
  103. package/dist/web/assets/TestManagement-Dohg2yyF.js +0 -4
  104. package/dist/web/assets/WhatsNew-Bcv9S0Tj.js +0 -1
  105. package/dist/web/assets/api-B8AQ8-Gb.js +0 -1
  106. package/dist/web/assets/desktopAppPath-Mg0cuo3X.js +0 -1
  107. package/dist/web/assets/frame-wloj3-xC.js +0 -139
  108. package/dist/web/assets/index-BCu9qAny.js +0 -47
  109. package/dist/web/assets/index-BEY6ZWQm.css +0 -2
  110. package/dist/web/assets/palette-DOQemIAv.js +0 -1
  111. package/dist/web/assets/parts-BNAiSyF0.js +0 -1
  112. package/dist/web/assets/qualityParts-diTrGtUR.js +0 -3
  113. package/dist/web/assets/sectionList-BPBmSZXk.js +0 -1
  114. package/dist/web/assets/wizardParts-OhFd_xL2.js +0 -1
@@ -0,0 +1,139 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/paletteCommands-DdFd3e0-.js","assets/route-9BkoTWUE.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-BDur5s0O.js","assets/sectionList-B6NF3ZMb.js","assets/line-icons-Cwj9OmCz.js","assets/coverage-DbHm8BUP.js","assets/logos-Cf-Wf5ex.js","assets/utils-DJRAScIl.js","assets/jsx-runtime-LKYXHABd.js","assets/CommandPalette-D8AtIocY.js","assets/surface-c1kG1KPS.js","assets/palette-D8aKJo_q.js","assets/api-DS8XP38R.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{a as n,r}from"./route-9BkoTWUE.js";import{B as i,I as a,L as o,P as s,R as c,V as l,a as u,c as d,f,o as p,u as m}from"./surface-c1kG1KPS.js";import{n as h,t as g}from"./utils-DJRAScIl.js";import{t as _}from"./jsx-runtime-LKYXHABd.js";import{A as v,H as y,I as b,K as x,L as S,M as C,P as w,U as T,W as E,a as D,c as O,n as k,o as A,q as j,r as M}from"./palette-D8aKJo_q.js";import{M as ee,a as N,d as P,f as te,i as F,m as I,t as ne,x as re}from"./sectionList-B6NF3ZMb.js";import{_t as ie,at as ae,b as L,et as oe,f as se,gt as ce,h as le,mt as ue,q as de,rt as fe,s as pe,u as R}from"./api-DS8XP38R.js";import{A as z,E as me,F as B,I as he,L as ge,M as _e,N as ve,P as V,S as ye,_ as be,a as xe,g as Se,i as Ce,j as we,k as Te,m as Ee,r as De,u as Oe,v as ke,y as Ae}from"./pageBack-DU3mApVL.js";import{$ as je,A as Me,An as Ne,At as Pe,B as Fe,C as Ie,Cn as Le,Cr as Re,Dn as ze,E as Be,Er as Ve,Et as He,Ft as Ue,Gn as We,Gr as Ge,Gt as Ke,I as qe,In as Je,Ir as Ye,Jn as Xe,K as Ze,Kn as Qe,Ln as $e,Lt as et,M as tt,Mn as nt,Mt as rt,N as it,Nn as at,Nr as ot,Nt as st,O as ct,On as lt,Ot as ut,Pn as dt,Pr as ft,Pt as pt,Qn as mt,Qt as ht,Rn as gt,Rt as _t,Sr as vt,Tr as yt,Tt as bt,U as xt,V as St,Vn as Ct,Vr as wt,W as Tt,Wn as Et,Wr as Dt,Wt as Ot,Xt as kt,Y as At,Z as jt,Zn as Mt,_n as Nt,_r as Pt,_t as Ft,a as It,ar as Lt,bn as Rt,br as zt,bt as Bt,c as Vt,cn as Ht,cr as Ut,d as Wt,dn as Gt,en as Kt,er as qt,et as Jt,f as Yt,ft as Xt,g as Zt,gn as Qt,h as $t,hr as en,i as tn,in as nn,ir as rn,it as an,jn as on,k as sn,kr as cn,kt as ln,l as un,m as dn,mr as fn,mt as pn,n as mn,nn as hn,nr as gn,nt as _n,o as vn,on as yn,or as bn,pr as xn,q as Sn,r as Cn,rn as wn,rr as Tn,s as En,sr as Dn,t as On,tn as kn,tr as An,tt as jn,u as Mn,un as Nn,ur as Pn,v as Fn,vn as In,vr as Ln,vt as Rn,w as zn,wr as Bn,wt as Vn,x as Hn,xr as Un,xt as Wn,y as Gn,yr as Kn,yt as qn,z as Jn,zn as Yn,zt as Xn}from"./line-icons-Cwj9OmCz.js";import{a as Zn,c as Qn,d as $n,f as er,l as tr,n as nr,o as rr,s as ir,t as ar}from"./nav-f8SqayfG.js";var H=e(t(),1),U=_();function or({checked:e,onChange:t,label:n,id:r,disabled:i}){return(0,U.jsx)(`button`,{type:`button`,role:`switch`,id:r,"aria-checked":e,"aria-label":n,disabled:i,onClick:()=>t(!e),className:g(`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,U.jsx)(`span`,{"aria-hidden":`true`,className:g(`absolute top-1/2 size-4 -translate-y-1/2 rounded-full bg-white shadow-[0_1px_2px_var(--shadow-float-ink)] left-0.5 transition-transform`,e&&`translate-x-4`)})})}function sr({open:e,id:t,className:n,children:r}){let[i,a]=(0,H.useState)(e),[o,s]=(0,H.useState)(e),[c,l]=(0,H.useState)(e);return(0,H.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,U.jsx)(`div`,{id:t,inert:!e||void 0,className:g(`collapse-box`,o&&`is-open`),onTransitionEnd:t=>{t.target===t.currentTarget&&t.propertyName===`grid-template-rows`&&(e?l(!0):a(!1))},children:(0,U.jsx)(`div`,{className:g(`min-h-0 min-w-0`,c?`overflow-visible`:`overflow-hidden`),children:(0,U.jsx)(`div`,{className:n,children:r})})}):null}var W=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{};function cr(e,t){let n=e;for(let e of t)n=W(n)[e];return n}var lr=e=>e===void 0||e===``||typeof e==`number`&&Number.isNaN(e);function ur(e,t,n){let[r,...i]=t;if(r===void 0)return e;let a={...e},o=i.length?ur(W(e[r]),i,n):n;return lr(o)||i.length&&lr(n)&&!Object.keys(W(o)).length?delete a[r]:a[r]=o,a}function dr(e,t,n){let r={};for(let[i,a]of Object.entries(e))r[i===t?n:i]=a;return r}function fr(e,t){if(!(t in e))return t;for(let n=2;;n++)if(!(`${t}-${n}`in e))return`${t}-${n}`}var pr=(e,t)=>JSON.stringify(e)===JSON.stringify(t),mr=(0,H.createContext)({pending:{},set:()=>{},saved:new Set,vars:{},store:`the credential store`}),hr=()=>(0,H.useContext)(mr);function gr(e){return/[\\/]/.test(e)?`ForgeQE's private credentials file (readable only by you)`:e}var _r=/^[A-Za-z_][A-Za-z0-9_]*$/;function vr(e,t){return t in e.pending?e.pending[t]===null?`removing`:`pending`:e.saved.has(t)?`saved`:e.vars[t]?`environment`:`missing`}var yr={pending:`Not saved yet`,removing:`Removed when you save`,saved:`Saved`,environment:`Set in the environment`,missing:`Not set`},br=(e,t)=>[`pending`,`saved`,`environment`].includes(vr(e,t));function xr({name:e}){let t=hr();if(!e)return null;if(!_r.test(e))return(0,U.jsx)(`span`,{className:`text-body-sm text-fail`,children:`Not a variable name`});let n=vr(t,e);return(0,U.jsx)(`span`,{className:g(`text-body-sm`,n===`saved`||n===`environment`?`text-pass`:n===`missing`?`text-muted`:`text-accent-fg`),children:yr[n]})}var Sr=/user|email|login|client_id|account/i;function Cr({id:e,name:t,field:n,onRename:r,compact:i}){let a=hr(),o=(0,H.useId)(),c=e||o,[l,u]=(0,H.useState)(!1),d=vr(a,t),f=typeof a.pending[t]==`string`?a.pending[t]:``,p=Sr.test(n)||Sr.test(t);return(0,U.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(s,{id:c,"aria-label":e?void 0:n,type:p?`text`:`password`,autoComplete:`off`,spellCheck:!1,value:f,disabled:!_r.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`:p?`Type it once`:`Paste it once`,onChange:e=>a.set(t,e.target.value||void 0)}),d===`saved`&&(0,U.jsx)(B,{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,U.jsx)(Re,{"aria-hidden":`true`})}),d===`removing`&&(0,U.jsxs)(B,{size:`sm`,"data-tip":`Keep the saved value of ${t}`,onClick:()=>a.set(t,void 0),children:[(0,U.jsx)(zn,{"aria-hidden":`true`}),`Keep`]})]}),!i&&(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-body-sm text-muted`,children:[(0,U.jsx)(xr,{name:t}),(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),l&&r?(0,U.jsx)(s,{size:`sm`,"aria-label":`Variable name`,autoFocus:!0,defaultValue:t,spellCheck:!1,onBlur:e=>{let n=e.target.value.trim();n&&_r.test(n)&&n!==t&&r(n),u(!1)},onKeyDown:e=>T(e)&&e.target.blur(),className:`max-w-[260px] font-mono`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{children:[`Kept as `,(0,U.jsx)(`span`,{className:`font-mono text-body-sm`,children:t})]}),r&&(0,U.jsxs)(B,{variant:`link`,size:`inline`,onClick:()=>u(!0),"data-tip":`Change the variable's name`,children:[(0,U.jsx)(Je,{"aria-hidden":`true`}),`Rename`]})]})]})]})}function wr({name:e}){return(0,U.jsx)(xr,{name:e})}function Tr({id:e,name:t,field:n,named:r,onName:i}){let a=hr();return(0,U.jsx)(Er,{onFirstValue:()=>{!r&&t&&i(t)},secrets:a,children:(0,U.jsx)(Cr,{id:e,name:t,field:n,onRename:i})})}function Er({secrets:e,onFirstValue:t,children:n}){return(0,U.jsx)(mr.Provider,{value:{...e,set:(n,r)=>{r&&t(),e.set(n,r)}},children:n})}function Dr({label:e,help:t,htmlFor:n,children:r,className:i,stacked:a,yamlKey:o}){let s=o?(0,U.jsx)(`code`,{className:`font-mono text-body-sm text-muted [overflow-wrap:anywhere]`,children:o}):null;return a?(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-4 py-4`,i),children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[n?(0,U.jsx)(`label`,{htmlFor:n,className:`text-body-sm leading-snug font-medium text-ink`,children:e}):(0,U.jsx)(`span`,{className:`text-body-sm leading-snug font-medium text-ink`,children:e}),t&&(0,U.jsx)(`span`,{className:`text-body-sm leading-relaxed text-ink-2`,children:t}),s]}),(0,U.jsx)(`div`,{className:`[&>*]:max-w-none`,children:r})]}):(0,U.jsxs)(`div`,{className:g(`flex min-h-16 flex-wrap items-center gap-x-10 gap-y-4 border-t border-line-soft py-4`,i),children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[n?(0,U.jsx)(`label`,{htmlFor:n,className:`text-body-sm leading-snug font-medium text-ink`,children:e}):(0,U.jsx)(`span`,{className:`text-body-sm leading-snug font-medium text-ink`,children:e}),t&&(0,U.jsx)(`span`,{className:`text-body-sm leading-relaxed text-ink-2`,children:t}),s]}),r!=null&&r!==!1&&(0,U.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,children:r})]})}var Or=`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,kr={"By how you asked":In,"Test runs":gt,"Speech on this computer":Vt,Conversation:Rt,"What went wrong":Ve,"What ForgeQE found":qn,Questions:qe,"The bug":Gn,"What is attached":dt,Send:qt,"Test case ids":Un,"Where runs happen":Qt,"The browser window":Cn,"Limits and checks":vt,"Remote browser, set here":xt,"Where tests go":ln,"How hard it tries":Et,"Help it gets":nn,Reports:Xt,"Memory and replays":Fn,Suites:Ht,"Flaky tests":Lt,"Release readiness":We,"Regression packs in a pipeline":lt,"Defect analysis":Gn,Accessibility:On,"Performance and visual changes":st,"API tests":wt,"The product":Zt,"Instructions and knowledge":dn,Capabilities:Dt,"Project report":Ie,"Report datasets":Pt,"Running in parallel":Sn,Driver:je,Appium:bn,"Devices on this computer":Kt,"TestMu AI devices":xt,"BrowserStack devices":xt,"Browser devices":hn,"Appium on this computer":bn,Maestro:Ln,"Windows desktop apps":Le,Runtime:At,"Tests in a container":bt,"The coding agents' workspace":Tt,"Browser in a container":_t,"How skills are used":Xn,Budgets:Ye,"Project folder":He,"ForgeQE in this folder":ut,Repository:ln,"Features to download":lt,Onboarding:We,"This computer":Kt,"A model":Ut,"Models file":pn,"Default model":Ut,"Product knowledge graph":ze,Repositories:ln,"Documents and links":wn,"Search service":dn,Documents:wn,"The product and its knowledge":Zt,"Building the graph":Dt,"The team's knowledge":ot,"Agent names":Kn,"Custom agents":$t,"Sign-ins":ht,"Recent runs":Ot,"Saved runs":Et,"Test data":Pt,"Areas of work":Xe,"Which model a call gets":Xe,Alerts:Wt,"When to alert":mn,Apps:hn,"By kind of run":Tn,"By run, newest first":Ot,Guides:dn,"Last 30 days":Hn,"Latest problems":Ve,"Links in alerts":yn,"Model calls":Rt,Plans:Nn,"Recent requests":kt,"Results and bugs":Fe,"What used the most":Vn,"Send a test":qt,Services:An,"Tools used":Dt,"What runs":gt,"Check the agent's domain knowledge":un,"Test cases and bugs":St,"Browser grids":xt,Notifications:Mn,"Other tools":Yt},Ar=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``),jr=g(`settings-card`,d);function Mr({children:e,className:t}){return(0,U.jsx)(`div`,{className:g(jr,t),children:e})}function Nr(e){return H.Children.toArray(e).flatMap(e=>(0,H.isValidElement)(e)&&e.type===H.Fragment?Nr(e.props.children):[e])}function Pr({children:e}){let t=[],n=[],r=null,i=()=>{r?.items.length&&n.push((0,U.jsx)(Mr,{children:r.items},r.key)),r=null};return Nr(e).forEach((e,a)=>{(0,H.isValidElement)(e)&&Lr.has(e.type)?(i(),n.push(e)):((0,H.isValidElement)(e)&&e.type===Ir&&i(),r||(r={key:`card-${a}`,items:[]},t.push(r)),r.items.push(e))}),i(),(0,U.jsx)(U.Fragment,{children:n})}var Fr=e=>typeof e==`string`?e.trim().replace(/^\d+\.\s*/,``):``;function Ir({children:e,help:t,first:n,icon:r}){let i=r??kr[Fr(e)];return(0,U.jsxs)(`div`,{"data-group-title":``,"data-tour":Ar(Fr(e)),className:g(`mb-4 flex flex-col gap-2`,n?`mt-0`:`mt-10`),children:[(0,U.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-body-lg leading-snug font-medium text-ink`,children:[i&&(0,U.jsx)(V,{icon:i,size:18,className:`flex-none text-icon`}),e]}),t&&(0,U.jsx)(`p`,{className:g(`m-0 text-body-sm leading-relaxed text-ink-2`,i&&`pl-8`),children:t})]})}var Lr=new Set([Pr]),Rr=e=>Array.isArray(e)?e.map(String).join(`, `):typeof e==`string`?e:``,zr=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean);function Br({id:e,value:t,onChange:n,placeholder:r,mono:i}){let[a,o]=(0,H.useState)(Rr(t)),[c,l]=(0,H.useState)(t);return JSON.stringify(c)!==JSON.stringify(t)&&(l(t),o(Rr(t))),(0,U.jsx)(s,{id:e,value:a,placeholder:r,className:g(i&&`font-mono text-body-sm`),onChange:e=>{o(e.target.value);let t=zr(e.target.value);l(t.length?t:void 0),n(t.length?t:void 0)}})}function Vr({def:e,edit:t,base:n,stacked:r}){let i=(0,H.useId)(),c=e.key?[...n,...e.key.split(`.`)]:n,l=cr(t.value,c),u=e=>t.set(ur(t.value,c,e)),d=`w-full`,f=t.file?c.join(`.`):void 0,p;switch(e.type){case`switch`:{let t=l===void 0?!!e.default:l===!0||l===`true`||l===`on`;return(0,U.jsx)(Dr,{label:e.label,help:e.help,yamlKey:f,children:(0,U.jsx)(or,{checked:t,onChange:u,label:e.label})})}case`select`:p=(0,U.jsxs)(a,{id:i,value:String(l===void 0?e.default??``:l),onChange:e=>u(e.target.value!==`false`&&e.target.value),className:`w-full`,children:[e.default===void 0&&(0,U.jsx)(`option`,{value:``,children:e.emptyLabel||`Not set`}),e.options.map(e=>(0,U.jsx)(`option`,{value:e.value,children:e.label},e.value))]});break;case`number`:p=(0,U.jsx)(s,{id:i,type:`number`,inputMode:`numeric`,value:l==null?``:String(l),placeholder:e.default===void 0?e.placeholder:String(e.default),onChange:e=>u(e.target.value===``?void 0:Number(e.target.value)),className:`w-full`});break;case`list`:p=(0,U.jsx)(`div`,{className:d,children:(0,U.jsx)(Br,{id:i,value:l,onChange:u,placeholder:e.placeholder})});break;case`kv`:p=(0,U.jsx)(`div`,{className:d,children:(0,U.jsx)(Hr,{id:i,value:l,onChange:u,placeholder:e.placeholder})});break;case`textarea`:p=(0,U.jsx)(o,{id:i,rows:3,value:l===void 0?``:String(l),placeholder:e.placeholder,onChange:e=>u(e.target.value),className:d});break;case`var`:{let t=String(l??e.default??e.placeholder??``);return p=(0,U.jsx)(`div`,{className:d,children:(0,U.jsx)(Tr,{id:i,name:t,field:e.key,named:l!==void 0||e.default!==void 0,onName:e=>u(e)})}),(0,U.jsx)(Dr,{label:e.label.replace(/ variable$/,``),help:e.help,htmlFor:i,stacked:r,yamlKey:f,children:p})}default:p=(0,U.jsx)(s,{id:i,type:e.type===`url`?`url`:`text`,value:l===void 0?``:String(l),placeholder:e.placeholder??(e.default===void 0?void 0:String(e.default)),spellCheck:e.type===`text`,onChange:e=>u(e.target.value),className:g(d,e.type===`path`&&`font-mono text-body-sm`)})}return(0,U.jsx)(Dr,{label:e.label,help:e.help,htmlFor:i,stacked:r,yamlKey:f,children:p})}function Hr({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(`
3
+ `),[a,s]=(0,H.useState)(i(t)),[c,l]=(0,H.useState)(t);return JSON.stringify(c)!==JSON.stringify(t)&&(l(t),s(i(t))),(0,U.jsx)(o,{id:e,rows:3,value:a,spellCheck:!1,placeholder:r??`NAME = value`,className:`font-mono`,onChange:e=>{s(e.target.value);let t={};for(let n of e.target.value.split(`
4
+ `)){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;l(r),n(r)}})}function Ur({defs:e,edit:t,base:n,stacked:r}){let i=cr(t.value,n),a=i&&typeof i==`object`&&!Array.isArray(i)?i:{};return(0,U.jsx)(U.Fragment,{children:e.filter(e=>!e.when||e.when(a)).map(e=>(0,U.jsx)(Vr,{def:e,edit:t,base:n,stacked:r},e.key))})}function Wr({title:e,meta:t,state:n,open:r,onToggle:i,lead:a,actions:o,children:s,expandable:c}){let l=(0,H.useId)();return(0,U.jsxs)(`div`,{className:`border-t border-line-soft`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 py-4`,children:[a,c===!1?(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e}),t&&(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:t})]}):(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":l,onClick:i,className:`flex min-w-0 flex-[1_1_260px] cursor-pointer items-center gap-4 border-0 bg-transparent p-0 text-left text-ink`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e}),t&&(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:t})]}),(0,U.jsx)(Be,{size:18,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform`,r&&`rotate-180`)})]}),n,o]}),c!==!1&&(0,U.jsx)(sr,{open:r,id:l,children:(0,U.jsx)(`div`,{className:`mb-4 border-l-2 border-line-soft pb-2 pl-4 sm:pl-6 [&>*:first-child]:border-t-0`,children:s})})]})}var Gr={idle:{speed:3e-4,distortion:.3,displacement:.12,fresnel:3.587},waiting:{speed:25e-5,distortion:.25,displacement:.1,fresnel:3.3},listening:{speed:6e-4,distortion:.4,displacement:.16,fresnel:3.9},thinking:{speed:.001,distortion:.5,displacement:.16,fresnel:3.8},speaking:{speed:8e-4,distortion:.4,displacement:.24,fresnel:4.2}},Kr=`
5
+ #define M_PI 3.1415926535897932384626433832795
6
+ uniform vec3 uLightAColor; uniform vec3 uLightAPosition; uniform float uLightAIntensity;
7
+ uniform vec3 uLightBColor; uniform vec3 uLightBPosition; uniform float uLightBIntensity;
8
+ uniform vec2 uSubdivision;
9
+ uniform vec3 uOffset;
10
+ uniform float uDistortionFrequency; uniform float uDistortionStrength;
11
+ uniform float uDisplacementFrequency; uniform float uDisplacementStrength;
12
+ uniform float uFresnelOffset; uniform float uFresnelMultiplier; uniform float uFresnelPower;
13
+ uniform float uTime;
14
+ varying vec3 vColor;
15
+
16
+ vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}
17
+ vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}
18
+ vec4 fade(vec4 t){return t*t*t*(t*(t*6.0-15.0)+10.0);}
19
+ float perlin4d(vec4 P){
20
+ vec4 Pi0 = floor(P); vec4 Pi1 = Pi0 + 1.0;
21
+ Pi0 = mod(Pi0, 289.0); Pi1 = mod(Pi1, 289.0);
22
+ vec4 Pf0 = fract(P); vec4 Pf1 = Pf0 - 1.0;
23
+ vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);
24
+ vec4 iy = vec4(Pi0.yy, Pi1.yy);
25
+ vec4 iz0 = vec4(Pi0.zzzz); vec4 iz1 = vec4(Pi1.zzzz);
26
+ vec4 iw0 = vec4(Pi0.wwww); vec4 iw1 = vec4(Pi1.wwww);
27
+ vec4 ixy = permute(permute(ix) + iy);
28
+ vec4 ixy0 = permute(ixy + iz0); vec4 ixy1 = permute(ixy + iz1);
29
+ vec4 ixy00 = permute(ixy0 + iw0); vec4 ixy01 = permute(ixy0 + iw1);
30
+ vec4 ixy10 = permute(ixy1 + iw0); vec4 ixy11 = permute(ixy1 + iw1);
31
+ vec4 gx00 = ixy00 / 7.0; vec4 gy00 = floor(gx00) / 7.0; vec4 gz00 = floor(gy00) / 6.0;
32
+ gx00 = fract(gx00) - 0.5; gy00 = fract(gy00) - 0.5; gz00 = fract(gz00) - 0.5;
33
+ vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);
34
+ vec4 sw00 = step(gw00, vec4(0.0));
35
+ gx00 -= sw00 * (step(0.0, gx00) - 0.5); gy00 -= sw00 * (step(0.0, gy00) - 0.5);
36
+ vec4 gx01 = ixy01 / 7.0; vec4 gy01 = floor(gx01) / 7.0; vec4 gz01 = floor(gy01) / 6.0;
37
+ gx01 = fract(gx01) - 0.5; gy01 = fract(gy01) - 0.5; gz01 = fract(gz01) - 0.5;
38
+ vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);
39
+ vec4 sw01 = step(gw01, vec4(0.0));
40
+ gx01 -= sw01 * (step(0.0, gx01) - 0.5); gy01 -= sw01 * (step(0.0, gy01) - 0.5);
41
+ vec4 gx10 = ixy10 / 7.0; vec4 gy10 = floor(gx10) / 7.0; vec4 gz10 = floor(gy10) / 6.0;
42
+ gx10 = fract(gx10) - 0.5; gy10 = fract(gy10) - 0.5; gz10 = fract(gz10) - 0.5;
43
+ vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);
44
+ vec4 sw10 = step(gw10, vec4(0.0));
45
+ gx10 -= sw10 * (step(0.0, gx10) - 0.5); gy10 -= sw10 * (step(0.0, gy10) - 0.5);
46
+ vec4 gx11 = ixy11 / 7.0; vec4 gy11 = floor(gx11) / 7.0; vec4 gz11 = floor(gy11) / 6.0;
47
+ gx11 = fract(gx11) - 0.5; gy11 = fract(gy11) - 0.5; gz11 = fract(gz11) - 0.5;
48
+ vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);
49
+ vec4 sw11 = step(gw11, vec4(0.0));
50
+ gx11 -= sw11 * (step(0.0, gx11) - 0.5); gy11 -= sw11 * (step(0.0, gy11) - 0.5);
51
+ vec4 g0000 = vec4(gx00.x,gy00.x,gz00.x,gw00.x); vec4 g1000 = vec4(gx00.y,gy00.y,gz00.y,gw00.y);
52
+ vec4 g0100 = vec4(gx00.z,gy00.z,gz00.z,gw00.z); vec4 g1100 = vec4(gx00.w,gy00.w,gz00.w,gw00.w);
53
+ vec4 g0010 = vec4(gx10.x,gy10.x,gz10.x,gw10.x); vec4 g1010 = vec4(gx10.y,gy10.y,gz10.y,gw10.y);
54
+ vec4 g0110 = vec4(gx10.z,gy10.z,gz10.z,gw10.z); vec4 g1110 = vec4(gx10.w,gy10.w,gz10.w,gw10.w);
55
+ vec4 g0001 = vec4(gx01.x,gy01.x,gz01.x,gw01.x); vec4 g1001 = vec4(gx01.y,gy01.y,gz01.y,gw01.y);
56
+ vec4 g0101 = vec4(gx01.z,gy01.z,gz01.z,gw01.z); vec4 g1101 = vec4(gx01.w,gy01.w,gz01.w,gw01.w);
57
+ vec4 g0011 = vec4(gx11.x,gy11.x,gz11.x,gw11.x); vec4 g1011 = vec4(gx11.y,gy11.y,gz11.y,gw11.y);
58
+ vec4 g0111 = vec4(gx11.z,gy11.z,gz11.z,gw11.z); vec4 g1111 = vec4(gx11.w,gy11.w,gz11.w,gw11.w);
59
+ vec4 norm00 = taylorInvSqrt(vec4(dot(g0000,g0000), dot(g0100,g0100), dot(g1000,g1000), dot(g1100,g1100)));
60
+ g0000 *= norm00.x; g0100 *= norm00.y; g1000 *= norm00.z; g1100 *= norm00.w;
61
+ vec4 norm01 = taylorInvSqrt(vec4(dot(g0001,g0001), dot(g0101,g0101), dot(g1001,g1001), dot(g1101,g1101)));
62
+ g0001 *= norm01.x; g0101 *= norm01.y; g1001 *= norm01.z; g1101 *= norm01.w;
63
+ vec4 norm10 = taylorInvSqrt(vec4(dot(g0010,g0010), dot(g0110,g0110), dot(g1010,g1010), dot(g1110,g1110)));
64
+ g0010 *= norm10.x; g0110 *= norm10.y; g1010 *= norm10.z; g1110 *= norm10.w;
65
+ vec4 norm11 = taylorInvSqrt(vec4(dot(g0011,g0011), dot(g0111,g0111), dot(g1011,g1011), dot(g1111,g1111)));
66
+ g0011 *= norm11.x; g0111 *= norm11.y; g1011 *= norm11.z; g1111 *= norm11.w;
67
+ float n0000 = dot(g0000, Pf0);
68
+ float n1000 = dot(g1000, vec4(Pf1.x, Pf0.yzw));
69
+ float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.zw));
70
+ float n1100 = dot(g1100, vec4(Pf1.xy, Pf0.zw));
71
+ float n0010 = dot(g0010, vec4(Pf0.xy, Pf1.z, Pf0.w));
72
+ float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));
73
+ float n0110 = dot(g0110, vec4(Pf0.x, Pf1.yz, Pf0.w));
74
+ float n1110 = dot(g1110, vec4(Pf1.xyz, Pf0.w));
75
+ float n0001 = dot(g0001, vec4(Pf0.xyz, Pf1.w));
76
+ float n1001 = dot(g1001, vec4(Pf1.x, Pf0.yz, Pf1.w));
77
+ float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));
78
+ float n1101 = dot(g1101, vec4(Pf1.xy, Pf0.z, Pf1.w));
79
+ float n0011 = dot(g0011, vec4(Pf0.xy, Pf1.zw));
80
+ float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.zw));
81
+ float n0111 = dot(g0111, vec4(Pf0.x, Pf1.yzw));
82
+ float n1111 = dot(g1111, Pf1);
83
+ vec4 fade_xyzw = fade(Pf0);
84
+ vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);
85
+ vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);
86
+ vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);
87
+ vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);
88
+ return 2.2 * mix(n_yzw.x, n_yzw.y, fade_xyzw.x);
89
+ }
90
+
91
+ vec3 getDisplacedPosition(vec3 p) {
92
+ vec3 d = p;
93
+ d += perlin4d(vec4(d * uDistortionFrequency + uOffset, uTime)) * uDistortionStrength;
94
+ float s = perlin4d(vec4(d * uDisplacementFrequency + uOffset, uTime));
95
+ return p + normalize(p) * s * uDisplacementStrength;
96
+ }
97
+ void main() {
98
+ vec3 displaced = getDisplacedPosition(position);
99
+ gl_Position = projectionMatrix * viewMatrix * vec4(displaced, 1.0);
100
+ float distanceA = (M_PI * 2.0) / uSubdivision.x;
101
+ float distanceB = M_PI / uSubdivision.x;
102
+ vec3 biTangent = cross(normal, tangent.xyz);
103
+ vec3 a = getDisplacedPosition(position + tangent.xyz * distanceA);
104
+ vec3 b = getDisplacedPosition(position + biTangent * distanceB);
105
+ vec3 n = normalize(cross(a - displaced, b - displaced));
106
+ float la = max(0.0, - dot(n, normalize(- uLightAPosition))) * uLightAIntensity;
107
+ float lb = max(0.0, - dot(n, normalize(- uLightBPosition))) * uLightBIntensity;
108
+ vec3 view = normalize(displaced - cameraPosition);
109
+ float fresnel = uFresnelOffset + (1.0 + dot(view, n)) * uFresnelMultiplier;
110
+ fresnel = pow(max(0.0, fresnel), uFresnelPower);
111
+ vec3 color = vec3(0.0);
112
+ color = mix(color, uLightAColor, la * fresnel);
113
+ color = mix(color, uLightBColor, lb * fresnel);
114
+ color = mix(color, vec3(1.0), clamp(pow(max(0.0, fresnel - 0.8), 3.0), 0.0, 1.0));
115
+ vColor = color;
116
+ }
117
+ `,qr=`
118
+ varying vec3 vColor;
119
+ void main() { gl_FragColor = vec4(vColor, 1.0); }
120
+ `;function Jr(){try{let e=document.createElement(`canvas`),t=e.getContext(`webgl2`)??e.getContext(`webgl`);return!!t&&typeof t.getParameter==`function`&&typeof t.createShader==`function`}catch{return!1}}function Yr(e,t){if(!t)return e;let[n,r,i]=[0,1,2].map(e=>{let n=Number(t[e]);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):0}),a=Math.max(n,r,i);return{speed:e.speed+n*8e-4,distortion:e.distortion+i*.35,displacement:e.displacement+(a<.05?0:a*.14),fresnel:e.fresnel+r*1.2}}async function Xr(e,t,n){let r=await ie(()=>import(`./three.module-D480w7q4.js`),[]),i=new r.WebGLRenderer({alpha:!0,antialias:!0,premultipliedAlpha:!1});i.setClearColor(0,0),i.setPixelRatio(Math.min(Math.max(window.devicePixelRatio||1,1),2)),i.setSize(t,t);let a=i.domElement;a.setAttribute(`aria-hidden`,`true`),Object.assign(a.style,{width:`100%`,height:`100%`,display:`block`,borderRadius:`50%`}),e.appendChild(a);let o=new r.Scene,s=new r.PerspectiveCamera(25,1,.1,15);s.position.set(0,0,5.7);let c=new r.SphereGeometry(1,128,128);c.computeTangents();let l=new r.Color(n.colours[0]),u=new r.Color(n.colours[1]),d=Gr[n.mood],f={uLightAColor:{value:l},uLightAPosition:{value:new r.Vector3().setFromSpherical(new r.Spherical(1,.615,2.049))},uLightAIntensity:{value:1.85},uLightBColor:{value:u},uLightBPosition:{value:new r.Vector3().setFromSpherical(new r.Spherical(1,2.561,-1.844))},uLightBIntensity:{value:1.4},uSubdivision:{value:new r.Vector2(128,128)},uOffset:{value:new r.Vector3},uDistortionFrequency:{value:1.5},uDistortionStrength:{value:d.distortion},uDisplacementFrequency:{value:2.12},uDisplacementStrength:{value:d.displacement},uFresnelOffset:{value:-1.609},uFresnelMultiplier:{value:d.fresnel},uFresnelPower:{value:1.793},uTime:{value:Math.random()*10}},p=new r.ShaderMaterial({uniforms:f,vertexShader:Kr,fragmentShader:qr,defines:{USE_TANGENT:``},depthWrite:!1,transparent:!0});o.add(new r.Mesh(c,p));let m=new r.Spherical(1,Math.random()*Math.PI,Math.random()*Math.PI*2),h=new r.Vector3,g={...d},_=d,v=performance.now(),y=0,b=0,x=e=>{let t=Math.min(e-v,64);v=e;let r=Yr(_,n.levels?.()??null);for(let e of[`speed`,`distortion`,`displacement`,`fresnel`])g[e]+=(r[e]-g[e])*Math.min(1,(r[e]>g[e]?.012:.004)*t);let a=t*g.speed;y+=a,f.uDistortionStrength.value=g.distortion,f.uDisplacementStrength.value=g.displacement,f.uFresnelMultiplier.value=g.fresnel;let c=y*.3*1e3;m.phi=(Math.sin(c*.001)*Math.sin(c*.00321)*.5+.5)*Math.PI,m.theta=(Math.sin(c*1e-4)*Math.sin(c*321e-6)*.5+.5)*Math.PI*2,h.setFromSpherical(m).multiplyScalar(g.speed*2),f.uOffset.value.add(h),f.uTime.value+=a,i.render(o,s)},S=e=>{x(e),b=requestAnimationFrame(S)},C=()=>{cancelAnimationFrame(b),b=0,!document.hidden&&!n.still&&(v=performance.now(),b=requestAnimationFrame(S))};return x(v),n.still||(b=requestAnimationFrame(S)),document.addEventListener(`visibilitychange`,C),{mood(e){_=Gr[e],n.still&&(Object.assign(g,_),x(performance.now()))},colours(e,t){l.set(e),u.set(t),n.still&&x(performance.now())},destroy(){cancelAnimationFrame(b),document.removeEventListener(`visibilitychange`,C),c.dispose(),p.dispose(),i.dispose(),a.remove()}}}var Zr=[`#0284c7`,`#7cc4ee`],Qr=/^(#[0-9a-f]{3}|#[0-9a-f]{6}|rgba?\([\d\s.,%]+\))$/i;function $r(e=e=>getComputedStyle(document.documentElement).getPropertyValue(e)){let t=(t,n)=>{let r=e(t).trim();return Qr.test(r)?r:n};return[t(`--color-accent`,Zr[0]),t(`--color-accent-grad`,Zr[1])]}function ei({mood:e,look:t,px:n,tint:r,levels:i,label:a,className:o}){let s=(0,H.useRef)(null),l=(0,H.useRef)(null),[u,d]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let t=s.current;if(!t||!Jr())return;let r=!1;return Xr(t,n,{mood:e,colours:$r(),still:c(),levels:i}).then(e=>{if(r)return e.destroy();l.current=e,d(!0)}).catch(()=>d(!1)),()=>{r=!0,l.current?.destroy(),l.current=null,d(!1)}},[n]),(0,H.useEffect)(()=>l.current?.mood(e),[e,u]),(0,H.useEffect)(()=>{l.current&&l.current.colours(...$r())},[r,u]),(0,U.jsxs)(`div`,{...a?{role:`img`,"aria-label":a}:{"aria-hidden":!0},"data-sphere":u?`3d`:`dots`,className:g(`relative flex flex-none items-center justify-center overflow-hidden rounded-full`,o),style:{width:n,height:n},children:[(0,U.jsx)(`div`,{ref:s,className:`absolute inset-0`}),!u&&(0,U.jsx)(_e,{state:t,px:Math.round(n*.6)})]})}var ti=null,ni=null,ri=null;function ii(e,t){ti=e,ni=t,vi()}function ai(e){let t=e.createAnalyser();return t.fftSize=256,t.smoothingTimeConstant=.7,t}function oi(e){let t=Math.floor(e.length/2),n=Math.max(1,Math.floor(t/3)),r=t=>{let r=0;for(let i=t;i<t+n&&i<e.length;i++)r+=e[i];return Math.min(1,Math.max(0,r/n/255))};return[r(0),r(n),r(n*2)]}var si=e=>(ri&&ri.length===e.frequencyBinCount||(ri=new Uint8Array(e.frequencyBinCount)),e.getByteFrequencyData(ri),oi(ri));function ci(){let e=ti??pi;if(!e&&!ni)return null;let t=e?si(e).map(e=>Math.min(1,e*1.5)):[0,0,0],n=ni?si(ni):[0,0,0];return[Math.max(t[0],n[0]),Math.max(t[1],n[1]),Math.max(t[2],n[2])]}var li=`forgeqe:orb-sound`,ui=`forgeqe.voice.orb-sound`,di=()=>{try{return localStorage.getItem(ui)!==`off`}catch{return!0}},fi=e=>{try{localStorage.setItem(ui,e?`on`:`off`)}catch{}window.dispatchEvent(new Event(li)),vi()},pi=null,mi=null,hi=!1,gi=!1,_i=0;function vi(){_i>0&&di()&&!gi&&!ti?pi||hi||typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia||typeof AudioContext>`u`||(hi=!0,navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!1,autoGainControl:!0,channelCount:1}}).then(e=>{if(hi=!1,_i<=0||!di()||ti)return e.getTracks().forEach(e=>e.stop());let t=new AudioContext,n=ai(t);t.createMediaStreamSource(e).connect(n);let r=()=>void t.resume().catch(()=>{});window.addEventListener(`pointerdown`,r),window.addEventListener(`keydown`,r),r(),pi=n,mi=()=>{window.removeEventListener(`pointerdown`,r),window.removeEventListener(`keydown`,r),e.getTracks().forEach(e=>e.stop()),t.close().catch(()=>{})}}).catch(()=>{hi=!1,gi=!0})):(mi?.(),mi=null,pi=null)}function yi(){_i++,vi();let e=!1;return()=>{e||(e=!0,_i--,vi())}}var bi=`(max-height: 820px)`,xi=()=>(0,H.useSyncExternalStore)(e=>{let t=typeof matchMedia==`function`?matchMedia(bi):null;return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},()=>typeof matchMedia==`function`&&matchMedia(`(max-height: 820px)`).matches,()=>!1);function Si({open:e,onClose:t,title:n,description:r,children:i,footer:a,wide:o,bare:s}){let c=(0,H.useRef)(null),l=(0,H.useId)(),u=(0,H.useRef)({title:n,description:r,children:i,footer:a});e&&(u.current={title:n,description:r,children:i,footer:a});let[d,f]=(0,H.useState)(!1),p=e?{title:n,description:r,children:i,footer:a}:u.current;return(0,H.useEffect)(()=>{let t=c.current;if(!t)return;if(e){t.classList.remove(`is-closing`),f(!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`),f(!0);let n=setTimeout(()=>{t.classList.remove(`is-closing`),f(!1),t.close()},150);return()=>clearTimeout(n)},[e]),(0,U.jsxs)(`dialog`,{ref:c,"aria-labelledby":s?void 0:l,"aria-label":s?n:void 0,onCancel:e=>{e.target===c.current&&(e.preventDefault(),t())},onClick:e=>{e.target===c.current&&t()},className:g(j,`sheet bg-canvas backdrop-blur-none fixed inset-y-0 right-0 left-auto m-0 h-[calc(100dvh/var(--ui-zoom))] max-h-none w-full rounded-r-none border-0 p-0 backdrop:bg-[rgba(15,23,42,0.2)]`,o?`max-w-[760px]`:`max-w-[480px]`),children:[(e||d)&&s&&(0,U.jsx)(`div`,{className:`h-full`,children:p.children}),(e||d)&&!s&&(0,U.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-4 px-6 pt-6 pb-4`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`h2`,{id:l,className:`m-0 text-headline-sm`,children:p.title}),p.description&&(0,U.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-muted`,children:p.description})]}),(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Close`,"data-tip":`Close`,onClick:t,className:`-mt-1 -mr-2`,children:(0,U.jsx)(Ge,{size:20,"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`sheet-body flex-1 overflow-y-auto px-6 pb-6`,children:p.children}),(0,U.jsx)(`div`,{className:`flex flex-wrap justify-end gap-2 px-6 py-4`,children:p.footer})]})]})}var Ci=null,wi=null;function Ti(){if(!Ci||Date.now()-Ci.at>1e4){let e=de.list().then(e=>wi=e.personas,e=>{throw Ci=null,e});Ci={at:Date.now(),list:e}}return Ci.list}var Ei=e=>new Set(e.flatMap(e=>[e.handle,e.id])),Di=()=>wi?Ei(wi):null;function Oi(e){let[t,n]=(0,H.useState)(Di);return(0,H.useEffect)(()=>{if(!e)return;let t=!1;return Ti().then(e=>!t&&n(Ei(e)),()=>{}),()=>{t=!0}},[e]),t}var ki=2048,Ai=/\.(png|jpe?g|gif|webp|bmp|avif|svg|ico|heic|heif|tiff?)$/i,ji=new Set([`image/png`,`image/jpeg`,`image/webp`,`image/gif`]),Mi=e=>Ai.test(e),Ni=e=>e.type.startsWith(`image/`)||Ai.test(e.name),Pi=e=>/\.(png|jpe?g|gif|webp)$/i.test(e);function Fi(e){return e.replace(/^.*[\\/]/,``).replace(/\.[^.]*$/,``).replace(/[^A-Za-z0-9._-]+/g,`-`).replace(/^[-.]+|(?<!-)-+$/g,``).slice(0,60)||`image`}var Ii=0;function Li(e=new Date){let t=e=>String(e).padStart(2,`0`);return`pasted-${e.getFullYear()}${t(e.getMonth()+1)}${t(e.getDate())}-${t(e.getHours())}${t(e.getMinutes())}${t(e.getSeconds())}-${++Ii}`}var Ri=e=>!e||/^image\.(png|jpe?g|gif|webp|bmp)$/i.test(e);async function zi(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}async function Bi(e){if(e.type!==`image/svg+xml`)try{let t=await createImageBitmap(e,{imageOrientation:`from-image`});return{source:t,width:t.width,height:t.height,close:()=>t.close()}}catch{}let t=await Vi(e);try{let e=new Image;e.decoding=`async`,e.src=t,await e.decode();let n=e.naturalWidth||1024;return{source:e,width:n,height:e.naturalHeight||Math.round(n*.75)}}catch{throw Error(`This browser cannot read that image. Save it as PNG or JPEG and attach it again.`)}}function Vi(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(Error(`The image could not be read.`)),r.readAsDataURL(e)})}function Hi(e,t){let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}function Ui(e,t,n){return new Promise(r=>e.toBlob(r,t,n))}function Wi(e){let t=e.getContext(`2d`);if(!t)return!1;let{data:n}=t.getImageData(0,0,e.width,e.height),r=Math.max(1,Math.floor(n.length/4/25e4))*4;for(let e=3;e<n.length;e+=r)if(n[e]<255)return!0;return!1}async function Gi(e,t={}){let n=t.max??5242880,r=t.name??e.name??``,i=Ri(r)?Li():Fi(r);if(e.type===`image/gif`&&e.size<=n){let t=await Bi(e).catch(()=>null);if(t?.close?.(),t)return{name:`${i}.gif`,type:`image/gif`,data:await zi(e),width:t.width,height:t.height,changed:!1}}let a=await Bi(e);try{let t=Math.min(1,ki/Math.max(a.width,a.height));for(let o=0;o<6;o++){let o=Math.max(1,Math.round(a.width*t)),s=Math.max(1,Math.round(a.height*t)),c=Hi(o,s),l=c.getContext(`2d`);if(!l)throw Error(`This browser cannot draw the image.`);l.imageSmoothingQuality=`high`,l.drawImage(a.source,0,0,o,s);let u=Wi(c),d=/^image\/(jpeg|heic|heif|avif)$/.test(e.type)||/\.(jpe?g|heic|heif|avif)$/i.test(r),f=u?[[`image/png`,void 0],[`image/webp`,.92],[`image/webp`,.8]]:d?[[`image/jpeg`,.9],[`image/jpeg`,.8],[`image/jpeg`,.7]]:[[`image/png`,void 0],[`image/webp`,.92],[`image/jpeg`,.9],[`image/jpeg`,.8],[`image/jpeg`,.7]];for(let[e,t]of f){let r=await Ui(c,e,t);if(r&&r.type===e&&ji.has(e)&&r.size<=n)return{name:`${i}${e===`image/png`?`.png`:e===`image/webp`?`.webp`:`.jpg`}`,type:e,data:await zi(r),width:o,height:s,changed:!0}}t*=.75}throw Error(`The image could not be made small enough to attach.`)}finally{a.close?.()}}var Ki=/<!-- (?:attached-files|forgeqe:files)\s*([\s\S]*?)-->\s*/,qi=/^(?:\.forgeqe\/inbox\/[A-Za-z0-9][A-Za-z0-9._-]*|(?:[A-Za-z0-9][A-Za-z0-9 ._-]*\/)*[A-Za-z0-9][A-Za-z0-9 ._-]*\/?)$/,Ji=/\.(png|jpe?g|gif|webp)$/i,Yi=e=>Ji.test(e),Xi=/\.(png|jpe?g|gif|webp|pdf|docx|xlsx|pptx|md|txt|csv|tsv|json|xml|ya?ml|tsx?|jsx?|mjs|cjs|py|java|cs|go|rb|sql|log|feature|toml|ini|sh|ps1)$/i,Zi=e=>Xi.test(e),Qi=/\.(docx|xlsx|pptx)$/i,$i=e=>Qi.test(e);function ea(e){let t=/\.(doc|xls|ppt)$/i.exec(e);return t?`.${t[1].toLowerCase()}x`:void 0}var ta=e=>/\s/.test(e)?`@"${e}"`:`@${e}`;function na(e,t){let n=ta(t),r=e.indexOf(n);for(;r>=0;){let t=r+n.length;if((r===0||/\s/.test(e[r-1]))&&(t===e.length||/\s/.test(e[t])))return e.slice(0,r)+e.slice(t).replace(/^ /,``);r=e.indexOf(n,r+1)}return e}function ra(e,t){return na(e,t)!==e}function ia(e){let t=e.endsWith(`/`)&&e.length>1,n=t?e.slice(0,-1):e,r=n.lastIndexOf(`/`),i=t?`/`:``;return r<=0?{name:`${n}${i}`,dir:``}:{name:`${n.slice(r+1)}${i}`,dir:n.slice(0,r)}}function aa(e,t){if(t<0||t>e.length)return null;let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0||r>0&&/[\w./]/.test(n[r-1]))return null;let i=n.slice(r+1);return i.length>200?null:i.startsWith(`"`)?/["@\n]/.test(i.slice(1))?null:{start:r,query:i.slice(1)}:/[\s@"]/.test(i)?null:{start:r,query:i}}function oa(e,t,n,r){let i=`${ta(r)} `;return{text:`${e.slice(0,t)}${i}${e.slice(n)}`,cursor:t+i.length}}function sa(e,t){let n=e.trim(),r=t.filter(e=>e.path);if(!r.length)return n;let i=r.flatMap(e=>e.text?[`- ${e.path}`,`- ${e.text}`]:[`- ${e.path}`]).join(`
121
+ `);return`<!-- attached-files\nRead these files with your tools; each path is relative to your working folder:\n${r.some(e=>e.text)?`A Word, Excel or PowerPoint file is listed with a .md copy of its text after it: read the copy.
122
+ `:``}${i}\n-->\n${n}`.trim()}function ca(e){let t=Ki.exec(e),n=t?t[1].split(/\r?\n/).map(e=>e.replace(/^- /,``).trim()).filter(e=>qi.test(e)):[],r=n.filter(e=>!(e.endsWith(`.md`)&&$i(e.slice(0,-3))&&n.includes(e.slice(0,-3))));return{body:e.replace(Ki,``).replace(/^(?:<!--[\s\S]*?-->\s*)+/,``).trim(),files:r}}function la(e,t){let n=/(^|\s)\/([a-z0-9-]{0,40})$/i.exec(e.slice(0,t));return!n||!/^[a-z0-9-]*(\s|$)/i.test(e.slice(t))?null:{start:n.index+n[1].length,query:n[2].toLowerCase()}}var ua=/^\/[a-z][a-z0-9-]{0,39}(?=\s|$)/,da=/(^|\s)(@"[^"\n]+"|@[^\s@"]*[^\s@".,;:!?)\]])/g,fa=/(^|\s)\/([a-z][a-z0-9-]{0,39})(?=[\s.,;:!?)]|$)/g;function pa(e,t){let n=[];for(let t of e.matchAll(da))n.push({start:t.index+t[1].length,text:t[2],mark:`file`});for(let r of e.matchAll(fa)){let e=r.index+r[1].length;(t?t.has(r[2]):e===0)&&n.push({start:e,text:`/${r[2]}`,mark:`persona`})}n.sort((e,t)=>e.start-t.start);let r=[],i=0;for(let t of n)t.start<i||(t.start>i&&r.push({text:e.slice(i,t.start)}),r.push({text:t.text,mark:t.mark}),i=t.start+t.text.length);return i<e.length&&r.push({text:e.slice(i)}),r}function ma(e){let t=ua.exec(e.trimStart());return t?{command:t[0],rest:e.trimStart().slice(t[0].length).trim()}:{command:``,rest:e}}function ha(e,t,n){let{command:r,rest:i}=ma(e),a=t.trim(),o=[...new Set([...i.matchAll(da)].map(e=>e[2]))].filter(e=>![...a.matchAll(da)].some(t=>t[2]===e)),s=e=>[...e.matchAll(fa)].map(e=>e[2]).filter(e=>n?.has(e)),c=[...new Set(s(i))].filter(e=>e!==r.slice(1)&&!s(a).includes(e));return c.length&&(a=`${a}\n\nPersonas: ${c.map(e=>`/${e}`).join(` `)}`),o.length&&(a=`${a}\n\nFiles: ${o.join(` `)}`),r&&ma(a).command!==r&&(a=`${r} ${a}`),a.trim()}var ga=8;function _a(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=String(r.result||``),n=e.indexOf(`,`);t(n>=0?e.slice(n+1):``)},r.onerror=()=>n(Error(`The file could not be read.`)),r.readAsDataURL(e)})}function va({path:e,name:t,note:n}){let r=ia(e),i=n||r.dir;return(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,U.jsx)(`span`,{className:`max-w-full truncate text-body-sm font-medium leading-tight text-ink`,children:t||r.name}),i?(0,U.jsx)(`span`,{className:`max-w-full truncate text-body-sm leading-tight text-muted`,"data-tip":e||void 0,children:i}):null]})}function ya({file:e,scope:t,onView:n}){let r=e.pending&&e.pending.type.startsWith(`image/`)&&Yi(e.name)?`data:${e.pending.type};base64,${e.pending.data}`:``,[i,a]=(0,H.useState)(``),o=`${t.chat||``}|${t.code===!1?0:1}`;(0,H.useEffect)(()=>{if(a(``),r||!e.path||!Yi(e.path))return;let n=!1;return L.openFile(e.path,t).then(e=>!n&&e.kind===`image`&&a(e.url)).catch(()=>{}),()=>{n=!0}},[e.path,r,o]);let s=r||i;if(!s)return null;let c=(0,U.jsx)(`img`,{src:s,alt:``,className:g(u,`size-8 flex-none`)});return n?(0,U.jsx)(`button`,{type:`button`,"aria-label":`Preview ${e.name}`,"data-tip":`Preview`,onClick:()=>n(s),className:`inline-flex flex-none cursor-zoom-in border-0 bg-transparent p-0`,children:c}):c}function ba({text:e,scope:t={}}){let{body:n,files:r}=ca(e),[i,a]=(0,H.useState)(``);return!n&&!r.length?null:(0,U.jsxs)(`div`,{className:`ml-auto flex max-w-[min(85%,640px)] flex-col items-end gap-2`,children:[r.length>0&&(0,U.jsx)(`ul`,{"aria-label":`Attached files`,className:`m-0 flex list-none flex-wrap justify-end gap-2 p-0`,children:r.map(e=>(0,U.jsx)(`li`,{className:`inline-flex max-w-full`,children:e.endsWith(`/`)?(0,U.jsx)(`span`,{className:`inline-flex max-w-full items-center gap-2 rounded-sm bg-surface-strong px-2 py-2`,children:(0,U.jsx)(va,{path:e})}):(0,U.jsxs)(B,{"data-tip":`Open ${e}`,onClick:async()=>{a(``),a(await we(e,e=>L.openFile(e,t)))},className:`max-w-full justify-start py-1 pl-1 text-left`,children:[(0,U.jsx)(ya,{file:{path:e,name:ia(e).name},scope:t}),(0,U.jsx)(va,{path:e})]})},e))}),i&&(0,U.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:i}),n&&(0,U.jsx)(`div`,{className:g(`rounded-md bg-bg px-4 py-2 text-ink shadow-md [overflow-wrap:anywhere]`,`text-body-lg leading-relaxed whitespace-pre-wrap`),children:n})]})}function xa({file:e,scope:t,onRemove:n,onView:r}){return(0,U.jsxs)(`span`,{className:`inline-flex max-w-[260px] items-center gap-2 rounded-sm bg-surface-strong py-2 pr-1 pl-2`,children:[(0,U.jsx)(ya,{file:e,scope:e.scope??t,onView:r}),(0,U.jsx)(va,{path:e.path,name:e.name,note:e.pending?`Saves when you send`:void 0}),(0,U.jsx)(B,{variant:`icon`,size:`icon-xs`,className:`self-start`,type:`button`,"aria-label":`Remove ${e.name}`,"data-tip":`Remove ${e.name}`,onClick:n,children:(0,U.jsx)(Ge,{size:12,"aria-hidden":`true`})})]})}async function Sa(e,t,n){try{let r=await L.openFile(e,n),i=await fetch(r.url,{credentials:`same-origin`});if(!i.ok)return null;let a=t.replace(/\.[^.]*$/,``),o=await Gi(await i.blob(),{name:`${a}-picture`}),s=await L.attachFile({name:o.name,type:o.type,data:o.data},n);return{id:s.path,path:s.path,name:s.name,kind:`upload`,image:!0,scope:n,copyOf:e}}catch{return null}}var Ca=716800,wa=5242880,Ta=52428800;function Ea(e,t,n,r={}){let[i,a]=(0,H.useState)([]),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)([]),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(0),[_,v]=(0,H.useState)(`file`),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(null),E=(0,H.useRef)(null),D=(0,H.useRef)(0),O=(0,H.useRef)(0),k=(0,H.useRef)(null),A=(0,H.useRef)(0),j=(0,H.useRef)(e);j.current=e;let M=(0,H.useRef)(i),ee=(0,H.useRef)(r);ee.current=r;let N=`${r.chat||``}|${r.code===!1?0:1}`,P=e=>{M.current=e,a(e)},te=e=>{let t=++A.current;_===`persona`?(b(!0),Ti().then(n=>{t===A.current&&(l(n.filter(t=>t.handle.startsWith(e)||t.id.startsWith(e)).slice(0,8).map(e=>({path:`/${e.handle}`,name:e.name,role:e.role}))),h(0))}).catch(e=>t===A.current&&s(`The personas did not load: ${e.message}`)).finally(()=>t===A.current&&b(!1))):L.files(e,ee.current).then(e=>{t===A.current&&(l(e.files),h(0))}).catch(e=>t===A.current&&s(e.message))};(0,H.useEffect)(()=>{if(f===null)return;let e=setTimeout(()=>te(f),80);return()=>clearTimeout(e)},[f,N,_]),(0,H.useEffect)(()=>{u&&document.getElementById(`${n}-file-${m}`)?.scrollIntoView({block:`nearest`})},[u,m,n]);let F=()=>{++A.current,d(!1),p(null),l([]),E.current=null},I=e=>{let t=M.current;return e.path&&t.some(t=>t.path===e.path)?``:e.pending&&t.some(t=>t.kind===`upload`&&t.name===e.name)?`${e.name} is already attached.`:t.length>=ga?`At most ${ga} files go with one message.`:(P([...t,e]),``)},ne=e=>{e.kind===`upload`&&e.path&&L.dropFile(e.path,e.scope??ee.current).catch(e=>s(e.message))},re=e=>{let n=M.current.find(t=>(t.id||t.path||t.name)===e);if(n){if(P(M.current.filter(e=>e!==n)),ne(n),n.kind===`project`){let e=na(j.current,n.name);e!==j.current&&t(e)}s(``)}},ie=e=>{requestAnimationFrame(()=>{let t=document.getElementById(n);t?.focus(),t?.setSelectionRange(e,e)})},ae=e=>{if(_===`persona`){let n=j.current,r=n.slice(O.current).replace(/^[a-z0-9-]*/i,``);F();let i=`${n.slice(0,D.current)}${e.path} `;t(`${i}${r.replace(/^\s+/,``)}`),ie(i.length);return}let n=E.current,r=I({id:e.path,path:e.path,name:e.name,kind:`project`,image:Yi(e.path)});if(s(r),F(),!n||r)return;let i=oa(j.current,n.start,O.current,e.name);t(i.text),ie(i.cursor)},oe=(e,t)=>{O.current=t;let n=j.current;if(e!==n){let t=M.current.filter(t=>t.kind===`project`&&ra(n,t.name)&&!ra(e,t.name));t.length&&P(M.current.filter(e=>!t.includes(e)))}let r=la(e,t);if(r!==null){E.current=null,D.current=r.start,_!==`persona`&&(++A.current,l([])),u&&_===`persona`||b(!0),v(`persona`),p(r.query),d(!0);return}let i=aa(e,t);i?(E.current=i,_!==`file`&&(++A.current,l([])),v(`file`),p(i.query),d(!0)):u&&F()},se=e=>u?e.key===`ArrowDown`?(e.preventDefault(),h(e=>Math.min(e+1,Math.max(c.length-1,0))),!0):e.key===`ArrowUp`?(e.preventDefault(),h(e=>Math.max(e-1,0)),!0):e.key===`Escape`?(e.preventDefault(),F(),!0):(T(e)||e.key===`Tab`)&&!e.shiftKey&&c[m]?(e.preventDefault(),O.current=e.currentTarget.selectionStart??O.current,ae(c[m]),!0):!1:!1,ce=e=>{s(``);let t=[...e];(async()=>{let e=[];for(let n of t){if(!n.size){e.push(`${n.name||`The pasted file`} is empty.`);continue}if(Ni(n)){if(n.size>Ta){e.push(`${n.name} is over ${Ta/1024/1024} MB: save a smaller copy and attach that.`);continue}try{let t=await Gi(n),r=I({id:`pending:${t.name}:${n.size}:${n.lastModified}`,path:``,name:t.name,kind:`upload`,image:!0,pending:{name:t.name,type:t.type,data:t.data}});if(r&&(e.push(r),M.current.length>=ga))break}catch(t){e.push(`${n.name}: ${t.message}`)}continue}let t=ea(n.name);if(t){e.push(`${n.name}: save it as ${t} and attach that (the older format is not read).`);continue}if(!Zi(n.name)){e.push(`${n.name}: attach an image, a PDF, a Word, Excel or PowerPoint file, or a text or code file.`);continue}let r=$i(n.name)?wa:Ca;if(n.size>r){let t=r>=1048576?`${r/1024/1024} MB`:`${Math.round(r/1024)} KB`;e.push(`${n.name} is too large to attach here (${t} at most): put it in the agent's folder and @ its path instead.`)}else try{let t=await _a(n),r=I({id:`pending:${n.name}:${n.size}:${n.lastModified}`,path:``,name:n.name,kind:`upload`,image:Yi(n.name),pending:{name:n.name,type:n.type||`application/octet-stream`,data:t}});if(r&&(e.push(r),M.current.length>=ga))break}catch(t){e.push(t.message)}}e.length&&s(e.join(` `))})()},le={onDragEnter:e=>{e.preventDefault(),[...e.dataTransfer.types].includes(`Files`)&&S(!0)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||S(!1)},onDrop:e=>{e.preventDefault(),S(!1),e.dataTransfer.files.length&&ce(e.dataTransfer.files)}},ue=i.filter(t=>!(t.kind===`project`&&ra(e,t.name)));return{files:i,error:o,setError:s,hasFiles:i.length>0,wrap:async e=>{let t=M.current,n=ee.current,r=[];for(let e=0;e<t.length;e++){let i=t[e];try{if(i.kind===`project`){let e=await L.attachFile({path:i.path},n);if(r.push({...i,id:e.path,path:e.path,name:e.name}),Mi(e.name)&&(!Pi(e.name)||(e.size??0)>5242880)&&!t.some(t=>t.copyOf===e.path)&&!r.some(t=>t.copyOf===e.path)){let t=await Sa(e.path,e.name,n);t&&r.push(t)}}else if(i.pending){let e=await L.attachFile(i.pending,n);r.push({id:e.path,path:e.path,name:e.name,kind:`upload`,image:Yi(e.path),scope:n,...i.copyOf?{copyOf:i.copyOf}:{},...e.text?{text:e.text}:{}})}else r.push(i);P([...r,...t.slice(e+1)])}catch(n){throw P([...r,...t.slice(e)]),Error(`${i.name}: ${n.message}`,{cause:n})}}return P(r),sa(e,r)},reset:e=>{if(!e?.keep)for(let e of M.current)ne(e);P([]),s(``),F()},onEdit:oe,onKeyDown:se,onFiles:ce,drop:le,dropping:x,pick:()=>k.current?.click(),fileInput:(0,U.jsx)(`input`,{ref:k,type:`file`,multiple:!0,className:`hidden`,onChange:e=>(e.target.files&&ce(e.target.files),e.target.value=``)}),chips:(0,U.jsxs)(U.Fragment,{children:[ue.length>0&&(0,U.jsx)(`ul`,{"aria-label":`Attached files`,className:`m-0 mb-2 flex list-none flex-wrap gap-2 p-0`,children:ue.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(xa,{file:e,scope:r,onRemove:()=>re(e.id||e.path||e.name),onView:t=>w({src:t,name:e.name,pending:!!e.pending})})},e.id||e.path||e.name))}),(0,U.jsx)(Si,{wide:!0,open:!!C,onClose:()=>w(null),title:C?.name||``,description:C?.pending?`As it goes to the model when you send: at most 2048 pixels across, with no location or camera details.`:`From the agent's folder.`,footer:(0,U.jsxs)(B,{onClick:()=>w(null),children:[(0,U.jsx)(Ge,{"aria-hidden":`true`}),`Close`]}),children:C&&(0,U.jsx)(`img`,{src:C.src,alt:`${C.name}, attached`,className:g(`rounded-base bg-surface-muted object-cover`,`block h-auto max-w-full object-contain`)})})]}),combo:{expanded:u,listId:`${n}-files`,activeId:u&&c[m]?`${n}-file-${m}`:void 0},mentions:u&&!(_===`persona`&&D.current>0&&c.length===0)&&(0,U.jsxs)(`div`,{className:g(`rounded-md border border-overlay-line bg-overlay p-2 text-ink shadow-menu backdrop-blur-[16px]`,`absolute bottom-full left-0 z-20 mb-2 w-[min(420px,calc(100vw-48px))]`),children:[c.length===0&&(0,U.jsx)(`p`,{role:`status`,className:`m-0 px-4 py-2 text-body-sm text-muted`,children:_===`persona`?y?`Reading the personas…`:o.startsWith(`The personas did not load`)?`The personas did not load.`:`No persona has this command. Business personas are on Mask's page.`:f?`No file or folder matches.`:`Type a name to find a file or folder.`}),(0,U.jsx)(`div`,{id:`${n}-files`,role:`listbox`,"aria-label":_===`persona`?`Business personas`:`Files in the agent's folder`,className:`max-h-64 overflow-y-auto`,children:c.map((e,t)=>{let r=_===`persona`?[e.path,e.role].filter(Boolean).join(` · `):ia(e.path).dir;return(0,U.jsxs)(`button`,{id:`${n}-file-${t}`,type:`button`,tabIndex:-1,role:`option`,"aria-selected":t===m,className:g(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`min-w-0 flex-col items-start gap-1`),onMouseDown:e=>e.preventDefault(),onClick:()=>ae(e),children:[(0,U.jsx)(`span`,{className:`max-w-full truncate text-body-sm font-medium text-ink`,children:e.name}),r?(0,U.jsx)(`span`,{className:`max-w-full truncate text-body-sm text-muted`,children:r}):null]},e.path)})})]})}}var Da={composer:0,tour:0},Oa=`forgeqe:on-screen`;function ka(e,t){(0,H.useEffect)(()=>{if(t)return Da[e]++,window.dispatchEvent(new Event(Oa)),()=>{Da[e]--,window.dispatchEvent(new Event(Oa))}},[e,t])}function Aa(e){let[t,n]=(0,H.useState)(Da[e]>0);return(0,H.useEffect)(()=>{let t=()=>n(Da[e]>0);return t(),window.addEventListener(Oa,t),()=>window.removeEventListener(Oa,t)},[e]),t}var ja=e=>ka(`composer`,e),Ma=()=>Aa(`composer`),Na=()=>ka(`tour`,!0),Pa=()=>Aa(`tour`),Fa=()=>typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`field-sizing: content`);function Ia({id:e,value:t,onChange:n,onSend:r,onStop:i,busy:a,disabled:o,placeholder:s,label:c,left:l,right:u,top:d,rows:f=2,canSend:p,onEdit:m,onKey:h,onFiles:_,dropping:v,drop:b,mentions:x,combo:S,counted:C=!0}){ja(C);let w=p??t.trim().length>0,T=(0,H.useRef)(null),E=(0,H.useRef)(null),D=pa(t,Oi(t.includes(`/`))),O=D.some(e=>e.mark),k=xi()&&f===2?1:f;return(0,H.useLayoutEffect)(()=>{let e=T.current;e&&!Fa()&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[t,k]),(0,U.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a?i?.():w&&!o&&r()},onDragEnter:b?.onDragEnter,onDragOver:b?.onDragOver,onDragLeave:b?.onDragLeave,onDrop:b?.onDrop,className:g(`relative box-border w-full rounded-lg border-0 bg-bg py-4 pr-4 pl-6 shadow-composer short:py-4 has-[textarea:focus-visible]:outline-2 has-[textarea:focus-visible]:outline-offset-2 has-[textarea:focus-visible]:outline-accent`,v&&`outline-2 outline-offset-2 outline-accent`),children:[v&&(0,U.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg bg-accent-soft/80 text-body-sm font-medium text-accent-fg`,children:`Drop files here`}),x,(0,U.jsx)(`label`,{htmlFor:e,className:`sr-only`,children:c}),d,(0,U.jsxs)(`div`,{className:`relative`,children:[O&&(0,U.jsx)(`div`,{ref:E,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden text-body-lg leading-[1.55] whitespace-pre-wrap text-transparent [overflow-wrap:break-word]`,children:D.map((e,t)=>e.mark?(0,U.jsx)(`mark`,{className:`rounded-[5px] bg-surface-strong text-transparent shadow-[0_0_0_2px_var(--color-surface-strong)]`,children:e.text},t):(0,U.jsx)(`span`,{children:e.text},t))}),(0,U.jsx)(`textarea`,{ref:T,id:e,rows:k,style:{minBlockSize:`${k}lh`},value:t,disabled:o,onChange:e=>{n(e.target.value),m?.(e.target.value,e.target.selectionStart)},onSelect:e=>m?.(e.currentTarget.value,e.currentTarget.selectionStart),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&_&&(e.preventDefault(),_(t))},onScroll:e=>{E.current&&(E.current.scrollTop=e.currentTarget.scrollTop)},...S?{role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":S.expanded,"aria-controls":S.listId,...S.expanded&&S.activeId?{"aria-activedescendant":S.activeId}:{}}:{},onKeyDown:e=>{h?.(e)||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),!y(e)&&!a&&w&&!o&&r())},placeholder:s,className:`relative box-border max-h-[50vh] w-full resize-none [field-sizing:content] overflow-y-auto border-0 bg-transparent p-0 text-body-lg leading-[1.55] text-ink outline-none placeholder:text-muted focus-visible:outline-none disabled:opacity-60`})]}),(0,U.jsxs)(`div`,{className:`mt-2 -ml-2 flex items-center gap-1 short:mt-2`,children:[l,(0,U.jsx)(`div`,{className:`flex-auto`}),u,a?(0,U.jsx)(`button`,{type:`submit`,"aria-label":`Stop`,className:`ml-2 inline-flex size-11 flex-none cursor-pointer items-center justify-center rounded-full border-0 bg-ink text-bg hover:bg-ink-2`,children:(0,U.jsx)(Pn,{size:14,fill:`currentColor`,"aria-hidden":`true`})}):(0,U.jsx)(`button`,{type:`submit`,"aria-label":`Send`,disabled:o,className:g(`ml-2 inline-flex size-11 flex-none cursor-pointer items-center justify-center rounded-full border-0 transition-colors disabled:cursor-not-allowed`,w&&!o?`bg-accent text-accent-ink hover:bg-accent-hover`:`bg-line text-muted`),children:(0,U.jsx)(En,{size:20,strokeWidth:2.2,"aria-hidden":`true`})})]})]})}var La=new Map,Ra=!1,za=()=>typeof document>`u`?null:document,Ba=()=>za()?.visibilityState===`hidden`;function Va(){if(!Ba())for(let e of[...La.values()])e()}function Ha(e,t){let n=setInterval(()=>{Ba()||e()},t);La.set(n,e);let r=za();return r&&!Ra&&(r.addEventListener(`visibilitychange`,Va),Ra=!0),n}function Ua(e){if(e==null)return;clearInterval(e),La.delete(e);let t=za();t&&Ra&&La.size===0&&(t.removeEventListener(`visibilitychange`,Va),Ra=!1)}var Wa=null,Ga=e=>void(Wa=e),Ka=/password|secret|token|api.?key|\bkey\b|credential|\bprod(uction)?\b|\bprd\b|\blive\b/i,qa=1e3,Ja=60,Ya=e=>e.replace(/[\u0000-\u001f\u007f\u2028\u2029]+/g,` `).replace(/\s+/g,` `).trim();function Xa(e){let t=new Set,n=[];for(let r of e){let e=Ya(r.label).slice(0,Ja);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`)&&Ka.test(e)))continue;let a=r.value===void 0?void 0:Ya(r.value).slice(0,Ja);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 Za=e=>e.map(e=>`${e.ref} ${e.kind}: ${e.label}${e.value===void 0?``:` (now: ${e.value||`empty`})`}`).join(`
123
+ `);function Qa(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`?Ya(n.text).slice(0,qa):``;return{ref:n.ref,label:Ya(n.label),text:r}}function $a(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 eo=()=>/^#\/settings(?:\/|$)/.test(location.hash)&&!/^#\/settings\/secrets/.test(location.hash);function to(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 no(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 ro(){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=eo();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(Ya(n(i)))){if(i instanceof HTMLTextAreaElement)a||e.push({kind:r?`setting`:`field`,label:to(i)||i.placeholder||`Text`,value:r?no(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:to(i),value:no(i),el:i}):e.push({kind:`field`,label:to(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:to(i)||n(i),value:no(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 io=()=>Xa(ro());function ao(e){let t=io(),n=((document.querySelector(`[data-screen]`)??document.body).innerText||``).replace(/[ \t]+/g,` `).replace(/\n{3,}/g,`
124
+
125
+ `).trim(),r=Za(t);return`${r?`Controls (page_act takes a ref and its label):\n${r}\n\n`:``}Page text:\n${n}`.slice(0,e)}function oo(e,t){if(e instanceof HTMLInputElement&&e.type===`checkbox`){let n=so(t);return n===null?`Say on or off.`:(e.checked!==n&&e.click(),null)}if(e.getAttribute(`role`)===`switch`){let n=so(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 so=e=>/^(on|yes|true|enabled?|shown?)$/i.test(e)?!0:!/^(off|no|false|disabled?|hidden)$/i.test(e)&&null;async function co(e){let t=Qa(e);if(!t)return`That is not a control of this page.`;let n=$a(io(),t);if(typeof n==`string`)return n;let r=n.from.el;if(n.kind===`setting`||n.kind===`option`&&eo()){let e=n.kind===`setting`?t.text:n.label;return Wa?await Wa(n.kind===`setting`?`Change ${n.label} to ${e}?`:`Switch to ${e}?`)?n.kind===`option`?(r.click(),`Switched to ${e}. Settings saves it.`):oo(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 Wa?await Wa(`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 lo=[`open`,`open_run`,`open_chat`,`search`,`back`,`new_chat`,`set`,`read`,`act`],uo={theme:[`light`,`dark`,`system`],sidebar:[`open`,`closed`],browser:[`shown`,`hidden`],talk:[`off`]},fo=8e3,po=/^(?:latest|last|newest|most recent)?$/i,mo=/^[A-Za-z0-9_-]{1,80}$/,ho=e=>e.replace(/[\u0000-\u001f\u007f]+/g,` `).trim().slice(0,1200);function go(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.id!=`string`||!mo.test(t.id)||!lo.includes(t.action))return null;let n=typeof t.what==`string`?ho(t.what):void 0;return{id:t.id,action:t.action,...n?{what:n}:{}}}function _o(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=vo(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 vo(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 yo=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,``);function bo(e,t){let n=yo(t),r=n.length>=4?e.filter(e=>e.kind!==`field`&&yo(e.label)===n):[];return r.length===1?r[0]:void 0}var xo=/^(?:settings\s*[›>:/-]\s*(.+)|(?:the\s+)?(.+?)\s+settings?)$/i;async function So(e,t){let n=(e.what||``).trim();switch(e.action){case`open`:{let e=await t.commands(),r=xo.exec(n),i=r?(r[1]||r[2]||``).trim():``,a=n?i&&k(e.filter(e=>e.kind===`setting`),i.toLowerCase())||k(e,n.toLowerCase())||bo(e,n):void 0;if(!a){let t=_o(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(),i=po.test(n)?e[0]:e.find(e=>e.name===n)??e.find(e=>e.title.toLowerCase()===n.toLowerCase());return i?(t.go(r(`runs`,encodeURIComponent(i.name))),`Opened the run “${i.title||i.name}”.`):e.length?`No run is called “${n}”.`:`There are no runs yet.`}case`open_chat`:{let e=await t.chats(),i=po.test(n)?e.find(e=>e.id!==t.current):e.find(e=>e.id===n)??e.find(e=>e.title.toLowerCase()===n.toLowerCase());return i?(t.go(r(`chats`,i.id)),`Opened the chat “${i.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(r()),`Opened a new chat.`;case`set`:{let[e,r,...i]=n.split(` `),a=e&&Object.hasOwn(uo,e)?uo[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?.(fo)??``).slice(0,fo);case`act`:return t.actOn?await t.actOn(n):`That cannot be done from here.`}}var Co=new Set;function wo(e,t){Co.has(e.id)||(Co.add(e.id),t(e))}function To(e,t,n,r){let i=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(n&&e){if(i.current!==e){i.current=e;for(let e of t)Co.add(e.id)}else for(let e of t)Co.has(e.id)||(Co.add(e.id),r(e))}},[e,t.length,n])}var Eo=(0,H.createContext)(null);function Do({pages:e,find:t,set:n,children:r}){let i=(0,H.useRef)(null),a=(0,H.useCallback)(r=>({commands:()=>i.current??=ie(()=>import(`./paletteCommands-DdFd3e0-.js`).then(t=>t.everyCommand(e)),__vite__mapDeps([0,1,2,3,4,5,6])),runs:async()=>(await oe.list()).runs.map(e=>({name:e.name,title:e.title})),chats:async()=>(await L.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:ao,actOn:co}),[e,t,n]),o=(0,H.useCallback)(async(e,t)=>{let n=await So(e,a(t)).catch(e=>`That did not work: ${e.message}`);return t&&/^act_[a-f0-9]{16}$/.test(e.id)&&await L.screen(t,e.id,n).catch(()=>{}),n},[a]),s=(0,H.useMemo)(()=>({act:o}),[o]);return(0,U.jsx)(Eo.Provider,{value:s,children:r})}function Oo(){let e=(0,H.useContext)(Eo);return e?e.act:async()=>``}var ko=16e3;function Ao(e,t){if(!e.length||!(t>0))return new Int16Array;let n=t/ko,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 jo(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 Mo=(0,H.createContext)(null);function No(){let e=(0,H.useContext)(Mo);if(!e)throw Error(`useTalk outside TalkProvider`);return e}var Po=e=>{try{return localStorage.getItem(e)}catch{return null}},Fo=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},Io=()=>{let e=Po(`forgeqe.voice.eagerness`);return e===`eager`||e===`patient`?e:`normal`},Lo=e=>Fo(`forgeqe.voice.eagerness`,e),Ro=`forgeqe:voice-in-mascot`,zo=()=>Po(`forgeqe.voice.mascot`)!==`off`,Bo=e=>{Fo(`forgeqe.voice.mascot`,e?`on`:`off`),window.dispatchEvent(new Event(Ro))},Vo=null;function Ho(e=!1){return(e||!Vo)&&(Vo=ue.status()),Vo.catch(()=>Vo=null),Vo}var Uo=()=>/^#\/chats\/([a-f0-9]{18})(?:[/?]|$)/.exec(location.hash)?.[1]??null,Wo=320;function Go({children:e}){let[t,n]=(0,H.useState)(`off`),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(``),[l,u]=(0,H.useState)(null),d=Oo(),f=(0,H.useRef)(null),p=(0,H.useRef)(null),m=(0,H.useRef)(null),h=(0,H.useRef)(null),g=(0,H.useRef)([]),_=(0,H.useRef)(0),v=(0,H.useRef)(0),y=(0,H.useRef)(new Int16Array),b=(0,H.useRef)({hearing:!1,thinking:!1,speaking:!1}),x=(0,H.useRef)(null),S=(0,H.useRef)(0),C=(0,H.useRef)(new Map),w=(0,H.useCallback)(()=>{let e=b.current;n(e.hearing?`hearing`:e.speaking?`speaking`:e.thinking?`thinking`:`listening`)},[]),T=(0,H.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,w()},[w]),E=(0,H.useCallback)((e,t,n)=>{let r=p.current,i=m.current;if(!r||!i||e<v.current)return;let a=jo(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,w())},b.current.speaking=!0,w()},[w]),D=(0,H.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`&&E(t.gen,t.rate,n(t.pcm));break;case`interrupt`:typeof t.gen==`number`&&T(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),w();break;case`app_action`:{let e=go(t);e&&(S.current=Date.now(),wo(e,e=>d(e,x.current??void 0)));break}case`confirmed`:{let e=C.current.get(n(t.id));C.current.delete(n(t.id)),e?.(t.yes===!0);break}case`error`:c(n(t.message).slice(0,300))}},[d,T,E,w]),O=()=>{ii(null,null),Ga(null);for(let e of C.current.values())e(!1);C.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},k=(0,H.useCallback)(()=>{O(),b.current={hearing:!1,thinking:!1,speaking:!1},x.current=null,i(null),u(null),n(`off`),o(!1)},[]),A=(0,H.useCallback)(async e=>{if(!f.current){c(``),n(`connecting`);try{if(!(await Ho()).ready)throw Error(`Speech is not set up on this computer yet: Settings › Voice.`);ue.warm().catch(()=>{});let t=new AudioContext;p.current=t;let r=t.createGain();r.connect(t.destination),m.current=r;let a=ai(t);r.connect(a);let o=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1}});h.current=o;let{default:s}=await ie(async()=>{let{default:e}=await import(`./capture.worklet-C65DyLpl.js`);return{default:e}},[]);await t.audioWorklet.addModule(s);let c=new AudioWorkletNode(t,`forgeqe-capture`),l=ai(t),u=t.createMediaStreamSource(o);u.connect(c),u.connect(l),ii(l,a),c.port.onmessage=e=>{let n=Ao(e.data,t.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>=Wo;i+=Wo)f.current?.readyState===WebSocket.OPEN&&f.current.send(r.slice(i,i+Wo).buffer);y.current=r.slice(i)},x.current=e===void 0?Uo():e&&/^[a-f0-9]{18}$/.test(e)?e:null,i(x.current);let{ticket:d}=await ue.ticket(x.current,Io()),g=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/api/voice/session?ticket=${d}`);g.binaryType=`arraybuffer`,g.onmessage=e=>typeof e.data==`string`&&D(e.data),g.onopen=()=>{b.current={hearing:!1,thinking:!1,speaking:!1},n(`listening`),Ga(e=>new Promise(t=>{if(g.readyState!==WebSocket.OPEN)return t(!1);let n=Math.random().toString(36).slice(2,12);C.current.set(n,t),setTimeout(()=>C.current.get(n)===t&&(C.current.delete(n),t(!1)),35e3),g.send(JSON.stringify({type:`confirm`,id:n,text:e.slice(0,200)}))}))},g.onclose=()=>{f.current===g&&(O(),n(`off`))},f.current=g}catch(e){O(),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)}}},[D]);(0,H.useEffect)(()=>()=>O(),[]),(0,H.useEffect)(()=>{let e=()=>{let e=()=>g.current.length?setTimeout(e,300):k();setTimeout(e,1500)};return window.addEventListener(`forgeqe:talk-off`,e),()=>window.removeEventListener(`forgeqe:talk-off`,e)},[k]),(0,H.useEffect)(()=>{if(t===`off`)return;let e=()=>{if(Date.now()-S.current<3e3)return;let e=Uo(),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 j=(0,H.useMemo)(()=>({phase:t,chat:r,working:a,error:s,line:l,start:e=>void A(e),end:k,dismiss:()=>c(``)}),[t,r,a,s,l,A,k]);return(0,U.jsx)(Mo.Provider,{value:j,children:e})}function Ko({chat:e,disabled:t}){let n=No(),[r,i]=(0,H.useState)(null);(0,H.useEffect)(()=>{Ho().then(e=>i(e.ready)).catch(()=>i(!1))},[]);let a=Jo(n,e),o=r===!1;return(0,U.jsx)(B,{variant:`icon`,size:`icon`,className:g(`flex-none`,a&&`bg-accent-soft text-accent-fg`),"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(e)},children:(0,U.jsx)(Vt,{"aria-hidden":`true`})})}function qo({chat:e}){let t=No(),n=Jo(t,e);if(!n&&!t.error)return null;let r=n&&t.phase!==`thinking`;return(0,U.jsxs)(`div`,{"aria-live":`polite`,className:`-mt-1 mb-4 flex flex-col gap-2 border-b border-line-soft pb-4 text-body-sm`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-7 flex-wrap items-center gap-x-2 gap-y-1`,children:[r?(0,U.jsx)(_e,{state:Xo[t.phase],px:18}):(0,U.jsx)(Vt,{size:16,"aria-hidden":`true`,className:`text-muted`}),(0,U.jsx)(`span`,{className:`font-medium`,children:n?Yo[t.phase]:`Talk stopped`}),n&&(0,U.jsx)(`span`,{className:`text-muted`,children:`Talk over Atlas any time; it stops and listens.`}),(0,U.jsx)(`span`,{className:`flex-auto`}),n?(0,U.jsx)(B,{size:`sm`,variant:`ghost`,onClick:t.end,children:`End`}):(0,U.jsx)(B,{variant:`icon`,size:`icon-xs`,type:`button`,"aria-label":`Close the note`,"data-tip":`Close the note`,onClick:t.dismiss,children:(0,U.jsx)(Ge,{size:14,"aria-hidden":`true`})})]}),t.error&&(0,U.jsx)(`p`,{className:g(ge.fail,`m-0`),children:t.error})]})}var Jo=(e,t)=>e.phase!==`off`&&(e.chat??null)===t,Yo={off:`Talk stopped`,connecting:`Starting Talk…`,listening:`Listening. Just talk.`,hearing:`Hearing you…`,thinking:`Listening while Atlas works.`,speaking:`Speaking.`},Xo={off:`idle`,connecting:`waiting`,listening:`waiting`,hearing:`recording`,thinking:`thinking`,speaking:`writing`},Zo={pass:`bg-pass-soft text-pass shadow-none`,warn:`bg-warn-soft text-warn shadow-none`,fail:`bg-fail-soft text-fail shadow-none`,info:`bg-accent-soft text-accent-fg shadow-none`},Qo={md:`size-9`,lg:`size-10`,xl:`size-14`},$o={md:18,lg:20,xl:28},es={md:20,lg:24,xl:32},ts={md:`size-[18px]`,lg:`size-5`,xl:`size-7`};function ns({icon:e,picked:t,onPick:n,label:r,size:i=`lg`}){return(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":t,"aria-label":r,onClick:()=>n(!t),className:`relative flex-none rounded-base focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,children:[(0,U.jsx)(rs,{icon:e,size:i,tone:t?`info`:void 0}),t&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`absolute -top-1 -right-1 inline-flex size-4 items-center justify-center rounded-full bg-accent text-accent-ink`,children:(0,U.jsx)(V,{icon:zn,size:10})})]})}function rs({icon:e,logo:t,pixel:n,tone:r,size:i=`md`,head:a,className:o}){return a?(0,U.jsx)(`span`,{"aria-hidden":`true`,className:g(`inline-flex size-10 flex-none items-center justify-center text-ink-2`,o),children:n?(0,U.jsx)(f,{name:n,px:40}):t?(0,U.jsx)(t,{className:`size-8`}):e?(0,U.jsx)(V,{icon:e,size:32}):null}):(0,U.jsx)(`span`,{"aria-hidden":`true`,"data-icon-tile":``,className:g(`inline-flex flex-none items-center justify-center rounded-base`,m,r&&Zo[r],Qo[i],o),children:n?(0,U.jsx)(f,{name:n,px:es[i]}):t?(0,U.jsx)(t,{className:ts[i]}):e?(0,U.jsx)(V,{icon:e,size:$o[i]}):null})}var is=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 150`,width:`2.06em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#34a853`,d:`M255.285 143.47c-.084-.524-.164-1.042-.251-1.56a128.1 128.1 0 0 0-12.794-38.288a128.8 128.8 0 0 0-23.45-31.86a129.2 129.2 0 0 0-22.713-18.005c.049-.08.09-.168.14-.25c2.582-4.461 5.172-8.917 7.755-13.38l7.576-13.068c1.818-3.126 3.632-6.26 5.438-9.386q.643-1.115 1.023-2.297a11.78 11.78 0 0 0-.36-8.188q-.32-.76-.743-1.472a11.7 11.7 0 0 0-4.08-4.064a11.85 11.85 0 0 0-5.005-1.61a12 12 0 0 0-2.218.02q-.912.094-1.814.33a11.74 11.74 0 0 0-7.154 5.467c-1.814 3.127-3.628 6.26-5.438 9.386l-7.576 13.069c-2.583 4.462-5.173 8.918-7.755 13.38c-.282.487-.567.973-.848 1.467q-.586-.237-1.172-.462c-14.24-5.43-29.688-8.4-45.836-8.4c-.442 0-.879 0-1.324.006c-14.357.143-28.152 2.64-41.022 7.12a119 119 0 0 0-4.42 1.642c-.262-.455-.532-.911-.79-1.367c-2.583-4.462-5.173-8.918-7.755-13.38l-7.576-13.07a3915 3915 0 0 1-5.439-9.386A11.74 11.74 0 0 0 48.5.048a11.7 11.7 0 0 0-5.01 1.612a11.7 11.7 0 0 0-4.077 4.063c-.281.474-.532.967-.742 1.473a11.8 11.8 0 0 0-.365 8.188c.259.786.594 1.554 1.023 2.296a3973 3973 0 0 1 5.439 9.386q3.793 6.535 7.58 13.069c2.582 4.462 5.168 8.918 7.75 13.38c.02.038.046.075.065.112A129 129 0 0 0 45.32 64.38a129.7 129.7 0 0 0-22.2 24.015a128 128 0 0 0-9.34 15.24a128.2 128.2 0 0 0-10.843 28.764a131 131 0 0 0-1.951 9.524c-.087.518-.167 1.042-.247 1.56A125 125 0 0 0 0 149.118h256q-.307-2.837-.734-5.636z`}),(0,U.jsx)(`path`,{fill:`#202124`,d:`M194.59 113.712c5.122-3.41 5.867-11.3 1.661-17.62c-4.203-6.323-11.763-8.682-16.883-5.273c-5.122 3.41-5.868 11.3-1.662 17.621c4.203 6.322 11.764 8.682 16.883 5.272m-116.071-5.25c4.206-6.321 3.46-14.21-1.662-17.62c-5.123-3.41-12.68-1.05-16.886 5.27c-4.203 6.323-3.458 14.212 1.662 17.622c5.122 3.41 12.683 1.05 16.886-5.272`})]})),as=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 315`,width:`0.99em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{d:`M213.803 167.03c.442 47.58 41.74 63.413 42.197 63.615c-.35 1.116-6.599 22.563-21.757 44.716c-13.104 19.153-26.705 38.235-48.13 38.63c-21.05.388-27.82-12.483-51.888-12.483c-24.061 0-31.582 12.088-51.51 12.871c-20.68.783-36.428-20.71-49.64-39.793c-27-39.033-47.633-110.3-19.928-158.406c13.763-23.89 38.36-39.017 65.056-39.405c20.307-.387 39.475 13.662 51.889 13.662c12.406 0 35.699-16.895 60.186-14.414c10.25.427 39.026 4.14 57.503 31.186c-1.49.923-34.335 20.044-33.978 59.822M174.24 50.199c10.98-13.29 18.369-31.79 16.353-50.199c-15.826.636-34.962 10.546-46.314 23.828c-10.173 11.763-19.082 30.589-16.678 48.633c17.64 1.365 35.66-8.964 46.64-22.262`})]})),os=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 242`,width:`1.28em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:`SVG4V795Kgq`,x1:`58.972%`,x2:`37.191%`,y1:`7.411%`,y2:`103.762%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#114a8b`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#0669bc`})]}),(0,U.jsxs)(`linearGradient`,{id:`SVGzpurqcJr`,x1:`59.719%`,x2:`52.691%`,y1:`52.313%`,y2:`54.864%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopOpacity:.3}),(0,U.jsx)(`stop`,{offset:`7.1%`,stopOpacity:.2}),(0,U.jsx)(`stop`,{offset:`32.1%`,stopOpacity:.1}),(0,U.jsx)(`stop`,{offset:`62.3%`,stopOpacity:.05}),(0,U.jsx)(`stop`,{offset:`100%`,stopOpacity:0})]}),(0,U.jsxs)(`linearGradient`,{id:`SVGZ5kCkZNr`,x1:`37.279%`,x2:`62.473%`,y1:`4.6%`,y2:`99.979%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#3ccbf4`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#2892df`})]})]}),(0,U.jsx)(`path`,{fill:`url(#SVG4V795Kgq)`,d:`M85.343.003h75.753L82.457 233a12.08 12.08 0 0 1-11.442 8.216H12.06A12.06 12.06 0 0 1 .633 225.303L73.898 8.219A12.08 12.08 0 0 1 85.343 0z`}),(0,U.jsx)(`path`,{fill:`#0078d4`,d:`M195.423 156.282H75.297a5.56 5.56 0 0 0-3.796 9.627l77.19 72.047a12.14 12.14 0 0 0 8.28 3.26h68.02z`}),(0,U.jsx)(`path`,{fill:`url(#SVGzpurqcJr)`,d:`M85.343.003a11.98 11.98 0 0 0-11.471 8.376L.723 225.105a12.045 12.045 0 0 0 11.37 16.112h60.475a12.93 12.93 0 0 0 9.921-8.437l14.588-42.991l52.105 48.6a12.33 12.33 0 0 0 7.757 2.828h67.766l-29.721-84.935l-86.643.02L161.37.003z`}),(0,U.jsx)(`path`,{fill:`url(#SVGZ5kCkZNr)`,d:`M182.098 8.207A12.06 12.06 0 0 0 170.67.003H86.245c5.175 0 9.773 3.301 11.428 8.204L170.94 225.3a12.062 12.062 0 0 1-11.428 15.92h84.429a12.062 12.062 0 0 0 11.425-15.92z`})]})),ss=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`defs`,{children:(0,U.jsxs)(`radialGradient`,{id:`SVGwZwAicDR`,cx:`50.141%`,cy:`50.003%`,r:`50.119%`,fx:`50.141%`,fy:`50.003%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#797979`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#4c4c4c`})]})}),(0,U.jsx)(`circle`,{cx:127.949,cy:128.603,r:127.397,fill:`#f5bb60`}),(0,U.jsx)(`circle`,{cx:114.961,cy:115.615,r:114.685,fill:`#e86f32`}),(0,U.jsx)(`circle`,{cx:130.16,cy:100.416,r:99.485,fill:`#e53d42`}),(0,U.jsx)(`circle`,{cx:138.174,cy:108.43,r:91.471,fill:`#bfd141`}),(0,U.jsx)(`circle`,{cx:131.542,cy:115.062,r:84.839,fill:`#6db64c`}),(0,U.jsx)(`circle`,{cx:118.001,cy:101.798,r:71.298,fill:`#afdbe7`}),(0,U.jsx)(`circle`,{cx:129.607,cy:89.915,r:59.691,fill:`#57badf`}),(0,U.jsx)(`circle`,{cx:137.069,cy:97.376,r:52.506,fill:`#02b2d6`}),(0,U.jsx)(`circle`,{cx:129.331,cy:104.837,r:44.768,fill:`url(#SVGwZwAicDR)`}),(0,U.jsx)(`circle`,{cx:129.331,cy:104.837,r:44.768,fill:`#231f20`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`M141.088 98.971c4.439 1.992 10.56-2.016 13.672-8.951s2.036-14.173-2.402-16.164c-4.44-1.992-10.56 2.016-13.672 8.951s-2.037 14.173 2.402 16.164`})]})),cs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 257`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#d97757`,d:`m50.228 170.321l50.357-28.257l.843-2.463l-.843-1.361h-2.462l-8.426-.518l-28.775-.778l-24.952-1.037l-24.175-1.296l-6.092-1.297L0 125.796l.583-3.759l5.12-3.434l7.324.648l16.202 1.101l24.304 1.685l17.629 1.037l26.118 2.722h4.148l.583-1.685l-1.426-1.037l-1.101-1.037l-25.147-17.045l-27.22-18.017l-14.258-10.37l-7.713-5.25l-3.888-4.925l-1.685-10.758l7-7.713l9.397.649l2.398.648l9.527 7.323l20.35 15.75L94.817 91.9l3.889 3.24l1.555-1.102l.195-.777l-1.75-2.917l-14.453-26.118l-15.425-26.572l-6.87-11.018l-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0l10.63 1.426l4.472 3.888l6.61 15.101l10.694 23.786l16.591 32.34l4.861 9.592l2.592 8.879l.973 2.722h1.685v-1.556l1.36-18.211l2.528-22.36l2.463-28.776l.843-8.1l4.018-9.722l7.971-5.25l6.222 2.981l5.12 7.324l-.713 4.73l-3.046 19.768l-5.962 30.98l-3.889 20.739h2.268l2.593-2.593l10.499-13.934l17.628-22.036l7.778-8.749l9.073-9.657l5.833-4.601h11.018l8.1 12.055l-3.628 12.443l-11.342 14.388l-9.398 12.184l-13.48 18.147l-8.426 14.518l.778 1.166l2.01-.194l30.46-6.481l16.462-2.982l19.637-3.37l8.88 4.148l.971 4.213l-3.5 8.62l-20.998 5.184l-24.628 4.926l-36.682 8.685l-.454.324l.519.648l16.526 1.555l7.065.389h17.304l32.21 2.398l8.426 5.574l5.055 6.805l-.843 5.184l-12.962 6.611l-17.498-4.148l-40.83-9.721l-14-3.5h-1.944v1.167l11.666 11.406l21.387 19.314l26.767 24.887l1.36 6.157l-3.434 4.86l-3.63-.518l-23.526-17.693l-9.073-7.972l-20.545-17.304h-1.36v1.814l4.73 6.935l25.017 37.59l1.296 11.536l-1.814 3.76l-6.481 2.268l-7.13-1.297l-14.647-20.544l-15.1-23.138l-12.185-20.739l-1.49.843l-7.194 77.448l-3.37 3.953l-7.778 2.981l-6.48-4.925l-3.436-7.972l3.435-15.749l4.148-20.544l3.37-16.333l3.046-20.285l1.815-6.74l-.13-.454l-1.49.194l-15.295 20.999l-23.267 31.433l-18.406 19.702l-4.407 1.75l-7.648-3.954l.713-7.064l4.277-6.286l25.47-32.405l15.36-20.092l9.917-11.6l-.065-1.686h-.583L44.07 198.125l-12.055 1.555l-5.185-4.86l.648-7.972l2.463-2.593l20.35-13.999z`})]})),ls=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 246`,width:`1.26em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:`SVGvnhR7dox`,x1:`99.14%`,x2:`33.859%`,y1:`112.708%`,y2:`37.755%`,children:[(0,U.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]}),(0,U.jsxs)(`linearGradient`,{id:`SVGgker3cTp`,x1:`.926%`,x2:`66.18%`,y1:`-12.582%`,y2:`62.306%`,children:[(0,U.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]})]}),(0,U.jsx)(`path`,{fill:`url(#SVGvnhR7dox)`,d:`M9.26 187.33c-2.64 4.307-5.607 9.305-8.126 13.287a8.127 8.127 0 0 0 2.722 11.052l52.823 32.507a8.127 8.127 0 0 0 11.256-2.763c2.113-3.536 4.835-8.127 7.801-13.044c20.926-34.538 41.974-30.312 79.925-12.19l52.376 24.908a8.127 8.127 0 0 0 10.93-4.063l25.152-56.886a8.127 8.127 0 0 0-4.063-10.646c-11.052-5.201-33.034-15.562-52.823-25.111c-71.189-34.579-131.691-32.344-177.972 42.949`}),(0,U.jsx)(`path`,{fill:`url(#SVGgker3cTp)`,d:`M246.115 58.232c2.641-4.307 5.607-9.305 8.127-13.287a8.127 8.127 0 0 0-2.723-11.052L198.696 1.386a8.127 8.127 0 0 0-11.58 2.682c-2.113 3.535-4.835 8.127-7.802 13.043c-20.926 34.538-41.974 30.313-79.925 12.19L47.176 4.515a8.127 8.127 0 0 0-10.93 4.063L11.093 65.465a8.127 8.127 0 0 0 4.063 10.645c11.052 5.202 33.035 15.563 52.823 25.112c71.351 34.538 131.854 32.222 178.135-42.99`})]})),us=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 208`,width:`1.49em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{d:`M205.28 31.36c14.096 14.88 20.016 35.2 22.512 63.68c6.626 0 12.805 1.47 16.976 7.152l7.792 10.56A17.55 17.55 0 0 1 256 123.2v28.688c-.008 3.704-1.843 7.315-4.832 9.504C215.885 187.222 172.35 208 128 208c-49.066 0-98.19-28.273-123.168-46.608c-2.989-2.189-4.825-5.8-4.832-9.504V123.2c0-3.776 1.2-7.424 3.424-10.464l7.792-10.544c4.173-5.657 10.38-7.152 16.992-7.152c2.496-28.48 8.4-48.8 22.512-63.68C77.331 3.165 112.567.06 127.552 0H128c14.72 0 50.4 2.88 77.28 31.36m-77.264 47.376c-3.04 0-6.544.176-10.272.544c-1.312 4.896-3.248 9.312-6.08 12.128c-11.2 11.2-24.704 12.928-31.936 12.928c-6.802 0-13.927-1.42-19.744-5.088c-5.502 1.808-10.786 4.415-11.136 10.912c-.586 12.28-.637 24.55-.688 36.824c-.026 6.16-.05 12.322-.144 18.488c.024 3.579 2.182 6.903 5.44 8.384C79.936 185.92 104.976 192 128.016 192c23.008 0 48.048-6.08 74.512-18.144c3.258-1.48 5.415-4.805 5.44-8.384c.317-18.418.062-36.912-.816-55.312h.016c-.342-6.534-5.648-9.098-11.168-10.912c-5.82 3.652-12.927 5.088-19.728 5.088c-7.232 0-20.72-1.728-31.936-12.928c-2.832-2.816-4.768-7.232-6.08-12.128a106 106 0 0 0-10.24-.544m-26.941 43.93c5.748 0 10.408 4.66 10.408 10.409v19.183c0 5.749-4.66 10.409-10.408 10.409s-10.408-4.66-10.408-10.409v-19.183c0-5.748 4.66-10.408 10.408-10.408m53.333 0c5.749 0 10.409 4.66 10.409 10.409v19.183c0 5.749-4.66 10.409-10.409 10.409c-5.748 0-10.408-4.66-10.408-10.409v-19.183c0-5.748 4.66-10.408 10.408-10.408M81.44 28.32c-11.2 1.12-20.64 4.8-25.44 9.92c-10.4 11.36-8.16 40.16-2.24 46.24c4.32 4.32 12.48 7.2 21.28 7.2c6.72 0 19.52-1.44 30.08-12.16c4.64-4.48 7.52-15.68 7.2-27.04c-.32-9.12-2.88-16.64-6.72-19.84c-4.16-3.68-13.6-5.28-24.16-4.32m68.96 4.32c-3.84 3.2-6.4 10.72-6.72 19.84c-.32 11.36 2.56 22.56 7.2 27.04c10.56 10.72 23.36 12.16 30.08 12.16c8.8 0 16.96-2.88 21.28-7.2c5.92-6.08 8.16-34.88-2.24-46.24c-4.8-5.12-14.24-8.8-25.44-9.92c-10.56-.96-20 .64-24.16 4.32M128 56c-2.56 0-5.6.16-8.96.48c.32 1.76.48 3.68.64 5.76c0 1.44 0 2.88-.16 4.48c3.2-.32 5.92-.32 8.48-.32s5.28 0 8.48.32c-.16-1.6-.16-3.04-.16-4.48c.16-2.08.32-4 .64-5.76c-3.36-.32-6.4-.48-8.96-.48`})]})),ds=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 250`,width:`1.24em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#161614`,d:`M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0m-80.06 182.34c-.282.636-1.283.827-2.194.39c-.929-.417-1.45-1.284-1.15-1.922c.276-.655 1.279-.838 2.205-.399c.93.418 1.46 1.293 1.139 1.931m6.296 5.618c-.61.566-1.804.303-2.614-.591c-.837-.892-.994-2.086-.375-2.66c.63-.566 1.787-.301 2.626.591c.838.903 1 2.088.363 2.66m4.32 7.188c-.785.545-2.067.034-2.86-1.104c-.784-1.138-.784-2.503.017-3.05c.795-.547 2.058-.055 2.861 1.075c.782 1.157.782 2.522-.019 3.08m7.304 8.325c-.701.774-2.196.566-3.29-.49c-1.119-1.032-1.43-2.496-.726-3.27c.71-.776 2.213-.558 3.315.49c1.11 1.03 1.45 2.505.701 3.27m9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033c-1.448-.439-2.395-1.613-2.103-2.626c.301-1.01 1.747-1.484 3.207-1.028c1.446.436 2.396 1.602 2.095 2.622m10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95c-1.53.034-2.769-.82-2.786-1.86c0-1.065 1.202-1.932 2.733-1.958c1.522-.03 2.768.818 2.768 1.868m10.555-.405c.182 1.03-.875 2.088-2.387 2.37c-1.485.271-2.861-.365-3.05-1.386c-.184-1.056.893-2.114 2.376-2.387c1.514-.263 2.868.356 3.061 1.403`})]})),fs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 247`,width:`1.25em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#e24329`,d:`m251.845 97.642l-.328-.986l-34.85-90.903c-.657-1.808-1.972-3.287-3.616-4.274Q210.586 0 207.627 0c-1.973 0-3.78.822-5.26 1.973a8.73 8.73 0 0 0-3.124 4.767l-23.506 71.999H80.56l-23.506-72c-.493-1.808-1.644-3.451-3.123-4.766C52.45.822 50.643 0 48.67 0s-3.781.329-5.425 1.48c-1.644.986-2.96 2.465-3.617 4.273L4.781 96.656l-.33.986c-10.355 26.959-1.479 57.37 21.535 74.794h.328c0 .164 53.096 39.944 53.096 39.944l26.3 19.89l15.946 12c3.78 2.96 9.205 2.96 12.986 0l15.945-12l26.3-19.89l53.424-39.944c23.014-17.425 31.726-47.835 21.37-74.794z`}),(0,U.jsx)(`path`,{fill:`#fc6d26`,d:`m251.845 97.642l-.328-.986c-17.26 3.616-33.205 10.85-46.849 21.04c-.164 0-41.424 31.398-76.602 57.863a18377 18377 0 0 0 48.657 36.821l53.424-39.944c23.013-17.425 31.726-47.835 21.37-74.794z`}),(0,U.jsx)(`path`,{fill:`#fca326`,d:`m79.245 212.38l26.301 19.89l15.945 12c3.78 2.96 9.206 2.96 12.986 0l15.945-12l26.301-19.89s-22.684-17.095-48.657-36.82c-26.136 19.725-48.82 36.82-48.82 36.82`}),(0,U.jsx)(`path`,{fill:`#fc6d26`,d:`M51.465 117.697c-13.644-10.192-29.589-17.589-46.849-21.04l-.329.985c-10.356 26.959-1.479 57.37 21.534 74.794h.33c0 .164 53.094 39.944 53.094 39.944s22.685-17.095 48.821-36.82c-35.013-26.466-76.272-57.699-76.601-57.863`})]})),ps=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 206`,width:`1.5em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#ea4335`,d:`m170.252 56.819l22.253-22.253l1.483-9.37C153.437-11.677 88.976-7.496 52.42 33.92C42.267 45.423 34.734 59.764 30.717 74.573l7.97-1.123l44.505-7.34l3.436-3.513c19.797-21.742 53.27-24.667 76.128-6.168z`}),(0,U.jsx)(`path`,{fill:`#4285f4`,d:`M224.205 73.918a100.25 100.25 0 0 0-30.217-48.722l-31.232 31.232a55.52 55.52 0 0 1 20.379 44.037v5.544c15.35 0 27.797 12.445 27.797 27.796c0 15.352-12.446 27.485-27.797 27.485h-55.671l-5.466 5.934v33.34l5.466 5.231h55.67c39.93.311 72.553-31.494 72.864-71.424a72.3 72.3 0 0 0-31.793-60.453`}),(0,U.jsx)(`path`,{fill:`#34a853`,d:`M71.87 205.796h55.593V161.29H71.87a27.3 27.3 0 0 1-11.399-2.498l-7.887 2.42l-22.409 22.253l-1.952 7.574c12.567 9.489 27.9 14.825 43.647 14.757`}),(0,U.jsx)(`path`,{fill:`#fbbc05`,d:`M71.87 61.426C31.94 61.663-.237 94.227.001 134.158a72.3 72.3 0 0 0 28.222 56.88l32.248-32.246c-13.99-6.322-20.208-22.786-13.887-36.776s22.786-20.208 36.775-13.888a27.8 27.8 0 0 1 13.887 13.888l32.248-32.248A72.22 72.22 0 0 0 71.87 61.427`})]})),ms=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`filter`,{id:`SVGqoIxVV2h`,width:39.274,height:43.217,x:-19.824,y:13.152,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:2.46})]}),(0,U.jsxs)(`filter`,{id:`SVGOahAkcjC`,width:84.868,height:85.688,x:-15.001,y:-40.257,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:11.891})]}),(0,U.jsxs)(`filter`,{id:`SVGyT4fLePl`,width:79.454,height:90.917,x:-20.776,y:11.927,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:10.109})]}),(0,U.jsxs)(`filter`,{id:`SVGonSETbRF`,width:79.731,height:81.505,x:-19.845,y:15.459,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:10.109})]}),(0,U.jsxs)(`filter`,{id:`SVGSN7ofz6B`,width:75.117,height:73.758,x:29.832,y:-11.552,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:9.606})]}),(0,U.jsxs)(`filter`,{id:`SVGHvbpPvOn`,width:78.135,height:78.758,x:-38.583,y:-16.253,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:8.706})]}),(0,U.jsxs)(`filter`,{id:`SVG7JmfweRd`,width:78.877,height:77.539,x:8.107,y:-5.966,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:7.775})]}),(0,U.jsxs)(`filter`,{id:`SVGgGkiybCN`,width:56.272,height:51.81,x:13.587,y:-18.488,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:6.957})]}),(0,U.jsxs)(`filter`,{id:`SVGxEY6lcrm`,width:70.856,height:69.306,x:-15.526,y:-31.297,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:5.876})]}),(0,U.jsxs)(`filter`,{id:`SVGMZLCp0yD`,width:55.502,height:51.571,x:-14.168,y:20.964,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,U.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,U.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:7.273})]}),(0,U.jsxs)(`linearGradient`,{id:`SVG1oAMmOOu`,x1:18.447,x2:52.153,y1:43.42,y2:15.004,gradientUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`stop`,{stopColor:`#4893fc`}),(0,U.jsx)(`stop`,{offset:.27,stopColor:`#4893fc`}),(0,U.jsx)(`stop`,{offset:.777,stopColor:`#969dff`}),(0,U.jsx)(`stop`,{offset:1,stopColor:`#bd99fe`})]})]}),(0,U.jsx)(`path`,{fill:`#fff`,d:`M228.265 114.441c-19.721-8.49-36.974-20.134-51.776-34.927c-14.792-14.789-26.436-32.056-34.93-51.779a154 154 0 0 1-7.884-23.295A5.86 5.86 0 0 0 127.999 0a5.86 5.86 0 0 0-5.674 4.44a154 154 0 0 1-7.882 23.295c-8.494 19.723-20.141 36.99-34.929 51.779c-14.794 14.793-32.058 26.437-51.779 34.927a154 154 0 0 1-23.297 7.889A5.855 5.855 0 0 0 0 127.999a5.86 5.86 0 0 0 4.438 5.678a154 154 0 0 1 23.297 7.886c19.721 8.49 36.978 20.139 51.779 34.93c14.795 14.789 26.435 32.055 34.929 51.774a154 154 0 0 1 7.882 23.297a5.854 5.854 0 0 0 5.674 4.436a5.85 5.85 0 0 0 5.676-4.436a154 154 0 0 1 7.884-23.297q12.742-29.58 34.93-51.774c14.793-14.791 32.055-26.44 51.776-34.93a154 154 0 0 1 23.297-7.886a5.86 5.86 0 0 0 4.438-5.678a5.855 5.855 0 0 0-4.438-5.669a154.4 154.4 0 0 1-23.297-7.889`}),(0,U.jsx)(`g`,{filter:`url(#SVGqoIxVV2h)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:14.407,cy:16.95,fill:`#ffe432`,rx:14.407,ry:16.95,transform:`rotate(19.552 -44.576 -16.496)`})}),(0,U.jsx)(`g`,{filter:`url(#SVGOahAkcjC)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:27.433,cy:2.587,fill:`#fc413d`,rx:18.652,ry:19.062})}),(0,U.jsx)(`g`,{filter:`url(#SVGyT4fLePl)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:18.951,cy:57.386,fill:`#00b95c`,rx:19.493,ry:25.253,transform:`rotate(-2.799 18.951 57.386)`})}),(0,U.jsx)(`g`,{filter:`url(#SVGyT4fLePl)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:18.951,cy:57.386,fill:`#00b95c`,rx:19.493,ry:25.253,transform:`rotate(-2.799 18.951 57.386)`})}),(0,U.jsx)(`g`,{filter:`url(#SVGonSETbRF)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:20.02,cy:56.211,fill:`#00b95c`,rx:19.107,ry:21.035,transform:`rotate(-31.318 20.02 56.211)`})}),(0,U.jsx)(`g`,{filter:`url(#SVGSN7ofz6B)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:67.391,cy:25.327,fill:`#3186ff`,rx:18.346,ry:17.667})}),(0,U.jsx)(`g`,{filter:`url(#SVGHvbpPvOn)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:21.222,cy:22.384,fill:`#fbbc04`,rx:21.222,ry:22.384,transform:`rotate(37.252 9.752 -8.009)`})}),(0,U.jsx)(`g`,{filter:`url(#SVG7JmfweRd)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:24.469,cy:22.604,fill:`#3186ff`,rx:24.469,ry:22.604,transform:`rotate(34.51 19.587 64.852)`})}),(0,U.jsx)(`g`,{filter:`url(#SVGgGkiybCN)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`path`,{fill:`#749bff`,d:`M54.984-2.336c2.833 3.852-.808 11.34-8.131 16.727s-15.557 6.631-18.39 2.78c-2.833-3.853.807-11.342 8.13-16.728s15.558-6.631 18.39-2.78`})}),(0,U.jsx)(`g`,{filter:`url(#SVGxEY6lcrm)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:19.902,cy:3.356,fill:`#fc413d`,rx:27.971,ry:17.388,transform:`rotate(-42.848 19.902 3.356)`})}),(0,U.jsx)(`g`,{filter:`url(#SVGMZLCp0yD)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,U.jsx)(`ellipse`,{cx:13.583,cy:46.75,fill:`#ffee48`,rx:14.989,ry:8.717,transform:`rotate(35.592 13.583 46.75)`})}),(0,U.jsxs)(`mask`,{id:`SVGWpw6Gcvj`,width:65,height:65,x:0,y:0,maskUnits:`userSpaceOnUse`,style:{maskType:`alpha`},children:[(0,U.jsx)(`path`,{d:`M32.447 0c.68 0 1.273.465 1.439 1.125a39 39 0 0 0 1.999 5.905q3.23 7.5 8.854 13.125q5.627 5.626 13.125 8.855a39 39 0 0 0 5.906 1.999c.66.166 1.124.758 1.124 1.438s-.464 1.273-1.125 1.439a39 39 0 0 0-5.905 1.999q-7.5 3.23-13.125 8.854q-5.625 5.627-8.854 13.125a39 39 0 0 0-2 5.906a1.485 1.485 0 0 1-1.438 1.124c-.68 0-1.272-.464-1.438-1.125a39 39 0 0 0-2-5.905q-3.227-7.5-8.854-13.125q-5.625-5.625-13.125-8.854a39 39 0 0 0-5.905-2A1.485 1.485 0 0 1 0 32.448c0-.68.465-1.272 1.125-1.438a39 39 0 0 0 5.905-2q7.5-3.228 13.125-8.854q5.626-5.624 8.855-13.125a39 39 0 0 0 1.999-5.905A1.485 1.485 0 0 1 32.447 0`}),(0,U.jsx)(`path`,{fill:`url(#SVG1oAMmOOu)`,d:`M32.447 0c.68 0 1.273.465 1.439 1.125a39 39 0 0 0 1.999 5.905q3.23 7.5 8.854 13.125q5.627 5.626 13.125 8.855a39 39 0 0 0 5.906 1.999c.66.166 1.124.758 1.124 1.438s-.464 1.273-1.125 1.439a39 39 0 0 0-5.905 1.999q-7.5 3.23-13.125 8.854q-5.625 5.627-8.854 13.125a39 39 0 0 0-2 5.906a1.485 1.485 0 0 1-1.438 1.124c-.68 0-1.272-.464-1.438-1.125a39 39 0 0 0-2-5.905q-3.227-7.5-8.854-13.125q-5.625-5.625-13.125-8.854a39 39 0 0 0-5.905-2A1.485 1.485 0 0 1 0 32.448c0-.68.465-1.272 1.125-1.438a39 39 0 0 0 5.905-2q7.5-3.228 13.125-8.854q5.626-5.624 8.855-13.125a39 39 0 0 0 1.999-5.905A1.485 1.485 0 0 1 32.447 0`})]})]})),hs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 231`,width:`1.34em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`defs`,{children:(0,U.jsxs)(`linearGradient`,{id:`SVGR9diIphF`,x1:`108.633%`,x2:`46.927%`,y1:`13.818%`,y2:`78.776%`,children:[(0,U.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]})}),(0,U.jsxs)(`g`,{fill:`none`,children:[(0,U.jsx)(`path`,{d:`M101.272 152.561h53.449l12.901-75.319H87.06z`}),(0,U.jsx)(`path`,{fill:`#2684ff`,d:`M8.308 0A8.202 8.202 0 0 0 .106 9.516l34.819 211.373a11.155 11.155 0 0 0 10.909 9.31h167.04a8.2 8.2 0 0 0 8.201-6.89l34.82-213.752a8.202 8.202 0 0 0-8.203-9.514zm146.616 152.768h-53.315l-14.436-75.42h80.67z`}),(0,U.jsx)(`path`,{fill:`url(#SVGR9diIphF)`,d:`M244.61 77.242h-76.916l-12.909 75.36h-53.272l-62.902 74.663a11.1 11.1 0 0 0 7.171 2.704H212.73a8.196 8.196 0 0 0 8.196-6.884z`})]})]})),gs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:`SVGSBI7obaC`,x1:`98.031%`,x2:`58.888%`,y1:`.161%`,y2:`40.766%`,children:[(0,U.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]}),(0,U.jsxs)(`linearGradient`,{id:`SVGHifZlbzE`,x1:`100.665%`,x2:`55.402%`,y1:`.455%`,y2:`44.727%`,children:[(0,U.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]})]}),(0,U.jsx)(`path`,{fill:`#2684ff`,d:`M244.658 0H121.707a55.5 55.5 0 0 0 55.502 55.502h22.649V77.37c.02 30.625 24.841 55.447 55.466 55.467V10.666C255.324 4.777 250.55 0 244.658 0`}),(0,U.jsx)(`path`,{fill:`url(#SVGSBI7obaC)`,d:`M183.822 61.262H60.872c.019 30.625 24.84 55.447 55.466 55.467h22.649v21.938c.039 30.625 24.877 55.43 55.502 55.43V71.93c0-5.891-4.776-10.667-10.667-10.667`}),(0,U.jsx)(`path`,{fill:`url(#SVGHifZlbzE)`,d:`M122.951 122.489H0c0 30.653 24.85 55.502 55.502 55.502h22.72v21.867c.02 30.597 24.798 55.408 55.396 55.466V133.156c0-5.891-4.776-10.667-10.667-10.667`})]})),_s=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 339`,width:`0.92em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{d:`M189.485 144.651c-3.445.99-6.306 3.4-7.867 6.626l-1.015 2.087l.014 2.918c0 2.721.057 3.06.832 4.977c1.072 2.72 2.143 4.399 4.103 6.316c3.383 3.355 7.19 4.23 12.294 2.89a12.13 12.13 0 0 0 7.288-6.147a10.6 10.6 0 0 0 1.128-7.02c-.902-6.387-4.652-11.026-10.207-12.647a14.94 14.94 0 0 0-6.57 0m-129.746.07c-4.3 1.354-7.515 4.512-9.164 9.01a16.7 16.7 0 0 0-.846 7.33c.803 4.357 4.37 8.319 8.43 9.404c5.104 1.34 8.91.465 12.294-2.89c1.974-1.917 3.031-3.595 4.103-6.316c.775-1.917.832-2.256.832-4.977l.014-2.918l-1.015-2.087a12.6 12.6 0 0 0-7.966-6.654a14.4 14.4 0 0 0-6.682.099m58.987 28.197c-1.847 1.001-3.144 3.525-2.75 5.4c.438 2.016 2.214 4.06 4.977 5.738c1.48.888 1.58 1.015 1.65 1.917c.056.536-.141 2.059-.409 3.426c-.282 1.325-.507 2.735-.507 3.13c.028 1.043.986 2.75 2.016 3.567c.902.733 1.071.761 3.595.832c2.312.07 2.791.014 3.722-.423c2.382-1.156 2.988-3.3 2.114-7.402c-.733-3.426-.592-3.947 1.227-5.005c1.931-1.128 3.962-3.087 4.568-4.427a5.146 5.146 0 0 0-2.467-6.767a5.56 5.56 0 0 0-2.552-.465c-1.777 0-2.919.423-5.005 1.748l-1.198.747l-.748-.45c-3.087-1.834-3.651-2.045-5.512-2.017a5.6 5.6 0 0 0-2.721.451m5.498-30.946c-5.258.508-6.696.705-9.22 1.213c-4.103.846-9.587 2.75-13.408 4.624c-13.252 6.485-22.402 17.285-25.193 29.804c-.564 2.481-.635 3.299-.635 7.472c0 4.145.07 5.033.607 7.388c3.722 16.354 18.779 28.436 38.262 30.635c4.23.465 22.501.465 26.73 0c15.65-1.762 29.1-10.25 35.148-22.148c1.607-3.186 2.382-5.245 3.101-8.487c.55-2.355.62-3.243.62-7.374c0-4.187-.07-5.005-.634-7.486c-4.06-18.187-21.697-32.482-43.31-35.203a97 97 0 0 0-12.054-.438zm9.094 13.21a46.3 46.3 0 0 1 20.301 7.247c3.144 2.087 7.571 6.457 9.46 9.333c2.34 3.539 3.666 7.162 4.272 11.56c.282 2.017.14 3.54-.606 6.796c-1.128 4.864-4.68 9.94-9.474 13.492a44 44 0 0 1-9.714 4.906c-5.386 1.72-8.91 2.03-21.5 1.946c-8.205-.085-9.671-.141-12.026-.592c-8.036-1.509-14.408-4.709-19.033-9.587c-3.721-3.947-5.427-7.543-6.344-13.337c-.423-2.707.353-7.176 1.932-10.94c1.917-4.596 6.88-10.292 11.786-13.577c5.681-3.792 13.168-6.485 20.048-7.218c2.636-.282 8.261-.282 10.898-.028M55.735.103a23.3 23.3 0 0 0-9.63 4.2c-8.092 6.133-14.352 19.188-17.002 35.444c-.987 6.147-1.678 14.662-1.678 21.19c0 7.669.903 17.481 2.186 24.263c.282 1.508.437 2.847.324 2.932q-1.302 1.091-2.637 2.143a75 75 0 0 0-13.379 14.38A77.4 77.4 0 0 0 .667 137.63a93.4 93.4 0 0 0-.325 19.132c1.283 10.996 4.582 20.273 10.25 28.76l1.833 2.75l-.522.902c-3.792 6.372-7.02 15.578-8.53 24.418c-1.184 6.993-1.339 8.868-1.339 18.243c0 9.446.127 11.321 1.24 17.848c1.34 7.825 4.061 16.115 7.092 21.627c1.001 1.805 3.426 5.54 3.722 5.738c.099.043-.197.945-.648 1.988a104.4 104.4 0 0 0-7.726 26.406c-.874 5.88-1.001 7.783-1.001 13.972c0 7.895.437 11.73 2.087 18.031l.24.917h20.836l-.704-1.283c-4.188-7.782-4.582-22.205-.96-36.613c1.65-6.655 3.525-11.547 7.022-18.272l2.086-4.088v-2.496c0-2.326-.042-2.594-.803-4.13a12.9 12.9 0 0 0-2.735-3.525a24.5 24.5 0 0 1-5.428-7.655c-5.978-12.97-7.134-32.23-2.933-48.654c1.749-6.851 4.639-12.942 7.67-16.27a11.1 11.1 0 0 0 3.144-7.485c0-2.75-.987-5.005-3.158-7.36a44.2 44.2 0 0 1-11.519-24.376c-1.973-13.534 1.608-28.267 9.728-39.954c7.938-11.476 19.075-18.836 31.538-20.795c2.806-.465 8.036-.395 10.94.14c3.187.565 5.175.396 7.219-.577c2.523-1.199 3.778-2.679 5.273-6.077c1.31-3.03 2.326-4.694 5.075-8.12c3.299-4.089 6.485-6.894 11.589-10.278c5.822-3.806 12.463-6.584 19.06-7.909c2.397-.493 3.525-.564 8.023-.564s5.61.07 8.022.564a57.4 57.4 0 0 1 26.984 14.056c1.65 1.537 5.61 6.443 6.88 8.487c.479.804 1.339 2.496 1.86 3.764c1.48 3.398 2.75 4.878 5.273 6.063c1.974.958 4.032 1.156 7.092.634c4.836-.818 8.557-.747 13.294.226c16.129 3.242 30.17 16.537 36.388 34.357c5.428 15.621 3.891 31.961-4.173 44.452c-1.367 2.115-2.72 3.807-4.695 5.907c-4.243 4.54-4.243 10.18-.014 14.846c6.95 7.599 11.293 26.307 9.982 42.802c-.874 10.884-3.666 20.626-7.515 26.139a29.6 29.6 0 0 1-3.158 3.637a12.9 12.9 0 0 0-2.735 3.524c-.76 1.537-.803 1.805-.803 4.131v2.51l2.086 4.088c3.497 6.711 5.358 11.603 7.021 18.258c3.567 14.21 3.257 28.337-.832 36.387q-.353.671-.62 1.382c0 .084 4.639.127 10.32.127h10.292l.282-1.043l.507-1.89c.268-1.071.804-4.23 1.241-7.274c.409-3.06.409-14.324 0-17.736c-1.55-12.336-4.159-22.134-8.417-31.383c-.45-1.043-.747-1.945-.648-1.988c.113-.07.803-1.043 1.522-2.143c5.301-8.022 8.558-18.102 10.208-31.41c.437-3.666.437-19.428 0-22.953c-1.17-9.093-2.566-15.254-4.907-21.5a86 86 0 0 0-4.638-9.868l-.536-.903l1.847-2.735c5.668-8.515 8.967-17.792 10.25-28.76a93.4 93.4 0 0 0-.339-19.146a77.7 77.7 0 0 0-13.238-32.976a75 75 0 0 0-13.393-14.38a114 114 0 0 1-2.623-2.143a9.8 9.8 0 0 1 .325-2.932c2.932-15.325 2.833-34.443-.24-49.387c-2.679-13.027-7.543-23.375-13.816-29.352c-4.991-4.766-10.095-6.796-16.213-6.415c-14.042.832-25.377 16.988-29.832 42.436a96 96 0 0 0-1.368 10.235c0 .508-.099.93-.211.93a13.5 13.5 0 0 1-2.101-1.099a68.5 68.5 0 0 0-34.611-9.827c-11.73 0-23.784 3.426-34.626 9.841c-.662.427-1.36.795-2.086 1.1c-.113 0-.212-.423-.212-.93a95 95 0 0 0-1.367-10.222C85.665 19.627 76.36 4.5 63.996.679A29.6 29.6 0 0 0 55.75.101zm4.13 19.765c3.497 2.777 7.374 10.7 9.616 19.569c.422 1.593.845 3.44.972 4.116c.099.663.367 2.143.578 3.285c.945 5.146 1.382 10.715 1.438 17.482l.029 6.697l-1.692 2.467l-1.664 2.51h-3.92c-4.567 0-9.107.577-13.449 1.748l-3.355.846c-.466.098-.536-.043-.804-2.03a119 119 0 0 1 .226-32.751c1.748-11.11 5.822-21.162 9.812-24.122c.945-.705 1.114-.691 2.213.183m138.516-.17c2.397 1.777 5.047 6.486 7.021 12.52c3.948 12.04 5.076 28.592 2.99 44.34c-.269 1.973-.34 2.128-.805 2.03l-3.355-.846a52 52 0 0 0-13.45-1.749h-3.919l-1.678-2.509l-1.677-2.467l.028-6.683c.056-9.432.93-16.777 3.017-24.982c2.213-8.783 6.118-16.707 9.587-19.484c1.1-.874 1.268-.888 2.241-.17`})]})),vs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 260`,width:`1.19em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{d:`M239.184 106.203a64.72 64.72 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.72 64.72 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.67 64.67 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.77 64.77 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483m-97.56 136.338a48.4 48.4 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.6 8.6 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601M37.158 197.93a48.35 48.35 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.34 8.34 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803M23.549 85.38a48.5 48.5 0 0 1 25.58-21.333v61.39a8.29 8.29 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.82.82 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405zm179.466 41.695l-63.08-36.63L161.73 77.86a.82.82 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.54 8.54 0 0 0-4.4-7.213m21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.72.72 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391zM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.6 8.6 0 0 0-4.246 7.367zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218z`})]})),ys=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M254.953 144.253c8.959-70.131-40.569-134.248-110.572-143.206C74.378-7.912 10.005 41.616 1.047 111.619c-8.959 70.003 40.569 134.248 110.572 143.334c70.131 8.959 134.248-40.569 143.334-110.7`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`m174.2 82.184l-54.007 54.007l-15.23-15.23c53.111-53.11 58.358-48.503 69.236-38.777`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M120.193 137.47c-.384 0-.64-.128-.896-.384l-15.357-15.229a1.237 1.237 0 0 1 0-1.791c54.006-54.007 59.637-48.888 71.027-38.65c.256.256.384.512.384.896s-.128.64-.384.896l-54.006 53.878c-.128.256-.512.384-.768.384m-13.437-16.509l13.437 13.438l52.087-52.087c-9.47-8.446-15.87-11.006-65.524 38.65`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`m135.678 151.676l-14.717-14.718l54.006-54.006c14.462 14.59-7.166 38.265-39.289 68.724`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M135.678 152.956c-.384 0-.64-.128-.895-.384l-14.718-14.718c-.256-.256-.256-.512-.256-.896c0-.383.128-.64.384-.895L174.2 82.056a1.237 1.237 0 0 1 1.792 0a15.58 15.58 0 0 1 4.991 11.902c-.256 14.206-16.38 32.25-44.28 58.614c-.384.256-.768.384-1.024.384m-12.925-15.998c8.19 8.319 11.646 11.646 12.925 12.926c21.5-20.476 42.36-41.464 42.489-55.926c.128-3.327-1.152-6.655-3.328-9.214z`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`m105.22 121.345l10.878 10.878q.384.384 0 .768c-.128.128-.128.128-.256.128l-22.524 4.863c-1.152.128-2.176-.64-2.432-1.791c-.128-.64.128-1.28.512-1.664l13.054-13.054c.256-.256.64-.384.768-.128`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M92.934 139.262c-1.92 0-3.327-1.536-3.327-3.455c0-.896.384-1.792 1.024-2.432l13.053-13.054c.768-.64 1.792-.64 2.56 0l10.878 10.878c.768.64.768 1.792 0 2.56c-.256.256-.512.384-.896.512l-22.524 4.863c-.256 0-.512.128-.768.128m11.902-16.509l-12.542 12.542c-.256.256-.384.64-.128 1.024c.128.384.512.511.896.384l21.116-4.608z`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`M202.738 52.238c-8.19-7.935-21.372-7.679-29.306.64c-7.935 8.318-7.679 21.372.64 29.306A20.68 20.68 0 0 0 199.154 85l-14.59-14.59z`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M188.405 89.223c-12.158 0-22.012-9.854-22.012-22.012s9.854-22.012 22.012-22.012c5.63 0 11.134 2.176 15.23 6.143c.255.256.383.512.383.896s-.128.64-.384.896L186.357 70.41l13.566 13.566c.512.512.512 1.28 0 1.792l-.256.256c-3.328 2.047-7.295 3.2-11.262 3.2m0-41.336c-10.75 0-19.453 8.702-19.325 19.452c0 10.75 8.703 19.453 19.453 19.325c2.943 0 5.887-.64 8.574-2.048l-13.437-13.31c-.256-.256-.384-.512-.384-.896c0-.383.128-.64.384-.895l17.149-17.15c-3.456-2.943-7.807-4.478-12.414-4.478`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`m203.122 52.622l-.256-.256l-18.3 18.044l14.461 14.462c1.408-.896 2.815-1.92 3.967-3.072a20.51 20.51 0 0 0 .128-29.178`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M199.155 86.28c-.384 0-.64-.128-.896-.384l-14.59-14.59c-.255-.256-.383-.512-.383-.896c0-.383.128-.64.384-.895l18.172-18.173a1.237 1.237 0 0 1 1.792 0l.384.256c8.575 8.574 8.575 22.396.128 31.098c-1.28 1.28-2.687 2.432-4.223 3.328c-.384.128-.64.256-.768.256m-12.798-15.87l12.926 12.926c1.024-.64 2.048-1.536 2.815-2.303c7.295-7.295 7.679-19.197.64-26.876z`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`M176.375 84.488a7.88 7.88 0 0 0-11.134 0l-48.247 48.247l8.062 8.063l51.063-44.792c3.328-2.816 3.583-7.807.768-11.134c-.256-.128-.384-.256-.512-.384`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M124.928 142.078c-.384 0-.64-.128-.896-.384l-8.062-8.063a1.237 1.237 0 0 1 0-1.792l48.247-48.247a9.115 9.115 0 0 1 12.926 0a9.115 9.115 0 0 1 0 12.926l-.384.384l-51.063 44.792q-.192.384-.768.384m-6.143-9.343l6.271 6.271l50.167-44.024c2.816-2.304 3.072-6.527.768-9.342c-2.303-2.816-6.527-3.072-9.342-.768c-.128.128-.256.256-.512.384z`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`M80.008 187.637c-.511.256-.767.768-.64 1.28l2.176 9.214c.512 1.28-.256 2.816-1.664 3.2c-1.023.384-2.175 0-2.815-.768l-14.078-13.95l45.944-45.943l15.87.256l10.75 10.75c-2.56 2.175-18.045 17.149-55.543 35.961`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M78.985 202.61c-1.024 0-2.048-.383-2.688-1.151l-13.95-13.95c-.255-.256-.383-.512-.383-.895c0-.384.128-.64.384-.896l45.943-45.944c.256-.256.64-.384.896-.384l15.87.256c.383 0 .64.128.895.384l10.75 10.75c.256.256.384.64.384 1.024s-.128.64-.512.896l-.896.767c-13.565 11.902-31.994 23.804-54.902 35.194l2.176 9.087c.384 1.663-.384 3.455-1.92 4.35c-.768.385-1.408.513-2.047.513m-14.078-15.996l13.182 13.053c.384.64 1.152.896 1.791.512c.64-.384.896-1.152.512-1.792l-2.175-9.214c-.256-1.152.256-2.176 1.28-2.687c22.651-11.39 40.952-23.164 54.39-34.81l-9.47-9.47l-14.718-.256z`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`m52.11 197.62l11.005-11.006l16.382 16.38l-26.108-1.791c-1.152-.128-1.92-1.152-1.791-2.304c0-.512.128-1.024.511-1.28`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`m79.497 204.146l-26.236-1.791c-1.92-.128-3.2-1.792-3.071-3.712c.128-.768.384-1.535 1.024-2.047L62.22 185.59a1.237 1.237 0 0 1 1.791 0l16.381 16.38c.384.385.512.897.256 1.408q-.384.768-1.151.768m-16.382-15.74l-10.11 10.11c-.384.255-.384.895 0 1.151c.128.128.256.256.512.256l22.652 1.536zm41.337-41.849c-.768 0-1.28-.64-1.28-1.28c0-.384.128-.64.384-.896l12.414-12.414a1.237 1.237 0 0 1 1.792 0l8.062 8.063c.384.384.512.768.384 1.28c-.128.384-.512.768-1.024.896l-20.476 4.35zm12.414-11.902l-8.447 8.446l13.822-2.943z`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`m124.8 140.926l-14.077 3.071c-1.024.256-2.048-.384-2.304-1.408c-.128-.64 0-1.28.512-1.791l7.807-7.807z`}),(0,U.jsx)(`path`,{fill:`#ff6c37`,d:`M110.467 145.277a3.17 3.17 0 0 1-3.2-3.2c0-.895.384-1.663.896-2.303l7.807-7.807a1.237 1.237 0 0 1 1.792 0l8.062 8.063c.384.384.512.768.384 1.28c-.128.384-.512.768-1.024.896l-14.077 3.071zm6.399-10.622l-6.911 6.91c-.256.257-.256.513-.128.768q.192.384.768.384l11.774-2.56zm86.384-69.748c-.256-.767-1.152-1.151-1.92-.895c-.767.256-1.151 1.151-.895 1.92c0 .127.128.255.128.383c.768 1.536.512 3.456-.512 4.863c-.512.64-.384 1.536.128 2.048c.64.512 1.535.384 2.047-.256c1.92-2.432 2.304-5.503 1.024-8.063`})]})),bs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 227`,width:`1.36em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#362d59`,d:`M148.368 12.403a23.935 23.935 0 0 0-41.003 0L73.64 70.165c52.426 26.174 87.05 78.177 90.975 136.642h-23.679c-3.918-50.113-34.061-94.41-79.238-116.448l-31.213 53.97a81.6 81.6 0 0 1 47.307 62.375h-54.38a3.895 3.895 0 0 1-3.178-5.69l15.069-25.626a55 55 0 0 0-17.221-9.738L3.167 191.277a23.27 23.27 0 0 0 8.662 31.982a23.9 23.9 0 0 0 11.583 3.075h74.471a99.43 99.43 0 0 0-41.003-88.72l11.84-20.5c35.679 24.504 55.754 66.038 52.79 109.22h63.094c2.99-65.43-29.047-127.512-84.107-162.986l23.935-41.002a3.947 3.947 0 0 1 5.382-1.384c2.716 1.486 103.993 178.208 105.89 180.258a3.895 3.895 0 0 1-3.486 5.792h-24.396q.46 9.789 0 19.528h24.499A23.53 23.53 0 0 0 256 202.91a23 23 0 0 0-3.178-11.685z`})]})),xs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 239`,width:`1.3em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:`SVGCo9xpmZW`,x1:`17.372%`,x2:`82.628%`,y1:`-6.51%`,y2:`106.51%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#5a62c3`}),(0,U.jsx)(`stop`,{offset:`50%`,stopColor:`#4d55bd`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#3940ab`})]}),(0,U.jsx)(`path`,{id:`SVGhJCUgeMn`,d:`M136.93 64.476v12.8a32.7 32.7 0 0 1-5.953-.952a38.7 38.7 0 0 1-26.79-22.742h21.848c6.008.022 10.872 4.887 10.895 10.894`})]}),(0,U.jsx)(`path`,{fill:`#5059c9`,d:`M178.563 89.302h66.125c6.248 0 11.312 5.065 11.312 11.312v60.231c0 22.96-18.613 41.574-41.573 41.574h-.197c-22.96.003-41.576-18.607-41.579-41.568V95.215a5.91 5.91 0 0 1 5.912-5.913`}),(0,U.jsx)(`circle`,{cx:223.256,cy:50.605,r:26.791,fill:`#5059c9`}),(0,U.jsx)(`circle`,{cx:139.907,cy:38.698,r:38.698,fill:`#7b83eb`}),(0,U.jsx)(`path`,{fill:`#7b83eb`,d:`M191.506 89.302H82.355c-6.173.153-11.056 5.276-10.913 11.449v68.697c-.862 37.044 28.445 67.785 65.488 68.692c37.043-.907 66.35-31.648 65.489-68.692v-68.697c.143-6.173-4.74-11.296-10.913-11.449`}),(0,U.jsx)(`path`,{d:`M142.884 89.302v96.268a10.96 10.96 0 0 1-6.787 10.062c-1.3.55-2.697.833-4.108.833H76.68c-.774-1.965-1.488-3.93-2.084-5.953a72.5 72.5 0 0 1-3.155-21.076v-68.703c-.143-6.163 4.732-11.278 10.895-11.43z`,opacity:.1}),(0,U.jsx)(`path`,{d:`M136.93 89.302v102.222c0 1.411-.283 2.808-.833 4.108a10.96 10.96 0 0 1-10.062 6.787H79.48c-1.012-1.965-1.965-3.93-2.798-5.954a59 59 0 0 1-2.084-5.953a72.5 72.5 0 0 1-3.155-21.076v-68.703c-.143-6.163 4.732-11.278 10.895-11.43z`,opacity:.2}),(0,U.jsx)(`path`,{d:`M136.93 89.302v90.315c-.045 5.998-4.896 10.85-10.895 10.895H74.597a72.5 72.5 0 0 1-3.155-21.076v-68.703c-.143-6.163 4.732-11.278 10.895-11.43z`,opacity:.2}),(0,U.jsx)(`path`,{d:`M130.977 89.302v90.315c-.046 5.998-4.897 10.85-10.895 10.895H74.597a72.5 72.5 0 0 1-3.155-21.076v-68.703c-.143-6.163 4.732-11.278 10.895-11.43z`,opacity:.2}),(0,U.jsx)(`path`,{d:`M142.884 58.523v18.753c-1.012.06-1.965.12-2.977.12s-1.965-.06-2.977-.12a32.7 32.7 0 0 1-5.953-.952a38.7 38.7 0 0 1-26.791-22.742a33 33 0 0 1-1.905-5.954h29.708c6.007.023 10.872 4.887 10.895 10.895`,opacity:.1}),(0,U.jsx)(`use`,{href:`#SVGhJCUgeMn`,opacity:.2}),(0,U.jsx)(`use`,{href:`#SVGhJCUgeMn`,opacity:.2}),(0,U.jsx)(`path`,{d:`M130.977 64.476v11.848a38.7 38.7 0 0 1-26.791-22.743h15.896c6.008.023 10.872 4.888 10.895 10.895`,opacity:.2}),(0,U.jsx)(`path`,{fill:`url(#SVGCo9xpmZW)`,d:`M10.913 53.581h109.15c6.028 0 10.914 4.886 10.914 10.913v109.151c0 6.027-4.886 10.913-10.913 10.913H10.913C4.886 184.558 0 179.672 0 173.645V64.495C0 58.466 4.886 53.58 10.913 53.58`}),(0,U.jsx)(`path`,{fill:`#fff`,d:`M94.208 95.125h-21.82v59.416H58.487V95.125H36.769V83.599h57.439z`})]})),Ss=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#0078d4`,d:`M0 0h121.329v121.329H0zm134.671 0H256v121.329H134.671zM0 134.671h121.329V256H0zm134.671 0H256V256H134.671z`})]})),Cs=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 128 128`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`defs`,{children:(0,U.jsxs)(`linearGradient`,{id:`SVG6uMEBcPj`,x1:9,x2:9,y1:16.97,y2:1.03,gradientTransform:`scale(7.11111)`,gradientUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`stop`,{offset:0,stopColor:`#0078d4`}),(0,U.jsx)(`stop`,{offset:.16,stopColor:`#1380da`}),(0,U.jsx)(`stop`,{offset:.53,stopColor:`#3c91e5`}),(0,U.jsx)(`stop`,{offset:.82,stopColor:`#559cec`}),(0,U.jsx)(`stop`,{offset:1,stopColor:`#5ea0ef`})]})}),(0,U.jsx)(`path`,{fill:`url(#SVG6uMEBcPj)`,d:`M120.89 28.445v69.262l-28.445 23.324l-44.09-16.07v15.93L23.395 88.25l72.746 5.688V31.574ZM96.64 31.93L55.82 7.11v16.285L18.348 34.418L7.109 48.852v32.785l16.075 7.11V46.718Zm0 0`})]})),ws=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 128 128`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#1a62b3`,d:`M50.782 42.96h26.436a7.536 7.536 0 0 1 7.553 7.552v26.976a7.536 7.536 0 0 1-7.553 7.552H50.782a7.536 7.536 0 0 1-7.553-7.552V50.512a7.536 7.536 0 0 1 7.553-7.553zm55.803 41.611V34.477A13.566 13.566 0 0 0 92.99 20.88H35.01a13.566 13.566 0 0 0-13.595 13.596v59.046a13.566 13.566 0 0 0 13.595 13.595l92.171.002c-.935 11.716-10.67 20.88-22.623 20.88H23.442A22.61 22.61 0 0 1 .783 105.341V22.66A22.61 22.61 0 0 1 23.443 0h81.115a22.61 22.61 0 0 1 22.659 22.66v61.91z`})]})),Ts=(0,H.forwardRef)(({title:e,titleId:t,...n},r)=>(0,U.jsxs)(`svg`,{viewBox:`0 0 128 128`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,U.jsx)(`title`,{id:t,children:e}):null,(0,U.jsx)(`path`,{fill:`#50d18d`,d:`m37.701 127.439l-15.398-14.782a1.813 1.813 0 0 1 0-2.666l15.41-14.773a2.005 2.005 0 0 1 2.78 0l15.412 14.783c.778.73.778 1.936 0 2.666L40.494 127.44a2.003 2.003 0 0 1-2.78 0zm24.907-23.89l-15.41-14.783a1.813 1.813 0 0 1 0-2.656l15.41-14.782a2.005 2.005 0 0 1 2.78 0L80.79 86.11c.778.73.778 1.936 0 2.666l-15.4 14.773a2.01 2.01 0 0 1-2.774 0zm24.908-23.892l-15.4-14.783a1.81 1.81 0 0 1 0-2.656L87.52 47.437a2.005 2.005 0 0 1 2.78 0l15.402 14.781a1.81 1.81 0 0 1 0 2.656L90.29 79.657a2.006 2.006 0 0 1-2.779 0h.01zm-49.346.447L22.758 65.333a1.817 1.817 0 0 1 0-2.66l15.412-14.79a2.004 2.004 0 0 1 2.779 0l15.41 14.784a1.81 1.81 0 0 1 0 2.656L40.95 80.116a2.007 2.007 0 0 1-2.78 0zm24.906-23.89L47.664 41.441a1.817 1.817 0 0 1 0-2.668l15.412-14.781a2.004 2.004 0 0 1 2.78 0l15.4 14.781a1.81 1.81 0 0 1 0 2.658l-15.4 14.781a2.006 2.006 0 0 1-2.774 0v-.01v.005zm-24.43-23.41l-15.42-14.828a1.814 1.814 0 0 1 0-2.667L38.647.56a2.004 2.004 0 0 1 2.78 0l15.41 14.782c.78.731.78 1.937 0 2.667l-15.42 14.75a2.004 2.004 0 0 1-2.78 0l.01.032z`})]})),Es=`/assets/dataverse-CH0w-aF1.png`,Ds=`/assets/zephyr-BNWDPG5u.png`,Os=(e,t,n)=>r=>(0,U.jsx)(`svg`,{viewBox:`0 0 ${t} ${n}`,...r,children:(0,U.jsx)(`image`,{href:e,width:t,height:n})}),ks=e=>(0,U.jsxs)(`svg`,{viewBox:`-55 0 209 209`,...e,children:[(0,U.jsx)(`path`,{fill:`#31b34b`,d:`m98.092 104.307l-49.011 12.252l-24.54 91.807z`,opacity:`.5`}),(0,U.jsx)(`path`,{fill:`#31b34b`,d:`M98.092 104.307L0 129.024V67.443h73.551l24.718 36.828z`,opacity:`.8`}),(0,U.jsx)(`path`,{fill:`#31b34b`,d:`M0 67.443v61.44L73.551 0z`})]}),As=e=>(0,U.jsxs)(`svg`,{viewBox:`0 0 256 153`,...e,children:[(0,U.jsx)(`path`,{className:`logo-ink`,fill:`#252f3e`,d:`M72.392 55.438c0 3.137.34 5.68.933 7.545a45.4 45.4 0 0 0 2.712 6.103c.424.678.593 1.356.593 1.95c0 .847-.508 1.695-1.61 2.543l-5.34 3.56c-.763.509-1.526.763-2.205.763c-.847 0-1.695-.424-2.543-1.187a26 26 0 0 1-3.051-3.984c-.848-1.44-1.696-3.052-2.628-5.001q-9.919 11.697-24.922 11.698c-7.12 0-12.8-2.035-16.954-6.103c-4.153-4.07-6.272-9.495-6.272-16.276c0-7.205 2.543-13.054 7.714-17.462c5.17-4.408 12.037-6.612 20.768-6.612c2.882 0 5.849.254 8.985.678c3.137.424 6.358 1.102 9.749 1.865V29.33c0-6.443-1.357-10.935-3.985-13.563c-2.712-2.628-7.29-3.9-13.817-3.9c-2.967 0-6.018.34-9.155 1.103s-6.188 1.695-9.155 2.882c-1.356.593-2.373.932-2.967 1.102s-1.017.254-1.356.254c-1.187 0-1.78-.848-1.78-2.628v-4.154c0-1.356.17-2.373.593-2.966c.424-.594 1.187-1.187 2.374-1.78q4.45-2.29 10.68-3.815C33.908.763 38.316.255 42.978.255c10.088 0 17.463 2.288 22.21 6.866c4.662 4.577 7.036 11.528 7.036 20.853v27.464zM37.976 68.323c2.798 0 5.68-.508 8.731-1.526c3.052-1.017 5.765-2.882 8.053-5.425c1.357-1.61 2.374-3.39 2.882-5.425c.509-2.034.848-4.493.848-7.375v-3.56a71 71 0 0 0-7.799-1.441a64 64 0 0 0-7.968-.509c-5.68 0-9.833 1.102-12.63 3.391s-4.154 5.51-4.154 9.748c0 3.984 1.017 6.951 3.136 8.986c2.035 2.119 5.002 3.136 8.901 3.136m68.069 9.155c-1.526 0-2.543-.254-3.221-.848c-.678-.508-1.272-1.695-1.78-3.305L81.124 7.799c-.51-1.696-.764-2.798-.764-3.391c0-1.356.678-2.12 2.035-2.12h8.307c1.61 0 2.713.255 3.306.848c.678.509 1.187 1.696 1.695 3.306l14.241 56.117l13.224-56.117c.424-1.695.933-2.797 1.61-3.306c.679-.508 1.866-.847 3.392-.847h6.781c1.61 0 2.713.254 3.39.847c.679.509 1.272 1.696 1.611 3.306l13.394 56.795L168.01 6.442c.508-1.695 1.102-2.797 1.695-3.306c.678-.508 1.78-.847 3.306-.847h7.883c1.357 0 2.12.678 2.12 2.119c0 .424-.085.848-.17 1.356s-.254 1.187-.593 2.12l-20.43 65.525q-.762 2.544-1.78 3.306c-.678.509-1.78.848-3.22.848h-7.29c-1.611 0-2.713-.254-3.392-.848c-.678-.593-1.271-1.695-1.61-3.39l-13.14-54.676l-13.054 54.59c-.423 1.696-.932 2.798-1.61 3.391c-.678.594-1.865.848-3.39.848zm108.927 2.289c-4.408 0-8.816-.509-13.054-1.526c-4.239-1.017-7.544-2.12-9.748-3.39c-1.357-.764-2.29-1.611-2.628-2.374a6 6 0 0 1-.509-2.374V65.78c0-1.78.678-2.628 1.95-2.628a4.8 4.8 0 0 1 1.526.255c.508.17 1.271.508 2.119.847a46 46 0 0 0 9.324 2.967a51 51 0 0 0 10.088 1.017c5.34 0 9.494-.932 12.376-2.797s4.408-4.577 4.408-8.053c0-2.373-.763-4.323-2.289-5.934s-4.408-3.051-8.561-4.408l-12.292-3.814c-6.188-1.95-10.765-4.832-13.563-8.647c-2.797-3.73-4.238-7.883-4.238-12.291q0-5.34 2.289-9.41c1.525-2.712 3.56-5.085 6.103-6.95c2.543-1.95 5.425-3.391 8.816-4.408c3.39-1.017 6.95-1.441 10.68-1.441c1.865 0 3.815.085 5.68.339c1.95.254 3.73.593 5.51.932c1.695.424 3.306.848 4.832 1.357q2.288.762 3.56 1.525c1.187.679 2.034 1.357 2.543 2.12q.763 1.017.763 2.797v3.984c0 1.78-.678 2.713-1.95 2.713c-.678 0-1.78-.34-3.22-1.018q-7.25-3.306-16.276-3.306c-4.832 0-8.647.763-11.275 2.374c-2.627 1.61-3.984 4.069-3.984 7.544c0 2.374.848 4.408 2.543 6.019s4.832 3.221 9.325 4.662l12.037 3.815c6.103 1.95 10.511 4.662 13.139 8.137s3.9 7.46 3.9 11.868c0 3.645-.764 6.951-2.205 9.833c-1.525 2.882-3.56 5.425-6.188 7.46c-2.628 2.119-5.764 3.645-9.409 4.747c-3.815 1.187-7.799 1.78-12.122 1.78`}),(0,U.jsx)(`path`,{fill:`#f90`,d:`M230.993 120.964c-27.888 20.599-68.408 31.534-103.247 31.534c-48.827 0-92.821-18.056-126.05-48.064c-2.628-2.373-.255-5.594 2.881-3.73c35.942 20.854 80.276 33.484 126.136 33.484c30.94 0 64.932-6.442 96.212-19.666c4.662-2.12 8.646 3.052 4.068 6.442m11.614-13.224c-3.56-4.577-23.566-2.204-32.636-1.102c-2.713.34-3.137-2.034-.678-3.814c15.936-11.19 42.13-7.968 45.181-4.239c3.052 3.815-.848 30.008-15.767 42.554c-2.288 1.95-4.492.933-3.475-1.61c3.39-8.393 10.935-27.296 7.375-31.789`})]}),js=e=>(0,U.jsxs)(`svg`,{viewBox:`0 0 18.02 20.27`,fill:`#000`,...e,children:[(0,U.jsx)(`path`,{d:`M18.0137 0H12.6097V13.0595H18.0137V0Z`}),(0,U.jsx)(`path`,{d:`M5.4043 0H0V7.43041L5.4043 13.0595V0Z`}),(0,U.jsx)(`path`,{d:`M5.4043 13.0595H0V20.2648H5.4043V13.0595Z`}),(0,U.jsx)(`path`,{d:`M12.6104 13.0595H5.4051L9.68322 18.4634H12.6104V13.0595Z`})]}),Ms=e=>t=>(0,U.jsx)(e,{...t,className:g(t.className,`logo-mono`)}),Ns={jira:gs,azure_devops:Cs,confluence:ls,testrail:Ts,qtest:ws,github:Ms(ds),browserstack:ss,xray:ks,gitlab:fs,bitbucket:hs,postman:ys,sentry:Ms(bs),testmu:Ms(js),zephyr:Os(Ds,128,128),dataverse:Os(Es,128,98),aws:As,gcp:ps},Ps={openai:Ms(vs),azure:os,github_copilot:Ms(us),ollama:Ms(_s),anthropic:cs,gemini:ms,bedrock:As},Fs={android:is,ios:Ms(as),windows:Ss},Is=new Set([``,`settings`,`welcome`,`agents`]);function Ls(e){return e.replace(/(?<![\\/])[\\/]+$/,``).split(/[\\/]/).pop()||e}function Rs({page:e,children:t}){let[n,i]=(0,H.useState)(null),a=Is.has(e);return(0,H.useEffect)(()=>{if(a||n?.ready)return;let e=!0;return fe.state().then(t=>e&&i({ready:t.ready,project:t.project}),()=>e&&i({ready:!0,project:``})),()=>{e=!1}},[e]),a||!n||n.ready?t:(0,U.jsx)(`div`,{className:`px-6 py-16`,children:(0,U.jsxs)(z,{center:!0,icon:ut,title:`Set up ForgeQE to use this page`,action:(0,U.jsx)(`a`,{className:g(he({variant:`primary`})),href:r(`settings`,`setup`),children:`Set up`}),children:[`ForgeQE is not set up in `,Ls(n.project),` yet. Choose your project folder in Settings and set it up there; this page opens once it is.`]})})}function zs(e,t){if(!e)return[];let n=[],i=[!e.engine&&`the browser engine`,!e.runtime&&`the agent runtime`].filter(e=>!!e);i.length&&n.push({title:`Install ${i.join(` and `)}`,detail:`The agents run tests with them. Installing needs no admin rights and takes a few minutes.`,fix:`Install what's missing`,to:r(`settings`,`setup`)});let a=e.model.usable??[],o=t??e.model.active;return e.model.ready?o&&!a.includes(o)&&n.push({title:`${o} has no key or sign-in yet`,detail:`Add its key, or pick a model that is ready in the box below: ${a.join(`, `)}.`,fix:`Add its key`,to:r(`settings`,`models`)}):n.push({title:`No model is ready`,detail:e.model.detail,fix:`Add a model key`,to:r(`settings`,`models`)}),n}function Bs(e){let t=W(e?.environments),n=Object.entries(W(t.environments)).map(([e,t])=>({name:e,env:W(t)}));return{envs:n,fallback:[W(e?.config.environments).default,t.default].find(e=>typeof e==`string`&&n.some(t=>t.name===e))||(n.length===1?n[0].name:``)}}function Vs({item:e,onOpen:t,onDone:n,innerRef:r}){return(0,U.jsxs)(`button`,{ref:r,type:`button`,role:`menuitem`,disabled:e.disabled,...e.tip?{"data-tip":e.tip}:{},...e.panel?{"aria-haspopup":`dialog`}:{},onClick:()=>{if(e.panel)return t(e.id);e.onSelect?.(),n()},className:g(l,`gap-2`),children:[(0,U.jsx)(V,{icon:e.icon,size:16,className:`flex-none text-muted`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.dot&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 flex-none rounded-full bg-accent`}),e.value&&(0,U.jsx)(`span`,{className:`max-w-[45%] truncate text-body-sm text-muted`,children:e.value}),e.panel&&(0,U.jsx)(ct,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`})]})}function Hs({items:e,label:t=`More`}){let[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(``),[c,u]=(0,H.useState)(`next`),[d,f]=(0,H.useState)(),p=(0,H.useRef)(null),m=(0,H.useRef)({}),h=(0,H.useRef)(null),_=(0,H.useCallback)(()=>{r(!1),a(``),s(``)},[]),v=(0,H.useCallback)(()=>{s(i),u(`back`),a(``)},[i]),y=(0,H.useCallback)(e=>{u(`next`),a(e)},[]);(0,H.useEffect)(()=>{if(n){if(i)return h.current?.focus();o&&(m.current[o]?.focus(),s(``))}},[n,i,o]);let b=e.find(e=>e.id===i&&!!e.panel);(0,H.useLayoutEffect)(()=>{if(!n)return f(void 0);f(p.current?.scrollHeight)},[n,i,e.length]);let x=e.some(e=>e.dot);return e.length?(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(B,{variant:`ghost`,className:`flex-none px-2 text-body-lg sm:px-2`,"aria-label":t,"aria-haspopup":`menu`,"aria-expanded":n,"data-tip":e.map(e=>e.label).join(` · `),onClick:()=>n?_():r(!0),children:[(0,U.jsx)(Ct,{"aria-hidden":`true`}),x&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-accent`})]}),(0,U.jsx)(E,{open:n,onClose:b?v:_,label:b?.panelLabel||b?.label||t,role:b?`dialog`:`menu`,className:g(`transition-[width] duration-[var(--motion)] ease-[var(--ease-out)]`,b?`w-[min(400px,calc(100vw-48px))]`:`w-[min(320px,calc(100vw-48px))]`),children:(0,U.jsx)(`div`,{className:`overflow-hidden transition-[height] duration-[var(--motion)] ease-[var(--ease-out)]`,style:d===void 0?void 0:{height:d},children:(0,U.jsx)(`div`,{ref:p,className:c===`next`?`pane-next`:`pane-back`,children:b?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{ref:h,type:`button`,onClick:v,className:g(l,`min-h-9 gap-2 font-medium text-ink-2`),children:[(0,U.jsx)(It,{size:16,"aria-hidden":`true`}),`Back`]}),b.panel]}):e.map(e=>(0,U.jsx)(Vs,{item:e,onOpen:y,onDone:_,innerRef:t=>{m.current[e.id]=t}},e.id))},i||`rows`)})})]}):null}function Us(e,t){return t&&!e.some(e=>e.id===`attach`)?[...e,t]:[...e]}function Ws(e){let t=e?.config||{},n=W(t.browser),r=W(t.sources),i=[`jira`,`azure_devops`,`testrail`,`xray`,`zephyr`,`qtest`,`servicenow`,`github`].find(e=>r[e]),a={jira:`Jira`,azure_devops:`Azure DevOps`,testrail:`TestRail`,xray:`Xray`,zephyr:`Zephyr`,qtest:`qTest`,servicenow:`ServiceNow`,github:`GitHub`},o=String(n.provider||`local`);return{code:!0,headed:n.headless===!1,repo:W(t.code).repo?String(W(t.code).repo):`the project folder`,browser:o===`local`?`Chrome on this machine`:o===`testmu`?`TestMu AI`:o===`browserstack`?`BrowserStack`:o,cases:i?a[i]:`Files in the project`}}var Gs={azure:`Azure OpenAI`,openai:`OpenAI`,ollama:`Ollama`,openai_compatible:`OpenAI-compatible`,github_copilot:`GitHub Copilot`,github:`GitHub Models`,anthropic:`Anthropic`};function Ks({children:e}){return(0,U.jsx)(`div`,{className:`px-4 pt-2 pb-1 text-body-sm font-medium text-muted`,children:e})}function qs({tools:e,onChange:t,chat:n}){let i=(n,r,i,a)=>(0,U.jsxs)(`label`,{className:l,children:[(0,U.jsx)(rs,{icon:n}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,U.jsx)(`span`,{className:`text-body-sm font-medium text-ink`,children:i}),(0,U.jsx)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:a})]}),(0,U.jsx)(or,{checked:e[r],label:i,onChange:n=>t({...e,[r]:n})})]}),a=(e,t,n)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-2`,children:[(0,U.jsx)(V,{icon:e,size:16,className:`flex-none text-muted`}),(0,U.jsx)(`span`,{className:`flex-1 text-body-sm text-ink-2`,children:t}),(0,U.jsx)(`span`,{className:`truncate text-body-sm text-ink`,children:n})]});return(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsx)(Ks,{children:n?`This chat, from your next message`:`This chat`}),i(Tt,`code`,`Write the test`,`Turn a passed run into a test in ${e.repo}`),i(Cn,`headed`,`Show the browser`,`Watch each run in a Chrome window`),(0,U.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,U.jsx)(Ks,{children:`From your settings`}),a(_t,`Browsers run on`,e.browser),a(Ht,`Test cases from`,e.cases),n?.model&&(0,U.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-2`,children:[Ps[n.provider||``]?(()=>{let e=Ps[n.provider||``];return(0,U.jsx)(e,{"aria-hidden":`true`,className:`size-4 flex-none`})})():(0,U.jsx)(V,{icon:Ut,size:16,className:`flex-none text-muted`}),(0,U.jsx)(`span`,{className:`flex-1 text-body-sm text-ink-2`,children:`Model`}),(0,U.jsx)(`span`,{className:`truncate text-body-sm text-ink`,children:n.model})]}),(0,U.jsx)(`div`,{className:`mx-2 mt-1 mb-1 flex flex-wrap gap-x-1`,children:(0,U.jsxs)(`a`,{href:r(`settings`),className:g(l,`min-h-9 gap-2 px-2 font-medium`),children:[(0,U.jsx)(gn,{size:14,"aria-hidden":`true`}),`Change them in Settings`]})})]})}function Js({models:e,current:t,onPick:n,auto:i=!0}){let a=(e,r=!1)=>{let i=t===e.name;return(0,U.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":i,onClick:()=>n(e.name),className:l,children:[r?(0,U.jsx)(rs,{icon:Ut}):Ps[e.provider]?(0,U.jsx)(rs,{logo:Ps[e.provider]}):(0,U.jsx)(rs,{icon:Yn}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,U.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-sm font-medium text-ink`,children:e.name}),!r&&Gs[e.provider]&&(0,U.jsx)(`span`,{className:`flex-none text-body-sm text-muted`,children:Gs[e.provider]})]}),e.note&&(0,U.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:e.note})]}),(0,U.jsx)(zn,{size:16,"aria-hidden":`true`,className:g(`flex-none text-accent-fg`,!i&&`invisible`)})]},e.name)};return(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsx)(Ks,{children:`Model for this chat`}),i&&a({name:`Auto routing`,provider:``,note:`The most capable model plans; each step gets the model that suits it`},!0),e.length>0&&(0,U.jsxs)(U.Fragment,{children:[i&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,U.jsx)(Ks,{children:`Your models`})]}),(0,U.jsx)(`div`,{className:`flex flex-col`,children:e.map(e=>a(e))})]}),(0,U.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,U.jsxs)(`a`,{href:r(`settings`,`models`),className:g(l,`mx-2 mb-1 min-h-9 w-auto gap-2 px-2 font-medium`),children:[(0,U.jsx)(gn,{size:14,"aria-hidden":`true`}),`Manage models`]})]})}var Ys={web:_t,api:An,desktop:Le,mobile:bn};function Xs({icon:e,label:t,value:n}){return(0,U.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 px-4 py-1 text-body-sm`,children:[(0,U.jsx)(V,{icon:e,size:14,className:`mt-1 flex-none text-muted`}),(0,U.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,U.jsx)(`span`,{className:`font-medium text-ink`,children:t}),n&&(0,U.jsxs)(`span`,{className:`text-muted`,children:[` `,n]})]})]})}function Zs({row:e}){let t=e.env,n=Object.entries(W(t.apps)).map(([e,t])=>({...W(t),name:e})),r=Object.entries(W(t.variables)),i=Object.entries(W(t.data)),a=Object.keys(W(t.databases)),o=Array.isArray(t.secrets)?t.secrets.filter(e=>typeof e==`string`):[],s=typeof t.file==`string`?t.file:``,c=!s&&!n.length&&!r.length&&!i.length&&!a.length&&!o.length;return(0,U.jsxs)(`div`,{className:`flex flex-col pb-1`,children:[(0,U.jsxs)(Ks,{children:[`What the agent gets in `,e.name]}),(0,U.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[s&&(0,U.jsx)(Xs,{icon:Wn,label:`Read from`,value:s}),n.map(e=>(0,U.jsx)(Xs,{icon:Ys[String(e.kind||`web`)]||_t,label:e.name,value:[String(e.url||e.path||e.app_id||``),e.login?`signs in as ${String(e.login)}`:``].filter(Boolean).join(` · `)},`app:${e.name}`)),r.length>0&&(0,U.jsx)(Xs,{icon:ft,label:`Values`,value:r.map(([e,t])=>`${e} = ${String(t??``)}`).join(`, `)}),i.length>0&&(0,U.jsx)(Xs,{icon:Bt,label:`Test data`,value:i.map(([e,t])=>`${e}: ${String(t)}`).join(`, `)}),a.length>0&&(0,U.jsx)(Xs,{icon:jn,label:`Databases`,value:a.join(`, `)}),o.length>0&&(0,U.jsx)(Xs,{icon:ht,label:`Secrets, by name`,value:o.join(`, `)}),c&&(0,U.jsx)(`li`,{className:`px-4 py-1 text-body-sm text-muted`,children:`Nothing set yet. Add its apps and test data in Settings.`})]})]})}function Qs({envs:e,current:t,onPick:n}){let i=e.find(e=>e.name===t);return(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsx)(Ks,{children:`Environment for this chat`}),e.length?e.map(e=>{let r=e.name===t,i=typeof e.env.description==`string`?e.env.description:``;return(0,U.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r,onClick:()=>n(e.name),className:l,children:[(0,U.jsx)(rs,{icon:kn}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-sm font-medium text-ink`,children:e.name}),i&&(0,U.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:i})]}),(0,U.jsx)(zn,{size:16,"aria-hidden":`true`,className:g(`flex-none text-accent-fg`,!r&&`invisible`)})]},e.name)}):(0,U.jsx)(`p`,{className:`m-0 px-4 py-1 text-body-sm text-muted`,children:`No environments yet. Add one with its apps, test data and the names of its secrets.`}),i&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,U.jsx)(Zs,{row:i})]}),(0,U.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,U.jsxs)(`a`,{href:r(`settings`,`environments`),className:g(l,`mx-2 mb-1 min-h-9 w-auto gap-2 px-2 font-medium`),children:[(0,U.jsx)(gn,{size:14,"aria-hidden":`true`}),`Manage environments`]})]})}function $s(){let[e,t]=(0,H.useState)(null),[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(()=>Ws(null)),[u,d]=(0,H.useState)(``);(0,H.useEffect)(()=>{fe.state().then(e=>{r(e),e.ready&&fe.machine().then(a,()=>{}),e.ready&&se.settings().then(e=>{t(e),l(Ws(e))},()=>{})},()=>{})},[]);let f=Object.entries(W(e?.models.models)).map(([e,t])=>({name:e,provider:String(W(t).provider||``),note:String(W(t).description||``)})).filter(e=>e.provider!==`mock`&&e.name!==`mock`),p=String(W(e?.config.llm).routing||`off`)===`auto`,m=e=>typeof e==`string`&&f.some(t=>t.name===e)?e:``,h=m(e?.models.default)||f[0]?.name||``,g=u||(p?`Auto routing`:m(W(e?.config.llm).active)||h||`Auto routing`),{envs:_,fallback:v}=Bs(e),y=_.some(e=>e.name===o)?o:v,b={profile:f.some(e=>e.name===g)?g:void 0,headed:c.headed,code:c.code,env:y||void 0};return{snap:e,setup:n,machine:i,ready:!n||n.ready,tools:c,setTools:l,profiles:f,current:g,setModel:d,envs:_,environment:y,setEnvName:s,choice:b}}function ec({attach:e,choice:t,started:n,before:r=[]}){let i=tc(n),a=Us(r,e&&{id:`attach`,icon:cn,label:`Attach a file`,tip:`Attach a file, or type @ in the box to name one in the agent's folder`,onSelect:e.pick});return t&&a.push({id:`env`,icon:An,label:`Environment`,value:t.environment||`None`,panel:(0,U.jsx)(Qs,{envs:t.envs,current:t.environment,onPick:t.setEnvName}),panelLabel:`Environment for this chat`},{id:`tools`,icon:Dt,label:`Tools`,dot:t.tools.headed||!t.tools.code,panel:(0,U.jsx)(qs,{tools:t.tools,onChange:t.setTools}),panelLabel:`Tools for this chat`}),n&&i&&a.push({id:`chat-tools`,icon:Dt,label:`Tools`,dot:i.tools.headed||!i.tools.code,disabled:n.ended,panel:(0,U.jsx)(qs,{tools:i.tools,chat:{model:n.thread.model?.name,provider:n.thread.model?.provider},onChange:i.change}),panelLabel:`Tools for this chat`}),(0,U.jsx)(Hs,{items:a})}function tc(e){let[t,n]=(0,H.useState)({}),r=e?.thread.headed,i=e?.thread.writeTests;if((0,H.useEffect)(()=>n({}),[r,i]),!e)return null;let a={...Ws(e.snap),headed:t.headed??r??!1,code:t.code??i??!0};return{tools:a,change:t=>{let r={};t.headed!==a.headed&&(r.headed=t.headed),t.code!==a.code&&(r.writeTests=t.code),Object.keys(r).length&&(n({headed:t.headed,code:t.code}),L.settings(e.chat,r).catch(t=>e.onError(t.message)))}}}function nc({c:e}){let[t,n]=(0,H.useState)(!1),r=e.profiles.find(t=>t.name===e.current)?.provider||``,i=e.current===`Auto routing`?void 0:Ps[r];return(0,U.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,U.jsxs)(B,{variant:`ghost`,className:`max-w-[46vw] min-w-0 px-2 text-body-lg sm:px-2`,"aria-expanded":t,"aria-haspopup":`menu`,"aria-label":`Model: ${e.current}`,onClick:()=>n(!t),children:[i?(0,U.jsx)(i,{"aria-hidden":`true`,className:`size-4`}):(0,U.jsx)(Dn,{"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`hidden truncate sm:inline`,children:e.current}),(0,U.jsx)(Be,{size:16,"aria-hidden":`true`,className:`hidden sm:block`})]}),(0,U.jsx)(E,{open:t,onClose:()=>n(!1),label:`Model`,align:`end`,className:`w-[min(400px,calc(100vw-48px))]`,children:(0,U.jsx)(Js,{models:e.profiles,current:e.current,onPick:t=>{e.setModel(t),n(!1)}})})]})}function rc({chat:e,thread:t,ended:n,busy:r,snap:i,onError:a}){let[o,s]=(0,H.useState)(!1),c=t.model?.name||``;if(!c)return null;let l=W(i?.models.models),u=(t.models||[]).map(e=>({...e,note:String(W(l[e.name]).description||``)})),d=Ps[t.model?.provider||``],f=u.length<2;return(0,U.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,U.jsxs)(B,{variant:`ghost`,className:`max-w-[46vw] min-w-0 px-2 text-body-lg sm:px-2`,disabled:n||r||f,"data-tip":f?`This chat has no other model to switch to`:r?`When ForgeQE has finished`:void 0,"aria-expanded":o,"aria-haspopup":`menu`,"aria-label":`Model: ${c}`,onClick:()=>s(!o),children:[d?(0,U.jsx)(d,{"aria-hidden":`true`,className:`size-4`}):(0,U.jsx)(Dn,{"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`hidden truncate sm:inline`,children:c}),!f&&(0,U.jsx)(Be,{size:16,"aria-hidden":`true`,className:`hidden sm:block`})]}),(0,U.jsx)(E,{open:o,onClose:()=>s(!1),label:`Model`,align:`end`,className:`w-[min(400px,calc(100vw-48px))]`,children:(0,U.jsx)(Js,{models:u,current:c,auto:!1,onPick:t=>{s(!1),t!==c&&L.model(e,t).catch(e=>a(e.message))}})})]})}function ic({project:e}){return(0,U.jsxs)(`div`,{role:`status`,className:`flex w-full flex-wrap items-center gap-x-4 gap-y-4 border-y border-line py-4 short:gap-y-2 short:py-2`,children:[(0,U.jsx)(V,{icon:We,size:20,className:`flex-none text-icon`}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`Set up ForgeQE first`}),(0,U.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[`Choose your project folder and set ForgeQE up in it. It is not set up in `,Ls(e),` yet.`]})]}),(0,U.jsxs)(`a`,{className:g(he({variant:`primary`}),`short:min-h-8 short:px-4 short:text-body-sm`),href:r(`settings`,`setup`),children:[(0,U.jsx)(gn,{"aria-hidden":`true`}),`Set up`]})]})}function ac({c:e}){let t=zs(e.machine,e.choice.profile);return t.length?(0,U.jsx)(`div`,{role:`status`,className:`flex w-full flex-col gap-4 border-y border-line py-4 short:gap-2 short:py-2`,children:t.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-4 short:gap-y-2`,children:[(0,U.jsx)(V,{icon:e.fix.startsWith(`Add`)?ht:an,size:20,className:`flex-none text-icon`}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,U.jsx)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:e.detail})]}),(0,U.jsxs)(`a`,{className:g(he({variant:`outline`}),`short:min-h-8 short:px-4 short:text-body-sm`),href:e.to,"data-tip":e.fix,children:[e.fix.startsWith(`Add`)?(0,U.jsx)(Ct,{"aria-hidden":`true`}):(0,U.jsx)(an,{"aria-hidden":`true`}),e.fix.split(` `)[0]]})]},e.title))}):null}function oc(e){return{label:`All agents`,href:r(`agents`)}}var sc=`orchestrator`;function cc(e){return e.page?te(e.page)??F.find(e=>e.id===`orchestrator`):F.find(t=>t.agent!==`forgeqe`&&e.title.startsWith(`${I(t.agent).name}: `))??F.find(e=>e.id===`orchestrator`)}var lc=(e,t)=>t.filter(t=>cc(t)?.id===e.id);function uc(e,t){if(e[0]!==`chats`||!e[1]||!t)return e;let n=cc(t);return n&&n.agent!==`forgeqe`?[`agents`,n.id]:e}function dc(e){let t=e[0]===`chats`?e[1]:void 0,[n,r]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!t)return;let e=!1;return L.events(t,2**53-1,!1).then(n=>!e&&r({id:t,title:n.title,...n.page?{page:n.page}:{}}),()=>{}),()=>{e=!0}},[t]),uc(e,n&&n.id===t?n:null)}var fc=`rounded-base border border-line bg-bg shadow-none in-[.rounded-lg.bg-bg]:shadow-none`,pc=`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,mc=`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,hc=`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,gc=`h-12 cursor-pointer border-t border-line-soft align-middle transition-colors duration-150 hover:bg-tint data-[state=selected]:bg-tint-hover`,_c=`px-4 py-2`,vc=`px-4 py-2 text-right whitespace-nowrap tabular-nums`,yc=`w-full max-w-0 px-4 py-2`,bc=`block truncate font-medium text-ink`,xc=`block truncate text-body-sm text-muted`,Sc=new Set([`className`,`style`,`key`,`ref`,`id`,`role`,`type`,`colSpan`,`rowSpan`,`scope`,`data-tip-side`]);function Cc(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=>Cc(e,t+1)).join(` `);if((0,H.isValidElement)(e))return Cc(e.props,t+1);if(typeof e==`object`){let n=[];for(let[r,i]of Object.entries(e))Sc.has(r)||r.startsWith(`on`)||r.startsWith(`aria-`)||n.push(Cc(i,t+1));return n.join(` `)}return``}function wc(e){return H.Children.toArray((0,H.isValidElement)(e)&&e.type===H.Fragment?e.props.children:e)}function Tc(e,t=0){if(e==null||typeof e==`boolean`||t>12)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e))return e.map(e=>Tc(e,t+1)).join(` `);if(!(0,H.isValidElement)(e))return``;let n=e.props;return typeof n.className==`string`&&/(^|\s)sr-only(\s|$)/.test(n.className)||n.onCheckedChange!==void 0?``:Tc(n.children,t+1)}function Ec(e){return(0,H.isValidElement)(e)?e.type===`tr`?e:e.type===H.Fragment?H.Children.toArray(e.props.children).find(e=>(0,H.isValidElement)(e)&&e.type===`tr`)??null:null:null}var Dc=/^[-+]?(?:\d{1,3}(?:,\d{3})+|\d+)?(?:\.\d+)?\s*(?:%|ms|s|m|h|d|x|kb|mb|gb)?$/i;function Oc(e){if(!(0,H.isValidElement)(e))return``;let t=e.props,n=t[`data-sort`];if(typeof n==`number`)return n;if(typeof n==`string`)return Dc.test(n.trim())&&/\d/.test(n)?Number.parseFloat(n.replace(/,/g,``)):n.toLowerCase();let r=t[`data-tip`];if(typeof r==`string`&&/\d{1,4}[/.-]\d{1,2}[/.-]\d{1,4}/.test(r)){let e=Date.parse(r);if(Number.isFinite(e))return e}let i=Tc(t.children).replace(/\s+/g,` `).trim();return i&&/\d/.test(i)&&Dc.test(i)?Number.parseFloat(i.replace(/,/g,``)):i.toLowerCase()}function kc(e,t,n){if(!t.size||!(0,H.isValidElement)(e))return e;let r=e=>{let r=H.Children.toArray(e.props.children);return r.length===n?(0,H.cloneElement)(e,void 0,r.filter((e,n)=>!t.has(n))):e};return e.type===`tr`?r(e):e.type===H.Fragment?(0,H.cloneElement)(e,void 0,H.Children.toArray(e.props.children).map(e=>(0,H.isValidElement)(e)&&e.type===`tr`?r(e):e)):e}function Ac(e){if(!(0,H.isValidElement)(e))return e;if(e.type===`tr`)return(0,H.cloneElement)(e,{"data-row":``});if(e.type===H.Fragment){let t=!1;return(0,H.cloneElement)(e,void 0,H.Children.toArray(e.props.children).map(e=>t||!(0,H.isValidElement)(e)||e.type!==`tr`?e:(t=!0,(0,H.cloneElement)(e,{"data-row":``}))))}return e}function jc({on:e,dir:t,num:n,onClick:r,children:i}){let a=e&&t===`asc`?En:tn;return(0,U.jsxs)(`button`,{type:`button`,onClick:r,className:g(`group -mx-2 inline-flex cursor-pointer items-center gap-1 rounded-sm border-0 bg-transparent px-2 py-1 font-medium transition-colors duration-150 hover:text-ink focus-visible:outline-2 focus-visible:outline-accent`,e?`text-ink`:`text-muted`,n&&`flex-row-reverse`),children:[i,e?(0,U.jsx)(a,{size:12,"aria-hidden":`true`,className:`flex-none`}):(0,U.jsx)(Me,{size:12,"aria-hidden":`true`,className:`flex-none opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100`})]})}function Mc({label:e,head:t,children:n,empty:r=`None.`,size:i=25,resetKey:a,fixed:o=!1,minWidth:c,className:l,search:u=!0,sortable:f=!0,columns:p=!0,placeholder:m,tools:h,end:_,selection:v,height:y,count:b=!0,framed:x=!1}){let S=H.Children.toArray(n),[C,w]=(0,H.useState)(``),T=C.toLowerCase().split(/\s+/).filter(Boolean),E=(0,H.useMemo)(()=>u?S.map(e=>Cc(e).toLowerCase()):[],[n,u]),D=T.length?S.filter((e,t)=>T.every(e=>E[t].includes(e))):S,O=wc(t),k=O.map(e=>(0,H.isValidElement)(e)&&e.type===`th`?Tc(e.props.children).replace(/\s+/g,` `).trim():``),A=(0,H.useMemo)(()=>S.every(e=>Ec(e)?H.Children.toArray(Ec(e).props.children).length===O.length:!1),[n,O.length]),[j,M]=(0,H.useState)(null),ee=f&&A&&S.length>1,N=(0,H.useMemo)(()=>{if(!ee||!j||!k[j.col])return D;let e=j.dir===`asc`?1:-1;return D.map(e=>({r:e,v:Oc(H.Children.toArray(Ec(e).props.children)[j.col])})).toSorted((t,n)=>(typeof t.v==`number`&&typeof n.v==`number`?t.v-n.v:String(t.v).localeCompare(String(n.v),void 0,{numeric:!0,sensitivity:`base`}))*e).map(e=>e.r)},[D,j,ee]),P=e=>{if(j?.col===e)return M({col:e,dir:j.dir===`asc`?`desc`:`asc`});let t=D.length?Oc(H.Children.toArray(Ec(D[0]).props.children)[e]):``;M({col:e,dir:typeof t==`number`?`desc`:`asc`})},te=k.flatMap((e,t)=>e?[t]:[]),F=p&&A?te.slice(1):[],[I,ne]=(0,H.useState)([]),re=new Set(I.map(Number).filter(e=>F.includes(e))),ie=O.map((e,t)=>{if(!ee||!k[t]||!(0,H.isValidElement)(e)||e.type!==`th`)return e;let n=e,r=j?.col===t,i=/(^|\s)text-right(\s|$)/.test(n.props.className??``);return(0,H.cloneElement)(n,{"aria-sort":r?j.dir===`asc`?`ascending`:`descending`:`none`},(0,U.jsx)(jc,{on:r,dir:j?.dir??`asc`,num:i,onClick:()=>P(t),children:n.props.children}))}).filter((e,t)=>!re.has(t)),ae=F.length>=2?(0,U.jsx)(Lc,{columns:F.map(e=>({id:String(e),label:k[e]})),hidden:I,onChange:ne}):null,[L,oe]=(0,H.useState)(0);(0,H.useEffect)(()=>oe(0),[a,C,j]);let se=(0,H.useRef)(null),[ce,le]=(0,H.useState)(null),ue=(0,H.useRef)(0),de=()=>{let e=se.current;if(!y||!e)return;let t=e.querySelector(`thead`)?.offsetHeight??0,n=e.querySelectorAll(`tbody > tr[data-row]`);for(let t of n.length?n:e.querySelectorAll(`tbody > tr`))ue.current=Math.max(ue.current,t.offsetHeight);ue.current&&le(Math.max(1,Math.min(i,Math.floor((e.clientHeight-t)/ue.current))))};(0,H.useEffect)(()=>{let e=se.current;if(!y||!e||typeof ResizeObserver>`u`)return;let t=e.clientWidth,n=new ResizeObserver(()=>{e.clientWidth!==t&&(ue.current=0),t=e.clientWidth,de()});return n.observe(e),()=>n.disconnect()},[y,i]);let fe=y?ce??i:i,pe=Math.max(1,Math.ceil(N.length/fe)),R=Math.min(L,pe-1),z=N.slice(R*fe,R*fe+fe).map(e=>Ac(kc(e,re,O.length)));(0,H.useEffect)(de,[R,fe,N,I]);let[he,ge]=(0,H.useState)(!1);(0,H.useEffect)(()=>{let e=se.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>ge(e.scrollWidth>e.clientWidth+1),n=new ResizeObserver(t);return n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),t(),()=>n.disconnect()},[y]);let _e=O.length-re.size,ve=_||ae?(0,U.jsxs)(U.Fragment,{children:[ae,_]}):null;return(0,U.jsxs)(`div`,{className:g(d,`@container overflow-hidden p-0 in-[.rounded-lg.bg-bg]:shadow-none in-[.panel]:shadow-none`,x&&fc,l),children:[(u||h||ve)&&(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pt-4 pb-2`,children:[u&&(0,U.jsxs)(`label`,{className:`relative flex min-w-0 w-full max-w-[320px] flex-[0_1_320px] items-center`,children:[(0,U.jsx)(mt,{size:14,"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 text-muted`}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[`Find in `,e.toLowerCase()]}),(0,U.jsx)(s,{size:`sm`,type:`search`,value:C,spellCheck:!1,placeholder:m??`Find in ${e.toLowerCase()}`,onChange:e=>w(e.target.value),className:`pl-8`})]}),h,T.length>0&&(0,U.jsxs)(`span`,{className:`text-body-sm whitespace-nowrap text-muted`,role:`status`,children:[N.length,` of `,S.length]}),ve&&(0,U.jsx)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:ve})]}),!!v?.count&&(0,U.jsxs)(`div`,{role:`region`,"aria-label":`Selected ${e.toLowerCase()}`,className:`flex flex-wrap items-center justify-between gap-2 border-b border-line-soft bg-surface-muted px-4 py-2`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`span`,{className:`text-body-sm font-medium text-ink tabular-nums`,role:`status`,children:[v.count,` selected`]}),(0,U.jsx)(B,{size:`sm`,variant:`ghost`,onClick:v.onClear,children:`Clear`})]}),v.actions&&(0,U.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:v.actions})]}),(0,U.jsx)(`div`,{ref:se,...he?{tabIndex:0,role:`region`,"aria-label":`${e}, scrolls`}:{},className:g(`relative overflow-x-auto focus-visible:outline-offset-[-2px]`,y&&`overflow-y-hidden`),style:y?{height:y}:void 0,children:(0,U.jsxs)(`table`,{"aria-label":e,className:g(`w-full border-collapse text-body-sm text-ink-2`,o&&`table-fixed`),style:c?{minWidth:c}:void 0,children:[(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{className:`h-10 text-left align-middle text-muted`,children:ie})}),(0,U.jsxs)(`tbody`,{children:[z,!N.length&&(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:Math.max(1,_e),className:`px-4 py-4 text-center text-muted`,children:T.length&&S.length?`Nothing matches.`:r})})]})]})}),N.length>0&&(b||N.length>fe)&&(0,U.jsx)(me,{page:R,size:fe,total:N.length,onPage:oe,label:`Pages of ${e.toLowerCase()}`})]})}var Nc=`max(320px, calc(var(--screen) - 288px))`;function Pc(e,t,n=`asc`){return e.key===t?{key:t,dir:e.dir===`asc`?`desc`:`asc`}:{key:t,dir:n}}function Fc(e,t,n){let r=n[t.key],i=t.dir===`asc`?1:-1;return e.toSorted((e,t)=>{let n=r(e),a=r(t);return(typeof n==`number`&&typeof a==`number`?n-a:String(n).localeCompare(String(a),void 0,{sensitivity:`base`,numeric:!0}))*i})}function Ic({col:e,sort:t,onSort:n,first:r=`asc`,num:i=!1,className:a,children:o}){let s=t.key===e;return(0,U.jsx)(`th`,{scope:`col`,"aria-sort":s?t.dir===`asc`?`ascending`:`descending`:`none`,className:g(i?mc:pc,a),children:(0,U.jsx)(jc,{on:s,dir:t.dir,num:i,onClick:()=>n(Pc(t,e,r)),children:o})})}function Lc({columns:e,hidden:t,onChange:n}){let[r,i]=(0,H.useState)(!1);return(0,U.jsxs)(`span`,{className:`relative inline-block`,children:[(0,U.jsxs)(B,{size:`sm`,variant:`ghost`,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>i(!r),children:[(0,U.jsx)(Sn,{"aria-hidden":`true`}),`Columns`,(0,U.jsx)(Be,{"aria-hidden":`true`})]}),(0,U.jsx)(E,{open:r,onClose:()=>i(!1),label:`Columns to show`,align:`end`,className:`min-w-[200px]`,children:e.map(e=>{let r=!t.includes(e.id);return(0,U.jsx)(x,{role:`menuitemcheckbox`,checked:r,onSelect:()=>n(r?[...t,e.id]:t.filter(t=>t!==e.id)),children:(0,U.jsx)(`span`,{className:`flex-1`,children:e.label})},e.id)})})]})}var Rc=new Intl.RelativeTimeFormat(`en`,{style:`narrow`}),zc=(e,t)=>Rc.format(-e,t);function Bc(e){let t=e?Date.parse(e):NaN;if(Number.isNaN(t))return``;let n=Math.max(0,(Date.now()-t)/1e3);if(n<60)return`just now`;if(n<3600)return zc(Math.floor(n/60),`minute`);if(n<21600)return zc(Math.floor(n/3600),`hour`);let r=new Date(t);return r.toDateString()===new Date().toDateString()?r.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):n<518400?r.toLocaleString([],{weekday:`short`,hour:`2-digit`,minute:`2-digit`}):r.toLocaleDateString([],{day:`numeric`,month:`short`})}function Vc(e,t=new Date){let n=e?new Date(e):null;if(!n||Number.isNaN(n.getTime()))return`Older`;let r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return n.getTime()>=r?`Today`:n.getTime()>=r-864e5?`Yesterday`:n.getTime()>=r-5184e5?`Earlier this week`:`Older`}function Hc({children:e,className:t}){return(0,U.jsx)(`kbd`,{className:g(p,`inline-flex min-h-5 items-center rounded-full px-2 font-sans text-label-sm text-ink-2 shadow-[inset_0_-1px_0_var(--shadow-float-ink)]`,t),children:e})}var Uc={x:0,y:0,w:0,h:0,on:!1},Wc=(e,t)=>e.on===t.on&&e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h;function Gc(e,t){if(!t||!t.isConnected||t.closest(`[inert]`)||!t.offsetHeight)return Uc;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}:Uc}function Kc(e,t,n){let[r,i]=(0,H.useState)(Uc),a=(0,H.useCallback)(()=>{let n=e.current;if(!n)return;let r=Gc(n,n.querySelector(t));i(e=>Wc(e,r)?e:r)},[e,t]);return(0,H.useLayoutEffect)(a,[n,a]),(0,H.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 qc=`[aria-selected="true"], [aria-current="page"], [aria-checked="true"], [aria-disabled="true"]`;function Jc(e){let[t,n]=(0,H.useState)(Uc);return{pill:t,enter:(0,H.useCallback)(t=>{let r=e.current;if(!r||t.pointerType===`touch`)return;let i=t.currentTarget.matches(qc)?Uc:Gc(r,t.currentTarget);n(e=>i.on?Wc(e,i)?e:i:e.on?{...e,on:!1}:e)},[e]),leave:(0,H.useCallback)(()=>n(e=>e.on?{...e,on:!1}:e),[])}}var Yc=new Map,Xc=1500;function Zc({pill:e,className:t,memory:n,children:r}){let[i,a]=(0,H.useState)(()=>{let e=n?Yc.get(n):void 0;return e&&Date.now()-e.at<Xc?e.pill:void 0});(0,H.useEffect)(()=>{n&&e.on&&Yc.set(n,{pill:e,at:Date.now()})},[n,e]),(0,H.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,H.useRef)(!1),c=s.current;return o.on&&(s.current=!0),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:g(`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 Qc=`flex w-fit max-w-full flex-wrap gap-1 rounded-full bg-surface-strong p-1`,$c=e=>g(`inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-full border-0 px-4 text-body-sm font-medium whitespace-nowrap`,e?`bg-bg text-ink shadow-sm`:`bg-transparent text-muted hover:text-ink`),el=`rounded-full bg-bg shadow-sm`,tl=`rounded-full bg-bg/70`,nl=(e,t)=>g($c(e),`relative z-10 transition-colors duration-(--motion-fast)`,e&&t&&`bg-transparent shadow-none`);function rl({icon:e}){return typeof e==`object`&&e&&`pixel`in e?(0,U.jsx)(f,{name:e.pixel,px:18,className:`flex-none`}):(0,U.jsx)(V,{icon:e,size:16,className:`flex-none`})}function il(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 al({tabs:e,current:t,onPick:r,hrefOf:i,label:a,className:o,prefix:s=`tab`}){let c=s===`tab`?`panel`:`${s}-panel`,l=(0,H.useRef)(null),u=Kc(l,`[aria-selected="true"], [aria-current="page"]`,t),d=Jc(l),f=r&&(e=>(n(l.current,!0),r(e))),p=`tabs:${a}:${typeof location>`u`?``:location.hash.split(`/`)[1]||``}`;(0,H.useEffect)(()=>{let e=l.current?.querySelector(`[aria-selected="true"], [aria-current="page"]`),t=l.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 m=g(`relative mb-6`,Qc,`flex-nowrap overflow-x-auto [scrollbar-width:thin]`,o),h=e=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(rl,{icon:e.icon}),e.label,e.n!==void 0&&e.n!==null&&(0,U.jsx)(`span`,{className:g(`text-body-sm font-normal tabular-nums`,e.tone||`text-muted`),children:e.n})]}),_=e=>g(nl(t===e.id,u.on),`flex-none focus-visible:outline-offset-[-2px]`,e.mono&&`font-mono text-body-sm font-normal`);return i?(0,U.jsxs)(`nav`,{ref:l,"aria-label":a,className:m,onPointerLeave:d.leave,children:[(0,U.jsx)(Zc,{pill:d.pill,className:tl}),(0,U.jsx)(Zc,{pill:u,className:el,memory:p}),e.map(e=>(0,U.jsx)(`a`,{id:`${s}-${e.id}`,href:i(e.id),onPointerEnter:d.enter,onClick:()=>t!==e.id&&n(l.current,!0),"aria-current":t===e.id?`page`:void 0,className:g(_(e),`no-underline hover:no-underline`,t===e.id&&`hover:text-ink`),children:h(e)},e.id))]}):(0,U.jsxs)(`div`,{ref:l,role:`tablist`,"aria-label":a,className:m,onPointerLeave:d.leave,children:[(0,U.jsx)(Zc,{pill:d.pill,className:tl}),(0,U.jsx)(Zc,{pill:u,className:el,memory:p}),e.map((n,r)=>(0,U.jsx)(`button`,{id:`${s}-${n.id}`,type:`button`,role:`tab`,"aria-selected":t===n.id,"aria-controls":`${c}-${n.id}`,tabIndex:t===n.id?0:-1,onPointerEnter:d.enter,onClick:()=>t!==n.id&&f?.(n.id),onKeyDown:t=>{f&&il(e,r,t.key,s,f)&&t.preventDefault()},className:_(n),children:h(n)},n.id))]})}function ol({tabs:e,current:t,onPick:r,label:i,className:a,prefix:o=`tab`}){let s=o===`tab`?`panel`:`${o}-panel`,c=(0,H.useRef)(null),l=Kc(c,`[aria-selected="true"]`,t),u=Jc(c),d=e=>(n(c.current,!1),r(e));return(0,U.jsxs)(`div`,{ref:c,role:`tablist`,"aria-label":i,className:g(`relative mb-6 flex flex-wrap gap-x-6 border-b border-line-soft`,a),onPointerLeave:u.leave,children:[(0,U.jsx)(Zc,{pill:u.pill,className:`border-b-2 border-line-strong`}),(0,U.jsx)(Zc,{pill:l,className:`border-b-2 border-ink`}),e.map((n,r)=>(0,U.jsxs)(`button`,{id:`${o}-${n.id}`,type:`button`,role:`tab`,"aria-selected":t===n.id,"aria-controls":`${s}-${n.id}`,tabIndex:t===n.id?0:-1,onPointerEnter:u.enter,onClick:()=>t!==n.id&&d(n.id),onKeyDown:t=>{il(e,r,t.key,o,d)&&t.preventDefault()},className:g(`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-body-sm font-medium transition-colors duration-(--motion-fast)`,n.mono&&`font-mono text-body-sm font-normal`,t===n.id?g(`text-ink`,l.on?`border-transparent`:`border-ink`):`border-transparent text-muted hover:text-ink`),children:[n.label,n.n!==void 0&&n.n!==null&&(0,U.jsx)(`span`,{className:g(`text-body-sm font-normal tabular-nums`,n.tone||`text-muted`),children:n.n})]},n.id))]})}var sl=e=>typeof location<`u`&&e.replace(/^#\/?/,``).split(`/`)[0]===location.hash.replace(/^#\/?/,``).split(`/`)[0];function cl({links:e,current:t,label:r,className:i}){let a=(0,H.useRef)(null),o=Kc(a,`[aria-current="page"]`,t),s=Jc(a);return(0,U.jsxs)(`nav`,{ref:a,"aria-label":r,className:g(`relative`,Qc,i),onPointerLeave:s.leave,children:[(0,U.jsx)(Zc,{pill:s.pill,className:tl}),(0,U.jsx)(Zc,{pill:o,className:el,memory:`links:${r}`}),e.map(e=>(0,U.jsxs)(`a`,{href:e.href,onPointerEnter:s.enter,onClick:()=>t!==e.id&&sl(e.href)&&n(a.current,!0),"aria-current":t===e.id?`page`:void 0,className:g(nl(t===e.id,o.on),`no-underline hover:no-underline`,t===e.id&&`hover:text-ink`),children:[(0,U.jsx)(rl,{icon:e.icon}),e.label]},e.id))]})}function ll({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,H.useRef)(null),l=Kc(c,`[aria-checked="true"]`,t),u=Jc(c),d=(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,U.jsxs)(`span`,{ref:c,role:`radiogroup`,"aria-label":r,"aria-labelledby":i,className:g(`relative`,Qc,o),onPointerLeave:u.leave,children:[(0,U.jsx)(Zc,{pill:u.pill,className:tl}),(0,U.jsx)(Zc,{pill:l,className:el}),e.map(e=>{let o=a||!!e.disabled;return(0,U.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,onPointerEnter:u.enter,onClick:()=>!o&&n(e.id),onKeyDown:t=>{(t.key===`ArrowRight`||t.key===`ArrowLeft`)&&(t.preventDefault(),d(e.id,t.key===`ArrowRight`?1:-1))},className:g(nl(t===e.id,l.on),o&&`cursor-not-allowed opacity-50`),children:[e.icon,e.label,e.n!==void 0&&e.n!==null&&(0,U.jsx)(`span`,{className:g(`text-body-sm font-normal tabular-nums`,e.tone||`text-muted`),children:e.n})]},e.id)})]})}var ul={good:`pass`,bad:`fail`,same:`neutral`},dl={good:`text-pass`,bad:`text-fail`,same:`text-muted`};function fl(e){return e.dir===`same`||e.good===void 0?`same`:e.good?`good`:`bad`}function pl({children:e,label:t,className:n}){return(0,U.jsx)(`section`,{"aria-label":t,className:g(d,`grid grid-cols-[repeat(auto-fit,minmax(min(100%,150px),1fr))] overflow-hidden p-0`,n),children:e})}function G({label:e,value:t,note:n,icon:r,period:i,change:a,tone:o,big:s,compact:c,className:l}){let u=a&&fl(a),d=a?.dir===`up`?yt:a?.dir===`down`?Bn:void 0;return(0,U.jsxs)(`div`,{className:g(`-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,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium text-ink text-body-sm`,children:[r&&(0,U.jsx)(V,{icon:r,size:14,className:`flex-none text-muted`}),(0,U.jsx)(`span`,{className:`min-w-0`,children:e})]}),i&&(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:i}),(0,U.jsxs)(`span`,{className:g(`flex flex-wrap items-center gap-x-2 gap-y-1`,c?`mt-0`:i?`mt-2`:`mt-1`),children:[(0,U.jsx)(`span`,{className:g(`tabular-nums`,s?`text-headline-md`:c?`text-headline-sm`:`text-headline-md`,o),children:t}),a&&u&&(0,U.jsx)(`span`,{"aria-hidden":a.against?!0:void 0,className:`inline-flex`,children:(0,U.jsxs)(Te,{tone:ul[u],icon:!1,className:`tabular-nums`,children:[d&&(0,U.jsx)(d,{size:12,strokeWidth:2.5,"aria-hidden":`true`,className:`flex-none`}),a.text]})})]}),(n||a?.against)&&(0,U.jsx)(`span`,{className:g(`text-muted tabular-nums`,c?`truncate text-body-sm`:`text-body-sm`),children:a?.against&&u?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:dl[u],children:a.amount??a.text}),` `,a.against,n?(0,U.jsxs)(U.Fragment,{children:[` · `,n]}):null]}):n})]})}var ml={line:16,inset:24},hl={line:8,inset:16},gl=(0,H.createContext)(null),_l=`relative z-10 flex h-8 short:h-7 w-full min-w-0 items-center gap-2 rounded-sm px-2 text-body-sm no-underline outline-none select-none focus-visible:ring-2 focus-visible:ring-accent`;function vl({offsets:e,width:t,className:n,style:r}){if(!e.length)return null;let i=e[e.length-1],a=i+1;return(0,U.jsxs)(`svg`,{"aria-hidden":`true`,width:t,height:a,viewBox:`0 0 ${t} ${a}`,fill:`none`,style:r,className:g(`pointer-events-none absolute top-0 z-0 text-line-strong`,n),children:[(0,U.jsx)(`path`,{d:`M0.5 0 V${i-5}`,stroke:`currentColor`,strokeWidth:`1`}),e.map((e,n)=>(0,U.jsx)(`path`,{d:`M0.5 ${e-5} Q0.5 ${e} 5.5 ${e} H${t-.5}`,stroke:`currentColor`,strokeWidth:`1`},n))]})}function yl({lines:e,label:t,className:n,children:r}){let i=(0,H.useRef)(null),[a,o]=(0,H.useState)([]),s=H.Children.count(r),c=(0,H.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,H.useLayoutEffect)(()=>{if(c(),!i.current||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(c);return e.observe(i.current),()=>e.disconnect()},[s,c]),(0,U.jsxs)(`div`,{ref:i,role:`group`,"aria-label":t,className:g(`relative flex flex-col gap-px`,n),style:e?{paddingLeft:e.inset}:void 0,children:[e&&(0,U.jsx)(vl,{offsets:a,width:e.inset-e.line,style:{left:e.line}}),r]})}function bl(){let e=(0,H.useContext)(gl);return{onPointerEnter:t=>t.pointerType===`mouse`&&e?.hover(t.currentTarget),onFocus:t=>t.currentTarget.matches(`:focus-visible`)&&e?.hover(t.currentTarget)}}function xl({href:e,label:t,current:n,icon:r,badge:i,after:a,tip:o,className:s}){let c=bl(),l=(0,U.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:g(_l,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,U.jsx)(`span`,{"aria-hidden":`true`,className:`size-[18px] flex-none`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),i]});return a?(0,U.jsxs)(`div`,{className:`group relative`,children:[l,a]}):l}function Sl(e,t,n){let[r,i]=(0,H.useState)(t),a=e??r;return[a,()=>{e===void 0&&i(!a),n?.(!a)}]}function Cl({href:e,label:t}){return(0,U.jsx)(`a`,{href:e,"aria-label":t,"data-tip":t,"data-tip-side":`right`,className:g(he({variant:`icon`,size:`icon-xs`}),`absolute top-1/2 right-[30px] z-20 -translate-y-1/2 bg-surface-strong opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-accent`),children:(0,U.jsx)(vn,{size:14,strokeWidth:2,"aria-hidden":`true`})})}function wl({label:e,href:t,current:n,className:r,children:i}){let a=(0,H.useId)(),o=`flex h-7 short:h-6 items-center rounded-sm px-2 text-body-sm font-medium text-muted no-underline`;return(0,U.jsxs)(`div`,{"data-tree-group":``,role:`group`,"aria-labelledby":a,className:g(`flex flex-col gap-px`,r),children:[t?(0,U.jsx)(`a`,{id:a,href:t,"aria-current":n?`page`:void 0,className:g(o,`hover:text-ink`,n&&`text-(--side-current-ink)`),children:e}):(0,U.jsx)(`span`,{id:a,className:o,children:e}),i]})}function Tl({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]=Sl(o,s,c),p=(0,H.useId)(),m=bl();return(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-px`,u),children:[(0,U.jsxs)(`div`,{className:`group relative`,children:[(0,U.jsxs)(`button`,{type:`button`,"data-tree-row":``,"aria-expanded":d,"aria-controls":p,"aria-current":a?`page`:void 0,onClick:f,...m,className:g(_l,`cursor-pointer text-left`,a?`font-medium text-(--side-current-ink)`:`text-ink-2 hover:text-ink`),children:[t,(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),n,(0,U.jsx)(ct,{size:14,strokeWidth:2,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform group-hover:text-ink motion-reduce:transition-none`,d&&`rotate-90`)})]}),r&&(0,U.jsx)(Cl,{href:r,label:i||`Open ${e}`})]}),(0,U.jsx)(sr,{open:d,id:p,children:(0,U.jsx)(yl,{lines:hl,label:e,children:l})})]})}function El({label:e,icon:t,href:n,hrefLabel:r,current:i,lines:a,open:o,defaultOpen:s=!0,onOpenChange:c,children:l,className:u}){let[d,f]=Sl(o,s,c),p=(0,H.useId)(),m=bl();return(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-px`,u),children:[(0,U.jsxs)(`div`,{className:`group relative`,children:[(0,U.jsxs)(`button`,{type:`button`,"data-tree-row":``,"aria-expanded":d,"aria-controls":p,"aria-current":i?`page`:void 0,onClick:f,...m,className:g(_l,`cursor-pointer text-left font-medium`,i?`text-(--side-current-ink)`:t?`text-ink`:`text-muted hover:text-ink`),children:[t,(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),(0,U.jsx)(Be,{size:14,strokeWidth:2,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform group-hover:text-ink motion-reduce:transition-none`,!d&&`-rotate-90`)})]}),n&&(0,U.jsx)(Cl,{href:n,label:r||`Open ${e}`})]}),(0,U.jsx)(sr,{open:d,id:p,children:(0,U.jsx)(yl,{lines:a,label:e,children:l})})]})}function Dl({routeKey:e,className:t,children:n}){let r=(0,H.useRef)(null),i=(0,H.useRef)(null),[a,o]=(0,H.useState)([]),[s,c]=(0,H.useState)(Uc),l=(0,H.useCallback)(()=>{let e=r.current;if(!e)return;let t=[...e.querySelectorAll(`[data-tree-row][aria-current="page"]`)].map(t=>Gc(e,t)).filter(e=>e.on);o(e=>e.length===t.length&&e.every((e,n)=>Wc(e,t[n]))?e:t);let n=i.current?.getAttribute(`aria-current`)===`page`?Uc:Gc(e,i.current);c(e=>Wc(e,n)?e:n)},[]);(0,H.useLayoutEffect)(l,[e,l]),(0,H.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,H.useRef)({hover:e=>{i.current=e,l()}}).current;return(0,U.jsx)(gl.Provider,{value:u,children:(0,U.jsxs)(`div`,{ref:r,onPointerLeave:()=>u.hover(null),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||u.hover(null)},className:g(`relative flex w-full flex-col gap-px`,t),children:[(0,U.jsx)(Zc,{pill:s,className:`rounded-sm bg-surface-strong/60`}),a.map((e,t)=>(0,U.jsx)(Zc,{pill:e,className:`rounded-sm bg-(--side-current-bg)`},t)),n]})})}var Ol=`flex h-8 short:h-7 items-center gap-2 rounded-full px-4 text-body-sm no-underline`,kl=e=>e?`bg-(--side-current-bg) font-medium text-(--side-current-ink) hover:text-(--side-current-ink)`:`text-ink-2 hover:bg-tint hover:text-ink`,Al=e=>e.id===`agents`?{href:r(`agents`),label:e.label}:{label:e.label},jl=/^[A-Za-z0-9][\w.-]{0,120}$/;function Ml(e){let[t,n,i,a]=e;if(t===`responsive`&&n===`runs`&&i)return{middle:{href:r(`responsive`,`runs`),label:`Runs`},here:`Run`};if(t===`product`&&n===`services`&&i)return{middle:{href:r(`product`,`architecture`,`services`),label:`Services`},here:`Service`};if(t===`agents`&&n===`custom`&&i&&i!==`new`)return{parent:{href:r(`agents`),label:`Agents`},middle:{href:r(`agents`,`category`,`custom`),label:`Custom agents`},here:`Custom agent`};if(t===`agents`&&n===`teams`&&i)return{parent:{href:r(`agents`),label:`Agents`},middle:{href:r(`agents`,`category`,`custom`),label:`Custom agents`},here:i===`new`?`New team`:`Team`};if(t===`test-management`&&n===`cases`&&i)return{middle:{href:r(`test-management`,`cases`),label:`Test cases`},here:`Test case`};if(t===`test-management`&&n===`tests`&&i)return{middle:{href:r(`test-management`,`tests`),label:`Automated tests`},here:`Test`};if(t===`test-management`&&n===`suites`&&i)return{middle:{href:r(`test-management`,`suites`),label:`Suites`},here:`Suite`};if(t===`agents`&&n===`basal`&&i===`tests`&&a)return{parent:{href:r(`agents`),label:`Agents`},middle:{href:r(`agents`,`basal`,`tests`),label:`BASAL tests`},here:`Test`};if((t===`migration`||t===`tosca`)&&n&&jl.test(n)&&i===`compare`)return{middle:{href:r(`migration`,n),label:`Conversion`},here:`Compare`}}function Nl(e){if(!e.length)return;if(e[0]===`settings`){let t=ne.find(t=>t.id===(e[1]||`models`));return t?{parent:{href:r(`settings`),label:`Settings`},here:{label:t.label}}:void 0}let t=ir(e),n=Ml(e);if(n&&(n.parent||t))return{parent:n.parent??Al(t.category),middle:n.middle,here:{label:n.here}};let i=e[0]===`agents`&&e[1]&&e[1]!==`category`&&e[1]!==`custom`?P(e[1]):void 0;if(i)return{parent:{href:r(`agents`),label:`Agents`},here:{label:I(i.agent).name,href:e.length>2?r(`agents`,i.id):void 0}};if(!t)return;let a=Qn(t.item,e),o=t.item.path.length>0&&e.length>a;return{parent:Al(t.category),here:{label:t.item.label,href:o?r(...t.item.path):void 0}}}function Pl(e){let[t,n]=(0,H.useState)(null),[r,i]=(0,H.useState)(``),a=(0,H.useCallback)(()=>{i(``),e().then(n,e=>i(e.message))},[e]);return(0,H.useEffect)(a,[a]),{data:t,error:r,reload:a}}function Fl({error:e,reload:t}){return e?(0,U.jsxs)(`div`,{role:`alert`,className:g(d,`flex flex-col items-start gap-4`),children:[(0,U.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:e}),(0,U.jsxs)(B,{size:`sm`,onClick:t,children:[(0,U.jsx)(Qe,{"aria-hidden":`true`}),`Retry`]})]}):(0,U.jsx)(Se,{shape:`lines`,count:4,card:!1,className:`py-4`})}function K(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 Il(e){return`${K(e.input)} read${e.cached?` (${K(e.cached)} from cache)`:``} · ${K(e.output)} written`}var Ll=null;function Rl(e){Ll=e}function q(e,t){if(!t)return`—`;let n=Ll?.to,r=Ll?.perEur?.[t],i=n?Ll?.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 zl(e){if(!Ll?.perEur||!e||Ll.to===e||!Ll.perEur[e])return``;let t=q(1,e);return`Shown in ${Ll.to}, converted from ${e} at the European Central Bank's rate of ${Ll.date}: ${new Intl.NumberFormat(void 0,{style:`currency`,currency:e}).format(1)} = ${t}.`}var Bl=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})},Vl=e=>e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} bytes`;function Hl({head:e,children:t,label:n,height:r}){let i=H.Children.toArray(t).map(e=>(0,H.isValidElement)(e)&&e.type===Ul?(0,U.jsx)(H.Fragment,{children:Ul(e.props)},e.key):e);return(0,U.jsx)(Mc,{label:n,...r?{height:r}:{},head:e.map((e,t)=>(0,U.jsx)(`th`,{scope:`col`,className:t>0?mc:pc,children:e},e||t)),children:i})}function Ul({cells:e,sort:t}){return(0,U.jsx)(`tr`,{className:`border-t border-line-soft`,children:e.map((e,n)=>(0,U.jsx)(`td`,{"data-sort":t?.[n],className:g(n>0?vc:_c,`align-top`,n===0&&`min-w-[200px]`),children:e},n))})}var Wl={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}]},Gl={"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 Kl(e,t){return e===`tier0`?t===`shadow`?`Test mode: AI ran it, could have replayed`:`Replayed for free`:`AI: ${Gl[e]||e}`}function ql({edit:e}){let{data:t,error:n,reload:r}=Pl(R.registry),[i,a]=(0,H.useState)(!1),o=String(cr(e.value,[`registry`,`mode`])??`on`);return(0,U.jsxs)(Pr,{children:[(0,U.jsx)(Dr,{label:`Replay passed runs for free`,help:o===`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,U.jsx)(or,{checked:o===`on`,onChange:t=>e.set(ur(e.value,[`registry`,`mode`],t?`on`:`off`)),label:`Replay passed runs for free`})}),t?!t.exists||t.plans.length===0?(0,U.jsx)(z,{children:`Nothing to replay yet. When a run passes, ForgeQE saves its steps, and running it again is free.`}):(0,U.jsxs)(Pr,{children:[(0,U.jsxs)(pl,{label:`Replays`,className:`mt-4`,children:[(0,U.jsx)(G,{icon:Et,label:`Free reruns`,value:String(t.replayed),note:`of ${h(t.total,`run`)}`}),(0,U.jsx)(G,{icon:$e,label:`Tokens saved`,value:K(t.tokensSaved),note:`${h(t.plans.length,`passed run`)} ready to replay`})]}),(0,U.jsxs)(B,{variant:`link`,size:`inline`,"aria-expanded":i,"aria-controls":`replay-details`,onClick:()=>a(!i),"data-tip":i?`Hide details`:`Show details`,className:`mt-2 self-start`,children:[i?(0,U.jsx)(sn,{"aria-hidden":`true`}):(0,U.jsx)(Be,{"aria-hidden":`true`}),i?`Less`:`Details`]}),(0,U.jsxs)(sr,{open:i,id:`replay-details`,children:[(0,U.jsx)(Ir,{first:!0,children:`Saved runs`}),(0,U.jsx)(Hl,{label:`Saved runs`,head:[`Goal`,`Passed`,`Failed`,`Tokens the first time`,`Last used`],children:t.plans.map(e=>(0,U.jsx)(Ul,{cells:[(0,U.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`line-clamp-2`,children:e.goal}),e.stale&&(0,U.jsx)(`span`,{className:`text-body-sm text-warn`,children:`Out of date: the AI runs it next time`})]}),e.successes,e.failures,e.firstTokens?K(e.firstTokens):`—`,Bl(e.lastAt)],sort:[void 0,void 0,void 0,e.firstTokens??-1,new Date(e.lastAt).getTime()||0]},e.id))}),(0,U.jsx)(Ir,{children:`Recent runs`}),t.requests.length===0?(0,U.jsx)(z,{children:`No runs yet.`}):(0,U.jsx)(Hl,{label:`Recent runs`,head:[`Request`,`How it ran`,`Result`,`Tokens`,`When`],children:t.requests.map(e=>(0,U.jsx)(Ul,{cells:[(0,U.jsx)(`span`,{className:`line-clamp-2`,children:e.request||e.planGoal||e.id}),Kl(e.decision,e.mode),e.outcome||`—`,K(e.tokens),Bl(e.startedAt)],sort:[void 0,void 0,void 0,e.tokens,new Date(e.startedAt).getTime()||0]},e.id))})]})]}):(0,U.jsx)(Fl,{error:n,reload:r})]})}function Jl(){let{data:e,error:t,reload:n}=Pl(R.logs),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(``);return e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`mt-0 mb-4 text-body-sm text-muted`,children:[`Kept in `,(0,U.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.dir}),`. Secrets are replaced with their names before a log is shown.`]}),a&&(0,U.jsx)(`p`,{role:`alert`,className:`mt-0 mb-4 text-body-sm text-fail`,children:a}),e.logs.length===0?(0,U.jsx)(z,{children:`No session logs yet. ForgeQE writes one for each chat, run and suite.`}):e.logs.map(e=>(0,U.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,U.jsx)(rs,{icon:Mt}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-mono text-body-sm break-all`,children:e.name}),(0,U.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[Bl(e.modified),`, `,Vl(e.size)]})]}),(0,U.jsx)(B,{variant:`icon`,size:`icon-sm`,"aria-label":`Open ${e.name}`,"data-tip":`Open ${e.name}`,onClick:()=>{o(``),R.log(e.name).then(i,e=>o(e.message))},children:(0,U.jsx)(Mt,{"aria-hidden":`true`})})]},e.name)),(0,U.jsx)(Si,{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,U.jsxs)(B,{onClick:()=>i(null),children:[(0,U.jsx)(Ge,{"aria-hidden":`true`}),`Close`]}),children:r&&(0,U.jsx)(`pre`,{className:`m-0 mt-4 font-mono text-body-sm leading-relaxed whitespace-pre-wrap break-all`,children:(0,U.jsx)(Ee,{text:r.text})})})]}):(0,U.jsx)(Fl,{error:t,reload:n})}var Yl={error:`Error`,tool:`Tool call failed`,run:`Run failed`,engine:`Browser engine stopped`,agent:`Agent error`,model:`Model call failed`},Xl={chat:`Chat`,start:`Shell`,run:`Run`,suite:`Suite`,code:`Write tests`,heal:`Heal`,monitor:`Monitor`,mcp:`MCP`,explore:`Explore`};function Zl(){let[e,t]=(0,H.useState)(null),[n,r]=(0,H.useState)(``);return{show:e=>{r(``),R.log(e).then(t,e=>r(e.message))},error:n,sheet:(0,U.jsx)(Si,{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,U.jsxs)(B,{onClick:()=>t(null),children:[(0,U.jsx)(Ge,{"aria-hidden":`true`}),`Close`]}),children:e&&(0,U.jsx)(`pre`,{className:`m-0 mt-4 font-mono text-body-sm leading-relaxed break-all whitespace-pre-wrap`,children:(0,U.jsx)(Ee,{text:e.text})})})}}function Ql({entries:e}){let[t,n]=(0,H.useState)(-1);return e.length?(0,U.jsx)(U.Fragment,{children:e.map((e,r)=>(0,U.jsx)(Wr,{lead:(0,U.jsx)(rs,{icon:Ot}),title:`${e.action}: ${e.file}`,meta:`${Bl(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,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0 py-4`,children:e.changes.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-body-sm`,children:[(0,U.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.key}),(0,U.jsx)(`span`,{className:`text-muted`,children:e.before===void 0?(0,U.jsxs)(U.Fragment,{children:[`added `,(0,U.jsx)(`span`,{className:`text-ink`,children:e.after})]}):e.after===void 0?(0,U.jsxs)(U.Fragment,{children:[`removed `,(0,U.jsx)(`span`,{className:`text-ink line-through`,children:e.before})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-ink line-through`,children:e.before}),` → `,(0,U.jsx)(`span`,{className:`text-ink`,children:e.after})]})})]},t))})},r))}):(0,U.jsx)(z,{children:`No changes made in Settings yet.`})}function $l(){let{data:e,error:t,reload:n}=Pl(R.audit),[r,i]=(0,H.useState)(`summary`),a=Zl();if(!e)return(0,U.jsx)(Fl,{error:t,reload:n});let o=e.summary,s=o.totals,c=e=>e?`${e} failed`:`None failed`;return(0,U.jsxs)(Pr,{children:[(0,U.jsx)(`p`,{className:`mt-0 mb-4 text-body-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,U.jsx)(ol,{label:`Audit`,current:r,onPick:i,tabs:[{id:`summary`,label:`Summary`},{id:`problems`,label:`Problems`,n:o.problems.length},{id:`sessions`,label:`Sessions`,n:o.sessions.length},{id:`changes`,label:`Settings changes`,n:e.entries.length}]}),a.error&&(0,U.jsx)(`p`,{role:`alert`,className:`mt-0 mb-4 text-body-sm text-fail`,children:a.error}),(0,U.jsxs)(`div`,{id:`panel-${r}`,role:`tabpanel`,"aria-labelledby":`tab-${r}`,children:[r===`summary`&&(0,U.jsxs)(Pr,{children:[(0,U.jsxs)(pl,{label:`Activity summary`,children:[(0,U.jsx)(G,{icon:Rt,label:`Sessions`,value:String(s.sessions),note:s.replays?`${s.replays} request${s.replays===1?``:`s`} replayed without the agent`:void 0}),(0,U.jsx)(G,{icon:Dt,label:`Tool calls`,value:String(s.toolCalls),note:c(s.toolErrors)}),(0,U.jsx)(G,{icon:gt,label:`Runs`,value:String(s.runs),note:c(s.runsFailed)}),(0,U.jsx)(G,{icon:Ut,label:`Model calls`,value:String(s.modelCalls),note:c(s.modelErrors)}),(0,U.jsx)(G,{icon:Ve,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,U.jsxs)(Pr,{children:[(0,U.jsx)(Ir,{children:`Latest problems`}),(0,U.jsx)(eu,{problems:o.problems.slice(0,5),onLog:a.show}),o.problems.length>5&&(0,U.jsxs)(B,{variant:`link`,size:`inline`,onClick:()=>i(`problems`),"data-tip":`All ${o.problems.length} problems`,className:`mt-4 self-start`,children:[(0,U.jsx)(vn,{"aria-hidden":`true`}),`All (`,o.problems.length,`)`]})]}),(0,U.jsx)(Ir,{children:`Tools used`}),o.tools.length===0?(0,U.jsx)(z,{children:`No tool calls logged in the last 30 days.`}):(0,U.jsx)(Hl,{label:`Tools used`,head:[`Tool`,`Calls`,`Failed`,`Average time`],children:o.tools.map(e=>(0,U.jsx)(Ul,{cells:[(0,U.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.name}),e.calls,e.errors?(0,U.jsx)(`span`,{className:`text-fail`,children:e.errors}):0,e.calls?`${(e.ms/e.calls/1e3).toFixed(1)} s`:`—`],sort:[void 0,e.calls,e.errors,e.calls?e.ms/e.calls:-1]},e.name))}),(0,U.jsx)(Ir,{children:`Model calls`}),o.models.length===0?(0,U.jsx)(z,{children:`No model calls in the usage ledger in the last 30 days.`}):(0,U.jsx)(Hl,{label:`Model calls`,head:[`Model`,`Calls`,`Failed`,`Tokens`],children:o.models.map(e=>(0,U.jsx)(Ul,{cells:[e.model,e.calls,e.errors?(0,U.jsx)(`span`,{className:`text-fail`,children:e.errors}):0,K(e.tokens)],sort:[void 0,e.calls,e.errors,e.tokens]},e.model))})]}),r===`problems`&&(o.problems.length?(0,U.jsx)(eu,{problems:o.problems,onLog:a.show}):(0,U.jsx)(z,{children:`Nothing failed in the last 30 days.`})),r===`sessions`&&(o.sessions.length?(0,U.jsx)(Hl,{label:`Sessions`,height:`max(320px, calc(var(--screen) - 288px))`,head:[`Session`,`Tool calls`,`Runs`,`Errors`,`Tokens`,``],children:o.sessions.map(e=>(0,U.jsx)(Ul,{cells:[(0,U.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:Xl[e.command]||e.command}),(0,U.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[Bl(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,U.jsx)(`span`,{className:`text-fail`,children:e.errors}):0,K(e.tokens),(0,U.jsx)(B,{variant:`icon`,size:`icon-sm`,"aria-label":`Open the log of the ${Xl[e.command]||e.command} session at ${Bl(e.started)}`,"data-tip":`Open the log of the ${Xl[e.command]||e.command} session at ${Bl(e.started)}`,onClick:()=>a.show(e.log),children:(0,U.jsx)(Mt,{"aria-hidden":`true`})})],sort:[void 0,e.tools,e.runs,e.errors,e.tokens]},e.log))}):(0,U.jsx)(z,{children:`No sessions logged in the last 30 days.`})),r===`changes`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`mt-0 mb-4 text-body-sm text-muted`,children:[`Every change made in Settings, kept in `,(0,U.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.file}),`. Changes made to the files by hand are not here.`]}),(0,U.jsx)(Ql,{entries:e.entries})]})]}),a.sheet]})}function eu({problems:e,onLog:t}){return(0,U.jsx)(U.Fragment,{children:e.map((e,n)=>(0,U.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,U.jsx)(rs,{icon:e.kind===`run`||e.kind===`tool`?Jn:Ve,tone:`fail`}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:Yl[e.kind]}),(0,U.jsx)(`span`,{className:`text-body-sm break-words text-ink-2`,children:e.text}),(0,U.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[Bl(e.at),`, `,Xl[e.command]||e.command]})]}),e.log&&(0,U.jsx)(B,{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,U.jsx)(Mt,{"aria-hidden":`true`})})]},n))})}var tu={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`}]},nu={suite:`Suites`,monitor:`Monitor rounds`,run:`Browser runs`,explore:`Exploratory`,api:`API tests`,desktop:`Desktop runs`,mobile:`Mobile runs`},ru={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`},iu=e=>ru[e]||e.charAt(0).toUpperCase()+e.slice(1);function au({days:e,currency:t}){let[n,r]=(0,H.useState)(-1),i=e.reduce((e,t)=>e+t.input+t.output,0),a=e.filter(e=>e.runs>0).length,o=e.reduce((e,t)=>t.input+t.output>e.input+e.output?t:e,e[0]),s=n>=0?e[n]:e[e.length-1],c=e=>new Date(`${e}T12:00:00Z`).toLocaleDateString(void 0,{month:`short`,day:`numeric`});return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`p`,{"aria-live":`polite`,className:`m-0 text-body-sm text-ink-2`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:c(s.day)}),`: `,K(s.input+s.output),` tokens, `,s.runs,` run`,s.runs===1?``:`s`,t?`, ${q(s.amount,t)}`:``]}),(0,U.jsx)(be,{series:[{values:e.map(e=>e.input+e.output)}],label:`Tokens a day for the last 30 days: ${K(i)} in all, on ${a} days with runs; the busiest was ${c(o.day)} with ${K(o.input+o.output)}.`,hover:n,onHover:r,className:`h-[160px]`,axis:[c(e[0].day),c(e[e.length-1].day)]})]})}function ou({rows:e,currency:t,label:n}){if(!e.length)return(0,U.jsx)(z,{children:`Nothing yet.`});let r=Math.max(1,e.reduce((e,t)=>e+t.sum.input+t.sum.output,0));return(0,U.jsx)(Ae,{label:n,rows:e.map(e=>{let n=e.sum.input+e.sum.output;return{key:e.name,label:e.name,value:K(n),sub:t&&e.sum.amount?q(e.sum.amount,t):`tokens`,share:n/r}})})}var su=e=>{let t=Math.round(e*100)/100;return`${t} premium request${t===1?``:`s`}`};function cu({label:e,spent:t,limit:n,currency:r,premium:i}){let a=e=>i?su(e):q(e,r),o=t/n*100,s=o>=100?`fail`:o>=80?`warn`:`ok`;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 text-body-sm`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e}),(0,U.jsxs)(`span`,{className:g(`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,U.jsx)(ke,{value:t,limit:n,label:`${e}: ${a(t)} of ${a(n)}`})]})}function lu({edit:e}){let{data:t,error:n,reload:i}=Pl(R.tokenomics),a=(0,U.jsx)(Ur,{defs:tu.fields,edit:e,base:tu.base});if(!t)return(0,U.jsx)(Fl,{error:n,reload:i});let o=t,s=o.currency,c=o.totals.input+o.totals.output,l=o.budget,u=l?.currency||o.spent?.currency||s,f=o.project?.days30.calls?o.project:void 0,p=f?f.days30.input+f.days30.output:0;return(0,U.jsxs)(Pr,{children:[f&&(0,U.jsxs)(Pr,{children:[(0,U.jsxs)(`p`,{className:`mt-0 mb-4 text-body-sm text-muted`,children:[`Every model call made for this project from `,o.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,U.jsx)(`a`,{href:r(`cost`),children:`Cost and model usage`}),` breaks them down by agent, job and model, priced at today's prices.`]}),(0,U.jsxs)(pl,{label:`All model calls, last 30 days`,children:[(0,U.jsx)(G,{icon:Ze,label:`Tokens`,value:K(p),note:Il(f.days30)}),(0,U.jsx)(G,{icon:Ye,label:`Cost`,value:f.currency?q(f.days30.amount,f.currency):`—`,note:f.currency?`When each call was made`:`No prices known`}),(0,U.jsx)(G,{icon:st,label:`Calls`,value:f.days30.calls.toLocaleString(),note:`${K(f.today.input+f.today.output)} tokens today`}),(0,U.jsx)(G,{icon:_n,label:`Read from cache`,value:f.days30.input?`${Math.round(f.days30.cached/f.days30.input*100)}%`:`—`,note:`Of the tokens read`})]}),zl(f.currency)&&(0,U.jsx)(`p`,{className:`mt-4 mb-0 text-body-sm text-muted`,children:zl(f.currency)}),f.byChannel&&(0,U.jsxs)(Pr,{children:[(0,U.jsx)(Ir,{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,U.jsx)(ou,{label:`Tokens by how you asked`,currency:f.currency,rows:[{name:`Voice (Talk), ${f.byChannel.voice.calls.toLocaleString()} calls`,sum:{runs:0,...f.byChannel.voice}},{name:`Typed and other, ${f.byChannel.typed.calls.toLocaleString()} calls`,sum:{runs:0,...f.byChannel.typed}}]})]}),!!f.top?.length&&(0,U.jsxs)(Pr,{children:[(0,U.jsx)(Ir,{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,U.jsx)(Hl,{label:`Work that used the most tokens`,head:[`Work`,`Kind`,`Tokens`,`Cost`,`When`],children:f.top.map(e=>(0,U.jsx)(Ul,{cells:[(0,U.jsxs)(`span`,{className:`line-clamp-2`,children:[e.title,e.voice?(0,U.jsx)(`span`,{className:`text-muted`,children:` · by voice`}):null]}),iu(e.kind),K(e.tokens),e.amount!==void 0&&f.currency?q(e.amount,f.currency):`—`,e.startedAt?Bl(e.startedAt):`—`],sort:[void 0,void 0,e.tokens,e.amount??-1,e.startedAt&&new Date(e.startedAt).getTime()||0]},e.id))})]}),(0,U.jsx)(Ir,{children:`Test runs`})]}),o.totals.runs===0?(0,U.jsx)(z,{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,U.jsxs)(Pr,{children:[(0,U.jsxs)(`p`,{className:`mt-0 mb-4 text-body-sm text-muted`,children:[`From `,o.totals.runs,` run`,o.totals.runs===1?``:`s`,` in this project's reports in the last 30 days`,o.from?`, ${o.from} to ${o.to}`:``,`: test runs only, not chats. Models and agents come from the `,o.totals.withCalls,` run`,o.totals.withCalls===1?``:`s`,` that kept their model calls.`]}),(0,U.jsxs)(pl,{label:`Test runs, last 30 days`,children:[(0,U.jsx)(G,{icon:Ze,label:`Tokens`,value:K(c),note:Il(o.totals)}),(0,U.jsx)(G,{icon:Ye,label:`Cost`,value:q(o.totals.amount,s),note:o.totals.unpriced?`${o.totals.unpriced} run${o.totals.unpriced===1?``:`s`} had no price`:s?`At the models' prices`:`No prices known`}),(0,U.jsx)(G,{icon:st,label:`Per run`,value:K(Math.round(c/o.totals.runs)),note:s?q(o.totals.amount/o.totals.runs,s):void 0}),(0,U.jsx)(G,{icon:_n,label:`Read from cache`,value:o.totals.input?`${Math.round(o.totals.cached/o.totals.input*100)}%`:`—`,note:`Of the tokens read`})]}),zl(o.currency)&&f?.currency!==o.currency&&(0,U.jsx)(`p`,{className:`mt-4 mb-0 text-body-sm text-muted`,children:zl(o.currency)}),o.otherCurrency>0&&(0,U.jsxs)(`p`,{className:`mt-4 mb-0 text-body-sm text-muted`,children:[o.otherCurrency,` run`,o.otherCurrency===1?` was`:`s were`,` priced in another currency and left out of the cost.`]}),(0,U.jsx)(Ir,{children:`Last 30 days`}),(0,U.jsx)(au,{days:o.days,currency:s}),(0,U.jsxs)(`div`,{className:`mt-8 flex flex-wrap gap-x-10 gap-y-8`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-4`,children:[(0,U.jsx)(`h3`,{className:`m-0 text-body-lg font-medium`,children:`By model`}),(0,U.jsx)(ou,{label:`Tokens by model`,rows:o.byModel.map(e=>({name:e.model,sum:e})),currency:s})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-4`,children:[(0,U.jsx)(`h3`,{className:`m-0 text-body-lg font-medium`,children:`By agent`}),(0,U.jsx)(ou,{label:`Tokens by agent`,rows:o.byAgent.map(e=>({name:e.agent,sum:e})),currency:s})]})]}),(0,U.jsx)(Ir,{children:`By kind of run`}),(0,U.jsx)(ou,{label:`Tokens by kind of run`,rows:o.byKind.map(e=>({name:`${nu[e.kind]||e.kind} (${e.runs})`,sum:e})),currency:s})]}),(0,U.jsx)(Ir,{help:tu.help,children:tu.title}),l&&o.spent&&(l.day||l.month)?(0,U.jsxs)(`div`,{className:g(d,`mb-4 flex flex-col gap-4`),children:[l.day?(0,U.jsx)(cu,{label:`Today`,spent:o.spent.today,limit:l.day,currency:u}):null,l.month?(0,U.jsx)(cu,{label:`This month`,spent:o.spent.month,limit:l.month,currency:u}):null]}):null,l?.premium&&o.spent&&(l.premium.day||l.premium.month)?(0,U.jsxs)(`div`,{className:g(d,`mb-4 flex flex-col gap-4`),children:[l.premium.day?(0,U.jsx)(cu,{label:`Premium requests today`,spent:o.spent.premiumToday||0,limit:l.premium.day,premium:!0}):null,l.premium.month?(0,U.jsx)(cu,{label:`Premium requests this month`,spent:o.spent.premiumMonth||0,limit:l.premium.month,premium:!0}):null]}):null,a]})}var J=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},Y=e=>typeof e==`string`?e:e==null?``:String(e),uu=e=>e.replace(/(?:\s*\[(?:They spoke while you were talking; they heard up to: |Running elsewhere in ForgeQE now, as data: )[^\n]*\])+\s*$/,``),du=(e,t=400)=>e.length>t?`${e.slice(0,t-1)}…`:e,fu=e=>typeof e==`number`?` in ${Math.round(e/1e3)}s`:``;function X(e,t=400){return du(e.replace(/\s+/g,` `).trim(),t).replace(/([\\`*_[\]<>#|~!])/g,`\\$1`)}function pu(e){let t=e.replace(/\s+/g,` `).trim();if(!t)return``;let n=t.includes("`")?"``":"`";return`${n}${n==="``"?` `:``}${t}${n==="``"?` `:``}${n}`}function mu(e,t){return/^https?:\/\/[^\s)]+$/i.test(t)?`[${X(e||t,120)}](${t})`:X(e)}var hu=e=>[pu(Y(J(e).id)),X(Y(J(e).title),200)].filter(Boolean).join(` `);function gu(e){return e.replace(/<!--[\s\S]*?(?:-->|$)/g,``).trim()}function _u(e){return e.replace(/\[((?:\\.|[^\]\\])*)\]\(https?:\/\/[^\s)]+\)/g,`$1`).replace(/\\(.)/g,`$1`).replace(/[*`]/g,``)}var Z=(e,t)=>({tone:e,kind:`item`,md:t}),vu=(e,t)=>({tone:e,kind:`sub`,md:t});function yu(e,t=``){let n=t||(e.agent&&e.agent!==`forgeqe`?`**${X(Y(e.agent))}:** `:``);switch(e.kind){case`info`:return Z(`info`,`${n}${X(Y(e.text))}`);case`start`:return Z(`dim`,`${n}→ ${pu(Y(e.tool))}${e.text&&e.text!==e.tool?` ${X(Y(e.text),200)}`:``}`);case`tool`:{let t=J(e.file),r=J(e.shell).exit,i=typeof r==`number`&&r!==0?` (exit code ${r})`:``;return Z(e.ok===!1?`warn`:`dim`,`${n}${e.ok===!1?`⚠`:`✓`} ${X(Y(e.text)||Y(e.tool),240)}${i}${t.path?` (${X(Y(t.action))} ${pu(Y(t.path))})`:``}`)}case`say`:{let t=gu(Y(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(Y(e.attempt))}:** ${X(Y(e.text),240)}`):Z(e.ok?`ok`:`fail`,`${n}${e.ok?`✓`:`✗`} ${X(Y(e.text),240)}`);case`plan`:{let t=Array.isArray(e.items)?e.items.map(J):[],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(Y(r.text))}`:``}`)}case`review`:return Z(e.approved?`ok`:`warn`,`${n}**Review, attempt ${X(Y(e.attempt))}:** ${e.approved?`approved`:`changes asked`}. ${X(Y(e.summary),240)}`);case`attempt`:return Z(`warn`,`${n}**Attempt ${X(Y(e.attempt))} of ${X(Y(e.max))}:** ${X(Y(e.why),240)}`);case`answer`:return Z(`dim`,`${n}Attempt ${X(Y(e.attempt))}: ${X(Y(e.notes)||`changed ${(Array.isArray(e.changed)?e.changed:[]).map(Y).join(`, `)}`,240)}`);case`context`:return e.compacted?Z(`info`,`${n}Context compacted: the conversation was summarised to make room.`):null;default:return null}}function bu(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(Y(e.text))}`);case`step`:return Z(`dim`,`${t}**Step ${X(Y(e.step))}** · ${e.source===`memory`?`from memory`:X(Y(e.category))} · ${mu(Y(e.title)||`untitled`,Y(e.url))}`);case`memory`:return Z(`info`,`${t}↻ ${X(Y(e.text))}`);case`thought`:return vu(`think`,`*${X(Y(e.text))}*`);case`outcome`:return vu(e.ok?`ok`:`fail`,`${e.ok?`✓`:`✗`} ${X(Y(e.text),300)}`);case`done`:{let n=J(e.result);return Z(n.status===`complete`?`ok`:`fail`,`${t}**${X(Y(n.status))}:** ${X(Y(n.summary))}`)}case`code`:return yu(e,t);default:return null}}function xu(e){switch(e.type){case`run-start`:return{tone:`info`,kind:`head`,md:`Browser run: ${X(Y(e.goal),200)}${e.url?` · ${mu(Y(e.url).replace(/^https?:\/\//,``),Y(e.url))}`:``}`};case`run-event`:return bu(J(e.event));case`run-done`:{let t=J(e.result),n=!e.error&&(t.outcome===`passed`||!t.outcome&&t.status===`complete`);return Z(n?`ok`:`fail`,`${n?`✓`:`✗`} **Run ${n?`passed`:`failed`}**${fu(e.ms)}: ${X(Y(e.error)||Y(t.summary))}${e.runDir?` · ${pu(Y(e.runDir))}`:``}`)}case`suite-start`:return{tone:`info`,kind:`head`,md:`Suite: ${(Array.isArray(e.cases)?e.cases:[]).length} cases, ${X(Y(e.parallel))} at once`};case`suite-event`:{let t=J(e.event);if(t.type===`case-start`)return Z(`info`,`**Case ${Number(t.index)+1} of ${X(Y(t.total))}:** ${hu(t.case)}`);if(t.type===`case-event`)return bu(J(t.event),`${pu(Y(J(t.case).id))} `);if(t.type===`case-done`){let e=J(t.result);return Z(e.status===`passed`?`ok`:`fail`,`${e.status===`passed`?`✓`:`✗`} ${hu(e.case)}: **${X(Y(e.status))}**${fu(e.ms)}${e.summary?`. ${X(Y(e.summary),240)}`:``}`)}return t.type===`code-start`?Z(`info`,`${pu(Y(J(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(J(e.suite).results)?J(e.suite).results:[]).map(J),n=t.filter(e=>e.status===`passed`).length;return Z(n===t.length?`ok`:`fail`,`**Suite: ${n} of ${t.length} passed**${fu(J(e.suite).ms)}`)}case`info`:return Z(e.ok===!1?`fail`:e.ok===!0?`ok`:`info`,X(Y(e.text)));case`agent`:return yu(J(J(e.event)),`**Quill:** `);case`code-start`:return{tone:`info`,kind:`head`,md:`Writing a test: ${X(Y(e.goal),200)}`};case`code-done`:{let t=Y(J(e.result).status);return e.error?Z(`fail`,`✗ **Test not written**${fu(e.ms)}: ${X(Y(e.error),240)}`):!t||t===`passed`?Z(`ok`,`✓ **Test written**${fu(e.ms)}`):t===`stopped`?Z(`warn`,`**Test writing stopped**${fu(e.ms)}`):Z(`fail`,`✗ **Test not finished**${fu(e.ms)} (${X(t,40)})`)}case`card`:{let t=J(e.card),n=(Array.isArray(t.body)?t.body:[]).map(Y).filter(Boolean);return Z(t.status===`ok`?`ok`:t.status===`fail`?`fail`:`info`,`**${X(Y(t.title))}**${t.stats?` · ${X(Y(t.stats))}`:``}${n.length?`: ${X(n.join(`; `),300)}`:``}`)}case`report`:return Z(`ok`,`✓ Report saved: ${X(Y(e.title))}`);case`call-start`:return Z(`dim`,`→ ${X(Y(e.text),240)}`);case`call`:return Z(e.ok===!1?`warn`:`dim`,`${e.ok===!1?`⚠`:`✓`} ${X(Y(e.text),240)}`);default:return null}}function Su(e){let t=Y(e.at)||Y(e.t),n=null;switch(e.type){case`user`:n=Z(`you`,`**You:** ${X(uu(Y(e.text)),240)}`);break;case`agent`:n=yu(J(e.event));break;case`tool`:n=xu(J(e.event));break;case`ask`:n=Z(`you`,`**Asked:** ${X(Y(J(e.question).title))}`);break;case`wait`:n=Z(`you`,`**Waiting for you:** ${X(Y(e.prompt))}`);break;case`answered`:n=Z(`you`,`**You:** ${e.label===void 0?e.ok?`done, continue`:`cancel`:X(Y(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(Y(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(Y(J(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:Y(e.text)};break;case`error`:n=Z(`warn`,`⚠ ${X(Y(e.message))}`);break;case`fatal`:n=Z(`fail`,`✗ **ForgeQE cannot go on:** ${X(Y(e.message))}`);break;case`exit`:n=Z(e.code===0?`dim`:`fail`,`ForgeQE stopped${e.code!==null&&e.code!==void 0?` (exit ${X(Y(e.code))})`:``}${e.message?`: ${X(Y(e.message))}`:``}`)}return n?{at:t,...n,plain:n.kind===`out`?n.md:_u(n.md)}:null}var Cu=new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`}),wu=new Intl.DateTimeFormat(`en-GB`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});function Tu(e){let t=e?Date.parse(e):NaN;if(!Number.isFinite(t))return``;let n=new Date(t);return`${Cu.format(n)} ${wu.format(n)}`}function Eu(e,t){let n=t?[`## ${X(t,200)}`,``]:[],r=[],i=()=>{if(!r.length)return;let e=Math.max(2,...r.map(e=>Math.max(0,...(e.match(/`+/g)||[]).map(e=>e.length)))),t="`".repeat(e+1);n.push(``,`${t}text`,...r,t,``),r=[]};for(let t of e){let e=Tu(t.at),a=e?`\`${e}\``:``;t.kind===`out`?r.push(e?`${e} ${t.md}`:t.md):(i(),t.kind===`head`?n.push(``,`#### ${t.md}${a?` ${a}`:``}`,``):t.kind===`sub`?n.push(` - ${t.md}`):n.push(`- ${a?`${a} `:``}${t.md}`))}return i(),n.join(`
126
+ `).replace(/\n{3,}/g,`
127
+
128
+ `).trim()+`
129
+ `}var Du=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0;function Ou(e){let t=Q(e),n=Du(t.input),r=Du(t.output);if(n===void 0||r===void 0)return;let i=Du(t.cached),a=Du(t.ms),o=Du(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 ku=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 Au(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),ju=[[/^(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`]],Mu={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`},Nu=20;function Pu(e,t,n){let r=(e,t)=>{t&&e.length<Nu&&!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=ju.find(([e])=>e.test(a));if(o)return r(e.knowledge,o[1]);if(Object.hasOwn(Mu,a))return r(e.systems,Mu[a]);let s=Ku.find(([e])=>e.test(a))?.[1];s&&r(e.systems,s)}function Fu(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<Nu&&!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 Iu=[[/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_edit_call/,`Changing a call`,`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`]],Lu=/^(test|attempt|info|review)$/,Ru=/run_test_cases|browser_run|run_suite|write_test/,zu=[[/(^|_)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 Bu(e){let t=e.toLowerCase();return zu.find(([e])=>e.test(t))?.[1]??`work`}function Vu(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 Hu=[[/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`],[/perf_write/,`forgeqe-perf`],[/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 Uu(e){let t=e.toLowerCase();if(!Ju(t))return Hu.find(([e])=>e.test(t))?.[1]}var Wu=[[/write_api_tests/,`forgeqe-api`,`Write the API tests`],[/perf_write/,`forgeqe-perf`,`Write the load test plan`],[/(?<!run_)api_scenarios$/,`forgeqe-api-plan`,`Plan the API scenarios`]];function Gu(e){let t=e.toLowerCase();if(Ju(t))return;let n=Wu.find(([e])=>e.test(t));return n?{agent:n[1],task:n[2]}:void 0}var Ku=[[/^(azure_devops|ado|azuredevops)_/,`Azure DevOps`],[/^(jira|atlassian)_/,`Jira`],[/^confluence_/,`Confluence`],[/^github_/,`GitHub`],[/^xray_/,`Xray`],[/^testrail_/,`TestRail`],[/^zephyr_/,`Zephyr Scale`],[/^qtest_/,`qTest`]],qu=/(^|_)(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 Ju(e){let t=e.toLowerCase();if(!t.startsWith(`forgeqe_`))return Ku.find(([e])=>e.test(t))?.[1]}var Yu=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},Xu=e=>Array.isArray(e)?e.map($).filter(Boolean):[];function Zu(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:Xu(e.changed),reused:Xu(e.reused),...n?{runDir:n}:{},...t?{error:t}:{},...$(e.notes)?{notes:$(e.notes)}:{}}}function Qu(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 $u(e){let t=e.toLowerCase(),n=Ju(t);if(n)return qu.test(t.replace(/^[a-z]+_/,``))?{label:`Updating ${n}`,orb:`working`}:{label:`Reading ${n}`,orb:`reading`};for(let[e,n,r]of Iu)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 ed(e,t){return{id:e,user:t,steps:[],parts:[],next:[],asks:[],waits:[],log:[],plan:[],changes:[],tests:[],reports:[],actions:[]}}function td(e){let t=Q(e);return[$(t.id),$(t.title)].filter(Boolean).join(`: `)}function nd(e,t){if(!t)return;let n=e.trim();if(!n)return t;if(t.trim().toLowerCase()!==n.toLowerCase())return t.slice(0,n.length).toLowerCase()===n.toLowerCase()&&/^[\s:·—-]/.test(t.slice(n.length))?t.slice(n.length).replace(/^[\s:·—-]+/,``)||void 0:t}function rd(e){let t=e.split(`
130
+ `)[0].trim(),n=e.includes(`
131
+ `)?`${t} …`:t;return n.length>80?`${n.slice(0,79)}…`:n}function id(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:rd(i),step:{command:i,...o?{output:o}:{},shell:{...a===void 0?{}:{exit:a},...t?n===`running`?{started:t}:{ended:t}:{}}}}}function ad(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 od(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},i=nd(r.label,r.arg);if(i?r.arg=i:delete r.arg,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&&Lu.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:I(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`)&&Ru.test($(n.tool))&&!Ju($(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?Gu($(n.tool)):void 0;if(f===`start`){if(v)a(e,{key:`c:${m}`,label:`Hands off to ${re(I(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}=$u(_),i=h?void 0:Uu($(n.tool)),o=id(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:Bu(_),...i?{agent:i}:{},...o?o.step:{}},h)}}else if(f===`tool`){n.ok!==!1&&$(n.tool)&&Pu(t.uses??={skills:[],knowledge:[],systems:[]},$(n.tool),$(n.skill));let r=m?i(e,`c:${m}`):void 0,o=Q(n.file),c=Yu(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=id(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 ${re(I(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}=$u(_),i=h?void 0:Uu($(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:Bu(_),...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}=Vu($(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`?ku(n.usage):void 0;if(i){let n=u.get(e);n&&(i.input<n.input||i.output<n.output)&&d.set(e,Au(d.get(e),n)),u.set(e,i),r.usage=Au(d.get(e),i),t.usage=(t.agents||[]).reduce((e,t)=>Au(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 Fu(t.uses??={skills:[],knowledge:[],systems:[]},n);if(o===`ui-action`){let t=go(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:`${td(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({...Zu(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=Su(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=ed($(e.id),uu($(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=Qu(e.next),n.error=$(e.error)||void 0,n.ended=$(e.t)||$(e.at),n.spent=Ou(e.spent),t.agents?.length||(t.usage=ku(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 sd(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 cd(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 ld(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 ud(e){if(e===0)return`included in your plan`;let t=Number(e.toFixed(2));return`${t} premium request${t===1?``:`s`}`}function dd(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 fd(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 pd={running:`active`,ok:`done`,fail:`failed`,info:`note`};function md(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(pd[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,...hd(l)]}function hd(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 gd(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 _d=`forgeqe-sidebar-panels`,vd={env:An,chat:Rt,usage:Ze,background:Ke,commands:fn,changes:Ft,outputs:Pe};function yd(e){return null}function bd(){let[e,t]=(0,H.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(_d)||`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).filter(([,e])=>typeof e==`boolean`)):{}}catch{return{}}}),n=(t,n)=>e[t]??n;return[n,(r,i)=>{let a={...e,[r]:!n(r,i)};t(a);try{localStorage.setItem(_d,JSON.stringify(a))}catch{}}]}function xd({children:e}){let[t,n]=bd(),r=H.Children.toArray(e).filter(e=>(0,H.isValidElement)(e)&&e.type===yd).map(e=>e.props),i=r.map(e=>t(e.id,e.initial??!0));return(0,U.jsx)(`div`,{className:`flex flex-col`,children:r.map((e,t)=>{let a=i[t],o=t===0||i[t-1],s=t===r.length-1||i[t+1];return(0,U.jsxs)(`section`,{"aria-labelledby":`panel-${e.id}`,className:g(p,`overflow-hidden transition-[margin,border-radius] duration-200 ease-out motion-reduce:transition-none`,a?g(`rounded-lg`,t>0&&`mt-2`,t<r.length-1&&`mb-2`):g(t>0&&!i[t-1]&&`mt-px`,o?`rounded-t-lg`:`rounded-t-sm`,s?`rounded-b-lg`:`rounded-b-sm`)),children:[(0,U.jsx)(`h3`,{id:`panel-${e.id}`,className:`m-0`,children:(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>n(e.id,e.initial??!0),className:g(l,`min-h-11 gap-2 rounded-none px-2 py-1 font-medium`),children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-6 flex-none items-center justify-center`,children:(0,U.jsx)(V,{icon:vd[e.id]??kn,size:16})}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.count!==void 0&&(0,U.jsx)(`span`,{className:`flex-none text-body-sm font-normal text-muted tabular-nums`,children:e.count}),(0,U.jsx)(Be,{size:14,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform duration-200`,!a&&`-rotate-90`)})]})}),(0,U.jsx)(sr,{open:a,className:`flex flex-col px-1 pb-2`,children:e.children})]},e.id)})})}function Sd({icon:e,label:t,value:n,detail:r,to:i,title:a,onClick:o,open:s,muted:c}){let u=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-6 flex-none items-center justify-center`,children:(0,U.jsx)(V,{icon:e,size:16,className:`text-muted`})}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,U.jsx)(`span`,{className:`text-label-md text-muted`,children:t}),(0,U.jsx)(`span`,{className:g(`truncate text-body-sm font-medium`,c?`text-muted`:`text-ink`),children:n}),r&&(0,U.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:r})]}),(i||o)&&(0,U.jsx)(ct,{size:14,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform duration-200 motion-reduce:transition-none`,s&&`rotate-90`)})]}),d=[n,r,a].filter(Boolean).join(` · `),f=`group min-h-11 items-center gap-2 px-1 py-2`;return o?(0,U.jsx)(`button`,{type:`button`,"aria-expanded":s,"data-tip":d,onClick:o,className:g(l,f),children:u}):i?(0,U.jsx)(`a`,{href:i,"data-tip":d,className:g(l,f),children:u}):(0,U.jsx)(`div`,{"data-tip":d,className:g(`flex w-full text-left`,f),children:u})}var Cd=e=>`Tokens used, added up over every model call: ${Il(e)}. Each call reads the conversation so far again, so this grows past the context window.`,wd=`How much of the model's context window the conversation fills now. It drops when the conversation is compacted.`;function Td({title:e,n:t,to:n}){let r=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`flex-1`,children:e}),t!==void 0&&(0,U.jsx)(`span`,{className:`tabular-nums`,children:t})]}),i=`flex min-h-7 items-end gap-2 px-2 pb-1 text-label-md text-muted`;return n?(0,U.jsx)(`a`,{href:n,"data-tip":`Open ${e}`,className:g(i,`no-underline hover:text-ink`),children:r}):(0,U.jsx)(`span`,{className:i,children:r})}function Ed({icon:e,text:t,value:n,tip:r}){return(0,U.jsxs)(`li`,{"data-tip":r??t,className:`flex min-h-7 items-center gap-2 px-2`,children:[(0,U.jsx)(`span`,{className:`flex size-4 flex-none items-center justify-center text-muted`,"aria-hidden":`true`,children:e}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm text-ink`,children:t}),n!==void 0&&(0,U.jsx)(`span`,{className:`flex-none text-body-sm text-ink tabular-nums`,children:n})]})}function Dd({a:e,working:t}){let n=I(e.agent),r=e.context&&e.context.limit>0?e.context:null,i=r?Math.min(1,r.tokens/r.limit):0,a=r?r.tokens>=(r.compactsAt??r.limit*.8):!1;return(0,U.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1`,children:[(0,U.jsxs)(`span`,{className:`flex min-h-6 items-center gap-2`,"data-tip":Cd(e.usage),children:[(0,U.jsx)(M,{agent:e.agent,px:16,decorative:!0,working:t}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm text-ink`,children:n.name}),(0,U.jsx)(`span`,{className:`flex-none text-body-sm text-ink tabular-nums`,children:K(e.usage.input+e.usage.output)})]}),r&&(0,U.jsxs)(`span`,{className:`flex items-center gap-2 pl-6`,"data-tip":`${wd} ${K(r.tokens)} of ${K(r.limit)}.`,"aria-label":`Context ${Math.round(i*100)}% full: ${K(r.tokens)} of ${K(r.limit)}`,children:[(0,U.jsx)(ye,{share:i,marks:[],fill:a?`bg-warn`:`bg-accent`,className:`h-1 flex-1`}),(0,U.jsxs)(`span`,{className:g(`w-10 flex-none text-right text-label-sm tabular-nums`,a?`text-warn`:`text-muted`),children:[Math.round(i*100),`%`]})]})]})}var Od=[{id:`skills`,label:`Skills`,to:r(`skills`),icon:e=>(0,U.jsx)(Md,{name:e})},{id:`knowledge`,label:`Knowledge`,to:r(`knowledge`,`notes`),icon:()=>(0,U.jsx)(V,{icon:Wn,size:14})},{id:`sections`,label:`Document sections`,to:r(`knowledge`,`notes`),icon:()=>(0,U.jsx)(V,{icon:dn,size:14})},{id:`systems`,label:`Systems`,icon:()=>(0,U.jsx)(V,{icon:An,size:14})}];function kd(e,t,n){let r=e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),i=e=>r.map(t=>Object.hasOwn(e,t)?e[t]:void 0).find(Boolean);return i(t)??i(n)}var Ad=()=>(0,U.jsx)(V,{icon:Ut,size:14}),jd=(0,H.lazy)(()=>ie(()=>import(`./logos-Cf-Wf5ex.js`).then(e=>e.c).then(e=>({default:({name:t})=>{let n=kd(t,e.FRAMEWORK_LOGOS,e.LANGUAGE_LOGOS);return n?(0,U.jsx)(n,{width:15,height:15,"aria-hidden":`true`}):(0,U.jsx)(Ad,{})}})),__vite__mapDeps([7,2,3,8,9,5])));function Md({name:e}){return(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(Ad,{}),children:(0,U.jsx)(jd,{name:e})})}function Nd({uses:e}){let t=Od.map(t=>({...t,names:e?.[t.id]||[]})).filter(e=>e.names.length);return(0,U.jsx)(U.Fragment,{children:t.map(t=>(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsx)(Td,{title:t.label,n:t.names.length,...t.to?{to:t.to}:{}}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:t.names.map(e=>(0,U.jsx)(Ed,{icon:t.icon(e),text:e},e))}),t.id===`sections`&&e?.text&&e.text.whole>e.text.sent&&(0,U.jsxs)(`span`,{"data-tip":`${e.text.sent.toLocaleString()} of ${e.text.whole.toLocaleString()} characters`,className:`px-2 pl-8 text-body-sm text-muted`,children:[Math.round((1-e.text.sent/e.text.whole)*100),`% less text than the whole documents`]})]},t.id))})}function Pd({value:e,max:t,warnAt:n,label:r}){return(0,U.jsx)(ke,{value:e,limit:t,warnAt:n&&t>0?Math.min(1,n/t):.8,label:r,className:`mt-1`})}var Fd=e=>{try{return e?new URL(e).host:``}catch{return``}},Id=e=>e.split(/[\\/]/).filter(Boolean).pop()||e;function Ld({path:e,icon:t,extra:n}){let[r,i]=(0,H.useState)(``);return(0,U.jsxs)(`li`,{className:`flex flex-col`,children:[(0,U.jsxs)(`button`,{type:`button`,"data-tip":`Open ${e}`,onClick:async()=>i(await we(e)),className:g(l,`min-h-8 gap-2 py-0`),children:[(0,U.jsx)(V,{icon:t,size:15,className:`flex-none text-muted`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-body-sm text-accent-fg`,children:Id(e)}),n]}),r&&(0,U.jsx)(`span`,{className:`px-4 text-body-sm text-fail`,children:r})]})}function Rd(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 zd({c:e}){let t=e.status===`running`?Bd(e.started):Rd(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,U.jsx)(`li`,{children:(0,U.jsxs)(`div`,{tabIndex:0,"data-tip":e.command,"aria-label":`${e.command}. ${n}${t?`, ${t}`:``}`,className:`flex items-start gap-2 px-4 py-2`,children:[e.status===`running`?(0,U.jsx)(Gt,{size:15,"aria-hidden":`true`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,U.jsx)(V,{icon:e.status===`ok`?it:Jn,size:15,className:g(`mt-1 flex-none`,e.status===`ok`?`text-pass`:e.status===`fail`?`text-fail`:`text-muted`)}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,U.jsx)(`span`,{className:`truncate font-mono text-body-sm text-ink`,children:rd(e.command)}),(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:[e.agent?I(e.agent).name:``,n,t].filter(Boolean).join(` · `)})]})]})})}function Bd(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 Vd({chat:e}){let[t,n]=(0,H.useState)(null),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)([]);(0,H.useEffect)(()=>{let e=!1,t=()=>le.list().then(t=>!e&&d(t.tasks),()=>{});t();let n=Ha(t,4e3);return()=>{e=!0,Ua(n)}},[]);let f=location.hash.replace(/^#\/?/,``),p=e?.commands??[],m=gd(p),_=u.filter(e=>e.to!==f);(0,H.useEffect)(()=>{let e=!1,t=()=>fe.state().then(t=>{if(!e){if(n(t),!t.ready)return a(null);ce.get().then(t=>!e&&a(t),()=>{})}},()=>{});return t(),window.addEventListener(`hashchange`,t),()=>{e=!0,window.removeEventListener(`hashchange`,t)}},[]),(0,H.useEffect)(()=>{if(!t?.ready)return;let n=!1,r=()=>R.tokenomics().then(e=>!n&&s(e),()=>{});r();let i=Ha(r,e?.busy?3e4:18e4);return()=>{n=!0,Ua(i)}},[t?.ready,t?.project,e?.busy]);let v=t?t.project.split(/[\\/]/).filter(Boolean).pop()||t.project:``,y=i?.codeRepo||i?.repo,b=y?.branch?y.branch:y?.commit?`Commit ${y.commit}`:void 0,x=!!y?.branch&&!i?.codeRepo&&y.name===v,S=o?.days.find(e=>e.day===new Date().toISOString().slice(0,10)),C=i?.environment,w=(e,t)=>({tokens:e.input+e.output,cost:t&&e.amount?q(e.amount,t):void 0}),T=o?.project?`Today counts every model call made for this project: chats, runs and the agents they started.`:`Today counts this project's test runs.`,E=o?.project?w(o.project.today,o.project.currency):S?w(S,o?.currency):void 0,D=o?o.project?{tokens:o.project.days30.input+o.project.days30.output,cost:o.project.currency&&o.project.days30.amount?q(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?q(o.totals.amount,o.currency):void 0,title:`Test runs of this project in the last 30 days.`}:void 0;return(0,U.jsxs)(xd,{children:[(0,U.jsx)(yd,{id:`env`,title:`Environment`,initial:!1,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,U.jsx)(Sd,{icon:He,label:`Project`,value:t?.ready?v:`Not set up`,muted:!t?.ready,to:r(`settings`,`setup`),title:t?.project}),i&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Sd,{icon:pt,label:i.codeRepo?`Tests go to`:x?`Branch`:`Repository`,value:y?x&&b?b:y.name:`Not a git repository`,muted:!y,detail:x?void 0:y?.branch?`Branch ${y.branch}`:b,title:y?`${y.root}${y.commit?` @ ${y.commit}`:``}`:void 0,to:r(`settings`,`tests`)}),(0,U.jsx)(Sd,{icon:An,label:`Test environment`,value:C?.active?C.active:C?.names.length?`None active`:`None yet`,muted:!C?.active,detail:C?.active&&Fd(C.startUrl)||void 0,title:C?.names.length?`${C.names.length} environment${C.names.length===1?``:`s`}: ${C.names.join(`, `)}${C.apps.length?`. Apps: ${C.apps.join(`, `)}`:``}`:void 0,to:r(`settings`,`environments`)}),(0,U.jsx)(Sd,{icon:pn,label:`Files`,value:`${i.files.filter(e=>e.exists).length} of ${i.files.length} set up`,onClick:()=>l(!c),open:c}),(0,U.jsx)(sr,{open:c,children:(0,U.jsx)(`ul`,{className:`m-0 mb-1 ml-8 flex list-none flex-col gap-1 p-0`,children:i.files.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`a`,{href:r(`settings`,`files`),"data-tip":e.path,className:g(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`min-h-0 flex-col items-start gap-0 px-1 py-1`,!e.exists&&`opacity-60`),children:[(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.label}),(0,U.jsx)(`span`,{className:`truncate font-mono text-body-sm text-ink`,children:e.path})]})},e.label))})})]})]})}),e&&(0,U.jsx)(yd,{id:`chat`,title:`This chat`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.agents?.length&&e.usage?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[(0,U.jsx)(Ed,{icon:(0,U.jsx)(V,{icon:Ze,size:14}),text:`Tokens used`,value:(0,U.jsx)(`span`,{className:`font-medium`,children:K(e.usage.input+e.usage.output)}),tip:Cd(e.usage)}),(0,U.jsxs)(`li`,{"data-tip":Il(e.usage),className:`truncate px-2 pl-8 text-body-sm text-muted tabular-nums`,children:[K(e.usage.input),` read · `,K(e.usage.output),` written`]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsx)(Td,{title:`Agents`,n:e.agents.length}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.agents.toSorted((e,t)=>t.at-e.at).map((t,n)=>(0,U.jsx)(Dd,{a:t,working:!!e.busy&&n===0},t.agent))})]})]}):(0,U.jsx)(`p`,{className:`m-0 px-2 py-1 text-body-sm 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,U.jsx)(Nd,{uses:e.uses})]})}),t?.ready&&(0,U.jsx)(yd,{id:`usage`,title:`This project`,children:(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsxs)(`a`,{href:r(`settings`,`tokenomics`),"data-tip":`${D?.title??``} ${T} Open Tokenomics for more.`.trim(),className:g(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`grid grid-cols-2 gap-0 overflow-hidden p-0`),children:[(0,U.jsx)(G,{compact:!0,label:`Last 30 days`,value:D?K(D.tokens):`–`,note:D?.cost?`tokens · ${D.cost}`:`tokens`,className:`border-b-0 px-2`}),(0,U.jsx)(G,{compact:!0,label:`Today`,value:o?K(E?.tokens??0):`–`,note:E?.cost?`tokens · ${E.cost}`:`tokens`,className:`border-b-0 px-2`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Open Tokenomics`})]}),o?.spent&&o.budget?.month?(0,U.jsxs)(`div`,{className:`px-2 py-2`,children:[(0,U.jsxs)(`span`,{className:`flex items-baseline gap-2 text-body-sm text-muted`,children:[(0,U.jsx)(`span`,{className:`flex-1`,children:`This month, this computer`}),(0,U.jsxs)(`span`,{className:`text-ink tabular-nums`,children:[q(o.spent.month,o.spent.currency),` of `,q(o.budget.month,o.budget.currency||o.spent.currency)]})]}),(0,U.jsx)(Pd,{value:o.spent.month,max:o.budget.month,label:`This month's spend`})]}):null]})}),_.length>0&&(0,U.jsx)(yd,{id:`background`,title:`Background tasks`,count:_.length,children:(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:_.map((e,t)=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`a`,{href:r(...e.to.split(`/`).filter(Boolean)),className:g(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`items-start gap-2`),children:[(0,U.jsx)(Gt,{size:15,"aria-hidden":`true`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-sm text-ink`,children:e.label}),(0,U.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[e.detail||`Running`,Bd(e.startedAt)&&` · ${Bd(e.startedAt)}`]})]})]})},`${e.kind}-${t}`))})}),p.length>0&&(0,U.jsxs)(yd,{id:`commands`,title:`Commands`,count:p.length,children:[(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:m.map(e=>(0,U.jsx)(zd,{c:e},e.key))}),p.length>m.length&&(0,U.jsxs)(`span`,{className:`px-4 pb-1 text-body-sm text-muted`,children:[h(p.length-m.length,`earlier command`),` in the chat`]})]}),e?.changes&&e.changes.length>0&&(0,U.jsxs)(yd,{id:`changes`,title:`Changes`,count:e.changes.length,children:[(0,U.jsxs)(`span`,{className:`px-4 pb-1 font-mono text-body-sm tabular-nums`,children:[h(e.changes.length,`file`),` · `,(0,U.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,U.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.changes.map(e=>(0,U.jsx)(Ld,{path:e.path,icon:Ft,extra:(0,U.jsxs)(`span`,{className:`flex-none font-mono text-body-sm tabular-nums`,children:[(0,U.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,U.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})},e.path))}),e.onCreatePr&&(0,U.jsx)(`div`,{className:`px-2 pt-2 pb-1`,children:(0,U.jsxs)(B,{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,U.jsx)(et,{"aria-hidden":`true`}),`Pull request`]})})]}),e?.outputs&&e.outputs.length>0&&(0,U.jsx)(yd,{id:`outputs`,title:`Outputs`,count:e.outputs.length,children:(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.outputs.map(e=>(0,U.jsx)(Ld,{path:e.path,icon:e.kind===`test`?pn:/\.html?$/i.test(e.path)?Xt:e.kind===`report`?Pe:Wn,extra:(0,U.jsx)(`span`,{className:`flex-none text-body-sm text-muted`,children:e.label})},e.path))})})]})}var Hd=24;function Ud(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])<=Hd));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])<=Hd):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 Wd(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 Gd(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 Kd(e){let t=Gd(await Wd(e));if(!t)return null;let{canvas:n,ctx:r}=t,i=Ud(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 qd=new Map;function Jd(e){return qd.has(e)||qd.set(e,Kd(e).then(t=>t?t.toDataURL(`image/png`):e).catch(()=>e)),qd.get(e)}var Yd=20971520,Xd=[1,.75,.5,.35],Zd=[[`image/png`,void 0],[`image/webp`,.92],[`image/webp`,.8]];async function Qd(e,t){for(let n of Xd)for(let[r,i]of Zd){let a=await e(n,r,i);if(a&&a.type===r&&a.size<=t)return a}return null}function $d(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 ef={"image/png":`.png`,"image/webp":`.webp`};async function tf(e,t){let n=t=>new File([t],e.name.replace(/\.[^.]+$/,``)+ef[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 ${Yd/1024/1024} MB: save a smaller copy and upload that.`);let r=await Wd(await $d(e)).catch(()=>null),i=r&&Gd(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=Ud(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 Qd((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 Kd(await $d(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 nf=`/assets/forgeqe-logo-D3CwM2Jl.png`,rf=`/assets/forgeqe-logo-white-CoE-hF2l.png`,af=`/assets/forgeqe-mark-ZLd4S3hw.png`;function of(e){let[t,n]=(0,H.useState)({});return(0,H.useEffect)(()=>{if(!e)return;let t=!0;return Jd(e).then(r=>t&&n({from:e,to:r})),()=>{t=!1}},[e]),e&&t.from===e?t.to:e}var sf=e=>`#${e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``)}`;function cf(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:sf([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:sf(o.map(e=>e/s))}:null}catch{return null}}var lf=`h-auto w-auto min-h-10 max-h-[112px] max-w-full object-contain`,uf=`h-11 w-auto max-w-[168px] object-contain object-left`;function df({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:lf,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?lf:uf,grow:s,auto:!1}:{cls:s?`size-12 object-contain`:`size-8 object-contain`,grow:!1,auto:!1}}function ff({theme:e,compact:t=!1,onPlate:n}){let{mode:r}=O(),i=r===`dark`?rf:nf,a=of(e.logo)||i,[o,s]=(0,H.useState)(e.logo?1:2.1),[c,l]=(0,H.useState)(null),u=o>1.6,d=df({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?v(c,w(e,r)):null,m=f&&!!v(c,w(e,r));(0,H.useEffect)(()=>n?.(!!p),[p,n]);let h=e.logo?e.logoFrame===`circle`&&u?`rounded`:e.logoFrame||(d.auto&&c?.kind===`background`?`rounded`:`plain`):`plain`,_=d.cls,y=(0,U.jsx)(`img`,{src:a,alt:``,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&s(t.naturalWidth/t.naturalHeight),l(cf(t))},className:g(`block min-w-0`,d.grow?`flex-initial`:`flex-none`,_,h===`rounded`&&`overflow-hidden rounded-sm`,m&&`shadow-[0_0_0_1px_rgb(0_0_0/0.12)]`)});return(0,U.jsxs)(`span`,{className:g(`flex min-w-0 items-center gap-2`,d.grow&&`flex-1`),children:[h===`tile`||p?(0,U.jsx)(`span`,{style:p?{background:p}:void 0,className:g(`flex items-center justify-center rounded-base 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:y}):y,!u&&e.name&&(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]})}function pf({theme:e}){let{mode:t}=O(),[n,r]=(0,H.useState)(1),[i,a]=(0,H.useState)(null),o=of(e.logoMark||e.logo),s=!!o&&(!!e.logoMark||n<=1.6),c=s?v(i,w(e,t)):null;return s?(0,U.jsx)(`span`,{style:c?{background:c}:void 0,className:g(`flex size-9 items-center justify-center rounded-base`,c&&`p-1`),children:(0,U.jsx)(`img`,{src:o,alt:``,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&r(t.naturalWidth/t.naturalHeight),a(cf(t))},className:g(`block size-full object-contain`,e.logoFrame===`circle`?`rounded-full`:`rounded-sm`)})}):(0,U.jsxs)(`span`,{"aria-hidden":`true`,className:`flex size-9 items-center justify-center`,children:[(0,U.jsx)(`img`,{src:af,alt:``,className:`block size-9 object-contain`}),o&&!e.logoMark&&(0,U.jsx)(`img`,{src:o,alt:``,className:`hidden`,onLoad:e=>e.currentTarget.naturalHeight&&r(e.currentTarget.naturalWidth/e.currentTarget.naturalHeight)})]})}var mf=`/assets/capgemini-mark-D6aZFnD3.png`,hf=`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`,gf=`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 _f({rail:e=!1}){let{mode:t}=O();return e?(0,U.jsx)(`img`,{src:mf,alt:`Capgemini`,"data-tip":`Capgemini`,"data-tip-side":`left`,className:`mb-1 size-8 flex-none object-contain`}):(0,U.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,U.jsx)(`path`,{fill:t===`dark`?`#fff`:`#12ABDB`,fillRule:`evenodd`,d:hf}),(0,U.jsx)(`path`,{fill:t===`dark`?`#fff`:`#0070AD`,fillRule:`evenodd`,d:gf})]})}function vf({title:e,children:t,defaultOpen:n}){let[r,i]=(0,H.useState)(!!n),a=(0,H.useId)();return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(!r),className:`self-start`,children:[(0,U.jsx)(Be,{size:15,"aria-hidden":`true`,className:g(`transition-transform`,r&&`rotate-180`)}),e]}),(0,U.jsx)(sr,{open:r,id:a,children:t})]})}function yf({review:e,className:t}){return(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-2 text-body-sm leading-relaxed`,t),children:[e.summary&&(0,U.jsx)(`p`,{className:`m-0 text-ink-2 [overflow-wrap:anywhere]`,children:e.summary}),e.issues.length>0&&(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.issues.map((e,t)=>(0,U.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,U.jsx)(`span`,{className:g(`mt-px flex-none rounded-full px-2 py-px text-body-sm font-medium`,e.kind===`correctness`?`bg-fail-soft text-fail`:`bg-surface-strong text-ink-2`),children:e.kind===`correctness`?`Correctness`:`Standards`}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.file&&(0,U.jsx)(`span`,{className:`font-mono text-body-sm text-muted [overflow-wrap:anywhere]`,children:e.file}),(0,U.jsx)(`span`,{className:`text-ink [overflow-wrap:anywhere]`,children:e.problem}),e.fix&&(0,U.jsxs)(`span`,{className:`text-muted [overflow-wrap:anywhere]`,children:[`Fix: `,e.fix]})]})]},t))})]})}var bf={done:`border-line-strong`,active:`border-accent/35`,pending:`border-line-strong`,failed:`border-fail/35`,skipped:`border-line-strong`,note:`border-line-strong`};function xf({status:e,orb:t,px:n=20,spin:r=!1}){let i={width:n,height:n};return e===`active`&&r?(0,U.jsx)(`span`,{role:`img`,"aria-label":`At work`,className:`flex flex-none items-center justify-center`,style:i,children:(0,U.jsx)(Gt,{size:n-2,strokeWidth:2.5,"aria-hidden":`true`,className:`animate-spin text-accent-fg motion-reduce:animate-none`})}):e===`active`?(0,U.jsx)(_e,{state:t,px:n,label:`At work`}):e===`done`?(0,U.jsx)(`span`,{role:`img`,"aria-label":`Done`,className:`flex flex-none items-center justify-center`,style:i,children:(0,U.jsx)(zn,{size:n*.8,strokeWidth:2.5,"aria-hidden":`true`,className:`text-icon`})}):e===`failed`?(0,U.jsx)(`span`,{role:`img`,"aria-label":`Failed`,className:`flex flex-none items-center justify-center`,style:i,children:(0,U.jsx)(Ge,{size:n*.8,strokeWidth:2.5,"aria-hidden":`true`,className:`text-fail`})}):e===`note`?(0,U.jsx)(`span`,{role:`img`,"aria-label":`Note`,className:`flex flex-none items-center justify-center`,style:i,children:(0,U.jsx)(`span`,{className:`size-1.5 rounded-full bg-line-strong`})}):(0,U.jsx)(`span`,{role:`img`,"aria-label":e===`skipped`?`Skipped`:`To come`,className:g(`box-border block flex-none rounded-full border-2 border-line-strong`,e===`skipped`&&`border-dashed`),style:i})}var Sf=(e,t)=>e.status===`running`?t?`active`:`done`:e.status===`ok`?`done`:e.status===`fail`?`failed`:`note`,Cf={read:Wn,search:mt,list:Pe,edit:Rn,run:zt,element:Jt,outline:Nn,references:Ue,impact:ze,find:qn,testfile:bt,web:_t,environment:An,cases:St,browser:_t,post:qt,test:bt,retry:Qe,review:rn,task:rt,work:Dt},wf={done:`text-icon`,failed:`text-fail`,active:`text-accent-fg animate-pulse motion-reduce:animate-none`,pending:`text-muted`,skipped:`text-muted`,note:`text-muted`},Tf={done:`Done`,failed:`Failed`,active:`At work`,pending:`To come`,skipped:`Skipped`,note:`Note`};function Ef({kind:e,status:t}){let n=g(`mt-px flex size-4 flex-none items-center justify-center`,wf[t]);if(e===`skill`)return(0,U.jsxs)(`span`,{role:`img`,"aria-label":Tf[t],className:g(n,`relative`),children:[(0,U.jsx)(f,{name:b.skills,px:15}),(t===`done`||t===`failed`)&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:g(`absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-1 ring-bg`,t===`done`?`bg-accent`:`bg-fail`)})]});let r=Cf[e];return(0,U.jsx)(`span`,{role:`img`,"aria-label":Tf[t],className:n,children:(0,U.jsx)(r,{size:15,strokeWidth:2,"aria-hidden":`true`})})}function Df({status:e}){return e===`active`?(0,U.jsx)(Gt,{size:12,strokeWidth:2.5,"aria-label":`At work`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,U.jsx)(`span`,{role:`img`,"aria-label":Tf[e],className:g(`mt-2 size-2 flex-none rounded-full`,e===`done`?`bg-accent`:e===`failed`?`bg-fail`:`bg-line-strong`)})}function Of({text:e,label:t}){let[n,r]=(0,H.useState)(!1);return(0,U.jsx)(B,{variant:`icon`,size:`icon-xs`,"aria-label":n?`Copied`:t,"data-tip":n?`Copied`:t,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{}},className:`flex-none opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,children:n?(0,U.jsx)(zn,{size:13,"aria-hidden":`true`,className:`text-icon`}):(0,U.jsx)(jt,{size:13,"aria-hidden":`true`})})}function kf({step:e,failed:t}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 py-1 font-mono text-body-sm leading-relaxed`,children:[e.command&&(0,U.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2 text-muted`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none select-none`,children:`$`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.command}),(0,U.jsx)(Of,{text:e.command,label:`Copy the command`})]}),e.output&&(0,U.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none text-muted select-none`,children:`⎿`}),(0,U.jsx)(`pre`,{className:g(`m-0 max-h-56 min-w-0 flex-1 overflow-auto font-mono text-body-sm leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,t?`text-fail`:`text-ink-2`),children:(0,U.jsx)(Ee,{text:e.output})}),(0,U.jsx)(Of,{text:e.output,label:`Copy the output`})]}),e.shell?.exit!==void 0&&e.shell.exit!==0&&(0,U.jsxs)(`span`,{className:`text-fail`,children:[`Exit code `,e.shell.exit]})]})}var Af=e=>/[/\\]|\.\w{1,5}$|^\$ /.test(e)&&!/\s{2,}/.test(e);function jf({text:e}){return(0,U.jsx)(`span`,{className:g(p,`min-w-0 max-w-full truncate rounded-sm px-2 py-1 text-body-sm text-ink-2`,Af(e)&&`font-mono text-body-sm`),children:e})}function Mf(e){return{count:e.length,failed:e.filter(e=>e.ok===!1).length,latest:e[e.length-1]}}function Nf({line:e}){return(0,U.jsxs)(`li`,{className:g(`flex gap-2 [overflow-wrap:anywhere]`,e.ok===!1?`text-fail`:`text-ink-2`),children:[e.ok!==void 0&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:e.ok?`text-icon`:void 0,children:e.ok?`✓`:`✗`}),(0,U.jsx)(xe,{text:e.text,className:`min-w-0 text-body-sm leading-relaxed text-inherit [&_p]:my-0`,fill:!0})]})}function Pf({step:e}){let[t,n]=(0,H.useState)(!1),r=e.lines.length>3&&!t,{count:i,failed:a,latest:o}=Mf(e.lines);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.lines.length>3&&(0,U.jsxs)(B,{variant:`link`,size:`inline`,"aria-expanded":t,onClick:()=>n(!t),className:`w-fit gap-1`,children:[(0,U.jsxs)(`span`,{children:[t?`Hide`:`Show`,` `,i,` lines`,a>0&&(0,U.jsxs)(`span`,{className:`text-fail`,children:[` · `,a,` failed`]})]}),(0,U.jsx)(Be,{size:13,"aria-hidden":`true`,className:g(`transition-transform`,t&&`rotate-180`)})]}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm leading-relaxed`,children:r?o&&(0,U.jsx)(Nf,{line:o}):e.lines.map((e,t)=>(0,U.jsx)(Nf,{line:e},t))})]})}function Ff({agent:e,named:t=!0,working:n=!1,state:r,orb:i}){let a=I(e),o=D(e);return(0,U.jsxs)(`span`,{className:`inline-flex flex-none items-center gap-2`,"data-tip":a.name,children:[(0,U.jsx)(M,{agent:e,px:24,decorative:t,working:n,state:r,activity:n?A(i):void 0}),t&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`font-medium`,style:{color:o},children:a.name}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`})]})]})}var If=e=>e===`active`?`thinking`:e===`failed`?`failed`:e===`done`?`done`:`idle`;function Lf({step:e,from:t,to:n,live:r}){let i=I(n),a=D(n),o=r?`thinking`:e.status===`fail`?`failed`:e.status===`ok`?`done`:`idle`,s=[...e.children??[]].reverse().find(e=>e.status===`running`)?.orb??(e.orb===`handing`?void 0:e.orb);return(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,U.jsx)(M,{agent:t,px:24,activity:r?`handing`:void 0}),(0,U.jsxs)(`span`,{role:`img`,"aria-label":`hands off to`,className:g(`handoff-flow flex-none`,r&&`is-live`),style:{color:a},children:[(0,U.jsx)(`span`,{}),(0,U.jsx)(`span`,{}),(0,U.jsx)(`span`,{})]}),(0,U.jsx)(M,{agent:n,px:28,decorative:!0,state:o,activity:r?A(s):void 0,className:`handoff-in`}),(0,U.jsx)(`span`,{className:`font-medium`,style:{color:a},children:i.name}),!e.handoff&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`}),(0,U.jsx)(`span`,{className:g(`[overflow-wrap:anywhere]`,r?`text-ink`:`text-ink-2`),children:e.label})]}),e.arg&&(0,U.jsx)(jf,{text:e.arg})]})}function Rf({step:e,working:t,from:n=N}){let r=e.agent||n,i=zf(e),a=Sf(e,t),[o,s]=(0,H.useState)(null),c=o??((!!e.handoff||!!e.agent||!!e.shell||e.key.startsWith(`try:`))&&a===`active`),u=(0,U.jsxs)(U.Fragment,{children:[e.handoff||r!==n?(0,U.jsx)(xf,{status:a,orb:e.orb,px:14,spin:!0}):!e.icon&&(0,U.jsx)(Df,{status:a}),e.handoff||r!==n?(0,U.jsx)(Lf,{step:e,from:n,to:e.handoff?.agent??r,live:a===`active`}):(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[e.icon?(0,U.jsx)(Ef,{kind:e.icon,status:a}):(0,U.jsx)(Ff,{agent:r,named:!1,working:a===`active`,state:If(a),orb:e.orb}),(0,U.jsx)(`span`,{className:g(`[overflow-wrap:anywhere]`,a===`active`?`text-ink`:`text-ink-2`),children:e.label}),e.arg&&(0,U.jsx)(jf,{text:e.arg}),e.change&&(0,U.jsxs)(`span`,{className:`font-mono text-body-sm tabular-nums`,children:[(0,U.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.change.added]}),` `,(0,U.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.change.removed]})]})]}),i&&(0,U.jsx)(Be,{size:14,"aria-hidden":`true`,className:g(`mt-1 ml-auto flex-none text-muted transition-transform`,c&&`rotate-180`)})]});return(0,U.jsxs)(`li`,{className:`flex flex-col`,children:[i?(0,U.jsx)(`button`,{type:`button`,"aria-expanded":c,onClick:()=>s(!c),className:g(l,`min-h-8 items-start gap-2 px-2 py-2`),children:u}):(0,U.jsx)(`div`,{className:`flex min-h-8 items-start gap-2 px-2 py-2 text-body-sm`,children:u}),i&&(0,U.jsx)(sr,{open:c,children:(0,U.jsx)(Bf,{step:e,working:t,from:n,className:`mb-1 ml-4`})})]})}var zf=e=>e.lines.length>0||(e.children?.length??0)>0||!!e.handoff?.result||!!e.change||!!e.output||!!e.command||!!e.review;function Bf({step:e,working:t,from:n,className:r}){let i=e.children||[],a=e.handoff?.agent||e.agent;return(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-2 border-l border-dotted py-1 pl-4`,r),style:{borderColor:a?`${I(a).hue}59`:`var(--color-line-strong)`},children:[(e.output||e.command)&&(0,U.jsx)(kf,{step:e,failed:e.status===`fail`}),e.review&&(0,U.jsx)(yf,{review:e.review}),e.lines.length>0&&(0,U.jsx)(Pf,{step:e}),e.change&&(0,U.jsx)(Oe,{diff:e.change.diff}),i.length>0&&(0,U.jsx)(`ul`,{"aria-label":a?`What ${re(I(a).name)} did`:`Steps`,className:`m-0 flex list-none flex-col p-0`,children:i.map(e=>(0,U.jsx)(Rf,{step:e,working:t,from:a||n},e.key))}),e.handoff?.result&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 text-body-sm`,children:[(0,U.jsxs)(`span`,{className:`text-muted`,children:[re(I(e.handoff.agent).name,!0),` answered`]}),(0,U.jsx)(xe,{text:e.handoff.result.length>1200?`${e.handoff.result.slice(0,1199)}…`:e.handoff.result,className:`text-body-sm text-ink-2 [&_p]:my-0`,fill:!0})]})]})}function Vf({node:e,last:t,working:n,now:r,orbed:i}){let a=e.step?[]:e.steps,o=e.step,s=a.length>0||!!r||!!o&&zf(o),[c,u]=(0,H.useState)(null),d=c??(e.status===`active`||e.status===`failed`),f=o?.orb??a.findLast(e=>e.status===`running`)?.orb??r?.orb??`thinking`;return(0,U.jsxs)(`li`,{className:`flex gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-none flex-col items-center`,children:[(0,U.jsx)(`span`,{className:`mt-1`,children:(0,U.jsx)(xf,{status:e.status,orb:f,px:16,spin:!i})}),!t&&(0,U.jsx)(`span`,{"aria-hidden":`true`,className:g(`mt-2 min-h-4 w-0 flex-1 border-l border-dotted`,bf[e.status])})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pb-2`,children:[s?(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>u(!d),className:g(l,`min-h-7 items-start gap-2 p-0`),children:[(0,U.jsx)(Hf,{node:e,orb:f}),(0,U.jsx)(Be,{size:14,"aria-hidden":`true`,className:g(`mt-1 flex-none text-muted transition-transform`,d&&`rotate-180`)}),e.status===`active`&&(0,U.jsx)(Te,{tone:`running`,icon:!1,className:`mt-1 ml-1 flex-none`,children:`In progress`})]}):(0,U.jsx)(`div`,{className:`min-h-7`,children:(0,U.jsx)(Hf,{node:e,orb:f})}),s&&(0,U.jsx)(sr,{open:d,className:`mt-1`,children:o?(0,U.jsx)(Bf,{step:o,working:n,from:`forgeqe`,className:`mt-1`}):(0,U.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[a.map(e=>(0,U.jsx)(Rf,{step:e,working:n},e.key)),r&&(0,U.jsx)(`li`,{children:(0,U.jsx)(Gf,{live:r,className:`px-2`})})]})})]})]})}function Hf({node:e,orb:t}){let n=e.status===`active`?`text-ink`:e.status===`pending`||e.status===`skipped`?`text-muted`:e.status===`failed`?`text-fail`:`text-ink-2`,r=e.step;return r?.handoff||r?.agent&&r.agent!==`forgeqe`?(0,U.jsx)(Lf,{step:r,from:N,to:r.handoff?.agent??r.agent,live:e.status===`active`}):(0,U.jsxs)(`span`,{className:g(`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-body-sm font-medium`,n,e.status===`skipped`&&`line-through`),children:[r&&(0,U.jsx)(Ff,{agent:r.agent||`forgeqe`,named:!!r.agent&&r.agent!==`forgeqe`,working:e.status===`active`,state:If(e.status),orb:t}),e.status===`active`?(0,U.jsx)(`span`,{className:`shimmer [overflow-wrap:anywhere]`,children:(0,U.jsx)(`span`,{children:e.label})}):(0,U.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.label}),r?.arg&&(0,U.jsx)(jf,{text:r.arg})]})}var Uf={info:`text-ink-2`,ok:`text-ink-2`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink-2`,you:`text-accent-fg`,think:`text-muted italic`};function Wf(e){let[t,n]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{let e=Ha(()=>n(Date.now()),1e3);return()=>Ua(e)},[]);let r=e?Date.parse(e):NaN;if(Number.isNaN(r))return``;let i=Math.max(0,Math.round((t-r)/1e3));return i<2?`just now`:i<60?zc(i,`second`):zc(Math.floor(i/60),`minute`)}function Gf({live:e,orb:t=!1,className:n}){let r=Wf(e.latest?.at);return(0,U.jsxs)(`div`,{className:g(`flex min-h-8 items-start gap-2 py-1`,n),children:[(0,U.jsx)(`span`,{className:`mt-1 flex size-4 flex-none items-center justify-center`,children:t?(0,U.jsx)(_e,{state:e.orb,px:20,label:`At work`}):(0,U.jsxs)(`span`,{"aria-hidden":`true`,className:`relative flex size-2`,children:[(0,U.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-accent opacity-60 motion-reduce:animate-none`}),(0,U.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-accent`})]})}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`shimmer text-body-sm font-medium text-muted`,children:(0,U.jsx)(`span`,{"aria-live":`polite`,children:e.text})}),e.latest&&(0,U.jsxs)(`button`,{type:`button`,onClick:e.onLog,"data-tip":`Open the activity log`,className:g(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`min-h-0 min-w-0 items-baseline gap-2 p-0`),children:[(0,U.jsx)(`span`,{className:g(`min-w-0 truncate font-mono text-body-sm`,Uf[e.latest.tone]),children:e.latest.plain}),(0,U.jsxs)(`span`,{className:`flex-none text-body-sm whitespace-nowrap text-muted tabular-nums`,children:[r,r&&` · `,e.events,` `,e.events===1?`event`:`events`]})]})]})]})}function Kf({turn:e,working:t,live:n,folded:r=!1}){if(r)return(0,U.jsx)(Gf,{live:n,orb:!0});let i=md(e,t),a=e.plan.length>0&&t?i.find(e=>e.status===`active`)??null:null,o=t&&!a?[{key:`now`,label:n.text,status:`active`,steps:[]}]:[],s=[...i,...o],c=i.findLast(e=>e.status===`active`);return(0,U.jsx)(`ol`,{"aria-label":`What ForgeQE did`,className:`m-0 flex list-none flex-col p-0 pt-1`,children:s.map((e,r)=>e.key===`now`?(0,U.jsx)(`li`,{className:`flex gap-4`,children:(0,U.jsx)(Gf,{live:n,orb:!c,className:`-mt-1 min-w-0 flex-1 py-0`})},`now`):(0,U.jsx)(Vf,{node:e,last:r===s.length-1,working:t,now:a===e?n:void 0,orbed:c===e},e.key))})}var qf={passed:`Passed`,failed:`Failed`,stopped:`Stopped`,blocked:`Blocked`};function Jf({label:e,children:t}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{className:`text-body-sm text-muted sm:pt-1`,children:e}),(0,U.jsx)(`dd`,{className:`m-0 min-w-0 text-body-sm [overflow-wrap:anywhere]`,children:t})]})}function Yf({text:e}){return(0,U.jsxs)(`span`,{role:`figure`,"aria-label":`Command`,className:`flex min-w-0 items-start gap-2`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none font-mono text-label-md leading-6 font-normal text-muted select-none`,children:`$`}),(0,U.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-label-md leading-6 font-normal whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:e}),(0,U.jsx)(De,{text:e,label:`Copy the command`})]})}function Xf(e){if(e.runs===void 0)return e.attempts===void 0?``:h(e.attempts,`attempt`);let t=`${h(e.runs,`test run`)}${e.failedRuns?` (${e.failedRuns} failed)`:``}`;return e.reviews?`${t} · ${h(e.reviews,`review`)}`:t}function Zf({name:e}){let t=e.lastIndexOf(`.`),n=t>0?e.slice(t+1):e,r=t>0?e.slice(0,t):``;return(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col`,"data-tip":e,children:[(0,U.jsx)(`span`,{className:`font-mono text-label-md font-normal text-ink [overflow-wrap:anywhere]`,children:n}),r&&(0,U.jsx)(`span`,{className:`font-mono text-label-md font-normal text-muted [overflow-wrap:anywhere]`,children:r})]})}function Qf({t:e}){let t=Xf(e);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 border-l-2 border-line-strong pl-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,U.jsx)(bt,{size:16,strokeWidth:2,"aria-hidden":`true`,className:e.ok?`text-pass`:e.status===`stopped`?`text-muted`:`text-fail`}),(0,U.jsx)(`span`,{className:`text-body-md font-medium`,children:e.ok?`Test written`:`Test not finished`}),(0,U.jsx)(Te,{tone:e.ok?`pass`:e.status===`stopped`?`neutral`:`fail`,children:qf[e.status]||e.status||`Not written`}),t&&(0,U.jsx)(`span`,{className:`ml-auto text-body-sm text-muted tabular-nums`,children:t})]}),(0,U.jsxs)(`dl`,{className:`m-0 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-[88px_minmax(0,1fr)] sm:gap-y-2`,children:[(e.testFile||e.testName)&&(0,U.jsx)(Jf,{label:`Test`,children:(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.testFile&&(0,U.jsx)(Ce,{path:e.testFile}),e.testName&&(0,U.jsx)(Zf,{name:e.testName})]})}),e.command&&(0,U.jsx)(Jf,{label:`Run it`,children:(0,U.jsx)(Yf,{text:e.command})}),e.review&&(0,U.jsx)(Jf,{label:e.review.approved?`Review`:`Review asked`,children:(0,U.jsx)(yf,{review:e.review})}),e.runDir&&(0,U.jsx)(Jf,{label:`From the run`,children:(0,U.jsx)(Ce,{path:e.runDir})}),e.reused.length>0&&(0,U.jsx)(Jf,{label:`Reused`,children:(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.reused.map(e=>(0,U.jsx)(`li`,{className:`min-w-0`,children:(0,U.jsx)(Ce,{path:e})},e))})})]}),e.error&&(0,U.jsx)(`p`,{className:`m-0 text-body-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]})}function $f({c:e}){let[t,n]=(0,H.useState)(!1);return(0,U.jsxs)(`li`,{className:`flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-9 items-center gap-2`,children:[(0,U.jsx)(B,{variant:`icon`,size:`icon-xs`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} the changes to ${e.path}`,"data-tip":`${t?`Hide`:`Show`} the changes to ${e.path}`,onClick:()=>n(!t),className:`flex-none`,children:(0,U.jsx)(Be,{size:15,"aria-hidden":`true`,className:g(`transition-transform`,!t&&`-rotate-90`)})}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,U.jsx)(Ce,{path:e.path})}),(0,U.jsxs)(`span`,{className:`flex-none font-mono text-body-sm tabular-nums`,children:[(0,U.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,U.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,U.jsx)(sr,{open:t,children:(0,U.jsx)(Oe,{diff:e.diff,className:`mb-2 ml-10`})})]})}function ep({turn:e}){let t=e.reports.filter((e,t,n)=>n.findIndex(t=>t.path===e.path)===t),n=new Set(e.changes.map(e=>e.path)),r=[...new Set(e.tests.flatMap(e=>e.changed))].filter(e=>!n.has(e)&&![...n].some(t=>t.endsWith(e)||e.endsWith(t)));return!e.tests.length&&!t.length&&!e.changes.length&&!r.length?null:(0,U.jsxs)(`section`,{"aria-label":`Result`,className:`flex flex-col gap-4 pt-4`,children:[e.tests.map((e,t)=>(0,U.jsx)(Qf,{t:e},t)),t.length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Reports`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,U.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,U.jsx)(Ce,{path:e.path})]},e.path))})]}),(e.changes.length>0||r.length>0)&&(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-1`,(e.tests.length>0||t.length>0)&&`pt-4`),children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 text-body-sm font-medium`,children:[(0,U.jsx)(Ft,{size:15,"aria-hidden":`true`,className:`text-muted`}),`Files changed`,(0,U.jsxs)(`span`,{className:`font-normal text-muted`,children:[h(e.changes.length+r.length,`file`),e.changes.length>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,U.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]})]})]}),(0,U.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[e.changes.map(e=>(0,U.jsx)($f,{c:e},e.path)),r.map(e=>(0,U.jsx)(`li`,{className:`flex min-h-9 items-center gap-2 pl-10`,children:(0,U.jsx)(Ce,{path:e})},e))]})]})]})}var tp=/^\s*(?:[-*>]\s*)?(?:\*\*|__)?\s*(?:sources?|evidence|references?|refs?)\s*(?:\*\*|__)?\s*:/i;function np(e){let t=[],n=[],r=!1;for(let i of e.split(`
132
+ `))/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&tp.test(i)?n.push(i.trim()):t.push(i);return{body:t.join(`
133
+ `).replace(/\n{3,}/g,`
134
+
135
+ `).trimEnd(),sources:n.join(`
136
+
137
+ `)}}var rp=1.5;function ip(e,t){if(e>=t)return t;let n=t-e;return Math.min(t,e+Math.max(rp,n/45))}function ap(e,t){return Math.min(Math.floor(t),e.length)}var op=()=>typeof window<`u`&&!!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;function sp(e,t){let n=(0,H.useRef)(t);t&&(n.current=!0);let r=n.current&&!op(),[i,a]=(0,H.useState)(()=>r?0:e.length),o=(0,H.useRef)(i),s=(0,H.useRef)(e);s.current!==e&&(o.current=ap(e,o.current),s.current=e),r||(o.current=e.length),(0,H.useEffect)(()=>{if(!r||o.current>=e.length){a(o.current);return}let t=0,n=()=>{o.current=ip(o.current,e.length),a(o.current),o.current<e.length&&(t=requestAnimationFrame(n))};return t=requestAnimationFrame(n),()=>cancelAnimationFrame(t)},[e,r]);let c=Math.min(Math.floor(r?i:e.length),e.length);return{shown:e.slice(0,c),typing:c<e.length}}var cp={info:`text-ink-2`,ok:`text-ink-2`,fail:`text-fail`,warn:`text-warn`,dim:`text-muted`,say:`text-ink`,you:`text-accent-fg`,think:`text-muted italic`};function lp({at:e}){let t=Tu(e),[n,r]=t?[t.slice(0,t.lastIndexOf(` `)),t.slice(t.lastIndexOf(` `)+1)]:[``,``];return(0,U.jsxs)(`time`,{dateTime:e,className:`w-28 flex-none text-body-sm whitespace-nowrap tabular-nums`,children:[(0,U.jsx)(`span`,{className:`text-muted/70`,children:n}),` `,(0,U.jsx)(`span`,{className:`text-muted`,children:r})]})}function up({line:e}){let[t,n]=(0,H.useState)(!1),r=e.plain.length>160;return e.kind===`head`?(0,U.jsxs)(`li`,{className:`mt-4 flex items-baseline gap-4 border-b border-line-soft pb-1 first:mt-0`,children:[(0,U.jsx)(lp,{at:e.at}),(0,U.jsx)(xe,{text:e.md,className:g(`min-w-0 text-body-sm font-medium text-ink [&_p]:my-0`),fill:!0})]}):(0,U.jsxs)(`li`,{className:g(`flex items-baseline gap-4 py-1`,e.kind===`sub`&&`pl-4`),children:[(0,U.jsx)(lp,{at:e.at}),e.kind===`out`?(0,U.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 font-mono text-body-sm leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,children:(0,U.jsx)(Ee,{text:e.plain})}):(0,U.jsx)(`button`,{type:`button`,disabled:!r,"aria-expanded":r?t:void 0,onClick:()=>n(!t),"data-tip":r&&!t?`Show all of it`:void 0,className:g(`min-w-0 flex-1 border-0 bg-transparent p-0 text-left`,r&&`cursor-pointer`),children:(0,U.jsx)(xe,{text:e.md,className:g(`text-body-sm leading-relaxed [overflow-wrap:anywhere] [&_code]:text-body-sm [&_p]:my-0`,cp[e.tone],r&&!t&&`line-clamp-2`),fill:!0})})]})}function dp({lines:e,live:t,name:n,timeline:r=!1}){let i=(0,H.useRef)(null),a=(0,H.useRef)(!0),[o,s]=(0,H.useState)(!1),c=(0,H.useMemo)(()=>Eu(e),[e]);return(0,H.useEffect)(()=>{a.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[c]),(0,U.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-9 items-center gap-1 border-b border-line-soft text-body-sm text-muted`,children:[(0,U.jsxs)(`span`,{className:`flex-1`,children:[e.length,` event`,e.length===1?``:`s`,t&&` · live`]}),(0,U.jsx)(B,{variant:`icon`,size:`icon-sm`,"aria-label":o?`Copied`:`Copy the activity log as Markdown`,"data-tip":o?`Copied`:`Copy the activity log as Markdown`,onClick:async()=>{try{await navigator.clipboard.writeText(c),s(!0),setTimeout(()=>s(!1),1500)}catch{}},children:o?(0,U.jsx)(zn,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,U.jsx)(jt,{size:14,"aria-hidden":`true`})}),(0,U.jsx)(B,{variant:`icon`,size:`icon-sm`,"aria-label":`Download the activity log as a Markdown file`,"data-tip":`Download the activity log as a Markdown file`,onClick:()=>{let e=URL.createObjectURL(new Blob([c],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=n,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},children:(0,U.jsx)(V,{icon:an,size:14})})]}),(0,U.jsx)(`div`,{ref:i,role:`log`,"aria-label":`Activity log`,onScroll:e=>{let t=e.currentTarget;a.current=t.scrollTop+t.clientHeight>=t.scrollHeight-24},className:g(`overflow-y-auto py-2`,r?`max-h-[calc(var(--screen)-260px)] min-h-[320px]`:`max-h-[360px] border-b border-line-soft`),children:(0,U.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.map((e,t)=>(0,U.jsx)(up,{line:e},t))})})]})}function fp({ask:e,live:t,onAnswer:n}){let r=t&&e.answer===void 0;return(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-4`,r?ge.info:`py-1`),children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,U.jsx)(Nt,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none text-icon`}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e.title}),e.detail&&(0,U.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:e.detail}),e.lines.map((e,t)=>(0,U.jsx)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]})]}),r?(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.options.map(e=>(0,U.jsx)(B,{size:`sm`,onClick:()=>n(e.id),children:e.label},e.id)),!e.options.some(e=>e.id===`cancel`||e.label.trim().toLowerCase()===`cancel`)&&(0,U.jsxs)(B,{size:`sm`,variant:`outline`,onClick:()=>n(null),children:[(0,U.jsx)(Ge,{"aria-hidden":`true`}),`Cancel`]})]}):(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.answer===void 0?`Not answered`:`You chose: ${e.answer}`})]})}function pp({wait:e,live:t,onProceed:n}){let r=t&&e.answer===void 0;return(0,U.jsxs)(`div`,{className:g(`flex flex-col gap-4`,r?ge.info:`py-1`),children:[(0,U.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,U.jsx)(tt,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none text-icon`}),(0,U.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.prompt})]}),r?(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsxs)(B,{size:`sm`,variant:`primary`,"data-tip":`Done, continue`,onClick:()=>n(!0),children:[(0,U.jsx)(vn,{"aria-hidden":`true`}),`Continue`]}),(0,U.jsxs)(B,{size:`sm`,onClick:()=>n(!1),children:[(0,U.jsx)(Ge,{"aria-hidden":`true`}),`Cancel`]})]}):(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.answer===void 0?`Not done`:e.answer?`You continued`:`You cancelled`})]})}function mp(e,t){let[n,r]=(0,H.useState)(!1),i=(0,H.useRef)(t);return(0,H.useEffect)(()=>{let n=t>i.current;if(i.current=t,!e||!n)return void(e||r(!1));r(!0);let a=setTimeout(()=>r(!1),900);return()=>clearTimeout(a)},[e,t]),n}function hp({started:e}){let[t,n]=(0,H.useState)(()=>Date.now());(0,H.useEffect)(()=>{let e=Ha(()=>n(Date.now()),1e3);return()=>Ua(e)},[]);let r=fd(e,t),i=new Date(t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),a=e&&!Number.isNaN(Date.parse(e))?new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):``;return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-sm whitespace-nowrap text-muted tabular-nums`,"data-tip":a?`Started at ${a}`:void 0,children:[r&&(0,U.jsxs)(`span`,{"aria-label":`Elapsed ${r}`,children:[r,` elapsed`]}),r&&(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,U.jsx)(`time`,{dateTime:new Date(t).toISOString(),"aria-label":`Time now ${i}`,children:i})]})}function gp({turn:e,live:t,onAnswer:n,onProceed:r}){let i=t&&!e.outcome,[a,o]=(0,H.useState)(null),s=a??i,c=sd(e),l=i?c.text:cd(e),u=e.parts.map(e=>gu(e.text)).filter(Boolean),d=sp(e.outcome&&e.reply?e.reply:u.join(`
138
+
139
+ `),i),f=(0,H.useMemo)(()=>np(d.shown),[d.shown]),p=mp(i,u.reduce((e,t)=>e+t.length,0)),m=d.typing||p,[h,_]=(0,H.useState)(!1),v=e.log.findLast(e=>e.tone!==`you`&&e.tone!==`say`);return(0,U.jsxs)(`div`,{className:`flex gap-4`,children:[(0,U.jsx)(`div`,{className:`size-9 flex-none`,"aria-hidden":`true`,children:(0,U.jsx)(M,{agent:`forgeqe`,px:34,working:i,state:m?`speaking`:i?`thinking`:e.outcome===`done`?`done`:e.outcome===`failed`?`failed`:`idle`,activity:i&&!m?A(sd(e).orb):void 0,className:`mt-1`})}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-4 pt-2`,children:[(e.steps.length>0||i||e.log.length>0)&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":s,disabled:!e.steps.length&&!e.plan.length,onClick:()=>o(!s),className:g(`flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 text-body-sm font-medium text-muted hover:text-ink disabled:cursor-default`,i&&`shimmer`),children:[(0,U.jsx)(`span`,{"aria-live":`polite`,children:l}),(e.steps.length>0||e.plan.length>0)&&(0,U.jsx)(Be,{size:16,"aria-hidden":`true`,className:g(`transition-transform`,s&&`rotate-180`)})]}),i&&(0,U.jsx)(hp,{started:e.started||e.log[0]?.at}),e.log.length>0&&(0,U.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-expanded":h,onClick:()=>_(!h),className:`ml-auto`,children:[(0,U.jsx)(V,{icon:Mt,size:14}),`Activity log`,(0,U.jsx)(`span`,{className:`tabular-nums`,children:e.log.length})]})]}),(0,U.jsx)(sr,{open:(s||i)&&(e.steps.length>0||e.plan.length>0||i),children:(0,U.jsx)(Kf,{turn:e,working:i,folded:!s,live:{...c,latest:v,events:e.log.length,onLog:()=>_(!0)}})}),(0,U.jsx)(sr,{open:h,children:(0,U.jsx)(dp,{lines:e.log,live:i,name:`forgeqe-activity-${e.id}.md`})})]}),e.asks.map(e=>(0,U.jsx)(fp,{ask:e,live:i,onAnswer:t=>n(e.id,t)},e.id)),e.waits.map(e=>(0,U.jsx)(pp,{wait:e,live:i,onProceed:t=>r(e.id,t)},e.id)),f.body&&(0,U.jsx)(xe,{text:f.body,className:g(`text-body-md leading-[1.7] [&_li]:my-2 [&_p]:my-4`,(d.typing||i)&&`typing-caret`),fill:!0}),f.sources&&!d.typing&&!i&&(0,U.jsx)(vf,{title:`Sources`,children:(0,U.jsx)(xe,{text:f.sources,className:`text-muted`,fill:!0})}),(0,U.jsx)(ep,{turn:e}),e.error&&(0,U.jsx)(`p`,{role:`alert`,className:g(ge.fail,`m-0`),children:e.error}),e.outcome===`stopped`&&!e.reply&&(0,U.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Stopped.`}),e.outcome&&e.spent&&(0,U.jsx)(_p,{spent:e.spent})]})]})}function _p({spent:e}){let t=e.input+e.output>0,n=[t?`${ld(e.input)} in → ${ld(e.output)} out`:``,e.ms===void 0?``:dd(e.ms),e.premium===void 0?``:ud(e.premium)].filter(Boolean);if(!n.length)return null;let r=[t?`${e.input.toLocaleString()} tokens read${e.cached?`, ${e.cached.toLocaleString()} of them from the cache`:``}; ${e.output.toLocaleString()} written.`:``,e.premium===void 0?e.copilot?`GitHub Copilot bills premium requests; how many is not known, as the seat's model list did not name this model.`:``:`GitHub Copilot bills premium requests: one a model call, times the model's multiplier on your seat.`].filter(Boolean).join(` `);return(0,U.jsx)(`p`,{className:`m-0 text-body-sm text-muted tabular-nums`,"data-tip":r||void 0,children:n.join(` · `)})}var vp=1e3,yp=15e3,bp=`Reconnecting to ForgeQE web… The chat carries on there; this page catches up when it answers.`;function xp(e,t,n){let r=Math.max(1,Math.floor(e)||1),i=Math.min(yp,vp*2**Math.min(r-1,4));return t===401?{waitMs:i,say:n,giveUp:!0}:t===404?{waitMs:vp*2,say:r>=3?n:null,giveUp:r>=3}:t===0||t>=500?{waitMs:i,say:r>=3?bp:null,giveUp:!1}:{waitMs:i,say:n,giveUp:!1}}function Sp(e,t=typeof window>`u`?null:window){return new Promise(n=>{let r=()=>{clearTimeout(a),t?.removeEventListener(`online`,r),t?.removeEventListener(`focus`,r),typeof document<`u`&&document.removeEventListener(`visibilitychange`,i),n()},i=()=>{(typeof document>`u`||document.visibilityState===`visible`)&&r()},a=setTimeout(r,e);t?.addEventListener(`online`,r),t?.addEventListener(`focus`,r),typeof document<`u`&&document.addEventListener(`visibilitychange`,i)})}var Cp=e=>e&&/^No model in llms\.json/.test(e)?`No model is set up for the agent yet: add one in Settings, Models (or sign in to GitHub Copilot there), then send this again.`:e;function wp(e){let t=()=>{try{return localStorage.getItem(e)}catch{return null}},n=t=>{try{t?localStorage.setItem(e,t):localStorage.removeItem(e)}catch{}},[r,i]=(0,H.useState)(t),[a,o]=(0,H.useState)([]),[s,c]=(0,H.useState)(null);(0,H.useEffect)(()=>{if(!r){o([]),c(null);return}let e=!1,t=0,a=0;return o([]),(async()=>{for(;!e;)try{let n=await L.events(r,t,t>0);if(e||(a=0,c(n.state),n.events.length&&(t=n.events.at(-1).n,o(e=>[...e,...n.events])),(n.state===`closed`||n.state===`failed`)&&!n.events.length))return}catch(t){if(e)return;let r=t.status??0,o=xp(++a,r,t.message);if(o.giveUp&&r===404){n(null),i(null);return}if(o.giveUp)return;await Sp(o.waitMs)}})(),()=>{e=!0}},[r]);let l=(0,H.useMemo)(()=>od(a),[a]),u=l.turns.at(-1),d=s===`closed`||s===`failed`;return{chat:r,thread:l,last:u,busy:s===`busy`||s===`starting`||!!u&&!u.outcome&&!d,ended:d,send:async(e,t,a={})=>{if(r&&!d)await L.send(r,e,t);else{let{id:r}=await L.start(e,a,void 0,t);n(r),i(r)}},reset:()=>{n(null),i(null)},open:e=>{/^[a-f0-9]{18}$/.test(e)&&e!==r&&(n(e),i(e))}}}var Tp=`forgeqe.dock.chat`;function Ep(e){let t=ir(e);if(!t)return`Written from the mascot on a page of ForgeQE's that is not in its menu.`;let n=(t.category.agents??[]).flatMap(e=>{let t=F.find(t=>t.id===e);return t&&t.agent!==`forgeqe`?[I(t.agent).name]:[]}),r=`Written from the mascot on ForgeQE's ${t.item.label} page (${t.category.label} › ${t.area.label}).`;return n.length?`${r} Agents that work in this area: ${n.join(`, `)}. Hand them this area's work.`:r}function Dp(e){let t=e=>{for(let n of[...e??[]].reverse())if(n.status===`running`)return t(n.children)??n.handoff?.agent??n.agent};return e&&!e.outcome&&t(e.steps)||`forgeqe`}var Op=(e,t)=>e===`off`?t?`thinking`:`idle`:Xo[e],kp=(e,t,n)=>e===`speaking`?`speaking`:e===`hearing`?`listening`:e===`thinking`||t?`thinking`:n||e===`listening`||e===`connecting`?`waiting`:`idle`,Ap=(e,t,n)=>e===`speaking`?`speaking`:n?`waiting`:t||e===`thinking`?`thinking`:`idle`;function jp({route:e,hidden:t=!1}){let n=No(),{theme:a,mode:o}=O(),s=C(a),c=s===`visor`||s===`classic`,l=s===`orb`,{chat:u,thread:d,last:f,busy:p,ended:m,send:h,reset:_,open:v}=wp(Tp),y=$s(),[b,x]=(0,H.useState)(!1),S=i(b,150),[w,T]=(0,H.useState)(``),[E,D]=(0,H.useState)(``),[k,A]=(0,H.useState)(!1),[ee,N]=(0,H.useState)(zo),P=Ma(),te=Pa(),F=(0,H.useRef)(null),ne=(0,H.useRef)(!1),re=()=>{ne.current=!0},ie=(0,H.useRef)(null),ae=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=()=>N(zo());return window.addEventListener(Ro,e),()=>window.removeEventListener(Ro,e)},[]),(0,H.useEffect)(()=>{!ee&&!t&&n.phase!==`off`&&n.end()},[ee]);let[oe,se]=(0,H.useState)(di);(0,H.useEffect)(()=>{let e=()=>se(di());return window.addEventListener(li,e),()=>window.removeEventListener(li,e)},[]);let ce=!c&&oe&&!te&&!t&&!P;(0,H.useEffect)(()=>ce?yi():void 0,[ce]),(0,H.useEffect)(()=>{n.phase!==`off`&&n.chat&&n.chat!==u&&v(n.chat)},[n.phase,n.chat]),(0,H.useEffect)(()=>{if(!b)return;setTimeout(()=>{let e=document.getElementById(`dock-box`);e&&!e.disabled?e.focus():ie.current?.focus()},0);let e=e=>{e.key===`Escape`&&ie.current?.contains(document.activeElement)&&(x(!1),re())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]),(0,H.useEffect)(()=>{!S&&ne.current&&(ne.current=!1,F.current?.focus())},[S]);let le=d.turns.slice(-3),ue=`${le.length}:${f?.reply?.length??0}:${f?.steps.length??0}:${f?.outcome??``}`;(0,H.useEffect)(()=>{b&&ae.current?.scrollTo({top:ae.current.scrollHeight})},[b,ue]);let de=location.hash===``||location.hash===`#`||location.hash===`#/`,fe=n.phase!==`off`&&(n.chat?Uo()===n.chat:de),pe=n.phase!==`off`&&!fe;if(te||!pe&&(t||P))return null;let R=!!f&&(f.outcome===`needs_input`||!f.outcome&&(f.asks.some(e=>e.answer===void 0)||f.waits.some(e=>e.answer===void 0))),z=Dp(f),me=n.phase!==`off`&&(n.chat??null)===(u??null),ge=async()=>{let t=w.trim();if(t&&!k&&y.ready){A(!0),D(``);try{await h(t,Ep(e),y.choice),T(``)}catch(e){D(e.message)}finally{A(!1)}}},_e=`${o}:${a.primary??``}:${a.gradient??``}`,V=e=>c?(0,U.jsx)(M,{agent:z,px:e,decorative:!0,state:Ap(n.phase,p,R)}):l?(0,U.jsx)(ei,{mood:kp(n.phase,p,R),look:Op(n.phase,p),px:e,levels:ci,tint:_e}):(0,U.jsx)(ve,{state:Op(n.phase,p),px:e,levels:ci}),ye=I(z).name;return(0,U.jsxs)(`div`,{className:`fixed right-6 bottom-6 z-30 flex flex-col items-end gap-2`,children:[S&&(0,U.jsxs)(`div`,{ref:ie,role:`dialog`,"aria-modal":`false`,"aria-label":`Ask Atlas`,tabIndex:-1,inert:!b||void 0,className:g(`rounded-md border border-overlay-line bg-overlay p-2 text-ink shadow-menu backdrop-blur-[16px]`,b?`dock-in`:`dock-out`,`flex max-h-[min(560px,calc(var(--screen)-96px))] w-[min(400px,calc(100vw-32px))] flex-col gap-2 p-4`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V(24),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm font-medium`,"aria-live":`polite`,children:z===`forgeqe`?`Atlas`:`${ye} is working`}),u&&(0,U.jsx)(`a`,{href:r(`chats`,u),onClick:()=>x(!1),className:g(he({variant:`ghost`,size:`sm`}),`no-underline`),children:`Open the chat`}),u&&(0,U.jsx)(B,{variant:`icon`,size:`icon-xs`,"aria-label":`New conversation`,"data-tip":`Start a new conversation`,disabled:p||me,onClick:()=>(_(),T(``),D(``)),children:(0,U.jsx)(Ct,{size:16,"aria-hidden":`true`})}),(0,U.jsx)(B,{variant:`icon`,size:`icon-xs`,"aria-label":`Close`,"data-tip":`Close`,onClick:()=>(x(!1),re()),children:(0,U.jsx)(Ge,{size:16,"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{ref:ae,className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto text-body-sm`,children:le.length?(0,U.jsxs)(U.Fragment,{children:[d.turns.length>le.length&&u&&(0,U.jsx)(`a`,{href:r(`chats`,u),onClick:()=>x(!1),className:`text-body-sm`,children:`${d.turns.length-le.length} earlier in the chat`}),le.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsx)(ba,{text:e.user,scope:{chat:u||void 0}}),(0,U.jsx)(gp,{turn:e.error?{...e,error:Cp(e.error)}:e,live:!m,onAnswer:(e,t)=>void L.answer(u,e,t).catch(e=>D(e.message)),onProceed:(e,t)=>void L.proceed(u,e,t).catch(e=>D(e.message))})]},e.id)),d.fatal&&(0,U.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:d.fatal})]}):(0,U.jsx)(`p`,{className:`m-0 text-muted`,children:`Ask Atlas about this page, or say what to do. It hands the work to the right agent.`})}),!y.ready&&y.setup&&(0,U.jsx)(ic,{project:y.setup.project}),E&&(0,U.jsx)(`p`,{className:`m-0 text-body-sm text-fail [overflow-wrap:anywhere]`,children:E}),(0,U.jsx)(Ia,{id:`dock-box`,counted:!1,label:`Message to Atlas`,value:w,onChange:T,onSend:()=>void ge(),onStop:()=>u&&void L.stop(u),busy:p,disabled:k||!y.ready,canSend:!!w.trim(),rows:1,placeholder:le.length?`Reply, or ask for the next thing…`:`Ask Atlas…`,top:ee?(0,U.jsx)(qo,{chat:u}):void 0,left:ee?(0,U.jsx)(Ko,{chat:u,disabled:p||k}):void 0})]}),!b&&pe&&(0,U.jsxs)(`div`,{role:`region`,"aria-label":`Talk`,"aria-live":`polite`,className:g(`rounded-md border border-overlay-line bg-overlay p-2 text-ink shadow-menu backdrop-blur-[16px]`,`flex items-center gap-2 text-body-sm`),children:[(0,U.jsx)(`span`,{className:`font-medium`,children:Yo[n.phase]}),(0,U.jsx)(B,{variant:`ghost`,size:`sm`,type:`button`,onClick:n.end,children:`End`})]}),(0,U.jsx)(`button`,{ref:F,type:`button`,"aria-expanded":b,"aria-label":`Ask Atlas`,"data-tip":b?void 0:`Ask Atlas`,"data-face":c?`mascot`:l?`sphere`:`orb`,"data-tip-side":`left`,onClick:()=>x(e=>!e),hidden:S,className:g(`fade-in flex cursor-pointer items-center justify-center rounded-full p-0`,c?g(j,`size-14`,me&&`ring-2 ring-accent`):`size-20 border-0 bg-transparent`),children:V(c?40:80)})]})}function Mp({item:e}){return e.agent?(0,U.jsx)(M,{agent:e.agent,px:18,decorative:!0}):(0,U.jsx)(f,{name:b[e.id]||S[e.id]||`feature`,px:18})}var Np={id:`settings`,label:`Settings`};function Pp(){let e=(e,t,n,r,i)=>({id:e,label:t,meta:n,href:r,words:i,kind:`page`});return[...ar.filter(e=>e.item.path[0]!==`settings`).map(t=>e(t.item.id,t.item.label,`${t.category.label} · ${t.area.label}`,rr(t.item),[t.item.words,t.item.about].filter(Boolean).join(` `))),e(Np.id,Np.label,`Every setting`,r(Np.id))]}var Fp=Pp(),Ip=(0,H.lazy)(()=>ie(()=>import(`./CommandPalette-D8AtIocY.js`),__vite__mapDeps([10,2,3,11,8,9,12,4,5,13,0,1,6]))),Lp=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),Rp=()=>Lp()?`⌘K`:`Ctrl K`;function zp({route:e}){let{find:t}=(0,H.useContext)(Up),n=Nl(e);return(0,U.jsxs)(`header`,{className:`hidden h-(--top-bar) flex-none items-center gap-6 bg-canvas px-8 md:flex`,children:[(0,U.jsx)(`nav`,{"aria-label":`Where you are`,className:`flex min-w-0 flex-[1_1_0] items-center gap-2 text-body-sm`,children:n&&(0,U.jsxs)(U.Fragment,{children:[[n.parent,...n.middle?[n.middle]:[]].map(e=>(0,U.jsxs)(H.Fragment,{children:[e.href?(0,U.jsx)(`a`,{href:e.href,className:`flex-none text-muted no-underline hover:text-ink`,children:e.label}):(0,U.jsx)(`span`,{className:`flex-none text-muted`,children:e.label}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`/`})]},e.href??e.label)),n.here.href?(0,U.jsx)(`a`,{href:n.here.href,"aria-current":`page`,className:`min-w-0 truncate font-medium text-ink no-underline hover:text-accent-fg`,children:n.here.label}):(0,U.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate font-medium text-ink`,children:n.here.label})]})}),(0,U.jsxs)(B,{variant:`field`,onClick:t,"aria-keyshortcuts":Lp()?`Meta+K`:`Control+K`,"aria-label":`Search pages, agents and settings`,className:`w-full max-w-[560px] flex-[0_1_560px]`,children:[(0,U.jsx)(mt,{size:16,strokeWidth:1.8,"aria-hidden":`true`,className:`text-icon`}),(0,U.jsx)(`span`,{className:`flex-1 truncate text-left`,children:`Search`}),(0,U.jsx)(Hc,{children:Rp()})]}),(0,U.jsx)(`span`,{className:`flex-[1_1_0]`,"aria-hidden":`true`})]})}function Bp(){let{find:e}=(0,H.useContext)(Up);return(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Search (${Rp()})`,"data-tip":`Search`,onClick:e,className:`size-9 flex-none`,children:(0,U.jsx)(mt,{strokeWidth:1.8,"aria-hidden":`true`})})}var Vp=Ol,Hp=kl,Up=(0,H.createContext)({hidden:!1,open:()=>{},setChat:()=>{},find:()=>{}});function Wp(e){let{setChat:t}=(0,H.useContext)(Up),n=JSON.stringify(e);(0,H.useEffect)(()=>(t(e),()=>t(null)),[n,t])}var Gp=`forgeqe-sidebar`,Kp=()=>{try{return localStorage.getItem(Gp)===`closed`}catch{return!1}};function qp({className:e}){let{open:t}=(0,H.useContext)(Up);return(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Open the sidebar`,"data-tip":`Open the sidebar`,onClick:t,className:g(`inline-flex md:hidden`,e),children:(0,U.jsx)(on,{strokeWidth:1.8,"aria-hidden":`true`})})}function Jp(){return(0,U.jsxs)(`div`,{className:`theme-side sticky top-0 z-20 flex items-center gap-1 px-4 py-2 md:hidden`,children:[(0,U.jsx)(qp,{}),(0,U.jsx)(`span`,{className:`ml-1 flex min-w-0 flex-1`,children:(0,U.jsx)(pm,{compact:!0})}),(0,U.jsx)(Bp,{})]})}function Yp({item:e,current:t}){let n=t===e.id;return(0,U.jsxs)(`a`,{href:r(e.id),"aria-current":n?`page`:void 0,className:g(Vp,Hp(n)),children:[(0,U.jsx)(Mp,{item:e}),(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]})}function Xp({current:e,rail:t=!1}){let n=!e;return t?(0,U.jsx)(`a`,{href:r(),"aria-label":`New chat`,"data-tip":`New chat`,"data-tip-side":`right`,"aria-current":n?`page`:void 0,className:g(am,`mt-2`,n&&`bg-(--side-current-bg) text-(--side-current-ink) hover:bg-(--side-current-bg) hover:text-(--side-current-ink)`),children:(0,U.jsx)(xn,{strokeWidth:1.8,"aria-hidden":`true`,className:`size-[18px]`})}):(0,U.jsxs)(`a`,{href:r(),"aria-current":n?`page`:void 0,className:g(Vp,Hp(n)),children:[(0,U.jsx)(xn,{strokeWidth:1.8,"aria-hidden":`true`,className:`size-[18px]`}),`New chat`]})}function Zp(e){let t=ir(e);return t&&t.item.path.length?{category:t.category.id,area:Zn(t.area)?t.area.id:void 0}:{}}var Qp=`forgeqe-sidebar-unfold`;function $p(e){let t=`c:${e}`;try{let e=tm(localStorage.getItem(em));e.includes(t)||localStorage.setItem(em,JSON.stringify([...e,t]))}catch{}window.dispatchEvent(new CustomEvent(Qp,{detail:t}))}var em=`forgeqe-sidebar-open`;function tm(e){let t=new Set([...nr.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 nm=()=>{try{return tm(localStorage.getItem(em))}catch{return[]}};function rm(e){let t=Zp(e);return[t.category&&`c:${t.category}`,t.category&&t.area&&`a:${t.category}/${t.area}`].filter(e=>!!e)}function im({current:e,route:t,place:n=t,onClose:r}){let i=t.join(`/`),a=n.join(`/`),[o,s]=(0,H.useState)(()=>new Set([...nm(),...rm(n)])),c=(0,H.useRef)(a);(0,H.useEffect)(()=>{if(c.current===a)return;c.current=a;let e=rm(n);if(e.length){s(new Set(e));try{localStorage.setItem(em,JSON.stringify(e))}catch{}}},[i,a]),(0,H.useEffect)(()=>{let e=e=>{let t=tm(JSON.stringify([e.detail]))[0];t&&s(e=>e.has(t)?e:new Set([...e,t]))};return window.addEventListener(Qp,e),()=>window.removeEventListener(Qp,e)},[]);let l=e=>t=>s(n=>{let r=new Set(n);t?r.add(e):r.delete(e);try{localStorage.setItem(em,JSON.stringify([...r]))}catch{}return r}),{pins:u,toggle:d}=er(),p=ir(n)?.item.id,m=u.map(e=>ar.find(t=>t.item.id===e)).filter(e=>!!e),h=e=>p===e.id&&!(e.id===`chats`&&t[1]),g=e=>{let t=u.includes(e.id),n=`${t?`Unpin`:`Pin`} ${e.label}`;return(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":n,"aria-pressed":t,"data-tip":n,"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,U.jsx)(en,{size:13,strokeWidth:1.8,fill:t?`currentColor`:`none`,"aria-hidden":`true`})})},_=e=>(0,U.jsx)(xl,{href:rr(e),label:e.label,current:h(e),icon:(0,U.jsx)(f,{name:e.icon,px:18}),after:g(e)},e.id),v=e=>(0,U.jsx)(xl,{href:rr(e),label:e.label,current:p===e.id,icon:(0,U.jsx)(f,{name:e.icon,px:18}),after:g(e)},e.id);return(0,U.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,U.jsxs)(`div`,{className:`flex min-h-10 items-center gap-1 pl-2`,children:[(0,U.jsx)(pm,{}),(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Close the sidebar`,"data-tip":`Close the sidebar`,onClick:r,className:`size-8 flex-none`,children:(0,U.jsx)(Ne,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`mt-4 flex flex-col gap-px short:mt-2`,children:(0,U.jsx)(Xp,{current:e})}),(0,U.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,U.jsxs)(Dl,{routeKey:`${i}|${a}`,className:`gap-4 short:gap-2`,children:[(0,U.jsx)(wl,{label:`Pinned`,children:m.length?m.map(e=>v(e.item)):(0,U.jsx)(`span`,{className:`px-2 text-body-sm text-muted`,children:`Star a page below to pin it here.`})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-px`,children:[(0,U.jsx)(`span`,{className:`flex h-7 short:h-6 items-center px-2 text-body-sm font-medium text-muted`,children:`Browse`}),nr.map(e=>(0,U.jsx)(El,{label:e.label,icon:(0,U.jsx)(f,{name:e.icon,px:18}),lines:ml,open:o.has(`c:${e.id}`),onOpenChange:l(`c:${e.id}`),children:e.areas.map(t=>Zn(t)?(0,U.jsx)(Tl,{label:t.label,badge:!o.has(`a:${e.id}/${t.id}`)&&(0,U.jsx)(`span`,{className:`text-body-sm text-muted tabular-nums`,children:$n(t).length}),open:o.has(`a:${e.id}/${t.id}`),onOpenChange:l(`a:${e.id}/${t.id}`),children:$n(t).map(_)},t.id):$n(t).map(_))},e.id))]})]})}),(0,U.jsxs)(`div`,{className:`flex flex-none items-center gap-1 pt-2 short:pt-1`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(Yp,{item:Np,current:e})}),(0,U.jsx)(cm,{}),(0,U.jsx)(um,{icon:!0})]})]})}var am=g(he({variant:`icon`,size:`icon`}),`size-9 flex-none`);function om({item:e,current:t}){let n=t===e.id;return(0,U.jsx)(`a`,{href:r(e.id),"aria-current":n?`page`:void 0,"aria-label":e.label,"data-tip":e.label,"data-tip-side":`right`,className:g(am,n&&`bg-(--side-current-bg) text-(--side-current-ink) hover:bg-(--side-current-bg) hover:text-(--side-current-ink)`),children:(0,U.jsx)(Mp,{item:e})})}function sm({current:e,route:t,onOpen:n}){let{theme:i}=O(),{pins:a}=er(),o=i.name||`ForgeQE`,s=ir(t),c=s?.item.path.length?s.category.id:``,l=(e,t,n,r)=>(0,U.jsx)(`a`,{href:e,"aria-current":r?`page`:void 0,"aria-label":t,"data-tip":t,"data-tip-side":`right`,className:g(am,r&&`bg-(--side-current-bg) text-(--side-current-ink) hover:bg-(--side-current-bg) hover:text-(--side-current-ink)`),children:(0,U.jsx)(f,{name:n,px:18})},e),u=a.map(e=>ar.find(t=>t.item.id===e)).filter(e=>!!e);return(0,U.jsxs)(`nav`,{"aria-label":`ForgeQE`,className:`theme-side flex h-full w-16 flex-col items-center gap-px py-4`,children:[(0,U.jsx)(`a`,{href:r(),"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,U.jsx)(pf,{theme:i})}),(0,U.jsx)(B,{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,U.jsx)(on,{strokeWidth:1.8,"aria-hidden":`true`})}),(0,U.jsx)(Xp,{current:e,rail:!0}),(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center gap-px overflow-y-auto`,children:[(0,U.jsxs)(`div`,{role:`group`,"aria-label":`Browse`,className:`flex flex-col items-center gap-px`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`my-2 h-px w-6 bg-line`}),nr.map(e=>(0,U.jsx)(`button`,{type:`button`,"aria-label":e.label,"data-tip":e.label,"data-tip-side":`right`,"aria-current":c===e.id?`true`:void 0,onClick:()=>{$p(e.id),n()},className:g(am,`cursor-pointer`,c===e.id&&`bg-(--side-current-bg) text-(--side-current-ink) hover:bg-(--side-current-bg) hover:text-(--side-current-ink)`),children:(0,U.jsx)(f,{name:e.icon,px:18})},e.id))]}),u.length>0&&(0,U.jsxs)(`div`,{role:`group`,"aria-label":`Pinned`,className:`flex flex-col items-center gap-px`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`my-2 h-px w-6 bg-line`}),u.map(e=>l(rr(e.item),e.item.label,e.item.icon,s?.item.id===e.item.id))]})]}),(0,U.jsxs)(`div`,{className:`flex flex-none flex-col items-center gap-px pt-2`,children:[(0,U.jsx)(cm,{rail:!0}),(0,U.jsx)(um,{icon:!0,rail:!0}),(0,U.jsx)(om,{item:Np,current:e})]})]})}function cm({rail:e=!1}){return(0,U.jsx)(`a`,{href:`/help/guide`,target:`_blank`,rel:`noreferrer noopener`,"aria-label":`Help`,"data-tip":`Help`,"data-tip-side":e?`right`:void 0,className:am,children:(0,U.jsx)(f,{name:b.help,px:18})})}var lm=[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}];function um({icon:e=!1,rail:t=!1}){let{choice:n,setChoice:r}=O(),i=lm.findIndex(e=>e.id===n),a=lm[i],o=lm[(i+1)%lm.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,U.jsxs)(`button`,{type:`button`,"aria-label":s,"data-tip":s,"data-tip-side":t?`right`:void 0,onClick:()=>r(o.id),className:e?am:g(Vp,Hp(!1),`w-full cursor-pointer border-0 bg-transparent text-left`),children:[(0,U.jsx)(f,{name:b.theme,px:18}),!e&&(0,U.jsxs)(`span`,{className:`flex flex-1 items-baseline justify-between gap-2`,children:[`Dark/Light`,(0,U.jsx)(`span`,{className:`text-body-sm text-muted`,children:a.label===`System`?`Auto`:a.label})]})]})}function dm(e){return[{id:`env`,label:`Environment`},...e?[{id:`chat`,label:`This chat`}]:[],{id:`usage`,label:`This project`},...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 fm({stats:e,onOpen:t}){return(0,U.jsxs)(`aside`,{"aria-label":`Workspace`,className:`flex h-full w-14 flex-col items-center gap-1 bg-canvas py-4`,children:[(0,U.jsx)(_f,{rail:!0}),(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Show the workspace panel`,"data-tip":`Show the workspace panel`,"data-tip-side":`left`,onClick:()=>t(),children:(0,U.jsx)(at,{strokeWidth:1.8,"aria-hidden":`true`})}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`my-1 h-px w-6 bg-line`}),dm(e).map(e=>(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":e.label,"data-tip":e.label,"data-tip-side":`left`,onClick:()=>t(e.id),className:`size-9 flex-none`,children:(0,U.jsx)(Mp,{item:e})},e.id))]})}function pm({compact:e=!1}){let{theme:t}=O(),n=t.name||`ForgeQE`;return(0,U.jsx)(`a`,{href:r(),"aria-label":`${n}, home`,className:`-ml-2 flex min-h-9 min-w-0 flex-1 items-center gap-2 pl-2 text-body-lg font-medium text-ink no-underline hover:text-ink`,children:(0,U.jsx)(ff,{theme:t,compact:e})})}function mm(){let[e,t]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=()=>t(!0);return window.addEventListener(pe,e),()=>window.removeEventListener(pe,e)},[]),e?(0,U.jsx)(`p`,{role:`alert`,className:g(ge.fail,`mx-4 mt-4 mb-0`),children:ae()}):null}function hm({stats:e,onClose:t,focus:n}){let r=(0,H.useRef)(null);return(0,H.useEffect)(()=>{n&&(r.current?.querySelector(`#panel-${n.id}`))?.scrollIntoView({block:`start`,behavior:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`})},[n]),(0,U.jsxs)(`aside`,{"aria-label":`Workspace`,className:`flex h-full w-[264px] flex-col bg-canvas`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-4`,children:[(0,U.jsx)(_f,{}),(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Close the workspace panel`,"data-tip":`Close the workspace panel`,"data-tip-side":`left`,onClick:t,children:(0,U.jsx)(nt,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{ref:r,className:`min-h-0 flex-1 overflow-y-auto px-4 pt-1 pb-4`,children:(0,U.jsx)(Vd,{chat:e})})]})}var gm=`forgeqe-workspace-panel`,_m=`forgeqe:workspace-fold`,vm=()=>{try{return localStorage.getItem(gm)!==`closed`}catch{return!0}},ym=220;function bm({open:e,side:t,label:n,wideAt:r,onClose:a,className:o,children:s}){let c=(0,H.useRef)(null),l=i(e,150);(0,H.useEffect)(()=>{let t=c.current;t&&(e&&!t.open?t.showModal():!l&&t.open&&t.close())},[e,l]),(0,H.useEffect)(()=>{if(!e)return;let t=window.matchMedia(r);if(t.matches)return a();let n=()=>t.matches&&a();return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e,r,a]);let u=t===`left`?`aside`:`div`;return(0,U.jsx)(`dialog`,{ref:c,"aria-label":n,onCancel:e=>{e.target===c.current&&(e.preventDefault(),a())},className:g(`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`,o),children:l&&(0,U.jsxs)(`div`,{inert:!e||void 0,className:`absolute inset-0`,children:[(0,U.jsx)(`div`,{"aria-hidden":`true`,className:`drawer-dim absolute inset-0 bg-[rgba(15,23,42,0.28)]`,onClick:a}),(0,U.jsx)(u,{className:g(`drawer-box absolute inset-y-0 max-w-[85vw] shadow-menu`,t===`left`?`drawer-left left-0`:`right-0`),children:s})]})})}function xm(e,t,n){let r=(e??``).replace(/\s+/g,` `).trim().slice(0,80);return n||!r?t:`${r} · ${t}`}function Sm(e,t,n){(0,H.useEffect)(()=>{let e=document.querySelector(`[data-screen]`);if(!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`h1`),r=xm(n?.textContent,ee(),!!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 Cm(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 wm({current:e,route:t=e?[e]:[],children:n}){let[r,a]=(0,H.useState)(Kp),[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(vm),[f,p]=(0,H.useState)(!1),m=(0,H.useCallback)(()=>l(!1),[]),h=(0,H.useCallback)(()=>p(!1),[]),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(``),C=t.join(`/`);(0,H.useEffect)(()=>tr(t),[C]);let{theme:w}=O();Sm(e,C,w.appName);let T=dc(t),E=()=>{l(!1),S(``),b(!0),v(!0)},D=(0,H.useCallback)(e=>{l(!1),S(e),b(!0),v(!0)},[]);(0,H.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),S(``),b(!0),v(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let k=i(!r,ym),A=i(u,ym),[j,M]=(0,H.useState)(null),ee=()=>window.matchMedia(`(min-width: 1600px)`).matches,N=e=>{d(e);try{localStorage.setItem(gm,e?`open`:`closed`)}catch{}};(0,H.useEffect)(()=>{let e=e=>d(e.detail!==!0&&vm());return window.addEventListener(_m,e),()=>window.removeEventListener(_m,e)},[]),(0,H.useEffect)(()=>{if(!f)return;let e=()=>p(!1);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[f]);let P=e=>{a(e);try{localStorage.setItem(Gp,e?`closed`:`open`)}catch{}};(0,H.useEffect)(()=>{if(!c)return;let e=()=>l(!1);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[c]);let te=()=>window.matchMedia(`(min-width: 768px)`).matches,{setChoice:F}=O(),I=async(e,t,n)=>e===`theme`?(F(t),`The look is ${t} now.`):e===`talk`?(window.dispatchEvent(new Event(`forgeqe:talk-off`)),`Talk is ending.`):e===`sidebar`?(te()?P(t===`closed`):l(t===`open`),`The sidebar is ${t}.`):n?(await L.settings(n,{headed:t===`shown`}),`Browser runs in this chat are ${t} now.`):`Browser runs are set per chat: open one first.`,ne=e===`settings`||e===`welcome`,re=e=>{ee()?N(!0):p(!0),M(e?{id:e,at:Date.now()}:null)};return(0,U.jsx)(Up.Provider,{value:{hidden:r,open:()=>te()?P(!1):l(!0),setChat:s,find:E},children:(0,U.jsx)(Do,{pages:Fp,find:D,set:I,children:(0,U.jsx)(Go,{children:(0,U.jsxs)(`div`,{className:`flex min-h-(--screen) bg-canvas`,children:[(0,U.jsx)(`a`,{href:`#content`,onClick:Cm,className:`sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70] focus:rounded-sm focus:bg-accent focus:px-4 focus:py-2 focus:text-body-sm focus:font-medium focus:text-accent-ink focus:no-underline`,children:`Skip to content`}),(0,U.jsxs)(`aside`,{style:{viewTransitionName:`app-sidebar`},className:g(`side-box sticky top-0 h-(--screen) flex-none overflow-hidden`,r?`w-16`:`w-[248px] min-[1440px]:w-[264px]`,ne?`hidden`:`hidden md:block`),children:[(0,U.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 left-0`,r&&`invisible opacity-0`),children:k&&(0,U.jsx)(im,{current:e,route:t,place:T,onClose:()=>P(!0)})}),(0,U.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 left-0`,!r&&`invisible opacity-0`),children:(0,U.jsx)(sm,{current:e,route:T,onOpen:()=>P(!1)})})]}),(0,U.jsx)(bm,{open:c,side:`left`,label:`Sidebar`,wideAt:`(min-width: 768px)`,onClose:m,className:`md:hidden`,children:(0,U.jsx)(im,{current:e,route:t,place:T,onClose:()=>l(!1)})}),(0,U.jsxs)(`div`,{"data-screen":!0,className:`relative flex min-w-0 flex-1 flex-col`,children:[e!==`welcome`&&(0,U.jsx)(zp,{route:t}),(0,U.jsx)(mm,{}),(0,U.jsx)(`div`,{"data-page-area":!0,className:`flex min-w-0 flex-1 flex-col`,children:n}),(0,U.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Show the workspace panel`,"data-tip":`Show the workspace panel`,onClick:()=>re(),className:g(`absolute top-2 right-3 z-30 md:hidden`,ne&&`hidden`),children:(0,U.jsx)(at,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,U.jsxs)(`div`,{style:{viewTransitionName:`app-panel`},className:g(`side-box sticky top-0 h-(--screen) w-14 flex-none overflow-hidden`,u&&`min-[1600px]:w-[264px]`,ne?`hidden`:`hidden md:block`),children:[(0,U.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 right-0 hidden min-[1600px]:block`,!u&&`invisible opacity-0`),children:A&&(0,U.jsx)(hm,{stats:o,focus:j,onClose:()=>N(!1)})}),(0,U.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 right-0`,u&&`min-[1600px]:invisible min-[1600px]:opacity-0`),children:(0,U.jsx)(fm,{stats:o,onOpen:re})})]}),y&&(0,U.jsx)(H.Suspense,{fallback:null,children:(0,U.jsx)(Ip,{open:_,onClose:()=>v(!1),pages:Fp,query:x})}),(0,U.jsx)(bm,{open:f,side:`right`,label:`Workspace panel`,wideAt:`(min-width: 1600px)`,onClose:h,className:`min-[1600px]:hidden`,children:(0,U.jsx)(hm,{stats:o,focus:j,onClose:()=>p(!1)})}),(0,U.jsx)(jp,{route:t,hidden:ne||e===``||e===`chats`&&!!t[1]})]})})})})}var Tm=`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`,Em=`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`,Dm=`[--page-w:100cqw]`,Om=`@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{zc as $,yi as $t,Fl as A,rs as At,K as B,To as Bt,sd as C,W as Cn,$s as Ct,gu as D,sr as Dn,Ps as Dt,Su as E,ur as En,Fs as Et,lu as F,Bo as Ft,pl as G,ba as Gt,Ol as H,Ha as Ht,zl as I,Io as It,ll as J,ma as Jt,cl as K,Ea as Kt,q as L,zo as Lt,ql as M,Ko as Mt,Wl as N,qo as Nt,$l as O,or as On,Ns as Ot,Hl as P,Lo as Pt,Vc as Q,xi as Qt,Il as R,Ho as Rt,tf as S,cr as Sn,ic as St,ad as T,pr as Tn,Rs as Tt,kl as U,Ia as Ut,Pl as V,Ua as Vt,G as W,Na as Wt,Hc as X,Di as Xt,ol as Y,Gi as Yt,Bc as Z,Si as Zt,Yf as _,mr as _n,lc as _t,_m as a,Wr as an,Ic as at,pf as b,hr as bn,rc as bt,wm as c,Ir as cn,vc as ct,Cp as d,Dr as dn,hc as dt,di as en,xc as et,wp as f,jr as fn,gc as ft,gp as g,xr as gn,cc as gt,dp as h,Cr as hn,oc as ht,Dm as i,Or as in,Nc as it,Jl as j,ns as jt,Ul as k,xs as kt,Rp as l,Pr as ln,pc as lt,Sp as m,wr as mn,sc as mt,Em as n,ci as nn,Lc as nt,qp as o,Vr as on,_c as ot,xp as p,Mr as pn,Fc as pt,al as q,ha as qt,Om as r,ei as rn,Mc as rt,Jp as s,Ur as sn,yc as st,Tm as t,fi as tn,bc as tt,Wp as u,Lr as un,mc as ut,vf as v,br as vn,ec as vt,od as w,dr as wn,Ks as wt,Yd as x,fr as xn,ac as xt,ff as y,gr as yn,nc as yt,Rl as z,Oo as zt};