@capagents/forgeqe 3.4.4 → 3.4.5
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 +1930 -1930
- package/dist/web/assets/{3d-force-graph-DwblDu4y.js → 3d-force-graph-Bv0L0GYY.js} +1 -1
- package/dist/web/assets/{Agent-C8WdS1HB.js → Agent-CxEcSdpb.js} +1 -1
- package/dist/web/assets/{AgentWork-C1Qa_Ftb.js → AgentWork-pz5zDHe7.js} +1 -1
- package/dist/web/assets/{ApiTests-u4tzlJaD.js → ApiTests-Cvuu_jpF.js} +1 -1
- package/dist/web/assets/{Browse-B0ZTvpo2.js → Browse-CugNbc8C.js} +1 -1
- package/dist/web/assets/{Chat-B73XMxdf.js → Chat-Tqqg4JUL.js} +1 -1
- package/dist/web/assets/{CommandPalette-D7ld-tbJ.js → CommandPalette-DvSYdMC_.js} +1 -1
- package/dist/web/assets/{Compare-CxGjAZW0.js → Compare-CVdloZNm.js} +1 -1
- package/dist/web/assets/{Cost-BeVu3Z6g.js → Cost-Bm4Dqpwr.js} +1 -1
- package/dist/web/assets/{Data-BPyCT0eP.js → Data-CGjaHLjI.js} +1 -1
- package/dist/web/assets/{Desktop-qPGc2OWb.js → Desktop-BbTWto2U.js} +1 -1
- package/dist/web/assets/{DesktopReview-CVoC6bQY.js → DesktopReview-Cw2ODskw.js} +1 -1
- package/dist/web/assets/{Evidence-CtUiUCa6.js → Evidence-DjY7OEs8.js} +1 -1
- package/dist/web/assets/{Explore-BvjAhqyo.js → Explore-BB-c2iyf.js} +1 -1
- package/dist/web/assets/{Features-CmQCxEJX.js → Features-DLJ0o5mQ.js} +1 -1
- package/dist/web/assets/{Flags-asj8tiKy.js → Flags-BF4LF0Sn.js} +1 -1
- package/dist/web/assets/{Flaky-ChYK151U.js → Flaky-DKEWWH_N.js} +1 -1
- package/dist/web/assets/{Impact-B1-B2oHr.js → Impact-BYfBT4ng.js} +1 -1
- package/dist/web/assets/{Jobs-CZ2k5hGk.js → Jobs-DwPYSmQp.js} +1 -1
- package/dist/web/assets/{KindPage-CDfvpDXP.js → KindPage-CNSIw8EU.js} +1 -1
- package/dist/web/assets/{LiveDevice-B33XU61P.js → LiveDevice-Bzz5k4my.js} +1 -1
- package/dist/web/assets/{Migration-BBM_Sce0.js → Migration-B8FRhxpQ.js} +1 -1
- package/dist/web/assets/{Mobile-BzufjlBb.js → Mobile-DDg3lrvO.js} +1 -1
- package/dist/web/assets/{Observability-qcx5vrNO.js → Observability-S_GxyR80.js} +1 -1
- package/dist/web/assets/{OwnItems-BkoHG_xw.js → OwnItems-CGD8lZsA.js} +1 -1
- package/dist/web/assets/{PageAgent-Do62EBze.js → PageAgent-CUicHm1M.js} +1 -1
- package/dist/web/assets/{Product-9ImZUA2B.js → Product-D0HVqFU9.js} +2 -2
- package/dist/web/assets/{Production-B6uigaYJ.js → Production-D4qoP1EY.js} +1 -1
- package/dist/web/assets/{Quality-Cw6qhXyl.js → Quality-BeNUMygb.js} +1 -1
- package/dist/web/assets/{Readiness-D8WMgQmd.js → Readiness-BKh3XR-d.js} +1 -1
- package/dist/web/assets/Record-CEY5wJ5f.js +1 -0
- package/dist/web/assets/{Regression-BLlXnCW2.js → Regression-DVQujWFy.js} +1 -1
- package/dist/web/assets/{RelationGraph-BxJgWpp6.js → RelationGraph-5GEqITmu.js} +1 -1
- package/dist/web/assets/{Reports-ZNS4Vjz8.js → Reports-C7R9gb02.js} +1 -1
- package/dist/web/assets/{Requirements-CtQLSXK2.js → Requirements-FCu-HkXc.js} +1 -1
- package/dist/web/assets/{Responsive-KaTTxiwX.js → Responsive-DwXdPKww.js} +1 -1
- package/dist/web/assets/{RunDiff-CpvrxBX1.js → RunDiff-UU3jCTyW.js} +1 -1
- package/dist/web/assets/{Settings-C5CTbhlT.js → Settings-BkjUlPMQ.js} +3 -3
- package/dist/web/assets/{SiteScan-CUMCTEY9.js → SiteScan-CNCGcPQX.js} +1 -1
- package/dist/web/assets/{Steps-C440M1Y_.js → Steps-CYDb_3OH.js} +1 -1
- package/dist/web/assets/{TestData-7rivojlz.js → TestData-CE5vC330.js} +1 -1
- package/dist/web/assets/{TestManagement-Dj5JHPIU.js → TestManagement-CxcJI04K.js} +1 -1
- package/dist/web/assets/{WhatsNew-xAi2Rzo3.js → WhatsNew-CIg0ienp.js} +1 -1
- package/dist/web/assets/{agentSettingsSheet-D12LwTAe.js → agentSettingsSheet-CLWVrbZy.js} +1 -1
- package/dist/web/assets/api-D1PU4zye.js +1 -0
- package/dist/web/assets/{dataParts-CVXmPBpU.js → dataParts-uqmYw8V2.js} +1 -1
- package/dist/web/assets/{desktopAppPath-D_PfQisd.js → desktopAppPath-DUEjQMmN.js} +1 -1
- package/dist/web/assets/{flowTheme-bdKXfQiL.js → flowTheme-ZJk8bNiH.js} +1 -1
- package/dist/web/assets/{frame-BC1vOowF.js → frame-D0MS2ZMz.js} +3 -3
- package/dist/web/assets/{index-BoFziUZw.js → index-F8zkXd19.js} +4 -4
- package/dist/web/assets/{nav--1SY7-OO.js → nav-CkrE6JFU.js} +1 -1
- package/dist/web/assets/{pageBack-DDAAmq4R.js → pageBack-DfGBh1Hs.js} +1 -1
- package/dist/web/assets/{palette-C8W4Fd5n.js → palette-dAh9kV3S.js} +1 -1
- package/dist/web/assets/{parts-uc6us_OU.js → parts-DqfD-6Qb.js} +1 -1
- package/dist/web/assets/{productParts-CAgJEF8_.js → productParts-CCceBbIo.js} +1 -1
- package/dist/web/assets/{qualityParts-BF3Yb7Zl.js → qualityParts-DcRvGy-_.js} +1 -1
- package/dist/web/assets/{recordTest-KjXCSP7c.js → recordTest-DN3Kl6PB.js} +1 -1
- package/dist/web/assets/{stepper-CZL9ueYn.js → stepper-DiPQQ2l6.js} +1 -1
- package/dist/web/assets/{wizardParts-Pzx0nTZ0.js → wizardParts-CnCYTsR0.js} +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/dist/web/assets/Record-DCcHfH7u.js +0 -1
- package/dist/web/assets/api-CorvgyDj.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-9BkoTWUE.js";import{I as i,L as a,P as o,c as s}from"./surface-c1kG1KPS.js";import{t as c}from"./utils-DJRAScIl.js";import{t as l}from"./jsx-runtime-LKYXHABd.js";import{G as u,I as d,W as f}from"./palette-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-9BkoTWUE.js";import{I as i,L as a,P as o,c as s}from"./surface-c1kG1KPS.js";import{t as c}from"./utils-DJRAScIl.js";import{t as l}from"./jsx-runtime-LKYXHABd.js";import{G as u,I as d,W as f}from"./palette-dAh9kV3S.js";import{b as p,f as m,ut as h,v as g}from"./api-D1PU4zye.js";import{A as _,C as v,F as y,I as b,L as x,M as S,T as C,_ as w,b as T,g as ee,k as E,n as te,o as ne,w as D}from"./pageBack-DfGBh1Hs.js";import{B as O,C as re,Cr as k,Er as A,F as ie,G as ae,Gr as j,Hr as oe,Kn as se,N as ce,P as M,Qn as le,Rn as N,Tn as P,Un as ue,W as de,Wt as fe,Z as pe,Zn as me,Zt as he,_t as ge,b as F,cn as I,cr as L,ct as _e,er as ve,et as ye,hr as be,kr as R,lt as xe,m as Se,nn as Ce,o as we,pr as Te,pt as Ee,sn as z,st as De,tn as Oe,ur as ke,w as Ae,yr as je,z as B}from"./line-icons-Cwj9OmCz.js";import{At as Me,G as V,Ht as Ne,Vt as Pe,W as H,Y as Fe,Z as U,Zt as Ie,ct as Le,dt as W,et as Re,ft as ze,it as Be,lt as G,n as Ve,ot as K,q as He,rt as q,s as Ue,st as We,tt as Ge,ut as Ke}from"./frame-D0MS2ZMz.js";import{B as qe,J,K as Y,V as Je,Y as Ye,o as Xe,z as Ze}from"./index-F8zkXd19.js";import{d as Qe}from"./qualityParts-DcRvGy-_.js";import{t as $e}from"./AgentWork-pz5zDHe7.js";var X=e(t(),1),Z={view:()=>g(`GET`,`/api/testmgmt`),cases:()=>g(`GET`,`/api/testmgmt/cases`),case:e=>g(`GET`,`/api/testmgmt/case/${encodeURIComponent(e).replace(/%3A/gi,`:`)}`),sync:()=>g(`POST`,`/api/testmgmt/sync`),schedule:()=>g(`GET`,`/api/testmgmt/schedule`),setSchedule:e=>g(`POST`,`/api/testmgmt/schedule`,e),gaps:()=>g(`GET`,`/api/testmgmt/gaps`),tags:()=>g(`GET`,`/api/testmgmt/tags`),tag:(e,t=!1)=>g(`POST`,`/api/testmgmt/tags`,{...e,...t?{confirmed:!0}:{}}),suites:()=>g(`GET`,`/api/testmgmt/suites`),suite:e=>g(`GET`,`/api/testmgmt/suites/${encodeURIComponent(e)}`),buildSuite:(e,t)=>g(`POST`,`/api/testmgmt/suites/agent`,{request:e,...t?{open:t}:{}}),saveSuite:e=>g(`POST`,`/api/testmgmt/suites`,e),deleteSuite:e=>g(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/delete`,{confirmed:!0}),runSuite:(e,t,n=!1)=>g(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/run`,{...t,...n?{confirmed:!0}:{}}),run:(e,t,n=!1)=>g(`POST`,`/api/testmgmt/run`,{keys:e,...t?{env:t}:{},...n?{confirmed:!0}:{}}),job:()=>g(`GET`,`/api/testmgmt/job`),writeBack:(e,t,n,r)=>g(`POST`,`/api/testmgmt/writeback/${e}`,{keys:t,...r?{tags:r}:{},...n?{digest:n}:{}}),suiteTracker:(e,t,n)=>g(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/tracker`,{...t?{target:t}:{},...n?{digest:n}:{}}),stop:()=>g(`POST`,`/api/testmgmt/stop`),tests:()=>g(`GET`,`/api/testmgmt/tests`),test:e=>g(`GET`,`/api/testmgmt/test/${encodeURIComponent(e)}`),discoveryPlan:()=>g(`GET`,`/api/testmgmt/discover`),discover:e=>g(`POST`,`/api/testmgmt/discover`,{digest:e}),link:e=>g(`POST`,`/api/testmgmt/links`,{changes:e}),setMain:(e,t)=>g(`POST`,`/api/testmgmt/links/main`,{case:e,test:t}),proposeLinks:(e=[])=>g(`POST`,`/api/testmgmt/links/propose`,{keys:e}),ask:(e,t,n,r)=>g(`POST`,`/api/testmgmt/ask`,{intent:e,keys:t,...n?{words:n}:{},...r?.length?{stories:r}:{}}),readStories:e=>g(`POST`,`/api/testmgmt/stories`,{scope:e})},et={automated:`Automated`,not_automated:`Not automated`,pending:`Pending`,known_defect:`Known defect`,needs_attention:`Needs attention`},tt={mapping:`ForgeQE's mapping`,manual:`Linked by a person`,attribute:`Its marker or attribute names the case`,tracker:`The case's system names it`,agent:`Linked by the mapping agent`,name:`The case's id is in its name or tags`},nt={framework:`Listed by its framework`,code:`Read from the code`,runs:`Known from runs`},rt={passed:`Passed`,failed:`Failed`,blocked:`Blocked`,not_run:`Not run`},Q=l();function it({title:e,about:t,onClose:n,children:r,footer:i}){return(0,Q.jsxs)(`aside`,{"aria-label":e,className:`flex w-full flex-none flex-col border-t border-line-soft bg-surface-muted xl:sticky xl:top-0 xl:h-(--screen) xl:w-[320px] 2xl:w-[380px] xl:border-t-0 xl:border-l`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-line-soft px-6 py-4`,children:[(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:(0,Q.jsx)(Ye,{icon:L,title:e,description:t})}),n&&(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Close the ${e}`,"data-tip":`Close`,onClick:n,children:(0,Q.jsx)(j,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-6`,children:r}),i&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft px-6 py-4`,children:i})]})}function at({title:e,about:t,looking:n,context:i,suggestions:o,placeholder:s,onClose:l,keys:u}){let[d,f]=(0,X.useState)(null),[m,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(!1),[v,b]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),T=async(e,t,n,r,i)=>{_(!0),b(``);try{let{request:a}=await Z.ask(e,t,r,i),{id:o}=await p.start(a,{});f({id:o,said:n}),w(!1),h(``)}catch(e){b(e.message)}finally{_(!1)}};return(0,Q.jsxs)(it,{title:e,about:t,onClose:l,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o.map(e=>(0,Q.jsxs)(y,{size:`sm`,disabled:g||!!e.disabled,"data-tip":e.disabled??e.label,onClick:()=>void T(e.intent,e.keys,e.label,void 0,e.stories),children:[(0,Q.jsx)(e.icon,{"aria-hidden":`true`}),e.label]},e.label))}),(0,Q.jsxs)(`form`,{className:`flex items-end gap-2`,onSubmit:e=>{e.preventDefault(),m.trim()&&T(`ask`,(u??o[0]?.keys??[]).slice(0,50),m.trim(),m.trim())},children:[(0,Q.jsxs)(`label`,{className:`sr-only`,htmlFor:`tm-agent-words`,children:[`Message the `,e]}),(0,Q.jsx)(a,{id:`tm-agent-words`,rows:2,maxLength:1e3,value:m,placeholder:s,onChange:e=>h(e.target.value),className:`min-h-11 flex-1 resize-none`}),(0,Q.jsx)(y,{size:`icon`,variant:`primary`,type:`submit`,disabled:g||!m.trim(),"aria-label":`Send`,"data-tip":`Send`,children:(0,Q.jsx)(ve,{"aria-hidden":`true`})})]})]}),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center`,children:[(0,Q.jsx)(S,{state:g||d&&!C?`thinking`:`working`,px:96,label:g?`Starting`:d&&!C?`Working`:`Ready`}),(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:d?C?`Done. Ask again, or open the chat.`:`Working on it…`:n}),i.length>0&&(0,Q.jsx)(`span`,{className:`flex flex-wrap justify-center gap-2`,children:i.map(e=>(0,Q.jsx)(E,{tone:`neutral`,icon:!1,children:e},e))}),d&&(0,Q.jsx)(`p`,{className:`m-0 text-body-lg leading-relaxed text-ink-2`,children:d.said})]}),v&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:v}),d?(0,Q.jsx)($e,{id:d.id,label:`The ${e} at work`,onEnd:()=>w(!0)},d.id):(0,Q.jsxs)(`p`,{className:c(`m-0 text-center text-body-sm text-muted`),children:[`Pick what to do below, or say it in your own words. It works in a chat you can open: `,(0,Q.jsx)(`a`,{href:r(`chats`),children:`All chats`}),`.`]})]})}var ot={automation:`Mark automated in their tracker`,tags:`Write ForgeQE's tags to their tracker`,untag:`Take ForgeQE's tags off in their tracker`},st={automation:`Each case's tracker records its automated test: Azure DevOps' Associated Automation, or the automated label on a Jira or Xray test. Only cases whose test ForgeQE knows, from its mapping or a link, are marked.`,tags:`ForgeQE's own tags are added to each case's tags in Azure DevOps, or its labels in Jira. Tags the case already has stay; nothing is taken away.`,untag:`ForgeQE's own tags are taken off each case's tags in Azure DevOps, or its labels in Jira. Only a tag ForgeQE keeps for the case is taken off; the tracker's other tags stay.`},ct=e=>e.system===`azure_devops`?`Azure DevOps plan ${e.plan}`:`Xray Test Set in ${e.project}`,lt=e=>e.system===`azure_devops`?`ado:${e.plan}`:`xray:${e.project}`,ut=e=>e?.url&&/^https:\/\//i.test(e.url)?e.url:void 0,dt=e=>e.system===`azure_devops`?`Azure DevOps suite ${e.suite} in plan ${e.plan}`:`Xray Test Set ${e.key}`;function ft({plan:e,outcome:t}){let n=new Map((t?.failed??[]).map(e=>[e.key,e.error])),r=new Set((t?.done??[]).map(e=>e.key)),i=(e,t,i=!1)=>(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r.has(e.key)&&(0,Q.jsx)(ce,{size:14,"aria-label":`Written`,className:`flex-none text-pass`}),n.has(e.key)&&(0,Q.jsx)(B,{size:14,"aria-label":`Refused`,className:`flex-none text-fail`}),e.key!==`suite`&&(0,Q.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.key.replace(/^[a-z_]+:/,``)}),(0,Q.jsx)(`span`,{className:i?`text-muted`:`text-ink-2`,children:e.what})]}),n.has(e.key)&&(0,Q.jsx)(`span`,{className:`text-fail [overflow-wrap:anywhere]`,children:n.get(e.key)})]},`${e.key}-${t}`);return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 text-body-sm`,children:[e.changes.length?(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.changes.map((e,t)=>i(e,t))}):(0,Q.jsx)(`p`,{className:`m-0 text-ink-2`,children:`Nothing to write: the trackers already say so.`}),e.skipped.length>0&&(0,Q.jsxs)(`details`,{children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer text-muted`,children:[`Left out: `,e.skipped.length]}),(0,Q.jsx)(`ul`,{className:`m-0 mt-2 flex list-none flex-col p-0`,children:e.skipped.map((e,t)=>i(e,t,!0))})]})]})}function pt(e,t,n){let[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(null),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1),d=(0,X.useRef)(!1);return(0,X.useEffect)(()=>{if(e&&d.current||(d.current=!1,i(null),o(null),c(``),!e))return;let t=!0;return e().then(e=>t&&i(e??null),e=>t&&c(e.message)),()=>{t=!1}},[e]),{plan:r,outcome:a,error:s,busy:l,go:async()=>{if(r){u(!0),c(``);try{let e=await t(r.digest);e&&(d.current=!0,o(e),n(`Wrote ${e.done.length}${e.failed.length?`; the tracker refused ${e.failed.length}`:``}.`))}catch(e){c(e.message)}finally{u(!1)}}}}}function mt({kind:e,keys:t,tags:n,onClose:r,onDone:i}){let[a,o]=(0,X.useState)(null),s=`${t.join(`
|
|
2
2
|
`)}|${(n??[]).join(`
|
|
3
3
|
`)}`;(0,X.useEffect)(()=>o(e?()=>()=>Z.writeBack(e,t,void 0,n).then(e=>e.plan):null),[e,s]);let l=pt(a,r=>Z.writeBack(e,t,r,n).then(e=>e.outcome),i);return(0,Q.jsx)(Ie,{open:!!e,onClose:r,title:e?ot[e]:``,description:e?st[e]:``,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{onClick:r,children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),l.outcome?`Close`:`Cancel`]}),!l.outcome&&(0,Q.jsxs)(y,{busy:l.busy,variant:`primary`,disabled:l.busy||!l.plan?.changes.length,onClick:()=>void l.go(),"data-tip":`Write these changes`,children:[e===`untag`?(0,Q.jsx)(De,{"aria-hidden":`true`}):(0,Q.jsx)(R,{"aria-hidden":`true`}),l.busy?`Writing…`:`${e===`untag`?`Take off`:`Write`} ${l.plan?.changes.length??``}`]})]}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[!l.plan&&!l.error&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Working out what would change…`}),l.error&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:l.error}),l.plan&&(0,Q.jsx)(ft,{plan:l.plan,outcome:l.outcome})]})})}function ht({open:e,suite:t,targets:n,onClose:r,onDone:a}){let[o,s]=(0,X.useState)(``),l=t.tracker?void 0:n.find(e=>lt(e)===(o||(n[0]?lt(n[0]):``))),[u,d]=(0,X.useState)(null);(0,X.useEffect)(()=>d(e&&(t.tracker||l)?()=>()=>Z.suiteTracker(t.id,l).then(e=>e.plan):null),[e,t.id,t.tracker?dt(t.tracker):``,l&<(l)]);let f=pt(u,e=>Z.suiteTracker(t.id,l,e).then(e=>e.outcome),a),p=t.tracker;return(0,Q.jsx)(Ie,{open:e,onClose:r,title:p?`Keep ${t.name} in step`:`Keep ${t.name} in a tracker`,description:p?`It is ${dt(p)}. Cases the suite gained are added there, and cases it lost are taken out.`:`The suite is made in the tracker with its cases, so the team sees it there. Later, Keep in step makes it match the suite again.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{onClick:r,children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),f.outcome?`Close`:`Cancel`]}),!f.outcome&&(0,Q.jsxs)(y,{busy:f.busy,variant:`primary`,disabled:f.busy||!f.plan?.changes.length,onClick:()=>void f.go(),children:[(0,Q.jsx)(Ae,{"aria-hidden":`true`}),f.busy?`Writing…`:p?`Keep in step`:`Make it there`]})]}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-body-sm`,children:[!p&&(n.length?(0,Q.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Where`,(0,Q.jsx)(i,{value:l?lt(l):``,onChange:e=>s(e.target.value),children:n.map(e=>(0,Q.jsx)(`option`,{value:lt(e),children:ct(e)},lt(e)))})]}):(0,Q.jsx)(`p`,{className:`m-0 text-ink-2`,children:`This suite's cases are in no connected Azure DevOps plan or Xray project. Connect one in Settings › Integrations.`})),(p||l)&&!f.plan&&!f.error&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Working out what would change…`}),f.error&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:f.error}),f.plan&&(0,Q.jsx)(ft,{plan:f.plan,outcome:f.outcome}),f.outcome&&!f.outcome.failed.length&&(0,Q.jsx)(E,{tone:`pass`,children:`Done`})]})})}var gt={automated:ce,not_automated:M,pending:ie,known_defect:A,needs_attention:A},_t={passed:`pass`,failed:`fail`,blocked:`warn`,not_run:`neutral`};function vt({text:e,tip:t,className:n}){return(0,Q.jsx)(`span`,{"data-tip":t??e,className:c(`line-clamp-2 [overflow-wrap:anywhere]`,n),children:e})}function yt({a:e}){let t=gt[e];return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-sm whitespace-nowrap`,children:[(0,Q.jsx)(t,{size:15,"aria-hidden":`true`,className:c(`flex-none`,e===`automated`?`text-pass`:e===`known_defect`?`text-fail`:e===`not_automated`?`text-muted`:`text-warn`)}),et[e]]})}function bt({o:e}){return(0,Q.jsx)(E,{tone:_t[e],icon:e!==`not_run`,children:rt[e]})}function xt({runs:e}){return e.length?(0,Q.jsx)(T,{label:`Last runs: ${e.map(e=>e===`p`?`passed`:`failed`).join(`, `)}`,runs:e.map(e=>e===`p`?{tone:`pass`,title:`Passed`}:{tone:`fail`,title:`Failed`})}):(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:`–`})}function St({tags:e,max:t=3}){return e.length?(0,Q.jsxs)(`span`,{className:`inline-flex flex-wrap gap-1`,children:[e.slice(0,t).map(e=>(0,Q.jsxs)(E,{tone:`neutral`,icon:!1,children:[(0,Q.jsx)(je,{size:11,"aria-hidden":`true`}),e]},e)),e.length>t&&(0,Q.jsxs)(`span`,{className:`text-body-sm text-muted`,"data-tip":e.slice(t).join(`, `),children:[`+`,e.length-t,(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`: `,e.slice(t).join(`, `)]})]})]}):null}function Ct({label:e,items:t,value:n,onChange:r}){let a=t.find(e=>e.id===n);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i,{size:`sm`,"aria-label":e,value:n,onChange:e=>r(e.target.value),className:c(`w-auto`,a?.alert&&a.n?`text-fail`:void 0),children:t.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.n===void 0?e.label:`${e.label} (${e.n})`},e.id))}),a?.tip&&(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:a.tip})]})}function wt({figures:e,label:t}){let n=e.filter(e=>e.points.length>=2);return n.length?(0,Q.jsx)(`ul`,{"aria-label":t,className:`m-0 flex list-none flex-col gap-4 p-0`,children:n.map(e=>{let t=e.format??(e=>String(e)),n=e.delta??(e=>String(e)),r=e.points.at(-1),i=e.points.at(-2),a=r.y-i.y,o=e.upIsGood===void 0||a===0?void 0:a>0===e.upIsGood,s=a>0?`up`:a<0?`down`:`no change`;return(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1 border-l-2 border-line pl-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.label}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,Q.jsx)(`span`,{className:`text-headline-sm text-ink tabular-nums`,children:t(r.y)}),(0,Q.jsxs)(`span`,{className:c(`text-body-sm font-medium tabular-nums`,o===void 0?`text-muted`:o?`text-pass`:`text-fail`),children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:a>0?`↗ `:a<0?`↘ `:`→ `}),a===0?`${s} since ${i.x}`:`${s} ${n(Math.abs(a))} since ${i.x}`]})]})]},e.label)})}):(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`The trend starts after a second day of numbers: each visit of Test management keeps the day's.`})}function Tt({items:e,series:t,label:n,empty:r}){return r&&!e.some(e=>e.values.some(e=>e>0))?(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:r}):(0,Q.jsxs)(`figure`,{className:`m-0 flex flex-col gap-2`,children:[(0,Q.jsx)(`span`,{className:`flex flex-wrap gap-4 text-body-sm text-ink-2`,children:t.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:c(`inline-block size-[10px] rounded-sm`,e.className),"aria-hidden":`true`}),e.name]},e.name))}),(0,Q.jsx)(w,{series:t.map((t,n)=>({values:e.map(e=>e.values[n]??0),tone:t.className.includes(`accent-line`)?`soft`:`accent`,glow:!t.className.includes(`accent-line`)})),lead:Math.max(0,t.findIndex(e=>!e.className.includes(`accent-line`))),label:`${n}: ${e.map(e=>`${e.x} ${e.values.join(` and `)}`).join(`; `)}`,className:`h-[140px]`}),(0,Q.jsxs)(`span`,{className:`flex justify-between text-body-sm text-muted`,children:[(0,Q.jsx)(`span`,{children:e[0]?.x}),(0,Q.jsx)(`span`,{children:e.at(-1)?.x})]})]})}function Et({label:e,part:t,whole:n,className:r=`bg-accent`}){let i=n?Math.round(t/n*100):0;return(0,Q.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,140px)_1fr_auto] items-center gap-4 text-body-sm`,children:[(0,Q.jsx)(vt,{text:e,className:`text-ink-2`}),(0,Q.jsx)(`span`,{role:`img`,"aria-label":`${e}: ${t} of ${n}`,className:`min-w-0`,children:(0,Q.jsx)(D,{share:n?t/n:0,lead:r===`bg-accent`,tone:r.includes(`fail`)?`fail`:r.includes(`pass`)?`pass`:void 0,text:`${i}%`})}),(0,Q.jsxs)(`span`,{className:`w-[86px] text-right tabular-nums text-ink-2`,children:[t,` of `,n]})]})}function Dt({open:e,onClose:t,title:n,preview:r,onStarted:a}){let[o,s]=(0,X.useState)(null),[l,u]=(0,X.useState)(``),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(``),[h,g]=(0,X.useState)(!1);(0,X.useEffect)(()=>{e&&(f(null),m(``),Z.suites().then(e=>{s({list:e.environments,...e.active?{active:e.active}:{}}),u(e.active&&e.environments.includes(e.active)?e.active:e.environments[0]??``)},e=>m(e.message)))},[e]),(0,X.useEffect)(()=>{if(!e||o===null)return;let t=!0;return f(null),m(``),r(l||void 0,!1).then(e=>{t&&f(e.preview??null)},e=>t&&m(e.message)),()=>{t=!1}},[e,l,o]);let _=async()=>{g(!0);try{await r(l||void 0,!0),a(),t()}catch(e){m(e.message)}finally{g(!1)}};return(0,Q.jsx)(Ie,{open:e,onClose:t,title:n,description:`ForgeQE runs these with forgeqe suite, on the environment you pick here. Results go to Runs and back to each case's system, as your settings say.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{onClick:t,children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),`Cancel`]}),(0,Q.jsxs)(y,{variant:`primary`,disabled:h||!d,onClick:()=>void _(),"data-tip":`Start the run`,children:[(0,Q.jsx)(N,{"aria-hidden":`true`}),`Run `,d?d.cases:``]})]}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-body-sm`,children:[o&&o.list.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Environment`,(0,Q.jsx)(i,{value:l,onChange:e=>u(e.target.value),children:o.list.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))})]}),d&&(0,Q.jsxs)(`p`,{role:`status`,className:`m-0 text-ink-2`,children:[d.cases,` test case`,d.cases===1?``:`s`,` on `,d.env??`the active environment`,`.`]}),p&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:p})]})})}var Ot=e=>e.lastRun.outcome===`failed`||e.lastRun.outcome===`blocked`,kt=e=>r(`test-management`,`cases`,encodeURIComponent(e)),At=e=>r(`test-management`,`tests`,encodeURIComponent(e));function jt({tests:e}){let t=(0,Q.jsxs)(`a`,{className:b({size:`sm`}),href:r(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,Q.jsx)(we,{"aria-hidden":`true`}),`Connect a test plan`]});return e?(0,Q.jsxs)(_,{page:!0,icon:de,title:`${e} automated test${e===1?``:`s`} found, no test case yet`,action:t,children:[`Your automation repository's code has them: see them on `,(0,Q.jsx)(`a`,{href:r(`test-management`,`tests`),children:`Automated`}),`. Connect a test plan (Azure DevOps, Xray, TestRail, Zephyr Scale or qTest) to see the test cases they cover, which are automated and which are not. It goes in Settings › Integrations.`]}):(0,Q.jsx)(_,{page:!0,icon:I,title:`No test plans connected yet`,action:t,children:`Connect a test plan from your test case system (Azure DevOps, Xray, TestRail, Zephyr Scale or qTest) and its cases show here with their automation, runs and gaps. Cases ForgeQE wrote or automated show here already. In Settings, add it under your system's Test management, Test plans.`})}function Mt({cases:e,onChanged:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(`all`),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(null),p=()=>Z.tests().then(e=>{r(e),a(``)},e=>a(e.message));(0,X.useEffect)(()=>{p()},[]),(0,X.useEffect)(()=>{if(!n?.busy)return;let e=Ne(()=>void p(),3e3);return()=>Pe(e)},[n?.busy]),Lt(n?.busy??null,()=>t(`Done: the tests and their links are up to date.`));let m=(0,X.useMemo)(()=>new Map(e.map(e=>[e.key,e])),[e]);if(i)return(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:i});if(!n)return(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`});let h=n.tests,g={all:h.length,unlinked:h.filter(e=>!e.cases.length).length,linked:h.filter(e=>e.cases.length).length,code:h.filter(e=>e.via===`code`).length},_=h.filter(e=>o===`all`||(o===`unlinked`?!e.cases.length:o===`linked`?e.cases.length>0:e.via===`code`)),v=Ft(_.map(e=>e.file).filter(e=>!!e)),b=async()=>{try{t(`The mapping agent is looking at ${(await Z.proposeLinks()).cases} cases with no test.`),p()}catch(e){t(e.message)}};return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(y,{variant:`primary`,onClick:()=>u(!0),disabled:!!n.busy,children:[(0,Q.jsx)(le,{"aria-hidden":`true`}),`Discover`]}),(0,Q.jsxs)(y,{onClick:()=>void b(),disabled:!!n.busy||!h.length,"data-tip":`The mapping agent links cases that have no test to the tests that check them`,children:[(0,Q.jsx)(L,{"aria-hidden":`true`}),`Link`]}),(0,Q.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[n.busy?n.busy.what===`discover`?`Discovering tests, started ${U(n.busy.started)}…`:`The mapping agent is at work, started ${U(n.busy.started)}…`:n.discovery?`Discovered ${U(n.discovery.at)}.`:`Not discovered yet: these are read from the code.`,n.proposed>0&&` ${n.proposed} link${n.proposed===1?``:`s`} proposed, waiting on the cases' pages.`]})]}),n.error&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:n.error}),n.discovery&&n.discovery.projects.length>0&&(0,Q.jsx)(Rt,{projects:n.discovery.projects}),(0,Q.jsx)(q,{label:`Automated tests`,placeholder:`Find a test by id, name, file or tag`,height:Be,resetKey:o,empty:h.length?`No test matches.`:`No automated test found yet. Discover asks each test project's framework (pytest, .NET, Playwright, Vitest, Jest, Mocha, Robot Framework) for its tests; set the automation repository in Settings › Code first.`,tools:(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,Q.jsx)(Ct,{label:`Tests to show`,items:[{id:`all`,label:`All tests`,n:g.all},{id:`unlinked`,label:`No test case`,n:g.unlinked},{id:`linked`,label:`Linked`,n:g.linked},{id:`code`,label:`Read from the code`,n:g.code,tip:`Their framework was not asked, or could not list them`}],value:o,onChange:s}),v&&(0,Q.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`Files in `,(0,Q.jsx)(`span`,{className:`font-mono`,children:v})]})]}),head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-[45%]`),children:`Test`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Framework`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Test cases`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @3xl:table-cell`),children:`Tags`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Last runs`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:_.map(t=>(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsx)(`td`,{className:c(K,`max-w-0`),children:(0,Q.jsxs)(Pt,{uid:t.uid,children:[(0,Q.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t.name}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-x-2 text-body-sm text-muted`,children:[(0,Q.jsx)(`span`,{className:`flex-none font-mono text-accent-fg`,children:t.uid??`No id yet`}),t.file&&(0,Q.jsx)(Nt,{path:t.file.slice(v.length),line:t.line}),t.flaky&&(0,Q.jsx)(E,{tone:`warn`,children:`Flaky`})]})]})}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm @2xl:table-cell`),children:(0,Q.jsxs)(`span`,{"data-tip":nt[t.via??`runs`],children:[t.framework&&t.framework!==`code`?It[t.framework]:(0,Q.jsx)(`span`,{className:`text-muted`,children:`Not known yet`}),t.framework===`gherkin`?`, ${t.runner??`no runner found`}`:``,(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`, `,nt[t.via??`runs`]]})]})}),(0,Q.jsx)(`td`,{className:c(K,`text-body-sm`),"data-sort":t.cases.length,children:t.cases.length?(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-x-2`,children:[t.cases.slice(0,4).map(e=>(0,Q.jsx)(`a`,{href:kt(e),className:`font-mono`,"data-tip":m.get(e)?.title,children:m.get(e)?.id??e},e)),t.cases.length>4&&(0,Q.jsxs)(`span`,{className:`text-muted`,children:[`+`,t.cases.length-4]})]}):(0,Q.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,Q.jsx)(`td`,{className:c(K,`hidden @3xl:table-cell`),children:(0,Q.jsx)(St,{tags:t.tags})}),(0,Q.jsx)(`td`,{className:c(K,`hidden @2xl:table-cell`),"data-sort":t.runs.length?t.runs.filter(e=>e===`p`).length/t.runs.length:-1,children:(0,Q.jsx)(xt,{runs:t.runs})}),(0,Q.jsx)(`td`,{className:c(K,`text-right`),children:(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,onClick:()=>f(t),"aria-label":`Link ${t.name} to a test case`,disabled:!e.length||!t.uid,"data-tip":t.uid?`Link to a test case`:`Known from runs only: Discover gives it an id to link`,children:(0,Q.jsx)(z,{"aria-hidden":`true`})})})]},t.uid??t.key))}),(0,Q.jsx)(zt,{open:l,onClose:()=>u(!1),onStarted:()=>{u(!1),t(`Discovering tests: each project's framework lists its tests.`),p()}}),(0,Q.jsx)(Bt,{open:!!d,title:`Link to a test case`,description:d?`Pick the test case ${d.name} checks. It is kept in .forgeqe/testmgmt/links.json, shared with the team.`:void 0,items:e.filter(e=>!d?.cases.includes(e.key)).map(e=>({id:e.key,label:e.title,sub:e.id})),onClose:()=>f(null),onPick:async e=>{d?.uid&&(await Z.link([{case:e,test:d.uid,action:`link`}]),f(null),t(`Linked ${d.uid} to ${m.get(e)?.id??e}.`),p())}})]})}function Nt({path:e,line:t}){let n=e.lastIndexOf(`/`)+1;return(0,Q.jsxs)(`span`,{className:`flex min-w-0 font-mono whitespace-nowrap`,children:[n>0&&(0,Q.jsx)(`span`,{className:`min-w-0 shrink-[999] truncate`,children:e.slice(0,n)}),(0,Q.jsx)(`span`,{className:`min-w-[10ch] truncate`,children:e.slice(n)}),t?`:${t}`:``]})}function Pt({uid:e,children:t}){let n=`flex min-w-0 flex-col gap-1 text-ink no-underline`;return e?(0,Q.jsx)(`a`,{href:At(e),className:n,children:t}):(0,Q.jsx)(`span`,{className:n,children:t})}function Ft(e){if(!e.length)return``;let t=e[0].split(`/`).slice(0,-1);for(let n of e.slice(1)){let e=n.split(`/`).slice(0,-1),r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];)r++;t=t.slice(0,r)}return t.length?`${t.join(`/`)}/`:``}var It={pytest:`pytest`,dotnet:`.NET`,playwright:`Playwright`,jest:`Jest`,vitest:`Vitest`,mocha:`Mocha`,robot:`Robot Framework`,gherkin:`Gherkin`,code:`Code`};function Lt(e,t){let[n,r]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{e?r(!0):n&&(r(!1),t())},[e]),n}function Rt({projects:e}){return(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,children:e.map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-start gap-2`,children:[e.ok?(0,Q.jsx)(ce,{size:14,"aria-label":`Listed`,className:`mt-1 flex-none text-pass`}):(0,Q.jsx)(A,{size:14,"aria-label":`Not listed`,className:`mt-1 flex-none text-warn`}),(0,Q.jsxs)(`span`,{children:[e.label,` in `,e.dir?(0,Q.jsx)(`span`,{className:`font-mono`,children:e.dir}):`the repository's root`,`: `,e.ok?`${e.tests} test${e.tests===1?``:`s`}`:`not listed by its framework, read from the code`,e.error&&(0,Q.jsx)(`span`,{className:`block text-muted [overflow-wrap:anywhere]`,children:e.error})]})]},`${e.framework}-${e.dir}-${t}`))})}function zt({open:e,onClose:t,onStarted:n}){let[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(``),[s,l]=(0,X.useState)(!1);(0,X.useEffect)(()=>{e&&(i(null),o(``),Z.discoveryPlan().then(i,e=>o(e.message)))},[e]);let u=async()=>{if(r){l(!0);try{await Z.discover(r.digest),n()}catch(e){o(e.message)}finally{l(!1)}}};return(0,Q.jsx)(Ie,{open:e,onClose:t,title:`Discover tests`,description:`Each test project's framework lists its tests, as a test explorer asks it. This runs the repository's code (pytest imports conftest.py, .NET builds the project) with no secret of ForgeQE's, so look at what will run first.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y,{onClick:t,children:`Cancel`}),(0,Q.jsxs)(y,{variant:`primary`,onClick:()=>void u(),disabled:!r||s,children:[(0,Q.jsx)(N,{"aria-hidden":`true`}),`Discover`]})]}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 text-body-sm`,children:[a&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:a}),!r&&!a&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Finding the test projects…`}),r&&!r.steps.length&&(0,Q.jsx)(`p`,{className:`m-0 text-ink-2`,children:`No test project was found whose framework can be asked. Gherkin features and the code are still read.`}),r&&r.steps.length>0&&(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:r.steps.map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`span`,{children:[It[e.project.framework],` in `,e.project.dir?(0,Q.jsx)(`span`,{className:`font-mono`,children:e.project.dir}):`the repository's root`]}),(0,Q.jsx)(`code`,{className:`font-mono text-body-sm font-medium text-ink [overflow-wrap:anywhere]`,children:e.command})]},t))})]})})}function Bt({open:e,title:t,description:n,items:r,onClose:i,onPick:a}){let[o,s]=(0,X.useState)(``),[l,u]=(0,X.useState)(``);(0,X.useEffect)(()=>s(``),[e]);let d=async e=>{u(e),s(``);try{await a(e)}catch(e){s(e.message)}finally{u(``)}};return(0,Q.jsx)(Ie,{open:e,onClose:i,title:t,description:n,wide:!0,footer:(0,Q.jsx)(y,{onClick:i,children:`Close`}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,Q.jsxs)(`p`,{role:`alert`,className:c(x.fail,`m-0 flex items-center gap-2`),children:[(0,Q.jsx)(B,{size:14,"aria-hidden":`true`}),o]}),(0,Q.jsx)(q,{label:t,placeholder:`Find by id or words`,resetKey:String(e),empty:`Nothing to pick.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Name`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Pick`})})]}),children:r.map(e=>(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsxs)(`td`,{className:c(K,`max-w-0`),children:[(0,Q.jsx)(vt,{text:e.label}),e.sub&&(0,Q.jsx)(`span`,{className:`block truncate font-mono text-body-sm text-muted`,children:e.sub})]}),(0,Q.jsx)(`td`,{className:c(K,`w-24 text-right`),children:(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,onClick:()=>void d(e.id),disabled:!!l,"aria-label":`Link ${e.label}`,"data-tip":`Link`,children:(0,Q.jsx)(z,{"aria-hidden":`true`})})})]},e.id))})]})})}var Vt=e=>e&&/^https:\/\//i.test(e)?e:void 0;function Ht({caseKey:e,onRun:t,onChanged:n=()=>{}}){let[i,a]=(0,X.useState)(null),[o,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(``);(0,X.useEffect)(()=>{let t=!0;return a(null),l(``),p(``),Z.case(e).then(e=>{t&&(a(e),l(``))},e=>t&&l(e.message)),()=>{t=!1}},[e]);let m=t=>{p(t),n(),Z.case(e).then(a,e=>p(`${t} Reading the case again failed: ${e.message}`))},h=(0,Q.jsx)(te,{to:{href:r(`test-management`,`cases`),label:`Test cases`}});if(o)return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[h,(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:o})]});if(!i)return(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`});let g=i.case,_=[g.key],v=Vt(g.url);return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[h,(0,Q.jsxs)(`header`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_420px] flex-col gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-accent-fg`,children:g.id}),` · `,g.plans.join(`, `)||`Not in a synced plan`]}),(0,Q.jsx)(Ye,{icon:O,title:g.title}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[g.priority&&(0,Q.jsxs)(E,{tone:g.priority===1?`fail`:g.priority===2?`warn`:`neutral`,icon:!1,children:[`Priority `,g.priority]}),g.state&&(0,Q.jsx)(E,{tone:`neutral`,children:g.state}),(0,Q.jsx)(yt,{a:g.automation}),g.origin===`forgeqe`&&(0,Q.jsxs)(E,{tone:`running`,icon:!1,children:[(0,Q.jsx)(L,{size:12,"aria-hidden":`true`}),`Written by ForgeQE`,g.createdAt?` ${U(g.createdAt)}`:``]})]})]}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[v&&(0,Q.jsxs)(`a`,{className:b(),href:v,target:`_blank`,rel:`noreferrer noopener`,"data-tip":`Open in its system`,children:[(0,Q.jsx)(_e,{"aria-hidden":`true`}),`Open`]}),g.how!==`none`&&g.how!==`tracker`&&!!g.test?.file&&g.trackerAutomated!==!0&&(0,Q.jsxs)(y,{onClick:()=>d(`automation`),"data-tip":`Mark it automated in its system`,children:[(0,Q.jsx)(R,{"aria-hidden":`true`}),`Mark automated`]}),g.ownTags.some(e=>!g.trackerTags.includes(e))&&(0,Q.jsxs)(y,{onClick:()=>d(`tags`),"data-tip":`Write ForgeQE's tags to its system`,children:[(0,Q.jsx)(R,{"aria-hidden":`true`}),`Write tags`]}),g.ownTags.some(e=>g.trackerTags.includes(e))&&(0,Q.jsxs)(y,{onClick:()=>d(`untag`),"data-tip":`Take ForgeQE's tags off in its system`,children:[(0,Q.jsx)(De,{"aria-hidden":`true`}),`Untag`]}),(0,Q.jsxs)(y,{variant:`primary`,onClick:()=>t([g.key]),children:[(0,Q.jsx)(N,{"aria-hidden":`true`}),`Run`]})]})]}),(0,Q.jsx)(mt,{kind:u,keys:_,onClose:()=>d(null),onDone:m}),f&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-ink-2`,children:f}),(g.stale||g.drift)&&(0,Q.jsxs)(`p`,{role:`status`,className:c(x.warn,`m-0 flex items-start gap-2`),children:[(0,Q.jsx)(A,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,Q.jsxs)(`span`,{children:[g.stale&&`Its steps changed in its system after its test was written: the next run updates the test. `,g.drift&&(g.trackerAutomated?`Its system marks it automated, but ForgeQE knows no test for it.`:`ForgeQE has a test for it, but its system does not mark it automated.`)]})]}),(0,Q.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,Q.jsx)(q,{label:`Steps`,search:!1,sortable:!1,empty:`Its system holds no steps for it, or it is not in a synced plan.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-10`),children:`#`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Action`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Expected result`})]}),children:i.steps.map((e,t)=>(0,Q.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,Q.jsx)(`td`,{className:c(K,`text-body-sm text-muted tabular-nums`),children:t+1}),(0,Q.jsx)(`td`,{className:c(K,`text-body-sm [overflow-wrap:anywhere]`),children:e.action}),(0,Q.jsx)(`td`,{className:c(K,`text-body-sm text-ink-2 [overflow-wrap:anywhere]`),children:e.expected??`–`})]},t))}),(0,Q.jsx)(Ut,{detail:i,onChanged:m})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,Q.jsx)(J,{level:3,icon:he,title:`Details`,className:c(s,`text-body-sm`),children:(0,Q.jsxs)(`dl`,{className:`m-0 grid grid-cols-[96px_1fr] gap-x-4 gap-y-2`,children:[(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Last run`}),(0,Q.jsxs)(`dd`,{className:`m-0 flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(bt,{o:g.lastRun.outcome}),g.lastRun.at&&(0,Q.jsxs)(`span`,{className:`text-muted`,children:[U(g.lastRun.at),g.lastRun.by===`tracker`?`, in its system`:``]})]}),(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Suite`}),(0,Q.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:g.suite??`–`}),(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Area`}),(0,Q.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:g.group??`–`}),(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Stories`}),(0,Q.jsx)(`dd`,{className:`m-0`,children:g.stories.join(`, `)||`–`}),(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Tags`}),(0,Q.jsx)(`dd`,{className:`m-0`,children:g.tags.length?(0,Q.jsx)(St,{tags:g.tags,max:10}):`–`}),(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Steps`}),(0,Q.jsx)(`dd`,{className:`m-0`,children:g.steps})]})}),(0,Q.jsx)(J,{level:3,icon:Oe,title:`In suites and packs`,className:c(s,`text-body-sm`),children:i.suites.length||g.packs.length?(0,Q.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:[i.suites.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`a`,{href:r(`test-management`,`suites`,e.id),children:e.name})},e.id)),g.packs.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`a`,{href:r(`regression`,e),children:[`Pack `,e]})},e))]}):(0,Q.jsx)(`p`,{className:`m-0 text-muted`,children:`In no suite or regression pack.`})}),i.changes.length>0&&(0,Q.jsx)(J,{level:3,icon:me,title:`What ForgeQE did`,className:c(`surface rounded-lg bg-bg p-6 shadow-sm`,`text-body-sm`),children:(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:i.changes.map((e,t)=>(0,Q.jsxs)(`li`,{className:`[overflow-wrap:anywhere]`,children:[(0,Q.jsx)(`span`,{className:`text-muted`,children:U(e.at)}),` `,e.action,e.story?` for ${e.story}`:``,e.reason?`: ${e.reason}`:``]},t))})})]})]})]})}function Ut({detail:e,onChanged:t}){let n=e.case,[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(!1),[l,u]=(0,X.useState)(``);(0,X.useEffect)(()=>{(n.proposed.length||a)&&Z.tests().then(e=>i(e.tests),()=>{})},[n.proposed.length,a]);let d=new Map((r??[]).filter(e=>e.uid).map(e=>[e.uid,e])),f=async(e,r,i)=>{u(``);try{await Z.link([{case:n.key,test:e,action:r}]),t(i)}catch(e){u(e.message)}},p=async e=>{u(``);try{t(`${e} is the main test now${(await Z.setMain(n.key,e)).mapped?`, and ForgeQE's mapping records it`:``}. Mark automated writes it to the tracker.`)}catch(e){u(e.message)}},m=async()=>{u(``);try{await Z.proposeLinks([n.key]),t(`The mapping agent is looking for this case's tests. Open the case again in a moment.`)}catch(e){u(e.message)}};return(0,Q.jsxs)(J,{level:3,icon:ae,title:`Automated tests`,className:s,actions:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{size:`sm`,onClick:()=>o(!0),"data-tip":`Link a test`,children:[(0,Q.jsx)(z,{"aria-hidden":`true`}),`Link`]}),(0,Q.jsxs)(y,{size:`sm`,onClick:()=>void m(),"data-tip":`The mapping agent picks the tests that check this case`,children:[(0,Q.jsx)(L,{"aria-hidden":`true`}),`Ask`]})]}),children:[l&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:l}),n.tests.length?(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0 text-body-sm`,children:n.tests.map(e=>(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-start gap-2 border-t border-line-soft py-2 first:border-t-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 [overflow-wrap:anywhere]`,children:[e.name,e.main&&n.tests.length>1&&(0,Q.jsx)(`span`,{"data-tip":`What its tracker records as its automated test, and what a run reuses first`,children:(0,Q.jsx)(E,{tone:`pass`,icon:!1,children:`Main test`})})]}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-body-sm text-muted`,children:[e.uid&&(0,Q.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.uid}),e.file&&(0,Q.jsx)(`span`,{className:`font-mono [overflow-wrap:anywhere]`,children:e.file})]}),(0,Q.jsxs)(`span`,{className:`text-body-sm text-ink-2`,children:[tt[e.how],e.why&&e.why!==tt[e.how]?`: ${e.why}`:``]})]}),e.uid&&n.tests.length>1&&!e.main&&(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,onClick:()=>void p(e.uid),"aria-label":`Make ${e.name} the main test`,"data-tip":`Make main: its tracker records this one as the case's automated test`,children:(0,Q.jsx)(be,{"aria-hidden":`true`})}),e.uid&&e.how!==`mapping`&&(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,onClick:()=>void f(e.uid,`unlink`,`Unlinked ${e.uid}. It is not linked again by itself.`),"aria-label":`Unlink ${e.name}`,"data-tip":`Unlink`,children:(0,Q.jsx)(j,{"aria-hidden":`true`})})]},e.uid??e.key))}):n.test?(0,Q.jsxs)(`dl`,{className:`m-0 grid grid-cols-[120px_1fr] gap-x-4 gap-y-2 text-body-sm`,children:[(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Test`}),(0,Q.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:n.test.name}),(0,Q.jsx)(`dt`,{className:`text-muted`,children:`File`}),(0,Q.jsx)(`dd`,{className:`m-0 font-mono [overflow-wrap:anywhere]`,children:n.test.file??`–`}),(0,Q.jsx)(`dt`,{className:`text-muted`,children:`Known from`}),(0,Q.jsx)(`dd`,{className:`m-0`,children:n.how===`none`?`–`:tt[n.how]})]}):(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No automated test is linked. Link one, ask the agent, or ask the agent on the right to automate it.`}),(n.tests.length>0||n.test)&&(0,Q.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-body-sm text-muted`,children:[`Last runs `,(0,Q.jsx)(xt,{runs:e.test?.runs??n.runs})]}),n.proposed.length>0&&(0,Q.jsxs)(`div`,{className:c(`rounded-base bg-surface-muted p-4`,`flex flex-col gap-2 text-body-sm`),children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:`Proposed by the mapping agent`}),n.proposed.map(e=>{let t=d.get(e.test);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col`,children:[(0,Q.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t?.name??e.test}),(0,Q.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[(0,Q.jsx)(`span`,{className:`font-mono`,children:e.test}),e.confidence?` · ${e.confidence} confidence`:``,e.why?` · ${e.why}`:``]})]}),(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,onClick:()=>void f(e.test,`accept`,`Linked ${e.test}.`),"aria-label":`Accept ${t?.name??e.test}`,"data-tip":`Accept`,children:(0,Q.jsx)(Ae,{"aria-hidden":`true`})}),(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,onClick:()=>void f(e.test,`refuse`,`Refused ${e.test}.`),"aria-label":`Refuse ${t?.name??e.test}`,"data-tip":`Refuse`,children:(0,Q.jsx)(j,{"aria-hidden":`true`})})]},e.test)})]}),(0,Q.jsx)(Bt,{open:a,title:`Link a test`,description:`Pick a test that checks ${n.id}. It is kept in .forgeqe/testmgmt/links.json, shared with the team.`,items:(r??[]).filter(e=>e.uid&&!n.tests.some(t=>t.uid===e.uid)).map(e=>({id:e.uid,label:e.name,sub:`${e.uid}${e.file?` · ${e.file}`:``}`})),onClose:()=>o(!1),onPick:async e=>{await Z.link([{case:n.key,test:e,action:`link`}]),o(!1),t(`Linked ${e}.`)}})]})}var Wt=[{id:`all`,label:`All cases`,icon:I,test:()=>!0},{id:`not_automated`,label:`Not automated`,icon:M,test:e=>e.automation===`not_automated`},{id:`failing`,label:`Failing`,icon:B,test:Ot,alert:!0},{id:`pending`,label:`Pending`,icon:ie,test:e=>e.automation===`pending`},{id:`generated`,label:`Generated by ForgeQE`,icon:L,test:e=>e.origin===`forgeqe`},{id:`stale`,label:`Steps changed`,icon:A,test:e=>e.stale},{id:`drift`,label:`Tracker disagrees`,icon:A,test:e=>e.drift}],Gt=``,Kt=e=>[...new Set(e.filter(e=>!!e))].sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));function qt({cases:e,tests:t=0,selected:n,onSelect:r,onRun:a,onChanged:o}){let[s,l]=(0,X.useState)(`all`),[u,d]=(0,X.useState)(Gt),[f,p]=(0,X.useState)(Gt),[m,h]=(0,X.useState)(Gt),[g,_]=(0,X.useState)(Gt),[v,b]=(0,X.useState)(!1),[x,S]=(0,X.useState)(!1),[C,w]=(0,X.useState)(null),T=(0,X.useMemo)(()=>Kt(e.flatMap(e=>e.plans)),[e]),ee=(0,X.useMemo)(()=>Kt(e.map(e=>e.suite)),[e]),E=(0,X.useMemo)(()=>Kt(e.flatMap(e=>e.tags)),[e]),te=e.filter(e=>(!u||e.plans.includes(u))&&(!f||e.suite===f)&&(!m||String(e.priority??``)===m)&&(!g||e.tags.includes(g))),ne=Wt.find(e=>e.id===s),D=te.filter(ne.test),O=new Set(n),re=(e,t)=>r(t?[...n,e]:n.filter(t=>t!==e)),k=D.length>0&&D.every(e=>O.has(e.key));return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(q,{label:`Test cases`,placeholder:`Find a case by id, title, tag or test`,height:Be,selection:{count:n.length,onClear:()=>r([]),actions:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{size:`sm`,onClick:()=>b(!0),children:[(0,Q.jsx)(je,{"aria-hidden":`true`}),`Tag`]}),(0,Q.jsxs)(y,{size:`sm`,onClick:()=>S(!0),"data-tip":`Make a suite of the picked cases`,children:[(0,Q.jsx)(Oe,{"aria-hidden":`true`}),`Suite`]}),(0,Q.jsxs)(y,{size:`sm`,onClick:()=>w(`automation`),"data-tip":`Mark the picked cases automated in their tracker`,children:[(0,Q.jsx)(R,{"aria-hidden":`true`}),`Mark automated`]}),(0,Q.jsxs)(y,{size:`sm`,onClick:()=>w(`tags`),"data-tip":`Write ForgeQE's tags to their tracker`,children:[(0,Q.jsx)(R,{"aria-hidden":`true`}),`Write tags`]}),(0,Q.jsxs)(y,{size:`sm`,variant:`primary`,onClick:()=>a(n),children:[(0,Q.jsx)(N,{"aria-hidden":`true`}),`Run`]})]})},resetKey:`${s}|${u}|${f}|${m}|${g}`,empty:e.length?`Nothing matches.`:t?`No test cases yet. The repository's ${t} automated test${t===1?` is`:`s are`} on the Automated tab.`:`No test cases yet.`,tools:(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(Ct,{label:`Show`,items:Wt.map(e=>({id:e.id,label:e.label,n:te.filter(e.test).length,...e.alert?{alert:!0}:{}})),value:s,onChange:l}),T.length>1&&(0,Q.jsxs)(i,{size:`sm`,"aria-label":`Plan`,value:u,onChange:e=>d(e.target.value),className:`w-auto`,children:[(0,Q.jsx)(`option`,{value:Gt,children:`Every plan`}),T.map(e=>(0,Q.jsx)(`option`,{children:e},e))]}),ee.length>0&&(0,Q.jsxs)(i,{size:`sm`,"aria-label":`Suite`,value:f,onChange:e=>p(e.target.value),className:`w-auto`,children:[(0,Q.jsx)(`option`,{value:Gt,children:`Every suite`}),ee.map(e=>(0,Q.jsx)(`option`,{children:e},e))]}),(0,Q.jsxs)(i,{size:`sm`,"aria-label":`Priority`,value:m,onChange:e=>h(e.target.value),className:`w-auto`,children:[(0,Q.jsx)(`option`,{value:Gt,children:`Any priority`}),[`1`,`2`,`3`,`4`].map(e=>(0,Q.jsxs)(`option`,{value:e,children:[`Priority `,e]},e))]}),E.length>0&&(0,Q.jsxs)(i,{size:`sm`,"aria-label":`Tag`,value:g,onChange:e=>_(e.target.value),className:`w-auto`,children:[(0,Q.jsx)(`option`,{value:Gt,children:`Any tag`}),E.map(e=>(0,Q.jsx)(`option`,{children:e},e))]})]}),head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-10`),children:(0,Q.jsx)(Y,{"aria-label":`Select every case shown`,checked:k,onCheckedChange:e=>r(e?Kt([...n,...D.map(e=>e.key)]):n.filter(e=>!D.some(t=>t.key===e)))})}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Test case`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Suite`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Priority`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @xl:table-cell`),children:`Automation`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @4xl:table-cell`),children:`Last runs`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @xl:table-cell`),children:`Last run`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:D.map(e=>(0,Q.jsxs)(`tr`,{className:W,"data-state":O.has(e.key)?`selected`:void 0,children:[(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(Y,{"aria-label":`Select ${e.id}`,checked:O.has(e.key),onCheckedChange:t=>re(e.key,t)})}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsxs)(`a`,{href:kt(e.key),className:`flex min-w-[160px] flex-col gap-1 text-ink no-underline @xl:min-w-[220px]`,children:[(0,Q.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-body-sm text-muted`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.id}),e.origin===`forgeqe`&&(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"data-tip":`ForgeQE wrote this case`,children:[(0,Q.jsx)(L,{size:12,"aria-hidden":`true`}),`ForgeQE`]}),e.stories[0]&&(0,Q.jsx)(`span`,{children:e.stories[0]}),(0,Q.jsx)(St,{tags:e.tags,max:2})]}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 @xl:hidden`,children:[(0,Q.jsx)(yt,{a:e.automation}),(0,Q.jsx)(bt,{o:e.lastRun.outcome})]})]})}),(0,Q.jsx)(`td`,{className:c(K,`hidden min-w-[120px] max-w-[220px] text-body-sm text-ink-2 [overflow-wrap:anywhere] @2xl:table-cell`),children:e.suite??e.plans[0]??`–`}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm @2xl:table-cell`),children:e.priority?`P${e.priority}`:`–`}),(0,Q.jsxs)(`td`,{className:c(K,`hidden @xl:table-cell`),children:[(0,Q.jsx)(yt,{a:e.automation}),e.stale&&(0,Q.jsx)(`span`,{className:`mt-1 block text-body-sm text-warn`,children:`Steps changed`})]}),(0,Q.jsx)(`td`,{className:c(K,`hidden @4xl:table-cell`),"data-sort":e.runs.length?e.runs.filter(e=>e===`p`).length/e.runs.length:-1,children:(0,Q.jsx)(xt,{runs:e.runs})}),(0,Q.jsx)(`td`,{className:c(K,`hidden @xl:table-cell`),"data-sort":e.lastRun.at&&Date.parse(e.lastRun.at)||0,children:(0,Q.jsxs)(`span`,{"data-tip":e.lastRun.at?`${U(e.lastRun.at)}${e.lastRun.by===`tracker`?`, in its system`:``}`:void 0,children:[(0,Q.jsx)(bt,{o:e.lastRun.outcome}),e.lastRun.at&&(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`, `,U(e.lastRun.at),e.lastRun.by===`tracker`?`, in its system`:``]})]})}),(0,Q.jsx)(`td`,{className:c(K,`text-right whitespace-nowrap`),children:(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.id}`,"data-tip":Ot(e)?`Run again`:`Run`,onClick:()=>a([e.key]),children:(0,Q.jsx)(N,{"aria-hidden":`true`})})})]},e.key))}),(0,Q.jsx)(mt,{kind:C,keys:n,onClose:()=>w(null),onDone:e=>o(e)}),(0,Q.jsx)(Jt,{open:v,keys:n,onClose:()=>b(!1),onDone:e=>o(e)}),(0,Q.jsx)(Yt,{open:x,keys:n,onClose:()=>S(!1),onDone:e=>o(e)})]})}function Jt({open:e,keys:t,onClose:n,onDone:r}){let[i,a]=(0,X.useState)(``),[s,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(``),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(null),g=`${s?`-`:`+`}${i.trim()}|${t.join(`
|
|
4
4
|
`)}`,_=m?.asked===g?m:null;(0,X.useEffect)(()=>{e||h(null)},[e]);let v=async()=>{p(!0),d(``);try{let e={[s?`remove`:`add`]:[i.trim()],cases:t};if(!_){let t=await Z.tag(e);h({asked:g,items:t.preview?.items??0});return}let o=await Z.tag(e,!0);h(null),r(`${s?`Removed`:`Added`} the tag ${i.trim()} ${s?`from`:`on`} ${o.changed??0} case${o.changed===1?``:`s`}.`),a(``),n()}catch(e){d(e.message)}finally{p(!1)}};return(0,Q.jsx)(Ie,{open:e,onClose:n,title:`Tag ${t.length} test case${t.length===1?``:`s`}`,description:`ForgeQE keeps its tags in .forgeqe/testmgmt/tags.json, shared with the team through the repository. The case's own tags in its system do not change.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{onClick:n,children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),`Cancel`]}),(0,Q.jsxs)(y,{variant:`primary`,disabled:f||!i.trim()||!!_&&_.items===0,onClick:()=>void v(),children:[(0,Q.jsx)(je,{"aria-hidden":`true`}),_?`${s?`Remove from`:`Add to`} ${_.items}`:`Preview`]})]}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-body-sm`,children:[(0,Q.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Tag`,(0,Q.jsx)(o,{value:i,maxLength:40,placeholder:`smoke, release-24.11`,onChange:e=>a(e.target.value)})]}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Y,{checked:s,onCheckedChange:l}),`Remove it instead`]}),_&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-ink-2`,children:_.items===0?`No case would change.`:`${_.items} case${_.items===1?``:`s`} would change. ${s?`Remove`:`Add`} to confirm.`}),u&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:u})]})})}function Yt({open:e,keys:t,onClose:n,onDone:i}){let[a,s]=(0,X.useState)(``),[l,u]=(0,X.useState)(``),[d,f]=(0,X.useState)(!1),p=async()=>{f(!0),u(``);try{let{suite:e}=await Z.saveSuite({name:a.trim(),groups:[],exclude:[],picked:t});i(`Made the suite ${e.name}.`),s(``),n(),location.hash=r(`test-management`,`suites`,e.id)}catch(e){u(e.message)}finally{f(!1)}};return(0,Q.jsx)(Ie,{open:e,onClose:n,title:`A suite of ${t.length} test case${t.length===1?``:`s`}`,description:`Kept in .forgeqe/testmgmt/suites.json. For a suite that keeps up as plans change, ask the Suite agent on Suites.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{onClick:n,children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),`Cancel`]}),(0,Q.jsxs)(y,{variant:`primary`,disabled:d||!a.trim(),onClick:()=>void p(),children:[(0,Q.jsx)(Oe,{"aria-hidden":`true`}),`Make the suite`]})]}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-body-sm`,children:[(0,Q.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Name`,(0,Q.jsx)(o,{value:a,maxLength:80,placeholder:`Saved cards`,onChange:e=>s(e.target.value)})]}),l&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:l})]})})}var Xt=e=>new Date(`${e}T00:00:00Z`).toLocaleDateString([],{month:`short`,day:`numeric`,timeZone:`UTC`}),Zt=(e,t)=>t?Math.round(e/t*100):0;function Qt(e,t,n){if(e.length<2)return;let r=e.at(-1),i=new Date(`${r.day}T00:00:00Z`).getTime()-6048e5,a=e.findLast(e=>new Date(`${e.day}T00:00:00Z`).getTime()<=i)??e[0],o=t(r)-t(a);return{text:`${o>0?`+`:``}${o}`,dir:o>0?`up`:o<0?`down`:`same`,...n===void 0||o===0?{}:{good:o>0===n},against:`since ${Xt(a.day)}`}}function $t({view:e,onRunSuite:t}){let n=e.summary;if(!n.cases&&!e.plans.length)return(0,Q.jsx)(jt,{tests:n.tests});let i=e.trend;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Q.jsxs)(V,{label:`Headline numbers`,children:[(0,Q.jsx)(H,{label:`Test cases`,icon:I,value:n.cases,change:Qt(i,e=>e.cases,void 0),note:`${e.plans.length} plan${e.plans.length===1?``:`s`}`}),(0,Q.jsx)(H,{label:`Automated`,icon:ce,value:`${n.automated} · ${Zt(n.automated,n.cases)}%`,change:Qt(i,e=>e.automated,!0),note:`${n.newlyAutomated} newly this week`}),(0,Q.jsx)(H,{label:`Not automated`,icon:M,value:n.notAutomated,change:Qt(i,e=>e.notAutomated,!1)}),(0,Q.jsx)(H,{label:`Pending`,icon:ie,value:n.pending,tone:n.pending?`text-warn`:void 0,change:Qt(i,e=>e.pending,!1),note:`in Design or not ready`}),(0,Q.jsx)(H,{label:`Failing`,icon:B,value:n.failing,tone:n.failing?`text-fail`:void 0,change:Qt(i,e=>e.failing,!1),note:`their last run`}),(0,Q.jsx)(H,{label:`Generated by ForgeQE`,icon:L,value:n.generated,change:Qt(i,e=>e.generated,!0)})]}),(0,Q.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-2`,children:[(0,Q.jsx)(J,{icon:ye,title:`Automation coverage`,divider:!1,className:s,children:(0,Q.jsx)(wt,{label:`Automation coverage, latest and its change`,figures:[{label:`Share of test cases automated`,points:i.map(e=>({x:Xt(e.day),y:Zt(e.automated,e.cases)})),format:e=>`${e}%`,delta:e=>`${e} pt${e===1?``:`s`}`,upIsGood:!0},{label:`Automated`,points:i.map(e=>({x:Xt(e.day),y:e.automated})),upIsGood:!0},{label:`Not automated`,points:i.map(e=>({x:Xt(e.day),y:e.notAutomated})),upIsGood:!1},{label:`Failing`,points:i.map(e=>({x:Xt(e.day),y:e.failing})),upIsGood:!1}]})}),(0,Q.jsx)(J,{icon:re,title:`Generated and automated, by week`,divider:!1,className:s,children:(0,Q.jsx)(Tt,{label:`Test cases generated and automated each week`,empty:`Nothing generated or automated in these weeks yet.`,series:[{name:`Generated`,className:`bg-accent-line`},{name:`Automated`,className:`bg-accent`}],items:e.weekly.map(e=>({x:Xt(e.week),values:[e.generated,e.automated]}))})}),(0,Q.jsxs)(J,{icon:N,title:`Last run of every case`,divider:!1,className:s,children:[(0,Q.jsx)(v,{label:`Passed ${n.cases-n.failing-n.neverRun}, failing ${n.failing}, not run ${n.neverRun}`,parts:[{key:`passed`,value:n.cases-n.failing-n.neverRun,className:`bg-pass`},{key:`failing`,value:n.failing,className:`bg-fail`},{key:`not-run`,value:n.neverRun,className:`bg-muted`}]}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-4 text-body-sm`,children:[(0,Q.jsx)(`a`,{href:r(`test-management`,`cases`),className:`no-underline`,children:(0,Q.jsxs)(E,{tone:`pass`,children:[`Passed `,n.cases-n.failing-n.neverRun]})}),(0,Q.jsx)(`a`,{href:r(`test-management`,`gaps`),className:`no-underline`,children:(0,Q.jsxs)(E,{tone:`fail`,children:[`Failing `,n.failing]})}),(0,Q.jsx)(`a`,{href:r(`test-management`,`gaps`),className:`no-underline`,children:(0,Q.jsxs)(E,{tone:`neutral`,children:[`Not run `,n.neverRun]})})]})]}),(0,Q.jsx)(J,{icon:Oe,title:`Automated, by suite`,divider:!1,className:s,actions:(0,Q.jsx)(`a`,{href:r(`test-management`,`gaps`),className:`text-body-sm`,children:`Find gaps`}),children:e.coverage.length?e.coverage.slice(0,8).map(e=>(0,Q.jsx)(Et,{label:e.suite,part:e.automated,whole:e.cases},e.suite)):(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No suites yet.`})})]}),(0,Q.jsx)(q,{label:`Suites`,placeholder:`Find a suite`,empty:`No suites yet: ask the Suite agent for one on Suites.`,search:e.suites.length>8,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Suite`}),(0,Q.jsx)(`th`,{scope:`col`,className:Ke,children:`Cases`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Last run`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.suites.map(e=>(0,Q.jsxs)(`tr`,{className:ze,onClick:()=>location.hash=r(`test-management`,`suites`,e.id),children:[(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(`a`,{href:r(`test-management`,`suites`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium`,children:e.name})}),(0,Q.jsx)(`td`,{className:Le,children:e.cases}),(0,Q.jsx)(`td`,{className:K,"data-sort":e.last&&Date.parse(e.last.at)||0,children:e.last?(0,Q.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2 text-body-sm`,children:[(0,Q.jsxs)(E,{tone:e.last.failed?`fail`:`pass`,children:[e.last.passed,` passed`,e.last.failed?`, ${e.last.failed} failed`:``]}),(0,Q.jsx)(`span`,{className:`text-muted`,children:U(e.last.at)})]}):(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not run`})}),(0,Q.jsxs)(`td`,{className:`${K} text-right whitespace-nowrap`,onClick:e=>e.stopPropagation(),children:[!!e.last?.failed&&(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Rerun the failed cases of ${e.name}`,"data-tip":`Rerun failed`,onClick:()=>t(e.id,`failed`),children:(0,Q.jsx)(se,{"aria-hidden":`true`})}),(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.name}`,"data-tip":`Run`,onClick:()=>t(e.id),children:(0,Q.jsx)(N,{"aria-hidden":`true`})})]})]},e.id))}),(0,Q.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-body-sm text-muted`,children:[(0,Q.jsx)(de,{size:14,"aria-hidden":`true`}),n.tests,` automated tests known, `,n.testsWithoutCase,` with no test case behind them.`]})]})}var en=e=>e&&/^https:\/\//i.test(e)?e:void 0;function tn({id:e,title:t,url:n}){let r=en(n);return(0,Q.jsxs)(`span`,{className:`flex min-w-[220px] flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t}),r?(0,Q.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-body-sm text-accent-fg`,children:e}):(0,Q.jsx)(`span`,{className:`font-mono text-body-sm text-accent-fg`,children:e})]})}var nn={azure_devops:[{key:`sprint`,label:`Sprint`,placeholder:`current, or Sprint 24`},{key:`iteration`,label:`Iteration path`,placeholder:`Shop\\Release 3`},{key:`area`,label:`Area path`,placeholder:`Shop\\Checkout`},{key:`parent`,label:`Epic or feature`,placeholder:`1234`,number:!0},{key:`ids`,label:`Work item ids`,placeholder:`101, 102`,list:`numbers`},{key:`project`,label:`Project`,placeholder:`When Settings names none`}],jira:[{key:`sprint`,label:`Sprint`,placeholder:`current, or Sprint 24`},{key:`fixVersion`,label:`Fix version`,placeholder:`2.4.0`},{key:`epic`,label:`Epic`,placeholder:`SHOP-12`},{key:`keys`,label:`Story keys`,placeholder:`SHOP-101, SHOP-102`,list:`keys`},{key:`project`,label:`Project key`,placeholder:`SHOP`}],qtest:[{key:`module`,label:`Requirements module`,placeholder:`Module id, e.g. 1203`,number:!0},{key:`ids`,label:`Requirement ids`,placeholder:`5101, 5102`,list:`numbers`}]};function rn(e,t){let n={system:e};for(let r of nn[e]){let i=(t[r.key]??``).trim();i&&(r.list===`numbers`?n[r.key]=i.split(/[\s,]+/).filter(Boolean).map(Number):r.list===`keys`?n[r.key]=i.split(/[\s,]+/).filter(Boolean).map(e=>e.toUpperCase()):r.number?n[r.key]=Number(i):n[r.key]=r.key===`project`&&e===`jira`?i.toUpperCase():i)}return n}var an=e=>Object.fromEntries(Object.entries(e??{}).filter(([e])=>e!==`system`).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]));function on({gaps:e,onRead:t}){let[n,r]=(0,X.useState)(e.live?.system??`azure_devops`),[a,l]=(0,X.useState)(an(e.live)),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(``);(0,X.useEffect)(()=>{e.live&&(r(e.live.system),l(an(e.live)))},[e.live]);let m=async()=>{d(!0),p(``);try{await Z.readStories(rn(n,a)),t()}catch(e){p(e.message)}finally{d(!1)}};return(0,Q.jsxs)(`form`,{className:c(s,`flex flex-col gap-4`),onSubmit:e=>{e.preventDefault(),m()},children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-sm`,children:[(0,Q.jsx)(`span`,{className:`text-muted`,children:`Stories in`}),(0,Q.jsxs)(i,{size:`sm`,value:n,onChange:e=>(r(e.target.value),l({})),className:`w-auto`,children:[(0,Q.jsx)(`option`,{value:`azure_devops`,children:`Azure DevOps`}),(0,Q.jsx)(`option`,{value:`jira`,children:`Jira (also Xray and Zephyr Scale)`}),(0,Q.jsx)(`option`,{value:`qtest`,children:`qTest requirements`})]})]}),nn[n].map(e=>(0,Q.jsxs)(`label`,{className:`flex min-w-[140px] flex-[1_1_140px] flex-col gap-1 text-body-sm`,children:[(0,Q.jsx)(`span`,{className:`text-muted`,children:e.label}),(0,Q.jsx)(o,{size:`sm`,value:a[e.key]??``,maxLength:e.list?2e3:200,placeholder:e.placeholder,onChange:t=>l({...a,[e.key]:t.target.value})})]},e.key)),(0,Q.jsxs)(y,{busy:u,size:`sm`,variant:`primary`,type:`submit`,disabled:u||!nn[n].some(e=>e.key!==`project`&&(a[e.key]??``).trim()),children:[(0,Q.jsx)(ue,{"aria-hidden":`true`}),u?`Reading…`:`Read`]})]}),f&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:f})]})}function sn({kind:e,gaps:t,picked:n=[],onPick:r=()=>{},onRead:i=()=>{}}){let a=(0,Q.jsx)(on,{gaps:t,onRead:i});if(!t.report)return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a,(0,Q.jsx)(_,{icon:Se,title:`No stories read yet`,children:`Say which stories to read: a sprint, an iteration, an area, an epic or the ids. ForgeQE reads each story with its test cases and acceptance criteria from the tracker, as Release readiness does, and reads them again with every sync.`})]});let o=(0,Q.jsxs)(`p`,{className:`m-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[t.report.id===`live`?`Read from the tracker${t.report.at?` ${U(t.report.at)}`:``}: ${t.report.scope}`:`From the readiness report of ${t.report.scope||t.report.id}`,` (`,t.stories,` stor`,t.stories===1?`y`:`ies`,`).`,e===`stories`&&n.length>0&&` ${n.length} picked for the Gap agent's "Cases for stories".`]}),s=new Set(t.noCase.map(e=>e.id)),l=new Set(n.filter(e=>s.has(e)));return e===`stories`?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a,o,(0,Q.jsx)(q,{label:`Stories with no test case`,placeholder:`Find a story`,empty:`Every story of the release has a test case.`,selection:{count:l.size,onClear:()=>r([])},head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-10`),children:(0,Q.jsx)(Y,{"aria-label":`Pick every story shown`,checked:t.noCase.length>0&&t.noCase.every(e=>l.has(e.id)),onCheckedChange:e=>r(e?t.noCase.map(e=>e.id).slice(0,50):[])})}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-[55%]`),children:`Story`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Type`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`State`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Area`})]}),children:t.noCase.map(e=>(0,Q.jsxs)(`tr`,{className:W,"data-state":l.has(e.id)?`selected`:void 0,children:[(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(Y,{"aria-label":`Pick ${e.id}`,checked:l.has(e.id),onCheckedChange:t=>r(t?[...l,e.id].slice(0,50):[...l].filter(t=>t!==e.id))})}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(tn,{id:e.id,title:e.title,url:e.url})}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm @2xl:table-cell`),children:e.type||`–`}),(0,Q.jsx)(`td`,{className:K,children:e.state?(0,Q.jsx)(E,{tone:`neutral`,icon:!1,children:e.state}):(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:`–`})}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm @2xl:table-cell [overflow-wrap:anywhere]`),children:e.area||`–`})]},e.id))})]}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a,o,(0,Q.jsx)(q,{label:`Acceptance criteria no test case covers`,placeholder:`Find a criterion`,empty:`Every traced acceptance criterion has a test case.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-[55%]`),children:`Criterion`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Story`})]}),children:t.criteria.map((e,t)=>(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsx)(`td`,{className:c(K,`[overflow-wrap:anywhere]`),children:e.text}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(tn,{id:e.story,title:e.storyTitle,url:e.url})})]},`${e.story}-${t}`))})]})}var cn=[{id:`stories`,label:`Stories with no case`,icon:Se},{id:`criteria`,label:`Criteria not covered`,icon:I}],ln=[{id:`not_automated`,label:`Not automated`,icon:M},{id:`pending`,label:`Pending`,icon:ie},{id:`never_run`,label:`Never run`,icon:M},{id:`failing`,label:`Failing`,icon:B,alert:!0},{id:`stale`,label:`Steps changed`,icon:A},{id:`drift`,label:`Tracker disagrees`,icon:A},{id:`no_case`,label:`Tests with no case`,icon:de}];function un({gaps:e,cases:t,tests:n,selected:r,onSelect:i,onRun:a,pickedStories:o=[],onPickStories:s=()=>{},onStoriesRead:l=()=>{}}){let[u,d]=(0,X.useState)(t.length||!n.length?`not_automated`:`no_case`),f=new Map(t.map(e=>[e.key,e])),p=new Map(e.ranked.map(e=>[e.key,e.why])),m=e.ranked.map(e=>e.key),h=new Set(m),g=u===`no_case`||u===`stories`||u===`criteria`?[]:u===`not_automated`?[...m,...e.lists.not_automated.filter(e=>!h.has(e))]:e.lists[u],_=e.stories??{stories:0,noCase:[],criteria:[]},v={stories:_.noCase.length,criteria:_.criteria.length},b=g.map(e=>f.get(e)).filter(e=>!!e),x=new Set(r),S=(e,t)=>i(t?[...r,e]:r.filter(t=>t!==e)),C=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(Ct,{label:`Gaps to show`,items:[...ln.map(t=>({id:t.id,label:t.label,n:e.counts[t.id],...t.alert?{alert:!0}:{}})),...cn.map(e=>({id:e.id,label:e.label,n:v[e.id],tip:_.report?_.report.id===`live`?`Read from the tracker: ${_.report.scope}`:`From the readiness report of ${_.report.scope||_.report.id}`:`Read the release's stories from the tracker first`}))],value:u,onChange:e=>d(e)}),u===`not_automated`&&b.length>0&&(0,Q.jsxs)(y,{size:`sm`,onClick:()=>i(b.slice(0,20).map(e=>e.key)),"data-tip":`Pick the 20 that matter most: priority, failing when run, in a pack, tagged smoke`,children:[(0,Q.jsx)(I,{"aria-hidden":`true`}),`Top 20`]})]});return(0,Q.jsx)(`div`,{className:`flex flex-col gap-6`,children:u===`stories`||u===`criteria`?(0,Q.jsxs)(Q.Fragment,{children:[C,(0,Q.jsx)(sn,{kind:u,gaps:_,picked:o,onPick:s,onRead:l})]}):u===`no_case`?(0,Q.jsx)(q,{label:`Tests with no test case`,placeholder:`Find a test`,height:Be,empty:`Every test ForgeQE knows has a test case behind it.`,tools:C,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-[55%]`),children:`Test`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Tags`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Last runs`})]}),children:e.testsWithoutCase.map(e=>{let t=n.find(t=>t.key===e);return t?(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsxs)(`td`,{className:K,children:[t.uid?(0,Q.jsx)(`a`,{href:At(t.uid),className:`font-medium [overflow-wrap:anywhere]`,children:t.name}):(0,Q.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t.name}),t.file&&(0,Q.jsx)(`span`,{className:`block font-mono text-body-sm text-muted [overflow-wrap:anywhere]`,children:t.file}),t.flaky&&(0,Q.jsx)(E,{tone:`warn`,className:`mt-1`,children:`Flaky`})]}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(St,{tags:t.tags})}),(0,Q.jsx)(`td`,{className:K,"data-sort":t.runs.length?t.runs.filter(e=>e===`p`).length/t.runs.length:-1,children:(0,Q.jsx)(xt,{runs:t.runs})})]},e):null})}):(0,Q.jsx)(q,{label:ln.find(e=>e.id===u).label,placeholder:`Find a case`,resetKey:u,height:Be,selection:{count:r.length,onClear:()=>i([])},empty:`No gap of this kind.`,tools:C,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-10`),children:(0,Q.jsx)(Y,{"aria-label":`Select every case shown`,checked:b.length>0&&b.every(e=>x.has(e.key)),onCheckedChange:e=>i(e?[...new Set([...r,...b.map(e=>e.key)])]:r.filter(e=>!b.some(t=>t.key===e)))})}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Test case`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Priority`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @xl:table-cell`),children:u===`not_automated`?`Why it matters`:`Automation`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Last run`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:b.map(e=>(0,Q.jsxs)(`tr`,{className:W,"data-state":x.has(e.key)?`selected`:void 0,children:[(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(Y,{"aria-label":`Select ${e.id}`,checked:x.has(e.key),onCheckedChange:t=>S(e.key,t)})}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsxs)(`a`,{href:kt(e.key),className:`flex min-w-[160px] flex-col gap-1 text-ink no-underline @xl:min-w-[220px]`,children:[(0,Q.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-body-sm text-muted`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.id}),e.suite&&(0,Q.jsx)(`span`,{children:e.suite}),(0,Q.jsx)(St,{tags:e.tags,max:2})]}),(0,Q.jsx)(`span`,{className:`flex flex-wrap items-center gap-1 @xl:hidden`,children:u===`not_automated`?(p.get(e.key)??[]).map(e=>(0,Q.jsx)(E,{tone:`running`,icon:!1,children:e},e)):(0,Q.jsx)(yt,{a:e.automation})})]})}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm @2xl:table-cell`),children:e.priority?`P${e.priority}`:`–`}),(0,Q.jsx)(`td`,{className:c(K,`hidden @xl:table-cell`),children:u===`not_automated`?(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(p.get(e.key)??[]).map(e=>(0,Q.jsx)(E,{tone:`running`,icon:!1,children:e},e)),!(p.get(e.key)??[]).length&&(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:`–`})]}):(0,Q.jsx)(yt,{a:e.automation})}),(0,Q.jsx)(`td`,{className:c(K,`hidden @2xl:table-cell`),children:(0,Q.jsx)(bt,{o:e.lastRun.outcome})}),(0,Q.jsx)(`td`,{className:c(K,`text-right`),children:(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.id}`,"data-tip":`Run`,onClick:()=>a([e.key]),children:(0,Q.jsx)(N,{"aria-hidden":`true`})})})]},e.key))})})}var dn=e=>e.from===`report`?`From the run's own report`:`From each case's latest result since the run started (its report is not written yet)`,fn={system:`system`,plan:`plan`,suite:`suite`,priority:`priority`,state:`state`,automation:`automation`,tag:`tag`,last_run:`last run`,origin:`origin`,stale:`steps changed`,in_pack:`in pack`};function pn({suites:e,onRun:t}){return(0,Q.jsx)(q,{label:`Suites`,placeholder:`Find a suite`,height:Be,empty:e.length?`Nothing matches.`:`No suites yet. Tell the Suite agent what a suite is for, such as “regression for the payments suite, P1 and anything failing lately”: it picks the cases from your plans, tags and runs.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-[40%]`),children:`Suite`}),(0,Q.jsx)(`th`,{scope:`col`,className:Ke,children:`Cases`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(Ke,`hidden @xl:table-cell`),children:`Automated`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Last run`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.map(e=>(0,Q.jsxs)(`tr`,{className:ze,onClick:()=>location.hash=r(`test-management`,`suites`,e.id),children:[(0,Q.jsxs)(`td`,{className:c(K,`max-w-0`),children:[(0,Q.jsxs)(`a`,{href:r(`test-management`,`suites`,e.id),onClick:e=>e.stopPropagation(),className:`flex items-center gap-2 font-medium`,children:[e.built===`agent`?(0,Q.jsx)(L,{size:14,"aria-hidden":`true`,className:`flex-none`}):(0,Q.jsx)(Oe,{size:14,"aria-hidden":`true`,className:`flex-none`}),(0,Q.jsx)(vt,{text:e.name})]}),e.description&&(0,Q.jsx)(vt,{text:e.description,className:`mt-1 text-body-sm text-muted`})]}),(0,Q.jsx)(`td`,{className:Le,children:e.cases}),(0,Q.jsxs)(`td`,{className:c(Le,`hidden @xl:table-cell`),children:[e.cases?Math.round(e.automated/e.cases*100):0,`%`]}),(0,Q.jsx)(`td`,{className:K,"data-sort":e.last&&Date.parse(e.last.at)||0,children:e.last?(0,Q.jsxs)(`span`,{className:`flex flex-col items-start gap-1 text-body-sm`,"data-tip":dn(e.last),children:[(0,Q.jsxs)(E,{tone:e.last.failed?`fail`:`pass`,children:[e.last.passed,` passed`,e.last.failed?`, ${e.last.failed} failed`:``]}),(0,Q.jsx)(`span`,{className:`text-muted`,children:U(e.last.at)})]}):(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not run`})}),(0,Q.jsxs)(`td`,{className:c(K,`text-right whitespace-nowrap`),onClick:e=>e.stopPropagation(),children:[!!e.last?.failed&&(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Rerun the failed cases of ${e.name}`,"data-tip":`Rerun failed`,onClick:()=>t(e.id,`failed`),children:(0,Q.jsx)(se,{"aria-hidden":`true`})}),(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.name}`,"data-tip":`Run`,onClick:()=>t(e.id),children:(0,Q.jsx)(N,{"aria-hidden":`true`})})]})]},e.id))})}function mn({id:e,onRun:t,onDeleted:n}){let[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(!1);(0,X.useEffect)(()=>{a(null),Z.suite(e).then(e=>{a(e),s(``)},e=>s(e.message))},[e]);let p=(0,Q.jsx)(te,{to:{href:r(`test-management`,`suites`),label:`All suites`}});if(o)return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p,(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:o})]});if(!i)return(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`});let m=i.suite,h=i.members.filter(e=>e.case.lastRun.outcome===`failed`||e.case.lastRun.outcome===`blocked`).length;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[p,(0,Q.jsxs)(`header`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1`,children:[(0,Q.jsx)(Ye,{icon:Oe,title:m.name}),m.description&&(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:m.description}),m.tracker&&(0,Q.jsxs)(`span`,{className:`text-body-sm text-ink-2`,children:[`Kept as`,` `,ut(m.tracker)?(0,Q.jsx)(`a`,{href:ut(m.tracker),target:`_blank`,rel:`noreferrer noopener`,children:dt(m.tracker)}):dt(m.tracker)]})]}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(m.tracker||i.targets.length>0)&&(0,Q.jsxs)(y,{onClick:()=>f(!0),"data-tip":m.tracker?`Keep it in step with its tracker`:`Keep it in a tracker`,children:[(0,Q.jsx)(R,{"aria-hidden":`true`}),m.tracker?`Update`:`Keep`]}),(0,Q.jsxs)(y,{variant:`danger`,onClick:()=>u(!0),children:[(0,Q.jsx)(k,{"aria-hidden":`true`}),`Delete`]}),h>0&&(0,Q.jsxs)(y,{onClick:()=>t(m.id,`failed`),children:[(0,Q.jsx)(se,{"aria-hidden":`true`}),`Rerun `,h,` failed`]}),(0,Q.jsxs)(y,{variant:`primary`,onClick:()=>t(m.id),children:[(0,Q.jsx)(N,{"aria-hidden":`true`}),`Run`]})]})]}),(0,Q.jsxs)(V,{label:`The suite`,children:[(0,Q.jsx)(H,{compact:!0,label:`Cases`,value:m.cases,note:`${m.automated} automated`}),(0,Q.jsx)(H,{compact:!0,label:`Last run`,value:m.last?`${m.last.passed} passed`:`Not run`,tone:m.last?.failed?`text-fail`:void 0,note:m.last?`${m.last.failed} failed · ${U(m.last.at)}${m.last.from===`report`?``:` · so far`}`:void 0}),(0,Q.jsx)(H,{compact:!0,label:`Runs on`,value:m.env??`Active`,note:m.runs.length?`${m.runs.length} run${m.runs.length===1?``:`s`}`:`never run`}),(0,Q.jsx)(H,{compact:!0,label:`Built`,value:m.built===`agent`?`Suite agent`:m.built===`rules`?`Rules`:`Picked`,note:`updated ${U(m.updatedAt)}`})]}),m.groupsCount.length>0&&(0,Q.jsx)(J,{level:3,icon:Ee,title:`Why these cases`,className:c(`surface rounded-lg bg-bg p-6 shadow-sm`,`text-body-sm`),children:(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:m.groupsCount.map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`text-muted`,children:m.groups[t]?.rules.map(e=>`${fn[e.field]} ${e.op===`is`?`is`:`is not`} ${e.value}`).join(` and `)}),(0,Q.jsx)(`span`,{className:`ml-auto tabular-nums`,children:e.cases})]},e.label))})}),(0,Q.jsx)(q,{label:`Cases`,placeholder:`Find a case`,empty:`No case meets the suite's rules now.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-[45%]`),children:`Test case`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @xl:table-cell`),children:`Why it is in`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Automation`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Last run`})]}),children:i.members.map(e=>(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsx)(`td`,{className:c(K,`max-w-0`),children:(0,Q.jsxs)(`a`,{href:kt(e.case.key),className:`flex min-w-0 flex-col gap-1 text-ink no-underline`,children:[(0,Q.jsx)(vt,{text:e.case.title,className:`font-medium`}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-body-sm text-muted`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.case.id}),(0,Q.jsx)(St,{tags:e.case.tags})]})]})}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm text-ink-2 @xl:table-cell`),children:e.group}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(yt,{a:e.case.automation})}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(bt,{o:e.case.lastRun.outcome})})]},e.case.key))}),(0,Q.jsx)(ht,{open:d,suite:m,targets:i.targets,onClose:()=>f(!1),onDone:()=>void Z.suite(e).then(a,()=>{})}),(0,Q.jsx)(Ie,{open:l,onClose:()=>u(!1),title:`Delete ${m.name}?`,description:`The suite goes from .forgeqe/testmgmt/suites.json. Its cases and their runs stay.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{onClick:()=>u(!1),children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),`Cancel`]}),(0,Q.jsxs)(y,{variant:`destructive`,onClick:()=>void Z.deleteSuite(m.id).then(()=>{u(!1),n()},e=>s(e.message)),children:[(0,Q.jsx)(k,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,Q.jsx)(`p`,{className:`m-0 pt-4 text-body-sm text-ink-2`,children:`Runs already made are kept in Runs.`})})]})}function hn({open:e,onSaved:t}){let[n,r]=(0,X.useState)([]),[i,o]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(``),p=n.findLast(e=>`built`in e)?.built,m=n.filter(e=>`you`in e).map(e=>e.you).join(`. `),h=async t=>{let n=t.trim();if(n){u(!0),f(``),r(e=>[...e,{you:n}]),o(``);try{let t=await Z.buildSuite(m?`${m}. ${n}`:n,e?.id);r(e=>[...e,{built:t}])}catch(e){f(e.message)}finally{u(!1)}}},g=async n=>{if(p){u(!0);try{let{suite:i}=await Z.saveSuite({...n&&e?{id:e.id}:{},name:n&&e?e.name:p.name,description:p.summary,groups:p.groups,exclude:p.exclude,built:`agent`});r([]),t(i)}catch(e){f(e.message)}finally{u(!1)}}};return(0,Q.jsxs)(it,{title:`Suite agent`,about:`Builds and changes suites from your plans, tags and runs.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(e?[`Leave out cases that are not automated`,`Add everything failing lately`,`Only priority 1 and 2`]:[`Smoke suite`,`P1 cases that failed lately`,`Everything not automated in one suite`]).map(e=>(0,Q.jsxs)(y,{size:`sm`,disabled:l,onClick:()=>void h(e),children:[(0,Q.jsx)(L,{"aria-hidden":`true`}),e]},e))}),(0,Q.jsxs)(`form`,{className:`flex items-end gap-2`,onSubmit:e=>{e.preventDefault(),h(i)},children:[(0,Q.jsx)(`label`,{className:`sr-only`,htmlFor:`tm-suite-words`,children:`Tell the Suite agent what the suite is for`}),(0,Q.jsx)(a,{id:`tm-suite-words`,rows:2,maxLength:1e3,value:i,placeholder:e?`Change ${e.name}, or ask about it`:`Describe the suite you need, e.g. regression for Payments under 30 minutes`,onChange:e=>o(e.target.value),className:`min-h-11 flex-1 resize-none`}),(0,Q.jsx)(y,{size:`icon`,variant:`primary`,type:`submit`,disabled:l||!i.trim(),"aria-label":`Send`,"data-tip":`Send`,children:(0,Q.jsx)(ve,{"aria-hidden":`true`})})]})]}),children:[(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,Q.jsx)(S,{state:l?`thinking`:`working`,px:96,label:l?`Building the suite`:`Ready`}),(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:l?`Building the suite…`:e?`Looking at ${e.name}.`:`Ready. Say what the suite is for.`})]}),n.map((e,t)=>`you`in e?(0,Q.jsx)(`p`,{className:`m-0 text-center text-body-lg leading-relaxed text-ink-2`,children:e.you},t):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(`p`,{className:`m-0 text-center text-headline-sm`,children:[e.built.name,`: `,e.built.cases,` case`,e.built.cases===1?``:`s`,`, `,e.built.automated,` automated.`]}),e.built.summary&&(0,Q.jsx)(`p`,{className:`m-0 text-center text-body-sm text-ink-2`,children:e.built.summary}),e.built.note&&(0,Q.jsx)(`p`,{className:`m-0 text-center text-body-sm text-muted`,children:e.built.note}),(0,Q.jsxs)(`div`,{className:c(s,`flex flex-col gap-2 text-body-sm`),children:[e.built.perGroup.map(e=>(0,Q.jsxs)(`span`,{className:`flex items-baseline gap-2`,"data-tip":e.why,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`ml-auto tabular-nums`,children:e.cases})]},e.label)),e.built.exclude.length>0&&(0,Q.jsxs)(`span`,{className:`text-muted`,children:[`Leaves out: `,e.built.exclude.map(e=>`${fn[e.field]} ${e.op===`is`?`is`:`is not`} ${e.value}`).join(`, `)]})]}),e.built.question&&t===n.length-1&&(0,Q.jsxs)(`div`,{className:c(`surface rounded-lg bg-bg p-6 shadow-sm`,`flex flex-col gap-2 text-body-sm`),children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:e.built.question.text}),e.built.question.options.map(e=>(0,Q.jsx)(y,{size:`sm`,disabled:l,onClick:()=>void h(e),className:`justify-start`,children:e},e))]}),e.built.sample.length>0&&(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,children:e.built.sample.slice(0,5).map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`flex-none font-mono text-accent-fg`,children:e.case.id}),(0,Q.jsx)(vt,{text:e.case.title,className:`min-w-0 text-ink-2`})]},e.case.key))})]},t)),d&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:d}),p&&(0,Q.jsxs)(`span`,{className:`flex flex-wrap justify-center gap-2`,children:[e&&(0,Q.jsxs)(y,{disabled:l,onClick:()=>void g(!0),children:[(0,Q.jsx)(Ae,{"aria-hidden":`true`}),`Update `,e.name]}),(0,Q.jsxs)(y,{variant:`primary`,disabled:l,onClick:()=>void g(!1),"data-tip":e?`Save as a new suite`:`Save the suite`,children:[(0,Q.jsx)(Ae,{"aria-hidden":`true`}),e?`Save new`:`Save`]})]})]})}var gn=[{id:`off`,label:`Off`,icon:M},{id:`hourly`,label:`Every hour`,icon:ue},{id:`daily`,label:`Daily`,icon:F}];function _n(e){return!e||e.every===`off`?`Sync: off`:e.every===`hourly`?`Sync: hourly`:e.every===`daily`?`Sync: daily ${e.at}`:`Sync: custom`}function vn({disabled:e}){let[t,n]=(0,X.useState)(!1),[r,i]=(0,X.useState)(null);return(0,X.useEffect)(()=>{Z.schedule().then(e=>i(e.schedule),()=>{})},[]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y,{size:`icon`,"aria-label":`Schedule`,disabled:e,onClick:()=>n(!0),"data-tip":`Schedule: ${_n(r)}${r?.nextAt?`, next ${Qe(r.nextAt)}`:``}. Set when the plans are synced`,children:(0,Q.jsx)(F,{"aria-hidden":`true`})}),(0,Q.jsx)(xn,{open:t,onClose:()=>n(!1),now:r,onSaved:i})]})}var yn=(e,t)=>!!e&&!!t&&e===t.digest&&t.steps.length>0,bn=(e,t,n)=>e!==`off`&&t&&n&&n.steps.length>0?n.digest:void 0;function xn({open:e,onClose:t,now:n,onSaved:r}){let[i,a]=(0,X.useState)(`off`),[s,l]=(0,X.useState)(`06:00`),[u,d]=(0,X.useState)(``),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(`loading`),[v,b]=(0,X.useState)(!1),S=n&&n.every!==`off`&&n.every!==`custom`?n.discover:void 0;(0,X.useEffect)(()=>{e&&(d(``),b(!1),h(null),_(`loading`),Z.discoveryPlan().then(e=>{h(e),_(`ready`),b(yn(S,e))},()=>_(`failed`)),a(n&&n.every!==`custom`?n.every:`off`),n?.every===`daily`&&l(n.at))},[e,n]);let w=async()=>{p(!0);try{let e=bn(i,v,m),n=e?{discover:e}:{};r((await Z.setSchedule(i===`daily`?{every:i,at:s,...n}:i===`hourly`?{every:i,...n}:{every:i})).schedule),t()}catch(e){d(e.message)}finally{p(!1)}};return(0,Q.jsx)(Ie,{open:e,onClose:t,title:`Sync on a schedule`,description:`ForgeQE reads every case of the connected test plans again, as Sync does, and the stories Gaps read, in the jobs service (forgeqe testmgmt sync). It can also discover the tests first. It runs while this computer is on.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(y,{onClick:t,children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),`Cancel`]}),(0,Q.jsxs)(y,{variant:`primary`,disabled:f||g===`loading`||i===`daily`&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(s),onClick:()=>void w(),children:[(0,Q.jsx)(Ae,{"aria-hidden":`true`}),`Save`]})]}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-body-sm`,children:[(0,Q.jsx)(`div`,{role:`group`,"aria-label":`When to sync`,className:`flex flex-wrap gap-2`,children:(0,Q.jsx)(C,{items:gn.map(e=>({id:e.id,label:e.label,icon:e.icon})),value:i,onChange:a})}),i===`daily`&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Time (this computer's clock)`,(0,Q.jsx)(o,{type:`time`,step:60,value:s,onChange:e=>l(e.target.value)})]}),i!==`off`&&m&&m.steps.length>0&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(Y,{checked:v,onCheckedChange:e=>b(e===!0),"aria-label":`Also discover the tests`}),(0,Q.jsx)(`span`,{children:`Also discover the tests first. This runs the repository's code with these commands, with no secret of ForgeQE's. If the test projects change, the schedule stops discovering until you confirm again.`})]}),!!S&&S!==m.digest&&!v&&(0,Q.jsx)(`p`,{className:`m-0 text-warn`,children:`The test projects changed since discovery was agreed to: tick the box to agree to these commands, or the schedule only syncs.`}),v&&(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:m.steps.map((e,t)=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`code`,{className:`font-mono text-body-sm font-medium text-ink [overflow-wrap:anywhere]`,children:e.command})},t))})]}),i!==`off`&&g===`loading`&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Reading what discovery would run…`}),i!==`off`&&g===`failed`&&!!S&&(0,Q.jsx)(`p`,{role:`alert`,className:`m-0 text-warn`,children:`What discovery would run could not be read, so saving here turns scheduled discovery off. Close and open this again to try once more.`}),n?.every===`custom`&&(0,Q.jsxs)(`p`,{className:`m-0 text-warn`,children:[`The sync job was changed outside this page (`,n.text,`). Saving here replaces it.`]}),n?.enabled===!1&&(0,Q.jsx)(`p`,{className:`m-0 text-warn`,children:`The sync job is disabled in the jobs service.`}),n?.last&&(0,Q.jsxs)(`p`,{className:`m-0 text-ink-2`,children:[`Last scheduled sync `,Qe(n.last.at),`: `,n.last.status.replace(`_`,` `),`.`]}),u&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:u})]})})}var Sn={forgeqe:{label:`ForgeQE`,icon:L},script:{label:`Tests`,icon:de}},Cn=e=>Sn[e]??{label:e===`azure_devops`?`Azure DevOps`:e===`jira`?`Jira`:e,icon:oe},wn=e=>e!==`forgeqe`&&e!==`script`,Tn=[];function En({tags:e,cases:t=[],onChanged:n}){let[r,i]=(0,X.useState)(`all`),[a,o]=(0,X.useState)(null),s=e=>e.system===`azure_devops`||e.system===`jira`,l=e=>t.filter(t=>t.ownTags.includes(e)&&!t.trackerTags.includes(e)&&s(t)).map(e=>e.key),u=e=>t.filter(t=>t.ownTags.includes(e)&&t.trackerTags.includes(e)&&s(t)).map(e=>e.key),d=e.tags.filter(e=>r===`all`||(r===`out`?e.outOfStep>0:r===`tracker`?e.from.some(wn):e.from.includes(r))),f=(e,t)=>t?`${Math.round(e/t*100)}%`:`–`;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Q.jsxs)(`p`,{className:`m-0 flex flex-wrap gap-x-6 gap-y-1 text-body-sm text-muted`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`b`,{className:`text-ink tabular-nums`,children:e.tags.length}),` tag`,e.tags.length===1?``:`s`,` in use`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`b`,{className:`text-ink tabular-nums`,children:f(e.casesTagged,e.cases)}),` of test cases tagged (`,e.casesTagged,` of `,e.cases,`)`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`b`,{className:`text-ink tabular-nums`,children:f(e.testsTagged,e.tests)}),` of tests tagged (`,e.testsTagged,` of `,e.tests,`)`]}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`b`,{className:c(`tabular-nums`,e.tags.some(e=>e.outOfStep)?`text-warn`:`text-ink`),children:e.tags.filter(e=>e.outOfStep).length}),` out of step (a case's tag its test lacks)`]})]}),(0,Q.jsx)(q,{label:`Tags`,placeholder:`Find a tag`,height:Be,resetKey:r,empty:e.tags.length?`Nothing matches.`:`No tags yet: tag cases in Test cases, or in their system.`,tools:(0,Q.jsx)(Ct,{label:`Tags to show`,items:[{id:`all`,label:`All tags`,n:e.tags.length},{id:`tracker`,label:`From their systems`,n:e.tags.filter(e=>e.from.some(wn)).length},{id:`script`,label:`From tests`,n:e.tags.filter(e=>e.from.includes(`script`)).length},{id:`forgeqe`,label:`ForgeQE's`,n:e.tags.filter(e=>e.from.includes(`forgeqe`)).length},{id:`out`,label:`Out of step`,n:e.tags.filter(e=>e.outOfStep).length,alert:!0}],value:r,onChange:i}),head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-[28%]`),children:`Tag`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Comes from`}),(0,Q.jsx)(`th`,{scope:`col`,className:Ke,children:`Test cases`}),(0,Q.jsx)(`th`,{scope:`col`,className:Ke,children:`Tests`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @xl:table-cell`),children:`Out of step`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`hidden @2xl:table-cell`),children:`Used by suites`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:d.map(e=>(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsxs)(E,{tone:`neutral`,icon:!1,children:[(0,Q.jsx)(je,{size:12,"aria-hidden":`true`}),e.name]})}),(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.from.map(e=>{let t=Cn(e);return(0,Q.jsxs)(E,{tone:`neutral`,icon:!1,children:[(0,Q.jsx)(t.icon,{size:12,"aria-hidden":`true`}),t.label]},e)})})}),(0,Q.jsx)(`td`,{className:Le,children:e.cases}),(0,Q.jsx)(`td`,{className:Le,children:e.tests}),(0,Q.jsx)(`td`,{className:c(K,`hidden @xl:table-cell`),"data-sort":e.outOfStep||0,children:e.outOfStep?(0,Q.jsx)(E,{tone:`warn`,children:e.outOfStep}):(0,Q.jsx)(`span`,{className:`text-body-sm text-muted`,children:`–`})}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm text-ink-2 @2xl:table-cell`),children:e.suites.join(`, `)||`–`}),(0,Q.jsxs)(`td`,{className:c(K,`text-right`),children:[l(e.name).length>0&&(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Write the tag ${e.name} to the trackers of ${l(e.name).length} cases`,"data-tip":`Write to the trackers of ${l(e.name).length} cases`,onClick:()=>o({kind:`tags`,keys:l(e.name)}),children:(0,Q.jsx)(R,{"aria-hidden":`true`})}),u(e.name).length>0&&(0,Q.jsx)(y,{size:`icon-sm`,variant:`icon`,"aria-label":`Take the tag ${e.name} off in the trackers of ${u(e.name).length} cases`,"data-tip":`Take off in the trackers of ${u(e.name).length} cases`,onClick:()=>o({kind:`untag`,keys:u(e.name),tags:[e.name]}),children:(0,Q.jsx)(De,{"aria-hidden":`true`})})]})]},e.name))}),(0,Q.jsx)(mt,{kind:a?.kind??null,keys:a?.keys??Tn,tags:a?.tags,onClose:()=>o(null),onDone:e=>n?.(e)})]})}function Dn({uid:e,tab:t,cases:n,onChanged:i}){let[a,o]=(0,X.useState)(null),[s,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(``),[m,h]=(0,X.useState)(``),g=(0,X.useCallback)(()=>Z.test(e).then(e=>{o(e),l(``)},e=>l(e.message)),[e]);(0,X.useEffect)(()=>{o(null),g()},[g]);let _=(0,Q.jsx)(te,{to:{href:r(`test-management`,`tests`),label:`Automated tests`}});if(s)return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[_,(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:s})]});if(!a)return(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`});let v=a.test,b=[...a.cases].sort((e,t)=>Number(t.lastRun.outcome===`failed`)-Number(e.lastRun.outcome===`failed`)),S=v.nativeId&&!(v.file&&v.nativeId.startsWith(v.file))?v.nativeId:void 0,C=!!v.framework&&v.framework!==`code`,w=C?It[v.framework]:``,T=e=>{h(``),p(e),i(e),g()},ee=async(t,n)=>{try{await Z.link([{case:t,test:e,action:`unlink`}]),T(`Unlinked ${e} from ${n}. It is not linked again by itself.`)}catch(e){h(e.message)}},ne=[{id:`code`,label:`Code`},{id:`cases`,label:`Test cases`,n:b.length}],D=ne.find(e=>e.id===t)?.id??`code`,O=encodeURIComponent(e);return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[_,(0,Q.jsxs)(`header`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_420px] flex-col gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-body-sm text-muted [overflow-wrap:anywhere]`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-accent-fg`,children:v.uid}),C&&` · ${w}${v.framework===`gherkin`?`, ${v.runner??`no runner found`}`:``}`,v.file&&(0,Q.jsxs)(Q.Fragment,{children:[` · `,(0,Q.jsxs)(`span`,{className:`font-mono`,children:[v.file,v.line?`:${v.line}`:``]})]})]}),(0,Q.jsx)(Ye,{icon:ae,title:v.name}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-body-sm`,children:[v.last?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(On,{status:v.last.status}),(0,Q.jsx)(`span`,{className:`text-muted`,children:U(v.last.at)})]}):(0,Q.jsx)(bt,{o:`not_run`}),v.runs.length>0&&(0,Q.jsx)(xt,{runs:v.runs}),v.flaky&&(0,Q.jsx)(E,{tone:`warn`,children:`Flaky`}),v.quarantined&&(0,Q.jsx)(E,{tone:`neutral`,children:`Quarantined`}),v.tags.length>0&&(0,Q.jsx)(St,{tags:v.tags,max:4}),(0,Q.jsxs)(`span`,{className:`text-muted [overflow-wrap:anywhere]`,children:[`· `,nt[v.via??`runs`],S&&(0,Q.jsxs)(Q.Fragment,{children:[` · Framework id `,(0,Q.jsx)(`span`,{className:`font-mono text-ink-2`,children:S})]})]})]})]}),(0,Q.jsx)(`span`,{className:`flex flex-wrap gap-2`,children:(0,Q.jsxs)(y,{onClick:()=>d(!0),disabled:!n.length,"data-tip":n.length?`Link to a test case`:`The project has no test case to link to yet`,children:[(0,Q.jsx)(z,{"aria-hidden":`true`}),`Link`]})})]}),f&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:f}),m&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:m}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Fe,{prefix:`ttab`,tabs:ne,current:D,onPick:e=>location.hash=e===`code`?r(`test-management`,`tests`,O):r(`test-management`,`tests`,O,e),label:`Test`}),(0,Q.jsxs)(`div`,{role:`tabpanel`,id:`ttab-panel-${D}`,"aria-labelledby":`ttab-${D}`,className:`flex min-w-0 flex-col gap-4 text-body-sm`,children:[D===`code`&&(a.source?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`pre`,{tabIndex:0,role:`region`,"aria-label":`Code of ${v.name}`,className:c(`overflow-auto rounded-base bg-surface-muted p-4 font-mono text-body-sm leading-relaxed whitespace-pre-wrap text-ink-2 [overflow-wrap:anywhere]`,`m-0 max-h-[640px] whitespace-pre focus-visible:outline-offset-[-2px]`),children:a.source.lines.map((e,t)=>{let n=a.source.from+t;return(0,Q.jsxs)(`span`,{className:c(`flex`,n===v.line&&`bg-accent-soft`),children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`w-12 flex-none pr-4 text-right text-muted tabular-nums select-none`,children:n}),(0,Q.jsx)(`span`,{className:`pr-4 whitespace-pre`,children:e})]},n)})}),a.source.more&&(0,Q.jsxs)(`span`,{className:`text-muted`,children:[`Lines `,a.source.from,`–`,a.source.from+a.source.lines.length-1,` of `,a.source.total,`.`]})]}):(0,Q.jsx)(`p`,{className:`m-0 text-muted`,children:v.file?`Its file could not be read from the repository.`:`Known from runs only: no file is known for it.`})),D===`cases`&&(0,Q.jsx)(q,{label:`Linked test cases`,search:b.length>10,columns:!1,empty:`Linked to no test case yet. Link it to the case it checks, so its runs count for that case.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`Test case`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Linked`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`Last run`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:b.map(e=>(0,Q.jsx)(kn,{c:e,onUnlink:()=>void ee(e.key,e.id)},e.key))})]})]}),(0,Q.jsx)(Bt,{open:u,title:`Link to a test case`,description:`Pick the test case ${v.name} checks. It is kept in .forgeqe/testmgmt/links.json, shared with the team.`,items:n.filter(e=>!v.cases.includes(e.key)).map(e=>({id:e.key,label:e.title,sub:e.id})),onClose:()=>d(!1),onPick:async t=>{await Z.link([{case:t,test:e,action:`link`}]),d(!1),T(`Linked ${e} to ${n.find(e=>e.key===t)?.id??t}.`)}})]})}function On({status:e}){return e===`skipped`?(0,Q.jsx)(E,{tone:`neutral`,children:`Skipped`}):(0,Q.jsx)(bt,{o:e})}function kn({c:e,onUnlink:t}){let[n,r]=(0,X.useState)(!1),i=kt(e.key);return(0,Q.jsxs)(`tr`,{className:ze,onClick:()=>location.href=i,children:[(0,Q.jsx)(`td`,{className:We,children:(0,Q.jsxs)(`a`,{href:i,className:`no-underline`,onClick:e=>e.stopPropagation(),children:[(0,Q.jsx)(`span`,{className:Ge,"data-tip":e.title,children:e.title}),(0,Q.jsx)(`span`,{className:c(Re,`font-mono`),children:e.id})]})}),(0,Q.jsx)(`td`,{className:c(K,`hidden text-body-sm whitespace-nowrap text-ink-2 @2xl:table-cell`),children:e.how===`mapping`?`By the plan's mapping`:`By hand`}),(0,Q.jsx)(`td`,{className:c(K,`whitespace-nowrap`),children:(0,Q.jsx)(bt,{o:e.lastRun.outcome})}),(0,Q.jsx)(`td`,{className:Le,onClick:e=>e.stopPropagation(),children:e.how!==`mapping`&&(0,Q.jsxs)(`span`,{className:`relative inline-block`,children:[(0,Q.jsx)(y,{variant:`icon`,size:`icon-sm`,"aria-label":`More for ${e.id}`,"data-tip":`More for ${e.id}`,"aria-haspopup":`menu`,"aria-expanded":n,onClick:()=>r(!n),children:(0,Q.jsx)(P,{"aria-hidden":`true`})}),(0,Q.jsx)(f,{open:n,onClose:()=>r(!1),label:`More for ${e.id}`,align:`end`,className:`w-[200px] text-left`,children:(0,Q.jsx)(u,{onClick:()=>{r(!1),t()},children:(0,Q.jsxs)(`span`,{className:`text-fail`,children:[`Unlink `,e.id]})})})]})})]})}var An=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],jn=e=>An.some(t=>t.id===e),Mn=e=>e&&ne(e)===`web`?e:void 0,Nn=(e,t)=>`${e} ${t}${e===1?``:`s`}`,Pn=e=>`${e.kind}:${e.id}`;function Fn(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${Nn((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function In(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function Ln(){let[e,t]=(0,X.useState)(An.map(e=>e.id)),[n,r]=(0,X.useState)(``);return(0,X.useEffect)(()=>{m.settings().then(e=>{let n=e.config.sources??{},r=An.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:An.filter(t=>e.includes(t.id)),error:n}}function Rn({view:e,onApplied:t,onError:n}){let[r,i]=(0,X.useState)([]),[a,o]=(0,X.useState)(null),[s,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(null),f=e.story.id,p=e.proposals.filter(e=>r.includes(Pn(e))),m=async()=>{let t=p.map(e=>In(e,f));l(!0);try{let r=await h.preview(e.system,f,t);o({lines:r.lines,changes:t}),n(``)}catch(e){n(e.message)}finally{l(!1)}},g=async()=>{if(a){l(!0);try{let r=await h.apply(e.system,f,a.changes);d({applied:r.applied,failed:r.failed}),o(null),i([]),n(``),t()}catch(e){n(e.message)}finally{l(!1)}}},_=Mn(e.story.url);return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Q.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-headline-sm [overflow-wrap:anywhere]`,children:[_?(0,Q.jsxs)(`a`,{href:_,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[f,(0,Q.jsx)(_e,{size:14,"aria-hidden":`true`})]}):(0,Q.jsx)(`span`,{children:f}),e.story.title&&(0,Q.jsx)(`span`,{className:`font-normal text-ink-2`,children:e.story.title})]}),e.changed&&(0,Q.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,"data-tip":new Date(e.changed.when).toLocaleString(),children:[`The story's `,e.changed.field,` changed `,U(e.changed.when),`.`]})]}),(0,Q.jsx)(J,{id:`cases`,icon:O,title:`Linked cases`,children:(0,Q.jsx)(q,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Case`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Title`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`text-right`),children:`Steps`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`State`})]}),children:e.cases.map(e=>{let t=Mn(e.url);return(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsx)(`td`,{className:c(K,`whitespace-nowrap`),children:t?(0,Q.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[e.id,(0,Q.jsx)(_e,{size:12,"aria-hidden":`true`})]}):e.id}),(0,Q.jsx)(`td`,{className:c(K,`[overflow-wrap:anywhere]`),children:e.title}),(0,Q.jsx)(`td`,{className:c(K,`text-right tabular-nums`),children:e.steps}),(0,Q.jsx)(`td`,{className:c(K,e.stale?`text-warn`:`text-muted`),"data-sort":e.changed&&Date.parse(e.changed)||0,children:e.stale?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Q.jsx)(A,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):e.changed?(0,Q.jsxs)(`span`,{"data-tip":new Date(e.changed).toLocaleString(),children:[`changed `,U(e.changed)]}):`–`})]},e.id)})})}),(0,Q.jsx)(J,{id:`criteria`,icon:I,title:`Acceptance criteria`,children:(0,Q.jsx)(q,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Criterion`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Cases`})]}),children:e.criteria.map((e,t)=>(0,Q.jsxs)(`tr`,{className:W,children:[(0,Q.jsx)(`td`,{className:c(K,`[overflow-wrap:anywhere]`),children:e.text}),(0,Q.jsx)(`td`,{className:c(K,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,Q.jsxs)(J,{id:`proposals`,icon:ge,title:`Proposed changes`,children:[(0,Q.jsx)(q,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,selection:{count:p.length,onClear:()=>i([]),actions:(0,Q.jsxs)(y,{size:`sm`,variant:`primary`,disabled:s||!p.length||!!a,"data-tip":`Review ${Nn(p.length,`change`)}`,onClick:()=>void m(),children:[(0,Q.jsx)(xe,{"aria-hidden":`true`}),`Review`]})},head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(G,`w-10`),children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Change`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`Existing case`}),(0,Q.jsx)(`th`,{scope:`col`,className:G,children:`The agent wrote`})]}),children:e.proposals.map(e=>{let t=Pn(e);return(0,Q.jsxs)(`tr`,{className:W,"data-state":r.includes(t)?`selected`:void 0,children:[(0,Q.jsx)(`td`,{className:K,children:(0,Q.jsx)(Y,{"aria-label":`${Fn(e)}: ${e.id} ${e.title}`,checked:r.includes(t),disabled:s||!!a,onCheckedChange:e=>i(e?[...r,t]:r.filter(e=>e!==t))})}),(0,Q.jsxs)(`td`,{className:c(K,`whitespace-nowrap font-medium`),children:[Fn(e),e.link&&e.kind!==`link`&&(0,Q.jsx)(`span`,{className:`block text-body-sm font-normal text-muted`,children:`and link it`})]}),(0,Q.jsxs)(`td`,{className:c(K,`[overflow-wrap:anywhere]`),children:[(0,Q.jsx)(`span`,{className:`font-mono text-body-sm text-ink-2`,children:e.id}),` `,e.title]}),(0,Q.jsx)(`td`,{className:c(K,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),a&&(0,Q.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:c(x.info,`flex flex-col gap-2`),children:[(0,Q.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,Nn(a.changes.length,`change`),` to `,An.find(t=>t.id===e.system)?.label,`?`]}),(0,Q.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-6 text-ink-2`,children:a.lines.map((e,t)=>(0,Q.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsxs)(y,{size:`sm`,variant:`primary`,disabled:s,onClick:()=>void g(),children:[(0,Q.jsx)(Ae,{"aria-hidden":`true`}),`Apply`]}),(0,Q.jsxs)(y,{size:`sm`,disabled:s,onClick:()=>o(null),children:[(0,Q.jsx)(j,{"aria-hidden":`true`}),`Cancel`]})]})]}),u&&u.applied.length>0&&(0,Q.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-pass`,children:[`Applied: `,u.applied.join(`, `)]}),u&&u.failed.length>0&&(0,Q.jsxs)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:[`Not applied: `,u.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,Q.jsx)(J,{id:`changes`,icon:fe,title:`Recent changes`,children:e.changes.length?(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm text-ink-2`,children:e.changes.map((e,t)=>(0,Q.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`ForgeQE has not changed this story's cases.`})}),e.notes.map((e,t)=>(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function zn({sub:e}){let{systems:t,error:i}=Ln(),a=e?e.indexOf(`/`):-1,s=a>0?e.slice(0,a):e,l=jn(s)?s:void 0,u=l&&a>0?n(e.slice(a+1)):``,[d,f]=(0,X.useState)(l??`azure_devops`),[p,m]=(0,X.useState)(u),[g,v]=(0,X.useState)(null),[b,S]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1);(0,X.useEffect)(()=>{l&&f(l),m(u)},[l,u]),(0,X.useEffect)(()=>{!l&&t.length&&!t.some(e=>e.id===d)&&f(t[0].id)},[t,d,l]);let E=(0,X.useCallback)(()=>{!l||!u?v(null):(T(!0),h.view(l,u).then(e=>{v(e),S(``),T(!1)},e=>{S(e.message),T(!1)}))},[l,u]);return(0,X.useEffect)(()=>v(null),[l,u]),(0,X.useEffect)(E,[E]),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,Q.jsx)(`a`,{href:r(`regression`),children:`Regression`}),`; their results on `,(0,Q.jsx)(`a`,{href:r(`runs`),children:`Runs`}),`.`]}),(0,Q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=p.trim();if(!t)return;let n=r(`test-management`,`stories`,d,encodeURIComponent(t));location.hash===n?E():location.hash=n},className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-2`,children:(0,Q.jsx)(C,{items:t,value:d,onChange:f})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,Q.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-body-sm font-medium`,children:[`Story`,(0,Q.jsx)(o,{value:p,maxLength:120,spellCheck:!1,placeholder:d===`azure_devops`?`1234`:d===`qtest`?`5678`:d===`testrail`?`R12`:`SHOP-12`,onChange:e=>m(e.target.value)})]}),(0,Q.jsxs)(y,{type:`submit`,variant:`primary`,disabled:!p.trim()||w,"data-tip":`Open the story's test cases`,children:[(0,Q.jsx)(we,{"aria-hidden":`true`}),`Open`]})]})]}),[i,b].filter(Boolean).map(e=>(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:e},e)),w&&(0,Q.jsx)(ee,{shape:`detail`}),g&&(0,Q.jsx)(Rn,{view:g,onApplied:E,onError:S},`${g.system}:${g.story.id}`),!u&&!g&&(0,Q.jsx)(_,{icon:I,title:`No story opened yet`,children:`Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})}var Bn={view:()=>g(`GET`,`/api/testdebt`),refresh:()=>g(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>g(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},Vn=[`untested`,`signal`,`duplicates`,`cases`],Hn={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},Un={test:`Test`,recording:`Recording`,case:`Test case`},Wn={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},Gn={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},Kn=e=>`${Math.round(e*100)}%`,qn=e=>Vn.includes(e)?e:`untested`;function Jn({part:e,what:t,action:n}){return(0,Q.jsxs)(_,{icon:A,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,Q.jsxs)(`a`,{className:b({size:`sm`}),href:n.to,"data-tip":`Open ${n.label}`,children:[(0,Q.jsx)(we,{"aria-hidden":`true`}),n.label]}),children:[`To see this list, set `,e.set,`.`]})}function $({text:e,tip:t}){return(0,Q.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function Yn({sub:e}){let[t,n]=(0,X.useState)(null),[a,s]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(``),m=qn(e),[h,g]=(0,X.useState)(`all`),[v,S]=(0,X.useState)(`manual`),[w,T]=(0,X.useState)(``),[E,te]=(0,X.useState)(``);(0,X.useEffect)(()=>{Bn.view().then(e=>{n(e),s(``)},e=>s(e.message))},[]);let ne=(0,X.useCallback)(async(e,t)=>{u(!0),f(``);try{n(await e()),s(``),t&&f(t)}catch(e){s(e.message)}finally{u(!1)}},[]),D=async e=>{if(e){u(!0);try{let{id:t}=await p.start(e,{});location.hash=r(`chats`,t)}catch(e){s(e.message),u(!1)}}},O=(e,t)=>(0,Q.jsx)(y,{size:`icon`,variant:`icon`,className:`size-8`,disabled:l||!e,onClick:()=>void D(e),"aria-label":`Draft a test for this ${t} in a chat`,"data-tip":e?`Draft a test for this ${t} in a chat`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:(0,Q.jsx)(Te,{"aria-hidden":`true`})}),re=t?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],k=w||re[0]?.id||``,A=t?.cases.filter(e=>!e.automated).length??0,ie=t?.areas.filter(e=>h===`all`||e.kind===h)??[],ae=t?.cases.filter(e=>v===`all`||(v===`manual`?!e.automated:e.automated))??[],j={untested:(t?.areas.length??0)+(t?.rules.length??0),signal:(t?.quiet.length??0)+(t?.gone.length??0),duplicates:t?.duplicates.length??0,cases:A};return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`div`,{className:`flex flex-wrap items-center gap-4`,children:t&&(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-body-sm text-muted`,children:[(0,Q.jsxs)(`span`,{"data-tip":Qe(t.at),children:[`Worked out `,U(t.at)]}),(0,Q.jsxs)(y,{size:`sm`,disabled:l,onClick:()=>void ne(Bn.refresh,`Worked out again.`),children:[(0,Q.jsx)(ue,{"aria-hidden":`true`}),`Refresh`]})]})}),(0,Q.jsx)(Je,{more:(0,Q.jsxs)(Q.Fragment,{children:[`Code and business rules no test reaches in the `,(0,Q.jsx)(`a`,{href:r(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,t?.repo&&t.repo!==`.`?(0,Q.jsx)(`code`,{className:`font-mono text-body-sm`,children:t.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),children:`What no test checks yet, and tests that tell you little.`}),a&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:a}),!t&&!a&&(0,Q.jsx)(ee,{shape:`rows`}),d&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-ink-2`,children:d}),t&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Ze,{label:`Test debt`,children:[(0,Q.jsx)(qe,{tip:t.graph.state===`ok`?`Of ${t.graph.checked} areas`:`The product graph is not built`,dot:t.graph.state===`ok`?t.areas.length?`warn`:`pass`:`neutral`,value:t.graph.state===`ok`?t.areas.length:`–`,label:`untested code areas`}),(0,Q.jsx)(qe,{tip:`Of ${t.graph.rulesChecked} rules`,dot:t.rules.length?`warn`:`pass`,value:t.rules.length,label:`untested rules`}),(0,Q.jsx)(qe,{tip:`30 passes in a row`,dot:`neutral`,value:t.quiet.length,label:`never fail`}),(0,Q.jsx)(qe,{tip:`Of ${t.files.count} files listed`,dot:t.gone.length?`fail`:`pass`,value:t.gone.length,label:`with their code gone`}),(0,Q.jsx)(qe,{tip:`From ${Kn(t.threshold)} alike`,dot:`neutral`,value:t.duplicates.length,label:`near-duplicates`}),(0,Q.jsx)(qe,{dot:A?`warn`:`pass`,value:A,label:`of ${t.cases.length} test cases not automated`})]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Q.jsx)(C,{items:[{id:`untested`,label:`Untested code and rules`,n:j.untested},{id:`signal`,label:`Low-signal tests`,n:j.signal},{id:`duplicates`,label:`Near-duplicates`,n:j.duplicates},{id:`cases`,label:`Test cases`,n:j.cases}],value:m,onChange:e=>location.hash=r(`test-management`,`debt`,e)})}),t.notes.map(e=>(0,Q.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:e},e)),m===`untested`&&(0,Q.jsxs)(Q.Fragment,{children:[t.graph.state===`ok`?(0,Q.jsx)(q,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:h,empty:t.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Q.jsx)(C,{items:[{id:`all`,label:`All`,n:t.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${Hn[e]}s`,n:t.areas.filter(t=>t.kind===e).length}))],value:h,onChange:g})}),head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[34%]`),children:`Code`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`Kind`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Used by`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ie.map(e=>(0,Q.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`max-w-0`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(M,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,Q.jsx)($,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`text-body-sm whitespace-nowrap`),children:Hn[e.kind]}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden max-w-0 font-mono text-body-sm text-ink-2 @xl:table-cell`),children:(0,Q.jsx)($,{text:e.where})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,Q.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:O(e.draft,Hn[e.kind].toLowerCase())})]},e.id))}):(0,Q.jsx)(Jn,{part:t.graph,what:`product graph`,action:{label:`Product`,to:r(`product`)}}),(0,Q.jsx)(q,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:t.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[46%]`),children:`Rule`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`From`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Closest test`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:t.rules.map(e=>(0,Q.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`max-w-0`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(M,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,Q.jsx)($,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`text-body-sm whitespace-nowrap`),"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden max-w-0 font-mono text-body-sm text-ink-2 @xl:table-cell`),children:(0,Q.jsx)($,{text:e.where})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden max-w-0 text-body-sm text-ink-2 @2xl:table-cell`),children:e.nearest?(0,Q.jsx)($,{text:`${e.nearest.name} (${Kn(e.nearest.score)})`,tip:`${Kn(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,Q.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:O(e.draft,`rule`)})]},e.id))})]}),m===`signal`&&(t.history.state===`ok`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[50%]`),children:`Test`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,children:`Passes`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Since`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:t.quiet.map(e=>(0,Q.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`max-w-0`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(ce,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,Q.jsx)($,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`text-muted`),children:e.runs}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.since?Qe(e.since):void 0,"data-sort":e.since&&new Date(e.since).getTime()||0,children:e.since?U(e.since):`–`}),(0,Q.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:O(e.draft,`test`)})]},e.key))}),(0,Q.jsx)(q,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${t.files.count} files, listed by ${t.files.by===`git`?`git`:`walking the folder`}).`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[40%]`),children:`Test`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`File`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Last run`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:t.gone.map(e=>(0,Q.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`max-w-0`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(B,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,Q.jsx)($,{text:e.name})]})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`max-w-0 font-mono text-body-sm text-ink-2`),children:(0,Q.jsx)($,{text:e.file})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.last?Qe(e.last):void 0,"data-sort":e.last&&new Date(e.last).getTime()||0,children:e.last?U(e.last):`–`}),(0,Q.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:O(e.draft,`test`)})]},e.key))})]}):(0,Q.jsx)(Jn,{part:t.history,what:`test history`,action:{label:`Regression`,to:r(`regression`)}})),m===`duplicates`&&(0,Q.jsx)(q,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,height:`max(320px, calc(var(--screen) - 288px))`,empty:`No two tests, recordings or test cases share ${Kn(t.threshold)} of their words (${t.compared} pairs compared).`,head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,children:`Alike`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`First`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`Second`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Shared words`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:t.duplicates.map(e=>(0,Q.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,Q.jsx)(`td`,{className:c(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,e.score>=.85?`text-warn`:`text-muted`),"data-sort":e.score,children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(pe,{size:14,"aria-hidden":`true`}),Kn(e.score)]})}),[e.a,e.b].map((e,t)=>(0,Q.jsxs)(`td`,{className:c(`px-4 py-2`,`max-w-0`),children:[(0,Q.jsx)($,{text:e.name,tip:`${Un[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,Q.jsx)(`span`,{className:`block text-body-sm text-muted`,children:Un[e.kind]})]},t)),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden max-w-0 text-body-sm text-ink-2 @2xl:table-cell`),children:(0,Q.jsx)($,{text:e.shared.join(`, `)})}),(0,Q.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:O(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),m===`cases`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Test management`}),(0,Q.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,children:t.sources.map(e=>(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,Q.jsx)(ce,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,Q.jsx)(M,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,Q.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${U(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),re.length>0&&(0,Q.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),k&&ne(()=>Bn.readCases(k,E.trim()),`Test cases read.`)},children:[(0,Q.jsx)(i,{size:`sm`,"aria-label":`Source`,value:k,onChange:e=>T(e.target.value),children:re.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,Q.jsx)(o,{size:`sm`,"aria-label":`Scope`,placeholder:k&&k!==`jira`?Gn[k]:``,value:E,maxLength:80,onChange:e=>te(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,Q.jsxs)(y,{size:`sm`,type:`submit`,disabled:l||!E.trim(),"data-tip":`Read the test cases`,children:[(0,Q.jsx)(R,{"aria-hidden":`true`}),`Import`]})]}),t.cases.length?(0,Q.jsx)(q,{label:`Test cases`,placeholder:`Find a test case by id or title`,height:`max(320px, calc(var(--screen) - 288px))`,resetKey:v,empty:`Nothing matches.`,tools:(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Q.jsx)(C,{items:[{id:`manual`,label:`Not automated`,n:A,alert:!0},{id:`automated`,label:`Automated`,n:t.cases.length-A},{id:`all`,label:`All`,n:t.cases.length}],value:v,onChange:S})}),head:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`Case`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[36%]`),children:`Title`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Source`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`Automated`}),(0,Q.jsx)(`th`,{scope:`col`,className:c(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Test`}),(0,Q.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ae.map(e=>(0,Q.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`font-mono text-body-sm whitespace-nowrap`),children:/^https?:\/\//i.test(e.url)?(0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`max-w-0`),children:(0,Q.jsx)($,{text:e.title||`–`})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden text-body-sm whitespace-nowrap @xl:table-cell`),"data-tip":`From ${e.scope}`,children:Wn[e.source]}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`text-body-sm whitespace-nowrap`),children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,Q.jsx)(ce,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,Q.jsx)(M,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,Q.jsx)(`td`,{className:c(`px-4 py-2`,`hidden max-w-0 text-body-sm text-ink-2 @2xl:table-cell`),children:e.test?(0,Q.jsx)($,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,Q.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:!e.automated&&O(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,Q.jsx)(_,{icon:I,title:`No test cases yet`,action:(0,Q.jsxs)(`a`,{className:b({size:`sm`}),href:r(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,Q.jsx)(we,{"aria-hidden":`true`}),`Settings`]}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})}var Xn=[`dashboard`,`cases`,`tests`,`gaps`,`debt`,`stories`,`suites`,`tags`],Zn={dashboard:[`dashboard`],inventory:[`cases`,`tests`,`stories`],coverage:[`gaps`,`debt`],organise:[`suites`,`tags`]},Qn=e=>Object.keys(Zn).find(t=>Zn[t].includes(e))??`dashboard`;function $n({sub:e}){let t=(e??``).split(`/`).filter(Boolean),i=Xn.includes(t[0])?t[0]:`dashboard`;Xe(`test-management`,i,Xn,!t[0],e=>location.replace(r(`test-management`,e)));let a=i===`cases`&&t[1]?n(t[1]):void 0,o=i===`tests`&&t[1]?n(t[1]):void 0,s=i===`suites`&&t[1]?n(t[1]):void 0,[l,u]=(0,X.useState)(null),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)([]),[v,b]=(0,X.useState)(null),[S,C]=(0,X.useState)(null),[w,T]=(0,X.useState)(null),[ne,D]=(0,X.useState)(``),[re,k]=(0,X.useState)(``),[A,ie]=(0,X.useState)(!1),[ae,j]=(0,X.useState)([]),[oe,se]=(0,X.useState)(null),[ce,le]=(0,X.useState)(null),P=(0,X.useCallback)(async()=>{try{let[e,t]=await Promise.all([Z.view(),Z.cases()]);u(e),p(t),C(e.suites),T(e.job),D(``)}catch(e){D(e.message)}},[]);(0,X.useEffect)(()=>{P()},[P]),(0,X.useEffect)(()=>{i===`gaps`&&Z.gaps().then(h,e=>D(e.message)),i===`tags`&&Z.tags().then(b,e=>D(e.message)),i===`suites`&&Z.suites().then(e=>C(e.suites),e=>D(e.message))},[i,l]),(0,X.useEffect)(()=>{if(!w?.running)return;let e=Ne(()=>{Z.job().then(e=>{T(e.job),e.job?.running||P()},()=>{})},2e3);return()=>Pe(e)},[w?.running,P]);let fe=async()=>{ie(!0),k(``);try{let e=await Z.sync(),t=e.plans.filter(e=>e.error),n=t.length?t.map(e=>`${e.label}: ${e.error}`).join(` · `):`Synced ${e.plans.map(e=>`${e.label} (${e.cases} cases)`).join(`, `)}.`;k(e.storiesError?`${n} The release's stories were not read again: ${e.storiesError}`:n),await P()}catch(e){D(e.message)}finally{ie(!1)}},pe=e=>se({title:`Run ${e.length} test case${e.length===1?``:`s`}`,go:(t,n)=>Z.run(e,t,n)}),me=(e,t)=>{let n=S?.find(t=>t.id===e)??l?.suites.find(t=>t.id===e);se({title:`${t?`Rerun the failed cases of`:`Run`} ${n?.name??`the suite`}`,go:(n,r)=>Z.runSuite(e,{...n?{env:n}:{},...t?{only:t}:{}},r)})},he=()=>{k(`The run started: it shows here while it runs, and in Runs.`),Z.job().then(e=>T(e.job),()=>{})},ge=e=>{k(e),j([]),P()},F=new Map((f?.cases??[]).map(e=>[e.key,e])),I=ae.filter(e=>F.has(e)),_e=e=>e.map(e=>F.get(e).id),ve=I.filter(e=>[`failed`,`blocked`].includes(F.get(e).lastRun.outcome)),ye=I.filter(e=>F.get(e).automation!==`automated`),be=[{intent:`automate`,label:ye.length?`Automate ${ye.length}`:`Automate`,icon:de,keys:ye.slice(0,50),...ye.length?{}:{disabled:`Pick test cases that are not automated`}},{intent:`investigate`,label:ve.length?`Why ${ve.length} fail`:`Why they fail`,icon:B,keys:ve.slice(0,50),...ve.length?{}:{disabled:`Pick failing test cases`}},{intent:`tag`,label:`Suggest tags`,icon:je,keys:I.slice(0,50),...I.length?{}:{disabled:`Pick test cases in the list first`}},{intent:`tag_tests`,label:`Write tags into tests`,icon:de,keys:I.filter(e=>F.get(e).tests.length>0&&F.get(e).tags.length>0).slice(0,50),...I.filter(e=>F.get(e).tests.length>0&&F.get(e).tags.length>0).length?{}:{disabled:`Pick tagged cases that have a linked test`}}],R=(m?.ranked??[]).slice(0,20).map(e=>e.key),xe=[{intent:`automate`,label:I.length?`Automate ${I.length}`:`Automate the top ${R.length}`,icon:de,keys:(I.length?I:R).slice(0,50),...I.length||R.length?{}:{disabled:`Nothing left to automate`}},{intent:`investigate`,label:`Why the failing fail`,icon:B,keys:(m?.lists.failing??[]).slice(0,50),...m?.lists.failing.length?{}:{disabled:`Nothing is failing`}},{intent:`cases_for_stories`,label:g.length?`Cases for ${g.length} stor${g.length===1?`y`:`ies`}`:`Cases for stories with none`,icon:L,keys:[],stories:(g.length?g:(m?.stories?.noCase??[]).map(e=>e.id)).slice(0,50),...g.length||m?.stories?.noCase.length?{}:{disabled:`Read the release's stories in Gaps, Stories with no case, first`}}],Se=f?f.cases.filter(e=>e.automation===`not_automated`||e.automation===`pending`||e.lastRun.outcome===`failed`||e.lastRun.outcome===`blocked`).length:(l?.summary.notAutomated??0)+(l?.summary.pending??0),we=s?S?.find(e=>e.id===s):void 0,Te=ce??(i===`suites`||(l?.summary.cases??0)>0),Ee=!!l&&!l.plans.length&&!l.summary.cases,z=Qn(i),De={dashboard:{label:`Dashboard`},cases:{label:`Test cases`,n:l?.summary.cases},tests:{label:`Automated`,n:l?.summary.tests},stories:{label:`Stories`},gaps:{label:`Gaps`,n:Se},debt:{label:`Test debt`},suites:{label:`Suites`,n:l?.suites.length},tags:{label:`Tags`}},Ae=(0,Q.jsxs)(`main`,{className:c(Ve,`@container flex-auto gap-4`),children:[!a&&!o&&!s&&(0,Q.jsx)(te,{}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,Q.jsx)(Me,{pixel:d[`test-management`],size:`lg`,head:!0}),(0,Q.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Test management`}),l&&(0,Q.jsx)(`div`,{className:`order-last flex min-w-0 basis-full @[74rem]:order-none @[74rem]:basis-auto`,children:(0,Q.jsx)(He,{label:`Test management`,className:`mb-0 max-w-full`,current:z,hrefOf:e=>r(`test-management`,Zn[e][0]),tabs:[{id:`dashboard`,label:`Dashboard`,icon:Ce},{id:`inventory`,label:`Cases`,n:l.summary.cases,icon:O},{id:`coverage`,label:`Coverage`,n:Se,icon:M},{id:`organise`,label:`Suites and tags`,icon:Oe}]})}),l&&(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[l.plans.length>0&&(0,Q.jsx)(y,{busy:A,size:`icon`,disabled:A,onClick:()=>void fe(),"aria-label":A?`Syncing`:`Sync`,"data-tip":A?`Syncing…`:`Sync: read every case of the connected plans again`,children:(0,Q.jsx)(ue,{"aria-hidden":`true`})}),(l.plans.length>0||l.summary.tests>0)&&(0,Q.jsx)(vn,{disabled:A}),(i===`cases`||i===`gaps`||i===`suites`)&&!Te&&(0,Q.jsx)(y,{size:`icon`,onClick:()=>le(!0),"aria-label":i===`suites`?`Open the Suite agent`:`Open the agent`,"data-tip":i===`suites`?`Open the Suite agent`:`Open the agent`,children:(0,Q.jsx)(L,{"aria-hidden":`true`})})]})]}),l&&!a&&!o&&!s&&(0,Q.jsxs)(Je,{children:[`Every case of your connected test plans: which are automated and by what, what ran, and what is left.`,` `,l.plans.length>0?(0,Q.jsxs)(`span`,{"data-tip":l.plans.map(e=>`${e.label}: ${e.cases} cases${e.at?`, synced ${Qe(e.at)}`:``}`).join(` · `),children:[l.plans.length,` plan`,l.plans.length===1?``:`s`,l.plans[0]?.at?`, synced ${U(l.plans.map(e=>e.at??``).sort()[0])}.`:`, not synced yet.`]}):(!Ee||i!==`dashboard`&&i!==`cases`&&i!==`gaps`)&&(0,Q.jsx)(`a`,{href:r(`settings`,`integrations`),children:`Connect a test plan in Settings`})]}),l&&Zn[z].length>1&&!a&&!o&&!s&&(0,Q.jsx)(Fe,{label:z===`inventory`?`Cases`:z===`coverage`?`Coverage`:`Suites and tags`,className:`mb-0`,current:i,onPick:e=>location.hash=r(`test-management`,e),tabs:Zn[z].map(e=>({id:e,...De[e]}))}),ne&&(0,Q.jsx)(`p`,{role:`alert`,className:c(x.fail,`m-0`),children:ne}),!l&&!ne&&(0,Q.jsx)(ee,{shape:`rows`}),re&&(0,Q.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:re}),l&&l.refused.length>0&&(0,Q.jsxs)(`p`,{className:`m-0 text-body-sm text-warn`,children:[`Not read, as their system does not write a plan that way: `,l.refused.join(` · `),`. Fix them in Settings › Integrations.`]}),w&&(0,Q.jsxs)(`div`,{role:`status`,className:c(`surface rounded-lg bg-bg p-6 shadow-sm`,`flex flex-wrap items-center gap-2 text-body-sm`),children:[(0,Q.jsx)(E,{tone:w.running?`running`:w.exitCode===0?`pass`:`fail`,children:w.running?`Running`:w.exitCode===0?`Finished`:`Stopped`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-ink-2`,"data-tip":w.command,children:w.lines.at(-1)??w.command}),w.running?(0,Q.jsxs)(y,{size:`sm`,variant:`danger`,onClick:()=>void Z.stop().then(e=>T(e.job),e=>D(e.message)),children:[(0,Q.jsx)(ke,{"aria-hidden":`true`}),`Stop`]}):(0,Q.jsx)(`a`,{href:r(`runs`),className:`text-body-sm`,children:`Runs`})]}),l&&(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`div`,{id:`panel-${i}`,...Zn[z].length>1&&!a&&!o&&!s?{role:`tabpanel`,"aria-labelledby":`tab-${i}`}:{},className:`flex flex-col gap-4`,children:[i===`dashboard`&&(0,Q.jsx)($t,{view:l,onRunSuite:me}),Ee&&(i===`cases`||i===`gaps`)&&!a&&(0,Q.jsx)(jt,{tests:l.summary.tests}),i===`cases`&&(!Ee||a)&&(a?(0,Q.jsx)(Ht,{caseKey:a,onRun:pe,onChanged:()=>void P()},a):f&&(0,Q.jsx)(qt,{cases:f.cases,tests:f.tests.length,selected:I,onSelect:j,onRun:pe,onChanged:ge})),i===`tests`&&f&&(o?(0,Q.jsx)(Dn,{uid:o,tab:t[2],cases:f.cases,onChanged:()=>void P()},o):(0,Q.jsx)(Mt,{cases:f.cases,onChanged:ge})),i===`gaps`&&(m&&f?(0,Q.jsx)(un,{gaps:m,cases:f.cases,tests:f.tests,selected:I,onSelect:j,onRun:pe,pickedStories:g,onPickStories:_,onStoriesRead:()=>(_([]),void P())}):(0,Q.jsx)(ee,{shape:`rows`})),i===`debt`&&(0,Q.jsx)(Yn,{sub:t[1]}),i===`stories`&&(0,Q.jsx)(zn,{sub:t.slice(1).join(`/`)||void 0}),i===`suites`&&(s?(0,Q.jsx)(mn,{id:s,onRun:me,onDeleted:()=>(location.hash=r(`test-management`,`suites`),void P())},s):S&&(0,Q.jsx)(pn,{suites:S,onRun:me})),i===`tags`&&(v?(0,Q.jsx)(En,{tags:v,cases:f?.cases,onChanged:ge}):(0,Q.jsx)(ee,{shape:`rows`}))]})}),(0,Q.jsx)(Dt,{open:!!oe,onClose:()=>se(null),title:oe?.title??`Run`,preview:(e,t)=>oe.go(e,t),onStarted:he})]}),V=a?F.get(a):void 0;return(0,Q.jsxs)(`div`,{className:`@container flex min-h-(--screen) flex-col`,children:[(0,Q.jsx)(Ue,{}),(0,Q.jsxs)(`div`,{className:`flex flex-auto flex-col xl:flex-row`,children:[(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-auto flex-col`,children:Ae}),l&&Te&&i===`cases`&&(0,Q.jsx)(at,{title:`Test case agent`,about:`Automates, runs and tags the cases you pick.`,looking:V?`Looking at ${V.id}.`:I.length?`Looking at the ${I.length} cases you picked.`:`Looking at ${l.summary.cases} test cases. Pick some in the list.`,context:V?[V.id,...V.plans.slice(0,1)]:I.length?_e(I).slice(0,4):[],suggestions:V?[{intent:V.automation===`automated`?`run`:`automate`,label:V.automation===`automated`?`Run it and explain`:`Automate it`,icon:V.automation===`automated`?N:de,keys:[V.key]},{intent:`investigate`,label:`Why it fails`,icon:B,keys:[V.key],...[`failed`,`blocked`].includes(V.lastRun.outcome)?{}:{disabled:`Its last run did not fail`}},{intent:`tag`,label:`Suggest tags`,icon:je,keys:[V.key]}]:be,keys:V?[V.key]:I,placeholder:`Ask about these cases, or say what to do`,onClose:()=>le(!1)},a??`list`),l&&Te&&i===`gaps`&&(0,Q.jsx)(at,{title:`Gap agent`,about:`Finds what to close first and closes it with you.`,looking:`Looking at ${l.summary.notAutomated} cases not automated, ${l.summary.pending} pending and ${l.summary.failing} failing.`,context:I.length?_e(I).slice(0,4):[],suggestions:xe,keys:I.length?I:R,placeholder:`What should we close first?`,onClose:()=>le(!1)}),l&&Te&&i===`suites`&&(0,Q.jsx)(hn,{open:we,onSaved:e=>{k(`Saved the suite ${e.name}.`),P(),location.hash=r(`test-management`,`suites`,e.id)}},s??`list`)]})]})}export{Zn as GROUPS,$n as TestManagement,Qn as groupOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{V as n,c as r}from"./surface-c1kG1KPS.js";import{n as i,t as a}from"./utils-DJRAScIl.js";import{t as o}from"./jsx-runtime-LKYXHABd.js";import{I as s}from"./palette-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{V as n,c as r}from"./surface-c1kG1KPS.js";import{n as i,t as a}from"./utils-DJRAScIl.js";import{t as o}from"./jsx-runtime-LKYXHABd.js";import{I as s}from"./palette-dAh9kV3S.js";import{k as c,n as l}from"./pageBack-DfGBh1Hs.js";import{O as u,o as d,x as f}from"./line-icons-Cwj9OmCz.js";import{At as p,Dn as m,s as h,t as g}from"./frame-D0MS2ZMz.js";import{F as _,M as v,N as y,P as b,Y as x,j as S}from"./index-F8zkXd19.js";var C=e(t(),1),w=o(),T={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function E({change:e,id:t,first:r}){let[i,o]=(0,C.useState)(!1),s=y(e);return(0,w.jsxs)(`li`,{className:a(!r&&`border-t border-line-soft`),children:[(0,w.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":t,onClick:()=>o(!i),className:n,children:[(0,w.jsx)(c,{tone:T[e.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:T[e.kind].label}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,w.jsx)(u,{size:16,"aria-hidden":`true`,className:a(`flex-none text-muted transition-transform duration-200`,i&&`rotate-90`)})]}),(0,w.jsx)(m,{open:i,id:t,children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 pt-1 pb-4 sm:pl-26`,children:[(0,w.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:e.detail}),s&&(0,w.jsxs)(`a`,{href:s,className:`inline-flex items-center gap-1 self-start text-body-sm font-medium`,children:[`Open`,(0,w.jsx)(d,{size:13,"aria-hidden":`true`})]})]})})]})}var D=e=>`whats-new-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`)}`;function O({release:e}){let t=e===S;return(0,w.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,className:a(`relative mt-2 size-[15px] flex-none rounded-full border-[3px] border-bg`,t?`bg-accent`:`bg-line`)}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,w.jsxs)(`h3`,{className:`m-0 text-body-lg font-medium`,children:[`ForgeQE `,e.version]}),t&&(0,w.jsx)(c,{tone:`running`,icon:!1,children:`Latest`}),(0,w.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[(0,w.jsx)(`time`,{dateTime:e.date,children:_(e.date)}),` · `,i(e.changes.length,`change`)]})]}),(0,w.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:e.summary}),(0,w.jsx)(`ul`,{className:a(r,`m-0 flex list-none flex-col overflow-hidden p-0`),children:e.changes.map((t,n)=>(0,w.jsx)(E,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function k({embedded:e=!1}={}){(0,C.useEffect)(b,[]);let t=v(),n=(0,w.jsx)(w.Fragment,{children:(0,w.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),t.map(e=>(0,w.jsxs)(`section`,{"aria-labelledby":D(e.month),className:`flex flex-col gap-4`,children:[(0,w.jsx)(x,{id:D(e.month),icon:f,title:e.month,className:`pl-8`}),(0,w.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,w.jsx)(O,{release:e},e.version))})]},e.month))]})});return e?(0,w.jsx)(`div`,{className:`flex flex-col gap-6`,children:n}):(0,w.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,w.jsx)(h,{}),(0,w.jsxs)(`main`,{className:a(g,`flex-auto gap-6`),children:[(0,w.jsx)(l,{}),(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,w.jsx)(p,{pixel:s[`whats-new`],size:`lg`,head:!0}),(0,w.jsx)(`h1`,{className:`m-0 flex-1 text-headline-md`,children:`What's new`})]}),(0,w.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),n]})]})}export{T as KIND,k as WhatsNew};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{t as r}from"./jsx-runtime-LKYXHABd.js";import{t as i}from"./sectionList-B6NF3ZMb.js";import{F as a,P as o,R as s}from"./pageBack-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{r as n}from"./route-9BkoTWUE.js";import{t as r}from"./jsx-runtime-LKYXHABd.js";import{t as i}from"./sectionList-B6NF3ZMb.js";import{F as a,P as o,R as s}from"./pageBack-DfGBh1Hs.js";import{pn as c,w as l}from"./line-icons-Cwj9OmCz.js";import{Zt as u,_n as d}from"./frame-D0MS2ZMz.js";import{SaveNotes as f,SectionBody as p,i as m,n as h,r as g,t as _,useSettingsStore as v}from"./Settings-BkjUlPMQ.js";var y=e(t(),1),b=r();function x({open:e,onClose:t,title:r,sections:x,agents:S}){let C=v(),{snap:w,drafts:T,setup:E,ready:D,loadError:O,secrets:k,setDrafts:A,setSaved:j,dirtyFiles:M,save:N,conflict:P,load:F}=C,I=(0,y.useRef)(!1);(0,y.useEffect)(()=>{e&&(I.current&&!M.length&&F(),I.current=!0)},[e]);let[L,R]=(0,y.useState)(!1);(0,y.useEffect)(()=>R(!1),[e]);let z=async()=>{if(!M.length||L||!P&&await N())return t();R(!0)},B=!!(w&&T);return(0,b.jsx)(u,{open:e,onClose:()=>void z(),wide:!0,title:`${r} settings`,description:`Saved for this project, as everything in Settings is. Models, sign-ins and the rest every agent shares are in Settings.`,footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f,{store:C,className:`static mr-auto items-start`}),(0,b.jsxs)(a,{variant:`primary`,onClick:()=>void z(),children:[(0,b.jsx)(l,{"aria-hidden":`true`}),`Done`]})]}),children:(0,b.jsx)(d.Provider,{value:k,children:(0,b.jsxs)(`div`,{className:`-mx-6 -mb-6 flex min-h-full flex-col gap-8 bg-canvas px-6 py-6`,children:[O&&(0,b.jsx)(`p`,{role:`alert`,className:`m-0 text-body-sm text-fail`,children:O}),E&&!D&&(0,b.jsxs)(s,{tone:`info`,className:`flex items-start gap-2 leading-relaxed`,children:[(0,b.jsx)(c,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-icon`}),(0,b.jsxs)(`span`,{children:[`These settings open once ForgeQE is set up in a project folder: `,(0,b.jsx)(`a`,{href:n(`settings`,`setup`),children:`Set up`}),`.`]})]}),!O&&(!E||D&&!B)&&(0,b.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading settings…`}),D&&B&&x.map(e=>{let t=i.find(t=>t.id===e);return(0,b.jsxs)(`section`,{"aria-labelledby":`panel-sec-${e}`,className:`flex flex-col gap-4`,children:[t&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,b.jsxs)(`h3`,{id:`panel-sec-${e}`,className:`m-0 flex items-center gap-2 font-home text-headline-sm`,children:[(0,b.jsx)(o,{icon:t.icon,size:18,className:`flex-none text-icon`}),t.label]}),(0,b.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:t.intro})]}),(0,b.jsx)(`div`,{className:`settings-body flex flex-col gap-6`,children:(0,b.jsx)(p,{id:e,store:C})})]},e)}),D&&B&&S.length>0&&(0,b.jsxs)(`section`,{"aria-labelledby":`panel-sec-agents`,className:`flex flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,b.jsxs)(`h3`,{id:`panel-sec-agents`,className:`m-0 font-home text-headline-sm`,children:[`How `,S.length===1?`it works`:`they work`]}),(0,b.jsx)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:`The model, prompts, skills and guardrails of this page's agents. Settings shows every agent's together.`})]}),(0,b.jsxs)(`div`,{className:`settings-body flex flex-col gap-6`,children:[(0,b.jsx)(h,{config:C.edit(`config`),models:C.edit(`models`),only:S}),(0,b.jsx)(m,{onChanged:j,only:S,title:`Prompts`}),(0,b.jsx)(g,{edit:C.edit(`config`),only:S,title:`Skills`}),(0,b.jsx)(_,{rules:T.guardrails,others:w.guardrails.filter(e=>!e.editable),onChange:e=>A(t=>({...t,guardrails:e})),onChanged:j,only:S,title:`Guardrails`})]})]})]})})})}export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`/api/prefs/sample`,t=`forgeqe-sample-data`,n=`This page is showing sample data, so nothing was changed. Turn sample data off in Settings › Sample data to work with your project.`,r=!1,i=null;function a(){return r}function o(e){let n=e===!0;n!==r&&(r=n,typeof window<`u`&&window.dispatchEvent(new Event(t)))}function s(e){return i||=e().then(e=>o(!!e&&typeof e==`object`&&e.on===!0),()=>o(!1)),i}var ee=`modulepreload`,c=function(e){return`/`+e},l={},te=function(e){return e.pathname.endsWith(`.css`)},ne=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},u=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=c(t,n);let r=s(t),i=te(r);return ne(l,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:ee,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},d=`forgeqe-web-token`,f=``;function p(e){return/(?:^#|&)token=([A-Za-z0-9]+)(?:&|$)/.exec(e)?.[1]}function m(){let e=p(location.hash);if(!e)return!1;let t=e!==g();return h(e),history.replaceState(null,``,`${location.pathname}${location.search}#/`),t&&x({kind:`token`,token:e,fresh:!0}),t}function re(){window.addEventListener(`hashchange`,()=>{m()&&location.reload()})}function h(e){f=e;try{sessionStorage.setItem(d,e)}catch{}}function g(){if(f)return f;try{return sessionStorage.getItem(d)||``}catch{return``}}var _=`forgeqe-web-sign-in`;function v(e){if(!e||typeof e!=`object`)return;let t=e;if(t.kind===`ask`)return{kind:`ask`};if(t.kind===`token`&&typeof t.token==`string`&&/^[A-Za-z0-9]{1,256}$/.test(t.token))return{kind:`token`,token:t.token,fresh:t.fresh===!0}}var y,b=!1;function x(e){try{y?.postMessage(e)}catch{}}var ie=600,S=Promise.resolve();function ae(){if(typeof BroadcastChannel>`u`)return;y=new BroadcastChannel(_);let e;y.onmessage=t=>{let n=v(t.data);if(!n)return;if(n.kind===`ask`){let e=g();e&&x({kind:`token`,token:e,fresh:!1});return}let r=g();r?n.fresh&&n.token!==r&&(h(n.token),b&&location.reload()):(h(n.token),e?.(),b&&location.reload())},!g()&&(S=new Promise(t=>{let n=setTimeout(t,ie);e=()=>{clearTimeout(n),t()}}),x({kind:`ask`}))}var C=`forgeqe-web-signed-out`,oe=`ForgeQE web does not accept this page's sign-in: it was started again, with a new token. Open the address it printed last (with its #token=…) in this tab.`,se=`This tab is not signed in to ForgeQE web, and no other open ForgeQE tab could share its sign-in. Open the address forgeqe web printed (with its #token=…), then other tabs work too.`;function w(){return g()?oe:se}var T=class extends Error{status;constructor(e,t){super(e),this.status=t}},E=`forgeqe-web-config-changed`,D=``;function O(e,t){e&&(!D||t!==`GET`?D=e:e!==D&&(D=e,window.dispatchEvent(new Event(E))))}function k(){return s(async()=>{await S;let t=await fetch(e,{headers:{Authorization:`Bearer ${g()}`}});return t.ok?t.json():void 0})}async function A(e,t){if(await k(),!a())return;let{sampleAnswer:n}=await u(async()=>{let{sampleAnswer:e}=await import(`./answer-BCM85AEe.js`);return{sampleAnswer:e}},[]);return n(e,t)}async function j(e,t,r){await S;let i=await A(e,t);if(i?.kind===`data`)return i.value;if(i?.kind===`refused`)throw new T(n,409);let a;try{a=await fetch(t,{method:e,headers:{Authorization:`Bearer ${g()}`,...r===void 0?{}:{"Content-Type":`application/json`}},body:r===void 0?void 0:JSON.stringify(r)})}catch{throw new T(`ForgeQE web is not running. Start it in your project folder with forgeqe web, then open the address it prints.`,0)}let o=await a.json().catch(()=>({}));if(a.ok&&O(a.headers.get(`X-ForgeQE-Config`),e),a.status===401)throw b=!0,window.dispatchEvent(new Event(C)),new T(w(),401);if(!a.ok)throw new T(o.error||`The request failed (${a.status}).`,a.status);return o}async function M(e,t){if(await S,(await A(`POST`,t))?.kind===`refused`)throw new T(n,409);let r;try{r=await fetch(t,{method:e,headers:{Authorization:`Bearer ${g()}`}})}catch{throw new T(`ForgeQE web is not running. Start it in your project folder with forgeqe web, then open the address it prints.`,0)}if(!r.ok)throw new T(await r.json().then(e=>e.error,()=>void 0)||`The file could not be made (HTTP ${r.status}).`,r.status);return r.blob()}function N(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var P={view:()=>j(`GET`,`/api/telemetry`),save:e=>j(`POST`,`/api/telemetry/save`,e),on:e=>j(`POST`,`/api/telemetry/on`,{confirm:e}),off:()=>j(`POST`,`/api/telemetry/off`,{}),test:()=>j(`POST`,`/api/telemetry/test`,{})},F={status:()=>j(`GET`,`/api/voice`),setup:()=>j(`POST`,`/api/voice/setup`,{confirm:!0}),warm:()=>j(`POST`,`/api/voice/warm`,{}),ticket:(e,t)=>j(`POST`,`/api/voice/ticket`,{...e?{chat:e}:{},eagerness:t})},I={repos:(e,t,n,r)=>j(`POST`,`/api/settings/repo-accounts/list`,{id:e,account:t,values:n,taken:r}),signIn:(e,t)=>j(`POST`,`/api/settings/repo-accounts/signin`,{id:e,account:t}),testSearch:(e,t,n,r)=>j(`POST`,`/api/settings/search/test`,{rag:e,mcp:t,query:n,values:r}),documents:()=>j(`GET`,`/api/settings/documents`),addDocument:(e,t,n)=>j(`POST`,`/api/settings/documents`,{name:e,text:t,replace:n}),removeDocument:e=>j(`POST`,`/api/settings/documents/remove`,{name:e})},L={settings:()=>j(`GET`,`/api/settings`),save:(e,t,n,r)=>j(`PUT`,`/api/settings/${e}`,{value:t,version:n,...r&&Object.keys(r).length?{renames:r}:{}}),saveText:(e,t,n,r)=>j(`PUT`,`/api/settings/${e}`,{text:t,env:n,version:r}),splitEnvironments:()=>j(`PUT`,`/api/settings/split`,{}),saveGrid:(e,t,n)=>j(`PUT`,`/api/settings/grid`,{grid:e,value:t,version:n}),test:(e,t,n,r)=>j(`POST`,`/api/test`,{kind:e,id:t,settings:n,values:r}),saveSecrets:e=>j(`PUT`,`/api/secrets`,{values:e}),saveGuardrails:(e,t)=>j(`PUT`,`/api/settings/guardrails`,{rules:e,version:t})},R={list:()=>j(`GET`,`/api/secrets-hub`),save:(e,t)=>j(`POST`,`/api/secrets-hub/secret`,{name:e,value:t}),remove:e=>j(`POST`,`/api/secrets-hub/secret`,{name:e,remove:!0}),saveVault:(e,t)=>j(`POST`,`/api/secrets-hub/vault`,{vault:e,replace:t}),removeVault:e=>j(`POST`,`/api/secrets-hub/vault`,{id:e,remove:!0}),names:(e,t=``)=>j(`GET`,`/api/secrets-hub/vault/${encodeURIComponent(e)}/names${t?`?search=${encodeURIComponent(t)}`:``}`),pull:e=>j(`POST`,`/api/secrets-hub/pull`,e),signIn:e=>j(`POST`,`/api/secrets-hub/vault/${encodeURIComponent(e)}/signin`,{}),signinState:()=>j(`GET`,`/api/secrets-hub/signin`),cancelSignin:()=>j(`POST`,`/api/secrets-hub/signin/cancel`,{}),check:e=>j(`POST`,`/api/secrets-hub/vault/${encodeURIComponent(e)}/check`,{}),exportVaults:()=>j(`GET`,`/api/secrets-hub/export`),importVaults:e=>j(`POST`,`/api/secrets-hub/import`,{text:e}),pullAgain:e=>j(`POST`,`/api/secrets-hub/pull-again`,e?{name:e}:{})},z={state:()=>j(`GET`,`/api/setup`),machine:()=>j(`GET`,`/api/setup/machine`),folders:e=>j(`GET`,`/api/folders${e?`?path=${encodeURIComponent(e)}`:``}`),newFolder:(e,t)=>j(`POST`,`/api/folders`,{parent:e,name:t}),open:e=>j(`PUT`,`/api/project`,{path:e}),init:()=>j(`POST`,`/api/project/init`),run:()=>j(`POST`,`/api/setup/run`),packages:()=>j(`GET`,`/api/setup/packages`)},B={get:()=>j(`GET`,`/api/onboarding`),status:()=>j(`GET`,`/api/onboarding/state`),save:e=>j(`POST`,`/api/onboarding`,e),features:()=>j(`GET`,`/api/onboarding/features`),install:e=>j(`POST`,`/api/onboarding/install`,{features:e,confirm:!0}),repo:()=>j(`GET`,`/api/onboarding/repo`),branches:(e,t)=>j(`POST`,`/api/onboarding/repo/branches`,{url:e,...t?{tokenVar:t}:{}}),clone:(e,t,n)=>j(`POST`,`/api/onboarding/repo/clone`,{url:e,...t?{branch:t}:{},...n?{tokenVar:n}:{}}),startRepo:e=>j(`POST`,`/api/onboarding/repo/init`,e?{remote:e}:{}),tokens:()=>j(`GET`,`/api/onboarding/tokens`)},V={get:()=>j(`GET`,`/api/fx`)},H={list:()=>j(`GET`,`/api/background`)},U={files:()=>j(`GET`,`/api/guardrails/files`),add:e=>j(`POST`,`/api/guardrails/files`,e),save:(e,t)=>j(`PUT`,`/api/guardrails/files/${encodeURIComponent(e)}`,t),remove:e=>j(`DELETE`,`/api/guardrails/files/${encodeURIComponent(e)}`)},W={prompts:()=>j(`GET`,`/api/prompts`),addTeamPrompt:e=>j(`POST`,`/api/prompts/team`,e),saveTeamPrompt:(e,t)=>j(`PUT`,`/api/prompts/team/${encodeURIComponent(e)}`,t),deleteTeamPrompt:e=>j(`DELETE`,`/api/prompts/team/${encodeURIComponent(e)}`),agentPrompt:e=>j(`GET`,`/api/prompts/agent/${encodeURIComponent(e)}`),prompt:e=>j(`GET`,`/api/prompts/${encodeURIComponent(e)}`),savePrompt:(e,t)=>j(`PUT`,`/api/prompts/${encodeURIComponent(e)}`,{text:t}),resetPrompt:e=>j(`DELETE`,`/api/prompts/${encodeURIComponent(e)}`),skills:()=>j(`GET`,`/api/skills`),skill:e=>j(`GET`,`/api/skills/${encodeURIComponent(e)}`),addSkill:e=>j(`POST`,`/api/skills`,e),saveSkill:(e,t)=>j(`PUT`,`/api/skills/${encodeURIComponent(e)}`,t),removeSkill:e=>j(`DELETE`,`/api/skills/${encodeURIComponent(e)}`),registry:()=>j(`GET`,`/api/registry`),logs:()=>j(`GET`,`/api/logs`),log:e=>j(`GET`,`/api/logs/${encodeURIComponent(e)}`),audit:()=>j(`GET`,`/api/audit`),tokenomics:()=>j(`GET`,`/api/tokenomics`)},G={start:(e,t,n,r)=>j(`POST`,`/api/chats`,{text:e,...t,...n?{page:n}:{},...r?{context:r}:{}}),list:()=>j(`GET`,`/api/chats`),events:(e,t,n)=>j(`GET`,`/api/chats/${encodeURIComponent(e)}?after=${t}${n?`&wait=1`:``}`),send:(e,t,n)=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/messages`,{text:t,...n?{context:n}:{}}),answer:(e,t,n)=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/answer`,{ask:t,choice:n}),proceed:(e,t,n)=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/continue`,{wait:t,ok:n}),stop:e=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/stop`,{}),pause:(e,t)=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/${t?`pause`:`resume`}`,{}),settings:(e,t)=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/settings`,t),screen:(e,t,n)=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/screen`,{read:t,text:n}),model:(e,t)=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/model`,{profile:t}),close:e=>j(`DELETE`,`/api/chats/${encodeURIComponent(e)}`),refresh:e=>j(`POST`,`/api/chats/${encodeURIComponent(e)}/refresh`,{}),files:(e,t={})=>j(`GET`,`/api/chat/files?q=${encodeURIComponent(e)}${t.chat?`&chat=${encodeURIComponent(t.chat)}`:``}${t.code===!1?`&code=0`:``}`),attachFile:(e,t={})=>j(`POST`,`/api/chat/files`,{...e,...t}),dropFile:(e,t={})=>j(`DELETE`,`/api/chat/files`,{path:e,...t}),openFile:(e,t={})=>j(`POST`,`/api/chat/files/open`,{path:e,...t})},K={view:()=>j(`GET`,`/api/knowledge/graph`),search:(e,t)=>j(`GET`,`/api/knowledge/graph/search?q=${encodeURIComponent(e)}${t?`&kind=${encodeURIComponent(t)}`:``}`),part:e=>j(`GET`,`/api/knowledge/graph/part?id=${encodeURIComponent(e)}`),build:()=>j(`POST`,`/api/knowledge/graph/build`,{action:`build`}),understand:()=>j(`POST`,`/api/knowledge/graph/build`,{action:`model`,confirmed:!0}),stop:()=>j(`POST`,`/api/knowledge/graph/stop`)},ce={view:()=>j(`GET`,`/api/knowledge/product`),feedback:(e,t,n)=>j(`POST`,`/api/knowledge/feedback`,{id:e,verdict:t,...n?{note:n}:{}})},le={view:()=>j(`GET`,`/api/knowledge/landscape`),decide:(e,t,n)=>j(`POST`,`/api/knowledge/systems`,{repo:e,verdict:t,...n?{system:n}:{}})},ue={overview:()=>j(`GET`,`/api/evidence`),monitor:e=>j(`GET`,`/api/evidence/monitor${e?`?agent=${encodeURIComponent(e)}`:``}`),audit:e=>j(`GET`,`/api/evidence/audit?agent=${encodeURIComponent(e)}`),baseline:(e,t,n)=>j(`POST`,`/api/evidence/baseline`,{agent:e,confirm:t,reason:n}),trust:(e,t,n,r)=>j(`POST`,`/api/evidence/trust`,{agent:e,level:t,confirm:n,reason:r}),learn:e=>j(`GET`,`/api/evidence/learn?agent=${encodeURIComponent(e)}`),replay:(e,t,n,r)=>j(`POST`,`/api/evidence/replay`,{agent:e,run:t,hypothesis:n,replays:r}),decide:(e,t,n,r)=>j(`POST`,`/api/evidence/decide`,{agent:e,proposal:t,decision:n,reason:r}),dashboard:e=>j(`GET`,`/api/evidence/dashboard?agent=${encodeURIComponent(e)}`),runs:()=>j(`GET`,`/api/evidence/runs`),run:e=>j(`GET`,`/api/evidence/run?id=${encodeURIComponent(e)}`),verdict:e=>j(`GET`,`/api/evidence/verdict?id=${encodeURIComponent(e)}`),review:()=>j(`GET`,`/api/evidence/review`),releases:()=>j(`GET`,`/api/evidence/releases`),release:(e,t,n)=>j(`GET`,`/api/evidence/release?agent=${encodeURIComponent(e)}&candidate=${encodeURIComponent(t)}${n?`&live=${encodeURIComponent(n)}`:``}`),overrule:(e,t,n)=>j(`POST`,`/api/evidence/overrule`,{run:e,finding:t,reason:n}),drafts:()=>j(`GET`,`/api/evidence/drafts`),decideDraft:(e,t,n,r)=>j(`POST`,`/api/evidence/draft`,{id:e,decision:t,confirm:n,reason:r}),grade:(e,t,n,r)=>j(`POST`,`/api/evidence/grade`,{run:e,criterion:t,grade:n,reason:r}),contracts:()=>j(`GET`,`/api/evidence/contracts`)},de={view:()=>j(`GET`,`/api/knowledge/engineering`),service:e=>j(`GET`,`/api/knowledge/engineering/service?repo=${encodeURIComponent(e)}`),impact:e=>j(`GET`,`/api/knowledge/engineering/impact?id=${encodeURIComponent(e)}`),path:(e,t)=>j(`GET`,`/api/knowledge/engineering/path?from=${encodeURIComponent(e)}&to=${encodeURIComponent(t)}`),codeMap:e=>j(`GET`,`/api/knowledge/engineering/codemap${e?`?repo=${encodeURIComponent(e)}`:``}`),files:e=>j(`GET`,`/api/knowledge/engineering/files${e?`?repo=${encodeURIComponent(e)}`:``}`),churn:()=>j(`GET`,`/api/knowledge/engineering/churn`)},fe={knowledge:()=>j(`GET`,`/api/knowledge`),knowledgeFile:e=>j(`GET`,`/api/knowledge/file?rel=${encodeURIComponent(e)}`),saveKnowledgeFile:(e,t)=>j(`PUT`,`/api/knowledge/file`,{rel:e,text:t}),docsStatus:()=>j(`GET`,`/api/docs/status`),indexDocs:()=>j(`POST`,`/api/docs/index`),searchDocs:(e,t={})=>j(`POST`,`/api/docs/search`,{query:e,...t}),docOutline:e=>j(`GET`,`/api/docs/outline?rel=${encodeURIComponent(e)}`),docFile:(e,t)=>j(`GET`,`/api/docs/file?source=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`),memory:()=>j(`GET`,`/api/memory`),clearMemory:e=>j(`POST`,`/api/memory/clear`,{...e?{target:e.name,kind:e.kind}:{},confirmed:!0})},pe={get:()=>j(`GET`,`/api/theme`),uploadLogo:(e,t,n=`logo`)=>j(`POST`,`/api/theme/logo`,{data:e,type:t,which:n}),fromUrl:e=>j(`POST`,`/api/theme/from-url`,{url:e})},me={convert:(e,t)=>j(`POST`,`/api/environments/convert`,{...e,...t?{name:t}:{}}),files:e=>j(`GET`,`/api/environments/files?kind=${e}`)},he={get:()=>j(`GET`,`/api/workspace`)},ge={open:e=>j(`POST`,`/api/files/open`,{path:e})},_e={list:()=>j(`GET`,`/api/reports`),build:()=>j(`POST`,`/api/reports/project/build`),buildStatus:()=>j(`GET`,`/api/reports/project/build`)},ve={list:()=>j(`GET`,`/api/jobs`),detail:e=>j(`GET`,`/api/jobs/${encodeURIComponent(e)}`),log:(e,t)=>j(`GET`,`/api/jobs/${encodeURIComponent(e)}/log?tail=400${t?`&run=${encodeURIComponent(t)}`:``}`),add:e=>j(`POST`,`/api/jobs`,e),act:(e,t)=>j(`POST`,`/api/jobs/${encodeURIComponent(e)}/${t}`),remove:e=>j(`DELETE`,`/api/jobs/${encodeURIComponent(e)}`)},ye={list:()=>j(`GET`,`/api/runs`),detail:e=>j(`GET`,`/api/runs/${encodeURIComponent(e)}`),cancel:e=>j(`POST`,`/api/runs/${encodeURIComponent(e)}/cancel`)},be={get:()=>j(`GET`,`/api/record`),mobileDevices:(e,t,n=!1)=>j(`GET`,`/api/record/mobile/devices?place=${encodeURIComponent(e)}&app=${encodeURIComponent(t)}${n?`&fresh=1`:``}`),review:e=>j(`GET`,`/api/record/review?run=${encodeURIComponent(e)}`),saveReview:(e,t)=>j(`POST`,`/api/record/review`,{run:e,...t}),restoreReview:(e,t)=>j(`POST`,`/api/record/review`,{run:e,restore:t}),suggest:e=>j(`POST`,`/api/record/suggest`,{run:e}),useBlock:(e,t,n)=>j(`POST`,`/api/record/review`,{run:e,useBlock:{block:t,from:n}}),insertBlock:(e,t,n,r)=>j(`POST`,`/api/record/review`,{run:e,insert:{after:t,block:n,...r}}),peekSteps:e=>j(`GET`,`/api/record/review?run=${encodeURIComponent(e)}&peek=1`),copyStep:(e,t,n,r)=>j(`POST`,`/api/record/review`,{run:e,copyFrom:{run:t,index:n,after:r}}),refreshBlock:(e,t,n)=>j(`POST`,`/api/record/review`,{run:e,refreshBlock:{block:t,from:n}}),blocks:()=>j(`GET`,`/api/record/blocks`),saveBlock:(e,t,n,r,i)=>j(`POST`,`/api/record/blocks`,{run:e,name:t,from:n,to:r,...i?{section:i}:{}}),updateBlock:(e,t)=>j(`POST`,`/api/record/blocks/update`,{id:e,...t}),deleteBlock:(e,t=!1)=>j(`POST`,`/api/record/blocks/delete`,{id:e,...t?{confirmed:!0}:{}}),playBlock:(e,t)=>j(`POST`,`/api/record/command`,{cmd:`play_block`,block:{id:e,...t}}),deleteRecordings:e=>j(`POST`,`/api/record/delete`,{runs:e,confirmed:!0}),exportRecording:e=>M(`GET`,`/api/record/export?run=${encodeURIComponent(e)}`),importRecording:e=>j(`POST`,`/api/record/import`,{text:e}),tryView:e=>j(`GET`,`/api/record/try?run=${encodeURIComponent(e)}`),tryRun:(e,t,n,r)=>j(`POST`,`/api/record/try`,{run:e,...t?{env:t}:{},data:n,...r?{each:r}:{}}),write:(e,t)=>j(`POST`,`/api/record/write`,{run:e,check:t.check,...t.env?{env:t.env}:{},...t.data?{data:t.data}:{},...t.each?{each:t.each}:{}}),stopWrite:e=>j(`POST`,`/api/record/write/stop`,{run:e}),reheal:(e,t,n,r)=>j(`POST`,`/api/record/reheal`,{run:e,...t?{env:t}:{},data:n,...r?{each:r}:{}}),acceptReheals:(e,t)=>j(`POST`,`/api/record/reheal/accept`,{run:e,...t.length?{steps:t}:{}}),tryStop:e=>j(`POST`,`/api/record/try/stop`,{run:e}),shot:(e,t)=>Q(`/api/record/shot?run=${encodeURIComponent(e)}&shot=${encodeURIComponent(t)}`,`image/jpeg`),tryShot:(e,t)=>{let n=`/api/record/shot?run=${encodeURIComponent(e)}&kind=try&shot=${String(t).padStart(3,`0`)}`;return Q(n,`image/jpeg`).catch(()=>Q(n,`image/png`))},openVideo:(e,t)=>j(`POST`,`/api/record/video/open`,{run:e,kind:t}),openLog:(e,t)=>j(`POST`,`/api/record/log/open`,{run:e,which:t}),openTrace:e=>j(`POST`,`/api/record/trace/open`,{run:e}),screen:()=>Q(`/api/record/screen`,`image/png`),start:e=>j(`POST`,`/api/record`,e),command:e=>j(`POST`,`/api/record/command`,e)},xe={list:()=>j(`GET`,`/api/packs`),detail:e=>j(`GET`,`/api/packs/${encodeURIComponent(e)}`),build:e=>j(`POST`,`/api/packs/build`,e),run:(e,t)=>j(`POST`,`/api/packs/${encodeURIComponent(e)}/run`,{on:t}),heal:(e,t)=>j(`POST`,`/api/packs/${encodeURIComponent(e)}/heal`,{tests:t}),stop:()=>j(`POST`,`/api/packs/stop`,{}),answer:(e,t)=>j(`POST`,`/api/packs/answer`,{id:e,choice:t}),edit:(e,t)=>j(`POST`,`/api/packs/${encodeURIComponent(e)}/edit`,t),refresh:e=>j(`POST`,`/api/packs/${encodeURIComponent(e)}/refresh`,{}),compare:(e,t)=>j(`GET`,`/api/packs/${encodeURIComponent(e)}/compare?with=${encodeURIComponent(t)}`)},Se={view:()=>j(`GET`,`/api/desktop`),replay:e=>j(`POST`,`/api/desktop/replay`,e),explore:(e,t,n)=>j(`POST`,`/api/desktop/explore`,{app:e,goal:t,name:n,confirmed:!0}),validate:e=>j(`POST`,`/api/desktop/validate`,{workflow:e}),setup:e=>j(`POST`,`/api/desktop/setup`,{...e,confirmed:!0}),doctor:()=>j(`POST`,`/api/desktop/doctor`,{}),acceptHeals:e=>j(`POST`,`/api/desktop/heals`,{run:e}),addApp:e=>j(`POST`,`/api/desktop/apps`,e),steps:e=>j(`GET`,`/api/desktop/steps?workflow=${encodeURIComponent(e)}`),editStep:e=>j(`POST`,`/api/desktop/steps/edit`,e),restore:(e,t,n)=>j(`POST`,`/api/desktop/restore`,{workflow:e,backup:t,...n?{version:n}:{}}),saveBlock:(e,t,n,r,i)=>j(`POST`,`/api/desktop/blocks`,{workflow:e,from:t,to:n,name:r,...i?{section:i}:{}}),review:e=>j(`GET`,`/api/desktop/review?workflow=${encodeURIComponent(e)}`),controls:(e,t)=>j(`GET`,`/api/desktop/controls?run=${encodeURIComponent(e)}&step=${t}`),shot:(e,t)=>Q(`/api/desktop/shot?run=${encodeURIComponent(e)}&step=${t}`,`image/png`),editApp:e=>j(`POST`,`/api/desktop/apps/edit`,e),removeApp:(e,t)=>j(`POST`,`/api/desktop/apps/remove`,{name:e,confirmed:t}),browse:()=>j(`POST`,`/api/desktop/browse`,{}),stop:()=>j(`POST`,`/api/desktop/stop`,{}),answer:(e,t)=>j(`POST`,`/api/desktop/answer`,{id:e,choice:t})},Ce={view:()=>j(`GET`,`/api/mobile`),live:()=>j(`GET`,`/api/mobile/live`),screen:e=>Q(`/api/mobile/live/screen?id=${encodeURIComponent(e)}`,`image/png`),replay:e=>j(`POST`,`/api/mobile/replay`,e),explore:e=>j(`POST`,`/api/mobile/explore`,{...e,confirmed:!0}),maestro:(e,t)=>j(`POST`,`/api/mobile/maestro`,{flows:e,...t?.length?{devices:t}:{}}),validate:e=>j(`POST`,`/api/mobile/validate`,{workflow:e}),keepDevices:(e,t)=>j(`POST`,`/api/mobile/devices/keep`,{app:e,picks:t}),setup:e=>j(`POST`,`/api/mobile/setup`,{force:e,confirmed:!0}),doctor:()=>j(`POST`,`/api/mobile/doctor`,{}),upload:e=>j(`POST`,`/api/mobile/upload`,{...e,confirmed:!0}),stop:()=>j(`POST`,`/api/mobile/stop`,{}),answer:(e,t)=>j(`POST`,`/api/mobile/answer`,{id:e,choice:t}),chatDevice:e=>j(`GET`,`/api/chats/${encodeURIComponent(e)}/device`),chatScreen:(e,t)=>Q(`/api/chats/${encodeURIComponent(e)}/device/screen?id=${encodeURIComponent(t)}`,`image/png`)},q=e=>`/api/migrations/${encodeURIComponent(e)}`,we={list:()=>j(`GET`,`/api/migrations`),testRepository:(e,t)=>j(`POST`,`/api/migrations/sources/test`,{url:e,tokenVar:t}),source:e=>j(`POST`,`/api/migrations/sources`,e),files:(e,t)=>j(`POST`,`/api/migrations/sources/${encodeURIComponent(e)}/files`,{files:t}),finish:e=>j(`POST`,`/api/migrations/sources/${encodeURIComponent(e)}/finish`,{}),discover:(e,t)=>j(`GET`,`/api/migrations/discover?${new URLSearchParams({...e?{workspace:e}:{},from:t})}`),plan:e=>j(`POST`,`/api/migrations/plan`,e),detail:e=>j(`GET`,q(e)),events:(e,t)=>j(`GET`,`${q(e)}/events?after=${t}`),pair:(e,t)=>j(`GET`,`${q(e)}/files?unit=${encodeURIComponent(t)}`),report:e=>j(`GET`,`${q(e)}/report`),start:(e,t,n)=>j(`POST`,`${q(e)}/start`,{confirm:t,acceptLimits:n}),verify:e=>j(`POST`,`${q(e)}/verify`,{}),fix:(e,t,n)=>j(`POST`,`${q(e)}/fix`,{units:t,note:n}),stop:e=>j(`POST`,`${q(e)}/stop`,{}),delete:(e,t)=>j(`POST`,`${q(e)}/delete`,{confirm:t})},J=e=>`/api/tosca/assistant/${encodeURIComponent(e)}`,Te={start:e=>j(`POST`,`/api/tosca/assistant`,{text:e}),view:e=>j(`GET`,J(e)),say:(e,t)=>j(`POST`,J(e),{text:t}),pick:(e,t,n)=>j(`POST`,J(e),{question:t,pick:n}),token:(e,t)=>j(`POST`,J(e),{tokenVar:t}),end:e=>j(`DELETE`,J(e))},Y=e=>`/api/tosca/${encodeURIComponent(e)}`,X={list:()=>j(`GET`,`/api/tosca`),inspect:(e,t)=>j(`POST`,`/api/tosca/inspect`,{file:e,testAttributes:t}),inspectSources:(e,t)=>j(`POST`,`/api/tosca/inspect`,{sources:e,testAttributes:t}),clone:(e,t,n)=>j(`POST`,`/api/tosca/sources/git`,{url:e,...t?{branch:t}:{},...n?{tokenVar:n}:{}}),removeClone:e=>j(`DELETE`,`/api/tosca/sources/${encodeURIComponent(e)}`),adopt:e=>j(`POST`,`/api/tosca/sources/${encodeURIComponent(e)}/adopt`),plan:e=>j(`POST`,`/api/tosca/plan`,e),detail:e=>j(`GET`,Y(e)),events:(e,t)=>j(`GET`,`${Y(e)}/events?after=${t}`),case:(e,t)=>j(`GET`,`${Y(e)}/case?id=${encodeURIComponent(t)}`),estimate:e=>j(`GET`,`${Y(e)}/estimate`),ci:(e,t)=>j(`GET`,`${Y(e)}/ci?kind=${t}`),writeCi:(e,t)=>j(`POST`,`${Y(e)}/ci`,{kind:t}),data:e=>j(`GET`,`${Y(e)}/data`),setData:(e,t)=>j(`POST`,`${Y(e)}/data`,t),pr:(e,t=``)=>j(`GET`,`${Y(e)}/pr${t?`?base=${encodeURIComponent(t)}`:``}`),openPr:(e,t)=>j(`POST`,`${Y(e)}/pr`,t),reimport:(e,t)=>j(`POST`,`${Y(e)}/reimport`,{refresh:t}),ready:e=>j(`GET`,`${Y(e)}/ready`),answer:(e,t)=>j(`POST`,`${Y(e)}/ready`,t),report:e=>j(`GET`,`${Y(e)}/report`),reportCase:(e,t)=>j(`GET`,`${Y(e)}/report-case?id=${encodeURIComponent(t)}`),reportZip:async e=>{await S;let t=await fetch(`${Y(e)}/report-zip`,{headers:{Authorization:`Bearer ${g()}`}});if(!t.ok)throw new T(await t.json().then(e=>e.error,()=>void 0)||`The zip could not be made (HTTP ${t.status}).`,t.status);return t.blob()},reportHtml:async e=>{await S;let t=await fetch(`${Y(e)}/report-html`,{headers:{Authorization:`Bearer ${g()}`}});if(!t.ok)throw new T(`The HTML report could not be made (HTTP ${t.status}).`,t.status);return t.blob()},evidenceUrl:(e,t,n)=>`${Y(e)}/evidence/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,evidence:(e,t,n)=>Q(X.evidenceUrl(e,t,n),De(n)),start:(e,t,n,r)=>j(`POST`,`${Y(e)}/start`,{confirm:t,acceptLimits:n,...r?{batch:r}:{}}),fix:(e,t,n)=>j(`POST`,`${Y(e)}/fix`,{units:t,note:n}),stop:e=>j(`POST`,`${Y(e)}/stop`,{}),verify:(e,t,n)=>j(`POST`,`${Y(e)}/verify`,{...t?{suite:t}:{},...n?.length?{units:n}:{}}),delete:(e,t)=>j(`POST`,`${Y(e)}/delete`,{confirm:t})},Z=(e,t)=>`/api/apitests/${encodeURIComponent(e)}/${t}`,Ee={view:()=>j(`GET`,`/api/apitests`),set:e=>j(`GET`,`/api/apitests/${encodeURIComponent(e)}`),contracts:e=>j(`POST`,`/api/apitests/contracts`,e),run:(e,t)=>j(`POST`,Z(e,`run`),t),runAll:(e,t)=>j(`POST`,Z(e,`run-all`),t),scenarios:(e,t)=>j(`POST`,Z(e,`scenarios`),t),runScenarios:(e,t)=>j(`POST`,Z(e,`run-scenarios`),t),stop:()=>j(`POST`,`/api/apitests/stop`,{}),send:(e,t)=>j(`POST`,Z(e,`send`),t),preview:(e,t)=>j(`POST`,Z(e,`preview`),t),save:(e,t)=>j(`POST`,Z(e,`save`),t),signInSave:(e,t)=>j(`POST`,Z(e,`sign-in-save`),{signIn:t}),signInRemove:(e,t)=>j(`POST`,Z(e,`sign-in-remove`),{name:t}),expectFrom:(e,t)=>j(`POST`,Z(e,`expect-from`),t),add:(e,t)=>j(`POST`,Z(e,`add`),t),rename:(e,t)=>j(`POST`,Z(e,`rename`),t),remove:(e,t)=>j(`POST`,Z(e,`remove`),{call:t}),renameFolder:(e,t,n)=>j(`POST`,Z(e,`folder-rename`),{folder:t,to:n}),removeFolder:(e,t)=>j(`POST`,Z(e,`folder-remove`),{folder:t}),deleteSet:e=>j(`POST`,Z(e,`delete`),{confirmed:!0}),auth:(e,t)=>j(`POST`,Z(e,`auth`),t),base:(e,t)=>j(`POST`,Z(e,`base`),t),prefs:(e,t)=>j(`POST`,Z(e,`prefs`),t),saveFlow:(e,t)=>j(`POST`,Z(e,`flow-save`),{flow:t}),removeFlow:(e,t)=>j(`POST`,Z(e,`flow-remove`),{flow:t}),importCollection:(e,t)=>j(`POST`,`/api/apitests/import`,{collection:e,...t?{name:t}:{}}),exportCollection:e=>j(`GET`,Z(e,`postman`)),specFile:(e,t)=>j(`POST`,`/api/apitests/spec-file`,{name:e,text:t})};async function Q(e,t=`image/png`){await S;let n=await fetch(e,{headers:{Authorization:`Bearer ${g()}`}}),r=(n.headers.get(`content-type`)||``).split(`;`)[0].trim();if(!n.ok||r!==t)throw new T(`The image could not be loaded.`,n.status);let i=new Blob([await n.arrayBuffer()],{type:t}),a=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(String(n.result)),n.onerror=()=>t(new T(`The image could not be read.`,0)),n.readAsDataURL(i)});if(!a.startsWith(`data:${t};base64,`))throw new T(`The image could not be read.`,0);return a}function De(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return t===`.jpg`||t===`.jpeg`?`image/jpeg`:t===`.webp`?`image/webp`:t===`.webm`?`video/webm`:t===`.mp4`?`video/mp4`:`image/png`}var Oe={view:()=>j(`GET`,`/api/quality`),run:e=>j(`GET`,`/api/quality/${encodeURIComponent(e)}`),compare:e=>j(`POST`,`/api/quality/${encodeURIComponent(e)}/compare`,{}),approve:(e,t,n)=>j(`POST`,`/api/quality/${encodeURIComponent(e)}/approve`,{pages:t,...n?{reason:n}:{}}),image:(e,t,n)=>Q(`/api/quality/${encodeURIComponent(e)}/image/${t}/${n}`),shot:(e,t)=>Q(`/api/quality/${encodeURIComponent(e)}/${t.split(`/`).map(encodeURIComponent).join(`/`)}`,`image/jpeg`)},ke={view:()=>j(`GET`,`/api/perf`),predict:(e,t)=>j(`GET`,`/api/perf/predict?plan=${encodeURIComponent(e)}${t?.length?`&users=${t.join(`,`)}`:``}`),plan:(e,t)=>j(`GET`,`/api/perf/plan?plan=${encodeURIComponent(e)}${t?`&env=${encodeURIComponent(t)}`:``}`),run:(e,t)=>j(`GET`,`/api/perf/run?plan=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`),baseline:(e,t,n)=>j(`POST`,`/api/perf/baseline`,{plan:e,id:t,confirmed:!0,...n?{reason:n}:{}}),report:(e,t)=>j(`POST`,`/api/perf/report`,{plan:e,id:t}),analyse:(e,t)=>j(`POST`,`/api/perf/analyse`,{plan:e,id:t}),convert:e=>j(`POST`,`/api/perf/convert`,e),exportLoadRunner:e=>j(`POST`,`/api/perf/export`,e),import:e=>j(`POST`,`/api/perf/import`,e),setup:()=>j(`POST`,`/api/perf/setup`,{confirmed:!0}),start:e=>j(`POST`,`/api/perf/run`,e),stop:()=>j(`POST`,`/api/perf/stop`,{}),strategies:()=>j(`GET`,`/api/perf/strategies`),strategy:e=>j(`GET`,`/api/perf/strategy?id=${encodeURIComponent(e)}`),draftStrategy:(e,t)=>j(`POST`,`/api/perf/strategy`,{request:e,...t?{nfr_file:t.file,...t.sheet?{sheet:t.sheet}:{}}:{}}),strategySummary:e=>j(`GET`,`/api/perf/strategy/summary?id=${encodeURIComponent(e)}`),linkStrategyRun:(e,t,n,r)=>j(`POST`,`/api/perf/strategy/link`,{id:e,test:t,plan:n,...r?{run:r}:{}}),markStrategyNfr:(e,t,n,r)=>j(`POST`,`/api/perf/strategy/mark`,{id:e,nfr:t,status:n,note:r}),exportStrategySummary:e=>j(`POST`,`/api/perf/strategy/summary/export`,{id:e}),checkStrategy:(e,t,n)=>j(`GET`,`/api/perf/strategy/check?id=${encodeURIComponent(e)}&plan=${encodeURIComponent(t)}${n?`&run=${encodeURIComponent(n)}`:``}`),approveStrategy:(e,t,n)=>j(`POST`,`/api/perf/strategy/approve`,{id:e,typed:t,digest:n}),writeStrategy:e=>j(`POST`,`/api/perf/strategy/write`,{id:e})},Ae={view:(e,t)=>j(`GET`,`/api/test-cases?${new URLSearchParams({system:e,story:t})}`),preview:(e,t,n)=>j(`POST`,`/api/test-cases/preview`,{system:e,story:t,changes:n}),apply:(e,t,n)=>j(`POST`,`/api/test-cases/apply`,{system:e,story:t,changes:n,confirmed:!0}),tryMapping:(e,t,n)=>j(`POST`,`/api/test-cases/try-mapping`,{system:e,key:t,value:n})},je={personas:()=>j(`GET`,`/api/a11y/personas`),sessions:()=>j(`GET`,`/api/a11y/sessions`),session:e=>j(`GET`,`/api/a11y/sessions/${encodeURIComponent(e)}`)},Me=[`sme`,`end_user`,`specialist`,`business_user`],Ne=[`novice`,`intermediate`,`expert`],Pe=[`legitimate`,`opportunistic`,`adversarial`],Fe=[`low`,`medium`,`high`],Ie={list:()=>j(`GET`,`/api/personas`),draft:e=>j(`POST`,`/api/personas/draft`,e),exportFile:()=>j(`GET`,`/api/personas/export`),importFile:e=>j(`POST`,`/api/personas/import`,{text:e}),save:e=>j(`POST`,`/api/personas`,{persona:e}),update:(e,t)=>j(`POST`,`/api/personas/update`,{id:e,persona:t}),resources:()=>j(`GET`,`/api/personas/resources`),suggest:e=>j(`GET`,`/api/personas/suggest?id=${encodeURIComponent(e)}`),own:e=>j(`GET`,`/api/personas/own?id=${encodeURIComponent(e)}`),draftOwn:e=>j(`POST`,`/api/personas/own/draft`,{id:e}),saveOwn:(e,t)=>j(`POST`,`/api/personas/own/save`,{id:e,items:t}),removeOwn:(e,t,n)=>j(`POST`,`/api/personas/own/remove`,{id:e,kind:t,name:n})},Le={view:()=>j(`GET`,`/api/data`),log:(e=500)=>j(`GET`,`/api/data/log?limit=${e}`),impact:e=>j(`GET`,`/api/data/impact?of=${encodeURIComponent(e)}`),stop:()=>j(`POST`,`/api/data/stop`,{}),run:(e,t)=>j(`POST`,`/api/data/${e}`,t)},Re={view:()=>j(`GET`,`/api/features`),detail:e=>j(`GET`,`/api/features/${encodeURIComponent(e)}`),scope:(e,t)=>j(`POST`,`/api/features/${encodeURIComponent(e)}/scope`,{to:t})},ze={job:()=>j(`GET`,`/api/refine`),start:(e,t)=>j(`POST`,`/api/refine`,{text:e,key:t}),stop:()=>j(`POST`,`/api/refine/stop`,{})},Be={view:()=>j(`GET`,`/api/about`),generated:()=>j(`GET`,`/api/generated`),run:(e,t={})=>j(`POST`,`/api/about/${e}`,t),stop:()=>j(`POST`,`/api/about/stop`,{}),restart:()=>j(`POST`,`/api/about/restart`,{confirmed:!0})},Ve={view:e=>j(`GET`,`/api/feedback${e?`?session=${encodeURIComponent(e)}`:``}`),draft:e=>j(`POST`,`/api/feedback/draft`,e),text:e=>j(`POST`,`/api/feedback/text`,{draft:e}),send:e=>j(`POST`,`/api/feedback/send`,e)},$={tools:e=>j(`GET`,`/api/agents/${encodeURIComponent(e)}`),directory:()=>j(`GET`,`/api/agents`)},He={get:()=>j(`GET`,`/api/signin`),start:e=>j(`POST`,`/api/signin`,{system:e}),answer:(e,t)=>j(`POST`,`/api/signin/answer`,{id:e,value:t}),cancel:()=>j(`POST`,`/api/signin/cancel`,{}),signOut:e=>j(`POST`,`/api/signout`,{system:e})},Ue={get:()=>j(`GET`,`/api/copilot`),signIn:e=>j(`POST`,`/api/copilot/signin`,{how:e}),answer:(e,t)=>j(`POST`,`/api/copilot/signin/answer`,{id:e,value:t}),cancel:()=>j(`POST`,`/api/copilot/signin/cancel`,{}),signOut:()=>j(`POST`,`/api/copilot/signout`,{}),models:()=>j(`GET`,`/api/copilot/models`),syncModels:()=>j(`POST`,`/api/copilot/models/sync`,{})},We={list:()=>j(`GET`,`/api/teams`),view:e=>j(`GET`,`/api/teams/${encodeURIComponent(e)}`),act:(e,t,n)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/${t}`,n),ask:(e,t)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/ask`,{words:t}),try:(e,t)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/try`,{words:t}),sharedFile:(e,t,n)=>j(`GET`,`/api/teams/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/files/${encodeURIComponent(n)}`),choices:()=>j(`GET`,`/api/teams/_choices`),propose:e=>j(`POST`,`/api/teams/_propose`,{goal:e}),create:e=>j(`POST`,`/api/teams`,{fields:e}),save:(e,t)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/save`,{fields:t}),own:(e,t)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/own`,t),ownAll:()=>j(`GET`,`/api/teams/_own`),look:(e,t)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/look`,{look:t}),image:(e,t,n)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/image`,n===null?{slot:t,remove:!0}:{slot:t,data:n}),remove:(e,t)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/delete`,{confirm:t}),canvas:(e,t)=>j(`POST`,`/api/teams/${encodeURIComponent(e)}/canvas`,{positions:t})},Ge={list:()=>j(`GET`,`/api/custom-agents`),bulk:(e,t,n)=>j(`POST`,`/api/custom-agents/bulk`,{action:e,ids:t,confirm:n}),view:e=>j(`GET`,`/api/custom-agents/${encodeURIComponent(e)}`),audit:async e=>{await S;let t=await fetch(`/api/custom-agents/${encodeURIComponent(e)}/audit`,{headers:{Authorization:`Bearer ${g()}`}});if(!t.ok)throw new T(`Its record could not be read (HTTP ${t.status}).`,t.status);return t.text()},checks:{job:()=>j(`GET`,`/api/agent-checks`),start:e=>j(`POST`,`/api/agent-checks/${encodeURIComponent(e)}`,{}),stop:()=>j(`POST`,`/api/agent-checks/stop`,{}),answer:(e,t)=>j(`POST`,`/api/agent-checks/answer`,{id:e,choice:t})},version:(e,t)=>j(`GET`,`/api/custom-agents/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}`),duplicate:(e,t={})=>j(`POST`,`/api/custom-agents/${encodeURIComponent(e)}/duplicate`,t),pack:async e=>{await S;let t=await fetch(`/api/custom-agents/${encodeURIComponent(e)}/pack`,{headers:{Authorization:`Bearer ${g()}`}});if(!t.ok)throw new T(`Its package could not be read (HTTP ${t.status}).`,t.status);return t.blob()},importPreview:(e,t)=>j(`POST`,`/api/custom-agents/import/preview`,{pack:{base64:e},...t?{id:t}:{}}),importPack:(e,t={})=>j(`POST`,`/api/custom-agents/import`,{pack:{base64:e},...t}),choices:()=>j(`GET`,`/api/custom-agents/choices`),validate:e=>j(`POST`,`/api/custom-agents/validate`,{fields:e}),save:(e,t)=>j(`POST`,`/api/custom-agents`,{fields:e,...t}),library:{list:()=>j(`GET`,`/api/custom-agents/_library`),pack:e=>j(`GET`,`/api/custom-agents/_library/${encodeURIComponent(e)}`),publish:e=>j(`POST`,`/api/custom-agents/${encodeURIComponent(e)}/publish`),remove:(e,t)=>j(`POST`,`/api/custom-agents/_library/remove`,{entry:e,confirm:t})},forget:(e,t)=>j(`POST`,`/api/custom-agents/${encodeURIComponent(e)}/memory`,t),act:(e,t,n)=>j(`POST`,`/api/custom-agents/${encodeURIComponent(e)}/${t}`,n),templates:()=>j(`GET`,`/api/custom-agent-templates`),template:e=>j(`GET`,`/api/custom-agent-templates/${encodeURIComponent(e)}`)},Ke={list:()=>j(`GET`,`/api/agent-builder`),start:e=>j(`POST`,`/api/agent-builder`,{goal:e}),view:e=>j(`GET`,`/api/agent-builder/${encodeURIComponent(e)}`),answer:(e,t,n)=>j(`POST`,`/api/agent-builder/${encodeURIComponent(e)}/${t}`,n),discard:e=>j(`DELETE`,`/api/agent-builder/${encodeURIComponent(e)}`)},qe={list:()=>j(`GET`,`/api/agent-approvals`),answer:(e,t,n)=>j(`POST`,`/api/agent-approvals/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{choice:n})},Je={view:e=>j(`GET`,`/api/impact${e?`?repo=${encodeURIComponent(e)}`:``}`),run:(e,t,n)=>j(`POST`,`/api/impact`,{repo:e,base:t,head:n}),runPr:(e,t)=>j(`POST`,`/api/impact`,{repo:e,pr:t}),check:e=>j(`POST`,`/api/impact/check`,{repo:e}),report:e=>j(`GET`,`/api/impact/report?repo=${encodeURIComponent(e)}`),comment:e=>j(`POST`,`/api/impact/comment`,{repo:e,confirm:!0}),source:(e,t)=>j(`GET`,`/api/impact/source?repo=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`)},Ye={status:()=>j(`GET`,`/api/config/status`)},Xe={view:()=>j(`GET`,`/api/flaky`),quarantine:(e,t,n)=>j(`POST`,`/api/flaky/quarantine`,{tests:e,release:t,confirmed:!0,...n?{reason:n}:{}})},Ze={runs:()=>j(`GET`,`/api/run-diff/runs`),diff:(e,t)=>j(`GET`,`/api/run-diff?a=${encodeURIComponent(e)}&b=${encodeURIComponent(t)}`),shot:(e,t,n)=>Q(`/api/run-diff/${encodeURIComponent(e)}/shot/${t}`,n)},Qe={home:()=>j(`GET`,`/api/basal`),test:e=>j(`GET`,`/api/basal/tests/${encodeURIComponent(e)}`),graph:e=>j(`GET`,`/api/basal/tests/${encodeURIComponent(e)}/graph`),ask:(e,t)=>j(`POST`,`/api/basal/tests`,{request:e,...t?{environment:t}:{}}),stage:(e,t)=>j(`POST`,`/api/basal/tests/${encodeURIComponent(e)}/${t}`,{}),act:(e,t,n)=>j(`POST`,`/api/basal/tests/${encodeURIComponent(e)}/act`,{approved:t,...n?.length?{only:n}:{}}),approve:(e,t)=>j(`POST`,`/api/basal/tests/${encodeURIComponent(e)}/approve`,{typed:t}),observe:(e,t)=>j(`POST`,`/api/basal/tests/${encodeURIComponent(e)}/observe`,t),regraph:e=>j(`POST`,`/api/basal/tests/${encodeURIComponent(e)}/regraph`,{})};export{Ze as $,Re as A,le as B,Ge as C,me as D,de as E,K as F,xe as G,we as H,U as I,ce as J,ke as K,Q as L,ge as M,Xe as N,ue as O,V as P,_e as Q,Je as R,Ue as S,Se as T,Ce as U,fe as V,B as W,be as X,Oe as Y,ze as Z,Ke as _,u as _t,Me as a,w as at,G as b,a as bt,je as c,We as ct,$ as d,pe as dt,ye as et,L as f,X as ft,Qe as g,he as gt,H as h,re as ht,Pe as i,ae as it,Ve as j,I as k,Be as l,P as lt,qe as m,F as mt,E as n,R as nt,Fe as o,He as ot,Ee as p,Te as pt,Ie as q,Ne as r,z as rt,C as s,m as st,T as t,N as tt,W as u,Ae as ut,j as v,t as vt,Le as w,Ye as x,o as xt,M as y,e as yt,ve as z};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{c as n}from"./surface-c1kG1KPS.js";import{n as r,t as i}from"./utils-DJRAScIl.js";import{t as a}from"./jsx-runtime-LKYXHABd.js";import{w as o}from"./api-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{c as n}from"./surface-c1kG1KPS.js";import{n as r,t as i}from"./utils-DJRAScIl.js";import{t as a}from"./jsx-runtime-LKYXHABd.js";import{w as o}from"./api-D1PU4zye.js";import{E as s,F as c,L as l,O as u,d,j as f,k as p,m}from"./pageBack-DfGBh1Hs.js";import{ur as h}from"./line-icons-Cwj9OmCz.js";import{Ht as g,On as _,Vt as v,ct as y,dt as b,lt as x,ot as S,rt as C,ut as w}from"./frame-D0MS2ZMz.js";var T=e(t(),1),E=a(),D={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking Miner for test data`,`Asked Miner for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking Miner`,`Asked Miner`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function O(){let[e,t]=(0,T.useState)(null),[n,r]=(0,T.useState)(``),[i,a]=(0,T.useState)(!1),s=(0,T.useCallback)(()=>{o.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,T.useEffect)(s,[s]);let c=!!e?.job?.running;return(0,T.useEffect)(()=>{if(!c)return;let e=g(s,1e3);return()=>v(e)},[c,s]),{view:e,error:n,busy:i||c,running:c,act:async(e,t)=>{a(!0),r(``);try{await o.run(e,t),s()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void o.stop().then(s),load:s,job:e?.job??null}}var k=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function A({file:e,onNote:t}){return(0,E.jsx)(c,{size:`sm`,"data-tip":e,onClick:async()=>t(await f(e)),className:`font-mono`,children:e.split(/[\\/]/).pop()})}function j({children:e,label:t}){return(0,E.jsx)(`pre`,{"aria-label":t,className:i(d,`m-0 max-h-[320px] whitespace-pre`),children:e})}function M({job:e,onStop:t,words:a}){let[o,s,l]=(a??D)[e.kind]??[`Working`,`Done`,`working`],u=(0,T.useRef)(null);(0,T.useEffect)(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[e.lines.length]);let f=e.exitCode===0,g=!f&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,E.jsxs)(`section`,{"aria-label":e.running?o:s,className:i(n,`flex flex-col gap-2`),children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,E.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?o:s,e.target?(0,E.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,E.jsx)(p,{tone:e.running?`running`:f?`pass`:e.exitCode===2||g?`warn`:`fail`,orb:l,children:e.running?`Working`:f?`Done`:g?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,E.jsxs)(c,{variant:`danger`,onClick:t,children:[(0,E.jsx)(h,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,E.jsxs)(`details`,{open:e.running||!f&&!e.result,children:[(0,E.jsxs)(`summary`,{className:`cursor-pointer text-body-sm text-muted`,children:[`Output (`,r(e.lines.length,`line`),`)`]}),(0,E.jsx)(`code`,{className:`mt-2 block font-mono text-body-sm text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,E.jsx)(`pre`,{ref:u,className:i(d,`mt-2 max-h-[240px]`),children:(0,E.jsx)(m,{text:e.lines.join(`
|
|
2
2
|
`)||`Starting…`})})]})]})}function N({text:e}){return(0,E.jsx)(`p`,{role:`alert`,className:i(l.fail,`m-0`),children:e})}function P({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,E.jsx)(C,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,E.jsx)(`th`,{scope:`col`,className:n[t]?w:x,children:e},e)),children:t.map((e,t)=>(0,E.jsx)(`tr`,{className:b,children:e.map((e,t)=>(0,E.jsx)(`td`,{"data-tip":k(e),className:i(n[t]?y:S,`font-mono text-body-sm`,!n[t]&&`max-w-[320px] truncate`,e==null&&`text-muted`),children:k(e)},t))},t))})}function F({r:e}){return(0,E.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],i=n?.sample||[],a=i.length?Object.keys(i[0]):[];return(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`span`,{className:`text-body-sm`,children:[(0,E.jsx)(`span`,{className:`font-medium`,children:t}),` · `,r(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,E.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,E.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),a.length>0&&(0,E.jsx)(P,{columns:a,rows:i.slice(0,3).map(e=>a.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,E.jsx)(`p`,{className:`m-0 text-body-sm text-warn`,children:e},t))]})}var I={query:`Existing rows`,generate:`New rows`};function L({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,E.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(p,{tone:`pass`,children:I[e.kind||``]||`Answered`}),(0,E.jsxs)(`span`,{className:`min-w-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,E.jsx)(R,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(`span`,{className:`text-body-sm font-medium`,children:`The query, as the database checked it`}),(0,E.jsx)(j,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(`span`,{className:`text-body-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,E.jsx)(j,{label:`INSERT script`,children:e.script_preview.join(`
|
|
3
3
|
`)})]}),e.files?.length?(0,E.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-body-sm`,children:[`Kept`,e.files.map(e=>(0,E.jsx)(A,{file:e,onNote:t},e))]}):null,e.replay&&(0,E.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Tests and pipelines get the same data with `,(0,E.jsx)(`code`,{className:`font-mono text-body-sm text-ink-2`,children:e.replay}),`, without a model.`]})]})}function R({title:e,rows:t,total:n}){let i=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`span`,{className:`text-body-sm`,children:[(0,E.jsx)(`span`,{className:`font-medium`,children:e}),` · `,r(n,`row`),n>t.length?(0,E.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),i.length>0?(0,E.jsx)(P,{columns:i,rows:t.map(e=>i.map(t=>e[t]))}):(0,E.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No rows match.`})]})}function z({items:e,text:t,label:n,size:r=10,children:i}){let[a,o]=(0,T.useState)(``),[c,l]=(0,T.useState)(0),d=a.toLowerCase().split(/\s+/).filter(Boolean),f=d.length?e.filter(e=>d.every(n=>t(e).toLowerCase().includes(n))):e;(0,T.useEffect)(()=>l(0),[a,e.length]);let p=Math.min(c,Math.max(0,Math.ceil(f.length/r)-1));return(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.length>r&&(0,E.jsx)(u,{id:`find-${n.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${n.toLowerCase()}`,value:a,onChange:o,className:`flex-none`}),f.length?(0,E.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.slice(p*r,p*r+r).map(i)}):(0,E.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`Nothing matches.`}),f.length>r&&(0,E.jsx)(s,{page:p,size:r,total:f.length,onPage:l,label:`Pages of ${n.toLowerCase()}`})]})}function B({on:e,set:t,children:n}){return(0,E.jsxs)(`label`,{className:`flex items-center gap-2 text-body-sm text-ink-2`,children:[(0,E.jsx)(_,{checked:e,onChange:t,label:n}),n]})}function V({label:e,hint:t,children:n}){return(0,E.jsxs)(`label`,{className:`flex flex-col gap-2 text-body-sm font-medium`,children:[e,n,t&&(0,E.jsx)(`span`,{className:`text-body-sm font-normal text-muted`,children:t})]})}export{F as a,z as c,R as d,B as f,A as i,N as l,O as m,j as n,M as o,k as p,V as r,I as s,L as t,P as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{P as n}from"./surface-c1kG1KPS.js";import{t as r}from"./utils-DJRAScIl.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{T as a}from"./api-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{P as n}from"./surface-c1kG1KPS.js";import{t as r}from"./utils-DJRAScIl.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{T as a}from"./api-D1PU4zye.js";import{F as o}from"./pageBack-DfGBh1Hs.js";import{At as s}from"./line-icons-Cwj9OmCz.js";var c=e(t(),1),l=i();function u(e){return(e.replace(/(?<![\\/])[\\/]+$/,``).split(/[\\/]/).pop()||``).replace(/\.(exe|app)$/i,``).toLowerCase().replace(/[^a-z0-9_.-]+/g,`-`).replace(/^[^a-z]+/,``).replace(/(?<!-)-+$/,``).slice(0,40)||`app`}function d({value:e,onChange:t,onPicked:i,onError:u,className:d}){let[f,p]=(0,c.useState)(!1),m=async()=>{p(!0),u(``);try{let e=await a.browse();`path`in e?(t(e.path),i?.(e.path,e.name)):`unavailable`in e&&u(e.unavailable)}catch(e){u(e.message)}finally{p(!1)}};return(0,l.jsxs)(`div`,{className:r(`flex min-w-0 gap-2`,d),children:[(0,l.jsx)(n,{"aria-label":`App's path`,value:e,spellCheck:!1,placeholder:`C:\\Program Files\\Contoso\\Billing.exe`,onChange:e=>t(e.target.value),className:`min-w-0 flex-1 font-mono text-body-sm`}),(0,l.jsxs)(o,{busy:f,type:`button`,disabled:f,onClick:()=>void m(),"data-tip":`Choose the app's .exe on this computer`,children:[(0,l.jsx)(s,{"aria-hidden":`true`}),f?`Choosing…`:`Browse…`]})]})}export{u as n,d as t};
|