mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-17 17:44:09 +01:00
Merge pull request #959 from tdurieux/feat/errors-triage
feat: rebuild admin errors for focused triage
This commit is contained in:
9 files changed
+1085
-297
No files matched your search
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"core.min.js": "core.d23af1c652.min.js",
|
||||
"vendor.min.js": "vendor.18a81ad2bc.min.js",
|
||||
"vendor.min.js": "vendor.80335936ff.min.js",
|
||||
"mermaid.min.js": "mermaid.a7356d5ed1.min.js",
|
||||
"all.min.css": "all.d45846cc6f.min.css",
|
||||
"all.min.css": "all.f9ba9c23e7.min.css",
|
||||
"markdown.min.js": "markdown.6c8dfb7b1d.min.js",
|
||||
"pdf.min.js": "pdf.4d9cc6ff49.min.js",
|
||||
"notebook.min.js": "notebook.c3144c18ae.min.js",
|
||||
|
||||
Vendored
+1
-1
@@ -10,4 +10,4 @@
|
||||
@container explorer-file (max-width: 700px) {
|
||||
.reviewer-preview .file-card-head .file-card-meta, .reviewer-preview .file-card-head .symbols { display: none !important; }
|
||||
}
|
||||
.reviewer-preview .rp-main{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reviewer-preview .rp-document{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;scrollbar-width:thin;position:relative}.reviewer-preview button.rp-count{background:0 0;border:0;padding:0;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px}.reviewer-preview button.rp-count:hover{text-decoration-color:currentColor}@media (max-width:767px){.reviewer-preview .file-card-head .rp-preserved-tag{display:none}}.billing-page{--bl-subscription:#008C7E;--bl-repository:#D0652A;--bl-conference:#6250D6}.dark-mode .billing-page{--bl-subscription:#16A091;--bl-repository:#D95926;--bl-conference:#9085E9}.billing-page .bl-subscription{background:var(--bl-subscription)!important}.billing-page .bl-repository{background:var(--bl-repository)!important}.billing-page .bl-conference{background:var(--bl-conference)!important}.billing-page .bl-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:4px 0 0}.billing-page .bl-basis{margin:0;font-size:12px;color:var(--ink-muted)}.billing-page .bl-message{display:flex;align-items:center;gap:8px;margin:14px 0 0;padding:10px 14px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);font-size:13px;color:var(--color);background:var(--paper-card)}.billing-page .bl-message .ui-icon{width:16px;height:16px;flex:none;color:var(--ink-muted)}.billing-page .bl-message.ov-performance-warning{border-color:color-mix(in srgb,var(--status-progress) 45%,var(--border-color));background:color-mix(in srgb,var(--status-progress) 8%,var(--paper-card))}.billing-page .bl-message.ov-performance-warning .ui-icon{color:var(--status-progress)}.billing-page .bl-message .btn{margin-left:auto}.overview-page .bl-kpi-row{grid-template-columns:repeat(6,minmax(0,1fr));margin:16px 0 16px}.overview-page .bl-kpi-row .ov-kpi-card{min-width:0;padding:16px 18px}.overview-page .bl-kpi-row .ov-kpi-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .ov-kpi-sub{white-space:normal;overflow-wrap:anywhere;line-height:1.4}.overview-page .bl-kpi-row .ov-kpi-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .bl-muted-value{color:var(--ink-muted);font-size:20px;line-height:28px}.overview-page .bl-kpi-row.is-loading .ov-kpi-card{opacity:.6}.billing-page .bl-skeleton-value{display:block;width:50%;height:28px;margin:4px 0;border-radius:6px}@media (max-width:1279px){.overview-page .bl-kpi-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}}@media (max-width:767px){.overview-page .bl-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}}.billing-page .bl-health{display:flex;align-items:center;flex-wrap:wrap;gap:6px 20px;padding:10px 16px;margin:0 0 16px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);background:var(--paper-card);font-size:13px;font-variant-numeric:tabular-nums}.billing-page .bl-health-title{display:inline-flex;align-items:center;gap:8px;font-weight:600}.billing-page .bl-health-title .ov-svc-dot{width:8px;height:8px;margin:0;border-radius:50%}.billing-page .bl-dot-bad{background:var(--st-bad,#b42318)}.billing-page .bl-health-item .k{color:var(--ink-muted);margin-right:2px}.billing-page .bl-health-item.is-bad{color:var(--st-bad,#b42318);font-weight:600}.billing-page .bl-health-item.is-warn{color:#946519;font-weight:600}.dark-mode .billing-page .bl-health-item.is-warn{color:var(--status-progress)}.dark-mode .billing-page .bl-health-item.is-bad{color:#f08a82}.billing-page .bl-health-error{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.billing-page .bl-health-error code{font-size:12px;color:inherit;background:var(--paper-bg-alt);padding:1px 5px;border-radius:4px}.billing-page .bl-chart-card{margin-bottom:16px}.billing-page .bl-swatch{display:inline-block;width:8px;height:8px;border-radius:2px;flex:none}.billing-page .bl-bars{position:relative;gap:3px}.billing-page .bl-bars.is-dense{gap:1px}.billing-page .bl-col{min-width:0}.billing-page .bl-stack{display:flex;flex-direction:column-reverse;width:100%;gap:1px;border-radius:2px 2px 0 0;overflow:hidden}.billing-page .bl-stack>i{display:block;min-height:2px;flex-basis:0}.billing-page .bl-col:hover .bl-stack{filter:brightness(1.08)}.billing-page .bl-col.is-zero .bl-stack{height:1px!important;background:var(--border-color)}.billing-page .bl-empty{margin:8px 0 4px;padding:32px 0;text-align:center;color:var(--ink-muted)}.billing-page .bl-plans{margin-bottom:24px}.billing-page .ov-metrics-table thead th.bl-group{text-align:center;border-bottom:1px solid var(--border-color)}.billing-page .ov-metrics-table tfoot td,.billing-page .ov-metrics-table tfoot th{border-top:1px solid var(--border-color);border-bottom:0;font-weight:600;background:var(--paper-bg-alt)}.billing-page .ov-metrics-table tboLine truncated
|
||||
.reviewer-preview .rp-main{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reviewer-preview .rp-document{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;scrollbar-width:thin;position:relative}.reviewer-preview button.rp-count{background:0 0;border:0;padding:0;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px}.reviewer-preview button.rp-count:hover{text-decoration-color:currentColor}@media (max-width:767px){.reviewer-preview .file-card-head .rp-preserved-tag{display:none}}.billing-page{--bl-subscription:#008C7E;--bl-repository:#D0652A;--bl-conference:#6250D6}.dark-mode .billing-page{--bl-subscription:#16A091;--bl-repository:#D95926;--bl-conference:#9085E9}.billing-page .bl-subscription{background:var(--bl-subscription)!important}.billing-page .bl-repository{background:var(--bl-repository)!important}.billing-page .bl-conference{background:var(--bl-conference)!important}.billing-page .bl-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:4px 0 0}.billing-page .bl-basis{margin:0;font-size:12px;color:var(--ink-muted)}.billing-page .bl-message{display:flex;align-items:center;gap:8px;margin:14px 0 0;padding:10px 14px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);font-size:13px;color:var(--color);background:var(--paper-card)}.billing-page .bl-message .ui-icon{width:16px;height:16px;flex:none;color:var(--ink-muted)}.billing-page .bl-message.ov-performance-warning{border-color:color-mix(in srgb,var(--status-progress) 45%,var(--border-color));background:color-mix(in srgb,var(--status-progress) 8%,var(--paper-card))}.billing-page .bl-message.ov-performance-warning .ui-icon{color:var(--status-progress)}.billing-page .bl-message .btn{margin-left:auto}.overview-page .bl-kpi-row{grid-template-columns:repeat(6,minmax(0,1fr));margin:16px 0 16px}.overview-page .bl-kpi-row .ov-kpi-card{min-width:0;padding:16px 18px}.overview-page .bl-kpi-row .ov-kpi-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .ov-kpi-sub{white-space:normal;overflow-wrap:anywhere;line-height:1.4}.overview-page .bl-kpi-row .ov-kpi-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .bl-muted-value{color:var(--ink-muted);font-size:20px;line-height:28px}.overview-page .bl-kpi-row.is-loading .ov-kpi-card{opacity:.6}.billing-page .bl-skeleton-value{display:block;width:50%;height:28px;margin:4px 0;border-radius:6px}@media (max-width:1279px){.overview-page .bl-kpi-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}}@media (max-width:767px){.overview-page .bl-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}}.billing-page .bl-health{display:flex;align-items:center;flex-wrap:wrap;gap:6px 20px;padding:10px 16px;margin:0 0 16px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);background:var(--paper-card);font-size:13px;font-variant-numeric:tabular-nums}.billing-page .bl-health-title{display:inline-flex;align-items:center;gap:8px;font-weight:600}.billing-page .bl-health-title .ov-svc-dot{width:8px;height:8px;margin:0;border-radius:50%}.billing-page .bl-dot-bad{background:var(--st-bad,#b42318)}.billing-page .bl-health-item .k{color:var(--ink-muted);margin-right:2px}.billing-page .bl-health-item.is-bad{color:var(--st-bad,#b42318);font-weight:600}.billing-page .bl-health-item.is-warn{color:#946519;font-weight:600}.dark-mode .billing-page .bl-health-item.is-warn{color:var(--status-progress)}.dark-mode .billing-page .bl-health-item.is-bad{color:#f08a82}.billing-page .bl-health-error{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.billing-page .bl-health-error code{font-size:12px;color:inherit;background:var(--paper-bg-alt);padding:1px 5px;border-radius:4px}.billing-page .bl-chart-card{margin-bottom:16px}.billing-page .bl-swatch{display:inline-block;width:8px;height:8px;border-radius:2px;flex:none}.billing-page .bl-bars{position:relative;gap:3px}.billing-page .bl-bars.is-dense{gap:1px}.billing-page .bl-col{min-width:0}.billing-page .bl-stack{display:flex;flex-direction:column-reverse;width:100%;gap:1px;border-radius:2px 2px 0 0;overflow:hidden}.billing-page .bl-stack>i{display:block;min-height:2px;flex-basis:0}.billing-page .bl-col:hover .bl-stack{filter:brightness(1.08)}.billing-page .bl-col.is-zero .bl-stack{height:1px!important;background:var(--border-color)}.billing-page .bl-empty{margin:8px 0 4px;padding:32px 0;text-align:center;color:var(--ink-muted)}.billing-page .bl-plans{margin-bottom:24px}.billing-page .ov-metrics-table thead th.bl-group{text-align:center;border-bottom:1px solid var(--border-color)}.billing-page .ov-metrics-table tfoot td,.billing-page .ov-metrics-table tfoot th{border-top:1px solid var(--border-color);border-bottom:0;font-weight:600;background:var(--paper-bg-alt)}.billing-page .ov-metrics-table tboLine truncated
|
||||
+353
-25
@@ -14329,34 +14329,220 @@ body.dark-mode .reviewer-preview .rp-preserved-tag { background: rgba(251, 191,
|
||||
/* Text: the slot centers on the line's letters, level with parentheses and punctuation. */
|
||||
.markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip, .dark-mode .markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip { vertical-align: .04em !important; }
|
||||
|
||||
/* Admin log investigation uses the existing paper surface and native controls. */
|
||||
.errors-page .log-investigation { margin: 24px 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line, #ddd); }
|
||||
.errors-page .log-investigation h2, .errors-page .redis-history-title { font-size: 1.35rem; margin: 0 0 12px; }
|
||||
.errors-page .log-investigation h3 { font-size: 1rem; margin: 16px 0 8px; }
|
||||
.errors-page .log-filters { align-items: end; flex-wrap: wrap; }
|
||||
.errors-page .log-filters label { display: grid; gap: 4px; font-weight: 600; }
|
||||
.errors-page .log-state { font-weight: 600; margin-top: 12px; }
|
||||
.errors-page .log-coverage, .errors-page .log-health { font-size: .875rem; }
|
||||
.errors-page .log-table-scroll { overflow-x: auto; margin-top: 16px; }
|
||||
.errors-page .log-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
|
||||
.errors-page .log-table caption { text-align: left; caption-side: top; padding: 8px 0; }
|
||||
.errors-page .log-table th, .errors-page .log-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line, #ddd); }
|
||||
.errors-page .log-trace-button { display: block; margin-bottom: 6px; max-width: 270px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
|
||||
.errors-page .log-id, .errors-page .log-events code, .errors-page .log-health li { overflow-wrap: anywhere; }
|
||||
.errors-page .log-events { padding-left: 22px; }
|
||||
.errors-page .log-events li { padding: 8px 0; border-bottom: 1px solid var(--line, #ddd); }
|
||||
.errors-page .log-investigation :focus-visible { outline: 2px solid var(--accent, #39739d); outline-offset: 3px; }
|
||||
@media (max-width: 600px) {
|
||||
.errors-page .log-filters label { width: 100%; }
|
||||
.errors-page .log-table { min-width: 660px; }
|
||||
.errors-page .log-investigation .volume-head { flex-wrap: wrap; gap: 8px; }
|
||||
/* Errors uses the admin paper shell, controls, and semantic status colors. */
|
||||
.errors-page .error-source-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px 24px; margin:16px 0; border-bottom:1px solid var(--border-color); }
|
||||
.errors-page .error-health-strip { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-left:auto; padding:4px 0 8px; max-width:560px; }
|
||||
.errors-page .log-state { flex:1; margin:0; font-size:12px; color:var(--ink-soft); }
|
||||
.errors-page .error-source-switch { display:flex; gap:24px; margin:0; padding:0; border:0; background:none; border-radius:0; }
|
||||
.errors-page .error-source-switch .seg-chip { border:0; border-bottom:2px solid transparent; border-radius:0; padding:10px 0; font-size:14px; font-weight:500; background:none; color:var(--ink-soft); }
|
||||
.errors-page .error-source-switch .seg-chip.active { border-bottom-color:var(--accent); color:var(--color); background:none; }
|
||||
.errors-page .log-investigation { margin:0; }
|
||||
.errors-page .log-investigation h2, .errors-page .redis-history-title { font-size:18px; margin:0; }
|
||||
.errors-page .volume-head { gap:12px; flex-wrap:wrap; margin-bottom:14px; }
|
||||
.errors-page .log-filters, .errors-page .log-local-filters { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin:14px 0 10px; }
|
||||
.errors-page .log-filters label, .errors-page .log-local-filters label { display:grid; gap:6px; margin:0; font-size:12px; font-weight:500; min-width:0; }
|
||||
.errors-page .log-filters label { flex:1; }
|
||||
.errors-page .log-filters .form-control, .errors-page .log-local-filters .form-control { width:100%; min-width:0; }
|
||||
.errors-page .log-local-filters .log-search { flex:1; min-width:180px; }
|
||||
.errors-page .log-coverage, .errors-page .log-meta { font-size:12px; color:var(--ink-muted); }
|
||||
.errors-page .log-coverage { margin:8px 0 14px; }
|
||||
.errors-page .log-meta { display:block; margin-top:4px; }
|
||||
.errors-page .log-workspace { display:flex; align-items:start; gap:20px; }
|
||||
.errors-page .log-results { flex:1; min-width:0; }
|
||||
.errors-page .log-table-scroll { border:1px solid var(--border-color); border-radius:8px; overflow:hidden; background:var(--paper-card); }
|
||||
.errors-page .log-table { width:100%; table-layout:fixed; border-collapse:collapse; font-size:13px; }
|
||||
.errors-page .log-table th, .errors-page .log-table td { padding:10px 16px; text-align:left; vertical-align:middle; overflow-wrap:anywhere; }
|
||||
.errors-page .log-table th { background:var(--paper-bg-alt); color:var(--ink-muted); font-size:12px; font-weight:500; }
|
||||
.errors-page .log-table th:first-child { width:32%; }
|
||||
.errors-page .log-table th:nth-child(2) { width:15%; }
|
||||
.errors-page .log-table th:nth-child(4) { width:13%; }
|
||||
.errors-page .log-table th:nth-child(3) { width:8%; text-align:right; }
|
||||
.errors-page .log-table td.log-count { text-align:right; font:500 14px var(--font-mono); background:transparent !important; box-shadow:none; }
|
||||
.errors-page .log-table th:last-child { width:32%; }
|
||||
.errors-page .log-table tbody tr + tr { border-top:1px solid var(--border-color); }
|
||||
.errors-page .log-table tbody tr:hover { background:var(--paper-bg-alt); }
|
||||
.errors-page .log-table tbody tr.log-selected { background:var(--accent-soft); }
|
||||
.errors-page .log-event-button { display:block; width:100%; min-height:44px; border:0; background:none; color:var(--color); padding:0; text-align:left; font:inherit; cursor:pointer; overflow-wrap:anywhere; }
|
||||
.errors-page .log-event-title { display:flex; align-items:center; gap:10px; }
|
||||
.errors-page .log-event-title .ui-icon { width:14px; height:14px; color:var(--ink-muted); flex-shrink:0; }
|
||||
.errors-page .log-event-button:hover .ui-icon { color:var(--link-color); }
|
||||
.errors-page .log-event-button strong { font-size:14px; font-weight:600; line-height:1.5; }
|
||||
.errors-page .log-event-button:hover strong, .errors-page .log-selected .log-event-button strong { color:var(--link-color); }
|
||||
.errors-page .log-event-button:hover strong { text-decoration:underline; text-underline-offset:3px; }
|
||||
.errors-page .log-service { color:var(--ink-soft); font-weight:500; }
|
||||
.errors-page .log-module { color:var(--ink-muted); font-weight:400; }
|
||||
.errors-page .log-severity { display:inline-flex; align-items:center; gap:6px; font-weight:500; }
|
||||
.errors-page .log-severity::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; flex-shrink:0; }
|
||||
.errors-page .log-severity-error { color:var(--status-error); }
|
||||
.errors-page .log-severity-warn { color:var(--status-progress); }
|
||||
.errors-page .log-severity-info { color:var(--ink-muted); }
|
||||
.errors-page .log-trace-button { display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:4px 0; margin:0 14px 0 0; border:0; background:none; color:var(--link-color); font:500 12px var(--font-sans); cursor:pointer; max-width:100%; white-space:normal; text-align:left; }
|
||||
.errors-page .log-trace-button:hover { text-decoration:underline; text-underline-offset:3px; }
|
||||
.errors-page .log-trace-button:last-child { margin-right:0; }
|
||||
.errors-page .log-http { display:block; margin-top:4px; font:12px var(--font-mono); color:var(--ink-muted); }
|
||||
.errors-page .log-short-id { font:12px var(--font-mono); color:var(--ink-soft); }
|
||||
.errors-page .log-detail { min-width:0; padding:8px 4px; overflow-wrap:anywhere; }
|
||||
.errors-page .log-table .log-detail-row > td { background:var(--paper-bg-alt); }
|
||||
.errors-page .log-table tbody tr { scroll-margin-top:80px; }
|
||||
.errors-page .log-origin { color:var(--ink-soft); margin:0 0 10px; }
|
||||
.errors-page .log-detail dl { display:grid; grid-template-columns:1fr 1fr; gap:0 24px; }
|
||||
.errors-page .log-detail-row .log-detail { width:100%; }
|
||||
.errors-page .log-detail h3, .errors-page .log-timeline h3 { font-size:14px; margin:0; }
|
||||
.errors-page .log-detail dl { margin:0; font-size:12px; }
|
||||
.errors-page .log-detail dl > div { margin-top:12px; }
|
||||
.errors-page .log-detail dt { font-weight:400; font-size:11px; color:var(--ink-muted); }
|
||||
.errors-page .log-detail dd { margin:5px 0 0; font-family:var(--font-mono); line-height:1.6; }
|
||||
.errors-page .log-detail-heading { align-items:flex-start; justify-content:space-between; }
|
||||
.errors-page .log-detail #log-detail-title { font-size:18px !important; line-height:1.4; font-weight:600; margin:0; }
|
||||
.errors-page .log-detail-heading > div { min-width:0; }
|
||||
.errors-page .log-detail-heading > button { flex-shrink:0; }
|
||||
.errors-page .log-detail-section { border-top:1px solid var(--border-color); padding-top:14px; margin-top:18px; }
|
||||
.errors-page .log-detail-section h4 { font-size:12px !important; font-weight:600; margin:0 0 4px; color:var(--ink-soft); }
|
||||
.errors-page .log-detail-identifiers { grid-template-columns:1fr; }
|
||||
.errors-page .log-detail-identifiers > div { display:grid; grid-template-columns:100px minmax(0,1fr); align-items:baseline; gap:12px; }
|
||||
.errors-page .log-detail-identifiers dd { margin:0; }
|
||||
.errors-page .log-detail-dates dd { font-family:var(--font-sans); }
|
||||
.errors-page .log-health, .errors-page .history-summary { margin:20px 0; font-size:12px; color:var(--ink-soft); }
|
||||
.errors-page summary { cursor:pointer; padding:8px 0; }
|
||||
.errors-page .log-health summary span { margin-left:8px; color:var(--ink-muted); }
|
||||
.errors-page .log-health p { margin:8px 0; max-width:75ch; }
|
||||
.errors-page .log-timeline { margin-top:20px; padding:20px; background:var(--paper-bg-alt); border:1px solid var(--border-color); border-radius:8px; font-size:12px; }
|
||||
.errors-page .log-id, .errors-page .log-events code, .errors-page .log-health li { overflow-wrap:anywhere; }
|
||||
.errors-page .log-events { padding-left:20px; }
|
||||
.errors-page .log-events li { padding:12px 0; border-bottom:1px solid var(--border-color); }
|
||||
.errors-page .log-events code { display:block; color:var(--ink-soft); }
|
||||
.errors-page .log-loading { padding:28px 16px; background:var(--paper-bg-alt); color:var(--ink-soft); }
|
||||
.errors-page :focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
|
||||
.errors-page button.errors-row-main { border:0; background:none; color:inherit; width:100%; text-align:left; font:inherit; }
|
||||
.errors-page button.errors-row-main:hover { background:var(--hover-bg-color); }
|
||||
.errors-page .errors-row-main .col-when, .errors-page .errors-row-main .col-msg { display:block; }
|
||||
.errors-page .errors-row-main .when-rel, .errors-page .errors-row-main .when-abs { display:block; }
|
||||
.errors-page .history-source > p { font-size:12px; color:var(--ink-soft); margin:10px 0; }
|
||||
.errors-page .errors-actions { display:flex; flex-wrap:wrap; gap:8px; }
|
||||
@media (max-width:1100px) {
|
||||
.errors-page .log-workspace { flex-direction:column; }
|
||||
.errors-page .log-results, .errors-page .log-detail { width:100%; }
|
||||
}
|
||||
@media (max-width:767px) {
|
||||
.errors-page .log-filters label { flex:1 1 40%; }
|
||||
.errors-page .log-local-filters .log-search { flex-basis:100%; }
|
||||
.errors-page .log-local-filters label { flex:1; }
|
||||
.errors-page .log-table, .errors-page .log-table tbody { display:block; }
|
||||
.errors-page .log-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
|
||||
.errors-page .log-table tbody tr { display:grid; grid-template-columns:1fr auto; gap:8px 12px; padding:14px; }
|
||||
.errors-page .log-table td { display:block; padding:0; min-width:0; }
|
||||
.errors-page .log-table td:first-child { grid-column:1; grid-row:1; }
|
||||
.errors-page .log-table td:nth-child(4) { color:var(--ink-muted); }
|
||||
.errors-page .log-table td:last-child { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:8px; }
|
||||
.errors-page .log-table tbody tr.log-detail-row { display:block; padding:14px; }
|
||||
.errors-page .log-table .log-detail-row > td { display:block; }
|
||||
.errors-page .log-detail dl { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 14px; }
|
||||
.errors-page .log-detail .log-detail-identifiers { grid-template-columns:1fr; }
|
||||
.errors-page .log-detail-identifiers > div { grid-template-columns:62px minmax(0,1fr); }
|
||||
.errors-page .log-detail-heading { gap:10px; }
|
||||
.errors-page .log-detail #log-detail-title { font-size:16px !important; }
|
||||
.errors-page .log-detail { padding:0; }
|
||||
.errors-page .log-count::before { content:'×'; font-size:12px; color:var(--ink-muted); margin-right:3px; }
|
||||
.errors-page .error-source-toolbar { gap:4px; }
|
||||
.errors-page .error-health-strip { padding:0 0 8px; margin:0; width:100%; max-width:none; }
|
||||
.errors-page .log-state { flex:1 1 175px; }
|
||||
.errors-page .log-table td.log-count { align-self:start; padding-top:3px; }
|
||||
.errors-page .log-table td:nth-child(4) { grid-column:2; grid-row:2; align-self:center; margin-top:0; font-size:12px; text-align:right; }
|
||||
.errors-page .log-table td.log-count { grid-column:2; grid-row:1; }
|
||||
.errors-page .log-table td:nth-child(2) { grid-column:1; grid-row:2; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
|
||||
.errors-page .log-http { display:inline; margin:0; }
|
||||
.errors-page .log-trace-button { min-height:44px; margin:0 8px 0 0; }
|
||||
.errors-page .log-timeline { padding:14px; }
|
||||
.errors-page .errors-toolbar > :first-child { min-width:0; }
|
||||
.errors-page .errors-toolbar .seg-filter { flex-wrap:wrap; }
|
||||
.errors-page .errors-row-main { gap:8px; padding-left:12px; padding-right:12px; }
|
||||
.errors-page .history-source .errors-list-head { display:none; }
|
||||
.errors-page .history-source .errors-row-main { grid-template-columns:minmax(0,1fr) auto !important; }
|
||||
.errors-page .history-source .errors-row-main .col-msg { grid-column:1/-1; grid-row:1; }
|
||||
.errors-page .history-source .errors-row-main .col-when { grid-column:1; }
|
||||
.errors-page .history-source .errors-row-main .col-count { grid-column:2; grid-row:2; }
|
||||
.errors-page .history-source .errors-row-main .col-status { grid-column:2; }
|
||||
}
|
||||
|
||||
.errors-page .log-events code { display: block; }
|
||||
@media (max-width: 600px) {
|
||||
.errors-page .errors-header { flex-direction: column; align-items: flex-start; }
|
||||
.errors-page .errors-actions { flex-wrap: wrap; }
|
||||
.errors-page .log-query { margin:0 0 8px; font-size:12px; color:var(--ink-soft); }
|
||||
.errors-page .log-query[open] { border-bottom:1px solid var(--border-color); padding-bottom:8px; }
|
||||
.errors-page .log-query-hint { float:right; color:var(--link-color); }
|
||||
.errors-page .log-investigation > .volume-head:has(.sr-only):not(:has(a)) { margin:0; }
|
||||
.errors-page .error-source-switch .seg-chip { box-shadow:none; }
|
||||
.errors-page .log-filters > label { min-width:0 !important; }
|
||||
@media(max-width:767px) { .errors-page .log-filters > label { width:auto !important; flex:1 1 40%; } }
|
||||
|
||||
/* History starts with its filters and records; diagnostics stay below the list. */
|
||||
.errors-page .history-source .errors-toolbar { display:grid !important; grid-template-columns:auto minmax(180px,1fr) auto; gap:10px !important; align-items:center; }
|
||||
.errors-page .history-source .errors-toolbar > :first-child { min-width:0 !important; }
|
||||
.errors-page .history-source .errors-toolbar .seg-filter { display:flex; flex-wrap:nowrap; width:auto; gap:2px; }
|
||||
.errors-page .history-source .errors-toolbar .seg-chip { white-space:nowrap; padding:6px 8px; }
|
||||
.errors-page .history-source .errors-toolbar .autoref { grid-column:1/-1; justify-self:end; }
|
||||
.errors-page .history-management { margin:20px 0; font-size:12px; color:var(--ink-soft); }
|
||||
.errors-page .history-management > summary { width:fit-content; }
|
||||
.errors-page .history-management .volume-head { margin-top:12px; }
|
||||
.errors-page .history-warning { color:var(--status-progress); font-size:12px; }
|
||||
.errors-page .history-fields { margin:0; display:grid; gap:12px; }
|
||||
.errors-page .history-fields > div { display:grid; grid-template-columns:100px minmax(0,1fr); gap:12px; align-items:baseline; }
|
||||
.errors-page .history-fields dt { margin:0; font:400 12px var(--font-sans); color:var(--ink-muted); }
|
||||
.errors-page .history-fields dd { margin:0; font:12px/1.6 var(--font-mono); overflow-wrap:anywhere; }
|
||||
.errors-page .history-source .errors-row-detail { padding:16px !important; }
|
||||
.errors-page .history-source .detail-body { gap:20px; }
|
||||
.errors-page .history-source .detail-main pre { margin:0; padding:12px; border:1px solid var(--border-color); border-radius:4px; box-shadow:none !important; background:var(--paper-card) !important; font-size:12px; white-space:pre-wrap; overflow-wrap:anywhere; }
|
||||
.errors-page .history-source .detail-tabs { margin-bottom:16px; }
|
||||
.errors-page .log-value-reveal { min-width:0; }
|
||||
.errors-page .log-value-reveal summary { padding:0; font:inherit; color:var(--ink-soft); }
|
||||
.errors-page .log-value-reveal > span { display:block; margin-top:6px; overflow-wrap:anywhere; }
|
||||
.errors-page .log-copy-value { display:inline-block; border:0; background:none; color:var(--link-color); padding:4px 0; font:12px var(--font-sans); cursor:pointer; }
|
||||
.errors-page .log-copy-value:hover { text-decoration:underline; }
|
||||
.errors-page .log-copy-status { font-size:12px; color:var(--ink-soft); }
|
||||
@media(max-width:767px) {
|
||||
.errors-page .history-source .errors-toolbar { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
|
||||
.errors-page .history-source .errors-toolbar .seg-filter, .errors-page .history-source .errors-toolbar .search-wrap { grid-column:1/-1; width:100%; }
|
||||
.errors-page .history-source .errors-toolbar .seg-chip { flex:1; min-width:0; min-height:44px; padding:6px 4px; justify-content:center; }
|
||||
.errors-page .history-source .errors-toolbar .select-wrap { display:grid; gap:4px; }
|
||||
.errors-page .history-source .errors-toolbar .select-wrap select { min-width:0; width:100%; }
|
||||
.errors-page .history-source .errors-toolbar .autoref { justify-self:start; }
|
||||
.errors-page .history-fields > div { grid-template-columns:70px minmax(0,1fr); }
|
||||
.errors-page .log-copy-value { min-height:44px; }
|
||||
.errors-page .history-source .detail-main { min-width:0; }
|
||||
}
|
||||
|
||||
.errors-page .history-view-options { font-size:12px; color:var(--ink-soft); }
|
||||
.errors-page .history-view-controls { display:flex; flex-wrap:wrap; gap:12px; padding:8px 0; }
|
||||
.errors-page .history-source .errors-toolbar:has(.history-view-options[open]) { grid-template-columns:auto minmax(180px,1fr); }
|
||||
.errors-page .history-source .history-view-options[open] { grid-column:1/-1; }
|
||||
@media(max-width:767px) {
|
||||
.errors-page .history-source .errors-toolbar:has(.history-view-options[open]) { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
|
||||
.errors-page .history-source .history-view-options { grid-column:1/-1; }
|
||||
.errors-page .history-source .errors-group-note { display:none; }
|
||||
.errors-page .history-source .errors-group-head { padding:10px 12px; }
|
||||
.errors-page .history-source .errors-row-main .col-status { grid-row:2; }
|
||||
.errors-page .history-source .errors-row-main .col-count { grid-row:1; }
|
||||
.errors-page .history-source .errors-row-main .col-msg { grid-column:1; }
|
||||
}
|
||||
|
||||
.errors-page .history-source .errors-toolbar { grid-template-areas:"severity search options"; }
|
||||
.errors-page .history-source .errors-toolbar > .seg-filter { grid-area:severity; width:auto !important; }
|
||||
.errors-page .history-source .errors-toolbar > .search-wrap { grid-area:search; width:100% !important; min-width:0 !important; }
|
||||
.errors-page .history-source .errors-toolbar > .history-view-options { grid-area:options; }
|
||||
.errors-page .history-source .errors-toolbar:has(.history-view-options[open]) { grid-template-areas:"severity search" "options options"; }
|
||||
@media(max-width:767px) {
|
||||
.errors-page .history-source .errors-toolbar, .errors-page .history-source .errors-toolbar:has(.history-view-options[open]) { grid-template-columns:minmax(0,1fr); grid-template-areas:"severity" "search" "options"; }
|
||||
.errors-page .history-source .errors-toolbar > .seg-filter { width:100% !important; }
|
||||
}
|
||||
|
||||
.errors-page .history-source .detail-aside { background:none !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; padding:12px 0 0 !important; border-top:1px solid var(--border-color) !important; }
|
||||
.errors-page .history-source .aside-label { font:400 11px var(--font-sans) !important; text-transform:none !important; letter-spacing:0 !important; color:var(--ink-muted); }
|
||||
.errors-page .history-source .aside-value { font:400 12px/1.5 var(--font-sans) !important; }
|
||||
.errors-page .history-source .detail-actions { display:flex; flex-wrap:wrap; gap:8px; }
|
||||
.errors-page .history-source .detail-actions .btn { flex:0 0 auto !important; width:auto !important; }
|
||||
@media(max-width:767px) {
|
||||
.errors-page .history-source .detail-aside { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
|
||||
.errors-page .history-source .aside-block { margin:0 !important; min-width:0; }
|
||||
.errors-page .history-source .aside-block:nth-child(n+4) { grid-column:1/-1; }
|
||||
}
|
||||
|
||||
/* Email operations: shared admin surfaces, compact history, progressive details. */
|
||||
.emails-page .email-overview-toolbar, .emails-page .email-section-head, .emails-page .email-refresh { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
|
||||
.email-overview-toolbar { margin:20px 0 10px; }
|
||||
@@ -14410,3 +14596,145 @@ body.dark-mode .reviewer-preview .rp-preserved-tag { background: rgba(251, 191,
|
||||
#email-history-title { scroll-margin-top:80px; }
|
||||
|
||||
.email-jump { font-size:12px; margin-right:auto; }
|
||||
|
||||
.errors-page .log-correlations { display:flex; flex-wrap:wrap; gap:8px 16px; }
|
||||
.errors-page .log-correlations .log-trace-button { min-height:44px; margin:0; }
|
||||
|
||||
.errors-page .log-explanation { margin:16px 0; max-width:760px; }
|
||||
.errors-page .log-explanation p { margin:6px 0; font-size:13px; line-height:1.6; }
|
||||
.errors-page .log-explanation .log-explanation-lead { font-size:15px; font-weight:500; color:var(--color); }
|
||||
.errors-page .log-detail-identifiers > div { display:block; }
|
||||
.errors-page .log-detail-identifiers dt { margin-bottom:6px; }
|
||||
.errors-page .log-detail-identifiers dd { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
|
||||
.errors-page .log-detail-identifiers .log-value-reveal { flex:1 1 100%; padding:8px 10px; border:1px solid var(--border-color); border-radius:4px; background:var(--paper-card); font:13px var(--font-mono); }
|
||||
.errors-page .log-detail-identifiers .log-copy-value, .errors-page .log-follow-id { min-height:32px; padding:4px 8px; border:1px solid var(--border-color); border-radius:4px; background:var(--paper-card); color:var(--link-color); font:12px var(--font-sans); cursor:pointer; }
|
||||
@media(max-width:767px) { .errors-page .log-detail-identifiers .log-copy-value, .errors-page .log-follow-id { min-height:44px; } }
|
||||
@media(max-width:767px) {
|
||||
.errors-page .log-detail-identifiers .log-value-reveal { padding:0; }
|
||||
.errors-page .log-detail-identifiers .log-value-reveal > summary { min-height:44px; box-sizing:border-box; padding:12px 10px; }
|
||||
.errors-page .log-detail-identifiers .log-value-reveal > span { margin:0; padding:0 10px 10px; }
|
||||
}
|
||||
|
||||
/* Errors: issue list → focused event inspector. */
|
||||
.errors-page .log-list-view .log-table th:first-child { width:52%; }
|
||||
.errors-page .log-list-view .log-table th:nth-child(2) { width:18%; }
|
||||
.errors-page .log-list-view .log-table th:nth-child(3) { width:12%; }
|
||||
.errors-page .log-list-view .log-table th:last-child { width:18%; }
|
||||
.errors-page .log-list-view .log-table td { padding:14px 16px; }
|
||||
.errors-page .log-query { margin:0; }
|
||||
.errors-page .log-query > summary { display:flex; gap:16px; width:fit-content; }
|
||||
.errors-page .log-query-hint { float:none; }
|
||||
.errors-page .log-local-filters { margin-top:8px; }
|
||||
.errors-page .log-back { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0; border:0; background:none; color:var(--link-color); font:13px var(--font-sans); cursor:pointer; }
|
||||
.errors-page .log-inspector-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:12px 0 24px; }
|
||||
.errors-page .log-inspector-eyebrow { color:var(--ink-muted); font-size:12px; margin:0 0 6px; }
|
||||
.errors-page .log-inspector #log-detail-title { font:600 24px/1.35 var(--font-sans); margin:0; overflow-wrap:anywhere; }
|
||||
.errors-page .log-inspector-heading > div { min-width:0; }
|
||||
.errors-page .log-inspector-heading > .log-severity { flex-shrink:0; font-size:12px; }
|
||||
.errors-page .log-inspector-tabs { display:flex; gap:28px; border-bottom:1px solid var(--border-color); }
|
||||
.errors-page .log-inspector-tabs button { min-height:44px; padding:8px 0; border:0; border-bottom:2px solid transparent; background:none; font:500 14px var(--font-sans); color:var(--ink-muted); cursor:pointer; }
|
||||
.errors-page .log-inspector-tabs button.active { color:var(--color); border-bottom-color:var(--accent); }
|
||||
.errors-page .log-overview { display:grid; grid-template-columns:minmax(0,1fr) 280px; padding:0; background:var(--paper-card); border:1px solid var(--border-color); border-top:0; }
|
||||
.errors-page .log-overview-main { min-width:0; padding:28px; }
|
||||
.errors-page .log-overview h3 { font:600 13px var(--font-sans); margin:0 0 12px; }
|
||||
.errors-page .log-overview .log-explanation-lead { font:500 17px/1.55 var(--font-sans); color:var(--color); margin:0 0 12px; }
|
||||
.errors-page .log-evidence { font:13px/1.6 var(--font-sans); color:var(--ink-soft); }
|
||||
.errors-page .log-overview .log-coverage { font-size:12px; line-height:1.6; max-width:65ch; }
|
||||
.errors-page .log-overview-context { padding:28px 22px; border-left:1px solid var(--border-color); background:var(--paper-bg-alt); min-width:0; }
|
||||
.errors-page .log-occurrence-total { display:block; font:500 28px var(--font-sans); margin-bottom:20px; font-variant-numeric:tabular-nums; }
|
||||
.errors-page .log-overview-context dl { display:block; }
|
||||
.errors-page .log-overview-context dd { font:13px/1.6 var(--font-sans); }
|
||||
.errors-page .log-overview-context .log-identifiers-title { margin-top:28px; }
|
||||
.errors-page .log-overview-context .log-value-reveal { padding:0; }
|
||||
.errors-page .log-overview-context .log-value-reveal summary { min-height:44px; box-sizing:border-box; padding:12px 10px; }
|
||||
.errors-page .log-overview-context .log-value-reveal > span { padding:0 10px 10px; margin:0; font-size:12px; }
|
||||
.errors-page .log-overview-context .log-copy-value { padding:0; min-height:32px; border:0; background:none; }
|
||||
.errors-page .log-next-step { border-top:1px solid var(--border-color); margin-top:28px; padding-top:24px; }
|
||||
.errors-page .log-next-step p { color:var(--ink-soft); font-size:13px; margin:0 0 16px; }
|
||||
.errors-page .log-detail-actions { display:flex; flex-wrap:wrap; gap:10px; }
|
||||
.errors-page .log-detail-actions .log-trace-button { margin:0; padding:8px 12px; min-height:40px; border:1px solid var(--border-color); border-radius:4px; background:var(--paper-card); }
|
||||
.errors-page .log-all-fields { border-top:1px solid var(--border-color); margin-top:28px; padding-top:12px; font-size:13px; }
|
||||
.errors-page .log-all-fields > summary { min-height:44px; box-sizing:border-box; padding:12px 0; }
|
||||
.errors-page .log-all-fields > summary > span { color:var(--ink-muted); margin-left:8px; }
|
||||
.errors-page .log-all-fields dl { grid-template-columns:1fr 1fr; padding-bottom:16px; }
|
||||
.errors-page .log-all-fields dt { font-size:12px; }
|
||||
.errors-page .log-all-fields dd { font-size:13px; }
|
||||
.errors-page .log-inspector .log-timeline { margin:0; padding:24px 28px; border-top:0; border-radius:0; background:var(--paper-card); }
|
||||
.errors-page .log-timeline .volume-head { justify-content:space-between; }
|
||||
.errors-page .log-timeline h3 { font-size:16px; }
|
||||
.errors-page .log-timeline .log-origin { font-size:13px; }
|
||||
.errors-page .log-events { list-style:none; padding:0; margin-top:24px; }
|
||||
.errors-page .log-events li { display:grid; grid-template-columns:145px minmax(0,1fr); gap:20px; padding:18px 0; border-bottom:1px solid var(--border-color); }
|
||||
.errors-page .log-events time { color:var(--ink-muted); font:12px/1.6 var(--font-mono); }
|
||||
.errors-page .log-timeline-event-title { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
|
||||
.errors-page .log-timeline-event-title strong { font-size:14px; overflow-wrap:anywhere; }
|
||||
.errors-page .log-timeline-event p { margin:6px 0; color:var(--ink-muted); font-size:12px; }
|
||||
.errors-page .log-event-fields > summary, .errors-page .log-timeline-scope > summary { color:var(--ink-muted); font-size:12px; }
|
||||
.errors-page .log-event-fields pre, .errors-page .log-raw-sample pre { padding:12px; background:var(--paper-bg-alt); border:1px solid var(--border-color); border-radius:4px; box-shadow:none; white-space:pre-wrap; overflow-wrap:anywhere; font:12px/1.6 var(--font-mono); }
|
||||
.errors-page .log-timeline-scope code { display:block; overflow-wrap:anywhere; }
|
||||
@media(max-width:767px) {
|
||||
.errors-page .log-list-view .log-table td { padding:0; }
|
||||
.errors-page .log-list-view .log-table td:last-child { grid-column:2; grid-row:2; display:block; }
|
||||
.errors-page .log-inspector-heading { display:block; margin-bottom:16px; }
|
||||
.errors-page .log-inspector-heading > .log-severity { margin-top:12px; }
|
||||
.errors-page .log-inspector #log-detail-title { font-size:21px; }
|
||||
.errors-page .log-overview { grid-template-columns:minmax(0,1fr); }
|
||||
.errors-page .log-overview-main, .errors-page .log-overview-context { padding:20px; }
|
||||
.errors-page .log-overview-context { border-left:0; border-top:1px solid var(--border-color); }
|
||||
.errors-page .log-detail-actions .log-trace-button, .errors-page .log-overview-context .log-copy-value { min-height:44px; }
|
||||
.errors-page .log-inspector .log-timeline { padding:20px; }
|
||||
.errors-page .log-events li { grid-template-columns:minmax(0,1fr); gap:6px; }
|
||||
.errors-page .log-event-fields summary, .errors-page .log-timeline-scope summary { min-height:44px; box-sizing:border-box; padding:12px 0; }
|
||||
}
|
||||
.errors-page #history-inspector-title { font:600 24px/1.35 var(--font-sans); margin:0; overflow-wrap:anywhere; }
|
||||
.errors-page .history-inspector { border-top:0; border-radius:0; }
|
||||
.errors-page .history-inspector .errors-row { border:0; }
|
||||
.errors-page .history-inspector .errors-row-detail { background:var(--paper-card); padding:24px !important; }
|
||||
.errors-page .history-inspector .detail-tabs { margin-bottom:20px; }
|
||||
.errors-page .history-inspector .detail-main { min-width:0; }
|
||||
@media(max-width:767px) { .errors-page #history-inspector-title { font-size:21px; } .errors-page .history-inspector .errors-row-detail { padding:20px !important; } }
|
||||
.errors-page .history-technical { margin:20px 0; border-top:1px solid var(--border-color); }
|
||||
.errors-page .history-technical > summary { min-height:44px; padding:12px 0; box-sizing:border-box; font-size:13px; }
|
||||
.errors-page .history-inspector .detail-main > div > h3 { font:600 13px var(--font-sans); margin:0 0 12px; }
|
||||
.errors-page .history-inspector .log-explanation-lead { font:500 17px/1.55 var(--font-sans); }
|
||||
.errors-page .history-source .log-inspector-tabs { margin-bottom:0; flex-wrap:wrap; }
|
||||
|
||||
/* Investigation-first inspector: related events are the primary content. */
|
||||
.errors-page .log-facts-strip { display:flex; flex-wrap:wrap; gap:12px 28px; padding:0 0 20px; color:var(--ink-muted); font-size:12px; }
|
||||
.errors-page .log-facts-strip strong, .errors-page .log-facts-strip time { color:var(--ink-soft); font-weight:500; font-variant-numeric:tabular-nums; }
|
||||
.errors-page .log-investigation-body { display:grid; grid-template-columns:minmax(0,1fr) 260px; border:1px solid var(--border-color); border-radius:6px; padding:0; background:var(--paper-card); }
|
||||
.errors-page .log-related-main { min-width:0; }
|
||||
.errors-page .log-correlation-selector { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:12px 20px; border-bottom:1px solid var(--border-color); font-size:12px; color:var(--ink-muted); }
|
||||
.errors-page .log-correlation-selector .log-trace-button { margin:0; padding:7px 10px; min-height:36px; border:1px solid transparent; border-radius:4px; font-size:12px; }
|
||||
.errors-page .log-correlation-selector .log-trace-button[aria-pressed=true] { border-color:var(--border-color); background:var(--paper-bg-alt); color:var(--color); }
|
||||
.errors-page .log-selector-mark { margin-left:6px; }
|
||||
.errors-page .log-correlation-window { margin-left:auto; }
|
||||
.errors-page .log-investigation-body .log-timeline { padding:20px; border:0; }
|
||||
.errors-page .log-investigation-body .log-timeline h3 { font-size:14px; }
|
||||
.errors-page .log-investigation-body .log-events { margin:16px 0; }
|
||||
.errors-page .log-investigation-body .log-events li { grid-template-columns:88px minmax(0,1fr); gap:16px; padding:16px 0; }
|
||||
.errors-page .log-investigation-body .log-events time { font-size:11px; padding-top:2px; }
|
||||
.errors-page .log-investigation-body .log-timeline-event { position:relative; padding-left:16px; border-left:1px solid var(--border-color); }
|
||||
.errors-page .log-investigation-body .log-timeline-event::before { content:''; position:absolute; top:6px; left:-4px; width:7px; height:7px; border-radius:50%; background:var(--ink-muted); }
|
||||
.errors-page .log-sample-panel { min-width:0; border-left:1px solid var(--border-color); padding:20px; background:var(--paper-bg-alt); border-radius:0 6px 6px 0; }
|
||||
.errors-page .log-sample-panel h3, .errors-page .log-no-trace h3 { font:600 14px var(--font-sans); margin:0 0 10px; }
|
||||
.errors-page .log-sample-panel dl { display:block; }
|
||||
.errors-page .log-sample-panel dt { font-size:11px; }
|
||||
.errors-page .log-sample-panel dd { font-size:12px; }
|
||||
.errors-page .log-sample-panel .log-value-reveal { padding:0; }
|
||||
.errors-page .log-sample-panel .log-value-reveal summary { min-height:44px; padding:12px 8px; box-sizing:border-box; font-size:12px; }
|
||||
.errors-page .log-sample-panel .log-value-reveal > span { padding:0 8px 8px; margin:0; }
|
||||
.errors-page .log-sample-panel .log-copy-value { min-height:32px; border:0; background:none; padding:0; }
|
||||
.errors-page .log-sample-panel .log-all-fields { margin-top:16px; }
|
||||
.errors-page .log-sample-panel .log-all-fields summary { font-size:12px; }
|
||||
.errors-page .log-no-trace { padding:24px; font-size:13px; }
|
||||
@media(max-width:767px) {
|
||||
.errors-page .log-inspector-heading { margin-top:4px; }
|
||||
.errors-page .log-facts-strip { gap:8px 16px; padding-bottom:16px; }
|
||||
.errors-page .log-investigation-body { grid-template-columns:minmax(0,1fr); }
|
||||
.errors-page .log-sample-panel { border-left:0; border-top:1px solid var(--border-color); border-radius:0 0 6px 6px; }
|
||||
.errors-page .log-correlation-selector { padding:10px 14px; }
|
||||
.errors-page .log-correlation-selector .log-trace-button, .errors-page .log-sample-panel .log-copy-value { min-height:44px; }
|
||||
.errors-page .log-investigation-body .log-timeline { padding:16px; }
|
||||
.errors-page .log-investigation-body .log-events li { grid-template-columns:minmax(0,1fr); gap:6px; }
|
||||
}
|
||||
+232
-188
@@ -1,14 +1,5 @@
|
||||
<div class="container paper-page admin-page errors-page">
|
||||
<div class="paper-crumbs">Admin / <span class="here">Errors</span></div>
|
||||
|
||||
<header class="errors-header">
|
||||
<h1 class="paper-page-title">Errors</h1>
|
||||
<div class="errors-actions">
|
||||
<button class="btn btn-sm" type="button" @click="exportCsv()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-export"></use></svg> Export Redis CSV</button>
|
||||
<button class="btn btn-sm btn-outline-danger" type="button" @click="clearAll()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-trash"></use></svg> Clear Redis history</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="container paper-page admin-page overview-page errors-page">
|
||||
<header class="page-head"><div class="paper-crumbs"><a href="/admin/">Admin</a> / <span class="here">Errors</span></div><div class="ov-header page-head-main"><h1 class="paper-page-title">Errors</h1></div></header>
|
||||
<nav class="admin-nav">
|
||||
<a href="/admin/"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chart"></use></svg> Overview</a>
|
||||
<a href="/admin/repositories"><svg class="ui-icon" aria-hidden="true"><use href="#project-type-repo"></use></svg> Repositories</a>
|
||||
@@ -17,16 +8,45 @@
|
||||
<a href="/admin/billing"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-card"></use></svg> Billing</a>
|
||||
<a href="/admin/queues"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-list"></use></svg> Queues</a>
|
||||
<a href="/admin/emails"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-list"></use></svg> Emails</a>
|
||||
<a href="/admin/errors" class="active"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg> Errors</a>
|
||||
<a href="/admin/errors" class="active" aria-current="page"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg> Errors</a>
|
||||
</nav>
|
||||
|
||||
<section class="log-investigation" aria-labelledby="central-logs-title" :aria-busy="logLoading">
|
||||
<div class="volume-head">
|
||||
<h2 id="central-logs-title">Central log investigation</h2>
|
||||
<a v-if="logData?.grafanaUrl" :href="safeUrl(logData.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open in Grafana</a>
|
||||
</div>
|
||||
<p>Warnings, errors and Nginx 5xx responses from VictoriaLogs. Counts describe only this bounded result window and are never added to Redis history.</p>
|
||||
<form class="errors-toolbar log-filters" @submit.prevent="refreshLogs()">
|
||||
<div class="error-source-toolbar">
|
||||
<div class="error-source-switch seg-filter" role="group" aria-label="Log source">
|
||||
<button id="error-source-central" type="button" class="seg-chip" :class="{active:errorSource==='central'}" :aria-pressed="errorSource==='central'" @click="errorSource='central'">Central logs</button>
|
||||
<button id="error-source-history" type="button" class="seg-chip" :class="{active:errorSource==='history'}" :aria-pressed="errorSource==='history'" @click="errorSource='history'">Application history</button>
|
||||
</div>
|
||||
<div class="error-health-strip">
|
||||
<p class="log-state" role="status" aria-live="polite">{{ errorSource === 'history' ? (redisLoading ? 'Loading application history…' : available === null ? 'Checking Redis…' : available ? 'Redis history is reachable.' : 'Redis history is unavailable. Previously loaded rows may be stale.') : logFailure || (logLoading ? 'Loading central logs…' : logSnapshotStale ? 'This snapshot is stale. Refresh before assessing current health.' : logStateText(logData?.state)) }}</p>
|
||||
<button type="button" class="btn btn-sm" :disabled="errorSource === 'central' ? logLoading : redisLoading" @click="errorSource === 'central' ? refreshLogs() : refreshNow()">{{ (errorSource === 'central' ? logLoading : redisLoading) ? 'Refreshing…' : 'Refresh' }}<span class="sr-only">{{ errorSource === 'central' ? ' central logs' : ' history' }}</span></button>
|
||||
<button v-if="errorSource === 'central' && (logFailure || ['disabled','misconfigured','unreachable','busy'].includes(logData?.state))" type="button" class="btn btn-sm" @click="errorSource = 'history'">Open application history</button>
|
||||
</div>
|
||||
</div>
|
||||
<section v-show="errorSource==='central'" class="log-investigation" aria-labelledby="central-logs-title" :aria-busy="logLoading">
|
||||
<div class="volume-head"><h2 class="sr-only" id="central-logs-title">Central logs</h2><a v-if="logData?.grafanaUrl" :href="safeUrl(logData.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open in Grafana</a></div>
|
||||
<section class="log-inspector" v-if="selectedLog" aria-labelledby="log-detail-title">
|
||||
<button type="button" class="log-back" @click="closeLogDetail()"><span aria-hidden="true">←</span> Back to events</button>
|
||||
<div class="log-inspector-heading"><div><p class="log-inspector-eyebrow">{{ selectedLog.sample.service }} / {{ selectedLog.sample.module }} · Event sample</p><h2 id="log-detail-title" tabindex="-1">{{ selectedLog.sample.errorCode || selectedLog.sample.event }}</h2></div><span class="log-severity" :class="'log-severity-'+logSeverity(selectedLog.sample)">{{ logSeverity(selectedLog.sample)==='error' ? 'Failure' : logSeverity(selectedLog.sample)==='warn' ? 'Warning' : 'Info' }}<span v-if="selectedLog.sample.status || selectedLog.sample.httpStatus"> · HTTP {{ selectedLog.sample.status || selectedLog.sample.httpStatus }}</span></span></div>
|
||||
<div class="log-facts-strip"><span><strong>{{ selectedLog.count }}</strong> returned occurrences</span><span>First <time :datetime="selectedLog.first">{{ absTimeShort(selectedLog.first) }}</time></span><span>Last <time :datetime="selectedLog.last">{{ absTimeShort(selectedLog.last) }}</time></span></div>
|
||||
<div class="log-detail log-investigation-body" id="log-detail">
|
||||
<div class="log-related-main"><div class="log-correlation-selector" role="group" aria-label="Related events correlation"><span>Follow</span><button type="button" class="log-trace-button" v-for="kind in ['requestId','jobId'].filter(key=>logTraceId(selectedLog,key))" :key="kind" :id="'trace-selector-'+kind" :aria-label="'Follow '+(kind==='requestId' ? 'request ' : 'job ')+selectedLog.sample[kind]" :aria-pressed="traceSelection?.kind===kind" @click="lookupTrace(kind,selectedLog.sample[kind],$event.currentTarget,selectedLog.sample)">{{ kind==='requestId' ? 'Request' : 'Job' }} <span class="log-selector-mark" aria-hidden="true">{{ traceSelection?.kind===kind ? '✓' : '→' }}</span></button><span class="log-meta" v-if="!logTraceId(selectedLog,'requestId') && !logTraceId(selectedLog,'jobId')">No correlation ID recorded</span><span class="log-correlation-window">{{ logData?.window || logAppliedFilters.window }} window</span></div>
|
||||
<section class="log-timeline" v-if="traceSelection" aria-labelledby="log-timeline-title" :aria-busy="traceLoading">
|
||||
<div class="volume-head"><h3 id="log-timeline-title" tabindex="-1">Related events</h3><button type="button" class="btn btn-sm" @click="closeTrace()">Hide events</button></div>
|
||||
<p role="status" v-if="traceLoading || trace?.state !== 'ready'">{{ traceLoading ? 'Loading related events…' : trace?.state === 'empty' ? 'No related events returned in this window.' : logStateText(trace?.state) }}</p>
|
||||
<p class="log-coverage" v-if="trace && !traceLoading">{{ trace.events?.length || 0 }} events returned · {{ absTime(trace.start) }} – {{ absTime(trace.end) }} · 200-event cap. All services and releases.</p>
|
||||
<ol class="log-events" v-if="trace?.events?.length"><li v-for="(event,index) in trace.events" :key="index"><time :datetime="event.timestamp" :title="event.timestamp">{{ absTimeShort(event.timestamp) }}</time><div class="log-timeline-event"><div class="log-timeline-event-title"><strong>{{ event.errorCode || event.event }}</strong><span class="log-severity" :class="'log-severity-'+logSeverity(event)">{{ event.status ? 'HTTP '+event.status : event.severity || 'Event' }}</span></div><p>{{ event.service }}<span v-if="event.module"> / {{ event.module }}</span><span v-if="event.ms !== undefined"> · {{ event.ms }} ms</span><span v-if="event.attempt !== undefined"> · attempt {{ event.attempt }}</span></p><details class="log-event-fields"><summary>Event fields</summary><pre>{{ JSON.stringify(event,null,2) }}</pre><button type="button" class="btn btn-sm" @click="copyLogValue(JSON.stringify(event,null,2))">Copy JSON</button></details></div></li></ol>
|
||||
<details class="log-timeline-scope"><summary>Query scope</summary><p>Earliest matching events for the selected {{ traceSelection.kind==='jobId' ? 'job' : 'request' }} ID. Service and release filters do not narrow this timeline.</p></details>
|
||||
<a v-if="trace?.grafanaUrl" :href="safeUrl(trace.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open in Grafana</a>
|
||||
</section>
|
||||
<div class="log-no-trace" v-if="!traceSelection"><h3>{{ logTraceId(selectedLog,'requestId') || logTraceId(selectedLog,'jobId') ? 'Related events hidden' : 'This sample has no correlation ID' }}</h3><p>{{ logExplanation(selectedLog.sample) }}</p><p class="log-evidence">{{ logEvidence(selectedLog.sample) }}</p><p class="log-coverage">{{ logTraceId(selectedLog,'requestId') || logTraceId(selectedLog,'jobId') ? 'Choose Request or Job above to load related events.' : 'The recorded fields are available in the sample panel. Related events cannot be looked up for this record.' }}</p></div>
|
||||
</div>
|
||||
<aside class="log-sample-panel"><h3>Event sample</h3><p class="log-coverage">One of {{ selectedLog.count }} returned occurrences. IDs can differ across the group.</p><dl class="log-sample-facts"><div><dt>Service</dt><dd>{{ selectedLog.sample.service }}</dd></div><div><dt>Module</dt><dd>{{ selectedLog.sample.module || 'Not recorded' }}</dd></div><div><dt>Event</dt><dd>{{ selectedLog.sample.event }}</dd></div><div v-if="selectedLog.sample.release"><dt>Release</dt><dd>{{ selectedLog.sample.release }}</dd></div></dl>
|
||||
<dl class="log-detail-identifiers"><template v-for="kind in ['requestId','jobId']" :key="kind"><div v-if="logTraceId(selectedLog,kind)"><dt>{{ kind==='requestId' ? 'Request ID' : 'Job ID' }}</dt><dd><details class="log-value-reveal"><summary>{{ compactLogValue(selectedLog.sample[kind]) }}</summary><span>{{ selectedLog.sample[kind] }}</span></details><button type="button" class="log-copy-value" @click="copyLogValue(selectedLog.sample[kind])">Copy full ID</button></dd></div></template></dl>
|
||||
<details class="log-all-fields"><summary>All sample fields <span>{{ Object.keys(selectedLog.sample).length }}</span></summary><p class="log-coverage">Safe API fields only; request paths and stack traces are not included.</p><dl><div v-for="(value,key) in selectedLog.sample" :key="key" v-show="!['requestId','jobId'].includes(key)"><dt>{{ key }}</dt><dd>{{ value }}</dd></div></dl><details class="log-raw-sample"><summary>Raw sample</summary><pre>{{ JSON.stringify(selectedLog.sample,null,2) }}</pre><button class="btn btn-sm" type="button" @click="copyLogValue(JSON.stringify(selectedLog.sample,null,2))">Copy JSON</button></details></details></aside>
|
||||
</div>
|
||||
</section>
|
||||
<div class="log-list-view" v-show="!selectedLog">
|
||||
<details class="log-query"><summary>Window: {{ logAppliedFilters.window }} · {{ logAppliedFilters.service || 'All services' }}<span v-if="logAppliedFilters.release"> · {{ logAppliedFilters.release }}</span><span class="log-query-hint">Time & service</span></summary> <form class="errors-toolbar log-filters" @submit.prevent="refreshLogs()">
|
||||
<label>Time window
|
||||
<select class="form-control" v-model="logFilters.window" id="log-window">
|
||||
<option value="15m">Last 15 minutes</option><option value="1h">Last hour</option><option value="6h">Last 6 hours</option><option value="24h">Last 24 hours</option>
|
||||
@@ -40,13 +60,39 @@
|
||||
<label>Release SHA
|
||||
<input class="form-control" id="log-release" v-model="logFilters.release" maxlength="40" placeholder="All releases" pattern="[a-f0-9]{7,40}|unknown" autocomplete="off">
|
||||
</label>
|
||||
<button class="btn btn-sm" type="submit" :disabled="logLoading">{{ logLoading ? 'Loading…' : 'Apply / refresh' }}</button>
|
||||
<button class="btn btn-sm" type="submit" :disabled="logLoading">{{ logLoading ? 'Loading…' : 'Refresh logs' }}</button>
|
||||
</form>
|
||||
<p class="log-state" role="status" aria-live="polite">{{ logFailure || (logLoading ? 'Loading central logs…' : logSnapshotStale ? 'This snapshot is stale. Refresh before assessing current health.' : logStateText(logData?.state)) }}</p>
|
||||
<template v-if="logData && !logLoading">
|
||||
<p class="log-coverage" v-if="logData.captured !== undefined">{{ absTime(logData.start) }} – {{ absTime(logData.end) }} · {{ logData.captured ?? 0 }} records returned · at most 1,000 recent records. Group counts and first/last dates apply to returned records only.</p>
|
||||
<div class="log-health" v-if="logData.telemetry">
|
||||
<h3>Telemetry · 90 seconds before last check, independent of error filters</h3>
|
||||
<p class="log-coverage" v-if="logData?.captured !== undefined">{{ logData.captured }} records returned · 1,000-record cap · {{ absTime(logData.start) }} to {{ absTime(logData.end) }}</p>
|
||||
</details>
|
||||
<div class="log-local-filters">
|
||||
<label class="log-search">Search returned groups<input class="form-control" type="search" v-model="logView.search" placeholder="Event, service, code or sample ID"></label>
|
||||
<label>Severity<select class="form-control" v-model="logView.severity"><option value="">All severities</option><option value="error">Failure / HTTP 5xx</option><option value="warn">Warning</option><option value="info">Info</option></select></label>
|
||||
<label>Sort<select class="form-control" v-model="logView.sort"><option value="recent">Most recent</option><option value="count">Most frequent</option></select></label>
|
||||
</div>
|
||||
<p class="log-coverage" role="status" title="Counts and first/last dates apply only to returned records, not all matching events.">{{ filteredLogGroups().length }} of {{ logData?.groups?.length || 0 }} returned groups · {{ logData?.captured ?? 0 }} records · 1,000-record cap.</p>
|
||||
<div class="log-loading" v-if="logLoading">Loading event groups…</div>
|
||||
<div class="log-workspace" v-else>
|
||||
<div class="log-results">
|
||||
<div class="log-table-scroll" v-if="filteredLogGroups().length"><table class="log-table" role="table">
|
||||
<caption class="sr-only">Returned events grouped by service, module, code, severity and status. Select an event for sample details.</caption>
|
||||
<thead><tr><th scope="col">Event</th><th scope="col">Severity</th><th scope="col">Count</th><th scope="col">Last seen</th></tr></thead>
|
||||
<tbody><template v-for="group in filteredLogGroups()" :key="group.fingerprint"><tr :class="{'log-selected':selectedLog?.fingerprint===group.fingerprint}">
|
||||
<td><button class="log-event-button" type="button" :aria-label="'Inspect ' + (group.sample.errorCode || group.sample.event)" @click="selectLog(group, $event.currentTarget)" :aria-expanded="selectedLog?.fingerprint===group.fingerprint" aria-controls="log-detail"><span class="log-event-title"><strong>{{ group.sample.errorCode || group.sample.event }}</strong><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-arrow-right"></use></svg></span><span class="log-meta"><span class="log-service">{{ group.sample.service }}</span><span class="log-module"> / {{ group.sample.module }}</span></span></button></td>
|
||||
<td class="log-level"><span class="log-severity" :class="'log-severity-'+logSeverity(group.sample)">{{ logSeverity(group.sample)==='error' ? 'Failure' : logSeverity(group.sample)==='warn' ? 'Warning' : 'Info' }}</span><span class="log-http" v-if="group.sample.status || group.sample.httpStatus">HTTP {{ group.sample.status || group.sample.httpStatus }}</span></td>
|
||||
<td class="log-count"><span class="sr-only">Count </span>{{ group.count }}</td>
|
||||
<td><time :datetime="group.last" :title="absTime(group.last)">{{ relTime(group.last) }}</time></td>
|
||||
|
||||
</tr>
|
||||
|
||||
</template></tbody>
|
||||
</table></div>
|
||||
<div class="admin-empty" v-else-if="logData?.groups?.length">No returned groups match these filters. <button class="btn btn-sm" @click="logView.search='';logView.severity=''">Reset filters</button></div>
|
||||
<div class="admin-empty" v-else>{{ logData?.state==='empty' ? 'No warnings, errors or HTTP 5xx returned in this window.' : 'No central events available. Refresh logs or open Application history.' }}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<details class="log-health" v-if="logData?.telemetry">
|
||||
<summary>Telemetry details <span>90 seconds before last check</span></summary>
|
||||
<p v-if="logData.telemetry.missing?.length">Missing or stale: {{ logData.telemetry.missing.join(', ') }}. Expected one API, four streamers and three queues.</p>
|
||||
<p v-else>Expected API, streamer and queue heartbeats were present at the last check.</p>
|
||||
<p v-if="logData.telemetry.partial">Telemetry coverage is partial; absence and drop totals may be incomplete.</p>
|
||||
@@ -55,40 +101,156 @@
|
||||
<summary>Application drop counters and last telemetry</summary>
|
||||
<ul><li v-for="(instance, i) in logData.telemetry.instances" :key="i">{{ instance.service }} · {{ instance.instance || 'unknown instance' }} · {{ instance.dropped ?? 'unknown' }} dropped since process start · last seen {{ absTime(instance.last) }}</li></ul>
|
||||
</details>
|
||||
</div>
|
||||
<div class="log-table-scroll" v-if="logData.groups?.length">
|
||||
<table class="log-table">
|
||||
<caption>Repeated events grouped by service, module, code, severity and status. Release and unique IDs do not split groups.</caption>
|
||||
<thead><tr><th scope="col">Event</th><th scope="col">Service / sample release</th><th scope="col">Count</th><th scope="col">First / last seen</th><th scope="col">Correlate sample</th></tr></thead>
|
||||
<tbody><tr v-for="group in logData.groups" :key="group.fingerprint">
|
||||
<td><strong>{{ group.sample.errorCode || group.sample.event }}</strong><br>{{ group.sample.severity }} · {{ group.sample.module }} · {{ group.sample.status || group.sample.httpStatus || 'no HTTP status' }}</td>
|
||||
<td>{{ group.sample.service }}<br><code>{{ group.sample.release }}</code></td><td>{{ group.count }}</td>
|
||||
<td>{{ absTime(group.first) }}<br>{{ absTime(group.last) }}</td>
|
||||
<td><button type="button" class="btn btn-sm log-trace-button" v-if="logTraceId(group, 'requestId')" @click="lookupTrace('requestId', group.sample.requestId)">Request {{ group.sample.requestId }}</button>
|
||||
<button type="button" class="btn btn-sm log-trace-button" v-if="logTraceId(group, 'jobId')" @click="lookupTrace('jobId', group.sample.jobId)">Job {{ group.sample.jobId }}</button>
|
||||
<span v-if="!logTraceId(group, 'requestId') && !logTraceId(group, 'jobId')">No correlation ID</span></td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
<section class="log-timeline" v-if="traceSelection" aria-labelledby="log-timeline-title" :aria-busy="traceLoading">
|
||||
<div class="volume-head"><h3 id="log-timeline-title" tabindex="-1">Correlated timeline</h3><button type="button" class="btn btn-sm" @click="closeTrace()">Close timeline</button></div>
|
||||
<p class="log-id">{{ traceSelection.kind }} · {{ traceSelection.id }}</p>
|
||||
<p role="status">{{ traceLoading ? 'Looking up correlated events…' : trace?.state === 'empty' ? 'No correlated events found in this window.' : logStateText(trace?.state) }}</p>
|
||||
<p v-if="trace && !traceLoading">{{ absTime(trace.start) }} – {{ absTime(trace.end) }} · at most 200 earliest matching events across services. Service and release filters do not narrow this timeline.</p>
|
||||
<a v-if="trace?.grafanaUrl" :href="safeUrl(trace.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open this correlation in Grafana</a>
|
||||
<ol class="log-events" v-if="trace?.events?.length">
|
||||
<li v-for="(event, index) in trace.events" :key="index"><time :datetime="event.timestamp" :title="event.timestamp">{{ absTimeShort(event.timestamp) }}</time> · <strong>{{ event.service }}</strong> · {{ event.event }}<span v-if="event.errorCode"> · {{ event.errorCode }}</span><span v-if="event.status"> · HTTP {{ event.status }}</span><span v-if="event.ms !== undefined"> · {{ event.ms }} ms</span><span v-if="event.attempt"> · attempt {{ event.attempt }}</span><br><code v-if="event.requestId">request {{ event.requestId }} </code><code v-if="event.jobId">job {{ event.jobId }}</code></li>
|
||||
</ol>
|
||||
</section>
|
||||
</details>
|
||||
</div>
|
||||
</section>
|
||||
<p class="log-copy-status" role="status" v-if="logCopyStatus">{{ logCopyStatus }}</p>
|
||||
<section v-show="errorSource==='history'" class="history-source" :aria-busy="redisLoading">
|
||||
<h2 class="sr-only">Application history</h2>
|
||||
<p class="history-warning" role="status" v-if="redisCollecting !== true">{{ redisCollecting === false ? 'Collection is off; retained history is not receiving new events.' : 'Collection status is unknown.' }}</p>
|
||||
|
||||
<h2 class="redis-history-title">Redis error history</h2>
|
||||
<p role="status">{{ available === null ? 'Checking Redis…' : available ? 'Redis history is reachable.' : 'Redis history is unavailable. Previously loaded rows may be stale.' }} {{ redisCollecting === false ? 'Collection is OFF (LOG_REDIS_MIRROR=off); retained history is not receiving new events.' : redisCollecting === true ? 'The application is configured to mirror warnings and errors.' : 'Collection status is unknown.' }}</p>
|
||||
<p>Separate source: hourly counters cover 24 hours; stored rows are a rotating snapshot and may cover a shorter or longer period. Counts are not combined with central logs.</p>
|
||||
<div class="log-inspector" v-if="historySelected"><button type="button" class="log-back" @click="closeHistory()">← Back to history</button><div class="log-inspector-heading"><div><p class="log-inspector-eyebrow">{{ historySelected.module }} · Application history</p><h2 id="history-inspector-title" tabindex="-1">{{ historySelected.displayMessage }}</h2></div><span class="log-severity" :class="'log-severity-'+historySelected._bucket">{{ historySelected._bucket }}<span v-if="historySelected._status"> · HTTP {{ historySelected._status }}</span></span></div><div class="log-inspector-tabs detail-tabs" role="group" aria-label="History event view"><button type="button" :aria-pressed="historyView==='overview' && (!detailTab[historySelected._key] || detailTab[historySelected._key]==='summary')" :class="{active:historyView==='overview' && (!detailTab[historySelected._key] || detailTab[historySelected._key]==='summary')}" @click="historyView='overview';detailTab[historySelected._key]='summary'">Overview</button><button type="button" :aria-pressed="historyView==='timeline'" :class="{active:historyView==='timeline'}" @click="showHistoryTimeline($event.currentTarget)">Timeline</button><button type="button" :aria-pressed="historyView==='overview' && detailTab[historySelected._key]==='raw'" :class="{active:historyView==='overview' && detailTab[historySelected._key]==='raw'}" @click="historyView='overview';detailTab[historySelected._key]='raw'">Raw</button><button type="button" v-if="historySelected._stack" @click="historyView='overview';detailTab[historySelected._key]='stack'">Stack</button><button type="button" v-if="historySelected.count>1" @click="historyView='overview';detailTab[historySelected._key]='related'">Related ({{ historySelected.count }})</button></div></div>
|
||||
<div v-show="!historySelected">
|
||||
<form class="errors-toolbar" aria-label="Error filters" v-form="viewState">
|
||||
<div class="seg-filter" role="group" aria-label="Filter by severity">
|
||||
<button type="button" class="seg-chip" :class="{ active: (query?.bucket || '') === '' }" :aria-pressed="(query?.bucket || '') === ''" @click="setBucket('')">All </button>
|
||||
<button type="button" class="seg-chip" :class="{ active: (query?.bucket || '') === 'error', 'is-empty': !(stats?.severity?.error) }" :aria-pressed="(query?.bucket || '') === 'error'" @click="setBucket('error')"><span class="seg-dot bad" aria-hidden="true"></span>Error </button>
|
||||
<button type="button" class="seg-chip" :class="{ active: (query?.bucket || '') === 'warn', 'is-empty': !(stats?.severity?.warn) }" :aria-pressed="(query?.bucket || '') === 'warn'" @click="setBucket('warn')"><span class="seg-dot warn" aria-hidden="true"></span>Warning </button>
|
||||
<button type="button" class="seg-chip" :class="{ active: (query?.bucket || '') === 'info', 'is-empty': !(stats?.severity?.info) }" :aria-pressed="(query?.bucket || '') === 'info'" @click="setBucket('info')"><span class="seg-dot off" aria-hidden="true"></span>Info </button>
|
||||
</div>
|
||||
<div class="search-wrap">
|
||||
<svg class="ui-icon search-icon" aria-hidden="true"><use href="#ui-icon-search"></use></svg>
|
||||
<input type="search" class="form-control" aria-label="Search application history" placeholder="Search history…" title="Search messages, or filter with code:repo_not_found module:route status:>=400" autocomplete="off" v-field="{ state: viewState, set: value => { query.search = value }, value: query?.search, form: null, options: {} }">
|
||||
<span class="filter-count" v-if="parsedFilterCount">{{ parsedFilterCount }} filter{{ parsedFilterCount > 1 ? 's' : '' }}</span>
|
||||
</div>
|
||||
<details class="history-view-options"><summary>View options</summary><div class="history-view-controls">
|
||||
<div class="select-wrap">
|
||||
<label for="history-sort">Sort</label>
|
||||
<select id="history-sort" class="form-control form-control-sm" v-field="{ state: viewState, set: value => { query.sort = value }, value: query?.sort, form: null, options: {} }">
|
||||
<option value="recent">Most recent</option>
|
||||
<option value="count">Most frequent</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="select-wrap">
|
||||
<label for="history-merge" title="Rows are always sectioned by severity. This merges repeated events inside each section.">Merge</label>
|
||||
<select id="history-merge" class="form-control form-control-sm" v-field="{ state: viewState, set: value => { query.group = value }, value: query?.group, form: null, options: {} }">
|
||||
<option value="">Don't merge</option>
|
||||
<option value="code">Same error</option>
|
||||
<option value="module">Same module</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="autoref">
|
||||
<input type="checkbox" v-field="{ state: viewState, set: value => { query.autoRefresh = value }, value: query?.autoRefresh, form: null, options: {} }">
|
||||
<span class="auto-refresh-label">Auto-refresh</span>
|
||||
</label>
|
||||
|
||||
</div></details>
|
||||
</form>
|
||||
|
||||
<p role="status" v-if="redisLoading">Loading application history…</p>
|
||||
<div class="admin-empty" v-if="!redisLoading && !visible?.length && available === true">No matching entries in the loaded Redis history.</div>
|
||||
<p v-if="redisRedacted">{{ redisRedacted }} invalid legacy records were omitted. Older valid records may still be available.</p>
|
||||
<div class="errors-pager" v-if="entries?.length || canLoadMore()">
|
||||
<span>{{ query?.group && visible?.length !== entries?.length ? fmt?.number(visible?.length) + (visible?.length === 1 ? ' group' : ' groups') + ' from ' : '' }}{{ fmt?.number(entries?.length) }} safe entries loaded · {{ fmt?.number(redisNextOffset || entries?.length) }} of {{ fmt?.number(total) }} stored records scanned</span>
|
||||
<button class="btn btn-sm" type="button" v-if="canLoadMore()" @click="loadMore()" :disabled="redisLoading">Load 250 older</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="errors-list" :class="{'history-inspector':historySelected}" v-if="visible?.length || historySelected" v-show="historyView!=='timeline' || !historySelected">
|
||||
<div class="errors-list-head" v-if="!historySelected">
|
||||
<span class="col-when">When</span>
|
||||
<span class="col-sev">Severity</span>
|
||||
<span class="col-mod">Module</span>
|
||||
<span class="col-msg">Message</span>
|
||||
<span class="col-count" title="Total occurrences since first seen">Total</span>
|
||||
<span class="col-status">Status</span>
|
||||
</div>
|
||||
|
||||
<template v-for="(row, index) in (historySelected ? [historySelected] : visible)" :key="row?._key">
|
||||
<div class="errors-group-head" v-if="!historySelected && (index === 0 || visible[index - 1]?._bucket !== row?._bucket)"><span class="sev-dot" :class="'sev-' + row?._bucket"></span>{{ row?._bucket === 'error' ? 'Error' : row?._bucket === 'warn' ? 'Warning' : 'Info' }}<span class="errors-group-count">{{ fmt?.number(visible.filter(r => r?._bucket === row?._bucket).length) }}</span><span class="errors-group-note" v-if="index === 0">By severity · {{ query?.group === 'code' ? 'repeats merged by error · ' : query?.group === 'module' ? 'repeats merged by module · ' : '' }}{{ query?.sort === 'count' ? 'most frequent first' : 'most recent first' }}</span></div>
|
||||
<div class="errors-row" :class="{open: expanded[row?._key]}">
|
||||
<button type="button" class="errors-row-main" v-show="!historySelected" :data-history-key="row?._key" :aria-expanded="!!expanded[row?._key]" :aria-controls="'history-detail-' + index" @click="toggle(row,$event.currentTarget)">
|
||||
<span class="col-when">
|
||||
<span class="when-rel">{{ relTime(row?.ts) }}</span>
|
||||
<span class="when-abs">{{ absTimeShort(row?.ts) }}</span>
|
||||
</span>
|
||||
<span class="col-sev">
|
||||
<span class="sev-dot" :class="'sev-' + row?._bucket"></span>
|
||||
<span class="sev-label">{{ row?._bucket === 'error' ? 'Error' : row?._bucket === 'warn' ? 'Warning' : 'Info' }}</span>
|
||||
</span>
|
||||
<span class="col-mod"><span class="pill pill-module">{{ row?.module }}</span></span>
|
||||
<span class="col-msg">
|
||||
<strong class="msg-code">{{ row?.displayMessage }}</strong>
|
||||
<span class="msg-context" v-if="row?.displayContext && row?.displayContext !== row?.displayMessage">{{ row?.displayContext }}</span>
|
||||
<span class="msg-detail" v-if="row?._detail">{{ row?._detail }}</span>
|
||||
<span class="msg-url" v-if="row?._url" :title="row?._url">{{ row?._url }}</span>
|
||||
</span>
|
||||
<span class="col-count">
|
||||
<span class="count-pill" v-if="row?.count > 1">×{{ row?.count }}</span>
|
||||
<span class="count-pill count-pill-muted" v-if="row?.count === 1">×1</span>
|
||||
</span>
|
||||
<span class="col-status">
|
||||
<span class="status-pill" v-if="row?._status" :class="String(row?._status).match(/^[23]/) ? 'status-neutral' : ('status-' + row?._bucket)" :title="String(row?._status).match(/^2/) && row?._bucket === 'warn' ? 'Client closed the connection' : null">{{ String(row?._status).match(/^2/) && row?._bucket === 'warn' ? '—' : row?._status }}</span>
|
||||
<span class="status-empty" v-if="!row?._status" title="No HTTP status for this event">—</span>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<div class="errors-row-detail" :id="'history-detail-' + index" v-if="expanded[row?._key]">
|
||||
<div class="detail-body">
|
||||
<div class="detail-main">
|
||||
<div v-if="!detailTab[row?._key] || detailTab[row?._key] === 'summary'"><h3>What happened</h3><p class="log-explanation-lead">{{ logExplanation(row.raw?.[0] || {}) }}</p><p class="log-evidence">{{ logEvidence(row.raw?.[0] || {}) }}</p><details class="history-technical"><summary>Technical fields</summary> <dl class="history-fields" v-if="!detailTab[row?._key] || detailTab[row?._key] === 'summary'"><div v-for="[key,value] in historyDetailFields(row)" :key="key"><dt>{{ key }}</dt><dd><template v-if="isLogIdentifier(key,value)"><details class="log-value-reveal"><summary>{{ compactLogValue(value) }}</summary><span>{{ value }}</span></details><button type="button" class="log-copy-value" @click="copyLogValue(value)">Copy full {{ key }}</button></template><template v-else>{{ logFieldText(value) }}</template></dd></div></dl></details></div>
|
||||
<pre v-if="detailTab[row?._key] === 'raw'">{{ row?._rawJson }}</pre>
|
||||
<pre class="stack-pre" v-if="detailTab[row?._key] === 'stack'">{{ row?._stack }}</pre>
|
||||
<div class="related-list" v-if="detailTab[row?._key] === 'related'">
|
||||
<div class="related-row" v-for="(r, index) in row?._related" :key="index">
|
||||
<span class="when-abs">{{ absTimeShort(r?.ts) }}</span>
|
||||
<span class="msg-url">{{ r?._url }}</span>
|
||||
<span class="status-pill" v-if="r?._status" :class="'status-' + r?._bucket">{{ r?._status }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-actions">
|
||||
<button class="btn btn-sm" type="button" v-if="logTraceId(row, 'requestId')" @click="lookupTrace('requestId', logTraceId(row, 'requestId'), $event.currentTarget, row)">Request timeline →</button>
|
||||
<button class="btn btn-sm" type="button" v-if="logTraceId(row, 'jobId')" @click="lookupTrace('jobId', logTraceId(row, 'jobId'), $event.currentTarget, row)">Job timeline →</button>
|
||||
<button class="btn btn-sm" type="button" v-if="row?._url" title="Copy a curl that reproduces the request" @click="copyCurl(row)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg> Copy curl</button>
|
||||
<button class="btn btn-sm" type="button" @click="copyJson(row)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-clipboard"></use></svg> Copy JSON</button>
|
||||
<span class="copy-hint" v-if="copyHint">{{ copyHint }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="detail-aside">
|
||||
<div class="aside-block">
|
||||
<div class="aside-label">First seen</div>
|
||||
<div class="aside-value" :title="(absTime(row?._firstSeen))">{{ relTime(row?._firstSeen) }}</div>
|
||||
</div>
|
||||
<div class="aside-block">
|
||||
<div class="aside-label">Last seen</div>
|
||||
<div class="aside-value" :title="(absTime(row?.ts))">{{ relTime(row?.ts) }}</div>
|
||||
</div>
|
||||
<div class="aside-block">
|
||||
<div class="aside-label">Occurrences</div>
|
||||
<div class="aside-value">{{ row?.count }}<span class="aside-sub" v-if="row?._lastHourCount"> · {{ row?._lastHourCount }} this hour</span></div>
|
||||
</div>
|
||||
<div class="aside-block" v-if="row?._repoId">
|
||||
<div class="aside-label">Repository</div>
|
||||
<a class="aside-value" :href="safeUrl("/r/" + (row?._repoId))">{{ isLogIdentifier('repoId',row?._repoId) ? compactLogValue(row?._repoId) : row?._repoId }}</a><details class="log-value-reveal" v-if="isLogIdentifier('repoId',row?._repoId)"><summary>Full repository ID</summary>{{ row?._repoId }}</details><button type="button" class="log-copy-value" @click="copyLogValue(row?._repoId)">Copy full repository ID</button>
|
||||
</div>
|
||||
<div class="aside-block" v-if="row?._url">
|
||||
<div class="aside-label">URL</div>
|
||||
<div class="aside-value mono">{{ row?._url }}</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<details class="history-management" v-show="!historySelected"><summary>History settings, export and diagnostics</summary>
|
||||
<div class="volume-head"><div class="errors-actions"><button class="btn btn-sm" type="button" @click="exportCsv()">Export Redis CSV</button><button class="btn btn-sm btn-outline-danger" type="button" @click="clearAll()">Clear Redis history</button></div></div>
|
||||
<p role="status">{{ redisCollecting === false ? 'Collection is OFF (LOG_REDIS_MIRROR=off); retained history is not receiving new events.' : redisCollecting === true ? 'The application is configured to mirror warnings and errors.' : 'Collection status is unknown.' }}</p>
|
||||
<p class="log-coverage">Redis mirror: hourly counters cover 24 hours; stored rows are a rotating snapshot and may cover a shorter or longer period. Counts are not combined with central logs.</p>
|
||||
<p v-if="redisStatsState !== 'ready' || available !== true">Redis counters are {{ redisStatsState === 'loading' ? 'loading' : 'unavailable' }}.</p>
|
||||
|
||||
<section class="kpi-grid" v-if="redisStatsState === 'ready' && available === true">
|
||||
<details class="history-summary"><summary>24-hour counters and volume</summary> <section class="kpi-grid" v-if="redisStatsState === 'ready' && available === true">
|
||||
<div class="kpi-card">
|
||||
<div class="kpi-label">Occurrences · 24h</div>
|
||||
<div class="kpi-value">{{ fmt?.number(stats?.last24h ?? 0) }}</div>
|
||||
@@ -97,17 +259,17 @@
|
||||
<span v-if="!stats?.prev24h">no prior baseline</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="kpi-card kpi-error kpi-filter" role="button" tabindex="0" :class="{ 'is-selected': query?.bucket === 'error' }" :aria-pressed="query?.bucket === 'error'" :title="'Show only errors (5xx)'" @click="setBucket(query?.bucket === 'error' ? '' : 'error')" @keydown.enter.prevent="setBucket(query?.bucket === 'error' ? '' : 'error')">
|
||||
<div class="kpi-card kpi-error">
|
||||
<div class="kpi-label">Error</div>
|
||||
<div class="kpi-value">{{ fmt?.number(stats?.severity?.error ?? 0) }}</div>
|
||||
<div class="kpi-sub">5xx · {{ stats?.unique?.error }} unique</div>
|
||||
</div>
|
||||
<div class="kpi-card kpi-warn kpi-filter" role="button" tabindex="0" :class="{ 'is-selected': query?.bucket === 'warn' }" :aria-pressed="query?.bucket === 'warn'" :title="'Show only warnings (4xx, aborted requests)'" @click="setBucket(query?.bucket === 'warn' ? '' : 'warn')" @keydown.enter.prevent="setBucket(query?.bucket === 'warn' ? '' : 'warn')">
|
||||
<div class="kpi-card kpi-warn">
|
||||
<div class="kpi-label">Warning</div>
|
||||
<div class="kpi-value">{{ fmt?.number(stats?.severity?.warn ?? 0) }}</div>
|
||||
<div class="kpi-sub">4xx, aborted · {{ stats?.unique?.warn }} unique</div>
|
||||
</div>
|
||||
<div class="kpi-card kpi-info kpi-filter" role="button" tabindex="0" :class="{ 'is-selected': query?.bucket === 'info' }" :aria-pressed="query?.bucket === 'info'" :title="'Show only info events'" @click="setBucket(query?.bucket === 'info' ? '' : 'info')" @keydown.enter.prevent="setBucket(query?.bucket === 'info' ? '' : 'info')">
|
||||
<div class="kpi-card kpi-info">
|
||||
<div class="kpi-label">Info</div>
|
||||
<div class="kpi-value">{{ fmt?.number(stats?.severity?.info ?? 0) }}</div>
|
||||
<div class="kpi-sub">Auth, 404 · {{ stats?.unique?.info }} unique</div>
|
||||
@@ -141,136 +303,18 @@
|
||||
<div class="volume-axis" aria-hidden="true"><span>24h ago</span><span>12h ago</span><span>now</span></div>
|
||||
</section>
|
||||
|
||||
<form class="errors-toolbar" aria-label="Error filters" v-form="viewState">
|
||||
<div class="seg-filter" role="radiogroup" aria-label="Filter by severity">
|
||||
<button type="button" role="radio" class="seg-chip" :class="{ active: (query?.bucket || '') === '' }" :aria-checked="(query?.bucket || '') === ''" @click="setBucket('')">All <span class="count">{{ fmt?.number((stats?.severity?.error ?? 0) + (stats?.severity?.warn ?? 0) + (stats?.severity?.info ?? 0)) }}</span></button>
|
||||
<button type="button" role="radio" class="seg-chip" :class="{ active: (query?.bucket || '') === 'error', 'is-empty': !(stats?.severity?.error) }" :aria-checked="(query?.bucket || '') === 'error'" @click="setBucket('error')"><span class="seg-dot bad" aria-hidden="true"></span>Error <span class="count">{{ fmt?.number(stats?.severity?.error ?? 0) }}</span></button>
|
||||
<button type="button" role="radio" class="seg-chip" :class="{ active: (query?.bucket || '') === 'warn', 'is-empty': !(stats?.severity?.warn) }" :aria-checked="(query?.bucket || '') === 'warn'" @click="setBucket('warn')"><span class="seg-dot warn" aria-hidden="true"></span>Warning <span class="count">{{ fmt?.number(stats?.severity?.warn ?? 0) }}</span></button>
|
||||
<button type="button" role="radio" class="seg-chip" :class="{ active: (query?.bucket || '') === 'info', 'is-empty': !(stats?.severity?.info) }" :aria-checked="(query?.bucket || '') === 'info'" @click="setBucket('info')"><span class="seg-dot off" aria-hidden="true"></span>Info <span class="count">{{ fmt?.number(stats?.severity?.info ?? 0) }}</span></button>
|
||||
</div>
|
||||
<div class="search-wrap">
|
||||
<svg class="ui-icon search-icon" aria-hidden="true"><use href="#ui-icon-search"></use></svg>
|
||||
<input type="search" class="form-control" placeholder="Search errors…" title="Search messages, or filter with code:repo_not_found module:route status:>=400" autocomplete="off" v-field="{ state: viewState, set: value => { query.search = value }, value: query?.search, form: null, options: {} }">
|
||||
<span class="filter-count" v-if="parsedFilterCount">{{ parsedFilterCount }} filter{{ parsedFilterCount > 1 ? 's' : '' }}</span>
|
||||
</div>
|
||||
<div class="select-wrap">
|
||||
<label>Sort</label>
|
||||
<select class="form-control form-control-sm" v-field="{ state: viewState, set: value => { query.sort = value }, value: query?.sort, form: null, options: {} }">
|
||||
<option value="recent">Most recent</option>
|
||||
<option value="count">Most frequent</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="select-wrap">
|
||||
<label title="Rows are always sectioned by severity. This merges repeated events inside each section.">Merge</label>
|
||||
<select class="form-control form-control-sm" v-field="{ state: viewState, set: value => { query.group = value }, value: query?.group, form: null, options: {} }">
|
||||
<option value="">Don't merge</option>
|
||||
<option value="code">Same error</option>
|
||||
<option value="module">Same module</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="autoref">
|
||||
<input type="checkbox" v-field="{ state: viewState, set: value => { query.autoRefresh = value }, value: query?.autoRefresh, form: null, options: {} }">
|
||||
<span class="auto-refresh-label">Auto-refresh</span>
|
||||
</label>
|
||||
<button class="btn btn-sm btn-icon" type="button" title="Refresh now" @click="refreshNow()" aria-label="Refresh"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-refresh"></use></svg></button>
|
||||
</form>
|
||||
</details>
|
||||
</details>
|
||||
|
||||
<div class="admin-empty" v-if="!visible?.length && available === true">No matching entries in the loaded Redis history.</div>
|
||||
<p v-if="redisRedacted">{{ redisRedacted }} invalid legacy records were omitted. Older valid records may still be available.</p>
|
||||
<div class="errors-pager" v-if="canLoadMore()">
|
||||
<span>{{ query?.group && visible?.length !== entries?.length ? fmt?.number(visible?.length) + (visible?.length === 1 ? ' group' : ' groups') + ' from ' : '' }}{{ fmt?.number(entries?.length) }} safe entries loaded · {{ fmt?.number(redisNextOffset || entries?.length) }} of {{ fmt?.number(total) }} stored records scanned</span>
|
||||
<button class="btn btn-sm" type="button" @click="loadMore()">Load 250 older</button>
|
||||
</div>
|
||||
</section>
|
||||
<div v-if="errorSource === 'history' && historyView==='timeline'"><div class="admin-empty" v-if="!traceSelection">No request or job ID was recorded for this entry.</div><section class="log-timeline" v-if="traceSelection" aria-labelledby="log-timeline-title" :aria-busy="traceLoading">
|
||||
<div class="volume-head"><h3 id="log-timeline-title" tabindex="-1">{{ traceSelection.kind === 'jobId' ? 'Job' : 'Request' }} timeline</h3><button type="button" class="btn btn-sm" @click="closeTrace()">Close timeline</button></div>
|
||||
<p class="log-origin" v-if="traceSelection.context">{{ traceSelection.context.event }} · {{ traceSelection.context.service }}</p>
|
||||
<p role="status" v-if="traceLoading || trace?.state !== 'ready'">{{ traceLoading ? 'Loading related events…' : trace?.state === 'empty' ? 'No related events returned in this window.' : logStateText(trace?.state) }}</p>
|
||||
<p class="log-coverage" v-if="trace && !traceLoading">{{ trace.events?.length || 0 }} events returned · {{ absTime(trace.start) }} – {{ absTime(trace.end) }} · 200-event cap. All services and releases.</p>
|
||||
<ol class="log-events" v-if="trace?.events?.length"><li v-for="(event,index) in trace.events" :key="index"><time :datetime="event.timestamp" :title="event.timestamp">{{ absTimeShort(event.timestamp) }}</time><div class="log-timeline-event"><div class="log-timeline-event-title"><strong>{{ event.errorCode || event.event }}</strong><span class="log-severity" :class="'log-severity-'+logSeverity(event)">{{ event.status ? 'HTTP '+event.status : event.severity || 'Event' }}</span></div><p>{{ event.service }}<span v-if="event.module"> / {{ event.module }}</span><span v-if="event.ms !== undefined"> · {{ event.ms }} ms</span><span v-if="event.attempt !== undefined"> · attempt {{ event.attempt }}</span></p><details class="log-event-fields"><summary>Event fields</summary><pre>{{ JSON.stringify(event,null,2) }}</pre><button type="button" class="btn btn-sm" @click="copyLogValue(JSON.stringify(event,null,2))">Copy JSON</button></details></div></li></ol>
|
||||
<details class="log-timeline-scope"><summary>Correlation ID and query scope</summary><code>{{ traceSelection.id }}</code><button type="button" class="log-copy-value" @click="copyLogValue(traceSelection.id)">Copy full ID</button><p>Earliest matching events in the selected window. Service and release filters do not narrow this timeline.</p></details>
|
||||
<a v-if="trace?.grafanaUrl" :href="safeUrl(trace.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open in Grafana</a>
|
||||
</section></div>
|
||||
|
||||
<div class="errors-list" v-if="visible?.length">
|
||||
<div class="errors-list-head">
|
||||
<span class="col-when">When</span>
|
||||
<span class="col-sev">Severity</span>
|
||||
<span class="col-mod">Module</span>
|
||||
<span class="col-msg">Message</span>
|
||||
<span class="col-count" title="Total occurrences since first seen">Total</span>
|
||||
<span class="col-status">Status</span>
|
||||
</div>
|
||||
|
||||
<template v-for="(row, index) in visible" :key="row?._key">
|
||||
<div class="errors-group-head" v-if="index === 0 || visible[index - 1]?._bucket !== row?._bucket"><span class="sev-dot" :class="'sev-' + row?._bucket"></span>{{ row?._bucket === 'error' ? 'Error' : row?._bucket === 'warn' ? 'Warning' : 'Info' }}<span class="errors-group-count">{{ fmt?.number(visible.filter(r => r?._bucket === row?._bucket).length) }}</span><span class="errors-group-note" v-if="index === 0">By severity · {{ query?.group === 'code' ? 'repeats merged by error · ' : query?.group === 'module' ? 'repeats merged by module · ' : '' }}{{ query?.sort === 'count' ? 'most frequent first' : 'most recent first' }}</span></div>
|
||||
<div class="errors-row" :class="{open: expanded[row?._key]}">
|
||||
<div class="errors-row-main" @click="toggle(row)">
|
||||
<div class="col-when">
|
||||
<div class="when-rel">{{ relTime(row?.ts) }}</div>
|
||||
<div class="when-abs">{{ absTimeShort(row?.ts) }}</div>
|
||||
</div>
|
||||
<div class="col-sev">
|
||||
<span class="sev-dot" :class="'sev-' + row?._bucket"></span>
|
||||
<span class="sev-label">{{ row?._bucket === 'error' ? 'Error' : row?._bucket === 'warn' ? 'Warning' : 'Info' }}</span>
|
||||
</div>
|
||||
<div class="col-mod"><span class="pill pill-module">{{ row?.module }}</span></div>
|
||||
<div class="col-msg">
|
||||
<strong class="msg-code">{{ row?.displayMessage }}</strong>
|
||||
<span class="msg-context" v-if="row?.displayContext && row?.displayContext !== row?.displayMessage">{{ row?.displayContext }}</span>
|
||||
<span class="msg-detail" v-if="row?._detail">{{ row?._detail }}</span>
|
||||
<div class="msg-url" v-if="row?._url" :title="row?._url">{{ row?._url }}</div>
|
||||
</div>
|
||||
<div class="col-count">
|
||||
<span class="count-pill" v-if="row?.count > 1">×{{ row?.count }}</span>
|
||||
<span class="count-pill count-pill-muted" v-if="row?.count === 1">×1</span>
|
||||
</div>
|
||||
<div class="col-status">
|
||||
<span class="status-pill" v-if="row?._status" :class="String(row?._status).match(/^[23]/) ? 'status-neutral' : ('status-' + row?._bucket)" :title="String(row?._status).match(/^2/) && row?._bucket === 'warn' ? 'Client closed the connection' : null">{{ String(row?._status).match(/^2/) && row?._bucket === 'warn' ? '—' : row?._status }}</span>
|
||||
<span class="status-empty" v-if="!row?._status" title="No HTTP status for this event">—</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="errors-row-detail" v-if="expanded[row?._key]">
|
||||
<div class="detail-tabs">
|
||||
<button type="button" :class="{active: detailTab[row?._key] === 'raw' || !detailTab[row?._key]}" @click="detailTab[row._key] = 'raw'">Raw</button>
|
||||
<button type="button" v-if="row?._stack" :class="{active: detailTab[row?._key] === 'stack'}" @click="detailTab[row._key] = 'stack'">Stack</button>
|
||||
<button type="button" v-if="row?.count > 1" :class="{active: detailTab[row?._key] === 'related'}" @click="detailTab[row._key] = 'related'">Related ({{ row?.count }})</button>
|
||||
</div>
|
||||
<div class="detail-body">
|
||||
<div class="detail-main">
|
||||
<pre v-if="(detailTab[row?._key] || 'raw') === 'raw'">{{ row?._detailJson }}</pre>
|
||||
<pre class="stack-pre" v-if="detailTab[row?._key] === 'stack'">{{ row?._stack }}</pre>
|
||||
<div class="related-list" v-if="detailTab[row?._key] === 'related'">
|
||||
<div class="related-row" v-for="(r, index) in row?._related" :key="index">
|
||||
<span class="when-abs">{{ absTimeShort(r?.ts) }}</span>
|
||||
<span class="msg-url">{{ r?._url }}</span>
|
||||
<span class="status-pill" v-if="r?._status" :class="'status-' + r?._bucket">{{ r?._status }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-actions">
|
||||
<button class="btn btn-sm" type="button" v-if="logTraceId(row, 'requestId')" @click="lookupTrace('requestId', logTraceId(row, 'requestId'))">Look up request {{ logTraceId(row, 'requestId') }}</button>
|
||||
<button class="btn btn-sm" type="button" v-if="logTraceId(row, 'jobId')" @click="lookupTrace('jobId', logTraceId(row, 'jobId'))">Look up job {{ logTraceId(row, 'jobId') }}</button>
|
||||
<button class="btn btn-sm" type="button" v-if="row?._url" title="Copy a curl that reproduces the request" @click="copyCurl(row)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg> Copy curl</button>
|
||||
<button class="btn btn-sm" type="button" @click="copyJson(row)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-clipboard"></use></svg> Copy JSON</button>
|
||||
<span class="copy-hint" v-if="copyHint">{{ copyHint }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<aside class="detail-aside">
|
||||
<div class="aside-block">
|
||||
<div class="aside-label">First seen</div>
|
||||
<div class="aside-value" :title="(absTime(row?._firstSeen))">{{ relTime(row?._firstSeen) }}</div>
|
||||
</div>
|
||||
<div class="aside-block">
|
||||
<div class="aside-label">Last seen</div>
|
||||
<div class="aside-value" :title="(absTime(row?.ts))">{{ relTime(row?.ts) }}</div>
|
||||
</div>
|
||||
<div class="aside-block">
|
||||
<div class="aside-label">Occurrences</div>
|
||||
<div class="aside-value">{{ row?.count }}<span class="aside-sub" v-if="row?._lastHourCount"> · {{ row?._lastHourCount }} this hour</span></div>
|
||||
</div>
|
||||
<div class="aside-block" v-if="row?._repoId">
|
||||
<div class="aside-label">Repository</div>
|
||||
<a class="aside-value" :href="safeUrl("/r/" + (row?._repoId))">{{ row?._repoId }}</a>
|
||||
</div>
|
||||
<div class="aside-block" v-if="row?._url">
|
||||
<div class="aside-label">URL</div>
|
||||
<div class="aside-value mono">{{ row?._url }}</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,7 +2,73 @@ import { nextTick } from "vue";
|
||||
|
||||
// Central counts never include the separately displayed Redis mirror.
|
||||
export function installLogInvestigation(state, http) {
|
||||
state.errorSource = "central";
|
||||
state.logView = { search: "", severity: "", sort: "recent" };
|
||||
state.selectedLog = null;
|
||||
state.logDetailTab = "overview";
|
||||
state.logSeverity = (sample) => Number(sample?.status || sample?.httpStatus) >= 500 || ["error", "fatal"].includes(sample?.severity) ? "error" : sample?.severity === "warn" ? "warn" : "info";
|
||||
state.filteredLogGroups = () => {
|
||||
const search = state.logView.search.trim().toLowerCase();
|
||||
return (state.logData?.groups || []).filter(group =>
|
||||
(!state.logView.severity || state.logSeverity(group.sample) === state.logView.severity) &&
|
||||
(!search || Object.values(group.sample).join(" ").toLowerCase().includes(search))
|
||||
).slice().sort((a, b) => state.logView.sort === "count" ? b.count - a.count : Date.parse(b.last) - Date.parse(a.last));
|
||||
};
|
||||
state.shortLogId = id => id ? id.slice(0, 8) : "";
|
||||
state.isLogIdentifier = (key, value) => typeof value === "string" && value.length > 16 && /(?:id|sha|release)$/i.test(key);
|
||||
state.compactLogValue = value => String(value).slice(0, 8) + "…" + String(value).slice(-4);
|
||||
state.logCopyStatus = "";
|
||||
state.copyLogValue = async value => {
|
||||
try { await navigator.clipboard.writeText(String(value)); state.logCopyStatus = "Full value copied"; }
|
||||
catch { state.logCopyStatus = "Copy unavailable. Expand the value to select it."; }
|
||||
};
|
||||
state.logExplanation = sample => {
|
||||
const service = sample.service || "The application";
|
||||
const event = ({job_failed:"reported a failed job",request_failed:"reported a failed request",request_aborted:"reported an aborted request",edge_request:"recorded an edge request",http_access:"recorded an HTTP request"})[sample.event] || ("recorded “" + (sample.event || "application event") + "”");
|
||||
const status = Number(sample.status || sample.httpStatus);
|
||||
const meaning = ({502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"})[status];
|
||||
return service + " " + event + (status ? " with HTTP " + status + (meaning ? " (" + meaning + ")" : "") : "") + ".";
|
||||
};
|
||||
state.logEvidence = sample => [
|
||||
sample.errorCode ? "Recorded error code: " + sample.errorCode + "." : "No error code was included in this sample.",
|
||||
sample.ms !== undefined ? "Recorded duration: " + sample.ms + " ms." : "",
|
||||
sample.attempt !== undefined ? "Recorded attempt: " + sample.attempt + "." : "",
|
||||
sample.queue ? "Queue: " + sample.queue + "." : "",
|
||||
].filter(Boolean).join(" ");
|
||||
state.historyDetailFields = row => {
|
||||
try { const value = JSON.parse(row?._detailJson || "{}"); return value && typeof value === "object" ? Object.entries(value) : [["value", value]]; }
|
||||
catch { return [["record", row?._detailJson || ""]]; }
|
||||
};
|
||||
state.logFieldText = value => typeof value === "object" ? JSON.stringify(value) : String(value ?? "");
|
||||
state.captureErrorScroll = origin => {
|
||||
const positions = [];
|
||||
for (let element = origin?.parentElement; element; element = element.parentElement) positions.push({element,top:element.scrollTop,left:element.scrollLeft});
|
||||
return positions;
|
||||
};
|
||||
state.restoreErrorScroll = positions => positions.forEach(({element,top,left}) => { if(element.isConnected) {element.scrollTop=top;element.scrollLeft=left;} });
|
||||
let traceOrigin = null, detailOrigin = null, traceSource = null, listScroll = [];
|
||||
state.selectLog = async (group, origin) => {
|
||||
detailOrigin = origin || document.activeElement;
|
||||
listScroll = state.captureErrorScroll(detailOrigin);
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false;
|
||||
state.logDetailTab = "overview";
|
||||
state.selectedLog = group;
|
||||
await nextTick();
|
||||
if (disposed || state.selectedLog !== group || state.errorSource !== "central") return;
|
||||
document.getElementById("log-detail-title")?.focus({ preventScroll: true });
|
||||
document.querySelector(".log-inspector")?.scrollIntoView?.({ block: "start" });
|
||||
const kind = ["requestId","jobId"].find(key=>state.logTraceId(group,key));
|
||||
if (kind) state.lookupTrace(kind,group.sample[kind],document.getElementById("trace-selector-"+kind),group.sample,true);
|
||||
};
|
||||
state.closeLogDetail = async () => {
|
||||
state.selectedLog = null;
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false;
|
||||
await nextTick();
|
||||
if (detailOrigin?.isConnected) { detailOrigin.focus({preventScroll:true}); state.restoreErrorScroll(listScroll); }
|
||||
else document.getElementById("error-source-central")?.focus();
|
||||
};
|
||||
state.logFilters = { window: "1h", service: "", release: "" };
|
||||
state.logAppliedFilters = { ...state.logFilters };
|
||||
state.logData = null;
|
||||
state.logLoading = false;
|
||||
state.logFailure = "";
|
||||
@@ -13,48 +79,73 @@ export function installLogInvestigation(state, http) {
|
||||
const uuid = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
|
||||
let version = 0, traceVersion = 0, disposed = false;
|
||||
state.logStateText = (value) => ({
|
||||
ready: "Central logs available", empty: "No warnings or errors in this window",
|
||||
disabled: "Central lookup is not configured. Redis history remains available below.",
|
||||
ready: "Central logs available", empty: "No warnings, errors or HTTP 5xx returned in this window",
|
||||
disabled: "Central lookup is not configured. Application history is available in the other source.",
|
||||
misconfigured: "Central lookup configuration is invalid. Ask an operator to check it.",
|
||||
unreachable: "Central logging is unreachable. Redis history remains available below.",
|
||||
unreachable: "Central logging is unreachable. Application history is available in the other source.",
|
||||
busy: "Central lookup is busy. Retry shortly.", partial: "Partial results: a result limit or invalid record reduced coverage.",
|
||||
stale: "Central logging responds, but expected application telemetry is stale or missing.",
|
||||
}[value] || "Central log status has not been checked");
|
||||
state.refreshLogs = async () => {
|
||||
const current = ++version;
|
||||
const filters = { ...state.logFilters };
|
||||
state.logLoading = true; state.logFailure = "";
|
||||
state.trace = null; state.traceSelection = null; state.traceLoading = false; traceVersion++;
|
||||
state.trace = null; state.traceSelection = null; state.traceLoading = false; state.selectedLog = null; traceVersion++;
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/investigation", { params: { ...state.logFilters } });
|
||||
const response = await http.get("/api/admin/errors/investigation", { params: filters });
|
||||
if (disposed || current !== version) return;
|
||||
state.logData = response.data;
|
||||
state.logAppliedFilters = filters;
|
||||
state.logSnapshotStale = !!response.data?.end && Date.now() - Date.parse(response.data.end) > 90000;
|
||||
} catch (error) {
|
||||
if (disposed || current !== version) return;
|
||||
state.logData = null;
|
||||
state.logFailure = error?.status === 400 ? "Use a Git release SHA or ‘unknown’ and retry." : "Could not load central log status. Retry or use Redis history below.";
|
||||
state.logFailure = error?.status === 400 ? "Use a Git release SHA or ‘unknown’ and retry." : "Could not load central log status. Retry or open Application history.";
|
||||
} finally { if (!disposed && current === version) state.logLoading = false; }
|
||||
};
|
||||
state.lookupTrace = async (kind, id) => {
|
||||
state.lookupTrace = async (kind, id, origin, sample, preserveFocus = false) => {
|
||||
if (!["requestId", "jobId"].includes(kind) || !uuid.test(id || "")) return;
|
||||
if (state.errorSource === "central" && state.selectedLog) state.logDetailTab = "timeline";
|
||||
if (state.errorSource === "history") state.historyView = "timeline";
|
||||
traceSource = state.errorSource;
|
||||
traceOrigin = origin || document.activeElement;
|
||||
const current = ++traceVersion;
|
||||
state.traceSelection = { kind, id }; state.trace = null; state.traceLoading = true;
|
||||
state.traceSelection = { kind, id, context: sample ? {
|
||||
event: sample.errorCode || sample.event || sample.displayMessage || sample.message,
|
||||
service: sample.service || sample.module,
|
||||
} : null }; state.trace = null; state.traceLoading = true;
|
||||
await nextTick();
|
||||
if (disposed || current !== traceVersion) return;
|
||||
const heading = document.getElementById("log-timeline-title");
|
||||
heading?.focus();
|
||||
heading?.scrollIntoView?.({ block: "nearest" });
|
||||
if (!preserveFocus) { heading?.focus(); heading?.scrollIntoView?.({ block: "nearest" }); }
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/correlation", { params: { kind, id, window: state.logData?.window || state.logFilters.window } });
|
||||
const response = await http.get("/api/admin/errors/correlation", { params: { kind, id, window: state.logData?.window || state.logAppliedFilters.window } });
|
||||
if (!disposed && current === traceVersion) state.trace = response.data;
|
||||
} catch {
|
||||
if (!disposed && current === traceVersion) state.trace = { state: "unreachable", events: [] };
|
||||
} finally { if (!disposed && current === traceVersion) state.traceLoading = false; }
|
||||
};
|
||||
state.closeTrace = () => { traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false; };
|
||||
state.showLogTimeline = origin => {
|
||||
state.logDetailTab = "timeline";
|
||||
if (state.traceSelection) return;
|
||||
const kind = ["requestId","jobId"].find(key=>state.logTraceId(state.selectedLog,key));
|
||||
if (kind) state.lookupTrace(kind,state.selectedLog.sample[kind],origin,state.selectedLog.sample);
|
||||
};
|
||||
state.closeTrace = async () => {
|
||||
state.logDetailTab = "overview";
|
||||
state.historyView = "overview";
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false;
|
||||
await nextTick();
|
||||
if (traceOrigin?.isConnected && traceSource === state.errorSource) traceOrigin.focus();
|
||||
else document.getElementById("error-source-" + state.errorSource)?.focus();
|
||||
};
|
||||
state.logTraceId = (row, kind) => {
|
||||
const value = row?.sample?.[kind] || row?.raw?.find(value => value && typeof value === "object")?.[kind];
|
||||
return uuid.test(value || "") ? value : null;
|
||||
};
|
||||
state.watch("errorSource", () => {
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false; state.selectedLog = null; state.historySelected = null; state.historyView = "overview"; state.expanded = {};
|
||||
}, false, false);
|
||||
const freshnessTimer = window.setInterval(() => {
|
||||
state.logSnapshotStale = !!state.logData?.end && Date.now() - Date.parse(state.logData.end) > 90000;
|
||||
}, 15000);
|
||||
|
||||
+58
-15
@@ -1,5 +1,5 @@
|
||||
import { installLogInvestigation } from "./admin-log-investigation.js";
|
||||
import { reactive, onScopeDispose } from "vue";
|
||||
import { reactive, onScopeDispose, nextTick } from "vue";
|
||||
import { createTimers, createListeners } from "./state.js";
|
||||
import { duration, statusMsg } from "./formatters.js";
|
||||
|
||||
@@ -1400,6 +1400,8 @@ export const queuesAdminController = function (state, http, location, interval,
|
||||
export const errorsAdminController = function (state, http, location, interval) {
|
||||
installLogInvestigation(state, http);
|
||||
state.redisCollecting = null;
|
||||
state.redisLoading = false;
|
||||
let historyVersion = 0, statsVersion = 0, statsPending = false, disposed = false;
|
||||
state.redisStatsState = "loading";
|
||||
const timers = createTimers();
|
||||
state.watch("user.status", () => {
|
||||
@@ -1418,6 +1420,9 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
state.total = 0;
|
||||
state.pageSize = 250;
|
||||
state.expanded = {};
|
||||
state.historySelected = null;
|
||||
state.historyView = "overview";
|
||||
let historyOrigin = null, historyScroll = [];
|
||||
state.detailTab = {};
|
||||
state.copyHint = "";
|
||||
state.parsedFilterCount = 0;
|
||||
@@ -1479,6 +1484,9 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
return "info";
|
||||
}
|
||||
function decorate(e) {
|
||||
// Preserve the API's safe record before adding UI-only fields. Raw and
|
||||
// Copy JSON must not silently omit fields through the summary projection.
|
||||
e._rawJson = JSON.stringify(e, null, 2);
|
||||
const detail = (e.raw || []).find(
|
||||
(a) => a && typeof a === "object" && !Array.isArray(a)
|
||||
);
|
||||
@@ -1530,7 +1538,7 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
return e;
|
||||
}
|
||||
|
||||
// Build a curated, column-aligned JSON payload for the Raw tab. Mirrors
|
||||
// Build a curated, column-aligned payload for the readable Details tab. Mirrors
|
||||
// the reference admin design: name / code / kind / httpStatus / module /
|
||||
// detail / url / ts on aligned colons. We can't just JSON.stringify the
|
||||
// raw entry because it includes the human "anonymous error" wrapper
|
||||
@@ -1541,6 +1549,7 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
if (v === undefined || v === null || v === "") return;
|
||||
fields.push([k, v]);
|
||||
};
|
||||
for (const key of ["service", "event", "severity", "requestId", "jobId"]) push(key, detail && detail[key]);
|
||||
push("name", detail && detail.name);
|
||||
push("code", entry.displayMessage || (detail && detail.message));
|
||||
if (entry._bucket) push("kind", entry._bucket);
|
||||
@@ -1724,6 +1733,9 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
}
|
||||
|
||||
function loadEntries(append) {
|
||||
if (append && state.redisLoading) return;
|
||||
const current = ++historyVersion;
|
||||
state.redisLoading = true;
|
||||
// On auto-refresh after the user has paginated ("Load older"),
|
||||
// request the SAME-sized window from the head so we don't blow away
|
||||
// their loaded tail. Newer entries take the top, the oldest visible
|
||||
@@ -1736,6 +1748,8 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
.get("/api/admin/errors", { params: { offset, limit } })
|
||||
.then(
|
||||
(res) => {
|
||||
if (disposed || current !== historyVersion) return;
|
||||
state.redisLoading = false;
|
||||
const next = (res.data.entries || []).map(decorate);
|
||||
state.entries = append ? state.entries.concat(next) : next;
|
||||
state.redisRedacted = (append ? state.redisRedacted || 0 : 0) + (res.data.redactedEntries || 0);
|
||||
@@ -1747,14 +1761,19 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
state._autoLoading = false;
|
||||
recompute();
|
||||
},
|
||||
() => { state._autoLoading = false; state.available = false; }
|
||||
() => { if (disposed || current !== historyVersion) return; state.redisLoading = false; state._autoLoading = false; state.available = false; }
|
||||
);
|
||||
}
|
||||
state.loadMore = () => loadEntries(true);
|
||||
state.canLoadMore = () => (state.redisNextOffset || state.entries.length) < state.total;
|
||||
function loadStats() {
|
||||
function loadStats(background = false) {
|
||||
if (background && statsPending) return;
|
||||
const current = ++statsVersion;
|
||||
statsPending = true;
|
||||
http.get("/api/admin/errors/stats").then(
|
||||
(res) => {
|
||||
if (disposed || current !== statsVersion) return;
|
||||
statsPending = false;
|
||||
const s = res.data || {};
|
||||
state.redisStatsState = s.available === false ? "unavailable" : "ready";
|
||||
const delta = s.prev24h ? Math.round(((s.last24h - s.prev24h) / s.prev24h) * 100) : 0;
|
||||
@@ -1769,12 +1788,14 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
};
|
||||
recompute();
|
||||
},
|
||||
() => { state.redisStatsState = "unavailable"; }
|
||||
() => { if (!disposed && current === statsVersion) { statsPending = false; state.redisStatsState = "unavailable"; } }
|
||||
);
|
||||
}
|
||||
function load() {
|
||||
loadEntries();
|
||||
loadStats();
|
||||
function load(background = false) {
|
||||
// Polls must not invalidate a slow head or pagination request. Explicit
|
||||
// refreshes still supersede it; stats refresh independently of entries.
|
||||
if (!background || !state.redisLoading) loadEntries();
|
||||
loadStats(background);
|
||||
}
|
||||
|
||||
// Volume chart: errors and warnings carry the height (scaled to their own peak, up to 44px);
|
||||
@@ -1795,17 +1816,39 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
return `${t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })} · ${b.error || 0} err · ${b.warn || 0} warn · ${b.info || 0} info`;
|
||||
};
|
||||
|
||||
state.toggle = (row) => {
|
||||
state.expanded[row._key] = !state.expanded[row._key];
|
||||
state.toggle = async (row, origin) => {
|
||||
historyOrigin = origin || document.activeElement;
|
||||
historyScroll = state.captureErrorScroll(historyOrigin);
|
||||
state.historySelected = row;
|
||||
state.historyView = "overview";
|
||||
state.expanded = {[row._key]:true};
|
||||
await nextTick();
|
||||
document.getElementById("history-inspector-title")?.focus({preventScroll:true});
|
||||
document.getElementById("history-inspector-title")?.scrollIntoView?.({block:"nearest"});
|
||||
};
|
||||
state.showHistoryTimeline = origin => {
|
||||
state.historyView = "timeline";
|
||||
if(state.traceSelection) return;
|
||||
const kind=["requestId","jobId"].find(key=>state.logTraceId(state.historySelected,key));
|
||||
if(kind) state.lookupTrace(kind,state.logTraceId(state.historySelected,kind),origin,state.historySelected);
|
||||
};
|
||||
state.closeHistory = async () => {
|
||||
const key = state.historySelected?._key;
|
||||
state.historySelected = null; state.expanded = {};
|
||||
if (state.traceSelection) await state.closeTrace();
|
||||
await nextTick();
|
||||
const target = historyOrigin?.isConnected ? historyOrigin : [...document.querySelectorAll('[data-history-key]')].find(node=>node.dataset.historyKey===key);
|
||||
target?.focus({preventScroll:true});
|
||||
state.restoreErrorScroll(historyScroll);
|
||||
};
|
||||
state.setBucket = (b) => {
|
||||
state.query.bucket = b;
|
||||
};
|
||||
|
||||
state.refreshNow = load;
|
||||
state.refreshNow = () => { state.historySelected = null; state.historyView = "overview"; state.expanded = {}; if (state.traceSelection) state.closeTrace(); load(); };
|
||||
state.clearAll = () => {
|
||||
if (!confirm("Clear Redis error history? Central logs are unaffected.")) return;
|
||||
http.delete("/api/admin/errors").then(load, (err) => console.error(err));
|
||||
http.delete("/api/admin/errors").then(() => state.refreshNow(), (err) => console.error(err));
|
||||
};
|
||||
state.exportCsv = () => {
|
||||
const cols = ["ts", "level", "module", "displayMessage", "_status", "_url", "_repoId"];
|
||||
@@ -1831,7 +1874,7 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
timers.timeout(() => { state.copyHint = ""; }, 1500);
|
||||
}
|
||||
state.copyJson = (row) => {
|
||||
navigator.clipboard.writeText(row._detailJson).then(() => flashCopy("JSON"));
|
||||
navigator.clipboard.writeText(row._rawJson).then(() => flashCopy("JSON"));
|
||||
};
|
||||
state.copyCurl = (row) => {
|
||||
if (!row._url) return;
|
||||
@@ -1842,9 +1885,9 @@ export const errorsAdminController = function (state, http, location, interval)
|
||||
|
||||
load();
|
||||
const stop = interval(() => {
|
||||
if (state.query.autoRefresh) load();
|
||||
if (state.query.autoRefresh) load(true);
|
||||
}, 15000);
|
||||
state.on("dispose", () => interval.cancel(stop));
|
||||
state.on("dispose", () => { disposed = true; historyVersion++; statsVersion++; interval.cancel(stop); });
|
||||
|
||||
state.watch("query.search", recompute);
|
||||
state.watch("query.bucket", recompute);
|
||||
|
||||
Vendored
+49
-49
@@ -1,52 +1,52 @@
|
||||
"use strict";(()=>{var el=Object.defineProperty;var tl=e=>{throw TypeError(e)};var rf=(e,t,s)=>t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var af=(e,t)=>{for(var s in t)el(e,s,{get:t[s],enumerable:!0})};var et=(e,t,s)=>rf(e,typeof t!="symbol"?t+"":t,s),hr=(e,t,s)=>t.has(e)||tl("Cannot "+s);var re=(e,t,s)=>(hr(e,t,"read from private field"),s?s.call(e):t.get(e)),qe=(e,t,s)=>t.has(e)?tl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),_e=(e,t,s,i)=>(hr(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Le=(e,t,s)=>(hr(e,t,"access private method"),s);var nl=(e,t,s,i)=>({set _(o){_e(e,t,o,s)},get _(){return re(e,t,i)}});var he=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ge={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",editor:"/script/editor.4f142d3adc.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js"};function sl(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let s=new URLSearchParams(t);if([...s.keys()].length!==3||[...s.keys()].some(d=>!["clientId","intentId","token"].includes(d)))return null;let i=s.get("clientId"),o=s.get("intentId"),r=s.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(o||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:o,token:r}}function ol(e,t){let{http:s,promises:i,window:o}=t,r=t.takeReviewHandoff(),d=r?{clientId:r.clientId,intentId:r.intentId}:null,p,u,y,h,b,m=!0,w,N=i.defer(),S=()=>[...o.crypto.getRandomValues(new Uint8Array(16))].map(V=>V.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let R=()=>m&&e.user?.username===b;function v(){m=!1,r=p=u=void 0,N.resolve(),o.clearTimeout(w)}e.on("dispose",v),e.on("routeLeave",v),e.watch(()=>e.user?.username,V=>{!b&&V?b=V:b&&V!==b&&(v(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let E=()=>({timeout:N.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":u}}),D=V=>V?.status===404?"Artifact linking is not available on this server.":V?.status===401?"Sign in, then open a new artifact link from your submission.":V?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!m||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;b=e.user.username;let V=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(V)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,p=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,o.clearTimeout(w),h||(h=S());try{let L=(await s.get("/api/review-consent/csrf",{timeout:N.promise})).data;if(!R())return;if(u=L.csrf,e.handoffEnabled=L.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(u||""))throw new Error("invalid_csrf");let z=(await s.post("/api/review-consent/preview",{repositoryId:V,intent:{...r,requestId:h}},E())).data;if(!R())return;if(!z||typeof z.ticket!="string"||!z.ticket||z.ticket.length>8192||typeof z.repositoryName!="string"||!["restricted-review","anonymous-link"].iLine truncated
|
||||
`))),e[hn]=$s(o);let r=i||o.props&&o.props.type==="number";Vn(e,t?"change":"input",d=>{d.target.composing||e[hn](ta(e.value,s,r))}),(s||r)&&Vn(e,"change",()=>{e.value=ta(e.value,s,r)}),t||(Vn(e,"compositionstart",uh),Vn(e,"compositionend",jd),Vn(e,"change",jd))},mounted(e,{value:t,modifiers:{trim:s,number:i}}){let o=t??"",r=e[Vi];delete e[Vi],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[hn](ta(e.value,s,i)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:i,trim:o,number:r}},d){if(e[hn]=$s(d),e.composing)return;let p=(r||e.type==="number")&&!/^0\d/.test(e.value)?As(e.value):e.value,u=t??"";if(p===u)return;let y=e.getRootNode();(y instanceof Document||y instanceof ShadowRoot)&&y.activeElement===e&&e.type!=="range"&&(i&&t===s||o&&e.value.trim()===u)||(e.value=u)}},sa={deep:!0,created(e,t,s){e[hn]=$s(s),Vn(e,"change",()=>{let i=e._modelValue,o=Mo(e),r=e.checked,d=e[hn];if(Ne(i)){let p=li(i,o),u=p!==-1;if(r&&!u)d(i.concat(o));else if(!r&&u){let y=[...i];y.splice(p,1),d(y)}}else if(Xt(i)){let p=new Set(i);r?p.add(o):p.delete(o),d(p)}else d(Jd(e,r))})},mounted:Gd,beforeUpdate(e,t,s){e[hn]=$s(s),Gd(e,t,s)}};function Gd(e,{value:t,oldValue:s},i){e._modelValue=t;let o;if(Ne(t))o=li(t,i.props.value)>-1;else if(Xt(t))o=t.has(i.props.value);else{if(t===s)return;o=Jt(t,Jd(e,!0))}e.checked!==o&&(e.checked=o)}var Tt={deep:!0,created(e,{value:t,modifiers:{number:s}},i){e._modelValue=t,Vn(e,"change",()=>{let o=Array.prototype.filter.call(e.options,u=>u.selected).map(u=>s?As(Mo(u)):Mo(u)),r=e.multiple,d=r?Xt(e._modelValue)?new Set(o):o:o[0],p=e._pendingValue=[r,r?Ne(d)?o.slice():o:d];try{e[hn](d)}finally{xe(()=>{e._pendingValue===p&&(e._pendingValue=void 0)})}}),e[hn]=$s(i)},mounted(e,{value:t}){Wd(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[hn]=$s(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!ch(t,s[1],s[0]))&&Wd(e,t)}};function ch(e,t,s){if(!s)return Jt(e,t);if(Ne(e))return Jt(e,t);if(Xt(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function Wd(e,t){let s=e.multiple,i=Ne(t);if(!(s&&!i&&!Xt(t))){for(let o=0,r=e.options.length;o<r;o++){let d=e.options[o],p=Mo(d);if(s)if(i){let u=typeof p;u==="string"||u==="number"?d.selected=t.some(y=>String(y)===String(p)):d.selected=li(t,p)>-1}else d.selected=t.has(p);else if(Jt(Mo(d),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Mo(e){return"_value"in e?e._value:e.value}function Jd(e,t){let s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}var ph=["ctrl","shift","alt","meta"],fh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ph.some(s=>e[`${s}Key`]&&!t.includes(s))},ae=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),i=t.join(".");return s[i]||(s[i]=((o,...r)=>{for(let d=0;d<t.length;d++){let p=fh[t[d]];if(p&&p(o,t))return}return e(o,...r)}))},mh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},kt=(e,t)=>{let s=e._withKeys||(e._withKeys={}),i=t.join(".");return s[i]||(s[i]=(o=>{if(!("key"in o))return;let r=on(o.key);if(t.some(d=>d===r||mh[d]===r))return e(o)}))},hh=pt({patchProp:ah},Gm),Kd;function gh(){return Kd||(Kd=Rd(hh))}var Qd=((...e)=>{let t=gh().createApp(...e),{mount:s}=t;return t.mount=i=>{let o=yh(i);if(!o)return;let r=t._component;!Ie(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");let d=s(o,!1,vh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),d},t});function vh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function yh(e){return rt(e)?document.querySelector(e):e}var ls=typeof document<"u";function xd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function bh(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&xd(e.default)}var Je=Object.assign;function Li(e,t){let s={};for(let i in t){let o=t[i];s[i]=Kt(o)?o.map(e):e(o)}return s}var Fs=()=>{},Kt=Array.isArray;function ra(e,t){let s={};for(let i in e)s[i]=i in t?t[i]:e[i];return s}var eu=/#/g,wh=/&/g,kh=/\//g,Ch=/=/g,Eh=/\?/g,tu=/\+/g,Sh=/%5B/g,Nh=/%5D/g,nu=/%5E/g,Rh=/%60/g,su=/%7B/g,Ph=/%7C/g,ou=/%7D/g,Dh=/%20/g;function aa(e){return e==null?"":encodeURI(""+e).replace(Ph,"|").replace(Sh,"[").replace(Nh,"]")}function iu(e){return aa(e).replace(su,"{").replace(ou,"}").replace(nu,"^")}function oa(e){return aa(e).replace(tu,"%2B").replace(Dh,"+").replace(eu,"%23").replace(wh,"%26").replace(Rh,"`").replace(su,"{").replace(ou,"}").replace(nu,"^")}function Th(e){return oa(e).replace(Ch,"%3D")}function Ah(e){return aLine truncated
|
||||
"use strict";(()=>{var el=Object.defineProperty;var tl=e=>{throw TypeError(e)};var rf=(e,t,s)=>t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var af=(e,t)=>{for(var s in t)el(e,s,{get:t[s],enumerable:!0})};var et=(e,t,s)=>rf(e,typeof t!="symbol"?t+"":t,s),hr=(e,t,s)=>t.has(e)||tl("Cannot "+s);var re=(e,t,s)=>(hr(e,t,"read from private field"),s?s.call(e):t.get(e)),Le=(e,t,s)=>t.has(e)?tl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),_e=(e,t,s,i)=>(hr(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),$e=(e,t,s)=>(hr(e,t,"access private method"),s);var nl=(e,t,s,i)=>({set _(o){_e(e,t,o,s)},get _(){return re(e,t,i)}});var ge=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ve={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};function ol(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let s=new URLSearchParams(t);if([...s.keys()].length!==3||[...s.keys()].some(d=>!["clientId","intentId","token"].includes(d)))return null;let i=s.get("clientId"),o=s.get("intentId"),r=s.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(o||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:o,token:r}}function sl(e,t){let{http:s,promises:i,window:o}=t,r=t.takeReviewHandoff(),d=r?{clientId:r.clientId,intentId:r.intentId}:null,p,c,v,g,y,m=!0,b,E=i.defer(),S=()=>[...o.crypto.getRandomValues(new Uint8Array(16))].map(_=>_.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let N=()=>m&&e.user?.username===y;function w(){m=!1,r=p=c=void 0,E.resolve(),o.clearTimeout(b)}e.on("dispose",w),e.on("routeLeave",w),e.watch(()=>e.user?.username,_=>{!y&&_?y=_:y&&_!==y&&(w(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let D=()=>({timeout:E.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":c}}),O=_=>_?.status===404?"Artifact linking is not available on this server.":_?.status===401?"Sign in, then open a new artifact link from your submission.":_?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!m||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;y=e.user.username;let _=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(_)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,p=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,o.clearTimeout(b),g||(g=S());try{let j=(await s.get("/api/review-consent/csrf",{timeout:E.promise})).data;if(!N())return;if(c=j.csrf,e.handoffEnabled=j.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(c||""))throw new Error("invalid_csrf");let oe=(await s.post("/api/review-consent/preview",{repositoryId:_,intent:{...r,requestId:g}},D())).data;if(!N())return;if(!oe||typeof oe.ticket!="string"||!oe.ticket||oe.ticket.length>8192||typeof oe.repositoryName!="string"||!["restricted-review","anonymous-liLine truncated
|
||||
`))),e[hn]=Fo(o);let r=i||o.props&&o.props.type==="number";Vn(e,t?"change":"input",d=>{d.target.composing||e[hn](ta(e.value,s,r))}),(s||r)&&Vn(e,"change",()=>{e.value=ta(e.value,s,r)}),t||(Vn(e,"compositionstart",uh),Vn(e,"compositionend",jd),Vn(e,"change",jd))},mounted(e,{value:t,modifiers:{trim:s,number:i}}){let o=t??"",r=e[Vi];delete e[Vi],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[hn](ta(e.value,s,i)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:i,trim:o,number:r}},d){if(e[hn]=Fo(d),e.composing)return;let p=(r||e.type==="number")&&!/^0\d/.test(e.value)?Io(e.value):e.value,c=t??"";if(p===c)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(i&&t===s||o&&e.value.trim()===c)||(e.value=c)}},oa={deep:!0,created(e,t,s){e[hn]=Fo(s),Vn(e,"change",()=>{let i=e._modelValue,o=Ms(e),r=e.checked,d=e[hn];if(Ne(i)){let p=li(i,o),c=p!==-1;if(r&&!c)d(i.concat(o));else if(!r&&c){let v=[...i];v.splice(p,1),d(v)}}else if(Jt(i)){let p=new Set(i);r?p.add(o):p.delete(o),d(p)}else d(Xd(e,r))})},mounted:Gd,beforeUpdate(e,t,s){e[hn]=Fo(s),Gd(e,t,s)}};function Gd(e,{value:t,oldValue:s},i){e._modelValue=t;let o;if(Ne(t))o=li(t,i.props.value)>-1;else if(Jt(t))o=t.has(i.props.value);else{if(t===s)return;o=Xt(t,Xd(e,!0))}e.checked!==o&&(e.checked=o)}var Rt={deep:!0,created(e,{value:t,modifiers:{number:s}},i){e._modelValue=t,Vn(e,"change",()=>{let o=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>s?Io(Ms(c)):Ms(c)),r=e.multiple,d=r?Jt(e._modelValue)?new Set(o):o:o[0],p=e._pendingValue=[r,r?Ne(d)?o.slice():o:d];try{e[hn](d)}finally{je(()=>{e._pendingValue===p&&(e._pendingValue=void 0)})}}),e[hn]=Fo(i)},mounted(e,{value:t}){Wd(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[hn]=Fo(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!ch(t,s[1],s[0]))&&Wd(e,t)}};function ch(e,t,s){if(!s)return Xt(e,t);if(Ne(e))return Xt(e,t);if(Jt(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function Wd(e,t){let s=e.multiple,i=Ne(t);if(!(s&&!i&&!Jt(t))){for(let o=0,r=e.options.length;o<r;o++){let d=e.options[o],p=Ms(d);if(s)if(i){let c=typeof p;c==="string"||c==="number"?d.selected=t.some(v=>String(v)===String(p)):d.selected=li(t,p)>-1}else d.selected=t.has(p);else if(Xt(Ms(d),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ms(e){return"_value"in e?e._value:e.value}function Xd(e,t){let s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}var ph=["ctrl","shift","alt","meta"],fh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ph.some(s=>e[`${s}Key`]&&!t.includes(s))},ae=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),i=t.join(".");return s[i]||(s[i]=((o,...r)=>{for(let d=0;d<t.length;d++){let p=fh[t[d]];if(p&&p(o,t))return}return e(o,...r)}))},mh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Vt=(e,t)=>{let s=e._withKeys||(e._withKeys={}),i=t.join(".");return s[i]||(s[i]=(o=>{if(!("key"in o))return;let r=sn(o.key);if(t.some(d=>d===r||mh[d]===r))return e(o)}))},hh=pt({patchProp:ah},Gm),Kd;function gh(){return Kd||(Kd=Rd(hh))}var Qd=((...e)=>{let t=gh().createApp(...e),{mount:s}=t;return t.mount=i=>{let o=yh(i);if(!o)return;let r=t._component;!Ie(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");let d=s(o,!1,vh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),d},t});function vh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function yh(e){return rt(e)?document.querySelector(e):e}var lo=typeof document<"u";function xd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function bh(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&xd(e.default)}var Ze=Object.assign;function Li(e,t){let s={};for(let i in t){let o=t[i];s[i]=Kt(o)?o.map(e):e(o)}return s}var Uo=()=>{},Kt=Array.isArray;function ra(e,t){let s={};for(let i in e)s[i]=i in t?t[i]:e[i];return s}var eu=/#/g,wh=/&/g,kh=/\//g,Ch=/=/g,Sh=/\?/g,tu=/\+/g,Eh=/%5B/g,Nh=/%5D/g,nu=/%5E/g,Rh=/%60/g,ou=/%7B/g,Th=/%7C/g,su=/%7D/g,Dh=/%20/g;function aa(e){return e==null?"":encodeURI(""+e).replace(Th,"|").replace(Eh,"[").replace(Nh,"]")}function iu(e){return aa(e).replace(ou,"{").replace(su,"}").replace(nu,"^")}function sa(e){return aa(e).replace(tu,"%2B").replace(Dh,"+").replace(eu,"%23").replace(wh,"%26").replace(Rh,"`").replace(ou,"{").replace(su,"}").replace(nu,"^")}function Ph(e){return sa(e).replace(Ch,"%3D")}function Ah(e){return aLine truncated
|
||||
${JSON.stringify(e)}${t?`
|
||||
while being at
|
||||
`+JSON.stringify(t):""}`},[ct.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Fh(t)}" via a navigation guard.`},[ct.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[ct.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[ct.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function as(e,t){return Je(new Error,{type:e,[mu]:!0},t)}function gn(e,t){return e instanceof Error&&mu in e&&(t==null||!!(e.type&t))}var _h=["params","query","hash"];function Fh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of _h)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function hu(e){let t={};if(e===""||e==="?")return t;let s=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;i<s.length;++i){let o=s[i].replace(tu," "),r=o.indexOf("="),d=_s(r<0?o:o.slice(0,r)),p=r<0?null:_s(o.slice(r+1));if(d in t){let u=t[d];Kt(u)||(u=t[d]=[u]),u.push(p)}else t[d]=p}return t}function pa(e){let t="";for(let s in e){let i=e[s];if(s=Th(s),i==null){i!==void 0&&(t+=(t.length?"&":"")+s);continue}(Kt(i)?i.map(o=>o&&oa(o)):[i&&oa(i)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function gu(e){let t={};for(let s in e){let i=e[s];i!==void 0&&(t[s]=Kt(i)?i.map(o=>o==null?null:""+o):i==null?i:""+i)}return t}var vu=Symbol(""),fa=Symbol(""),Ui=Symbol(""),Bi=Symbol(""),zi=Symbol("");function Us(){let e=[];function t(i){return e.push(i),()=>{let o=e.indexOf(i);o>-1&&e.splice(o,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function Nn(e,t,s,i,o,r=d=>d()){let d=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise((p,u)=>{let y=m=>{m===!1?u(as(ct.NAVIGATION_ABORTED,{from:s,to:t})):m instanceof Error?u(m):$h(m)?u(as(ct.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(d&&i.enterCallbacks[o]===d&&typeof m=="function"&&d.push(m),p())},h=r(()=>e.call(i&&i.instances[o],t,s,y)),b=Promise.resolve(h);e.length<3&&(b=b.then(y)),b.catch(m=>u(m))})}function Hi(e,t,s,i,o=r=>r()){let r=[];for(let d of e)for(let p in d.components){let u=d.components[p];if(!(t!=="beforeRouteEnter"&&!d.instances[p]))if(xd(u)){let y=(u.__vccOpts||u)[t];y&&r.push(Nn(y,s,i,d,p,o))}else{let y=u();r.push(()=>y.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${p}" at "${d.path}"`);let b=bh(h)?h.default:h;d.mods[p]=h,d.components[p]=b;let m=(b.__vccOpts||b)[t];return m&&Nn(m,s,i,d,p,o)()}))}}return r}function yu(e,t){let s=[],i=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let d=0;d<r;d++){let p=t.matched[d];p&&(e.matched.find(y=>rs(y,p))?i.push(p):s.push(p));let u=e.matched[d];u&&(t.matched.find(y=>rs(y,u))||o.push(u))}return[s,i,o]}var Uh=()=>location.protocol+"//"+location.host;function Tu(e,t){let{pathname:s,search:i,hash:o}=t,r=e.indexOf("#");if(r>-1){let d=o.includes(e.slice(r))?e.slice(r).length:1,p=o.slice(d);return p[0]!=="/"&&(p="/"+p),la(p,"")}return la(s,e)+i+o}function Bh(e,t,s,i){let o=[],r=[],d=null,p=({state:m})=>{let w=Tu(e,location),N=s.value,S=t.value,R=0;if(m){if(s.value=w,t.value=m,d&&d===N){d=null;return}R=S?m.position-S.position:0}else i(w);o.forEach(v=>{v(s.value,N,{delta:R,type:_i.pop,direction:R?R>0?Fi.forward:Fi.back:Fi.unknown})})};function u(){d=s.value}function y(m){o.push(m);let w=()=>{let N=o.indexOf(m);N>-1&&o.splice(N,1)};return r.push(w),w}function h(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Je({},m.state,{scroll:Vo()}),"")}}function b(){for(let m of r)m();r=[],window.removeEventListener("popstate",p),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",p),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:u,listen:y,destroy:b}}function bu(e,t,s,i=!1,o=!1){return{back:e,current:t,forward:s,replaced:i,position:window.history.length,scroll:o?Vo():null}}function zh(e){let{history:t,location:s}=window,i={value:Tu(e,s)},o={value:t.state};o.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(u,y,h){let b=e.indexOf("#"),m=b>-1?(s.host&&document.querySelector("base")?e:e.slice(b))+u:Uh()+e+u;try{t[h?"replaceState":"pushState"](y,"",m),o.value=y}catch(w){console.error(w),s[h?"replace":"assign"](m)}}function d(u,y){r(u,Je({},t.state,bu(o.value.back,u,o.value.forward,!0),y,{position:o.value.position}),!0),i.value=u}function p(u,y){let h=Je({},o.value,t.state,{forward:u,scroll:Vo()});r(h.current,h,!0),r(u,Je({},bu(i.value,u,null),{position:h.position+1},y),!1),i.value=u}return{location:i,state:o,push:p,replace:d}}function Au(e){e=du(e);let t=zh(e),s=Bh(e,t.state,t.location,t.replace);function i(r,d=!0){d||s.pauseListeners(),history.go(r)}let o=Je({locatLine truncated
|
||||
`).forEach((U,C)=>{for(let[_,H]of w){let K=_.exec(U);if(K&&!/^(if|for|while|switch|return|catch)$/.test(K[1])){O.push({name:K[1],kind:H,line:C+1});break}}}),N={content:e.content,list:O.slice(0,300)},N.list},e.goToSymbol=function(O){e.symbolsOpen=!1;let U=e.codeEditor;U&&(U.scrollToLine(O-1,!0,!0,()=>{}),U.gotoLine(O,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+O),window.dispatchEvent(new HashChangeEvent("hashchange")))},e.gotoLine=function(){e.codeEditor&&(e.moreOpen=!1,e.gotoError="",e.gotoValue=String(e.codeEditor.getCursorPosition().row+1),e.gotoOpen=!0,setTimeout(()=>{let O=window.document.getElementById("goto-input");O&&(O.focus(),O.select())},0))},e.closeGoto=function(){e.gotoOpen=!1,e.gotoError="",e.codeEditor?.focus()},e.submitGoto=function(){let O=e.codeEditor;if(!O)return;let U=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),C=O.session.getLength();if(!U||+U[1]<1||+U[1]>C){e.gotoError="Enter a line from 1 to "+C;return}O.gotoLine(+U[1],U[2]?Math.max(0,+U[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",O.focus()},e.rootEntries=function(){return[...e.files||[]].sort((O,U)=>{let C=O.size==null,_=U.size==null;return C!==_?C?-1:1:O.name.localeCompare(U.name)})},e.formatSize=function(O){if(O==null)return"";if(O<1024)return O+" B";let U=O/1024,C=_=>_.toFixed(1).replace(/\.0$/,"");return U<1024?C(U)+" KB":U<1024*1024?C(U/1024)+" MB":C(U/1024/1024)+" GB"},e.fileSize=function(O){if(!O)return null;let U=O.replace(/^\/+/,""),C=(e.files||[]).find(_=>(_.path?_.path+"/":"")+_.name===U);return C&&C.size!=null?C.size:null},e.revealFolder=function(O){e.sidebarHidden=!1,e.sidebarCollapsed=!1,xe(()=>{let U=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(O):O)+'"]');U&&(U.closest("li")?.classList.contains("open")||U.click(),U.scrollIntoView({block:"nearest"}),U.focus())})};let S={content:null,n:0},R=O=>{if(S.content===O)return S.n;let U=O;if(typeof U=="string")try{U=JSON.parse(U)}catch{U=null}let C=[],_=K=>{Array.isArray(K)?C.push(K.join("")):typeof K=="string"&&C.push(K)};(U&&(U.cells||(U.worksheets||[]).flatMap(K=>K.cells||[]))||[]).forEach(K=>{_(K?.source??K?.input),(K?.outputs||[]).forEach(ie=>{_(ie?.text),ie?.data&&(_(ie.data["text/plain"]),_(ie.data["text/markdown"]),_(ie.data["text/html"])),_(ie?.traceback)})});let H=C.reduce((K,ie)=>K+(ie.match(s)||[]).length,0);return S={content:O,n:H},H};e.redactionCount=function(){return e.type==="IPython"?R(e.content):typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(s)||[]).length},e.renderRedacted=Lo;let v=O=>O.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(O){let U=e.renderRedacted(O);if(!U||typeof window.DOMParser!="function")return U;let C=new window.DOMParser().parseFromString("<div>"+U+"</div>","text/html"),_={};return C.querySelectorAll("h1, h2, h3").forEach(H=>{let K=H.id||v(H.textContent);_[K]?K+="-"+ ++_[K]:_[K]=1,H.id=K}),C.body.firstChild.innerHTML};let E={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(E.content===e.content)return E.list;let U=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(C=>({id:C.id,text:C.textContent.trim(),level:C.tagName==="H3"?3:2})).slice(0,40);return E={content:e.content,list:U},U},e.activeHeading=null,o(window,"scroll",()=>{let O=e.readmeToc?e.readmeToc():[];if(!O.length)return;let U=150,C="",_="";for(let H of O){let K=window.document.getElementById(H.id);if(!K)continue;let ie=K.getBoundingClientRect().top;ie<U?C=H.id:!_&&ie<window.innerHeight-80&&(_=H.id)}_&&(C=_),e.activeHeading!==C&&(e.activeHeading=C)},{capture:!0,passive:!0}),e.scrollToHeading=function(O){if(!O){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let U=window.document.getElementById(O);U&&U.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=O},e.csvView="table";let D={content:null,rows:[]},V=(O,U)=>{let C=[],_=[],H="",K=!1;for(let ie=0;ie<O.length;ie++){let se=O[ie];K?se==='"'?O[ie+1]==='"'?(H+='"',ie++):K=!1:H+=se:se==='"'&&H===""?K=!0:se===U?(_.push(H),H=""):se===`
|
||||
`||se==="\r"?(se==="\r"&&O[ie+1]===`
|
||||
`&&ie++,_.push(H),C.push(_),_=[],H=""):H+=se}return(H!==""||_.length)&&(_.push(H),C.push(_)),C.filter(ie=>ie.length>1||ie[0]!=="")};e.isCsv=()=>typeof e.content=="string"&&e.type!=="html"&&/\.(csv|tsv)$/i.test(e.filePath||"")&&e.content.length<=1024*1024,e.csvRows=()=>{if(D.content!==e.content){let O=/\.tsv$/i.test(e.filePath||"")?" ":",";D={content:e.content,rows:V(e.content,O)}}return D.rows},e.csvNumCol=O=>{let U=e.csvRows().slice(1).map(C=>C[O]).filter(C=>C!=null&&String(C).trim()!=="");return U.length>0&&U.every(C=>e.csvNumeric(C))},e.csvNumeric=O=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(O)&&/\d/.test(O),e.redactParts=function(O){let U=[],C=0,_,H=/\bXXXX-(\d+)\b/g;for(O=String(O||"");_=H.exec(O);)_.index>C&&U.push({t:O.slice(C,_.index)}),U.push({n:_[1]}),C=_.index+_[0].length;return C<O.length&&U.push({t:O.slice(C)}),U},e.pathCopied=!1,e.copyPath=async function(){window.navigator.clipboard?.writeText&&(await window.navigator.clipboard.writeText(e.filePath||""),e.pathCopied=!0,setTimeout(()=>{e.pathCopied=!1},1600))},e.contentCopied=!1,e.copyContent=async function(){if(typeof e.content!="string"||!window.navigator.clipboard?.writeText)return;let O=e.content;if(e.type==="html"&&e.url)if(e.preview)O=e.sourceContent;else try{O=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(O),e.contentCopied=!0,setTimeout(()=>{e.contentCopied=!1},1600)};function L(O){return r[O]?r[O]:O}function z(O){return O=="pdf"?"pdf":O=="html"||O=="htm"?"html-doc":["md","markdown","mdown","mkdn","mdx"].includes(O)?"md":O=="org"?"org":O=="ipynb"?"IPython":d.indexOf(O)>-1?"text":p.indexOf(O)>-1?"image":y.indexOf(O)>-1?"media":u.indexOf(O)>-1?"audio":"code"}e.downloadUrl=()=>e.preview?e.url:e.url+"&download=true",e.prepareFile=function(O){e.showSource=!1,e.allowScripts=!1,e.imageSize="",e.filePath=O,e.paths=O.split("/").filter(Boolean);let U=e.filePath.toLowerCase(),C=U.lastIndexOf(".");C>-1&&(U=U.substring(C+1));let _={javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",python:"Python",java:"Java",c_cpp:"C/C++",csharp:"C#",golang:"Go",rust:"Rust",ruby:"Ruby",php:"PHP",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",yaml:"YAML",markdown:"Markdown",sh:"Shell",dockerfile:"Dockerfile",xml:"XML",sql:"SQL",kotlin:"Kotlin",swift:"Swift",scala:"Scala",r:"R",julia:"Julia",latex:"LaTeX",toml:"TOML",csv:"CSV",tsv:"TSV",text:""},H=L(U);e.languageName=_[H]??(H?H.charAt(0).toUpperCase()+H.slice(1):""),e.aceOption={readOnly:!0,useWrapMode:!0,showGutter:!0,theme:"chrome",useSoftTab:!0,tabSize:2,fontSize:window.matchMedia?.("(max-width: 767px)").matches?12:13,keyBinding:"vscode",fullLineSelection:!0,highlightActiveLine:!1,highlightGutterLine:!1,cursor:"hide",showInvisibles:!1,showIndentGuides:!1,showPrintMargin:!1,highlightSelectedWord:!1,enableBehaviours:!0,fadeFoldWidgets:!1,mode:L(U),onLoad:function(K){e.codeEditor=un(K);{let Re=K.session,Fe=Re.getTokens.bind(Re),W=/\bXXXX-\d+\b/g;if(Re.getTokens=function(fe){let de=Fe(fe);if(!de.some(ve=>ve.value.indexOf("XXXX-")!==-1))return de;let ce=[];for(let ve of de){if(ve.value.indexOf("XXXX-")===-1){ce.push(ve);continue}let Me=0;W.lastIndex=0;let T;for(;T=W.exec(ve.value);)T.index>Me&&ce.push({type:ve.type,value:ve.value.slice(Me,T.index)}),ce.push({type:"redacted.n"+T[0].slice(5),value:T[0]}),Me=T.index+T[0].length;Me<ve.value.length&&ce.push({type:ve.type,value:ve.value.slice(Me)})}return ce},!window.document.getElementById("redact-index-rules")){let fe=window.document.createElement("style");fe.id="redact-index-rules",fe.textContent=Array.from({length:99},(de,ce)=>`.ace_redacted.ace_n${ce+1}::after{content:"${ce+1}"}`).join(""),window.document.head.appendChild(fe)}K.renderer.updateFull(!0)}K.session.setUseWrapMode(e.wrapLines!==!1);let ie=K.container.closest?.(".file-card"),se=()=>{if(!ie)return;let Re=K.renderer,Fe=(Re.layerConfig?.width||0)-(Re.$size?.scrollerWidth||0);ie.classList.toggle("at-right-edge",Fe<=2||Re.getScrollLeft()>=Fe-2)};K.session.on("changeScrollLeft",se),K.renderer.on("afterRender",se),window.matchMedia?.("(max-width: 767px)").matches&&K.setOption("hScrollBarAlwaysVisible",!0);let Y=ace.require("ace/range").Range,me=null;function Se(Re,Fe){me!==null&&(K.session.removeMarker(me),me=null),Re!=null&&(me=K.session.addMarker(new Y(Re,0,Fe,1),"highlighted-line","fullLine"))}function Ue(Re){let Fe=!e.preview&&window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(!Fe){Se(null);return}let W=parseInt(Fe[1])-1,fe=Fe[2]?parseInt(Fe[2])-1:W;Se(W,fe),Re&&i.timeout(()=>{K.scrollToLine(W,!0,!0,function(){})},100)}Ue(!0);let Be=null;K.on("guttermousedown",function(Re){let Fe=Re.getDocumentPosition().row,W=Re.domEvent&&Re.domEvent.shiftKey,fe=Fe,de=Fe;W&&Be!==null?(fe=Math.min(Be,Fe),de=Math.max(Be,Fe)):Be=Fe;let ce=fe===de?`#L${fe+1}`:`#L${fe+1}-L${de+1}`,ve=window.location.pathname+window.location.search+ce;e.preview||window.history.replaceState(null,"",ve),Se(fe,de),Re.stop()});let Qe=o(window,"h
Line truncated
|
||||
`);for(let b=0;b<h.length;b++){let m=h[b];if(m.startsWith("diff --git")){y(),u();continue}if(m.startsWith("--- ")){r&&r.lines.length&&y(),u().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){u().newPath=m.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(m.startsWith("index ")||m.startsWith("similarity index")||m.startsWith("rename ")||m.startsWith("new file mode")||m.startsWith("deleted file mode")||m.startsWith("Binary files"))){if(m.startsWith("@@")){let w=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);w&&(d=parseInt(w[1],10),p=parseInt(w[2],10)),u().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}r&&(m.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:p,text:m.slice(1)}),p++):m.startsWith("-")?(r.lines.push({kind:"remove",oldNo:d,newNo:"",text:m.slice(1)}),d++):(r.lines.push({kind:"ctx",oldNo:d,newNo:p,text:m.startsWith(" ")?m.slice(1):m}),d++,p++))}}return s(o,r),o.join("")}})({trustAsHtml:e=>e});function mg(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function hg(e,t="EUR"){let s=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:s%1?2:0,maximumFractionDigits:2}).format(s)}function gg(e){return String(e??"").toUpperCase()}function vg(e,t,s=0){return(e||[]).slice(s,s+t)}function yg(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function bg(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((i,o)=>{for(let r of s){let d=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let p=r.split(".").reduce((y,h)=>y?.[h],i),u=r.split(".").reduce((y,h)=>y?.[h],o);if(typeof p=="string"&&(p=p.toLowerCase()),typeof u=="string"&&(u=u.toLowerCase()),p!==u)return(p==null?-1:u==null?1:p<u?-1:1)*d}return 0})}function wg(e,t){if(!e)return"";let s=new Date(e);if(isNaN(s))return String(e);if(!t||t==="mediumDate")return s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let i={yyyy:s.getFullYear(),MMM:s.toLocaleDateString(void 0,{month:"short"}),MM:String(s.getMonth()+1).padStart(2,"0"),dd:String(s.getDate()).padStart(2,"0"),d:s.getDate(),HH:String(s.getHours()).padStart(2,"0"),mm:String(s.getMinutes()).padStart(2,"0"),ss:String(s.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,o=>i[o])}function kg(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function ya(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),s=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(s))return"";let i=s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),o=new Date;o.setHours(0,0,0,0);let r=Math.round((s-o)/864e5),d;if(r===0)d="today";else if(r===1)d="tomorrow";else if(r===-1)d="yesterday";else{let p=Math.abs(r),u=Math.round(p/30.44),y=p<14?[p,"day"]:p<60?[Math.round(p/7),"week"]:u<18?[u,"month"]:[Math.round(p/365.25),"year"],h=y[0]+" "+y[1]+(y[0]===1?"":"s");d=r>0?"in "+h:h+" ago"}return i+" \xB7 "+d}function qn(e){if(e==null||e===""||isNaN(e))return"";e=Number(e);let t="\u202F";if(e<1e3)return+(e<10?e.toFixed(2):e<100?e.toFixed(1):Math.round(e))+t+"ms";let s=e/1e3;if(s<60)return+(s<10?s.toFixed(2):s.toFixed(1))+t+"s";let i=r=>String(r).padStart(2,"0"),o=Math.round(s);return o<3600?Math.floor(o/60)+"m "+i(o%60)+"s":Math.floor(o/3600)+"h "+i(Math.floor(o%3600/60))+"m"}function ba(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let s={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(s.year="numeric"),t.toLocaleDateString(void 0,s)}var Xi=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function Ji(e,{flags:t,keys:s,count:i,onChange:o=()=>{}}){if(e.segView=()=>{let r=t()||{};if(s.every(p=>!!r[p]))return"all";let d=s.filter(p=>!!r[p]);return d.length===1?d[0]:"custom"},e.setSegView=r=>{let d=t();if(d){for(let p of s)d[p]=r==="all"?!0:p===r;o()}},e.segCount=r=>r==="all"?s.reduce((d,p)=>d+i(p),0):i(r),t()&&e.segView()==="custom")for(let r of s)t()[r]=!0}var Fu=function(e,t,s){let i=Ct(),o=Bt();Wu(i,o),e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.repositories=[],e.total=-1,e.totalPage=0,e.statusCounts=[],e.totalSize=0,e.selected={},e.allSelected=!1;let r=S=>{if(S.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){S.preventDefault();let R=document.querySelector('.admin-filter-toolbar input[type="search"]');R&&R.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=S=>{S==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[S]="",e.query.page=1},e.chips=[];let d=()=>{let S=[];e.query.owner&&S.push({key:"owner",label:"Owner",value:e.query.owner}),e.query.conference&&S.push({key:"conference",label:"Conference",value:e.query.conference}),e.chips=S};e.showSta
Line truncated
|
||||
`+JSON.stringify(t):""}`},[ct.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${_h(t)}" via a navigation guard.`},[ct.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[ct.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[ct.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ao(e,t){return Ze(new Error,{type:e,[mu]:!0},t)}function gn(e,t){return e instanceof Error&&mu in e&&(t==null||!!(e.type&t))}var Fh=["params","query","hash"];function _h(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of Fh)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function hu(e){let t={};if(e===""||e==="?")return t;let s=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;i<s.length;++i){let o=s[i].replace(tu," "),r=o.indexOf("="),d=_o(r<0?o:o.slice(0,r)),p=r<0?null:_o(o.slice(r+1));if(d in t){let c=t[d];Kt(c)||(c=t[d]=[c]),c.push(p)}else t[d]=p}return t}function pa(e){let t="";for(let s in e){let i=e[s];if(s=Ph(s),i==null){i!==void 0&&(t+=(t.length?"&":"")+s);continue}(Kt(i)?i.map(o=>o&&sa(o)):[i&&sa(i)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function gu(e){let t={};for(let s in e){let i=e[s];i!==void 0&&(t[s]=Kt(i)?i.map(o=>o==null?null:""+o):i==null?i:""+i)}return t}var vu=Symbol(""),fa=Symbol(""),Ui=Symbol(""),Bi=Symbol(""),zi=Symbol("");function Bo(){let e=[];function t(i){return e.push(i),()=>{let o=e.indexOf(i);o>-1&&e.splice(o,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function Nn(e,t,s,i,o,r=d=>d()){let d=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise((p,c)=>{let v=m=>{m===!1?c(ao(ct.NAVIGATION_ABORTED,{from:s,to:t})):m instanceof Error?c(m):$h(m)?c(ao(ct.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(d&&i.enterCallbacks[o]===d&&typeof m=="function"&&d.push(m),p())},g=r(()=>e.call(i&&i.instances[o],t,s,v)),y=Promise.resolve(g);e.length<3&&(y=y.then(v)),y.catch(m=>c(m))})}function Hi(e,t,s,i,o=r=>r()){let r=[];for(let d of e)for(let p in d.components){let c=d.components[p];if(!(t!=="beforeRouteEnter"&&!d.instances[p]))if(xd(c)){let v=(c.__vccOpts||c)[t];v&&r.push(Nn(v,s,i,d,p,o))}else{let v=c();r.push(()=>v.then(g=>{if(!g)throw new Error(`Couldn't resolve component "${p}" at "${d.path}"`);let y=bh(g)?g.default:g;d.mods[p]=g,d.components[p]=y;let m=(y.__vccOpts||y)[t];return m&&Nn(m,s,i,d,p,o)()}))}}return r}function yu(e,t){let s=[],i=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let d=0;d<r;d++){let p=t.matched[d];p&&(e.matched.find(v=>ro(v,p))?i.push(p):s.push(p));let c=e.matched[d];c&&(t.matched.find(v=>ro(v,c))||o.push(c))}return[s,i,o]}var Uh=()=>location.protocol+"//"+location.host;function Pu(e,t){let{pathname:s,search:i,hash:o}=t,r=e.indexOf("#");if(r>-1){let d=o.includes(e.slice(r))?e.slice(r).length:1,p=o.slice(d);return p[0]!=="/"&&(p="/"+p),la(p,"")}return la(s,e)+i+o}function Bh(e,t,s,i){let o=[],r=[],d=null,p=({state:m})=>{let b=Pu(e,location),E=s.value,S=t.value,N=0;if(m){if(s.value=b,t.value=m,d&&d===E){d=null;return}N=S?m.position-S.position:0}else i(b);o.forEach(w=>{w(s.value,E,{delta:N,type:Fi.pop,direction:N?N>0?_i.forward:_i.back:_i.unknown})})};function c(){d=s.value}function v(m){o.push(m);let b=()=>{let E=o.indexOf(m);E>-1&&o.splice(E,1)};return r.push(b),b}function g(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Ze({},m.state,{scroll:Vs()}),"")}}function y(){for(let m of r)m();r=[],window.removeEventListener("popstate",p),window.removeEventListener("pagehide",g),document.removeEventListener("visibilitychange",g)}return window.addEventListener("popstate",p),window.addEventListener("pagehide",g),document.addEventListener("visibilitychange",g),{pauseListeners:c,listen:v,destroy:y}}function bu(e,t,s,i=!1,o=!1){return{back:e,current:t,forward:s,replaced:i,position:window.history.length,scroll:o?Vs():null}}function zh(e){let{history:t,location:s}=window,i={value:Pu(e,s)},o={value:t.state};o.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(c,v,g){let y=e.indexOf("#"),m=y>-1?(s.host&&document.querySelector("base")?e:e.slice(y))+c:Uh()+e+c;try{t[g?"replaceState":"pushState"](v,"",m),o.value=v}catch(b){console.error(b),s[g?"replace":"assign"](m)}}function d(c,v){r(c,Ze({},t.state,bu(o.value.back,c,o.value.forward,!0),v,{position:o.value.position}),!0),i.value=c}function p(c,v){let g=Ze({},o.value,t.state,{forward:c,scroll:Vs()});r(g.current,g,!0),r(c,Ze({},bu(i.value,c,null),{position:g.position+1},v),!1),i.value=c}return{location:i,state:o,push:p,replace:d}}function Au(e){e=du(e);let t=zh(e),s=Bh(e,t.state,t.location,t.replace);function i(r,d=!0){d||s.pauseListeners(),history.go(r)}let o=Ze({locatLine truncated
|
||||
`).forEach((q,k)=>{for(let[L,W]of b){let z=L.exec(q);if(z&&!/^(if|for|while|switch|return|catch)$/.test(z[1])){I.push({name:z[1],kind:W,line:k+1});break}}}),E={content:e.content,list:I.slice(0,300)},E.list},e.goToSymbol=function(I){e.symbolsOpen=!1;let q=e.codeEditor;q&&(q.scrollToLine(I-1,!0,!0,()=>{}),q.gotoLine(I,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+I),window.dispatchEvent(new HashChangeEvent("hashchange")))},e.gotoLine=function(){e.codeEditor&&(e.moreOpen=!1,e.gotoError="",e.gotoValue=String(e.codeEditor.getCursorPosition().row+1),e.gotoOpen=!0,setTimeout(()=>{let I=window.document.getElementById("goto-input");I&&(I.focus(),I.select())},0))},e.closeGoto=function(){e.gotoOpen=!1,e.gotoError="",e.codeEditor?.focus()},e.submitGoto=function(){let I=e.codeEditor;if(!I)return;let q=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),k=I.session.getLength();if(!q||+q[1]<1||+q[1]>k){e.gotoError="Enter a line from 1 to "+k;return}I.gotoLine(+q[1],q[2]?Math.max(0,+q[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",I.focus()},e.rootEntries=function(){return[...e.files||[]].sort((I,q)=>{let k=I.size==null,L=q.size==null;return k!==L?k?-1:1:I.name.localeCompare(q.name)})},e.formatSize=function(I){if(I==null)return"";if(I<1024)return I+" B";let q=I/1024,k=L=>L.toFixed(1).replace(/\.0$/,"");return q<1024?k(q)+" KB":q<1024*1024?k(q/1024)+" MB":k(q/1024/1024)+" GB"},e.fileSize=function(I){if(!I)return null;let q=I.replace(/^\/+/,""),k=(e.files||[]).find(L=>(L.path?L.path+"/":"")+L.name===q);return k&&k.size!=null?k.size:null},e.revealFolder=function(I){e.sidebarHidden=!1,e.sidebarCollapsed=!1,je(()=>{let q=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(I):I)+'"]');q&&(q.closest("li")?.classList.contains("open")||q.click(),q.scrollIntoView({block:"nearest"}),q.focus())})};let S={content:null,n:0},N=I=>{if(S.content===I)return S.n;let q=I;if(typeof q=="string")try{q=JSON.parse(q)}catch{q=null}let k=[],L=z=>{Array.isArray(z)?k.push(z.join("")):typeof z=="string"&&k.push(z)};(q&&(q.cells||(q.worksheets||[]).flatMap(z=>z.cells||[]))||[]).forEach(z=>{L(z?.source??z?.input),(z?.outputs||[]).forEach(J=>{L(J?.text),J?.data&&(L(J.data["text/plain"]),L(J.data["text/markdown"]),L(J.data["text/html"])),L(J?.traceback)})});let W=k.reduce((z,J)=>z+(J.match(s)||[]).length,0);return S={content:I,n:W},W};e.redactionCount=function(){return e.type==="IPython"?N(e.content):typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(s)||[]).length},e.renderRedacted=Ls;let w=I=>I.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(I){let q=e.renderRedacted(I);if(!q||typeof window.DOMParser!="function")return q;let k=new window.DOMParser().parseFromString("<div>"+q+"</div>","text/html"),L={};return k.querySelectorAll("h1, h2, h3").forEach(W=>{let z=W.id||w(W.textContent);L[z]?z+="-"+ ++L[z]:L[z]=1,W.id=z}),k.body.firstChild.innerHTML};let D={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(D.content===e.content)return D.list;let q=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(k=>({id:k.id,text:k.textContent.trim(),level:k.tagName==="H3"?3:2})).slice(0,40);return D={content:e.content,list:q},q},e.activeHeading=null,o(window,"scroll",()=>{let I=e.readmeToc?e.readmeToc():[];if(!I.length)return;let q=150,k="",L="";for(let W of I){let z=window.document.getElementById(W.id);if(!z)continue;let J=z.getBoundingClientRect().top;J<q?k=W.id:!L&&J<window.innerHeight-80&&(L=W.id)}L&&(k=L),e.activeHeading!==k&&(e.activeHeading=k)},{capture:!0,passive:!0}),e.scrollToHeading=function(I){if(!I){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let q=window.document.getElementById(I);q&&q.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=I},e.csvView="table";let O={content:null,rows:[]},_=(I,q)=>{let k=[],L=[],W="",z=!1;for(let J=0;J<I.length;J++){let ne=I[J];z?ne==='"'?I[J+1]==='"'?(W+='"',J++):z=!1:W+=ne:ne==='"'&&W===""?z=!0:ne===q?(L.push(W),W=""):ne===`
|
||||
`||ne==="\r"?(ne==="\r"&&I[J+1]===`
|
||||
`&&J++,L.push(W),k.push(L),L=[],W=""):W+=ne}return(W!==""||L.length)&&(L.push(W),k.push(L)),k.filter(J=>J.length>1||J[0]!=="")};e.isCsv=()=>typeof e.content=="string"&&e.type!=="html"&&/\.(csv|tsv)$/i.test(e.filePath||"")&&e.content.length<=1024*1024,e.csvRows=()=>{if(O.content!==e.content){let I=/\.tsv$/i.test(e.filePath||"")?" ":",";O={content:e.content,rows:_(e.content,I)}}return O.rows},e.csvNumCol=I=>{let q=e.csvRows().slice(1).map(k=>k[I]).filter(k=>k!=null&&String(k).trim()!=="");return q.length>0&&q.every(k=>e.csvNumeric(k))},e.csvNumeric=I=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(I)&&/\d/.test(I),e.redactParts=function(I){let q=[],k=0,L,W=/\bXXXX-(\d+)\b/g;for(I=String(I||"");L=W.exec(I);)L.index>k&&q.push({t:I.slice(k,L.index)}),q.push({n:L[1]}),k=L.index+L[0].length;return k<I.length&&q.push({t:I.slice(k)}),q},e.pathCopied=!1,e.copyPath=async function(){window.navigator.clipboard?.writeText&&(await window.navigator.clipboard.writeText(e.filePath||""),e.pathCopied=!0,setTimeout(()=>{e.pathCopied=!1},1600))},e.contentCopied=!1,e.copyContent=async function(){if(typeof e.content!="string"||!window.navigator.clipboard?.writeText)return;let I=e.content;if(e.type==="html"&&e.url)if(e.preview)I=e.sourceContent;else try{I=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(I),e.contentCopied=!0,setTimeout(()=>{e.contentCopied=!1},1600)};function j(I){return r[I]?r[I]:I}function oe(I){return I=="pdf"?"pdf":I=="html"||I=="htm"?"html-doc":["md","markdown","mdown","mkdn","mdx"].includes(I)?"md":I=="org"?"org":I=="ipynb"?"IPython":d.indexOf(I)>-1?"text":p.indexOf(I)>-1?"image":v.indexOf(I)>-1?"media":c.indexOf(I)>-1?"audio":"code"}e.downloadUrl=()=>e.preview?e.url:e.url+"&download=true",e.prepareFile=function(I){e.showSource=!1,e.allowScripts=!1,e.imageSize="",e.filePath=I,e.paths=I.split("/").filter(Boolean);let q=e.filePath.toLowerCase(),k=q.lastIndexOf(".");k>-1&&(q=q.substring(k+1));let L={javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",python:"Python",java:"Java",c_cpp:"C/C++",csharp:"C#",golang:"Go",rust:"Rust",ruby:"Ruby",php:"PHP",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",yaml:"YAML",markdown:"Markdown",sh:"Shell",dockerfile:"Dockerfile",xml:"XML",sql:"SQL",kotlin:"Kotlin",swift:"Swift",scala:"Scala",r:"R",julia:"Julia",latex:"LaTeX",toml:"TOML",csv:"CSV",tsv:"TSV",text:""},W=j(q);e.languageName=L[W]??(W?W.charAt(0).toUpperCase()+W.slice(1):""),e.aceOption={readOnly:!0,useWrapMode:!0,showGutter:!0,theme:"chrome",useSoftTab:!0,tabSize:2,fontSize:window.matchMedia?.("(max-width: 767px)").matches?12:13,keyBinding:"vscode",fullLineSelection:!0,highlightActiveLine:!1,highlightGutterLine:!1,cursor:"hide",showInvisibles:!1,showIndentGuides:!1,showPrintMargin:!1,highlightSelectedWord:!1,enableBehaviours:!0,fadeFoldWidgets:!1,mode:j(q),onLoad:function(z){e.codeEditor=un(z);{let Re=z.session,Be=Re.getTokens.bind(Re),X=/\bXXXX-\d+\b/g;if(Re.getTokens=function(me){let de=Be(me);if(!de.some(ye=>ye.value.indexOf("XXXX-")!==-1))return de;let pe=[];for(let ye of de){if(ye.value.indexOf("XXXX-")===-1){pe.push(ye);continue}let Ve=0;X.lastIndex=0;let P;for(;P=X.exec(ye.value);)P.index>Ve&&pe.push({type:ye.type,value:ye.value.slice(Ve,P.index)}),pe.push({type:"redacted.n"+P[0].slice(5),value:P[0]}),Ve=P.index+P[0].length;Ve<ye.value.length&&pe.push({type:ye.type,value:ye.value.slice(Ve)})}return pe},!window.document.getElementById("redact-index-rules")){let me=window.document.createElement("style");me.id="redact-index-rules",me.textContent=Array.from({length:99},(de,pe)=>`.ace_redacted.ace_n${pe+1}::after{content:"${pe+1}"}`).join(""),window.document.head.appendChild(me)}z.renderer.updateFull(!0)}z.session.setUseWrapMode(e.wrapLines!==!1);let J=z.container.closest?.(".file-card"),ne=()=>{if(!J)return;let Re=z.renderer,Be=(Re.layerConfig?.width||0)-(Re.$size?.scrollerWidth||0);J.classList.toggle("at-right-edge",Be<=2||Re.getScrollLeft()>=Be-2)};z.session.on("changeScrollLeft",ne),z.renderer.on("afterRender",ne),window.matchMedia?.("(max-width: 767px)").matches&&z.setOption("hScrollBarAlwaysVisible",!0);let G=ace.require("ace/range").Range,ue=null;function he(Re,Be){ue!==null&&(z.session.removeMarker(ue),ue=null),Re!=null&&(ue=z.session.addMarker(new G(Re,0,Be,1),"highlighted-line","fullLine"))}function Me(Re){let Be=!e.preview&&window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(!Be){he(null);return}let X=parseInt(Be[1])-1,me=Be[2]?parseInt(Be[2])-1:X;he(X,me),Re&&i.timeout(()=>{z.scrollToLine(X,!0,!0,function(){})},100)}Me(!0);let Ue=null;z.on("guttermousedown",function(Re){let Be=Re.getDocumentPosition().row,X=Re.domEvent&&Re.domEvent.shiftKey,me=Be,de=Be;X&&Ue!==null?(me=Math.min(Ue,Be),de=Math.max(Ue,Be)):Ue=Be;let pe=me===de?`#L${me+1}`:`#L${me+1}-L${de+1}`,ye=window.location.pathname+window.location.search+pe;e.preview||window.history.replaceState(null,"",ye),he(me,de),Re.stop()});let We=o(window,"hashcha
Line truncated
|
||||
`);for(let y=0;y<g.length;y++){let m=g[y];if(m.startsWith("diff --git")){v(),c();continue}if(m.startsWith("--- ")){r&&r.lines.length&&v(),c().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){c().newPath=m.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(m.startsWith("index ")||m.startsWith("similarity index")||m.startsWith("rename ")||m.startsWith("new file mode")||m.startsWith("deleted file mode")||m.startsWith("Binary files"))){if(m.startsWith("@@")){let b=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);b&&(d=parseInt(b[1],10),p=parseInt(b[2],10)),c().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}r&&(m.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:p,text:m.slice(1)}),p++):m.startsWith("-")?(r.lines.push({kind:"remove",oldNo:d,newNo:"",text:m.slice(1)}),d++):(r.lines.push({kind:"ctx",oldNo:d,newNo:p,text:m.startsWith(" ")?m.slice(1):m}),d++,p++))}}return s(o,r),o.join("")}})({trustAsHtml:e=>e});function mg(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function hg(e,t="EUR"){let s=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:s%1?2:0,maximumFractionDigits:2}).format(s)}function gg(e){return String(e??"").toUpperCase()}function vg(e,t,s=0){return(e||[]).slice(s,s+t)}function yg(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function bg(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((i,o)=>{for(let r of s){let d=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let p=r.split(".").reduce((v,g)=>v?.[g],i),c=r.split(".").reduce((v,g)=>v?.[g],o);if(typeof p=="string"&&(p=p.toLowerCase()),typeof c=="string"&&(c=c.toLowerCase()),p!==c)return(p==null?-1:c==null?1:p<c?-1:1)*d}return 0})}function wg(e,t){if(!e)return"";let s=new Date(e);if(isNaN(s))return String(e);if(!t||t==="mediumDate")return s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let i={yyyy:s.getFullYear(),MMM:s.toLocaleDateString(void 0,{month:"short"}),MM:String(s.getMonth()+1).padStart(2,"0"),dd:String(s.getDate()).padStart(2,"0"),d:s.getDate(),HH:String(s.getHours()).padStart(2,"0"),mm:String(s.getMinutes()).padStart(2,"0"),ss:String(s.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,o=>i[o])}function kg(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function ya(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),s=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(s))return"";let i=s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),o=new Date;o.setHours(0,0,0,0);let r=Math.round((s-o)/864e5),d;if(r===0)d="today";else if(r===1)d="tomorrow";else if(r===-1)d="yesterday";else{let p=Math.abs(r),c=Math.round(p/30.44),v=p<14?[p,"day"]:p<60?[Math.round(p/7),"week"]:c<18?[c,"month"]:[Math.round(p/365.25),"year"],g=v[0]+" "+v[1]+(v[0]===1?"":"s");d=r>0?"in "+g:g+" ago"}return i+" \xB7 "+d}function qn(e){if(e==null||e===""||isNaN(e))return"";e=Number(e);let t="\u202F";if(e<1e3)return+(e<10?e.toFixed(2):e<100?e.toFixed(1):Math.round(e))+t+"ms";let s=e/1e3;if(s<60)return+(s<10?s.toFixed(2):s.toFixed(1))+t+"s";let i=r=>String(r).padStart(2,"0"),o=Math.round(s);return o<3600?Math.floor(o/60)+"m "+i(o%60)+"s":Math.floor(o/3600)+"h "+i(Math.floor(o%3600/60))+"m"}function ba(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let s={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(s.year="numeric"),t.toLocaleDateString(void 0,s)}var Ji=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function Xi(e,{flags:t,keys:s,count:i,onChange:o=()=>{}}){if(e.segView=()=>{let r=t()||{};if(s.every(p=>!!r[p]))return"all";let d=s.filter(p=>!!r[p]);return d.length===1?d[0]:"custom"},e.setSegView=r=>{let d=t();if(d){for(let p of s)d[p]=r==="all"?!0:p===r;o()}},e.segCount=r=>r==="all"?s.reduce((d,p)=>d+i(p),0):i(r),t()&&e.segView()==="custom")for(let r of s)t()[r]=!0}var _u=function(e,t,s){let i=kt(),o=Bt();Wu(i,o),e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.repositories=[],e.total=-1,e.totalPage=0,e.statusCounts=[],e.totalSize=0,e.selected={},e.allSelected=!1;let r=S=>{if(S.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){S.preventDefault();let N=document.querySelector('.admin-filter-toolbar input[type="search"]');N&&N.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=S=>{S==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[S]="",e.query.page=1},e.chips=[];let d=()=>{let S=[];e.query.owner&&S.push({key:"owner",label:"Owner",value:e.query.owner}),e.query.conference&&S.push({key:"conference",label:"Conference",value:e.query.conference}),e.chips=S};e.showSta
Line truncated
|
||||
`+S.join(`
|
||||
`)],{type:"text/csv"}),v=document.createElement("a");v.href=URL.createObjectURL(R),v.download=i.username+"-repositories.csv",v.click()},e.showStatusMessage=m=>{let w=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,w)},e.fetchGithubInfo=m=>{let w=window.open("","_blank");w&&w.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(N=>{w&&(w.document.open(),w.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(N.data,null,2).replace(/[<>]/g,S=>S==="<"?"<":">")+"</pre>"),w.document.close())},N=>{let S=N&&N.data?JSON.stringify(N.data,null,2):String(N);w&&(w.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+S+"</pre>")})};function u(m){t.get("/api/admin/users/"+m+"/repos",{}).then(w=>{e.repositories=w.data},w=>{console.error(w)})}function y(m){t.get("/api/admin/users/"+m,{}).then(w=>{e.userInfo=w.data},w=>{console.error(w)})}y(i.username),u(i.username),e.banUser=()=>{confirm(`Ban user ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/ban`).then(()=>y(i.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${i.username}/activate`).then(()=>y(i.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${i.username} to admin?`)&&t.post(`/api/admin/users/${i.username}/promote`).then(()=>y(i.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/demote`).then(()=>y(i.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function h(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}h(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(m=>{e.tokenForm.plaintext=m.data.token,e.tokenForm.name="",h()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>h(),w=>console.error(w))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>u(i.username),w=>console.error(w))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>u(i.username),w=>console.error(w))},e.updateRepository=m=>{let w=ot({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(w),t.post(`/api/repo/${m.repoId}/refresh`).then(N=>{N.data.status=="ready"?w.title=`${m.repoId} is refreshed.`:w.title=`Refreshing of ${m.repoId}.`},N=>{w.title=`Error during the refresh of ${m.repoId}.`,w.body=N.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(w=>{e.userInfo.repositories=w.data})};let b=null;e.watch("query",()=>{o.timeout.cancel(b),b=o.timeout(()=>{u(i.username)},500)},!0)},zu=function(e,t,s){let i=Ct(),o=Bt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let r=N=>{if(N.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){N.preventDefault();let S=document.querySelector('.admin-filter-toolbar input[type="search"]');S&&S.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=N=>{N==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[N]="",e.query.page=1},e.chips=[];let d=()=>{let N=[];(e.query.dateFrom||e.query.dateTo)&&N.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=N};e.statusCountFor=N=>{let S=(e.statusCounts||[]).find(R=>R._id===N);return S?S.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=N=>{e.query.sort===N?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=N,e.query.direction="desc"),e.query.page=1},e.sortIcon=N=>e.query.sort===N?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let p="admin.conferences.filterPrefs",u={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},y=loadFilterPrefs(p)||{};e.query=Object.assign({},u,y,{page:1,search:""});let h=s.search();h.search&&(e.query.search=h.search);let b="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(b)||"[]"),e.savePreset=()=>{let N=window.prompt("Preset name:");if(!N)return;let S=Object.assign({},e.query);delete S.page,e.presets=(e.presets||[]).filter(R=>R.name!==N),e.presets.push({name:N,query:S}),localStorage.setItem(b,JSON.stringify(e.presets))},e.applyPreset=N=>{Object.assign(e.query,N.query,{page:1})},e.deletePreset=N=>{e.presets=(e.presets||[]).filter(S=>S.name!==N.name),localStorage.setItem(b,JS
Line truncated
|
||||
`).map((se,Y)=>Y===0?se:ie+se).join(`
|
||||
`)}else typeof O=="number"||typeof O=="boolean"?K=String(O):K=JSON.stringify(O);x.push(`${_}${K}${H}`)}),x.push("}"),x.join(`
|
||||
`)}function y(v){let E=[],D="",V=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,L=0,z;for(;z=V.exec(v);)D+=v.slice(L,z.index),L=V.lastIndex,E.push({key:z[1],op:z[2]||"=",val:z[3]});return D+=v.slice(L),{filters:E,free:D.trim().toLowerCase()}}function h(v,E){for(let D of E.filters){let V=(z,x,X)=>{let O=parseFloat(z),U=parseFloat(x);return X==="="?String(z)===String(x):X==="!="?String(z)!==String(x):X===">="?O>=U:X==="<="?O<=U:X===">"?O>U:X==="<"?O<U:!0},L;if(D.key==="code")L=v.displayMessage;else if(D.key==="module")L=v.module;else if(D.key==="status")L=v._status;else if(D.key==="url")L=v._url;else if(D.key==="repo")L=v._repoId;else if(D.key==="level")L=v.level;else continue;if(L==null||!V(L,D.val,D.op))return!1}return!(E.free&&((v.displayMessage||"")+" "+(v.module||"")+" "+(v._url||"")+" "+JSON.stringify(v.raw||[])).toLowerCase().indexOf(E.free)===-1)}function b(){let v=y(e.query.search||"");e.parsedFilterCount=v.filters.length;let E=e.query.bucket,D=e.entries.filter(X=>E&&X._bucket!==E?!1:h(X,v)),V=e.query.group;if(V){let X=C=>JSON.stringify(V==="module"?[C.module,C._bucket]:[C.raw?.[0]?.service||"unknown",C.module,C.displayMessage||C.message||"_",C._bucket,C._status]),O=new Map;for(let C of D){let _=X(C);if(O.has(_)){let H=O.get(_);H.count++,H._related.push(C),new Date(C.ts)>new Date(H.ts)&&(H.ts=C.ts,H._url=C._url,H._status=C._status),new Date(C.ts)<new Date(H._firstSeen)&&(H._firstSeen=C.ts)}else{let H=Object.assign({},C);H._key=`${V}:${_}`,H._related=[C],H._firstSeen=C.ts,H._lastHourCount=0,H.count=1,O.set(_,H)}}let U=Date.now()-3600*1e3;for(let C of O.values())C._lastHourCount=C._related.filter(_=>new Date(_.ts).getTime()>=U).length;D=Array.from(O.values())}else D=D.map((X,O)=>(X._key="row:"+O+":"+X.ts,X._related=[X],X._firstSeen=X.ts,X._lastHourCount=0,X.count=1,X));let L=X=>({error:0,warn:1,info:2})[X._bucket]??1;e.query.sort==="count"?D.sort((X,O)=>L(X)-L(O)||O.count-X.count||new Date(O.ts)-new Date(X.ts)):D.sort((X,O)=>L(X)-L(O)||new Date(O.ts)-new Date(X.ts)),e.visible=D;let z=!!(e.query.bucket||(e.query.search||"").trim()),x=!z&&(e.stats?.severity?.error||0)>0&&!D.some(X=>X._bucket==="error")&&e.entries.length<1500;(z&&!D.length||x)&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,m(!0))}function m(v){let E=v?e.redisNextOffset||e.entries.length:0,D=v?e.pageSize:Math.max(e.pageSize,e.redisNextOffset||e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:E,limit:D}}).then(V=>{let L=(V.data.entries||[]).map(p);e.entries=v?e.entries.concat(L):L,e.redisRedacted=(v&&e.redisRedacted||0)+(V.data.redactedEntries||0),e.redisNextOffset=V.data.nextOffset??E+(V.data.entries||[]).length,e.available=!!V.data.available,e.redisCollecting=V.data.redisCollecting!==!1,e.cap=V.data.max||e.cap,e.total=V.data.total||e.entries.length,e._autoLoading=!1,b()},()=>{e._autoLoading=!1,e.available=!1})}e.loadMore=()=>m(!0),e.canLoadMore=()=>(e.redisNextOffset||e.entries.length)<e.total;function w(){t.get("/api/admin/errors/stats").then(v=>{let E=v.data||{};e.redisStatsState=E.available===!1?"unavailable":"ready";let D=E.prev24h?Math.round((E.last24h-E.prev24h)/E.prev24h*100):0;e.stats={last24h:E.last24h||0,prev24h:E.prev24h||0,delta:D,severity:E.severity||{error:0,warn:0,info:0},unique:E.unique||{error:0,warn:0,info:0},buckets:E.buckets||[],dropped:E.dropped||0},b()},()=>{e.redisStatsState="unavailable"})}function N(){m(),w()}e.barPx=(v,E)=>{let D=e.stats.buckets||[],V=0,L=0;for(let O of D)V=Math.max(V,(O.error||0)+(O.warn||0)),L=Math.max(L,O.info||0);let z=v[E]||0;if(!z)return 0;if(E==="info")return L?Math.max(2,Math.round(z/L*(V?16:60))):0;let x=(v.error||0)+(v.warn||0),X=Math.round(x/V*44);return Math.max(4,Math.round(z/x*X))},e.bucketTitle=v=>`${new Date(v.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${v.error||0} err \xB7 ${v.warn||0} warn \xB7 ${v.info||0} info`,e.toggle=v=>{e.expanded[v._key]=!e.expanded[v._key]},e.setBucket=v=>{e.query.bucket=v},e.refreshNow=N,e.clearAll=()=>{confirm("Clear Redis error history? Central logs are unaffected.")&&t.delete("/api/admin/errors").then(N,v=>console.error(v))},e.exportCsv=()=>{let v=["ts","level","module","displayMessage","_status","_url","_repoId"],E=[v.join(",")];for(let z of e.visible)E.push(v.map(x=>{let X=z[x]==null?"":String(z[x]);return/[",\n]/.test(X)?`"${X.replace(/"/g,'""')}"`:X}).join(","));let D=new Blob([E.join(`
|
||||
`)],{type:"text/csv;charset=utf-8"}),V=URL.createObjectURL(D),L=document.createElement("a");L.href=V,L.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(V)};function S(v){e.copyHint=`${v} copied`,o.timeout(()=>{e.copyHint=""},1500)}e.copyJson=v=>{navigator.clipboard.writeText(v._detailJson).then(()=>S("JSON"))},e.copyCurl=v=>{if(!v._url)return;let D=`curl -X ${v._method||"GET"} '${window.location.origin}${v._url}'`;navigator.clipboard.writeText(D).then(()=>S("curl"))},N();let R=i(()=>{e.query.autoRefresh&&N()},15e3);e.on("dispose",()=>i.cancel(R)),e.watch("query.search",b),e.watch("query.bucket",b),e.watch("query.sort",b),e.watch("query.group",b)},Gu=function(e,t,s,i){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null){s.url("/");return}e.data=null,e.loading=!0,e.error=null,e.performance=null,e.performanceMinutes=15,e.performanceTab="routes",e.cacheReport=null,e.cacheError=null,e.cacheMinutes=60,e.cacheTraffic="all",e.ovView=["performance","cache"].includes((window.location.hash||"").slice(1))?window.location.hash.slice(1):"summary",e.setOvView=function(v){e.ovView=v;try{window.history.replaceState(null,"",v==="summary"?window.location.pathname:"#"+v)}catch{}};var o=!1;e.loadCache=function(){if(!o){o=!0;var v=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:v}}).then(function(E){v===e.cacheMinutes&&(e.cacheReport=E.data,e.cacheError=E.data.available?null:E.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){o=!1,v!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(v){return e.cacheTraffic==="all"||v.traffic===e.cacheTraffic})},e.cacheRate=function(v,E){var D=e.cacheRows(),V=function(x){return D.filter(function(X){return X.name===x}).reduce(function(X,O){return X+O[E]},0)},L=V(v+"_hit"),z=V(v+"_miss");return L+z?(100*L/(L+z)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(v){return v.replaceAll("_"," ")},e.cacheP95=function(v){var E=0,D=e.cacheReport?.latencyBucketsMs||[];if(!v.count)return"No samples";if(!v.ms)return"Not timed";for(var V=0;V<=D.length;V++)if(E+=v["b"+V]||0,E>=Math.ceil(v.count*.95))return V<D.length?"\u2264 "+qn(D[V]):"> 10\u202Fs";return"No samples"},e.healthAlert=function(){let v=e.data&&e.data.system||{},E=[["Memory",v.memPercent],["Disk",v.diskPercent]].filter(([,V])=>V>90);return E.length?E.map(([V,L])=>V+" is at "+L+"%").join(" and ")+". New anonymizations may fail until "+(E.length>1?"they drop.":"it drops."):""},e.performanceError=null,e.formatMs=function(v){return v==null?"":qn(v)},e.latencyBound=function(v,E){return v.count?v[E]==null?"> 60\u202Fs":"\u2264 "+e.formatMs(v[E]):"No samples"},e.firstByteBound=function(v){return e.latencyBound({count:v.firstByteCount,p95UpperMs:v.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(v){return Math.max(0,Math.round((Date.now()-v.sampledAt)/1e3))},e.peakRss=function(v){return(e.performance.runtimeSeries||[]).filter(function(E){return E.instance===v.instance}).reduce(function(E,D){return Math.max(E,D.rss)},v.memory.rss)},e.performanceWarning=function(v){return e.sampleAge(v)>45||v.droppedBatches||v.droppedMetrics||v.sockets?.closeWait>0||v.eventLoop?.p95Ms>100||v.memoryLimitBytes&&v.memory.rss>v.memoryLimitBytes*.8};var r=!1;e.loadPerformance=function(){var v=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==v&&(e.performance=null),!r&&(r=!0,t.get("/api/admin/performance",{params:{minutes:v}}).then(function(E){v===e.performanceMinutes&&(e.performance=E.data,e.performanceError=E.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){v===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){r=!1,v!==e.performanceMinutes&&e.loadPerformance()}))};function d(v){if(v==null)return"\u2014";for(var E=["B","KB","MB","GB","TB"],D=0,V=v;V>=1024&&D<E.length-1;)V/=1024,D++;return V.toFixed(D>0?1:0).replace(/\.0$/,"")+" "+E[D]}e.humanBytes=d;function p(v){if(!v)return"\u2014";var E=Math.floor(v/86400),D=Math.floor(v%86400/3600),V=Math.floor(v%3600/60);return E>0?E+"d "+(D<10?"0":"")+D+"h":D>0?D+"h "+(V<10?"0":"")+V+"m":V+"m"}e.humanDuration=p;function u(v){return v==null?"\u2014":v>=1e6?(v/1e6).toFixed(1)+"M":v>=1e3?(v/1e3).toFixed(1)+"K":String(v)}e.humanNum=u,e.queueTotal=function(v){return v?(v.waiting||0)+(v.active||0)+(v.delayed||0)+(v.failed||0):0},e.statusCount=function(v){if(!e.data||!e.data.repos)return 0;for(var E=e.data.repos.statusBreakdown||[],D=0;D<E.length;D++)if(E[D]._id===v)return E[D].count;return 0},e.barPct=function(v){var E=e.data&&e.data.repos?e.data.repos.total:0;if(!E)return 0;var D=[v];v==="expired"&&D.push("expiring"),v==="removed"&&D.push("removi
Line truncated
|
||||
`)},Da=class{constructor(t){et(this,"gen");et(this,"threads",[]);et(this,"match",!1);et(this,"runs",[]);et(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},dc=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((s,i)=>s!==t.ids[i])?!1:e.runs.every(s=>t.runs.some(i=>i.neg===s.neg&&dc(i.state,s.state))),nc=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),cs,Bn,Ta,Aa,Uo=class{constructor(t,s,i){qe(this,Bn);et(this,"dots");et(this,"dotStart");qe(this,cs);this.dots=t,this.dotStart=s,_e(this,cs,i)}state(){return new Da(++re(this,cs).gen)}done(t){return t.ids=t.threads.map(s=>s.id).sort((s,i)=>s-i),t.match&&t.ids.unshift(Pa.id),t}restricted(t,s){return s&&(this.dots||this.dotStart&&t===0)}add(t,s,i,o){switch(s.t){case"split":if(!Le(this,Bn,Ta).call(this,t,s))return;for(let d of s.out)this.add(t,d,i,o);return;case"neg":if(!Le(this,Bn,Ta).call(this,t,s))return;let r=this.state();return this.add(r,s.sub,i,!1),this.done(r),this.addRun(t,{t:"run",neg:s,state:r},i,o);case"star":if(this.restricted(i,o))return;Le(this,Bn,Aa).call(this,t,s)&&this.add(t,s.next,i,o);return;case"match":t.match=!0;return;default:Le(this,Bn,Aa).call(this,t,s)}}addRun(t,s,i,o){for(let r of t.runs)if(r.neg===s.neg&&dc(r.state,s.state))return;t.runs.push(s),s.state.match||this.add(t,s.neg.next,i,o)}step(t,s,i,o){let r=this.state();for(let d of t.threads)switch(d.t){case"lit":Ma(d,s)&&this.add(r,d.next,i+1,o);break;case"any":this.restricted(i,o)||this.add(r,d.next,i+1,o);break;case"class":!this.restricted(i,o)&&d.re.test(s)&&this.add(r,d.next,i+1,o);break;case"star":this.restricted(i,o)||this.add(r,d,i+1,o)}if(!this.restricted(i,o))for(let d of t.runs){if(d.state.dead){this.addRun(r,d,i+1,o);continue}let p=this.step(d.state,s,i,!1);this.addRun(r,{t:"run",neg:d.neg,state:p},i+1,o)}return this.done(r)}};cs=new WeakMap,Bn=new WeakSet,Ta=function(t,s){let{seen:i}=re(this,cs);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,!0)},Aa=function(t,s){let{has:i}=re(this,cs);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,t.threads.push(s),!0)};var uc=e=>{let t=e.ids.join();if(!e.runs.length)return t;let s=e.runs.map(i=>`${i.neg.id}(${uc(i.state)})`);return`${t}|${s.sort().join("|")}`},nv=1<<18,Bs,zs,Ln,ps,$n,_n,Fn,sn,Oa,xi,cc,Ia=class{constructor(t,s){qe(this,sn);qe(this,Bs);qe(this,zs,new Map);qe(this,Ln,0);qe(this,ps);qe(this,$n);qe(this,_n);qe(this,Fn);_e(this,Bs,t),_e(this,_n,new Uo(!1,!1,s)),_e(this,Fn,new Uo(!1,!0,s))}start(t){if(t){if(re(this,$n))return re(this,$n);let i=re(this,Fn).state();return re(this,Fn).add(i,re(this,Bs),0,!0),_e(this,$n,Le(this,sn,Oa).call(this,re(this,Fn).done(i)))}if(re(this,ps))return re(this,ps);let s=re(this,_n).state();return re(this,_n).add(s,re(this,Bs),0,!0),_e(this,ps,Le(this,sn,xi).call(this,re(this,_n).done(s)))}next(t,s){let i=s.charCodeAt(0),o=i<128?void 0:t.next.get(s);if(o)return o;let r=t===re(this,$n)?Le(this,sn,xi).call(this,re(this,Fn).step(t.state,s,0,!0)):Le(this,sn,xi).call(this,re(this,_n).step(t.state,s,1,!0));return i<128?(t.ascii||(t.ascii=new Array(128),_e(this,Ln,re(this,Ln)+128)),t.ascii[i]=r):t.next.set(s,r),nl(this,Ln)._++,r}};Bs=new WeakMap,zs=new WeakMap,Ln=new WeakMap,ps=new WeakMap,$n=new WeakMap,_n=new WeakMap,Fn=new WeakMap,sn=new WeakSet,Oa=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},xi=function(t){let s=uc(t),i=re(this,zs).get(s);if(i)return i;re(this,Ln)>nv&&Le(this,sn,cc).call(this);let o=Le(this,sn,Oa).call(this,t);return re(this,zs).set(s,o),_e(this,Ln,re(this,Ln)+(s.length+1)),o},cc=function(){re(this,zs).clear(),_e(this,Ln,0),_e(this,ps,void 0),_e(this,$n,void 0)};var sv=e=>{let t=[];for(let s=e;s.t!=="match";s=s.next){if(s.t==="split"||s.t==="neg")return;t.push(s)}return t},ov=(e,t,s,i)=>{let o=0,r=s,d=-1,p=0;for(;r<i;){let u=e[o];if(u?.t==="star"){d=o++,p=r;continue}let y=t[r];if(u&&(u.t==="any"||u.t==="lit"&&Ma(u,y)||u.t==="class"&&u.re.test(y))){o++,r++;continue}if(d===-1)return!1;o=d+1,r=++p}for(;e[o]?.t==="star";)o++;return o===e.length},pc=e=>{let t=0,s=0;for(let i of e){let[o,r]=iv(i);t+=o,s+=r}return[t,s]},iv=e=>{if(e.t==="star")return[0,1/0];if(e.t!=="ext")return[1,1];if(e.type==="!")return[0,1/0];let t=e.alts.map(pc),s=Math.min(...t.map(r=>r[0])),i=Math.max(...t.map(r=>r[1])),o=i===0?0:1/0;return e.type==="@"?[s,i]:e.type==="?"?[0,i]:e.type==="*"?[0,o]:[s,o]},sc=(e,t,s)=>{for(let i=0;i<e.length;i++)if(!Ma(e[i],t[s+i]))return!1;return!0},rv=/[/\ud800-\udfff]/,av=/[\ud800-\udfff]/,Zi=e=>av.test(e)?[...e]:e,oc=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},Un,Hs,fs,er,ms,zo,tr,hs,Ho,jo,Go,Pn,vn,js,Gs,Wo,nr,nn,gs,Fo,Bo=class{constructor(t,s={}){qe(this,gs);et(this,"pattern");et(this,"options");qe(this,Un);qe(this,Hs);qe(this,fs);qe(this,er);qe(this,ms);qe(this,zo,!1);qe(this,tr);qe(this,hs);qe(this,Ho,!1);qe(this,jo,0);qe(this,Go,1/0);qe(this,Pn,[]);qe(this,vn,[]);qe(this,js);qe(this,Gs);qe(this,Wo,!1);qe(this,nr);qe(this,nn);if(t.includes
Line truncated
|
||||
`).forEach((s,i)=>{let{term:o}=Ga(s.trim());if(!o)return;let r=[];for(let d=0;d<o.length;d++){if(o[d]==="\\"){d++;continue}Tc.has(o[d])&&!r.includes(o[d])&&r.push(o[d])}r.length&&t.push({line:i,term:o,symbols:r})}),t}function Ic(e,t){let s=String(e||"").split(`
|
||||
`),i=s[t];if(i===void 0)return e;let{term:o}=Ga(i.trim());if(!o)return e;let r="";for(let p=0;p<o.length;p++){if(o[p]==="\\"){r+=o.slice(p,p+2),p++;continue}r+=Tc.has(o[p])||o[p]==="."?"\\"+o[p]:o[p]}let d=i.indexOf(o);return s[t]=i.slice(0,d)+r+i.slice(d+o.length),s.join(`
|
||||
`)}var Kn={VIEWER_ERRORS:{title:"Content could not be loaded",access_title:"GitHub access needs attention",reader_help:"Reading this repository? You do not need to sign in. Try again after the owner restores access, or let them know this anonymous link is unavailable.",owner_help:"Own this repository? If your GitHub account was suspended or recently recovered, sign in to Anonymous GitHub again and check the GitHub connection and repository permissions in your dashboard. Then retry this page. Keep the existing anonymous URL; do not delete the repository to restore access.",retry:"Try again",dashboard:"Open owner dashboard"},ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",invalid_sort:"The selected sort order is invalid.",invalid_cursor:"This project page is no longer valid. Reload the list.",repository_changed:"The repository changed while processing. Please retry.",repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"We could not load this content. Try again. If it still fails, contact support with the anonymous URL and the time of the error.",unreachable:"The service could not complete this request. Wait a moment and try again.",request_error:"The connection was interrupted. Check your internet connection and try again.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"Anonymous GitHub cannot access the source repository on GitHub. It may be private, unavailable, or require the owner to reconnect GitHub.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub temporarily blocked the request because we hit its API rate limit. Wait a few minutes and try again. If the problem persists and you contact GitHub Support, include the request ID and timestamp shown in GitHub's response (the 'X-GitHub-Request-Id' header).",rate_limited:"GitHub API rate limit reached. The repository will be available shortly \u2014 please wait a moment and refresh.",repoId_already_used:"The repository ID is already used.",invalid_repoId:"The format of the repository ID is invalid.",unsupported_source:"The repository source type is not supported.",branch_not_specified:"The branch is not specified.",branch_not_found:"The branch of the repository cannot be found.",commit_not_specified:"A commit must be specified.",commit_not_found:"The configured commit no longer exists in the source repository. It may have been force-pushed, rebased, or removed.",repo_renamed:"The source repository appears to have been renamed or moved on GitHub. Please refresh and try again \u2014 the cached name has been updated.",invalid_commit_format:"The commit hash format is invalid. It must be a hexadecimal string.",pull_request_not_found:"The requested pull request could not be found.",pull_request_expired:"This pull request has expired and is no longer available.",pull_request_not_ready:"This pull request is still being prepared. Please t
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,b.options),p.restore()})}u();let y=null;e.saveDefault=h=>{if(h&&h.preventDefault&&h.preventDefault(),e.saving)return;let b=p.checkpoint(),m={terms:e.terms.split(`
|
||||
`).map(w=>w.trim()).filter(w=>w.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",m).then(()=>{p.accept(b),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",y&&i.cancel(y),y=i(()=>{e.message=null},2500)},w=>{e.saving=!1;let N=w&&w.data&&w.data.error,S="Unable to save your defaults. Please try again.";Promise.all([s("ERRORS."+N),s("ERRORS.unknown_error")]).then(([R,v])=>{e.error=N&&R!==v?R:S},()=>{e.error=S})})},e.deleteAccount=()=>{e.deletingAccount||!e.confirmDeleteAccount||e.deleteUsername!==e.user?.username||(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},_c=function(e,t,s){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(i=>{s.url("/dashboard")},i=>{e.error=i.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Fc=function(e,t,s,i,o){e.user&&!e.user.status&&s.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&s.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(p){e.feature=p},e.featureHref=function(p){return p.needsUser&&!e.user?"/signin":p.href},e.featureTarget=function(p){return p.needsUser&&!e.user?"_self":p.target||void 0},e.featureKeydown=function(p,u){let y={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[p.key];if(y===void 0)return;p.preventDefault();let h=e.features.length,b=y==="first"?0:y==="last"?h-1:(u+y+h)%h;e.feature=e.features[b].key,o(()=>{let m=i.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.demoText=`# DeepLearnUtils
|
||||
`)],{type:"text/csv"}),w=document.createElement("a");w.href=URL.createObjectURL(N),w.download=i.username+"-repositories.csv",w.click()},e.showStatusMessage=m=>{let b=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,b)},e.fetchGithubInfo=m=>{let b=window.open("","_blank");b&&b.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(E=>{b&&(b.document.open(),b.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(E.data,null,2).replace(/[<>]/g,S=>S==="<"?"<":">")+"</pre>"),b.document.close())},E=>{let S=E&&E.data?JSON.stringify(E.data,null,2):String(E);b&&(b.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+S+"</pre>")})};function c(m){t.get("/api/admin/users/"+m+"/repos",{}).then(b=>{e.repositories=b.data},b=>{console.error(b)})}function v(m){t.get("/api/admin/users/"+m,{}).then(b=>{e.userInfo=b.data},b=>{console.error(b)})}v(i.username),c(i.username),e.banUser=()=>{confirm(`Ban user ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/ban`).then(()=>v(i.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${i.username}/activate`).then(()=>v(i.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${i.username} to admin?`)&&t.post(`/api/admin/users/${i.username}/promote`).then(()=>v(i.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/demote`).then(()=>v(i.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function g(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}g(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(m=>{e.tokenForm.plaintext=m.data.token,e.tokenForm.name="",g()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>g(),b=>console.error(b))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>c(i.username),b=>console.error(b))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>c(i.username),b=>console.error(b))},e.updateRepository=m=>{let b=st({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(b),t.post(`/api/repo/${m.repoId}/refresh`).then(E=>{E.data.status=="ready"?b.title=`${m.repoId} is refreshed.`:b.title=`Refreshing of ${m.repoId}.`},E=>{b.title=`Error during the refresh of ${m.repoId}.`,b.body=E.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(b=>{e.userInfo.repositories=b.data})};let y=null;e.watch("query",()=>{o.timeout.cancel(y),y=o.timeout(()=>{c(i.username)},500)},!0)},zu=function(e,t,s){let i=kt(),o=Bt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let r=E=>{if(E.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){E.preventDefault();let S=document.querySelector('.admin-filter-toolbar input[type="search"]');S&&S.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=E=>{E==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[E]="",e.query.page=1},e.chips=[];let d=()=>{let E=[];(e.query.dateFrom||e.query.dateTo)&&E.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=E};e.statusCountFor=E=>{let S=(e.statusCounts||[]).find(N=>N._id===E);return S?S.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=E=>{e.query.sort===E?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=E,e.query.direction="desc"),e.query.page=1},e.sortIcon=E=>e.query.sort===E?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let p="admin.conferences.filterPrefs",c={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},v=loadFilterPrefs(p)||{};e.query=Object.assign({},c,v,{page:1,search:""});let g=s.search();g.search&&(e.query.search=g.search);let y="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(y)||"[]"),e.savePreset=()=>{let E=window.prompt("Preset name:");if(!E)return;let S=Object.assign({},e.query);delete S.page,e.presets=(e.presets||[]).filter(N=>N.name!==E),e.presets.push({name:E,query:S}),localStorage.setItem(y,JSON.stringify(e.presets))},e.applyPreset=E=>{Object.assign(e.query,E.query,{page:1})},e.deletePreset=E=>{e.presets=(e.presets||[]).filter(S=>S.name!==E.name),localStorage.setItem(y,JS
Line truncated
|
||||
`).map((We,ze)=>ze===0?We:Ue+We).join(`
|
||||
`)}else typeof J=="number"||typeof J=="boolean"?Me=String(J):Me=JSON.stringify(J);W.push(`${ue}${Me}${he}`)}),W.push("}"),W.join(`
|
||||
`)}function S(F){let H=[],I="",q=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,k=0,L;for(;L=q.exec(F);)I+=F.slice(k,L.index),k=q.lastIndex,H.push({key:L[1],op:L[2]||"=",val:L[3]});return I+=F.slice(k),{filters:H,free:I.trim().toLowerCase()}}function N(F,H){for(let I of H.filters){let q=(L,W,z)=>{let J=parseFloat(L),ne=parseFloat(W);return z==="="?String(L)===String(W):z==="!="?String(L)!==String(W):z===">="?J>=ne:z==="<="?J<=ne:z===">"?J>ne:z==="<"?J<ne:!0},k;if(I.key==="code")k=F.displayMessage;else if(I.key==="module")k=F.module;else if(I.key==="status")k=F._status;else if(I.key==="url")k=F._url;else if(I.key==="repo")k=F._repoId;else if(I.key==="level")k=F.level;else continue;if(k==null||!q(k,I.val,I.op))return!1}return!(H.free&&((F.displayMessage||"")+" "+(F.module||"")+" "+(F._url||"")+" "+JSON.stringify(F.raw||[])).toLowerCase().indexOf(H.free)===-1)}function w(){let F=S(e.query.search||"");e.parsedFilterCount=F.filters.length;let H=e.query.bucket,I=e.entries.filter(z=>H&&z._bucket!==H?!1:N(z,F)),q=e.query.group;if(q){let z=G=>JSON.stringify(q==="module"?[G.module,G._bucket]:[G.raw?.[0]?.service||"unknown",G.module,G.displayMessage||G.message||"_",G._bucket,G._status]),J=new Map;for(let G of I){let ue=z(G);if(J.has(ue)){let he=J.get(ue);he.count++,he._related.push(G),new Date(G.ts)>new Date(he.ts)&&(he.ts=G.ts,he._url=G._url,he._status=G._status),new Date(G.ts)<new Date(he._firstSeen)&&(he._firstSeen=G.ts)}else{let he=Object.assign({},G);he._key=`${q}:${ue}`,he._related=[G],he._firstSeen=G.ts,he._lastHourCount=0,he.count=1,J.set(ue,he)}}let ne=Date.now()-3600*1e3;for(let G of J.values())G._lastHourCount=G._related.filter(ue=>new Date(ue.ts).getTime()>=ne).length;I=Array.from(J.values())}else I=I.map((z,J)=>(z._key="row:"+J+":"+z.ts,z._related=[z],z._firstSeen=z.ts,z._lastHourCount=0,z.count=1,z));let k=z=>({error:0,warn:1,info:2})[z._bucket]??1;e.query.sort==="count"?I.sort((z,J)=>k(z)-k(J)||J.count-z.count||new Date(J.ts)-new Date(z.ts)):I.sort((z,J)=>k(z)-k(J)||new Date(J.ts)-new Date(z.ts)),e.visible=I;let L=!!(e.query.bucket||(e.query.search||"").trim()),W=!L&&(e.stats?.severity?.error||0)>0&&!I.some(z=>z._bucket==="error")&&e.entries.length<1500;(L&&!I.length||W)&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,D(!0))}function D(F){if(F&&e.redisLoading)return;let H=++o;e.redisLoading=!0;let I=F?e.redisNextOffset||e.entries.length:0,q=F?e.pageSize:Math.max(e.pageSize,e.redisNextOffset||e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:I,limit:q}}).then(k=>{if(p||H!==o)return;e.redisLoading=!1;let L=(k.data.entries||[]).map(b);e.entries=F?e.entries.concat(L):L,e.redisRedacted=(F&&e.redisRedacted||0)+(k.data.redactedEntries||0),e.redisNextOffset=k.data.nextOffset??I+(k.data.entries||[]).length,e.available=!!k.data.available,e.redisCollecting=k.data.redisCollecting!==!1,e.cap=k.data.max||e.cap,e.total=k.data.total||e.entries.length,e._autoLoading=!1,w()},()=>{p||H!==o||(e.redisLoading=!1,e._autoLoading=!1,e.available=!1)})}e.loadMore=()=>D(!0),e.canLoadMore=()=>(e.redisNextOffset||e.entries.length)<e.total;function O(F=!1){if(F&&d)return;let H=++r;d=!0,t.get("/api/admin/errors/stats").then(I=>{if(p||H!==r)return;d=!1;let q=I.data||{};e.redisStatsState=q.available===!1?"unavailable":"ready";let k=q.prev24h?Math.round((q.last24h-q.prev24h)/q.prev24h*100):0;e.stats={last24h:q.last24h||0,prev24h:q.prev24h||0,delta:k,severity:q.severity||{error:0,warn:0,info:0},unique:q.unique||{error:0,warn:0,info:0},buckets:q.buckets||[],dropped:q.dropped||0},w()},()=>{!p&&H===r&&(d=!1,e.redisStatsState="unavailable")})}function _(F=!1){(!F||!e.redisLoading)&&D(),O(F)}e.barPx=(F,H)=>{let I=e.stats.buckets||[],q=0,k=0;for(let J of I)q=Math.max(q,(J.error||0)+(J.warn||0)),k=Math.max(k,J.info||0);let L=F[H]||0;if(!L)return 0;if(H==="info")return k?Math.max(2,Math.round(L/k*(q?16:60))):0;let W=(F.error||0)+(F.warn||0),z=Math.round(W/q*44);return Math.max(4,Math.round(L/W*z))},e.bucketTitle=F=>`${new Date(F.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${F.error||0} err \xB7 ${F.warn||0} warn \xB7 ${F.info||0} info`,e.toggle=async(F,H)=>{v=H||document.activeElement,g=e.captureErrorScroll(v),e.historySelected=F,e.historyView="overview",e.expanded={[F._key]:!0},await je(),document.getElementById("history-inspector-title")?.focus({preventScroll:!0}),document.getElementById("history-inspector-title")?.scrollIntoView?.({block:"nearest"})},e.showHistoryTimeline=F=>{if(e.historyView="timeline",e.traceSelection)return;let H=["requestId","jobId"].find(I=>e.logTraceId(e.historySelected,I));H&&e.lookupTrace(H,e.logTraceId(e.historySelected,H),F,e.historySelected)},e.closeHistory=async()=>{let F=e.historySelected?._key;e.historySelected=null,e.expanded={},e.traceSelection&&await e.closeTrace(),await je(),(v?.isConnected?v:[...document.querySelectorAll("[data-history-key]")].find(I=>I.dataset.historyKey===F))?.focus({preventScroll:!0}),e.restoreErrorScroll(g)},e.setBucket=F
Line truncated
|
||||
`)],{type:"text/csv;charset=utf-8"}),q=URL.createObjectURL(I),k=document.createElement("a");k.href=q,k.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(q)};function j(F){e.copyHint=`${F} copied`,c.timeout(()=>{e.copyHint=""},1500)}e.copyJson=F=>{navigator.clipboard.writeText(F._rawJson).then(()=>j("JSON"))},e.copyCurl=F=>{if(!F._url)return;let I=`curl -X ${F._method||"GET"} '${window.location.origin}${F._url}'`;navigator.clipboard.writeText(I).then(()=>j("curl"))},_();let oe=i(()=>{e.query.autoRefresh&&_(!0)},15e3);e.on("dispose",()=>{p=!0,o++,r++,i.cancel(oe)}),e.watch("query.search",w),e.watch("query.bucket",w),e.watch("query.sort",w),e.watch("query.group",w)},Gu=function(e,t,s,i){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null){s.url("/");return}e.data=null,e.loading=!0,e.error=null,e.performance=null,e.performanceMinutes=15,e.performanceTab="routes",e.cacheReport=null,e.cacheError=null,e.cacheMinutes=60,e.cacheTraffic="all",e.ovView=["performance","cache"].includes((window.location.hash||"").slice(1))?window.location.hash.slice(1):"summary",e.setOvView=function(w){e.ovView=w;try{window.history.replaceState(null,"",w==="summary"?window.location.pathname:"#"+w)}catch{}};var o=!1;e.loadCache=function(){if(!o){o=!0;var w=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:w}}).then(function(D){w===e.cacheMinutes&&(e.cacheReport=D.data,e.cacheError=D.data.available?null:D.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){o=!1,w!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(w){return e.cacheTraffic==="all"||w.traffic===e.cacheTraffic})},e.cacheRate=function(w,D){var O=e.cacheRows(),_=function(F){return O.filter(function(H){return H.name===F}).reduce(function(H,I){return H+I[D]},0)},j=_(w+"_hit"),oe=_(w+"_miss");return j+oe?(100*j/(j+oe)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(w){return w.replaceAll("_"," ")},e.cacheP95=function(w){var D=0,O=e.cacheReport?.latencyBucketsMs||[];if(!w.count)return"No samples";if(!w.ms)return"Not timed";for(var _=0;_<=O.length;_++)if(D+=w["b"+_]||0,D>=Math.ceil(w.count*.95))return _<O.length?"\u2264 "+qn(O[_]):"> 10\u202Fs";return"No samples"},e.healthAlert=function(){let w=e.data&&e.data.system||{},D=[["Memory",w.memPercent],["Disk",w.diskPercent]].filter(([,_])=>_>90);return D.length?D.map(([_,j])=>_+" is at "+j+"%").join(" and ")+". New anonymizations may fail until "+(D.length>1?"they drop.":"it drops."):""},e.performanceError=null,e.formatMs=function(w){return w==null?"":qn(w)},e.latencyBound=function(w,D){return w.count?w[D]==null?"> 60\u202Fs":"\u2264 "+e.formatMs(w[D]):"No samples"},e.firstByteBound=function(w){return e.latencyBound({count:w.firstByteCount,p95UpperMs:w.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(w){return Math.max(0,Math.round((Date.now()-w.sampledAt)/1e3))},e.peakRss=function(w){return(e.performance.runtimeSeries||[]).filter(function(D){return D.instance===w.instance}).reduce(function(D,O){return Math.max(D,O.rss)},w.memory.rss)},e.performanceWarning=function(w){return e.sampleAge(w)>45||w.droppedBatches||w.droppedMetrics||w.sockets?.closeWait>0||w.eventLoop?.p95Ms>100||w.memoryLimitBytes&&w.memory.rss>w.memoryLimitBytes*.8};var r=!1;e.loadPerformance=function(){var w=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==w&&(e.performance=null),!r&&(r=!0,t.get("/api/admin/performance",{params:{minutes:w}}).then(function(D){w===e.performanceMinutes&&(e.performance=D.data,e.performanceError=D.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){w===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){r=!1,w!==e.performanceMinutes&&e.loadPerformance()}))};function d(w){if(w==null)return"\u2014";for(var D=["B","KB","MB","GB","TB"],O=0,_=w;_>=1024&&O<D.length-1;)_/=1024,O++;return _.toFixed(O>0?1:0).replace(/\.0$/,"")+" "+D[O]}e.humanBytes=d;function p(w){if(!w)return"\u2014";var D=Math.floor(w/86400),O=Math.floor(w%86400/3600),_=Math.floor(w%3600/60);return D>0?D+"d "+(O<10?"0":"")+O+"h":O>0?O+"h "+(_<10?"0":"")+_+"m":_+"m"}e.humanDuration=p;function c(w){return w==null?"\u2014":w>=1e6?(w/1e6).toFixed(1)+"M":w>=1e3?(w/1e3).toFixed(1)+"K":String(w)}e.humanNum=c,e.queueTotal=function(w){return w?(w.waiting||0)+(w.active||0)+(w.delayed||0)+(w.failed||0):0},e.statusCount=function(w){if(!e.data||!e.data.repos)return 0;for(var D=e.data.repos.statusBreakdown||[],O=0;O<D.length;O++)if(D[O]._id===w)return D[O].count;return 0},e.barPct=function(w){var D=e.data&&e.data.repos?e.data.repos.total:0;if(!D)return 0;var O=[w];w==="expired"&&O.push("expiring"),w==="remov
Line truncated
|
||||
`)},Da=class{constructor(t){et(this,"gen");et(this,"threads",[]);et(this,"match",!1);et(this,"runs",[]);et(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},dc=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((s,i)=>s!==t.ids[i])?!1:e.runs.every(s=>t.runs.some(i=>i.neg===s.neg&&dc(i.state,s.state))),nc=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),po,Bn,Pa,Aa,Us=class{constructor(t,s,i){Le(this,Bn);et(this,"dots");et(this,"dotStart");Le(this,po);this.dots=t,this.dotStart=s,_e(this,po,i)}state(){return new Da(++re(this,po).gen)}done(t){return t.ids=t.threads.map(s=>s.id).sort((s,i)=>s-i),t.match&&t.ids.unshift(Ta.id),t}restricted(t,s){return s&&(this.dots||this.dotStart&&t===0)}add(t,s,i,o){switch(s.t){case"split":if(!$e(this,Bn,Pa).call(this,t,s))return;for(let d of s.out)this.add(t,d,i,o);return;case"neg":if(!$e(this,Bn,Pa).call(this,t,s))return;let r=this.state();return this.add(r,s.sub,i,!1),this.done(r),this.addRun(t,{t:"run",neg:s,state:r},i,o);case"star":if(this.restricted(i,o))return;$e(this,Bn,Aa).call(this,t,s)&&this.add(t,s.next,i,o);return;case"match":t.match=!0;return;default:$e(this,Bn,Aa).call(this,t,s)}}addRun(t,s,i,o){for(let r of t.runs)if(r.neg===s.neg&&dc(r.state,s.state))return;t.runs.push(s),s.state.match||this.add(t,s.neg.next,i,o)}step(t,s,i,o){let r=this.state();for(let d of t.threads)switch(d.t){case"lit":Ma(d,s)&&this.add(r,d.next,i+1,o);break;case"any":this.restricted(i,o)||this.add(r,d.next,i+1,o);break;case"class":!this.restricted(i,o)&&d.re.test(s)&&this.add(r,d.next,i+1,o);break;case"star":this.restricted(i,o)||this.add(r,d,i+1,o)}if(!this.restricted(i,o))for(let d of t.runs){if(d.state.dead){this.addRun(r,d,i+1,o);continue}let p=this.step(d.state,s,i,!1);this.addRun(r,{t:"run",neg:d.neg,state:p},i+1,o)}return this.done(r)}};po=new WeakMap,Bn=new WeakSet,Pa=function(t,s){let{seen:i}=re(this,po);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,!0)},Aa=function(t,s){let{has:i}=re(this,po);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,t.threads.push(s),!0)};var uc=e=>{let t=e.ids.join();if(!e.runs.length)return t;let s=e.runs.map(i=>`${i.neg.id}(${uc(i.state)})`);return`${t}|${s.sort().join("|")}`},nv=1<<18,zo,Ho,Ln,fo,$n,Fn,_n,on,Oa,xi,cc,Ia=class{constructor(t,s){Le(this,on);Le(this,zo);Le(this,Ho,new Map);Le(this,Ln,0);Le(this,fo);Le(this,$n);Le(this,Fn);Le(this,_n);_e(this,zo,t),_e(this,Fn,new Us(!1,!1,s)),_e(this,_n,new Us(!1,!0,s))}start(t){if(t){if(re(this,$n))return re(this,$n);let i=re(this,_n).state();return re(this,_n).add(i,re(this,zo),0,!0),_e(this,$n,$e(this,on,Oa).call(this,re(this,_n).done(i)))}if(re(this,fo))return re(this,fo);let s=re(this,Fn).state();return re(this,Fn).add(s,re(this,zo),0,!0),_e(this,fo,$e(this,on,xi).call(this,re(this,Fn).done(s)))}next(t,s){let i=s.charCodeAt(0),o=i<128?void 0:t.next.get(s);if(o)return o;let r=t===re(this,$n)?$e(this,on,xi).call(this,re(this,_n).step(t.state,s,0,!0)):$e(this,on,xi).call(this,re(this,Fn).step(t.state,s,1,!0));return i<128?(t.ascii||(t.ascii=new Array(128),_e(this,Ln,re(this,Ln)+128)),t.ascii[i]=r):t.next.set(s,r),nl(this,Ln)._++,r}};zo=new WeakMap,Ho=new WeakMap,Ln=new WeakMap,fo=new WeakMap,$n=new WeakMap,Fn=new WeakMap,_n=new WeakMap,on=new WeakSet,Oa=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},xi=function(t){let s=uc(t),i=re(this,Ho).get(s);if(i)return i;re(this,Ln)>nv&&$e(this,on,cc).call(this);let o=$e(this,on,Oa).call(this,t);return re(this,Ho).set(s,o),_e(this,Ln,re(this,Ln)+(s.length+1)),o},cc=function(){re(this,Ho).clear(),_e(this,Ln,0),_e(this,fo,void 0),_e(this,$n,void 0)};var ov=e=>{let t=[];for(let s=e;s.t!=="match";s=s.next){if(s.t==="split"||s.t==="neg")return;t.push(s)}return t},sv=(e,t,s,i)=>{let o=0,r=s,d=-1,p=0;for(;r<i;){let c=e[o];if(c?.t==="star"){d=o++,p=r;continue}let v=t[r];if(c&&(c.t==="any"||c.t==="lit"&&Ma(c,v)||c.t==="class"&&c.re.test(v))){o++,r++;continue}if(d===-1)return!1;o=d+1,r=++p}for(;e[o]?.t==="star";)o++;return o===e.length},pc=e=>{let t=0,s=0;for(let i of e){let[o,r]=iv(i);t+=o,s+=r}return[t,s]},iv=e=>{if(e.t==="star")return[0,1/0];if(e.t!=="ext")return[1,1];if(e.type==="!")return[0,1/0];let t=e.alts.map(pc),s=Math.min(...t.map(r=>r[0])),i=Math.max(...t.map(r=>r[1])),o=i===0?0:1/0;return e.type==="@"?[s,i]:e.type==="?"?[0,i]:e.type==="*"?[0,o]:[s,o]},oc=(e,t,s)=>{for(let i=0;i<e.length;i++)if(!Ma(e[i],t[s+i]))return!1;return!0},rv=/[/\ud800-\udfff]/,av=/[\ud800-\udfff]/,Zi=e=>av.test(e)?[...e]:e,sc=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},Un,jo,mo,er,ho,zs,tr,go,Hs,js,Gs,Tn,vn,Go,Wo,Ws,nr,nn,vo,_s,Bs=class{constructor(t,s={}){Le(this,vo);et(this,"pattern");et(this,"options");Le(this,Un);Le(this,jo);Le(this,mo);Le(this,er);Le(this,ho);Le(this,zs,!1);Le(this,tr);Le(this,go);Le(this,Hs,!1);Le(this,js,0);Le(this,Gs,1/0);Le(this,Tn,[]);Le(this,vn,[]);Le(this,Go);Le(this,Wo);Le(this,Ws,!1);Le(this,nr);Le(this,nn);if(t.includes
Line truncated
|
||||
`).forEach((s,i)=>{let{term:o}=Ga(s.trim());if(!o)return;let r=[];for(let d=0;d<o.length;d++){if(o[d]==="\\"){d++;continue}Pc.has(o[d])&&!r.includes(o[d])&&r.push(o[d])}r.length&&t.push({line:i,term:o,symbols:r})}),t}function Ic(e,t){let s=String(e||"").split(`
|
||||
`),i=s[t];if(i===void 0)return e;let{term:o}=Ga(i.trim());if(!o)return e;let r="";for(let p=0;p<o.length;p++){if(o[p]==="\\"){r+=o.slice(p,p+2),p++;continue}r+=Pc.has(o[p])||o[p]==="."?"\\"+o[p]:o[p]}let d=i.indexOf(o);return s[t]=i.slice(0,d)+r+i.slice(d+o.length),s.join(`
|
||||
`)}var Kn={VIEWER_ERRORS:{title:"Content could not be loaded",access_title:"GitHub access needs attention",reader_help:"Reading this repository? You do not need to sign in. Try again after the owner restores access, or let them know this anonymous link is unavailable.",owner_help:"Own this repository? If your GitHub account was suspended or recently recovered, sign in to Anonymous GitHub again and check the GitHub connection and repository permissions in your dashboard. Then retry this page. Keep the existing anonymous URL; do not delete the repository to restore access.",retry:"Try again",dashboard:"Open owner dashboard"},ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",invalid_sort:"The selected sort order is invalid.",invalid_cursor:"This project page is no longer valid. Reload the list.",repository_changed:"The repository changed while processing. Please retry.",repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"We could not load this content. Try again. If it still fails, contact support with the anonymous URL and the time of the error.",unreachable:"The service could not complete this request. Wait a moment and try again.",request_error:"The connection was interrupted. Check your internet connection and try again.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"Anonymous GitHub cannot access the source repository on GitHub. It may be private, unavailable, or require the owner to reconnect GitHub.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub temporarily blocked the request because we hit its API rate limit. Wait a few minutes and try again. If the problem persists and you contact GitHub Support, include the request ID and timestamp shown in GitHub's response (the 'X-GitHub-Request-Id' header).",rate_limited:"GitHub API rate limit reached. The repository will be available shortly \u2014 please wait a moment and refresh.",repoId_already_used:"The repository ID is already used.",invalid_repoId:"The format of the repository ID is invalid.",unsupported_source:"The repository source type is not supported.",branch_not_specified:"The branch is not specified.",branch_not_found:"The branch of the repository cannot be found.",commit_not_specified:"A commit must be specified.",commit_not_found:"The configured commit no longer exists in the source repository. It may have been force-pushed, rebased, or removed.",repo_renamed:"The source repository appears to have been renamed or moved on GitHub. Please refresh and try again \u2014 the cached name has been updated.",invalid_commit_format:"The commit hash format is invalid. It must be a hexadecimal string.",pull_request_not_found:"The requested pull request could not be found.",pull_request_expired:"This pull request has expired and is no longer available.",pull_request_not_ready:"This pull request is still being prepared. Please t
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,y.options),p.restore()})}c();let v=null;e.saveDefault=g=>{if(g&&g.preventDefault&&g.preventDefault(),e.saving)return;let y=p.checkpoint(),m={terms:e.terms.split(`
|
||||
`).map(b=>b.trim()).filter(b=>b.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",m).then(()=>{p.accept(y),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",v&&i.cancel(v),v=i(()=>{e.message=null},2500)},b=>{e.saving=!1;let E=b&&b.data&&b.data.error,S="Unable to save your defaults. Please try again.";Promise.all([s("ERRORS."+E),s("ERRORS.unknown_error")]).then(([N,w])=>{e.error=E&&N!==w?N:S},()=>{e.error=S})})},e.deleteAccount=()=>{e.deletingAccount||!e.confirmDeleteAccount||e.deleteUsername!==e.user?.username||(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},Fc=function(e,t,s){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(i=>{s.url("/dashboard")},i=>{e.error=i.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},_c=function(e,t,s,i,o){e.user&&!e.user.status&&s.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&s.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(p){e.feature=p},e.featureHref=function(p){return p.needsUser&&!e.user?"/signin":p.href},e.featureTarget=function(p){return p.needsUser&&!e.user?"_self":p.target||void 0},e.featureKeydown=function(p,c){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[p.key];if(v===void 0)return;p.preventDefault();let g=e.features.length,y=v==="first"?0:v==="last"?g-1:(c+v+g)%g;e.feature=e.features[y].key,o(()=>{let m=i.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.demoText=`# DeepLearnUtils
|
||||
Developed by Jane Smith at MIT CSAIL.
|
||||
See Smith et al., "Attention That Works," 2026.
|
||||
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let p=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,w)=>w.length-m.length),u=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!p.length)return[{text:e.demoText}];let y=new RegExp("("+p.map(u).join("|")+")","gi"),h={},b=0;return(e.demoText||"").split(y).filter(m=>m!=="").map(m=>{let w=p.find(N=>N.toLowerCase()===m.toLowerCase());return w?(h[w.toLowerCase()]||(h[w.toLowerCase()]=++b),{text:String(h[w.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(p=>p.redacted).length,e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}],e.statsEmpty=()=>!!e.stat&&e.cards.every(p=>!p.total);function r(){t.get("/api/stat/").then(p=>{e.stat=p.data,e.cards[0].total=p.data.nbRepositories,e.cards[1].total=p.data.nbUsers,e.cards[2].total=p.data.nbPageViews,e.cards[3].total=p.data.nbPullRequests}).catch(()=>{})}r();function d(p){let u={series:p,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!p||p.length<2)return u;let y=new Array(p.length-1);for(let S=1;S<p.length;S++)y[S-1]=p[S]-p[S-1];let h=y.length,b=Math.max.apply(null,y),m=Math.min.apply(null,y),w=Math.min(0,m),N=b-w||1;u.viewW=h*2,u.bars=new Array(h);for(let S=0;S<h;S++){let R=(y[S]-w)/N,v=Math.max(1.5,R*34);u.bars[S]={x:(S*2+.25).toFixed(2),y:(36-v).toFixed(2),w:"1.5",h:v.toFixed(2)}}if(u.deltaToday=y[h-1],h>=2){let S=y[h-2];S&&(u.pctChange=(u.deltaToday-S)/S*100)}return u.pctAbs=Math.round(Math.abs(u.pctChange)),u.isUp=u.pctChange>=0,u}e.history={repositories:d([]),users:d([]),pageViews:d([]),pullRequests:d([])},t.get("/api/stat/history?days=60").then(p=>{let u=p.data||[];e.history={repositories:d(u.map(y=>y.nbRepositories||0)),users:d(u.map(y=>y.nbUsers||0)),pageViews:d(u.map(y=>y.nbPageViews||0)),pullRequests:d(u.map(y=>y.nbPullRequests||0))}}).catch(()=>{})},Uc=function(e,t,s,i,o,r){let d=Ct();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),d.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,xe(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Bt()(document,"click",C=>{e.quotaExpanded&&!C.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=C=>C.status==="error"||C._broken||u(C.status)==="progress"&&C._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=C=>{e.projectView=C,C==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=C=>{let _=va(C?.anonymizeDate||C?.lastView)||"";return/ ago$/.test(_)?"No activity for "+_.replace(/ ago$/,""):"No activity since "+_.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=C=>"project-details-"+encodeURIComponent(C._type+":"+(C._id||C._source||"unknown")),e.showProjectDetails=async C=>{e.selectedProject=C,e.projectName=C.projectName||"",e.nameError="",e.nameMessage="",await xe();let _=document.getElementById(e.projectDetailsId(C));_?.focus(),_?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=C=>{e.selectedProject=null,xe(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(C._type+":"+C._id)}"]`)?.focus())},e.saveProjectName=async C=>{if(e.nameSaving||!C._id)return;let _=e.projectName.trim();if(_.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let H=await t.post("/api/user/project-name",{type:C._type,id:C._id,name:_});C.projectName=H.data.name,C._label=C.projectName||C._fallbackLabel,e.selectedProject===C&&(e.nameMessage=_?"Project name saved.":"Default project name restored."),E||(e.dashboardCursor=null,await V(),e.selectedProject===C&&(e.selectedProject=e.items.find(K=>K._type===C._type&&K._id===C._id)||null))}catch{e.selectedProject===C&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async C=>{if(!C._viewUrl||e.copyingId)return;let _=new URL(C._viewUrl,o.location.origin).href;e.copyingId=C._type+":"+C._id;try{await Wa(_),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:_})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"Preparing",error:"Error",expired:"Expiring / expired",removed:"Removing / removed"};let p=["queue","download","downloaded","preparing","anonymizing"];function
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,B.options),e.options.expirationDate=B.options&&B.options.expirationDate?new Date(B.options.expirationDate):x(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),k&&k()})}function Y(k,M,B){e.anonymize&&e.anonymize[k]&&e.anonymize[k].setValidity(M,B)}function me(k){try{let M=parseGithubUrl(k);if(M&&M.owner&&M.repo)return M.owner+"/"+M.repo}catch{}return null}e.accessRepairAllowed=!1,e.repairingGitHubAccess=!1,e.accessRepairMessage="",e.repairGitHubAccess=async()=>{if(!e.accessRepairAllowed||e.repairingGitHubAccess||!e.githubConnections?.appEnabled||!i.repoId||e.role!=="owner"||e.githubConnection!=="github-app"||me(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let k=m();try{let M=await t.get("/github/connections");if(e.githubConnections=M.data,!M.data.appEnabled)return;let B=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":M.data.csrf}});if(!b(k))return;e.error=null,B.data.fullName&&(e._originalFullName=B.data.fullName,e.source.fullName=B.data.fullName,e.sourceUrl="https://github.com/"+B.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{b(k)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,w(k)}},e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await Qe()}catch{}}};function Se(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:me(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function Ue(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function Be(){let k=new URLSearchParams(window.location.search).get("billingDraft");if(k){R.restore();try{let B=(await t.get("/api/billing/draft/"+encodeURIComponent(k))).data;if(B.path!==o.path())throw new Error("Wrong task");v=B.values.conference||null;for(let G of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(B.values,G)&&(e[G]=B.values[G]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),E=B.id,D=JSON.stringify(R.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await Ue(),o.replace?.(o.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let M;try{M=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!M||M.path!==o.path()||Date.now()-M.savedAt>=30*6e4)return R.restore()?(e.sourceUrl&&await Ue(),!0):!1;R.restore();for(let B of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(M.draft,B)&&(e[B]=M.draft[B]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await Ue(),sessionStorage.removeItem("github-access-draft"),!0}se(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&d(Be,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async k=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(k.data.status),e.githubConnection=k.data.connection||"oauth",e.sourceUrl="https://github.com/"+k.data.source.fullName,e._originalFullName=k.data.source.fullName,e.terms=k.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=k.data.source,e.role=k.data.role||"owner",e._existingNever=k.data.options.expirationMode==="never",e._savedExpirationDate=k.data.options.expirationDate?new Date(k.data.options.expirationDate):null,e.coauthors=k.data.coauthors||[],e._originalBranch=k.data.source.branch,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,e.repositoryID=k.data.source.repositoryID,e._originalRepositoryID=k.data.source.repositoryID,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),N=S(parseGithubUrl(e.sourceUrl)),!await Be()&&(await Promise.all([Qe(),He()]),ws())},()=>{o.url("/404")})),i.pullRequestId&&i.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=i.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async k=>{if(e.githubConnection=k.data.connection||"oauth",e.sourceUrl="https://github.com/"+k.data.source.repositoryFullName+"/pull/"+k.data.source.pullRequestId,e.terms=k.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=k.data.source,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),N=S(parseGithubUrl(e.sourceUrl)),!await Be())try{await Qa()}catch{}},()=>{o.url("/404")})),i.gistId&&i.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=i.gistId,t.get("/api/gist/"+e.gistId).then(async k=>{e.sourceUrl="https://gist.github.com/"+k.data.source.gistId,e.terms=k.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=k.data.source,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),N=S(parseGithubUrl(e.sourceUrl)),!await Be()&&await Za()},()=>{o.url("/404")}))}),t.get("/github/connections").then(k=>{e.githubConnections=k.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&k.data.appEnabled&&k.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&Ue())}).catch(()=>{}),e.urlSelected=async(k=!1)=>{let M=++u;e.previousConfigurations=[],e.previousConfigurationId="";let B;try{B=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,Yt.cancel(),An.cancel(),In.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",Y("sourceUrl","github",!1);return}let G=S(B),ue=k||N===G;N=G,e.sourceUrlError="",Y("sourceUrl","github",!0);let ye=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let Ke=window.document.getElementById("sourceUrl");if(Ke){try{Ke.setSelectionRange(0,0)}catch{}Ke.scrollLeft=0}},50),ye&&d(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!ue&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],ue||(e.source={type:"GitHubStream",branch:"",commit:""}),Yt.cancel(),An.cancel(),In.cancel(),ks.clear(),Cs.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",dt(),e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=ue;try{B.gistId&&!B.repo?(e.detectedType="gist",e.source={gistId:B.gistId},await Za()):B.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:B.owner+"/"+B.repo,pullRequestId:B.pullRequestId},await Qa()):(e.detectedType="repo",_(),await Promise.all([Qe(),He()]),ws())}catch{}finally{M===u&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let k=e.branches.filter(B=>B.name==e.source.branch)[0];if(!k)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=k.commit),e.readme=k.readme,await He(),ws()}),e.getBranches=async k=>{let M=parseGithubUrl(e.sourceUrl),B=m();try{let G=await t.get(`/api/repo/${M.owner}/${M.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:k===!0||e.reconnectingSource?"1":"0",repositoryID:Se()}});if(!b(B))return;e.branches=G.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let ue=e.branches.filter(ye=>ye.name==e.source.branch);ue.length>0&&(!(!e.reconnectingSource&&!k&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=ue[0].commit),e.readme=ue[0].readme,await He(k))}catch(G){if(!b(B))return;e.branches=[],e.sourceUnreachable=G&&(G.status===404||G.data&&G.data.error==="repo_not_found");let ue=G&&G.data&&G.data.error||(G&&G.status===404?"repo_not_found":"unknown_error");r("ERRORS."+ue).then(ye=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:ye}),e.error=ye},console.error),typeof Y=="function"&&Y("sourceUrl","missing",!1)}finally{w(B)}};async function Qe(){let k=parseGithubUrl(e.sourceUrl),M=m();try{Es();let B=await t.get(`/api/repo/${k.owner}/${k.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:Se(),force:"1"}});if(!b(M))return;e.details=B.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(B){if(!b(M))return;throw B.data&&(r("ERRORS."+B.data.error).then(G=>{e.addToast({title:"Error",date:new Date,body:G}),e.error=G},console.error),Ss(B.data.error)),Y("sourceUrl","missing",!1),B}finally{w(M)}}async function He(k){if(e.readme&&!k)return e.readme;let M=parseGithubUrl(e.sourceUrl),B=m();try{let G=await t.get(`/api/repo/${M.owner}/${M.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:k===!0?"1":"0",branch:e.source.branch,repositoryID:Se()}});b(B,!0)&&(e.readme=G.data)}catch{b(B,!0)&&(e.readme="")}finally{w(B)}}let tt={magicalBraces:!0},Re=k=>k.startsWith("/")&&!k.endsWith("/")&&zn(vs(k.slice(1),tt),tt)===k.slice(1),Fe=()=>Object.keys(e.preserve.picked).filter(k=>e.preserve.pick
Line truncated
|
||||
`).map(k=>k.trim()).filter(Boolean),ce=null,ve=null,Me=new Set,T=0,I=null,F=()=>!1;function Q(){let k=T+"\0"+e.preserve.patterns;if(k!==I){I=k;try{F=ja(Ha([...Fe(),...de()]))}catch{F=()=>!1}}return F}function j(k){let M=new Map([["",{dirs:[],files:[]}]]);for(let B of k){let G=B.split("/"),ue="";for(let ye=0;ye<G.length-1;ye++){let Ke=G.slice(0,ye+1).join("/");M.has(Ke)||(M.set(Ke,{dirs:[],files:[]}),M.get(ue).dirs.push(Ke)),ue=Ke}M.get(ue).files.push(B)}for(let B of M.values())B.dirs.sort();return{files:k,dirs:M,descendants:new Map}}function ee(k){return ce.descendants.has(k)||ce.descendants.set(k,ce.files.filter(M=>M.startsWith(k+"/"))),ce.descendants.get(k)}let le=k=>Q()(k);function ne(k){let M=ee(k),B=0;for(let G of M)le(G)&&B++;return B===0?"none":B===M.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let k=(e.options?.preserveFiles||[]).map(M=>String(M).trim()).filter(Boolean).map(M=>Re(M)?vs(M.slice(1),tt):M);return k.length?k.slice(0,2).join(", ")+(k.length>2?` and ${k.length-2} more`:""):"None. Every file is redacted."};async function oe(){let k=e.source?.commit;if(!(ce&&e.preserve.commit===k)){e.preserve.loading=!0,e.preserve.error="",ce=null,ve=null;try{let M=parseGithubUrl(e.sourceUrl),B=await t.get(`/api/repo/${M.owner}/${M.repo}/tree`,{params:{commit:k,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Se()}});if(e.source?.commit!==k)return;let G=Array.isArray(B.data.binaryFiles)?B.data.binaryFiles:[];ce=un(j(B.data.files||[])),ve=G.length?un(j([...B.data.files||[],...G])):ce,Me=un(new Set(G)),e.preserve.commit=k,e.preserve.truncated=!!B.data.truncated,e.previewFile||Yt()}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",k=>{e.previewFile&&e.openPreviewFile(""),e.detectedType==="repo"&&k&&e.sourceUrl&&oe().catch(()=>{})}),e.openPreserveFiles=()=>{let k={},M=[];for(let G of e.options?.preserveFiles||[]){let ue=String(G).trim();ue&&(!M.length&&Re(ue)?k[vs(ue.slice(1),tt)]=!0:M.push(ue))}let B={};for(let G of Object.keys(k)){let ue=G.split("/");for(let ye=1;ye<ue.length;ye++)B[ue.slice(0,ye).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:k,expanded:B,patterns:M.join(`
|
||||
`),patternsOpen:M.length>0}),e.mobileWorkspace&&(e.mobilePane="settings"),T++,d(()=>{let G=document.getElementById("preserve-files-dialog");G?.showModal&&!G.open&&G.showModal(),document.getElementById("preserve-files-search")?.focus()},0),oe()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=Ha([...Fe(),...de()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!ce)return[];let k=Q(),M=(ye,Ke,Lt)=>{let bt=!!e.preserve.picked[ye],Xn=k(ye);return{kind:"file",path:ye,label:Lt,depth:Ke,state:Xn?"all":"none",locked:!bt&&Xn,note:!bt&&Xn?"matched by a pattern":bt&&!Xn?"excluded by a pattern":""}},B=String(e.preserve.search||"").trim().toLowerCase();if(B)return ce.files.filter(ye=>ye.toLowerCase().includes(B)).slice(0,300).map(ye=>M(ye,0,ye));let G=[],ue=(ye,Ke)=>{let Lt=ce.dirs.get(ye);for(let bt of Lt.dirs){let Xn=!!e.preserve.expanded[bt],xa=de().includes(W(bt));G.push({kind:"dir",path:bt,label:bt.slice(ye?ye.length+1:0)+"/",depth:Ke,open:Xn,state:ne(bt),locked:!1,note:xa?"whole folder":""}),Xn&&ue(bt,Ke+1)}for(let bt of Lt.files)G.push(M(bt,Ke,bt.slice(ye?ye.length+1:0)))};return ue("",0),G},e.preserveCount=()=>ce?ce.files.filter(le).length:0,e.togglePreserveDir=k=>{e.preserve.expanded[k]=!e.preserve.expanded[k]},e.togglePreserveFile=k=>{e.preserve.picked[k]=!e.preserve.picked[k],T++},e.togglePreserveFolder=k=>{let M=W(k),B=fe(k),G=de().filter(ye=>ye!==M&&ye!==B),ue=ne(k)==="all"||de().includes(M);for(let ye of ee(k))e.preserve.picked[ye]=!1;T++,e.preserve.patterns=(ue?G:[...G,M]).join(`
|
||||
`),ue&&ee(k).some(le)&&(e.preserve.patterns=[...G,B].join(`
|
||||
`))};let te=/^readme(\.[^/]*)?$/i,ke=[".md",".markdown",".mdown",".mkdn",".rst",".txt",""],pe=["README.md","README","README.markdown","README.rst","README.txt","readme.md"],Ee=k=>{let M=K(k),B=M.indexOf("."),G=ke.indexOf(B===-1?"":M.slice(B).toLowerCase());return G===-1?ke.length:G},Pe=()=>!!ce&&!!e.preserve.commit&&e.preserve.commit===e.source?.commit;e.readmePath=()=>{if(!Pe())return"";for(let k of[".github","","docs"]){let M=(ce.dirs.get(k)?.files||[]).filter(B=>te.test(K(B)));if(M.length)return M.sort((B,G)=>Ee(B)-Ee(G)||H(B,G))[0]}return""},e.readmeName=()=>K(e.readmePath())||"README.md";let Ve={key:null,fn:()=>!1},Ge=()=>{let k=(e.options?.preserveFiles||[]).map(B=>String(B).trim()).filter(Boolean),M=k.join(`
|
||||
`);if(M!==Ve.key){let B=()=>!1;try{k.length&&(B=ja(k))}catch{}Ve={key:M,fn:B}}return Ve.fn};e.pathPreserved=k=>!!k&&Ge()(k),e.readmePreserved=()=>{if(e.detectedType!=="repo")return!1;let k=Ge();if(Pe()){let M=e.readmePath();return!!M&&k(M)}return pe.some(M=>k(M))},e.previewPreserved=()=>e.detectedType==="repo"&&(e.previewFile?e.pathPreserved(e.previewFile):e.readmePreserved());function ze(){let k={terms:e.terms?e.terms.split(`
|
||||
`):[],filePath:e.previewOpenPath()||"README.md",preserveFiles:e.options.preserveFiles||[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(k.branchName=e.source.branch);try{let M=parseGithubUrl(e.sourceUrl);k.repoName=`${M.owner}/${M.repo}`}catch{}return k}function we(k,M,B){let G=null,ue=0,ye=()=>{if(e.detectedType!==k)return;G&&d.cancel(G);let Ke=++ue;e.previewStatus="loading",G=d(()=>{G=null;let Lt=M();if(!Lt){e.previewStatus="idle";return}t.post("/api/anonymize-preview",Lt).then(bt=>{Ke===ue&&(B(bt.data,Lt),e.previewStatus="ready")}).catch(()=>{Ke===ue&&(e.previewStatus="error")})},200)};return ye.cancel=()=>{ue++,G&&d.cancel(G),G=null},e.on("dispose",ye.cancel),ye}e.retryPreview=()=>{e.detectedType==="repo"&&(e.previewFile&&typeof lt!="string"?ft(e.previewFile):Yt()),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()};let be=un(qo(e));Object.defineProperty(e,"previewViewer",{get:()=>be}),ha(be,e),Object.assign(be,{options:{},files:[],paths:[],content:null,type:"loading",sidebarHidden:!1,sidebarCollapsed:!0,moreOpen:!1,tocOpen:!1,gotoOpen:!1,mdFindOpen:!1,mdFindQuery:"",mdFindTotal:0,mdFindIndex:0}),be.preview=!0,be.fileSize=k=>k===be.filePath&&typeof lt=="string"?new Blob([lt]).size:!e.previewFile&&e.readme?new Blob([e.readme]).size:null,be.openPreserveFiles=()=>e.openPreserveFiles(),be.previewPreserved=()=>e.previewPreserved(),be.retryContent=()=>e.retryPreview();let it=k=>Me.has(k)||/\.(pdf|png|jpe?g|gif|svg|ico|bmp|tiff?|webp|avif|heic|heif|mp4|webm|mp3|wav|zip|bin)$/i.test(k),at=(k="")=>({path:k,loading:!1,note:"",loadError:""});e.previewFile="",e.previewDoc=at();let yt=0,lt=null;e.previewOpenPath=()=>e.previewFile||e.readmePath(),e.openPreviewFile=k=>{if(k=k||"",k&&k===e.readmePath()&&(k=""),yt++,lt=null,Yn(),Yt.cancel(),e.previewFile=k,e.previewDoc=at(k),be.sidebarCollapsed=!0,be.content=null,!k){e.readme?Yt():e.previewStatus="idle";return}if(it(k)){cr("binary"),e.previewStatus="ready";return}ft(k)};function dt(){yt++,lt=null,e.previewFile="",e.previewDoc=at(),be.sidebarCollapsed=!0,be.content=null}function ft(k){let M=++yt;lt=null,Object.assign(e.previewDoc,{loading:!0,loadError:""}),e.previewStatus="loading";let B;try{B=parseGithubUrl(e.sourceUrl)}catch{B=null}if(!B||!e.source?.commit){Object.assign(e.previewDoc,{loading:!1,loadError:"The repository is still loading. Try again in a moment."}),e.previewStatus="error";return}t.get(`/api/repo/${B.owner}/${B.repo}/file`,{params:{commit:e.source.commit,path:k,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Se()},transformResponse:G=>G}).then(G=>{if(M!==yt)return;e.previewDoc.loading=!1;let ue=typeof G.headers=="function"&&G.headers("content-type")||"";if(/json/i.test(ue)){let ye=null;try{ye=JSON.parse(G.data)}catch{}if(ye&&ye.binary===!0){cr("binary"),e.previewStatus="ready";return}}lt=typeof G.data=="string"?G.data:"",Yt()},G=>{if(M!==yt)return;e.previewDoc.loading=!1;let ue=ar(G);if(ue==="file_too_big"){cr("too_big"),e.previewStatus="ready";return}e.previewDoc.loadError=Kn.ERRORS[ue]||"GitHub did not return this file.",e.previewStatus="error"})}let qt;function Yn(){qt&&window.URL.revokeObjectURL(qt),qt=void 0,be.url=void 0}e.on("dispose",Yn);function cr(k){Yn(),e.previewDoc.note=k,be.prepareFile(e.previewPathName(e.previewOpenPath()||e.readmeName())),be.type=k==="too_big"?"error":"binary",be.content=k==="too_big"?"file_too_big":"binary"}function ef(k){try{let M=parseGithubUrl(e.sourceUrl),B=e.source.branch||e.details&&e.details.defaultBranch||"main",G=k&&k.includes("/")?k.slice(0,k.lastIndexOf("/")+1):"";return`https://github.com/${M.owner}/${M.repo}/raw/${B}/${G}`}catch{return""}}let Ja=we("repo",()=>e.previewFile?typeof lt!="string"?null:{content:lt,options:ze()}:e.readme?{content:e.readme,options:ze()}:null,k=>{if(typeof k?.content!="string")throw Error("Invalid preview response");Yn(),window.URL?.createObjectURL&&(be.url=qt=window.URL.createObjectURL(new Blob([k.content],{type:"text/plain"})));let M=e.previewOpenPath()||e.readmeName();be.prepareFile(e.previewPathName(M)),be.fileBaseUrl=ef(M),be.renderFileContent(k.content,be.type,be.fileBaseUrl,"text/plain"),e.previewFile||(e.anonymize_readme=k.content)}),Yt=()=>{e.previewFile&&typeof lt!="string"||Ja()};Yt.cancel=Ja.cancel;let bs=ot(new Map),pr=new Set,fr=new Set,Zs="",xs=null,xo=()=>String(e.terms||"").split(`
|
||||
`).filter(k=>k.trim());function tf(){xs=null;let k=xo(),M=k.join(`
|
||||
`);M!==Zs&&(bs.clear(),fr.clear(),Zs=M);let B=[...pr].filter(G=>!bs.has(G));if(pr.clear(),!(!B.length||!k.length))for(let G=0;G<B.length;G+=400){let ue=B.slice(G,G+400);t.post("/api/anonymize-preview",{contents:ue,options:{terms:k,image:!0,link:!0}}).then(ye=>{if(Zs!==M||xo().join(`
|
||||
`)!==M)return;let Ke=ye.data?.contents;if(!Array.isArray(Ke)||Ke.length!==ue.length)throw Error("Invalid preview response");ue.forEach((Lt,bt)=>bs.set(Lt,typeof Ke[bt]=="string"?Ke[bt]:Lt))}).catch(()=>{Zs===M&&ue.forEach(ye=>fr.add(ye))})}}e.previewName=k=>{if(!k||!xo().length)return k;if(Zs===xo().join(`
|
||||
`)){if(bs.has(k))return bs.get(k);if(fr.has(k))return k}return pr.add(k),xs||(xs=d(tf,120)),k},e.previewPathName=k=>{k=String(k||"");let M=k.lastIndexOf("/");return M<0?e.previewName(k):e.previewName(k.slice(0,M))+"/"+e.previewName(k.slice(M+1))},e.watch(()=>[e.repoId,e.previewPathName(e.previewOpenPath()||e.readmeName()),e.previewTreeFiles()],()=>{be.repoId=e.repoId||"repository",be.filePath=e.previewPathName(e.previewOpenPath()||e.readmeName()),be.paths=be.filePath.split("/"),be.files=e.previewTreeFiles(),be.loadedFolders=Object.fromEntries([...ve?.dirs.keys()||[]].map(k=>[e.previewName(k),!0]))},!0),e.on("dispose",()=>{xs&&d.cancel(xs)});function ws(){!e.anonymize||!e.anonymize.terms||Yt()}async function Qa(){let k=parseGithubUrl(e.sourceUrl),M=m();try{Es();let B=await t.get(`/api/pr/${k.owner}/${k.repo}/${k.pullRequestId}`,{params:{connection:e.githubConnection}});if(!b(M))return;e.details=B.data,e.pullRequestId||(e.pullRequestId=k.repo+"-PR"+k.pullRequestId+"-"+generateRandomId(4))}catch(B){if(!b(M))return;throw B.data&&(r("ERRORS."+B.data.error).then(G=>{e.addToast({title:"Error",date:new Date,body:G}),e.error=G},console.error),Ss(B.data.error)),Y("sourceUrl","missing",!1),B}finally{w(M)}}let ks=ot(new Map);function nf(){let k=new Set,M=e.details&&e.details.pullRequest;if(!M)return k;typeof M.title=="string"&&k.add(M.title),typeof M.body=="string"&&k.add(M.body),typeof M.diff=="string"&&k.add(M.diff);let B=M.comments||[];for(let G of B)typeof G.author=="string"&&k.add(G.author),typeof G.body=="string"&&k.add(G.body);return k}let An=we("pr",()=>{let k=nf(),M=Array.from(k);return M.length===0?null:{contents:M,options:ze()}},(k,M)=>{if(!Array.isArray(k?.contents)||k.contents.length!==M.contents.length||k.contents.some(ue=>typeof ue!="string"))throw Error("Invalid preview response");let B=M.contents,G=new Map;for(let ue=0;ue<B.length&&ue<k.contents.length;ue++)G.set(B[ue],k.contents[ue]);ks.clear(),G.forEach((ue,ye)=>ks.set(ye,ue))});e.anonymizePrContent=function(k){return k&&(ks.has(k)?ks.get(k):"")};async function Za(){let k=parseGithubUrl(e.sourceUrl),M=m();try{Es(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let B=await t.get(`/api/gist/source/${k.gistId}`);if(!b(M))return;e.details=B.data,e.gistId||(e.gistId="gist-"+k.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(B){if(!b(M))return;if(B.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,Y("sourceUrl","missing",!1);return}if(B.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,Y("sourceUrl","missing",!1);return}throw B.data&&(r("ERRORS."+B.data.error).then(G=>{e.addToast({title:"Error",date:new Date,body:G}),e.error=G},console.error),Ss(B.data.error)),Y("sourceUrl","missing",!1),B}finally{w(M)}}let Cs=ot(new Map);function sf(){let k=new Set,M=e.details&&e.details.gist;if(!M)return k;typeof M.description=="string"&&k.add(M.description),typeof M.ownerLogin=="string"&&k.add(M.ownerLogin);let B=M.files||[];for(let ue of B)typeof ue.filename=="string"&&k.add(ue.filename),typeof ue.content=="string"&&k.add(ue.content);let G=M.comments||[];for(let ue of G)typeof ue.author=="string"&&k.add(ue.author),typeof ue.body=="string"&&k.add(ue.body);return k}let In=we("gist",()=>{let k=sf(),M=Array.from(k);return M.length===0?null:{contents:M,options:ze()}},(k,M)=>{if(!Array.isArray(k?.contents)||k.contents.length!==M.contents.length||k.contents.some(ue=>typeof ue!="string"))throw Error("Invalid preview response");let B=M.contents,G=new Map;for(let ue=0;ue<B.length&&ue<k.contents.length;ue++)G.set(B[ue],k.contents[ue]);Cs.clear(),G.forEach((ue,ye)=>Cs.set(ye,ue)),mr()});e.anonymizeGistContent=function(k){return k&&(Cs.has(k)?Cs.get(k):"")},e.previewGistFiles=[];function mr(){let k=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=k.map(M=>({filename:e.anonymizeGistContent(M.filename),content:e.anonymizeGistContent(M.content),language:M.language}))}e.watch("details.gist.files",mr,!0),e.watch("terms",mr);function of(){let k=e.conference;if(e.conference_data=null,!k)return;let M=k===v||e.isUpdate&&k===e._originalConference;k!==v&&(v=null),t.get("/api/conferences/"+k).then(B=>{e.conference===k&&(e.conference_data=B.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!M&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.image,e.options.pdf=e.conference_data.options.pdf,e.options.notebook=e.conference_data.options.notebook,e.options.link=e.conference_data.options.link))},()=>{e.conference===k&&(e.conference_data=null)})}function Es(){Y("repoId","used",!0),Y("repoId","format",!0),Y("pullRequestId","used",!0),Y("pullRequestId","format",!0),Y("gistId","used",!0),Y("gistId","format",!0),Y("sourceUrl","used",!0),Y("sourceUrl","missing",!0),Y("sourceUrl","access",!0),Y("sourceUrl","github",!0),Y("commit","exi
Line truncated
|
||||
`).filter(ye=>ye),connection:e.githubConnection,fullName:`${B.owner}/${B.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(G.options.pageSource=e.details.pageSource),Es();let ue=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(ue,G,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/status/"+e.repoId},ye=>{if(ye.data){let Ke=["quota_exceeded","subscription_required_for_never_expiration"].includes(ye.data.error);Ke||r("ERRORS."+ye.data.error).then(Lt=>{e.error=Lt},console.error),Ss(ye.data.error),Ke&&(ye.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,xe(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"})))}}).finally(()=>{M.disabled=!1})},e.anonymizeGist=k=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ei())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let M=k.currentTarget||k.target.closest?.("button")||k.target;M.disabled=!0;let B=parseGithubUrl(e.sourceUrl),G={gistId:e.gistId,terms:e.terms.trim().split(`
|
||||
`).filter(ye=>ye),source:{gistId:B.gistId},options:e.options,conference:e.conference};Es();let ue=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(ue,G,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/gist/"+e.gistId},ye=>{ye.data&&(r("ERRORS."+ye.data.error).then(Ke=>{e.error=Ke},console.error),Ss(ye.data.error))}).finally(()=>{M.disabled=!1})},e.anonymizePullRequest=k=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ei())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let M=k.currentTarget||k.target.closest?.("button")||k.target;M.disabled=!0;let B=parseGithubUrl(e.sourceUrl),G={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
|
||||
`).filter(ye=>ye),source:{repositoryFullName:`${B.owner}/${B.repo}`,pullRequestId:B.pullRequestId},options:e.options,conference:e.conference};Es();let ue=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(ue,G,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/pr/"+e.pullRequestId},ye=>{ye.data&&(r("ERRORS."+ye.data.error).then(Ke=>{e.error=Ke},console.error),Ss(ye.data.error))}).finally(()=>{M.disabled=!1})},e.watch("conference",()=>{of()}),e.termHints=[],e.matchTermAsWritten=k=>{e.terms=Ic(e.terms,k)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&Yt()}),e.watch("terms",()=>{e.termHints=Ac(e.terms),e.detectedType==="repo"&&ws(),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ws(),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ws(),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()}),e.watch("details",()=>{e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()},!0)},Ka=function(e,t,s,i,o,r){ha(e);let d=Ct();Mc();let p=Bt(),u=0,y=null,h=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function b(){y&&(y.resolve(),y=null),h&&(d.timeout.cancel(h),h=null)}let m=!1;e.on("dispose",()=>{m=!0,u++,b(),w&&w.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,p(document,"click",O=>{e.symbolsOpen&&!O.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!O.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.tocOpen&&!O.target.closest?.(".tb-toc-m")&&(e.tocOpen=!1),e.gotoOpen&&O.target.isConnected&&!O.target.closest?.(".goto-pop, .btn-goto, .tb-more")&&(e.gotoOpen=!1),e.accountOpen&&!O.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!O.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),p(document,"keydown",O=>{O.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.tocOpen=!1,e.gotoOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(O.ctrlKey||O.metaKey)&&!O.altKey&&O.key&&O.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(O.preventDefault(),e.toggleMdFind(!0))}),p(document,"keydown",function(O){if((O.metaKey||O.ctrlKey)&&O.key==="k"){O.preventDefault();var U=document.querySelector(".tree-search-input");U&&(U.focus(),U.select())}});var w=null;e.onFileSearchChange=function(){w&&(w.resolve(),w=null);let O=e.fileSearchQuery;if(!O||O.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let U=r.defer();w=U,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(O)}`,{timeout:U.promise}).then(function(C){if(!(m||w!==U)){w=null,e.fileSearchLoading=!1;var _={};e.files.forEach(function(Fe){_[(Fe.path||"")+"/"+Fe.name]=!0});for(var H=[],K={},ie=0;ie<C.data.length;ie++){var se=C.data[ie];if(se.path)for(var Y=se.path.split("/"),me="",Se=0;Se<Y.length;Se++){var Ue=me;me=me?me+"/"+Y[Se]:Y[Se];var Be=Ue+"/"+Y[Se];!_[Be]&&!K[Be]&&(K[Be]=!0,H.push({name:Y[Se],path:Ue}))}}H.sort(function(Fe,W){return(Fe.path||"").split("/").length-(W.path||"").split("/").length}),H.length>0&&e.files.push.apply(e.files,H);for(var Qe=[],He=0;He<C.data.length;He++){var tt=C.data[He],Re=(tt.path||"")+"/"+tt.name;!_[Re]&&tt.size!=null&&(Qe.push(tt),_[Re]=!0)}Qe.length>0&&e.files.push.apply(e.files,Qe),e.fileSearchResults=C.data}},function(){!m&&w===U&&(w=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})},e.on("routeUpdate",function(O,U){if(e.repoId!=i.repoId)return X();if((i.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(C=>C&&C.trim().length>0),x();for(let C=0;C<e.paths.length-1;C++){let _=C>0?e.paths.slice(0,C).join("/"):"";e.files.some(K=>K.path===_)||e.getFiles(_)}}});function N(){if(e.paths[0]!="")return;let O=["readme.md","readme.txt","readme.org","readme.1st","readme"],U={};for(let _ of e.files)_.name.toLowerCase().indexOf("readme")>-1&&(U[_.name.toLowerCase()]=_.name);let C=null;for(let _ of O)if(U[_]){C=_;break}if(!C&&Object.keys(U).length>0&&(C=Object.keys(U)[0]),C){let _=s.url();_[_.length-1]!="/"&&(_+="/"),s.url(_+encodePathForUrl(U[C]))}}e.fileCounts=null;let S=0,R=new Set,v=!1;e.getFiles=function(O,U=!1){let C=e.repoId,_=S;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(O)}&v=${e.options.lastUpdateDate}`).then(function(H){if(m||C!==e.repoId||_!==S)return[];let K=O||"";return e.files=e.files.filter(ie=>ie.path!==K),e.files.push(...H.data),e.loadedFolders={...e.loadedFolders,[K]:!0},E(K,_),H.data},function(H){if(m||C!==e.repoId||_!==S)return[];U||(e.type="error",e.content=ar(H),e.files=[])})};function E(O,U){if(v||R.has(O))return;R.add(O);let C=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts?path=${encodeURIComponent(O)}`).then(function(_){m||C!==e.repoId||U!==S||(e.fileCounts={...e.fileCounts,..._.data})},function(){
Line truncated
|
||||
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let p=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,b)=>b.length-m.length),c=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!p.length)return[{text:e.demoText}];let v=new RegExp("("+p.map(c).join("|")+")","gi"),g={},y=0;return(e.demoText||"").split(v).filter(m=>m!=="").map(m=>{let b=p.find(E=>E.toLowerCase()===m.toLowerCase());return b?(g[b.toLowerCase()]||(g[b.toLowerCase()]=++y),{text:String(g[b.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(p=>p.redacted).length,e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}],e.statsEmpty=()=>!!e.stat&&e.cards.every(p=>!p.total);function r(){t.get("/api/stat/").then(p=>{e.stat=p.data,e.cards[0].total=p.data.nbRepositories,e.cards[1].total=p.data.nbUsers,e.cards[2].total=p.data.nbPageViews,e.cards[3].total=p.data.nbPullRequests}).catch(()=>{})}r();function d(p){let c={series:p,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!p||p.length<2)return c;let v=new Array(p.length-1);for(let S=1;S<p.length;S++)v[S-1]=p[S]-p[S-1];let g=v.length,y=Math.max.apply(null,v),m=Math.min.apply(null,v),b=Math.min(0,m),E=y-b||1;c.viewW=g*2,c.bars=new Array(g);for(let S=0;S<g;S++){let N=(v[S]-b)/E,w=Math.max(1.5,N*34);c.bars[S]={x:(S*2+.25).toFixed(2),y:(36-w).toFixed(2),w:"1.5",h:w.toFixed(2)}}if(c.deltaToday=v[g-1],g>=2){let S=v[g-2];S&&(c.pctChange=(c.deltaToday-S)/S*100)}return c.pctAbs=Math.round(Math.abs(c.pctChange)),c.isUp=c.pctChange>=0,c}e.history={repositories:d([]),users:d([]),pageViews:d([]),pullRequests:d([])},t.get("/api/stat/history?days=60").then(p=>{let c=p.data||[];e.history={repositories:d(c.map(v=>v.nbRepositories||0)),users:d(c.map(v=>v.nbUsers||0)),pageViews:d(c.map(v=>v.nbPageViews||0)),pullRequests:d(c.map(v=>v.nbPullRequests||0))}}).catch(()=>{})},Uc=function(e,t,s,i,o,r){let d=kt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),d.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,je(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Bt()(document,"click",k=>{e.quotaExpanded&&!k.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=k=>k.status==="error"||k._broken||c(k.status)==="progress"&&k._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=k=>{e.projectView=k,k==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=k=>{let L=va(k?.anonymizeDate||k?.lastView)||"";return/ ago$/.test(L)?"No activity for "+L.replace(/ ago$/,""):"No activity since "+L.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=k=>"project-details-"+encodeURIComponent(k._type+":"+(k._id||k._source||"unknown")),e.showProjectDetails=async k=>{e.selectedProject=k,e.projectName=k.projectName||"",e.nameError="",e.nameMessage="",await je();let L=document.getElementById(e.projectDetailsId(k));L?.focus(),L?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=k=>{e.selectedProject=null,je(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(k._type+":"+k._id)}"]`)?.focus())},e.saveProjectName=async k=>{if(e.nameSaving||!k._id)return;let L=e.projectName.trim();if(L.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let W=await t.post("/api/user/project-name",{type:k._type,id:k._id,name:L});k.projectName=W.data.name,k._label=k.projectName||k._fallbackLabel,e.selectedProject===k&&(e.nameMessage=L?"Project name saved.":"Default project name restored."),D||(e.dashboardCursor=null,await _(),e.selectedProject===k&&(e.selectedProject=e.items.find(z=>z._type===k._type&&z._id===k._id)||null))}catch{e.selectedProject===k&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async k=>{if(!k._viewUrl||e.copyingId)return;let L=new URL(k._viewUrl,o.location.origin).href;e.copyingId=k._type+":"+k._id;try{await Wa(L),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:L})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"Preparing",error:"Error",expired:"Expiring / expired",removed:"Removing / removed"};let p=["queue","download","downloaded","preparing","anonymizing"];function
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,B.options),e.options.expirationDate=B.options&&B.options.expirationDate?new Date(B.options.expirationDate):F(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),C&&C()})}function G(C,M,B){e.anonymize&&e.anonymize[C]&&e.anonymize[C].setValidity(M,B)}function ue(C){try{let M=parseGithubUrl(C);if(M&&M.owner&&M.repo)return M.owner+"/"+M.repo}catch{}return null}e.accessRepairAllowed=!1,e.repairingGitHubAccess=!1,e.accessRepairMessage="",e.repairGitHubAccess=async()=>{if(!e.accessRepairAllowed||e.repairingGitHubAccess||!e.githubConnections?.appEnabled||!i.repoId||e.role!=="owner"||e.githubConnection!=="github-app"||ue(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let C=m();try{let M=await t.get("/github/connections");if(e.githubConnections=M.data,!M.data.appEnabled)return;let B=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":M.data.csrf}});if(!y(C))return;e.error=null,B.data.fullName&&(e._originalFullName=B.data.fullName,e.source.fullName=B.data.fullName,e.sourceUrl="https://github.com/"+B.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{y(C)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,b(C)}},e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await We()}catch{}}};function he(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:ue(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function Me(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function Ue(){let C=new URLSearchParams(window.location.search).get("billingDraft");if(C){N.restore();try{let B=(await t.get("/api/billing/draft/"+encodeURIComponent(C))).data;if(B.path!==o.path())throw new Error("Wrong task");w=B.values.conference||null;for(let Y of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(B.values,Y)&&(e[Y]=B.values[Y]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),D=B.id,O=JSON.stringify(N.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await Me(),o.replace?.(o.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let M;try{M=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!M||M.path!==o.path()||Date.now()-M.savedAt>=30*6e4)return N.restore()?(e.sourceUrl&&await Me(),!0):!1;N.restore();for(let B of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(M.draft,B)&&(e[B]=M.draft[B]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await Me(),sessionStorage.removeItem("github-access-draft"),!0}ne(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&d(Ue,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async C=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(C.data.status),e.githubConnection=C.data.connection||"oauth",e.sourceUrl="https://github.com/"+C.data.source.fullName,e._originalFullName=C.data.source.fullName,e.terms=C.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=C.data.source,e.role=C.data.role||"owner",e._existingNever=C.data.options.expirationMode==="never",e._savedExpirationDate=C.data.options.expirationDate?new Date(C.data.options.expirationDate):null,e.coauthors=C.data.coauthors||[],e._originalBranch=C.data.source.branch,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,e.repositoryID=C.data.source.repositoryID,e._originalRepositoryID=C.data.source.repositoryID,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),E=S(parseGithubUrl(e.sourceUrl)),!await Ue()&&(await Promise.all([We(),ze()]),ko())},()=>{o.url("/404")})),i.pullRequestId&&i.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=i.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async C=>{if(e.githubConnection=C.data.connection||"oauth",e.sourceUrl="https://github.com/"+C.data.source.repositoryFullName+"/pull/"+C.data.source.pullRequestId,e.terms=C.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=C.data.source,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),E=S(parseGithubUrl(e.sourceUrl)),!await Ue())try{await Qa()}catch{}},()=>{o.url("/404")})),i.gistId&&i.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=i.gistId,t.get("/api/gist/"+e.gistId).then(async C=>{e.sourceUrl="https://gist.github.com/"+C.data.source.gistId,e.terms=C.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=C.data.source,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),E=S(parseGithubUrl(e.sourceUrl)),!await Ue()&&await Za()},()=>{o.url("/404")}))}),t.get("/github/connections").then(C=>{e.githubConnections=C.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&C.data.appEnabled&&C.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&Me())}).catch(()=>{}),e.urlSelected=async(C=!1)=>{let M=++c;e.previousConfigurations=[],e.previousConfigurationId="";let B;try{B=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,Yt.cancel(),An.cancel(),In.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",G("sourceUrl","github",!1);return}let Y=S(B),ce=C||E===Y;E=Y,e.sourceUrlError="",G("sourceUrl","github",!0);let be=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let Je=window.document.getElementById("sourceUrl");if(Je){try{Je.setSelectionRange(0,0)}catch{}Je.scrollLeft=0}},50),be&&d(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!ce&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],ce||(e.source={type:"GitHubStream",branch:"",commit:""}),Yt.cancel(),An.cancel(),In.cancel(),Co.clear(),So.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",dt(),e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=ce;try{B.gistId&&!B.repo?(e.detectedType="gist",e.source={gistId:B.gistId},await Za()):B.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:B.owner+"/"+B.repo,pullRequestId:B.pullRequestId},await Qa()):(e.detectedType="repo",L(),await Promise.all([We(),ze()]),ko())}catch{}finally{M===c&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let C=e.branches.filter(B=>B.name==e.source.branch)[0];if(!C)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=C.commit),e.readme=C.readme,await ze(),ko()}),e.getBranches=async C=>{let M=parseGithubUrl(e.sourceUrl),B=m();try{let Y=await t.get(`/api/repo/${M.owner}/${M.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&ue(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:C===!0||e.reconnectingSource?"1":"0",repositoryID:he()}});if(!y(B))return;e.branches=Y.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let ce=e.branches.filter(be=>be.name==e.source.branch);ce.length>0&&(!(!e.reconnectingSource&&!C&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=ce[0].commit),e.readme=ce[0].readme,await ze(C))}catch(Y){if(!y(B))return;e.branches=[],e.sourceUnreachable=Y&&(Y.status===404||Y.data&&Y.data.error==="repo_not_found");let ce=Y&&Y.data&&Y.data.error||(Y&&Y.status===404?"repo_not_found":"unknown_error");r("ERRORS."+ce).then(be=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:be}),e.error=be},console.error),typeof G=="function"&&G("sourceUrl","missing",!1)}finally{b(B)}};async function We(){let C=parseGithubUrl(e.sourceUrl),M=m();try{Eo();let B=await t.get(`/api/repo/${C.owner}/${C.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&ue(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:he(),force:"1"}});if(!y(M))return;e.details=B.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(B){if(!y(M))return;throw B.data&&(r("ERRORS."+B.data.error).then(Y=>{e.addToast({title:"Error",date:new Date,body:Y}),e.error=Y},console.error),No(B.data.error)),G("sourceUrl","missing",!1),B}finally{b(M)}}async function ze(C){if(e.readme&&!C)return e.readme;let M=parseGithubUrl(e.sourceUrl),B=m();try{let Y=await t.get(`/api/repo/${M.owner}/${M.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&ue(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:C===!0?"1":"0",branch:e.source.branch,repositoryID:he()}});y(B,!0)&&(e.readme=Y.data)}catch{y(B,!0)&&(e.readme="")}finally{b(B)}}let tt={magicalBraces:!0},Re=C=>C.startsWith("/")&&!C.endsWith("/")&&zn(yo(C.slice(1),tt),tt)===C.slice(1),Be=()=>Object.keys(e.preserve.picked).filter(C=>e.preserve.pick
Line truncated
|
||||
`).map(C=>C.trim()).filter(Boolean),pe=null,ye=null,Ve=new Set,P=0,A=null,U=()=>!1;function x(){let C=P+"\0"+e.preserve.patterns;if(C!==A){A=C;try{U=ja(Ha([...Be(),...de()]))}catch{U=()=>!1}}return U}function K(C){let M=new Map([["",{dirs:[],files:[]}]]);for(let B of C){let Y=B.split("/"),ce="";for(let be=0;be<Y.length-1;be++){let Je=Y.slice(0,be+1).join("/");M.has(Je)||(M.set(Je,{dirs:[],files:[]}),M.get(ce).dirs.push(Je)),ce=Je}M.get(ce).files.push(B)}for(let B of M.values())B.dirs.sort();return{files:C,dirs:M,descendants:new Map}}function ee(C){return pe.descendants.has(C)||pe.descendants.set(C,pe.files.filter(M=>M.startsWith(C+"/"))),pe.descendants.get(C)}let le=C=>x()(C);function se(C){let M=ee(C),B=0;for(let Y of M)le(Y)&&B++;return B===0?"none":B===M.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let C=(e.options?.preserveFiles||[]).map(M=>String(M).trim()).filter(Boolean).map(M=>Re(M)?yo(M.slice(1),tt):M);return C.length?C.slice(0,2).join(", ")+(C.length>2?` and ${C.length-2} more`:""):"None. Every file is redacted."};async function ie(){let C=e.source?.commit;if(!(pe&&e.preserve.commit===C)){e.preserve.loading=!0,e.preserve.error="",pe=null,ye=null;try{let M=parseGithubUrl(e.sourceUrl),B=await t.get(`/api/repo/${M.owner}/${M.repo}/tree`,{params:{commit:C,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&ue(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:he()}});if(e.source?.commit!==C)return;let Y=Array.isArray(B.data.binaryFiles)?B.data.binaryFiles:[];pe=un(K(B.data.files||[])),ye=Y.length?un(K([...B.data.files||[],...Y])):pe,Ve=un(new Set(Y)),e.preserve.commit=C,e.preserve.truncated=!!B.data.truncated,e.previewFile||Yt()}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",C=>{e.previewFile&&e.openPreviewFile(""),e.detectedType==="repo"&&C&&e.sourceUrl&&ie().catch(()=>{})}),e.openPreserveFiles=()=>{let C={},M=[];for(let Y of e.options?.preserveFiles||[]){let ce=String(Y).trim();ce&&(!M.length&&Re(ce)?C[yo(ce.slice(1),tt)]=!0:M.push(ce))}let B={};for(let Y of Object.keys(C)){let ce=Y.split("/");for(let be=1;be<ce.length;be++)B[ce.slice(0,be).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:C,expanded:B,patterns:M.join(`
|
||||
`),patternsOpen:M.length>0}),e.mobileWorkspace&&(e.mobilePane="settings"),P++,d(()=>{let Y=document.getElementById("preserve-files-dialog");Y?.showModal&&!Y.open&&Y.showModal(),document.getElementById("preserve-files-search")?.focus()},0),ie()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=Ha([...Be(),...de()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!pe)return[];let C=x(),M=(be,Je,Lt)=>{let bt=!!e.preserve.picked[be],Jn=C(be);return{kind:"file",path:be,label:Lt,depth:Je,state:Jn?"all":"none",locked:!bt&&Jn,note:!bt&&Jn?"matched by a pattern":bt&&!Jn?"excluded by a pattern":""}},B=String(e.preserve.search||"").trim().toLowerCase();if(B)return pe.files.filter(be=>be.toLowerCase().includes(B)).slice(0,300).map(be=>M(be,0,be));let Y=[],ce=(be,Je)=>{let Lt=pe.dirs.get(be);for(let bt of Lt.dirs){let Jn=!!e.preserve.expanded[bt],xa=de().includes(X(bt));Y.push({kind:"dir",path:bt,label:bt.slice(be?be.length+1:0)+"/",depth:Je,open:Jn,state:se(bt),locked:!1,note:xa?"whole folder":""}),Jn&&ce(bt,Je+1)}for(let bt of Lt.files)Y.push(M(bt,Je,bt.slice(be?be.length+1:0)))};return ce("",0),Y},e.preserveCount=()=>pe?pe.files.filter(le).length:0,e.togglePreserveDir=C=>{e.preserve.expanded[C]=!e.preserve.expanded[C]},e.togglePreserveFile=C=>{e.preserve.picked[C]=!e.preserve.picked[C],P++},e.togglePreserveFolder=C=>{let M=X(C),B=me(C),Y=de().filter(be=>be!==M&&be!==B),ce=se(C)==="all"||de().includes(M);for(let be of ee(C))e.preserve.picked[be]=!1;P++,e.preserve.patterns=(ce?Y:[...Y,M]).join(`
|
||||
`),ce&&ee(C).some(le)&&(e.preserve.patterns=[...Y,B].join(`
|
||||
`))};let te=/^readme(\.[^/]*)?$/i,Ce=[".md",".markdown",".mdown",".mkdn",".rst",".txt",""],fe=["README.md","README","README.markdown","README.rst","README.txt","readme.md"],Ee=C=>{let M=z(C),B=M.indexOf("."),Y=Ce.indexOf(B===-1?"":M.slice(B).toLowerCase());return Y===-1?Ce.length:Y},Te=()=>!!pe&&!!e.preserve.commit&&e.preserve.commit===e.source?.commit;e.readmePath=()=>{if(!Te())return"";for(let C of[".github","","docs"]){let M=(pe.dirs.get(C)?.files||[]).filter(B=>te.test(z(B)));if(M.length)return M.sort((B,Y)=>Ee(B)-Ee(Y)||W(B,Y))[0]}return""},e.readmeName=()=>z(e.readmePath())||"README.md";let qe={key:null,fn:()=>!1},Ke=()=>{let C=(e.options?.preserveFiles||[]).map(B=>String(B).trim()).filter(Boolean),M=C.join(`
|
||||
`);if(M!==qe.key){let B=()=>!1;try{C.length&&(B=ja(C))}catch{}qe={key:M,fn:B}}return qe.fn};e.pathPreserved=C=>!!C&&Ke()(C),e.readmePreserved=()=>{if(e.detectedType!=="repo")return!1;let C=Ke();if(Te()){let M=e.readmePath();return!!M&&C(M)}return fe.some(M=>C(M))},e.previewPreserved=()=>e.detectedType==="repo"&&(e.previewFile?e.pathPreserved(e.previewFile):e.readmePreserved());function He(){let C={terms:e.terms?e.terms.split(`
|
||||
`):[],filePath:e.previewOpenPath()||"README.md",preserveFiles:e.options.preserveFiles||[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(C.branchName=e.source.branch);try{let M=parseGithubUrl(e.sourceUrl);C.repoName=`${M.owner}/${M.repo}`}catch{}return C}function ke(C,M,B){let Y=null,ce=0,be=()=>{if(e.detectedType!==C)return;Y&&d.cancel(Y);let Je=++ce;e.previewStatus="loading",Y=d(()=>{Y=null;let Lt=M();if(!Lt){e.previewStatus="idle";return}t.post("/api/anonymize-preview",Lt).then(bt=>{Je===ce&&(B(bt.data,Lt),e.previewStatus="ready")}).catch(()=>{Je===ce&&(e.previewStatus="error")})},200)};return be.cancel=()=>{ce++,Y&&d.cancel(Y),Y=null},e.on("dispose",be.cancel),be}e.retryPreview=()=>{e.detectedType==="repo"&&(e.previewFile&&typeof lt!="string"?ft(e.previewFile):Yt()),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()};let we=un(qs(e));Object.defineProperty(e,"previewViewer",{get:()=>we}),ha(we,e),Object.assign(we,{options:{},files:[],paths:[],content:null,type:"loading",sidebarHidden:!1,sidebarCollapsed:!0,moreOpen:!1,tocOpen:!1,gotoOpen:!1,mdFindOpen:!1,mdFindQuery:"",mdFindTotal:0,mdFindIndex:0}),we.preview=!0,we.fileSize=C=>C===we.filePath&&typeof lt=="string"?new Blob([lt]).size:!e.previewFile&&e.readme?new Blob([e.readme]).size:null,we.openPreserveFiles=()=>e.openPreserveFiles(),we.previewPreserved=()=>e.previewPreserved(),we.retryContent=()=>e.retryPreview();let it=C=>Ve.has(C)||/\.(pdf|png|jpe?g|gif|svg|ico|bmp|tiff?|webp|avif|heic|heif|mp4|webm|mp3|wav|zip|bin)$/i.test(C),at=(C="")=>({path:C,loading:!1,note:"",loadError:""});e.previewFile="",e.previewDoc=at();let yt=0,lt=null;e.previewOpenPath=()=>e.previewFile||e.readmePath(),e.openPreviewFile=C=>{if(C=C||"",C&&C===e.readmePath()&&(C=""),yt++,lt=null,Yn(),Yt.cancel(),e.previewFile=C,e.previewDoc=at(C),we.sidebarCollapsed=!0,we.content=null,!C){e.readme?Yt():e.previewStatus="idle";return}if(it(C)){cr("binary"),e.previewStatus="ready";return}ft(C)};function dt(){yt++,lt=null,e.previewFile="",e.previewDoc=at(),we.sidebarCollapsed=!0,we.content=null}function ft(C){let M=++yt;lt=null,Object.assign(e.previewDoc,{loading:!0,loadError:""}),e.previewStatus="loading";let B;try{B=parseGithubUrl(e.sourceUrl)}catch{B=null}if(!B||!e.source?.commit){Object.assign(e.previewDoc,{loading:!1,loadError:"The repository is still loading. Try again in a moment."}),e.previewStatus="error";return}t.get(`/api/repo/${B.owner}/${B.repo}/file`,{params:{commit:e.source.commit,path:C,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&ue(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:he()},transformResponse:Y=>Y}).then(Y=>{if(M!==yt)return;e.previewDoc.loading=!1;let ce=typeof Y.headers=="function"&&Y.headers("content-type")||"";if(/json/i.test(ce)){let be=null;try{be=JSON.parse(Y.data)}catch{}if(be&&be.binary===!0){cr("binary"),e.previewStatus="ready";return}}lt=typeof Y.data=="string"?Y.data:"",Yt()},Y=>{if(M!==yt)return;e.previewDoc.loading=!1;let ce=ar(Y);if(ce==="file_too_big"){cr("too_big"),e.previewStatus="ready";return}e.previewDoc.loadError=Kn.ERRORS[ce]||"GitHub did not return this file.",e.previewStatus="error"})}let qt;function Yn(){qt&&window.URL.revokeObjectURL(qt),qt=void 0,we.url=void 0}e.on("dispose",Yn);function cr(C){Yn(),e.previewDoc.note=C,we.prepareFile(e.previewPathName(e.previewOpenPath()||e.readmeName())),we.type=C==="too_big"?"error":"binary",we.content=C==="too_big"?"file_too_big":"binary"}function ef(C){try{let M=parseGithubUrl(e.sourceUrl),B=e.source.branch||e.details&&e.details.defaultBranch||"main",Y=C&&C.includes("/")?C.slice(0,C.lastIndexOf("/")+1):"";return`https://github.com/${M.owner}/${M.repo}/raw/${B}/${Y}`}catch{return""}}let Xa=ke("repo",()=>e.previewFile?typeof lt!="string"?null:{content:lt,options:He()}:e.readme?{content:e.readme,options:He()}:null,C=>{if(typeof C?.content!="string")throw Error("Invalid preview response");Yn(),window.URL?.createObjectURL&&(we.url=qt=window.URL.createObjectURL(new Blob([C.content],{type:"text/plain"})));let M=e.previewOpenPath()||e.readmeName();we.prepareFile(e.previewPathName(M)),we.fileBaseUrl=ef(M),we.renderFileContent(C.content,we.type,we.fileBaseUrl,"text/plain"),e.previewFile||(e.anonymize_readme=C.content)}),Yt=()=>{e.previewFile&&typeof lt!="string"||Xa()};Yt.cancel=Xa.cancel;let wo=st(new Map),pr=new Set,fr=new Set,xo="",es=null,xs=()=>String(e.terms||"").split(`
|
||||
`).filter(C=>C.trim());function tf(){es=null;let C=xs(),M=C.join(`
|
||||
`);M!==xo&&(wo.clear(),fr.clear(),xo=M);let B=[...pr].filter(Y=>!wo.has(Y));if(pr.clear(),!(!B.length||!C.length))for(let Y=0;Y<B.length;Y+=400){let ce=B.slice(Y,Y+400);t.post("/api/anonymize-preview",{contents:ce,options:{terms:C,image:!0,link:!0}}).then(be=>{if(xo!==M||xs().join(`
|
||||
`)!==M)return;let Je=be.data?.contents;if(!Array.isArray(Je)||Je.length!==ce.length)throw Error("Invalid preview response");ce.forEach((Lt,bt)=>wo.set(Lt,typeof Je[bt]=="string"?Je[bt]:Lt))}).catch(()=>{xo===M&&ce.forEach(be=>fr.add(be))})}}e.previewName=C=>{if(!C||!xs().length)return C;if(xo===xs().join(`
|
||||
`)){if(wo.has(C))return wo.get(C);if(fr.has(C))return C}return pr.add(C),es||(es=d(tf,120)),C},e.previewPathName=C=>{C=String(C||"");let M=C.lastIndexOf("/");return M<0?e.previewName(C):e.previewName(C.slice(0,M))+"/"+e.previewName(C.slice(M+1))},e.watch(()=>[e.repoId,e.previewPathName(e.previewOpenPath()||e.readmeName()),e.previewTreeFiles()],()=>{we.repoId=e.repoId||"repository",we.filePath=e.previewPathName(e.previewOpenPath()||e.readmeName()),we.paths=we.filePath.split("/"),we.files=e.previewTreeFiles(),we.loadedFolders=Object.fromEntries([...ye?.dirs.keys()||[]].map(C=>[e.previewName(C),!0]))},!0),e.on("dispose",()=>{es&&d.cancel(es)});function ko(){!e.anonymize||!e.anonymize.terms||Yt()}async function Qa(){let C=parseGithubUrl(e.sourceUrl),M=m();try{Eo();let B=await t.get(`/api/pr/${C.owner}/${C.repo}/${C.pullRequestId}`,{params:{connection:e.githubConnection}});if(!y(M))return;e.details=B.data,e.pullRequestId||(e.pullRequestId=C.repo+"-PR"+C.pullRequestId+"-"+generateRandomId(4))}catch(B){if(!y(M))return;throw B.data&&(r("ERRORS."+B.data.error).then(Y=>{e.addToast({title:"Error",date:new Date,body:Y}),e.error=Y},console.error),No(B.data.error)),G("sourceUrl","missing",!1),B}finally{b(M)}}let Co=st(new Map);function nf(){let C=new Set,M=e.details&&e.details.pullRequest;if(!M)return C;typeof M.title=="string"&&C.add(M.title),typeof M.body=="string"&&C.add(M.body),typeof M.diff=="string"&&C.add(M.diff);let B=M.comments||[];for(let Y of B)typeof Y.author=="string"&&C.add(Y.author),typeof Y.body=="string"&&C.add(Y.body);return C}let An=ke("pr",()=>{let C=nf(),M=Array.from(C);return M.length===0?null:{contents:M,options:He()}},(C,M)=>{if(!Array.isArray(C?.contents)||C.contents.length!==M.contents.length||C.contents.some(ce=>typeof ce!="string"))throw Error("Invalid preview response");let B=M.contents,Y=new Map;for(let ce=0;ce<B.length&&ce<C.contents.length;ce++)Y.set(B[ce],C.contents[ce]);Co.clear(),Y.forEach((ce,be)=>Co.set(be,ce))});e.anonymizePrContent=function(C){return C&&(Co.has(C)?Co.get(C):"")};async function Za(){let C=parseGithubUrl(e.sourceUrl),M=m();try{Eo(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let B=await t.get(`/api/gist/source/${C.gistId}`);if(!y(M))return;e.details=B.data,e.gistId||(e.gistId="gist-"+C.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(B){if(!y(M))return;if(B.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,G("sourceUrl","missing",!1);return}if(B.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,G("sourceUrl","missing",!1);return}throw B.data&&(r("ERRORS."+B.data.error).then(Y=>{e.addToast({title:"Error",date:new Date,body:Y}),e.error=Y},console.error),No(B.data.error)),G("sourceUrl","missing",!1),B}finally{b(M)}}let So=st(new Map);function of(){let C=new Set,M=e.details&&e.details.gist;if(!M)return C;typeof M.description=="string"&&C.add(M.description),typeof M.ownerLogin=="string"&&C.add(M.ownerLogin);let B=M.files||[];for(let ce of B)typeof ce.filename=="string"&&C.add(ce.filename),typeof ce.content=="string"&&C.add(ce.content);let Y=M.comments||[];for(let ce of Y)typeof ce.author=="string"&&C.add(ce.author),typeof ce.body=="string"&&C.add(ce.body);return C}let In=ke("gist",()=>{let C=of(),M=Array.from(C);return M.length===0?null:{contents:M,options:He()}},(C,M)=>{if(!Array.isArray(C?.contents)||C.contents.length!==M.contents.length||C.contents.some(ce=>typeof ce!="string"))throw Error("Invalid preview response");let B=M.contents,Y=new Map;for(let ce=0;ce<B.length&&ce<C.contents.length;ce++)Y.set(B[ce],C.contents[ce]);So.clear(),Y.forEach((ce,be)=>So.set(be,ce)),mr()});e.anonymizeGistContent=function(C){return C&&(So.has(C)?So.get(C):"")},e.previewGistFiles=[];function mr(){let C=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=C.map(M=>({filename:e.anonymizeGistContent(M.filename),content:e.anonymizeGistContent(M.content),language:M.language}))}e.watch("details.gist.files",mr,!0),e.watch("terms",mr);function sf(){let C=e.conference;if(e.conference_data=null,!C)return;let M=C===w||e.isUpdate&&C===e._originalConference;C!==w&&(w=null),t.get("/api/conferences/"+C).then(B=>{e.conference===C&&(e.conference_data=B.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!M&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.image,e.options.pdf=e.conference_data.options.pdf,e.options.notebook=e.conference_data.options.notebook,e.options.link=e.conference_data.options.link))},()=>{e.conference===C&&(e.conference_data=null)})}function Eo(){G("repoId","used",!0),G("repoId","format",!0),G("pullRequestId","used",!0),G("pullRequestId","format",!0),G("gistId","used",!0),G("gistId","format",!0),G("sourceUrl","used",!0),G("sourceUrl","missing",!0),G("sourceUrl","access",!0),G("sourceUrl","github",!0),G("commit","exi
Line truncated
|
||||
`).filter(be=>be),connection:e.githubConnection,fullName:`${B.owner}/${B.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(Y.options.pageSource=e.details.pageSource),Eo();let ce=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(ce,Y,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/status/"+e.repoId},be=>{if(be.data){let Je=["quota_exceeded","subscription_required_for_never_expiration"].includes(be.data.error);Je||r("ERRORS."+be.data.error).then(Lt=>{e.error=Lt},console.error),No(be.data.error),Je&&(be.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,je(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"})))}}).finally(()=>{M.disabled=!1})},e.anonymizeGist=C=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ei())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let M=C.currentTarget||C.target.closest?.("button")||C.target;M.disabled=!0;let B=parseGithubUrl(e.sourceUrl),Y={gistId:e.gistId,terms:e.terms.trim().split(`
|
||||
`).filter(be=>be),source:{gistId:B.gistId},options:e.options,conference:e.conference};Eo();let ce=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(ce,Y,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/gist/"+e.gistId},be=>{be.data&&(r("ERRORS."+be.data.error).then(Je=>{e.error=Je},console.error),No(be.data.error))}).finally(()=>{M.disabled=!1})},e.anonymizePullRequest=C=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ei())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let M=C.currentTarget||C.target.closest?.("button")||C.target;M.disabled=!0;let B=parseGithubUrl(e.sourceUrl),Y={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
|
||||
`).filter(be=>be),source:{repositoryFullName:`${B.owner}/${B.repo}`,pullRequestId:B.pullRequestId},options:e.options,conference:e.conference};Eo();let ce=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(ce,Y,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/pr/"+e.pullRequestId},be=>{be.data&&(r("ERRORS."+be.data.error).then(Je=>{e.error=Je},console.error),No(be.data.error))}).finally(()=>{M.disabled=!1})},e.watch("conference",()=>{sf()}),e.termHints=[],e.matchTermAsWritten=C=>{e.terms=Ic(e.terms,C)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&Yt()}),e.watch("terms",()=>{e.termHints=Ac(e.terms),e.detectedType==="repo"&&ko(),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ko(),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ko(),e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()}),e.watch("details",()=>{e.detectedType==="pr"&&An(),e.detectedType==="gist"&&In()},!0)},Ka=function(e,t,s,i,o,r){ha(e);let d=kt();Mc();let p=Bt(),c=0,v=null,g=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function y(){v&&(v.resolve(),v=null),g&&(d.timeout.cancel(g),g=null)}let m=!1;e.on("dispose",()=>{m=!0,c++,y(),b&&b.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,p(document,"click",I=>{e.symbolsOpen&&!I.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!I.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.tocOpen&&!I.target.closest?.(".tb-toc-m")&&(e.tocOpen=!1),e.gotoOpen&&I.target.isConnected&&!I.target.closest?.(".goto-pop, .btn-goto, .tb-more")&&(e.gotoOpen=!1),e.accountOpen&&!I.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!I.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),p(document,"keydown",I=>{I.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.tocOpen=!1,e.gotoOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(I.ctrlKey||I.metaKey)&&!I.altKey&&I.key&&I.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(I.preventDefault(),e.toggleMdFind(!0))}),p(document,"keydown",function(I){if((I.metaKey||I.ctrlKey)&&I.key==="k"){I.preventDefault();var q=document.querySelector(".tree-search-input");q&&(q.focus(),q.select())}});var b=null;e.onFileSearchChange=function(){b&&(b.resolve(),b=null);let I=e.fileSearchQuery;if(!I||I.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let q=r.defer();b=q,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(I)}`,{timeout:q.promise}).then(function(k){if(!(m||b!==q)){b=null,e.fileSearchLoading=!1;var L={};e.files.forEach(function(Be){L[(Be.path||"")+"/"+Be.name]=!0});for(var W=[],z={},J=0;J<k.data.length;J++){var ne=k.data[J];if(ne.path)for(var G=ne.path.split("/"),ue="",he=0;he<G.length;he++){var Me=ue;ue=ue?ue+"/"+G[he]:G[he];var Ue=Me+"/"+G[he];!L[Ue]&&!z[Ue]&&(z[Ue]=!0,W.push({name:G[he],path:Me}))}}W.sort(function(Be,X){return(Be.path||"").split("/").length-(X.path||"").split("/").length}),W.length>0&&e.files.push.apply(e.files,W);for(var We=[],ze=0;ze<k.data.length;ze++){var tt=k.data[ze],Re=(tt.path||"")+"/"+tt.name;!L[Re]&&tt.size!=null&&(We.push(tt),L[Re]=!0)}We.length>0&&e.files.push.apply(e.files,We),e.fileSearchResults=k.data}},function(){!m&&b===q&&(b=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})},e.on("routeUpdate",function(I,q){if(e.repoId!=i.repoId)return H();if((i.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(k=>k&&k.trim().length>0),F();for(let k=0;k<e.paths.length-1;k++){let L=k>0?e.paths.slice(0,k).join("/"):"";e.files.some(z=>z.path===L)||e.getFiles(L)}}});function E(){if(e.paths[0]!="")return;let I=["readme.md","readme.txt","readme.org","readme.1st","readme"],q={};for(let L of e.files)L.name.toLowerCase().indexOf("readme")>-1&&(q[L.name.toLowerCase()]=L.name);let k=null;for(let L of I)if(q[L]){k=L;break}if(!k&&Object.keys(q).length>0&&(k=Object.keys(q)[0]),k){let L=s.url();L[L.length-1]!="/"&&(L+="/"),s.url(L+encodePathForUrl(q[k]))}}e.fileCounts=null;let S=0,N=new Set,w=!1;e.getFiles=function(I,q=!1){let k=e.repoId,L=S;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(I)}&v=${e.options.lastUpdateDate}`).then(function(W){if(m||k!==e.repoId||L!==S)return[];let z=I||"";return e.files=e.files.filter(J=>J.path!==z),e.files.push(...W.data),e.loadedFolders={...e.loadedFolders,[z]:!0},D(z,L),W.data},function(W){if(m||k!==e.repoId||L!==S)return[];q||(e.type="error",e.content=ar(W),e.files=[])})};function D(I,q){if(w||N.has(I))return;N.add(I);let k=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts?path=${encodeURIComponent(I)}`).then(function(L){m||k!==e.repoId||q!==S||(e.fileCounts={...e.fileCounts,...L.data})},function(){m||k!=
Line truncated
|
||||
`).length+1)),placeholder:`Jane Smith
|
||||
MIT CSAIL
|
||||
jane.smith@example.org`},null,10,wI),[[d,{state:e.viewState,set:u=>{e.terms=u},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[126]||(t[126]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",kI,[t[121]||(t[121]=n("summary",null,"Regex & replacement syntax",-1)),t[122]||(t[122]=g()),n("small",CI,[t[115]||(t[115]=g("Regex is supported. Replaced by ",-1)),n("code",null,c(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[116]||(t[116]=g(", or use ",-1)),t[117]||(t[117]=n("code",null,"term=>replacement",-1)),t[118]||(t[118]=g(" to pick your own (e.g. ",-1)),t[119]||(t[119]=n("code",null,"Anonymous=>ABC",-1)),t[120]||(t[120]=g(").",-1))])]),(a(!0),l(q,null,J((e.termHints||[]).slice(0,3),u=>(a(),l("div",{class:"term-hint",key:u.line},[n("span",null,[t[123]||(t[123]=g("In ",-1)),n("code",null,c(u.term),1),t[124]||(t[124]=g(", ",-1)),n("code",null,c(u.symbols.join(" ")),1),g(" "+c(u.symbols.length>1?"are regex symbols":"is a regex symbol")+", so it may not match the text as written.",1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm",onClick:y=>e.matchTermAsWritten(u.line)},"Match as written",8,EI)]))),128)),(e.termHints||[]).length>3?(a(),l("div",SI,c(e.termHints.length-3)+" more "+c(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):f("v-if",!0),A(n("div",NI,"Terms are in an invalid format.",512),[[Z,e.anonymize?.terms?.errors?.format]])]),A(n("div",RI,[n("div",PI,[t[127]||(t[127]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",DI,c(e.preserveSummary()),1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm","aria-describedby":"preserve-files-label",disabled:!e.source?.commit,onClick:t[22]||(t[22]=u=>e.openPreserveFiles())},c((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,TI)],512),[[Z,e.detectedType==="repo"]]),e.preserve?.open?(a(),l("dialog",{key:0,id:"preserve-files-dialog",class:"preserve-dialog","aria-labelledby":"preserve-files-title",onCancel:t[27]||(t[27]=ae(u=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[26]||(t[26]=ae(u=>e.savePreserveFiles(),["prevent"]))},[t[131]||(t[131]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[132]||(t[132]=n("p",{class:"preserve-intro"},"Checked files are shown exactly as written, for example a bibliography where redacted self-citations would reveal you. File names are still redacted.",-1)),A(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[23]||(t[23]=u=>e.preserve.search=u)},null,512),[[st,e.preserve.search]]),n("div",AI,[e.preserve.loading?(a(),l("p",II,"Loading files from GitHub\u2026")):e.preserve.error?(a(),l("p",OI,c(e.preserve.error),1)):(a(),l(q,{key:2},[(a(!0),l(q,null,J(e.preserveRows(),(u,y)=>(a(),l("div",{class:"preserve-item",key:u.kind+":"+u.path,style:Ae({paddingLeft:u.depth*18+6+"px"})},[u.kind==="dir"?(a(),l("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":u.open?"true":"false","aria-label":(u.open?"Collapse ":"Expand ")+u.label,onClick:h=>e.togglePreserveDir(u.path)},c(u.open?"\u25BE":"\u25B8"),9,MI)):(a(),l("span",VI)),n("input",{type:"checkbox",id:"pf-"+y,"aria-label":u.kind==="dir"?"Leave folder "+u.path+" unredacted":null,checked:u.state==="all",".indeterminate":u.state==="some",disabled:u.locked,onChange:h=>u.kind==="dir"?e.togglePreserveFolder(u.path):e.togglePreserveFile(u.path)},null,40,qI),n("label",{for:u.kind==="file"?"pf-"+y:null,class:"preserve-name",onClick:h=>u.kind==="dir"&&e.togglePreserveDir(u.path)},c(u.label),9,LI),u.note?(a(),l("span",$I,c(u.note),1)):f("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(a(),l("p",_I,c(e.preserve.search?"No file matches your search.":"No text files in this commit."),1)):f("v-if",!0)],64))]),e.preserve.truncated?(a(),l("p",FI,"This repository has too many files to list them all. Use a pattern for files you cannot find.")):f("v-if",!0),n("details",{class:"preserve-patterns",open:e.preserve.patternsOpen},[t[128]||(t[128]=n("summary",null,"Patterns",-1)),A(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
|
||||
paper/appendix/**`,"onUpdate:modelValue":t[24]||(t[24]=u=>e.preserve.patterns=u)},null,512),[[st,e.preserve.patterns]]),t[129]||(t[129]=n("small",{class:"form-text text-muted"},[g("One per line, as in .gitignore: "),n("code",null,"*.bib"),g(" matches in any folder; "),n("code",null,"/refs.bib"),g(" and "),n("code",null,"paper/refs.bib"),g(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),g(" covers everything inside it; "),n("code",null,"!private.bib"),g(" excludes again.")],-1))],8,UI),n("div",BI,[n("span",zI,c(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",HI,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[25]||(t[25]=u=>e.closePreserveFiles())},"Cancel"),t[130]||(t[130]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):f("v-if",!0)],512),[[Z,e.detectedType]]),A(n("section",jI,[t[153]||(t[153]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),A(n("div",null,[n("div",GI,[A(n("input",WI,null,512),[[d,{state:e.viewState,set:u=>{e.options.link=u},value:e.options?.link,form:"anonymize",options:{}}]]),t[134]||(t[134]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",KI,[A(n("input",YI,null,512),[[d,{state:e.viewState,set:u=>{e.options.image=u},value:e.options?.image,form:"anonymize",options:{}}]]),t[135]||(t[135]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",XI,[A(n("input",JI,null,512),[[d,{state:e.viewState,set:u=>{e.options.pdf=u},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[136]||(t[136]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",QI,[A(n("input",ZI,null,512),[[d,{state:e.viewState,set:u=>{e.options.notebook=u},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[137]||(t[137]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",xI,[A(n("input",{class:"form-check-input",type:"checkbox",id:"page",name:"page",disabled:!e.details?.hasPage||e.details?.pageSource&&e.details?.pageSource?.branch!==e.source?.branch},null,8,eO),[[d,{state:e.viewState,set:u=>{e.options.page=u},value:e.options?.page,form:"anonymize",options:{}}]]),t[138]||(t[138]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?f("v-if",!0):(a(),l("small",tO,c(e.fmt?.translate("WARNINGS.page_not_enabled_on_repo")),1)),e.details?.hasPage&&e.details?.pageSource?.branch&&e.source?.branch&&e.details.pageSource.branch!==e.source.branch?(a(),l("small",nO,c(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):f("v-if",!0)])],512),[[Z,e.detectedType==="repo"]]),e.detectedType==="repo"&&(e.options.image||e.options.pdf)?(a(),l("p",sO,[...t[139]||(t[139]=[g("Images and PDFs are served unchanged. Review their contents and metadata before sharing. ",-1),n("a",{href:"/faq#formats"},"Supported formats",-1)])])):f("v-if",!0),A(n("div",null,[n("div",oO,[A(n("input",iO,null,512),[[d,{state:e.viewState,set:u=>{e.options.title=u},value:e.options?.title,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",rO,[A(n("input",aO,null,512),[[d,{state:e.viewState,set:u=>{e.options.content=u},value:e.options?.content,form:"anonymize",options:{}}]]),t[141]||(t[141]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",lO,[A(n("input",dO,null,512),[[d,{state:e.viewState,set:u=>{e.options.comments=u},value:e.options?.comments,form:"anonymize",options:{}}]]),t[142]||(t[142]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",uO,[A(n("input",cO,null,512),[[d,{state:e.viewState,set:u=>{e.options.username=u},value:e.options?.username,form:"anonymize",options:{}}]]),t[143]||(t[143]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",pO,[A(n("input",fO,null,512),[[d,{state:e.viewState,set:u=>{e.options.date=u},value:e.options?.date,form:"anonymize",options:{}}]]),t[144]||(t[144]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",mO,[A(n("input",hO,null,512),[[d,{state:e.viewState,set:u=>{e.options.origin=u},value:e.options?.origin,form:"anonymize",options:{}}]]),t[145]||(t[145]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[Z,e.detectedType==="gist"]]),A(n("div",null,[n("div",gO,[A(n("input",vO,null,512),[[d,{state:e.viewState,set:u=>{e.options.title=u},value:e.options?.title,form:"anonymize",options:{}}]]),t[146]||(t[146]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",yO,[A(n("input",bO,null,512),[[d,{state:e.viewState,set:u=>{e.options.body=u},value:e.options?.body,form:"anonymize",options:{}}]]),t[147]||(t[147]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n("div",wO,[A(n("in
Line truncated
|
||||
anonymous_github`)])])])])]),f(" Limitations "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-warning"})]),g("Limitations ")]),n("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),n("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[n("div",{class:"panel-body p-3"},[n("ul",null,[n("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),n("li",null," Files larger than 8 MB are not supported. "),n("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),n("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),f(" Privacy and security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),g("Privacy and security ")]),n("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),n("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[n("div",{class:"panel-body p-3"},[n("p",null," Repository data is used to provide the anonymization service. If you purchase a plan, Stripe processes payment and billing information. When a repository is removed or expires, only its configuration is retained. This makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),n("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[n("div",{class:"panel-body p-3"},[n("p",null,[g("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),n("a",{href:"/connections"},"GitHub connections"),g(" page.")]),n("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),n("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),n("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[n("div",{class:"panel-body p-3"},[n("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),f(" Self-hosting "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#project-icon-storage"})]),g("Self"),n("span",{class:"serif-hy"},"-"),g("hosting ")]),n("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),n("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[n("div",{cla
Line truncated
|
||||
jane.smith@example.org`},null,10,o5),[[d,{state:e.viewState,set:c=>{e.terms=c},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[126]||(t[126]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",s5,[t[121]||(t[121]=n("summary",null,"Regex & replacement syntax",-1)),t[122]||(t[122]=h()),n("small",i5,[t[115]||(t[115]=h("Regex is supported. Replaced by ",-1)),n("code",null,u(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[116]||(t[116]=h(", or use ",-1)),t[117]||(t[117]=n("code",null,"term=>replacement",-1)),t[118]||(t[118]=h(" to pick your own (e.g. ",-1)),t[119]||(t[119]=n("code",null,"Anonymous=>ABC",-1)),t[120]||(t[120]=h(").",-1))])]),(a(!0),l(V,null,Q((e.termHints||[]).slice(0,3),c=>(a(),l("div",{class:"term-hint",key:c.line},[n("span",null,[t[123]||(t[123]=h("In ",-1)),n("code",null,u(c.term),1),t[124]||(t[124]=h(", ",-1)),n("code",null,u(c.symbols.join(" ")),1),h(" "+u(c.symbols.length>1?"are regex symbols":"is a regex symbol")+", so it may not match the text as written.",1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm",onClick:v=>e.matchTermAsWritten(c.line)},"Match as written",8,r5)]))),128)),(e.termHints||[]).length>3?(a(),l("div",a5,u(e.termHints.length-3)+" more "+u(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):f("v-if",!0),T(n("div",l5,"Terms are in an invalid format.",512),[[Z,e.anonymize?.terms?.errors?.format]])]),T(n("div",d5,[n("div",u5,[t[127]||(t[127]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",c5,u(e.preserveSummary()),1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm","aria-describedby":"preserve-files-label",disabled:!e.source?.commit,onClick:t[22]||(t[22]=c=>e.openPreserveFiles())},u((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,p5)],512),[[Z,e.detectedType==="repo"]]),e.preserve?.open?(a(),l("dialog",{key:0,id:"preserve-files-dialog",class:"preserve-dialog","aria-labelledby":"preserve-files-title",onCancel:t[27]||(t[27]=ae(c=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[26]||(t[26]=ae(c=>e.savePreserveFiles(),["prevent"]))},[t[131]||(t[131]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[132]||(t[132]=n("p",{class:"preserve-intro"},"Checked files are shown exactly as written, for example a bibliography where redacted self-citations would reveal you. File names are still redacted.",-1)),T(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[23]||(t[23]=c=>e.preserve.search=c)},null,512),[[nt,e.preserve.search]]),n("div",f5,[e.preserve.loading?(a(),l("p",m5,"Loading files from GitHub\u2026")):e.preserve.error?(a(),l("p",h5,u(e.preserve.error),1)):(a(),l(V,{key:2},[(a(!0),l(V,null,Q(e.preserveRows(),(c,v)=>(a(),l("div",{class:"preserve-item",key:c.kind+":"+c.path,style:Ae({paddingLeft:c.depth*18+6+"px"})},[c.kind==="dir"?(a(),l("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":c.open?"true":"false","aria-label":(c.open?"Collapse ":"Expand ")+c.label,onClick:g=>e.togglePreserveDir(c.path)},u(c.open?"\u25BE":"\u25B8"),9,g5)):(a(),l("span",v5)),n("input",{type:"checkbox",id:"pf-"+v,"aria-label":c.kind==="dir"?"Leave folder "+c.path+" unredacted":null,checked:c.state==="all",".indeterminate":c.state==="some",disabled:c.locked,onChange:g=>c.kind==="dir"?e.togglePreserveFolder(c.path):e.togglePreserveFile(c.path)},null,40,y5),n("label",{for:c.kind==="file"?"pf-"+v:null,class:"preserve-name",onClick:g=>c.kind==="dir"&&e.togglePreserveDir(c.path)},u(c.label),9,b5),c.note?(a(),l("span",w5,u(c.note),1)):f("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(a(),l("p",k5,u(e.preserve.search?"No file matches your search.":"No text files in this commit."),1)):f("v-if",!0)],64))]),e.preserve.truncated?(a(),l("p",C5,"This repository has too many files to list them all. Use a pattern for files you cannot find.")):f("v-if",!0),n("details",{class:"preserve-patterns",open:e.preserve.patternsOpen},[t[128]||(t[128]=n("summary",null,"Patterns",-1)),T(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
|
||||
paper/appendix/**`,"onUpdate:modelValue":t[24]||(t[24]=c=>e.preserve.patterns=c)},null,512),[[nt,e.preserve.patterns]]),t[129]||(t[129]=n("small",{class:"form-text text-muted"},[h("One per line, as in .gitignore: "),n("code",null,"*.bib"),h(" matches in any folder; "),n("code",null,"/refs.bib"),h(" and "),n("code",null,"paper/refs.bib"),h(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),h(" covers everything inside it; "),n("code",null,"!private.bib"),h(" excludes again.")],-1))],8,S5),n("div",E5,[n("span",N5,u(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",R5,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[25]||(t[25]=c=>e.closePreserveFiles())},"Cancel"),t[130]||(t[130]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):f("v-if",!0)],512),[[Z,e.detectedType]]),T(n("section",T5,[t[153]||(t[153]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),T(n("div",null,[n("div",D5,[T(n("input",P5,null,512),[[d,{state:e.viewState,set:c=>{e.options.link=c},value:e.options?.link,form:"anonymize",options:{}}]]),t[134]||(t[134]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",A5,[T(n("input",I5,null,512),[[d,{state:e.viewState,set:c=>{e.options.image=c},value:e.options?.image,form:"anonymize",options:{}}]]),t[135]||(t[135]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",O5,[T(n("input",M5,null,512),[[d,{state:e.viewState,set:c=>{e.options.pdf=c},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[136]||(t[136]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",V5,[T(n("input",q5,null,512),[[d,{state:e.viewState,set:c=>{e.options.notebook=c},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[137]||(t[137]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",L5,[T(n("input",{class:"form-check-input",type:"checkbox",id:"page",name:"page",disabled:!e.details?.hasPage||e.details?.pageSource&&e.details?.pageSource?.branch!==e.source?.branch},null,8,$5),[[d,{state:e.viewState,set:c=>{e.options.page=c},value:e.options?.page,form:"anonymize",options:{}}]]),t[138]||(t[138]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?f("v-if",!0):(a(),l("small",F5,u(e.fmt?.translate("WARNINGS.page_not_enabled_on_repo")),1)),e.details?.hasPage&&e.details?.pageSource?.branch&&e.source?.branch&&e.details.pageSource.branch!==e.source.branch?(a(),l("small",_5,u(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):f("v-if",!0)])],512),[[Z,e.detectedType==="repo"]]),e.detectedType==="repo"&&(e.options.image||e.options.pdf)?(a(),l("p",U5,[...t[139]||(t[139]=[h("Images and PDFs are served unchanged. Review their contents and metadata before sharing. ",-1),n("a",{href:"/faq#formats"},"Supported formats",-1)])])):f("v-if",!0),T(n("div",null,[n("div",B5,[T(n("input",z5,null,512),[[d,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",H5,[T(n("input",j5,null,512),[[d,{state:e.viewState,set:c=>{e.options.content=c},value:e.options?.content,form:"anonymize",options:{}}]]),t[141]||(t[141]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",G5,[T(n("input",W5,null,512),[[d,{state:e.viewState,set:c=>{e.options.comments=c},value:e.options?.comments,form:"anonymize",options:{}}]]),t[142]||(t[142]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",K5,[T(n("input",Y5,null,512),[[d,{state:e.viewState,set:c=>{e.options.username=c},value:e.options?.username,form:"anonymize",options:{}}]]),t[143]||(t[143]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",J5,[T(n("input",X5,null,512),[[d,{state:e.viewState,set:c=>{e.options.date=c},value:e.options?.date,form:"anonymize",options:{}}]]),t[144]||(t[144]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",Q5,[T(n("input",Z5,null,512),[[d,{state:e.viewState,set:c=>{e.options.origin=c},value:e.options?.origin,form:"anonymize",options:{}}]]),t[145]||(t[145]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[Z,e.detectedType==="gist"]]),T(n("div",null,[n("div",x5,[T(n("input",e8,null,512),[[d,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[146]||(t[146]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",t8,[T(n("input",n8,null,512),[[d,{state:e.viewState,set:c=>{e.options.body=c},value:e.options?.body,form:"anonymize",options:{}}]]),t[147]||(t[147]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n("div",o8,[T(n("in
Line truncated
|
||||
anonymous_github`)])])])])]),f(" Limitations "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-warning"})]),h("Limitations ")]),n("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),n("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[n("div",{class:"panel-body p-3"},[n("ul",null,[n("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),n("li",null," Files larger than 8 MB are not supported. "),n("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),n("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),f(" Privacy and security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),h("Privacy and security ")]),n("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),n("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[n("div",{class:"panel-body p-3"},[n("p",null," Repository data is used to provide the anonymization service. If you purchase a plan, Stripe processes payment and billing information. When a repository is removed or expires, only its configuration is retained. This makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),n("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[n("div",{class:"panel-body p-3"},[n("p",null,[h("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),n("a",{href:"/connections"},"GitHub connections"),h(" page.")]),n("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),n("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),n("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[n("div",{class:"panel-body p-3"},[n("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),f(" Self-hosting "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#project-icon-storage"})]),h("Self"),n("span",{class:"serif-hy"},"-"),h("hosting ")]),n("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),n("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[n("div",{cla
Line truncated
|
||||
anonymized repository often think it is about the paper, so the
|
||||
label names the service and the tooltip says who to contact. `),n("li",{class:P(["nav-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[19]||(t[19]=[n("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[n("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),g("Report a bug ")],-1)])],2),n("li",{class:P(["nav-item nav-support-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[20]||(t[20]=[n("a",{class:"nav-link nav-support-inline",href:"https://ko-fi.com/tdurieux",target:"_blank",rel:"noopener",title:"Donate on Ko-fi to help cover hosting costs"},[n("svg",{class:"ui-icon nav-heart","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})]),g("Support ")],-1)])],2),e.isDarkMode?f("v-if",!0):(a(),l("li",M7,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to dark mode","aria-label":"Switch to dark mode",onClick:t[1]||(t[1]=s=>{e.darkMode(!0)})},[...t[21]||(t[21]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(a(),l("li",V7,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to light mode","aria-label":"Switch to light mode",onClick:t[2]||(t[2]=s=>{e.darkMode(!1)})},[...t[22]||(t[22]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):f("v-if",!0),!e.user&&!e.isReviewerRoute?(a(),l("li",q7,[...t[23]||(t[23]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),g(" Sign in ")],-1)])])):f("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(a(),l("li",L7,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=ae(s=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):f("v-if",!0),e.user?(a(),l("li",$7,[n("a",_7,[e.user?.photo?(a(),l("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,F7)):f("v-if",!0),n("span",U7,c(e.user?.username),1)]),n("div",B7,[n("h6",z7,"Signed in as @"+c(e.user?.username),1),t[25]||(t[25]=Ce('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item um-extra" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a>',6)),e.headerShowSupport?(a(),l("a",H7,[...t[24]||(t[24]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})],-1),n("span",null,"Support the project",-1)])])):f("v-if",!0),t[26]||(t[26]=n("div",{class:"dropdown-divider"},null,-1)),t[27]||(t[27]=n("a",{class:"dropdown-item",href:"/api/user/logout",target:"_self"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-logout"})]),n("span",null,"Sign out")],-1))])])):f("v-if",!0)])])],2),e.generalMessage?(a(),l("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,j7)):f("v-if",!0),e.emailPromptOpen?(a(),l("dialog",{key:1,id:"email-prompt",class:"email-prompt","aria-labelledby":"email-prompt-title","aria-describedby":"email-prompt-reason",onCancel:t[8]||(t[8]=ae(s=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=ae(s=>e.respondToEmailPrompt("save"),["prevent"]))},[t[30]||(t[30]=n("h2",{id:"email-prompt-title"},"Stay informed about access problems",-1)),t[31]||(t[31]=n("p",{id:"email-prompt-reason"},"Get email alerts when your GitHub token or repository access fails.",-1)),t[32]||(t[32]=n("label",{for:"email-prompt-address"},"Email address",-1)),A(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=s=>e.emailPromptAddress=s),disabled:e.emailPromptBusy},null,8,G7),[[st,e.emailPromptAddress]]),e.emailPromptError?(a(),l("p
Line truncated
|
||||
python experiments/run.py`),n("p",null,[g("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),f(" Live stats "),n("section",{class:P(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",s9,[e.statsEmpty()?f("v-if",!0):(a(),l("div",o9,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),g(),n("span",null,[g("Live \xB7 last 60 days"),n("span",{class:"paper-stats-daily"}," \xB7 updated daily")],-1)])])),t[12]||(t[12]=n("div",{class:"paper-stats-meta-right"},"Used by authors at ICSE \xB7 FSE \xB7 OOPSLA",-1))]),e.statsEmpty()?f("v-if",!0):(a(),l("div",i9,[(a(!0),l(q,null,J(e.cards,(i,o)=>(a(),l("div",{class:"paper-stat-card",key:i?.key},[n("div",{class:P(["paper-stat-value",{"is-pending":!e.stat}])},c(e.stat?e.fmt?.bigNum(i?.total):"\u2014"),3),n("div",r9,c(i?.label),1),e.history[i?.key].bars?.length>1&&e.history[i?.key].deltaToday>0?(a(),l("div",a9," +"+c(e.fmt?.number(e.history[i?.key].deltaToday))+" today ",1)):f("v-if",!0)]))),128))]))],2),f(" Before / after "),t[22]||(t[22]=n("section",{class:"paper-section-head paper-wrap"},[n("div",null,[n("div",{class:"paper-eyebrow"},"Try it"),n("h2",null,[g("The same repository, "),n("em",null,"minus you.")])]),n("p",null," Names, affiliations, emails, and any term you list are replaced across the README, source files, notebooks, and PDF links. Reviewers browse the real thing, not a zip. ")],-1)),n("div",l9,[n("div",d9,[t[13]||(t[13]=n("label",{for:"demo-terms"},[g("Terms to redact "),n("span",null,[g("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),A(n("textarea",{id:"demo-terms",class:"demo-terms-input",rows:"1","onUpdate:modelValue":t[0]||(t[0]=i=>e.demoTerms=i),spellcheck:"false",autocomplete:"off",onKeydown:t[1]||(t[1]=kt(ae(()=>{},["prevent"]),["enter"]))},null,544),[[st,e.demoTerms]])]),n("div",u9,[n("div",c9,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[g("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",p9,[n("div",f9,[(a(!0),l(q,null,J(e.demoParts(),(i,o)=>(a(),l(q,{key:o},[i.redacted?(a(),l("mark",m9,c(i.original),1)):(a(),l(q,{key:1},[g(c(i.text),1)],64))],64))),128)),t[14]||(t[14]=g("\u200B",-1))]),A(n("textarea",{class:"pane-body demo-input","onUpdate:modelValue":t[2]||(t[2]=i=>e.demoText=i),spellcheck:"false","aria-label":"Sample README to anonymize"},null,512),[[st,e.demoText]])])]),n("div",h9,[n("div",g9,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",v9,[n("span",y9,c(e.demoCount())+" redacted",1)])]),n("div",b9,[(a(!0),l(q,null,J(e.demoParts(),(i,o)=>(a(),l(q,{key:o},[i.redacted?(a(),l("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+i.original+"\u201D"},c(i.text),9,w9)):(a(),l(q,{key:1},[g(c(i.text),1)],64))],64))),128))])])])]),f(" What you get: one screenshot, three tabs "),t[23]||(t[23]=n("section",{class:"paper-section-head paper-wrap",id:"about"},[n("div",null,[n("div",{class:"paper-eyebrow"},"What you get"),n("h2",null,"Anonymize, review, manage.")]),n("p",null," Terms are redacted in text files. Enabled images and PDFs are served unchanged, so review them for identifying content before sharing. Monitor your mirror, update it, or remove it when the review is over. ")],-1)),n("section",k9,[n("div",C9,[(a(!0),l(q,null,J(e.features,(i,o)=>(a(),l("div",{class:P(["paper-feature",{"is-on":e.feature===i?.key}]),key:i?.key},[n("button",{type:"button",class:"paper-feature-tab",role:"tab",onClick:r=>e.selectFeature(i.key),onKeydown:r=>e.featureKeydown(r,o),id:"feature-tab-"+i?.key,"aria-controls":"feature-panel-"+i?.key,"aria-selected":e.feature===i?.key,tabindex:e.feature===i?.key?0:-1},[n("span",S9,[n("span",N9,c(i?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",R9,c(i?.eyebrow),1)]),n("span",P9,[g(c(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",D9,"-")):f("v-if",!0),g(c(i?.title.split("-").slice(1).join("-"))+" "+c(i?.accent),1)])],40,E9),n("div",T9,[n("span",A9,[g(c(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",I9,"-")):f("v-if",!0),g(c(i?.title.split("-").slice(1).join("-"))+" "+c(i?.accent),1)]),n("p",null,c(i?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(i)),target:e.featureTarget(i)},c(i?.cta)+" \u2192",9,O9)])],2))),128))]),n("div",M9,[(a(!0),l(q,null,J(e.features,(i,o)=>A((a(),l("div",{class:"paper-feature-panel",role:"tabpanel",key:i?.key,id:"feature-panel-"+i?.key,"aria-labelledby":"feature-tab-"+i?.key},[n("div",q9,[n("div",L9,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",$9,c(i?.url),1)]),n("div",{class:P(["feat-mock","is-"+i?.key]),role:"img","aria-label":i?.alt},[i?.key==="anonymize"?(a(),l("div",F9,[...t[19]||(t[19]=[Ce('<div class="fm-label">GitHub reposit
Line truncated
|
||||
label names the service and the tooltip says who to contact. `),n("li",{class:R(["nav-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[19]||(t[19]=[n("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[n("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),h("Report a bug ")],-1)])],2),n("li",{class:R(["nav-item nav-support-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[20]||(t[20]=[n("a",{class:"nav-link nav-support-inline",href:"https://ko-fi.com/tdurieux",target:"_blank",rel:"noopener",title:"Donate on Ko-fi to help cover hosting costs"},[n("svg",{class:"ui-icon nav-heart","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})]),h("Support ")],-1)])],2),e.isDarkMode?f("v-if",!0):(a(),l("li",gB,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to dark mode","aria-label":"Switch to dark mode",onClick:t[1]||(t[1]=s=>{e.darkMode(!0)})},[...t[21]||(t[21]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(a(),l("li",vB,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to light mode","aria-label":"Switch to light mode",onClick:t[2]||(t[2]=s=>{e.darkMode(!1)})},[...t[22]||(t[22]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):f("v-if",!0),!e.user&&!e.isReviewerRoute?(a(),l("li",yB,[...t[23]||(t[23]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),h(" Sign in ")],-1)])])):f("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(a(),l("li",bB,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=ae(s=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):f("v-if",!0),e.user?(a(),l("li",wB,[n("a",kB,[e.user?.photo?(a(),l("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,CB)):f("v-if",!0),n("span",SB,u(e.user?.username),1)]),n("div",EB,[n("h6",NB,"Signed in as @"+u(e.user?.username),1),t[25]||(t[25]=Se('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item um-extra" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a>',6)),e.headerShowSupport?(a(),l("a",RB,[...t[24]||(t[24]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})],-1),n("span",null,"Support the project",-1)])])):f("v-if",!0),t[26]||(t[26]=n("div",{class:"dropdown-divider"},null,-1)),t[27]||(t[27]=n("a",{class:"dropdown-item",href:"/api/user/logout",target:"_self"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-logout"})]),n("span",null,"Sign out")],-1))])])):f("v-if",!0)])])],2),e.generalMessage?(a(),l("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,TB)):f("v-if",!0),e.emailPromptOpen?(a(),l("dialog",{key:1,id:"email-prompt",class:"email-prompt","aria-labelledby":"email-prompt-title","aria-describedby":"email-prompt-reason",onCancel:t[8]||(t[8]=ae(s=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=ae(s=>e.respondToEmailPrompt("save"),["prevent"]))},[t[30]||(t[30]=n("h2",{id:"email-prompt-title"},"Stay informed about access problems",-1)),t[31]||(t[31]=n("p",{id:"email-prompt-reason"},"Get email alerts when your GitHub token or repository access fails.",-1)),t[32]||(t[32]=n("label",{for:"email-prompt-address"},"Email address",-1)),T(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=s=>e.emailPromptAddress=s),disabled:e.emailPromptBusy},null,8,DB),[[nt,e.emailPromptAddress]]),e.emailPromptError?(a(),l("p
Line truncated
|
||||
python experiments/run.py`),n("p",null,[h("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),f(" Live stats "),n("section",{class:R(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",UB,[e.statsEmpty()?f("v-if",!0):(a(),l("div",BB,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),h(),n("span",null,[h("Live \xB7 last 60 days"),n("span",{class:"paper-stats-daily"}," \xB7 updated daily")],-1)])])),t[12]||(t[12]=n("div",{class:"paper-stats-meta-right"},"Used by authors at ICSE \xB7 FSE \xB7 OOPSLA",-1))]),e.statsEmpty()?f("v-if",!0):(a(),l("div",zB,[(a(!0),l(V,null,Q(e.cards,(i,o)=>(a(),l("div",{class:"paper-stat-card",key:i?.key},[n("div",{class:R(["paper-stat-value",{"is-pending":!e.stat}])},u(e.stat?e.fmt?.bigNum(i?.total):"\u2014"),3),n("div",HB,u(i?.label),1),e.history[i?.key].bars?.length>1&&e.history[i?.key].deltaToday>0?(a(),l("div",jB," +"+u(e.fmt?.number(e.history[i?.key].deltaToday))+" today ",1)):f("v-if",!0)]))),128))]))],2),f(" Before / after "),t[22]||(t[22]=n("section",{class:"paper-section-head paper-wrap"},[n("div",null,[n("div",{class:"paper-eyebrow"},"Try it"),n("h2",null,[h("The same repository, "),n("em",null,"minus you.")])]),n("p",null," Names, affiliations, emails, and any term you list are replaced across the README, source files, notebooks, and PDF links. Reviewers browse the real thing, not a zip. ")],-1)),n("div",GB,[n("div",WB,[t[13]||(t[13]=n("label",{for:"demo-terms"},[h("Terms to redact "),n("span",null,[h("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),T(n("textarea",{id:"demo-terms",class:"demo-terms-input",rows:"1","onUpdate:modelValue":t[0]||(t[0]=i=>e.demoTerms=i),spellcheck:"false",autocomplete:"off",onKeydown:t[1]||(t[1]=Vt(ae(()=>{},["prevent"]),["enter"]))},null,544),[[nt,e.demoTerms]])]),n("div",KB,[n("div",YB,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[h("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",JB,[n("div",XB,[(a(!0),l(V,null,Q(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("mark",QB,u(i.original),1)):(a(),l(V,{key:1},[h(u(i.text),1)],64))],64))),128)),t[14]||(t[14]=h("\u200B",-1))]),T(n("textarea",{class:"pane-body demo-input","onUpdate:modelValue":t[2]||(t[2]=i=>e.demoText=i),spellcheck:"false","aria-label":"Sample README to anonymize"},null,512),[[nt,e.demoText]])])]),n("div",ZB,[n("div",xB,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",ez,[n("span",tz,u(e.demoCount())+" redacted",1)])]),n("div",nz,[(a(!0),l(V,null,Q(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+i.original+"\u201D"},u(i.text),9,oz)):(a(),l(V,{key:1},[h(u(i.text),1)],64))],64))),128))])])])]),f(" What you get: one screenshot, three tabs "),t[23]||(t[23]=n("section",{class:"paper-section-head paper-wrap",id:"about"},[n("div",null,[n("div",{class:"paper-eyebrow"},"What you get"),n("h2",null,"Anonymize, review, manage.")]),n("p",null," Terms are redacted in text files. Enabled images and PDFs are served unchanged, so review them for identifying content before sharing. Monitor your mirror, update it, or remove it when the review is over. ")],-1)),n("section",sz,[n("div",iz,[(a(!0),l(V,null,Q(e.features,(i,o)=>(a(),l("div",{class:R(["paper-feature",{"is-on":e.feature===i?.key}]),key:i?.key},[n("button",{type:"button",class:"paper-feature-tab",role:"tab",onClick:r=>e.selectFeature(i.key),onKeydown:r=>e.featureKeydown(r,o),id:"feature-tab-"+i?.key,"aria-controls":"feature-panel-"+i?.key,"aria-selected":e.feature===i?.key,tabindex:e.feature===i?.key?0:-1},[n("span",az,[n("span",lz,u(i?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",dz,u(i?.eyebrow),1)]),n("span",uz,[h(u(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",cz,"-")):f("v-if",!0),h(u(i?.title.split("-").slice(1).join("-"))+" "+u(i?.accent),1)])],40,rz),n("div",pz,[n("span",fz,[h(u(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",mz,"-")):f("v-if",!0),h(u(i?.title.split("-").slice(1).join("-"))+" "+u(i?.accent),1)]),n("p",null,u(i?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(i)),target:e.featureTarget(i)},u(i?.cta)+" \u2192",9,hz)])],2))),128))]),n("div",gz,[(a(!0),l(V,null,Q(e.features,(i,o)=>T((a(),l("div",{class:"paper-feature-panel",role:"tabpanel",key:i?.key,id:"feature-panel-"+i?.key,"aria-labelledby":"feature-tab-"+i?.key},[n("div",yz,[n("div",bz,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",wz,u(i?.url),1)]),n("div",{class:R(["feat-mock","is-"+i?.key]),role:"img","aria-label":i?.alt},[i?.key==="anonymize"?(a(),l("div",Cz,[...t[19]||(t[19]=[Se('<div class="fm-label">GitHub reposit
Line truncated
|
||||
<span class="ln">2</span><span class="c"># Author: <span class="redact">XXXX-1</span>, <span class="redact">XXXX-2</span></span>
|
||||
<span class="ln">3</span><span class="k">import</span> torch
|
||||
<span class="ln">4</span><span class="k">from</span> utils <span class="k">import</span> load_config
|
||||
@@ -55,18 +55,18 @@ python experiments/run.py`),n("p",null,[g("Contact: "),n("span",{class:"redact",
|
||||
<span class="ln">7</span> model = build_model(config)
|
||||
<span class="ln">8</span> <span class="k">for</span> epoch <span class="k">in</span> range(config.epochs):
|
||||
<span class="ln">9</span> loss = step(model)
|
||||
<span class="ln">10</span> log(<span class="s">"epoch %d: %.3f"</span>, epoch, loss)</pre></div>`,2)])])):(a(),l("div",B9,[...t[21]||(t[21]=[Ce('<div class="fm-dash-head"><span>Project</span><span>Status</span><span>Views</span><span>Expires</span></div><div class="fm-dash-row"><span><b>DeepLearnUtils</b><i>paper-7f2a \xB7 ICSE 2027</i></span><span class="st is-ready">Ready</span><span>41</span><span>Mar 31, 2027</span></div><div class="fm-dash-row"><span><b>vision-bench#212</b><i>pull request \xB7 FSE 2027</i></span><span class="st is-ready">Ready</span><span>12</span><span>Never</span></div><div class="fm-dash-row"><span><b>graph-repair</b><i>gr-91ab</i></span><span class="st is-progress">Updating</span><span>5</span><span>Jan 5, 2027</span></div><div class="fm-dash-row is-muted"><span><b>JarSift</b><i>OOPSLA 2025</i></span><span class="st is-expired">Expired</span><span>72</span><span>Sep 28, 2026</span></div>',5)])]))],10,_9)])],8,V9)),[[Z,e.feature===i?.key]])),128))])]),f(" FAQ teaser "),t[24]||(t[24]=Ce('<section class="paper-qa paper-qa-r3 paper-wrap" aria-labelledby="qa-heading"><div class="qa-head"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that come up most.</h2></div><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div class="qa-grid"><div class="q"><a href="/faq#permissions">What access does GitHub sign-in require?</a><p> The GitHub App has read-only access to gists and the repositories you choose. Legacy OAuth uses broader permissions. Anonymous GitHub never writes to your repositories. </p></div><div class="q"><a href="/faq#formats">Which file formats are supported?</a><p> Source code with syntax highlighting, Markdown, Jupyter notebooks, PDFs, images, and GitHub Pages sites. Text files are anonymized; enabled images and PDFs are served unchanged. </p></div><div class="q"><a href="/faq#expiration">What happens when an anonymized repository expires?</a><p> You choose: the mirror is removed, or visitors are redirected to the original GitHub repository once the review is over. </p></div></div></section><section class="paper-cta paper-wrap" aria-labelledby="cta-heading"><div><h2 id="cta-heading">Ready for review?</h2><p>Create an anonymous mirror in a couple of minutes. Reviewers just open the link.</p></div><div class="paper-cta-actions"><a class="btn-hero" href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i> Sign in with GitHub</a><a class="paper-link-arrow" target="_self" href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/">See an anonymized repository \u2192</a></div></section>',2)),Oe(s,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var z9={class:"paper-empty"},H9={class:"paper-empty-inner"},j9={key:0,class:"paper-eyebrow"},G9={key:1,class:"paper-eyebrow"},W9={key:2,class:"paper-empty-title"},K9=["textContent"];function bp(e,t){return a(),l("div",z9,[n("div",H9,[e.error?f("v-if",!0):(a(),l("div",j9,"Working")),e.error?(a(),l("div",G9,"Error")):f("v-if",!0),e.error?f("v-if",!0):(a(),l("h1",W9,[...t[0]||(t[0]=[g(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(a(),l("h1",{key:3,class:"paper-empty-title",textContent:c(e.fmt.translate(e.error))},null,8,K9)):f("v-if",!0)])])}var Y9={class:"container paper-page paper-settings"},X9={class:"paper-crumbs"},J9={class:"here"},Q9={class:"paper-page-title"},Z9={class:"paper-settings-body"},x9={class:"paper-settings-toc"},eB={href:"#conf-billing"},tB={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},nB={id:"conf-basics",class:"paper-settings-section"},sB={class:"form-group"},oB={class:"invalid-feedback"},iB={class:"invalid-feedback"},rB={class:"form-group"},aB={class:"invalid-feedback"},lB={class:"form-group"},dB={class:"invalid-feedback"},uB={class:"invalid-feedback"},cB={id:"conf-window",class:"paper-settings-section"},pB={class:"form-grid-2"},fB={class:"form-group"},mB={class:"invalid-feedback"},hB={class:"invalid-feedback"},gB={class:"form-group"},vB={class:"invalid-feedback"},yB={class:"invalid-feedback"},bB={id:"conf-rendering",class:"paper-settings-section"},wB={class:"form-check"},kB={class:"form-check-input",type:"checkbox",id:"link",name:"link"},CB={class:"form-check"},EB={class:"form-check-input",type:"checkbox",id:"image",name:"image"},SB={class:"form-check"},NB={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},RB={class:"form-check"},PB={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},DB={id:"conf-features",class:"paper-settings-section"},TB={class:"form-check"},AB={class:"form-check-input",type:"checkbox",id:"update",name:"update"},IB={class:"form-check"},OB={class:"form-check-input",type:"checkbox",id:"page",name:"page"},MB={id:"conf-plan",class:"paper-settings-section"},VB={key:0,class:"paper-section-copy"},qB={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"},Line truncated
|
||||
`).length))+" lines",1)):f("v-if",!0)]),A(n("button",{type:"button",class:"btn btn-sm btn-icon-only btn-ghost copy-path-btn","aria-label":e.pathCopied?"Path copied":"Copy file path",title:e.pathCopied?"Path copied":"Copy file path",onClick:t[2]||(t[2]=d=>e.copyPath())},[(a(),l("svg",Dz,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,Tz)]))],8,Pz),[[Z,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(a(),l("span",Az,[e.redactionCount()?(a(),l(q,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[g(c(e.redactionCount()),1),t[49]||(t[49]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,Iz),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),g(c(e.languageName||"Text"),1),n("span",Oz,[t[51]||(t[51]=n("span",{class:"sep"},"\xB7",-1)),g(c(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),t[52]||(t[52]=n("span",{class:"sep"},"\xB7",-1)),g(c(e.fmt?.number(e.content.split(`
|
||||
`).length))+" lines",1)])):f("v-if",!0),e.type=="html"?(a(),l("span",Mz,[e.redactionCount()?(a(),l(q,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[g(c(e.redactionCount()),1),t[53]||(t[53]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,Vz),t[54]||(t[54]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),t[56]||(t[56]=g("Markdown",-1)),e.fileSize(e.filePath)!=null?(a(),l(q,{key:1},[t[55]||(t[55]=n("span",{class:"sep"},"\xB7",-1)),g(c(e.formatSize(e.fileSize(e.filePath))),1)],64)):f("v-if",!0)])):f("v-if",!0),e.preview&&e.previewPreserved()?(a(),l("button",{key:2,type:"button",class:"rp-preserved-tag",onClick:t[3]||(t[3]=d=>e.openPreserveFiles())},"Left unredacted")):f("v-if",!0),n("div",qz,[e.isCsv()?(a(),l("div",Lz,[n("button",{type:"button",role:"radio",class:P(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[4]||(t[4]=d=>e.csvView="table")},"Table",10,$z),n("button",{type:"button",role:"radio",class:P(["seg-chip",{active:e.csvView==="raw"}]),"aria-checked":e.csvView==="raw",onClick:t[5]||(t[5]=d=>e.csvView="raw"),title:"Show the file as text with line numbers"},"Text",10,_z)])):f("v-if",!0),e.type!="html"&&e.symbols().length>1?(a(),l("div",Fz,[n("button",{type:"button",class:P(["btn btn-sm btn-ghost btn-symbols",{"is-on":e.symbolsOpen}]),"aria-expanded":e.symbolsOpen?"true":"false","aria-haspopup":"true",title:"Symbols in this file",onClick:t[6]||(t[6]=d=>e.symbolsOpen=!e.symbolsOpen)},[...t[57]||(t[57]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,Uz),e.symbolsOpen?(a(),l("div",Bz,[n("div",zz,c(e.symbols().length)+" "+c(e.symbols().length===1?"symbol":"symbols"),1),(a(!0),l(q,null,J(e.symbols(),d=>(a(),l("button",{type:"button",class:"symbols-item",role:"menuitem",key:d.line+d.name,onClick:p=>e.goToSymbol(d.line)},[n("span",{class:P(["symbols-kind","is-"+d.kind])},c(d.kind==="class"?"C":d.kind==="function"?"\u0192":"v"),3),n("span",jz,c(d.name),1),n("span",Gz,c(d.line),1)],8,Hz))),128))])):f("v-if",!0)])):f("v-if",!0),e.type=="html"?(a(),l("button",{key:2,type:"button",class:P(["btn btn-sm btn-ghost btn-icon-only btn-find btn-md-find",{"is-on":e.mdFindOpen}]),"aria-label":"Find on this page",title:"Find on this page ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[7]||(t[7]=d=>e.toggleMdFind())},[...t[58]||(t[58]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,Wz)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(a(),l("div",Kz,[e.type!="html"?(a(),l("button",{key:0,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-goto","aria-label":"Go to line",title:"Go to line ("+(e.isMac?"\u2318":"Ctrl+")+"G)",onClick:t[8]||(t[8]=d=>e.gotoLine())},[...t[59]||(t[59]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,Yz)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:1,type:"button",class:P(["btn btn-sm btn-icon-only btn-ghost btn-toggle",{"is-on":e.wrapLines}]),"aria-pressed":e.wrapLines?"true":"false","aria-label":"Wrap lines",title:"Wrap lines (Alt+Z)",onClick:t[9]||(t[9]=d=>e.toggleWrap())},[...t[60]||(t[60]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,Xz)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:2,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-find","aria-label":"Find in file",title:"Find in file ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[10]||(t[10]=d=>e.findInFile())},[...t[61]||(t[61]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,Jz)):f("v-if",!0)])):f("v-if",!0),!e.preview||e.url?(a(),l("div",Qz,[n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,Zz),typeof e.content=="string"?(a(),l("button",{key:0,type:"button",class:"tb-seg-btn tb-seg-icon","aria-label":e.contentCopied?"Copied":"Copy file contents",title:e.contentCopied?"Copied":"Copy file contents",onClick:t[11]||(t[11]=d=>e.copyContent())},[(a(),l("svg",eH,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,tH)]))],8,xz)):f("v-if",!0),n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[62]||(t[62]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,nH)])):f("v-if",!0),typeof e.content=="string"?(a(),l("button",{key:5,type:"button",class:"btn btn-sm btn-icon-only btn-ghost tb-copy-m","aria-label":e.contentCopied?"Copied":"Copy file contents",onClick:t[12]||(t[12]=d=>e.copyContent())},[(a(),l("svg",oH,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,iH)]))],8,sH)):f("v-if",!0),e.type=="html"&&e.r
Line truncated
|
||||
`).length))+" lines",1)],64)):f("v-if",!0)])):f("v-if",!0),e.options?.publishedAt||e.options?.sourceCommitDate||e.options?.anonymizedAt||e.options?.lastUpdateDate?(a(),l("div",mH)):f("v-if",!0),e.type=="html"?(a(),l("button",{key:3,type:"button",role:"menuitem",onClick:t[17]||(t[17]=d=>e.toggleMdFind())},[...t[67]||(t[67]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),g("Find in file",-1)])])):f("v-if",!0),e.type=="html"?(a(),l("div",hH)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:5,type:"button",role:"menuitem",onClick:t[18]||(t[18]=d=>e.findInFile())},[...t[68]||(t[68]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),g("Find in file",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:6,type:"button",role:"menuitem",onClick:t[19]||(t[19]=d=>e.gotoLine())},[...t[69]||(t[69]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1),g("Go to line",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:7,type:"button",role:"menuitemcheckbox","aria-checked":e.wrapLines?"true":"false",onClick:t[20]||(t[20]=d=>e.toggleWrap())},[t[70]||(t[70]=n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)),t[71]||(t[71]=g("Wrap lines",-1)),e.wrapLines?(a(),l("span",vH,"\u2713")):f("v-if",!0)],8,gH)):f("v-if",!0),e.isCsv()?(a(),l("button",{key:8,type:"button",role:"menuitem",class:"tb-csv-view",onClick:t[21]||(t[21]=d=>{e.csvView=e.csvView==="table"?"raw":"table",e.moreOpen=!1})},[(a(),l("svg",yH,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,bH)])),g(c(e.csvView==="table"?"Show as text":"Show as table"),1)])):f("v-if",!0),e.type!="html"?(a(),l("div",wH)):f("v-if",!0),e.type=="html"&&(!e.preview||e.url)?(a(),l("a",{key:10,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[72]||(t[72]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),g("View raw",-1)])],8,kH)):f("v-if",!0),e.type!="html"&&(!e.preview||e.url)?(a(),l("a",{key:11,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[73]||(t[73]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),g("View raw",-1)])],8,CH)):f("v-if",!0),!e.preview||e.url?(a(),l("a",{key:12,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[74]||(t[74]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1),g("Download file",-1)])],8,EH)):f("v-if",!0),e.options?.hasWebsite?(a(),l("a",{key:13,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/w/"+e.repoId+"/")},[...t[75]||(t[75]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-globe"})],-1),g("Open website",-1)])],8,SH)):f("v-if",!0),e.options?.isAdmin||e.options?.isOwner?(a(),l("a",{key:14,role:"menuitem",href:e.safeUrl("/anonymize/"+e.repoId)},[...t[76]||(t[76]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-edit"})],-1),g("Edit anonymization",-1)])],8,NH)):f("v-if",!0),e.options?.download?(a(),l("a",{key:15,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/api/repo/"+e.repoId+"/zip")},[...t[77]||(t[77]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-archive"})],-1),g("Download ZIP",-1)])],8,RH)):f("v-if",!0),n("button",{type:"button",role:"menuitem",onClick:t[22]||(t[22]=d=>e.copyPath())},[...t[78]||(t[78]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-link"})],-1),g("Copy file path",-1)])]),t[79]||(t[79]=n("div",{class:"tb-menu-sep"},null,-1)),t[80]||(t[80]=n("a",{role:"menuitem",href:"/faq"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-help"})]),g("FAQ")],-1)),t[81]||(t[81]=n("a",{role:"menuitem",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",target:"_blank",rel:"noopener"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),g("Report a bug")],-1))])):f("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(a(),l("form",{key:3,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[26]||(t[26]=ae(d=>e.submitGoto(),["prevent"]))},[t[82]||(t[82]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),A(n("input",{id:"goto-input",class:"goto-input",type:"text",inputmode:"numeric",autocomplete:"off",spellcheck:"false",placeholder:"1\u2013"+e.fmt?.number(typeof e.content=="string"?e.content.split(`
|
||||
`).length:1),"aria-invalid":e.gotoError?"true":"false","onUpdate:modelValue":t[24]||(t[24]=d=>e.gotoValue=d),onKeydown:t[25]||(t[25]=kt(ae(d=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,PH),[[st,e.gotoValue]]),n("span",{class:P(["goto-hint",{"is-error":e.gotoError}])},c(e.gotoError||"Line, or line:column"),3)],32)):f("v-if",!0)]),e.isCsv()&&e.csvView==="table"?(a(),l("div",{key:0,class:"csv-table-wrap",tabindex:"0",role:"region","aria-label":"Table view of "+(e.paths?.[e.paths.length-1]||"file")},[n("table",TH,[n("thead",null,[n("tr",null,[t[83]||(t[83]=n("th",{class:"csv-rownum",scope:"col"},[n("span",{class:"sr-only"},"Row")],-1)),(a(!0),l(q,null,J(e.csvRows()[0]||[],(d,p)=>(a(),l("th",{scope:"col",key:p,class:P({"is-num":e.csvNumCol(p)})},[(a(!0),l(q,null,J(e.redactParts(d),(u,y)=>(a(),l(q,{key:y},[u.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+u.n},[n("i",null,c(u.n),1)],8,AH)):(a(),l(q,{key:1},[g(c(u.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(a(!0),l(q,null,J(e.csvRows().slice(1),(d,p)=>(a(),l("tr",{key:p},[n("td",IH,c(p+1),1),(a(!0),l(q,null,J(d,(u,y)=>(a(),l("td",{key:y,class:P({"is-num":e.csvNumCol(y)})},[(a(!0),l(q,null,J(e.redactParts(u),(h,b)=>(a(),l(q,{key:b},[h.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+h.n},[n("i",null,c(h.n),1)],8,OH)):(a(),l(q,{key:1},[g(c(h.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,DH)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?A((a(),l("div",MH,null,512)),[[r,{content:e.content,options:e.aceOption}]]):f("v-if",!0),e.type=="html"&&e.mdFindOpen?(a(),l("div",VH,[n("input",{type:"search",class:"md-find-input",placeholder:"Find on this page","aria-label":"Find on this page",value:e.mdFindQuery,onInput:t[27]||(t[27]=d=>{e.mdFindQuery=d.target.value,e.runMdFind()}),onKeydown:[t[28]||(t[28]=kt(ae(d=>d.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[29]||(t[29]=kt(ae(d=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,qH),n("span",LH,[n("button",{type:"button","aria-label":"Previous match",onClick:t[30]||(t[30]=d=>e.stepMdFind(-1)),disabled:!e.mdFindTotal},[...t[84]||(t[84]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-left"})],-1)])],8,$H),n("button",{type:"button","aria-label":"Next match",onClick:t[31]||(t[31]=d=>e.stepMdFind(1)),disabled:!e.mdFindTotal},[...t[85]||(t[85]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-right"})],-1)])],8,_H)]),n("span",FH,c(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:P(["md-find-opt",{"is-on":e.mdFindCase}]),"aria-pressed":e.mdFindCase?"true":"false",title:"Match case","aria-label":"Match case",onClick:t[32]||(t[32]=d=>{e.mdFindCase=!e.mdFindCase,e.runMdFind()})},"Aa",10,UH),n("button",{type:"button",class:"md-find-close","aria-label":"Close find",onClick:t[33]||(t[33]=d=>e.toggleMdFind(!1))},"\xD7")])):f("v-if",!0),e.type=="html"?(a(),l("div",BH,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,zH),e.readmeToc().length>=3?(a(),l("aside",HH,[t[86]||(t[86]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",jH,[n("a",{href:"#",class:P(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[34]||(t[34]=ae(d=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(a(!0),l(q,null,J(e.readmeToc(),(d,p)=>(a(),l("a",{key:d.id,href:"#"+d.id,class:P(["lvl-"+d.level,{"is-active":e.activeHeading===d.id}]),onClick:ae(u=>e.scrollToHeading(d.id),["prevent"])},c(d.text),11,GH))),128))])])):f("v-if",!0)])):f("v-if",!0)],2)):f("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(a(),Wt(s,{key:2,content:e.content,"base-url":e.fileBaseUrl,"allow-scripts":e.allowScripts},null,8,["content","base-url","allow-scripts"])):f("v-if",!0),e.fileFrame()?(a(),l("section",{key:3,class:P(["file-card file-card-media","view-"+e.type])},[n("header",WH,[n("div",KH,[n("button",{type:"button",class:P(["btn btn-sm btn-icon-only btn-ghost card-files-btn",{"is-needed":e.sidebarHidden}]),title:"Show file tree",onClick:t[35]||(t[35]=d=>e.sidebarHidden?e.sidebarHidden=!1:e.sidebarCollapsed=!1)},[...t[87]||(t[87]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sidebar"})],-1),n("span",{class:"card-files-label"},"Files",-1)])],2),n("ol",YH,[n("li",XH,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:c(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,JH)]),(a(!0),l(q,null,J(e.paths,(d,p)=>(a(),l("li",{class:"breadcrumb-item","aria-current":p===e.paths.length-1?"page":null},[(a(!0),l(q,null,J(e.redactParts(d),(u,y)=>(a(),l(q,{key:y},[u.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+u.n},[n("i",null,c(u.n),1)],8,ZH)):(a(),l(q,{key:1},[g(c(u.t),1)],64))],64))),128))],8,QH))),256))]),n("span",xH,[e.type=="IPython
Line truncated
|
||||
<span class="ln">10</span> log(<span class="s">"epoch %d: %.3f"</span>, epoch, loss)</pre></div>`,2)])])):(a(),l("div",Ez,[...t[21]||(t[21]=[Se('<div class="fm-dash-head"><span>Project</span><span>Status</span><span>Views</span><span>Expires</span></div><div class="fm-dash-row"><span><b>DeepLearnUtils</b><i>paper-7f2a \xB7 ICSE 2027</i></span><span class="st is-ready">Ready</span><span>41</span><span>Mar 31, 2027</span></div><div class="fm-dash-row"><span><b>vision-bench#212</b><i>pull request \xB7 FSE 2027</i></span><span class="st is-ready">Ready</span><span>12</span><span>Never</span></div><div class="fm-dash-row"><span><b>graph-repair</b><i>gr-91ab</i></span><span class="st is-progress">Updating</span><span>5</span><span>Jan 5, 2027</span></div><div class="fm-dash-row is-muted"><span><b>JarSift</b><i>OOPSLA 2025</i></span><span class="st is-expired">Expired</span><span>72</span><span>Sep 28, 2026</span></div>',5)])]))],10,kz)])],8,vz)),[[Z,e.feature===i?.key]])),128))])]),f(" FAQ teaser "),t[24]||(t[24]=Se('<section class="paper-qa paper-qa-r3 paper-wrap" aria-labelledby="qa-heading"><div class="qa-head"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that come up most.</h2></div><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div class="qa-grid"><div class="q"><a href="/faq#permissions">What access does GitHub sign-in require?</a><p> The GitHub App has read-only access to gists and the repositories you choose. Legacy OAuth uses broader permissions. Anonymous GitHub never writes to your repositories. </p></div><div class="q"><a href="/faq#formats">Which file formats are supported?</a><p> Source code with syntax highlighting, Markdown, Jupyter notebooks, PDFs, images, and GitHub Pages sites. Text files are anonymized; enabled images and PDFs are served unchanged. </p></div><div class="q"><a href="/faq#expiration">What happens when an anonymized repository expires?</a><p> You choose: the mirror is removed, or visitors are redirected to the original GitHub repository once the review is over. </p></div></div></section><section class="paper-cta paper-wrap" aria-labelledby="cta-heading"><div><h2 id="cta-heading">Ready for review?</h2><p>Create an anonymous mirror in a couple of minutes. Reviewers just open the link.</p></div><div class="paper-cta-actions"><a class="btn-hero" href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i> Sign in with GitHub</a><a class="paper-link-arrow" target="_self" href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/">See an anonymized repository \u2192</a></div></section>',2)),Oe(s,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var Nz={class:"paper-empty"},Rz={class:"paper-empty-inner"},Tz={key:0,class:"paper-eyebrow"},Dz={key:1,class:"paper-eyebrow"},Pz={key:2,class:"paper-empty-title"},Az=["textContent"];function bp(e,t){return a(),l("div",Nz,[n("div",Rz,[e.error?f("v-if",!0):(a(),l("div",Tz,"Working")),e.error?(a(),l("div",Dz,"Error")):f("v-if",!0),e.error?f("v-if",!0):(a(),l("h1",Pz,[...t[0]||(t[0]=[h(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(a(),l("h1",{key:3,class:"paper-empty-title",textContent:u(e.fmt.translate(e.error))},null,8,Az)):f("v-if",!0)])])}var Iz={class:"container paper-page paper-settings"},Oz={class:"paper-crumbs"},Mz={class:"here"},Vz={class:"paper-page-title"},qz={class:"paper-settings-body"},Lz={class:"paper-settings-toc"},$z={href:"#conf-billing"},Fz={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},_z={id:"conf-basics",class:"paper-settings-section"},Uz={class:"form-group"},Bz={class:"invalid-feedback"},zz={class:"invalid-feedback"},Hz={class:"form-group"},jz={class:"invalid-feedback"},Gz={class:"form-group"},Wz={class:"invalid-feedback"},Kz={class:"invalid-feedback"},Yz={id:"conf-window",class:"paper-settings-section"},Jz={class:"form-grid-2"},Xz={class:"form-group"},Qz={class:"invalid-feedback"},Zz={class:"invalid-feedback"},xz={class:"form-group"},eH={class:"invalid-feedback"},tH={class:"invalid-feedback"},nH={id:"conf-rendering",class:"paper-settings-section"},oH={class:"form-check"},sH={class:"form-check-input",type:"checkbox",id:"link",name:"link"},iH={class:"form-check"},rH={class:"form-check-input",type:"checkbox",id:"image",name:"image"},aH={class:"form-check"},lH={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},dH={class:"form-check"},uH={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},cH={id:"conf-features",class:"paper-settings-section"},pH={class:"form-check"},fH={class:"form-check-input",type:"checkbox",id:"update",name:"update"},mH={class:"form-check"},hH={class:"form-check-input",type:"checkbox",id:"page",name:"page"},gH={id:"conf-plan",class:"paper-settings-section"},vH={key:0,class:"paper-section-copy"},yH={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"},Line truncated
|
||||
`).length))+" lines",1)):f("v-if",!0)]),T(n("button",{type:"button",class:"btn btn-sm btn-icon-only btn-ghost copy-path-btn","aria-label":e.pathCopied?"Path copied":"Copy file path",title:e.pathCopied?"Path copied":"Copy file path",onClick:t[2]||(t[2]=d=>e.copyPath())},[(a(),l("svg",cj,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,pj)]))],8,uj),[[Z,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(a(),l("span",fj,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[h(u(e.redactionCount()),1),t[49]||(t[49]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,mj),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),h(u(e.languageName||"Text"),1),n("span",hj,[t[51]||(t[51]=n("span",{class:"sep"},"\xB7",-1)),h(u(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),t[52]||(t[52]=n("span",{class:"sep"},"\xB7",-1)),h(u(e.fmt?.number(e.content.split(`
|
||||
`).length))+" lines",1)])):f("v-if",!0),e.type=="html"?(a(),l("span",gj,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[h(u(e.redactionCount()),1),t[53]||(t[53]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,vj),t[54]||(t[54]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),t[56]||(t[56]=h("Markdown",-1)),e.fileSize(e.filePath)!=null?(a(),l(V,{key:1},[t[55]||(t[55]=n("span",{class:"sep"},"\xB7",-1)),h(u(e.formatSize(e.fileSize(e.filePath))),1)],64)):f("v-if",!0)])):f("v-if",!0),e.preview&&e.previewPreserved()?(a(),l("button",{key:2,type:"button",class:"rp-preserved-tag",onClick:t[3]||(t[3]=d=>e.openPreserveFiles())},"Left unredacted")):f("v-if",!0),n("div",yj,[e.isCsv()?(a(),l("div",bj,[n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[4]||(t[4]=d=>e.csvView="table")},"Table",10,wj),n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="raw"}]),"aria-checked":e.csvView==="raw",onClick:t[5]||(t[5]=d=>e.csvView="raw"),title:"Show the file as text with line numbers"},"Text",10,kj)])):f("v-if",!0),e.type!="html"&&e.symbols().length>1?(a(),l("div",Cj,[n("button",{type:"button",class:R(["btn btn-sm btn-ghost btn-symbols",{"is-on":e.symbolsOpen}]),"aria-expanded":e.symbolsOpen?"true":"false","aria-haspopup":"true",title:"Symbols in this file",onClick:t[6]||(t[6]=d=>e.symbolsOpen=!e.symbolsOpen)},[...t[57]||(t[57]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,Sj),e.symbolsOpen?(a(),l("div",Ej,[n("div",Nj,u(e.symbols().length)+" "+u(e.symbols().length===1?"symbol":"symbols"),1),(a(!0),l(V,null,Q(e.symbols(),d=>(a(),l("button",{type:"button",class:"symbols-item",role:"menuitem",key:d.line+d.name,onClick:p=>e.goToSymbol(d.line)},[n("span",{class:R(["symbols-kind","is-"+d.kind])},u(d.kind==="class"?"C":d.kind==="function"?"\u0192":"v"),3),n("span",Tj,u(d.name),1),n("span",Dj,u(d.line),1)],8,Rj))),128))])):f("v-if",!0)])):f("v-if",!0),e.type=="html"?(a(),l("button",{key:2,type:"button",class:R(["btn btn-sm btn-ghost btn-icon-only btn-find btn-md-find",{"is-on":e.mdFindOpen}]),"aria-label":"Find on this page",title:"Find on this page ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[7]||(t[7]=d=>e.toggleMdFind())},[...t[58]||(t[58]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,Pj)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(a(),l("div",Aj,[e.type!="html"?(a(),l("button",{key:0,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-goto","aria-label":"Go to line",title:"Go to line ("+(e.isMac?"\u2318":"Ctrl+")+"G)",onClick:t[8]||(t[8]=d=>e.gotoLine())},[...t[59]||(t[59]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,Ij)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:1,type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost btn-toggle",{"is-on":e.wrapLines}]),"aria-pressed":e.wrapLines?"true":"false","aria-label":"Wrap lines",title:"Wrap lines (Alt+Z)",onClick:t[9]||(t[9]=d=>e.toggleWrap())},[...t[60]||(t[60]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,Oj)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:2,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-find","aria-label":"Find in file",title:"Find in file ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[10]||(t[10]=d=>e.findInFile())},[...t[61]||(t[61]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,Mj)):f("v-if",!0)])):f("v-if",!0),!e.preview||e.url?(a(),l("div",Vj,[n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,qj),typeof e.content=="string"?(a(),l("button",{key:0,type:"button",class:"tb-seg-btn tb-seg-icon","aria-label":e.contentCopied?"Copied":"Copy file contents",title:e.contentCopied?"Copied":"Copy file contents",onClick:t[11]||(t[11]=d=>e.copyContent())},[(a(),l("svg",$j,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,Fj)]))],8,Lj)):f("v-if",!0),n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[62]||(t[62]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,_j)])):f("v-if",!0),typeof e.content=="string"?(a(),l("button",{key:5,type:"button",class:"btn btn-sm btn-icon-only btn-ghost tb-copy-m","aria-label":e.contentCopied?"Copied":"Copy file contents",onClick:t[12]||(t[12]=d=>e.copyContent())},[(a(),l("svg",Bj,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,zj)]))],8,Uj)):f("v-if",!0),e.type=="html"&&e.r
Line truncated
|
||||
`).length))+" lines",1)],64)):f("v-if",!0)])):f("v-if",!0),e.options?.publishedAt||e.options?.sourceCommitDate||e.options?.anonymizedAt||e.options?.lastUpdateDate?(a(),l("div",Qj)):f("v-if",!0),e.type=="html"?(a(),l("button",{key:3,type:"button",role:"menuitem",onClick:t[17]||(t[17]=d=>e.toggleMdFind())},[...t[67]||(t[67]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),h("Find in file",-1)])])):f("v-if",!0),e.type=="html"?(a(),l("div",Zj)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:5,type:"button",role:"menuitem",onClick:t[18]||(t[18]=d=>e.findInFile())},[...t[68]||(t[68]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),h("Find in file",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:6,type:"button",role:"menuitem",onClick:t[19]||(t[19]=d=>e.gotoLine())},[...t[69]||(t[69]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1),h("Go to line",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:7,type:"button",role:"menuitemcheckbox","aria-checked":e.wrapLines?"true":"false",onClick:t[20]||(t[20]=d=>e.toggleWrap())},[t[70]||(t[70]=n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)),t[71]||(t[71]=h("Wrap lines",-1)),e.wrapLines?(a(),l("span",eG,"\u2713")):f("v-if",!0)],8,xj)):f("v-if",!0),e.isCsv()?(a(),l("button",{key:8,type:"button",role:"menuitem",class:"tb-csv-view",onClick:t[21]||(t[21]=d=>{e.csvView=e.csvView==="table"?"raw":"table",e.moreOpen=!1})},[(a(),l("svg",tG,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,nG)])),h(u(e.csvView==="table"?"Show as text":"Show as table"),1)])):f("v-if",!0),e.type!="html"?(a(),l("div",oG)):f("v-if",!0),e.type=="html"&&(!e.preview||e.url)?(a(),l("a",{key:10,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[72]||(t[72]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),h("View raw",-1)])],8,sG)):f("v-if",!0),e.type!="html"&&(!e.preview||e.url)?(a(),l("a",{key:11,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[73]||(t[73]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),h("View raw",-1)])],8,iG)):f("v-if",!0),!e.preview||e.url?(a(),l("a",{key:12,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[74]||(t[74]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1),h("Download file",-1)])],8,rG)):f("v-if",!0),e.options?.hasWebsite?(a(),l("a",{key:13,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/w/"+e.repoId+"/")},[...t[75]||(t[75]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-globe"})],-1),h("Open website",-1)])],8,aG)):f("v-if",!0),e.options?.isAdmin||e.options?.isOwner?(a(),l("a",{key:14,role:"menuitem",href:e.safeUrl("/anonymize/"+e.repoId)},[...t[76]||(t[76]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-edit"})],-1),h("Edit anonymization",-1)])],8,lG)):f("v-if",!0),e.options?.download?(a(),l("a",{key:15,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/api/repo/"+e.repoId+"/zip")},[...t[77]||(t[77]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-archive"})],-1),h("Download ZIP",-1)])],8,dG)):f("v-if",!0),n("button",{type:"button",role:"menuitem",onClick:t[22]||(t[22]=d=>e.copyPath())},[...t[78]||(t[78]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-link"})],-1),h("Copy file path",-1)])]),t[79]||(t[79]=n("div",{class:"tb-menu-sep"},null,-1)),t[80]||(t[80]=n("a",{role:"menuitem",href:"/faq"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-help"})]),h("FAQ")],-1)),t[81]||(t[81]=n("a",{role:"menuitem",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",target:"_blank",rel:"noopener"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),h("Report a bug")],-1))])):f("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(a(),l("form",{key:3,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[26]||(t[26]=ae(d=>e.submitGoto(),["prevent"]))},[t[82]||(t[82]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),T(n("input",{id:"goto-input",class:"goto-input",type:"text",inputmode:"numeric",autocomplete:"off",spellcheck:"false",placeholder:"1\u2013"+e.fmt?.number(typeof e.content=="string"?e.content.split(`
|
||||
`).length:1),"aria-invalid":e.gotoError?"true":"false","onUpdate:modelValue":t[24]||(t[24]=d=>e.gotoValue=d),onKeydown:t[25]||(t[25]=Vt(ae(d=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,uG),[[nt,e.gotoValue]]),n("span",{class:R(["goto-hint",{"is-error":e.gotoError}])},u(e.gotoError||"Line, or line:column"),3)],32)):f("v-if",!0)]),e.isCsv()&&e.csvView==="table"?(a(),l("div",{key:0,class:"csv-table-wrap",tabindex:"0",role:"region","aria-label":"Table view of "+(e.paths?.[e.paths.length-1]||"file")},[n("table",pG,[n("thead",null,[n("tr",null,[t[83]||(t[83]=n("th",{class:"csv-rownum",scope:"col"},[n("span",{class:"sr-only"},"Row")],-1)),(a(!0),l(V,null,Q(e.csvRows()[0]||[],(d,p)=>(a(),l("th",{scope:"col",key:p,class:R({"is-num":e.csvNumCol(p)})},[(a(!0),l(V,null,Q(e.redactParts(d),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,u(c.n),1)],8,fG)):(a(),l(V,{key:1},[h(u(c.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(a(!0),l(V,null,Q(e.csvRows().slice(1),(d,p)=>(a(),l("tr",{key:p},[n("td",mG,u(p+1),1),(a(!0),l(V,null,Q(d,(c,v)=>(a(),l("td",{key:v,class:R({"is-num":e.csvNumCol(v)})},[(a(!0),l(V,null,Q(e.redactParts(c),(g,y)=>(a(),l(V,{key:y},[g.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+g.n},[n("i",null,u(g.n),1)],8,hG)):(a(),l(V,{key:1},[h(u(g.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,cG)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?T((a(),l("div",gG,null,512)),[[r,{content:e.content,options:e.aceOption}]]):f("v-if",!0),e.type=="html"&&e.mdFindOpen?(a(),l("div",vG,[n("input",{type:"search",class:"md-find-input",placeholder:"Find on this page","aria-label":"Find on this page",value:e.mdFindQuery,onInput:t[27]||(t[27]=d=>{e.mdFindQuery=d.target.value,e.runMdFind()}),onKeydown:[t[28]||(t[28]=Vt(ae(d=>d.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[29]||(t[29]=Vt(ae(d=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,yG),n("span",bG,[n("button",{type:"button","aria-label":"Previous match",onClick:t[30]||(t[30]=d=>e.stepMdFind(-1)),disabled:!e.mdFindTotal},[...t[84]||(t[84]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-left"})],-1)])],8,wG),n("button",{type:"button","aria-label":"Next match",onClick:t[31]||(t[31]=d=>e.stepMdFind(1)),disabled:!e.mdFindTotal},[...t[85]||(t[85]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-right"})],-1)])],8,kG)]),n("span",CG,u(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:R(["md-find-opt",{"is-on":e.mdFindCase}]),"aria-pressed":e.mdFindCase?"true":"false",title:"Match case","aria-label":"Match case",onClick:t[32]||(t[32]=d=>{e.mdFindCase=!e.mdFindCase,e.runMdFind()})},"Aa",10,SG),n("button",{type:"button",class:"md-find-close","aria-label":"Close find",onClick:t[33]||(t[33]=d=>e.toggleMdFind(!1))},"\xD7")])):f("v-if",!0),e.type=="html"?(a(),l("div",EG,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,NG),e.readmeToc().length>=3?(a(),l("aside",RG,[t[86]||(t[86]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",TG,[n("a",{href:"#",class:R(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[34]||(t[34]=ae(d=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(a(!0),l(V,null,Q(e.readmeToc(),(d,p)=>(a(),l("a",{key:d.id,href:"#"+d.id,class:R(["lvl-"+d.level,{"is-active":e.activeHeading===d.id}]),onClick:ae(c=>e.scrollToHeading(d.id),["prevent"])},u(d.text),11,DG))),128))])])):f("v-if",!0)])):f("v-if",!0)],2)):f("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(a(),Wt(s,{key:2,content:e.content,"base-url":e.fileBaseUrl,"allow-scripts":e.allowScripts},null,8,["content","base-url","allow-scripts"])):f("v-if",!0),e.fileFrame()?(a(),l("section",{key:3,class:R(["file-card file-card-media","view-"+e.type])},[n("header",PG,[n("div",AG,[n("button",{type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost card-files-btn",{"is-needed":e.sidebarHidden}]),title:"Show file tree",onClick:t[35]||(t[35]=d=>e.sidebarHidden?e.sidebarHidden=!1:e.sidebarCollapsed=!1)},[...t[87]||(t[87]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sidebar"})],-1),n("span",{class:"card-files-label"},"Files",-1)])],2),n("ol",IG,[n("li",OG,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:u(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,MG)]),(a(!0),l(V,null,Q(e.paths,(d,p)=>(a(),l("li",{class:"breadcrumb-item","aria-current":p===e.paths.length-1?"page":null},[(a(!0),l(V,null,Q(e.redactParts(d),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,u(c.n),1)],8,qG)):(a(),l(V,{key:1},[h(u(c.t),1)],64))],64))),128))],8,VG))),256))]),n("span",LG,[e.type=="IPython
Line truncated
|
||||
`).length+1)),placeholder:`Jane Smith
|
||||
MIT CSAIL
|
||||
jane.smith@example.org`},null,8,dW),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",uW,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=g("Matches become ",-1)),n("code",null,c(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=g(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=g(" for a custom replacement. Regex is supported.",-1))])]),A(n("div",cW,"Terms are in an invalid format.",512),[[Z,e.defaultsForm?.terms?.errors?.format]])])]),n("section",pW,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",fW,[n("label",mW,[A(n("input",hW,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=g("Keep links",-1))]),n("label",gW,[A(n("input",vW,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=g("Display images",-1))]),n("label",yW,[A(n("input",bW,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=g("Display PDFs",-1))]),n("label",wW,[A(n("input",kW,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=g("Display notebooks",-1))]),n("label",CW,[A(n("input",EW,null,512),[[i,{state:e.viewState,set:r=>{e.options.loc=r},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=g("Show line counts",-1))]),n("label",SW,[A(n("input",NW,null,512),[[i,{state:e.viewState,set:r=>{e.options.page=r},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=g("GitHub Pages",-1))])]),t[33]||(t[33]=n("p",{class:"settings-help"},"Images and PDFs are not anonymized.",-1)),t[34]||(t[34]=n("p",{class:"settings-help"},"GitHub Pages must use the anonymized branch.",-1))])]),n("section",RW,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",PW,[A(n("input",DW,null,512),[[i,{state:e.viewState,set:r=>{e.options.update=r},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=g("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",TW,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[A((a(),l("select",AW,[...t[39]||(t[39]=[n("option",{value:"redirect"},"Redirect visitors to the GitHub repository",-1),n("option",{value:"remove",selected:""},"Remove the anonymized repository",-1)])])),[[i,{state:e.viewState,set:r=>{e.options.expirationMode=r},value:e.options?.expirationMode,form:"defaultsForm",options:{}}]]),n("p",IW,c(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",OW,[n("div",MW,[e.draftRestored?(a(),l("span",VW,"Your unsaved draft was restored.")):e.unsavedChanges?(a(),l("span",qW,"Unsaved changes"+c(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(a(),l("span",LW,c(e.message?"Defaults saved":"No unsaved changes"),1))]),e.draftRestored||e.unsavedChanges?(a(),l("button",{key:0,type:"button",class:"draft-discard",onClick:t[0]||(t[0]=r=>e.discardDraft())},"Discard changes")):f("v-if",!0),n("button",{id:"save",type:"submit",class:P(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},c(e.saving?"Saving\u2026":"Save defaults"),11,$W),e.error?(a(),l("div",_W,c(e.error),1)):f("v-if",!0)])],32)),[[o,e.viewState]])],512),[[Z,e.settingsTab==="defaults"]]),A(n("section",{id:"settings-billing","aria-busy":e.billingLoading||e.billingBusy},[t[95]||(t[95]=n("p",{class:"settings-scope"},"Your plan and usage. Reviewer access is always free.",-1)),e.billingLoading?(a(),l("p",UW,"Loading billing\u2026")):f("v-if",!0),e.billingError?(a(),l("div",BW,[g(c(e.billingError)+" ",1),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[3]||(t[3]=r=>e.loadBilling()),disabled:e.billingBusy},"Try again",8,zW)])):f("v-if",!0),e.billingNotice?(a(),l("p",HW,c(e.billingNotice),1)):f("v-if",!0),e.billingPending?(a(),l("div",jW,[t[42]||(t[42]=n("strong",null,"Confirming your payment",-1)),t[43]||(t[43]=n("p",null,"Your allowance will update after confirmation. Please do not pay again.",-1)),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[4]||(t[4]=r=>e.refreshBilling()),disabled:e.billingBusy},"Check payment status",8,GW)])):f("v-if",!0),n("section",WW,[n("div",KW,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",YW,c(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(a(),l("p",XW,[g(c(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access u
Line truncated
|
||||
jane.smith@example.org`},null,8,WK),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",KK,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=h("Matches become ",-1)),n("code",null,u(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=h(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=h(" for a custom replacement. Regex is supported.",-1))])]),T(n("div",YK,"Terms are in an invalid format.",512),[[Z,e.defaultsForm?.terms?.errors?.format]])])]),n("section",JK,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",XK,[n("label",QK,[T(n("input",ZK,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=h("Keep links",-1))]),n("label",xK,[T(n("input",eY,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=h("Display images",-1))]),n("label",tY,[T(n("input",nY,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=h("Display PDFs",-1))]),n("label",oY,[T(n("input",sY,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=h("Display notebooks",-1))]),n("label",iY,[T(n("input",rY,null,512),[[i,{state:e.viewState,set:r=>{e.options.loc=r},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=h("Show line counts",-1))]),n("label",aY,[T(n("input",lY,null,512),[[i,{state:e.viewState,set:r=>{e.options.page=r},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=h("GitHub Pages",-1))])]),t[33]||(t[33]=n("p",{class:"settings-help"},"Images and PDFs are not anonymized.",-1)),t[34]||(t[34]=n("p",{class:"settings-help"},"GitHub Pages must use the anonymized branch.",-1))])]),n("section",dY,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",uY,[T(n("input",cY,null,512),[[i,{state:e.viewState,set:r=>{e.options.update=r},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=h("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",pY,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[T((a(),l("select",fY,[...t[39]||(t[39]=[n("option",{value:"redirect"},"Redirect visitors to the GitHub repository",-1),n("option",{value:"remove",selected:""},"Remove the anonymized repository",-1)])])),[[i,{state:e.viewState,set:r=>{e.options.expirationMode=r},value:e.options?.expirationMode,form:"defaultsForm",options:{}}]]),n("p",mY,u(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",hY,[n("div",gY,[e.draftRestored?(a(),l("span",vY,"Your unsaved draft was restored.")):e.unsavedChanges?(a(),l("span",yY,"Unsaved changes"+u(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(a(),l("span",bY,u(e.message?"Defaults saved":"No unsaved changes"),1))]),e.draftRestored||e.unsavedChanges?(a(),l("button",{key:0,type:"button",class:"draft-discard",onClick:t[0]||(t[0]=r=>e.discardDraft())},"Discard changes")):f("v-if",!0),n("button",{id:"save",type:"submit",class:R(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},u(e.saving?"Saving\u2026":"Save defaults"),11,wY),e.error?(a(),l("div",kY,u(e.error),1)):f("v-if",!0)])],32)),[[o,e.viewState]])],512),[[Z,e.settingsTab==="defaults"]]),T(n("section",{id:"settings-billing","aria-busy":e.billingLoading||e.billingBusy},[t[95]||(t[95]=n("p",{class:"settings-scope"},"Your plan and usage. Reviewer access is always free.",-1)),e.billingLoading?(a(),l("p",SY,"Loading billing\u2026")):f("v-if",!0),e.billingError?(a(),l("div",EY,[h(u(e.billingError)+" ",1),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[3]||(t[3]=r=>e.loadBilling()),disabled:e.billingBusy},"Try again",8,NY)])):f("v-if",!0),e.billingNotice?(a(),l("p",RY,u(e.billingNotice),1)):f("v-if",!0),e.billingPending?(a(),l("div",TY,[t[42]||(t[42]=n("strong",null,"Confirming your payment",-1)),t[43]||(t[43]=n("p",null,"Your allowance will update after confirmation. Please do not pay again.",-1)),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[4]||(t[4]=r=>e.refreshBilling()),disabled:e.billingBusy},"Check payment status",8,DY)])):f("v-if",!0),n("section",PY,[n("div",AY,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",IY,u(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(a(),l("p",OY,[h(u(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access u
Line truncated
|
||||
`);t.innerHTML=s.map(i=>{let o=i.replace(/^(<[^>]+>)+/,"").charAt(0),r=i.startsWith("@@")?"hunk":o==="+"?"add":o==="-"?"remove":"";return`<span class="md-diff-line${r?" is-"+r:""}">${i||" "}</span>`}).join(`
|
||||
`)}),Lp=(e,t=0)=>{let s=(String(e).slice(t).match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length;return Math.min(t+s+4,24)},Fp=e=>{e?.closest?.(".reviewer-preview")&&e.querySelectorAll("pre code").forEach(t=>{let s=t.querySelectorAll(".md-diff-line");if(s.length){s.forEach(o=>{o.classList.contains("is-hunk")||o.style.setProperty("--hang",Lp(o.textContent,1)+"ch")});return}if(t.querySelector(".code-line"))return;let i=[];t.innerHTML=t.innerHTML.replace(/\n$/,"").split(`
|
||||
`)}),Lp=(e,t=0)=>{let s=(String(e).slice(t).match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length;return Math.min(t+s+4,24)},_p=e=>{e?.closest?.(".reviewer-preview")&&e.querySelectorAll("pre code").forEach(t=>{let s=t.querySelectorAll(".md-diff-line");if(s.length){s.forEach(o=>{o.classList.contains("is-hunk")||o.style.setProperty("--hang",Lp(o.textContent,1)+"ch")});return}if(t.querySelector(".code-line"))return;let i=[];t.innerHTML=t.innerHTML.replace(/\n$/,"").split(`
|
||||
`).map(o=>{let r=i.join("");o.replace(/<\/?span\b[^>]*>/g,p=>(p.startsWith("</")?i.pop():i.push(p),p));let d=o.replace(/<[^>]+>/g,"");return`<span class="code-line" style="--hang:${Lp(d)}ch">${r}${o||" "}${"</span>".repeat(i.length)}</span>`}).join(`
|
||||
`)})},Up={props:["content","terms","options"],setup(e){let t=St(null),s=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),_p(t.value),Fp(t.value)};return mn(()=>{s(),ut(()=>[e.content,e.terms,e.options],s,{deep:!0})}),()=>Te("markdown",{ref:t})}},RZ={props:["file","terms","options"],setup(e){let t=St(null),s=()=>xe(()=>{t.value?.querySelectorAll("pre code").forEach(i=>window.Prism?.highlightElement(i)),_p(t.value),Fp(t.value)});return mn(s),ut(()=>[e.file?.content,e.terms,e.options],s,{deep:!0}),()=>{let i=e.file||{},o=(i.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(o)||i.language==="Markdown")return Te("gist-file",{ref:t},Te(Up,{content:i.content,terms:e.terms,options:e.options}));let r={js:"javascript",jsx:"javascript",ts:"javascript",typescript:"javascript",py:"python",html:"markup",xml:"markup",svg:"markup",sh:"bash"},d=(i.language||o||"none").toLowerCase();return Te("gist-file",{ref:t},Te("pre",{class:"line-numbers"},Te("code",{class:"language-"+(r[d]||d),key:i.content},i.content||"")))}}},PZ=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let s=document.createElement("div");s.className="nb-code-scroll",t.replaceWith(s),s.appendChild(t);let i=()=>{let o=t.scrollWidth-t.clientWidth>1;if(s.classList.toggle("is-overflowing",o),s.classList.toggle("is-at-end",o&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!o)return;let r=t.clientWidth-16,d=Math.max(24,r*t.clientWidth/t.scrollWidth);s.style.setProperty("--thumb-w",d+"px"),s.style.setProperty("--thumb-x",(r-d)*t.scrollLeft/(t.scrollWidth-t.clientWidth)+"px")};t.addEventListener("scroll",i,{passive:!0}),window.ResizeObserver?new ResizeObserver(i).observe(t):i(),i()}),DZ={props:["file","content"],setup(e){let t=St(null),s=0,i,o=async()=>{let r=++s;i?.abort(),i=new AbortController;try{let d=e.content?JSON.parse(e.content):await fetch(e.file?.download_url||e.file,{signal:i.signal}).then(p=>{if(!p.ok)throw Error("Notebook request failed");return p.json()});if(await Jn("notebook"),r!==s)return;t.value.innerHTML=Lo(DOMPurify.sanitize(nb.parse(d).render())),t.value.querySelectorAll("pre code").forEach(p=>window.Prism?.highlightElement(p)),PZ(t.value)}catch(d){r===s&&d.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return mn(()=>{o(),ut(()=>[e.file,e.content],o)}),is(()=>{s++,i?.abort()}),()=>Te("notebook",{ref:t})}},TZ={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,i])=>i.code),s=t.reduce((i,[,o])=>i+o.code,0);return Te("loc",t.map(([i,o])=>Te("div",{class:"lang",title:`${i}: ${o.code.toLocaleString()} lines`,style:{width:o.code*100/s+"%",background:langColors[i]}})))}}},Bp={Markdown:Up,GistFile:RZ,Notebook:DZ,Loc:TZ,HtmlDoc:Mp,QuotaUsage:SZ,Pdfviewer:id(async()=>(await Jn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",Vp))},zp={async mounted(e,{value:t}){e._editorValue=t;try{if(await ni(),e._editorDisposed)return;let s=e._editorValue,i=ace.edit(e);e._editor=i,i.setValue(String(s.content??""),-1),$p(e,s.options),e._editorCleanup=s.options?.onLoad?.(i)}catch(s){e._editorDisposed||(e.textContent=s.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),$p(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function $p(e,t={}){let s=NZ.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+s),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var Hp={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],s=new Set,i=new IntersectionObserver(o=>{o.forEach(d=>d.isIntersecting?s.add(d.target.id):s.delete(d.target.id));let r=t.find(d=>s.has(d.hash.slice(1)));r&&t.forEach(d=>d.classList.toggle("active",d===r))},{rootMargin:"-20% 0px -60% 0px",threshold:0});xe(()=>{t.forEach(o=>{let r=document.getElementById(o.hash.slice(1));r&&i.observe(r)}),t[0]&&!t.some(o=>o.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=i},beforeUnmount(e){e._observer?.disconnect()}};function jp(e){let t=[],s=0,i=/\bXXXX-(\d+)\b/g,o;for(;o=i.exec(e);)o.index>s&&t.push(e.slice(s,o.index)),t.push(Te("span",{class:"redact-slot",role:"img","aria-label":"Redacted term "+o[1]},[Te("i",null,o[1])])),s=o.index+o[0].length;return t.length?(s<e.length&&t.push(e.slice(s)),t):e}function AZ(e){let t=jp(e),s=[];for(let i of Array.isArray(t)?t:[t]){if(typeof i!="string"){s.push(i);continue}let o=i.split(/(?<=[._-])/);o.forEach((r,d)=>{s.push(r),d<o.length-1&&s.push(Te("wbr"))})}return s}function IZ(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],s=e/1024,i=0;for(;s>=1024&&i<t.length-1;)s/=1024,i++;return`${s.toFixed(1)} ${t[i]}`}function OZ(e){let t={children:[]},s=new Map([["",t]]);function i(o){if(s.has(o))return s.get(o);let r=o.lastIndexOf(
Line truncated
|
||||
`)})},Up={props:["content","terms","options"],setup(e){let t=St(null),s=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),Fp(t.value),_p(t.value)};return mn(()=>{s(),ut(()=>[e.content,e.terms,e.options],s,{deep:!0})}),()=>Pe("markdown",{ref:t})}},dee={props:["file","terms","options"],setup(e){let t=St(null),s=()=>je(()=>{t.value?.querySelectorAll("pre code").forEach(i=>window.Prism?.highlightElement(i)),Fp(t.value),_p(t.value)});return mn(s),ut(()=>[e.file?.content,e.terms,e.options],s,{deep:!0}),()=>{let i=e.file||{},o=(i.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(o)||i.language==="Markdown")return Pe("gist-file",{ref:t},Pe(Up,{content:i.content,terms:e.terms,options:e.options}));let r={js:"javascript",jsx:"javascript",ts:"javascript",typescript:"javascript",py:"python",html:"markup",xml:"markup",svg:"markup",sh:"bash"},d=(i.language||o||"none").toLowerCase();return Pe("gist-file",{ref:t},Pe("pre",{class:"line-numbers"},Pe("code",{class:"language-"+(r[d]||d),key:i.content},i.content||"")))}}},uee=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let s=document.createElement("div");s.className="nb-code-scroll",t.replaceWith(s),s.appendChild(t);let i=()=>{let o=t.scrollWidth-t.clientWidth>1;if(s.classList.toggle("is-overflowing",o),s.classList.toggle("is-at-end",o&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!o)return;let r=t.clientWidth-16,d=Math.max(24,r*t.clientWidth/t.scrollWidth);s.style.setProperty("--thumb-w",d+"px"),s.style.setProperty("--thumb-x",(r-d)*t.scrollLeft/(t.scrollWidth-t.clientWidth)+"px")};t.addEventListener("scroll",i,{passive:!0}),window.ResizeObserver?new ResizeObserver(i).observe(t):i(),i()}),cee={props:["file","content"],setup(e){let t=St(null),s=0,i,o=async()=>{let r=++s;i?.abort(),i=new AbortController;try{let d=e.content?JSON.parse(e.content):await fetch(e.file?.download_url||e.file,{signal:i.signal}).then(p=>{if(!p.ok)throw Error("Notebook request failed");return p.json()});if(await Xn("notebook"),r!==s)return;t.value.innerHTML=Ls(DOMPurify.sanitize(nb.parse(d).render())),t.value.querySelectorAll("pre code").forEach(p=>window.Prism?.highlightElement(p)),uee(t.value)}catch(d){r===s&&d.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return mn(()=>{o(),ut(()=>[e.file,e.content],o)}),io(()=>{s++,i?.abort()}),()=>Pe("notebook",{ref:t})}},pee={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,i])=>i.code),s=t.reduce((i,[,o])=>i+o.code,0);return Pe("loc",t.map(([i,o])=>Pe("div",{class:"lang",title:`${i}: ${o.code.toLocaleString()} lines`,style:{width:o.code*100/s+"%",background:langColors[i]}})))}}},Bp={Markdown:Up,GistFile:dee,Notebook:cee,Loc:pee,HtmlDoc:Mp,QuotaUsage:aee,Pdfviewer:id(async()=>(await Xn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",Vp))},zp={async mounted(e,{value:t}){e._editorValue=t;try{if(await ni(),e._editorDisposed)return;let s=e._editorValue,i=ace.edit(e);e._editor=i,i.setValue(String(s.content??""),-1),$p(e,s.options),e._editorCleanup=s.options?.onLoad?.(i)}catch(s){e._editorDisposed||(e.textContent=s.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),$p(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function $p(e,t={}){let s=lee.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+s),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var Hp={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],s=new Set,i=new IntersectionObserver(o=>{o.forEach(d=>d.isIntersecting?s.add(d.target.id):s.delete(d.target.id));let r=t.find(d=>s.has(d.hash.slice(1)));r&&t.forEach(d=>d.classList.toggle("active",d===r))},{rootMargin:"-20% 0px -60% 0px",threshold:0});je(()=>{t.forEach(o=>{let r=document.getElementById(o.hash.slice(1));r&&i.observe(r)}),t[0]&&!t.some(o=>o.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=i},beforeUnmount(e){e._observer?.disconnect()}};function jp(e){let t=[],s=0,i=/\bXXXX-(\d+)\b/g,o;for(;o=i.exec(e);)o.index>s&&t.push(e.slice(s,o.index)),t.push(Pe("span",{class:"redact-slot",role:"img","aria-label":"Redacted term "+o[1]},[Pe("i",null,o[1])])),s=o.index+o[0].length;return t.length?(s<e.length&&t.push(e.slice(s)),t):e}function fee(e){let t=jp(e),s=[];for(let i of Array.isArray(t)?t:[t]){if(typeof i!="string"){s.push(i);continue}let o=i.split(/(?<=[._-])/);o.forEach((r,d)=>{s.push(r),d<o.length-1&&s.push(Pe("wbr"))})}return s}function mee(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],s=e/1024,i=0;for(;s>=1024&&i<t.length-1;)s/=1024,i++;return`${s.toFixed(1)} ${t[i]}`}function hee(e){let t={children:[]},s=new Map([["",t]]);function i(o){if(s.has(o))return s.get(o);let r=o
Line truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
@vue/shared/dist/shared.esm-bundler.js:
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Local synthetic fixtures only. No production proxy or credentials.
|
||||
// Run: node scripts/preview-errors.js, then /admin/errors?scenario=disabled|offline|empty|stale
|
||||
const express = require('express');
|
||||
const fs = require('node:fs');
|
||||
const { setTimeout } = require('node:timers');
|
||||
const path = require('node:path');
|
||||
const app = express();
|
||||
let historyCleared = false;
|
||||
const root = path.resolve(__dirname, '../public');
|
||||
const id = 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa';
|
||||
app.use('/api', async (req, res) => {
|
||||
const scenario = new URL(req.headers.referer || 'http://localhost').searchParams.get('scenario');
|
||||
if (scenario === 'loading') await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
const now = new Date().toISOString(), start = new Date(Date.now()-3600000).toISOString();
|
||||
if (req.path === '/user') return res.json({username:'Synthetic preview',isAdmin:true,status:'ready'});
|
||||
if (req.path === '/user/default') return res.json({options:{},terms:[]});
|
||||
if (req.path === '/admin/emails/summary') return res.json({total:2,counts:{accepted:1,rejected:1,unknown:0,sending:0},chartDays:7,series:[{date:now.slice(0,10),accepted:1,rejected:1,unknown:0,sending:0}]});
|
||||
if (req.path === '/admin/emails') return res.json({entries:[{_id:'synthetic-attempt',recipient:'fixture@example.test',kind:'repository-expiration',state:'rejected',createdAt:now,httpStatus:503}],nextCursor:null});
|
||||
if (req.path === '/admin/billing/summary') return res.json({period:'30d',bucket:'day',subscriptions:{active:3,monthly:2,annual:1,cancelling:0,mrr:{eur:1400}},sales:{count:4,revenue:{eur:3000}},allTime:{count:9,revenue:{eur:5000}},reversals:{refunds:0,disputes:0,amount:{}},plans:[],series:[{date:now,subscription:1,repository:2,conference:1}],revenue:{available:true,missingSales:0},webhooks:{pending:0,failed:0}});
|
||||
if (req.path === '/admin/billing/grants') return res.json({results:[],total:0,stateCounts:{active:0,expired:0,revoked:0},statuses:[]});
|
||||
if (scenario === 'offline' && req.path.startsWith('/admin/errors')) return res.status(503).json({});
|
||||
let samples = [
|
||||
{service:'worker',module:'queue',event:'job_failed',errorCode:'upstream_error',severity:'error',status:502,jobId:id,requestId:id},
|
||||
{service:'nginx',module:'proxy',event:'edge_request',severity:'info',status:504,requestId:id},
|
||||
{service:'streamer',module:'download',event:'request_aborted',severity:'warn',requestId:id},
|
||||
{service:'api',module:'route',event:'request_failed',errorCode:'repository_unavailable',severity:'error',status:503,requestId:id},
|
||||
];
|
||||
if (scenario === 'many') samples = Array.from({length:50}, (_,i) => ({...samples[i%4],errorCode:'synthetic_event_'+(i+1)}));
|
||||
if (req.path === '/admin/errors/investigation') return res.json({state:scenario === 'unreachable' ? 'unreachable' : scenario === 'disabled' ? 'disabled' : scenario === 'empty' ? 'empty':'ready',window:req.query.window||'1h',start,end:scenario==='stale'?start:now,captured:['disabled','unreachable','empty'].includes(scenario)?0:samples.reduce((sum,_,i)=>sum+[18,9,5,2][i%4],0),groups:['disabled','unreachable','empty'].includes(scenario)?[]:samples.map((sample,i)=>({fingerprint:String(i),sample:{...sample,release:'abcdef1234567'},count:[18,9,5,2][i%4],first:start,last:now})),telemetry:{missing:[],instances:[{service:'api',instance:'synthetic-api',last:now,dropped:0}],collector:{state:'reachable',dropped:0}}});
|
||||
if (req.path === '/admin/errors/correlation') return res.json({state:'ready',start,end:now,events:samples.map(sample=>({...sample,timestamp:now}))});
|
||||
if (req.path === '/admin/errors/stats') return res.json({available:true,last24h:34,prev24h:20,severity:{error:29,warn:5,info:0},unique:{error:3,warn:1,info:0},buckets:[],dropped:0});
|
||||
if (req.path === '/admin/errors' && req.method === 'DELETE') historyCleared = true;
|
||||
if (req.path === '/admin/errors') return res.json({available:true,redisCollecting:true,total:historyCleared?0:samples.length,max:1000,entries:historyCleared?[]:samples.map((sample,i)=>({ts:now,level:sample.severity,module:sample.module,message:sample.errorCode||sample.event,count:i+1,raw:[sample]}))});
|
||||
return res.json([]);
|
||||
});
|
||||
app.use((req,res,next)=>{ req.url=req.url.replace(/\.[a-f0-9]{10}\.min\./,'.min.'); next(); });
|
||||
app.use(express.static(root,{index:false}));
|
||||
app.get('/{*path}', (req,res)=>res.type('html').send(fs.readFileSync(path.join(root,'index.html'),'utf8').replace(/__([A-Z]+)_JS__/g,(_,name)=>`${name.toLowerCase()}.min.js`).replace('__ALL_CSS__','all.min.css').replace('<body ', '<body data-synthetic-preview="true" ').replace('<div id="app"', '<div style="padding:6px 16px;background:#fff3cd;color:#493800;text-align:center;font:13px sans-serif">Synthetic preview · generated fixtures only · no production connection</div><div id="app"')));
|
||||
app.listen(4173,'0.0.0.0',()=>console.log('Synthetic Errors preview: http://localhost:4173/admin/errors'));
|
||||
+248
-5
@@ -92,11 +92,13 @@ describe("Vue 3 UI", function () {
|
||||
});
|
||||
await ui.go("/admin/errors");
|
||||
const doc = ui.window.document;
|
||||
expect(doc.body.textContent).to.include("Partial results").and.include("Collection is OFF").and.include("dropped events since collector start: unknown");
|
||||
expect(doc.body.textContent).to.include("Partial results").and.include("Collection is off").and.include("dropped events since collector start: unknown");
|
||||
expect(doc.querySelector(".log-table img")).to.equal(null);
|
||||
doc.querySelector(".log-trace-button").click(); await delay(50);
|
||||
doc.querySelector(".log-event-button").click(); await delay(20);
|
||||
await delay(50);
|
||||
expect(doc.querySelectorAll(".log-events li")).to.have.length(2);
|
||||
expect(doc.activeElement.id).to.equal("log-timeline-title");
|
||||
expect(doc.activeElement.id).to.equal("log-detail-title");
|
||||
expect(ui.requests.filter(r=>r.url.pathname==="/api/admin/errors/correlation")).to.have.length(1);
|
||||
const request = ui.requests.find(r=>r.url.pathname==="/api/admin/errors/correlation");
|
||||
expect(request.url.searchParams.get("id")).to.equal(requestId);
|
||||
expect(request.url.searchParams.get("kind")).to.equal("requestId");
|
||||
@@ -108,6 +110,139 @@ describe("Vue 3 UI", function () {
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("filters returned groups without hiding edge 5xx and restores investigation focus", async () => {
|
||||
const requestId = "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa";
|
||||
const now = new Date().toISOString();
|
||||
const historySample = {requestId, jobId:"bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb", service:"worker", event:"job_failed", severity:"error", status:502};
|
||||
const historyEntry = {ts:now,level:"error",module:"queue",message:"history_only",raw:[historySample]};
|
||||
ui = await browser("/", {
|
||||
"/api/user": {username:"admin",isAdmin:true,status:"ready"},
|
||||
"/api/admin/errors": {entries:[historyEntry],available:true,total:1},
|
||||
"/api/admin/errors/investigation": {state:"ready",window:"1h",captured:12,end:now,groups:[
|
||||
{fingerprint:"edge",count:9,last:now,first:now,sample:{event:"http_access",service:"nginx",severity:"info",status:504,requestId}},
|
||||
{fingerprint:"warn",count:3,last:now,first:now,sample:{event:"retry",service:"worker",severity:"warn"}},
|
||||
]},
|
||||
"/api/admin/errors/correlation": {state:"empty",events:[]},
|
||||
});
|
||||
await ui.go("/admin/errors");
|
||||
const doc = ui.window.document;
|
||||
expect(doc.querySelector('.history-source').style.display).to.equal('none');
|
||||
await ui.input('.log-local-filters select', 'error', 'change');
|
||||
expect(doc.querySelectorAll('.log-table tbody tr')).to.have.length(1);
|
||||
expect(doc.querySelector('.log-table').textContent).to.include('http_access').and.include('Failure');
|
||||
expect(doc.querySelector('.log-local-filters + p').textContent).to.include('1 of 2 returned groups');
|
||||
await ui.input('.log-search input', 'absent');
|
||||
expect(doc.querySelector('.log-results').textContent).to.include('No returned groups match');
|
||||
doc.querySelector('.log-results button').click(); await delay(30);
|
||||
const detail = doc.querySelector('.log-event-button'); detail.focus(); detail.click(); await delay(30);
|
||||
expect(doc.activeElement.id).to.equal('log-detail-title');
|
||||
expect(doc.querySelector('.log-detail').textContent).to.include(requestId).and.include('info');
|
||||
expect(doc.querySelector('.log-list-view').style.display).to.equal('none');
|
||||
expect(doc.querySelector('#log-detail-title').textContent).to.equal('http_access');
|
||||
expect(doc.querySelector('.log-sample-panel').textContent).to.include('http_access').and.include('nginx');
|
||||
expect(doc.querySelector('#trace-selector-requestId').getAttribute('aria-pressed')).to.equal('true');
|
||||
const identifier = doc.querySelector('.log-detail .log-value-reveal');
|
||||
expect(identifier.open).to.equal(false);
|
||||
expect(identifier.querySelector('summary').textContent).not.to.include(requestId);
|
||||
expect(identifier.querySelector('span').textContent).to.equal(requestId);
|
||||
let copiedIdentifier;
|
||||
Object.defineProperty(ui.window.navigator, 'clipboard', {configurable:true,value:{writeText:async value => { copiedIdentifier = value; }}});
|
||||
doc.querySelector('.log-detail .log-copy-value').click(); await delay(30);
|
||||
expect(copiedIdentifier).to.equal(requestId);
|
||||
expect(doc.querySelector(".log-table").textContent).not.to.include("aaaaaaaa");
|
||||
doc.querySelector('.log-back').click(); await delay(30);
|
||||
expect(doc.activeElement).to.equal(detail);
|
||||
expect(doc.querySelector('.log-list-view').style.display).not.to.equal('none');
|
||||
detail.click(); await delay(30);
|
||||
const trigger = doc.querySelector('.log-trace-button'); trigger.focus(); trigger.click(); await delay(30);
|
||||
expect(doc.activeElement.id).to.equal('log-timeline-title');
|
||||
expect(doc.querySelector('#log-timeline-title').textContent).to.equal('Related events');
|
||||
doc.querySelector('.log-timeline button').click(); await delay(30);
|
||||
expect(doc.activeElement).to.equal(trigger);
|
||||
doc.querySelector('#error-source-history').click(); await delay(30);
|
||||
const row = doc.querySelector('button.errors-row-main');
|
||||
expect(row.getAttribute('aria-expanded')).to.equal('false'); row.click(); await delay(30);
|
||||
expect(row.getAttribute('aria-expanded')).to.equal('true');
|
||||
expect(doc.getElementById(row.getAttribute('aria-controls'))).not.to.equal(null);
|
||||
expect(doc.querySelector('.history-fields')).not.to.equal(null);
|
||||
expect(doc.querySelector('.detail-main pre')).to.equal(null);
|
||||
[...doc.querySelectorAll('.detail-tabs button')].find(button => button.textContent === 'Raw').click(); await delay(30);
|
||||
expect(JSON.parse(doc.querySelector('.detail-main pre').textContent)).to.deep.equal(historyEntry);
|
||||
[...doc.querySelectorAll('.detail-actions button')].find(button => button.textContent.includes('Copy JSON')).click(); await delay(30);
|
||||
expect(JSON.parse(copiedIdentifier)).to.deep.equal(historyEntry);
|
||||
expect(doc.querySelector('.history-management').open).to.equal(false);
|
||||
expect(ui.requests.filter(r=>r.url.pathname==='/api/admin/errors/investigation')).to.have.length(1);
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("ignores superseded central requests and closed timeline responses", async () => {
|
||||
const pending = [], traces = [];
|
||||
ui = await browser("/", {
|
||||
"/api/user": {username:"admin",isAdmin:true,status:"ready"},
|
||||
"/api/admin/errors/investigation": () => new Promise(resolve => pending.push(resolve)),
|
||||
"/api/admin/errors/correlation": () => new Promise(resolve => traces.push(resolve)),
|
||||
});
|
||||
await ui.go("/admin/errors");
|
||||
const doc = ui.window.document;
|
||||
doc.querySelector('.log-filters').dispatchEvent(new ui.window.Event('submit', {bubbles:true,cancelable:true}));
|
||||
await delay(20);
|
||||
const sample = {event:'latest_event',severity:'error',requestId:'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa'};
|
||||
pending[1]({state:'ready',groups:[{fingerprint:'latest',sample,count:1}]}); await delay(30);
|
||||
pending[0]({state:'disabled',groups:[]}); await delay(30);
|
||||
expect(doc.querySelector('.log-results').textContent).to.include('latest_event');
|
||||
doc.querySelector('.log-event-button').click(); await delay(20);
|
||||
expect(traces).to.have.length(1);
|
||||
doc.querySelector('.log-timeline button').click(); await delay(30);
|
||||
traces[0]({state:'ready',events:[{event:'late_event'}]}); await delay(30);
|
||||
expect(doc.querySelector('.log-timeline')).to.equal(null);
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("automatically follows one sample ID and isolates late events across inspectors", async () => {
|
||||
const requestId = "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa", jobId = "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb";
|
||||
const traces = [];
|
||||
ui = await browser("/", {
|
||||
"/api/user": {username:"admin",isAdmin:true,status:"ready"},
|
||||
"/api/admin/errors/investigation": {state:"ready",window:"6h",groups:[
|
||||
{fingerprint:"both",count:1,sample:{event:"both_ids",requestId,jobId,severity:"error"}},
|
||||
{fingerprint:"job",count:1,sample:{event:"job_only",jobId,severity:"error"}},
|
||||
{fingerprint:"none",count:1,sample:{event:"no_id",service:"nginx",status:504,severity:"info"}},
|
||||
]},
|
||||
"/api/admin/errors/correlation": request => new Promise(resolve => traces.push({request,resolve})),
|
||||
});
|
||||
await ui.go('/admin/errors');
|
||||
const doc=ui.window.document, open=index=>doc.querySelectorAll('.log-event-button')[index].click();
|
||||
open(0); await delay(30);
|
||||
expect(traces).to.have.length(1);
|
||||
expect(traces[0].request.url.searchParams.get('kind')).to.equal('requestId');
|
||||
expect(traces[0].request.url.searchParams.get('id')).to.equal(requestId);
|
||||
expect(traces[0].request.url.searchParams.get('window')).to.equal('6h');
|
||||
doc.querySelector('.log-all-fields summary').click();
|
||||
doc.querySelector('.log-value-reveal summary').click(); await delay(30);
|
||||
expect(traces).to.have.length(1); // Native disclosure must never trigger another lookup.
|
||||
doc.querySelector('.log-back').click(); await delay(20);
|
||||
open(1); await delay(30);
|
||||
expect(traces).to.have.length(2);
|
||||
expect(traces[1].request.url.searchParams.get('kind')).to.equal('jobId');
|
||||
expect(traces[1].request.url.searchParams.get('id')).to.equal(jobId);
|
||||
traces[1].resolve({state:'ready',events:[{event:'current_job_event'}]}); await delay(30);
|
||||
traces[0].resolve({state:'ready',events:[{event:'obsolete_request_event'}]}); await delay(30);
|
||||
expect(doc.querySelector('.log-events').textContent).to.include('current_job_event').and.not.include('obsolete_request_event');
|
||||
doc.querySelector('.log-back').click(); await delay(20);
|
||||
open(2); await delay(30);
|
||||
expect(traces).to.have.length(2);
|
||||
expect(doc.querySelector('.log-no-trace').textContent).to.include('no correlation ID').and.include('HTTP 504').and.include('recorded');
|
||||
expect(doc.querySelector('.log-sample-panel').textContent).to.include('nginx');
|
||||
expect(doc.querySelector('.log-timeline')).to.equal(null);
|
||||
doc.querySelector('.log-back').click(); await delay(20);
|
||||
open(0); await delay(30);
|
||||
doc.querySelector('#error-source-history').click(); await delay(20);
|
||||
traces[2].resolve({state:'ready',events:[{event:'obsolete_source_event'}]}); await delay(30);
|
||||
expect(doc.querySelector('.log-inspector')).to.equal(null);
|
||||
expect(doc.querySelector('.log-events')).to.equal(null);
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("keeps Redis history usable when admin central lookup is disabled or unreachable", async () => {
|
||||
let state = "disabled";
|
||||
ui = await browser("/", {
|
||||
@@ -119,7 +254,10 @@ describe("Vue 3 UI", function () {
|
||||
expect(ui.window.document.body.textContent).to.include("Central lookup is not configured").and.include("upstream_error");
|
||||
state = "unreachable";
|
||||
ui.window.document.querySelector(".log-filters").dispatchEvent(new ui.window.Event("submit",{bubbles:true,cancelable:true})); await delay(40);
|
||||
expect(ui.window.document.body.textContent).to.include("Central logging is unreachable").and.include("Redis history is reachable");
|
||||
expect(ui.window.document.body.textContent).to.include("Central logging is unreachable");
|
||||
ui.window.document.querySelector('#error-source-history').click(); await delay(30);
|
||||
expect(ui.window.document.querySelector('.log-state').textContent).to.include("Redis history is reachable");
|
||||
expect(ui.window.document.querySelector('.error-health-strip button').textContent).to.equal("Refresh history");
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
@@ -135,12 +273,117 @@ describe("Vue 3 UI", function () {
|
||||
const button=ui.window.document.querySelector(".errors-pager button");
|
||||
expect(button).not.to.equal(null); button.click(); await delay(40);
|
||||
expect(ui.window.document.body.textContent).to.include("upstream_error").and.include("invalid legacy records were omitted");
|
||||
ui.window.document.querySelector('button[aria-label="Refresh"]').click(); await delay(40);
|
||||
ui.window.document.querySelector('#error-source-history').click(); await delay(30);
|
||||
ui.window.document.querySelector('.error-health-strip button').click(); await delay(40);
|
||||
expect(ui.requests.filter(r => r.url.pathname === "/api/admin/errors").at(-1).url.searchParams.get("limit")).to.equal("251");
|
||||
expect(ui.window.document.body.textContent).to.include("upstream_error");
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("preserves inspector list filters and clears details on source change and refresh", async () => {
|
||||
const now = new Date().toISOString(), requestId = "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa";
|
||||
const row = {ts:now,level:"error",module:"queue",message:"history_failure",raw:[{requestId,status:502}]};
|
||||
ui = await browser("/", {
|
||||
"/api/user": {username:"admin",isAdmin:true,status:"ready"},
|
||||
"/api/admin/errors": {entries:[row],available:true,total:1},
|
||||
"/api/admin/errors/investigation": {state:"ready",groups:[{fingerprint:"one",sample:{event:"job_failed",errorCode:"fixture_failure",severity:"error",requestId},count:2,first:now,last:now}]},
|
||||
"/api/admin/errors/correlation": {state:"empty",events:[]},
|
||||
});
|
||||
await ui.go('/admin/errors');
|
||||
const doc=ui.window.document;
|
||||
await ui.input('.log-search input','fixture');
|
||||
const open=doc.querySelector('.log-event-button'); open.click(); await delay(20);
|
||||
expect(doc.querySelector('.log-list-view').style.display).to.equal('none');
|
||||
expect(doc.querySelector('.log-all-fields').open).to.equal(false);
|
||||
doc.querySelector('.log-back').click(); await delay(20);
|
||||
expect(doc.activeElement).to.equal(open);
|
||||
expect(doc.querySelector('.log-search input').value).to.equal('fixture');
|
||||
open.click(); await delay(20);
|
||||
doc.querySelector('#error-source-history').click(); await delay(20);
|
||||
expect(doc.querySelector('.log-inspector')).to.equal(null);
|
||||
doc.querySelector('button.errors-row-main').click(); await delay(20);
|
||||
expect(doc.activeElement.id).to.equal('history-inspector-title');
|
||||
doc.querySelector('.history-source .log-back').click(); await delay(20);
|
||||
expect(doc.activeElement.matches('button.errors-row-main')).to.equal(true);
|
||||
doc.querySelector('button.errors-row-main').click(); await delay(20);
|
||||
doc.querySelector('.error-health-strip button').click(); await delay(30);
|
||||
expect(doc.querySelector('#history-inspector-title')).to.equal(null);
|
||||
doc.querySelector('#error-source-central').click(); await delay(20);
|
||||
doc.querySelector('.log-event-button').click(); await delay(20);
|
||||
doc.querySelector('.error-health-strip button').click(); await delay(30);
|
||||
expect(doc.querySelector('#log-detail-title')).to.equal(null);
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("lets slow Redis history finish across polls and protects pending older pages", async () => {
|
||||
const pending = [], polls = [];
|
||||
ui = await browser("/", {
|
||||
"/api/user": {username:"admin",isAdmin:true,status:"ready"},
|
||||
"/api/admin/errors": request => new Promise(resolve => pending.push({request,resolve})),
|
||||
"/api/admin/errors/investigation": {state:"disabled",groups:[]},
|
||||
});
|
||||
const nativeInterval = ui.window.setInterval.bind(ui.window);
|
||||
ui.window.setInterval = (callback, ms) => ms === 15000 ? (polls.push(callback), -polls.length) : nativeInterval(callback, ms);
|
||||
await ui.go("/admin/errors");
|
||||
const doc = ui.window.document;
|
||||
doc.querySelector('#error-source-history').click(); await delay(10);
|
||||
const poll = async () => { polls.forEach(callback => callback()); await delay(20); };
|
||||
expect(polls).to.have.length(2); // History polling and central snapshot freshness.
|
||||
await poll(); await poll(); await poll(); // 15s, 30s, 45s, while request is pending.
|
||||
expect(pending).to.have.length(1);
|
||||
expect(doc.querySelector('.error-health-strip button').disabled).to.equal(true);
|
||||
expect(ui.requests.filter(r=>r.url.pathname==='/api/admin/errors/stats')).to.have.length(4);
|
||||
const entry = message => ({ts:new Date().toISOString(),level:"error",module:"queue",message,raw:[{status:502}]});
|
||||
pending[0].resolve({entries:[entry('slow_success')],available:true,total:251,nextOffset:250}); await delay(30);
|
||||
expect(doc.querySelector('.history-source').textContent).to.include('slow_success');
|
||||
expect(doc.querySelector('.error-health-strip button').disabled).to.equal(false);
|
||||
await poll();
|
||||
expect(pending).to.have.length(2);
|
||||
pending[1].resolve({entries:[entry('next_poll_success')],available:true,total:251,nextOffset:250}); await delay(30);
|
||||
doc.querySelector('.errors-pager button').click(); await delay(20);
|
||||
expect(pending[2].request.url.searchParams.get('offset')).to.equal('250');
|
||||
await poll(); await poll();
|
||||
expect(pending).to.have.length(3);
|
||||
pending[2].resolve({entries:[entry('older_success')],available:true,total:251,nextOffset:251}); await delay(30);
|
||||
expect(doc.querySelector('.history-source').textContent).to.include('next_poll_success').and.include('older_success');
|
||||
await poll();
|
||||
expect(pending).to.have.length(4);
|
||||
expect(pending[3].request.url.searchParams.get('limit')).to.equal('251');
|
||||
await ui.go('/');
|
||||
pending[3].resolve({entries:[entry('disposed_response')],available:true,total:1}); await delay(30);
|
||||
expect(doc.body.textContent).not.to.include('disposed_response');
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("lets slow statistics finish independently and discover older history failures", async () => {
|
||||
const pending = [], polls = [];
|
||||
const entry = (message,status) => ({ts:new Date().toISOString(),level:status>=500?"error":"warn",module:"queue",message,raw:[{status}]});
|
||||
ui = await browser("/", {
|
||||
"/api/user": {username:"admin",isAdmin:true,status:"ready"},
|
||||
"/api/admin/errors/investigation": {state:"disabled",groups:[]},
|
||||
"/api/admin/errors/stats": () => new Promise(resolve=>pending.push(resolve)),
|
||||
"/api/admin/errors": request => ({entries:[entry(request.url.searchParams.get('offset')==='250'?'older_failure':'recent_warning',request.url.searchParams.get('offset')==='250'?502:400)],available:true,total:251,nextOffset:request.url.searchParams.get('offset')==='250'?251:250}),
|
||||
});
|
||||
const nativeInterval=ui.window.setInterval.bind(ui.window);
|
||||
ui.window.setInterval=(callback,ms)=>ms===15000?(polls.push(callback),-polls.length):nativeInterval(callback,ms);
|
||||
await ui.go('/admin/errors');
|
||||
const poll=async()=>{polls.forEach(callback=>callback());await delay(25);};
|
||||
await poll();await poll();await poll();
|
||||
expect(pending).to.have.length(1);
|
||||
expect(ui.requests.filter(r=>r.url.pathname==='/api/admin/errors')).to.have.length(4);
|
||||
pending[0]({available:true,last24h:7,severity:{error:1,warn:6,info:0}});await delay(40);
|
||||
expect(ui.window.document.querySelector('.history-source').textContent).to.include('older_failure');
|
||||
expect(ui.window.document.querySelector('.kpi-value').textContent).to.equal('7');
|
||||
await poll();
|
||||
expect(pending).to.have.length(2);
|
||||
pending[1]({__status:503,body:{}});await delay(25);
|
||||
expect(ui.window.document.querySelector('.history-management').textContent).to.include('Redis counters are unavailable');
|
||||
await poll();expect(pending).to.have.length(3);
|
||||
pending[2]({available:true,last24h:9,severity:{error:1,warn:8,info:0}});await delay(30);
|
||||
expect(ui.window.document.querySelector('.kpi-value').textContent).to.equal('9');
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it("marks an old central health snapshot stale without claiming current health", async () => {
|
||||
ui = await browser("/", {
|
||||
"/api/user": {username:"admin",isAdmin:true,status:"ready"},
|
||||
|
||||
Reference in new issue
Block a user