System.register(["./chunk-vendor.js","./chunk-frameworks.js","./chunk-overview.js","./chunk-get-repo-element.js","./chunk-input-demux.js","./chunk-ref-selector.js"],function(){"use strict";var w,je,Se,D,be,y,h,l,X,ve,qe,we,ke,O,V,_e,Le,M,Ce,Ae,Ie,Te,Pe,xe,Ee,De,Oe;return{setters:[function(u){w=u.t,je=u.b,Se=u.d,D=u.c,be=u.h,y=u.f,h=u.o,l=u.a,X=u.r,ve=u.C,qe=u.e,we=u.af,ke=u.j},function(u){O=u.e,V=u.z,_e=u.c,Le=u.r,M=u.E,Ce=u.D,Ae=u.R,Ie=u.aF,Te=u.aG,Pe=u.m,xe=u.aH,Ee=u.a9,De=u.aV},function(){},function(u){Oe=u.G},function(){},function(){}],execute:function(){var u=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,Me=(e,t)=>u(e,"name",{value:t,configurable:!0}),k=(e,t,r,n)=>{for(var o=n>1?void 0:n?vt(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&u(t,r,o),o};let S=class extends HTMLElement{constructor(){super(...arguments);this.abortSearch=null,this.originalSelectedItem=null}submit(e){e.preventDefault()}resetField(e){if(be(e)!=="Escape")return;const t=this.field.value.trim();this.field.value="",t&&this.search()}reset(){this.field.focus(),this.field.value="",y(this.field,"input")}get activeFilter(){var e;return(e=this.filters.find(t=>t.classList.contains("selected")))!=null?e:null}async search(){var e;this.originalSelectedItem||(this.originalSelectedItem=this.activeFilter);const t=this.field.value.trim().length>0,r=Ue(this.field);this.classList.toggle("is-search-mode",t),this.classList.add("is-loading");for(const o of this.filters)o.classList.remove("selected");t?this.allFilter.classList.add("selected"):this.originalSelectedItem&&(this.originalSelectedItem.classList.add("selected"),this.originalSelectedItem=null),(e=this.abortSearch)==null||e.abort();const{signal:n}=this.abortSearch=new AbortController;try{const o=await O(document,r,{signal:n});V(null,"",r),this.result.innerHTML="",this.result.appendChild(o)}catch(o){}n.aborted||this.classList.remove("is-loading")}};Me(S,"BranchFilterElement"),k([w],S.prototype,"field",2),k([w],S.prototype,"result",2),k([w],S.prototype,"allFilter",2),k([je],S.prototype,"filters",2),k([Se(100)],S.prototype,"search",1),S=k([D],S);function Ue(e){const t=e.form;if(e.value.trim()){const r=new URL(t.action,window.location.origin),n=new URLSearchParams(r.search.slice(1)),o=t.elements.namedItem("utf8");return o instanceof HTMLInputElement&&n.append("utf8",o.value),n.append("query",e.value),r.search=n.toString(),r.toString()}return t.getAttribute("data-reset-url")}Me(Ue,"queryUrl");var Ne=Object.defineProperty,qt=Object.getOwnPropertyDescriptor,wt=(e,t)=>Ne(e,"name",{value:t,configurable:!0}),K=(e,t,r,n)=>{for(var o=n>1?void 0:n?qt(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ne(t,r,o),o};let P=class extends HTMLElement{get branch(){return this.getAttribute("branch")}get branches(){const t=this.closest("branch-filter").querySelectorAll("branch-filter-item");return Array.from(t).filter(r=>r.branch===this.branch)}loading(e){for(const t of this.branches)t.spinner.hidden=!e,t.destroyButton&&(t.destroyButton.hidden=e)}set mode(e){for(const t of this.branches)t.classList.toggle("Details--on",e==="restore")}async restore(e){e.preventDefault(),this.loading(!0);const t=e.target;let r;try{r=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{"X-Requested-With":"XMLHttpRequest"}})}catch(n){}finally{(!r||!r.ok)&&location.reload(),this.loading(!1)}this.mode="destroy"}async destroy(e){e.preventDefault(),this.loading(!0);const t=e.target;let r;try{r=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{"X-Requested-With":"XMLHttpRequest"}})}catch(n){}finally{(!r||!r.ok)&&location.reload(),this.loading(!1)}this.mode="restore"}};wt(P,"BranchFilterItemElement"),K([w],P.prototype,"destroyButton",2),K([w],P.prototype,"spinner",2),P=K([D],P),h(".js-new-badge-autodismiss",{constructor:HTMLFormElement,add:e=>{const t=e.closest("details");t.addEventListener("toggle",()=>{t.hasAttribute("open")&&fetch(e.action,{method:e.method,body:new FormData(e),headers:{"X-Requested-With":"XMLHttpRequest"}})})}}),h(".js-fetch-upstream-details-content",{constructor:HTMLElement,initialize(e){e.hidden=!0}}),l("click",".js-fetch-upstream-summary",async function(){const e=document.querySelector("details.js-fetch-upstream-details"),t=e.querySelector(".js-fetch-upstream-details-spinner");if(e.open){t.hidden=!1;return}if(t.hidden)return;const r=e.querySelector(".js-fetch-upstream-details-content"),n=r.querySelector(".js-fetch-upstream-conflicts-ui"),o=r.querySelector(".js-fetch-upstream-no-conflicts-ui"),a=r.querySelector(".js-fetch-upstream-conflicts-error-message"),s=r.querySelector(".js-fetch-upstream-conflicts-no-error-message");if(parseInt(r.getAttribute("data-behind"))===0){n.hidden=!0,o.hidden=!1,r.hidden=!1,t.hidden=!0;return}const c=r.getAttribute("data-mergeability-check-url"),d=await fetch(c,{headers:{Accept:"application/json"}});r.hidden=!1,t.hidden=!0,d.ok?(await d.json()).state==="clean"?o.hidden=!1:n.hidden=!1:(n.hidden=!1,a.hidden=!1,s.hidden=!0)}),h(".repository-import",{subscribe:e=>_e(e,"socket:message",function(t){const r=t.detail.data;r.redirect_to&&(document.location.href=r.redirect_to,t.stopImmediatePropagation())})}),l("change","input.js-repository-import-lfs-opt",function({currentTarget:e}){const t=parseInt(e.getAttribute("data-percent-used")||""),r=e.closest(".js-repository-import-lfs-container"),n=e.getAttribute("data-used")||"";r.querySelector(".js-repository-import-lfs-warn").classList.toggle("d-none",!(t>100)),r.querySelector(".js-usage-bar").classList.toggle("exceeded",t>=100),r.querySelector(".js-usage-bar").setAttribute("aria-label",`${t}%`),r.querySelector(".js-repository-import-lfs-progress").style.width=`${t}%`,r.querySelector("span.js-usage-text").textContent=n}),X(".js-repository-import-author-form",async function(e,t){const r=await t.html();e.closest(".js-repository-import-author").replaceWith(r.html)}),l("click",".js-repository-import-projects-cancel-button",function(){const e=document.querySelector(".js-repository-import-projects-cancel-form");Le(e)});var kt=Object.defineProperty,m=(e,t)=>kt(e,"name",{value:t,configurable:!0});let Re=!1;function $e(){return document.querySelector(".js-privacy-toggle:checked").value==="private"}m($e,"privateRepoSelected");function Q(){const e=document.querySelector(".js-repo-name");y(e,"input");const t=document.querySelector('.js-owner-container [aria-checked="true"]'),r=t.getAttribute("data-org-allow-public-repos")!=="false",n=document.querySelector(".js-privacy-toggle[value=public]"),o=document.querySelector(".js-privacy-toggle-label-public"),a=document.querySelector(".js-public-description"),s=document.querySelector(".js-public-restricted-by-policy-description");J(r,n,o,a,s);const i=t.getAttribute("data-business-id"),c=He(i,t),d=t.getAttribute("data-org-allow-private-repos")!=="false",p=document.querySelector(".js-privacy-toggle[value=private]"),j=document.querySelector(".js-privacy-toggle-label-private"),H=document.querySelector(".js-private-description"),b=document.querySelector(".js-private-restricted-by-policy-description");J(d,p,j,H,b),Be();const ft=t.getAttribute("data-org-private-restricted-by-plan")!=="false",A=document.querySelector(".js-upgrade-private-description"),pt=t.getAttribute("data-org-show-upgrade")!=="false",mt=t.getAttribute("data-org-name"),I=mt?document.querySelector(`a[data-upgrade-link="${mt}"]`):null,T=document.querySelector(".js-ask-owner-message");d||!ft?(A&&(A.hidden=!0),I&&(I.hidden=!0),T&&(T.hidden=!0)):(b&&(b.hidden=ft),A&&(A.hidden=!1),I&&(I.hidden=!pt),T&&(T.hidden=pt));const Nt=t.getAttribute("data-default-new-repo-branch"),ht=document.querySelector(".js-new-repo-owner-default-branch");ht&&(ht.textContent=Nt);const Rt=t.getAttribute("data-owner-settings-link-prefix"),gt=document.querySelector(".js-new-repo-owner-settings-link-prefix");gt&&(gt.textContent=Rt);const yt=t.getAttribute("data-owner-settings-url"),W=document.querySelector(".js-repo-owner-default-branch-settings-link-container"),z=document.querySelector(".js-org-repo-owner-default-branch-settings-info");if(yt){const v=document.querySelector(".js-new-repo-owner-settings-link");v&&(v.href=yt,W&&(W.hidden=!1)),z&&(z.hidden=!0)}else if(W&&(W.hidden=!0,z)){const v=t.hasAttribute("data-viewer-is-org-admin");z.hidden=!v}const $t=t.getAttribute("data-org-show-trade-controls")==="true",jt=t.getAttribute("data-viewer-is-org-admin")==="true",me=t.getAttribute("data-user-show-trade-controls")==="true",he=$t&&!d,q=document.querySelector(".js-trade-controls-description"),G=document.querySelector(".js-individual-trade-controls-description");me||he?(b&&(!me&&!jt&&he?b.hidden=!1:b.hidden=!0),p.disabled=!0,H&&(H.hidden=!0),A&&(A.hidden=!0),I&&(I.hidden=!0),T&&(T.hidden=!0)):(q&&(q.hidden=!0),G&&(G.hidden=!0)),me?(q&&(q.hidden=!0),G&&(G.hidden=!1)):he&&q&&(jt?q.hidden=!1:q.hidden=!0),Fe(t,n,c,p),We(t.getAttribute("data-permission")==="yes"),ze(),Y();const ge=document.querySelector(".js-quick-install-container");if(ge){const v=ge.querySelector(".js-quick-install-divider");v.hidden=!0;const St=document.querySelector("input[name=owner]:checked").parentElement;if(St){const ye=St.querySelector(".js-quick-install-list-template");if(ye instanceof HTMLTemplateElement){const bt=ge.querySelector(".js-account-apps");bt.innerHTML="",bt.append(ye.content.cloneNode(!0)),ye.children.length>0&&(v.hidden=!1)}}}}m(Q,"handleOwnerChange");function J(e,t,r,n,o){e?(t&&(t.disabled=!1),r&&r.classList.remove("color-fg-muted"),n&&(n.hidden=!1),o&&(o.hidden=!0)):(t&&(t.disabled=!0),r&&r.classList.add("color-fg-muted"),n&&(n.hidden=!0),o&&(o.hidden=!1))}m(J,"enableDisableRepoType");function Be(){const e=document.querySelectorAll('.js-org-upgrade-link:not([hidden=""]');for(const t of e)t.hidden=!0}m(Be,"hideOrgUpgradeLinks");function Fe(e,t,r,n){let o=null;if(e.getAttribute("data-default")==="private"&&!n.disabled?o=n:e.getAttribute("data-default")==="internal"&&r&&!r.disabled?o=r:t&&!t.disabled?o=t:r&&!r.disabled&&(o=r),!o)return;const a=t&&t.disabled&&t.checked||n.disabled&&n.checked||r&&r.disabled&&r.checked,s=(!t||!t.checked)&&(!r||!r.checked)&&!n.checked;(Re===!1||a===!0||s===!0)&&(o.checked=!0,y(o,"change"))}m(Fe,"ensureOneRadioIsSelected");function He(e,t){let r=!1;const n=document.querySelectorAll(".js-new-repo-internal-visibility");for(const o of n){o.hidden=!0;const a=o.querySelector(".js-privacy-toggle[value=internal]");a instanceof HTMLInputElement&&a.checked&&(r=!0)}if(e){const o=document.querySelector(`#new-repo-internal-visibility-${e}`);if(o){o.hidden=!1;const a=o.querySelector(".js-privacy-toggle-label-internal"),s=o.querySelector(".js-internal-description"),i=o.querySelector(".js-internal-restricted-by-policy-description"),c=o.querySelector(".js-privacy-toggle[value=internal]");if(c instanceof HTMLInputElement)return t.getAttribute("data-org-allow-internal-repos")==="false"?(c.disabled=!0,a&&a.classList.add("color-fg-muted"),s&&(s.hidden=!0),i&&(i.hidden=!1)):(r&&(c.checked=!0,y(c,"change")),c.disabled=!1,a&&a.classList.remove("color-fg-muted"),s&&(s.hidden=!1),i&&(i.hidden=!0)),c}}return null}m(He,"updateInternalDiv");function We(e){for(const n of document.querySelectorAll(".js-with-permission-fields"))n.hidden=!e;for(const n of document.querySelectorAll(".js-without-permission-fields"))n.hidden=e;const t=document.querySelector(".errored"),r=document.querySelector("dl.warn");t&&(t.hidden=!e),r&&(r.hidden=!e)}m(We,"togglePermissionFields");function Y(e){const t=document.querySelector("#js-upgrade-container");if(!t)return;const r=t.querySelector(".js-billing-section"),n=t.querySelector(".js-confirm-upgrade-checkbox");let o=e?e.target:null;o||(o=document.querySelector(".js-privacy-toggle:checked")),o.value==="false"?(t.hidden=!1,r&&r.classList.remove("has-removed-contents"),n&&(n.checked=!0)):(t.hidden=!0,r&&r.classList.add("has-removed-contents"),n&&(n.checked=!1)),g()}m(Y,"handlePrivacyChange");function ze(){const e=document.querySelector("#js-upgrade-container");if(!e)return;const t=document.querySelector("#js-payment-methods-form");e.firstElementChild&&t.appendChild(e.firstElementChild);const r=document.querySelector("input[name=owner]:checked").value,n=t.querySelector(`.js-upgrade[data-login="${r}"]`);n&&e.appendChild(n)}m(ze,"updateUpsell");function g(){const e=document.querySelector(".js-repo-form"),t=e.querySelector(".js-repository-owner-choice:checked"),r=e.querySelector(".js-repo-name"),n=e.querySelector(".js-repo-url"),o=e.querySelector(".js-repo-gitignore"),a=e.querySelector(".js-repo-license");let s=n?!n.classList.contains("is-autocheck-errored"):!0;if(s=s&&!!t,s&&r&&(s=r.classList.contains("is-autocheck-successful"),$e()&&(s=s&&Ge())),o&&o.checked){const c=e.querySelector('input[name="repository[gitignore_template]"]:checked');s=s&&c.value!==""}if(a&&a.checked){const c=e.querySelector('input[name="repository[license_template]"]:checked');s=s&&c.value!==""}const i=e.querySelector("button[type=submit]");i.disabled=!s}m(g,"validate");function Ge(){const e=document.querySelector("#js-upgrade-container");if(!e)return!0;if(e.querySelector(".js-ofac-sanction-notice"))return!1;const r=e.querySelector(".js-confirm-upgrade-checkbox");if(r instanceof HTMLInputElement&&!r.checked)return!1;const n=e.querySelector(".js-zuora-billing-info");return!(n&&n.classList.contains("d-none"))}m(Ge,"validBillingInfo");function Xe(e){const t=e.closest(".js-repo-init-setting-container");if(!t)return;const r=t.querySelector(".js-repo-init-setting-unchecked-menu-option");r.checked||(r.checked=!0,y(r,"change"))}m(Xe,"onRepoInitSettingUnchecked");function Ve(e){const t=e.closest(".js-repo-init-setting-container");if(!t)return;const r=t.querySelector(".js-toggle-repo-init-setting");r.checked&&(r.checked=!1,y(r,"change"))}m(Ve,"onRepoInitNoneMenuOptionSelected");function Ke(e){const t=e.closest("form"),r=t.querySelector(".js-new-repo-default-branch-info");if(!r)return;const o=t.querySelectorAll(".js-toggle-new-repo-default-branch-info:checked").length>0;r.hidden=!o}m(Ke,"toggleDefaultBranchInfo"),h("#js-upgrade-container .js-zuora-billing-info:not(.d-none)",g),h(".js-page-new-repo",function(){const e=document.querySelector("#js-upgrade-container");e&&(e.hidden=!0),Q();const t=document.querySelector(".js-repo-form"),r=t.querySelector(".js-repo-url");if(r){r.focus();return}const n=t.querySelector(".js-template-repository-select");if(n){n.focus();return}const o=t.querySelector(".js-owner-select");o&&o.focus()}),l("click",".js-reponame-suggestion",function(e){const t=document.querySelector(".js-repo-name");t.value=e.currentTarget.textContent,y(t,"input",!1)}),l("click",".js-privacy-toggle",function(){Re=!0}),l("change",".js-privacy-toggle",Y),l("details-menu-selected",".js-owner-container",Q,{capture:!0}),l("change","#js-upgrade-container input",g),M("#js-upgrade-container input",g);const _t=m(e=>{const t=document.querySelector(".js-org-profile");if(t){const r=document.querySelector(".js-owner-container input.js-repository-owner-is-org:checked"),n=e.target,o=!(r&&n.value.toLowerCase()===".github");t.hidden=o;const a=document.querySelector("#repo-name-suggestion");a.hidden=!o}},"renderOrgProfileHint"),Lt=m(e=>{const t=document.querySelector(".js-personal");if(t){const r=document.querySelector(".js-owner-container input.js-repository-owner-is-viewer"),n=e.target,o=!(r&&r.checked&&r.defaultValue.toLowerCase()===n.value.toLowerCase());t.hidden=o;const a=document.querySelector("#repo-name-suggestion");a.hidden=!o}},"renderPersonalProfileHint");M(".js-owner-reponame .js-repo-name",function(e){Lt(e),_t(e),g()}),l("auto-check-send",".js-repo-name-auto-check",function(e){const n=e.currentTarget.form.querySelector("input[name=owner]:checked").value;e.detail.body.append("owner",n)}),l("auto-check-complete","#repository_name",function(){g()}),M(".js-repo-url",function(e){const t=e.target;if(!(t instanceof HTMLInputElement))return;const r=t.closest(".form-group");if(!(r instanceof HTMLDListElement))return;const n=document.querySelector(".js-insecure-url-warning"),o=document.querySelector(".js-svn-url-error"),a=document.querySelector(".js-git-url-error"),s=t.value.toLowerCase();n.hidden=!s.startsWith("http://"),o.hidden=!s.startsWith("svn://"),a.hidden=!s.startsWith("git://"),s.startsWith("svn://")||s.startsWith("git://")?(t.classList.add("is-autocheck-errored"),r.classList.add("errored")):(t.classList.remove("is-autocheck-errored"),r.classList.remove("errored")),g()}),l("change",".js-toggle-repo-init-setting",e=>{const t=e.currentTarget;t.checked||Xe(t),g()}),l("change",".js-repo-init-setting-unchecked-menu-option",e=>{const t=e.currentTarget;t.checked&&Ve(t),g()}),l("change",".js-repo-init-setting-menu-option",g),l("change",".js-repo-readme",g),l("change",".js-toggle-new-repo-default-branch-info",e=>{const t=e.currentTarget;Ke(t)});var Ct=Object.defineProperty,Z=(e,t)=>Ct(e,"name",{value:t,configurable:!0});h(".js-pulse-contribution-data",e=>{Je(e)});async function Qe(e){return O(document,e)}Z(Qe,"diffstatCall");async function Je(e){const t=e.getAttribute("data-pulse-diffstat-summary-url");let r;try{t&&(r=await Qe(t),Ye(r,e))}catch(n){const o=e.querySelector(".js-blankslate-loading"),a=e.querySelector(".js-blankslate-error");o.classList.add("d-none"),a.classList.remove("d-none")}}Z(Je,"loadContributionData");function Ye(e,t){t.innerHTML="",t.appendChild(e)}Z(Ye,"showContributionData");var At=Object.defineProperty,f=(e,t)=>At(e,"name",{value:t,configurable:!0});async function ee(e){const t=e.form,r=t.querySelector("#release_draft");r.value="1",x(e,"saving");const n=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}});if(!n.ok){x(e,"failed");return}const o=await n.json();return x(e,"saved"),setTimeout(x,5e3,e,"default"),y(t,"release:saved",{release:o}),o}f(ee,"saveDraft"),l("change",".js-releases-marketplace-publish-field",function(e){te(e.currentTarget)}),h(".js-releases-marketplace-publish-field",function(e){te(e)});function te(e){const r=e.closest(".js-releases-marketplace-publish-container").querySelector(".js-releases-marketplace-publish-preview");e.checked?r.classList.remove("d-none"):r.classList.add("d-none")}f(te,"processMarketplacePublishCheckbox"),l("click",".js-save-draft",function(e){const t=e.currentTarget;ee(t),e.preventDefault()});function x(e,t){for(const r of e.querySelectorAll(".js-save-draft-button-state"))r.hidden=r.getAttribute("data-state")!==t;e.disabled=t==="saving"}f(x,"setState"),l("release:saved",".js-release-form",function(e){const t=e.detail.release,r=e.currentTarget,n=r.getAttribute("data-repo-url"),o=t.update_url||R("tag",n,t.tag_name);if(r.setAttribute("action",o),t.update_authenticity_token){const c=r.querySelector("input[name=authenticity_token]");c.value=t.update_authenticity_token}const a=t.edit_url||R("edit",n,t.tag_name);V(Ce(),document.title,a);const s=document.querySelector("#delete_release_confirm form");if(s){const c=t.delete_url||R("tag",n,t.tag_name);if(s.setAttribute("action",c),t.delete_authenticity_token){const d=s.querySelector("input[name=authenticity_token]");d.value=t.delete_authenticity_token}}const i=r.querySelector("#release_id");if(!i.value){i.value=t.id;const c=document.createElement("input");c.type="hidden",c.name="_method",c.value="put",r.appendChild(c)}}),l("click",".js-publish-release",function(){document.querySelector("#release_draft").value="0"});function _(e){const t=document.querySelector(".js-release-target-wrapper");if(t!=null){switch(Ze(e),e){case"valid":case"invalid":case"duplicate":t.hidden=!0;break;case"loading":break;default:t.hidden=!1}for(const r of document.querySelectorAll(".js-tag-status-message"))r.hidden=r.getAttribute("data-state")!==e;$(),L("pending")}}f(_,"setTagWrapperState");function re(){return document.querySelector(".js-release-tag").getAttribute("data-state")}f(re,"getTagState");function Ze(e){document.querySelector(".js-release-tag").setAttribute("data-state",e)}f(Ze,"setTagState");const et=new WeakMap;function U(e){const t=e.querySelector('input[name="release[tag_name]"]:checked');return t==null?void 0:t.value}f(U,"getTagName");async function ne(e){const t=U(e);if(!t){_("empty");return}if(t===et.get(e))return;_("loading"),et.set(e,t);const r=e.getAttribute("data-url"),n=new URL(r,window.location.origin),o=new URLSearchParams(n.search.slice(1));o.append("tag_name",t),n.search=o.toString();const a=await fetch(n.toString(),{headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}});if(!a.ok){_("invalid");return}const s=await a.json();s.status==="duplicate"&&parseInt(e.getAttribute("data-existing-id"))===parseInt(s.release_id)?_("valid"):(document.querySelector(".js-release-tag .js-edit-release-link").setAttribute("href",s.url),_(s.status)),ae(e)}f(ne,"checkTag"),l("click",".js-generate-release-notes",function(e){const t=e.currentTarget;t.disabled||tt(t)});async function tt(e){L("loading"),e.disabled=!0;const r=`${e.getAttribute("data-repo-url")}/releases/notes`,n=new URL(r,window.location.origin),o=new URLSearchParams(n.search.slice(1));o.append("commitish",se()),o.append("tag_name",U(document)||""),n.search=o.toString();const a=await fetch(n.toString(),{headers:{Accept:"application/json"}});if(a.ok){const s=await a.json();if(s.commitish===se()){const i=document.getElementById("release_body"),c=oe()==="generated"?"":i.value.trim();c?i.value=c.concat(` `,s.body):i.value=s.body;const d=document.getElementById("release_name");d.value||(d.value=s.title),L("succeed"),N(c?"generated-and-edited":"generated");const p=document.querySelector(".js-release-body-warning");p.textContent=s.warning_message,p.hidden=!s.warning_message}}else{L("failed"),e.disabled=!1;const s=await a.json();if(s&&s.error){const i=document.querySelector(".js-comment-form-error");i.textContent=s.error,i.hidden=!1}}}f(tt,"generateNotes");const It=["pending","loading","succeed","failed"];function L(e){if(It.map(t=>{const r=document.getElementById(`generate-icon-${t}`);r&&(t===e?r.removeAttribute("hidden"):r.setAttribute("hidden","true"))}),e!=="failed"){const t=document.querySelector(".js-comment-form-error");t.textContent="",t.hidden=!0}}f(L,"setGeneratedNotesFetchState");function N(e){const t=document.getElementById("generated_notes_state");t.value=e}f(N,"setNotesTrackingState");function oe(){return document.getElementById("generated_notes_state").value}f(oe,"getNotesTrackingState");function se(){var e;return re()==="valid"?U(document)||"":((e=document.querySelector('input[name="release[target_commitish]"]:checked'))==null?void 0:e.value)||""}f(se,"getCommitish");function R(e,t,r){return`${t}/releases/${e}/${r}`}f(R,"releasesUrl"),h(".js-release-tag",f(function(t){ne(t)},"initialize"));function ae(e){const r=e.closest("form").querySelector(".js-previewable-comment-form");if(!r)return;let n=r.getAttribute("data-base-preview-url");n||(n=String(r.getAttribute("data-preview-url")),r.setAttribute("data-base-preview-url",n));const o=e.querySelectorAll('input[name="release[tag_name]"], input[name="release[target_commitish]"]:checked'),a=new URL(n,window.location.origin),s=new URLSearchParams(a.search.slice(1));for(const i of o)i.value&&s.append(i.name,i.value);a.search=s.toString(),r.setAttribute("data-preview-url",a.toString())}f(ae,"processChangedTag");function $(e=!1){const t=document.querySelector(".js-generate-release-notes");if(t){const r=re(),n=r!=="valid"&&r!=="pending";t.disabled=e||n,t.ariaLabel=`${t.disabled?"Select a valid tag to a":"A"}utomatically add the markdown for all the merged pull requests from this diff and contributors of this release`}}f($,"refreshGenerateNotesButton");function ie(e){if(e.value==="")$(),L("pending"),N("initial");else{const t=oe();$(t!=="initial"),t==="generated"&&N("generated-and-edited")}}f(ie,"processChangedBody"),l("click",".js-release-expand-btn",async function(e){const t=e.currentTarget.closest(".js-release-expandable"),r=t.getAttribute("data-expand-url"),n=await O(document,r);t==null||t.replaceWith(n)}),h("#release_body",function(e){const t=e;t.addEventListener("input",function(){ie(t)}),ie(t)}),l("change",".js-release-tag",function(e){ne(e.currentTarget)}),h(".js-release-form .js-previewable-comment-form",function(e){const t=e.closest("form").querySelector(".js-release-tag");ae(t)});var Tt=Object.defineProperty,Pt=(e,t)=>Tt(e,"name",{value:t,configurable:!0});const rt="";function nt(e){const t=e.closest(".js-rename-branch-form");let r=e.value;const n=r!==e.defaultValue&&r!=="",o=t.querySelector(".js-rename-branch-autocheck-message");if(o&&n){let a=!1;r=o.getAttribute("data-shell-safe-name")||rt,r.includes("<")&&(a=!0);for(const i of t.querySelectorAll(".js-rename-branch-new-name"))i.textContent=r;r=o.getAttribute("data-shell-safe-name-with-remote")||`origin/${rt}`,r.includes("<")&&(a=!0);for(const i of t.querySelectorAll(".js-rename-branch-new-name-with-remote"))i.textContent=r;const s=t.querySelector(".js-rename-branch-special-characters-documentation");s&&a&&(s.hidden=!1,s.removeAttribute("aria-hidden"))}}Pt(nt,"updateRenameInstructions"),l("auto-check-message-updated",".js-rename-branch-input",function(e){const t=e.currentTarget;nt(t)});var xt=Object.defineProperty,Et=(e,t)=>xt(e,"name",{value:t,configurable:!0});const ot=Et(e=>{const t=document.querySelector(st);if(t){const r=e.value.length===0;t.disabled=r}},"toggleSubmit"),st='form.js-protected-branch-settings button[type="submit"]';h(st,{add(){const e=document.getElementById("rule_field");e&&(ot(e),e.addEventListener("input",()=>ot(e)))}}),l("change",".js-template-repository-choice",function(e){const t=e.target,r=t.checked&&t.value!=="",n=t.form;n.querySelector(".js-repository-auto-init-options").classList.toggle("has-removed-contents",r);const a=n.querySelectorAll(".js-template-repository-setting"),s=n.querySelectorAll(".js-template-repository-name-display");if(r){const c=t.closest(".js-template-repository-choice-container").querySelector(".js-template-repository-name"),d=t.getAttribute("data-owner"),p=n.querySelector(`.js-repository-owner-choice[value="${d}"]`);if(p instanceof HTMLInputElement)p.checked=!0,y(p,"change");else{const j=n.querySelector(".js-repository-owner-choice.js-repository-owner-is-viewer");j.checked=!0,y(j,"change")}for(const j of s)j.textContent=c.textContent}else for(const i of s)i.textContent="";for(const i of a)i.hidden=!r});const ce=Pe(xe);Ae("keydown",".js-tree-finder-field",e=>{e.key==="Escape"&&(e.preventDefault(),history.back())}),h(".js-tree-finder",e=>{const t=e.querySelector(".js-tree-finder-field"),r=e.querySelector(".js-tree-finder-virtual-filter"),n=e.querySelector(".js-tree-browser"),o=e.querySelector(".js-tree-browser-results"),a=e.querySelector(".js-tree-browser-result-template"),s=new ve(t,o);r.filter=(i,c)=>c===""||Ie(c,i)&&ce(c,i)>0,r.addEventListener("virtual-filter-input-filter",()=>{n.updating="lazy"}),r.addEventListener("virtual-filter-input-filtered",()=>{n.updating="eager"}),n.addEventListener("virtual-list-sort",i=>{i.preventDefault();const c=t.value;n.sort((d,p)=>ce(c,p)-ce(c,d))}),n.addEventListener("virtual-list-update",()=>{s.stop()}),n.addEventListener("virtual-list-updated",()=>{s.start(),s.navigate()}),n.addEventListener("virtual-list-render-item",i=>{if(!(i instanceof CustomEvent))return;const c=new qe(a,{item:i.detail.item,id:`entry-${Math.random().toString().substr(2,5)}`}),d=c.querySelector("marked-text");d&&(d.positions=Te),i.detail.fragment.append(c)}),n.querySelector("ul").hidden=!1,t.focus(),s.start()});var Dt=Object.defineProperty,C=(e,t)=>Dt(e,"name",{value:t,configurable:!0});let E=null;const le=new WeakMap;function at(e,t){const n=e.closest(".js-upload-manifest-file-container").querySelector(".js-upload-progress");n.hidden=!1,e.classList.add("is-progress-bar");const o=n.querySelector(".js-upload-meter-text"),a=o.querySelector(".js-upload-meter-range-start");a.textContent=String(t.uploaded()+1);const s=o.querySelector(".js-upload-meter-range-end");s.textContent=String(t.size)}C(at,"showProgress");function ue(e){e.classList.remove("is-progress-bar");const t=e.closest(".js-upload-manifest-file-container"),r=t.querySelector(".js-upload-progress");r.hidden=!0;const n=t.querySelector(".js-upload-meter-text .js-upload-meter-filename");n.textContent=""}C(ue,"hideProgress"),l("file-attachment-accept",".js-upload-manifest-file",function(e){const{attachments:t}=e.detail,r=parseInt(e.currentTarget.getAttribute("data-directory-upload-max-files")||"",10);t.length>r&&(e.preventDefault(),e.currentTarget.classList.add("is-too-many"))}),l("document:drop",".js-upload-manifest-tree-view",async function(e){const{transfer:t}=e.detail,r=e.currentTarget,n=await we.traverse(t,!0),o=document.querySelector("#js-repo-pjax-container");o.addEventListener("pjax:success",()=>{o.querySelector(".js-upload-manifest-file").attach(n)},{once:!0});const a=r.getAttribute("data-drop-url");Ee({url:a,container:o})}),l("upload:setup",".js-upload-manifest-file",async function(e){const{batch:t,form:r,preprocess:n}=e.detail,o=e.currentTarget;at(o,t);function a(){r.append("upload_manifest_id",le.get(o))}if(C(a,"addInfo"),le.get(o)){a();return}if(E){n.push(E.then(a));return}const i=o.closest(".js-upload-manifest-file-container").querySelector(".js-upload-manifest-form");E=fetch(i.action,{method:i.method,body:new FormData(i),headers:{Accept:"application/json"}});const[c,d]=it();n.push(c.then(a));const p=await E;if(!p.ok)return;const j=await p.json(),b=document.querySelector(".js-manifest-commit-form").elements.namedItem("manifest_id");b.value=j.upload_manifest.id,le.set(o,j.upload_manifest.id),E=null,d()});function it(){let e;return[new Promise(r=>{e=r}),e]}C(it,"makeDeferred"),l("upload:start",".js-upload-manifest-file",function(e){const{attachment:t,batch:r}=e.detail,a=e.currentTarget.closest(".js-upload-manifest-file-container").querySelector(".js-upload-progress").querySelector(".js-upload-meter-text"),s=a.querySelector(".js-upload-meter-range-start");s.textContent=r.uploaded()+1;const i=a.querySelector(".js-upload-meter-filename");i.textContent=t.fullPath}),l("upload:complete",".js-upload-manifest-file",function(e){const{attachment:t,batch:r}=e.detail,o=document.querySelector(".js-manifest-commit-file-template").querySelector(".js-manifest-file-entry").cloneNode(!0),a=o.querySelector(".js-filename");a.textContent=t.fullPath;const s=t.id,c=o.querySelector(".js-remove-manifest-file-form").elements.namedItem("file_id");c.value=s;const d=document.querySelector(".js-manifest-file-list");d.hidden=!1,e.currentTarget.classList.add("is-file-list"),d.querySelector(".js-manifest-file-list-root").appendChild(o),r.isFinished()&&ue(e.currentTarget)}),l("upload:progress",".js-upload-manifest-file",function(e){const{batch:t}=e.detail,n=e.currentTarget.closest(".js-upload-manifest-file-container").querySelector(".js-upload-meter");n.style.width=`${t.percent()}%`});function de(e){ue(e.currentTarget)}C(de,"onerror"),l("upload:error",".js-upload-manifest-file",de),l("upload:invalid",".js-upload-manifest-file",de),X(".js-remove-manifest-file-form",async function(e,t){await t.html();const r=e.closest(".js-manifest-file-list-root");if(e.closest(".js-manifest-file-entry").remove(),!r.hasChildNodes()){const o=r.closest(".js-manifest-file-list");o.hidden=!0,document.querySelector(".js-upload-manifest-file").classList.remove("is-file-list")}});async function ct(e){const t=e.getAttribute("data-redirect-url");try{await De(e.getAttribute("data-poll-url")),window.location.href=t}catch(r){document.querySelector(".js-manifest-ready-check").hidden=!0,document.querySelector(".js-manifest-ready-check-failed").hidden=!1}}C(ct,"manifestReadyCheck"),h(".js-manifest-ready-check",{initialize(e){ct(e)}});var Ot=Object.defineProperty,lt=(e,t)=>Ot(e,"name",{value:t,configurable:!0});l("click",".js-release-remove-file",function(e){const t=e.currentTarget.closest(".js-release-file");t.classList.add("delete"),t.querySelector("input.destroy").value="true"}),l("click",".js-release-undo-remove-file",function(e){const t=e.currentTarget.closest(".js-release-file");t.classList.remove("delete"),t.querySelector("input.destroy").value=""});function fe(e){return e.closest("form").querySelector("#release_id").value}lt(fe,"getReleaseId");let B=null;l("release:saved",".js-release-form",function(e){const t=e.currentTarget;B=null;let r=!1;for(const o of t.querySelectorAll(".js-releases-field .js-release-file"))o.classList.contains("delete")?o.remove():o.classList.contains("js-template")||(r=!0);const n=t.querySelector(".js-releases-field");n.classList.toggle("not-populated",!r),n.classList.toggle("is-populated",r)});function pe(e,t){t.append("release_id",fe(e));const r=Array.from(document.querySelectorAll(".js-releases-field .js-release-file.delete .id"));if(r.length){const n=r.map(o=>o.value);t.append("deletion_candidates",n.join(","))}}lt(pe,"addInfo"),l("upload:setup",".js-upload-release-file",function(e){const{form:t,preprocess:r}=e.detail,n=e.currentTarget;if(fe(n)){pe(n,t);return}if(!B){const a=document.querySelector(".js-save-draft");B=ee(a)}const o=pe.bind(null,n,t);r.push(B.then(o))}),l("upload:start",".js-upload-release-file",function(e){const t=e.detail.policy;e.currentTarget.querySelector(".js-upload-meter").classList.remove("d-none");const n=t.asset.replaced_asset;if(!!n)for(const o of document.querySelectorAll(".js-releases-field .js-release-file .id"))Number(o.value)===n&&o.closest(".js-release-file").remove()}),l("upload:complete",".js-upload-release-file",function(e){const{attachment:t}=e.detail,r=document.querySelector(".js-releases-field"),n=r.querySelector(".js-template").cloneNode(!0);n.classList.remove("d-none","js-template"),n.querySelector("input.id").value=t.id;const o=t.name||t.href.split("/").pop();for(const i of n.querySelectorAll(".js-release-asset-filename"))i instanceof HTMLInputElement?i.value=o:i.textContent=o;const a=`(${(t.file.size/(1024*1024)).toFixed(2)} MB)`;n.querySelector(".js-release-asset-filesize").textContent=a,r.appendChild(n),r.classList.remove("not-populated"),r.classList.add("is-populated"),e.currentTarget.querySelector(".js-upload-meter").classList.add("d-none")}),l("upload:progress",".js-upload-release-file",function(e){const{attachment:t}=e.detail,r=e.currentTarget.querySelector(".js-upload-meter");r.style.width=`${t.percent}%`});var ut=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,Ut=(e,t)=>ut(e,"name",{value:t,configurable:!0}),dt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Mt(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ut(t,r,o),o};let F=class extends HTMLElement{constructor(){super(...arguments);this.count=0}connectedCallback(){h("get-repo",{constructor:Oe,add:e=>{this.handleGetRepoElement(e)}})}handleGetRepoElement(e){!e.openOrCreateInCodespace||(this.count===0?e.showOpenOrCreateInCodespace():e.removeOpenOrCreateInCodespace())}};Ut(F,"RepoCodespacesCountElement"),dt([ke],F.prototype,"count",2),F=dt([D],F)}}}); //# sourceMappingURL=repositories-a726449f.js.map