@capagents/forgeqe 3.4.1 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/forgeqe.js +1977 -1977
  2. package/dist/web/assets/{Agent-FGPuvhc5.js → Agent-C5oBtGk7.js} +1 -1
  3. package/dist/web/assets/{AgentWork-CFw0XcKd.js → AgentWork-DJ8Vs06n.js} +1 -1
  4. package/dist/web/assets/{ApiTests-D5rqD6gA.js → ApiTests-BLCfYh51.js} +1 -1
  5. package/dist/web/assets/{Chat-DS4jyAH3.js → Chat-Cv8DeS-_.js} +1 -1
  6. package/dist/web/assets/{Compare-BFDv-NmH.js → Compare-DaIqZceW.js} +1 -1
  7. package/dist/web/assets/{Cost-_h1bxSj0.js → Cost-CITIwCiU.js} +1 -1
  8. package/dist/web/assets/{Data-BuIpjLOr.js → Data-DSoaKTFT.js} +1 -1
  9. package/dist/web/assets/{Desktop-F-PyYzC0.js → Desktop-CSaj8gd9.js} +1 -1
  10. package/dist/web/assets/{DesktopReview-CODdFSMN.js → DesktopReview-Dz5XOBgo.js} +1 -1
  11. package/dist/web/assets/{Evidence-BXr78jgr.js → Evidence-WRJ5Ocx1.js} +1 -1
  12. package/dist/web/assets/{Explore-AAssIdGu.js → Explore-CnsxID-z.js} +1 -1
  13. package/dist/web/assets/{Features-Ce2hYdNS.js → Features-Do6F_oaP.js} +1 -1
  14. package/dist/web/assets/{Flags-DRXJnHt4.js → Flags-KtTYNU6g.js} +1 -1
  15. package/dist/web/assets/{Flaky-BGUyv4_b.js → Flaky-BBPNCZOq.js} +1 -1
  16. package/dist/web/assets/{Impact-B6F9nuZt.js → Impact-DXpXmLyE.js} +1 -1
  17. package/dist/web/assets/{Jobs-BsP-lQnC.js → Jobs-Fj0wBOAO.js} +1 -1
  18. package/dist/web/assets/{KindPage-jQ0mJt7b.js → KindPage--MHC32ho.js} +1 -1
  19. package/dist/web/assets/{LiveDevice-C0OpjAg0.js → LiveDevice-CuJzvCUi.js} +1 -1
  20. package/dist/web/assets/{Migration-yiY2-7f3.js → Migration-6aYe_2EG.js} +1 -1
  21. package/dist/web/assets/{Mobile-DcL2FOJg.js → Mobile-Dv6f7u3D.js} +1 -1
  22. package/dist/web/assets/{Observability-BdpwjRNO.js → Observability-Dqb01Eyo.js} +1 -1
  23. package/dist/web/assets/{OwnItems-DRV4_VbL.js → OwnItems-BWX70VhE.js} +1 -1
  24. package/dist/web/assets/{PageAgent-C_DrJ3kc.js → PageAgent-CPVv-rb3.js} +1 -1
  25. package/dist/web/assets/{Product-BoLtQxi6.js → Product-Bg8GLZO1.js} +1 -1
  26. package/dist/web/assets/{Production-DgMWWNd_.js → Production-D_-UKwAW.js} +1 -1
  27. package/dist/web/assets/{Quality-Dfh-gpB-.js → Quality-AK4ooDrk.js} +1 -1
  28. package/dist/web/assets/{Readiness-BzlzH-RQ.js → Readiness-oW5ApJNH.js} +1 -1
  29. package/dist/web/assets/{Record-BpL7Br8t.js → Record-DB3vbV-C.js} +1 -1
  30. package/dist/web/assets/{Regression-VL1J4PQB.js → Regression-DuYa0h-o.js} +1 -1
  31. package/dist/web/assets/{Reports-CzJULGPA.js → Reports-1mP0MxVQ.js} +1 -1
  32. package/dist/web/assets/{Requirements-CsfwSrgh.js → Requirements-BRXFZQuu.js} +1 -1
  33. package/dist/web/assets/{Responsive-GfKHZLev.js → Responsive-CnoYMfsl.js} +1 -1
  34. package/dist/web/assets/{RunDiff-DZw8Jja0.js → RunDiff-Wro2Olyz.js} +1 -1
  35. package/dist/web/assets/{Settings-CiMIX_QR.js → Settings-DBCDjRxF.js} +3 -3
  36. package/dist/web/assets/{SiteScan-Cydt89Ja.js → SiteScan-BkdOUe_S.js} +1 -1
  37. package/dist/web/assets/{Steps-BoyXqIqo.js → Steps-ndafqk8T.js} +1 -1
  38. package/dist/web/assets/{TestData-Jwowbnv2.js → TestData-4P28hX0Q.js} +1 -1
  39. package/dist/web/assets/{TestManagement-BPx01M_H.js → TestManagement-Dohg2yyF.js} +1 -1
  40. package/dist/web/assets/{WhatsNew-DAtb7FTn.js → WhatsNew-Bcv9S0Tj.js} +1 -1
  41. package/dist/web/assets/{agentSettingsSheet-DxBRwlvu.js → agentSettingsSheet-ElGgFEeo.js} +1 -1
  42. package/dist/web/assets/{dataParts-DvgtfSmo.js → dataParts-_MZY-U_N.js} +1 -1
  43. package/dist/web/assets/frame-wloj3-xC.js +139 -0
  44. package/dist/web/assets/{index-nbjwmmih.js → index-BCu9qAny.js} +4 -4
  45. package/dist/web/assets/{productParts-tf1w_F1S.js → productParts-Pp0gh7QX.js} +1 -1
  46. package/dist/web/assets/{qualityParts-O56nH8FQ.js → qualityParts-diTrGtUR.js} +1 -1
  47. package/dist/web/index.html +2 -2
  48. package/package.json +1 -1
  49. package/dist/web/assets/frame-Z5TaJY7O.js +0 -23
