feat(ui): redesign the viewer, landing, author and admin screens

Viewer: full-height app bar with a Help menu, search + ZIP sidebar, one
toolbar for README and code, reading mode with a scroll-tracking outline,
docked find for Markdown and code, and redaction slots (a blank stone slot
holding the term number) in prose, headings, code, the tree and the path.

Landing and FAQ: live redaction demo, serif display headings, teal accent.

Author screens: My work table with copy/open/edit actions, a usage meter,
a single-container New anonymization flow with a sticky submit bar, themed
form controls, and consistent GitHub connection cards.

Admin: underline tabs, severity-first errors chart and list, error tiles
that filter (older pages load until matches appear), queue and overview
health states, and shared toolbar heights and borders.

Fixes: guarded localStorage access, failed README images render a
placeholder, phone hover states no longer stick, and UI tests updated for
the new copy and markup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Thomas DurieuxandClaude Opus 5.5 committed 2026-11-08 10:52:10 +00:00
1 parent 76e5804404
commit 579ce970c7
36 files changed
+4976 -541

No files matched your search

+3 -3
View File
@@ -1,8 +1,8 @@
{
"core.min.js": "core.d3798fb7a3.min.js",
"vendor.min.js": "vendor.fdbeebd5f9.min.js",
"core.min.js": "core.fefc61001a.min.js",
"vendor.min.js": "vendor.35208cb3e7.min.js",
"mermaid.min.js": "mermaid.f848a72d16.min.js",
"all.min.css": "all.273a6191f7.min.css",
"all.min.css": "all.40fdc12309.min.css",
"markdown.min.js": "markdown.1d3b1ed22a.min.js",
"pdf.min.js": "pdf.4d9cc6ff49.min.js",
"notebook.min.js": "notebook.c3144c18ae.min.js",
+1 -1
View File
@@ -6,4 +6,4 @@
*/:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unsLine truncated
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{contentLine truncated
*/.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{contentLine truncated
+3957 -190
View File
File diff suppressed because it is too large. Load diff
-22
View File
@@ -74,27 +74,5 @@
};
</script>
<script src="/script/__VENDOR_JS__" defer></script>
<script>
window.addEventListener("load", function () {
// Phones use the always-visible header link instead of an overlay.
if (window.matchMedia("(max-width: 991px)").matches) return;
var s = document.createElement("script");
s.src = "https://storage.ko-fi.com/cdn/scripts/overlay-widget.js";
s.onload = function () {
var isDark = localStorage.getItem("darkMode") === "true";
kofiWidgetOverlay.draw("tdurieux", {
type: "floating-chat",
"floating-chat.donateButton.text": "Support me",
"floating-chat.donateButton.background-color": isDark
? "#FAF9F6"
: "#1A1815",
"floating-chat.donateButton.text-color": isDark
? "#1A1815"
: "#FAF9F6",
});
};
document.body.appendChild(s);
});
</script>
</body>
</html>
+7 -6
View File
@@ -11,8 +11,9 @@
<a href="/admin/errors"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg> Errors</a>
</nav>
<div class="admin-summary">
<span class="summary-total">{{ total >= 0 ? fmt.number(total) : '…' }}</span>
<div class="admin-summary" :class="{ 'is-empty': total === 0 }">
<span class="summary-total">{{ total >= 0 ? fmt.number(total) : '…' }} <small>{{ total === 1 ? 'conference' : 'conferences' }}</small></span>
<span class="summary-show-label">Show:</span>
<button type="button" class="summary-pill ok" title="Toggle ready filter" :class="{active: query?.ready}" @click="query.ready = !query.ready; query.page = 1" :aria-pressed="!!(query?.ready)">Ready <span class="count">{{ fmt?.number(statusCountFor('ready')) }}</span></button>
<button type="button" class="summary-pill warn" title="Toggle preparing filter" :class="{active: query?.preparing}" @click="query.preparing = !query.preparing; query.page = 1" :aria-pressed="!!(query?.preparing)">Preparing <span class="count">{{ fmt?.number(statusCountFor('preparing')) }}</span></button>
<button type="button" class="summary-pill error" title="Toggle errored filter" :class="{active: query?.error}" @click="query.error = !query.error; query.page = 1" :aria-pressed="!!(query?.error)">Errored <span class="count">{{ fmt?.number(statusCountFor('error')) }}</span></button>
@@ -31,8 +32,8 @@
<span class="admin-search-hint" v-if="!query?.search">/</span>
</div>
<span class="admin-filter-spacer"></span>
<button class="btn btn-sm" type="button" @click="exportCsv()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-export"></use></svg> Export</button>
<span class="admin-filter-inline" aria-label="Pagination">
<button class="btn btn-sm" type="button" v-if="total &gt; 0" @click="exportCsv()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-export"></use></svg> Export</button>
<span class="admin-filter-inline" aria-label="Pagination" v-if="totalPage &gt; 1">
<button class="btn btn-sm btn-icon" type="button" @click="query.page = Math.max(1, query.page - 1)" :disabled="query?.page &lt;= 1" aria-label="Previous page"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-left"></use></svg></button>
<span style="font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted);">{{ query?.page }}/{{ totalPage || 1 }}</span>
<button class="btn btn-sm btn-icon" type="button" @click="query.page = Math.min(totalPage, query.page + 1)" :disabled="query?.page &gt;= totalPage" aria-label="Next page"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-right"></use></svg></button>
@@ -51,7 +52,7 @@
</form>
<div class="paper-table paper-table-conferences w-100" role="table" aria-label="Conferences">
<div class="paper-table-head" role="row">
<div class="paper-table-head" role="row" v-if="total !== 0">
<div role="columnheader"><button type="button" class="sortable" :class="{active: query?.sort == &#x27;name&#x27;}" @click="sortBy(&#x27;name&#x27;)">Conference <svg class="ui-icon sort-direction" aria-hidden="true" v-if="sortIcon(&#x27;name&#x27;)" :class="{ascending: sortIcon(&#x27;name&#x27;) === 'fa-arrow-up'}"><use href="#project-icon-arrow"></use></svg></button></div>
<div role="columnheader"><button type="button" class="sortable" :class="{active: query?.sort == &#x27;status&#x27;}" @click="sortBy(&#x27;status&#x27;)">Status <svg class="ui-icon sort-direction" aria-hidden="true" v-if="sortIcon(&#x27;status&#x27;)" :class="{ascending: sortIcon(&#x27;status&#x27;) === 'fa-arrow-up'}"><use href="#project-icon-arrow"></use></svg></button></div>
<div role="columnheader" class="num">Repos</div>
@@ -93,7 +94,7 @@
</div>
<div class="paper-table-empty" v-if="filteredConferences?.length == 0">
<svg class="ui-icon" aria-hidden="true"><use href="#project-icon-inbox"></use></svg>
<span>No conferences match the current filters.</span>
<span>{{ total ? 'No conferences match the current filters.' : 'No conferences yet.' }}</span>
</div>
</div>
+24 -23
View File
@@ -5,7 +5,7 @@
<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 CSV</button>
<button class="btn btn-sm btn-danger" type="button" @click="clearAll()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-trash"></use></svg> Clear all</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 all</button>
</div>
</header>
@@ -20,33 +20,33 @@
<section class="kpi-grid">
<div class="kpi-card">
<div class="kpi-label">Last 24h</div>
<div class="kpi-value">{{ stats?.last24h }}</div>
<div class="kpi-label">Occurrences · 24h</div>
<div class="kpi-value">{{ fmt?.number(stats?.last24h ?? 0) }}</div>
<div class="kpi-sub" :class="{up: stats?.delta &gt; 0, down: stats?.delta &lt; 0}">
<span v-if="stats?.prev24h">{{ stats?.delta > 0 ? '+' : '' }}{{ stats?.delta }}% vs yesterday</span>
<span v-if="stats?.prev24h &gt;= 20">{{ (stats?.last24h ?? 0) - (stats?.prev24h ?? 0) &gt;= 0 ? '+' : '' }}{{ Math.round(((stats?.last24h ?? 0) - (stats?.prev24h ?? 0)) / stats.prev24h * 100) }}% vs yesterday</span><span v-else-if="stats?.prev24h !== undefined">{{ fmt?.number(stats?.prev24h ?? 0) }} in prior 24h</span>
<span v-if="!stats?.prev24h">no prior baseline</span>
</div>
</div>
<div class="kpi-card kpi-error">
<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 5xx errors'" @click="setBucket(query?.bucket === 'error' ? '' : 'error')" @keydown.enter.prevent="setBucket(query?.bucket === 'error' ? '' : 'error')">
<div class="kpi-label">Errors (5xx)</div>
<div class="kpi-value">{{ stats?.severity?.error }}</div>
<div class="kpi-value">{{ fmt?.number(stats?.severity?.error ?? 0) }}</div>
<div class="kpi-sub">{{ stats?.unique?.error }} unique</div>
</div>
<div class="kpi-card kpi-warn">
<div class="kpi-label">Warnings (4xx)</div>
<div class="kpi-value">{{ stats?.severity?.warn }}</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 4xx responses'" @click="setBucket(query?.bucket === 'warn' ? '' : 'warn')" @keydown.enter.prevent="setBucket(query?.bucket === 'warn' ? '' : 'warn')">
<div class="kpi-label">4xx responses</div>
<div class="kpi-value">{{ fmt?.number(stats?.severity?.warn ?? 0) }}</div>
<div class="kpi-sub">{{ stats?.unique?.warn }} unique</div>
</div>
<div class="kpi-card kpi-info">
<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-label">Info (auth, 404)</div>
<div class="kpi-value">{{ stats?.severity?.info }}</div>
<div class="kpi-value">{{ fmt?.number(stats?.severity?.info ?? 0) }}</div>
<div class="kpi-sub">{{ stats?.unique?.info }} unique</div>
</div>
<div class="kpi-card" :class="{&#x27;kpi-error&#x27;: stats?.dropped &gt; 0}">
<div class="kpi-label">Captured</div>
<div class="kpi-value">{{ total }}</div>
<div class="kpi-label">Distinct errors stored</div>
<div class="kpi-value">{{ fmt?.number(total) }}</div>
<div class="kpi-sub">
cap {{ cap }} · {{ available ? 'live' : 'redis off' }}
all time · cap {{ fmt?.number(cap) }} · {{ available ? 'live' : 'redis off' }}
<span class="dropped-warn" v-if="stats?.dropped &gt; 0"> · {{ stats?.dropped }} dropped</span>
</div>
</div>
@@ -56,9 +56,9 @@
<div class="volume-head">
<span class="volume-title">Volume · 24h · 1h buckets</span>
<span class="volume-legend">
<span class="dot dot-error"></span>error
<span class="dot dot-warn"></span>warn
<span class="dot dot-info"></span>info
<span v-if="stats?.severity?.error"><span class="dot dot-error"></span>error</span>
<span v-if="stats?.severity?.warn"><span class="dot dot-warn"></span>warn</span>
<span v-if="stats?.severity?.info"><span class="dot dot-info"></span>info</span>
</span>
</div>
<div class="volume-bars">
@@ -68,6 +68,7 @@
<span class="seg seg-info" :style="{height: barPx(b, &#x27;info&#x27;) + &#x27;px&#x27;}"></span>
</div>
</div>
<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">
@@ -79,7 +80,7 @@
</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="code:repo_not_found module:route status:&gt;=400" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { query.search = value }, value: query?.search, form: null, options: {} }">
<input type="search" class="form-control" placeholder="Search code, module, status…" title="Syntax: code:repo_not_found module:route status:&gt;=400" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { 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">
@@ -99,15 +100,15 @@
</div>
<label class="autoref">
<input type="checkbox" v-field="{ state: viewState, set: value =&gt; { query.autoRefresh = value }, value: query?.autoRefresh, form: null, options: {} }">
Auto-refresh
<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>
<div class="admin-empty" v-if="!visible?.length">No errors captured.</div>
<div class="errors-pager" v-if="canLoadMore() &amp;&amp; visible?.length">
<span>Showing {{ entries?.length }} of {{ total }} captured</span>
<button class="btn btn-sm" type="button" @click="loadMore()">Load older</button>
<span>{{ query?.group &amp;&amp; visible?.length !== entries?.length ? fmt?.number(visible?.length) + (visible?.length === 1 ? ' group' : ' groups') + ' from ' : '' }}{{ fmt?.number(entries?.length) }} of {{ fmt?.number(total) }} stored errors loaded</span>
<button class="btn btn-sm" type="button" @click="loadMore()">Load 250 older</button>
</div>
<div class="errors-list" v-if="visible?.length">
@@ -116,7 +117,7 @@
<span class="col-sev">Severity</span>
<span class="col-mod">Module</span>
<span class="col-msg">Message</span>
<span class="col-count">Count</span>
<span class="col-count" title="Total occurrences since first seen">Total</span>
<span class="col-status">Status</span>
</div>
@@ -142,7 +143,7 @@
<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="&#x27;status-&#x27; + row?._bucket">{{ row?._status }}</span>
<span class="status-pill" v-if="row?._status" :class="String(row?._status).match(/^[23]/) ? 'status-neutral' : (&#x27;status-&#x27; + row?._bucket)" :title="String(row?._status).match(/^2/) &amp;&amp; row?._bucket === 'warn' ? 'Client closed the connection' : null">{{ String(row?._status).match(/^2/) &amp;&amp; row?._bucket === 'warn' ? '—' : row?._status }}</span>
</div>
</div>
+24 -18
View File
@@ -1,8 +1,9 @@
<div class="container paper-page admin-page overview-page">
<div class="paper-crumbs">Admin &middot; System Health</div>
<div class="paper-crumbs"><a href="/admin/">Admin</a> &nbsp;/&nbsp; <span class="here">Overview</span></div>
<div class="ov-header">
<h1 class="paper-page-title">Overview</h1>
<span class="ov-live"><span class="ov-live-dot" aria-hidden="true"></span>Live<span class="ov-live-extra"> &middot; refreshes every 30s</span></span>
</div>
<nav class="admin-nav">
@@ -20,27 +21,32 @@
<div v-if="data">
<div class="ov-health" role="status" v-if="data?.system?.memPercent &gt; 90 || data?.system?.diskPercent &gt; 90">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-warning"></use></svg>
<span><b>Server needs attention.</b> {{ [data?.system?.memPercent &gt; 85 ? 'Memory at ' + Math.round(data.system.memPercent) + '%.' : '', data?.system?.diskPercent &gt; 85 ? 'Disk at ' + Math.round(data.system.diskPercent) + '%.' : ''].filter(Boolean).join(' ') }} New anonymizations may fail until it drops.</span>
</div>
<!-- ── Top KPI row ──────────────────────────────────────────── -->
<section class="ov-kpi-row">
<div class="ov-kpi-card">
<div class="ov-kpi-label">Repositories <span class="ov-dot ov-dot-ok"></span></div>
<div class="ov-kpi-value">{{ humanNum(data?.repos?.total) }}</div>
<div class="ov-kpi-sub">+{{ data?.repos?.newRepos24h }} &middot; last 24h</div>
<div class="ov-kpi-label">Live repositories</div>
<div class="ov-kpi-value">{{ humanNum((data?.repos?.statusBreakdown || []).filter(s =&gt; s._id !== 'removed' &amp;&amp; s._id !== 'expired').reduce((a, s) =&gt; a + (s.count || 0), 0)) }}</div>
<div class="ov-kpi-sub">{{ humanNum(((data?.repos?.statusBreakdown || []).find(s =&gt; s._id === 'removed') || {}).count || 0) }} removed &middot; {{ humanNum(data?.repos?.total) }} total</div>
</div>
<div class="ov-kpi-card">
<div class="ov-kpi-label">CPU</div>
<div class="ov-kpi-value" :class="{&#x27;ov-val-warn&#x27;: data?.system?.cpuPercent &gt; 80}">{{ data?.system?.cpuPercent }}%</div>
<div class="ov-kpi-value" :class="{&#x27;ov-val-warn&#x27;: data?.system?.cpuPercent &gt; 80}">{{ data?.system?.cpuPercent }}%</div><div class="ov-meter" :class="{ warn: data?.system?.cpuPercent &gt; 80, crit: data?.system?.cpuPercent &gt; 90 }"><span :style="{ width: Math.min(100, data?.system?.cpuPercent || 0) + '%' }"></span></div>
<div class="ov-kpi-sub">{{ data?.system?.cpuCount }} cores &middot; load {{ data?.system?.loadAvg?.[0]?.toFixed(1) }}</div>
</div>
<div class="ov-kpi-card">
<div class="ov-kpi-label">Memory</div>
<div class="ov-kpi-value" :class="{&#x27;ov-val-warn&#x27;: data?.system?.memPercent &gt; 85}">{{ data?.system?.memPercent }}%</div>
<div class="ov-kpi-sub">{{ humanBytes(data?.system?.memUsed) }} / {{ humanBytes(data?.system?.memTotal) }}</div>
<div class="ov-kpi-value" :class="{&#x27;ov-val-warn&#x27;: data?.system?.memPercent &gt; 85}">{{ data?.system?.memPercent }}%</div><div class="ov-meter" :class="{ warn: data?.system?.memPercent &gt; 85, crit: data?.system?.memPercent &gt; 90 }"><span :style="{ width: Math.min(100, data?.system?.memPercent || 0) + '%' }"></span></div>
<div class="ov-kpi-sub"><b class="ov-flag" :class="{ critical: data?.system?.memPercent &gt; 90 }" v-if="data?.system?.memPercent &gt; 85">{{ data?.system?.memPercent &gt; 90 ? 'Critical' : 'High' }} · </b>{{ humanBytes(data?.system?.memUsed).replace(/\s*GB$/, '') }} / {{ humanBytes(data?.system?.memTotal) }}</div>
</div>
<div class="ov-kpi-card">
<div class="ov-kpi-label">Disk</div>
<div class="ov-kpi-value" :class="{&#x27;ov-val-warn&#x27;: data?.system?.diskPercent &gt; 85}">{{ data?.system?.diskPercent }}%</div>
<div class="ov-kpi-sub">{{ humanBytes(data?.system?.diskUsed) }} / {{ humanBytes(data?.system?.diskTotal) }} &middot; {{ data?.system?.diskMount }}</div>
<div class="ov-kpi-value" :class="{&#x27;ov-val-warn&#x27;: data?.system?.diskPercent &gt; 85}">{{ data?.system?.diskPercent }}%</div><div class="ov-meter" :class="{ warn: data?.system?.diskPercent &gt; 85, crit: data?.system?.diskPercent &gt; 90 }"><span :style="{ width: Math.min(100, data?.system?.diskPercent || 0) + '%' }"></span></div>
<div class="ov-kpi-sub"><b class="ov-flag" :class="{ critical: data?.system?.diskPercent &gt; 90 }" v-if="data?.system?.diskPercent &gt; 85">{{ data?.system?.diskPercent &gt; 90 ? 'Critical' : 'High' }} · </b>{{ humanBytes(data?.system?.diskUsed).replace(/\s*GB$/, '') }} / {{ humanBytes(data?.system?.diskTotal) }}<template v-if="data?.system?.diskMount &amp;&amp; data.system.diskMount !== '/'"> &middot; {{ data?.system?.diskMount }}</template></div>
</div>
<div class="ov-kpi-card">
<div class="ov-kpi-label">Uptime</div>
@@ -53,18 +59,18 @@
<section class="ov-daily-row">
<div class="ov-daily-card">
<div class="ov-daily-label">New repos today</div>
<div class="ov-daily-value">+{{ fmt?.number(data?.daily?.today?.repositories) }}</div>
<div class="ov-daily-sub">since yesterday</div>
<div class="ov-daily-value">{{ fmt?.number(data?.daily?.today?.repositories || 0) }}</div>
<div class="ov-daily-sub">so far today</div>
</div>
<div class="ov-daily-card">
<div class="ov-daily-label">New users today</div>
<div class="ov-daily-value">+{{ fmt?.number(data?.daily?.today?.users) }}</div>
<div class="ov-daily-value">{{ fmt?.number(data?.daily?.today?.users || 0) }}</div>
<div class="ov-daily-sub">{{ fmt?.number(data?.users?.total) }} total users</div>
</div>
<div class="ov-daily-card">
<div class="ov-daily-label">Page views today</div>
<div class="ov-daily-value">+{{ fmt?.number(data?.daily?.today?.pageViews) }}</div>
<div class="ov-daily-sub">since yesterday</div>
<div class="ov-daily-value">{{ fmt?.number(data?.daily?.today?.pageViews || 0) }}</div>
<div class="ov-daily-sub">so far today</div>
</div>
</section>
@@ -73,7 +79,7 @@
<div class="ov-chart-card">
<div class="ov-chart-head">
<span class="ov-chart-title">Daily page views &middot; 30d</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-accent"></span>views/day</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-accent"></span>views/day &middot; peak {{ fmt?.number(historyMax('dailyPageViews')) }}</span>
</div>
<div class="ov-spark-bars" v-if="data?.history?.length">
<div class="ov-spark-col has-tip" v-for="(d, index) in data?.history" :key="index" :data-tip="(historyLabel(d)) + &quot;: +&quot; + (fmt?.number(d?.dailyPageViews)) + &quot; views&quot;" :aria-label="(historyLabel(d)) + &quot;: +&quot; + (fmt?.number(d?.dailyPageViews)) + &quot; views&quot;">
@@ -89,7 +95,7 @@
<div class="ov-chart-card">
<div class="ov-chart-head">
<span class="ov-chart-title">New repos &middot; 30d</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-ok-fill"></span>repos/day</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-ok-fill"></span>repos/day &middot; peak {{ fmt?.number(historyMax('dailyRepositories')) }}</span>
</div>
<div class="ov-spark-bars" v-if="data?.history?.length">
<div class="ov-spark-col has-tip" v-for="(d, index) in data?.history" :key="index" :data-tip="(historyLabel(d)) + &quot;: +&quot; + (fmt?.number(d?.dailyRepositories)) + &quot; repos&quot;" :aria-label="(historyLabel(d)) + &quot;: +&quot; + (fmt?.number(d?.dailyRepositories)) + &quot; repos&quot;">
@@ -105,7 +111,7 @@
<div class="ov-chart-card">
<div class="ov-chart-head">
<span class="ov-chart-title">Users &middot; 30d</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-user-fill"></span>total users</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-user-fill"></span>total users &middot; peak {{ fmt?.number(historyMax('nbUsers')) }}</span>
</div>
<div class="ov-spark-bars" v-if="data?.history?.length">
<div class="ov-spark-col has-tip" v-for="(d, index) in data?.history" :key="index" :data-tip="(historyLabel(d)) + &quot;: &quot; + (fmt?.number(d?.nbUsers)) + &quot; users&quot;" :aria-label="(historyLabel(d)) + &quot;: &quot; + (fmt?.number(d?.nbUsers)) + &quot; users&quot;">
@@ -121,7 +127,7 @@
<div class="ov-chart-card">
<div class="ov-chart-head">
<span class="ov-chart-title">New users &middot; 30d</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-new-user-fill"></span>users/day</span>
<span class="ov-chart-legend"><span class="ov-dot-legend ov-dot-new-user-fill"></span>users/day &middot; peak {{ fmt?.number(historyMax('dailyUsers')) }}</span>
</div>
<div class="ov-spark-bars" v-if="data?.history?.length">
<div class="ov-spark-col has-tip" v-for="(d, index) in data?.history" :key="index" :data-tip="(historyLabel(d)) + &quot;: +&quot; + (fmt?.number(d?.dailyUsers)) + &quot; users&quot;" :aria-label="(historyLabel(d)) + &quot;: +&quot; + (fmt?.number(d?.dailyUsers)) + &quot; users&quot;">
+22 -21
View File
@@ -10,8 +10,8 @@
<button class="btn btn-sm" :class="{active: range == &#x27;24h&#x27;}" @click="setRange(&#x27;24h&#x27;)">24h</button>
<button class="btn btn-sm" :class="{active: range == &#x27;7d&#x27;}" @click="setRange(&#x27;7d&#x27;)">7d</button>
</div>
<button class="btn btn-sm" @click="pauseAll()">Pause all</button>
<button class="btn btn-sm btn-dark" @click="drainSelected()">Drain {{ selectedQueue }}</button>
<button class="btn btn-sm" @click="pauseAll()">Pause all queues</button>
</div>
</div>
@@ -28,7 +28,7 @@
<div class="q-cards">
<div class="q-card" role="button" tabindex="0" :aria-pressed="selectedQueue === q.key" @keydown.enter.prevent="selectQueue(q.key)" @keydown.space.prevent="selectQueue(q.key)" v-for="(q, index) in queueList" :class="{selected: selectedQueue == q?.key, paused: q?.paused}" @click="selectQueue(q.key)">
<div class="q-card-head">
<span class="q-dot" :class="{&#x27;q-dot-red&#x27;: q?.paused || q?.counts?.failed &gt; 0}"></span>
<span class="q-dot" :class="{&#x27;q-dot-red&#x27;: q?.paused || q?.counts?.failed &gt; 0, &#x27;q-dot-idle&#x27;: !q?.counts?.active &amp;&amp; !q?.counts?.waiting}"></span>
<span class="q-card-name" v-text="q?.label"></span>
</div>
<div class="q-card-count" v-text="(q?.counts?.waiting || 0) + (q?.counts?.active || 0) + (q?.counts?.delayed || 0)"></div>
@@ -44,45 +44,46 @@
<!-- Detail: throughput chart + stats panel -->
<div class="q-detail" v-if="selectedStats">
<div class="q-throughput">
<div class="q-section-label">{{ selectedQueue }}&middot;throughput <span class="q-section-right"><span class="q-legend-completed">&#9679;</span> completed <span class="q-legend-failed">&#9679;</span> failed <span class="q-legend-exec">- -</span> avg time &middot; {{ fmt?.uppercase(range) }}</span></div>
<div class="q-section-label">Throughput · {{ selectedQueue }} <span class="q-section-right" v-if="(selectedStats?.completed24h || 0) + (selectedStats?.failed24h || 0) &gt; 0"><span class="q-legend-completed">&#9679;</span> completed <span class="q-legend-failed">&#9679;</span> failed <template v-if="(selectedStats?.completed24h || 0) + (selectedStats?.failed24h || 0) &gt; 0"><span class="q-legend-exec" aria-hidden="true"></span> avg time &middot; {{ range }}</template></span></div>
<div class="q-chart-wrap">
<canvas id="q-throughput-chart" height="180"></canvas>
<div class="q-chart-empty" v-if="(selectedStats?.completed24h || 0) + (selectedStats?.failed24h || 0) === 0"><strong>No jobs processed in this window</strong><span>Completed and failed jobs will chart here.</span></div>
<div id="q-chart-tooltip" class="q-chart-tooltip" style="display:none;"></div>
<div id="q-chart-crosshair" class="q-chart-crosshair" style="display:none;"></div>
</div>
</div>
<div class="q-stats-panel">
<div class="q-section-label">{{ selectedQueue }}&middot;stats</div>
<div class="q-section-label">Stats · {{ selectedQueue }}</div>
<div class="q-stats-grid">
<div class="q-stat">
<div class="q-stat-label">WAITING</div>
<div class="q-stat-label">Waiting</div>
<div class="q-stat-value" v-text="selectedStats?.counts?.waiting || 0"></div>
</div>
<div class="q-stat">
<div class="q-stat-label">ACTIVE</div>
<div class="q-stat-label">Active</div>
<div class="q-stat-value" v-text="selectedStats?.counts?.active || 0"></div>
</div>
<div class="q-stat">
<div class="q-stat-label">COMPLETED (24H)</div>
<div class="q-stat-label">Completed (24h)</div>
<div class="q-stat-value" v-text="fmt?.number(selectedStats?.completed24h)"></div>
</div>
<div class="q-stat">
<div class="q-stat-label">FAILED (24H)</div>
<div class="q-stat-label">Failed (24h)</div>
<div class="q-stat-value" v-text="selectedStats?.failed24h || 0"></div>
</div>
<div class="q-stat">
<div class="q-stat-label">DELAYED</div>
<div class="q-stat-label">Delayed</div>
<div class="q-stat-value" v-text="selectedStats?.counts?.delayed || 0"></div>
</div>
<div class="q-stat">
<div class="q-stat-label">WORKERS</div>
<div class="q-stat-label">Workers</div>
<div class="q-stat-value" v-text="selectedStats?.workers || 0"></div>
</div>
</div>
<div class="q-stats-actions">
<button class="btn btn-sm" @click="togglePause()">{{ selectedStats?.paused ? 'Resume' : 'Pause' }}</button>
<button class="btn btn-sm" @click="togglePause()">{{ selectedStats?.paused ? 'Resume ' + selectedQueue : 'Pause ' + selectedQueue }}</button>
<button class="btn btn-sm" @click="retryFailed()" :disabled="!selectedStats?.counts?.failed">Retry failed</button>
<button class="btn btn-sm" @click="emptyQueue()">Empty</button>
<span class="q-danger-group"><button class="btn btn-sm btn-outline-danger" @click="drainSelected()">Drain</button><button class="btn btn-sm btn-outline-danger" @click="emptyQueue()">Empty</button></span>
</div>
</div>
</div>
@@ -94,7 +95,7 @@
<!-- Jobs table -->
<div class="q-jobs">
<div class="q-jobs-header">
<div class="q-section-label">ALL JOBS &middot; {{ fmt?.uppercase(selectedQueue) }}</div>
<div class="q-section-label">All jobs · {{ selectedQueue }}</div>
<div class="q-state-filters">
<label class="q-state-toggle" v-for="(s, index) in allStates">
<input type="checkbox" v-field="{ state: viewState, set: value =&gt; { stateFilter[s] = value }, value: stateFilter[s], form: null, options: {} }">
@@ -107,7 +108,7 @@
<input type="search" class="form-control" placeholder="Search by job/repo id…" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { query.search = value }, value: query?.search, form: null, options: {} }">
<label class="q-auto-refresh">
<input type="checkbox" v-field="{ state: viewState, set: value =&gt; { query.autoRefresh = value }, value: query?.autoRefresh, form: null, options: {} }">
Auto-refresh
<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>
</div>
@@ -115,12 +116,12 @@
<table class="q-table" v-if="filteredJobs().length &gt; 0">
<thead>
<tr>
<th>STATE</th>
<th>JOB ID</th>
<th>PAYLOAD</th>
<th>ATTEMPTS</th>
<th>DURATION</th>
<th>PROGRESS</th>
<th>State</th>
<th>Job ID</th>
<th>Payload</th>
<th>Attempts</th>
<th>Duration</th>
<th>Progress</th>
<th></th>
</tr>
</thead>
+10 -7
View File
@@ -12,13 +12,14 @@
</nav>
<div class="admin-summary">
<span class="summary-total">{{ total >= 0 ? fmt.number(total) : '…' }}</span>
<span class="summary-total">{{ total >= 0 ? fmt.number(total) : '…' }} <small>{{ total === 1 ? 'repository' : 'repositories' }}</small></span>
<span class="summary-meta">{{ fmt?.humanFileSize(totalSize) }} on disk</span>
<span class="summary-show-label">Show:</span>
<button type="button" class="summary-pill ok" title="Toggle ready filter" :class="{active: query?.ready}" @click="query.ready = !query.ready; query.page = 1" :aria-pressed="!!(query?.ready)">Ready <span class="count">{{ fmt?.number(statusCountFor('ready')) }}</span></button>
<button type="button" class="summary-pill warn" title="Toggle preparing filter" :class="{active: query?.preparing}" @click="query.preparing = !query.preparing; query.page = 1" :aria-pressed="!!(query?.preparing)">Preparing <span class="count">{{ fmt?.number(statusCountFor('preparing') + statusCountFor('download')) }}</span></button>
<button type="button" class="summary-pill error" title="Toggle errored filter" :class="{active: query?.error}" @click="query.error = !query.error; query.page = 1" :aria-pressed="!!(query?.error)">Errored <span class="count">{{ fmt?.number(statusCountFor('error')) }}</span></button>
<button type="button" class="summary-pill" title="Toggle expired filter" :class="{active: query?.expired}" @click="query.expired = !query.expired; query.page = 1" :aria-pressed="!!(query?.expired)">Expired <span class="count">{{ fmt?.number(statusCountFor('expired') + statusCountFor('expiring')) }}</span></button>
<button type="button" class="summary-pill" title="Toggle removed filter" :class="{active: query?.removed}" @click="query.removed = !query.removed; query.page = 1" :aria-pressed="!!(query?.removed)">Removed <span class="count">{{ fmt?.number(statusCountFor('removed') + statusCountFor('removing')) }}</span></button>
<button type="button" class="summary-pill" :title="query?.removed ? 'Removed repositories are shown. Click to hide them.' : 'Removed repositories are hidden. Click to include them.'" :class="{active: query?.removed}" @click="query.removed = !query.removed; query.page = 1" :aria-pressed="!!(query?.removed)">Removed <span class="count">{{ fmt?.number(statusCountFor('removed') + statusCountFor('removing')) }}</span></button>
</div>
<div class="alert alert-danger" style="margin: 8px 0;" v-if="fetchError">
@@ -27,16 +28,17 @@
<form class="w-100 admin-filter-toolbar" aria-label="Repositories" accept-charset="UTF-8" v-form="viewState">
<!-- Row 1: search + scoped inputs + headline actions -->
<div class="admin-filter-row">
<button type="button" class="btn btn-sm admin-filters-toggle" @click="filtersOpen = !filtersOpen" :aria-expanded="filtersOpen ? 'true' : 'false'">Filters</button>
<div class="admin-filter-row" :class="{ 'is-open': filtersOpen }">
<div class="search-wrap">
<input type="search" class="form-control" aria-label="Search repositories" placeholder="Search repoId, source repo, error message…" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { query.search = value }, value: query?.search, form: null, options: {} }">
<input type="search" class="form-control" aria-label="Search repositories" placeholder="Search repositories…" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { query.search = value }, value: query?.search, form: null, options: {} }">
<span class="admin-search-hint" v-if="!query?.search">/</span>
</div>
<span class="admin-filter-inline"><label>Owner</label><input type="text" class="form-control form-control-sm" placeholder="username" v-field="{ state: viewState, set: value =&gt; { query.owner = value }, value: query?.owner, form: null, options: {} }"></span>
<span class="admin-filter-inline"><label>Conference</label><input type="text" class="form-control form-control-sm" placeholder="ID" v-field="{ state: viewState, set: value =&gt; { query.conference = value }, value: query?.conference, form: null, options: {} }"></span>
<span class="admin-filter-spacer"></span>
<button class="btn btn-sm" type="button" title="Export current view to CSV" @click="exportCsv()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-export"></use></svg> Export</button>
<span class="admin-filter-inline" aria-label="Pagination">
<span class="admin-filter-inline" aria-label="Pagination" v-if="totalPage &gt; 1">
<button class="btn btn-sm btn-icon" type="button" @click="query.page = Math.max(1, query.page - 1)" :disabled="query?.page &lt;= 1" aria-label="Previous page"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-left"></use></svg></button>
<span style="font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted);">{{ query?.page }}/{{ totalPage || 1 }}</span>
<button class="btn btn-sm btn-icon" type="button" @click="query.page = Math.min(totalPage, query.page + 1)" :disabled="query?.page &gt;= totalPage" aria-label="Next page"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-right"></use></svg></button>
@@ -82,7 +84,7 @@
<div class="anon-text">
<a class="repo-name" target="_blank" v-text="repo?.repoId" :href="safeUrl(&quot;/r/&quot; + (repo?.repoId))"></a>
<div class="anon-sub">
<a v-text="repo?.source?.repositoryName" :href="safeUrl(&quot;https://github.com/&quot; + (repo?.source?.repositoryName) + &quot;/&quot;)"></a><span v-if="repo?.options?.update">&nbsp;&middot;&nbsp;<a v-text="repo?.source?.branch" :href="safeUrl(&quot;https://github.com/&quot; + (repo?.source?.fullName) + &quot;/tree/&quot; + (repo?.source?.branch))"></a></span><span v-if="!repo?.options?.update">&nbsp;&middot;&nbsp;@<a v-text="repo?.source?.commit?.substring(0, 8)" :href="safeUrl(&quot;https://github.com/&quot; + (repo?.source?.fullName) + &quot;/tree/&quot; + (repo?.source?.commit))"></a></span><span v-if="repo?.conference">&nbsp;&middot;&nbsp;<svg class="ui-icon" aria-hidden="true"><use href="#project-icon-conference"></use></svg> {{ repo?.conference }}</span><span>&nbsp;&middot;&nbsp;{{ fmt?.humanFileSize(repo?.size?.storage) }}</span><span>&nbsp;&middot;&nbsp;{{ fmt?.number(repo?.options?.terms?.length) }} terms</span>
<a v-text="repo?.source?.repositoryName" :href="safeUrl(&quot;https://github.com/&quot; + (repo?.source?.repositoryName) + &quot;/&quot;)"></a><span class="meta-sep" v-if="repo?.options?.update"><a v-text="repo?.source?.branch" :href="safeUrl(&quot;https://github.com/&quot; + (repo?.source?.fullName) + &quot;/tree/&quot; + (repo?.source?.branch))"></a></span><span class="meta-sep" v-if="!repo?.options?.update"><a class="mono-hash" v-text="repo?.source?.commit?.substring(0, 7)" :href="safeUrl(&quot;https://github.com/&quot; + (repo?.source?.fullName) + &quot;/tree/&quot; + (repo?.source?.commit))"></a></span><span class="meta-sep" v-if="repo?.conference"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-conference"></use></svg> {{ repo?.conference }}</span><span class="meta-sep" v-if="repo?.size?.storage &gt; 0">{{ fmt?.humanFileSize(repo?.size?.storage) }}</span><span>{{ fmt?.number(repo?.options?.terms?.length) }} {{ repo?.options?.terms?.length === 1 ? 'term' : 'terms' }}</span>
</div>
</div>
</div>
@@ -94,7 +96,7 @@
<span class="status-sub" v-if="repo?.statusMessage" v-text="fmt?.statusMsg(repo?.statusMessage)" :title="(repo?.statusMessage)"></span>
</div>
<div class="cell-views num" role="cell"><svg class="ui-icon mobile-meta-icon" aria-hidden="true"><use href="#project-icon-eye"></use></svg> <span v-text="fmt?.number(repo?.pageView || 0)"></span></div>
<div class="cell-expires" role="cell"><svg class="ui-icon mobile-meta-icon" aria-hidden="true"><use href="#project-icon-clock"></use></svg> <span v-text="fmt?.humanTime(repo?.anonymizeDate)"></span></div>
<div class="cell-expires" role="cell"><svg class="ui-icon mobile-meta-icon" aria-hidden="true"><use href="#project-icon-clock"></use></svg> <span v-text="(fmt?.humanTime(repo?.anonymizeDate) || '').replace(/^on /, '')"></span></div>
<div class="cell-actions" role="cell">
<div class="dropdown">
<button class="btn btn-icon-dots" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Actions">
@@ -119,6 +121,7 @@
<div class="paper-table-empty" v-if="filteredRepositories?.length == 0">
<svg class="ui-icon" aria-hidden="true"><use href="#project-icon-inbox"></use></svg>
<span>No repositories match the current filters.</span>
<button type="button" class="btn btn-sm btn-outline-ink" v-if="!(query.ready &amp;&amp; query.expired &amp;&amp; query.removed &amp;&amp; query.error &amp;&amp; query.preparing)" @click="showAllStatuses()">Show all statuses</button>
</div>
</div>
+10 -10
View File
@@ -1,5 +1,5 @@
<div class="container paper-page admin-page">
<div class="paper-crumbs"><a href="/admin/users">Users</a> &nbsp;/&nbsp; <span class="here">{{ userInfo?.username || 'Profile' }}</span></div>
<div class="paper-crumbs"><a href="/admin/">Admin</a> &nbsp;/&nbsp; <a href="/admin/users">Users</a> &nbsp;/&nbsp; <span class="here">{{ userInfo?.username || 'Profile' }}</span></div>
<h1 class="paper-page-title">{{ userInfo?.username || 'User' }}</h1>
<nav class="admin-nav">
@@ -24,23 +24,23 @@
<span class="type-badge type-repo" v-if="userInfo?.isAdmin">Admin</span>
</h2>
<div class="user-actions" style="margin-top: 4px;">
<button class="btn btn-sm text-danger" v-if="userInfo?.status !== &#x27;banned&#x27;" @click="banUser()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-ban"></use></svg> Ban</button>
<button class="btn btn-sm btn-outline-danger" v-if="userInfo?.status !== &#x27;banned&#x27; &amp;&amp; userInfo?.username !== user?.username" @click="banUser()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-ban"></use></svg> Ban</button>
<button class="btn btn-sm" v-if="userInfo?.status === &#x27;banned&#x27; || userInfo?.status === &#x27;removed&#x27;" @click="activateUser()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-check-circle"></use></svg> Activate</button>
<button class="btn btn-sm" v-if="!userInfo?.isAdmin" @click="promoteUser()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-user-shield"></use></svg> Promote to admin</button>
<button class="btn btn-sm text-danger" v-if="userInfo?.isAdmin" @click="demoteUser()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-user-minus"></use></svg> Remove admin</button>
<button class="btn btn-sm btn-outline-ink" v-if="userInfo?.isAdmin &amp;&amp; userInfo?.username !== user?.username" @click="demoteUser()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-user-minus"></use></svg> Remove admin</button>
</div>
</div>
</div>
<div class="user-detail-grid">
<div class="detail-label">ID</div>
<div class="detail-value">{{ userInfo?._id }}</div>
<div class="detail-value mono-id">{{ userInfo?._id }}</div>
<div class="detail-label">Email</div>
<div class="detail-value">{{ userInfo?.emails?.[0]?.email }}</div>
<div class="detail-value" :class="{ 'is-empty': !userInfo?.emails?.[0]?.email }">{{ userInfo?.emails?.[0]?.email || 'Not shared' }}</div>
<div class="detail-label">Access token</div>
<div class="detail-value" style="font-family: var(--font-mono); font-size: 0.85rem;">{{ userInfo?.accessTokens?.github }}</div>
<div class="detail-value" :class="{ 'is-empty': !userInfo?.accessTokens?.github }" style="font-family: var(--font-mono); font-size: 0.85rem;">{{ userInfo?.accessTokens?.github || 'Not stored' }}</div>
<div class="detail-label">GitHub</div>
<div class="detail-value">
@@ -55,14 +55,14 @@
<div class="detail-label">Last connection</div>
<div class="detail-value">
<span v-if="userInfo?.accessTokenDates?.github">{{ fmt?.humanTime(userInfo?.accessTokenDates?.github) }}</span>
<span class="text-muted" v-if="!userInfo?.accessTokenDates?.github">never</span>
<span class="text-muted" v-if="!userInfo?.accessTokenDates?.github">Not recorded (GitHub App sign-in)</span>
</div>
<div class="detail-label">GitHub repos</div>
<div class="detail-value">
{{ userInfo?.repositories?.length }} repositories
<button class="btn btn-sm ml-2" @click="showRepos = !showRepos">
{{ showRepos ? 'Hide' : 'Show' }}
{{ userInfo?.repositories?.length ? userInfo.repositories.length + " repositories" : "Not synced" }}
<button class="btn btn-sm ml-2" v-if="userInfo?.repositories?.length" @click="showRepos = !showRepos">
{{ showRepos ? 'Hide repos' : 'Show repos' }}
</button>
<button class="btn btn-sm ml-1" @click="getGitHubRepositories()">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-refresh"></use></svg> Refresh
+7 -5
View File
@@ -12,7 +12,8 @@
</nav>
<div class="admin-summary">
<span class="summary-total">{{ total >= 0 ? fmt.number(total) : '…' }}</span>
<span class="summary-total">{{ total >= 0 ? fmt.number(total) : '…' }} <small>{{ total === 1 ? 'user' : 'users' }}</small></span>
<button type="button" class="summary-pill" :class="{active: !query?.status}" @click="query.status = ''; query.page = 1" :aria-pressed="!query?.status">All <span class="count">{{ fmt?.number(total) }}</span></button>
<button type="button" class="summary-pill ok" :class="{active: query?.status == &#x27;active&#x27;}" @click="query.status = query.status == &#x27;active&#x27; ? &#x27;&#x27; : &#x27;active&#x27;; query.page = 1" :aria-pressed="!!(query?.status == &#x27;active&#x27;)">Active <span class="count">{{ fmt?.number(statusCountFor('active')) }}</span></button>
<button type="button" class="summary-pill error" :class="{active: query?.status == &#x27;banned&#x27;}" @click="query.status = query.status == &#x27;banned&#x27; ? &#x27;&#x27; : &#x27;banned&#x27;; query.page = 1" :aria-pressed="!!(query?.status == &#x27;banned&#x27;)">Banned <span class="count">{{ fmt?.number(statusCountFor('banned')) }}</span></button>
<button type="button" class="summary-pill" :class="{active: query?.status == &#x27;removed&#x27;}" @click="query.status = query.status == &#x27;removed&#x27; ? &#x27;&#x27; : &#x27;removed&#x27;; query.page = 1" :aria-pressed="!!(query?.status == &#x27;removed&#x27;)">Removed <span class="count">{{ fmt?.number(statusCountFor('removed')) }}</span></button>
@@ -33,7 +34,7 @@
</span>
<span class="admin-filter-spacer"></span>
<button class="btn btn-sm" type="button" @click="exportCsv()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-export"></use></svg> Export</button>
<span class="admin-filter-inline" aria-label="Pagination">
<span class="admin-filter-inline" aria-label="Pagination" v-if="totalPage &gt; 1">
<button class="btn btn-sm btn-icon" type="button" @click="query.page = Math.max(1, query.page - 1)" :disabled="query?.page &lt;= 1" aria-label="Previous page"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-left"></use></svg></button>
<span style="font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted);">{{ query?.page }}/{{ totalPage || 1 }}</span>
<button class="btn btn-sm btn-icon" type="button" @click="query.page = Math.min(totalPage, query.page + 1)" :disabled="query?.page &gt;= totalPage" aria-label="Next page"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-right"></use></svg></button>
@@ -63,7 +64,7 @@
<input type="checkbox" aria-label="Select all on page" @click="selectAllOnPage()" :checked="allSelected">
</div>
<div role="columnheader"><button type="button" class="sortable" :class="{active: query?.sort == &#x27;username&#x27;}" @click="sortBy(&#x27;username&#x27;)">User <svg class="ui-icon sort-direction" aria-hidden="true" v-if="sortIcon(&#x27;username&#x27;)" :class="{ascending: sortIcon(&#x27;username&#x27;) === 'fa-arrow-up'}"><use href="#project-icon-arrow"></use></svg></button></div>
<div role="columnheader" class="num">Repos</div>
<div role="columnheader" class="num" title="Repositories discovered on the user's GitHub account">GitHub repos</div>
<div role="columnheader"><button type="button" class="sortable" :class="{active: query?.sort == &#x27;status&#x27;}" @click="sortBy(&#x27;status&#x27;)">Status <svg class="ui-icon sort-direction" aria-hidden="true" v-if="sortIcon(&#x27;status&#x27;)" :class="{ascending: sortIcon(&#x27;status&#x27;) === 'fa-arrow-up'}"><use href="#project-icon-arrow"></use></svg></button></div>
<div role="columnheader">Role</div>
<div role="columnheader" aria-label="Actions"></div>
@@ -74,6 +75,7 @@
</div>
<div class="cell-anon" role="cell">
<img width="28" height="28" class="rounded-circle" style="flex-shrink:0;" v-if="u?.photo" :src="safeUrl((u?.photo))">
<span class="avatar-fallback" aria-hidden="true" v-else>{{ (u?.username || '?').charAt(0).toUpperCase() }}</span>
<div class="anon-text">
<a class="repo-name" v-text="u?.username" :href="safeUrl(&quot;/admin/users/&quot; + (u?.username))"></a>
<div class="anon-sub">
@@ -82,14 +84,14 @@
</div>
</div>
<div class="cell-views num" role="cell"><svg class="ui-icon mobile-meta-icon" aria-hidden="true"><use href="#project-type-repo"></use></svg>
<a title="Show this user&#x27;s repositories" v-text="fmt?.number((u?.repoCount || 0))" :href="safeUrl(&quot;/admin/repositories?owner=&quot; + (u?.username))"></a>
<a :title="u?.repoCount ? 'Show this user’s repositories' : 'Repositories not synced yet'" v-text="u?.repoCount ? fmt?.number(u.repoCount) : 'Not synced'" :class="{ 'is-unsynced': !u?.repoCount }" :href="safeUrl(&quot;/admin/repositories?owner=&quot; + (u?.username))"></a>
</div>
<div class="cell-status" role="cell">
<span class="status-dot" :class="{&#x27;status-ready&#x27;: u?.status == &#x27;active&#x27;, &#x27;status-removed&#x27;: u?.status == &#x27;removed&#x27; || u?.status == &#x27;banned&#x27;}"></span>
<span v-text="fmt?.title(u?.status)"></span>
</div>
<div class="cell-status" role="cell">
<span class="type-badge type-repo" v-if="u?.isAdmin">Admin</span>
<span class="role-pill" v-if="u?.isAdmin">Admin</span>
<span class="empty-dash" v-if="!u?.isAdmin">&mdash;</span>
</div>
<div class="cell-actions" role="cell">
+12 -16
View File
@@ -5,9 +5,7 @@
<div class="paper-crumbs">My work &nbsp;/&nbsp; <span class="here">New anonymization</span></div>
<h1 class="paper-page-title">New <em>anonymization</em></h1>
<p class="paper-page-lede">
Paste a GitHub repository, pull-request, or gist URL. We&rsquo;ll fetch
it, redact the terms you choose in text files, and give you a share link.
Images and PDFs are served unchanged when enabled. Review them before sharing.
Paste a repository, pull request, or gist URL. You&rsquo;ll choose the terms to redact next.
</p>
<div class="form-group mt-4 mb-2">
<div class="source-url-label-row">
@@ -20,9 +18,8 @@
<span class="connection-badge" v-if="isUpdate || detectedType === 'gist'">{{ (detectedType === 'gist' ? githubConnections?.gistConnection === 'github-app' : githubConnection === 'github-app') ? 'Read-only GitHub App' : 'Legacy OAuth' }}</span>
</aside>
</div>
<input id="sourceUrl-landing" type="text" class="form-control form-control-lg" placeholder="https://github.com/owner/repository" v-field="{ state: viewState, set: value =&gt; { sourceUrl = value }, value: sourceUrl, form: null, options: { debounce: {default: 1000, blur: 0, click: 0}, updateOn: &#x27;default blur click&#x27; }, change: () =&gt; { urlSelected() } }">
<div class="landing-url-row"><input id="sourceUrl-landing" onblur="this.scrollLeft=0" type="text" class="form-control form-control-lg" placeholder="https://github.com/owner/repository" v-field="{ state: viewState, set: value =&gt; { sourceUrl = value }, value: sourceUrl, form: null, options: { debounce: {default: 1000, blur: 0, click: 0}, updateOn: &#x27;default blur click&#x27; }, change: () =&gt; { urlSelected() } }"><button type="button" class="btn btn-primary landing-continue" :aria-disabled="!sourceUrl ? 'true' : null" @click="sourceUrl && urlSelected()">Continue</button></div>
</div>
<div class="draft-status" role="status" v-if="draftRestored">Your unsaved draft was restored. <button type="button" class="draft-discard" @click="discardDraft()">Discard draft</button></div>
<p class="text-danger" role="alert" v-if="sourceUrlError">{{ sourceUrlError }}</p>
<small class="form-text" style="color: var(--ink-muted);">
Repository, pull request (…/pull/42) and gist (gist.github.com/…) URLs are all accepted.
@@ -30,7 +27,7 @@
<aside class="repo-access-details" aria-label="GitHub access" v-if="!sourceUrl &amp;&amp; githubConnections?.appEnabled &amp;&amp; githubConnections.appConnected &amp;&amp; githubConnections.oauthConnected">
<div class="repo-access-main">
<div class="repo-access-controls">
<button type="button" class="btn btn-outline-ink" v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth'" @click="grantGitHubAccess()">Manage access <svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-external-link"></use></svg></button>
<span class="access-q" v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth'">Repository not listed?</span><button type="button" class="btn btn-outline-ink" v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth'" @click="grantGitHubAccess()">Manage access <svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-external-link"></use></svg></button>
<a class="connection-link" href="/connections" v-if="isUpdate || detectedType === 'gist' || githubConnection === 'oauth'">{{ isUpdate ? 'Change connection' : 'Manage connections' }} &rarr;</a>
</div>
</div>
@@ -53,7 +50,7 @@
<span v-if="isUpdate">Edit <em>anonymization</em></span>
</h1>
<span class="type-badge" v-show="detectedType" :class="{&#x27;type-repo&#x27;: detectedType === &#x27;repo&#x27;, &#x27;type-pr&#x27;: detectedType === &#x27;pr&#x27;, &#x27;type-gist&#x27;: detectedType === &#x27;gist&#x27;}">
{{ detectedType === 'repo' ? 'Repo' : detectedType === 'pr' ? 'PR' : 'Gist' }}
{{ detectedType === 'repo' ? 'Repository' : detectedType === 'pr' ? 'Pull request' : 'Gist' }}
</span>
</div>
</div>
@@ -85,7 +82,7 @@
<div class="form-group">
<div class="source-url-label-row">
<label class="paper-field-label" for="sourceUrl">GitHub URL</label>
<label class="paper-field-label" for="sourceUrl">Source URL</label>
<aside class="repo-access" aria-label="GitHub access" v-if="sourceUrl &amp;&amp; githubConnections?.appEnabled &amp;&amp; githubConnections.appConnected &amp;&amp; githubConnections.oauthConnected">
<div class="repo-access-switch" role="group" aria-label="Repository connection" v-if="!isUpdate &amp;&amp; detectedType !== 'gist'">
<button type="button" :aria-pressed="githubConnection === 'github-app'" :disabled="githubConnection === 'github-app'" @click="chooseGitHubConnection('github-app')"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-shield"></use></svg> <span class="sr-only">Read-only </span>GitHub App</button>
@@ -94,7 +91,7 @@
<span class="connection-badge" v-if="isUpdate || detectedType === 'gist'">{{ (detectedType === 'gist' ? githubConnections?.gistConnection === 'github-app' : githubConnection === 'github-app') ? 'Read-only GitHub App' : 'Legacy OAuth' }}</span>
</aside>
</div>
<input type="text" class="form-control" name="sourceUrl" id="sourceUrl" :disabled="isUpdate &amp;&amp; detectedType !== &#x27;repo&#x27;" placeholder="Paste a GitHub repo or pull request URL" v-field="{ state: viewState, set: value =&gt; { sourceUrl = value }, value: sourceUrl, form: &quot;anonymize&quot;, options: { debounce: {default: 1000, blur: 0, click: 0}, updateOn: &#x27;default blur click&#x27; }, change: () =&gt; { urlSelected() } }" :class="{&#x27;is-invalid&#x27;: anonymize?.sourceUrl?.invalid}">
<input type="text" class="form-control" name="sourceUrl" id="sourceUrl" onblur="this.scrollLeft=0" :disabled="isUpdate &amp;&amp; detectedType !== &#x27;repo&#x27;" placeholder="Paste a GitHub repo or pull request URL" v-field="{ state: viewState, set: value =&gt; { sourceUrl = value }, value: sourceUrl, form: &quot;anonymize&quot;, options: { debounce: {default: 1000, blur: 0, click: 0}, updateOn: &#x27;default blur click&#x27; }, change: () =&gt; { urlSelected() } }" :class="{&#x27;is-invalid&#x27;: anonymize?.sourceUrl?.invalid}">
<div class="invalid-feedback" v-show="anonymize?.sourceUrl?.errors?.github">
Please provide a valid GitHub URL.
</div>
@@ -112,11 +109,11 @@
<aside class="repo-access-details" aria-label="GitHub access" v-if="sourceUrl &amp;&amp; githubConnections?.appEnabled &amp;&amp; githubConnections.appConnected &amp;&amp; githubConnections.oauthConnected">
<div class="repo-access-main">
<div class="repo-access-controls">
<button type="button" class="btn btn-outline-ink" v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth'" @click="grantGitHubAccess()">Manage access <svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-external-link"></use></svg></button>
<span class="access-q" v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth' &amp;&amp; !details">Repository not listed?</span><button type="button" class="btn btn-outline-ink" v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth' &amp;&amp; !details" @click="grantGitHubAccess()">Manage access <svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-external-link"></use></svg></button>
<a class="connection-link" href="/connections" v-if="isUpdate || detectedType === 'gist' || githubConnection === 'oauth'">{{ isUpdate ? 'Change connection' : 'Manage connections' }} &rarr;</a>
</div>
</div>
<div class="repo-access-note"><span v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth'">Select repositories on GitHub, then return here.</span><span><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-info"></use></svg> Selected content will be published, including content from private repositories.</span></div>
<div class="repo-access-note"><span v-if="detectedType !== 'gist' &amp;&amp; githubConnection !== 'oauth' &amp;&amp; !details">Select repositories on GitHub, then return here.</span><span><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-info"></use></svg> Selected content will be published, including content from private repositories.</span></div>
</aside>
<aside class="repo-access-details" v-if="isUpdate &amp;&amp; detectedType === 'repo' &amp;&amp; role === 'owner' &amp;&amp; sourceUrl === 'https://github.com/' + _originalFullName">
@@ -202,7 +199,7 @@
<div class="form-group">
<label class="paper-field-label" for="terms">Terms to redact</label>
<textarea class="form-control" id="terms" name="terms" rows="4" v-field="{ state: viewState, set: value =&gt; { terms = value }, value: terms, form: &quot;anonymize&quot;, options: { debounce: 250 } }" :class="{&#x27;is-invalid&#x27;: anonymize?.terms?.invalid}"></textarea>
<textarea class="form-control" id="terms" name="terms" rows="4" placeholder="Jane Smith&#10;MIT CSAIL&#10;jane.smith@example.org" v-field="{ state: viewState, set: value =&gt; { terms = value }, value: terms, form: &quot;anonymize&quot;, options: { debounce: 250 } }" :class="{&#x27;is-invalid&#x27;: anonymize?.terms?.invalid}"></textarea>
<small class="form-text text-muted">One term per line (regex allowed). Replaced by <code>{{ site_options?.ANONYMIZATION_MASK }}-[N]</code>, or use <code>term=&gt;replacement</code> to pick your own (e.g. <code>Anonymous=&gt;ABC</code>).</small>
<div class="warning-feedback" v-show="termsRegexWarning">Regex characters detected. Escape them if unintentional.</div>
<div class="invalid-feedback" v-show="anonymize?.terms?.errors?.format">Terms are in an invalid format.</div>
@@ -362,11 +359,10 @@
<div class="alert alert-danger" role="alert" v-if="error" v-text="error"></div>
<div class="draft-status" role="status" v-if="draftRestored">Your unsaved draft was restored. <button type="button" class="draft-discard" @click="discardDraft()">Discard draft</button></div>
<div class="draft-status" v-else-if="unsavedChanges">{{ draftSaved ? "Draft saved in this tab for 30 minutes." : "Unsaved changes. Keep this tab open until you save." }} <button type="button" class="draft-discard" @click="discardDraft()">{{ isUpdate ? "Restore saved settings" : "Discard changes" }}</button></div>
<p class="anonymize-review-note" v-if="detectedType === 'repo' &amp;&amp; (options.image || options.pdf)">Review enabled images and PDFs before sharing. Their contents are not anonymized.</p>
<button type="button" class="btn btn-outline-ink mobile-preview-jump" @click="selectMobilePane('preview')">Review preview <span aria-hidden="true">→</span></button>
<div class="anonymize-submit-bar" v-show="detectedType">
<div class="draft-status" role="status" v-if="draftRestored">Your unsaved draft was restored. <button type="button" class="draft-discard" @click="discardDraft()">Discard draft</button></div>
<div class="draft-status" v-else-if="unsavedChanges">{{ draftSaved ? "Draft saved in this tab for 30 minutes." : "Unsaved changes. Keep this tab open until you save." }} <button type="button" class="draft-discard" @click="discardDraft()">{{ isUpdate ? "Restore saved settings" : "Discard changes" }}</button></div>
<button type="submit" :disabled="sourceLoading" class="btn btn-ink" v-if="detectedType === &#x27;repo&#x27; &amp;&amp; !isUpdate" @click.prevent="submitForm($event, () =&gt; { anonymizeRepo($event) })">
<svg class="ui-icon mr-1" aria-hidden="true"><use href="#ui-icon-shield"></use></svg> Anonymize Repository
</button>
@@ -393,7 +389,7 @@
<div id="workspace-preview" :role="mobileWorkspace ? 'tabpanel' : null" :aria-labelledby="mobileWorkspace ? 'workspace-preview-tab' : null" class="anonymize-preview-col" v-if="detectedType === &#x27;repo&#x27;">
<div class="anonymize-preview-head">
<span class="paper-eyebrow">Live preview</span>
<span class="anonymize-preview-sub">{{ previewStatus === 'ready' ? 'README with redactions applied' : 'README preview' }}</span>
<span class="anonymize-preview-sub">{{ previewStatus !== 'ready' ? 'README preview' : (String(terms || '').trim() ? 'README with redactions applied' : 'No terms yet. Add some to see them redacted here.') }}</span>
</div>
<div class="anonymize-preview-status" role="status" v-if="sourceLoading &amp;&amp; previewStatus === 'idle'">Loading source…</div>
<div class="anonymize-preview-status" role="status" v-if="previewStatus === 'loading'">Updating the anonymized preview…</div>
+2 -2
View File
@@ -10,14 +10,14 @@
<form class="form needs-validation" name="claimForm" novalidate v-form="viewState" @submit.prevent="submitForm($event, () =&gt; { claim() })">
<div class="form-group">
<label class="paper-field-label" for="repoUrl">GitHub repository URL</label>
<input type="text" class="form-control" name="repoUrl" id="repoUrl" required v-field="{ state: viewState, set: value =&gt; { repoUrl = value }, value: repoUrl, form: &quot;claimForm&quot;, options: {} }" :class="{&#x27;is-invalid&#x27;: claimForm?.repoUrl?.invalid &amp;&amp; (claimForm?.repoUrl?.touched || claimForm?.submitted)}">
<input type="text" class="form-control" name="repoUrl" id="repoUrl" placeholder="https://github.com/owner/repository" required v-field="{ state: viewState, set: value =&gt; { repoUrl = value }, value: repoUrl, form: &quot;claimForm&quot;, options: {} }" :class="{&#x27;is-invalid&#x27;: claimForm?.repoUrl?.invalid &amp;&amp; (claimForm?.repoUrl?.touched || claimForm?.submitted)}">
<div class="invalid-feedback" v-show="claimForm?.repoUrl?.errors?.not_found">
No anonymization matches this repository and ID. Check both values and that you can access the repository on GitHub.
</div>
</div>
<div class="form-group">
<label class="paper-field-label" for="repoId">Anonymized repository ID</label>
<input type="text" class="form-control" name="repoId" id="repoId" required v-field="{ state: viewState, set: value =&gt; { repoId = value }, value: repoId, form: &quot;claimForm&quot;, options: {} }" :class="{&#x27;is-invalid&#x27;: claimForm?.repoId?.invalid &amp;&amp; (claimForm?.repoId?.touched || claimForm?.submitted)}">
<input type="text" class="form-control" name="repoId" id="repoId" placeholder="e.g. anonymous_github-72DE" required v-field="{ state: viewState, set: value =&gt; { repoId = value }, value: repoId, form: &quot;claimForm&quot;, options: {} }" :class="{&#x27;is-invalid&#x27;: claimForm?.repoId?.invalid &amp;&amp; (claimForm?.repoId?.touched || claimForm?.submitted)}">
<small id="idHelp" class="form-text text-muted">The ID is the last part of the anonymized URL: <code>anonymous.4open.science/r/&lt;ID&gt;</code>.</small>
</div>
+6 -7
View File
@@ -2,17 +2,17 @@
<div class="row">
<div class="w-100">
<div class="paper-crumbs"><a href="/dashboard">My work</a> &nbsp;/&nbsp; <span class="here">Conferences</span></div>
<div class="d-flex align-items-end justify-content-between flex-wrap" style="gap: 12px;">
<div class="d-flex align-items-start justify-content-between flex-wrap page-head-row" style="gap: 12px;">
<div>
<h1 class="paper-page-title">Your <em>conferences</em></h1>
<p class="paper-page-lede">Group anonymizations by venue, give chairs a shared dashboard, and set one expiry for every submission.</p>
</div>
<a href="/conference/new" class="btn btn-ink">
<a href="/conference/new" class="btn btn-primary">
<svg class="ui-icon mr-1" aria-hidden="true"><use href="#project-icon-plus"></use></svg> New conference
</a>
</div>
<form class="w-100 dashboard-filter-row" aria-label="Filter conferences" accept-charset="UTF-8" v-form="viewState" @submit.prevent="submitForm($event, () =&gt; { $event.preventDefault() })">
<form class="w-100 dashboard-filter-row" v-if="conferences?.length &gt; 0" aria-label="Filter conferences" accept-charset="UTF-8" v-form="viewState" @submit.prevent="submitForm($event, () =&gt; { $event.preventDefault() })">
<div class="search-wrap">
<input type="search" id="search" class="form-control" aria-label="Search conferences" placeholder="Search by name or ID…" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { search = value }, value: search, form: null, options: {} }">
</div>
@@ -58,7 +58,7 @@
</div>
</form>
<div class="dashboard-meta">
<div class="dashboard-meta" v-if="conferences?.length &gt; 0">
<span class="dashboard-count">
<span v-if="filteredConferences?.length === conferences?.length">{{ fmt?.number(conferences?.length) }} conference<span v-if="conferences?.length !== 1">s</span></span>
<span v-if="filteredConferences?.length !== conferences?.length">{{ fmt?.number(filteredConferences?.length) }} of {{ fmt?.number(conferences?.length) }} shown</span>
@@ -125,11 +125,10 @@
</div>
<div class="paper-table-empty" v-if="!loading &amp;&amp; !error &amp;&amp; filteredConferences?.length == 0">
<svg class="ui-icon" aria-hidden="true"><use href="#project-icon-inbox"></use></svg>
<span v-if="conferences?.length == 0">You have not created a conference yet.</span>
<template v-if="conferences?.length == 0"><strong class="empty-title">No conferences yet</strong><span>Create one to group submissions for a venue, share a dashboard with chairs, and set a single expiry date.</span></template>
<span v-if="conferences?.length &gt; 0">Nothing matches the current filters.</span>
<div class="paper-table-empty-actions">
<div class="paper-table-empty-actions"><a href="/conference/new" class="btn btn-primary" v-if="false">New conference</a>
<button type="button" class="btn btn-outline-ink" v-if="conferences?.length &gt; 0" @click="search = &#x27;&#x27;; filters.status.ready = true; filters.status.expired = true; filters.status.removed = true;">Clear filters</button>
<a href="/conference/new" class="btn btn-ink" v-if="conferences?.length == 0"><svg class="ui-icon mr-1" aria-hidden="true"><use href="#project-icon-plus"></use></svg> New conference</a>
</div>
</div>
</div>
+5 -5
View File
@@ -1,5 +1,5 @@
<div class="container paper-page connections-page">
<div class="paper-crumbs"><a href="/dashboard">My work</a> / <span class="here">GitHub connections</span></div>
<div class="paper-crumbs"><a href="/dashboard">My work</a> &nbsp;/&nbsp; <span class="here">GitHub connections</span></div>
<header class="connections-heading">
<h1 class="paper-page-title">GitHub <em>connections</em></h1>
<p class="paper-page-lede">Manage how GitHub shares your code. Your anonymizations and URLs stay the same.</p>
@@ -17,12 +17,12 @@
<div class="connection-actions">
<a class="btn btn-ink" v-if="connections.appConnected &amp;&amp; !connections.appError" target="_self" href="/github/app/install">Manage repository access <svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-external-link"></use></svg></a>
<a :class="connections.appConnected &amp;&amp; !connections.appError ? 'connection-link' : 'btn btn-ink'" target="_self" href="/github/app/login">{{ connections.appConnected ? 'Reconnect account' : 'Connect GitHub account' }}</a>
<button class="connection-link connection-refresh" title="Refresh access" v-if="connections.appConnected" :disabled="busy" @click="loadConnections()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-refresh"></use></svg><span class="sr-only">Refresh access</span></button>
</div>
<p class="connection-help">Choose repositories on GitHub. Organization access may need an administrator's approval.</p>
<ul class="connection-installations" v-if="connections.installations?.length">
<li v-for="installation in connections.installations" :key="installation.id"><div><strong>{{ installation.account }}</strong><span v-if="installation.suspended"> · Suspended</span></div><a target="_self" :href="'/github/app/install?installationId=' + installation.id">Manage access <span class="sr-only">for {{ installation.account }}</span> &rarr;</a></li>
<li v-for="installation in connections.installations" :key="installation.id"><div><span class="connection-label">Installed on</span> <strong>{{ installation.account }}</strong><span v-if="installation.suspended"> · Suspended</span></div><a v-if="connections.installations.length > 1" target="_self" :href="'/github/app/install?installationId=' + installation.id">Manage access <span class="sr-only">for {{ installation.account }}</span> &rarr;</a></li>
</ul>
<button class="connection-link" :disabled="busy" @click="loadConnections()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-refresh"></use></svg> Refresh access</button>
</section>
<section>
<div class="connection-top"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-key"></use></svg><span class="connection-badge connection-badge-muted">Legacy</span></div>
@@ -33,12 +33,12 @@
<div class="connection-revoke" v-if="connections.oauthConnected">
<p v-if="connections.gistCount">{{ connections.gistCount }} gist(s) use your GitHub App connection when available.</p>
<p>Switch all dependent repositories before revoking access. Gists can use your GitHub App connection.</p>
<button v-if="connections.appConnected" class="connection-link connection-danger" :disabled="busy || connections.resources.some(r => r.connection === 'oauth')" @click="disconnectOAuth()">Revoke OAuth access</button>
<button v-if="connections.appConnected" class="btn btn-sm btn-outline-danger connection-danger" :disabled="busy || connections.resources.some(r => r.connection === 'oauth')" @click="disconnectOAuth()">Revoke OAuth access</button>
</div>
</section>
</div>
<section class="connection-resources">
<div class="connection-title"><h2>Repository connections</h2><span class="connection-count">{{ connections.resources?.length || 0 }} resources</span></div>
<div class="connection-title"><h2>Repository connections</h2><span class="connection-count">{{ connections.resources?.length || 0 }} {{ (connections.resources?.length || 0) === 1 ? 'resource' : 'resources' }}</span></div>
<p>Check access, then switch each resource to the GitHub App. After reinstalling the App, reconnect existing resources here to keep their anonymous URLs and published snapshots.</p>
<div class="connection-empty" v-if="!connections.resources?.length"><svg class="ui-icon" aria-hidden="true"><use href="#project-type-repo"></use></svg><div><h3>No repository connections yet</h3><p>Your repositories and pull requests will appear here once you anonymize them.</p></div><a class="connection-link" href="/anonymize">New anonymization &rarr;</a></div>
<div class="connection-resource" v-for="resource in connections.resources" :key="resource.type + resource.id">
+19 -16
View File
@@ -3,10 +3,14 @@
<div class="w-100">
<div class="dashboard-heading">
<div>
<h1 class="paper-page-title">Projects</h1>
<h1 class="paper-page-title">My work</h1>
<p class="paper-page-lede">Manage your anonymous links.</p>
</div>
<div class="dashboard-heading-actions">
<details class="dashboard-quota" :open="quotaExpanded" @toggle="quotaExpanded = $event.target.open" @keydown.esc.prevent.stop="closeQuota()">
<summary aria-controls="dashboard-usage" :aria-expanded="quotaExpanded">
<summary aria-controls="dashboard-usage" :aria-expanded="quotaExpanded" :style="quota && !quota.repository.unlimited ? { '--quota-pct': quota.repository.percent + '%' } : null">
<svg class="quota-summary-ring" viewBox="0 0 24 24" aria-hidden="true" :class="quota ? 'quota-' + quota.repository.level : ''">
<circle class="quota-ring-track" cx="12" cy="12" r="9"></circle>
<circle class="quota-ring-fill" cx="12" cy="12" r="9" pathLength="100" v-if="quota &amp;&amp; !quota.repository.unlimited" :stroke-dasharray="quota.repository.percent + ' 100'"></circle>
@@ -22,12 +26,8 @@
<p class="quota-loading" role="status" v-else>Loading usage…</p>
</div>
</details>
</div>
<div class="dashboard-heading-actions">
<a href="/anonymize" class="btn btn-ink" aria-label="New anonymization">
<svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-plus"></use></svg><span class="dashboard-new-label">New link</span><span class="dashboard-new-mobile" aria-hidden="true">New</span>
<svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-plus"></use></svg><span class="dashboard-new-label">New anonymization</span><span class="dashboard-new-mobile" aria-hidden="true">New</span>
</a>
</div>
@@ -36,7 +36,7 @@
<!-- Search + filters -->
<form class="w-100 dashboard-filter-row" aria-label="Filter anonymizations" accept-charset="UTF-8" v-form="viewState" @submit.prevent="submitForm($event, () =&gt; { $event.preventDefault() })">
<div class="search-wrap">
<input type="search" id="search" class="form-control" aria-label="Search anonymizations" placeholder="Search projects, IDs, or conferences…" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { search = value }, value: search, form: null, options: {} }">
<input type="search" id="search" class="form-control" aria-label="Search anonymizations" placeholder="Search projects…" autocomplete="off" v-field="{ state: viewState, set: value =&gt; { search = value }, value: search, form: null, options: {} }">
</div>
<button class="btn dashboard-filters-toggle" type="button" :aria-expanded="filtersExpanded" aria-controls="dashboard-filter-controls" @click="filtersExpanded = !filtersExpanded">Filters<svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-filter"></use></svg></button>
<div id="dashboard-filter-controls" class="dashboard-filter-controls" :class="{'expanded': filtersExpanded}">
@@ -73,7 +73,8 @@
<button class="btn dropdown-toggle" type="button" id="dropdownStatus" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="filter-btn-label">Status</span>
<span class="filter-btn-value" v-if="!hasHiddenStatus()">All</span>
<span class="filter-btn-value" v-if="hasHiddenStatus()">{{ hiddenStatusCount() }} hidden</span>
<span class="filter-btn-value" v-if="hiddenStatusCount() === 1 &amp;&amp; filters?.status?.removed === false">Active</span>
<span class="filter-btn-value" v-if="hasHiddenStatus() &amp;&amp; !(hiddenStatusCount() === 1 &amp;&amp; filters?.status?.removed === false)">{{ hiddenStatusCount() === 1 ? 'Hiding ' + (statusKeyLabels[Object.keys(filters?.status || {}).find(k => filters.status[k] === false)] || '').toLowerCase() : hiddenStatusCount() + ' hidden' }}</span>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownStatus">
<h6 class="dropdown-header">Show statuses</h6>
@@ -89,16 +90,16 @@
<!-- Result count + active filter chips -->
<div class="dashboard-meta" v-if="!loading">
<div class="dashboard-view-tabs" role="group" aria-label="Project view">
<div class="dashboard-view-tabs" role="group" aria-label="Project view" v-if="attentionCount() &gt; 0 || projectView === 'attention'">
<button type="button" :aria-pressed="projectView === 'all'" @click="setProjectView('all')" aria-label="All projects"><span class="dashboard-view-long">All projects</span><span class="dashboard-view-short" aria-hidden="true">All</span></button>
<button type="button" :aria-pressed="projectView === 'attention'" @click="setProjectView('attention')" :aria-label="'Needs attention ' + attentionCount()"><span class="dashboard-attention-prefix">Needs </span><span>attention</span> <span class="attention-count" :class="{'has-attention': attentionCount() > 0}">{{ attentionCount() }}</span></button>
<button type="button" v-if="attentionCount() &gt; 0 || projectView === 'attention'" :aria-pressed="projectView === 'attention'" @click="setProjectView('attention')" :aria-label="'Needs attention ' + attentionCount()"><span class="dashboard-attention-prefix">Needs </span><span>attention</span> <span class="attention-count" :class="{'has-attention': attentionCount() > 0}">{{ attentionCount() }}</span></button>
</div>
<span class="dashboard-count">
<span v-if="(dashboardTotals?.filtered ?? filteredItems?.length) === (dashboardTotals?.total ?? items?.length)">{{ fmt?.number(dashboardTotals?.total ?? items?.length) }} project<span v-if="(dashboardTotals?.total ?? items?.length) !== 1">s</span></span>
<span v-else>{{ fmt?.number(dashboardTotals?.filtered ?? filteredItems?.length) }} of {{ fmt?.number(dashboardTotals?.total ?? items?.length) }} shown</span>
<span v-else>{{ fmt?.number(dashboardTotals?.filtered ?? filteredItems?.length) }} shown · <button type="button" class="btn-link-inline hidden-toggle" @click="clearFilters()">Show {{ fmt?.number((dashboardTotals?.total ?? items?.length) - (dashboardTotals?.filtered ?? filteredItems?.length)) }} removed</button></span>
</span>
<div class="dashboard-active-filters">
<template v-for="(v, f, index) in filters?.status"><button type="button" class="filter-chip" v-if="v === false" @click="filters.status[f] = true" :aria-label="'Show ' + statusKeyLabels[f] + ' again'" :title="'Show ' + statusKeyLabels[f] + ' again'">{{ statusKeyLabels[f] }} hidden<svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-close"></use></svg></button></template>
<template v-for="(v, f, index) in filters?.status"><button type="button" class="filter-chip" v-if="v === false &amp;&amp; !(f === 'removed' &amp;&amp; hiddenStatusCount() === 1)" @click="filters.status[f] = true" :aria-label="'Show ' + statusKeyLabels[f] + ' again'" :title="'Show ' + statusKeyLabels[f] + ' again'">Hiding {{ (statusKeyLabels[f] || '').toLowerCase() }}<svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-close"></use></svg></button></template>
<button type="button" class="filter-chip" v-if="typeFilter !== 'all'" @click="typeFilter = 'all'" aria-label="Show all project types">{{ typeFilter === 'repo' ? 'Repositories' : typeFilter === 'pr' ? 'Pull requests' : 'Gists' }}<svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-close"></use></svg></button>
<button type="button" class="btn-link-inline" v-if="showClearFilters()" @click="clearFilters()">Clear filters</button>
</div>
@@ -128,7 +129,7 @@
Expires <svg class="project-type-svg sort-direction" aria-hidden="true" v-if="isSortedBy(&#x27;options.expirationDate&#x27;)" :class="{'ascending': !sortDesc()}"><use href="#project-icon-arrow"></use></svg>
</button>
</div>
<div role="columnheader"><span class="sr-only">Actions</span></div>
<div role="columnheader" class="col-link">Link</div>
</div>
<!-- Loading skeleton: keeps the layout stable while the three lists load -->
@@ -176,15 +177,17 @@
<div class="cell-expires" role="cell">
<svg class="project-type-svg mobile-meta-icon" aria-hidden="true"><use href="#project-icon-clock"></use></svg>
<span class="expires-never" v-if="item?._expiry?.kind === &#x27;never&#x27;">Never</span>
<span v-if="item?._expiry?.kind === &#x27;date&#x27;" v-text="fmt?.humanTime(item?._expiry?.date)"></span>
<span v-if="item?._expiry?.kind === &#x27;date&#x27;" v-text="(fmt?.humanTime(item?._expiry?.date) || '').replace(/^on /, '')"></span>
<span class="expires-past" v-if="item?._expiry?.kind === &#x27;expired&#x27; &amp;&amp; item?._expiry?.date">Expired {{ fmt?.humanTime(item?._expiry?.date) }}</span>
<span class="expires-past" v-if="item?._expiry?.kind === &#x27;expired&#x27; &amp;&amp; !item?._expiry?.date">Expired</span>
<span class="empty-dash" aria-label="Not applicable" v-if="item?._expiry?.kind === &#x27;none&#x27;">&mdash;</span>
</div>
</div>
<div class="cell-actions" role="cell">
<button type="button" class="copy-link-inline" v-if="item._viewUrl" @click.stop="copyLink(item)" :disabled="!!copyingId" :title="'Copy anonymous link for ' + item._label" :aria-label="'Copy anonymous link for ' + item._label"><svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-copy"></use></svg></button>
<button type="button" class="copy-url" v-if="item._viewUrl" @click.stop="copyLink(item)" :disabled="!!copyingId" :title="'Copy anonymous link: ' + item._viewUrl" :aria-label="'Copy anonymous link for ' + item._label"><span class="copy-url-text">{{ copyingId === item._type + ':' + item._id ? 'Copied' : item._viewUrl.replace(/^https?:\/\/[^/]+/, '').replace(/\/$/, '') }}</span><svg class="project-type-svg" aria-hidden="true"><use :href="copyingId === item._type + ':' + item._id ? '#ui-icon-check' : '#project-icon-copy'"></use></svg></button>
<button type="button" class="project-details-button" v-if="item._broken" @click.stop="showProjectDetails(item)" :data-project-actions="encodeURIComponent(item._type + ':' + item._id)" :aria-controls="projectDetailsId(item)" :aria-expanded="selectedProject === item">Details</button>
<a class="row-edit row-open" v-if="item._viewUrl" :href="safeUrl(item._viewUrl)" target="_blank" rel="noopener" :title="'Open what reviewers see'" :aria-label="'Open anonymous page for ' + item._label"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-external-link"></use></svg></a>
<a class="row-edit" v-if="item?._editUrl &amp;&amp; !item?._broken" :href="safeUrl(item._editUrl)" :title="'Edit ' + item._name" :aria-label="'Edit ' + item._name"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-edit"></use></svg></a>
<div class="dropdown" v-if="!item?._broken">
<button class="btn btn-icon-dots" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" :data-project-actions="encodeURIComponent(item._type + ':' + item._id)" :aria-label="&quot;Actions for &quot; + (item?._name)">
<svg class="project-type-svg" aria-hidden="true"><use href="#project-icon-more"></use></svg>
+44 -24
View File
@@ -1,4 +1,38 @@
<div class="explorer-page">
<div class="explorer-page" :class="{ 'files-hidden': sidebarHidden }" :style="{ '--sidebar-w': sidebarWidth + 'px' }">
<header class="viewer-bar">
<div class="vb-left">
<a class="vb-logo" href="/">Anonymous <em>GitHub</em></a>
<button type="button" class="vb-icon vb-sidebar" :aria-label="sidebarHidden ? 'Show file tree' : 'Hide file tree'" :title="sidebarHidden ? 'Show file tree' : 'Hide file tree'" @click="sidebarHidden = !sidebarHidden"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-sidebar"></use></svg></button>
</div>
<div class="vb-right">
<span class="vb-snapshot" v-if="options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate" :title="(options?.anonymizedAt &amp;&amp; !options?.publishedAt) ? 'Older repositories have no recorded publication date. The source commit date does not establish when files became available here.' : ((options?.sourceCommitDate ? 'Source commit ' : options?.anonymizedAt ? 'Anonymized ' : 'Updated ') + fmt?.date(options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate) + (options?.publishedAt ? ' · snapshot ready ' + fmt?.date(options.publishedAt) : ''))">
<svg class="ui-icon" aria-hidden="true"><use href="#project-icon-clock"></use></svg><span>Snapshot</span><span class="vb-dot" aria-hidden="true">·</span><span>{{ fmt?.date(options?.publishedAt || options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate) }}</span>
</span>
<a class="vb-support" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener" title="Support Anonymous GitHub — help keep it free for researchers"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support</span></a>
<div class="vb-help">
<button type="button" class="vb-help-btn" aria-haspopup="true" :aria-expanded="helpOpen ? 'true' : 'false'" @click.stop="helpOpen = !helpOpen"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-help"></use></svg><span>Help</span></button>
<div class="acct-menu vb-help-menu" v-if="helpOpen" role="menu">
<a role="menuitem" href="/faq"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-help"></use></svg><span>FAQ<small>How anonymization works</small></span></a>
<a role="menuitem" 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 the paper</small></span></a>
</div>
</div>
<button type="button" class="vb-icon" :aria-label="isDarkMode ? 'Switch to light mode' : 'Switch to dark mode'" :title="isDarkMode ? 'Light mode' : 'Dark mode'" @click="darkMode(!isDarkMode)"><svg class="ui-icon" aria-hidden="true"><use :href="isDarkMode ? '#ui-icon-sun' : '#ui-icon-moon'"></use></svg></button>
<div class="acct" v-if="user">
<button type="button" class="acct-chip" aria-haspopup="true" :aria-label="'Account: ' + user?.username" :aria-expanded="accountOpen ? 'true' : 'false'" @click.stop="accountOpen = !accountOpen">
<img v-if="user?.photo" :src="safeUrl(user.photo)" alt="" width="26" height="26">
<span v-else class="acct-initial">{{ (user?.username || '?').charAt(0).toUpperCase() }}</span>
</button>
<div class="acct-menu" v-if="accountOpen" role="menu">
<div class="acct-menu-head">Signed in as <b>@{{ user?.username }}</b></div>
<a role="menuitem" href="/dashboard"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-grid"></use></svg>My work</a>
<a role="menuitem" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-user"></use></svg>Settings</a>
<a role="menuitem" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg>Sign out</a>
</div>
</div>
<a class="vb-signin" v-else href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i>Sign in</a>
</div>
</header>
<button class="sidebar-toggle" v-show="files?.length" @click="sidebarCollapsed = !sidebarCollapsed" :aria-label="(sidebarCollapsed ? &#x27;Show files&#x27; : &#x27;Hide files&#x27;)">
<svg class="ui-icon" aria-hidden="true"><use :href="sidebarCollapsed ? '#ui-icon-folder' : '#project-icon-close'"></use></svg>
<span v-text="sidebarCollapsed ? &#x27;Files&#x27; : &#x27;Close&#x27;"></span>
@@ -18,10 +52,7 @@
<kbd class="tree-search-kbd" v-show="!(fileSearchQuery)">{{ isMac ? '⌘' : 'Ctrl+' }}K</kbd>
<button class="tree-search-clear" aria-label="Clear search" v-show="fileSearchQuery" @click="fileSearchQuery = &#x27;&#x27;; onFileSearchChange()">&times;</button>
</div>
</div>
<div class="leftCol-project-header">
<span class="project-name" v-text="repoId"></span>
<span class="project-file-count">{{ fileCounts?.[''] || files?.length }} files</span>
<a target="_self" class="search-zip" v-if="options?.download" aria-label="Download repository as ZIP" :title="'Download the repository (snapshot ' + fmt?.date(options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate) + ') as ZIP'" :href="safeUrl(&quot;/api/repo/&quot; + (repoId) + &quot;/zip&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-zip"></use></svg></a>
</div>
<div class="leftCol-body">
<div class="paper-inline-warning" role="alert" v-if="options?.truncatedFolders?.length &gt; 0">
@@ -34,29 +65,21 @@
</div>
<tree class="files" :file="files" :search-query="fileSearchQuery" :search-results="fileSearchResults" :page="viewState"></tree>
</div>
<div class="leftCol-foot">
<span class="last-update" :title="options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate">
{{ options?.sourceCommitDate ? 'Source commit' : options?.anonymizedAt ? 'Anonymized' : 'Updated' }} {{ fmt?.date(options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate) }}
</span>
<span class="last-update" v-if="options?.settingsSavedAt" :title="options.settingsSavedAt">
Settings saved {{ fmt?.date(options.settingsSavedAt) }}
</span>
<span class="last-update" v-if="options?.publishedAt" :title="options.publishedAt">
Snapshot ready {{ fmt?.date(options.publishedAt) }}
</span>
<span class="last-update" v-if="options?.anonymizedAt &amp;&amp; !options?.publishedAt" title="Older repositories have no recorded publication date. The source commit date does not establish when files became available here.">
Snapshot ready date not recorded
</span>
</div>
</div>
<div class="leftCol-resizer" v-show="files?.length &amp;&amp; !sidebarHidden" role="separator" aria-orientation="vertical" aria-label="Resize file tree" title="Drag to resize" @pointerdown="startSidebarResize($event)"></div>
<div class="leftCol-backdrop" v-show="files?.length &amp;&amp; !sidebarCollapsed" @click="sidebarCollapsed = true"></div>
<div class="explorer-main">
<div class="status-bar">
<div class="status-bar" :class="{ 'is-redundant': ['code', 'text', 'html'].includes(type) &amp;&amp; content != null &amp;&amp; !(options?.isAdmin || options?.isOwner || options?.hasWebsite) }">
<button type="button" class="btn btn-sm status-files-btn" v-show="files?.length" aria-label="Show files" title="Show files" @click="sidebarHidden ? (sidebarHidden = false) : (sidebarCollapsed = false)">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-folder"></use></svg><span>Files</span>
</button>
<ol class="breadcrumb paths" aria-label="Path">
<li class="breadcrumb-item" v-for="(p, index) in paths" v-text="p"></li>
<li class="breadcrumb-item breadcrumb-root"><a :href="safeUrl('/r/' + repoId + '/')" :title="repoId" v-text="/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(repoId || '') ? 'repository' : repoId"></a></li>
<li class="breadcrumb-item" v-for="(p, index) in paths" :aria-current="index === paths.length - 1 ? 'page' : null" v-text="p"></li>
</ol>
<button type="button" class="btn btn-sm btn-icon-only btn-ghost copy-path-btn" v-show="filePath" :aria-label="pathCopied ? 'Path copied' : 'Copy path'" :title="pathCopied ? 'Path copied' : 'Copy path'" @click="copyPath()"><svg class="ui-icon" aria-hidden="true"><use :href="pathCopied ? '#ui-icon-check' : '#project-icon-copy'"></use></svg></button>
<div class="status-bar-actions">
<a class="btn btn-sm" aria-label="Edit" v-if="options?.isAdmin || options?.isOwner" :href="safeUrl(&quot;/anonymize/&quot; + (repoId))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-edit"></use></svg><span class="d-none d-md-inline"> Edit</span></a>
<button class="btn btn-sm" aria-label="Allow this document to run JavaScript" title="Scripts in this file are blocked by default. Enable them only if you trust the repository — the document stays isolated from your session either way." v-if="type == &#x27;html-doc&#x27; &amp;&amp; !showSource" :class="{&#x27;btn-active&#x27;: allowScripts}" @click="toggleAllowScripts()">
@@ -67,9 +90,6 @@
<svg class="ui-icon" aria-hidden="true"><use :href="showSource ? '#project-icon-eye' : '#ui-icon-code'"></use></svg><span class="d-none d-md-inline">
{{ showSource ? "Rendered" : "Source" }}</span>
</button>
<a target="_self" class="btn btn-sm" aria-label="View raw current file" title="View the raw content of the current file" v-show="content != null" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-file"></use></svg><span class="d-none d-md-inline"> Raw</span></a>
<a target="_self" class="btn btn-sm" aria-label="Download current file" title="Download the current file" v-show="content != null" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg><span class="d-none d-md-inline"> Download</span></a>
<a target="_self" class="btn btn-sm" aria-label="Download full repository as ZIP" title="Download the full repository as a ZIP archive" v-if="options?.download" :href="safeUrl(&quot;/api/repo/&quot; + (repoId) + &quot;/zip&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-archive"></use></svg><span class="d-none d-md-inline"> Full repo ZIP</span></a>
<a target="_self" class="btn btn-sm" aria-label="Website" v-if="options?.hasWebsite" :href="safeUrl(&quot;/w/&quot; + (repoId) + &quot;/&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-globe"></use></svg><span class="d-none d-md-inline"> Website</span></a>
</div>
</div>
+6 -6
View File
@@ -1,14 +1,14 @@
<div class="paper-faq">
<div class="paper-faq-hero">
<div class="paper-faq-eyebrow">Help</div>
<h1 class="paper-faq-title">Answers to the <em>questions</em> that come up most.</h1>
<h1 class="paper-faq-title">Answers to the questions that <em>come up most.</em></h1>
<p class="paper-faq-lede">
If something's missing, write to us &mdash;
<a href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener">report a bug on GitHub</a>.
Can&rsquo;t find your answer?
<a href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener">Open an issue on GitHub</a>.
</p>
</div>
<div class="paper-faq-body">
<aside class="paper-faq-toc">
<aside class="paper-faq-toc" v-paper-scrollspy>
<div class="paper-faq-toc-head">Contents</div>
<nav>
<a href="#faq-general">General</a>
@@ -29,12 +29,12 @@
<div class="panel panel-default mb-3">
<div class="panel-heading p-3" role="tab" id="headingWhatIs">
<h3 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#faq-general" href="#whatIs" aria-expanded="false" aria-controls="whatIs">
<a role="button" data-toggle="collapse" data-parent="#faq-general" href="#whatIs" aria-expanded="true" aria-controls="whatIs">
What is Anonymous GitHub?
</a>
</h3>
</div>
<div id="whatIs" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingWhatIs">
<div id="whatIs" class="panel-collapse collapse show" role="tabpanel" aria-labelledby="headingWhatIs">
<div class="panel-body p-3">
<p>
Anonymous GitHub is a free, open-source tool that anonymizes GitHub repositories and pull requests
+17 -10
View File
@@ -4,13 +4,15 @@
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg>
<span class="nav-support-label">Support</span>
</a>
<a class="nav-heart-m" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener" aria-label="Support Anonymous GitHub" title="Support Anonymous GitHub" v-if="!/^\/(r|w|pr|gist)\//.test(path || '')"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg></a>
<a class="nav-signin-m" href="/signin" target="_self" v-if="!user &amp;&amp; !/^\/(r|w|pr|gist)\//.test(path || '')">Sign in</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto smooth-scroll">
<li class="nav-item" v-if="!user">
<li class="nav-item nav-home-item" v-if="!user">
<a class="nav-link" href="/" :class="{&#x27;active&#x27;: path == &#x27;/&#x27;}">
Home
</a>
@@ -28,7 +30,7 @@
</a>
</li>
<li class="nav-item" v-if="user">
<a class="nav-link" href="/conferences" :class="{&#x27;active&#x27;:path == &#x27;/conferences&#x27;}">
<a class="nav-link" href="/conferences" :class="{&#x27;active&#x27;:path == &#x27;/conferences&#x27; || path?.startsWith(&#x27;/conference/&#x27;)}">
<svg class="ui-icon d-lg-none mr-1" aria-hidden="true"><use href="#project-icon-conference"></use></svg>
Conferences
</a>
@@ -44,7 +46,7 @@
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<li class="nav-item d-lg-none">
<a class="nav-link nav-icon" target="_blank" href="https://github.com/tdurieux/anonymous_github/" title="Anonymous GitHub source code" aria-label="Anonymous GitHub source code on GitHub" rel="noopener" data-offset="30"><i class="fab fa-github" aria-hidden="true"></i></a>
</li>
<!-- "Report a bug" is about this service. Reviewers who land on an
@@ -55,19 +57,24 @@
</a>
</li>
<li class="nav-item" v-if="!isDarkMode">
<a class="nav-link nav-icon" href="#" title="Switch to dark mode" aria-label="Switch to dark mode" role="button" @click.prevent="darkMode(true);">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-moon"></use></svg>
<li class="nav-item nav-support-item d-none d-lg-block">
<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">
<svg class="ui-icon nav-heart" aria-hidden="true"><use href="#ui-icon-heart"></use></svg>Support
</a>
</li>
<li class="nav-item" v-if="!isDarkMode">
<button type="button" class="nav-link nav-icon" title="Switch to dark mode" aria-label="Switch to dark mode" @click="darkMode(true);">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-moon"></use></svg>
</button>
</li>
<li class="nav-item" v-if="isDarkMode">
<a class="nav-link nav-icon" href="#" title="Switch to light mode" aria-label="Switch to light mode" role="button" @click.prevent="darkMode(false);">
<button type="button" class="nav-link nav-icon" title="Switch to light mode" aria-label="Switch to light mode" @click="darkMode(false);">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-sun"></use></svg>
</a>
</button>
</li>
<li class="nav-item" v-if="!user">
<li class="nav-item nav-signin-item" v-if="!user">
<a class="nav-link btn-signin" target="_self" href="/signin" data-offset="30"><i class="fab fa-github mr-1"></i>
Sign in
</a>
+86 -46
View File
@@ -24,46 +24,54 @@
</div>
<ul class="paper-reassure">
<li>Free and open source</li>
<li>Read-only: never writes to your repos</li>
<li>Expires on the date you set</li>
<li>Read-only GitHub access</li>
<li>Expires when you choose</li>
</ul>
</div>
<div class="paper-hero-shot">
<div class="paper-frame">
<div class="paper-frame-bar" aria-hidden="true">
<span class="dots"><i></i><i></i><i></i></span>
<span class="url">anonymous.4open.science/anonymize</span>
<span class="url">anonymous.4open.science/r/paper-7f2a</span>
</div>
<div class="hero-mock" role="img" aria-label="A reviewer browsing an anonymized repository: the author, affiliation, and email in the README are replaced by anonymous terms">
<div class="hero-mock-tree" aria-hidden="true">
<div class="hero-mock-tree-title">Files</div>
<div class="hero-mock-row is-folder"><svg viewBox="0 0 16 16"><path d="M1.5 3.5h4l1.5 1.5h7.5v8h-13z"/></svg>data</div>
<div class="hero-mock-row is-folder"><svg viewBox="0 0 16 16"><path d="M1.5 3.5h4l1.5 1.5h7.5v8h-13z"/></svg>experiments</div>
<div class="hero-mock-row is-folder"><svg viewBox="0 0 16 16"><path d="M1.5 3.5h4l1.5 1.5h7.5v8h-13z"/></svg>src</div>
<div class="hero-mock-row"><svg viewBox="0 0 16 16"><path d="M3.5 1.5h6l3 3v10h-9z"/></svg>LICENSE</div>
<div class="hero-mock-row is-active"><svg viewBox="0 0 16 16"><path d="M3.5 1.5h6l3 3v10h-9z"/></svg>README.md</div>
<div class="hero-mock-row"><svg viewBox="0 0 16 16"><path d="M3.5 1.5h6l3 3v10h-9z"/></svg>requirements.txt</div>
</div>
<div class="hero-mock-doc" aria-hidden="true">
<div class="hero-mock-doc-bar"><strong>README.md</strong><span class="hero-mock-count">3 redacted</span></div>
<div class="hero-mock-doc-body">
<div class="hero-mock-h1">DeepLearnUtils</div>
<p>Developed by <span class="redact" role="img" aria-label="Redacted term 1"><i>1</i></span> at <span class="redact" role="img" aria-label="Redacted term 2"><i>2</i></span>.</p>
<p>Utilities for reproducing the paper&rsquo;s experiments.</p>
<div class="hero-mock-h2">Quick start</div>
<pre>pip install -r requirements.txt
python experiments/run.py</pre>
<p>Contact: <span class="redact" role="img" aria-label="Redacted term 3"><i>3</i></span></p>
</div>
</div>
</div>
<img src="/imgs/redaction-preview.png" width="1360" height="960" alt="A reviewer preview with the author, affiliation, and email replaced by anonymous terms">
</div>
</div>
</section>
<!-- Proof -->
<section class="paper-proof paper-wrap" aria-label="Venues">
<div class="paper-eyebrow">Trusted by authors at</div>
<div class="paper-proof-venues">
<span>ICSE</span><i aria-hidden="true">&middot;</i>
<span>FSE</span><i aria-hidden="true">&middot;</i>
<span>OOPSLA</span>
</div>
</section>
<!-- Live stats -->
<section class="paper-stats paper-wrap" id="metrics" aria-label="Usage over the last 60 days">
<div class="paper-stats-meta">
<div class="paper-stats-meta-left">Live &middot; last 60 days</div>
<div class="paper-stats-meta-right">
<span class="paper-stats-dot" aria-hidden="true"></span> updated daily
</div>
<div class="paper-stats-meta-left"><span class="paper-stats-dot" aria-hidden="true"></span> Live &middot; last 60 days &middot; updated daily</div>
<div class="paper-stats-meta-right">Used by authors at ICSE &middot; FSE &middot; OOPSLA</div>
</div>
<div class="paper-stats-grid">
<div class="paper-stat-card" v-for="(card, index) in cards" :key="card?.key">
<div class="paper-stat-value">{{ fmt?.bigNum(card?.total) }}</div>
<div class="paper-stat-value" :class="{ 'is-pending': !stat }">{{ stat ? fmt?.bigNum(card?.total) : '—' }}</div>
<div class="paper-stat-label">{{ card?.label }}</div>
<svg class="paper-stat-bars" preserveAspectRatio="none" aria-hidden="true" v-if="history[card?.key].bars?.length &gt; 1" :viewBox="&quot;0 0 &quot; + (history[card?.key].viewW) + &quot; 36&quot;">
<rect v-for="(b, index) in history[card?.key].bars" :key="index" :class="{&#x27;is-latest&#x27;: index === history[card.key].bars.length - 1}" :x="(b?.x)" :y="(b?.y)" :width="(b?.w)" :height="(b?.h)"></rect>
</svg>
<div class="paper-stat-delta" v-if="history[card?.key].bars?.length &gt; 1">
+{{ fmt?.number(history[card?.key].deltaToday) }} today
</div>
@@ -74,7 +82,7 @@
<!-- Before / after -->
<section class="paper-section-head paper-wrap">
<div>
<div class="paper-eyebrow">Before &middot; after</div>
<div class="paper-eyebrow">Try it</div>
<h2>The same repository, <em>minus you.</em></h2>
</div>
<p>
@@ -83,29 +91,22 @@
real thing, not a zip.
</p>
</section>
<div class="paper-preview paper-wrap" aria-label="Before and after example">
<div class="pane">
<div class="pane-header">
<span class="pane-label">Before &middot; your repo</span>
<span class="pane-url">github.com/jane-smith/DeepLearnUtils</span>
</div>
<div class="pane-body">
<div><span class="tok">#</span> <strong>DeepLearnUtils</strong></div>
<div>Developed by Jane Smith at MIT CSAIL.</div>
<div>See Smith et&nbsp;al., &ldquo;Attention That Works,&rdquo; 2026.</div>
<div>Contact: jane.smith@mit.edu</div>
</div>
<div class="demo paper-wrap" aria-label="Try redaction">
<div class="demo-terms">
<label for="demo-terms">Terms to redact <span>comma-separated, try adding your own</span></label>
<input id="demo-terms" type="text" v-model="demoTerms" spellcheck="false" autocomplete="off">
</div>
<div class="pane">
<div class="pane-header">
<span class="pane-label">After &middot; anonymous mirror</span>
<span class="pane-url">anonymous.4open.science/r/paper-7f2a</span>
<div class="demo-panes">
<div class="pane">
<div class="pane-header"><span class="pane-label">Your repository</span><span class="pane-url">github.com/jane-smith/DeepLearnUtils</span></div>
<div class="demo-input-wrap">
<div class="pane-body demo-backdrop" aria-hidden="true"><template v-for="(p, i) in demoParts()" :key="i"><mark v-if="p.redacted" class="demo-match">{{ p.original }}</mark><template v-else>{{ p.text }}</template></template>&#8203;</div>
<textarea class="pane-body demo-input" v-model="demoText" spellcheck="false" aria-label="Sample README to anonymize"></textarea>
</div>
</div>
<div class="pane-body">
<div><span class="tok">#</span> <strong>DeepLearnUtils</strong></div>
<div>Developed by <span class="redact" role="img" aria-label="redacted author name">XXXX-1</span> at <span class="redact" role="img" aria-label="redacted affiliation">XXXX-2</span>.</div>
<div>See <span class="redact" role="img" aria-label="redacted author name">XXXX-1</span> et&nbsp;al., &ldquo;Attention That Works,&rdquo; 2026.</div>
<div>Contact: <span class="redact" role="img" aria-label="redacted email address">XXXX-3</span></div>
<div class="pane pane-after">
<div class="pane-header"><span class="pane-label">What reviewers see</span><span class="pane-url">{{ demoCount() }} redacted · anonymous.4open.science/r/paper-7f2a</span></div>
<div class="pane-body demo-output" aria-live="polite"><template v-for="(p, i) in demoParts()" :key="i"><span v-if="p.redacted" class="redact-chip" :title="'Replaces “' + p.original + '”'">{{ p.text }}</span><template v-else>{{ p.text }}</template></template></div>
</div>
</div>
</div>
@@ -143,8 +144,47 @@
<span class="dots"><i></i><i></i><i></i></span>
<span class="url">{{ f?.url }}</span>
</div>
<div :class="&quot;paper-crop paper-crop-&quot; + (f?.key)">
<img loading="lazy" width="2880" height="1800" :src="safeUrl((f?.img))" :alt="(f?.alt)">
<div class="feat-mock" :class="'is-' + f?.key" role="img" :aria-label="(f?.alt)">
<template v-if="f?.key === 'anonymize'">
<div class="fm-form">
<div class="fm-label">GitHub repository</div>
<div class="fm-input">github.com/jane-smith/DeepLearnUtils</div>
<div class="fm-label">Terms to redact</div>
<div class="fm-chips"><span>Jane Smith</span><span>MIT CSAIL</span><span>jane.smith@mit.edu</span><span class="fm-chip-add">+ Add term</span></div>
<div class="fm-row">
<div><div class="fm-label">Reviewers can see</div><div class="fm-toggles"><span class="is-on">Images</span><span class="is-on">PDFs</span><span>Links</span><span class="is-on">Notebooks</span></div></div>
<div><div class="fm-label">Expires</div><div class="fm-input fm-input-sm">Mar 31, 2027</div></div>
</div>
<div class="fm-actions"><span class="fm-share">anonymous.4open.science/r/paper-7f2a</span><span class="fm-btn">Anonymize repository</span></div>
</div>
</template>
<template v-else-if="f?.key === 'review'">
<div class="fm-viewer">
<div class="fm-tree"><div class="is-folder">data</div><div class="is-folder">src</div><div class="is-file is-active">train.py</div><div class="is-file">README.md</div><div class="is-file">LICENSE</div></div>
<div class="fm-code">
<div class="fm-code-bar"><span><b>train.py</b></span><span>48 lines · Python</span></div>
<pre><span class="ln">1</span><span class="c"># Training loop for DeepLearnUtils</span>
<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
<span class="ln">5</span>
<span class="ln">6</span><span class="k">def</span> <span class="f">train</span>(config):
<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>
</div>
</template>
<template v-else>
<div class="fm-dash">
<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 · 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 · 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>
</div>
</template>
</div>
</div>
</div>
@@ -205,7 +245,7 @@
<div class="paper-footer-head">Project</div>
<a href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener">Source code</a>
<a href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener">Report a bug</a>
<a href="https://github.com/sponsors/tdurieux/" target="_blank" rel="noopener">Sponsor</a>
<a href="https://github.com/sponsors/tdurieux/" target="_blank" rel="noopener">Support</a>
</div>
<div class="paper-footer-col">
<div class="paper-footer-head">Contact</div>
+4
View File
@@ -49,6 +49,10 @@
<symbol id="ui-icon-logout" viewBox="0 0 24 24"><path d="M9 3H3v18h6M9 12h12m-4-4 4 4-4 4"/></symbol>
<symbol id="ui-icon-link" viewBox="0 0 24 24"><path d="m10 7 3-3a5 5 0 0 1 7 7l-3 3M7 10l-3 3a5 5 0 0 0 7 7l3-3M8 16l8-8"/></symbol>
<symbol id="ui-icon-chart" viewBox="0 0 24 24"><path d="M3 3v18h18M7 16V9m5 7V5m5 11v-5"/></symbol>
<symbol id="ui-icon-sidebar" viewBox="0 0 24 24"><path d="M4 5h16v14H4zM9.5 5v14M6 8.5h1.5M6 11h1.5"/></symbol>
<symbol id="ui-icon-zip" viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><path d="M12 10v6m-2.5-2.5L12 16l2.5-2.5"/></symbol>
<symbol id="ui-icon-goto" viewBox="0 0 24 24"><path d="M3 12h11"/><path d="M10 8l4 4-4 4"/><path d="M18 5v14"/></symbol>
<symbol id="ui-icon-wrap" viewBox="0 0 24 24"><path d="M3 6h18M3 12h14.5a3.5 3.5 0 0 1 0 7H13m2-2.5L12.5 19l2.5 2.5M3 18h6"/></symbol>
<symbol id="ui-icon-list" viewBox="0 0 24 24"><path d="M9 5h12M9 12h12M9 19h12m-18-14 1 1 2-2m-3 8 1 1 2-2m-3 8 1 1 2-2"/></symbol>
<symbol id="ui-icon-bug" viewBox="0 0 24 24"><rect x="7" y="7" width="10" height="14" rx="5"/><path d="M9 7V5a3 3 0 0 1 6 0v2M12 7v14M3 8l4 2m-4 5h4m-4 7 4-4M21 8l-4 2m4 5h-4m4 7-4-4"/></symbol>
<symbol id="ui-icon-chevron-left" viewBox="0 0 24 24"><path d="m15 5-7 7 7 7"/></symbol>

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

+89 -4
View File
@@ -1,7 +1,92 @@
<div v-code-editor="{ content: content, options: aceOption }" v-if="type == &#x27;text&#x27;"></div>
<div class="file-content markdown-body" v-if="type == &#x27;html&#x27;" v-html="sanitize(content)"></div>
<section class="dir-card" v-if="sidebarHidden &amp;&amp; type == 'html' &amp;&amp; content != null &amp;&amp; paths?.length === 1 &amp;&amp; /^readme/i.test(paths[0] || '') &amp;&amp; files?.length" aria-label="Repository files">
<header class="dir-card-head">
<span class="dir-card-title">Files</span>
<span class="dir-card-sub">Snapshot of the repository at review time</span>
</header>
<ul class="dir-list" :class="{ 'is-expanded': dirExpanded }">
<li v-for="entry in rootEntries()" :key="entry.name">
<button type="button" class="dir-row" v-if="entry.size == null" @click="revealFolder(entry.name)">
<svg class="dir-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M1.5 3.5h4l1.5 1.5h7.5v8h-13z"/></svg>
<span class="dir-name">{{ entry.name }}</span>
<span class="dir-meta">Folder</span>
</button>
<a class="dir-row" v-else :class="{ 'is-current': entry.name === paths[0] }" :href="safeUrl('/r/' + repoId + '/' + encodeURIComponent(entry.name))">
<svg class="dir-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 1.5h6l3 3v10h-9z"/></svg>
<span class="dir-name">{{ entry.name }}</span>
<span class="dir-meta">{{ formatSize(entry.size) }}</span>
</a>
</li>
</ul>
<button type="button" class="dir-more" v-if="!dirExpanded &amp;&amp; files.length &gt; 8" @click="dirExpanded = true">Show all {{ files.length }} items</button>
</section>
<section class="file-card" :class="{ 'is-code': type != 'html', 'no-wrap': !wrapLines }" v-if="(type == 'text' || type == 'code' || type == 'html' || (type == 'html-doc' &amp;&amp; showSource)) &amp;&amp; content != null">
<header class="file-card-head">
<div class="file-card-path">
<button type="button" class="btn btn-sm btn-icon-only btn-ghost card-files-btn" :class="{ 'is-needed': sidebarHidden }" aria-label="Show file tree" title="Show file tree" @click="sidebarHidden ? (sidebarHidden = false) : (sidebarCollapsed = false)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-sidebar"></use></svg></button>
<ol class="breadcrumb paths" aria-label="Path">
<li class="breadcrumb-item breadcrumb-root"><a :href="safeUrl('/r/' + repoId + '/')" :title="repoId" v-text="/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(repoId || '') ? 'repository' : repoId"></a></li>
<li class="breadcrumb-item" v-for="(p, index) in paths" :aria-current="index === paths.length - 1 ? 'page' : null"><template v-for="(seg, si) in redactParts(p)" :key="si"><span v-if="seg.n" class="redact-slot" role="img" :aria-label="'Redacted term ' + seg.n"><i>{{ seg.n }}</i></span><template v-else>{{ seg.t }}</template></template></li>
</ol>
<span class="mobile-sub"><span>{{ type == 'html' ? 'Markdown' : (languageName || 'Text') }}</span><span v-if="type != 'html' &amp;&amp; typeof content === 'string'">{{ fmt?.number(content.split('\n').length) }} lines</span><span v-if="type == 'html' && fileSize(filePath) != null">{{ formatSize(fileSize(filePath)) }}</span><b v-if="redactionCount()">{{ redactionCount() }} redacted</b></span>
<button type="button" class="btn btn-sm btn-icon-only btn-ghost copy-path-btn" v-show="filePath" :aria-label="pathCopied ? 'Path copied' : 'Copy path'" :title="pathCopied ? 'Path copied' : 'Copy path'" @click="copyPath()"><svg class="ui-icon" aria-hidden="true"><use :href="pathCopied ? '#ui-icon-check' : '#ui-icon-link'"></use></svg></button>
</div>
<span class="file-card-meta" v-if="type != 'html' &amp;&amp; typeof content === 'string'"><template v-if="languageName">{{ languageName }}<span class="sep">·</span></template>{{ fmt?.number(content.split('\n').length) }} lines<span class="meta-extra"><span class="sep">·</span>{{ content.length &lt; 1024 ? content.length + ' B' : (content.length / 1024).toFixed(1) + ' KB' }}</span><template v-if="redactionCount()"><span class="sep">·</span><span class="meta-redact">{{ redactionCount() }} redacted</span></template></span>
<span class="file-card-meta" v-if="type == 'html'">Markdown<template v-if="fileSize(filePath) != null"><span class="sep">·</span>{{ formatSize(fileSize(filePath)) }}</template><template v-if="redactionCount()"><span class="sep">·</span><span class="meta-redact">{{ redactionCount() }} redacted</span></template></span>
<div class="file-card-actions">
<div class="symbols" v-if="type != 'html' &amp;&amp; symbols().length &gt; 1">
<button type="button" class="btn btn-sm btn-ghost btn-symbols" :class="{ 'is-on': symbolsOpen }" :aria-expanded="symbolsOpen ? 'true' : 'false'" aria-haspopup="true" title="Symbols in this file" @click="symbolsOpen = !symbolsOpen"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-list"></use></svg><span class="btn-find-label">Symbols</span></button>
<div class="symbols-menu" v-if="symbolsOpen" role="menu">
<div class="symbols-head">{{ symbols().length }} {{ symbols().length === 1 ? 'symbol' : 'symbols' }}</div>
<button type="button" class="symbols-item" role="menuitem" v-for="sym in symbols()" :key="sym.line + sym.name" @click="goToSymbol(sym.line)"><span class="symbols-kind" :class="'is-' + sym.kind">{{ sym.kind === 'class' ? 'C' : sym.kind === 'function' ? 'ƒ' : 'v' }}</span><span class="symbols-name">{{ sym.name }}</span><span class="symbols-line">{{ sym.line }}</span></button>
</div>
</div>
<button type="button" class="btn btn-sm btn-ghost btn-icon-only btn-find btn-md-find" v-if="type == 'html'" :class="{ 'is-on': mdFindOpen }" aria-label="Find on this page" :title="'Find on this page (' + (isMac ? '⌘' : 'Ctrl+') + 'F)'" @click="toggleMdFind()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-search"></use></svg></button>
<button type="button" class="btn btn-sm btn-ghost btn-icon-only btn-find" v-if="type != 'html'" aria-label="Find in file" :title="'Find in file (' + (isMac ? '⌘' : 'Ctrl+') + 'F)'" @click="findInFile()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-search"></use></svg></button>
<button type="button" class="btn btn-sm btn-ghost btn-icon-only btn-goto" v-if="type != 'html'" aria-label="Go to line" :title="'Go to line (' + (isMac ? '⌘' : 'Ctrl+') + 'G)'" @click="gotoLine()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-goto"></use></svg></button>
<button type="button" class="btn btn-sm btn-icon-only btn-ghost btn-toggle" v-if="type != 'html'" :class="{ 'is-on': wrapLines }" :aria-pressed="wrapLines ? 'true' : 'false'" aria-label="Wrap long lines" :title="'Wrap long lines (Alt+Z)'" @click="toggleWrap()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-wrap"></use></svg></button>
<div class="tb-file" role="group" aria-label="File actions">
<a target="_self" class="tb-seg-btn" :title="type == 'html' ? 'Open the Markdown source' : 'Open the raw file'" :href="safeUrl((url))">Raw</a>
<button type="button" class="tb-seg-btn tb-seg-icon" v-if="typeof content === 'string'" :aria-label="contentCopied ? 'Copied' : 'Copy file contents'" :title="contentCopied ? 'Copied' : 'Copy file contents'" @click="copyContent()"><svg class="ui-icon" aria-hidden="true"><use :href="contentCopied ? '#ui-icon-check' : '#project-icon-copy'"></use></svg></button>
<a target="_self" class="tb-seg-btn tb-seg-icon" aria-label="Download file" title="Download file" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg></a>
</div>
<button type="button" class="btn btn-sm btn-icon-only btn-ghost tb-copy-m" v-if="typeof content === 'string'" :aria-label="contentCopied ? 'Copied' : 'Copy file contents'" @click="copyContent()"><svg class="ui-icon" aria-hidden="true"><use :href="contentCopied ? '#ui-icon-check' : '#project-icon-copy'"></use></svg></button>
<div class="tb-more">
<button type="button" class="btn btn-sm btn-icon-only btn-ghost tb-more-btn" :class="{ 'is-on': moreOpen }" aria-label="More actions" aria-haspopup="true" :aria-expanded="moreOpen ? 'true' : 'false'" @click.stop="moreOpen = !moreOpen"><svg viewBox="0 0 24 24" class="ui-icon" aria-hidden="true" style="fill:currentColor;stroke:none"><circle cx="5" cy="12" r="1.8"/><circle cx="12" cy="12" r="1.8"/><circle cx="19" cy="12" r="1.8"/></svg></button>
<div class="tb-menu" v-if="moreOpen" role="menu" @click="moreOpen = false">
<div class="tb-menu-note" v-if="options?.publishedAt || options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-clock"></use></svg>Snapshot · {{ fmt?.date(options?.publishedAt || options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate) }}</div>
<div class="tb-menu-sep" v-if="options?.publishedAt || options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate"></div>
<button type="button" role="menuitem" v-if="type != 'html'" @click="findInFile()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-search"></use></svg>Find in file</button>
<button type="button" role="menuitem" v-if="type != 'html'" @click="gotoLine()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-goto"></use></svg>Go to line</button>
<button type="button" role="menuitemcheckbox" v-if="type != 'html'" :aria-checked="wrapLines ? 'true' : 'false'" @click="toggleWrap()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-wrap"></use></svg>Wrap lines<span class="tb-menu-check" v-if="wrapLines">✓</span></button>
<div class="tb-menu-sep" v-if="type != 'html'"></div>
<a role="menuitem" target="_self" v-if="type != 'html'" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg>Open raw file</a>
<button type="button" role="menuitem" v-if="typeof content === 'string'" @click="copyContent()"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-copy"></use></svg>Copy contents</button>
<a role="menuitem" target="_self" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg>Download file</a>
<button type="button" role="menuitem" @click="copyPath()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg>Copy path</button>
<div class="tb-menu-sep"></div>
<a role="menuitem" href="/faq"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-help"></use></svg>FAQ</a>
<a role="menuitem" 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>Report a bug</a>
</div>
</div>
</div>
</header>
<div class="file-card-body" v-if="type != 'html'" v-code-editor="{ content: content, options: aceOption }"></div>
<div class="md-find-bar" v-if="type == 'html' &amp;&amp; mdFindOpen" role="search">
<input type="search" class="md-find-input" placeholder="Find on this page" aria-label="Find on this page" :value="mdFindQuery" @input="mdFindQuery = $event.target.value; runMdFind()" @keydown.enter.prevent="$event.shiftKey ? stepMdFind(-1) : stepMdFind(1)" @keydown.esc.prevent="toggleMdFind(false)">
<span class="md-find-nav"><button type="button" aria-label="Previous match" @click="stepMdFind(-1)" :disabled="!mdFindTotal"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-left"></use></svg></button><button type="button" aria-label="Next match" @click="stepMdFind(1)" :disabled="!mdFindTotal"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-chevron-right"></use></svg></button></span>
<span class="md-find-count" aria-live="polite">{{ mdFindQuery ? (mdFindTotal ? (mdFindIndex + 1) + ' of ' + mdFindTotal : 'No results') : '' }}</span>
<button type="button" class="md-find-opt" :class="{ 'is-on': mdFindCase }" :aria-pressed="mdFindCase ? 'true' : 'false'" title="Match case" aria-label="Match case" @click="mdFindCase = !mdFindCase; runMdFind()">Aa</button>
<button type="button" class="md-find-close" aria-label="Close find" @click="toggleMdFind(false)">&times;</button>
</div>
<div class="reading-layout" v-if="type == 'html'">
<div class="file-content markdown-body" v-html="renderReadme(sanitize(content))"></div>
<aside class="readme-toc" v-if="readmeToc().length &gt;= 3" aria-label="On this page">
<div class="readme-toc-head">On this page</div>
<nav class="toc-rail"><a href="#" class="lvl-2 toc-top" :class="{ 'is-active': !activeHeading }" @click.prevent="scrollToHeading(null)">Introduction</a><a v-for="(h, i) in readmeToc()" :key="h.id" :href="'#' + h.id" :class="['lvl-' + h.level, { 'is-active': activeHeading === h.id }]" @click.prevent="scrollToHeading(h.id)">{{ h.text }}</a></nav>
</aside>
</div>
</section>
<html-doc v-if="type == &#x27;html-doc&#x27; &amp;&amp; !showSource &amp;&amp; content != null" :content="content" :base-url="(fileBaseUrl)" :allow-scripts="allowScripts"></html-doc>
<div v-code-editor="{ content: content, options: aceOption }" v-if="(type == &#x27;code&#x27; || (type == &#x27;html-doc&#x27; &amp;&amp; showSource)) &amp;&amp; content != null"></div>
<img class="image-content" v-if="type == &#x27;image&#x27;" :src="safeUrl((url))">
<iframe class="h-100 overflow-auto w-100 b-0" v-if="type == &#x27;media&#x27;" :src="safeUrl((url))"></iframe>
<pdfviewer v-if="type == &#x27;pdf&#x27;" :src="safeUrl((url))"></pdfviewer>
@@ -42,5 +127,5 @@
<div class="viewer-loading-lines" aria-hidden="true"><span v-for="line in 10" :key="line"></span></div>
</section>
<div class="file-error container d-flex h-100" v-if="type == &#x27;empty&#x27;"><h1 class="paper-empty-title m-auto">Empty <em>repository</em>.</h1></div>
<div class="file-error container d-flex h-100" v-if="content == null &amp;&amp; type != &#x27;empty&#x27;"><h1 class="paper-empty-title m-auto">Empty <em>file</em>.</h1></div>
<div class="file-error container d-flex h-100" v-if="content == null &amp;&amp; !['empty', 'loading', 'error', 'rate_limited'].includes(type)"><h1 class="paper-empty-title m-auto">Empty <em>file</em>.</h1></div>
<div class="file-error container d-flex h-100" v-if="type == &#x27;binary&#x27;"><h1 class="paper-empty-title m-auto">Unsupported <em>binary file</em>. You can <a target="_blank" :href="safeUrl((url) + &quot;&amp;download=true&quot;)">download it</a>.</h1></div>
+1 -1
View File
@@ -6,7 +6,7 @@
]">
<div class="quota-header">
<span class="quota-label"><svg class="project-type-svg" aria-hidden="true"><use :href="'#' + q.icon"></use></svg>{{ q.label }}</span>
<span class="quota-percent" v-if="!quota[q.key].unlimited">{{ fmt.number(quota[q.key].percent, 0) }}% used</span>
<span class="quota-percent" v-if="!quota[q.key].unlimited">{{ quota[q.key].percent > 0 &amp;&amp; quota[q.key].percent < 1 ? '<1' : fmt.number(quota[q.key].percent, 0) }}% used</span>
<span class="quota-unlimited-tag" v-if="quota[q.key].unlimited">Unlimited</span>
</div>
<div class="quota-value"><strong>{{ formatAmount(quota[q.key].used, q.kind) }}</strong><span v-if="!quota[q.key].unlimited"> / {{ formatAmount(quota[q.key].total, q.kind) }}</span></div>
+75 -21
View File
@@ -126,8 +126,8 @@ export const repositoriesAdminController = function (state, http, location) {
conference: "",
dateFrom: "",
dateTo: "",
ready: false,
expired: false,
ready: true,
expired: true,
removed: false,
error: true,
preparing: true,
@@ -242,6 +242,7 @@ export const repositoriesAdminController = function (state, http, location) {
);
};
state.filtersOpen = false;
state.fetchError = null;
function getRepositories() {
state.fetchError = null;
@@ -250,8 +251,6 @@ export const repositoriesAdminController = function (state, http, location) {
state.total = res.data.total;
state.totalPage = Math.ceil(res.data.total / state.query.limit);
state.repositories = res.data.results;
state.statusCounts = res.data.statusCounts || [];
state.totalSize = res.data.totalSize || 0;
state.allSelected = false;
},
(err) => {
@@ -260,14 +259,25 @@ export const repositoriesAdminController = function (state, http, location) {
}
);
}
// Status chips always show real totals: the list endpoint counts only within the
// active status filter, so ask again with every status enabled (one row).
function getStatusCounts() {
const params = Object.assign({}, state.query, { page: 1, limit: 1, ready: true, expired: true, removed: true, error: true, preparing: true });
http.get("/api/admin/repos", { params }).then((res) => {
state.statusCounts = res.data.statusCounts || [];
state.totalSize = res.data.totalSize || 0;
}, () => {});
}
state.showAllStatuses = () => Object.assign(state.query, { ready: true, expired: true, removed: true, error: true, preparing: true, page: 1 });
getRepositories();
getStatusCounts();
let timeClear = null;
state.watch(
"query",
() => {
timers.timeout.cancel(timeClear);
timeClear = timers.timeout(getRepositories, 500);
timeClear = timers.timeout(() => { getRepositories(); getStatusCounts(); }, 500);
const { page, search, ...persisted } = state.query;
saveFilterPrefs(reposAdminPrefsKey, persisted);
recomputeChips();
@@ -808,8 +818,8 @@ export const conferencesAdminController = function (state, http, location) {
search: "",
dateFrom: "",
dateTo: "",
ready: false,
expired: false,
ready: true,
expired: true,
removed: false,
error: true,
preparing: true,
@@ -1089,8 +1099,8 @@ export const queuesAdminController = function (state, http, location, interval,
var isDark = document.body.classList.contains("dark-mode");
var labelColor = "#8A857C";
var gridColor = isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.06)";
var completedColor = isDark ? "#A7B2FF" : "#3B4AD6";
var completedFill = isDark ? "rgba(167,178,255,0.12)" : "rgba(59,74,214,0.08)";
var completedColor = isDark ? "#6FBF8A" : "#2F7D4F";
var completedFill = isDark ? "rgba(111,191,138,0.12)" : "rgba(47,125,79,0.08)";
var failedColor = isDark ? "#F08A82" : "#B42318";
var failedFill = isDark ? "rgba(240,138,130,0.08)" : "rgba(180,35,24,0.06)";
var execColor = isDark ? "#F5C842" : "#B8860B";
@@ -1098,7 +1108,7 @@ export const queuesAdminController = function (state, http, location, interval,
var pts = state.metricsPoints || [];
if (pts.length === 0) {
ctx.fillStyle = labelColor;
ctx.font = "12px monospace";
ctx.font = "13px Inter, system-ui, sans-serif";
ctx.textAlign = "center";
ctx.fillText("No metrics data yet", totalW / 2, totalH / 2);
chartState = null;
@@ -1109,6 +1119,19 @@ export const queuesAdminController = function (state, http, location, interval,
var completedPts = pts.map(function (p) { return p.completed; });
var failedPts = pts.map(function (p) { return p.failed; });
var execPts = pts.map(function (p) { return p.avgMs; });
if (!completedPts.some(Boolean) && !failedPts.some(Boolean)) {
ctx.strokeStyle = isDark ? "rgba(255,255,255,0.14)" : "rgba(0,0,0,0.12)";
ctx.beginPath(); ctx.moveTo(0, totalH - 18.5); ctx.lineTo(totalW, totalH - 18.5); ctx.stroke();
ctx.fillStyle = isDark ? "#CFC8BD" : "#4F4A42";
ctx.font = "500 14px Inter, system-ui, sans-serif";
ctx.textAlign = "center";
ctx.fillText("No jobs processed in this window", totalW / 2, totalH / 2 - 6);
ctx.fillStyle = labelColor;
ctx.font = "12.5px Inter, system-ui, sans-serif";
ctx.fillText("Completed and failed jobs will chart here", totalW / 2, totalH / 2 + 16);
chartState = null;
return;
}
var maxLen = pts.length;
var step = w / (maxLen - 1 || 1);
@@ -1594,12 +1617,21 @@ export const errorsAdminController = function (state, http, location, interval)
});
}
// Errors surface first, then warnings, then routine info; within a level, the chosen order.
const rank = (r) => ({ error: 0, warn: 1, info: 2 })[r._bucket] ?? 1;
if (state.query.sort === "count") {
rows.sort((a, b) => b.count - a.count || new Date(b.ts) - new Date(a.ts));
rows.sort((a, b) => rank(a) - rank(b) || b.count - a.count || new Date(b.ts) - new Date(a.ts));
} else {
rows.sort((a, b) => new Date(b.ts) - new Date(a.ts));
rows.sort((a, b) => rank(a) - rank(b) || new Date(b.ts) - new Date(a.ts));
}
state.visible = rows;
// A filter that matches nothing in the loaded window keeps reading older pages
// (bounded) so a 5xx counted in the tiles is not reported as "No errors captured".
const filtering = !!(state.query.bucket || (state.query.search || "").trim());
if (filtering && !rows.length && state.canLoadMore?.() && !state._autoLoading && state.entries.length < 2500) {
state._autoLoading = true;
loadEntries(true);
}
}
function loadEntries(append) {
@@ -1620,9 +1652,10 @@ export const errorsAdminController = function (state, http, location, interval)
state.available = !!res.data.available;
state.cap = res.data.max || state.cap;
state.total = res.data.total || state.entries.length;
state._autoLoading = false;
recompute();
},
(err) => console.error(err)
(err) => { state._autoLoading = false; console.error(err); }
);
}
state.loadMore = () => loadEntries(true);
@@ -1650,17 +1683,18 @@ export const errorsAdminController = function (state, http, location, interval)
loadStats();
}
// For the volume chart: scale tallest bucket-total to a fixed pixel max.
// Volume chart: errors and warnings carry the height (scaled to their own peak, up to 44px);
// routine info traffic is a faint band on top, capped at 16px. Exact counts are in the tooltip.
state.barPx = (b, key) => {
const all = state.stats.buckets || [];
let max = 0;
for (const x of all) max = Math.max(max, (x.error || 0) + (x.warn || 0) + (x.info || 0));
if (!max) return 0;
const total = (b.error || 0) + (b.warn || 0) + (b.info || 0);
if (!total) return 0;
const targetTotal = Math.round((total / max) * 60); // 60px max
let maxEW = 0, maxInfo = 0;
for (const x of all) { maxEW = Math.max(maxEW, (x.error || 0) + (x.warn || 0)); maxInfo = Math.max(maxInfo, x.info || 0); }
const part = b[key] || 0;
return Math.round((part / total) * targetTotal);
if (!part) return 0;
if (key === "info") return maxInfo ? Math.max(2, Math.round((part / maxInfo) * (maxEW ? 16 : 60))) : 0;
const ew = (b.error || 0) + (b.warn || 0);
const h = Math.round((ew / maxEW) * 44);
return Math.max(4, Math.round((part / ew) * h));
};
state.bucketTitle = (b) => {
const t = new Date(b.hour);
@@ -1903,7 +1937,23 @@ export const overviewAdminController = function (state, http, location, interval
};
}
// Always show a full 30-day axis; days before data exists are empty slots.
function padHistory(rows, days) {
if (!rows || !rows.length) return rows;
var last = new Date(rows[rows.length - 1].date);
if (isNaN(last)) return rows;
var byDay = {};
rows.forEach(function (r) { byDay[new Date(r.date).toISOString().slice(0, 10)] = r; });
var out = [];
for (var i = days - 1; i >= 0; i--) {
var dt = new Date(last.getTime() - i * 86400000);
var key = dt.toISOString().slice(0, 10);
out.push(byDay[key] || { date: dt.toISOString(), _empty: true, dailyPageViews: 0, dailyRepositories: 0, dailyUsers: 0, nbUsers: 0 });
}
return out;
}
var historyMaxes = {};
state.historyMax = function (field) { return historyMaxes[field] || 0; };
state.historyBarH = function (d, field) {
if (!d || !historyMaxes[field]) return 0;
return Math.max(1, Math.round((d[field] / historyMaxes[field]) * 140));
@@ -1922,6 +1972,10 @@ export const overviewAdminController = function (state, http, location, interval
r.data.daily = {
today: todayDailyStats(r.data.history),
};
r.data.history = padHistory(r.data.history, 30);
r.data.daily = {
today: todayDailyStats(r.data.history),
};
state.data = r.data;
state.loading = false;
state.error = null;
+413 -21
View File
@@ -1,9 +1,22 @@
import { reactive, nextTick } from "vue";
import { reactive, nextTick, markRaw } from "vue";
import { loadEditor } from "./lazy-assets.js";
import { createTimers, createListeners } from "./state.js";
import { formDraft } from "./drafts.js";
import translations from "../i18n/locale-en.json";
// A README image that fails to load becomes a quiet placeholder, not a broken-image glyph.
if (typeof window !== "undefined" && window.document?.addEventListener) {
window.document.addEventListener("error", (event) => {
const img = event.target;
if (!img || img.tagName !== "IMG" || img.dataset.failed || !img.closest?.(".markdown-body, .anonymize-preview-body")) return;
img.dataset.failed = "1";
const ph = window.document.createElement("span");
ph.className = "img-unavailable";
ph.textContent = img.alt ? "Image unavailable: " + img.alt : "Image unavailable";
img.replaceWith(ph);
}, true);
}
function viewerErrorCode(error) {
let data = error?.data;
if (typeof data === "string") {
@@ -357,6 +370,25 @@ export const homeController = function (state, http, location, window, timeout)
});
};
// Live redaction demo on the landing page: same masking rule as the product (XXXX-n per distinct term).
state.demoText = "# DeepLearnUtils\nDeveloped by Jane Smith at MIT CSAIL.\nSee Smith et al., \"Attention That Works,\" 2026.\nContact: jane.smith@mit.edu";
state.demoTerms = "Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu";
state.demoParts = function () {
const terms = (state.demoTerms || "").split(/[,\n]/).map((t) => t.trim()).filter(Boolean).sort((a, b) => b.length - a.length);
const escape = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
if (!terms.length) return [{ text: state.demoText }];
const re = new RegExp("(" + terms.map(escape).join("|") + ")", "gi");
const index = {};
let n = 0;
return (state.demoText || "").split(re).filter((p) => p !== "").map((p) => {
const key = terms.find((t) => t.toLowerCase() === p.toLowerCase());
if (!key) return { text: p };
if (!index[key.toLowerCase()]) index[key.toLowerCase()] = ++n;
return { text: String(index[key.toLowerCase()]), redacted: true, original: p };
});
};
state.demoCount = () => state.demoParts().filter((p) => p.redacted).length;
state.cards = [
{ key: "repositories", total: 0, label: "repositories anonymized" },
{ key: "users", total: 0, label: "researchers" },
@@ -370,6 +402,8 @@ export const homeController = function (state, http, location, window, timeout)
state.cards[1].total = res.data.nbUsers;
state.cards[2].total = res.data.nbPageViews;
state.cards[3].total = res.data.nbPullRequests;
}).catch(() => {
// Leave the placeholders in place rather than showing zeros.
});
}
getStat();
@@ -436,7 +470,7 @@ export const homeController = function (state, http, location, window, timeout)
pageViews: buildSeriesView(rows.map((r) => r.nbPageViews || 0)),
pullRequests: buildSeriesView(rows.map((r) => r.nbPullRequests || 0)),
};
});
}).catch(() => {});
};
export const unifiedDashboardController = function (state, http, location, promises, window, quotaService) {
@@ -1446,6 +1480,8 @@ export const anonymizeController = function (state, http, html, params, location
setValidity("sourceUrl", "github", true);
const transferFocus = document.activeElement?.id === "sourceUrl-landing";
state.workspaceOpen = true;
// Show the pasted URL from its start, not scrolled to the caret.
setTimeout(() => { const el = window.document.getElementById("sourceUrl"); if (!el) return; try { el.setSelectionRange(0, 0); } catch { /* not a text input */ } el.scrollLeft = 0; }, 50);
if (transferFocus) timeout(() => document.getElementById("sourceUrl")?.focus(), 0);
state.reconnectingSource = false;
state.reconnectRepositoryId = undefined;
@@ -2187,6 +2223,20 @@ export const exploreController = function (state, http, location, params, html,
state.fileSearchResults = null;
state.fileSearchLoading = false;
listen(document, "click", (e) => {
if (state.symbolsOpen && !e.target.closest?.(".symbols")) state.symbolsOpen = false;
if (state.moreOpen && !e.target.closest?.(".tb-more")) state.moreOpen = false;
if (state.accountOpen && !e.target.closest?.(".acct")) state.accountOpen = false;
if (state.helpOpen && !e.target.closest?.(".vb-help")) state.helpOpen = false;
});
listen(document, "keydown", (e) => {
if (e.key === "Escape") { state.symbolsOpen = false; state.moreOpen = false; state.accountOpen = false; state.helpOpen = false; }
if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key && e.key.toLowerCase() === "f" && state.type === "html" && window.document.querySelector(".reading-layout")) {
e.preventDefault();
state.toggleMdFind(true);
}
});
listen(document, "keydown", function (e) {
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
e.preventDefault();
@@ -2382,7 +2432,6 @@ export const exploreController = function (state, http, location, params, html,
);
}
}
state.fileCounts = null;
state.getFiles = function (path, background = false) {
const repoId = state.repoId;
return http.get(
@@ -2402,18 +2451,6 @@ export const exploreController = function (state, http, location, params, html,
}
});
};
function fetchFileCounts() {
const repoId = state.repoId;
http.get(
`/api/repo/${state.repoId}/files/counts`
).then(function (res) {
if (destroyed || repoId !== state.repoId) return;
state.fileCounts = res.data;
}, function () {
state.fileCounts = {};
});
}
function getSelectedFile() {
return state.files.filter(
(f) =>
@@ -2486,6 +2523,289 @@ export const exploreController = function (state, http, location, params, html,
state.allowScripts = !state.allowScripts;
};
// Wrap on wide screens; on phones code scrolls sideways so tokens stay intact.
const storedWrap = (() => { try { return window.localStorage?.getItem("wrapLines"); } catch { return null; } })();
state.wrapLines = (storedWrap ?? (window.matchMedia?.("(max-width: 767px)").matches ? "false" : "true")) !== "false";
state.toggleWrap = function () {
state.wrapLines = !state.wrapLines;
try { window.localStorage?.setItem("wrapLines", String(state.wrapLines)); } catch { /* storage unavailable */ }
state.codeEditor?.session.setUseWrapMode(state.wrapLines);
};
// Find opens as an overlay at the top right of the code, like an editor.
// Find on rendered Markdown pages: highlight matches inside the reading column.
function mdFindRoot() { return window.document.querySelector(".reading-layout .markdown-body"); }
function clearMdFind() {
const root = mdFindRoot();
if (!root) return;
root.querySelectorAll("mark.md-find").forEach((m) => { m.replaceWith(window.document.createTextNode(m.textContent)); });
root.normalize();
}
state.runMdFind = function () {
clearMdFind();
state.mdFindTotal = 0;
state.mdFindIndex = 0;
const q = (state.mdFindQuery || "").trim();
const root = mdFindRoot();
if (!q || !root) return;
const cs = !!state.mdFindCase;
const needle = cs ? q : q.toLowerCase();
const walker = window.document.createTreeWalker(root, 4);
const nodes = [];
while (walker.nextNode()) if ((cs ? walker.currentNode.nodeValue : walker.currentNode.nodeValue.toLowerCase()).includes(needle)) nodes.push(walker.currentNode);
let total = 0;
for (const node of nodes) {
const text = node.nodeValue, lower = cs ? text : text.toLowerCase();
const frag = window.document.createDocumentFragment();
let last = 0, i;
while ((i = lower.indexOf(needle, last)) !== -1) {
frag.appendChild(window.document.createTextNode(text.slice(last, i)));
const m = window.document.createElement("mark");
m.className = "md-find";
m.textContent = text.slice(i, i + q.length);
frag.appendChild(m);
total++;
last = i + q.length;
}
frag.appendChild(window.document.createTextNode(text.slice(last)));
node.parentNode.replaceChild(frag, node);
}
state.mdFindTotal = total;
if (total) state.stepMdFind(0);
};
state.stepMdFind = function (delta) {
const root = mdFindRoot();
if (!root || !state.mdFindTotal) return;
const marks = root.querySelectorAll("mark.md-find");
state.mdFindIndex = (state.mdFindIndex + delta + marks.length) % marks.length;
marks.forEach((m, i) => m.classList.toggle("is-current", i === state.mdFindIndex));
marks[state.mdFindIndex]?.scrollIntoView({ block: "center", behavior: "smooth" });
};
state.toggleMdFind = function (open) {
state.mdFindOpen = open === undefined ? !state.mdFindOpen : open;
if (!state.mdFindOpen) { clearMdFind(); state.mdFindTotal = 0; return; }
nextTick(() => window.document.querySelector(".md-find-input")?.focus());
};
state.findInFile = function () {
const editor = state.codeEditor;
if (!editor) return;
editor.focus();
editor.execCommand("find");
// Docked under the toolbar: push the code down while the find bar is open.
const dock = () => {
const box = editor.searchBox?.element;
if (!box) return;
editor.renderer.setScrollMargin(52, 12, 0, 0);
if (box._dockObserver) return;
box._dockObserver = new MutationObserver(() => {
editor.renderer.setScrollMargin(box.style.display !== "none" ? 52 : 12, 12, 0, 0);
});
box._dockObserver.observe(box, { attributes: true, attributeFilter: ["style"] });
};
dock();
setTimeout(dock, 150);
};
// Lightweight outline: top-level classes, functions and exported constants.
const symbolPatterns = [
[/^\s*(?:export\s+)?(?:default\s+)?(?:abstract\s+)?class\s+([A-Za-z_$][\w$]*)/, "class"],
[/^\s*(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/, "function"],
[/^\s*(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/, "function"],
[/^\s*(?:async\s+)?def\s+([A-Za-z_]\w*)/, "function"],
[/^\s*class\s+([A-Za-z_]\w*)/, "class"],
[/^\s*func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/, "function"],
[/^\s*(?:pub\s+)?fn\s+([A-Za-z_]\w*)/, "function"],
[/^\s*(?:public|private|protected|static|\s)+[\w<>\[\],\s]+\s+([A-Za-z_]\w*)\s*\([^;]*\)\s*\{?\s*$/, "function"],
];
let symbolCache = { content: null, list: [] };
state.symbolsOpen = false;
state.symbols = function () {
if (typeof state.content !== "string" || state.content.length > 2_000_000) return [];
if (symbolCache.content === state.content) return symbolCache.list;
const list = [];
state.content.split("\n").forEach((text, index) => {
for (const [re, kind] of symbolPatterns) {
const m = re.exec(text);
if (m && !/^(if|for|while|switch|return|catch)$/.test(m[1])) { list.push({ name: m[1], kind, line: index + 1 }); break; }
}
});
symbolCache = { content: state.content, list: list.slice(0, 300) };
return symbolCache.list;
};
state.goToSymbol = function (line) {
state.symbolsOpen = false;
const editor = state.codeEditor;
if (!editor) return;
editor.scrollToLine(line - 1, true, true, () => {});
editor.gotoLine(line, 0, true);
window.history.replaceState(null, "", window.location.pathname + window.location.search + "#L" + line);
window.dispatchEvent(new HashChangeEvent("hashchange"));
};
state.gotoLine = function () {
const editor = state.codeEditor;
if (!editor) return;
editor.focus();
editor.execCommand("gotoline");
};
// Root listing above the README: folders first, then files.
state.rootEntries = function () {
return [...(state.files || [])].sort((a, b) => {
const af = a.size == null, bf = b.size == null;
if (af !== bf) return af ? -1 : 1;
return a.name.localeCompare(b.name);
});
};
state.formatSize = function (bytes) {
if (bytes == null) return "";
if (bytes < 1024) return bytes + " B";
const kb = bytes / 1024;
return kb < 1024 ? kb.toFixed(1) + " KB" : (kb / 1024).toFixed(1) + " MB";
};
state.fileSize = function (path) {
if (!path) return null;
const clean = path.replace(/^\/+/, "");
const entry = (state.files || []).find((f) => (f.path ? f.path + "/" : "") + f.name === clean);
return entry && entry.size != null ? entry.size : null;
};
state.revealFolder = function (name) {
state.sidebarHidden = false;
state.sidebarCollapsed = false;
nextTick(() => {
const link = window.document.querySelector('.files a[data-path="/' + (window.CSS?.escape ? window.CSS.escape(name) : name) + '"]');
if (!link) return;
if (!link.closest("li")?.classList.contains("open")) link.click();
link.scrollIntoView({ block: "nearest" });
link.focus();
});
};
// Redactions are the product's signature: show every XXXX-n mask as a chip.
const REDACTION_RE = /\bXXXX-\d+\b/g;
state.redactionCount = function () {
if (typeof state.content !== "string") return 0;
const text = state.type === "html" ? state.content.replace(/<[^>]*>/g, " ") : state.content;
return (text.match(REDACTION_RE) || []).length;
};
state.renderRedacted = function (html) {
if (!html || html.indexOf("XXXX-") === -1 || typeof window.DOMParser !== "function") return html;
const doc = new window.DOMParser().parseFromString("<div>" + html + "</div>", "text/html");
const walker = doc.createTreeWalker(doc.body, 4);
const nodes = [];
while (walker.nextNode()) if (REDACTION_RE.test(walker.currentNode.nodeValue)) nodes.push(walker.currentNode);
for (const node of nodes) {
REDACTION_RE.lastIndex = 0;
const frag = doc.createDocumentFragment();
let last = 0, m;
const text = node.nodeValue;
while ((m = REDACTION_RE.exec(text))) {
frag.appendChild(doc.createTextNode(text.slice(last, m.index)));
const mark = doc.createElement("mark");
mark.className = "redact-chip";
mark.setAttribute("title", "Redacted term " + m[0].slice(5) + " — the same term everywhere in this snapshot");
// Display: an empty slot holding only the term's number (the file keeps XXXX-N).
const num = m[0].slice(5);
mark.textContent = "";
const idx = doc.createElement("i");
idx.textContent = num;
mark.appendChild(idx);
mark.dataset.term = m[0];
mark.setAttribute("aria-label", "Redacted term " + num);
// Keep trailing punctuation on the chip's line (no orphaned "." or ",").
const trail = /^[.,;:!?)\]]+/.exec(text.slice(m.index + m[0].length));
if (trail) {
const glue = doc.createElement("span");
glue.className = "redact-glue";
glue.appendChild(mark);
glue.appendChild(doc.createTextNode(trail[0]));
frag.appendChild(glue);
last = m.index + m[0].length + trail[0].length;
} else {
frag.appendChild(mark);
last = m.index + m[0].length;
}
}
frag.appendChild(doc.createTextNode(text.slice(last)));
node.parentNode.replaceChild(frag, node);
}
return doc.body.firstChild.innerHTML;
};
// Reading mode: slugged heading ids + an "On this page" outline (like Mintlify/Stripe docs).
const slug = (t) => t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").slice(0, 60) || "section";
state.renderReadme = function (html) {
const out = state.renderRedacted(html);
if (!out || typeof window.DOMParser !== "function") return out;
const doc = new window.DOMParser().parseFromString("<div>" + out + "</div>", "text/html");
const seen = {};
doc.querySelectorAll("h1, h2, h3").forEach((h) => {
let id = h.id || slug(h.textContent);
if (seen[id]) id += "-" + (++seen[id]); else seen[id] = 1;
h.id = id;
});
return doc.body.firstChild.innerHTML;
};
let tocCache = { content: null, list: [] };
state.readmeToc = function () {
if (state.type !== "html" || typeof state.content !== "string") return [];
if (tocCache.content === state.content) return tocCache.list;
const doc = new window.DOMParser().parseFromString("<div>" + state.renderReadme(state.sanitize ? state.sanitize(state.content) : state.content) + "</div>", "text/html");
const list = [...doc.querySelectorAll("h2, h3")].map((h) => ({ id: h.id, text: h.textContent.trim(), level: h.tagName === "H3" ? 3 : 2 })).slice(0, 40);
tocCache = { content: state.content, list };
return list;
};
state.activeHeading = null;
listen(window, "scroll", () => {
const toc = state.readmeToc ? state.readmeToc() : [];
if (!toc.length) return;
// Active = the first heading visible below the sticky chrome; if none is on screen,
// the last heading already scrolled past (the reader is inside that section).
const chrome = 150;
let current = "", firstVisible = "";
for (const h of toc) {
const el = window.document.getElementById(h.id);
if (!el) continue;
const top = el.getBoundingClientRect().top;
if (top < chrome) current = h.id;
else if (!firstVisible && top < window.innerHeight - 80) firstVisible = h.id;
}
if (firstVisible) current = firstVisible;
if (state.activeHeading !== current) state.activeHeading = current;
}, { capture: true, passive: true });
state.scrollToHeading = function (id) {
if (!id) {
const sc = window.document.querySelector(".explorer-content, .file-card-body, .main-pane");
(sc || window).scrollTo({ top: 0, behavior: "smooth" });
state.activeHeading = "";
return;
}
const el = window.document.getElementById(id);
if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
state.activeHeading = id;
};
state.redactParts = function (text) {
const out = []; let last = 0; let m; const re = /\bXXXX-(\d+)\b/g;
text = String(text || "");
while ((m = re.exec(text))) { if (m.index > last) out.push({ t: text.slice(last, m.index) }); out.push({ n: m[1] }); last = m.index + m[0].length; }
if (last < text.length) out.push({ t: text.slice(last) });
return out;
};
state.pathCopied = false;
state.copyPath = async function () {
if (!window.navigator.clipboard?.writeText) return;
await window.navigator.clipboard.writeText(state.filePath || "");
state.pathCopied = true;
setTimeout(() => { state.pathCopied = false; }, 1600);
};
state.contentCopied = false;
state.copyContent = async function () {
if (typeof state.content !== "string" || !window.navigator.clipboard?.writeText) return;
// Rendered Markdown: copy the source, not the HTML.
let text = state.content;
if (state.type === "html" && state.url) {
try { text = await (await window.fetch(state.url, { credentials: "same-origin" })).text(); } catch (_) { return; }
}
await window.navigator.clipboard.writeText(text);
state.contentCopied = true;
setTimeout(() => { state.contentCopied = false; }, 1600);
};
function getMode(extension) {
if (extensionModes[extension]) {
return extensionModes[extension];
@@ -2647,6 +2967,9 @@ export const exploreController = function (state, http, location, params, html,
extension = extension.substring(extensionIndex + 1);
}
const languageNames = { 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", text: "" };
const detectedMode = getMode(extension);
state.languageName = languageNames[detectedMode] ?? (detectedMode ? detectedMode.charAt(0).toUpperCase() + detectedMode.slice(1) : "");
state.aceOption = {
readOnly: true,
useWrapMode: true,
@@ -2654,14 +2977,14 @@ export const exploreController = function (state, http, location, params, html,
theme: "chrome",
useSoftTab: true,
tabSize: 2,
fontSize: 15,
fontSize: 13,
keyBinding: "vscode",
fullLineSelection: true,
highlightActiveLine: false,
highlightGutterLine: false,
cursor: "hide",
showInvisibles: false,
showIndentGuides: true,
showIndentGuides: false,
showPrintMargin: false,
highlightSelectedWord: false,
enableBehaviours: true,
@@ -2669,6 +2992,53 @@ export const exploreController = function (state, http, location, params, html,
mode: getMode(extension),
onLoad: function (_editor) {
state.codeEditor = markRaw(_editor);
{
// Render each XXXX-n as its own "redacted" token so the text layer
// draws it exactly like the Markdown chip (teal text on a teal tint).
const session = _editor.session;
const origGetTokens = session.getTokens.bind(session);
const re = /\bXXXX-\d+\b/g;
session.getTokens = function (row) {
const tokens = origGetTokens(row);
if (!tokens.some((t) => t.value.indexOf("XXXX-") !== -1)) return tokens;
const out = [];
for (const t of tokens) {
if (t.value.indexOf("XXXX-") === -1) { out.push(t); continue; }
let last = 0;
re.lastIndex = 0;
let m;
while ((m = re.exec(t.value))) {
if (m.index > last) out.push({ type: t.type, value: t.value.slice(last, m.index) });
out.push({ type: "redacted.n" + m[0].slice(5), value: m[0] });
last = m.index + m[0].length;
}
if (last < t.value.length) out.push({ type: t.type, value: t.value.slice(last) });
}
return out;
};
// Each redacted token shows its term number inside the slot.
if (!window.document.getElementById("redact-index-rules")) {
const st = window.document.createElement("style");
st.id = "redact-index-rules";
st.textContent = Array.from({ length: 99 }, (_, i) => `.ace_redacted.ace_n${i + 1}::after{content:"${i + 1}"}`).join("");
window.document.head.appendChild(st);
}
_editor.renderer.updateFull(true);
}
_editor.session.setUseWrapMode(state.wrapLines !== false);
// The right-edge fade is a cue only while there is more code to the right.
const card = _editor.container.closest?.(".file-card");
const syncEdge = () => {
if (!card) return;
const r = _editor.renderer;
const max = (r.layerConfig?.width || 0) - (r.$size?.scrollerWidth || 0);
card.classList.toggle("at-right-edge", max <= 2 || r.getScrollLeft() >= max - 2);
};
_editor.session.on("changeScrollLeft", syncEdge);
_editor.renderer.on("afterRender", syncEdge);
// On phones code scrolls sideways; keep the scrollbar visible as a cue.
if (window.matchMedia?.("(max-width: 767px)").matches) _editor.setOption("hScrollBarAlwaysVisible", true);
const Range = ace.require("ace/range").Range;
let activeLineMarker = null;
@@ -2733,12 +3103,19 @@ export const exploreController = function (state, http, location, params, html,
const removeHashListener = listen(window, "hashchange", () => applyHashFromUrl(false));
_editor.setFontSize(state.aceOption.fontSize);
_editor.setOptions({
fontFamily: "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace",
});
_editor.container.style.lineHeight = "20px";
_editor.renderer.setPadding(16);
_editor.renderer.setScrollMargin(12, 12, 0, 0);
_editor.renderer.updateFontSize();
_editor.setReadOnly(state.aceOption.readOnly);
_editor.setKeyboardHandler(state.aceOption.keyBinding);
_editor.setSelectionStyle(
state.aceOption.fullLineSelection ? "line" : "text"
);
_editor.setOption("displayIndentGuides", true);
_editor.setOption("displayIndentGuides", false);
_editor.setHighlightActiveLine(
state.aceOption.highlightActiveLine
);
@@ -2761,7 +3138,24 @@ export const exploreController = function (state, http, location, params, html,
_editor.session.setTabSize(state.aceOption.tabSize);
_editor.setBehavioursEnabled(state.aceOption.enableBehaviours);
_editor.setFadeFoldWidgets(state.aceOption.fadeFoldWidgets);
return removeHashListener;
// Ctrl/Cmd+F searches inside the file (Ace searchbox), like GitHub's blob view.
const removeFindListener = listen(window, "keydown", (event) => {
if ((event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "g" && document.body.contains(_editor.container)) {
event.preventDefault();
state.gotoLine();
return;
}
if (event.altKey && !event.ctrlKey && !event.metaKey && event.key.toLowerCase() === "z" && document.body.contains(_editor.container)) {
event.preventDefault();
state.toggleWrap();
return;
}
if ((event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "f" && document.body.contains(_editor.container)) {
event.preventDefault();
state.findInFile();
}
});
return () => { removeHashListener(); removeFindListener(); };
},
};
if (state.isDarkMode) {
@@ -2790,7 +3184,6 @@ export const exploreController = function (state, http, location, params, html,
cancelContentLoad();
state.files = [];
state.content = null;
state.fileCounts = null;
state.fileSearchQuery = "";
state.onFileSearchChange();
state.repoId = params.repoId;
@@ -2800,7 +3193,6 @@ export const exploreController = function (state, http, location, params, html,
const repoId = state.repoId;
getOptions(function (options) {
fetchFileCounts();
if (state.filePath) {
// File URLs are independently authorized by the content endpoint.
// The tree is navigation metadata, not a prerequisite for reading.
+5 -2
View File
@@ -122,9 +122,12 @@ export const paperScrollspy = {
const observer = new IntersectionObserver(entries => {
entries.forEach(e => e.isIntersecting ? visible.add(e.target.id) : visible.delete(e.target.id));
const active = links.find(a => visible.has(a.hash.slice(1)));
links.forEach(a => a.classList.toggle("active", a === active));
if (active) links.forEach(a => a.classList.toggle("active", a === active));
}, { rootMargin: "-20% 0px -60% 0px", threshold: 0 });
nextTick(() => links.forEach(a => { const target = document.getElementById(a.hash.slice(1)); if (target) observer.observe(target); }));
nextTick(() => {
links.forEach(a => { const target = document.getElementById(a.hash.slice(1)); if (target) observer.observe(target); });
if (links[0] && !links.some(a => a.classList.contains("active"))) links[0].classList.add("active");
});
el._observer = observer;
},
beforeUnmount(el) { el._observer?.disconnect(); },
+1 -1
View File
@@ -6,4 +6,4 @@ ${e}</blockquote>
`}table(e,t){return"<table>\n<thead>\n"+e+"</thead>\n"+(t=t&&`<tbody>${t}</tbody>`)+"</table>\n"}tablerow(e){return`<tr>
${e}</tr>
`}tablecell(e,t){var i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+e+`</${i}>
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,i){var s=u(e);if(null===s)return i;let n='<a href="'+(e=s)+'"';return t&&(n+=' title="'+t+'"'),n+=">"+i+"</a>"}image(e,t,i){var s=u(e);if(null===s)return i;let n=`<img src="${e=s}" alt="${i}"`;return t&&(n+=` title="${t}"`),n+=">"}text(e){return e}}class N{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class I{options;renderer;textRenderer;constructor(e){this.options=e||t.defaults,this.options.renderer=this.options.renderer||new D,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new N}static parse(e,t){return new I(t).parse(e)}static parseInline(e,t){return new I(t).parseInline(e)}parse(s,n=!0){let u="";for(let i=0;i<s.length;i++){var g=s[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[g.type]){let e=g,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){u+=t||"";continue}}switch(g.type){case"space":continue;case"hr":u+=this.renderer.hr();continue;case"heading":{let e=g;u+=this.renderer.heading(this.parseInline(e.tokens),e.depth,this.parseInline(e.tokens,this.textRenderer).replace(H,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""));continue}case"code":{let e=g;u+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{let i=g,e="",s="";for(let e=0;e<i.header.length;e++)s+=this.renderer.tablecell(this.parseInline(i.header[e].tokens),{header:!0,align:i.align[e]});e+=this.renderer.tablerow(s);let n="";for(let e=0;e<i.rows.length;e++){let t=i.rows[e];s="";for(let e=0;e<t.length;e++)s+=this.renderer.tablecell(this.parseInline(t[e].tokens),{header:!1,align:i.align[e]});n+=this.renderer.tablerow(s)}u+=this.renderer.table(e,n);continue}case"blockquote":{let e=g,t=this.parse(e.tokens);u+=this.renderer.blockquote(t);continue}case"list":{let o=g,e=o.ordered,t=o.start,a=o.loose,c="";for(let n=0;n<o.items.length;n++){let t=o.items[n],i=t.checked,e=t.task,s="";if(t.task){let e=this.renderer.checkbox(!!i);a?0<t.tokens.length&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&0<t.tokens[0].tokens.length&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):s+=e+" "}s+=this.parse(t.tokens,a),c+=this.renderer.listitem(s,e,!!i)}u+=this.renderer.list(c,e,t);continue}case"html":{let e=g;u+=this.renderer.html(e.text,e.block);continue}case"paragraph":{let e=g;u+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let e=g,t=e.tokens?this.parseInline(e.tokens):e.text;for(;i+1<s.length&&"text"===s[i+1].type;)e=s[++i],t+="\n"+(e.tokens?this.parseInline(e.tokens):e.text);u+=n?this.renderer.paragraph(t):t;continue}default:{let e='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return u}parseInline(t,i){i=i||this.renderer;let s="";for(let e=0;e<t.length;e++){var n=t[e];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){s+=e||"";continue}}switch(n.type){case"escape":{let e=n;s+=i.text(e.text);break}case"html":{let e=n;s+=i.html(e.text);break}case"link":{let e=n;s+=i.link(e.href,e.title,this.parseInline(e.tokens,i));break}case"image":{let e=n;s+=i.image(e.href,e.title,e.text);break}case"strong":{let e=n;s+=i.strong(this.parseInline(e.tokens,i));break}case"em":{let e=n;s+=i.em(this.parseInline(e.tokens,i));break}case"codespan":{let e=n;s+=i.codespan(e.text);break}case"br":s+=i.br();break;case"del":{let e=n;s+=i.del(this.parseInline(e.tokens,i));break}case"text":{let e=n;s+=i.text(e.text);break}default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return s}}class O{options;constructor(e){this.options=e||t.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class ue{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(S.lex,I.parse);parseInline=this.#e(S.lexInline,I.parseInline);Parser=I;Renderer=D;TextRenderer=N;Lexer=S;Tokenizer=p;Hooks=O;constructor(...e){this.use(..Line truncated
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,i){var s=u(e);if(null===s)return i;let n='<a href="'+(e=s)+'"';return t&&(n+=' title="'+t+'"'),n+=">"+i+"</a>"}image(e,t,i){var s=u(e);if(null===s)return i;let n=`<img src="${e=s}" alt="${i}"`;return t&&(n+=` title="${t}"`),n+=">"}text(e){return e}}class N{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class I{options;renderer;textRenderer;constructor(e){this.options=e||t.defaults,this.options.renderer=this.options.renderer||new D,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new N}static parse(e,t){return new I(t).parse(e)}static parseInline(e,t){return new I(t).parseInline(e)}parse(s,n=!0){let u="";for(let i=0;i<s.length;i++){var g=s[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[g.type]){let e=g,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){u+=t||"";continue}}switch(g.type){case"space":continue;case"hr":u+=this.renderer.hr();continue;case"heading":{let e=g;u+=this.renderer.heading(this.parseInline(e.tokens),e.depth,this.parseInline(e.tokens,this.textRenderer).replace(H,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""));continue}case"code":{let e=g;u+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{let i=g,e="",s="";for(let e=0;e<i.header.length;e++)s+=this.renderer.tablecell(this.parseInline(i.header[e].tokens),{header:!0,align:i.align[e]});e+=this.renderer.tablerow(s);let n="";for(let e=0;e<i.rows.length;e++){let t=i.rows[e];s="";for(let e=0;e<t.length;e++)s+=this.renderer.tablecell(this.parseInline(t[e].tokens),{header:!1,align:i.align[e]});n+=this.renderer.tablerow(s)}u+=this.renderer.table(e,n);continue}case"blockquote":{let e=g,t=this.parse(e.tokens);u+=this.renderer.blockquote(t);continue}case"list":{let o=g,e=o.ordered,t=o.start,a=o.loose,c="";for(let n=0;n<o.items.length;n++){let t=o.items[n],i=t.checked,e=t.task,s="";if(t.task){let e=this.renderer.checkbox(!!i);a?0<t.tokens.length&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&0<t.tokens[0].tokens.length&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):s+=e+" "}s+=this.parse(t.tokens,a),c+=this.renderer.listitem(s,e,!!i)}u+=this.renderer.list(c,e,t);continue}case"html":{let e=g;u+=this.renderer.html(e.text,e.block);continue}case"paragraph":{let e=g;u+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let e=g,t=e.tokens?this.parseInline(e.tokens):e.text;for(;i+1<s.length&&"text"===s[i+1].type;)e=s[++i],t+="\n"+(e.tokens?this.parseInline(e.tokens):e.text);u+=n?this.renderer.paragraph(t):t;continue}default:{let e='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return u}parseInline(t,i){i=i||this.renderer;let s="";for(let e=0;e<t.length;e++){var n=t[e];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){s+=e||"";continue}}switch(n.type){case"escape":{let e=n;s+=i.text(e.text);break}case"html":{let e=n;s+=i.html(e.text);break}case"link":{let e=n;s+=i.link(e.href,e.title,this.parseInline(e.tokens,i));break}case"image":{let e=n;s+=i.image(e.href,e.title,e.text);break}case"strong":{let e=n;s+=i.strong(this.parseInline(e.tokens,i));break}case"em":{let e=n;s+=i.em(this.parseInline(e.tokens,i));break}case"codespan":{let e=n;s+=i.codespan(e.text);break}case"br":s+=i.br();break;case"del":{let e=n;s+=i.del(this.parseInline(e.tokens,i));break}case"text":{let e=n;s+=i.text(e.text);break}default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return s}}class O{options;constructor(e){this.options=e||t.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class ue{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(S.lex,I.parse);parseInline=this.#e(S.lexInline,I.parseInline);Parser=I;Renderer=D;TextRenderer=N;Lexer=S;Tokenizer=p;Hooks=O;constructor(...e){this.use(..Line truncated
+9 -6
View File
@@ -15,19 +15,22 @@ export const humanTime = (function () {
if (!seconds) {
return "never";
}
if (seconds instanceof Date)
var when = null;
if (seconds instanceof Date) {
when = seconds;
seconds = Math.round((Date.now() - seconds) / 1000);
if (typeof seconds == "string" || typeof seconds == "number")
seconds = Math.round((Date.now() - new Date(seconds)) / 1000);
}
if (typeof seconds == "string" || typeof seconds == "number") {
when = new Date(seconds);
seconds = Math.round((Date.now() - when) / 1000);
}
var suffix = seconds < 0 ? "from now" : "ago";
// more than 2 days ago display Date. Spell the month out so the date
// is unambiguous regardless of the reader's locale (9/6 vs 6/9).
if (Math.abs(seconds) > 2 * 60 * 60 * 24) {
const now = new Date();
now.setSeconds(now.getSeconds() - seconds);
const now = when && !isNaN(when) ? when : new Date(Date.now() - seconds * 1000);
return (
"on " +
now.toLocaleDateString(undefined, {
day: "numeric",
month: "short",
+2 -1
View File
@@ -102,7 +102,8 @@ export function mountApplication(target = "#app", options = {}) {
onBeforeUnmount(() => document.removeEventListener("click", navigate));
return () => [
iconsTemplate(root, []),
h("header", { class: "app-header" }, templates["partials/header.htm"](root, headerCache)),
// Repository viewers are a full-height app shell; the explorer carries brand and links itself.
/^\/(r|repository)\//.test(root.path || "") ? null : h("header", { class: ["app-header", { "is-contained": root.path === "/" || root.path === "/faq" }] }, templates["partials/header.htm"](root, headerCache)),
h("main", { class: "app-view align-items-stretch w-100" }, h(RouterView, null, {
default: ({ Component, route }) => Component ? h(Component, { key: route.meta.preserveExplorer ? route.matched[0]?.path : route.path }) : null,
})),
+31
View File
@@ -4,6 +4,37 @@ import { computed } from "vue";
export function initializeTemplate(name, state) {
if (name === "partials/explorer.htm") {
state.sidebarCollapsed = window.matchMedia?.("(max-width: 767px)").matches || false;
state.sidebarHidden = false;
state.dirExpanded = false;
state.moreOpen = false;
state.mdFindOpen = false;
state.mdFindQuery = "";
state.mdFindTotal = 0;
state.mdFindIndex = 0;
state.mdFindCase = false;
state.accountOpen = false;
state.helpOpen = false;
state.sidebarWidth = Math.min(520, Math.max(220, Number(localStorage.getItem("sidebarWidth")) || 280));
// Shared with the app bar so the brand column lines up with the file tree.
document.documentElement.style.setProperty("--sidebar-w", state.sidebarWidth + "px");
state.startSidebarResize = (event) => {
event.preventDefault();
const startX = event.clientX;
const startWidth = state.sidebarWidth;
const move = (e) => {
state.sidebarWidth = Math.min(520, Math.max(220, startWidth + e.clientX - startX));
document.documentElement.style.setProperty("--sidebar-w", state.sidebarWidth + "px");
};
const up = () => {
window.removeEventListener("pointermove", move);
window.removeEventListener("pointerup", up);
document.body.classList.remove("is-resizing");
localStorage.setItem("sidebarWidth", String(state.sidebarWidth));
};
document.body.classList.add("is-resizing");
window.addEventListener("pointermove", move);
window.addEventListener("pointerup", up);
};
}
if (name === "partials/anonymize.htm") {
state.prTabState = { active: state.options.diff ? "diff" : "comments" };
+27 -5
View File
@@ -1,6 +1,29 @@
import { h, reactive, ref, computed, watch, nextTick } from "vue";
import { useRoute } from "vue-router";
// Redacted segments (XXXX-N) render as a slot holding the term number; the rest stays readable.
function redactedNodes(text) {
const out = []; let last = 0; const re = /\bXXXX-(\d+)\b/g; let m;
while ((m = re.exec(text))) {
if (m.index > last) out.push(text.slice(last, m.index));
out.push(h("span", { class: "redact-slot", role: "img", "aria-label": "Redacted term " + m[1] }, [h("i", null, m[1])]));
last = m.index + m[0].length;
}
if (!out.length) return text;
if (last < text.length) out.push(text.slice(last));
return out;
}
// File sizes from the API are bytes; the global humanFileSize expects bits.
function formatBytes(bytes) {
if (bytes < 1024) return `${bytes} B`;
const units = ["KB", "MB", "GB"];
let value = bytes / 1024;
let u = 0;
while (value >= 1024 && u < units.length - 1) { value /= 1024; u++; }
return `${value.toFixed(1)} ${units[u]}`;
}
export function fileHierarchy(files) {
const root = { children: [] };
const directories = new Map([["", root]]);
@@ -85,10 +108,9 @@ export default {
const folder = !!node.children;
const open = matching.value ? opens[path] !== false : !!opens[path];
const truncated = folder && props.page?.options?.truncatedFolders?.includes(path.slice(1));
const count = props.page?.fileCounts?.[path.slice(1)] || 0;
const icon = h("span", { class: folder ? "tree-icon-folder" : "far fa-file tree-icon-file", "aria-hidden": "true" },
folder ? h("svg", { viewBox: "0 0 14 12", focusable: "false" }, h("path", { d: "M1.5 10.5v-9h4l1.5 2h5.5v7z" })) : null);
const label = h("span", { class: "tree-name" }, name);
const label = h("span", { class: "tree-name", title: name.replace(/\bXXXX-(\d+)\b/g, "[redacted term $1]") }, redactedNodes(name));
const onClick = event => {
focus(event.currentTarget);
if (!folder) return;
@@ -102,10 +124,10 @@ export default {
href: folder ? undefined : `/r/${encodeURIComponent(route.params.repoId)}${encodePathForUrl(path)}`,
class: { "tree-focused": focusedPath === path },
onClick,
}, [folder ? h("span", { class: "tree-toggle" }) : parent ? h("span", { class: "tree-spacer" }) : null, icon, label,
}, [folder ? h("span", { class: "tree-toggle" }) : h("span", { class: "tree-spacer" }), icon, label,
truncated ? h("span", { class: "truncated-warning", title: props.page.fmt.translate("WARNINGS.folder_truncated") }, h("i", { class: "fas fa-exclamation-triangle" })) : null,
folder && count ? h("span", { class: "tree-count" }, count) : null]);
return h("li", { key: path, class: { file: true, folder, open, active: selectedPath() === path, truncated }, title: folder ? "" : `Size: ${humanFileSize(node.size || 0)}` }, [link, folder && open ? renderNodes(node.children, path) : null]);
]);
return h("li", { key: path, class: { file: true, folder, open, active: selectedPath() === path, truncated }, title: folder ? "" : `Size: ${formatBytes(node.size || 0)}` }, [link, folder && open ? renderNodes(node.children, path) : null]);
}));
}
return () => h("tree", { ref: host, tabindex: 0, onKeydown: keyboard },
+2 -2
View File
@@ -28,7 +28,7 @@ function humanFileSize(bytes, si = false, dp = 1) {
bytes = bytes / 8;
if (Math.abs(bytes) < thresh) {
return bytes + "B";
return bytes + " B";
}
const units = si
@@ -45,7 +45,7 @@ function humanFileSize(bytes, si = false, dp = 1) {
u < units.length - 1
);
return bytes.toFixed(dp) + "" + units[u];
return bytes.toFixed(dp) + " " + units[u];
}
function urlRel2abs(
+42 -24
View File
@@ -1,30 +1,48 @@
"use strict";(()=>{var ud=Object.defineProperty;var cd=(e,t)=>{for(var s in t)ud(e,s,{get:t[s],enumerable:!0})};var me=["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 he={markdown:"/script/markdown.1d3b1ed22a.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"};var ps=new Map,md=he;function xt(e){if(!ps.has(e)){let t=document.createElement("script");t.src=md[e];let s=new Promise((r,n)=>{t.onload=r,t.onerror=()=>{ps.delete(e),t.remove(),n(new Error(`Unable to load ${e}. Please retry.`))}});ps.set(e,s),document.head.appendChild(t)}return ps.get(e)}async function fs(){await xt("editor"),ace.config.set("basePath","/script/external/ace/")}function ho(e){let t=Object.create(null);for(let s of e.split(","))t[s]=1;return s=>s in t}var qe={},Xt=[],it=()=>{},ln=()=>!1,vo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),go=e=>e.startsWith("onUpdate:"),je=Object.assign,Io=(e,t)=>{let s=e.indexOf(t);s>-1&&e.splice(s,1)},hd=Object.prototype.hasOwnProperty,Re=(e,t)=>hd.call(e,t),ge=Array.isArray,Ft=e=>Po(e)==="[object Map]",zt=e=>Po(e)==="[object Set]",vr=e=>Po(e)==="[object Date]";var be=e=>typeof e=="function",Fe=e=>typeof e=="string",ft=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",dn=e=>(Ae(e)||be(e))&&be(e.then)&&be(e.catch),wr=Object.prototype.toString,Po=e=>wr.call(e),un=e=>Po(e).slice(8,-1),ms=e=>Po(e)==="[object Object]",hs=e=>Fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,yo=ho(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var vs=e=>{let t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},vd=/-\w/g,Ye=vs(e=>e.replace(vd,t=>t.slice(1).toUpperCase())),gd=/\B([A-Z])/g,Rt=vs(e=>e.replace(gd,"-$1").toLowerCase()),eo=vs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vo=vs(e=>e?`on${eo(e)}`:""),gt=(e,t)=>!Object.is(e,t),bo=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},gs=(e,t,s,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:s})},wo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var gr,qo=()=>gr||(gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Le(e){if(ge(e)){let t={};for(let s=0;s<e.length;s++){let r=e[s],n=Fe(r)?kd(r):Le(r);if(n)for(let i in n)t[i]=n[i]}return t}else if(Fe(e)||Ae(e))return e}var yd=/;(?![^(]*\))/g,bd=/:([^]+)/,wd=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function kd(e){let t={};return e.replace(wd,s=>s.startsWith("/*")?"":s).split(yd).forEach(s=>{if(s){let r=s.split(bd);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function A(e){let t="";if(Fe(e))t=e;else if(ge(e))for(let s=0;s<e.length;s++){let r=A(e[s]);r&&(t+=r+" ")}else if(Ae(e))for(let s in e)e[s]&&(t+=s+" ");return t.trim()}var kr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",Er=ho(kr),Ed=ho(kr+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function ys(e){return!!e||e===""}function Cd(e,t,s){if(e.length!==t.length)return!1;let r=!0;for(let n=0;r&&n<e.length;n++)r=Tt(e[n],t[n],s);return r}function yr(e,t,s){if(e.size!==t.size)return!1;let r=Array.from(t),n=new Uint8Array(r.length);for(let i of e){let a=-1;for(let c=0;c<r.length;c++)if(!n[c]&&Tt(i,r[c],s)){a=c;break}if(a<0)retLine truncated
`))),e[uo]=Ws(n);let i=r||n.props&&n.props.type==="number";lo(e,t?"change":"input",a=>{a.target.composing||e[uo](Kn(e.value,s,i))}),(s||i)&&lo(e,"change",()=>{e.value=Kn(e.value,s,i)}),t||(lo(e,"compositionstart",mc),lo(e,"compositionend",oa),lo(e,"change",oa))},mounted(e,{value:t,modifiers:{trim:s,number:r}}){let n=t??"",i=e[js];delete e[js],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[uo](Kn(e.value,s,r)):e.value=n},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:r,trim:n,number:i}},a){if(e[uo]=Ws(a),e.composing)return;let c=(i||e.type==="number")&&!/^0\d/.test(e.value)?wo(e.value):e.value,f=t??"";if(c===f)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(r&&t===s||n&&e.value.trim()===f)||(e.value=f)}};var Ys={deep:!0,created(e,{value:t,modifiers:{number:s}},r){e._modelValue=t,lo(e,"change",()=>{let n=Array.prototype.filter.call(e.options,f=>f.selected).map(f=>s?wo(Ks(f)):Ks(f)),i=e.multiple,a=i?zt(e._modelValue)?new Set(n):n:n[0],c=e._pendingValue=[i,i?ge(a)?n.slice():n:a];try{e[uo](a)}finally{ot(()=>{e._pendingValue===c&&(e._pendingValue=void 0)})}}),e[uo]=Ws(r)},mounted(e,{value:t}){sa(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[uo]=Ws(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!hc(t,s[1],s[0]))&&sa(e,t)}};function hc(e,t,s){if(!s)return Tt(e,t);if(ge(e))return Tt(e,t);if(zt(e)){if(e.size!==t.length)return!1;for(let r of t)if(!e.has(r))return!1;return!0}return!1}function sa(e,t){let s=e.multiple,r=ge(t);if(!(s&&!r&&!zt(t))){for(let n=0,i=e.options.length;n<i;n++){let a=e.options[n],c=Ks(a);if(s)if(r){let f=typeof c;f==="string"||f==="number"?a.selected=t.some(v=>String(v)===String(c)):a.selected=Cr(t,c)>-1}else a.selected=t.has(c);else if(Tt(Ks(a),t)){e.selectedIndex!==n&&(e.selectedIndex=n);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ks(e){return"_value"in e?e._value:e.value}var vc=["ctrl","shift","alt","meta"],gc={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)=>vc.some(s=>e[`${s}Key`]&&!t.includes(s))},pe=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),r=t.join(".");return s[r]||(s[r]=((n,...i)=>{for(let a=0;a<t.length;a++){let c=gc[t[a]];if(c&&c(n,t))return}return e(n,...i)}))},yc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Do=(e,t)=>{let s=e._withKeys||(e._withKeys={}),r=t.join(".");return s[r]||(s[r]=(n=>{if(!("key"in n))return;let i=Rt(n.key);if(t.some(a=>a===i||yc[a]===i))return e(n)}))},bc=je({patchProp:cc},Ju),na;function wc(){return na||(na=$i(bc))}var la=((...e)=>{let t=wc().createApp(...e),{mount:s}=t;return t.mount=r=>{let n=Ec(r);if(!n)return;let i=t._component;!be(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.nodeType===1&&(n.textContent="");let a=s(n,!1,kc(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t});function kc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ec(e){return Fe(e)?document.querySelector(e):e}var fo=typeof document<"u";function ua(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Cc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ua(e.default)}var Pe=Object.assign;function Js(e,t){let s={};for(let r in t){let n=t[r];s[r]=wt(n)?n.map(e):e(n)}return s}var To=()=>{},wt=Array.isArray;function Xn(e,t){let s={};for(let r in e)s[r]=r in t?t[r]:e[r];return s}var ca=/#/g,_c=/&/g,Sc=/\//g,Nc=/=/g,Dc=/\?/g,pa=/\+/g,Rc=/%5B/g,Tc=/%5D/g,fa=/%5E/g,Ac=/%60/g,ma=/%7B/g,Oc=/%7C/g,ha=/%7D/g,Ic=/%20/g;function Zn(e){return e==null?"":encodeURI(""+e).replace(Oc,"|").replace(Rc,"[").replace(Tc,"]")}function va(e){return Zn(e).replace(ma,"{").replace(ha,"}").replace(fa,"^")}function Jn(e){return Zn(e).replace(pa,"%2B").replace(Ic,"+").replace(ca,"%23").replace(_c,"%26").replace(Ac,"`").replace(ma,"{").replace(ha,"}").replace(fa,"^")}function Pc(e){return Jn(e).replace(Nc,"%3D")}function Vc(e){return Zn(e).replace(ca,"%23").replace(Dc,"%3F")}function ga(e){return Vc(e).replace(Sc,"%2F")}function Ro(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var qc=/\/$/,Mc=e=>e.replace(qc,"");function Qs(e,t,s="/"){let r,n={},i="",a="",c=t.indexOf("#"),f=t.indexOf("?");return f=c>=0&&f>c?-1:f,f>=0&&(r=t.slice(0,f),i=t.slice(f,c>0?c:t.length),n=e(i.slice(1))),c>=0&&(r=r||t.slice(0,c),a=t.slice(c,t.length)),r=$c(r??t,s),{fullPath:r+i+a,path:r,query:n,hash:Ro(a)}}function ya(e,t){let s=t.query?e(t.query):"";return t.path+(s&&"?")+s+(t.hash||"")}function xn(e,t){return!t||!e.toLowerCase().sLine truncated
"use strict";(()=>{var ud=Object.defineProperty;var cd=(e,t)=>{for(var s in t)ud(e,s,{get:t[s],enumerable:!0})};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 be={markdown:"/script/markdown.1d3b1ed22a.min.js",org:"/script/org.f61f262915.min.js",notebook:"/script/notebook.c3144c18ae.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};var ms=new Map,md=be;function en(e){if(!ms.has(e)){let t=document.createElement("script");t.src=md[e];let s=new Promise((r,o)=>{t.onload=r,t.onerror=()=>{ms.delete(e),t.remove(),o(new Error(`Unable to load ${e}. Please retry.`))}});ms.set(e,s),document.head.appendChild(t)}return ms.get(e)}async function hs(){await en("editor"),ace.config.set("basePath","/script/external/ace/")}function vn(e){let t=Object.create(null);for(let s of e.split(","))t[s]=1;return s=>s in t}var Me={},Zt=[],it=()=>{},uo=()=>!1,yn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),gn=e=>e.startsWith("onUpdate:"),je=Object.assign,In=(e,t)=>{let s=e.indexOf(t);s>-1&&e.splice(s,1)},hd=Object.prototype.hasOwnProperty,Ae=(e,t)=>hd.call(e,t),ke=Array.isArray,zt=e=>Pn(e)==="[object Map]",Ht=e=>Pn(e)==="[object Set]",yr=e=>Pn(e)==="[object Date]";var Ne=e=>typeof e=="function",Fe=e=>typeof e=="string",ft=e=>typeof e=="symbol",Pe=e=>e!==null&&typeof e=="object",co=e=>(Pe(e)||Ne(e))&&Ne(e.then)&&Ne(e.catch),kr=Object.prototype.toString,Pn=e=>kr.call(e),po=e=>Pn(e).slice(8,-1),vs=e=>Pn(e)==="[object Object]",ys=e=>Fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bn=vn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var gs=e=>{let t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},vd=/-\w/g,Ye=gs(e=>e.replace(vd,t=>t.slice(1).toUpperCase())),yd=/\B([A-Z])/g,Tt=gs(e=>e.replace(yd,"-$1").toLowerCase()),tn=gs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vn=gs(e=>e?`on${tn(e)}`:""),gt=(e,t)=>!Object.is(e,t),wn=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},bs=(e,t,s,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:s})},kn=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var gr,Mn=()=>gr||(gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Te(e){if(ke(e)){let t={};for(let s=0;s<e.length;s++){let r=e[s],o=Fe(r)?kd(r):Te(r);if(o)for(let i in o)t[i]=o[i]}return t}else if(Fe(e)||Pe(e))return e}var gd=/;(?![^(]*\))/g,bd=/:([^]+)/,wd=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function kd(e){let t={};return e.replace(wd,s=>s.startsWith("/*")?"":s).split(gd).forEach(s=>{if(s){let r=s.split(bd);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function T(e){let t="";if(Fe(e))t=e;else if(ke(e))for(let s=0;s<e.length;s++){let r=T(e[s]);r&&(t+=r+" ")}else if(Pe(e))for(let s in e)e[s]&&(t+=s+" ");return t.trim()}var Cr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",Er=vn(Cr),Cd=vn(Cr+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function ws(e){return!!e||e===""}function Ed(e,t,s){if(e.length!==t.length)return!1;let r=!0;for(let o=0;r&&o<e.length;o++)r=Ot(e[o],t[o],s);return r}function br(e,t,s){if(e.size!==t.size)return!1;let r=Array.from(t),o=new Uint8Array(r.length);for(let i of e){let a=-1;for(let c=0;c<r.length;c++)if(!o[c]&&Ot(i,r[c],s)){a=c;break}if(a<0)retLine truncated
`))),e[cn]=Ys(o);let i=r||o.props&&o.props.type==="number";un(e,t?"change":"input",a=>{a.target.composing||e[cn](Yo(e.value,s,i))}),(s||i)&&un(e,"change",()=>{e.value=Yo(e.value,s,i)}),t||(un(e,"compositionstart",mc),un(e,"compositionend",sa),un(e,"change",sa))},mounted(e,{value:t,modifiers:{trim:s,number:r}}){let o=t??"",i=e[Ws];delete e[Ws],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[cn](Yo(e.value,s,r)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:r,trim:o,number:i}},a){if(e[cn]=Ys(a),e.composing)return;let c=(i||e.type==="number")&&!/^0\d/.test(e.value)?kn(e.value):e.value,f=t??"";if(c===f)return;let g=e.getRootNode();(g instanceof Document||g instanceof ShadowRoot)&&g.activeElement===e&&e.type!=="range"&&(r&&t===s||o&&e.value.trim()===f)||(e.value=f)}};var Qs={deep:!0,created(e,{value:t,modifiers:{number:s}},r){e._modelValue=t,un(e,"change",()=>{let o=Array.prototype.filter.call(e.options,f=>f.selected).map(f=>s?kn(Js(f)):Js(f)),i=e.multiple,a=i?Ht(e._modelValue)?new Set(o):o:o[0],c=e._pendingValue=[i,i?ke(a)?o.slice():o:a];try{e[cn](a)}finally{Ze(()=>{e._pendingValue===c&&(e._pendingValue=void 0)})}}),e[cn]=Ys(r)},mounted(e,{value:t}){oa(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[cn]=Ys(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!hc(t,s[1],s[0]))&&oa(e,t)}};function hc(e,t,s){if(!s)return Ot(e,t);if(ke(e))return Ot(e,t);if(Ht(e)){if(e.size!==t.length)return!1;for(let r of t)if(!e.has(r))return!1;return!0}return!1}function oa(e,t){let s=e.multiple,r=ke(t);if(!(s&&!r&&!Ht(t))){for(let o=0,i=e.options.length;o<i;o++){let a=e.options[o],c=Js(a);if(s)if(r){let f=typeof c;f==="string"||f==="number"?a.selected=t.some(g=>String(g)===String(c)):a.selected=Sr(t,c)>-1}else a.selected=t.has(c);else if(Ot(Js(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Js(e){return"_value"in e?e._value:e.value}var vc=["ctrl","shift","alt","meta"],yc={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)=>vc.some(s=>e[`${s}Key`]&&!t.includes(s))},ue=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),r=t.join(".");return s[r]||(s[r]=((o,...i)=>{for(let a=0;a<t.length;a++){let c=yc[t[a]];if(c&&c(o,t))return}return e(o,...i)}))},gc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},yt=(e,t)=>{let s=e._withKeys||(e._withKeys={}),r=t.join(".");return s[r]||(s[r]=(o=>{if(!("key"in o))return;let i=Tt(o.key);if(t.some(a=>a===i||gc[a]===i))return e(o)}))},bc=je({patchProp:cc},Ju),ra;function wc(){return ra||(ra=Ui(bc))}var la=((...e)=>{let t=wc().createApp(...e),{mount:s}=t;return t.mount=r=>{let o=Cc(r);if(!o)return;let i=t._component;!Ne(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");let a=s(o,!1,kc(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function kc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Cc(e){return Fe(e)?document.querySelector(e):e}var mn=typeof document<"u";function ua(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ec(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ua(e.default)}var Ve=Object.assign;function Xs(e,t){let s={};for(let r in t){let o=t[r];s[r]=kt(o)?o.map(e):e(o)}return s}var Tn=()=>{},kt=Array.isArray;function Zo(e,t){let s={};for(let r in e)s[r]=r in t?t[r]:e[r];return s}var ca=/#/g,Sc=/&/g,Nc=/\//g,_c=/=/g,Dc=/\?/g,pa=/\+/g,Rc=/%5B/g,Tc=/%5D/g,fa=/%5E/g,Oc=/%60/g,ma=/%7B/g,Ac=/%7C/g,ha=/%7D/g,Ic=/%20/g;function xo(e){return e==null?"":encodeURI(""+e).replace(Ac,"|").replace(Rc,"[").replace(Tc,"]")}function va(e){return xo(e).replace(ma,"{").replace(ha,"}").replace(fa,"^")}function Qo(e){return xo(e).replace(pa,"%2B").replace(Ic,"+").replace(ca,"%23").replace(Sc,"%26").replace(Oc,"`").replace(ma,"{").replace(ha,"}").replace(fa,"^")}function Pc(e){return Qo(e).replace(_c,"%3D")}function Vc(e){return xo(e).replace(ca,"%23").replace(Dc,"%3F")}function ya(e){return Vc(e).replace(Nc,"%2F")}function Rn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var Mc=/\/$/,qc=e=>e.replace(Mc,"");function Zs(e,t,s="/"){let r,o={},i="",a="",c=t.indexOf("#"),f=t.indexOf("?");return f=c>=0&&f>c?-1:f,f>=0&&(r=t.slice(0,f),i=t.slice(f,c>0?c:t.length),o=e(i.slice(1))),c>=0&&(r=r||t.slice(0,c),a=t.slice(c,t.length)),r=$c(r??t,s),{fullPath:r+i+a,path:r,query:o,hash:Rn(a)}}function ga(e,t){let s=t.query?e(t.query):"";return t.path+(s&&"?")+s+(t.hash||"")}function er(e,t){return!t||!e.toLowerCase().sLine truncated
${JSON.stringify(e)}${t?`
while being at
`+JSON.stringify(t):""}`},[He.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Hc(t)}" via a navigation guard.`},[He.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[He.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[He.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function po(e,t){return Pe(new Error,{type:e,[Sa]:!0},t)}function Ut(e,t){return e instanceof Error&&Sa in e&&(t==null||!!(e.type&t))}var Bc=["params","query","hash"];function Hc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of Bc)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function Na(e){let t={};if(e===""||e==="?")return t;let s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<s.length;++r){let n=s[r].replace(pa," "),i=n.indexOf("="),a=Ro(i<0?n:n.slice(0,i)),c=i<0?null:Ro(n.slice(i+1));if(a in t){let f=t[a];wt(f)||(f=t[a]=[f]),f.push(c)}else t[a]=c}return t}function sr(e){let t="";for(let s in e){let r=e[s];if(s=Pc(s),r==null){r!==void 0&&(t+=(t.length?"&":"")+s);continue}(wt(r)?r.map(n=>n&&Jn(n)):[r&&Jn(r)]).forEach(n=>{n!==void 0&&(t+=(t.length?"&":"")+s,n!=null&&(t+="="+n))})}return t}function Da(e){let t={};for(let s in e){let r=e[s];r!==void 0&&(t[s]=wt(r)?r.map(n=>n==null?null:""+n):r==null?r:""+r)}return t}var Ra=Symbol(""),nr=Symbol(""),xs=Symbol(""),en=Symbol(""),tn=Symbol("");function Ao(){let e=[];function t(r){return e.push(r),()=>{let n=e.indexOf(r);n>-1&&e.splice(n,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function Yt(e,t,s,r,n,i=a=>a()){let a=r&&(r.enterCallbacks[n]=r.enterCallbacks[n]||[]);return()=>new Promise((c,f)=>{let v=m=>{m===!1?f(po(He.NAVIGATION_ABORTED,{from:s,to:t})):m instanceof Error?f(m):zc(m)?f(po(He.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&r.enterCallbacks[n]===a&&typeof m=="function"&&a.push(m),c())},y=i(()=>e.call(r&&r.instances[n],t,s,v)),E=Promise.resolve(y);e.length<3&&(E=E.then(v)),E.catch(m=>f(m))})}function on(e,t,s,r,n=i=>i()){let i=[];for(let a of e)for(let c in a.components){let f=a.components[c];if(!(t!=="beforeRouteEnter"&&!a.instances[c]))if(ua(f)){let v=(f.__vccOpts||f)[t];v&&i.push(Yt(v,s,r,a,c,n))}else{let v=f();i.push(()=>v.then(y=>{if(!y)throw new Error(`Couldn't resolve component "${c}" at "${a.path}"`);let E=Cc(y)?y.default:y;a.mods[c]=y,a.components[c]=E;let m=(E.__vccOpts||E)[t];return m&&Yt(m,s,r,a,c,n)()}))}}return i}function Ta(e,t){let s=[],r=[],n=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){let c=t.matched[a];c&&(e.matched.find(v=>co(v,c))?r.push(c):s.push(c));let f=e.matched[a];f&&(t.matched.find(v=>co(v,f))||n.push(f))}return[s,r,n]}var jc=()=>location.protocol+"//"+location.host;function Fa(e,t){let{pathname:s,search:r,hash:n}=t,i=e.indexOf("#");if(i>-1){let a=n.includes(e.slice(i))?e.slice(i).length:1,c=n.slice(a);return c[0]!=="/"&&(c="/"+c),xn(c,"")}return xn(s,e)+r+n}function Gc(e,t,s,r){let n=[],i=[],a=null,c=({state:m})=>{let C=Fa(e,location),g=s.value,w=t.value,R=0;if(m){if(s.value=C,t.value=m,a&&a===g){a=null;return}R=w?m.position-w.position:0}else r(C);n.forEach(D=>{D(s.value,g,{delta:R,type:Xs.pop,direction:R?R>0?Zs.forward:Zs.back:Zs.unknown})})};function f(){a=s.value}function v(m){n.push(m);let C=()=>{let g=n.indexOf(m);g>-1&&n.splice(g,1)};return i.push(C),C}function y(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Pe({},m.state,{scroll:cs()}),"")}}function E(){for(let m of i)m();i=[],window.removeEventListener("popstate",c),window.removeEventListener("pagehide",y),document.removeEventListener("visibilitychange",y)}return window.addEventListener("popstate",c),window.addEventListener("pagehide",y),document.addEventListener("visibilitychange",y),{pauseListeners:f,listen:v,destroy:E}}function Aa(e,t,s,r=!1,n=!1){return{back:e,current:t,forward:s,replaced:r,position:window.history.length,scroll:n?cs():null}}function Wc(e){let{history:t,location:s}=window,r={value:Fa(e,s)},n={value:t.state};n.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(f,v,y){let E=e.indexOf("#"),m=E>-1?(s.host&&document.querySelector("base")?e:e.slice(E))+f:jc()+e+f;try{t[y?"replaceState":"pushState"](v,"",m),n.value=v}catch(C){console.error(C),s[y?"replace":"assign"](m)}}function a(f,v){i(f,Pe({},t.state,Aa(n.value.back,f,n.value.forward,!0),v,{position:n.value.position}),!0),r.value=f}function c(f,v){let y=Pe({},n.value,t.state,{forward:f,scroll:cs()});i(y.current,y,!0),i(f,Pe({},Aa(r.value,f,null),{position:y.position+1},v),!1),r.value=f}return{location:r,state:n,push:c,replace:a}}function za(e){e=wa(e);let t=Wc(e),s=Gc(e,t.state,t.location,t.replace);function r(i,a=!0){a||s.pauseListeners(),history.go(i)}let n=Pe({locatLine truncated
`)),e.options=Object.assign({},e.options,v.options),i.restore()})}a();let c=null;e.saveDefault=f=>{if(f&&f.preventDefault&&f.preventDefault(),e.saving)return;let v=i.checkpoint(),y={terms:e.terms.split(`
`).map(E=>E.trim()).filter(E=>E.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",y).then(()=>{i.accept(v),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",c&&r.cancel(c),c=r(()=>{e.message=null},2500)},E=>{e.saving=!1;let C="ERRORS."+(E&&E.data&&E.data.error);s(C).then(g=>{e.error=g&&g!==C?g:"Unable to save your defaults. Please try again."},()=>{e.error="Unable to save your defaults. Please try again."})})},e.deleteAccount=()=>{confirm("Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone.")&&(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},Qa=function(e,t,s){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{s.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Xa=function(e,t,s,r,n){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(c){e.feature=c},e.featureHref=function(c){return c.needsUser&&!e.user?"/signin":c.href},e.featureTarget=function(c){return c.needsUser&&!e.user?"_self":c.target||void 0},e.featureKeydown=function(c,f){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[c.key];if(v===void 0)return;c.preventDefault();let y=e.features.length,E=v==="first"?0:v==="last"?y-1:(f+v+y)%y;e.feature=e.features[E].key,n(()=>{let m=r.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},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"}];function i(){t.get("/api/stat/").then(c=>{e.stat=c.data,e.cards[0].total=c.data.nbRepositories,e.cards[1].total=c.data.nbUsers,e.cards[2].total=c.data.nbPageViews,e.cards[3].total=c.data.nbPullRequests})}i();function a(c){let f={series:c,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!c||c.length<2)return f;let v=new Array(c.length-1);for(let w=1;w<c.length;w++)v[w-1]=c[w]-c[w-1];let y=v.length,E=Math.max.apply(null,v),m=Math.min.apply(null,v),C=Math.min(0,m),g=E-C||1;f.viewW=y*2,f.bars=new Array(y);for(let w=0;w<y;w++){let R=(v[w]-C)/g,D=Math.max(1.5,R*34);f.bars[w]={x:(w*2+.25).toFixed(2),y:(36-D).toFixed(2),w:"1.5",h:D.toFixed(2)}}if(f.deltaToday=v[y-1],y>=2){let w=v[y-2];w&&(f.pctChange=(f.deltaToday-w)/w*100)}return f.pctAbs=Math.round(Math.abs(f.pctChange)),f.isUp=f.pctChange>=0,f}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(c=>{let f=c.data||[];e.history={repositories:a(f.map(v=>v.nbRepositories||0)),users:a(f.map(v=>v.nbUsers||0)),pageViews:a(f.map(v=>v.nbPageViews||0)),pullRequests:a(f.map(v=>v.nbPullRequests||0))}})},Za=function(e,t,s,r,n,i){let a=ut();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,ot(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Qt()(document,"click",S=>{e.quotaExpanded&&!S.target.closest?.(".dashboard-quota")&& Line truncated
`)),e.options=Object.assign({},e.options,H.options),e.options.expirationDate=H.options&&H.options.expirationDate?new Date(H.options.expirationDate):T(),!r.repoId&&!r.pullRequestId&&!r.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),_&&_()})}function q(_,V,H){e.anonymize&&e.anonymize[_]&&e.anonymize[_].setValidity(V,H)}function ie(_){try{let V=parseGithubUrl(_);if(V&&V.owner&&V.repo)return V.owner+"/"+V.repo}catch{}return null}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 te()}catch{}}};function ae(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:ie(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function S(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function B(){let _;try{_=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!_||_.path!==n.path()||Date.now()-_.savedAt>=30*6e4)return R.restore()?(e.sourceUrl&&await S(),!0):!1;R.restore();for(let V of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(_.draft,V)&&(e[V]=_.draft[V]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await S(),sessionStorage.removeItem("github-access-draft"),!0}P(()=>{!r.repoId&&!r.pullRequestId&&!r.gistId&&a(B,0),r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async _=>{e.githubConnection=_.data.connection||"oauth",e.sourceUrl="https://github.com/"+_.data.source.fullName,e._originalFullName=_.data.source.fullName,e.terms=_.data.options.terms.filter(V=>V).join(`
`),e.source=_.data.source,e.role=_.data.role||"owner",e.coauthors=_.data.coauthors||[],e._originalBranch=_.data.source.branch,e.options=Object.assign({},e.options,_.data.options),e.conference=_.data.conference,e._originalConference=_.data.conference,e.repositoryID=_.data.source.repositoryID,e._originalRepositoryID=_.data.source.repositoryID,_.data.options.expirationDate&&(e.options.expirationDate=new Date(_.data.options.expirationDate)),g=w(parseGithubUrl(e.sourceUrl)),!await B()&&(await Promise.all([te(),fe()]),ee())},()=>{n.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async _=>{if(e.githubConnection=_.data.connection||"oauth",e.sourceUrl="https://github.com/"+_.data.source.repositoryFullName+"/pull/"+_.data.source.pullRequestId,e.terms=_.data.options.terms.filter(V=>V).join(`
`),e.source=_.data.source,e.options=Object.assign({},e.options,_.data.options),e.conference=_.data.conference,e._originalConference=_.data.conference,_.data.options.expirationDate&&(e.options.expirationDate=new Date(_.data.options.expirationDate)),g=w(parseGithubUrl(e.sourceUrl)),!await B())try{await oe()}catch{}},()=>{n.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async _=>{e.sourceUrl="https://gist.github.com/"+_.data.source.gistId,e.terms=_.data.options.terms.filter(V=>V).join(`
`),e.source=_.data.source,e.options=Object.assign({},e.options,_.data.options),e.conference=_.data.conference,e._originalConference=_.data.conference,_.data.options.expirationDate&&(e.options.expirationDate=new Date(_.data.options.expirationDate)),g=w(parseGithubUrl(e.sourceUrl)),!await B()&&await Oe()},()=>{n.url("/404")}))}),t.get("/github/connections").then(_=>{e.githubConnections=_.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&_.data.appEnabled&&_.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&S())}).catch(()=>{}),e.urlSelected=async(_=!1)=>{let V=++f,H;try{H=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,Q.cancel(),Ce.cancel(),Ne.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",q("sourceUrl","github",!1);return}let h=w(H),k=_||g===h;g=h,e.sourceUrlError="",q("sourceUrl","github",!0);let O=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,O&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!k&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],k||(e.source={type:"GitHubStream",branch:"",commit:""}),Q.cancel(),Ce.cancel(),Ne.cancel(),le.clear(),Se.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=k;try{H.gistId&&!H.repo?(e.detectedType="gist",e.source={gistId:H.gistId},await Oe()):H.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:H.owner+"/"+H.repo,pullRequestId:H.pullRequestId},await oe()):(e.detectedType="repo",await Promise.all([te(),fe()]),ee())}catch{}finally{V===f&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let _=e.branches.filter(H=>H.name==e.source.branch)[0];if(!_)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=_.commit),e.readme=_.readme,await fe(),ee()}),e.getBranches=async _=>{let V=parseGithubUrl(e.sourceUrl),H=m();try{let h=await t.get(`/api/repo/${V.owner}/${V.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&ie(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:_===!0||e.reconnectingSource?"1":"0",repositoryID:ae()}});if(!E(H))return;e.branches=h.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let k=e.branches.filter(O=>O.name==e.source.branch);k.length>0&&(!(!e.reconnectingSource&&!_&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=k[0].commit),e.readme=k[0].readme,await fe(_))}catch(h){if(!E(H))return;e.branches=[],e.sourceUnreachable=h&&(h.status===404||h.data&&h.data.error==="repo_not_found");let k=h&&h.data&&h.data.error||(h&&h.status===404?"repo_not_found":"unknown_error");i("ERRORS."+k).then(O=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:O}),e.error=O},console.error),typeof q=="function"&&q("sourceUrl","missing",!1)}finally{C(H)}};async function te(){let _=parseGithubUrl(e.sourceUrl),V=m();try{U();let H=await t.get(`/api/repo/${_.owner}/${_.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&ie(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:ae(),force:"1"}});if(!E(V))return;e.details=H.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(H){if(!E(V))return;throw H.data&&(i("ERRORS."+H.data.error).then(h=>{e.addToast({title:"Error",date:new Date,body:h}),e.error=h},console.error),x(H.data.error)),q("sourceUrl","missing",!1),H}finally{C(V)}}async function fe(_){if(e.readme&&!_)return e.readme;let V=parseGithubUrl(e.sourceUrl),H=m();try{let h=await t.get(`/api/repo/${V.owner}/${V.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&ie(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:_===!0?"1":"0",branch:e.source.branch,repositoryID:ae()}});E(H,!0)&&(e.readme=h.data)}catch{E(H,!0)&&(e.readme="")}finally{C(H)}}function J(){let _={terms:e.terms?e.terms.split(`
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(_.branchName=e.source.branch);try{let V=parseGithubUrl(e.sourceUrl);_.repoName=`${V.owner}/${V.repo}`}catch{}return _}function X(_,V,H){let h=null,k=0,O=()=>{if(e.detectedType!==_)return;h&&a.cancel(h);let F=++k;e.previewStatus="loading",h=a(()=>{h=null;let M=V();if(!M){e.previewStatus="idle";return}t.post("/api/anonymize-preview",M).then(j=>{F===k&&(H(j.data,M),e.previewStatus="ready")}).catch(()=>{F===k&&(e.previewStatus="error")})},200)};return O.cancel=()=>{k++,h&&a.cancel(h),h=null},e.on("dispose",O.cancel),O}e.retryPreview=()=>{e.detectedType==="repo"&&Q(),e.detectedType==="pr"&&Ce(),e.detectedType==="gist"&&Ne()};let Q=X("repo",()=>e.readme?{content:e.readme,options:J()}:null,_=>{if(typeof _?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=_.content;let V="";try{let h=parseGithubUrl(e.sourceUrl),k=e.source.branch||e.details&&e.details.defaultBranch||"main";V=`https://github.com/${h.owner}/${h.repo}/raw/${k}/`}catch{}let H=renderMD(e.anonymize_readme,V);e.html_readme=H,a(Prism.highlightAll,150)});function ee(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),Q())}async function oe(){let _=parseGithubUrl(e.sourceUrl),V=m();try{U();let H=await t.get(`/api/pr/${_.owner}/${_.repo}/${_.pullRequestId}`,{params:{connection:e.githubConnection}});if(!E(V))return;e.details=H.data,e.pullRequestId||(e.pullRequestId=_.repo+"-PR"+_.pullRequestId+"-"+generateRandomId(4))}catch(H){if(!E(V))return;throw H.data&&(i("ERRORS."+H.data.error).then(h=>{e.addToast({title:"Error",date:new Date,body:h}),e.error=h},console.error),x(H.data.error)),q("sourceUrl","missing",!1),H}finally{C(V)}}let le=ze(new Map);function ke(){let _=new Set,V=e.details&&e.details.pullRequest;if(!V)return _;typeof V.title=="string"&&_.add(V.title),typeof V.body=="string"&&_.add(V.body),typeof V.diff=="string"&&_.add(V.diff);let H=V.comments||[];for(let h of H)typeof h.author=="string"&&_.add(h.author),typeof h.body=="string"&&_.add(h.body);return _}let Ce=X("pr",()=>{let _=ke(),V=Array.from(_);return V.length===0?null:{contents:V,options:J()}},(_,V)=>{if(!Array.isArray(_?.contents)||_.contents.length!==V.contents.length||_.contents.some(k=>typeof k!="string"))throw Error("Invalid preview response");let H=V.contents,h=new Map;for(let k=0;k<H.length&&k<_.contents.length;k++)h.set(H[k],_.contents[k]);le.clear(),h.forEach((k,O)=>le.set(O,k))});e.anonymizePrContent=function(_){return _&&(le.has(_)?le.get(_):"")};async function Oe(){let _=parseGithubUrl(e.sourceUrl),V=m();try{U(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let H=await t.get(`/api/gist/source/${_.gistId}`);if(!E(V))return;e.details=H.data,e.gistId||(e.gistId="gist-"+_.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(H){if(!E(V))return;if(H.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,q("sourceUrl","missing",!1);return}if(H.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,q("sourceUrl","missing",!1);return}throw H.data&&(i("ERRORS."+H.data.error).then(h=>{e.addToast({title:"Error",date:new Date,body:h}),e.error=h},console.error),x(H.data.error)),q("sourceUrl","missing",!1),H}finally{C(V)}}let Se=ze(new Map);function Ve(){let _=new Set,V=e.details&&e.details.gist;if(!V)return _;typeof V.description=="string"&&_.add(V.description),typeof V.ownerLogin=="string"&&_.add(V.ownerLogin);let H=V.files||[];for(let k of H)typeof k.filename=="string"&&_.add(k.filename),typeof k.content=="string"&&_.add(k.content);let h=V.comments||[];for(let k of h)typeof k.author=="string"&&_.add(k.author),typeof k.body=="string"&&_.add(k.body);return _}let Ne=X("gist",()=>{let _=Ve(),V=Array.from(_);return V.length===0?null:{contents:V,options:J()}},(_,V)=>{if(!Array.isArray(_?.contents)||_.contents.length!==V.contents.length||_.contents.some(k=>typeof k!="string"))throw Error("Invalid preview response");let H=V.contents,h=new Map;for(let k=0;k<H.length&&k<_.contents.length;k++)h.set(H[k],_.contents[k]);Se.clear(),h.forEach((k,O)=>Se.set(O,k)),De()});e.anonymizeGistContent=function(_){return _&&(Se.has(_)?Se.get(_):"")},e.previewGistFiles=[];function De(){let _=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=_.map(V=>({filename:e.anonymizeGistContent(V.filename),content:e.anonymizeGistContent(V.content),language:V.language}))}e.watch("details.gist.files",De,!0),e.watch("terms",De);function Ie(){let _=e.conference;if(e.conference_data=null,!_)return;let V=e.isUpdate&&_===e._originalConference;t.get("/api/conferences/"+_).then(H=>{e.conference===_&&(e.conference_data=H.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!V&&(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_ Line truncated
`).filter(O=>O),connection:e.githubConnection,fullName:`${H.owner}/${H.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(h.options.pageSource=e.details.pageSource),U();let k=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(k,h,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/status/"+e.repoId},O=>{O.data&&(i("ERRORS."+O.data.error).then(F=>{e.error=F},console.error),x(O.data.error))}).finally(()=>{V.disabled=!1})},e.anonymizeGist=_=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ne())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let V=_.currentTarget||_.target.closest?.("button")||_.target;V.disabled=!0;let H=parseGithubUrl(e.sourceUrl),h={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(O=>O),source:{gistId:H.gistId},options:e.options,conference:e.conference};U();let k=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(k,h,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/gist/"+e.gistId},O=>{O.data&&(i("ERRORS."+O.data.error).then(F=>{e.error=F},console.error),x(O.data.error))}).finally(()=>{V.disabled=!1})},e.anonymizePullRequest=_=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ne())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let V=_.currentTarget||_.target.closest?.("button")||_.target;V.disabled=!0;let H=parseGithubUrl(e.sourceUrl),h={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
`).filter(O=>O),source:{repositoryFullName:`${H.owner}/${H.repo}`,pullRequestId:H.pullRequestId},options:e.options,conference:e.conference};U();let k=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(k,h,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/pr/"+e.pullRequestId},O=>{O.data&&(i("ERRORS."+O.data.error).then(F=>{e.error=F},console.error),x(O.data.error))}).finally(()=>{V.disabled=!1})},e.watch("conference",()=>{Ie()}),e.watch("terms",()=>{e.detectedType==="repo"&&ee(),e.detectedType==="pr"&&Ce(),e.detectedType==="gist"&&Ne()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ee(),e.detectedType==="pr"&&Ce(),e.detectedType==="gist"&&Ne()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ee(),e.detectedType==="pr"&&Ce(),e.detectedType==="gist"&&Ne()}),e.watch("details",()=>{e.detectedType==="pr"&&Ce(),e.detectedType==="gist"&&Ne()},!0)},dr=function(e,t,s,r,n,i){let a=ut(),c=Qt();e.on("dark-mode",(J,X)=>{e.aceOption&&(X?e.aceOption.theme="nord_dark":e.aceOption.theme="chrome")});let f=0,v=null,y=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function E(){v&&(v.resolve(),v=null),y&&(a.timeout.cancel(y),y=null)}let m=!1;e.on("dispose",()=>{m=!0,f++,E(),C&&C.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,c(document,"keydown",function(J){if((J.metaKey||J.ctrlKey)&&J.key==="k"){J.preventDefault();var X=document.querySelector(".tree-search-input");X&&(X.focus(),X.select())}});var C=null;e.onFileSearchChange=function(){C&&(C.resolve(),C=null);let J=e.fileSearchQuery;if(!J||J.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let X=i.defer();C=X,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(J)}`,{timeout:X.promise}).then(function(Q){if(!(m||C!==X)){C=null,e.fileSearchLoading=!1;var ee={};e.files.forEach(function(_){ee[(_.path||"")+"/"+_.name]=!0});for(var oe=[],le={},ke=0;ke<Q.data.length;ke++){var Ce=Q.data[ke];if(Ce.path)for(var Oe=Ce.path.split("/"),Se="",Ve=0;Ve<Oe.length;Ve++){var Ne=Se;Se=Se?Se+"/"+Oe[Ve]:Oe[Ve];var De=Ne+"/"+Oe[Ve];!ee[De]&&!le[De]&&(le[De]=!0,oe.push({name:Oe[Ve],path:Ne}))}}oe.sort(function(_,V){return(_.path||"").split("/").length-(V.path||"").split("/").length}),oe.length>0&&e.files.push.apply(e.files,oe);for(var Ie=[],U=0;U<Q.data.length;U++){var ne=Q.data[U],x=(ne.path||"")+"/"+ne.name;!ee[x]&&ne.size!=null&&(Ie.push(ne),ee[x]=!0)}Ie.length>0&&e.files.push.apply(e.files,Ie),e.fileSearchResults=Q.data}},function(){!m&&C===X&&(C=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let g={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},w=["license","txt"],R=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],D=["wav","mp3","ogg","wma","flac","aac","m4a"],T=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(J,X){if(e.repoId!=r.repoId)return fe();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(Q=>Q&&Q.trim().length>0),te();for(let Q=0;Q<e.paths.length-1;Q++){let ee=Q>0?e.paths.slice(0,Q).join("/"):"";e.files.some(le=>le.path===ee)||e.getFiles(ee)}}});function I(){if(e.paths[0]!="")return;let J=["readme.md","readme.txt","readme.org","readme.1st","readme"],X={};for(let ee of e.files)ee.name.toLowerCase().indexOf("readme")>-1&&(X[ee.name.toLowerCase()]=ee.name);let Q=null;for(let ee of J)if(X[ee]){Q=ee;break}if(!Q&&Object.keys(X).length>0&&(Q=Object.keys(X)[0]),Q){let ee=s.url();ee[ee.length-1]!="/"&&(ee+="/"),s.url(ee+encodePathForUrl(X[Q]))}}e.fileCounts=null,e.getFiles=function(J,X=!1){let Q=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(J)}&v=${e.options.lastUpdateDate}`).then(function(ee){if(m||Q!==e.repoId)return[];let oe=J||"";return e.files=e.files.filter(le=>le.path!==oe),e.files.push(...ee.data),ee.data},function(ee){if(m||Q!==e.repoId)return[];X||(e.type="error",e.content=lr(ee),e.files=[])})};function z(){let J=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(X){m||J!==e.repoId||(e.fileCounts=X.data)},function(){e.fileCounts={}})}function P(){return e.files.filter(J=>J.name==e.paths[e.paths.length-1]&&J.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var q=null;e.on("dispose",function(){q&&a.interval.cancel(q)});function ie(J){if(m)return;let X=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(Q=>{if(!(m||X!==e.repoId)){if(e.options=Q.data,e.options.url){window.location=e.options.url;return}J&&J(Q.data)}},Q=>{if(!(m||X!==e.repoId)){var ee=Q.data||{};if(ee.error==="rate_limited"&&ee.resetAt){let le=function(){var ke=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(ke<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,q&&(a.interval.cancel(q),q=null),ie(J);else{var Ce=Math.floor(ke/60),Oe=ke%60;e.rateLimitCoun Line truncated
`+w.join(`
`)],{type:"text/csv"}),D=document.createElement("a");D.href=URL.createObjectURL(R),D.download=r.username+"-repositories.csv",D.click()},e.showStatusMessage=m=>{let C=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,C)},e.fetchGithubInfo=m=>{let C=window.open("","_blank");C&&C.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(g=>{C&&(C.document.open(),C.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(g.data,null,2).replace(/[<>]/g,w=>w==="<"?"&lt;":"&gt;")+"</pre>"),C.document.close())},g=>{let w=g&&g.data?JSON.stringify(g.data,null,2):String(g);C&&(C.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+w+"</pre>")})};function f(m){t.get("/api/admin/users/"+m+"/repos",{}).then(C=>{e.repositories=C.data},C=>{console.error(C)})}function v(m){t.get("/api/admin/users/"+m,{}).then(C=>{e.userInfo=C.data},C=>{console.error(C)})}v(r.username),f(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>v(r.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>v(r.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>v(r.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>v(r.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function y(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}y(),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="",y()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>y(),C=>console.error(C))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>f(r.username),C=>console.error(C))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>f(r.username),C=>console.error(C))},e.updateRepository=m=>{let C=ze({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(C),t.post(`/api/repo/${m.repoId}/refresh`).then(g=>{g.data.status=="ready"?C.title=`${m.repoId} is refreshed.`:C.title=`Refreshing of ${m.repoId}.`},g=>{C.title=`Error during the refresh of ${m.repoId}.`,C.body=g.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(C=>{e.userInfo.repositories=C.data})};let E=null;e.watch("query",()=>{n.timeout.cancel(E),E=n.timeout(()=>{f(r.username)},500)},!0)},dl=function(e,t,s){let r=ut(),n=Qt();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 i=g=>{if(g.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){g.preventDefault();let w=document.querySelector('.admin-filter-toolbar input[type="search"]');w&&w.focus()}};n(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=g=>{g==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[g]="",e.query.page=1},e.chips=[];let a=()=>{let g=[];(e.query.dateFrom||e.query.dateTo)&&g.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=g};e.statusCountFor=g=>{let w=(e.statusCounts||[]).find(R=>R._id===g);return w?w.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=g=>{e.query.sort===g?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=g,e.query.direction="desc"),e.query.page=1},e.sortIcon=g=>e.query.sort===g?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let c="admin.conferences.filterPrefs",f={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},v=loadFilterPrefs(c)||{};e.query=Object.assign({},f,v,{page:1,search:""});let y=s.search();y.search&&(e.query.search=y.search);let E="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(E)||"[]"),e.savePreset=()=>{let g=window.prompt("Preset name:");if(!g)return;let w=Object.assign({},e.query);delete w.page,e.presets=(e.presets||[]).filter(R=>R.name!==g),e.presets.push({name:g,query:w}),localStorage.setItem(E,JSON.stringify(e.presets))},e.applyPreset=g=>{Object.assign(e.query,g.query,{page:1})},e.deletePreset=g=>{e.presets=(e.presets||[]).filter(w=>w.name!==g.name),localStorage.setItem(E,JS Line truncated
`).map((ee,oe)=>oe===0?ee:Q+ee).join(`
`)}else typeof S=="number"||typeof S=="boolean"?X=String(S):X=JSON.stringify(S);ie.push(`${fe}${X}${J}`)}),ie.push("}"),ie.join(`
`)}function v(D){let T=[],I="",z=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,P=0,q;for(;q=z.exec(D);)I+=D.slice(P,q.index),P=z.lastIndex,T.push({key:q[1],op:q[2]||"=",val:q[3]});return I+=D.slice(P),{filters:T,free:I.trim().toLowerCase()}}function y(D,T){for(let I of T.filters){let z=(q,ie,ae)=>{let S=parseFloat(q),B=parseFloat(ie);return ae==="="?String(q)===String(ie):ae==="!="?String(q)!==String(ie):ae===">="?S>=B:ae==="<="?S<=B:ae===">"?S>B:ae==="<"?S<B:!0},P;if(I.key==="code")P=D.displayMessage;else if(I.key==="module")P=D.module;else if(I.key==="status")P=D._status;else if(I.key==="url")P=D._url;else if(I.key==="repo")P=D._repoId;else if(I.key==="level")P=D.level;else continue;if(P==null||!z(P,I.val,I.op))return!1}return!(T.free&&((D.displayMessage||"")+" "+(D.module||"")+" "+(D._url||"")+" "+JSON.stringify(D.raw||[])).toLowerCase().indexOf(T.free)===-1)}function E(){let D=v(e.query.search||"");e.parsedFilterCount=D.filters.length;let T=e.query.bucket,I=e.entries.filter(P=>T&&P._bucket!==T?!1:y(P,D)),z=e.query.group;if(z){let P=ae=>z==="module"?ae.module:ae.displayMessage||ae.message||"_",q=new Map;for(let ae of I){let S=P(ae);if(q.has(S)){let B=q.get(S);B.count++,B._related.push(ae),new Date(ae.ts)>new Date(B.ts)&&(B.ts=ae.ts,B._url=ae._url,B._status=ae._status),new Date(ae.ts)<new Date(B._firstSeen)&&(B._firstSeen=ae.ts)}else{let B=Object.assign({},ae);B._key=`${z}:${S}`,B._related=[ae],B._firstSeen=ae.ts,B._lastHourCount=0,B.count=1,q.set(S,B)}}let ie=Date.now()-3600*1e3;for(let ae of q.values())ae._lastHourCount=ae._related.filter(S=>new Date(S.ts).getTime()>=ie).length;I=Array.from(q.values())}else I=I.map((P,q)=>(P._key="row:"+q+":"+P.ts,P._related=[P],P._firstSeen=P.ts,P._lastHourCount=0,P.count=1,P));e.query.sort==="count"?I.sort((P,q)=>q.count-P.count||new Date(q.ts)-new Date(P.ts)):I.sort((P,q)=>new Date(q.ts)-new Date(P.ts)),e.visible=I}function m(D){let T=D?e.entries.length:0,I=D?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:T,limit:I}}).then(z=>{let P=(z.data.entries||[]).map(c);e.entries=D?e.entries.concat(P):P,e.available=!!z.data.available,e.cap=z.data.max||e.cap,e.total=z.data.total||e.entries.length,E()},z=>console.error(z))}e.loadMore=()=>m(!0),e.canLoadMore=()=>e.entries.length<e.total;function C(){t.get("/api/admin/errors/stats").then(D=>{let T=D.data||{},I=T.prev24h?Math.round((T.last24h-T.prev24h)/T.prev24h*100):0;e.stats={last24h:T.last24h||0,prev24h:T.prev24h||0,delta:I,severity:T.severity||{error:0,warn:0,info:0},unique:T.unique||{error:0,warn:0,info:0},buckets:T.buckets||[],dropped:T.dropped||0}},D=>console.error(D))}function g(){m(),C()}e.barPx=(D,T)=>{let I=e.stats.buckets||[],z=0;for(let ae of I)z=Math.max(z,(ae.error||0)+(ae.warn||0)+(ae.info||0));if(!z)return 0;let P=(D.error||0)+(D.warn||0)+(D.info||0);if(!P)return 0;let q=Math.round(P/z*60),ie=D[T]||0;return Math.round(ie/P*q)},e.bucketTitle=D=>`${new Date(D.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${D.error||0} err \xB7 ${D.warn||0} warn \xB7 ${D.info||0} info`,e.toggle=D=>{e.expanded[D._key]=!e.expanded[D._key]},e.setBucket=D=>{e.query.bucket=D},e.refreshNow=g,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(g,D=>console.error(D))},e.exportCsv=()=>{let D=["ts","level","module","displayMessage","_status","_url","_repoId"],T=[D.join(",")];for(let q of e.visible)T.push(D.map(ie=>{let ae=q[ie]==null?"":String(q[ie]);return/[",\n]/.test(ae)?`"${ae.replace(/"/g,'""')}"`:ae}).join(","));let I=new Blob([T.join(`
`)],{type:"text/csv;charset=utf-8"}),z=URL.createObjectURL(I),P=document.createElement("a");P.href=z,P.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL(z)};function w(D){e.copyHint=`${D} copied`,n.timeout(()=>{e.copyHint=""},1500)}e.copyJson=D=>{navigator.clipboard.writeText(D._detailJson).then(()=>w("JSON"))},e.copyCurl=D=>{if(!D._url)return;let I=`curl -X ${D._method||"GET"} '${window.location.origin}${D._url}'`;navigator.clipboard.writeText(I).then(()=>w("curl"))},g();let R=r(()=>{e.query.autoRefresh&&g()},15e3);e.on("dispose",()=>r.cancel(R)),e.watch("query.search",E),e.watch("query.bucket",E),e.watch("query.sort",E),e.watch("query.group",E)},pl=function(e,t,s,r){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";var n=!1;e.loadCache=function(){if(!n){n=!0;var g=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:g}}).then(function(w){g===e.cacheMinutes&&(e.cacheReport=w.data,e.cacheError=w.data.available?null:w.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){n=!1,g!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(g){return e.cacheTraffic==="all"||g.traffic===e.cacheTraffic})},e.cacheRate=function(g,w){var R=e.cacheRows(),D=function(z){return R.filter(function(P){return P.name===z}).reduce(function(P,q){return P+q[w]},0)},T=D(g+"_hit"),I=D(g+"_miss");return T+I?(100*T/(T+I)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(g){return g.replaceAll("_"," ")},e.cacheP95=function(g){var w=0,R=e.cacheReport?.latencyBucketsMs||[];if(!g.count)return"No samples";if(!g.ms)return"Not timed";for(var D=0;D<=R.length;D++)if(w+=g["b"+D]||0,w>=Math.ceil(g.count*.95))return D<R.length?"\u2264 "+R[D]+" ms":"> 10 s";return"No samples"},e.performanceError=null,e.latencyBound=function(g,w){return g.count?g[w]==null?"> 60 s":"\u2264 "+g[w]+" ms":"No samples"},e.firstByteBound=function(g){return e.latencyBound({count:g.firstByteCount,p95UpperMs:g.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(g){return Math.max(0,Math.round((Date.now()-g.sampledAt)/1e3))},e.peakRss=function(g){return(e.performance.runtimeSeries||[]).filter(function(w){return w.instance===g.instance}).reduce(function(w,R){return Math.max(w,R.rss)},g.memory.rss)},e.performanceWarning=function(g){return e.sampleAge(g)>45||g.droppedBatches||g.droppedMetrics||g.sockets?.closeWait>0||g.eventLoop?.p95Ms>100||g.memoryLimitBytes&&g.memory.rss>g.memoryLimitBytes*.8};var i=!1;e.loadPerformance=function(){var g=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==g&&(e.performance=null),!i&&(i=!0,t.get("/api/admin/performance",{params:{minutes:g}}).then(function(w){g===e.performanceMinutes&&(e.performance=w.data,e.performanceError=w.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){g===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){i=!1,g!==e.performanceMinutes&&e.loadPerformance()}))};function a(g){if(g==null)return"\u2014";for(var w=["B","KB","MB","GB","TB"],R=0,D=g;D>=1024&&R<w.length-1;)D/=1024,R++;return D.toFixed(R>0?1:0)+" "+w[R]}e.humanBytes=a;function c(g){if(!g)return"\u2014";var w=Math.floor(g/86400),R=Math.floor(g%86400/3600),D=Math.floor(g%3600/60);return w>0?w+"d "+(R<10?"0":"")+R+"h":R>0?R+"h "+(D<10?"0":"")+D+"m":D+"m"}e.humanDuration=c;function f(g){return g==null?"\u2014":g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"K":String(g)}e.humanNum=f,e.queueTotal=function(g){return g?(g.waiting||0)+(g.active||0)+(g.delayed||0)+(g.failed||0):0},e.statusCount=function(g){if(!e.data||!e.data.repos)return 0;for(var w=e.data.repos.statusBreakdown||[],R=0;R<w.length;R++)if(w[R]._id===g)return w[R].count;return 0},e.barPct=function(g){var w=e.data&&e.data.repos?e.data.repos.total:0;if(!w)return 0;var R=[g];g==="expired"&&R.push("expiring"),g==="removed"&&R.push("removing"),g==="preparing"&&R.push("download");var D=0;return R.forEach(function(T){D+=e.statusCount(T)}),Math.max(.4,D/w*100)},e.errPct=function(g){if(!e.data||!e.data.errors)return 0;var w=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[g]/w*100};function v(g){var w=g||[];return w.map(function(R,D){var T=w[D-1]||{},I=Object.assign({},R);return I.dailyRepositories=D?Math.max(0,(R.nbRepositories||0)-(T.nbRepositories||0)):0,I.dailyUsers=D?Math.max(0,(R.nbUsers||0)-(T.nbUsers||0)):0,I.dailyPageViews=D?Math.max(0,(R.nbPageViews Line truncated
anonymous_github`)])])])])]),p(" Limitations "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-warning"})]),b("Limitations ")]),o("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[o("h3",{class:"panel-title"},[o("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? ")])]),o("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[o("div",{class:"panel-body p-3"},[o("ul",null,[o("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),o("li",null," Files larger than 8 MB are not supported. "),o("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),o("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). ")])])])])]),p(" Privacy & Security "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-shield"})]),b("Privacy & Security ")]),o("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[o("h3",{class:"panel-title"},[o("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? ")])]),o("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[o("div",{class:"panel-body p-3"},[o("p",null," Data stored on Anonymous GitHub is never shared or used for any purpose beyond providing the anonymization service. When a repository is removed or expires, only its configuration is retained \u2014 this makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[o("h3",{class:"panel-title"},[o("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? ")])]),o("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[o("div",{class:"panel-body p-3"},[o("p",null,[b("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),o("a",{href:"/connections"},"GitHub connections"),b(" page.")]),o("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."),o("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[o("h3",{class:"panel-title"},[o("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? ")])]),o("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[o("div",{class:"panel-body p-3"},[o("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. ")])])])]),p(" Self-Hosting "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#project-icon-storage"})]),b("Self-Hosting ")]),o("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[o("h3",{class:"panel-title"},[o("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? ")])]),o("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[o("div",{class:"panel-body p-3"},[o("p",null,[b(" Yes. Anonymous Git Line truncated
anonymized repository often think it is about the paper, so the
label names the service and the tooltip says who to contact. `),t[12]||(t[12]=o("li",{class:"nav-item d-none d-lg-block"},[o("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"},[o("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[o("use",{href:"#ui-icon-bug"})]),b("Report a bug ")])],-1)),e.isDarkMode?p("v-if",!0):(l(),d("li",y3,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to dark mode","aria-label":"Switch to dark mode",role:"button",onClick:t[0]||(t[0]=pe(s=>{e.darkMode(!0)},["prevent"]))},[...t[7]||(t[7]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",b3,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to light mode","aria-label":"Switch to light mode",role:"button",onClick:t[1]||(t[1]=pe(s=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),e.user?p("v-if",!0):(l(),d("li",w3,[...t[9]||(t[9]=[o("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[o("i",{class:"fab fa-github mr-1"}),b(" Sign in ")],-1)])])),e.user?(l(),d("li",k3,[o("a",E3,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,C3)):p("v-if",!0),o("span",_3,u(e.user?.username),1)]),o("div",S3,[o("h6",N3,"Signed in as @"+u(e.user?.username),1),t[10]||(t[10]=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" 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><a class="dropdown-item" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support the project</span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg><span>Sign out</span></a>',9))])])):p("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,D3)):p("v-if",!0)],64)}var R3={class:"paper-landing"},T3={class:"paper-hero"},A3={class:"paper-hero-copy"},O3={class:"paper-cta-row"},I3={key:0,href:"/signin",target:"_self",class:"btn-hero"},P3={key:1,href:"/anonymize",class:"btn-hero"},V3={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},q3={class:"paper-stats-grid"},M3={class:"paper-stat-value"},L3={class:"paper-stat-label"},$3=["viewBox"],U3=["x","y","width","height"],F3={key:1,class:"paper-stat-delta"},z3={class:"paper-features paper-wrap","aria-label":"Product features"},B3={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},H3=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],j3={class:"paper-eyebrow"},G3={class:"paper-feature-title"},W3={class:"paper-feature-more"},K3={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},Y3=["href","target"],J3={class:"paper-features-stage"},Q3=["id","aria-labelledby"],X3={class:"paper-frame"},Z3={class:"paper-frame-bar","aria-hidden":"true"},x3={class:"url"},eP=["src","alt"],tP={class:"paper-footer"},oP={class:"paper-footer-inner"},sP={class:"paper-footer-col"},nP={key:0,href:"/dashboard"},rP={key:1,href:"/conferences"},iP={class:"paper-footer-foot"};function Vl(e,t){return l(),d("div",R3,[p(" Hero: copy on the left, the product on the right "),o("section",T3,[o("div",A3,[t[2]||(t[2]=o("div",{class:"paper-eyebrow"},"For double-blind peer review",-1)),t[3]||(t[3]=o("h1",{class:"hero-title"},[b(" Share the code,"),o("br"),o("span",{class:"accent"},"not the author.")],-1)),t[4]||(t[4]=o("p",{class:"hero-subtitle Line truncated
`+JSON.stringify(t):""}`},[Be.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Bc(t)}" via a navigation guard.`},[Be.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[Be.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[Be.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function fn(e,t){return Ve(new Error,{type:e,[Na]:!0},t)}function Ft(e,t){return e instanceof Error&&Na in e&&(t==null||!!(e.type&t))}var Hc=["params","query","hash"];function Bc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of Hc)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function _a(e){let t={};if(e===""||e==="?")return t;let s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<s.length;++r){let o=s[r].replace(pa," "),i=o.indexOf("="),a=Rn(i<0?o:o.slice(0,i)),c=i<0?null:Rn(o.slice(i+1));if(a in t){let f=t[a];kt(f)||(f=t[a]=[f]),f.push(c)}else t[a]=c}return t}function or(e){let t="";for(let s in e){let r=e[s];if(s=Pc(s),r==null){r!==void 0&&(t+=(t.length?"&":"")+s);continue}(kt(r)?r.map(o=>o&&Qo(o)):[r&&Qo(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function Da(e){let t={};for(let s in e){let r=e[s];r!==void 0&&(t[s]=kt(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}var Ra=Symbol(""),rr=Symbol(""),to=Symbol(""),no=Symbol(""),so=Symbol("");function On(){let e=[];function t(r){return e.push(r),()=>{let o=e.indexOf(r);o>-1&&e.splice(o,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function Jt(e,t,s,r,o,i=a=>a()){let a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((c,f)=>{let g=m=>{m===!1?f(fn(Be.NAVIGATION_ABORTED,{from:s,to:t})):m instanceof Error?f(m):zc(m)?f(fn(Be.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&r.enterCallbacks[o]===a&&typeof m=="function"&&a.push(m),c())},b=i(()=>e.call(r&&r.instances[o],t,s,g)),k=Promise.resolve(b);e.length<3&&(k=k.then(g)),k.catch(m=>f(m))})}function oo(e,t,s,r,o=i=>i()){let i=[];for(let a of e)for(let c in a.components){let f=a.components[c];if(!(t!=="beforeRouteEnter"&&!a.instances[c]))if(ua(f)){let g=(f.__vccOpts||f)[t];g&&i.push(Jt(g,s,r,a,c,o))}else{let g=f();i.push(()=>g.then(b=>{if(!b)throw new Error(`Couldn't resolve component "${c}" at "${a.path}"`);let k=Ec(b)?b.default:b;a.mods[c]=b,a.components[c]=k;let m=(k.__vccOpts||k)[t];return m&&Jt(m,s,r,a,c,o)()}))}}return i}function Ta(e,t){let s=[],r=[],o=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){let c=t.matched[a];c&&(e.matched.find(g=>pn(g,c))?r.push(c):s.push(c));let f=e.matched[a];f&&(t.matched.find(g=>pn(g,f))||o.push(f))}return[s,r,o]}var jc=()=>location.protocol+"//"+location.host;function Fa(e,t){let{pathname:s,search:r,hash:o}=t,i=e.indexOf("#");if(i>-1){let a=o.includes(e.slice(i))?e.slice(i).length:1,c=o.slice(a);return c[0]!=="/"&&(c="/"+c),er(c,"")}return er(s,e)+r+o}function Gc(e,t,s,r){let o=[],i=[],a=null,c=({state:m})=>{let C=Fa(e,location),A=s.value,h=t.value,E=0;if(m){if(s.value=C,t.value=m,a&&a===A){a=null;return}E=h?m.position-h.position:0}else r(C);o.forEach(N=>{N(s.value,A,{delta:E,type:xs.pop,direction:E?E>0?eo.forward:eo.back:eo.unknown})})};function f(){a=s.value}function g(m){o.push(m);let C=()=>{let A=o.indexOf(m);A>-1&&o.splice(A,1)};return i.push(C),C}function b(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Ve({},m.state,{scroll:fs()}),"")}}function k(){for(let m of i)m();i=[],window.removeEventListener("popstate",c),window.removeEventListener("pagehide",b),document.removeEventListener("visibilitychange",b)}return window.addEventListener("popstate",c),window.addEventListener("pagehide",b),document.addEventListener("visibilitychange",b),{pauseListeners:f,listen:g,destroy:k}}function Oa(e,t,s,r=!1,o=!1){return{back:e,current:t,forward:s,replaced:r,position:window.history.length,scroll:o?fs():null}}function Wc(e){let{history:t,location:s}=window,r={value:Fa(e,s)},o={value:t.state};o.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(f,g,b){let k=e.indexOf("#"),m=k>-1?(s.host&&document.querySelector("base")?e:e.slice(k))+f:jc()+e+f;try{t[b?"replaceState":"pushState"](g,"",m),o.value=g}catch(C){console.error(C),s[b?"replace":"assign"](m)}}function a(f,g){i(f,Ve({},t.state,Oa(o.value.back,f,o.value.forward,!0),g,{position:o.value.position}),!0),r.value=f}function c(f,g){let b=Ve({},o.value,t.state,{forward:f,scroll:fs()});i(b.current,b,!0),i(f,Ve({},Oa(r.value,f,null),{position:b.position+1},g),!1),r.value=f}return{location:r,state:o,push:c,replace:a}}function za(e){e=wa(e);let t=Wc(e),s=Gc(e,t.state,t.location,t.replace);function r(i,a=!0){a||s.pauseListeners(),history.go(i)}let o=Ve({locatLine truncated
`)),e.options=Object.assign({},e.options,g.options),i.restore()})}a();let c=null;e.saveDefault=f=>{if(f&&f.preventDefault&&f.preventDefault(),e.saving)return;let g=i.checkpoint(),b={terms:e.terms.split(`
`).map(k=>k.trim()).filter(k=>k.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",b).then(()=>{i.accept(g),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",c&&r.cancel(c),c=r(()=>{e.message=null},2500)},k=>{e.saving=!1;let C="ERRORS."+(k&&k.data&&k.data.error);s(C).then(A=>{e.error=A&&A!==C?A:"Unable to save your defaults. Please try again."},()=>{e.error="Unable to save your defaults. Please try again."})})},e.deleteAccount=()=>{confirm("Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone.")&&(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},Qa=function(e,t,s){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{s.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},Xa=function(e,t,s,r,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(c){e.feature=c},e.featureHref=function(c){return c.needsUser&&!e.user?"/signin":c.href},e.featureTarget=function(c){return c.needsUser&&!e.user?"_self":c.target||void 0},e.featureKeydown=function(c,f){let g={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[c.key];if(g===void 0)return;c.preventDefault();let b=e.features.length,k=g==="first"?0:g==="last"?b-1:(f+g+b)%b;e.feature=e.features[k].key,o(()=>{let m=r.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 c=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,C)=>C.length-m.length),f=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!c.length)return[{text:e.demoText}];let g=new RegExp("("+c.map(f).join("|")+")","gi"),b={},k=0;return(e.demoText||"").split(g).filter(m=>m!=="").map(m=>{let C=c.find(A=>A.toLowerCase()===m.toLowerCase());return C?(b[C.toLowerCase()]||(b[C.toLowerCase()]=++k),{text:String(b[C.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(c=>c.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"}];function i(){t.get("/api/stat/").then(c=>{e.stat=c.data,e.cards[0].total=c.data.nbRepositories,e.cards[1].total=c.data.nbUsers,e.cards[2].total=c.data.nbPageViews,e.cards[3].total=c.data.nbPullRequests}).catch(()=>{})}i();function a(c){let f={series:c,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!c||c.length<2)return f;let g=new Array(c.length-1);for(let h=1;h<c.length;h++)g[h-1]=c[h]-c[h-1];let b=g.length,k=Math.max.apply(null,g),m=Math.min.apply(null,g),C=Math.min(0,m),A=k-C||1;f.viewW=b*2,f.bars=new Array(b);for(let h=0;h<b;h++){let E=(g[h]-C)/A,N=Math.max(1.5,E*34);f.bars[h]={x:(h*2+.25).toFixed(2),y:(36-N).toFixed(2),w:"1.5",h:N.toFixed(2)}}if(f.deltaToday=g[b-1],b>=2){let h=g[b-2];h&&(f.pctChange=(f.deltaToday-h)/h*100)}return f.pctAbs=Math.round(Math.abs(f.pctChange)),f.isUp=f.pctChange>=0,f}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(c=>{let f=c.data||[];e.history={repositories:a(f.map(g=>g.nbRepositories||0)),users:a(f.map(g=>g.nbUsers||0)),pageViews:a(f.map(g=>g.nbPageViews||0)),pullRequests:a(f.map(g=>g.nbPullRequests||0))}}).catch(()=>{})},Za=function(e,t,s,r,o,i){let a=ut();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,Ze(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Xt()(document,"click",_=>{e.quotaExpanded&&!_.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=_=>_.status==="error"||_._broken||f(_.status)==="progress"&&_._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=_=>{e.projectView=_,_==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.projectDetailsId=_=>"project-details-"+encodeURIComponent(_._type+":"+(_._id||_._source||"unknown")),e.showProjectDetails=async _=>{e.selectedProject=_,e.projectName=_.projectName||"",e.nameError="",e.nameMessage="",await Ze();let j=document.getElementById(e.projectDetailsId(_));j?.focus(),j?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=_=>{e.selectedProject=null,Ze(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(_._type+":"+_._id)}"]`)?.focus())},e.saveProjectName=async _=>{if(e.nameSaving||!_._id)return;let j=e.projectName.trim();if(j.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let ne=await t.post("/api/user/project-name",{type:_._type,id:_._id,name:j});_.projectName=ne.data.name,_._label=_.projectName||_._fallbackLabel,e.selectedProject===_&&(e.nameMessage=j?"Project name saved.":"Default project name restored."),R||(e.dashboardCursor=null,await H(),e.selectedProject===_&&(e.selectedProject=e.items.find(le=>le._type===_._type&&le._id===_._id)||null))}catch{e.selectedProject===_&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async _=>{if(!_._viewUrl||e.copyingId)return;let j=new URL(_._viewUrl,o.location.origin).href;e.copyingId=_._type+":"+_._id;try{if(o.navigator.clipboard?.writeText)await o.navigator.clipboard.writeText(j);else{let ne=document.createElement("textarea");ne.value=j,ne.setAttribute("readonly",""),ne.style.position="fixed",ne.style.opacity="0";let le=document.activeElement;document.body.appendChild(ne);try{if(ne.select(),!document.execCommand?.("copy"))throw Error("Copy unavailable")}finally{ne.remove(),le?.focus()}}e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:j})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"In progress",error: Line truncated
`)),e.options=Object.assign({},e.options,B.options),e.options.expirationDate=B.options&&B.options.expirationDate?new Date(B.options.expirationDate):R(),!r.repoId&&!r.pullRequestId&&!r.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),S&&S()})}function z(S,I,B){e.anonymize&&e.anonymize[S]&&e.anonymize[S].setValidity(I,B)}function Z(S){try{let I=parseGithubUrl(S);if(I&&I.owner&&I.repo)return I.owner+"/"+I.repo}catch{}return null}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 ne()}catch{}}};function ae(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:Z(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function _(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function j(){let S;try{S=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!S||S.path!==o.path()||Date.now()-S.savedAt>=30*6e4)return E.restore()?(e.sourceUrl&&await _(),!0):!1;E.restore();for(let I of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(S.draft,I)&&(e[I]=S.draft[I]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await _(),sessionStorage.removeItem("github-access-draft"),!0}q(()=>{!r.repoId&&!r.pullRequestId&&!r.gistId&&a(j,0),r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async S=>{e.githubConnection=S.data.connection||"oauth",e.sourceUrl="https://github.com/"+S.data.source.fullName,e._originalFullName=S.data.source.fullName,e.terms=S.data.options.terms.filter(I=>I).join(`
`),e.source=S.data.source,e.role=S.data.role||"owner",e.coauthors=S.data.coauthors||[],e._originalBranch=S.data.source.branch,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,e.repositoryID=S.data.source.repositoryID,e._originalRepositoryID=S.data.source.repositoryID,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),A=h(parseGithubUrl(e.sourceUrl)),!await j()&&(await Promise.all([ne(),le()]),_e())},()=>{o.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async S=>{if(e.githubConnection=S.data.connection||"oauth",e.sourceUrl="https://github.com/"+S.data.source.repositoryFullName+"/pull/"+S.data.source.pullRequestId,e.terms=S.data.options.terms.filter(I=>I).join(`
`),e.source=S.data.source,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),A=h(parseGithubUrl(e.sourceUrl)),!await j())try{await Se()}catch{}},()=>{o.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async S=>{e.sourceUrl="https://gist.github.com/"+S.data.source.gistId,e.terms=S.data.options.terms.filter(I=>I).join(`
`),e.source=S.data.source,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),A=h(parseGithubUrl(e.sourceUrl)),!await j()&&await X()},()=>{o.url("/404")}))}),t.get("/github/connections").then(S=>{e.githubConnections=S.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&S.data.appEnabled&&S.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&_())}).catch(()=>{}),e.urlSelected=async(S=!1)=>{let I=++f,B;try{B=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,ve.cancel(),L.cancel(),me.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",z("sourceUrl","github",!1);return}let v=h(B),w=S||A===v;A=v,e.sourceUrlError="",z("sourceUrl","github",!0);let O=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let P=window.document.getElementById("sourceUrl");if(P){try{P.setSelectionRange(0,0)}catch{}P.scrollLeft=0}},50),O&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!w&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],w||(e.source={type:"GitHubStream",branch:"",commit:""}),ve.cancel(),L.cancel(),me.cancel(),ye.clear(),J.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=w;try{B.gistId&&!B.repo?(e.detectedType="gist",e.source={gistId:B.gistId},await X()):B.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:B.owner+"/"+B.repo,pullRequestId:B.pullRequestId},await Se()):(e.detectedType="repo",await Promise.all([ne(),le()]),_e())}catch{}finally{I===f&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let S=e.branches.filter(B=>B.name==e.source.branch)[0];if(!S)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=S.commit),e.readme=S.readme,await le(),_e()}),e.getBranches=async S=>{let I=parseGithubUrl(e.sourceUrl),B=m();try{let v=await t.get(`/api/repo/${I.owner}/${I.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&Z(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:S===!0||e.reconnectingSource?"1":"0",repositoryID:ae()}});if(!k(B))return;e.branches=v.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let w=e.branches.filter(O=>O.name==e.source.branch);w.length>0&&(!(!e.reconnectingSource&&!S&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=w[0].commit),e.readme=w[0].readme,await le(S))}catch(v){if(!k(B))return;e.branches=[],e.sourceUnreachable=v&&(v.status===404||v.data&&v.data.error==="repo_not_found");let w=v&&v.data&&v.data.error||(v&&v.status===404?"repo_not_found":"unknown_error");i("ERRORS."+w).then(O=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:O}),e.error=O},console.error),typeof z=="function"&&z("sourceUrl","missing",!1)}finally{C(B)}};async function ne(){let S=parseGithubUrl(e.sourceUrl),I=m();try{U();let B=await t.get(`/api/repo/${S.owner}/${S.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&Z(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:ae(),force:"1"}});if(!k(I))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(!k(I))return;throw B.data&&(i("ERRORS."+B.data.error).then(v=>{e.addToast({title:"Error",date:new Date,body:v}),e.error=v},console.error),x(B.data.error)),z("sourceUrl","missing",!1),B}finally{C(I)}}async function le(S){if(e.readme&&!S)return e.readme;let I=parseGithubUrl(e.sourceUrl),B=m();try{let v=await t.get(`/api/repo/${I.owner}/${I.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&Z(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:S===!0?"1":"0",branch:e.source.branch,repositoryID:ae()}});k(B,!0)&&(e.readme=v.data)}catch{k(B,!0)&&(e.readme="")}finally{C(B)}}function Ce(){let S={terms:e.terms?e.terms.split(`
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(S.branchName=e.source.branch);try{let I=parseGithubUrl(e.sourceUrl);S.repoName=`${I.owner}/${I.repo}`}catch{}return S}function ce(S,I,B){let v=null,w=0,O=()=>{if(e.detectedType!==S)return;v&&a.cancel(v);let P=++w;e.previewStatus="loading",v=a(()=>{v=null;let M=I();if(!M){e.previewStatus="idle";return}t.post("/api/anonymize-preview",M).then(W=>{P===w&&(B(W.data,M),e.previewStatus="ready")}).catch(()=>{P===w&&(e.previewStatus="error")})},200)};return O.cancel=()=>{w++,v&&a.cancel(v),v=null},e.on("dispose",O.cancel),O}e.retryPreview=()=>{e.detectedType==="repo"&&ve(),e.detectedType==="pr"&&L(),e.detectedType==="gist"&&me()};let ve=ce("repo",()=>e.readme?{content:e.readme,options:Ce()}:null,S=>{if(typeof S?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=S.content;let I="";try{let v=parseGithubUrl(e.sourceUrl),w=e.source.branch||e.details&&e.details.defaultBranch||"main";I=`https://github.com/${v.owner}/${v.repo}/raw/${w}/`}catch{}let B=renderMD(e.anonymize_readme,I);e.html_readme=B,a(Prism.highlightAll,150)});function _e(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),ve())}async function Se(){let S=parseGithubUrl(e.sourceUrl),I=m();try{U();let B=await t.get(`/api/pr/${S.owner}/${S.repo}/${S.pullRequestId}`,{params:{connection:e.githubConnection}});if(!k(I))return;e.details=B.data,e.pullRequestId||(e.pullRequestId=S.repo+"-PR"+S.pullRequestId+"-"+generateRandomId(4))}catch(B){if(!k(I))return;throw B.data&&(i("ERRORS."+B.data.error).then(v=>{e.addToast({title:"Error",date:new Date,body:v}),e.error=v},console.error),x(B.data.error)),z("sourceUrl","missing",!1),B}finally{C(I)}}let ye=ze(new Map);function Ue(){let S=new Set,I=e.details&&e.details.pullRequest;if(!I)return S;typeof I.title=="string"&&S.add(I.title),typeof I.body=="string"&&S.add(I.body),typeof I.diff=="string"&&S.add(I.diff);let B=I.comments||[];for(let v of B)typeof v.author=="string"&&S.add(v.author),typeof v.body=="string"&&S.add(v.body);return S}let L=ce("pr",()=>{let S=Ue(),I=Array.from(S);return I.length===0?null:{contents:I,options:Ce()}},(S,I)=>{if(!Array.isArray(S?.contents)||S.contents.length!==I.contents.length||S.contents.some(w=>typeof w!="string"))throw Error("Invalid preview response");let B=I.contents,v=new Map;for(let w=0;w<B.length&&w<S.contents.length;w++)v.set(B[w],S.contents[w]);ye.clear(),v.forEach((w,O)=>ye.set(O,w))});e.anonymizePrContent=function(S){return S&&(ye.has(S)?ye.get(S):"")};async function X(){let S=parseGithubUrl(e.sourceUrl),I=m();try{U(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let B=await t.get(`/api/gist/source/${S.gistId}`);if(!k(I))return;e.details=B.data,e.gistId||(e.gistId="gist-"+S.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(B){if(!k(I))return;if(B.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,z("sourceUrl","missing",!1);return}if(B.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,z("sourceUrl","missing",!1);return}throw B.data&&(i("ERRORS."+B.data.error).then(v=>{e.addToast({title:"Error",date:new Date,body:v}),e.error=v},console.error),x(B.data.error)),z("sourceUrl","missing",!1),B}finally{C(I)}}let J=ze(new Map);function se(){let S=new Set,I=e.details&&e.details.gist;if(!I)return S;typeof I.description=="string"&&S.add(I.description),typeof I.ownerLogin=="string"&&S.add(I.ownerLogin);let B=I.files||[];for(let w of B)typeof w.filename=="string"&&S.add(w.filename),typeof w.content=="string"&&S.add(w.content);let v=I.comments||[];for(let w of v)typeof w.author=="string"&&S.add(w.author),typeof w.body=="string"&&S.add(w.body);return S}let me=ce("gist",()=>{let S=se(),I=Array.from(S);return I.length===0?null:{contents:I,options:Ce()}},(S,I)=>{if(!Array.isArray(S?.contents)||S.contents.length!==I.contents.length||S.contents.some(w=>typeof w!="string"))throw Error("Invalid preview response");let B=I.contents,v=new Map;for(let w=0;w<B.length&&w<S.contents.length;w++)v.set(B[w],S.contents[w]);J.clear(),v.forEach((w,O)=>J.set(O,w)),he()});e.anonymizeGistContent=function(S){return S&&(J.has(S)?J.get(S):"")},e.previewGistFiles=[];function he(){let S=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=S.map(I=>({filename:e.anonymizeGistContent(I.filename),content:e.anonymizeGistContent(I.content),language:I.language}))}e.watch("details.gist.files",he,!0),e.watch("terms",he);function re(){let S=e.conference;if(e.conference_data=null,!S)return;let I=e.isUpdate&&S===e._originalConference;t.get("/api/conferences/"+S).then(B=>{e.conference===S&&(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),!I&&(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.conferenc Line truncated
`).filter(O=>O),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&&(v.options.pageSource=e.details.pageSource),U();let w=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(w,v,{headers:{"Content-Type":"application/json"}}).then(()=>{E.clear(),window.location.href="/status/"+e.repoId},O=>{O.data&&(i("ERRORS."+O.data.error).then(P=>{e.error=P},console.error),x(O.data.error))}).finally(()=>{I.disabled=!1})},e.anonymizeGist=S=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(te())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let I=S.currentTarget||S.target.closest?.("button")||S.target;I.disabled=!0;let B=parseGithubUrl(e.sourceUrl),v={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(O=>O),source:{gistId:B.gistId},options:e.options,conference:e.conference};U();let w=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(w,v,{headers:{"Content-Type":"application/json"}}).then(()=>{E.clear(),window.location.href="/gist/"+e.gistId},O=>{O.data&&(i("ERRORS."+O.data.error).then(P=>{e.error=P},console.error),x(O.data.error))}).finally(()=>{I.disabled=!1})},e.anonymizePullRequest=S=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(te())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let I=S.currentTarget||S.target.closest?.("button")||S.target;I.disabled=!0;let B=parseGithubUrl(e.sourceUrl),v={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
`).filter(O=>O),source:{repositoryFullName:`${B.owner}/${B.repo}`,pullRequestId:B.pullRequestId},options:e.options,conference:e.conference};U();let w=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(w,v,{headers:{"Content-Type":"application/json"}}).then(()=>{E.clear(),window.location.href="/pr/"+e.pullRequestId},O=>{O.data&&(i("ERRORS."+O.data.error).then(P=>{e.error=P},console.error),x(O.data.error))}).finally(()=>{I.disabled=!1})},e.watch("conference",()=>{re()}),e.watch("terms",()=>{e.detectedType==="repo"&&_e(),e.detectedType==="pr"&&L(),e.detectedType==="gist"&&me()}),e.watch("options.image",()=>{e.detectedType==="repo"&&_e(),e.detectedType==="pr"&&L(),e.detectedType==="gist"&&me()}),e.watch("options.link",()=>{e.detectedType==="repo"&&_e(),e.detectedType==="pr"&&L(),e.detectedType==="gist"&&me()}),e.watch("details",()=>{e.detectedType==="pr"&&L(),e.detectedType==="gist"&&me()},!0)},ur=function(e,t,s,r,o,i){let a=ut(),c=Xt();e.on("dark-mode",(L,X)=>{e.aceOption&&(X?e.aceOption.theme="nord_dark":e.aceOption.theme="chrome")});let f=0,g=null,b=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function k(){g&&(g.resolve(),g=null),b&&(a.timeout.cancel(b),b=null)}let m=!1;e.on("dispose",()=>{m=!0,f++,k(),C&&C.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,c(document,"click",L=>{e.symbolsOpen&&!L.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!L.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.accountOpen&&!L.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!L.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),c(document,"keydown",L=>{L.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(L.ctrlKey||L.metaKey)&&!L.altKey&&L.key&&L.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(L.preventDefault(),e.toggleMdFind(!0))}),c(document,"keydown",function(L){if((L.metaKey||L.ctrlKey)&&L.key==="k"){L.preventDefault();var X=document.querySelector(".tree-search-input");X&&(X.focus(),X.select())}});var C=null;e.onFileSearchChange=function(){C&&(C.resolve(),C=null);let L=e.fileSearchQuery;if(!L||L.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let X=i.defer();C=X,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(L)}`,{timeout:X.promise}).then(function(J){if(!(m||C!==X)){C=null,e.fileSearchLoading=!1;var se={};e.files.forEach(function(M){se[(M.path||"")+"/"+M.name]=!0});for(var me=[],he={},re=0;re<J.data.length;re++){var U=J.data[re];if(U.path)for(var te=U.path.split("/"),x="",S=0;S<te.length;S++){var I=x;x=x?x+"/"+te[S]:te[S];var B=I+"/"+te[S];!se[B]&&!he[B]&&(he[B]=!0,me.push({name:te[S],path:I}))}}me.sort(function(M,W){return(M.path||"").split("/").length-(W.path||"").split("/").length}),me.length>0&&e.files.push.apply(e.files,me);for(var v=[],w=0;w<J.data.length;w++){var O=J.data[w],P=(O.path||"")+"/"+O.name;!se[P]&&O.size!=null&&(v.push(O),se[P]=!0)}v.length>0&&e.files.push.apply(e.files,v),e.fileSearchResults=J.data}},function(){!m&&C===X&&(C=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let A={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},h=["license","txt"],E=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],N=["wav","mp3","ogg","wma","flac","aac","m4a"],R=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(L,X){if(e.repoId!=r.repoId)return Ue();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(J=>J&&J.trim().length>0),ye();for(let J=0;J<e.paths.length-1;J++){let se=J>0?e.paths.slice(0,J).join("/"):"";e.files.some(he=>he.path===se)||e.getFiles(se)}}});function V(){if(e.paths[0]!="")return;let L=["readme.md","readme.txt","readme.org","readme.1st","readme"],X={};for(let se of e.files)se.name.toLowerCase().indexOf("readme")>-1&&(X[se.name.toLowerCase()]=se.name);let J=null;for(let se of L)if(X[se]){J=se;break}if(!J&&Object.keys(X).length>0&&(J=Object.keys(X)[0]),J){let se=s.url();se[se.length-1]!="/"&&(se+="/"),s.url(se+encodePathForUrl(X[J]))}}e.getFiles=function(L,X=!1){let J=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(L)}&v=${e.options.lastUpdateDate}`).then(function(se){if(m||J!==e.repoId)return[];let me=L||"";return e.files=e.files.filter(he=>he.path!==me),e.files.push(...se.data),se.data},function(se){if(m||J!==e.repoId)return[];X||(e.type="error",e.content=dr(se),e.files=[])})};function H(){return e.files.filter(L=>L.name==e.paths[e.paths.length-1]&&L.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var q=null;e.on("dispose",function(){q&&a.interval.cancel(q)});function z(L){if(m)return;let X=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(J=>{if(!(m||X!==e.repoId)){if(e.options=J.data,e.options.url){window.location=e.o Line truncated
`).forEach((X,J)=>{for(let[se,me]of j){let he=se.exec(X);if(he&&!/^(if|for|while|switch|return|catch)$/.test(he[1])){L.push({name:he[1],kind:me,line:J+1});break}}}),ne={content:e.content,list:L.slice(0,300)},ne.list},e.goToSymbol=function(L){e.symbolsOpen=!1;let X=e.codeEditor;X&&(X.scrollToLine(L-1,!0,!0,()=>{}),X.gotoLine(L,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+L),window.dispatchEvent(new HashChangeEvent("hashchange")))},e.gotoLine=function(){let L=e.codeEditor;L&&(L.focus(),L.execCommand("gotoline"))},e.rootEntries=function(){return[...e.files||[]].sort((L,X)=>{let J=L.size==null,se=X.size==null;return J!==se?J?-1:1:L.name.localeCompare(X.name)})},e.formatSize=function(L){if(L==null)return"";if(L<1024)return L+" B";let X=L/1024;return X<1024?X.toFixed(1)+" KB":(X/1024).toFixed(1)+" MB"},e.fileSize=function(L){if(!L)return null;let X=L.replace(/^\/+/,""),J=(e.files||[]).find(se=>(se.path?se.path+"/":"")+se.name===X);return J&&J.size!=null?J.size:null},e.revealFolder=function(L){e.sidebarHidden=!1,e.sidebarCollapsed=!1,Ze(()=>{let X=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(L):L)+'"]');X&&(X.closest("li")?.classList.contains("open")||X.click(),X.scrollIntoView({block:"nearest"}),X.focus())})};let le=/\bXXXX-\d+\b/g;e.redactionCount=function(){return typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(le)||[]).length},e.renderRedacted=function(L){if(!L||L.indexOf("XXXX-")===-1||typeof window.DOMParser!="function")return L;let X=new window.DOMParser().parseFromString("<div>"+L+"</div>","text/html"),J=X.createTreeWalker(X.body,4),se=[];for(;J.nextNode();)le.test(J.currentNode.nodeValue)&&se.push(J.currentNode);for(let me of se){le.lastIndex=0;let he=X.createDocumentFragment(),re=0,U,te=me.nodeValue;for(;U=le.exec(te);){he.appendChild(X.createTextNode(te.slice(re,U.index)));let x=X.createElement("mark");x.className="redact-chip",x.setAttribute("title","Redacted term "+U[0].slice(5)+" \u2014 the same term everywhere in this snapshot");let S=U[0].slice(5);x.textContent="";let I=X.createElement("i");I.textContent=S,x.appendChild(I),x.dataset.term=U[0],x.setAttribute("aria-label","Redacted term "+S);let B=/^[.,;:!?)\]]+/.exec(te.slice(U.index+U[0].length));if(B){let v=X.createElement("span");v.className="redact-glue",v.appendChild(x),v.appendChild(X.createTextNode(B[0])),he.appendChild(v),re=U.index+U[0].length+B[0].length}else he.appendChild(x),re=U.index+U[0].length}he.appendChild(X.createTextNode(te.slice(re))),me.parentNode.replaceChild(he,me)}return X.body.firstChild.innerHTML};let Ce=L=>L.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(L){let X=e.renderRedacted(L);if(!X||typeof window.DOMParser!="function")return X;let J=new window.DOMParser().parseFromString("<div>"+X+"</div>","text/html"),se={};return J.querySelectorAll("h1, h2, h3").forEach(me=>{let he=me.id||Ce(me.textContent);se[he]?he+="-"+ ++se[he]:se[he]=1,me.id=he}),J.body.firstChild.innerHTML};let ce={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(ce.content===e.content)return ce.list;let X=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(J=>({id:J.id,text:J.textContent.trim(),level:J.tagName==="H3"?3:2})).slice(0,40);return ce={content:e.content,list:X},X},e.activeHeading=null,c(window,"scroll",()=>{let L=e.readmeToc?e.readmeToc():[];if(!L.length)return;let X=150,J="",se="";for(let me of L){let he=window.document.getElementById(me.id);if(!he)continue;let re=he.getBoundingClientRect().top;re<X?J=me.id:!se&&re<window.innerHeight-80&&(se=me.id)}se&&(J=se),e.activeHeading!==J&&(e.activeHeading=J)},{capture:!0,passive:!0}),e.scrollToHeading=function(L){if(!L){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let X=window.document.getElementById(L);X&&X.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=L},e.redactParts=function(L){let X=[],J=0,se,me=/\bXXXX-(\d+)\b/g;for(L=String(L||"");se=me.exec(L);)se.index>J&&X.push({t:L.slice(J,se.index)}),X.push({n:se[1]}),J=se.index+se[0].length;return J<L.length&&X.push({t:L.slice(J)}),X},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 L=e.content;if(e.type==="html"&&e.url)try{L=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(L),e.contentCopied=!0,setTimeout Line truncated
`+h.join(`
`)],{type:"text/csv"}),N=document.createElement("a");N.href=URL.createObjectURL(E),N.download=r.username+"-repositories.csv",N.click()},e.showStatusMessage=m=>{let C=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,C)},e.fetchGithubInfo=m=>{let C=window.open("","_blank");C&&C.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(A=>{C&&(C.document.open(),C.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(A.data,null,2).replace(/[<>]/g,h=>h==="<"?"&lt;":"&gt;")+"</pre>"),C.document.close())},A=>{let h=A&&A.data?JSON.stringify(A.data,null,2):String(A);C&&(C.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+h+"</pre>")})};function f(m){t.get("/api/admin/users/"+m+"/repos",{}).then(C=>{e.repositories=C.data},C=>{console.error(C)})}function g(m){t.get("/api/admin/users/"+m,{}).then(C=>{e.userInfo=C.data},C=>{console.error(C)})}g(r.username),f(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>g(r.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>g(r.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>g(r.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>g(r.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function b(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}b(),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="",b()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>b(),C=>console.error(C))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>f(r.username),C=>console.error(C))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>f(r.username),C=>console.error(C))},e.updateRepository=m=>{let C=ze({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(C),t.post(`/api/repo/${m.repoId}/refresh`).then(A=>{A.data.status=="ready"?C.title=`${m.repoId} is refreshed.`:C.title=`Refreshing of ${m.repoId}.`},A=>{C.title=`Error during the refresh of ${m.repoId}.`,C.body=A.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(C=>{e.userInfo.repositories=C.data})};let k=null;e.watch("query",()=>{o.timeout.cancel(k),k=o.timeout(()=>{f(r.username)},500)},!0)},dl=function(e,t,s){let r=ut(),o=Xt();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 i=A=>{if(A.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){A.preventDefault();let h=document.querySelector('.admin-filter-toolbar input[type="search"]');h&&h.focus()}};o(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=A=>{A==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[A]="",e.query.page=1},e.chips=[];let a=()=>{let A=[];(e.query.dateFrom||e.query.dateTo)&&A.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=A};e.statusCountFor=A=>{let h=(e.statusCounts||[]).find(E=>E._id===A);return h?h.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=A=>{e.query.sort===A?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=A,e.query.direction="desc"),e.query.page=1},e.sortIcon=A=>e.query.sort===A?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let c="admin.conferences.filterPrefs",f={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!1,error:!0,preparing:!0},g=loadFilterPrefs(c)||{};e.query=Object.assign({},f,g,{page:1,search:""});let b=s.search();b.search&&(e.query.search=b.search);let k="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(k)||"[]"),e.savePreset=()=>{let A=window.prompt("Preset name:");if(!A)return;let h=Object.assign({},e.query);delete h.page,e.presets=(e.presets||[]).filter(E=>E.name!==A),e.presets.push({name:A,query:h}),localStorage.setItem(k,JSON.stringify(e.presets))},e.applyPreset=A=>{Object.assign(e.query,A.query,{page:1})},e.deletePreset=A=>{e.presets=(e.presets||[]).filter(h=>h.name!==A.name),localStorage.setItem(k,JS Line truncated
`).map((_e,Se)=>Se===0?_e:ve+_e).join(`
`)}else typeof _=="number"||typeof _=="boolean"?ce=String(_):ce=JSON.stringify(_);Z.push(`${le}${ce}${Ce}`)}),Z.push("}"),Z.join(`
`)}function g(N){let R=[],V="",H=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,q=0,z;for(;z=H.exec(N);)V+=N.slice(q,z.index),q=H.lastIndex,R.push({key:z[1],op:z[2]||"=",val:z[3]});return V+=N.slice(q),{filters:R,free:V.trim().toLowerCase()}}function b(N,R){for(let V of R.filters){let H=(z,Z,ae)=>{let _=parseFloat(z),j=parseFloat(Z);return ae==="="?String(z)===String(Z):ae==="!="?String(z)!==String(Z):ae===">="?_>=j:ae==="<="?_<=j:ae===">"?_>j:ae==="<"?_<j:!0},q;if(V.key==="code")q=N.displayMessage;else if(V.key==="module")q=N.module;else if(V.key==="status")q=N._status;else if(V.key==="url")q=N._url;else if(V.key==="repo")q=N._repoId;else if(V.key==="level")q=N.level;else continue;if(q==null||!H(q,V.val,V.op))return!1}return!(R.free&&((N.displayMessage||"")+" "+(N.module||"")+" "+(N._url||"")+" "+JSON.stringify(N.raw||[])).toLowerCase().indexOf(R.free)===-1)}function k(){let N=g(e.query.search||"");e.parsedFilterCount=N.filters.length;let R=e.query.bucket,V=e.entries.filter(Z=>R&&Z._bucket!==R?!1:b(Z,N)),H=e.query.group;if(H){let Z=j=>H==="module"?j.module:j.displayMessage||j.message||"_",ae=new Map;for(let j of V){let ne=Z(j);if(ae.has(ne)){let le=ae.get(ne);le.count++,le._related.push(j),new Date(j.ts)>new Date(le.ts)&&(le.ts=j.ts,le._url=j._url,le._status=j._status),new Date(j.ts)<new Date(le._firstSeen)&&(le._firstSeen=j.ts)}else{let le=Object.assign({},j);le._key=`${H}:${ne}`,le._related=[j],le._firstSeen=j.ts,le._lastHourCount=0,le.count=1,ae.set(ne,le)}}let _=Date.now()-3600*1e3;for(let j of ae.values())j._lastHourCount=j._related.filter(ne=>new Date(ne.ts).getTime()>=_).length;V=Array.from(ae.values())}else V=V.map((Z,ae)=>(Z._key="row:"+ae+":"+Z.ts,Z._related=[Z],Z._firstSeen=Z.ts,Z._lastHourCount=0,Z.count=1,Z));let q=Z=>({error:0,warn:1,info:2})[Z._bucket]??1;e.query.sort==="count"?V.sort((Z,ae)=>q(Z)-q(ae)||ae.count-Z.count||new Date(ae.ts)-new Date(Z.ts)):V.sort((Z,ae)=>q(Z)-q(ae)||new Date(ae.ts)-new Date(Z.ts)),e.visible=V,(e.query.bucket||(e.query.search||"").trim())&&!V.length&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,m(!0))}function m(N){let R=N?e.entries.length:0,V=N?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:R,limit:V}}).then(H=>{let q=(H.data.entries||[]).map(c);e.entries=N?e.entries.concat(q):q,e.available=!!H.data.available,e.cap=H.data.max||e.cap,e.total=H.data.total||e.entries.length,e._autoLoading=!1,k()},H=>{e._autoLoading=!1,console.error(H)})}e.loadMore=()=>m(!0),e.canLoadMore=()=>e.entries.length<e.total;function C(){t.get("/api/admin/errors/stats").then(N=>{let R=N.data||{},V=R.prev24h?Math.round((R.last24h-R.prev24h)/R.prev24h*100):0;e.stats={last24h:R.last24h||0,prev24h:R.prev24h||0,delta:V,severity:R.severity||{error:0,warn:0,info:0},unique:R.unique||{error:0,warn:0,info:0},buckets:R.buckets||[],dropped:R.dropped||0}},N=>console.error(N))}function A(){m(),C()}e.barPx=(N,R)=>{let V=e.stats.buckets||[],H=0,q=0;for(let _ of V)H=Math.max(H,(_.error||0)+(_.warn||0)),q=Math.max(q,_.info||0);let z=N[R]||0;if(!z)return 0;if(R==="info")return q?Math.max(2,Math.round(z/q*(H?16:60))):0;let Z=(N.error||0)+(N.warn||0),ae=Math.round(Z/H*44);return Math.max(4,Math.round(z/Z*ae))},e.bucketTitle=N=>`${new Date(N.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${N.error||0} err \xB7 ${N.warn||0} warn \xB7 ${N.info||0} info`,e.toggle=N=>{e.expanded[N._key]=!e.expanded[N._key]},e.setBucket=N=>{e.query.bucket=N},e.refreshNow=A,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(A,N=>console.error(N))},e.exportCsv=()=>{let N=["ts","level","module","displayMessage","_status","_url","_repoId"],R=[N.join(",")];for(let z of e.visible)R.push(N.map(Z=>{let ae=z[Z]==null?"":String(z[Z]);return/[",\n]/.test(ae)?`"${ae.replace(/"/g,'""')}"`:ae}).join(","));let V=new Blob([R.join(`
`)],{type:"text/csv;charset=utf-8"}),H=URL.createObjectURL(V),q=document.createElement("a");q.href=H,q.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(q),q.click(),document.body.removeChild(q),URL.revokeObjectURL(H)};function h(N){e.copyHint=`${N} copied`,o.timeout(()=>{e.copyHint=""},1500)}e.copyJson=N=>{navigator.clipboard.writeText(N._detailJson).then(()=>h("JSON"))},e.copyCurl=N=>{if(!N._url)return;let V=`curl -X ${N._method||"GET"} '${window.location.origin}${N._url}'`;navigator.clipboard.writeText(V).then(()=>h("curl"))},A();let E=r(()=>{e.query.autoRefresh&&A()},15e3);e.on("dispose",()=>r.cancel(E)),e.watch("query.search",k),e.watch("query.bucket",k),e.watch("query.sort",k),e.watch("query.group",k)},pl=function(e,t,s,r){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";var o=!1;e.loadCache=function(){if(!o){o=!0;var h=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:h}}).then(function(E){h===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,h!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(h){return e.cacheTraffic==="all"||h.traffic===e.cacheTraffic})},e.cacheRate=function(h,E){var N=e.cacheRows(),R=function(q){return N.filter(function(z){return z.name===q}).reduce(function(z,Z){return z+Z[E]},0)},V=R(h+"_hit"),H=R(h+"_miss");return V+H?(100*V/(V+H)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(h){return h.replaceAll("_"," ")},e.cacheP95=function(h){var E=0,N=e.cacheReport?.latencyBucketsMs||[];if(!h.count)return"No samples";if(!h.ms)return"Not timed";for(var R=0;R<=N.length;R++)if(E+=h["b"+R]||0,E>=Math.ceil(h.count*.95))return R<N.length?"\u2264 "+N[R]+" ms":"> 10 s";return"No samples"},e.performanceError=null,e.latencyBound=function(h,E){return h.count?h[E]==null?"> 60 s":"\u2264 "+h[E]+" ms":"No samples"},e.firstByteBound=function(h){return e.latencyBound({count:h.firstByteCount,p95UpperMs:h.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(h){return Math.max(0,Math.round((Date.now()-h.sampledAt)/1e3))},e.peakRss=function(h){return(e.performance.runtimeSeries||[]).filter(function(E){return E.instance===h.instance}).reduce(function(E,N){return Math.max(E,N.rss)},h.memory.rss)},e.performanceWarning=function(h){return e.sampleAge(h)>45||h.droppedBatches||h.droppedMetrics||h.sockets?.closeWait>0||h.eventLoop?.p95Ms>100||h.memoryLimitBytes&&h.memory.rss>h.memoryLimitBytes*.8};var i=!1;e.loadPerformance=function(){var h=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==h&&(e.performance=null),!i&&(i=!0,t.get("/api/admin/performance",{params:{minutes:h}}).then(function(E){h===e.performanceMinutes&&(e.performance=E.data,e.performanceError=E.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){h===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){i=!1,h!==e.performanceMinutes&&e.loadPerformance()}))};function a(h){if(h==null)return"\u2014";for(var E=["B","KB","MB","GB","TB"],N=0,R=h;R>=1024&&N<E.length-1;)R/=1024,N++;return R.toFixed(N>0?1:0)+" "+E[N]}e.humanBytes=a;function c(h){if(!h)return"\u2014";var E=Math.floor(h/86400),N=Math.floor(h%86400/3600),R=Math.floor(h%3600/60);return E>0?E+"d "+(N<10?"0":"")+N+"h":N>0?N+"h "+(R<10?"0":"")+R+"m":R+"m"}e.humanDuration=c;function f(h){return h==null?"\u2014":h>=1e6?(h/1e6).toFixed(1)+"M":h>=1e3?(h/1e3).toFixed(1)+"K":String(h)}e.humanNum=f,e.queueTotal=function(h){return h?(h.waiting||0)+(h.active||0)+(h.delayed||0)+(h.failed||0):0},e.statusCount=function(h){if(!e.data||!e.data.repos)return 0;for(var E=e.data.repos.statusBreakdown||[],N=0;N<E.length;N++)if(E[N]._id===h)return E[N].count;return 0},e.barPct=function(h){var E=e.data&&e.data.repos?e.data.repos.total:0;if(!E)return 0;var N=[h];h==="expired"&&N.push("expiring"),h==="removed"&&N.push("removing"),h==="preparing"&&N.push("download");var R=0;return N.forEach(function(V){R+=e.statusCount(V)}),Math.max(.4,R/E*100)},e.errPct=function(h){if(!e.data||!e.data.errors)return 0;var E=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[h]/E*100};function g(h){var E=h||[];return E.map(function(N,R){var V=E[R-1]||{},H=Object.assign({},N);return H.dailyRepositories=R?Math.max(0,(N.nbRepositories||0)-(V.nbRepositories||0)):0,H.dailyUsers=R?Math.max(0,(N.nbUsers||0)-(V.nbUsers||0)):0,H.dailyPageViews=R?Math.max(0,(N.nbPageViews Line truncated
MIT CSAIL
jane.smith@example.org`},sq={id:"termsHelp",class:"form-text text-muted"},nq={class:"invalid-feedback"},rq={id:"settings-display",class:"paper-settings-section"},iq={class:"form-group paper-check-list"},aq={class:"form-check"},lq={class:"form-check-input",type:"checkbox",id:"link",name:"link"},dq={class:"form-check"},uq={class:"form-check-input",type:"checkbox",id:"image",name:"image"},cq={class:"form-check"},pq={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},fq={class:"form-check"},mq={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},hq={id:"settings-features",class:"paper-settings-section"},vq={class:"form-group paper-check-list"},gq={class:"form-check"},yq={class:"form-check-input",type:"checkbox",id:"page",name:"page"},bq={class:"form-check"},wq={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},kq={class:"form-check"},Eq={class:"form-check-input",type:"checkbox",id:"update",name:"update"},Cq={class:"form-group"},_q={class:"form-control",id:"mode",name:"mode"},Sq={class:"form-text text-muted"},Nq={id:"settings-expiration",class:"paper-settings-section"},Dq={class:"form-group"},Rq={class:"form-control",id:"expiration",name:"expiration"},Tq={key:0,class:"draft-status",role:"status"},Aq={key:1,class:"draft-status"},Oq={class:"paper-settings-footer"},Iq={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},Pq=["textContent"],Vq={class:"paper-settings-actions"},qq=["disabled"],Mq={key:0,class:"ui-icon mr-1","aria-hidden":"true"},Lq={id:"settings-account",class:"paper-settings-section"},$q={class:"paper-account-card"},Uq=["src"],Fq={class:"paper-account-identity"},zq={class:"paper-account-name"},Bq={class:"paper-danger-zone"},Hq={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},jq=["textContent"],Gq=["disabled"];function Ul(e,t){let s=Ge("quota-usage"),r=ye("paper-scrollspy"),n=ye("field"),i=ye("form");return l(),d("div",K5,[t[52]||(t[52]=ce('<div class="paper-crumbs"><a href="/dashboard">My work</a> \xA0/\xA0 <span class="here">Settings</span></div><h1 class="paper-page-title">Your <em>settings</em></h1><p class="paper-page-lede">Defaults applied to every new anonymization, your quotas, and your account.</p>',3)),o("div",Y5,[N((l(),d("aside",J5,[...t[4]||(t[4]=[ce('<div class="paper-settings-toc-head">On this page</div><nav><a href="#settings-quota">Quota</a><a href="#settings-terms">Terms to redact</a><a href="#settings-display">Display</a><a href="#settings-features">Features</a><a href="#settings-expiration">Expiration</a><a href="#settings-account">Account</a></nav>',2)])])),[[r]]),o("div",Q5,[p(" Account usage shares the dashboard component. "),o("section",X5,[t[6]||(t[6]=o("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[7]||(t[7]=o("p",{class:"paper-section-copy"},"What you are using across all your anonymizations. Conferences can lift these limits during a review window.",-1)),e.quota?(l(),$t(s,{key:0,quota:e.quota,fmt:e.fmt},null,8,["quota","fmt"])):p("v-if",!0),e.quota?p("v-if",!0):(l(),d("div",Z5,[(l(),d(Y,null,re([1,2,3],(a,c)=>o("div",x5,[...t[5]||(t[5]=[o("div",{class:"quota-header"},[o("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),o("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),o("div",{class:"quota-track"},null,-1)])])),64))]))]),N((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[2]||(t[2]=pe(a=>e.submitForm(a,()=>{e.saveDefault(a)}),["prevent"]))},[o("section",eq,[t[13]||(t[13]=o("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[14]||(t[14]=o("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),o("div",tq,[t[12]||(t[12]=o("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),N(o("textarea",oq,null,512),[[n,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),o("small",sq,[t[8]||(t[8]=b(" One term per line (regex allowed). Each match is replaced by ",-1)),o("code",null,u(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[9]||(t[9]=b(", or use ",-1)),t[10]||(t[10]=o("code",null,"term=>replacement",-1)),t[11]||(t[11]=b(" to pick your own. ",-1))]),N(o("div",nq," Terms are in an invalid format ",512),[[K,e.defaultsForm?.terms?.errors?.format]])])]),o("section",rq,[t[23]||(t[23]=o("div",{class:"paper-section-eyebrow"},"Display",-1)),t[24]||(t[24]=o("p",{class:"paper-section-copy"},"What reviewers can see inside an anonymized repository.",-1)),o("div",iq,[o("div",aq,[N(o("input",lq,null,512),[[n,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[15]||(t[15]=o("label",{class:"form-check-label",for:"link"},"Keep links",-1)),t[16]||(t[16]=o("small",{class:"form-text text-muted"},"Unchecked, every link in text files is removed.",-1))]),o("div",dq,[N(o("input",uq,null,512),[[n,{state:e.viewState,set:a=>{e.options.image=a},value:e.op Line truncated
`);for(let E=0;E<y.length;E++){let m=y[E];if(m.startsWith("diff --git")){v(),f();continue}if(m.startsWith("--- ")){i&&i.lines.length&&v(),f().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){f().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 C=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);C&&(a=parseInt(C[1],10),c=parseInt(C[2],10)),f().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}i&&(m.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:c,text:m.slice(1)}),c++):m.startsWith("-")?(i.lines.push({kind:"remove",oldNo:a,newNo:"",text:m.slice(1)}),a++):(i.lines.push({kind:"ctx",oldNo:a,newNo:c,text:m.startsWith(" ")?m.slice(1):m}),a++,c++))}}return s(n,i),n.join("")}})({trustAsHtml:e=>e});function i8(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function a8(e){return String(e??"").toUpperCase()}function l8(e,t,s=0){return(e||[]).slice(s,s+t)}function d8(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function u8(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((r,n)=>{for(let i of s){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let c=i.split(".").reduce((v,y)=>v?.[y],r),f=i.split(".").reduce((v,y)=>v?.[y],n);if(typeof c=="string"&&(c=c.toLowerCase()),typeof f=="string"&&(f=f.toLowerCase()),c!==f)return(c==null?-1:f==null?1:c<f?-1:1)*a}return 0})}function c8(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 r={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,n=>r[n])}function p8(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var Kl={name:"htmlDoc",props:["content","baseUrl","allowScripts"],setup(e){let t=xe(null);return Lt(()=>{let r=[t.value][0];r.classList.add("html-doc");function n(){r.innerHTML="";let i=e.content;if(typeof i!="string")return;let a=document.createElement("iframe");a.className="html-doc-frame",a.setAttribute("title","Rendered HTML document");let c=["allow-popups","allow-popups-to-escape-sandbox"];e.allowScripts&&c.push("allow-scripts","allow-forms","allow-modals"),a.setAttribute("sandbox",c.join(" ")),a.setAttribute("referrerpolicy","no-referrer"),r.appendChild(a);let f="";e.baseUrl&&(f='<base href="'+e.baseUrl.replace(/&/g,"&amp;").replace(/"/g,"&quot;")+'">'),a.srcdoc=f+i}Be(()=>e.content,n,{immediate:!0}),Be(()=>e.baseUrl,n,{immediate:!0}),Be(()=>e.allowScripts,n,{immediate:!0})}),()=>we("html-doc",{ref:t})}};var Yl={name:"pdfviewer",props:["src"],setup(e){let t=xe(null);return Lt(()=>{let s=[t.value],r=400,n=[.5,.75,1,1.25,1.5,2,3],i=1e3,a=s[0];a.classList.add("pdf-viewer");let c=null,f=[],v=!1,y=null,E=1,m=1,C=0,g=0,w=612/792,R=0,D=null,T=new Map,I=0;function z(h){let k=T.get(h);k&&(k.cancelled=!0,k.task?.cancel?.(),T.delete(h));let O=h.querySelector("canvas");O&&(O.width=0,O.height=0),h.innerHTML="",delete h.dataset.state}let P=document.createElement("div");P.className="pdf-toolbar";let q=document.createElement("div");q.className="pdf-pages",q.tabIndex=0,q.setAttribute("aria-label","PDF pages"),a.appendChild(P),a.appendChild(q);function ie(h,k,O){let F=document.createElement("button");return F.type="button",F.className="pdf-toolbar-btn",F.title=k,F.setAttribute("aria-label",k),F.innerHTML='<i class="fas '+h+'"></i>',F.addEventListener("click",O),F}let ae=ie("fa-chevron-up","Previous page",function(){Ce(m-1)}),S=ie("fa-chevron-down","Next page",function(){Ce(m+1)}),B=document.createElement("input");B.type="text",B.className="pdf-toolbar-page",B.setAttribute("aria-label","Page number"),B.title="Page number \u2014 type a page and press Enter",B.addEventListener("keydown",function(h){h.key==="Enter"&&(Ce(parseInt(B.value,10)),B.blur())}),B.addEventListener("blur",function(){B.value=String(m)});let te=document.createElement("span");te.className="pdf-toolbar-count";let fe=ie("fa-search-minus","Zoom out",function(){_(n[Math.max(0,oe()-1)])}),J=ie("fa-search-plus","Zoom in",function(){_(n[Math.min(n.length-1,oe()+1)])}),X=document.createElement("button");X.type="button",X.className="pdf-toolbar-btn pdf-toolbar-zoom",X.title="Reset zoom to fit the width",X.setAttribute("aria-label","Reset zoom to fit the width"),X.addEventListener("click",function(){_(1)}),P.appendChild(ae),P.appendChild(S);let Q=document.createElement("span");Q.className="pdf-toolbar-group",Q.appendChild(B),Q.ap Line truncated
jane.smith@example.org`},null,2),[[o,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"anonymize",options:{debounce:250}}]]),n("small",vS,[t[68]||(t[68]=y("One term per line (regex allowed). Replaced by ",-1)),n("code",null,u(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[69]||(t[69]=y(", or use ",-1)),t[70]||(t[70]=n("code",null,"term=>replacement",-1)),t[71]||(t[71]=y(" to pick your own (e.g. ",-1)),t[72]||(t[72]=n("code",null,"Anonymous=>ABC",-1)),t[73]||(t[73]=y(").",-1))]),D(n("div",yS,"Regex characters detected. Escape them if unintentional.",512),[[Q,e.termsRegexWarning]]),D(n("div",gS,"Terms are in an invalid format.",512),[[Q,e.anonymize?.terms?.errors?.format]])])],512),[[Q,e.detectedType]]),D(n("section",bS,[t[96]||(t[96]=n("div",{class:"paper-section-eyebrow"},"Display",-1)),D(n("div",null,[n("div",wS,[D(n("input",kS,null,512),[[o,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"anonymize",options:{}}]]),t[76]||(t[76]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",CS,[D(n("input",ES,null,512),[[o,{state:e.viewState,set:a=>{e.options.image=a},value:e.options?.image,form:"anonymize",options:{}}]]),t[77]||(t[77]=n("label",{class:"form-check-label",for:"image"},"Display images",-1)),t[78]||(t[78]=n("small",{class:"form-text text-muted"},"Images are served unchanged and may contain names or affiliations.",-1))]),n("div",SS,[D(n("input",NS,null,512),[[o,{state:e.viewState,set:a=>{e.options.pdf=a},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[79]||(t[79]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1)),t[80]||(t[80]=n("small",{class:"form-text text-muted"},[y("PDF contents and metadata are served unchanged. "),n("a",{href:"/faq#formats"},"About supported formats")],-1))]),n("div",_S,[D(n("input",DS,null,512),[[o,{state:e.viewState,set:a=>{e.options.notebook=a},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[81]||(t[81]=n("label",{class:"form-check-label",for:"notebook"},"Display Notebooks",-1))]),n("div",RS,[D(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,TS),[[o,{state:e.viewState,set:a=>{e.options.page=a},value:e.options?.page,form:"anonymize",options:{}}]]),t[82]||(t[82]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?p("v-if",!0):(l(),d("small",OS,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?(l(),d("small",AS,u(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):p("v-if",!0)])],512),[[Q,e.detectedType==="repo"]]),D(n("div",null,[n("div",IS,[D(n("input",PS,null,512),[[o,{state:e.viewState,set:a=>{e.options.title=a},value:e.options?.title,form:"anonymize",options:{}}]]),t[83]||(t[83]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",VS,[D(n("input",MS,null,512),[[o,{state:e.viewState,set:a=>{e.options.content=a},value:e.options?.content,form:"anonymize",options:{}}]]),t[84]||(t[84]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",qS,[D(n("input",LS,null,512),[[o,{state:e.viewState,set:a=>{e.options.comments=a},value:e.options?.comments,form:"anonymize",options:{}}]]),t[85]||(t[85]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",$S,[D(n("input",US,null,512),[[o,{state:e.viewState,set:a=>{e.options.username=a},value:e.options?.username,form:"anonymize",options:{}}]]),t[86]||(t[86]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",FS,[D(n("input",zS,null,512),[[o,{state:e.viewState,set:a=>{e.options.date=a},value:e.options?.date,form:"anonymize",options:{}}]]),t[87]||(t[87]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",HS,[D(n("input",BS,null,512),[[o,{state:e.viewState,set:a=>{e.options.origin=a},value:e.options?.origin,form:"anonymize",options:{}}]]),t[88]||(t[88]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[Q,e.detectedType==="gist"]]),D(n("div",null,[n("div",jS,[D(n("input",GS,null,512),[[o,{state:e.viewState,set:a=>{e.options.title=a},value:e.options?.title,form:"anonymize",options:{}}]]),t[89]||(t[89]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",WS,[D(n("input",KS,null,512),[[o,{state:e.viewState,set:a=>{e.options.body=a},value:e.options?.body,form:"anonymize",options:{}}]]),t[90]||(t[90]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n("div",YS,[D(n("input",JS,null,512),[[o,{state:e.viewState,set:a=>{e.options.diff=a},value:e.options?.diff,form:"anonymize",options:{}}]]),t[91]||(t[91]=n("label",{class:"form-check-label",for:"diff"},"Diff",-1))]),n("div",QS,[ Line truncated
anonymous_github`)])])])])]),p(" Limitations "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-warning"})]),y("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). ")])])])])]),p(" Privacy & Security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),y("Privacy & 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," Data stored on Anonymous GitHub is never shared or used for any purpose beyond providing the anonymization service. When a repository is removed or expires, only its configuration is retained \u2014 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,[y("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"),y(" 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. ")])])])]),p(" Self-Hosting "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#project-icon-storage"})]),y("Self-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",{class:"panel-body p-3"},[n("p",null,[y(" Yes. Anonymous Git Line truncated
anonymized repository often think it is about the paper, so the
label names the service and the tooltip says who to contact. `),t[13]||(t[13]=fe('<li class="nav-item d-none d-lg-block"><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"><svg class="ui-icon d-lg-none mr-1" aria-hidden="true"><use href="#ui-icon-bug"></use></svg>Report a bug </a></li><li class="nav-item nav-support-item d-none d-lg-block"><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"><svg class="ui-icon nav-heart" aria-hidden="true"><use href="#ui-icon-heart"></use></svg>Support </a></li>',2)),e.isDarkMode?p("v-if",!0):(l(),d("li",i5,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to dark mode","aria-label":"Switch to dark mode",onClick:t[0]||(t[0]=s=>{e.darkMode(!0)})},[...t[8]||(t[8]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",a5,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to light mode","aria-label":"Switch to light mode",onClick:t[1]||(t[1]=s=>{e.darkMode(!1)})},[...t[9]||(t[9]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),e.user?p("v-if",!0):(l(),d("li",l5,[...t[10]||(t[10]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),y(" Sign in ")],-1)])])),e.user?(l(),d("li",d5,[n("a",u5,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,c5)):p("v-if",!0),n("span",p5,u(e.user?.username),1)]),n("div",f5,[n("h6",m5,"Signed in as @"+u(e.user?.username),1),t[11]||(t[11]=fe('<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" 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><a class="dropdown-item" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support the project</span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg><span>Sign out</span></a>',9))])])):p("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,h5)):p("v-if",!0)],64)}var v5={class:"paper-landing"},y5={class:"paper-hero"},g5={class:"paper-hero-copy"},b5={class:"paper-cta-row"},w5={key:0,href:"/signin",target:"_self",class:"btn-hero"},k5={key:1,href:"/anonymize",class:"btn-hero"},C5={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},E5={class:"paper-stats-grid"},S5={class:"paper-stat-label"},N5={key:0,class:"paper-stat-delta"},_5={class:"demo paper-wrap","aria-label":"Try redaction"},D5={class:"demo-terms"},R5={class:"demo-panes"},T5={class:"pane"},O5={class:"demo-input-wrap"},A5={class:"pane-body demo-backdrop","aria-hidden":"true"},I5={key:0,class:"demo-match"},P5={class:"pane pane-after"},V5={class:"pane-header"},M5={class:"pane-url"},q5={class:"pane-body demo-output","aria-live":"polite"},L5=["title"],$5={class:"paper-features paper-wrap","aria-label":"Product features"},U5={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},F5=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],z5={class:"paper-eyebrow"},H5={class:"paper-feature-title"},B5={class:"paper-feature-more"},j5={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},G5=["href","target"],W5={class:"paper-features-stage"},K5=["id","aria-labelledby"],Y5={class:"paper-frame"},J5={class:"paper-frame-bar","aria-hidden":"true"}, Line truncated
python experiments/run.py`),n("p",null,[y("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),p(" Live stats "),n("section",C5,[t[9]||(t[9]=n("div",{class:"paper-stats-meta"},[n("div",{class:"paper-stats-meta-left"},[n("span",{class:"paper-stats-dot","aria-hidden":"true"}),y(" Live \xB7 last 60 days \xB7 updated daily")]),n("div",{class:"paper-stats-meta-right"},"Used by authors at ICSE \xB7 FSE \xB7 OOPSLA")],-1)),n("div",E5,[(l(!0),d(Y,null,ie(e.cards,(s,r)=>(l(),d("div",{class:"paper-stat-card",key:s?.key},[n("div",{class:T(["paper-stat-value",{"is-pending":!e.stat}])},u(e.stat?e.fmt?.bigNum(s?.total):"\u2014"),3),n("div",S5,u(s?.label),1),e.history[s?.key].bars?.length>1?(l(),d("div",N5," +"+u(e.fmt?.number(e.history[s?.key].deltaToday))+" today ",1)):p("v-if",!0)]))),128))])]),p(" Before / after "),t[25]||(t[25]=n("section",{class:"paper-section-head paper-wrap"},[n("div",null,[n("div",{class:"paper-eyebrow"},"Try it"),n("h2",null,[y("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",_5,[n("div",D5,[t[10]||(t[10]=n("label",{for:"demo-terms"},[y("Terms to redact "),n("span",null,"comma-separated, try adding your own")],-1)),D(n("input",{id:"demo-terms",type:"text","onUpdate:modelValue":t[0]||(t[0]=s=>e.demoTerms=s),spellcheck:"false",autocomplete:"off"},null,512),[[ps,e.demoTerms]])]),n("div",R5,[n("div",T5,[t[12]||(t[12]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},"Your repository"),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",O5,[n("div",A5,[(l(!0),d(Y,null,ie(e.demoParts(),(s,r)=>(l(),d(Y,{key:r},[s.redacted?(l(),d("mark",I5,u(s.original),1)):(l(),d(Y,{key:1},[y(u(s.text),1)],64))],64))),128)),t[11]||(t[11]=y("\u200B",-1))]),D(n("textarea",{class:"pane-body demo-input","onUpdate:modelValue":t[1]||(t[1]=s=>e.demoText=s),spellcheck:"false","aria-label":"Sample README to anonymize"},null,512),[[ps,e.demoText]])])]),n("div",P5,[n("div",V5,[t[13]||(t[13]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",M5,u(e.demoCount())+" redacted \xB7 anonymous.4open.science/r/paper-7f2a",1)]),n("div",q5,[(l(!0),d(Y,null,ie(e.demoParts(),(s,r)=>(l(),d(Y,{key:r},[s.redacted?(l(),d("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+s.original+"\u201D"},u(s.text),9,L5)):(l(),d(Y,{key:1},[y(u(s.text),1)],64))],64))),128))])])])]),p(" What you get: one screenshot, three tabs "),t[26]||(t[26]=n("section",{class:"paper-section-head paper-wrap",id:"about"},[n("div",null,[n("div",{class:"paper-eyebrow"},"What you get"),n("h2",null,[y("Anonymize, review, "),n("em",null,"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",$5,[n("div",U5,[(l(!0),d(Y,null,ie(e.features,(s,r)=>(l(),d("div",{class:T(["paper-feature",{"is-on":e.feature===s?.key}]),key:s?.key},[n("button",{type:"button",class:"paper-feature-tab",role:"tab",onClick:o=>e.selectFeature(s.key),onKeydown:o=>e.featureKeydown(o,r),id:"feature-tab-"+s?.key,"aria-controls":"feature-panel-"+s?.key,"aria-selected":e.feature===s?.key,tabindex:e.feature===s?.key?0:-1},[n("span",z5,u(s?.num)+" \xB7 "+u(s?.eyebrow),1),n("span",H5,[y(u(s?.title)+" ",1),n("em",null,u(s?.accent),1)])],40,F5),n("div",B5,[n("span",j5,[y(u(s?.title)+" ",1),n("em",null,u(s?.accent),1)]),n("p",null,u(s?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(s)),target:e.featureTarget(s)},u(s?.cta)+" \u2192",9,G5)])],2))),128))]),n("div",W5,[(l(!0),d(Y,null,ie(e.features,(s,r)=>D((l(),d("div",{class:"paper-feature-panel",role:"tabpanel",key:s?.key,id:"feature-panel-"+s?.key,"aria-labelledby":"feature-tab-"+s?.key},[n("div",Y5,[n("div",J5,[t[14]||(t[14]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",Q5,u(s?.url),1)]),n("div",{class:T(["feat-mock","is-"+s?.key]),role:"img","aria-label":s?.alt},[s?.key==="anonymize"?(l(),d("div",Z5,[...t[15]||(t[15]=[fe('<div class="fm-label">GitHub repository</div><div class="fm-input">github.com/jane-smith/DeepLearnUtils</div><div class="fm-label">Terms to redact</div><div class="fm-chips"><span>Jane Smith</span><span>MIT CSAIL</span><span>jane.smith@mit.edu</span><span class="fm-chip-add">+ Add term</span></div><div class="fm-row"><div><div class="fm-label">Reviewers can see</div><div class="fm-toggles"><span class="is-on">Images</span><span class="is-on">PDFs</span><span>Links</span><span class="is-on">Notebooks</span></div></div><div><div class="fm-label">Expires</div><div class="fm-input fm-input-sm">Mar 31, 2027</div></div></div><div class="fm-actions"><span class="fm-share">anonymous.4open.science/r/paper-7 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
<span class="ln">5</span>
<span class="ln">6</span><span class="k">def</span> <span class="f">train</span>(config):
<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">&quot;epoch %d: %.3f&quot;</span>, epoch, loss)</pre></div>`,2)])])):(l(),d("div",eP,[...t[17]||(t[17]=[fe('<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,X5)])],8,K5)),[[Q,e.feature===s?.key]])),128))])]),p(" FAQ teaser "),t[27]||(t[27]=fe('<section class="paper-qa paper-wrap" aria-labelledby="qa-heading"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that <em>come up most.</em></h2><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div><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>',1)),n("footer",tP,[n("div",nP,[t[21]||(t[21]=n("div",{class:"paper-footer-brand"},[n("div",{class:"paper-footer-mark"},[y("Anonymous "),n("em",null,"GitHub")]),n("p",{class:"paper-footer-tag"}," A read-only, identity-stripped mirror of your repository, built for double-anonymous peer review. ")],-1)),n("div",sP,[t[18]||(t[18]=n("div",{class:"paper-footer-head"},"Product",-1)),t[19]||(t[19]=n("a",{href:"/anonymize"},"Anonymize",-1)),e.user?(l(),d("a",oP,"My work")):p("v-if",!0),e.user?(l(),d("a",rP,"Conferences")):p("v-if",!0),t[20]||(t[20]=n("a",{href:"/faq"},"FAQ",-1))]),t[22]||(t[22]=fe('<div class="paper-footer-col"><div class="paper-footer-head">Project</div><a href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener">Source code</a><a href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener">Report a bug</a><a href="https://github.com/sponsors/tdurieux/" target="_blank" rel="noopener">Support</a></div><div class="paper-footer-col"><div class="paper-footer-head">Contact</div><a href="mailto:tdurieux@anonymous.4open.science">Email maintainer</a><a href="https://github.com/tdurieux" target="_blank" rel="noopener">@tdurieux</a></div>',2))]),t[24]||(t[24]=n("div",{class:"paper-footer-rule"},null,-1)),n("div",iP,[n("span",null,"\xA9 "+u(e.year||2026)+" Anonymous GitHub \xB7 GPL-3.0 licensed",1),t[23]||(t[23]=n("span",{class:"paper-footer-meta"},"Built for reviewers, by researchers.",-1))])])])}var aP={class:"paper-empty"},lP={class:"paper-empty-inner"},dP={key:0,class:"paper-eyebrow"},uP={key:1,class:"paper-eyebrow"},cP={key:2,class:"paper-empty-title"},pP=["textContent"];function Ml(e,t){return l(),d("div",aP,[n("div",lP,[e.error?p("v-if",!0):(l(),d("div",dP,"Working")),e.error?(l(),d("div",uP,"Error")):p("v-if",!0),e.error?p("v-if",!0):(l(),d("h1",cP,[...t[0]||(t[0]=[y(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(l(),d("h1",{key:3,class:"paper-empty-title",textContent:u(e.fmt.translate(e.error))},null,8,pP)):p("v-if",!0)])])}var fP={class:"container paper-page paper-settings"},mP={class:"paper-crumbs"},hP={class:"here"},vP={class:"paper-page-title"},yP={class:"paper-settings-body"},gP={class:"paper-settings-toc"},bP={href:"#conf-billing"},wP={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},kP={id:"conf-basics",class:"paper-settings-section"},CP={class:"form-group"},EP={class:"invalid-feedback"},SP={class:"invalid-feedback"},NP={class:"form-group"},_P={class:"invalid-feedback"},DP={class:"form-group"},RP={class:"invalid-feedback"},TP={class:"invalid-feedback"},OP={id:"conf-window",class:"paper-settings-section"},AP={class:"form-grid-2"},IP={class:"form-group"},PP={class:"invalid-feedback"},VP={class:"invalid-feedback"},MP={class:"form-group"},qP={class:"invalid-feedback"},LP={class:"invalid-feedback"},$P={Line truncated
`).length))+" lines",1)):p("v-if",!0),e.type=="html"&&e.fileSize(e.filePath)!=null?(l(),d("span",PV,u(e.formatSize(e.fileSize(e.filePath))),1)):p("v-if",!0),e.redactionCount()?(l(),d("b",VV,u(e.redactionCount())+" redacted",1)):p("v-if",!0)]),D(n("button",{type:"button",class:"btn btn-sm btn-icon-only btn-ghost copy-path-btn","aria-label":e.pathCopied?"Path copied":"Copy path",title:e.pathCopied?"Path copied":"Copy path",onClick:t[2]||(t[2]=a=>e.copyPath())},[(l(),d("svg",qV,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,LV)]))],8,MV),[[Q,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(l(),d("span",$V,[e.languageName?(l(),d(Y,{key:0},[y(u(e.languageName),1),t[31]||(t[31]=n("span",{class:"sep"},"\xB7",-1))],64)):p("v-if",!0),y(u(e.fmt?.number(e.content.split(`
`).length))+" lines",1),n("span",UV,[t[32]||(t[32]=n("span",{class:"sep"},"\xB7",-1)),y(u(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),e.redactionCount()?(l(),d(Y,{key:1},[t[33]||(t[33]=n("span",{class:"sep"},"\xB7",-1)),n("span",FV,u(e.redactionCount())+" redacted",1)],64)):p("v-if",!0)])):p("v-if",!0),e.type=="html"?(l(),d("span",zV,[t[36]||(t[36]=y("Markdown",-1)),e.fileSize(e.filePath)!=null?(l(),d(Y,{key:0},[t[34]||(t[34]=n("span",{class:"sep"},"\xB7",-1)),y(u(e.formatSize(e.fileSize(e.filePath))),1)],64)):p("v-if",!0),e.redactionCount()?(l(),d(Y,{key:1},[t[35]||(t[35]=n("span",{class:"sep"},"\xB7",-1)),n("span",HV,u(e.redactionCount())+" redacted",1)],64)):p("v-if",!0)])):p("v-if",!0),n("div",BV,[e.type!="html"&&e.symbols().length>1?(l(),d("div",jV,[n("button",{type:"button",class:T(["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[3]||(t[3]=a=>e.symbolsOpen=!e.symbolsOpen)},[...t[37]||(t[37]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,GV),e.symbolsOpen?(l(),d("div",WV,[n("div",KV,u(e.symbols().length)+" "+u(e.symbols().length===1?"symbol":"symbols"),1),(l(!0),d(Y,null,ie(e.symbols(),a=>(l(),d("button",{type:"button",class:"symbols-item",role:"menuitem",key:a.line+a.name,onClick:c=>e.goToSymbol(a.line)},[n("span",{class:T(["symbols-kind","is-"+a.kind])},u(a.kind==="class"?"C":a.kind==="function"?"\u0192":"v"),3),n("span",JV,u(a.name),1),n("span",QV,u(a.line),1)],8,YV))),128))])):p("v-if",!0)])):p("v-if",!0),e.type=="html"?(l(),d("button",{key:1,type:"button",class:T(["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[4]||(t[4]=a=>e.toggleMdFind())},[...t[38]||(t[38]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,XV)):p("v-if",!0),e.type!="html"?(l(),d("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[5]||(t[5]=a=>e.findInFile())},[...t[39]||(t[39]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,ZV)):p("v-if",!0),e.type!="html"?(l(),d("button",{key:3,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[6]||(t[6]=a=>e.gotoLine())},[...t[40]||(t[40]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,xV)):p("v-if",!0),e.type!="html"?(l(),d("button",{key:4,type:"button",class:T(["btn btn-sm btn-icon-only btn-ghost btn-toggle",{"is-on":e.wrapLines}]),"aria-pressed":e.wrapLines?"true":"false","aria-label":"Wrap long lines",title:"Wrap long lines (Alt+Z)",onClick:t[7]||(t[7]=a=>e.toggleWrap())},[...t[41]||(t[41]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,eM)):p("v-if",!0),n("div",tM,[n("a",{target:"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,nM),typeof e.content=="string"?(l(),d("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[8]||(t[8]=a=>e.copyContent())},[(l(),d("svg",oM,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,rM)]))],8,sM)):p("v-if",!0),n("a",{target:"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.url+"&download=true")},[...t[42]||(t[42]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,iM)]),typeof e.content=="string"?(l(),d("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[9]||(t[9]=a=>e.copyContent())},[(l(),d("svg",lM,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,dM)]))],8,aM)):p("v-if",!0),n("div",uM,[n("button",{type:"button",class:T(["btn btn-sm btn-icon-only btn-ghost tb-more-btn",{"is-on":e.moreOpen}]),"aria-label":"More actions","aria-haspopup":"true","aria-expanded":e.moreOpen?"true":"false",onClick:t[10]||(t[10]=ue(a=>e.moreOpen=!e.moreOpen,["stop"]))},[(l(),d("svg",pM,[...t[43]||(t[43]=[n("circle",{cx:"5",cy:"12",r:"1.8"},null,-1),n("circle",{cx:"12",cy:"12",r:"1.8"},null,-1),n("circle",{cx:"19",cy:"12",r:"1.8"},null,-1)])]))],10,cM),e.moreOpen?(l(),d("div",{key:0,class:"tb-menu",role:"menu",onClick:t[16]||(t[16]=a=>e.moreOpen=!1)},[e.options?.publishedAt||e.options?.sourceCommitDate||e.options?.anonymizedAt||e.options?.last Line truncated
MIT CSAIL
jane.smith@example.org`},hq={id:"termsHelp",class:"form-text text-muted"},vq={class:"invalid-feedback"},yq={id:"settings-display",class:"paper-settings-section"},gq={class:"form-group paper-check-list"},bq={class:"form-check"},wq={class:"form-check-input",type:"checkbox",id:"link",name:"link"},kq={class:"form-check"},Cq={class:"form-check-input",type:"checkbox",id:"image",name:"image"},Eq={class:"form-check"},Sq={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},Nq={class:"form-check"},_q={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},Dq={id:"settings-features",class:"paper-settings-section"},Rq={class:"form-group paper-check-list"},Tq={class:"form-check"},Oq={class:"form-check-input",type:"checkbox",id:"page",name:"page"},Aq={class:"form-check"},Iq={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},Pq={class:"form-check"},Vq={class:"form-check-input",type:"checkbox",id:"update",name:"update"},Mq={class:"form-group"},qq={class:"form-control",id:"mode",name:"mode"},Lq={class:"form-text text-muted"},$q={id:"settings-expiration",class:"paper-settings-section"},Uq={class:"form-group"},Fq={class:"form-control",id:"expiration",name:"expiration"},zq={key:0,class:"draft-status",role:"status"},Hq={key:1,class:"draft-status"},Bq={class:"paper-settings-footer"},jq={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},Gq=["textContent"],Wq={class:"paper-settings-actions"},Kq=["disabled"],Yq={key:0,class:"ui-icon mr-1","aria-hidden":"true"},Jq={id:"settings-account",class:"paper-settings-section"},Qq={class:"paper-account-card"},Xq=["src"],Zq={class:"paper-account-identity"},xq={class:"paper-account-name"},e6={class:"paper-danger-zone"},t6={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},n6=["textContent"],s6=["disabled"];function Ul(e,t){let s=Ge("quota-usage"),r=Ee("paper-scrollspy"),o=Ee("field"),i=Ee("form");return l(),d("div",rq,[t[52]||(t[52]=fe('<div class="paper-crumbs"><a href="/dashboard">My work</a> \xA0/\xA0 <span class="here">Settings</span></div><h1 class="paper-page-title">Your <em>settings</em></h1><p class="paper-page-lede">Defaults applied to every new anonymization, your quotas, and your account.</p>',3)),n("div",iq,[D((l(),d("aside",aq,[...t[4]||(t[4]=[fe('<div class="paper-settings-toc-head">On this page</div><nav><a href="#settings-quota">Quota</a><a href="#settings-terms">Terms to redact</a><a href="#settings-display">Display</a><a href="#settings-features">Features</a><a href="#settings-expiration">Expiration</a><a href="#settings-account">Account</a></nav>',2)])])),[[r]]),n("div",lq,[p(" Account usage shares the dashboard component. "),n("section",dq,[t[6]||(t[6]=n("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[7]||(t[7]=n("p",{class:"paper-section-copy"},"What you are using across all your anonymizations. Conferences can lift these limits during a review window.",-1)),e.quota?(l(),Ut(s,{key:0,quota:e.quota,fmt:e.fmt},null,8,["quota","fmt"])):p("v-if",!0),e.quota?p("v-if",!0):(l(),d("div",uq,[(l(),d(Y,null,ie([1,2,3],(a,c)=>n("div",cq,[...t[5]||(t[5]=[n("div",{class:"quota-header"},[n("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),n("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),n("div",{class:"quota-track"},null,-1)])])),64))]))]),D((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[2]||(t[2]=ue(a=>e.submitForm(a,()=>{e.saveDefault(a)}),["prevent"]))},[n("section",pq,[t[13]||(t[13]=n("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[14]||(t[14]=n("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),n("div",fq,[t[12]||(t[12]=n("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),D(n("textarea",mq,null,512),[[o,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("small",hq,[t[8]||(t[8]=y(" One term per line (regex allowed). Each match is replaced by ",-1)),n("code",null,u(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[9]||(t[9]=y(", or use ",-1)),t[10]||(t[10]=n("code",null,"term=>replacement",-1)),t[11]||(t[11]=y(" to pick your own. ",-1))]),D(n("div",vq," Terms are in an invalid format ",512),[[Q,e.defaultsForm?.terms?.errors?.format]])])]),n("section",yq,[t[23]||(t[23]=n("div",{class:"paper-section-eyebrow"},"Display",-1)),t[24]||(t[24]=n("p",{class:"paper-section-copy"},"What reviewers can see inside an anonymized repository.",-1)),n("div",gq,[n("div",bq,[D(n("input",wq,null,512),[[o,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[15]||(t[15]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1)),t[16]||(t[16]=n("small",{class:"form-text text-muted"},"Unchecked, every link in text files is removed.",-1))]),n("div",kq,[D(n("input",Cq,null,512),[[o,{state:e.viewState,set:a=>{e.options.image=a},value:e.op Line truncated
`);for(let k=0;k<b.length;k++){let m=b[k];if(m.startsWith("diff --git")){g(),f();continue}if(m.startsWith("--- ")){i&&i.lines.length&&g(),f().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){f().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 C=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);C&&(a=parseInt(C[1],10),c=parseInt(C[2],10)),f().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}i&&(m.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:c,text:m.slice(1)}),c++):m.startsWith("-")?(i.lines.push({kind:"remove",oldNo:a,newNo:"",text:m.slice(1)}),a++):(i.lines.push({kind:"ctx",oldNo:a,newNo:c,text:m.startsWith(" ")?m.slice(1):m}),a++,c++))}}return s(o,i),o.join("")}})({trustAsHtml:e=>e});function gL(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function bL(e){return String(e??"").toUpperCase()}function wL(e,t,s=0){return(e||[]).slice(s,s+t)}function kL(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function CL(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((r,o)=>{for(let i of s){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let c=i.split(".").reduce((g,b)=>g?.[b],r),f=i.split(".").reduce((g,b)=>g?.[b],o);if(typeof c=="string"&&(c=c.toLowerCase()),typeof f=="string"&&(f=f.toLowerCase()),c!==f)return(c==null?-1:f==null?1:c<f?-1:1)*a}return 0})}function EL(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 r={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=>r[o])}function SL(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var Kl={name:"htmlDoc",props:["content","baseUrl","allowScripts"],setup(e){let t=et(null);return $t(()=>{let r=[t.value][0];r.classList.add("html-doc");function o(){r.innerHTML="";let i=e.content;if(typeof i!="string")return;let a=document.createElement("iframe");a.className="html-doc-frame",a.setAttribute("title","Rendered HTML document");let c=["allow-popups","allow-popups-to-escape-sandbox"];e.allowScripts&&c.push("allow-scripts","allow-forms","allow-modals"),a.setAttribute("sandbox",c.join(" ")),a.setAttribute("referrerpolicy","no-referrer"),r.appendChild(a);let f="";e.baseUrl&&(f='<base href="'+e.baseUrl.replace(/&/g,"&amp;").replace(/"/g,"&quot;")+'">'),a.srcdoc=f+i}He(()=>e.content,o,{immediate:!0}),He(()=>e.baseUrl,o,{immediate:!0}),He(()=>e.allowScripts,o,{immediate:!0})}),()=>De("html-doc",{ref:t})}};var Yl={name:"pdfviewer",props:["src"],setup(e){let t=et(null);return $t(()=>{let s=[t.value],r=400,o=[.5,.75,1,1.25,1.5,2,3],i=1e3,a=s[0];a.classList.add("pdf-viewer");let c=null,f=[],g=!1,b=null,k=1,m=1,C=0,A=0,h=612/792,E=0,N=null,R=new Map,V=0;function H(v){let w=R.get(v);w&&(w.cancelled=!0,w.task?.cancel?.(),R.delete(v));let O=v.querySelector("canvas");O&&(O.width=0,O.height=0),v.innerHTML="",delete v.dataset.state}let q=document.createElement("div");q.className="pdf-toolbar";let z=document.createElement("div");z.className="pdf-pages",z.tabIndex=0,z.setAttribute("aria-label","PDF pages"),a.appendChild(q),a.appendChild(z);function Z(v,w,O){let P=document.createElement("button");return P.type="button",P.className="pdf-toolbar-btn",P.title=w,P.setAttribute("aria-label",w),P.innerHTML='<i class="fas '+v+'"></i>',P.addEventListener("click",O),P}let ae=Z("fa-chevron-up","Previous page",function(){L(m-1)}),_=Z("fa-chevron-down","Next page",function(){L(m+1)}),j=document.createElement("input");j.type="text",j.className="pdf-toolbar-page",j.setAttribute("aria-label","Page number"),j.title="Page number \u2014 type a page and press Enter",j.addEventListener("keydown",function(v){v.key==="Enter"&&(L(parseInt(j.value,10)),j.blur())}),j.addEventListener("blur",function(){j.value=String(m)});let ne=document.createElement("span");ne.className="pdf-toolbar-count";let le=Z("fa-search-minus","Zoom out",function(){S(o[Math.max(0,Se()-1)])}),Ce=Z("fa-search-plus","Zoom in",function(){S(o[Math.min(o.length-1,Se()+1)])}),ce=document.createElement("button");ce.type="button",ce.className="pdf-toolbar-btn pdf-toolbar-zoom",ce.title="Reset zoom to fit the width",ce.setAttribute("aria-label","Reset zoom to fit the width"),ce.addEventListener("click",function(){S(1)}),q.appendChild(ae),q.appendChild(_);let ve=document.createElement("span");ve.className="pdf-toolbar-group",ve.appendChild(j),ve Line truncated
/*! Bundled license information:
@vue/shared/dist/shared.esm-bundler.js:
+2 -2
View File
@@ -73,7 +73,7 @@ describe("dashboard UI", function () {
describe("humanTime filter", function () {
it("spells the month for dates older than two days", function () {
const out = filters.humanTime()("2024-03-09T12:00:00Z");
expect(out).to.match(/^on /);
expect(out).to.not.match(/^on /);
expect(out).to.match(/Mar/);
expect(out).to.not.match(/\d+\/\d+\/\d+/);
});
@@ -93,7 +93,7 @@ describe("dashboard UI", function () {
expect(divider).to.be.greaterThan(-1);
});
it("labels hidden statuses as hidden, not as active filters", function () {
expect(html).to.match(/\{\{\s*statusKeyLabels\[f\]\s*\}\} hidden/);
expect(html).to.match(/Hiding \{\{\s*\(statusKeyLabels\[f\] \|\| ''\)\.toLowerCase\(\)\s*\}\}/);
});
it("shows an unlimited quota without a full bar", function () {
const quota = fs.readFileSync(path.join(__dirname, "../public/partials/quotaUsage.htm"), "utf8");
+2 -2
View File
@@ -11,9 +11,9 @@ function harness(date) {
const context = { reactive: value => value, console, Map, Set, Date: date || Date,
formDraft: state => ({ restore: () => false, clear() {}, discard() {}, checkpoint: () => ({ terms: state.terms, options: state.options }), accept() {} }),
navigator: { platform: "Linux" }, document: { location: { pathname: "/r/repo" }, addEventListener() {}, querySelector() {} },
window: {}, Prism: { highlightAll() {} }, encodeURIComponent,
window: { addEventListener() {}, removeEventListener() {} }, Prism: { highlightAll() {} }, encodeURIComponent,
encodePathForUrl: p => p.split("/").map(encodeURIComponent).join("/"),
humanFileSize: x => String(x), parseGithubUrl: () => ({ owner: "owner", repo: "repo" }),
humanFileSize: x => String(x), loadEditor: async () => {}, parseGithubUrl: () => ({ owner: "owner", repo: "repo" }),
$: () => ({ on() {}, tooltip() {} }),
setTimeout: fn => { timers.set(++timerId, fn); return timerId; },
clearTimeout: id => timers.delete(id), setInterval: () => 0, clearInterval() {},
+9 -11
View File
@@ -781,7 +781,7 @@ describe("Vue 3 UI", function () {
ui = await browser("/connections", {
"/api/user": { username: "owner" },
"/github/connections": { csrf: "csrf-value", appEnabled: true, appConnected: true, oauthEnabled: true, oauthConnected: connection === "oauth",
installations: [{ id: 4, account: "owner" }], gistCount: 0, resources: [resource] },
installations: [{ id: 4, account: "owner" }, { id: 5, account: "org" }], gistCount: 0, resources: [resource] },
"/github/connections/migrate": request => request.payload.preview ? { eligible: true } : { connection: "github-app" },
});
const button = label => [...ui.window.document.querySelectorAll("button")].find(node => node.textContent.includes(label));
@@ -1048,21 +1048,19 @@ describe("Vue 3 UI", function () {
"/api/repo/test/options": { anonymizedAt: "2026-01-01T00:00:00Z", sourceCommitDate: "2020-01-01T00:00:00Z",
settingsSavedAt: "2026-02-01T00:00:00Z", publishedAt: "2026-03-01T00:00:00Z" },
});
const footer = ui.window.document.querySelector(".leftCol-foot");
expect(footer.textContent).to.include("Source commit").and.include("Settings saved").and.include("Snapshot ready");
expect([...footer.querySelectorAll(".last-update")].map(node => node.title)).to.deep.equal([
"2020-01-01T00:00:00Z", "2026-02-01T00:00:00Z", "2026-03-01T00:00:00Z",
]);
expect(footer.textContent).not.to.include("not recorded");
const snapshot = ui.window.document.querySelector(".vb-snapshot");
expect(snapshot.textContent).to.include("Mar 1, 2026");
expect(snapshot.title).to.include("Source commit").and.include("snapshot ready");
expect(snapshot.title).not.to.include("no recorded publication date");
expect(ui.errors).to.deep.equal([]);
});
it("identifies an unknown legacy publication date", async function () {
ui = await browser("/r/test/hello.txt", {
"/api/repo/test/options": { anonymizedAt: "2026-01-01T00:00:00Z", sourceCommitDate: "2020-01-01T00:00:00Z" },
});
const footer = ui.window.document.querySelector(".leftCol-foot");
expect(footer.textContent).to.include("Snapshot ready date not recorded");
expect(footer.textContent).not.to.include("Settings saved");
const snapshot = ui.window.document.querySelector(".vb-snapshot");
expect(snapshot.title).to.include("no recorded publication date");
expect(snapshot.textContent).not.to.include("Settings saved");
expect(ui.errors).to.deep.equal([]);
});
@@ -1372,7 +1370,7 @@ describe("Vue 3 UI", function () {
await delay(10);
expect(state.filteredItems.map(item => item._id).sort()).to.deep.equal(["error", "stalled"]);
expect(ui.window.document.querySelector('[href="/anonymize/error"]').textContent).to.equal("Fix source");
expect(ui.window.document.querySelector(".filter-chip")?.textContent).not.to.include("Error hidden");
expect(ui.window.document.querySelector(".filter-chip")?.textContent ?? "").not.to.include("Hiding error");
await ui.input("#search", "stalled");
expect(state.filteredItems).to.have.length(1);
state.clearFilters(); await delay(10);