dependency-radar 0.8.0 → 0.9.0

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.
@@ -8,11 +8,10 @@ exports.JS_CONTENT = exports.CSS_CONTENT = void 0;
8
8
  * CSS content for the dependency radar HTML report
9
9
  * Built from report-ui/style.css
10
10
  */
11
- exports.CSS_CONTENT = `*,*:before,*:after{box-sizing:border-box}:root{--bg-primary: #0c1222;--bg-secondary: #151d2e;--bg-card: rgba(21, 29, 46, .95);--bg-card-hover: rgba(30, 41, 59, .95);--text-primary: #e8edf5;--text-secondary: #8b99b0;--text-muted: #5c6b82;--border-color: rgba(99, 120, 150, .2);--border-color-strong: rgba(99, 120, 150, .35);--accent: #06b6d4;--accent-hover: #22d3ee;--accent-subtle: rgba(6, 182, 212, .15);--title-gradient: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);--green: #10b981;--green-bg: rgba(16, 185, 129, .15);--amber: #f59e0b;--amber-bg: rgba(245, 158, 11, .15);--red: #ef4444;--red-bg: rgba(239, 68, 68, .15);--gray: #64748b;--gray-bg: rgba(100, 116, 139, .15);--license-permissive: #10b981;--license-weak-copyleft: #f59e0b;--license-strong-copyleft: #ef4444;--license-unknown: #64748b;--font-stack: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", sans-serif;--font-mono: ui-monospace, "SFMono-Regular", "SF Mono", "Menlo", "Consolas", monospace;--transition: .2s ease;--radius: 8px;--radius-lg: 12px;--graph-direct-runtime: var(--green);--graph-direct-dev: var(--amber);--graph-transitive: var(--accent);--graph-edge: var(--border-color-strong);--graph-highlight: var(--accent-hover);--graph-muted: var(--text-muted);--graph-vuln-high: var(--red);--graph-vuln-medium: var(--amber)}:root.light{--bg-primary: #f5f7fa;--bg-secondary: #e8ecf2;--bg-card: rgba(255, 255, 255, .98);--bg-card-hover: rgba(248, 250, 252, 1);--text-primary: #0f172a;--text-secondary: #475569;--text-muted: #64748b;--border-color: rgba(100, 116, 139, .18);--border-color-strong: rgba(100, 116, 139, .3);--accent: #0891b2;--accent-hover: #06b6d4;--accent-subtle: rgba(8, 145, 178, .1);--title-gradient: linear-gradient(135deg, #0891b2 0%, #059669 100%);--graph-highlight: var(--accent);--graph-muted: var(--text-secondary)}[data-theme=light]{--graph-highlight: var(--accent);--graph-muted: var(--text-secondary)}html{scroll-behavior:smooth}@media(prefers-reduced-motion:reduce){html,*,*:before,*:after{scroll-behavior:auto;animation-duration:0s!important;animation-iteration-count:1!important;transition:none!important;transform:none!important}}body{font-family:var(--font-stack);background:var(--bg-primary);color:var(--text-primary);margin:0;padding:0;line-height:1.5;transition:background var(--transition),color var(--transition)}.top-header{padding:28px 24px 20px;max-width:1400px;margin:0 auto}.header-row{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.header-content{display:flex;align-items:flex-start;gap:18px}.logo,.logo-wrapper{display:block;width:6rem;height:6rem;flex-shrink:0}.logo svg{width:100%;height:100%}.header-text h1{margin:0;font-size:26px;font-weight:700;background:var(--title-gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;letter-spacing:-.02em}.header-meta{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;font-size:12px}.meta-item{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:6px;color:var(--text-secondary)}.metadata-toggle{font-family:inherit}.meta-item strong{color:var(--text-primary);font-family:var(--font-mono);font-size:11px;font-weight:500}.meta-label{color:var(--text-muted);font-size:10px;text-transform:uppercase;letter-spacing:.3px}.header-disclaimer{display:block;width:100%;font-size:10px;color:var(--text-muted);margin-top:6px;padding-left:2px}.metadata-panel{position:absolute;top:calc(100% - 4px);left:min(660px,calc(100% - 520px));z-index:120;width:min(520px,calc(100vw - 48px));max-height:min(70vh,680px);overflow:auto;padding:14px;background:var(--bg-card);border:1px solid var(--border-color-strong);border-radius:var(--radius-lg);box-shadow:0 18px 42px #00000059;opacity:0;transform:translateY(-6px);pointer-events:none;transition:opacity var(--transition),transform var(--transition)}.metadata-panel.open{opacity:1;transform:translateY(0);pointer-events:auto}.metadata-section{padding-bottom:14px;margin-bottom:14px;border-bottom:1px solid var(--border-color)}.metadata-section:last-child{padding-bottom:0;margin-bottom:0;border-bottom:none}.metadata-section-title{margin-bottom:8px;color:var(--text-primary);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px}.metadata-grid{display:grid;gap:8px}.metadata-row{display:grid;grid-template-columns:minmax(110px,.42fr) minmax(0,1fr);gap:10px;align-items:start}.metadata-row-label{color:var(--text-muted);font-size:11px;text-transform:uppercase;letter-spacing:.35px}.metadata-row-value{color:var(--text-primary);font-family:var(--font-mono);font-size:12px;line-height:1.4;overflow-wrap:anywhere}.metadata-list{display:grid;gap:6px}.metadata-list-item{padding:7px 8px;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:6px}.metadata-muted{color:var(--text-muted);font-size:12px}.cta-section{flex:0 1 660px;min-width:360px;display:flex;justify-content:flex-end}.cta-card{width:min(100%,560px);display:grid;grid-template-columns:auto minmax(190px,1fr) minmax(220px,.9fr);align-items:center;gap:16px;padding:8px 12px 8px 16px;color:var(--text-primary);text-decoration:none;border:1px solid rgba(6,182,212,.36);border-radius:18px;background:var(--bg-secondary);transition:border-color var(--transition),box-shadow var(--transition),transform var(--transition)}.cta-card:hover{border-color:#22d3eeb8;transform:translateY(-1px);box-shadow:0 18px 48px #0000004d,inset 0 1px #ffffff14,0 0 28px #06b6d433}.cta-card:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.cta-icon{width:78px;height:78px;display:inline-flex;align-items:center;justify-content:center;color:var(--accent-hover);border:1px solid var(--border-color-strong);border-radius:999px;box-shadow:inset 0 0 20px #06b6d41a}.cta-icon-svg{width:58px;height:58px}.cta-copy,.cta-action{display:grid;gap:6px}.cta-title{color:var(--text-primary);font-size:16px;font-weight:800;line-height:1.1}.cta-text{color:var(--text-secondary);font-size:13px;line-height:1.45;text-wrap:balance}.cta-button{display:inline-flex;align-items:center;justify-content:center;gap:12px;padding:9px;border-radius:12px;background:var(--accent);color:#fff;font-size:15px;font-weight:700;box-shadow:0 8px 24px #06b6d43d}.cta-privacy{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:var(--text-secondary);font-size:12px;font-weight:600}.cta-privacy svg{color:var(--accent-hover)}.cta-arrow{font-size:24px;line-height:1;transition:transform var(--transition)}.cta-card:hover .cta-arrow{transform:translate(2px)}.filter-bar{position:sticky;top:0;z-index:100;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);padding:12px 24px 4px;transition:background var(--transition),border-color var(--transition)}.filter-bar-inner{max-width:1360px;margin:0 auto}.filter-row{position:relative;display:grid;grid-template-columns:1fr;align-items:center;gap:8px}.filter-top-row{display:flex;align-items:center;gap:10px;min-width:0}.filter-top-row .search-wrapper{flex:1 1 420px;min-width:240px;max-width:548px}.view-switch{display:inline-flex;align-items:center;gap:4px;padding:2px;border:1px solid var(--border-color);border-radius:999px;background:var(--bg-primary)}.view-switch-btn{border:none;background:transparent;color:var(--text-secondary);border-radius:999px;padding:6px 12px;font-size:12px;cursor:pointer;transition:color var(--transition),background var(--transition);white-space:nowrap}.view-switch-btn:hover{color:var(--text-primary)}.view-switch-btn.active{color:var(--text-primary);background:var(--accent-subtle)}.filter-controls{position:absolute;top:calc(100% - 4px);left:min(530px,calc(100% - 440px));z-index:120;width:min(440px,calc(100vw - 48px));min-width:0;padding:14px;border:1px solid var(--border-color-strong);border-radius:var(--radius-lg);background:var(--bg-card);box-shadow:0 18px 42px #00000059;opacity:0;transform:translateY(-6px);pointer-events:none;transition:opacity var(--transition),transform var(--transition)}.filter-controls-row{display:grid;gap:14px}.filters-toggle{display:inline-flex;padding:8px 12px;border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);color:var(--text-secondary);font-size:13px;cursor:pointer;align-items:center;gap:6px;transition:all var(--transition);white-space:nowrap}.filters-toggle:hover{border-color:var(--accent);color:var(--accent)}.filters-toggle.open,.filters-toggle.has-active-filters{border-color:var(--accent);color:var(--text-primary);background:var(--accent-subtle)}.filter-count-badge{display:inline-flex;min-width:18px;height:18px;align-items:center;justify-content:center;border-radius:999px;background:var(--accent);color:#fff;font-size:11px;font-weight:700;line-height:1}.filter-count-badge[hidden]{display:none}.filters-toggle .chevron{transition:transform var(--transition)}.filters-toggle.open .chevron{transform:rotate(180deg)}.filter-controls.open{opacity:1;transform:translateY(0);pointer-events:auto}.filter-row>.column-headers-section{grid-column:1 / -1;width:100%}.mobile-only,.sort-wrapper.mobile-only{display:none}.filter-group{display:grid;gap:6px}.workspace-filter-group.hidden{display:none}.filter-panel-section{display:grid;gap:10px;padding-bottom:14px;border-bottom:1px solid var(--border-color)}.filter-panel-section:last-of-type{padding-bottom:0;border-bottom:none}.filter-panel-context:has(.workspace-filter-group.hidden){display:none}.filter-panel-title{font-size:11px;font-weight:700;color:var(--text-primary);text-transform:uppercase;letter-spacing:.5px}.filter-label{font-size:12px;font-weight:500;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}.search-wrapper{position:relative;flex:1;min-width:180px;max-width:280px}.search-icon{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--text-muted);pointer-events:none}input[type=search]{width:100%;padding:8px 12px 8px 32px;border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);color:var(--text-primary);font-size:14px;transition:border-color var(--transition),background var(--transition)}input[type=search]:focus{outline:none;border-color:var(--accent)}input[type=search]::placeholder{color:var(--text-muted)}select{padding:8px 28px 8px 10px;border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);color:var(--text-primary);font-size:13px;cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;transition:border-color var(--transition),background var(--transition)}.filter-controls select{width:100%}select:focus{outline:none;border-color:var(--accent)}.sort-wrapper{display:flex;align-items:center;gap:4px}.sort-wrapper select{margin-left:auto}.sort-direction-btn{padding:8px;border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);color:var(--text-secondary);cursor:pointer;font-size:14px;line-height:1;transition:all var(--transition)}.sort-direction-btn:hover{border-color:var(--accent);color:var(--accent)}.checkbox-filter{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-secondary);cursor:pointer}.checkbox-filter input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}.theme-toggle{margin-left:auto;display:flex;align-items:center;gap:8px}.theme-toggle-label{font-size:12px;color:var(--text-muted)}.theme-switch{appearance:none;position:relative;width:44px;height:24px;padding:0;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:12px;cursor:pointer;transition:background var(--transition),border-color var(--transition)}.theme-switch:after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;background:var(--text-secondary);border-radius:50%;transition:transform var(--transition),background var(--transition)}.theme-switch.light:after{transform:translate(20px);background:var(--accent)}.license-filter-toggle{display:none;padding:6px 12px;border:1px solid var(--border-color);border-radius:var(--radius);background:transparent;color:var(--text-secondary);font-size:12px;cursor:pointer;align-items:center;gap:6px;transition:all var(--transition)}.license-filter-toggle:hover{border-color:var(--accent);color:var(--accent)}.license-filter-toggle .chevron{transition:transform var(--transition)}.license-filter-toggle.open .chevron{transform:rotate(180deg)}.license-filter-panel-row{display:none}.license-filter-panel{background:transparent}.license-filter-inner{max-width:100%;margin:0;padding:0}.license-filter-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.license-filter-title{font-size:12px;font-weight:500;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}.license-quick-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.quick-action-btn{padding:4px 10px;font-size:11px;border:1px solid var(--border-color);border-radius:4px;background:transparent;color:var(--text-secondary);cursor:pointer;transition:all var(--transition)}.quick-action-btn:hover{border-color:var(--accent);color:var(--accent)}.license-groups{display:grid;gap:8px}.license-group-checkbox{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-secondary);cursor:pointer}.filter-panel-actions{display:flex;justify-content:flex-end}.active-filters-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:2px 0 6px}.active-filters-row[hidden]{display:none}.active-filters-label{color:var(--text-muted);font-size:12px}.active-filter-chips{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.active-filter-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid var(--border-color);border-radius:999px;background:var(--bg-primary);color:var(--text-primary);font-size:12px;line-height:1.2}.active-filter-remove{border:none;background:transparent;color:var(--text-muted);cursor:pointer;font-size:14px;line-height:1;padding:0}.active-filter-remove:hover{color:var(--accent)}.active-filter-clear{border:none;background:transparent;color:var(--accent);cursor:pointer;font-size:12px;padding:4px 6px}.active-filter-clear:hover{text-decoration:underline}.license-group-checkbox input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}.license-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.license-dot.permissive{background:var(--license-permissive)}.license-dot.weak-copyleft{background:var(--license-weak-copyleft)}.license-dot.strong-copyleft{background:var(--license-strong-copyleft)}.license-dot.unknown{background:var(--license-unknown)}.tool-errors{max-width:1400px;margin:16px auto;padding:12px 16px;background:var(--red-bg);border:1px solid var(--red);border-radius:var(--radius);color:var(--red)}.tool-errors:empty{display:none}.tool-errors strong{display:block;margin-bottom:8px}.main-content{max-width:1400px;margin:0 auto;padding:8px 24px 48px}.view-panel{display:none}.view-panel.active{display:block}.graph-mode .filter-bar,.graph-mode .top-header,.graph-mode .results-summary,.graph-mode .report-footer{display:none}.graph-mode .main-content{max-width:none;padding:24px}.graph-workspace-label{color:var(--text-muted);font-size:10px;text-transform:uppercase;letter-spacing:.4px;-webkit-user-select:none;user-select:none}.graph-workspace-select{min-width:200px;max-width:240px}select.graph-workspace-select{background-color:#ffffff0d;border:1px solid rgba(100,116,139,.25);color:var(--text-primary);transition:all var(--transition)}select.graph-workspace-select:hover{background-color:#ffffff1a;border-color:#64748b66}select.graph-workspace-select:focus{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-subtle)}[data-theme=light] select.graph-workspace-select{background-color:#00000008;border-color:#64748b33}[data-theme=light] select.graph-workspace-select:hover{background-color:#0000000f}.graph-canvas-shell{--graph-toolbar-height: 50px;position:relative;width:100%;height:74vh;min-height:420px;max-height:980px;border:1px solid var(--border-color);border-radius:var(--radius-lg);background:radial-gradient(circle at 15% 20%,var(--accent-subtle),transparent 35%),radial-gradient(circle at 80% 80%,var(--accent-subtle),transparent 42%),var(--bg-card);overflow:hidden}.graph-mode .graph-canvas-shell{height:calc(100dvh - 48px);min-height:520px;max-height:none}.graph-overlay{position:absolute;z-index:8;pointer-events:auto;display:flex;align-items:center;gap:8px;padding:8px;background:#0f172ab3;border:1px solid rgba(100,116,139,.25);border-radius:12px;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 4px 24px #0003,inset 0 1px #ffffff0d}.graph-key:before,.graph-workspace-wrap:before{content:"";display:block;width:1px;height:20px;position:absolute;top:50%;left:0;transform:translateY(-50%);background-color:var(--text-secondary)}.graph-key{padding-left:24px;display:flex;flex-direction:row;align-items:center;gap:12px;max-width:100%;position:relative}.graph-key-items{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0}.graph-key-item{display:inline-flex;align-items:center;gap:6px;color:var(--text-secondary);font-size:12px;line-height:1.1;white-space:nowrap}.graph-key-dot{width:10px;height:10px;border-radius:50%;display:inline-block;box-shadow:0 0 0 1px #ffffff1f}.graph-key-dot.dependency{background:var(--graph-direct-runtime)}.graph-key-dot.dev-dependency{background:var(--graph-direct-dev)}.graph-key-dot.sub-dependency{background:var(--graph-transitive)}[data-theme=light] .graph-overlay{background:#ffffffb3;border-color:#64748b26;box-shadow:0 4px 24px #0000000f,inset 0 1px #ffffff80}.graph-overlay.hidden,.graph-workspace-wrap.hidden{display:none}.graph-workspace-wrap{display:flex;padding-left:24px;flex-direction:row;align-items:center;gap:12px;position:relative}[data-theme=light] .graph-overlay-top{background:#ffffffb3;border-color:#64748b26}.graph-overlay-top{align-items:center;position:absolute;top:0;left:0;right:0;display:flex;flex-wrap:wrap;column-gap:24px;row-gap:8px;background:#0f172ab3;border-bottom:1px solid rgba(100,116,139,.25);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);padding:0 12px;min-height:50px}.graph-back-btn{gap:8px;background:#0f172ab3;border:1px solid rgba(100,116,139,.25);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 4px 24px #0003,inset 0 1px #ffffff0d;top:12px;left:12px;color:var(--text-primary);border-radius:8px;padding:7px 12px;font-size:12px;cursor:pointer;transition:transform var(--transition),background var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition);-webkit-user-select:none;user-select:none}.graph-back-btn:hover{background:#ffffff1a;border-color:#64748b66;color:var(--text-primary);transform:translateY(-1px);box-shadow:0 4px 12px #0003}[data-theme=light] .graph-back-btn:hover{background:#0000000d;box-shadow:0 4px 12px #00000014}[data-theme=light] .graph-back-btn{background:#ffffffb3;border-color:#64748b26;box-shadow:0 4px 24px #0000000f,inset 0 1px #ffffff80}.graph-controls{flex-direction:column;align-items:center;gap:8px;padding:8px;top:calc(var(--graph-toolbar-height, 50px) + 12px);right:12px}.zoom-controls{display:grid;grid-template-columns:repeat(2,52px);gap:6px}.zoom-controls>.graph-control-btn{font-size:18px;width:100%}.dpad{display:grid;grid-template-columns:34px 34px 34px;grid-template-rows:34px 34px 34px;grid-template-areas:". up ." "left . right" ". down .";gap:2px}.dpad .up{grid-area:up}.dpad .left{grid-area:left}.dpad .right{grid-area:right}.dpad .down{grid-area:down}.center-spacer{grid-column:2;grid-row:2;width:32px;height:32px;border:none;background:transparent}.graph-control-btn{border:1px solid rgba(100,116,139,.25);background:#ffffff0d;color:var(--text-primary);font-size:12px;width:34px;height:30px;border-radius:6px;cursor:pointer;line-height:1;transition:transform var(--transition),background var(--transition),border-color var(--transition),box-shadow var(--transition),color var(--transition)}.graph-control-btn:hover{background:#ffffff1f;border-color:#64748b66;transform:translateY(-1px);box-shadow:0 3px 10px #0003}[data-theme=light] .graph-control-btn{background:#00000008;border-color:#64748b26}[data-theme=light] .graph-control-btn:hover{background:#00000014;border-color:#64748b4d;box-shadow:0 3px 10px #00000014}.reset-btn{width:112px;text-transform:lowercase;letter-spacing:.2px}.graph-popover{position:absolute;z-index:9;min-width:220px;max-width:min(320px,calc(100% - 24px));padding:12px 14px;border:1px solid var(--border-color-strong);background:#0f172ad9;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:12px;box-shadow:0 12px 40px #0006,inset 0 1px #ffffff1a;pointer-events:auto}[data-theme=light] .graph-popover{background:#ffffffd9;box-shadow:0 12px 40px #0000001f,inset 0 1px #fff9}.graph-popover[hidden]{display:none}.graph-popover-name{font-family:var(--font-mono);font-size:13px;color:var(--text-primary);font-weight:600;margin-bottom:4px}.graph-popover-meta{font-size:12px;color:var(--text-secondary);margin-bottom:3px}.graph-popover-action{margin-top:8px;width:100%;border:1px solid var(--border-color);border-radius:6px;background:var(--bg-primary);color:var(--text-primary);font-size:12px;padding:7px 8px;cursor:pointer}.graph-popover-action:hover{border-color:var(--accent);color:var(--accent)}#graph-canvas{width:100%;height:100%;display:block;cursor:grab}#graph-canvas.is-clickable{cursor:pointer}#graph-canvas.is-panning{cursor:grabbing}.dep-list-highlight{animation:dep-list-highlight 2s ease-out}@keyframes dep-list-highlight{0%{box-shadow:0 0 0 0 var(--accent-subtle);border-color:var(--accent)}to{box-shadow:0 0 0 18px transparent;border-color:var(--border-color)}}.report-footer{max-width:1400px;margin:0 auto;padding:0 24px 40px;color:var(--text-secondary);font-size:12px}.report-footer p{margin:8px 0 0}.report-footer.hidden{display:none}.column-headers-section{max-width:1376px;margin:0 auto;display:flex;align-items:center;padding:12px 0 8px 14px}.package-header-wrapper{display:flex;flex-direction:row;justify-content:space-between;gap:2px;flex:1;min-width:0;padding-right:1rem}.results-summary{font-size:12px;color:var(--text-secondary);white-space:nowrap}.results-summary strong{color:var(--text-primary)}.package-header{align-self:flex-start;padding:4px 8px 4px 0}#column-headers-container{margin-left:auto;flex-shrink:0;width:60%}.column-headers{display:grid;grid-template-columns:repeat(5,1fr);width:100%}.column-header{display:flex;align-items:center;gap:4px;border:none;background:transparent;font-size:10px;font-weight:500;color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px;cursor:pointer;padding:4px 8px 4px 10px;border-left:1px solid var(--border-color);transition:color var(--transition);white-space:nowrap;line-height:1.1;overflow:hidden}.column-header-no-border{border-left:none}.column-header:hover{color:var(--text-primary)}.column-header.sorted{color:var(--accent)}.column-header-label{flex-shrink:1;overflow:hidden;text-overflow:ellipsis}.sort-indicator{font-size:9px;opacity:.8}.column-header:not(.sorted) .sort-indicator{visibility:hidden}.dependency-grid{display:flex;flex-direction:column;gap:8px}.dep-card{background:var(--bg-card);border:1px solid var(--border-color);border-radius:var(--radius-lg);overflow:hidden;transition:border-color var(--transition)}.dep-card:hover{border-color:var(--border-color-strong)}.dep-card[data-risk=red]{border-left:3px solid var(--red)}.dep-card[data-risk=amber]{border-left:3px solid var(--amber)}.dep-card[data-risk=green]{border-left:3px solid var(--green)}.dep-summary{display:flex;align-items:stretch;gap:10px;padding:0 0 0 12px;cursor:pointer;list-style:none;transition:background var(--transition)}.dep-summary:hover{background:var(--bg-card-hover)}.dep-summary::-webkit-details-marker{display:none}.expand-icon{align-self:center;width:16px;height:16px;flex-shrink:0;display:inline-block;color:var(--text-muted);transition:transform var(--transition);background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") no-repeat center / contain;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") no-repeat center / contain}details[open]>summary .expand-icon{transform:rotate(90deg)}.dep-name{align-self:center;font-family:var(--font-mono);font-size:14px;font-weight:600;color:var(--text-primary);padding:8px 0}.dep-version{font-weight:400;color:var(--text-secondary)}.dep-indicators{display:grid;grid-template-columns:repeat(5,1fr);align-self:stretch;margin-left:auto;flex-shrink:0;width:60%}.badge-card{display:flex;flex-direction:column;justify-content:center;min-height:38px;padding:4px 8px 4px 10px;background:var(--bg-primary);border-left:1px solid var(--border-color);position:relative;overflow:hidden}.badge-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--gray)}.badge-card.green:before{background:var(--green)}.badge-card.amber:before{background:var(--amber)}.badge-card.red:before{background:var(--red)}.badge-card.gray:before{background:var(--gray)}.badge-label{font-size:8px;font-weight:500;color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px;line-height:1.1;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}.badge-value{font-size:11px;font-weight:500;color:var(--text-primary);line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dep-details{padding:0 16px 16px;border-top:1px solid var(--border-color);animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.package-links{display:flex;flex-wrap:wrap;gap:8px;padding:12px 0;margin-bottom:4px;border-bottom:1px solid var(--border-color)}.package-link{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--bg-hover);border:1px solid var(--border-color);border-radius:var(--radius-md);color:var(--text-primary);text-decoration:none;font-size:13px;font-weight:500;transition:all var(--transition)}.package-link:hover{background:var(--accent);border-color:var(--accent);color:#fff}.package-link svg{width:14px;height:14px;flex-shrink:0}.section,.section:first-child{margin-top:16px}.section-header{display:flex;align-items:center;gap:8px;margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid var(--border-color)}.section-title{font-size:13px;font-weight:600;color:var(--text-primary);text-transform:uppercase;letter-spacing:.5px}.section-desc{font-size:11px;color:var(--text-muted)}.kv-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px}.kv-grid-tight{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.kv-item{display:flex;flex-direction:column;gap:2px}.kv-label{font-size:12px;font-weight:500;color:var(--text-muted)}.kv-value{font-size:14px;color:var(--text-primary);overflow-wrap:anywhere;word-break:break-word}.kv-inline-link{color:var(--accent);text-decoration:none;font-size:12px;margin-left:6px;white-space:nowrap;display:inline-flex;align-items:center;gap:3px;text-underline-offset:2px}.kv-inline-link:hover{text-decoration:underline}.kv-inline-link-icon{width:11px;height:11px;flex-shrink:0}.kv-inline-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}.risk-value{display:inline-flex;align-items:center;gap:6px}.risk-dot{width:8px;height:8px;border-radius:999px;background:var(--gray);flex-shrink:0}.risk-dot.green{background:var(--green)}.risk-dot.amber{background:var(--amber)}.risk-dot.red{background:var(--red)}.kv-hint{font-size:11px;color:var(--text-muted);font-style:italic}.micro-summary{display:grid;gap:6px;padding:6px 0 2px}.micro-line{font-size:13px;color:var(--text-primary)}.micro-sublist{margin-top:8px}.micro-subtitle{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px}.section-block{margin-top:12px}.block-title{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px}.section-note{font-size:12px;color:var(--text-secondary);margin:6px 0 12px}.subsection{padding:12px 0;border-top:1px solid var(--border-color)}.subsection:first-child{border-top:none;padding-top:0}.subsection-header{display:flex;align-items:baseline;gap:8px;margin-bottom:8px}.subsection-title{font-size:12px;font-weight:600;color:var(--text-primary);text-transform:uppercase;letter-spacing:.4px}.subsection-desc{font-size:11px;color:var(--text-muted)}.subsection.warning .subsection-title{color:var(--red)}.detail-list{margin-top:12px}.detail-title{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px}.detail-items{list-style:none;padding:0;margin:0;display:grid;gap:6px}.detail-items.mono .detail-item{font-family:var(--font-mono)}.detail-item{font-size:12px;color:var(--text-secondary);overflow-wrap:anywhere;word-break:break-word}.detail-item.muted{color:var(--text-muted)}.declared-deps{display:grid;gap:8px}.declared-summary{font-size:12px;color:var(--text-secondary);margin:4px 0 8px}.declared-group{border:1px solid var(--border-color);border-radius:8px;background:var(--bg-primary);padding:8px 10px}.declared-group-summary{font-size:12px;font-weight:600;color:var(--text-primary);cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px}.declared-group-summary::-webkit-details-marker{display:none}.declared-count{font-size:11px;color:var(--text-muted);font-weight:500}.declared-group-title{display:inline-flex;align-items:baseline;gap:6px}.declared-table{display:grid;gap:6px;margin-top:8px}.declared-row{display:grid;grid-template-columns:minmax(160px,1.3fr) minmax(120px,1fr) auto;gap:10px;align-items:center;padding:8px 10px;border:1px solid var(--border-color);border-radius:6px;background:var(--bg-primary)}.declared-name{font-size:12px;font-family:var(--font-mono);color:var(--text-primary);display:flex;align-items:center;gap:6px;overflow-wrap:anywhere}.declared-range{font-size:12px;color:var(--text-secondary);font-family:var(--font-mono);overflow-wrap:anywhere}.status-pill{display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;text-decoration:none;border:1px solid transparent}.status-pill.installed{color:var(--green);border-color:var(--green);background:var(--green-bg)}.status-pill.missing{color:var(--text-muted);border-color:var(--border-color-strong);background:var(--gray-bg)}.bullet-list{margin:6px 0 0;padding-left:18px;color:var(--text-secondary)}.bullet-list li{margin-bottom:6px}.subtle-divider{height:1px;background:var(--border-color);margin:12px 0}.package-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.package-tag{padding:2px 8px;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;font-size:11px;font-family:var(--font-mono);color:var(--text-secondary)}.package-list-toggle{font-size:11px;color:var(--accent);background:none;border:none;cursor:pointer;padding:2px 4px}.package-list-toggle:hover{text-decoration:underline}.vuln-table{width:100%;border-collapse:collapse;font-size:13px}.vuln-table th,.vuln-table td{text-align:left;padding:8px 12px;border-bottom:1px solid var(--border-color);vertical-align:top;overflow-wrap:anywhere;word-break:break-word}.vuln-table th{font-weight:500;color:var(--text-muted);font-size:11px;text-transform:uppercase;letter-spacing:.5px}.vuln-table tr[data-severity=critical],.vuln-table tr[data-severity=high]{background:var(--red-bg)}.vuln-table tr[data-severity=moderate]{background:var(--amber-bg)}.vuln-table a{color:var(--accent);text-decoration:none}.vuln-table a:hover{text-decoration:underline}.no-vulns{font-size:13px;color:var(--text-secondary);padding:8px 0}.raw-data-toggle{margin-top:16px}.raw-data-toggle summary{font-size:12px;color:var(--text-muted);cursor:pointer;padding:8px 0;display:flex;align-items:center;gap:8px;list-style:none}.raw-data-toggle summary::-webkit-details-marker{display:none}.raw-data-pane{margin-top:8px;position:relative;display:flex;flex-direction:column;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:var(--radius);max-height:300px;overflow:auto}.raw-data-pane pre{margin:0;padding:12px 12px 44px;background:transparent;border:none;font-family:var(--font-mono);font-size:11px;color:var(--text-secondary);white-space:pre;overflow:visible}.copy-json-btn{position:sticky;bottom:8px;align-self:flex-end;margin:0 8px 8px;padding:6px 10px;border:1px solid var(--border-color);border-radius:4px;background:var(--bg-card);color:var(--text-primary);font-size:11px;cursor:pointer;transition:all var(--transition)}.raw-data-toggle:not([open]) .copy-json-btn{display:none}.copy-json-btn:hover{border-color:var(--accent);color:var(--accent)}.copy-json-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.copy-json-btn.copied{border-color:var(--green);color:var(--green)}.dep-loading{padding:2rem 0}.dep-loading-bar{position:relative;height:.25rem;background:var(--border-color);overflow:hidden;border-radius:999px}.dep-loading-bar:after{content:"";position:absolute;top:0;left:-40%;width:40%;height:100%;background:var(--accent);animation:dep-loading 1.2s ease-in-out infinite}@keyframes dep-loading{0%{transform:translate(0)}to{transform:translate(250%)}}.package-tag-link{text-decoration:none;color:var(--text-secondary);transition:all var(--transition)}.package-tag-link:hover{border-color:var(--accent);color:var(--accent)}.package-tag-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.empty-state{text-align:center;padding:48px 24px;color:var(--text-muted)}.empty-state-icon{font-size:48px;margin-bottom:12px}.empty-state-text{font-size:16px}@media(max-width:1180px)and (min-width:769px){.header-row{flex-direction:column}.cta-section{flex:none;width:100%;min-width:0;max-width:none}.cta-card{width:100%;max-width:none}.filter-top-row{max-width:none}.graph-overlay-top{padding:8px 12px}}@media(max-width:768px){.top-header{padding:20px 16px}.header-row{flex-direction:column;align-items:flex-start;gap:16px}.header-content{gap:12px}.logo,.logo-wrapper{width:48px;height:48px}.header-text h1{font-size:22px}.header-meta{gap:6px}.meta-item{padding:3px 8px;font-size:11px}.cta-section{flex:none;width:100%;min-width:0;max-width:none;text-align:left}.cta-card{width:100%;min-height:0;grid-template-columns:auto minmax(0,1fr);gap:14px;padding:14px;border-radius:14px}.cta-icon{width:56px;height:56px}.cta-icon-svg{width:42px;height:42px;display:block}.cta-title{font-size:18px}.cta-text{font-size:13px}.cta-action{grid-column:1 / -1;grid-template-columns:minmax(0,1fr)}.cta-button{font-size:14px}.cta-privacy{justify-content:flex-start;font-size:12px}.filter-bar{padding:10px 16px}.filter-row{display:block}.filter-top-row{display:flex;align-items:center;gap:10px;flex:1 1 auto;min-width:0;flex-wrap:wrap}.search-wrapper{max-width:none;flex:1 1 100%}.filter-top-row .search-wrapper{flex-basis:100%;min-width:0}.view-switch{order:3}.view-switch-btn{padding:6px 10px}.filters-toggle{order:2;flex-shrink:0}.filter-controls,.metadata-panel{position:static;width:100%;max-height:0;opacity:0;overflow:hidden;transform:translateY(-8px);pointer-events:none;transition:max-height .3s ease-out,opacity .25s ease-out,transform .25s ease-out,margin-top .25s ease-out;margin-top:0;padding:0 12px;box-shadow:none}.filter-controls.open,.metadata-panel.open{max-height:900px;opacity:1;transform:translateY(0);pointer-events:auto;margin-top:8px;padding:12px}.filter-controls-row{display:grid;gap:10px}.filter-group{display:grid}.filter-group select{max-width:none}.mobile-only,.sort-wrapper.mobile-only{display:flex!important}.theme-toggle{order:4;margin-left:auto}.license-filter-toggle,#column-headers-container,.column-headers,.package-header{display:none}.column-headers-section{max-height:0;opacity:0;overflow:hidden;transform:translateY(-6px);pointer-events:none;transition:max-height .3s ease-out,opacity .25s ease-out,transform .25s ease-out,margin-top .25s ease-out,padding .25s ease-out;margin-top:0;padding:0 16px}.filter-controls.open+.license-filter-panel-row+.column-headers-section{max-height:120px;opacity:1;transform:translateY(0);pointer-events:auto;margin-top:8px;padding:8px 16px}.package-header-wrapper{flex-direction:row}.main-content{padding:12px 16px 32px}.graph-workspace-select{min-width:170px}.graph-overlay{padding:6px}.graph-canvas-shell{height:62vh;min-height:340px}.graph-key{padding:6px 8px;gap:8px}.graph-key-items{gap:8px}.graph-key-item{font-size:11px}.graph-back-btn{left:8px;top:8px}.graph-mode .main-content{padding:8px}.graph-mode .graph-canvas-shell{height:calc(100dvh - 16px);min-height:420px}.graph-controls{top:calc(var(--graph-toolbar-height, 50px) + 8px)}.report-footer{padding:0 16px 32px}.vuln-table thead{display:none}.vuln-table tr{display:block;border-bottom:1px solid var(--border-color)}.vuln-table td{display:flex;justify-content:space-between;gap:12px;padding:6px 8px}.vuln-table td:before{content:attr(data-label);font-size:10px;text-transform:uppercase;letter-spacing:.4px;color:var(--text-muted);min-width:120px}.dep-summary{align-items:center;flex-wrap:wrap;padding:8px 12px}.dep-name{font-size:13px}.dep-indicators{display:flex;flex-wrap:wrap;min-width:auto;width:100%;margin-left:0;margin-top:6px;padding-top:6px;border-top:1px solid var(--border-color);gap:4px}.badge-card{flex:1 1 calc(50% - 4px);min-width:0}.badge-value{font-size:10px}.badge-label{clip:none;clip-path:none;height:auto;width:auto;margin:0;overflow:auto;padding:0;position:relative;font-size:7px}.declared-row{grid-template-columns:1fr;gap:6px}.graph-overlay-top{padding:8px 12px}}@media(max-width:480px){.header-text h1{font-size:20px}.meta-item{font-size:10px;padding:2px 6px}.cta-card{grid-template-columns:1fr;text-align:left}.cta-icon{display:none}.cta-action{grid-column:auto}.badge-card{flex:1 1 100%}}
12
- `;
11
+ exports.CSS_CONTENT = `*,:before,:after{box-sizing:border-box}:root{--bg-primary:#0c1222;--bg-secondary:#151d2e;--bg-card:#151d2ef2;--bg-card-hover:#1e293bf2;--text-primary:#e8edf5;--text-secondary:#8b99b0;--text-muted:#5c6b82;--border-color:#63789633;--border-color-strong:#63789659;--accent:#06b6d4;--accent-hover:#22d3ee;--accent-subtle:#06b6d426;--green:#10b981;--green-bg:#10b98126;--amber:#f59e0b;--amber-bg:#f59e0b26;--red:#ef4444;--red-bg:#ef444426;--gray:#64748b;--gray-bg:#64748b26;--license-permissive:#10b981;--license-weak-copyleft:#f59e0b;--license-strong-copyleft:#ef4444;--license-unknown:#64748b;--font-stack:-apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", sans-serif;--font-mono:ui-monospace, "SFMono-Regular", "SF Mono", "Menlo", "Consolas", monospace;--transition:.2s ease;--radius:8px;--radius-sm:4px;--radius-lg:12px;--graph-direct-runtime:var(--green);--graph-direct-dev:var(--amber);--graph-transitive:var(--accent);--graph-edge:var(--border-color-strong);--graph-highlight:var(--accent-hover);--graph-muted:var(--text-muted);--graph-vuln-high:var(--red);--graph-vuln-medium:var(--amber)}:root.light{--bg-primary:#f5f7fa;--bg-secondary:#e8ecf2;--bg-card:#fffffffa;--bg-card-hover:#f8fafc;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#64748b;--border-color:#64748b2e;--border-color-strong:#64748b4d;--accent:#0891b2;--accent-hover:#06b6d4;--accent-subtle:#0891b21a;--title-gradient:linear-gradient(135deg, #0891b2 0%, #059669 100%);--graph-highlight:var(--accent);--graph-muted:var(--text-secondary)}[data-theme=light]{--graph-highlight:var(--accent);--graph-muted:var(--text-secondary)}html{scroll-behavior:smooth}@media (prefers-reduced-motion:reduce){html,*,:before,:after{scroll-behavior:auto;transition:none!important;animation-duration:0s!important;animation-iteration-count:1!important;transform:none!important}}body{font-family:var(--font-stack);background:var(--bg-primary);color:var(--text-primary);transition:background var(--transition), color var(--transition);margin:0;padding:0;line-height:1.5}.top-header{max-width:1400px;margin:0 auto;padding:28px 24px 20px}.header-row{justify-content:space-between;align-items:flex-start;gap:24px;display:flex}.header-content{align-items:flex-start;gap:18px;display:flex}.logo,.logo-wrapper{flex-shrink:0;width:6rem;height:6rem;display:block}.logo svg{width:100%;height:100%}.header-text h1{background-color:var(--accent);-webkit-text-fill-color:transparent;letter-spacing:-.02em;-webkit-background-clip:text;background-clip:text;margin:0;font-size:26px;font-weight:700}.header-meta{flex-wrap:wrap;gap:8px;margin-top:10px;font-size:12px;display:flex}.meta-item{background:var(--bg-secondary);border:1px solid var(--border-color);color:var(--text-secondary);border-radius:6px;align-items:center;gap:6px;padding:4px 10px;display:inline-flex}.metadata-toggle{font-family:inherit}.meta-item strong{color:var(--text-primary);font-family:var(--font-mono);font-size:11px;font-weight:500}.meta-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px;font-size:10px}.header-disclaimer{width:100%;color:var(--text-muted);margin-top:6px;padding-left:2px;font-size:10px;display:block}.metadata-panel{z-index:120;background:var(--bg-card);border:1px solid var(--border-color-strong);border-radius:var(--radius-lg);opacity:0;pointer-events:none;width:min(520px,100vw - 48px);max-height:min(70vh,680px);transition:opacity var(--transition), transform var(--transition);padding:14px;position:absolute;top:calc(100% - 4px);left:min(660px,100% - 520px);overflow:auto;transform:translateY(-6px);box-shadow:0 18px 42px #00000059}.metadata-panel.open{opacity:1;pointer-events:auto;transform:translateY(0)}.metadata-section{border-bottom:1px solid var(--border-color);margin-bottom:14px;padding-bottom:14px}.metadata-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.metadata-section-title{color:var(--text-primary);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px;font-size:11px;font-weight:700}.metadata-grid{gap:8px;display:grid}.metadata-row{grid-template-columns:minmax(110px,.42fr) minmax(0,1fr);align-items:start;gap:10px;display:grid}.metadata-row-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.35px;font-size:11px}.metadata-row-value{color:var(--text-primary);font-family:var(--font-mono);overflow-wrap:anywhere;font-size:12px;line-height:1.4}.metadata-list{gap:6px;display:grid}.metadata-list-item{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:6px;padding:7px 8px}.metadata-muted{color:var(--text-muted);font-size:12px}.cta-section{flex:0 660px;justify-content:flex-end;min-width:360px;display:flex}.cta-card{width:min(100%,560px);color:var(--text-primary);background:var(--bg-secondary);transition:border-color var(--transition), box-shadow var(--transition), transform var(--transition);border:1px solid #06b6d45c;border-radius:18px;grid-template-columns:auto minmax(190px,1fr) minmax(220px,.9fr);align-items:center;gap:16px;padding:8px 12px 8px 8px;text-decoration:none;display:grid}.cta-card:hover{border-color:#22d3eeb8;transform:translateY(-1px);box-shadow:0 18px 48px #0000004d,inset 0 1px #ffffff14,0 0 28px #06b6d433}.cta-card:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.cta-icon{width:78px;height:78px;color:var(--accent-hover);border:1px solid var(--border-color-strong);background-color:var(--bg-primary);border-radius:999px;justify-content:center;align-items:center;display:inline-flex;box-shadow:inset 0 0 20px #06b6d41a}.cta-icon-svg{width:58px;height:58px}.cta-copy,.cta-action{gap:6px;display:grid}.cta-title{color:var(--text-primary);font-size:16px;font-weight:800;line-height:1.1}.cta-text{color:var(--text-secondary);text-wrap:balance;font-size:13px;line-height:1.45}.cta-button{background:var(--accent);color:#fff;border-radius:10px;justify-content:center;align-items:center;gap:12px;padding:9px;font-size:15px;font-weight:700;display:inline-flex;box-shadow:0 8px 24px #06b6d43d}.cta-privacy{color:var(--text-secondary);justify-content:center;align-items:center;gap:6px;font-size:12px;font-weight:600;display:inline-flex}.cta-privacy svg{color:var(--accent-hover)}.cta-arrow{transition:transform var(--transition);font-size:24px;line-height:1}.cta-card:hover .cta-arrow{transform:translate(2px)}.filter-bar{z-index:100;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);transition:background var(--transition), border-color var(--transition);padding:12px 24px 4px;position:sticky;top:0}.filter-bar-inner{max-width:1360px;margin:0 auto}.filter-row{grid-template-columns:1fr;align-items:center;gap:6px;display:grid;position:relative}.filter-top-row{align-items:center;gap:10px;min-width:0;display:flex}.filter-top-row .search-wrapper{flex:420px;min-width:240px;max-width:548px}.view-switch{border:1px solid var(--border-color);background:var(--bg-primary);border-radius:999px;align-items:center;gap:4px;padding:2px;display:inline-flex}.view-switch-btn{color:var(--text-secondary);cursor:pointer;transition:color var(--transition), background var(--transition);white-space:nowrap;background:0 0;border:none;border-radius:999px;padding:6px 12px;font-size:12px}.view-switch-btn:hover{color:var(--text-primary)}.view-switch-btn.active{color:var(--text-primary);background:var(--accent-subtle)}.filter-controls{z-index:120;border:1px solid var(--border-color-strong);border-radius:var(--radius-lg);background:var(--bg-card);opacity:0;pointer-events:none;width:min(440px,100vw - 48px);min-width:0;transition:opacity var(--transition), transform var(--transition);padding:14px;position:absolute;top:calc(100% - 4px);left:min(530px,100% - 440px);transform:translateY(-6px);box-shadow:0 18px 42px #00000059}.filter-controls-row{gap:14px;display:grid}.filters-toggle{border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);color:var(--text-secondary);cursor:pointer;transition:all var(--transition);white-space:nowrap;align-items:center;gap:6px;padding:8px 12px;font-size:13px;display:inline-flex}.filters-toggle:hover{border-color:var(--accent);color:var(--accent)}.filters-toggle.open,.filters-toggle.has-active-filters{border-color:var(--accent);color:var(--text-primary);background:var(--accent-subtle)}.filter-count-badge{background:var(--accent);color:#fff;border-radius:999px;justify-content:center;align-items:center;min-width:18px;height:18px;font-size:11px;font-weight:700;line-height:1;display:inline-flex}.filter-count-badge[hidden]{display:none}.filters-toggle .chevron{transition:transform var(--transition)}.filters-toggle.open .chevron{transform:rotate(180deg)}.filter-controls.open{opacity:1;pointer-events:auto;transform:translateY(0)}.filter-row>.column-headers-section{grid-column:1/-1;width:100%}.mobile-only,.sort-wrapper.mobile-only{display:none}.filter-group{gap:6px;display:grid}.workspace-filter-group.hidden{display:none}.filter-panel-section{border-bottom:1px solid var(--border-color);gap:10px;padding-bottom:14px;display:grid}.filter-panel-section:last-of-type{border-bottom:none;padding-bottom:0}.filter-panel-context:has(.workspace-filter-group.hidden){display:none}.filter-panel-title{color:var(--text-primary);text-transform:uppercase;letter-spacing:.5px;font-size:11px;font-weight:700}.filter-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;font-size:12px;font-weight:500}.search-wrapper{flex:1;min-width:180px;max-width:280px;position:relative}.search-icon{color:var(--text-muted);pointer-events:none;position:absolute;top:50%;left:10px;transform:translateY(-50%)}input[type=search]{border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);width:100%;color:var(--text-primary);transition:border-color var(--transition), background var(--transition);padding:8px 12px 8px 32px;font-size:14px}input[type=search]:focus{border-color:var(--accent);outline:none}input[type=search]::placeholder{color:var(--text-muted)}select{border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);color:var(--text-primary);cursor:pointer;appearance:none;transition:border-color var(--transition), background var(--transition);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-position:right 8px center;background-repeat:no-repeat;padding:8px 28px 8px 10px;font-size:13px}.filter-controls select{width:100%}select:focus{border-color:var(--accent);outline:none}.sort-wrapper{align-items:center;gap:4px;display:flex}.sort-wrapper select{margin-left:auto}.sort-direction-btn{border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-primary);color:var(--text-secondary);cursor:pointer;transition:all var(--transition);padding:8px;font-size:14px;line-height:1}.sort-direction-btn:hover{border-color:var(--accent);color:var(--accent)}.checkbox-filter{color:var(--text-secondary);cursor:pointer;align-items:center;gap:6px;font-size:13px;display:flex}.checkbox-filter input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}.theme-toggle{align-items:center;gap:8px;margin-left:auto;display:flex}.theme-toggle-label{color:var(--text-muted);font-size:12px}.theme-switch{appearance:none;background:var(--bg-primary);border:1px solid var(--border-color);cursor:pointer;width:44px;height:24px;transition:background var(--transition), border-color var(--transition);border-radius:12px;padding:0;position:relative}.theme-switch:after{content:"";background:var(--text-secondary);width:18px;height:18px;transition:transform var(--transition), background var(--transition);border-radius:50%;position:absolute;top:2px;left:2px}.theme-switch.light:after{background:var(--accent);transform:translate(20px)}.license-filter-toggle{border:1px solid var(--border-color);border-radius:var(--radius);color:var(--text-secondary);cursor:pointer;transition:all var(--transition);background:0 0;align-items:center;gap:6px;padding:6px 12px;font-size:12px;display:none}.license-filter-toggle:hover{border-color:var(--accent);color:var(--accent)}.license-filter-toggle .chevron{transition:transform var(--transition)}.license-filter-toggle.open .chevron{transform:rotate(180deg)}.license-filter-panel-row{display:none}.license-filter-panel{background:0 0}.license-filter-inner{max-width:100%;margin:0;padding:0}.license-filter-header{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.license-filter-title{color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;font-size:12px;font-weight:500}.license-quick-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;display:flex}.quick-action-btn{border:1px solid var(--border-color);color:var(--text-secondary);cursor:pointer;transition:all var(--transition);background:0 0;border-radius:4px;padding:4px 10px;font-size:11px}.quick-action-btn:hover{border-color:var(--accent);color:var(--accent)}.license-groups{gap:8px;display:grid}.license-group-checkbox{color:var(--text-secondary);cursor:pointer;align-items:center;gap:6px;font-size:13px;display:flex}.filter-panel-actions{justify-content:flex-end;display:flex}.active-filters-row{flex-wrap:wrap;align-items:center;gap:8px;padding:2px 0 6px;display:flex}.active-filters-row[hidden]{display:none}.active-filters-label{color:var(--text-muted);font-size:12px}.active-filter-chips{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.active-filter-chip{border:1px solid var(--border-color);background:var(--bg-primary);color:var(--text-primary);border-radius:999px;align-items:center;gap:6px;padding:4px 8px;font-size:12px;line-height:1.2;display:inline-flex}.active-filter-remove{color:var(--text-muted);cursor:pointer;background:0 0;border:none;padding:0;font-size:14px;line-height:1}.active-filter-remove:hover{color:var(--accent)}.active-filter-clear{color:var(--accent);cursor:pointer;background:0 0;border:none;padding:4px 6px;font-size:12px}.active-filter-clear:hover{text-decoration:underline}.license-group-checkbox input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}.license-dot{border-radius:50%;flex-shrink:0;width:8px;height:8px}.license-dot.permissive{background:var(--license-permissive)}.license-dot.weak-copyleft{background:var(--license-weak-copyleft)}.license-dot.strong-copyleft{background:var(--license-strong-copyleft)}.license-dot.unknown{background:var(--license-unknown)}.tool-errors{background:var(--red-bg);border:1px solid var(--red);border-radius:var(--radius);max-width:1400px;color:var(--red);margin:16px auto;padding:12px 16px}.tool-errors:empty{display:none}.tool-errors strong{margin-bottom:8px;display:block}.main-content{max-width:1400px;margin:0 auto;padding:6px 24px 48px}.view-panel{display:none}.view-panel.active{display:block}.graph-mode .filter-bar,.graph-mode .top-header,.graph-mode .results-summary,.graph-mode .report-footer{display:none}.graph-mode .main-content{max-width:none;padding:24px}.graph-workspace-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;-webkit-user-select:none;user-select:none;font-size:10px}.graph-workspace-select{min-width:200px;max-width:240px}select.graph-workspace-select{color:var(--text-primary);transition:all var(--transition);background-color:#ffffff0d;border:1px solid #64748b40}select.graph-workspace-select:hover{background-color:#ffffff1a;border-color:#64748b66}select.graph-workspace-select:focus{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-subtle)}[data-theme=light] select.graph-workspace-select{background-color:#00000008;border-color:#64748b33}[data-theme=light] select.graph-workspace-select:hover{background-color:#0000000f}.graph-canvas-shell{--graph-toolbar-height:50px;border:1px solid var(--border-color);border-radius:var(--radius-lg);background:radial-gradient(circle at 15% 20%, var(--accent-subtle), transparent 35%), radial-gradient(circle at 80% 80%, var(--accent-subtle), transparent 42%), var(--bg-card);width:100%;height:74vh;min-height:420px;max-height:980px;position:relative;overflow:hidden}.graph-mode .graph-canvas-shell{height:calc(100dvh - 48px);min-height:520px;max-height:none}.graph-overlay{z-index:8;pointer-events:auto;-webkit-backdrop-filter:blur(12px);background:#0f172ab3;border:1px solid #64748b40;border-radius:12px;align-items:center;gap:8px;padding:8px;display:flex;position:absolute;box-shadow:0 4px 24px #0003,inset 0 1px #ffffff0d}.graph-key:before,.graph-workspace-wrap:before{content:"";background-color:var(--text-secondary);width:1px;height:20px;display:block;position:absolute;top:50%;left:0;transform:translateY(-50%)}.graph-key{flex-direction:row;align-items:center;gap:12px;max-width:100%;padding-left:24px;display:flex;position:relative}.graph-key-items{flex-wrap:wrap;align-items:center;gap:12px;min-width:0;display:flex}.graph-key-item{color:var(--text-secondary);white-space:nowrap;align-items:center;gap:6px;font-size:12px;line-height:1.1;display:inline-flex}.graph-key-dot{border-radius:50%;width:10px;height:10px;display:inline-block;box-shadow:0 0 0 1px #ffffff1f}.graph-key-dot.dependency{background:var(--graph-direct-runtime)}.graph-key-dot.dev-dependency{background:var(--graph-direct-dev)}.graph-key-dot.sub-dependency{background:var(--graph-transitive)}[data-theme=light] .graph-overlay{background:#ffffffb3;border-color:#64748b26;box-shadow:0 4px 24px #0000000f,inset 0 1px #ffffff80}.graph-overlay.hidden,.graph-workspace-wrap.hidden{display:none}.graph-workspace-wrap{flex-direction:row;align-items:center;gap:12px;padding-left:24px;display:flex;position:relative}[data-theme=light] .graph-overlay-top{background:#ffffffb3;border-color:#64748b26}.graph-overlay-top{-webkit-backdrop-filter:blur(12px);background:#0f172ab3;border-bottom:1px solid #64748b40;flex-wrap:wrap;align-items:center;gap:8px 24px;min-height:50px;padding:0 12px;display:flex;position:absolute;top:0;left:0;right:0}.graph-back-btn{-webkit-backdrop-filter:blur(12px);color:var(--text-primary);cursor:pointer;transition:transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);-webkit-user-select:none;user-select:none;background:#0f172ab3;border:1px solid #64748b40;border-radius:8px;gap:8px;padding:7px 12px;font-size:12px;top:12px;left:12px;box-shadow:0 4px 24px #0003,inset 0 1px #ffffff0d}.graph-back-btn:hover{color:var(--text-primary);background:#ffffff1a;border-color:#64748b66;transform:translateY(-1px);box-shadow:0 4px 12px #0003}[data-theme=light] .graph-back-btn:hover{background:#0000000d;box-shadow:0 4px 12px #00000014}[data-theme=light] .graph-back-btn{background:#ffffffb3;border-color:#64748b26;box-shadow:0 4px 24px #0000000f,inset 0 1px #ffffff80}.graph-controls{top:calc(var(--graph-toolbar-height,50px) + 12px);flex-direction:column;align-items:center;gap:8px;padding:8px;right:12px}.zoom-controls{grid-template-columns:repeat(2,52px);gap:6px;display:grid}.zoom-controls>.graph-control-btn{width:100%;font-size:18px}.dpad{grid-template:".up."34px"left.right"34px".down."34px/34px 34px 34px;gap:2px;display:grid}.dpad .up{grid-area:up}.dpad .left{grid-area:left}.dpad .right{grid-area:right}.dpad .down{grid-area:down}.center-spacer{background:0 0;border:none;grid-area:2/2;width:32px;height:32px}.graph-control-btn{color:var(--text-primary);cursor:pointer;width:34px;height:30px;transition:transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);background:#ffffff0d;border:1px solid #64748b40;border-radius:6px;font-size:12px;line-height:1}.graph-control-btn:hover{background:#ffffff1f;border-color:#64748b66;transform:translateY(-1px);box-shadow:0 3px 10px #0003}[data-theme=light] .graph-control-btn{background:#00000008;border-color:#64748b26}[data-theme=light] .graph-control-btn:hover{background:#00000014;border-color:#64748b4d;box-shadow:0 3px 10px #00000014}.reset-btn{text-transform:lowercase;letter-spacing:.2px;width:112px}.graph-popover{z-index:9;border:1px solid var(--border-color-strong);-webkit-backdrop-filter:blur(16px);pointer-events:auto;background:#0f172ad9;border-radius:12px;min-width:220px;max-width:min(320px,100% - 24px);padding:12px 14px;position:absolute;box-shadow:0 12px 40px #0006,inset 0 1px #ffffff1a}[data-theme=light] .graph-popover{background:#ffffffd9;box-shadow:0 12px 40px #0000001f,inset 0 1px #fff9}.graph-popover[hidden]{display:none}.graph-popover-name{font-family:var(--font-mono);color:var(--text-primary);margin-bottom:4px;font-size:13px;font-weight:600}.graph-popover-meta{color:var(--text-secondary);margin-bottom:3px;font-size:12px}.graph-popover-action{border:1px solid var(--border-color);background:var(--bg-primary);width:100%;color:var(--text-primary);cursor:pointer;border-radius:6px;margin-top:8px;padding:7px 8px;font-size:12px}.graph-popover-action:hover{border-color:var(--accent);color:var(--accent)}#graph-canvas{cursor:grab;width:100%;height:100%;display:block}#graph-canvas.is-clickable{cursor:pointer}#graph-canvas.is-panning{cursor:grabbing}.dep-list-highlight{animation:2s ease-out dep-list-highlight}@keyframes dep-list-highlight{0%{box-shadow:0 0 0 0 var(--accent-subtle);border-color:var(--accent)}to{border-color:var(--border-color);box-shadow:0 0 0 18px #0000}}.report-footer{max-width:1400px;color:var(--text-secondary);margin:0 auto;padding:0 24px 40px;font-size:12px}.report-footer p{margin:8px 0 0}.report-footer.hidden{display:none}.column-headers-section{align-items:center;max-width:1376px;margin:0 auto;padding:8px 0 8px 14px;display:flex}.package-header-wrapper{flex-direction:row;flex:1;justify-content:space-between;gap:2px;min-width:0;padding-right:1rem;display:flex}.results-summary{color:var(--text-secondary);white-space:nowrap;font-size:12px}.results-summary strong{color:var(--text-primary)}.package-header{align-self:flex-start;padding:4px 8px 4px 0}#column-headers-container{flex-shrink:0;width:60%;margin-left:auto}.column-headers{grid-template-columns:repeat(5,1fr);width:100%;display:grid}.column-header{color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px;cursor:pointer;border:none;border-left:1px solid var(--border-color);transition:color var(--transition);white-space:nowrap;background:0 0;align-items:center;gap:4px;padding:4px 8px 4px 10px;font-size:10px;font-weight:500;line-height:1.1;display:flex;overflow:hidden}.column-header-no-border{border-left:none}.column-header:hover{color:var(--text-primary)}.column-header.sorted{color:var(--accent)}.column-header-label{text-overflow:ellipsis;flex-shrink:1;overflow:hidden}.sort-indicator{opacity:.8;font-size:9px}.column-header:not(.sorted) .sort-indicator{visibility:hidden}.dependency-grid{flex-direction:column;gap:6px;display:flex}.dep-card{background:var(--bg-card);border:1px solid var(--border-color);border-radius:var(--radius-sm);transition:border-color var(--transition);overflow:hidden}.dep-card:hover{border-color:var(--border-color-strong)}.dep-card[data-risk=red]{border-left:3px solid var(--red)}.dep-card[data-risk=amber]{border-left:3px solid var(--amber)}.dep-card[data-risk=green]{border-left:3px solid var(--green)}.dep-summary{cursor:pointer;transition:background var(--transition);align-items:stretch;gap:10px;padding:0 0 0 12px;list-style:none;display:flex}.dep-summary:hover{background:var(--bg-card-hover)}.dep-summary::-webkit-details-marker{display:none}.expand-icon{width:16px;height:16px;color:var(--text-muted);transition:transform var(--transition);background:currentColor;flex-shrink:0;align-self:center;display:inline-block;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") 50%/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") 50%/contain no-repeat}details[open]>summary .expand-icon{transform:rotate(90deg)}.dep-name{font-family:var(--font-mono);color:var(--text-primary);align-self:center;padding:8px 0;font-size:14px;font-weight:600}.dep-version{color:var(--text-secondary);font-weight:400}.dep-indicators{flex-shrink:0;grid-template-columns:repeat(5,1fr);align-self:stretch;width:60%;margin-left:auto;display:grid}.badge-card{background:var(--bg-primary);border-left:1px solid var(--border-color);flex-direction:column;justify-content:center;min-height:38px;padding:4px 8px 4px 10px;display:flex;position:relative;overflow:hidden}.badge-card:before{content:"";background:var(--gray);width:3px;position:absolute;top:0;bottom:0;left:0}.badge-card.green:before{background:var(--green)}.badge-card.amber:before{background:var(--amber)}.badge-card.red:before{background:var(--red)}.badge-card.gray:before{background:var(--gray)}.badge-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px;clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%);width:1px;height:1px;margin:-1px;padding:0;font-size:8px;font-weight:500;line-height:1.1;position:absolute;overflow:hidden}.badge-value{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;font-weight:500;line-height:1.2;overflow:hidden}.dep-details{border-top:1px solid var(--border-color);flex-direction:column;gap:16px;padding:16px 20px 20px;animation:.2s ease-out slideDown;display:flex}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.dep-description{color:var(--text-secondary);margin:4px 0;padding-left:6px;font-size:13px;line-height:1.5}.dep-description span{color:var(--text-primary)}.package-links{flex-wrap:wrap;gap:8px;margin:0;padding:0;display:flex}.package-link{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:var(--radius);color:var(--text-primary);transition:all var(--transition);align-items:center;gap:6px;padding:7px 14px;font-size:13px;font-weight:500;text-decoration:none;display:inline-flex}.package-link:hover{background:var(--accent);border-color:var(--accent);color:#fff}.package-link svg{flex-shrink:0;width:14px;height:14px}.section{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:var(--radius-lg);margin:0;padding:16px}.section:first-child{margin-top:0}.section-header{border-bottom:1px solid var(--border-color);align-items:center;gap:10px;margin-bottom:14px;padding-bottom:10px;display:flex}.section-header.compact{margin-bottom:10px;padding-bottom:8px}.section-title{color:var(--accent);text-transform:uppercase;letter-spacing:.6px;font-size:12px;font-weight:700}.section-desc{color:var(--text-muted);font-size:11px}.status-chip-strip{flex-wrap:wrap;gap:6px;margin:0;display:flex}.status-chip{border:1px solid var(--border-color);background:var(--bg-primary);color:var(--text-secondary);letter-spacing:.1px;border-radius:999px;align-items:center;padding:5px 10px;font-size:11px;font-weight:600;line-height:1.2;display:inline-flex}.status-chip.green{color:var(--green);background:var(--green-bg);border-color:#10b9814d}.status-chip.amber{color:var(--amber);background:var(--amber-bg);border-color:#f59e0b66}.status-chip.red{color:var(--red);background:var(--red-bg);border-color:#ef444466}.key-points{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:var(--radius-lg);margin:0;padding:14px 16px}.key-points .section-header{border-bottom:none;margin-bottom:8px;padding-bottom:0}.key-points-list{color:var(--text-primary);gap:5px;margin:0;padding-left:20px;font-size:13px;line-height:1.5;display:grid}.key-points-list li{color:var(--text-secondary)}.key-points-list li::marker{color:var(--accent)}.definition-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:2px;display:grid}.kv-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:2px;display:grid}.kv-grid-tight{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:2px;display:grid}.kv-item{background:var(--bg-card);border-radius:var(--radius-sm);flex-direction:column;gap:3px;padding:8px 10px;display:flex}.kv-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.3px;font-size:10px;font-weight:600}.kv-value{color:var(--text-primary);overflow-wrap:anywhere;font-size:13px;line-height:1.4}.kv-inline-link{color:var(--accent);white-space:nowrap;text-underline-offset:2px;align-items:center;gap:3px;margin-left:6px;font-size:11px;text-decoration:none;display:inline-flex}.kv-inline-link:hover{text-decoration:underline}.kv-inline-link-icon{flex-shrink:0;width:11px;height:11px}.kv-inline-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}.risk-value{align-items:center;gap:6px;display:inline-flex}.risk-dot{background:var(--gray);border-radius:999px;flex-shrink:0;width:8px;height:8px}.risk-dot.green{background:var(--green)}.risk-dot.amber{background:var(--amber)}.risk-dot.red{background:var(--red)}.kv-hint{color:var(--text-muted);font-size:10px;font-style:italic}.micro-summary{gap:6px;padding:6px 0 2px;display:grid}.micro-line{color:var(--text-primary);font-size:13px}.micro-sublist{background:var(--bg-card);border-radius:var(--radius-sm);margin-top:10px;padding:10px}.micro-subtitle{color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px;font-size:10px;font-weight:600}.section-block{margin-top:12px}.block-title{color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px;font-size:10px;font-weight:600}.section-note{color:var(--text-muted);background:var(--bg-card);border-radius:var(--radius-sm);border-left:2px solid var(--border-color-strong);margin:0 0 10px;padding:8px 10px;font-size:11px;line-height:1.5}.subsection{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:var(--radius);margin-top:10px;padding:12px}.subsection:first-child{border-top:1px solid var(--border-color);margin-top:0;padding-top:12px}.subsection-header{align-items:baseline;gap:8px;margin-bottom:10px;display:flex}.subsection-title{color:var(--text-primary);text-transform:uppercase;letter-spacing:.4px;font-size:11px;font-weight:700}.subsection-desc{color:var(--text-muted);font-size:11px}.subsection.warning{background:#ef44440a;border-color:#ef444440}.subsection.warning .subsection-title{color:var(--red)}.detail-list{background:var(--bg-card);border-radius:var(--radius-sm);margin-top:10px;padding:10px}.detail-title{color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px;font-size:10px;font-weight:600}.detail-items{gap:4px;margin:0;padding:0;list-style:none;display:grid}.detail-items.mono .detail-item{font-family:var(--font-mono)}.detail-item{color:var(--text-secondary);overflow-wrap:anywhere;border-bottom:1px solid var(--border-color);padding:4px 0;font-size:12px;line-height:1.4}.detail-item:last-child{border-bottom:none}.detail-item.muted{color:var(--text-muted)}.declared-deps{gap:6px;display:grid}.declared-summary{color:var(--text-muted);margin:0 0 6px;font-size:11px;line-height:1.5}.declared-group{border:1px solid var(--border-color);border-radius:var(--radius);background:var(--bg-card);transition:border-color var(--transition);padding:10px 12px}.declared-group[open]{border-color:var(--border-color-strong)}.declared-group-summary{color:var(--text-primary);cursor:pointer;transition:color var(--transition);align-items:center;gap:8px;padding:2px 0;font-size:12px;font-weight:600;list-style:none;display:flex}.declared-group-summary:hover{color:var(--accent)}.declared-group-summary::-webkit-details-marker{display:none}.declared-count{color:var(--text-muted);background:var(--bg-primary);border:1px solid var(--border-color);border-radius:999px;padding:1px 6px;font-size:10px;font-weight:600}.declared-group-title{align-items:baseline;gap:6px;display:inline-flex}.declared-table{gap:4px;margin-top:10px;display:grid}.declared-row{border:1px solid var(--border-color);border-radius:var(--radius-sm);background:var(--bg-primary);transition:border-color var(--transition);grid-template-columns:minmax(160px,1.3fr) minmax(120px,1fr) auto;align-items:center;gap:10px;padding:6px 10px;display:grid}.declared-row:hover{border-color:var(--border-color-strong)}.declared-name{font-size:11px;font-family:var(--font-mono);color:var(--text-primary);overflow-wrap:anywhere;align-items:center;gap:6px;display:flex}.declared-range{color:var(--text-secondary);font-size:11px;font-family:var(--font-mono);overflow-wrap:anywhere}.status-pill{letter-spacing:.2px;border:1px solid #0000;border-radius:999px;justify-content:center;align-items:center;padding:2px 8px;font-size:10px;font-weight:600;text-decoration:none;display:inline-flex}.status-pill.installed{color:var(--green);background:var(--green-bg);border-color:#10b98159}.status-pill.missing{color:var(--text-muted);border-color:var(--border-color);background:var(--gray-bg)}.bullet-list{color:var(--text-secondary);margin:6px 0 0;padding-left:18px;font-size:13px;line-height:1.5}.bullet-list li{margin-bottom:4px}.bullet-list li::marker{color:var(--accent)}.subtle-divider{display:none}.status-row{color:var(--text-secondary);padding:4px 0;font-size:13px}.package-list{flex-wrap:wrap;gap:4px;margin-top:4px;display:flex}.package-tag{background:var(--bg-primary);border:1px solid var(--border-color);font-size:11px;font-family:var(--font-mono);color:var(--text-secondary);border-radius:4px;padding:3px 8px}.package-list-toggle{color:var(--accent);cursor:pointer;background:0 0;border:none;padding:2px 4px;font-size:11px}.package-list-toggle:hover{text-decoration:underline}.vuln-table{border-collapse:separate;border-spacing:0;border:1px solid var(--border-color);border-radius:var(--radius);width:100%;margin-top:10px;font-size:12px;overflow:hidden}.vuln-table th,.vuln-table td{text-align:left;border-bottom:1px solid var(--border-color);vertical-align:top;overflow-wrap:anywhere;padding:8px 12px}.vuln-table thead{background:var(--bg-primary)}.vuln-table th{color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;font-size:10px;font-weight:600}.vuln-table tbody tr{transition:background var(--transition)}.vuln-table tbody tr:last-child td{border-bottom:none}.vuln-table tr[data-severity=critical],.vuln-table tr[data-severity=high]{background:var(--red-bg)}.vuln-table tr[data-severity=moderate]{background:var(--amber-bg)}.vuln-table a{color:var(--accent);text-decoration:none}.vuln-table a:hover{text-decoration:underline}.no-vulns{color:var(--text-secondary);padding:6px 0;font-size:12px}.raw-data-toggle{margin:0}.raw-data-toggle summary{color:var(--text-muted);cursor:pointer;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:var(--radius);transition:all var(--transition);align-items:center;gap:8px;padding:10px 14px;font-size:11px;list-style:none;display:flex}.raw-data-toggle summary:hover{border-color:var(--border-color-strong);color:var(--text-secondary)}.raw-data-toggle[open] summary{border-radius:var(--radius) var(--radius) 0 0;border-bottom-color:#0000}.raw-data-toggle summary::-webkit-details-marker{display:none}.raw-data-pane{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:0 0 var(--radius) var(--radius);flex-direction:column;max-height:300px;margin-top:-1px;display:flex;position:relative;overflow:auto}.raw-data-pane pre{font-family:var(--font-mono);color:var(--text-secondary);white-space:pre;background:0 0;border:none;margin:0;padding:12px 12px 44px;font-size:11px;line-height:1.5;overflow:visible}.copy-json-btn{border:1px solid var(--border-color);border-radius:var(--radius-sm);background:var(--bg-card);color:var(--text-primary);cursor:pointer;transition:all var(--transition);align-self:flex-end;margin:0 8px 8px;padding:6px 12px;font-size:11px;position:sticky;bottom:8px}.raw-data-toggle:not([open]) .copy-json-btn{display:none}.copy-json-btn:hover{border-color:var(--accent);color:var(--accent)}.copy-json-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.copy-json-btn.copied{border-color:var(--green);color:var(--green)}.dep-loading{padding:2rem 0}.dep-loading-bar{background:var(--border-color);border-radius:999px;height:.25rem;position:relative;overflow:hidden}.dep-loading-bar:after{content:"";background:var(--accent);width:40%;height:100%;animation:1.2s ease-in-out infinite dep-loading;position:absolute;top:0;left:-40%}@keyframes dep-loading{0%{transform:translate(0)}to{transform:translate(250%)}}.package-tag-link{color:var(--text-secondary);transition:all var(--transition);text-decoration:none}.package-tag-link:hover{border-color:var(--accent);color:var(--accent)}.package-tag-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.empty-state{text-align:center;color:var(--text-muted);padding:48px 24px}.empty-state-icon{margin-bottom:12px;font-size:48px}.empty-state-text{font-size:16px}@media (width<=1180px) and (width>=769px){.header-row{flex-direction:column}.cta-section{flex:none;width:100%;min-width:0;max-width:none}.cta-card{width:100%;max-width:none}.filter-top-row{max-width:none}.graph-overlay-top{padding:8px 12px}}@media (width<=768px){.top-header{padding:20px 16px}.header-row{flex-direction:column;align-items:flex-start;gap:16px}.header-content{gap:12px}.logo,.logo-wrapper{width:48px;height:48px}.header-text h1{font-size:22px}.header-meta{gap:6px}.meta-item{padding:3px 8px;font-size:11px}.cta-section{text-align:left;flex:none;width:100%;min-width:0;max-width:none}.cta-card{border-radius:14px;grid-template-columns:auto minmax(0,1fr);gap:14px;width:100%;min-height:0;padding:14px}.cta-icon{width:56px;height:56px}.cta-icon-svg{width:42px;height:42px;display:block}.cta-title{font-size:18px}.cta-text{font-size:13px}.cta-action{grid-column:1/-1;grid-template-columns:minmax(0,1fr)}.cta-button{font-size:14px}.cta-privacy{justify-content:flex-start;font-size:12px}.filter-bar{padding:10px 16px}.filter-row{display:block}.filter-top-row{flex-wrap:wrap;flex:auto;align-items:center;gap:10px;min-width:0;display:flex}.search-wrapper{flex:100%;max-width:none}.filter-top-row .search-wrapper{flex-basis:100%;min-width:0}.view-switch{order:3}.view-switch-btn{padding:6px 10px}.filters-toggle{flex-shrink:0;order:2}.filter-controls,.metadata-panel{opacity:0;pointer-events:none;width:100%;max-height:0;box-shadow:none;margin-top:0;padding:0 12px;transition:max-height .3s ease-out,opacity .25s ease-out,transform .25s ease-out,margin-top .25s ease-out;position:static;overflow:hidden;transform:translateY(-8px)}.filter-controls.open,.metadata-panel.open{opacity:1;pointer-events:auto;max-height:900px;margin-top:8px;padding:12px;transform:translateY(0)}.filter-controls-row{gap:10px;display:grid}.filter-group{display:grid}.filter-group select{max-width:none}.mobile-only,.sort-wrapper.mobile-only{display:flex!important}.theme-toggle{order:4;margin-left:auto}.license-filter-toggle,#column-headers-container,.column-headers,.package-header{display:none}.column-headers-section{opacity:0;pointer-events:none;max-height:0;margin-top:0;padding:0 16px;transition:max-height .3s ease-out,opacity .25s ease-out,transform .25s ease-out,margin-top .25s ease-out,padding .25s ease-out;overflow:hidden;transform:translateY(-6px)}.filter-controls.open+.license-filter-panel-row+.column-headers-section{opacity:1;pointer-events:auto;max-height:120px;margin-top:8px;padding:8px 16px;transform:translateY(0)}.package-header-wrapper{flex-direction:row}.main-content{padding:12px 16px 32px}.graph-workspace-select{min-width:170px}.graph-overlay{padding:6px}.graph-canvas-shell{height:62vh;min-height:340px}.graph-key{gap:8px;padding:6px 8px}.graph-key-items{gap:8px}.graph-key-item{font-size:11px}.graph-back-btn{top:8px;left:8px}.graph-mode .main-content{padding:8px}.graph-mode .graph-canvas-shell{height:calc(100dvh - 16px);min-height:420px}.graph-controls{top:calc(var(--graph-toolbar-height,50px) + 8px)}.report-footer{padding:0 16px 32px}.vuln-table thead{display:none}.vuln-table tr{border-bottom:1px solid var(--border-color);display:block}.vuln-table td{justify-content:space-between;gap:12px;padding:6px 8px;display:flex}.vuln-table td:before{content:attr(data-label);text-transform:uppercase;letter-spacing:.4px;color:var(--text-muted);min-width:120px;font-size:10px}.dep-summary{flex-wrap:wrap;align-items:center;padding:8px 12px}.dep-name{font-size:13px}.dep-indicators{border-top:1px solid var(--border-color);flex-wrap:wrap;gap:4px;width:100%;min-width:auto;margin-top:6px;margin-left:0;padding-top:6px;display:flex}.badge-card{flex:calc(50% - 4px);min-width:0}.badge-value{font-size:10px}.badge-label{clip:none;clip-path:none;width:auto;height:auto;margin:0;padding:0;font-size:7px;position:relative;overflow:auto}.declared-row{grid-template-columns:1fr;gap:6px}.graph-overlay-top{padding:8px 12px}}@media (width<=480px){.header-text h1{font-size:20px}.meta-item{padding:2px 6px;font-size:10px}.cta-card{text-align:left;grid-template-columns:1fr}.cta-icon{display:none}.cta-action{grid-column:auto}.badge-card{flex:100%}}
12
+ /*\$vite\$:1*/`;
13
13
  /**
14
14
  * JavaScript content for the dependency radar HTML report
15
15
  * Built from report-ui/main.ts
16
16
  */
