@wcag-checkr/ci 1.0.0-rc.285 → 1.0.0-rc.286
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.
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./modulepreload-polyfill-B5Qt9EMX.js";import{j as e,r as c,c as ee,R as te}from"./styles-DToZ04ht.js";import{u as h,c as re,l as M,s as ae,w as ne,r as ie,a as se,b as le,p as oe,d as de,E as ce,A as ue}from"./ErrorBoundary-Cry28iIf.js";import{l as ve,a as pe,b as ge,c as he,g as K,s as me,d as q,e as J,f as fe,h as xe,i as ye,j as be,k as ke}from"./scheduled-audit-runner-GIytYifI.js";import{s as N,i as je}from"./crash-reporter-Dc5lvxvY.js";import{B as P}from"./ai-usage-log-C-jq4cW3.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./diff-DA41zYPc.js";import"./design-system-audit-DpxJrxnb.js";function O({initialUrl:t,isRunning:r,onCrawl:a,onVerifyFixes:n,onAuditThisPage:o}){const[l,i]=c.useState(t),[s,d]=c.useState(25),[m,k]=c.useState(""),[j,p]=c.useState(""),[x,v]=c.useState(!1),[y,g]=c.useState(P),[w,b]=c.useState(P[0].id),[S,u]=c.useState(null);c.useEffect(()=>{t&&!l&&i(t)},[t]),c.useEffect(()=>{let f=!1;return Promise.all([N({type:"SETTINGS_GET",key:"matrixPresets"}),N({type:"SETTINGS_GET",key:"activePresetId"})]).then(([C,I])=>{if(f)return;const B=Array.isArray(C.data)?C.data:null;g(B&&B.length>0?B:P),typeof I.data=="string"&&b(I.data)}),()=>{f=!0}},[]);function R(f){const C=y.find(I=>I.id===f);C&&(b(f),N({type:"SETTINGS_SET",key:"activePresetId",value:f}),N({type:"SETTINGS_SET",key:"stateMatrix",value:C.matrix}))}function E(){u(null);for(const[f,C]of[["Include",m.trim()],["Exclude",j.trim()]])if(C)try{new RegExp(C)}catch(I){return u(`${f} regex invalid: ${I instanceof Error?I.message:String(I)}`),!1}return!0}function A(f){if(!E())return;const C={startUrl:l.trim(),maxPages:s,includeRegex:m.trim(),excludeRegex:j.trim()};f&&n?n(C):a(C)}return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)",textAlign:"left"},children:[e.jsx(U,{label:"Start URL",children:e.jsx("input",{type:"url",value:l,onChange:f=>i(f.target.value),placeholder:"https://yoursite.com",disabled:r,className:"v2-mono",style:F})}),e.jsx(U,{label:"Max pages",hint:"1–200. Each page runs the full pipeline you configured.",children:e.jsx("input",{type:"number",min:1,max:200,value:s,onChange:f=>d(Math.min(200,Math.max(1,parseInt(f.target.value,10)||25))),disabled:r,className:"v2-mono",style:{...F,maxWidth:100}})}),e.jsx(U,{label:"Audit depth",hint:"State matrix preset applied to every crawled page.",children:e.jsx("select",{value:w,onChange:f=>R(f.target.value),disabled:r,style:F,children:y.map(f=>e.jsx("option",{value:f.id,children:f.name},f.id))})}),e.jsx("button",{type:"button",onClick:()=>v(f=>!f),className:"v2-eyebrow",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--v2-ink-secondary)",textAlign:"left",alignSelf:"flex-start"},children:x?"− hide advanced filters":"+ show URL filters (include / exclude)"}),x&&e.jsxs(e.Fragment,{children:[e.jsx(U,{label:"Include only URLs matching",hint:"Optional regex. Empty = no filter.",children:e.jsx("input",{type:"text",value:m,onChange:f=>k(f.target.value),placeholder:"^https://example\\.com/products/",disabled:r,className:"v2-mono",style:F})}),e.jsx(U,{label:"Exclude URLs matching",hint:"Optional regex. Useful for /admin or /login while logged in.",children:e.jsx("input",{type:"text",value:j,onChange:f=>p(f.target.value),placeholder:"/admin|/dashboard|/login",disabled:r,className:"v2-mono",style:F})})]}),S&&e.jsx("p",{role:"alert",style:{color:"var(--v2-critical)",fontSize:12,margin:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",border:"1px solid var(--v2-critical)",borderRadius:4,background:"rgba(207, 44, 44, 0.06)"},children:S}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",disabled:r||!l.trim(),onClick:()=>A(!1),children:r?"Crawling…":"Crawl whole site"}),n&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:r||!l.trim(),onClick:()=>A(!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),o&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:r,onClick:o,title:"Single-page audit on the active tab (no crawl)",children:"Just this page"})]})]})}function we(){const t=h(o=>o.siteCrawlProgress),r=h(o=>o.siteCrawlStatus);function a(){N({type:"CANCEL_SITE_CRAWL"})}if(r!=="running")return null;const n=t?Math.min(100,Math.max(0,t.current/Math.max(1,t.total)*100)):0;return e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:"crawling…"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:12,fontWeight:600,color:"var(--v2-ink-primary)",fontVariantNumeric:"tabular-nums"},children:t?`${t.current} / ${t.total}`:"…"})]}),e.jsx("div",{role:"progressbar","aria-valuenow":(t==null?void 0:t.current)??0,"aria-valuemin":0,"aria-valuemax":(t==null?void 0:t.total)??1,"aria-label":"Crawl progress",style:{height:8,background:"var(--v2-bg-elev-2)",borderRadius:4,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${n}%`,background:"var(--v2-action)",transition:"width 240ms ease"}})}),(t==null?void 0:t.url)&&e.jsxs("div",{children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:4},children:"current page"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:t.url})]}),(t==null?void 0:t.lastViolations)!==void 0&&t.lastViolations>0&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:["last page: ",t.lastViolations," axe violation",t.lastViolations===1?"":"s"]}),e.jsx("div",{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:a,children:"Cancel crawl"})})]})}function Se(){const t=h(d=>d.status),r=h(d=>d.progress),a=h(d=>d.aiProgress);if(t!=="running")return null;const n=r?r.current>=r.total:!1,o=r?n?"Running deep analyzers…":`Auditing… ${r.current} / ${r.total}`:"Starting audit…",l=r?n?"reading order · tab order · typography · CSS vars · AI candidates":Ce(r.currentState):"Loading axe + DOM analyzers",i=r?n?100:r.current/Math.max(1,r.total)*100:0;function s(){N({type:"CANCEL_AUDIT"})}return e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-4)"},children:[e.jsx(V,{label:o,detail:l,pct:i,valuenow:r?Math.min(r.current,r.total):0,valuemax:r?r.total:1,ariaLabel:r?n?"Running deep analyzers: reading order, tab order, typography, custom properties, AI candidates.":`Audit progress: ${r.current} of ${r.total} states`:"Audit starting",fillColor:"var(--v2-action)"}),a&&e.jsx(V,{label:`AI augmentation… ${a.current} / ${a.total}`,detail:a.candidatesTotal&&a.candidatesTotal>0?`${a.currentCheckLabel} (${a.candidatesDone??0}/${a.candidatesTotal})`:a.currentCheckLabel,pct:a.current/Math.max(1,a.total)*100,valuenow:a.current,valuemax:a.total,ariaLabel:`AI augmentation: ${a.current} of ${a.total} checks. ${a.currentCheckLabel}`,fillColor:"var(--v2-needs-review)"}),e.jsx("div",{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:s,children:"Cancel audit"})})]})}function V({label:t,detail:r,pct:a,valuenow:n,valuemax:o,ariaLabel:l,fillColor:i}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:[e.jsx("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:e.jsx("span",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:t})}),e.jsx("div",{role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":o,"aria-label":l,style:{height:6,background:"var(--v2-bg-elev-2)",borderRadius:3,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${a}%`,background:i,transition:"width 240ms ease"}})}),r&&e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:r})]})}function Ce(t){if(!t)return"";const r=[t.pseudoState];return t.theme&&t.theme!=="light"&&r.push(t.theme),t.direction&&t.direction!=="ltr"&&r.push(t.direction),r.join(" · ")}function U({label:t,hint:r,children:a}){return e.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{className:"v2-eyebrow",style:{color:"var(--v2-ink-secondary)"},children:t}),a,r&&e.jsx("span",{style:{fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.4},children:r})]})}const F={fontFamily:"var(--v2-body)",fontSize:12,padding:"8px 10px",background:"var(--v2-bg)",color:"var(--v2-ink-primary)",border:"1px solid var(--v2-border-strong)",borderRadius:4,outline:"none"};function Y(){const t=h(d=>d.siteCrawlReport),r=h(d=>d.results),a=h(d=>d.delta),n=h(d=>d.componentId),o=h(d=>d.status),l=h(d=>d.siteCrawlStatus),[i,s]=c.useState({report:null,resolvedFails:[]});return c.useEffect(()=>{var j;let d=!1;async function m(p){return p.length===0?[]:(await Promise.all(p.map(v=>K(v)))).flat().filter(v=>v.verdict==="fail")}if(l==="running"||o==="running"){s({report:null,resolvedFails:[]});return}if(t)return(async()=>{const p=t.pages.map(v=>v.url),x=await m(p);d||s({report:t,resolvedFails:x})})(),()=>{d=!0};if(r.length===0||!n){s({report:null,resolvedFails:[]});return}const k=(j=r[0])==null?void 0:j.pageUrl;if(!k){s({report:null,resolvedFails:[]});return}return(async()=>{try{const[p,x,v,y]=await Promise.all([ve([n]),pe([n]),ge(n),m([k])]),g=new Map([[n,p]]),w=new Map([[n,x]]),b=new Map([[n,v]]),S=new Date().toISOString(),u=he(k,[{url:k,results:r,delta:a,componentId:n,durationMs:0}],S,S,0,g,w,b);d||s({report:u,resolvedFails:y})}catch(p){console.warn("[v2] synthesize single-page report failed",p),d||s({report:null,resolvedFails:[]})}})(),()=>{d=!0}},[t,r,a,n,o,l]),i}function Re(){const{report:t,resolvedFails:r}=Y(),a=h(u=>u.siteCrawlReport),n=h(u=>u.siteCrawlStatus),o=h(u=>u.siteCrawlError),l=h(u=>u.status),i=n==="running",d=i||l==="running"&&!i,m=!!t&&!a,[k,j]=c.useState(null);c.useEffect(()=>{let u=!1;return chrome.tabs.query({active:!0,currentWindow:!0}).then(R=>{var E;u||j(((E=R[0])==null?void 0:E.url)??null)}),()=>{u=!0}},[]);const[p,x]=c.useState(!1);function v(u,R=!1){u.startUrl&&(h.getState().setSiteCrawlStatus("running"),h.getState().setSiteCrawlReport(null),h.getState().setSiteCrawlError(null),M({type:"START_SITE_CRAWL",startUrl:u.startUrl,maxPages:u.maxPages,...u.includeRegex?{includeRegex:u.includeRegex}:{},...u.excludeRegex?{excludeRegex:u.excludeRegex}:{},...R?{verifyFixesOnly:!0}:{}}))}function y(){M({type:"START_AUDIT",mode:"full-page"}),h.getState().startNewScan()}if(d)return e.jsx("section",{"aria-label":"Audit in progress",style:{padding:"var(--v2-pad-5) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:i?e.jsx(we,{}):e.jsx(Se,{})});if(!t)return e.jsxs("section",{"aria-label":"No audit yet",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",maxWidth:640,margin:"0 auto"},children:[e.jsx("p",{className:"v2-eyebrow",style:{marginBottom:"var(--v2-pad-2)"},children:"new audit"}),e.jsx("h1",{className:"v2-display",style:{fontSize:28,fontWeight:500,letterSpacing:"-0.02em",color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:"Configure your crawl."}),o&&e.jsxs("div",{role:"alert",style:{marginBottom:"var(--v2-pad-4)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-critical)",borderRadius:4,background:"rgba(207, 44, 44, 0.06)",color:"var(--v2-critical)",fontSize:12,lineHeight:1.5},children:[e.jsx("strong",{style:{fontWeight:600,marginRight:6},children:"Last crawl failed:"}),o]}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,marginBottom:"var(--v2-pad-5)",maxWidth:520},children:"The crawler follows internal links from the start URL, same-origin only. Each page runs your full audit pipeline (axe + DOM analyzers + AI walkthroughs). Findings appear below as a single unified list."}),e.jsx(O,{initialUrl:k??"",isRunning:d,onCrawl:u=>v(u,!1),onAuditThisPage:y})]});const g=r.length,w=(t.totalWalkthroughFindings??0)+t.totalUniqueViolations+g,b=(t.walkthroughAcknowledgements??[]).length,S=t.totalNeedsReview;return e.jsxs("section",{"aria-label":"Audit summary",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"var(--v2-pad-6)"},children:[e.jsx(Ne,{grade:t.siteGrade}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0},children:m?"page grade · single-page audit":`site grade · ${t.pagesAudited} page${t.pagesAudited===1?"":"s"}`}),e.jsx("h1",{className:"v2-display",style:{fontSize:22,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0,lineHeight:1.25},children:w===0&&S===0?"All clear — nothing open.":`${w+S} finding${w+S===1?"":"s"} to address.`}),e.jsx(Ae,{openCount:w,reviewCount:S,verifiedCount:b,axeCount:t.totalUniqueViolations,walkthroughCount:t.totalWalkthroughFindings??0,autoCount:g}),k&&!Ie(k,t.startUrl)&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:["Active tab: ",k]}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",marginTop:"var(--v2-pad-2)",flexWrap:"wrap"},children:[m?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",onClick:y,title:"Re-audit the current page",children:"Re-audit this page"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>x(u=>!u),"aria-expanded":p,title:"Open crawl setup to audit the whole site instead",children:p?"Hide crawl options":"Crawl whole site"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",onClick:()=>v({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!1),title:`Re-crawl ${t.startUrl} (same options)`,children:"Re-crawl"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:y,title:"Single-page audit of the active tab (no crawl)",children:"Just this page"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>v({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>x(u=>!u),"aria-expanded":p,children:p?"Hide options":"Adjust options"})]}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>{re(),h.getState().setSiteCrawlReport(null),h.getState().setSiteCrawlError(null),me(null).catch(()=>{})},title:"Wipe these results so you can start fresh",style:{marginLeft:"auto"},children:"Clear results"})]})]})]}),p&&e.jsx("div",{style:{marginTop:"var(--v2-pad-5)",paddingTop:"var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)",maxWidth:640},children:e.jsx(O,{initialUrl:t.startUrl,isRunning:d,onCrawl:u=>v(u,!1),onVerifyFixes:u=>v(u,!0),onAuditThisPage:y})})]})}function Ie(t,r){try{return new URL(t).origin===new URL(r).origin}catch{return!1}}function Ne({grade:t}){const r={A:"var(--v2-grade-a)",B:"var(--v2-grade-b)",C:"var(--v2-grade-c)",D:"var(--v2-grade-d)",F:"var(--v2-grade-f)"};return e.jsx("div",{"aria-label":`Grade ${t}`,role:"img",style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:140},children:e.jsx("span",{className:"v2-display",style:{fontSize:132,lineHeight:1,fontWeight:500,color:r[t],letterSpacing:"-0.04em",fontVariationSettings:'"opsz" 144'},children:t})})}function Ae({openCount:t,reviewCount:r,verifiedCount:a,axeCount:n,walkthroughCount:o,autoCount:l}){return e.jsxs("dl",{style:{display:"flex",gap:"var(--v2-pad-4)",flexWrap:"wrap",margin:0,color:"var(--v2-ink-secondary)",fontSize:12},children:[e.jsx(T,{term:"open",value:t,tone:t>0?"attention":"neutral"}),e.jsx(T,{term:"review",value:r,tone:r>0?"review":"neutral"}),e.jsx(T,{term:"verified",value:a,tone:a>0?"positive":"neutral"}),e.jsx("span",{style:{color:"var(--v2-ink-faint)"},children:"·"}),e.jsx(T,{term:"axe",value:n,tone:"neutral"}),e.jsx(T,{term:"walkthrough",value:o,tone:"neutral"}),l>0&&e.jsx(T,{term:"auto-contrast",value:l,tone:"neutral"})]})}function T({term:t,value:r,tone:a}){const n={attention:"var(--v2-critical)",review:"var(--v2-needs-review)",positive:"var(--v2-verified)",neutral:"var(--v2-ink-secondary)"};return e.jsxs("div",{style:{display:"inline-flex",alignItems:"baseline",gap:6},children:[e.jsx("dt",{className:"v2-eyebrow",style:{display:"inline",margin:0,color:"var(--v2-ink-tertiary)"},children:t}),e.jsx("dd",{className:"v2-mono",style:{margin:0,fontWeight:600,fontSize:13,color:n[a],fontVariantNumeric:"tabular-nums"},children:r})]})}const Te=new Set(["2.4.3","2.1.2","2.4.7","1.3.2","1.4.11","2.5.3"]);function _(t){return Te.has(t)}async function G(t){var n,o;const r=h.getState();if(r.componentId&&((n=r.results[0])==null?void 0:n.pageUrl)===t)return r.componentId;const a=await q();return((o=a==null?void 0:a.find(l=>l.url===t))==null?void 0:o.componentId)??null}async function Ee(t,r){var l;const a=h.getState(),n=[];if(a.componentId&&a.results.length>0){const i=(l=a.results[0])==null?void 0:l.pageUrl,s=r.find(d=>d.url===i);if(s){for(const d of a.results)for(const m of d.violations)m.ruleId===t&&m.target.selector===s.selector&&n.push({componentId:a.componentId,matchKey:m.matchKey});if(n.length>0)return n}}const o=await q()??[];for(const i of r){const s=o.find(d=>d.url===i.url);if(s)for(const d of s.results)for(const m of d.violations)m.ruleId===t&&m.target.selector===i.selector&&n.push({componentId:s.componentId,matchKey:m.matchKey})}return n}function Ue({row:t}){return e.jsxs("details",{style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,overflow:"hidden"},children:[e.jsxs("summary",{style:{cursor:"pointer",padding:"var(--v2-pad-3) var(--v2-pad-4)",listStyle:"none",display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-3)"},children:[e.jsx(Fe,{row:t}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx($e,{row:t}),e.jsx(ze,{row:t})]}),e.jsx(We,{})]}),e.jsx("div",{style:{padding:"0 var(--v2-pad-4) var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)"},children:e.jsx(Be,{row:t})})]})}function Fe({row:t}){if(t.kind==="walkthrough-ack")return e.jsx("span",{className:"v2-chip v2-chip-verified","aria-label":"Status: human verified",children:"verified"});if(t.kind==="needs-review")return e.jsx("span",{className:"v2-chip v2-chip-review","aria-label":"Status: needs human review",children:"review"});if(t.kind==="auto-contrast")return e.jsx("span",{className:"v2-chip v2-chip-serious","aria-label":"Severity: serious, auto-resolved by pixel sampler",title:"Empirical pixel-contrast measurement, not an axe-confirmed violation. Human verification recommended.",children:"auto · serious"});if(t.kind==="walkthrough-fail")return e.jsx("span",{className:t.verdict==="fail"?"v2-chip v2-chip-serious":"v2-chip v2-chip-moderate","aria-label":`Severity: ${t.verdict}`,children:t.verdict});const r={critical:"v2-chip-critical",serious:"v2-chip-serious",moderate:"v2-chip-moderate",minor:"v2-chip-minor"};return e.jsx("span",{className:`v2-chip ${r[t.impact]}`,"aria-label":`Severity: ${t.impact}`,children:t.impact})}function $e({row:t}){const r=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"||t.kind==="needs-review"||t.kind==="axe"||t.kind==="auto-contrast"?t.criterion:null,a=t.kind==="walkthrough-fail"?`AI walkthrough ${t.verdict} on this criterion.`:t.kind==="walkthrough-ack"?"Human-verified by an auditor.":t.kind==="needs-review"?t.description:t.kind==="auto-contrast"?"Empirical contrast measurement fell below threshold.":t.description;return e.jsxs("p",{style:{margin:0,marginBottom:4,color:"var(--v2-ink-primary)",fontSize:13,fontWeight:500,lineHeight:1.4},children:[r&&e.jsxs("span",{className:"v2-mono",style:{fontSize:11,fontWeight:600,color:"var(--v2-ink-tertiary)",marginRight:8},children:["WCAG ",r]}),a]})}function ze({row:t}){const r=t.kind==="axe"||t.kind==="needs-review"?t.pages.length:1,a=t.kind==="axe"||t.kind==="needs-review"||t.kind==="auto-contrast"?t.selector:null,n=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"||t.kind==="auto-contrast"?t.pageUrl:null;return e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",flexWrap:"wrap"},children:[a&&e.jsx("code",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",background:"var(--v2-bg-elev-2)",padding:"2px 6px",borderRadius:2,wordBreak:"break-all"},children:a}),n&&e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:n}),r>1&&e.jsxs("span",{className:"v2-eyebrow",style:{marginLeft:"auto"},children:["on ",r," pages"]})]})}function We(){return e.jsx("span",{"aria-hidden":"true",style:{color:"var(--v2-ink-tertiary)",fontFamily:"var(--v2-mono)",fontSize:12,marginLeft:8,marginTop:2},children:"⏵"})}function Be({row:t}){return t.kind==="walkthrough-fail"?e.jsx(De,{row:t}):t.kind==="walkthrough-ack"?e.jsx(Le,{row:t}):t.kind==="needs-review"?e.jsx(He,{row:t}):t.kind==="auto-contrast"?e.jsx(Pe,{row:t}):e.jsx(Me,{row:t})}function Pe({row:t}){const[r,a]=c.useState(!1),[n,o]=c.useState(!1),[l,i]=c.useState(""),[s,d]=c.useState(!1),[m,k]=c.useState(!1),[j,p]=c.useState(null),x=J(t.ruleId);async function v(){if(d(!0),p(null),!l.trim()){p("Note is required — explain why the empirical contrast measurement is wrong, or why this element is acceptable in context."),d(!1);return}try{const g=(await K(t.pageUrl)).find(b=>b.ruleId===t.ruleId&&b.selector===t.selector),w={pageUrl:t.pageUrl,ruleId:t.ruleId,selector:t.selector,verdict:"pass",reasoning:`Human override: ${l.trim()}
|
|
2
|
+
|
|
3
|
+
(Original empirical reasoning: ${t.reasoning})`,resolvedAt:new Date().toISOString(),costUsd:0,wcagCriterion:t.criterion,inputHash:g==null?void 0:g.inputHash};await xe(w),k(!0),a(!1)}catch(y){p(y instanceof Error?y.message:String(y))}finally{d(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx($,{label:"Empirical measurement",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:t.reasoning})}),e.jsx("p",{style:{margin:0,marginBottom:"var(--v2-pad-3)",fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.5,fontStyle:"italic"},children:"This finding came from a pixel-level screenshot diff of text against the rendered background, not from axe-core. Treat as a strong hint for human review, not a confirmed violation — gradients, translucent overlays, and animated backdrops can fool the sampler."}),m?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsxs(H,{children:[x&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>o(y=>!y),"aria-expanded":n,children:n?"Hide fix recipe":"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>a(y=>!y),"aria-expanded":r,children:r?"Cancel":"Mark verified manually"})]}),n&&x&&e.jsx(X,{summary:x.summary,snippet:x.snippet}),r&&e.jsx(D,{note:l,setNote:i,busy:s,err:j,onConfirm:v,hint:"Why the empirical measurement is wrong, or why this is acceptable. Overrides the resolution to pass.",placeholder:"e.g., Text sits over a video poster image; static screenshot misreads the rendered background. Production poster passes 7:1."}),j&&!r&&e.jsx(W,{message:j})]})]})}function De({row:t}){const[r,a]=c.useState(!1),[n,o]=c.useState(""),[l,i]=c.useState(!1),[s,d]=c.useState(!1),[m,k]=c.useState(!1),[j,p]=c.useState(null),[x,v]=c.useState(null),y=_(t.criterion);async function g(){if(i(!0),v(null),!n.trim()){v("Note is required — explain how you manually verified this."),i(!1);return}try{const b=await G(t.pageUrl);if(!b){v("Could not find this page in the audit data. Re-run the audit and try again.");return}await fe({componentId:b,criterionId:t.criterion,pageUrl:t.pageUrl,note:n.trim(),acknowledgedAt:new Date().toISOString(),verdictAtAck:t.verdict}),d(!0),a(!1)}catch(b){v(b instanceof Error?b.message:String(b))}finally{i(!1)}}async function w(){var b;k(!0),p(null),v(null);try{const u=(b=(await chrome.tabs.query({active:!0,currentWindow:!0}))[0])==null?void 0:b.id;if(!u){v("Open the audited page in your active tab to re-run.");return}const R=await G(t.pageUrl);if(!R){v("Could not find this page in the audit data.");return}if(!_(t.criterion)){v(`Re-run is only available for interactive criteria. ${t.criterion} is not supported.`);return}const A=await N({type:"INTERACTIVE_AUDIT_REQUEST",criterionId:t.criterion,tabId:u,componentId:R,pageUrl:t.pageUrl});if(!A.ok){v(A.error??"Re-run failed.");return}p(`Re-run verdict: ${A.verdict??"unknown"}. Re-audit the page to refresh this list.`)}catch(S){v(S instanceof Error?S.message:String(S))}finally{k(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx($,{label:"AI reasoning",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),s?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsxs(H,{children:[y&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:w,disabled:m,children:m?"Re-running…":"Re-run walkthrough"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>a(b=>!b),"aria-expanded":r,children:r?"Cancel":"Mark verified manually"})]}),j&&e.jsx("p",{role:"status",style:{marginTop:"var(--v2-pad-2)",padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"rgba(15, 143, 94, 0.08)",border:"1px solid var(--v2-verified)",borderRadius:4,color:"var(--v2-verified)",fontSize:11,lineHeight:1.5},children:j}),r&&e.jsx(D,{note:n,setNote:o,busy:l,err:x,onConfirm:g,hint:"Explain what you checked. This goes into the forensic record.",placeholder:"e.g., Verified — focus indicator visible on every interactive control under :focus-visible; tested with keyboard nav."}),x&&!r&&e.jsx(W,{message:x})]})]})}function Le({row:t}){return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx($,{label:"What the human verified",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),e.jsxs("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginTop:"var(--v2-pad-2)"},children:["Original AI verdict: ",e.jsx("strong",{children:t.verdict}),". Now treated as pass for conformance."]})]})}function He({row:t}){return e.jsx(Q,{row:t,kind:"needs-review"})}function Me({row:t}){return e.jsx(Q,{row:t,kind:"axe"})}function Q({row:t,kind:r}){const[a,n]=c.useState(!1),[o,l]=c.useState(""),[i,s]=c.useState(!1),[d,m]=c.useState(!1),[k,j]=c.useState(!1),[p,x]=c.useState(null),v=J(t.ruleId);async function y(){if(s(!0),x(null),!o.trim()){x(r==="needs-review"?"Note is required — explain your review judgment.":"Note is required — explain why this isn't actually an issue in your context."),s(!1);return}try{const g=await Ee(t.ruleId,t.pages);if(g.length===0){x("Could not find this finding in the persisted audit data. Re-run the audit and try again.");return}for(const w of g)await ye({componentId:w.componentId,matchKey:w.matchKey,ruleId:t.ruleId,note:o.trim()});m(!0),n(!1)}catch(g){x(g instanceof Error?g.message:String(g))}finally{s(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[r==="needs-review"&&t.failureSummary&&e.jsx($,{label:"AI assessment",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:t.failureSummary})}),e.jsx($,{label:"Affected",children:e.jsxs("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:4},children:[t.pages.slice(0,8).map(g=>e.jsx("li",{children:e.jsx("a",{href:g.url,target:"_blank",rel:"noopener noreferrer",className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",textDecoration:"underline",textDecorationColor:"var(--v2-ink-faint)",textUnderlineOffset:2},children:g.url})},g.url)),t.pages.length>8&&e.jsxs("li",{className:"v2-eyebrow",children:["+ ",t.pages.length-8," more"]})]})}),d?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsxs(H,{children:[r==="axe"&&v&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>j(g=>!g),"aria-expanded":k,children:k?"Hide fix recipe":"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>n(g=>!g),"aria-expanded":a,children:a?"Cancel":"Mark verified manually"})]}),k&&v&&e.jsx(X,{summary:v.summary,snippet:v.snippet}),a&&e.jsx(D,{note:o,setNote:l,busy:i,err:p,onConfirm:y,hint:r==="needs-review"?"Your review judgment. Goes into the forensic record.":"Why this isn't actually an issue in your context. Goes into the forensic record.",placeholder:r==="needs-review"?"e.g., Verified — image is a portrait of the named founder; alt text correctly identifies subject and role.":'e.g., This element is decorative; aria-hidden + role="presentation" applied via design system.',confirmLabel:`Confirm — acknowledge on ${t.pages.length} page${t.pages.length===1?"":"s"}`}),p&&!a&&e.jsx(W,{message:p})]})]})}function D({note:t,setNote:r,busy:a,err:n,onConfirm:o,hint:l,placeholder:i,confirmLabel:s="Confirm acknowledgement"}){return e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-border-strong)",borderRadius:4,background:"var(--v2-bg)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:"verification note · required"}),e.jsx("p",{style:{margin:0,marginBottom:"var(--v2-pad-2)",fontSize:11,color:"var(--v2-ink-tertiary)"},children:l}),e.jsx("textarea",{value:t,onChange:d=>r(d.target.value),placeholder:i,rows:3,style:{width:"100%",fontFamily:"var(--v2-body)",fontSize:12,lineHeight:1.5,padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"var(--v2-bg)",color:"var(--v2-ink-primary)",border:"1px solid var(--v2-border-strong)",borderRadius:4,resize:"vertical",minHeight:70},autoFocus:!0}),n&&e.jsx(W,{message:n}),e.jsx("div",{style:{marginTop:"var(--v2-pad-2)"},children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:o,disabled:a||!t.trim(),children:a?"Saving…":s})})]})}function X({summary:t,snippet:r}){return e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-verified)",borderRadius:4,background:"rgba(15, 143, 94, 0.06)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6,color:"var(--v2-verified)"},children:"how to fix"}),e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t}),r&&e.jsx("pre",{className:"v2-mono",style:{marginTop:"var(--v2-pad-2)",marginBottom:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"var(--v2-bg)",border:"1px solid var(--v2-border)",borderRadius:3,fontSize:11,color:"var(--v2-ink-primary)",overflowX:"auto",whiteSpace:"pre"},children:e.jsx("code",{children:r})})]})}function L(){return e.jsxs("div",{role:"status",style:{marginTop:"var(--v2-pad-2)",padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"rgba(15, 143, 94, 0.08)",border:"1px solid var(--v2-verified)",borderRadius:4,color:"var(--v2-verified)",fontSize:12,lineHeight:1.5},children:[e.jsx("strong",{style:{fontWeight:600},children:"✓ Acknowledged."})," ","The ack is saved. Re-audit or re-crawl to see this finding drop out of the list."]})}function W({message:t}){return e.jsx("p",{role:"alert",style:{marginTop:"var(--v2-pad-2)",marginBottom:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",border:"1px solid var(--v2-critical)",background:"rgba(207, 44, 44, 0.06)",borderRadius:4,color:"var(--v2-critical)",fontSize:11,lineHeight:1.4},children:t})}function $({label:t,children:r}){return e.jsxs("div",{style:{marginBottom:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:t}),r]})}function H({children:t}){return e.jsx("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:t})}function Oe(){const{report:t,resolvedFails:r}=Y(),[a,n]=c.useState("open"),o=c.useMemo(()=>t?Ge(t.pages,t.findingGroups??[],r):[],[t,r]),l=c.useMemo(()=>a==="all"?o:o.filter(s=>a==="verified"?s.kind==="walkthrough-ack":a==="review"?s.kind==="needs-review":a==="open"?s.kind==="axe"||s.kind==="walkthrough-fail"||s.kind==="auto-contrast":!0),[o,a]);if(!t)return null;const i={all:o.length,open:o.filter(s=>s.kind==="axe"||s.kind==="walkthrough-fail"||s.kind==="auto-contrast").length,review:o.filter(s=>s.kind==="needs-review").length,verified:o.filter(s=>s.kind==="walkthrough-ack").length};return e.jsxs("section",{"aria-labelledby":"findings-heading",style:{padding:"var(--v2-pad-5) var(--v2-pad-5) var(--v2-pad-7)"},children:[e.jsxs("header",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)",marginBottom:"var(--v2-pad-4)",flexWrap:"wrap"},children:[e.jsx("h2",{id:"findings-heading",className:"v2-display",style:{fontSize:20,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0},children:"Findings"}),e.jsx(Ve,{filter:a,setFilter:n,counts:i})]}),l.length===0?e.jsx(_e,{filter:a}):e.jsx("ul",{"aria-label":`${a} findings, ${l.length} items`,style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:l.map((s,d)=>e.jsx("li",{style:{animation:`v2-row-in 240ms ease ${Math.min(d,12)*30}ms both`},children:e.jsx(Ue,{row:s})},s.key))})]})}function Ve({filter:t,setFilter:r,counts:a}){const n=[{id:"open",label:"Open"},{id:"review",label:"Review"},{id:"verified",label:"Verified"},{id:"all",label:"All"}];return e.jsx("div",{role:"tablist","aria-label":"Filter findings",style:{display:"inline-flex",gap:4,background:"var(--v2-bg-elev)",padding:3,borderRadius:6,border:"1px solid var(--v2-border)"},children:n.map(o=>{const l=t===o.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":l,onClick:()=>r(o.id),style:{fontFamily:"var(--v2-body)",fontSize:11,padding:"5px 10px",borderRadius:4,border:"none",cursor:"pointer",background:l?"var(--v2-bg-elev-2)":"transparent",color:l?"var(--v2-ink-primary)":"var(--v2-ink-secondary)",fontWeight:l?600:500,transition:"background 120ms ease, color 120ms ease",display:"inline-flex",alignItems:"baseline",gap:5},children:[o.label,e.jsx("span",{className:"v2-mono",style:{fontSize:10,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:a[o.id]})]},o.id)})})}function _e({filter:t}){const a={open:{headline:"Nothing open.",sub:"No axe violations or AI walkthrough failures across the audited pages. Switch to All to see everything, or to Verified for a record of acknowledged items."},review:{headline:"No items awaiting review.",sub:"AI walkthroughs returned definitive verdicts (or human verifications) for every criterion that needed judgment."},verified:{headline:"No human verifications recorded.",sub:"When you mark a walkthrough finding as manually verified, it appears here with your note + timestamp."},all:{headline:"Nothing to show.",sub:"No audit data yet — run a scan to begin."}}[t];return e.jsxs("div",{role:"status","aria-live":"polite",style:{padding:"var(--v2-pad-6) var(--v2-pad-4)",textAlign:"center",border:"1px dashed var(--v2-border)",borderRadius:6},children:[e.jsx("p",{className:"v2-display",style:{fontSize:18,fontWeight:500,color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:a.headline}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,maxWidth:440,marginInline:"auto"},children:a.sub})]})}function Ge(t,r,a=[]){const n=[];for(const i of r)i.needsReview?n.push({kind:"needs-review",key:`nr::${i.ruleId}::${i.representativeSelector}`,criterion:i.wcagCriterion,ruleId:i.ruleId,description:i.axeDescription,selector:i.representativeSelector,failureSummary:i.failureSummary,pages:i.pages,group:i}):n.push({kind:"axe",key:`axe::${i.ruleId}::${i.representativeSelector}`,criterion:i.wcagCriterion,ruleId:i.ruleId,impact:i.impact,description:i.axeDescription,selector:i.representativeSelector,pages:i.pages,isShared:i.isShared});const o=new Set;for(const i of t){for(const s of i.walkthroughFindings??[]){const d=`wt-fail::${s.criterionId}::${s.pageUrl}`;o.has(d)||(o.add(d),n.push({kind:"walkthrough-fail",key:d,criterion:s.criterionId,verdict:s.verdict,impact:s.impact,reasoning:s.reasoning,pageUrl:s.pageUrl}))}for(const s of i.walkthroughAcknowledgements??[]){const d=`wt-ack::${s.criterionId}::${s.pageUrl}`;o.has(d)||(o.add(d),n.push({kind:"walkthrough-ack",key:d,criterion:s.criterionId,verdict:s.verdict,reasoning:s.reasoning,pageUrl:s.pageUrl}))}}for(const i of a)n.push({kind:"auto-contrast",key:`auto::${i.ruleId}::${i.selector}::${i.pageUrl}`,criterion:i.wcagCriterion??"1.4.3",ruleId:i.ruleId,impact:"serious",selector:i.selector,pageUrl:i.pageUrl,reasoning:i.reasoning});const l={critical:0,serious:1,moderate:2,minor:3,"needs-review":4,ack:5};return n.sort((i,s)=>{const d=i.kind==="walkthrough-ack"?l.ack:i.kind==="needs-review"?l["needs-review"]:l[i.impact],m=s.kind==="walkthrough-ack"?l.ack:s.kind==="needs-review"?l["needs-review"]:l[s.impact];return(d??99)-(m??99)}),n}function Ke(){var n,o;const t=h(l=>l.siteCrawlReport),r=h(l=>l.results),a=(t==null?void 0:t.startUrl)??((n=r[0])==null?void 0:n.pageUrl)??((o=r[0])==null?void 0:o.scope)??null;return e.jsxs("header",{role:"banner",style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-4)",padding:"var(--v2-pad-3) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",background:"var(--v2-bg)",minHeight:44},children:[e.jsx("a",{href:"#main-content",className:"v2-skip-link",style:{position:"absolute",left:-9999},onFocus:l=>{l.currentTarget.style.left="var(--v2-pad-4)",l.currentTarget.style.top="var(--v2-pad-4)"},onBlur:l=>{l.currentTarget.style.left="-9999px"},children:"Skip to main content"}),e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)"},children:[e.jsx("span",{className:"v2-display",style:{fontSize:18,fontWeight:600,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)"},children:"wcagcheckr"}),e.jsx("span",{className:"v2-eyebrow",children:"v2"})]}),a&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",marginLeft:"var(--v2-pad-4)",minWidth:0,flex:1},children:[e.jsx("span",{className:"v2-eyebrow",children:"scope"}),e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:a,children:a})]}),e.jsxs("nav",{"aria-label":"Application",style:{display:"flex",gap:"var(--v2-pad-1)",marginLeft:"auto"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>{chrome.storage.local.set({v2UiEnabled:!1})},"aria-label":"Switch back to the classic UI",title:"Switch back to the classic v1 UI",children:"Use v1"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm","aria-label":"Open settings",title:"Open settings",onClick:()=>void N({type:"OPEN_SETTINGS"}),children:"Settings"})]})]})}function qe(){return c.useEffect(()=>{const t=ae(),a=new URLSearchParams(window.location.search).get("context")==="overlay"?null:chrome.runtime.connect({name:"sidepanel-tracker"}),n=ne();ie({forceRefresh:!0}).catch(()=>{}),se().catch(()=>{}),le().catch(()=>{}),oe().catch(()=>{}),de().catch(()=>{}),be().then(l=>{h.getState().setAcknowledgedKeys(new Set(l.map(i=>i.matchKey)))}).catch(()=>{});let o=!1;return ke().then(l=>{o||l&&h.setState({siteCrawlReport:l})}).catch(()=>{}),()=>{o=!0,n();try{t.disconnect()}catch{}try{a==null||a.disconnect()}catch{}}},[]),e.jsxs("div",{className:"v2-root",children:[e.jsx(Ke,{}),e.jsxs("main",{id:"main-content","aria-label":"wcagcheckr findings",children:[e.jsx(Re,{}),e.jsx(Oe,{})]})]})}je("side-panel");const z="v2UiEnabled";function Je(){const[t,r]=c.useState(null);return c.useEffect(()=>{let a=!1;chrome.storage.local.get(z).then(o=>{a||r(!!o[z])}).catch(()=>r(!1));const n=(o,l)=>{var i;l==="local"&&z in o&&r(!!((i=o[z])!=null&&i.newValue))};return chrome.storage.onChanged.addListener(n),()=>{a=!0,chrome.storage.onChanged.removeListener(n)}},[]),t===null?null:t?e.jsx(qe,{}):e.jsx(ue,{})}const Z=document.getElementById("root");if(!Z)throw new Error("side-panel: #root not found");ee(Z).render(e.jsx(te.StrictMode,{children:e.jsx(ce,{children:e.jsx(Je,{})})}));
|
package/dist/manifest.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "wcagcheckr",
|
|
4
4
|
"description": "Audit components across hover, focus, dark mode, forced colors, RTL — every state your users actually encounter. Per-component baselines surface only NEW violations.",
|
|
5
|
-
"version": "1.0.0.
|
|
6
|
-
"version_name": "1.0.0-rc.
|
|
5
|
+
"version": "1.0.0.286",
|
|
6
|
+
"version_name": "1.0.0-rc.286",
|
|
7
7
|
"author": "Locustware",
|
|
8
8
|
"homepage_url": "https://wcagcheckr.com",
|
|
9
9
|
"icons": {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>WCAG Component Auditor</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/side-panel-
|
|
7
|
+
<script type="module" crossorigin src="/assets/side-panel-DOOKonms.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/_commonjsHelpers-Cpj98o6Y.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/crash-reporter-Dc5lvxvY.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wcag-checkr/ci",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.286",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Headless wcagcheckr accessibility audit runner for CI/CD pipelines. Drives the wcagcheckr Chrome extension via Playwright, runs full-page audits across the state matrix (108 combinations: hover, focus, dark mode, RTL, breakpoints), outputs JSON / SARIF / JUnit, exits with severity-aware codes.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import"./modulepreload-polyfill-B5Qt9EMX.js";import{j as e,r as c,c as ee,R as te}from"./styles-DToZ04ht.js";import{u as f,c as re,l as M,s as ae,w as ne,r as ie,a as se,b as le,p as oe,d as de,E as ce,A as ue}from"./ErrorBoundary-Cry28iIf.js";import{l as ve,a as pe,b as ge,c as he,g as K,s as me,d as q,e as J,f as fe,h as xe,i as ye,j as be,k as ke}from"./scheduled-audit-runner-GIytYifI.js";import{s as N,i as je}from"./crash-reporter-Dc5lvxvY.js";import{B as P}from"./ai-usage-log-C-jq4cW3.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./diff-DA41zYPc.js";import"./design-system-audit-DpxJrxnb.js";function O({initialUrl:t,isRunning:r,onCrawl:a,onVerifyFixes:n,onAuditThisPage:l}){const[o,i]=c.useState(t),[s,d]=c.useState(25),[v,j]=c.useState(""),[x,y]=c.useState(""),[p,g]=c.useState(!1),[b,h]=c.useState(P),[w,k]=c.useState(P[0].id),[S,u]=c.useState(null);c.useEffect(()=>{t&&!o&&i(t)},[t]),c.useEffect(()=>{let m=!1;return Promise.all([N({type:"SETTINGS_GET",key:"matrixPresets"}),N({type:"SETTINGS_GET",key:"activePresetId"})]).then(([C,I])=>{if(m)return;const B=Array.isArray(C.data)?C.data:null;h(B&&B.length>0?B:P),typeof I.data=="string"&&k(I.data)}),()=>{m=!0}},[]);function R(m){const C=b.find(I=>I.id===m);C&&(k(m),N({type:"SETTINGS_SET",key:"activePresetId",value:m}),N({type:"SETTINGS_SET",key:"stateMatrix",value:C.matrix}))}function E(){u(null);for(const[m,C]of[["Include",v.trim()],["Exclude",x.trim()]])if(C)try{new RegExp(C)}catch(I){return u(`${m} regex invalid: ${I instanceof Error?I.message:String(I)}`),!1}return!0}function A(m){if(!E())return;const C={startUrl:o.trim(),maxPages:s,includeRegex:v.trim(),excludeRegex:x.trim()};m&&n?n(C):a(C)}return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)",textAlign:"left"},children:[e.jsx(U,{label:"Start URL",children:e.jsx("input",{type:"url",value:o,onChange:m=>i(m.target.value),placeholder:"https://yoursite.com",disabled:r,className:"v2-mono",style:$})}),e.jsx(U,{label:"Max pages",hint:"1–200. Each page runs the full pipeline you configured.",children:e.jsx("input",{type:"number",min:1,max:200,value:s,onChange:m=>d(Math.min(200,Math.max(1,parseInt(m.target.value,10)||25))),disabled:r,className:"v2-mono",style:{...$,maxWidth:100}})}),e.jsx(U,{label:"Audit depth",hint:"State matrix preset applied to every crawled page.",children:e.jsx("select",{value:w,onChange:m=>R(m.target.value),disabled:r,style:$,children:b.map(m=>e.jsx("option",{value:m.id,children:m.name},m.id))})}),e.jsx("button",{type:"button",onClick:()=>g(m=>!m),className:"v2-eyebrow",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--v2-ink-secondary)",textAlign:"left",alignSelf:"flex-start"},children:p?"− hide advanced filters":"+ show URL filters (include / exclude)"}),p&&e.jsxs(e.Fragment,{children:[e.jsx(U,{label:"Include only URLs matching",hint:"Optional regex. Empty = no filter.",children:e.jsx("input",{type:"text",value:v,onChange:m=>j(m.target.value),placeholder:"^https://example\\.com/products/",disabled:r,className:"v2-mono",style:$})}),e.jsx(U,{label:"Exclude URLs matching",hint:"Optional regex. Useful for /admin or /login while logged in.",children:e.jsx("input",{type:"text",value:x,onChange:m=>y(m.target.value),placeholder:"/admin|/dashboard|/login",disabled:r,className:"v2-mono",style:$})})]}),S&&e.jsx("p",{role:"alert",style:{color:"var(--v2-critical)",fontSize:12,margin:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",border:"1px solid var(--v2-critical)",borderRadius:4,background:"rgba(207, 44, 44, 0.06)"},children:S}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",disabled:r||!o.trim(),onClick:()=>A(!1),children:r?"Crawling…":"Crawl whole site"}),n&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:r||!o.trim(),onClick:()=>A(!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),l&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:r,onClick:l,title:"Single-page audit on the active tab (no crawl)",children:"Just this page"})]})]})}function we(){const t=f(l=>l.siteCrawlProgress),r=f(l=>l.siteCrawlStatus);function a(){N({type:"CANCEL_SITE_CRAWL"})}if(r!=="running")return null;const n=t?Math.min(100,Math.max(0,t.current/Math.max(1,t.total)*100)):0;return e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:"crawling…"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:12,fontWeight:600,color:"var(--v2-ink-primary)",fontVariantNumeric:"tabular-nums"},children:t?`${t.current} / ${t.total}`:"…"})]}),e.jsx("div",{role:"progressbar","aria-valuenow":(t==null?void 0:t.current)??0,"aria-valuemin":0,"aria-valuemax":(t==null?void 0:t.total)??1,"aria-label":"Crawl progress",style:{height:8,background:"var(--v2-bg-elev-2)",borderRadius:4,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${n}%`,background:"var(--v2-action)",transition:"width 240ms ease"}})}),(t==null?void 0:t.url)&&e.jsxs("div",{children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:4},children:"current page"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:t.url})]}),(t==null?void 0:t.lastViolations)!==void 0&&t.lastViolations>0&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:["last page: ",t.lastViolations," axe violation",t.lastViolations===1?"":"s"]}),e.jsx("div",{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:a,children:"Cancel crawl"})})]})}function Se(){const t=f(d=>d.status),r=f(d=>d.progress),a=f(d=>d.aiProgress);if(t!=="running")return null;const n=r?r.current>=r.total:!1,l=r?n?"Running deep analyzers…":`Auditing… ${r.current} / ${r.total}`:"Starting audit…",o=r?n?"reading order · tab order · typography · CSS vars · AI candidates":Ce(r.currentState):"Loading axe + DOM analyzers",i=r?n?100:r.current/Math.max(1,r.total)*100:0;function s(){N({type:"CANCEL_AUDIT"})}return e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-4)"},children:[e.jsx(V,{label:l,detail:o,pct:i,valuenow:r?Math.min(r.current,r.total):0,valuemax:r?r.total:1,ariaLabel:r?n?"Running deep analyzers: reading order, tab order, typography, custom properties, AI candidates.":`Audit progress: ${r.current} of ${r.total} states`:"Audit starting",fillColor:"var(--v2-action)"}),a&&e.jsx(V,{label:`AI augmentation… ${a.current} / ${a.total}`,detail:a.candidatesTotal&&a.candidatesTotal>0?`${a.currentCheckLabel} (${a.candidatesDone??0}/${a.candidatesTotal})`:a.currentCheckLabel,pct:a.current/Math.max(1,a.total)*100,valuenow:a.current,valuemax:a.total,ariaLabel:`AI augmentation: ${a.current} of ${a.total} checks. ${a.currentCheckLabel}`,fillColor:"var(--v2-needs-review)"}),e.jsx("div",{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:s,children:"Cancel audit"})})]})}function V({label:t,detail:r,pct:a,valuenow:n,valuemax:l,ariaLabel:o,fillColor:i}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:[e.jsx("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:e.jsx("span",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:t})}),e.jsx("div",{role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":l,"aria-label":o,style:{height:6,background:"var(--v2-bg-elev-2)",borderRadius:3,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${a}%`,background:i,transition:"width 240ms ease"}})}),r&&e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:r})]})}function Ce(t){if(!t)return"";const r=[t.pseudoState];return t.theme&&t.theme!=="light"&&r.push(t.theme),t.direction&&t.direction!=="ltr"&&r.push(t.direction),r.join(" · ")}function U({label:t,hint:r,children:a}){return e.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{className:"v2-eyebrow",style:{color:"var(--v2-ink-secondary)"},children:t}),a,r&&e.jsx("span",{style:{fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.4},children:r})]})}const $={fontFamily:"var(--v2-body)",fontSize:12,padding:"8px 10px",background:"var(--v2-bg)",color:"var(--v2-ink-primary)",border:"1px solid var(--v2-border-strong)",borderRadius:4,outline:"none"};function Y(){const t=f(s=>s.siteCrawlReport),r=f(s=>s.results),a=f(s=>s.delta),n=f(s=>s.componentId),l=f(s=>s.status),[o,i]=c.useState({report:null,resolvedFails:[]});return c.useEffect(()=>{var j;let s=!1;async function d(x){return x.length===0?[]:(await Promise.all(x.map(p=>K(p)))).flat().filter(p=>p.verdict==="fail")}if(t)return(async()=>{const x=t.pages.map(p=>p.url),y=await d(x);s||i({report:t,resolvedFails:y})})(),()=>{s=!0};if(l==="running"||r.length===0||!n){i({report:null,resolvedFails:[]});return}const v=(j=r[0])==null?void 0:j.pageUrl;if(!v){i({report:null,resolvedFails:[]});return}return(async()=>{try{const[x,y,p,g]=await Promise.all([ve([n]),pe([n]),ge(n),d([v])]),b=new Map([[n,x]]),h=new Map([[n,y]]),w=new Map([[n,p]]),k=new Date().toISOString(),S=he(v,[{url:v,results:r,delta:a,componentId:n,durationMs:0}],k,k,0,b,h,w);s||i({report:S,resolvedFails:g})}catch(x){console.warn("[v2] synthesize single-page report failed",x),s||i({report:null,resolvedFails:[]})}})(),()=>{s=!0}},[t,r,a,n,l]),o}function Re(){const{report:t,resolvedFails:r}=Y(),a=f(u=>u.siteCrawlReport),n=f(u=>u.siteCrawlStatus),l=f(u=>u.siteCrawlError),o=f(u=>u.status),i=n==="running",d=i||o==="running"&&!i,v=!!t&&!a,[j,x]=c.useState(null);c.useEffect(()=>{let u=!1;return chrome.tabs.query({active:!0,currentWindow:!0}).then(R=>{var E;u||x(((E=R[0])==null?void 0:E.url)??null)}),()=>{u=!0}},[]);const[y,p]=c.useState(!1);function g(u,R=!1){u.startUrl&&(f.getState().setSiteCrawlStatus("running"),f.getState().setSiteCrawlReport(null),f.getState().setSiteCrawlError(null),M({type:"START_SITE_CRAWL",startUrl:u.startUrl,maxPages:u.maxPages,...u.includeRegex?{includeRegex:u.includeRegex}:{},...u.excludeRegex?{excludeRegex:u.excludeRegex}:{},...R?{verifyFixesOnly:!0}:{}}))}function b(){M({type:"START_AUDIT",mode:"full-page"}),f.getState().startNewScan()}if(d)return e.jsx("section",{"aria-label":"Audit in progress",style:{padding:"var(--v2-pad-5) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:i?e.jsx(we,{}):e.jsx(Se,{})});if(!t)return e.jsxs("section",{"aria-label":"No audit yet",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",maxWidth:640,margin:"0 auto"},children:[e.jsx("p",{className:"v2-eyebrow",style:{marginBottom:"var(--v2-pad-2)"},children:"new audit"}),e.jsx("h1",{className:"v2-display",style:{fontSize:28,fontWeight:500,letterSpacing:"-0.02em",color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:"Configure your crawl."}),l&&e.jsxs("div",{role:"alert",style:{marginBottom:"var(--v2-pad-4)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-critical)",borderRadius:4,background:"rgba(207, 44, 44, 0.06)",color:"var(--v2-critical)",fontSize:12,lineHeight:1.5},children:[e.jsx("strong",{style:{fontWeight:600,marginRight:6},children:"Last crawl failed:"}),l]}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,marginBottom:"var(--v2-pad-5)",maxWidth:520},children:"The crawler follows internal links from the start URL, same-origin only. Each page runs your full audit pipeline (axe + DOM analyzers + AI walkthroughs). Findings appear below as a single unified list."}),e.jsx(O,{initialUrl:j??"",isRunning:d,onCrawl:u=>g(u,!1),onAuditThisPage:b})]});const h=r.length,w=(t.totalWalkthroughFindings??0)+t.totalUniqueViolations+h,k=(t.walkthroughAcknowledgements??[]).length,S=t.totalNeedsReview;return e.jsxs("section",{"aria-label":"Audit summary",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"var(--v2-pad-6)"},children:[e.jsx(Ne,{grade:t.siteGrade}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0},children:v?"page grade · single-page audit":`site grade · ${t.pagesAudited} page${t.pagesAudited===1?"":"s"}`}),e.jsx("h1",{className:"v2-display",style:{fontSize:22,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0,lineHeight:1.25},children:w===0&&S===0?"All clear — nothing open.":`${w+S} finding${w+S===1?"":"s"} to address.`}),e.jsx(Ae,{openCount:w,reviewCount:S,verifiedCount:k,axeCount:t.totalUniqueViolations,walkthroughCount:t.totalWalkthroughFindings??0,autoCount:h}),j&&!Ie(j,t.startUrl)&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:["Active tab: ",j]}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",marginTop:"var(--v2-pad-2)",flexWrap:"wrap"},children:[v?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",onClick:b,title:"Re-audit the current page",children:"Re-audit this page"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>p(u=>!u),"aria-expanded":y,title:"Open crawl setup to audit the whole site instead",children:y?"Hide crawl options":"Crawl whole site"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",onClick:()=>g({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!1),title:`Re-crawl ${t.startUrl} (same options)`,children:"Re-crawl"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:b,title:"Single-page audit of the active tab (no crawl)",children:"Just this page"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>g({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>p(u=>!u),"aria-expanded":y,children:y?"Hide options":"Adjust options"})]}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>{re(),f.getState().setSiteCrawlReport(null),f.getState().setSiteCrawlError(null),me(null).catch(()=>{})},title:"Wipe these results so you can start fresh",style:{marginLeft:"auto"},children:"Clear results"})]})]})]}),y&&e.jsx("div",{style:{marginTop:"var(--v2-pad-5)",paddingTop:"var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)",maxWidth:640},children:e.jsx(O,{initialUrl:t.startUrl,isRunning:d,onCrawl:u=>g(u,!1),onVerifyFixes:u=>g(u,!0),onAuditThisPage:b})})]})}function Ie(t,r){try{return new URL(t).origin===new URL(r).origin}catch{return!1}}function Ne({grade:t}){const r={A:"var(--v2-grade-a)",B:"var(--v2-grade-b)",C:"var(--v2-grade-c)",D:"var(--v2-grade-d)",F:"var(--v2-grade-f)"};return e.jsx("div",{"aria-label":`Grade ${t}`,role:"img",style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:140},children:e.jsx("span",{className:"v2-display",style:{fontSize:132,lineHeight:1,fontWeight:500,color:r[t],letterSpacing:"-0.04em",fontVariationSettings:'"opsz" 144'},children:t})})}function Ae({openCount:t,reviewCount:r,verifiedCount:a,axeCount:n,walkthroughCount:l,autoCount:o}){return e.jsxs("dl",{style:{display:"flex",gap:"var(--v2-pad-4)",flexWrap:"wrap",margin:0,color:"var(--v2-ink-secondary)",fontSize:12},children:[e.jsx(T,{term:"open",value:t,tone:t>0?"attention":"neutral"}),e.jsx(T,{term:"review",value:r,tone:r>0?"review":"neutral"}),e.jsx(T,{term:"verified",value:a,tone:a>0?"positive":"neutral"}),e.jsx("span",{style:{color:"var(--v2-ink-faint)"},children:"·"}),e.jsx(T,{term:"axe",value:n,tone:"neutral"}),e.jsx(T,{term:"walkthrough",value:l,tone:"neutral"}),o>0&&e.jsx(T,{term:"auto-contrast",value:o,tone:"neutral"})]})}function T({term:t,value:r,tone:a}){const n={attention:"var(--v2-critical)",review:"var(--v2-needs-review)",positive:"var(--v2-verified)",neutral:"var(--v2-ink-secondary)"};return e.jsxs("div",{style:{display:"inline-flex",alignItems:"baseline",gap:6},children:[e.jsx("dt",{className:"v2-eyebrow",style:{display:"inline",margin:0,color:"var(--v2-ink-tertiary)"},children:t}),e.jsx("dd",{className:"v2-mono",style:{margin:0,fontWeight:600,fontSize:13,color:n[a],fontVariantNumeric:"tabular-nums"},children:r})]})}const Te=new Set(["2.4.3","2.1.2","2.4.7","1.3.2","1.4.11","2.5.3"]);function _(t){return Te.has(t)}async function G(t){var n,l;const r=f.getState();if(r.componentId&&((n=r.results[0])==null?void 0:n.pageUrl)===t)return r.componentId;const a=await q();return((l=a==null?void 0:a.find(o=>o.url===t))==null?void 0:l.componentId)??null}async function Ee(t,r){var o;const a=f.getState(),n=[];if(a.componentId&&a.results.length>0){const i=(o=a.results[0])==null?void 0:o.pageUrl,s=r.find(d=>d.url===i);if(s){for(const d of a.results)for(const v of d.violations)v.ruleId===t&&v.target.selector===s.selector&&n.push({componentId:a.componentId,matchKey:v.matchKey});if(n.length>0)return n}}const l=await q()??[];for(const i of r){const s=l.find(d=>d.url===i.url);if(s)for(const d of s.results)for(const v of d.violations)v.ruleId===t&&v.target.selector===i.selector&&n.push({componentId:s.componentId,matchKey:v.matchKey})}return n}function Ue({row:t}){return e.jsxs("details",{style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,overflow:"hidden"},children:[e.jsxs("summary",{style:{cursor:"pointer",padding:"var(--v2-pad-3) var(--v2-pad-4)",listStyle:"none",display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-3)"},children:[e.jsx($e,{row:t}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(Fe,{row:t}),e.jsx(ze,{row:t})]}),e.jsx(We,{})]}),e.jsx("div",{style:{padding:"0 var(--v2-pad-4) var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)"},children:e.jsx(Be,{row:t})})]})}function $e({row:t}){if(t.kind==="walkthrough-ack")return e.jsx("span",{className:"v2-chip v2-chip-verified","aria-label":"Status: human verified",children:"verified"});if(t.kind==="needs-review")return e.jsx("span",{className:"v2-chip v2-chip-review","aria-label":"Status: needs human review",children:"review"});if(t.kind==="auto-contrast")return e.jsx("span",{className:"v2-chip v2-chip-serious","aria-label":"Severity: serious, auto-resolved by pixel sampler",title:"Empirical pixel-contrast measurement, not an axe-confirmed violation. Human verification recommended.",children:"auto · serious"});if(t.kind==="walkthrough-fail")return e.jsx("span",{className:t.verdict==="fail"?"v2-chip v2-chip-serious":"v2-chip v2-chip-moderate","aria-label":`Severity: ${t.verdict}`,children:t.verdict});const r={critical:"v2-chip-critical",serious:"v2-chip-serious",moderate:"v2-chip-moderate",minor:"v2-chip-minor"};return e.jsx("span",{className:`v2-chip ${r[t.impact]}`,"aria-label":`Severity: ${t.impact}`,children:t.impact})}function Fe({row:t}){const r=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"||t.kind==="needs-review"||t.kind==="axe"||t.kind==="auto-contrast"?t.criterion:null,a=t.kind==="walkthrough-fail"?`AI walkthrough ${t.verdict} on this criterion.`:t.kind==="walkthrough-ack"?"Human-verified by an auditor.":t.kind==="needs-review"?t.description:t.kind==="auto-contrast"?"Empirical contrast measurement fell below threshold.":t.description;return e.jsxs("p",{style:{margin:0,marginBottom:4,color:"var(--v2-ink-primary)",fontSize:13,fontWeight:500,lineHeight:1.4},children:[r&&e.jsxs("span",{className:"v2-mono",style:{fontSize:11,fontWeight:600,color:"var(--v2-ink-tertiary)",marginRight:8},children:["WCAG ",r]}),a]})}function ze({row:t}){const r=t.kind==="axe"||t.kind==="needs-review"?t.pages.length:1,a=t.kind==="axe"||t.kind==="needs-review"||t.kind==="auto-contrast"?t.selector:null,n=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"||t.kind==="auto-contrast"?t.pageUrl:null;return e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",flexWrap:"wrap"},children:[a&&e.jsx("code",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",background:"var(--v2-bg-elev-2)",padding:"2px 6px",borderRadius:2,wordBreak:"break-all"},children:a}),n&&e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:n}),r>1&&e.jsxs("span",{className:"v2-eyebrow",style:{marginLeft:"auto"},children:["on ",r," pages"]})]})}function We(){return e.jsx("span",{"aria-hidden":"true",style:{color:"var(--v2-ink-tertiary)",fontFamily:"var(--v2-mono)",fontSize:12,marginLeft:8,marginTop:2},children:"⏵"})}function Be({row:t}){return t.kind==="walkthrough-fail"?e.jsx(De,{row:t}):t.kind==="walkthrough-ack"?e.jsx(Le,{row:t}):t.kind==="needs-review"?e.jsx(He,{row:t}):t.kind==="auto-contrast"?e.jsx(Pe,{row:t}):e.jsx(Me,{row:t})}function Pe({row:t}){const[r,a]=c.useState(!1),[n,l]=c.useState(!1),[o,i]=c.useState(""),[s,d]=c.useState(!1),[v,j]=c.useState(!1),[x,y]=c.useState(null),p=J(t.ruleId);async function g(){if(d(!0),y(null),!o.trim()){y("Note is required — explain why the empirical contrast measurement is wrong, or why this element is acceptable in context."),d(!1);return}try{const h=(await K(t.pageUrl)).find(k=>k.ruleId===t.ruleId&&k.selector===t.selector),w={pageUrl:t.pageUrl,ruleId:t.ruleId,selector:t.selector,verdict:"pass",reasoning:`Human override: ${o.trim()}
|
|
2
|
-
|
|
3
|
-
(Original empirical reasoning: ${t.reasoning})`,resolvedAt:new Date().toISOString(),costUsd:0,wcagCriterion:t.criterion,inputHash:h==null?void 0:h.inputHash};await xe(w),j(!0),a(!1)}catch(b){y(b instanceof Error?b.message:String(b))}finally{d(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(F,{label:"Empirical measurement",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:t.reasoning})}),e.jsx("p",{style:{margin:0,marginBottom:"var(--v2-pad-3)",fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.5,fontStyle:"italic"},children:"This finding came from a pixel-level screenshot diff of text against the rendered background, not from axe-core. Treat as a strong hint for human review, not a confirmed violation — gradients, translucent overlays, and animated backdrops can fool the sampler."}),v?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsxs(H,{children:[p&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>l(b=>!b),"aria-expanded":n,children:n?"Hide fix recipe":"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>a(b=>!b),"aria-expanded":r,children:r?"Cancel":"Mark verified manually"})]}),n&&p&&e.jsx(X,{summary:p.summary,snippet:p.snippet}),r&&e.jsx(D,{note:o,setNote:i,busy:s,err:x,onConfirm:g,hint:"Why the empirical measurement is wrong, or why this is acceptable. Overrides the resolution to pass.",placeholder:"e.g., Text sits over a video poster image; static screenshot misreads the rendered background. Production poster passes 7:1."}),x&&!r&&e.jsx(W,{message:x})]})]})}function De({row:t}){const[r,a]=c.useState(!1),[n,l]=c.useState(""),[o,i]=c.useState(!1),[s,d]=c.useState(!1),[v,j]=c.useState(!1),[x,y]=c.useState(null),[p,g]=c.useState(null),b=_(t.criterion);async function h(){if(i(!0),g(null),!n.trim()){g("Note is required — explain how you manually verified this."),i(!1);return}try{const k=await G(t.pageUrl);if(!k){g("Could not find this page in the audit data. Re-run the audit and try again.");return}await fe({componentId:k,criterionId:t.criterion,pageUrl:t.pageUrl,note:n.trim(),acknowledgedAt:new Date().toISOString(),verdictAtAck:t.verdict}),d(!0),a(!1)}catch(k){g(k instanceof Error?k.message:String(k))}finally{i(!1)}}async function w(){var k;j(!0),y(null),g(null);try{const u=(k=(await chrome.tabs.query({active:!0,currentWindow:!0}))[0])==null?void 0:k.id;if(!u){g("Open the audited page in your active tab to re-run.");return}const R=await G(t.pageUrl);if(!R){g("Could not find this page in the audit data.");return}if(!_(t.criterion)){g(`Re-run is only available for interactive criteria. ${t.criterion} is not supported.`);return}const A=await N({type:"INTERACTIVE_AUDIT_REQUEST",criterionId:t.criterion,tabId:u,componentId:R,pageUrl:t.pageUrl});if(!A.ok){g(A.error??"Re-run failed.");return}y(`Re-run verdict: ${A.verdict??"unknown"}. Re-audit the page to refresh this list.`)}catch(S){g(S instanceof Error?S.message:String(S))}finally{j(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(F,{label:"AI reasoning",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),s?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsxs(H,{children:[b&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:w,disabled:v,children:v?"Re-running…":"Re-run walkthrough"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>a(k=>!k),"aria-expanded":r,children:r?"Cancel":"Mark verified manually"})]}),x&&e.jsx("p",{role:"status",style:{marginTop:"var(--v2-pad-2)",padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"rgba(15, 143, 94, 0.08)",border:"1px solid var(--v2-verified)",borderRadius:4,color:"var(--v2-verified)",fontSize:11,lineHeight:1.5},children:x}),r&&e.jsx(D,{note:n,setNote:l,busy:o,err:p,onConfirm:h,hint:"Explain what you checked. This goes into the forensic record.",placeholder:"e.g., Verified — focus indicator visible on every interactive control under :focus-visible; tested with keyboard nav."}),p&&!r&&e.jsx(W,{message:p})]})]})}function Le({row:t}){return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(F,{label:"What the human verified",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),e.jsxs("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginTop:"var(--v2-pad-2)"},children:["Original AI verdict: ",e.jsx("strong",{children:t.verdict}),". Now treated as pass for conformance."]})]})}function He({row:t}){return e.jsx(Q,{row:t,kind:"needs-review"})}function Me({row:t}){return e.jsx(Q,{row:t,kind:"axe"})}function Q({row:t,kind:r}){const[a,n]=c.useState(!1),[l,o]=c.useState(""),[i,s]=c.useState(!1),[d,v]=c.useState(!1),[j,x]=c.useState(!1),[y,p]=c.useState(null),g=J(t.ruleId);async function b(){if(s(!0),p(null),!l.trim()){p(r==="needs-review"?"Note is required — explain your review judgment.":"Note is required — explain why this isn't actually an issue in your context."),s(!1);return}try{const h=await Ee(t.ruleId,t.pages);if(h.length===0){p("Could not find this finding in the persisted audit data. Re-run the audit and try again.");return}for(const w of h)await ye({componentId:w.componentId,matchKey:w.matchKey,ruleId:t.ruleId,note:l.trim()});v(!0),n(!1)}catch(h){p(h instanceof Error?h.message:String(h))}finally{s(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[r==="needs-review"&&t.failureSummary&&e.jsx(F,{label:"AI assessment",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:t.failureSummary})}),e.jsx(F,{label:"Affected",children:e.jsxs("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:4},children:[t.pages.slice(0,8).map(h=>e.jsx("li",{children:e.jsx("a",{href:h.url,target:"_blank",rel:"noopener noreferrer",className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",textDecoration:"underline",textDecorationColor:"var(--v2-ink-faint)",textUnderlineOffset:2},children:h.url})},h.url)),t.pages.length>8&&e.jsxs("li",{className:"v2-eyebrow",children:["+ ",t.pages.length-8," more"]})]})}),d?e.jsx(L,{}):e.jsxs(e.Fragment,{children:[e.jsxs(H,{children:[r==="axe"&&g&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>x(h=>!h),"aria-expanded":j,children:j?"Hide fix recipe":"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>n(h=>!h),"aria-expanded":a,children:a?"Cancel":"Mark verified manually"})]}),j&&g&&e.jsx(X,{summary:g.summary,snippet:g.snippet}),a&&e.jsx(D,{note:l,setNote:o,busy:i,err:y,onConfirm:b,hint:r==="needs-review"?"Your review judgment. Goes into the forensic record.":"Why this isn't actually an issue in your context. Goes into the forensic record.",placeholder:r==="needs-review"?"e.g., Verified — image is a portrait of the named founder; alt text correctly identifies subject and role.":'e.g., This element is decorative; aria-hidden + role="presentation" applied via design system.',confirmLabel:`Confirm — acknowledge on ${t.pages.length} page${t.pages.length===1?"":"s"}`}),y&&!a&&e.jsx(W,{message:y})]})]})}function D({note:t,setNote:r,busy:a,err:n,onConfirm:l,hint:o,placeholder:i,confirmLabel:s="Confirm acknowledgement"}){return e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-border-strong)",borderRadius:4,background:"var(--v2-bg)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:"verification note · required"}),e.jsx("p",{style:{margin:0,marginBottom:"var(--v2-pad-2)",fontSize:11,color:"var(--v2-ink-tertiary)"},children:o}),e.jsx("textarea",{value:t,onChange:d=>r(d.target.value),placeholder:i,rows:3,style:{width:"100%",fontFamily:"var(--v2-body)",fontSize:12,lineHeight:1.5,padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"var(--v2-bg)",color:"var(--v2-ink-primary)",border:"1px solid var(--v2-border-strong)",borderRadius:4,resize:"vertical",minHeight:70},autoFocus:!0}),n&&e.jsx(W,{message:n}),e.jsx("div",{style:{marginTop:"var(--v2-pad-2)"},children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:l,disabled:a||!t.trim(),children:a?"Saving…":s})})]})}function X({summary:t,snippet:r}){return e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-verified)",borderRadius:4,background:"rgba(15, 143, 94, 0.06)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6,color:"var(--v2-verified)"},children:"how to fix"}),e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t}),r&&e.jsx("pre",{className:"v2-mono",style:{marginTop:"var(--v2-pad-2)",marginBottom:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"var(--v2-bg)",border:"1px solid var(--v2-border)",borderRadius:3,fontSize:11,color:"var(--v2-ink-primary)",overflowX:"auto",whiteSpace:"pre"},children:e.jsx("code",{children:r})})]})}function L(){return e.jsxs("div",{role:"status",style:{marginTop:"var(--v2-pad-2)",padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"rgba(15, 143, 94, 0.08)",border:"1px solid var(--v2-verified)",borderRadius:4,color:"var(--v2-verified)",fontSize:12,lineHeight:1.5},children:[e.jsx("strong",{style:{fontWeight:600},children:"✓ Acknowledged."})," ","The ack is saved. Re-audit or re-crawl to see this finding drop out of the list."]})}function W({message:t}){return e.jsx("p",{role:"alert",style:{marginTop:"var(--v2-pad-2)",marginBottom:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",border:"1px solid var(--v2-critical)",background:"rgba(207, 44, 44, 0.06)",borderRadius:4,color:"var(--v2-critical)",fontSize:11,lineHeight:1.4},children:t})}function F({label:t,children:r}){return e.jsxs("div",{style:{marginBottom:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:t}),r]})}function H({children:t}){return e.jsx("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:t})}function Oe(){const{report:t,resolvedFails:r}=Y(),[a,n]=c.useState("open"),l=c.useMemo(()=>t?Ge(t.pages,t.findingGroups??[],r):[],[t,r]),o=c.useMemo(()=>a==="all"?l:l.filter(s=>a==="verified"?s.kind==="walkthrough-ack":a==="review"?s.kind==="needs-review":a==="open"?s.kind==="axe"||s.kind==="walkthrough-fail"||s.kind==="auto-contrast":!0),[l,a]);if(!t)return null;const i={all:l.length,open:l.filter(s=>s.kind==="axe"||s.kind==="walkthrough-fail"||s.kind==="auto-contrast").length,review:l.filter(s=>s.kind==="needs-review").length,verified:l.filter(s=>s.kind==="walkthrough-ack").length};return e.jsxs("section",{"aria-labelledby":"findings-heading",style:{padding:"var(--v2-pad-5) var(--v2-pad-5) var(--v2-pad-7)"},children:[e.jsxs("header",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)",marginBottom:"var(--v2-pad-4)",flexWrap:"wrap"},children:[e.jsx("h2",{id:"findings-heading",className:"v2-display",style:{fontSize:20,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0},children:"Findings"}),e.jsx(Ve,{filter:a,setFilter:n,counts:i})]}),o.length===0?e.jsx(_e,{filter:a}):e.jsx("ul",{"aria-label":`${a} findings, ${o.length} items`,style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:o.map((s,d)=>e.jsx("li",{style:{animation:`v2-row-in 240ms ease ${Math.min(d,12)*30}ms both`},children:e.jsx(Ue,{row:s})},s.key))})]})}function Ve({filter:t,setFilter:r,counts:a}){const n=[{id:"open",label:"Open"},{id:"review",label:"Review"},{id:"verified",label:"Verified"},{id:"all",label:"All"}];return e.jsx("div",{role:"tablist","aria-label":"Filter findings",style:{display:"inline-flex",gap:4,background:"var(--v2-bg-elev)",padding:3,borderRadius:6,border:"1px solid var(--v2-border)"},children:n.map(l=>{const o=t===l.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:()=>r(l.id),style:{fontFamily:"var(--v2-body)",fontSize:11,padding:"5px 10px",borderRadius:4,border:"none",cursor:"pointer",background:o?"var(--v2-bg-elev-2)":"transparent",color:o?"var(--v2-ink-primary)":"var(--v2-ink-secondary)",fontWeight:o?600:500,transition:"background 120ms ease, color 120ms ease",display:"inline-flex",alignItems:"baseline",gap:5},children:[l.label,e.jsx("span",{className:"v2-mono",style:{fontSize:10,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:a[l.id]})]},l.id)})})}function _e({filter:t}){const a={open:{headline:"Nothing open.",sub:"No axe violations or AI walkthrough failures across the audited pages. Switch to All to see everything, or to Verified for a record of acknowledged items."},review:{headline:"No items awaiting review.",sub:"AI walkthroughs returned definitive verdicts (or human verifications) for every criterion that needed judgment."},verified:{headline:"No human verifications recorded.",sub:"When you mark a walkthrough finding as manually verified, it appears here with your note + timestamp."},all:{headline:"Nothing to show.",sub:"No audit data yet — run a scan to begin."}}[t];return e.jsxs("div",{role:"status","aria-live":"polite",style:{padding:"var(--v2-pad-6) var(--v2-pad-4)",textAlign:"center",border:"1px dashed var(--v2-border)",borderRadius:6},children:[e.jsx("p",{className:"v2-display",style:{fontSize:18,fontWeight:500,color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:a.headline}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,maxWidth:440,marginInline:"auto"},children:a.sub})]})}function Ge(t,r,a=[]){const n=[];for(const i of r)i.needsReview?n.push({kind:"needs-review",key:`nr::${i.ruleId}::${i.representativeSelector}`,criterion:i.wcagCriterion,ruleId:i.ruleId,description:i.axeDescription,selector:i.representativeSelector,failureSummary:i.failureSummary,pages:i.pages,group:i}):n.push({kind:"axe",key:`axe::${i.ruleId}::${i.representativeSelector}`,criterion:i.wcagCriterion,ruleId:i.ruleId,impact:i.impact,description:i.axeDescription,selector:i.representativeSelector,pages:i.pages,isShared:i.isShared});const l=new Set;for(const i of t){for(const s of i.walkthroughFindings??[]){const d=`wt-fail::${s.criterionId}::${s.pageUrl}`;l.has(d)||(l.add(d),n.push({kind:"walkthrough-fail",key:d,criterion:s.criterionId,verdict:s.verdict,impact:s.impact,reasoning:s.reasoning,pageUrl:s.pageUrl}))}for(const s of i.walkthroughAcknowledgements??[]){const d=`wt-ack::${s.criterionId}::${s.pageUrl}`;l.has(d)||(l.add(d),n.push({kind:"walkthrough-ack",key:d,criterion:s.criterionId,verdict:s.verdict,reasoning:s.reasoning,pageUrl:s.pageUrl}))}}for(const i of a)n.push({kind:"auto-contrast",key:`auto::${i.ruleId}::${i.selector}::${i.pageUrl}`,criterion:i.wcagCriterion??"1.4.3",ruleId:i.ruleId,impact:"serious",selector:i.selector,pageUrl:i.pageUrl,reasoning:i.reasoning});const o={critical:0,serious:1,moderate:2,minor:3,"needs-review":4,ack:5};return n.sort((i,s)=>{const d=i.kind==="walkthrough-ack"?o.ack:i.kind==="needs-review"?o["needs-review"]:o[i.impact],v=s.kind==="walkthrough-ack"?o.ack:s.kind==="needs-review"?o["needs-review"]:o[s.impact];return(d??99)-(v??99)}),n}function Ke(){var n,l;const t=f(o=>o.siteCrawlReport),r=f(o=>o.results),a=(t==null?void 0:t.startUrl)??((n=r[0])==null?void 0:n.pageUrl)??((l=r[0])==null?void 0:l.scope)??null;return e.jsxs("header",{role:"banner",style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-4)",padding:"var(--v2-pad-3) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",background:"var(--v2-bg)",minHeight:44},children:[e.jsx("a",{href:"#main-content",className:"v2-skip-link",style:{position:"absolute",left:-9999},onFocus:o=>{o.currentTarget.style.left="var(--v2-pad-4)",o.currentTarget.style.top="var(--v2-pad-4)"},onBlur:o=>{o.currentTarget.style.left="-9999px"},children:"Skip to main content"}),e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)"},children:[e.jsx("span",{className:"v2-display",style:{fontSize:18,fontWeight:600,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)"},children:"wcagcheckr"}),e.jsx("span",{className:"v2-eyebrow",children:"v2"})]}),a&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",marginLeft:"var(--v2-pad-4)",minWidth:0,flex:1},children:[e.jsx("span",{className:"v2-eyebrow",children:"scope"}),e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:a,children:a})]}),e.jsxs("nav",{"aria-label":"Application",style:{display:"flex",gap:"var(--v2-pad-1)",marginLeft:"auto"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>{chrome.storage.local.set({v2UiEnabled:!1})},"aria-label":"Switch back to the classic UI",title:"Switch back to the classic v1 UI",children:"Use v1"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm","aria-label":"Open settings",title:"Open settings",onClick:()=>void N({type:"OPEN_SETTINGS"}),children:"Settings"})]})]})}function qe(){return c.useEffect(()=>{const t=ae(),a=new URLSearchParams(window.location.search).get("context")==="overlay"?null:chrome.runtime.connect({name:"sidepanel-tracker"}),n=ne();ie({forceRefresh:!0}).catch(()=>{}),se().catch(()=>{}),le().catch(()=>{}),oe().catch(()=>{}),de().catch(()=>{}),be().then(o=>{f.getState().setAcknowledgedKeys(new Set(o.map(i=>i.matchKey)))}).catch(()=>{});let l=!1;return ke().then(o=>{l||o&&f.setState({siteCrawlReport:o})}).catch(()=>{}),()=>{l=!0,n();try{t.disconnect()}catch{}try{a==null||a.disconnect()}catch{}}},[]),e.jsxs("div",{className:"v2-root",children:[e.jsx(Ke,{}),e.jsxs("main",{id:"main-content","aria-label":"wcagcheckr findings",children:[e.jsx(Re,{}),e.jsx(Oe,{})]})]})}je("side-panel");const z="v2UiEnabled";function Je(){const[t,r]=c.useState(null);return c.useEffect(()=>{let a=!1;chrome.storage.local.get(z).then(l=>{a||r(!!l[z])}).catch(()=>r(!1));const n=(l,o)=>{var i;o==="local"&&z in l&&r(!!((i=l[z])!=null&&i.newValue))};return chrome.storage.onChanged.addListener(n),()=>{a=!0,chrome.storage.onChanged.removeListener(n)}},[]),t===null?null:t?e.jsx(qe,{}):e.jsx(ue,{})}const Z=document.getElementById("root");if(!Z)throw new Error("side-panel: #root not found");ee(Z).render(e.jsx(te.StrictMode,{children:e.jsx(ce,{children:e.jsx(Je,{})})}));
|