@visulima/vis 1.0.0-alpha.26 → 1.0.0-alpha.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE.md +17 -17
  3. package/README.md +24 -22
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +1 -1
  6. package/dist/config/index.d.ts +176 -16
  7. package/dist/packem_chunks/bin.js +263 -263
  8. package/dist/packem_chunks/bloom-status.js +1 -1
  9. package/dist/packem_chunks/bloom-sync.js +1 -1
  10. package/dist/packem_chunks/config.js +12 -12
  11. package/dist/packem_chunks/handler10.js +1 -1
  12. package/dist/packem_chunks/handler11.js +1 -1
  13. package/dist/packem_chunks/handler12.js +1 -1
  14. package/dist/packem_chunks/handler13.js +1 -1
  15. package/dist/packem_chunks/handler14.js +8 -9
  16. package/dist/packem_chunks/handler15.js +1 -1
  17. package/dist/packem_chunks/handler16.js +1 -1
  18. package/dist/packem_chunks/handler17.js +1 -1
  19. package/dist/packem_chunks/handler18.js +1 -1
  20. package/dist/packem_chunks/handler19.js +1 -1
  21. package/dist/packem_chunks/handler2.js +1 -1
  22. package/dist/packem_chunks/handler20.js +1 -1
  23. package/dist/packem_chunks/handler22.js +1 -1
  24. package/dist/packem_chunks/handler23.js +1 -1
  25. package/dist/packem_chunks/handler27.js +1 -1
  26. package/dist/packem_chunks/handler28.js +1 -1
  27. package/dist/packem_chunks/handler29.js +1 -1
  28. package/dist/packem_chunks/handler30.js +3 -3
  29. package/dist/packem_chunks/handler31.js +2 -2
  30. package/dist/packem_chunks/handler34.js +1 -1
  31. package/dist/packem_chunks/handler35.js +3 -22
  32. package/dist/packem_chunks/handler36.js +21 -60
  33. package/dist/packem_chunks/handler37.js +61 -6
  34. package/dist/packem_chunks/handler38.js +3 -24
  35. package/dist/packem_chunks/handler39.js +6 -153
  36. package/dist/packem_chunks/handler4.js +1 -1
  37. package/dist/packem_chunks/handler40.js +24 -10
  38. package/dist/packem_chunks/handler41.js +153 -25
  39. package/dist/packem_chunks/handler42.js +10 -708
  40. package/dist/packem_chunks/handler43.js +25 -24
  41. package/dist/packem_chunks/handler44.js +659 -273
  42. package/dist/packem_chunks/handler45.js +24 -46
  43. package/dist/packem_chunks/handler46.js +322 -3
  44. package/dist/packem_chunks/handler47.js +48 -27
  45. package/dist/packem_chunks/handler48.js +3 -187
  46. package/dist/packem_chunks/handler49.js +23 -30
  47. package/dist/packem_chunks/handler5.js +6 -6
  48. package/dist/packem_chunks/handler50.js +196 -0
  49. package/dist/packem_chunks/handler51.js +34 -0
  50. package/dist/packem_chunks/handler8.js +1 -1
  51. package/dist/packem_chunks/handler9.js +1 -1
  52. package/dist/packem_chunks/heal-accept.js +1 -1
  53. package/dist/packem_chunks/help-command.js +16 -16
  54. package/dist/packem_chunks/index.js +1 -1
  55. package/dist/packem_chunks/list.js +1 -1
  56. package/dist/packem_chunks/loader.js +1 -1
  57. package/dist/packem_chunks/prune.js +1 -1
  58. package/dist/packem_chunks/status.js +1 -1
  59. package/dist/packem_chunks/sync.js +1 -1
  60. package/dist/packem_chunks/sync2.js +1 -1
  61. package/dist/packem_chunks/tripwire.js +1 -1
  62. package/dist/packem_chunks/verify-lockfile.js +1 -1
  63. package/dist/packem_shared/{advisories-DS8JEB_g.js → advisories-xIOdLbAI.js} +1 -1
  64. package/dist/packem_shared/{cyclonedx-ja1cbU69.js → cyclonedx-B3ILsY74.js} +1 -1
  65. package/dist/packem_shared/{docker-Bw9gKo69.js → docker-BynKrOLe.js} +1 -1
  66. package/dist/packem_shared/{index-88UK-tt_.js → index-B_KtN1MB.js} +1 -1
  67. package/dist/packem_shared/{index-CS6a2wFB.js → index-efSniSRN.js} +1 -1
  68. package/dist/packem_shared/{lifecycle-ChCFTm5Q.js → lifecycle-CJRNbN3x.js} +2 -2
  69. package/dist/packem_shared/{min-release-age-heJgeP7o.js → min-release-age-aEn0x8Vy.js} +1 -1
  70. package/dist/packem_shared/{native-config-sync-BOeuyrBj.js → native-config-sync-DdhTLlKL.js} +1 -1
  71. package/dist/packem_shared/{osv-bloom-QSAn2Dcw.js → osv-bloom-BJhlc_I2.js} +2 -2
  72. package/dist/packem_shared/{pm-runner-BzGZmzYs.js → pm-runner-BwX5AL3W.js} +1 -1
  73. package/dist/packem_shared/{provenance-BsBn1f5S.js → provenance-BuiEsWbI.js} +1 -1
  74. package/dist/packem_shared/{resolve-explicit-CBPr617N.js → resolve-explicit-RgRrUDZv.js} +1 -1
  75. package/dist/packem_shared/{s1ngularity-j_ArCZAs.js → s1ngularity-Bs9fUf3q.js} +1 -1
  76. package/dist/packem_shared/{scan-progress-EbvmIh4i.js → scan-progress-DjPT66jy.js} +2 -2
  77. package/dist/packem_shared/{signatures-CaXzNuEn.js → signatures-LYMy8OR5.js} +1 -1
  78. package/dist/packem_shared/{typosquats-C1e6RNjF.js → typosquats-znskIR5j.js} +1 -1
  79. package/dist/packem_shared/watch-BSVsZ_1I.js +1 -0
  80. package/dist/packem_shared/watch-loop-DLlMLg_J.js +11 -0
  81. package/index.js +751 -567
  82. package/package.json +11 -11
  83. package/schemas/project.schema.json +86 -1
  84. package/schemas/vis-config.schema.json +255 -7