17
- exports.JS_CONTENT = `!function(){"use strict";function e(e){if(!e.workspaces.enabled)return[];const t=new Set;return(e.workspaces.workspacePackages||[]).forEach(e=>{e.name&&t.add(e.name)}),Object.values(e.dependencies||{}).forEach(e=>{(e.usage.origins.workspaces||[]).forEach(e=>{e&&t.add(e)})}),Array.from(t).sort((e,t)=>"root"===e?-1:"root"===t?1:e.localeCompare(t))}const t=2.8,n='500 11.5px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';function a(e,t,n){return Math.min(n,Math.max(t,e))}function r(e,t=!1){return t?e.length:Math.min(e.length,34)}function s(e){const t=r(e);return e.length<=34?t:Math.max(1,t-6)}function i(e){const{labelGraphemes:t}=e;if(t.length<=34)return e.ref.name;const n=a(Math.round(e.renderLabelChars),1,t.length);return n>=t.length?e.ref.name:\`\${t.slice(0,n-1).join("")}…\`}function o(e,t,n){const r=function(e){const t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})\$/i);if(n){const e=n[1];return 3===e.length?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)}:{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}}const r=t.match(/^rgba?\\(([^)]+)\\)\$/i);if(!r)return null;const s=r[1].replace(/\\//g," ").split(/[\\s,]+/).filter(Boolean).slice(0,3);if(3!==s.length)return null;const i=e=>{if(e.endsWith("%")){const t=Number(e.slice(0,-1));return Number.isFinite(t)?a(Math.round(t/100*255),0,255):null}const t=Number(e);return Number.isFinite(t)?a(Math.round(t),0,255):null},o=i(s[0]),c=i(s[1]),l=i(s[2]);return null===o||null===c||null===l?null:{r:o,g:c,b:l}}(e);if(!r)return n;const s=a(t,0,1);return\`rgb(\${Math.round(r.r+(255-r.r)*s)}, \${Math.round(r.g+(255-r.g)*s)}, \${Math.round(r.b+(255-r.b)*s)})\`}function c(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function l(e,t,n){if(0===t.length)return;if(e.moveTo(t[0].x,t[0].y),1===t.length)return;if(2===t.length)return void e.lineTo(t[1].x,t[1].y);for(let r=1;r<t.length-1;r+=1){const a=t[r-1],s=t[r],i=t[r+1],o=s.x-a.x,c=s.y-a.y,l=i.x-s.x,d=i.y-s.y,u=Math.hypot(o,c),p=Math.hypot(l,d);if(u<.001||p<.001){e.lineTo(s.x,s.y);continue}const h=Math.min(n,.45*u,.45*p),g=s.x-o/u*h,m=s.y-c/u*h,v=s.x+l/p*h,f=s.y+d/p*h;e.lineTo(g,m),e.quadraticCurveTo(s.x,s.y,v,f)}const a=t[t.length-1];e.lineTo(a.x,a.y)}function d(e,t,n,r){const s=t.renderX,i=t.renderY,o=n.renderX,c=n.renderY,d=n.depth-t.depth,u=Math.abs(d);if(0===u){const n=Math.abs(s-o)<r.sameColumnXThreshold,d=Math.abs(i-c),u=t.depth<r.maxDepth;if(n&&d>r.minDetourVerticalSpan&&u){const n=r.paddingX+t.depth*r.layerGap,u=r.paddingX+(t.depth+1)*r.layerGap,p=.5*(n+u);let h=p+r.detourInset;const g=Math.min(i,c)-12,m=Math.max(i,c)+12;(function(e,t,n,a,r){const s=e.depthNodeIndex.get(t);if(!s||0===s.length)return!1;const i=function(e,t){let n=0,a=e.length;for(;n<a;){const r=n+(a-n>>1);e[r].renderY<t?n=r+1:a=r}return n}(s,n);for(let o=i;o<s.length&&s[o].renderY<=a;o+=1)if(Math.abs(s[o].renderX-r)<e.detourNodeClearance)return!0;return!1})(r,t.depth+1,g,m,h)&&(h+=12);h=a(h,p+8,u-24);const v=Math.max(1,h-s);return void l(e,[{x:s,y:i},{x:h,y:i},{x:h,y:c},{x:o,y:c}],a(.42*Math.min(v,d),16,52))}e.moveTo(s,i);const p=s+.5*(o-s),h=i+(c-i)*r.edgeCurve;return void e.quadraticCurveTo(p,h,o,c)}if(1===u){const a=Math.min(t.depth,n.depth),l=r.paddingX+a*r.layerGap+.5*r.layerGap;return e.moveTo(s,i),void e.bezierCurveTo(l,i,l,c,o,c)}const p=Math.sign(d),h=c-i,g=[{x:s,y:i}],m=r.paddingX+t.depth*r.layerGap+p*(.5*r.layerGap);g.push({x:m,y:i});for(let a=1;a<u;a+=1){const e=t.depth+p*a,n=r.paddingX+e*r.layerGap+p*(.5*r.layerGap),s=a/u;g.push({x:n,y:i+h*s})}const v=r.paddingX+n.depth*r.layerGap-p*(.5*r.layerGap);g.push({x:v,y:c}),g.push({x:o,y:c}),l(e,g,14)}function u(e,t,n,r){r&&t.highlighted?function(e,t,n){const r=t.renderX,s=t.renderY,i=n.renderX,o=n.renderY,c=i-r,l=o-s;if(e.moveTo(r,s),Math.abs(c)<18){const t=r+(s<=o?26:-26);return void e.bezierCurveTo(t,s,t,o,i,o)}const d=a(.44*Math.abs(c),42,150),u=Math.sign(c),p=a(.12*Math.abs(l),0,24);e.bezierCurveTo(r+u*d,s+p*Math.sign(l),i-u*d,o-p*Math.sign(l),i,o)}(e,t.from,t.to):d(e,t.from,t.to,n)}function p(e,t){return\`\${e}@\${t}\`}function h(e,t){return\`\${e}->\${t}\`}function g(e){if(!e||"object"!=typeof e)return!1;const t=e;if(!Array.isArray(t.workspaces))return!1;if(!t.dependencies||"object"!=typeof t.dependencies)return!1;const n=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e);if(!t.workspaces.every(e=>(e=>{if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.name&&!!Array.isArray(t.directDependencies)&&!!Array.isArray(t.directDevDependencies)})(e)))return!1;if(!t.workspaces.every(e=>n(e.directDependencies)&&n(e.directDevDependencies)))return!1;return!!Object.entries(t.dependencies).every(([,e])=>{if(!e||"object"!=typeof e)return!1;const t=e;return!(void 0!==t.dependencies&&!Array.isArray(t.dependencies))&&!(void 0!==t.workspaceOrigins&&!Array.isArray(t.workspaceOrigins))})}function m(e){const t=e.compliance.license.declared?.valid?e.compliance.license.declared.spdxId:void 0;return t||(e.compliance.license.inferred?.spdxId||"Unknown")}function v(e){const t=e.security?.summary;return t?Number(t.critical||0)+Number(t.high||0)+Number(t.moderate||0)+Number(t.low||0):0}function f(e){const t=e.security?.summary?.highest;return"critical"===t||"high"===t?"high":"moderate"===t?"moderate":"none"}function y(e,t){const n=new Set,a=[t];for(;a.length>0;){const t=a.pop();if(!t)continue;const r=e.nodes.get(t);r&&r.parents.forEach(e=>{n.has(e)||(n.add(e),a.push(e))})}return n}function k(e,t){const n=new Set,a=[t];for(;a.length>0;){const t=a.pop();if(!t)continue;const r=e.nodes.get(t);r&&r.children.forEach(e=>{n.has(e)||(n.add(e),a.push(e))})}return n}function b(e,t,n){const a=new Map,r=[{slug:t,distance:0}];let s=0;for(;s<r.length;){const t=r[s++],i=e.nodes.get(t.slug);i&&i[n].forEach(e=>{a.has(e)||(a.set(e,t.distance+1),r.push({slug:e,distance:t.distance+1}))})}return a}function w(e){const l=function(e,t,n){const a=window.__DEPENDENCY_DATA__;if(g(a)){const e={};return Object.entries(a.dependencies).forEach(([t,n])=>{const a=n,r=a.vulnerabilitySeverity||a.vulnerabilityHighest||a.highestSeverity||"none",s=String(r).trim().toLowerCase();let i="none";"critical"===s||"high"===s?i="high":"moderate"!==s&&"medium"!==s||(i="moderate"),e[t]={slug:String(a.slug||t),name:String(a.name||t),version:String(a.version||""),dependencies:Array.isArray(a.dependencies)?a.dependencies.map(e=>String(e)):[],license:String(a.license||"Unknown"),vulnerabilityCount:Number(a.vulnerabilityCount||0),vulnerabilitySeverity:i,isDevOnly:Boolean(a.isDevOnly),workspaceOrigins:Array.isArray(a.workspaceOrigins)?a.workspaceOrigins.map(e=>String(e)):[]}}),{workspaces:a.workspaces,dependencies:e}}const r={},s=Object.values(e.dependencies||{});s.forEach(e=>{const t=p(e.package.name,e.package.version);r[t]={slug:t,name:e.package.name,version:e.package.version,dependencies:[],license:m(e),vulnerabilityCount:v(e),vulnerabilitySeverity:f(e),isDevOnly:"dev"===e.usage.scope,workspaceOrigins:e.usage.origins.workspaces||[]}}),s.forEach(e=>{const a=p(e.package.name,e.package.version),s=e.graph.subDeps;if(!s)return;const i=new Set;["dep","dev","opt","peer"].forEach(e=>{const o=s[e];o&&Object.values(o).forEach(e=>{const s=e[1];if(!s)return;const o=n(s);o&&t.has(o)&&r[o]&&o!==a&&i.add(o)})}),r[a].dependencies=[...i]});const i=new Map,o=e=>{const t=i.get(e);if(t)return t;const n={directDependencies:new Set,directDevDependencies:new Set};return i.set(e,n),n};return o("root"),(e.workspaces.workspacePackages||[]).forEach(e=>{o(e.name)}),s.forEach(e=>{if(!e.usage.direct)return;const t=p(e.package.name,e.package.version);(e.usage.origins.workspaces?.length?e.usage.origins.workspaces:["root"]).forEach(n=>{const a=o(n);"dev"===e.usage.scope?a.directDevDependencies.add(t):a.directDependencies.add(t)})}),{workspaces:[...i.entries()].map(([e,t])=>({name:e,directDependencies:[...t.directDependencies],directDevDependencies:[...t.directDevDependencies]})).sort((e,t)=>e.name.localeCompare(t.name)),dependencies:r}}(e.report,e.knownDepKeys,e.resolveDepKey),d=new Map(l.workspaces.map(e=>[e.name,e])),w=new Map,E=new Map;Object.values(l.dependencies).forEach(e=>{const t=(e.dependencies||[]).filter(t=>t!==e.slug&&Boolean(l.dependencies[t]));E.set(e.slug,t),t.forEach(t=>{const n=w.get(t)||[];n.push(e.slug),w.set(t,n)})});let C=null,x="",S=null,L=null,I=new Set,M=new Set,Y=new Set,P=new Map,X=null,B=null,D=new Set,A=new Set,N=null,T=1,j=0,R=0,V=1,H=.1,O=0,F=0,W=null,G=null,\$=!1,U=!0,_=0,q=Math.max(1,Math.floor(window.devicePixelRatio||1)),z=1,K=1;const J={down:!1,moved:!1,startX:0,startY:0,startPanX:0,startPanY:0},Z={active:!1,startX1:0,startY1:0,startX2:0,startY2:0,startPanX:0,startPanY:0,startDist:0,startZoom:0,anchorX:null,anchorY:null},Q={active:!1,velocityX:0,velocityY:0,lastSampleX:0,lastSampleY:0,lastSampleTime:0,lastFrameTime:0},ee=e.canvas.getContext("2d"),te=Boolean(ee);let ne=!1,ae=!1,re=!1,se=null,ie=null,oe=null,ce=!1;const le="function"==typeof window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null;let de={runtime:"#10b981",runtimeHighlight:"#34d399",dev:"#f59e0b",devHighlight:"#fcd34d",transitive:"#06b6d4",transitiveHighlight:"#67e8f9",edge:"#64748b",highlight:"#22d3ee",muted:"#64748b",ringHigh:"#ef4444",ringModerate:"#f59e0b",label:"#e8edf5",backgroundPrimary:"#0c1222"};function ue(){const e=c("--graph-direct-runtime")||"#10b981",t=c("--graph-direct-dev")||"#f59e0b",n=c("--graph-transitive")||"#06b6d4";de={runtime:e,runtimeHighlight:o(e,.2,"#34d399"),dev:t,devHighlight:o(t,.28,"#fcd34d"),transitive:n,transitiveHighlight:o(n,.38,"#67e8f9"),edge:c("--graph-edge")||"#64748b",highlight:c("--graph-highlight")||"#22d3ee",muted:c("--graph-muted")||"#64748b",ringHigh:c("--graph-vuln-high")||"#ef4444",ringModerate:c("--graph-vuln-medium")||"#f59e0b",label:c("--text-primary")||"#e8edf5",backgroundPrimary:c("--bg-primary")||"#0c1222"}}function pe(){if(ce)return;ce=!0,console.warn("Dependency Radar: unable to initialize 2D canvas; graph rendering disabled."),e.controlsRoot.classList.add("hidden"),e.workspaceWrap.classList.add("hidden"),e.canvas.style.display="none";const t=document.createElement("div");t.className="empty-state";const n=document.createElement("div");n.className="empty-state-text",n.textContent="Graph view is unavailable in this browser context.",t.appendChild(n),e.canvasHost.appendChild(t)}function he(e){return(e-j)/T}function ge(e){return(e-R)/T}function me(e,t){if(!C)return{x:e,y:t};const n=C.bounds.minX-120,r=C.bounds.maxX+120,s=C.bounds.minY-90,i=C.bounds.maxY+90,o=Math.min(.22*z,220),c=Math.min(.22*K,180),l=o-r*T,d=z-o-n*T,u=c-i*T,p=K-c-s*T;return{x:l>d? .5*(l+d):a(e,l,d),y:u>p? .5*(u+p):a(t,u,p)}}function ve(e,t){const n=me(e,t);j=n.x,R=n.y}function fe(){W=null,G=null}function ye(e,n,r){we(),fe();const s=a(e,H,t),i=he(n),o=ge(r);T=s,ve(n-i*T,r-o*T),U=!0,_e()}function ke(e,t){we(),fe(),ve(j+e,R+t),U=!0,_e()}function be(){return!le?.matches}function we(){Q.active=!1,Q.velocityX=0,Q.velocityY=0,Q.lastFrameTime=0}function Ee(e,t,n){Q.lastSampleX=e,Q.lastSampleY=t,Q.lastSampleTime=n}function Ce(e,t,n){const a=n-Q.lastSampleTime;if(a<=0)return void Ee(e,t,n);const r=(e-Q.lastSampleX)/a,s=(t-Q.lastSampleY)/a;Q.velocityX+=.22*(r-Q.velocityX),Q.velocityY+=.22*(s-Q.velocityY),Ee(e,t,n)}function xe(){if(!be())return void we();Math.hypot(Q.velocityX,Q.velocityY)<.08?we():(Q.active=!0,Q.lastFrameTime=performance.now(),je(!1),_e())}function Se(){const t=e.canvasHost.getBoundingClientRect();z=Math.max(1,Math.floor(t.width)),K=Math.max(1,Math.floor(t.height)),q=Math.max(1,Math.floor(window.devicePixelRatio||1)),e.canvas.width=z*q,e.canvas.height=K*q,e.canvas.style.width=\`\${z}px\`,e.canvas.style.height=\`\${K}px\`;const n=e.canvasHost.querySelector(".graph-overlay-top"),a=n?Math.ceil(n.getBoundingClientRect().height):50;e.canvasHost.style.setProperty("--graph-toolbar-height",\`\${a}px\`),U=!0,_e()}function Le(){if(!C)return;const e=C.bounds;let r=e.maxX;ee&&(ee.save(),ee.font=n,C.nodes.forEach(e=>{const t=i(e);if(!t)return;const n=ee.measureText(t).width;r=Math.max(r,e.baseX+e.radius+6+n)}),ee.restore());const s=Math.max(1,e.maxY-e.minY),o=z/Math.max(1,r-e.minX),c=K/s;V=a(Math.min(o,c),.05,t),H=a(.64*V,.05,t),O=.5*(z-Math.max(1,r-e.minX)*V)-e.minX*V,F=.5*(K-s*V)-e.minY*V}function Ie(t,n){if(!C)return null;const a=e.canvas.getBoundingClientRect();if(t<a.left||t>a.right||n<a.top||n>a.bottom)return null;const r=he(t-a.left),s=ge(n-a.top);let i=null,o=1/0;return C.nodes.forEach(e=>{const t=r-e.renderX,n=s-e.renderY,a=Math.sqrt(t*t+n*n);a<=e.renderRadius+5&&a<o&&(o=a,i=e)}),i}function Me(t){e.canvas.classList.toggle("is-clickable",t&&!J.down&&!Z.active)}function Ye(t=!1){Me(!1),t&&e.canvas.classList.remove("is-panning")}function Pe(e,t){const n=Ie(e,t);return Ve(n?n.slug:null),Me(Boolean(n)),n}function Xe(e){const t=d.get(e);if(!t)return null;const n=new Set(t.directDependencies.filter(e=>Boolean(l.dependencies[e]))),a=new Set(t.directDevDependencies.filter(e=>Boolean(l.dependencies[e]))),i=new Set([...n,...a]);0===i.size&&Object.keys(l.dependencies).filter(e=>0===(w.get(e)||[]).length).slice(0,40).forEach(e=>{i.add(e)});const o=new Set,c=[...i];let u=0;for(;u<c.length;){const e=c[u++];e&&(o.has(e)||l.dependencies[e]&&(o.add(e),(E.get(e)||[]).forEach(e=>{o.has(e)||c.push(e)})))}if(0===o.size)return null;const p=new Map;o.forEach(e=>{const t=n.has(e)?"direct-runtime":a.has(e)?"direct-dev":"transitive",i=Array.from(l.dependencies[e].name);p.set(e,{slug:e,ref:l.dependencies[e],labelGraphemes:i,parents:new Set,children:new Set,depth:Number.POSITIVE_INFINITY,order:0,amplification:0,kind:t,baseX:0,baseY:0,targetX:0,targetY:0,renderX:0,renderY:0,radius:8,targetRadius:8,renderRadius:8,targetLabelChars:r(i),renderLabelChars:s(i)})}),p.forEach(e=>{(w.get(e.slug)||[]).forEach(t=>{p.has(t)&&e.parents.add(t)}),(E.get(e.slug)||[]).forEach(t=>{p.has(t)&&e.children.add(t)})});const h=[];for(i.forEach(e=>{const t=p.get(e);t&&(t.depth=0,h.push(e))});h.length>0;){const e=h.shift();if(!e)continue;const t=p.get(e);t&&t.children.forEach(e=>{const n=p.get(e);if(!n)return;const a=t.depth+1;a>=n.depth||(n.depth=a,h.push(e))})}p.forEach(e=>{if(Number.isFinite(e.depth))return;let t=Number.POSITIVE_INFINITY;e.parents.forEach(e=>{const n=p.get(e);n&&Number.isFinite(n.depth)&&(t=Math.min(t,n.depth+1))}),e.depth=Number.isFinite(t)?t:0});const g=[...p.values()].reduce((e,t)=>Math.max(e,t.depth),0),m=Array.from({length:g+1},()=>[]);p.forEach(e=>{m[e.depth].push(e.slug)});const v=[];p.forEach(e=>{e.children.forEach(t=>{v.push({from:e.slug,to:t,direct:0===e.depth})})});const f={workspaceName:e,nodes:p,edges:v,layers:m,directRuntime:n,directDev:a,directAll:new Set([...n,...a]),bounds:{minX:0,maxX:1,minY:0,maxY:1}};return Be(f),De(f),f}function Be(e){e.nodes.forEach(e=>{e.amplification=0}),e.nodes.forEach(t=>{if(0!==t.depth)return;if(!e.directAll.has(t.slug))return;const n=new Set,a=[...t.children];for(;a.length>0;){const r=a.pop();if(!r)continue;if(r===t.slug)continue;if(n.has(r))continue;n.add(r);const s=e.nodes.get(r);s&&s.children.forEach(e=>{n.has(e)||a.push(e)})}t.amplification=n.size})}function De(e){const t=new Map;e.layers.forEach((n,a)=>{0===a?n.sort((t,n)=>{const a=e.nodes.get(t),r=e.nodes.get(n);if(!a&&!r)return 0;if(!a)return 1;if(!r)return-1;if(a.amplification!==r.amplification)return r.amplification-a.amplification;if(a.kind!==r.kind){if("direct-runtime"===a.kind)return-1;if("direct-runtime"===r.kind)return 1}return a.ref.name.localeCompare(r.ref.name)}):n.sort((n,a)=>{const r=e.nodes.get(n),s=e.nodes.get(a);if(!r&&!s)return 0;if(!r)return 1;if(!s)return-1;const i=(()=>{let e=0,n=0;return r.parents.forEach(a=>{const r=t.get(a);"number"==typeof r&&(e+=1,n+=r)}),e>0?n/e:Number.MAX_SAFE_INTEGER})(),o=(()=>{let e=0,n=0;return s.parents.forEach(a=>{const r=t.get(a);"number"==typeof r&&(e+=1,n+=r)}),e>0?n/e:Number.MAX_SAFE_INTEGER})();return i!==o?i-o:r.ref.name.localeCompare(s.ref.name)}),n.forEach((e,n)=>{t.set(e,n)})});const n=e.layers.reduce((e,t)=>Math.max(e,t.length),1);e.bounds={minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY},e.layers.forEach((t,a)=>{const i=Math.max(0,43*(t.length-1)),o=64+.5*(43*n-i);t.forEach((t,n)=>{const i=e.nodes.get(t);if(!i)return;i.order=n,i.baseX=96+240*a,i.baseY=o+43*n,i.targetX=i.baseX,i.targetY=i.baseY,i.renderX=i.baseX,i.renderY=i.baseY;const c=.55*Math.log(i.children.size+i.parents.size+1),l=0===i.depth&&e.directAll.has(i.slug)?1.05*Math.log(i.amplification+1):0;i.radius=6.7+c+l,i.targetRadius=i.radius,i.renderRadius=i.radius,i.targetLabelChars=r(i.labelGraphemes),i.renderLabelChars=s(i.labelGraphemes),e.bounds.minX=Math.min(e.bounds.minX,i.baseX),e.bounds.maxX=Math.max(e.bounds.maxX,i.baseX),e.bounds.minY=Math.min(e.bounds.minY,i.baseY),e.bounds.maxY=Math.max(e.bounds.maxY,i.baseY)})}),Number.isFinite(e.bounds.minX)||(e.bounds={minX:0,maxX:1,minY:0,maxY:1})}function Ae(e,n){if(!C)return;const r=a(Math.max(T,1.35*V),H,t);T+=(r-T)*(le?.matches?1:.35),function(e,t){const n=me(e,t);W=n.x,G=n.y}(.46*z-e*T,.5*K-n*T)}function Ne(e){if(!C||!C.nodes.has(e))return;we(),S=e;const t=y(C,e),n=k(C,e);I=new Set([e]),t.forEach(e=>{I.add(e)}),n.forEach(e=>{I.add(e)}),M=new Set;const r=[e],s=new Set([e]);for(;r.length>0;){const e=r.pop();if(!e)continue;const t=C.nodes.get(e);t&&t.parents.forEach(t=>{M.add(h(t,e)),s.has(t)||(s.add(t),r.push(t))})}const i=[e],o=new Set([e]);for(;i.length>0;){const e=i.pop();if(!e)continue;const t=C.nodes.get(e);t&&t.children.forEach(t=>{M.add(h(e,t)),o.has(t)||(o.add(t),i.push(t))})}Y=new Set(I);const c=C.nodes.get(e);c.parents.forEach(e=>{Y.add(e)}),c.children.forEach(e=>{Y.add(e)});const l=null===X||null===B,d=!l&&Boolean(N)&&I.has(N);!l&&d||(X=c.renderX,B=c.renderY),P=function(e,t,n,r){const s=new Map,i=b(e,t,"parents"),o=b(e,t,"children"),c=new Map;return s.set(t,{x:n,y:r}),I.forEach(a=>{if(a===t)return;const r=e.nodes.get(a);if(!r)return;const s=i.get(a),l=o.get(a);let d=0;"number"==typeof s&&("number"!=typeof l||s<=l)?d=-s:"number"==typeof l&&(d=l),0===d&&(d=r.baseX<n?-1:1);const u=c.get(d)||[];u.push(r),c.set(d,u)}),c.forEach((e,t)=>{e.sort((e,n)=>{const a=t<0?i.get(e.slug)||0:o.get(e.slug)||0,r=t<0?i.get(n.slug)||0:o.get(n.slug)||0;return a!==r?a-r:e.baseY!==n.baseY?e.baseY-n.baseY:e.ref.name.localeCompare(n.ref.name)});const c=a(760/Math.max(1,e.length-1),34,54),l=r-(e.length-1)*c*.5;e.forEach((e,a)=>{const r=Math.abs(t),i=170*(1+.78*Math.max(0,r-1));s.set(e.slug,{x:n+Math.sign(t)*i,y:l+a*c})})}),s}(C,e,X??c.renderX,B??c.renderY),Ae(X??c.renderX,B??c.renderY),U=!0,_e()}function Te(){S=null,I=new Set,M=new Set,Y=new Set,P=new Map,X=null,B=null,fe(),U=!0,_e()}function je(e=!0){L=null,D=new Set,A=new Set,e&&(U=!0,_e())}function Re(){if(!C)return;const e=S&&C.nodes.get(S)||null;C.nodes.forEach(t=>{t.targetRadius=function(e){const t=S===e.slug,n=I.has(e.slug);let a=e.radius;t?a*=1.85:S&&n?a*=1.22:S&&!n?a*=.84:L&&D.has(e.slug)?a*=1.1:L&&(a*=.9);return a}(t),t.targetLabelChars=r(t.labelGraphemes,Boolean(S)&&I.has(t.slug)||!S&&Boolean(L)&&D.has(t.slug));const n=P.get(t.slug);if(e&&n)return t.targetX=n.x,void(t.targetY=n.y);if(!e||!Y.has(t.slug))return t.targetX=t.baseX,void(t.targetY=t.baseY);const a=t.baseX-e.baseX,s=t.baseY-e.baseY,i=1+120/(Math.sqrt(a*a+s*s)+1);t.targetX=e.baseX+a*i,t.targetY=e.baseY+s*i})}function Ve(e){if(S)return;if(L=e,D=new Set,A=new Set,!C||!e||!C.nodes.has(e))return U=!0,void _e();const t=y(C,e),n=k(C,e);D=new Set([e]),t.forEach(e=>{D.add(e)}),n.forEach(e=>{D.add(e)});const a=C.nodes.get(e);a&&(a.parents.forEach(e=>{D.add(e)}),a.children.forEach(e=>{D.add(e)})),C.edges.forEach(e=>{D.has(e.from)&&D.has(e.to)&&A.add(h(e.from,e.to))}),U=!0,_e()}function He(t){if(!C)return;const n=C.nodes.get(t);if(!n)return;const a=0===n.depth&&C.directAll.has(n.slug);N=t,e.popoverName.textContent=n.ref.name,e.popoverVersion.textContent=\`Version: \${n.ref.version}\`,e.popoverLicense.textContent=\`License: \${n.ref.license||"Unknown"}\`,e.popoverVulns.textContent=\`Vulnerabilities: \${n.ref.vulnerabilityCount||0}\`,e.popoverAmplification.textContent=a?\`Amplification: \${n.amplification}\`:\`Dependencies: \${n.children.size} • Dependents: \${n.parents.size}\`,e.popover.hidden=!1,Fe()}function Oe(){N=null,e.popover.hidden=!0}function Fe(){if(!C||!N||e.popover.hidden)return;const t=C.nodes.get(N);if(!t)return void Oe();const n=t.renderX*T+j,r=t.renderY*T+R,s=e.canvasHost.getBoundingClientRect(),i=e.popover.getBoundingClientRect(),o=Math.max(8,s.width-i.width-8),c=Math.max(8,s.height-i.height-8),l=a(n+14,8,o),d=a(r+14,8,c);e.popover.style.left=\`\${l}px\`,e.popover.style.top=\`\${d}px\`}function We(e){return S?I.has(e)?1:.14:L?D.has(e)?1:.16:.95}function Ge(){if(!ee)return;if(ee.setTransform(q,0,0,q,0,0),ee.clearRect(0,0,z,K),!C)return;const e=C,t=he(0)-80,r=he(z)+80,s=ge(0)-80,o=ge(K)+80;ee.setTransform(q*T,0,0,q*T,q*j,q*R);const c=de.runtime,l=de.dev,d=de.transitive,p=de.edge,g=de.highlight,m=de.muted,v=de.ringHigh,f=de.ringModerate,y=de.label,k=de.backgroundPrimary,b=new Set;e.nodes.forEach(e=>{const n=Math.max(e.radius,e.renderRadius);e.renderX+n>=t&&e.renderX-n<=r&&e.renderY+n>=s&&e.renderY-n<=o&&b.add(e.slug)});const w=[];let E=0;e.nodes.forEach(e=>{if(!b.has(e.slug))return;let t=0;S===e.slug?t=2:(I.has(e.slug)||D.has(e.slug))&&(t=1),w.push({node:e,priority:t,order:E++})}),w.sort((e,t)=>e.priority-t.priority||e.order-t.order);const x=Math.max(0,e.layers.length-1),Y=function(e){const t=new Map;return e.nodes.forEach(e=>{const n=t.get(e.depth);n?n.push(e):t.set(e.depth,[e])}),t.forEach(e=>{e.sort((e,t)=>e.renderY-t.renderY)}),t}(e),P={depthNodeIndex:Y,maxDepth:x,sameColumnXThreshold:6,minDetourVerticalSpan:80,detourInset:14,detourNodeClearance:26,paddingX:96,layerGap:240,edgeCurve:.2},X=[];e.edges.forEach(t=>{const n=e.nodes.get(t.from),a=e.nodes.get(t.to);if(!n||!a)return;if(!b.has(n.slug)&&!b.has(a.slug))return;const r=h(t.from,t.to);X.push({from:n,to:a,highlighted:M.has(r)||!S&&A.has(r),span:Math.abs(a.depth-n.depth)})}),X.sort((e,t)=>t.span-e.span),ee.globalCompositeOperation="source-over",ee.strokeStyle=S||L?m:p,ee.lineWidth=1.05,ee.globalAlpha=function(){if(S||L)return.04*a((T-.35)/.9,.75,1);return.25*a((T-.35)/.9,.2,1)}(),ee.beginPath(),X.forEach(e=>{e.highlighted||u(ee,e,P,Boolean(S))}),ee.stroke(),ee.globalCompositeOperation="lighter",ee.strokeStyle=g,ee.lineWidth=1.2,ee.globalAlpha=.36*a((T-.35)/.9,.2,1),ee.beginPath(),X.forEach(e=>{e.highlighted&&u(ee,e,P,Boolean(S))}),ee.stroke(),ee.globalCompositeOperation="source-over";const B=e=>{const t=S===e.slug,n=e.renderRadius;ee.globalAlpha=1,ee.fillStyle=k,ee.beginPath(),ee.arc(e.renderX,e.renderY,n,0,2*Math.PI),ee.fill(),ee.globalAlpha=We(e.slug);const a=ee.createRadialGradient(e.renderX-.3*n,e.renderY-.3*n,0,e.renderX,e.renderY,1.2*n);"direct-runtime"===e.kind?(a.addColorStop(0,de.runtimeHighlight),a.addColorStop(1,c)):"direct-dev"===e.kind?(a.addColorStop(0,de.devHighlight),a.addColorStop(1,l)):(a.addColorStop(0,de.transitiveHighlight),a.addColorStop(1,d)),ee.fillStyle=a,ee.beginPath(),ee.arc(e.renderX,e.renderY,n,0,2*Math.PI),ee.fill(),t&&(ee.globalAlpha=.95,ee.strokeStyle=g,ee.lineWidth=1.5,ee.beginPath(),ee.arc(e.renderX,e.renderY,n+4,0,2*Math.PI),ee.stroke())},N=e=>{if(!e.ref.vulnerabilityCount||e.ref.vulnerabilityCount<=0)return;if("none"===e.ref.vulnerabilitySeverity)return;const t=e.renderRadius,n="high"===e.ref.vulnerabilitySeverity?v:f;var a;ee.save(),ee.translate(e.renderX,e.renderY),ee.globalAlpha=(a=e.slug,S?I.has(a)? .78:.11:L?D.has(a)? .76:.12:.8),ee.strokeStyle=n;const r=t/e.radius,s=t/3*1.2/12,i=1.2*s+3*(r-1),o=Math.max(.5*s,.15),c=Math.max(1*s,.3),l=Math.max(3*s,.8),d=Math.max(1*s,.3),u=Math.max(.5*s,.15),p=t+(2+6*(r-1))+o/2,h=p+o/2+i+c/2,g=h+c/2+i+l/2,m=g+l/2+i+d/2,y=m+d/2+i+u/2;ee.setLineDash([]),ee.lineWidth=u,ee.beginPath(),ee.arc(0,0,y,0,2*Math.PI),ee.stroke(),ee.lineWidth=d,ee.beginPath(),ee.arc(0,0,m,0,2*Math.PI),ee.stroke(),ee.lineWidth=l,ee.beginPath(),ee.arc(0,0,g,0,2*Math.PI),ee.stroke(),ee.lineWidth=c,ee.beginPath(),ee.arc(0,0,h,0,2*Math.PI),ee.stroke(),ee.lineWidth=o,ee.beginPath(),ee.arc(0,0,p,0,2*Math.PI),ee.stroke(),ee.restore()};for(const n of[0,1,2])w.forEach(({node:e,priority:t})=>{t===n&&B(e)}),w.forEach(({node:e,priority:t})=>{t===n&&N(e)});ee.textBaseline="middle",ee.font=n,ee.fillStyle=y,w.forEach(({node:e})=>{(e=>{const t=i(e);t&&(ee.globalAlpha=We(e.slug),ee.fillText(t,e.renderX+e.renderRadius+6,e.renderY))})(e)}),ee.globalAlpha=1,Fe()}function \$e(){if(!\$)return void(_=0);Re();const e=function(){if(!C)return!1;let e=!1;const t=le?.matches;return C.nodes.forEach(n=>{if(t)return n.renderX=n.targetX,n.renderY=n.targetY,n.renderRadius=n.targetRadius,void(n.renderLabelChars=n.targetLabelChars);const a=S? .18:.15;n.renderX+=(n.targetX-n.renderX)*a,n.renderY+=(n.targetY-n.renderY)*a,n.renderRadius+=.18*(n.targetRadius-n.renderRadius),n.renderLabelChars+=.32*(n.targetLabelChars-n.renderLabelChars),Math.abs(n.targetX-n.renderX)<.06&&Math.abs(n.targetY-n.renderY)<.06&&Math.abs(n.targetRadius-n.renderRadius)<.04&&Math.abs(n.targetLabelChars-n.renderLabelChars)<.12||(e=!0)}),e}(),t=function(e){if(!Q.active)return!1;if(!be())return we(),!1;const t=a(e-Q.lastFrameTime||16,1,32);Q.lastFrameTime=e,ve(j+Q.velocityX*t,R+Q.velocityY*t);const n=Math.exp(-.0042*t);return Q.velocityX*=n,Q.velocityY*=n,U=!0,!(Math.hypot(Q.velocityX,Q.velocityY)<.02&&(we(),1))}(performance.now()),n=null!==W&&null!==G&&(le?.matches?(ve(W,G),fe(),U=!0,!1):(j+=.12*(W-j),R+=.12*(G-R),ve(j,R),Math.abs((W??j)-j)<.35&&Math.abs((G??R)-R)<.35?(ve(W,G),fe(),U=!0,!1):(U=!0,!0)));if(U||e||t||n)return Ge(),U=!1,void(_=\$&&(U||e||t||n)?window.requestAnimationFrame(\$e):0);_=0}function Ue(){\$&&!_&&U&&(_=window.requestAnimationFrame(\$e))}function _e(){U=!0,\$&&Ue()}function qe(e){const t=Xe(e);t&&(we(),x=e,C=t,Te(),Oe(),L=null,D=new Set,A=new Set,Ye(!0),C&&(we(),fe(),Le(),T=V,ve(O,F)),U=!0,_e())}function ze(t){0===t.button&&(we(),fe(),J.down=!0,J.moved=!1,J.startX=t.clientX,J.startY=t.clientY,J.startPanX=j,J.startPanY=R,Ee(t.clientX,t.clientY,t.timeStamp),Ye(),e.canvas.classList.add("is-panning"))}function Ke(e){if(!J.down)return void Pe(e.clientX,e.clientY);const t=e.clientX-J.startX,n=e.clientY-J.startY;(Math.abs(t)>2||Math.abs(n)>2)&&(J.moved=!0),ve(J.startPanX+t,J.startPanY+n),Ce(e.clientX,e.clientY,e.timeStamp),_e()}function Je(t){if(!J.down)return;e.canvas.classList.remove("is-panning");const n=J.moved;if(J.down=!1,J.moved=!1,n)return xe(),Q.active?void Me(!1):void Pe(t.clientX,t.clientY);const a=Pe(t.clientX,t.clientY);if(!a)return je(!1),Te(),void Oe();Ne(a.slug),He(a.slug)}function Ze(t){if(!e.canvasHost.contains(t.target))return;t.preventDefault(),we();const n=e.canvas.getBoundingClientRect(),a=t.clientX-n.left,r=t.clientY-n.top,s=t.ctrlKey||t.metaKey? .015*t.deltaY:.002*t.deltaY,i=Math.exp(-s);ye(T*i,a,r)}function Qe(t){if(0===t.touches.length)return;t.preventDefault(),we(),fe(),Ye();const n=e.canvas.getBoundingClientRect();if(1===t.touches.length)Z.active=!0,J.moved=!1,Z.startX1=t.touches[0].clientX,Z.startY1=t.touches[0].clientY,Z.startPanX=j,Z.startPanY=R,Ee(t.touches[0].clientX,t.touches[0].clientY,t.timeStamp),e.canvas.classList.add("is-panning");else if(2===t.touches.length){Z.active=!0,J.moved=!1,Z.startX1=t.touches[0].clientX,Z.startY1=t.touches[0].clientY,Z.startX2=t.touches[1].clientX,Z.startY2=t.touches[1].clientY;const e=Z.startX2-Z.startX1,a=Z.startY2-Z.startY1;Z.startDist=Math.sqrt(e*e+a*a),Z.startZoom=T;const r=(Z.startX1+Z.startX2)/2,s=(Z.startY1+Z.startY2)/2,i=r-n.left,o=s-n.top;Z.anchorX=i,Z.anchorY=o}}function et(e){if(Z.active)if(e.preventDefault(),1===e.touches.length){const t=e.touches[0].clientX-Z.startX1,n=e.touches[0].clientY-Z.startY1;(Math.abs(t)>2||Math.abs(n)>2)&&(J.moved=!0),ve(Z.startPanX+t,Z.startPanY+n),Ce(e.touches[0].clientX,e.touches[0].clientY,e.timeStamp),_e()}else if(2===e.touches.length){we(),J.moved=!0;const t=e.touches[0].clientX,n=e.touches[0].clientY,a=e.touches[1].clientX-t,r=e.touches[1].clientY-n,s=Math.sqrt(a*a+r*r);if(Z.startDist>0){const e=s/Z.startDist;ye(Z.startZoom*e,Z.anchorX??z/2,Z.anchorY??K/2)}}}function tt(e){if(!Z.active)return;e.preventDefault();if("touchcancel"===e.type)return we(),Ye(!0),Z.active=!1,Z.anchorX=null,Z.anchorY=null,void(J.moved=!1);if(0===e.touches.length){if(Ye(!0),Z.active=!1,Z.anchorX=null,Z.anchorY=null,J.moved||1!==e.changedTouches.length)J.moved&&xe();else{const t=Ie(e.changedTouches[0].clientX,e.changedTouches[0].clientY);t?(Ne(t.slug),He(t.slug)):(je(!1),Te(),Oe())}J.moved=!1}else 1===e.touches.length&&(Z.startX1=e.touches[0].clientX,Z.startY1=e.touches[0].clientY,Z.startPanX=j,Z.startPanY=R,Ee(e.touches[0].clientX,e.touches[0].clientY,e.timeStamp))}function nt(){Ve(null),Ye()}function at(t){if(!\$)return;const n=t.target;e.popover.hidden||e.popover.contains(n)||e.canvasHost.contains(n)||Oe()}function rt(e){const t=e.target.closest("button[data-action]");if(!t)return;const n=t.dataset.action;n&&("zoom-in"!==n?"zoom-out"!==n?"pan-left"!==n?"pan-right"!==n?"pan-up"!==n?"pan-down"!==n?"reset"===n&&(we(),T=V,ve(O,F),Te(),Oe(),_e()):ke(0,52):ke(0,-52):ke(52,0):ke(-52,0):ye(T/1.18,.5*z,.5*K):ye(1.18*T,.5*z,.5*K))}function st(){N&&e.onOpenList(N)}function it(){qe(e.workspaceSelect.value)}function ot(){\$&&(Se(),z<=1||K<=1||(Le(),T=a(T,H,t),ve(j,R),_e()))}function ct(){re||(e.workspaceSelect.addEventListener("change",it),re=!0),ae||(e.controlsRoot.addEventListener("click",rt),e.popoverOpenButton.addEventListener("click",st),ae=!0)}return{initGraphView:function(){const t=l.workspaces.length?l.workspaces:[{name:"root",directDependencies:[],directDevDependencies:[]}],n=t.find(e=>"root"===e.name),a=n?[n,...t.filter(e=>"root"!==e.name)]:t;e.workspaceSelect.textContent="",a.forEach((t,n)=>{const r=document.createElement("option");if(r.value=t.name,r.textContent="root"===t.name?"Workspace root":t.name,e.workspaceSelect.appendChild(r),"root"===t.name&&a.length>1&&0===n){const t=document.createElement("option");t.disabled=!0,t.textContent="──────────────",e.workspaceSelect.appendChild(t)}}),e.workspaceWrap.classList.toggle("hidden",t.length<=1),d.has("root")||1!==t.length||d.set("root",t[0]),x=a[0].name,e.workspaceSelect.value=x,ue(),function(){if(se&&se.disconnect(),se=new MutationObserver(()=>{ue(),_e()}),se.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),ie&&(ie.disconnect(),ie=null),oe&&(window.removeEventListener("resize",oe),oe=null),"undefined"!=typeof ResizeObserver)return ie=new ResizeObserver(ot),void ie.observe(e.canvasHost);oe=ot,window.addEventListener("resize",oe)}(),ct(),te?(Se(),qe(x)):pe()},buildWorkspaceGraph:Xe,computeAmplification:Be,layoutGraph:De,renderLoop:Ue,applyFocus:Ne,clearFocus:Te,showPopover:He,hidePopover:Oe,switchWorkspace:qe,setActive:function(n){if(\$=n,\$)return te?(!ne&&te&&(e.canvas.addEventListener("mousedown",ze),window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",Je),e.canvas.addEventListener("wheel",Ze,{passive:!1}),e.canvas.addEventListener("touchstart",Qe,{passive:!1}),window.addEventListener("touchmove",et,{passive:!1}),window.addEventListener("touchend",tt,{passive:!1}),window.addEventListener("touchcancel",tt,{passive:!1}),e.canvas.addEventListener("mouseleave",nt),document.addEventListener("mousedown",at),ne=!0),Se(),z>1&&K>1&&(Le(),T=a(T,H,t),ve(j,R)),Ue(),void _e()):void pe();ne&&(e.canvas.removeEventListener("mousedown",ze),window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",Je),e.canvas.removeEventListener("wheel",Ze),e.canvas.removeEventListener("touchstart",Qe),window.removeEventListener("touchmove",et),window.removeEventListener("touchend",tt),window.removeEventListener("touchcancel",tt),e.canvas.removeEventListener("mouseleave",nt),document.removeEventListener("mousedown",at),Ye(!0),J.down=!1,J.moved=!1,Z.active=!1,Z.anchorX=null,Z.anchorY=null,we(),ne=!1),we(),_&&(window.cancelAnimationFrame(_),_=0)},requestRender:_e}}const E={permissive:["MIT","ISC","BSD-2-Clause","BSD-3-Clause","Apache-2.0","Unlicense","0BSD","CC0-1.0","BSD","Apache","Apache 2.0","Apache License 2.0","MIT License","ISC License"],weakCopyleft:["LGPL-2.1","LGPL-3.0","LGPL-2.0","LGPL","MPL-2.0","MPL-1.1","MPL","EPL-1.0","EPL-2.0","EPL"],strongCopyleft:["GPL-2.0","GPL-3.0","GPL","AGPL-3.0","AGPL","GPL-2.0-only","GPL-3.0-only","GPL-2.0-or-later","GPL-3.0-or-later"]},C={"network-access":"Accesses the network during install","dynamic-exec":"Uses dynamic execution","child-process":"Spawns child processes",encoding:"Uses encoding/decoding logic",obfuscated:"Contains obfuscated/minified install logic","reads-env":"Reads environment variables","reads-home":"Reads user home directory","uses-ssh":"Uses SSH configuration/keys"};function x(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e}function S(e){const t=e.compliance.license,n=t.declared?.valid?t.declared.spdxId:void 0,a=t.inferred?.spdxId;return n?{value:n,isInferred:!1}:a?{value:a,isInferred:!0}:{value:"Unknown",isInferred:!1}}function L(e){const t=e.security;if(t?.summary)return{summary:t.summary,advisories:t.advisories};if(t?.vulnerabilities){const e=t.vulnerabilities;return{summary:{critical:Number(e.critical||0),high:Number(e.high||0),moderate:Number(e.moderate||0),low:Number(e.low||0),highest:e.highest||"none",risk:t.vulnRisk||t.risk||"green"},advisories:t.advisories}}return{summary:{critical:0,high:0,moderate:0,low:0,highest:"none",risk:"green"},advisories:t?.advisories}}function I(e){return e?.highest||"none"}function M(e){return e&&e.risk||"green"}const Y={permissive:"green",weakCopyleft:"amber",strongCopyleft:"red",unknown:"gray"},P={none:0,low:1,moderate:2,high:3,critical:4},X=[{id:"type",label:"Type",sortKey:"type",getValue:e=>e.usage.direct?"Dependency":"Sub-Dependency",getTone:e=>e.usage.direct?"green":"amber",sortFn:(e,t)=>e.usage.direct===t.usage.direct?0:e.usage.direct?-1:1},{id:"scope",label:"Scope",sortKey:"scope",getValue:e=>{return"runtime"===(t=e.usage.scope)?"Runtime":"dev"===t?"Dev":"optional"===t?"Optional":"peer"===t?"Peer":t;var t},getTone:e=>"runtime"===e.usage.scope?"green":"dev"===e.usage.scope||"optional"===e.usage.scope?"amber":"gray",sortFn:(e,t)=>e.usage.scope.localeCompare(t.usage.scope)},{id:"license",label:"License",sortKey:"license",getValue:e=>{const t=S(e),n=t.isInferred?\`\${t.value} (inferred)\`:t.value;return"mismatch"===e.compliance.license.status?\`\${n} *\`:n},getTone:e=>{const t=function(e){if(!e)return"unknown";const t=e.toUpperCase();for(const[n,a]of Object.entries(E))if(a.some(e=>t.includes(e.toUpperCase())))return n;return"unknown"}(S(e).value);return Y[t]},sortFn:(e,t)=>{const n=S(e).value,a=S(t).value;return n.localeCompare(a)}},{id:"vulns",label:"Vulnerabilities",sortKey:"severity",getValue:e=>x(I(L(e).summary)),getTone:e=>L(e).summary.risk,sortFn:(e,t)=>P[I(L(t).summary)]-P[I(L(e).summary)]},{id:"install",label:"Install",sortKey:"install",getValue:e=>{return(t=e.execution)?x(t.risk||"low"):"Low";var t},getTone:e=>M(e.execution),sortFn:(e,t)=>{const n={green:0,amber:1,red:2},a=M(e.execution),r=M(t.execution);return n[a]-n[r]}}],B=X.length;function D(e){if(!e)return"unknown";const t=e.toUpperCase();for(const[n,a]of Object.entries(E))if(a.some(e=>t.includes(e.toUpperCase())))return n;return"unknown"}function A(e){const t=e.compliance.license,n=t.declared?.valid?t.declared.spdxId:void 0,a=t.inferred?.spdxId;return n?{value:n,isInferred:!1}:a?{value:a,isInferred:!0}:{value:"Unknown",isInferred:!1}}function N(e){switch(e){case"declared-only":return"Declared";case"inferred-only":return"Inferred";case"match":return"Declared + Inferred (match)";case"mismatch":return"Declared + Inferred (mismatch)";case"invalid-spdx":return"Invalid SPDX";default:return"Unknown"}}const T={none:0,low:1,moderate:2,high:3,critical:4};function j(e){const t=e.security;if(t?.summary)return{summary:t.summary,advisories:t.advisories};if(t?.vulnerabilities){const e=t.vulnerabilities;return{summary:{critical:Number(e.critical||0),high:Number(e.high||0),moderate:Number(e.moderate||0),low:Number(e.low||0),highest:e.highest||"none",risk:t.vulnRisk||t.risk||"green"},advisories:t.advisories}}return{summary:{critical:0,high:0,moderate:0,low:0,highest:"none",risk:"green"},advisories:t?.advisories}}function R(e){return e?String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}function V(e){return null!=e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.length>0:"object"!=typeof e||Object.keys(e).length>0)}function H(e){return Array.isArray(e)?e.map(e=>H(e)).join(", "):"boolean"==typeof e?e?"Yes":"No":"object"==typeof e&&null!==e?Object.entries(e).filter(([,e])=>V(e)).map(([e,t])=>R(e)+": "+H(t)).join("<br>"):R(String(e))}function O(e,t){return V(t)?'<div class="metadata-row"><div class="metadata-row-label">'+R(e)+'</div><div class="metadata-row-value">'+H(t)+"</div></div>":""}function F(e,t){const n=t.filter(Boolean);return 0===n.length?"":'<section class="metadata-section"><div class="metadata-section-title">'+R(e)+'</div><div class="metadata-grid">'+n.join("")+"</div></section>"}function W(e){const t=e.workspaces;if(!t||!t.enabled)return F("Workspaces",[O("Enabled",!1),O("Type",t?.type)]);const n=t.workspacePackages||[],a=n.length?'<div class="metadata-list">'+n.map(e=>'<div class="metadata-list-item"><div class="metadata-row-value">'+R(e.name)+'</div><div class="metadata-muted">'+R(e.relativePath)+" · runtime "+R(String(e.directExternal.runtime))+" · dev "+R(String(e.directExternal.dev))+"</div></div>").join("")+"</div>":"";return F("Workspaces",[O("Enabled",t.enabled),O("Type",t.type),O("Package count",t.packageCount),a?'<div class="metadata-row"><div class="metadata-row-label">Packages</div><div>'+a+"</div></div>":""])}function G(e){const t=e.supplyChain;if(!t)return"";const n=t.signatureAudit;return F("Supply Chain",[O("Signals",t.signals?.length),n?O("Signature audit",{attempted:n.attempted,ok:n.ok,status:n.status,error:n.error}):""])}function \$(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e}function U(e){return e.split(/[\\s-_]+/).map(e=>e?\$(e):e).join(" ")}function _(e){return X.map(t=>{return n=t.label,a=t.getValue(e),'<div class="badge-card '+t.getTone(e)+'"><span class="badge-label">'+R(n)+'</span><span class="badge-value">'+R(a)+"</span></div>";var n,a}).join("")}function q(e,t){const n=X.map(n=>function(e,t,n,a){const r=n===e,s=r?a?" ▲":" ▼":"",i=r?a?" sorted-asc":" sorted-desc":"";return'<button type="button" class="column-header'+(r?" sorted":"")+i+'" data-sort="'+R(e)+'"><span class="column-header-label">'+R(t)+'</span><span class="sort-indicator">'+s+"</span></button>"}(n.sortKey,n.label,e,t)).join("");return'<div class="column-headers" style="--column-count: '+B+'">'+n+"</div>"}function z(e,t,n){let a='<div class="kv-item">';return a+='<span class="kv-label">'+R(e)+"</span>",a+='<span class="kv-value">'+R(String(t))+"</span>",n&&(a+='<span class="kv-hint">'+R(n)+"</span>"),a+="</div>",a}function K(e,t){return'<span class="kv-value risk-value"><span class="risk-dot '+t+'"></span>'+R(String(e))+"</span>"}function J(e,t,n){let a='<div class="kv-item">';return a+='<span class="kv-label">'+R(e)+"</span>",a+=t,a+="</div>",a}function Z(e,t){if(!e||0===e.length)return'<span class="kv-value">None</span>';const n=e.slice(0,t),a=e.length-t;let r='<div class="package-list">';return n.forEach(e=>{r+='<span class="package-tag">'+R(e)+"</span>"}),a>0&&(r+='<span class="package-tag">+'+a+" more</span>"),r+="</div>",r}function Q(e,t,n,a){if(!e||0===e.length)return'<span class="kv-value">None</span>';const r=e.slice(0,t),s=e.length-t;let i='<div class="package-list">';return r.forEach(e=>{const t=ie(e,n,a);i+=t?'<a class="package-tag package-tag-link root-package-link" href="#'+R(ae(t))+'" data-dep-key="'+R(t)+'" aria-label="Jump to dependency '+R(t)+'">'+R(e)+"</a>":'<span class="package-tag">'+R(e)+"</span>"}),s>0&&(i+='<span class="package-tag">+'+s+" more</span>"),i+="</div>",i}function ee(e,t){return e+"@"+t}const te=new WeakMap;function ne(e){const t=e.lastIndexOf("@npm:");if(t>0)return{name:e.slice(0,t),version:e.slice(t+1)};const n=e.lastIndexOf("@");return n<=0?null:{name:e.slice(0,n),version:e.slice(n+1)}}function ae(e){return\`dep-\${e}\`}function re(e){const t=te.get(e);if(t)return t;const n=new Map;return e.forEach(e=>{const t=ne(e);if(!t)return;const a=n.get(t.name)||[];a.push(e),n.set(t.name,a)}),te.set(e,n),n}function se(e,t,n){const a=((n||re(t)).get(e)||[]).filter(e=>t.has(e));return 1===a.length?a[0]:null}function ie(e,t,n){if(t.has(e))return e;const a=ne(e);if(!a)return se(e,t,n);if(a.version.startsWith("npm:")){const e=a.version.slice(4),n=a.name+(e.startsWith("@")?e:"@"+e);if(t.has(n))return n}return se(a.name,t,n)}function oe(e,t){if(t.has(e))return e;const n=ne(e);if(!n)return null;if(n.version.startsWith("npm:")){const e=n.version.slice(4),a=n.name+(e.startsWith("@")?e:"@"+e);if(t.has(a))return a}return null}function ce(e,t,n,a){if(!e||0===e.length)return'<span class="kv-value">None</span>';const r=e.slice(0,t),s=e.length-t;let i='<div class="package-list">';return r.forEach(e=>{if("string"==typeof e){const t=ie(e,n,a);return t?void(i+='<a class="package-tag package-tag-link root-package-link" href="#'+R(ae(t))+'" data-dep-key="'+R(t)+'" aria-label="Jump to dependency '+R(t)+'">'+R(e)+"</a>"):void(i+='<span class="package-tag">'+R(e)+"</span>")}const t=ee(e.name,e.version),r=e.name+"@"+e.version,s=ie(t,n,a);i+=s?'<a class="package-tag package-tag-link root-package-link" href="#'+R(ae(s))+'" data-dep-key="'+R(s)+'" aria-label="Jump to dependency '+R(s)+'">'+R(r)+"</a>":'<span class="package-tag">'+R(r)+"</span>"}),s>0&&(i+='<span class="package-tag">+'+s+" more</span>"),i+="</div>",i}function le(e,t,n){const a=e.graph.subDeps;if(!a)return"";const r=[{title:"Dependencies",key:"dep"},{title:"Optional",key:"opt"},{title:"Peer",key:"peer"},{title:"Dev Dependencies",key:"dev"}];let s=0,i=0;for(const l of r){const e=a[l.key];if(e)for(const t of Object.values(e))s+=1,t[1]&&(i+=1)}if(0===s)return"";const o='<div class="declared-summary">Total: '+s+" • Installed: "+i+" • Not installed: "+(s-i)+"</div>",c=r.map(e=>{const r=a[e.key];if(!r||0===Object.keys(r).length)return"";let s=0,i=0;const o=Object.entries(r).sort(([e],[t])=>e.localeCompare(t)).map(([e,[a,r]])=>{s+=1,r&&(i+=1);const o='<div class="declared-name">'+R(e)+"</div>",c='<div class="declared-range">'+R(a)+"</div>",l=r?function(e,t,n){const a=ie(e,t,n);return a?'<a class="status-pill installed root-package-link" href="#'+R(ae(a))+'" data-dep-key="'+R(a)+'" aria-label="Jump to dependency '+R(a)+'">Installed</a>':'<span class="status-pill installed">Installed</span>'}(r,t,n):'<span class="status-pill missing">Not installed</span>';return'<div class="declared-row">'+o+c+l+"</div>"}),c=i+" of "+s+" installed";return['<details class="declared-group">','<summary class="declared-group-summary"><span class="expand-icon" aria-hidden="true"></span><span class="declared-group-title">'+R(e.title)+' <span class="declared-count">('+c+")</span></span></summary>",'<div class="declared-table">'+o.join("")+"</div>","</details>"].join("")}).filter(Boolean);return de("Declared Dependencies","Dependencies declared by this package",o+'<div class="declared-deps">'+c.join("")+"</div>")}function de(e,t,n){let a='<div class="section">';return a+='<div class="section-header">',a+='<span class="section-title">'+R(e)+"</span>",t&&(a+='<span class="section-desc">'+R(t)+"</span>"),a+="</div>",a+=n,a+="</div>",a}function ue(e,t,n,a){let r='<div class="subsection'+(a?" "+a:"")+'">';return r+='<div class="subsection-header">',r+='<span class="subsection-title">'+R(e)+"</span>",n&&(r+='<span class="subsection-desc">'+R(n)+"</span>"),r+="</div>",r+=t,r+="</div>",r}function pe(e){if(!e||0===e.length)return"";return ue("Supply chain source",'<div class="section-note">Shown only when lockfile source metadata is unusual or incomplete.</div><div class="kv-grid">'+e.map(e=>{return z({"git-dependency":"Git dependency source","file-dependency":"Local dependency source","non-registry-tarball":"Non-registry tarball","missing-integrity":"Missing lockfile integrity","unexpected-registry-host":"Unexpected registry host"}[t=e.type]||U(t),e.source,e.detail);var t}).join("")+"</div>","Lockfile source signals","warning")}function he(e){if(!e)return;const t=e.trim();if(!t)return;const n=e=>e.replace(/\\.git\$/i,"");if(/^https?:\\/\\//i.test(t))return n(t);if(/^git\\+https?:\\/\\//i.test(t))return n(t.replace(/^git\\+/,""));if(/^git:\\/\\/github\\.com\\//i.test(t))return n(t.replace(/^git:\\/\\//i,"https://"));if(/^github:/i.test(t)){const e=t.slice(7).replace(/^\\/+/,"");return e?\`https://github.com/\${n(e)}\`:void 0}if(/^git@github\\.com:/i.test(t)){const e=t.slice(15);return e?\`https://github.com/\${n(e)}\`:void 0}return/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+\$/.test(t)?\`https://github.com/\${n(t)}\`:void 0}function ge(e,t){const n=he(e);if(!n)return;let a;try{a=new URL(n)}catch{return}if("github.com"!==a.hostname.toLowerCase())return;const r=a.pathname.split("/").filter(Boolean);if(r.length<2)return;const s=r[0],i=r[1].replace(/\\.git\$/i,"");return s&&i?\`https://github.com/\${s}/\${i}/blob/HEAD/\${t}\`:void 0}function me(e,t){return t?R(e)+' <a class="kv-inline-link" href="'+R(t)+'" target="_blank" rel="noopener noreferrer">GitHub<svg class="kv-inline-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M7 17 17 7"/><path d="M9 7h8v8"/></svg></a>':R(e)}function ve(e){const t='<svg viewBox="0 0 24 24" fill="currentColor"><path d="M0 7.334v8h6.666v1.332H12v-1.332h12v-8H0zm6.666 6.664H5.334v-4H3.999v4H1.335V8.667h5.331v5.331zm4 0v1.336H8.001V8.667h5.334v5.332h-2.669v-.001zm12.001 0h-1.33v-4h-1.336v4h-1.335v-4h-1.33v4h-2.671V8.667h8.002v5.331zM10.665 10H12v2.667h-1.335V10z"/></svg>',n='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg>',a='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',r='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>';if(!(e.npm||e.repository||e.homepage||e.issues))return"";let s='<div class="package-links">';return e.npm&&(s+='<a href="'+R(e.npm)+'" target="_blank" rel="noopener" class="package-link">'+t+"npm</a>"),e.repository&&(s+='<a href="'+R(e.repository)+'" target="_blank" rel="noopener" class="package-link">'+n+"Repository</a>"),e.homepage&&(s+='<a href="'+R(e.homepage)+'" target="_blank" rel="noopener" class="package-link">'+r+"Homepage</a>"),e.issues&&(s+='<a href="'+R(e.issues)+'" target="_blank" rel="noopener" class="package-link">'+a+"Issues</a>"),s+="</div>",s}function fe(e){const t=function(e,t){const n=[e.risk,t];return n.includes("red")?"red":n.includes("amber")?"amber":"green"}(j(e).summary,e.compliance.licenseRisk),n=ee(e.package.name,e.package.version),a=ae(n),r=_(e),s=['<summary class="dep-summary">','<span class="expand-icon" aria-hidden="true"></span>','<span class="dep-name">'+R(e.package.name)+'<span class="dep-version">@'+R(e.package.version)+"</span></span>",'<div class="dep-indicators" style="--column-count: '+B+'">',r,"</div>","</summary>"].join("");return['<details class="dep-card" data-risk="'+t+'" data-dep-key="'+R(n)+'" id="'+R(a)+'">',s,'<div class="dep-details" data-rendered="false"></div>',"</details>"].join("")}function ye(e,t,n,a){const r=j(e),s=r.summary,i=A(e),o=i.isInferred?\`\${i.value} (inferred)\`:i.value,c=function(e){const t=e.package?.links||{},n=e.links||{},a=he(t.repository||n.repository||n.repo);return{npm:t.npm||n.npm,repository:a||t.repository||n.repository||n.repo,homepage:t.homepage||n.homepage,issues:t.bugs||t.issues||n.bugs||n.issues}}(e),l=JSON.stringify(e,null,2),d=[e.usage.direct?"Direct dependency":"Indirect dependency (transitive)","Scope: "+(u=e.usage.scope,"runtime"===u?"Runtime":"dev"===u?"Dev":"optional"===u?"Optional":"peer"===u?"Peer":u)];var u;e.package.description&&d.unshift("Description: "+e.package.description),e.usage.origins.workspaces?.length&&d.push("Used in "+e.usage.origins.workspaces.length+" workspaces"),e.usage.importUsage&&d.push("Imported in "+e.usage.importUsage.fileCount+" project files"),e.usage.introduction&&d.push("Introduced by: "+U(e.usage.introduction)),d.length<3&&d.push("Dependency depth: "+e.usage.depth);var p,h;const g=de("Overview","Summary and key context",'<div class="micro-summary">'+d.slice(0,5).map(e=>'<div class="micro-line">'+R(e)+"</div>").join("")+"</div>"+(e.usage.origins.workspaces?.length?'<div class="micro-sublist"><div class="micro-subtitle">Workspaces</div>'+Z(e.usage.origins.workspaces,8)+"</div>":"")+('<div class="section-block"><div class="block-title">Key context</div><div class="kv-grid kv-grid-tight">'+[e.usage.runtimeImpact?z("Runtime impact",(h=e.usage.runtimeImpact,h?U(h):"")):"",z("Dependency depth",e.usage.depth),e.usage.direct?"":J("Introduced via root packages",ce(e.usage.origins.topRootPackages,8,t,n)),e.usage.direct?"":z("Direct roots",e.usage.origins.rootPackageCount),e.usage.direct?"":J("Direct parents",Q(e.usage.origins.topParentPackages,8,t,n)),e.usage.direct?"":z("Direct parents count",e.usage.origins.parentPackageCount??0),z("TypeScript types",(p=e.usage.tsTypes,"bundled"===p?"Bundled":"definitelyTyped"===p?"DefinitelyTyped":"none"===p?"None":"Unknown"))].filter(Boolean).join("")+"</div></div>")+function(e,t,n,a){if(!t||0===t.length)return"";const r=t.slice(0,n),s=t.length-n;let i='<div class="detail-list">';return i+='<div class="detail-title">'+R(e)+"</div>",i+='<ul class="detail-items '+a+'">',r.forEach(e=>{i+='<li class="detail-item">'+R(e)+"</li>"}),s>0&&(i+='<li class="detail-item muted">+'+s+" more</li>"),i+="</ul></div>",i}("Top import locations",e.usage.importUsage?.topFiles,5,"mono")),m=e.compliance.license,v=ge(c.repository,"package.json"),f=ge(c.repository,"LICENSE"),y=[J("Primary license",K(o,e.compliance.licenseRisk)),z("Status",N(m.status))];if(m.declared){const e=[m.declared.valid?"valid":"invalid",m.declared.expression?"expression":void 0,m.declared.deprecated?"deprecated":void 0].filter(Boolean).join(", "),t=m.exception?.id?\` WITH \${m.exception.id}\`:"";y.push(J("Declared SPDX in package.json",'<span class="kv-value">'+me(\`\${m.declared.spdxId}\${t}\${e?\` (\${e})\`:""}\`,v)+"</span>"))}m.inferred&&y.push(J("Inferred from LICENSE file",'<span class="kv-value">'+me(\`\${m.inferred.spdxId} (\${m.inferred.confidence})\`,f)+"</span>")),"mismatch"===m.status&&y.push(z("Mismatch","Declared SPDX and LICENSE text do not match")),"invalid-spdx"===m.status&&y.push(z("Invalid SPDX","Package.json license is not a valid SPDX identifier or expression"));const k=ue("License",'<div class="kv-grid">'+y.join("")+"</div>"),b=s.critical+s.high+s.moderate+s.low,w=[J("Known vulnerabilities",K(0===b?"None":String(b),s.risk)),z("Highest severity","none"===s.highest?"None":U(s.highest))],E=b>0?'<div class="kv-grid kv-grid-tight">'+[z("Critical",s.critical),z("High",s.high),z("Moderate",s.moderate),z("Low",s.low)].join("")+"</div>":"",x=function(e){if(!e||0===e.length)return"";let t='<table class="vuln-table"><thead><tr>';return t+="<th>Title</th><th>Severity</th><th>Affected range</th><th>Fix available</th><th>Reference</th>",t+="</tr></thead><tbody>",e.forEach(e=>{const n=R(e.title),a=e.url?'<a href="'+R(e.url)+'" target="_blank" rel="noopener">Link</a>':"";t+='<tr data-severity="'+R(e.severity)+'">',t+='<td data-label="Title">'+n+"</td>",t+='<td data-label="Severity">'+R(\$(e.severity))+"</td>",t+='<td data-label="Affected range">'+R(e.vulnerableRange)+"</td>",t+='<td data-label="Fix available">'+R(e.fixAvailable?"Yes":"No")+"</td>",t+='<td data-label="Reference">'+a+"</td>",t+="</tr>"}),t+="</tbody></table>",t}(r.advisories),S=de("Risk & Compliance","License, vulnerabilities, install-time execution, and unusual source signals",k+ue("VULNERABILITIES",['<div class="section-note">Based on npm audit findings (known disclosed issues).</div>','<div class="kv-grid">'+w.join("")+"</div>",E?'<div class="subtle-divider"></div>'+E:"",x?'<div class="subtle-divider"></div>'+x:""].join(""),"Known security issues from npm audit","vuln-block")+(e.execution?function(e){const t=[J("Execution risk",K((n=e.risk,"red"===n?"High":"amber"===n?"Medium":"Low"),e.risk))];var n;if(e.native&&t.push(z("Native build tooling detected (native)","Yes")),e.scripts?.hooks?.length&&t.push(J("Lifecycle hooks",Z(e.scripts.hooks,6))),"number"==typeof e.scripts?.complexity&&t.push(z("Heuristic complexity","Script complexity: "+e.scripts.complexity+" (complexity)")),e.scripts?.signals?.length){const n=e.scripts.signals.map(e=>\`\${C[e]} (\${e})\`);t.push(J("Install-time signals",Z(n,6)))}return ue("Install-time execution behaviour",'<div class="section-note">Install-time behaviour signals detected. These describe code that runs automatically during install and may warrant review in security-sensitive environments.</div><div class="kv-grid">'+t.join("")+"</div>")}(e.execution):"")+pe(a)),L=[z("Outdated status",(I=e.upgrade.outdatedStatus,I?"unknown"===I?"Unknown":U(I):"Not reported"))];var I;e.upgrade.latestVersion&&L.push(z("Latest version",e.upgrade.latestVersion));const M=ue("Version",'<div class="section-note">Based on npm outdated findings.</div><div class="kv-grid">'+L.join("")+"</div>"),Y=e.package.deprecated?ue("Deprecated",'<div class="kv-grid">'+z("Deprecated","Yes","Declared by the package author.")+"</div>",void 0,"warning"):"",P=[z("Node engine constraint",e.upgrade.nodeEngine||"Any")];void 0!==e.upgrade.blocksNodeMajor&&P.push(z("Blocks Node major upgrade",e.upgrade.blocksNodeMajor?"Yes":"No"));const X=ue("Constraints",'<div class="kv-grid">'+P.join("")+"</div>"),B=ue("Blast radius",'<div class="kv-grid">'+[z("Used by other packages (fanIn)",e.graph.fanIn),z("Depends on packages (fanOut)",e.graph.fanOut)].join("")+"</div>"),D={nodeEngine:"Node engine constraint",peerDependency:"Peer dependency constraints",nativeBindings:"Native bindings/build tooling",installScripts:"Install lifecycle scripts",deprecated:"Deprecated by author"},T=de("Upgrade & Change Impact","Currency, constraints, and blast radius",M+Y+X+B+(e.upgrade.blockers?.length?'<div class="subsection"><div class="subsection-header"><span class="subsection-title">Upgrade blockers</span></div><ul class="bullet-list">'+e.upgrade.blockers.map(e=>"<li>"+R(D[e]||e)+"</li>").join("")+"</ul></div>":"")),V=le(e,t,n);return[ve(c),g,S,T,V,'<details class="raw-data-toggle"><summary><span class="expand-icon" aria-hidden="true"></span>View raw data</summary><div class="raw-data-pane"><pre>'+R(l)+'</pre><button type="button" class="copy-json-btn" aria-label="Copy raw JSON">Copy JSON</button></div></details>'].join("")}async function ke(){const t=await async function(){const e=document.getElementById("radar-data");return e&&e.textContent&&"{}"!==e.textContent.trim()?JSON.parse(e.textContent):(await fetch("./sample-data.json")).json()}();void 0===window.__DEPENDENCY_DATA__&&(window.__DEPENDENCY_DATA__=t);const n=document.getElementById("dependency-list"),a=document.getElementById("results-summary"),r=function(e){const t="string"==typeof e&&e.trim().length>0?e.trim():"unknown";return\`https://dependency-radar.com/next-steps?source=standalone-report&cli=\${encodeURIComponent(t)}\`}(t.dependencyRadarVersion),s=document.getElementById("project-path");s&&(s.textContent=t.project.name||t.project.projectDir,s.title=t.project.projectDir);const i=document.getElementById("metadata-toggle"),o=document.getElementById("metadata-panel"),c=document.getElementById("cta-primary-link");c&&(c.href=r);const l=document.getElementById("formatted-date");let d=t.generatedAt||"";if(l&&t.generatedAt)try{const e=new Date(t.generatedAt);Number.isNaN(e.getTime())?(d=t.generatedAt,l.textContent=t.generatedAt):(d=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(e),l.textContent=d)}catch{d=t.generatedAt,l.textContent=t.generatedAt}o&&(o.innerHTML=function(e,t){const n=e.environment||{},a=n.minRequiredMajor,r=a&&a>0?"Node requirement derived from dependency engine ranges.":"";return[F("Report",[O("Dependency Radar",e.dependencyRadarVersion),O("Schema",e.schemaVersion),O("Generated",t||e.generatedAt),O("Generated raw",e.generatedAt)]),F("Project",[O("Name",e.project.name),O("Version",e.project.version),O("Path",e.project.projectDir),O("Description",e.project.description),O("License",e.project.license),O("Homepage",e.project.homepage),O("Repository",e.project.repository),O("Constraints",e.project.constraints),O("Dependency policy",e.project.dependencyPolicySummary)]),F("Git",[O("Branch",e.git?.branch)]),F("Environment",[O("Node",n.nodeVersion),O("Runtime",n.runtimeVersion),O("Minimum required Node major",n.minRequiredMajor),O("Target Node major",n.targetNodeMajor),O("Platform",n.platform),O("Architecture",n.arch),O("CI",n.ci),O("packageManager field",n.packageManagerField),O("Package manager",n.packageManager),O("Package manager version",n.packageManagerVersion),O("Tool versions",n.toolVersions),O("Node note",r)]),W(e),F("Summary",[O("Dependencies",e.summary?.dependencyCount),O("Direct",e.summary?.directCount),O("Transitive",e.summary?.transitiveCount),O("Findings",e.summary?.findingCount)]),G(e)].filter(Boolean).join("")}(t,d),o.hidden=!1,o.inert=!0,o.setAttribute("aria-hidden","true"));const u=e=>{i&&o&&(o.classList.toggle("open",e),o.inert=!e,o.setAttribute("aria-hidden",String(!e)),i.classList.toggle("open",e),i.setAttribute("aria-expanded",String(e)))};i?.addEventListener("click",()=>{const e=!o?.classList.contains("open");u(e)}),document.addEventListener("click",e=>{if(!i||!o)return;if(!o.classList.contains("open"))return;const t=e.target;i.contains(t)||o.contains(t)||u(!1)}),document.addEventListener("keydown",e=>{"Escape"===e.key&&u(!1)});const p={search:document.getElementById("search"),direct:document.getElementById("direct-filter"),runtime:document.getElementById("runtime-filter"),workspace:document.getElementById("workspace-filter"),workspaceWrap:document.getElementById("workspace-filter-wrap"),sort:document.getElementById("sort-by"),sortDirection:document.getElementById("sort-direction"),hasVulns:document.getElementById("has-vulns"),themeSwitch:document.getElementById("theme-switch"),licenseToggle:document.getElementById("license-toggle"),licensePanel:document.getElementById("license-panel"),licensePermissive:document.getElementById("license-permissive"),licenseWeakCopyleft:document.getElementById("license-weak-copyleft"),licenseStrongCopyleft:document.getElementById("license-strong-copyleft"),licenseUnknown:document.getElementById("license-unknown"),licenseAll:document.getElementById("license-all"),licenseFriendly:document.getElementById("license-friendly"),filtersToggle:document.getElementById("filters-toggle"),filterCountBadge:document.getElementById("filter-count-badge"),filterControls:document.getElementById("filter-controls"),activeFiltersRow:document.getElementById("active-filters-row"),activeFilterChips:document.getElementById("active-filter-chips"),activeFilterClear:document.getElementById("active-filter-clear"),clearAllFilters:document.getElementById("clear-all-filters"),licensePermissiveLabel:document.getElementById("license-permissive-label"),licenseWeakCopyleftLabel:document.getElementById("license-weak-copyleft-label"),licenseStrongCopyleftLabel:document.getElementById("license-strong-copyleft-label"),licenseUnknownLabel:document.getElementById("license-unknown-label"),hasVulnsLabel:document.getElementById("has-vulns-label"),columnHeadersContainer:document.getElementById("column-headers-container"),packageHeader:document.getElementById("package-header"),viewGraphButton:document.getElementById("view-graph-btn"),graphBackButton:document.getElementById("graph-back-btn"),listViewPanel:document.getElementById("list-view"),graphViewPanel:document.getElementById("graph-view"),graphWorkspaceSelect:document.getElementById("graph-workspace"),graphWorkspaceWrap:document.getElementById("graph-workspace-wrap"),graphControls:document.getElementById("graph-controls"),graphCanvas:document.getElementById("graph-canvas"),graphCanvasShell:document.getElementById("graph-canvas-shell"),graphPopover:document.getElementById("graph-popover"),graphPopoverName:document.getElementById("graph-popover-name"),graphPopoverVersion:document.getElementById("graph-popover-version"),graphPopoverLicense:document.getElementById("graph-popover-license"),graphPopoverVulns:document.getElementById("graph-popover-vulns"),graphPopoverAmplification:document.getElementById("graph-popover-amplification"),graphOpenList:document.getElementById("graph-open-list"),reportFooter:document.querySelector(".report-footer")};let h="name",g=!0,m=null,v=!1;document.documentElement.setAttribute("data-theme","dark");"light"===localStorage.getItem("dependency-radar-theme")?(document.documentElement.classList.add("light"),p.themeSwitch.classList.add("light"),p.themeSwitch.setAttribute("aria-pressed","true"),document.documentElement.setAttribute("data-theme","light")):(document.documentElement.classList.remove("light"),p.themeSwitch.classList.remove("light"),p.themeSwitch.setAttribute("aria-pressed","false"),document.documentElement.setAttribute("data-theme","dark")),p.themeSwitch.addEventListener("click",()=>{document.documentElement.classList.toggle("light"),p.themeSwitch.classList.toggle("light");const e=document.documentElement.classList.contains("light");document.documentElement.setAttribute("data-theme",e?"light":"dark"),p.themeSwitch.setAttribute("aria-pressed",String(e)),localStorage.setItem("dependency-radar-theme",e?"light":"dark"),m?.requestRender()});const f=window.matchMedia("(max-width: 768px)");let y=f.matches;const k=e=>{p.filterControls&&p.filtersToggle&&(p.filterControls.classList.toggle("open",e),p.filterControls.inert=!e,p.filterControls.setAttribute("aria-hidden",String(!e)),p.filtersToggle.classList.toggle("open",e),p.filtersToggle.setAttribute("aria-expanded",String(e)),e&&u(!1))},b=()=>{if(f.matches)return k(!1),void(y=!0);y&&k(!1),y=!1};function E(){if(p.columnHeadersContainer&&(p.columnHeadersContainer.innerHTML=q(h,g)),p.packageHeader){const e=p.packageHeader.querySelector(".sort-indicator");e&&("name"===h?(e.textContent=g?" ▲":" ▼",p.packageHeader.classList.add("sorted")):(e.textContent="",p.packageHeader.classList.remove("sorted")))}}function C(e){const t=e.target.closest(".column-header");if(!t)return;const n=t.dataset.sort;n&&(h===n?g=!g:(h=n,g=!0),p.sort&&(p.sort.value=h,p.sortDirection.textContent=g?"↑":"↓"),E(),Q())}p.filtersToggle&&p.filterControls&&p.filtersToggle.addEventListener("click",()=>{const e=!p.filterControls.classList.contains("open");k(e)}),document.addEventListener("click",e=>{if(!p.filterControls||!p.filtersToggle)return;const t=e.target;p.filterControls.contains(t)||p.filtersToggle.contains(t)||k(!1)}),document.addEventListener("keydown",e=>{"Escape"===e.key&&k(!1)}),k(!1),window.addEventListener("resize",b),b(),p.sortDirection.addEventListener("click",()=>{g=!g,p.sortDirection.textContent=g?"↑":"↓",E(),Q()}),p.sort.addEventListener("change",()=>{h=p.sort.value,E(),Q()}),p.columnHeadersContainer&&p.columnHeadersContainer.addEventListener("click",C),p.packageHeader&&p.packageHeader.addEventListener("click",C),E(),p.licenseAll.addEventListener("click",()=>{p.licensePermissive.checked=!0,p.licenseWeakCopyleft.checked=!0,p.licenseStrongCopyleft.checked=!0,p.licenseUnknown.checked=!0,\$.clear(),Q()}),p.licenseFriendly.addEventListener("click",()=>{p.licensePermissive.checked=!0,p.licenseWeakCopyleft.checked=!1,p.licenseStrongCopyleft.checked=!1,p.licenseUnknown.checked=!1,\$.clear(),Q()});const x=Object.values(t.dependencies||{}),S=e=>{const t=e.usage.origins.workspaces||[];return t.length>0?t:["root"]},L=Array.from(new Set([...e(t),...x.flatMap(S)])).sort((e,t)=>"root"===e?-1:"root"===t?1:e.localeCompare(t)),I=(e,t)=>e+" ("+t+")",M=e=>{return T[(t=j(e).summary,t?.highest||"none")]>0;var t},Y=e=>x.reduce((t,n)=>t+(e(n)?1:0),0);if(p.workspace&&p.workspaceWrap&&L.length>1){p.workspace.textContent="";const e=document.createElement("option");e.value="all",e.textContent=I("All workspaces",x.length),p.workspace.appendChild(e),L.forEach(e=>{const t=document.createElement("option");t.value=e,t.textContent=I("root"===e?"Workspace root":e,Y(t=>S(t).includes(e))),p.workspace.appendChild(t)}),p.workspaceWrap.classList.remove("hidden")}!function(){const e=x.length;p.direct.options[0].textContent=I("All",e),p.direct.options[1].textContent=I("Direct",Y(e=>e.usage.direct)),p.direct.options[2].textContent=I("Transitive",Y(e=>!e.usage.direct));const t={all:"All",runtime:"Production",dev:"Development",optional:"Optional",peer:"Peer"};Array.from(p.runtime.options).forEach(n=>{n.textContent=I(t[n.value]||n.textContent||n.value,"all"===n.value?e:Y(e=>e.usage.scope===n.value))});const n={permissive:0,weakCopyleft:0,strongCopyleft:0,unknown:0};x.forEach(e=>{n[D(A(e).value)]+=1}),p.licensePermissiveLabel&&(p.licensePermissiveLabel.textContent=I("Permissive",n.permissive)),p.licenseWeakCopyleftLabel&&(p.licenseWeakCopyleftLabel.textContent=I("Weak Copyleft",n.weakCopyleft)),p.licenseStrongCopyleftLabel&&(p.licenseStrongCopyleftLabel.textContent=I("Strong Copyleft",n.strongCopyleft)),p.licenseUnknownLabel&&(p.licenseUnknownLabel.textContent=I("Other / Unknown",n.unknown)),p.hasVulnsLabel&&(p.hasVulnsLabel.textContent=I("Has vulnerabilities",Y(M)))}();const P=new Map;x.forEach(e=>{P.set(ee(e.package.name,e.package.version),e)});const B=new Set(P.keys()),N=re(B),V=function(e,t,n){const a=new Map,r=(e,t)=>{const n=a.get(e)||[];n.push(t),a.set(e,n)};for(const s of e.supplyChain?.signals||[]){const e=[s.packageId,s.packageName&&s.packageVersion?ee(s.packageName,s.packageVersion):void 0].filter(Boolean);let a=!1;for(const n of e){const e=oe(n,t);if(e){r(e,s),a=!0;break}}if(!a&&s.packageName&&!s.packageVersion){const e=se(s.packageName,t,n);e&&r(e,s)}}return a}(t,B,N),H=new Set,\$=new Set,U=new Map,_=(()=>{const e=document.getElementById("copy-announcer");if(e)return e;const t=document.createElement("div");return t.id="copy-announcer",t.className="sr-only",t.setAttribute("aria-live","polite"),document.body.appendChild(t),t})();function z(e){const t=e.dataset.depKey;if(!t)return;const n=e.querySelector(".dep-details");if(!n||"true"===n.dataset.rendered)return;const a=P.get(t);a&&(n.setAttribute("aria-busy","true"),n.innerHTML=['<div class="dep-loading" role="presentation">','<div class="dep-loading-bar"></div>',"</div>"].join(""),requestAnimationFrame(()=>{n.innerHTML=ye(a,B,N,V.get(t)),n.dataset.rendered="true",n.removeAttribute("aria-busy")}))}function K(e){const t=e.selectedOptions[0];return(t?.textContent||"").replace(/\\s+\\(\\d+\\)\$/,"")}function J(){p.search.value="",p.direct.value="all",p.runtime.value="all",p.workspace&&(p.workspace.value="all"),p.hasVulns.checked=!1,p.licensePermissive.checked=!0,p.licenseWeakCopyleft.checked=!0,p.licenseStrongCopyleft.checked=!0,p.licenseUnknown.checked=!0}function Z(){const e=[],t=p.search.value.trim();t&&e.push({id:"search",label:"Search: "+t,remove:()=>{p.search.value=""}}),"all"!==p.direct.value&&e.push({id:"type",label:"Type: "+K(p.direct),remove:()=>{p.direct.value="all"}}),"all"!==p.runtime.value&&e.push({id:"scope",label:"Scope: "+K(p.runtime),remove:()=>{p.runtime.value="all"}}),p.workspace&&"all"!==p.workspace.value&&e.push({id:"workspace",label:"Workspace: "+K(p.workspace),remove:()=>{p.workspace.value="all"}});return[{id:"license-permissive",checked:p.licensePermissive.checked,label:"License: Permissive",reset:()=>{p.licensePermissive.checked=!0}},{id:"license-weak-copyleft",checked:p.licenseWeakCopyleft.checked,label:"License: Weak Copyleft",reset:()=>{p.licenseWeakCopyleft.checked=!0}},{id:"license-strong-copyleft",checked:p.licenseStrongCopyleft.checked,label:"License: Strong Copyleft",reset:()=>{p.licenseStrongCopyleft.checked=!0}},{id:"license-unknown",checked:p.licenseUnknown.checked,label:"License: Other / Unknown",reset:()=>{p.licenseUnknown.checked=!0}}].forEach(t=>{t.checked||e.push({id:t.id,label:t.label,remove:t.reset})}),p.hasVulns.checked&&e.push({id:"has-vulns",label:"Has vulnerabilities",remove:()=>{p.hasVulns.checked=!1}}),e}function Q(){!function(){const e=Z(),t=e.length;p.filtersToggle.classList.toggle("has-active-filters",t>0),p.filterCountBadge&&(p.filterCountBadge.hidden=0===t,p.filterCountBadge.textContent=String(t)),p.activeFiltersRow&&p.activeFilterChips&&(p.activeFiltersRow.hidden=0===t,p.activeFilterChips.innerHTML=e.map(e=>'<span class="active-filter-chip">'+R(e.label)+'<button type="button" class="active-filter-remove" data-filter-chip="'+R(e.id)+'" aria-label="Remove '+R(e.label)+'">×</button></span>').join(""))}();const e=function(e){const t=[...e];if("name"===h)t.sort((e,t)=>e.package.name.localeCompare(t.package.name));else if("depth"===h)t.sort((e,t)=>e.usage.depth-t.usage.depth);else{const e=X.find(e=>e.sortKey===h||e.id===h);e?.sortFn?t.sort(e.sortFn):e&&t.sort((t,n)=>e.getValue(t).localeCompare(e.getValue(n)))}return g||t.reverse(),t}(function(){const e=(p.search.value||"").toLowerCase(),t=p.direct.value,n=p.runtime.value,a=p.workspace?.value||"all",r=p.hasVulns.checked,s=p.licensePermissive.checked,i=p.licenseWeakCopyleft.checked,o=p.licenseStrongCopyleft.checked,c=p.licenseUnknown.checked;return x.filter(l=>{const d=ee(l.package.name,l.package.version);if(\$.has(d))return!0;const u=A(l),p=[u.value,l.compliance.license.declared?.spdxId,l.compliance.license.inferred?.spdxId].filter(Boolean).join(" ").toLowerCase();if(e&&!l.package.name.toLowerCase().includes(e)&&!p.includes(e))return!1;if("direct"===t&&!l.usage.direct)return!1;if("transitive"===t&&l.usage.direct)return!1;if("all"!==n&&l.usage.scope!==n)return!1;if("all"!==a&&!S(l).includes(a))return!1;if(r&&!M(l))return!1;const h=D(u.value);return!("permissive"===h&&!s||"weakCopyleft"===h&&!i||"strongCopyleft"===h&&!o||"unknown"===h&&!c)})}()),r=t.summary?.dependencyCount||x.length;a.innerHTML="Showing <strong>"+e.length+"</strong> of <strong>"+r+"</strong> dependencies","all"!==(p.workspace?.value||"all")&&(a.innerHTML+=" in <strong>"+R(p.workspace.value)+"</strong>"),0!==e.length?(n.innerHTML=e.map(fe).join(""),U.clear(),n.querySelectorAll("details.dep-card").forEach(e=>{const t=e.dataset.depKey;t&&U.set(t,e)}),H.forEach(e=>{const t=U.get(e);t&&(t.open||(t.open=!0),z(t))})):n.innerHTML='<div class="empty-state"><div class="empty-state-icon">📦</div><div class="empty-state-text">No dependencies match your filters</div></div>'}function te(e){const t=N.get(e)||[];return 1===t.length?t[0]:null}function ie(e){if(P.has(e))return e;const t=ne(e);if(!t)return te(e);if(t.version.startsWith("npm:")){const e=t.version.slice(4),n=t.name+(e.startsWith("@")?e:"@"+e);if(P.has(n))return n}return te(t.name)}function ce(e){if(!p.listViewPanel||!p.graphViewPanel)return void console.warn("Dependency Radar: view panels are missing from the report DOM.");const n="list"===e;n||Boolean(p.graphWorkspaceSelect&&p.graphWorkspaceWrap&&p.graphControls&&p.graphCanvas&&p.graphCanvasShell&&p.graphPopover&&p.graphPopoverName&&p.graphPopoverVersion&&p.graphPopoverLicense&&p.graphPopoverVulns&&p.graphPopoverAmplification&&p.graphOpenList)?(p.listViewPanel.classList.toggle("active",n),p.graphViewPanel.classList.toggle("active",!n),p.listViewPanel.setAttribute("aria-hidden",String(!n)),p.graphViewPanel.setAttribute("aria-hidden",String(n)),p.viewGraphButton&&(p.viewGraphButton.style.display=n?"":"none"),p.graphBackButton&&(p.graphBackButton.style.display=n?"none":""),p.reportFooter?.classList.toggle("hidden",!n),document.body.classList.toggle("graph-mode",!n),n?m?.setActive(!1):(v||(m=w({report:t,knownDepKeys:B,resolveDepKey:ie,workspaceSelect:p.graphWorkspaceSelect,workspaceWrap:p.graphWorkspaceWrap,controlsRoot:p.graphControls,canvas:p.graphCanvas,canvasHost:p.graphCanvasShell,popover:p.graphPopover,popoverName:p.graphPopoverName,popoverVersion:p.graphPopoverVersion,popoverLicense:p.graphPopoverLicense,popoverVulns:p.graphPopoverVulns,popoverAmplification:p.graphPopoverAmplification,popoverOpenButton:p.graphOpenList,onOpenList:e=>{!function(e){ce("list");let t=document.getElementById(ae(e));!t&&P.has(e)&&(\$.add(e),Q(),t=document.getElementById(ae(e)));if(!t)return;if(t instanceof HTMLDetailsElement){const e=t.dataset.depKey;e&&H.add(e),t.open||(t.open=!0),z(t)}t.classList.add("dep-list-highlight"),le(t,!0),window.setTimeout(()=>{t?.classList.remove("dep-list-highlight")},2e3)}(e)}}),m.initGraphView(),v=!0),m?.setActive(!0),m?.requestRender())):console.warn("Dependency Radar: graph view DOM nodes are missing; graph view disabled.")}function le(e,t=!1){const n=()=>{const n=window.scrollY+e.getBoundingClientRect().top-function(){const e=document.querySelector(".filter-bar");return!e||document.body.classList.contains("graph-mode")?0:Math.ceil(e.getBoundingClientRect().height+8)}();if(window.scrollTo({top:Math.max(0,n),behavior:"smooth"}),t){const t=e.querySelector("summary");t&&t.focus({preventScroll:!0})}};requestAnimationFrame(()=>{n(),window.setTimeout(n,60)})}const de=[p.search,p.direct,p.runtime,p.sort,p.hasVulns,p.workspace,p.licensePermissive,p.licenseWeakCopyleft,p.licenseStrongCopyleft,p.licenseUnknown],ue=()=>{\$.clear(),Q()};de.forEach(e=>{e&&(e.addEventListener("input",ue),e.addEventListener("change",ue))}),p.activeFilterChips?.addEventListener("click",e=>{const t=e.target.closest("[data-filter-chip]");if(!t)return;const n=Z().find(e=>e.id===t.dataset.filterChip);n&&(n.remove(),ue())});const pe=()=>{J(),ue()};function he(e){const t=e.getAttribute("data-dep-key");if(!t)return;const n=ie(t);if(!n)return;let a=U.get(n);a||(\$.add(n),Q(),a=U.get(n)),a&&(H.add(n),a.open||(a.open=!0),z(a),le(a,!0))}p.activeFilterClear?.addEventListener("click",pe),p.clearAllFilters?.addEventListener("click",pe),p.viewGraphButton?.addEventListener("click",()=>{ce("graph")}),p.graphBackButton?.addEventListener("click",()=>{ce("list")}),n.addEventListener("toggle",e=>{const t=e.target;if(!(t instanceof HTMLDetailsElement))return;if(!t.classList.contains("dep-card"))return;const n=t.dataset.depKey;n&&(t.open?(H.add(n),z(t)):H.delete(n))},!0),n.addEventListener("click",e=>{const t=e.target,n=t.closest(".root-package-link");if(n)return e.preventDefault(),void he(n);const a=t.closest(".copy-json-btn");a&&(e.preventDefault(),async function(e){const t=e.closest(".raw-data-toggle"),n=t?.querySelector("pre"),a=n?.textContent??"";if(a)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(a);else{const e=document.createElement("textarea");e.value=a,e.setAttribute("readonly","true"),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}const t=e.dataset.label||e.textContent||"Copy JSON";e.dataset.label=t,e.textContent="Copied",e.classList.add("copied"),_.textContent="Copied JSON to clipboard.",window.setTimeout(()=>{e.textContent=t,e.classList.remove("copied")},1500)}catch{_.textContent="Copy failed."}}(a))}),n.addEventListener("keydown",e=>{const t=e.target.closest(".root-package-link");t&&(" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),he(t)))}),E(),Q(),ce("list")}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",ke):ke()}();
18
- `;
17
+ exports.JS_CONTENT = `!function(){var e={"network-access":"Accesses network during install","dynamic-exec":"Uses dynamic execution","child-process":"Spawns child processes",encoding:"Uses encoding/decoding logic",obfuscated:"Contains obfuscated/minified install logic","reads-env":"Reads environment variables","reads-home":"Reads user home directory","uses-ssh":"Uses SSH configuration/keys"};function t(e){return e.critical+e.high+e.moderate+e.low}function n(e){return"runtime"===e?"Runtime":"dev"===e?"Dev":"optional"===e?"Optional":"peer"===e?"Peer":e.split(/[-_\\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function a(a,r){const s=[],i=t(r),o=a.security.advisories?.some(e=>e.fixAvailable);if(r.critical||r.high){const e=r.critical+r.high;s.push(\`\${e} critical/high \${1===e?"vulnerability":"vulnerabilities"}\${o?", fix available":""}\`)}if(r.moderate||r.low){const e=r.moderate+r.low;s.push(\`\${function(e){const t=[];return e.moderate&&t.push(\`\${e.moderate} moderate\`),e.low&&t.push(\`\${e.low} low\`),t.join(", ")}(r)} \${1===e?"vulnerability":"vulnerabilities"}\${o?", fix available":""}\`)}"green"!==a.compliance.licenseRisk&&s.push("Licence status: "+function(e){switch(e){case"declared-only":return"Declared";case"inferred-only":return"Inferred";case"match":return"Declared + Inferred (match)";case"mismatch":return"Declared + Inferred (mismatch)";case"invalid-spdx":return"Invalid SPDX";default:return"Unknown"}}(a.compliance.license.status)),a.upgrade.blocksNodeMajor&&s.push("Blocks Node major upgrade"),a.upgrade.blockers?.length&&s.push(\`\${a.upgrade.blockers.length} upgrade \${1===a.upgrade.blockers.length?"blocker":"blockers"} detected\`);const c=a.execution?.risk||"green";var l;if("green"!==c&&s.push(("red"===(l=c)?"High":"amber"===l?"Medium":"Low")+" install-time execution risk"),a.execution?.scripts?.hooks?.length&&s.push("Runs "+a.execution.scripts.hooks.slice(0,2).join(", ")+" lifecycle script"+(1===a.execution.scripts.hooks.length?"":"s")),function(e){return Array.from(new Set([...e.execution?.scripts?.signals||[],...e.execution?.signals||[]]))}(a).slice(0,3).forEach(t=>s.push(e[t])),a.packaging?.signals?.length&&s.push(\`\${a.packaging.signals.length} package content \${1===a.packaging.signals.length?"signal":"signals"}\`),a.supplyChain?.registry?.signals?.length&&s.push(\`\${a.supplyChain.registry.signals.length} registry metadata \${1===a.supplyChain.registry.signals.length?"signal":"signals"}\`),a.usage.direct)s.push(\`Direct \${n(a.usage.scope).toLowerCase()} dependency\`);else{const e=a.usage.origins.topParentPackages?.[0]?\` introduced by \${a.usage.origins.topParentPackages[0]}\`:"";s.push(\`Transitive \${n(a.usage.scope).toLowerCase()} dependency\${e}\`)}return a.usage.depth>1&&s.push(\`Dependency depth \${a.usage.depth}\`),(0===s.length||0===i&&"green"===c&&"green"===a.compliance.licenseRisk&&s.length<3)&&["No known vulnerabilities","No install-time execution signals detected","Licence status appears consistent",a.usage.direct?\`Direct \${n(a.usage.scope).toLowerCase()} dependency\`:\`Transitive \${n(a.usage.scope).toLowerCase()} dependency\`].forEach(e=>{s.includes(e)||s.push(e)}),Array.from(new Set(s)).slice(0,8)}function r(e){if(!e.workspaces.enabled)return[];const t=new Set;return(e.workspaces.workspacePackages||[]).forEach(e=>{e.name&&t.add(e.name)}),Object.values(e.dependencies||{}).forEach(e=>{(e.usage.origins.workspaces||[]).forEach(e=>{e&&t.add(e)})}),Array.from(t).sort((e,t)=>"root"===e?-1:"root"===t?1:e.localeCompare(t))}var s=2.8,i='500 11.5px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';function o(e,t,n){return Math.min(n,Math.max(t,e))}function c(e,t=!1){return t?e.length:Math.min(e.length,34)}function l(e){const t=c(e);return e.length<=34?t:Math.max(1,t-6)}function d(e){const{labelGraphemes:t}=e;if(t.length<=34)return e.ref.name;const n=o(Math.round(e.renderLabelChars),1,t.length);return n>=t.length?e.ref.name:\`\${t.slice(0,n-1).join("")}…\`}function u(e,t,n){const a=function(e){const t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})\$/i);if(n){const e=n[1];return 3===e.length?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16)}:{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}}const a=t.match(/^rgba?\\(([^)]+)\\)\$/i);if(!a)return null;const r=a[1].replace(/\\//g," ").split(/[\\s,]+/).filter(Boolean).slice(0,3);if(3!==r.length)return null;const s=e=>{if(e.endsWith("%")){const t=Number(e.slice(0,-1));return Number.isFinite(t)?o(Math.round(t/100*255),0,255):null}const t=Number(e);return Number.isFinite(t)?o(Math.round(t),0,255):null},i=s(r[0]),c=s(r[1]),l=s(r[2]);return null===i||null===c||null===l?null:{r:i,g:c,b:l}}(e);if(!a)return n;const r=o(t,0,1);return\`rgb(\${Math.round(a.r+(255-a.r)*r)}, \${Math.round(a.g+(255-a.g)*r)}, \${Math.round(a.b+(255-a.b)*r)})\`}function p(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function g(e,t,n){if(0===t.length)return;if(e.moveTo(t[0].x,t[0].y),1===t.length)return;if(2===t.length)return void e.lineTo(t[1].x,t[1].y);for(let r=1;r<t.length-1;r+=1){const a=t[r-1],s=t[r],i=t[r+1],o=s.x-a.x,c=s.y-a.y,l=i.x-s.x,d=i.y-s.y,u=Math.hypot(o,c),p=Math.hypot(l,d);if(u<.001||p<.001){e.lineTo(s.x,s.y);continue}const g=Math.min(n,.45*u,.45*p),h=s.x-o/u*g,m=s.y-c/u*g,v=s.x+l/p*g,f=s.y+d/p*g;e.lineTo(h,m),e.quadraticCurveTo(s.x,s.y,v,f)}const a=t[t.length-1];e.lineTo(a.x,a.y)}function h(e){const t=new Map;return e.nodes.forEach(e=>{const n=t.get(e.depth);n?n.push(e):t.set(e.depth,[e])}),t.forEach(e=>{e.sort((e,t)=>e.renderY-t.renderY)}),t}function m(e,t,n,a){const r=t.renderX,s=t.renderY,i=n.renderX,c=n.renderY,l=n.depth-t.depth,d=Math.abs(l);if(0===d){const n=Math.abs(r-i)<a.sameColumnXThreshold,l=Math.abs(s-c),d=t.depth<a.maxDepth;if(n&&l>a.minDetourVerticalSpan&&d){const n=a.paddingX+t.depth*a.layerGap,d=a.paddingX+(t.depth+1)*a.layerGap,u=.5*(n+d);let p=u+a.detourInset;const h=Math.min(s,c)-12,m=Math.max(s,c)+12;(function(e,t,n,a,r){const s=e.depthNodeIndex.get(t);if(!s||0===s.length)return!1;const i=function(e,t){let n=0,a=e.length;for(;n<a;){const r=n+(a-n>>1);e[r].renderY<t?n=r+1:a=r}return n}(s,n);for(let o=i;o<s.length&&s[o].renderY<=a;o+=1)if(Math.abs(s[o].renderX-r)<e.detourNodeClearance)return!0;return!1})(a,t.depth+1,h,m,p)&&(p+=12);p=o(p,u+8,d-24);const v=Math.max(1,p-r);return void g(e,[{x:r,y:s},{x:p,y:s},{x:p,y:c},{x:i,y:c}],o(.42*Math.min(v,l),16,52))}e.moveTo(r,s);const u=r+.5*(i-r),p=s+(c-s)*a.edgeCurve;return void e.quadraticCurveTo(u,p,i,c)}if(1===d){const o=Math.min(t.depth,n.depth),l=a.paddingX+o*a.layerGap+.5*a.layerGap;return e.moveTo(r,s),void e.bezierCurveTo(l,s,l,c,i,c)}const u=Math.sign(l),p=c-s,h=[{x:r,y:s}],m=a.paddingX+t.depth*a.layerGap+u*(.5*a.layerGap);h.push({x:m,y:s});for(let o=1;o<d;o+=1){const e=t.depth+u*o,n=a.paddingX+e*a.layerGap+u*(.5*a.layerGap),r=o/d;h.push({x:n,y:s+p*r})}const v=a.paddingX+n.depth*a.layerGap-u*(.5*a.layerGap);h.push({x:v,y:c}),h.push({x:i,y:c}),g(e,h,14)}function v(e,t,n,a){a&&t.highlighted?function(e,t,n){const a=t.renderX,r=t.renderY,s=n.renderX,i=n.renderY,c=s-a,l=i-r;if(e.moveTo(a,r),Math.abs(c)<18){const t=a+(r<=i?26:-26);return void e.bezierCurveTo(t,r,t,i,s,i)}const d=o(.44*Math.abs(c),42,150),u=Math.sign(c),p=o(.12*Math.abs(l),0,24);e.bezierCurveTo(a+u*d,r+p*Math.sign(l),s-u*d,i-p*Math.sign(l),s,i)}(e,t.from,t.to):m(e,t.from,t.to,n)}function f(e,t){return\`\${e}@\${t}\`}function y(e,t){return\`\${e}->\${t}\`}function k(e){if(!e||"object"!=typeof e)return!1;const t=e;if(!Array.isArray(t.workspaces))return!1;if(!t.dependencies||"object"!=typeof t.dependencies)return!1;const n=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e);return!!t.workspaces.every(e=>(e=>{if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.name&&!!Array.isArray(t.directDependencies)&&!!Array.isArray(t.directDevDependencies)})(e))&&(!!t.workspaces.every(e=>n(e.directDependencies)&&n(e.directDevDependencies))&&!!Object.entries(t.dependencies).every(([,e])=>{if(!e||"object"!=typeof e)return!1;const t=e;return!(void 0!==t.dependencies&&!Array.isArray(t.dependencies))&&!(void 0!==t.workspaceOrigins&&!Array.isArray(t.workspaceOrigins))}))}function b(e){const t=e.compliance.license.declared?.valid?e.compliance.license.declared.spdxId:void 0;return t||(e.compliance.license.inferred?.spdxId||"Unknown")}function w(e){const t=e.security?.summary;return t?Number(t.critical||0)+Number(t.high||0)+Number(t.moderate||0)+Number(t.low||0):0}function E(e){const t=e.security?.summary?.highest;return"critical"===t||"high"===t?"high":"moderate"===t?"moderate":"none"}function C(e,t){const n=new Set,a=[t];for(;a.length>0;){const t=a.pop();if(!t)continue;const r=e.nodes.get(t);r&&r.parents.forEach(e=>{n.has(e)||(n.add(e),a.push(e))})}return n}function x(e,t){const n=new Set,a=[t];for(;a.length>0;){const t=a.pop();if(!t)continue;const r=e.nodes.get(t);r&&r.children.forEach(e=>{n.has(e)||(n.add(e),a.push(e))})}return n}function S(e,t,n){const a=new Map,r=[{slug:t,distance:0}];let s=0;for(;s<r.length;){const t=r[s++],i=e.nodes.get(t.slug);i&&i[n].forEach(e=>{a.has(e)||(a.set(e,t.distance+1),r.push({slug:e,distance:t.distance+1}))})}return a}function L(e){const t=function(e,t,n){const a=window.__DEPENDENCY_DATA__;if(k(a)){const e={};return Object.entries(a.dependencies).forEach(([t,n])=>{const a=n,r=a.vulnerabilitySeverity||a.vulnerabilityHighest||a.highestSeverity||"none",s=String(r).trim().toLowerCase();let i="none";"critical"===s||"high"===s?i="high":"moderate"!==s&&"medium"!==s||(i="moderate"),e[t]={slug:String(a.slug||t),name:String(a.name||t),version:String(a.version||""),dependencies:Array.isArray(a.dependencies)?a.dependencies.map(e=>String(e)):[],license:String(a.license||"Unknown"),vulnerabilityCount:Number(a.vulnerabilityCount||0),vulnerabilitySeverity:i,isDevOnly:Boolean(a.isDevOnly),workspaceOrigins:Array.isArray(a.workspaceOrigins)?a.workspaceOrigins.map(e=>String(e)):[]}}),{workspaces:a.workspaces,dependencies:e}}const r={},s=Object.values(e.dependencies||{});s.forEach(e=>{const t=f(e.package.name,e.package.version);r[t]={slug:t,name:e.package.name,version:e.package.version,dependencies:[],license:b(e),vulnerabilityCount:w(e),vulnerabilitySeverity:E(e),isDevOnly:"dev"===e.usage.scope,workspaceOrigins:e.usage.origins.workspaces||[]}}),s.forEach(e=>{const a=f(e.package.name,e.package.version),s=e.graph.subDeps;if(!s)return;const i=new Set;["dep","dev","opt","peer"].forEach(e=>{const o=s[e];o&&Object.values(o).forEach(e=>{const s=e[1];if(!s)return;const o=n(s);o&&t.has(o)&&r[o]&&o!==a&&i.add(o)})}),r[a].dependencies=[...i]});const i=new Map,o=e=>{const t=i.get(e);if(t)return t;const n={directDependencies:new Set,directDevDependencies:new Set};return i.set(e,n),n};return o("root"),(e.workspaces.workspacePackages||[]).forEach(e=>{o(e.name)}),s.forEach(e=>{if(!e.usage.direct)return;const t=f(e.package.name,e.package.version);(e.usage.origins.workspaces?.length?e.usage.origins.workspaces:["root"]).forEach(n=>{const a=o(n);"dev"===e.usage.scope?a.directDevDependencies.add(t):a.directDependencies.add(t)})}),{workspaces:[...i.entries()].map(([e,t])=>({name:e,directDependencies:[...t.directDependencies],directDevDependencies:[...t.directDevDependencies]})).sort((e,t)=>e.name.localeCompare(t.name)),dependencies:r}}(e.report,e.knownDepKeys,e.resolveDepKey),n=new Map(t.workspaces.map(e=>[e.name,e])),a=new Map,r=new Map;Object.values(t.dependencies).forEach(e=>{const n=(e.dependencies||[]).filter(n=>n!==e.slug&&Boolean(t.dependencies[n]));r.set(e.slug,n),n.forEach(t=>{const n=a.get(t)||[];n.push(e.slug),a.set(t,n)})});let g=null,m="",L=null,I=null,M=new Set,P=new Set,Y=new Set,D=new Map,X=null,A=null,B=new Set,N=new Set,T=null,j=1,R=0,V=0,\$=1,H=.1,O=0,F=0,W=null,G=null,U=!1,_=!0,q=0,z=Math.max(1,Math.floor(window.devicePixelRatio||1)),K=1,J=1;const Z={down:!1,moved:!1,startX:0,startY:0,startPanX:0,startPanY:0},Q={active:!1,startX1:0,startY1:0,startX2:0,startY2:0,startPanX:0,startPanY:0,startDist:0,startZoom:0,anchorX:null,anchorY:null},ee={active:!1,velocityX:0,velocityY:0,lastSampleX:0,lastSampleY:0,lastSampleTime:0,lastFrameTime:0},te=e.canvas.getContext("2d"),ne=Boolean(te);let ae=!1,re=!1,se=!1,ie=null,oe=null,ce=null,le=!1;const de="function"==typeof window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null;let ue={runtime:"#10b981",runtimeHighlight:"#34d399",dev:"#f59e0b",devHighlight:"#fcd34d",transitive:"#06b6d4",transitiveHighlight:"#67e8f9",edge:"#64748b",highlight:"#22d3ee",muted:"#64748b",ringHigh:"#ef4444",ringModerate:"#f59e0b",label:"#e8edf5",backgroundPrimary:"#0c1222"};function pe(){const e=p("--graph-direct-runtime")||"#10b981",t=p("--graph-direct-dev")||"#f59e0b",n=p("--graph-transitive")||"#06b6d4";ue={runtime:e,runtimeHighlight:u(e,.2,"#34d399"),dev:t,devHighlight:u(t,.28,"#fcd34d"),transitive:n,transitiveHighlight:u(n,.38,"#67e8f9"),edge:p("--graph-edge")||"#64748b",highlight:p("--graph-highlight")||"#22d3ee",muted:p("--graph-muted")||"#64748b",ringHigh:p("--graph-vuln-high")||"#ef4444",ringModerate:p("--graph-vuln-medium")||"#f59e0b",label:p("--text-primary")||"#e8edf5",backgroundPrimary:p("--bg-primary")||"#0c1222"}}function ge(){if(le)return;le=!0,console.warn("Dependency Radar: unable to initialize 2D canvas; graph rendering disabled."),e.controlsRoot.classList.add("hidden"),e.workspaceWrap.classList.add("hidden"),e.canvas.style.display="none";const t=document.createElement("div");t.className="empty-state";const n=document.createElement("div");n.className="empty-state-text",n.textContent="Graph view is unavailable in this browser context.",t.appendChild(n),e.canvasHost.appendChild(t)}function he(e){return(e-R)/j}function me(e){return(e-V)/j}function ve(e,t){if(!g)return{x:e,y:t};const n=g.bounds.minX-120,a=g.bounds.maxX+120,r=g.bounds.minY-90,s=g.bounds.maxY+90,i=Math.min(.22*K,220),c=Math.min(.22*J,180),l=i-a*j,d=K-i-n*j,u=c-s*j,p=J-c-r*j;return{x:l>d? .5*(l+d):o(e,l,d),y:u>p? .5*(u+p):o(t,u,p)}}function fe(e,t){const n=ve(e,t);R=n.x,V=n.y}function ye(){W=null,G=null}function ke(e,t,n){Ee(),ye();const a=o(e,H,s),r=he(t),i=me(n);j=a,fe(t-r*j,n-i*j),_=!0,qe()}function be(e,t){Ee(),ye(),fe(R+e,V+t),_=!0,qe()}function we(){return!de?.matches}function Ee(){ee.active=!1,ee.velocityX=0,ee.velocityY=0,ee.lastFrameTime=0}function Ce(e,t,n){ee.lastSampleX=e,ee.lastSampleY=t,ee.lastSampleTime=n}function xe(e,t,n){const a=n-ee.lastSampleTime;if(a<=0)return void Ce(e,t,n);const r=(e-ee.lastSampleX)/a,s=(t-ee.lastSampleY)/a;ee.velocityX+=.22*(r-ee.velocityX),ee.velocityY+=.22*(s-ee.velocityY),Ce(e,t,n)}function Se(){we()?Math.hypot(ee.velocityX,ee.velocityY)<.08?Ee():(ee.active=!0,ee.lastFrameTime=performance.now(),Re(!1),qe()):Ee()}function Le(){const t=e.canvasHost.getBoundingClientRect();K=Math.max(1,Math.floor(t.width)),J=Math.max(1,Math.floor(t.height)),z=Math.max(1,Math.floor(window.devicePixelRatio||1)),e.canvas.width=K*z,e.canvas.height=J*z,e.canvas.style.width=\`\${K}px\`,e.canvas.style.height=\`\${J}px\`;const n=e.canvasHost.querySelector(".graph-overlay-top"),a=n?Math.ceil(n.getBoundingClientRect().height):50;e.canvasHost.style.setProperty("--graph-toolbar-height",\`\${a}px\`),_=!0,qe()}function Ie(){if(!g)return;const e=g.bounds;let t=e.maxX;te&&(te.save(),te.font=i,g.nodes.forEach(e=>{const n=d(e);if(!n)return;const a=te.measureText(n).width;t=Math.max(t,e.baseX+e.radius+6+a)}),te.restore());const n=Math.max(1,e.maxY-e.minY),a=K/Math.max(1,t-e.minX),r=J/n;\$=o(Math.min(a,r),.05,s),H=o(.64*\$,.05,s),O=.5*(K-Math.max(1,t-e.minX)*\$)-e.minX*\$,F=.5*(J-n*\$)-e.minY*\$}function Me(t,n){if(!g)return null;const a=e.canvas.getBoundingClientRect();if(t<a.left||t>a.right||n<a.top||n>a.bottom)return null;const r=he(t-a.left),s=me(n-a.top);let i=null,o=1/0;return g.nodes.forEach(e=>{const t=r-e.renderX,n=s-e.renderY,a=Math.sqrt(t*t+n*n);a<=e.renderRadius+5&&a<o&&(o=a,i=e)}),i}function Pe(t){e.canvas.classList.toggle("is-clickable",t&&!Z.down&&!Q.active)}function Ye(t=!1){Pe(!1),t&&e.canvas.classList.remove("is-panning")}function De(e,t){const n=Me(e,t);return \$e(n?n.slug:null),Pe(Boolean(n)),n}function Xe(e){const s=n.get(e);if(!s)return null;const i=new Set(s.directDependencies.filter(e=>Boolean(t.dependencies[e]))),o=new Set(s.directDevDependencies.filter(e=>Boolean(t.dependencies[e]))),d=new Set([...i,...o]);0===d.size&&Object.keys(t.dependencies).filter(e=>0===(a.get(e)||[]).length).slice(0,40).forEach(e=>{d.add(e)});const u=new Set,p=[...d];let g=0;for(;g<p.length;){const e=p[g++];e&&(u.has(e)||t.dependencies[e]&&(u.add(e),(r.get(e)||[]).forEach(e=>{u.has(e)||p.push(e)})))}if(0===u.size)return null;const h=new Map;u.forEach(e=>{const n=i.has(e)?"direct-runtime":o.has(e)?"direct-dev":"transitive",a=Array.from(t.dependencies[e].name);h.set(e,{slug:e,ref:t.dependencies[e],labelGraphemes:a,parents:new Set,children:new Set,depth:Number.POSITIVE_INFINITY,order:0,amplification:0,kind:n,baseX:0,baseY:0,targetX:0,targetY:0,renderX:0,renderY:0,radius:8,targetRadius:8,renderRadius:8,targetLabelChars:c(a),renderLabelChars:l(a)})}),h.forEach(e=>{(a.get(e.slug)||[]).forEach(t=>{h.has(t)&&e.parents.add(t)}),(r.get(e.slug)||[]).forEach(t=>{h.has(t)&&e.children.add(t)})});const m=[];for(d.forEach(e=>{const t=h.get(e);t&&(t.depth=0,m.push(e))});m.length>0;){const e=m.shift();if(!e)continue;const t=h.get(e);t&&t.children.forEach(e=>{const n=h.get(e);if(!n)return;const a=t.depth+1;a>=n.depth||(n.depth=a,m.push(e))})}h.forEach(e=>{if(Number.isFinite(e.depth))return;let t=Number.POSITIVE_INFINITY;e.parents.forEach(e=>{const n=h.get(e);n&&Number.isFinite(n.depth)&&(t=Math.min(t,n.depth+1))}),e.depth=Number.isFinite(t)?t:0});const v=[...h.values()].reduce((e,t)=>Math.max(e,t.depth),0),f=Array.from({length:v+1},()=>[]);h.forEach(e=>{f[e.depth].push(e.slug)});const y=[];h.forEach(e=>{e.children.forEach(t=>{y.push({from:e.slug,to:t,direct:0===e.depth})})});const k={workspaceName:e,nodes:h,edges:y,layers:f,directRuntime:i,directDev:o,directAll:new Set([...i,...o]),bounds:{minX:0,maxX:1,minY:0,maxY:1}};return Ae(k),Be(k),k}function Ae(e){e.nodes.forEach(e=>{e.amplification=0}),e.nodes.forEach(t=>{if(0!==t.depth)return;if(!e.directAll.has(t.slug))return;const n=new Set,a=[...t.children];for(;a.length>0;){const r=a.pop();if(!r)continue;if(r===t.slug)continue;if(n.has(r))continue;n.add(r);const s=e.nodes.get(r);s&&s.children.forEach(e=>{n.has(e)||a.push(e)})}t.amplification=n.size})}function Be(e){const t=new Map;e.layers.forEach((n,a)=>{0===a?n.sort((t,n)=>{const a=e.nodes.get(t),r=e.nodes.get(n);if(!a&&!r)return 0;if(!a)return 1;if(!r)return-1;if(a.amplification!==r.amplification)return r.amplification-a.amplification;if(a.kind!==r.kind){if("direct-runtime"===a.kind)return-1;if("direct-runtime"===r.kind)return 1}return a.ref.name.localeCompare(r.ref.name)}):n.sort((n,a)=>{const r=e.nodes.get(n),s=e.nodes.get(a);if(!r&&!s)return 0;if(!r)return 1;if(!s)return-1;const i=(()=>{let e=0,n=0;return r.parents.forEach(a=>{const r=t.get(a);"number"==typeof r&&(e+=1,n+=r)}),e>0?n/e:Number.MAX_SAFE_INTEGER})(),o=(()=>{let e=0,n=0;return s.parents.forEach(a=>{const r=t.get(a);"number"==typeof r&&(e+=1,n+=r)}),e>0?n/e:Number.MAX_SAFE_INTEGER})();return i!==o?i-o:r.ref.name.localeCompare(s.ref.name)}),n.forEach((e,n)=>{t.set(e,n)})});const n=e.layers.reduce((e,t)=>Math.max(e,t.length),1);e.bounds={minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY},e.layers.forEach((t,a)=>{const r=Math.max(0,43*(t.length-1)),s=64+.5*(43*n-r);t.forEach((t,n)=>{const r=e.nodes.get(t);if(!r)return;r.order=n,r.baseX=96+240*a,r.baseY=s+43*n,r.targetX=r.baseX,r.targetY=r.baseY,r.renderX=r.baseX,r.renderY=r.baseY;const i=.55*Math.log(r.children.size+r.parents.size+1),o=0===r.depth&&e.directAll.has(r.slug)?1.05*Math.log(r.amplification+1):0;r.radius=6.7+i+o,r.targetRadius=r.radius,r.renderRadius=r.radius,r.targetLabelChars=c(r.labelGraphemes),r.renderLabelChars=l(r.labelGraphemes),e.bounds.minX=Math.min(e.bounds.minX,r.baseX),e.bounds.maxX=Math.max(e.bounds.maxX,r.baseX),e.bounds.minY=Math.min(e.bounds.minY,r.baseY),e.bounds.maxY=Math.max(e.bounds.maxY,r.baseY)})}),Number.isFinite(e.bounds.minX)||(e.bounds={minX:0,maxX:1,minY:0,maxY:1})}function Ne(e,t){if(!g)return;const n=o(Math.max(j,1.35*\$),H,s);j+=(n-j)*(de?.matches?1:.35),function(e,t){const n=ve(e,t);W=n.x,G=n.y}(.46*K-e*j,.5*J-t*j)}function Te(e){if(!g||!g.nodes.has(e))return;Ee(),L=e;const t=C(g,e),n=x(g,e);M=new Set([e]),t.forEach(e=>{M.add(e)}),n.forEach(e=>{M.add(e)}),P=new Set;const a=[e],r=new Set([e]);for(;a.length>0;){const e=a.pop();if(!e)continue;const t=g.nodes.get(e);t&&t.parents.forEach(t=>{P.add(y(t,e)),r.has(t)||(r.add(t),a.push(t))})}const s=[e],i=new Set([e]);for(;s.length>0;){const e=s.pop();if(!e)continue;const t=g.nodes.get(e);t&&t.children.forEach(t=>{P.add(y(e,t)),i.has(t)||(i.add(t),s.push(t))})}Y=new Set(M);const c=g.nodes.get(e);c.parents.forEach(e=>{Y.add(e)}),c.children.forEach(e=>{Y.add(e)});const l=null===X||null===A,d=!l&&Boolean(T)&&M.has(T);!l&&d||(X=c.renderX,A=c.renderY),D=function(e,t,n,a){const r=new Map,s=S(e,t,"parents"),i=S(e,t,"children"),c=new Map;return r.set(t,{x:n,y:a}),M.forEach(a=>{if(a===t)return;const r=e.nodes.get(a);if(!r)return;const o=s.get(a),l=i.get(a);let d=0;"number"==typeof o&&("number"!=typeof l||o<=l)?d=-o:"number"==typeof l&&(d=l),0===d&&(d=r.baseX<n?-1:1);const u=c.get(d)||[];u.push(r),c.set(d,u)}),c.forEach((e,t)=>{e.sort((e,n)=>{const a=t<0?s.get(e.slug)||0:i.get(e.slug)||0,r=t<0?s.get(n.slug)||0:i.get(n.slug)||0;return a!==r?a-r:e.baseY!==n.baseY?e.baseY-n.baseY:e.ref.name.localeCompare(n.ref.name)});const c=o(760/Math.max(1,e.length-1),34,54),l=a-(e.length-1)*c*.5;e.forEach((e,a)=>{const s=170*(1+.78*Math.max(0,Math.abs(t)-1));r.set(e.slug,{x:n+Math.sign(t)*s,y:l+a*c})})}),r}(g,e,X??c.renderX,A??c.renderY),Ne(X??c.renderX,A??c.renderY),_=!0,qe()}function je(){L=null,M=new Set,P=new Set,Y=new Set,D=new Map,X=null,A=null,ye(),_=!0,qe()}function Re(e=!0){I=null,B=new Set,N=new Set,e&&(_=!0,qe())}function Ve(){if(!g)return;const e=L&&g.nodes.get(L)||null;g.nodes.forEach(t=>{t.targetRadius=function(e){const t=L===e.slug,n=M.has(e.slug);let a=e.radius;t?a*=1.85:L&&n?a*=1.22:L&&!n?a*=.84:I&&B.has(e.slug)?a*=1.1:I&&(a*=.9);return a}(t),t.targetLabelChars=c(t.labelGraphemes,Boolean(L)&&M.has(t.slug)||!L&&Boolean(I)&&B.has(t.slug));const n=D.get(t.slug);if(e&&n)return t.targetX=n.x,void(t.targetY=n.y);if(!e||!Y.has(t.slug))return t.targetX=t.baseX,void(t.targetY=t.baseY);const a=t.baseX-e.baseX,r=t.baseY-e.baseY,s=1+120/(Math.sqrt(a*a+r*r)+1);t.targetX=e.baseX+a*s,t.targetY=e.baseY+r*s})}function \$e(e){if(L)return;if(I=e,B=new Set,N=new Set,!g||!e||!g.nodes.has(e))return _=!0,void qe();const t=C(g,e),n=x(g,e);B=new Set([e]),t.forEach(e=>{B.add(e)}),n.forEach(e=>{B.add(e)});const a=g.nodes.get(e);a&&(a.parents.forEach(e=>{B.add(e)}),a.children.forEach(e=>{B.add(e)})),g.edges.forEach(e=>{B.has(e.from)&&B.has(e.to)&&N.add(y(e.from,e.to))}),_=!0,qe()}function He(t){if(!g)return;const n=g.nodes.get(t);if(!n)return;const a=0===n.depth&&g.directAll.has(n.slug);T=t,e.popoverName.textContent=n.ref.name,e.popoverVersion.textContent=\`Version: \${n.ref.version}\`,e.popoverLicense.textContent=\`License: \${n.ref.license||"Unknown"}\`,e.popoverVulns.textContent=\`Vulnerabilities: \${n.ref.vulnerabilityCount||0}\`,e.popoverAmplification.textContent=a?\`Amplification: \${n.amplification}\`:\`Dependencies: \${n.children.size} • Dependents: \${n.parents.size}\`,e.popover.hidden=!1,Fe()}function Oe(){T=null,e.popover.hidden=!0}function Fe(){if(!g||!T||e.popover.hidden)return;const t=g.nodes.get(T);if(!t)return void Oe();const n=t.renderX*j+R,a=t.renderY*j+V,r=e.canvasHost.getBoundingClientRect(),s=e.popover.getBoundingClientRect(),i=Math.max(8,r.width-s.width-8),c=Math.max(8,r.height-s.height-8),l=o(n+14,8,i),d=o(a+14,8,c);e.popover.style.left=\`\${l}px\`,e.popover.style.top=\`\${d}px\`}function We(e){return L?M.has(e)?1:.14:I?B.has(e)?1:.16:.95}function Ge(){if(!te)return;if(te.setTransform(z,0,0,z,0,0),te.clearRect(0,0,K,J),!g)return;const e=g,t=he(0)-80,n=he(K)+80,a=me(0)-80,r=me(J)+80;te.setTransform(z*j,0,0,z*j,z*R,z*V);const s=ue.runtime,c=ue.dev,l=ue.transitive,u=ue.edge,p=ue.highlight,m=ue.muted,f=ue.ringHigh,k=ue.ringModerate,b=ue.label,w=ue.backgroundPrimary,E=new Set;e.nodes.forEach(e=>{const s=Math.max(e.radius,e.renderRadius);e.renderX+s>=t&&e.renderX-s<=n&&e.renderY+s>=a&&e.renderY-s<=r&&E.add(e.slug)});const C=[];let x=0;e.nodes.forEach(e=>{if(!E.has(e.slug))return;let t=0;L===e.slug?t=2:(M.has(e.slug)||B.has(e.slug))&&(t=1),C.push({node:e,priority:t,order:x++})}),C.sort((e,t)=>e.priority-t.priority||e.order-t.order);const S=Math.max(0,e.layers.length-1),Y={depthNodeIndex:h(e),maxDepth:S,sameColumnXThreshold:6,minDetourVerticalSpan:80,detourInset:14,detourNodeClearance:26,paddingX:96,layerGap:240,edgeCurve:.2},D=[];e.edges.forEach(t=>{const n=e.nodes.get(t.from),a=e.nodes.get(t.to);if(!n||!a)return;if(!E.has(n.slug)&&!E.has(a.slug))return;const r=y(t.from,t.to);D.push({from:n,to:a,highlighted:P.has(r)||!L&&N.has(r),span:Math.abs(a.depth-n.depth)})}),D.sort((e,t)=>t.span-e.span),te.globalCompositeOperation="source-over",te.strokeStyle=L||I?m:u,te.lineWidth=1.05,te.globalAlpha=L||I? .04*o((j-.35)/.9,.75,1):.25*o((j-.35)/.9,.2,1),te.beginPath(),D.forEach(e=>{e.highlighted||v(te,e,Y,Boolean(L))}),te.stroke(),te.globalCompositeOperation="lighter",te.strokeStyle=p,te.lineWidth=1.2,te.globalAlpha=.36*o((j-.35)/.9,.2,1),te.beginPath(),D.forEach(e=>{e.highlighted&&v(te,e,Y,Boolean(L))}),te.stroke(),te.globalCompositeOperation="source-over";const X=e=>{const t=L===e.slug,n=e.renderRadius;te.globalAlpha=1,te.fillStyle=w,te.beginPath(),te.arc(e.renderX,e.renderY,n,0,2*Math.PI),te.fill(),te.globalAlpha=We(e.slug);const a=te.createRadialGradient(e.renderX-.3*n,e.renderY-.3*n,0,e.renderX,e.renderY,1.2*n);"direct-runtime"===e.kind?(a.addColorStop(0,ue.runtimeHighlight),a.addColorStop(1,s)):"direct-dev"===e.kind?(a.addColorStop(0,ue.devHighlight),a.addColorStop(1,c)):(a.addColorStop(0,ue.transitiveHighlight),a.addColorStop(1,l)),te.fillStyle=a,te.beginPath(),te.arc(e.renderX,e.renderY,n,0,2*Math.PI),te.fill(),t&&(te.globalAlpha=.95,te.strokeStyle=p,te.lineWidth=1.5,te.beginPath(),te.arc(e.renderX,e.renderY,n+4,0,2*Math.PI),te.stroke())},A=e=>{if(!e.ref.vulnerabilityCount||e.ref.vulnerabilityCount<=0)return;if("none"===e.ref.vulnerabilitySeverity)return;const t=e.renderRadius,n="high"===e.ref.vulnerabilitySeverity?f:k;var a;te.save(),te.translate(e.renderX,e.renderY),te.globalAlpha=(a=e.slug,L?M.has(a)? .78:.11:I?B.has(a)? .76:.12:.8),te.strokeStyle=n;const r=t/e.radius,s=t/3*1.2/12,i=1.2*s+3*(r-1),o=Math.max(.5*s,.15),c=Math.max(1*s,.3),l=Math.max(3*s,.8),d=Math.max(1*s,.3),u=Math.max(.5*s,.15),p=t+(2+6*(r-1))+o/2,g=p+o/2+i+c/2,h=g+c/2+i+l/2,m=h+l/2+i+d/2,v=m+d/2+i+u/2;te.setLineDash([]),te.lineWidth=u,te.beginPath(),te.arc(0,0,v,0,2*Math.PI),te.stroke(),te.lineWidth=d,te.beginPath(),te.arc(0,0,m,0,2*Math.PI),te.stroke(),te.lineWidth=l,te.beginPath(),te.arc(0,0,h,0,2*Math.PI),te.stroke(),te.lineWidth=c,te.beginPath(),te.arc(0,0,g,0,2*Math.PI),te.stroke(),te.lineWidth=o,te.beginPath(),te.arc(0,0,p,0,2*Math.PI),te.stroke(),te.restore()};for(const i of[0,1,2])C.forEach(({node:e,priority:t})=>{t===i&&X(e)}),C.forEach(({node:e,priority:t})=>{t===i&&A(e)});te.textBaseline="middle",te.font=i,te.fillStyle=b,C.forEach(({node:e})=>{(e=>{const t=d(e);t&&(te.globalAlpha=We(e.slug),te.fillText(t,e.renderX+e.renderRadius+6,e.renderY))})(e)}),te.globalAlpha=1,Fe()}function Ue(){if(!U)return void(q=0);Ve();const e=function(){if(!g)return!1;let e=!1;const t=de?.matches;return g.nodes.forEach(n=>{if(t)return n.renderX=n.targetX,n.renderY=n.targetY,n.renderRadius=n.targetRadius,void(n.renderLabelChars=n.targetLabelChars);const a=L? .18:.15;n.renderX+=(n.targetX-n.renderX)*a,n.renderY+=(n.targetY-n.renderY)*a,n.renderRadius+=.18*(n.targetRadius-n.renderRadius),n.renderLabelChars+=.32*(n.targetLabelChars-n.renderLabelChars),Math.abs(n.targetX-n.renderX)<.06&&Math.abs(n.targetY-n.renderY)<.06&&Math.abs(n.targetRadius-n.renderRadius)<.04&&Math.abs(n.targetLabelChars-n.renderLabelChars)<.12||(e=!0)}),e}(),t=function(e){if(!ee.active)return!1;if(!we())return Ee(),!1;const t=o(e-ee.lastFrameTime||16,1,32);ee.lastFrameTime=e,fe(R+ee.velocityX*t,V+ee.velocityY*t);const n=Math.exp(-.0042*t);return ee.velocityX*=n,ee.velocityY*=n,_=!0,!(Math.hypot(ee.velocityX,ee.velocityY)<.02&&(Ee(),1))}(performance.now()),n=null!==W&&null!==G&&(de?.matches?(fe(W,G),ye(),_=!0,!1):(R+=.12*(W-R),V+=.12*(G-V),fe(R,V),Math.abs((W??R)-R)<.35&&Math.abs((G??V)-V)<.35?(fe(W,G),ye(),_=!0,!1):(_=!0,!0)));if(_||e||t||n)return Ge(),_=!1,void(q=U&&(_||e||t||n)?window.requestAnimationFrame(Ue):0);q=0}function _e(){U&&!q&&_&&(q=window.requestAnimationFrame(Ue))}function qe(){_=!0,U&&_e()}function ze(e){const t=Xe(e);t&&(Ee(),m=e,g=t,je(),Oe(),I=null,B=new Set,N=new Set,Ye(!0),g&&(Ee(),ye(),Ie(),j=\$,fe(O,F)),_=!0,qe())}function Ke(t){0===t.button&&(Ee(),ye(),Z.down=!0,Z.moved=!1,Z.startX=t.clientX,Z.startY=t.clientY,Z.startPanX=R,Z.startPanY=V,Ce(t.clientX,t.clientY,t.timeStamp),Ye(),e.canvas.classList.add("is-panning"))}function Je(e){if(!Z.down)return void De(e.clientX,e.clientY);const t=e.clientX-Z.startX,n=e.clientY-Z.startY;(Math.abs(t)>2||Math.abs(n)>2)&&(Z.moved=!0),fe(Z.startPanX+t,Z.startPanY+n),xe(e.clientX,e.clientY,e.timeStamp),qe()}function Ze(t){if(!Z.down)return;e.canvas.classList.remove("is-panning");const n=Z.moved;if(Z.down=!1,Z.moved=!1,n)return Se(),ee.active?void Pe(!1):void De(t.clientX,t.clientY);const a=De(t.clientX,t.clientY);if(!a)return Re(!1),je(),void Oe();Te(a.slug),He(a.slug)}function Qe(t){if(!e.canvasHost.contains(t.target))return;t.preventDefault(),Ee();const n=e.canvas.getBoundingClientRect(),a=t.clientX-n.left,r=t.clientY-n.top,s=t.ctrlKey||t.metaKey? .015*t.deltaY:.002*t.deltaY,i=Math.exp(-s);ke(j*i,a,r)}function et(t){if(0===t.touches.length)return;t.preventDefault(),Ee(),ye(),Ye();const n=e.canvas.getBoundingClientRect();if(1===t.touches.length)Q.active=!0,Z.moved=!1,Q.startX1=t.touches[0].clientX,Q.startY1=t.touches[0].clientY,Q.startPanX=R,Q.startPanY=V,Ce(t.touches[0].clientX,t.touches[0].clientY,t.timeStamp),e.canvas.classList.add("is-panning");else if(2===t.touches.length){Q.active=!0,Z.moved=!1,Q.startX1=t.touches[0].clientX,Q.startY1=t.touches[0].clientY,Q.startX2=t.touches[1].clientX,Q.startY2=t.touches[1].clientY;const e=Q.startX2-Q.startX1,a=Q.startY2-Q.startY1;Q.startDist=Math.sqrt(e*e+a*a),Q.startZoom=j;const r=(Q.startX1+Q.startX2)/2,s=(Q.startY1+Q.startY2)/2,i=r-n.left,o=s-n.top;Q.anchorX=i,Q.anchorY=o}}function tt(e){if(Q.active)if(e.preventDefault(),1===e.touches.length){const t=e.touches[0].clientX-Q.startX1,n=e.touches[0].clientY-Q.startY1;(Math.abs(t)>2||Math.abs(n)>2)&&(Z.moved=!0),fe(Q.startPanX+t,Q.startPanY+n),xe(e.touches[0].clientX,e.touches[0].clientY,e.timeStamp),qe()}else if(2===e.touches.length){Ee(),Z.moved=!0;const t=e.touches[0].clientX,n=e.touches[0].clientY,a=e.touches[1].clientX-t,r=e.touches[1].clientY-n,s=Math.sqrt(a*a+r*r);if(Q.startDist>0){const e=s/Q.startDist;ke(Q.startZoom*e,Q.anchorX??K/2,Q.anchorY??J/2)}}}function nt(e){if(Q.active){if(e.preventDefault(),"touchcancel"===e.type)return Ee(),Ye(!0),Q.active=!1,Q.anchorX=null,Q.anchorY=null,void(Z.moved=!1);if(0===e.touches.length){if(Ye(!0),Q.active=!1,Q.anchorX=null,Q.anchorY=null,Z.moved||1!==e.changedTouches.length)Z.moved&&Se();else{const t=Me(e.changedTouches[0].clientX,e.changedTouches[0].clientY);t?(Te(t.slug),He(t.slug)):(Re(!1),je(),Oe())}Z.moved=!1}else 1===e.touches.length&&(Q.startX1=e.touches[0].clientX,Q.startY1=e.touches[0].clientY,Q.startPanX=R,Q.startPanY=V,Ce(e.touches[0].clientX,e.touches[0].clientY,e.timeStamp))}}function at(){\$e(null),Ye()}function rt(t){if(!U)return;const n=t.target;e.popover.hidden||e.popover.contains(n)||e.canvasHost.contains(n)||Oe()}function st(e){const t=e.target.closest("button[data-action]");if(!t)return;const n=t.dataset.action;n&&("zoom-in"!==n?"zoom-out"!==n?"pan-left"!==n?"pan-right"!==n?"pan-up"!==n?"pan-down"!==n?"reset"===n&&(Ee(),j=\$,fe(O,F),je(),Oe(),qe()):be(0,52):be(0,-52):be(52,0):be(-52,0):ke(j/1.18,.5*K,.5*J):ke(1.18*j,.5*K,.5*J))}function it(){T&&e.onOpenList(T)}function ot(){ze(e.workspaceSelect.value)}function ct(){U&&(Le(),K<=1||J<=1||(Ie(),j=o(j,H,s),fe(R,V),qe()))}function lt(){se||(e.workspaceSelect.addEventListener("change",ot),se=!0),re||(e.controlsRoot.addEventListener("click",st),e.popoverOpenButton.addEventListener("click",it),re=!0)}return{initGraphView:function(){const a=t.workspaces.length?t.workspaces:[{name:"root",directDependencies:[],directDevDependencies:[]}],r=a.find(e=>"root"===e.name),s=r?[r,...a.filter(e=>"root"!==e.name)]:a;e.workspaceSelect.textContent="",s.forEach((t,n)=>{const a=document.createElement("option");if(a.value=t.name,a.textContent="root"===t.name?"Workspace root":t.name,e.workspaceSelect.appendChild(a),"root"===t.name&&s.length>1&&0===n){const t=document.createElement("option");t.disabled=!0,t.textContent="──────────────",e.workspaceSelect.appendChild(t)}}),e.workspaceWrap.classList.toggle("hidden",a.length<=1),n.has("root")||1!==a.length||n.set("root",a[0]),m=s[0].name,e.workspaceSelect.value=m,pe(),function(){if(ie&&ie.disconnect(),ie=new MutationObserver(()=>{pe(),qe()}),ie.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),oe&&(oe.disconnect(),oe=null),ce&&(window.removeEventListener("resize",ce),ce=null),"undefined"!=typeof ResizeObserver)return oe=new ResizeObserver(ct),void oe.observe(e.canvasHost);ce=ct,window.addEventListener("resize",ce)}(),lt(),ne?(Le(),ze(m)):ge()},buildWorkspaceGraph:Xe,computeAmplification:Ae,layoutGraph:Be,renderLoop:_e,applyFocus:Te,clearFocus:je,showPopover:He,hidePopover:Oe,switchWorkspace:ze,setActive:function(t){if(U=t,U)return ne?(!ae&&ne&&(e.canvas.addEventListener("mousedown",Ke),window.addEventListener("mousemove",Je),window.addEventListener("mouseup",Ze),e.canvas.addEventListener("wheel",Qe,{passive:!1}),e.canvas.addEventListener("touchstart",et,{passive:!1}),window.addEventListener("touchmove",tt,{passive:!1}),window.addEventListener("touchend",nt,{passive:!1}),window.addEventListener("touchcancel",nt,{passive:!1}),e.canvas.addEventListener("mouseleave",at),document.addEventListener("mousedown",rt),ae=!0),Le(),K>1&&J>1&&(Ie(),j=o(j,H,s),fe(R,V)),_e(),void qe()):void ge();ae&&(e.canvas.removeEventListener("mousedown",Ke),window.removeEventListener("mousemove",Je),window.removeEventListener("mouseup",Ze),e.canvas.removeEventListener("wheel",Qe),e.canvas.removeEventListener("touchstart",et),window.removeEventListener("touchmove",tt),window.removeEventListener("touchend",nt),window.removeEventListener("touchcancel",nt),e.canvas.removeEventListener("mouseleave",at),document.removeEventListener("mousedown",rt),Ye(!0),Z.down=!1,Z.moved=!1,Q.active=!1,Q.anchorX=null,Q.anchorY=null,Ee(),ae=!1),Ee(),q&&(window.cancelAnimationFrame(q),q=0)},requestRender:qe}}var I={permissive:["MIT","ISC","BSD-2-Clause","BSD-3-Clause","Apache-2.0","Unlicense","0BSD","CC0-1.0","BSD","Apache","Apache 2.0","Apache License 2.0","MIT License","ISC License"],weakCopyleft:["LGPL-2.1","LGPL-3.0","LGPL-2.0","LGPL","MPL-2.0","MPL-1.1","MPL","EPL-1.0","EPL-2.0","EPL"],strongCopyleft:["GPL-2.0","GPL-3.0","GPL","AGPL-3.0","AGPL","GPL-2.0-only","GPL-3.0-only","GPL-2.0-or-later","GPL-3.0-or-later"]},M={"network-access":"Accesses the network during install","dynamic-exec":"Uses dynamic execution","child-process":"Spawns child processes",encoding:"Uses encoding/decoding logic",obfuscated:"Contains obfuscated/minified install logic","reads-env":"Reads environment variables","reads-home":"Reads user home directory","uses-ssh":"Uses SSH configuration/keys"},P={"bundled-dependencies":"Declares bundled dependencies","embedded-shrinkwrap":"Contains embedded npm-shrinkwrap.json"},Y={"recent-package":"Recently created package","recent-version":"Recently published installed version","low-release-history":"Low release history","reactivated-package":"Reactivated after dormancy","old-major-new-patch":"Recent patch on older major line"};function D(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e}function X(e){const t=e.compliance.license,n=t.declared?.valid?t.declared.spdxId:void 0,a=t.inferred?.spdxId;return n?{value:n,isInferred:!1}:a?{value:a,isInferred:!0}:{value:"Unknown",isInferred:!1}}function A(e){const t=e.security;if(t?.summary)return{summary:t.summary,advisories:t.advisories};if(t?.vulnerabilities){const e=t.vulnerabilities;return{summary:{critical:Number(e.critical||0),high:Number(e.high||0),moderate:Number(e.moderate||0),low:Number(e.low||0),highest:e.highest||"none",risk:t.vulnRisk||t.risk||"green"},advisories:t.advisories}}return{summary:{critical:0,high:0,moderate:0,low:0,highest:"none",risk:"green"},advisories:t?.advisories}}function B(e){return e?.highest||"none"}function N(e){return e&&e.risk||"green"}var T={permissive:"green",weakCopyleft:"amber",strongCopyleft:"red",unknown:"gray"},j={none:0,low:1,moderate:2,high:3,critical:4},R=[{id:"type",label:"Type",sortKey:"type",getValue:e=>e.usage.direct?"Dependency":"Sub-Dependency",getTone:e=>e.usage.direct?"green":"amber",sortFn:(e,t)=>e.usage.direct===t.usage.direct?0:e.usage.direct?-1:1},{id:"scope",label:"Scope",sortKey:"scope",getValue:e=>{return"runtime"===(t=e.usage.scope)?"Runtime":"dev"===t?"Dev":"optional"===t?"Optional":"peer"===t?"Peer":t;var t},getTone:e=>"runtime"===e.usage.scope?"green":"dev"===e.usage.scope||"optional"===e.usage.scope?"amber":"gray",sortFn:(e,t)=>e.usage.scope.localeCompare(t.usage.scope)},{id:"license",label:"License",sortKey:"license",getValue:e=>{const t=X(e),n=t.isInferred?\`\${t.value} (inferred)\`:t.value;return"mismatch"===e.compliance.license.status?\`\${n} *\`:n},getTone:e=>T[function(e){if(!e)return"unknown";const t=e.toUpperCase();for(const[n,a]of Object.entries(I))if(a.some(e=>t.includes(e.toUpperCase())))return n;return"unknown"}(X(e).value)],sortFn:(e,t)=>{const n=X(e).value,a=X(t).value;return n.localeCompare(a)}},{id:"vulns",label:"Vulnerabilities",sortKey:"severity",getValue:e=>D(B(A(e).summary)),getTone:e=>A(e).summary.risk,sortFn:(e,t)=>j[B(A(t).summary)]-j[B(A(e).summary)]},{id:"install",label:"Install",sortKey:"install",getValue:e=>{return(t=e.execution)?D(t.risk||"low"):"Low";var t},getTone:e=>N(e.execution),sortFn:(e,t)=>{const n={green:0,amber:1,red:2},a=N(e.execution),r=N(t.execution);return n[a]-n[r]}}],V=R.length;function \$(e){if(!e)return"unknown";const t=e.toUpperCase();for(const[n,a]of Object.entries(I))if(a.some(e=>t.includes(e.toUpperCase())))return n;return"unknown"}function H(e){const t=e.compliance.license,n=t.declared?.valid?t.declared.spdxId:void 0,a=t.inferred?.spdxId;return n?{value:n,isInferred:!1}:a?{value:a,isInferred:!0}:{value:"Unknown",isInferred:!1}}function O(e){switch(e){case"declared-only":return"Declared";case"inferred-only":return"Inferred";case"match":return"Declared + Inferred (match)";case"mismatch":return"Declared + Inferred (mismatch)";case"invalid-spdx":return"Invalid SPDX";default:return"Unknown"}}var F={none:0,low:1,moderate:2,high:3,critical:4};function W(e){const t=e.security;if(t?.summary)return{summary:t.summary,advisories:t.advisories};if(t?.vulnerabilities){const e=t.vulnerabilities;return{summary:{critical:Number(e.critical||0),high:Number(e.high||0),moderate:Number(e.moderate||0),low:Number(e.low||0),highest:e.highest||"none",risk:t.vulnRisk||t.risk||"green"},advisories:t.advisories}}return{summary:{critical:0,high:0,moderate:0,low:0,highest:"none",risk:"green"},advisories:t?.advisories}}function G(e){return e?String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}function U(e){return null!=e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.length>0:"object"!=typeof e||Object.keys(e).length>0)}function _(e){return Array.isArray(e)?e.map(e=>_(e)).join(", "):"boolean"==typeof e?e?"Yes":"No":"object"==typeof e&&null!==e?Object.entries(e).filter(([,e])=>U(e)).map(([e,t])=>G(e)+": "+_(t)).join("<br>"):G(String(e))}function q(e,t){return U(t)?'<div class="metadata-row"><div class="metadata-row-label">'+G(e)+'</div><div class="metadata-row-value">'+_(t)+"</div></div>":""}function z(e,t){const n=t.filter(Boolean);return 0===n.length?"":'<section class="metadata-section"><div class="metadata-section-title">'+G(e)+'</div><div class="metadata-grid">'+n.join("")+"</div></section>"}function K(e){const t=e.workspaces;if(!t||!t.enabled)return z("Workspaces",[q("Enabled",!1),q("Type",t?.type)]);const n=t.workspacePackages||[],a=n.length?'<div class="metadata-list">'+n.map(e=>'<div class="metadata-list-item"><div class="metadata-row-value">'+G(e.name)+'</div><div class="metadata-muted">'+G(e.relativePath)+" · runtime "+G(String(e.directExternal.runtime))+" · dev "+G(String(e.directExternal.dev))+"</div></div>").join("")+"</div>":"";return z("Workspaces",[q("Enabled",t.enabled),q("Type",t.type),q("Package count",t.packageCount),a?'<div class="metadata-row"><div class="metadata-row-label">Packages</div><div>'+a+"</div></div>":""])}function J(e){const t=e.supplyChain;if(!t)return"";const n=t.signatureAudit;return z("Supply Chain",[q("Signals",t.signals?.length),n?q("Signature audit",{attempted:n.attempted,ok:n.ok,status:n.status,error:n.error}):""])}function Z(e){return"runtime"===e?"Runtime":"dev"===e?"Dev":"optional"===e?"Optional":"peer"===e?"Peer":e}function Q(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e}function ee(e){return e.split(/[\\s-_]+/).map(e=>e?Q(e):e).join(" ")}function te(e){return R.map(t=>{return n=t.label,a=t.getValue(e),'<div class="badge-card '+t.getTone(e)+'"><span class="badge-label">'+G(n)+'</span><span class="badge-value">'+G(a)+"</span></div>";var n,a}).join("")}function ne(e,t){const n=R.map(n=>function(e,t,n,a){const r=n===e,s=r?a?" ▲":" ▼":"",i=r?a?" sorted-asc":" sorted-desc":"";return'<button type="button" class="column-header'+(r?" sorted":"")+i+'" data-sort="'+G(e)+'"><span class="column-header-label">'+G(t)+'</span><span class="sort-indicator">'+s+"</span></button>"}(n.sortKey,n.label,e,t)).join("");return'<div class="column-headers" style="--column-count: '+V+'">'+n+"</div>"}function ae(e,t,n){let a='<div class="kv-item">';return a+='<span class="kv-label">'+G(e)+"</span>",a+='<span class="kv-value">'+G(String(t))+"</span>",n&&(a+='<span class="kv-hint">'+G(n)+"</span>"),a+="</div>",a}function re(e,t){return'<span class="kv-value risk-value"><span class="risk-dot '+t+'"></span>'+G(String(e))+"</span>"}function se(e,t="neutral"){return'<span class="status-chip '+t+'">'+G(e)+"</span>"}function ie(e,n,a){const r=t(n),s=e.execution?.risk||"green",i=e.upgrade.blocksNodeMajor||!!e.upgrade.blockers?.length;return'<div class="status-chip-strip">'+[se(e.usage.direct?"Direct dependency":"Transitive dependency"),se(Z(e.usage.scope)),se(r>0?"Vulnerability: "+ee(n.highest):"Vulnerability: None","green"===n.risk?"neutral":n.risk),se("Licence: "+a,"green"===e.compliance.licenseRisk?"neutral":e.compliance.licenseRisk),se("Install risk: "+Ee(s),"green"===s?"neutral":s),se(i?"Upgrade blocker":"No upgrade blocker",i?"amber":"neutral")].join("")+"</div>"}function oe(e,t,n){let a='<div class="kv-item">';return a+='<span class="kv-label">'+G(e)+"</span>",a+=t,n&&(a+='<span class="kv-hint">'+G(n)+"</span>"),a+="</div>",a}function ce(e,t){if(!e||0===e.length)return'<span class="kv-value">None</span>';const n=e.slice(0,t),a=e.length-t;let r='<div class="package-list">';return n.forEach(e=>{r+='<span class="package-tag">'+G(e)+"</span>"}),a>0&&(r+='<span class="package-tag">+'+a+" more</span>"),r+="</div>",r}function le(e,t,n,a){if(!e||0===e.length)return'<span class="kv-value">None</span>';const r=e.slice(0,t),s=e.length-t;let i='<div class="package-list">';return r.forEach(e=>{const t=ve(e,n,a);i+=t?'<a class="package-tag package-tag-link root-package-link" href="#'+G(ge(t))+'" data-dep-key="'+G(t)+'" aria-label="Jump to dependency '+G(t)+'">'+G(e)+"</a>":'<span class="package-tag">'+G(e)+"</span>"}),s>0&&(i+='<span class="package-tag">+'+s+" more</span>"),i+="</div>",i}function de(e,t){return e+"@"+t}var ue=new WeakMap;function pe(e){const t=e.lastIndexOf("@npm:");if(t>0)return{name:e.slice(0,t),version:e.slice(t+1)};const n=e.lastIndexOf("@");return n<=0?null:{name:e.slice(0,n),version:e.slice(n+1)}}function ge(e){return\`dep-\${e}\`}function he(e){const t=ue.get(e);if(t)return t;const n=new Map;return e.forEach(e=>{const t=pe(e);if(!t)return;const a=n.get(t.name)||[];a.push(e),n.set(t.name,a)}),ue.set(e,n),n}function me(e,t,n){const a=((n||he(t)).get(e)||[]).filter(e=>t.has(e));return 1===a.length?a[0]:null}function ve(e,t,n){if(t.has(e))return e;const a=pe(e);if(!a)return me(e,t,n);if(a.version.startsWith("npm:")){const e=a.version.slice(4),n=a.name+(e.startsWith("@")?e:"@"+e);if(t.has(n))return n}return me(a.name,t,n)}function fe(e,t){if(t.has(e))return e;const n=pe(e);if(!n)return null;if(n.version.startsWith("npm:")){const e=n.version.slice(4),a=n.name+(e.startsWith("@")?e:"@"+e);if(t.has(a))return a}return null}function ye(e,t,n,a){if(!e||0===e.length)return'<span class="kv-value">None</span>';const r=e.slice(0,t),s=e.length-t;let i='<div class="package-list">';return r.forEach(e=>{if("string"==typeof e){const t=ve(e,n,a);return t?void(i+='<a class="package-tag package-tag-link root-package-link" href="#'+G(ge(t))+'" data-dep-key="'+G(t)+'" aria-label="Jump to dependency '+G(t)+'">'+G(e)+"</a>"):void(i+='<span class="package-tag">'+G(e)+"</span>")}const t=de(e.name,e.version),r=e.name+"@"+e.version,s=ve(t,n,a);i+=s?'<a class="package-tag package-tag-link root-package-link" href="#'+G(ge(s))+'" data-dep-key="'+G(s)+'" aria-label="Jump to dependency '+G(s)+'">'+G(r)+"</a>":'<span class="package-tag">'+G(r)+"</span>"}),s>0&&(i+='<span class="package-tag">+'+s+" more</span>"),i+="</div>",i}function ke(e,t,n){const a=e.graph.subDeps;if(!a)return"";const r=[{title:"Dependencies",key:"dep"},{title:"Optional",key:"opt"},{title:"Peer",key:"peer"},{title:"Dev Dependencies",key:"dev"}];let s=0,i=0;for(const l of r){const e=a[l.key];if(e)for(const t of Object.values(e))s+=1,t[1]&&(i+=1)}if(0===s)return"";const o='<div class="declared-summary">Total: '+s+" • Installed: "+i+" • Not installed: "+(s-i)+"</div>",c=r.map(e=>{const r=a[e.key];if(!r||0===Object.keys(r).length)return"";let s=0,i=0;const o=Object.entries(r).sort(([e],[t])=>e.localeCompare(t)).map(([e,[a,r]])=>{s+=1,r&&(i+=1);const o='<div class="declared-name">'+G(e)+"</div>",c='<div class="declared-range">'+G(a)+"</div>",l=r?function(e,t,n){const a=ve(e,t,n);return a?'<a class="status-pill installed root-package-link" href="#'+G(ge(a))+'" data-dep-key="'+G(a)+'" aria-label="Jump to dependency '+G(a)+'">Installed</a>':'<span class="status-pill installed">Installed</span>'}(r,t,n):'<span class="status-pill missing">Not installed</span>';return'<div class="declared-row">'+o+c+l+"</div>"}),c=i+" of "+s+" installed";return['<details class="declared-group">','<summary class="declared-group-summary"><span class="expand-icon" aria-hidden="true"></span><span class="declared-group-title">'+G(e.title)+' <span class="declared-count">('+c+")</span></span></summary>",'<div class="declared-table">'+o.join("")+"</div>","</details>"].join("")}).filter(Boolean);return be("Declared Dependencies","Dependencies declared by this package",o+'<div class="declared-deps">'+c.join("")+"</div>")}function be(e,t,n){let a='<div class="section">';return a+='<div class="section-header">',a+='<span class="section-title">'+G(e)+"</span>",t&&(a+='<span class="section-desc">'+G(t)+"</span>"),a+="</div>",a+=n,a+="</div>",a}function we(e,t,n,a){let r='<div class="subsection'+(a?" "+a:"")+'">';return r+='<div class="subsection-header">',r+='<span class="subsection-title">'+G(e)+"</span>",n&&(r+='<span class="subsection-desc">'+G(n)+"</span>"),r+="</div>",r+=t,r+="</div>",r}function Ee(e){return"red"===e?"High":"amber"===e?"Medium":"Low"}function Ce(e){return e&&0!==e.length?we("Supply chain source",'<div class="section-note">Shown only when lockfile source metadata is unusual or incomplete.</div><div class="kv-grid">'+e.map(e=>{return ae({"git-dependency":"Git dependency source","file-dependency":"Local dependency source","non-registry-tarball":"Non-registry tarball","missing-integrity":"Missing lockfile integrity","unexpected-registry-host":"Unexpected registry host"}[t=e.type]||ee(t),e.source,e.detail);var t}).join("")+"</div>","Lockfile source signals","warning"):""}function xe(e){if(!e)return;const t=e.trim();if(!t)return;const n=e=>e.replace(/\\.git\$/i,"");if(/^https?:\\/\\//i.test(t))return n(t);if(/^git\\+https?:\\/\\//i.test(t))return n(t.replace(/^git\\+/,""));if(/^git:\\/\\/github\\.com\\//i.test(t))return n(t.replace(/^git:\\/\\//i,"https://"));if(/^github:/i.test(t)){const e=t.slice(7).replace(/^\\/+/,"");return e?\`https://github.com/\${n(e)}\`:void 0}if(/^git@github\\.com:/i.test(t)){const e=t.slice(15);return e?\`https://github.com/\${n(e)}\`:void 0}return/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+\$/.test(t)?\`https://github.com/\${n(t)}\`:void 0}function Se(e,t){const n=xe(e);if(!n)return;let a;try{a=new URL(n)}catch{return}if("github.com"!==a.hostname.toLowerCase())return;const r=a.pathname.split("/").filter(Boolean);if(r.length<2)return;const s=r[0],i=r[1].replace(/\\.git\$/i,"");return s&&i?\`https://github.com/\${s}/\${i}/blob/HEAD/\${t}\`:void 0}function Le(e,t){return t?G(e)+' <a class="kv-inline-link" href="'+G(t)+'" target="_blank" rel="noopener noreferrer">GitHub<svg class="kv-inline-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M7 17 17 7"/><path d="M9 7h8v8"/></svg></a>':G(e)}function Ie(e){const t='<svg viewBox="0 0 24 24" fill="currentColor"><path d="M0 7.334v8h6.666v1.332H12v-1.332h12v-8H0zm6.666 6.664H5.334v-4H3.999v4H1.335V8.667h5.331v5.331zm4 0v1.336H8.001V8.667h5.334v5.332h-2.669v-.001zm12.001 0h-1.33v-4h-1.336v4h-1.335v-4h-1.33v4h-2.671V8.667h8.002v5.331zM10.665 10H12v2.667h-1.335V10z"/></svg>',n='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg>',a='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>',r='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>';if(!(e.npm||e.repository||e.homepage||e.issues))return"";let s='<div class="package-links">';return e.npm&&(s+='<a href="'+G(e.npm)+'" target="_blank" rel="noopener" class="package-link">'+t+"npm</a>"),e.repository&&(s+='<a href="'+G(e.repository)+'" target="_blank" rel="noopener" class="package-link">'+n+"Repository</a>"),e.homepage&&(s+='<a href="'+G(e.homepage)+'" target="_blank" rel="noopener" class="package-link">'+r+"Homepage</a>"),e.issues&&(s+='<a href="'+G(e.issues)+'" target="_blank" rel="noopener" class="package-link">'+a+"Issues</a>"),s+="</div>",s}function Me(e,n,r,s){const i=W(e),o=i.summary,c=H(e),l=c.isInferred?\`\${c.value} (inferred)\`:c.value,d=function(e){const t=e.package?.links||{},n=e.links||{},a=xe(t.repository||n.repository||n.repo);return{npm:t.npm||n.npm,repository:a||t.repository||n.repository||n.repo,homepage:t.homepage||n.homepage,issues:t.bugs||t.issues||n.bugs||n.issues}}(e),u=JSON.stringify(e,null,2),p=e.usage.origins.workspaces?.length?'<div class="micro-sublist"><div class="micro-subtitle">Workspaces</div>'+ce(e.usage.origins.workspaces,8)+"</div>":"",g=e.package.description?'<p class="dep-description"><span>Description: </span>'+G(e.package.description)+"</p>":"";var h,m;const v=be("Overview",void 0,'<div class="definition-grid">'+[ae("Dependency status",e.usage.direct?"Direct dependency":"Transitive dependency"),ae("Scope",Z(e.usage.scope)),e.usage.introduction?ae("Introduced by",ee(e.usage.introduction)):"",e.usage.runtimeImpact?ae("Runtime impact",(m=e.usage.runtimeImpact,m?ee(m):"")):"",ae("Dependency depth",e.usage.depth),e.usage.direct?"":oe("Introduced via root packages",ye(e.usage.origins.topRootPackages,8,n,r)),e.usage.direct?"":ae("Direct roots",e.usage.origins.rootPackageCount),e.usage.direct?"":oe("Direct parents",le(e.usage.origins.topParentPackages,8,n,r)),e.usage.direct?"":ae("Direct parents count",e.usage.origins.parentPackageCount??0),ae("TypeScript types",(h=e.usage.tsTypes,"bundled"===h?"Bundled":"definitelyTyped"===h?"DefinitelyTyped":"none"===h?"None":"Unknown"))].filter(Boolean).join("")+"</div>"+p+function(e,t,n,a){if(!t||0===t.length)return"";const r=t.slice(0,n),s=t.length-n;let i='<div class="detail-list">';return i+='<div class="detail-title">'+G(e)+"</div>",i+='<ul class="detail-items'+(a?" "+a:"")+'">',r.forEach(e=>{i+='<li class="detail-item">'+G(e)+"</li>"}),s>0&&(i+='<li class="detail-item muted">+'+s+" more</li>"),i+="</ul></div>",i}("Top import locations",e.usage.importUsage?.topFiles,5,"mono")),f=e.compliance.license,y=Se(d.repository,"package.json"),k=Se(d.repository,"LICENSE"),b=[oe("Primary license",re(l,e.compliance.licenseRisk)),ae("Status",O(f.status))];if(f.declared){const e=[f.declared.valid?"valid":"invalid",f.declared.expression?"expression":void 0,f.declared.deprecated?"deprecated":void 0].filter(Boolean).join(", "),t=f.exception?.id?\` WITH \${f.exception.id}\`:"";b.push(oe("Declared SPDX in package.json",'<span class="kv-value">'+Le(\`\${f.declared.spdxId}\${t}\${e?\` (\${e})\`:""}\`,y)+"</span>"))}f.inferred&&b.push(oe("Inferred from LICENSE file",'<span class="kv-value">'+Le(\`\${f.inferred.spdxId} (\${f.inferred.confidence})\`,k)+"</span>")),"mismatch"===f.status&&b.push(ae("Mismatch","Declared SPDX and LICENSE text do not match")),"invalid-spdx"===f.status&&b.push(ae("Invalid SPDX","Package.json license is not a valid SPDX identifier or expression"));const w=we("License",'<div class="kv-grid">'+b.join("")+"</div>"),E=t(o),C=[oe("Vulnerability status",re(0===E?"No known vulnerabilities":String(E),o.risk)),ae("Highest severity","none"===o.highest?"None":ee(o.highest))],x=E>0?'<div class="kv-grid kv-grid-tight">'+[ae("Critical",o.critical),ae("High",o.high),ae("Moderate",o.moderate),ae("Low",o.low)].join("")+"</div>":"",S=function(e){if(!e||0===e.length)return"";let t='<table class="vuln-table"><thead><tr>';return t+="<th>Title</th><th>Severity</th><th>Affected range</th><th>Fix available</th><th>Reference</th>",t+="</tr></thead><tbody>",e.forEach(e=>{const n=G(e.title),a=e.url?'<a href="'+G(e.url)+'" target="_blank" rel="noopener">Link</a>':"";t+='<tr data-severity="'+G(e.severity)+'">',t+='<td data-label="Title">'+n+"</td>",t+='<td data-label="Severity">'+G(Q(e.severity))+"</td>",t+='<td data-label="Affected range">'+G(e.vulnerableRange)+"</td>",t+='<td data-label="Fix available">'+G(e.fixAvailable?"Yes":"No")+"</td>",t+='<td data-label="Reference">'+a+"</td>",t+="</tr>"}),t+="</tbody></table>",t}(i.advisories),L=be("Risk & Compliance",void 0,w+we("Vulnerabilities",['<div class="kv-grid">'+C.join("")+"</div>",x||"",S||""].join(""),"Known security issues from npm audit","vuln-block")+(e.execution?function(e){const t=[oe("Execution risk",re(Ee(e.risk),e.risk))];if(e.native&&t.push(ae("Native build tooling detected (native)","Yes")),e.scripts?.hooks?.length&&t.push(oe("Lifecycle hooks",ce(e.scripts.hooks,6))),"number"==typeof e.scripts?.complexity&&t.push(ae("Heuristic complexity","Script complexity: "+e.scripts.complexity+" (complexity)")),e.scripts?.signals?.length){const n=e.scripts.signals.map(e=>\`\${M[e]} (\${e})\`);t.push(oe("Install-time signals",ce(n,6)))}const n=(e.signals||[]).filter(t=>!(e.scripts?.signals||[]).includes(t));if(n.length){const e=n.map(e=>\`\${M[e]} (\${e})\`);t.push(oe("Local execution signals",ce(e,6)))}return we("Install-time execution behaviour",'<div class="section-note">Execution behaviour signals are local static review cues from lifecycle scripts, entry files, package bins, or a small bounded set of package files. They do not imply compromise.</div><div class="kv-grid">'+t.join("")+"</div>")}(e.execution):"")+function(e){if(!e?.signals?.length)return"";const t=[oe("Packaging signals",ce(e.signals.map(e=>\`\${P[e]} (\${e})\`),6))];return e.bundledDependencies?.length&&t.push(oe("Bundled dependencies",ce(e.bundledDependencies,8))),we("Package contents",'<div class="section-note">Packaging signals describe local package structure that may warrant review; they are not malware verdicts.</div><div class="kv-grid">'+t.join("")+"</div>")}(e.packaging)+function(e){if(!e?.attempted)return"";const t=[ae("Lookup",e.ok?"Available":"Unavailable"),oe("Candidate reasons",ce(e.candidateReasons||[],6))];if(e.error&&t.push(ae("Error",e.error)),e.signals?.length){const n=e.signals.map(e=>\`\${Y[e]} (\${e})\`);t.push(oe("Registry signals",ce(n,6)))}return e.installedVersionPublishedAt&&t.push(ae("Installed version published",e.installedVersionPublishedAt)),e.packageCreatedAt&&t.push(ae("Package created",e.packageCreatedAt)),"number"==typeof e.versionCount&&t.push(ae("Published versions",e.versionCount)),e.latestVersion&&t.push(ae("Latest dist-tag",e.latestVersion)),we("Registry metadata",'<div class="section-note">Targeted npm registry metadata is collected only for packages that already show local review signals, and is skipped in offline scans.</div><div class="kv-grid">'+t.join("")+"</div>")}(e.supplyChain?.registry)+Ce(s)),I=[ae("Outdated status",(D=e.upgrade.outdatedStatus,D?"unknown"===D?"Unknown":ee(D):"Not reported"))];var D;e.upgrade.latestVersion&&I.push(ae("Latest version",e.upgrade.latestVersion));const X=we("Version",'<div class="section-note">Based on npm outdated findings.</div><div class="kv-grid">'+I.join("")+"</div>"),A=e.package.deprecated?we("Deprecated",'<div class="kv-grid">'+ae("Deprecated","Yes","Declared by the package author.")+"</div>",void 0,"warning"):"",B=[ae("Node engine constraint",e.upgrade.nodeEngine||"Any")];void 0!==e.upgrade.blocksNodeMajor&&B.push(ae("Blocks Node major upgrade",e.upgrade.blocksNodeMajor?"Yes":"No"));const N=we("Constraints",'<div class="kv-grid">'+B.join("")+"</div>"),T=we("Blast radius",'<div class="kv-grid">'+[ae("Used by other packages (fanIn)",e.graph.fanIn),ae("Depends on packages (fanOut)",e.graph.fanOut)].join("")+"</div>"),j={nodeEngine:"Node engine constraint",peerDependency:"Peer dependency constraints",nativeBindings:"Native bindings/build tooling",installScripts:"Install lifecycle scripts",deprecated:"Deprecated by author"},R=be("Upgrade & Change Impact","Currency, constraints, and blast radius",X+A+N+T+('<div class="subsection"><div class="subsection-header"><span class="subsection-title">Upgrade blockers</span></div>'+(e.upgrade.blockers?.length?'<ul class="bullet-list">'+e.upgrade.blockers.map(e=>"<li>"+G(j[e]||e)+"</li>").join("")+"</ul>":'<div class="status-row">No upgrade blockers detected</div>')+"</div>")),V=ke(e,n,r);return[Ie(d),g,ie(e,o,l),(\$=a(e,o),['<div class="key-points">','<div class="section-header compact"><span class="section-title">Key points</span></div>','<ul class="key-points-list">',\$.map(e=>"<li>"+G(e)+"</li>").join(""),"</ul>","</div>"].join("")),v,L,R,V,'<details class="raw-data-toggle"><summary><span class="expand-icon" aria-hidden="true"></span>View raw data</summary><div class="raw-data-pane"><pre>'+G(u)+'</pre><button type="button" class="copy-json-btn" aria-label="Copy raw JSON">Copy JSON</button></div></details>'].join("");var \$}async function Pe(){const e=await async function(){const e=document.getElementById("radar-data");return e&&e.textContent&&"{}"!==e.textContent.trim()?JSON.parse(e.textContent):(await fetch("./sample-data.json")).json()}();void 0===window.__DEPENDENCY_DATA__&&(window.__DEPENDENCY_DATA__=e);const t=document.getElementById("dependency-list"),n=document.getElementById("results-summary"),a=function(e){const t="string"==typeof e&&e.trim().length>0?e.trim():"unknown";return\`https://dependency-radar.com/next-steps?source=standalone-report&cli=\${encodeURIComponent(t)}\`}(e.dependencyRadarVersion),s=document.getElementById("project-path");s&&(s.textContent=e.project.name||e.project.projectDir,s.title=e.project.projectDir);const i=document.getElementById("metadata-toggle"),o=document.getElementById("metadata-panel"),c=document.getElementById("cta-primary-link");c&&(c.href=a);const l=document.getElementById("formatted-date");let d=e.generatedAt||"";if(l&&e.generatedAt)try{const t=new Date(e.generatedAt);Number.isNaN(t.getTime())?(d=e.generatedAt,l.textContent=e.generatedAt):(d=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),l.textContent=d)}catch{d=e.generatedAt,l.textContent=e.generatedAt}o&&(o.innerHTML=function(e,t){const n=e.environment||{},a=n.minRequiredMajor,r=a&&a>0?"Node requirement derived from dependency engine ranges.":"";return[z("Report",[q("Dependency Radar",e.dependencyRadarVersion),q("Schema",e.schemaVersion),q("Generated",t||e.generatedAt),q("Generated raw",e.generatedAt)]),z("Project",[q("Name",e.project.name),q("Version",e.project.version),q("Path",e.project.projectDir),q("Description",e.project.description),q("License",e.project.license),q("Homepage",e.project.homepage),q("Repository",e.project.repository),q("Constraints",e.project.constraints),q("Dependency policy",e.project.dependencyPolicySummary)]),z("Git",[q("Branch",e.git?.branch)]),z("Environment",[q("Node",n.nodeVersion),q("Runtime",n.runtimeVersion),q("Minimum required Node major",n.minRequiredMajor),q("Target Node major",n.targetNodeMajor),q("Platform",n.platform),q("Architecture",n.arch),q("CI",n.ci),q("packageManager field",n.packageManagerField),q("Package manager",n.packageManager),q("Package manager version",n.packageManagerVersion),q("Tool versions",n.toolVersions),q("Node note",r)]),K(e),z("Summary",[q("Dependencies",e.summary?.dependencyCount),q("Direct",e.summary?.directCount),q("Transitive",e.summary?.transitiveCount),q("Findings",e.summary?.findingCount)]),J(e)].filter(Boolean).join("")}(e,d),o.hidden=!1,o.inert=!0,o.setAttribute("aria-hidden","true"));const u=e=>{i&&o&&(o.classList.toggle("open",e),o.inert=!e,o.setAttribute("aria-hidden",String(!e)),i.classList.toggle("open",e),i.setAttribute("aria-expanded",String(e)))};i?.addEventListener("click",()=>{u(!o?.classList.contains("open"))}),document.addEventListener("click",e=>{if(!i||!o)return;if(!o.classList.contains("open"))return;const t=e.target;i.contains(t)||o.contains(t)||u(!1)}),document.addEventListener("keydown",e=>{"Escape"===e.key&&u(!1)});const p={search:document.getElementById("search"),direct:document.getElementById("direct-filter"),runtime:document.getElementById("runtime-filter"),workspace:document.getElementById("workspace-filter"),workspaceWrap:document.getElementById("workspace-filter-wrap"),sort:document.getElementById("sort-by"),sortDirection:document.getElementById("sort-direction"),hasVulns:document.getElementById("has-vulns"),themeSwitch:document.getElementById("theme-switch"),licenseToggle:document.getElementById("license-toggle"),licensePanel:document.getElementById("license-panel"),licensePermissive:document.getElementById("license-permissive"),licenseWeakCopyleft:document.getElementById("license-weak-copyleft"),licenseStrongCopyleft:document.getElementById("license-strong-copyleft"),licenseUnknown:document.getElementById("license-unknown"),licenseAll:document.getElementById("license-all"),licenseFriendly:document.getElementById("license-friendly"),filtersToggle:document.getElementById("filters-toggle"),filterCountBadge:document.getElementById("filter-count-badge"),filterControls:document.getElementById("filter-controls"),activeFiltersRow:document.getElementById("active-filters-row"),activeFilterChips:document.getElementById("active-filter-chips"),activeFilterClear:document.getElementById("active-filter-clear"),clearAllFilters:document.getElementById("clear-all-filters"),licensePermissiveLabel:document.getElementById("license-permissive-label"),licenseWeakCopyleftLabel:document.getElementById("license-weak-copyleft-label"),licenseStrongCopyleftLabel:document.getElementById("license-strong-copyleft-label"),licenseUnknownLabel:document.getElementById("license-unknown-label"),hasVulnsLabel:document.getElementById("has-vulns-label"),columnHeadersContainer:document.getElementById("column-headers-container"),packageHeader:document.getElementById("package-header"),viewGraphButton:document.getElementById("view-graph-btn"),graphBackButton:document.getElementById("graph-back-btn"),listViewPanel:document.getElementById("list-view"),graphViewPanel:document.getElementById("graph-view"),graphWorkspaceSelect:document.getElementById("graph-workspace"),graphWorkspaceWrap:document.getElementById("graph-workspace-wrap"),graphControls:document.getElementById("graph-controls"),graphCanvas:document.getElementById("graph-canvas"),graphCanvasShell:document.getElementById("graph-canvas-shell"),graphPopover:document.getElementById("graph-popover"),graphPopoverName:document.getElementById("graph-popover-name"),graphPopoverVersion:document.getElementById("graph-popover-version"),graphPopoverLicense:document.getElementById("graph-popover-license"),graphPopoverVulns:document.getElementById("graph-popover-vulns"),graphPopoverAmplification:document.getElementById("graph-popover-amplification"),graphOpenList:document.getElementById("graph-open-list"),reportFooter:document.querySelector(".report-footer")};let g="name",h=!0,m=null,v=!1;document.documentElement.setAttribute("data-theme","dark"),"light"===localStorage.getItem("dependency-radar-theme")?(document.documentElement.classList.add("light"),p.themeSwitch.classList.add("light"),p.themeSwitch.setAttribute("aria-pressed","true"),document.documentElement.setAttribute("data-theme","light")):(document.documentElement.classList.remove("light"),p.themeSwitch.classList.remove("light"),p.themeSwitch.setAttribute("aria-pressed","false"),document.documentElement.setAttribute("data-theme","dark")),p.themeSwitch.addEventListener("click",()=>{document.documentElement.classList.toggle("light"),p.themeSwitch.classList.toggle("light");const e=document.documentElement.classList.contains("light");document.documentElement.setAttribute("data-theme",e?"light":"dark"),p.themeSwitch.setAttribute("aria-pressed",String(e)),localStorage.setItem("dependency-radar-theme",e?"light":"dark"),m?.requestRender()});const f=window.matchMedia("(max-width: 768px)");let y=f.matches;const k=e=>{p.filterControls&&p.filtersToggle&&(p.filterControls.classList.toggle("open",e),p.filterControls.inert=!e,p.filterControls.setAttribute("aria-hidden",String(!e)),p.filtersToggle.classList.toggle("open",e),p.filtersToggle.setAttribute("aria-expanded",String(e)),e&&u(!1))},b=()=>{if(f.matches)return k(!1),void(y=!0);y&&k(!1),y=!1};function w(){if(p.columnHeadersContainer&&(p.columnHeadersContainer.innerHTML=ne(g,h)),p.packageHeader){const e=p.packageHeader.querySelector(".sort-indicator");e&&("name"===g?(e.textContent=h?" ▲":" ▼",p.packageHeader.classList.add("sorted")):(e.textContent="",p.packageHeader.classList.remove("sorted")))}}function E(e){const t=e.target.closest(".column-header");if(!t)return;const n=t.dataset.sort;n&&(g===n?h=!h:(g=n,h=!0),p.sort&&(p.sort.value=g,p.sortDirection.textContent=h?"↑":"↓"),w(),Q())}p.filtersToggle&&p.filterControls&&p.filtersToggle.addEventListener("click",()=>{k(!p.filterControls.classList.contains("open"))}),document.addEventListener("click",e=>{if(!p.filterControls||!p.filtersToggle)return;const t=e.target;p.filterControls.contains(t)||p.filtersToggle.contains(t)||k(!1)}),document.addEventListener("keydown",e=>{"Escape"===e.key&&k(!1)}),k(!1),window.addEventListener("resize",b),b(),p.sortDirection.addEventListener("click",()=>{h=!h,p.sortDirection.textContent=h?"↑":"↓",w(),Q()}),p.sort.addEventListener("change",()=>{g=p.sort.value,w(),Q()}),p.columnHeadersContainer&&p.columnHeadersContainer.addEventListener("click",E),p.packageHeader&&p.packageHeader.addEventListener("click",E),w(),p.licenseAll.addEventListener("click",()=>{p.licensePermissive.checked=!0,p.licenseWeakCopyleft.checked=!0,p.licenseStrongCopyleft.checked=!0,p.licenseUnknown.checked=!0,N.clear(),Q()}),p.licenseFriendly.addEventListener("click",()=>{p.licensePermissive.checked=!0,p.licenseWeakCopyleft.checked=!1,p.licenseStrongCopyleft.checked=!1,p.licenseUnknown.checked=!1,N.clear(),Q()});const C=Object.values(e.dependencies||{}),x=e=>{const t=e.usage.origins.workspaces||[];return t.length>0?t:["root"]},S=Array.from(new Set([...r(e),...C.flatMap(x)])).sort((e,t)=>"root"===e?-1:"root"===t?1:e.localeCompare(t)),I=(e,t)=>e+" ("+t+")",M=e=>{return F[t=W(e).summary,t?.highest||"none"]>0;var t},P=e=>C.reduce((t,n)=>t+(e(n)?1:0),0);if(p.workspace&&p.workspaceWrap&&S.length>1){p.workspace.textContent="";const e=document.createElement("option");e.value="all",e.textContent=I("All workspaces",C.length),p.workspace.appendChild(e),S.forEach(e=>{const t=document.createElement("option");t.value=e,t.textContent=I("root"===e?"Workspace root":e,P(t=>x(t).includes(e))),p.workspace.appendChild(t)}),p.workspaceWrap.classList.remove("hidden")}!function(){const e=C.length;p.direct.options[0].textContent=I("All",e),p.direct.options[1].textContent=I("Direct",P(e=>e.usage.direct)),p.direct.options[2].textContent=I("Transitive",P(e=>!e.usage.direct));const t={all:"All",runtime:"Production",dev:"Development",optional:"Optional",peer:"Peer"};Array.from(p.runtime.options).forEach(n=>{n.textContent=I(t[n.value]||n.textContent||n.value,"all"===n.value?e:P(e=>e.usage.scope===n.value))});const n={permissive:0,weakCopyleft:0,strongCopyleft:0,unknown:0};C.forEach(e=>{n[\$(H(e).value)]+=1}),p.licensePermissiveLabel&&(p.licensePermissiveLabel.textContent=I("Permissive",n.permissive)),p.licenseWeakCopyleftLabel&&(p.licenseWeakCopyleftLabel.textContent=I("Weak Copyleft",n.weakCopyleft)),p.licenseStrongCopyleftLabel&&(p.licenseStrongCopyleftLabel.textContent=I("Strong Copyleft",n.strongCopyleft)),p.licenseUnknownLabel&&(p.licenseUnknownLabel.textContent=I("Other / Unknown",n.unknown)),p.hasVulnsLabel&&(p.hasVulnsLabel.textContent=I("Has vulnerabilities",P(M)))}();const Y=new Map;C.forEach(e=>{Y.set(de(e.package.name,e.package.version),e)});const D=new Set(Y.keys()),X=he(D),A=function(e,t,n){const a=new Map,r=(e,t)=>{const n=a.get(e)||[];n.push(t),a.set(e,n)};for(const s of e.supplyChain?.signals||[]){const e=[s.packageId,s.packageName&&s.packageVersion?de(s.packageName,s.packageVersion):void 0].filter(Boolean);let a=!1;for(const n of e){const e=fe(n,t);if(e){r(e,s),a=!0;break}}if(!a&&s.packageName&&!s.packageVersion){const e=me(s.packageName,t,n);e&&r(e,s)}}return a}(e,D,X),B=new Set,N=new Set,T=new Map,j=(()=>{const e=document.getElementById("copy-announcer");if(e)return e;const t=document.createElement("div");return t.id="copy-announcer",t.className="sr-only",t.setAttribute("aria-live","polite"),document.body.appendChild(t),t})();function O(e){const t=e.dataset.depKey;if(!t)return;const n=e.querySelector(".dep-details");if(!n||"true"===n.dataset.rendered)return;const a=Y.get(t);a&&(n.setAttribute("aria-busy","true"),n.innerHTML=['<div class="dep-loading" role="presentation">','<div class="dep-loading-bar"></div>',"</div>"].join(""),requestAnimationFrame(()=>{n.innerHTML=Me(a,D,X,A.get(t)),n.dataset.rendered="true",n.removeAttribute("aria-busy")}))}function U(e){return(e.selectedOptions[0]?.textContent||"").replace(/\\s+\\(\\d+\\)\$/,"")}function _(){p.search.value="",p.direct.value="all",p.runtime.value="all",p.workspace&&(p.workspace.value="all"),p.hasVulns.checked=!1,p.licensePermissive.checked=!0,p.licenseWeakCopyleft.checked=!0,p.licenseStrongCopyleft.checked=!0,p.licenseUnknown.checked=!0}function Z(){const e=[],t=p.search.value.trim();return t&&e.push({id:"search",label:"Search: "+t,remove:()=>{p.search.value=""}}),"all"!==p.direct.value&&e.push({id:"type",label:"Type: "+U(p.direct),remove:()=>{p.direct.value="all"}}),"all"!==p.runtime.value&&e.push({id:"scope",label:"Scope: "+U(p.runtime),remove:()=>{p.runtime.value="all"}}),p.workspace&&"all"!==p.workspace.value&&e.push({id:"workspace",label:"Workspace: "+U(p.workspace),remove:()=>{p.workspace.value="all"}}),[{id:"license-permissive",checked:p.licensePermissive.checked,label:"License: Permissive",reset:()=>{p.licensePermissive.checked=!0}},{id:"license-weak-copyleft",checked:p.licenseWeakCopyleft.checked,label:"License: Weak Copyleft",reset:()=>{p.licenseWeakCopyleft.checked=!0}},{id:"license-strong-copyleft",checked:p.licenseStrongCopyleft.checked,label:"License: Strong Copyleft",reset:()=>{p.licenseStrongCopyleft.checked=!0}},{id:"license-unknown",checked:p.licenseUnknown.checked,label:"License: Other / Unknown",reset:()=>{p.licenseUnknown.checked=!0}}].forEach(t=>{t.checked||e.push({id:t.id,label:t.label,remove:t.reset})}),p.hasVulns.checked&&e.push({id:"has-vulns",label:"Has vulnerabilities",remove:()=>{p.hasVulns.checked=!1}}),e}function Q(){!function(){const e=Z(),t=e.length;p.filtersToggle.classList.toggle("has-active-filters",t>0),p.filterCountBadge&&(p.filterCountBadge.hidden=0===t,p.filterCountBadge.textContent=String(t)),p.activeFiltersRow&&p.activeFilterChips&&(p.activeFiltersRow.hidden=0===t,p.activeFilterChips.innerHTML=e.map(e=>'<span class="active-filter-chip">'+G(e.label)+'<button type="button" class="active-filter-remove" data-filter-chip="'+G(e.id)+'" aria-label="Remove '+G(e.label)+'">×</button></span>').join(""))}();const a=function(e){const t=[...e];if("name"===g)t.sort((e,t)=>e.package.name.localeCompare(t.package.name));else if("depth"===g)t.sort((e,t)=>e.usage.depth-t.usage.depth);else{const e=R.find(e=>e.sortKey===g||e.id===g);e?.sortFn?t.sort(e.sortFn):e&&t.sort((t,n)=>e.getValue(t).localeCompare(e.getValue(n)))}return h||t.reverse(),t}(function(){const e=(p.search.value||"").toLowerCase(),t=p.direct.value,n=p.runtime.value,a=p.workspace?.value||"all",r=p.hasVulns.checked,s=p.licensePermissive.checked,i=p.licenseWeakCopyleft.checked,o=p.licenseStrongCopyleft.checked,c=p.licenseUnknown.checked;return C.filter(l=>{const d=de(l.package.name,l.package.version);if(N.has(d))return!0;const u=H(l),p=[u.value,l.compliance.license.declared?.spdxId,l.compliance.license.inferred?.spdxId].filter(Boolean).join(" ").toLowerCase();if(e&&!l.package.name.toLowerCase().includes(e)&&!p.includes(e))return!1;if("direct"===t&&!l.usage.direct)return!1;if("transitive"===t&&l.usage.direct)return!1;if("all"!==n&&l.usage.scope!==n)return!1;if("all"!==a&&!x(l).includes(a))return!1;if(r&&!M(l))return!1;const g=\$(u.value);return!("permissive"===g&&!s||"weakCopyleft"===g&&!i||"strongCopyleft"===g&&!o||"unknown"===g&&!c)})}()),r=e.summary?.dependencyCount||C.length;n.innerHTML="Showing <strong>"+a.length+"</strong> of <strong>"+r+"</strong> dependencies","all"!==(p.workspace?.value||"all")&&(n.innerHTML+=" in <strong>"+G(p.workspace.value)+"</strong>"),0!==a.length?(t.innerHTML=a.map(e=>function(e,t){const n=function(e,t,n=0){const a=e.execution?.risk||"green",r=n>0||(e.packaging?.signals?.length||0)>0?"amber":"green",s=(e.supplyChain?.registry?.signals?.length||0)>0?"amber":"green";return(i=[t.risk,e.compliance.licenseRisk,a,r,s]).includes("red")?"red":i.includes("amber")?"amber":"green";var i}(e,W(e).summary,t?.length||0),a=de(e.package.name,e.package.version),r=ge(a),s=te(e),i=['<summary class="dep-summary">','<span class="expand-icon" aria-hidden="true"></span>','<span class="dep-name">'+G(e.package.name)+'<span class="dep-version">@'+G(e.package.version)+"</span></span>",'<div class="dep-indicators" style="--column-count: '+V+'">',s,"</div>","</summary>"].join("");return['<details class="dep-card" data-risk="'+n+'" data-dep-key="'+G(a)+'" id="'+G(r)+'">',i,'<div class="dep-details" data-rendered="false"></div>',"</details>"].join("")}(e,A.get(de(e.package.name,e.package.version)))).join(""),T.clear(),t.querySelectorAll("details.dep-card").forEach(e=>{const t=e.dataset.depKey;t&&T.set(t,e)}),B.forEach(e=>{const t=T.get(e);t&&(t.open||(t.open=!0),O(t))})):t.innerHTML='<div class="empty-state"><div class="empty-state-icon">📦</div><div class="empty-state-text">No dependencies match your filters</div></div>'}function ee(e){const t=X.get(e)||[];return 1===t.length?t[0]:null}function ae(e){if(Y.has(e))return e;const t=pe(e);if(!t)return ee(e);if(t.version.startsWith("npm:")){const e=t.version.slice(4),n=t.name+(e.startsWith("@")?e:"@"+e);if(Y.has(n))return n}return ee(t.name)}function re(t){if(!p.listViewPanel||!p.graphViewPanel)return void console.warn("Dependency Radar: view panels are missing from the report DOM.");const n="list"===t;n||Boolean(p.graphWorkspaceSelect&&p.graphWorkspaceWrap&&p.graphControls&&p.graphCanvas&&p.graphCanvasShell&&p.graphPopover&&p.graphPopoverName&&p.graphPopoverVersion&&p.graphPopoverLicense&&p.graphPopoverVulns&&p.graphPopoverAmplification&&p.graphOpenList)?(p.listViewPanel.classList.toggle("active",n),p.graphViewPanel.classList.toggle("active",!n),p.listViewPanel.setAttribute("aria-hidden",String(!n)),p.graphViewPanel.setAttribute("aria-hidden",String(n)),p.viewGraphButton&&(p.viewGraphButton.style.display=n?"":"none"),p.graphBackButton&&(p.graphBackButton.style.display=n?"none":""),p.reportFooter?.classList.toggle("hidden",!n),document.body.classList.toggle("graph-mode",!n),n?m?.setActive(!1):(v||(m=L({report:e,knownDepKeys:D,resolveDepKey:ae,workspaceSelect:p.graphWorkspaceSelect,workspaceWrap:p.graphWorkspaceWrap,controlsRoot:p.graphControls,canvas:p.graphCanvas,canvasHost:p.graphCanvasShell,popover:p.graphPopover,popoverName:p.graphPopoverName,popoverVersion:p.graphPopoverVersion,popoverLicense:p.graphPopoverLicense,popoverVulns:p.graphPopoverVulns,popoverAmplification:p.graphPopoverAmplification,popoverOpenButton:p.graphOpenList,onOpenList:e=>{!function(e){re("list");let t=document.getElementById(ge(e));!t&&Y.has(e)&&(N.add(e),Q(),t=document.getElementById(ge(e)));if(!t)return;if(t instanceof HTMLDetailsElement){const e=t.dataset.depKey;e&&B.add(e),t.open||(t.open=!0),O(t)}t.classList.add("dep-list-highlight"),se(t,!0),window.setTimeout(()=>{t?.classList.remove("dep-list-highlight")},2e3)}(e)}}),m.initGraphView(),v=!0),m?.setActive(!0),m?.requestRender())):console.warn("Dependency Radar: graph view DOM nodes are missing; graph view disabled.")}function se(e,t=!1){const n=()=>{const n=window.scrollY+e.getBoundingClientRect().top-function(){const e=document.querySelector(".filter-bar");return!e||document.body.classList.contains("graph-mode")?0:Math.ceil(e.getBoundingClientRect().height+8)}();if(window.scrollTo({top:Math.max(0,n),behavior:"smooth"}),t){const t=e.querySelector("summary");t&&t.focus({preventScroll:!0})}};requestAnimationFrame(()=>{n(),window.setTimeout(n,60)})}const ie=[p.search,p.direct,p.runtime,p.sort,p.hasVulns,p.workspace,p.licensePermissive,p.licenseWeakCopyleft,p.licenseStrongCopyleft,p.licenseUnknown],oe=()=>{N.clear(),Q()};ie.forEach(e=>{e&&(e.addEventListener("input",oe),e.addEventListener("change",oe))}),p.activeFilterChips?.addEventListener("click",e=>{const t=e.target.closest("[data-filter-chip]");if(!t)return;const n=Z().find(e=>e.id===t.dataset.filterChip);n&&(n.remove(),oe())});const ce=()=>{_(),oe()};function le(e){const t=e.getAttribute("data-dep-key");if(!t)return;const n=ae(t);if(!n)return;let a=T.get(n);a||(N.add(n),Q(),a=T.get(n)),a&&(B.add(n),a.open||(a.open=!0),O(a),se(a,!0))}p.activeFilterClear?.addEventListener("click",ce),p.clearAllFilters?.addEventListener("click",ce),p.viewGraphButton?.addEventListener("click",()=>{re("graph")}),p.graphBackButton?.addEventListener("click",()=>{re("list")}),t.addEventListener("toggle",e=>{const t=e.target;if(!(t instanceof HTMLDetailsElement))return;if(!t.classList.contains("dep-card"))return;const n=t.dataset.depKey;n&&(t.open?(B.add(n),O(t)):B.delete(n))},!0),t.addEventListener("click",e=>{const t=e.target,n=t.closest(".root-package-link");if(n)return e.preventDefault(),void le(n);const a=t.closest(".copy-json-btn");a&&(e.preventDefault(),async function(e){const t=(e.closest(".raw-data-toggle")?.querySelector("pre"))?.textContent??"";if(t)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(t);else{const e=document.createElement("textarea");e.value=t,e.setAttribute("readonly","true"),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}const n=e.dataset.label||e.textContent||"Copy JSON";e.dataset.label=n,e.textContent="Copied",e.classList.add("copied"),j.textContent="Copied JSON to clipboard.",window.setTimeout(()=>{e.textContent=n,e.classList.remove("copied")},1500)}catch{j.textContent="Copy failed."}}(a))}),t.addEventListener("keydown",e=>{const t=e.target.closest(".root-package-link");t&&(" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),le(t)))}),w(),Q(),re("list")}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Pe):Pe()}();`;