text: self.System=self.System||(()=>{const e={},t={},n=e=>e.replace(/^.\/(\w+)-[a-f0-9]{8,}.js$/,"./$1.js"),s={register(o,r){const i=n(`./${((document.currentScript||{}).src||"").split("?").shift().split("/").pop()}`),a={},c=r((e,t)=>t?a[e]=t:Object.assign(a,e),s);e[i]=Promise.all(o.map((e,t)=>s.import(n(e)).then(c.setters[t]))).then(()=>(c.execute(),a)).catch(e=>{throw e.message=`evaluating module ${i}: ${e.message}`,e}),t[i]&&(t[i](e[i]),delete t[i])},import:n=>e[n]||(e[n]=new Promise((e,s)=>{const o=setTimeout(()=>{s(new Error(`could not resolve ${n}`))},1e4);t[n]=(t=>{clearTimeout(o),e(t)})}))};return s})(),System.register(["./frameworks.js"],function(e,t){"use strict";var n,s,o,r,i,a,c,l,u,d,m,f,g,p,h,j,v,b,L,y,E,w,T,k,S,A,M,H,x,q,I,C,_,$,R,N,P,D,F,O,B,U,W,z,V,K,G,J,Q,X,Y,Z,ee,te,ne,se,oe,re,ie,ae,ce,le,ue,de,me,fe,ge,pe,he,je,ve,be,Le,ye,Ee,we,Te,ke,Se,Ae,Me,He,xe,qe,Ie,Ce,_e,$e,Re,Ne,Pe,De,Fe,Oe,Be,Ue,We,ze,Ve,Ke,Ge,Je,Qe,Xe,Ye,Ze,et,tt,nt,st,ot,rt,it,at,ct,lt,ut,dt,mt,ft,gt,pt,ht,jt,vt,bt,Lt,yt,Et,wt,Tt,kt,St,At;return{setters:[function(e){n=e.d,s=e.a,o=e.i,r=e.k,i=e.e,a=e.x,c=e.r,l=e.j,u=e.o,d=e.f,m=e.y,f=e.z,g=e.g,p=e.A,h=e.q,j=e.B,v=e.v,b=e.C,L=e.D,y=e.m,E=e.n,w=e.E,T=e.F,k=e.w,S=e.G,A=e.H,M=e.I,H=e.J,x=e.K,q=e.L,I=e.M,C=e.N,_=e.O,$=e.P,R=e.Q,N=e.R,P=e.S,D=e.T,F=e.U,O=e.V,B=e.W,U=e.p,W=e.X,z=e.Y,V=e.Z,K=e._,G=e.$,J=e.a0,Q=e.a1,X=e.a2,Y=e.a3,Z=e.a4,ee=e.a5,te=e.a6,ne=e.a7,se=e.a8,oe=e.a9,re=e.aa,ie=e.ab,ae=e.ac,ce=e.ad,le=e.ae,ue=e.af,de=e.ag,me=e.ah,fe=e.ai,ge=e.aj,pe=e.ak,he=e.al,je=e.am,ve=e.an,be=e.ao,Le=e.h,ye=e.ap,Ee=e.aq,we=e.b,e.c,Te=e.u,ke=e.ar,Se=e.as,Ae=e.at,Me=e.au,He=e.av,xe=e.aw,qe=e.ax,Ie=e.ay,Ce=e.az,_e=e.aA,$e=e.aB,Re=e.aC,Ne=e.aD,Pe=e.aE,De=e.aF,Fe=e.aG,Oe=e.aH,Be=e.aI,Ue=e.aJ,We=e.aK,ze=e.aL,Ve=e.aM,Ke=e.aN,Ge=e.aO,Je=e.aP,Qe=e.aQ,Xe=e.aR,Ye=e.aS,Ze=e.aT,et=e.aU,tt=e.aV,nt=e.aW,st=e.aX,ot=e.aY,rt=e.aZ,it=e.a_,at=e.a$,ct=e.b0,lt=e.b1,ut=e.b2,dt=e.b3,mt=e.b4,ft=e.b5,gt=e.b6,pt=e.b7,ht=e.b8,jt=e.b9,vt=e.ba,bt=e.bb,Lt=e.bc,yt=e.bd,Et=e.be,wt=e.bf,Tt=e.bg,kt=e.bh,St=e.bi,At=e.bj}],execute:function(){var e=-1/0,t=1/0,Mt=-.005,Ht=-.005,xt=-.01,qt=1,It=.9,Ct=.8,_t=.7,$t=.6;function Rt(e){return e.toUpperCase()===e}function Nt(t,n,s,o){for(var r=t.length,i=n.length,a=t.toLowerCase(),c=n.toLowerCase(),l=function(e){for(var t,n=e.length,s=new Array(n),o="/",r=0;r<n;r++){var i=e[r];"/"===o?s[r]=It:"-"===o||"_"===o||" "===o?s[r]=Ct:"."===o?s[r]=$t:(t=o).toLowerCase()===t&&Rt(i)?s[r]=_t:s[r]=0,o=i}return s}(n),u=0;u<r;u++){s[u]=new Array(i),o[u]=new Array(i);for(var d=e,m=u===r-1?Ht:xt,f=0;f<i;f++)if(a[u]===c[f]){var g=e;u?f&&(g=Math.max(o[u-1][f-1]+l[f],s[u-1][f-1]+qt)):g=f*Mt+l[f],s[u][f]=g,o[u][f]=d=Math.max(g,d+m)}else s[u][f]=e,o[u][f]=d+=m}}var Pt={SCORE_MIN:e,SCORE_MAX:t,SCORE_GAP_LEADING:Mt,SCORE_GAP_TRAILING:Ht,SCORE_GAP_INNER:xt,SCORE_MATCH_CONSECUTIVE:qt,SCORE_MATCH_SLASH:It,SCORE_MATCH_WORD:Ct,SCORE_MATCH_CAPITAL:_t,SCORE_MATCH_DOT:$t,score:function(n,s){var o=n.length,r=s.length;if(!o||!r)return e;if(o===r)return t;if(r>1024)return e;var i=new Array(o),a=new Array(o);return Nt(n,s,i,a),a[o-1][r-1]},positions:function(t,n){var s=t.length,o=n.length,r=new Array(s);if(!s||!o)return r;if(s===o){for(var i=0;i<s;i++)r[i]=i;return r}if(o>1024)return r;var a=new Array(s),c=new Array(s);Nt(t,n,a,c);for(var l=!1,u=(i=s-1,o-1);i>=0;i--)for(;u>=0;u--)if(a[i][u]!==e&&(l||a[i][u]===c[i][u])){l=i&&u&&c[i][u]===a[i-1][u-1]+qt,r[i]=u--;break}return r},hasMatch:function(e,t){e=e.toLowerCase(),t=t.toLowerCase();for(var n=e.length,s=0,o=0;s<n;s+=1)if(0===(o=t.indexOf(e[s],o)+1))return!1;return!0}};const Dt=(e,t,n)=>{e.innerHTML="";let s=0;for(const o of Pt.positions(t,n)){""!==n.slice(s,o)&&e.appendChild(document.createTextNode(n.slice(s,o))),s=o+1;const t=document.createElement("mark");t.textContent=n[o],e.appendChild(t)}e.appendChild(document.createTextNode(n.slice(s)))},Ft=new WeakMap,Ot=new WeakMap,Bt=e=>{if(!Ot.has(e)&&e instanceof HTMLElement){const t=e.getAttribute("data-value")||e.textContent||"";return Ot.set(e,t),t}return Ot.get(e)||""};class FuzzyListElement extends HTMLElement{connectedCallback(){const e=this.querySelector("ul");if(!(e instanceof HTMLUListElement))return;const t=new Set(e.querySelectorAll("li")),n=new MutationObserver(e=>{let n=!1;for(const s of e)if("childList"===s.type&&s.addedNodes.length)for(const e of s.addedNodes)n=n||!t.has(e),t.add(e);n&&this.sort()});n.observe(e,{childList:!0});const s={handler:n,items:t,timer:null};Ft.set(this,s)}disconnectedCallback(){const e=Ft.get(this);e&&(e.handler.disconnect(),Ft.delete(this))}sort(){const e=this.threshold,t=this.mark,n=this.limit,s=this.value;if(!s)return;const o=Ft.get(this);if(!o)return;if(!this.dispatchEvent(new CustomEvent("fuzzy-list-will-sort",{cancelable:!0,detail:s})))return;const r=o.items,i=this.hasAttribute("data-mark"),a=[];for(const c of r){const t=Bt(c);if(!Pt.hasMatch(s,t))continue;const n=Pt.score(s,t);n<e||a.push({item:c,score:n})}a.sort((e,t)=>t.score-e.score).splice(n),requestAnimationFrame(()=>{const e=this.querySelector("ul");if(!(e instanceof HTMLUListElement))return;e.innerHTML="";const n=document.createDocumentFragment();for(const o of a){const e=o.item;i&&e instanceof HTMLElement&&Dt(t&&e.querySelector(t)||e,i?s:"",Bt(e)),n.appendChild(e)}e.appendChild(n),this.dispatchEvent(new CustomEvent("fuzzy-list-sorted",{detail:a.length}))})}get value(){return this.getAttribute("value")||""}set value(e){this.setAttribute("value",e)}get mark(){return this.getAttribute("data-mark")||""}set mark(e){e?this.setAttribute("data-mark",!0===e?"":e):this.removeAttribute("data-mark")}get threshold(){return Number(this.getAttribute("data-threshold")||0)}set threshold(e){Number.isNaN(e)||this.setAttribute("data-threshold",String(e))}get limit(){return Number(this.getAttribute("data-limit")||1/0)}set limit(e){Number.isNaN(e)||this.setAttribute("data-limit",String(e))}static get observedAttributes(){return["value","data-mark","data-threshold","data-limit"]}attributeChangedCallback(e,t,n){if(t===n)return;const s=Ft.get(this);s&&(s.timer&&clearTimeout(s.timer),s.timer=setTimeout(()=>this.sort(),100))}}function Ut(e){const t=s(e,'input[type="radio"]',HTMLInputElement),n=t.hasAttribute("data-already-member"),o=r(e,"form");if(o.classList.toggle("is-member",n),o.classList.toggle("is-not-member",!n),t.hasAttribute("data-member-type")){const e=t.getAttribute("data-member-type");if(e){const t=s(o,'input[type="hidden"][name="member_type"]',HTMLInputElement);t&&(t.value=e)}}}function Wt(){s(document,".js-workflow-submit",HTMLButtonElement).disabled=!document.querySelector(".js-workflow-option:checked")||!document.querySelector(".js-repository-id:checked")}function zt(){const e=u(document,"input[type=text].js-advanced-search-prefix",HTMLInputElement),t=u(document,"select.js-advanced-search-prefix",HTMLSelectElement),n=u(document,".js-advanced-search-prefix:checked",HTMLInputElement),o=[...Kt(e),...Kt(t),...Kt(n)],r=o.reduce((e,t)=>(t.value&&t.type&&e[t.type]++,e),{Repositories:0,Users:0,Code:0,Issues:0}),i=o.reduce((e,t)=>`${e} ${function(e){let t=e.prefix,n=e.value;return""===t?"":n?`${t}${n}`:""}(t)}`.trim(),""),a=s(document,".js-advanced-search-input",HTMLInputElement).value;s(document,".js-type-value",HTMLInputElement).value=function(e){let t=0,n="Repositories";for(const s in e)e[s]>t&&(t=e[s],n=s);return n}(r),s(document,".js-search-query",HTMLInputElement).value=`${a} ${i}`.trim();const c=s(document,".js-advanced-query");c.innerHTML="",c.textContent=i;const l=document.createElement("span");l.textContent=a.trim(),c.prepend(l," ")}function Vt(e){return-1!==e.search(/\s/g)?`"${e}"`:e}function Kt(e){return e.map(e=>{const t=e.value.trim(),n=d(e,"data-search-prefix"),s=e.getAttribute("data-search-type");return""===n?{prefix:n,value:t,type:s}:-1!==t.search(/,/g)&&"location"!==n?t.split(/,/).map(e=>({prefix:n,value:Vt(e.trim()),type:s})):{prefix:n,value:Vt(t),type:s}}).reduce((e,t)=>e.concat(t),[])}function Gt(e){return i(e instanceof HTMLElement,"null.js:14"),e.querySelectorAll(".js-integrations-install-repo-picked .js-repository-picker-result").length}function Jt(e){i(e instanceof HTMLElement,"null.js:30");const t=e.querySelector("input.js-no-repositories-radio"),n=e.querySelector("input.js-all-repositories-radio");return i(n instanceof HTMLInputElement,"null.js:33"),t instanceof HTMLInputElement&&t.checked||n.checked||function(e){return Gt(e)>0}(e)}function Qt(){return document.querySelector(".js-apps-install-select-repositories-container")}function Xt(){const e=Qt();return e&&e.querySelector(".js-filterable-field")}function Yt(e){return function(){const t=e.querySelector("button.js-integrations-install-form-submit");i(t instanceof HTMLButtonElement,"null.js:51"),t.disabled=!Jt(e);const n=e.querySelector(".flash");n&&n.classList.toggle("d-none",!function(e){const t=+e.getAttribute("data-max-repos");if(t)return Gt(e)>=t}(e))}}function Zt(){let e=0;0!==document.querySelectorAll(".js-integrations-install-repo-picked:not(.d-none)").length&&(e=document.querySelectorAll(".js-repository-picker-result:not(.d-none)").length);let t="";if(e>0){t=`Selected ${e} ${e>1?"repositories":"repository"}`}const n=document.querySelector(".js-integration-total-repos");i(n instanceof HTMLElement,"null.js:78"),n.textContent=t}window.customElements.get("fuzzy-list")||(window.FuzzyListElement=FuzzyListElement,window.customElements.define("fuzzy-list",FuzzyListElement)),n(".js-account-membership",function(e){const t=s(e,".select-menu-item.selected",HTMLElement);t&&Ut(t)}),o("selectmenu:selected",".js-account-membership .select-menu-item",function(e){Ut(e.currentTarget)}),o("change",".js-npm-workflows .js-auto-publish-npm",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:11");const n=t.form;i(n instanceof HTMLFormElement,"null.js:14"),a(n,"secret_value",HTMLTextAreaElement).required=t.checked}),n(".js-npm-workflows",Wt),o("change",".js-workflow-option",Wt),o("change",".js-npm-workflows",Wt),c(".js-advanced-search-prefix",function(){zt()}),o("change",".js-advanced-search-prefix",zt),l(".js-advanced-search-input",function(e){const t=r(e,".js-advanced-search-label");t.classList.add("focus"),e.addEventListener("blur",()=>t.classList.remove("focus"),{once:!0})}),n(".js-advanced-search-input",function(){zt()});let en=new m;function tn(e,t){const n=e.querySelector(".js-app-logo-with-bgcolor");n&&(n.style.backgroundColor=`#${t}`)}function nn(e,t){const n=e.nextElementSibling;if(n)return i(n instanceof HTMLElement,"null.js:8"),n.classList.contains(t)?n:nn(n,t)}n(".js-integrations-install-form",function(e){const t=Qt();if(!t)return;const n=t.querySelector(".js-navigation-container");async function r(e){try{const s=Xt();let o=s&&s.getAttribute("data-alternate-search-url");i(o,"null.js:126");const r=Array.prototype.slice.call(document.querySelectorAll(".js-integrations-install-repo-picked .js-selected-repository-field")).map(function(e){return i(e instanceof HTMLInputElement,"null.js:131"),e.value});o+=~o.indexOf("?")?"&":"?",o+=`q=${encodeURIComponent(e)}`,en.abort(),en=new m;const c=g(o,{signal:en.signal});let l;try{l=await c}catch(t){if(t instanceof p)return;throw t}const u=f(document,l.trim());for(const e of u.querySelectorAll(".js-navigation-item")){const t=e.getAttribute("data-autocomplete-value");r.includes(t)&&e.remove()}for(;n.firstChild;)n.removeChild(n.firstChild);n.append(u)}finally{const e=Qt();e&&e.classList.remove("is-loading"),a=null}}i(n,"null.js:87"),e.addEventListener("change",Yt(e)),o("selectmenu:selected",".js-apps-install-select-repositories-container",function(t){t.target.classList.add("d-none");const n=e.querySelector(".js-integrations-install-repo-picked"),o=t.target.querySelector(".js-repository-picker-result");i(o instanceof HTMLElement,"null.js:100");const a=f(document,o.outerHTML.trim()).querySelector(".js-repository-picker-result");i(a instanceof HTMLElement,"null.js:104"),a.classList.remove("d-none"),i(n,"null.js:107"),n.insertBefore(a,n.firstChild),s(document,".js-min-repository-error").classList.add("d-none"),Zt(),Yt(e).call(),r("")});let a=null;o("filterable:change",".js-apps-install-select-repositories-container",function(e){if(a)return;a=e;const t=Qt();t&&t.classList.add("is-loading"),n.classList.contains("filterable-active")?setTimeout(function(){const e=Xt();if(e instanceof HTMLInputElement){r(e.value.trim())}},1e3):(t&&t.classList.remove("is-loading"),a=null)}),o("click",".js-repository-picker-remove",function(t){const n=t.target.closest(".js-repository-picker-result");i(n instanceof HTMLElement,"null.js:210");const o=t.target.closest("svg.js-repository-picker-remove");if(o){const e=o.getAttribute("data-repo-id");if(e){const t=Qt(),n=t&&t.querySelector(`.js-navigation-item[data-repo-id="${e}"]`);n&&(n.classList.remove("selected"),n.classList.remove("d-none"))}}if(n.remove(),0===s(document,".js-integrations-install-repo-picked").children.length){const e=Array.from(document.querySelectorAll(".js-min-repository-error"));for(const t of e)t.classList.remove("d-none")}return Zt(),r(""),Yt(e).call()}),o("click",".js-apps-install-select-repositories-container .js-menu-target",function(){return s(document,".js-select-repositories-radio",HTMLInputElement).checked=!0,Yt(e).call()}),o("click",".js-no-repositories-radio",function(){s(document,".js-integrations-install-repo-picked, .js-min-repository-error").classList.add("d-none"),Zt()}),o("click",".js-all-repositories-radio",function(){s(document,".js-integrations-install-repo-picked, .js-min-repository-error").classList.add("d-none"),Zt()}),o("click",".js-select-repositories-radio",function(){s(document,".js-integrations-install-repo-picked").classList.remove("d-none"),Zt()})}),o("submit",".js-integrations-install-form",function(e){const t=e.target.querySelector(".js-all-repositories-radio");if(t instanceof HTMLInputElement)if(t.checked){const t=Array.from(e.target.querySelectorAll('input[name="repository_ids[]"]'));for(const e of t)e.remove()}else{const e=Qt();if(!e)return;const t=e.querySelector(".js-navigation-container");for(i(t instanceof HTMLElement,"null.js:287");t.firstChild;)t.removeChild(t.firstChild)}}),h(".js-app-bgcolor-form",async function(e,t){const n=e.querySelector(".js-app-bgcolor-save-notice");if(!n)return;let s;try{s=await t.html()}catch(o){n.classList.remove("visible")}s&&(n.classList.add("visible"),setTimeout(()=>n.classList.remove("visible"),1500))}),c(".js-app-bgcolor-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:46");const n=r(t,"form",HTMLFormElement),s=t.value.replace(/^#/,"");if(s.length<1)return t.classList.remove("text-red"),void tn(n,t.defaultValue);t.checkValidity()?(t.classList.remove("text-red"),tn(n,s),n.classList.contains("js-app-bgcolor-form")&&j(()=>(function(e,t){t.checkValidity()&&v(e)})(n,t),400)()):(t.classList.add("text-red"),tn(n,t.defaultValue))}),o("click",".js-banner .js-next",function(e){const t=r(e.currentTarget,".js-banner"),n=s(t,".js-dismiss",HTMLButtonElement),o=s(t,".js-next",HTMLButtonElement),a=s(t,".js-page.d-block"),c=nn(a,"js-page");i(c,"null.js:43"),a.classList.remove("d-block"),a.classList.add("d-none"),c.classList.remove("d-none"),c.classList.add("d-block"),nn(c,"js-page")||(o.classList.add("d-none"),n.classList.remove("d-none"))}),n(".js-banner",function(e){const t=s(e,".js-dismiss",HTMLButtonElement);if(e.querySelectorAll(".js-page").length>0){const n=s(e,".js-next",HTMLButtonElement),o=s(e,".js-page.d-block",HTMLDivElement);o&&!nn(o,"js-page")?t.classList.remove("d-none"):n.classList.remove("d-none")}else t.classList.remove("d-none")}),o("deprecatedAjaxSend","[data-remote]",function(e){e.currentTarget===e.target&&(e.defaultPrevented||e.currentTarget.classList.add("loading"))}),o("deprecatedAjaxComplete","[data-remote]",function(e){e.currentTarget===e.target&&e.currentTarget.classList.remove("loading")}),h("form.js-ajax-pagination, .js-ajax-pagination form",async function(e,t){const n=r(e,".js-ajax-pagination");let s;try{s=await t.html()}catch(o){if(o.response&&404===o.response.status)return void n.remove();throw o}n.replaceWith(s.html),b(e,"page:loaded")});const sn=new WeakMap;function on(e,t){t.classList.remove("is-loading","successed","errored","warn"),e.classList.remove("is-autocheck-loading","is-autocheck-successful","is-autocheck-errored");const n=t.querySelector("p.note");if(n){const e=sn.get(n);e&&(n.innerHTML=e)}const s=t.querySelector("dd.error");s&&s.remove();const o=t.querySelector("dd.warning");o&&o.remove()}function rn(e){const t=e.closest("form");if(!t)return;const n=t.querySelector(".js-auto-complete-button");n instanceof HTMLButtonElement&&(n.disabled=!e.value)}n("auto-check",function(e){const t=s(e,"input",HTMLInputElement),n=r(t,"dl.form-group"),o=t.form;i(o,"null.js:16");const a=n.querySelector("p.note");a&&sn.set(a,a.innerHTML),e.addEventListener("loadstart",()=>{on(t,n),n.classList.add("is-loading"),t.classList.add("is-autocheck-loading"),L(o)}),e.addEventListener("loadend",()=>{n.classList.remove("is-loading"),t.classList.remove("is-autocheck-loading")}),t.addEventListener("autocheck:success",e=>{i(e instanceof CustomEvent,"null.js:35"),t.classList.add("is-autocheck-successful"),n.classList.add("successed"),L(o);const s=e.detail.message;if(s)if(a)a.innerHTML=s;else{const e=document.createElement("dd");e.classList.add("warning"),e.innerHTML=s,n.append(e),n.classList.add("warn")}}),t.addEventListener("autocheck:error",e=>{if(i(e instanceof CustomEvent,"null.js:56"),t.classList.add("is-autocheck-errored"),n.classList.add("errored"),L(o),a)a.innerHTML=e.detail.message||"Something went wrong";else{const t=e.detail.message||"Something went wrong",s=document.createElement("dd");s.classList.add("error"),s.innerHTML=t,n.append(s)}}),t.addEventListener("input",()=>{t.value||on(t,n)})}),n("auto-complete",function(e){e.addEventListener("loadstart",()=>e.classList.add("is-auto-complete-loading")),e.addEventListener("loadend",()=>e.classList.remove("is-auto-complete-loading"))}),n("auto-complete",{constructor:AutocompleteElement,initialize:rn}),o("change","auto-complete",function(e){i(e.currentTarget instanceof AutocompleteElement,"null.js:18"),rn(e.currentTarget)});const an=new k;async function cn(e){const t=e.form;i(t,"null.js:34"),t.classList.add("is-sending");try{const e=w(t),n=`${t.action}&${e}`.replace(/[?&]/,"?"),s=await an.push(g(n)),o=t.getAttribute("data-results-container"),r=o?document.getElementById(o):null;r&&(r.innerHTML=s),T(null,"",`?${e}`)}finally{t.classList.remove("is-sending")}}function ln(e){e.preventDefault(),e.stopPropagation()}function un(e){const t=e.querySelector(".js-clipboard-clippy-icon"),n=e.querySelector(".js-clipboard-check-icon");e.classList.toggle("ClipboardButton--success"),e.classList.toggle("tooltipped"),e.classList.toggle("tooltipped-s"),t&&t.classList.toggle("d-none"),n&&n.classList.toggle("d-none")}function dn(e,t){const n=e.closest(".js-write-bucket");n&&n.classList.toggle("focused",t)}function mn(e){const t=e.currentTarget;t instanceof Element&&dn(t,!1)}l(".js-autosearch-field",e=>{const t=e;i(t instanceof HTMLInputElement,"null.js:54"),y(t,cn),t.addEventListener("blur",()=>E(t,cn),{once:!0})}),l("input[data-autoselect]",async function(e){i(e instanceof HTMLInputElement,"null.js:10"),await S(),e.select()}),o("change","form[data-autosubmit]",function(e){const t=e.currentTarget;i(t instanceof HTMLFormElement,"null.js:20"),v(t)}),o("change","input[data-autosubmit]",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:25");const n=t.form;i(n,"null.js:27"),v(n)}),A({features:M}),n("a.btn.disabled",{subscribe:e=>H(e,"click",ln)}),(async()=>{await x;const e=function(e){try{return JSON.parse(window.localStorage.getItem(e))}catch(t){return{}}}("bundle-urls")||{},t=function(){const e={};for(const t of document.getElementsByTagName("script")){const n=t.src.match(/\/([\w-]+)-[0-9a-f]{32,}\.js$/);n&&(e[`${n[1]}.js`]=t.src)}for(const t of document.getElementsByTagName("link")){const n=t.href.match(/\/([\w-]+)-[0-9a-f]{32,}\.css$/);n&&(e[`${n[1]}.css`]=t.href)}return e}();!function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){}}("bundle-urls",t);const n=Object.keys(t).filter(n=>{const s=t[n];return e[n]!==s});n.length&&A({downloadedBundles:n})})(),o("copy",".js-clipboard-copy",function(e){un(e.target),setTimeout(()=>un(e.target),2e3)}),h(".js-new-comment-form",async function(e,t){let n;!function(e){const t=e.querySelector(".js-comment-form-error");t&&(t.style.display="none")}(e);try{n=await t.json()}catch(r){!function(e,t){let n="You can't comment at this time";if(t.response&&422===t.response.status){const e=t.response.json;e.errors&&(n+=` — your comment ${e.errors.join(", ")}`)}n+=". ";const s=e.querySelector(".js-comment-form-error");s&&(s.style.display="block",s.classList.remove("d-none"),s.textContent=n)}(e,r)}if(!n)return;e.reset();for(const i of u(e,".js-resettable-field",HTMLInputElement))q(i,i.getAttribute("data-reset-value")||"");const s=e.querySelector(".js-write-tab");s&&s.click();const o=n.json.updateContent;for(const i in o){const e=o[i],t=document.querySelector(i);t?I(t,e):console.warn(`couldn't find ${i} for immediate update`)}}),n(".js-comment-and-button",{constructor:HTMLButtonElement,initialize(e){i(e.form,"null.js:29");const t=s(e.form,".js-comment-field"),n=e.textContent;let o=!1;function r(t){const s=t.currentTarget;i(s instanceof HTMLTextAreaElement,"null.js:36");const r=s.value.trim();r!==o&&(o=r,e.textContent=r?d(e,"data-comment-text"):n)}return{add(){t.addEventListener("input",r),t.addEventListener("change",r)},remove(){t.removeEventListener("input",r),t.removeEventListener("change",r)}}}}),l(".js-comment-field",function(e){dn(e,!0),e.addEventListener("blur",mn,{once:!0})});const fn=/^(>[^\n]\n|\s*\n)*\s*(\+1|-1|:\+1*|:-1*)\s*$/m;function gn(e){const t=e.target;i(t instanceof HTMLTextAreaElement,"null.js:27");const n=t.value,s=r(t,".js-reaction-suggestion");if(s)if(fn.test(n)){s.classList.remove("hide-reaction-suggestion"),s.classList.add("reaction-suggestion");const e=d(s,"data-reaction-markup");s.setAttribute("data-reaction-suggestion-message",e)}else pn(s)}function pn(e){e.classList.remove("reaction-suggestion"),e.classList.add("hide-reaction-suggestion"),e.removeAttribute("data-reaction-suggestion-message")}o("focusout","#new_comment_field",function(e){const t=e.currentTarget;pn(r(t,".js-reaction-suggestion"))}),o("focusin","#new_comment_field",function(e){gn(e)}),C("keyup","#new_comment_field",function(e){gn(e)}),o("menu:activate",".js-select-menu",function(e){e.currentTarget.classList.add("is-dirty")}),o("menu:deactivate",".js-select-menu",function(e){e.currentTarget.classList.remove("is-dirty")});const hn={OS:"Meta",Win:"Meta",Windows:"Meta",Scroll:"ScrollLock",SpaceBar:" ",Left:"ArrowLeft",Right:"ArrowRight",Down:"ArrowDown",Up:"ArrowUp",Del:"Delete",Esc:"Escape"};const jn=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,"key");if(jn){let e=e=>jn.get.apply(e);/Macintosh.*Safari/.test(navigator.userAgent)&&(e=(e=>{return function(e,t){return t&&/^[a-z]$/.test(e)?e.toUpperCase():e}(jn.get.apply(e),e.shiftKey)})),Object.defineProperty(KeyboardEvent.prototype,"key",{enumerable:!0,configurable:!0,get(){return t=e(this),hn[t]||t;var t}})}class FilterableInputElement extends HTMLElement{connectedCallback(){const e=this.input;e&&(e.setAttribute("autocomplete","off"),e.setAttribute("spellcheck","false"),this.debounceInputChange=j(this.fetchResults.bind(this),300),this.boundFetchResults=this.fetchResults.bind(this),e.addEventListener("focus",this.boundFetchResults),e.addEventListener("change",this.boundFetchResults),e.addEventListener("input",this.debounceInputChange))}disconnectedCallback(){const e=this.input;e&&(e.removeEventListener("focus",this.boundFetchResults),e.removeEventListener("change",this.boundFetchResults),e.removeEventListener("input",this.debounceInputChange))}get input(){const e=this.querySelector("input");return e instanceof HTMLInputElement?e:null}get resultsContainer(){return document.getElementById(this.getAttribute("aria-owns")||"")}get src(){return this.getAttribute("src")||""}set src(e){this.setAttribute("src",e)}get name(){return this.getAttribute("name")||"q"}set name(e){this.setAttribute("name",e)}async fetchResults(){if(!this.input)return;const e=this.input.value.trim();if(this.currentQuery===e)return;this.currentQuery=e;const t=this.src;if(!t)return;const n=this.resultsContainer;if(!n)return;const s=new URL(t,window.location.origin),o=new URLSearchParams(s.search);o.append(this.name,e),s.search=o.toString(),this.dispatchEvent(new CustomEvent("loadstart")),this.setAttribute("loading","");try{const e=await _(document,s);this.dispatchEvent(new CustomEvent("load")),n.innerHTML="",n.append(e)}catch(r){this.dispatchEvent(new CustomEvent("error"))}this.removeAttribute("loading"),this.dispatchEvent(new CustomEvent("loadend"))}}function vn(e,t){return!!e&&e.length>=t}function bn(e){return!!e&&/\d/.test(e)}function Ln(e){return!!e&&/[a-z]/.test(e)}function yn(e){return null==e.getAttribute("data-pjax-preserve-scroll")&&0}function En(e){let t=e;for(;t;){const e=t.getAttribute("data-pjax");if(e&&"true"!==e)return document.querySelector(e);t=t.parentElement&&t.parentElement.closest("[data-pjax]")}return e.closest("[data-pjax-container]")}window.customElements.get("filterable-input")||(window.FilterableInputElement=FilterableInputElement,window.customElements.define("filterable-input",FilterableInputElement)),n("details-menu filterable-input",{constructor:FilterableInputElement,initialize(e){const t=document.getElementById(e.getAttribute("aria-owns")||"");if(!t)return;let n;e.addEventListener("load",()=>{n=document.activeElement&&t.contains(document.activeElement)&&document.activeElement.id?document.activeElement.id:null}),e.addEventListener("loadend",()=>{if(n){const s=t.querySelector(`#${n}`)||t.querySelector('[role^="menu"]');s?s.focus():e.input&&e.input.focus()}})}}),h(".js-immediate-updates",async function(e,t){let n;try{n=(await t.json()).json.updateContent}catch(s){s.response.json&&(n=s.response.json.updateContent)}if(n)for(const o in n){const e=n[o],t=document.querySelector(o);t&&I(t,e)}}),h(".js-notice-dismiss",async function(e,t){await t.text(),r(e,".js-notice").remove()}),n("password-strength",function(e){const t=s(e,"input",HTMLInputElement),n=Number(e.getAttribute("data-minimum-character-count")),o=Number(e.getAttribute("data-passphrase-length")),r=e.querySelector("p.note")||e.querySelector(".form-control-note");t.addEventListener("keyup",()=>{r&&function(e,t,n,o){const r=s(e,"span.js-more-than-n-chars"),i=s(e,"span.js-min-chars"),a=s(e,"span.js-number-requirement"),c=s(e,"span.js-letter-requirement");if(function(e){for(const t of e)t.classList.remove("text-green","text-red")}([r,i,a,c]),vn(t,o))r.classList.add("text-green");else if(function(e,t){return vn(e,t)&&bn(e)&&Ln(e)}(t,n))i.classList.add("text-green"),a.classList.add("text-green"),c.classList.add("text-green");else{const e=vn(t,n)?"text-green":"text-red",s=bn(t)?"text-green":"text-red",o=Ln(t)?"text-green":"text-red";r.classList.add("text-red"),i.classList.add(e),a.classList.add(s),c.classList.add(o)}}(r,t.value,n,o)})}),o("click",".js-permalink-shortcut",function(e){const t=e.currentTarget;i(t instanceof HTMLAnchorElement,"null.js:16");try{T(null,"",t.href+window.location.hash)}catch(n){window.location=t.href+window.location.hash}e.preventDefault()}),o("click","[data-pjax] a, a[data-pjax]",function(e){i(e instanceof MouseEvent,"null.js:54");const t=e.currentTarget;if(t instanceof HTMLAnchorElement){if(null!=t.getAttribute("data-skip-pjax"))return;if(null!=t.getAttribute("data-remote"))return;const n=En(t);n&&$(e,{container:n,scrollTo:yn(t)})}}),o("submit","form[data-pjax]",function(e){i(e instanceof Event,"null.js:75");const t=e.target,n=En(t);n&&R(e,{container:n,scrollTo:yn(t)})}),o("change","select[data-pjax]",function(e){const t=e.currentTarget;i(t instanceof HTMLSelectElement,"null.js:88");const n=En(t);n&&N({url:t.value,container:n})}),async function(){await P;const e=document.getElementById("js-pjax-loader-bar");if(!e)return;const t=e.firstElementChild;if(!(t instanceof HTMLElement))return;let n=0,s=null,o=null;function r(e){0===e&&(null==o&&(o=getComputedStyle(t).transition),t.style.transition="none"),n=e,t.style.width=`${n}%`,0===e&&(t.clientWidth,t.style.transition=o||"")}function i(){0===n&&(n=12),r(Math.min(n+3,95)),s=setTimeout(i,500)}document.addEventListener("pjax:start",function(){r(0),e.classList.add("is-loading"),s=setTimeout(i,0)}),document.addEventListener("pjax:end",function(){s&&clearTimeout(s),r(100),e.classList.remove("is-loading")}),document.addEventListener("pjax:timeout",function(e){e.preventDefault()})}();let wn=null;const Tn="last_pjax_request",kn="pjax_start",Sn="pjax_end";function An(e,t){return e.split("/",3).join("/")===t.split("/",3).join("/")}window.performance.getEntriesByName&&(document.addEventListener("pjax:start",function(e){e instanceof CustomEvent&&e.detail&&e.detail.url&&(window.performance.mark(kn),wn=e.detail.url)}),document.addEventListener("pjax:end",async function(){if(await S(),!window.performance.getEntriesByName(kn).length)return;window.performance.mark(Sn),window.performance.measure(Tn,kn,Sn);const e=window.performance.getEntriesByName(Tn).pop(),t=e?e.duration:null;t&&(wn&&A({requestUrl:wn,pjaxDuration:Math.round(t)}),window.performance.clearMarks(kn),window.performance.clearMarks(Sn),window.performance.clearMeasures(Tn))})),document.addEventListener("pjax:click",function(e){if(window.onbeforeunload)return e.preventDefault()}),o("pjax:click","#js-repo-pjax-container a[href]",function(e){i(e.currentTarget instanceof HTMLAnchorElement,"null.js:25");const t=e.currentTarget.pathname;An(t,location.pathname)?function(e){const t=e.split("/")[3];return-1!==["projects","releases","tags","wiki","community"].indexOf(t)&&An(e,location.pathname)}(t)&&e.preventDefault():e.preventDefault()}),o("pjax:click",".js-comment-body",function(e){const t=e.target;t instanceof HTMLAnchorElement&&"files"===t.pathname.split("/")[3]&&e.preventDefault()});const Mn={};function Hn(e){const t=e.target;if(i(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement,"null.js:18"),(e.ctrlKey||e.metaKey)&&"Enter"===e.key){const n=t.form;i(n instanceof HTMLFormElement,"null.js:22");const s=n.querySelector("input[type=submit], button[type=submit]");if(e.shiftKey){const e=n.querySelector(".js-quick-submit-alternative");(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&!e.disabled&&v(n,e)}else(s instanceof HTMLInputElement||s instanceof HTMLButtonElement)&&s.disabled||v(n);e.preventDefault()}}function xn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return n.some(function(t){return e.classList.contains(t)})}function qn(e){if(null===e.parentNode||!(e.parentNode instanceof HTMLElement))throw new Error;for(var t=e.parentNode.children,n=0;n<t.length;++n)if(t[n]===e)return n;return 0}function In(e){return"DIV"===e.nodeName&&e.classList.contains("highlight")}(async()=>{await P,Mn[document.location.pathname]=Array.from(document.querySelectorAll("head [data-pjax-transient]"))})(),document.addEventListener("pjax:beforeReplace",function(e){i(e instanceof CustomEvent,"null.js:14");const t=e.detail.contents;for(let n=0;n<t.length;n++){const e=t[n];if(e)if("pjax-head"===e.id)Mn[document.location.pathname]=Array.from(e.children),t[n]=null;else if("js-flash-container"===e.id){const s=document.querySelector("#js-flash-container");s&&s.replaceWith(e),t[n]=null}}}),document.addEventListener("pjax:end",function(){const e=Mn[document.location.pathname];if(!e)return;const t=document.head;i(t,"null.js:35");for(const n of document.querySelectorAll("head [data-pjax-transient]"))n.remove();for(const n of e)n.matches("title, script, link[rel=stylesheet]")?n.matches("link[rel=stylesheet]")&&t.append(n):(n.setAttribute("data-pjax-transient",""),t.append(n))}),C("keydown",".js-quick-submit",function(e){Hn(e)});var Cn=0;function _n(e){return e.replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var $n={INPUT:function(e){return e instanceof HTMLInputElement&&e.checked?"[x] ":"[ ] "},CODE:function(e){var t=e.textContent;return e.parentNode&&"PRE"===e.parentNode.nodeName?(e.textContent="```\n".concat(t.replace(/\n+$/,""),"\n```"),e):t.indexOf("`")>=0?"`` ".concat(t," ``"):"`".concat(t,"`")},PRE:function(e){var t=e.parentNode;if(t instanceof HTMLElement&&In(t)){var n=t.className.match(/highlight-source-(\S+)/),s=n?n[1]:"",o=e.textContent.replace(/\n+$/,"");e.textContent="```".concat(s,"\n").concat(o,"\n```"),e.append("\n\n")}return e},STRONG:function(e){return"**".concat(e.textContent,"**")},EM:function(e){return"_".concat(e.textContent,"_")},BLOCKQUOTE:function(e){var t=e.textContent.trim().replace(/^/gm,"> "),n=document.createElement("pre");return n.textContent="".concat(t,"\n\n"),n},A:function(e){var t=e.textContent,n=e.getAttribute("href");return xn(e,"user-mention","team-mention")?t:xn(e,"issue-link")&&/^#\d+$/.test(t)?t:/^https?:/.test(t)&&t===n?t:n?"[".concat(t,"](").concat(n,")"):t},IMG:function(e){var t=e.getAttribute("alt")||"";if(t&&xn(e,"emoji"))return t;var n=e.getAttribute("src");if(!n)throw new Error;var s=e.hasAttribute("width")?' width="'.concat(_n(e.getAttribute("width")||""),'"'):"",o=e.hasAttribute("height")?' height="'.concat(_n(e.getAttribute("height")||""),'"'):"";return s||o?'<img alt="'.concat(_n(t),'"').concat(s).concat(o,' src="').concat(_n(n),'">'):"![".concat(t,"](").concat(n,")")},LI:function(e){var t=e.parentNode;if(!t)throw new Error;var n,s,o,r="";if(s=(n=e).childNodes[0],o=n.childNodes[1],!(s&&n.childNodes.length<3)||("OL"!==s.nodeName&&"UL"!==s.nodeName||o&&(o.nodeType!==Node.TEXT_NODE||o.textContent.trim())))if("OL"===t.nodeName)if(Cn>0&&!t.previousSibling){var i=qn(e)+Cn+1;r="".concat(i,"\\. ")}else r="".concat(qn(e)+1,". ");else r="* ";var a=r.replace(/\S/g," "),c=e.textContent.trim().replace(/^/gm,a),l=document.createElement("pre");return l.textContent=c.replace(a,r),l},OL:function(e){var t=document.createElement("li");return t.appendChild(document.createElement("br")),e.append(t),e},H1:function(e){var t=parseInt(e.nodeName.slice(1));return e.prepend("".concat(Array(t+1).join("#")," ")),e},UL:function(e){return e}};$n.UL=$n.OL;for(var Rn=2;Rn<=6;++Rn)$n["H".concat(Rn)]=$n.H1;function Nn(e,t){for(var n=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,function(e){return e.nodeName in $n&&!function(e){return e instanceof HTMLAnchorElement&&1===e.childNodes.length&&e.childNodes[0]instanceof HTMLImageElement&&e.childNodes[0].src===e.href}(e)&&(function(e){return"IMG"===e.nodeName||null!=e.firstChild}(e)||function(e){return"INPUT"===e.nodeName&&e instanceof HTMLInputElement&&"checkbox"===e.type}(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),s=[],o=n.nextNode();o;)o instanceof HTMLElement&&s.push(o),o=n.nextNode();s.reverse();for(var r=0;r<s.length;r++)t(o=s[r],$n[o.nodeName](o))}var Pn=new WeakMap,Dn=0,Fn=/\bEdge\//.test(navigator.userAgent);function On(e){for(var t=e;t=t.parentElement;)if(Pn.has(t))return t}function Bn(e){var t,n=!0,s=!1,o=void 0;try{for(var r,i=e.querySelectorAll("textarea")[Symbol.iterator]();!(n=(r=i.next()).done);n=!0){var a=r.value;if(a instanceof HTMLTextAreaElement&&!((t=a).offsetWidth<=0&&t.offsetHeight<=0))return a}}catch(c){s=!0,o=c}finally{try{n||null==i.return||i.return()}finally{if(s)throw o}}}function Un(e){if(!function(e){return e.defaultPrevented||"r"!==e.key||e.metaKey||e.altKey||e.shiftKey||e.ctrlKey||e.target instanceof HTMLElement&&(t=e.target,n=t.nodeName.toLowerCase(),s=(t.getAttribute("type")||"").toLowerCase(),"select"===n||"textarea"===n||"input"===n&&"submit"!==s&&"reset"!==s||t.isContentEditable);var t,n,s}(e)){var t,n=window.getSelection();try{t=n.getRangeAt(0)}catch(s){return}Wn(n.toString(),t)&&e.preventDefault()}}function Wn(e,t){var n=function(e,t,n){var s=e.trim();if(!s)return;var o=t.startContainer;if(!o)return;o.nodeType!==Node.ELEMENT_NODE&&(o=o.parentNode);if(!(o instanceof Element))return;var r=On(o);if(!r)return;var i=r.getAttribute("data-quote-markdown");if(null!=i&&!Fn)try{s=function(e){var t=document.body;if(!t)return"";var n=document.createElement("div");n.appendChild(e),n.style.cssText="position:absolute;left:-9999px;",t.appendChild(n);var s="";try{var o=window.getSelection(),r=document.createRange();r.selectNodeContents(n),o.removeAllRanges(),o.addRange(r),s=o.toString(),o.removeAllRanges(),r.detach()}finally{t.removeChild(n)}return s}(function(e,t,n){var s=e.startContainer;if(!(s&&s.parentNode&&s.parentNode instanceof HTMLElement))throw new Error("the range must start within an HTMLElement");var o=s.parentNode,r=e.cloneContents();if(t){var i=r.querySelector(t);i&&(r=document.createDocumentFragment()).appendChild(i)}Cn=0;var a=o.closest("li"),c=o.closest("pre");if(c){var l=document.createElement("pre");l.appendChild(r);var u=l;if(!n){var d=c.parentNode;if(d instanceof HTMLElement&&In(d)){var m=document.createElement("div");m.className=d.className,m.appendChild(u),u=m}}(r=document.createDocumentFragment()).appendChild(u)}else if(a&&a.parentNode&&("OL"===a.parentNode.nodeName&&(Cn=qn(a)),!r.querySelector("li"))){var f=document.createElement("li");if(!a.parentNode)throw new Error;var g=document.createElement(a.parentNode.nodeName);f.appendChild(r),g.appendChild(f),(r=document.createDocumentFragment()).appendChild(g)}return Nn(r,function(e,t){return e.replaceWith(t)}),r}(t,i,n)).replace(/^\n+/,"").replace(/\s+$/,"")}catch(a){setTimeout(function(){throw a})}return{selectionText:s,container:r}}(e,t,!1);if(!n)return!1;var s=n.container,o=n.selectionText;if(!s.dispatchEvent(new CustomEvent("quote-selection",{bubbles:!0,cancelable:!0,detail:{range:t,selectionText:o}})))return!0;var r=Bn(s);return!!r&&(function(e,t){var n="> ".concat(e.replace(/\n/g,"\n> "),"\n\n");t.value&&(n="".concat(t.value,"\n\n").concat(n));t.value=n,t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1})),t.focus(),t.selectionStart=t.value.length,t.scrollTop=t.scrollHeight}(o,r),!0)}let zn,Vn;function Kn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],s=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(s=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);s=!0);}catch(c){o=!0,r=c}finally{try{s||null==a.return||a.return()}finally{if(o)throw r}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n(".js-quote-selection-container",{subscribe:function(e){return function(e){var t=0===Dn;Dn+=Pn.has(e)?0:1,Pn.set(e,1),t&&document.addEventListener("keydown",Un)}(e),{unsubscribe:function(){!function(e){Dn-=Pn.has(e)?1:0,Pn.delete(e),Dn||document.removeEventListener("keydown",Un)}(e)}}}}),o("click",".js-comment-quote-reply",function(e){let t=e.currentTarget;const n=r(t,".js-comment"),o=s(n,".js-comment-body");if(Vn&&"Range"===Vn.type&&o.contains(Vn.anchorNode))Wn(Vn.text,Vn.range);else{const e=window.getSelection();e.removeAllRanges(),e.selectAllChildren(o),Wn(e.toString(),e.getRangeAt(0))}}),document.addEventListener("selectionchange",j(function(){const e=window.getSelection();let t;try{t=e.getRangeAt(0)}catch(n){return void(zn=null)}zn={type:e.type,anchorNode:e.anchorNode,text:e.toString(),range:t}},100)),document.addEventListener("toggle",function(e){const t=e.target;if(!(t instanceof Element&&t.hasAttribute("open")))return;Vn=zn;const n=t.querySelector(".js-comment-quote-reply.d-none");if(!n)return;const s=On(t);s&&(s.querySelector(".js-inline-comment-form-container")||Bn(s))&&n.classList.remove("d-none")},{capture:!0});var Gn=null;function Jn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.selector,s=void 0===n?".js-session-resumable":n,o=t.keyPrefix,r="".concat(void 0===o?"session-resume:":o).concat(e),i=[],a=!0,c=!1,l=void 0;try{for(var u,d=document.querySelectorAll(s)[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var m=u.value;(m instanceof HTMLInputElement||m instanceof HTMLTextAreaElement)&&i.push(m)}}catch(g){c=!0,l=g}finally{try{a||null==d.return||d.return()}finally{if(c)throw l}}var f=i.filter(function(e){return function(e){return e.id&&e.value!==e.defaultValue&&e.form!==Gn}(e)}).map(function(e){return[e.id,e.value]});if(f.length)try{sessionStorage.setItem(r,JSON.stringify(f))}catch(p){}}function Qn(e){var t,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).keyPrefix,s="".concat(void 0===n?"session-resume:":n).concat(e);try{t=sessionStorage.getItem(s)}catch(p){}if(t){try{sessionStorage.removeItem(s)}catch(p){}var o=[],r=!0,i=!1,a=void 0;try{for(var c,l=JSON.parse(t)[Symbol.iterator]();!(r=(c=l.next()).done);r=!0){var u=Kn(c.value,2),d=u[0],m=u[1],f=new CustomEvent("session:resume",{bubbles:!0,cancelable:!0,detail:{targetId:d,targetValue:m}});if(document.dispatchEvent(f)){var g=document.getElementById(d);g&&(g instanceof HTMLInputElement||g instanceof HTMLTextAreaElement)&&g.value===g.defaultValue&&(g.value=m,o.push(g))}}}catch(h){i=!0,a=h}finally{try{r||null==l.return||l.return()}finally{if(i)throw a}}setTimeout(function(){for(var e=0;e<o.length;e++){o[e].dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))}},0)}}function Xn(e){const t=e||window.location,n=document.head&&document.head.querySelector("meta[name=session-resume-id]");return n instanceof HTMLMetaElement&&n.content||t.pathname}window.addEventListener("submit",function(e){Gn=e.target,setTimeout(function(){e.defaultPrevented&&(Gn=null)},0)},{capture:!0}),window.addEventListener("pageshow",function(){Qn(Xn())}),window.addEventListener("pjax:end",function(){Qn(Xn())}),window.addEventListener("pagehide",function(){Jn(Xn(),{selector:".js-session-resumable"})}),window.addEventListener("pjax:beforeReplace",function(e){const t=e.detail.previousState,n=t?t.url:null;if(n)Jn(Xn(new URL(n)),{selector:".js-session-resumable"});else{const e=new Error("pjax:beforeReplace event.detail.previousState.url is undefined");setTimeout(function(){throw e})}}),n("textarea.js-size-to-fit",{constructor:HTMLTextAreaElement,subscribe:function(e){var t=null,n=!1,s=void 0,o=void 0,r=void 0;function i(t){if(s!==t.clientX||o!==t.clientY){var a=e.style.height;r&&r!==a&&(n=!0,e.style.maxHeight="",e.removeEventListener("mousemove",i)),r=a}s=t.clientX,o=t.clientY}var a=e.ownerDocument,c=a.documentElement;function l(){if(!(n||e.value===t||e.offsetWidth<=0&&e.offsetHeight<=0)){var s=function(){for(var t=0,n=e;n!==a.body&&null!==n;)t+=n.offsetTop||0,n=n.offsetParent;var s=t-a.defaultView.pageYOffset;return{top:s,bottom:c.clientHeight-(s+e.offsetHeight)}}(),o=s.top,i=s.bottom;if(!(o<0||i<0)){var l=Number(getComputedStyle(e).height.replace(/px/,""))+i;e.style.maxHeight=l-100+"px";var u=e.parentElement;if(u instanceof HTMLElement){var d=u.style.height;u.style.height=getComputedStyle(u).height,e.style.height="auto",e.style.height=e.scrollHeight+"px",u.style.height=d,r=e.style.height}t=e.value}}}function u(){n=!1,e.style.height="",e.style.maxHeight=""}e.addEventListener("mousemove",i),e.addEventListener("input",l),e.addEventListener("change",l);var d=e.form;return d&&d.addEventListener("reset",u),e.value&&l(),{unsubscribe:function(){e.removeEventListener("mousemove",i),e.removeEventListener("input",l),e.removeEventListener("change",l),d&&d.removeEventListener("reset",u)}}}}),h(".js-social-form",async function(e,t){const n=await t.json(),s=r(e,".js-social-container");for(const o of s.querySelectorAll(".js-social-count"))o.textContent=n.json.count});const Yn=new Map,Zn=(e,...t)=>new es(e,t,"html");class es{constructor(e,t,n,s=hs){this.strings=e,this.values=t,this.type=n,this.partCallback=s}getHTML(){const e=this.strings.length-1;let t="",n=!0;for(let s=0;s<e;s++){const e=this.strings[s];t+=e;const o=is(e);t+=(n=o>-1?o<e.length:n)?ss:ns}return t+=this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}function ts(e,t,n=function(e){let t=Yn.get(e.type);void 0===t&&(t=new Map,Yn.set(e.type,t));let n=t.get(e.strings);return void 0===n&&(n=new ls(e,e.getTemplateElement()),t.set(e.strings,n)),n}){const s=n(e);let o=t.__templateInstance;if(void 0!==o&&o.template===s&&o._partCallback===e.partCallback)return void o.update(e.values);o=new js(s,e.partCallback,n),t.__templateInstance=o;const r=o._clone();o.update(e.values),vs(t,t.firstChild),t.appendChild(r)}const ns=`{{lit-${String(Math.random()).slice(2)}}}`,ss=`\x3c!--${ns}--\x3e`,os=new RegExp(`${ns}|${ss}`),rs=/[ \x09\x0a\x0c\x0d]([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)[ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*)$/;function is(e){const t=e.lastIndexOf(">");return e.indexOf("<",t+1)>-1?e.length:t}class as{constructor(e,t,n,s,o){this.type=e,this.index=t,this.name=n,this.rawName=s,this.strings=o}}const cs=e=>-1!==e.index;class ls{constructor(e,t){this.parts=[],this.element=t;const n=this.element.content,s=document.createTreeWalker(n,133,null,!1);let o=-1,r=0;const i=[];let a,c;for(;s.nextNode();){o++,a=c;const t=c=s.currentNode;if(1===t.nodeType){if(!t.hasAttributes())continue;const n=t.attributes;let s=0;for(let e=0;e<n.length;e++)n[e].value.indexOf(ns)>=0&&s++;for(;s-- >0;){const s=e.strings[r],i=rs.exec(s)[1],a=n.getNamedItem(i),c=a.value.split(os);this.parts.push(new as("attribute",o,a.name,i,c)),t.removeAttribute(a.name),r+=c.length-1}}else if(3===t.nodeType){const e=t.nodeValue;if(e.indexOf(ns)<0)continue;const n=t.parentNode,s=e.split(os),a=s.length-1;r+=a;for(let r=0;r<a;r++)n.insertBefore(""===s[r]?document.createComment(""):document.createTextNode(s[r]),t),this.parts.push(new as("node",o++));n.insertBefore(""===s[a]?document.createComment(""):document.createTextNode(s[a]),t),i.push(t)}else if(8===t.nodeType&&t.nodeValue===ns){const e=t.parentNode,n=t.previousSibling;null===n||n!==a||n.nodeType!==Node.TEXT_NODE?e.insertBefore(document.createComment(""),t):o--,this.parts.push(new as("node",o++)),i.push(t),null===t.nextSibling?e.insertBefore(document.createComment(""),t):o--,c=a,r++}}for(const l of i)l.parentNode.removeChild(l)}}const us=(e,t)=>ds(t)?(t=t(e),ms):null===t?void 0:t,ds=e=>"function"==typeof e&&!0===e.__litDirective,ms={},fs=e=>null===e||!("object"==typeof e||"function"==typeof e);class gs{constructor(e,t,n,s){this.instance=e,this.element=t,this.name=n,this.strings=s,this.size=s.length-1,this._previousValues=[]}_interpolate(e,t){const n=this.strings,s=n.length-1;let o="";for(let r=0;r<s;r++){o+=n[r];const s=us(this,e[t+r]);if(s&&s!==ms&&(Array.isArray(s)||"string"!=typeof s&&s[Symbol.iterator]))for(const e of s)o+=e;else o+=s}return o+n[s]}_equalToPreviousValues(e,t){for(let n=t;n<t+this.size;n++)if(this._previousValues[n]!==e[n]||!fs(e[n]))return!1;return!0}setValue(e,t){if(this._equalToPreviousValues(e,t))return;const n=this.strings;let s;2===n.length&&""===n[0]&&""===n[1]?(s=us(this,e[t]),Array.isArray(s)&&(s=s.join(""))):s=this._interpolate(e,t),s!==ms&&this.element.setAttribute(this.name,s),this._previousValues=e}}class ps{constructor(e,t,n){this.instance=e,this.startNode=t,this.endNode=n,this._previousValue=void 0}setValue(e){if((e=us(this,e))!==ms)if(fs(e)){if(e===this._previousValue)return;this._setText(e)}else e instanceof es?this._setTemplateResult(e):Array.isArray(e)||e[Symbol.iterator]?this._setIterable(e):e instanceof Node?this._setNode(e):void 0!==e.then?this._setPromise(e):this._setText(e)}_insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}_setNode(e){this._previousValue!==e&&(this.clear(),this._insert(e),this._previousValue=e)}_setText(e){const t=this.startNode.nextSibling;e=void 0===e?"":e,t===this.endNode.previousSibling&&t.nodeType===Node.TEXT_NODE?t.textContent=e:this._setNode(document.createTextNode(e)),this._previousValue=e}_setTemplateResult(e){const t=this.instance._getTemplate(e);let n;this._previousValue&&this._previousValue.template===t?n=this._previousValue:(n=new js(t,this.instance._partCallback,this.instance._getTemplate),this._setNode(n._clone()),this._previousValue=n),n.update(e.values)}_setIterable(e){Array.isArray(this._previousValue)||(this.clear(),this._previousValue=[]);const t=this._previousValue;let n=0;for(const s of e){let e=t[n];if(void 0===e){let s=this.startNode;if(n>0){s=t[n-1].endNode=document.createTextNode(""),this._insert(s)}e=new ps(this.instance,s,this.endNode),t.push(e)}e.setValue(s),n++}if(0===n)this.clear(),this._previousValue=void 0;else if(n<t.length){const e=t[n-1];t.length=n,this.clear(e.endNode.previousSibling),e.endNode=this.endNode}}_setPromise(e){this._previousValue=e,e.then(t=>{this._previousValue===e&&this.setValue(t)})}clear(e=this.startNode){vs(this.startNode.parentNode,e.nextSibling,this.endNode)}}const hs=(e,t,n)=>{if("attribute"===t.type)return new gs(e,n,t.name,t.strings);if("node"===t.type)return new ps(e,n,n.nextSibling);throw new Error(`Unknown part type ${t.type}`)};class js{constructor(e,t,n){this._parts=[],this.template=e,this._partCallback=t,this._getTemplate=n}update(e){let t=0;for(const n of this._parts)n?void 0===n.size?(n.setValue(e[t]),t++):(n.setValue(e,t),t+=n.size):t++}_clone(){const e=this.template.element.content.cloneNode(!0),t=this.template.parts;if(t.length>0){const n=document.createTreeWalker(e,133,null,!1);let s=-1;for(let e=0;e<t.length;e++){const o=t[e],r=cs(o);if(r)for(;s<o.index;)s++,n.nextNode();this._parts.push(r?this._partCallback(this,o,n.currentNode):void 0)}}return e}}const vs=(e,t,n=null)=>{let s=t;for(;s!==n;){const t=s.nextSibling;e.removeChild(s),s=t}};function bs(e,t){e.addEventListener("compositionstart",As),e.addEventListener("compositionend",As),e.addEventListener("keydown",ws),t.addEventListener("click",Ts)}function Ls(e,t){e.removeAttribute("aria-activedescendant"),e.removeEventListener("compositionstart",As),e.removeEventListener("compositionend",As),e.removeEventListener("keydown",ws),t.removeEventListener("click",Ts)}var ys=!1,Es=!!navigator.userAgent.match(/Macintosh/);function ws(e){if(!(e.shiftKey||e.metaKey||e.altKey)){var t=e.currentTarget;if((t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement)&&!ys){var n=document.getElementById(t.getAttribute("aria-owns")||"");if(n)switch(e.key){case"Enter":case"Tab":(function(e,t){var n=t.querySelector('[aria-selected="true"]');return!(!n||"true"!==n.getAttribute("aria-disabled")&&(n.click(),0))})(0,n)&&e.preventDefault();break;case"Escape":Ss(n);break;case"ArrowDown":ks(t,n,1),e.preventDefault();break;case"ArrowUp":ks(t,n,-1),e.preventDefault();break;case"n":Es&&e.ctrlKey&&(ks(t,n,1),e.preventDefault());break;case"p":Es&&e.ctrlKey&&(ks(t,n,-1),e.preventDefault())}}}}function Ts(e){if(e.target instanceof Element){var t=e.target.closest('[role="option"]');t&&"true"!==t.getAttribute("aria-disabled")&&function(e){e.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(t)}}function ks(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=t.querySelector('[aria-selected="true"]'),o=Array.from(t.querySelectorAll('[role="option"]')),r=o.indexOf(s),i=1===n?0:o.length-1;if(s&&r>=0){var a=r+n;a>=0&&a<o.length&&(i=a)}var c=o[i];if(c)for(var l=0;l<o.length;l++){var u=o[l];c===u?(e.setAttribute("aria-activedescendant",c.id),c.setAttribute("aria-selected","true")):u.setAttribute("aria-selected","false")}}function Ss(e){var t=e.querySelector('[aria-selected="true"]');t&&t.setAttribute("aria-selected","false")}function As(e){var t=e.currentTarget;if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement){ys="compositionstart"===e.type;var n=document.getElementById(t.getAttribute("aria-owns")||"");n&&Ss(n)}}function Ms(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selectionEnd;const n=D(e,t),o=s(n,".text-field-mirror-marker"),r=n.getBoundingClientRect(),i=o.getBoundingClientRect();return setTimeout(()=>{n.remove()},5e3),{top:i.top-r.top,left:i.left-r.left}}const Hs=new WeakMap,xs={};class qs{constructor(e){this.setupHandler=this.setup.bind(this),this.teardownHandler=this.teardown.bind(this),this.textarea=e.input,this.types=e.types,this.suggester=e.suggester,this.suggestions=document.createElement("div"),this.suggestionsLoadedHandler=this.onSuggestionsLoaded.bind(this),this.deactivateHandler=this.deactivate.bind(this),this.pasteHandler=this.onPaste.bind(this),this.inputHandler=this.onInput.bind(this),this.escapeHandler=this.onEscapeKeydown.bind(this),this.commitHandler=this.onComboboxCommit.bind(this)}setup(){const e=this.textarea.form;i(e,"null.js:104"),e.addEventListener("reset",this.deactivateHandler),this.textarea.addEventListener("paste",this.pasteHandler),this.textarea.addEventListener("input",this.inputHandler),this.textarea.addEventListener("keydown",this.escapeHandler),this.suggester.addEventListener("combobox-commit",this.commitHandler),this.textarea.addEventListener("focusout:delay",this.teardownHandler),this.loadSuggestions()}teardown(){this.deactivate();const e=this.textarea.form;i(e,"null.js:120"),e.removeEventListener("reset",this.deactivateHandler),this.textarea.removeEventListener("paste",this.pasteHandler),this.textarea.removeEventListener("input",this.inputHandler),this.textarea.removeEventListener("keydown",this.escapeHandler),this.suggester.removeEventListener("combobox-commit",this.commitHandler),this.textarea.removeEventListener("focusout:delay",this.teardownHandler),this.suggestionsLoadedHandler=function(){}}onPaste(){this.deactivate(),this.justPasted=!0}onInput(){this.justPasted?this.justPasted=!1:this.checkQuery()}onEscapeKeydown(e){this.suggester.hidden||"Escape"===e.key&&(this.deactivate(),e.stopImmediatePropagation(),e.preventDefault())}_getDataValue(e){return this.currentSearch&&this.currentSearch.type.getValue?this.currentSearch.type.getValue(e):e.getAttribute("data-value")}_findIndexOfPick(e,t){let n=1;for(const s of e){if(this._getDataValue(s)===t)return n;n++}return-1}onComboboxCommit(e){let t=e.target;if(i(t instanceof HTMLElement,"null.js:177"),!t.hasAttribute("data-value"))return;const n=this._getDataValue(t);if(!n)return;const s=this.currentSearch;if(!s)return;let o=this.textarea.value.substring(0,s.endIndex);const r=this.textarea.value.substring(s.endIndex);o=o.replace(s.type.match,s.type.replace.replace("$value",n)),this.textarea.value=o+r,this.deactivate(),this.textarea.focus(),this.textarea.selectionStart=o.length,this.textarea.selectionEnd=o.length}mentionData(){const e=this.suggestions.querySelector("[data-mentions-json]");if(!e)return;let t=Hs.get(e);if(!t){const n=d(e,"data-mentions-json");t=JSON.parse(n),Hs.set(e,t)}return t}async checkQuery(){const e=this.searchQuery();if(e){const t="mention"===e.type.typeid?this.mentionData():null;if(this.currentSearch&&this.currentSearch===e.query)return;return this.currentSearch=e,void(await this.search(t)?this.activate(e.startIndex):this.deactivate())}this.currentSearch=null,this.deactivate()}renderResults(e,t){const n=e=>{const t="user"===e.type?e.login:e.name,n="user"===e.type?e.name:e.description,s=`${t} ${n}`;return Zn`
          <li
            role="option"
            id="suggester-${e.id}-${e.type}-${t}"
            data-value="${t}"
            data-text="${s}"
            data-mentionable-type="${e.type}"
            data-mentionable-id="${e.id}">
            <span>${t}</span>
            <small>${n}</small>
          </li>`};ts((e=>Zn`${e.map(n)}`)(t),e)}activate(e){if(this.textarea!==document.activeElement)return;const t=Ms(this.textarea,e+1),n=t.top,s=t.left;if(this.suggester.style.top=`${n}px`,this.suggester.style.left=`${s}px`,!this.suggester.hidden)return;this.suggester.hidden=!1;const o=this.suggester.querySelector("ul");i(o,"null.js:282");const r=o.id||`suggester-${Math.floor(1e5*Math.random()).toString()}`;o.id=r,this.textarea.setAttribute("aria-owns",r),this.textarea.setAttribute("role","combobox"),bs(this.textarea,this.suggester)}deactivate(){if(this.suggester.hidden)return;this.suggester.hidden=!0;const e=this.suggester.querySelector(".suggestions");e&&(e.style.display="none"),this.textarea.removeAttribute("role"),Ls(this.textarea,this.suggester)}async search(e){if(!this.currentSearch)return!1;const t=this.currentSearch,n=t.type,s=t.query,o=await n.search(this.suggestions,s,e),r=o.element,i=o.results;if((i&&Array.isArray(i)?i.length:i)>0&&r){const t=r.cloneNode(!0);return e&&Array.isArray(i)&&this.renderResults(t,i),this.suggester.innerHTML="",this.suggester.appendChild(t),t.id=this.textarea.getAttribute("aria-owns")||"",t.style.display="block",ks(this.textarea,this.suggester),!0}return!1}searchQuery(){const e=this.textarea.selectionEnd,t=this.textarea.value.substring(0,e);for(const n in this.types){const s=this.types[n],o=t.match(s.match);if(o)return s.normalizeMatch?s.normalizeMatch(s,e,o):this.normalizeMatch(s,e,o)}}normalizeMatch(e,t,n){const s=n[2];return{type:e,text:s,query:n[3],startIndex:t-s.length,endIndex:t}}async loadSuggestions(){if(this.suggestions.hasChildNodes())return;const e=this.suggester.getAttribute("data-url");if(!e)return;const t=xs[e]||(xs[e]=g(e)),n=await t;this.suggestionsLoadedHandler(n)}onSuggestionsLoaded(e){const t=f(document,e);this.suggestions.appendChild(t),document.activeElement===this.textarea&&(this.currentSearch=null,this.checkQuery())}}function Is(e,t,n){const s=n[3],o=n[4];return{type:e,text:s,query:o,startIndex:t-o.length,endIndex:t}}const Cs={mention:{typeid:"mention",match:/(^|\s|\()(@([a-z0-9\-_\/]*))$/i,replace:"$1@$value ",search(e,t,n){const s=Os(t),o=e.querySelector("ul.mention-suggestions");let r;return r=n?F(n,t,{limit:5,score:(e,t,n)=>{const o=s.score(e),r=n.score;return"number"==typeof r?o*r:o},text:e=>e.login?`${e.login} ${e.name}`.trim().toLowerCase():`${e.name} ${e.description}`.trim().toLowerCase()}):O(o,t,{limit:5,text:Rs,score:(e,t,n)=>{const o=s.score(e);i(n,"null.js:95");const r=n.getAttribute("data-mentionable-score");return null!==r?o*parseFloat(r):o}}),Promise.resolve({element:o,results:r})}},auditLogUser:{typeid:"auditLogUser",match:/(^|\s)((-?actor:|-?user:)([a-z0-9\-+_]*))$/i,replace:"$1$3$value ",search(e,t){const n=e.querySelector("ul.user-suggestions"),s=O(n,t,{limit:5});return Promise.resolve({element:n,results:s})},normalizeMatch:Is},auditLogOrg:{typeid:"auditLogOrg",match:/(^|\s)((-?org:)([a-z0-9\-+_]*))$/i,replace:"$1$3$value ",search(e,t){const n=e.querySelector("ul.org-suggestions"),s=O(n,t,{limit:5});return Promise.resolve({element:n,results:s})},normalizeMatch:Is},auditLogAction:{typeid:"auditLogAction",match:/(^|\s)((-?action:)([a-z0-9.\-+_]*))$/i,replace:"$1$3$value ",search(e,t){const n=e.querySelector("ul.action-suggestions"),s=O(n,t,{limit:5});return Promise.resolve({element:n,results:s})},normalizeMatch:Is},auditLogRepo:{typeid:"auditLogRepo",match:/(^|\s)((-?repo:)([a-z0-9\/\-+_]*))$/i,replace:"$1$3$value ",search(e,t){const n=e.querySelector("ul.repo-suggestions"),s=O(n,t,{limit:5});return Promise.resolve({element:n,results:s})},normalizeMatch:Is},auditLogCountry:{typeid:"auditLogCountry",match:/(^|\s)((-?country:)([a-z0-9\-+_]*))$/i,replace:"$1$3$value ",search(e,t){const n=e.querySelector("ul.country-suggestions"),s=O(n,t,{limit:5});return Promise.resolve({element:n,results:s})},normalizeMatch:Is},emoji:{typeid:"emoji",match:/(^|\s|\()(:([a-z0-9\-+_]*))$/i,replace:"$1$value ",getValue(e){if(e.hasAttribute("data-use-colon-emoji"))return e.getAttribute("data-value");const t=e.firstElementChild;return t&&"G-EMOJI"===t.tagName&&!t.firstElementChild?t.textContent:e.getAttribute("data-value")},search(e,t){const n=e.querySelector("ul.emoji-suggestions"),s=` ${t.toLowerCase().replace(/_/g," ")}`,o=O(n,s,{limit:5,text:$s,score:Ps});return Promise.resolve({element:n,results:o})}},search:{typeid:"search",match:/(^|\s)([a-z-]*)$/i,replace:"$1$value",getValue:e=>e.getAttribute("data-value"),search(e,t){const n=e.querySelector("ul.search-suggestions"),s=O(n,t,{limit:10,text:e=>e.getAttribute("data-text")||"",score:Ns});return Promise.resolve({element:n,results:s})},normalizeMatch(e,t,n){const s=n[2];return{type:e,text:s,query:s,startIndex:t-s.length,endIndex:t}}},hashed:{typeid:"issue",match:/(^|\s|\()(#([a-z0-9\-_\/]*))$/i,replace:"$1#$value ",search(e,t){let n;const s=e.querySelector("ul.hashed-suggestions"),o=/^\d+$/.test(t)?(n=new RegExp(`\\b${t}`),function(e){return function(e,t){const n=e.search(t);return n>-1?1e3-n:0}(e,n)}):Os(t).score,r=O(s,t,{limit:5,text:Rs,score:o});return Promise.resolve({element:s,results:r})}}},_s={};function $s(e){const t=e.getAttribute("data-emoji-name")||"";return _s[t]=` ${Rs(e).replace(/_/g," ")}`,t}function Rs(e){return(e.getAttribute("data-text")||"").trim().toLowerCase()}function Ns(e,t){const n=e.indexOf(t);return-1===n?0:1/(n+1)}function Ps(e,t){const n=_s[e].indexOf(t);return n>-1?1e3-n:0}function Ds(e,t,n){let s=n;const o=[];for(let r=1;r<t.length;r+=1){if(-1===(s=e.indexOf(t[r],s)))return;o.push(s++)}return o}function Fs(){return 2}function Os(e){let t;if(e){const n=e.toLowerCase().split("");t=function(t){if(!t)return 0;const s=function(e,t){let n,s,o,r;const i=function(e,t){let n=0;const s=[];for(;(n=e.indexOf(t,n))>-1;)s.push(n++);return s}(e,t[0]);if(0!==i.length){if(1===t.length)return[i[0],1,[]];for(r=null,s=0,o=i.length;s<o;s++){const o=i[s];if(!(n=Ds(e,t,o+1)))continue;const a=n[n.length-1]-o;(!r||a<r[1])&&(r=[o,a,n])}return r}}(t,n);if(!s)return 0;let o=e.length/s[1];return o/=s[0]/2+1}}else t=Fs;return{score:t}}function Bs(e){let t=e.match(/`{3,}/g);return t||(t=function(e){return e.replace(/`{3,}[^`]*\n(.+)?\n`{3,}/g,"")}(e).match(/`/g)),null!=t&&t.length%2}o("focusin:delay",".js-suggester-field",function(e){const t=e.currentTarget;i(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement,"null.js:418");const n=r(t,".js-suggester-container"),o=s(n,".js-suggester");new qs({input:t,suggester:o,types:Cs,disable:Bs}).setup()}),o("click",'tab-container [role="tab"]',function(e){const t=e.currentTarget,n=r(t,"tab-container").querySelector(".js-filterable-field");if(n){const e=t.getAttribute("data-filter-placeholder");e&&n.setAttribute("placeholder",e),n.focus()}});class Us{constructor(e){this.container=e.container,this.selections=e.selections,this.inputWrap=e.inputWrap,this.input=e.input,this.tagTemplate=e.tagTemplate,i(this.input.form,"null.js:62"),this.form=this.input.form,this.autoComplete=e.autoComplete}setup(){this.container.addEventListener("click",e=>{const t=e.target;i(t instanceof HTMLElement,"null.js:71"),t.matches(".js-remove")?this.removeTag(e):this.onFocus()}),this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.addEventListener("blur",this.onBlur.bind(this)),this.input.addEventListener("keydown",this.onKeyDown.bind(this)),this.form.addEventListener("submit",this.onSubmit.bind(this)),this.autoComplete.addEventListener("change",()=>{this.selectTag(this.autoComplete.value)})}onFocus(){this.inputWrap.classList.add("focus"),this.input!==document.activeElement&&this.input.focus()}onBlur(){this.inputWrap.classList.remove("focus"),this.autoComplete.open||this.onSubmit()}onSubmit(){this.input.value&&(this.selectTag(this.input.value),this.autoComplete.open=!1)}onKeyDown(e){switch(B(e)){case"Backspace":this.onBackspace();break;case"Enter":case"Tab":this.taggifyValueWhenSuggesterHidden(e);break;case",":case" ":this.taggifyValue(e)}}taggifyValueWhenSuggesterHidden(e){!this.autoComplete.open&&this.input.value&&(e.preventDefault(),this.selectTag(this.input.value))}taggifyValue(e){this.input.value&&(e.preventDefault(),this.selectTag(this.input.value),this.autoComplete.open=!1)}selectTag(e){const t=this.normalizeTag(e),n=this.selectedTags();t&&n.indexOf(t)<0&&(this.selections.appendChild(this.templateTag(t)),this.input.value="",b(this.form,"tags:changed"))}removeTag(e){const t=e.target;i(t instanceof HTMLElement,"null.js:161"),e.preventDefault(),r(t,".js-tag-input-tag").remove(),b(this.form,"tags:changed")}templateTag(e){const t=this.tagTemplate.cloneNode(!0);return s(t,"input",HTMLInputElement).value=e,s(t,".js-placeholder-tag-name").replaceWith(e),t.classList.remove("d-none","js-template"),t}normalizeTag(e){return e.toLowerCase().trim().replace(/[\s,']+/g,"-")}onBackspace(){if(!this.input.value){const e=this.selections.querySelector("li:last-child .js-remove");e&&e.click()}}selectedTags(){const e=u(this.selections,"input",HTMLInputElement);return Array.from(e).map(e=>e.value).filter(e=>e.length>0)}}async function Ws(e){const t=e.currentTarget;if(i(t instanceof HTMLElement,"null.js:11"),(n=t).getAttribute("data-hovercard-url")&&n.closest("[data-team-hovercards-enabled]"))return void t.classList.remove("tooltipped");var n;const s=t.getAttribute("data-url");if(!s)return;const o=U(s),r=d(t,"data-id"),a=document.querySelectorAll(`.js-team-mention[data-id='${r}']`);for(const i of a)i.removeAttribute("data-url");try{const e=await o;0===e.total?e.members.push("This team has no members"):e.total>e.members.length&&e.members.push(`${e.total-e.members.length} more`),zs(a,function(e){if("ListFormat"in Intl){const t=new Intl.ListFormat;return t.format(e)}if(0===e.length)return"";if(1===e.length)return e[0];if(2===e.length)return e.join(" and ");{const t=e[e.length-1];return e.slice(0,-1).concat(`and ${t}`).join(", ")}}(e.members))}catch(c){const e=c.response?c.response.status:500;zs(a,d(t,404===e?"data-permission-text":"data-error-text"))}}function zs(e,t){for(const n of e)n.setAttribute("aria-label",t),n.classList.add("tooltipped","tooltipped-s","tooltipped-multiline")}function Vs(e){return new Promise(function(t){function n(){e.hasFocus()&&(t(),e.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n),window.removeEventListener("blur",n))}e.addEventListener("visibilitychange",n),window.addEventListener("focus",n),window.addEventListener("blur",n),n()})}n(".js-tag-input-container",{constructor:HTMLElement,initialize(e){new Us({container:e,inputWrap:s(e,".js-tag-input-wrapper"),input:s(e,'input[type="text"], input:not([type])',HTMLInputElement),selections:s(e,".js-tag-input-selected-tags"),tagTemplate:s(e,".js-template"),autoComplete:s(e,"auto-complete",AutocompleteElement)}).setup()}}),n(".js-team-mention",function(e){e.addEventListener("mouseenter",Ws)});let Ks=0,Gs=-1;function Js(e){const t=e.getBoundingClientRect(),n=window.innerHeight,s=window.innerWidth;if(0===t.height)return!1;if(t.height<n)return t.top>=0&&t.left>=0&&t.bottom<=n&&t.right<=s;{const e=Math.ceil(n/2);return t.top>=0&&t.top+e<n}}function Qs(e){for(const t of e.elements)Js(t)?e.in.call(t,t,e):e.out&&e.out.call(t,t,e)}function Xs(e,t){const s={id:Ks++,selector:e,in:t,out:null,elements:[],checkPending:!1,scrollHandler(){!function(e){document.hasFocus()&&window.scrollY!==Gs&&(Gs=window.scrollY,e.checkPending||(e.checkPending=!0,window.requestAnimationFrame(()=>{e.checkPending=!1,Qs(e)})))}(s)}};n(e,{add(e){!async function(e,t){t.elements.push(e),1===t.elements.length&&(window.addEventListener("scroll",t.scrollHandler,{capture:!0,passive:!0}),await Vs(document),Qs(t))}(e,s)},remove(e){!function(e,t){const n=t.elements.indexOf(e);-1!==n&&t.elements.splice(n,1),0===t.elements.length&&window.removeEventListener("scroll",t.scrollHandler,{capture:!0,passive:!0})}(e,s)}})}let Ys=0;function Zs(e){return e.classList.remove("js-unread-item","unread-item")}function eo(){if(document.querySelector(":target"))return;const e=W(location.hash).toLowerCase(),t=z(document,`user-content-${e}`);t&&t.scrollIntoView()}function to(e){i(e.target instanceof Element,"null.js:26"),e.target.classList.remove("will-transition-once")}Xs(".js-unread-item",function(e){Zs(e)}),n(".js-unread-item",{add(){Ys++},remove(){0===--Ys&&function(){if(!document.hasFocus())return;const e=document.querySelector(".js-timeline-marker-form");e&&e instanceof HTMLFormElement&&v(e)}()}}),o("socket:message",".js-discussion",function(e){if(e.currentTarget===e.target)for(const t of document.querySelectorAll(".js-unread-item"))Zs(t)}),window.addEventListener("hashchange",eo),document.addEventListener("pjax:success",eo),async function(){await P,eo()}(),o("click","a[href]",function(e){const t=e.currentTarget;t instanceof HTMLAnchorElement&&t.href===location.href&&location.hash.length>1&&setTimeout(function(){e.defaultPrevented||eo()})}),n(".will-transition-once",{constructor:HTMLElement,subscribe:e=>H(e,"transitionend",to)});const no=new k;async function so(e){const t=e.getAttribute("data-item-name")||"items",n=parseInt(e.getAttribute("data-item-minimum"))||0,s=parseInt(e.getAttribute("data-item-count"))||0,o=Math.max(n,parseInt(e.value)||0),r=o>300,i=document.querySelector(".js-purchase-button");i instanceof HTMLButtonElement&&(i.disabled=0===o||r);const a=document.querySelector(".js-downgrade-button");a instanceof HTMLButtonElement&&(a.disabled=o===s);const c=new URL(d(e,"data-url"),window.location.origin),l=new URLSearchParams(c.search.slice(1));l.append(t,o.toString()),document.querySelector(".js-transform-user")&&l.append("transform_user","1"),c.search=l.toString();const u=await no.push(U(c)),m=document.querySelector(".js-contact-us");m&&m.classList.toggle("d-none",!r);const f=document.querySelector(".js-payment-summary");f&&f.classList.toggle("d-none",r);const g=document.querySelector(".js-billing-section");g&&g.classList.toggle("has-removed-contents",u.free);const p=document.querySelector(".js-upgrade-info");p&&p.classList.toggle("d-none",o<=0);const h=document.querySelector(".js-downgrade-info");h&&h.classList.toggle("d-none",o>=0);const j=document.querySelector(".js-extra-seats-line-item");j&&j.classList.toggle("d-none",u.no_additional_seats);const v=u.selectors;for(const d in v)for(const e of document.querySelectorAll(d))e.textContent=v[d];T(K(),"",u.url)}n(".js-addon-purchase-field",{constructor:HTMLInputElement,add(e){V(e)&&so(e),y(e,function(){so(e)})}}),n(".js-addon-downgrade-field",{constructor:HTMLInputElement,add(e){V(e)&&so(e),e.addEventListener("change",function(){so(e)})}}),n(".js-repo-health",function(e){const t=r(e,"form",HTMLFormElement),n=s(t,".js-comment-field",HTMLTextAreaElement),o=s(t,".js-repo-name",HTMLInputElement);function i(){!async function(e,t,n){const o=s(document,".js-repo-health-check",HTMLFormElement);s(o,".js-repo-health-name",HTMLInputElement).value=n,e.classList.remove("d-none"),e.classList.add("is-loading"),t.setCustomValidity("checking"),b(t,"change");const r=await _(document,o.action,{method:"POST",body:new FormData(o)}),i=s(e,".js-repo-health-results");i.innerHTML="",i.appendChild(r),e.classList.remove("is-loading"),t.setCustomValidity(""),b(t,"change")}(e,n,o.value)}"hidden"===o.type?n.addEventListener("focus",i):o.addEventListener("change",i)});let oo=null;const ro=300,io=[".",".","."];let ao=0;const co=new WeakMap;function lo(){const e=s(document,".js-audit-log-export-status");return co.set(e,e.textContent),oo=setInterval(function(){const t=io.slice(0,ao).join("");e.textContent=`Exporting${t}`,ao>=3?ao=0:ao+=1},ro),s(document,".js-audit-log-export-button").classList.add("disabled")}function uo(){s(document,".js-audit-log-export-button").classList.remove("disabled");const e=s(document,".js-audit-log-export-status");e.textContent=co.get(e)||"",null!==oo&&clearInterval(oo),ao=0}function mo(){uo(),J()}h(".js-audit-log-export-form",async function(e,t){let n;lo();try{n=await t.json()}catch(r){return void mo()}const s=n.json;try{await G(s.job_url)}catch(r){return void mo()}var o;o=s.export_url,uo(),window.location=o}),o("combobox-commit",".audit-search-form .js-suggester",function(e){const t=r(e.currentTarget,"form",HTMLFormElement);v(t)});const fo=new k;function go(e){const t=document.querySelector(".js-membership-tabs");if(t){const n=e.querySelectorAll(".js-bulk-actions-toggle:checked");t.classList.toggle("d-none",n.length>0)}}function po(){return s(document,".js-business-saml-provider-settings-form",HTMLFormElement)}function ho(){return po().querySelector(".js-business-saml-form-inputs")}function jo(e){e&&e.classList.remove("d-none")}function vo(){return"1"===s(document,".js-business-saml-currently-enabled",HTMLInputElement).value&&!s(document,".js-business-enable-saml",HTMLInputElement).checked}function bo(){return s(document,".is-submit-button-value",HTMLInputElement)}function Lo(){po().submit()}function yo(){const e=document.querySelector(".js-business-enable-saml");e&&e instanceof HTMLInputElement&&(e.checked=!0,jo(ho()))}function Eo(){const e="0"===s(document,".js-business-two-factor-currently-enabled",HTMLInputElement).value;return s(document,".js-business-enable-two-factor",HTMLInputElement).checked&&e}if(o("change",".js-bulk-actions-toggle",function(e){const t=e.currentTarget,n=r(t,".js-bulk-actions-container");b(n,"bulk-actions:update")}),o("bulk-actions:update",".js-bulk-actions-container",j(async function(e){const t=e.target,n=s(t,".js-bulk-actions"),o=!!t.querySelector(".js-bulk-actions-toggle:checked"),i=await fo.push(g(function(e){const t=Array.from(e.querySelectorAll(".js-bulk-actions-toggle:checked")).map(e=>d(r(e,".js-bulk-actions-item"),"data-bulk-actions-id")).sort(),n=`${d(e,"data-bulk-actions-parameter")}[]`,s=new URL(d(e,"data-bulk-actions-url"),window.location.origin),o=new URLSearchParams(s.search.slice(1));for(const r of t)o.append(n,r);return s.search=o.toString(),s.toString()}(t)));o?(go(t),n.innerHTML=i):(n.innerHTML=i,go(t))},100)),o("change",".js-select-initial-admins",function(e){if(e.target!==e.currentTarget)return;const t=e.target;i(t instanceof AutocompleteElement,"null.js:14");const n=r(t,"form");t.value&&(!function(e,t){const n=s(e,".js-business-admin-login-list",HTMLInputElement);n.value=`${n.value} ${t}`;const o=s(e,".js-initial-admins",HTMLTableElement),r=s(e,".js-admin-template-row",HTMLTableRowElement).cloneNode(!0);r.setAttribute("data-value",t),s(r,".js-admin-login",HTMLElement).textContent=t,o.appendChild(r),r.classList.remove("d-none"),o.classList.remove("d-none")}(n,t.value),t.value="")}),o("click",".js-deselect-admin",function(e){let t=e.target;!function(e,t){const n=r(t,"tr"),o=n.getAttribute("data-value"),i=s(e,".js-business-admin-login-list",HTMLInputElement);null!=o&&(i.value=i.value.replace(o,""));n.remove()}(r(t,"form"),t)}),o("click",".js-preview-sign-in-message",function(e){const t=s(document,"#custom_messages_sign_in_message",HTMLTextAreaElement).value;s(document,"#sign_in_message",HTMLInputElement).value=t;const n=e.currentTarget;i(n instanceof HTMLButtonElement,"null.js:69"),i(n.form,"null.js:70"),n.form.submit()}),o("click",".js-preview-sign-out-message",function(e){const t=s(document,"#custom_messages_sign_out_message",HTMLTextAreaElement).value;s(document,"#sign_out_message",HTMLInputElement).value=t;const n=e.currentTarget;i(n instanceof HTMLButtonElement,"null.js:79"),i(n.form,"null.js:80"),n.form.submit()}),o("click",".js-preview-auth-provider-name",function(e){const t=s(document,"#custom_messages_auth_provider_name",HTMLInputElement).value;s(document,"#auth_provider_name",HTMLInputElement).value=t;const n=e.currentTarget;i(n instanceof HTMLButtonElement,"null.js:89"),i(n.form,"null.js:90"),v(n.form)}),o("click",".js-preview-suspended-message",function(e){const t=s(document,"#custom_messages_suspended_message",HTMLTextAreaElement).value;s(document,"#suspended_message",HTMLInputElement).value=t;const n=e.currentTarget;i(n instanceof HTMLButtonElement&&n.form,"null.js:99"),n.form.submit()}),o("click",".js-admin-settings-policy-input",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:104"),i(t.form instanceof HTMLFormElement,"null.js:105"),v(t.form)}),o("click",".js-admin-settings-select",function(e){let t=e.currentTarget;const n=s(t,".js-value"),o=r(t,"form",HTMLFormElement);s(o,".js-item-value",HTMLInputElement).value=n.textContent,v(o)}),o("click",".js-business-enable-saml",function(e){var t;i(e.currentTarget instanceof HTMLInputElement,"null.js:185"),e.currentTarget.checked?jo(ho()):(t=ho())&&t.classList.add("d-none")}),o("click",".js-business-saml-submit",function(e){e.preventDefault(),i(e.currentTarget instanceof HTMLButtonElement,"null.js:202"),Q(e.currentTarget),v(po())}),o("submit",".js-business-saml-provider-settings-form",function(e){e.preventDefault(),"test_settings"===bo().name?Lo():"save_settings"===bo().name&&(vo()?async function(){(await X({content:s(document,"#disable-saml-confirmation",HTMLTemplateElement).content.cloneNode(!0)})).addEventListener("dialog:remove",yo)}():Lo())}),o("click",".js-business-two-factor-submit-button",function(e){Eo()||e.preventDefault()}),top!==window){alert("For security reasons, framing is not allowed.");try{top.location.replace(document.location)}catch(Jd){}}const wo=/\bChrome\//.test(navigator.userAgent)&&!/\bEdge\//.test(navigator.userAgent),To=/Macintosh.*Safari/.test(navigator.userAgent);let ko,So=!1;function Ao(){ko=document.activeElement,document.body&&(wo||To)&&document.body.classList.toggle("intent-mouse",So)}function Mo(e){return e.hasAttribute("data-maxlength")?parseInt(e.getAttribute("data-maxlength")):e.maxLength}function Ho(e){const t=Mo(e);!function(e,t,n){const o=n.closest(".js-characters-remaining-container");if(!o)return;const r=s(o,".js-characters-remaining"),i=String(r.getAttribute("data-suffix")),a=t-Y(e);a<=20?(r.textContent=`${a} ${i}`,r.classList.toggle("text-red",a<=5),r.hidden=!1):r.hidden=!0}(e.value,t,e)}function xo(e){const t=e.querySelectorAll(".js-characters-remaining-container");for(const n of t){Ho(s(n,".js-characters-remaining-field",HTMLInputElement))}}document.addEventListener("mousedown",function(){So=!0,ko===document.activeElement&&Ao()},{capture:!0}),document.addEventListener("keydown",function(){So=!1},{capture:!0}),document.addEventListener("focusin",Ao,{capture:!0}),l(".js-characters-remaining-field",function(e){function t(){Ho(e)}i(e instanceof HTMLInputElement,"null.js:59"),t(),e.addEventListener("input",t),e.addEventListener("blur",()=>{e.removeEventListener("input",t)},{once:!0})});const qo={}.hasOwnProperty,Io=[].slice;function Co(e){if(console&&console.warn)return console.warn(e)}const _o={host:"collector.githubapp.com",type:"page_view",dimensions:{},measures:{},context:{},actor:{},image:new Image,performance:{},expectedPerformanceTimingKeys:["connectEnd","connectStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domainLookupEnd","domainLookupStart","fetchStart","loadEventEnd","loadEventStart","navigationStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","secureConnectionStart","unloadEventEnd","unloadEventStart"],recordPageView(){return this.applyMetaTags(),null!=this.app&&(null==this.host?(Co("Host not set, you are doing something wrong"),!1):(this.image.src=this._src(),this._clearPerformance(),!0))},setHost(e){this.host=e},setApp(e){this.app=e},setDimensions(e){this.dimensions=e},addDimensions(e){let t;null==this.dimensions&&(this.dimensions={});const n=[];for(t in e){if(!qo.call(e,t))continue;const s=e[t];n.push(this.dimensions[t]=s)}return n},setMeasures(e){this.measures=e},addMeasures(e){let t;null==this.measures&&(this.measures={});const n=[];for(t in e){if(!qo.call(e,t))continue;const s=e[t];n.push(this.measures[t]=s)}return n},setContext(e){this.context=e},addContext(e){let t;null==this.context&&(this.context={});const n=[];for(t in e){if(!qo.call(e,t))continue;const s=e[t];n.push(this.context[t]=s)}return n},setActor(e){this.actor=e},push(e){return this.applyCall(e)},enablePerformance(){this.performance=this._performanceTiming()},_recordSrc(e,t,n,s){return`//${this.host}/${this.app}/${e}?${this._queryString(t,n,s)}`},_src(){return`//${this.host}/${this.app}/${this.type}?${this._queryString()}`},_queryString(e,t,n){let s,o;const r=function(){const e=this._params(),t=[];for(s in e)o=e[s],t.push(`dimensions[${s}]=${o}`);return t}.call(this);return r.push(this._encodeObject("dimensions",this._merge(this.dimensions,e))),r.push(this._encodeObject("measures",this._merge(this.measures,t))),null!=this.performance&&r.push(this._encodeObject("measures",{performance_timing:this.performance})),r.push(this._encodeObject("context",this._merge(this.context,n))),r.push(this._actor()),r.push(this._encodeObject("dimensions",{cid:this._clientId()})),r.join("&")},_clearPerformance(){this.performance=null},_performanceTiming(){let e,t,n;if(null==window.performance||null==window.performance.timing||null==window.performance.timing.navigationStart)return null;const s={},o=this.expectedPerformanceTimingKeys;for(e=0,t=o.length;e<t;e++){const t=o[e];s[t]=null!=(n=window.performance.timing[t])?n:0}const r=[],i=s.navigationStart;for(const a in s){const e=s[a],t=0===e?null:e-i;r.push(t)}return`1-${r.join("-")}`},_params(){return{page:this._encode(this._page()),title:this._encode(this._title()),referrer:this._encode(this._referrer()),user_agent:this._encode(this._agent()),screen_resolution:this._encode(this._screenResolution()),pixel_ratio:this._encode(this._pixelRatio()),browser_resolution:this._encode(this._browserResolution()),tz_seconds:this._encode(this._tzSeconds()),timestamp:(new Date).getTime()}},_page(){try{const t=document.querySelector("meta[name=octolytics-location]");return t instanceof HTMLMetaElement?document.location.origin+t.content:document.location.href}catch(e){}},_title(){try{return document.title}catch(e){}},_referrer(){let e;e="";try{e=window.top.document.referrer}catch(t){if(window.parent)try{e=window.parent.document.referrer}catch(t){}}return""===e&&(e=document.referrer),e},_agent(){try{return navigator.userAgent}catch(e){}},_screenResolution(){try{return`${screen.width}x${screen.height}`}catch(e){return"unknown"}},_pixelRatio:()=>window.devicePixelRatio,_browserResolution(){let e,t;try{return t=0,e=0,"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):null!=document.documentElement&&null!=document.documentElement.clientWidth?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):null!=document.body&&null!=document.body.clientWidth&&(t=document.body.clientWidth,e=document.body.clientHeight),`${t}x${e}`}catch(n){return"unknown"}},_tzSeconds(){try{return-60*(new Date).getTimezoneOffset()}catch(e){return""}},_merge(){let e,t,n;for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];const i=1<=o.length?Io.call(o,0):[],a={};for(e=0,n=i.length;e<n;e++){const n=i[e];for(t in n){const e=n[t];a[t]=e}}return a},_encodeObject(e,t){let n,s,o;const r=[];if(null!=Array.isArray&&Array.isArray(t)||"[object Array]"===Object.prototype.toString.call(t))for(n=0,s=t.length;n<s;n++){const s=t[n];r.push(this._encodeObject(`${e}[]`,s))}else if(t===Object(t))for(o in t)r.push(this._encodeObject(`${e}[${o}]`,t[o]));else r.push(`${e}=${this._encode(t)}`);return r.join("&")},_actor(){let e,t,n;const s=[],o=this.actor;for(t in o){const r=o[t],i=`dimensions[actor_${t}]`;if(r.join)for(e=0,n=r.length;e<n;e++){const t=r[e];s.push(`${i}[]=${this._encode(t)}`)}else s.push(`${i}=${this._encode(r)}`)}return s.join("&")},_getCookie(e){let t,n;const s=[],o=document.cookie.split(";");for(t=0,n=o.length;t<n;t++){const n=o[t].trim().split("=");if(n.length<2)continue;const r=n[0],i=n[1];r===e&&s.push({key:r,value:i})}return s},_clientId(){let e;return""===(e=this._getClientId())&&(e=this._setClientId()),e},_getClientId(){let e,t,n;const s=this._getCookie("_octo"),o=[];for(t=0,n=s.length;t<n;t++){const n=s[t].value.split(".");if("GH1"===n.shift()&&n.length>1){const t=n.shift().split("-");1===t.length&&(t[1]="1"),t[0]*=1,t[1]*=1,e=n.join("."),o.push([t,e])}}return e="",o.length>0&&(e=o.sort().reverse()[0][1]),e},_setClientId(){const e=(new Date).getTime(),t=`${Math.round(Math.random()*(Math.pow(2,31)-1))}.${Math.round(e/1e3)}`,n=`GH1.1.${t}`,s=new Date(e+63072e6).toUTCString(),o=document.domain;if(null==o)throw new Error("Unable to get document domain");const r=`.${o.split(".").reverse().slice(0,2).reverse().join(".")}`;return document.cookie=`_octo=${n}; expires=${s}; path=/; domain=${r}`,t},_encode:e=>null!=e?window.encodeURIComponent(e):"",applyQueuedCalls(e){let t,n;const s=[];for(t=0,n=e.length;t<n;t++){const n=e[t];s.push(this.applyCall(n))}return s},applyCall(e){const t=e[0],n=e.slice(1);return this[t]?this[t](...n):Co(`${t} is not a valid method`)},applyMetaTags(){const e=this.loadMetaTags();return e.host&&this.setHost(e.host),e.app&&this.setApp(e.app),this._objectIsEmpty(e.actor)||this.setActor(e.actor),this.addDimensions(e.dimensions),this.addMeasures(e.measures),this.addContext(e.context)},loadMetaTags(){let e,t;const n={dimensions:{},measures:{},context:{},actor:{}},s=document.getElementsByTagName("meta");for(e=0,t=s.length;e<t;e++){const t=s[e];if(t.name&&t.content){const e=t.name.match(this.octolyticsMetaTagName);if(e)switch(e[1]){case"host":n.host=t.content;break;case"app-id":case"app":n.app=t.content;break;case"dimension":this._addField(n.dimensions,e[2],t);break;case"measure":this._addField(n.measures,e[2],t);break;case"context":this._addField(n.context,e[2],t);break;case"actor":this._addField(n.actor,e[2],t)}}}return n},_addField(e,t,n){n.attributes["data-array"]?(null==e[t]&&(e[t]=[]),e[t].push(n.content)):e[t]=n.content},_objectIsEmpty(e){let t;for(t in e)if(qo.call(e,t))return!1;return!0},octolyticsMetaTagName:/^octolytics-(host|app-id|app|dimension|measure|context|actor)-?(.*)/};if(window._octo){if(window._octo.slice){const e=window._octo.slice(0);window._octo=_o,window._octo.applyQueuedCalls(e)}}else window._octo=_o;function $o(e){const t=d(e,"data-fieldname");return document.querySelectorAll(`span[data-fieldname="${t}"]`)}function Ro(e,t){if(e.value)for(const n of t)n.textContent=e.value}function No(e,t){return e.length<t.length?-1:e.length>t.length?1:e.localeCompare(t)}function Po(e,t){const n=e.getBoundingClientRect();return(t.getBoundingClientRect().width-n.width)/2}function Do(e){const t=e.map(e=>e.priority),n=Math.min(...t),o=e.find(e=>e.priority===n);if(o){s(o.el,".js-loader").classList.remove("d-none")}}document.addEventListener("keydown",e=>{if("Escape"!==e.key)return;if(e.target!==document.body)return;const t=document.querySelector(".js-targetable-comment:target");t&&Z(t,()=>{window.location.hash="",window.history.replaceState(null,null,window.location.pathname+window.location.search)})}),document.addEventListener("click",e=>{const t=document.querySelector(".js-targetable-comment:target");t&&e.target instanceof HTMLElement&&(t.contains(e.target)||Z(t,()=>{window.location.hash="",window.history.replaceState(null,null,window.location.pathname+window.location.search)}))}),l(".js-template-form-input",function(e){i(e instanceof HTMLInputElement,"null.js:28");const t=$o(e);function n(){Ro(e,t)}function s(e){for(const n of t)n.classList.toggle("CommunityTemplate-highlight--focus",e)}s(!0),e.addEventListener("input",n),e.addEventListener("blur",function t(){s(!1),e.removeEventListener("input",n),e.removeEventListener("blur",t)})}),o("click",".js-template-highlight",function(e){(function(e){const t=d(e,"data-fieldname");return s(document,`input[data-fieldname="${t}"]`,HTMLInputElement)})(e.currentTarget).focus()}),n(".js-templates",function(){for(const e of u(document,".js-template-form-input",HTMLInputElement)){Ro(e,$o(e))}}),n(".js-activity-overview-graph-container",function(e){const t=d(e,"data-percentages");!function(e,t){const n=e.querySelector("svg");if(!n)return;const s=n.querySelector(".js-highlight-blob"),o=Math.floor(e.clientWidth),r=Math.max(o,250),a=r,c=n.querySelector(".js-highlight-label-top"),l=n.querySelector(".js-highlight-label-bottom"),u=n.querySelector(".js-highlight-label-right"),d=n.querySelector(".js-highlight-label-left"),m=n.querySelector(".js-highlight-percent-top"),f=n.querySelector(".js-highlight-percent-bottom"),g=n.querySelector(".js-highlight-percent-right"),p=n.querySelector(".js-highlight-percent-left"),h=n.querySelector(".js-highlight-x-axis"),j=n.querySelector(".js-highlight-y-axis"),v=n.querySelector(".js-highlight-top-ellipse"),b=n.querySelector(".js-highlight-right-ellipse"),L=n.querySelector(".js-highlight-bottom-ellipse"),y=n.querySelector(".js-highlight-left-ellipse"),E=e.querySelector(".js-activity-overview-graph-spinner"),w=n.querySelector("g");i(w,"null.js:71"),i(s,"null.js:72"),i(c,"null.js:73"),i(l,"null.js:74"),i(u,"null.js:75"),i(d,"null.js:76"),i(m,"null.js:77"),i(f,"null.js:78"),i(g,"null.js:79"),i(p,"null.js:80"),i(h,"null.js:81"),i(j,"null.js:82"),i(v,"null.js:83"),i(b,"null.js:84"),i(L,"null.js:85"),i(y,"null.js:86"),i(E,"null.js:87"),w.removeAttribute("transform"),n.classList.remove("d-none"),n.classList.add("d-block"),E.classList.remove("d-block"),E.classList.add("d-none"),c.innerHTML="",u.innerHTML="",l.innerHTML="",d.innerHTML="",m.innerHTML="&nbsp;",g.innerHTML="&nbsp;",f.innerHTML="&nbsp;",p.innerHTML="&nbsp;";const T=Object.keys(t.percentages).sort(No),k=T.slice(0,2).sort(),S=ee(k,2),A=S[0],M=S[1],H=T.slice(2,4).sort(),x=ee(H,2),q=x[0],I=x[1],C=t.percentages[q],_=t.percentages[M],$=t.percentages[I],R=t.percentages[A];let N=null;const P=(e,n)=>{const s=t.percentages[e];if(s>0)return N=n,`${s}%`},D=P(q,m);D&&(m.textContent=D);const F=P(M,g);F&&(g.textContent=F);const O=P(I,f);O&&(f.textContent=O);const B=P(A,p);B&&(p.textContent=B);const U=r/2,W=r/2;c.appendChild(document.createTextNode(q)),c.setAttribute("dx",U.toString()),l.appendChild(document.createTextNode(I)),l.setAttribute("dx",W.toString()),m.setAttribute("dx",U.toString()),f.setAttribute("dx",W.toString());const z=c.getBoundingClientRect().height;let V=0;N&&(V=N.getBoundingClientRect().height);let K=a/2+z/4,G=a/2+z/4;R>0&&(K=K+V/2+2.5),_>0&&(G=G+V/2+2.5),d.appendChild(document.createTextNode(A)),d.setAttribute("dy",K.toString()),u.appendChild(document.createTextNode(M)),u.setAttribute("dy",G.toString());const J=K-z,Q=G-z;p.setAttribute("dy",J.toString()),g.setAttribute("dy",Q.toString());let X=C/100,Y=$/100,Z=R/100,te=_/100;const ne=Math.max(X,Y,Z,te),se=e=>1*e/ne+0;X=se(X),Y=se(Y),Z=se(Z),te=se(te);const oe=function(e){let t=0;for(const n of e){const e=n.getBoundingClientRect();e.width>t&&(t=e.width)}return t}([d,u,c,l])+10,re=Math.max(oe,z),ie=r/2,ae=a/2,ce=ie,le=re,ue=ie,de=a-re,me=re,fe=ae,ge=r-re,pe=ae,he=ie-me,je=ae-le;let ve=le+(1-X)*je,be=Math.max(de-(1-Y)*je,ae),Le=me+(1-Z)*he,ye=ge-(1-te)*he;h.setAttribute("x1",me.toString()),h.setAttribute("y1",ae.toString()),h.setAttribute("x2",ge.toString()),h.setAttribute("y2",ae.toString()),j.setAttribute("x1",ie.toString()),j.setAttribute("y1",le.toString()),j.setAttribute("x2",ie.toString()),j.setAttribute("y2",de.toString()),ve+4<ae&&(ve+=4),be-4>ae&&(be-=4),Le+4<ie&&(Le+=4),ye-4>ie&&(ye-=4);const Ee=le-10,we=ge+10;let Te=de+10+8;$>0&&(Te+=V);const ke=me-12;c.setAttribute("dy",Ee.toString()),u.setAttribute("dx",we.toString()),l.setAttribute("dy",Te.toString()),d.setAttribute("dx",ke.toString());const Se=ke-Po(p,d),Ae=we+Po(g,u);p.setAttribute("dx",Se.toString()),g.setAttribute("dx",Ae.toString());const Me=Ee-z,He=Te-z;m.setAttribute("dy",Me.toString()),f.setAttribute("dy",He.toString()),0===C?v.classList.add("d-none"):(v.setAttribute("cx",ce.toString()),v.setAttribute("cy",(ve-2).toString())),0===_?b.classList.add("d-none"):(b.setAttribute("cx",(ye+2).toString()),b.setAttribute("cy",pe.toString())),0===$?L.classList.add("d-none"):(L.setAttribute("cx",ue.toString()),L.setAttribute("cy",(be+2).toString())),0===R?y.classList.add("d-none"):(y.setAttribute("cx",(Le-2).toString()),y.setAttribute("cy",fe.toString()));const xe=w.getBoundingClientRect(),qe=n.getBoundingClientRect(),Ie=0-(xe.top-qe.top),Ce=0-(xe.left-qe.left);w.setAttribute("transform",`translate(${Ce}, ${Ie})`);const _e=Math.ceil(xe.width),$e=Math.ceil(xe.height);n.setAttribute("width",_e.toString()),n.setAttribute("height",$e.toString());const Re=`M${ce},${ve} ${[[ye,pe],[ue,be],[Le,fe]].map(e=>`L${e[0]},${e[1]}`).join(" ")} z`;C+_+$+R!==0&&s.setAttribute("d",Re)}(e,{percentages:JSON.parse(t)})}),n(".dashboard-sidebar.js-sticky",{constructor:HTMLElement,initialize(e){if(e.classList.contains("is-placeholder"))return;let t=!0;const n=()=>{const n=e.getBoundingClientRect(),s=window.innerHeight,o=0===n.top;o?o&&t&&(t=!1,e.style.height=`${s}px`):(e.style.width="auto",e.style.height=`${s-n.top}px`)};document.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",()=>{t=!0,n()},{passive:!0}),n()}}),o("details:toggled",".js-news-feed-event-group",function(e){if(i(e instanceof CustomEvent,"null.js:49"),!e.detail.open)return;const t=e.currentTarget;for(const n of t.querySelectorAll("[data-hydro-view]"))te(n)});const Fo=document.querySelectorAll(".js-dashboard-deferred");if(Fo.length)try{!function(e){const t=Array.from(e).map(e=>({url:d(e,"data-src"),priority:parseInt(d(e,"data-priority"),10),el:e,loaded:!1}));for(const n of t){const e=n.url,s=n.el;_(document,e).then(function(e){s.replaceWith(e),n.loaded=!0,Do(t.filter(e=>!e.loaded))}).catch(()=>{s.classList.add("is-error")})}Do(t)}(Fo)}catch(Qd){}function Oo(e){let t=e.currentTarget;i(t instanceof HTMLElement,"null.js:20"),s(t,".js-dismiss-repository-recommendation").classList.remove("d-none")}function Bo(e){let t=e.currentTarget;i(t instanceof HTMLElement,"null.js:27"),s(t,".js-dismiss-repository-recommendation").classList.add("d-none")}Xs(".js-discover-repositories .js-ajax-pagination",function(e){i(e instanceof HTMLFormElement,"null.js:11"),e.classList.contains("is-loading")||(e.classList.add("is-loading"),v(e))}),n(".js-repository-recommendation",{add:function(e){e.addEventListener("mouseover",Oo),e.addEventListener("mouseout",Bo)},remove:function(e){e.removeEventListener("mouseover",Oo),e.removeEventListener("mouseout",Bo)}}),h(".js-dismiss-repository-recommendation",async function(e,t){const n=r(e,".js-repository-recommendation-and-restore"),o=s(n,".js-restore-repo-rec-container"),i=s(n,".js-repository-recommendation");await t.html()&&(i.classList.add("d-none"),o.classList.remove("d-none"),o.style.display="block")}),h(".js-restore-repo-rec-form",async function(e,t){const n=r(e,".js-repository-recommendation-and-restore"),o=s(n,".js-restore-repo-rec-container"),i=s(n,".js-repository-recommendation");await t.html()&&(o.classList.add("d-none"),i.classList.remove("d-none"),i.style.display="block")}),o("click",".js-show-more-recent-items",function(e){e.currentTarget.classList.add("d-none")}),n(".js-recent-activity-container",function(){const e=document.querySelector(".js-all-activity-header");e&&e.classList.remove("d-none")}),o("submit","form.js-post-recovery-token",function(e){const t=e.currentTarget;i(t instanceof HTMLFormElement,"null.js:41"),e.preventDefault(),async function(e){const t=s(document,".js-delegated-account-recovery-submit",HTMLButtonElement),n=s(document,".js-create-recovery-token-form",HTMLFormElement);e.classList.remove("failed"),e.classList.add("loading"),t.disabled=!0;try{const s=await ne(n),r=await s.json();se(e,{token:r.token,state:r.state_url}),e.submit()}catch(o){e.classList.remove("loading"),e.classList.add("failed"),t.disabled=!1}}(t)}),n("form.js-recovery-provider-auto-redirect",{constructor:HTMLFormElement,initialize:function(e){e.submit()}}),o("click",".js-sub-dependencies",async function(e){let t=e.currentTarget;i(t instanceof HTMLElement,"null.js:9");const n=t,s=n.getAttribute("data-loaded"),o=n.querySelector(".js-expanded"),r=n.querySelector(".js-collapsed"),a=n.closest(".js-details-container");if(o&&o.classList.toggle("d-none"),r&&r.classList.toggle("d-none"),a&&a.classList.toggle("bg-gray-light"),!s){n.setAttribute("data-loaded","true");const e=d(n,"data-sub-dependency-url"),t=n.closest(".js-dependency"),s=await _(document,e);t&&t.after(s)}});let Uo=null;function Wo(e){let t=e.currentTarget;i(t instanceof HTMLElement,"null.js:27"),t.hasAttribute("open")?(Uo&&Uo!==t&&Uo.removeAttribute("open"),Uo=t):t===Uo&&(Uo=null)}async function zo(e){let t=e.currentTarget;i(t instanceof HTMLElement,"null.js:45");const n=t,s=t.hasAttribute("open");b(n,s?"menu:activate":"menu:deactivate"),await S(),b(n,s?"menu:activated":"menu:deactivated")}function Vo(e){let t=e.currentTarget;if(!(t instanceof Element))return;const n=r(t,"details"),o=d(n,"data-deferred-details-content-url");n.removeAttribute("data-deferred-details-content-url"),s(n,"include-fragment",IncludeFragmentElement).src=o}async function Ko(e){const t=e.getAttribute("data-url");if(await async function(e){const t=e;if(!t)return!1;try{const e=await U(t);return e.has_gravatar}catch(n){return!1}}(t)){const t=e.getAttribute("data-gravatar-text");null!=t&&(e.textContent=t)}}function Go(e){const t=e.ownerDocument;e.scrollIntoView(),t.defaultView.scrollBy(0,-Jo(t))}function Jo(e){re();const t=e.querySelectorAll(".js-sticky-offset-scroll"),n=e.querySelectorAll(".js-position-sticky");return Math.max(0,...Array.from(t).map(e=>{const t=e.getBoundingClientRect(),n=t.top,s=t.height;return 0===n?s:0}))+Math.max(0,...Array.from(n).map(e=>{const t=e.getBoundingClientRect(),n=t.top,s=t.height,o=parseInt(getComputedStyle(e).top);if(!e.parentElement)return 0;const r=e.parentElement.getBoundingClientRect().top;return n===o&&r<0?s:0}))}function Qo(e){const t=Xo();if(!t)return;Yo(e,t);const n=function(e,t){const n=function(e,t){const n=/^(diff-[0-9a-f]{32})(?:[L|R]\d+)?$/.exec(t);if(!n)return;const s=n[1],o=e.querySelector(`a[name='${s}']`);if(!o)return;const r=o.nextElementSibling;if(r&&!r.querySelector(".js-diff-load-container"))return;return r}(e,t);if(n)return n;return function(e,t){const n=/^(?:r|commitcomment-)(\d+)$/.exec(t);if(!n)return;const s=n[1],o=e.querySelector(`#diff-with-comment-${s}`);if(!o)return;return o.closest(".js-file")}(e,t)}(e,t);n&&(Go(n),er(n))}function Xo(){return window.location.hash.slice(1)}function Yo(e,t){const n=z(e.ownerDocument,t);n&&e.contains(n)&&Go(n)}function Zo(e){let t=e.currentTarget;i(t instanceof Element,"null.js:146"),s(t,".js-diff-progressive-spinner").classList.add("d-none"),s(t,".js-diff-progressive-retry").classList.remove("d-none")}function er(e){const t=s(e,".js-diff-entry-loader",IncludeFragmentElement),n=s(e,".js-diff-placeholder",Element),o=s(e,"button.js-diff-load",HTMLButtonElement),r=s(e,".js-button-text");n.setAttribute("fill","url('#animated-diff-gradient')"),r.textContent=o.getAttribute("data-disable-with")||"",o.disabled=!0;const i=new URL(t.getAttribute("data-fragment-url")||"",window.location.origin);return t.src=i.toString(),t.data}function tr(e){const t=e.currentTarget;i(t instanceof Element,"null.js:179"),s(t,".js-diff-load-button-container").classList.add("d-none"),s(t,".js-diff-load-retry").classList.remove("d-none")}function nr(e){let t=e.currentTarget;i(t instanceof IncludeFragmentElement,"null.js:196"),t.setAttribute("data-url",t.src),t.removeAttribute("src")}function sr(e){e.src=e.getAttribute("data-url")||"",e.removeAttribute("data-url")}function or(e){var t;fr(),t=e,s(document,".js-file-filter-text",HTMLElement).classList.toggle("text-blue",t),function(e){const t=document.querySelector(".js-reset-filters"),n=document.querySelector(".js-commits-filtered");null==t||n||(t.hidden=!e)}(e),function(){const e=ar(),t=dr();for(const o of e)if(t){const e="0"===d(o,"data-non-deleted-files-count");o.disabled=e}else o.disabled=!1;const n=document.querySelector(".js-deleted-files-container"),s=cr();if(s&&n){const t=function(e){const t=e.find(e=>e.checked&&"0"!==d(e,"data-deleted-files-count"));return Boolean(t)}(e);n.classList.toggle("text-gray",!t),s.disabled=!t}}(),function(){const e=ur(),t=s(document,".js-file-filter-select-all-container",HTMLElement),n=d(t,e?"data-select-all-markup":"data-all-selected-markup");t.textContent=n,t.classList.toggle("text-gray",!e),t.classList.toggle("text-blue",e)}(),function(){const e=document.querySelector(".js-deleted-files-container");if(e){const t=dr()?"data-show-deleted-markup":"data-hide-deleted-markup",n=d(e,t);e.textContent=n}}(),function(){const e=u(document,".js-file-type-count");for(const t of e){const e=dr()?"data-non-deleted-file-count-markup":"data-all-file-count-markup",n=d(t,e);t.textContent=n}}(),ae(e,ir())}function rr(e){!function(){const e=cr(),t=ir(),n=pr()?u(document,".js-file"):u(document,".js-file-header");for(const s of n){const n=s.getAttribute("data-file-type");if(n){const e=t.includes(n);mr(s,e)}if(e&&e.checked){const e="true"===s.getAttribute("data-file-deleted");e&&mr(s,!e)}}}(),or(e)}function ir(){return ar().filter(e=>e.checked).map(e=>e.value)}function ar(){return u(document,".js-diff-file-type-option",HTMLInputElement)}function cr(){const e=document.querySelector(".js-deleted-files-toggle");if(e instanceof HTMLInputElement)return e}function lr(){return ur()||dr()}function ur(){return ir().length!==ar().length}function dr(){const e=cr();return!!e&&e.checked}function mr(e,t){const n=r(e,".js-file.js-details-container");pr()?(n.classList.toggle("open",t),n.classList.toggle("Details--on",t)):n.hidden=!t}function fr(){if(pr())return;const e=u(document,".toc-menu-item",HTMLAnchorElement),t=ir(),n=cr();for(const s of e){const e=s.getAttribute("data-file-type");if(e){const n=t.includes(e);s.classList.toggle("d-none",!n)}if(n&&n.checked){const e="true"===s.getAttribute("data-file-deleted");e&&s.classList.toggle("d-none",e)}}}function gr(e){const t=ar();for(const n of t)n.checked=e}function pr(){const e=document.querySelector(".js-file-filter");return!!e&&e.hasAttribute("data-diff-file-filter-persistence")}document.addEventListener("keydown",function(e){!e.defaultPrevented&&"Escape"===e.key&&Uo&&Uo.removeAttribute("open")}),n(".js-dropdown-details",{subscribe:e=>H(e,"toggle",Wo)}),n("details.js-select-menu",{subscribe:e=>H(e,"toggle",zo)}),o("menu:deactivate","details.js-select-menu",function(e){e.currentTarget.hasAttribute("open")&&e.currentTarget.removeAttribute("open")}),n("[data-deferred-details-content-url]:not([data-details-no-preload-on-hover])",{subscribe:e=>{const t=s(e,"summary");return H(t,"mouseenter",Vo)}}),n("[data-deferred-details-content-url]",{subscribe:e=>H(e,"toggle",Vo)}),o("click","[data-toggle-for]",function(e){const t=e.currentTarget.getAttribute("data-toggle-for")||"",n=document.getElementById(t);n&&(n.hasAttribute("open")?n.removeAttribute("open"):n.setAttribute("open","open"))}),n("details.select-menu details-menu include-fragment",function(e){const t=e.closest("details");t&&(e.addEventListener("loadstart",function(){t.classList.add("is-loading"),t.classList.remove("has-error")}),e.addEventListener("error",function(){t.classList.add("has-error")}),e.addEventListener("loadend",function(){t.classList.remove("is-loading");const e=t.querySelector(".js-filterable-field");e&&b(e,"filterable:change")}))}),n("details details-menu .js-filterable-field",{constructor:HTMLInputElement,add(e){const t=e.closest("details");t&&t.addEventListener("toggle",function(){t.hasAttribute("open")||(e.value="",b(e,"filterable:change"))})}}),oe(function(e){let t=e.target;if(!t||t.closest("summary"))return;let n=t.parentElement;for(;n;)(n=n.closest("details"))&&(n.hasAttribute("open")||n.setAttribute("open",""),n=n.parentElement)}),o("click",".js-anon-download-zip-link",function(e){const t=e.currentTarget,n=r(t,".js-get-repo-modal"),o=s(n,".js-modal-downloading");n.classList.add("is-downloading"),o.hidden=!1}),o("toggle",".js-anon-get-repo-select-menu",function(e){const t=e.target;s(t,".js-modal-downloading").hidden=t.hasAttribute("open")},{capture:!0}),n(".js-detect-gravatar",function(e){Ko(e)}),n(".js-diff-progressive-container",function(e){Qo(e);const t=e.querySelector(".js-diff-progressive-loader");t&&(t.addEventListener("load",function(){Qo(e)}),t.addEventListener("error",nr),t.addEventListener("error",Zo))}),o("click",".js-diff-progressive-retry .js-retry-button",function(e){const t=r(e.currentTarget,".js-diff-progressive-loader",IncludeFragmentElement);!function(e){s(e,".js-diff-progressive-spinner").classList.remove("d-none"),s(e,".js-diff-progressive-retry").classList.add("d-none")}(t),sr(t)}),n(".js-diff-load-container",function(e){const t=e.querySelector(".js-diff-entry-loader");t&&(t.addEventListener("load",function(){r(e,".js-file").classList.remove("hide-file-notes-toggle");const t=Xo();t&&Yo(e,t)}),t.addEventListener("error",nr),t.addEventListener("error",tr))}),o("click",".js-diff-load",function(e){if(e.target.classList.contains("js-ignore-this"))return;er(r(e.currentTarget,".js-diff-load-container"))}),o("click",".js-diff-load-retry .js-retry-button",function(e){const t=r(e.currentTarget,".js-diff-entry-loader",IncludeFragmentElement);!function(e){s(e,".js-diff-load-button-container").classList.remove("d-none"),s(e,".js-diff-load-retry").classList.add("d-none")}(t),sr(t)}),o("click",".js-rendered, .js-source",function(e){const t=e.currentTarget;t.classList.contains("selected")?e.preventDefault():(function(e){const t=r(e,".js-file-header"),n=e.classList.contains("js-rendered"),s=e.classList.contains("js-source"),o=d(t,"data-short-path"),i=d(t,"data-anchor"),a=new URL(window.location.href,window.location.origin),c=new URLSearchParams(a.search.slice(1));a.hash=i,n?c.set("short_path",o):s&&c.delete("short_path");a.search=c.toString(),T(null,"",a.toString())}(t),function(e){for(const t of document.querySelectorAll(".js-rendered, .js-source"))t.classList.remove("selected"),t.removeAttribute("aria-current");e.classList.add("selected"),e.setAttribute("aria-current","true")}(t))}),h(".js-prose-diff-toggle-form",async function(e,t){const n=r(e,".js-details-container"),o=s(n,".js-file-content"),i=await t.html();for(;o.lastChild;)o.removeChild(o.lastChild);o.append(i.html),n.classList.toggle("display-rich-diff"),n.classList.toggle("show-inline-notes")}),o("change",".js-diff-style-toggle input",function(e){const t=r(e.target,".js-diff-settings");for(const n of u(t,".js-diff-style-toggle label"))n.classList.toggle("selected")}),o("click",".js-toc-retry",function(e){const t=r(e.target,".select-menu"),n=s(t,"include-fragment"),o=d(n,"src");n.setAttribute("src",""),n.setAttribute("src",o)}),o("change",".js-diff-file-type-option",function(){rr(lr())}),n(".js-toc-items-container",function(){fr()}),o("click",".js-file-filter-select-all",function(){ur()&&(gr(!0),rr(lr()))}),o("change",".js-deleted-files-toggle",function(){rr(lr())}),n(".js-file-filter",function(){pr()&&(lr()?or(!0):ae(!1,ir()))}),o("click",".js-file-header .js-details-target",function(e){let t=e.currentTarget;if(!pr())return;const n=r(t,".js-details-container"),s=ce(n),o=cr();let i=!1;o&&(i=le(n,o)),(s||i)&&or(lr())});class ItemSuggesterElement extends HTMLElement{constructor(){super(),this.teardownHandler=this.teardown.bind(this),this.deactivateHandler=this.deactivate.bind(this),this.pasteHandler=this.onPaste.bind(this),this.inputHandler=this.onInput.bind(this),this.escapeHandler=this.onEscapeKeydown.bind(this)}connectedCallback(){const e=document.getElementById(this.getAttribute("for")||"");(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(this.input=e,e.form&&e.form.addEventListener("reset",this.deactivateHandler),e.addEventListener("paste",this.pasteHandler),e.addEventListener("input",this.inputHandler),e.addEventListener("keydown",this.escapeHandler),e.addEventListener("focusout:delay",this.teardownHandler),this.addEventListener("combobox-commit",this.onComboboxCommit))}disconnectedCallback(){this.teardownHandler()}teardown(){this.deactivate();const e=this.input;e&&(e.form&&e.form.removeEventListener("reset",this.deactivateHandler),e.removeEventListener("paste",this.pasteHandler),e.removeEventListener("input",this.inputHandler),e.removeEventListener("keydown",this.escapeHandler),e.removeEventListener("focusout:delay",this.teardownHandler),this.removeEventListener("combobox-commit",this.onComboboxCommit))}getList(){return this.querySelector("ul")}async loadSuggestions(){const e=this.getAttribute("src");e&&(this.suggestionContainer=f(document,await g(e)).children[0],document.activeElement===this.input&&(this.currentSearch=null,this.checkQuery()))}activate(e){if(this.input!==document.activeElement)return;const t=Ms(this.input,e+1),n=t.top,s=t.left;if(this.style.top=`${n}px`,this.style.left=`${s}px`,!this.hidden)return;this.hidden=!1;const o=this.getList();o&&(o.id||(o.id=`suggester-${Math.floor(1e5*Math.random()).toString()}`),this.input.setAttribute("aria-owns",o.id),this.input.setAttribute("role","combobox"),bs(this.input,this))}deactivate(){if(this.hidden)return;this.hidden=!0;const e=this.getList();e&&e.remove(),this.input.removeAttribute("role"),Ls(this.input,this)}onPaste(){this.deactivate(),this.justPasted=!0}onInput(){this.justPasted?this.justPasted=!1:this.checkQuery()}onEscapeKeydown(e){this.hidden||"Escape"===e.key&&(this.deactivate(),e.stopImmediatePropagation(),e.preventDefault())}onComboboxCommit(e){let t=e.target;if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-value"))return;const n=this.getValue(t);if(!n)return;const s=this.currentSearch;if(!s)return;let o=this.input.value.substring(0,s.endIndex);const r=this.input.value.substring(s.endIndex);o=o.replace(this.matchRegExp,this.replacePattern.replace("$value",n)),this.input.value=o+r,this.input.dispatchEvent(new CustomEvent("suggester:complete",{bubbles:!0})),this.deactivate(),this.input.focus(),this.input.selectionStart=o.length,this.input.selectionEnd=o.length}async checkQuery(){this.suggestionContainer||await this.loadSuggestions();const e=this.searchQuery();if(e){if(this.currentSearch&&this.currentSearch===e.query)return;return this.currentSearch=e,void(await this.searchAndUpdateResults()?this.activate(e.startIndex):this.deactivate())}this.currentSearch=null,this.deactivate()}async searchAndUpdateResults(){if(!this.currentSearch)return!1;const e=await this.search(this.currentSearch.query);if(!e)return!1;const t=e.element;if(e.results>0&&t){const e=t.cloneNode(!0),n=this.getList();n?n.replaceWith(e):this.append(e),e.id=this.input.getAttribute("aria-owns")||"",e.style.display="block";const s=this.getList();return!!s&&(ks(this.input,s),!0)}return!1}searchQuery(){const e=this.input.selectionEnd,t=this.input.value.substring(0,e).match(this.matchRegExp);if(t)return this.normalizeMatch(e,t)}normalizeMatch(e,t){const n=e-t[2].length,s=e;return{query:t[3],startIndex:n,endIndex:s}}getValue(e){return e.getAttribute("data-value")}search(e){throw new Error(`Searching with ${e}, but search function is not definied`)}}class EmojiSuggesterElement extends ItemSuggesterElement{constructor(){super(),this.matchRegExp=/(^|\s|\()(:([a-z0-9\-+_]*))$/i,this.replacePattern="$1$value "}search(e){const t=` ${e.toLowerCase().replace(/_/g," ")}`,n=O(this.suggestionContainer,t,{limit:5,text:jr,score:vr});if(!this.suggestionContainer)throw new Error("suggestionContainer is null");return Promise.resolve({element:this.suggestionContainer,results:n})}getValue(e){if(e.hasAttribute("data-use-colon-emoji"))return e.getAttribute("data-value");const t=e.firstElementChild;return t&&"G-EMOJI"===t.tagName&&!t.firstElementChild?t.textContent:e.getAttribute("data-value")}}const hr={};function jr(e){const t=e.getAttribute("data-emoji-name")||"";return hr[t]=` ${function(e){return(e.getAttribute("data-text")||"").trim().toLowerCase()}(e).replace(/_/g," ")}`,t}function vr(e,t){const n=hr[e].indexOf(t);return n>-1?1e3-n:0}function br(){for(const t of document.querySelectorAll(".js-newsletter-frequency-choice.selected"))t.classList.remove("selected");const e=s(document,".js-newsletter-frequency-radio:enabled:checked");r(e,".js-newsletter-frequency-choice").classList.add("selected")}function Lr(){Jo(document)&&function(e){const t=ie(e);t&&Go(t)}(document)}window.customElements.get("emoji-suggester")||(window.EmojiSuggesterElement=EmojiSuggesterElement,window.customElements.define("emoji-suggester",EmojiSuggesterElement)),n(".js-subscription-toggle",function(){br()}),o("change",".js-newsletter-frequency-radio",function(){br()}),h(".js-subscription-toggle",async function(e,t){await t.text();const n=s(e,".selected .notice");n.classList.add("visible"),setTimeout(function(){n.classList.remove("visible")},2e3)}),h(".js-explore-newsletter-form",async function(e,t){const n=await t.html();r(e,".js-explore-newsletter-container").replaceWith(n.html)}),oe(Lr),o("click",'a[href^="#"]',function(e){e.currentTarget instanceof HTMLAnchorElement&&setTimeout(Lr,0)});class yr{constructor(e){this.name=e.getAttribute("data-theme-name")||"",this.slug=e.getAttribute("data-theme-slug")||"",this.gem=e.getAttribute("data-theme-gem")||"",this.selected=e.classList.contains("selected"),this.baseHref=e.getAttribute("href")||""}}class Er{constructor(){this.pagePreview=s(document,"#page-preview"),this.contextLoader=s(document,".theme-picker-spinner"),this.fullPicker=s(document,".theme-picker-thumbs"),this.miniPicker=s(document,".theme-picker-controls"),this.scrollBackwardsLink=s(document,".theme-toggle-full-left",HTMLButtonElement),this.scrollForwardsLink=s(document,".theme-toggle-full-right",HTMLButtonElement),this.themeLinksContainer=s(this.fullPicker,".js-theme-selector"),this.themeLinks=u(this.themeLinksContainer,".theme-selector-thumbnail"),this.themes=this.themeLinks.map(e=>{const t=new yr(e);return t.selected&&(this.selectedTheme=t),t}),this.scrolledPage=0,this.selectedTheme=this.selectedTheme||this.themes[0],this.pagePreview.addEventListener("load",()=>this.onPagePreviewLoad()),this.scrollBackwardsLink.addEventListener("click",()=>this.scrollThemeLinksContainer(-1)),this.scrollForwardsLink.addEventListener("click",()=>this.scrollThemeLinksContainer(1)),s(document,".theme-picker-prev").addEventListener("click",e=>this.onThemeNavPrevClick(e)),s(document,".theme-picker-next").addEventListener("click",e=>this.onThemeNavNextClick(e));for(const t of this.themeLinks)t.addEventListener("click",e=>this.onThemeLinkClick(e));s(document,".theme-picker-view-toggle").addEventListener("click",e=>this.onHideClick(e));const e=document.querySelector("#page-edit");e&&e.addEventListener("click",e=>this.onEditClick(e)),s(document,"#page-publish").addEventListener("click",e=>this.onPublishClick(e)),this.theme(this.selectedTheme),this.updateScrollLinks()}onPagePreviewLoad(){this.contextLoader.classList.remove("visible")}onThemeNavPrevClick(e){this.theme(this.prevTheme()),e.preventDefault()}onThemeNavNextClick(e){this.theme(this.nextTheme()),e.preventDefault()}onThemeLinkClick(e){this.theme(this.themeForLink(e.currentTarget)),e.preventDefault()}onHideClick(e){let t=e.currentTarget;i(t instanceof HTMLElement,"null.js:98"),this.fullPicker.classList.toggle("d-none"),this.miniPicker.classList.toggle("d-none"),this.scrollToTheme(this.theme(),!1),t.classList.toggle("open")}onEditClick(e){v(s(document,"#page-edit-form",HTMLFormElement)),e.preventDefault()}onPublishClick(e){const t=s(document,"#page-publish-form",HTMLFormElement),n=this.theme();n&&(s(document,'input[name="page[theme_slug]"]',HTMLInputElement).value=n.slug),v(t),e.preventDefault()}scrollThemeLinksContainer(e){this.scrollToTheme(this.themes[e<0?0:6]),this.updateScrollLinks()}updateScrollLinks(){const e=0===this.scrolledPage;this.scrollBackwardsLink.disabled=e,this.scrollBackwardsLink.classList.toggle("disabled",e),this.scrollForwardsLink.disabled=!e,this.scrollForwardsLink.classList.toggle("disabled",!e)}selectedThemeIndex(){return this.themes.indexOf(this.selectedTheme)}prevTheme(){let e=(this.selectedThemeIndex()-1)%this.themes.length;return e<0&&(e+=this.themes.length),this.themes[e]}nextTheme(){return this.themes[(this.selectedThemeIndex()+1)%this.themes.length]}themeForLink(e){return this.themes[this.themeLinks.indexOf(e)]}linkForTheme(e){return this.themeLinks[this.themes.indexOf(e)]}scrollToTheme(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.scrolledPage=Math.floor(this.themes.indexOf(e)/6);let n=0;if(this.scrolledPage>0){const e=this.linkForTheme(this.themes[6*this.scrolledPage]);n=e.offsetLeft}const s=this.themeLinksContainer,o=n-s.scrollLeft;if(t&&0!==o){const e=150;r=(t=>{if(t<0)return;const r=s.scrollLeft;return s.scrollLeft=Math[n-r>0?"min":"max"](r+o*(t/e),n),r!==s.scrollLeft&&void 0}),new Promise(e=>{let t=performance.now();!function n(){window.requestAnimationFrame(s=>{!1!==r(s-t)?(t=s,n()):e()})}()})}else s.scrollLeft=n;var r}theme(e){if(!e)return this.selectedTheme;this.selectedTheme=e,this.showPreviewFor(e);for(const t of this.themeLinks)t.classList.remove("selected");this.linkForTheme(e).classList.add("selected"),this.scrollToTheme(e),s(this.miniPicker,".js-theme-name").textContent=e.name}showPreviewFor(e){if(this.contextLoader.classList.add("visible"),e.gem)this.pagePreview.setAttribute("src",e.baseHref);else{const t=s(this.fullPicker,"form",HTMLFormElement);s(document,'input[name="theme_slug"]',HTMLInputElement).value=e.slug,v(t)}}}function wr(){const e=document.querySelector(".js-get-repo-modal");if(e){e.classList.remove("is-downloading");for(const t of e.querySelectorAll(".js-modal-download-mac, .js-modal-download-windows, .js-modal-download-xcode, .js-modal-download-visual-studio"))t.classList.remove("d-block"),t.classList.add("d-none")}}function Tr(e){const t=document.querySelectorAll(e);if(t.length>0)return t[t.length-1]}function kr(){return function(){const e=Tr("meta[name=analytics-location]");return e instanceof HTMLMetaElement?e.content:window.location.pathname}()+function(){let e="";Tr("meta[name=analytics-location-query-strip]")||(e=window.location.search);const t=Tr("meta[name=analytics-location-params]");t instanceof HTMLMetaElement&&(e+=(e?"&":"?")+t.content);for(const n of u(document,"meta[name=analytics-param-rename]",HTMLMetaElement)){const t=n.content.split(":",2);e=e.replace(new RegExp(`(^|[?&])${t[0]}($|=)`,"g"),`$1${t[1]}$2`)}return e}()}function Sr(){const e=`${window.location.protocol}//${window.location.host}${kr()}`;me(e),fe(Tr("meta[name=analytics-location]")?"(masked)":document.title);const t=Tr("meta[name=analytics-ec-payload]");t instanceof HTMLMetaElement&&Ar(t.content);const n=ge("ga-deferred");n&&(Ar(n),pe("ga-deferred"));for(const s of u(document,"meta.js-ga-set",HTMLMetaElement))he(s.name,s.content)}function Ar(e){if(e)for(const t of JSON.parse(e))window.ga.apply(null,t)}function Mr(){for(const e of document.querySelectorAll("meta[name=analytics-virtual-pageview]"))e instanceof HTMLMetaElement&&je(e.content,{title:""});je()}function Hr(e){const t=e.trim().split(/\s*,\s*/),n=ee(t,4),s=n[0],o=n[1],r=n[2],i=n[3],a={category:s,action:o,label:r};return i&&(a.value=Number(i)),a}n("#theme-picker-wrap",function(){new Er}),o("click",".email-hidden-toggle",function(e){const t=e.currentTarget.nextElementSibling;i(t instanceof HTMLElement,"null.js:11"),t.style.display="",t.classList.toggle("expanded"),e.preventDefault()}),o("click",".js-git-clone-help-container .js-git-clone-help-switcher",function(e){const t=e.currentTarget,n=r(t,".js-git-clone-help-container"),o=t.getAttribute("data-url")||"";if(s(n,".js-git-clone-help-field",HTMLInputElement).value=o,t.matches(".js-git-protocol-clone-url"))for(const s of n.querySelectorAll(".js-git-clone-help-text"))s.textContent=o;const i=n.querySelector(".js-clone-url-button.selected");i&&i.classList.remove("selected"),r(t,".js-clone-url-button").classList.add("selected")}),o("click",".js-get-repo",function(e){const t=d(e.currentTarget,"data-open-app");!function(e,t){let n;switch(e.classList.add("is-downloading"),t){case"mac":n=e.querySelector(".js-modal-download-mac");break;case"windows":n=e.querySelector(".js-modal-download-windows");break;case"xcode":n=e.querySelector(".js-modal-download-xcode");break;case"visual-studio":n=e.querySelector(".js-modal-download-visual-studio")}n&&(n.classList.remove("d-none"),n.classList.add("d-block"))}(r(e.currentTarget,".js-get-repo-modal"),t)}),o("toggle",".js-get-repo-select-menu",wr,{capture:!0}),o("click",".js-get-repo-modal-download-back",wr),ue("octolyticsPlugin",function(e){const t=e.get("sendHitTask");e.set("sendHitTask",function(e){t(e),"event"===e.get("hitType")&&null!=window._octo&&de(`//${window._octo.host}/collect`,e.get("hitPayload"),"application/x-www-form-urlencoded")})});const xr=document.querySelector("meta[name=google-analytics]");xr instanceof HTMLMetaElement&&(ve(xr.content,"auto"),be("octolyticsPlugin"),be("ec"),Sr()),async function(){await P,Mr()}(),document.addEventListener("pjax:complete",()=>{setTimeout(()=>{Sr(),Mr()},20)},!1),n("[data-ga-load]",function(e){const t=Hr(e.getAttribute("data-ga-load")||"");t.interactive=!1,Le(t)}),n("meta[name=analytics-event]",{constructor:HTMLMetaElement,initialize(e){const t=Hr(e.content);t.interactive=!1,Le(t)}}),o("click","[data-ga-click]",function(e){Ar(e.currentTarget.getAttribute("data-ga-ec"));const t=Hr(e.currentTarget.getAttribute("data-ga-click")||"");Le(t)},{capture:!0}),o("click","[data-ga-deferred]",function(e){ye("ga-deferred",e.currentTarget.getAttribute("data-ga-deferred")||"")},{capture:!0}),o("change","[data-ga-change]",function(e){Ar(e.currentTarget.getAttribute("data-ga-ec"));const t=Hr(e.currentTarget.getAttribute("data-ga-change")||"");Le(t)},{capture:!0}),o("click",".js-skip-to-content",function(e){const t=document.getElementById("start-of-content");if(t){const e=t.nextElementSibling;e instanceof HTMLElement&&(e.setAttribute("tabindex","-1"),e.focus())}e.preventDefault()});const qr="ontouchstart"in document;for(const n of document.querySelectorAll(".HeaderMenu-details"))n.addEventListener("toggle",Cr),qr||(n.addEventListener("mouseover",_r),n.addEventListener("mouseleave",_r));let Ir=!1;function Cr(e){if(!Ir){Ir=!0;for(const t of document.querySelectorAll(".HeaderMenu-details"))t!==e.currentTarget&&t.removeAttribute("open");setTimeout(()=>Ir=!1)}}function _r(e){const t=e.currentTarget;t instanceof HTMLElement&&window.innerWidth>1012&&("mouseover"===e.type?e.target instanceof Node&&e.relatedTarget instanceof Node&&t.contains(e.target)&&!t.contains(e.relatedTarget)&&t.setAttribute("open",""):t.removeAttribute("open"))}o("click",".js-video-play, .js-video-close",function(e){e.preventDefault();const t=e.currentTarget,n=t.classList.contains("js-video-play"),o=r(t,".js-video-container"),i=s(o,".js-video-iframe",HTMLIFrameElement),a=document.querySelector(".js-video-bg");n?i.src=i.getAttribute("data-src")||"":i.removeAttribute("src"),o.classList.toggle("is-expanded",n),null!=a&&a.classList.toggle("is-expanded",n),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.getBoundingClientRect(),s=n.top-t,o=n.bottom-window.innerHeight+t;s<0?window.scrollBy(0,s):o>0&&window.scrollBy(0,o)}(i,20)});const $r=document.querySelector(".js-hovercard-content"),Rr={};let Nr,Pr,Dr,Fr=0;const Or=12,Br=24,Ur=Br-7,Wr=16,zr=100,Vr=250;function Kr(e){return"Popover-message--"+e}function Gr(){$r&&($r.style.display="none",$r.children[0].innerHTML="",Pr=null,Nr=null)}function Jr(e){i($r,"null.js:110");const t=$r.getBoundingClientRect(),n=t.width,s=t.height,o=function(e){const t=e.getClientRects();let n=t[0];for(const s of t)if(s.left<Fr&&s.right>Fr){n=s;break}return n}(e),r=o.left,a=o.top,c=o.height,l=o.width,u=a>s;if(e.classList.contains("js-hovercard-left")){const e=a+c/2;return{containerTop:u?e-s+Ur+Wr/2:e-Ur-Wr/2,containerLeft:r-n-Or,contentClassSuffix:u?"right-bottom":"right-top"}}{const e=window.innerWidth-r>n,t=r+l/2;return{containerTop:u?a-s-Or:a+c+Or,containerLeft:e?t-Br:t-n+Br,contentClassSuffix:u?e?"bottom-left":"bottom-right":e?"top-left":"top-right"}}}function Qr(e,t){if(!$r)return;const n=$r.children[0];n.innerHTML="";const s=document.createElement("div");for(const o of e.children)s.appendChild(o.cloneNode(!0));n.appendChild(s),function(e,t){if(!$r)return;$r.style.visibility="hidden",$r.style.display="block",t.classList.remove(Kr("bottom-left"),Kr("bottom-right"),Kr("right-top"),Kr("right-bottom"),Kr("top-left"),Kr("top-right"));const n=Jr(e),s=n.containerTop,o=n.containerLeft,r=n.contentClassSuffix;t.classList.add(Kr(r)),$r.style.top=`${s+window.pageYOffset}px`,$r.style.left=`${o+window.pageXOffset}px`,function(e,t){const n=e.getAttribute("data-hovercard-z-index-override");t.style.zIndex=n||"100"}(e,$r),$r.style.visibility=""}(t,n),function(e){setTimeout(()=>{if(document.body&&document.body.contains(e)){const t=e.querySelector("[data-hovercard-tracking]");if(t){const e=t.getAttribute("data-hovercard-tracking");if(e){const t={event_type:"user-hovercard-load"};t.dimensions=JSON.parse(e),Ee(t)}}const n=e.querySelector("[data-hydro-view]");n&&te(n)}},500)}(s),$r.style.display="block"}function Xr(e){const t=e.getAttribute("data-hovercard-url");if(t){const n=function(e){const t=e.closest("[data-hovercard-subject-tag]");if(t)return t.getAttribute("data-hovercard-subject-tag");const n=document.head&&document.head.querySelector('meta[name="hovercard-subject-tag"]');return n?n.getAttribute("content"):void 0}(e);if(n){const e=new URL(t,window.location.origin),s=new URLSearchParams(e.search.slice(1));return s.append("subject",n),s.append("current_path",window.location.pathname+window.location.search),e.search=s.toString(),e.toString()}return t}return""}async function Yr(e,t){const n=e.currentTarget;if(e instanceof MouseEvent&&(Fr=e.clientX),i(n instanceof Element,"null.js:277"),Nr===n)return;if(n.closest(".js-hovercard-content"))return;if(!function(e){const t=e.getAttribute("data-hovercard-type");return"pull_request"===t||"issue"===t?!!e.closest("[data-issue-and-pr-hovercards-enabled]"):"team"===t?!!e.closest("[data-team-hovercards-enabled]"):"repository"===t?!!e.closest("[data-repository-hovercards-enabled]"):"commit"!==t||!!e.closest("[data-commit-hovercards-enabled]")}(n))return;Gr(),Nr=n,Pr=document.activeElement;const s=Xr(n);let o;try{const e=new Promise(e=>setTimeout(e,t,0));o=await async function(e){return Rr[e]||(Rr[e]=_(document,e)),Rr[e]}(s),await e}catch(r){if(r.response&&404===r.response.status){const e="Hovercard is unavailable";return n.setAttribute("aria-label",e),void n.classList.add("tooltipped","tooltipped-ne")}if(r.response&&410===r.response.status){const e=await r.response.clone().json();return n.setAttribute("aria-label",e.message),void n.classList.add("tooltipped","tooltipped-ne")}if(/X-HTML-Safe/.test(r.message))return;throw r}n===Nr&&(Qr(o,n),e instanceof KeyboardEvent&&$r&&$r.focus())}function Zr(e){Yr(e,Vr)}function ei(e){if(Nr){if(e instanceof MouseEvent&&e.relatedTarget instanceof HTMLElement){const t=e.relatedTarget;if(t.closest(".js-hovercard-content")||t.closest("[data-hovercard-url]"))return}else e instanceof KeyboardEvent&&Pr&&Pr.focus();Gr()}}function ti(e){const t=Nr;Dr=setTimeout(()=>{Nr===t&&ei(e)},zr)}function ni(e){switch(i(e instanceof KeyboardEvent,"null.js:366"),e.key){case"Escape":ei(e)}}function si(){Dr&&clearTimeout(Dr)}function oi(){const e=document.getElementById("js-update-integration-permissions");e&&e.removeAttribute("disabled")}function ri(){return function(){const e=u(document,'[id^=integration_permission_]:checked:not([data-permission="none"])',HTMLInputElement);return Array.from(e,e=>e.getAttribute("data-resource"))}().map(e=>(function(e){if(e)return u(document,`.js-integration-hook-event[data-resource~="${e}"]:checked`,HTMLInputElement)})(e)).reduce((e,t)=>e.concat(t,[]),[])}function ii(){const e=s(document,".js-content-references input",HTMLInputElement),t=s(document,".js-content-references template",HTMLTemplateElement),n=s(document,".js-content-references-domain-list"),o=e.value;if(!o)return;const i=t.content.cloneNode(!0);s(i,"input",HTMLInputElement).value=o,s(i,".js-content-references-domain-url").textContent=o,e.value="",n.appendChild(i),r(n,".Box").hidden=!1,oi()}async function ai(e){let t=e.currentTarget;i(t instanceof HTMLElement,"null.js:12");const n=t.getAttribute("data-url");if(!n)return;const s=t.getAttribute("data-id")||"",o=t.textContent,r=document.querySelectorAll(`.js-issue-link[data-id='${s}']`);for(const i of r)i.removeAttribute("data-url");try{ci(r,`${o}, ${(await U(n)).title}`)}catch(a){const e=(null!=a.response?a.response.status:void 0)||500;ci(r,(()=>{switch(e){case 404:return t.getAttribute("data-permission-text");default:return t.getAttribute("data-error-text")}})()||"")}}function ci(e,t){for(const s of e)(n=s).getAttribute("data-hovercard-url")&&n.closest("[data-issue-and-pr-hovercards-enabled]")||s.classList.add("tooltipped","tooltipped-ne"),s.setAttribute("aria-label",t);var n}function li(e){const t=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(function(e){return String(e).toLowerCase().replace(/[^0-9a-f]/g,"")}(e));if(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}}$r&&(n("[data-hovercard-url]",{subscribe:e=>H(e,"mouseover",Zr)}),n("[data-hovercard-url]",{subscribe:e=>H(e,"mouseleave",ti)}),n("[data-hovercard-url]",{subscribe:e=>H(e,"keyup",ni)}),n("[data-hovercard-url]",{remove(e){Nr===e&&Gr()}}),n(".js-hovercard-content",{subscribe:e=>H(e,"mouseover",si)}),n(".js-hovercard-content",{subscribe:e=>H(e,"mouseleave",ei)}),n(".js-hovercard-content",{subscribe:e=>H(e,"keyup",ni)}),o("menu:activated",".js-select-menu",Gr),window.addEventListener("statechange",Gr)),n(".js-scrollnav-listener",function(e){window.addEventListener("scroll",function(){!function(e){const t=s(e,".js-scrollnav").getBoundingClientRect().height;for(const n of e.querySelectorAll(".js-section")){const s=n.getBoundingClientRect(),o=t>=s.top,r=t<=s.top+s.height;if(o&&r){const t=e.querySelector(`.js-scrollnav-item[href="#${n.id}"]`);if(t&&!t.classList.contains("selected")){for(const t of e.querySelectorAll(".js-scrollnav-item"))t.classList.remove("selected");t.classList.add("selected")}}}}(e)},{passive:!0})}),o("change",".js-integration-permissions-selector [id^=integration_permission_]",function(e){let t=e.currentTarget;const n=t.getAttribute("data-permission"),o=t.getAttribute("data-resource")||"",i=u(document,`.js-integration-hook-event[data-resource~="${o}"]`,HTMLInputElement),a=u(document,".js-integration-single-file-resource",HTMLInputElement),c=u(document,`.js-dropdown-container[data-resource~="${o}"]`);if(oi(),"none"!==n){const e=u(document,`.js-integration-hook-event-permission-error[data-resource~='${o}']`);for(const t of e)t.classList.add("d-none");const n=u(document,".js-integration-single-file-permission-error");for(const t of n)t.classList.add("d-none");for(const t of i)t.readOnly=!1;for(const t of a)t.readOnly=!1;r(t,".js-list-group-item").classList.remove("disabled");for(const t of c)t.classList.remove("d-none")}else{for(const e of i)l=e,ri().includes(l)||(e.readOnly=!0,e.checked=!1,r(e,".js-dropdown-container").classList.add("anim-fade-in","d-none"));if(r(t,".js-list-group-item").classList.add("disabled"),"single_file"===o)for(const e of a)e.readOnly=!0,e.value="";else"content_references"===o&&(s(document,`.js-dropdown-container[data-resource~='${o}']`).classList.add("anim-fade-in","d-none"),"none"===n&&(s(document,".js-content-references-domain-list").innerHTML=""))}var l}),o("change",".js-integration-permissions-selector [name^=integration]",oi),o("click",".js-integration-permissions-selector .js-integration-hook-event",function(e){const t=e.currentTarget;if(i(t instanceof HTMLInputElement,"null.js:174"),t.readOnly){const n=r(t,".js-send-events");s(n,".js-integration-hook-event-permission-error").classList.remove("d-none"),e.preventDefault()}}),o("click",".js-integration-permissions-selector .js-integration-single-file-resource",function(e){const t=e.currentTarget;if(i(t instanceof HTMLInputElement,"null.js:187"),t.readOnly){const n=r(t,".js-single-file");s(n,".js-integration-single-file-permission-error").classList.remove("d-none"),e.preventDefault()}}),C("keydown",".js-content-references input",function(e){"Enter"===e.key&&(e.preventDefault(),ii())}),o("click",".js-content-references .js-domain-add",ii),o("click",".js-content-references .js-close",function(e){const t=r(e.target,"li"),n=t.parentElement;n&&(n.removeChild(t),0===u(n,"li").length&&(r(n,".Box").hidden=!0),oi())}),n(".js-issue-link",{subscribe:e=>H(e,"mouseenter",ai)});var ui=we(function(e,t){var n;n=function(){var e=null,t={};r("monochrome",null,[[0,0],[100,0]]),r("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),r("orange",[19,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),r("yellow",[47,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),r("green",[63,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),r("blue",[179,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),r("purple",[258,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),r("pink",[283,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]);var n=function(r){if(void 0!==(r=r||{}).seed&&null!==r.seed&&r.seed===parseInt(r.seed,10))e=r.seed;else if("string"==typeof r.seed)e=function(e){for(var t=0,n=0;n!==e.length&&!(t>=Number.MAX_SAFE_INTEGER);n++)t+=e.charCodeAt(n);return t}(r.seed);else{if(void 0!==r.seed&&null!==r.seed)throw new TypeError("The seed value must be an integer or string");e=null}var c,l,u;if(null!==r.count&&void 0!==r.count){var d=r.count,m=[];for(r.count=null;d>m.length;)e&&r.seed&&(r.seed+=1),m.push(n(r));return r.count=d,m}return c=function(e){var n=o(function(e){if("number"==typeof parseInt(e)){var n=parseInt(e);if(n<360&&n>0)return[n,n]}if("string"==typeof e)if(t[e]){var s=t[e];if(s.hueRange)return s.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var o=function(e){e=3===(e=e.replace(/^#/,"")).length?e.replace(/(.)/g,"$1$1"):e;var t=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,s=parseInt(e.substr(4,2),16)/255,o=Math.max(t,n,s),r=o-Math.min(t,n,s),i=o?r/o:0;switch(o){case t:return[(n-s)/r%6*60||0,i,o];case n:return[60*((s-t)/r+2)||0,i,o];case s:return[60*((t-n)/r+4)||0,i,o]}}(e)[0];return[o,o]}return[0,360]}(e.hue));n<0&&(n=360+n);return n}(r),l=function(e,t){if("monochrome"===t.hue)return 0;if("random"===t.luminosity)return o([0,100]);var n=function(e){return s(e).saturationRange}(e),r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55}return o([r,i])}(c,r),u=function(e,t,n){var r=function(e,t){for(var n=s(e).lowerBounds,o=0;o<n.length-1;o++){var r=n[o][0],i=n[o][1],a=n[o+1][0],c=n[o+1][1];if(t>=r&&t<=a){var l=(c-i)/(a-r),u=i-l*r;return l*t+u}}return 0}(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100}return o([r,i])}(c,l,r),function(e,t){switch(t.format){case"hsvArray":return e;case"hslArray":return a(e);case"hsl":var n=a(e);return"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)";case"hsla":var s=a(e),o=t.alpha||Math.random();return"hsla("+s[0]+", "+s[1]+"%, "+s[2]+"%, "+o+")";case"rgbArray":return i(e);case"rgb":var r=i(e);return"rgb("+r.join(", ")+")";case"rgba":var c=i(e),o=t.alpha||Math.random();return"rgba("+c.join(", ")+", "+o+")";default:return function(e){var t=i(e);function n(e){var t=e.toString(16);return 1==t.length?"0"+t:t}return"#"+n(t[0])+n(t[1])+n(t[2])}(e)}}([c,l,u],r)};function s(e){for(var n in e>=334&&e<=360&&(e-=360),t){var s=t[n];if(s.hueRange&&e>=s.hueRange[0]&&e<=s.hueRange[1])return t[n]}return"Color not found"}function o(t){if(null===e)return Math.floor(t[0]+Math.random()*(t[1]+1-t[0]));var n=t[1]||1,s=t[0]||0,o=(e=(9301*e+49297)%233280)/233280;return Math.floor(s+o*(n-s))}function r(e,n,s){var o=s[0][0],r=s[s.length-1][0],i=s[s.length-1][1],a=s[0][1];t[e]={hueRange:n,lowerBounds:s,saturationRange:[o,r],brightnessRange:[i,a]}}function i(e){var t=e[0];0===t&&(t=1),360===t&&(t=359),t/=360;var n=e[1]/100,s=e[2]/100,o=Math.floor(6*t),r=6*t-o,i=s*(1-n),a=s*(1-r*n),c=s*(1-(1-r)*n),l=256,u=256,d=256;switch(o){case 0:l=s,u=c,d=i;break;case 1:l=a,u=s,d=i;break;case 2:l=i,u=s,d=c;break;case 3:l=i,u=a,d=s;break;case 4:l=c,u=i,d=s;break;case 5:l=s,u=i,d=a}var m=[Math.floor(255*l),Math.floor(255*u),Math.floor(255*d)];return m}function a(e){var t=e[0],n=e[1]/100,s=e[2]/100,o=(2-n)*s;return[t,Math.round(n*s/(o<1?o:2-o)*1e4)/100,o/2*100]}return n}(),e&&e.exports&&(t=e.exports=n),t.randomColor=n});ui.randomColor;function di(e,t){const n=function(e){const t=li(e);if(t)return(299*t[0]+587*t[1]+114*t[2])/1e3}(t);null!=n&&(n<150?(e.classList.remove("text-gray-dark"),e.classList.add("text-white")):(e.classList.remove("text-white"),e.classList.add("text-gray-dark")))}function mi(e,t){let n=t;"#"!==n.charAt(0)&&(n=`#${n}`),e.style.backgroundColor=n;const s=e.querySelector(".js-new-label-color-icon");s&&di(s,t)}function fi(e,t){e.blur();const n=r(e,"form");s(n,".js-new-label-color-input",HTMLInputElement).value=t,mi(s(n,".js-new-label-color",HTMLButtonElement),t)}function gi(e){const t=Array.from(e.querySelectorAll(".js-navigation-item")).filter(e=>""===e.style.display);if(t.length>2)return;if(!t.every(e=>e.classList.contains("js-label-options")))return;const n=t.filter(e=>e.classList.contains("js-add-label-button"))[0];if(n){for(const t of e.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false");n.setAttribute("aria-selected","true")}}function pi(e,t,n){const s=t.querySelector(e);s&&(n?function(e,t){r(e,".js-label-error-container").classList.add("errored"),e.textContent=t,e.classList.remove("d-none")}(s,n[0]):function(e){r(e,".js-label-error-container").classList.remove("errored"),e.classList.add("d-none")}(s))}function hi(e,t){pi(".js-label-name-error",e,t.name),pi(".js-label-description-error",e,t.description),pi(".js-label-color-error",e,t.color)}function ji(e){pi(".js-label-name-error",e,null),pi(".js-label-description-error",e,null),pi(".js-label-color-error",e,null)}async function vi(e){const t=e.closest(".js-label-preview-container");if(!t)return;const n=r(e,".js-label-form",HTMLFormElement),o=n.querySelector(".js-new-label-error"),i=n.getAttribute("data-label-id"),a=s(t,".js-label-preview",HTMLElement),c=function(e,t){let n=s(e,".js-new-label-name-input",HTMLInputElement).value.trim();return n.length<1&&(n=d(t,"data-default-name")),n}(n,a),l=function(e){const t=s(e,".js-new-label-color-input",HTMLInputElement);return t.checkValidity()?t.value.trim().replace(/^#/,""):"ededed"}(n),u=function(e){let t=null;const n=e.querySelector(".js-new-label-description-input");return n instanceof HTMLInputElement&&n.value.trim().length>0&&(t=n.value.trim()),t}(n),m=function(e,t,n,s,o){const r=new URL(`${e}${encodeURIComponent(t)}`,window.location.origin),i=new URLSearchParams(r.search.slice(1));return i.append("color",n),s&&i.append("description",s),o&&i.append("id",o),r.search=i.toString(),r.toString()}(d(a,"data-url-template"),c,l,u,i);if(t.hasAttribute("data-last-preview-url")){if(m===d(t,"data-last-preview-url"))return}let f;try{f=await _(document,m)}catch(g){const e=await g.response.json();return hi(n,e),void(o&&(o.textContent=e.message,o.hidden=!1))}o&&(o.textContent="",o.hidden=!0),ji(n),a.innerHTML="",a.appendChild(f),t.setAttribute("data-last-preview-url",m)}function bi(e,t){r(e,".js-details-container").classList.toggle("is-empty",t)}function Li(e){const t=s(document,".js-labels-count"),n=Se(t.textContent)+e;t.textContent=Ae(n);const o=s(document,".js-labels-label");return Me(n,o),n}c(".js-label-filter-field",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:254");const n=r(t,".js-select-menu").querySelector(".js-new-label-name");if(!n)return;const s=t.value.trim();n.textContent=s}),o("filterable:change",".js-filterable-issue-labels",function(e){i(e instanceof CustomEvent,"null.js:267");const t=r(e.target,".js-issue-labels-menu-content"),n=t.querySelector(".js-new-label-modal, .js-add-label-button");if(!n)return;const s=e.detail.inputField.value.trim().toLowerCase(),o=Array.from(t.querySelectorAll(".js-navigation-item")).filter(e=>""===e.style.display);let a=s.length>0;if(a)for(const r of o){const e=r.querySelector('input[type="checkbox"][name="issue[labels][]"]');if(e){if(e.getAttribute("data-label-name").toLowerCase()===s){a=!1;break}}}n.classList.toggle("d-none",!a),gi(t)}),o("navigation:focus",".js-label-options",function(e){const t=e.target.closest(".js-filterable-issue-labels");t instanceof HTMLElement&&gi(t)}),l(".js-new-label-color-input",function(e){const t=r(e,"form"),n=s(t,".js-new-label-swatches");n.hidden=!1,e.addEventListener("blur",function(){n.hidden=!0},{once:!0})}),c(".js-new-label-color-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:327");let n=t.value.trim();if(!(n.length<1))if(0!==n.indexOf("#")&&(n=`#${n}`,t.value=n),t.checkValidity()){t.classList.remove("text-red");const e=r(t,"form");mi(s(e,".js-new-label-color",HTMLButtonElement),n)}else t.classList.add("text-red")}),C("keyup",".js-new-label-color-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:351");let n=t.value.trim();if(0!==n.indexOf("#")&&(n=`#${n}`,t.value=n),t.checkValidity()){const e=r(t,"form");mi(s(e,".js-new-label-color",HTMLButtonElement),n)}b(t,"change",!1),ji(r(t,"form",HTMLFormElement))}),C("keyup",".js-new-label-description-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:372");const n=t.form;i(n,"null.js:374"),ji(n)}),C("keyup",".js-new-label-color-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:380");const n=t.form;i(n,"null.js:382"),ji(n)}),C("keydown",".js-label-filter-field",function(e){if("Enter"!==e.key)return;const t=s(document,".js-issue-labels-menu-content").querySelector('.js-label-options[aria-selected="true"]');t&&t.click()}),o("click",".js-new-label-color",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:403"),fi(t,ui()),vi(t)}),o("mousedown",".js-new-label-color-swatch",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:411"),fi(t,d(t,"data-color")),vi(t),r(t,".js-new-label-swatches").hidden=!0}),o("toggle",".js-new-label-modal",function(e){e.target.hasAttribute("open")&&function(e){const t=e.querySelector(".js-new-label-name-input");if(!t)return;i(t instanceof HTMLInputElement,"null.js:437");const n=s(e,".js-new-label-color-input",HTMLInputElement);let o=ui();if(n.value.length>0)for(;n.value===o;)o=ui();n.value=o;const r=s(e,".js-new-label-color",HTMLButtonElement);mi(r,o);const a=s(document,".js-new-label-name").textContent;q(t,a),Ho(t),vi(r)}(e.target)},{capture:!0}),h(".js-new-label-modal-form",async function(e,t){const n=s(e,".js-new-label-error");let o;try{o=await t.html()}catch(i){const e=i.response.json;n.textContent=e.message,n.hidden=!1}if(!o)return;n.hidden=!0,Te(s(document,".js-issue-labels-menu-content")),s(document,".js-new-label-modal").removeAttribute("open"),s(document,".js-filterable-issue-labels").prepend(o.html);const r=s(document,".js-label-filter-field",HTMLInputElement);r.value=r.defaultValue,r.focus()}),o("click",".js-edit-label-cancel",function(e){const t=r(e.target,"form",HTMLFormElement);ji(t),t.reset();const n=s(t,".js-new-label-color-input",HTMLInputElement),o=n.value;s(t,".js-new-label-color",HTMLButtonElement).style.backgroundColor=o,xo(t),vi(n);const i=e.currentTarget.closest(".js-labels-list-item");if(i){s(i,".js-update-label",HTMLElement).classList.add("d-none");const e=i.querySelector(".js-label-preview");if(e){e.classList.add("d-none"),s(i,".js-label-link",HTMLElement).classList.remove("d-none")}const t=i.querySelectorAll(".js-hide-on-label-edit.d-none");for(const n of t)n.classList.remove("d-none")}}),h(".js-update-label",async function(e,t){let n;try{n=await t.html()}catch(s){return void hi(e,s.response.json)}ji(e),r(e,".js-labels-list-item").replaceWith(n.html)}),h(".js-create-label",async function(e,t){let n;try{n=await t.html()}catch(r){return void hi(e,r.response.json)}e.reset(),ji(e),s(document,".js-label-list").prepend(n.html),Li(1),bi(e,!1),fi(s(e,".js-new-label-color",HTMLButtonElement),ui()),vi(s(e,".js-new-label-name-input",HTMLInputElement)),xo(e);const o=e.closest(".js-details-container");o instanceof HTMLElement&&ke(o)}),o("click",".js-details-target-new-label",function(){const e=s(document,".js-create-label");s(e,".js-new-label-name-input",HTMLInputElement).focus()}),o("click",".js-edit-label",function(e){const t=r(e.currentTarget,".js-labels-list-item"),n=s(t,".js-update-label",HTMLElement);n.classList.remove("d-none"),s(n,".js-new-label-name-input",HTMLInputElement).focus();const o=t.querySelector(".js-label-preview");if(o){o.classList.remove("d-none"),s(t,".js-label-link",HTMLElement).classList.add("d-none")}const i=u(t,".js-hide-on-label-edit",HTMLElement);for(const s of i)s.classList.add("d-none")}),h(".js-delete-label",async function(e,t){const n=r(e,".js-labels-list-item");s(n,".js-label-delete-spinner").hidden=!1,await t.text(),bi(e,0===Li(-1)),n.remove()});const yi=j(function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:230"),vi(t)},500);function Ei(e){e instanceof HTMLFormElement?v(e):Ti(e)}function wi(e){let t=e.currentTarget;i(t instanceof Element,"null.js:21");const n=t.closest(".js-issue-sidebar-form")||t.querySelector(".js-issue-sidebar-form");i(n,"null.js:23"),Ei(n)}async function Ti(e,t){const n=function(e){const t=r(e,"form",HTMLFormElement),n=xe(t),s=new FormData;for(const r of n){var o=ee(r,2);const n=o[0],i=o[1];e.contains(ki(t,n,i))&&s.append(n,i)}return s}(e);t&&n.append(t.name,t.value);let s=e.getAttribute("data-authenticity-token");if(null==s){const t=r(e,"form",HTMLFormElement).elements.namedItem("authenticity_token");t instanceof HTMLInputElement&&(s=t.value)}i(s,"null.js:108"),n.append("authenticity_token",s);const o=d(e,"data-url"),a=await g(o,{method:"post",body:n});!function(e,t){e.replaceWith(f(document,t))}(r(e,".js-discussion-sidebar-item"),a)}function ki(e,t,n){for(const s of e.elements)if((s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLButtonElement)&&s.name===t&&s.value===n)return s}function Si(e){s(document,".js-jump-to-suggestions-container").classList.remove("d-none"),e.classList.add("jump-to-dropdown-visible"),s(document,".js-jump-to").setAttribute("aria-expanded","true")}function Ai(){s(document,".js-jump-to-suggestions-container").classList.add("d-none"),s(document,".js-jump-to-field").classList.remove("jump-to-dropdown-visible"),s(document,".js-jump-to").setAttribute("aria-expanded","false"),Ce("menu-deactivation")}function Mi(e){const t=e.form;i(t,"null.js:40");const n=s(document,".js-jump-to-suggestions-results-container"),o=e.value.trim(),r=!(!e.form||!e.form.getAttribute("data-scope-type")),a=s(n,".js-jump-to-scoped-search"),c=s(n,".js-jump-to-global-search");if(a.classList.toggle("d-none",!o||!r),c.classList.toggle("d-none",!o),o&&r){const e=d(t,"action"),s=Ii(a,o,_e(e,o,r),!0);n.replaceChild(s,a)}if(o){const e=d(t,"data-unscoped-search-url"),s=Ii(c,o,_e(e,o,!1),!1);n.replaceChild(s,c)}}function Hi(e,t,n){const o=e.form;i(o,"null.js:82");const r=Ci(".js-jump-to-suggestions-template-container"),a=document.createDocumentFragment();n.length<1&&!t?function(){if(!$e(document,"user-login"))return;const e=Ci(".js-jump-to-no-results-template-container").cloneNode(!0);e.classList.remove("d-none"),xi(e)}():(n.forEach((e,n)=>{a.appendChild(function(e,t,n,o){const r=e.cloneNode(!0);r.id=`jump-to-suggestion-${t.type.toLowerCase()}-${t.databaseId}`;const i=s(r,".js-jump-to-suggestion-path",HTMLAnchorElement);i.href=t.path,i.setAttribute("data-target-type",t.type),i.setAttribute("data-target-id",`${t.databaseId}`),i.setAttribute("data-client-rank",`${o}`),i.setAttribute("data-server-rank",`${t.rank}`);const a=s(r,".js-jump-to-suggestion-name");switch(a.textContent=t.name,a.setAttribute("aria-label",t.name),Re(a,n.replace(/\s/g,"")),t.type){case"Team":{const e=s(r,".js-jump-to-suggestion-avatar",HTMLImageElement);e.alt=t.name,e.src=t.avatarUrl?t.avatarUrl:"",e.classList.remove("d-none");break}case"Project":qi(r,".js-jump-to-octicon-project");break;case"Repository":qi(r,".js-jump-to-octicon-repo")}return s(r,".js-jump-to-badge-jump").classList.remove("d-none"),r}(r,e,t,n))}),xi(a))}function xi(e){const t=s(document,".js-jump-to-suggestions-results-container");for(const n of u(t,".js-jump-to-suggestion"))i(n.parentNode,"null.js:125"),n.parentNode.removeChild(n);t.appendChild(e)}function qi(e,t){const n=s(e,".js-jump-to-octicon"),o=s(n,t,SVGElement);n.classList.remove("d-none"),o.classList.remove("d-none")}function Ii(e,t,n,o){const r=e.cloneNode(!0);r.id=`jump-to-suggestion-search-${o?"scoped":"global"}`;const i=s(r,".js-jump-to-suggestion-path",HTMLAnchorElement);i.href=n,i.setAttribute("data-target-type","Search");const a=s(r,".js-jump-to-suggestion-name");a.textContent=t,a.setAttribute("aria-label",t),qi(r,".js-jump-to-octicon-search");const c=s(r,".js-jump-to-badge-search");return c.classList.remove("d-none"),o?s(c,".js-jump-to-badge-search-text-default").classList.remove("d-none"):s(c,".js-jump-to-badge-search-text-global").classList.remove("d-none"),r}function Ci(e){const t=s(document,".js-jump-to-suggestions-container"),n=s(t,e).firstElementChild;return i(n instanceof HTMLElement,"null.js:218"),n}function _i(e){return!!(e?e.closest(".js-jump-to-field"):document.querySelector(".js-jump-to-field"))}function $i(e,t){const n=e.value.trim(),s=Ne(Pe(n,t,window.location.pathname)),o=s.slice(0,7);De({measures:{result_count:s.length,display_count:o.length,filter_count:t.length-s.length},context:{query:n,display_set:o.map(e=>[e.type,e.databaseId])}}),Hi(e,n,o),Ce("menu-activation")||Ce("query")}let Ri,Ni;async function Pi(e){const t=function(e){const t=d(e,"data-jump-to-suggestions-path");return window.location.origin+t}(e),n=Ke();try{const e=await U(Ge(t,{method:"POST",body:n}));return Je(e)}catch(s){if(s.response&&422===s.response.status)return[];throw s}}async function Di(e){const t=e;i(t instanceof HTMLInputElement,"null.js:78"),function(e){e.classList.add("js-navigation-enable"),e.classList.add("jump-to-field-active")}(t),Si(t),Ri||(Ri=Pi(t)),Mi(t),Fi(t),$i(t,await Ri)}function Fi(e){const t=e.value.trim(),n=s(document,".js-jump-to-suggestions-results-container");t?ze(n):Ve(n)}o("suggester:complete",".js-new-label-name-input",yi),c(".js-new-label-name-input",yi),c(".js-new-label-description-input",yi),c(".js-new-label-color-input",yi),C("keypress",".js-new-label-name-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:639");const n=parseInt(t.getAttribute("data-maxlength"));Y(t.value)>=n&&e.preventDefault()}),o("click",".js-issues-label-select-menu-item",function(e){i(e instanceof MouseEvent,"null.js:649"),e.altKey&&(e.preventDefault(),e.stopPropagation(),window.location=d(e.currentTarget,"data-excluded-url"))}),C("keydown",".js-issues-label-select-menu-item",function(e){if(i(e instanceof KeyboardEvent,"null.js:659"),"Enter"!==e.key)return;if(!e.altKey)return;const t=e.currentTarget;e.preventDefault(),e.stopPropagation(),t instanceof HTMLAnchorElement&&(window.location=d(t,"data-excluded-url"))}),oe(function(e){let t=e.newURL;const n=t.match(/\/issues#issue\/(\d+)$/);if(n){const e=n[1];window.location=t.replace(/\/?#issue\/.+/,`/${e}`)}}),oe(function(e){let t=e.newURL;const n=t.match(/\/issues#issue\/(\d+)\/comment\/(\d+)$/);if(n){const e=n[1],s=n[2];window.location=t.replace(/\/?#issue\/.+/,`/${e}#issuecomment-${s}`)}}),n(".js-issue-row .js-issues-list-check:checked",{add(e){r(e,".js-issue-row").classList.add("selected")},remove(e){r(e,".js-issue-row").classList.remove("selected")}}),o("navigation:keydown",".js-issue-row",function(e){i(e instanceof CustomEvent,"null.js:28"),"x"===e.detail.hotkey&&(!function(e){const t=e.querySelector(".js-issues-list-check");t instanceof HTMLInputElement&&q(t,!t.checked)}(e.currentTarget),e.preventDefault(),e.stopPropagation())}),l("#js-issues-search",function(e){i(e instanceof HTMLInputElement,"null.js:40"),e.value=e.value}),o("details-menu-select",".js-saved-reply-container button",function(e){const t=s(e.target,".js-saved-reply-body"),n=t.textContent.trim(),o=r(e.currentTarget,".js-previewable-comment-form"),i=s(o,"textarea.js-comment-field",HTMLTextAreaElement);He(i,n),setTimeout(()=>i.focus(),0),s(o,"input.js-saved-reply-id",HTMLInputElement).value=t.getAttribute("data-saved-reply-id")||""}),C("keydown",".js-saved-reply-shortcut-comment-field",function(e){if("Control+."===B(e)){i(e.target instanceof HTMLElement,"null.js:26");const t=r(e.target,".js-previewable-comment-form");s(t,".js-saved-reply-container").setAttribute("open",""),e.preventDefault(),Le({category:"Markdown Toolbar",action:"shortcut",label:"saved reply"})}}),C("keydown",".js-saved-reply-filter-input",function(e){if(/^Control\+[1-9]$/.test(B(e))){i(e.target instanceof HTMLElement,"null.js:41");const t=r(e.target,".js-saved-reply-container").querySelectorAll('[role="menuitem"]'),n=Number(e.key),s=t[n-1];s&&(s.click(),e.preventDefault(),Le({category:"Saved Replies",action:"shortcut",label:`saved reply number ${n}`}))}}),o("selectmenu:selected",".js-discussion-sidebar-item",function(e){const t=s(e.currentTarget,".js-issue-sidebar-form"),n=e.target,o=r(n,".js-select-menu"),i=o.hasAttribute("data-multiple");if(n.hasAttribute("data-clear-assignees")){const e=u(o,'input[name="issue[user_assignee_ids][]"]:checked',HTMLInputElement);for(const t of e)t.disabled=!1,t.checked=!1;Ei(t)}else if(i){const e=Number(o.getAttribute("data-max-options"));if(e){const t=o.querySelectorAll('input[type="checkbox"]:checked').length;s(o,".js-max-warning").classList.toggle("d-none",t<=e)}o.addEventListener("menu:deactivate",wi,{once:!0})}else Ei(t)}),h(".js-issue-sidebar-form",async function(e,t){const n=await t.html();i(e.parentNode instanceof HTMLElement,"null.js:61"),r(e,".js-discussion-sidebar-item").replaceWith(n.html)}),o("click","div.js-issue-sidebar-form .js-suggested-reviewer",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:68"),Ti(r(t,".js-issue-sidebar-form"),{name:t.name,value:t.value}),e.preventDefault()}),o("click","div.js-issue-sidebar-form .js-issue-assign-self",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:78"),Ti(r(t,".js-issue-sidebar-form"),{name:t.name,value:t.value}),e.preventDefault()}),h(".js-pages-preview-toggle-form",async function(e,t){const n=await t.json();s(e,"button.btn").textContent=n.json.new_button_value}),o("change",".js-project-menu-checkbox",function(e){const t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:122");const n=r(t,".js-project-menu-container");for(const s of u(n,".js-project-menu-checkbox",HTMLInputElement))s!==t&&s.name===t.name&&(s.checked=t.checked,r(s,".select-menu-item").classList.toggle("selected",s.checked))}),o("click",".js-prompt-dismiss",function(e){r(e.currentTarget,".js-prompt").remove()}),o("change",".js-issues-list-check",function(){const e=!!document.querySelector(".js-issues-list-check:checked");s(document,"#js-issues-toolbar").classList.toggle("triage-mode",e)}),o("change",".js-issues-list-check",function(){const e=u(document,".js-issues-list-check:checked",HTMLInputElement).map(e=>[e.name,e.value]),t=document.querySelectorAll("#js-issues-toolbar .js-issues-toolbar-triage .js-select-menu");for(const n of t)qe(n,e),n.classList.add("js-load-contents")}),o("selectmenu:selected",".js-issues-toolbar-triage .js-navigation-item",async function(e){const t=e.currentTarget,n=r(t,".js-menu-container"),o=n.hasAttribute("data-submits-hash"),i=r(t,"form"),a=t.classList.contains("selected"),c=d(t,"data-name"),l=d(t,"data-value"),u=document.createElement("input");u.setAttribute("type","hidden"),o?(u.setAttribute("name",`${c}[${l}]`),u.setAttribute("value",a?"1":"0")):(u.setAttribute("name",c),u.setAttribute("value",a?l:"")),s(i,".js-issues-triage-fields").appendChild(u),i.classList.add("will-submit"),await S(),Ie(n)}),o("menu:deactivate",".js-issues-toolbar-triage .js-menu-container",async function(e){const t=e.currentTarget,n=t.querySelector("form.will-submit");if(!(n instanceof HTMLFormElement))return;t.classList.add("is-loading");const s=n.action,o=n.method;try{const e=await U(s,{method:o,body:new FormData(n)});await G(e.job.url,{headers:{accept:"application/json"}}),i(t instanceof HTMLElement,"null.js:81"),Ie(t),location.reload()}catch(r){t.classList.add("has-error")}n.classList.remove("will-submit"),e.preventDefault()}),h(".js-undo-issue-event-form",async(e,t)=>{await t.text();const n=d(e,"action");e.remove();const s=document.querySelectorAll(`.js-undo-issue-event-form[action="${n}"]`);for(let o=0;o<s.length;o++)s[o].remove()}),n(".js-jump-to-field",{constructor:HTMLInputElement,add(e){try{Fe(window.location.pathname)}catch(Jd){Oe(new Be(Jd))}y(e,async function(){Mi(e),Fi(e),$i(e,await Ri)}),document.activeElement&&document.activeElement===e&&Di(e)}}),l(".js-jump-to-field",Di),o("navigation:keydown",".js-site-search-form",function(e){i(e instanceof CustomEvent,"null.js:94");const t=e.currentTarget.querySelector('.js-navigation-item[aria-selected="true"]');switch(e.detail.hotkey){case"Enter":if(t)Ue(s(t,".js-jump-to-suggestion-path",HTMLElement));else{const t=e.currentTarget;i(t instanceof HTMLFormElement,"null.js:102"),v(t)}break;case"Escape":s(e.currentTarget,".js-jump-to-field",HTMLInputElement).blur(),Ai()}}),o("navigation:focus",".js-site-search-form",function(e){const t=s(document,".js-jump-to-field",HTMLInputElement),n=e.target.id;t.setAttribute("aria-activedescendant",n)}),o("focusout",".js-jump-to",function(){const e=s(document,".js-jump-to-field",HTMLInputElement);Ni=setTimeout(()=>{!function(e){e.classList.remove("js-navigation-enable"),e.classList.remove("jump-to-field-active")}(e),Ai()},200)}),o("focusin",".js-jump-to",function(){clearTimeout(Ni),Si(s(document,".js-jump-to-field",HTMLInputElement))}),o("click",".js-jump-to-suggestion-path",function(e){const t=e.currentTarget;if(i(t instanceof HTMLAnchorElement,"null.js:142"),"Search"===t.getAttribute("data-target-type")){const e=s(document,".js-jump-to-field",HTMLInputElement);t.href=We(e.value.trim(),t.href)}Ue(t)}),o("submit",".js-site-search-form",function(e){if(!_i())return;const t=e.target;t.getAttribute("data-scoped-search-url")&&De({scope_type:t.getAttribute("data-scope-type"),scope_id:t.getAttribute("data-scope-id")}),Ce("search")});let Oi=0,Bi=null;const Ui=["ArrowUp","ArrowUp","ArrowDown","ArrowDown","ArrowLeft","ArrowRight","ArrowLeft","ArrowRight","b","a","Enter"];function Wi(e){!function(e){let t=document.getElementById("konami-overlay");t||((t=document.createElement("div")).id="konami-overlay",t.classList.add("konami-overlay"),document&&document.body&&document.body.appendChild(t));if(!t)return;t.style.background=`rgba(0,0,0,${e+.24})`;const n=50*(1+e),s=(e,t)=>e+Math.round(Math.random()*(t-e));for(let o=0;o<n;o++){const e=s(0,window.innerHeight),n=s(0,window.innerWidth),o=document.createElement("div");o.classList.add("dot"),o.textContent=`${s(0,1)}`,o.style.fontSize=`${s(1,8)}px`,o.style.color=`rgba(255,255,255,${Math.random()})`,o.style.top=`${e}px`,o.style.left=`${n}px`;const r=s(0,300);setTimeout(()=>t&&t.prepend(o),r),setTimeout(()=>o.parentNode&&o.parentNode.removeChild(o),r+s(100,500))}}((Oi=e)/Ui.length);const t=u(document,".js-konami-key");for(const r of t)r.classList.remove("active"),r.classList.remove("inactive"),r.classList.remove("complete"),r.classList.remove("down");const n=t.slice(0,Oi),s=t.slice(Oi,Oi+1),o=t.slice(Oi+2);for(const r of n)r.classList.add("complete");for(const r of s)r.classList.add("active");for(const r of o)r.classList.add("inactive")}function zi(e){if(!(e.target instanceof Node&&Qe(e.target)||Oi>=Ui.length||(Ui.includes(B(e))&&(e.preventDefault(),e.stopPropagation()),B(e)!==Ui[Oi]))){const e=document.querySelectorAll(".js-konami-key")[Oi];e&&e.classList.add("down")}}function Vi(e){if(!(e.target instanceof Node&&Qe(e.target)||Oi>=Ui.length)){if(B(e)===Ui[Oi])Wi(Oi+1),Oi===Ui.length-1&&function(){const e=document.querySelector(".js-konami-success");e&&e.removeAttribute("hidden")}(),Oi===Ui.length&&function(){const e=document.querySelector(".js-konami-form");i(e instanceof HTMLFormElement,"null.js:145"),v(e)}();else{if(!Ui.includes(B(e)))return;Wi(0)}e.preventDefault(),e.stopPropagation()}}function Ki(){Bi=null,document.removeEventListener("keydown",zi),document.removeEventListener("keyup",Vi);const e=document.getElementById("konami-overlay");e&&e.parentNode&&e.parentNode.removeChild(e)}function Gi(e){const t=e.currentTarget,n=s(t,".js-milestone-edit-cancel"),o=n.getAttribute("data-confirm-changes");o&&(Xe(t)?n.setAttribute("data-confirm",o):n.removeAttribute("data-confirm"))}function Ji(e,t){o("click",`${e} .js-sortable-button`,function(n){let s=n.currentTarget;i(s instanceof HTMLElement,"null.js:11");const o=r(s,e),a=s.getAttribute("data-direction"),c=o.parentElement;i(c,"null.js:15");const l=Array.from(c.children).indexOf(o);"up"===a&&o.previousElementSibling?o.previousElementSibling.insertAdjacentElement("beforebegin",o):"down"===a&&o.nextElementSibling&&o.nextElementSibling.insertAdjacentElement("afterend",o);const u=Array.from(c.children).indexOf(o);s.focus(),t({oldIndex:l,newIndex:u,item:o})})}o("click",".js-konami",async function(e){if(e.preventDefault(),Bi)return;Wi(5),document.addEventListener("keydown",zi),document.addEventListener("keyup",Vi);const t=`/site/konami?return_to=${e.target.getAttribute("data-return-to")||""}`;Bi=await X({content:_(document,t),dialogClass:"kb-konami-dialog container-xl"}),Wi(Oi),Bi.addEventListener("dialog:remove",Ki,{once:!0})}),o("click",".js-details-target-new-label",function(e){let t=e.target;i(t instanceof HTMLElement,"null.js:10");const n=nn(t,"Popover");if(n){const e=s(n,"form",HTMLFormElement);v(e)}}),n("link[rel=prefetch-viewed]",{initialize(){requestIdleCallback(()=>{fetch(location.href,{method:"HEAD",credentials:"same-origin",headers:{Purpose:"prefetch-viewed"}})})}}),o("click",".js-manage-requests-tabs-item",function(e){let t=e.currentTarget;const n=r(t,".js-manage-memberships-container");s(n,".js-manage-invitations-tabs-item").classList.remove("selected"),t.classList.add("selected");const o=s(n,".js-manage-invitations-list"),i=s(n,".js-manage-requests-list");o.classList.add("d-none"),i.classList.remove("d-none")}),o("click",".js-manage-invitations-tabs-item",function(e){let t=e.currentTarget;const n=r(t,".js-manage-memberships-container");s(n,".js-manage-requests-tabs-item").classList.remove("selected"),t.classList.add("selected");const o=s(n,".js-manage-requests-list"),i=s(n,".js-manage-invitations-list");o.classList.add("d-none"),i.classList.remove("d-none")}),o("change",".js-milestone-edit-form",Gi),o("click",".js-milestone-edit-form",Gi);const Qi=new WeakMap;o("socket:message",".js-milestone-issues",async function(e){i(e instanceof CustomEvent,"null.js:34");const t=e.currentTarget,n=e.detail.data,o=s(t,".js-milestone-issues-container");if("1"===o.getAttribute("data-is-sorting"))return void o.removeAttribute("data-is-sorting");await Ye();const r=document.querySelector(".js-client-uid");r instanceof HTMLInputElement&&r.value===n.client_uid||async function(e){if(Ze(e))return;const t=d(e,"data-url"),n=await _(document,t);et(document,()=>{e.replaceWith(n)})}(t)}),h(".js-milestone-sort-form",async function(e,t){const n=(await t.json()).json,o=s(e,".js-milestone-reorder-feedback");o.textContent="",n.error?s(e,".js-milestone-changed").classList.remove("d-none"):(s(e,".js-timestamp",HTMLInputElement).value=n.updated_at,o.textContent=o.getAttribute("data-success-text")||"")});const Xi=j(function(e){const t=e.newIndex,n=e.item,o=r(n,".js-milestone-issues-container"),i=n.getAttribute("data-id")||"",a=function(e,t){return e.querySelectorAll(".js-draggable-issue")[t]}(o,t-1),c=a&&a.getAttribute("data-id"),l=r(o,".js-milestone-sort-form",HTMLFormElement);s(l,".js-item-id",HTMLInputElement).value=i,s(l,".js-prev-id",HTMLInputElement).value=c||"",Le({category:"Milestone",action:"reorder",label:"string"==typeof e.trackingLabel?e.trackingLabel:"drag-and-drop"}),o.setAttribute("data-is-sorting","1"),v(l)},200);function Yi(e,t){Xi({item:t,newIndex:Array.from(e.querySelectorAll(".js-draggable-issue")).indexOf(t),trackingLabel:"keyboard-shortcut"}),tt(r(t,".js-navigation-container"),t)}function Zi(e,t){for(const n of document.querySelectorAll(".js-setting-toggle .js-status-indicator"))n.classList.remove("status-indicator-success","status-indicator-loading","status-indicator-failed");e.classList.add(t)}function ea(){const e=document.querySelector(".js-org-reinstate-forms"),t=document.querySelectorAll(".js-org-reinstate-option:checked");if(!e||1!==t.length)return;const n=d(t[0],"data-form"),s=e.getElementsByClassName("js-togglable-form");for(const r of s)r.classList.add("d-none");const o=document.getElementById(n);i(o,"null.js:42"),o.classList.remove("d-none")}async function ta(e,t,n,o){const r=d(e,"data-url"),i=new URL(r,window.location.origin),a=new URLSearchParams(i.search.slice(1));a.append("member",t),a.append("action_type",n),o&&a.append("return_to",o),i.search=a.toString(),na(!0),s(document,".js-add-team-member-form").hidden=!0;const c=await _(document,i);na(!1),e.innerHTML="",e.appendChild(c)}function na(e){s(document,".js-add-members-loading-state").hidden=!e,s(document,".js-add-members-modal-content").hidden=e}function sa(){s(document,".js-save-member-privileges-button-container").classList.toggle("member-privilege-radios-preserved",oa()&&ra()&&ia())}function oa(){return""===s(document,".js-customize-member-privileges-default-repository-permission-radio:checked",HTMLInputElement).value}function ra(){return"0"===s(document,".js-customize-member-privileges-repository-creation-radio:checked",HTMLInputElement).value}function ia(){return"secret"===s(document,".js-customize-member-privileges-team-privacy-radio:checked",HTMLInputElement).value}function aa(){return s(document,".js-saml-provider-settings-form",HTMLFormElement)}function ca(){return aa().querySelector(".js-saml-form-inputs")}function la(){return s(document,".js-org-saml-confirm-enforcement-hidden",HTMLInputElement)}function ua(e){e&&e.classList.remove("d-none")}function da(){return"1"===s(document,".js-org-saml-currently-enabled",HTMLInputElement).value&&!s(document,".js-org-enable-saml",HTMLInputElement).checked}function ma(){return s(document,".is-submit-button-value",HTMLInputElement)}function fa(){return s(document,".js-org-saml-enforce",HTMLInputElement).checked&&"0"===la().value&&!("1"===s(document,".js-org-saml-previously-enforced",HTMLInputElement).value)&&"1"===s(document,".js-org-has-unlinked-saml-members",HTMLInputElement).value}function ga(){aa().submit()}function pa(){const e=document.querySelector(".js-org-enable-saml");e&&e instanceof HTMLInputElement&&(e.checked=!0,ua(ca()))}function ha(e,t){s(e,".js-add-child-team-loading-state").hidden=!t,s(e,".js-add-child-team-modal-content").hidden=t}function ja(e){const t=s(e,".js-inline-comment-form-container");t.classList.add("open"),s(t,".js-write-tab").click(),s(t,".js-comment-field").focus()}function va(e){e.reset();const t=r(e,".js-inline-comment-form-container");t.classList.remove("open"),b(t,"inlinecomment:collapse")}function ba(e){const t=e.closest(".js-teams-write-a-post");return t?function(e){const t=s(e,".js-team-discussions-post-compose");t.classList.contains("d-none")||(t.classList.add("d-none"),s(e,".js-post-placeholder").classList.remove("d-none"),e.classList.remove("active")),s(e,".js-comment-form-error").classList.add("d-none")}(t):e.closest(".js-teams-reply-to-post")?function(e){i(e instanceof HTMLFormElement,"null.js:35"),va(e)}(e):void 0}function La(e){const t=e.closest(".js-teams-reply-to-post"),n=t&&t.querySelector(".js-comment-form-error");n&&n.classList.add("d-none")}function ya(e,t){e.textContent=(parseInt(e.textContent)+t).toString()}function Ea(e,t){e.classList.add("d-none"),i(e.parentElement,"null.js:231"),s(e.parentElement,t).classList.remove("d-none")}Ji(".js-draggable-issue",Xi),o("navigation:keydown",".js-draggable-issues-container .js-draggable-issue",function(e){i(e instanceof CustomEvent,"null.js:111");const t=e.currentTarget,n=r(t,".js-draggable-issues-container");if("J"===e.detail.hotkey){const s=t.nextElementSibling;s&&(s.after(t),Yi(n,t),e.preventDefault(),e.stopPropagation())}else if("K"===e.detail.hotkey){const s=t.previousElementSibling;s&&(s.before(t),Yi(n,t),e.preventDefault(),e.stopPropagation())}}),n(".js-draggable-issues-container",{add:function(e){if(Qi.has(e))return;const t=nt.create(e,{animation:150,item:".js-draggable-issue",handle:".js-drag-handle",onUpdate:Xi,chosenClass:"is-dragging"});Qi.set(e,t)},remove:function(e){const t=Qi.get(e);t&&t.destroy()}}),o("submit",".js-mobile-preference-form",e=>{s(e.currentTarget,".js-mobile-preference-anchor-field",HTMLInputElement).value=window.location.hash.substr(1)}),h(".js-setting-toggle",async function(e,t){const n=s(e,".js-status-indicator");Zi(n,"status-indicator-loading");try{await t.text()}catch(o){Zi(n,"status-indicator-failed")}Zi(n,"status-indicator-success")}),o("change",".js-toggle-email-settings input",function(){const e=s(document,".js-notification-emails"),t=document.querySelector(".js-toggle-email-settings input:checked");e.classList.toggle("d-none",!t)}),h(".js-unignore-form, .js-ignore-form, .js-unsubscribe-form, .js-subscribe-form",async function(e,t){const n=r(e,".js-subscription-row");n.classList.add("loading");try{await t.text()}catch(o){n.classList.remove("loading");const t=s(e,".btn-sm");t.classList.add("btn-danger"),t.setAttribute("title",n.getAttribute("data-error-message")||"")}n.classList.remove("loading"),e.classList.contains("js-unignore-form")||e.classList.contains("js-unsubscribe-form")?n.classList.add("unsubscribed"):(e.classList.contains("js-ignore-form")||e.classList.contains("js-subscribe-form"))&&n.classList.remove("unsubscribed")}),h(".js-thread-subscribe-form",async function(e,t){const n=await t.text(),s=r(e,".js-thread-subscription-status");n&&I(s,n.text)}),n("#js-oauth-authorize-btn",e=>{!async function(e){await Vs(document),await new Promise(e=>setTimeout(e,1e3)),i(e instanceof HTMLButtonElement,"null.js:9"),e.disabled=!1}(e)}),async function(){await x,window._octo.push(["enablePerformance"]),window._octo.push(["recordPageView"])}(),document.addEventListener("pjax:complete",function(){window._octo.push(["recordPageView"])}),o("change",".js-two-factor-needs-enforced",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:36"),s(document,".js-confirm-2fa-modal").classList.toggle("d-none",!t.checked),s(document,".js-2fa-save-button").classList.toggle("d-none",t.checked)}),n(".js-two-factor-enforcement-poller",function(e){e.addEventListener("load",function(){window.location.reload()})}),o("click",".js-invitations-team-suggestions-view-all",async function(e){const t=e.currentTarget,n=d(t,"data-url"),o=u(document,".js-invitation-toggle-team:checked",HTMLInputElement).map(e=>e.value),i=await _(document,n),a=r(t,"ul");a.innerHTML="",a.appendChild(i);for(const r of o)s(a,`.js-invitation-toggle-team[value="${r}"]`,HTMLInputElement).checked=!0}),o("change",".js-org-reinstate-option",ea),n(".js-org-reinstate-forms",ea),o("click",".js-membership-tab",function(e){const t=d(e.currentTarget,"data-membership"),n=s(document,".js-member-filter-field",HTMLInputElement),o=n.value,r=new RegExp("membership:[a-z-]+"),i=o.toString().trim().replace(r,"");n.value=`${i} ${t}`.replace(/\s\s/," "),n.focus(),st(n),s(document,".js-membership-tabs").classList.remove("selected"),e.currentTarget.classList.add("selected")}),o("click",".js-member-search-filter",function(e){e.preventDefault();const t=d(e.currentTarget,"data-filter"),n=r(e.currentTarget,"[data-filter-on]"),o=d(n,"data-filter-on"),i=s(document,".js-member-filter-field",HTMLInputElement),a=i.value,c=new RegExp(`${o}:[a-z]+`),l=a.toString().trim().replace(c,"");i.value=`${l} ${t}`.replace(/\s\s/," "),i.focus(),st(i)}),o("submit",".js-needs-interstitial .js-approve-membership-request",function(e){const t=e.currentTarget;i(t instanceof HTMLFormElement,"null.js:57");const n=d(s(t,"[data-member-name]"),"data-member-name"),o=d(t,"data-action-type"),a=r(t,".js-add-members-container");e.preventDefault(),ta(a,n,o,null)}),o("submit",".js-needs-interstitial.js-add-team-member-form",function(e){const t=e.currentTarget;i(t instanceof HTMLFormElement,"null.js:69");const n=a(t,"member");if(!n.value)return;const o=d(t,"data-action-type"),r=s(document,".js-add-members-container");e.preventDefault();const c=t.getAttribute("data-return-to");ta(r,n.value,o,c)}),n("#add-team-member",function(e){const t=s(e,"details-dialog"),n=t.innerHTML;e.addEventListener("toggle",function(e){let s=e.currentTarget;i(s instanceof HTMLElement,"null.js:112"),s.hasAttribute("open")||(t.innerHTML=n)})}),h(".js-add-org-member-form",async function(e,t){const n=s(document,".js-member-list");e.classList.add("is-sending");const o=document.querySelector(".flash-messages");let r;o&&o.remove();try{r=await t.json()}catch(c){if(!c.response&&!c.response.json)return;return void n.insertAdjacentHTML("beforebegin",c.response.json.message_html)}e.classList.remove("is-sending"),s(e,"auto-complete",AutocompleteElement).value="";const i=s(f(document,r.json.list_item_html),"*"),a=i.getAttribute("data-login");if(a)for(const s of n.children)if(s.getAttribute("data-login")===a){s.remove();break}n.prepend(i)}),o("change",".js-customize-member-privileges-default-repository-permission-radio",function(){s(document,".js-migrate-ability-list-item-default-repository-permission").classList.toggle("migrate-ability-not-possible",oa()),sa()}),o("change",".js-customize-member-privileges-repository-creation-radio",function(){const e=document.querySelector(".js-migrate-ability-list-item-members-can-create-repositories");e instanceof HTMLElement&&(e.classList.toggle("migrate-ability-not-possible",ra()),sa())}),o("change",".js-customize-member-privileges-team-privacy-radio",function(){s(document,".js-migrate-ability-list-item-team-privacy").classList.toggle("migrate-ability-not-possible",ia()),sa()}),n(".js-save-member-privileges-button-container",sa),o("click",".js-org-signup-duration-change",e=>{i(e instanceof MouseEvent,"null.js:13");const t=e.currentTarget,n=s(document,".js-plan-choice:checked",HTMLInputElement),o=s(document,"#js-pjax-container"),r=new URLSearchParams;r.append("plan_duration",d(t,"data-plan-duration")),r.append("plan",n.value);const a=s(document,".js-new-organization-name",HTMLInputElement);a.value&&r.append("login",a.value);const c=s(document,".js-new-organization-billing-email",HTMLInputElement);c.value&&r.append("billing_email",c.value),document.querySelector(".js-transform-user")&&r.append("transform_user","1");const l=e.currentTarget;i(l instanceof HTMLAnchorElement,"null.js:29"),l.search=`?${r.toString()}`,$(e,{scrollTo:!1,container:o})}),o("autocheck:success",".js-new-organization-name",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:40");const n=r(t,"dd").querySelector(".js-field-hint-name");n&&(n.textContent=t.value)}),c(".js-company-name-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:53");const n=t.form;i(n,"null.js:56");const o=n.querySelector(".js-company-name-text");if(!o)return;const r=s(n,".js-corp-tos-link"),a=n.querySelector(".js-tos-link");a&&(a.classList.add("d-none"),a.setAttribute("aria-hidden","true")),r.classList.remove("d-none"),r.setAttribute("aria-hidden","false"),o.textContent=` on behalf of your company, ${t.value}`}),n(".js-company-owned:not(:checked)",{constructor:HTMLInputElement,add(e){const t=e.form;i(t,"null.js:86");const n=s(t,".js-company-name-input",HTMLInputElement),o=s(document,".js-company-name-text"),r=s(document,".js-corp-tos-link"),a=s(document,".js-tos-link");e.getAttribute("data-optional")&&n.removeAttribute("required"),q(n,""),a.classList.remove("d-none"),a.setAttribute("aria-hidden","false"),r.classList.add("d-none"),r.setAttribute("aria-hidden","true"),o.textContent=""}}),n(".js-company-owned:checked",{constructor:HTMLInputElement,add(e){const t=e.form;i(t,"null.js:113");const n=s(t,".js-company-name-input");n.setAttribute("required","required"),b(n,"change")}}),n(".js-plan-choice",{constructor:HTMLInputElement,add(e){const t=e;t.addEventListener("change",function(){const e=document.querySelector(".js-new-business-section");e&&t.checked&&(e.classList.add("has-removed-contents"),s(document,".js-company-owned",HTMLInputElement).disabled=!1)})}}),n(".js-company-owned-autoselect",{constructor:HTMLInputElement,add(e){const t=e;function n(){if(t.checked&&t.form){const e=s(t.form,".js-company-owned",HTMLInputElement);q(e,!0),document.querySelectorAll(".js-new-business-section").length>0&&(e.disabled=!0)}}t.addEventListener("change",n),n()}}),h(".js-org-list-item .js-org-remove-item",async function(e,t){r(e,".js-org-list-item").classList.add("d-none");try{await t.text()}catch(Jd){r(e,".js-org-list-item").classList.remove("d-none");const n=e.getAttribute("data-error-message");if(n)return void alert(n)}r(e,".js-org-list-item").remove()}),o("click",".js-plan-choice",e=>{const t=document.querySelector(".SignUpContinueActions"),n=e.target.value;null!=t&&t.classList.remove("has-removed-contents");const s=!(n&&"business_plus"===n);for(const o of u(document,".js-enterprise-choice",HTMLInputElement))o.disabled=s}),o("click",".js-enterprise-choice",e=>{const t=document.querySelector(".js-enterprise-plan-seat-selection"),n=document.querySelector(".js-billing-section"),s=document.querySelector(".SignUpContinueActions"),o=document.querySelector(".js-enterprise-contact"),r=e.target.value,i=[n,s,t];for(const a of i)null!=a&&a.classList.toggle("has-removed-contents","cloud"!==r);o&&o.classList.toggle("has-removed-contents","cloud"===r)}),h(".js-select-repo-permission",async function(e,t){e.classList.remove("was-successful"),e.classList.add("is-loading");const n=await t.json();e.classList.remove("is-loading"),e.classList.add("was-successful");const s=e.closest(".js-org-repo");if(s){const e=n.json;s.classList.toggle("with-higher-access",e.members_with_higher_access)}}),h(".js-per-seat-invite-field, .js-per-seat-invite .js-org-remove-item",async function(e,t){!function(e){for(const n in e.selectors){const t=e.selectors[n],s=document.querySelector(n);t&&s&&(s.textContent=t)}const t=100===e.filled_seats_percent;s(document,".js-live-update-seats-percent").style.width=`${e.filled_seats_percent}%`,s(document,".js-need-more-seats").classList.toggle("d-none",!t),s(document,".js-add-org-member-form").classList.toggle("d-none",t)}((await t.json()).json)}),o("click",".js-org-enable-saml",function(e){var t;i(e.currentTarget instanceof HTMLInputElement,"null.js:113"),e.currentTarget.checked?ua(ca()):(t=ca())&&t.classList.add("d-none")}),o("click",".js-saml-submit",function(e){e.preventDefault(),i(e.currentTarget instanceof HTMLButtonElement,"null.js:130"),Q(e.currentTarget),v(aa())}),o("click",".js-org-saml-confirm-enforce-button",function(){la().value="true",v(aa())}),o("submit",".js-saml-provider-settings-form",function(e){e.preventDefault(),"test_settings"===ma().name?ga():"save_settings"===ma().name&&(da()?async function(){(await X({content:s(document,"#disable-saml-confirmation",HTMLTemplateElement).content.cloneNode(!0)})).addEventListener("dialog:remove",pa)}():fa()?X({content:s(document,"#enforce-saml-confirmation",HTMLTemplateElement).content.cloneNode(!0)}):ga())}),o("click",".js-team-remove-user",function(e){e.preventDefault();for(const t of document.querySelectorAll(".js-team-add-user-form"))t.classList.remove("d-none");s(document,".js-team-add-user-name").focus(),r(e.currentTarget,"li").remove()}),o("click",".js-team-add-user-button",function(e){e.preventDefault(),async function(e){const t=r(e,".js-team-add-user-form"),n=s(t,".js-team-add-user-name",HTMLInputElement),o=n.value;n.value="";const i=s(document,".js-team-user-logins");for(const s of i.querySelectorAll("li"))if(s.getAttribute("data-login")===o)return;if(!(await ot("low")))return;const a=new URL(t.getAttribute("data-template-url")||"",window.location.origin),c=new URLSearchParams(a.search.slice(1));c.append("member",o),a.search=c.toString(),n.focus();const l=await _(document,a);i.appendChild(l);for(const s of u(document,".js-login-field",HTMLInputElement))s.disabled=!1;t.classList.add("d-none")}(e.currentTarget)}),o("click",".js-rename-owners-team-next-btn",function(){const e=s(document,".js-rename-owners-team-about-content");e.hidden=!e.hidden;const t=s(document,".js-rename-owners-team-rename-form");t.hidden=!t.hidden}),o("change",".js-add-child-team-completer",async function(e){if(e.target!==e.currentTarget)return;const t=e.currentTarget;if(i(t instanceof AutocompleteElement,"null.js:17"),!t.value)return;const n=r(t,".js-add-team-container");ha(n,!0);const o=r(t,".js-add-child-team-form"),a=d(o,"data-change-parent-summary-path"),c=await _(document,a);s(o,".js-add-team-search").hidden=!0,s(o,".js-add-team-warning").append(c),ha(n,!1)}),o("click",".js-expandable-team-breadcrumbs .js-team-breadcrumb-trigger",async function(e){const t=r(e.target,".js-expandable-team-breadcrumbs");t.classList.add("is-loading");try{await rt(t)}catch(Jd){}t.classList.remove("is-loading")}),o("click",".js-toggle-inline-comment-form",function(e){ja(r(e.currentTarget,".js-line-comments"))}),o("quote-selection",".js-line-comments",function(e){ja(e.currentTarget)}),C("keydown",".js-inline-comment-form-container form .js-comment-field",function(e){const t=e.target;if(i(t instanceof HTMLTextAreaElement,"null.js:37"),!t.classList.contains("js-navigation-enable")&&"Escape"===e.key&&0===t.value.length){va(r(t,"form",HTMLFormElement)),e.preventDefault()}}),o("click",".js-hide-inline-comment-form",function(e){const t=r(e.currentTarget,"form",HTMLFormElement);!Xe(t)||confirm(d(e.target,"data-confirm-cancel-text"))?va(t):e.preventDefault()}),o("click",".js-team-discussions-team-description-toggle",function(){s(document,".js-team-discussions-team-description").classList.toggle("d-none"),s(document,".js-team-discussions-team-description-form").classList.toggle("d-none")}),o("click",".js-team-discussions-post-toggle",function(e){const t=r(e.target,".js-teams-write-a-post");t.classList.contains("active")||(t.classList.add("active"),s(t,".js-team-discussions-post-compose").classList.remove("d-none"),s(t,".js-post-placeholder").classList.add("d-none"),s(t,".js-title-field").focus())}),o("reset",".js-new-comment-form",function(e){let t=e.currentTarget;setTimeout(()=>(function(e){const t=e.querySelectorAll("details-menu [role=menuitemradio] input[type=radio]:checked");for(const n of t)n.click()})(t),0)}),o("click",".js-hide-post-form",function(e){const t=r(e.target,".js-new-comment-form",HTMLFormElement);!Xe(t)||confirm(d(e.target,"data-confirm-cancel-text"))?ba(e.target):e.preventDefault()}),o("click",".js-hide-inline-comment-form",function(e){La(e.target)}),h(".js-new-comment-form",async function(e,t){await t.text(),ba(e),La(e)}),h(".js-team-discussions-team-description-form",async function(e,t){try{await t.text()}catch(Jd){}const n=s(document,".js-team-discussions-team-description"),o=s(n,".description"),r=s(document,".js-team-discussions-team-description-field",HTMLTextAreaElement);n.classList.toggle("d-none"),e.classList.toggle("d-none"),r.value.trim()?(o.textContent=r.value,r.defaultValue=r.value):(o.textContent="This team has no description",r.defaultValue="")}),h(".js-comment-pin",async function(e,t){const n=s(e,"button[type=submit]");n.blur(),await t.text();const o=s(e,'input[name="team_discussion[pinned]"]',HTMLInputElement),i=document.querySelector("#pinned_posts_counter"),a=d(n,"aria-label"),c=d(n,"data-alternate-aria-label");n.setAttribute("data-alternate-aria-label",a),n.setAttribute("aria-label",c),n.classList.toggle("pinned");const l=n.classList.contains("pinned");if(i){ya(i,l?1:-1);const t=r(i,".js-pinned-post-tab");if(!l&&t.classList.contains("selected")){const t=r(e,".js-comment-delete-container");(u=t).addEventListener("transitionend",function(e){"opacity"===e.propertyName&&u.remove()},{once:!0}),u.classList.add("fade-out")}}var u;o.value=l?"0":"1"}),h(".js-comment-delete",async function(e,t){await t.text();const n=e.closest(".discussion-post"),s=n&&n.querySelector(".js-comment-pin button[type=submit]");if(s&&s.classList.contains("pinned")){const e=document.querySelector("#pinned_posts_counter");e&&ya(e,-1)}}),o("quote-selection",".js-discussion-post",function(e){const t=s(e.target,".js-inline-comment-form-container");t.classList.add("open"),s(t,".js-write-tab").click(),s(t,".js-comment-field").focus()}),h(".js-comment-subscribe",async function(e,t){await t.text(),Ea(e,".js-comment-unsubscribe")}),h(".js-comment-unsubscribe",async function(e,t){await t.text(),Ea(e,".js-comment-subscribe")}),h(".js-discussion-post-update",async function(e,t){const n=e.closest(".js-comment");if(!n)return;const s=n.querySelector(".js-comment-title");if(!s)return;const o=await t.json();s.textContent=o.json.title}),async function(){await x;const e=document.querySelector(".js-show-discussion .js-mark-notification-form");e instanceof HTMLFormElement&&v(e)}();let wa=!1;async function Ta(e){const t=d(e,"data-contents-url"),n=new URL(t,window.location.origin),o=new URLSearchParams(n.search.slice(1));o.append("query",e.value.trim()),n.search=o.toString();const r=s(document,".js-select-team-results"),i=await _(document,n);r.innerHTML="",r.append(i)}function ka(e){const t=r(e,"form",HTMLFormElement),n=t.querySelector(".js-selected-team-id"),o=n instanceof HTMLInputElement&&n.value,i=s(t,".js-team-privacy-closed"),a=s(t,".js-team-privacy-secret"),c=s(i,"input",HTMLInputElement),l=s(a,"input",HTMLInputElement);a.classList.toggle("tooltipped",!!o),a.classList.toggle("text-gray",!!o),l.disabled=!!o,o&&(c.checked=!0)}function Sa(e,t){const n=e.value;e.value=t.textContent,t.textContent=n}o("click",".js-open-child-team",function(e){if(wa)return;wa=!0;const t=e.currentTarget.getAttribute("data-parent-team-slug");if(!t)return;const n=document.querySelectorAll(`.js-child-team[data-parent-team-slug="${t}"]`),s=r(e.currentTarget,".js-team-row");if(s.classList.contains("is-open"))e.currentTarget.setAttribute("aria-expanded","false"),function(e,t){(function e(t){for(const n of t){const t=d(n,"data-team-slug"),s=document.querySelectorAll(`.js-child-team[data-parent-team-slug="${t}"]`);e(s),n.classList.remove("is-open"),n.classList.add("d-none")}})(t),e.classList.remove("is-open"),wa=!1}(s,n);else{e.currentTarget.setAttribute("aria-expanded","true"),async function(e,t,n){if(t.length){for(const e of t)e.classList.remove("d-none");e.classList.add("is-open"),wa=!1}else{const t=await _(document,n);e.after(t),e.classList.add("is-open"),wa=!1}}(s,n,d(e.currentTarget,"data-child-team-url"))}}),o("click",".js-show-more-child-teams",async function(e){if(wa)return;wa=!0;const t=e.currentTarget,n=r(t,".js-team-row"),s=d(t,"data-child-team-url"),o=n.parentNode,i=await _(document,s);n.before(i),o&&o.removeChild(n),wa=!1}),n(".js-selected-team-field",{constructor:HTMLInputElement,initialize(e){y(e,Ta)}}),o("menu:activated",".js-select-team-menu",function(e){const t=e.target.querySelector(".js-selected-team-field");t&&t.focus()}),o("selectmenu:selected",".js-select-team",function(e){const t=e.currentTarget,n=d(t,"data-selected-team-id"),o=s(document,"#selected-team-id",HTMLInputElement),r=s(t,".js-selected-team-name").innerHTML,i=s(document,"#selected-team-name",HTMLInputElement);n!==o.value&&(o.value=n,i.value=r)}),o("selectmenu:selected",".js-clear-team-selection",function(){const e=s(document,".js-select-button");e.textContent=e.getAttribute("data-placeholder")||"Select team"}),c(".js-team-ldap-group-field",function(e){const t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:11"),r(t,".form-group").classList.remove("errored")}),o("change",".js-import-ldap-group-completer",function(e){if(e.target!==e.currentTarget)return;const t=e.target;i(t instanceof AutocompleteElement,"null.js:19");const n=r(t,".js-ldap-group-adder"),o=s(t,".js-team-ldap-group-field",HTMLInputElement),a=s(n,".js-team-ldap-dn-field",HTMLInputElement);if(a.value="",t.value){const e=JSON.parse(t.value),n=e.dn,s=e.cn;o.value=s,a.value=n}}),h(".js-ldap-group-adder",async function(e,t,n){n.headers.set("X-Context","import");const o=r(e,".js-ldap-import-groups-container");let i;try{i=await t.html()}catch(Jd){return void(Jd.response&&s(e,".form-group").classList.add("errored"))}const a=document.querySelector(".js-import-form-actions");o.classList.remove("is-empty"),s(o,".js-ldap-imported-groups").prepend(i.html),e.reset(),s(e,".js-team-ldap-group-field").focus(),a&&a.classList.remove("d-none")}),o("submit",".js-team-remove-group",function(e){r(e.currentTarget,".js-team").classList.add("is-removing"),s(document,".js-team-ldap-group-field").focus()}),h(".js-team-remove-group",async function(e,t){try{await t.text()}catch(n){return void r(e,".js-team").classList.remove("is-removing")}r(e,".js-team").remove(),document.querySelector(".js-team:not(.is-removing)")||(s(document,".js-ldap-import-groups-container").classList.add("is-empty"),s(document,".js-import-form-actions").classList.add("d-none"))}),o("click",".js-edit-team",function(e){const t=r(e.currentTarget,".js-team");t.classList.contains("is-removing")||(t.classList.add("is-editing"),s(t,".js-team-name-field").focus())}),o("click",".js-cancel-team-edit",function(e){const t=r(e.currentTarget,".js-team"),n=s(t,".js-team-form",HTMLFormElement);t.classList.remove("is-editing"),n.reset()}),h(".js-team-form",async function(e,t,n){n.headers.set("X-Context","import");const s=await t.html();r(e,".js-team").replaceWith(s.html)}),o("click",".js-team-search-filter",function(e){e.preventDefault();const t=d(e.currentTarget,"data-filter"),n=r(e.currentTarget,"[data-filter-on]"),o=d(n,"data-filter-on"),i=s(document,".js-team-search-field",HTMLInputElement),a=new RegExp(`${o}:[a-z]+`),c=i.value.trim().replace(a,"");i.value=`${c} ${t}`.replace(/\s\s/," "),i.focus(),st(i)}),n(".js-select-team-menu",function(e){ka(e)}),o("selectmenu:selected",".js-select-team-menu",function(e){ka(e.currentTarget)}),o("click",".js-create-team-button",function(e){const t=r(e.currentTarget,"form"),n=t.querySelector(".js-already-selected-team-name");if(!(n instanceof HTMLInputElement))return;const o=t.querySelector(".js-original-team-visibility"),i=t.querySelector(".js-team-privacy-secret");if(!i)return;const a=s(i,"input",HTMLInputElement),c=function(e){return e.value!==e.getAttribute("data-original-team-name")}(n),l=function(e,t){return null!=e&&t.checked&&!["","SECRET"].includes(e.getAttribute("data-original-team-visibility"))}(o,a);if(c||l){e.preventDefault();const s=d(t,"data-important-changes-summary-url"),o=new URL(s,window.location.origin),r=new URLSearchParams(o.search.slice(1));r.append("parent_team",n.value),l&&r.append("visibility_changed",l.toString()),c&&r.append("parent_changed",c.toString()),o.search=r.toString(),X({content:_(document,o),dialogClass:"p-3"})}}),o("click",".js-confirm-edit-team",function(){s(document,".js-org-team-form",HTMLFormElement).submit()}),o("change",".js-team-project-completer",function(e){if(e.target!==e.currentTarget)return;const t=e.currentTarget;i(t instanceof AutocompleteElement,"null.js:11");const n=r(e.currentTarget,"form",HTMLFormElement),o=a(n,"project_id"),c=s(n,".js-team-project-complete-field",HTMLInputElement);if(t.value){const e=JSON.parse(t.value),n=e.name,s=e.id;o.value=s,c.value=n}else o.value=""}),n(".js-org-transform-poller",function(e){const t=e.getAttribute("data-redirect-url");e.addEventListener("load",function(){window.location.href=t})}),o("click","#load-readme",function(e){const t=s(document,"#gollum-editor-body",HTMLTextAreaElement),n=s(document,"#editor-body-buffer"),o=s(document,"#undo-load-readme"),r=n.textContent,a=d(e.currentTarget,"data-readme-name");Sa(t,n),i(e.currentTarget instanceof HTMLButtonElement,"null.js:16"),e.currentTarget.disabled=!0,e.currentTarget.textContent=`${a} loaded`,o.classList.remove("d-none"),t.addEventListener("input",function e(){t.value!==r&&(o.classList.add("d-none"),t.removeEventListener("input",e))})}),o("click","#undo-load-readme",function(e){Sa(s(document,"#gollum-editor-body",HTMLTextAreaElement),s(document,"#editor-body-buffer"));const t=s(document,"#load-readme",HTMLButtonElement),n=d(t,"data-readme-name");t.disabled=!1,t.textContent=`Load ${n}`,e.currentTarget.classList.add("d-none")});let Aa=!1;function Ma(e,t){return document.querySelector(`#${e}LC${t}`)}function Ha(e){let t=e.blobRange,n=e.anchorPrefix;if(0!==document.querySelectorAll(".js-file-line").length&&(function(){for(const e of document.querySelectorAll(".js-file-line.highlighted"))e.classList.remove("highlighted");for(const e of document.querySelectorAll(".js-file-line .highlighted")){const t=r(e,".js-file-line");e.replaceWith(...e.childNodes),t.normalize()}}(),t))if(null===t.start.column||null===t.end.column)for(const s of lt(t)){const e=Ma(n,s);e&&e.classList.add("highlighted")}else if(t.start.line===t.end.line&&null!=t.start.column&&null!=t.end.column){const e=ut(document,t,{getLineElement:e=>Ma(n,e)});if(e){const t=document.createElement("span");t.classList.add("highlighted"),dt(e,t)}}}function xa(){const e=it(window.location.hash);Ha(e),function(){const e=document.querySelector(".js-file-line-actions");if(!e)return;const t=document.querySelectorAll(".js-file-line.highlighted"),n=t[0];if(n){!function(e){const t=[];for(const s of e)t.push(s.textContent);const n=document.getElementById("js-copy-lines");if(n instanceof ClipboardCopyElement){n.textContent=`Copy ${mt(e.length,"line")}`,n.value=t.join("\n");const s=`Blob, copyLines, numLines:${e.length.toString()}`;n.setAttribute("data-ga-click",s)}}(t),function(e){const t=document.getElementById("js-view-git-blame");if(!t)return;t.setAttribute("data-ga-click",`Blob, viewGitBlame, numLines:${e.toString()}`)}(t.length);const s=function(e){const t=document.querySelector(".js-permalink-shortcut");if(t instanceof HTMLAnchorElement){const n=`${t.href}${window.location.hash}`,s=document.getElementById("js-copy-permalink");if(s instanceof ClipboardCopyElement){s.value=n;const t=`Blob, copyPermalink, numLines:${e.toString()}`;s.setAttribute("data-ga-click",t)}return n}}(t.length);s&&function(e,t){const n=document.getElementById("js-new-issue");if(n instanceof HTMLAnchorElement){if(!n.href)return;const s=new URL(n.href,window.location.origin),o=new URLSearchParams(s.search.slice(1));o.set("permalink",e),s.search=o.toString(),n.href=s.toString(),n.setAttribute("data-ga-click",`Blob, newIssue, numLines:${t.toString()}`)}}(s,t.length),e.style.top=`${n.offsetTop-2}px`,e.classList.remove("d-none")}else e.classList.add("d-none")}();const t=e.blobRange,n=e.anchorPrefix,s=t&&Ma(n,t.start.line);if(!Aa&&s){s.scrollIntoView(),r(s,".blob-wrapper, .js-blob-wrapper").scrollLeft=0}Aa=!1}function qa(e){const t=e.currentTarget,n=t.getAttribute("data-original-text");n&&(t.textContent="Copied!",setTimeout(()=>{t.textContent=n},2e3))}function Ia(e){const t=e.match(/^#?(diff-[a-f0-9]+)(L|R)(\d+)(?:-(L|R)(\d+))?$/i);if(null!=t&&6===t.length)return t;const n=e.match(/^#?(discussion-diff-[0-9]+)(L|R)(\d+)(?:-(L|R)(\d+))?$/i);return null!=n&&6===n.length?n:null}function Ca(e){ft(e),Go(e)}async function _a(e,t){let n;if(t){const s="R"===t.slice(-1)?"data-right-range":"data-left-range",o=e.getAttribute(s)||"";n=t+parseInt(o.split("-")[0],10)}else n=e.hash.slice(1);const s=d(e,"data-url"),o=new URL(s,window.location.origin),i=new URLSearchParams(o.search.slice(1));i.append("anchor",n),o.search=i.toString();const a=await _(document,o),c=r(e,".js-expandable-line"),l=function(e,t){const n=e.nextElementSibling;return n instanceof HTMLElement&&n.matches(t)?n:null}(c,".file-diff-line");l?Z(l,()=>{c.replaceWith(a)}):c.replaceWith(a)}function $a(e,t,n,s){const o=parseInt(n,10),r=parseInt(s,10);return u(e,".js-expand",HTMLAnchorElement).filter(e=>{const n="R"===t?"data-right-range":"data-left-range",s=(e.getAttribute(n)||"").split("-"),i=parseInt(s[0],10),a=parseInt(s[1],10);return i<=o&&o<=a||(o<=i&&a<=r||i<=r&&r<=a)})}function Ra(e,t){const n=e.nextElementSibling;return n&&n.matches(t)?n:null}function Na(e){const t=e.querySelector(".js-toggle-file-notes");t instanceof HTMLInputElement&&q(t,!0)}function Pa(){for(const e of document.querySelectorAll(".file .js-inline-comments-container")){const t=e.querySelectorAll(".js-comments-holder > *").length>0,n=e.querySelector(".js-inline-comment-form-container"),s=!!n&&n.classList.contains("open");t||s||e.remove()}}function Da(e){const t=s(document,e).firstElementChild;i(t,"null.js:224");const n=t.cloneNode(!0),o=n.querySelector("textarea");return o instanceof HTMLTextAreaElement&&(o.value=""),n}function Fa(e,t){const n=["type","path","position","line","side","original-line"];for(const s of n){const n=e.elements.namedItem(s);if(n instanceof HTMLInputElement){const e=t.getAttribute(`data-${s}`)||"";n.value=e}}const o=t.getAttribute("data-position")||"",r=t.getAttribute("data-anchor")||"",i=s(e,".js-comment-field"),a=i.id.replace(/^r\d+ /,"").replace("${anchor}",r).replace("${position}",o);for(const s of e.querySelectorAll(`[for="${i.id}"]`))s.setAttribute("for",a);i.id=a}function Oa(e){return Math.floor(e/2)}function Ba(e,t){const n=e.parentElement;if(!n)return;const s=n.children;let o;if(4===s.length)for(let r=0,i=s.length;r<i;r++){s[r]===e&&(o=Oa(r))}for(let r=0,i=s.length;r<i;r++){const e=s[r];null!=o&&Oa(r)!==o||e.classList.toggle("is-hovered",t)}}oe(function(){if(document.querySelector(".js-file-line-container")){setTimeout(xa,0);const e=window.location.hash;for(const t of document.querySelectorAll(".js-update-url-with-hash"))if(t instanceof HTMLAnchorElement)t.hash=e;else if(t instanceof HTMLFormElement){const n=new URL(t.action);n.hash=e,t.action=n.toString()}}}),o("click","#js-copy-permalink",qa),o("click","#js-copy-lines",qa),o("click",".js-line-number",function(e){i(e instanceof MouseEvent,"expected click event to be MouseEvent -- null.js:207");const t=it(e.currentTarget.id),n=t.blobRange;i(n,"expected line number clicks to match range -- null.js:212");const s=at(window.location.hash);s&&e.shiftKey&&(t.blobRange={start:s.start,end:n.end}),function(e){const t=window.scrollY;Aa=!0,e(),window.scrollTo(0,t)}(()=>{window.location.hash=ct(t)})}),o("submit",".js-jump-to-line-form",function(e){const t=s(e.currentTarget,".js-jump-to-line-field",HTMLInputElement).value.replace(/[^\d-]/g,"").split("-").map(e=>parseInt(e,10)).filter(e=>e>0).sort((e,t)=>e-t);t.length&&(window.location.hash=`L${t.join("-L")}`),e.preventDefault()}),c(".js-csv-filter-field",function(e){i(e.target instanceof HTMLInputElement,"null.js:7");const t=e.target.value.toLowerCase();for(const n of document.querySelectorAll(".js-csv-data tbody tr"))n.hidden=!!t&&!n.textContent.toLowerCase().includes(t)}),o("navigation:keydown",".js-commits-list-item",function(e){i(e instanceof CustomEvent,"null.js:9"),"c"===e.detail.hotkey&&s(e.target,".js-navigation-open").click()}),oe(function(){const e=function(e){if(!e)return;const t=Ia(e);if(!t)return;const n=t[1],s=t[2],o=t[3],r=t[5];return{anchor:n,side:s,line:o,lastLine:r,hashFragment:n+s+o,partialHashFragment:n+s}}(window.location.hash);e&&(z(document,e.hashFragment)&&!e.lastLine||async function e(t,n){const s=t.anchor,o=t.side,r=t.line,i=t.lastLine,a=t.hashFragment,c=t.partialHashFragment;const l=z(document,s);if(!l)return;const u=l.nextElementSibling;if(!u)return;const d=$a(u,o,r,i);if(!d.length){const e=z(document,a);if(e)return void Ca(e);const t=u.querySelector(".js-diff-load-container");if(!t)return;try{await er(t);const e=z(document,a);e instanceof HTMLElement&&Ca(e)}catch(Jd){Ca(u)}return}await function(e,t){return Promise.all(e.map(e=>_a(e,t)))}(d,c);const m=z(document,a);const f=$a(u,o,r,i);f.length?e(t,n):m?Ca(m):n<1&&e(t,n+1)}(e,0))}),o("click",".js-expand",function(e){e.preventDefault(),i(e.currentTarget instanceof HTMLAnchorElement,"null.js:123"),_a(e.currentTarget,null)}),o("click",".js-add-single-line-comment",function(e){const t=e.currentTarget;i(t instanceof Element,"null.js:18"),Na(r(t,".file"));const n=function(e){const t=r(e,"tr"),n=Ra(t,".js-inline-comments-container");if(n instanceof Element){const e=s(t,"button.js-add-line-comment"),o=Array.from(n.querySelectorAll(".js-inline-comment-form")).pop();return o instanceof HTMLFormElement&&Fa(o,e),n}}(t)||function(e){const t=r(e,"tr"),n=Da("#js-inline-comments-single-container-template"),s=n.querySelector(".js-inline-comment-form");s instanceof HTMLFormElement&&Fa(s,e);return t.after(n),n}(t);ja(Array.from(n.querySelectorAll(".js-line-comments")).pop())}),o("click",".js-toggle-new-thread-form",function(e){const t=e.currentTarget.getAttribute("data-side"),n=r(e.currentTarget,"td"),o=Array.from(n.querySelectorAll(".js-line-comments")).pop(),a=s(o,".js-inline-comment-form",HTMLFormElement),c=r(e.currentTarget,"tr").previousElementSibling;i(c,"null.js:37"),Fa(a,s(c,`${"right"===t?".blob-code-addition":".blob-code-deletion"} button.js-add-line-comment, .blob-code-context button.js-add-line-comment`)),ja(o)}),o("click",".js-add-split-line-comment",function(e){const t=e.currentTarget;Na(r(t,".file"));const n=r(t,"tr"),s="addition"===t.getAttribute("data-type")?"js-addition":"js-deletion",o=function(e,t,n){const s=e.querySelector(`.js-line-comments.${t}`);if(s){const e=Array.from(s.querySelectorAll(".js-inline-comment-form")).pop();return i(e instanceof HTMLFormElement,"null.js:256"),Fa(e,n),s}const o=Da("#js-inline-comments-split-form-container-template");o.classList.add(t);const r=o.querySelector(".js-inline-comment-form");r instanceof HTMLFormElement&&Fa(r,n);const a=e.querySelectorAll(`.${t}`);a[a.length-1].after(o);for(const i of a)i.remove();return o}(function(e){let t=Ra(e,".js-inline-comments-container");return t||(t=Da("#js-inline-comments-split-container-template"),e.after(t),t)}(n),s,t);ja(Array.from(o.querySelectorAll(".js-line-comments")).pop())}),h(".js-inline-comment-form",async function(e,t){let n;try{n=await t.json()}catch(l){if(l.response){let t;try{t=l.response.json}catch(Qd){}if(t)return void function(e,t){const n=s(e,".js-comment-form-error");let o;o=t.errors?Array.isArray(t.errors)?t.errors.join(", "):t.errors:"There was an error posting your comment.";n.textContent=o,n.style.display="block",n.classList.remove("d-none")}(e,t)}throw l}const o=n.json,r=o.inline_comment,a=e.closest(".js-line-comments");r&&(i(a,"null.js:127"),s(a,".js-comments-holder").append(f(document,r)));const c=o.inline_comment_thread;c&&(i(a,"null.js:134"),a.replaceWith(f(document,c))),va(e)}),document.addEventListener("session:resume",function(e){i(e instanceof CustomEvent,"null.js:192"),function(e){const t=e.match(/^new_inline_comment_(?:discussion|diff)_(?:[\w-]+)_(\d+)_(\d+)$/)||[],n=ee(t,2),s=n[0],o=n[1];if(!s)return;const r=document.querySelector(`.js-inline-comment-form input[name='in_reply_to'][value='${o}']`);if(!r)return;const i=r.closest(".js-line-comments");i&&ja(i)}(e.detail.targetId),function(e){const t=e.match(/^new_inline_comment_diff_(?:[\w-]+)_(\d+)$/)||[],n=ee(t,2),s=n[0],o=n[1];if(!s)return;const r=document.querySelector(`.js-add-line-comment[data-anchor='${s}'][data-position='${o}']`);r&&r.click()}(e.detail.targetId)}),n(".js-comment",{remove:Pa}),document.addEventListener("inlinecomment:collapse",()=>{Pa()}),n(".diff-table",function(e){let t=null;function n(e){i(e instanceof MouseEvent,"null.js:43"),t&&Ba(t,!1),t=null}function s(e){i(e instanceof MouseEvent,"null.js:51"),t&&Ba(t,!1),e.target instanceof HTMLElement&&(t=e.target.closest("td.blob-code"))&&Ba(t,!0)}return{add:function(){e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",n),e.addEventListener("mouseover",s)},remove:function(){e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",n),e.removeEventListener("mouseover",s)}}});class Ua{constructor(e,t,n){this.diffId=e,this.side=t,this.lineNumber=n,this.element=z(document,this.anchor())}anchor(){return`${this.diffId}${this.anchorSuffix()}`}anchorSuffix(){return`${this.side}${this.lineNumber}`}is(e){return this.diffId===e.diffId&&this.side===e.side&&this.lineNumber===e.lineNumber}}class Wa{constructor(e,t,n,s,o){this.elements=new Set,this.isParsed=!1,this.isSplit=!1,this.diffId=e,this.diffTable=document.querySelector(`.js-diff-table[data-diff-anchor=${e}]`),this.diffTable&&(this.isSplit=this.diffTable.classList.contains("js-file-diff-split")),this.start=new Ua(e,t,n),this.end=new Ua(e,s,o),this.parse()}anchor(){const e=[];return e.push(this.start.anchor()),this.start.is(this.end)||e.push(this.end.anchorSuffix()),e.join("-")}parse(){if(!this.diffTable)return;let e=this.diffTable.querySelectorAll(".js-linkable-line-number");e=this.unify(e),e=this.filterInRange(e),this.elements=this.expandRelatedElements(e),this.isParsed=!0}unify(e){if(!this.isSplit)return Array.from(e);const t=[];let n=[],s=[];for(const o of e)o.classList.contains("blob-num-addition")?n.push(o):o.classList.contains("blob-num-deletion")?s.push(o):(t.push(...s,...n,o),n=[],s=[]);return t.push(...s,...n),t}filterInRange(e){if(!this.start.element||!this.end.element)return[];let t=e.indexOf(this.start.element),n=e.indexOf(this.end.element);if(t>n){var s=[n,t];t=s[0],n=s[1];const e=[this.end,this.start],o=e[0],r=e[1];this.start=o,this.end=r}return e.slice(t,n+1)}expandRelatedElements(e){const t=this.isSplit;return e.reduce(function(e,n){const s=n.parentElement,o=n.classList.contains("blob-num-deletion")||n.classList.contains("blob-num-addition");if(!s)return e;if(t&&o)return Array.from(s.children).indexOf(n)<2?e.add(s.children[0]).add(s.children[1]):e.add(s.children[2]).add(s.children[3]);for(const t of Array.from(s.children))e.add(t);return e},new Set)}}let za=null;function Va(){return document.body&&document.body.classList.contains("diff-range-highlighting")}function Ka(){if(za){for(const e of za.elements)e.classList.remove("selected-line");za=null}const e=Ia(window.location.hash);if(!e)return;const t=e[1],n=e[2],s=e[3],o=Va()&&e[4]||n,r=Va()&&e[5]||s;za=new Wa(t,n,+s,o,+r);for(const i of za.elements)i.classList.add("selected-line")}function Ga(){const e=document.body;i(e,"null.js:9");const t=document.querySelector("meta[name=diff-view]"),n=t&&t instanceof HTMLMetaElement?t.content:"",s=document.querySelector(".js-file-diff-split"),o=document.querySelector(".CommunityTemplate-header"),r=!!("split"===n&&s||document.querySelector(".wants-full-width-container"));e.classList.toggle("full-width",r);const a=!!o;e.classList.toggle("full-width-p0",a)}function Ja(e){const t=e.parentElement;i(t,"null.js:19");const n=t.querySelectorAll("td.js-line-comments").length,s=t.querySelectorAll("td.js-line-comments.is-collapsed").length;t.classList.toggle("is-collapsed",s>0&&n===s)}function Qa(e){const t=u(document,".js-hook-event-checkbox",HTMLInputElement);for(const n of t)n.checked=n.matches(e)}function Xa(e){e.classList.contains("unread")&&(e.classList.remove("unread"),e.classList.add("read"))}function Ya(e){e.classList.contains("read")&&(e.classList.add("unread"),e.classList.remove("read"))}function Za(e,t){e===(document.activeElement&&document.activeElement.closest(".js-notification"))&&s(e,t).focus()}function ec(e){e.setAttribute("tabindex","-1"),e.addEventListener("blur",()=>e.removeAttribute("tabindex")),e.focus()}function tc(e){const t=r(e,".js-org-insights-hero-container");for(const n of t.querySelectorAll("[role=tab]"))n.setAttribute("aria-selected",(n===e).toString());for(const n of t.querySelectorAll("[role=tabpanel]"))n.hidden=e.id!==n.getAttribute("aria-labelledby");for(const n of u(document,".org-insights-header a",HTMLAnchorElement))n.hash=e.hash}o("click",".js-linkable-line-number",function(e){let t=e.currentTarget.id;if(e instanceof MouseEvent&&e.shiftKey&&Va()){const e=Ia(t);if(!e)return;const n=e[1],s=e[2],o=e[3];if(za&&za.diffId===n){t=new Wa(n,za.start.side,za.start.lineNumber,s,+o).anchor()}}window.history.replaceState(null,null,`#${t}`),Ka(),e.preventDefault()}),oe(Ka),n(".blob-expanded",Ka),n(".js-diff-progressive-loader",function(e){e.addEventListener("load",Ka)}),n(".js-diff-entry-loader",function(e){e.addEventListener("load",Ka)}),o("click",".js-rich-diff.collapsed .js-expandable",function(e){e.preventDefault();const t=e.target.closest(".js-rich-diff");i(t,"null.js:9"),t.classList.remove("collapsed")}),o("click",".js-show-rich-diff",function(e){const t=e.currentTarget.closest(".js-warn-no-visible-changes");if(!t)return;t.classList.add("d-none");const n=t.parentElement;i(n,"null.js:21");const s=n.querySelector(".js-no-rich-changes");s&&s.classList.remove("d-none")}),n("meta[name=diff-view]",{add:Ga,remove:Ga}),n(".js-file-diff-split",{add:Ga,remove:Ga}),n(".js-compare-tab.selected",{add:Ga,remove:Ga}),n(".wants-full-width-container",{add:Ga,remove:Ga}),n(".CommunityTemplate-header",{add:Ga,remove:Ga}),o("change",".js-toggle-file-notes",function(e){const t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:15"),r(t,".file").classList.toggle("show-inline-notes",t.checked)}),o("click",".js-toggle-all-file-notes",function(e){const t=u(document,".js-toggle-file-notes",HTMLInputElement),n=t.some(e=>e.checked);for(const s of t)q(s,!n);e.preventDefault()}),n(".js-inline-comments-container",function(e){let t;const n=e.closest(".file");if(n){return{add:t=function(){const e=null!=n.querySelector(".js-inline-comments-container");n.classList.toggle("has-inline-notes",e)},remove:t}}}),n("td.js-line-comments.is-collapsed",{add:Ja,remove:Ja}),n(".js-hook-url-field",{constructor:HTMLInputElement,add(e){function t(){const t=e.form;let n;i(t,"null.js:19");try{n=new URL(e.value)}catch(Jd){}const o=t.querySelector(".js-invalid-url-notice");o&&(o.hidden=!!(""===e.value||n&&/^https?:/.test(n.protocol)));const r=t.querySelector(".js-insecure-url-notice");r&&n&&e.value&&(r.hidden=/^https:$/.test(n.protocol)),s(t,".js-ssl-hook-fields").hidden=!(n&&"https:"===n.protocol)}y(e,t),t()}}),o("change",".js-hook-event-choice",function(e){const t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:53");const n=t.checked&&"custom"===t.value,o=t.closest(".js-hook-events-field");if(o&&o.classList.toggle("is-custom",n),t.checked)if(n){s(document,".js-hook-wildcard-event",HTMLInputElement).checked=!1}else"push"===t.value?Qa('[value="push"]'):"all"===t.value&&Qa(".js-hook-wildcard-event")}),o("details:toggled",".js-hook-secret",function(e){const t=e.currentTarget,n=s(t,"input[type=password]",HTMLInputElement);t.classList.contains("open")&&n.focus()}),o("click",".js-hook-deliveries-pagination-button",async function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:85"),t.disabled=!0;const n=t.parentElement;i(n,"null.js:88");const s=d(t,"data-url");n.before(await _(document,s)),n.remove()}),h(".js-redeliver-hook-form",async function(e,t){let n;try{n=await t.html()}catch(c){return i(e.parentElement,"null.js:102"),void e.classList.add("failed")}const o=e.getAttribute("data-delivery-guid")||"",r=s(document,`.js-hook-delivery-container[data-delivery-guid="${o}"]`),a=r.parentElement;i(a,"null.js:110"),r.replaceWith(n.html),s(a,"poll-include-fragment").addEventListener("load",function(){const e=s(a,".js-hook-delivery-container"),t=s(a,".js-item-status"),n=e.getAttribute("data-status-class");t.classList.remove("success","pending","failure"),n&&t.classList.add(n);const o=a.querySelector(".js-item-status-tooltip"),r=e.getAttribute("data-status-message");o&&r&&o.setAttribute("aria-label",r)})}),h(".js-test-hook-form",async function(e,t){const n=s(document,".js-test-hook-message");n.classList.remove("error","success");try{await t.text()}catch(o){n.classList.add("error");const e=s(n,".js-test-hook-message-errors");if(null!=o.response){const t=await o.response.json();e.textContent=t.errors}else e.textContent=e.getAttribute("data-network-error-message")||"";return}n.classList.add("success")}),o("click",".js-hook-enforcement-select .js-navigation-item",function(e){const t=e.currentTarget,n=s(e.currentTarget,".js-value"),o=r(t,"form",HTMLFormElement),i=s(o,".js-enforcement-value",HTMLInputElement),a=n.textContent.split("_"),c=ee(a,2),l=c[0],u=c[1];i.value=l;const d=o.querySelector(".js-final-value");d instanceof HTMLInputElement&&(d.value=u?"false":"true"),v(o)}),o("click",".js-notification-target",function(e){if(i(e instanceof MouseEvent,"null.js:39"),0===e.button){Xa(r(e.currentTarget,".js-notification"))}}),h(".js-delete-notification",async function(e,t){await t.html(),Xa(r(e,".js-notification"))}),h(".js-mute-notification",async function(e,t){gt();const n=r(e,".js-notification");n.classList.add("muted"),Xa(n),Za(n,".js-unmute-notification button");try{await t.html()}catch(s){n.classList.remove("muted"),Ya(n),J()}}),h(".js-unmute-notification",async function(e,t){gt();const n=r(e,".js-notification");n.classList.remove("muted"),Za(n,".js-mute-notification button");try{await t.html()}catch(s){n.classList.add("muted"),J()}}),h(".js-mark-notification-as-read",async function(e,t){gt();const n=r(e,".js-notification");Xa(n),Za(n,".js-mark-notification-as-unread button");try{await t.html()}catch(s){Ya(n),J()}}),h(".js-mark-notification-as-unread",async function(e,t){gt();const n=r(e,".js-notification");Ya(n),Za(n,".js-mark-notification-as-read button");try{await t.html()}catch(s){Xa(n),J()}}),h(".js-mark-visible-as-read",async function(e,t){await t.html();const n=r(e,".js-notifications-browser"),o=n.querySelectorAll(".unread");for(const s of o)s.classList.remove("unread"),s.classList.add("read");const i=n.querySelector(".js-mark-visible-as-read");i&&i.classList.add("mark-all-as-read-confirmed");const a=n.querySelector(".js-mark-as-read-confirmation");a&&a.classList.add("mark-all-as-read-confirmed"),ec(s(e,".js-mark-visible-as-read-success"))}),h(".js-mark-remaining-as-read",async function(e,t){await t.html();const n=r(e,".js-notifications-browser"),s=n.querySelector(".js-mark-remaining-as-read");s&&s.classList.add("d-none");const o=n.querySelector(".js-mark-remaining-as-read-confirmation");o&&(o.classList.remove("d-none"),ec(o))}),h(".js-create-saved-notification-thread",async function(e,t){await t.json(),e.hidden=!0;const n=r(e,".js-save-notification");s(n,".js-delete-saved-notification-thread").hidden=!1}),h(".js-delete-saved-notification-thread",async function(e,t){if(await t.json(),e.getAttribute("data-is-saved-notification-view")){r(e,".js-notification").classList.toggle("d-none")}else{e.hidden=!0;const t=r(e,".js-save-notification");s(t,".js-create-saved-notification-thread").hidden=!1}}),o("navigation:keydown",".js-notification",function(e){i(e instanceof CustomEvent,"null.js:197");const t=e.currentTarget,n=t.querySelector(".js-delete-notification")||t.querySelector(".js-mark-notification-as-read");switch(e.detail.hotkey){case"I":case"e":case"y":v(n),e.preventDefault(),e.stopPropagation();break;case"M":case"m":v(t.querySelector(".js-mute-notification")),e.preventDefault(),e.stopPropagation()}}),o("navigation:keyopen",".js-notification",function(e){Xa(e.currentTarget)}),h(".js-notifications-subscription",async function(e,t){const n=s(e,".js-spinner");n.classList.remove("d-none");try{await t.html()}catch(o){}n.classList.add("d-none")}),o("change",".js-notification-subscriptions-check",function(){const e=null!=document.querySelector(".js-notification-subscriptions-check:checked");s(document,".js-notification-subscription-filters").hidden=e,s(document,".js-notification-subscription-actions").hidden=!e}),n(".js-notification-subscriptions-dark-ship",function(e){const t=e.getAttribute("data-subscriptions-page-path");t&&pt(t);const n=e.getAttribute("data-repositories-partial-path");n&&pt(n)}),h(".js-toggler-container .js-set-approval-state",async function(e,t){const n=r(e,".js-toggler-container");n.classList.add("loading");const s=await t.json();"approved"===s.json.approval_state?n.classList.add("on"):"denied"===s.json.approval_state&&(n.classList.add("revoked"),n.classList.remove("on")),n.classList.remove("loading")}),h(".js-request-access-approval-form",async function(e,t){await t.text();const n=d(e,"data-container-id");s(document,`#${n}`).classList.add("on")}),o("click",".js-org-insights-hero-container [role=tab]",e=>{let t=e.currentTarget;t instanceof HTMLAnchorElement&&tc(t)}),oe(()=>{try{tc(s(document,`[href='${document.location.hash||"#insights-prs"}']`,HTMLAnchorElement))}catch(Jd){}}),l(".js-email-notice-trigger",function(e){const t=u(document,".js-email-notice");for(const n of t)n.classList.add("notice-highlight");e.addEventListener("blur",function(){for(const e of t)e.classList.remove("notice-highlight")})}),n(".js-plan-choice:checked",{add(e){const t=e.closest(".plan-row");t&&t.classList.add("selected")},remove(e){const t=e.closest(".plan-row");t&&t.classList.remove("selected")}}),n(".js-setup-organization:checked",{add(){const e=s(document,".js-choose-plan-submit");e.getAttribute("data-default-text")||e.setAttribute("data-default-text",e.textContent),e.textContent=e.getAttribute("data-org-text")||""},remove(){const e=s(document,".js-choose-plan-submit");e.textContent=e.getAttribute("data-default-text")||""}});const nc=new WeakMap;function sc(e){let t=e.target;i(t instanceof HTMLElement,"null.js:65");const n=r(t,"form");if(t.closest("input[type=text]")&&!nc.get(n)){const e=s(n,".js-signup-source",HTMLInputElement);Le({category:"Signup",action:"Attempt",label:e.value}),nc.set(n,!0)}}let oc;n(".js-signup-form",{subscribe:e=>H(e,"input",sc)}),n(".js-octocaptcha-parent",function(e){const t=s(e,".js-octocaptcha-spinner"),n=s(e,".js-octocaptcha-success"),o=s(e,".js-octocaptcha-token",HTMLInputElement),r=s(e,".js-octocaptcha-form-submit",HTMLButtonElement),i=s(e,".js-octocaptcha-frame-container"),a=s(e,".js-octocaptcha-frame"),c=o.getAttribute("data-octocaptcha-url");let l="true"===e.getAttribute("data-redirect-after-solved"),u=!1;const d=()=>{u||(u=!0,t.classList.add("d-none"),n.classList.remove("d-none"),r.disabled=!1,l&&r.click())},m=()=>{if(u)return;const t=document.createElement("input");t.type="hidden",t.id="error_loading_captcha",t.name="error_loading_captcha",t.value="1",l=!1,e.appendChild(t),d()};setTimeout(m,2e4),a.addEventListener("error",m),window.addEventListener("message",e=>{if(e.origin!==c)return;const n=e.data&&e.data.event;"captcha-loaded"===n?u||(u=!0,t.classList.add("d-none"),i.classList.remove("v-hidden","zero-height")):"captcha-complete"===n?(o.value=e.data.sessionToken,r.disabled=!1,l&&r.click()):"captcha-suppressed"===n&&d()})}),n(".js-other-field:checked",{add(){const e=document.querySelector(".js-specify-field");null!==e&&(e.hidden=!1)},remove(){const e=document.querySelector(".js-specify-field");null!==e&&(e.hidden=!0)}});let rc=null;function ic(e){const t=e.item,n=e.oldIndex,s=t.parentNode;i(s instanceof HTMLElement,"null.js:17"),rc=s.children[n+1]}async function ac(e){const t=e.oldIndex,n=e.newIndex,o=e.item;if(t===n)return;const a=r(o,".js-pinned-issues-reorder-form",HTMLFormElement),c=r(a,".js-pinned-issues-reorder-container"),l=s(c,".js-pinned-issues-spinner");l.style.display="inline-block",oc.option("disabled",!0);try{await g(a.action,{method:a.method,body:new FormData(a)}),l.style.display="none",oc.option("disabled",!1)}catch(Jd){const t=o.parentNode;i(t,"null.js:44"),rc?t.insertBefore(o,rc):t.appendChild(o)}}n(".js-pinned-issues-reorder-list",function(e){oc=nt.create(e,{animation:150,item:".js-pinned-issue-list-item",handle:".js-pinned-issue-reorder",onUpdate:ac,onStart:ic,chosenClass:"is-dragging"})}),o("submit",".js-pinned-issues-reorder-form",function(e){e.preventDefault()}),Ji(".js-pinned-issue-list-item",ac),o("click",".js-new-user-contrib-example",async function(e){const t=s(document,".js-calendar-graph");if(t.classList.contains("sample-graph"))return;t.classList.add("sample-graph");const n=d(e.currentTarget,"data-url");let o;try{o=await g(n)}catch(Jd){return void t.classList.remove("sample-graph")}const r=document.createElement("div");r.innerHTML=o;const a=t.querySelector(".js-calendar-graph-svg");i(a,"null.js:32"),a.replaceWith(r.children[0])});let cc=null;function lc(){const e=s(document,".js-calendar-graph"),t=d(e,"data-url");return new URL(t,window.location.origin)}function uc(e){const t=e.target;i(t instanceof Element,"null.js:56"),t.matches("rect.day")&&(dc(),function(e){const t=document.body;i(t,"null.js:89");const n=d(e,"data-date"),s=function(e,t){const n=`${mc[t.getUTCMonth()].slice(0,3)} ${t.getUTCDate()}, ${t.getUTCFullYear()}`,s=0===e?"No":Ae(e),o=document.createElement("div");o.classList.add("svg-tip","svg-tip-one-line"),o.style.pointerEvents="none";const r=document.createElement("strong");return r.textContent=`${s} ${mt(e,"contribution")}`,o.append(r,` on ${n}`),o}(parseInt(e.getAttribute("data-count")),yc(n));t.appendChild(s);const o=e.getBoundingClientRect(),r=o.left+window.pageXOffset-s.offsetWidth/2+o.width/2,a=o.bottom+window.pageYOffset-s.offsetHeight-2*o.height;s.style.top=`${a}px`,s.style.left=`${r}px`}(t))}function dc(){const e=document.querySelector(".svg-tip");e&&e.remove()}n(".js-calendar-graph-svg",function(e){const t=r(e,".js-calendar-graph");t.addEventListener("mouseover",uc),t.addEventListener("mouseout",dc);let n=t.getAttribute("data-from");n&&(n=cc=yc(n));let s=t.getAttribute("data-to");s&&(s=yc(s))}),o("click",".js-calendar-graph rect.day",function(e){i(e instanceof MouseEvent,"null.js:39");const t=e.currentTarget;i(t instanceof Element,"null.js:41");const n=r(t,".js-calendar-graph"),s=d(n,"data-org"),o=d(t,"data-date");t.classList.contains("active")?Tc(wc()):function(e,t,n){let s,o;if(cc&&t){const t=cc.getTime(),n=26784e5,a=t-n,c=t+n;var r=e>cc?[cc,e]:[e,cc],i=ee(r,2);s=i[0],o=i[1],s=new Date(Math.max(s.getTime(),a)),o=new Date(Math.min(o.getTime(),c)),cc=null}else cc=o=s=e;hc(s,o);const a=lc(),c=gc(a.search.slice(1),{from:s,to:o,org:n});c.append("tab","overview"),a.search=c.toString(),fc(a.toString())}(yc(o),e.shiftKey,s)});const mc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];async function fc(e){const t=document.getElementById("js-contribution-activity");if(!t)return;t.classList.add("loading");const n=await _(document,e);t.classList.remove("loading"),t.innerHTML="",t.append(n)}function gc(e,t){const n=new URLSearchParams(e);n.delete("from"),n.delete("to"),n.delete("org");let s=t.fromStr;t.from&&(s=Lc(t.from)),s&&n.append("from",s);let o=t.toStr;t.to&&(o=Lc(t.to)),o&&n.append("to",o);const r=t.org;return r&&n.append("org",r),n}async function pc(e,t,n){const o=s(document,".js-calendar-graph"),r=d(o,"data-graph-url"),i=new URL(r,window.location.origin),a=gc(i.search.slice(1),{from:e,to:t,org:n});i.search=a.toString();const c=await _(document,i.toString());s(document,".js-yearly-contributions").replaceWith(c)}function hc(e,t){const n=s(document,".js-calendar-graph"),o=n.querySelectorAll("rect.day");for(const s of o)s.classList.remove("active");if(n.classList.remove("days-selected"),e||t){n.classList.add("days-selected");for(const e of o)r(e)&&e.classList.add("active")}function r(n){const s=yc(n.getAttribute("data-date")||"").getTime();return e&&t?e.getTime()<=s&&s<=t.getTime():e?s===e.getTime():void 0}}function jc(){const e=s(document,".js-calendar-graph").querySelectorAll("rect.active"),t=e[0],n=e[e.length-1],o=t&&d(t,"data-date"),r=n&&d(n,"data-date");if(o&&r)return{first:o,last:r}}function vc(){const e=jc()||function(){const e=new URLSearchParams(window.location.search.slice(1)),t=e.get("from"),n=e.get("to");if(t&&n)return{first:t,last:n}}()||function(){const e=new URL(wc()),t=new URLSearchParams(e.search.slice(1)),n=t.get("from"),s=t.get("to");if(n&&s)return{first:n,last:s}}();return i(e,"null.js:257"),e}function bc(e){return`0${e}`.slice(-2)}function Lc(e){return`${e.getUTCFullYear()}-${bc(e.getUTCMonth()+1)}-${bc(e.getUTCDate())}`}function yc(e){const t=e.split("-").map(e=>parseInt(e,10)),n=ee(t,3),s=n[0],o=n[1],r=n[2];return new Date(Date.UTC(s,o-1,r))}async function Ec(e){const t=jc(),n=function(){const e=s(document,".js-calendar-graph");return{first:d(e,"data-from"),last:d(e,"data-to")}}(),o=new Date(n.first),r=new Date(n.last);if(await pc(o,r,e),t){hc(new Date(t.first),new Date(t.last))}}function wc(){return s(document,".js-profile-timeline-year-list .js-year-link.selected",HTMLAnchorElement).href||""}function Tc(e){const t=new URL(e).search,n=new URLSearchParams(t.slice(1)),s=n.get("org"),o=n.get("from"),r=n.get("to");i(o&&r,"null.js:413");const a=new Date(o),c=new Date(r);pc(a,c,s);const l=new lc,u=gc(l.search.slice(1),{from:a,to:c,org:s});u.append("tab","overview"),l.search=u.toString(),fc(l.toString())}function kc(e){const t=e.closest(".js-details-container");t&&t.classList.add("open");const n=e.getBoundingClientRect(),s=window.scrollY+n.top-62-10;window.scrollTo(0,s)}function Sc(e){s(document,".js-profile-editable-area").hidden=e,s(document,".js-profile-editable-form").hidden=!e,s(document,".js-profile-editable-error").textContent=""}o("click",".js-org-filter-link",function(e){e.stopPropagation(),e.preventDefault();const t=e.currentTarget;i(t instanceof HTMLAnchorElement,"null.js:341");const n=r(t,".js-org-filter-links-container").querySelector(".js-org-filter-link.selected"),s=new URL(t.href,window.location.origin),o=new URLSearchParams(s.search.slice(1)),a=o.get("org"),c=vc(),l=new Date(c.first),u=new Date(c.last);n&&n.classList.remove("selected"),t!==n&&t.classList.add("selected"),Ec(a);const d=lc(),m={org:a,from:null,to:null};o.has("from")&&(m.from=l),o.has("to")&&(m.to=u);const f=gc(d.search.slice(1),m);d.search=f.toString(),fc(d.toString()),async function(e,t){const n=document.getElementById("year-list-container");if(!n)return;t.append("year_list","1"),e.search=t.toString();const s=await _(document,e.toString());n.innerHTML="",n.append(s)}(d,f),ht(null,"",d.toString())}),o("click",".js-year-link",function(e){e.stopPropagation(),e.preventDefault();const t=e.currentTarget;i(t instanceof HTMLAnchorElement,"null.js:387");const n=r(t,"ul");s(n,".js-year-link.selected").classList.remove("selected"),t.classList.add("selected"),Tc(t.href),ht(null,"",t.href)}),function(){const e=window.location.hash;if(!e||e.indexOf("#event-")<0)return;const t=e.slice(1,e.length),n=document.getElementById(t);n&&kc(n)}(),window.addEventListener("hashchange",function(e){const t=e.newURL||window.location.href,n=t.slice(t.indexOf("#")+1,t.length),s=document.getElementById(n);s&&(e.stopPropagation(),kc(s))}),h(".js-show-more-timeline-form",async function(e,t){await t.text();const n=document.querySelector(".js-show-more-timeline-form");if(n){const t=d(n,"data-year"),o=s(document,".js-year-link.selected"),r=s(document,`#year-link-${t}`);if(o.classList.remove("selected"),r.classList.add("selected"),t!==e.getAttribute("data-year")){const e=d(n,"data-from"),t=new Date(e),s=d(n,"data-to");pc(t,new Date(s),n.getAttribute("data-org"))}}document.title=e.getAttribute("data-title")||"",ht(null,"",e.getAttribute("data-url")||"")});let Ac=null;o("click",".js-profile-editable-edit-button",function(){!function(){const e=s(document,".js-user-profile-bio").textContent;"string"==typeof e&&(s(document,".js-user-profile-bio-edit",HTMLTextAreaElement).value=e)}(),Sc(!0)}),o("click",".js-profile-editable-cancel",function(){Sc(!1)}),o("change",".js-profile-editable-pro-badge",function(e){i(e.target instanceof HTMLInputElement,"null.js:39"),Ac={preference:e.target.checked}}),h(".js-profile-editable-form",async(e,t)=>{let n;try{n=await t.html()}catch(o){if(422===o.response.status){s(document,".js-profile-editable-error").textContent=o.response.json.message}return}if(function(e){s(document,".js-profile-editable-area").replaceWith(e)}(n.html),Sc(!1),Ac){s(document,".js-pro-badge").classList.toggle("d-none",!Ac.preference)}});const Mc=new WeakMap,Hc=100;async function xc(e,t){if(t){if((Mc.get(e)||0)>Hc)return}const n=e.querySelector(".js-more-pinnable-items-button");if(!n)return;if(i(n instanceof HTMLButtonElement,"null.js:45"),n.textContent=d(n,"data-disable-with"),n.disabled=!0,t){const t=Mc.get(e)||0;Mc.set(e,t+1)}const s=d(n,"data-url"),o=await _(document,s);n.replaceWith(o),function(e){const t=e.querySelector(".js-pinned-items-filter");t&&b(t,"filterable:change")}(e)}async function qc(e){let t=e.currentTarget;const n=s(t,".js-pinned-items-selection-list");await S();const o=u(n,"input[type=checkbox]",HTMLInputElement),i=o.filter(e=>e.checked).length,a=parseInt(n.getAttribute("data-max-repo-count"),10);for(const s of o)s.disabled=i===a&&!s.checked;!function(e,t,n){const o=s(e,".js-remaining-pinned-items-count"),r=d(o,"data-remaining-label"),i=n-t;o.textContent=`${i} ${r}`,o.classList.toggle("text-red",i<1)}(r(n,".js-pinned-items-selection-form",HTMLFormElement),i,a)}function Ic(e){const t=s(e,".js-pinnable-item");return{name:t.textContent.toLowerCase().trim(),isPinned:s(e,'input[type="checkbox"]',HTMLInputElement).checked,element:e,isRepository:t.classList.contains("js-pinnable-repo"),isGist:t.classList.contains("js-pinnable-gist")}}function Cc(e,t,n){if(e.isPinned)return!0;const s=!t||e.name.indexOf(t)>-1,o=e.isRepository&&n.includeRepositories,r=e.isGist&&n.includeGists;return s&&(o||r)}function _c(e){const t=e.target;i(t instanceof Element,"null.js:189");const n=r(t,".js-pinned-items-selection-form");let o=null;t.classList.contains("js-pinned-items-search")?i((o=t)instanceof HTMLInputElement,"null.js:195"):o=s(n,".js-pinned-items-search",HTMLInputElement);const a=o.value.toLowerCase().trim(),c=function(e){if(!function(e){return!!e.querySelector(".js-pinned-items-type-filter")}(e))return{includeRepositories:!0,includeGists:!0};const t=u(e,".js-pinned-items-type-filter:checked",HTMLInputElement),n=t.map(e=>e.value),s=n.indexOf("repository")>-1,o=n.indexOf("gist")>-1;for(const r of t)r.disabled=s!==o;return{includeRepositories:s,includeGists:o}}(n);let l=!1;const d=Array.from(n.querySelectorAll(".js-pinned-items-selection"));for(const s of d){const e=Ic(s),t=Cc(e,a,c);t&&(l=!0),e.element.hidden=!t}s(n,".js-no-repos-message").hidden=l}let $c;n(".js-more-pinnable-items-button",function(e){const t=r(e,".js-pinned-items-selection-form");(function(e){const t=e.querySelector(".js-pinned-items-filter");return!!t&&(document.activeElement===t||(i(t instanceof HTMLInputElement,"null.js:79"),t.defaultValue.trim().length>0))})(t)&&xc(t,!0)}),o("click",".js-more-pinnable-items-button",function(e){const t=e.target;xc(r(t,".js-pinned-items-selection-form"),!1)}),C("keydown",".js-pinned-items-search",function(e){i(e instanceof KeyboardEvent,"null.js:220"),"Enter"===B(e)&&e.preventDefault()}),l(".js-pinned-items-search",function(e){xc(r(e,".js-pinned-items-selection-form"),!0)}),c(".js-pinned-items-search",_c),o("change",".js-pinned-items-filter",_c),o("search",".js-pinned-items-search",_c),o("change",".js-pinned-items-selection-form",qc),o("reset",".js-pinned-items-selection-form",qc);let Rc=null;function Nc(e){const t=e.item,n=e.oldIndex,s=t.parentNode;i(s instanceof HTMLElement,"null.js:17"),Rc=s.children[n+1]}async function Pc(e){const t=e.oldIndex,n=e.newIndex,o=e.item;if(t===n)return;const a=r(o,".js-pinned-items-reorder-form",HTMLFormElement),c=r(a,".js-pinned-items-reorder-container"),l=s(c,".js-pinned-items-spinner"),u=s(c,".js-pinned-items-reorder-message");u.textContent="",l.style.display="inline-block",$c.option("disabled",!0);try{await g(a.action,{method:a.method,body:new FormData(a)}),u.textContent=u.getAttribute("data-success-text")||"",l.style.display="none",$c.option("disabled",!1)}catch(Jd){u.textContent=u.getAttribute("data-error-text")||"";const t=o.parentNode;i(t,"null.js:49"),Rc?t.insertBefore(o,Rc):t.appendChild(o)}}n(".js-pinned-items-reorder-list",function(e){$c=nt.create(e,{animation:150,item:".js-pinned-item-list-item",handle:".js-pinned-item-reorder",onUpdate:Pc,onStart:Nc,chosenClass:"is-dragging"})}),o("submit",".js-pinned-items-reorder-form",function(e){e.preventDefault()}),Ji(".js-pinned-item-list-item",Pc),n(".js-user-profile-sticky-fields.is-stuck",function(){const e=s(document,".js-user-profile-sticky-bar");return{add(){e.classList.add("is-stuck")},remove(){e.classList.remove("is-stuck")}}}),n(".js-user-profile-follow-button.is-stuck",function(){const e=s(document,".js-user-profile-sticky-bar");return{add(){e.classList.add("is-follow-stuck")},remove(){e.classList.remove("is-follow-stuck")}}}),n(".js-user-profile-following-toggle .js-toggler-container.on",function(){return{add(){const e=document.querySelector(".js-user-profile-following-mini-toggle .js-toggler-container");e&&e.classList.add("on")},remove(){const e=document.querySelector(".js-user-profile-following-mini-toggle .js-toggler-container");e&&e.classList.remove("on")}}}),n(".js-user-profile-following-mini-toggle .js-toggler-container.on",function(){const e=s(document,".js-user-profile-following-toggle .js-toggler-container");return{add(){e.classList.add("on")},remove(){e.classList.remove("on")}}});const Dc=document.querySelector("meta[name=js-proxy-site-detection-payload]"),Fc=document.querySelector("meta[name=expected-hostname]");if(Dc instanceof HTMLMetaElement&&Fc instanceof HTMLMetaElement&&jt(document)){const e={url:window.location.href,expectedHostname:Fc.content,documentHostname:document.location.hostname,proxyPayload:Dc.content},t=new Error,n={};n.$__=btoa(JSON.stringify(e)),Oe(t,n)}function Oc(e,t,n){const s=Array.from(e.querySelectorAll('[role="menuitem"]'));let o=s.indexOf(t),r=s.indexOf(n);if(-1===o)throw new Error("Couldn't find startIndex in container");if(-1===r)throw new Error("Couldn't find endItem in container");if(Bc(e),s[r].classList.add("is-last-in-range"),o>r){var i=[r,o];o=i[0],r=i[1]}for(const a of s.slice(o,r+1))a.classList.add("is-range-selected")}function Bc(e){for(const t of e.querySelectorAll('[role="menuitem"]'))t.classList.remove("is-range-selected","is-last-in-range")}let Uc;function Wc(e){const t=document.querySelector("head .js-site-favicon");t instanceof HTMLLinkElement&&(null==Uc&&(Uc=t.href),t.href=e)}o("details-menu-select",".js-pull-base-branch-item",function(e){e.preventDefault();const t=s(document,".js-change-base-template",HTMLTemplateElement).content.cloneNode(!0);s(t,".js-pull-change-base-branch-field",HTMLInputElement).value=e.currentTarget.getAttribute("data-branch")||"",X({content:t})}),n(".js-diffbar-commits-menu .js-diffbar-commits-list",{subscribe:function(e){let t=!1;function n(e){t=e.shiftKey,e.shiftKey&&e.preventDefault()}function o(e){if(!t)return;e.preventDefault();const n=e.target,o=e.currentTarget;if(i(n instanceof Element,"null.js:84"),i(o instanceof Element,"null.js:85"),n.classList.contains("is-range-selected")){e.stopPropagation();const t=o.querySelectorAll(".is-range-selected"),n=t[0],r=t[t.length-1],i=d(o,"data-range-url"),a=n.getAttribute("data-parent-commit"),c=d(r,"data-commit"),l=a&&c?`${a}..${c}`:c,u=i.replace("$range",l);N({url:u,container:s(document,"#js-repo-pjax-container")})}else e.stopImmediatePropagation(),async function(e,t){function n(n){i(n.target instanceof Element,"null.js:42"),Oc(e,t,r(n.target,'[role="menuitem"]'))}Oc(e,t,t),e.addEventListener("mouseover",n),await new Promise(e=>window.addEventListener("keyup",e,{once:!0})),e.removeEventListener("mouseover",n),Bc(e)}(o,n)}return e.addEventListener("click",n,{capture:!0}),e.addEventListener("details-menu-select",o),{unsubscribe:()=>{e.removeEventListener("click",n,{capture:!0}),e.removeEventListener("details-menu-select",o)}}}}),o("toggle",".js-diffbar-commits-menu",function(e){const t=e.currentTarget;if(!t.hasAttribute("open"))return;const n=t.querySelector(".in-range");n&&n.focus()},{capture:!0}),o("click",".js-compare-tab",function(e){for(const n of document.querySelectorAll(".js-compare-tab.selected"))n.classList.remove("selected");e.currentTarget.classList.add("selected");for(const n of document.querySelectorAll("#commits_bucket, #files_bucket, #commit_comments_bucket"))n.classList.add("d-none");i(e.currentTarget instanceof HTMLAnchorElement,"null.js:21");const t=e.currentTarget.hash;s(document,t).classList.remove("d-none"),e.preventDefault()}),oe(function(e){let t=e.target;if(!(t instanceof HTMLElement))return;const n=t.closest("#commits_bucket, #files_bucket, #commit_comments_bucket");n&&n instanceof HTMLElement&&!V(n)&&s(document,`.js-compare-tab[href="#${n.id}"]`).click()}),o("click",".js-toggle-range-editor-cross-repo",function(){s(document,".js-range-editor").classList.toggle("is-cross-repo")}),o("pjax:click",".js-range-editor",function(e){const t=document.querySelector(".js-compare-pr");if(t&&t.classList.contains("open")){i(e instanceof CustomEvent,"null.js:53");const t=e.detail.options,n=new URL(t.url);n.search.match(/expand=1/)||(n.search+=`${n.search?"&":""}expand=1`,t.url=n.toString())}}),n(".js-compare-pr.open",{add(){const e=document.body;i(e,"null.js:66"),e.classList.add("is-pr-composer-expanded")},remove(){const e=document.body;i(e,"null.js:71"),e.classList.remove("is-pr-composer-expanded")}}),o("change",".js-collab-checkbox",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:9");const n=t.form;i(n,"null.js:11");for(const s of n.querySelectorAll(".errored"))s.classList.remove("errored");const o=r(t,".js-collab-option"),a=s(o,".js-status-indicator");a.classList.remove("status-indicator-success","status-indicator-failed"),a.classList.add("status-indicator-loading")}),h(".js-collab-form",async function(e,t){try{await t.text()}catch(n){for(const t of e.querySelectorAll(".status-indicator-loading")){t.classList.remove("status-indicator-loading"),t.classList.add("status-indicator-failed");const e=r(t,".js-collab-option");e.classList.add("errored");const n=s(e,".js-collab-checkbox",HTMLInputElement);n.checked=!n.checked}for(const t of e.querySelectorAll(".status-indicator-success"))t.classList.remove("status-indicator-success");return}for(const s of e.querySelectorAll(".errored"))s.classList.remove("errored");for(const s of e.querySelectorAll(".status-indicator-loading"))s.classList.remove("status-indicator-loading"),s.classList.add("status-indicator-success")}),o("details-menu-selected",".js-button-menu",function(e){const t=s(e.currentTarget,"button[data-menu-button]"),n=s(e.target,"span[data-menu-button-text]").textContent;t.textContent=n,t.focus()}),n(".js-timeline-item > .discussion-item.discussion-commits",{constructor:HTMLElement,add(e){if(e.querySelector(".discussion-item-header"))return;const t=e.closest(".js-timeline-item");if(!(t instanceof HTMLElement))return;const n=t.previousElementSibling;n instanceof HTMLElement&&n.querySelector(".discussion-item.discussion-commits")&&function(e,t){const n=s(e,".timeline-commits"),o=t.querySelectorAll(".timeline-commits > .commit");for(const s of o)n.appendChild(s);t.remove()}(n,t)}}),n("[data-favicon-override]",{add(e){const t=d(e,"data-favicon-override");setTimeout(()=>Wc(t))},remove(){null!=Uc&&Wc(Uc)}}),o("click",".js-file-header .js-details-target",function(e){if(!(e instanceof MouseEvent&&e.altKey&&e.currentTarget instanceof HTMLElement)){const t=r(e.currentTarget,".js-file");return void(t.getBoundingClientRect().top<0&&Go(t))}const t=e.currentTarget,n=r(t,".js-details-container");n.addEventListener("details:toggled",function(e){i(e instanceof CustomEvent,"null.js:28");const t=e.detail.open;Z(n,()=>{for(const e of document.querySelectorAll(".js-file.js-details-container"))e!==n&&(e.classList.toggle("open",t),e.classList.toggle("Details--on",t))}),function(e){if(!pr())return;gr(e);const t=cr();t&&(t.checked=!e),or(lr())}(t)},{once:!0})}),oe(()=>{const e=window.location.hash.slice(1);if(!e)return;const t=document.getElementsByName(e)[0];if(!t)return;const n=t.nextElementSibling;n&&n.matches(".js-file.js-details-container")&&(n.classList.add("open"),n.classList.add("Details--on"))}),o("click",".js-fork-cleanup-select-item",function(e){let t=e.currentTarget;const n=r(t,".js-fork-cleanup-select-menu");for(const s of u(n,".js-fork-cleanup-select-item"))s.classList.remove("selected");t.classList.add("selected");const o=r(n,".js-fork-cleanup-button-group"),i=t.getAttribute("data-toggles-button");"branch"===i?(s(o,".js-fork-cleanup-branch-button").classList.remove("d-none"),s(o,".js-fork-cleanup-fork-button").classList.add("d-none")):"fork"===i&&(s(o,".js-fork-cleanup-branch-button").classList.add("d-none"),s(o,".js-fork-cleanup-fork-button").classList.remove("d-none"))}),o("details:toggled",".js-pull-merging",function(e){let t=e.currentTarget;const n=u(t,".js-merge-pull-request"),s=n.some(V);for(const o of n)o.classList.toggle("is-dirty",s)}),o("click",".js-merge-box-try-again",async function(e){let t=e.currentTarget;const n=s(r(t,".js-pull-merging"),".js-tryable-again",HTMLFormElement);b(n,"submit")}),document.addEventListener("session:resume",function(e){i(e instanceof CustomEvent,"null.js:32");const t=document.getElementById(e.detail.targetId);if(t){const e=t.closest(".js-merge-pull-request");if(e){const t=e.closest(".js-details-container");t&&t.classList.add("open")}}}),o("change",".js-merge-method",function(e){let t=e.currentTarget;const n=r(t,".js-merge-pr");i(t instanceof HTMLInputElement,"null.js:45"),n.classList.toggle("is-merging","merge"===t.value),n.classList.toggle("is-squashing","squash"===t.value),n.classList.toggle("is-rebasing","rebase"===t.value);const s=u(n,".js-merge-pull-request .js-merge-commit-button",HTMLButtonElement);for(const r of s)r.type=t.value===r.value?"submit":"button";const o=r(n,".js-pull-merging");let a=o.getAttribute("data-url")||"";a=a.replace(/merge_type=(\w+)/,`merge_type=${t.value}`),o.setAttribute("data-url",a)}),o("change",".js-merge-button-toggle",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:62");const n=r(t,".js-merge-pr"),s=!t.checked;for(const o of u(n,".js-merge-commit-button",HTMLButtonElement))o.disabled=s}),o("navigation:open",".js-merge-method-menu .js-navigation-item",function(e){const t=e.currentTarget,n=r(t,".js-merge-pr"),o=s(n,".js-merge-title",HTMLInputElement),i=s(n,".js-merge-message",HTMLTextAreaElement);o.defaultValue===o.value&&(o.defaultValue=t.getAttribute("data-input-title-value")||""),i.defaultValue===i.value&&(i.defaultValue=t.getAttribute("data-input-message-value")||"")}),o("details:toggled",".js-merge-pr",function(e){const t=e.currentTarget.querySelector(".js-merge-message");t&&b(t,"change")}),o("click",".js-pull-merging a[href]",function(e){const t=e.currentTarget;i(t instanceof HTMLElement,"null.js:94"),So&&t.blur()});let zc=!1;function Vc(){const e=document.querySelectorAll(".pull-request-ref-restore");for(let t=0;t<e.length;t++)e[t].classList.toggle("last",t===e.length-1)}function Kc(){const e=null!=document.querySelector("#js-pull-restorable"),t=document.querySelector(".js-pull-discussion-timeline");t&&t.classList.toggle("is-pull-restorable",e)}document.addEventListener("keydown",function(e){"Alt"===e.key&&(zc=!0)}),document.addEventListener("keyup",function(e){"Alt"===e.key&&(zc=!1)}),o("click",".js-toggle-outdated-comments",function(e){if(!((e instanceof MouseEvent&&e.altKey||zc)&&e.currentTarget instanceof HTMLElement))return;const t=e.currentTarget,n=r(t,"details");function s(){const e=n.hasAttribute("open");for(const n of document.querySelectorAll(".js-toggle-outdated-comments"))if(n!==t){r(n,"details").toggleAttribute("open",e)}}setTimeout(()=>{Z(t,s)})}),n(".pull-request-ref-restore",{add:Vc,remove:Vc}),n("#js-pull-restorable",{add:Kc,remove:Kc}),document.addEventListener("pjax:end",function(){for(const e of document.querySelectorAll(".js-pull-refresh-on-pjax"))b(e,"socket:message",{})}),n(".js-updating-pull-request-commits-count",{add(e){const t=e.textContent,n=u(document,".js-updateable-pull-request-commits-count");for(const s of n)s.textContent=t}});const Gc="```suggestion",Jc="```",Qc=new RegExp(`${Gc}(?:.*)\n`,"i"),Xc=new RegExp(`${Jc}(\n|$)`);function Yc(e,t){const n=e.slice(0,t).split("\n");return e.split("\n")[n.length-1]}function Zc(e){const t=/^(\s+)/.exec(e);return t&&t[0]||""}function el(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const s=t.substring(n,t.length),o=e.exec(s);return o?o.index+n:-1}function tl(e,t){const n=[];let s=0,o=-1;for(;(o=el(Qc,e,s))>-1;){s=o+Gc.length;const t=el(Xc,e,s);if(-1===t)return!1;s=t+Jc.length,n.push([o,t])}return n.some(e=>t>e[0]&&t<e[1])}function nl(e,t){const n=function(e){let t=`${Gc}\n`;return t+=`${e}\n`,t+=Jc}(e),s=t.selectionStart,o=t.value,r=el(/\n/,o,s),i=""===o.trim(),a=Yc(o,s),c=""===a.trim(),l=`\n${Jc}`.length;let u=o,d=0;if(i)d=(u=n).length-l;else if(-1===r)d=c?(u=o+n).length-l:(u=[o,n].join("\n")).length-l;else if(c){const e=s-Zc(a).length,t=o.substring(0,e),i=o.substring(r,o.length);d=(u=[t,n,i].join("")).length-i.length-l}else if(tl(o,s)){const e=el(/```/,o,s)+3,t=o.substring(0,e),r=o.substring(e,o.length);d=(u=[t,"\n",n,r].join("")).length-r.length-l}else{const e=o.substring(0,r),t=o.substring(r,o.length);d=(u=[e,"\n",n,t].join("")).length-t.length-l}q(t,u),t.focus(),t.setSelectionRange(d,d)}const sl=".js-add-to-batch-enabled",ol=".js-unchanged-suggestion",rl=".js-closed-pull",il=".js-viewing-subset-changes",al=".js-validation-on-left-blob",cl=".js-validation-on-right-blob",ll=".js-outdated-comment",ul=".js-resolved-thread",dl=".js-pending-review";function ml(e){const t=function(e){const t=e.closest(".js-inline-comments-container");if(!t)return;const n=e.closest(".js-line-comments.line-comments");let o=null;n&&(o=n.classList.contains("js-addition")?"right":"left");const r=t.previousElementSibling;i(r,"null.js:44");let a=[];if("TR"===r.tagName)a=Array.from(r.children);else{const e=r.querySelectorAll("tr"),t=Array.from(e).pop();a=Array.from(t.children)}const c=a.filter(e=>{const t=e.classList;return!t.contains("blob-code-marker-cell")&&(t.contains("code-review")||t.contains("blob-code"))}),l="right"===o?c.pop():c.shift();if(l)return s(l,".blob-code-inner").textContent}(e);if(null!=t){const n=r(e,".js-suggester-container");nl(t,s(n,".js-comment-field",HTMLTextAreaElement))}}function fl(e,t){const n=document.querySelectorAll(".js-apply-suggestion-button"),o=s(e,".js-disabled-apply-suggestion-button");for(const s of n){const e=o.cloneNode(!0);pl(e,t),r(s,"details").replaceWith(e)}}function gl(e){const t=document.querySelector(".js-batched-suggested-changes-container");t&&t.classList.add("d-none");for(const n of u(document,".js-apply-single-suggestion",HTMLInputElement))n.classList.remove("d-none"),n.disabled=!0,n.setAttribute("aria-label",e);for(const n of u(document,".js-batched-suggested-changes-add",HTMLInputElement))n.classList.remove("d-none"),n.disabled=!0,n.setAttribute("aria-label",e);for(const n of document.querySelectorAll(".js-batched-suggested-changes-remove"))n.classList.add("d-none");for(const n of document.querySelectorAll(".js-focus-commit-suggestions-form-button"))n.classList.add("d-none");for(const n of document.querySelectorAll(".pending-batched-suggestion-label"))n.classList.add("d-none")}function pl(e,t){e.setAttribute("aria-label",t),e.classList.remove("d-none")}function hl(e,t){const n=s(document,".js-suggested-changes-inline-validation-template").cloneNode(!0);n.classList.remove("js-suggested-changes-inline-validation-template"),s(n,".js-suggested-changes-inline-error-message").textContent=e.trim();const o=t.parentNode;i(o,"null.js:135"),o.insertBefore(n,t.nextSibling)}function jl(){const e=document.querySelector(".js-batched-suggested-changes-container");e&&setTimeout(()=>(function(e){const t=r(e,".js-review-state-classes").querySelectorAll("[data-pending-batched-suggestion]").length;for(const s of document.querySelectorAll(".js-pending-batched-suggested-changes-count"))s.textContent=String(t);const n=s(document,".js-reenable-add-to-batch").textContent;for(const s of document.querySelectorAll("[data-batched-suggestion-reenable-sibling]"))s.removeAttribute("data-batched-suggestion-reenable-sibling"),s.removeAttribute("disabled"),s.setAttribute("aria-label",n);if(t>0){e.hidden=!1;const t=s(e,".js-batched-suggested-changes-toggle");t.classList.add("anim-pulse-in"),t.addEventListener("animationend",()=>t.classList.remove("anim-pulse-in"),{once:!0});for(const e of document.querySelectorAll(".js-apply-single-suggestion"))e.classList.add("d-none");for(const e of document.querySelectorAll(".js-batched-suggested-changes-add")){const t=r(e,".js-suggested-change-form-container");if("true"===t.getAttribute("data-pending-batched-suggestion")||"true"===t.getAttribute("data-comment-pending")||"true"===t.getAttribute("data-outdated-comment")?e.classList.add("d-none"):e.classList.remove("d-none"),"true"===e.getAttribute("data-batched-suggestion-disabled-by-sibling")){e.removeAttribute("data-batched-suggestion-disabled-by-sibling"),e.setAttribute("disabled","disabled");const t=s(document,".js-one-suggestion-per-line").textContent;e.setAttribute("aria-label",t)}}for(const e of document.querySelectorAll(".js-batched-suggested-changes-remove"))"true"===r(e,".js-suggested-change-form-container").getAttribute("data-pending-batched-suggestion")?e.classList.remove("d-none"):e.classList.add("d-none");for(const e of document.querySelectorAll(".js-focus-commit-suggestions-form-button")){const t=r(e,".js-suggested-change-form-container"),n="true"===t.getAttribute("data-comment-pending"),o="true"===t.getAttribute("data-outdated-comment"),i="true"===t.getAttribute("data-resolved-comment"),a=r(e,".js-inline-comments-container"),c="left"===s(a,'input[name="side"]',HTMLInputElement).value;n||o||i||c?e.classList.add("d-none"):e.classList.remove("d-none")}for(const e of document.querySelectorAll(".pending-batched-suggestion-label"))"true"===r(e,".js-suggested-change-form-container").getAttribute("data-pending-batched-suggestion")?e.classList.remove("d-none"):e.classList.add("d-none")}else{e.hidden=!0;for(const e of document.querySelectorAll(".js-apply-single-suggestion"))e.classList.remove("d-none");for(const e of document.querySelectorAll(".js-batched-suggested-changes-add"))e.classList.remove("d-none");for(const e of document.querySelectorAll(".js-batched-suggested-changes-remove"))e.classList.add("d-none");for(const e of document.querySelectorAll(".js-focus-commit-suggestions-form-button"))e.classList.add("d-none");for(const e of document.querySelectorAll(".pending-batched-suggestion-label"))e.classList.add("d-none")}})(e))}function vl(e,t){const n=s(e,"input[name=commit_title]",HTMLInputElement),o=s(e,"textarea[name=commit_message]",HTMLTextAreaElement);let r=n.value.trim();""===r&&(r=n.defaultValue);const i=o.value.trim();""!==i&&(r=`${r}\n\n${i}\n`),n.disabled=!0,o.disabled=!0;const a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name","message"),a.value=r,e.appendChild(a);const c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("name","changes"),c.value=JSON.stringify(t),e.appendChild(c)}function bl(e){const t=e.target;i(t instanceof HTMLElement,"null.js:32");const n=d(t,"data-reaction-label"),o=r(t,".js-add-reaction-popover"),a=s(o,".js-reaction-description");a.hasAttribute("data-default-text")||a.setAttribute("data-default-text",a.textContent),a.textContent=n}function Ll(e){i(e.target instanceof HTMLElement,"null.js:46");const t=r(e.target,".js-add-reaction-popover"),n=s(t,".js-reaction-description"),o=n.getAttribute("data-default-text");o&&(n.textContent=o)}o("click",".js-suggested-change-toolbar-item",function(e){const t=e.currentTarget;t instanceof HTMLButtonElement&&!t.disabled&&ml(t)}),o("click",".js-refresh-after-suggestion",function(){window.location.reload()}),n(".js-inline-comments-container",{add(e){const t=e.querySelector('input[name="side"]'),n=document.querySelector(".js-suggested-changes-subset-files"),o=t instanceof HTMLInputElement&&"left"===t.value;if(!n&&!o)return;const r=u(e,".js-suggested-change-toolbar-item",HTMLButtonElement),i=s(document,n?il:al).textContent.trim();for(const s of r)s.disabled=!0,s.setAttribute("aria-label",i)}}),n(".js-preview-body .js-apply-changes",{add(e){const t=e.closest(".js-suggested-changes-container");if(!t)return e.remove();const n=s(document,cl).textContent,o=s(document,al).textContent,a=r(e,".js-suggested-changes-blob");if(""!==t.getAttribute("data-thread-side")){if("left"===t.getAttribute("data-thread-side"))return hl(o,a),e.remove()}else{const t=r(e,".js-inline-comment-form"),n=s(t,'input[name="side"]',HTMLInputElement);if(!t||!n)return e.remove();if(t&&"left"===n.value)return hl(o,a),e.remove()}const c=e.previousElementSibling;i(c,"null.js:202");const l=c.querySelector(".js-blob-code-deletion"),u=c.querySelectorAll(".js-blob-code-addition");return l&&0!==u.length?l.textContent===Array.from(u).map(e=>e.textContent).join("\n")?(hl(n,a),e.remove()):void e.remove():void 0}}),n(".js-comment-body .js-apply-changes",{add(e){const t=e.closest(".js-suggested-changes-container");if(!t)return e.remove();const n=t.querySelector(".js-suggested-changes-template");if(!(n instanceof HTMLTemplateElement))return e.remove();const o=n.content.cloneNode(!0),i=s(o,".js-disabled-apply-suggestion-button");let a;try{a=s(o,".js-batched-suggested-changes-add")}catch(v){if("QueryError"!==v.name)throw v}if(u(document,".js-suggested-changes-files-tab").length){const e=s(document,sl).textContent;a&&(a.removeAttribute("disabled"),a.setAttribute("aria-label",e))}const c=s(document,".js-pull-header-details"),l=c&&"true"===c.getAttribute("data-pull-is-open"),d=e.closest(".js-resolvable-timeline-thread-container"),m="true"===n.getAttribute("data-comment-pending");if(d&&"true"===d.getAttribute("data-resolved")){const t=s(document,ul).textContent,n=o.querySelector("details");return n&&n.remove(),pl(i,t),a&&(a.setAttribute("disabled","disabled"),a.setAttribute("aria-label",t)),e.replaceWith(o)}if(!l){const t=s(document,rl).textContent;return pl(i,t),a&&(a.setAttribute("disabled","disabled"),a.setAttribute("aria-label",t)),e.replaceWith(o)}if(m){const t=s(document,dl).textContent;return s(o,"details").remove(),pl(i,t),a&&(a.setAttribute("disabled","disabled"),a.setAttribute("aria-label",t)),e.replaceWith(o)}const f="left"===r(e,".js-suggested-changes-contents").getAttribute("data-thread-side"),g=document.querySelector(".js-suggested-changes-subset-files"),p="true"===n.getAttribute("data-outdated-comment");if(f||g||p){let t;return g?t=s(document,il).textContent:f?t=s(document,al).textContent:p&&(t=s(document,ll).textContent),s(o,"details").remove(),pl(i,t),a&&(a.setAttribute("disabled","disabled"),a.setAttribute("aria-label",t)),e.replaceWith(o)}const h=s(o,".js-single-suggested-change-form"),j=e.closest(".js-suggested-changes-blob");if(j){const e=j.querySelector(".js-blob-code-deletion"),t=j.querySelectorAll(".js-blob-code-addition");if(!e)return;const n=e.textContent,r=Array.from(t).map(e=>e.textContent);if(r.length>0&&n===r.join("\n")){const e=s(document,ol).textContent;s(o,"details").remove(),pl(i,e),a&&(a.setAttribute("disabled","disabled"),a.setAttribute("aria-label",e))}else for(const s of r){const e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name","value[]"),e.value=s,h.appendChild(e)}}e.replaceWith(o)}}),n(".js-pull-header-details",{add(e){const t="true"===e.getAttribute("data-pull-is-open"),n=document.querySelector(".js-suggested-changes-template");if(t||!(n instanceof HTMLTemplateElement))return;const o=n.content,r=s(document,rl).textContent;fl(o,r),gl(r)}}),n(".js-suggested-changes-subset-files",{add(){const e=document.querySelector(".js-suggested-changes-template");if(!(e instanceof HTMLTemplateElement))return;const t=e.content,n=s(document,il).textContent;fl(t,n),gl(n)}}),o("click",".js-apply-suggestion-button",async function(e){const t=e.currentTarget.parentElement;if(t){const e=s(t,".js-suggestion-commit-title");setTimeout(()=>e.focus(),1)}}),o("click",".js-dismiss-suggested-change-onboarding-notice",async function(e){const t=d(e.currentTarget,"data-url"),n=new FormData;n.append("notice","suggested_changes_onboarding_prompt"),await g(Ge(t,{method:"post",body:n}));const s=document.querySelectorAll(".js-suggested-change-onboarding-notice");for(const o of s)o.remove()}),C("keypress",".js-comment-field",function(e){if("Enter"===e.key){const t=e.target;i(t instanceof HTMLTextAreaElement,"null.js:426"),function(e){const t=e.selectionStart;if(!tl(e.value,t))return!1;const n=e.value,s=Yc(n,t);if(null===s)return!1;const o=`\n${Zc(s)}`,r=n.substr(0,t)+o+n.substr(t);q(e,r);const i=t+o.length;return e.setSelectionRange(i,i),!0}(t)&&e.preventDefault()}}),C("keypress",".js-suggestion-commit-message",function(e){const t=e.currentTarget;i(t instanceof HTMLTextAreaElement,"null.js:435"),"Enter"===e.key&&t.setAttribute("rows","3")}),o("click",".js-batched-suggested-changes-add",function(e){const t=r(e.target,".js-suggested-change-form-container");if("true"===t.getAttribute("data-comment-pending")||"true"===t.getAttribute("data-outdated-comment")||"true"===e.target.getAttribute("data-batched-suggestion-disabled-by-sibling"))return;t.setAttribute("data-pending-batched-suggestion","true");const n=r(e.target,".js-inline-comments-container");for(const s of n.querySelectorAll(".js-batched-suggested-changes-add"))s.setAttribute("data-batched-suggestion-disabled-by-sibling","true");e.target.removeAttribute("data-batched-suggestion-disabled-by-sibling"),jl()}),o("click",".js-batched-suggested-changes-remove",function(e){r(e.currentTarget,".js-suggested-change-form-container").removeAttribute("data-pending-batched-suggestion");const t=r(e.currentTarget,".js-inline-comments-container");for(const n of t.querySelectorAll(".js-batched-suggested-changes-add"))n.setAttribute("data-batched-suggestion-reenable-sibling","true");jl()}),o("click",".js-focus-commit-suggestions-form-button",function(e){e.preventDefault(),window.location="#clear-commit-suggestions",window.location="#commit-suggestions"}),o("click",".js-dismiss-batched-suggested-changes-onboarding-notice",async function(e){const t=d(e.currentTarget,"data-url"),n=new FormData;n.append("notice","batched_suggested_changes_onboarding_prompt"),await g(Ge(t,{method:"post",body:n}));for(const s of document.querySelectorAll(".js-batched-suggested-change-onboarding-notice"))s.remove()}),o("click",".js-single-suggested-change-form .js-suggested-changes-submit",function(e){try{const t=e.currentTarget,n=r(t,".js-single-suggested-change-form",HTMLFormElement),o=u(n,'input[name="value[]"]',HTMLInputElement).map(e=>e.value);vl(n,[{commentId:s(n,"input[name=comment_id]",HTMLInputElement).value,path:s(n,"input[name=path]",HTMLInputElement).value,suggestion:o}])}catch(Jd){Oe(Jd)}}),h(".js-single-suggested-change-form",async function(e,t){const n=r(e,".js-suggested-change-form-container"),o=r(e,"details"),i=s(n,".js-suggestion-applied"),a=r(e,".js-suggested-changes-contents"),c=s(a,".js-error-message-placeholder");try{await t.json(),i.classList.remove("d-none"),s(n,".js-batched-suggested-changes-add").classList.add("d-none"),o.remove(),window.location.reload()}catch(l){if("QueryError"!==l.name){const t=l.response.json&&l.response.json.error,i=s(c,".js-error-message");c.hidden=!1,i.textContent=t,n.prepend(c);const a=r(e,".js-suggested-change-form-container");s(a,".js-batched-suggested-changes-add").classList.add("d-none"),o.remove()}}}),o("click",".js-suggestion-batch-submit",function(e){const t=r(e.currentTarget,".js-batched-suggested-changes-form",HTMLFormElement),n=[];try{for(const e of document.querySelectorAll("[data-pending-batched-suggestion]")){const t=s(e,".js-single-suggested-change-form",HTMLFormElement),o=u(t,'input[name="value[]"]',HTMLInputElement).map(e=>e.value);n.push({commentId:s(t,"input[name=comment_id]",HTMLInputElement).value,path:s(t,"input[name=path]",HTMLInputElement).value,suggestion:o})}vl(t,n)}catch(Jd){Oe(Jd)}}),h(".js-batched-suggested-changes-form",async function(e,t){try{await t.json(),r(e,".js-batched-suggested-changes-container",HTMLElement).hidden=!0,window.location.reload()}catch(n){const t=n.response.json&&n.response.json.error,o=r(e,".js-batched-suggested-changes-container"),i=s(o,".js-error-message-container");s(i,".js-error-message").textContent=t,i.hidden=!1}}),n(".js-files-tab-stale",{add(){const e=document.querySelector(".js-batched-suggested-changes-container");e&&setTimeout(()=>{e.hidden=!0})}}),h(".js-pick-reaction",async function(e,t){const n=await t.json(),o=e.closest(".js-menu-container");o instanceof HTMLElement&&Ie(o);const i=r(e,".js-comment"),a=s(i,".js-reactions-container"),c=s(i,".js-comment-header-reaction-button"),l=f(document,n.json.reactions_container.trim()),u=f(document,n.json.comment_header_reaction_button.trim());a.replaceWith(l),c.replaceWith(u),i.classList.remove("is-reacting")}),o("toggle",".js-reaction-popover-container",function(e){const t=e.currentTarget.hasAttribute("open");for(const n of e.target.querySelectorAll(".js-reaction-option-item"))t?(n.addEventListener("mouseenter",bl),n.addEventListener("mouseleave",Ll)):(n.removeEventListener("mouseenter",bl),n.removeEventListener("mouseleave",Ll));r(e.target,".js-comment").classList.toggle("is-reacting",t)},{capture:!0});const yl="render-editor",El="show-code",wl=".js-render-editor-actions",Tl={ACQUIRE:"actions:lock:acquire",RELEASE:"actions:lock:release"};class kl{constructor(e){this._initialized=!1,this._visual=e}static init(){if(kl.initialized)throw Error("Invariant: pjax not supported");kl.initialized=!0;const e=new kl({send:e=>(function(e){const t=_l(s(document,".js-render-target"));i(t,"null.js:57"),$l(t,e)})({type:e})});o(vt.Message,wl,t=>{i(t instanceof CustomEvent,"null.js:49"),e.handleMessage(t.detail.type)}),o(vt.AfterReady,wl,()=>{e.init()}),o("tab:change",".js-file-editor-nav",t=>{i(t instanceof CustomEvent,"null.js:60"),e.tabChange(t.detail.name)})}init(){this._initialized||(this._initialized=!0,this._handToVisual())}tabChange(e){switch(e){case yl:return void this._handToVisual();case El:return this._visual.send(Tl.ACQUIRE),void function(){const e=s(document,".js-render-editor-lock");setTimeout(()=>{e.style.opacity="1"},50)}()}}_handToVisual(){Sl(!0),this._visual.send(Tl.RELEASE)}handleMessage(e){switch(e){case Tl.RELEASE:Sl(!1)}}}function Sl(e){const t=s(document,".js-render-editor-lock");t.hidden=!e,e&&(t.style.opacity="0");const n=s(document,".js-code-editor"),o=bt(n);i(o,"null.js:115"),o.editor.setOption("readOnly",!!e&&"nocursor")}kl.initialized=!1,n(wl,kl.init);const Al=["is-render-pending","is-render-ready","is-render-loading","is-render-loaded"],Ml=new WeakMap,Hl=Lt(()=>{A({incrementKey:"LAUNCH_EDITOR_RENDER_SUCCEED"})});function xl(e){if(null==e)return;const t=Ml.get(e);null!=t&&(t.load=t.hello=null,t.helloTimer&&(clearTimeout(t.helloTimer),t.helloTimer=null),t.loadTimer&&(clearTimeout(t.loadTimer),t.loadTimer=null))}function ql(e,t){if(null!=e){if(Rl(e)){let e;switch(t){case"timeout:hello":e="LAUNCH_EDITOR_RENDER_TIMEOUT_HELLO";break;case"timeout:load":e="LAUNCH_EDITOR_RENDER_TIMEOUT_LOAD";break;default:e="LAUNCH_EDITOR_RENDER_FAIL"}A({incrementKey:e})}return e.classList.remove(...Al),e.classList.add("is-render-failed"),xl(e)}}function Il(){return!0}function Cl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Il;return function(){if(V(e)&&!e.classList.contains("is-render-ready")&&!e.classList.contains("is-render-failed")&&!e.classList.contains("is-render-failed-fatally")&&(!n||n()))return ql(e,t)}}function _l(e){const t=e.querySelector("iframe");return t instanceof HTMLIFrameElement?t.contentWindow:null}function $l(e,t){e&&e.postMessage&&e.postMessage(JSON.stringify(t),"*")}function Rl(e){return"launch_flow_file"===e.getAttribute("data-type")}n(".js-render-target",{constructor:HTMLElement,initialize:function(e){const t=Ml.get(e);null!=t&&t.load||(xl(e),function(e){if(Ml.get(e))return;let t=10,n=45;Rl(e)&&(t=15,n=50);const s={load:null,hello:null,helloTimer:null,loadTimer:null};s.load=Date.now(),s.helloTimer=setTimeout(Cl(e,"timeout:hello",function(){return!s.hello}),1e3*t),s.loadTimer=setTimeout(Cl(e,"timeout:load"),1e3*n),Ml.set(e,s)}(e),e.classList.add("is-render-automatic"),e.classList.add("is-render-requested"))}}),window.addEventListener("message",function(e){const t=e.data;if(!t)return;const n=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return}}(t)||t;if("string"!=typeof n.type&&"render"!==n.type)return;const s=n.type;if("string"!=typeof n.identity)return;const o=n.identity;if("string"!=typeof n.body)return;const r=n.body,i=function(e){return Array.from(document.querySelectorAll(".js-render-target")).filter(t=>!e||t.getAttribute("data-identity")===e)[0]}(o);i&&e.origin===i.getAttribute("data-host")&&function(e,t,n,s,o){switch(s){case"hello":{const t=Ml.get(e)||{untimed:!0};t.hello=Date.now();const n={type:"render:cmd",body:{cmd:"ack",ack:!0}},s={type:"render:cmd",body:{cmd:"branding",branding:!1}},o=_l(e);if($l(o,n),$l(o,s),e.classList.contains("is-local")&&o&&"function"==typeof o.postMessage){const t=o,n=e.closest(".js-code-editor"),s=n instanceof HTMLElement?bt(n):null,r=e.getAttribute("data-data");if(s){let e=null;const n=(n,o)=>{if(function(e){return e&&"setValue"===e.origin}(o))return;const r=s.code();r!==e&&(e=r,$l(t,{type:"render:data",body:r}))};s.editor.on("change",n),n()}else r&&$l(t,{type:"render:data",body:r})}}break;case"error":return ql(e,s);case"error:fatal":return ql(e,s),e.classList.add("is-render-failed-fatal");case"error:invalid":return ql(e,s),e.classList.add("is-render-failed-invalid");case"loading":return e.classList.remove(...Al),e.classList.add("is-render-loading");case"loaded":return e.classList.remove(...Al),e.classList.add("is-render-loaded");case"ready":e.classList.remove(...Al),e.classList.add("is-render-ready"),o&&"number"==typeof o.height&&(e.style.height=`${o.height}px`),Rl(e)&&Hl(),b(e,vt.AfterReady,{container:e,payload:o});break;case"resize":o&&"number"==typeof o.height&&(e.style.height=`${o.height}px`);break;case"data":b(e,"edit:visual",o);break;default:b(e,vt.Message,{type:t,body:s,payload:o})}}(i,s,0,r,null!=n.payload?n.payload:void 0)});const Nl=new WeakMap,Pl=100;function Dl(e){const t=Nl.get(e)||0;if(t>Pl)return;const n=e.querySelector(".js-more-repos-form");n&&(Nl.set(e,t+1),i(n instanceof HTMLFormElement,"null.js:31"),v(n))}function Fl(e){const t=e.querySelector(".js-your-repositories-search");t&&b(t,"filterable:change")}function Ol(e){const t=d(e,"data-url"),n=d(e,"data-query-name");T(null,"",function(e,t,n){const s=new URL(e,window.location.origin),o=new URLSearchParams(s.search.slice(1));return t.length<1?o.delete(n):o.set(n,t),s.search=o.toString(),s.toString()}(t,e.value.trim(),n))}l(".js-your-repositories-search",function(e){Dl(r(e,".js-repos-container"))}),n(".js-your-repositories-search",{constructor:HTMLInputElement,initialize(e){e.defaultValue.trim().length>0&&Fl(r(e,".js-repos-container"))}}),c(".js-your-repositories-search",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:100"),Ol(t)}),n(".js-more-repos-form",function(e){const t=r(e,".js-repos-container");(function(e){const t=e.querySelector(".js-your-repositories-search");return!!t&&(document.activeElement===t||(i(t instanceof HTMLInputElement,"null.js:62"),t.defaultValue.trim().length>0))})(t)&&Dl(t),e.addEventListener("page:loaded",function(){Fl(t)})}),o("pjax:end",".js-repos-container",function(e){const t=e.target;i(t instanceof HTMLElement,"null.js:123"),function(e){Nl.set(e,0)}(t),Fl(t)});let Bl=null;const Ul=new k;function Wl(e){const t=e.form;i(t,"null.js:43");const n=r(t,".js-branches"),o=n.querySelectorAll(".js-branches-subnav .js-subnav-item"),a=n.querySelector(".js-branches-subnav .js-subnav-item.selected"),c=s(n,".js-branches-subnav .js-branches-all"),l=t.getAttribute("data-results-container");Bl||(Bl=a);const u=e.value.trim().length>0,m=function(e){const t=e.form;if(i(t,"null.js:24"),e.value.trim()){const n=new URL(t.action,window.location.origin),s=new URLSearchParams(n.search.slice(1)),o=t.elements.namedItem("utf8");return o instanceof HTMLInputElement&&s.append("utf8",o.value),s.append("query",e.value),n.search=s.toString(),n.toString()}return d(t,"data-reset-url")}(e);function f(){n.classList.remove("is-loading")}Ul.push(_(document,m)).then(function(e){T(null,"",m);const t=l?document.getElementById(l):null;t&&(t.innerHTML="",t.appendChild(e))}).then(f,f),n.classList.toggle("is-search-mode",u),n.classList.add("is-loading");for(const s of o)s.classList.remove("selected");u?c.classList.add("selected"):Bl&&(Bl.classList.add("selected"),Bl=null)}n(".js-branch-search-field",{constructor:HTMLInputElement,initialize(e){y(e,Wl)},subscribe:e=>H(e,"keyup",function(t){i(t instanceof KeyboardEvent,"null.js:104"),"Escape"===B(t)&&(!function(e){const t=e.value.trim();e.value="",t&&Wl(e)}(e),e.blur())})}),o("submit",".js-branch-search",e=>e.preventDefault()),o("click",".js-clear-branch-search",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:119"),i(t.form,"null.js:120");const n=s(t.form,".js-branch-search-field",HTMLInputElement);n.focus(),n.value="",b(n,"input")}),h(".js-branch-destroy, .js-branch-restore",async function(e,t){s(e,"button[type=submit]").blur();const n=function(e){const t=r(e,".js-branch-row").getAttribute("data-branch-name"),n=r(e,".js-branches").querySelectorAll(".js-branch-row");return Array.from(n).filter(e=>e.getAttribute("data-branch-name")===t)}(e);for(const s of n){const e=s.querySelector(".js-branch-delete-target"),t=s.querySelector(".js-loading-spinner");t&&(t.hidden=!1),e&&(e.hidden=!0)}let o=!1;try{await t.text()}catch(i){o=!0,location.reload()}finally{for(const e of n){const t=e.querySelector(".js-branch-delete-target"),n=e.querySelector(".js-loading-spinner");t&&(t.hidden=!1),n&&(n.hidden=!0)}}if(!o){const t=e.classList.contains("js-branch-destroy");for(const e of n)e.classList.toggle("Details--on",t)}}),o("change",".js-repository-import-owner-container input",function(e){let t=e.currentTarget;const n=t.getAttribute("data-upsell")||"",o=t.getAttribute("data-billing-url")||"";s(document,".js-repository-import-billing-url",HTMLAnchorElement).href=o,s(document,".js-repository-import-upsell").classList.toggle("d-none","false"===n),s(document,".js-repository-import-no-upsell").classList.toggle("d-none","true"===n)}),o("socket:message",".repository-import",function(e){i(e instanceof CustomEvent,"null.js:21");const t=e.detail.data;t.redirect_to&&(document.location.href=t.redirect_to,e.stopImmediatePropagation())}),o("change","input.js-repository-import-lfs-opt",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:30");const n=parseInt(t.getAttribute("data-percent-used")),o=r(t,".js-repository-import-lfs-container"),a=t.getAttribute("data-used")||"";s(o,".js-repository-import-lfs-warn").classList.toggle("d-none",!(n>100)),s(o,".js-usage-bar").classList.toggle("exceeded",n>=100),s(o,".js-usage-bar").setAttribute("aria-label",`${n}%`),s(o,".js-repository-import-lfs-progress").style.width=`${n}%`,s(o,"span.js-usage-text").textContent=a}),h(".js-repository-import-author-form",async function(e,t){const n=await t.html();r(e,".js-repository-import-author").replaceWith(n.html)}),o("click",".js-repository-import-projects-cancel-button",function(){const e=s(document,".js-repository-import-projects-cancel-form",HTMLFormElement);v(e)});let zl=!1;function Vl(){return"false"===s(document,".js-privacy-toggle:checked",HTMLInputElement).value}function Kl(){const e=s(document,".js-repo-name");b(e,"change");const t=s(document,'.js-owner-container [aria-checked="true"]'),n=s(document,".js-privacy-toggle[value=false]",HTMLInputElement),o=s(document,".js-privacy-toggle[value=true]",HTMLInputElement);zl||("private"===t.getAttribute("data-default")?(n.checked=!0,b(n,"change")):(o.checked=!0,b(o,"change"))),"false"===t.getAttribute("data-org-allow-public-repos")?(o.disabled=!0,!0===o.checked&&(n.checked=!0,b(n,"change"))):o.disabled=!1,function(e){for(const s of document.querySelectorAll(".js-with-permission-fields"))s.hidden=!e;for(const s of document.querySelectorAll(".js-without-permission-fields"))s.hidden=e;const t=document.querySelector(".errored"),n=document.querySelector("dl.warn");t&&(t.hidden=!e);n&&(n.hidden=!e)}("yes"===t.getAttribute("data-permission")),function(){const e=document.querySelector("#js-upgrade-container");if(!e)return;const t=s(document,"#js-payment-methods-form");e.firstElementChild&&t.appendChild(e.firstElementChild);const n=s(document,"input[name=owner]:checked",HTMLInputElement).value,o=t.querySelector(`.js-upgrade[data-login="${n}"]`);o&&e.appendChild(o)}(),Gl();const r=document.querySelector(".js-quick-install-container");if(r){const e=s(r,".js-quick-install-divider");e.hidden=!0;const t=s(document,"input[name=owner]:checked",HTMLInputElement).parentElement;if(t){const n=t.querySelector(".js-quick-install-list-template");if(n instanceof HTMLTemplateElement){const t=s(r,".js-account-apps");t.innerHTML="",t.append(n.content.cloneNode(!0)),n.children.length>0&&(e.hidden=!1)}}}}function Gl(e){const t=document.querySelector("#js-upgrade-container");if(!t)return;const n=t.querySelector(".js-billing-section"),s=t.querySelector(".js-confirm-upgrade-checkbox");let o=e?e.target:null;o||(o=document.querySelector(".js-privacy-toggle:checked")),i(o instanceof HTMLInputElement,"null.js:94"),"false"===o.value?(t.hidden=!1,n&&n.classList.remove("has-removed-contents"),s&&(i(s instanceof HTMLInputElement,"null.js:100"),s.checked=!0)):(t.hidden=!0,n&&n.classList.add("has-removed-contents"),s&&(i(s instanceof HTMLInputElement,"null.js:107"),s.checked=!1)),Jl()}function Jl(){const e=s(document,"#new_repository");let t=s(e,".js-repo-name").classList.contains("is-autocheck-successful");Vl()&&(t=t&&function(){const e=document.querySelector("#js-upgrade-container");if(!e)return!0;if(e.querySelector(".js-ofac-sanction-notice"))return!1;const t=e.querySelector(".js-confirm-upgrade-checkbox");if(t instanceof HTMLInputElement&&!t.checked)return!1;const n=e.querySelector(".js-zuora-billing-info");if(n&&n.classList.contains("d-none"))return!1;return!0}()),s(e,"button[type=submit]",HTMLButtonElement).disabled=!t}n("#js-upgrade-container .js-zuora-billing-info:not(.d-none)",Jl),n(".page-new-repo",function(){zl=Vl();const e=document.querySelector("#js-upgrade-container");e&&(e.hidden=!0),Kl();const t=document.querySelector(".js-owner-select");t&&t.focus()}),o("click",".js-reponame-suggestion",function(e){const t=s(document,".js-repo-name",HTMLInputElement);t.value=e.currentTarget.textContent,b(t,"input",!1)}),o("click",".js-privacy-toggle",function(){zl=!0}),o("change",".js-privacy-toggle",Gl),o("details-menu-selected",".js-owner-container",Kl),o("change","#js-upgrade-container input",Jl),c("#js-upgrade-container input",Jl),o("autocheck:send",".js-repo-name-auto-check",function(e){i(e instanceof CustomEvent,"null.js:202");const t=e.currentTarget.form;i(t,"null.js:205");const n=s(t,"input[name=owner]:checked",HTMLInputElement).value;e.detail.body.append("owner",n)}),o("autocheck:complete","#repository_name",function(){Jl()}),n(".js-pulse-contribution-data",e=>{!async function(e){const t=e.getAttribute("data-pulse-diffstat-summary-url");let n;try{t&&function(e,t){t.innerHTML="",t.appendChild(e)}(n=await async function(e){return _(document,e)}(t),e)}catch(o){const t=s(e,".js-blankslate-loading"),n=s(e,".js-blankslate-error");t.classList.add("d-none"),n.classList.remove("d-none")}}(e)});const Ql=new WeakMap;let Xl=!1;function Yl(e,t){if(_i(e))return;const n=s(document,".js-site-search-form",HTMLFormElement);let o,r;s(document,".js-site-search").classList.toggle("scoped-search",t),t?(o=d(n,"data-scoped-search-url"),r=d(e,"data-scoped-placeholder")):(o=d(n,"data-unscoped-search-url"),r=d(e,"data-unscoped-placeholder")),n.setAttribute("action",o),e.setAttribute("placeholder",r)}function Zl(e){i(e.currentTarget instanceof Element,"null.js:19");const t=e.currentTarget.querySelector(".js-search-result-feedback");t&&t.classList.add("show")}function eu(e){i(e.currentTarget instanceof Element,"null.js:29");const t=e.currentTarget.querySelector(".js-search-result-feedback");t&&t.classList.remove("show")}function tu(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:41"),t.classList.add("text-gray-dark"),t.classList.remove("link-gray");const n=r(t,".js-search-result-feedback");for(const s of u(n,".js-search-rating",HTMLButtonElement))s.disabled=!0;s(n,".js-search-feedback-form").classList.add("show")}function nu(e){const t=e.value.slice(0,e.selectionEnd),n=e.value.slice(e.selectionEnd),s=0===e.value.trim().length,o=t.match(/(^|\s+)[^\s:]+$/)&&n.match(/^(\s|$)/);return s||o}async function su(e){const t=e.getAttribute("data-contents-url"),n=wt("SEARCH_SUGGESTIONS");if(!t)return;const o=s(document,".js-search-suggester"),r=e.value.slice(0,e.selectionEnd).match(/\S*$/),a=r?r[0]:"",c=new URL(t,window.location.origin),l=new URLSearchParams;l.append("query",a),c.search=l.toString();const u=await g(c.toString());if(""===u.trim())return void ou();o.innerHTML=u,n&&o.classList.remove("d-none"),Ve(s(o,".js-navigation-container"));const d=s(o,".js-search-suggester-helper"),m=e.value.match(/(^|\s)[^\s:]+$/),f=d.parentElement;i(f instanceof HTMLElement,"null.js:52"),m&&(d.textContent=e.value),f.classList.toggle("d-none",n&&!m)}function ou(){s(document,".js-search-suggester").classList.add("d-none")}function ru(e){const t=e.target,n=r(t,".js-navigation-item"),o=s(document,".js-search-suggester-field",HTMLInputElement),i=s(document,".js-search-suggester"),a=n.getAttribute("data-value")||"",c=o.value.slice(0,o.selectionEnd).replace(/\S+$/,""),l=o.value.slice(o.selectionEnd);i.classList.contains("d-none")?v(s(document,"#search_form",HTMLFormElement)):(e.preventDefault(),o.value=c+a+l,nu(o)?su(o):ou())}function iu(e,t){const n=s(t,".js-repo-access-error");n.textContent=e,n.classList.remove("d-none")}function au(){for(const e of document.querySelectorAll(".js-repo-access-error"))e.textContent="",e.classList.add("d-none")}function cu(e){const t=e.querySelectorAll(".js-repo-access-entry").length,n=parseInt(s(e,".js-collab-limit",HTMLElement).getAttribute("data-collab-limit"),10),o=s(e,".js-over-limit",HTMLElement),r=s(e,".js-under-limit",HTMLElement);e.classList.toggle("is-empty",0===t),o.classList.toggle("d-none",t<n),r.classList.toggle("d-none",t>=n)}C("keydown",".js-tree-finder-field",function(e){"Escape"===e.key&&(e.preventDefault(),history.back())}),n(".js-tree-finder-field",{constructor:HTMLInputElement,initialize(e){function t(){!async function e(t){const n=t.getAttribute("data-results");if(!n)return;const o=document.getElementById(n);if(!o)return;const r=Ql.get(o);if(!r){if(Xl)return;Xl=!0;const n=d(o,"data-url");let s;try{s=await U(n)}catch(Jd){return void(Xl=!1)}return Xl=!1,Ql.set(o,s.paths),void e(t)}const a=s(o,".js-tree-browser-result-template").firstElementChild;i(a,"null.js:47");const c=s(o,".js-tree-finder-results"),l=t.value;let u,m;l?(u=yt(l),m=Et(r,l)):m=r,o.classList.toggle("filterable-empty",!m.length);const f=document.createDocumentFragment();for(const i of m.slice(0,50)){const e=a.cloneNode(!0),t=s(e,".js-tree-finder-path",HTMLAnchorElement),n=new URL(t.href);n.pathname=`${n.pathname}/${encodeURI(i)}`,t.href=n.href,t.textContent=i,Re(t,l,u),f.append(e)}c.innerHTML="",c.append(f),ze(c)}(e)}return t(),{add(e){y(e,t),e.focus()},remove(e){E(e,t)}}}}),n(".js-codesearch-nav",function(e){const t=e.querySelector(".selected");if(!t)return;const n=t.offsetLeft,s=t.offsetWidth,o=n+s,r=window.innerWidth;(o-e.scrollLeft>r||o<e.scrollLeft)&&(e.scrollLeft=n-r/2+s/2)}),n(".js-codesearch-count",function(e){const t=e.getAttribute("data-search-type");for(const n of document.querySelectorAll(".js-codesearch-deferred-count"))if(t&&n.getAttribute("data-search-type")===t){const t=e.cloneNode(!0);t.classList.remove("js-codesearch-count"),n.replaceWith(t)}}),C("keyup",".js-site-search-field",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:34");const n=0===t.value.length;n&&"Backspace"===e.key&&t.classList.contains("is-clearable")&&Yl(t,!1),n&&"Escape"===e.key&&Yl(t,!0),t.classList.toggle("is-clearable",n)}),l(".js-site-search-focus",function(e){const t=r(e,".js-chromeless-input-container");t.classList.add("focus"),e.addEventListener("blur",function n(){t.classList.remove("focus"),i(e instanceof HTMLInputElement,"null.js:53"),0===e.value.length&&e.classList.contains("js-site-search-field")&&Yl(e,!0),e.removeEventListener("blur",n)})}),o("submit",".js-site-search-form",function(e){s(e.target,".js-site-search-type-field",HTMLInputElement).value=new URLSearchParams(window.location.search).get("type")||""}),n(".issue-list-item",{subscribe:e=>H(e,"mouseover",Zl)}),n(".issue-list-item",{subscribe:e=>H(e,"mouseleave",eu)}),n(".js-search-rating",{subscribe:e=>H(e,"click",tu)}),n(".js-search-suggester-field",{constructor:HTMLInputElement,initialize(e){su(e),y(e,function(){nu(e)?su(e):ou()})}}),o("focusin",".js-search-suggester-field",function(e){const t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:78"),nu(t)?su(t):ou()}),o("focusout",".js-search-suggester-field",function(){ou()}),o("mousedown",".js-search-suggester",ru),o("navigation:keydown",".js-search-suggester",function(e){i(e instanceof CustomEvent,"null.js:109");const t=e.currentTarget.querySelector('.js-search-suggester .js-navigation-item[aria-selected="true"]');switch(e.detail.hotkey){case"Enter":t?ru(e):v(s(document,"#search_form",HTMLFormElement));break;case"Tab":t&&ru(e);break;case"ArrowLeft":case"ArrowRight":case"Escape":ou()}}),o("click",".js-segmented-nav-button",function(e){e.preventDefault();const t=e.currentTarget,n=d(t,"data-selected-tab"),o=r(t,".js-segmented-nav"),a=o.parentElement;i(a,"null.js:14");for(const s of u(o,".js-segmented-nav-button"))s.classList.remove("selected");t.classList.add("selected");for(const s of u(a,".js-selected-nav-tab"))s.parentElement===a&&s.classList.remove("active");s(document,`.${n}`).classList.add("active")}),n("body.js-print-popup",()=>{window.print(),setTimeout(window.close,1e3)});function lu(e){const t=s(e,".js-authorized-pushers");if(!t.getAttribute("data-limit"))return;const n=parseInt(t.getAttribute("data-limit")),o=t.querySelectorAll(".js-authorized-user-or-team").length;t.classList.toggle("at-limit",o>=n)}async function uu(e){if(!e)return;const t=e.getAttribute("data-url");if(!t)return;let n;try{n=await _(document,t),e.innerHTML="",e.append(n)}catch(Jd){window.location.reload()}}function du(e,t){s(e,".js-add-new-blocked-user",HTMLButtonElement).disabled=!t}function mu(){const e=document.body;i(e,"null.js:13"),e.classList.add("is-sending"),e.classList.remove("is-sent","is-not-sent")}function fu(){const e=document.body;i(e,"null.js:21"),e.classList.add("is-sent"),e.classList.remove("is-sending")}function gu(e){const t=document.body;i(t,"null.js:29"),e&&(s(document,".js-sms-error").textContent=e),t.classList.add("is-not-sent"),t.classList.remove("is-sending")}o("selectmenu:selected",".js-repo-access-team-select",function(e){let t=e.currentTarget;const n=s(t,".js-repo-access-team-select-option.selected").getAttribute("data-team-id")||"",o=s(r(t,".js-repo-access-group"),".js-add-repo-access-field",HTMLInputElement);o.value=n,i(o.form,"null.js:120"),v(o.form)}),h(".js-add-repo-access-form",async function(e,t){au();const n=(await t.json()).json;let o;const i=r(e,".js-repo-access-group");o="collaborators"===i.id?i.querySelector(".js-repo-access-list-invites"):i.querySelector(".js-repo-access-list");const a=e.querySelector(".js-add-repo-access-field");if(a instanceof HTMLInputElement){const e=a.value;a.value="","teams"===i.id&&function(e){const t=document.querySelector(".js-repo-access-team-select");if(t){let n=0;for(const s of t.querySelectorAll(".js-repo-access-team-select-option"))e===s.getAttribute("data-team-id")&&(s.classList.add("has-access"),s.classList.remove("selected")),s.classList.contains("has-access")||n++;0===n&&r(t,".js-repo-access-group").classList.add("no-form")}}(e)}if(n.error)iu(n.error,i);else{if(function(){const e=document.getElementById("collaborators");e&&(s(e,".js-add-new-collab",HTMLButtonElement).disabled=!0)}(),function(){const e=document.querySelector("#teams .js-add-new-collab");e instanceof HTMLButtonElement&&(e.disabled=!0)}(),(()=>{const e=document.querySelector(".js-repo-filled-seats"),t=document.querySelector(".js-repo-access-progress");if(!e||!t)return;const n=e.getAttribute("data-filled-seats"),s=e.getAttribute("data-seats");if(!n||!s)return;const o=parseInt(n)+1,r=parseFloat(s);e.textContent=o.toString(),e.setAttribute("data-filled-seats",o.toString()),t.style.width=`${o/r*100}%`})(),o){o.insertAdjacentHTML("beforeend",n.html);const e=u(o,".js-repo-access-entry");s(e[e.length-1],"a").focus()}if(cu(i),n.seats||0===n.seats){const e=1===n.seats?"seat":"seats",t=document.getElementById("available-seats");t&&(t.innerHTML=`${n.seats} ${e}`)}}}),h(".js-remove-repo-access-form",async function(e,t){if(e.hasAttribute("data-skip-remote"))return;try{await t.text()}catch(o){return void iu(e.getAttribute("data-error-message")||"",r(e,".js-repo-access-group"))}au();const n=r(e,".js-repo-access-entry"),s=r(e,".js-repo-access-group");"teams"===s.id&&function(e){const t=document.querySelector(".js-repo-access-team-select");if(t){const n=t.querySelector(`[data-team-id='${e}']`);n&&n.classList.remove("has-access"),r(t,".js-repo-access-group").classList.remove("no-form")}}(n.getAttribute("data-team-id")||""),n.remove(),cu(s)}),o("change","input.js-repo-data-opt-in",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:16");const n=r(t,".js-repo-data-services"),s=t.checked;for(const o of n.querySelectorAll(".js-repo-data-options"))o.classList.toggle("active",s);for(const o of n.querySelectorAll(".js-repo-data-option"))o.toggleAttribute("disabled",!s),s&&o.removeAttribute("checked")}),o("change",".js-repo-features-form input[type=checkbox]",function(e){let t=e.currentTarget;const n=r(t,".js-repo-option"),o=s(n,".js-status-indicator");o.classList.remove("status-indicator-success","status-indicator-failed"),o.classList.add("status-indicator-loading")}),o("change",".js-repo-actions-settings input[type=radio]",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:41");const n=t.form;i(n,"null.js:44");for(const s of n.querySelectorAll(".js-actions-status-indicator"))s.classList.remove("status-indicator-success","status-indicator-failed","status-indicator-loading");const o=r(t,".js-actions-option"),a=s(o,".js-actions-status-indicator");a.classList.remove("status-indicator-success","status-indicator-failed"),a.classList.add("status-indicator-loading")}),h(".js-repo-features-form",async function(e,t){let n;try{n=await t.html()}catch(o){for(const t of u(e,".status-indicator-loading")){t.classList.remove("status-indicator-loading"),t.classList.add("status-indicator-failed");const e=r(t,".js-repo-option"),n=s(e,"input[type=checkbox]",HTMLInputElement);n.checked=!n.checked}return}for(const s of u(e,".status-indicator-loading"))s.classList.remove("status-indicator-loading"),s.classList.add("status-indicator-success");s(document,".js-repo-nav").replaceWith(n.html)}),o("change",".js-merge-features-form input[type=checkbox]",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:80");const n=t.form;i(n,"null.js:83");for(const s of n.querySelectorAll(".errored"))s.classList.remove("errored");const o=r(t,".js-repo-option"),a=s(o,".js-status-indicator");a.classList.remove("status-indicator-success","status-indicator-failed"),a.classList.add("status-indicator-loading")}),h(".js-merge-features-form",async function(e,t){try{await t.text()}catch(n){for(const t of e.querySelectorAll(".js-select-one-warning"))t.classList.remove("d-none");for(const t of e.querySelectorAll(".status-indicator-loading")){t.classList.remove("status-indicator-loading"),t.classList.add("status-indicator-failed");const e=r(t,".js-repo-option");e.classList.add("errored");const n=s(e,"input[type=checkbox]",HTMLInputElement);n.checked=!n.checked}for(const t of e.querySelectorAll(".status-indicator-success"))t.classList.remove("status-indicator-success");return}for(const s of e.querySelectorAll(".errored"))s.classList.remove("errored");for(const s of e.querySelectorAll(".js-select-one-warning"))s.classList.add("d-none");for(const s of e.querySelectorAll(".status-indicator-loading"))s.classList.remove("status-indicator-loading"),s.classList.add("status-indicator-success")}),o("change","input.js-required-status-toggle",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:144");const n=r(t,".js-protected-branch-settings");s(n,".js-required-statuses").classList.toggle("d-none",!t.checked)}),o("change","input.js-required-status-checkbox",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:152");const n=r(t,".js-protected-branches-item");s(n,".js-required-status-badge").classList.toggle("d-none",!t.checked)}),o("change",".js-authorized-branch-pushers-toggle, input.js-authorized-review-dismisser-toggle",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:163");const n=r(t,".js-protected-branch-options"),o=s(n,".js-authorized-pushers");o.classList.toggle("d-none",!t.checked),s(o,".js-add-protected-branch-user-or-team input",HTMLInputElement).focus()}),o("change",".js-protected-branch-include-admin-toggle",function(e){let t=e.currentTarget;const n=r(t,".js-protected-branch-settings").querySelectorAll(".js-protected-branch-admin-permission");for(const s of n)s.classList.toggle("d-none"),s.classList.toggle("active",!s.classList.contains("d-none"))}),o("change",".js-add-protected-branch-user-or-team",async function(e){if(e.target!==e.currentTarget)return;const t=e.currentTarget;i(t instanceof AutocompleteElement,"null.js:198");const n=t.value;if(!n)return;t.value="";const o=r(t,".js-protected-branch-options"),a=s(o,".js-authorized-users-and-teams"),c=a.querySelector(`div[data-user-or-team-name='${n}']`);if(c)return void s(c,".js-protected-branch-pusher").classList.add("user-already-added");const l=d(t,"data-add-url"),u=new URL(l,window.location.origin),m=new URLSearchParams(u.search.slice(1));m.append("item",n),u.search=m.toString(),a.append(await _(document,u)),lu(o)}),o("click",".js-remove-authorized-user-or-team",function(e){let t=e.currentTarget;const n=r(t,".js-protected-branch-options");r(t,".js-authorized-user-or-team").remove(),lu(n)}),n("#pages-cname-field",{constructor:HTMLInputElement,add(e){y(e,function(){s(document,".js-pages-cname-save-btn",HTMLButtonElement).disabled=e.value===e.defaultValue})}}),n(".js-pages-https-status-form",{constructor:HTMLFormElement,add(e){const t=new Request(e.action,{method:e.method,body:new FormData(e)});(async()=>{try{const s=await _(document,t);e.replaceWith(s)}catch(n){if(!n.response||404!==n.response.status)throw n}})()}}),o("click",".js-repo-team-suggestions-view-all",async function(e){const t=r(e.currentTarget,"ul"),n=d(e.currentTarget,"data-url"),o=u(document,".js-repo-toggle-team:checked",HTMLInputElement).map(e=>e.value),i=await _(document,n);t.innerHTML="",t.append(i);for(const r of o)s(t,`.js-repo-toggle-team[value="${r}"]`,HTMLInputElement).checked=!0}),c(".js-synced-repo-owner-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:25");const n=t.getAttribute("data-sync");if(!n)return;const s=document.querySelectorAll(`[data-sync-with="${n}"]`);for(const o of s)o.textContent=t.value}),h(".js-saved-reply-delete",async function(e,t){await t.text();const n=e.closest(".js-saved-reply-container");i(n,"null.js:10");const s=n.querySelectorAll(".js-saved-reply-list-item").length;n.classList.toggle("has-replies",s>1);const o=e.closest(".js-saved-reply-list-item");i(o,"null.js:16"),o.remove()}),h(".js-user-sessions-revoke",async function(e,t){await t.text();const n=r(e,".js-user-sessions-container");if(r(e,".js-user-session").remove(),n){const e=n.querySelectorAll(".js-user-session").length;n.classList.toggle("has-active-sessions",e>0)}}),n(".js-email-global-unsubscribe-form",function(e){s(e,".js-email-global-unsubscribe-submit",HTMLInputElement).disabled=!0}),o("change",".js-email-global-unsubscribe-form",function(e){const t=e.currentTarget,n=s(t,".js-email-global-unsubscribe-submit",HTMLInputElement),o=u(t,".js-email-global-unsubscribe",HTMLInputElement),r=Array.from(o).some(e=>e.checked!==e.defaultChecked);n.disabled=!r}),h(".js-verify-ssh-key",async function(e,t){await t.html();const n=r(e,"li");s(n,".js-unverified-user-key-notice").remove(),s(n,".js-user-key-icon").classList.remove("unverified-user-key"),e.remove()}),h(".js-leave-collaborated-repo",async function(e,t){await t.html();const n=d(e,"data-repo-id"),o=d(e,"data-owner-id");s(document,`.js-collab-repo[data-repo-id='${n}']`).remove(),document.querySelector(".js-collab-repo")||(s(document,".js-collaborated-repos-empty").hidden=!1,s(document,".js-collaborated-repos").hidden=!0);const r=document.querySelector(`.js-collab-repo-owner[data-owner-id='${o}']`);r&&(r.querySelector(".js-collab-repo")||r.remove())}),h(".js-email-unsubscribe-form",async function(e,t){await t.text();for(const n of document.querySelectorAll(".js-email-unsubscribe-message"))n.hidden=!n.hidden}),h(".js-revoke-access-form",async function(e,t){await t.html();const n=d(e,"data-id"),o=d(e,"data-type-name"),r=s(document,`.js-revoke-item[data-type='${o}'][data-id='${n}']`);r.remove(),r.classList.contains("new-token")&&s(document,".js-flash-new-token").remove()}),o("click",".js-delete-oauth-application-image",function(){const e=s(document,".js-delete-oauth-application-image-form",HTMLFormElement);v(e)}),o("click",".js-new-callback",function(e){e.preventDefault();const t=e.currentTarget,n=r(t,".js-callback-urls"),o=s(n,".js-callback-url").cloneNode(!0);o.classList.remove("is-default-callback"),s(o,"input",HTMLInputElement).value="",n.classList.add("has-many");const a=t.parentNode;i(a instanceof HTMLElement,"null.js:99"),a.insertBefore(o,t)}),o("click",".js-delete-callback",function(e){e.preventDefault();const t=e.currentTarget;r(t,".js-callback-url").remove();const n=r(t,".js-callback-urls");u(n,".js-callback-url",HTMLElement).length<=1&&n.classList.remove("has-many")}),o("click",".js-oauth-application-whitelist .js-deny-this-request",function(e){const t=e.currentTarget,n=t.nextElementSibling;i(n instanceof HTMLInputElement,"null.js:121"),n.value="denied",v(r(t,".js-org-application-access-form",HTMLFormElement))}),o("change",".js-checkbox-scope",function(e){const t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:130");const n=r(t,".js-check-scope-container"),s=u(n,".js-checkbox-scope",HTMLInputElement);for(const o of s)o!==t&&(o.checked=t.checked,o.disabled=t.checked)}),o("click",".js-generate-integration-key",function(){const e=s(document,".js-integration-key-management-wrapper");e.classList.add("downloading"),e.classList.contains("js-integration-key-multi")&&(e.classList.add("has-keys"),setTimeout(function(){const e=s(document,".js-integration-keys-container",HTMLElement);e&&uu(e)},1e3))}),h(".js-remove-integration-key",async function(e,t){try{await t.text()}catch(i){if(!i.response)throw i;r(e,"details").removeAttribute("open");const t=s(document,".js-integration-key-management-wrapper"),n=s(t,".js-error-container"),o=s(n,".js-error-message");switch(i.response.status){case 500:o.textContent="Oops, something went wrong.";break;case 404:o.textContent="Oops, that key could not be found.";break;default:o.textContent=i.response.json.message}return void t.classList.add("error")}const n=d(e,"data-key-id"),o=document.getElementById(n);if(o){const e=r(o,".js-integration-keys-container",HTMLElement);e&&uu(e)}}),o("click",".js-error-dismiss",function(){const e=s(document,".js-integration-keys-container",HTMLElement);e&&uu(e)}),n(".js-block-users-form",function(e){du(e,!1)}),h(".js-block-users-form",async function(e,t){const n=await t.html(),o=s(document,".js-user-block-settings-list"),r=s(o,".js-blocked-list");du(e,!1);const i=s(e,".js-add-blocked-user-field",HTMLInputElement);var a;q(i,""),a=o,document.querySelector(".js-blocked-user-list")||s(a,".blankslate").classList.add("d-none"),r.prepend(n.html)}),o("change",".js-add-blocked-user-completer",function(e){if(e.target!==e.currentTarget)return;const t=e.target;i(t instanceof AutocompleteElement,"null.js:256"),du(r(t,".js-block-users-form"),!!t.value)}),o("change",".js-notification-restrictions-confirmation-needed",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:10"),s(document,".js-notification-restrictions-confirm-modal").classList.toggle("d-none",!t.checked),s(document,".js-notification-restrictions-save").classList.toggle("d-none",t.checked)}),h(".js-send-auth-code",async(e,t)=>{let n;mu();try{n=await t.text()}catch(s){gu(s.response.text)}n&&fu()}),o("click",".js-send-two-factor-code",async function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:56");const n=t.form;i(n,"null.js:58");const o=`${s(n,".js-country-code-select",HTMLSelectElement).value} ${s(n,".js-sms-number",HTMLInputElement).value}`;mu();let r=t.getAttribute("data-authenticity-token");null==r&&(r=a(n,"authenticity_token").value);const c=new FormData;c.append("number",o),c.append("authenticity_token",r);try{const e=d(t,"data-url");await pt(e,{method:"post",body:c}),fu();for(const t of n.querySelectorAll(".js-2fa-enable"))(t instanceof HTMLInputElement||t instanceof HTMLButtonElement)&&(t.disabled=!1);s(n,".js-2fa-otp").focus()}catch(l){if(l.response){gu(await l.response.text())}for(const e of n.querySelectorAll(".js-2fa-enable"))(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&(e.disabled=!0)}}),o("click",".js-enable-enable-two-factor-auth-button",function(){const e=s(document,".js-enable-two-factor-auth-button",HTMLButtonElement);e.disabled=!1,e.removeAttribute("aria-label"),e.classList.remove("tooltipped")}),n(".js-two-factor-sms-fallback-button",function(e){e.addEventListener("toggle",function(e){const t=e.currentTarget;i(t instanceof Element,"null.js:113");for(const n of t.querySelectorAll(".flash"))n.hidden=!0;s(t,".js-configure-sms-fallback").hidden=!1,s(t,".js-verify-sms-fallback").hidden=!0})}),h(".js-two-factor-set-sms-fallback",async(e,t)=>{let n;try{n=await t.text()}catch(o){const t=s(e,".js-configure-sms-fallback"),n=s(e,".js-verify-sms-fallback"),r=t.hidden?n:t,i=s(r,".flash");switch(o.response.status){case 422:case 429:i.textContent=o.response.text,i.hidden=!1}}if(n)switch(n.status){case 200:case 201:window.location.reload();break;case 202:s(e,".js-configure-sms-fallback").hidden=!0,s(e,".js-verify-sms-fallback").hidden=!1,s(e,".js-fallback-otp").focus()}}),n("meta[name=user-login]",{constructor:HTMLMetaElement,initialize(e){const t=e.content;let n=String(!!t.length);try{window.localStorage.setItem("logged-in",n)}catch(r){return}window.addEventListener("storage",function(e){if(e.storageArea!==window.localStorage)return;if("logged-in"!==e.key)return;if("true"!==e.newValue&&"false"!==e.newValue)return;if(e.newValue===n)return;n=e.newValue;const t=s(document,".js-stale-session-flash");t.classList.toggle("is-signed-in","true"===n),t.classList.toggle("is-signed-out","false"===n),t.classList.remove("d-none"),window.addEventListener("popstate",function(e){e.state&&null!=e.state.container&&location.reload()}),o("submit","form",function(e){e.preventDefault()})})}}),document.addEventListener("pjax:end",function(){const e=document.querySelector('meta[name="selected-link"]'),t=e&&e.getAttribute("value");if(t)for(const n of document.querySelectorAll(".js-sidenav-container-pjax .js-selected-navigation-item")){const e=(n.getAttribute("data-selected-links")||"").split(" ").indexOf(t)>=0;n.classList.toggle("selected",e)}}),n(".js-contact-javascript-flag",{constructor:HTMLInputElement,add(e){e.value="true"}}),o("socket:message",".js-notification-indicator",function(e){i(e instanceof CustomEvent,"null.js:10");const t=e.currentTarget,n=e.detail.data;t.setAttribute("aria-label",n.aria_label),t.setAttribute("data-ga-click",n.ga_click),t.querySelector("span").setAttribute("class",n.span_class)});let pu,hu=!1;async function ju(){if(hu)return;hu=!0;const e=`/site/keyboard_shortcuts?url=${window.location.pathname}`;(await X({content:_(document,e),dialogClass:"kb-shortcut-dialog container-xl"})).addEventListener("dialog:remove",function(){hu=!1},{once:!0})}o("click",".js-keyboard-shortcuts",ju),document.addEventListener("keydown",e=>{e.target instanceof Node&&Qe(e.target)||"?"===B(e)&&ju()}),n(".js-site-status-container",{initialize(e){!async function(e){const t=$e(document,"site-status-api-url"),n=await window.fetch(t),o=await n.json(),r=o.status.indicator;if("none"!==r&&e instanceof HTMLElement){s(e,".js-site-status-message").textContent=o.status.description,s(e,".js-site-status-time").setAttribute("datetime",o.page.updated_at);const t="minor"===r?"flash-warn":"flash-error";s(e,".flash").classList.add(t),e.hidden=!1}}(e)}}),l(".js-skip-password-autofill",e=>{i(e instanceof HTMLInputElement,"null.js:9"),e.type="password"}),async function(){wt("SERVICE_WORKER")&&navigator.serviceWorker&&(pu=await navigator.serviceWorker.register("/service-worker.js"))}(),o("click",".js-subscribe-to-web-push",async function(e){if(!window.PushManager)return;e.preventDefault();const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:27"),i(t.form,"null.js:28");const n=s(t.form,"[name=authenticity_token]",HTMLInputElement).value,o=await fetch("/web-push/public-key",{credentials:"same-origin"}),r=(await o.json()).vapid_public_key,a=new Uint8Array(r),c=(await pu.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:a})).toJSON(),l=new FormData;l.append("authenticity_token",n),l.append("endpoint",c.endpoint),l.append("p256dh",c.keys.p256dh),l.append("auth",c.keys.auth),await fetch("/web-push-subscription",{method:"POST",body:l,credentials:"same-origin"})});const vu={},bu={};let Lu=null,yu=0,Eu=0,wu=null;const Tu=1e3,ku=1008,Su=1011,Au=1013,Mu=1012;function Hu(){const e=document.head&&document.head.querySelector("link[rel=web-socket]");if(!e)return;i(e instanceof HTMLLinkElement,"Link must be of type HTMLLinkElement -- null.js:53");try{Lu=new WebSocket(e.href,void 0)}catch(n){if(Lu=null,n.name&&"SecurityError"!==n.name)throw new Error(`error opening WebSocket: ${n.message} (${n.name})`);return null}const t=setTimeout(function(){window.removeEventListener("online",xu),Lu&&Lu.close(),Lu=null},4e3);Lu.addEventListener("open",function(){clearTimeout(t),yu+=1,Eu=0;for(const e in vu)Lu&&Lu.send(`subscribe:${e}`)}),Lu.addEventListener("message",function(e){i(e instanceof MessageEvent,"null.js:84");const t=JSON.parse(String(e.data)),n=t[0],s=t[1];if(!n||!s)return;const o=bu[n]||[];for(const r of o)b(r,"socket:message",{data:s,name:n})})}function xu(e){if(!1===navigator.onLine)return;if(yu>=5||e.code===ku||e.code===Su)return window.removeEventListener("online",xu),Lu&&Lu.close(Tu,"give-up-reconnects"),void(Lu=null);Eu+=1;let t=null;if(e.code===Au||e.code===Mu)t=5e3;else{const e=5*Math.random();t=1e3*Math.pow(2,Eu)*e}wu&&clearTimeout(wu),wu=setTimeout(Hu,t)}function qu(e){const t=e.getAttribute("data-channel");return t?t.split(/\s+/):[]}function Iu(e,t,n){const s=e.getBoundingClientRect().height,o=t.getBoundingClientRect(),r=n.getBoundingClientRect();let i=r.top;i+o.height+10>=s&&(i=Math.max(s-o.height-10,0));let a=r.right;null!=n.closest(".js-build-status-to-the-left")&&(a=Math.max(r.left-o.width-10,0)),t.style.top=`${i}px`,t.style.left=`${a}px`,t.style.right="auto"}async function Cu(e){const t=e.querySelector(".js-dropdown-details"),n=e.querySelector(".js-status-dropdown-menu")||e.closest(".js-status-dropdown-menu");if(!(n instanceof HTMLElement))return;const o=s(n,".js-status-loader"),r=s(n,".js-status-loading"),i=s(n,".js-status-error"),a=d(o,"data-contents-url");let c;r.classList.remove("d-none"),i.classList.add("d-none");try{await Ye(),c=await _(document,a)}catch(l){r.classList.add("d-none"),i.classList.remove("d-none")}if(c){o.replaceWith(c),s(n,".js-details-container").classList.add("open");const e=document.body;e&&t&&n.classList.contains("js-append-menu-to-body")&&Iu(e,n,t)}}function _u(e){let t=e.currentTarget;i(t instanceof Element,"null.js:120"),Cu(t)}async function $u(e){e.preventDefault();const t=e.currentTarget;i(t instanceof HTMLElement,"null.js:15"),await ot(d(t,"data-sudo-required"))&&(t.removeAttribute("data-sudo-required"),t instanceof HTMLFormElement?v(t):t.click())}function Ru(e,t){const n=r(e,".js-survey-question-form"),o=s(n,"input.js-survey-other-text",HTMLInputElement);n.classList.toggle("is-other-selected",t),o.hidden=!t,t?(o.required=!0,o.focus()):o.required=!1,b(o,"change")}window.WebSocket&&(n(".js-socket-channel[data-channel]",{add:function(e){if(Lu||Hu(),Lu)for(const t of qu(e))Lu.readyState!==WebSocket.OPEN||vu[t]||Lu.send(`subscribe:${t}`),vu[t]=!0,null==bu[t]&&(bu[t]=[]),bu[t].push(e)},remove:function(e){for(const t of qu(e)){const n=bu[t];if(n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}}}),window.addEventListener("online",xu),window.addEventListener("offline",function(){Lu&&Lu.close(Tu,"navigator-offline")})),n("form.js-auto-replay-enforced-sso-request",{constructor:HTMLFormElement,initialize(e){v(e)}}),o("toggle",".js-build-status .js-dropdown-details",function(e){const t=e.currentTarget,n=t.querySelector(".js-status-dropdown-menu");if(!n)return;function o(){t.hasAttribute("open")||i()}function r(e){n.contains(e.target)||i()}function i(){t.removeAttribute("open"),n.classList.add("d-none"),t.appendChild(n),t.removeEventListener("toggle",o),window.removeEventListener("scroll",r)}t.addEventListener("toggle",o),n.classList.contains("js-close-menu-on-scroll")&&window.addEventListener("scroll",r,{capture:!0,passive:!0}),n.classList.remove("d-none"),s(n,".js-details-container").classList.add("open");const a=document.body;a&&n.classList.contains("js-append-menu-to-body")&&(a.appendChild(n),Iu(a,n,t))},{capture:!0}),o("click",".js-status-retry",e=>{Cu(e.currentTarget)}),n(".js-build-status",{add(e){e.addEventListener("mouseenter",_u,{once:!0})},remove(e){e.removeEventListener("mouseenter",_u)}}),o("submit","form[data-sudo-required]",$u),o("click","button[data-sudo-required]",$u),o("change","select.js-survey-select",function(e){let t=e.currentTarget;i(t instanceof HTMLSelectElement,"null.js:24"),Ru(t,t.options[t.selectedIndex].classList.contains("js-survey-option-other"))}),o("change","input.js-survey-radio",function(e){let t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:30"),Ru(t,t.classList.contains("js-survey-radio-other"))}),n(".js-tagsearch-popover",{constructor:HTMLElement,subscribe(e){const t=s(document,".js-file-line-container, .js-code-block-container"),n=s(e,".js-tagsearch-popover-content"),o=new WeakMap,r=new WeakMap;let a;async function c(n){const s=function(e,t,n){let s,o;if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t,n);e&&(s=e.offsetNode,o=e.offset)}else if(document.caretRangeFromPoint){const e=document.caretRangeFromPoint(t,n);e&&(s=e.startContainer,o=e.startOffset)}if(!s||"number"!=typeof o)return;const r=s.textContent;if(!r)return null;const i=function(e,t,n){let s;for(;s=t.exec(e);){const e=s.index+s[0].length;if(s.index<n&&n<e)return[s[0],s.index,e]}return null}(r,e,o);if(!i)return null;const a=document.createRange();return a.setStart(s,i[1]),a.setEnd(s,i[2]),a}(/\w+[!?]?/g,n.clientX,n.clientY);if(!s)return;const a=s.commonAncestorContainer.parentElement;i(a,"null.js:23");for(const e of a.classList)if(["pl-token","pl-c","pl-s","pl-k"].includes(e))return;const c=s.toString();if(!c||c.match(/\n|\s|[();&.=",]/))return;let u=r.get(a);if(u||(u=new Set,r.set(a,u)),u.has(c))return;u.add(c);let m=d(e,"data-tagsearch-lang");if("HTML+ERB"===m){if(!a.closest(".pl-sre"))return;m="Ruby"}if(t.classList.contains("js-code-block-container")&&!(m=function(e){const t=e.closest(".highlight");if(t)for(const n of t.classList)switch(n){case"highlight-source-go":return"Go";case"highlight-source-js":return"JavaScript";case"highlight-source-python":return"Python";case"highlight-source-ruby":return"Ruby";case"highlight-source-ts":return"TypeScript"}return null}(a)))return;const f=await async function(e,t,n){const s=d(e,"data-tagsearch-url"),o=d(e,"data-tagsearch-path"),r=d(e,"data-tagsearch-ref"),i=new URL(s,window.location.origin),a=new URLSearchParams;a.set("q",t),a.set("context",o),a.set("ref",r),a.set("lang",n),i.search=a.toString();const c=await g(i);return/js-tagsearch-no-definitions/.test(c)?"":c}(e,c,m);if(!f)return;const p=document.createElement("span");p.classList.add("pl-token"),p.addEventListener("click",l),o.set(p,f),s.surroundContents(p)}function l(t){if(t.altKey||t.ctrlKey||t.metaKey)return;const s=t.currentTarget;i(s instanceof HTMLElement,"null.js:72"),s===a?m():(function(e){a&&a.classList.remove("active");(a=e).classList.add("active"),n.innerHTML=o.get(e)||"",u(e);const t=e.closest(".js-file-line");t&&function(e){const t=e.id.replace(/^LC/,""),s=n.querySelector(".js-tagsearch-looking-at-def"),o=n.querySelector(".js-tagsearch-defined-on");if(!t||!s||!o)return;d(s,"data-row")===t&&(s.hidden=!1,o.hidden=!0)}(t)}(s),function(){if(!e.hidden)return;e.hidden=!1,document.addEventListener("click",p),document.addEventListener("keyup",h),window.addEventListener("resize",f,{passive:!0})}()),t.preventDefault()}function u(t){const n=t.getClientRects()[0];e.style.position="absolute",e.style.top=`${window.scrollY+n.bottom+7}px`,e.style.left=`${window.scrollX+n.left}px`}function m(){e.hidden||(e.hidden=!0,a&&a.classList.remove("active"),a=null,document.removeEventListener("click",p),document.removeEventListener("keyup",h),window.removeEventListener("resize",f))}function f(){a instanceof HTMLElement&&u(a)}function p(t){const n=t.target;n instanceof Node&&(i(a,"null.js:149"),e.contains(n)||a.contains(n)||m())}function h(e){switch(e.key){case"Escape":m()}}return t.addEventListener("mousemove",c),{unsubscribe(){t.removeEventListener("mousemove",c)}}}});const Nu=new k;const Pu=j(async function(){const e=s(document,".js-quick-pull-new-branch-name",HTMLInputElement),t=e.value,n=e.getAttribute("data-generated-branch");if(null==n)throw new Error("Missing attribute `data-generated-branch`");const o=s(document,".js-quick-pull-normalization-info"),r=e.getAttribute("data-check-authenticity-token")||"",i=new FormData;i.append("ref",t),i.append("authenticity_token",r);const a=d(e,"data-check-url"),c=U(a,{method:"post",body:i}),l=await Nu.push(c);try{!function(r){if(t!==e.value)return;const i=r.normalized_ref;o.innerHTML=null==r.message_html?"":r.message_html,i||(s(o,"code").textContent=n)}(l)}catch(Jd){e.value}},200);function Du(){return document.querySelectorAll(".js-template-editor").length>0}function Fu(e){e.classList.toggle("section-focus")}function Ou(){return document.querySelectorAll(".js-template-form.is-loading").length>0?"loading":document.querySelectorAll(".js-template-form.is-errored").length>0?"error":"ok"}function Bu(){const e=s(document,".js-commit-templates-form",HTMLFormElement),t=s(e,".js-blob-submit",HTMLButtonElement),n=s(document,".js-template-commit-form-error-message"),o=s(document,".js-template-commit-form-loading-message");switch(Ou()){case"loading":n.classList.add("d-none"),o.classList.remove("d-none"),e.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled");break;case"error":n.classList.remove("d-none"),o.classList.add("d-none"),e.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled");break;default:n.classList.add("d-none"),o.classList.add("d-none"),e.removeAttribute("disabled"),t.removeAttribute("disabled")}}async function Uu(e){e.classList.add("is-loading"),Bu();const t=s(e,'[name="filename"]',HTMLInputElement).value,n={};for(const r of u(document,".js-template-form",HTMLFormElement)){const e=s(r,'[name="filename"]',HTMLInputElement).value;n[e]={};for(const t of xe(r)){var o=ee(t,2);const s=o[0],r=o[1];n[e][s]=r}}const i=new FormData(e);i.append("current",t),i.append("templates",JSON.stringify(n));const a=await U(e.action,{method:"POST",body:i}),c=f(document,a.html);r(e,".js-template-preview").replaceWith(c);const l=s(document,".js-hidden-template-fields");let d=l.querySelector(`[data-filename="${a.filename}"]`);d instanceof HTMLInputElement?d.value=a.markdown:((d=document.createElement("input")).type="hidden",d.name=`templates[][${a.filename}]`,d.setAttribute("data-filename",a.filename),d.value=a.markdown,l.append(d)),e.classList.remove("is-loading"),Bu()}function Wu(){for(const e of u(document,".js-template-form",HTMLFormElement))Uu(e)}function zu(e){if(function(e){let t;try{t=new URL(e.url)}catch(n){return!0}return t.host!==window.location.host}(e)||function(e){return/[?&]_pjax=/.test(e.url)}(e))return;const t=function(){const e=document.querySelector(".js-timeline-marker");return null!=e?e.getAttribute("data-last-modified"):null}();t&&e.headers.set("X-Timeline-Last-Modified",t)}function Vu(e){!function(e){const t=e.closest("details, .js-details-container");if(!t)return;i(t instanceof HTMLElement,"null.js:79"),"DETAILS"===t.nodeName?t.setAttribute("open","open"):Tt(t)||ke(t)}(e);const t=e.querySelector(`[href='#${e.id}']`);t&&t.click()}function Ku(){return window.location.hash.slice(1)}n(".js-custom-fields-drag-container",e=>{nt.create(e,{draggable:".js-custom-field-draggable",handle:".js-draggable-box-icon"})}),n(".js-template-form .js-issue-labels",{add(e){const t=e.closest(".js-issue-template-labels-container");if(!t)return;const n=s(t,".js-issue-template-labels",HTMLInputElement);n.value="";for(const s of e.children){const e=s.getAttribute("data-name");e&&!n.value.includes(e)&&(""===n.value?n.value=e:n.value=`${n.value}, ${e}`)}}}),n(".js-template-form .js-issue-assignees",{add(e){const t=e.closest(".js-issue-template-assignees-container");i(t instanceof HTMLElement,"null.js:106");const n=s(t,".js-issue-template-assignees",HTMLInputElement);n.value="";for(const s of e.children){const e=s.querySelector("span");if(e){const t=e.getAttribute("data-assignee-name");t&&!n.value.includes(t)&&(""===n.value?n.value=t:n.value=`${n.value}, ${t}`)}}}}),o("change",".js-quick-pull-choice-option",function(e){if(!Du())return;const t=e.currentTarget;i(t instanceof HTMLInputElement,"null.js:134"),s(document,".js-commit-branch-name").classList.toggle("d-none","quick-pull"!==t.value),s(document,".js-quick-pull-new-branch-name").toggleAttribute("required","quick-pull"===t.value)}),c(".js-quick-pull-new-branch-name",function(e){if(!Du())return;const t=e.target;i(t instanceof HTMLInputElement,"null.js:148");const n=t.value;s(document,".js-quick-pull-target-branch",HTMLInputElement).value=n,n.length&&Pu()}),c(".js-synced-template-input",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:159");const n=t.getAttribute("data-sync");if(!n)return;const o=r(t,".js-sync-container"),a=u(o,`[data-sync-with="${n}"]`),c=t.value;if(""!==c.trim()){for(const e of a)e.textContent=t.value;if("name"===n){s(o,".js-sync-filename",HTMLInputElement).value=`${c.replace(/[^\w]/g,"-")}.md`.toLowerCase()}}else for(const s of a){const e=s.getAttribute("data-sync-blank");e&&(s.innerHTML=`<span class="text-gray">${e}</span>`)}}),o("submit",".js-template-form",function(e){e.preventDefault();const t=e.currentTarget;i(t instanceof HTMLFormElement,"null.js:299"),Uu(t)}),o("click",".js-toggle-template-commit",function(){const e=s(document,".js-template-commit-pane");e.classList.toggle("d-none"),e.classList.contains("d-none")||Wu()}),o("submit",".js-commit-templates-form",function(e){"ok"!==Ou()&&e.preventDefault(),Bu()}),o("click",".js-refresh-template-content",async function(e){const t=e.currentTarget,n=r(t,".js-template-form"),o=s(n,".js-template-content-preview");o.innerHTML='<span class="text-gray">Loading preview...</span>';const i=s(n,".js-template-content-textarea",HTMLTextAreaElement).value,a=t.getAttribute("data-markdown-preview-url"),c=t.getAttribute("data-markdown-preview-token");if(!a||!c)return;const l=new FormData;l.append("markdown",i),l.append("authenticity_token",c);const u=await g(a,{method:"POST",body:l});o.innerHTML=u}),o("click",".js-custom-template-toggle",e=>{const t=e.target,n=r(t,".js-template-preview"),o=!n.classList.contains("expand-preview");if(function(){const e=document.querySelectorAll(".js-template-preview");for(const t of e)t.classList.remove("expand-preview")}(),o)n.classList.add("expand-preview"),n.scrollIntoView({behavior:"smooth",block:"start"});else{Uu(s(n,".js-template-form",HTMLFormElement))}}),o("click",".js-remove-template-button",function(e){const t=r(e.target,".js-template-preview"),n=d(t,"data-filename"),o=s(document,".js-hidden-template-fields"),i=s(document,".js-toggle-template-commit"),a=o.querySelector(`[data-filename="${n}"]`);a&&a.remove(),i.removeAttribute("disabled"),t.remove(),Wu()}),o("click",".js-append-custom-field-option",function(e){const t=e.target,n=t.getAttribute("data-source");if(!n)return;const o=s(document,`#${n}`);t.insertAdjacentHTML("beforebegin",o.innerHTML)}),o("click",".js-remove-custom-field-option",function(e){r(e.target,".js-custom-field-option").remove()}),o("click",".js-edit-custom-field",e=>{Fu(r(e.target,".js-custom-field-editor"))}),o("click",".js-edit-custom-field-header",function(e){r(e.target,".js-custom-field-header").classList.toggle("section-focus"),s(document,".js-toggle-template-commit").removeAttribute("disabled")}),o("click",".js-remove-custom-field",function(e){r(e.target,".js-custom-field-editor").remove()}),o("details-menu-selected",".js-add-template",function(e){let t=e.target;const n=s(document,".js-templates-container"),o=s(document,".js-toggle-template-commit"),r=t.getAttribute("data-source");if(!r)return;o.removeAttribute("disabled");const i=s(document,`#${r}`);n.insertAdjacentHTML("beforeend",i.innerHTML)}),o("click",".js-add-custom-field-button",function(e){const t=e.currentTarget,n=r(t,".js-template-preview"),o=t.getAttribute("data-source");if(!o)return;const i=s(document,`#${o}`),a=f(document,i.innerHTML).firstElementChild;a instanceof HTMLElement&&(Fu(a),s(n,".js-custom-fields-container").insertAdjacentElement("beforeend",a))}),n(".js-discussion",function(){let e;function t(){e=new WeakSet(document.querySelectorAll(".js-timeline-item"))}t(),document.addEventListener("pjax:end",t),n(".js-timeline-item",t=>{e.has(t)||function(e){const t=document.querySelector(".js-global-screen-reader-notice");t&&(t.textContent="",t.textContent=function(e){return(e.innerText||"").trim()}(e))}(t)})}),h(".js-needs-timeline-marker-header",function(e,t,n){zu(n)}),o("deprecatedAjaxSend","[data-remote]",function(e){i(e instanceof CustomEvent,"null.js:50"),zu(e.detail.request)}),oe(function(e){let t=e.target;const n=Ku();n&&!t&&async function(e){const t=document.getElementById("js-timeline-progressive-loader");if(!t)return;const n=t.getAttribute("data-timeline-item-src");if(!n)return;const s=new URL(n,window.location.origin),o=new URLSearchParams(s.search.slice(1));let r;o.append("anchor",e),s.search=o.toString();try{r=await _(document,s)}catch(l){return}const i=r.querySelector(".js-timeline-item");if(!i)return;const a=i.getAttribute("data-gid");if(!a)return;const c=document.querySelector(`.js-timeline-item[data-gid='${a}']`);if(c){c.replaceWith(i);const t=document.getElementById(e);t&&Vu(t)}else{const t=document.getElementById("js-progressive-timeline-item-container");t&&t.replaceWith(r);const n=document.getElementById(e);n&&Vu(n)}}(n)}),n(".js-timeline-progressive-focus-container",function(e){const t=Ku();if(!t)return;const n=document.getElementById(t);n&&e.contains(n)&&Vu(n)});const Gu="navigationStart";function Ju(){const e={};e.crossBrowserLoadEvent=Date.now();const t=window.performance&&window.performance.timing;if(t)for(const s in t){const n=t[s];"number"==typeof n&&(e[s]=n)}else{const t=function(){const e=ge(Gu);if(e)return parseInt(e,10)}();null!=t&&(e.simulatedNavigationStart=t)}const n=function(){if(window.performance&&"timeOrigin"in window.performance&&window.performance.getEntriesByType){const e=window.performance.getEntriesByType("paint");if(e.length){const t=e.find(e=>"first-paint"===e.name);if(t)return Math.round((performance.timeOrigin+t.startTime)/1e6)}}}();return null!=n&&(e.chromeFirstPaintTime=n),e}function Qu(e){const t=r(e,".js-topic-save-notice-container"),n=s(t,".js-repo-topics-save-notice");n.classList.remove("d-none"),n.classList.add("d-inline-block","anim-fade-in"),setTimeout(()=>{n.classList.remove("d-inline-block"),n.classList.add("d-none")},1900)}function Xu(e){const t=s(e,".js-topic-suggestions-box");t.querySelector(".js-topic-suggestion")||t.remove()}async function Yu(e){const t=e.querySelector(".js-topic-suggestions-container");if(!t)return;const n=d(t,"data-url"),s=await _(document,n);t.innerHTML="",t.appendChild(s)}function Zu(){}function ed(){return!!window.u2f||"true"===$e(document,"u2f-support")}window.performance||window.performance.timing||window.addEventListener("pagehide",function(){ye(Gu,Date.now().toString())}),async function(){await x,await new Promise(e=>setTimeout(e));const e=function(){const e=[],t=window.performance;if(t&&t.getEntriesByType)for(const n of t.getEntriesByType("resource")){const t={};e.push(t);for(const e in n){const s=n[e];"number"!=typeof s&&"string"!=typeof s||(t[e]=s)}}return e}();e.length&&A({resourceTimings:e});const t=function(){const e=[],t=window.performance;if(t&&t.getEntriesByType)for(const s of t.getEntriesByType("navigation")){const t={};e.push(t);for(const e in s){const n=s[e];"number"!=typeof n&&"string"!=typeof n||(t[e]=n)}}const n=Ju();return n&&0===e.length&&e.push({name:location.href,entryType:"navigation",startTime:0,duration:n.loadEventEnd-n.navigationStart,initiatorType:"navigation",nextHopProtocol:"http/1.1",type:"navigate",redirectStart:n.redirectStart,redirectEnd:n.redirectEnd,fetchStart:n.fetchStart,domainLookupStart:n.domainLookupStart,domainLookupEnd:n.domainLookupEnd,connectStart:n.connectStart,connectEnd:n.connectEnd,secureConnectionStart:n.secureConnectionStart,requestStart:n.requestStart,responseStart:n.responseStart,responseEnd:n.responseEnd,unloadEventStart:n.unloadEventStart,unloadEventEnd:n.unloadEventEnd,domInteractive:n.domInteractive,domContentLoadedEventStart:n.domContentLoadedEventStart,domContentLoadedEventEnd:n.domContentLoadedEventEnd,domComplete:n.domComplete,loadEventStart:n.loadEventStart,loadEventEnd:n.loadEventEnd}),e}();t.length&&A({navigationTimings:t})}(),o("click",".js-toggler-container .js-toggler-target",function(e){if(i(e instanceof MouseEvent,"null.js:41"),i(e.currentTarget,"null.js:42"),0!==e.button)return;const t=e.currentTarget.closest(".js-toggler-container"),n=e.currentTarget.closest(".js-toggler-container-secondary");t.classList.toggle("on"),n&&n.classList.toggle("on")}),h(".js-toggler-container",async(e,t)=>{e.classList.remove("success","error"),e.classList.add("loading");try{await t.text(),e.classList.add("success")}catch(n){e.classList.add("error")}finally{e.classList.remove("loading")}}),h(".js-accept-topic-form",async function(e,t){await t.html();const n=r(e,".js-topic-form-area"),o=r(e,".js-topic-suggestion"),i=s(n,".js-template"),a=s(n,".js-tag-input-selected-tags"),c=i.cloneNode(!0),l=s(o,'input[name="input[name]"]',HTMLInputElement).value;s(c,"input",HTMLInputElement).value=l,s(c,".js-placeholder-tag-name").replaceWith(l),c.classList.remove("d-none","js-template"),a.appendChild(c),o.remove(),Yu(n),Xu(n),Qu(e)}),o("click",".js-repo-topics-form-done",function(){!async function(){const e=s(document,".js-topics-list-container"),t=d(e,"data-url"),n=await _(document,t);e.innerHTML="",e.appendChild(n)}()}),h(".js-decline-topic-form",async function(e,t){await t.html(),Qu(e);const n=r(e,".js-topic-form-area");r(e,".js-topic-suggestion").remove(),Yu(n),Xu(n)}),h(".js-repo-topics-edit-form",async function(e,t){const n=r(e,".js-topic-form-area");n.classList.remove("errored"),s(n,".js-topic-error").textContent="";for(const s of n.querySelectorAll(".js-tag-input-tag.invalid-topic"))s.classList.remove("invalid-topic");try{await t.json(),Qu(e),Yu(n)}catch(o){const t=o.response.json;if(t.message&&(n.classList.add("errored"),s(n,".js-topic-error").textContent=t.message),t.invalidTopics){const n=u(e,".js-topic-input",HTMLInputElement);for(const e of t.invalidTopics)for(const t of n)if(t.value===e){r(t,".js-tag-input-tag").classList.add("invalid-topic")}}}}),o("tags:changed",".js-repo-topics-edit-form",function(e){let t=e.target;i(t instanceof HTMLFormElement,"null.js:139"),v(t)}),o("click",".js-reveal-hidden-topics",function(e){const t=e.target,n=r(t,".js-hidden-topics-container").querySelector(".js-hidden-topics");n&&(n.classList.remove("d-none"),t.remove())}),n(".js-touch-events",{add(e){e.addEventListener("click",Zu)},remove(e){e.removeEventListener("click",Zu)}}),o("click",".js-hide-content-attachment",function(e){e.preventDefault(),function(e){const t=r(e,".js-content-attachment"),n=d(r(e,"[data-unfurl-hide-url]"),"data-unfurl-hide-url"),s=d(r(e,"[data-unfurl-authenticity-token]"),"data-unfurl-authenticity-token"),o=d(e,"data-id"),i=new XMLHttpRequest;i.onload=function(){i.status>=200&&i.status<300&&t.remove()},i.open("POST",n);const a=new FormData;a.append("id",o),a.append("authenticity_token",s),i.send(a)}(e.currentTarget)}),n(".js-content-attachment .max--md",function(e){const t=s(e,".markdown-body");var n;(t.clientHeight<188||""===(n=t).textContent.trim()&&1===n.querySelectorAll("img").length)&&(e.classList.remove("max--md"),s(e,".Details-content--closed").hidden=!0,s(e,".Details-content--open").hidden=!0)}),requestIdleCallback(()=>{const e=kt();if(e){const t="https:"===location.protocol?"secure":"";document.cookie=`tz=${encodeURIComponent(e)}; path=/; ${t}`}}),function(){var e="chrome"in window&&window.navigator.userAgent.indexOf("Edge")<0;if(!("u2f"in window)&&e){var t,n=window.u2f={};n.EXTENSION_ID="kmendfapggjehodndflmmgagdbamhnfd",n.MessageTypes={U2F_REGISTER_REQUEST:"u2f_register_request",U2F_REGISTER_RESPONSE:"u2f_register_response",U2F_SIGN_REQUEST:"u2f_sign_request",U2F_SIGN_RESPONSE:"u2f_sign_response",U2F_GET_API_VERSION_REQUEST:"u2f_get_api_version_request",U2F_GET_API_VERSION_RESPONSE:"u2f_get_api_version_response"},n.ErrorCodes={OK:0,OTHER_ERROR:1,BAD_REQUEST:2,CONFIGURATION_UNSUPPORTED:3,DEVICE_INELIGIBLE:4,TIMEOUT:5},n.getMessagePort=function(e){if("undefined"!=typeof chrome&&chrome.runtime){var t={type:n.MessageTypes.U2F_SIGN_REQUEST,signRequests:[]};chrome.runtime.sendMessage(n.EXTENSION_ID,t,function(){chrome.runtime.lastError?n.getIframePort_(e):n.getChromeRuntimePort_(e)})}else n.isAndroidChrome_()?n.getAuthenticatorPort_(e):n.isIosChrome_()?n.getIosPort_(e):n.getIframePort_(e)},n.isAndroidChrome_=function(){var e=navigator.userAgent;return-1!=e.indexOf("Chrome")&&-1!=e.indexOf("Android")},n.isIosChrome_=function(){return["iPhone","iPad","iPod"].indexOf(navigator.platform)>-1},n.getChromeRuntimePort_=function(e){var t=chrome.runtime.connect(n.EXTENSION_ID,{includeTlsChannelId:!0});setTimeout(function(){e(new n.WrappedChromeRuntimePort_(t))},0)},n.getAuthenticatorPort_=function(e){setTimeout(function(){e(new n.WrappedAuthenticatorPort_)},0)},n.getIosPort_=function(e){setTimeout(function(){e(new n.WrappedIosPort_)},0)},n.WrappedChromeRuntimePort_=function(e){this.port_=e},n.formatSignRequest_=function(e,s,o,r,i){if(void 0===t||t<1.1){for(var a=[],c=0;c<o.length;c++)a[c]={version:o[c].version,challenge:s,keyHandle:o[c].keyHandle,appId:e};return{type:n.MessageTypes.U2F_SIGN_REQUEST,signRequests:a,timeoutSeconds:r,requestId:i}}return{type:n.MessageTypes.U2F_SIGN_REQUEST,appId:e,challenge:s,registeredKeys:o,timeoutSeconds:r,requestId:i}},n.formatRegisterRequest_=function(e,s,o,r,i){if(void 0===t||t<1.1){for(var a=0;a<o.length;a++)o[a].appId=e;var c=[];for(a=0;a<s.length;a++)c[a]={version:s[a].version,challenge:o[0],keyHandle:s[a].keyHandle,appId:e};return{type:n.MessageTypes.U2F_REGISTER_REQUEST,signRequests:c,registerRequests:o,timeoutSeconds:r,requestId:i}}return{type:n.MessageTypes.U2F_REGISTER_REQUEST,appId:e,registerRequests:o,registeredKeys:s,timeoutSeconds:r,requestId:i}},n.WrappedChromeRuntimePort_.prototype.postMessage=function(e){this.port_.postMessage(e)},n.WrappedChromeRuntimePort_.prototype.addEventListener=function(e,t){var n=e.toLowerCase();"message"==n||"onmessage"==n?this.port_.onMessage.addListener(function(e){t({data:e})}):console.error("WrappedChromeRuntimePort only supports onMessage")},n.WrappedAuthenticatorPort_=function(){this.requestId_=-1,this.requestObject_=null},n.WrappedAuthenticatorPort_.prototype.postMessage=function(e){var t=n.WrappedAuthenticatorPort_.INTENT_URL_BASE_+";S.request="+encodeURIComponent(JSON.stringify(e))+";end";document.location=t},n.WrappedAuthenticatorPort_.prototype.getPortType=function(){return"WrappedAuthenticatorPort_"},n.WrappedAuthenticatorPort_.prototype.addEventListener=function(e,t){if("message"==e.toLowerCase()){window.addEventListener("message",this.onRequestUpdate_.bind(this,t),!1)}else console.error("WrappedAuthenticatorPort only supports message")},n.WrappedAuthenticatorPort_.prototype.onRequestUpdate_=function(e,t){var n=JSON.parse(t.data),s=(n.intentURL,n.errorCode,null);n.hasOwnProperty("data")&&(s=JSON.parse(n.data)),e({data:s})},n.WrappedAuthenticatorPort_.INTENT_URL_BASE_="intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE",n.WrappedIosPort_=function(){},n.WrappedIosPort_.prototype.postMessage=function(e){var t=JSON.stringify(e),n="u2f://auth?"+encodeURI(t);location.replace(n)},n.WrappedIosPort_.prototype.getPortType=function(){return"WrappedIosPort_"},n.WrappedIosPort_.prototype.addEventListener=function(e,t){"message"!==e.toLowerCase()&&console.error("WrappedIosPort only supports message")},n.getIframePort_=function(e){var t="chrome-extension://"+n.EXTENSION_ID,s=document.createElement("iframe");s.src=t+"/u2f-comms.html",s.setAttribute("style","display:none"),document.body.appendChild(s);var o=new MessageChannel,r=function(t){"ready"==t.data?(o.port1.removeEventListener("message",r),e(o.port1)):console.error('First event on iframe port was not "ready"')};o.port1.addEventListener("message",r),o.port1.start(),s.addEventListener("load",function(){s.contentWindow.postMessage("init",t,[o.port2])})},n.EXTENSION_TIMEOUT_SEC=30,n.port_=null,n.waitingForPort_=[],n.reqCounter_=0,n.callbackMap_={},n.getPortSingleton_=function(e){n.port_?e(n.port_):(0==n.waitingForPort_.length&&n.getMessagePort(function(e){for(n.port_=e,n.port_.addEventListener("message",n.responseHandler_);n.waitingForPort_.length;)n.waitingForPort_.shift()(n.port_)}),n.waitingForPort_.push(e))},n.responseHandler_=function(e){var t=e.data,s=t.requestId;if(s&&n.callbackMap_[s]){var o=n.callbackMap_[s];delete n.callbackMap_[s],o(t.responseData)}else console.error("Unknown or missing requestId in response.")},n.sign=function(e,s,o,r,i){void 0===t?n.getApiVersion(function(a){t=void 0===a.js_api_version?0:a.js_api_version,console.log("Extension JS API Version: ",t),n.sendSignRequest(e,s,o,r,i)}):n.sendSignRequest(e,s,o,r,i)},n.sendSignRequest=function(e,t,s,o,r){n.getPortSingleton_(function(i){var a=++n.reqCounter_;n.callbackMap_[a]=o;var c=void 0!==r?r:n.EXTENSION_TIMEOUT_SEC,l=n.formatSignRequest_(e,t,s,c,a);i.postMessage(l)})},n.register=function(e,s,o,r,i){void 0===t?n.getApiVersion(function(a){t=void 0===a.js_api_version?0:a.js_api_version,console.log("Extension JS API Version: ",t),n.sendRegisterRequest(e,s,o,r,i)}):n.sendRegisterRequest(e,s,o,r,i)},n.sendRegisterRequest=function(e,t,s,o,r){n.getPortSingleton_(function(i){var a=++n.reqCounter_;n.callbackMap_[a]=o;var c=void 0!==r?r:n.EXTENSION_TIMEOUT_SEC,l=n.formatRegisterRequest_(e,s,t,c,a);i.postMessage(l)})},n.getApiVersion=function(e,t){n.getPortSingleton_(function(s){if(s.getPortType){var o;switch(s.getPortType()){case"WrappedIosPort_":case"WrappedAuthenticatorPort_":o=1.1;break;default:o=0}e({js_api_version:o})}else{var r=++n.reqCounter_;n.callbackMap_[r]=e;var i={type:n.MessageTypes.U2F_GET_API_VERSION_REQUEST,timeoutSeconds:void 0!==t?t:n.EXTENSION_TIMEOUT_SEC,requestId:r};s.postMessage(i)}})}}}();const td=1;class nd extends Error{constructor(e,t){super(e),this.code=t}}function sd(e){return void 0===e.errorCode||0===e.errorCode?td:e.errorCode}function od(){const e=s(document,".js-u2f-auth-form",HTMLFormElement),t=s(e,".js-u2f-auth-response",HTMLInputElement),n=e.getAttribute("data-app-id"),o=e.getAttribute("data-challenge");if(null==o)return;const r=e.getAttribute("data-sign-requests");if(null==r)return;const i=JSON.parse(r);for(const s of document.querySelectorAll(".js-u2f-error"))s.hidden=!0;const a=document.querySelector(".js-u2f-login-waiting");null!=a&&(a.hidden=!1),function(e,t,n){return new Promise(function(s,o){window.u2f.sign(e,t,n,function(e){e.keyHandle?s(e):o(new nd("Signing request failed",sd(e)))})})}(n,o,i).then(function(n){t.value=JSON.stringify(n),b(e,"submit")&&e.submit()},function(e){let t=".js-u2f-auth-error";switch(e.code){case 4:t=".js-u2f-auth-not-registered-error";break;case 5:t=".js-u2f-auth-timeout"}const n=document.querySelector(t);null!=n&&(n.hidden=!1),null!=a&&(a.hidden=!0)})}function rd(e,t,n){if(!n){const n=e.getAttribute(t);if(!n)return;return JSON.parse(n)}e.setAttribute(t,JSON.stringify(n))}function id(e){const t=rd(s(document,".js-add-u2f-registration-form",HTMLFormElement),"data-sign-requests",e);return t||[]}function ad(e){const t=rd(s(document,".js-add-u2f-registration-form",HTMLFormElement),"data-register-requests",e);return t||[]}function cd(e){e.register_requests&&ad(e.register_requests),e.sign_requests&&id(e.sign_requests)}function ld(e,t){const n=s(document,".js-new-u2f-registration");n.classList.add("is-showing-error"),n.classList.remove("is-sending");for(const s of n.querySelectorAll(".js-u2f-error"))s.classList.add("d-none");const o=s(n,e);t&&(o.textContent=t),o.classList.remove("d-none")}async function ud(e){if(!(await ot("high")))throw new Error("sudo failed");const t=s(document,".js-add-u2f-registration-form",HTMLFormElement);a(t,"response").value=JSON.stringify(e);try{const e=await U(t.action,{method:t.method,body:new FormData(t)});cd(e),s(document,".js-new-u2f-registration").classList.remove("is-sending","is-active"),s(document,".js-u2f-registration-nickname-field",HTMLInputElement).value="",e.registration&&function(e){const t=document.createElement("div");t.innerHTML=e;const n=t.firstChild;null!=n&&s(document,".js-u2f-registrations").appendChild(n)}(e.registration)}catch(n){if(n.response){const e=await n.response.json();cd(e),ld(".js-u2f-server-error",e.error)}else ld(".js-u2f-network-error")}}async function dd(){const e=s(document,".js-new-u2f-registration");e.classList.add("is-sending"),e.classList.remove("is-showing-error");const t=s(document,".js-add-u2f-registration-form"),n=d(t,"data-app-id");try{const e=await function(e,t,n){return new Promise(function(s,o){window.u2f.register(e,t,n,function(e){e.registrationData?s(e):o(new nd("Device registration failed",sd(e)))})})}(n,ad(),id());await ud(e)}catch(o){switch(o.code){case 4:ld(".js-u2f-registered-error");break;case 5:ld(".js-u2f-timeout-error");break;default:ld(".js-u2f-other-error")}}}function md(e){return s(e,'[role="tablist"] [role="tab"][aria-selected="true"]')}function fd(e){const t=u(e,'[role="tablist"] [role="tab"]'),n=md(e);return u(e,'[role="tabpanel"]',HTMLElement)[Array.from(t).indexOf(n)]}function gd(e){const t=e.querySelector(".js-emoji-picker-filter"),n=s(e,".js-emoji-picker-filter-tab-button"),o=s(e,".js-emoji-picker-all-emoji");t&&(i(t instanceof HTMLInputElement,"null.js:86"),t.value=""),o.setAttribute("value",""),n.hidden=!0}function pd(e){e.classList.add("selected-emoji")}function hd(e){if(!(e.target instanceof HTMLElement))return;const t=e.target.closest(".js-emoji-picker");if(t&&(i(t instanceof HTMLElement,"null.js:267"),!t.hidden))switch(e.key){case"ArrowRight":case"ArrowLeft":case"ArrowUp":case"ArrowDown":e.preventDefault(),function(e,t){const n=fd(e),s=Array.from(n.querySelectorAll(".js-emoji-button")),o=n.querySelector(".selected-emoji.js-emoji-button"),r=function(e){let t,n=0;const s=e[0].getBoundingClientRect().top;for(const o of e){if(s<(t=o.getBoundingClientRect()).top)break;n+=1}return n}(s),i=function(e,t){const n=[[]];let s=0;for(let o=0;o<e.length;o++)o>0&&o%t==0&&(s+=1,n.push([])),n[s].push(e[o]);return n}(s,r);let a=0,c=0;if(o){const e=function(e,t){let n,s,o=0,r=0;for(let i=0;i<e.length;i++){if((s=(n=e[i]).indexOf(t))>-1){r=s;break}o+=1}return{row:o,col:r}}(i,o);switch(a=e.row,c=e.col,o.classList.remove("selected-emoji"),t){case"ArrowRight":c+=1;break;case"ArrowDown":a+=1;break;case"ArrowLeft":c-=1;break;case"ArrowUp":a-=1}}const l=i.length-1,u=c>i[l].length-1,d=a===l;a<0?(a=l,u&&(a-=1)):(a>l||d&&u&&"ArrowDown"===t)&&(a=0);const m=i[a].length-1;c<0?c=m:c>m&&(c=0);const f=i[a][c];pd(f),f.focus()}(t,e.key)}}function jd(e){e.hidden=!0,document.removeEventListener("keydown",hd)}function vd(e){document.addEventListener("click",t=>{if(t.target instanceof HTMLElement){t.target.closest(".js-emoji-picker")!==e&&jd(e)}});const t=s(e,".js-emoji-picker-all-emoji"),n=s(e,".js-emoji-picker-no-results"),o=s(e,".js-emoji-picker-results-header");t.addEventListener("fuzzy-list-sorted",e=>{if(!(e instanceof CustomEvent))return;const s=Number(e.detail)>0;n.hidden=s,t.hidden=!s,o.hidden=!s});const a=e.querySelector(".js-emoji-picker-filter");a&&(i(a instanceof HTMLInputElement,"null.js:333"),a.addEventListener("input",()=>(function(e){const t=r(e,".js-emoji-picker"),n=md(t),o=s(t,".js-emoji-picker-filter-tab-button",HTMLButtonElement);if(s(t,".js-emoji-picker-all-emoji").setAttribute("value",e.value),n.classList.contains("js-emoji-picker-filter-tab-button")||n.classList.add("emoji-picker-prior-selected-tab-button"),e.value)o.hidden=!1,"true"===o.getAttribute("aria-selected")||(o.click(),e.focus());else{o.hidden=!0;const e=t.querySelector(".emoji-picker-prior-selected-tab-button");e instanceof HTMLButtonElement&&e.click()}})(a)))}function bd(e){return s(e,".js-user-status-details").hasAttribute("open")}function Ld(e){const t=e.querySelector(".js-emoji-picker");t&&(!function(e){const t=s(e,".js-original-emoji-category"),n=s(e,".js-original-emoji-category-tab",HTMLElement),o=md(e),r=fd(e),i=e.querySelector(".js-originally-selected-emoji");if(i){const t=e.querySelector(".selected-emoji");t&&t.classList.remove("selected-emoji"),i.classList.add("selected-emoji")}o.removeAttribute("aria-selected"),t.setAttribute("aria-selected","true"),r.hidden=!0,n.hidden=!1}(t),gd(t),jd(t))}function yd(e){const t=s(e,".js-user-status-original-emoji"),n=s(e,".js-user-status-custom-emoji"),o=s(e,".js-user-status-no-emoji-icon");n.innerHTML=t.innerHTML,o.hidden=n.hasChildNodes()}function Ed(e,t){yd(e),function(e,t){const n=e.querySelector(".js-user-status-emoji-picker");if(!(n instanceof IncludeFragmentElement))return;let s=d(n,"data-url");if(t){s=new URL(s,window.location.origin);const e=new URLSearchParams(s.search.slice(1));e.append("show_picker","1"),s.search=e.toString()}n.setAttribute("src",s.toString())}(e,t),function(e){const t=e.querySelector(".js-user-status-org-picker");if(!(t instanceof IncludeFragmentElement))return;const n=d(t,"data-url");t.src=n.toString()}(e)}function wd(e){const t=s(e,".js-user-status-suggestions"),n=s(e,".js-user-status-message-field",HTMLInputElement).value.trim().length>0;t.classList.toggle("collapsed",n),t.setAttribute("aria-expanded",n.toString())}function Td(e,t){bd(e)?function(e){const t=s(e,".js-user-status-message-field",HTMLInputElement);yd(e),Ld(e),t.value=t.defaultValue,xo(e)}(e):Ed(e,t),Md(e)}function kd(e,t){s(e,".js-user-status-custom-emoji").innerHTML=t.innerHTML,s(e,".js-user-status-no-emoji-icon").hidden=!0}function Sd(e,t){s(e,".js-user-status-emoji-field",HTMLInputElement).value=t.value}function Ad(e,t){if("Escape"===B(t)){const t=e.closest(".js-user-status-container");if(!t)return;e.value=e.defaultValue,Td(t,!1)}}function Md(e){const t=s(e,".js-user-status-submit",HTMLButtonElement),n=s(e,".js-clear-user-status-button",HTMLButtonElement),o=s(e,".js-user-status-message-field",HTMLInputElement),r=o.value.trim();let i=!1,a=!1;var c;Mo(c=o)-Y(c.value)<0&&(i=!0),r.length<1&&(i=!0,n.classList.contains("js-user-status-exists")||(a=!0)),t.disabled=i,n.disabled=a}function Hd(e){return r(e,".js-user-status-container")}function xd(e,t){if(bd(e))return;const n=e.querySelectorAll(".js-toggle-user-status-edit.Details-content--closed");for(const s of n)s.classList.toggle("text-blue",t),s.classList.toggle("link-gray-dark",!t)}function qd(e){if(!(e.target instanceof Element))return;xd(r(e.target,".js-user-status-container"),!0)}function Id(e){if(!(e.target instanceof Element))return;xd(r(e.target,".js-user-status-container"),!1)}function Cd(e){let t=e.currentTarget;i(t instanceof Element,"null.js:39"),Xe(t)?function(e){const t=e.getAttribute("data-warn-unsaved-changes")||"Changes you made may not be saved.";window.onbeforeunload=function(e){return e.returnValue=t,t}}(t):_d()}function _d(){window.onbeforeunload=null}function $d(e){let t=e.currentTarget;i(t instanceof Element,"null.js:63"),t.hasAttribute("open")||_d()}function Rd(e){const t=e.currentTarget;if(i(t instanceof Element,"null.js:73"),!t.closest("details[open]"))return;let n=!0;const s=u(t,"form[data-warn-unsaved-changes]",HTMLFormElement);for(const o of s)if(Xe(o)){const e=d(o,"data-warn-unsaved-changes");n=confirm(e);break}n||e.preventDefault()}o("click",".js-u2f-auth-retry",function(){od()}),n(".js-u2f-auth-form-body",function(e){e.classList.toggle("unavailable",!ed()),ed()&&od()}),h(".js-u2f-registration-delete",async function(e,t){const n=r(e,".js-u2f-registration");n.classList.add("is-sending"),cd((await t.json()).json),n.remove()}),o("click",".js-add-u2f-registration-link",function(){const e=s(document,".js-new-u2f-registration");e.classList.add("is-active"),e.classList.remove("is-showing-error"),s(document,".js-u2f-registration-nickname-field",HTMLInputElement).focus()}),o("click",".js-u2f-register-retry",function(){dd()}),o("submit",".js-add-u2f-registration-form",function(e){e.preventDefault(),dd()}),n(".js-u2f-box",function(e){e.classList.toggle("available",ed())}),o("click",".js-user-status-expire-button",function(e){const t=e.currentTarget,n=Hd(t);i(t instanceof HTMLButtonElement,"null.js:303"),function(e,t){const n=s(e,".js-user-status-expiration-interval-selected"),o=s(e,".js-user-status-expire-drop-down"),r=s(e,".js-user-status-expiration-date-input",HTMLInputElement);n.textContent=t.title,r.value=t.value,o.removeAttribute("open")}(n,t)}),o("click",".js-toggle-user-status-edit",function(e){Td(Hd(e.currentTarget),!!e.target.closest(".js-toggle-user-status-emoji-picker"))}),o("click",".js-toggle-user-status-emoji-picker",function(e){const t=Hd(e.currentTarget).querySelector(".js-emoji-picker");t&&t.hidden&&setTimeout(()=>(function(e){const t=e.querySelector(".js-emoji-picker-filter"),n=!e.hidden;e.hidden=n,n?(t&&(i(t instanceof HTMLInputElement,"null.js:291"),t.value=""),document.removeEventListener("keydown",hd)):(t&&(i(t instanceof HTMLInputElement,"null.js:297"),t.focus()),document.addEventListener("keydown",hd))})(t),50)}),o("click",".js-emoji-button",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:326"),function(e){const t=r(e,".js-user-status-container"),n=s(t,".js-emoji-picker");Sd(t,e),function(e){const t=e.querySelector(".selected-emoji");t&&t.classList.remove("selected-emoji")}(t),pd(e),kd(t,e),Md(t),jd(n)}(t)}),o("click",".js-user-status-emoji-tab",function(e){!function(e){const t=r(e,".js-emoji-picker"),n=t.querySelector(".js-emoji-picker-filter");gd(t),!t.hidden&&n&&(i(n instanceof HTMLInputElement,"null.js:101"),n.focus())}(e.currentTarget)}),l(".js-user-status-message-field",function(e){wd(Hd(e))}),C("keyup",".js-user-status-message-field",e=>{const t=e.target;i(t instanceof HTMLInputElement,"null.js:343"),Ad(t,e)}),C("keyup",".js-emoji-picker-filter",e=>{const t=e.target;i(t instanceof HTMLInputElement,"null.js:349"),Ad(t,e)}),o("click",".js-clear-user-status-button",function(e){const t=e.currentTarget;!function(e){e.hidden=!0,s(e,".js-user-status-emoji-field",HTMLInputElement).value="",s(e,".js-user-status-no-emoji-icon").hidden=!1,s(e,".js-user-status-custom-emoji").innerHTML="";const t=s(e,".js-user-status-message-field",HTMLInputElement);t.value="",t.classList.contains("js-characters-remaining-field")&&Ho(t);const n=e.querySelector(".selected-emoji.js-emoji-button");n&&n.classList.remove("selected-emoji"),s(e,".js-user-status-limited-availability-checkbox",HTMLInputElement).checked=!1;const o=e.querySelector(".js-user-status-expiration-date-input");o&&o instanceof HTMLInputElement&&(o.value=""),Md(e),wd(e);const r=s(e,".js-user-status-form",HTMLFormElement);v(r)}(r(t,".js-user-status-container"))}),o("click",".js-predefined-user-status",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:362"),function(e){const t=r(e,".js-user-status-container"),n=s(e,".js-predefined-user-status-emoji"),o=s(e,".js-predefined-user-status-message"),i=s(t,".js-user-status-message-field",HTMLInputElement);i.value=o.textContent.trim(),kd(t,n),Sd(t,e),Md(t),wd(t),i.classList.contains("js-characters-remaining-field")&&Ho(i)}(t)}),c(".js-user-status-message-field",function(e){const t=e.target;i(t instanceof HTMLElement,"null.js:369");const n=r(t,".js-user-status-form");Md(n),wd(n)}),o("click",".js-user-status-org-button",function(e){const t=e.currentTarget;i(t instanceof HTMLButtonElement,"null.js:378"),function(e){const t=r(e,".js-user-status-container"),n=s(t,".js-user-status-org-id-field",HTMLInputElement),o=s(t,".js-user-status-org-details"),i=s(t,".js-user-status-selected-org"),a=s(e,".js-user-status-org-display"),c=s(t,".js-user-status-org-message"),l=e.value,u=""!==l,m=s(t,".js-suggester"),f=t.querySelector(".js-user-status-org-button.selected");let g="";f&&f.classList.remove("selected"),e.classList.add("selected"),n.value=l,i.innerHTML="";const p=a.cloneNode(!0);if(p.hidden=!1,i.appendChild(p),o.removeAttribute("open"),u){const t=d(c,"data-prefix"),n=d(c,"data-suffix"),s=d(e,"data-org");c.textContent=`${t}${s}${n}`,c.hidden=!1;const o=new URL(d(m,"data-org-url"),window.location.origin),r=new URLSearchParams(o.search.slice(1));r.append("global_id",l),o.search=r.toString(),g=o.toString()}else c.textContent=d(c,"data-none"),c.hidden=!0,g=d(m,"data-no-org-url");m.setAttribute("data-url",g)}(t)}),o("change",".js-user-status-limited-availability-checkbox",function(e){const t=e.target;i(t instanceof HTMLInputElement,"null.js:385");const n=r(t,".js-user-status-form"),o=t.checked,a=d(t,"data-default-message"),c=s(n,".js-user-status-message-field",HTMLInputElement);o&&c.value.length<1?c.value=a:o||c.value!==a||(c.value=""),Md(n),wd(n)}),h(".js-user-status-form",async function(e,t){const n=s(e,".js-user-status-form-group");let o;n.classList.remove("errored");try{o=await t.html()}catch(l){return void n.classList.add("errored")}const i=r(e,".js-user-status-container"),a=o.html.querySelector(".js-user-status-container");i.replaceWith(o.html);const c=document.querySelectorAll(".js-user-status-container");for(const s of c)if(a!==s){const e=s.closest(".js-user-status-context");if(e){const t=d(e,"data-url"),n=await _(document,t);s.replaceWith(n)}}}),n(".js-toggle-user-status-edit",function(e){e.addEventListener("mouseenter",qd),e.addEventListener("mouseleave",Id)}),n(".js-emoji-picker",e=>{i(e instanceof HTMLElement,"null.js:75"),vd(e)}),n("[data-warn-unsaved-changes]",{add(e){e.addEventListener("input",Cd),e.addEventListener("change",Cd),e.addEventListener("submit",_d);const t=e.closest("details-dialog");t&&(r(t,"details").addEventListener("toggle",$d),t.addEventListener("details-dialog:will-close",Rd))},remove(e){e.removeEventListener("input",Cd),e.removeEventListener("change",Cd),e.removeEventListener("submit",_d);const t=e.closest("details-dialog");t&&(r(t,"details").removeEventListener("toggle",$d),t.removeEventListener("details-dialog:will-close",Rd),_d())}});const Nd="related-issues-hidden";let Pd;async function Dd(e){const t=e.value;if(Pd=t,!t)return[];!function(e){const t=s(document,".js-related-issues-spinner");"true"===e.getAttribute("data-user-has-opted-in")&&(t.hidden=!1)}(e);const n=d(e,"data-related-issues-path"),o=await U(Ge(n,{method:"POST",body:zd(t,e.getAttribute("data-repository-id"))}));return Vd(),i(o.data,"null.js:148"),o.data.errors?[]:o.data.repository.relatedIssues.nodes}function Fd(e,t){if(0===t.length)return Vd(),Od(),s(document,".js-related-issues-suggestions-results-wrapper").hidden=!0,void function(){const e=document.querySelector(".js-related-issues-beta-notice");if(e){const t=document.querySelector("#first-time-contributor");t&&(t.style.top="25%");const n=document.querySelector("#prior-contributor");n&&(n.style.top="25%"),e.classList.add("d-none")}}();s(document,".js-number-of-related-issues",HTMLInputElement).value=`${t.length}`,function(e){const t=s(document,".js-related-issues-suggestions-results-container");t.innerHTML="",t.appendChild(e),function(){if(ge(Nd))return;Wd(!0),Bd(!0),s(document,".js-related-issues-results-display").setAttribute("open","")}(),s(document,".js-related-issues-suggestions-results-wrapper").hidden=!1}(function(e,t){const n=s(document,".js-related-issues-suggestions-template",HTMLTemplateElement),o=document.createDocumentFragment();for(let s=0;s<t.length;s++){const r=Kd(n,t[s],St(t,e.value,s));o.appendChild(r)}return o}(e,t)),function(){const e=document.querySelector(".js-related-issues-beta-notice");if(e){const t=document.querySelector("#first-time-contributor");t&&(t.style.top="70%");const n=document.querySelector("#prior-contributor");n&&(n.style.top="70%"),e.classList.remove("d-none")}}()}function Od(){Wd(!1),Bd(!1),s(document,".js-related-issues-results-display").removeAttribute("open")}function Bd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;const t=s(document,".js-related-issues-found-message"),n=s(document,".js-related-issues-feedback-message");void 0!==e?(t.hidden=!e,n.hidden=!e):(t.hidden=!t.hidden,n.hidden=!n.hidden)}n(".js-related-issues-search",{constructor:HTMLInputElement,add(e){ge(Nd)&&Od(),y(e,async()=>{Fd(e,await Dd(e))},{wait:500}),o("change",".js-related-issues-search",async()=>{e.value!==Pd&&Fd(e,await Dd(e))})}}),o("submit","form#new_issue",e=>{e.defaultPrevented||pe(Nd)}),o("click",".js-toggle-related-results",()=>{Wd(),Bd(),s(document,".js-related-issues-results-display").hasAttribute("open")?ye(Nd,"true"):(pe(Nd),window.localStorage.removeItem(Nd))}),o("navigation:keydown",".js-issue-title-input-container",function(e){i(e instanceof CustomEvent,"null.js:96");const t=document.querySelector('.js-issue-title-input-container .js-navigation-item[aria-selected="true"]'),n=s(document,".js-related-issues-results-display").hasAttribute("open");switch(e.detail.hotkey){case"Enter":if(!t){const t=r(e.currentTarget,"form",HTMLFormElement);t.querySelector("input[type=submit], button[type=submit]").disabled||v(t)}break;case"Escape":n&&s(document,".js-hide-related-results").click()}}),C("keydown",".js-related-issues-search",function(e){document.querySelector('.js-issue-title-input-container .js-navigation-item[aria-selected="true"]')||Hn(e)});let Ud=!1;function Wd(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;e=void 0===t?!s(document,".js-related-issues-results-display").hasAttribute("open"):!!t,!Ud&&e?(Ve(s(document,".js-related-issues-suggestions-results-container")),s(document,".js-related-issues-search").classList.add("js-navigation-enable")):(At(s(document,".js-related-issues-suggestions-results-container")),s(document,".js-related-issues-search").classList.remove("js-navigation-enable"))}function zd(e,t){i(t,"null.js:313");const n=new FormData;return n.append("variables[query]",e),n.append("variables[repository_id]",t),n}function Vd(){const e=document.querySelector(".js-related-issues-spinner");e&&(e.hidden=!0)}function Kd(e,t,n){const o=e.content.cloneNode(!0);"OPEN"===t.state?Gd(o,".js-related-issues-octicon-issue-opened"):Gd(o,".js-related-issues-octicon-issue-closed");const r=s(o,".js-related-issue-suggestion-link",HTMLAnchorElement);if(r.href=t.url,r.setAttribute("data-hydro-client-context",JSON.stringify(n)),s(o,".js-related-issue-suggestion-title",HTMLElement).textContent=t.title,s(o,".js-related-issue-number",HTMLElement).textContent=`#${t.number}`,s(o,".js-related-issue-opened-at",HTMLElement).setAttribute("datetime",t.createdAt),t.author){const e=s(o,".js-related-issue-author",HTMLElement);e.textContent=`${t.author.login}`,e.hidden=!1}return s(o,".js-related-issue-updated-at",HTMLElement).setAttribute("datetime",t.updatedAt),s(o,".js-related-issue-suggestion-comment-count").textContent=t.comments.totalCount,o}function Gd(e,t){const n=s(e,".js-related-issue-octicon"),o=s(n,t,SVGElement);n.classList.remove("d-none"),o.classList.remove("d-none")}o("compositionstart",".js-related-issues-search",()=>{Wd(!1),Ud=!0}),o("compositionend",".js-related-issues-search",()=>{Ud=!1,Wd()}),h(".js-repository-advisory-title-update",async function(e,t){r(e,".js-details-container").classList.remove("open");const n=(await t.json()).json;document.title=n.page_title;for(const s of e.elements)(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement)&&(s.defaultValue=s.value)}),h(".js-repository-advisory-update",async function(e){r(e,".previewable-edit").classList.remove("is-comment-editing");for(const t of e.elements)(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.defaultValue=t.value)})}}});
  //# sourceMappingURL=github-bootstrap-8f9bc0ae.js.map
  