PageSourceSearch

https://zop.dev/zopnight/app/assets/GovernancePage-DgV45SFn.js

js zop.dev collected 2026-10-03 19:49:09 UTC 21,765 bytes, 2 lines download raw bytes

1import{r as i,j as e,u as Z,L as K}from"./react-vendor-xjz46aeH.js";import{B as O,D as Y,C as V,j as Q,P as J,E as W}from"./index-DB-GErVi.js";import{P as X}from"./PageHeader-BdDybfPf.js";import{E as ee}from"./ErrorState-DlvwccLP.js";import{C as te}from"./CurrencyValue-CxMJfgrF.js";import{T as H}from"./TableSkeleton-C9Pu8LvF.js";import{u as se,a as re,d as _,S as ae,b as ne,c as oe,e as ie,f as le,g as ce,h as de,i as ue,R as xe,s as me,j as pe,k as he,E as ge}from"./bits-C85JEsbM.js";import{S as fe}from"./SearchableSelect-DyTTeEMu.js";import{P as be}from"./PolicyWizard-Bn-mlEgH.js";import"./tanstack-vendor-CK-H18W-.js";import"./sentry-vendor-B7Zxq--p.js";import"./CostInfoBanner-DabANHFh.js";import"./actionFailure-B9bV-6re.js";import"./Toggle-DarifWY4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"53c0c37b9d0458a05694e8ed0430da9c4ec6eaca"};var a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="063270a5-9eca-4b17-ada6-58642c02326b",t._sentryDebugIdIdentifier="sentry-dbid-063270a5-9eca-4b17-ada6-58642c02326b")}catch{}})();const je=["critical","high","medium","low","info"],A="font-mono text-[10.5px] uppercase tracking-wide text-text-muted";function U({active:t,tone:a,onClick:r,children:n}){const o=a==="danger"?"text-danger-700":"text-warning-700";return e.jsx("button",{type:"button",onClick:r,className:`h-full flex-1 rounded text-[11.5px] font-semibold uppercase tracking-wide transition-colors ${t?`bg-surface shadow-sm ${o}`:"text-text-muted hover:text-text-secondary"}`,children:n})}function ye({open:t,policy:a,catalogByRule:r,canManage:n=!0,onClose:o,onSaved:l}){const j=se(),x=re(),d=a?_(a,r||{}):null,m=d?.spec||{},u=m.kind==="rego",b=d?(r||{})[m.rule]:null,[v,g]=i.useState(a?.name||d?.name||""),[p,k]=i.useState(d?.severity||"medium"),[c,S]=i.useState(d?.enforcement||"advisory"),[M,I]=i.useState(m.params||{}),[y,w]=i.useState(m.rego?.module||"");if(!a)return null;const N=(s,h)=>I(C=>({...C,[s]:h})),E=async()=>{const s=u?ne({severity:p,enforcement:c,module:y}):oe({rule:m.rule,severity:p,enforcement:c,params:ie(M)});try{const h=await x.mutateAsync(s);if(h&&h.valid===!1){V.error("Policy is invalid",{description:(h.errors||[]).join(`
2`)||"Fix the errors and try again."});return}}catch{V.error("Could not validate the policy — not saved",{description:"Please try again."});return}j.mutate({id:a.id,name:v.trim()||d.name||m.rule,spec:s},{onSuccess:()=>{l?.(),o()}})},f=e.jsxs("div",{className:"flex w-full items-center justify-end gap-2.5",children:[e.jsx(O,{variant:"secondary",size:"sm",onClick:o,disabled:j.isPending,children:n?"Cancel":"Close"}),n&&e.jsx(O,{variant:"primary",size:"sm",onClick:E,disabled:j.isPending||x.isPending||u&&!y.trim(),children:x.isPending?"Validating…":j.isPending?"Saving…":"Save changes"})]});return e.jsx(Y,{open:t,onClose:o,title:"Edit policy",subtitle:u?"custom rego":d.rule,footer:f,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:A,children:"Name"}),e.jsx("input",{value:v,onChange:s=>g(s.target.value),className:"h-9 rounded-md border border-border bg-surface px-3 text-[12.5px] text-text-primary outline-none focus:border-border-focus"})]}),e.jsxs("div",{className:"flex gap-2.5",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[e.jsx("span",{className:A,children:"Severity"}),e.jsx(fe,{portal:!0,subtle:!0,stopEscapePropagation:!0,size:"sm",value:p,onChange:s=>k(s.target.value),options:je.map(s=>({value:s,label:s,leadingIcon:e.jsx(ae,{level:s})}))})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5",children:[e.jsx("span",{className:A,children:"Enforcement"}),e.jsxs("div",{className:"flex h-9 items-center gap-1 rounded-md border border-border bg-surface-tertiary p-1",children:[e.jsx(U,{active:c==="mandatory",tone:"danger",onClick:()=>S("mandatory"),children:"mandatory"}),e.jsx(U,{active:c==="advisory",tone:"warning",onClick:()=>S("advisory"),children:"advisory"})]})]})]}),d.appliesTo&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:A,children:"Scope (read-only)"}),e.jsx("div",{className:"rounded-md border border-border bg-surface-tertiary px-3 py-2 font-mono text-[11.5px] text-text-secondary",children:d.appliesTo})]}),u?e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:A,children:"Rego module"}),e.jsx("textarea",{value:y,onChange:s=>w(s.target.value),spellCheck:!1,className:"min-h-[220px] resize-none rounded-md border border-border bg-surface-tertiary p-3 font-mono text-[12px] leading-relaxed text-text-primary outline-none focus:border-border-focus"})]}):(b?.params||[]).length>0?e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:A,children:"Parameters"}),b.params.map(s=>
2{const h=M[s.name],C=s.type==="string_list",B=s.type==="number";return e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[12px] font-medium text-text-secondary",children:s.label||s.name}),e.jsx("input",{type:B?"number":"text",value:C?Array.isArray(h)?h.join(", "):h||"":h??"",onChange:G=>{const R=G.target.value;if(C){N(s.name,R.split(",").map(L=>L.trim()).filter(Boolean));return}if(B){const L=Number(R);N(s.name,R===""||Number.isNaN(L)?"":L);return}N(s.name,R)},inputMode:B?"decimal":void 0,placeholder:C?"comma-separated":"",className:"h-9 rounded-md border border-border bg-surface px-3 font-mono text-[12.5px] text-text-primary outline-none focus:border-border-focus"})]},s.name)})]}):e.jsx("p",{className:"text-[12px] text-text-muted",children:"This rule takes no parameters."})]})})}const P=(t,a=0)=>typeof t=="number"?t:a,ve=t=>t.runId||t.id,T=t=>t.repo||t.repoId||t.repository||"",Ne=t=>T(t)||(t.trigger==="pull_request"?"PR check":"Scan"),q=t=>t.ref||t.gitRef||t.branch||[t.framework,(t.source||"").replace("_json","")].filter(Boolean).join(" "),we=t=>P(t.findingCount,P(t.findings)),ke=t=>P(t.blockingCount,P(t.blocking)),z=t=>P(t.estimatedMonthlyCost,P(t.risk,P(t.riskUSD,P(t.atRisk)))),Se=t=>t.finishedAt||t.startedAt||t.when||t.createdAt||t.at||"";function Ce(t){if(!t)return"—";const a=new Date(t).getTime();if(isNaN(a))return"—";const r=Math.max(0,Math.floor((Date.now()-a)/1e3));if(r<60)return`${r}s ago`;const n=Math.floor(r/60);if(n<60)return`${n}m ago`;const o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Pe(t){const a=new Map;for(const r of t)if(!(r.targetType!=="repository"||!r.targetId))for(const n of String(r.targetId).split(",")){const o=n.trim();o&&(a.has(o)||a.set(o,[]),a.get(o).push(r))}return[...a.entries()].map(([r,n])=>({repoRef:r,policies:n})).sort((r,n)=>r.repoRef.localeCompare(n.repoRef))}function Ze(){const t=Z(),{data:a=[]}=le(),r=i.useMemo(()=>Object.fromEntries(a.map(f=>[f.rule,f])),[a]),{data:n=[],isLoading:o,isError:l,error:j,refetch:x}=ce(),{data:d=[],isLoading:m}=de(),{data:u=[]}=ue(),b=u.find(f=>f.provider==="github_app")?.id||u[0]?.id||null,[v,g]=i.useState("validations"),[p,k]=i.useState(null),[c,S]=i.useState(0),M=(f=null)=>{k({presetRepo:f}),S(s=>s+1)},I=Q(J.IAC_POLICY_MANAGE),[y,w]=i.useState(null),N=i.useMemo(()=>Pe(n),[n]),E=i.useMemo(()=>n.filter(f=>_(f,r).enforcement==="mandatory").length,[n,r]);return e.jsxs("div",{className:"gov",children:[e.jsx(X,{title:"IaC Validations",action:I?e.jsx(O,{variant:"primary",size:"sm",onClick:()=>M(null),children:"Attach policy"}):void 0}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 mb-5",children:[e.jsx(D,{label:"Repositories",value:N.length,sub:"governed"}),e.jsx(D,{label:"Policies",value:n.length,sub:"attached"}),e.jsx(D,{label:"Blocking",value:E,tone:E?"danger":void 0,sub:"mandatory policies"})]}),e.jsx("div",{className:"flex items-center justify-between gap-3 mb-5",children:e.jsxs("div",{className:"inline-flex rounded-lg border border-border bg-surface p-0.5",children:[e.jsx(F,{active:v==="validations",onClick:()=>g("validations"),children:"Validations"}),e.jsx(F,{active:v==="repos",onClick:()=>g("repos"),children:"Repositories"})]})}),v==="repos"?e.jsx(Me,{repoGroups:N,catalogByRule:r,loading:o,error:l,err:j,refetch:x,onAttach:M,canManage:I,onEditPolicy:w,ciIntegrationId:b}):e.jsx(Le,{runs:d,loading:m,onOpenRun:f=>t(`/governance/validations/${encodeURIComponent(f)}`)}),e.jsx(be,{open:p!==null,onClose:()=>k(null),onCreated:x,presetRepo:p?.presetRepo||null},c),e.jsx(ye,{open:y!==null,policy:y,catalogByRule:r,canManage:I,onClose:()=>w(null),onSaved:x},y?.id||"none")]})}function Me({repoGroups:t,catalogByRule:a,loading:r,error:n,err:o,refetch:l,onAttach:j,canManage:x,onEditPolicy:d,ciIntegrationId:m}){return r?e.jsx(H,{rows:3}):n?e.jsx(ee,{error:o,onRetry:l,resource:"policies"}):t.length===0?e.jsx(W,{title:"No repositories governed yet",description:"Attach a policy to a repository to start gating its pull requests — pick a builtin rule (encryption, budget caps, tags…) or write custom Rego. Use “Attach policy” above to begin.",icon:e.jsx("div",{className:"text-3xl opacity-50",children:"❯"})}):e.jsx("div",{className:"flex flex-col gap-4",children:t.map(({repoRef:u,policies:b})=>e.jsx(Ee,{repoRef:u,policies:b,catalogByRule:a,onAttach:()=>j(u),canManage:x,onEditPolicy:d,ciIntegrationId:m},u))})}const $="inline-flex w-fit items-center gap-1.5 rounded-full px-2 py-0.5 font-mono text-[10.5px] font-semibold uppercase tracking-wide ring-1 ring-inset";function Ie({integrationId:t,repoRef:a}){const{data:r,isLoading:n}=pe(t,a);if(!t||n||!r?.status)return null;if(r.status==="active")return e.jsxs("span",{className:`${$} text-success-700 bg-success-500/10 ring-success-500/40`,children:[e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})}),"CI active"]});if(r.status==="token_missing")return e.jsxs("span",{className:`${$} text-danger-700 bg-danger-500/10 ring-danger-500/40`,title:"The governance workflow is merged, but its ZopNight scan token is missing or revoked — checks will fail until it's restored (re-attach a policy to remint it)",children:[e.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M12 9v4M12 17h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"})}),"CI token missing"]});if(r.status==="pending"){const o=`${$} text-warning-700 bg-warning-500/15 ring-warning-500/50`,l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-warning-500","aria-hidden":"true"}),"Merge setup PR"]});return r.prUrl?e.jsx("a",{href:r.prUrl,target:"_blank",rel:"noopener noreferrer",title:"Open the ZopNight CI setup pull request — merge it to make gating live",className:`${o} transition-colors hover:bg-warning-500/25`,children:l}):e.jsx("span",{className:o,title:"A ZopNight CI setup pull request is open — merge it to make gating live",children:l})}return r.status==="not_wired"?e.jsx("span",{className:`${$} text-text-muted bg-surface-tertiary ring-border-strong`,title:"No governance workflow is wired for this repository",children:"CI not wired"}):null}function Ee({repoRef:t,policies:a,catalogByRule:r,onAttach:n,canManage:o,onEditPolicy:l,ciIntegrationId:j}){const x=a.filter(c=>_(c,r).enforcement==="mandatory").length,[d,m]=i.useState(!0),u=5,[b,v]=i.useState(0),g=Math.max(1,Math.ceil(a.length/u)),p=Math.min(b,g-1)*u,k=a.slice(p,p+u);return e.jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-surface",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("button",{type:"button",onClick:()=>m(c=>!c),"aria-label":d?"Collapse":"Expand","aria-expanded":d,className:"grid h-5 w-5 shrink-0 place-items-center rounded text-text-muted hover:text-text-primary",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform ${d?"rotate-90":""}`,children:e.jsx("path",{d:"M9 6l6 6-6 6"})})}),e.jsx("span",{className:"grid h-6 w-6 shrink-0 place-items-center rounded-md bg-surface-tertiary text-text-muted",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("path",{d:"M4 4.5A2.5 2.5 0 0 1 6.5 2H20v18H6.5A2.5 2.5 0 0 0 4 22z"}),e.jsx("path",{d:"M4 17.5A2.5 2.5 0 0 1 6.5 15H20"})]})}),e.jsx(K,{to:`/governance/repositories/${encodeURIComponent(t)}`,className:"truncate font-mono text-[13px] font-medium text-text-primary hover:text-primary-600",children:t})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ie,{integrationId:j,repoRef:t}),e.jsxs("span",{className:"font-mono text-[11px] text-text-muted",children:[a.length," ",a.length===1?"policy":"policies",x>0&&e.jsxs("span",{className:"text-danger-600",children:[" · ",x," blocking"]})]}),o&&e.jsx(O,{variant:"secondary",size:"xs",onClick:n,children:"Attach"})]})]}),d&&e.jsxs("div",{className:"p-3",children:[e.jsx("div",{className:"flex flex-col divide-y divide-border/50",children:k.map(c=>e.jsx(Ae,{policy:c,catalogByRule:r,onEdit:l,compact:!0},c.id))}),a.length>u&&e.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-border/50 pt-2.5 text-[11px] text-text-muted",children:[e.jsxs("span",{className:"tabular-nums",children:[p+1,"–",Math.min(p+u,a.length)," of ",a.length]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",disabled:b<=0,onClick:()=>v(c=>Math.max(0,c-1)),className:"flex h-6 items-center gap-0.5 rounded-md border border-border bg-surface px-2 font-medium text-text-secondary transition-colors hover:bg-surface-tertiary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Previous policies",children:"‹ Prev"}),e.jsxs("span",{className:"tabular-nums text-text-secondary",children:[b+1," / ",g]}),e.jsx("button",{type:"button",disabled:b>=g-1,onClick:()=>v(c=>Math.min(g-1,c+1)),className:"flex h-6 items-center gap-0.5 rounded-md border border-border bg-surface px-2 font-medium text-text-secondary transition-colors hover:bg-surface-tertiary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Next policies",children:"Next ›"})]})]})]})]})}function Ae({policy:t,catalogByRule:a,compact:r=!1,onEdit:n}){const o=_(t,a),l=typeof n=="function";return e.jsxs("button",{type:"button",onClick:()=>l&&n(t),disabled:!l,title:l?"View / edit policy":void 0,className:`flex w-full items-center justify-between gap-3 text-left ${r?"py-1.5":"px-4 py-2.5"}
2 ${l?"cursor-pointer rounded hover:bg-surface-tertiary/40":"cursor-default"}`,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-[12.5px] text-text-primary",children:t.name||o.name||o.rule}),!r&&e.jsx("div",{className:"font-mono text-[11px] text-text-muted",children:o.rule})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsx(he,{level:o.severity}),e.jsx(ge,{value:o.enforcement}),t.enabled===!1&&e.jsx("span",{className:"rounded-full bg-surface-tertiary px-2 py-0.5 font-mono text-[10px] uppercase text-text-muted",children:"off"})]})]})}const Re=[["failed","Blocked"],["warning","Advisory"],["passed","Passed"],["error","Error"]];function Le({runs:t,loading:a,onOpenRun:r}){const[n,o]=i.useState(""),[l,j]=i.useState("all"),[x,d]=i.useState("all"),[m,u]=i.useState("all"),b=i.useMemo(()=>[...new Set(t.map(T).filter(Boolean))].sort(),[t]),v=i.useMemo(()=>[...new Set(t.map(s=>s.trigger).filter(Boolean))].sort(),[t]),g=i.useMemo(()=>t.filter(s=>!(l!=="all"&&String(s.status).toLowerCase()!==l||x!=="all"&&s.trigger!==x||m!=="all"&&T(s)!==m||n.trim()&&!`${T(s)} ${q(s)}`.toLowerCase().includes(n.trim().toLowerCase()))),[t,l,x,m,n]),p=15,[k,c]=i.useState(0),S=`${n}|${l}|${x}|${m}`,[M,I]=i.useState(S);S!==M&&(I(S),c(0));const y=Math.max(1,Math.ceil(g.length/p)),w=Math.min(k,y-1),N=w*p,E=g.slice(N,N+p),f="h-9 rounded-md border border-border bg-surface px-2.5 text-[12.5px] text-text-secondary outline-none focus:border-border-focus";return a?e.jsx(H,{rows:5}):t.length===0?e.jsx(W,{title:"No validations yet",description:"Runs appear here once your CI posts a Terraform/OpenTofu plan to the governance API — every pull request checked against your attached policies.",icon:e.jsx("div",{className:"text-3xl opacity-50",children:"❯"})}):e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{value:n,onChange:s=>o(s.target.value),placeholder:"Search repository or ref…","aria-label":"Search",className:"h-9 min-w-[200px] flex-1 rounded-md border border-border bg-surface px-3 text-[12.5px] text-text-primary outline-none focus:border-border-focus placeholder:text-text-muted"}),e.jsxs("select",{value:l,onChange:s=>j(s.target.value),className:f,"aria-label":"Status",children:[e.jsx("option",{value:"all",children:"All statuses"}),Re.map(([s,h])=>e.jsx("option",{value:s,children:h},s))]}),e.jsxs("select",{value:x,onChange:s=>d(s.target.value),className:f,"aria-label":"Trigger",children:[e.jsx("option",{value:"all",children:"All triggers"}),v.map(s=>e.jsx("option",{value:s,children:s},s))]}),b.length>0&&e.jsxs("select",{value:m,onChange:s=>u(s.target.value),className:f,"aria-label":"Repository",children:[e.jsx("option",{value:"all",children:"All repositories"}),b.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-surface",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[820px] text-[12.5px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-[11px] font-medium text-text-muted",children:[e.jsx("th",{className:"py-2.5 pl-4 pr-2 text-left font-medium",children:"Status"}),e.jsx("th",{className:"px-2 py-2.5 text-left font-medium",children:"Repository · ref"}),e.jsx("th",{className:"px-2 py-2.5 text-left font-medium",children:"Trigger"}),e.jsx("th",{className:"px-2 py-2.5 text-right font-medium",children:"Findings"}),e.jsx("th",{className:"px-2 py-2.5 text-right font-medium",children:"$ / mo"}),e.jsx("th",{className:"px-4 py-2.5 text-right font-medium",children:"When"})]})}),e.jsx("tbody",{children:g.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-text-muted",children:"No runs match your filters."})}):E.map(s=>{const h=ve(s),C=ke(s);return e.jsxs("tr",{onClick:()=>h&&r(h),className:"cursor-pointer border-b border-border/60 last:border-0 hover:bg-surface-tertiary/40",children:[e.jsx("td",{className:"py-2.5 pl-4 pr-2",style:me(s.status),children:e.jsx(xe,{status:s.status})}),e.jsxs("td",{className:"px-2 py-2.5",children:[e.jsx("div",{className:"font-medium text-text-primary",children:Ne(s)}),e.jsx("div",{className:"font-mono text-[11px] text-text-muted",children:q(s)})]}),e.jsx("td",{className:"px-2 py-2.5 font-mono text-[11.5px] text-text-secondary",children:s.trigger||"—"}),e.jsxs("td",{className:"px-2 py-2.5 text-right tabular-nums",children:[we(s),C>0&&e.jsxs("span",{className:"ml-1 text-danger-600",children:["(",C,")"]})]}),e.jsx("td",{className:"px-2 py-2.5 text-right font-mono tabular-nums text-text-secondary",children:z(s)>
20?e.jsx(te,{usd:z(s)}):"—"}),e.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-[11.5px] text-text-muted",children:Ce(Se(s))})]},h)})})]})}),g.length>p&&e.jsxs("div",{className:"flex items-center justify-between border-t border-border px-4 py-2.5 text-[11px] text-text-muted",children:[e.jsxs("span",{className:"tabular-nums",children:[N+1,"–",Math.min(N+p,g.length)," of ",g.length]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",disabled:w<=0,onClick:()=>c(s=>Math.max(0,s-1)),className:"flex h-6 items-center gap-0.5 rounded-md border border-border bg-surface px-2 font-medium text-text-secondary transition-colors hover:bg-surface-tertiary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Previous validations",children:"‹ Prev"}),e.jsxs("span",{className:"tabular-nums text-text-secondary",children:[w+1," / ",y]}),e.jsx("button",{type:"button",disabled:w>=y-1,onClick:()=>c(s=>Math.min(y-1,s+1)),className:"flex h-6 items-center gap-0.5 rounded-md border border-border bg-surface px-2 font-medium text-text-secondary transition-colors hover:bg-surface-tertiary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Next validations",children:"Next ›"})]})]})]})]})}function F({active:t,onClick:a,children:r}){return e.jsx("button",{type:"button",onClick:a,className:`rounded-md px-3.5 py-1.5 text-[13px] transition-colors ${t?"bg-surface-tertiary font-medium text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:r})}function D({label:t,value:a,sub:r,tone:n,slot:o}){return e.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 py-3",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-text-muted",children:t}),e.jsx("div",{className:`mt-0.5 font-mono text-xl font-semibold tabular-nums ${n==="danger"?"text-danger-600":"text-text-primary"}`,children:a}),r&&e.jsx("div",{className:"text-[11px] text-text-muted",children:r}),o]})}export{Ze as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.