@capagents/forgeqe 2.8.4 → 2.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/forgeqe.js +1476 -1476
  2. package/dist/web/assets/Agent-DCvSd2XZ.js +4 -0
  3. package/dist/web/assets/ApiTests-BLvFB4cK.js +10 -0
  4. package/dist/web/assets/Chat-B_QahQb2.js +3 -0
  5. package/dist/web/assets/{CommandPalette-BYvOQjLS.js → CommandPalette-Do6qSD_Y.js} +1 -1
  6. package/dist/web/assets/Cost-Cl254YcD.js +1 -0
  7. package/dist/web/assets/Data-Hr3e_onA.js +6 -0
  8. package/dist/web/assets/Evidence-CrKGYdSL.js +1 -0
  9. package/dist/web/assets/{Explore-B4RIFQSP.js → Explore-DtFP2IVA.js} +2 -2
  10. package/dist/web/assets/{Features-PwuXPwsQ.js → Features-CPwubxge.js} +1 -1
  11. package/dist/web/assets/Flags-CuPa3qr7.js +2 -0
  12. package/dist/web/assets/Flaky-CxCLwdBA.js +1 -0
  13. package/dist/web/assets/{ForceGraph-C_zLHbjL.js → ForceGraph-k3615MlF.js} +1 -1
  14. package/dist/web/assets/Impact-BUs5zsKo.js +3 -0
  15. package/dist/web/assets/Jobs-D1GoyJev.js +5 -0
  16. package/dist/web/assets/KindPage-BZZYRP8y.js +6 -0
  17. package/dist/web/assets/Migration-IHAjwFCp.js +2 -0
  18. package/dist/web/assets/Product-DwB4NSAG.js +7 -0
  19. package/dist/web/assets/Production-DKMo0cUW.js +1 -0
  20. package/dist/web/assets/{Quality-BLD_hTzQ.js → Quality-Gf1bVJoJ.js} +1 -1
  21. package/dist/web/assets/{Readiness-BhdZCmc5.js → Readiness-BYuscIL-.js} +1 -1
  22. package/dist/web/assets/Record-OqreQwZ0.js +2 -0
  23. package/dist/web/assets/Regression-BqJPZgW6.js +5 -0
  24. package/dist/web/assets/{Reports-B7_QOXgR.js → Reports-BHfIjZeK.js} +2 -2
  25. package/dist/web/assets/Response-C5u2FRz4.js +4 -0
  26. package/dist/web/assets/{RunDiff-oLQoRUYt.js → RunDiff-gtEx0L6U.js} +1 -1
  27. package/dist/web/assets/Runs-CkeXPqkM.js +2 -0
  28. package/dist/web/assets/{TestCases-BsY_u_c2.js → TestCases-BoMABRKP.js} +1 -1
  29. package/dist/web/assets/TestData-BjpifoSn.js +2 -0
  30. package/dist/web/assets/TestDebt-zPafJuxI.js +1 -0
  31. package/dist/web/assets/Tosca-BqujCHtP.js +2 -0
  32. package/dist/web/assets/{WhatsNew-Bw0a6thL.js → WhatsNew-BZsnBSDX.js} +1 -1
  33. package/dist/web/assets/agentIconBodies-Cpn22UTR.js +1 -0
  34. package/dist/web/assets/{dataParts-Bwftp_1E.js → dataParts-C5dROdX4.js} +3 -3
  35. package/dist/web/assets/{families-CwLTQ9Rz.js → families-DF7po37F.js} +1 -1
  36. package/dist/web/assets/{frame-PaIZHHuH.js → frame-BY4TCOKb.js} +4 -4
  37. package/dist/web/assets/index-2XeVj3Uw.js +45 -0
  38. package/dist/web/assets/index-3D5uDfcc.css +2 -0
  39. package/dist/web/assets/{logos-UVpBu7FK.js → logos-wnjr1dej.js} +1 -1
  40. package/dist/web/assets/{parts-Dxtb4Bbc.js → parts-BGgYgqej.js} +1 -1
  41. package/dist/web/assets/{productParts-BOFjMKqP.js → productParts-CwQk7_05.js} +1 -1
  42. package/dist/web/assets/{qualityParts-B8Ez1Yru.js → qualityParts-D1HM_vxN.js} +1 -1
  43. package/dist/web/assets/segmented-DN6qwHw7.js +1 -0
  44. package/dist/web/assets/{thread-tfPSGuU_.js → thread-z0OCwmPe.js} +1 -1
  45. package/dist/web/assets/{usePageChat-CI-050n8.js → usePageChat-B3HxBsUC.js} +1 -1
  46. package/dist/web/index.html +3 -3
  47. package/package.json +1 -1
  48. package/dist/web/assets/Agent-BNqNqlnh.js +0 -4
  49. package/dist/web/assets/ApiTests-CFBsj4t8.js +0 -10
  50. package/dist/web/assets/Chat-BvvsVyfQ.js +0 -3
  51. package/dist/web/assets/Cost-CQKzgsB4.js +0 -1
  52. package/dist/web/assets/Data-Coon55p7.js +0 -6
  53. package/dist/web/assets/Evidence-Ai0Dptf2.js +0 -1
  54. package/dist/web/assets/Flags-DWF2JPYv.js +0 -2
  55. package/dist/web/assets/Flaky-CrqNK0MG.js +0 -1
  56. package/dist/web/assets/Impact-DrWOOLCh.js +0 -3
  57. package/dist/web/assets/Jobs-BbMCch6k.js +0 -5
  58. package/dist/web/assets/KindPage-Qp49_Zba.js +0 -6
  59. package/dist/web/assets/Migration-nG2ZGz54.js +0 -2
  60. package/dist/web/assets/Product-ECS4coRw.js +0 -7
  61. package/dist/web/assets/Production-D5fdXi9r.js +0 -1
  62. package/dist/web/assets/Record-Dfs6EU9D.js +0 -2
  63. package/dist/web/assets/Regression-C0-KdOsi.js +0 -5
  64. package/dist/web/assets/Response-Bk5bwieC.js +0 -4
  65. package/dist/web/assets/Runs-D-c_Cwvy.js +0 -2
  66. package/dist/web/assets/TestData-D4qSo30K.js +0 -2
  67. package/dist/web/assets/TestDebt-D80D911j.js +0 -1
  68. package/dist/web/assets/Tosca-DVzWEwsl.js +0 -2
  69. package/dist/web/assets/index-D_Rdwtap.css +0 -2
  70. package/dist/web/assets/index-uKsXcgSa.js +0 -45
  71. package/dist/web/assets/segmented-CaCvJJD1.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{Ai as e,Ao as t,Ca as n,Co as r,Di as i,Do as a,Ea as o,Fn as s,L as c,Mi as l,Mt as u,Nn as d,Oa as f,Ot as p,To as m,Tr as h,Zi as g,_n as _,_t as v,at as y,ca as b,ci as x,da as S,dn as C,dt as w,et as T,gn as E,gt as D,jt as O,kt as k,ni as A,ot as j,pt as M,r as N,si as P,t as F,tt as I,ut as L,vt as R,wa as z,yr as ee,z as B}from"./frame-BY4TCOKb.js";import{o as te,r as ne,u as re}from"./index-2XeVj3Uw.js";import{t as ie}from"./segmented-DN6qwHw7.js";import{n as ae}from"./families-DF7po37F.js";import{r as oe,s as V,t as se}from"./logos-wnjr1dej.js";import{d as H,o as ce,p as le,r as U,s as ue,t as de}from"./parts-BGgYgqej.js";var W=t(a(),1),G=m(),K=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,fe={ok:{label:`Ready to start`,tone:`pass`},limits:{label:`Ready, with limits`,tone:`warn`},blocked:{label:`Not possible`,tone:`fail`}},pe={converted:{label:`Converted`,tone:`pass`},partial:{label:`Needs review`,tone:`warn`},failed:{label:`Failed`,tone:`fail`},stopped:{label:`Stopped`,tone:`neutral`},running:{label:`Running`,tone:`running`}},q={converted:{label:`Converted`,tone:`pass`},written:{label:`Written`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`},blocked:{label:`Not possible`,tone:`warn`},skipped:{label:`Skipped`,tone:`neutral`}},me={setup:`Set-up`,page:`Page`,test:`Test`},he={matched:{label:`In the test`,dot:`bg-pass`},missing:{label:`Missing from the test`,dot:`bg-fail`},elided:{label:`Not needed: this branch never runs`,dot:`bg-line-strong`},marked:{label:`Left for a person to finish`,dot:`bg-warn`}},J={web:`Web`,api:`API`,desktop:`Desktop`,mobile:`Mobile`,data:`Data`,mixed:`Mixed`,unsupported:`Not supported`},ge={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`},Y=[`prepare`,`setup`,`pages`,`tests`,`validate`,`review`];function _e(e,t){if(!t)return 0;if(t.status===`converted`||t.stages?.review.status===`done`)return 100;let n=t.stages?.validate.status===`done`?8:0,r=Math.min(t.units.length,e.units.length);return Math.min(99,Math.round(r/Math.max(1,e.units.length)*90+n))}function ve(e){let t=e?.status||`pending`,n=e?.startedAt&&e?.endedAt?H(Date.parse(e.endedAt)-Date.parse(e.startedAt)):``;return t===`running`?e?.startedAt?`Running · ${H(Date.now()-Date.parse(e.startedAt))}`:`Running`:t===`done`?e?.note||(n?`Done · ${n}`:`Done`):t===`failed`?e?.note||`Did not finish`:t===`skipped`?e?.note||`Skipped`:`Waiting`}function ye({states:e}){return(0,G.jsx)(`ol`,{"aria-label":`Stages`,className:`m-0 flex w-full min-w-0 list-none items-center gap-1 p-0 @xl:gap-2`,children:Y.map((t,n)=>{let r=e?.[t],i=r?.status||`pending`,a=i===`done`||i===`skipped`,o=i===`running`||i===`failed`,s=ve(r);return(0,G.jsxs)(`li`,{"data-tip":`${ge[t]}: ${s}`,className:f(`relative flex items-center gap-1 @xl:gap-2`,n<Y.length-1&&`flex-1`),"aria-current":i===`running`?`step`:void 0,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:f(`inline-flex size-5 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums @xl:size-6`,a?`bg-pass text-white`:i===`running`?`border-2 border-accent bg-accent-soft text-accent-fg`:i===`failed`?`bg-fail text-white`:`border border-line bg-bg text-muted`),children:a?(0,G.jsx)(d,{size:12,strokeWidth:3}):i===`failed`?(0,G.jsx)(z,{size:12,strokeWidth:3}):i===`running`?(0,G.jsx)(x,{size:12,strokeWidth:2.5,className:`animate-spin`}):n+1}),(0,G.jsxs)(`span`,{className:f(`flex-none text-[13px] whitespace-nowrap`,o?`inline`:`hidden @xl:inline`,i===`running`?`font-medium text-accent-fg`:i===`failed`?`font-medium text-fail`:i===`pending`?`text-muted`:`text-ink`),children:[ge[t],o&&(0,G.jsx)(`span`,{className:`ml-1.5 hidden font-normal text-muted @3xl:inline`,children:s})]}),(0,G.jsxs)(`span`,{className:`sr-only`,children:[ge[t],`: `,s]}),n<Y.length-1&&(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,G.jsx)(`span`,{className:f(`block h-full rounded-full bg-pass transition-[width] duration-500`,a?`w-full`:`w-0`)})})]},t)})})}function X(e){return e?`literal`in e?JSON.stringify(e.literal):`env`in e?`env ${String(e.env)}${e.secret?` (secret)`:``}`:`var`in e?`variable ${String(e.var)}`:`param`in e?`parameter ${String(e.param)}`:`data`in e?`test data ${String(e.data)}`:`expr`in e?`expression ${String(e.expr)}`:`concat`in e&&Array.isArray(e.concat)?e.concat.map(X).join(` + `):``:``}function be(e){let t=e.target?e.target.slice(e.target.indexOf(`.`)+1).replace(/_/g,` `):``;if(e.kind===`action`){let n=e.op===`navigate`?`Open ${X(e.value)}`:e.op===`close`?`Close the browser`:e.op===`fill`?`Fill ${t} with ${X(e.value)}`:e.op===`press`?`Press ${e.key} on ${t}`:e.op===`select`?`Select in ${t}`:`${e.op[0].toUpperCase()}${e.op.slice(1)} ${t}`;return e.optional?`${n} (if it is there)`:n}return e.kind===`assert`?`Check ${t} ${e.op===`text`||e.op===`value`?`${e.match===`contains`?`contains`:`is`} ${X(e.expected)}`:`is ${e.op}`}${e.wait?`, waiting`:``}`:e.kind===`store`?`Read ${t} into ${e.var}`:e.kind===`set_var`?`Set ${e.var} to ${X(e.value)}`:e.kind===`wait`?`Wait ${e.ms} ms`:e.kind===`unsupported`?e.reason||`Cannot be converted`:e.name||e.kind}var xe={before:`Before`,after:`After`,block:`Reusable block`,folder:`Folder`};function Se({nodes:e,status:t,pick:n,onPick:r,depth:i=0}){return(0,G.jsx)(`ul`,{className:f(`m-0 flex list-none flex-col p-0`,i>0&&`ml-3 border-l border-line-soft pl-3`),children:e.map((e,a)=>{if(e.kind===`group`)return(0,G.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,G.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[xe[e.role||`folder`]||`Folder`,`: `,(0,G.jsx)(`span`,{className:`text-ink-2`,children:e.name})]}),(0,G.jsx)(Se,{nodes:e.body||[],status:t,pick:n,onPick:r,depth:i+1})]},`g${a}`);if(e.kind===`if`||e.kind===`loop`){let o=e.condition;return(0,G.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,G.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[e.kind===`if`?`If`:`Loop`,` `,e.name,`: `,(0,G.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:o?.tosca}),o?.constant!==void 0&&(0,G.jsxs)(`span`,{children:[` · always `,o.constant?`true`:`false`]})]}),[`then`,`else`,`loop`].map(a=>e[a]?.length?(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,G.jsx)(`span`,{className:`ml-3 text-[12px] text-muted`,children:a===`then`?`Then`:a===`else`?`Else`:`Each time`}),(0,G.jsx)(Se,{nodes:e[a],status:t,pick:n,onPick:r,depth:i+1})]},a):null)]},`i${a}`)}let o=e.id?t.get(e.id):void 0,s=o?he[o]:void 0;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.id,onClick:()=>r(e),className:f(`flex w-full min-w-0 cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,n===e.id?`bg-accent-soft`:`bg-transparent hover:bg-surface-muted`),children:[(0,G.jsx)(`span`,{role:`img`,"aria-label":s?.label||`Not converted yet`,"data-tip":s?.label||`Not converted yet`,className:f(`mt-1.5 size-2 flex-none rounded-full`,s?.dot||`bg-line`)}),(0,G.jsx)(`span`,{className:`w-9 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,G.jsxs)(`span`,{className:f(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`unsupported`?`text-warn`:`text-ink`),children:[be(e),e.tosca?.step&&(0,G.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[`Tosca step "`,e.tosca.step,`"`]})]})]})},e.id||a)})})}function Ce(e,t){for(let n of e){if(n.id===t)return n;for(let e of[`body`,`then`,`else`,`loop`]){let r=n[e]&&Ce(n[e],t);if(r)return r}}}function we({view:e,pick:t}){let n=e.target,r=n?.text||``,i=r.split(`
2
+ `),a=(0,W.useMemo)(()=>r?re(r,n?.lang||`plaintext`):null,[r,n?.lang]),o=(0,W.useMemo)(()=>{if(!t)return new Set;let e=RegExp(`tosca:[\\sn\\d,]*\\b${t}\\b`,`i`);return new Set(i.flatMap((t,n)=>e.test(t)?[n]:[]))},[t,r]),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{s.current?.scrollIntoView({block:`center`,behavior:`smooth`})},[t,o.size]);let c=Math.min(...o);return(0,G.jsxs)(`figure`,{className:`m-0 flex min-h-0 min-w-0 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,G.jsxs)(`figcaption`,{className:`flex min-h-10 items-center gap-2 border-b border-line-soft pr-1 pl-3`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Converted test`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-ink-2`,"data-tip":n?.path,children:n?.path||``}),r&&(0,G.jsx)(te,{text:r,label:`Copy ${n?.path||`the test`}`})]}),r?(0,G.jsxs)(`div`,{className:`flex min-h-[260px] flex-1 overflow-auto font-mono text-[12.5px] leading-[1.6]`,children:[(0,G.jsx)(`pre`,{"aria-hidden":`true`,className:`m-0 min-h-full flex-none self-stretch border-r border-line-soft py-3 text-right text-muted select-none`,children:i.map((e,t)=>(0,G.jsx)(`span`,{ref:t===c?s:void 0,className:f(`block px-3`,o.has(t)&&`bg-accent-soft font-semibold text-accent-fg`),children:t+1},t))}),(0,G.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 px-3 py-3`,children:(0,G.jsx)(`code`,{className:`hljs`,children:a})})]}):(0,G.jsx)(`p`,{className:`m-0 flex min-h-[260px] flex-1 items-center justify-center px-4 text-center text-sm text-muted`,children:n?`Not written yet.`:`This test case is left out of the plan.`}),t&&r&&(0,G.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft px-3 py-2 text-[12.5px] text-muted`,children:o.size?`${t} is done on line ${[...o].map(e=>e+1).join(`, `)}.`:`No line of the test is marked ${t}.`})]})}function Te({view:e,node:t}){if(!t?.target)return null;let[n,r]=t.target.split(`.`),i=e.pages.find(e=>e.id===n),a=i?.elements.find(e=>e.id===r);return a?(0,G.jsxs)(`section`,{"aria-label":`Locators Tosca recorded`,className:`flex flex-col gap-2 rounded-[12px] card border px-4 py-3 text-[13px]`,children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[a.name,` `,(0,G.jsxs)(`span`,{className:`font-normal text-muted`,children:[`on `,i?.name,a.scope?.length?`, inside ${a.scope.join(` › `)}`:``,a.nth===void 0?``:`, number ${a.nth+1}`]})]}),a.locators.length?(0,G.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.locators.slice(0,6).map((e,t)=>(0,G.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`w-14 flex-none text-[12px] text-muted`,children:e.strategy}),(0,G.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.strategy===`role`?`${e.role} "${e.name}"`:e.attr?`[${e.attr}="${e.value}"]`:e.value}),e.fragile&&(0,G.jsx)(D,{tone:`warn`,children:`Fragile`})]},t))}):(0,G.jsx)(`span`,{className:`text-muted`,children:`Tosca recorded no locator for it.`})]}):null}function Ee({id:e,plan:t,result:n,initial:i}){let a=t.cases.filter(e=>e.included),[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(i||a[0]?.id||``),[u,d]=(0,W.useState)(null),[p,m]=(0,W.useState)(``),[h,g]=(0,W.useState)(``);(0,W.useEffect)(()=>{c&&(g(``),r.case(e,c).then(d,e=>g(e.message)))},[e,c,n?.units.length,n?.status]),(0,W.useEffect)(()=>{m(``)},[c]);let _=new Map((u?.fidelity||[]).map(e=>[e.id,e.status])),y=a.filter(e=>!o||e.name.toLowerCase().includes(o.toLowerCase())),b=e=>n?.units.find(t=>t.kind===`test`&&t.case===e);return a.length?(0,G.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-4 @5xl:h-[calc(var(--screen)-320px)] @5xl:min-h-[540px] @5xl:grid-cols-[220px_minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,G.jsxs)(`nav`,{"aria-label":`Test cases`,className:`flex max-h-[320px] min-h-0 min-w-0 flex-col gap-2 overflow-hidden rounded-[14px] card border p-3 @5xl:max-h-none`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-semibold`,children:`Test cases`}),(0,G.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[a.filter(e=>b(e.id)?.status===`converted`).length,` converted · `,a.filter(e=>[`failed`,`blocked`].includes(b(e.id)?.status||``)).length,` failed · `,K(a.length,`test case`)]})]}),(0,G.jsx)(L,{id:`find-a-case`,label:`Find a test case`,value:o,onChange:s,className:`max-w-none flex-none`}),(0,G.jsxs)(`ul`,{className:`m-0 flex min-h-0 flex-1 list-none flex-col gap-0.5 overflow-y-auto p-0`,children:[y.map(e=>{let t=b(e.id);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":c===e.id,onClick:()=>l(e.id),className:f(`flex w-full cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-1.5 text-left text-[13px]`,c===e.id?`bg-accent-soft text-ink`:`bg-transparent text-ink-2 hover:bg-surface-muted`),children:[(0,G.jsx)(`span`,{role:`img`,"aria-label":t?q[t.status].label:`Waiting`,className:f(`mt-1.5 size-2 flex-none rounded-full`,t?.status===`converted`?`bg-pass`:t?.status===`failed`?`bg-fail`:t?.status===`blocked`?`bg-warn`:`bg-line`)}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.name,(0,G.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[K(e.steps,`step`),` · `,K(e.asserts,`check`),t?.fidelity?` · ${t.fidelity.matched}/${t.fidelity.required} in the test`:``]})]})]})},e.id)}),!y.length&&(0,G.jsx)(`li`,{className:`px-2 py-3 text-[13px] text-muted`,children:`No test case matches.`})]})]}),(0,G.jsxs)(`section`,{"aria-label":`Tosca steps`,className:`flex min-h-[360px] min-w-0 flex-col gap-3 overflow-hidden`,children:[h&&(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:h}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,G.jsxs)(`header`,{className:`flex min-h-10 flex-wrap items-center gap-2 border-b border-line-soft px-3 py-1.5`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Tosca steps`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:u?.name}),u&&t.cases.find(e=>e.id===c)&&(0,G.jsx)(`span`,{className:`text-[12px] text-muted`,children:J[t.cases.find(e=>e.id===c).route]||``})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:u?(0,G.jsx)(Se,{nodes:u.body,status:_,pick:p,onPick:e=>m(e.id||``)}):h?(0,G.jsx)(`p`,{className:`m-0 px-2 text-sm text-muted`,children:`Nothing to show.`}):(0,G.jsx)(`p`,{role:`status`,className:`m-0 px-2 text-sm text-muted`,children:`Loading…`})}),u&&(u.env.length>0||u.warnings.length>0)&&(0,G.jsxs)(`footer`,{className:`flex flex-col gap-1 border-t border-line-soft px-3 py-2 text-[12.5px] text-ink-2`,children:[u.env.length>0&&(0,G.jsxs)(`span`,{children:[`Environment variables: `,u.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`.`]}),u.warnings.slice(0,3).map(e=>(0,G.jsx)(`span`,{className:`text-warn`,children:e},e))]})]}),u&&(0,G.jsx)(Te,{view:u,node:Ce(u.body,p)})]}),u?(0,G.jsx)(we,{view:u,pick:p}):(0,G.jsx)(`p`,{className:`m-0 flex min-h-[260px] items-center justify-center rounded-[12px] card border px-4 text-center text-sm text-muted`,children:h?`Nothing to show.`:`Loading…`})]}):(0,G.jsx)(v,{center:!0,className:`py-6`,children:`No test case of this plan is converted.`})}function De(e){if(e.job?.running)return{label:e.job.kind===`fix`?`Fixing`:e.job.kind===`verify`?`Running tests`:`Running`,tone:`running`};let t=e.result;return t?.status===`running`?{label:t.stage===`validate`?`Validating`:`Running`,tone:`running`}:t?pe[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:fe[e.plan.feasibility.verdict]}var Z=e=>e.slice(e.lastIndexOf(`/`)+1);function Oe({id:e,title:t,targetDir:n,onClose:i}){let[a,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(!1),[d,f]=(0,W.useState)(``),p=async()=>{l(!0),f(``);try{await r.delete(e,a),location.hash=u(`tosca`)}catch(e){f(e.message),l(!1)}};return(0,G.jsx)(O,{open:!0,onClose:i,title:`Delete this conversion`,description:`${t}. Removes the plan and its run history from the list. Files already written under ${n} stay.`,footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(o,{variant:`ghost`,onClick:i,children:`Keep it`}),(0,G.jsxs)(o,{variant:`danger`,disabled:c||a!==e,onClick:()=>void p(),children:[(0,G.jsx)(b,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,G.jsxs)(`span`,{children:[`Type `,(0,G.jsx)(`span`,{className:`font-mono`,children:e}),` to confirm`]}),(0,G.jsx)(w,{value:a,onChange:e=>s(e.target.value),autoComplete:`off`,spellCheck:!1})]}),d?(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:d}):null]})})}function ke({d:e,unit:t,onClose:r,onSend:i}){let[a,s]=(0,W.useState)(``),c=e.plan.units.find(e=>e.id===t),l=e.result?.units.find(e=>e.id===t);return(0,G.jsx)(O,{open:!0,onClose:r,title:`Fix ${c?Z(c.target):t}`,description:`The Tosca agent works on this file again, with ForgeQE's last check and your note. It runs in the background.`,footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(o,{variant:`ghost`,onClick:r,children:`Cancel`}),(0,G.jsxs)(o,{variant:`primary`,onClick:()=>i(a.trim()),children:[(0,G.jsx)(n,{"aria-hidden":`true`}),`Send to the agent`]})]}),children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[l?.problems?.length?(0,G.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:l.problems[0]}):null,(0,G.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:`What should change? (optional)`}),(0,G.jsx)(M,{value:a,rows:4,maxLength:2e3,placeholder:`The cart badge is a span now, not a button.`,onChange:e=>s(e.target.value)})]})]})})}function Ae({d:e,unit:t,onClose:n}){let r=e.result?.units.find(e=>e.id===t),i=e.plan.units.find(e=>e.id===t);return(0,G.jsx)(O,{open:!0,onClose:n,wide:!0,title:`Output of ${i?Z(i.target):t}`,description:r?.checkedAt?`Run again ${le(r.checkedAt)}`:`From the conversion's own run`,footer:(0,G.jsx)(o,{onClick:n,children:`Close`}),children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[r?.problems?.length?(0,G.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r.problems.join(` `)}):r?.status===`converted`?(0,G.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`Passes, with every Tosca step in the test.`}):null,r?.command&&(0,G.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,r.command]}),(0,G.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto rounded-[12px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:r?.output||`No output.`})]})})}function je(e){let t=Object.fromEntries(Y.map(e=>[e,{status:e===`prepare`?`running`:`pending`,...e===`prepare`?{startedAt:new Date().toISOString()}:{}}]));return{status:`running`,plan:e.plan.id,target:e.plan.target,units:[],reverted:[],model:``,startedAt:e.job?.last?.startedAt||new Date().toISOString(),ms:0,stage:`prepare`,stages:t,notes:``}}function Me({d:e,planView:t,busy:r,onFix:a,onSteps:s,onOutput:c,onRun:l}){let u=e.result||(e.job?.running?je(e):null);if(!u)return(0,G.jsx)(G.Fragment,{children:t});let d=new Map(u.units.map(e=>[e.id,e])),p=e.plan.units.filter(e=>e.kind===`test`),m=u.units.filter(e=>e.kind===`test`&&e.status===`converted`).length,g=u.units.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),_=u.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,[v,...b]=e.plan.target.id.split(`-`);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,G.jsxs)(ce,{children:[(0,G.jsx)(U,{label:`Tests passing`,value:`${m} / ${p.length}`,tone:m===p.length&&p.length?`text-pass`:void 0}),(0,G.jsx)(U,{label:`Tosca steps in the tests`,value:g.n?`${g.m} / ${g.n}`:`–`,tone:g.n&&g.m===g.n?`text-pass`:void 0}),(0,G.jsx)(U,{label:`Need attention`,value:_,tone:_?`text-fail`:void 0}),(0,G.jsx)(U,{label:u.status===`running`?`Running for`:`Took`,value:H(u.status===`running`?Date.now()-Date.parse(u.startedAt):u.ms)})]}),u.notes&&(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:u.notes}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,G.jsx)(T,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,head:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`File`}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,G.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Tosca steps`}),(0,G.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Note`}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,G.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.plan.units.map(t=>{let i=d.get(t.id),l=i?q[i.status]:null,u=t.case?e.plan.cases.find(e=>e.id===t.case):void 0;return(0,G.jsxs)(`tr`,{className:y,children:[(0,G.jsxs)(`td`,{className:I,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:t.kind===`setup`?`Project set-up`:Z(t.target)}),(0,G.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[u?u.name:`${me[t.kind]} · ${t.target}`,u?.suites?.length?` · ${u.suites.join(`, `)}`:``]})]}),(0,G.jsxs)(`td`,{className:f(I,`whitespace-nowrap`),children:[l?(0,G.jsx)(D,{tone:l.tone,children:l.label}):(0,G.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Waiting`}),i?.checkedAt&&(0,G.jsxs)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:[`Run again `,ne(i.checkedAt)]})]}),(0,G.jsx)(`td`,{className:f(I,`hidden text-[13px] whitespace-nowrap @2xl:table-cell`),children:i?.fidelity?(0,G.jsxs)(`span`,{className:i.fidelity.missing.length?`text-fail`:`text-ink-2`,children:[i.fidelity.matched,` of `,i.fidelity.required]}):(0,G.jsx)(`span`,{className:`text-muted`,children:`–`})}),(0,G.jsx)(`td`,{className:f(I,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:(0,G.jsx)(`span`,{className:`line-clamp-2`,children:i?.problems?.[0]||i?.reason||``})}),(0,G.jsx)(`td`,{className:f(I,`whitespace-nowrap text-right`),children:(0,G.jsxs)(`span`,{className:`inline-flex gap-1`,children:[t.kind===`test`&&(i?.output||i?.problems?.length)&&(0,G.jsxs)(o,{size:`sm`,variant:`ghost`,"aria-label":`Output of ${Z(t.target)}`,onClick:()=>c(t.id),children:[(0,G.jsx)(h,{"aria-hidden":`true`}),`Output`]}),t.case&&(0,G.jsxs)(o,{size:`sm`,variant:`ghost`,"aria-label":`Steps of ${Z(t.target)}`,onClick:()=>s(t.case),children:[(0,G.jsx)(P,{"aria-hidden":`true`}),`Steps`]}),i&&(i.status===`failed`||i.status===`blocked`)&&t.kind!==`setup`&&(0,G.jsxs)(o,{size:`sm`,disabled:r,"aria-label":`Fix ${Z(t.target)}`,onClick:()=>a(t.id),children:[(0,G.jsx)(n,{"aria-hidden":`true`}),`Fix`]})]})})]},t.id)})}),(0,G.jsxs)(`aside`,{"aria-label":`Details`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,G.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,e.plan.source.project?` · ${e.plan.source.project}`:``]}),(0,G.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.plan.source.file})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,G.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,G.jsx)(V,{framework:v,language:b.join(`-`)}),e.plan.target.title]}),(0,G.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:e.targetPath})]}),(e.plan.suites||[]).length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Suites`}),(0,G.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1.5 p-0`,children:e.plan.suites.map(e=>{let t=new Set(e.cases),n=u.units.filter(e=>e.kind===`test`&&e.case&&t.has(e.case)&&e.status===`converted`).length;return(0,G.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:e.name}),(0,G.jsxs)(`span`,{className:f(`text-[12px]`,n===e.cases.length?`text-pass`:`text-muted`),children:[n,` of `,K(e.cases.length,`test`),` pass · @`,e.tag]})]}),(0,G.jsxs)(o,{size:`sm`,variant:`ghost`,disabled:r,"aria-label":`Run the ${e.name} suite`,onClick:()=>l(e.name),children:[(0,G.jsx)(i,{"aria-hidden":`true`}),`Run`]})]},e.name)})})]}),e.plan.env.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,G.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.plan.env.map(e=>(0,G.jsxs)(`li`,{className:`flex flex-col`,children:[(0,G.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,G.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,G.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),(0,G.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,G.jsx)(`dd`,{className:`m-0 text-right`,children:le(u.startedAt)}),u.model&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`Agent`}),(0,G.jsx)(`dd`,{className:`m-0 truncate text-right`,"data-tip":u.model,children:u.model})]}),u.reverted.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`Put back`}),(0,G.jsxs)(`dd`,{className:`m-0 text-right`,children:[u.reverted.length,` edits outside the target`]})]})]})]})]})]})}var Ne={ok:{mark:`✓`,cls:`text-pass`},fail:{mark:`✗`,cls:`text-fail`},info:{mark:`•`,cls:`text-muted`},agent:{mark:`•`,cls:`text-accent-fg`},tool:{mark:`·`,cls:`text-muted`}};function Pe({events:e,running:t}){let n=(0,W.useRef)(null);(0,W.useEffect)(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e.length,t]);let r=e.filter(e=>e.kind!==`tool`);return(0,G.jsxs)(`ol`,{ref:n,"aria-live":t?`polite`:void 0,"aria-label":`Activity`,className:`m-0 flex max-h-[60vh] list-none flex-col overflow-y-auto rounded-[12px] card border p-0`,children:[r.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex gap-3 border-b border-line-soft px-4 py-2 text-[13px] last:border-b-0`,children:[(0,G.jsx)(`span`,{className:`w-[64px] flex-none text-[12px] text-muted tabular-nums`,children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,G.jsx)(`span`,{"aria-hidden":`true`,className:f(`w-3 flex-none text-center`,Ne[e.kind].cls),children:Ne[e.kind].mark}),(0,G.jsx)(`span`,{className:f(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`fail`?`text-fail`:e.kind===`ok`?`text-ink`:`text-ink-2`),children:e.text})]},t)),!r.length&&(0,G.jsx)(`li`,{className:`px-4 py-8 text-center text-sm text-muted`,children:`Nothing yet.`})]})}function Fe({id:e,plan:t}){let[n,i]=(0,W.useState)(null),[a,s]=(0,W.useState)(``),[c,d]=(0,W.useState)(`overview`),[f,p]=(0,W.useState)(),[m,h]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),[x,S]=(0,W.useState)([]),[C,w]=(0,W.useState)(!1),[T,O]=(0,W.useState)(!1),k=(0,W.useRef)(0),A=(0,W.useCallback)(()=>{r.detail(e).then(e=>{i(e),s(``)},e=>s(e.message)),r.events(e,k.current).then(e=>{e.next<k.current?(k.current=0,S([])):(k.current=e.next,e.events.length&&S(t=>[...t,...e.events].slice(-2e3)))},()=>{})},[e]);(0,W.useEffect)(A,[A]);let j=!!(n?.job?.running||n?.result?.status===`running`);(0,W.useEffect)(()=>{if(!j)return;let e=setInterval(A,1500);return()=>clearInterval(e)},[j,A]);let M=(0,W.useCallback)(e=>{i(e),s(``),d(`overview`),setTimeout(A,800)},[A]),N=async e=>{w(!0),s(``);try{i(await e()),setTimeout(A,800)}catch(e){s(e.message)}finally{w(!1)}};if(!n)return a?(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}):(0,G.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let P=De(n),F=_e(n.plan,n.result),I=n.result,L=(I?.units||[]).filter(e=>e.kind===`test`&&(e.status===`failed`||e.status===`blocked`)).length,R=n.plan.cases.filter(e=>e.included).length,z=[{id:`overview`,label:`Overview`},{id:`steps`,label:`Steps`,n:R?String(R):void 0,tone:L?`text-fail`:void 0},{id:`activity`,label:`Activity`}];return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`a`,{href:u(`tosca`),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,G.jsx)(E,{size:16,"aria-hidden":`true`}),`Tosca`]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,G.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:Z(n.plan.source.file)}),(0,G.jsx)(_,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,G.jsx)(V,{framework:n.plan.target.id.split(`-`)[0],language:n.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),n.plan.target.title]})]}),(0,G.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,G.jsxs)(`span`,{children:[`Tricentis Tosca`,n.plan.source.project?` · ${n.plan.source.project}`:``]}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{children:[`into `,(0,G.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:n.plan.target.dir})]})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(D,{tone:P.tone,children:P.label}),j?(0,G.jsxs)(o,{variant:`danger`,disabled:C,onClick:()=>void N(()=>r.stop(e)),children:[(0,G.jsx)(g,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,G.jsxs)(G.Fragment,{children:[I?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(o,{variant:`ghost`,onClick:()=>location.hash=u(`tosca`,e,`report`),children:`Report`}),(0,G.jsxs)(o,{disabled:C,onClick:()=>void N(()=>r.verify(e)),"data-tip":`Run every converted test again, no agent`,children:[(0,G.jsx)(l,{"aria-hidden":`true`}),`Run tests again`]})]}):null,(0,G.jsxs)(o,{variant:`ghost`,disabled:C,onClick:()=>O(!0),"data-tip":`Remove this plan from the list. Converted tests stay.`,children:[(0,G.jsx)(b,{"aria-hidden":`true`}),`Delete`]})]})]})]}),T&&(0,G.jsx)(Oe,{id:e,title:`${Z(n.plan.source.file)} → ${n.plan.target.title}`,targetDir:n.plan.target.dir,onClose:()=>O(!1)}),I&&(0,G.jsxs)(`div`,{className:`flex items-center gap-3 rounded-[12px] card border px-3 py-2.5 @xl:gap-4 @xl:px-4`,children:[(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(ye,{states:I.stages})}),j&&(0,G.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(F)}% done`,children:[Math.round(F),`%`]})]}),a&&(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),(0,G.jsx)(ue,{tabs:z,tab:c,onTab:d,label:`Tosca conversion`}),(0,G.jsxs)(`div`,{role:`tabpanel`,id:`mpanel-${c}`,"aria-labelledby":`mtab-${c}`,className:`flex min-w-0 flex-col gap-4`,children:[c===`overview`&&(0,G.jsx)(Me,{d:n,planView:t(n,M),busy:C||j,onFix:h,onSteps:e=>(p(e),d(`steps`)),onOutput:y,onRun:t=>void N(()=>r.verify(e,t))}),c===`steps`&&(0,G.jsx)(Ee,{id:e,plan:n.plan,result:I,initial:f}),c===`activity`&&(0,G.jsx)(Pe,{events:x,running:j})]}),v&&(0,G.jsx)(Ae,{d:n,unit:v,onClose:()=>y(null)}),m&&(0,G.jsx)(ke,{d:n,unit:m,onClose:()=>h(null),onSend:t=>{h(null),N(()=>r.fix(e,[m],t))}})]})}var Ie=e=>e.slice(e.lastIndexOf(`/`)+1),Le={prepare:`Prepare`,setup:`Set up`,pages:`Pages`,tests:`Tests`,validate:`Validate`,review:`Review`};function Re(e){return e===`converted`?q.converted:e===`failed`?q.failed:e===`blocked`?q.blocked:e===`left out`||e===`skipped`||e===`not run`?{label:e===`left out`?`Left out`:e===`not run`?`Not run`:`Skipped`,tone:`neutral`}:{label:e,tone:`neutral`}}function ze(e){for(let t of Y){let n=e[t];if(n?.status===`failed`)return{id:t,...n.note?{note:n.note}:{}}}return null}function Be({title:e,children:t,defaultOpen:n}){let[r,i]=(0,W.useState)(!!n),a=(0,W.useId)();return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(!r),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,G.jsx)(s,{size:15,"aria-hidden":`true`,className:f(`transition-transform`,r&&`rotate-180`)}),e]}),(0,G.jsx)(k,{open:r,id:a,children:t})]})}function Ve({planId:e,unit:t,file:n}){let[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(!1),c=/\.(webm|mp4)$/i.test(n);return(0,W.useEffect)(()=>{let i=!1;return a(``),s(!1),r.evidence(e,t,n).then(e=>!i&&a(e),()=>!i&&s(!0)),()=>{i=!0}},[e,t,n]),(0,G.jsxs)(`li`,{className:`flex max-w-[320px] flex-col gap-1`,children:[i?c?(0,G.jsx)(`video`,{controls:!0,src:i,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,G.jsx)(`img`,{src:i,alt:n,className:`max-h-[220px] w-full rounded-[10px] border border-line-soft object-contain`}):(0,G.jsx)(`span`,{className:`flex h-[120px] items-center justify-center rounded-[10px] border border-line-soft bg-surface-muted text-[12px] text-muted`,children:o?`Not available`:`Loading…`}),(0,G.jsx)(`span`,{className:`font-mono text-[11px] text-muted`,children:n})]})}function He({planId:e,unit:t,files:n}){return!t||!n.length?null:(0,G.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-3 p-0`,children:n.map(n=>(0,G.jsx)(Ve,{planId:e,unit:t,file:n},n))})}function Ue({planId:e,t}){let n=t.fidelity,r=t.status===`failed`||t.status===`blocked`,i=t.problems?.length?t.problems.join(` `):r&&t.reason?t.reason:``;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-[14px] card border p-5`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:t.name}),(0,G.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted`,children:[t.file?(0,G.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.file}):`No file`,t.suites.length?` · ${t.suites.join(`, `)}`:``,t.folders.length?` · ${t.folders.join(` / `)}`:``]})]}),(0,G.jsx)(D,{tone:Re(t.status).tone,children:Re(t.status).label}),t.ms>0&&(0,G.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:H(t.ms)})]}),i&&(0,G.jsx)(`p`,{role:`status`,className:f(`m-0 rounded-[10px] px-3 py-2 text-sm [overflow-wrap:anywhere]`,r?`bg-fail-soft text-fail`:`bg-surface-muted text-ink-2`),children:i}),n&&n.rows.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`span`,{className:`text-[12px] font-medium text-muted`,children:[`Tosca steps (`,n.matched,` of `,n.required,`)`]}),(0,G.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[10px] border border-line-soft p-0 text-[13px]`,children:n.rows.map(e=>{let t=he[e.status]||he.matched;return(0,G.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-3 py-2 last:border-b-0`,children:[(0,G.jsx)(`span`,{className:f(`mt-1.5 h-2 w-2 flex-none rounded-full`,t.dot),"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`w-12 flex-none font-mono text-[12px] text-muted`,children:e.id}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.kind===`assert`?`check ${e.op}`:e.op,` on `,e.element||`—`,(0,G.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[t.label,e.step?` · Tosca “${e.step}”`:``]})]})]},e.id)})})]}),t.media.length>0?(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Screenshots and video`}),(0,G.jsx)(He,{planId:e,unit:t.unit,files:t.media})]}):r?(0,G.jsx)(`p`,{className:`m-0 text-[12.5px] text-muted`,children:`No screenshot or video was kept for this failure.`}):null,t.command&&(0,G.jsxs)(`code`,{className:`block font-mono text-[12px] text-muted`,children:[`$ `,t.command]}),t.output&&(0,G.jsx)(Be,{title:`Test output`,defaultOpen:r,children:(0,G.jsx)(`pre`,{className:`m-0 max-h-[40vh] overflow-auto rounded-[10px] bg-surface-muted px-3 py-2 font-mono text-[12.5px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:t.output})})]})}function We({id:e}){let[t,n]=(0,W.useState)(null),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(!0),[l,d]=(0,W.useState)(`all`),[p,m]=(0,W.useState)(``);(0,W.useEffect)(()=>{s(!0),r.report(e).then(e=>{if(n(e.report),a(e.report?``:`No report yet. Start the conversion first.`),s(!1),e.report){let t=e.report.tests.filter(e=>e.status!==`left out`),n=t.find(e=>e.status===`failed`||e.status===`blocked`);m(n?.case||t[0]?.case||``),d(n?`attention`:`all`)}},e=>{a(e.message),s(!1)})},[e]);let g=(0,W.useMemo)(()=>t?t.tests.filter(e=>e.status!==`left out`):[],[t]),v=(0,W.useMemo)(()=>g.filter(e=>!(l===`attention`&&e.status!==`failed`&&e.status!==`blocked`||l===`converted`&&e.status!==`converted`)),[g,l]);if((0,W.useEffect)(()=>{p&&(v.some(e=>e.case===p)||m(v[0]?.case||``))},[v,p]),o)return(0,G.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading report…`});if(i||!t)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`a`,{href:u(`tosca`,e),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,G.jsx)(E,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i||`No report.`})]});let b=g.filter(e=>e.status===`converted`).length,x=g.filter(e=>e.status===`failed`||e.status===`blocked`).length,S=g.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),C=g.reduce((e,t)=>e+t.media.length,0),w=pe[t.status]||{label:t.status,tone:`neutral`},[O,...k]=t.target.id.split(`-`),A=ze(t.stages),j=g.find(e=>e.case===p)||null,M=[{id:`all`,label:`All (${g.length})`},{id:`attention`,label:`Needs attention (${x})`},{id:`converted`,label:`Converted (${b})`}];return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`a`,{href:u(`tosca`,e),className:`inline-flex items-center gap-1.5 self-start text-sm`,children:[(0,G.jsx)(E,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 @3xl:flex-row @3xl:items-start`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsx)(`p`,{className:`m-0 text-[12px] font-medium tracking-wide text-muted uppercase`,children:`Conversion report`}),(0,G.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,G.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:Ie(t.source.file)}),(0,G.jsx)(_,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,G.jsx)(V,{framework:O,language:k.join(`-`),size:20}),t.target.title]})]}),(0,G.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-1.5 text-sm text-muted`,children:[(0,G.jsxs)(`span`,{children:[`Tricentis Tosca`,t.source.project?` · ${t.source.project}`:``]}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:t.id}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{children:[`Started `,le(t.startedAt)]})]})]}),(0,G.jsx)(D,{tone:w.tone,children:w.label})]}),A&&(0,G.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[`Failed in `,Le[A.id],A.note?`: ${A.note}`:``]}),(0,G.jsxs)(ce,{children:[(0,G.jsx)(U,{label:`Tests passing`,value:`${b} / ${g.length}`,tone:b===g.length&&g.length?`text-pass`:void 0}),(0,G.jsx)(U,{label:`Total time`,value:H(t.ms)}),(0,G.jsx)(U,{label:`Tosca steps`,value:S.n?`${S.m} / ${S.n}`:`–`,tone:S.n&&S.m===S.n?`text-pass`:void 0}),(0,G.jsx)(U,{label:`Media`,value:C,sub:C?`screenshots / video`:`only on failure`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-5 @5xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,G.jsx)(T,{label:`Test cases`,placeholder:`Find a test case`,empty:g.length?`No test case matches.`:`No test cases.`,resetKey:l,tools:(0,G.jsx)(`div`,{role:`group`,"aria-label":`Filter test cases`,className:`flex flex-wrap gap-1`,children:M.map(e=>(0,G.jsx)(`button`,{type:`button`,"aria-pressed":l===e.id,onClick:()=>d(e.id),className:f(`min-h-8 cursor-pointer rounded-[8px] border px-2.5 text-[13px]`,l===e.id?`border-accent bg-accent-soft font-medium text-accent-fg`:`border-line bg-transparent text-ink-2 hover:bg-surface-muted`),children:e.label},e.id))}),head:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`th`,{className:`py-2 pr-3 pl-3 font-medium`,children:`Test case`}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:`Status`}),(0,G.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @2xl:table-cell`,children:`Steps`}),(0,G.jsx)(`th`,{className:`hidden py-2 pr-3 font-medium @3xl:table-cell`,children:`Time`})]}),children:v.map(e=>{let t=Re(e.status),n=p===e.case;return(0,G.jsxs)(`tr`,{className:f(y,`cursor-pointer hover:bg-surface-muted`,n&&`bg-accent-soft`),onClick:()=>m(e.case),"aria-selected":n,children:[(0,G.jsxs)(`td`,{className:I,children:[(0,G.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.name}),(0,G.jsx)(`span`,{className:`block font-mono text-[12px] text-muted`,children:e.file||`No file`})]}),(0,G.jsxs)(`td`,{className:f(I,`whitespace-nowrap`),children:[(0,G.jsx)(D,{tone:t.tone,children:t.label}),e.media.length>0&&(0,G.jsx)(`span`,{className:`block pt-1 text-[12px] text-muted`,children:K(e.media.length,`file`)})]}),(0,G.jsx)(`td`,{className:f(I,`hidden text-[13px] whitespace-nowrap tabular-nums @2xl:table-cell`,e.fidelity?.missing.length?`text-fail`:`text-ink-2`),children:e.fidelity?`${e.fidelity.matched}/${e.fidelity.required}`:`–`}),(0,G.jsx)(`td`,{className:f(I,`hidden text-[13px] whitespace-nowrap text-muted tabular-nums @3xl:table-cell`),children:e.ms>0?H(e.ms):`–`})]},e.case)})}),j?(0,G.jsx)(Ue,{planId:t.id,t:j}):v.length?(0,G.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Select a test case for steps, output, and media.`}):null,t.personSteps.length>0&&(0,G.jsxs)(`section`,{className:`flex flex-col gap-2 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,G.jsx)(`h3`,{className:`m-0 text-sm font-semibold text-warn`,children:`Steps a person has to finish`}),(0,G.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:t.personSteps.map(e=>(0,G.jsxs)(`li`,{children:[e.case,` / `,e.id,`: Tosca step “`,e.step,`” on “`,e.element,`”`]},`${e.case}-${e.id}`))})]})]}),(0,G.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[14px] card border p-5 text-sm @5xl:sticky @5xl:top-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`From`}),(0,G.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,t.source.project?` · ${t.source.project}`:``]}),(0,G.jsx)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:t.source.file}),t.source.baseUrl&&(0,G.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:t.source.baseUrl})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`To`}),(0,G.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,G.jsx)(V,{framework:O,language:k.join(`-`)}),t.target.title]}),(0,G.jsxs)(`span`,{className:`font-mono text-[12px] text-ink-2 [overflow-wrap:anywhere]`,children:[t.target.dir,`/`]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`LLM`}),(0,G.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t.model||`—`}),t.usage.input||t.usage.output?(0,G.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-[12.5px]`,children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`Tokens`}),(0,G.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:B(t.usage.input+t.usage.output)}),(0,G.jsx)(`dt`,{className:`text-muted`,children:`Read`}),(0,G.jsxs)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:[B(t.usage.input),t.usage.cached?(0,G.jsxs)(`span`,{className:`text-muted`,children:[` · `,B(t.usage.cached),` cached`]}):null]}),(0,G.jsx)(`dt`,{className:`text-muted`,children:`Written`}),(0,G.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:B(t.usage.output)}),(0,G.jsx)(`dt`,{className:`text-muted`,children:`Cost`}),(0,G.jsx)(`dd`,{className:`m-0 tabular-nums text-ink-2`,children:t.cost?(0,G.jsxs)(G.Fragment,{children:[t.cost.estimate?`≈`:``,c(t.cost.amount,t.cost.currency)]}):`—`})]}):(0,G.jsx)(`span`,{className:`text-[12.5px] text-muted`,children:`No usage recorded.`})]}),t.env.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Environment variables`}),(0,G.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:t.env.map(e=>(0,G.jsxs)(`li`,{className:`flex flex-col`,children:[(0,G.jsxs)(`span`,{className:`font-mono text-[12px]`,children:[e.name,e.secret?(0,G.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,G.jsx)(`span`,{className:`text-[12px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),t.reverted.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t border-line-soft pt-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:`Put back`}),(0,G.jsxs)(`span`,{className:`text-[12.5px] text-ink-2`,children:[t.reverted.length,` edit`,t.reverted.length===1?``:`s`,` outside the target`]})]}),t.notes&&(0,G.jsxs)(`p`,{className:`m-0 border-t border-line-soft pt-4 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[(0,G.jsx)(h,{size:14,"aria-hidden":`true`,className:`mr-1 inline align-text-bottom`}),t.notes]})]})]})]})}var Ge=[`Export`,`Target`,`Instructions`,`Review`],Ke=[`The Tosca export and its test cases`,`Framework and language`,`Your rules, optional`,`Check and start`],qe=[`Keep one page object per Tosca module, in pages/.`,`Name each test after its Tosca test case.`,`Read the base URL from BASE_URL.`],Je={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function Ye({at:e,reached:t,onGo:n}){return(0,G.jsx)(`nav`,{"aria-label":`Steps`,children:(0,G.jsx)(`ol`,{className:`m-0 flex list-none items-center gap-2 p-0`,children:Ge.map((r,i)=>{let a=i<=t,o=i===e,s=i<t&&!o;return(0,G.jsxs)(`li`,{className:f(`flex items-center gap-2`,i<Ge.length-1&&`flex-1`),children:[(0,G.jsxs)(`button`,{type:`button`,disabled:!a,"aria-current":o?`step`:void 0,onClick:()=>n(i),"aria-label":r,"data-tip":Ke[i],className:f(`inline-flex min-h-8 flex-none items-center gap-2 rounded-[8px] border-0 bg-transparent px-1 text-[13px] whitespace-nowrap`,a&&!o?`cursor-pointer hover:bg-surface-strong`:``),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:f(`inline-flex size-6 flex-none items-center justify-center rounded-full text-[11px] font-semibold tabular-nums`,s?`bg-pass text-white`:o?`bg-accent text-accent-ink`:`border border-line bg-bg text-muted`),children:s?(0,G.jsx)(d,{size:13,strokeWidth:3}):i+1}),(0,G.jsx)(`span`,{className:f(o?`font-medium text-ink`:a?`text-ink-2`:`text-muted`,!o&&`hidden @xl:inline`),children:r})]}),i<Ge.length-1&&(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,G.jsx)(`span`,{className:f(`block h-full rounded-full bg-pass transition-[width] duration-500`,i<t?`w-full`:`w-0`)})})]},r)})})})}function Q({id:e,label:t,help:n,children:r}){return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,G.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function $({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,G.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-3 border-t border-line-soft bg-bg py-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,G.jsx)(o,{variant:`ghost`,disabled:e,onClick:t,children:`Back`}),(0,G.jsx)(o,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function Xe({on:e,onPick:t,logo:n,title:r,sub:i,label:a}){return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e,"aria-label":a,onClick:t,className:f(`flex min-h-[72px] min-w-0 cursor-pointer items-center gap-3 rounded-[12px] border px-3.5 py-3 text-left transition-colors`,e?`border-accent bg-accent-soft ring-1 ring-accent`:`border-line-soft bg-bg hover:border-line hover:bg-surface-muted`),children:[(0,G.jsx)(`span`,{className:`inline-flex size-9 flex-none items-center justify-center rounded-[10px] bg-surface-muted`,children:n}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,G.jsx)(`span`,{className:`truncate text-sm font-medium text-ink`,children:r}),i&&(0,G.jsx)(`span`,{className:`truncate text-[12px] text-muted`,children:i})]})]})}var Ze=e=>e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function Qe({s:e}){return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-surface-muted px-4 py-3 text-sm`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:e.project||e.file}),(0,G.jsxs)(`span`,{className:`text-ink-2`,children:[K(e.test_cases.length,`test case`),` · `,K(e.pages.length,`module`),` · `,K(e.totals.steps,`step`),` · `,K(e.totals.asserts,`check`)]}),e.suites.length>0&&(0,G.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,K(e.suites.length,`execution list`)]}),e.totals.unsupported>0&&(0,G.jsxs)(`span`,{className:`text-warn`,children:[`· `,e.totals.unsupported===1?`1 step value cannot`:`${e.totals.unsupported} step values cannot`,` be converted`]})]})}function $e({view:e,file:t,setFile:n,found:i,setFound:a,only:s,setOnly:c}){let[l,u]=(0,W.useState)(e.exports.some(e=>e.path===t)?``:t),[d,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(``),g=async e=>{if(n(e),a(null),h(``),e){p(!0);try{let t=await r.inspect(e);a(t),c(new Set(t.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).map(e=>e.id)))}catch(e){h(e.message)}finally{p(!1)}}},_=e=>{let t=new Set(s);t.has(e)?t.delete(e):t.add(e),c(t)};return(0,G.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.exports.length>0?(0,G.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,G.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Tosca exports in this project`}),(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":`Tosca exports`,className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5`,children:e.exports.map(e=>(0,G.jsx)(Xe,{on:t===e.path,onPick:()=>void g(e.path),logo:(0,G.jsx)(ee,{size:18,"aria-hidden":`true`,className:`text-ink-2`}),title:e.path.slice(e.path.lastIndexOf(`/`)+1),sub:`${e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):`.`} · ${Ze(e.bytes)}`,label:e.path},e.path))})]}):(0,G.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-3 text-sm text-ink-2`,children:[`No Tosca export (.tsu) in this project yet. Export the test cases from Tosca Commander, put the file inside the project, for example `,(0,G.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:`tosca/checkout.tsu`}),`, and type its path below.`]}),(0,G.jsx)(Q,{id:`tsc-path`,label:e.exports.length?`Or type its path`:`Path of the export`,help:`Inside the project. Secrets in it stay encrypted: they become environment variables.`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,G.jsx)(w,{id:`tsc-path`,value:l,spellCheck:!1,maxLength:300,placeholder:`tosca/checkout.tsu`,onChange:e=>u(e.target.value),className:`min-w-0 flex-[1_1_300px]`}),(0,G.jsx)(o,{disabled:d||!l.trim(),onClick:()=>void g(l.trim()),children:d?`Reading…`:`Read it`})]})}),m&&(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:m}),d&&!m&&(0,G.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Reading the export…`}),i&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Qe,{s:i}),(0,G.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,G.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Test cases to convert`}),(0,G.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:i.test_cases.map(e=>{let t=e.route===`web`||(e.routes?.web??0)>0;return(0,G.jsx)(`li`,{className:`border-b border-line-soft last:border-b-0`,children:(0,G.jsxs)(`label`,{className:f(`flex min-h-11 items-start gap-3 px-4 py-2.5`,t?`cursor-pointer`:``),children:[(0,G.jsx)(`input`,{type:`checkbox`,className:`mt-0.5`,disabled:!t,checked:t&&s.has(e.id),onChange:()=>_(e.id)}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`font-medium text-ink [overflow-wrap:anywhere]`,children:e.name}),(0,G.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.folders.join(` / `)||`–`,` · `,K(e.steps,`step`),` · `,K(e.asserts,`check`),e.unsupported?` · ${e.unsupported} not convertible`:``,e.suites.length?` · in ${e.suites.join(`, `)}`:``]})]}),(0,G.jsx)(D,{tone:t?`neutral`:`warn`,children:e.route===`web`?J.web:t?`${J.web} + notes`:`${J[e.route]||e.route}: later`})]})},e.id)})})]}),i.env.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:`Environment variables`}),(0,G.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[i.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`. Their values are never in the export; you set them before the tests run.`]})]})]})]})}function et({view:e,to:t,setTo:n,into:r,setInto:i,attr:a,setAttr:o}){let s=e=>e.split(`-`)[0],c=e=>e.split(`-`).slice(1).join(`-`),l=[...new Map(e.targets.map(e=>[s(e.id),e.framework])).entries()],u=e.targets.filter(e=>s(e.id)===s(t));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,G.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Framework`}),(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":`Framework`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:l.map(([r,i])=>{let a=se[r];return(0,G.jsx)(Xe,{on:s(t)===r,onPick:()=>n((e.targets.find(e=>s(e.id)===r&&c(e.id)===c(t))||e.targets.find(e=>s(e.id)===r)).id),logo:a?(0,G.jsx)(a,{width:22,height:22,"aria-hidden":`true`}):null,title:i,sub:Je[r],label:i},r)})})]}),(0,G.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2.5 border-0 p-0`,children:[(0,G.jsx)(`legend`,{className:`mb-2.5 text-sm font-medium`,children:`Language`}),(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":`Language`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2.5`,children:u.map(e=>{let r=oe[c(e.id)];return(0,G.jsx)(Xe,{on:t===e.id,onPick:()=>n(e.id),logo:r?(0,G.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:e.language,label:e.language},e.id)})})]}),(0,G.jsxs)(`div`,{className:`grid gap-4 @2xl:grid-cols-2`,children:[(0,G.jsx)(Q,{id:`tsc-into`,label:`Output folder`,help:`A new folder. Empty: named after the target.`,children:(0,G.jsx)(w,{id:`tsc-into`,value:r,spellCheck:!1,maxLength:300,placeholder:`tosca-${t}`,onChange:e=>i(e.target.value)})}),(0,G.jsx)(Q,{id:`tsc-attr`,label:`Test id attribute (optional)`,help:`When the app's is not data-test-id, data-testid, data-test, data-cy or data-qa.`,children:(0,G.jsx)(w,{id:`tsc-attr`,value:a,spellCheck:!1,maxLength:40,placeholder:`data-automation-id`,onChange:e=>o(e.target.value.replace(/[^A-Za-z0-9_-]/g,``))})})]})]})}function tt({view:e,file:t,found:n,only:r,to:i,instructions:a}){let o=e.targets.find(e=>e.id===i),s=(e,t)=>(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-b border-line-soft py-3.5 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-muted`,children:e}),(0,G.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,G.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-5`,children:[s(`Export`,t?(0,G.jsx)(`span`,{className:`font-mono text-[12.5px] [overflow-wrap:anywhere]`,children:t}):(0,G.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Test cases`,n?(0,G.jsxs)(`span`,{children:[r.size,` of `,n.test_cases.length,` picked`]}):(0,G.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Target`,o?(0,G.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,G.jsx)(V,{framework:o.id.split(`-`)[0],language:o.id.split(`-`).slice(1).join(`-`)}),o.title]}):(0,G.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Instructions`,a.trim()?(0,G.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:a.trim()}):(0,G.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function nt({view:t,review:n,onStart:a}){let[o,s]=(0,W.useState)(0),[c,l]=(0,W.useState)(0),[u,d]=(0,W.useState)(``),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(new Set),[g,_]=(0,W.useState)(t.targets[0]?.id||``),[v,y]=(0,W.useState)(``),[b,x]=(0,W.useState)(``),[S,w]=(0,W.useState)(``),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(!1),[k,A]=(0,W.useState)(!1),[j,N]=(0,W.useState)(``),P=[...m].sort().join(`,`);(0,W.useEffect)(()=>{E(null),O(!1),l(e=>Math.min(e,2))},[u,P,g,v,b,S]);let F=e=>{s(e),l(t=>Math.max(t,e)),N(``)},I=async()=>{A(!0),N(``);try{let e=!f||f.test_cases.filter(e=>e.route===`web`||(e.routes?.web??0)>0).every(e=>m.has(e.id)),t=await r.plan({file:u,to:g,...v.trim()?{into:v.trim()}:{},...e?{}:{only:[...m]},...S.trim()?{instructions:S.trim()}:{},...b?{testAttributes:[b]}:{}});E(t),F(3)}catch(e){N(e.message)}finally{A(!1)}},L=T?.plan,R=L?.feasibility.findings.some(e=>e.level===`limit`),z=L?.feasibility.verdict===`blocked`;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsx)(Ye,{at:o,reached:c,onGo:e=>!k&&(e<3||T)&&s(e)}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,G.jsxs)(`section`,{"aria-labelledby":`tsc-step`,className:`flex min-w-0 flex-col gap-5`,children:[(0,G.jsx)(`h2`,{id:`tsc-step`,className:`m-0 text-[22px] font-semibold tracking-[-0.01em]`,children:[`Which Tosca export?`,`What should the tests become?`,`Anything the agent should know?`,`Review and start`][o]}),j&&(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:j}),o===0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)($e,{view:t,file:u,setFile:d,found:f,setFound:p,only:m,setOnly:h}),(0,G.jsx)($,{busy:k,next:`Continue`,onNext:()=>F(1),disabled:!f||!m.size,aside:f&&!m.size?(0,G.jsx)(`span`,{className:`text-muted`,children:`Pick at least one web test case.`}):void 0})]}),o===1&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(et,{view:t,to:g,setTo:_,into:v,setInto:y,attr:b,setAttr:x}),(0,G.jsx)($,{busy:k,onBack:()=>s(0),next:`Continue`,onNext:()=>F(2),disabled:!g})]}),o===2&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Q,{id:`tsc-instructions`,label:`Instructions (optional)`,help:`Style and structure for the new code. Every Tosca step and check is kept either way.`,children:(0,G.jsx)(M,{id:`tsc-instructions`,value:S,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per Tosca module.`,onChange:e=>w(e.target.value)})}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:qe.map(t=>(0,G.jsxs)(`button`,{type:`button`,disabled:S.includes(t),onClick:()=>w(S.trim()?`${S.trim()}\n${t}`:t),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 rounded-[8px] border-0 bg-surface-strong px-2.5 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,children:[(0,G.jsx)(e,{size:13,"aria-hidden":`true`}),t]},t))}),(0,G.jsx)($,{busy:k,onBack:()=>s(1),next:k?`Checking…`:`Check the plan`,onNext:()=>void I(),aside:(0,G.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),o===3&&L&&(0,G.jsxs)(G.Fragment,{children:[n(L,D,O),(0,G.jsx)($,{busy:k,onBack:()=>s(2),next:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(C,{icon:i,size:15}),`Start conversion`]}),disabled:z||R&&!D,onNext:()=>a(T,!!R&&D),aside:(0,G.jsx)(`span`,{className:`text-muted`,children:z?`Change what is not possible first.`:R&&!D?`Accept the limits to start.`:`Runs in the background.`})})]})]}),(0,G.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,G.jsx)(tt,{view:t,file:u,found:f,only:m,to:g,instructions:S})})]})]})}function rt({children:e,wide:t}){return(0,G.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,G.jsx)(N,{}),(0,G.jsx)(`main`,{className:f(F,`@container flex-auto gap-5`,t?`max-w-[1480px]`:`max-w-[1180px]`),children:e})]})}function it({action:e}){return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(p,{pixel:R.tosca,size:`lg`}),(0,G.jsx)(`h1`,{className:`m-0 text-[26px] font-semibold tracking-[-0.01em]`,children:`Tosca`})]}),(0,G.jsx)(ie,{label:`Migration`,links:ae,current:`tosca`}),(0,G.jsx)(`span`,{className:`flex-1`}),e]})}function at({error:e}){return e?(0,G.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e}):null}function ot({title:e,children:t}){let[n,r]=(0,W.useState)(!1),i=(0,W.useId)();return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":n,"aria-controls":i,onClick:()=>r(!n),className:`inline-flex min-h-8 cursor-pointer items-center gap-1.5 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,G.jsx)(s,{size:15,"aria-hidden":`true`,className:f(`transition-transform`,n&&`rotate-180`)}),e]}),(0,G.jsx)(k,{open:n,id:i,children:t})]})}function st({plan:e,accepted:t,onAccept:n}){let r=e.feasibility.findings.filter(e=>e.level===`blocker`),i=e.feasibility.findings.filter(e=>e.level===`limit`),a=e.cases.filter(e=>e.included),o=e.units.filter(e=>e.kind===`page`).length;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,G.jsxs)(`dl`,{className:`m-0 grid gap-x-6 gap-y-2.5 rounded-[14px] card border px-5 py-4 text-sm @xl:grid-cols-[auto_1fr]`,children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,G.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[`Tricentis Tosca`,(0,G.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,(0,G.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:e.source.file}),e.source.project?` · ${e.source.project}`:``]})]}),(0,G.jsx)(`dt`,{className:`text-muted`,children:`To`}),(0,G.jsxs)(`dd`,{className:`m-0`,children:[e.target.title,(0,G.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.target.dir]})]}),(0,G.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,G.jsxs)(`dd`,{className:`m-0`,children:[a.length,` test`,a.length===1?``:`s`,` of `,e.cases.length,` test case`,e.cases.length===1?``:`s`,`, `,o,` page object`,o===1?``:`s`]}),(e.suites||[]).length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`Suites`}),(0,G.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.suites.map(e=>`${e.name} (${K(e.cases.length,`test`)})`).join(`, `),(0,G.jsxs)(`span`,{className:`block text-[12.5px] text-muted`,children:[`Tosca's execution lists, as tags on the tests: `,e.suites.map(e=>`@${e.tag}`).join(`, `),`.`]})]})]}),e.env.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`Environment variables`}),(0,G.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),(0,G.jsx)(`span`,{className:`block text-[12.5px] text-muted`,children:`Never in the export: you set them before the tests run.`})]})]}),e.instructions&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:`Instructions`}),(0,G.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.instructions})]})]}),r.length>0&&(0,G.jsxs)(`section`,{"aria-labelledby":`tsc-blockers`,className:`flex flex-col gap-2 rounded-[14px] bg-fail-soft px-5 py-4`,children:[(0,G.jsxs)(`h3`,{id:`tsc-blockers`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-fail`,children:[(0,G.jsx)(S,{size:16,"aria-hidden":`true`}),`Not possible`]}),(0,G.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5 text-sm text-ink`,children:r.map(e=>(0,G.jsx)(`li`,{children:e.text},e.code))})]}),i.length>0&&(0,G.jsxs)(`section`,{"aria-labelledby":`tsc-limits`,className:`flex flex-col gap-3 rounded-[14px] bg-warn-soft px-5 py-4`,children:[(0,G.jsxs)(`h3`,{id:`tsc-limits`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-warn`,children:[(0,G.jsx)(S,{size:16,"aria-hidden":`true`}),`Before you start`]}),(0,G.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1.5 pl-5 text-sm text-ink`,children:i.map(e=>(0,G.jsx)(`li`,{children:e.text},e.code))}),n&&!r.length&&(0,G.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm font-medium`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:!!t,onChange:e=>n(e.target.checked)}),`I understand`]})]}),(0,G.jsx)(ot,{title:`Test cases (${e.cases.length})`,children:(0,G.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.cases.map(e=>(0,G.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,G.jsx)(`span`,{className:f(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.included?`text-ink`:`text-muted`),children:e.name}),(0,G.jsx)(`span`,{className:`text-muted`,children:e.included?`${K(e.steps,`step`)} · ${K(e.asserts,`check`)}`:e.why}),(0,G.jsx)(`span`,{className:`w-16 flex-none text-right text-muted`,children:J[e.route]||e.route})]},e.id))})}),(0,G.jsx)(ot,{title:`Files, in order (${e.units.length})`,children:(0,G.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.units.map(e=>(0,G.jsxs)(`li`,{className:`flex flex-wrap gap-x-3 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,G.jsx)(`span`,{className:`w-16 flex-none text-muted`,children:me[e.kind]}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.target})]},e.id))})})]})}function ct({plan:e,acceptLimits:t,onClose:n,onStarted:i}){let[a,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(!1),[u,d]=(0,W.useState)(``),f=async()=>{l(!0),d(``);try{i((await r.start(e.id,a,t)).detail)}catch(e){d(e.message),l(!1)}};return(0,G.jsx)(O,{open:!0,onClose:n,title:`Start the conversion`,description:`The Tosca test cases are written as ${e.target.title} tests in ${e.target.dir}, and ForgeQE runs each one. It runs in the background; the Tosca export is not changed.`,footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(o,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,G.jsx)(o,{variant:`primary`,disabled:c||a!==e.id,onClick:()=>void f(),children:`Start conversion`})]}),children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,G.jsxs)(`span`,{children:[`Type `,(0,G.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,G.jsx)(w,{value:a,onChange:e=>s(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,G.jsx)(at,{error:u})]})})}function lt({d:e,onStarted:t}){let[n,r]=(0,W.useState)(!1),[a,s]=(0,W.useState)(!1),c=e.plan.feasibility.findings.some(e=>e.level===`limit`),l=e.plan.feasibility.verdict===`blocked`,u=!!e.job?.running;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e.job?.last&&!u&&(0,G.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-3 py-2 text-sm text-fail`,children:`The last start did not run. Its job's log on the Jobs page says why.`}),(0,G.jsx)(st,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r}),!l&&!u&&(0,G.jsx)(`div`,{children:(0,G.jsxs)(o,{variant:`primary`,disabled:!e.confirmed&&c&&!n,onClick:()=>s(!0),children:[(0,G.jsx)(i,{"aria-hidden":`true`}),`Start conversion`]})}),a&&(0,G.jsx)(ct,{plan:e.plan,acceptLimits:c&&(e.confirmed||n),onClose:()=>s(!1),onStarted:e=>{s(!1),t(e)}})]})}function ut(e){return e.result?.status===`running`?`running`:e.result?.status===`converted`?`done`:e.result?`review`:`planned`}function dt(e){return e.result?pe[e.result.status]:e.confirmed?{label:`Confirmed`,tone:`neutral`}:fe[e.verdict]}var ft=e=>e.slice(e.lastIndexOf(`/`)+1);function pt({view:e}){let[t,n]=(0,W.useState)(`all`),r=t=>t===`all`?e.plans.length:e.plans.filter(e=>ut(e)===t).length,i=e.plans.filter(e=>t===`all`||ut(e)===t),a=e=>location.hash=u(`tosca`,e);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(ce,{children:[(0,G.jsx)(U,{label:`All`,value:r(`all`),onClick:()=>n(`all`),on:t===`all`}),(0,G.jsx)(U,{label:`Running`,value:r(`running`),onClick:()=>n(`running`),on:t===`running`}),(0,G.jsx)(U,{label:`Converted`,value:r(`done`),tone:r(`done`)?`text-pass`:void 0,onClick:()=>n(`done`),on:t===`done`}),(0,G.jsx)(U,{label:`Needs review`,value:r(`review`),tone:r(`review`)?`text-warn`:void 0,onClick:()=>n(`review`),on:t===`review`})]}),(0,G.jsx)(T,{label:`Conversions`,placeholder:`Find a conversion`,empty:t===`all`?`No conversions.`:`None here.`,resetKey:t,head:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`th`,{className:`py-1.5 pr-3 pl-3 font-medium`,children:`Conversion`}),(0,G.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Tests`}),(0,G.jsx)(`th`,{className:`py-1.5 pr-3 font-medium`,children:`Status`}),(0,G.jsx)(`th`,{className:`hidden py-1.5 pr-3 font-medium @xl:table-cell`,children:`Updated`})]}),children:i.map(e=>{let t=dt(e),n=e.result?e.result.status===`converted`||e.result.endedAt?100:Math.min(99,Math.round(e.result.done/Math.max(1,e.units||e.tests+1)*95)):0;return(0,G.jsxs)(`tr`,{onClick:()=>a(e.id),className:j,children:[(0,G.jsx)(`td`,{className:I,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`hidden flex-none items-center gap-1 @xl:inline-flex`,"aria-hidden":`true`,children:(0,G.jsx)(V,{framework:e.targetId.split(`-`)[0],language:e.targetId.split(`-`).slice(1).join(`-`),size:18})}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsxs)(`a`,{href:u(`tosca`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline hover:underline`,children:[ft(e.file),` to `,e.target]}),(0,G.jsxs)(`span`,{className:`block text-[12px] text-muted`,children:[e.project?`${e.project} · `:``,e.into]})]})]})}),(0,G.jsx)(`td`,{className:f(I,`w-[180px] text-[13px]`),children:e.result?.status===`running`?(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(de,{value:n,label:`${ft(e.file)} to ${e.target}: progress`}),(0,G.jsxs)(`span`,{className:`w-9 flex-none text-right text-[12px] text-muted tabular-nums`,children:[n,`%`]})]}):e.result?(0,G.jsxs)(`span`,{className:e.result.converted===e.tests?`text-pass`:`text-ink-2`,children:[e.result.converted,` of `,e.tests,` pass`]}):(0,G.jsx)(`span`,{className:`text-muted`,children:`Not started`})}),(0,G.jsx)(`td`,{className:f(I,`whitespace-nowrap`),children:(0,G.jsx)(D,{tone:t.tone,children:t.label})}),(0,G.jsx)(`td`,{className:f(I,`hidden text-[12.5px] whitespace-nowrap text-muted @xl:table-cell`),children:ne(e.result?.endedAt||e.result?.at||e.createdAt)})]},e.id)})})]})}function mt({sub:e}){let[t,n]=(0,W.useState)(null),[i,a]=(0,W.useState)(``),[s,c]=(0,W.useState)(null),l=(0,W.useCallback)(()=>{r.list().then(e=>{n(e),a(``)},e=>a(e.message))},[]);(0,W.useEffect)(l,[l,e]);let d=t?.plans.some(e=>e.result?.status===`running`);(0,W.useEffect)(()=>{if(!d||e)return;let t=setInterval(l,3e3);return()=>clearInterval(t)},[d,e,l]);let f=e?.match(/^(tsc-\d{8}-\d{6}-[0-9a-f]{4})\/report$/),p=e&&/^tsc-\d{8}-\d{6}-[0-9a-f]{4}$/.test(e)?e:f?.[1]||``,m=!!f,h=()=>location.hash=u(`tosca`,`new`),g=!t&&!i&&(0,G.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});return e===`new`?(0,G.jsxs)(rt,{children:[(0,G.jsx)(it,{}),(0,G.jsx)(at,{error:i}),g,t&&(0,G.jsx)(nt,{view:t,review:(e,t,n)=>(0,G.jsx)(st,{plan:e,accepted:t,onAccept:n}),onStart:(e,t)=>c({d:e,accept:t})}),s&&(0,G.jsx)(ct,{plan:s.d.plan,acceptLimits:s.accept,onClose:()=>c(null),onStarted:e=>{c(null),location.hash=u(`tosca`,e.plan.id)}})]}):p&&m?(0,G.jsxs)(rt,{wide:!0,children:[(0,G.jsx)(it,{}),(0,G.jsx)(We,{id:p},p)]}):p?(0,G.jsxs)(rt,{wide:!0,children:[(0,G.jsx)(it,{}),(0,G.jsx)(at,{error:i}),g,t&&(0,G.jsx)(Fe,{id:p,plan:(e,t)=>(0,G.jsx)(lt,{d:e,onStarted:t})},p)]}):(0,G.jsxs)(rt,{children:[(0,G.jsx)(it,{action:t&&!t.plans.length?void 0:(0,G.jsx)(o,{variant:`primary`,disabled:!t,onClick:h,children:`New conversion`})}),(0,G.jsx)(at,{error:i}),g,t&&(t.plans.length?(0,G.jsx)(pt,{view:t}):(0,G.jsx)(v,{icon:A,title:`No Tosca conversions yet`,action:(0,G.jsx)(o,{size:`sm`,onClick:h,children:`New conversion`}),children:`Pick a Tosca export (.tsu) in this project and the framework its test cases become. Every Tosca step and check is kept, and nothing starts until you confirm.`}))]})}export{mt as Tosca};
@@ -1 +1 @@
1
- import{At as e,Co as t,Sa as n,_t as r,bo as i,dn as a,jn as o,kt as s,r as c,t as l,vo as u,xa as d,yt as f}from"./frame-PaIZHHuH.js";import{_ as p,g as m,h,m as g,p as _}from"./index-uKsXcgSa.js";var v=t(i(),1),y=u(),b={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function x({change:t,id:n,first:i}){let[s,c]=(0,v.useState)(!1),l=h(t);return(0,y.jsxs)(`li`,{className:d(!i&&`border-t border-line-soft`),children:[(0,y.jsxs)(`button`,{type:`button`,"aria-expanded":s,"aria-controls":n,onClick:()=>c(!s),className:`flex min-h-11 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,y.jsx)(r,{tone:b[t.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:b[t.kind].label}),(0,y.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:t.title}),(0,y.jsx)(o,{size:16,"aria-hidden":`true`,className:d(`flex-none text-muted transition-transform duration-200`,s&&`rotate-90`)})]}),(0,y.jsx)(e,{open:s,id:n,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 pt-1 pb-3 sm:pl-[100px]`,children:[(0,y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:t.detail}),l&&(0,y.jsxs)(`a`,{href:l,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,y.jsx)(a,{size:13,"aria-hidden":`true`})]})]})})]})}function S({release:e}){let t=e===_;return(0,y.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:d(`relative mt-1.5 size-[15px] flex-none rounded-full border-[3px] border-bg`,t?`bg-accent`:`bg-line`)}),(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,y.jsxs)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:[`ForgeQE `,e.version]}),t&&(0,y.jsx)(r,{tone:`running`,icon:!1,children:`Latest`}),(0,y.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,y.jsx)(`time`,{dateTime:e.date,children:p(e.date)}),` · `,n(e.changes.length,`change`)]})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,y.jsx)(`ul`,{className:`m-0 flex list-none flex-col overflow-hidden rounded-[12px] card border p-0`,children:e.changes.map((t,n)=>(0,y.jsx)(x,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function C({embedded:e=!1}={}){(0,v.useEffect)(m,[]);let t=g(),n=(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),t.map(e=>(0,y.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,y.jsx)(`h2`,{className:`m-0 pl-[31px] text-[22px] font-semibold`,children:e.month}),(0,y.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,y.jsx)(S,{release:e},e.version))})]},e.month))]})});return e?(0,y.jsx)(`div`,{className:`flex flex-col gap-5`,children:n}):(0,y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,y.jsx)(c,{}),(0,y.jsxs)(`main`,{className:d(l,`flex-auto gap-5`),children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,y.jsx)(s,{pixel:f[`whats-new`],size:`lg`}),(0,y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),n]})]})}export{b as KIND,C as WhatsNew};
1
+ import{Ao as e,Do as t,Ln as n,Oa as r,Ot as i,To as a,_n as o,gt as s,ka as c,kt as l,r as u,t as d,vt as f}from"./frame-BY4TCOKb.js";import{_ as p,g as m,h,m as g,p as _}from"./index-2XeVj3Uw.js";var v=e(t(),1),y=a(),b={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function x({change:e,id:t,first:i}){let[a,c]=(0,v.useState)(!1),u=h(e);return(0,y.jsxs)(`li`,{className:r(!i&&`border-t border-line-soft`),children:[(0,y.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":t,onClick:()=>c(!a),className:`flex min-h-11 w-full cursor-pointer items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,y.jsx)(s,{tone:b[e.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:b[e.kind].label}),(0,y.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,y.jsx)(n,{size:16,"aria-hidden":`true`,className:r(`flex-none text-muted transition-transform duration-200`,a&&`rotate-90`)})]}),(0,y.jsx)(l,{open:a,id:t,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 pt-1 pb-3 sm:pl-[100px]`,children:[(0,y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.detail}),u&&(0,y.jsxs)(`a`,{href:u,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,y.jsx)(o,{size:13,"aria-hidden":`true`})]})]})})]})}function S({release:e}){let t=e===_;return(0,y.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:r(`relative mt-1.5 size-[15px] flex-none rounded-full border-[3px] border-bg`,t?`bg-accent`:`bg-line`)}),(0,y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,y.jsxs)(`h3`,{className:`m-0 text-[15px] font-semibold`,children:[`ForgeQE `,e.version]}),t&&(0,y.jsx)(s,{tone:`running`,icon:!1,children:`Latest`}),(0,y.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,y.jsx)(`time`,{dateTime:e.date,children:p(e.date)}),` · `,c(e.changes.length,`change`)]})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,y.jsx)(`ul`,{className:`m-0 flex list-none flex-col overflow-hidden rounded-[12px] card border p-0`,children:e.changes.map((t,n)=>(0,y.jsx)(x,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function C({embedded:e=!1}={}){(0,v.useEffect)(m,[]);let t=g(),n=(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),t.map(e=>(0,y.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,y.jsx)(`h2`,{className:`m-0 pl-[31px] text-[22px] font-semibold`,children:e.month}),(0,y.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,y.jsx)(S,{release:e},e.version))})]},e.month))]})});return e?(0,y.jsx)(`div`,{className:`flex flex-col gap-5`,children:n}):(0,y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,y.jsx)(u,{}),(0,y.jsxs)(`main`,{className:r(d,`flex-auto gap-5`),children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,y.jsx)(i,{pixel:f[`whats-new`],size:`lg`}),(0,y.jsx)(`h1`,{className:`m-0 flex-1 text-[26px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,y.jsx)(`p`,{className:`m-0 max-w-[70ch] text-sm leading-relaxed text-ink-2`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),n]})]})}export{b as KIND,C as WhatsNew};