diff --git a/build/github-defreshed-simplified.user.js b/build/github-defreshed-simplified.user.js index 4078a2d..e2b0422 100644 --- a/build/github-defreshed-simplified.user.js +++ b/build/github-defreshed-simplified.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name GitHub Defreshed // @namespace GitHub -// @version 1.4.0 +// @version 1.4.5 // @author Kir_Antipov // @description Make GitHub Great Again! // @license MIT @@ -13,4 +13,4 @@ // @run-at document-start // @grant none // ==/UserScript== -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";const n=r(1),a=r(2);t.all=n,t.check=e=>(e=(e||"").toString().toLowerCase(),n.includes(e)),t.oddballs=e=>e&&e in a?a[e]:Object.keys(a).sort()},function(e){e.exports=JSON.parse('["400","401","402","403","404","405","406","407","408","409","410","411","412","413","414","415","416","417","418","419","420","421","422","423","424","425","426","427","428","429","430","431","500","501","502","503","504","505","506","507","508","509","510","511","about","access","account","admin","anonymous","any","api","apps","attributes","auth","billing","blob","blog","bounty","branches","business","businesses","c","cache","case-studies","categories","central","certification","changelog","cla","cloud","codereview","collection","collections","comments","commit","commits","community","companies","compare","contact","contributing","cookbook","coupons","customer","customers","dashboard","dashboards","design","develop","developer","diff","discover","discussions","docs","downloads","downtime","editor","editors","edu","enterprise","events","explore","featured","features","files","fixtures","forked","garage","ghost","gist","gists","graphs","guide","guides","help","help-wanted","home","hooks","hosting","hovercards","identity","images","inbox","individual","info","integration","interfaces","introduction","invalid-email-address","investors","issues","jobs","join","journal","journals","lab","labs","languages","launch","layouts","learn","legal","library","linux","listings","lists","login","logos","logout","mac","maintenance","malware","man","marketplace","mention","mentioned","mentioning","mentions","migrating","milestones","mine","mirrors","mobile","navigation","network","new","news","none","nonprofit","nonprofits","notices","notifications","oauth","offer","open-source","organisations","organizations","orgs","pages","partners","payments","personal","plans","plugins","popular","popularity","posts","press","pricing","professional","projects","pulls","raw","readme","recommendations","redeem","releases","render","reply","repositories","resources","restore","revert","save-net-neutrality","saved","scraping","search","security","services","sessions","settings","shareholders","shop","showcases","signin","signup","site","spam","sponsors","ssh","staff","starred","stars","static","status","statuses","storage","store","stories","styleguide","subscriptions","suggest","suggestion","suggestions","support","suspended","talks","teach","teacher","teachers","teaching","teams","ten","terms","timeline","topic","topics","tos","tour","train","training","translations","tree","trending","updates","username","users","visualization","w","watching","wiki","windows","works-with","www0","www1","www2","www3","www4","www5","www6","www7","www8","www9"]')},function(e){e.exports=JSON.parse('{"avatars":{"reserved":true,"taken":true,"typical":true,"included":false},"assets":{"reserved":true,"taken":true,"typical":true,"included":false},"bookmarks":{"reserved":true,"taken":true,"typical":true,"included":false},"checks":{"reserved":true,"taken":true,"typical":true,"included":false},"conversations":{"reserved":true,"taken":true,"typical":true,"included":false},"labels":{"reserved":true,"taken":true,"typical":true,"included":false},"media":{"reserved":true,"taken":true,"typical":true,"included":false},"nodes":{"reserved":true,"taken":true,"typical":true,"included":false},"owners":{"reserved":true,"taken":true,"typical":true,"included":false},"page":{"reserved":true,"taken":true,"typical":true,"included":false},"registry":{"reserved":true,"taken":true,"typical":true,"included":false},"seats":{"reserved":true,"taken":true,"typical":true,"included":false},"shared":{"reserved":true,"taken":true,"typical":true,"included":false},"tasks":{"reserved":true,"taken":true,"typical":true,"included":false},"uploads":{"reserved":true,"taken":true,"typical":true,"included":false},"account":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"apps":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/marketplace","included":true},"blog":{"reserved":true,"taken":false,"typical":false,"redirect":"https://blog.github.com","included":true},"c":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/contact","included":true},"contributing":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/careers","included":true},"customer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"customers":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"developer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://developer.github.com","included":true},"edu":{"reserved":true,"taken":false,"typical":false,"redirect":"https://education.github.com","included":true},"guides":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"help":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"launch":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/search","included":true},"mac":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"mirrors":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/about-github-mirrors/","included":true},"pages":{"reserved":true,"taken":false,"typical":false,"redirect":"https://pages.github.com","included":true},"plans":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/pricing","included":true},"press":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/press","included":true},"readme":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/about","included":true},"repositories":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/trending","included":true},"resources":{"reserved":true,"taken":false,"typical":false,"redirect":"https://resources.github.com","included":true},"security":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-security/","included":true},"settings":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"signup":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/join","included":true},"terms":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"topic":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/topics","included":true},"tos":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"training":{"reserved":true,"taken":false,"typical":false,"redirect":"https://services.github.com","included":true},"users":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"wiki":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"windows":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"collections":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"Curated lists of GitHub repos"},"hovercards":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"HTTP ERROR 406"},"inbox":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/410","included":true,"notes":"410 ERROR"},"invalid-email-address":{"reserved":true,"taken":true,"typical":false,"included":true,"notes":"HTTP ERROR 404"},"suggestions":{"reserved":true,"taken":false,"typical":false,"included":true},"suspended":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com","included":true,"notes":"Page behaviour depends on whether you\'re logged in or if your account is actually suspended"},"case-studies":{"reserved":false,"taken":true,"typical":false,"included":true},"watching":{"reserved":false,"taken":true,"typical":false,"included":true},"save-net-neutrality":{"reserved":false,"taken":true,"typical":false,"included":true},"ghost":{"reserved":false,"taken":true,"typical":true,"included":true},"status":{"reserved":true,"taken":false,"typical":false,"included":true}}')},function(e,t,r){"use strict";r.r(t);var n=r(0);function a(e=location.pathname){try{e=new URL(e).pathname}catch(e){}return e.replace(/^[/]|[/]$/g,"")}function i(e=location.pathname){return l(e=a(e))?e.split("/",2).join("/"):null}function s(e=location.pathname){if(!l(e=a(e)))return null;let t=e.match(/^[^/]+[/][^/]+[/]?(.*)$/);return t?t[1]:null}function l(e=location.pathname){let t=(e=a(e)).substring(0,e.indexOf("/"));return/^[^/]+\/[^/]+/.test(e)&&!Object(n.check)(t)&&!function(e=location.pathname){return/^((orgs[/][^/]+[/])?dashboard([/]index[/]\d+)?)?$/.test(a(e))}(e)&&!function(e=location.pathname){return/^([^/]+[/][^/]+\/)?notifications/.test(a(e))}(e)}function o(e=location.pathname){return/^(tree[/][^/]+)?$/.test(s(e))}function c(e=location.pathname){return/^tree\//.test(s(e))}function u(e=location.pathname){return/^projects\/\d+$/.test(s(e))}function d(e=location.pathname){return/#[^\/]*$/.test(e)}function p(e,t){try{return new URL(e).host==t}catch(e){return!1}}function m(e=location.pathname,t=location.host,r=location.protocol){return function(e){try{return new URL(e),!0}catch(e){return!1}}(e)?e:`${r}//${t}/${e=a(e)}`}function h(e=window.location.href){return p(e,"github.com")}function f(e,t){if(e instanceof HTMLElement&&(function(e){return!!e&&"function"==typeof e[Symbol.iterator]}(t.children)&&(e.append(...t.children),delete t.children),t.attributes&&"object"==typeof t.attributes)){for(let r in t.attributes)e.setAttribute(r,t.attributes[r]);delete t.attributes}for(let r in t){let n=e[r],a=t[r];a&&"object"==typeof a?(null==n&&(n=e[r]={}),f(n,a)):e[r]=t[r]}}function y(e="div",t){"string"==typeof t&&(t={className:t}),t=t||{};let r=document.createElement(e);return f(r,t),r}class g{isApplieble(e=window.location.href,t=null){return!0}waitUntilFixerReady(){return!0}apply(e=window.location.href,t=null){}}function v(e){return new Promise(t=>{setTimeout(t,e)})}async function b(e,t,r){let n=new Date;for(;!e()&&new Date-n!!e.querySelector(t),r,n)}async function x(e){"string"==typeof e?e={selectors:[...arguments]}:e instanceof Node&&(e={container:arguments[0],selectors:[...arguments].splice(1)}),(e={container:document,interval:100,timeout:1500,selectors:[],...e}).selector&&(e.selectors=[e.selector]),e.selectors&&!Array.isArray(e.selectors)&&(e.selectors=[...e.selectors]);let t=await Promise.all(e.selectors.map(t=>w(e.container,t,e.interval,e.timeout)));return t.every(e=>e)}async function k(e){!function(){let e=document.querySelector(".progress-pjax-loader");if(e){const t=1200,r=100;e.firstElementChild.style.width=0,e.style.opacity="100%";for(let n=0;ne.firstElementChild.style.width=r+"%",n)}setTimeout(()=>e.style.opacity=0,t+r)}}();let t=await fetch(e);return{document:(new DOMParser).parseFromString(await t.text(),"text/html"),url:t.url}}async function S(e=window.location.href,t=!0){let r=function(e=location.pathname){return!a(e)}(),n=u(),i=await k(e),s=i.document.querySelector("main");if(s.style.display="none",r){document.querySelector("body > div.application-main").prepend(y("div",{className:"",attributes:{itemscope:"",itemtype:"http://schema.org/SoftwareSourceCode"},children:[y("main")]}))}let l=document.querySelector("main");if(l.parentElement.insertBefore(s,l),await _(i.url),l.replaceWith(s),r){let e=document.querySelector("body > div.application-main");for(let t of[...e.children].splice(1))e.removeChild(t);document.body.className="logged-in env-production page-responsive intent-mouse"}else n&&(s.parentElement.className="");s.style.display="",t&&function(e){try{history.pushState(null,null,e)}catch(t){location.hash="#"+e}}(i.url)}var q=[new class extends g{isApplieble(e){return l(e)&&!u(e)}waitUntilFixerReady(){return x("main:nth-child(1) .container-xl")}apply(){[...document.querySelectorAll("main .container-xl")].forEach(e=>e.className="container-lg clearfix new-discussion-timeline px-3")}},new class extends g{isApplieble(e){return l(e)}waitUntilFixerReady(){return x("main:nth-child(1) > div.repohead")}apply(e){let t=document.querySelector("main > div.repohead");u(e)||(t.className="pagehead repohead hx_repohead readability-menu bg-gray-light pb-0 pt-3",t.firstElementChild.className="d-flex container-lg mb-4 px-3"),t.querySelector("nav").className="js-repo-nav js-sidenav-container-pjax clearfix hx_reponav reponav px-3 container-lg",t.querySelector("nav > ul").className="list-style-none",[...t.querySelectorAll("nav > ul > li")].forEach(e=>{e.className="";let t=e.querySelector("a"),r=t.classList.contains("selected");t.className="js-selected-navigation-item reponav-item"+(r?" selected":"")})}},new class extends g{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(){return x("main:nth-child(1) .repository-content .js-details-container .Details-content--hidden",".repository-content ul.list-style-none.d-flex li:nth-child(3)")}apply(e,t){let r=document.querySelector(".repository-content div.css-truncate.css-truncate-overflow.text-gray");this._backupCommitsDetails(t),this._backupBranchesDetails(t),this._moveCommitDate(r),this._fixCommitMessage(r)}_backupCommitsDetails(e){this._backupDetails("backup-commits",e)}_backupBranchesDetails(e){this._backupDetails("backup-branches",e)}_backupDetails(e,t){let r=document.querySelector(".repository-content ul.list-style-none.d-flex li:nth-child(1)");r.id=e,t.append(r)}_moveCommitDate(e){let t=e.parentElement.parentElement.querySelector(":scope > div.flex-shrink-0:not(.hx_avatar_stack_commit)");for(let e of[...t.children])t.removeChild(e);let r=y("div",{className:"css-truncate css-truncate-overflow text-gray",children:["Latest commit ",e.querySelector(".text-mono")," ",e.querySelector("relative-time")]});t.append(r)}_fixCommitMessage(e){let t=e.parentElement.parentElement.querySelector(":scope > .Details-content--hidden"),r=t.querySelector("a"),n=t.querySelector("pre"),a=t.querySelector("a[anchor='comments']"),i=e.parentElement.querySelector(":scope > span.hidden-text-expander"),s=e.querySelector(".commit-author");for(let t of[...e.childNodes])e.removeChild(t);e.append(s," ",r),a&&i.parentElement.insertBefore(a,i),n||i.parentElement.removeChild(i)}},new class extends g{isApplieble(e){return o(e)}waitUntilFixerReady(){return x({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .Progress"],timeout:300})}apply(){let e=y("div","d-flex repository-lang-stats-graph"),t=y("ol","repository-lang-stats-numbers"),r=y("details",{className:"details-reset mb-3",children:[y("summary",{title:"Click for language details",children:[e]}),y("div",{className:"repository-lang-stats",children:[t]})]}),n=[...document.querySelector(".flex-shrink-0.col-12.col-md-3 .Progress").parentElement.nextElementSibling.children];for(let r of n.map(this._extractLanguageData)){let n=y("span",{className:"language-color",attributes:{"aria-label":`${r.name} ${r.percent}`,itemprop:"keywords"},innerText:r.name,style:{width:r.percent,backgroundColor:r.color}});e.append(n);let a=y(r.link?"a":"span",{href:r.link,children:[y("span",{className:"color-block language-color",style:{backgroundColor:r.color}}),y("span",{className:"lang",innerText:` ${r.name} `}),y("span",{className:"percent",innerText:r.percent})]});t.append(y("li",{children:[a]}))}document.querySelector(".repository-content").prepend(r)}_extractLanguageData(e){return e.querySelector("a")?{name:e.querySelector("span").innerText,percent:e.querySelectorAll("span")[1].innerText,color:e.querySelector("svg").style.color,link:e.querySelector("a").href}:{name:e.querySelectorAll("span")[1].innerText,percent:e.querySelectorAll("span")[2].innerText,color:e.querySelector("svg").style.color,link:""}}},new class extends g{isApplieble(e){return o(e)}apply(e,t){let r=document.querySelector(".repository-content details summary div.repository-lang-stats-graph"),n=y("ul",{className:"numbers-summary",children:[this._createCommitsSummaryElement(t),this._createBranchesSummaryElement(t),this._createPackagesSummaryElement(e),this._createReleasesSummaryElement(e),this._createContributorsSummaryElement(e),this._createLicenseSummaryElement()].filter(e=>e)});document.querySelector(".repository-content").prepend(y("div",{className:"overall-summary "+(r?"border-bottom-0 mb-0 rounded-bottom-0":"mb-3"),children:[n]}))}_createCommitsSummaryElement(e){let t=e.querySelector("#backup-commits"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"commit",r)}_createBranchesSummaryElement(e){let t=e.querySelector("#backup-branches"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"branch",r,"es")}_createPackagesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"package","s",0,"",!1)}_createReleasesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"release")}_createContributorsSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"contributor","s",1,"graphs/")}_createLicenseSummaryElement(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 svg.octicon-law");if(e){let t=e.parentElement.href,r=e.parentElement.innerText.trim().replace(" License",""),n='';return this._createSummaryElement(n,t,r)}return null}_createSummaryElementFromRightBar(e,t,r,n="s",a=0,s="",l=!0){let o,c,u=r+n,d=[...document.querySelectorAll(".flex-shrink-0.col-12.col-md-3 div.BorderGrid-cell")].find(e=>{let t=e.querySelector("a");return t&&t.href.endsWith(u)});return d||l?(d?(o=(d.querySelector("span.Counter")||{}).innerText||0,c=d.querySelector("a").href):(o=a,c=i(e)+"/"+s+u),this._createSummaryElement(t,c,r,o,n)):null}_createSummaryElement(e,t,r,n=-1,a="s"){let i=e+"\n";return-1==n?i+=r:(i+=`${n}`,i+="\n",i+=r,1!=n&&(i+=a)),y("li",{children:[y("a",{href:t,innerHTML:i})]})}},new class extends g{isApplieble(e){return o(e)}waitUntilFixerReady(){return x({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6");e&&document.querySelector(".repository-content").prepend(y("div",{className:"repository-topics-container mt-2 mb-3 js-topics-list-container",children:[e]}))}},new class extends g{isApplieble(e){return o(e)}waitUntilFixerReady(){return x({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .f4"],timeout:300})}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-3 .f4"),r=e.querySelector("div.list-topics-container.f6");t&&e.prepend(y("div",{className:r?"":"mb-3",children:[y("div",{className:"f4",innerHTML:t.innerHTML})]}))}},new class extends g{isApplieble(e){return o(e)}waitUntilFixerReady(){return x({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 details"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 details");e&&document.querySelector(".repository-content").prepend(e)}},new class extends g{isApplieble(e){return o(e)}waitUntilFixerReady(){return x("main:nth-child(1) .flex-shrink-0.col-12.col-md-3")}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-9.mb-4.mb-md-0"),r=document.querySelector(".gutter-condensed.gutter-lg.d-flex.flex-column.flex-md-row");e.append(...t.children),r.parentElement.removeChild(r)}},new class extends g{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(){return x({selectors:["main:nth-child(1) #readme"],timeout:300})}apply(){let e=document.querySelector("#readme");if(e){e.className="Box md js-code-block-container Box--condensed",e.querySelector(".Box-header").className="Box-header d-flex flex-items-center flex-justify-between";let t='',r=e.querySelector(".Box-title.pr-3");r.innerHTML=t+r.innerHTML}}},new class extends g{apply(){this._setupObserver(),this._fixAll()}_needToBeFixed(e){return!e.hasAttribute("defreshed")&&e.href&&!d(e.href)&&(!!(t=e.href)&&(t.startsWith("/")||p(t,location.host)))&&l(e.href)&&!function(e=location.pathname){return(s(e)||"").startsWith("raw/")}(e.href)&&!function(e=location.pathname){return(s(e)||"").startsWith("archive/")}(e.href)&&!u(e.href);var t}_fix(e){e.setAttribute("defreshed",""),e.addEventListener("click",(async function(e){e.metaKey||e.ctrlKey||(e.stopPropagation(),e.preventDefault(),S(m(this.href)))}))}_fixAll(){[...document.querySelectorAll("a")].filter(this._needToBeFixed).forEach(this._fix)}_setupObserver(){window.defreshObserver||(window.defreshObserver=new MutationObserver(()=>this._fixAll()),window.defreshObserver.observe(document.body,{childList:!0,subtree:!0}))}},new class extends g{apply(){window.onpopstate=function(){let e=document.location.href;h(e)&&l(e)&&!d(e)?S(e,!1):window.location.href=document.location.href}}}];async function _(e=window.location.href){let t=document.createElement("backup");for(let r of q)if(r.isApplieble(e,t)&&await r.waitUntilFixerReady())try{r.apply(e,t)}catch(e){console.log("Fixer exception: ",e)}}!window.defreshed&&h()&&(window.defreshed=!0,_())}]); \ No newline at end of file +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";const n=r(1),a=r(2);t.all=n,t.check=e=>(e=(e||"").toString().toLowerCase(),n.includes(e)),t.oddballs=e=>e&&e in a?a[e]:Object.keys(a).sort()},function(e){e.exports=JSON.parse('["400","401","402","403","404","405","406","407","408","409","410","411","412","413","414","415","416","417","418","419","420","421","422","423","424","425","426","427","428","429","430","431","500","501","502","503","504","505","506","507","508","509","510","511","about","access","account","admin","anonymous","any","api","apps","attributes","auth","billing","blob","blog","bounty","branches","business","businesses","c","cache","case-studies","categories","central","certification","changelog","cla","cloud","codereview","collection","collections","comments","commit","commits","community","companies","compare","contact","contributing","cookbook","coupons","customer","customers","dashboard","dashboards","design","develop","developer","diff","discover","discussions","docs","downloads","downtime","editor","editors","edu","enterprise","events","explore","featured","features","files","fixtures","forked","garage","ghost","gist","gists","graphs","guide","guides","help","help-wanted","home","hooks","hosting","hovercards","identity","images","inbox","individual","info","integration","interfaces","introduction","invalid-email-address","investors","issues","jobs","join","journal","journals","lab","labs","languages","launch","layouts","learn","legal","library","linux","listings","lists","login","logos","logout","mac","maintenance","malware","man","marketplace","mention","mentioned","mentioning","mentions","migrating","milestones","mine","mirrors","mobile","navigation","network","new","news","none","nonprofit","nonprofits","notices","notifications","oauth","offer","open-source","organisations","organizations","orgs","pages","partners","payments","personal","plans","plugins","popular","popularity","posts","press","pricing","professional","projects","pulls","raw","readme","recommendations","redeem","releases","render","reply","repositories","resources","restore","revert","save-net-neutrality","saved","scraping","search","security","services","sessions","settings","shareholders","shop","showcases","signin","signup","site","spam","sponsors","ssh","staff","starred","stars","static","status","statuses","storage","store","stories","styleguide","subscriptions","suggest","suggestion","suggestions","support","suspended","talks","teach","teacher","teachers","teaching","teams","ten","terms","timeline","topic","topics","tos","tour","train","training","translations","tree","trending","updates","username","users","visualization","w","watching","wiki","windows","works-with","www0","www1","www2","www3","www4","www5","www6","www7","www8","www9"]')},function(e){e.exports=JSON.parse('{"avatars":{"reserved":true,"taken":true,"typical":true,"included":false},"assets":{"reserved":true,"taken":true,"typical":true,"included":false},"bookmarks":{"reserved":true,"taken":true,"typical":true,"included":false},"checks":{"reserved":true,"taken":true,"typical":true,"included":false},"conversations":{"reserved":true,"taken":true,"typical":true,"included":false},"labels":{"reserved":true,"taken":true,"typical":true,"included":false},"media":{"reserved":true,"taken":true,"typical":true,"included":false},"nodes":{"reserved":true,"taken":true,"typical":true,"included":false},"owners":{"reserved":true,"taken":true,"typical":true,"included":false},"page":{"reserved":true,"taken":true,"typical":true,"included":false},"registry":{"reserved":true,"taken":true,"typical":true,"included":false},"seats":{"reserved":true,"taken":true,"typical":true,"included":false},"shared":{"reserved":true,"taken":true,"typical":true,"included":false},"tasks":{"reserved":true,"taken":true,"typical":true,"included":false},"uploads":{"reserved":true,"taken":true,"typical":true,"included":false},"account":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"apps":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/marketplace","included":true},"blog":{"reserved":true,"taken":false,"typical":false,"redirect":"https://blog.github.com","included":true},"c":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/contact","included":true},"contributing":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/careers","included":true},"customer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"customers":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"developer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://developer.github.com","included":true},"edu":{"reserved":true,"taken":false,"typical":false,"redirect":"https://education.github.com","included":true},"guides":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"help":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"launch":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/search","included":true},"mac":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"mirrors":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/about-github-mirrors/","included":true},"pages":{"reserved":true,"taken":false,"typical":false,"redirect":"https://pages.github.com","included":true},"plans":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/pricing","included":true},"press":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/press","included":true},"readme":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/about","included":true},"repositories":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/trending","included":true},"resources":{"reserved":true,"taken":false,"typical":false,"redirect":"https://resources.github.com","included":true},"security":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-security/","included":true},"settings":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"signup":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/join","included":true},"terms":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"topic":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/topics","included":true},"tos":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"training":{"reserved":true,"taken":false,"typical":false,"redirect":"https://services.github.com","included":true},"users":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"wiki":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"windows":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"collections":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"Curated lists of GitHub repos"},"hovercards":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"HTTP ERROR 406"},"inbox":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/410","included":true,"notes":"410 ERROR"},"invalid-email-address":{"reserved":true,"taken":true,"typical":false,"included":true,"notes":"HTTP ERROR 404"},"suggestions":{"reserved":true,"taken":false,"typical":false,"included":true},"suspended":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com","included":true,"notes":"Page behaviour depends on whether you\'re logged in or if your account is actually suspended"},"case-studies":{"reserved":false,"taken":true,"typical":false,"included":true},"watching":{"reserved":false,"taken":true,"typical":false,"included":true},"save-net-neutrality":{"reserved":false,"taken":true,"typical":false,"included":true},"ghost":{"reserved":false,"taken":true,"typical":true,"included":true},"status":{"reserved":true,"taken":false,"typical":false,"included":true}}')},function(e,t,r){"use strict";r.r(t);var n=r(0);function a(e=location.pathname){try{e=new URL(e).pathname}catch(e){}return e.replace(/^[/]|[/]$/g,"")}function i(e=location.pathname){return l(e=a(e))?e.split("/",2).join("/"):null}function s(e=location.pathname){if(!l(e=a(e)))return null;let t=e.match(/^[^/]+[/][^/]+[/]?(.*)$/);return t?t[1]:null}function l(e=location.pathname){let t=(e=a(e)).substring(0,e.indexOf("/"));return/^[^/]+\/[^/]+/.test(e)&&!Object(n.check)(t)&&!function(e=location.pathname){return/^((orgs[/][^/]+[/])?dashboard([/]index[/]\d+)?)?$/.test(a(e))}(e)&&!function(e=location.pathname){return/^([^/]+[/][^/]+\/)?notifications/.test(a(e))}(e)}function o(e=location.pathname){return/^(tree[/][^/]+)?$/.test(s(e))}function c(e=location.pathname){return/^tree\//.test(s(e))}function u(e=location.pathname){return function(e=location.pathname){return(s(e)||"").startsWith("raw/")}(e)||function(e=location.pathname){return(s(e)||"").startsWith("archive/")}(e)||function(e=location.pathname){return(s(e)||"").startsWith("releases/download/")}(e)}function d(e=location.pathname){return/^projects\/\d+$/.test(s(e))}function p(e=location.pathname){return/#[^\/]*$/.test(e)}function m(e,t){try{return new URL(e).host==t}catch(e){return!1}}function h(e=location.pathname,t=location.host,r=location.protocol){return function(e){try{return new URL(e),!0}catch(e){return!1}}(e)?e:`${r}//${t}/${e=a(e)}`}function f(e=window.location.href){return m(e,"github.com")}function y(e,t){if(e instanceof HTMLElement&&(function(e){return!!e&&"function"==typeof e[Symbol.iterator]}(t.children)&&(e.append(...t.children),delete t.children),t.attributes&&"object"==typeof t.attributes)){for(let r in t.attributes)e.setAttribute(r,t.attributes[r]);delete t.attributes}for(let r in t){let n=e[r],a=t[r];a&&"object"==typeof a?(null==n&&(n=e[r]={}),y(n,a)):e[r]=t[r]}}function g(e="div",t){"string"==typeof t&&(t={className:t}),t=t||{};let r=document.createElement(e);return y(r,t),r}class v{isApplieble(e=window.location.href,t=null){return!0}waitUntilFixerReady(e=window.location.href,t=null){return!0}apply(e=window.location.href,t=null){}}function b(e){return new Promise(t=>{setTimeout(t,e)})}async function w(e,t,r){let n=new Date;for(;!e()&&new Date-n!!e.querySelector(t),r,n)}async function k(e){"string"==typeof e?e={selectors:[...arguments]}:e instanceof Node&&(e={container:arguments[0],selectors:[...arguments].splice(1)}),(e={container:document,interval:100,timeout:1500,selectors:[],...e}).selector&&(e.selectors=[e.selector]),e.selectors&&!Array.isArray(e.selectors)&&(e.selectors=[...e.selectors]);let t=await Promise.all(e.selectors.map(t=>x(e.container,t,e.interval,e.timeout)));return t.every(e=>e)}async function S(e){!function(){let e=document.querySelector(".progress-pjax-loader");if(e){const t=1200,r=100;e.firstElementChild.style.width=0,e.style.opacity="100%";for(let n=0;ne.firstElementChild.style.width=r+"%",n)}setTimeout(()=>e.style.opacity=0,t+r)}}();let t=await fetch(e);return{document:(new DOMParser).parseFromString(await t.text(),"text/html"),url:t.url}}async function q(e=window.location.href,t=!0){let r=function(e=location.pathname){return!a(e)}(),n=d(),i=await S(e),s=i.document.querySelector("main");if(s.style.display="none",r){document.querySelector("body > div.application-main").prepend(g("div",{className:"",attributes:{itemscope:"",itemtype:"http://schema.org/SoftwareSourceCode"},children:[g("main")]}))}let l=document.querySelector("main");if(l.parentElement.insertBefore(s,l),await E(i.url),l.replaceWith(s),r){let e=document.querySelector("body > div.application-main");for(let t of[...e.children].splice(1))e.removeChild(t);document.body.className="logged-in env-production page-responsive intent-mouse"}else n&&(s.parentElement.className="");s.style.display="",document.head.querySelector("title").innerText=i.document.head.querySelector("title").innerText;let o=document.querySelector("header"),c=i.document.querySelector("header");o&&c&&o.replaceWith(c),t&&function(e){try{history.pushState(null,null,e)}catch(t){location.hash="#"+e}}(i.url)}var _=[new class extends v{isApplieble(e){return l(e)&&!d(e)}waitUntilFixerReady(){return k("main:nth-child(1) .container-xl")}apply(){[...document.querySelectorAll("main .container-xl")].forEach(e=>e.className="container-lg clearfix new-discussion-timeline px-3")}},new class extends v{isApplieble(e){return l(e)}waitUntilFixerReady(){return k("main:nth-child(1) > div.repohead")}apply(e){let t=document.querySelector("main > div.repohead");d(e)||(t.className="pagehead repohead hx_repohead readability-menu bg-gray-light pb-0 pt-3",t.firstElementChild.className="d-flex container-lg mb-4 px-3"),t.querySelector("nav").className="js-repo-nav js-sidenav-container-pjax clearfix hx_reponav reponav px-3 container-lg",t.querySelector("nav > ul").className="list-style-none",[...t.querySelectorAll("nav > ul > li")].forEach(e=>{e.className="";let t=e.querySelector("a"),r=t.classList.contains("selected");t.className="js-selected-navigation-item reponav-item"+(r?" selected":"")})}},new class extends v{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(e){let t=["main:nth-child(1) .repository-content .js-details-container .Details-content--hidden"];return o(e)&&t.push(".repository-content ul.list-style-none.d-flex li:nth-child(3)"),k(...t)}apply(e,t){let r=document.querySelector(".repository-content div.css-truncate.css-truncate-overflow.text-gray");o(e)&&(this._backupCommitsDetails(t),this._backupBranchesDetails(t)),this._moveCommitDate(r),this._fixCommitMessage(r)}_backupCommitsDetails(e){this._backupDetails("backup-commits",e)}_backupBranchesDetails(e){this._backupDetails("backup-branches",e)}_backupDetails(e,t){let r=document.querySelector(".repository-content ul.list-style-none.d-flex li:nth-child(1)");r.id=e,t.append(r)}_moveCommitDate(e){let t=e.parentElement.parentElement.querySelector(":scope > div.flex-shrink-0:not(.hx_avatar_stack_commit)");for(let e of[...t.children])t.removeChild(e);let r=g("div",{className:"css-truncate css-truncate-overflow text-gray",children:["Latest commit ",e.querySelector(".text-mono")," ",e.querySelector("relative-time")]});t.append(r)}_fixCommitMessage(e){let t=e.parentElement.parentElement.querySelector(":scope > .Details-content--hidden"),r=t.querySelector("a"),n=t.querySelector("pre"),a=t.querySelector("a[anchor='comments']"),i=e.parentElement.querySelector(":scope > span.hidden-text-expander"),s=e.querySelector(".commit-author");for(let t of[...e.childNodes])e.removeChild(t);r.classList.remove("text-bold"),e.append(s," ",r),i&&(a&&i.parentElement.insertBefore(a,i),n||i.parentElement.removeChild(i))}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .Progress"],timeout:300})}apply(){let e=g("div","d-flex repository-lang-stats-graph"),t=g("ol","repository-lang-stats-numbers"),r=g("details",{className:"details-reset mb-3",children:[g("summary",{title:"Click for language details",children:[e]}),g("div",{className:"repository-lang-stats",children:[t]})]}),n=[...document.querySelector(".flex-shrink-0.col-12.col-md-3 .Progress").parentElement.nextElementSibling.children];for(let r of n.map(this._extractLanguageData)){let n=g("span",{className:"language-color",attributes:{"aria-label":`${r.name} ${r.percent}`,itemprop:"keywords"},innerText:r.name,style:{width:r.percent,backgroundColor:r.color}});e.append(n);let a=g(r.link?"a":"span",{href:r.link,children:[g("span",{className:"color-block language-color",style:{backgroundColor:r.color}}),g("span",{className:"lang",innerText:` ${r.name} `}),g("span",{className:"percent",innerText:r.percent})]});t.append(g("li",{children:[a]}))}document.querySelector(".repository-content").prepend(r)}_extractLanguageData(e){return e.querySelector("a")?{name:e.querySelector("span").innerText,percent:e.querySelectorAll("span")[1].innerText,color:e.querySelector("svg").style.color,link:e.querySelector("a").href}:{name:e.querySelectorAll("span")[1].innerText,percent:e.querySelectorAll("span")[2].innerText,color:e.querySelector("svg").style.color,link:""}}},new class extends v{isApplieble(e){return o(e)}apply(e,t){let r=document.querySelector(".repository-content details summary div.repository-lang-stats-graph"),n=g("ul",{className:"numbers-summary",children:[this._createCommitsSummaryElement(t),this._createBranchesSummaryElement(t),this._createPackagesSummaryElement(e),this._createReleasesSummaryElement(e),this._createContributorsSummaryElement(e),this._createLicenseSummaryElement()].filter(e=>e)});document.querySelector(".repository-content").prepend(g("div",{className:"overall-summary "+(r?"border-bottom-0 mb-0 rounded-bottom-0":"mb-3"),children:[n]}))}_createCommitsSummaryElement(e){let t=e.querySelector("#backup-commits"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"commit",r)}_createBranchesSummaryElement(e){let t=e.querySelector("#backup-branches"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"branch",r,"es")}_createPackagesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"package","s",0,"",!1)}_createReleasesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"release")}_createContributorsSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"contributor","s",1,"graphs/")}_createLicenseSummaryElement(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 svg.octicon-law");if(e){let t=e.parentElement.href,r=e.parentElement.innerText.trim().replace(" License",""),n='';return this._createSummaryElement(n,t,r)}return null}_createSummaryElementFromRightBar(e,t,r,n="s",a=0,s="",l=!0){let o,c,u=r+n,d=[...document.querySelectorAll(".flex-shrink-0.col-12.col-md-3 div.BorderGrid-cell")].find(e=>{let t=e.querySelector("a");return t&&t.href.endsWith(u)});return d||l?(d?(o=(d.querySelector("span.Counter")||{}).innerText||0,c=d.querySelector("a").href):(o=a,c=i(e)+"/"+s+u),this._createSummaryElement(t,c,r,o,n)):null}_createSummaryElement(e,t,r,n=-1,a="s"){let i=e+"\n";return-1==n?i+=r:(i+=`${n}`,i+="\n",i+=r,1!=n&&(i+=a)),g("li",{children:[g("a",{href:t,innerHTML:i})]})}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6");e&&document.querySelector(".repository-content").prepend(g("div",{className:"repository-topics-container mt-2 mb-3 js-topics-list-container",children:[e]}))}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .f4"],timeout:300})}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-3 .f4"),r=e.querySelector("div.list-topics-container.f6");t&&e.prepend(g("div",{className:r?"":"mb-3",children:[g("div",{className:"f4",innerHTML:t.innerHTML})]}))}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 details"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 details");e&&document.querySelector(".repository-content").prepend(e)}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k("main:nth-child(1) .flex-shrink-0.col-12.col-md-3")}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-9.mb-4.mb-md-0"),r=document.querySelector(".gutter-condensed.gutter-lg.d-flex.flex-column.flex-md-row");e.append(...t.children),r.parentElement.removeChild(r)}},new class extends v{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) #readme"],timeout:300})}apply(){let e=document.querySelector("#readme");if(e){e.className="Box md js-code-block-container Box--condensed",e.querySelector(".Box-header").className="Box-header d-flex flex-items-center flex-justify-between";let t='',r=e.querySelector(".Box-title.pr-3");r.innerHTML=t+r.innerHTML}}},new class extends v{apply(){this._setupObserver(),this._fixAll()}_needToBeFixed(e){return!e.hasAttribute("defreshed")&&e.href&&!p(e.href)&&(!!(t=e.href)&&(t.startsWith("/")||m(t,location.host)))&&l(e.href)&&!u(e.href)&&!d(e.href);var t}_fix(e){e.setAttribute("defreshed",""),e.addEventListener("click",(async function(e){e.metaKey||e.ctrlKey||(e.stopPropagation(),e.preventDefault(),q(h(this.href)))}))}_fixAll(){[...document.querySelectorAll("a")].filter(this._needToBeFixed).forEach(this._fix)}_setupObserver(){window.defreshObserver||(window.defreshObserver=new MutationObserver(()=>this._fixAll()),window.defreshObserver.observe(document.body,{childList:!0,subtree:!0}))}},new class extends v{apply(){window.onpopstate=function(){let e=document.location.href;f(e)&&l(e)&&!p(e)?q(e,!1):window.location.href=document.location.href}}}];async function E(e=window.location.href){let t=document.createElement("backup");for(let r of _)if(r.isApplieble(e,t)&&await r.waitUntilFixerReady(e,t))try{r.apply(e,t)}catch(e){console.log("Fixer exception: ",e)}}!window.defreshed&&f()&&(window.defreshed=!0,E())}]); \ No newline at end of file diff --git a/build/github-defreshed.meta.js b/build/github-defreshed.meta.js index e46e1d9..40b942f 100644 --- a/build/github-defreshed.meta.js +++ b/build/github-defreshed.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name GitHub Defreshed // @namespace GitHub -// @version 1.4.0 +// @version 1.4.5 // @author Kir_Antipov // @description Make GitHub Great Again! // @license MIT diff --git a/build/github-defreshed.user.js b/build/github-defreshed.user.js index e2f2d2e..4284066 100644 --- a/build/github-defreshed.user.js +++ b/build/github-defreshed.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name GitHub Defreshed // @namespace GitHub -// @version 1.4.0 +// @version 1.4.5 // @author Kir_Antipov // @description Make GitHub Great Again! // @license MIT @@ -13,4 +13,4 @@ // @run-at document-start // @grant none // ==/UserScript== -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";const n=r(1),a=r(2);t.all=n,t.check=e=>(e=(e||"").toString().toLowerCase(),n.includes(e)),t.oddballs=e=>e&&e in a?a[e]:Object.keys(a).sort()},function(e){e.exports=JSON.parse('["400","401","402","403","404","405","406","407","408","409","410","411","412","413","414","415","416","417","418","419","420","421","422","423","424","425","426","427","428","429","430","431","500","501","502","503","504","505","506","507","508","509","510","511","about","access","account","admin","anonymous","any","api","apps","attributes","auth","billing","blob","blog","bounty","branches","business","businesses","c","cache","case-studies","categories","central","certification","changelog","cla","cloud","codereview","collection","collections","comments","commit","commits","community","companies","compare","contact","contributing","cookbook","coupons","customer","customers","dashboard","dashboards","design","develop","developer","diff","discover","discussions","docs","downloads","downtime","editor","editors","edu","enterprise","events","explore","featured","features","files","fixtures","forked","garage","ghost","gist","gists","graphs","guide","guides","help","help-wanted","home","hooks","hosting","hovercards","identity","images","inbox","individual","info","integration","interfaces","introduction","invalid-email-address","investors","issues","jobs","join","journal","journals","lab","labs","languages","launch","layouts","learn","legal","library","linux","listings","lists","login","logos","logout","mac","maintenance","malware","man","marketplace","mention","mentioned","mentioning","mentions","migrating","milestones","mine","mirrors","mobile","navigation","network","new","news","none","nonprofit","nonprofits","notices","notifications","oauth","offer","open-source","organisations","organizations","orgs","pages","partners","payments","personal","plans","plugins","popular","popularity","posts","press","pricing","professional","projects","pulls","raw","readme","recommendations","redeem","releases","render","reply","repositories","resources","restore","revert","save-net-neutrality","saved","scraping","search","security","services","sessions","settings","shareholders","shop","showcases","signin","signup","site","spam","sponsors","ssh","staff","starred","stars","static","status","statuses","storage","store","stories","styleguide","subscriptions","suggest","suggestion","suggestions","support","suspended","talks","teach","teacher","teachers","teaching","teams","ten","terms","timeline","topic","topics","tos","tour","train","training","translations","tree","trending","updates","username","users","visualization","w","watching","wiki","windows","works-with","www0","www1","www2","www3","www4","www5","www6","www7","www8","www9"]')},function(e){e.exports=JSON.parse('{"avatars":{"reserved":true,"taken":true,"typical":true,"included":false},"assets":{"reserved":true,"taken":true,"typical":true,"included":false},"bookmarks":{"reserved":true,"taken":true,"typical":true,"included":false},"checks":{"reserved":true,"taken":true,"typical":true,"included":false},"conversations":{"reserved":true,"taken":true,"typical":true,"included":false},"labels":{"reserved":true,"taken":true,"typical":true,"included":false},"media":{"reserved":true,"taken":true,"typical":true,"included":false},"nodes":{"reserved":true,"taken":true,"typical":true,"included":false},"owners":{"reserved":true,"taken":true,"typical":true,"included":false},"page":{"reserved":true,"taken":true,"typical":true,"included":false},"registry":{"reserved":true,"taken":true,"typical":true,"included":false},"seats":{"reserved":true,"taken":true,"typical":true,"included":false},"shared":{"reserved":true,"taken":true,"typical":true,"included":false},"tasks":{"reserved":true,"taken":true,"typical":true,"included":false},"uploads":{"reserved":true,"taken":true,"typical":true,"included":false},"account":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"apps":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/marketplace","included":true},"blog":{"reserved":true,"taken":false,"typical":false,"redirect":"https://blog.github.com","included":true},"c":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/contact","included":true},"contributing":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/careers","included":true},"customer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"customers":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"developer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://developer.github.com","included":true},"edu":{"reserved":true,"taken":false,"typical":false,"redirect":"https://education.github.com","included":true},"guides":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"help":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"launch":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/search","included":true},"mac":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"mirrors":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/about-github-mirrors/","included":true},"pages":{"reserved":true,"taken":false,"typical":false,"redirect":"https://pages.github.com","included":true},"plans":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/pricing","included":true},"press":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/press","included":true},"readme":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/about","included":true},"repositories":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/trending","included":true},"resources":{"reserved":true,"taken":false,"typical":false,"redirect":"https://resources.github.com","included":true},"security":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-security/","included":true},"settings":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"signup":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/join","included":true},"terms":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"topic":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/topics","included":true},"tos":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"training":{"reserved":true,"taken":false,"typical":false,"redirect":"https://services.github.com","included":true},"users":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"wiki":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"windows":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"collections":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"Curated lists of GitHub repos"},"hovercards":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"HTTP ERROR 406"},"inbox":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/410","included":true,"notes":"410 ERROR"},"invalid-email-address":{"reserved":true,"taken":true,"typical":false,"included":true,"notes":"HTTP ERROR 404"},"suggestions":{"reserved":true,"taken":false,"typical":false,"included":true},"suspended":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com","included":true,"notes":"Page behaviour depends on whether you\'re logged in or if your account is actually suspended"},"case-studies":{"reserved":false,"taken":true,"typical":false,"included":true},"watching":{"reserved":false,"taken":true,"typical":false,"included":true},"save-net-neutrality":{"reserved":false,"taken":true,"typical":false,"included":true},"ghost":{"reserved":false,"taken":true,"typical":true,"included":true},"status":{"reserved":true,"taken":false,"typical":false,"included":true}}')},function(e,t,r){"use strict";r.r(t);var n=r(0);function a(e=location.pathname){try{e=new URL(e).pathname}catch(e){}return e.replace(/^[/]|[/]$/g,"")}function i(e=location.pathname){return l(e=a(e))?e.split("/",2).join("/"):null}function s(e=location.pathname){if(!l(e=a(e)))return null;let t=e.match(/^[^/]+[/][^/]+[/]?(.*)$/);return t?t[1]:null}function l(e=location.pathname){let t=(e=a(e)).substring(0,e.indexOf("/"));return/^[^/]+\/[^/]+/.test(e)&&!Object(n.check)(t)&&!function(e=location.pathname){return/^((orgs[/][^/]+[/])?dashboard([/]index[/]\d+)?)?$/.test(a(e))}(e)&&!function(e=location.pathname){return/^([^/]+[/][^/]+\/)?notifications/.test(a(e))}(e)}function o(e=location.pathname){return/^(tree[/][^/]+)?$/.test(s(e))}function c(e=location.pathname){return/^tree\//.test(s(e))}function u(e=location.pathname){return/^projects\/\d+$/.test(s(e))}function d(e=location.pathname){return/#[^\/]*$/.test(e)}function p(e,t){try{return new URL(e).host==t}catch(e){return!1}}function m(e=location.pathname,t=location.host,r=location.protocol){return function(e){try{return new URL(e),!0}catch(e){return!1}}(e)?e:`${r}//${t}/${e=a(e)}`}function h(e=window.location.href){return p(e,"github.com")}function f(e,t){if(e instanceof HTMLElement&&(function(e){return!!e&&"function"==typeof e[Symbol.iterator]}(t.children)&&(e.append(...t.children),delete t.children),t.attributes&&"object"==typeof t.attributes)){for(let r in t.attributes)e.setAttribute(r,t.attributes[r]);delete t.attributes}for(let r in t){let n=e[r],a=t[r];a&&"object"==typeof a?(null==n&&(n=e[r]={}),f(n,a)):e[r]=t[r]}}function y(e){return g("style",{type:"text/css",children:[e]})}function g(e="div",t){"string"==typeof t&&(t={className:t}),t=t||{};let r=document.createElement(e);return f(r,t),r}class v{isApplieble(e=window.location.href,t=null){return!0}waitUntilFixerReady(){return!0}apply(e=window.location.href,t=null){}}function b(e){return new Promise(t=>{setTimeout(t,e)})}async function w(e,t,r){let n=new Date;for(;!e()&&new Date-n!!e.querySelector(t),r,n)}async function k(e){"string"==typeof e?e={selectors:[...arguments]}:e instanceof Node&&(e={container:arguments[0],selectors:[...arguments].splice(1)}),(e={container:document,interval:100,timeout:1500,selectors:[],...e}).selector&&(e.selectors=[e.selector]),e.selectors&&!Array.isArray(e.selectors)&&(e.selectors=[...e.selectors]);let t=await Promise.all(e.selectors.map(t=>x(e.container,t,e.interval,e.timeout)));return t.every(e=>e)}async function S(e){!function(){let e=document.querySelector(".progress-pjax-loader");if(e){const t=1200,r=100;e.firstElementChild.style.width=0,e.style.opacity="100%";for(let n=0;ne.firstElementChild.style.width=r+"%",n)}setTimeout(()=>e.style.opacity=0,t+r)}}();let t=await fetch(e);return{document:(new DOMParser).parseFromString(await t.text(),"text/html"),url:t.url}}async function q(e=window.location.href,t=!0){let r=function(e=location.pathname){return!a(e)}(),n=u(),i=await S(e),s=i.document.querySelector("main");if(s.style.display="none",r){document.querySelector("body > div.application-main").prepend(g("div",{className:"",attributes:{itemscope:"",itemtype:"http://schema.org/SoftwareSourceCode"},children:[g("main")]}))}let l=document.querySelector("main");if(l.parentElement.insertBefore(s,l),await E(i.url),l.replaceWith(s),r){let e=document.querySelector("body > div.application-main");for(let t of[...e.children].splice(1))e.removeChild(t);document.body.className="logged-in env-production page-responsive intent-mouse"}else n&&(s.parentElement.className="");s.style.display="",t&&function(e){try{history.pushState(null,null,e)}catch(t){location.hash="#"+e}}(i.url)}var _=[new class extends v{apply(){document.head.append(y(".topic-tag {\n display: inline-block !important;\n padding: .3em .9em !important;\n margin: 0 .5em .5em 0 !important;\n white-space: nowrap !important;\n border-radius: 3px !important;\n line-height: 1.5 !important;\n font-size: 12px !important;\n border: none !important;\n }"))}},new class extends v{apply(){document.head.append(y("\n .overall-summary {\n border-radius: 3px !important;\n }\n\n .repository-lang-stats-graph {\n border-bottom-left-radius: 3px !important;\n border-bottom-right-radius: 3px !important;\n }\n\n .repository-lang-stats-graph .language-color:first-child {\n border-bottom-left-radius: 3px !important;\n }\n\n .repository-lang-stats-graph .language-color:last-child {\n border-bottom-right-radius: 3px !important;\n }\n "))}},new class extends v{apply(){document.head.append(y("\n .btn {\n border-radius: 3px !important;\n }\n\n .repository-content .file-navigation .btn {\n padding: 3px 10px !important;\n font-size: 12px !important;\n line-height: 20px !important;\n font-weight: 600 !important;\n }\n\n #branch-select-menu svg {\n display: none !important;\n }\n\n #branch-select-menu .btn > span {\n font-weight: 600 !important;\n }\n\n .pagehead-actions .btn {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n padding: 3px 10px !important;\n }\n\n .pagehead-actions a.social-count {\n border-top-right-radius: 3px !important;\n border-bottom-right-radius: 3px !important;\n padding: 3px 10px !important;\n }\n "))}},new class extends v{apply(){document.head.append(y("img.avatar, img.avatar-user, a.avatar-user {\n border-radius: 3px !important;\n }"))}},new class extends v{apply(){document.head.append(y("\n div.Box, .markdown-body pre {\n border-radius: 3px !important;\n }\n \n div.Box-header {\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n }\n "))}},new class extends v{isApplieble(e){return l(e)&&!u(e)}waitUntilFixerReady(){return k("main:nth-child(1) .container-xl")}apply(){[...document.querySelectorAll("main .container-xl")].forEach(e=>e.className="container-lg clearfix new-discussion-timeline px-3")}},new class extends v{isApplieble(e){return l(e)}waitUntilFixerReady(){return k("main:nth-child(1) > div.repohead")}apply(e){let t=document.querySelector("main > div.repohead");u(e)||(t.className="pagehead repohead hx_repohead readability-menu bg-gray-light pb-0 pt-3",t.firstElementChild.className="d-flex container-lg mb-4 px-3"),t.querySelector("nav").className="js-repo-nav js-sidenav-container-pjax clearfix hx_reponav reponav px-3 container-lg",t.querySelector("nav > ul").className="list-style-none",[...t.querySelectorAll("nav > ul > li")].forEach(e=>{e.className="";let t=e.querySelector("a"),r=t.classList.contains("selected");t.className="js-selected-navigation-item reponav-item"+(r?" selected":"")})}},new class extends v{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(){return k("main:nth-child(1) .repository-content .js-details-container .Details-content--hidden",".repository-content ul.list-style-none.d-flex li:nth-child(3)")}apply(e,t){let r=document.querySelector(".repository-content div.css-truncate.css-truncate-overflow.text-gray");this._backupCommitsDetails(t),this._backupBranchesDetails(t),this._moveCommitDate(r),this._fixCommitMessage(r)}_backupCommitsDetails(e){this._backupDetails("backup-commits",e)}_backupBranchesDetails(e){this._backupDetails("backup-branches",e)}_backupDetails(e,t){let r=document.querySelector(".repository-content ul.list-style-none.d-flex li:nth-child(1)");r.id=e,t.append(r)}_moveCommitDate(e){let t=e.parentElement.parentElement.querySelector(":scope > div.flex-shrink-0:not(.hx_avatar_stack_commit)");for(let e of[...t.children])t.removeChild(e);let r=g("div",{className:"css-truncate css-truncate-overflow text-gray",children:["Latest commit ",e.querySelector(".text-mono")," ",e.querySelector("relative-time")]});t.append(r)}_fixCommitMessage(e){let t=e.parentElement.parentElement.querySelector(":scope > .Details-content--hidden"),r=t.querySelector("a"),n=t.querySelector("pre"),a=t.querySelector("a[anchor='comments']"),i=e.parentElement.querySelector(":scope > span.hidden-text-expander"),s=e.querySelector(".commit-author");for(let t of[...e.childNodes])e.removeChild(t);e.append(s," ",r),a&&i.parentElement.insertBefore(a,i),n||i.parentElement.removeChild(i)}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .Progress"],timeout:300})}apply(){let e=g("div","d-flex repository-lang-stats-graph"),t=g("ol","repository-lang-stats-numbers"),r=g("details",{className:"details-reset mb-3",children:[g("summary",{title:"Click for language details",children:[e]}),g("div",{className:"repository-lang-stats",children:[t]})]}),n=[...document.querySelector(".flex-shrink-0.col-12.col-md-3 .Progress").parentElement.nextElementSibling.children];for(let r of n.map(this._extractLanguageData)){let n=g("span",{className:"language-color",attributes:{"aria-label":`${r.name} ${r.percent}`,itemprop:"keywords"},innerText:r.name,style:{width:r.percent,backgroundColor:r.color}});e.append(n);let a=g(r.link?"a":"span",{href:r.link,children:[g("span",{className:"color-block language-color",style:{backgroundColor:r.color}}),g("span",{className:"lang",innerText:` ${r.name} `}),g("span",{className:"percent",innerText:r.percent})]});t.append(g("li",{children:[a]}))}document.querySelector(".repository-content").prepend(r)}_extractLanguageData(e){return e.querySelector("a")?{name:e.querySelector("span").innerText,percent:e.querySelectorAll("span")[1].innerText,color:e.querySelector("svg").style.color,link:e.querySelector("a").href}:{name:e.querySelectorAll("span")[1].innerText,percent:e.querySelectorAll("span")[2].innerText,color:e.querySelector("svg").style.color,link:""}}},new class extends v{isApplieble(e){return o(e)}apply(e,t){let r=document.querySelector(".repository-content details summary div.repository-lang-stats-graph"),n=g("ul",{className:"numbers-summary",children:[this._createCommitsSummaryElement(t),this._createBranchesSummaryElement(t),this._createPackagesSummaryElement(e),this._createReleasesSummaryElement(e),this._createContributorsSummaryElement(e),this._createLicenseSummaryElement()].filter(e=>e)});document.querySelector(".repository-content").prepend(g("div",{className:"overall-summary "+(r?"border-bottom-0 mb-0 rounded-bottom-0":"mb-3"),children:[n]}))}_createCommitsSummaryElement(e){let t=e.querySelector("#backup-commits"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"commit",r)}_createBranchesSummaryElement(e){let t=e.querySelector("#backup-branches"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"branch",r,"es")}_createPackagesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"package","s",0,"",!1)}_createReleasesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"release")}_createContributorsSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"contributor","s",1,"graphs/")}_createLicenseSummaryElement(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 svg.octicon-law");if(e){let t=e.parentElement.href,r=e.parentElement.innerText.trim().replace(" License",""),n='';return this._createSummaryElement(n,t,r)}return null}_createSummaryElementFromRightBar(e,t,r,n="s",a=0,s="",l=!0){let o,c,u=r+n,d=[...document.querySelectorAll(".flex-shrink-0.col-12.col-md-3 div.BorderGrid-cell")].find(e=>{let t=e.querySelector("a");return t&&t.href.endsWith(u)});return d||l?(d?(o=(d.querySelector("span.Counter")||{}).innerText||0,c=d.querySelector("a").href):(o=a,c=i(e)+"/"+s+u),this._createSummaryElement(t,c,r,o,n)):null}_createSummaryElement(e,t,r,n=-1,a="s"){let i=e+"\n";return-1==n?i+=r:(i+=`${n}`,i+="\n",i+=r,1!=n&&(i+=a)),g("li",{children:[g("a",{href:t,innerHTML:i})]})}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6");e&&document.querySelector(".repository-content").prepend(g("div",{className:"repository-topics-container mt-2 mb-3 js-topics-list-container",children:[e]}))}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .f4"],timeout:300})}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-3 .f4"),r=e.querySelector("div.list-topics-container.f6");t&&e.prepend(g("div",{className:r?"":"mb-3",children:[g("div",{className:"f4",innerHTML:t.innerHTML})]}))}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 details"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 details");e&&document.querySelector(".repository-content").prepend(e)}},new class extends v{isApplieble(e){return o(e)}waitUntilFixerReady(){return k("main:nth-child(1) .flex-shrink-0.col-12.col-md-3")}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-9.mb-4.mb-md-0"),r=document.querySelector(".gutter-condensed.gutter-lg.d-flex.flex-column.flex-md-row");e.append(...t.children),r.parentElement.removeChild(r)}},new class extends v{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(){return k({selectors:["main:nth-child(1) #readme"],timeout:300})}apply(){let e=document.querySelector("#readme");if(e){e.className="Box md js-code-block-container Box--condensed",e.querySelector(".Box-header").className="Box-header d-flex flex-items-center flex-justify-between";let t='',r=e.querySelector(".Box-title.pr-3");r.innerHTML=t+r.innerHTML}}},new class extends v{apply(){this._setupObserver(),this._fixAll()}_needToBeFixed(e){return!e.hasAttribute("defreshed")&&e.href&&!d(e.href)&&(!!(t=e.href)&&(t.startsWith("/")||p(t,location.host)))&&l(e.href)&&!function(e=location.pathname){return(s(e)||"").startsWith("raw/")}(e.href)&&!function(e=location.pathname){return(s(e)||"").startsWith("archive/")}(e.href)&&!u(e.href);var t}_fix(e){e.setAttribute("defreshed",""),e.addEventListener("click",(async function(e){e.metaKey||e.ctrlKey||(e.stopPropagation(),e.preventDefault(),q(m(this.href)))}))}_fixAll(){[...document.querySelectorAll("a")].filter(this._needToBeFixed).forEach(this._fix)}_setupObserver(){window.defreshObserver||(window.defreshObserver=new MutationObserver(()=>this._fixAll()),window.defreshObserver.observe(document.body,{childList:!0,subtree:!0}))}},new class extends v{apply(){window.onpopstate=function(){let e=document.location.href;h(e)&&l(e)&&!d(e)?q(e,!1):window.location.href=document.location.href}}}];async function E(e=window.location.href){let t=document.createElement("backup");for(let r of _)if(r.isApplieble(e,t)&&await r.waitUntilFixerReady())try{r.apply(e,t)}catch(e){console.log("Fixer exception: ",e)}}!window.defreshed&&h()&&(window.defreshed=!0,E())}]); \ No newline at end of file +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";const n=r(1),a=r(2);t.all=n,t.check=e=>(e=(e||"").toString().toLowerCase(),n.includes(e)),t.oddballs=e=>e&&e in a?a[e]:Object.keys(a).sort()},function(e){e.exports=JSON.parse('["400","401","402","403","404","405","406","407","408","409","410","411","412","413","414","415","416","417","418","419","420","421","422","423","424","425","426","427","428","429","430","431","500","501","502","503","504","505","506","507","508","509","510","511","about","access","account","admin","anonymous","any","api","apps","attributes","auth","billing","blob","blog","bounty","branches","business","businesses","c","cache","case-studies","categories","central","certification","changelog","cla","cloud","codereview","collection","collections","comments","commit","commits","community","companies","compare","contact","contributing","cookbook","coupons","customer","customers","dashboard","dashboards","design","develop","developer","diff","discover","discussions","docs","downloads","downtime","editor","editors","edu","enterprise","events","explore","featured","features","files","fixtures","forked","garage","ghost","gist","gists","graphs","guide","guides","help","help-wanted","home","hooks","hosting","hovercards","identity","images","inbox","individual","info","integration","interfaces","introduction","invalid-email-address","investors","issues","jobs","join","journal","journals","lab","labs","languages","launch","layouts","learn","legal","library","linux","listings","lists","login","logos","logout","mac","maintenance","malware","man","marketplace","mention","mentioned","mentioning","mentions","migrating","milestones","mine","mirrors","mobile","navigation","network","new","news","none","nonprofit","nonprofits","notices","notifications","oauth","offer","open-source","organisations","organizations","orgs","pages","partners","payments","personal","plans","plugins","popular","popularity","posts","press","pricing","professional","projects","pulls","raw","readme","recommendations","redeem","releases","render","reply","repositories","resources","restore","revert","save-net-neutrality","saved","scraping","search","security","services","sessions","settings","shareholders","shop","showcases","signin","signup","site","spam","sponsors","ssh","staff","starred","stars","static","status","statuses","storage","store","stories","styleguide","subscriptions","suggest","suggestion","suggestions","support","suspended","talks","teach","teacher","teachers","teaching","teams","ten","terms","timeline","topic","topics","tos","tour","train","training","translations","tree","trending","updates","username","users","visualization","w","watching","wiki","windows","works-with","www0","www1","www2","www3","www4","www5","www6","www7","www8","www9"]')},function(e){e.exports=JSON.parse('{"avatars":{"reserved":true,"taken":true,"typical":true,"included":false},"assets":{"reserved":true,"taken":true,"typical":true,"included":false},"bookmarks":{"reserved":true,"taken":true,"typical":true,"included":false},"checks":{"reserved":true,"taken":true,"typical":true,"included":false},"conversations":{"reserved":true,"taken":true,"typical":true,"included":false},"labels":{"reserved":true,"taken":true,"typical":true,"included":false},"media":{"reserved":true,"taken":true,"typical":true,"included":false},"nodes":{"reserved":true,"taken":true,"typical":true,"included":false},"owners":{"reserved":true,"taken":true,"typical":true,"included":false},"page":{"reserved":true,"taken":true,"typical":true,"included":false},"registry":{"reserved":true,"taken":true,"typical":true,"included":false},"seats":{"reserved":true,"taken":true,"typical":true,"included":false},"shared":{"reserved":true,"taken":true,"typical":true,"included":false},"tasks":{"reserved":true,"taken":true,"typical":true,"included":false},"uploads":{"reserved":true,"taken":true,"typical":true,"included":false},"account":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"apps":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/marketplace","included":true},"blog":{"reserved":true,"taken":false,"typical":false,"redirect":"https://blog.github.com","included":true},"c":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/contact","included":true},"contributing":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/careers","included":true},"customer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"customers":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/business/customers","included":true},"developer":{"reserved":true,"taken":false,"typical":false,"redirect":"https://developer.github.com","included":true},"edu":{"reserved":true,"taken":false,"typical":false,"redirect":"https://education.github.com","included":true},"guides":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"help":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com","included":true},"launch":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/search","included":true},"mac":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"mirrors":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/about-github-mirrors/","included":true},"pages":{"reserved":true,"taken":false,"typical":false,"redirect":"https://pages.github.com","included":true},"plans":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/pricing","included":true},"press":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/about/press","included":true},"readme":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/about","included":true},"repositories":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/trending","included":true},"resources":{"reserved":true,"taken":false,"typical":false,"redirect":"https://resources.github.com","included":true},"security":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-security/","included":true},"settings":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/settings/profile","included":true},"signup":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/join","included":true},"terms":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"topic":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com/topics","included":true},"tos":{"reserved":true,"taken":false,"typical":false,"redirect":"https://help.github.com/articles/github-terms-of-service/","included":true},"training":{"reserved":true,"taken":false,"typical":false,"redirect":"https://services.github.com","included":true},"users":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"wiki":{"reserved":true,"taken":false,"typical":false,"redirect":"https://github.com","included":true},"windows":{"reserved":true,"taken":false,"typical":false,"redirect":"https://desktop.github.com","included":true},"collections":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"Curated lists of GitHub repos"},"hovercards":{"reserved":true,"taken":false,"typical":false,"included":true,"notes":"HTTP ERROR 406"},"inbox":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com/410","included":true,"notes":"410 ERROR"},"invalid-email-address":{"reserved":true,"taken":true,"typical":false,"included":true,"notes":"HTTP ERROR 404"},"suggestions":{"reserved":true,"taken":false,"typical":false,"included":true},"suspended":{"reserved":true,"taken":true,"typical":false,"redirect":"https://github.com","included":true,"notes":"Page behaviour depends on whether you\'re logged in or if your account is actually suspended"},"case-studies":{"reserved":false,"taken":true,"typical":false,"included":true},"watching":{"reserved":false,"taken":true,"typical":false,"included":true},"save-net-neutrality":{"reserved":false,"taken":true,"typical":false,"included":true},"ghost":{"reserved":false,"taken":true,"typical":true,"included":true},"status":{"reserved":true,"taken":false,"typical":false,"included":true}}')},function(e,t,r){"use strict";r.r(t);var n=r(0);function a(e=location.pathname){try{e=new URL(e).pathname}catch(e){}return e.replace(/^[/]|[/]$/g,"")}function i(e=location.pathname){return l(e=a(e))?e.split("/",2).join("/"):null}function s(e=location.pathname){if(!l(e=a(e)))return null;let t=e.match(/^[^/]+[/][^/]+[/]?(.*)$/);return t?t[1]:null}function l(e=location.pathname){let t=(e=a(e)).substring(0,e.indexOf("/"));return/^[^/]+\/[^/]+/.test(e)&&!Object(n.check)(t)&&!function(e=location.pathname){return/^((orgs[/][^/]+[/])?dashboard([/]index[/]\d+)?)?$/.test(a(e))}(e)&&!function(e=location.pathname){return/^([^/]+[/][^/]+\/)?notifications/.test(a(e))}(e)}function o(e=location.pathname){return/^(tree[/][^/]+)?$/.test(s(e))}function c(e=location.pathname){return/^tree\//.test(s(e))}function u(e=location.pathname){return function(e=location.pathname){return(s(e)||"").startsWith("raw/")}(e)||function(e=location.pathname){return(s(e)||"").startsWith("archive/")}(e)||function(e=location.pathname){return(s(e)||"").startsWith("releases/download/")}(e)}function d(e=location.pathname){return/^projects\/\d+$/.test(s(e))}function p(e=location.pathname){return/#[^\/]*$/.test(e)}function m(e,t){try{return new URL(e).host==t}catch(e){return!1}}function h(e=location.pathname,t=location.host,r=location.protocol){return function(e){try{return new URL(e),!0}catch(e){return!1}}(e)?e:`${r}//${t}/${e=a(e)}`}function f(e=window.location.href){return m(e,"github.com")}function y(e,t){if(e instanceof HTMLElement&&(function(e){return!!e&&"function"==typeof e[Symbol.iterator]}(t.children)&&(e.append(...t.children),delete t.children),t.attributes&&"object"==typeof t.attributes)){for(let r in t.attributes)e.setAttribute(r,t.attributes[r]);delete t.attributes}for(let r in t){let n=e[r],a=t[r];a&&"object"==typeof a?(null==n&&(n=e[r]={}),y(n,a)):e[r]=t[r]}}function g(e){return v("style",{type:"text/css",children:[e]})}function v(e="div",t){"string"==typeof t&&(t={className:t}),t=t||{};let r=document.createElement(e);return y(r,t),r}class b{isApplieble(e=window.location.href,t=null){return!0}waitUntilFixerReady(e=window.location.href,t=null){return!0}apply(e=window.location.href,t=null){}}function w(e){return new Promise(t=>{setTimeout(t,e)})}async function x(e,t,r){let n=new Date;for(;!e()&&new Date-n!!e.querySelector(t),r,n)}async function S(e){"string"==typeof e?e={selectors:[...arguments]}:e instanceof Node&&(e={container:arguments[0],selectors:[...arguments].splice(1)}),(e={container:document,interval:100,timeout:1500,selectors:[],...e}).selector&&(e.selectors=[e.selector]),e.selectors&&!Array.isArray(e.selectors)&&(e.selectors=[...e.selectors]);let t=await Promise.all(e.selectors.map(t=>k(e.container,t,e.interval,e.timeout)));return t.every(e=>e)}async function q(e){!function(){let e=document.querySelector(".progress-pjax-loader");if(e){const t=1200,r=100;e.firstElementChild.style.width=0,e.style.opacity="100%";for(let n=0;ne.firstElementChild.style.width=r+"%",n)}setTimeout(()=>e.style.opacity=0,t+r)}}();let t=await fetch(e);return{document:(new DOMParser).parseFromString(await t.text(),"text/html"),url:t.url}}async function _(e=window.location.href,t=!0){let r=function(e=location.pathname){return!a(e)}(),n=d(),i=await q(e),s=i.document.querySelector("main");if(s.style.display="none",r){document.querySelector("body > div.application-main").prepend(v("div",{className:"",attributes:{itemscope:"",itemtype:"http://schema.org/SoftwareSourceCode"},children:[v("main")]}))}let l=document.querySelector("main");if(l.parentElement.insertBefore(s,l),await A(i.url),l.replaceWith(s),r){let e=document.querySelector("body > div.application-main");for(let t of[...e.children].splice(1))e.removeChild(t);document.body.className="logged-in env-production page-responsive intent-mouse"}else n&&(s.parentElement.className="");s.style.display="",document.head.querySelector("title").innerText=i.document.head.querySelector("title").innerText;let o=document.querySelector("header"),c=i.document.querySelector("header");o&&c&&o.replaceWith(c),t&&function(e){try{history.pushState(null,null,e)}catch(t){location.hash="#"+e}}(i.url)}var E=[new class extends b{apply(){document.head.append(g(".topic-tag {\n display: inline-block !important;\n padding: .3em .9em !important;\n margin: 0 .5em .5em 0 !important;\n white-space: nowrap !important;\n border-radius: 3px !important;\n line-height: 1.5 !important;\n font-size: 12px !important;\n border: none !important;\n }"))}},new class extends b{apply(){document.head.append(g("\n .overall-summary {\n border-radius: 3px !important;\n }\n\n .repository-lang-stats-graph {\n border-bottom-left-radius: 3px !important;\n border-bottom-right-radius: 3px !important;\n }\n\n .repository-lang-stats-graph .language-color:first-child {\n border-bottom-left-radius: 3px !important;\n }\n\n .repository-lang-stats-graph .language-color:last-child {\n border-bottom-right-radius: 3px !important;\n }\n "))}},new class extends b{apply(){document.head.append(g("\n .btn {\n border-radius: 3px !important;\n }\n\n .repository-content .file-navigation .btn {\n padding: 3px 10px !important;\n font-size: 12px !important;\n line-height: 20px !important;\n font-weight: 600 !important;\n }\n\n #branch-select-menu svg {\n display: none !important;\n }\n\n #branch-select-menu .btn > span {\n font-weight: 600 !important;\n }\n\n .pagehead-actions .btn {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n padding: 3px 10px !important;\n }\n\n .pagehead-actions a.social-count {\n border-top-right-radius: 3px !important;\n border-bottom-right-radius: 3px !important;\n padding: 3px 10px !important;\n }\n "))}},new class extends b{apply(){document.head.append(g("img.avatar, img.avatar-user, a.avatar-user {\n border-radius: 3px !important;\n }"))}},new class extends b{apply(){document.head.append(g("\n div.Box, .markdown-body pre {\n border-radius: 3px !important;\n }\n \n div.Box-header {\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n }\n "))}},new class extends b{isApplieble(e){return l(e)&&!d(e)}waitUntilFixerReady(){return S("main:nth-child(1) .container-xl")}apply(){[...document.querySelectorAll("main .container-xl")].forEach(e=>e.className="container-lg clearfix new-discussion-timeline px-3")}},new class extends b{isApplieble(e){return l(e)}waitUntilFixerReady(){return S("main:nth-child(1) > div.repohead")}apply(e){let t=document.querySelector("main > div.repohead");d(e)||(t.className="pagehead repohead hx_repohead readability-menu bg-gray-light pb-0 pt-3",t.firstElementChild.className="d-flex container-lg mb-4 px-3"),t.querySelector("nav").className="js-repo-nav js-sidenav-container-pjax clearfix hx_reponav reponav px-3 container-lg",t.querySelector("nav > ul").className="list-style-none",[...t.querySelectorAll("nav > ul > li")].forEach(e=>{e.className="";let t=e.querySelector("a"),r=t.classList.contains("selected");t.className="js-selected-navigation-item reponav-item"+(r?" selected":"")})}},new class extends b{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(e){let t=["main:nth-child(1) .repository-content .js-details-container .Details-content--hidden"];return o(e)&&t.push(".repository-content ul.list-style-none.d-flex li:nth-child(3)"),S(...t)}apply(e,t){let r=document.querySelector(".repository-content div.css-truncate.css-truncate-overflow.text-gray");o(e)&&(this._backupCommitsDetails(t),this._backupBranchesDetails(t)),this._moveCommitDate(r),this._fixCommitMessage(r)}_backupCommitsDetails(e){this._backupDetails("backup-commits",e)}_backupBranchesDetails(e){this._backupDetails("backup-branches",e)}_backupDetails(e,t){let r=document.querySelector(".repository-content ul.list-style-none.d-flex li:nth-child(1)");r.id=e,t.append(r)}_moveCommitDate(e){let t=e.parentElement.parentElement.querySelector(":scope > div.flex-shrink-0:not(.hx_avatar_stack_commit)");for(let e of[...t.children])t.removeChild(e);let r=v("div",{className:"css-truncate css-truncate-overflow text-gray",children:["Latest commit ",e.querySelector(".text-mono")," ",e.querySelector("relative-time")]});t.append(r)}_fixCommitMessage(e){let t=e.parentElement.parentElement.querySelector(":scope > .Details-content--hidden"),r=t.querySelector("a"),n=t.querySelector("pre"),a=t.querySelector("a[anchor='comments']"),i=e.parentElement.querySelector(":scope > span.hidden-text-expander"),s=e.querySelector(".commit-author");for(let t of[...e.childNodes])e.removeChild(t);r.classList.remove("text-bold"),e.append(s," ",r),i&&(a&&i.parentElement.insertBefore(a,i),n||i.parentElement.removeChild(i))}},new class extends b{isApplieble(e){return o(e)}waitUntilFixerReady(){return S({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .Progress"],timeout:300})}apply(){let e=v("div","d-flex repository-lang-stats-graph"),t=v("ol","repository-lang-stats-numbers"),r=v("details",{className:"details-reset mb-3",children:[v("summary",{title:"Click for language details",children:[e]}),v("div",{className:"repository-lang-stats",children:[t]})]}),n=[...document.querySelector(".flex-shrink-0.col-12.col-md-3 .Progress").parentElement.nextElementSibling.children];for(let r of n.map(this._extractLanguageData)){let n=v("span",{className:"language-color",attributes:{"aria-label":`${r.name} ${r.percent}`,itemprop:"keywords"},innerText:r.name,style:{width:r.percent,backgroundColor:r.color}});e.append(n);let a=v(r.link?"a":"span",{href:r.link,children:[v("span",{className:"color-block language-color",style:{backgroundColor:r.color}}),v("span",{className:"lang",innerText:` ${r.name} `}),v("span",{className:"percent",innerText:r.percent})]});t.append(v("li",{children:[a]}))}document.querySelector(".repository-content").prepend(r)}_extractLanguageData(e){return e.querySelector("a")?{name:e.querySelector("span").innerText,percent:e.querySelectorAll("span")[1].innerText,color:e.querySelector("svg").style.color,link:e.querySelector("a").href}:{name:e.querySelectorAll("span")[1].innerText,percent:e.querySelectorAll("span")[2].innerText,color:e.querySelector("svg").style.color,link:""}}},new class extends b{isApplieble(e){return o(e)}apply(e,t){let r=document.querySelector(".repository-content details summary div.repository-lang-stats-graph"),n=v("ul",{className:"numbers-summary",children:[this._createCommitsSummaryElement(t),this._createBranchesSummaryElement(t),this._createPackagesSummaryElement(e),this._createReleasesSummaryElement(e),this._createContributorsSummaryElement(e),this._createLicenseSummaryElement()].filter(e=>e)});document.querySelector(".repository-content").prepend(v("div",{className:"overall-summary "+(r?"border-bottom-0 mb-0 rounded-bottom-0":"mb-3"),children:[n]}))}_createCommitsSummaryElement(e){let t=e.querySelector("#backup-commits"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"commit",r)}_createBranchesSummaryElement(e){let t=e.querySelector("#backup-branches"),r=t.querySelector("strong").innerText,n=t.querySelector("a").href;return this._createSummaryElement('',n,"branch",r,"es")}_createPackagesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"package","s",0,"",!1)}_createReleasesSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"release")}_createContributorsSummaryElement(e){return this._createSummaryElementFromRightBar(e,'',"contributor","s",1,"graphs/")}_createLicenseSummaryElement(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 svg.octicon-law");if(e){let t=e.parentElement.href,r=e.parentElement.innerText.trim().replace(" License",""),n='';return this._createSummaryElement(n,t,r)}return null}_createSummaryElementFromRightBar(e,t,r,n="s",a=0,s="",l=!0){let o,c,u=r+n,d=[...document.querySelectorAll(".flex-shrink-0.col-12.col-md-3 div.BorderGrid-cell")].find(e=>{let t=e.querySelector("a");return t&&t.href.endsWith(u)});return d||l?(d?(o=(d.querySelector("span.Counter")||{}).innerText||0,c=d.querySelector("a").href):(o=a,c=i(e)+"/"+s+u),this._createSummaryElement(t,c,r,o,n)):null}_createSummaryElement(e,t,r,n=-1,a="s"){let i=e+"\n";return-1==n?i+=r:(i+=`${n}`,i+="\n",i+=r,1!=n&&(i+=a)),v("li",{children:[v("a",{href:t,innerHTML:i})]})}},new class extends b{isApplieble(e){return o(e)}waitUntilFixerReady(){return S({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 div.list-topics-container.f6");e&&document.querySelector(".repository-content").prepend(v("div",{className:"repository-topics-container mt-2 mb-3 js-topics-list-container",children:[e]}))}},new class extends b{isApplieble(e){return o(e)}waitUntilFixerReady(){return S({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 .f4"],timeout:300})}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-3 .f4"),r=e.querySelector("div.list-topics-container.f6");t&&e.prepend(v("div",{className:r?"":"mb-3",children:[v("div",{className:"f4",innerHTML:t.innerHTML})]}))}},new class extends b{isApplieble(e){return o(e)}waitUntilFixerReady(){return S({selectors:["main:nth-child(1) .flex-shrink-0.col-12.col-md-3 details"],timeout:300})}apply(){let e=document.querySelector(".flex-shrink-0.col-12.col-md-3 details");e&&document.querySelector(".repository-content").prepend(e)}},new class extends b{isApplieble(e){return o(e)}waitUntilFixerReady(){return S("main:nth-child(1) .flex-shrink-0.col-12.col-md-3")}apply(){let e=document.querySelector(".repository-content"),t=document.querySelector(".flex-shrink-0.col-12.col-md-9.mb-4.mb-md-0"),r=document.querySelector(".gutter-condensed.gutter-lg.d-flex.flex-column.flex-md-row");e.append(...t.children),r.parentElement.removeChild(r)}},new class extends b{isApplieble(e){return o(e)||c(e)}waitUntilFixerReady(){return S({selectors:["main:nth-child(1) #readme"],timeout:300})}apply(){let e=document.querySelector("#readme");if(e){e.className="Box md js-code-block-container Box--condensed",e.querySelector(".Box-header").className="Box-header d-flex flex-items-center flex-justify-between";let t='',r=e.querySelector(".Box-title.pr-3");r.innerHTML=t+r.innerHTML}}},new class extends b{apply(){this._setupObserver(),this._fixAll()}_needToBeFixed(e){return!e.hasAttribute("defreshed")&&e.href&&!p(e.href)&&(!!(t=e.href)&&(t.startsWith("/")||m(t,location.host)))&&l(e.href)&&!u(e.href)&&!d(e.href);var t}_fix(e){e.setAttribute("defreshed",""),e.addEventListener("click",(async function(e){e.metaKey||e.ctrlKey||(e.stopPropagation(),e.preventDefault(),_(h(this.href)))}))}_fixAll(){[...document.querySelectorAll("a")].filter(this._needToBeFixed).forEach(this._fix)}_setupObserver(){window.defreshObserver||(window.defreshObserver=new MutationObserver(()=>this._fixAll()),window.defreshObserver.observe(document.body,{childList:!0,subtree:!0}))}},new class extends b{apply(){window.onpopstate=function(){let e=document.location.href;f(e)&&l(e)&&!p(e)?_(e,!1):window.location.href=document.location.href}}}];async function A(e=window.location.href){let t=document.createElement("backup");for(let r of E)if(r.isApplieble(e,t)&&await r.waitUntilFixerReady(e,t))try{r.apply(e,t)}catch(e){console.log("Fixer exception: ",e)}}!window.defreshed&&f()&&(window.defreshed=!0,A())}]); \ No newline at end of file