@capagents/forgeqe 3.4.1 → 3.4.2
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.
- package/dist/forgeqe.js +1977 -1977
- package/dist/web/assets/{Agent-FGPuvhc5.js → Agent-C5oBtGk7.js} +1 -1
- package/dist/web/assets/{AgentWork-CFw0XcKd.js → AgentWork-DJ8Vs06n.js} +1 -1
- package/dist/web/assets/{ApiTests-D5rqD6gA.js → ApiTests-BLCfYh51.js} +1 -1
- package/dist/web/assets/{Chat-DS4jyAH3.js → Chat-Cv8DeS-_.js} +1 -1
- package/dist/web/assets/{Compare-BFDv-NmH.js → Compare-DaIqZceW.js} +1 -1
- package/dist/web/assets/{Cost-_h1bxSj0.js → Cost-CITIwCiU.js} +1 -1
- package/dist/web/assets/{Data-BuIpjLOr.js → Data-DSoaKTFT.js} +1 -1
- package/dist/web/assets/{Desktop-F-PyYzC0.js → Desktop-CSaj8gd9.js} +1 -1
- package/dist/web/assets/{DesktopReview-CODdFSMN.js → DesktopReview-Dz5XOBgo.js} +1 -1
- package/dist/web/assets/{Evidence-BXr78jgr.js → Evidence-WRJ5Ocx1.js} +1 -1
- package/dist/web/assets/{Explore-AAssIdGu.js → Explore-CnsxID-z.js} +1 -1
- package/dist/web/assets/{Features-Ce2hYdNS.js → Features-Do6F_oaP.js} +1 -1
- package/dist/web/assets/{Flags-DRXJnHt4.js → Flags-KtTYNU6g.js} +1 -1
- package/dist/web/assets/{Flaky-BGUyv4_b.js → Flaky-BBPNCZOq.js} +1 -1
- package/dist/web/assets/{Impact-B6F9nuZt.js → Impact-DXpXmLyE.js} +1 -1
- package/dist/web/assets/{Jobs-BsP-lQnC.js → Jobs-Fj0wBOAO.js} +1 -1
- package/dist/web/assets/{KindPage-jQ0mJt7b.js → KindPage--MHC32ho.js} +1 -1
- package/dist/web/assets/{LiveDevice-C0OpjAg0.js → LiveDevice-CuJzvCUi.js} +1 -1
- package/dist/web/assets/{Migration-yiY2-7f3.js → Migration-6aYe_2EG.js} +1 -1
- package/dist/web/assets/{Mobile-DcL2FOJg.js → Mobile-Dv6f7u3D.js} +1 -1
- package/dist/web/assets/{Observability-BdpwjRNO.js → Observability-Dqb01Eyo.js} +1 -1
- package/dist/web/assets/{OwnItems-DRV4_VbL.js → OwnItems-BWX70VhE.js} +1 -1
- package/dist/web/assets/{PageAgent-C_DrJ3kc.js → PageAgent-CPVv-rb3.js} +1 -1
- package/dist/web/assets/{Product-BoLtQxi6.js → Product-Bg8GLZO1.js} +1 -1
- package/dist/web/assets/{Production-DgMWWNd_.js → Production-D_-UKwAW.js} +1 -1
- package/dist/web/assets/{Quality-Dfh-gpB-.js → Quality-AK4ooDrk.js} +1 -1
- package/dist/web/assets/{Readiness-BzlzH-RQ.js → Readiness-oW5ApJNH.js} +1 -1
- package/dist/web/assets/{Record-BpL7Br8t.js → Record-DB3vbV-C.js} +1 -1
- package/dist/web/assets/{Regression-VL1J4PQB.js → Regression-DuYa0h-o.js} +1 -1
- package/dist/web/assets/{Reports-CzJULGPA.js → Reports-1mP0MxVQ.js} +1 -1
- package/dist/web/assets/{Requirements-CsfwSrgh.js → Requirements-BRXFZQuu.js} +1 -1
- package/dist/web/assets/{Responsive-GfKHZLev.js → Responsive-CnoYMfsl.js} +1 -1
- package/dist/web/assets/{RunDiff-DZw8Jja0.js → RunDiff-Wro2Olyz.js} +1 -1
- package/dist/web/assets/{Settings-CiMIX_QR.js → Settings-DBCDjRxF.js} +3 -3
- package/dist/web/assets/{SiteScan-Cydt89Ja.js → SiteScan-BkdOUe_S.js} +1 -1
- package/dist/web/assets/{Steps-BoyXqIqo.js → Steps-ndafqk8T.js} +1 -1
- package/dist/web/assets/{TestData-Jwowbnv2.js → TestData-4P28hX0Q.js} +1 -1
- package/dist/web/assets/{TestManagement-BPx01M_H.js → TestManagement-Dohg2yyF.js} +1 -1
- package/dist/web/assets/{WhatsNew-DAtb7FTn.js → WhatsNew-Bcv9S0Tj.js} +1 -1
- package/dist/web/assets/{agentSettingsSheet-DxBRwlvu.js → agentSettingsSheet-ElGgFEeo.js} +1 -1
- package/dist/web/assets/{dataParts-DvgtfSmo.js → dataParts-_MZY-U_N.js} +1 -1
- package/dist/web/assets/frame-wloj3-xC.js +139 -0
- package/dist/web/assets/{index-nbjwmmih.js → index-BCu9qAny.js} +4 -4
- package/dist/web/assets/{productParts-tf1w_F1S.js → productParts-Pp0gh7QX.js} +1 -1
- package/dist/web/assets/{qualityParts-O56nH8FQ.js → qualityParts-diTrGtUR.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/frame-Z5TaJY7O.js +0 -23
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/paletteCommands-Bx61jZay.js","assets/route-9BkoTWUE.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-BDur5s0O.js","assets/sectionList-BPBmSZXk.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-x_RA-vYW.js","assets/preload-helper-BupTYkQW.js","assets/palette-DOQemIAv.js","assets/api-B8AQ8-Gb.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{F as i,H as a,L as o,R as s,V as c,d as l,l as u,o as d,p as f,s as p,t as m}from"./preload-helper-BupTYkQW.js";import{n as h,t as g}from"./utils-DJRAScIl.js";import{t as _}from"./jsx-runtime-LKYXHABd.js";import{F as v,G as y,K as b,L as x,N as S,R as C,U as w,a as T,c as E,i as D,j as O,n as k,r as A,s as j,u as M}from"./palette-DOQemIAv.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-BPBmSZXk.js";import{at as ie,b as L,et as ae,f as oe,gt as se,h as ce,mt as le,q as ue,rt as de,s as fe,u as pe}from"./api-B8AQ8-Gb.js";import{A as R,E as me,F as he,I as ge,M as _e,N as z,P as B,S as ve,_ as ye,a as be,g as xe,i as Se,j as Ce,k as we,m as Te,r as Ee,u as De,v as Oe,y as ke}from"./pageBack-CINGjBHZ.js";import{$ as Ae,A as je,An as Me,At as Ne,B as Pe,C as Fe,Cn as Ie,Cr as Le,Dn as Re,E as V,Er as ze,Et as Be,Ft as Ve,Gn as He,Gr as Ue,Gt as We,I as Ge,In as Ke,Ir as qe,Jn as Je,K as Ye,Kn as Xe,Ln as Ze,Lt as Qe,M as $e,Mn as et,Mt as tt,N as nt,Nn as rt,Nr as it,Nt as at,O as ot,On as st,Ot as ct,Pn as lt,Pr as ut,Pt as dt,Qn as ft,Qt as pt,Rn as mt,Rt as ht,Sr as gt,Tr as _t,Tt as vt,U as yt,V as bt,Vn as xt,Vr as St,W as Ct,Wn as wt,Wr as Tt,Wt as Et,Xt as Dt,Y as Ot,Z as kt,Zn as At,_n as jt,_r as Mt,_t as Nt,a as Pt,ar as Ft,bn as It,br as Lt,bt as Rt,c as zt,cn as Bt,cr as Vt,d as Ht,dn as Ut,en as Wt,er as Gt,et as Kt,f as qt,ft as Jt,g as Yt,gn as Xt,h as Zt,hr as Qt,i as $t,in as en,ir as tn,it as nn,jn as rn,k as an,kr as on,kt as sn,l as cn,m as ln,mr as un,mt as dn,n as fn,nn as pn,nr as mn,nt as hn,o as gn,on as _n,or as vn,pr as yn,q as bn,r as xn,rn as Sn,rr as Cn,s as wn,sr as Tn,t as En,tn as Dn,tr as On,tt as kn,u as An,un as jn,ur as Mn,v as Nn,vn as Pn,vr as Fn,vt as In,w as Ln,wr as Rn,wt as zn,x as Bn,xr as Vn,xt as Hn,y as Un,yr as Wn,yt as Gn,z as Kn,zn as qn,zt as Jn}from"./line-icons-Cwj9OmCz.js";import{a as Yn,c as Xn,d as Zn,f as Qn,l as $n,n as er,o as tr,s as nr,t as rr}from"./nav-DRpijFeN.js";var H=_(),U=e(t(),1),ir=`(max-height: 820px)`,ar=()=>(0,U.useSyncExternalStore)(e=>{let t=typeof matchMedia==`function`?matchMedia(ir):null;return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},()=>typeof matchMedia==`function`&&matchMedia(`(max-height: 820px)`).matches,()=>!1);function or({open:e,onClose:t,title:n,description:r,children:i,footer:a,wide:o,bare:s}){let c=(0,U.useRef)(null),l=(0,U.useId)(),u=(0,U.useRef)({title:n,description:r,children:i,footer:a});e&&(u.current={title:n,description:r,children:i,footer:a});let[d,f]=(0,U.useState)(!1),p=e?{title:n,description:r,children:i,footer:a}:u.current;return(0,U.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,H.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(b,`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,H.jsx)(`div`,{className:`h-full`,children:p.children}),(e||d)&&!s&&(0,H.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-4 px-6 pt-6 pb-4`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`h2`,{id:l,className:`m-0 text-headline-sm`,children:p.title}),p.description&&(0,H.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-muted`,children:p.description})]}),(0,H.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Close`,"data-tip":`Close`,onClick:t,className:`-mt-1 -mr-2`,children:(0,H.jsx)(Ue,{size:20,"aria-hidden":`true`})})]}),(0,H.jsx)(`div`,{className:`sheet-body flex-1 overflow-y-auto px-6 pb-6`,children:p.children}),(0,H.jsx)(`div`,{className:`flex flex-wrap justify-end gap-2 px-6 py-4`,children:p.footer})]})]})}var sr=null,cr=null;function lr(){if(!sr||Date.now()-sr.at>1e4){let e=ue.list().then(e=>cr=e.personas,e=>{throw sr=null,e});sr={at:Date.now(),list:e}}return sr.list}var ur=e=>new Set(e.flatMap(e=>[e.handle,e.id])),dr=()=>cr?ur(cr):null;function fr(e){let[t,n]=(0,U.useState)(dr);return(0,U.useEffect)(()=>{if(!e)return;let t=!1;return lr().then(e=>!t&&n(ur(e)),()=>{}),()=>{t=!0}},[e]),t}var pr=2048,mr=/\.(png|jpe?g|gif|webp|bmp|avif|svg|ico|heic|heif|tiff?)$/i,hr=new Set([`image/png`,`image/jpeg`,`image/webp`,`image/gif`]),gr=e=>mr.test(e),_r=e=>e.type.startsWith(`image/`)||mr.test(e.name),vr=e=>/\.(png|jpe?g|gif|webp)$/i.test(e);function yr(e){return e.replace(/^.*[\\/]/,``).replace(/\.[^.]*$/,``).replace(/[^A-Za-z0-9._-]+/g,`-`).replace(/^[-.]+|(?<!-)-+$/g,``).slice(0,60)||`image`}var br=0;function xr(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())}-${++br}`}var Sr=e=>!e||/^image\.(png|jpe?g|gif|webp|bmp)$/i.test(e);async function Cr(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 wr(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 Tr(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 Tr(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 Er(e,t){let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}function Dr(e,t,n){return new Promise(r=>e.toBlob(r,t,n))}function Or(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 kr(e,t={}){let n=t.max??5242880,r=t.name??e.name??``,i=Sr(r)?xr():yr(r);if(e.type===`image/gif`&&e.size<=n){let t=await wr(e).catch(()=>null);if(t?.close?.(),t)return{name:`${i}.gif`,type:`image/gif`,data:await Cr(e),width:t.width,height:t.height,changed:!1}}let a=await wr(e);try{let t=Math.min(1,pr/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=Er(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=Or(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 Dr(c,e,t);if(r&&r.type===e&&hr.has(e)&&r.size<=n)return{name:`${i}${e===`image/png`?`.png`:e===`image/webp`?`.webp`:`.jpg`}`,type:e,data:await Cr(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 Ar=/<!-- (?:attached-files|forgeqe:files)\s*([\s\S]*?)-->\s*/,jr=/^(?:\.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 ._-]*\/?)$/,Mr=/\.(png|jpe?g|gif|webp)$/i,Nr=e=>Mr.test(e),Pr=/\.(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,Fr=e=>Pr.test(e),Ir=/\.(docx|xlsx|pptx)$/i,Lr=e=>Ir.test(e);function Rr(e){let t=/\.(doc|xls|ppt)$/i.exec(e);return t?`.${t[1].toLowerCase()}x`:void 0}var zr=e=>/\s/.test(e)?`@"${e}"`:`@${e}`;function Br(e,t){let n=zr(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 Vr(e,t){return Br(e,t)!==e}function Hr(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 Ur(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 Wr(e,t,n,r){let i=`${zr(r)} `;return{text:`${e.slice(0,t)}${i}${e.slice(n)}`,cursor:t+i.length}}function Gr(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(`
|
|
3
|
-
`);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.
|
|
4
|
-
`:``}${i}\n-->\n${n}`.trim()}function Kr(e){let t=Ar.exec(e),n=t?t[1].split(/\r?\n/).map(e=>e.replace(/^- /,``).trim()).filter(e=>jr.test(e)):[],r=n.filter(e=>!(e.endsWith(`.md`)&&Lr(e.slice(0,-3))&&n.includes(e.slice(0,-3))));return{body:e.replace(Ar,``).replace(/^(?:<!--[\s\S]*?-->\s*)+/,``).trim(),files:r}}function qr(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 Jr=/^\/[a-z][a-z0-9-]{0,39}(?=\s|$)/,Yr=/(^|\s)(@"[^"\n]+"|@[^\s@"]*[^\s@".,;:!?)\]])/g,Xr=/(^|\s)\/([a-z][a-z0-9-]{0,39})(?=[\s.,;:!?)]|$)/g;function Zr(e,t){let n=[];for(let t of e.matchAll(Yr))n.push({start:t.index+t[1].length,text:t[2],mark:`file`});for(let r of e.matchAll(Xr)){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 Qr(e){let t=Jr.exec(e.trimStart());return t?{command:t[0],rest:e.trimStart().slice(t[0].length).trim()}:{command:``,rest:e}}function $r(e,t,n){let{command:r,rest:i}=Qr(e),a=t.trim(),o=[...new Set([...i.matchAll(Yr)].map(e=>e[2]))].filter(e=>![...a.matchAll(Yr)].some(t=>t[2]===e)),s=e=>[...e.matchAll(Xr)].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&&Qr(a).command!==r&&(a=`${r} ${a}`),a.trim()}var ei=8;function ti(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 ni({path:e,name:t,note:n}){let r=Hr(e),i=n||r.dir;return(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,H.jsx)(`span`,{className:`max-w-full truncate text-body-sm font-medium leading-tight text-ink`,children:t||r.name}),i?(0,H.jsx)(`span`,{className:`max-w-full truncate text-body-sm leading-tight text-muted`,"data-tip":e||void 0,children:i}):null]})}function ri({file:e,scope:t,onView:n}){let r=e.pending&&e.pending.type.startsWith(`image/`)&&Nr(e.name)?`data:${e.pending.type};base64,${e.pending.data}`:``,[i,a]=(0,U.useState)(``),o=`${t.chat||``}|${t.code===!1?0:1}`;(0,U.useEffect)(()=>{if(a(``),r||!e.path||!Nr(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,H.jsx)(`img`,{src:s,alt:``,className:g(d,`size-8 flex-none`)});return n?(0,H.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 ii({text:e,scope:t={}}){let{body:n,files:r}=Kr(e),[i,a]=(0,U.useState)(``);return!n&&!r.length?null:(0,H.jsxs)(`div`,{className:`ml-auto flex max-w-[min(85%,640px)] flex-col items-end gap-2`,children:[r.length>0&&(0,H.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,H.jsx)(`li`,{className:`inline-flex max-w-full`,children:e.endsWith(`/`)?(0,H.jsx)(`span`,{className:`inline-flex max-w-full items-center gap-2 rounded-sm bg-surface-strong px-2 py-2`,children:(0,H.jsx)(ni,{path:e})}):(0,H.jsxs)(B,{"data-tip":`Open ${e}`,onClick:async()=>{a(``),a(await Ce(e,e=>L.openFile(e,t)))},className:`max-w-full justify-start py-1 pl-1 text-left`,children:[(0,H.jsx)(ri,{file:{path:e,name:Hr(e).name},scope:t}),(0,H.jsx)(ni,{path:e})]})},e))}),i&&(0,H.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:i}),n&&(0,H.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 ai({file:e,scope:t,onRemove:n,onView:r}){return(0,H.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,H.jsx)(ri,{file:e,scope:e.scope??t,onView:r}),(0,H.jsx)(ni,{path:e.path,name:e.name,note:e.pending?`Saves when you send`:void 0}),(0,H.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,H.jsx)(Ue,{size:12,"aria-hidden":`true`})})]})}async function oi(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 kr(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 si=716800,ci=5242880,li=52428800;function ui(e,t,n,r={}){let[i,a]=(0,U.useState)([]),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)([]),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)(null),[m,h]=(0,U.useState)(0),[_,v]=(0,U.useState)(`file`),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(!1),[C,w]=(0,U.useState)(null),T=(0,U.useRef)(null),E=(0,U.useRef)(0),O=(0,U.useRef)(0),k=(0,U.useRef)(null),A=(0,U.useRef)(0),j=(0,U.useRef)(e);j.current=e;let M=(0,U.useRef)(i),ee=(0,U.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),lr().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,U.useEffect)(()=>{if(f===null)return;let e=setTimeout(()=>te(f),80);return()=>clearTimeout(e)},[f,N,_]),(0,U.useEffect)(()=>{u&&document.getElementById(`${n}-file-${m}`)?.scrollIntoView({block:`nearest`})},[u,m,n]);let F=()=>{++A.current,d(!1),p(null),l([]),T.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>=ei?`At most ${ei} 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=Br(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,E.current)}${e.path} `;t(`${i}${r.replace(/^\s+/,``)}`),ie(i.length);return}let n=T.current,r=I({id:e.path,path:e.path,name:e.name,kind:`project`,image:Nr(e.path)});if(s(r),F(),!n||r)return;let i=Wr(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`&&Vr(n,t.name)&&!Vr(e,t.name));t.length&&P(M.current.filter(e=>!t.includes(e)))}let r=qr(e,t);if(r!==null){T.current=null,E.current=r.start,_!==`persona`&&(++A.current,l([])),u&&_===`persona`||b(!0),v(`persona`),p(r.query),d(!0);return}let i=Ur(e,t);i?(T.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):(D(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(_r(n)){if(n.size>li){e.push(`${n.name} is over ${li/1024/1024} MB: save a smaller copy and attach that.`);continue}try{let t=await kr(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>=ei))break}catch(t){e.push(`${n.name}: ${t.message}`)}continue}let t=Rr(n.name);if(t){e.push(`${n.name}: save it as ${t} and attach that (the older format is not read).`);continue}if(!Fr(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=Lr(n.name)?ci:si;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 ti(n),r=I({id:`pending:${n.name}:${n.size}:${n.lastModified}`,path:``,name:n.name,kind:`upload`,image:Nr(n.name),pending:{name:n.name,type:n.type||`application/octet-stream`,data:t}});if(r&&(e.push(r),M.current.length>=ei))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`&&Vr(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}),gr(e.name)&&(!vr(e.name)||(e.size??0)>5242880)&&!t.some(t=>t.copyOf===e.path)&&!r.some(t=>t.copyOf===e.path)){let t=await oi(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:Nr(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),Gr(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,H.jsx)(`input`,{ref:k,type:`file`,multiple:!0,className:`hidden`,onChange:e=>(e.target.files&&ce(e.target.files),e.target.value=``)}),chips:(0,H.jsxs)(H.Fragment,{children:[ue.length>0&&(0,H.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,H.jsx)(`li`,{children:(0,H.jsx)(ai,{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,H.jsx)(or,{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,H.jsxs)(B,{onClick:()=>w(null),children:[(0,H.jsx)(Ue,{"aria-hidden":`true`}),`Close`]}),children:C&&(0,H.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`&&E.current>0&&c.length===0)&&(0,H.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,H.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,H.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(` · `):Hr(e.path).dir;return(0,H.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,H.jsx)(`span`,{className:`max-w-full truncate text-body-sm font-medium text-ink`,children:e.name}),r?(0,H.jsx)(`span`,{className:`max-w-full truncate text-body-sm text-muted`,children:r}):null]},e.path)})})]})}}var di={composer:0,tour:0},fi=`forgeqe:on-screen`;function pi(e,t){(0,U.useEffect)(()=>{if(t)return di[e]++,window.dispatchEvent(new Event(fi)),()=>{di[e]--,window.dispatchEvent(new Event(fi))}},[e,t])}function mi(e){let[t,n]=(0,U.useState)(di[e]>0);return(0,U.useEffect)(()=>{let t=()=>n(di[e]>0);return t(),window.addEventListener(fi,t),()=>window.removeEventListener(fi,t)},[e]),t}var hi=e=>pi(`composer`,e),gi=()=>mi(`composer`),_i=()=>pi(`tour`,!0),vi=()=>mi(`tour`),yi=()=>typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`field-sizing: content`);function bi({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:y,mentions:b,combo:x,counted:S=!0}){hi(S);let C=p??t.trim().length>0,w=(0,U.useRef)(null),T=(0,U.useRef)(null),E=Zr(t,fr(t.includes(`/`))),D=E.some(e=>e.mark),O=ar()&&f===2?1:f;return(0,U.useLayoutEffect)(()=>{let e=w.current;e&&!yi()&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[t,O]),(0,H.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a?i?.():C&&!o&&r()},onDragEnter:y?.onDragEnter,onDragOver:y?.onDragOver,onDragLeave:y?.onDragLeave,onDrop:y?.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,H.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`}),b,(0,H.jsx)(`label`,{htmlFor:e,className:`sr-only`,children:c}),d,(0,H.jsxs)(`div`,{className:`relative`,children:[D&&(0,H.jsx)(`div`,{ref:T,"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:E.map((e,t)=>e.mark?(0,H.jsx)(`mark`,{className:`rounded-[5px] bg-surface-strong text-transparent shadow-[0_0_0_2px_var(--color-surface-strong)]`,children:e.text},t):(0,H.jsx)(`span`,{children:e.text},t))}),(0,H.jsx)(`textarea`,{ref:w,id:e,rows:O,style:{minBlockSize:`${O}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=>{T.current&&(T.current.scrollTop=e.currentTarget.scrollTop)},...x?{role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":x.expanded,"aria-controls":x.listId,...x.expanded&&x.activeId?{"aria-activedescendant":x.activeId}:{}}:{},onKeyDown:e=>{h?.(e)||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),!A(e)&&!a&&C&&!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,H.jsxs)(`div`,{className:`mt-2 -ml-2 flex items-center gap-1 short:mt-2`,children:[l,(0,H.jsx)(`div`,{className:`flex-auto`}),u,a?(0,H.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,H.jsx)(Mn,{size:14,fill:`currentColor`,"aria-hidden":`true`})}):(0,H.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`,C&&!o?`bg-accent text-accent-ink hover:bg-accent-hover`:`bg-line text-muted`),children:(0,H.jsx)(wn,{size:20,strokeWidth:2.2,"aria-hidden":`true`})})]})]})}var xi=new Map,Si=!1,Ci=()=>typeof document>`u`?null:document,wi=()=>Ci()?.visibilityState===`hidden`;function Ti(){if(!wi())for(let e of[...xi.values()])e()}function Ei(e,t){let n=setInterval(()=>{wi()||e()},t);xi.set(n,e);let r=Ci();return r&&!Si&&(r.addEventListener(`visibilitychange`,Ti),Si=!0),n}function Di(e){if(e==null)return;clearInterval(e),xi.delete(e);let t=Ci();t&&Si&&xi.size===0&&(t.removeEventListener(`visibilitychange`,Ti),Si=!1)}function Oi({open:e,id:t,className:n,children:r}){let[i,a]=(0,U.useState)(e),[o,s]=(0,U.useState)(e),[c,l]=(0,U.useState)(e);return(0,U.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,H.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,H.jsx)(`div`,{className:g(`min-h-0 min-w-0`,c?`overflow-visible`:`overflow-hidden`),children:(0,H.jsx)(`div`,{className:n,children:r})})}):null}var ki=null,Ai=e=>void(ki=e),ji=/password|secret|token|api.?key|\bkey\b|credential|\bprod(uction)?\b|\bprd\b|\blive\b/i,Mi=1e3,Ni=60,Pi=e=>e.replace(/[\u0000-\u001f\u007f\u2028\u2029]+/g,` `).replace(/\s+/g,` `).trim();function Fi(e){let t=new Set,n=[];for(let r of e){let e=Pi(r.label).slice(0,Ni);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`)&&ji.test(e)))continue;let a=r.value===void 0?void 0:Pi(r.value).slice(0,Ni);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 Ii=e=>e.map(e=>`${e.ref} ${e.kind}: ${e.label}${e.value===void 0?``:` (now: ${e.value||`empty`})`}`).join(`
|
|
5
|
-
`);function Li(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`?Pi(n.text).slice(0,Mi):``;return{ref:n.ref,label:Pi(n.label),text:r}}function Ri(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 zi=()=>/^#\/settings(?:\/|$)/.test(location.hash)&&!/^#\/settings\/secrets/.test(location.hash);function Bi(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 Vi(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 Hi(){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=zi();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(Pi(n(i)))){if(i instanceof HTMLTextAreaElement)a||e.push({kind:r?`setting`:`field`,label:Bi(i)||i.placeholder||`Text`,value:r?Vi(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:Bi(i),value:Vi(i),el:i}):e.push({kind:`field`,label:Bi(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:Bi(i)||n(i),value:Vi(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 Ui=()=>Fi(Hi());function Wi(e){let t=Ui(),n=((document.querySelector(`[data-screen]`)??document.body).innerText||``).replace(/[ \t]+/g,` `).replace(/\n{3,}/g,`
|
|
6
|
-
|
|
7
|
-
`).trim(),r=Ii(t);return`${r?`Controls (page_act takes a ref and its label):\n${r}\n\n`:``}Page text:\n${n}`.slice(0,e)}function Gi(e,t){if(e instanceof HTMLInputElement&&e.type===`checkbox`){let n=Ki(t);return n===null?`Say on or off.`:(e.checked!==n&&e.click(),null)}if(e.getAttribute(`role`)===`switch`){let n=Ki(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 Ki=e=>/^(on|yes|true|enabled?|shown?)$/i.test(e)?!0:!/^(off|no|false|disabled?|hidden)$/i.test(e)&&null;async function qi(e){let t=Li(e);if(!t)return`That is not a control of this page.`;let n=Ri(Ui(),t);if(typeof n==`string`)return n;let r=n.from.el;if(n.kind===`setting`||n.kind===`option`&&zi()){let e=n.kind===`setting`?t.text:n.label;return ki?await ki(n.kind===`setting`?`Change ${n.label} to ${e}?`:`Switch to ${e}?`)?n.kind===`option`?(r.click(),`Switched to ${e}. Settings saves it.`):Gi(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 ki?await ki(`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 Ji=[`open`,`open_run`,`open_chat`,`search`,`back`,`new_chat`,`set`,`read`,`act`],Yi={theme:[`light`,`dark`,`system`],sidebar:[`open`,`closed`],browser:[`shown`,`hidden`],talk:[`off`]},Xi=8e3,Zi=/^(?:latest|last|newest|most recent)?$/i,Qi=/^[A-Za-z0-9_-]{1,80}$/,$i=e=>e.replace(/[\u0000-\u001f\u007f]+/g,` `).trim().slice(0,1200);function ea(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.id!=`string`||!Qi.test(t.id)||!Ji.includes(t.action))return null;let n=typeof t.what==`string`?$i(t.what):void 0;return{id:t.id,action:t.action,...n?{what:n}:{}}}function ta(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=na(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 na(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 ra=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,``);function ia(e,t){let n=ra(t),r=n.length>=4?e.filter(e=>e.kind!==`field`&&ra(e.label)===n):[];return r.length===1?r[0]:void 0}var aa=/^(?:settings\s*[›>:/-]\s*(.+)|(?:the\s+)?(.+?)\s+settings?)$/i;async function oa(e,t){let n=(e.what||``).trim();switch(e.action){case`open`:{let e=await t.commands(),r=aa.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())||ia(e,n):void 0;if(!a){let t=ta(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=Zi.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=Zi.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(Yi,e)?Yi[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?.(Xi)??``).slice(0,Xi);case`act`:return t.actOn?await t.actOn(n):`That cannot be done from here.`}}var sa=new Set;function ca(e,t){sa.has(e.id)||(sa.add(e.id),t(e))}function la(e,t,n,r){let i=(0,U.useRef)(null);(0,U.useEffect)(()=>{if(n&&e){if(i.current!==e){i.current=e;for(let e of t)sa.add(e.id)}else for(let e of t)sa.has(e.id)||(sa.add(e.id),r(e))}},[e,t.length,n])}var ua=(0,U.createContext)(null);function da({pages:e,find:t,set:n,children:r}){let i=(0,U.useRef)(null),a=(0,U.useCallback)(r=>({commands:()=>i.current??=m(()=>import(`./paletteCommands-Bx61jZay.js`).then(t=>t.everyCommand(e)),__vite__mapDeps([0,1,2,3,4,5,6])),runs:async()=>(await ae.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:Wi,actOn:qi}),[e,t,n]),o=(0,U.useCallback)(async(e,t)=>{let n=await oa(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,U.useMemo)(()=>({act:o}),[o]);return(0,H.jsx)(ua.Provider,{value:s,children:r})}function fa(){let e=(0,U.useContext)(ua);return e?e.act:async()=>``}var pa=16e3;function ma(e,t){if(!e.length||!(t>0))return new Int16Array;let n=t/pa,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 ha(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 ga=(0,U.createContext)(null);function _a(){let e=(0,U.useContext)(ga);if(!e)throw Error(`useTalk outside TalkProvider`);return e}var va=e=>{try{return localStorage.getItem(e)}catch{return null}},ya=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},ba=()=>{let e=va(`forgeqe.voice.eagerness`);return e===`eager`||e===`patient`?e:`normal`},xa=e=>ya(`forgeqe.voice.eagerness`,e),Sa=`forgeqe:voice-in-mascot`,Ca=()=>va(`forgeqe.voice.mascot`)!==`off`,wa=e=>{ya(`forgeqe.voice.mascot`,e?`on`:`off`),window.dispatchEvent(new Event(Sa))},Ta=null;function Ea(e=!1){return(e||!Ta)&&(Ta=le.status()),Ta.catch(()=>Ta=null),Ta}var Da=()=>/^#\/chats\/([a-f0-9]{18})(?:[/?]|$)/.exec(location.hash)?.[1]??null,Oa=320;function ka({children:e}){let[t,n]=(0,U.useState)(`off`),[r,i]=(0,U.useState)(null),[a,o]=(0,U.useState)(!1),[s,c]=(0,U.useState)(``),[l,u]=(0,U.useState)(null),d=fa(),f=(0,U.useRef)(null),p=(0,U.useRef)(null),h=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)([]),v=(0,U.useRef)(0),y=(0,U.useRef)(0),b=(0,U.useRef)(new Int16Array),x=(0,U.useRef)({hearing:!1,thinking:!1,speaking:!1}),S=(0,U.useRef)(null),C=(0,U.useRef)(0),w=(0,U.useRef)(new Map),T=(0,U.useCallback)(()=>{let e=x.current;n(e.hearing?`hearing`:e.speaking?`speaking`:e.thinking?`thinking`:`listening`)},[]),E=(0,U.useCallback)(e=>{y.current=e;let t=p.current,n=h.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=_.current;_.current=[],v.current=0,setTimeout(()=>{for(let e of i)try{e.stop()}catch{}n.gain.setValueAtTime(1,t.currentTime)},90),x.current.speaking=!1,T()},[T]),D=(0,U.useCallback)((e,t,n)=>{let r=p.current,i=h.current;if(!r||!i||e<y.current)return;let a=ha(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),v.current=Math.max(v.current,r.currentTime+.04),s.start(v.current),v.current+=o.duration,_.current.push(s),s.onended=()=>{_.current=_.current.filter(e=>e!==s),_.current.length||(x.current.speaking=!1,T())},x.current.speaking=!0,T()},[T]),O=(0,U.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`&&D(t.gen,t.rate,n(t.pcm));break;case`interrupt`:typeof t.gen==`number`&&E(t.gen);break;case`chat`:{if(t.id===null){S.current=null,i(null),u(null);break}let e=n(t.id);if(!/^[a-f0-9]{18}$/.test(e))break;S.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`&&(x.current[e]=t[e]);typeof t.thinking==`boolean`&&o(t.thinking),T();break;case`app_action`:{let e=ea(t);e&&(C.current=Date.now(),ca(e,e=>d(e,S.current??void 0)));break}case`confirmed`:{let e=w.current.get(n(t.id));w.current.delete(n(t.id)),e?.(t.yes===!0);break}case`error`:c(n(t.message).slice(0,300))}},[d,E,D,T]),k=()=>{Ai(null);for(let e of w.current.values())e(!1);w.current.clear();try{f.current?.close()}catch{}f.current=null,g.current?.getTracks().forEach(e=>e.stop()),g.current=null,p.current?.close().catch(()=>{}),p.current=null,h.current=null,_.current=[],v.current=0,b.current=new Int16Array},A=(0,U.useCallback)(()=>{k(),x.current={hearing:!1,thinking:!1,speaking:!1},S.current=null,i(null),u(null),n(`off`),o(!1)},[]),j=(0,U.useCallback)(async e=>{if(!f.current){c(``),n(`connecting`);try{if(!(await Ea()).ready)throw Error(`Speech is not set up on this computer yet: Settings › Voice.`);le.warm().catch(()=>{});let t=new AudioContext;p.current=t;let r=t.createGain();r.connect(t.destination),h.current=r;let a=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,channelCount:1}});g.current=a;let{default:o}=await m(async()=>{let{default:e}=await import(`./capture.worklet-C65DyLpl.js`);return{default:e}},[]);await t.audioWorklet.addModule(o);let s=new AudioWorkletNode(t,`forgeqe-capture`);t.createMediaStreamSource(a).connect(s),s.port.onmessage=e=>{let n=ma(e.data,t.sampleRate),r=new Int16Array(b.current.length+n.length);r.set(b.current),r.set(n,b.current.length);let i=0;for(;r.length-i>=Oa;i+=Oa)f.current?.readyState===WebSocket.OPEN&&f.current.send(r.slice(i,i+Oa).buffer);b.current=r.slice(i)},S.current=e===void 0?Da():e&&/^[a-f0-9]{18}$/.test(e)?e:null,i(S.current);let{ticket:c}=await le.ticket(S.current,ba()),l=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/api/voice/session?ticket=${c}`);l.binaryType=`arraybuffer`,l.onmessage=e=>typeof e.data==`string`&&O(e.data),l.onopen=()=>{x.current={hearing:!1,thinking:!1,speaking:!1},n(`listening`),Ai(e=>new Promise(t=>{if(l.readyState!==WebSocket.OPEN)return t(!1);let n=Math.random().toString(36).slice(2,12);w.current.set(n,t),setTimeout(()=>w.current.get(n)===t&&(w.current.delete(n),t(!1)),35e3),l.send(JSON.stringify({type:`confirm`,id:n,text:e.slice(0,200)}))}))},l.onclose=()=>{f.current===l&&(k(),n(`off`))},f.current=l}catch(e){k(),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)}}},[O]);(0,U.useEffect)(()=>()=>k(),[]),(0,U.useEffect)(()=>{let e=()=>{let e=()=>_.current.length?setTimeout(e,300):A();setTimeout(e,1500)};return window.addEventListener(`forgeqe:talk-off`,e),()=>window.removeEventListener(`forgeqe:talk-off`,e)},[A]),(0,U.useEffect)(()=>{if(t===`off`)return;let e=()=>{if(Date.now()-C.current<3e3)return;let e=Da(),t=location.hash===``||location.hash===`#`||location.hash===`#/`;(e||t)&&(e??null)!==S.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 M=(0,U.useMemo)(()=>({phase:t,chat:r,working:a,error:s,line:l,start:e=>void j(e),end:A,dismiss:()=>c(``)}),[t,r,a,s,l,j,A]);return(0,H.jsx)(ga.Provider,{value:M,children:e})}function Aa({chat:e,disabled:t}){let n=_a(),[r,i]=(0,U.useState)(null);(0,U.useEffect)(()=>{Ea().then(e=>i(e.ready)).catch(()=>i(!1))},[]);let a=Ma(n,e),o=r===!1;return(0,H.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,H.jsx)(zt,{"aria-hidden":`true`})})}function ja({chat:e}){let t=_a(),n=Ma(t,e);if(!n&&!t.error)return null;let r=n&&t.phase!==`thinking`;return(0,H.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,H.jsxs)(`div`,{className:`flex min-h-7 flex-wrap items-center gap-x-2 gap-y-1`,children:[r?(0,H.jsx)(_e,{state:Pa[t.phase],px:18}):(0,H.jsx)(zt,{size:16,"aria-hidden":`true`,className:`text-muted`}),(0,H.jsx)(`span`,{className:`font-medium`,children:n?Na[t.phase]:`Talk stopped`}),n&&(0,H.jsx)(`span`,{className:`text-muted`,children:`Talk over Atlas any time; it stops and listens.`}),(0,H.jsx)(`span`,{className:`flex-auto`}),n?(0,H.jsx)(B,{size:`sm`,variant:`ghost`,onClick:t.end,children:`End`}):(0,H.jsx)(B,{variant:`icon`,size:`icon-xs`,type:`button`,"aria-label":`Close the note`,"data-tip":`Close the note`,onClick:t.dismiss,children:(0,H.jsx)(Ue,{size:14,"aria-hidden":`true`})})]}),t.error&&(0,H.jsx)(`p`,{className:g(ge.fail,`m-0`),children:t.error})]})}var Ma=(e,t)=>e.phase!==`off`&&(e.chat??null)===t,Na={off:`Talk stopped`,connecting:`Starting Talk…`,listening:`Listening. Just talk.`,hearing:`Hearing you…`,thinking:`Listening while Atlas works.`,speaking:`Speaking.`},Pa={off:`idle`,connecting:`waiting`,listening:`waiting`,hearing:`recording`,thinking:`thinking`,speaking:`writing`},Fa={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`},Ia={md:`size-9`,lg:`size-10`,xl:`size-14`},La={md:18,lg:20,xl:28},Ra={md:20,lg:24,xl:32},za={md:`size-[18px]`,lg:`size-5`,xl:`size-7`};function Ba({icon:e,picked:t,onPick:n,label:r,size:i=`lg`}){return(0,H.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,H.jsx)(Va,{icon:e,size:i,tone:t?`info`:void 0}),t&&(0,H.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,H.jsx)(z,{icon:Ln,size:10})})]})}function Va({icon:e,logo:t,pixel:n,tone:r,size:i=`md`,head:a,className:o}){return a?(0,H.jsx)(`span`,{"aria-hidden":`true`,className:g(`inline-flex size-10 flex-none items-center justify-center text-ink-2`,o),children:n?(0,H.jsx)(f,{name:n,px:40}):t?(0,H.jsx)(t,{className:`size-8`}):e?(0,H.jsx)(z,{icon:e,size:32}):null}):(0,H.jsx)(`span`,{"aria-hidden":`true`,"data-icon-tile":``,className:g(`inline-flex flex-none items-center justify-center rounded-base`,l,r&&Fa[r],Ia[i],o),children:n?(0,H.jsx)(f,{name:n,px:Ra[i]}):t?(0,H.jsx)(t,{className:za[i]}):e?(0,H.jsx)(z,{icon:e,size:La[i]}):null})}var W=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{};function Ha(e,t){let n=e;for(let e of t)n=W(n)[e];return n}var Ua=e=>e===void 0||e===``||typeof e==`number`&&Number.isNaN(e);function Wa(e,t,n){let[r,...i]=t;if(r===void 0)return e;let a={...e},o=i.length?Wa(W(e[r]),i,n):n;return Ua(o)||i.length&&Ua(n)&&!Object.keys(W(o)).length?delete a[r]:a[r]=o,a}function Ga(e,t,n){let r={};for(let[i,a]of Object.entries(e))r[i===t?n:i]=a;return r}function Ka(e,t){if(!(t in e))return t;for(let n=2;;n++)if(!(`${t}-${n}`in e))return`${t}-${n}`}var qa=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ja=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 150`,width:`2.06em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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,H.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`})]})),Ya=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 315`,width:`0.99em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),Xa=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 242`,width:`1.28em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`defs`,{children:[(0,H.jsxs)(`linearGradient`,{id:`SVG4V795Kgq`,x1:`58.972%`,x2:`37.191%`,y1:`7.411%`,y2:`103.762%`,children:[(0,H.jsx)(`stop`,{offset:`0%`,stopColor:`#114a8b`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#0669bc`})]}),(0,H.jsxs)(`linearGradient`,{id:`SVGzpurqcJr`,x1:`59.719%`,x2:`52.691%`,y1:`52.313%`,y2:`54.864%`,children:[(0,H.jsx)(`stop`,{offset:`0%`,stopOpacity:.3}),(0,H.jsx)(`stop`,{offset:`7.1%`,stopOpacity:.2}),(0,H.jsx)(`stop`,{offset:`32.1%`,stopOpacity:.1}),(0,H.jsx)(`stop`,{offset:`62.3%`,stopOpacity:.05}),(0,H.jsx)(`stop`,{offset:`100%`,stopOpacity:0})]}),(0,H.jsxs)(`linearGradient`,{id:`SVGZ5kCkZNr`,x1:`37.279%`,x2:`62.473%`,y1:`4.6%`,y2:`99.979%`,children:[(0,H.jsx)(`stop`,{offset:`0%`,stopColor:`#3ccbf4`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#2892df`})]})]}),(0,H.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,H.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,H.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,H.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`})]})),Za=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`defs`,{children:(0,H.jsxs)(`radialGradient`,{id:`SVGwZwAicDR`,cx:`50.141%`,cy:`50.003%`,r:`50.119%`,fx:`50.141%`,fy:`50.003%`,children:[(0,H.jsx)(`stop`,{offset:`0%`,stopColor:`#797979`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#4c4c4c`})]})}),(0,H.jsx)(`circle`,{cx:127.949,cy:128.603,r:127.397,fill:`#f5bb60`}),(0,H.jsx)(`circle`,{cx:114.961,cy:115.615,r:114.685,fill:`#e86f32`}),(0,H.jsx)(`circle`,{cx:130.16,cy:100.416,r:99.485,fill:`#e53d42`}),(0,H.jsx)(`circle`,{cx:138.174,cy:108.43,r:91.471,fill:`#bfd141`}),(0,H.jsx)(`circle`,{cx:131.542,cy:115.062,r:84.839,fill:`#6db64c`}),(0,H.jsx)(`circle`,{cx:118.001,cy:101.798,r:71.298,fill:`#afdbe7`}),(0,H.jsx)(`circle`,{cx:129.607,cy:89.915,r:59.691,fill:`#57badf`}),(0,H.jsx)(`circle`,{cx:137.069,cy:97.376,r:52.506,fill:`#02b2d6`}),(0,H.jsx)(`circle`,{cx:129.331,cy:104.837,r:44.768,fill:`url(#SVGwZwAicDR)`}),(0,H.jsx)(`circle`,{cx:129.331,cy:104.837,r:44.768,fill:`#231f20`}),(0,H.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`})]})),Qa=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 257`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),$a=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 246`,width:`1.26em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`defs`,{children:[(0,H.jsxs)(`linearGradient`,{id:`SVGvnhR7dox`,x1:`99.14%`,x2:`33.859%`,y1:`112.708%`,y2:`37.755%`,children:[(0,H.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]}),(0,H.jsxs)(`linearGradient`,{id:`SVGgker3cTp`,x1:`.926%`,x2:`66.18%`,y1:`-12.582%`,y2:`62.306%`,children:[(0,H.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]})]}),(0,H.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,H.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`})]})),eo=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 208`,width:`1.49em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),to=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 250`,width:`1.24em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),no=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 247`,width:`1.25em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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,H.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,H.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,H.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`})]})),ro=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 206`,width:`1.5em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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,H.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,H.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,H.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`})]})),io=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`defs`,{children:[(0,H.jsxs)(`filter`,{id:`SVGqoIxVV2h`,width:39.274,height:43.217,x:-19.824,y:13.152,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:2.46})]}),(0,H.jsxs)(`filter`,{id:`SVGOahAkcjC`,width:84.868,height:85.688,x:-15.001,y:-40.257,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:11.891})]}),(0,H.jsxs)(`filter`,{id:`SVGyT4fLePl`,width:79.454,height:90.917,x:-20.776,y:11.927,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:10.109})]}),(0,H.jsxs)(`filter`,{id:`SVGonSETbRF`,width:79.731,height:81.505,x:-19.845,y:15.459,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:10.109})]}),(0,H.jsxs)(`filter`,{id:`SVGSN7ofz6B`,width:75.117,height:73.758,x:29.832,y:-11.552,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:9.606})]}),(0,H.jsxs)(`filter`,{id:`SVGHvbpPvOn`,width:78.135,height:78.758,x:-38.583,y:-16.253,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:8.706})]}),(0,H.jsxs)(`filter`,{id:`SVG7JmfweRd`,width:78.877,height:77.539,x:8.107,y:-5.966,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:7.775})]}),(0,H.jsxs)(`filter`,{id:`SVGgGkiybCN`,width:56.272,height:51.81,x:13.587,y:-18.488,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:6.957})]}),(0,H.jsxs)(`filter`,{id:`SVGxEY6lcrm`,width:70.856,height:69.306,x:-15.526,y:-31.297,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:5.876})]}),(0,H.jsxs)(`filter`,{id:`SVGMZLCp0yD`,width:55.502,height:51.571,x:-14.168,y:20.964,colorInterpolationFilters:`sRGB`,filterUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`feFlood`,{floodOpacity:0,result:`BackgroundImageFix`}),(0,H.jsx)(`feBlend`,{in:`SourceGraphic`,in2:`BackgroundImageFix`,result:`shape`}),(0,H.jsx)(`feGaussianBlur`,{result:`effect1_foregroundBlur_10859_4895`,stdDeviation:7.273})]}),(0,H.jsxs)(`linearGradient`,{id:`SVG1oAMmOOu`,x1:18.447,x2:52.153,y1:43.42,y2:15.004,gradientUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`stop`,{stopColor:`#4893fc`}),(0,H.jsx)(`stop`,{offset:.27,stopColor:`#4893fc`}),(0,H.jsx)(`stop`,{offset:.777,stopColor:`#969dff`}),(0,H.jsx)(`stop`,{offset:1,stopColor:`#bd99fe`})]})]}),(0,H.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,H.jsx)(`g`,{filter:`url(#SVGqoIxVV2h)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVGOahAkcjC)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.jsx)(`ellipse`,{cx:27.433,cy:2.587,fill:`#fc413d`,rx:18.652,ry:19.062})}),(0,H.jsx)(`g`,{filter:`url(#SVGyT4fLePl)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVGyT4fLePl)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVGonSETbRF)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVGSN7ofz6B)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.jsx)(`ellipse`,{cx:67.391,cy:25.327,fill:`#3186ff`,rx:18.346,ry:17.667})}),(0,H.jsx)(`g`,{filter:`url(#SVGHvbpPvOn)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVG7JmfweRd)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVGgGkiybCN)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVGxEY6lcrm)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsx)(`g`,{filter:`url(#SVGMZLCp0yD)`,mask:`url(#SVGWpw6Gcvj)`,transform:`translate(-.101 -.049)scale(3.9436)`,children:(0,H.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,H.jsxs)(`mask`,{id:`SVGWpw6Gcvj`,width:65,height:65,x:0,y:0,maskUnits:`userSpaceOnUse`,style:{maskType:`alpha`},children:[(0,H.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,H.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`})]})]})),ao=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 231`,width:`1.34em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`defs`,{children:(0,H.jsxs)(`linearGradient`,{id:`SVGR9diIphF`,x1:`108.633%`,x2:`46.927%`,y1:`13.818%`,y2:`78.776%`,children:[(0,H.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]})}),(0,H.jsxs)(`g`,{fill:`none`,children:[(0,H.jsx)(`path`,{d:`M101.272 152.561h53.449l12.901-75.319H87.06z`}),(0,H.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,H.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`})]})]})),oo=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`defs`,{children:[(0,H.jsxs)(`linearGradient`,{id:`SVGSBI7obaC`,x1:`98.031%`,x2:`58.888%`,y1:`.161%`,y2:`40.766%`,children:[(0,H.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]}),(0,H.jsxs)(`linearGradient`,{id:`SVGHifZlbzE`,x1:`100.665%`,x2:`55.402%`,y1:`.455%`,y2:`44.727%`,children:[(0,H.jsx)(`stop`,{offset:`18%`,stopColor:`#0052cc`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#2684ff`})]})]}),(0,H.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,H.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,H.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`})]})),so=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 339`,width:`0.92em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),co=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 260`,width:`1.19em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),lo=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.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`})]})),uo=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 227`,width:`1.36em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),fo=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 239`,width:`1.3em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsxs)(`defs`,{children:[(0,H.jsxs)(`linearGradient`,{id:`SVGCo9xpmZW`,x1:`17.372%`,x2:`82.628%`,y1:`-6.51%`,y2:`106.51%`,children:[(0,H.jsx)(`stop`,{offset:`0%`,stopColor:`#5a62c3`}),(0,H.jsx)(`stop`,{offset:`50%`,stopColor:`#4d55bd`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`#3940ab`})]}),(0,H.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,H.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,H.jsx)(`circle`,{cx:223.256,cy:50.605,r:26.791,fill:`#5059c9`}),(0,H.jsx)(`circle`,{cx:139.907,cy:38.698,r:38.698,fill:`#7b83eb`}),(0,H.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,H.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,H.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,H.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,H.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,H.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,H.jsx)(`use`,{href:`#SVGhJCUgeMn`,opacity:.2}),(0,H.jsx)(`use`,{href:`#SVGhJCUgeMn`,opacity:.2}),(0,H.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,H.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,H.jsx)(`path`,{fill:`#fff`,d:`M94.208 95.125h-21.82v59.416H58.487V95.125H36.769V83.599h57.439z`})]})),po=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`path`,{fill:`#0078d4`,d:`M0 0h121.329v121.329H0zm134.671 0H256v121.329H134.671zM0 134.671h121.329V256H0zm134.671 0H256V256H134.671z`})]})),mo=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 128 128`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.jsx)(`defs`,{children:(0,H.jsxs)(`linearGradient`,{id:`SVG6uMEBcPj`,x1:9,x2:9,y1:16.97,y2:1.03,gradientTransform:`scale(7.11111)`,gradientUnits:`userSpaceOnUse`,children:[(0,H.jsx)(`stop`,{offset:0,stopColor:`#0078d4`}),(0,H.jsx)(`stop`,{offset:.16,stopColor:`#1380da`}),(0,H.jsx)(`stop`,{offset:.53,stopColor:`#3c91e5`}),(0,H.jsx)(`stop`,{offset:.82,stopColor:`#559cec`}),(0,H.jsx)(`stop`,{offset:1,stopColor:`#5ea0ef`})]})}),(0,H.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`})]})),ho=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 128 128`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),go=(0,U.forwardRef)(({title:e,titleId:t,...n},r)=>(0,H.jsxs)(`svg`,{viewBox:`0 0 128 128`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,H.jsx)(`title`,{id:t,children:e}):null,(0,H.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`})]})),_o=`/assets/dataverse-CH0w-aF1.png`,vo=`/assets/zephyr-BNWDPG5u.png`,yo=(e,t,n)=>r=>(0,H.jsx)(`svg`,{viewBox:`0 0 ${t} ${n}`,...r,children:(0,H.jsx)(`image`,{href:e,width:t,height:n})}),bo=e=>(0,H.jsxs)(`svg`,{viewBox:`-55 0 209 209`,...e,children:[(0,H.jsx)(`path`,{fill:`#31b34b`,d:`m98.092 104.307l-49.011 12.252l-24.54 91.807z`,opacity:`.5`}),(0,H.jsx)(`path`,{fill:`#31b34b`,d:`M98.092 104.307L0 129.024V67.443h73.551l24.718 36.828z`,opacity:`.8`}),(0,H.jsx)(`path`,{fill:`#31b34b`,d:`M0 67.443v61.44L73.551 0z`})]}),xo=e=>(0,H.jsxs)(`svg`,{viewBox:`0 0 256 153`,...e,children:[(0,H.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,H.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`})]}),So=e=>(0,H.jsxs)(`svg`,{viewBox:`0 0 18.02 20.27`,fill:`#000`,...e,children:[(0,H.jsx)(`path`,{d:`M18.0137 0H12.6097V13.0595H18.0137V0Z`}),(0,H.jsx)(`path`,{d:`M5.4043 0H0V7.43041L5.4043 13.0595V0Z`}),(0,H.jsx)(`path`,{d:`M5.4043 13.0595H0V20.2648H5.4043V13.0595Z`}),(0,H.jsx)(`path`,{d:`M12.6104 13.0595H5.4051L9.68322 18.4634H12.6104V13.0595Z`})]}),Co=e=>t=>(0,H.jsx)(e,{...t,className:g(t.className,`logo-mono`)}),wo={jira:oo,azure_devops:mo,confluence:$a,testrail:go,qtest:ho,github:Co(to),browserstack:Za,xray:bo,gitlab:no,bitbucket:ao,postman:lo,sentry:Co(uo),testmu:Co(So),zephyr:yo(vo,128,128),dataverse:yo(_o,128,98),aws:xo,gcp:ro},To={openai:Co(co),azure:Xa,github_copilot:Co(eo),ollama:Co(so),anthropic:Qa,gemini:io,bedrock:xo},Eo={android:Ja,ios:Co(Ya),windows:po},Do=new Set([``,`settings`,`welcome`,`agents`]);function Oo(e){return e.replace(/(?<![\\/])[\\/]+$/,``).split(/[\\/]/).pop()||e}function ko({page:e,children:t}){let[n,i]=(0,U.useState)(null),a=Do.has(e);return(0,U.useEffect)(()=>{if(a||n?.ready)return;let e=!0;return de.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,H.jsx)(`div`,{className:`px-6 py-16`,children:(0,H.jsxs)(R,{center:!0,icon:ct,title:`Set up ForgeQE to use this page`,action:(0,H.jsx)(`a`,{className:g(he({variant:`primary`})),href:r(`settings`,`setup`),children:`Set up`}),children:[`ForgeQE is not set up in `,Oo(n.project),` yet. Choose your project folder in Settings and set it up there; this page opens once it is.`]})})}function Ao(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 jo(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 Mo({item:e,onOpen:t,onDone:n,innerRef:r}){return(0,H.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(a,`gap-2`),children:[(0,H.jsx)(z,{icon:e.icon,size:16,className:`flex-none text-muted`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.dot&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 flex-none rounded-full bg-accent`}),e.value&&(0,H.jsx)(`span`,{className:`max-w-[45%] truncate text-body-sm text-muted`,children:e.value}),e.panel&&(0,H.jsx)(ot,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`})]})}function No({items:e,label:t=`More`}){let[n,r]=(0,U.useState)(!1),[i,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(``),[l,u]=(0,U.useState)(`next`),[d,f]=(0,U.useState)(),p=(0,U.useRef)(null),m=(0,U.useRef)({}),h=(0,U.useRef)(null),_=(0,U.useCallback)(()=>{r(!1),o(``),c(``)},[]),v=(0,U.useCallback)(()=>{c(i),u(`back`),o(``)},[i]),y=(0,U.useCallback)(e=>{u(`next`),o(e)},[]);(0,U.useEffect)(()=>{if(n){if(i)return h.current?.focus();s&&(m.current[s]?.focus(),c(``))}},[n,i,s]);let b=e.find(e=>e.id===i&&!!e.panel);(0,U.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,H.jsxs)(`div`,{className:`relative`,children:[(0,H.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,H.jsx)(xt,{"aria-hidden":`true`}),x&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-accent`})]}),(0,H.jsx)(w,{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,H.jsx)(`div`,{className:`overflow-hidden transition-[height] duration-[var(--motion)] ease-[var(--ease-out)]`,style:d===void 0?void 0:{height:d},children:(0,H.jsx)(`div`,{ref:p,className:l===`next`?`pane-next`:`pane-back`,children:b?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{ref:h,type:`button`,onClick:v,className:g(a,`min-h-9 gap-2 font-medium text-ink-2`),children:[(0,H.jsx)(Pt,{size:16,"aria-hidden":`true`}),`Back`]}),b.panel]}):e.map(e=>(0,H.jsx)(Mo,{item:e,onOpen:y,onDone:_,innerRef:t=>{m.current[e.id]=t}},e.id))},i||`rows`)})})]}):null}function Po(e,t){return t&&!e.some(e=>e.id===`attach`)?[...e,t]:[...e]}function Fo({checked:e,onChange:t,label:n,id:r,disabled:i}){return(0,H.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,H.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 Io(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 Lo={azure:`Azure OpenAI`,openai:`OpenAI`,ollama:`Ollama`,openai_compatible:`OpenAI-compatible`,github_copilot:`GitHub Copilot`,github:`GitHub Models`,anthropic:`Anthropic`};function Ro({children:e}){return(0,H.jsx)(`div`,{className:`px-4 pt-2 pb-1 text-body-sm font-medium text-muted`,children:e})}function zo({tools:e,onChange:t,chat:n}){let i=(n,r,i,o)=>(0,H.jsxs)(`label`,{className:a,children:[(0,H.jsx)(Va,{icon:n}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`text-body-sm font-medium text-ink`,children:i}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:o})]}),(0,H.jsx)(Fo,{checked:e[r],label:i,onChange:n=>t({...e,[r]:n})})]}),o=(e,t,n)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-2`,children:[(0,H.jsx)(z,{icon:e,size:16,className:`flex-none text-muted`}),(0,H.jsx)(`span`,{className:`flex-1 text-body-sm text-ink-2`,children:t}),(0,H.jsx)(`span`,{className:`truncate text-body-sm text-ink`,children:n})]});return(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsx)(Ro,{children:n?`This chat, from your next message`:`This chat`}),i(Ct,`code`,`Write the test`,`Turn a passed run into a test in ${e.repo}`),i(xn,`headed`,`Show the browser`,`Watch each run in a Chrome window`),(0,H.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,H.jsx)(Ro,{children:`From your settings`}),o(ht,`Browsers run on`,e.browser),o(Bt,`Test cases from`,e.cases),n?.model&&(0,H.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-2`,children:[To[n.provider||``]?(()=>{let e=To[n.provider||``];return(0,H.jsx)(e,{"aria-hidden":`true`,className:`size-4 flex-none`})})():(0,H.jsx)(z,{icon:Vt,size:16,className:`flex-none text-muted`}),(0,H.jsx)(`span`,{className:`flex-1 text-body-sm text-ink-2`,children:`Model`}),(0,H.jsx)(`span`,{className:`truncate text-body-sm text-ink`,children:n.model})]}),(0,H.jsx)(`div`,{className:`mx-2 mt-1 mb-1 flex flex-wrap gap-x-1`,children:(0,H.jsxs)(`a`,{href:r(`settings`),className:g(a,`min-h-9 gap-2 px-2 font-medium`),children:[(0,H.jsx)(mn,{size:14,"aria-hidden":`true`}),`Change them in Settings`]})})]})}function Bo({models:e,current:t,onPick:n,auto:i=!0}){let o=(e,r=!1)=>{let i=t===e.name;return(0,H.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":i,onClick:()=>n(e.name),className:a,children:[r?(0,H.jsx)(Va,{icon:Vt}):To[e.provider]?(0,H.jsx)(Va,{logo:To[e.provider]}):(0,H.jsx)(Va,{icon:qn}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm font-medium text-ink`,children:e.name}),!r&&Lo[e.provider]&&(0,H.jsx)(`span`,{className:`flex-none text-body-sm text-muted`,children:Lo[e.provider]})]}),e.note&&(0,H.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:e.note})]}),(0,H.jsx)(Ln,{size:16,"aria-hidden":`true`,className:g(`flex-none text-accent-fg`,!i&&`invisible`)})]},e.name)};return(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsx)(Ro,{children:`Model for this chat`}),i&&o({name:`Auto routing`,provider:``,note:`The most capable model plans; each step gets the model that suits it`},!0),e.length>0&&(0,H.jsxs)(H.Fragment,{children:[i&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,H.jsx)(Ro,{children:`Your models`})]}),(0,H.jsx)(`div`,{className:`flex flex-col`,children:e.map(e=>o(e))})]}),(0,H.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,H.jsxs)(`a`,{href:r(`settings`,`models`),className:g(a,`mx-2 mb-1 min-h-9 w-auto gap-2 px-2 font-medium`),children:[(0,H.jsx)(mn,{size:14,"aria-hidden":`true`}),`Manage models`]})]})}var Vo={web:ht,api:On,desktop:Ie,mobile:vn};function Ho({icon:e,label:t,value:n}){return(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 px-4 py-1 text-body-sm`,children:[(0,H.jsx)(z,{icon:e,size:14,className:`mt-1 flex-none text-muted`}),(0,H.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,H.jsx)(`span`,{className:`font-medium text-ink`,children:t}),n&&(0,H.jsxs)(`span`,{className:`text-muted`,children:[` `,n]})]})]})}function Uo({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,H.jsxs)(`div`,{className:`flex flex-col pb-1`,children:[(0,H.jsxs)(Ro,{children:[`What the agent gets in `,e.name]}),(0,H.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[s&&(0,H.jsx)(Ho,{icon:Hn,label:`Read from`,value:s}),n.map(e=>(0,H.jsx)(Ho,{icon:Vo[String(e.kind||`web`)]||ht,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,H.jsx)(Ho,{icon:ut,label:`Values`,value:r.map(([e,t])=>`${e} = ${String(t??``)}`).join(`, `)}),i.length>0&&(0,H.jsx)(Ho,{icon:Rt,label:`Test data`,value:i.map(([e,t])=>`${e}: ${String(t)}`).join(`, `)}),a.length>0&&(0,H.jsx)(Ho,{icon:kn,label:`Databases`,value:a.join(`, `)}),o.length>0&&(0,H.jsx)(Ho,{icon:pt,label:`Secrets, by name`,value:o.join(`, `)}),c&&(0,H.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 Wo({envs:e,current:t,onPick:n}){let i=e.find(e=>e.name===t);return(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsx)(Ro,{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,H.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r,onClick:()=>n(e.name),className:a,children:[(0,H.jsx)(Va,{icon:Dn}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm font-medium text-ink`,children:e.name}),i&&(0,H.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:i})]}),(0,H.jsx)(Ln,{size:16,"aria-hidden":`true`,className:g(`flex-none text-accent-fg`,!r&&`invisible`)})]},e.name)}):(0,H.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,H.jsx)(Uo,{row:i})]}),(0,H.jsx)(`div`,{className:`mx-4 my-2 border-t border-line-soft`}),(0,H.jsxs)(`a`,{href:r(`settings`,`environments`),className:g(a,`mx-2 mb-1 min-h-9 w-auto gap-2 px-2 font-medium`),children:[(0,H.jsx)(mn,{size:14,"aria-hidden":`true`}),`Manage environments`]})]})}function Go(){let[e,t]=(0,U.useState)(null),[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)(()=>Io(null)),[u,d]=(0,U.useState)(``);(0,U.useEffect)(()=>{de.state().then(e=>{r(e),e.ready&&de.machine().then(a,()=>{}),e.ready&&oe.settings().then(e=>{t(e),l(Io(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}=jo(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 Ko({attach:e,choice:t,started:n,before:r=[]}){let i=qo(n),a=Po(r,e&&{id:`attach`,icon:on,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:On,label:`Environment`,value:t.environment||`None`,panel:(0,H.jsx)(Wo,{envs:t.envs,current:t.environment,onPick:t.setEnvName}),panelLabel:`Environment for this chat`},{id:`tools`,icon:Tt,label:`Tools`,dot:t.tools.headed||!t.tools.code,panel:(0,H.jsx)(zo,{tools:t.tools,onChange:t.setTools}),panelLabel:`Tools for this chat`}),n&&i&&a.push({id:`chat-tools`,icon:Tt,label:`Tools`,dot:i.tools.headed||!i.tools.code,disabled:n.ended,panel:(0,H.jsx)(zo,{tools:i.tools,chat:{model:n.thread.model?.name,provider:n.thread.model?.provider},onChange:i.change}),panelLabel:`Tools for this chat`}),(0,H.jsx)(No,{items:a})}function qo(e){let[t,n]=(0,U.useState)({}),r=e?.thread.headed,i=e?.thread.writeTests;if((0,U.useEffect)(()=>n({}),[r,i]),!e)return null;let a={...Io(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 Jo({c:e}){let[t,n]=(0,U.useState)(!1),r=e.profiles.find(t=>t.name===e.current)?.provider||``,i=e.current===`Auto routing`?void 0:To[r];return(0,H.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,H.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,H.jsx)(i,{"aria-hidden":`true`,className:`size-4`}):(0,H.jsx)(Tn,{"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`hidden truncate sm:inline`,children:e.current}),(0,H.jsx)(V,{size:16,"aria-hidden":`true`,className:`hidden sm:block`})]}),(0,H.jsx)(w,{open:t,onClose:()=>n(!1),label:`Model`,align:`end`,className:`w-[min(400px,calc(100vw-48px))]`,children:(0,H.jsx)(Bo,{models:e.profiles,current:e.current,onPick:t=>{e.setModel(t),n(!1)}})})]})}function Yo({chat:e,thread:t,ended:n,busy:r,snap:i,onError:a}){let[o,s]=(0,U.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=To[t.model?.provider||``],f=u.length<2;return(0,H.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,H.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,H.jsx)(d,{"aria-hidden":`true`,className:`size-4`}):(0,H.jsx)(Tn,{"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`hidden truncate sm:inline`,children:c}),!f&&(0,H.jsx)(V,{size:16,"aria-hidden":`true`,className:`hidden sm:block`})]}),(0,H.jsx)(w,{open:o,onClose:()=>s(!1),label:`Model`,align:`end`,className:`w-[min(400px,calc(100vw-48px))]`,children:(0,H.jsx)(Bo,{models:u,current:c,auto:!1,onPick:t=>{s(!1),t!==c&&L.model(e,t).catch(e=>a(e.message))}})})]})}function Xo({project:e}){return(0,H.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,H.jsx)(z,{icon:He,size:20,className:`flex-none text-icon`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Set up ForgeQE first`}),(0,H.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 `,Oo(e),` yet.`]})]}),(0,H.jsxs)(`a`,{className:g(he({variant:`primary`}),`short:min-h-8 short:px-4 short:text-body-sm`),href:r(`settings`,`setup`),children:[(0,H.jsx)(mn,{"aria-hidden":`true`}),`Set up`]})]})}function Zo({c:e}){let t=Ao(e.machine,e.choice.profile);return t.length?(0,H.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,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-4 short:gap-y-2`,children:[(0,H.jsx)(z,{icon:e.fix.startsWith(`Add`)?pt:nn,size:20,className:`flex-none text-icon`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:e.detail})]}),(0,H.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,H.jsx)(xt,{"aria-hidden":`true`}):(0,H.jsx)(nn,{"aria-hidden":`true`}),e.fix.split(` `)[0]]})]},e.title))}):null}function Qo(e){return{label:`All agents`,href:r(`agents`)}}var $o=`orchestrator`;function es(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 ts=(e,t)=>t.filter(t=>es(t)?.id===e.id);function ns(e,t){if(e[0]!==`chats`||!e[1]||!t)return e;let n=es(t);return n&&n.agent!==`forgeqe`?[`agents`,n.id]:e}function rs(e){let t=e[0]===`chats`?e[1]:void 0,[n,r]=(0,U.useState)(null);return(0,U.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]),ns(e,n&&n.id===t?n:null)}var is=`rounded-base border border-line bg-bg shadow-none in-[.rounded-lg.bg-bg]:shadow-none`,as=`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,os=`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,ss=`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,cs=`h-12 cursor-pointer border-t border-line-soft align-middle transition-colors duration-150 hover:bg-tint data-[state=selected]:bg-tint-hover`,ls=`px-4 py-2`,us=`px-4 py-2 text-right whitespace-nowrap tabular-nums`,ds=`w-full max-w-0 px-4 py-2`,fs=`block truncate font-medium text-ink`,ps=`block truncate text-body-sm text-muted`,ms=new Set([`className`,`style`,`key`,`ref`,`id`,`role`,`type`,`colSpan`,`rowSpan`,`scope`,`data-tip-side`]);function hs(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=>hs(e,t+1)).join(` `);if((0,U.isValidElement)(e))return hs(e.props,t+1);if(typeof e==`object`){let n=[];for(let[r,i]of Object.entries(e))ms.has(r)||r.startsWith(`on`)||r.startsWith(`aria-`)||n.push(hs(i,t+1));return n.join(` `)}return``}function gs(e){return U.Children.toArray((0,U.isValidElement)(e)&&e.type===U.Fragment?e.props.children:e)}function _s(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=>_s(e,t+1)).join(` `);if(!(0,U.isValidElement)(e))return``;let n=e.props;return typeof n.className==`string`&&/(^|\s)sr-only(\s|$)/.test(n.className)||n.onCheckedChange!==void 0?``:_s(n.children,t+1)}function vs(e){return(0,U.isValidElement)(e)?e.type===`tr`?e:e.type===U.Fragment?U.Children.toArray(e.props.children).find(e=>(0,U.isValidElement)(e)&&e.type===`tr`)??null:null:null}var ys=/^[-+]?(?:\d{1,3}(?:,\d{3})+|\d+)?(?:\.\d+)?\s*(?:%|ms|s|m|h|d|x|kb|mb|gb)?$/i;function bs(e){if(!(0,U.isValidElement)(e))return``;let t=e.props,n=t[`data-sort`];if(typeof n==`number`)return n;if(typeof n==`string`)return ys.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=_s(t.children).replace(/\s+/g,` `).trim();return i&&/\d/.test(i)&&ys.test(i)?Number.parseFloat(i.replace(/,/g,``)):i.toLowerCase()}function xs(e,t,n){if(!t.size||!(0,U.isValidElement)(e))return e;let r=e=>{let r=U.Children.toArray(e.props.children);return r.length===n?(0,U.cloneElement)(e,void 0,r.filter((e,n)=>!t.has(n))):e};return e.type===`tr`?r(e):e.type===U.Fragment?(0,U.cloneElement)(e,void 0,U.Children.toArray(e.props.children).map(e=>(0,U.isValidElement)(e)&&e.type===`tr`?r(e):e)):e}function Ss(e){if(!(0,U.isValidElement)(e))return e;if(e.type===`tr`)return(0,U.cloneElement)(e,{"data-row":``});if(e.type===U.Fragment){let t=!1;return(0,U.cloneElement)(e,void 0,U.Children.toArray(e.props.children).map(e=>t||!(0,U.isValidElement)(e)||e.type!==`tr`?e:(t=!0,(0,U.cloneElement)(e,{"data-row":``}))))}return e}function Cs({on:e,dir:t,num:n,onClick:r,children:i}){let a=e&&t===`asc`?wn:$t;return(0,H.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,H.jsx)(a,{size:12,"aria-hidden":`true`,className:`flex-none`}):(0,H.jsx)(je,{size:12,"aria-hidden":`true`,className:`flex-none opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100`})]})}function ws({label:e,head:t,children:n,empty:r=`None.`,size:a=25,resetKey:o,fixed:s=!1,minWidth:c,className:l,search:d=!0,sortable:f=!0,columns:p=!0,placeholder:m,tools:h,end:_,selection:v,height:y,count:b=!0,framed:x=!1}){let S=U.Children.toArray(n),[C,w]=(0,U.useState)(``),T=C.toLowerCase().split(/\s+/).filter(Boolean),E=(0,U.useMemo)(()=>d?S.map(e=>hs(e).toLowerCase()):[],[n,d]),D=T.length?S.filter((e,t)=>T.every(e=>E[t].includes(e))):S,O=gs(t),k=O.map(e=>(0,U.isValidElement)(e)&&e.type===`th`?_s(e.props.children).replace(/\s+/g,` `).trim():``),A=(0,U.useMemo)(()=>S.every(e=>vs(e)?U.Children.toArray(vs(e).props.children).length===O.length:!1),[n,O.length]),[j,M]=(0,U.useState)(null),ee=f&&A&&S.length>1,N=(0,U.useMemo)(()=>{if(!ee||!j||!k[j.col])return D;let e=j.dir===`asc`?1:-1;return D.map(e=>({r:e,v:bs(U.Children.toArray(vs(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?bs(U.Children.toArray(vs(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,U.useState)([]),re=new Set(I.map(Number).filter(e=>F.includes(e))),ie=O.map((e,t)=>{if(!ee||!k[t]||!(0,U.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,U.cloneElement)(n,{"aria-sort":r?j.dir===`asc`?`ascending`:`descending`:`none`},(0,H.jsx)(Cs,{on:r,dir:j?.dir??`asc`,num:i,onClick:()=>P(t),children:n.props.children}))}).filter((e,t)=>!re.has(t)),L=F.length>=2?(0,H.jsx)(ks,{columns:F.map(e=>({id:String(e),label:k[e]})),hidden:I,onChange:ne}):null,[ae,oe]=(0,U.useState)(0);(0,U.useEffect)(()=>oe(0),[o,C,j]);let se=(0,U.useRef)(null),[ce,le]=(0,U.useState)(null),ue=(0,U.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(a,Math.floor((e.clientHeight-t)/ue.current))))};(0,U.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,a]);let fe=y?ce??a:a,pe=Math.max(1,Math.ceil(N.length/fe)),R=Math.min(ae,pe-1),he=N.slice(R*fe,R*fe+fe).map(e=>Ss(xs(e,re,O.length)));(0,U.useEffect)(de,[R,fe,N,I]);let[ge,_e]=(0,U.useState)(!1);(0,U.useEffect)(()=>{let e=se.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>_e(e.scrollWidth>e.clientWidth+1),n=new ResizeObserver(t);return n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),t(),()=>n.disconnect()},[y]);let z=O.length-re.size,ve=_||L?(0,H.jsxs)(H.Fragment,{children:[L,_]}):null;return(0,H.jsxs)(`div`,{className:g(u,`@container overflow-hidden p-0 in-[.rounded-lg.bg-bg]:shadow-none in-[.panel]:shadow-none`,x&&is,l),children:[(d||h||ve)&&(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pt-4 pb-2`,children:[d&&(0,H.jsxs)(`label`,{className:`relative flex min-w-0 w-full max-w-[320px] flex-[0_1_320px] items-center`,children:[(0,H.jsx)(ft,{size:14,"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 text-muted`}),(0,H.jsxs)(`span`,{className:`sr-only`,children:[`Find in `,e.toLowerCase()]}),(0,H.jsx)(i,{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,H.jsxs)(`span`,{className:`text-body-sm whitespace-nowrap text-muted`,role:`status`,children:[N.length,` of `,S.length]}),ve&&(0,H.jsx)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:ve})]}),!!v?.count&&(0,H.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,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:`text-body-sm font-medium text-ink tabular-nums`,role:`status`,children:[v.count,` selected`]}),(0,H.jsx)(B,{size:`sm`,variant:`ghost`,onClick:v.onClear,children:`Clear`})]}),v.actions&&(0,H.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:v.actions})]}),(0,H.jsx)(`div`,{ref:se,...ge?{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,H.jsxs)(`table`,{"aria-label":e,className:g(`w-full border-collapse text-body-sm text-ink-2`,s&&`table-fixed`),style:c?{minWidth:c}:void 0,children:[(0,H.jsx)(`thead`,{children:(0,H.jsx)(`tr`,{className:`h-10 text-left align-middle text-muted`,children:ie})}),(0,H.jsxs)(`tbody`,{children:[he,!N.length&&(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:Math.max(1,z),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,H.jsx)(me,{page:R,size:fe,total:N.length,onPage:oe,label:`Pages of ${e.toLowerCase()}`})]})}var Ts=`max(320px, calc(var(--screen) - 288px))`;function Es(e,t,n=`asc`){return e.key===t?{key:t,dir:e.dir===`asc`?`desc`:`asc`}:{key:t,dir:n}}function Ds(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 Os({col:e,sort:t,onSort:n,first:r=`asc`,num:i=!1,className:a,children:o}){let s=t.key===e;return(0,H.jsx)(`th`,{scope:`col`,"aria-sort":s?t.dir===`asc`?`ascending`:`descending`:`none`,className:g(i?os:as,a),children:(0,H.jsx)(Cs,{on:s,dir:t.dir,num:i,onClick:()=>n(Es(t,e,r)),children:o})})}function ks({columns:e,hidden:t,onChange:n}){let[r,i]=(0,U.useState)(!1);return(0,H.jsxs)(`span`,{className:`relative inline-block`,children:[(0,H.jsxs)(B,{size:`sm`,variant:`ghost`,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>i(!r),children:[(0,H.jsx)(bn,{"aria-hidden":`true`}),`Columns`,(0,H.jsx)(V,{"aria-hidden":`true`})]}),(0,H.jsx)(w,{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,H.jsx)(y,{role:`menuitemcheckbox`,checked:r,onSelect:()=>n(r?[...t,e.id]:t.filter(t=>t!==e.id)),children:(0,H.jsx)(`span`,{className:`flex-1`,children:e.label})},e.id)})})]})}var As=new Intl.RelativeTimeFormat(`en`,{style:`narrow`}),js=(e,t)=>As.format(-e,t);function Ms(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 js(Math.floor(n/60),`minute`);if(n<21600)return js(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 Ns(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 Ps({children:e,className:t}){return(0,H.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 Fs={x:0,y:0,w:0,h:0,on:!1},Is=(e,t)=>e.on===t.on&&e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h;function Ls(e,t){if(!t||!t.isConnected||t.closest(`[inert]`)||!t.offsetHeight)return Fs;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}:Fs}function Rs(e,t,n){let[r,i]=(0,U.useState)(Fs),a=(0,U.useCallback)(()=>{let n=e.current;if(!n)return;let r=Ls(n,n.querySelector(t));i(e=>Is(e,r)?e:r)},[e,t]);return(0,U.useLayoutEffect)(a,[n,a]),(0,U.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 zs=`[aria-selected="true"], [aria-current="page"], [aria-checked="true"], [aria-disabled="true"]`;function Bs(e){let[t,n]=(0,U.useState)(Fs);return{pill:t,enter:(0,U.useCallback)(t=>{let r=e.current;if(!r||t.pointerType===`touch`)return;let i=t.currentTarget.matches(zs)?Fs:Ls(r,t.currentTarget);n(e=>i.on?Is(e,i)?e:i:e.on?{...e,on:!1}:e)},[e]),leave:(0,U.useCallback)(()=>n(e=>e.on?{...e,on:!1}:e),[])}}var Vs=new Map,Hs=1500;function Us({pill:e,className:t,memory:n,children:r}){let[i,a]=(0,U.useState)(()=>{let e=n?Vs.get(n):void 0;return e&&Date.now()-e.at<Hs?e.pill:void 0});(0,U.useEffect)(()=>{n&&e.on&&Vs.set(n,{pill:e,at:Date.now()})},[n,e]),(0,U.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,U.useRef)(!1),c=s.current;return o.on&&(s.current=!0),(0,H.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 Ws=`flex w-fit max-w-full flex-wrap gap-1 rounded-full bg-surface-strong p-1`,Gs=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`),Ks=`rounded-full bg-bg shadow-sm`,qs=`rounded-full bg-bg/70`,Js=(e,t)=>g(Gs(e),`relative z-10 transition-colors duration-(--motion-fast)`,e&&t&&`bg-transparent shadow-none`);function Ys({icon:e}){return typeof e==`object`&&e&&`pixel`in e?(0,H.jsx)(f,{name:e.pixel,px:18,className:`flex-none`}):(0,H.jsx)(z,{icon:e,size:16,className:`flex-none`})}function Xs(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 Zs({tabs:e,current:t,onPick:r,hrefOf:i,label:a,className:o,prefix:s=`tab`}){let c=s===`tab`?`panel`:`${s}-panel`,l=(0,U.useRef)(null),u=Rs(l,`[aria-selected="true"], [aria-current="page"]`,t),d=Bs(l),f=r&&(e=>(n(l.current,!0),r(e))),p=`tabs:${a}:${typeof location>`u`?``:location.hash.split(`/`)[1]||``}`;(0,U.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`,Ws,`flex-nowrap overflow-x-auto [scrollbar-width:thin]`,o),h=e=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Ys,{icon:e.icon}),e.label,e.n!==void 0&&e.n!==null&&(0,H.jsx)(`span`,{className:g(`text-body-sm font-normal tabular-nums`,e.tone||`text-muted`),children:e.n})]}),_=e=>g(Js(t===e.id,u.on),`flex-none focus-visible:outline-offset-[-2px]`,e.mono&&`font-mono text-body-sm font-normal`);return i?(0,H.jsxs)(`nav`,{ref:l,"aria-label":a,className:m,onPointerLeave:d.leave,children:[(0,H.jsx)(Us,{pill:d.pill,className:qs}),(0,H.jsx)(Us,{pill:u,className:Ks,memory:p}),e.map(e=>(0,H.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,H.jsxs)(`div`,{ref:l,role:`tablist`,"aria-label":a,className:m,onPointerLeave:d.leave,children:[(0,H.jsx)(Us,{pill:d.pill,className:qs}),(0,H.jsx)(Us,{pill:u,className:Ks,memory:p}),e.map((n,r)=>(0,H.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&&Xs(e,r,t.key,s,f)&&t.preventDefault()},className:_(n),children:h(n)},n.id))]})}function Qs({tabs:e,current:t,onPick:r,label:i,className:a,prefix:o=`tab`}){let s=o===`tab`?`panel`:`${o}-panel`,c=(0,U.useRef)(null),l=Rs(c,`[aria-selected="true"]`,t),u=Bs(c),d=e=>(n(c.current,!1),r(e));return(0,H.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,H.jsx)(Us,{pill:u.pill,className:`border-b-2 border-line-strong`}),(0,H.jsx)(Us,{pill:l,className:`border-b-2 border-ink`}),e.map((n,r)=>(0,H.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=>{Xs(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,H.jsx)(`span`,{className:g(`text-body-sm font-normal tabular-nums`,n.tone||`text-muted`),children:n.n})]},n.id))]})}var $s=e=>typeof location<`u`&&e.replace(/^#\/?/,``).split(`/`)[0]===location.hash.replace(/^#\/?/,``).split(`/`)[0];function ec({links:e,current:t,label:r,className:i}){let a=(0,U.useRef)(null),o=Rs(a,`[aria-current="page"]`,t),s=Bs(a);return(0,H.jsxs)(`nav`,{ref:a,"aria-label":r,className:g(`relative`,Ws,i),onPointerLeave:s.leave,children:[(0,H.jsx)(Us,{pill:s.pill,className:qs}),(0,H.jsx)(Us,{pill:o,className:Ks,memory:`links:${r}`}),e.map(e=>(0,H.jsxs)(`a`,{href:e.href,onPointerEnter:s.enter,onClick:()=>t!==e.id&&$s(e.href)&&n(a.current,!0),"aria-current":t===e.id?`page`:void 0,className:g(Js(t===e.id,o.on),`no-underline hover:no-underline`,t===e.id&&`hover:text-ink`),children:[(0,H.jsx)(Ys,{icon:e.icon}),e.label]},e.id))]})}function tc({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,U.useRef)(null),l=Rs(c,`[aria-checked="true"]`,t),u=Bs(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,H.jsxs)(`span`,{ref:c,role:`radiogroup`,"aria-label":r,"aria-labelledby":i,className:g(`relative`,Ws,o),onPointerLeave:u.leave,children:[(0,H.jsx)(Us,{pill:u.pill,className:qs}),(0,H.jsx)(Us,{pill:l,className:Ks}),e.map(e=>{let o=a||!!e.disabled;return(0,H.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(Js(t===e.id,l.on),o&&`cursor-not-allowed opacity-50`),children:[e.icon,e.label,e.n!==void 0&&e.n!==null&&(0,H.jsx)(`span`,{className:g(`text-body-sm font-normal tabular-nums`,e.tone||`text-muted`),children:e.n})]},e.id)})]})}var nc={good:`pass`,bad:`fail`,same:`neutral`},rc={good:`text-pass`,bad:`text-fail`,same:`text-muted`};function ic(e){return e.dir===`same`||e.good===void 0?`same`:e.good?`good`:`bad`}function ac({children:e,label:t,className:n}){return(0,H.jsx)(`section`,{"aria-label":t,className:g(u,`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&&ic(a),d=a?.dir===`up`?_t:a?.dir===`down`?Rn:void 0;return(0,H.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,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium text-ink text-body-sm`,children:[r&&(0,H.jsx)(z,{icon:r,size:14,className:`flex-none text-muted`}),(0,H.jsx)(`span`,{className:`min-w-0`,children:e})]}),i&&(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:i}),(0,H.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,H.jsx)(`span`,{className:g(`tabular-nums`,s?`text-headline-md`:c?`text-headline-sm`:`text-headline-md`,o),children:t}),a&&u&&(0,H.jsx)(`span`,{"aria-hidden":a.against?!0:void 0,className:`inline-flex`,children:(0,H.jsxs)(we,{tone:nc[u],icon:!1,className:`tabular-nums`,children:[d&&(0,H.jsx)(d,{size:12,strokeWidth:2.5,"aria-hidden":`true`,className:`flex-none`}),a.text]})})]}),(n||a?.against)&&(0,H.jsx)(`span`,{className:g(`text-muted tabular-nums`,c?`truncate text-body-sm`:`text-body-sm`),children:a?.against&&u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:rc[u],children:a.amount??a.text}),` `,a.against,n?(0,H.jsxs)(H.Fragment,{children:[` · `,n]}):null]}):n})]})}var oc={line:16,inset:24},sc={line:8,inset:16},cc=(0,U.createContext)(null),lc=`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 uc({offsets:e,width:t,className:n,style:r}){if(!e.length)return null;let i=e[e.length-1],a=i+1;return(0,H.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,H.jsx)(`path`,{d:`M0.5 0 V${i-5}`,stroke:`currentColor`,strokeWidth:`1`}),e.map((e,n)=>(0,H.jsx)(`path`,{d:`M0.5 ${e-5} Q0.5 ${e} 5.5 ${e} H${t-.5}`,stroke:`currentColor`,strokeWidth:`1`},n))]})}function dc({lines:e,label:t,className:n,children:r}){let i=(0,U.useRef)(null),[a,o]=(0,U.useState)([]),s=U.Children.count(r),c=(0,U.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,U.useLayoutEffect)(()=>{if(c(),!i.current||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(c);return e.observe(i.current),()=>e.disconnect()},[s,c]),(0,H.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,H.jsx)(uc,{offsets:a,width:e.inset-e.line,style:{left:e.line}}),r]})}function fc(){let e=(0,U.useContext)(cc);return{onPointerEnter:t=>t.pointerType===`mouse`&&e?.hover(t.currentTarget),onFocus:t=>t.currentTarget.matches(`:focus-visible`)&&e?.hover(t.currentTarget)}}function pc({href:e,label:t,current:n,icon:r,badge:i,after:a,tip:o,className:s}){let c=fc(),l=(0,H.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(lc,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,H.jsx)(`span`,{"aria-hidden":`true`,className:`size-[18px] flex-none`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),i]});return a?(0,H.jsxs)(`div`,{className:`group relative`,children:[l,a]}):l}function mc(e,t,n){let[r,i]=(0,U.useState)(t),a=e??r;return[a,()=>{e===void 0&&i(!a),n?.(!a)}]}function hc({href:e,label:t}){return(0,H.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,H.jsx)(gn,{size:14,strokeWidth:2,"aria-hidden":`true`})})}function gc({label:e,href:t,current:n,className:r,children:i}){let a=(0,U.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,H.jsxs)(`div`,{"data-tree-group":``,role:`group`,"aria-labelledby":a,className:g(`flex flex-col gap-px`,r),children:[t?(0,H.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,H.jsx)(`span`,{id:a,className:o,children:e}),i]})}function _c({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]=mc(o,s,c),p=(0,U.useId)(),m=fc();return(0,H.jsxs)(`div`,{className:g(`flex flex-col gap-px`,u),children:[(0,H.jsxs)(`div`,{className:`group relative`,children:[(0,H.jsxs)(`button`,{type:`button`,"data-tree-row":``,"aria-expanded":d,"aria-controls":p,"aria-current":a?`page`:void 0,onClick:f,...m,className:g(lc,`cursor-pointer text-left`,a?`font-medium text-(--side-current-ink)`:`text-ink-2 hover:text-ink`),children:[t,(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),n,(0,H.jsx)(ot,{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,H.jsx)(hc,{href:r,label:i||`Open ${e}`})]}),(0,H.jsx)(Oi,{open:d,id:p,children:(0,H.jsx)(dc,{lines:sc,label:e,children:l})})]})}function vc({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]=mc(o,s,c),p=(0,U.useId)(),m=fc();return(0,H.jsxs)(`div`,{className:g(`flex flex-col gap-px`,u),children:[(0,H.jsxs)(`div`,{className:`group relative`,children:[(0,H.jsxs)(`button`,{type:`button`,"data-tree-row":``,"aria-expanded":d,"aria-controls":p,"aria-current":i?`page`:void 0,onClick:f,...m,className:g(lc,`cursor-pointer text-left font-medium`,i?`text-(--side-current-ink)`:t?`text-ink`:`text-muted hover:text-ink`),children:[t,(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),(0,H.jsx)(V,{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,H.jsx)(hc,{href:n,label:r||`Open ${e}`})]}),(0,H.jsx)(Oi,{open:d,id:p,children:(0,H.jsx)(dc,{lines:a,label:e,children:l})})]})}function yc({routeKey:e,className:t,children:n}){let r=(0,U.useRef)(null),i=(0,U.useRef)(null),[a,o]=(0,U.useState)([]),[s,c]=(0,U.useState)(Fs),l=(0,U.useCallback)(()=>{let e=r.current;if(!e)return;let t=[...e.querySelectorAll(`[data-tree-row][aria-current="page"]`)].map(t=>Ls(e,t)).filter(e=>e.on);o(e=>e.length===t.length&&e.every((e,n)=>Is(e,t[n]))?e:t);let n=i.current?.getAttribute(`aria-current`)===`page`?Fs:Ls(e,i.current);c(e=>Is(e,n)?e:n)},[]);(0,U.useLayoutEffect)(l,[e,l]),(0,U.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,U.useRef)({hover:e=>{i.current=e,l()}}).current;return(0,H.jsx)(cc.Provider,{value:u,children:(0,H.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,H.jsx)(Us,{pill:s,className:`rounded-sm bg-surface-strong/60`}),a.map((e,t)=>(0,H.jsx)(Us,{pill:e,className:`rounded-sm bg-(--side-current-bg)`},t)),n]})})}var bc=`flex h-8 short:h-7 items-center gap-2 rounded-full px-4 text-body-sm no-underline`,xc=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`,Sc=e=>e.id===`agents`?{href:r(`agents`),label:e.label}:{label:e.label},Cc=/^[A-Za-z0-9][\w.-]{0,120}$/;function wc(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&&Cc.test(n)&&i===`compare`)return{middle:{href:r(`migration`,n),label:`Conversion`},here:`Compare`}}function Tc(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=nr(e),n=wc(e);if(n&&(n.parent||t))return{parent:n.parent??Sc(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=Xn(t.item,e),o=t.item.path.length>0&&e.length>a;return{parent:Sc(t.category),here:{label:t.item.label,href:o?r(...t.item.path):void 0}}}var Ec=(0,U.createContext)({pending:{},set:()=>{},saved:new Set,vars:{},store:`the credential store`}),Dc=()=>(0,U.useContext)(Ec);function Oc(e){return/[\\/]/.test(e)?`ForgeQE's private credentials file (readable only by you)`:e}var kc=/^[A-Za-z_][A-Za-z0-9_]*$/;function Ac(e,t){return t in e.pending?e.pending[t]===null?`removing`:`pending`:e.saved.has(t)?`saved`:e.vars[t]?`environment`:`missing`}var jc={pending:`Not saved yet`,removing:`Removed when you save`,saved:`Saved`,environment:`Set in the environment`,missing:`Not set`},Mc=(e,t)=>[`pending`,`saved`,`environment`].includes(Ac(e,t));function Nc({name:e}){let t=Dc();if(!e)return null;if(!kc.test(e))return(0,H.jsx)(`span`,{className:`text-body-sm text-fail`,children:`Not a variable name`});let n=Ac(t,e);return(0,H.jsx)(`span`,{className:g(`text-body-sm`,n===`saved`||n===`environment`?`text-pass`:n===`missing`?`text-muted`:`text-accent-fg`),children:jc[n]})}var Pc=/user|email|login|client_id|account/i;function Fc({id:e,name:t,field:n,onRename:r,compact:a}){let o=Dc(),s=(0,U.useId)(),c=e||s,[l,u]=(0,U.useState)(!1),d=Ac(o,t),f=typeof o.pending[t]==`string`?o.pending[t]:``,p=Pc.test(n)||Pc.test(t);return(0,H.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(i,{id:c,"aria-label":e?void 0:n,type:p?`text`:`password`,autoComplete:`off`,spellCheck:!1,value:f,disabled:!kc.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=>o.set(t,e.target.value||void 0)}),d===`saved`&&(0,H.jsx)(B,{variant:`icon`,size:`icon-sm`,onClick:()=>o.set(t,null),"aria-label":`Remove the saved value of ${t}`,"data-tip":`Remove the saved value of ${t}`,children:(0,H.jsx)(Le,{"aria-hidden":`true`})}),d===`removing`&&(0,H.jsxs)(B,{size:`sm`,"data-tip":`Keep the saved value of ${t}`,onClick:()=>o.set(t,void 0),children:[(0,H.jsx)(Ln,{"aria-hidden":`true`}),`Keep`]})]}),!a&&(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-body-sm text-muted`,children:[(0,H.jsx)(Nc,{name:t}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),l&&r?(0,H.jsx)(i,{size:`sm`,"aria-label":`Variable name`,autoFocus:!0,defaultValue:t,spellCheck:!1,onBlur:e=>{let n=e.target.value.trim();n&&kc.test(n)&&n!==t&&r(n),u(!1)},onKeyDown:e=>D(e)&&e.target.blur(),className:`max-w-[260px] font-mono`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{children:[`Kept as `,(0,H.jsx)(`span`,{className:`font-mono text-body-sm`,children:t})]}),r&&(0,H.jsxs)(B,{variant:`link`,size:`inline`,onClick:()=>u(!0),"data-tip":`Change the variable's name`,children:[(0,H.jsx)(Ke,{"aria-hidden":`true`}),`Rename`]})]})]})]})}function Ic({name:e}){return(0,H.jsx)(Nc,{name:e})}function Lc({id:e,name:t,field:n,named:r,onName:i}){let a=Dc();return(0,H.jsx)(Rc,{onFirstValue:()=>{!r&&t&&i(t)},secrets:a,children:(0,H.jsx)(Fc,{id:e,name:t,field:n,onRename:i})})}function Rc({secrets:e,onFirstValue:t,children:n}){return(0,H.jsx)(Ec.Provider,{value:{...e,set:(n,r)=>{r&&t(),e.set(n,r)}},children:n})}function zc({label:e,help:t,htmlFor:n,children:r,className:i,stacked:a,yamlKey:o}){let s=o?(0,H.jsx)(`code`,{className:`font-mono text-body-sm text-muted [overflow-wrap:anywhere]`,children:o}):null;return a?(0,H.jsxs)(`div`,{className:g(`flex flex-col gap-4 py-4`,i),children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[n?(0,H.jsx)(`label`,{htmlFor:n,className:`text-body-sm leading-snug font-medium text-ink`,children:e}):(0,H.jsx)(`span`,{className:`text-body-sm leading-snug font-medium text-ink`,children:e}),t&&(0,H.jsx)(`span`,{className:`text-body-sm leading-relaxed text-ink-2`,children:t}),s]}),(0,H.jsx)(`div`,{className:`[&>*]:max-w-none`,children:r})]}):(0,H.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,H.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[n?(0,H.jsx)(`label`,{htmlFor:n,className:`text-body-sm leading-snug font-medium text-ink`,children:e}):(0,H.jsx)(`span`,{className:`text-body-sm leading-snug font-medium text-ink`,children:e}),t&&(0,H.jsx)(`span`,{className:`text-body-sm leading-relaxed text-ink-2`,children:t}),s]}),r!=null&&r!==!1&&(0,H.jsx)(`div`,{className:`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,children:r})]})}var Bc=`flex w-full flex-wrap items-center gap-2 sm:w-[340px] sm:flex-none sm:justify-end`,Vc={"By how you asked":Pn,"Test runs":mt,"Speech on this computer":zt,Conversation:It,"What went wrong":ze,"What ForgeQE found":Gn,Questions:Ge,"The bug":Un,"What is attached":lt,Send:Gt,"Test case ids":Vn,"Where runs happen":Xt,"The browser window":xn,"Limits and checks":gt,"Remote browser, set here":yt,"Where tests go":sn,"How hard it tries":wt,"Help it gets":en,Reports:Jt,"Memory and replays":Nn,Suites:Bt,"Flaky tests":Ft,"Release readiness":He,"Regression packs in a pipeline":st,"Defect analysis":Un,Accessibility:En,"Performance and visual changes":at,"API tests":St,"The product":Yt,"Instructions and knowledge":ln,Capabilities:Tt,"Project report":Fe,"Report datasets":Mt,"Running in parallel":bn,Driver:Ae,Appium:vn,"Devices on this computer":Wt,"TestMu AI devices":yt,"BrowserStack devices":yt,"Browser devices":pn,"Appium on this computer":vn,Maestro:Fn,"Windows desktop apps":Ie,Runtime:Ot,"Tests in a container":vt,"The coding agents' workspace":Ct,"Browser in a container":ht,"How skills are used":Jn,Budgets:qe,"Project folder":Be,"ForgeQE in this folder":ct,Repository:sn,"Features to download":st,Onboarding:He,"This computer":Wt,"A model":Vt,"Models file":dn,"Default model":Vt,"Product knowledge graph":Re,Repositories:sn,"Documents and links":Sn,"Search service":ln,Documents:Sn,"The product and its knowledge":Yt,"Building the graph":Tt,"The team's knowledge":it,"Agent names":Wn,"Custom agents":Zt,"Sign-ins":pt,"Recent runs":Et,"Saved runs":wt,"Test data":Mt,"Areas of work":Je,"Which model a call gets":Je,Alerts:Ht,"When to alert":fn,Apps:pn,"By kind of run":Cn,"By run, newest first":Et,Guides:ln,"Last 30 days":Bn,"Latest problems":ze,"Links in alerts":_n,"Model calls":It,Plans:jn,"Recent requests":Dt,"Results and bugs":Pe,"What used the most":zn,"Send a test":Gt,Services:On,"Tools used":Tt,"What runs":mt,"Check the agent's domain knowledge":cn,"Test cases and bugs":bt,"Browser grids":yt,Notifications:An,"Other tools":qt},Hc=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``),Uc=g(`settings-card`,u);function Wc({children:e,className:t}){return(0,H.jsx)(`div`,{className:g(Uc,t),children:e})}function Gc(e){return U.Children.toArray(e).flatMap(e=>(0,U.isValidElement)(e)&&e.type===U.Fragment?Gc(e.props.children):[e])}function Kc({children:e}){let t=[],n=[],r=null,i=()=>{r?.items.length&&n.push((0,H.jsx)(Wc,{children:r.items},r.key)),r=null};return Gc(e).forEach((e,a)=>{(0,U.isValidElement)(e)&&Yc.has(e.type)?(i(),n.push(e)):((0,U.isValidElement)(e)&&e.type===Jc&&i(),r||(r={key:`card-${a}`,items:[]},t.push(r)),r.items.push(e))}),i(),(0,H.jsx)(H.Fragment,{children:n})}var qc=e=>typeof e==`string`?e.trim().replace(/^\d+\.\s*/,``):``;function Jc({children:e,help:t,first:n,icon:r}){let i=r??Vc[qc(e)];return(0,H.jsxs)(`div`,{"data-group-title":``,"data-tour":Hc(qc(e)),className:g(`mb-4 flex flex-col gap-2`,n?`mt-0`:`mt-10`),children:[(0,H.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-body-lg leading-snug font-medium text-ink`,children:[i&&(0,H.jsx)(z,{icon:i,size:18,className:`flex-none text-icon`}),e]}),t&&(0,H.jsx)(`p`,{className:g(`m-0 text-body-sm leading-relaxed text-ink-2`,i&&`pl-8`),children:t})]})}var Yc=new Set([Kc]),Xc=e=>Array.isArray(e)?e.map(String).join(`, `):typeof e==`string`?e:``,Zc=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean);function Qc({id:e,value:t,onChange:n,placeholder:r,mono:a}){let[o,s]=(0,U.useState)(Xc(t)),[c,l]=(0,U.useState)(t);return JSON.stringify(c)!==JSON.stringify(t)&&(l(t),s(Xc(t))),(0,H.jsx)(i,{id:e,value:o,placeholder:r,className:g(a&&`font-mono text-body-sm`),onChange:e=>{s(e.target.value);let t=Zc(e.target.value);l(t.length?t:void 0),n(t.length?t:void 0)}})}function $c({def:e,edit:t,base:n,stacked:r}){let a=(0,U.useId)(),c=e.key?[...n,...e.key.split(`.`)]:n,l=Ha(t.value,c),u=e=>t.set(Wa(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,H.jsx)(zc,{label:e.label,help:e.help,yamlKey:f,children:(0,H.jsx)(Fo,{checked:t,onChange:u,label:e.label})})}case`select`:p=(0,H.jsxs)(o,{id:a,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,H.jsx)(`option`,{value:``,children:e.emptyLabel||`Not set`}),e.options.map(e=>(0,H.jsx)(`option`,{value:e.value,children:e.label},e.value))]});break;case`number`:p=(0,H.jsx)(i,{id:a,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,H.jsx)(`div`,{className:d,children:(0,H.jsx)(Qc,{id:a,value:l,onChange:u,placeholder:e.placeholder})});break;case`kv`:p=(0,H.jsx)(`div`,{className:d,children:(0,H.jsx)(el,{id:a,value:l,onChange:u,placeholder:e.placeholder})});break;case`textarea`:p=(0,H.jsx)(s,{id:a,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,H.jsx)(`div`,{className:d,children:(0,H.jsx)(Lc,{id:a,name:t,field:e.key,named:l!==void 0||e.default!==void 0,onName:e=>u(e)})}),(0,H.jsx)(zc,{label:e.label.replace(/ variable$/,``),help:e.help,htmlFor:a,stacked:r,yamlKey:f,children:p})}default:p=(0,H.jsx)(i,{id:a,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,H.jsx)(zc,{label:e.label,help:e.help,htmlFor:a,stacked:r,yamlKey:f,children:p})}function el({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(`
|
|
8
|
-
`),[a,o]=(0,U.useState)(i(t)),[c,l]=(0,U.useState)(t);return JSON.stringify(c)!==JSON.stringify(t)&&(l(t),o(i(t))),(0,H.jsx)(s,{id:e,rows:3,value:a,spellCheck:!1,placeholder:r??`NAME = value`,className:`font-mono`,onChange:e=>{o(e.target.value);let t={};for(let n of e.target.value.split(`
|
|
9
|
-
`)){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 tl({defs:e,edit:t,base:n,stacked:r}){let i=Ha(t.value,n),a=i&&typeof i==`object`&&!Array.isArray(i)?i:{};return(0,H.jsx)(H.Fragment,{children:e.filter(e=>!e.when||e.when(a)).map(e=>(0,H.jsx)($c,{def:e,edit:t,base:n,stacked:r},e.key))})}function nl({title:e,meta:t,state:n,open:r,onToggle:i,lead:a,actions:o,children:s,expandable:c}){let l=(0,U.useId)();return(0,H.jsxs)(`div`,{className:`border-t border-line-soft`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-[68px] flex-wrap items-center gap-x-4 gap-y-2 py-4`,children:[a,c===!1?(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e}),t&&(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:t})]}):(0,H.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,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e}),t&&(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:t})]}),(0,H.jsx)(V,{size:18,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform`,r&&`rotate-180`)})]}),n,o]}),c!==!1&&(0,H.jsx)(Oi,{open:r,id:l,children:(0,H.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})})]})}function rl(e){let[t,n]=(0,U.useState)(null),[r,i]=(0,U.useState)(``),a=(0,U.useCallback)(()=>{i(``),e().then(n,e=>i(e.message))},[e]);return(0,U.useEffect)(a,[a]),{data:t,error:r,reload:a}}function il({error:e,reload:t}){return e?(0,H.jsxs)(`div`,{role:`alert`,className:g(u,`flex flex-col items-start gap-4`),children:[(0,H.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:e}),(0,H.jsxs)(B,{size:`sm`,onClick:t,children:[(0,H.jsx)(Xe,{"aria-hidden":`true`}),`Retry`]})]}):(0,H.jsx)(xe,{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 al(e){return`${K(e.input)} read${e.cached?` (${K(e.cached)} from cache)`:``} · ${K(e.output)} written`}var ol=null;function sl(e){ol=e}function q(e,t){if(!t)return`—`;let n=ol?.to,r=ol?.perEur?.[t],i=n?ol?.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 cl(e){if(!ol?.perEur||!e||ol.to===e||!ol.perEur[e])return``;let t=q(1,e);return`Shown in ${ol.to}, converted from ${e} at the European Central Bank's rate of ${ol.date}: ${new Intl.NumberFormat(void 0,{style:`currency`,currency:e}).format(1)} = ${t}.`}var ll=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})},ul=e=>e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} bytes`;function dl({head:e,children:t,label:n,height:r}){let i=U.Children.toArray(t).map(e=>(0,U.isValidElement)(e)&&e.type===fl?(0,H.jsx)(U.Fragment,{children:fl(e.props)},e.key):e);return(0,H.jsx)(ws,{label:n,...r?{height:r}:{},head:e.map((e,t)=>(0,H.jsx)(`th`,{scope:`col`,className:t>0?os:as,children:e},e||t)),children:i})}function fl({cells:e,sort:t}){return(0,H.jsx)(`tr`,{className:`border-t border-line-soft`,children:e.map((e,n)=>(0,H.jsx)(`td`,{"data-sort":t?.[n],className:g(n>0?us:ls,`align-top`,n===0&&`min-w-[200px]`),children:e},n))})}var pl={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}]},ml={"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 hl(e,t){return e===`tier0`?t===`shadow`?`Test mode: AI ran it, could have replayed`:`Replayed for free`:`AI: ${ml[e]||e}`}function gl({edit:e}){let{data:t,error:n,reload:r}=rl(pe.registry),[i,a]=(0,U.useState)(!1),o=String(Ha(e.value,[`registry`,`mode`])??`on`);return(0,H.jsxs)(Kc,{children:[(0,H.jsx)(zc,{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,H.jsx)(Fo,{checked:o===`on`,onChange:t=>e.set(Wa(e.value,[`registry`,`mode`],t?`on`:`off`)),label:`Replay passed runs for free`})}),t?!t.exists||t.plans.length===0?(0,H.jsx)(R,{children:`Nothing to replay yet. When a run passes, ForgeQE saves its steps, and running it again is free.`}):(0,H.jsxs)(Kc,{children:[(0,H.jsxs)(ac,{label:`Replays`,className:`mt-4`,children:[(0,H.jsx)(G,{icon:wt,label:`Free reruns`,value:String(t.replayed),note:`of ${h(t.total,`run`)}`}),(0,H.jsx)(G,{icon:Ze,label:`Tokens saved`,value:K(t.tokensSaved),note:`${h(t.plans.length,`passed run`)} ready to replay`})]}),(0,H.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,H.jsx)(an,{"aria-hidden":`true`}):(0,H.jsx)(V,{"aria-hidden":`true`}),i?`Less`:`Details`]}),(0,H.jsxs)(Oi,{open:i,id:`replay-details`,children:[(0,H.jsx)(Jc,{first:!0,children:`Saved runs`}),(0,H.jsx)(dl,{label:`Saved runs`,head:[`Goal`,`Passed`,`Failed`,`Tokens the first time`,`Last used`],children:t.plans.map(e=>(0,H.jsx)(fl,{cells:[(0,H.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`line-clamp-2`,children:e.goal}),e.stale&&(0,H.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):`—`,ll(e.lastAt)],sort:[void 0,void 0,void 0,e.firstTokens??-1,new Date(e.lastAt).getTime()||0]},e.id))}),(0,H.jsx)(Jc,{children:`Recent runs`}),t.requests.length===0?(0,H.jsx)(R,{children:`No runs yet.`}):(0,H.jsx)(dl,{label:`Recent runs`,head:[`Request`,`How it ran`,`Result`,`Tokens`,`When`],children:t.requests.map(e=>(0,H.jsx)(fl,{cells:[(0,H.jsx)(`span`,{className:`line-clamp-2`,children:e.request||e.planGoal||e.id}),hl(e.decision,e.mode),e.outcome||`—`,K(e.tokens),ll(e.startedAt)],sort:[void 0,void 0,void 0,e.tokens,new Date(e.startedAt).getTime()||0]},e.id))})]})]}):(0,H.jsx)(il,{error:n,reload:r})]})}function _l(){let{data:e,error:t,reload:n}=rl(pe.logs),[r,i]=(0,U.useState)(null),[a,o]=(0,U.useState)(``);return e?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`mt-0 mb-4 text-body-sm text-muted`,children:[`Kept in `,(0,H.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.dir}),`. Secrets are replaced with their names before a log is shown.`]}),a&&(0,H.jsx)(`p`,{role:`alert`,className:`mt-0 mb-4 text-body-sm text-fail`,children:a}),e.logs.length===0?(0,H.jsx)(R,{children:`No session logs yet. ForgeQE writes one for each chat, run and suite.`}):e.logs.map(e=>(0,H.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,H.jsx)(Va,{icon:At}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-mono text-body-sm break-all`,children:e.name}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[ll(e.modified),`, `,ul(e.size)]})]}),(0,H.jsx)(B,{variant:`icon`,size:`icon-sm`,"aria-label":`Open ${e.name}`,"data-tip":`Open ${e.name}`,onClick:()=>{o(``),pe.log(e.name).then(i,e=>o(e.message))},children:(0,H.jsx)(At,{"aria-hidden":`true`})})]},e.name)),(0,H.jsx)(or,{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,H.jsxs)(B,{onClick:()=>i(null),children:[(0,H.jsx)(Ue,{"aria-hidden":`true`}),`Close`]}),children:r&&(0,H.jsx)(`pre`,{className:`m-0 mt-4 font-mono text-body-sm leading-relaxed whitespace-pre-wrap break-all`,children:(0,H.jsx)(Te,{text:r.text})})})]}):(0,H.jsx)(il,{error:t,reload:n})}var vl={error:`Error`,tool:`Tool call failed`,run:`Run failed`,engine:`Browser engine stopped`,agent:`Agent error`,model:`Model call failed`},yl={chat:`Chat`,start:`Shell`,run:`Run`,suite:`Suite`,code:`Write tests`,heal:`Heal`,monitor:`Monitor`,mcp:`MCP`,explore:`Explore`};function bl(){let[e,t]=(0,U.useState)(null),[n,r]=(0,U.useState)(``);return{show:e=>{r(``),pe.log(e).then(t,e=>r(e.message))},error:n,sheet:(0,H.jsx)(or,{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,H.jsxs)(B,{onClick:()=>t(null),children:[(0,H.jsx)(Ue,{"aria-hidden":`true`}),`Close`]}),children:e&&(0,H.jsx)(`pre`,{className:`m-0 mt-4 font-mono text-body-sm leading-relaxed break-all whitespace-pre-wrap`,children:(0,H.jsx)(Te,{text:e.text})})})}}function xl({entries:e}){let[t,n]=(0,U.useState)(-1);return e.length?(0,H.jsx)(H.Fragment,{children:e.map((e,r)=>(0,H.jsx)(nl,{lead:(0,H.jsx)(Va,{icon:Et}),title:`${e.action}: ${e.file}`,meta:`${ll(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,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0 py-4`,children:e.changes.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-body-sm`,children:[(0,H.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.key}),(0,H.jsx)(`span`,{className:`text-muted`,children:e.before===void 0?(0,H.jsxs)(H.Fragment,{children:[`added `,(0,H.jsx)(`span`,{className:`text-ink`,children:e.after})]}):e.after===void 0?(0,H.jsxs)(H.Fragment,{children:[`removed `,(0,H.jsx)(`span`,{className:`text-ink line-through`,children:e.before})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`text-ink line-through`,children:e.before}),` → `,(0,H.jsx)(`span`,{className:`text-ink`,children:e.after})]})})]},t))})},r))}):(0,H.jsx)(R,{children:`No changes made in Settings yet.`})}function Sl(){let{data:e,error:t,reload:n}=rl(pe.audit),[r,i]=(0,U.useState)(`summary`),a=bl();if(!e)return(0,H.jsx)(il,{error:t,reload:n});let o=e.summary,s=o.totals,c=e=>e?`${e} failed`:`None failed`;return(0,H.jsxs)(Kc,{children:[(0,H.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,H.jsx)(Qs,{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,H.jsx)(`p`,{role:`alert`,className:`mt-0 mb-4 text-body-sm text-fail`,children:a.error}),(0,H.jsxs)(`div`,{id:`panel-${r}`,role:`tabpanel`,"aria-labelledby":`tab-${r}`,children:[r===`summary`&&(0,H.jsxs)(Kc,{children:[(0,H.jsxs)(ac,{label:`Activity summary`,children:[(0,H.jsx)(G,{icon:It,label:`Sessions`,value:String(s.sessions),note:s.replays?`${s.replays} request${s.replays===1?``:`s`} replayed without the agent`:void 0}),(0,H.jsx)(G,{icon:Tt,label:`Tool calls`,value:String(s.toolCalls),note:c(s.toolErrors)}),(0,H.jsx)(G,{icon:mt,label:`Runs`,value:String(s.runs),note:c(s.runsFailed)}),(0,H.jsx)(G,{icon:Vt,label:`Model calls`,value:String(s.modelCalls),note:c(s.modelErrors)}),(0,H.jsx)(G,{icon:ze,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,H.jsxs)(Kc,{children:[(0,H.jsx)(Jc,{children:`Latest problems`}),(0,H.jsx)(Cl,{problems:o.problems.slice(0,5),onLog:a.show}),o.problems.length>5&&(0,H.jsxs)(B,{variant:`link`,size:`inline`,onClick:()=>i(`problems`),"data-tip":`All ${o.problems.length} problems`,className:`mt-4 self-start`,children:[(0,H.jsx)(gn,{"aria-hidden":`true`}),`All (`,o.problems.length,`)`]})]}),(0,H.jsx)(Jc,{children:`Tools used`}),o.tools.length===0?(0,H.jsx)(R,{children:`No tool calls logged in the last 30 days.`}):(0,H.jsx)(dl,{label:`Tools used`,head:[`Tool`,`Calls`,`Failed`,`Average time`],children:o.tools.map(e=>(0,H.jsx)(fl,{cells:[(0,H.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.name}),e.calls,e.errors?(0,H.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,H.jsx)(Jc,{children:`Model calls`}),o.models.length===0?(0,H.jsx)(R,{children:`No model calls in the usage ledger in the last 30 days.`}):(0,H.jsx)(dl,{label:`Model calls`,head:[`Model`,`Calls`,`Failed`,`Tokens`],children:o.models.map(e=>(0,H.jsx)(fl,{cells:[e.model,e.calls,e.errors?(0,H.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,H.jsx)(Cl,{problems:o.problems,onLog:a.show}):(0,H.jsx)(R,{children:`Nothing failed in the last 30 days.`})),r===`sessions`&&(o.sessions.length?(0,H.jsx)(dl,{label:`Sessions`,height:`max(320px, calc(var(--screen) - 288px))`,head:[`Session`,`Tool calls`,`Runs`,`Errors`,`Tokens`,``],children:o.sessions.map(e=>(0,H.jsx)(fl,{cells:[(0,H.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:yl[e.command]||e.command}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[ll(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,H.jsx)(`span`,{className:`text-fail`,children:e.errors}):0,K(e.tokens),(0,H.jsx)(B,{variant:`icon`,size:`icon-sm`,"aria-label":`Open the log of the ${yl[e.command]||e.command} session at ${ll(e.started)}`,"data-tip":`Open the log of the ${yl[e.command]||e.command} session at ${ll(e.started)}`,onClick:()=>a.show(e.log),children:(0,H.jsx)(At,{"aria-hidden":`true`})})],sort:[void 0,e.tools,e.runs,e.errors,e.tokens]},e.log))}):(0,H.jsx)(R,{children:`No sessions logged in the last 30 days.`})),r===`changes`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`mt-0 mb-4 text-body-sm text-muted`,children:[`Every change made in Settings, kept in `,(0,H.jsx)(`span`,{className:`font-mono text-body-sm`,children:e.file}),`. Changes made to the files by hand are not here.`]}),(0,H.jsx)(xl,{entries:e.entries})]})]}),a.sheet]})}function Cl({problems:e,onLog:t}){return(0,H.jsx)(H.Fragment,{children:e.map((e,n)=>(0,H.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,H.jsx)(Va,{icon:e.kind===`run`||e.kind===`tool`?Kn:ze,tone:`fail`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:vl[e.kind]}),(0,H.jsx)(`span`,{className:`text-body-sm break-words text-ink-2`,children:e.text}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[ll(e.at),`, `,yl[e.command]||e.command]})]}),e.log&&(0,H.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,H.jsx)(At,{"aria-hidden":`true`})})]},n))})}var wl={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`}]},Tl={suite:`Suites`,monitor:`Monitor rounds`,run:`Browser runs`,explore:`Exploratory`,api:`API tests`,desktop:`Desktop runs`,mobile:`Mobile runs`},El={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`},Dl=e=>El[e]||e.charAt(0).toUpperCase()+e.slice(1);function Ol({days:e,currency:t}){let[n,r]=(0,U.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,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`p`,{"aria-live":`polite`,className:`m-0 text-body-sm text-ink-2`,children:[(0,H.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,H.jsx)(ye,{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 kl({rows:e,currency:t,label:n}){if(!e.length)return(0,H.jsx)(R,{children:`Nothing yet.`});let r=Math.max(1,e.reduce((e,t)=>e+t.sum.input+t.sum.output,0));return(0,H.jsx)(ke,{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 Al=e=>{let t=Math.round(e*100)/100;return`${t} premium request${t===1?``:`s`}`};function jl({label:e,spent:t,limit:n,currency:r,premium:i}){let a=e=>i?Al(e):q(e,r),o=t/n*100,s=o>=100?`fail`:o>=80?`warn`:`ok`;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 text-body-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e}),(0,H.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,H.jsx)(Oe,{value:t,limit:n,label:`${e}: ${a(t)} of ${a(n)}`})]})}function Ml({edit:e}){let{data:t,error:n,reload:i}=rl(pe.tokenomics),a=(0,H.jsx)(tl,{defs:wl.fields,edit:e,base:wl.base});if(!t)return(0,H.jsx)(il,{error:n,reload:i});let o=t,s=o.currency,c=o.totals.input+o.totals.output,l=o.budget,d=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,H.jsxs)(Kc,{children:[f&&(0,H.jsxs)(Kc,{children:[(0,H.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,H.jsx)(`a`,{href:r(`cost`),children:`Cost and model usage`}),` breaks them down by agent, job and model, priced at today's prices.`]}),(0,H.jsxs)(ac,{label:`All model calls, last 30 days`,children:[(0,H.jsx)(G,{icon:Ye,label:`Tokens`,value:K(p),note:al(f.days30)}),(0,H.jsx)(G,{icon:qe,label:`Cost`,value:f.currency?q(f.days30.amount,f.currency):`—`,note:f.currency?`When each call was made`:`No prices known`}),(0,H.jsx)(G,{icon:at,label:`Calls`,value:f.days30.calls.toLocaleString(),note:`${K(f.today.input+f.today.output)} tokens today`}),(0,H.jsx)(G,{icon:hn,label:`Read from cache`,value:f.days30.input?`${Math.round(f.days30.cached/f.days30.input*100)}%`:`—`,note:`Of the tokens read`})]}),cl(f.currency)&&(0,H.jsx)(`p`,{className:`mt-4 mb-0 text-body-sm text-muted`,children:cl(f.currency)}),f.byChannel&&(0,H.jsxs)(Kc,{children:[(0,H.jsx)(Jc,{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,H.jsx)(kl,{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,H.jsxs)(Kc,{children:[(0,H.jsx)(Jc,{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,H.jsx)(dl,{label:`Work that used the most tokens`,head:[`Work`,`Kind`,`Tokens`,`Cost`,`When`],children:f.top.map(e=>(0,H.jsx)(fl,{cells:[(0,H.jsxs)(`span`,{className:`line-clamp-2`,children:[e.title,e.voice?(0,H.jsx)(`span`,{className:`text-muted`,children:` · by voice`}):null]}),Dl(e.kind),K(e.tokens),e.amount!==void 0&&f.currency?q(e.amount,f.currency):`—`,e.startedAt?ll(e.startedAt):`—`],sort:[void 0,void 0,e.tokens,e.amount??-1,e.startedAt&&new Date(e.startedAt).getTime()||0]},e.id))})]}),(0,H.jsx)(Jc,{children:`Test runs`})]}),o.totals.runs===0?(0,H.jsx)(R,{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,H.jsxs)(Kc,{children:[(0,H.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,H.jsxs)(ac,{label:`Test runs, last 30 days`,children:[(0,H.jsx)(G,{icon:Ye,label:`Tokens`,value:K(c),note:al(o.totals)}),(0,H.jsx)(G,{icon:qe,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,H.jsx)(G,{icon:at,label:`Per run`,value:K(Math.round(c/o.totals.runs)),note:s?q(o.totals.amount/o.totals.runs,s):void 0}),(0,H.jsx)(G,{icon:hn,label:`Read from cache`,value:o.totals.input?`${Math.round(o.totals.cached/o.totals.input*100)}%`:`—`,note:`Of the tokens read`})]}),cl(o.currency)&&f?.currency!==o.currency&&(0,H.jsx)(`p`,{className:`mt-4 mb-0 text-body-sm text-muted`,children:cl(o.currency)}),o.otherCurrency>0&&(0,H.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,H.jsx)(Jc,{children:`Last 30 days`}),(0,H.jsx)(Ol,{days:o.days,currency:s}),(0,H.jsxs)(`div`,{className:`mt-8 flex flex-wrap gap-x-10 gap-y-8`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-4`,children:[(0,H.jsx)(`h3`,{className:`m-0 text-body-lg font-medium`,children:`By model`}),(0,H.jsx)(kl,{label:`Tokens by model`,rows:o.byModel.map(e=>({name:e.model,sum:e})),currency:s})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-4`,children:[(0,H.jsx)(`h3`,{className:`m-0 text-body-lg font-medium`,children:`By agent`}),(0,H.jsx)(kl,{label:`Tokens by agent`,rows:o.byAgent.map(e=>({name:e.agent,sum:e})),currency:s})]})]}),(0,H.jsx)(Jc,{children:`By kind of run`}),(0,H.jsx)(kl,{label:`Tokens by kind of run`,rows:o.byKind.map(e=>({name:`${Tl[e.kind]||e.kind} (${e.runs})`,sum:e})),currency:s})]}),(0,H.jsx)(Jc,{help:wl.help,children:wl.title}),l&&o.spent&&(l.day||l.month)?(0,H.jsxs)(`div`,{className:g(u,`mb-4 flex flex-col gap-4`),children:[l.day?(0,H.jsx)(jl,{label:`Today`,spent:o.spent.today,limit:l.day,currency:d}):null,l.month?(0,H.jsx)(jl,{label:`This month`,spent:o.spent.month,limit:l.month,currency:d}):null]}):null,l?.premium&&o.spent&&(l.premium.day||l.premium.month)?(0,H.jsxs)(`div`,{className:g(u,`mb-4 flex flex-col gap-4`),children:[l.premium.day?(0,H.jsx)(jl,{label:`Premium requests today`,spent:o.spent.premiumToday||0,limit:l.premium.day,premium:!0}):null,l.premium.month?(0,H.jsx)(jl,{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),Nl=e=>e.replace(/(?:\s*\[(?:They spoke while you were talking; they heard up to: |Running elsewhere in ForgeQE now, as data: )[^\n]*\])+\s*$/,``),Pl=(e,t=400)=>e.length>t?`${e.slice(0,t-1)}…`:e,Fl=e=>typeof e==`number`?` in ${Math.round(e/1e3)}s`:``;function X(e,t=400){return Pl(e.replace(/\s+/g,` `).trim(),t).replace(/([\\`*_[\]<>#|~!])/g,`\\$1`)}function Il(e){let t=e.replace(/\s+/g,` `).trim();if(!t)return``;let n=t.includes("`")?"``":"`";return`${n}${n==="``"?` `:``}${t}${n==="``"?` `:``}${n}`}function Ll(e,t){return/^https?:\/\/[^\s)]+$/i.test(t)?`[${X(e||t,120)}](${t})`:X(e)}var Rl=e=>[Il(Y(J(e).id)),X(Y(J(e).title),200)].filter(Boolean).join(` `);function zl(e){return e.replace(/<!--[\s\S]*?(?:-->|$)/g,``).trim()}function Bl(e){return e.replace(/\[((?:\\.|[^\]\\])*)\]\(https?:\/\/[^\s)]+\)/g,`$1`).replace(/\\(.)/g,`$1`).replace(/[*`]/g,``)}var Z=(e,t)=>({tone:e,kind:`item`,md:t}),Vl=(e,t)=>({tone:e,kind:`sub`,md:t});function Hl(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}→ ${Il(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))} ${Il(Y(t.path))})`:``}`)}case`say`:{let t=zl(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 Ul(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))} · ${Ll(Y(e.title)||`untitled`,Y(e.url))}`);case`memory`:return Z(`info`,`${t}↻ ${X(Y(e.text))}`);case`thought`:return Vl(`think`,`*${X(Y(e.text))}*`);case`outcome`:return Vl(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 Hl(e,t);default:return null}}function Wl(e){switch(e.type){case`run-start`:return{tone:`info`,kind:`head`,md:`Browser run: ${X(Y(e.goal),200)}${e.url?` · ${Ll(Y(e.url).replace(/^https?:\/\//,``),Y(e.url))}`:``}`};case`run-event`:return Ul(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`}**${Fl(e.ms)}: ${X(Y(e.error)||Y(t.summary))}${e.runDir?` · ${Il(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))}:** ${Rl(t.case)}`);if(t.type===`case-event`)return Ul(J(t.event),`${Il(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`?`✓`:`✗`} ${Rl(e.case)}: **${X(Y(e.status))}**${Fl(e.ms)}${e.summary?`. ${X(Y(e.summary),240)}`:``}`)}return t.type===`code-start`?Z(`info`,`${Il(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**${Fl(J(e.suite).ms)}`)}case`info`:return Z(e.ok===!1?`fail`:e.ok===!0?`ok`:`info`,X(Y(e.text)));case`agent`:return Hl(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**${Fl(e.ms)}: ${X(Y(e.error),240)}`):!t||t===`passed`?Z(`ok`,`✓ **Test written**${Fl(e.ms)}`):t===`stopped`?Z(`warn`,`**Test writing stopped**${Fl(e.ms)}`):Z(`fail`,`✗ **Test not finished**${Fl(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 Gl(e){let t=Y(e.at)||Y(e.t),n=null;switch(e.type){case`user`:n=Z(`you`,`**You:** ${X(Nl(Y(e.text)),240)}`);break;case`agent`:n=Hl(J(e.event));break;case`tool`:n=Wl(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:Bl(n.md)}:null}var Kl=new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`}),ql=new Intl.DateTimeFormat(`en-GB`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});function Jl(e){let t=e?Date.parse(e):NaN;if(!Number.isFinite(t))return``;let n=new Date(t);return`${Kl.format(n)} ${ql.format(n)}`}function Yl(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=Jl(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(`
|
|
10
|
-
`).replace(/\n{3,}/g,`
|
|
11
|
-
|
|
12
|
-
`).trim()+`
|
|
13
|
-
`}var Xl=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0;function Zl(e){let t=Q(e),n=Xl(t.input),r=Xl(t.output);if(n===void 0||r===void 0)return;let i=Xl(t.cached),a=Xl(t.ms),o=Xl(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 Ql=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 $l(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),eu=[[/^(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`]],tu={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 ru(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=eu.find(([e])=>e.test(a));if(o)return r(e.knowledge,o[1]);if(Object.hasOwn(tu,a))return r(e.systems,tu[a]);let s=hu.find(([e])=>e.test(a))?.[1];s&&r(e.systems,s)}function iu(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 au=[[/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`]],ou=/^(test|attempt|info|review)$/,su=/run_test_cases|browser_run|run_suite|write_test/,cu=[[/(^|_)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 lu(e){let t=e.toLowerCase();return cu.find(([e])=>e.test(t))?.[1]??`work`}function uu(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 du=[[/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 fu(e){let t=e.toLowerCase();if(!_u(t))return du.find(([e])=>e.test(t))?.[1]}var pu=[[/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 mu(e){let t=e.toLowerCase();if(_u(t))return;let n=pu.find(([e])=>e.test(t));return n?{agent:n[1],task:n[2]}:void 0}var hu=[[/^(azure_devops|ado|azuredevops)_/,`Azure DevOps`],[/^(jira|atlassian)_/,`Jira`],[/^confluence_/,`Confluence`],[/^github_/,`GitHub`],[/^xray_/,`Xray`],[/^testrail_/,`TestRail`],[/^zephyr_/,`Zephyr Scale`],[/^qtest_/,`qTest`]],gu=/(^|_)(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 _u(e){let t=e.toLowerCase();if(!t.startsWith(`forgeqe_`))return hu.find(([e])=>e.test(t))?.[1]}var vu=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},yu=e=>Array.isArray(e)?e.map($).filter(Boolean):[];function bu(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:yu(e.changed),reused:yu(e.reused),...n?{runDir:n}:{},...t?{error:t}:{},...$(e.notes)?{notes:$(e.notes)}:{}}}function xu(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 Su(e){let t=e.toLowerCase(),n=_u(t);if(n)return gu.test(t.replace(/^[a-z]+_/,``))?{label:`Updating ${n}`,orb:`working`}:{label:`Reading ${n}`,orb:`reading`};for(let[e,n,r]of au)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 Cu(e,t){return{id:e,user:t,steps:[],parts:[],next:[],asks:[],waits:[],log:[],plan:[],changes:[],tests:[],reports:[],actions:[]}}function wu(e){let t=Q(e);return[$(t.id),$(t.title)].filter(Boolean).join(`: `)}function Tu(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 Eu(e){let t=e.split(`
|
|
14
|
-
`)[0].trim(),n=e.includes(`
|
|
15
|
-
`)?`${t} …`:t;return n.length>80?`${n.slice(0,79)}…`:n}function Du(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:Eu(i),step:{command:i,...o?{output:o}:{},shell:{...a===void 0?{}:{exit:a},...t?n===`running`?{started:t}:{ended:t}:{}}}}}function Ou(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 ku(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=Tu(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&&ou.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`)&&su.test($(n.tool))&&!_u($(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?mu($(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}=Su(_),i=h?void 0:fu($(n.tool)),o=Du(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:lu(_),...i?{agent:i}:{},...o?o.step:{}},h)}}else if(f===`tool`){n.ok!==!1&&$(n.tool)&&ru(t.uses??={skills:[],knowledge:[],systems:[]},$(n.tool),$(n.skill));let r=m?i(e,`c:${m}`):void 0,o=Q(n.file),c=vu(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=Du(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}=Su(_),i=h?void 0:fu($(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:lu(_),...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}=uu($(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`?Ql(n.usage):void 0;if(i){let n=u.get(e);n&&(i.input<n.input||i.output<n.output)&&d.set(e,$l(d.get(e),n)),u.set(e,i),r.usage=$l(d.get(e),i),t.usage=(t.agents||[]).reduce((e,t)=>$l(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 iu(t.uses??={skills:[],knowledge:[],systems:[]},n);if(o===`ui-action`){let t=ea(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:`${wu(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({...bu(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=Gl(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=Cu($(e.id),Nl($(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=xu(e.next),n.error=$(e.error)||void 0,n.ended=$(e.t)||$(e.at),n.spent=Zl(e.spent),t.agents?.length||(t.usage=Ql(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 Au(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 ju(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 Mu(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 Nu(e){if(e===0)return`included in your plan`;let t=Number(e.toFixed(2));return`${t} premium request${t===1?``:`s`}`}function Pu(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 Fu(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 Iu={running:`active`,ok:`done`,fail:`failed`,info:`note`};function Lu(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(Iu[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,...Ru(l)]}function Ru(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 zu(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 Bu=`forgeqe-sidebar-panels`,Vu={env:On,chat:It,usage:Ye,background:We,commands:un,changes:Nt,outputs:Ne};function Hu(e){return null}function Uu(){let[e,t]=(0,U.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(Bu)||`{}`);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(Bu,JSON.stringify(a))}catch{}}]}function Wu({children:e}){let[t,n]=Uu(),r=U.Children.toArray(e).filter(e=>(0,U.isValidElement)(e)&&e.type===Hu).map(e=>e.props),i=r.map(e=>t(e.id,e.initial??!0));return(0,H.jsx)(`div`,{className:`flex flex-col`,children:r.map((e,t)=>{let o=i[t],s=t===0||i[t-1],c=t===r.length-1||i[t+1];return(0,H.jsxs)(`section`,{"aria-labelledby":`panel-${e.id}`,className:g(p,`overflow-hidden transition-[margin,border-radius] duration-200 ease-out motion-reduce:transition-none`,o?g(`rounded-lg`,t>0&&`mt-2`,t<r.length-1&&`mb-2`):g(t>0&&!i[t-1]&&`mt-px`,s?`rounded-t-lg`:`rounded-t-sm`,c?`rounded-b-lg`:`rounded-b-sm`)),children:[(0,H.jsx)(`h3`,{id:`panel-${e.id}`,className:`m-0`,children:(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":o,onClick:()=>n(e.id,e.initial??!0),className:g(a,`min-h-11 gap-2 rounded-none px-2 py-1 font-medium`),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-6 flex-none items-center justify-center`,children:(0,H.jsx)(z,{icon:Vu[e.id]??Dn,size:16})}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.count!==void 0&&(0,H.jsx)(`span`,{className:`flex-none text-body-sm font-normal text-muted tabular-nums`,children:e.count}),(0,H.jsx)(V,{size:14,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform duration-200`,!o&&`-rotate-90`)})]})}),(0,H.jsx)(Oi,{open:o,className:`flex flex-col px-1 pb-2`,children:e.children})]},e.id)})})}function Gu({icon:e,label:t,value:n,detail:r,to:i,title:o,onClick:s,open:c,muted:l}){let u=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-6 flex-none items-center justify-center`,children:(0,H.jsx)(z,{icon:e,size:16,className:`text-muted`})}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`text-label-md text-muted`,children:t}),(0,H.jsx)(`span`,{className:g(`truncate text-body-sm font-medium`,l?`text-muted`:`text-ink`),children:n}),r&&(0,H.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:r})]}),(i||s)&&(0,H.jsx)(ot,{size:14,"aria-hidden":`true`,className:g(`flex-none text-muted transition-transform duration-200 motion-reduce:transition-none`,c&&`rotate-90`)})]}),d=[n,r,o].filter(Boolean).join(` · `),f=`group min-h-11 items-center gap-2 px-1 py-2`;return s?(0,H.jsx)(`button`,{type:`button`,"aria-expanded":c,"data-tip":d,onClick:s,className:g(a,f),children:u}):i?(0,H.jsx)(`a`,{href:i,"data-tip":d,className:g(a,f),children:u}):(0,H.jsx)(`div`,{"data-tip":d,className:g(`flex w-full text-left`,f),children:u})}var Ku=e=>`Tokens used, added up over every model call: ${al(e)}. Each call reads the conversation so far again, so this grows past the context window.`,qu=`How much of the model's context window the conversation fills now. It drops when the conversation is compacted.`;function Ju({title:e,n:t,to:n}){let r=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`flex-1`,children:e}),t!==void 0&&(0,H.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,H.jsx)(`a`,{href:n,"data-tip":`Open ${e}`,className:g(i,`no-underline hover:text-ink`),children:r}):(0,H.jsx)(`span`,{className:i,children:r})}function Yu({icon:e,text:t,value:n,tip:r}){return(0,H.jsxs)(`li`,{"data-tip":r??t,className:`flex min-h-7 items-center gap-2 px-2`,children:[(0,H.jsx)(`span`,{className:`flex size-4 flex-none items-center justify-center text-muted`,"aria-hidden":`true`,children:e}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm text-ink`,children:t}),n!==void 0&&(0,H.jsx)(`span`,{className:`flex-none text-body-sm text-ink tabular-nums`,children:n})]})}function Xu({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,H.jsxs)(`li`,{className:`flex flex-col gap-1 px-2 py-1`,children:[(0,H.jsxs)(`span`,{className:`flex min-h-6 items-center gap-2`,"data-tip":Ku(e.usage),children:[(0,H.jsx)(T,{agent:e.agent,px:16,decorative:!0,working:t}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm text-ink`,children:n.name}),(0,H.jsx)(`span`,{className:`flex-none text-body-sm text-ink tabular-nums`,children:K(e.usage.input+e.usage.output)})]}),r&&(0,H.jsxs)(`span`,{className:`flex items-center gap-2 pl-6`,"data-tip":`${qu} ${K(r.tokens)} of ${K(r.limit)}.`,"aria-label":`Context ${Math.round(i*100)}% full: ${K(r.tokens)} of ${K(r.limit)}`,children:[(0,H.jsx)(ve,{share:i,marks:[],fill:a?`bg-warn`:`bg-accent`,className:`h-1 flex-1`}),(0,H.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 Zu=[{id:`skills`,label:`Skills`,to:r(`skills`),icon:e=>(0,H.jsx)(td,{name:e})},{id:`knowledge`,label:`Knowledge`,to:r(`knowledge`,`notes`),icon:()=>(0,H.jsx)(z,{icon:Hn,size:14})},{id:`sections`,label:`Document sections`,to:r(`knowledge`,`notes`),icon:()=>(0,H.jsx)(z,{icon:ln,size:14})},{id:`systems`,label:`Systems`,icon:()=>(0,H.jsx)(z,{icon:On,size:14})}];function Qu(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 $u=()=>(0,H.jsx)(z,{icon:Vt,size:14}),ed=(0,U.lazy)(()=>m(()=>import(`./logos-Cf-Wf5ex.js`).then(e=>e.c).then(e=>({default:({name:t})=>{let n=Qu(t,e.FRAMEWORK_LOGOS,e.LANGUAGE_LOGOS);return n?(0,H.jsx)(n,{width:15,height:15,"aria-hidden":`true`}):(0,H.jsx)($u,{})}})),__vite__mapDeps([7,2,3,8,9,5])));function td({name:e}){return(0,H.jsx)(U.Suspense,{fallback:(0,H.jsx)($u,{}),children:(0,H.jsx)(ed,{name:e})})}function nd({uses:e}){let t=Zu.map(t=>({...t,names:e?.[t.id]||[]})).filter(e=>e.names.length);return(0,H.jsx)(H.Fragment,{children:t.map(t=>(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsx)(Ju,{title:t.label,n:t.names.length,...t.to?{to:t.to}:{}}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:t.names.map(e=>(0,H.jsx)(Yu,{icon:t.icon(e),text:e},e))}),t.id===`sections`&&e?.text&&e.text.whole>e.text.sent&&(0,H.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 rd({value:e,max:t,warnAt:n,label:r}){return(0,H.jsx)(Oe,{value:e,limit:t,warnAt:n&&t>0?Math.min(1,n/t):.8,label:r,className:`mt-1`})}var id=e=>{try{return e?new URL(e).host:``}catch{return``}},ad=e=>e.split(/[\\/]/).filter(Boolean).pop()||e;function od({path:e,icon:t,extra:n}){let[r,i]=(0,U.useState)(``);return(0,H.jsxs)(`li`,{className:`flex flex-col`,children:[(0,H.jsxs)(`button`,{type:`button`,"data-tip":`Open ${e}`,onClick:async()=>i(await Ce(e)),className:g(a,`min-h-8 gap-2 py-0`),children:[(0,H.jsx)(z,{icon:t,size:15,className:`flex-none text-muted`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-body-sm text-accent-fg`,children:ad(e)}),n]}),r&&(0,H.jsx)(`span`,{className:`px-4 text-body-sm text-fail`,children:r})]})}function sd(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 cd({c:e}){let t=e.status===`running`?ld(e.started):sd(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,H.jsx)(`li`,{children:(0,H.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,H.jsx)(Ut,{size:15,"aria-hidden":`true`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,H.jsx)(z,{icon:e.status===`ok`?nt:Kn,size:15,className:g(`mt-1 flex-none`,e.status===`ok`?`text-pass`:e.status===`fail`?`text-fail`:`text-muted`)}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate font-mono text-body-sm text-ink`,children:Eu(e.command)}),(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:[e.agent?I(e.agent).name:``,n,t].filter(Boolean).join(` · `)})]})]})})}function ld(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 ud({chat:e}){let[t,n]=(0,U.useState)(null),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(null),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)([]);(0,U.useEffect)(()=>{let e=!1,t=()=>ce.list().then(t=>!e&&d(t.tasks),()=>{});t();let n=Ei(t,4e3);return()=>{e=!0,Di(n)}},[]);let f=location.hash.replace(/^#\/?/,``),p=e?.commands??[],m=zu(p),_=u.filter(e=>e.to!==f);(0,U.useEffect)(()=>{let e=!1,t=()=>de.state().then(t=>{if(!e){if(n(t),!t.ready)return a(null);se.get().then(t=>!e&&a(t),()=>{})}},()=>{});return t(),window.addEventListener(`hashchange`,t),()=>{e=!0,window.removeEventListener(`hashchange`,t)}},[]),(0,U.useEffect)(()=>{if(!t?.ready)return;let n=!1,r=()=>pe.tokenomics().then(e=>!n&&s(e),()=>{});r();let i=Ei(r,e?.busy?3e4:18e4);return()=>{n=!0,Di(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,H.jsxs)(Wu,{children:[(0,H.jsx)(Hu,{id:`env`,title:`Environment`,initial:!1,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 py-1`,children:[(0,H.jsx)(Gu,{icon:Be,label:`Project`,value:t?.ready?v:`Not set up`,muted:!t?.ready,to:r(`settings`,`setup`),title:t?.project}),i&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Gu,{icon:dt,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,H.jsx)(Gu,{icon:On,label:`Test environment`,value:C?.active?C.active:C?.names.length?`None active`:`None yet`,muted:!C?.active,detail:C?.active&&id(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,H.jsx)(Gu,{icon:dn,label:`Files`,value:`${i.files.filter(e=>e.exists).length} of ${i.files.length} set up`,onClick:()=>l(!c),open:c}),(0,H.jsx)(Oi,{open:c,children:(0,H.jsx)(`ul`,{className:`m-0 mb-1 ml-8 flex list-none flex-col gap-1 p-0`,children:i.files.map(e=>(0,H.jsx)(`li`,{children:(0,H.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,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.label}),(0,H.jsx)(`span`,{className:`truncate font-mono text-body-sm text-ink`,children:e.path})]})},e.label))})})]})]})}),e&&(0,H.jsx)(Hu,{id:`chat`,title:`This chat`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.agents?.length&&e.usage?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[(0,H.jsx)(Yu,{icon:(0,H.jsx)(z,{icon:Ye,size:14}),text:`Tokens used`,value:(0,H.jsx)(`span`,{className:`font-medium`,children:K(e.usage.input+e.usage.output)}),tip:Ku(e.usage)}),(0,H.jsxs)(`li`,{"data-tip":al(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,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsx)(Ju,{title:`Agents`,n:e.agents.length}),(0,H.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,H.jsx)(Xu,{a:t,working:!!e.busy&&n===0},t.agent))})]})]}):(0,H.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,H.jsx)(nd,{uses:e.uses})]})}),t?.ready&&(0,H.jsx)(Hu,{id:`usage`,title:`This project`,children:(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.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,H.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,H.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,H.jsx)(`span`,{className:`sr-only`,children:`Open Tokenomics`})]}),o?.spent&&o.budget?.month?(0,H.jsxs)(`div`,{className:`px-2 py-2`,children:[(0,H.jsxs)(`span`,{className:`flex items-baseline gap-2 text-body-sm text-muted`,children:[(0,H.jsx)(`span`,{className:`flex-1`,children:`This month, this computer`}),(0,H.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,H.jsx)(rd,{value:o.spent.month,max:o.budget.month,label:`This month's spend`})]}):null]})}),_.length>0&&(0,H.jsx)(Hu,{id:`background`,title:`Background tasks`,count:_.length,children:(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:_.map((e,t)=>(0,H.jsx)(`li`,{children:(0,H.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,H.jsx)(Ut,{size:15,"aria-hidden":`true`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-sm text-ink`,children:e.label}),(0,H.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[e.detail||`Running`,ld(e.startedAt)&&` · ${ld(e.startedAt)}`]})]})]})},`${e.kind}-${t}`))})}),p.length>0&&(0,H.jsxs)(Hu,{id:`commands`,title:`Commands`,count:p.length,children:[(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:m.map(e=>(0,H.jsx)(cd,{c:e},e.key))}),p.length>m.length&&(0,H.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,H.jsxs)(Hu,{id:`changes`,title:`Changes`,count:e.changes.length,children:[(0,H.jsxs)(`span`,{className:`px-4 pb-1 font-mono text-body-sm tabular-nums`,children:[h(e.changes.length,`file`),` · `,(0,H.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,H.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.changes.map(e=>(0,H.jsx)(od,{path:e.path,icon:Nt,extra:(0,H.jsxs)(`span`,{className:`flex-none font-mono text-body-sm tabular-nums`,children:[(0,H.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,H.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})},e.path))}),e.onCreatePr&&(0,H.jsx)(`div`,{className:`px-2 pt-2 pb-1`,children:(0,H.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,H.jsx)(Qe,{"aria-hidden":`true`}),`Pull request`]})})]}),e?.outputs&&e.outputs.length>0&&(0,H.jsx)(Hu,{id:`outputs`,title:`Outputs`,count:e.outputs.length,children:(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.outputs.map(e=>(0,H.jsx)(od,{path:e.path,icon:e.kind===`test`?dn:/\.html?$/i.test(e.path)?Jt:e.kind===`report`?Ne:Hn,extra:(0,H.jsx)(`span`,{className:`flex-none text-body-sm text-muted`,children:e.label})},e.path))})})]})}var dd=24;function fd(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])<=dd));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])<=dd):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 pd(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 md(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 hd(e){let t=md(await pd(e));if(!t)return null;let{canvas:n,ctx:r}=t,i=fd(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 gd=new Map;function _d(e){return gd.has(e)||gd.set(e,hd(e).then(t=>t?t.toDataURL(`image/png`):e).catch(()=>e)),gd.get(e)}var vd=20971520,yd=[1,.75,.5,.35],bd=[[`image/png`,void 0],[`image/webp`,.92],[`image/webp`,.8]];async function xd(e,t){for(let n of yd)for(let[r,i]of bd){let a=await e(n,r,i);if(a&&a.type===r&&a.size<=t)return a}return null}function Sd(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 Cd={"image/png":`.png`,"image/webp":`.webp`};async function wd(e,t){let n=t=>new File([t],e.name.replace(/\.[^.]+$/,``)+Cd[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 ${vd/1024/1024} MB: save a smaller copy and upload that.`);let r=await pd(await Sd(e)).catch(()=>null),i=r&&md(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=fd(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 xd((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 hd(await Sd(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 Td=`/assets/forgeqe-logo-D3CwM2Jl.png`,Ed=`/assets/forgeqe-logo-white-CoE-hF2l.png`,Dd=`/assets/forgeqe-mark-ZLd4S3hw.png`;function Od(e){let[t,n]=(0,U.useState)({});return(0,U.useEffect)(()=>{if(!e)return;let t=!0;return _d(e).then(r=>t&&n({from:e,to:r})),()=>{t=!1}},[e]),e&&t.from===e?t.to:e}var kd=e=>`#${e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``)}`;function Ad(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:kd([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:kd(o.map(e=>e/s))}:null}catch{return null}}var jd=`h-auto w-auto min-h-10 max-h-[112px] max-w-full object-contain`,Md=`h-11 w-auto max-w-[168px] object-contain object-left`;function Nd({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:jd,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?jd:Md,grow:s,auto:!1}:{cls:s?`size-12 object-contain`:`size-8 object-contain`,grow:!1,auto:!1}}function Pd({theme:e,compact:t=!1,onPlate:n}){let{mode:r}=M(),i=r===`dark`?Ed:Td,a=Od(e.logo)||i,[o,s]=(0,U.useState)(e.logo?1:2.1),[c,l]=(0,U.useState)(null),u=o>1.6,d=Nd({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?O(c,v(e,r)):null,m=f&&!!O(c,v(e,r));(0,U.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,H.jsx)(`img`,{src:a,alt:``,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&s(t.naturalWidth/t.naturalHeight),l(Ad(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,H.jsxs)(`span`,{className:g(`flex min-w-0 items-center gap-2`,d.grow&&`flex-1`),children:[h===`tile`||p?(0,H.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,H.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name})]})}function Fd({theme:e}){let{mode:t}=M(),[n,r]=(0,U.useState)(1),[i,a]=(0,U.useState)(null),o=Od(e.logoMark||e.logo),s=!!o&&(!!e.logoMark||n<=1.6),c=s?O(i,v(e,t)):null;return s?(0,H.jsx)(`span`,{style:c?{background:c}:void 0,className:g(`flex size-9 items-center justify-center rounded-base`,c&&`p-1`),children:(0,H.jsx)(`img`,{src:o,alt:``,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&r(t.naturalWidth/t.naturalHeight),a(Ad(t))},className:g(`block size-full object-contain`,e.logoFrame===`circle`?`rounded-full`:`rounded-sm`)})}):(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`flex size-9 items-center justify-center`,children:[(0,H.jsx)(`img`,{src:Dd,alt:``,className:`block size-9 object-contain`}),o&&!e.logoMark&&(0,H.jsx)(`img`,{src:o,alt:``,className:`hidden`,onLoad:e=>e.currentTarget.naturalHeight&&r(e.currentTarget.naturalWidth/e.currentTarget.naturalHeight)})]})}var Id=`/assets/capgemini-mark-D6aZFnD3.png`,Ld=`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`,Rd=`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 zd({rail:e=!1}){let{mode:t}=M();return e?(0,H.jsx)(`img`,{src:Id,alt:`Capgemini`,"data-tip":`Capgemini`,"data-tip-side":`left`,className:`mb-1 size-8 flex-none object-contain`}):(0,H.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,H.jsx)(`path`,{fill:t===`dark`?`#fff`:`#12ABDB`,fillRule:`evenodd`,d:Ld}),(0,H.jsx)(`path`,{fill:t===`dark`?`#fff`:`#0070AD`,fillRule:`evenodd`,d:Rd})]})}function Bd({title:e,children:t,defaultOpen:n}){let[r,i]=(0,U.useState)(!!n),a=(0,U.useId)();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(!r),className:`self-start`,children:[(0,H.jsx)(V,{size:15,"aria-hidden":`true`,className:g(`transition-transform`,r&&`rotate-180`)}),e]}),(0,H.jsx)(Oi,{open:r,id:a,children:t})]})}function Vd({review:e,className:t}){return(0,H.jsxs)(`div`,{className:g(`flex flex-col gap-2 text-body-sm leading-relaxed`,t),children:[e.summary&&(0,H.jsx)(`p`,{className:`m-0 text-ink-2 [overflow-wrap:anywhere]`,children:e.summary}),e.issues.length>0&&(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.issues.map((e,t)=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,H.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,H.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.file&&(0,H.jsx)(`span`,{className:`font-mono text-body-sm text-muted [overflow-wrap:anywhere]`,children:e.file}),(0,H.jsx)(`span`,{className:`text-ink [overflow-wrap:anywhere]`,children:e.problem}),e.fix&&(0,H.jsxs)(`span`,{className:`text-muted [overflow-wrap:anywhere]`,children:[`Fix: `,e.fix]})]})]},t))})]})}var Hd={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 Ud({status:e,orb:t,px:n=20,spin:r=!1}){let i={width:n,height:n};return e===`active`&&r?(0,H.jsx)(`span`,{role:`img`,"aria-label":`At work`,className:`flex flex-none items-center justify-center`,style:i,children:(0,H.jsx)(Ut,{size:n-2,strokeWidth:2.5,"aria-hidden":`true`,className:`animate-spin text-accent-fg motion-reduce:animate-none`})}):e===`active`?(0,H.jsx)(_e,{state:t,px:n,label:`At work`}):e===`done`?(0,H.jsx)(`span`,{role:`img`,"aria-label":`Done`,className:`flex flex-none items-center justify-center`,style:i,children:(0,H.jsx)(Ln,{size:n*.8,strokeWidth:2.5,"aria-hidden":`true`,className:`text-icon`})}):e===`failed`?(0,H.jsx)(`span`,{role:`img`,"aria-label":`Failed`,className:`flex flex-none items-center justify-center`,style:i,children:(0,H.jsx)(Ue,{size:n*.8,strokeWidth:2.5,"aria-hidden":`true`,className:`text-fail`})}):e===`note`?(0,H.jsx)(`span`,{role:`img`,"aria-label":`Note`,className:`flex flex-none items-center justify-center`,style:i,children:(0,H.jsx)(`span`,{className:`size-1.5 rounded-full bg-line-strong`})}):(0,H.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 Wd=(e,t)=>e.status===`running`?t?`active`:`done`:e.status===`ok`?`done`:e.status===`fail`?`failed`:`note`,Gd={read:Hn,search:ft,list:Ne,edit:In,run:Lt,element:Kt,outline:jn,references:Ve,impact:Re,find:Gn,testfile:vt,web:ht,environment:On,cases:bt,browser:ht,post:Gt,test:vt,retry:Xe,review:tn,task:tt,work:Tt},Kd={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`},qd={done:`Done`,failed:`Failed`,active:`At work`,pending:`To come`,skipped:`Skipped`,note:`Note`};function Jd({kind:e,status:t}){let n=g(`mt-px flex size-4 flex-none items-center justify-center`,Kd[t]);if(e===`skill`)return(0,H.jsxs)(`span`,{role:`img`,"aria-label":qd[t],className:g(n,`relative`),children:[(0,H.jsx)(f,{name:x.skills,px:15}),(t===`done`||t===`failed`)&&(0,H.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=Gd[e];return(0,H.jsx)(`span`,{role:`img`,"aria-label":qd[t],className:n,children:(0,H.jsx)(r,{size:15,strokeWidth:2,"aria-hidden":`true`})})}function Yd({status:e}){return e===`active`?(0,H.jsx)(Ut,{size:12,strokeWidth:2.5,"aria-label":`At work`,className:`mt-1 flex-none animate-spin text-accent-fg motion-reduce:animate-none`}):(0,H.jsx)(`span`,{role:`img`,"aria-label":qd[e],className:g(`mt-2 size-2 flex-none rounded-full`,e===`done`?`bg-accent`:e===`failed`?`bg-fail`:`bg-line-strong`)})}function Xd({text:e,label:t}){let[n,r]=(0,U.useState)(!1);return(0,H.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,H.jsx)(Ln,{size:13,"aria-hidden":`true`,className:`text-icon`}):(0,H.jsx)(kt,{size:13,"aria-hidden":`true`})})}function Zd({step:e,failed:t}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 py-1 font-mono text-body-sm leading-relaxed`,children:[e.command&&(0,H.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2 text-muted`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none select-none`,children:`$`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.command}),(0,H.jsx)(Xd,{text:e.command,label:`Copy the command`})]}),e.output&&(0,H.jsxs)(`div`,{className:`group flex min-w-0 items-start gap-2`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none text-muted select-none`,children:`⎿`}),(0,H.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,H.jsx)(Te,{text:e.output})}),(0,H.jsx)(Xd,{text:e.output,label:`Copy the output`})]}),e.shell?.exit!==void 0&&e.shell.exit!==0&&(0,H.jsxs)(`span`,{className:`text-fail`,children:[`Exit code `,e.shell.exit]})]})}var Qd=e=>/[/\\]|\.\w{1,5}$|^\$ /.test(e)&&!/\s{2,}/.test(e);function $d({text:e}){return(0,H.jsx)(`span`,{className:g(p,`min-w-0 max-w-full truncate rounded-sm px-2 py-1 text-body-sm text-ink-2`,Qd(e)&&`font-mono text-body-sm`),children:e})}function ef(e){return{count:e.length,failed:e.filter(e=>e.ok===!1).length,latest:e[e.length-1]}}function tf({line:e}){return(0,H.jsxs)(`li`,{className:g(`flex gap-2 [overflow-wrap:anywhere]`,e.ok===!1?`text-fail`:`text-ink-2`),children:[e.ok!==void 0&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:e.ok?`text-icon`:void 0,children:e.ok?`✓`:`✗`}),(0,H.jsx)(be,{text:e.text,className:`min-w-0 text-body-sm leading-relaxed text-inherit [&_p]:my-0`,fill:!0})]})}function nf({step:e}){let[t,n]=(0,U.useState)(!1),r=e.lines.length>3&&!t,{count:i,failed:a,latest:o}=ef(e.lines);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.lines.length>3&&(0,H.jsxs)(B,{variant:`link`,size:`inline`,"aria-expanded":t,onClick:()=>n(!t),className:`w-fit gap-1`,children:[(0,H.jsxs)(`span`,{children:[t?`Hide`:`Show`,` `,i,` lines`,a>0&&(0,H.jsxs)(`span`,{className:`text-fail`,children:[` · `,a,` failed`]})]}),(0,H.jsx)(V,{size:13,"aria-hidden":`true`,className:g(`transition-transform`,t&&`rotate-180`)})]}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm leading-relaxed`,children:r?o&&(0,H.jsx)(tf,{line:o}):e.lines.map((e,t)=>(0,H.jsx)(tf,{line:e},t))})]})}function rf({agent:e,named:t=!0,working:n=!1,state:r,orb:i}){let a=I(e),o=j(e);return(0,H.jsxs)(`span`,{className:`inline-flex flex-none items-center gap-2`,"data-tip":a.name,children:[(0,H.jsx)(T,{agent:e,px:24,decorative:t,working:n,state:r,activity:n?E(i):void 0}),t&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`font-medium`,style:{color:o},children:a.name}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`})]})]})}var af=e=>e===`active`?`thinking`:e===`failed`?`failed`:e===`done`?`done`:`idle`;function of({step:e,from:t,to:n,live:r}){let i=I(n),a=j(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,H.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,H.jsx)(T,{agent:t,px:24,activity:r?`handing`:void 0}),(0,H.jsxs)(`span`,{role:`img`,"aria-label":`hands off to`,className:g(`handoff-flow flex-none`,r&&`is-live`),style:{color:a},children:[(0,H.jsx)(`span`,{}),(0,H.jsx)(`span`,{}),(0,H.jsx)(`span`,{})]}),(0,H.jsx)(T,{agent:n,px:28,decorative:!0,state:o,activity:r?E(s):void 0,className:`handoff-in`}),(0,H.jsx)(`span`,{className:`font-medium`,style:{color:a},children:i.name}),!e.handoff&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`·`}),(0,H.jsx)(`span`,{className:g(`[overflow-wrap:anywhere]`,r?`text-ink`:`text-ink-2`),children:e.label})]}),e.arg&&(0,H.jsx)($d,{text:e.arg})]})}function sf({step:e,working:t,from:n=N}){let r=e.agent||n,i=cf(e),o=Wd(e,t),[s,c]=(0,U.useState)(null),l=s??((!!e.handoff||!!e.agent||!!e.shell||e.key.startsWith(`try:`))&&o===`active`),u=(0,H.jsxs)(H.Fragment,{children:[e.handoff||r!==n?(0,H.jsx)(Ud,{status:o,orb:e.orb,px:14,spin:!0}):!e.icon&&(0,H.jsx)(Yd,{status:o}),e.handoff||r!==n?(0,H.jsx)(of,{step:e,from:n,to:e.handoff?.agent??r,live:o===`active`}):(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[e.icon?(0,H.jsx)(Jd,{kind:e.icon,status:o}):(0,H.jsx)(rf,{agent:r,named:!1,working:o===`active`,state:af(o),orb:e.orb}),(0,H.jsx)(`span`,{className:g(`[overflow-wrap:anywhere]`,o===`active`?`text-ink`:`text-ink-2`),children:e.label}),e.arg&&(0,H.jsx)($d,{text:e.arg}),e.change&&(0,H.jsxs)(`span`,{className:`font-mono text-body-sm tabular-nums`,children:[(0,H.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.change.added]}),` `,(0,H.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.change.removed]})]})]}),i&&(0,H.jsx)(V,{size:14,"aria-hidden":`true`,className:g(`mt-1 ml-auto flex-none text-muted transition-transform`,l&&`rotate-180`)})]});return(0,H.jsxs)(`li`,{className:`flex flex-col`,children:[i?(0,H.jsx)(`button`,{type:`button`,"aria-expanded":l,onClick:()=>c(!l),className:g(a,`min-h-8 items-start gap-2 px-2 py-2`),children:u}):(0,H.jsx)(`div`,{className:`flex min-h-8 items-start gap-2 px-2 py-2 text-body-sm`,children:u}),i&&(0,H.jsx)(Oi,{open:l,children:(0,H.jsx)(lf,{step:e,working:t,from:n,className:`mb-1 ml-4`})})]})}var cf=e=>e.lines.length>0||(e.children?.length??0)>0||!!e.handoff?.result||!!e.change||!!e.output||!!e.command||!!e.review;function lf({step:e,working:t,from:n,className:r}){let i=e.children||[],a=e.handoff?.agent||e.agent;return(0,H.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,H.jsx)(Zd,{step:e,failed:e.status===`fail`}),e.review&&(0,H.jsx)(Vd,{review:e.review}),e.lines.length>0&&(0,H.jsx)(nf,{step:e}),e.change&&(0,H.jsx)(De,{diff:e.change.diff}),i.length>0&&(0,H.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,H.jsx)(sf,{step:e,working:t,from:a||n},e.key))}),e.handoff?.result&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 text-body-sm`,children:[(0,H.jsxs)(`span`,{className:`text-muted`,children:[re(I(e.handoff.agent).name,!0),` answered`]}),(0,H.jsx)(be,{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 uf({node:e,last:t,working:n,now:r,orbed:i}){let o=e.step?[]:e.steps,s=e.step,c=o.length>0||!!r||!!s&&cf(s),[l,u]=(0,U.useState)(null),d=l??(e.status===`active`||e.status===`failed`),f=s?.orb??o.findLast(e=>e.status===`running`)?.orb??r?.orb??`thinking`;return(0,H.jsxs)(`li`,{className:`flex gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-none flex-col items-center`,children:[(0,H.jsx)(`span`,{className:`mt-1`,children:(0,H.jsx)(Ud,{status:e.status,orb:f,px:16,spin:!i})}),!t&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:g(`mt-2 min-h-4 w-0 flex-1 border-l border-dotted`,Hd[e.status])})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pb-2`,children:[c?(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>u(!d),className:g(a,`min-h-7 items-start gap-2 p-0`),children:[(0,H.jsx)(df,{node:e,orb:f}),(0,H.jsx)(V,{size:14,"aria-hidden":`true`,className:g(`mt-1 flex-none text-muted transition-transform`,d&&`rotate-180`)}),e.status===`active`&&(0,H.jsx)(we,{tone:`running`,icon:!1,className:`mt-1 ml-1 flex-none`,children:`In progress`})]}):(0,H.jsx)(`div`,{className:`min-h-7`,children:(0,H.jsx)(df,{node:e,orb:f})}),c&&(0,H.jsx)(Oi,{open:d,className:`mt-1`,children:s?(0,H.jsx)(lf,{step:s,working:n,from:`forgeqe`,className:`mt-1`}):(0,H.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[o.map(e=>(0,H.jsx)(sf,{step:e,working:n},e.key)),r&&(0,H.jsx)(`li`,{children:(0,H.jsx)(mf,{live:r,className:`px-2`})})]})})]})]})}function df({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,H.jsx)(of,{step:r,from:N,to:r.handoff?.agent??r.agent,live:e.status===`active`}):(0,H.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,H.jsx)(rf,{agent:r.agent||`forgeqe`,named:!!r.agent&&r.agent!==`forgeqe`,working:e.status===`active`,state:af(e.status),orb:t}),e.status===`active`?(0,H.jsx)(`span`,{className:`shimmer [overflow-wrap:anywhere]`,children:(0,H.jsx)(`span`,{children:e.label})}):(0,H.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.label}),r?.arg&&(0,H.jsx)($d,{text:r.arg})]})}var ff={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 pf(e){let[t,n]=(0,U.useState)(()=>Date.now());(0,U.useEffect)(()=>{let e=Ei(()=>n(Date.now()),1e3);return()=>Di(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?js(i,`second`):js(Math.floor(i/60),`minute`)}function mf({live:e,orb:t=!1,className:n}){let r=pf(e.latest?.at);return(0,H.jsxs)(`div`,{className:g(`flex min-h-8 items-start gap-2 py-1`,n),children:[(0,H.jsx)(`span`,{className:`mt-1 flex size-4 flex-none items-center justify-center`,children:t?(0,H.jsx)(_e,{state:e.orb,px:20,label:`At work`}):(0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`relative flex size-2`,children:[(0,H.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-accent opacity-60 motion-reduce:animate-none`}),(0,H.jsx)(`span`,{className:`relative inline-flex size-2 rounded-full bg-accent`})]})}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`shimmer text-body-sm font-medium text-muted`,children:(0,H.jsx)(`span`,{"aria-live":`polite`,children:e.text})}),e.latest&&(0,H.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,H.jsx)(`span`,{className:g(`min-w-0 truncate font-mono text-body-sm`,ff[e.latest.tone]),children:e.latest.plain}),(0,H.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 hf({turn:e,working:t,live:n,folded:r=!1}){if(r)return(0,H.jsx)(mf,{live:n,orb:!0});let i=Lu(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,H.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,H.jsx)(`li`,{className:`flex gap-4`,children:(0,H.jsx)(mf,{live:n,orb:!c,className:`-mt-1 min-w-0 flex-1 py-0`})},`now`):(0,H.jsx)(uf,{node:e,last:r===s.length-1,working:t,now:a===e?n:void 0,orbed:c===e},e.key))})}var gf={passed:`Passed`,failed:`Failed`,stopped:`Stopped`,blocked:`Blocked`};function _f({label:e,children:t}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-body-sm text-muted sm:pt-1`,children:e}),(0,H.jsx)(`dd`,{className:`m-0 min-w-0 text-body-sm [overflow-wrap:anywhere]`,children:t})]})}function vf({text:e}){return(0,H.jsxs)(`span`,{role:`figure`,"aria-label":`Command`,className:`flex min-w-0 items-start gap-2`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`flex-none font-mono text-label-md leading-6 font-normal text-muted select-none`,children:`$`}),(0,H.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,H.jsx)(Ee,{text:e,label:`Copy the command`})]})}function yf(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 bf({name:e}){let t=e.lastIndexOf(`.`),n=t>0?e.slice(t+1):e,r=t>0?e.slice(0,t):``;return(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,"data-tip":e,children:[(0,H.jsx)(`span`,{className:`font-mono text-label-md font-normal text-ink [overflow-wrap:anywhere]`,children:n}),r&&(0,H.jsx)(`span`,{className:`font-mono text-label-md font-normal text-muted [overflow-wrap:anywhere]`,children:r})]})}function xf({t:e}){let t=yf(e);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 border-l-2 border-line-strong pl-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,H.jsx)(vt,{size:16,strokeWidth:2,"aria-hidden":`true`,className:e.ok?`text-pass`:e.status===`stopped`?`text-muted`:`text-fail`}),(0,H.jsx)(`span`,{className:`text-body-md font-medium`,children:e.ok?`Test written`:`Test not finished`}),(0,H.jsx)(we,{tone:e.ok?`pass`:e.status===`stopped`?`neutral`:`fail`,children:gf[e.status]||e.status||`Not written`}),t&&(0,H.jsx)(`span`,{className:`ml-auto text-body-sm text-muted tabular-nums`,children:t})]}),(0,H.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,H.jsx)(_f,{label:`Test`,children:(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[e.testFile&&(0,H.jsx)(Se,{path:e.testFile}),e.testName&&(0,H.jsx)(bf,{name:e.testName})]})}),e.command&&(0,H.jsx)(_f,{label:`Run it`,children:(0,H.jsx)(vf,{text:e.command})}),e.review&&(0,H.jsx)(_f,{label:e.review.approved?`Review`:`Review asked`,children:(0,H.jsx)(Vd,{review:e.review})}),e.runDir&&(0,H.jsx)(_f,{label:`From the run`,children:(0,H.jsx)(Se,{path:e.runDir})}),e.reused.length>0&&(0,H.jsx)(_f,{label:`Reused`,children:(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.reused.map(e=>(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsx)(Se,{path:e})},e))})})]}),e.error&&(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-fail [overflow-wrap:anywhere]`,children:e.error})]})}function Sf({c:e}){let[t,n]=(0,U.useState)(!1);return(0,H.jsxs)(`li`,{className:`flex flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-9 items-center gap-2`,children:[(0,H.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,H.jsx)(V,{size:15,"aria-hidden":`true`,className:g(`transition-transform`,!t&&`-rotate-90`)})}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,H.jsx)(Se,{path:e.path})}),(0,H.jsxs)(`span`,{className:`flex-none font-mono text-body-sm tabular-nums`,children:[(0,H.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,H.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]}),(0,H.jsx)(Oi,{open:t,children:(0,H.jsx)(De,{diff:e.diff,className:`mb-2 ml-10`})})]})}function Cf({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,H.jsxs)(`section`,{"aria-label":`Result`,className:`flex flex-col gap-4 pt-4`,children:[e.tests.map((e,t)=>(0,H.jsx)(xf,{t:e},t)),t.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Reports`}),(0,H.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,children:t.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,H.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,H.jsx)(Se,{path:e.path})]},e.path))})]}),(e.changes.length>0||r.length>0)&&(0,H.jsxs)(`div`,{className:g(`flex flex-col gap-1`,(e.tests.length>0||t.length>0)&&`pt-4`),children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-body-sm font-medium`,children:[(0,H.jsx)(Nt,{size:15,"aria-hidden":`true`,className:`text-muted`}),`Files changed`,(0,H.jsxs)(`span`,{className:`font-normal text-muted`,children:[h(e.changes.length+r.length,`file`),e.changes.length>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.changes.reduce((e,t)=>e+t.added,0)]}),` `,(0,H.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.changes.reduce((e,t)=>e+t.removed,0)]})]})]})]}),(0,H.jsxs)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:[e.changes.map(e=>(0,H.jsx)(Sf,{c:e},e.path)),r.map(e=>(0,H.jsx)(`li`,{className:`flex min-h-9 items-center gap-2 pl-10`,children:(0,H.jsx)(Se,{path:e})},e))]})]})]})}var wf=/^\s*(?:[-*>]\s*)?(?:\*\*|__)?\s*(?:sources?|evidence|references?|refs?)\s*(?:\*\*|__)?\s*:/i;function Tf(e){let t=[],n=[],r=!1;for(let i of e.split(`
|
|
16
|
-
`))/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&wf.test(i)?n.push(i.trim()):t.push(i);return{body:t.join(`
|
|
17
|
-
`).replace(/\n{3,}/g,`
|
|
18
|
-
|
|
19
|
-
`).trimEnd(),sources:n.join(`
|
|
20
|
-
|
|
21
|
-
`)}}var Ef=1.5;function Df(e,t){if(e>=t)return t;let n=t-e;return Math.min(t,e+Math.max(Ef,n/45))}function Of(e,t){return Math.min(Math.floor(t),e.length)}var kf=()=>typeof window<`u`&&!!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;function Af(e,t){let n=(0,U.useRef)(t);t&&(n.current=!0);let r=n.current&&!kf(),[i,a]=(0,U.useState)(()=>r?0:e.length),o=(0,U.useRef)(i),s=(0,U.useRef)(e);s.current!==e&&(o.current=Of(e,o.current),s.current=e),r||(o.current=e.length),(0,U.useEffect)(()=>{if(!r||o.current>=e.length){a(o.current);return}let t=0,n=()=>{o.current=Df(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 jf={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 Mf({at:e}){let t=Jl(e),[n,r]=t?[t.slice(0,t.lastIndexOf(` `)),t.slice(t.lastIndexOf(` `)+1)]:[``,``];return(0,H.jsxs)(`time`,{dateTime:e,className:`w-28 flex-none text-body-sm whitespace-nowrap tabular-nums`,children:[(0,H.jsx)(`span`,{className:`text-muted/70`,children:n}),` `,(0,H.jsx)(`span`,{className:`text-muted`,children:r})]})}function Nf({line:e}){let[t,n]=(0,U.useState)(!1),r=e.plain.length>160;return e.kind===`head`?(0,H.jsxs)(`li`,{className:`mt-4 flex items-baseline gap-4 border-b border-line-soft pb-1 first:mt-0`,children:[(0,H.jsx)(Mf,{at:e.at}),(0,H.jsx)(be,{text:e.md,className:g(`min-w-0 text-body-sm font-medium text-ink [&_p]:my-0`),fill:!0})]}):(0,H.jsxs)(`li`,{className:g(`flex items-baseline gap-4 py-1`,e.kind===`sub`&&`pl-4`),children:[(0,H.jsx)(Mf,{at:e.at}),e.kind===`out`?(0,H.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,H.jsx)(Te,{text:e.plain})}):(0,H.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,H.jsx)(be,{text:e.md,className:g(`text-body-sm leading-relaxed [overflow-wrap:anywhere] [&_code]:text-body-sm [&_p]:my-0`,jf[e.tone],r&&!t&&`line-clamp-2`),fill:!0})})]})}function Pf({lines:e,live:t,name:n,timeline:r=!1}){let i=(0,U.useRef)(null),a=(0,U.useRef)(!0),[o,s]=(0,U.useState)(!1),c=(0,U.useMemo)(()=>Yl(e),[e]);return(0,U.useEffect)(()=>{a.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[c]),(0,H.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-9 items-center gap-1 border-b border-line-soft text-body-sm text-muted`,children:[(0,H.jsxs)(`span`,{className:`flex-1`,children:[e.length,` event`,e.length===1?``:`s`,t&&` · live`]}),(0,H.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,H.jsx)(Ln,{size:14,"aria-hidden":`true`,className:`text-pass`}):(0,H.jsx)(kt,{size:14,"aria-hidden":`true`})}),(0,H.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,H.jsx)(z,{icon:nn,size:14})})]}),(0,H.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,H.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.map((e,t)=>(0,H.jsx)(Nf,{line:e},t))})})]})}function Ff({ask:e,live:t,onAnswer:n}){let r=t&&e.answer===void 0;return(0,H.jsxs)(`div`,{className:g(`flex flex-col gap-4`,r?ge.info:`py-1`),children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,H.jsx)(jt,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none text-icon`}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.title}),e.detail&&(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:e.detail}),e.lines.map((e,t)=>(0,H.jsx)(`span`,{className:`text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]})]}),r?(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.options.map(e=>(0,H.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,H.jsxs)(B,{size:`sm`,variant:`outline`,onClick:()=>n(null),children:[(0,H.jsx)(Ue,{"aria-hidden":`true`}),`Cancel`]})]}):(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.answer===void 0?`Not answered`:`You chose: ${e.answer}`})]})}function If({wait:e,live:t,onProceed:n}){let r=t&&e.answer===void 0;return(0,H.jsxs)(`div`,{className:g(`flex flex-col gap-4`,r?ge.info:`py-1`),children:[(0,H.jsxs)(`span`,{className:`flex items-start gap-2`,children:[(0,H.jsx)($e,{size:18,"aria-hidden":`true`,className:`mt-1 flex-none text-icon`}),(0,H.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.prompt})]}),r?(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsxs)(B,{size:`sm`,variant:`primary`,"data-tip":`Done, continue`,onClick:()=>n(!0),children:[(0,H.jsx)(gn,{"aria-hidden":`true`}),`Continue`]}),(0,H.jsxs)(B,{size:`sm`,onClick:()=>n(!1),children:[(0,H.jsx)(Ue,{"aria-hidden":`true`}),`Cancel`]})]}):(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.answer===void 0?`Not done`:e.answer?`You continued`:`You cancelled`})]})}function Lf(e,t){let[n,r]=(0,U.useState)(!1),i=(0,U.useRef)(t);return(0,U.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 Rf({started:e}){let[t,n]=(0,U.useState)(()=>Date.now());(0,U.useEffect)(()=>{let e=Ei(()=>n(Date.now()),1e3);return()=>Di(e)},[]);let r=Fu(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,H.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,H.jsxs)(`span`,{"aria-label":`Elapsed ${r}`,children:[r,` elapsed`]}),r&&(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,H.jsx)(`time`,{dateTime:new Date(t).toISOString(),"aria-label":`Time now ${i}`,children:i})]})}function zf({turn:e,live:t,onAnswer:n,onProceed:r}){let i=t&&!e.outcome,[a,o]=(0,U.useState)(null),s=a??i,c=Au(e),l=i?c.text:ju(e),u=e.parts.map(e=>zl(e.text)).filter(Boolean),d=Af(e.outcome&&e.reply?e.reply:u.join(`
|
|
22
|
-
|
|
23
|
-
`),i),f=(0,U.useMemo)(()=>Tf(d.shown),[d.shown]),p=Lf(i,u.reduce((e,t)=>e+t.length,0)),m=d.typing||p,[h,_]=(0,U.useState)(!1),v=e.log.findLast(e=>e.tone!==`you`&&e.tone!==`say`);return(0,H.jsxs)(`div`,{className:`flex gap-4`,children:[(0,H.jsx)(`div`,{className:`size-9 flex-none`,"aria-hidden":`true`,children:(0,H.jsx)(T,{agent:`forgeqe`,px:34,working:i,state:m?`speaking`:i?`thinking`:e.outcome===`done`?`done`:e.outcome===`failed`?`failed`:`idle`,activity:i&&!m?E(Au(e).orb):void 0,className:`mt-1`})}),(0,H.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,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,H.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,H.jsx)(`span`,{"aria-live":`polite`,children:l}),(e.steps.length>0||e.plan.length>0)&&(0,H.jsx)(V,{size:16,"aria-hidden":`true`,className:g(`transition-transform`,s&&`rotate-180`)})]}),i&&(0,H.jsx)(Rf,{started:e.started||e.log[0]?.at}),e.log.length>0&&(0,H.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-expanded":h,onClick:()=>_(!h),className:`ml-auto`,children:[(0,H.jsx)(z,{icon:At,size:14}),`Activity log`,(0,H.jsx)(`span`,{className:`tabular-nums`,children:e.log.length})]})]}),(0,H.jsx)(Oi,{open:(s||i)&&(e.steps.length>0||e.plan.length>0||i),children:(0,H.jsx)(hf,{turn:e,working:i,folded:!s,live:{...c,latest:v,events:e.log.length,onLog:()=>_(!0)}})}),(0,H.jsx)(Oi,{open:h,children:(0,H.jsx)(Pf,{lines:e.log,live:i,name:`forgeqe-activity-${e.id}.md`})})]}),e.asks.map(e=>(0,H.jsx)(Ff,{ask:e,live:i,onAnswer:t=>n(e.id,t)},e.id)),e.waits.map(e=>(0,H.jsx)(If,{wait:e,live:i,onProceed:t=>r(e.id,t)},e.id)),f.body&&(0,H.jsx)(be,{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,H.jsx)(Bd,{title:`Sources`,children:(0,H.jsx)(be,{text:f.sources,className:`text-muted`,fill:!0})}),(0,H.jsx)(Cf,{turn:e}),e.error&&(0,H.jsx)(`p`,{role:`alert`,className:g(ge.fail,`m-0`),children:e.error}),e.outcome===`stopped`&&!e.reply&&(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Stopped.`}),e.outcome&&e.spent&&(0,H.jsx)(Bf,{spent:e.spent})]})]})}function Bf({spent:e}){let t=e.input+e.output>0,n=[t?`${Mu(e.input)} in → ${Mu(e.output)} out`:``,e.ms===void 0?``:Pu(e.ms),e.premium===void 0?``:Nu(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,H.jsx)(`p`,{className:`m-0 text-body-sm text-muted tabular-nums`,"data-tip":r||void 0,children:n.join(` · `)})}var Vf=1e3,Hf=15e3,Uf=`Reconnecting to ForgeQE web… The chat carries on there; this page catches up when it answers.`;function Wf(e,t,n){let r=Math.max(1,Math.floor(e)||1),i=Math.min(Hf,Vf*2**Math.min(r-1,4));return t===401?{waitMs:i,say:n,giveUp:!0}:t===404?{waitMs:Vf*2,say:r>=3?n:null,giveUp:r>=3}:t===0||t>=500?{waitMs:i,say:r>=3?Uf:null,giveUp:!1}:{waitMs:i,say:n,giveUp:!1}}function Gf(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 Kf=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 qf(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,U.useState)(t),[a,o]=(0,U.useState)([]),[s,c]=(0,U.useState)(null);(0,U.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=Wf(++a,r,t.message);if(o.giveUp&&r===404){n(null),i(null);return}if(o.giveUp)return;await Gf(o.waitMs)}})(),()=>{e=!0}},[r]);let l=(0,U.useMemo)(()=>ku(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 Jf=`forgeqe.dock.chat`;function Yf(e){let t=nr(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 Xf(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 Zf=(e,t)=>e===`off`?t?`thinking`:`idle`:Pa[e],Qf=(e,t,n)=>e===`speaking`?`speaking`:n?`waiting`:t||e===`thinking`?`thinking`:`idle`;function $f({route:e,hidden:t=!1}){let n=_a(),{theme:i}=M(),a=S(i)!==`icons`,{chat:o,thread:s,last:c,busy:l,ended:u,send:d,reset:f,open:p}=qf(Jf),m=Go(),[h,_]=(0,U.useState)(!1),[v,y]=(0,U.useState)(``),[x,C]=(0,U.useState)(``),[w,E]=(0,U.useState)(!1),[D,O]=(0,U.useState)(Ca),k=gi(),A=vi(),j=(0,U.useRef)(null),ee=(0,U.useRef)(null),N=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=()=>O(Ca());return window.addEventListener(Sa,e),()=>window.removeEventListener(Sa,e)},[]),(0,U.useEffect)(()=>{!D&&!t&&n.phase!==`off`&&n.end()},[D]),(0,U.useEffect)(()=>{n.phase!==`off`&&n.chat&&n.chat!==o&&p(n.chat)},[n.phase,n.chat]),(0,U.useEffect)(()=>{if(!h)return;setTimeout(()=>{let e=document.getElementById(`dock-box`);e&&!e.disabled?e.focus():ee.current?.focus()},0);let e=e=>{e.key===`Escape`&&ee.current?.contains(document.activeElement)&&(_(!1),j.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let P=s.turns.slice(-3),te=`${P.length}:${c?.reply?.length??0}:${c?.steps.length??0}:${c?.outcome??``}`;(0,U.useEffect)(()=>{h&&N.current?.scrollTo({top:N.current.scrollHeight})},[h,te]);let F=location.hash===``||location.hash===`#`||location.hash===`#/`,ne=n.phase!==`off`&&(n.chat?Da()===n.chat:F),re=n.phase!==`off`&&!ne;if(A||!re&&(t||k))return null;let ie=!!c&&(c.outcome===`needs_input`||!c.outcome&&(c.asks.some(e=>e.answer===void 0)||c.waits.some(e=>e.answer===void 0))),ae=Xf(c),oe=n.phase!==`off`&&(n.chat??null)===(o??null),se=async()=>{let t=v.trim();if(t&&!w&&m.ready){E(!0),C(``);try{await d(t,Yf(e),m.choice),y(``)}catch(e){C(e.message)}finally{E(!1)}}},ce=e=>a?(0,H.jsx)(T,{agent:ae,px:e,decorative:!0,state:Qf(n.phase,l,ie)}):(0,H.jsx)(_e,{state:Zf(n.phase,l),px:e}),le=I(ae).name;return(0,H.jsxs)(`div`,{className:`fixed right-4 bottom-4 z-30 flex flex-col items-end gap-2`,children:[h&&(0,H.jsxs)(`div`,{ref:ee,role:`dialog`,"aria-modal":`false`,"aria-label":`Ask Atlas`,tabIndex:-1,className:g(`rounded-md border border-overlay-line bg-overlay p-2 text-ink shadow-menu backdrop-blur-[16px]`,`flex max-h-[min(560px,calc(var(--screen)-96px))] w-[min(400px,calc(100vw-32px))] flex-col gap-2 p-4`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ce(24),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm font-medium`,"aria-live":`polite`,children:ae===`forgeqe`?`Atlas`:`${le} is working`}),o&&(0,H.jsx)(`a`,{href:r(`chats`,o),onClick:()=>_(!1),className:g(he({variant:`ghost`,size:`sm`}),`no-underline`),children:`Open the chat`}),o&&(0,H.jsx)(B,{variant:`icon`,size:`icon-xs`,"aria-label":`New conversation`,"data-tip":`Start a new conversation`,disabled:l||oe,onClick:()=>(f(),y(``),C(``)),children:(0,H.jsx)(xt,{size:16,"aria-hidden":`true`})}),(0,H.jsx)(B,{variant:`icon`,size:`icon-xs`,"aria-label":`Close`,"data-tip":`Close`,onClick:()=>(_(!1),j.current?.focus()),children:(0,H.jsx)(Ue,{size:16,"aria-hidden":`true`})})]}),(0,H.jsx)(`div`,{ref:N,className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto text-body-sm`,children:P.length?(0,H.jsxs)(H.Fragment,{children:[s.turns.length>P.length&&o&&(0,H.jsx)(`a`,{href:r(`chats`,o),onClick:()=>_(!1),className:`text-body-sm`,children:`${s.turns.length-P.length} earlier in the chat`}),P.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(ii,{text:e.user,scope:{chat:o||void 0}}),(0,H.jsx)(zf,{turn:e.error?{...e,error:Kf(e.error)}:e,live:!u,onAnswer:(e,t)=>void L.answer(o,e,t).catch(e=>C(e.message)),onProceed:(e,t)=>void L.proceed(o,e,t).catch(e=>C(e.message))})]},e.id)),s.fatal&&(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:s.fatal})]}):(0,H.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.`})}),!m.ready&&m.setup&&(0,H.jsx)(Xo,{project:m.setup.project}),x&&(0,H.jsx)(`p`,{className:`m-0 text-body-sm text-fail [overflow-wrap:anywhere]`,children:x}),(0,H.jsx)(bi,{id:`dock-box`,counted:!1,label:`Message to Atlas`,value:v,onChange:y,onSend:()=>void se(),onStop:()=>o&&void L.stop(o),busy:l,disabled:w||!m.ready,canSend:!!v.trim(),rows:1,placeholder:P.length?`Reply, or ask for the next thing…`:`Ask Atlas…`,top:D?(0,H.jsx)(ja,{chat:o}):void 0,left:D?(0,H.jsx)(Aa,{chat:o,disabled:l||w}):void 0})]}),!h&&re&&(0,H.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,H.jsx)(`span`,{className:`font-medium`,children:Na[n.phase]}),(0,H.jsx)(B,{variant:`ghost`,size:`sm`,type:`button`,onClick:n.end,children:`End`})]}),(0,H.jsx)(`button`,{ref:j,type:`button`,"aria-expanded":h,"aria-label":`Ask Atlas`,"data-tip":h?void 0:`Ask Atlas`,"data-face":a?`mascot`:`orb`,"data-tip-side":`left`,onClick:()=>_(e=>!e),className:g(b,`flex size-14 cursor-pointer items-center justify-center rounded-full p-0`,oe&&`ring-2 ring-accent`),children:ce(a?40:28)})]})}function ep({item:e}){return e.agent?(0,H.jsx)(T,{agent:e.agent,px:18,decorative:!0}):(0,H.jsx)(f,{name:x[e.id]||C[e.id]||`feature`,px:18})}var tp={id:`settings`,label:`Settings`};function np(){let e=(e,t,n,r,i)=>({id:e,label:t,meta:n,href:r,words:i,kind:`page`});return[...rr.filter(e=>e.item.path[0]!==`settings`).map(t=>e(t.item.id,t.item.label,`${t.category.label} · ${t.area.label}`,tr(t.item),[t.item.words,t.item.about].filter(Boolean).join(` `))),e(tp.id,tp.label,`Every setting`,r(tp.id))]}var rp=np(),ip=(0,U.lazy)(()=>m(()=>import(`./CommandPalette-x_RA-vYW.js`),__vite__mapDeps([10,2,3,11,8,9,12,4,5,13,0,1,6]))),ap=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),op=()=>ap()?`⌘K`:`Ctrl K`;function sp({route:e}){let{find:t}=(0,U.useContext)(dp),n=Tc(e);return(0,H.jsxs)(`header`,{className:`hidden h-(--top-bar) flex-none items-center gap-6 bg-canvas px-8 md:flex`,children:[(0,H.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,H.jsxs)(H.Fragment,{children:[[n.parent,...n.middle?[n.middle]:[]].map(e=>(0,H.jsxs)(U.Fragment,{children:[e.href?(0,H.jsx)(`a`,{href:e.href,className:`flex-none text-muted no-underline hover:text-ink`,children:e.label}):(0,H.jsx)(`span`,{className:`flex-none text-muted`,children:e.label}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted`,children:`/`})]},e.href??e.label)),n.here.href?(0,H.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,H.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate font-medium text-ink`,children:n.here.label})]})}),(0,H.jsxs)(B,{variant:`field`,onClick:t,"aria-keyshortcuts":ap()?`Meta+K`:`Control+K`,"aria-label":`Search pages, agents and settings`,className:`w-full max-w-[560px] flex-[0_1_560px]`,children:[(0,H.jsx)(ft,{size:16,strokeWidth:1.8,"aria-hidden":`true`,className:`text-icon`}),(0,H.jsx)(`span`,{className:`flex-1 truncate text-left`,children:`Search`}),(0,H.jsx)(Ps,{children:op()})]}),(0,H.jsx)(`span`,{className:`flex-[1_1_0]`,"aria-hidden":`true`})]})}function cp(){let{find:e}=(0,U.useContext)(dp);return(0,H.jsx)(B,{variant:`icon`,size:`icon`,"aria-label":`Search (${op()})`,"data-tip":`Search`,onClick:e,className:`size-9 flex-none`,children:(0,H.jsx)(ft,{strokeWidth:1.8,"aria-hidden":`true`})})}var lp=bc,up=xc,dp=(0,U.createContext)({hidden:!1,open:()=>{},setChat:()=>{},find:()=>{}});function fp(e){let{setChat:t}=(0,U.useContext)(dp),n=JSON.stringify(e);(0,U.useEffect)(()=>(t(e),()=>t(null)),[n,t])}var pp=`forgeqe-sidebar`,mp=()=>{try{return localStorage.getItem(pp)===`closed`}catch{return!1}};function hp({className:e}){let{open:t}=(0,U.useContext)(dp);return(0,H.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,H.jsx)(rn,{strokeWidth:1.8,"aria-hidden":`true`})})}function gp(){return(0,H.jsxs)(`div`,{className:`theme-side sticky top-0 z-20 flex items-center gap-1 px-4 py-2 md:hidden`,children:[(0,H.jsx)(hp,{}),(0,H.jsx)(`span`,{className:`ml-1 flex min-w-0 flex-1`,children:(0,H.jsx)(Fp,{compact:!0})}),(0,H.jsx)(cp,{})]})}function _p({item:e,current:t}){let n=t===e.id;return(0,H.jsxs)(`a`,{href:r(e.id),"aria-current":n?`page`:void 0,className:g(lp,up(n)),children:[(0,H.jsx)(ep,{item:e}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]})}function vp({current:e,rail:t=!1}){let n=!e;return t?(0,H.jsx)(`a`,{href:r(),"aria-label":`New chat`,"data-tip":`New chat`,"data-tip-side":`right`,"aria-current":n?`page`:void 0,className:g(Dp,`mt-2`,n&&`bg-(--side-current-bg) text-(--side-current-ink) hover:bg-(--side-current-bg) hover:text-(--side-current-ink)`),children:(0,H.jsx)(yn,{strokeWidth:1.8,"aria-hidden":`true`,className:`size-[18px]`})}):(0,H.jsxs)(`a`,{href:r(),"aria-current":n?`page`:void 0,className:g(lp,up(n)),children:[(0,H.jsx)(yn,{strokeWidth:1.8,"aria-hidden":`true`,className:`size-[18px]`}),`New chat`]})}function yp(e){let t=nr(e);return t&&t.item.path.length?{category:t.category.id,area:Yn(t.area)?t.area.id:void 0}:{}}var bp=`forgeqe-sidebar-unfold`;function xp(e){let t=`c:${e}`;try{let e=Cp(localStorage.getItem(Sp));e.includes(t)||localStorage.setItem(Sp,JSON.stringify([...e,t]))}catch{}window.dispatchEvent(new CustomEvent(bp,{detail:t}))}var Sp=`forgeqe-sidebar-open`;function Cp(e){let t=new Set([...er.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 wp=()=>{try{return Cp(localStorage.getItem(Sp))}catch{return[]}};function Tp(e){let t=yp(e);return[t.category&&`c:${t.category}`,t.category&&t.area&&`a:${t.category}/${t.area}`].filter(e=>!!e)}function Ep({current:e,route:t,place:n=t,onClose:r}){let i=t.join(`/`),a=n.join(`/`),[o,s]=(0,U.useState)(()=>new Set([...wp(),...Tp(n)])),c=(0,U.useRef)(a);(0,U.useEffect)(()=>{if(c.current===a)return;c.current=a;let e=Tp(n);if(e.length){s(new Set(e));try{localStorage.setItem(Sp,JSON.stringify(e))}catch{}}},[i,a]),(0,U.useEffect)(()=>{let e=e=>{let t=Cp(JSON.stringify([e.detail]))[0];t&&s(e=>e.has(t)?e:new Set([...e,t]))};return window.addEventListener(bp,e),()=>window.removeEventListener(bp,e)},[]);let l=e=>t=>s(n=>{let r=new Set(n);t?r.add(e):r.delete(e);try{localStorage.setItem(Sp,JSON.stringify([...r]))}catch{}return r}),{pins:u,toggle:d}=Qn(),p=nr(n)?.item.id,m=u.map(e=>rr.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,H.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,H.jsx)(Qt,{size:13,strokeWidth:1.8,fill:t?`currentColor`:`none`,"aria-hidden":`true`})})},_=e=>(0,H.jsx)(pc,{href:tr(e),label:e.label,current:h(e),icon:(0,H.jsx)(f,{name:e.icon,px:18}),after:g(e)},e.id),v=e=>(0,H.jsx)(pc,{href:tr(e),label:e.label,current:p===e.id,icon:(0,H.jsx)(f,{name:e.icon,px:18}),after:g(e)},e.id);return(0,H.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,H.jsxs)(`div`,{className:`flex min-h-10 items-center gap-1 pl-2`,children:[(0,H.jsx)(Fp,{}),(0,H.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,H.jsx)(Me,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,H.jsx)(`div`,{className:`mt-4 flex flex-col gap-px short:mt-2`,children:(0,H.jsx)(vp,{current:e})}),(0,H.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,H.jsxs)(yc,{routeKey:`${i}|${a}`,className:`gap-4 short:gap-2`,children:[(0,H.jsx)(gc,{label:`Pinned`,children:m.length?m.map(e=>v(e.item)):(0,H.jsx)(`span`,{className:`px-2 text-body-sm text-muted`,children:`Star a page below to pin it here.`})}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-px`,children:[(0,H.jsx)(`span`,{className:`flex h-7 short:h-6 items-center px-2 text-body-sm font-medium text-muted`,children:`Browse`}),er.map(e=>(0,H.jsx)(vc,{label:e.label,icon:(0,H.jsx)(f,{name:e.icon,px:18}),lines:oc,open:o.has(`c:${e.id}`),onOpenChange:l(`c:${e.id}`),children:e.areas.map(t=>Yn(t)?(0,H.jsx)(_c,{label:t.label,badge:!o.has(`a:${e.id}/${t.id}`)&&(0,H.jsx)(`span`,{className:`text-body-sm text-muted tabular-nums`,children:Zn(t).length}),open:o.has(`a:${e.id}/${t.id}`),onOpenChange:l(`a:${e.id}/${t.id}`),children:Zn(t).map(_)},t.id):Zn(t).map(_))},e.id))]})]})}),(0,H.jsxs)(`div`,{className:`flex flex-none items-center gap-1 pt-2 short:pt-1`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(_p,{item:tp,current:e})}),(0,H.jsx)(Ap,{}),(0,H.jsx)(Mp,{icon:!0})]})]})}var Dp=g(he({variant:`icon`,size:`icon`}),`size-9 flex-none`);function Op({item:e,current:t}){let n=t===e.id;return(0,H.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(Dp,n&&`bg-(--side-current-bg) text-(--side-current-ink) hover:bg-(--side-current-bg) hover:text-(--side-current-ink)`),children:(0,H.jsx)(ep,{item:e})})}function kp({current:e,route:t,onOpen:n}){let{theme:i}=M(),{pins:a}=Qn(),o=i.name||`ForgeQE`,s=nr(t),c=s?.item.path.length?s.category.id:``,l=(e,t,n,r)=>(0,H.jsx)(`a`,{href:e,"aria-current":r?`page`:void 0,"aria-label":t,"data-tip":t,"data-tip-side":`right`,className:g(Dp,r&&`bg-(--side-current-bg) text-(--side-current-ink) hover:bg-(--side-current-bg) hover:text-(--side-current-ink)`),children:(0,H.jsx)(f,{name:n,px:18})},e),u=a.map(e=>rr.find(t=>t.item.id===e)).filter(e=>!!e);return(0,H.jsxs)(`nav`,{"aria-label":`ForgeQE`,className:`theme-side flex h-full w-16 flex-col items-center gap-px py-4`,children:[(0,H.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,H.jsx)(Fd,{theme:i})}),(0,H.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,H.jsx)(rn,{strokeWidth:1.8,"aria-hidden":`true`})}),(0,H.jsx)(vp,{current:e,rail:!0}),(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center gap-px overflow-y-auto`,children:[(0,H.jsxs)(`div`,{role:`group`,"aria-label":`Browse`,className:`flex flex-col items-center gap-px`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`my-2 h-px w-6 bg-line`}),er.map(e=>(0,H.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:()=>{xp(e.id),n()},className:g(Dp,`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,H.jsx)(f,{name:e.icon,px:18})},e.id))]}),u.length>0&&(0,H.jsxs)(`div`,{role:`group`,"aria-label":`Pinned`,className:`flex flex-col items-center gap-px`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`my-2 h-px w-6 bg-line`}),u.map(e=>l(tr(e.item),e.item.label,e.item.icon,s?.item.id===e.item.id))]})]}),(0,H.jsxs)(`div`,{className:`flex flex-none flex-col items-center gap-px pt-2`,children:[(0,H.jsx)(Ap,{rail:!0}),(0,H.jsx)(Mp,{icon:!0,rail:!0}),(0,H.jsx)(Op,{item:tp,current:e})]})]})}function Ap({rail:e=!1}){return(0,H.jsx)(`a`,{href:`/help/guide`,target:`_blank`,rel:`noreferrer noopener`,"aria-label":`Help`,"data-tip":`Help`,"data-tip-side":e?`right`:void 0,className:Dp,children:(0,H.jsx)(f,{name:x.help,px:18})})}var jp=[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}];function Mp({icon:e=!1,rail:t=!1}){let{choice:n,setChoice:r}=M(),i=jp.findIndex(e=>e.id===n),a=jp[i],o=jp[(i+1)%jp.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,H.jsxs)(`button`,{type:`button`,"aria-label":s,"data-tip":s,"data-tip-side":t?`right`:void 0,onClick:()=>r(o.id),className:e?Dp:g(lp,up(!1),`w-full cursor-pointer border-0 bg-transparent text-left`),children:[(0,H.jsx)(f,{name:x.theme,px:18}),!e&&(0,H.jsxs)(`span`,{className:`flex flex-1 items-baseline justify-between gap-2`,children:[`Dark/Light`,(0,H.jsx)(`span`,{className:`text-body-sm text-muted`,children:a.label===`System`?`Auto`:a.label})]})]})}function Np(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 Pp({stats:e,onOpen:t}){return(0,H.jsxs)(`aside`,{"aria-label":`Workspace`,className:`flex h-full w-14 flex-col items-center gap-1 bg-canvas py-4`,children:[(0,H.jsx)(zd,{rail:!0}),(0,H.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,H.jsx)(rt,{strokeWidth:1.8,"aria-hidden":`true`})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`my-1 h-px w-6 bg-line`}),Np(e).map(e=>(0,H.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,H.jsx)(ep,{item:e})},e.id))]})}function Fp({compact:e=!1}){let{theme:t}=M(),n=t.name||`ForgeQE`;return(0,H.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,H.jsx)(Pd,{theme:t,compact:e})})}function Ip(){let[e,t]=(0,U.useState)(!1);return(0,U.useEffect)(()=>{let e=()=>t(!0);return window.addEventListener(fe,e),()=>window.removeEventListener(fe,e)},[]),e?(0,H.jsx)(`p`,{role:`alert`,className:g(ge.fail,`mx-4 mt-4 mb-0`),children:ie()}):null}function Lp({stats:e,onClose:t,focus:n}){let r=(0,U.useRef)(null);return(0,U.useEffect)(()=>{n&&(r.current?.querySelector(`#panel-${n.id}`))?.scrollIntoView({block:`start`,behavior:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`})},[n]),(0,H.jsxs)(`aside`,{"aria-label":`Workspace`,className:`flex h-full w-[264px] flex-col bg-canvas`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-4`,children:[(0,H.jsx)(zd,{}),(0,H.jsx)(`span`,{className:`flex-1`}),(0,H.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,H.jsx)(et,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,H.jsx)(`div`,{ref:r,className:`min-h-0 flex-1 overflow-y-auto px-4 pt-1 pb-4`,children:(0,H.jsx)(ud,{chat:e})})]})}var Rp=`forgeqe-workspace-panel`,zp=`forgeqe:workspace-fold`,Bp=()=>{try{return localStorage.getItem(Rp)!==`closed`}catch{return!0}},Vp=220;function Hp({open:e,side:t,label:n,wideAt:r,onClose:i,className:a,children:o}){let s=(0,U.useRef)(null),l=c(e,150);(0,U.useEffect)(()=>{let t=s.current;t&&(e&&!t.open?t.showModal():!l&&t.open&&t.close())},[e,l]),(0,U.useEffect)(()=>{if(!e)return;let t=window.matchMedia(r);if(t.matches)return i();let n=()=>t.matches&&i();return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e,r,i]);let u=t===`left`?`aside`:`div`;return(0,H.jsx)(`dialog`,{ref:s,"aria-label":n,onCancel:e=>{e.target===s.current&&(e.preventDefault(),i())},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`,a),children:l&&(0,H.jsxs)(`div`,{inert:!e||void 0,className:`absolute inset-0`,children:[(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`drawer-dim absolute inset-0 bg-[rgba(15,23,42,0.28)]`,onClick:i}),(0,H.jsx)(u,{className:g(`drawer-box absolute inset-y-0 max-w-[85vw] shadow-menu`,t===`left`?`drawer-left left-0`:`right-0`),children:o})]})})}function Up(e,t,n){let r=(e??``).replace(/\s+/g,` `).trim().slice(0,80);return n||!r?t:`${r} · ${t}`}function Wp(e,t,n){(0,U.useEffect)(()=>{let e=document.querySelector(`[data-screen]`);if(!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`h1`),r=Up(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 Gp(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 Kp({current:e,route:t=e?[e]:[],children:n}){let[r,i]=(0,U.useState)(mp),[a,o]=(0,U.useState)(null),[s,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(Bp),[f,p]=(0,U.useState)(!1),m=(0,U.useCallback)(()=>l(!1),[]),h=(0,U.useCallback)(()=>p(!1),[]),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(``),C=t.join(`/`);(0,U.useEffect)(()=>$n(t),[C]);let{theme:w}=M();Wp(e,C,w.appName);let T=rs(t),E=()=>{l(!1),S(``),b(!0),v(!0)},D=(0,U.useCallback)(e=>{l(!1),S(e),b(!0),v(!0)},[]);(0,U.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 O=c(!r,Vp),k=c(u,Vp),[A,j]=(0,U.useState)(null),ee=()=>window.matchMedia(`(min-width: 1600px)`).matches,N=e=>{d(e);try{localStorage.setItem(Rp,e?`open`:`closed`)}catch{}};(0,U.useEffect)(()=>{let e=e=>d(e.detail!==!0&&Bp());return window.addEventListener(zp,e),()=>window.removeEventListener(zp,e)},[]),(0,U.useEffect)(()=>{if(!f)return;let e=()=>p(!1);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[f]);let P=e=>{i(e);try{localStorage.setItem(pp,e?`closed`:`open`)}catch{}};(0,U.useEffect)(()=>{if(!s)return;let e=()=>l(!1);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[s]);let te=()=>window.matchMedia(`(min-width: 768px)`).matches,{setChoice:F}=M(),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),j(e?{id:e,at:Date.now()}:null)};return(0,H.jsx)(dp.Provider,{value:{hidden:r,open:()=>te()?P(!1):l(!0),setChat:o,find:E},children:(0,H.jsx)(da,{pages:rp,find:D,set:I,children:(0,H.jsx)(ka,{children:(0,H.jsxs)(`div`,{className:`flex min-h-(--screen) bg-canvas`,children:[(0,H.jsx)(`a`,{href:`#content`,onClick:Gp,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,H.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,H.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 left-0`,r&&`invisible opacity-0`),children:O&&(0,H.jsx)(Ep,{current:e,route:t,place:T,onClose:()=>P(!0)})}),(0,H.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 left-0`,!r&&`invisible opacity-0`),children:(0,H.jsx)(kp,{current:e,route:T,onOpen:()=>P(!1)})})]}),(0,H.jsx)(Hp,{open:s,side:`left`,label:`Sidebar`,wideAt:`(min-width: 768px)`,onClose:m,className:`md:hidden`,children:(0,H.jsx)(Ep,{current:e,route:t,place:T,onClose:()=>l(!1)})}),(0,H.jsxs)(`div`,{"data-screen":!0,className:`relative flex min-w-0 flex-1 flex-col`,children:[e!==`welcome`&&(0,H.jsx)(sp,{route:t}),(0,H.jsx)(Ip,{}),(0,H.jsx)(`div`,{"data-page-area":!0,className:`flex min-w-0 flex-1 flex-col`,children:n}),(0,H.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,H.jsx)(rt,{strokeWidth:1.8,"aria-hidden":`true`})})]}),(0,H.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,H.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 right-0 hidden min-[1600px]:block`,!u&&`invisible opacity-0`),children:k&&(0,H.jsx)(Lp,{stats:a,focus:A,onClose:()=>N(!1)})}),(0,H.jsx)(`div`,{className:g(`side-layer absolute inset-y-0 right-0`,u&&`min-[1600px]:invisible min-[1600px]:opacity-0`),children:(0,H.jsx)(Pp,{stats:a,onOpen:re})})]}),y&&(0,H.jsx)(U.Suspense,{fallback:null,children:(0,H.jsx)(ip,{open:_,onClose:()=>v(!1),pages:rp,query:x})}),(0,H.jsx)(Hp,{open:f,side:`right`,label:`Workspace panel`,wideAt:`(min-width: 1600px)`,onClose:h,className:`min-[1600px]:hidden`,children:(0,H.jsx)(Lp,{stats:a,focus:A,onClose:()=>p(!1)})}),(0,H.jsx)($f,{route:t,hidden:ne||e===``||e===`chats`&&!!t[1]})]})})})})}var qp=`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`,Jp=`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`,Yp=`[--page-w:100cqw]`,Xp=`@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{Fc as $,Wa as $t,il as A,Ds as At,K as B,Go as Bt,Au as C,ar as Cn,ls as Ct,zl as D,os as Dt,Gl as E,as as Et,Ml as F,Ko as Ft,tl as G,To as Gt,Bc as H,Fo as Ht,cl as I,Jo as It,Yc as J,Ka as Jt,Jc as K,wo as Kt,q as L,Yo as Lt,gl as M,Qo as Mt,pl as N,es as Nt,Sl as O,ss as Ot,dl as P,ts as Pt,Ic as Q,qa as Qt,al as R,Zo as Rt,wd as S,or as Sn,Os as St,Ou as T,us as Tt,nl as U,ko as Ut,rl as V,Ro as Vt,$c as W,Eo as Wt,Uc as X,W as Xt,zc as Y,Ha as Yt,Wc as Z,Ga as Zt,vf as _,ui as _n,ps as _t,zp as a,wa as an,bc as at,Fd as b,kr as bn,ws as bt,Kp as c,Ea as cn,ac as ct,Kf as d,Oi as dn,tc as dt,Va as en,Nc as et,qf as f,Di as fn,Qs as ft,zf as g,ii as gn,js as gt,Pf as h,_i as hn,Ns as ht,Yp as i,xa as in,Dc as it,_l as j,$o as jt,fl as k,cs as kt,op as l,fa as ln,ec as lt,Gf as m,bi as mn,Ms as mt,Jp as n,Aa as nn,Mc as nt,hp as o,ba as on,xc as ot,Wf as p,Ei as pn,Ps as pt,Kc as q,fo as qt,Xp as r,ja as rn,Oc as rt,gp as s,Ca as sn,G as st,qp as t,Ba as tn,Ec as tt,fp as u,la as un,Zs as ut,Bd as v,$r as vn,fs as vt,ku as w,ds as wt,vd as x,dr as xn,Ts as xt,Pd as y,Qr as yn,ks as yt,sl as z,Xo as zt};
|