@@ -1,322 +1,708 @@
1
- var Kt=Object.defineProperty;var R=(e,t)=>Kt(e,"name",{value:t,configurable:!0});import{createRequire as qt}from"node:module";import{E as L,e as Re,q as jt,P as Rt,T as Ie}from"../packem_shared/index.server-B7ETiT4C.js";import{M as U,i as ae,$ as Ee,C as ea}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{ac as ta,ab as aa,a2 as ia,a3 as ra,a4 as na,o as Ye,h as oa,J as sa,aD as ca,I as la,N as pa,p as f,i as gt,b as da,T as ga,f as ua,L as ut,C as fa,S as ma,Y as ha,s as Ge}from"./bin.js";import{whichBin as va}from"#native";import{w as ya,r as ba,b as xa}from"../packem_shared/ai-analysis-Csn82p17.js";import{B as ft,n as It}from"./config.js";import{s as T,A as ka,P as $a}from"../packem_shared/pm-runner-BzGZmzYs.js";import{c as Et,s as Ce,g as Sa,p as Aa,e as Na}from"../packem_shared/index-88UK-tt_.js";import{d as Ca}from"../packem_shared/anolilab-text-CAM_E6uK.js";import{t as ja,b as Ra}from"../packem_shared/cyclonedx-ja1cbU69.js";import{s as Oa}from"../packem_shared/scan-progress-EbvmIh4i.js";import{r as Pa,A as mt,q as ht}from"../packem_shared/advisories-DS8JEB_g.js";import{l as Da,f as La,a as Ma}from"../packem_shared/dependency-scan-s2MD0vi-.js";import{r as Ta}from"../packem_shared/manifests-Z3spBpxv.js";import{l as Va,p as za,O as Wa}from"../packem_shared/osv-bloom-QSAn2Dcw.js";const Jt=qt(import.meta.url),ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ie=R(e=>{if(typeof ce<"u"&&ce.versions&&ce.versions.node){const[t,a]=ce.versions.node.split(".").map(Number);if(t>22||t===22&&a>=3||t===20&&a>=16)return ce.getBuiltinModule(e)}return Jt(e)},"__cjs_getBuiltinModule"),{spawnSync:Yt}=ie("node:child_process"),{existsSync:At,readFileSync:Nt,writeFileSync:Ct,renameSync:Zt,unlinkSync:Xt}=ie("node:fs"),{createInterface:Qt}=ie("node:readline"),{stripVTControlCharacters:wa}=ie("node:util"),{createHash:Ia}=ie("node:crypto"),{relative:Ot,join:Ea}=ie("node:path");var _a=Object.defineProperty,Fa=R((e,t)=>_a(e,"name",{value:t,configurable:!0}),"t$1"),Ua=Object.defineProperty,Ha=Fa((e,t)=>Ua(e,"name",{value:t,configurable:!0}),"s"),Ga=Object.defineProperty,Ba=Ha((e,t)=>Ga(e,"name",{value:t,configurable:!0}),"n");const vt=Ba((e,t={})=>{Array.isArray(t.extensions)||(t.extensions=["js","mjs","cjs","ts"]);const a=[];for(const i of ta(e,t))a.push(i.path);return a},"collectSync");var Ka=Object.defineProperty,H=R((e,t)=>Ka(e,"name",{value:t,configurable:!0}),"a$1");const Oe=H(e=>`${e.packageName}@${e.packageVersion}:${e.vulnerability.id}`,"explainKey"),qa=H(e=>e==null||e===!0||e===""||e==="true"||e.toString().toLowerCase()==="all","isSelectAll"),Ja=H((e,t)=>{if(qa(t))return e;const a=String(t).trim();if(/^\d+$/.test(a)){const r=Number.parseInt(a,10)-1,n=e[r];return n?[n]:[]}const i=a.toLowerCase();return e.filter(r=>{const{aliases:n,id:o}=r.vulnerability;return o.toLowerCase()===i||(n??[]).some(c=>c.toLowerCase()===i)})},"selectTargets"),Ya=H(e=>{const{packageName:t,packageVersion:a,vulnerability:i}=e,r=(i.aliases??[]).join(", ")||"none",n=(i.fixedVersions??[]).join(", ")||"no fixed version published";return`You are a security engineer. Explain this dependency vulnerability for a developer triaging it.
2
-
3
- Package: ${t}@${a}
4
- Advisory: ${i.id} (aliases: ${r})
5
- Severity: ${i.severity}
6
- Fixed in: ${n}
7
- Summary: ${i.summary}
8
-
9
- Respond ONLY with valid JSON in this exact structure, each value 1-3 plain sentences, no markdown:
10
- {
11
- "whatItIs": "what the vulnerability is and how it is exploited",
12
- "areYouAtRisk": "what usage pattern makes an app actually exposed; be honest that lockfile presence alone is not exploitation",
13
- "whatToDo": "the concrete remediation step"
14
- }`},"buildExplainPrompt"),Ne=H(e=>wa(e).replaceAll(/[\u0000-\u0008\u000B-\u001F\u007F]/gu,"").trim(),"sanitize"),Za=H(e=>`What it is: ${e.whatItIs}
15
- Are you at risk: ${e.areYouAtRisk}
16
- What to do: ${e.whatToDo}`,"formatExplanation"),Xa=H(e=>{const t=ya(e);if(t&&typeof t=="object"){const a=t,i=typeof a.whatItIs=="string"?Ne(a.whatItIs):"",r=typeof a.areYouAtRisk=="string"?Ne(a.areYouAtRisk):"",n=typeof a.whatToDo=="string"?Ne(a.whatToDo):"";if(i||r||n)return Za({areYouAtRisk:r,whatItIs:i,whatToDo:n})}return Ne(e)},"parseExplanation"),Qa=H(async(e,t,a)=>{let i=0;const r=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){const n=i;i+=1;const o=e[n];o!==void 0&&await a(o)}});await Promise.all(r)},"mapWithConcurrency"),ei=3,ti={resolveProvider:xa,runWithRetry:ba},ai=H(async(e,t,a,i=ti)=>{const r=new Map;if(e.length===0)return r;const n=i.resolveProvider(t);if(!n)return a?.info?.("No AI CLI provider found on PATH — skipping --explain."),r;const o=aa("security",t?.cacheTtl);return await Qa(e,ei,async c=>{const l=Oe(c),d=ia({id:c.vulnerability.id,kind:"audit-explain",name:c.packageName,provider:n.name,version:c.packageVersion}),m=ra(d);if(typeof m=="string"){r.set(l,m);return}try{const b=await i.runWithRetry(n,Ya(c)),h=Xa(b);h&&(r.set(l,h),na(d,h,o))}catch(b){const h=b instanceof Error?b.message:String(b);a?.warn?.(`Explain failed for ${c.vulnerability.id} (${h}).`)}}),r},"explainFindings");var ii=Object.defineProperty,Y=R((e,t)=>ii(e,"name",{value:t,configurable:!0}),"o$2");const Pe=Y(e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[],"toStringArray"),Be=Y((e,t)=>{for(const a of t)if(a===e||a.endsWith("*")&&e.startsWith(a.slice(0,-1)))return!0;return!1},"matchesGlobList"),Pt=Y(e=>{const t=U(e,"pnpm-workspace.yaml");if(!ae(t))return{excludedPackages:[],ignoredAdvisories:[]};try{const a=Ye(t);return{excludedPackages:[],ignoredAdvisories:[...Pe(a?.auditConfig?.ignoreCves),...Pe(a?.auditConfig?.ignoreGhsas)]}}catch{return{excludedPackages:[],ignoredAdvisories:[]}}},"readPnpmAuditExclusions"),Dt=Y(e=>{const t=U(e,".yarnrc.yml");if(!ae(t))return{excludedPackages:[],ignoredAdvisories:[]};try{const a=Ye(t);return{excludedPackages:Pe(a?.npmAuditExcludePackages),ignoredAdvisories:Pe(a?.npmAuditIgnoreAdvisories)}}catch{return{excludedPackages:[],ignoredAdvisories:[]}}},"readYarnAuditExclusions"),ri=Y((e,t)=>{switch(t){case"pnpm":return Pt(e);case"yarn":return Dt(e);default:return{excludedPackages:[],ignoredAdvisories:[]}}},"readNativeAuditExclusions"),de=Y((e,t,a)=>{if(Be(e,t.ignoredAdvisories))return!0;if(a){for(const i of a)if(Be(i,t.ignoredAdvisories))return!0}return!1},"isAdvisoryExcluded"),ni=Y((e,t)=>Be(e,t.excludedPackages),"isPackageExcluded"),oi=Y((e,t,a)=>{if(a.length===0)return["No advisory IDs to sync."];const i=[];switch(e){case"bun":{i.push(`bun has no audit config file. Use CLI flags: bun audit ${a.map(r=>`--ignore ${r}`).join(" ")}`);break}case"npm":{i.push("npm has no native audit exclusion config. vis accepted risks are the only layer.");break}case"pnpm":{const r=U(t,"pnpm-workspace.yaml");if(!ae(r)){i.push("pnpm-workspace.yaml not found. Cannot sync.");break}const n=Pt(t),o=new Set(n.ignoredAdvisories.filter(g=>g.startsWith("CVE-"))),c=new Set(n.ignoredAdvisories.filter(g=>g.startsWith("GHSA-"))),l=a.filter(g=>g.startsWith("CVE-")),d=a.filter(g=>g.startsWith("GHSA-")),m=[...new Set([...o,...l])],b=[...new Set([...c,...d])],h=l.filter(g=>!o.has(g)).length,w=d.filter(g=>!c.has(g)).length;if(h===0&&w===0){i.push("All advisory IDs already present in pnpm-workspace.yaml.");break}let y=Ee(r);if(m.length>0){const g=` ignoreCves:
17
- ${m.map($=>` - ${$}`).join(`
18
- `)}
19
- `;/auditConfig:/.test(y)?y=/ignoreCves:/.test(y)?y.replace(/ignoreCves:\s*\n(?:\s+-\s+(?:\S.*|[\t\v\f \u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])\n)*/,g):y.replace(/auditConfig:\s*\n/,`auditConfig:
20
- ${g}`):y=`${y.trimEnd()}
21
-
22
- auditConfig:
23
- ${g}`,h>0&&i.push(`Added ${String(h)} new CVE${h===1?"":"s"} to pnpm-workspace.yaml (${String(m.length)} total)`)}if(b.length>0){const g=` ignoreGhsas:
24
- ${b.map($=>` - ${$}`).join(`
25
- `)}
26
- `;/auditConfig:/.test(y)&&(y=/ignoreGhsas:/.test(y)?y.replace(/ignoreGhsas:\s*\n(?:\s+-\s+(?:\S.*|[\t\v\f \u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])\n)*/,g):y.replace(/(auditConfig:[\s\S]*?)(\n\S|\n?$)/m,`$1${g}$2`)),w>0&&i.push(`Added ${String(w)} new GHSA${w===1?"":"s"} to pnpm-workspace.yaml (${String(b.length)} total)`)}ft(r,y);break}case"yarn":{const r=U(t,".yarnrc.yml");if(!ae(r)){i.push(".yarnrc.yml not found. Cannot sync.");break}const n=Dt(t),o=new Set(n.ignoredAdvisories),c=[...new Set([...o,...a])],l=a.filter(b=>!o.has(b)).length;if(l===0){i.push("All advisory IDs already present in .yarnrc.yml.");break}let d=Ee(r);const m=`npmAuditIgnoreAdvisories:
27
- ${c.map(b=>` - "${b}"`).join(`
28
- `)}
29
- `;d=/npmAuditIgnoreAdvisories:/.test(d)?d.replace(/npmAuditIgnoreAdvisories:\s*\n(?:\s+-\s+(?:\S.*|[\t\v\f \u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])\n)*/,m):`${d.trimEnd()}
30
-
31
- ${m}`,ft(r,d),i.push(`Synced ${String(l)} advisor${l===1?"y":"ies"} to .yarnrc.yml (${String(c.length)} total)`);break}default:i.push(`Unknown package manager: ${e}`)}return i},"syncAcceptedRisksToNativeConfig");var si=Object.defineProperty,ci=R((e,t)=>si(e,"name",{value:t,configurable:!0}),"c$3");const li="1.0",pi=ci(e=>{const{bloomHits:t,duplicates:a,explanations:i,filtered:r,now:n,packagesScanned:o,policyDecisions:c,tool:l,unknownPolicyTokens:d,workspaceRoot:m}=e,b=r.map(g=>({acceptedRisk:g.acceptedRisk??null,dependencyPaths:g.dependencyPaths?g.dependencyPaths.map($=>$.map(x=>({name:x.name,version:x.version}))):[],name:g.name,socketAlerts:g.socketReport?.alerts??[],socketScore:g.socketReport?.score.overall??null,version:g.version,vulnerabilities:g.vulnerabilities.map($=>{const x=i.get(Oe({packageName:g.name,packageVersion:g.version,vulnerability:$}));return x?{...$,explanation:x}:{...$}})})),h=c.map(g=>({acceptedRisk:g.acceptedRisk??null,data:g.data??null,packageName:g.packageName,policy:g.policy,reason:g.reason,severity:g.severity,version:g.version})),w={accepted:b.filter(g=>g.acceptedRisk!==null).length,duplicatePackages:a.length,issues:b.filter(g=>g.acceptedRisk===null).length,policyBlocks:h.filter(g=>g.severity==="block"&&g.acceptedRisk===null).length,policyDecisions:h.length,total:b.length},y=d.map(g=>({kind:"unknown-policy",token:g}));return{bloomHits:t.map(g=>({name:g.name,version:g.version})),duplicates:a.map(g=>({name:g.name,versionCount:g.versions.length,versions:[...g.versions]})),generatedAt:(n??new Date).toISOString(),packages:o,policies:h,results:b,schemaVersion:li,summary:w,tool:l,warnings:y,workspaceRoot:m}},"buildAuditReport");var di=Object.defineProperty,te=R((e,t)=>di(e,"name",{value:t,configurable:!0}),"r");const gi=["CRITICAL","HIGH","MODERATE","LOW","UNKNOWN"],ui={CRITICAL:"error",HIGH:"error",LOW:"note",MODERATE:"warning",UNKNOWN:"none"},fi={CRITICAL:"critical",HIGH:"high",LOW:"low",MODERATE:"medium",UNKNOWN:"none"},mi={CRITICAL:9.5,HIGH:8,LOW:2.5,MODERATE:5.5,UNKNOWN:0},hi=te(e=>ui[e],"severityToSarifLevel"),Ke=te(e=>fi[e],"severityLabel"),vi=te(e=>mi[e],"severityFallbackScore"),Ze=te(e=>typeof e.cvssScore=="number"&&Number.isFinite(e.cvssScore)?e.cvssScore:vi(e.severity),"cvssScore"),wi=te(e=>Ze(e).toFixed(1),"securitySeverityString"),V=te(e=>e.startsWith("CVE-")?`https://nvd.nist.gov/vuln/detail/${e}`:e.startsWith("GHSA-")?`https://github.com/advisories/${e}`:`https://osv.dev/vulnerability/${e}`,"advisoryUri"),je=te(e=>e.startsWith("CVE-")?"NVD":e.startsWith("GHSA-")?"GitHub Advisory Database":"OSV","advisorySourceName");var yi=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
32
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-light:300;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--leading-tight:1.25;--leading-snug:1.375;--radius-sm:.25rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--critical:#d71921;--high:#8a5a00;--medium:#555;--low:#707070;--unknown:#707070;--major:#d71921;--minor:#1f7a3d;--mono:ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;--sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif}@media (prefers-color-scheme:dark){:root{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--critical:#ff4d54;--high:#e0b860;--medium:#b8b8b8;--low:#8a8a8a;--unknown:#8a8a8a;--major:#ff4d54;--minor:#6dbf80}}html[data-theme=light]{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--critical:#d71921;--high:#8a5a00;--medium:#555;--low:#707070;--unknown:#707070;--major:#d71921;--minor:#1f7a3d}html[data-theme=dark]{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--critical:#ff4d54;--high:#e0b860;--medium:#b8b8b8;--low:#8a8a8a;--unknown:#8a8a8a;--major:#ff4d54;--minor:#6dbf80}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{font-family:var(--sans);background-color:var(--bg);background-image:radial-gradient(circle, var(--border) .5px, transparent .5px);color:var(--fg);-webkit-font-smoothing:antialiased;font-feature-settings:"ss01";background-size:14px 14px;margin:0;padding:24px;line-height:1.5}a{color:var(--link);text-decoration:none}code{font-family:var(--mono);font-size:12px}h2{font-family:var(--mono);letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin:48px 0 14px;font-size:11px;font-weight:500}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:oklch(55.1% .027 264.364);border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-color:oklch(54.6% .245 262.881);outline:2px solid #0000}input::placeholder,textarea::placeholder{color:oklch(55.1% .027 264.364);opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:oklch(54.6% .245 262.881);--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:oklch(55.1% .027 264.364);flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media (forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media (forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media (forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components{.masthead{border-bottom:1px solid var(--border)}.brand{font-family:var(--sans);color:var(--fg);font-size:clamp(30px,5vw,52px);font-weight:600}.brand .slash{color:var(--accent)}.brand .sub{font-family:var(--mono);letter-spacing:.22em;color:var(--faint)}.chip{font-family:var(--mono);letter-spacing:.08em;color:var(--muted);border:1px solid var(--border2)}.tbtn{font-family:var(--mono);letter-spacing:.08em;color:var(--muted);border:1px solid var(--border2);transition:border-color .2s,color .2s}.tbtn:hover{color:var(--fg);border-color:var(--fg)}.tbtn-theme{min-width:28px}.tbtn-theme .ticon{line-height:0}.tbtn-theme .ticon-sun{display:none}@media (prefers-color-scheme:dark){.tbtn-theme .ticon-moon{display:none}.tbtn-theme .ticon-sun{display:inline-flex}}html[data-theme=light] .tbtn-theme .ticon-moon{display:inline-flex}html[data-theme=light] .tbtn-theme .ticon-sun,html[data-theme=dark] .tbtn-theme .ticon-moon{display:none}html[data-theme=dark] .tbtn-theme .ticon-sun{display:inline-flex}.verdict{padding:56px 0 36px}.verdict .vnum{font-family:var(--mono);letter-spacing:-.04em;color:var(--fg);font-variant-numeric:tabular-nums;font-size:clamp(64px,14vw,148px);line-height:.85}.verdict .vsub{font-family:var(--mono);letter-spacing:.16em;color:var(--faint)}.verdict-crit .vnum{color:var(--accent)}.verdict-high .vnum{color:var(--high)}.debugbar{border-bottom:1px solid var(--border)}.dseg+.dseg{border-left:1px solid var(--border);padding-left:1.75rem}.dseg .dk{font-family:var(--mono);letter-spacing:.13em;color:var(--faint)}.dseg .dv{font-family:var(--mono);color:var(--fg);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-weight:400}.dseg .dvsep{color:var(--faint)}.dseg .dot{background:var(--unknown)}.dseg-critical .dv{color:var(--critical)}.dseg-high .dv{color:var(--high)}.dseg-moderate .dv{color:var(--medium)}.dseg-low .dv{color:var(--low)}.dseg-ok .dot{background:var(--minor)}.dseg-ok .dv,.dseg-fixable .dv{color:var(--minor)}.field{border-bottom:1px solid var(--border2);background:0 0;transition:border-color .2s}.field:focus-within{border-bottom-color:var(--fg)}.field .prompt{font-family:var(--mono);letter-spacing:.12em;color:var(--faint)}.field input,.field select{font-family:var(--mono);color:var(--fg)}.field.sel{margin-left:32px}.field select{text-transform:uppercase;letter-spacing:.06em;font-size:11px}.field select option{background:var(--panel);color:var(--fg);text-transform:none;letter-spacing:0}.field input::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.06em;font-size:11px}#findings{border-collapse:collapse}#findings thead th{font-family:var(--mono);letter-spacing:.11em;color:var(--faint);background:var(--bg);border-bottom:1px solid var(--border2)}#findings td,#findings tbody tr:last-child td{border-bottom:1px solid var(--border)}.finding-row:hover td{background:var(--row-hover)}.sev-cell{box-shadow:inset 2px 0 0 var(--border2)}tr[data-severity=CRITICAL] .sev-cell{box-shadow:inset 2px 0 0 var(--critical)}tr[data-severity=HIGH] .sev-cell{box-shadow:inset 2px 0 0 var(--high)}tr[data-severity=MODERATE] .sev-cell{box-shadow:inset 2px 0 0 var(--medium)}tr[data-severity=LOW] .sev-cell{box-shadow:inset 2px 0 0 var(--low)}tr[data-severity=UNKNOWN] .sev-cell{box-shadow:inset 2px 0 0 var(--unknown)}.ack-row td{opacity:.4}.ack-row .summary-cell,.ack-row a{color:var(--muted)}code.pkg{color:var(--fg)}code.ver,code.fix{color:var(--muted)}code.fix{color:var(--minor)}code.copyable{cursor:copy;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1);white-space:nowrap;color:var(--fg);border:1px solid var(--border2);background:0 0;border-radius:3px;font-size:12px;transition:border-color .2s,color .2s;display:inline-block}code.copyable:hover{border-color:var(--fg)}code.copyable.copied{color:var(--minor);border-color:var(--minor)}.adv-cell a{font-family:var(--mono);color:var(--link);border-bottom:1px solid #0000;transition:border-color .2s}.adv-cell a:hover{border-bottom-color:var(--link)}.summary-cell{font-family:var(--sans);color:var(--muted);line-height:1.5}.muted{font-family:var(--mono);letter-spacing:.06em;color:var(--faint)}.ack{font-family:var(--mono);letter-spacing:.12em;color:var(--faint);border:1px solid var(--border2)}.badge{font-family:var(--mono);letter-spacing:.1em;border:1px solid}.badge:before{content:"";background:currentColor;width:5px;height:5px}.badge-critical{color:var(--critical)}.badge-high{color:var(--high)}.badge-moderate{color:var(--medium)}.badge-low{color:var(--low)}.badge-unknown{color:var(--unknown)}.marker{font-family:var(--mono);letter-spacing:.09em}.marker-major{color:var(--major)}.marker-minor-patch{color:var(--minor)}.marker-unknown{color:var(--unknown)}.empty{font-family:var(--mono);letter-spacing:.1em;color:var(--faint);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}.clean{padding-top:96px;padding-bottom:96px}.clean .big{font-family:var(--mono);letter-spacing:-.03em;color:var(--fg);font-size:clamp(56px,12vw,128px);line-height:1}.clean .sub{font-family:var(--mono);letter-spacing:.16em;color:var(--faint)}#policies{border-collapse:collapse}#policies th{font-family:var(--mono);letter-spacing:.12em;color:var(--faint);background:var(--bg);border-bottom:1px solid var(--border2)}#policies td,#policies tr:last-child td{border-bottom:1px solid var(--border)}#policies code{letter-spacing:.04em;color:var(--muted)}.policy-badge{font-family:var(--mono);letter-spacing:.1em;border:1px solid}.policy-badge:before{content:"";background:currentColor;width:5px;height:5px}.policy-block{color:var(--accent)}.policy-warn{color:var(--high)}.policy-info{color:var(--muted)}.hint{font-family:var(--mono);letter-spacing:.1em;color:var(--faint)}.kbd{font-family:var(--mono);letter-spacing:.06em;color:var(--muted);background:var(--panel2);border:1px solid var(--border2)}.explain-row td{border-top:1px dotted var(--accent);border-bottom:1px solid var(--border);box-shadow:inset 2px 0 0 var(--accent);background:0 0}.finding-row:has(+.explain-row) td{border-bottom:none}.explain-row details{background:0 0}.explain-row summary::-webkit-details-marker{display:none}.intel-tag{font-family:var(--mono);letter-spacing:.16em;color:var(--accent)}.intel-hint{font-family:var(--mono);letter-spacing:.1em;color:var(--muted)}.explain-row details[open] summary .intel-hint:after{content:" [-]"}.explain-row details:not([open]) summary .intel-hint:after{content:" [+]"}.explain-body{animation:.2s both rise}.intel-key{font-family:var(--mono);letter-spacing:.12em;color:var(--accent)}.intel-val{font-family:var(--sans);color:var(--fg);line-height:1.55}.intel-prose{color:var(--muted);grid-template-columns:1fr}.intel-prose .intel-val{color:var(--muted)}.sig{font-family:var(--mono);letter-spacing:.1em;color:var(--faint);border-top:1px solid var(--border)}.sig b{color:var(--muted);font-weight:500}.sig-by{color:var(--muted)}.anolilab-logo{width:auto;height:13px;fill:var(--fg)}.anolilab-accent{fill:#dfff1b}@keyframes rise{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){.explain-body{animation:none}}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:calc(var(--spacing) * 0)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.z-20{z-index:20}.z-30{z-index:30}.z-\\[2\\]{z-index:2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-12{margin-inline:calc(var(--spacing) * 12)}.mx-\\[0\\.12em\\]{margin-inline:.12em}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-\\[7px\\]{width:7px;height:7px}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-\\[6px\\]{height:6px}.h-\\[7px\\]{height:7px}.h-\\[8px\\]{height:8px}.h-\\[10px\\]{height:10px}.h-\\[18px\\]{height:18px}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.min-h-\\[400px\\]{min-height:400px}.min-h-\\[480px\\]{min-height:480px}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-9{width:calc(var(--spacing) * 9)}.w-\\[7px\\]{width:7px}.w-\\[8px\\]{width:8px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[380px\\]{max-width:380px}.max-w-\\[1080px\\]{max-width:1080px}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[260px\\]{min-width:260px}.flex-1{flex:1}.flex-\\[1_1_280px\\]{flex:280px}.flex-auto{flex:auto}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\\[72px_1fr\\]{grid-template-columns:72px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-16{gap:calc(var(--spacing) * 16)}.gap-\\[0\\.65rem\\]{gap:.65rem}.gap-\\[2px\\]{gap:2px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\\[5px\\]{padding-inline:5px}.px-\\[6px\\]{padding-inline:6px}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-\\[3px\\]{padding-block:3px}.py-px{padding-block:1px}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-7{padding-top:calc(var(--spacing) * 7)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pl-0{padding-left:calc(var(--spacing) * 0)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-\\[7px\\]{padding-left:7px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[28px\\]{font-size:28px}.text-\\[44px\\]{font-size:44px}.text-\\[72px\\]{font-size:72px}.text-\\[clamp\\(28px\\,5vw\\,52px\\)\\]{font-size:clamp(28px,5vw,52px)}.leading-\\[0\\.9\\]{--tw-leading:.9;line-height:.9}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\\[0\\.11em\\]{--tw-tracking:.11em;letter-spacing:.11em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.15em\\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\\[0\\.16em\\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\\[0\\.22em\\]{--tw-tracking:.22em;letter-spacing:.22em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.opacity-40{opacity:.4}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_4px_12px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_8px_24px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-0{outline-style:var(--tw-outline-style);outline-width:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.group-data-\\[state\\=off\\]\\:opacity-30:is(:where(.group)[data-state=off] *){opacity:.3}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:calc(var(--spacing) * 0)}.before\\:content-\\[\\'→\\'\\]:before{--tw-content:"→";content:var(--tw-content)}.after\\:ml-auto:after{content:var(--tw-content);margin-left:auto}.after\\:font-mono:after{content:var(--tw-content);font-family:var(--font-mono)}.after\\:text-\\[9px\\]:after{content:var(--tw-content);font-size:9px}.after\\:tracking-\\[0\\.1em\\]:after{content:var(--tw-content);--tw-tracking:.1em;letter-spacing:.1em}.after\\:content-\\[\\'ON\\'\\]:after{--tw-content:"ON";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-90:hover{opacity:.9}}.focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-40:disabled{opacity:.4}.data-\\[open\\=false\\]\\:hidden[data-open=false]{display:none}.data-\\[pinned\\=true\\]\\:pointer-events-auto[data-pinned=true]{pointer-events:auto}.data-\\[state\\=off\\]\\:line-through[data-state=off]{text-decoration-line:line-through}.data-\\[state\\=off\\]\\:after\\:content-\\[\\'OFF\\'\\][data-state=off]:after{--tw-content:"OFF";content:var(--tw-content)}@media (min-width:40rem){.sm\\:min-w-\\[320px\\]{min-width:320px}}@media (min-width:48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\\:grid-cols-\\[1\\.4fr_1fr\\]{grid-template-columns:1.4fr 1fr}}.\\[\\&_svg\\]\\:size-\\[14px\\] svg{width:14px;height:14px}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_tr\\]\\:border-b-0 tr{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\\[\\&\\>\\*\\+\\*\\]\\:ml-6>*+*{margin-left:calc(var(--spacing) * 6)}.\\[\\&\\>\\*\\+\\*\\]\\:border-l>*+*{border-left-style:var(--tw-border-style);border-left-width:1px}.\\[\\&\\>\\*\\+\\*\\]\\:pl-6>*+*{padding-left:calc(var(--spacing) * 6)}.\\[\\&\\>td\\]\\:border-b>td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}`,bi=Object.defineProperty,ee=R((e,t)=>bi(e,"name",{value:t,configurable:!0}),"d$1");const xi=yi,S=ee(e=>e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;"),"escapeHtml"),ki={major:"major bump","minor-patch":"safe",unknown:"no fix"},$i=ee((e,t)=>{if(t.length===0)return{kind:"unknown",label:"no fix"};const a=T.coerce(e);if(!a)return{kind:"unknown",label:"non-semver"};let i,r;for(const n of t){const o=T.coerce(n);if(!o)continue;const c=T.diff(a,o);c==="major"||c==="premajor"?i||(i=n):(c==="minor"||c==="patch"||c==="preminor"||c==="prepatch")&&!r&&(r=n)}return r?{kind:"minor-patch",label:`safe to ${r}`}:i?{kind:"major",label:`requires major bump to ${i}`}:{kind:"unknown",label:"no usable fix"}},"breakingMarker"),Si=new Map([["are you at risk","RISK"],["what it is","VECTOR"],["what to do","ACTION"]]),Ai=ee(e=>e.split(`
33
- `).map(t=>{const a=t.trim();if(!a)return"";const i=a.match(/^([^:]{2,40}):\s*(.+)$/u);if(i?.[1]&&i[2]){const r=Si.get(i[1].trim().toLowerCase())??i[1].trim().toUpperCase();return`<div class="intel-line grid grid-cols-[72px_1fr] items-start gap-4"><span class="intel-key pt-0.5 text-[9px] font-bold uppercase">${S(r)}</span><span class="intel-val text-[13px]">${S(i[2].trim())}</span></div>`}return`<div class="intel-line intel-prose grid items-start gap-4"><span class="intel-val text-[13px]">${S(a)}</span></div>`}).join(""),"renderExplanation"),Ni='<svg class="ticon-svg" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>',Ci='<svg class="ticon-svg" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32 1.41-1.41"/></svg>',K="px-3 py-3 text-left align-middle",q="sticky top-0 z-[2] px-3 py-3 text-left text-[10px] font-medium uppercase whitespace-nowrap select-none",J="px-3 py-3 text-left text-[10px] font-medium uppercase",ji=ee(e=>`<ul class="dep-paths flex flex-col gap-2 px-3 py-3">${e.map(t=>`<li class="dep-path flex flex-wrap items-center gap-y-1">${t.map((a,i)=>{const r=`${a.name}@${a.version}`,n=i<t.length-1?'<span class="dep-arrow muted px-1">→</span>':"";return`<code class="dep-node text-[12px]">${S(r)}</code>${n}`}).join("")}</li>`).join("")}</ul>`,"renderDependencyPaths"),Ri=ee(e=>{const{acknowledged:t,dependencyPaths:a,explanation:i,packageName:r,packageVersion:n,remediation:o,vulnerability:c}=e,{severity:l}=c,d=$i(n,c.fixedVersions),m=c.fixedVersions.length>0?c.fixedVersions.join(", "):"—",b=o?`<code class="copyable" data-cmd="${S(o)}" title="Click to copy">${S(o)}</code>`:'<span class="muted">advisory only</span>',h=`data-severity="${l}" data-package="${S(r)}" data-advisory="${S(c.id)}"`,w=`<tr class="${t?"finding-row ack-row":"finding-row"}" ${h}>
34
- <td class="sev-cell whitespace-nowrap ${K}"><span class="badge badge-${l.toLowerCase()} inline-flex items-center gap-[7px] rounded-[3px] py-1 pr-2 pl-[7px] text-[9px] font-bold uppercase">${l}</span></td>
35
- <td class="${K}"><span class="marker marker-${d.kind} inline-block whitespace-nowrap align-middle text-[9px] font-bold uppercase" title="${S(d.label)}">${ki[d.kind]}</span></td>
36
- <td class="${K}"><code class="pkg font-medium">${S(r)}</code></td>
37
- <td class="${K}"><code class="ver whitespace-nowrap">${S(n)}</code></td>
38
- <td class="adv-cell whitespace-nowrap ${K}"><a href="${S(V(c.id))}" class="text-[12px] no-underline" rel="noreferrer noopener" target="_blank">${S(c.id)}</a>${t?' <span class="ack ml-2 inline-block px-[5px] py-px text-[9px] uppercase">acknowledged</span>':""}</td>
39
- <td class="summary-cell ${K} min-w-[220px] text-[13px]">${S(c.summary)}</td>
40
- <td class="${K}"><code class="fix whitespace-nowrap">${S(m)}</code></td>
41
- <td class="${K}">${b}</td>
42
- </tr>`,y=a&&a.length>0?`<tr class="paths-row" ${h}>
43
- <td colspan="8" class="p-0"><details><summary class="flex cursor-pointer items-center gap-3 px-3 py-2 select-none"><span class="intel-tag text-[9px] font-bold uppercase">[ DEPENDENCY PATHS ]</span><span class="intel-hint text-[9px] uppercase">${String(a.length)} root${a.length===1?"":"s"} reach this finding · click to expand</span></summary>${ji(a)}</details></td>
44
- </tr>`:"";return i?`${w}${y}
45
- <tr class="explain-row" ${h}>
46
- <td colspan="8" class="p-0"><details><summary class="flex cursor-pointer items-center gap-3 px-3 py-2 select-none"><span class="intel-tag text-[9px] font-bold uppercase">[ AI INTEL ]</span><span class="intel-hint text-[9px] uppercase">threat analysis · click to expand</span></summary><div class="explain-body grid gap-3 px-3 pt-1 pb-4">${Ai(i)}</div></details></td>
47
- </tr>`:`${w}${y}`},"renderRow"),Ii=ee(e=>{const t=e.now??new Date,a=[...e.findings].sort(Et),i={CRITICAL:0,HIGH:0,LOW:0,MODERATE:0,UNKNOWN:0};let r=0,n=0;for(const x of a)i[x.vulnerability.severity??"UNKNOWN"]+=1,x.acknowledged||(n+=1,x.vulnerability.fixedVersions.length>0&&(r+=1));const o=a.map(x=>Ri(x)).join(`
48
- `),c=a.length===0,l=gi.filter(x=>i[x]>0).map(x=>`<div class="dseg dseg-sev dseg-${x.toLowerCase()}"><span class="dk text-[10px] font-medium uppercase">${x}</span><span class="dv text-[22px]">${String(i[x])}</span></div>`),d=!c&&n>0?`<div class="dseg dseg-fixable"><span class="dk text-[10px] font-medium uppercase">fixable</span><span class="dv text-[22px]">${String(r)}<span class="dvsep mx-1 font-light">/</span>${String(n)}</span></div>`:"",m=[`<div class="dseg"><span class="dk text-[10px] font-medium uppercase">scanned</span><span class="dv text-[22px]">${String(e.packagesScanned)}</span></div>`,`<div class="dseg"><span class="dk text-[10px] font-medium uppercase">findings</span><span class="dv text-[22px]"><span id="shown">${String(a.length)}</span>${c?"":`<span class="dvsep mx-1 font-light">/</span>${String(a.length)}`}</span></div>`,d,l.length>0?'<span class="flex-auto"></span>':"",...l,c?'<div class="dseg dseg-ok"><span class="dot inline-block size-[7px] self-center"></span><span class="dk text-[10px] font-medium uppercase">status</span><span class="dv text-[22px]">CLEAN</span></div>':""].join(""),b=c?"ok":i.CRITICAL>0?"crit":i.HIGH>0?"high":"warn",h=[...e.report?.duplicates??[]].sort((x,j)=>x.name.localeCompare(j.name)),w=h.map(x=>`<tr>
49
- <td class="px-3 py-3 align-top"><code class="font-medium">${S(x.name)}</code></td>
50
- <td class="px-3 py-3 align-top text-[12px] font-medium tabular-nums">${String(x.versionCount)}</td>
51
- <td class="px-3 py-3 align-top"><code class="text-[12px]">${x.versions.map(j=>S(j)).join(", ")}</code></td>
52
- </tr>`).join(`
53
- `),y=(e.policyDecisions??[]).filter(x=>x.policy!=="vulnerability"),g=[...y].sort((x,j)=>{const M=ee(fe=>fe==="block"?0:fe==="warn"?1:2,"rank");return M(x.severity)-M(j.severity)||x.policy.localeCompare(j.policy)||x.packageName.localeCompare(j.packageName)}).map(x=>{const j=x.acceptedRisk?' <span class="ack ml-2 inline-block px-[5px] py-px text-[9px] uppercase">[acknowledged]</span>':"";return`<tr>
54
- <td class="px-3 py-3 align-top"><span class="policy-badge policy-${x.severity} inline-flex items-center gap-[7px] rounded-[3px] py-1 pr-2 pl-[7px] text-[10px] font-bold uppercase">${x.severity.toUpperCase()}</span></td>
55
- <td class="px-3 py-3 align-top"><code class="uppercase">${S(x.policy)}</code></td>
56
- <td class="px-3 py-3 align-top"><code class="uppercase">${S(x.packageName)}</code></td>
57
- <td class="px-3 py-3 align-top"><code class="uppercase">${S(x.version)}</code></td>
58
- <td class="px-3 py-3 align-top">${S(x.reason)}${j}</td>
59
- </tr>`}).join(`
60
- `),$=e.report?`
61
- <script type="application/json" id="vis-audit-report">${JSON.stringify(e.report).replaceAll("</","<\\/")}<\/script>`:"";return`<!doctype html>
1
+ var Br=Object.defineProperty;var m=(n,e)=>Br(n,"name",{value:e,configurable:!0});import{createRequire as Hr}from"node:module";import{E as ie,j as le,q as bt}from"../packem_shared/index.server-B7ETiT4C.js";import{projectGraphToDot as Yr}from"@visulima/task-runner";import{render as Qr}from"@visulima/tui";import{au as wt,C as Jr,S as Zr,s as ei}from"./bin.js";import ti,{useSyncExternalStore as ri,useState as et,useRef as yt,useMemo as tt,useCallback as vt,useEffect as ii}from"react";import{g as di}from"../packem_shared/index-efSniSRN.js";import{d as ci}from"../packem_shared/anolilab-text-CAM_E6uK.js";import{jsx as y,jsxs as E}from"react/jsx-runtime";import{Box as G}from"@visulima/tui/components/box";import{Dialog as li}from"@visulima/tui/components/dialog";import{Text as w}from"@visulima/tui/components/text";import{useApp as hi}from"@visulima/tui/hooks/use-app";import{useInput as pi}from"@visulima/tui/hooks/use-input";import{useWindowSize as ui}from"@visulima/tui/hooks/use-window-size";import{ScrollView as gi}from"@visulima/tui/components/scroll-view";import{ScrollBar as fi}from"@visulima/tui/components/scroll-bar";const Vr=Hr(import.meta.url),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qe=m(n=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[e,t]=De.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return De.getBuiltinModule(n)}return Vr(n)},"__cjs_getBuiltinModule"),{readFileSync:Kr,writeFileSync:Xr}=qe("node:fs"),{createRequire:ni}=qe("node:module"),{join:oi,dirname:ai}=qe("node:path"),{EventEmitter:si}=qe("events");var mi=Object.defineProperty,b=m((n,e)=>mi(n,"name",{value:e,configurable:!0}),"h");function Tt(){const n=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const r in arguments[e])n[r]=arguments[e][r];return n}m(Tt,"ft");b(Tt,"assignPolyfill");let V=Tt;typeof Object.assign=="function"&&(V=Object.assign);function ee(n,e,t,r){const i=n._nodes.get(e);let o=null;return i&&(r==="mixed"?o=i.out&&i.out[t]||i.undirected&&i.undirected[t]:r==="directed"?o=i.out&&i.out[t]:o=i.undirected&&i.undirected[t]),o}m(ee,"D$1");b(ee,"getMatchingEdge");function K(n){return typeof n=="object"&&n!==null}m(K,"G$1");b(K,"isPlainObject");function ct(n){let e;for(e in n)return!1;return!0}m(ct,"tt");b(ct,"isEmpty");function Z(n,e,t){Object.defineProperty(n,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}m(Z,"x");b(Z,"privateProperty");function re(n,e,t){const r={enumerable:!0,configurable:!0};typeof t=="function"?r.get=t:(r.value=t,r.writable=!1),Object.defineProperty(n,e,r)}m(re,"A$1");b(re,"readOnlyProperty");function at(n){return!(!K(n)||n.attributes&&!Array.isArray(n.attributes))}m(at,"Q");b(at,"validateHints");function Ot(){let n=Math.floor(Math.random()*256)&255;return()=>n++}m(Ot,"pt");b(Ot,"incrementalIdStartingFromRandomByte");function oe(){const n=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(e===null){if(t++,t>=n.length)return{done:!0};e=n[t][Symbol.iterator]()}if(r=e.next(),r.done){e=null;continue}break}while(!0);return r}}}m(oe,"N$1");b(oe,"chain");function me(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}m(me,"L$2");b(me,"emptyIterator");let lt=class extends Error{static{m(this,"P")}static{b(this,"GraphError")}constructor(e){super(),this.name="GraphError",this.message=e}},$=class zt extends lt{static{m(this,"g")}static{b(this,"InvalidArgumentsGraphError")}constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,zt.prototype.constructor)}},x=class jt extends lt{static{m(this,"p")}static{b(this,"NotFoundGraphError")}constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,jt.prototype.constructor)}},D=class Ut extends lt{static{m(this,"y")}static{b(this,"UsageGraphError")}constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ut.prototype.constructor)}};function ht(n,e){this.key=n,this.attributes=e,this.clear()}m(ht,"et");b(ht,"MixedNodeData");ht.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function pt(n,e){this.key=n,this.attributes=e,this.clear()}m(pt,"it");b(pt,"DirectedNodeData");pt.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function ut(n,e){this.key=n,this.attributes=e,this.clear()}m(ut,"nt");b(ut,"UndirectedNodeData");ut.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function be(n,e,t,r,i){this.key=e,this.attributes=i,this.undirected=n,this.source=t,this.target=r}m(be,"M$1");b(be,"EdgeData");be.prototype.attach=function(){let n="out",e="in";this.undirected&&(n=e="undirected");const t=this.source.key,r=this.target.key;this.source[n][r]=this,!(this.undirected&&t===r)&&(this.target[e][t]=this)};be.prototype.attachMulti=function(){let n="out",e="in";const t=this.source.key,r=this.target.key;this.undirected&&(n=e="undirected");const i=this.source[n],o=i[r];if(typeof o>"u"){i[r]=this,this.undirected&&t===r||(this.target[e][t]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[e][t]=this};be.prototype.detach=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),delete this.source[t][e],delete this.target[r][n]};be.prototype.detachMulti=function(){const n=this.source.key,e=this.target.key;let t="out",r="in";this.undirected&&(t=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[r][n]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[r][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Rt=0,Ft=1,bi=2,Pt=3;function ae(n,e,t,r,i,o,a){let s,d,c,p;if(r=""+r,t===Rt){if(s=n._nodes.get(r),!s)throw new x(`Graph.${e}: could not find the "${r}" node in the graph.`);c=i,p=o}else if(t===Pt){if(i=""+i,d=n._edges.get(i),!d)throw new x(`Graph.${e}: could not find the "${i}" edge in the graph.`);const l=d.source.key,u=d.target.key;if(r===l)s=d.target;else if(r===u)s=d.source;else throw new x(`Graph.${e}: the "${r}" node is not attached to the "${i}" edge (${l}, ${u}).`);c=o,p=a}else{if(d=n._edges.get(r),!d)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`);t===Ft?s=d.source:s=d.target,c=i,p=o}return[s,c,p]}m(ae,"S$2");b(ae,"findRelevantNodeData");function Wt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);return a.attributes[s]}}m(Wt,"gt");b(Wt,"attachNodeAttributeGetter");function qt(n,e,t){n.prototype[e]=function(r,i){const[o]=ae(this,e,t,r,i);return o.attributes}}m(qt,"yt");b(qt,"attachNodeAttributesGetter");function Bt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);return a.attributes.hasOwnProperty(s)}}m(Bt,"wt");b(Bt,"attachNodeAttributeChecker");function Ht(n,e,t){n.prototype[e]=function(r,i,o,a){const[s,d,c]=ae(this,e,t,r,i,o,a);return s.attributes[d]=c,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:d}),this}}m(Ht,"mt");b(Ht,"attachNodeAttributeSetter");function Vt(n,e,t){n.prototype[e]=function(r,i,o,a){const[s,d,c]=ae(this,e,t,r,i,o,a);if(typeof c!="function")throw new $(`Graph.${e}: updater should be a function.`);const p=s.attributes,l=c(p[d]);return p[d]=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:d}),this}}m(Vt,"bt");b(Vt,"attachNodeAttributeUpdater");function Kt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);return delete a.attributes[s],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:s}),this}}m(Kt,"$t");b(Kt,"attachNodeAttributeRemover");function Xt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);if(!K(s))throw new $(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=s,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}m(Xt,"Gt");b(Xt,"attachNodeAttributesReplacer");function Yt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);if(!K(s))throw new $(`Graph.${e}: provided attributes are not a plain object.`);return V(a.attributes,s),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:s}),this}}m(Yt,"Et");b(Yt,"attachNodeAttributesMerger");function Qt(n,e,t){n.prototype[e]=function(r,i,o){const[a,s]=ae(this,e,t,r,i,o);if(typeof s!="function")throw new $(`Graph.${e}: provided updater is not a function.`);return a.attributes=s(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}m(Qt,"kt");b(Qt,"attachNodeAttributesUpdater");const wi=[{name:b(n=>`get${n}Attribute`,"name"),attacher:Wt},{name:b(n=>`get${n}Attributes`,"name"),attacher:qt},{name:b(n=>`has${n}Attribute`,"name"),attacher:Bt},{name:b(n=>`set${n}Attribute`,"name"),attacher:Ht},{name:b(n=>`update${n}Attribute`,"name"),attacher:Vt},{name:b(n=>`remove${n}Attribute`,"name"),attacher:Kt},{name:b(n=>`replace${n}Attributes`,"name"),attacher:Xt},{name:b(n=>`merge${n}Attributes`,"name"),attacher:Yt},{name:b(n=>`update${n}Attributes`,"name"),attacher:Qt}];function Jt(n){wi.forEach(function({name:e,attacher:t}){t(n,e("Node"),Rt),t(n,e("Source"),Ft),t(n,e("Target"),bi),t(n,e("Opposite"),Pt)})}m(Jt,"xt");b(Jt,"attachNodeAttributesMethods");function Zt(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=ee(this,a,s,t),!o)throw new x(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}m(Zt,"Dt");b(Zt,"attachEdgeAttributeGetter");function er(n,e,t){n.prototype[e]=function(r){let i;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+arguments[1];if(i=ee(this,o,a,t),!i)throw new x(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return i.attributes}}m(er,"At");b(er,"attachEdgeAttributesGetter");function tr(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=ee(this,a,s,t),!o)throw new x(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}m(tr,"vt");b(tr,"attachEdgeAttributeChecker");function rr(n,e,t){n.prototype[e]=function(r,i,o){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,d=""+i;if(i=arguments[2],o=arguments[3],a=ee(this,s,d,t),!a)throw new x(`Graph.${e}: could not find an edge for the given path ("${s}" - "${d}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}m(rr,"Nt");b(rr,"attachEdgeAttributeSetter");function ir(n,e,t){n.prototype[e]=function(r,i,o){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,d=""+i;if(i=arguments[2],o=arguments[3],a=ee(this,s,d,t),!a)throw new x(`Graph.${e}: could not find an edge for the given path ("${s}" - "${d}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new $(`Graph.${e}: updater should be a function.`);return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}m(ir,"St");b(ir,"attachEdgeAttributeUpdater");function nr(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=ee(this,a,s,t),!o)throw new x(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}m(nr,"Ut");b(nr,"attachEdgeAttributeRemover");function or(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=ee(this,a,s,t),!o)throw new x(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!K(i))throw new $(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}m(or,"Lt");b(or,"attachEdgeAttributesReplacer");function ar(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=ee(this,a,s,t),!o)throw new x(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!K(i))throw new $(`Graph.${e}: provided attributes are not a plain object.`);return V(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}m(ar,"Mt");b(ar,"attachEdgeAttributesMerger");function sr(n,e,t){n.prototype[e]=function(r,i){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new D(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new D(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,s=""+i;if(i=arguments[2],o=ee(this,a,s,t),!o)throw new x(`Graph.${e}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(t!=="mixed")throw new D(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new x(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new $(`Graph.${e}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}m(sr,"Ct");b(sr,"attachEdgeAttributesUpdater");const yi=[{name:b(n=>`get${n}Attribute`,"name"),attacher:Zt},{name:b(n=>`get${n}Attributes`,"name"),attacher:er},{name:b(n=>`has${n}Attribute`,"name"),attacher:tr},{name:b(n=>`set${n}Attribute`,"name"),attacher:rr},{name:b(n=>`update${n}Attribute`,"name"),attacher:ir},{name:b(n=>`remove${n}Attribute`,"name"),attacher:nr},{name:b(n=>`replace${n}Attributes`,"name"),attacher:or},{name:b(n=>`merge${n}Attributes`,"name"),attacher:ar},{name:b(n=>`update${n}Attributes`,"name"),attacher:sr}];function dr(n){yi.forEach(function({name:e,attacher:t}){t(n,e("Edge"),"mixed"),t(n,e("DirectedEdge"),"directed"),t(n,e("UndirectedEdge"),"undirected")})}m(dr,"It");b(dr,"attachEdgeAttributesMethods");const vi=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function cr(n,e,t,r){let i=!1;for(const o in e){if(o===r)continue;const a=e[o];if(i=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),n&&i)return a.key}}m(cr,"Ot");b(cr,"forEachSimple");function lr(n,e,t,r){let i,o,a,s=!1;for(const d in e)if(d!==r){i=e[d];do{if(o=i.source,a=i.target,s=t(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),n&&s)return i.key;i=i.next}while(i!==void 0)}}m(lr,"Wt");b(lr,"forEachMulti");function Pe(n,e){const t=Object.keys(n),r=t.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=r)return{done:!0};const a=t[o++];if(a===e){i=void 0;continue}i=n[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}m(Pe,"K");b(Pe,"createIterator");function hr(n,e,t,r){const i=e[t];if(!i)return;const o=i.source,a=i.target;if(r(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&n)return i.key}m(hr,"Kt");b(hr,"forEachForKeySimple");function pr(n,e,t,r){let i=e[t];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),n&&o)return i.key;i=i.next}while(i!==void 0)}m(pr,"Tt");b(pr,"forEachForKeyMulti");function We(n,e){let t=n[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const i={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}m(We,"T$3");b(We,"createIteratorForKey");function ur(n,e){if(n.size===0)return[];if(e==="mixed"||e===n.type)return Array.from(n._edges.keys());const t=e==="undirected"?n.undirectedSize:n.directedSize,r=new Array(t),i=e==="undirected",o=n._edges.values();let a=0,s,d;for(;s=o.next(),s.done!==!0;)d=s.value,d.undirected===i&&(r[a++]=d.key);return r}m(ur,"Pt");b(ur,"createEdgeArray");function gt(n,e,t,r){if(e.size===0)return;const i=t!=="mixed"&&t!==e.type,o=t==="undirected";let a,s,d=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(s=a.value,i&&s.undirected!==o)continue;const{key:p,attributes:l,source:u,target:v}=s;if(d=r(p,l,u.key,v.key,u.attributes,v.attributes,s.undirected),n&&d)return p}}m(gt,"at");b(gt,"forEachEdge");function gr(n,e){if(n.size===0)return me();const t=e!=="mixed"&&e!==n.type,r=e==="undirected",i=n._edges.values();return{[Symbol.iterator](){return this},next(){let o,a;for(;;){if(o=i.next(),o.done)return o;if(a=o.value,!(t&&a.undirected!==r))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}}}}m(gr,"Ft");b(gr,"createEdgeIterator");function Be(n,e,t,r,i,o){const a=e?lr:cr;let s;if(t!=="undirected"&&(r!=="out"&&(s=a(n,i.in,o),n&&s)||r!=="in"&&(s=a(n,i.out,o,r?void 0:i.key),n&&s))||t!=="directed"&&(s=a(n,i.undirected,o),n&&s))return s}m(Be,"F$1");b(Be,"forEachEdgeForNode");function fr(n,e,t,r){const i=[];return Be(!1,n,e,t,r,function(o){i.push(o)}),i}m(fr,"Bt");b(fr,"createEdgeArrayForNode");function mr(n,e,t){let r=me();return n!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(r=oe(r,Pe(t.in))),e!=="in"&&typeof t.out<"u"&&(r=oe(r,Pe(t.out,e?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(r=oe(r,Pe(t.undirected))),r}m(mr,"Rt");b(mr,"createEdgeIteratorForNode");function He(n,e,t,r,i,o,a){const s=t?pr:hr;let d;if(e!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(d=s(n,i.in,o,a),n&&d)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==o)&&(d=s(n,i.out,o,a),n&&d))||e!=="directed"&&typeof i.undirected<"u"&&(d=s(n,i.undirected,o,a),n&&d))return d}m(He,"B");b(He,"forEachEdgeForPath");function br(n,e,t,r,i){const o=[];return He(!1,n,e,t,r,i,function(a){o.push(a)}),o}m(br,"Yt");b(br,"createEdgeArrayForPath");function wr(n,e,t,r){let i=me();return n!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&r in t.in&&(i=oe(i,We(t.in,r))),typeof t.out<"u"&&e!=="in"&&r in t.out&&(e||t.key!==r)&&(i=oe(i,We(t.out,r)))),n!=="directed"&&typeof t.undirected<"u"&&r in t.undirected&&(i=oe(i,We(t.undirected,r))),i}m(wr,"Ht");b(wr,"createEdgeIteratorForPath");function yr(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(o,a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return ur(this,r);if(arguments.length===1){o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new x(`Graph.${t}: could not find the "${o}" node in the graph.`);return fr(this.multi,r==="mixed"?this.type:r,i,s)}if(arguments.length===2){o=""+o,a=""+a;const s=this._nodes.get(o);if(!s)throw new x(`Graph.${t}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(a))throw new x(`Graph.${t}: could not find the "${a}" target node in the graph.`);return br(r,this.multi,i,s,a)}throw new $(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}m(yr,"Jt");b(yr,"attachEdgeArrayCreator");function vr(n,e){const{name:t,type:r,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(c,p,l){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return l=c,gt(!1,this,r,l);if(arguments.length===2){c=""+c,l=p;const u=this._nodes.get(c);if(typeof u>"u")throw new x(`Graph.${o}: could not find the "${c}" node in the graph.`);return Be(!1,this.multi,r==="mixed"?this.type:r,i,u,l)}if(arguments.length===3){c=""+c,p=""+p;const u=this._nodes.get(c);if(!u)throw new x(`Graph.${o}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(p))throw new x(`Graph.${o}: could not find the "${p}" target node in the graph.`);return He(!1,r,this.multi,i,u,p,l)}throw new $(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),p=c.pop();let l;if(c.length===0){let u=0;r!=="directed"&&(u+=this.undirectedSize),r!=="undirected"&&(u+=this.directedSize),l=new Array(u);let v=0;c.push((S,N,A,I,R,F,z)=>{l[v++]=p(S,N,A,I,R,F,z)})}else l=[],c.push((u,v,S,N,A,I,R)=>{l.push(p(u,v,S,N,A,I,R))});return this[o].apply(this,c),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(){const c=Array.prototype.slice.call(arguments),p=c.pop(),l=[];return c.push((u,v,S,N,A,I,R)=>{p(u,v,S,N,A,I,R)&&l.push(u)}),this[o].apply(this,c),l};const d="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[d]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new $(`Graph.${d}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new $(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,l;c.length===2?(p=c[0],l=c[1],c=[]):c.length===3?(p=c[1],l=c[2],c=[c[0]]):c.length===4&&(p=c[2],l=c[3],c=[c[0],c[1]]);let u=l;return c.push((v,S,N,A,I,R,F)=>{u=p(u,v,S,N,A,I,R,F)}),this[o].apply(this,c),u}}m(vr,"Vt");b(vr,"attachForEachEdge");function xr(n,e){const{name:t,type:r,direction:i}=e,o="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(d,c,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=d,gt(!0,this,r,p);if(arguments.length===2){d=""+d,p=c;const l=this._nodes.get(d);if(typeof l>"u")throw new x(`Graph.${o}: could not find the "${d}" node in the graph.`);return Be(!0,this.multi,r==="mixed"?this.type:r,i,l,p)}if(arguments.length===3){d=""+d,c=""+c;const l=this._nodes.get(d);if(!l)throw new x(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(c))throw new x(`Graph.${o}: could not find the "${c}" target node in the graph.`);return He(!0,r,this.multi,i,l,c,p)}throw new $(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(){const d=Array.prototype.slice.call(arguments),c=d.pop();return d.push((p,l,u,v,S,N,A)=>c(p,l,u,v,S,N,A)),!!this[o].apply(this,d)};const s="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(){const d=Array.prototype.slice.call(arguments),c=d.pop();return d.push((p,l,u,v,S,N,A)=>!c(p,l,u,v,S,N,A)),!this[o].apply(this,d)}}m(xr,"qt");b(xr,"attachFindEdge");function kr(n,e){const{name:t,type:r,direction:i}=e,o=t.slice(0,-1)+"Entries";n.prototype[o]=function(a,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return me();if(!arguments.length)return gr(this,r);if(arguments.length===1){a=""+a;const d=this._nodes.get(a);if(!d)throw new x(`Graph.${o}: could not find the "${a}" node in the graph.`);return mr(r,i,d)}if(arguments.length===2){a=""+a,s=""+s;const d=this._nodes.get(a);if(!d)throw new x(`Graph.${o}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(s))throw new x(`Graph.${o}: could not find the "${s}" target node in the graph.`);return wr(r,i,d,s)}throw new $(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}m(kr,"Qt");b(kr,"attachEdgeIteratorCreator");function Er(n){vi.forEach(e=>{yr(n,e),vr(n,e),xr(n,e),kr(n,e)})}m(Er,"Xt");b(Er,"attachEdgeIterationMethods");const xi=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Le(){this.A=null,this.B=null}m(Le,"W");b(Le,"CompositeSetWrapper");Le.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};Le.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function $e(n,e,t,r,i){for(const o in r){const a=r[o],s=a.source,d=a.target,c=s===t?d:s;if(e&&e.has(c.key))continue;const p=i(c.key,c.attributes);if(n&&p)return c.key}}m($e,"I$1");b($e,"forEachInObjectOnce");function Ve(n,e,t,r,i){if(e!=="mixed"){if(e==="undirected")return $e(n,null,r,r.undirected,i);if(typeof t=="string")return $e(n,null,r,r[t],i)}const o=new Le;let a;if(e!=="undirected"){if(t!=="out"){if(a=$e(n,null,r,r.in,i),n&&a)return a;o.wrap(r.in)}if(t!=="in"){if(a=$e(n,o,r,r.out,i),n&&a)return a;o.wrap(r.out)}}if(e!=="directed"&&(a=$e(n,o,r,r.undirected,i),n&&a))return a}m(Ve,"R$1");b(Ve,"forEachNeighbor");function $r(n,e,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const r=[];return Ve(!1,n,e,t,function(i){r.push(i)}),r}m($r,"te$1");b($r,"createNeighborArrayForNode");function Ge(n,e,t){const r=Object.keys(t),i=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(o>=i)return n&&n.wrap(t),{done:!0};const s=t[r[o++]],d=s.source,c=s.target;if(a=d===e?c:d,n&&n.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}m(Ge,"j");b(Ge,"createDedupedObjectIterator");function Gr(n,e,t){if(n!=="mixed"){if(n==="undirected")return Ge(null,t,t.undirected);if(typeof e=="string")return Ge(null,t,t[e])}let r=me();const i=new Le;return n!=="undirected"&&(e!=="out"&&(r=oe(r,Ge(i,t,t.in))),e!=="in"&&(r=oe(r,Ge(i,t,t.out)))),n!=="directed"&&(r=oe(r,Ge(i,t,t.undirected))),r}m(Gr,"ee$1");b(Gr,"createNeighborIterator");function Ar(n,e){const{name:t,type:r,direction:i}=e;n.prototype[t]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const a=this._nodes.get(o);if(typeof a>"u")throw new x(`Graph.${t}: could not find the "${o}" node in the graph.`);return $r(r==="mixed"?this.type:r,i,a)}}m(Ar,"ie");b(Ar,"attachNeighborArrayCreator");function Sr(n,e){const{name:t,type:r,direction:i}=e,o="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(c,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const l=this._nodes.get(c);if(typeof l>"u")throw new x(`Graph.${o}: could not find the "${c}" node in the graph.`);Ve(!1,r==="mixed"?this.type:r,i,l,p)};const a="map"+t[0].toUpperCase()+t.slice(1);n.prototype[a]=function(c,p){const l=[];return this[o](c,(u,v)=>{l.push(p(u,v))}),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(c,p){const l=[];return this[o](c,(u,v)=>{p(u,v)&&l.push(u)}),l};const d="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[d]=function(c,p,l){if(arguments.length<3)throw new $(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let u=l;return this[o](c,(v,S)=>{u=p(u,v,S)}),u}}m(Sr,"ne");b(Sr,"attachForEachNeighbor");function Nr(n,e){const{name:t,type:r,direction:i}=e,o=t[0].toUpperCase()+t.slice(1,-1),a="find"+o;n.prototype[a]=function(c,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const l=this._nodes.get(c);if(typeof l>"u")throw new x(`Graph.${a}: could not find the "${c}" node in the graph.`);return Ve(!0,r==="mixed"?this.type:r,i,l,p)};const s="some"+o;n.prototype[s]=function(c,p){return!!this[a](c,p)};const d="every"+o;n.prototype[d]=function(c,p){return!this[a](c,(l,u)=>!p(l,u))}}m(Nr,"re");b(Nr,"attachFindNeighbor");function Cr(n,e){const{name:t,type:r,direction:i}=e,o=t.slice(0,-1)+"Entries";n.prototype[o]=function(a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return me();a=""+a;const s=this._nodes.get(a);if(typeof s>"u")throw new x(`Graph.${o}: could not find the "${a}" node in the graph.`);return Gr(r==="mixed"?this.type:r,i,s)}}m(Cr,"oe");b(Cr,"attachNeighborIteratorCreator");function _r(n){xi.forEach(e=>{Ar(n,e),Sr(n,e),Nr(n,e),Cr(n,e)})}m(_r,"se");b(_r,"attachNeighborIterationMethods");function Ie(n,e,t,r,i){const o=r._nodes.values(),a=r.type;let s,d,c,p,l,u,v;for(;s=o.next(),s.done!==!0;){let S=!1;if(d=s.value,a!=="undirected"){p=d.out;for(c in p){l=p[c];do{if(u=l.target,S=!0,v=i(d.key,u.key,d.attributes,u.attributes,l.key,l.attributes,l.undirected),n&&v)return l;l=l.next}while(l)}}if(a!=="directed"){p=d.undirected;for(c in p)if(!(e&&d.key>c)){l=p[c];do{if(u=l.target,u.key!==c&&(u=l.source),S=!0,v=i(d.key,u.key,d.attributes,u.attributes,l.key,l.attributes,l.undirected),n&&v)return l;l=l.next}while(l)}}if(t&&!S&&(v=i(d.key,null,d.attributes,null,null,null,null),n&&v))return null}}m(Ie,"O");b(Ie,"forEachAdjacency");function Dr(n,e){const t={key:n};return ct(e.attributes)||(t.attributes=V({},e.attributes)),t}m(Dr,"ae");b(Dr,"serializeNode");function Mr(n,e,t){const r={key:e,source:t.source.key,target:t.target.key};return ct(t.attributes)||(r.attributes=V({},t.attributes)),n==="mixed"&&t.undirected&&(r.undirected=!0),r}m(Mr,"ue");b(Mr,"serializeEdge");function Ir(n){if(!K(n))throw new $('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new $("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!K(n.attributes)||n.attributes===null))throw new $("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}m(Ir,"de");b(Ir,"validateSerializedNode");function Lr(n){if(!K(n))throw new $('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new $("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new $("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!K(n.attributes)||n.attributes===null))throw new $("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new $("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}m(Lr,"he");b(Lr,"validateSerializedEdge");const ki=Ot(),Ei=new Set(["directed","undirected","mixed"]),xt=new Set(["domain","_events","_eventsCount","_maxListeners"]),$i=[{name:b(n=>`${n}Edge`,"name"),generateKey:!0},{name:b(n=>`${n}DirectedEdge`,"name"),generateKey:!0,type:"directed"},{name:b(n=>`${n}UndirectedEdge`,"name"),generateKey:!0,type:"undirected"},{name:b(n=>`${n}EdgeWithKey`,"name")},{name:b(n=>`${n}DirectedEdgeWithKey`,"name"),type:"directed"},{name:b(n=>`${n}UndirectedEdgeWithKey`,"name"),type:"undirected"}],Gi={allowSelfLoops:!0,multi:!1,type:"mixed"};function Tr(n,e,t){if(t&&!K(t))throw new $(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},n._nodes.has(e))throw new D(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}m(Tr,"ge");b(Tr,"addNode");function st(n,e,t){const r=new n.NodeDataClass(e,t);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:t}),r}m(st,"Z");b(st,"unsafeAddNode");function ft(n,e,t,r,i,o,a,s){if(!r&&n.type==="undirected")throw new D(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new D(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!K(s))throw new $(`Graph.${e}: invalid attributes. Expecting an object but got "${s}"`);if(o=""+o,a=""+a,s=s||{},!n.allowSelfLoops&&o===a)throw new D(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const d=n._nodes.get(o),c=n._nodes.get(a);if(!d)throw new x(`Graph.${e}: source node "${o}" not found.`);if(!c)throw new x(`Graph.${e}: target node "${a}" not found.`);const p={key:null,undirected:r,source:o,target:a,attributes:s};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new D(`Graph.${e}: the "${i}" edge already exists in the graph.`);if(!n.multi&&(r?typeof d.undirected[a]<"u":typeof d.out[a]<"u"))throw new D(`Graph.${e}: an edge linking "${o}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const l=new be(r,i,d,c,s);n._edges.set(i,l);const u=o===a;return r?(d.undirectedDegree++,c.undirectedDegree++,u&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,c.inDegree++,u&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?l.attachMulti():l.attach(),r?n._undirectedSize++:n._directedSize++,p.key=i,n.emit("edgeAdded",p),i}m(ft,"ut");b(ft,"addEdge");function Or(n,e,t,r,i,o,a,s,d){if(!r&&n.type==="undirected")throw new D(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new D(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(d){if(typeof s!="function")throw new $(`Graph.${e}: invalid updater function. Expecting a function but got "${s}"`)}else if(!K(s))throw new $(`Graph.${e}: invalid attributes. Expecting an object but got "${s}"`)}o=""+o,a=""+a;let c;if(d&&(c=s,s=void 0),!n.allowSelfLoops&&o===a)throw new D(`Graph.${e}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=n._nodes.get(o),l=n._nodes.get(a),u,v;if(!t&&(u=n._edges.get(i),u)){if((u.source.key!==o||u.target.key!==a)&&(!r||u.source.key!==a||u.target.key!==o))throw new D(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${a}" target vs. ("${u.source.key}", "${u.target.key}").`);v=u}if(!v&&!n.multi&&p&&(v=r?p.undirected[a]:p.out[a]),v){const R=[v.key,!1,!1,!1];if(d?!c:!s)return R;if(d){const F=v.attributes;v.attributes=c(F),n.emit("edgeAttributesUpdated",{type:"replace",key:v.key,attributes:v.attributes})}else V(v.attributes,s),n.emit("edgeAttributesUpdated",{type:"merge",key:v.key,attributes:v.attributes,data:s});return R}s=s||{},d&&c&&(s=c(s));const S={key:null,undirected:r,source:o,target:a,attributes:s};if(t)i=n._edgeKeyGenerator();else if(i=""+i,n._edges.has(i))throw new D(`Graph.${e}: the "${i}" edge already exists in the graph.`);let N=!1,A=!1;p||(p=st(n,o,{}),N=!0,o===a&&(l=p,A=!0)),l||(l=st(n,a,{}),A=!0),u=new be(r,i,p,l,s),n._edges.set(i,u);const I=o===a;return r?(p.undirectedDegree++,l.undirectedDegree++,I&&(p.undirectedLoops++,n._undirectedSelfLoopCount++)):(p.outDegree++,l.inDegree++,I&&(p.directedLoops++,n._directedSelfLoopCount++)),n.multi?u.attachMulti():u.attach(),r?n._undirectedSize++:n._directedSize++,S.key=i,n.emit("edgeAdded",S),[i,!0,N,A]}m(Or,"ye");b(Or,"mergeEdge");function fe(n,e){n._edges.delete(e.key);const{source:t,target:r,attributes:i}=e,o=e.undirected,a=t===r;o?(t.undirectedDegree--,r.undirectedDegree--,a&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,r.inDegree--,a&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?e.detachMulti():e.detach(),o?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:e.key,attributes:i,source:t.key,target:r.key,undirected:o})}m(fe,"U$1");b(fe,"dropEdgeFromData");let W=class dt extends si{static{m(this,"m")}static{b(this,"Graph")}constructor(e){if(super(),e=V({},Gi,e),typeof e.multi!="boolean")throw new $(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Ei.has(e.type))throw new $(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new $(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?ht:e.type==="directed"?pt:ut;Z(this,"NodeDataClass",t);const r="geid_"+ki()+"_";let i=0;const o=b(()=>{let a;do a=r+i++;while(this._edges.has(a));return a},"edgeKeyGenerator");Z(this,"_attributes",{}),Z(this,"_nodes",new Map),Z(this,"_edges",new Map),Z(this,"_directedSize",0),Z(this,"_undirectedSize",0),Z(this,"_directedSelfLoopCount",0),Z(this,"_undirectedSelfLoopCount",0),Z(this,"_edgeKeyGenerator",o),Z(this,"_options",e),xt.forEach(a=>Z(this,a,this[a])),re(this,"order",()=>this._nodes.size),re(this,"size",()=>this._edges.size),re(this,"directedSize",()=>this._directedSize),re(this,"undirectedSize",()=>this._undirectedSize),re(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),re(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),re(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),re(this,"multi",this._options.multi),re(this,"type",this._options.type),re(this,"allowSelfLoops",this._options.allowSelfLoops),re(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(t):!1}throw new $(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(t):!1}throw new $(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,t=""+t;const r=this._nodes.get(e);return r?typeof r.out<"u"&&r.out.hasOwnProperty(t)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(t):!1}throw new $(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new D("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(e);if(!r)throw new x(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new x(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||void 0;if(i)return i.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new D("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(e);if(!r)throw new x(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new x(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const i=r.undirected&&r.undirected[t]||void 0;if(i)return i.key}edge(e,t){if(this.multi)throw new D("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new x(`Graph.edge: could not find the "${t}" target node in the graph.`);const i=r.out&&r.out[t]||r.undirected&&r.undirected[t]||void 0;if(i)return i.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in||t in r.out}areOutNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.out}areInNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in r.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in r.undirected}areNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in r.in||t in r.out)||this.type!=="directed"&&t in r.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.in||this.type!=="directed"&&t in r.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const r=this._nodes.get(e);if(!r)throw new x(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in r.out||this.type!=="directed"&&t in r.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree),r}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.outDegree),r}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=t.undirectedDegree),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree,i+=t.directedLoops),r-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.outDegree,i+=t.directedLoops),r-i}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(r+=t.inDegree+t.outDegree,i+=t.directedLoops*2),r-i}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new x(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new x(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new x(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const r=this._edges.get(t);if(!r)throw new x(`Graph.opposite: could not find the "${t}" edge in the graph.`);const i=r.source.key,o=r.target.key;if(e===i)return o;if(e===o)return i;throw new x(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${o}).`)}hasExtremity(e,t){e=""+e,t=""+t;const r=this._edges.get(e);if(!r)throw new x(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===t||r.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new x(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new x(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new x(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return Tr(this,e,t).key}mergeNode(e,t){if(t&&!K(t))throw new $(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let r=this._nodes.get(e);return r?(t&&(V(r.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.attributes,data:t})),[e,!1]):(r=new this.NodeDataClass(e,t),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new $(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let r=this._nodes.get(e);if(r){if(t){const o=r.attributes;r.attributes=t(o),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const i=t?t({}):{};return r=new this.NodeDataClass(e,i),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new x(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in t.out){r=t.out[i];do fe(this,r),r=r.next;while(r)}for(const i in t.in){r=t.in[i];do fe(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in t.undirected){r=t.undirected[i];do fe(this,r),r=r.next;while(r)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(t=ee(this,r,i,this.type),!t)throw new x(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new x(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return fe(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new D("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new D("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const r=ee(this,e,t,"directed");if(!r)throw new x(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return fe(this,r),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new D("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new D("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=ee(this,e,t,"undirected");if(!r)throw new x(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return fe(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new $("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=t(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!K(e))throw new $("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!K(e))throw new $("Graph.mergeAttributes: provided attributes are not a plain object.");return V(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new $("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new $("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!at(t))throw new $("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=e(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new $("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!at(t))throw new $("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,o,a,s;for(;i=r.next(),i.done!==!0;)o=i.value,a=o.source,s=o.target,o.attributes=e(o.key,o.attributes,a.key,s.key,a.attributes,s.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new $("Graph.forEachAdjacencyEntry: expecting a callback.");Ie(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new $("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Ie(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new $("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Ie(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new $("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Ie(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new $("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new $("Graph.findNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new $("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let r,i;const o=new Array(this.order);let a=0;for(;r=t.next(),r.done!==!0;)i=r.value,o[a++]=e(i.key,i.attributes);return o}someNode(e){if(typeof e!="function")throw new $("Graph.someNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new $("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let r,i;for(;r=t.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new $("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let r,i;const o=[];for(;r=t.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(e,t){if(typeof e!="function")throw new $("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new $("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=t;const i=this._nodes.values();let o,a;for(;o=i.next(),o.done!==!0;)a=o.value,r=e(r,a.key,a.attributes);return r}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const r=t.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((i,o)=>{e[t++]=Dr(o,i)});const r=new Array(this._edges.size);return t=0,this._edges.forEach((i,o)=>{r[t++]=Mr(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,t=!1){if(e instanceof dt)return e.forEachNode((d,c)=>{t?this.mergeNode(d,c):this.addNode(d,c)}),e.forEachEdge((d,c,p,l,u,v,S)=>{t?S?this.mergeUndirectedEdgeWithKey(d,p,l,c):this.mergeDirectedEdgeWithKey(d,p,l,c):S?this.addUndirectedEdgeWithKey(d,p,l,c):this.addDirectedEdgeWithKey(d,p,l,c)}),this;if(!K(e))throw new $("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!K(e.attributes))throw new $("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,o,a,s;if(e.nodes){if(o=e.nodes,!Array.isArray(o))throw new $("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r<i;r++){a=o[r],Ir(a);const{key:d,attributes:c}=a;t?this.mergeNode(d,c):this.addNode(d,c)}}if(e.edges){let d=!1;if(this.type==="undirected"&&(d=!0),o=e.edges,!Array.isArray(o))throw new $("Graph.import: invalid edges. Expecting an array.");for(r=0,i=o.length;r<i;r++){s=o[r],Lr(s);const{source:c,target:p,attributes:l,undirected:u=d}=s;let v;"key"in s?(v=t?u?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:u?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,v.call(this,s.key,c,p,l)):(v=t?u?this.mergeUndirectedEdge:this.mergeDirectedEdge:u?this.addUndirectedEdge:this.addDirectedEdge,v.call(this,c,p,l))}}return this}nullCopy(e){const t=new dt(V({},this._options,e));return t.replaceAttributes(V({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((r,i)=>{const o=V({},r.attributes);r=new t.NodeDataClass(i,o),t._nodes.set(i,r)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new D(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new D("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new D("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),r=this._edges.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,ft(t,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,V({},o.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((o,a)=>{e[a]=o.attributes});const t={},r={};this._edges.forEach((o,a)=>{const s=o.undirected?"--":"->";let d="",c=o.source.key,p=o.target.key,l;o.undirected&&c>p&&(l=c,c=p,p=l);const u=`(${c})${s}(${p})`;a.startsWith("geid_")?this.multi&&(typeof r[u]>"u"?r[u]=0:r[u]++,d+=`${r[u]}. `):d+=`[${a}]: `,d+=u,t[d]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!xt.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=e,i.edges=t,Z(i,"constructor",this.constructor),i}};typeof Symbol<"u"&&(W.prototype[Symbol.for("nodejs.util.inspect.custom")]=W.prototype.inspect);$i.forEach(n=>{["add","merge","update"].forEach(e=>{const t=n.name(e),r=e==="add"?ft:Or;n.generateKey?W.prototype[t]=function(i,o,a){return r(this,t,!0,(n.type||this.type)==="undirected",null,i,o,a,e==="update")}:W.prototype[t]=function(i,o,a,s){return r(this,t,!1,(n.type||this.type)==="undirected",i,o,a,s,e==="update")}})});Jt(W);dr(W);Er(W);_r(W);class zr extends W{static{m(this,"Y")}static{b(this,"DirectedGraph")}constructor(e){const t=V({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new $("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new $('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}let jr=class extends W{static{m(this,"H")}static{b(this,"UndirectedGraph")}constructor(e){const t=V({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new $("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new $('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}},Ur=class extends W{static{m(this,"J")}static{b(this,"MultiGraph")}constructor(e){const t=V({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new $("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}};class Rr extends W{static{m(this,"V")}static{b(this,"MultiDirectedGraph")}constructor(e){const t=V({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new $("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new $('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Fr extends W{static{m(this,"q")}static{b(this,"MultiUndirectedGraph")}constructor(e){const t=V({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new $("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new $('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function we(n){n.from=function(e,t){const r=V({},e.options,t),i=new n(r);return i.import(e),i}}m(we,"C$1");b(we,"attachStaticFromMethod");we(W);we(zr);we(jr);we(Ur);we(Rr);we(Fr);W.Graph=W;W.DirectedGraph=zr;W.UndirectedGraph=jr;W.MultiGraph=Ur;W.MultiDirectedGraph=Rr;W.MultiUndirectedGraph=Fr;W.InvalidArgumentsGraphError=$;W.NotFoundGraphError=x;W.UsageGraphError=D;var rt,kt;function Ai(){if(kt)return rt;kt=1;var n=Object.defineProperty,e=m((t,r)=>n(t,"name",{value:r,configurable:!0}),"e");return rt=e(function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"},"isGraph"),rt}m(Ai,"requireIsGraph");var Me={},Et;function Si(){if(Et)return Me;Et=1;var n=Object.defineProperty,e=m((o,a)=>n(o,"name",{value:a,configurable:!0}),"o");function t(o){return typeof o!="number"||isNaN(o)?1:o}m(t,"coerceWeight"),e(t,"coerceWeight");function r(o,a){var s={},d=e(function(l){return typeof l>"u"?a:l},"coerceToDefault");typeof a=="function"&&(d=a);var c=e(function(l){return d(l[o])},"get"),p=e(function(){return d(void 0)},"returnDefault");return typeof o=="string"?(s.fromAttributes=c,s.fromGraph=function(l,u){return c(l.getNodeAttributes(u))},s.fromEntry=function(l,u){return c(u)}):typeof o=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(l,u){return d(o(u,l.getNodeAttributes(u)))},s.fromEntry=function(l,u){return d(o(l,u))}):(s.fromAttributes=p,s.fromGraph=p,s.fromEntry=p),s}m(r,"createNodeValueGetter"),e(r,"createNodeValueGetter");function i(o,a){var s={},d=e(function(l){return typeof l>"u"?a:l},"coerceToDefault");typeof a=="function"&&(d=a);var c=e(function(l){return d(l[o])},"get"),p=e(function(){return d(void 0)},"returnDefault");return typeof o=="string"?(s.fromAttributes=c,s.fromGraph=function(l,u){return c(l.getEdgeAttributes(u))},s.fromEntry=function(l,u){return c(u)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof o=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(l,u){var v=l.extremities(u);return d(o(u,l.getEdgeAttributes(u),v[0],v[1],l.getNodeAttributes(v[0]),l.getNodeAttributes(v[1]),l.isUndirected(u)))},s.fromEntry=function(l,u,v,S,N,A,I){return d(o(l,u,v,S,N,A,I))},s.fromPartialEntry=function(l,u,v,S){return d(o(l,u,v,S))},s.fromMinimalEntry=function(l,u){return d(o(l,u))}):(s.fromAttributes=p,s.fromGraph=p,s.fromEntry=p,s.fromMinimalEntry=p),s}return m(i,"createEdgeValueGetter"),e(i,"createEdgeValueGetter"),Me.createNodeValueGetter=r,Me.createEdgeValueGetter=i,Me.createEdgeWeightGetter=function(o){return i(o,t)},Me}m(Si,"requireGetters");var it,$t;function Ni(){if($t)return it;$t=1;var n=Object.defineProperty,e=m((_,h)=>n(_,"name",{value:h,configurable:!0}),"$"),t=0,r=1,i=2,o=3,a=4,s=5,d=6,c=7,p=8,l=9,u=0,v=1,S=2,N=0,A=1,I=2,R=3,F=4,z=5,H=6,Q=7,J=8,Ne=3,Y=10,Ye=3,T=9,O=10;return it=e(function(_,h,ye){var Qe,k,g,P,B,he,ve,X,L,Je,ne=h.length,Wr=ye.length,Ce=_.adjustSizes,qr=_.barnesHutTheta*_.barnesHutTheta,Te,q,j,U,se,M,C,f=[];for(g=0;g<ne;g+=Y)h[g+a]=h[g+i],h[g+s]=h[g+o],h[g+i]=0,h[g+o]=0;if(_.outboundAttractionDistribution){for(Te=0,g=0;g<ne;g+=Y)Te+=h[g+d];Te/=ne/Y}if(_.barnesHutOptimize){var pe=1/0,xe=-1/0,ue=1/0,ke=-1/0,te,Ee,Ze;for(g=0;g<ne;g+=Y)pe=Math.min(pe,h[g+t]),xe=Math.max(xe,h[g+t]),ue=Math.min(ue,h[g+r]),ke=Math.max(ke,h[g+r]);var Oe=xe-pe,ze=ke-ue;for(Oe>ze?(ue-=(Oe-ze)/2,ke=ue+Oe):(pe-=(ze-Oe)/2,xe=pe+ze),f[0+N]=-1,f[0+A]=(pe+xe)/2,f[0+I]=(ue+ke)/2,f[0+R]=Math.max(xe-pe,ke-ue),f[0+F]=-1,f[0+z]=-1,f[0+H]=0,f[0+Q]=0,f[0+J]=0,Qe=1,g=0;g<ne;g+=Y)for(k=0,Ze=Ne;;)if(f[k+z]>=0){h[g+t]<f[k+A]?h[g+r]<f[k+I]?te=f[k+z]:te=f[k+z]+T:h[g+r]<f[k+I]?te=f[k+z]+T*2:te=f[k+z]+T*3,f[k+Q]=(f[k+Q]*f[k+H]+h[g+t]*h[g+d])/(f[k+H]+h[g+d]),f[k+J]=(f[k+J]*f[k+H]+h[g+r]*h[g+d])/(f[k+H]+h[g+d]),f[k+H]+=h[g+d],k=te;continue}else if(f[k+N]<0){f[k+N]=g;break}else{if(f[k+z]=Qe*T,X=f[k+R]/2,L=f[k+z],f[L+N]=-1,f[L+A]=f[k+A]-X,f[L+I]=f[k+I]-X,f[L+R]=X,f[L+F]=L+T,f[L+z]=-1,f[L+H]=0,f[L+Q]=0,f[L+J]=0,L+=T,f[L+N]=-1,f[L+A]=f[k+A]-X,f[L+I]=f[k+I]+X,f[L+R]=X,f[L+F]=L+T,f[L+z]=-1,f[L+H]=0,f[L+Q]=0,f[L+J]=0,L+=T,f[L+N]=-1,f[L+A]=f[k+A]+X,f[L+I]=f[k+I]-X,f[L+R]=X,f[L+F]=L+T,f[L+z]=-1,f[L+H]=0,f[L+Q]=0,f[L+J]=0,L+=T,f[L+N]=-1,f[L+A]=f[k+A]+X,f[L+I]=f[k+I]+X,f[L+R]=X,f[L+F]=f[k+F],f[L+z]=-1,f[L+H]=0,f[L+Q]=0,f[L+J]=0,Qe+=4,h[f[k+N]+t]<f[k+A]?h[f[k+N]+r]<f[k+I]?te=f[k+z]:te=f[k+z]+T:h[f[k+N]+r]<f[k+I]?te=f[k+z]+T*2:te=f[k+z]+T*3,f[k+H]=h[f[k+N]+d],f[k+Q]=h[f[k+N]+t],f[k+J]=h[f[k+N]+r],f[te+N]=f[k+N],f[k+N]=-1,h[g+t]<f[k+A]?h[g+r]<f[k+I]?Ee=f[k+z]:Ee=f[k+z]+T:h[g+r]<f[k+I]?Ee=f[k+z]+T*2:Ee=f[k+z]+T*3,te===Ee)if(Ze--){k=te;continue}else{Ze=Ne;break}f[Ee+N]=g;break}}if(_.barnesHutOptimize)for(q=_.scalingRatio,g=0;g<ne;g+=Y)for(k=0;;)if(f[k+z]>=0)if(M=Math.pow(h[g+t]-f[k+Q],2)+Math.pow(h[g+r]-f[k+J],2),Je=f[k+R],4*Je*Je/M<qr){if(j=h[g+t]-f[k+Q],U=h[g+r]-f[k+J],Ce===!0?M>0?(C=q*h[g+d]*f[k+H]/M,h[g+i]+=j*C,h[g+o]+=U*C):M<0&&(C=-q*h[g+d]*f[k+H]/Math.sqrt(M),h[g+i]+=j*C,h[g+o]+=U*C):M>0&&(C=q*h[g+d]*f[k+H]/M,h[g+i]+=j*C,h[g+o]+=U*C),k=f[k+F],k<0)break;continue}else{k=f[k+z];continue}else{if(he=f[k+N],he>=0&&he!==g&&(j=h[g+t]-h[he+t],U=h[g+r]-h[he+r],M=j*j+U*U,Ce===!0?M>0?(C=q*h[g+d]*h[he+d]/M,h[g+i]+=j*C,h[g+o]+=U*C):M<0&&(C=-q*h[g+d]*h[he+d]/Math.sqrt(M),h[g+i]+=j*C,h[g+o]+=U*C):M>0&&(C=q*h[g+d]*h[he+d]/M,h[g+i]+=j*C,h[g+o]+=U*C)),k=f[k+F],k<0)break;continue}else for(q=_.scalingRatio,P=0;P<ne;P+=Y)for(B=0;B<P;B+=Y)j=h[P+t]-h[B+t],U=h[P+r]-h[B+r],Ce===!0?(M=Math.sqrt(j*j+U*U)-h[P+p]-h[B+p],M>0?(C=q*h[P+d]*h[B+d]/M/M,h[P+i]+=j*C,h[P+o]+=U*C,h[B+i]-=j*C,h[B+o]-=U*C):M<0&&(C=100*q*h[P+d]*h[B+d],h[P+i]+=j*C,h[P+o]+=U*C,h[B+i]-=j*C,h[B+o]-=U*C)):(M=Math.sqrt(j*j+U*U),M>0&&(C=q*h[P+d]*h[B+d]/M/M,h[P+i]+=j*C,h[P+o]+=U*C,h[B+i]-=j*C,h[B+o]-=U*C));for(L=_.gravity/_.scalingRatio,q=_.scalingRatio,g=0;g<ne;g+=Y)C=0,j=h[g+t],U=h[g+r],M=Math.sqrt(Math.pow(j,2)+Math.pow(U,2)),_.strongGravityMode?M>0&&(C=q*h[g+d]*L):M>0&&(C=q*h[g+d]*L/M),h[g+i]-=j*C,h[g+o]-=U*C;for(q=1*(_.outboundAttractionDistribution?Te:1),ve=0;ve<Wr;ve+=Ye)P=ye[ve+u],B=ye[ve+v],X=ye[ve+S],se=Math.pow(X,_.edgeWeightInfluence),j=h[P+t]-h[B+t],U=h[P+r]-h[B+r],Ce===!0?(M=Math.sqrt(j*j+U*U)-h[P+p]-h[B+p],_.linLogMode?_.outboundAttractionDistribution?M>0&&(C=-q*se*Math.log(1+M)/M/h[P+d]):M>0&&(C=-q*se*Math.log(1+M)/M):_.outboundAttractionDistribution?M>0&&(C=-q*se/h[P+d]):M>0&&(C=-q*se)):(M=Math.sqrt(Math.pow(j,2)+Math.pow(U,2)),_.linLogMode?_.outboundAttractionDistribution?M>0&&(C=-q*se*Math.log(1+M)/M/h[P+d]):M>0&&(C=-q*se*Math.log(1+M)/M):_.outboundAttractionDistribution?(M=1,C=-q*se/h[P+d]):(M=1,C=-q*se)),M>0&&(h[P+i]+=j*C,h[P+o]+=U*C,h[B+i]-=j*C,h[B+o]-=U*C);var je,_e,Ue,ge,Re,Fe;if(Ce===!0)for(g=0;g<ne;g+=Y)h[g+l]!==1&&(je=Math.sqrt(Math.pow(h[g+i],2)+Math.pow(h[g+o],2)),je>O&&(h[g+i]=h[g+i]*O/je,h[g+o]=h[g+o]*O/je),_e=h[g+d]*Math.sqrt((h[g+a]-h[g+i])*(h[g+a]-h[g+i])+(h[g+s]-h[g+o])*(h[g+s]-h[g+o])),Ue=Math.sqrt((h[g+a]+h[g+i])*(h[g+a]+h[g+i])+(h[g+s]+h[g+o])*(h[g+s]+h[g+o]))/2,ge=.1*Math.log(1+Ue)/(1+Math.sqrt(_e)),Re=h[g+t]+h[g+i]*(ge/_.slowDown),h[g+t]=Re,Fe=h[g+r]+h[g+o]*(ge/_.slowDown),h[g+r]=Fe);else for(g=0;g<ne;g+=Y)h[g+l]!==1&&(_e=h[g+d]*Math.sqrt((h[g+a]-h[g+i])*(h[g+a]-h[g+i])+(h[g+s]-h[g+o])*(h[g+s]-h[g+o])),Ue=Math.sqrt((h[g+a]+h[g+i])*(h[g+a]+h[g+i])+(h[g+s]+h[g+o])*(h[g+s]+h[g+o]))/2,ge=h[g+c]*Math.log(1+Ue)/(1+Math.sqrt(_e)),h[g+c]=Math.min(1,Math.sqrt(ge*(Math.pow(h[g+i],2)+Math.pow(h[g+o],2))/(1+Math.sqrt(_e)))),Re=h[g+t]+h[g+i]*(ge/_.slowDown),h[g+t]=Re,Fe=h[g+r]+h[g+o]*(ge/_.slowDown),h[g+r]=Fe);return{}},"iterate"),it}m(Ni,"requireIterate");var de={},Gt;function Ci(){if(Gt)return de;Gt=1;var n=Object.defineProperty,e=m((i,o)=>n(i,"name",{value:o,configurable:!0}),"y"),t=10,r=3;return de.assign=function(i){i=i||{};var o=Array.prototype.slice.call(arguments).slice(1),a,s,d;for(a=0,d=o.length;a<d;a++)if(o[a])for(s in o[a])i[s]=o[a][s];return i},de.validateSettings=function(i){return"linLogMode"in i&&typeof i.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in i&&typeof i.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in i&&typeof i.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in i&&typeof i.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in i&&!(typeof i.scalingRatio=="number"&&i.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in i&&typeof i.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in i&&!(typeof i.gravity=="number"&&i.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in i&&!(typeof i.slowDown=="number"||i.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in i&&typeof i.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in i&&!(typeof i.barnesHutTheta=="number"&&i.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},de.graphToByteArrays=function(i,o){var a=i.order,s=i.size,d={},c,p=new Float32Array(a*t),l=new Float32Array(s*r);return c=0,i.forEachNode(function(u,v){d[u]=c,p[c]=v.x,p[c+1]=v.y,p[c+2]=0,p[c+3]=0,p[c+4]=0,p[c+5]=0,p[c+6]=1,p[c+7]=1,p[c+8]=v.size||1,p[c+9]=v.fixed?1:0,c+=t}),c=0,i.forEachEdge(function(u,v,S,N,A,I,R){var F=d[S],z=d[N],H=o(u,v,S,N,A,I,R);p[F+6]+=H,p[z+6]+=H,l[c]=F,l[c+1]=z,l[c+2]=H,c+=r}),{nodes:p,edges:l}},de.assignLayoutChanges=function(i,o,a){var s=0;i.updateEachNodeAttributes(function(d,c){return c.x=o[s],c.y=o[s+1],s+=t,a?a(d,c):c})},de.readGraphPositions=function(i,o){var a=0;i.forEachNode(function(s,d){o[a]=d.x,o[a+1]=d.y,a+=t})},de.collectLayoutChanges=function(i,o,a){for(var s=i.nodes(),d={},c=0,p=0,l=o.length;c<l;c+=t){if(a){var u=Object.assign({},i.getNodeAttributes(s[p]));u.x=o[c],u.y=o[c+1],u=a(s[p],u),d[s[p]]={x:u.x,y:u.y}}else d[s[p]]={x:o[c],y:o[c+1]};p++}return d},de.createWorker=e(function(i){var o=window.URL||window.webkitURL,a=i.toString(),s=o.createObjectURL(new Blob(["("+a+").call(this);"],{type:"text/javascript"})),d=new Worker(s);return o.revokeObjectURL(s),d},"createWorker"),de}m(Ci,"requireHelpers");var nt,At;function _i(){return At||(At=1,nt={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),nt}m(_i,"requireDefaults");var ot,St;function Di(){if(St)return ot;St=1;var n=Object.defineProperty,e=m((p,l)=>n(p,"name",{value:l,configurable:!0}),"a"),t=Ai(),r=Si().createEdgeWeightGetter,i=Ni(),o=Ci(),a=_i();function s(p,l,u){if(!t(l))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof u=="number"&&(u={iterations:u});var v=u.iterations;if(typeof v!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(v<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var S=r("getEdgeWeight"in u?u.getEdgeWeight:"weight").fromEntry,N=typeof u.outputReducer=="function"?u.outputReducer:null,A=o.assign({},a,u.settings),I=o.validateSettings(A);if(I)throw new Error("graphology-layout-forceatlas2: "+I.message);var R=o.graphToByteArrays(l,S),F;for(F=0;F<v;F++)i(A,R.nodes,R.edges);if(p){o.assignLayoutChanges(l,R.nodes,N);return}return o.collectLayoutChanges(l,R.nodes)}m(s,"abstractSynchronousLayout"),e(s,"abstractSynchronousLayout");function d(p){var l=typeof p=="number"?p:p.order;return{barnesHutOptimize:l>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(l)}}m(d,"inferSettings"),e(d,"inferSettings");var c=s.bind(null,!1);return c.assign=s.bind(null,!0),c.inferSettings=d,ot=c,ot}m(Di,"requireGraphologyLayoutForceatlas2");var Mi=Di();const Nt=di(Mi);var Ii=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:""}}}@layer theme{:root,:host{--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-light:300;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--leading-tight:1.25;--leading-snug:1.375;--radius-sm:.25rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--sans);--default-mono-font-family:var(--mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0;--mono:ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;--sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif}@media (prefers-color-scheme:dark){:root{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}}html[data-theme=light]{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0}html[data-theme=dark]{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}body{background-image:radial-gradient(circle, var(--border) .5px, transparent .5px);font-feature-settings:"ss01";background-size:14px 14px}}@layer components{.tbtn-theme [data-icon=moon]{display:inline-flex}.tbtn-theme [data-icon=sun]{display:none}@media (prefers-color-scheme:dark){.tbtn-theme [data-icon=moon]{display:none}.tbtn-theme [data-icon=sun]{display:inline-flex}}html[data-theme=light] .tbtn-theme [data-icon=moon]{display:inline-flex}html[data-theme=light] .tbtn-theme [data-icon=sun],html[data-theme=dark] .tbtn-theme [data-icon=moon]{display:none}html[data-theme=dark] .tbtn-theme [data-icon=sun]{display:inline-flex}.anolilab-logo{width:auto;height:13px;fill:var(--fg)}.anolilab-accent{fill:#dfff1b}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:calc(var(--spacing) * 0)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.z-20{z-index:20}.z-30{z-index:30}.z-\\[2\\]{z-index:2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-12{margin-inline:calc(var(--spacing) * 12)}.mx-\\[0\\.12em\\]{margin-inline:.12em}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-\\[7px\\]{width:7px;height:7px}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-\\[6px\\]{height:6px}.h-\\[7px\\]{height:7px}.h-\\[8px\\]{height:8px}.h-\\[10px\\]{height:10px}.h-\\[18px\\]{height:18px}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.min-h-\\[400px\\]{min-height:400px}.min-h-\\[480px\\]{min-height:480px}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-9{width:calc(var(--spacing) * 9)}.w-\\[7px\\]{width:7px}.w-\\[8px\\]{width:8px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[380px\\]{max-width:380px}.max-w-\\[1080px\\]{max-width:1080px}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[260px\\]{min-width:260px}.flex-1{flex:1}.flex-\\[1_1_280px\\]{flex:280px}.flex-auto{flex:auto}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\\[72px_1fr\\]{grid-template-columns:72px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-16{gap:calc(var(--spacing) * 16)}.gap-\\[0\\.65rem\\]{gap:.65rem}.gap-\\[2px\\]{gap:2px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent,.border-accent\\/60{border-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.border-accent\\/60{border-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.border-border{border-color:var(--border)}.border-border2{border-color:var(--border2)}.border-fg{border-color:var(--fg)}.border-link{border-color:var(--link)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-accent\\/40{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/40{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.bg-bg,.bg-bg\\/40{background-color:var(--bg)}@supports (color:color-mix(in lab, red, red)){.bg-bg\\/40{background-color:color-mix(in oklab, var(--bg) 40%, transparent)}}.bg-border{background-color:var(--border)}.bg-border2{background-color:var(--border2)}.bg-edge{background-color:var(--edge)}.bg-edge-faint{background-color:var(--edge-faint)}.bg-fg{background-color:var(--fg)}.bg-node-app{background-color:var(--node-app)}.bg-node-lib{background-color:var(--node-lib)}.bg-panel,.bg-panel\\/95{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/95{background-color:color-mix(in oklab, var(--panel) 95%, transparent)}}.bg-panel2{background-color:var(--panel2)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\\[5px\\]{padding-inline:5px}.px-\\[6px\\]{padding-inline:6px}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-\\[3px\\]{padding-block:3px}.py-px{padding-block:1px}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-7{padding-top:calc(var(--spacing) * 7)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pl-0{padding-left:calc(var(--spacing) * 0)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-\\[7px\\]{padding-left:7px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[28px\\]{font-size:28px}.text-\\[44px\\]{font-size:44px}.text-\\[72px\\]{font-size:72px}.text-\\[clamp\\(28px\\,5vw\\,52px\\)\\]{font-size:clamp(28px,5vw,52px)}.leading-\\[0\\.9\\]{--tw-leading:.9;line-height:.9}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\\[0\\.11em\\]{--tw-tracking:.11em;letter-spacing:.11em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.15em\\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\\[0\\.16em\\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\\[0\\.22em\\]{--tw-tracking:.22em;letter-spacing:.22em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent{color:var(--accent)}.text-bg{color:var(--bg)}.text-faint{color:var(--faint)}.text-fg{color:var(--fg)}.text-link{color:var(--link)}.text-muted{color:var(--muted)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.opacity-40{opacity:.4}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_4px_12px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_8px_24px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-0{outline-style:var(--tw-outline-style);outline-width:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.group-data-\\[state\\=off\\]\\:opacity-30:is(:where(.group)[data-state=off] *){opacity:.3}.placeholder\\:text-faint::placeholder{color:var(--faint)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:calc(var(--spacing) * 0)}.before\\:text-faint:before{content:var(--tw-content);color:var(--faint)}.before\\:content-\\[\\'→\\'\\]:before{--tw-content:"→";content:var(--tw-content)}.after\\:ml-auto:after{content:var(--tw-content);margin-left:auto}.after\\:font-mono:after{content:var(--tw-content);font-family:var(--mono)}.after\\:text-\\[9px\\]:after{content:var(--tw-content);font-size:9px}.after\\:tracking-\\[0\\.1em\\]:after{content:var(--tw-content);--tw-tracking:.1em;letter-spacing:.1em}.after\\:text-accent:after{content:var(--tw-content);color:var(--accent)}.after\\:content-\\[\\'ON\\'\\]:after{--tw-content:"ON";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-fg:focus-within{border-color:var(--fg)}@media (hover:hover){.hover\\:border-fg:hover{border-color:var(--fg)}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-row-hover:hover{background-color:var(--row-hover)}.hover\\:text-accent:hover{color:var(--accent)}.hover\\:text-fg:hover{color:var(--fg)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-90:hover{opacity:.9}}.focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-fg:focus-visible{--tw-ring-color:var(--fg)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-40:disabled{opacity:.4}.aria-selected\\:bg-row-hover[aria-selected=true]{background-color:var(--row-hover)}.data-\\[open\\=false\\]\\:hidden[data-open=false]{display:none}.data-\\[pinned\\=true\\]\\:pointer-events-auto[data-pinned=true]{pointer-events:auto}.data-\\[pinned\\=true\\]\\:border-accent[data-pinned=true]{border-color:var(--accent)}.data-\\[state\\=off\\]\\:text-faint[data-state=off]{color:var(--faint)}.data-\\[state\\=off\\]\\:line-through[data-state=off]{text-decoration-line:line-through}.data-\\[state\\=off\\]\\:after\\:text-faint[data-state=off]:after{content:var(--tw-content);color:var(--faint)}.data-\\[state\\=off\\]\\:after\\:content-\\[\\'OFF\\'\\][data-state=off]:after{--tw-content:"OFF";content:var(--tw-content)}.data-\\[state\\=selected\\]\\:bg-row-hover[data-state=selected]{background-color:var(--row-hover)}.data-\\[state\\=zero\\]\\:text-accent[data-state=zero]{color:var(--accent)}@media (min-width:40rem){.sm\\:min-w-\\[320px\\]{min-width:320px}}@media (min-width:48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\\:grid-cols-\\[1\\.4fr_1fr\\]{grid-template-columns:1.4fr 1fr}}.\\[\\&_svg\\]\\:size-\\[14px\\] svg{width:14px;height:14px}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_tr\\]\\:border-b-0 tr{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\\[\\&\\>\\*\\+\\*\\]\\:ml-6>*+*{margin-left:calc(var(--spacing) * 6)}.\\[\\&\\>\\*\\+\\*\\]\\:border-l>*+*{border-left-style:var(--tw-border-style);border-left-width:1px}.\\[\\&\\>\\*\\+\\*\\]\\:border-border>*+*{border-color:var(--border)}.\\[\\&\\>\\*\\+\\*\\]\\:pl-6>*+*{padding-left:calc(var(--spacing) * 6)}.\\[\\&\\>td\\]\\:border-b>td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\\[\\&\\>td\\]\\:border-border>td{border-color:var(--border)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}`,Li=Object.defineProperty,Ke=m((n,e)=>Li(n,"name",{value:e,configurable:!0}),"d$1");const Ti=Ii,Oi=ni(import.meta.url),Xe=Ke((n,e)=>{const t=Oi.resolve(n);return Kr(oi(ai(t),e),"utf8")},"readUmd"),zi=Xe("sigma","sigma.min.js"),ji=Xe("graphology","graphology.umd.min.js"),Ui=Xe("@floating-ui/core","floating-ui.core.umd.min.js"),Ri=Xe("@floating-ui/dom","floating-ui.dom.umd.min.js"),Fi='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>',Pi='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32 1.41-1.41"/></svg>',ce=Ke(n=>n.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;"),"escapeHtml"),Wi=9,qi=4,Bi=Ke((n,e)=>{if(n.length===0)return[];const t=new W({multi:!0,type:"directed"});for(const o of n){const a=t.order/n.length*Math.PI*2;t.addNode(o.name,{path:o.path,size:o.type==="application"?Wi:qi,type:o.type,x:Math.cos(a),y:Math.sin(a)})}for(const o of e)t.hasNode(o.source)&&t.hasNode(o.target)&&t.addEdge(o.source,o.target,{type:o.type});const r=Nt.inferSettings(t);Nt.assign(t,{iterations:600,settings:{...r,adjustSizes:!0,barnesHutOptimize:t.order>100,gravity:1.2,linLogMode:!0,scalingRatio:8,slowDown:4}});const i=[];return t.forEachNode((o,a)=>{i.push({name:o,path:a.path,size:a.size,type:a.type,x:a.x,y:a.y})}),i},"computeLayout"),Hi=Ke(n=>{const e=n.now??new Date,t=n.nodes.filter(p=>p.type==="application").length,r=n.nodes.length-t,i=Bi(n.nodes,n.edges),o=new Set(i.map(p=>p.name)),a=n.edges.filter(p=>o.has(p.source)&&o.has(p.target)),s={edges:a,nodes:i},d=n.nodes.length===0,c={chip:"font-mono tracking-[0.08em] text-muted border border-border2 inline-flex h-7 items-center justify-center rounded-[4px] px-3 text-[11px] font-medium uppercase",dvNum:"font-mono text-[22px] font-medium text-fg leading-none",labelMono:"font-mono text-[10px] uppercase tracking-[0.15em] text-faint"};return`<!doctype html>
62
3
  <html lang="en">
63
4
  <head>
64
5
  <meta charset="utf-8">
65
6
  <meta name="viewport" content="width=device-width, initial-scale=1">
66
- <title>vis audit · ${S(t.toISOString().slice(0,10))}</title>
67
- <style>${xi}</style>${$}
7
+ <title>${ce(n.tool.name)} graph · ${ce(e.toISOString().slice(0,10))}</title>
8
+ <style>${Ti}</style>
68
9
  </head>
69
- <body>
70
- <main class="mx-auto max-w-[1080px]">
71
- <header class="masthead flex flex-wrap items-end gap-4 px-0 pt-8 pb-5">
72
- <div class="brand leading-none tracking-tight">${(()=>{const[x,...j]=e.tool.name.split("-");return j.length>0?`${S(x??e.tool.name)}<span class="slash mx-[0.12em] font-light">/</span>${S(j.join("-"))}`:S(e.tool.name)})()}<span class="sub mt-3 block text-[11px] font-medium uppercase">dependency security report</span></div>
10
+ <body class="bg-bg text-fg">
11
+ <div class="min-h-screen flex flex-col">
12
+ <header class="flex flex-wrap items-end gap-4 px-8 pt-8 pb-5">
13
+ <div class="font-sans text-[clamp(28px,5vw,52px)] font-semibold text-fg leading-none tracking-tight">${(()=>{const[p,...l]=n.tool.name.split("-");return l.length>0?`${ce(p??n.tool.name)}<span class="text-accent mx-[0.12em] font-light">/</span>${ce(l.join("-"))}`:ce(n.tool.name)})()}<span class="font-mono tracking-[0.22em] text-faint mt-3 block text-[10px] font-medium uppercase">dependency graph</span></div>
73
14
  <span class="flex-auto"></span>
74
- <span class="chip inline-flex h-7 items-center justify-center rounded-[4px] px-3 text-[11px] font-medium uppercase">v${S(e.tool.version)}</span>
75
- <button id="theme" class="tbtn tbtn-theme inline-flex h-7 cursor-pointer items-center justify-center rounded-[4px] bg-transparent px-3 text-[11px] font-medium uppercase" type="button" aria-label="Toggle color theme" title="Toggle color theme"><span class="ticon ticon-moon inline-flex items-center justify-center">${Ni}</span><span class="ticon ticon-sun inline-flex items-center justify-center">${Ci}</span></button>
15
+ <span class="${c.chip}">v${ce(n.tool.version)}</span>
16
+ <button id="theme" class="tbtn-theme font-mono text-muted border border-border2 inline-flex h-7 w-9 cursor-pointer items-center justify-center rounded-[4px] bg-transparent transition-colors duration-150 hover:text-fg hover:border-fg" type="button" aria-label="Toggle color theme" title="Toggle color theme"><span data-icon="moon" class="items-center justify-center">${Fi}</span><span data-icon="sun" class="items-center justify-center">${Pi}</span></button>
76
17
  </header>
77
- ${c?"":`<section class="verdict verdict-${b} flex flex-wrap items-baseline gap-x-6 gap-y-1"><span class="vnum font-light">${String(a.length)}</span><span class="vsub text-[12px] uppercase">${a.length===1?"vulnerability detected":"vulnerabilities detected"}</span></section>`}
78
- <div class="debugbar flex flex-wrap items-stretch gap-0 pt-7 pb-1">${m}</div>
79
- <div class="pt-8">
80
- ${c?'<div class="clean px-6 text-center"><div class="big font-light">CLEAN</div><div class="sub mt-6 text-[12px] uppercase">No security issues found.</div></div>':`
81
- <div class="mb-6 flex flex-wrap items-center gap-0">
82
- <label class="field flex flex-[1_1_280px] items-center"><span class="prompt pr-3 text-[10px] uppercase select-none">filter:</span><input id="filter" type="search" class="w-full border-0 bg-transparent py-2.5 pr-0 pl-0 text-[13px] outline-0" placeholder="package or advisory id…" aria-label="Filter findings" /></label>
83
- <label class="field sel flex flex-none items-center"><span class="prompt pr-3 text-[10px] uppercase select-none">sev</span><select id="severity" class="w-full cursor-pointer border-0 bg-transparent py-2.5 pr-6 pl-0 text-[13px] outline-0" aria-label="Filter by severity">
84
- <option value="">all severities</option>
85
- <option value="CRITICAL">critical only</option>
86
- <option value="HIGH">high and above</option>
87
- <option value="MODERATE">moderate and above</option>
88
- <option value="LOW">low and above</option>
89
- </select></label>
90
- <span class="hint ml-8 text-[10px] uppercase"><span class="kbd rounded-[3px] px-[6px] py-px text-[10px] font-medium uppercase">/</span> to search · <span class="kbd rounded-[3px] px-[6px] py-px text-[10px] font-medium uppercase">esc</span> to clear</span>
18
+ <div class="flex flex-wrap items-end gap-6 px-8 pt-5 pb-5 border-b border-border">
19
+ <div class="flex flex-wrap items-stretch gap-0 [&>*+*]:pl-6 [&>*+*]:ml-6 [&>*+*]:border-l [&>*+*]:border-border">
20
+ <div class="flex items-baseline gap-[0.65rem]"><span class="${c.labelMono}">apps</span><span class="${c.dvNum}">${String(t)}</span></div>
21
+ <div class="flex items-baseline gap-[0.65rem]"><span class="${c.labelMono}">libraries</span><span class="${c.dvNum}">${String(r)}</span></div>
22
+ <div class="flex items-baseline gap-[0.65rem]"><span class="${c.labelMono}">dependencies</span><span class="${c.dvNum}">${String(a.length)}</span></div>
23
+ </div>
24
+ <span class="flex-auto"></span>
25
+ <div class="relative min-w-[260px] sm:min-w-[320px] ml-auto">
26
+ <label class="flex items-center gap-3 border-b border-border2 transition-colors duration-150 hover:border-fg focus-within:border-fg pb-1.5">
27
+ <span class="${c.labelMono} select-none">find:</span>
28
+ <input id="filter" type="search" class="w-full min-w-0 border-0 bg-transparent py-0.5 text-fg text-[12px] font-mono outline-0 placeholder:text-faint" placeholder="package name…" aria-label="Filter packages" autocomplete="off" spellcheck="false" />
29
+ <span id="filter-count" data-state="" class="font-mono text-faint text-[10px] tracking-[0.05em] shrink-0 select-none data-[state=zero]:text-accent" aria-live="polite"></span>
30
+ </label>
31
+ <div id="filter-results" data-open="false" class="data-[open=false]:hidden absolute z-20 top-full left-0 right-0 mt-2 bg-panel border border-border max-h-72 overflow-y-auto shadow-[0_4px_12px_rgba(0,0,0,0.08)]" role="listbox" aria-label="Matching packages"></div>
32
+ </div>
33
+ </div>
34
+ <main class="relative flex-1 min-h-[480px]">${d?'<div class="flex flex-col items-center justify-center min-h-[400px] gap-4 text-center"><div class="font-sans text-[72px] font-semibold text-fg leading-none tracking-tight">NONE</div><div class="font-mono text-faint text-[12px] uppercase tracking-[0.15em]">No projects discovered in this workspace.</div></div>':`<div id="graph" class="absolute inset-0"></div>
35
+ <div id="tooltip" data-pinned="false" class="fixed z-30 top-0 left-0 hidden bg-panel border border-border2 px-4 py-3 max-w-[380px] pointer-events-none font-sans shadow-[0_8px_24px_rgba(0,0,0,0.12)] data-[pinned=true]:pointer-events-auto data-[pinned=true]:border-accent"></div>
36
+ <div id="legend" class="absolute top-4 right-4 bg-panel/95 backdrop-blur-sm border border-border px-4 py-3 min-w-[200px]">
37
+ <div class="${c.labelMono} mb-2">Filter</div>
38
+ <div data-toggle="app" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-app shrink-0 group-data-[state=off]:opacity-30"></span>Application</div>
39
+ <div data-toggle="lib" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-lib shrink-0 group-data-[state=off]:opacity-30"></span>Library</div>
40
+ <div data-toggle="prod" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge shrink-0 group-data-[state=off]:opacity-30"></span>Static dep</div>
41
+ <div data-toggle="dev" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge-faint shrink-0 group-data-[state=off]:opacity-30"></span>Dev / implicit</div>
42
+ <div data-toggle="peer" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-accent shrink-0 group-data-[state=off]:opacity-30"></span>Peer</div>
91
43
  </div>
92
- <table id="findings" class="w-full text-[13px]">
93
- <thead>
94
- <tr>
95
- <th class="${q}">Severity</th>
96
- <th class="${q}">Upgrade</th>
97
- <th class="${q}">Package</th>
98
- <th class="${q}">Version</th>
99
- <th class="${q}">Advisory</th>
100
- <th class="${q}">Summary</th>
101
- <th class="${q}">Fix</th>
102
- <th class="${q}">Remediation</th>
103
- </tr>
104
- </thead>
105
- <tbody>
106
- ${o}
107
- </tbody>
108
- </table>
109
- <div id="empty" class="empty hidden px-5 py-12 text-center text-[12px] uppercase">No findings match the current filter.</div>`}
110
- ${y.length>0?`
111
- <h2>Policy Decisions (${y.length})</h2>
112
- <table id="policies" class="w-full text-[13px]">
113
- <thead>
114
- <tr>
115
- <th class="${J}">Severity</th>
116
- <th class="${J}">Policy</th>
117
- <th class="${J}">Package</th>
118
- <th class="${J}">Version</th>
119
- <th class="${J}">Reason</th>
120
- </tr>
121
- </thead>
122
- <tbody>
123
- ${g}
124
- </tbody>
125
- </table>`:""}
126
- ${h.length>0?`
127
- <h2>Duplicate Versions (${h.length})</h2>
128
- <p class="mt-1 mb-3 text-[12px] uppercase opacity-70">Packages installed at multiple versions. Consolidating these via overrides shrinks the install footprint and the attack surface.</p>
129
- <table id="duplicates" class="w-full text-[13px]">
130
- <thead>
131
- <tr>
132
- <th class="${J}">Package</th>
133
- <th class="${J}">Versions</th>
134
- <th class="${J}">Installed</th>
135
- </tr>
136
- </thead>
137
- <tbody>
138
- ${w}
139
- </tbody>
140
- </table>`:""}
141
- <footer class="sig mt-12 flex flex-wrap items-center justify-between gap-x-6 gap-y-3 pt-5 text-[10px] uppercase"><span class="sig-meta"><b>${S(e.tool.name)}</b> ${S(e.tool.version)} · generated ${S(t.toISOString())} · powered by OSV.dev</span><span class="sig-by inline-flex items-center gap-2"><span class="sig-by-label">built by</span><a class="sig-by-link inline-flex items-center" href="https://anolilab.com" rel="noreferrer noopener" target="_blank" aria-label="Anolilab">${Ca}</a></span></footer>
44
+ <div class="absolute bottom-4 left-4 flex flex-wrap items-center gap-x-6 gap-y-2 bg-panel/95 backdrop-blur-sm border border-border px-4 py-2 font-mono text-[10px] uppercase tracking-[0.15em] text-faint">
45
+ <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">/</span><span>Search</span></div>
46
+ <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">R</span><span>Fit view</span></div>
47
+ <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">Click</span><span>Pin · click empty to unpin</span></div>
48
+ </div>`}</main>
49
+ <footer class="flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-8 py-4 text-[10px] uppercase border-t border-border font-mono text-faint tracking-[0.1em]">
50
+ <span><b class="text-fg font-semibold">${ce(n.tool.name)}</b> ${ce(n.tool.version)} · generated ${ce(e.toISOString())}</span>
51
+ <span class="inline-flex items-center gap-2"><span>built by</span><a class="sig-by-link inline-flex items-center" href="https://anolilab.com" rel="noreferrer noopener" target="_blank" aria-label="Anolilab">${ci}</a></span>
52
+ </footer>
142
53
  </div>
143
- </main>
54
+ <script>${ji}<\/script>
55
+ <script>${zi}<\/script>
56
+ <script>${Ui}<\/script>
57
+ <script>${Ri}<\/script>
144
58
  <script>
145
59
  (() => {
146
60
  const root = document.documentElement;
147
61
  const themeBtn = document.getElementById('theme');
148
62
  const mql = window.matchMedia('(prefers-color-scheme: dark)');
149
63
 
150
- // Theme: persisted choice wins, else follow OS. JS only flips data-theme;
151
- // CSS handles the colors and the moon/sun icon swap.
152
64
  try {
153
- const stored = localStorage.getItem('vis-audit-theme');
65
+ const stored = localStorage.getItem('vis-graph-theme');
154
66
  if (stored === 'light' || stored === 'dark') {
155
67
  root.dataset.theme = stored;
156
68
  }
157
69
  } catch {}
158
70
 
159
- themeBtn?.addEventListener('click', () => {
160
- const isDark = root.dataset.theme ? root.dataset.theme === 'dark' : mql.matches;
161
- const next = isDark ? 'light' : 'dark';
162
- root.dataset.theme = next;
163
- try {
164
- localStorage.setItem('vis-audit-theme', next);
165
- } catch {}
166
- });
71
+ const data = ${JSON.stringify(s).replaceAll("</",String.raw`<\/`)};
72
+ if (!data.nodes.length || !window.graphology || !window.Sigma) {
73
+ return;
74
+ }
167
75
 
168
- // Filter index: read each row's data-* once, lowercase strings ahead of
169
- // time, and pre-rank severity. Subsequent keystrokes only compare cached
170
- // primitives no per-row getAttribute / toLowerCase in the hot loop.
171
- const RANK = { CRITICAL: 0, HIGH: 1, MODERATE: 2, LOW: 3, UNKNOWN: 4 };
172
- const UNKNOWN = RANK.UNKNOWN;
173
- const filterInput = document.getElementById('filter');
174
- const sevSelect = document.getElementById('severity');
175
- const shown = document.getElementById('shown');
176
- const empty = document.getElementById('empty');
177
- const index = [];
178
- for (const el of document.querySelectorAll('#findings tbody tr')) {
179
- const d = el.dataset;
180
- index.push({
181
- el,
182
- pkg: (d.package || '').toLowerCase(),
183
- adv: (d.advisory || '').toLowerCase(),
184
- rank: RANK[d.severity] ?? UNKNOWN,
185
- finding: el.classList.contains('finding-row'),
186
- hidden: false,
76
+ // Reusable Tailwind utility-class strings for dynamically-created elements.
77
+ // Inline-everywhere is the system of record; these strings only exist
78
+ // because the JS DOM API can't read Tailwind from the markup.
79
+ const CLS = {
80
+ ttlName: 'font-sans text-fg text-[13px] font-semibold leading-tight mb-1 break-words',
81
+ ttlType: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em]',
82
+ ttlPath: 'font-mono text-muted text-[10px] mt-2 break-all',
83
+ ttlSection: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] mt-3 mb-1',
84
+ ttlEmpty: 'font-mono text-faint text-[10px] italic mt-2',
85
+ ttlMore: 'font-mono text-faint text-[10px] italic pl-3 mt-1',
86
+ ttlUl: 'mt-1 space-y-0.5',
87
+ ttlLi: "font-mono text-fg text-[11px] leading-snug pl-3 relative before:content-['→'] before:text-faint before:absolute before:left-0",
88
+ matchItem: 'flex items-center justify-between gap-3 px-3 py-2 cursor-pointer text-[12px] hover:bg-row-hover aria-selected:bg-row-hover',
89
+ miName: 'font-sans text-fg truncate',
90
+ miMark: 'bg-accent-soft text-accent rounded-sm px-0.5',
91
+ miKind: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] shrink-0',
92
+ matchEmpty: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] px-3 py-3',
93
+ };
94
+
95
+ // Read live colors from the rendered CSS so theme switches stay in one
96
+ // place: change vars → call sigma.refresh() and node/edge colors update.
97
+ const css = () => {
98
+ const s = getComputedStyle(root);
99
+ return {
100
+ app: s.getPropertyValue('--node-app').trim(),
101
+ lib: s.getPropertyValue('--node-lib').trim(),
102
+ edge: s.getPropertyValue('--edge').trim(),
103
+ edgeFaint: s.getPropertyValue('--edge-faint').trim(),
104
+ accent: s.getPropertyValue('--accent').trim(),
105
+ fg: s.getPropertyValue('--fg').trim(),
106
+ muted: s.getPropertyValue('--muted').trim(),
107
+ };
108
+ };
109
+
110
+ let theme = css();
111
+
112
+ const Graph = window.graphology.Graph || window.graphology;
113
+ const graph = new Graph({ multi: true, type: 'directed' });
114
+
115
+ const colorForNode = (type) => type === 'application' ? theme.app : theme.lib;
116
+ const colorForEdge = (type) => {
117
+ if (type === 'peerDependency') return theme.accent;
118
+ if (type === 'devDependency' || type === 'implicit') return theme.edgeFaint;
119
+ return theme.edge;
120
+ };
121
+
122
+ // Attribute is named "kind", not "type": sigma reads node.type as its
123
+ // program-class name and bails when it sees "application" / "library".
124
+ for (const n of data.nodes) {
125
+ graph.addNode(n.name, {
126
+ x: n.x,
127
+ y: n.y,
128
+ size: n.size,
129
+ label: n.name,
130
+ kind: n.type,
131
+ path: n.path,
132
+ color: colorForNode(n.type),
133
+ });
134
+ }
135
+
136
+ for (const e of data.edges) {
137
+ graph.addEdge(e.source, e.target, {
138
+ color: colorForEdge(e.type),
139
+ depType: e.type,
140
+ size: 1,
187
141
  });
188
142
  }
189
- let emptyShown = false;
190
-
191
- const apply = () => {
192
- const q = (filterInput?.value || '').toLowerCase().trim();
193
- const sevValue = sevSelect?.value || '';
194
- const cap = sevValue ? (RANK[sevValue] ?? UNKNOWN) : UNKNOWN;
195
- let visible = 0;
196
- for (const row of index) {
197
- const queryHit = !q || row.pkg.includes(q) || row.adv.includes(q);
198
- const sevHit = !sevValue || row.rank <= cap;
199
- const visibleNow = queryHit && sevHit;
200
- if (visibleNow && row.finding) {
201
- visible += 1;
143
+
144
+ // Adjacency for tooltip & hover-emphasis.
145
+ const depMap = {}, rdepMap = {};
146
+ for (const n of data.nodes) { depMap[n.name] = []; rdepMap[n.name] = []; }
147
+ for (const e of data.edges) {
148
+ depMap[e.source].push(e.target);
149
+ rdepMap[e.target].push(e.source);
150
+ }
151
+
152
+ const container = document.getElementById('graph');
153
+ const tooltip = document.getElementById('tooltip');
154
+ const filterInput = document.getElementById('filter');
155
+ const filterCount = document.getElementById('filter-count');
156
+ const filterResults = document.getElementById('filter-results');
157
+
158
+ const renderer = new window.Sigma(graph, container, {
159
+ renderEdgeLabels: false,
160
+ labelColor: { color: theme.fg },
161
+ labelFont: 'system-ui, -apple-system, sans-serif',
162
+ labelSize: 11,
163
+ labelWeight: '500',
164
+ labelDensity: 0.7,
165
+ labelGridCellSize: 80,
166
+ defaultEdgeColor: theme.edge,
167
+ defaultNodeColor: theme.lib,
168
+ defaultEdgeType: 'arrow',
169
+ minCameraRatio: 0.05,
170
+ maxCameraRatio: 8,
171
+ // Suppress sigma's built-in hover label panel. We render our own tooltip,
172
+ // so its empty label box (the small rectangle near the cursor) is noise.
173
+ defaultDrawNodeHover: () => undefined,
174
+ });
175
+
176
+ // State: hover follows the mouse, focus is sticky (set by clicking a node
177
+ // or selecting a search result), pin keeps the tooltip locked in place.
178
+ let hoveredNode = null;
179
+ let focusedNode = null;
180
+ let pinned = false;
181
+ let filterTerm = '';
182
+ let matches = [];
183
+ let activeMatchIndex = -1;
184
+
185
+ // Legend filter state: each key toggles the visibility of a category.
186
+ // previewCategory is set transiently while hovering a legend row so the
187
+ // user can sneak-peek which lines/nodes belong to that category without
188
+ // committing to a toggle.
189
+ const visible = { app: true, lib: true, prod: true, dev: true, peer: true };
190
+ let previewCategory = null;
191
+ const isNodeCat = (k) => k === 'app' || k === 'lib';
192
+ const isEdgeCat = (k) => k === 'prod' || k === 'dev' || k === 'peer';
193
+ const edgeCategory = (depType) => {
194
+ if (depType === 'peerDependency') return 'peer';
195
+ if (depType === 'devDependency' || depType === 'implicit') return 'dev';
196
+ return 'prod';
197
+ };
198
+ const nodeVisible = (kind) => visible[kind === 'application' ? 'app' : 'lib'];
199
+
200
+ const activeNode = () => focusedNode || hoveredNode;
201
+
202
+ renderer.setSetting('nodeReducer', (node, attrs) => {
203
+ if (!nodeVisible(attrs.kind)) {
204
+ return { ...attrs, hidden: true, label: '' };
205
+ }
206
+ // Legend-row preview takes precedence over normal focus/hover emphasis:
207
+ // hovering a category gives an unambiguous "show me what's in this set".
208
+ if (previewCategory) {
209
+ const nodeCat = attrs.kind === 'application' ? 'app' : 'lib';
210
+ const inPreview = isNodeCat(previewCategory) ? nodeCat === previewCategory : false;
211
+ return {
212
+ ...attrs,
213
+ color: inPreview ? attrs.color : theme.edgeFaint,
214
+ label: inPreview ? attrs.label : '',
215
+ zIndex: inPreview ? 1 : 0,
216
+ };
217
+ }
218
+ const active = activeNode();
219
+ const matchedFilter = !filterTerm || node.toLowerCase().includes(filterTerm);
220
+ const isActive = active === node;
221
+ const isRelated = active && (depMap[active]?.includes(node) || rdepMap[active]?.includes(node));
222
+ const dim = (filterTerm && !matchedFilter) || (active && !isActive && !isRelated);
223
+ return {
224
+ ...attrs,
225
+ color: isActive ? theme.accent : attrs.color,
226
+ label: dim ? '' : attrs.label,
227
+ zIndex: isActive ? 2 : isRelated ? 1 : 0,
228
+ };
229
+ });
230
+
231
+ renderer.setSetting('edgeReducer', (edge, attrs) => {
232
+ if (!visible[edgeCategory(attrs.depType)]) {
233
+ return { ...attrs, hidden: true };
234
+ }
235
+ const ext = graph.extremities(edge);
236
+ if (!nodeVisible(graph.getNodeAttribute(ext[0], 'kind')) || !nodeVisible(graph.getNodeAttribute(ext[1], 'kind'))) {
237
+ return { ...attrs, hidden: true };
238
+ }
239
+ if (previewCategory) {
240
+ if (isEdgeCat(previewCategory)) {
241
+ const inPreview = edgeCategory(attrs.depType) === previewCategory;
242
+ return { ...attrs, color: inPreview ? theme.accent : theme.edgeFaint, size: inPreview ? 1.5 : 0.3, zIndex: inPreview ? 1 : 0 };
243
+ }
244
+ // Previewing a node category dims every edge — the focus is on the dots.
245
+ return { ...attrs, color: theme.edgeFaint, size: 0.3 };
246
+ }
247
+ const active = activeNode();
248
+ const touchesActive = active && (ext[0] === active || ext[1] === active);
249
+ if (active && !touchesActive) {
250
+ return { ...attrs, color: theme.edgeFaint, hidden: false, size: 0.5 };
251
+ }
252
+ if (touchesActive) {
253
+ return { ...attrs, color: theme.accent, size: 1.5, zIndex: 1 };
254
+ }
255
+ return attrs;
256
+ });
257
+
258
+ // Tooltip body assembled with safe DOM methods (createElement +
259
+ // textContent) — no innerHTML, no template strings of user data.
260
+ const MAX_TOOLTIP_ITEMS = 8;
261
+ const setTooltipContent = (name) => {
262
+ const node = graph.getNodeAttributes(name);
263
+ const deps = depMap[name] || [];
264
+ const rdeps = rdepMap[name] || [];
265
+ tooltip.textContent = '';
266
+
267
+ const nameEl = document.createElement('div');
268
+ nameEl.className = CLS.ttlName;
269
+ nameEl.textContent = name;
270
+ tooltip.appendChild(nameEl);
271
+
272
+ const typeEl = document.createElement('div');
273
+ typeEl.className = CLS.ttlType;
274
+ typeEl.textContent = node.kind + (pinned ? ' · pinned' : '');
275
+ tooltip.appendChild(typeEl);
276
+
277
+ if (node.path) {
278
+ const pathEl = document.createElement('div');
279
+ pathEl.className = CLS.ttlPath;
280
+ pathEl.textContent = node.path;
281
+ tooltip.appendChild(pathEl);
282
+ }
283
+
284
+ const addSection = (label, items) => {
285
+ const heading = document.createElement('div');
286
+ heading.className = CLS.ttlSection;
287
+ heading.textContent = label + ' (' + items.length + ')';
288
+ tooltip.appendChild(heading);
289
+ const ul = document.createElement('ul');
290
+ ul.className = CLS.ttlUl;
291
+ const shown = items.slice(0, MAX_TOOLTIP_ITEMS);
292
+ for (const item of shown) {
293
+ const li = document.createElement('li');
294
+ li.className = CLS.ttlLi;
295
+ li.textContent = item;
296
+ ul.appendChild(li);
202
297
  }
203
- // Only touch the DOM when this row's state actually changes — keeps
204
- // continued typing from re-laying out every row on every keystroke.
205
- if (visibleNow === !row.hidden) {
206
- continue;
298
+ if (items.length > MAX_TOOLTIP_ITEMS) {
299
+ const more = document.createElement('li');
300
+ more.className = CLS.ttlMore;
301
+ more.textContent = (items.length - MAX_TOOLTIP_ITEMS) + ' more';
302
+ ul.appendChild(more);
207
303
  }
208
- row.el.style.display = visibleNow ? '' : 'none';
209
- row.hidden = !visibleNow;
304
+ tooltip.appendChild(ul);
305
+ };
306
+
307
+ if (deps.length) addSection('Depends on', deps);
308
+ if (rdeps.length) addSection('Required by', rdeps);
309
+ if (!deps.length && !rdeps.length) {
310
+ const empty = document.createElement('div');
311
+ empty.className = CLS.ttlEmpty;
312
+ empty.textContent = 'No dependencies';
313
+ tooltip.appendChild(empty);
314
+ }
315
+ };
316
+
317
+ // Tooltip placement delegated to Floating UI. We build a virtual reference
318
+ // element that either follows the cursor (hover) or anchors to a node's
319
+ // viewport position (pinned), then run computePosition with flip + shift +
320
+ // size middleware so the tooltip always fits the viewport.
321
+ const FUI = window.FloatingUIDOM;
322
+ let lastMouse = null;
323
+ let anchorMode = 'cursor'; // 'cursor' (follows mouse) or 'node' (sticky to node)
324
+ let anchorNode = null;
325
+ let cleanupAutoUpdate = null;
326
+
327
+ const cursorRef = {
328
+ getBoundingClientRect() {
329
+ const x = lastMouse ? lastMouse.clientX : 0;
330
+ const y = lastMouse ? lastMouse.clientY : 0;
331
+ return { width: 0, height: 0, x, y, top: y, left: x, right: x, bottom: y };
332
+ },
333
+ };
334
+
335
+ const nodeRef = {
336
+ getBoundingClientRect() {
337
+ if (!anchorNode || !graph.hasNode(anchorNode)) {
338
+ return { width: 0, height: 0, x: 0, y: 0, top: 0, left: 0, right: 0, bottom: 0 };
339
+ }
340
+ const pos = renderer.getNodeDisplayData(anchorNode);
341
+ const vp = renderer.graphToViewport({ x: pos.x, y: pos.y });
342
+ const rect = container.getBoundingClientRect();
343
+ const r = (pos.size || 4) + 4;
344
+ const cx = rect.left + vp.x;
345
+ const cy = rect.top + vp.y;
346
+ return { width: r * 2, height: r * 2, x: cx - r, y: cy - r, top: cy - r, left: cx - r, right: cx + r, bottom: cy + r };
347
+ },
348
+ };
349
+
350
+ const updatePosition = async () => {
351
+ if (tooltip.style.display !== 'block') return;
352
+ const ref = anchorMode === 'node' ? nodeRef : cursorRef;
353
+ const { x, y } = await FUI.computePosition(ref, tooltip, {
354
+ placement: 'right-start',
355
+ strategy: 'fixed',
356
+ middleware: [
357
+ FUI.offset(12),
358
+ FUI.flip({ fallbackPlacements: ['left-start', 'right-end', 'left-end', 'top', 'bottom'] }),
359
+ FUI.shift({ padding: 12 }),
360
+ FUI.size({
361
+ padding: 12,
362
+ apply({ availableWidth, availableHeight, elements }) {
363
+ const maxW = Math.min(380, Math.max(220, availableWidth));
364
+ const maxH = Math.max(160, availableHeight);
365
+ Object.assign(elements.floating.style, {
366
+ maxWidth: maxW + 'px',
367
+ maxHeight: maxH + 'px',
368
+ overflowY: 'auto',
369
+ });
370
+ },
371
+ }),
372
+ ],
373
+ });
374
+ Object.assign(tooltip.style, { left: x + 'px', top: y + 'px' });
375
+ };
376
+
377
+ const stopAutoUpdate = () => {
378
+ if (cleanupAutoUpdate) { cleanupAutoUpdate(); cleanupAutoUpdate = null; }
379
+ };
380
+
381
+ // Auto-update is only used for the node-anchored (pinned) mode, where the
382
+ // reference is stable across events but its viewport position changes when
383
+ // the user pans, zooms, or resizes. In cursor mode we drive recomputation
384
+ // ourselves from the mousemove handler.
385
+ const startAutoUpdate = () => {
386
+ stopAutoUpdate();
387
+ if (anchorMode === 'node') {
388
+ cleanupAutoUpdate = FUI.autoUpdate(nodeRef, tooltip, updatePosition);
210
389
  }
211
- if (shown) {
212
- shown.textContent = String(visible);
390
+ };
391
+
392
+ const showTooltipFor = (name, mode = 'cursor') => {
393
+ anchorMode = mode;
394
+ anchorNode = mode === 'node' ? name : null;
395
+ setTooltipContent(name);
396
+ tooltip.style.display = 'block';
397
+ startAutoUpdate();
398
+ updatePosition();
399
+ };
400
+
401
+ const hideTooltip = () => {
402
+ stopAutoUpdate();
403
+ tooltip.style.display = 'none';
404
+ tooltip.dataset.pinned = 'false';
405
+ anchorNode = null;
406
+ };
407
+
408
+ renderer.on('enterNode', (e) => {
409
+ hoveredNode = e.node;
410
+ if (!pinned) showTooltipFor(e.node, 'cursor');
411
+ renderer.refresh({ skipIndexation: true });
412
+ });
413
+
414
+ renderer.on('leaveNode', () => {
415
+ hoveredNode = null;
416
+ if (!pinned) hideTooltip();
417
+ renderer.refresh({ skipIndexation: true });
418
+ });
419
+
420
+ // Click a node to pin it; the anchor switches from the cursor to the node
421
+ // so the tooltip stays attached even when the mouse moves away.
422
+ renderer.on('clickNode', (e) => {
423
+ focusedNode = e.node;
424
+ pinned = true;
425
+ tooltip.dataset.pinned = 'true';
426
+ showTooltipFor(e.node, 'node');
427
+ renderer.refresh({ skipIndexation: true });
428
+ });
429
+
430
+ renderer.on('clickStage', () => {
431
+ if (pinned || focusedNode) {
432
+ focusedNode = null;
433
+ pinned = false;
434
+ tooltip.dataset.pinned = 'false';
435
+ if (hoveredNode) {
436
+ showTooltipFor(hoveredNode, 'cursor');
437
+ } else {
438
+ hideTooltip();
439
+ }
440
+ renderer.refresh({ skipIndexation: true });
213
441
  }
214
- const showEmpty = visible === 0;
215
- if (empty && showEmpty !== emptyShown) {
216
- empty.style.display = showEmpty ? 'block' : 'none';
217
- emptyShown = showEmpty;
442
+ });
443
+
444
+ let posRafQueued = false;
445
+ container.addEventListener('mousemove', (e) => {
446
+ lastMouse = { clientX: e.clientX, clientY: e.clientY };
447
+ if (anchorMode === 'cursor' && tooltip.style.display === 'block' && !posRafQueued) {
448
+ posRafQueued = true;
449
+ requestAnimationFrame(() => {
450
+ posRafQueued = false;
451
+ updatePosition();
452
+ });
218
453
  }
454
+ });
455
+
456
+ const focusOnNode = (name, { pin = true } = {}) => {
457
+ if (!graph.hasNode(name)) return;
458
+ const pos = renderer.getNodeDisplayData(name);
459
+ if (pos) renderer.getCamera().animate({ x: pos.x, y: pos.y, ratio: 0.3 }, { duration: 600 });
460
+ focusedNode = name;
461
+ pinned = pin;
462
+ if (pin) tooltip.dataset.pinned = 'true';
463
+ showTooltipFor(name, pin ? 'node' : 'cursor');
464
+ renderer.refresh({ skipIndexation: true });
219
465
  };
220
466
 
221
- // Coalesce typing-driven updates to one pass per frame; rapid keystrokes
222
- // (paste, IME) collapse into a single filter sweep.
223
- let pending = 0;
224
- const scheduleApply = () => {
225
- if (pending) {
467
+ // ── Search results ───────────────────────────────────────────────────
468
+ const totalNodes = data.nodes.length;
469
+ const renderResults = () => {
470
+ filterResults.textContent = '';
471
+ if (!filterTerm) {
472
+ filterResults.dataset.open = 'false';
473
+ filterCount.textContent = '';
474
+ filterCount.dataset.state = '';
475
+ activeMatchIndex = -1;
226
476
  return;
227
477
  }
228
- pending = requestAnimationFrame(() => {
229
- pending = 0;
230
- apply();
478
+ filterCount.textContent = matches.length + ' / ' + totalNodes;
479
+ filterCount.dataset.state = matches.length === 0 ? 'zero' : '';
480
+ if (matches.length === 0) {
481
+ const empty = document.createElement('div');
482
+ empty.className = CLS.matchEmpty;
483
+ const b = document.createElement('b'); b.textContent = 'No matches'; b.className = 'text-fg';
484
+ empty.appendChild(b);
485
+ empty.appendChild(document.createTextNode(' for "' + filterTerm + '"'));
486
+ filterResults.appendChild(empty);
487
+ filterResults.dataset.open = 'true';
488
+ activeMatchIndex = -1;
489
+ return;
490
+ }
491
+ const limit = Math.min(matches.length, 24);
492
+ for (let i = 0; i < limit; i++) {
493
+ const m = matches[i];
494
+ const row = document.createElement('div');
495
+ row.className = CLS.matchItem;
496
+ row.setAttribute('role', 'option');
497
+ row.dataset.index = String(i);
498
+ if (i === activeMatchIndex) row.setAttribute('aria-selected', 'true');
499
+
500
+ const nameEl = document.createElement('span');
501
+ nameEl.className = CLS.miName;
502
+ const idx = m.name.toLowerCase().indexOf(filterTerm);
503
+ if (idx >= 0) {
504
+ nameEl.appendChild(document.createTextNode(m.name.slice(0, idx)));
505
+ const mark = document.createElement('mark');
506
+ mark.className = CLS.miMark;
507
+ mark.textContent = m.name.slice(idx, idx + filterTerm.length);
508
+ nameEl.appendChild(mark);
509
+ nameEl.appendChild(document.createTextNode(m.name.slice(idx + filterTerm.length)));
510
+ } else {
511
+ nameEl.textContent = m.name;
512
+ }
513
+ row.appendChild(nameEl);
514
+
515
+ const kindEl = document.createElement('span');
516
+ kindEl.className = CLS.miKind;
517
+ kindEl.textContent = m.type === 'application' ? 'app' : 'lib';
518
+ row.appendChild(kindEl);
519
+
520
+ row.addEventListener('mousedown', (ev) => {
521
+ ev.preventDefault();
522
+ focusOnNode(m.name);
523
+ filterResults.dataset.open = 'false';
524
+ });
525
+ filterResults.appendChild(row);
526
+ }
527
+ if (matches.length > limit) {
528
+ const more = document.createElement('div');
529
+ more.className = CLS.matchEmpty;
530
+ more.textContent = '+ ' + (matches.length - limit) + ' more — refine to see';
531
+ filterResults.appendChild(more);
532
+ }
533
+ filterResults.dataset.open = 'true';
534
+ };
535
+
536
+ const recomputeMatches = () => {
537
+ if (!filterTerm) { matches = []; return; }
538
+ matches = [];
539
+ for (const n of data.nodes) {
540
+ if (n.name.toLowerCase().includes(filterTerm)) matches.push(n);
541
+ }
542
+ matches.sort((a, b) => {
543
+ // Apps first, then by closeness of match position, then by name.
544
+ if (a.type !== b.type) return a.type === 'application' ? -1 : 1;
545
+ const ai = a.name.toLowerCase().indexOf(filterTerm);
546
+ const bi = b.name.toLowerCase().indexOf(filterTerm);
547
+ if (ai !== bi) return ai - bi;
548
+ return a.name.localeCompare(b.name);
231
549
  });
232
550
  };
233
551
 
234
- filterInput?.addEventListener('input', scheduleApply);
235
- sevSelect?.addEventListener('change', apply);
552
+ let rafQueued = false;
553
+ filterInput.addEventListener('input', () => {
554
+ filterTerm = filterInput.value.toLowerCase().trim();
555
+ recomputeMatches();
556
+ activeMatchIndex = matches.length ? 0 : -1;
557
+ renderResults();
558
+ if (!rafQueued) {
559
+ rafQueued = true;
560
+ requestAnimationFrame(() => {
561
+ rafQueued = false;
562
+ renderer.refresh({ skipIndexation: true });
563
+ });
564
+ }
565
+ });
566
+
567
+ filterInput.addEventListener('focus', () => {
568
+ if (filterTerm) filterResults.dataset.open = 'true';
569
+ });
236
570
 
237
- // Keyboard: "/" focuses the filter, Esc clears every active filter.
238
- document.addEventListener('keydown', (event) => {
239
- if (event.key === '/' && document.activeElement !== filterInput) {
240
- event.preventDefault();
241
- filterInput?.focus();
242
- return;
571
+ document.addEventListener('mousedown', (e) => {
572
+ if (!filterResults.contains(e.target) && e.target !== filterInput) {
573
+ filterResults.dataset.open = 'false';
243
574
  }
244
- if (event.key === 'Escape') {
245
- if (filterInput) {
246
- filterInput.value = '';
575
+ });
576
+
577
+ filterInput.addEventListener('keydown', (e) => {
578
+ if (e.key === 'ArrowDown') {
579
+ if (matches.length) {
580
+ e.preventDefault();
581
+ activeMatchIndex = (activeMatchIndex + 1) % matches.length;
582
+ renderResults();
583
+ }
584
+ } else if (e.key === 'ArrowUp') {
585
+ if (matches.length) {
586
+ e.preventDefault();
587
+ activeMatchIndex = (activeMatchIndex - 1 + matches.length) % matches.length;
588
+ renderResults();
247
589
  }
248
- if (sevSelect) {
249
- sevSelect.value = '';
590
+ } else if (e.key === 'Enter') {
591
+ if (matches.length && activeMatchIndex >= 0) {
592
+ e.preventDefault();
593
+ focusOnNode(matches[activeMatchIndex].name);
594
+ filterResults.dataset.open = 'false';
250
595
  }
251
- apply();
252
- filterInput?.blur();
253
596
  }
254
597
  });
255
598
 
256
- // Click-to-copy on remediation command bars (event-delegated).
257
- document.addEventListener('click', (event) => {
258
- const target = event.target?.closest?.('.copyable');
259
- // Guard re-entry during the 1s revert: a second click would otherwise
260
- // capture "✓ copied to clipboard" as the original and never restore it.
261
- if (!target || target.classList.contains('copied')) {
262
- return;
599
+ // ── Legend / category filter ─────────────────────────────────────────
600
+ const legend = document.getElementById('legend');
601
+ const toggleCategory = (key) => {
602
+ if (!(key in visible)) return;
603
+ visible[key] = !visible[key];
604
+ const row = legend?.querySelector('[data-toggle="' + key + '"]');
605
+ if (row) {
606
+ row.dataset.state = visible[key] ? 'on' : 'off';
607
+ row.setAttribute('aria-checked', String(visible[key]));
263
608
  }
264
- const cmd = target.dataset.cmd ?? target.textContent ?? '';
265
- navigator.clipboard?.writeText(cmd).then(() => {
266
- const orig = target.textContent;
267
- target.classList.add('copied');
268
- target.textContent = '✓ copied to clipboard';
269
- setTimeout(() => {
270
- target.textContent = orig;
271
- target.classList.remove('copied');
272
- }, 1000);
273
- }).catch(() => {});
609
+ renderer.refresh({ skipIndexation: true });
610
+ };
611
+ let previewRafQueued = false;
612
+ const queuePreviewRefresh = () => {
613
+ if (previewRafQueued) return;
614
+ previewRafQueued = true;
615
+ requestAnimationFrame(() => {
616
+ previewRafQueued = false;
617
+ renderer.refresh({ skipIndexation: true });
618
+ });
619
+ };
620
+ legend?.querySelectorAll('[data-toggle]').forEach((row) => {
621
+ row.addEventListener('click', () => toggleCategory(row.dataset.toggle));
622
+ row.addEventListener('mouseenter', () => {
623
+ previewCategory = row.dataset.toggle;
624
+ queuePreviewRefresh();
625
+ });
626
+ row.addEventListener('mouseleave', () => {
627
+ previewCategory = null;
628
+ queuePreviewRefresh();
629
+ });
630
+ row.addEventListener('focus', () => {
631
+ previewCategory = row.dataset.toggle;
632
+ queuePreviewRefresh();
633
+ });
634
+ row.addEventListener('blur', () => {
635
+ previewCategory = null;
636
+ queuePreviewRefresh();
637
+ });
638
+ row.addEventListener('keydown', (e) => {
639
+ if (e.key === ' ' || e.key === 'Enter') {
640
+ e.preventDefault();
641
+ toggleCategory(row.dataset.toggle);
642
+ }
643
+ });
644
+ });
645
+
646
+ // ── Camera controls ──────────────────────────────────────────────────
647
+ const resetView = () => {
648
+ renderer.getCamera().animatedReset({ duration: 600 });
649
+ };
650
+
651
+ const applyTheme = () => {
652
+ theme = css();
653
+ graph.forEachNode((node, attrs) => {
654
+ graph.setNodeAttribute(node, 'color', colorForNode(attrs.kind));
655
+ });
656
+ graph.forEachEdge((edge, attrs) => {
657
+ graph.setEdgeAttribute(edge, 'color', colorForEdge(attrs.depType));
658
+ });
659
+ renderer.setSetting('labelColor', { color: theme.fg });
660
+ renderer.setSetting('defaultEdgeColor', theme.edge);
661
+ renderer.setSetting('defaultNodeColor', theme.lib);
662
+ renderer.refresh();
663
+ };
664
+
665
+ themeBtn?.addEventListener('click', () => {
666
+ const isDark = root.dataset.theme ? root.dataset.theme === 'dark' : mql.matches;
667
+ const next = isDark ? 'light' : 'dark';
668
+ root.dataset.theme = next;
669
+ try { localStorage.setItem('vis-graph-theme', next); } catch {}
670
+ applyTheme();
671
+ });
672
+
673
+ mql.addEventListener('change', () => {
674
+ if (!root.dataset.theme) applyTheme();
274
675
  });
275
676
 
276
- apply();
677
+ // Keyboard shortcuts: '/' focuses search, 'R' fits view, Esc clears + unpins.
678
+ window.addEventListener('keydown', (e) => {
679
+ const inField = document.activeElement === filterInput;
680
+ if (e.key === '/' && !inField) {
681
+ e.preventDefault();
682
+ filterInput.focus();
683
+ filterInput.select();
684
+ } else if ((e.key === 'r' || e.key === 'R') && !inField) {
685
+ e.preventDefault();
686
+ resetView();
687
+ } else if (e.key === 'Escape') {
688
+ if (inField) {
689
+ filterInput.value = '';
690
+ filterTerm = '';
691
+ matches = [];
692
+ renderResults();
693
+ renderer.refresh({ skipIndexation: true });
694
+ filterInput.blur();
695
+ } else if (pinned || focusedNode) {
696
+ focusedNode = null;
697
+ pinned = false;
698
+ tooltip.dataset.pinned = 'false';
699
+ if (!hoveredNode) hideTooltip();
700
+ renderer.refresh({ skipIndexation: true });
701
+ }
702
+ }
703
+ });
277
704
  })();
278
705
  <\/script>
279
706
  </body>
280
- </html>
281
- `},"emitAuditHtml");var Ei=Object.defineProperty,Xe=R((e,t)=>Ei(e,"name",{value:t,configurable:!0}),"u$2");const Oi={CRITICAL:"CRITICAL",HIGH:"HIGH",LOW:"LOW",MODERATE:"MEDIUM",UNKNOWN:"NONE"},He=Xe((e,t)=>`pkg:npm/${e}@${t}`,"productId"),wt=Xe((e,t)=>{const a=new Map;for(const i of e){const r=t(i),n=a.get(r);n?n.push(i):a.set(r,[i])}return a},"groupBy"),Pi=Xe(e=>{const t=e.now??new Date,a=t.toISOString(),i=e.trackingId??`vis-audit-${t.toISOString().slice(0,10)}`,r=[...wt(e.findings,o=>o.packageName).entries()].sort(([o],[c])=>o.localeCompare(c)).map(([o,c])=>({branches:[...new Set(c.map(l=>l.packageVersion))].sort().map(l=>{const d=He(o,l);return{category:"product_version",name:l,product:{name:`${o}@${l}`,product_id:d,product_identification_helper:{purl:d}}}}),category:"product_name",name:o})),n=[...wt(e.findings,o=>o.vulnerability.id).entries()].sort(([o],[c])=>o.localeCompare(c)).map(([o,c])=>{const l=c[0].vulnerability,d=[...new Set(c.map($=>He($.packageName,$.packageVersion)))].sort(),m=o.startsWith("CVE-"),b=[o,...l.aliases??[]],h=m?o:b.find($=>$.startsWith("CVE-")),w=b.filter($=>$!==h).map($=>({system_name:$.startsWith("GHSA-")?"GitHub Security Advisory":"OSV",text:$})),y=Ze(l),g=c.filter($=>$.acknowledged).map($=>He($.packageName,$.packageVersion));return{...h?{cve:h}:{},...w.length>0?{ids:w}:{},notes:[{category:"description",text:l.summary||`Advisory ${o}`,title:"Advisory description"}],product_status:{known_affected:d},references:[{category:"external",summary:`${o} advisory record`,url:V(o)}],scores:[{cvss_v3:{baseScore:y,baseSeverity:Oi[l.severity]??"NONE",vectorString:"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",version:"3.1"},products:d}],title:l.summary.split(`
282
- `)[0]?.slice(0,200)||o,...g.length>0?{flags:[{label:"inline_mitigations_already_exist",product_ids:g}]}:{}}});return{document:{category:"csaf_vex",csaf_version:"2.0",distribution:{tlp:{label:"WHITE"}},publisher:{category:"vendor",name:e.tool.name,namespace:e.tool.informationUri},title:`vis audit · ${i}`,tracking:{current_release_date:a,id:i,initial_release_date:a,revision_history:[{date:a,number:"1",summary:"Initial audit emission"}],status:"final",version:"1"}},...r.length>0?{product_tree:{branches:r}}:{},...n.length>0?{vulnerabilities:n}:{}}},"emitCsaf");var Di=Object.defineProperty,Qe=R((e,t)=>Di(e,"name",{value:t,configurable:!0}),"l$1");const Li={CRITICAL:"critical",HIGH:"high",LOW:"low",MODERATE:"medium",UNKNOWN:"unknown"},yt=Qe((e,t)=>{const a=new Map;for(const i of e){const r=t(i),n=a.get(r);n?n.push(i):a.set(r,[i])}return a},"groupBy"),Mi=Qe((e,t=new Date)=>{const a=yt(e,r=>r.vulnerability.id),i=t.toISOString();return[...a.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>{const o=n[0].vulnerability,c=Li[o.severity]??"unknown",l=Ze(o),d=[...yt(n,y=>y.packageName).entries()].sort(([y],[g])=>y.localeCompare(g)).map(([y,g])=>{const $=[...new Set(g.map(x=>x.packageVersion))].sort();return{ref:ja(y,$[0]),versions:$.map(x=>({status:"affected",version:x}))}}),m=(o.aliases??[]).filter(y=>y!==r).map(y=>({id:y,source:{name:je(y),url:V(y)}})),b=n.some(y=>y.acknowledged),h=n.every(y=>y.acknowledged)?{justification:"code_not_reachable",response:["will_not_fix"],state:"not_affected"}:b?{state:"in_triage"}:void 0,w=o.fixedVersions??[];return{"bom-ref":`vuln:${r}`,id:r,source:{name:je(r),url:V(r)},...m.length>0?{references:m}:{},description:o.summary||`Advisory ${r}`,ratings:[{method:"CVSSv31",score:l,severity:c,source:{name:je(r),url:V(r)}}],...w.length>0?{recommendation:`Upgrade to one of: ${w.join(", ")}`}:{},affects:d,created:i,published:i,...h?{analysis:h}:{}}})},"buildCycloneDxVulnerabilities"),Ti=Qe(e=>{const t=Mi(e.findings,e.now);return{...e.bom,vulnerabilities:t}},"emitCycloneDxVex");var Vi=Object.defineProperty,et=R((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"c$2");const Lt="15.2.1",zi=`https://gitlab.com/gitlab-org/security-products/security-report-schemas/-/raw/v${Lt}/dist/dependency-scanning-report-format.json`,Wi={CRITICAL:"Critical",HIGH:"High",LOW:"Low",MODERATE:"Medium",UNKNOWN:"Unknown"},_i={block:"High",info:"Info",warn:"Medium"},Fi=Uint8Array.from([107,167,184,18,157,173,17,209,128,180,0,192,79,212,48,200]),bt=et(e=>{const t=Ia("sha1");t.update(Fi),t.update(e,"utf8");const a=t.digest();a[6]=(a[6]??0)&15|80,a[8]=(a[8]??0)&63|128;const i=a.subarray(0,16).toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`},"uuidV5"),xt=et(e=>e.startsWith("CVE-")?{name:e,type:"cve",url:V(e),value:e}:e.startsWith("GHSA-")?{name:e,type:"ghsa",url:V(e),value:e}:{name:e,type:"osv",url:V(e),value:e},"identifierFromAdvisoryId"),Ui=et(e=>{const t=(e.now??new Date).toISOString().replace(/\.\d{3}Z$/,""),a=e.artifactUri??(Ot(e.workspaceRoot,`${e.workspaceRoot}/package.json`)||"package.json"),i=[];for(const r of e.findings){const{acknowledged:n,packageName:o,packageVersion:c,vulnerability:l}=r,d=[xt(l.id)];for(const w of l.aliases??[])w!==l.id&&d.push(xt(w));const m=[{name:`${je(l.id)} advisory`,url:V(l.id)}],b=l.summary||`Advisory ${l.id}`,h=l.fixedVersions.length>0?`Upgrade ${o} to ${l.fixedVersions.join(" or ")}`:void 0;i.push({description:b,...n?{flags:[{description:"Acknowledged via vis accepted-risks",origin:"vis",type:"flagged-as-likely-false-positive"}]}:{},id:bt(`vis-audit|${l.id}|${o}@${c}`),identifiers:d,links:m,location:{dependency:{package:{name:o},version:c},file:a},name:`${l.id}: ${o}@${c}`,severity:Wi[l.severity],...h?{solution:h}:{}})}for(const r of e.policyDecisions??[]){if(r.policy==="vulnerability")continue;const n=`vis.policy.${r.policy}`;i.push({description:r.reason,...r.acceptedRisk?{flags:[{description:"Acknowledged via vis accepted-risks",origin:"vis",type:"flagged-as-likely-false-positive"}]}:{},id:bt(`vis-audit|${n}|${r.packageName}@${r.version}`),identifiers:[{name:n,type:"vis_policy",url:`https://visulima.com/packages/vis/commands/audit#policy-${r.policy}`,value:n}],links:[{name:`vis policy: ${r.policy}`,url:`https://visulima.com/packages/vis/commands/audit#policy-${r.policy}`}],location:{dependency:{package:{name:r.packageName},version:r.version},file:a},name:`vis policy '${r.policy}': ${r.packageName}@${r.version}`,severity:_i[r.severity]})}return{scan:{analyzer:{id:e.tool.name,name:e.tool.name,url:e.tool.informationUri,vendor:{name:"Visulima"},version:e.tool.version},end_time:t,scanner:{id:e.tool.name,name:e.tool.name,url:e.tool.informationUri,vendor:{name:"Visulima"},version:e.tool.version},start_time:t,status:"success",type:"dependency_scanning"},schema:zi,version:Lt,vulnerabilities:i}},"emitGitlabDepScan");var Hi=Object.defineProperty,ue=R((e,t)=>Hi(e,"name",{value:t,configurable:!0}),"u$1");const Q=ue(e=>e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;"),"escapeAttribute"),kt=ue(e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,"cdata"),Gi=ue(e=>{let t="";return e.status==="skipped"?t=` <skipped/>
283
- `:e.status==="failure"?t=` <failure type="${Q(e.failureType)}" message="${Q(e.failureMessage)}">${kt(e.failureText)}</failure>
284
- `:e.systemOut!==void 0&&(t=` <system-out>${kt(e.systemOut)}</system-out>
285
- `),` <testcase classname="${Q(e.classname)}" name="${Q(e.name)}">
286
- ${t} </testcase>
287
- `},"renderTestcase"),$t=ue((e,t,a)=>{const i=t.filter(c=>c.status==="failure").length,r=t.filter(c=>c.status==="skipped").length,n=t.length,o=t.map(Gi).join("");return` <testsuite name="${Q(e)}" tests="${String(n)}" failures="${String(i)}" skipped="${String(r)}" errors="0" timestamp="${Q(a)}" time="0">
288
- ${o} </testsuite>
289
- `},"renderTestsuite"),Bi=ue(e=>{const t=(e.now??new Date).toISOString().replace(/\.\d{3}Z$/,""),a=e.suiteName??"vis-audit",i=e.findings.map(d=>{const{acknowledged:m,packageName:b,packageVersion:h,vulnerability:w}=d,y=w.fixedVersions.length>0?` (fix: ${w.fixedVersions.join(", ")})`:"";return{classname:`${b}@${h}`,failureMessage:`${Ke(w.severity).toUpperCase()} ${w.id} — ${w.summary.split(`
290
- `)[0]?.slice(0,200)??w.id}`,failureText:`${w.id}: ${b}@${h}
291
- ${w.summary||`Advisory ${w.id}`}${y}`,failureType:Ke(w.severity).toUpperCase(),name:w.id,status:m?"skipped":"failure"}}),r=(e.policyDecisions??[]).filter(d=>d.policy!=="vulnerability").map(d=>{let m;return d.acceptedRisk?m="skipped":d.severity==="info"?m="passing":m="failure",{classname:`${d.packageName}@${d.version}`,failureMessage:`${d.severity.toUpperCase()} vis.policy.${d.policy}`,failureText:d.reason,failureType:d.severity.toUpperCase(),name:`vis.policy.${d.policy}`,status:m,...m==="passing"?{systemOut:d.reason}:{}}}),n=i.length+r.length,o=i.filter(d=>d.status==="failure").length+r.filter(d=>d.status==="failure").length,c=i.filter(d=>d.status==="skipped").length+r.filter(d=>d.status==="skipped").length;let l=`<?xml version="1.0" encoding="UTF-8"?>
292
- <testsuites name="${Q(a)}" tests="${String(n)}" failures="${String(o)}" skipped="${String(c)}" errors="0" time="0">
293
- `;return l+=$t("vulnerabilities",i,t),r.length>0&&(l+=$t("policies",r,t)),l+=`</testsuites>
294
- `,l},"emitJUnitAudit");var Ki=Object.defineProperty,qi=R((e,t)=>Ki(e,"name",{value:t,configurable:!0}),"g$1");const Ji=qi(e=>{const t=new Map,a=[],i=e.artifactUri??(Ot(e.workspaceRoot,Ea(e.workspaceRoot,"package.json"))||"package.json");for(const o of e.findings){const{acknowledged:c,packageName:l,packageVersion:d,vulnerability:m}=o,b=hi(m.severity),h=Ke(m.severity);t.has(m.id)||t.set(m.id,{defaultConfiguration:{level:b},fullDescription:{text:m.summary||`Advisory ${m.id}`},helpUri:V(m.id),id:m.id,name:m.id,properties:{precision:"very-high","security-severity":wi(m),"severity-label":h,tags:["security","vulnerability","supply-chain",`severity:${h}`]},shortDescription:{text:(m.summary.split(`
295
- `)[0]??m.id).slice(0,200)}}),a.push({level:b,locations:[{logicalLocations:[{kind:"package",name:`${l}@${d}`}],physicalLocation:{artifactLocation:{uri:i}}}],message:{text:`${m.id}: ${l}@${d} — ${m.summary||"no summary"}${m.fixedVersions.length>0?` (fix: ${m.fixedVersions.join(", ")})`:""}`},partialFingerprints:{advisoryId:m.id,package:l,version:d},properties:{...c?{acknowledged:!0}:{},...m.aliases&&m.aliases.length>0?{aliases:m.aliases}:{},...typeof m.cvssScore=="number"?{cvssScore:m.cvssScore}:{},...m.fixedVersions.length>0?{fixedVersions:m.fixedVersions}:{},packageName:l,packageVersion:d,severityLabel:h},ruleId:m.id})}const r={block:"error",info:"note",warn:"warning"},n={block:"high",info:"none",warn:"medium"};for(const o of e.policyDecisions??[]){if(o.policy==="vulnerability")continue;const c=`vis.policy.${o.policy}`,l=r[o.severity],d=n[o.severity];t.has(c)||t.set(c,{defaultConfiguration:{level:l},fullDescription:{text:`vis policy '${o.policy}' (Socket.dev-style supply-chain gate)`},helpUri:`https://visulima.com/packages/vis/commands/audit#policy-${o.policy}`,id:c,name:c,properties:{precision:"high","security-severity":o.severity==="block"?"8.0":o.severity==="warn"?"5.5":"0.0","severity-label":d,tags:["security","supply-chain","policy",`policy:${o.policy}`]},shortDescription:{text:`vis policy: ${o.policy}`}}),a.push({level:l,locations:[{logicalLocations:[{kind:"package",name:`${o.packageName}@${o.version}`}],physicalLocation:{artifactLocation:{uri:i}}}],message:{text:o.reason},partialFingerprints:{package:o.packageName,policy:o.policy,version:o.version},properties:{...o.acceptedRisk?{acknowledged:!0}:{},packageName:o.packageName,packageVersion:o.version,severityLabel:d},ruleId:c})}return{$schema:"https://json.schemastore.org/sarif-2.1.0.json",runs:[{results:a,tool:{driver:{informationUri:e.tool.informationUri,name:e.tool.name,rules:[...t.values()],version:e.tool.version}}}],version:"2.1.0"}},"emitSarif");var Yi=Object.defineProperty,re=R((e,t)=>Yi(e,"name",{value:t,configurable:!0}),"c$1");const Zi=["dependencies","devDependencies","optionalDependencies","peerDependencies"],St=re(e=>{try{return{path:e,pkg:It(e)}}catch{return}},"readPackageJsonSafe"),Xi=re(e=>{const t=[],a=St(U(e,"package.json"));a&&t.push({path:a.path,pkg:a.pkg,workspaceName:a.pkg.name});const i=oa(e);let r;if(i?r=i:a?.pkg.workspaces&&(Array.isArray(a.pkg.workspaces)?r=a.pkg.workspaces:a.pkg.workspaces.packages&&(r=a.pkg.workspaces.packages)),!r)return t;for(const n of sa(e,r)){const o=St(U(e,n,"package.json"));o&&t.push({path:o.path,pkg:o.pkg,workspaceName:o.pkg.name})}return t},"collectWorkspaceManifests"),Qi=re((e,t)=>{const a=[];for(const i of e)for(const r of Zi){const n=i.pkg[r]?.[t];typeof n=="string"&&a.push({field:r,manifest:i,range:n})}return a},"findDeclarations"),Mt=re(e=>{const t=Xi(e.workspaceRoot),a=[],i=[],r=[],n=new Set;for(const o of e.findings){const c=o.vulnerability.fixedVersions[0];if(!c){r.push({packageName:o.packageName,reason:"no-fixed-version"});continue}const l=Qi(t,o.packageName);if(l.length===0){r.push({packageName:o.packageName,reason:"transitive-only"});continue}const d=T.coerce(c),m=d?`^${d.version}`:c,b=d?d.version:c;for(const h of l){const w=`${h.manifest.path}::${h.field}::${o.packageName}::${b}`;if(n.has(w))continue;n.add(w);const y=tr(b,h.range),g={currentRange:h.range,field:h.field,inRange:y,manifestPath:h.manifest.path,packageName:o.packageName,targetSpec:m,targetVersion:b,workspaceName:h.manifest.workspaceName};y||e.allowMajor===!0?a.push(g):i.push(g)}}return{apply:a,skippedMajor:i,unmatched:r}},"buildDirectApplyPlan"),er=/^(?:workspace|file|link|portal|patch|git\+|git:|github:|npm:|catalog|jsr|http|https):/i,tr=re((e,t)=>{if(er.test(t))return!0;const a=T.coerce(e)?.version??e;try{return T.satisfies(a,t)}catch{return!0}},"satisfiesRange"),ar=re(e=>{const t=[];if(e.apply.length>0){t.push(`Apply (${String(e.apply.length)}):`);for(const a of e.apply){const i=a.workspaceName?` [${a.workspaceName}]`:"";t.push(` + ${a.packageName}: ${a.currentRange} → ${a.targetSpec}${i}`)}}if(e.skippedMajor.length>0){t.push(`Skipped — major bump (${String(e.skippedMajor.length)}, requires --allow-major):`);for(const a of e.skippedMajor){const i=a.workspaceName?` [${a.workspaceName}]`:"";t.push(` ! ${a.packageName}: ${a.currentRange} → ${a.targetSpec}${i}`)}}if(e.unmatched.length>0){const a=e.unmatched.filter(r=>r.reason==="transitive-only"),i=e.unmatched.filter(r=>r.reason==="no-fixed-version");if(a.length>0){t.push(`Transitive only (${String(a.length)}, requires --fix-transitive):`);for(const r of a)t.push(` · ${r.packageName}`)}if(i.length>0){t.push(`No fixed version available (${String(i.length)}):`);for(const r of i)t.push(` · ${r.packageName}`)}}return t.length===0?"No direct-dep fixes to apply.":t.join(`
296
- `)},"formatDirectApplyPlan");var ir=Object.defineProperty,De=R((e,t)=>ir(e,"name",{value:t,configurable:!0}),"l");const rr=5,nr=64,or=De((e,t)=>{if(t.length===0)return[];const a=new Set;for(const i of e){if(t.includes(i)){a.add(i);continue}let r=!1;for(const n of t)try{T.satisfies(n,i)&&(a.add(n),r=!0)}catch{}!r&&t.length===1&&a.add(t[0])}return[...a]},"resolveSpecifierVersions"),sr=De(e=>{const t=new Map;for(const r of e.entries){let n=t.get(r.name);n||(n=[],t.set(r.name,n)),n.includes(r.version)||n.push(r.version)}const a=new Map;for(const r of e.entries){const n=`${r.name}@${r.version}`;let o=a.get(n);o||(o=new Map,a.set(n,o));for(const c of[r.dependencies,r.peerDependencies,r.optionalDependencies])if(c)for(const[l,d]of Object.entries(c)){const m=t.get(l)??[],b=or(d,m);for(const h of b){const w=`${l}@${h}`;o.has(w)||o.set(w,{name:l,version:h})}}}const i=new Map;for(const[r,n]of a)i.set(r,{children:[...n.values()]});return{adjacency:i,versionsByName:t}},"buildAdjacency"),cr=De((e,t)=>{const a=t.get(e.name);if(!(!a||a.length===0)){if(a.includes(e.version))return{name:e.name,version:e.version};for(const i of a)try{if(T.satisfies(i,e.version))return{name:e.name,version:i}}catch{}if(a.length===1)return{name:e.name,version:a[0]}}},"resolveRootNode"),lr=De((e,t,a={})=>{const i=a.maxPathsPerTarget??rr,r=a.maxDepth??nr;if(i<=0)return[];const{adjacency:n,versionsByName:o}=sr(e),c=`${t.name}@${t.version}`,l=[],d=[],m=new Set;for(const w of e.roots){const y=cr(w,o);if(!y)continue;const g=`${y.name}@${y.version}`;m.has(g)||(m.add(g),d.push(y))}const b=[];for(const w of d){const y=`${w.name}@${w.version}`;if(y===c){if(l.push([w]),l.length>=i)return l;continue}b.push({node:w,path:[w],visited:new Set([y])})}let h=0;for(;h<b.length&&l.length<i;){const w=b[h];if(h+=1,w.path.length>=r)continue;const y=n.get(`${w.node.name}@${w.node.version}`)?.children??[];for(const g of y){const $=`${g.name}@${g.version}`;if(w.visited.has($))continue;const x=[...w.path,g];if($===c){if(l.push(x),l.length>=i)return l;continue}const j=new Set(w.visited);j.add($),b.push({node:g,path:x,visited:j})}}return l},"buildDependencyPaths");var pr=Object.defineProperty,z=R((e,t)=>pr(e,"name",{value:t,configurable:!0}),"i");const dr={"crates.io":["Cargo.lock"],Go:["go.sum"],Maven:["gradle.lockfile","pom.xml"],PyPI:["uv.lock","poetry.lock","Pipfile.lock"],RubyGems:["Gemfile.lock"]},gr={cargo:"crates.io","crates.io":"crates.io",go:"Go",maven:"Maven",npm:"npm",pypi:"PyPI",rubygems:"RubyGems"},Tt=z(e=>gr[e.toLowerCase()]??e,"canonicalEcosystem"),ur=z((e,t)=>{const a=Tt(t),i=dr[a]??[];for(const r of i){const n=U(e,r);if(At(n))return n}},"findEcosystemLockfile"),fr=z(e=>{const t=new Set,a=[];for(const i of e){const r=`${i.name}@${i.version}`;t.has(r)||(t.add(r),a.push(i))}return a},"dedupe"),mr=/\[\[package\]\]([\s\S]*?)(?=\[\[|$)/g,hr=/^\s*name\s*=\s*"([^"]+)"\s*$/m,vr=/^\s*version\s*=\s*"([^"]+)"\s*$/m,wr=z(e=>{const t=[];for(const a of e.matchAll(mr)){const i=a[1]??"",r=hr.exec(i)?.[1],n=vr.exec(i)?.[1];r&&n&&t.push({isDev:!1,name:r,version:n})}return t},"parseTomlPackages"),yr=z(e=>{let t;try{t=JSON.parse(e)}catch{return[]}if(typeof t!="object"||t===null)return[];const a=[];for(const i of["default","develop"]){const r=t[i];if(!(typeof r!="object"||r===null))for(const[n,o]of Object.entries(r)){if(typeof o!="object"||o===null)continue;const c=o.version;if(typeof c!="string")continue;const l=c.replace(/^==/,"").trim();l.length>0&&a.push({isDev:!1,name:n,version:l})}}return a},"parsePipfileLock"),br=/<dependency>([\s\S]*?)<\/dependency>/g,xr=/<groupId>\s*([^<\s]+)\s*<\/groupId>/,kr=/<artifactId>\s*([^<\s]+)\s*<\/artifactId>/,$r=/<version>\s*([^<\s]+)\s*<\/version>/,Sr=z(e=>{const t=[];for(const a of e.matchAll(br)){const i=a[1]??"",r=xr.exec(i)?.[1],n=kr.exec(i)?.[1],o=$r.exec(i)?.[1];!r||!n||!o||o.startsWith("${")||t.push({isDev:!1,name:`${r}:${n}`,version:o})}return t},"parsePomXml"),Ar=z(e=>{const t=[];for(const a of e.split(/\r?\n/)){const i=a.trim();if(i.length===0||i.startsWith("#"))continue;const r=i.indexOf("="),n=(r===-1?i:i.slice(0,r)).split(":");if(n.length<3)continue;const[o,c,l]=n;!o||!c||!l||t.push({isDev:!1,name:`${o}:${c}`,version:l})}return t},"parseGradleLockfile"),Nr=z(e=>{const t=[];for(const a of e.split(/\r?\n/)){const i=a.trim();if(i.length===0)continue;const r=i.split(/\s+/);if(r.length<3)continue;const[n,o]=r;if(!n||!o?.endsWith("/go.mod"))continue;const c=o.slice(0,-7);c.length!==0&&t.push({isDev:!1,name:n,version:c})}return t},"parseGoSum"),Cr=/^ {4}([^ ()]+) \(([^()]+)\)\s*$/,jr=z(e=>{const t=[];let a=!1,i=!1;for(const r of e.split(/\r?\n/)){if(r.startsWith("GEM")){a=!0,i=!1;continue}if(a&&/^[A-Z]/.test(r)){a=!1,i=!1;continue}if(a&&r.trim()==="specs:"){i=!0;continue}if(i){const n=Cr.exec(r);if(n){const[,o,c]=n;o&&c&&t.push({isDev:!1,name:o,version:c})}}}return t},"parseGemfileLock"),Rr=z((e,t)=>{const a=ur(e,t);if(!a)return[];let i;try{i=Nt(a,"utf8")}catch{return[]}const r=a.split(/[/\\]/).pop()??"";let n;switch(r){case"Cargo.lock":case"poetry.lock":case"uv.lock":{n=wr(i);break}case"Gemfile.lock":{n=jr(i);break}case"go.sum":{n=Nr(i);break}case"gradle.lockfile":{n=Ar(i);break}case"Pipfile.lock":{n=yr(i);break}case"pom.xml":{n=Sr(i);break}default:return[]}return fr(n)},"lockedPackagesForEcosystem");var Ir=Object.defineProperty,ge=R((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"c");const Er=["ts","tsx","js","jsx","mjs","cjs","mts","cts"],Or=[/node_modules/,/\.git/,/\.next/,/\.cache/,/dist/,/build/,/coverage/,/\.turbo/,/\.nx/,/\.parcel-cache/],Pr=["dependencies","devDependencies","peerDependencies","optionalDependencies"],Dr=/(?:import|export)\s+(?:[\s\S]*?from\s+)?["']([^"'\n]+)["']/g,Lr=/(?:^|[^.\w$])require\s*\(\s*["']([^"'\n]+)["']\s*\)/g,Mr=/\bimport\s*\(\s*["']([^"'\n]+)["']\s*\)/g,Tr=ge(e=>{if(e.startsWith(".")||e.startsWith("/")||/^[a-z][a-z0-9+.-]*:/i.test(e))return;const t=e.trim();if(t.length!==0){if(t.startsWith("@")){const a=t.split("/");return a.length<2?void 0:`${a[0]}/${a[1]}`}return t.split("/")[0]}},"normalizePackageName"),Vr=ge(e=>{const t=new Set,a=e.replaceAll(/\/\*[\s\S]*?\*\//g,"").replaceAll(/(^|[^:])\/\/.*$/gm,"$1"),i=ge(r=>{r.lastIndex=0;let n;for(;(n=r.exec(a))!==null;){const o=Tr(n[1]);o&&t.add(o)}},"collect");return i(Dr),i(Lr),i(Mr),t},"extractImportedNames"),zr=ge(e=>{const t=new Set;try{const a=It(e);for(const i of Pr){const r=a[i];if(r&&typeof r=="object"&&!Array.isArray(r))for(const n of Object.keys(r))t.add(n)}}catch{}return t},"extractPackageJsonNames"),Wr=ge(e=>{const t=e.skip??Or,a=e.extensions??Er,i=new Set;let r=0;const n=vt(e.workspaceRoot,{extensions:a,includeDirs:!1,skip:t});for(const l of n){r+=1;try{const d=Nt(l,"utf8");for(const m of Vr(d))i.add(m)}catch{}}const o=vt(e.workspaceRoot,{extensions:["json"],includeDirs:!1,skip:t}).filter(l=>l.endsWith("/package.json")||l.endsWith(String.raw`\package.json`)||l.endsWith("package.json"));for(const l of o)for(const d of zr(l))i.add(d);if(e.alwaysAssumeUsed)for(const l of e.alwaysAssumeUsed)i.add(l);const c=new Set;for(const l of e.vulnerablePackages)i.has(l)&&c.add(l);return{filesScanned:r,importedTotal:i,reachable:c}},"computeReachableVulnerablePackages");var _r=Object.defineProperty,W=R((e,t)=>_r(e,"name",{value:t,configurable:!0}),"o");const Fr=W(e=>{const t=T.coerce(e)?.major;return t!==void 0&&t>=10},"PNPM_V10_PLUS"),Ur=W(e=>Object.fromEntries(Object.entries(e).sort(([t],[a])=>t.localeCompare(a))),"sortByKey"),Hr=W((e,t)=>`${JSON.stringify(e,void 0,t)}
297
- `,"stringifyJson"),Vt=W((e,t)=>{if(t.name==="pnpm"&&Fr(t.version))return{filePath:U(e,"pnpm-workspace.yaml"),surface:"pnpm-workspace.yaml"};const a=U(e,"package.json");return t.name==="pnpm"?{filePath:a,surface:"package.json#pnpm.overrides"}:t.name==="yarn"?{filePath:a,surface:"package.json#resolutions"}:{filePath:a,surface:"package.json#overrides"}},"resolveOverrideSurface"),Gr=W((e,t)=>{const{filePath:a,surface:i}=Vt(e,t);if(!ae(a))return{};if(i==="pnpm-workspace.yaml")try{return Ye(a)?.overrides??{}}catch{return{}}try{const r=JSON.parse(Ee(a));return i==="package.json#pnpm.overrides"?(r.pnpm??{}).overrides??{}:i==="package.json#resolutions"?r.resolutions??{}:r.overrides??{}}catch{return{}}},"readExistingOverrides"),Br=W((e,t)=>{const a=Object.keys(t).sort();if(a.length===0&&!/^overrides\s*:/m.test(e))return e;const i=`overrides:
298
- ${a.map(r=>` '${r}': '${t[r]}'`).join(`
299
- `)}
300
- `;if(e.length===0)return i;if(/^overrides\s*:/m.test(e)){const r=e.replace(/^overrides\s*:[^\n]*\n(?:[ \t][^\n]*\n)*/m,i);return r.endsWith(`
301
- `)?r:`${r}
302
- `}return`${e.endsWith(`
303
- `)?e:`${e}
304
- `}
305
- ${i}`},"renderPnpmWorkspaceOverrides"),Kr=W((e,t,a,i)=>{const r=ca(e,t.length>0?t:void 0),n=t.length>0?JSON.parse(t):{};if(a==="package.json#pnpm.overrides"){const o=n.pnpm??{};o.overrides=i,n.pnpm=o}else a==="package.json#resolutions"?n.resolutions=i:n.overrides=i;return Hr(n,r)},"renderPackageJsonWithOverrides"),qr=W((e,t,a)=>{const{filePath:i,surface:r}=Vt(e,a),n=Gr(e,a),o=ae(i)?Ee(i):"",c=[],l={...n};for(const h of t.entries){const w=n[h.packageName];if(w===h.spec){c.push({...h,previousSpec:w,status:"unchanged"});continue}w===void 0?c.push({...h,status:"added"}):c.push({...h,previousSpec:w,status:"updated"}),l[h.packageName]=h.spec}const d=Ur(l),m=c.some(h=>h.status!=="unchanged"),b=r==="pnpm-workspace.yaml"?Br(o,d):Kr(i,o,r,d);return{changed:m,entries:c,filePath:i,nextContent:b,previousContent:o,surface:r}},"planOverrideWrite"),Jr=W(e=>{if(!e.changed)return e;if(e.surface==="pnpm-workspace.yaml"&&e.previousContent.length===0)throw new Error(`${e.filePath} not found. Run \`pnpm init\` or create pnpm-workspace.yaml before applying overrides for pnpm v10+.`);const t=`${e.filePath}.tmp`;try{Ct(t,e.nextContent),Zt(t,e.filePath)}catch(a){try{Xt(t)}catch{}throw a}return e},"applyOverridePlan"),Yr=W(e=>{const t=new Map;for(const a of e){const i=a.vulnerability.fixedVersions[0];if(!i)continue;const r=T.coerce(i),n=r?`^${r.version}`:i;t.set(a.packageName,n)}return{entries:[...t.entries()].sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({packageName:a,spec:i}))}},"buildOverridePlanFromFindings");var Zr=Object.defineProperty,N=R((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"m");const Xr={critical:Ie,high:Rt,low:jt,medium:Re},qe=new Set(["cargo","crates.io","go","maven","npm","pypi","rubygems"]),Qr=N(e=>{const t=(e??"npm").split(",").map(r=>r.trim()).filter(r=>r.length>0),a=t.length>0?t:["npm"],i=a.filter(r=>!qe.has(r.toLowerCase()));return{all:a,unsupported:i}},"parseEcosystems"),en={CRITICAL:Ie,HIGH:Rt,LOW:jt,MODERATE:Re,UNKNOWN:L},tn=N((e,t,a,i)=>{const r=en[a.severity]??L,n=i?` ${L("[acknowledged]")}`:"",o=a.fixedVersions??[],c=o.length>0?` (fix: ${o.join(", ")})`:"";return` ${r(a.severity)} ${a.id} — ${e}@${t}${n}
306
- ${a.summary}${c}`},"formatVulnLine"),an=N((e,t)=>{const a=la(e),i=`${String(Math.round(e.score.overall*100))}%`,r=t?` ${L("[acknowledged]")}`:"",n=e.alerts.length>0?`, ${String(e.alerts.length)} alert${e.alerts.length===1?"":"s"}`:"";return` ${i} ${a}@${e.version} (${pa(e.score.overall)}${n})${r}`},"formatSocketLine"),rn=new Set(["aube","auto","vis"]),le=N(e=>e!==void 0&&rn.has(e),"isAuditBackend"),nn=N((e,t,a)=>{if(e!==void 0&&!le(e))throw new Error(`Invalid --backend value '${e}'. Expected one of: aube, auto, vis.`);const i=process.env.VIS_AUDIT_BACKEND;if(i!==void 0&&i!==""&&!le(i))throw new Error(`Invalid VIS_AUDIT_BACKEND value '${i}'. Expected one of: aube, auto, vis.`);const r=le(i)?i:void 0,n=le(t)?t:void 0,o=(le(e)?e:void 0)??r??n??"auto";return o==="aube"?"aube":o==="vis"?"vis":(a?.install?.backend??process.env.VIS_INSTALLER)==="aube"&&va("aube")!==null?"aube":"vis"},"resolveAuditBackend"),on=N(e=>{if(e!==void 0)switch(e){case"critical":return"critical";case"high":return"high";case"low":return"low";case"medium":return"moderate";default:return e}},"mapSeverityToAube"),sn=N((e,t,a)=>{const i=["audit"],r=on(t.severity);r!==void 0&&i.push("--audit-level",r),(t.prodOnly===!0||t.prod===!0)&&i.push("--prod"),(t.json===!0||t.format==="json")&&i.push("--json");const n=t.fix===!0;t["fix-transitive"]===!0||t.fixTransitive===!0?i.push("--fix=override"):n&&i.push("--fix=update");const o=[];t.offline===!0&&o.push("--offline (aube has its own offline cache)"),(t.format==="sarif"||t.format==="csaf"||t.format==="cyclonedx"||t.format==="cyclonedx-vex"||t.format==="gitlab"||t.format==="junit")&&o.push(`--format=${String(t.format)} (only json/text is forwarded to aube)`),o.length>0&&f.warn(`Delegating to 'aube audit'. Skipping vis-only flags: ${o.join(", ")}`);const c=Yt("aube",i,{cwd:e,stdio:"inherit"});if(c.error){const{code:l}=c.error;return l==="ENOENT"?f.error("Backend 'aube' selected but the 'aube' binary was not found on PATH. Install aube or run with --backend vis."):f.error(`Failed to spawn aube: ${c.error.message}`),1}return c.status??1},"runAubeAudit"),cn=N(async(e,t,a,i)=>{if(nn(t.backend,a?.security?.audit?.backend,a)==="aube"){process.exitCode=sn(e,t,a);return}const r=t.severity??"low",n=t.format??"table",o=n==="sarif",c=n==="csaf",l=n==="cyclonedx-vex"||n==="cyclonedx",d=n==="gitlab",m=n==="junit",b=n==="json"||!!t.json,h=t.report,w=a?.security?.audit,y=a?.security?.policies,g=t.offline===void 0?!!w?.offlineByDefault:!!t.offline,$=t.db,x=Qr(t.ecosystem),j=!!t.prodOnly,M=t.failOn??y?.vulnerability?.failOn,fe=!!t.showFixes,me=!!t.showAccepted,Le=a?.security?.acceptedRisks,tt=y?.vulnerability?.usage,_t=t.noUsage?!1:t.usage===void 0?!!tt?.enabled:!!t.usage,E=b||o||c||l||d||m,at=t.explain,Me=at!==void 0,it=Me&&!o&&!c&&!l&&!d&&!m;if(Me&&g){f.error("`--explain` needs network access and cannot run in offline mode (--offline or security.audit.offlineByDefault)."),process.exitCode=1;return}Me&&!it&&f.warn(`\`--explain\` has no effect with --format=${n}; explanations are only rendered in table, json, and HTML output.`);const D=ka(e),C=ri(e,D.name);if(g){const s=$??Pa(e);if(!At(s)){const p=new mt(s);E?process.stderr.write(`${p.message}
307
- `):f.error(p.message),process.exitCode=1;return}}!E&&(C.ignoredAdvisories.length>0||C.excludedPackages.length>0)&&f.info(`Loaded ${String(C.ignoredAdvisories.length)} ignored advisor${C.ignoredAdvisories.length===1?"y":"ies"} and ${String(C.excludedPackages.length)} excluded package${C.excludedPackages.length===1?"":"s"} from ${D.name} config.`),!E&&x.unsupported.length>0&&f.warn(`Ecosystems ${x.unsupported.map(s=>`'${s}'`).join(", ")} are not yet supported by the audit matcher. Supported: npm, pypi, crates.io, cargo, maven, go, rubygems.`);const _=Da(e,D.name,{includeDev:!j});if(_.length===0){f.info(`No ${D.name} lockfile entries found. Run ${D.name} install first.`);return}if(!E){const s=j?"production-only packages":"installed packages";f.info(`Scanning ${String(_.length)} ${s}${g?" (offline)":""}…`)}const he=_.map(s=>({name:s.name,version:s.version})),ve=a?.security?.audit?.advisories?.bloom?.mode??"off";let G=[];if(ve!=="off")try{const s=await Va(e,{softFail:ve==="on"});if(s){if(G=za(s,he).map(p=>({name:p.name,version:p.version})),!E&&G.length>0){f.warn(`osv-bloom prefilter flagged ${String(G.length)} package${G.length===1?"":"s"} as possibly malicious (MAL-*). Confirming via the advisory query path…`);const p=10;for(const u of G.slice(0,p))f.warn(` ${Ie("[bloom]")} ${u.name}@${u.version}`);G.length>p&&f.warn(` …and ${String(G.length-p)} more (full list in --format json output)`)}}else E||f.info(L("osv-bloom cache absent — skipping prefilter (run `vis advisories bloom sync` to enable)."))}catch(s){if(s instanceof Wa&&ve==="required"){const u=`${s.message} (security.audit.advisories.bloom.mode = "required")`;E?process.stderr.write(`${u}
308
- `):f.error(u),process.exitCode=1;return}const p=s instanceof Error?s.message:String(s);if(ve==="required"){E?process.stderr.write(`osv-bloom prefilter failed: ${p}
309
- `):f.error(`osv-bloom prefilter failed: ${p}`),process.exitCode=1;return}E||f.warn(`osv-bloom prefilter failed (continuing): ${p}`)}const we=new Set;g?we.add("socket").add("deps-dev"):(gt("socket")&&we.add("socket"),gt("depsDev")&&we.add("deps-dev"));const Te=da(a?.security,{disabled:we,minimumScore:y?.score?.minimum}),Ve=Te.length>0,Ft=Te.map(s=>s.displayName).join(" + "),ye=y?.score?.minimum??ha,Z=La(e,D.name),Ut=[{id:"vulnerabilities",label:g?"Known vulnerabilities (offline OSV cache)":"Known vulnerabilities (OSV)"},...Ve?[{id:"security",label:`Supply-chain reports (${Ft})`}]:[]],F=Oa(Ut,{live:!E}),Ht=Date.now(),X=N(s=>{const p=Date.now()-s;return p>=1e3?`${(p/1e3).toFixed(1)}s`:`${String(Math.round(p))}ms`},"fmtElapsed");let ze,We;try{const s=Date.now(),p=Date.now();F.start("vulnerabilities"),Ve&&F.start("security");const u=g?Promise.resolve().then(()=>ht(he,{dbPath:$,ecosystem:x.all.find(v=>qe.has(v.toLowerCase()))??"npm",workspaceRoot:e})).then(v=>{let k=0;for(const A of v.values())k+=A.length;return F.finish("vulnerabilities",k>0?"warn":"ok",k>0?`${String(k)} found · ${X(s)}`:`none found · ${X(s)}`),v}).catch(v=>{const k=v instanceof Error?v.message:String(v);if(F.finish("vulnerabilities","error",k),v instanceof mt)throw v;return new Map}):ga(he).then(v=>{let k=0;for(const A of v.values())k+=A.length;return F.finish("vulnerabilities",k>0?"warn":"ok",k>0?`${String(k)} found · ${X(s)}`:`none found · ${X(s)}`),v}).catch(v=>{const k=v instanceof Error?v.message:String(v);return F.finish("vulnerabilities","error",k),new Map});[ze,We]=await Promise.all([u,Ve?ua(Te,he).then(v=>{let k=0,A=0;for(const se of v.values())k+=se.alerts.length,se.score.overall<ye&&(A+=1);const P=k+A;return F.finish("security",P>0?"warn":"ok",P>0?`${String(k)} alert${k===1?"":"s"}, ${String(A)} low-score · ${X(p)}`:`clean · ${X(p)}`),v}).catch(v=>{const k=v instanceof Error?v.message:String(v);return F.finish("security","error",k),new Map}):Promise.resolve(new Map)])}finally{F.stop()}b||f.info(L(`Scan completed in ${X(Ht)}`));const be=[];for(const s of _){if(ni(s.name,C))continue;const p=ze.get(s.name)??[],u=We.get(`${s.name}@${s.version}`),v=ut(s.name,s.version,Le),k=p.length>0,A=u?u.score.overall<ye:!1,P=u?u.alerts.length>0:!1;(k||A||P)&&be.push({acceptedRisk:v,name:s.name,socketReport:u,version:s.version,vulnerabilities:p})}if(g){const s=x.all.filter(p=>qe.has(p.toLowerCase())&&p.toLowerCase()!=="npm");for(const p of s){const u=Tt(p),v=Rr(e,u);if(v.length!==0){E||f.info(L(`Scanning ${String(v.length)} ${u} packages…`));try{const k=ht(v.map(A=>({name:A.name,version:A.version})),{dbPath:$,ecosystem:u,workspaceRoot:e});for(const A of v){const P=k.get(A.name)??[];P.length!==0&&be.push({acceptedRisk:ut(A.name,A.version,Le),name:A.name,version:A.version,vulnerabilities:P})}}catch(k){const A=k instanceof Error?k.message:String(k);f.warn(`Failed to scan ${u}: ${A}`)}}}}let I=be.filter(s=>{const p=s.vulnerabilities.some(k=>Ce(k.severity,r)),u=s.socketReport?.alerts.some(k=>Ce(k.severity==="medium"?"MODERATE":k.severity.toUpperCase(),r)),v=s.socketReport&&s.socketReport.score.overall<ye;return p||u||v});const Gt=t.policies,rt=[],O=await(async()=>{const s=Sa().map(P=>`'${P}'`).join(", "),p=Aa(Gt,P=>{rt.push(P);const se=`Unknown policy '${P}' — ignoring. Available: ${s}.`;E?process.stderr.write(`vis audit: ${se}
310
- `):f.warn(se)});if(p?.size===0)return[];const u=a?.security?.policies?.license,v=!!(u&&((u.allow?.length??0)>0||(u.deny?.length??0)>0)),k=p===void 0||p.has("license"),A=v&&k?Ta(e):void 0;return Na({manifestData:A,offline:g,osvFindings:ze,packageManager:D.name,packages:_,socketReports:We,workspaceRoot:e},"audit",{enabledPolicies:p,visConfig:a??{}})})();if(_t){const s=new Set(I.filter(u=>u.vulnerabilities.length>0).map(u=>u.name)),p=Wr({alwaysAssumeUsed:tt?.alwaysAssumeUsed,vulnerablePackages:s,workspaceRoot:e});I=I.filter(u=>u.vulnerabilities.length===0?!0:p.reachable.has(u.name)),E||f.info(L(`Reachability filter: ${String(p.reachable.size)}/${String(s.size)} vulnerable packages reachable (${String(p.filesScanned)} files scanned).`))}const nt=Ma(e,D.name),ot=nt?I.map(s=>{const p=lr(nt,{name:s.name,version:s.version});return{...s,dependencyPaths:p}}):I.map(s=>({...s,dependencyPaths:[]})),B=N(()=>ot.flatMap(s=>s.vulnerabilities.map(p=>({acknowledged:!!s.acceptedRisk||de(p.id,C,p.aliases),dependencyPaths:s.dependencyPaths,packageName:s.name,packageVersion:s.version,vulnerability:p}))),"findingsForReport"),st=!!t.fix,ct=!!t.fixTransitive,lt=!!t.yes,Bt=!!t.allowMajor;if(st||ct){const s=B().filter(p=>!p.acknowledged);if(st){const p=await pn({actionableFindings:s,allowMajor:Bt,pm:D,visConfig:a,workspaceRoot:e,yes:lt});if(p!==void 0){process.exitCode=p;return}}if(ct){const p=await dn({actionableFindings:s,pm:D,visConfig:a,workspaceRoot:e,yes:lt});if(p!==void 0){process.exitCode=p;return}}}const xe=new Map;if(it){const s=Ja(B().filter(u=>!u.acknowledged).map(u=>({packageName:u.packageName,packageVersion:u.packageVersion,vulnerability:u.vulnerability})).sort(Et),at),p=await ai(s,a?.ai,{info:N(u=>{f.info(u)},"info"),warn:N(u=>{f.warn(u)},"warn")});for(const[u,v]of p)xe.set(u,v)}if(o){const s=Ji({findings:B(),policyDecisions:O,tool:{informationUri:"https://github.com/visulima/visulima",name:"vis-audit",version:"alpha"},workspaceRoot:e});process.stdout.write(`${JSON.stringify(s,void 0,2)}
311
- `),pe(I,C,t.exitCode,M,O);return}if(c){const s=Pi({findings:B(),tool:{informationUri:"https://github.com/visulima/visulima",name:"vis-audit",version:"alpha"},workspaceRoot:e});process.stdout.write(`${JSON.stringify(s,void 0,2)}
312
- `),pe(I,C,t.exitCode,M,O);return}if(l){const{packageJsons:s,workspace:p}=fa(e,a),u=ma(e,p,s),v=Ra({includeDev:!j,projectGraph:u,workspace:p,workspaceRoot:e}),k=Ti({bom:v,findings:B()});process.stdout.write(`${JSON.stringify(k,void 0,2)}
313
- `),pe(I,C,t.exitCode,M,O);return}if(d){const s=Ui({findings:B(),policyDecisions:O,tool:{informationUri:"https://github.com/visulima/visulima",name:"vis-audit",version:"alpha"},workspaceRoot:e});process.stdout.write(`${JSON.stringify(s,void 0,2)}
314
- `),pe(I,C,t.exitCode,M,O);return}if(m){const s=Bi({findings:B(),policyDecisions:O});process.stdout.write(s),pe(I,C,t.exitCode,M,O);return}const _e={informationUri:"https://github.com/visulima/visulima",name:"vis-audit",version:"alpha"},ke=pi({bloomHits:G,duplicates:Z,explanations:xe,filtered:ot,packagesScanned:_.length,policyDecisions:O,tool:_e,unknownPolicyTokens:rt,workspaceRoot:e});if(h){const s=Ii({findings:B().map(u=>{const v=xe.get(Oe({packageName:u.packageName,packageVersion:u.packageVersion,vulnerability:u.vulnerability}));return v?{...u,explanation:v}:u}),packagesScanned:_.length,policyDecisions:O,report:ke,tool:{name:_e.name,version:_e.version},workspaceRoot:e}),p=ea(e,h);Ct(p,s,"utf8"),E||f.success(`HTML report written to ${p}`)}if(b){process.stdout.write(`${JSON.stringify(ke,void 0,2)}
315
- `),t.exitCode&&(ke.summary.issues>0||ke.summary.policyBlocks>0)&&(process.exitCode=1),Je(I,C,M,O);return}if(I.length===0){f.success(`No security issues found across ${String(_.length)} packages.`);return}const ne={CRITICAL:[],HIGH:[],LOW:[],MODERATE:[]};for(const s of I)for(const p of s.vulnerabilities)if(Ce(p.severity,r)){const u=p.severity==="UNKNOWN"?"LOW":p.severity;ne[u]?.push({entry:s,vuln:p})}let $e=0,Fe=0;for(const s of["CRITICAL","HIGH","MODERATE","LOW"]){const p=ne[s];if(!(!p||p.length===0)){f.info(`
316
- ── ${s} (${String(p.length)}) ──`);for(const{entry:u,vuln:v}of p){const k=!!u.acceptedRisk||de(v.id,C,v.aliases);if(k&&(Fe++,!me))continue;$e++,f.info(tn(u.name,u.version,v,k)),fe&&(v.fixedVersions??[]).length>0&&f.notice(` Fix: update to ${v.fixedVersions.at(-1)}`);const A=xe.get(Oe({packageName:u.name,packageVersion:u.version,vulnerability:v}));if(A)for(const P of A.split(`
317
- `))f.info(` ${P}`)}}}const oe=I.filter(s=>s.socketReport&&(s.socketReport.score.overall<ye||s.socketReport.alerts.length>0));if(oe.length>0){f.info(`
318
- ── Socket.dev Supply Chain (${String(oe.length)}) ──`);for(const s of oe){if(!s.socketReport)continue;const p=!!s.acceptedRisk;if(!(p&&!me)){f.info(an(s.socketReport,p));for(const u of s.socketReport.alerts){const v=Xr[u.severity]??L;f.info(` ${v(`[${u.severity.toUpperCase()}]`)} ${u.type} — ${u.category}`)}}}}if(Z.length>0){f.info(`
319
- ── Duplicate Dependencies (${String(Z.length)}) ──`);for(const s of Z){const p=s.versions.join(", ");f.info(` ${s.name} — ${String(s.versions.length)} versions: ${Re(p)}`)}}const pt=new Set;for(const s of["CRITICAL","HIGH","MODERATE","LOW"]){const p=ne[s];if(p)for(const{vuln:u}of p)pt.add(u.id)}const Ue=O.filter(s=>{if(s.policy!=="vulnerability")return!0;const p=typeof s.data?.advisoryId=="string"?s.data.advisoryId:void 0;return s.severity==="block"&&p!==void 0&&!pt.has(p)});if(Ue.length>0){f.info(`
320
- ── Policy Decisions (${String(Ue.length)}) ──`);for(const s of Ue){const p=!!s.acceptedRisk;if(p&&!me)continue;const u=s.severity==="block"?Ie:s.severity==="warn"?Re:L,v=p?` ${L("[acknowledged]")}`:"";f.info(` ${u(`[${s.severity}]`)} ${s.policy} — ${s.reason}${v}`)}}const Se=N(s=>!!s.acceptedRisk||s.vulnerabilities.length>0&&s.vulnerabilities.every(p=>de(p.id,C,p.aliases)),"isEntryExcluded"),dt=I.filter(s=>!Se(s)).length;if(f.info(""),f.info("─ Audit Summary"),f.info(` ${String(_.length)} packages scanned`),C.ignoredAdvisories.length>0&&f.info(` ${String(C.ignoredAdvisories.length)} ${D.name} audit exclusion${C.ignoredAdvisories.length===1?"":"s"} applied`),$e>0){const s=ne.CRITICAL?.filter(u=>!Se(u.entry)).length??0,p=ne.HIGH?.filter(u=>!Se(u.entry)).length??0;f.error(` ${String($e)} vulnerabilit${$e===1?"y":"ies"} found`),s>0&&f.error(` ${String(s)} critical`),p>0&&f.warn(` ${String(p)} high`)}else f.success(" No vulnerabilities found");if(oe.length>0){const s=oe.filter(p=>!Se(p)).length;f.warn(` ${String(s)} package${s===1?"":"s"} with Socket.dev supply chain issues`)}Z.length>0&&(f.warn(` ${String(Z.length)} package${Z.length===1?"":"s"} with duplicate versions`),f.notice(" Run 'vis dedupe' or your package manager's dedupe command to reduce duplicates."));const Ae=O.filter(s=>s.severity==="block"&&!s.acceptedRisk);if(Ae.length>0&&f.error(` ${String(Ae.length)} policy block${Ae.length===1?"":"s"}`),Fe>0&&(f.info(` ${String(Fe)} acknowledged (accepted risks)`),me||f.notice(" Use --show-accepted to see acknowledged issues.")),dt===0&&f.success(`
321
- All issues are acknowledged. No action required.`),t.sync&&Le){const s=new Set;for(const u of be)if(u.acceptedRisk){for(const v of u.vulnerabilities)if((v.id.startsWith("CVE-")||v.id.startsWith("GHSA-"))&&s.add(v.id),v.aliases)for(const k of v.aliases)(k.startsWith("CVE-")||k.startsWith("GHSA-"))&&s.add(k)}const p=[...s];if(p.length>0){f.info("");const u=oi(D.name,e,p);for(const v of u)f.success(` ${v}`)}else f.info(`
322
- No advisory IDs to sync to native PM config.`)}t.exitCode&&(dt>0||Ae.length>0)&&(process.exitCode=1),Je(I,C,M,O)},"executeAudit"),zt=N(e=>!e||e.length===0?!1:e.some(t=>t.severity==="block"&&!t.acceptedRisk),"hasBlockingPolicy"),Je=N((e,t,a,i)=>{zt(i)&&(process.exitCode=1),a&&e.some(r=>r.vulnerabilities.some(n=>r.acceptedRisk||de(n.id,t,n.aliases)?!1:Ce(n.severity,a)))&&(process.exitCode=1)},"applyFailOnGate"),pe=N((e,t,a,i,r)=>{a&&(e.filter(n=>!n.acceptedRisk&&n.vulnerabilities.some(o=>!de(o.id,t,o.aliases))).length>0||zt(r))&&(process.exitCode=1),Je(e,t,i,r)},"applyExitGate"),Wt=N(async(e,t)=>{if(!process.stdin.isTTY)return t;const a=Qt({input:process.stdin,output:process.stderr});try{const i=t?"[Y/n]":"[y/N]",r=await new Promise(n=>{a.question(`${e} ${L(i)} `,o=>{n(o.trim())})});return r.length===0?t:r.toLowerCase().startsWith("y")}finally{a.close()}},"promptYesNo"),ln=N(e=>e==="pnpm"||e==="npm"||e==="yarn"||e==="bun","isTransitiveOnlyPm"),pn=N(async e=>{const t=Mt({allowMajor:e.allowMajor,findings:e.actionableFindings,workspaceRoot:e.workspaceRoot});if(f.info(""),f.info("─ Apply (direct deps)"),f.info(ar(t)),t.apply.length===0){f.info("Nothing to apply for direct deps.");return}if(Ge&&!e.yes)return f.error("Refusing to run --fix in CI without --yes. Re-run with --yes once the plan above looks right."),1;if(!e.yes&&!await Wt("Apply these direct-dep upgrades?",!1))return f.info("Aborted — no changes made."),0;const a=new Map;for(const i of t.apply){const r=i.workspaceName??"",n=a.get(r);n?n.push(i):a.set(r,[i])}for(const[i,r]of a){const n=r.map(l=>`${l.packageName}@${l.targetSpec}`),o=i.length>0?[i]:[];f.info(`Running ${e.pm.name} add ${n.join(" ")}${i.length>0?` --filter ${i}`:""}`);const c=$a(e.pm,{exact:!1,filter:o,global:!1,optional:!1,packages:n,peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},e.workspaceRoot,console);if(c!==0)return f.error(`${e.pm.name} add exited ${String(c)} — aborting before rescan.`),c}return f.success("Direct-dep upgrades applied. Re-run `vis audit` to confirm the fixes landed."),0},"runApplyDirect"),dn=N(async e=>{if(!ln(e.pm.name))return f.error(`--fix-transitive is not supported for package manager "${e.pm.name}". Use pnpm, npm, yarn, or bun.`),1;const t=!!e.visConfig?.security?.audit?.apply?.transitive?.enabled;if(Ge&&(!e.yes||!t))return f.error("Refusing to run --fix-transitive in CI without both --yes and security.audit.apply.transitive.enabled = true. Overrides have a higher blast radius than direct bumps — gate on config."),1;const a=new Set(Mt({findings:e.actionableFindings,workspaceRoot:e.workspaceRoot}).apply.map(o=>o.packageName)),i=e.actionableFindings.filter(o=>!a.has(o.packageName)),r=Yr(i);if(r.entries.length===0){f.info(""),f.info("─ Apply transitive (overrides)"),f.info("Nothing to override — all vulnerable packages are direct deps or have no fixed version.");return}const n=qr(e.workspaceRoot,r,{name:e.pm.name,version:e.pm.version});f.info(""),f.info("─ Apply transitive (overrides)"),f.info(`Target: ${n.filePath} (${n.surface})`);for(const o of n.entries){const c=o.status==="added"?"+":o.status==="updated"?"~":"·",l=o.previousSpec?` (was ${o.previousSpec})`:"";f.info(` ${c} ${o.packageName}: ${o.spec}${l}`)}if(!n.changed){f.info("No changes — overrides already match the plan.");return}if(!e.yes){if(Ge)return 1;if(!await Wt("Write these overrides?",!1))return f.info("Aborted — no changes made."),0}try{Jr(n)}catch(o){const c=o instanceof Error?o.message:String(o);return f.error(`Failed to write overrides: ${c}`),1}return f.success(`Wrote ${String(n.entries.filter(o=>o.status!=="unchanged").length)} override${n.entries.length===1?"":"s"}. Run \`${e.pm.name} install\` then re-run \`vis audit\` to confirm the fixes landed.`),0},"runApplyTransitive"),Rn=N(async({logger:e,options:t,visConfig:a,workspaceRoot:i})=>{if(!i)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");await cn(i,t,a,e)},"execute");export{Rn as default,on as mapSeverityToAube,nn as resolveAuditBackend};
707
+ </html>`},"emitGraphHtml");var Vi=Object.defineProperty,Ae=m((n,e)=>Vi(n,"name",{value:e,configurable:!0}),"l");const Ki={application:0,library:3,service:1,tool:2},Ct=Ae(n=>Ki[n]??Number.MAX_SAFE_INTEGER,"typeRank"),Xi=Ae(n=>{const e=new Map;for(const[t,r]of Object.entries(n.dependencies))for(const i of r){const o=e.get(i.target)??[];o.push(t),e.set(i.target,o)}return Object.values(n.nodes).map(t=>({deps:n.dependencies[t.name]??[],name:t.name,reverseDeps:e.get(t.name)??[],type:t.type})).sort((t,r)=>t.type!==r.type?Ct(t.type)-Ct(r.type):t.name.localeCompare(r.name))},"buildNodes"),Yi=Ae((n,e,t)=>{let r=n;if(e==="app"?r=r.filter(i=>i.type==="application"):e==="lib"&&(r=r.filter(i=>i.type!=="application")),t){const i=t.toLowerCase();r=r.filter(o=>o.name.toLowerCase().includes(i))}return r},"filterNodes");class Qi{static{m(this,"GraphStore")}static{Ae(this,"GraphStore")}#e;#r=new Set;#i;constructor(e){this.#i=e;const t=Xi(e);this.#e={allNodes:t,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",selectedIndex:0}}getSnapshot=Ae(()=>this.#e,"getSnapshot");subscribe=Ae(e=>(this.#r.add(e),()=>{this.#r.delete(e)}),"subscribe");getFilteredNodes(){return Yi(this.#e.allNodes,this.#e.filterType,this.#e.filterText)}getStats(){const e=this.#e.allNodes.filter(i=>i.type==="application").length,t=this.#e.allNodes.length,r=Object.values(this.#i.dependencies).reduce((i,o)=>i+o.length,0);return{apps:e,deps:r,libs:t-e,total:t}}setSelectedIndex(e){const t=this.getFilteredNodes(),r=t.length===0?-1:Math.max(0,Math.min(e,t.length-1));r!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:r})}setFocusedPanel(e){e!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:e})}setFilterType(e){e!==this.#e.filterType&&this.#t({...this.#e,filterType:e,selectedIndex:0})}setFilter(e){this.#t({...this.#e,filterText:e,selectedIndex:0})}setFilterActive(e){e!==this.#e.filterActive&&this.#t({...this.#e,filterActive:e,filterText:e?this.#e.filterText:"",selectedIndex:e?this.#e.selectedIndex:0})}#t(e){this.#e=e;for(const t of this.#r)try{t()}catch{}}}var Ji=Object.defineProperty,Zi=m((n,e)=>Ji(n,"name",{value:e,configurable:!0}),"p");const en=Zi(({focused:n,node:e,scrollRef:t})=>{const r=n?"white":"gray";if(!e)return y(G,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:y(w,{dimColor:!0,children:"No project selected"})});const i=e.type==="application",o=i?"yellow":"cyan",a=i?"Application":"Library";return y(G,{borderColor:r,borderStyle:"single",borderTopRightTitle:` ${a} `,borderTopTitle:` ${e.name} `,flexDirection:"column",flexGrow:1,children:E(gi,{flexGrow:1,flexShrink:1,paddingX:2,ref:t,scrollbar:!0,scrollbarColor:"gray",children:[E(G,{flexDirection:"column",marginTop:1,children:[E(G,{children:[y(w,{dimColor:!0,children:"── "}),y(w,{bold:!0,color:"white",children:"DEPENDS ON"}),E(w,{dimColor:!0,children:[" ","(",e.deps.length,")"]})]}),e.deps.length===0?y(G,{marginTop:1,paddingLeft:2,children:y(w,{dimColor:!0,children:"No dependencies"})}):y(G,{flexDirection:"column",marginTop:1,children:e.deps.map(s=>E(G,{gap:1,paddingLeft:2,children:[y(w,{color:"cyan",children:"→"}),y(w,{children:s.target}),s.type!=="static"&&E(w,{dimColor:!0,children:["(",s.type,")"]})]},s.target))})]}),E(G,{flexDirection:"column",marginTop:1,children:[E(G,{children:[y(w,{dimColor:!0,children:"── "}),y(w,{bold:!0,color:"white",children:"REQUIRED BY"}),E(w,{dimColor:!0,children:[" ","(",e.reverseDeps.length,")"]})]}),e.reverseDeps.length===0?y(G,{marginTop:1,paddingLeft:2,children:y(w,{dimColor:!0,children:"No reverse dependencies"})}):y(G,{flexDirection:"column",marginTop:1,children:e.reverseDeps.map(s=>E(G,{gap:1,paddingLeft:2,children:[y(w,{color:"magenta",children:"←"}),y(w,{children:s})]},s))})]}),E(G,{flexDirection:"column",marginTop:1,children:[E(G,{children:[y(w,{dimColor:!0,children:"── "}),y(w,{bold:!0,color:"white",children:"INFO"})]}),E(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[E(G,{children:[y(G,{width:16,children:y(w,{dimColor:!0,children:"Type:"})}),y(w,{color:o,children:a})]}),E(G,{children:[y(G,{width:16,children:y(w,{dimColor:!0,children:"Dependencies:"})}),y(w,{children:String(e.deps.length)})]}),E(G,{children:[y(G,{width:16,children:y(w,{dimColor:!0,children:"Required by:"})}),y(w,{children:String(e.reverseDeps.length)})]}),E(G,{children:[y(G,{width:16,children:y(w,{dimColor:!0,children:"Connectivity:"})}),y(w,{children:String(e.deps.length+e.reverseDeps.length)})]})]})]})]})})},"ProjectDetailPanel");var tn=Object.defineProperty,mt=m((n,e)=>tn(n,"name",{value:e,configurable:!0}),"m");const rn=[{key:"all",label:"All",shortcut:"1"},{key:"app",label:"Apps",shortcut:"2"},{key:"lib",label:"Libs",shortcut:"3"}],_t=mt(({isSelected:n,node:e})=>{const t=e.type==="application",r=t?"yellow":"cyan",i=t?"app":"lib";return E(G,{flexShrink:0,height:1,children:[E(w,{children:[n?"▶":" "," "]}),y(G,{flexGrow:1,children:y(w,{bold:n,inverse:n,wrap:"truncate",children:e.name})}),E(w,{color:r,children:[" ",i]}),E(w,{dimColor:!0,children:[" ","→",e.deps.length," ","←",e.reverseDeps.length]})]})},"ProjectRow"),Dt=mt(({count:n,label:e})=>E(G,{flexShrink:0,height:1,marginTop:1,children:[E(w,{dimColor:!0,children:["▼"," "]}),y(w,{bold:!0,color:"white",children:e.toUpperCase()}),E(w,{dimColor:!0,children:[" ","(",n,")"]})]}),"TypeHeader"),nn=mt(({filterActive:n,filterText:e,filterType:t,focused:r,nodes:i,scrollOffset:o,selectedIndex:a,stats:s,viewportHeight:d})=>{const c=r?"white":"gray",p=i.filter(A=>A.type==="application"),l=i.filter(A=>A.type!=="application"),u=[];let v=0;if(p.length>0){u.push(y(Dt,{count:p.length,label:"Applications"},"hdr-apps"));for(const A of p){const I=v;u.push(y(_t,{isSelected:I===a,node:A},A.name)),v++}}if(l.length>0){u.push(y(Dt,{count:l.length,label:"Libraries"},"hdr-libs"));for(const A of l){const I=v;u.push(y(_t,{isSelected:I===a,node:A},A.name)),v++}}let S=0;p.length>0&&(S+=2+p.length),l.length>0&&(S+=2+l.length);const N=S>d&&d>0;return E(G,{borderColor:c,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[E(G,{flexShrink:0,gap:1,paddingX:1,children:[y(w,{bold:!0,inverse:!0,children:" VIS "}),E(w,{wrap:"truncate",children:[s.total," ","packages"]}),E(w,{dimColor:!0,children:["(",s.apps," ","apps,"," ",s.libs," ","libs,"," ",s.deps," ","deps)"]})]}),y(G,{flexShrink:0,gap:1,paddingX:1,paddingY:1,children:rn.map(A=>{const I=t===A.key;return E(G,{children:[y(w,{dimColor:!I,children:"["}),y(w,{bold:I,color:I?"cyan":"gray",children:A.shortcut}),y(w,{dimColor:!I,children:"]"}),E(w,{color:I?"white":"gray",children:[" ",A.label]})]},A.key)})}),n&&E(G,{flexShrink:0,paddingX:1,children:[y(w,{bold:!0,color:"white",children:"/ "}),y(w,{children:e}),y(w,{inverse:!0,children:" "})]}),E(G,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[y(G,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:y(G,{flexDirection:"column",marginTop:-o,children:u})}),N&&y(G,{flexShrink:0,marginLeft:1,marginRight:1,children:y(fi,{contentHeight:S,placement:"inset",scrollOffset:o,style:"block",viewportHeight:d})})]})]})},"ProjectListPanel");var on=Object.defineProperty,an=m((n,e)=>on(n,"name",{value:e,configurable:!0}),"E");const sn=100,dn=40,cn=10,Mt={1:"all",2:"app",3:"lib"},ln=an(({autoExitSeconds:n=0,store:e})=>{const{exit:t}=hi(),{columns:r,rows:i}=ui(),o=ri(e.subscribe,e.getSnapshot),[a,s]=et(!1),d=yt(null),c=yt(null),[p,l]=et(0),[u,v]=et(!1),S=tt(()=>e.getFilteredNodes(),[o.allNodes,o.filterType,o.filterText]),N=tt(()=>e.getStats(),[o.allNodes]),A=S[o.selectedIndex]??null,I=tt(()=>{let T=0,O=0;for(const _ of S)_.type==="application"?T+=1:O+=1;return{appsCount:T,libsCount:O}},[S]),R=vt(T=>{const{appsCount:O,libsCount:_}=I;if(T<O)return(O>0?2:0)+T;const h=O>0?2+O:0,ye=_>0?2:0;return h+ye+(T-O)},[I]),F=Math.max(1,i-8-(o.filterActive?1:0)),z=vt(T=>{const O=R(T);l(_=>O>_+F-2?Math.max(0,O-F+2):O<_+1?Math.max(0,O-1):_)},[R,F]);if(ii(()=>{c.current?.scrollToTop()},[A?.name]),pi((T,O)=>{if(T==="c"&&O.ctrl){t();return}if(!u){if(a){O.escape||T==="?"?s(!1):T==="q"?(s(!1),v(!0)):O.downArrow||T==="j"?d.current?.scrollBy(1):(O.upArrow||T==="k")&&d.current?.scrollBy(-1);return}if(T==="?"){s(!0);return}if(T==="q"){v(!0);return}if(O.tab){e.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(Mt[T]){e.setFilterType(Mt[T]);return}if(o.filterActive){if(O.escape){e.setFilterActive(!1);return}if(O.return){e.setFilterActive(!1);return}if(O.backspace){e.setFilter(o.filterText.slice(0,-1));return}if(T&&!O.ctrl&&!O.meta){e.setFilter(o.filterText+T);return}return}if(o.focusedPanel==="list"){if(S.length===0){T==="/"&&e.setFilterActive(!0);return}if(O.downArrow||T==="j"){const _=Math.min(o.selectedIndex+1,S.length-1);e.setSelectedIndex(_),z(_);return}if(O.upArrow||T==="k"){const _=Math.max(o.selectedIndex-1,0);e.setSelectedIndex(_),z(_);return}if(O.pageDown){const _=Math.min(o.selectedIndex+10,S.length-1);e.setSelectedIndex(_),z(_);return}if(O.pageUp){const _=Math.max(o.selectedIndex-10,0);e.setSelectedIndex(_),z(_);return}if(O.home){e.setSelectedIndex(0),l(0);return}if(O.end){const _=S.length-1;e.setSelectedIndex(_),z(_);return}if(T==="/"){e.setFilterActive(!0);return}if(O.rightArrow){e.setFocusedPanel("detail");return}return}if(o.focusedPanel==="detail"){if(O.escape||O.leftArrow){e.setFocusedPanel("list");return}if(O.downArrow||T==="j"){c.current?.scrollBy(1);return}if(O.upArrow||T==="k"){c.current?.scrollBy(-1);return}if(O.pageDown){c.current?.scrollBy(10);return}if(O.pageUp){c.current?.scrollBy(-10);return}if(O.home){c.current?.scrollToTop();return}O.end&&c.current?.scrollToBottom()}}},{isActive:!0}),r<dn||i<cn)return y(G,{alignItems:"center",height:i,justifyContent:"center",width:r,children:E(w,{color:"yellow",children:["Terminal too small (",r,"x",i,")"]})});const H=r>=sn,Q=y(G,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:E(G,{flexWrap:"wrap",gap:2,paddingX:1,children:[E(G,{gap:1,children:[y(w,{bold:!0,color:"white",children:"q"}),y(w,{dimColor:!0,children:"QUIT"})]},"q"),E(G,{gap:1,children:[y(w,{bold:!0,color:"white",children:"?"}),y(w,{dimColor:!0,children:"HELP"})]},"?"),E(G,{gap:1,children:[y(w,{bold:!0,color:"white",children:"↑↓"}),y(w,{dimColor:!0,children:"NAV"})]},"nav"),E(G,{gap:1,children:[y(w,{bold:!0,color:"white",children:"1-3 /"}),y(w,{dimColor:!0,children:"FILTER"})]},"f"),E(G,{gap:1,children:[y(w,{bold:!0,color:"white",children:"Tab"}),y(w,{dimColor:!0,children:"PANEL"})]},"t")]})}),J=E(li,{footer:E(w,{dimColor:!0,children:[y(w,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",y(w,{bold:!0,color:"white",children:"?"}),"/",y(w,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:d,title:"KEYBOARD SHORTCUTS",visible:a,width:52,children:[E(G,{flexDirection:"column",marginBottom:1,children:[E(G,{marginBottom:1,children:[y(w,{dimColor:!0,children:"── "}),y(w,{bold:!0,color:"white",children:"NAVIGATION"})]}),E(G,{children:[y(G,{width:24,children:E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","↑","/k"]}),y(w,{dimColor:!0,children:" Move up"})]})}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","↓","/j"]}),y(w,{dimColor:!0,children:" Move down"})]})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","Tab"]}),y(w,{dimColor:!0,children:" Switch panel"})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","→","/","←"]}),y(w,{dimColor:!0,children:" Focus detail/list"})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","PgUp/PgDn"]}),y(w,{dimColor:!0,children:" Jump 10 items"})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","Home/End"]}),y(w,{dimColor:!0,children:" Jump to start/end"})]})]}),E(G,{flexDirection:"column",marginBottom:1,children:[E(G,{marginBottom:1,children:[y(w,{dimColor:!0,children:"── "}),y(w,{bold:!0,color:"white",children:"FILTERS"})]}),E(G,{children:[y(G,{width:24,children:E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","1"]}),y(w,{dimColor:!0,children:" All"})]})}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","2"]}),y(w,{dimColor:!0,children:" Apps only"})]})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","3"]}),y(w,{dimColor:!0,children:" Libraries only"})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","/"]}),y(w,{dimColor:!0,children:" Text filter"})]})]}),E(G,{flexDirection:"column",children:[E(G,{marginBottom:1,children:[y(w,{dimColor:!0,children:"── "}),y(w,{bold:!0,color:"white",children:"ACTIONS"})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","q"]}),y(w,{dimColor:!0,children:" Quit"})]}),E(w,{children:[E(w,{bold:!0,color:"white",children:[" ","?"]}),y(w,{dimColor:!0,children:" Toggle help"})]})]})]}),Ne=y(nn,{filterActive:o.filterActive,filterText:o.filterText,filterType:o.filterType,focused:o.focusedPanel==="list",nodes:S,scrollOffset:p,selectedIndex:o.selectedIndex,stats:N,viewportHeight:F}),Y=y(en,{focused:o.focusedPanel==="detail",node:A,scrollRef:c});if(H){const T=Math.floor(r*.35);return E(G,{flexDirection:"column",height:i,width:r,children:[E(G,{flexDirection:"row",flexGrow:1,children:[y(G,{flexGrow:1,children:Ne}),y(G,{width:T,children:Y})]}),Q,y(wt,{autoExitSeconds:n??3,onCancel:m(()=>{v(!1)},"onCancel"),visible:u}),J]})}const Ye=Math.floor(i*.55);return E(G,{flexDirection:"column",height:i,width:r,children:[y(G,{height:Ye,children:Ne}),y(G,{flexGrow:1,children:Y}),Q,y(wt,{autoExitSeconds:n??3,onCancel:m(()=>{v(!1)},"onCancel"),visible:u}),J]})},"VisGraphApp");var hn=Object.defineProperty,Se=m((n,e)=>hn(n,"name",{value:e,configurable:!0}),"y");const Pr=Se((n,e,t,r,i,o,a,s)=>{const d=t?ie("└── "):ie("├── "),c=i.has(n),p=c?ie(" (*)"):"",l=r.get(n),u=l?.type==="application"?le(n):n;if(o.push(`${e}${d}${u}${p}`),c)return;i.add(n);const v=l?.deps??[],S=t?`${e} `:`${e}${ie("│")} `;if(s>=a&&v.length>0){o.push(`${S}${ie(`... ${v.length} more`)}`);return}for(let N=0;N<v.length;N++){const A=v[N];A&&Pr(A.target,S,N===v.length-1,r,i,o,a,s+1)}},"printDepsTree"),It=Se((n,e,t,r,i,o)=>{const a=e.get(n),s=a?.type==="application"?le(n):n;r.push(`${o}${s}`),t.add(n);const d=a?.deps??[];if(d.length===0){r.push(`${o} ${ie("(no dependencies)")}`);return}if(i<=0){r.push(`${o} ${ie(`... ${d.length} dependencies`)}`);return}for(let c=0;c<d.length;c++){const p=d[c];p&&Pr(p.target,o,c===d.length-1,e,t,r,i,1)}},"printRootProject"),Lt=Se((n,e)=>{const t=new Map;for(const[l,u]of Object.entries(n.nodes))t.set(l,{deps:(n.dependencies[l]??[]).map(v=>({target:v.target,type:v.type})),name:l,type:u.type});const r=[],i=[];for(const[l,u]of t)u.type==="application"?r.push(l):i.push(l);r.sort(),i.sort();const o=r.length+i.length,a=Object.values(n.dependencies).reduce((l,u)=>l+u.length,0),s=[le("Project Dependency Graph"),""];if(r.length>0){s.push(` ${le(bt(`Applications (${r.length})`))}`,"");for(const l of r)It(l,t,new Set,s,e," "),s.push("")}if(i.length>0){s.push(` ${le(bt(`Libraries (${i.length})`))}`,"");for(const l of i)It(l,t,new Set,s,e," "),s.push("")}const d=process.stdout.columns||80;s.push(ie("─".repeat(Math.min(d,60)))),s.push(`${le(String(o))} packages ${ie("·")} ${le(String(a))} dependencies ${ie("·")} ${le(String(r.length))} apps${ie(",")} ${le(String(i.length))} libraries`);const c=new Set;let p=!1;for(const l of[...r,...i]){const u=t.get(l)?.deps??[];for(const v of u)c.has(v.target)&&(p=!0),c.add(v.target);c.add(l)}return p&&s.push(ie("(*) = already shown above")),s.join(`
708
+ `)},"projectGraphToAscii"),pn=Se(n=>{const e=Object.values(n.nodes).map(t=>({name:t.name,type:t.type}));return{edges:Object.values(n.dependencies).flat(),nodes:e}},"projectGraphToJson"),un=Se(n=>{const e=Object.values(n.nodes).map(r=>({name:r.name,path:r.data?.root,type:r.type})),t=[];for(const r of Object.values(n.dependencies))for(const i of r)t.push({source:i.source,target:i.target,type:i.type});return Hi({edges:t,nodes:e,tool:{name:"vis-graph",version:"alpha"},workspaceRoot:process.cwd()})},"projectGraphToHtml"),Tn=Se(async({logger:n,options:e,visConfig:t,workspaceRoot:r})=>{if(!r)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const i=r,{packageJsons:o,workspace:a}=Jr(i,t),s=Zr(i,a,o),d=!!process.stdout.isTTY&&!ei,c=e.format??(d?"tui":"ascii"),p=e.output,l=e.depth??1/0;let u;switch(c){case"dot":{u=Yr(s);break}case"html":{u=un(s);break}case"json":{u=JSON.stringify(pn(s),void 0,2);break}case"tui":{if(!d){u=Lt(s,l);break}const v=t?.tui?.autoExit===!0?3:typeof t?.tui?.autoExit=="number"?t.tui.autoExit:0;process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume());const S=setInterval(()=>{},1e3),N=new Qi(s);await Qr(ti.createElement(ln,{autoExitSeconds:v,store:N}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval(S);return}default:u=Lt(s,l)}p?(Xr(p,u,"utf8"),n.info(`Graph written to ${p}`)):n.info(u)},"execute");export{Tn as default};