@@ -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"./utils-DJRAScIl.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{L as a}from"./palette-DOQemIAv.js";import{b as ee,v as o}from"./api-B8AQ8-Gb.js";import{A as s,F as c,I as l,P as u,T as d,g as f,n as p,o as m}from"./pageBack-CINGjBHZ.js";import{Er as h,F as g,Gr as _,N as v,P as y,Un as b,ct as te,o as ne,vn as x,z as S,zn as C}from"./line-icons-Cwj9OmCz.js";import{bt as w,en as T,mt as E,s as D,t as O}from"./frame-Z5TaJY7O.js";import{B as k,V as A,z as j}from"./index-nbjwmmih.js";import{d as re}from"./qualityParts-O56nH8FQ.js";var M=e(t(),1),N={view:(e=!1)=>o(`GET`,`/api/production${e?`?refresh=1`:``}`)},P=i(),F={sentry:`Sentry`,datadog:`Datadog`,appinsights:`App Insights`},I={fatal:{label:`Fatal`,tone:`text-fail`},error:{label:`Error`,tone:`text-fail`},warning:{label:`Warning`,tone:`text-warn`},info:{label:`Info`,tone:`text-muted`}};function L(e,t,n){return e.flatMap(e=>{let r=e.issues.filter(e=>(t===`all`||!e.coverage.covered)&&(n===`all`||e.provider===n));return r.length?[{...e,issues:r}]:[]})}var R=e=>e&&m(e)===`web`?e:void 0,z=e=>n(`record`,encodeURIComponent(e));function B({p:e}){let t=e.error||e.problem?S:e.configured?v:y,n=e.error||e.problem?`Not read`:e.configured?`Connected`:`Not set up`,i=e.error||e.problem?`text-fail`:e.configured?`text-pass`:`text-muted`;return(0,P.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-2 text-body-sm`,children:[(0,P.jsx)(t,{size:15,"aria-label":n,className:r(`mt-1 flex-none`,i)}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:e.label}),e.host&&(0,P.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.host]}),(0,P.jsxs)(`span`,{className:`text-ink-2`,children:[` — `,e.problem?e.problem:e.error?e.error:e.configured?`${e.issues} issue${e.issues===1?``:`s`}${e.fetchedAt?`, read ${E(e.fetchedAt)}`:``}`:e.missing.length?`set ${e.missing.join(` and `)}`:`not set up`]})]})]})}function V({i:e}){if(!e.coverage.covered)return(0,P.jsxs)(`span`,{className:`flex items-center gap-2 whitespace-nowrap text-warn`,children:[(0,P.jsx)(h,{size:14,"aria-label":`No test`,className:`flex-none`}),`No test`]});let t=[...e.coverage.runs.map(e=>e.goal?`${e.id} (${e.goal})`:e.id),...e.coverage.tests],n=e.coverage.runs[0]?.id??e.coverage.tests[0]??``;return(0,P.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,"data-tip":`Covered by ${e.coverage.how===`page`?`a run on this page`:`a test named for this page`}: ${t.join(`, `)}`,children:[(0,P.jsx)(v,{size:14,"aria-label":`Covered`,className:`flex-none text-pass`}),(0,P.jsxs)(`span`,{className:`truncate`,children:[n,t.length>1?` +${t.length-1}`:``]})]})}function H(){let[e,t]=(0,M.useState)(null),[i,o]=(0,M.useState)(``),[m,H]=(0,M.useState)(`uncovered`),[U,W]=(0,M.useState)(`all`),[G,K]=(0,M.useState)(!1),[q,J]=(0,M.useState)(``),[Y,X]=(0,M.useState)(null),Z=(0,M.useCallback)((e=!1)=>{K(e),N.view(e).then(e=>{t(e),o(``),K(!1)},e=>{o(e.message),K(!1)})},[]);(0,M.useEffect)(()=>Z(),[Z]);let ie=e=>{if(e.repro){if(e.repro.on===`production`)return X(e);location.hash=z(e.repro.url)}},ae=async e=>{K(!0);try{let{id:t}=await ee.start(e.ask,{});location.hash=n(`chats`,t)}catch(e){J(e.message),K(!1)}},Q=e?.providers.filter(e=>e.configured)??[],oe=e?L(e.pages,m,U):[],$=[`sentry`,`datadog`,`appinsights`].filter(t=>e?.pages.some(e=>e.issues.some(e=>e.provider===t)));return(0,P.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,P.jsx)(D,{}),(0,P.jsxs)(`main`,{className:r(O,`@container flex-auto gap-4`),children:[(0,P.jsx)(p,{}),(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,P.jsx)(T,{pixel:a.production,size:`lg`,head:!0}),(0,P.jsx)(`h1`,{className:`m-0 flex-1 text-headline-md`,children:`Production signals`}),Q.length>0&&(0,P.jsxs)(u,{size:`sm`,disabled:G,onClick:()=>Z(!0),"data-tip":`Read again`,children:[(0,P.jsx)(b,{"aria-hidden":`true`}),`Refresh`]})]}),(0,P.jsx)(A,{more:(0,P.jsxs)(P.Fragment,{children:[`The errors of the last 14 days come from Sentry, Datadog and Azure Application Insights, grouped by the page they happened on. Each one says which browser run or automated test already goes to that page, or that no test does. This page only reads: nothing is changed at the provider. Record a repro opens `,(0,P.jsx)(`a`,{href:n(`record`),children:`Record`}),` at the same page on `,e?.testEnvironment?(0,P.jsxs)(P.Fragment,{children:[`the `,e.testEnvironment,` environment`]}):`your test environment`,`. A tracker is set up with `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations.sentry`}),`, `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations.datadog`}),` or `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations.appinsights`}),` in forgeqe.yaml, its keys saved in Settings under the variable names the trackers list shows; Sentry uses the same settings as its MCP server.`]}),children:`See the errors real users hit, and which of them no test covers yet.`}),i&&(0,P.jsx)(`p`,{role:`alert`,className:r(l.fail,`m-0`),children:i}),!e&&!i&&(0,P.jsx)(f,{shape:`rows`,count:3}),e&&Q.length>0&&(0,P.jsx)(`ul`,{"aria-label":`Error trackers`,className:`m-0 flex list-none flex-col divide-y divide-line-soft border-y border-line-soft p-0`,children:e.providers.map(e=>(0,P.jsx)(B,{p:e},e.id))}),e&&!Q.length&&(0,P.jsxs)(s,{page:!0,icon:C,title:`No error tracker set up`,action:(0,P.jsxs)(`a`,{className:c({size:`sm`}),href:n(`settings`,`integrations`),"data-tip":`Open Integrations in Settings`,children:[(0,P.jsx)(ne,{"aria-hidden":`true`}),`Integrations`]}),children:[`Connect Sentry, Datadog or Azure Application Insights, and the errors real users hit show here, grouped by page. In forgeqe.yaml that is one of the `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations`}),`, with its keys saved in Settings.`,e.providers.some(e=>e.problem||e.error||e.missing.length)&&(0,P.jsx)(`ul`,{"aria-label":`Error trackers`,className:`m-0 mt-2 flex list-none flex-col p-0 text-left`,children:e.providers.map(e=>(0,P.jsx)(B,{p:e},e.id))})]}),e&&Q.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{label:`Errors in the last 14 days`,children:[(0,P.jsx)(k,{dot:`neutral`,value:e.counts.issues,label:`errors on ${e.pages.length} page${e.pages.length===1?``:`s`}`}),(0,P.jsx)(`span`,{className:`flex items-center`,"data-tip":`No run or test goes there`,children:(0,P.jsx)(k,{dot:e.counts.uncovered?`warn`:`pass`,value:e.counts.uncovered,label:`with no test`})}),(0,P.jsx)(k,{dot:`neutral`,value:e.counts.events.toLocaleString(),label:`events`}),(0,P.jsx)(`span`,{className:`flex items-center`,"data-tip":`Added up per error`,children:(0,P.jsx)(k,{dot:`neutral`,value:e.counts.users.toLocaleString(),label:`users affected`})})]}),Y?.repro&&(0,P.jsxs)(`div`,{role:`group`,"aria-label":`Record on production`,className:r(l.warn,`flex flex-wrap items-center gap-2`),children:[(0,P.jsx)(h,{size:15,"aria-label":`Warning`,className:`flex-none text-warn`}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[`No test environment is active, so the recording would open the production page `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:Y.repro.url}),`. Real data is there: record only steps that read.`]}),(0,P.jsxs)(u,{size:`sm`,onClick:()=>{let e=Y.repro.url;X(null),location.hash=z(e)},"data-tip":`Record on production`,children:[(0,P.jsx)(g,{"aria-hidden":`true`}),`Record`]}),(0,P.jsxs)(u,{size:`sm`,variant:`outline`,onClick:()=>X(null),children:[(0,P.jsx)(_,{"aria-hidden":`true`}),`Cancel`]})]}),q&&(0,P.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-ink-2`,children:q}),$.length>1&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,P.jsx)(d,{items:[{id:`all`,label:`All trackers`},...$.map(t=>({id:t,label:F[t],n:e.pages.reduce((e,n)=>e+n.issues.filter(e=>e.provider===t).length,0)}))],value:U,onChange:W})}),e.counts.issues===0?(0,P.jsx)(s,{icon:v,title:`No errors in the last 14 days`,children:`The trackers that are set up report no unresolved errors.`}):(0,P.jsx)(w,{label:`Errors by page`,placeholder:`Find an error, page or test`,height:`max(320px, calc(var(--screen) - 288px))`,resetKey:`${m}-${U}`,empty:m===`uncovered`?`Every error here has a test.`:`Nothing matches.`,tools:(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,P.jsx)(d,{items:[{id:`uncovered`,label:`No test`,n:L(e.pages,`uncovered`,U).reduce((e,t)=>e+t.issues.length,0),alert:!0},{id:`all`,label:`All`,n:L(e.pages,`all`,U).reduce((e,t)=>e+t.issues.length,0)}],value:m,onChange:H})}),head:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[38%]`),children:`Error`}),(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Tracker`}),(0,P.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,children:`Events`}),(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Users`}),(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Last seen`}),(0,P.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`Covered by`}),(0,P.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,P.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:oe.map(e=>(0,P.jsxs)(M.Fragment,{children:[(0,P.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted`,children:(0,P.jsx)(`td`,{colSpan:7,className:r(`px-4 py-2`,`max-w-0 text-body-sm`),children:(0,P.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono`,"data-tip":e.url||e.page||`The tracker names no page`,children:e.page||`No page named`}),(0,P.jsxs)(`span`,{className:`flex-none text-muted`,children:[e.issues.length,` error`,e.issues.length===1?``:`s`,e.uncovered?`, ${e.uncovered} with no test`:``]})]})})}),e.issues.map(e=>{let t=I[e.level],n=R(e.link);return(0,P.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`max-w-0`),children:(0,P.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.level===`info`?(0,P.jsx)(y,{size:15,"aria-label":t.label,className:r(`flex-none`,t.tone)}):e.level===`warning`?(0,P.jsx)(h,{size:15,"aria-label":t.label,className:r(`flex-none`,t.tone)}):(0,P.jsx)(S,{size:15,"aria-label":t.label,className:r(`flex-none`,t.tone)}),(0,P.jsx)(`span`,{className:`truncate`,"data-tip":[e.title,`${F[e.provider]} ${e.id}`,e.environment&&`environment ${e.environment}${e.production?` (production: read only)`:``}`,e.release&&`release ${e.release}`,e.service].filter(Boolean).join(` · `),children:e.title})]})}),(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`hidden whitespace-nowrap text-body-sm text-ink-2 @xl:table-cell`),children:F[e.provider]}),(0,P.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":e.count,children:e.count.toLocaleString()}),(0,P.jsx)(`td`,{className:r(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden text-muted @2xl:table-cell`),"data-sort":e.users,children:e.users.toLocaleString()}),(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`hidden whitespace-nowrap text-body-sm text-muted @2xl:table-cell`),"data-tip":e.lastSeen?re(e.lastSeen):void 0,children:e.lastSeen?E(e.lastSeen):`–`}),(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`max-w-0 text-body-sm`),children:(0,P.jsx)(V,{i:e})}),(0,P.jsxs)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:[e.repro&&(0,P.jsx)(u,{variant:`icon`,size:`icon-sm`,disabled:G,onClick:()=>ie(e),"aria-label":e.repro.on===`test`?`Record a repro at ${e.repro.url}`:`Record a repro at the production page (asks first)`,"data-tip":e.repro.on===`test`?`Record a repro at ${e.repro.url}`:`Record a repro at the production page (asks first)`,children:(0,P.jsx)(g,{"aria-hidden":`true`})}),(0,P.jsx)(u,{variant:`icon`,size:`icon-sm`,disabled:G,onClick:()=>void ae(e),"aria-label":`Ask in a chat about ${F[e.provider]} ${e.id}`,"data-tip":`Ask in a chat about ${F[e.provider]} ${e.id}`,children:(0,P.jsx)(x,{"aria-hidden":`true`})}),n&&(0,P.jsx)(`a`,{className:c({variant:`icon`,size:`icon`}),href:n,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open in ${F[e.provider]}`,"data-tip":`Open in ${F[e.provider]}`,children:(0,P.jsx)(te,{"aria-hidden":`true`})})]})]},`${e.provider}-${e.id}`)})]},e.page||`-`))})]})]})]})}export{H as Production,L as shownPages};
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"./utils-DJRAScIl.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{L as a}from"./palette-DOQemIAv.js";import{b as ee,v as o}from"./api-B8AQ8-Gb.js";import{A as s,F as c,I as l,P as u,T as d,g as f,n as p,o as m}from"./pageBack-CINGjBHZ.js";import{Er as h,F as g,Gr as _,N as v,P as y,Un as b,ct as te,o as ne,vn as x,z as S,zn as C}from"./line-icons-Cwj9OmCz.js";import{bt as w,en as T,mt as E,s as D,t as O}from"./frame-wloj3-xC.js";import{B as k,V as A,z as j}from"./index-BCu9qAny.js";import{d as re}from"./qualityParts-diTrGtUR.js";var M=e(t(),1),N={view:(e=!1)=>o(`GET`,`/api/production${e?`?refresh=1`:``}`)},P=i(),F={sentry:`Sentry`,datadog:`Datadog`,appinsights:`App Insights`},I={fatal:{label:`Fatal`,tone:`text-fail`},error:{label:`Error`,tone:`text-fail`},warning:{label:`Warning`,tone:`text-warn`},info:{label:`Info`,tone:`text-muted`}};function L(e,t,n){return e.flatMap(e=>{let r=e.issues.filter(e=>(t===`all`||!e.coverage.covered)&&(n===`all`||e.provider===n));return r.length?[{...e,issues:r}]:[]})}var R=e=>e&&m(e)===`web`?e:void 0,z=e=>n(`record`,encodeURIComponent(e));function B({p:e}){let t=e.error||e.problem?S:e.configured?v:y,n=e.error||e.problem?`Not read`:e.configured?`Connected`:`Not set up`,i=e.error||e.problem?`text-fail`:e.configured?`text-pass`:`text-muted`;return(0,P.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 py-2 text-body-sm`,children:[(0,P.jsx)(t,{size:15,"aria-label":n,className:r(`mt-1 flex-none`,i)}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[(0,P.jsx)(`span`,{className:`font-medium`,children:e.label}),e.host&&(0,P.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.host]}),(0,P.jsxs)(`span`,{className:`text-ink-2`,children:[` — `,e.problem?e.problem:e.error?e.error:e.configured?`${e.issues} issue${e.issues===1?``:`s`}${e.fetchedAt?`, read ${E(e.fetchedAt)}`:``}`:e.missing.length?`set ${e.missing.join(` and `)}`:`not set up`]})]})]})}function V({i:e}){if(!e.coverage.covered)return(0,P.jsxs)(`span`,{className:`flex items-center gap-2 whitespace-nowrap text-warn`,children:[(0,P.jsx)(h,{size:14,"aria-label":`No test`,className:`flex-none`}),`No test`]});let t=[...e.coverage.runs.map(e=>e.goal?`${e.id} (${e.goal})`:e.id),...e.coverage.tests],n=e.coverage.runs[0]?.id??e.coverage.tests[0]??``;return(0,P.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,"data-tip":`Covered by ${e.coverage.how===`page`?`a run on this page`:`a test named for this page`}: ${t.join(`, `)}`,children:[(0,P.jsx)(v,{size:14,"aria-label":`Covered`,className:`flex-none text-pass`}),(0,P.jsxs)(`span`,{className:`truncate`,children:[n,t.length>1?` +${t.length-1}`:``]})]})}function H(){let[e,t]=(0,M.useState)(null),[i,o]=(0,M.useState)(``),[m,H]=(0,M.useState)(`uncovered`),[U,W]=(0,M.useState)(`all`),[G,K]=(0,M.useState)(!1),[q,J]=(0,M.useState)(``),[Y,X]=(0,M.useState)(null),Z=(0,M.useCallback)((e=!1)=>{K(e),N.view(e).then(e=>{t(e),o(``),K(!1)},e=>{o(e.message),K(!1)})},[]);(0,M.useEffect)(()=>Z(),[Z]);let ie=e=>{if(e.repro){if(e.repro.on===`production`)return X(e);location.hash=z(e.repro.url)}},ae=async e=>{K(!0);try{let{id:t}=await ee.start(e.ask,{});location.hash=n(`chats`,t)}catch(e){J(e.message),K(!1)}},Q=e?.providers.filter(e=>e.configured)??[],oe=e?L(e.pages,m,U):[],$=[`sentry`,`datadog`,`appinsights`].filter(t=>e?.pages.some(e=>e.issues.some(e=>e.provider===t)));return(0,P.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,P.jsx)(D,{}),(0,P.jsxs)(`main`,{className:r(O,`@container flex-auto gap-4`),children:[(0,P.jsx)(p,{}),(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,P.jsx)(T,{pixel:a.production,size:`lg`,head:!0}),(0,P.jsx)(`h1`,{className:`m-0 flex-1 text-headline-md`,children:`Production signals`}),Q.length>0&&(0,P.jsxs)(u,{size:`sm`,disabled:G,onClick:()=>Z(!0),"data-tip":`Read again`,children:[(0,P.jsx)(b,{"aria-hidden":`true`}),`Refresh`]})]}),(0,P.jsx)(A,{more:(0,P.jsxs)(P.Fragment,{children:[`The errors of the last 14 days come from Sentry, Datadog and Azure Application Insights, grouped by the page they happened on. Each one says which browser run or automated test already goes to that page, or that no test does. This page only reads: nothing is changed at the provider. Record a repro opens `,(0,P.jsx)(`a`,{href:n(`record`),children:`Record`}),` at the same page on `,e?.testEnvironment?(0,P.jsxs)(P.Fragment,{children:[`the `,e.testEnvironment,` environment`]}):`your test environment`,`. A tracker is set up with `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations.sentry`}),`, `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations.datadog`}),` or `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations.appinsights`}),` in forgeqe.yaml, its keys saved in Settings under the variable names the trackers list shows; Sentry uses the same settings as its MCP server.`]}),children:`See the errors real users hit, and which of them no test covers yet.`}),i&&(0,P.jsx)(`p`,{role:`alert`,className:r(l.fail,`m-0`),children:i}),!e&&!i&&(0,P.jsx)(f,{shape:`rows`,count:3}),e&&Q.length>0&&(0,P.jsx)(`ul`,{"aria-label":`Error trackers`,className:`m-0 flex list-none flex-col divide-y divide-line-soft border-y border-line-soft p-0`,children:e.providers.map(e=>(0,P.jsx)(B,{p:e},e.id))}),e&&!Q.length&&(0,P.jsxs)(s,{page:!0,icon:C,title:`No error tracker set up`,action:(0,P.jsxs)(`a`,{className:c({size:`sm`}),href:n(`settings`,`integrations`),"data-tip":`Open Integrations in Settings`,children:[(0,P.jsx)(ne,{"aria-hidden":`true`}),`Integrations`]}),children:[`Connect Sentry, Datadog or Azure Application Insights, and the errors real users hit show here, grouped by page. In forgeqe.yaml that is one of the `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:`integrations`}),`, with its keys saved in Settings.`,e.providers.some(e=>e.problem||e.error||e.missing.length)&&(0,P.jsx)(`ul`,{"aria-label":`Error trackers`,className:`m-0 mt-2 flex list-none flex-col p-0 text-left`,children:e.providers.map(e=>(0,P.jsx)(B,{p:e},e.id))})]}),e&&Q.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{label:`Errors in the last 14 days`,children:[(0,P.jsx)(k,{dot:`neutral`,value:e.counts.issues,label:`errors on ${e.pages.length} page${e.pages.length===1?``:`s`}`}),(0,P.jsx)(`span`,{className:`flex items-center`,"data-tip":`No run or test goes there`,children:(0,P.jsx)(k,{dot:e.counts.uncovered?`warn`:`pass`,value:e.counts.uncovered,label:`with no test`})}),(0,P.jsx)(k,{dot:`neutral`,value:e.counts.events.toLocaleString(),label:`events`}),(0,P.jsx)(`span`,{className:`flex items-center`,"data-tip":`Added up per error`,children:(0,P.jsx)(k,{dot:`neutral`,value:e.counts.users.toLocaleString(),label:`users affected`})})]}),Y?.repro&&(0,P.jsxs)(`div`,{role:`group`,"aria-label":`Record on production`,className:r(l.warn,`flex flex-wrap items-center gap-2`),children:[(0,P.jsx)(h,{size:15,"aria-label":`Warning`,className:`flex-none text-warn`}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[`No test environment is active, so the recording would open the production page `,(0,P.jsx)(`code`,{className:`font-mono text-body-sm`,children:Y.repro.url}),`. Real data is there: record only steps that read.`]}),(0,P.jsxs)(u,{size:`sm`,onClick:()=>{let e=Y.repro.url;X(null),location.hash=z(e)},"data-tip":`Record on production`,children:[(0,P.jsx)(g,{"aria-hidden":`true`}),`Record`]}),(0,P.jsxs)(u,{size:`sm`,variant:`outline`,onClick:()=>X(null),children:[(0,P.jsx)(_,{"aria-hidden":`true`}),`Cancel`]})]}),q&&(0,P.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-ink-2`,children:q}),$.length>1&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,P.jsx)(d,{items:[{id:`all`,label:`All trackers`},...$.map(t=>({id:t,label:F[t],n:e.pages.reduce((e,n)=>e+n.issues.filter(e=>e.provider===t).length,0)}))],value:U,onChange:W})}),e.counts.issues===0?(0,P.jsx)(s,{icon:v,title:`No errors in the last 14 days`,children:`The trackers that are set up report no unresolved errors.`}):(0,P.jsx)(w,{label:`Errors by page`,placeholder:`Find an error, page or test`,height:`max(320px, calc(var(--screen) - 288px))`,resetKey:`${m}-${U}`,empty:m===`uncovered`?`Every error here has a test.`:`Nothing matches.`,tools:(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,P.jsx)(d,{items:[{id:`uncovered`,label:`No test`,n:L(e.pages,`uncovered`,U).reduce((e,t)=>e+t.issues.length,0),alert:!0},{id:`all`,label:`All`,n:L(e.pages,`all`,U).reduce((e,t)=>e+t.issues.length,0)}],value:m,onChange:H})}),head:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`w-[38%]`),children:`Error`}),(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Tracker`}),(0,P.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,children:`Events`}),(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-right text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Users`}),(0,P.jsx)(`th`,{scope:`col`,className:r(`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Last seen`}),(0,P.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:`Covered by`}),(0,P.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-label-md font-medium whitespace-nowrap text-muted`,children:(0,P.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:oe.map(e=>(0,P.jsxs)(M.Fragment,{children:[(0,P.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted`,children:(0,P.jsx)(`td`,{colSpan:7,className:r(`px-4 py-2`,`max-w-0 text-body-sm`),children:(0,P.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono`,"data-tip":e.url||e.page||`The tracker names no page`,children:e.page||`No page named`}),(0,P.jsxs)(`span`,{className:`flex-none text-muted`,children:[e.issues.length,` error`,e.issues.length===1?``:`s`,e.uncovered?`, ${e.uncovered} with no test`:``]})]})})}),e.issues.map(e=>{let t=I[e.level],n=R(e.link);return(0,P.jsxs)(`tr`,{className:`h-12 border-t border-line-soft align-middle transition-colors duration-150 data-[state=selected]:bg-tint-hover`,children:[(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`max-w-0`),children:(0,P.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.level===`info`?(0,P.jsx)(y,{size:15,"aria-label":t.label,className:r(`flex-none`,t.tone)}):e.level===`warning`?(0,P.jsx)(h,{size:15,"aria-label":t.label,className:r(`flex-none`,t.tone)}):(0,P.jsx)(S,{size:15,"aria-label":t.label,className:r(`flex-none`,t.tone)}),(0,P.jsx)(`span`,{className:`truncate`,"data-tip":[e.title,`${F[e.provider]} ${e.id}`,e.environment&&`environment ${e.environment}${e.production?` (production: read only)`:``}`,e.release&&`release ${e.release}`,e.service].filter(Boolean).join(` · `),children:e.title})]})}),(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`hidden whitespace-nowrap text-body-sm text-ink-2 @xl:table-cell`),children:F[e.provider]}),(0,P.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,"data-sort":e.count,children:e.count.toLocaleString()}),(0,P.jsx)(`td`,{className:r(`px-4 py-2 text-right whitespace-nowrap tabular-nums`,`hidden text-muted @2xl:table-cell`),"data-sort":e.users,children:e.users.toLocaleString()}),(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`hidden whitespace-nowrap text-body-sm text-muted @2xl:table-cell`),"data-tip":e.lastSeen?re(e.lastSeen):void 0,children:e.lastSeen?E(e.lastSeen):`–`}),(0,P.jsx)(`td`,{className:r(`px-4 py-2`,`max-w-0 text-body-sm`),children:(0,P.jsx)(V,{i:e})}),(0,P.jsxs)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:[e.repro&&(0,P.jsx)(u,{variant:`icon`,size:`icon-sm`,disabled:G,onClick:()=>ie(e),"aria-label":e.repro.on===`test`?`Record a repro at ${e.repro.url}`:`Record a repro at the production page (asks first)`,"data-tip":e.repro.on===`test`?`Record a repro at ${e.repro.url}`:`Record a repro at the production page (asks first)`,children:(0,P.jsx)(g,{"aria-hidden":`true`})}),(0,P.jsx)(u,{variant:`icon`,size:`icon-sm`,disabled:G,onClick:()=>void ae(e),"aria-label":`Ask in a chat about ${F[e.provider]} ${e.id}`,"data-tip":`Ask in a chat about ${F[e.provider]} ${e.id}`,children:(0,P.jsx)(x,{"aria-hidden":`true`})}),n&&(0,P.jsx)(`a`,{className:c({variant:`icon`,size:`icon`}),href:n,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open in ${F[e.provider]}`,"data-tip":`Open in ${F[e.provider]}`,children:(0,P.jsx)(te,{"aria-hidden":`true`})})]})]},`${e.provider}-${e.id}`)})]},e.page||`-`))})]})]})]})}export{H as Production,L as shownPages};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-9BkoTWUE.js";import{H as i,L as a,l as o,o as s}from"./preload-helper-BupTYkQW.js";import{t as c}from"./utils-DJRAScIl.js";import{t as l}from"./jsx-runtime-LKYXHABd.js";import{L as u}from"./palette-DOQemIAv.js";import{L as d,Y as f,b as p,tt as m,v as h}from"./api-B8AQ8-Gb.js";import{A as g,F as _,I as v,P as y,T as b,_ as x,g as S,i as C,k as w,n as T}from"./pageBack-CINGjBHZ.js";import{C as E,E as D,Er as O,F as k,N as A,Nt as ee,Rn as te,Rt as j,Tr as M,Xn as N,Yt as ne,ft as re,ir as ie,it as ae,pn as oe,t as P,vn as F,wr as se,z as I}from"./line-icons-Cwj9OmCz.js";import{Ct as L,Dt as R,Et as z,Tt as B,bt as V,ct as ce,dn as le,en as ue,ft as de,kt as H,lt as fe,mt as pe,s as me,st as he,t as ge,xt as U}from"./frame-Z5TaJY7O.js";import{B as W,V as G,Y as K,z as q}from"./index-nbjwmmih.js";import{a as _e,c as ve,d as J,l as Y,n as ye,s as be,t as xe,v as X,x as Se,y as Ce}from"./qualityParts-O56nH8FQ.js";import{a as we,c as Te,i as Ee,n as De,s as Z}from"./SiteScan-Cydt89Ja.js";var Q=e(t(),1),Oe={view:()=>h(`GET`,`/api/localization`),run:e=>h(`GET`,`/api/localization/${encodeURIComponent(e)}`),shot:(e,t,n)=>d(`/api/localization/${encodeURIComponent(e)}/shot/${t}/${n}`,`image/jpeg`)},$=l(),ke={high:`text-fail`,medium:`text-warn`,low:`text-muted`},Ae=[`key`,`untranslated`,`cut_off`,`overflow`,`expansion`,`rtl`];function je({id:e,index:t,mode:n}){let[r,i]=(0,Q.useState)(``),[a,o]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{let r=!1;return Oe.shot(e,t,n).then(e=>!r&&i(e),()=>!r&&o(!0)),()=>{r=!0}},[e,t,n]);let l=n===`pseudo`?`Pseudo-localized`:`Right to left`;return(0,$.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-1`,children:[(0,$.jsx)(`figcaption`,{className:`text-body-sm text-muted`,children:l}),a?(0,$.jsx)(`p`,{className:c(s,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`No capture`}):r?(0,$.jsx)(`img`,{src:r,alt:`${l} capture`,className:c(s,`max-h-[420px] w-full object-contain object-top`)}):(0,$.jsx)(`div`,{className:c(s,`min-h-24`)})]})}function Me({id:e,page:t,index:n,text:r}){let[a,o]=(0,Q.useState)(!1),s=t.findings.some(e=>r[e.kind].severity===`high`)?`high`:t.findings.some(e=>r[e.kind].severity===`medium`)?`medium`:t.findings.length?`low`:void 0,l=s===`high`?I:s?O:A,u=t.findings.toSorted((e,t)=>Ae.indexOf(e.kind)-Ae.indexOf(t.kind));return(0,$.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(!a),className:c(i,`items-start gap-2`),children:[(0,$.jsx)(l,{size:15,"aria-label":s?`${s} findings`:`Nothing found`,className:c(`mt-1 flex-none`,s?ke[s]:`text-pass`)}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,$.jsxs)(`span`,{className:`truncate font-medium`,"data-tip":t.url,children:[t.title||Se(t.url),s&&(0,$.jsxs)(`span`,{className:c(`font-normal`,ke[s]),children:[` · `,s===`high`?`High`:s===`medium`?`Medium`:`Low`]})]}),(0,$.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,children:[Se(t.url),` · `,t.lang?`lang ${t.lang}`:`no lang`,u.length?` · ${u.map(e=>`${r[e.kind].label.charAt(0).toLowerCase()}${r[e.kind].label.slice(1)} ${e.count}`).join(`, `)}`:` · nothing found`]})]}),(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:c(`mt-1 flex-none transition-transform`,a&&`rotate-180`)})]}),(0,$.jsx)(le,{open:a,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 pb-4 pl-8`,children:[u.map(e=>(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 text-body-sm`,children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[r[e.kind].label,` `,(0,$.jsxs)(`span`,{className:c(`font-normal`,ke[r[e.kind].severity]),children:[`· `,e.count]})]}),(0,$.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:r[e.kind].fix}),e.examples.map((e,t)=>(0,$.jsx)(`span`,{className:`truncate font-mono text-body-sm text-muted`,"data-tip":e,children:e},t))]},e.kind)),(t.shots.pseudo||t.shots.rtl)&&(0,$.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 @2xl:grid-cols-2`,children:[t.shots.pseudo&&(0,$.jsx)(je,{id:e,index:n,mode:`pseudo`}),t.shots.rtl&&(0,$.jsx)(je,{id:e,index:n,mode:`rtl`})]})]})})]})}function Ne({id:e,text:t}){let[n,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``),[s,l]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let t=!1;return i(null),Oe.run(e).then(e=>!t&&(i(e),o(``)),e=>!t&&o(e.message)),()=>{t=!0}},[e]);let u=(0,$.jsxs)(`a`,{href:r(`quality`,`localization`),className:c(_({variant:`link`,size:`inline`}),`gap-1 self-start`),children:[(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});if(a||!n)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u,a?(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a}):(0,$.jsx)(S,{shape:`detail`})]});let d=async()=>{try{let{id:e}=await p.start(`Explain the localization findings of the browser run ${n.id} in the reports folder (its localization.json and the captures in its localization folder), page by page, and what the developers should change.`,{});location.hash=r(`chats`,e)}catch(e){l(e.message)}},f=e=>n.counts[e]??0;return(0,$.jsxs)(`section`,{"aria-labelledby":`l10n-run-h`,className:`flex min-w-0 flex-col gap-4`,children:[u,(0,$.jsx)(K,{id:`l10n-run-h`,icon:j,title:(0,$.jsx)(`span`,{"data-tip":n.goal,children:n.goal}),description:(0,$.jsxs)($.Fragment,{children:[J(n.at),` · `,n.langs.length?n.langs.join(`, `):`no lang`,` · `,(0,$.jsx)(`span`,{className:`font-mono`,children:n.id})]}),actions:(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void d(),children:[(0,$.jsx)(F,{"aria-hidden":`true`}),`Chat`]})}),s&&(0,$.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:s}),(0,$.jsxs)(q,{label:`What the run found`,children:[(0,$.jsx)(W,{dot:`neutral`,value:n.pages,label:n.langs.length?`pages (${n.langs.join(`, `)})`:`pages, no lang set`}),(0,$.jsx)(W,{dot:`fail`,value:f(`key`),label:`translation keys shown`}),(0,$.jsx)(W,{dot:`warn`,value:f(`untranslated`),label:`English left on other languages`}),(0,$.jsx)(W,{dot:`warn`,value:f(`cut_off`)+f(`overflow`),label:`cut off as the page was`}),(0,$.jsx)(W,{dot:`warn`,value:f(`expansion`),label:`break with longer text`}),(0,$.jsx)(W,{dot:`warn`,value:f(`rtl`),label:`break right to left`})]}),(0,$.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:n.list.map((e,r)=>(0,$.jsx)(Me,{id:n.id,page:e,index:r,text:t},e.url))})]})}function Pe({runs:e}){let t=e=>location.hash=r(`quality`,`localization`,encodeURIComponent(e)),n=(e,t)=>e.counts[t]??0;return(0,$.jsx)(V,{label:`Runs`,placeholder:`Find a run by what it did`,empty:`Nothing matches.`,height:U,head:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`th`,{scope:`col`,className:c(z,`w-[44%]`),children:`Run`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Keys`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @xl:table-cell`),children:`English left`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Cut off`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @2xl:table-cell`),children:`Longer · RTL`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @xl:table-cell`),children:`When`})]}),children:e.map(e=>{let i=n(e,`key`),a=n(e,`untranslated`)+n(e,`cut_off`)+n(e,`overflow`)+n(e,`expansion`)+n(e,`rtl`),o=i?I:a?O:A;return(0,$.jsxs)(`tr`,{onClick:()=>t(e.id),className:H,children:[(0,$.jsx)(`td`,{className:c(L,`max-w-0`),children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(o,{size:15,"aria-label":i?`Keys shown`:a?`Needs a look`:`Nothing found`,className:c(`flex-none`,i?`text-fail`:a?`text-warn`:`text-pass`)}),(0,$.jsx)(`a`,{href:r(`quality`,`localization`,encodeURIComponent(e.id)),onClick:e=>e.stopPropagation(),"data-tip":e.goal,className:`truncate text-ink no-underline hover:underline`,children:e.goal})]})}),(0,$.jsx)(`td`,{className:c(B,i?`text-fail`:`text-muted`),children:i}),(0,$.jsx)(`td`,{className:c(B,`hidden @xl:table-cell`,n(e,`untranslated`)?`text-warn`:`text-muted`),children:n(e,`untranslated`)}),(0,$.jsx)(`td`,{className:c(B,n(e,`cut_off`)+n(e,`overflow`)?`text-warn`:`text-muted`),children:n(e,`cut_off`)+n(e,`overflow`)}),(0,$.jsxs)(`td`,{className:c(B,`hidden text-muted @2xl:table-cell`),"data-sort":n(e,`expansion`)+n(e,`rtl`),children:[n(e,`expansion`),` · `,n(e,`rtl`)]}),(0,$.jsx)(`td`,{className:c(L,`hidden whitespace-nowrap text-body-sm text-muted @xl:table-cell`),"data-tip":J(e.at),"data-sort":new Date(e.at).getTime()||0,children:pe(e.at)})]},e.id)})})}function Fe({id:e}){let[t,n]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{Oe.view().then(e=>(n(e),a(``)),e=>a(e.message))},[]),i?(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:i}):t?e?(0,$.jsx)(Ne,{id:e,text:t.text}):t.runs.length?(0,$.jsx)(Pe,{runs:t.runs}):(0,$.jsx)(g,{page:!0,icon:j,title:`No runs checked yet`,action:(0,$.jsxs)(`a`,{className:_({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,$.jsx)(k,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow in each language your site has, and what it found shows here. Every browser run with accessibility checks on also checks each page's language.`}):(0,$.jsx)(S,{shape:`rows`})}var Ie=[{id:`7d`,label:`Last 7 days`},{id:`30d`,label:`Last 30 days`},{id:`90d`,label:`Last 90 days`},{id:`all`,label:`All time`}],Le=[{key:`a11y`,label:`Accessibility violations`,better:`down`,show:e=>String(e)},{key:`seo`,label:`SEO score`,better:`up`,show:e=>String(e)},{key:`lcp`,label:`Largest paint (LCP)`,better:`down`,show:e=>X(e,`ms`)}];function Re(e,t,n,r){if(t===void 0||n===void 0||r<2)return;let i=n-t;if(!i)return;let a=i>0;return{text:`${a?`+`:`−`}${e.key===`lcp`?X(Math.abs(i),`ms`):Math.abs(i)}`,dir:a?`up`:`down`,good:(a?`up`:`down`)===e.better,against:`since the first run of the range`}}function ze({s:e}){let t=t=>e.points.map(e=>e[t]).filter(e=>typeof e==`number`),n=Le.filter(e=>t(e.key).length),r=e=>e?J(e.at):``;return(0,$.jsxs)(`section`,{"aria-label":e.site,className:c(o,`flex flex-col gap-4`),children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,$.jsx)(j,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,$.jsx)(`h3`,{className:`m-0 min-w-0 truncate font-mono text-body-lg font-medium`,children:e.site}),(0,$.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[Ce(e.runs,`run`),` · `,Ce(e.pages,`page`),e.first&&e.latest&&e.runs>1?` · ${r(e.first)} to ${r(e.latest)}`:e.latest?` · ${r(e.latest)}`:``]})]}),n.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ce,{label:`${e.site} now`,className:`shadow-none`,children:n.map(t=>{let n=e.latest?.[t.key],r=Re(t,e.first?.[t.key],n,e.runs);return(0,$.jsx)(he,{compact:!0,label:t.label,value:n===void 0?`–`:t.show(n),...r?{change:r}:{note:e.runs>1?`No change in this range`:`One run in this range`}},t.key)})}),e.points.length>1&&(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,150px),1fr))] gap-x-px`,children:n.map(n=>{let r=t(n.key),i=Re(n,e.first?.[n.key],e.latest?.[n.key],e.runs);return r.length>1?(0,$.jsx)(x,{series:[{values:r,tone:i?.good===!1?`fail`:`accent`}],label:`${n.label} over the last ${r.length} runs: ${r.map(n.show).join(`, `)}`,className:`h-12 px-4`},n.key):(0,$.jsx)(`span`,{},n.key)})})]}),e.analytics.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-body-sm`,children:[(0,$.jsx)(`span`,{className:`mr-1 text-muted`,children:`Analytics in the latest run:`}),e.analytics.map(e=>(0,$.jsxs)(w,{tone:`neutral`,icon:!1,children:[e.tool,(0,$.jsxs)(`span`,{className:`text-muted`,children:[` · `,Ce(e.pages,`page`)]})]},e.tool))]}),(0,$.jsx)(ye,{icon:M,className:`text-fail`,lines:e.newRules.map(e=>`newly failing: ${e}`)}),(0,$.jsx)(ye,{icon:se,className:`text-pass`,lines:e.fixedRules.map(e=>`fixed: ${e}`)})]})}function Be(){let[e,t]=(0,Q.useState)(`30d`),[n,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{let t=!1;return i(null),Te.view(e).then(e=>!t&&(i(e.sites),o(``)),e=>!t&&o(e.message)),()=>{t=!0}},[e]),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Every browser run and site scan adds each page's accessibility and timings to the history; a scan also adds its SEO score and analytics tags. A site is its origin; each number is per run, summed over its pages (violations) or their average (SEO score, LCP). The change is against the first run in the range.`}),children:`How each site's accessibility, SEO, speed and analytics changed over time.`}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:Ie,value:e,onChange:t})}),a&&(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a}),!n&&!a&&(0,$.jsx)(S,{shape:`detail`}),n&&(n.length?(0,$.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map(e=>(0,$.jsx)(ze,{s:e},e.site))}):(0,$.jsx)(g,{page:!0,icon:E,title:e===`all`?`No history yet`:`Nothing in this range`,action:(0,$.jsx)(`a`,{className:_({size:`sm`}),href:r(`quality`,`scans`),children:`Scan pages`}),children:`Scan a few pages, or run a flow in a browser: each page's results are kept, and every site shows here with how it changed.`}))]})}var Ve={view:()=>h(`GET`,`/api/security`),run:e=>h(`GET`,`/api/security/${encodeURIComponent(e)}`)},He={high:`text-fail`,medium:`text-warn`,low:`text-muted`},Ue={high:`High`,medium:`Medium`,low:`Low`};function We({id:e,fix:t}){let[n,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``),[s,l]=(0,Q.useState)(`all`),[u,d]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let t=!1;return i(null),Ve.run(e).then(e=>!t&&(i(e),o(``)),e=>!t&&o(e.message)),()=>{t=!0}},[e]);let f=(0,$.jsxs)(`a`,{href:r(`quality`,`security`),className:`inline-flex items-center gap-1 self-start text-body-sm no-underline`,children:[(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});if(a)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[f,(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a})]});if(!n)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[f,(0,$.jsx)(S,{shape:`detail`})]});let m=async()=>{try{let{id:e}=await p.start(`Explain the passive security findings of the browser run ${n.id} in the reports folder (its network.json, security section), most serious first, and how the team should fix each.`,{});location.hash=r(`chats`,e)}catch(e){d(e.message)}},h=n.findings.filter(e=>s===`all`||e.severity===s);return(0,$.jsxs)(`section`,{"aria-labelledby":`sec-run-h`,className:`flex min-w-0 flex-col gap-4`,children:[f,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,$.jsx)(K,{id:`sec-run-h`,icon:ie,title:(0,$.jsx)(`span`,{"data-tip":n.goal,className:`block truncate`,children:n.goal})}),(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-body-sm text-muted`,children:[J(n.at),` · `,n.env?`${n.env} · `:``,n.host??`no start page`,` · `,(0,$.jsx)(`span`,{className:`font-mono`,children:n.id})]})]}),!n.production&&n.findings.length>0&&(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void m(),children:[(0,$.jsx)(F,{"aria-hidden":`true`}),`Chat`]})]}),u&&(0,$.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:u}),n.production?(0,$.jsxs)(g,{icon:oe,title:`Not checked`,children:[`This run was on `,n.env,`, an environment named like production. The security smoke checks are for test environments only.`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(q,{label:`Findings by severity`,children:[(0,$.jsx)(W,{dot:`fail`,value:n.counts.high,label:`high: fix before release`}),(0,$.jsx)(W,{dot:`warn`,value:n.counts.medium,label:`medium: worth fixing`}),(0,$.jsx)(W,{dot:`neutral`,value:n.counts.low,label:`low: hardening`}),(0,$.jsx)(W,{dot:`neutral`,value:n.pages,label:`pages checked`}),(0,$.jsx)(W,{dot:`neutral`,value:n.calls,label:`calls checked`})]}),!n.pages&&!n.findings.length?(0,$.jsx)(g,{icon:O,title:`No pages recorded`,children:`This run kept its API calls but not the pages' headers and cookies: it was made before ForgeQE recorded them. Run the flow again to check it.`}):n.findings.length?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:[{id:`all`,label:`All`,n:n.findings.length},...[`high`,`medium`,`low`].filter(e=>n.counts[e]).map(e=>({id:e,label:Ue[e],n:n.counts[e],alert:e===`high`}))],value:s,onChange:l})}),(0,$.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:h.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start gap-2 border-t border-line-soft py-2 text-body-sm`,children:[e.severity===`high`?(0,$.jsx)(I,{size:15,"aria-label":`High`,className:`mt-1 flex-none text-fail`}):(0,$.jsx)(O,{size:15,"aria-label":Ue[e.severity],className:c(`mt-1 flex-none`,He[e.severity])}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[e.title,` `,(0,$.jsxs)(`span`,{className:c(`font-normal`,He[e.severity]),children:[`· `,Ue[e.severity]]})]}),(0,$.jsxs)(`span`,{className:`truncate font-mono text-body-sm text-ink-2`,"data-tip":e.target,children:[e.target,e.detail?` · ${e.detail}`:``]}),(0,$.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:t[e.kind]?.fix})]})]},`${e.kind}|${e.target}`))})]}):(0,$.jsx)(g,{icon:A,title:`Nothing found`,children:`The pages this run loaded sent the security headers checked, their cookies had safe flags, and no answer held a key or token.`})]})]})}function Ge({runs:e}){let[t,n]=(0,Q.useState)(`all`),i=t===`high`?e.filter(e=>e.counts.high):e,a=e=>location.hash=r(`quality`,`security`,encodeURIComponent(e));return(0,$.jsx)(V,{label:`Runs`,placeholder:`Find a run by what it did`,resetKey:t,empty:`Nothing matches.`,height:U,tools:(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:[{id:`all`,label:`All`,n:e.length},{id:`high`,label:`High findings`,n:e.filter(e=>e.counts.high).length,alert:!0}],value:t,onChange:n})}),head:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`th`,{scope:`col`,className:c(z,`w-[46%]`),children:`Run`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`High`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Medium`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @xl:table-cell`),children:`Low`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @2xl:table-cell`),children:`Environment`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @xl:table-cell`),children:`When`})]}),children:i.map(e=>{let t=e.production||!e.pages&&!e.counts.high&&!e.counts.medium&&!e.counts.low,n=t?oe:e.counts.high?I:e.counts.medium?O:A,i=e.production?`Not checked: production`:t?`No pages recorded`:e.counts.high?`High findings`:e.counts.medium?`Medium findings`:`Nothing serious`;return(0,$.jsxs)(`tr`,{onClick:()=>a(e.id),className:H,children:[(0,$.jsx)(`td`,{className:c(L,`max-w-0`),children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(n,{size:15,"aria-label":i,className:c(`flex-none`,t?`text-muted`:e.counts.high?`text-fail`:e.counts.medium?`text-warn`:`text-pass`)}),(0,$.jsx)(`a`,{href:r(`quality`,`security`,encodeURIComponent(e.id)),onClick:e=>e.stopPropagation(),"data-tip":e.goal,className:`truncate text-ink no-underline hover:underline`,children:e.goal})]})}),(0,$.jsx)(`td`,{"data-sort":t?-1:e.counts.high,className:c(B,e.counts.high?`text-fail`:`text-muted`),children:t?`–`:e.counts.high}),(0,$.jsx)(`td`,{"data-sort":t?-1:e.counts.medium,className:c(B,e.counts.medium?`text-warn`:`text-muted`),children:t?`–`:e.counts.medium}),(0,$.jsx)(`td`,{"data-sort":t?-1:e.counts.low,className:c(B,`hidden text-muted @xl:table-cell`),children:t?`–`:e.counts.low}),(0,$.jsx)(`td`,{className:c(L,`hidden text-body-sm text-muted @2xl:table-cell`),children:e.production?`${e.env} · not checked`:t?`no pages recorded`:e.env??e.host??`–`}),(0,$.jsx)(`td`,{className:c(L,`hidden whitespace-nowrap text-body-sm text-muted @xl:table-cell`),"data-tip":J(e.at),"data-sort":new Date(e.at).getTime()||0,children:pe(e.at)})]},e.id)})})}function Ke({id:e}){let[t,n]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{Ve.view().then(e=>(n(e),a(``)),e=>a(e.message))},[]),i?(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:i}):t?e?(0,$.jsx)(We,{id:e,fix:t.fix}):t.runs.length?(0,$.jsx)(Ge,{runs:t.runs}):(0,$.jsx)(g,{page:!0,icon:oe,title:`No runs to check yet`,action:(0,$.jsxs)(`a`,{className:_({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,$.jsx)(k,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow on a test environment, and what it found shows here. Every browser run keeps the pages' security headers, the cookies' flags and its API calls.`}):(0,$.jsx)(S,{shape:`rows`})}function qe(){let[e,t]=(0,Q.useState)(``),[n,r]=(0,Q.useState)(``),[i,o]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let i=!1;return Z.view(e,n).then(a=>{i||(o(a),l(``),e||t(a.coverage.standard),n||r(a.coverage.engine))},e=>!i&&l(e.message)),()=>{i=!0}},[e,n]);let f=async t=>{d(t),l(``);try{let r=await(t===`csv`?Z.csv(e,n):t===`html`?Z.html(e,n):Z.pdf(e,n));m(r,`wcag-coverage-${e}-${n}.${t}`)}catch(e){l(e.message)}finally{d(``)}};return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Rules come from the engine's own map of its rules to the success criteria; a rule that runs never proves a criterion is met. The personas (Accessibility › Agent) exercise criteria by how they use a page: a keyboard-only person meets focus order, a person at 200% zoom meets reflow. What is left needs a person reviewing by hand.`}),children:`What ForgeQE's rules and accessibility personas can check of a WCAG standard, criterion by criterion.`}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_220px] flex-col gap-1 text-body-sm font-medium`,children:[`Standard`,(0,$.jsx)(a,{size:`sm`,value:e,onChange:e=>t(e.target.value),disabled:!i,children:(i?.standards??[]).map(e=>(0,$.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,$.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_200px] flex-col gap-1 text-body-sm font-medium`,children:[`Rule engine`,(0,$.jsx)(a,{size:`sm`,value:n,onChange:e=>r(e.target.value),disabled:!i,children:(i?.engines??[]).map(e=>(0,$.jsx)(`option`,{value:e,children:we(e)},e))})]}),(0,$.jsx)(`span`,{className:`flex-auto`}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,disabled:!i||!!u,onClick:()=>void f(`csv`),"data-tip":`Download the matrix as CSV`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`}),`CSV`]}),(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,disabled:!i||!!u,onClick:()=>void f(`html`),"data-tip":`Download the matrix as an HTML page`,children:[(0,$.jsx)(re,{"aria-hidden":`true`}),`HTML`]}),(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,disabled:!i||!!u,onClick:()=>void f(`pdf`),"data-tip":`Print the matrix to PDF and download it`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`}),u===`pdf`?`Printing…`:`PDF`]})]})]}),s&&(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:s}),!i&&!s&&(0,$.jsx)(S,{shape:`rows`,count:8}),i&&(0,$.jsx)(Ee,{c:i.coverage,engineLabel:we(i.coverage.engine)},`${i.coverage.standard}-${i.coverage.engine}`)]})}function Je({id:e,asked:t,view:n,onChanged:i}){let[a,o]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(`accessibility`),m=t===`accessibility`||t===`performance`||t===`visual`?t:u,h=t=>location.hash=r(`quality`,encodeURIComponent(e),t),[g,b]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let t=!1;return o(null),f.run(e).then(e=>{if(t)return;o(e),l(``);let n=e.visual?.pages.some(e=>e.status===`changed`)||!e.visual&&e.captured;d(e.report?.accessibility.failed.length?`accessibility`:e.report?.breaches.some(e=>e.kind===`performance`)?`performance`:n?`visual`:e.report?.accessibility.pages?`accessibility`:e.report?.performance.pages.length?`performance`:`visual`)},e=>!t&&l(e.message)),()=>{t=!0}},[e]);let x=(0,$.jsxs)(`a`,{href:r(`quality`),className:c(_({variant:`link`,size:`inline`}),`gap-1 self-start`),children:[(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});if(s)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[x,(0,$.jsx)(`p`,{className:c(v.fail,`m-0`),children:s})]});if(!a)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[x,(0,$.jsx)(S,{shape:`detail`})]});let w=async()=>{try{let{id:e}=await p.start(`Explain the accessibility, performance and visual results of the run in ${a.dir}: call quality_report and visual_compare with run_dir ${a.dir}. Say what matters most to fix first, and why.`,{});location.hash=r(`chats`,e)}catch(e){b(e.message)}},T=a.report,E=T?.accessibility,O=T?.performance.pages??[],k=O.filter(e=>e.over.length).length,A=O.map(e=>e.lcp).filter(e=>typeof e==`number`),j=A.length?Math.max(...A):void 0,M=a.visual?.pages.filter(e=>e.status===`changed`).length??0,N=T?.breaches.length??0,re=[{id:`accessibility`,label:`Accessibility`,icon:P,n:E?.pages?`${E.failed.length} failed`:`not measured`,tone:E?.failed.length?`text-fail`:void 0},{id:`performance`,label:`Performance`,icon:ee,n:O.length?k?`${k} over budget`:`${O.length} pages`:`not measured`,tone:k?`text-fail`:void 0},{id:`visual`,label:`Visual`,icon:ne,n:a.visual?`${M} changed`:a.captured?`not compared`:`not captured`,tone:M?`text-warn`:void 0}];return(0,$.jsxs)(`section`,{"aria-labelledby":`run-h`,className:`flex min-w-0 flex-col gap-4`,children:[x,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,$.jsx)(K,{id:`run-h`,icon:te,title:(0,$.jsx)(`span`,{"data-tip":a.goal,className:`block truncate`,children:a.goal})}),(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-body-sm text-muted`,children:[J(a.at),` · `,n.standard,` · `,(0,$.jsx)(C,{path:a.dir})]})]}),(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void w(),children:[(0,$.jsx)(F,{"aria-hidden":`true`}),`Chat`]})]}),g&&(0,$.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:g}),(0,$.jsxs)(q,{label:`What the run measured`,children:[(0,$.jsx)(W,{dot:N?`fail`:`pass`,value:N,label:N?`budgets exceeded: fails the run`:`budgets exceeded`}),E?.pages?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(W,{dot:`fail`,value:E.failed.length,label:`rules failed (${E.passed.length} passed)`}),(0,$.jsx)(W,{dot:`fail`,value:`${E.byImpact.critical} · ${E.byImpact.serious}`,label:`critical · serious`}),(0,$.jsx)(W,{dot:`warn`,value:`${E.byImpact.moderate} · ${E.byImpact.minor}`,label:`moderate · minor`})]}):null,O.length>0&&(0,$.jsx)(W,{dot:k?`fail`:`neutral`,value:O.length,label:k?`pages timed, ${k} over budget`:`pages timed`}),j!==void 0&&(0,$.jsx)(W,{dot:j>4e3?`fail`:j>2500?`warn`:`pass`,value:X(j,`ms`),label:`slowest LCP (good up to 2.5s)`}),a.visual?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(W,{dot:`neutral`,value:a.visual.pages.length,label:`pages compared`}),(0,$.jsx)(W,{dot:`warn`,value:M,label:a.visual.pages.some(e=>e.over)?`pages changed, over budget`:`pages changed`})]}):a.captured?(0,$.jsx)(W,{dot:`neutral`,value:a.captured,label:`pages captured, not compared`}):null]}),(0,$.jsx)(de,{label:`Results`,className:`mb-0`,current:m,onPick:h,tabs:re.map(e=>({id:e.id,label:e.label,n:e.n,...e.tone?{tone:e.tone}:{}}))}),(0,$.jsxs)(`div`,{role:`tabpanel`,id:`panel-${m}`,"aria-labelledby":`tab-${m}`,className:`flex min-w-0 flex-col`,children:[m===`accessibility`&&(0,$.jsx)(xe,{run:a,standard:n.standard,disclaimer:n.disclaimer},a.id),m===`performance`&&(0,$.jsx)(_e,{run:a}),m===`visual`&&(0,$.jsx)(ve,{run:a,budget:n.budgets.visual,onChange:e=>{o(e),i()}})]})]})}function Ye({runs:e}){let[t,n]=(0,Q.useState)(`all`),i=e,a=t===`attention`?i.filter(Y):i,o=e=>location.hash=r(`quality`,encodeURIComponent(e));return(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,$.jsx)(V,{label:`Runs`,placeholder:`Find a run by what it did`,resetKey:t,empty:`Nothing matches.`,height:U,tools:(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:[{id:`all`,label:`All`,n:i.length},{id:`attention`,label:`Needs a look`,n:i.filter(Y).length,alert:!0}],value:t,onChange:n})}),head:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`th`,{scope:`col`,className:c(z,`w-[46%]`),children:`Run`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Rules failed`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @2xl:table-cell`),children:`Critical · serious`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @xl:table-cell`),children:`Slow pages`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Visual`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @3xl:table-cell`),children:`Budgets`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let t=e.breaches?I:Y(e)?O:A,n=e.a11y?e.a11y.critical+e.a11y.serious:void 0;return(0,$.jsxs)(`tr`,{onClick:()=>o(e.id),className:H,children:[(0,$.jsx)(`td`,{className:c(L,`max-w-0`),children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(t,{size:15,"aria-label":e.breaches?`Over a budget`:Y(e)?`Needs a look`:`Within budgets`,className:c(`flex-none`,e.breaches?`text-fail`:Y(e)?`text-warn`:`text-pass`)}),(0,$.jsx)(`a`,{href:r(`quality`,encodeURIComponent(e.id)),onClick:e=>e.stopPropagation(),"data-tip":e.goal,className:`truncate text-ink no-underline hover:underline`,children:e.goal})]})}),(0,$.jsx)(`td`,{className:c(B,e.a11y?.failed?`text-fail`:`text-muted`),"data-sort":e.a11y?e.a11y.failed:-1,children:e.a11y?e.a11y.failed:`–`}),(0,$.jsx)(`td`,{className:c(B,`hidden @2xl:table-cell`,n?`text-fail`:`text-muted`),"data-sort":e.a11y?e.a11y.critical*1e3+e.a11y.serious:-1,children:e.a11y?`${e.a11y.critical} · ${e.a11y.serious}`:`–`}),(0,$.jsx)(`td`,{className:c(B,`hidden @xl:table-cell`,e.perf.over?`text-fail`:`text-muted`),"data-sort":e.perf.pages?e.perf.over:-1,children:e.perf.pages?`${e.perf.over} / ${e.perf.pages}`:`–`}),(0,$.jsx)(`td`,{className:c(B,e.visual?.changed?`text-warn`:`text-muted`),"data-sort":e.visual?e.visual.changed:-1,children:e.visual?`${e.visual.changed} changed`:e.captured?`not compared`:`–`}),(0,$.jsx)(`td`,{className:c(B,`hidden @3xl:table-cell`,e.breaches?`text-fail`:`text-muted`),"data-sort":e.breaches||0,children:e.breaches?`${e.breaches} over`:`ok`}),(0,$.jsx)(`td`,{className:c(L,`hidden whitespace-nowrap text-body-sm text-muted @xl:table-cell`),"data-tip":J(e.at),"data-sort":new Date(e.at).getTime()||0,children:pe(e.at)})]},e.id)})})})}function Xe({sub:e}){let[t,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``),s=(0,Q.useCallback)(()=>{f.view().then(e=>{i(e),o(``)},e=>o(e.message))},[]);(0,Q.useEffect)(s,[s]);let[l=``,d,p]=(e??``).split(`/`),m=l===`trends`,h=l===`security`,y=l===`localization`,b=l===`scans`,x=l===`dashboard`,C=l===`coverage`,w=b||x||C,D=(h||y)&&d?n(d):void 0,O=h?D:void 0,A=l&&!m&&!h&&!y&&!w?n(l):``;return(0,$.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,$.jsx)(me,{}),(0,$.jsxs)(`main`,{className:c(ge,`@container flex-auto gap-4`),children:[(0,$.jsx)(T,{}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,$.jsx)(ue,{pixel:u.quality,size:`lg`,head:!0}),(0,$.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Quality`}),!A&&!(b&&d)&&(0,$.jsx)(fe,{label:`Show`,current:m?`trends`:h?`security`:y?`localization`:b?`scans`:x?`dashboard`:C?`coverage`:`runs`,links:[{id:`runs`,label:`Runs`,icon:te,href:r(`quality`)},{id:`scans`,label:`Scan history`,icon:N,href:r(`quality`,`scans`)},{id:`dashboard`,label:`Dashboard`,icon:E,href:r(`quality`,`dashboard`)},{id:`trends`,label:`Trends`,icon:M,href:r(`quality`,`trends`)},{id:`coverage`,label:`WCAG coverage`,icon:P,href:r(`quality`,`coverage`)},{id:`security`,label:`Security`,icon:ie,href:r(`quality`,`security`)},{id:`localization`,label:`Localization`,icon:j,href:r(`quality`,`localization`)}]})]}),h&&!O&&(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Passive smoke checks read from what each run recorded: the pages' security headers, the flags of the cookies they set, http requests from https pages, redirects to an address taken from the URL, and keys or tokens in API answers. Nothing is sent to the site, and runs on an environment named like production are not checked.`}),children:`Security problems each browser run's pages showed, found without touching the site.`}),y&&!D&&(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Each page is checked for translation keys shown as text, English left on a page in another language, and text cut off or running past its box. Then, for a moment the run never sees, the page is shown with pseudo-localized text (accented and a third longer) and right to left, to find what breaks in German or Arabic before it is translated. Run a flow in each language your site has.`}),children:`Each page a browser run visited, checked for its language and for what breaks when it is translated.`}),!A&&!h&&!y&&!w&&(0,$.jsx)(G,{more:(0,$.jsxs)($.Fragment,{children:[`Each browser run measures accessibility (`,t?.standard||`WCAG`,`), Core Web Vitals, and visual changes against approved baselines. Budgets (quality.budgets) decide what fails a run. Open a run for all its details, or one kind with its agent: `,(0,$.jsx)(`a`,{href:r(`accessibility`,`agent`),children:`Accessibility`}),`, `,(0,$.jsx)(`a`,{href:r(`performance`,`agent`),children:`Performance`}),` or `,(0,$.jsx)(`a`,{href:r(`visual`,`agent`),children:`Visual`}),`.`]}),children:`How accessible, fast and visually unchanged the pages of each browser run were.`}),a&&(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a}),!t&&!a&&!w&&(0,$.jsx)(S,{shape:`rows`}),h&&(0,$.jsx)(Ke,{id:O}),b&&(0,$.jsx)(De,{id:d,asked:p}),x&&(0,$.jsx)(Be,{}),C&&(0,$.jsx)(qe,{}),y&&(0,$.jsx)(Fe,{id:D}),t&&A&&(0,$.jsx)(Je,{id:A,asked:d,view:t,onChanged:s},A),t&&!A&&m&&!w&&(0,$.jsx)(`div`,{role:`tabpanel`,"aria-label":`Trends`,children:(0,$.jsx)(be,{trends:t.trends})}),t&&!A&&!m&&!h&&!y&&!w&&(t.runs.length?(0,$.jsx)(Ye,{runs:t.runs}):(0,$.jsx)(g,{page:!0,icon:P,title:`No measurements yet`,action:(0,$.jsxs)(`a`,{className:_({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,$.jsx)(k,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow from a chat or the Record page, and what it measured shows here. Every browser run checks accessibility, timings and visual changes of the pages it visits.`}))]})]})}export{Xe as Quality};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-9BkoTWUE.js";import{H as i,L as a,l as o,o as s}from"./preload-helper-BupTYkQW.js";import{t as c}from"./utils-DJRAScIl.js";import{t as l}from"./jsx-runtime-LKYXHABd.js";import{L as u}from"./palette-DOQemIAv.js";import{L as d,Y as f,b as p,tt as m,v as h}from"./api-B8AQ8-Gb.js";import{A as g,F as _,I as v,P as y,T as b,_ as x,g as S,i as C,k as w,n as T}from"./pageBack-CINGjBHZ.js";import{C as E,E as D,Er as O,F as k,N as A,Nt as ee,Rn as te,Rt as j,Tr as M,Xn as N,Yt as ne,ft as re,ir as ie,it as ae,pn as oe,t as P,vn as F,wr as se,z as I}from"./line-icons-Cwj9OmCz.js";import{Ct as L,Dt as R,Et as z,Tt as B,bt as V,ct as ce,dn as le,en as ue,ft as de,kt as H,lt as fe,mt as pe,s as me,st as he,t as ge,xt as U}from"./frame-wloj3-xC.js";import{B as W,V as G,Y as K,z as q}from"./index-BCu9qAny.js";import{a as _e,c as ve,d as J,l as Y,n as ye,s as be,t as xe,v as X,x as Se,y as Ce}from"./qualityParts-diTrGtUR.js";import{a as we,c as Te,i as Ee,n as De,s as Z}from"./SiteScan-BkdOUe_S.js";var Q=e(t(),1),Oe={view:()=>h(`GET`,`/api/localization`),run:e=>h(`GET`,`/api/localization/${encodeURIComponent(e)}`),shot:(e,t,n)=>d(`/api/localization/${encodeURIComponent(e)}/shot/${t}/${n}`,`image/jpeg`)},$=l(),ke={high:`text-fail`,medium:`text-warn`,low:`text-muted`},Ae=[`key`,`untranslated`,`cut_off`,`overflow`,`expansion`,`rtl`];function je({id:e,index:t,mode:n}){let[r,i]=(0,Q.useState)(``),[a,o]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{let r=!1;return Oe.shot(e,t,n).then(e=>!r&&i(e),()=>!r&&o(!0)),()=>{r=!0}},[e,t,n]);let l=n===`pseudo`?`Pseudo-localized`:`Right to left`;return(0,$.jsxs)(`figure`,{className:`m-0 flex min-w-0 flex-col gap-1`,children:[(0,$.jsx)(`figcaption`,{className:`text-body-sm text-muted`,children:l}),a?(0,$.jsx)(`p`,{className:c(s,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`No capture`}):r?(0,$.jsx)(`img`,{src:r,alt:`${l} capture`,className:c(s,`max-h-[420px] w-full object-contain object-top`)}):(0,$.jsx)(`div`,{className:c(s,`min-h-24`)})]})}function Me({id:e,page:t,index:n,text:r}){let[a,o]=(0,Q.useState)(!1),s=t.findings.some(e=>r[e.kind].severity===`high`)?`high`:t.findings.some(e=>r[e.kind].severity===`medium`)?`medium`:t.findings.length?`low`:void 0,l=s===`high`?I:s?O:A,u=t.findings.toSorted((e,t)=>Ae.indexOf(e.kind)-Ae.indexOf(t.kind));return(0,$.jsxs)(`li`,{className:`border-t border-line-soft`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(!a),className:c(i,`items-start gap-2`),children:[(0,$.jsx)(l,{size:15,"aria-label":s?`${s} findings`:`Nothing found`,className:c(`mt-1 flex-none`,s?ke[s]:`text-pass`)}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,$.jsxs)(`span`,{className:`truncate font-medium`,"data-tip":t.url,children:[t.title||Se(t.url),s&&(0,$.jsxs)(`span`,{className:c(`font-normal`,ke[s]),children:[` · `,s===`high`?`High`:s===`medium`?`Medium`:`Low`]})]}),(0,$.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,children:[Se(t.url),` · `,t.lang?`lang ${t.lang}`:`no lang`,u.length?` · ${u.map(e=>`${r[e.kind].label.charAt(0).toLowerCase()}${r[e.kind].label.slice(1)} ${e.count}`).join(`, `)}`:` · nothing found`]})]}),(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:c(`mt-1 flex-none transition-transform`,a&&`rotate-180`)})]}),(0,$.jsx)(le,{open:a,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 pb-4 pl-8`,children:[u.map(e=>(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 text-body-sm`,children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[r[e.kind].label,` `,(0,$.jsxs)(`span`,{className:c(`font-normal`,ke[r[e.kind].severity]),children:[`· `,e.count]})]}),(0,$.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:r[e.kind].fix}),e.examples.map((e,t)=>(0,$.jsx)(`span`,{className:`truncate font-mono text-body-sm text-muted`,"data-tip":e,children:e},t))]},e.kind)),(t.shots.pseudo||t.shots.rtl)&&(0,$.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 @2xl:grid-cols-2`,children:[t.shots.pseudo&&(0,$.jsx)(je,{id:e,index:n,mode:`pseudo`}),t.shots.rtl&&(0,$.jsx)(je,{id:e,index:n,mode:`rtl`})]})]})})]})}function Ne({id:e,text:t}){let[n,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``),[s,l]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let t=!1;return i(null),Oe.run(e).then(e=>!t&&(i(e),o(``)),e=>!t&&o(e.message)),()=>{t=!0}},[e]);let u=(0,$.jsxs)(`a`,{href:r(`quality`,`localization`),className:c(_({variant:`link`,size:`inline`}),`gap-1 self-start`),children:[(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});if(a||!n)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u,a?(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a}):(0,$.jsx)(S,{shape:`detail`})]});let d=async()=>{try{let{id:e}=await p.start(`Explain the localization findings of the browser run ${n.id} in the reports folder (its localization.json and the captures in its localization folder), page by page, and what the developers should change.`,{});location.hash=r(`chats`,e)}catch(e){l(e.message)}},f=e=>n.counts[e]??0;return(0,$.jsxs)(`section`,{"aria-labelledby":`l10n-run-h`,className:`flex min-w-0 flex-col gap-4`,children:[u,(0,$.jsx)(K,{id:`l10n-run-h`,icon:j,title:(0,$.jsx)(`span`,{"data-tip":n.goal,children:n.goal}),description:(0,$.jsxs)($.Fragment,{children:[J(n.at),` · `,n.langs.length?n.langs.join(`, `):`no lang`,` · `,(0,$.jsx)(`span`,{className:`font-mono`,children:n.id})]}),actions:(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void d(),children:[(0,$.jsx)(F,{"aria-hidden":`true`}),`Chat`]})}),s&&(0,$.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:s}),(0,$.jsxs)(q,{label:`What the run found`,children:[(0,$.jsx)(W,{dot:`neutral`,value:n.pages,label:n.langs.length?`pages (${n.langs.join(`, `)})`:`pages, no lang set`}),(0,$.jsx)(W,{dot:`fail`,value:f(`key`),label:`translation keys shown`}),(0,$.jsx)(W,{dot:`warn`,value:f(`untranslated`),label:`English left on other languages`}),(0,$.jsx)(W,{dot:`warn`,value:f(`cut_off`)+f(`overflow`),label:`cut off as the page was`}),(0,$.jsx)(W,{dot:`warn`,value:f(`expansion`),label:`break with longer text`}),(0,$.jsx)(W,{dot:`warn`,value:f(`rtl`),label:`break right to left`})]}),(0,$.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:n.list.map((e,r)=>(0,$.jsx)(Me,{id:n.id,page:e,index:r,text:t},e.url))})]})}function Pe({runs:e}){let t=e=>location.hash=r(`quality`,`localization`,encodeURIComponent(e)),n=(e,t)=>e.counts[t]??0;return(0,$.jsx)(V,{label:`Runs`,placeholder:`Find a run by what it did`,empty:`Nothing matches.`,height:U,head:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`th`,{scope:`col`,className:c(z,`w-[44%]`),children:`Run`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Keys`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @xl:table-cell`),children:`English left`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Cut off`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @2xl:table-cell`),children:`Longer · RTL`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @xl:table-cell`),children:`When`})]}),children:e.map(e=>{let i=n(e,`key`),a=n(e,`untranslated`)+n(e,`cut_off`)+n(e,`overflow`)+n(e,`expansion`)+n(e,`rtl`),o=i?I:a?O:A;return(0,$.jsxs)(`tr`,{onClick:()=>t(e.id),className:H,children:[(0,$.jsx)(`td`,{className:c(L,`max-w-0`),children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(o,{size:15,"aria-label":i?`Keys shown`:a?`Needs a look`:`Nothing found`,className:c(`flex-none`,i?`text-fail`:a?`text-warn`:`text-pass`)}),(0,$.jsx)(`a`,{href:r(`quality`,`localization`,encodeURIComponent(e.id)),onClick:e=>e.stopPropagation(),"data-tip":e.goal,className:`truncate text-ink no-underline hover:underline`,children:e.goal})]})}),(0,$.jsx)(`td`,{className:c(B,i?`text-fail`:`text-muted`),children:i}),(0,$.jsx)(`td`,{className:c(B,`hidden @xl:table-cell`,n(e,`untranslated`)?`text-warn`:`text-muted`),children:n(e,`untranslated`)}),(0,$.jsx)(`td`,{className:c(B,n(e,`cut_off`)+n(e,`overflow`)?`text-warn`:`text-muted`),children:n(e,`cut_off`)+n(e,`overflow`)}),(0,$.jsxs)(`td`,{className:c(B,`hidden text-muted @2xl:table-cell`),"data-sort":n(e,`expansion`)+n(e,`rtl`),children:[n(e,`expansion`),` · `,n(e,`rtl`)]}),(0,$.jsx)(`td`,{className:c(L,`hidden whitespace-nowrap text-body-sm text-muted @xl:table-cell`),"data-tip":J(e.at),"data-sort":new Date(e.at).getTime()||0,children:pe(e.at)})]},e.id)})})}function Fe({id:e}){let[t,n]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{Oe.view().then(e=>(n(e),a(``)),e=>a(e.message))},[]),i?(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:i}):t?e?(0,$.jsx)(Ne,{id:e,text:t.text}):t.runs.length?(0,$.jsx)(Pe,{runs:t.runs}):(0,$.jsx)(g,{page:!0,icon:j,title:`No runs checked yet`,action:(0,$.jsxs)(`a`,{className:_({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,$.jsx)(k,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow in each language your site has, and what it found shows here. Every browser run with accessibility checks on also checks each page's language.`}):(0,$.jsx)(S,{shape:`rows`})}var Ie=[{id:`7d`,label:`Last 7 days`},{id:`30d`,label:`Last 30 days`},{id:`90d`,label:`Last 90 days`},{id:`all`,label:`All time`}],Le=[{key:`a11y`,label:`Accessibility violations`,better:`down`,show:e=>String(e)},{key:`seo`,label:`SEO score`,better:`up`,show:e=>String(e)},{key:`lcp`,label:`Largest paint (LCP)`,better:`down`,show:e=>X(e,`ms`)}];function Re(e,t,n,r){if(t===void 0||n===void 0||r<2)return;let i=n-t;if(!i)return;let a=i>0;return{text:`${a?`+`:`−`}${e.key===`lcp`?X(Math.abs(i),`ms`):Math.abs(i)}`,dir:a?`up`:`down`,good:(a?`up`:`down`)===e.better,against:`since the first run of the range`}}function ze({s:e}){let t=t=>e.points.map(e=>e[t]).filter(e=>typeof e==`number`),n=Le.filter(e=>t(e.key).length),r=e=>e?J(e.at):``;return(0,$.jsxs)(`section`,{"aria-label":e.site,className:c(o,`flex flex-col gap-4`),children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,$.jsx)(j,{size:16,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,$.jsx)(`h3`,{className:`m-0 min-w-0 truncate font-mono text-body-lg font-medium`,children:e.site}),(0,$.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[Ce(e.runs,`run`),` · `,Ce(e.pages,`page`),e.first&&e.latest&&e.runs>1?` · ${r(e.first)} to ${r(e.latest)}`:e.latest?` · ${r(e.latest)}`:``]})]}),n.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(ce,{label:`${e.site} now`,className:`shadow-none`,children:n.map(t=>{let n=e.latest?.[t.key],r=Re(t,e.first?.[t.key],n,e.runs);return(0,$.jsx)(he,{compact:!0,label:t.label,value:n===void 0?`–`:t.show(n),...r?{change:r}:{note:e.runs>1?`No change in this range`:`One run in this range`}},t.key)})}),e.points.length>1&&(0,$.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,150px),1fr))] gap-x-px`,children:n.map(n=>{let r=t(n.key),i=Re(n,e.first?.[n.key],e.latest?.[n.key],e.runs);return r.length>1?(0,$.jsx)(x,{series:[{values:r,tone:i?.good===!1?`fail`:`accent`}],label:`${n.label} over the last ${r.length} runs: ${r.map(n.show).join(`, `)}`,className:`h-12 px-4`},n.key):(0,$.jsx)(`span`,{},n.key)})})]}),e.analytics.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-body-sm`,children:[(0,$.jsx)(`span`,{className:`mr-1 text-muted`,children:`Analytics in the latest run:`}),e.analytics.map(e=>(0,$.jsxs)(w,{tone:`neutral`,icon:!1,children:[e.tool,(0,$.jsxs)(`span`,{className:`text-muted`,children:[` · `,Ce(e.pages,`page`)]})]},e.tool))]}),(0,$.jsx)(ye,{icon:M,className:`text-fail`,lines:e.newRules.map(e=>`newly failing: ${e}`)}),(0,$.jsx)(ye,{icon:se,className:`text-pass`,lines:e.fixedRules.map(e=>`fixed: ${e}`)})]})}function Be(){let[e,t]=(0,Q.useState)(`30d`),[n,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{let t=!1;return i(null),Te.view(e).then(e=>!t&&(i(e.sites),o(``)),e=>!t&&o(e.message)),()=>{t=!0}},[e]),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Every browser run and site scan adds each page's accessibility and timings to the history; a scan also adds its SEO score and analytics tags. A site is its origin; each number is per run, summed over its pages (violations) or their average (SEO score, LCP). The change is against the first run in the range.`}),children:`How each site's accessibility, SEO, speed and analytics changed over time.`}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:Ie,value:e,onChange:t})}),a&&(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a}),!n&&!a&&(0,$.jsx)(S,{shape:`detail`}),n&&(n.length?(0,$.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map(e=>(0,$.jsx)(ze,{s:e},e.site))}):(0,$.jsx)(g,{page:!0,icon:E,title:e===`all`?`No history yet`:`Nothing in this range`,action:(0,$.jsx)(`a`,{className:_({size:`sm`}),href:r(`quality`,`scans`),children:`Scan pages`}),children:`Scan a few pages, or run a flow in a browser: each page's results are kept, and every site shows here with how it changed.`}))]})}var Ve={view:()=>h(`GET`,`/api/security`),run:e=>h(`GET`,`/api/security/${encodeURIComponent(e)}`)},He={high:`text-fail`,medium:`text-warn`,low:`text-muted`},Ue={high:`High`,medium:`Medium`,low:`Low`};function We({id:e,fix:t}){let[n,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``),[s,l]=(0,Q.useState)(`all`),[u,d]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let t=!1;return i(null),Ve.run(e).then(e=>!t&&(i(e),o(``)),e=>!t&&o(e.message)),()=>{t=!0}},[e]);let f=(0,$.jsxs)(`a`,{href:r(`quality`,`security`),className:`inline-flex items-center gap-1 self-start text-body-sm no-underline`,children:[(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});if(a)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[f,(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a})]});if(!n)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[f,(0,$.jsx)(S,{shape:`detail`})]});let m=async()=>{try{let{id:e}=await p.start(`Explain the passive security findings of the browser run ${n.id} in the reports folder (its network.json, security section), most serious first, and how the team should fix each.`,{});location.hash=r(`chats`,e)}catch(e){d(e.message)}},h=n.findings.filter(e=>s===`all`||e.severity===s);return(0,$.jsxs)(`section`,{"aria-labelledby":`sec-run-h`,className:`flex min-w-0 flex-col gap-4`,children:[f,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,$.jsx)(K,{id:`sec-run-h`,icon:ie,title:(0,$.jsx)(`span`,{"data-tip":n.goal,className:`block truncate`,children:n.goal})}),(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-body-sm text-muted`,children:[J(n.at),` · `,n.env?`${n.env} · `:``,n.host??`no start page`,` · `,(0,$.jsx)(`span`,{className:`font-mono`,children:n.id})]})]}),!n.production&&n.findings.length>0&&(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void m(),children:[(0,$.jsx)(F,{"aria-hidden":`true`}),`Chat`]})]}),u&&(0,$.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:u}),n.production?(0,$.jsxs)(g,{icon:oe,title:`Not checked`,children:[`This run was on `,n.env,`, an environment named like production. The security smoke checks are for test environments only.`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(q,{label:`Findings by severity`,children:[(0,$.jsx)(W,{dot:`fail`,value:n.counts.high,label:`high: fix before release`}),(0,$.jsx)(W,{dot:`warn`,value:n.counts.medium,label:`medium: worth fixing`}),(0,$.jsx)(W,{dot:`neutral`,value:n.counts.low,label:`low: hardening`}),(0,$.jsx)(W,{dot:`neutral`,value:n.pages,label:`pages checked`}),(0,$.jsx)(W,{dot:`neutral`,value:n.calls,label:`calls checked`})]}),!n.pages&&!n.findings.length?(0,$.jsx)(g,{icon:O,title:`No pages recorded`,children:`This run kept its API calls but not the pages' headers and cookies: it was made before ForgeQE recorded them. Run the flow again to check it.`}):n.findings.length?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:[{id:`all`,label:`All`,n:n.findings.length},...[`high`,`medium`,`low`].filter(e=>n.counts[e]).map(e=>({id:e,label:Ue[e],n:n.counts[e],alert:e===`high`}))],value:s,onChange:l})}),(0,$.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:h.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start gap-2 border-t border-line-soft py-2 text-body-sm`,children:[e.severity===`high`?(0,$.jsx)(I,{size:15,"aria-label":`High`,className:`mt-1 flex-none text-fail`}):(0,$.jsx)(O,{size:15,"aria-label":Ue[e.severity],className:c(`mt-1 flex-none`,He[e.severity])}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,$.jsxs)(`span`,{className:`font-medium`,children:[e.title,` `,(0,$.jsxs)(`span`,{className:c(`font-normal`,He[e.severity]),children:[`· `,Ue[e.severity]]})]}),(0,$.jsxs)(`span`,{className:`truncate font-mono text-body-sm text-ink-2`,"data-tip":e.target,children:[e.target,e.detail?` · ${e.detail}`:``]}),(0,$.jsx)(`span`,{className:`text-body-sm text-ink-2`,children:t[e.kind]?.fix})]})]},`${e.kind}|${e.target}`))})]}):(0,$.jsx)(g,{icon:A,title:`Nothing found`,children:`The pages this run loaded sent the security headers checked, their cookies had safe flags, and no answer held a key or token.`})]})]})}function Ge({runs:e}){let[t,n]=(0,Q.useState)(`all`),i=t===`high`?e.filter(e=>e.counts.high):e,a=e=>location.hash=r(`quality`,`security`,encodeURIComponent(e));return(0,$.jsx)(V,{label:`Runs`,placeholder:`Find a run by what it did`,resetKey:t,empty:`Nothing matches.`,height:U,tools:(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:[{id:`all`,label:`All`,n:e.length},{id:`high`,label:`High findings`,n:e.filter(e=>e.counts.high).length,alert:!0}],value:t,onChange:n})}),head:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`th`,{scope:`col`,className:c(z,`w-[46%]`),children:`Run`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`High`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Medium`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @xl:table-cell`),children:`Low`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @2xl:table-cell`),children:`Environment`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @xl:table-cell`),children:`When`})]}),children:i.map(e=>{let t=e.production||!e.pages&&!e.counts.high&&!e.counts.medium&&!e.counts.low,n=t?oe:e.counts.high?I:e.counts.medium?O:A,i=e.production?`Not checked: production`:t?`No pages recorded`:e.counts.high?`High findings`:e.counts.medium?`Medium findings`:`Nothing serious`;return(0,$.jsxs)(`tr`,{onClick:()=>a(e.id),className:H,children:[(0,$.jsx)(`td`,{className:c(L,`max-w-0`),children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(n,{size:15,"aria-label":i,className:c(`flex-none`,t?`text-muted`:e.counts.high?`text-fail`:e.counts.medium?`text-warn`:`text-pass`)}),(0,$.jsx)(`a`,{href:r(`quality`,`security`,encodeURIComponent(e.id)),onClick:e=>e.stopPropagation(),"data-tip":e.goal,className:`truncate text-ink no-underline hover:underline`,children:e.goal})]})}),(0,$.jsx)(`td`,{"data-sort":t?-1:e.counts.high,className:c(B,e.counts.high?`text-fail`:`text-muted`),children:t?`–`:e.counts.high}),(0,$.jsx)(`td`,{"data-sort":t?-1:e.counts.medium,className:c(B,e.counts.medium?`text-warn`:`text-muted`),children:t?`–`:e.counts.medium}),(0,$.jsx)(`td`,{"data-sort":t?-1:e.counts.low,className:c(B,`hidden text-muted @xl:table-cell`),children:t?`–`:e.counts.low}),(0,$.jsx)(`td`,{className:c(L,`hidden text-body-sm text-muted @2xl:table-cell`),children:e.production?`${e.env} · not checked`:t?`no pages recorded`:e.env??e.host??`–`}),(0,$.jsx)(`td`,{className:c(L,`hidden whitespace-nowrap text-body-sm text-muted @xl:table-cell`),"data-tip":J(e.at),"data-sort":new Date(e.at).getTime()||0,children:pe(e.at)})]},e.id)})})}function Ke({id:e}){let[t,n]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{Ve.view().then(e=>(n(e),a(``)),e=>a(e.message))},[]),i?(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:i}):t?e?(0,$.jsx)(We,{id:e,fix:t.fix}):t.runs.length?(0,$.jsx)(Ge,{runs:t.runs}):(0,$.jsx)(g,{page:!0,icon:oe,title:`No runs to check yet`,action:(0,$.jsxs)(`a`,{className:_({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,$.jsx)(k,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow on a test environment, and what it found shows here. Every browser run keeps the pages' security headers, the cookies' flags and its API calls.`}):(0,$.jsx)(S,{shape:`rows`})}function qe(){let[e,t]=(0,Q.useState)(``),[n,r]=(0,Q.useState)(``),[i,o]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let i=!1;return Z.view(e,n).then(a=>{i||(o(a),l(``),e||t(a.coverage.standard),n||r(a.coverage.engine))},e=>!i&&l(e.message)),()=>{i=!0}},[e,n]);let f=async t=>{d(t),l(``);try{let r=await(t===`csv`?Z.csv(e,n):t===`html`?Z.html(e,n):Z.pdf(e,n));m(r,`wcag-coverage-${e}-${n}.${t}`)}catch(e){l(e.message)}finally{d(``)}};return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Rules come from the engine's own map of its rules to the success criteria; a rule that runs never proves a criterion is met. The personas (Accessibility › Agent) exercise criteria by how they use a page: a keyboard-only person meets focus order, a person at 200% zoom meets reflow. What is left needs a person reviewing by hand.`}),children:`What ForgeQE's rules and accessibility personas can check of a WCAG standard, criterion by criterion.`}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_220px] flex-col gap-1 text-body-sm font-medium`,children:[`Standard`,(0,$.jsx)(a,{size:`sm`,value:e,onChange:e=>t(e.target.value),disabled:!i,children:(i?.standards??[]).map(e=>(0,$.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,$.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_200px] flex-col gap-1 text-body-sm font-medium`,children:[`Rule engine`,(0,$.jsx)(a,{size:`sm`,value:n,onChange:e=>r(e.target.value),disabled:!i,children:(i?.engines??[]).map(e=>(0,$.jsx)(`option`,{value:e,children:we(e)},e))})]}),(0,$.jsx)(`span`,{className:`flex-auto`}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,disabled:!i||!!u,onClick:()=>void f(`csv`),"data-tip":`Download the matrix as CSV`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`}),`CSV`]}),(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,disabled:!i||!!u,onClick:()=>void f(`html`),"data-tip":`Download the matrix as an HTML page`,children:[(0,$.jsx)(re,{"aria-hidden":`true`}),`HTML`]}),(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,disabled:!i||!!u,onClick:()=>void f(`pdf`),"data-tip":`Print the matrix to PDF and download it`,children:[(0,$.jsx)(ae,{"aria-hidden":`true`}),u===`pdf`?`Printing…`:`PDF`]})]})]}),s&&(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:s}),!i&&!s&&(0,$.jsx)(S,{shape:`rows`,count:8}),i&&(0,$.jsx)(Ee,{c:i.coverage,engineLabel:we(i.coverage.engine)},`${i.coverage.standard}-${i.coverage.engine}`)]})}function Je({id:e,asked:t,view:n,onChanged:i}){let[a,o]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(`accessibility`),m=t===`accessibility`||t===`performance`||t===`visual`?t:u,h=t=>location.hash=r(`quality`,encodeURIComponent(e),t),[g,b]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{let t=!1;return o(null),f.run(e).then(e=>{if(t)return;o(e),l(``);let n=e.visual?.pages.some(e=>e.status===`changed`)||!e.visual&&e.captured;d(e.report?.accessibility.failed.length?`accessibility`:e.report?.breaches.some(e=>e.kind===`performance`)?`performance`:n?`visual`:e.report?.accessibility.pages?`accessibility`:e.report?.performance.pages.length?`performance`:`visual`)},e=>!t&&l(e.message)),()=>{t=!0}},[e]);let x=(0,$.jsxs)(`a`,{href:r(`quality`),className:c(_({variant:`link`,size:`inline`}),`gap-1 self-start`),children:[(0,$.jsx)(D,{size:14,"aria-hidden":`true`,className:`rotate-90`}),`All runs`]});if(s)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[x,(0,$.jsx)(`p`,{className:c(v.fail,`m-0`),children:s})]});if(!a)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[x,(0,$.jsx)(S,{shape:`detail`})]});let w=async()=>{try{let{id:e}=await p.start(`Explain the accessibility, performance and visual results of the run in ${a.dir}: call quality_report and visual_compare with run_dir ${a.dir}. Say what matters most to fix first, and why.`,{});location.hash=r(`chats`,e)}catch(e){b(e.message)}},T=a.report,E=T?.accessibility,O=T?.performance.pages??[],k=O.filter(e=>e.over.length).length,A=O.map(e=>e.lcp).filter(e=>typeof e==`number`),j=A.length?Math.max(...A):void 0,M=a.visual?.pages.filter(e=>e.status===`changed`).length??0,N=T?.breaches.length??0,re=[{id:`accessibility`,label:`Accessibility`,icon:P,n:E?.pages?`${E.failed.length} failed`:`not measured`,tone:E?.failed.length?`text-fail`:void 0},{id:`performance`,label:`Performance`,icon:ee,n:O.length?k?`${k} over budget`:`${O.length} pages`:`not measured`,tone:k?`text-fail`:void 0},{id:`visual`,label:`Visual`,icon:ne,n:a.visual?`${M} changed`:a.captured?`not compared`:`not captured`,tone:M?`text-warn`:void 0}];return(0,$.jsxs)(`section`,{"aria-labelledby":`run-h`,className:`flex min-w-0 flex-col gap-4`,children:[x,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,$.jsx)(K,{id:`run-h`,icon:te,title:(0,$.jsx)(`span`,{"data-tip":a.goal,className:`block truncate`,children:a.goal})}),(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 text-body-sm text-muted`,children:[J(a.at),` · `,n.standard,` · `,(0,$.jsx)(C,{path:a.dir})]})]}),(0,$.jsxs)(y,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void w(),children:[(0,$.jsx)(F,{"aria-hidden":`true`}),`Chat`]})]}),g&&(0,$.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:g}),(0,$.jsxs)(q,{label:`What the run measured`,children:[(0,$.jsx)(W,{dot:N?`fail`:`pass`,value:N,label:N?`budgets exceeded: fails the run`:`budgets exceeded`}),E?.pages?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(W,{dot:`fail`,value:E.failed.length,label:`rules failed (${E.passed.length} passed)`}),(0,$.jsx)(W,{dot:`fail`,value:`${E.byImpact.critical} · ${E.byImpact.serious}`,label:`critical · serious`}),(0,$.jsx)(W,{dot:`warn`,value:`${E.byImpact.moderate} · ${E.byImpact.minor}`,label:`moderate · minor`})]}):null,O.length>0&&(0,$.jsx)(W,{dot:k?`fail`:`neutral`,value:O.length,label:k?`pages timed, ${k} over budget`:`pages timed`}),j!==void 0&&(0,$.jsx)(W,{dot:j>4e3?`fail`:j>2500?`warn`:`pass`,value:X(j,`ms`),label:`slowest LCP (good up to 2.5s)`}),a.visual?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(W,{dot:`neutral`,value:a.visual.pages.length,label:`pages compared`}),(0,$.jsx)(W,{dot:`warn`,value:M,label:a.visual.pages.some(e=>e.over)?`pages changed, over budget`:`pages changed`})]}):a.captured?(0,$.jsx)(W,{dot:`neutral`,value:a.captured,label:`pages captured, not compared`}):null]}),(0,$.jsx)(de,{label:`Results`,className:`mb-0`,current:m,onPick:h,tabs:re.map(e=>({id:e.id,label:e.label,n:e.n,...e.tone?{tone:e.tone}:{}}))}),(0,$.jsxs)(`div`,{role:`tabpanel`,id:`panel-${m}`,"aria-labelledby":`tab-${m}`,className:`flex min-w-0 flex-col`,children:[m===`accessibility`&&(0,$.jsx)(xe,{run:a,standard:n.standard,disclaimer:n.disclaimer},a.id),m===`performance`&&(0,$.jsx)(_e,{run:a}),m===`visual`&&(0,$.jsx)(ve,{run:a,budget:n.budgets.visual,onChange:e=>{o(e),i()}})]})]})}function Ye({runs:e}){let[t,n]=(0,Q.useState)(`all`),i=e,a=t===`attention`?i.filter(Y):i,o=e=>location.hash=r(`quality`,encodeURIComponent(e));return(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,$.jsx)(V,{label:`Runs`,placeholder:`Find a run by what it did`,resetKey:t,empty:`Nothing matches.`,height:U,tools:(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsx)(b,{items:[{id:`all`,label:`All`,n:i.length},{id:`attention`,label:`Needs a look`,n:i.filter(Y).length,alert:!0}],value:t,onChange:n})}),head:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`th`,{scope:`col`,className:c(z,`w-[46%]`),children:`Run`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Rules failed`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @2xl:table-cell`),children:`Critical · serious`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @xl:table-cell`),children:`Slow pages`}),(0,$.jsx)(`th`,{scope:`col`,className:R,children:`Visual`}),(0,$.jsx)(`th`,{scope:`col`,className:c(R,`hidden @3xl:table-cell`),children:`Budgets`}),(0,$.jsx)(`th`,{scope:`col`,className:c(z,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let t=e.breaches?I:Y(e)?O:A,n=e.a11y?e.a11y.critical+e.a11y.serious:void 0;return(0,$.jsxs)(`tr`,{onClick:()=>o(e.id),className:H,children:[(0,$.jsx)(`td`,{className:c(L,`max-w-0`),children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(t,{size:15,"aria-label":e.breaches?`Over a budget`:Y(e)?`Needs a look`:`Within budgets`,className:c(`flex-none`,e.breaches?`text-fail`:Y(e)?`text-warn`:`text-pass`)}),(0,$.jsx)(`a`,{href:r(`quality`,encodeURIComponent(e.id)),onClick:e=>e.stopPropagation(),"data-tip":e.goal,className:`truncate text-ink no-underline hover:underline`,children:e.goal})]})}),(0,$.jsx)(`td`,{className:c(B,e.a11y?.failed?`text-fail`:`text-muted`),"data-sort":e.a11y?e.a11y.failed:-1,children:e.a11y?e.a11y.failed:`–`}),(0,$.jsx)(`td`,{className:c(B,`hidden @2xl:table-cell`,n?`text-fail`:`text-muted`),"data-sort":e.a11y?e.a11y.critical*1e3+e.a11y.serious:-1,children:e.a11y?`${e.a11y.critical} · ${e.a11y.serious}`:`–`}),(0,$.jsx)(`td`,{className:c(B,`hidden @xl:table-cell`,e.perf.over?`text-fail`:`text-muted`),"data-sort":e.perf.pages?e.perf.over:-1,children:e.perf.pages?`${e.perf.over} / ${e.perf.pages}`:`–`}),(0,$.jsx)(`td`,{className:c(B,e.visual?.changed?`text-warn`:`text-muted`),"data-sort":e.visual?e.visual.changed:-1,children:e.visual?`${e.visual.changed} changed`:e.captured?`not compared`:`–`}),(0,$.jsx)(`td`,{className:c(B,`hidden @3xl:table-cell`,e.breaches?`text-fail`:`text-muted`),"data-sort":e.breaches||0,children:e.breaches?`${e.breaches} over`:`ok`}),(0,$.jsx)(`td`,{className:c(L,`hidden whitespace-nowrap text-body-sm text-muted @xl:table-cell`),"data-tip":J(e.at),"data-sort":new Date(e.at).getTime()||0,children:pe(e.at)})]},e.id)})})})}function Xe({sub:e}){let[t,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(``),s=(0,Q.useCallback)(()=>{f.view().then(e=>{i(e),o(``)},e=>o(e.message))},[]);(0,Q.useEffect)(s,[s]);let[l=``,d,p]=(e??``).split(`/`),m=l===`trends`,h=l===`security`,y=l===`localization`,b=l===`scans`,x=l===`dashboard`,C=l===`coverage`,w=b||x||C,D=(h||y)&&d?n(d):void 0,O=h?D:void 0,A=l&&!m&&!h&&!y&&!w?n(l):``;return(0,$.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,$.jsx)(me,{}),(0,$.jsxs)(`main`,{className:c(ge,`@container flex-auto gap-4`),children:[(0,$.jsx)(T,{}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,$.jsx)(ue,{pixel:u.quality,size:`lg`,head:!0}),(0,$.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Quality`}),!A&&!(b&&d)&&(0,$.jsx)(fe,{label:`Show`,current:m?`trends`:h?`security`:y?`localization`:b?`scans`:x?`dashboard`:C?`coverage`:`runs`,links:[{id:`runs`,label:`Runs`,icon:te,href:r(`quality`)},{id:`scans`,label:`Scan history`,icon:N,href:r(`quality`,`scans`)},{id:`dashboard`,label:`Dashboard`,icon:E,href:r(`quality`,`dashboard`)},{id:`trends`,label:`Trends`,icon:M,href:r(`quality`,`trends`)},{id:`coverage`,label:`WCAG coverage`,icon:P,href:r(`quality`,`coverage`)},{id:`security`,label:`Security`,icon:ie,href:r(`quality`,`security`)},{id:`localization`,label:`Localization`,icon:j,href:r(`quality`,`localization`)}]})]}),h&&!O&&(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Passive smoke checks read from what each run recorded: the pages' security headers, the flags of the cookies they set, http requests from https pages, redirects to an address taken from the URL, and keys or tokens in API answers. Nothing is sent to the site, and runs on an environment named like production are not checked.`}),children:`Security problems each browser run's pages showed, found without touching the site.`}),y&&!D&&(0,$.jsx)(G,{more:(0,$.jsx)($.Fragment,{children:`Each page is checked for translation keys shown as text, English left on a page in another language, and text cut off or running past its box. Then, for a moment the run never sees, the page is shown with pseudo-localized text (accented and a third longer) and right to left, to find what breaks in German or Arabic before it is translated. Run a flow in each language your site has.`}),children:`Each page a browser run visited, checked for its language and for what breaks when it is translated.`}),!A&&!h&&!y&&!w&&(0,$.jsx)(G,{more:(0,$.jsxs)($.Fragment,{children:[`Each browser run measures accessibility (`,t?.standard||`WCAG`,`), Core Web Vitals, and visual changes against approved baselines. Budgets (quality.budgets) decide what fails a run. Open a run for all its details, or one kind with its agent: `,(0,$.jsx)(`a`,{href:r(`accessibility`,`agent`),children:`Accessibility`}),`, `,(0,$.jsx)(`a`,{href:r(`performance`,`agent`),children:`Performance`}),` or `,(0,$.jsx)(`a`,{href:r(`visual`,`agent`),children:`Visual`}),`.`]}),children:`How accessible, fast and visually unchanged the pages of each browser run were.`}),a&&(0,$.jsx)(`p`,{role:`alert`,className:c(v.fail,`m-0`),children:a}),!t&&!a&&!w&&(0,$.jsx)(S,{shape:`rows`}),h&&(0,$.jsx)(Ke,{id:O}),b&&(0,$.jsx)(De,{id:d,asked:p}),x&&(0,$.jsx)(Be,{}),C&&(0,$.jsx)(qe,{}),y&&(0,$.jsx)(Fe,{id:D}),t&&A&&(0,$.jsx)(Je,{id:A,asked:d,view:t,onChanged:s},A),t&&!A&&m&&!w&&(0,$.jsx)(`div`,{role:`tabpanel`,"aria-label":`Trends`,children:(0,$.jsx)(be,{trends:t.trends})}),t&&!A&&!m&&!h&&!y&&!w&&(t.runs.length?(0,$.jsx)(Ye,{runs:t.runs}):(0,$.jsx)(g,{page:!0,icon:P,title:`No measurements yet`,action:(0,$.jsxs)(`a`,{className:_({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,$.jsx)(k,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow from a chat or the Record page, and what it measured shows here. Every browser run checks accessibility, timings and visual changes of the pages it visits.`}))]})]})}export{Xe as Quality};
@@ -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{F as r,L as i,a}from"./preload-helper-BupTYkQW.js";import{t as o}from"./utils-DJRAScIl.js";import{t as s}from"./jsx-runtime-LKYXHABd.js";import{L as c}from"./palette-DOQemIAv.js";import{v as l}from"./api-B8AQ8-Gb.js";import{I as u,P as d,g as f,n as p}from"./pageBack-CINGjBHZ.js";import{Er as m,N as h,P as g,it as _,o as v,z as y}from"./line-icons-Cwj9OmCz.js";import{en as b,mt as x,s as S,t as C}from"./frame-Z5TaJY7O.js";import{J as w,V as T}from"./index-nbjwmmih.js";import{d as E}from"./qualityParts-O56nH8FQ.js";var D=e(t(),1),O={view:(e,t)=>l(`GET`,`/api/readiness?${new URLSearchParams({...e?{pack:e}:{},...t?{report:t}:{}})}`),signOff:e=>l(`POST`,`/api/readiness/signoff`,{...e,confirmed:!0})},k=s(),A={pass:{label:`Pass`,icon:h,tone:`text-pass`},risk:{label:`Risk`,icon:m,tone:`text-warn`},block:{label:`Blocker`,icon:y,tone:`text-fail`},unknown:{label:`No evidence`,icon:g,tone:`text-muted`}},j={GO:{word:`Go`,tone:`text-pass`,bg:`bg-pass-soft`,text:`Every criterion with evidence passed.`},"GO WITH RISKS":{word:`Go with risks`,tone:`text-warn`,bg:`bg-warn-soft`,text:`Nothing blocks the release, but some criteria are risks or have no evidence yet.`},"NO-GO":{word:`No go`,tone:`text-fail`,bg:`bg-fail-soft`,text:`At least one criterion blocks the release.`},"NO EVIDENCE":{word:`No evidence yet`,tone:`text-muted`,bg:`bg-surface-muted`,text:`Nothing has been measured for this release yet: build and run a regression pack.`}},M={GO:`go`,"GO WITH RISKS":`go-with-risks`,"NO-GO":`no-go`,"NO EVIDENCE":`no-go`};function N({view:e,onDone:t}){let[n,s]=(0,D.useState)(``),[c,l]=(0,D.useState)(M[e.verdict]),[u,f]=(0,D.useState)(``),[p,m]=(0,D.useState)(!1),[g,_]=(0,D.useState)(``),v=async()=>{m(!0);try{let r=await O.signOff({by:n.trim(),decision:c,...u.trim()?{note:u.trim()}:{},...e.pack?{pack:e.pack}:{},...e.report?{report:e.report}:{}});t(r.view,r.file,r.markdown)}catch(e){_(e.message)}finally{m(!1)}};return(0,k.jsxs)(`form`,{"aria-label":`Sign off`,className:o(a,`flex flex-col gap-2 text-body-sm`),onSubmit:e=>{e.preventDefault(),n.trim()&&v()},children:[(0,k.jsxs)(`span`,{children:[`Sign off `,e.release||e.pack||`this release`,` as it is now. The record keeps your name, your decision, ForgeQE's verdict and every criterion with its evidence.`]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1 font-medium`,children:[`Your name`,(0,k.jsx)(r,{size:`sm`,value:n,maxLength:80,onChange:e=>s(e.target.value)})]}),(0,k.jsxs)(`label`,{className:`flex flex-[0_1_200px] flex-col gap-1 font-medium`,children:[`Decision`,(0,k.jsxs)(i,{size:`sm`,value:c,onChange:e=>l(e.target.value),children:[(0,k.jsx)(`option`,{value:`go`,children:`Go`}),(0,k.jsx)(`option`,{value:`go-with-risks`,children:`Go with risks`}),(0,k.jsx)(`option`,{value:`no-go`,children:`No go`})]})]}),(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1 font-medium`,children:[`Note (optional)`,(0,k.jsx)(r,{size:`sm`,value:u,maxLength:500,onChange:e=>f(e.target.value),placeholder:`Accepted the coupon risk: covered by a manual check`})]}),(0,k.jsxs)(d,{size:`sm`,variant:`primary`,type:`submit`,disabled:p||!n.trim(),children:[(0,k.jsx)(h,{"aria-hidden":`true`}),`Sign off`]})]}),g&&(0,k.jsx)(`p`,{role:`alert`,className:`m-0 text-fail`,children:g})]})}function P(){let[e,t]=(0,D.useState)(null),[r,a]=(0,D.useState)(``),[s,l]=(0,D.useState)(),[m,g]=(0,D.useState)(),[y,M]=(0,D.useState)(!1),[P,F]=(0,D.useState)(null),I=(0,D.useCallback)(()=>{O.view(s,m).then(e=>(t(e),a(``)),e=>a(e.message))},[s,m]);(0,D.useEffect)(I,[I]);let L=e,R=L?{block:L.criteria.filter(e=>e.status===`block`).length,risk:L.criteria.filter(e=>e.status===`risk`).length,unknown:L.criteria.filter(e=>e.status===`unknown`).length}:void 0;return(0,k.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,k.jsx)(S,{}),(0,k.jsxs)(`main`,{className:o(C,`@container flex-auto gap-4`),children:[(0,k.jsx)(p,{}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,k.jsx)(b,{pixel:c.readiness,size:`lg`,head:!0}),(0,k.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Release readiness`})]}),(0,k.jsx)(T,{more:(0,k.jsx)(k.Fragment,{children:`The verdict comes from what ForgeQE has measured: the regression pack's last run and the changes it does not cover, the latest readiness report of the test cases and bugs, flaky tests, Quality budgets and Security findings since the pack was built, the agents' Evidence verdicts and exploratory sessions. Any blocker makes it a no go. Each criterion opens the page with its evidence.`}),children:`Decide whether a release is ready to ship, and sign it off.`}),r&&(0,k.jsx)(`p`,{role:`alert`,className:o(u.fail,`m-0`),children:r}),!L&&!r&&(0,k.jsx)(f,{shape:`detail`}),L&&R&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1 text-body-sm font-medium`,children:[`Release (regression pack)`,(0,k.jsxs)(i,{size:`sm`,value:L.pack??``,onChange:e=>(l(e.target.value||void 0),F(null)),disabled:!L.packs.length,children:[!L.packs.length&&(0,k.jsx)(`option`,{value:``,children:`No packs yet`}),L.packs.map(e=>(0,k.jsx)(`option`,{value:e.name,children:e.release?`${e.release} · ${e.name}`:e.name},e.name))]})]}),(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1 text-body-sm font-medium`,children:[`Test cases and bugs (readiness report)`,(0,k.jsxs)(i,{size:`sm`,value:L.report??``,onChange:e=>(g(e.target.value||void 0),F(null)),disabled:!L.reports.length,children:[!L.reports.length&&(0,k.jsx)(`option`,{value:``,children:`No reports yet`}),L.reports.map(e=>(0,k.jsxs)(`option`,{value:e.id,children:[e.scope,` · `,e.verdict,` · `,e.id]},e.id))]})]})]}),(0,k.jsxs)(`section`,{"aria-label":`Verdict`,className:o(`flex flex-wrap items-center gap-x-6 gap-y-2 rounded-md px-4 py-4`,j[L.verdict].bg),children:[(0,k.jsxs)(`div`,{className:`flex flex-col`,children:[(0,k.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`ForgeQE's verdict`,L.release?` for ${L.release}`:``]}),(0,k.jsx)(`span`,{className:o(L.verdict===`NO EVIDENCE`?`text-body-md`:`text-headline-lg`,j[L.verdict].tone),children:j[L.verdict].word})]}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1 text-body-sm`,children:[(0,k.jsx)(`span`,{className:`text-ink-2`,children:j[L.verdict].text}),(0,k.jsxs)(`span`,{className:`text-muted`,children:[R.block,` blocker`,R.block===1?``:`s`,` · `,R.risk,` risk`,R.risk===1?``:`s`,` · `,R.unknown,` without evidence`,L.since?(0,k.jsxs)(`span`,{"data-tip":E(L.since),children:[` · measured since the pack was built, `,x(L.since)]}):null]})]}),!y&&(0,k.jsxs)(d,{size:`sm`,onClick:()=>(M(!0),F(null)),children:[(0,k.jsx)(h,{"aria-hidden":`true`}),`Sign off`]})]}),y&&(0,k.jsx)(N,{view:L,onDone:(e,n,r)=>{t(e),M(!1),F({file:n,markdown:r})}}),P&&(0,k.jsxs)(`p`,{role:`status`,className:`m-0 flex flex-wrap items-center gap-2 text-body-sm text-ink-2`,children:[`Signed off: saved as `,(0,k.jsx)(`code`,{className:`font-mono text-body-sm`,children:P.file}),(0,k.jsxs)(d,{size:`sm`,variant:`ghost`,"data-tip":`Download the record`,onClick:()=>{let e=URL.createObjectURL(new Blob([P.markdown],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=`signoff.md`,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},children:[(0,k.jsx)(_,{"aria-hidden":`true`}),`Download`]})]}),(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:L.criteria.map(e=>{let t=A[e.status];return(0,k.jsxs)(`li`,{className:`flex flex-wrap items-start gap-4 border-t border-line-soft py-4 text-body-sm`,children:[(0,k.jsx)(t.icon,{size:16,"aria-label":t.label,className:o(`mt-1 flex-none`,t.tone)}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1`,children:[(0,k.jsxs)(`span`,{className:`font-medium`,children:[e.label,` `,(0,k.jsxs)(`span`,{className:o(`font-normal`,t.tone),children:[`· `,t.label,`: `,e.value]})]}),e.detail.map((e,t)=>(0,k.jsx)(`span`,{className:`text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]}),e.link.length>0&&(0,k.jsxs)(`a`,{href:n(...e.link.map(encodeURIComponent)),className:`inline-flex items-center gap-1 self-center text-body-sm whitespace-nowrap`,children:[`Open`,(0,k.jsx)(v,{size:14,"aria-hidden":`true`})]})]},e.id)})}),L.signoffs.length>0&&(0,k.jsx)(w,{id:`signoffs`,icon:h,title:`Sign-offs`,children:(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0 text-body-sm`,children:L.signoffs.map(e=>(0,k.jsxs)(`li`,{className:`flex flex-wrap gap-x-2 border-t border-line-soft py-2`,children:[(0,k.jsx)(`span`,{className:`font-medium`,children:e.release}),(0,k.jsx)(`span`,{className:e.decision===`NO-GO`?`text-fail`:e.decision===`GO`?`text-pass`:`text-warn`,children:j[e.decision]?.word??e.decision}),(0,k.jsxs)(`span`,{className:`text-muted`,children:[`by `,e.by,`, `,e.at?E(e.at):e.id,` · ForgeQE said `,j[e.verdict]?.word??e.verdict]})]},e.id))})})]})]})]})}export{P as Readiness};
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{F as r,L as i,a}from"./preload-helper-BupTYkQW.js";import{t as o}from"./utils-DJRAScIl.js";import{t as s}from"./jsx-runtime-LKYXHABd.js";import{L as c}from"./palette-DOQemIAv.js";import{v as l}from"./api-B8AQ8-Gb.js";import{I as u,P as d,g as f,n as p}from"./pageBack-CINGjBHZ.js";import{Er as m,N as h,P as g,it as _,o as v,z as y}from"./line-icons-Cwj9OmCz.js";import{en as b,mt as x,s as S,t as C}from"./frame-wloj3-xC.js";import{J as w,V as T}from"./index-BCu9qAny.js";import{d as E}from"./qualityParts-diTrGtUR.js";var D=e(t(),1),O={view:(e,t)=>l(`GET`,`/api/readiness?${new URLSearchParams({...e?{pack:e}:{},...t?{report:t}:{}})}`),signOff:e=>l(`POST`,`/api/readiness/signoff`,{...e,confirmed:!0})},k=s(),A={pass:{label:`Pass`,icon:h,tone:`text-pass`},risk:{label:`Risk`,icon:m,tone:`text-warn`},block:{label:`Blocker`,icon:y,tone:`text-fail`},unknown:{label:`No evidence`,icon:g,tone:`text-muted`}},j={GO:{word:`Go`,tone:`text-pass`,bg:`bg-pass-soft`,text:`Every criterion with evidence passed.`},"GO WITH RISKS":{word:`Go with risks`,tone:`text-warn`,bg:`bg-warn-soft`,text:`Nothing blocks the release, but some criteria are risks or have no evidence yet.`},"NO-GO":{word:`No go`,tone:`text-fail`,bg:`bg-fail-soft`,text:`At least one criterion blocks the release.`},"NO EVIDENCE":{word:`No evidence yet`,tone:`text-muted`,bg:`bg-surface-muted`,text:`Nothing has been measured for this release yet: build and run a regression pack.`}},M={GO:`go`,"GO WITH RISKS":`go-with-risks`,"NO-GO":`no-go`,"NO EVIDENCE":`no-go`};function N({view:e,onDone:t}){let[n,s]=(0,D.useState)(``),[c,l]=(0,D.useState)(M[e.verdict]),[u,f]=(0,D.useState)(``),[p,m]=(0,D.useState)(!1),[g,_]=(0,D.useState)(``),v=async()=>{m(!0);try{let r=await O.signOff({by:n.trim(),decision:c,...u.trim()?{note:u.trim()}:{},...e.pack?{pack:e.pack}:{},...e.report?{report:e.report}:{}});t(r.view,r.file,r.markdown)}catch(e){_(e.message)}finally{m(!1)}};return(0,k.jsxs)(`form`,{"aria-label":`Sign off`,className:o(a,`flex flex-col gap-2 text-body-sm`),onSubmit:e=>{e.preventDefault(),n.trim()&&v()},children:[(0,k.jsxs)(`span`,{children:[`Sign off `,e.release||e.pack||`this release`,` as it is now. The record keeps your name, your decision, ForgeQE's verdict and every criterion with its evidence.`]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-1 font-medium`,children:[`Your name`,(0,k.jsx)(r,{size:`sm`,value:n,maxLength:80,onChange:e=>s(e.target.value)})]}),(0,k.jsxs)(`label`,{className:`flex flex-[0_1_200px] flex-col gap-1 font-medium`,children:[`Decision`,(0,k.jsxs)(i,{size:`sm`,value:c,onChange:e=>l(e.target.value),children:[(0,k.jsx)(`option`,{value:`go`,children:`Go`}),(0,k.jsx)(`option`,{value:`go-with-risks`,children:`Go with risks`}),(0,k.jsx)(`option`,{value:`no-go`,children:`No go`})]})]}),(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-1 font-medium`,children:[`Note (optional)`,(0,k.jsx)(r,{size:`sm`,value:u,maxLength:500,onChange:e=>f(e.target.value),placeholder:`Accepted the coupon risk: covered by a manual check`})]}),(0,k.jsxs)(d,{size:`sm`,variant:`primary`,type:`submit`,disabled:p||!n.trim(),children:[(0,k.jsx)(h,{"aria-hidden":`true`}),`Sign off`]})]}),g&&(0,k.jsx)(`p`,{role:`alert`,className:`m-0 text-fail`,children:g})]})}function P(){let[e,t]=(0,D.useState)(null),[r,a]=(0,D.useState)(``),[s,l]=(0,D.useState)(),[m,g]=(0,D.useState)(),[y,M]=(0,D.useState)(!1),[P,F]=(0,D.useState)(null),I=(0,D.useCallback)(()=>{O.view(s,m).then(e=>(t(e),a(``)),e=>a(e.message))},[s,m]);(0,D.useEffect)(I,[I]);let L=e,R=L?{block:L.criteria.filter(e=>e.status===`block`).length,risk:L.criteria.filter(e=>e.status===`risk`).length,unknown:L.criteria.filter(e=>e.status===`unknown`).length}:void 0;return(0,k.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,k.jsx)(S,{}),(0,k.jsxs)(`main`,{className:o(C,`@container flex-auto gap-4`),children:[(0,k.jsx)(p,{}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,k.jsx)(b,{pixel:c.readiness,size:`lg`,head:!0}),(0,k.jsx)(`h1`,{className:`m-0 text-headline-md`,children:`Release readiness`})]}),(0,k.jsx)(T,{more:(0,k.jsx)(k.Fragment,{children:`The verdict comes from what ForgeQE has measured: the regression pack's last run and the changes it does not cover, the latest readiness report of the test cases and bugs, flaky tests, Quality budgets and Security findings since the pack was built, the agents' Evidence verdicts and exploratory sessions. Any blocker makes it a no go. Each criterion opens the page with its evidence.`}),children:`Decide whether a release is ready to ship, and sign it off.`}),r&&(0,k.jsx)(`p`,{role:`alert`,className:o(u.fail,`m-0`),children:r}),!L&&!r&&(0,k.jsx)(f,{shape:`detail`}),L&&R&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1 text-body-sm font-medium`,children:[`Release (regression pack)`,(0,k.jsxs)(i,{size:`sm`,value:L.pack??``,onChange:e=>(l(e.target.value||void 0),F(null)),disabled:!L.packs.length,children:[!L.packs.length&&(0,k.jsx)(`option`,{value:``,children:`No packs yet`}),L.packs.map(e=>(0,k.jsx)(`option`,{value:e.name,children:e.release?`${e.release} · ${e.name}`:e.name},e.name))]})]}),(0,k.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_260px] flex-col gap-1 text-body-sm font-medium`,children:[`Test cases and bugs (readiness report)`,(0,k.jsxs)(i,{size:`sm`,value:L.report??``,onChange:e=>(g(e.target.value||void 0),F(null)),disabled:!L.reports.length,children:[!L.reports.length&&(0,k.jsx)(`option`,{value:``,children:`No reports yet`}),L.reports.map(e=>(0,k.jsxs)(`option`,{value:e.id,children:[e.scope,` · `,e.verdict,` · `,e.id]},e.id))]})]})]}),(0,k.jsxs)(`section`,{"aria-label":`Verdict`,className:o(`flex flex-wrap items-center gap-x-6 gap-y-2 rounded-md px-4 py-4`,j[L.verdict].bg),children:[(0,k.jsxs)(`div`,{className:`flex flex-col`,children:[(0,k.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`ForgeQE's verdict`,L.release?` for ${L.release}`:``]}),(0,k.jsx)(`span`,{className:o(L.verdict===`NO EVIDENCE`?`text-body-md`:`text-headline-lg`,j[L.verdict].tone),children:j[L.verdict].word})]}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1 text-body-sm`,children:[(0,k.jsx)(`span`,{className:`text-ink-2`,children:j[L.verdict].text}),(0,k.jsxs)(`span`,{className:`text-muted`,children:[R.block,` blocker`,R.block===1?``:`s`,` · `,R.risk,` risk`,R.risk===1?``:`s`,` · `,R.unknown,` without evidence`,L.since?(0,k.jsxs)(`span`,{"data-tip":E(L.since),children:[` · measured since the pack was built, `,x(L.since)]}):null]})]}),!y&&(0,k.jsxs)(d,{size:`sm`,onClick:()=>(M(!0),F(null)),children:[(0,k.jsx)(h,{"aria-hidden":`true`}),`Sign off`]})]}),y&&(0,k.jsx)(N,{view:L,onDone:(e,n,r)=>{t(e),M(!1),F({file:n,markdown:r})}}),P&&(0,k.jsxs)(`p`,{role:`status`,className:`m-0 flex flex-wrap items-center gap-2 text-body-sm text-ink-2`,children:[`Signed off: saved as `,(0,k.jsx)(`code`,{className:`font-mono text-body-sm`,children:P.file}),(0,k.jsxs)(d,{size:`sm`,variant:`ghost`,"data-tip":`Download the record`,onClick:()=>{let e=URL.createObjectURL(new Blob([P.markdown],{type:`text/markdown;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=`signoff.md`,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},children:[(0,k.jsx)(_,{"aria-hidden":`true`}),`Download`]})]}),(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:L.criteria.map(e=>{let t=A[e.status];return(0,k.jsxs)(`li`,{className:`flex flex-wrap items-start gap-4 border-t border-line-soft py-4 text-body-sm`,children:[(0,k.jsx)(t.icon,{size:16,"aria-label":t.label,className:o(`mt-1 flex-none`,t.tone)}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1`,children:[(0,k.jsxs)(`span`,{className:`font-medium`,children:[e.label,` `,(0,k.jsxs)(`span`,{className:o(`font-normal`,t.tone),children:[`· `,t.label,`: `,e.value]})]}),e.detail.map((e,t)=>(0,k.jsx)(`span`,{className:`text-ink-2 [overflow-wrap:anywhere]`,children:e},t))]}),e.link.length>0&&(0,k.jsxs)(`a`,{href:n(...e.link.map(encodeURIComponent)),className:`inline-flex items-center gap-1 self-center text-body-sm whitespace-nowrap`,children:[`Open`,(0,k.jsx)(v,{size:14,"aria-hidden":`true`})]})]},e.id)})}),L.signoffs.length>0&&(0,k.jsx)(w,{id:`signoffs`,icon:h,title:`Sign-offs`,children:(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0 text-body-sm`,children:L.signoffs.map(e=>(0,k.jsxs)(`li`,{className:`flex flex-wrap gap-x-2 border-t border-line-soft py-2`,children:[(0,k.jsx)(`span`,{className:`font-medium`,children:e.release}),(0,k.jsx)(`span`,{className:e.decision===`NO-GO`?`text-fail`:e.decision===`GO`?`text-pass`:`text-warn`,children:j[e.decision]?.word??e.decision}),(0,k.jsxs)(`span`,{className:`text-muted`,children:[`by `,e.by,`, `,e.at?E(e.at):e.id,` · ForgeQE said `,j[e.verdict]?.word??e.verdict]})]},e.id))})})]})]})]})}export{P as Readiness};