98 lines
262 KiB
JavaScript
98 lines
262 KiB
JavaScript
System.register(["./chunk-vendor.js","./chunk-frameworks.js","./chunk-notification-list-focus.js","./chunk-cookies.js","./chunk-edit.js","./chunk-responsive-underlinenav.js","./chunk-tag-input.js"],function(Av,k){"use strict";var y,te,I,p,f,se,Yr,na,Zr,M,v,ra,We,de,eo,oa,sa,ia,aa,ca,la,ua,da,fa,xn,ma,to,pa,no,ha,An,ga,ba,ya,va,Pn,Mn,wa,Ft,Ot,La,ja,Ea,Sa,ka,ro,_a,oo,Rt,Ta,Ca,xa,Aa,Pa,Ma,qa,C,$a,Ia,U,qn,Fa,qe,$e,Dt,Ht,ze,Ve,so,fe,Ke,Nt,Xe,E,V,Bt,$n,Ut,Oa,me,Wt,io,ao,co,Ra,Da,zt,we,In,lo,Vt,Ha,uo,K,pe,ie,Le,Ge,Je,Fn,Na,Kt,Ba,Ua,Wa,za,Va,Ka,fo,mo,Xa,Ga,Xt,Ja,Qa,Ya,po,Za,ec,ho,go,tc,nc,rc,oc,On,sc,ic,Rn,ac,cc,bo,lc,yo,uc,dc,fc,vo,mc,pc,hc,Gt,gc,wo,bc,yc,vc,Lo,jo,wc;return{setters:[function(u){y=u.t,te=u.b,I=u.c,p=u.o,f=u.a,se=u.j,Yr=u.I,na=u.R,Zr=u.C,M=u.r,v=u.f,ra=u.A,We=u.k,de=u.e,eo=u.l,oa=u.s,sa=u.m,ia=u.n,aa=u.q,ca=u.v,la=u.w,ua=u.x,da=u.y,fa=u.z,xn=u.B,ma=u.E,to=u.F,pa=u.G,no=u.H,ha=u.J,An=u.h,ga=u.K,ba=u.Q,ya=u.M,va=u.L,Pn=u.g,Mn=u.i,wa=u.N,Ft=u.O,Ot=u.P,La=u.U,ja=u.V,Ea=u.W,Sa=u.X,ka=u.Y,ro=u.Z,_a=u._,oo=u.$,Rt=u.a0,Ta=u.a1,Ca=u.a2,xa=u.a3,Aa=u.a4,Pa=u.a5,Ma=u.a6,qa=u.a7,C=u.a8},function(u){$a=u.p,Ia=u.k,U=u.e,qn=u.l,Fa=u.n,qe=u.j,$e=u.q,Dt=u.v,Ht=u.t,ze=u.w,Ve=u.x,so=u.i,fe=u.y,Ke=u.z,Nt=u.o,Xe=u.A,E=u.c,V=u.r,Bt=u.B,$n=u.C,Ut=u.D,Oa=u.E,me=u.F,Wt=u.G,io=u.H,ao=u.I,co=u.J,Ra=u.K,Da=u.L,zt=u.M,we=u.a,In=u.N,lo=u.O,Vt=u.P,Ha=u.Q,uo=u.R,K=u.S,pe=u.m,ie=u.T,Le=u.g,Ge=u.U,Je=u.V,Fn=u.W,Na=u.X,Kt=u.Y,Ba=u.Z,Ua=u._,Wa=u.$,za=u.a0,Va=u.a1,Ka=u.a2,fo=u.a3,mo=u.a4,Xa=u.a5,Ga=u.a6,Xt=u.a7,Ja=u.a8,Qa=u.a9,Ya=u.aa,po=u.ab,Za=u.ac,ec=u.ad,ho=u.ae,go=u.af,tc=u.ag,nc=u.ah,rc=u.ai,oc=u.aj,On=u.u,sc=u.ak,ic=u.s,Rn=u.al,ac=u.am,cc=u.an,bo=u.ao,lc=u.ap,yo=u.aq,uc=u.ar,dc=u.as,fc=u.at,vo=u.au,mc=u.av,pc=u.aw,hc=u.ax,Gt=u.h,gc=u.ay,wo=u.az,bc=u.aA},function(u){yc=u.g,vc=u.r},function(u){Lo=u.g,jo=u.d,wc=u.s},function(){},function(){},function(){}],execute:function(){const u=function(){return document.readyState==="complete"?Promise.resolve():new Promise(e=>{window.addEventListener("load",e)})}();class Lc extends HTMLElement{async connectedCallback(){await u,this.content&&await Hp(this.lines,this.content,this.characterDelay,this.lineDelay),this.cursor&&(this.cursor.hidden=!0),this.dispatchEvent(new CustomEvent("typing:complete",{bubbles:!0,cancelable:!0}))}get content(){return this.querySelector('[data-target="typing-effect.content"]')}get cursor(){return this.querySelector('[data-target="typing-effect.cursor"]')}get lines(){const t=this.getAttribute("data-lines");try{return t?JSON.parse(t):[]}catch{return[]}}get prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion)").matches}get characterDelay(){return this.prefersReducedMotion?0:Math.max(0,Math.min(Math.floor(Number(this.getAttribute("data-character-delay"))),2147483647))||40}set characterDelay(t){if(t>2147483647||t<0)throw new DOMException("Value is negative or greater than the allowed amount");this.setAttribute("data-character-delay",String(t))}get lineDelay(){return this.prefersReducedMotion?0:Math.max(0,Math.min(Math.floor(Number(this.getAttribute("data-line-delay"))),2147483647))||40}set lineDelay(t){if(t>2147483647||t<0)throw new DOMException("Value is negative or greater than the allowed amount");this.setAttribute("data-line-delay",String(t))}}window.customElements.get("typing-effect")||(window.TypingEffectElement=Lc,window.customElements.define("typing-effect",Lc));async function Hp(e,t,n,r){for(let o=0;o<e.length;o++){if(n===0)t.append(e[o]);else for(const s of e[o].split(""))await jc(n),t.innerHTML+=s;r!==0&&await jc(r),o<e.length-1&&t.append(document.createElement("br"))}}async function jc(e){return new Promise(t=>{setTimeout(t,e)})}const Np=2e3;function Ec(e){e.style.display="inline-block"}function Sc(e){e.style.display="none"}function Bp(e){const[t,n]=e.querySelectorAll(".octicon");!t||!n||(Ec(t),Sc(n))}function Up(e){const[t,n]=e.querySelectorAll(".octicon");!t||!n||(Sc(t),Ec(n))}const Dn=new WeakMap;document.addEventListener("clipboard-copy",function({target:e}){if(!(e instanceof HTMLElement)||!e.hasAttribute("data-view-component"))return;const t=Dn.get(e);t?(clearTimeout(t),Dn.delete(e)):Up(e),Dn.set(e,setTimeout(()=>{Bp(e),Dn.delete(e)},Np))});var Wp=Object.defineProperty,zp=(e,t)=>Wp(e,"name",{value:t,configurable:!0}),kc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},_=(e,t,n)=>(kc(e,t,"read from private field"),n?n.call(e):t.get(e)),Qe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},je=(e,t,n,r)=>(kc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ye,Y,Ie,ae,Jt,Eo,mt;class So extends HTMLElement{constructor(){super(...arguments);Qe(this,Ye,!1),Qe(this,Y,new Set),Qe(this,Ie,new Map),Qe(this,ae,1/0),Qe(this,Jt,new Map),Qe(this,Eo,new Map),Qe(this,mt,0)}static get observedAttributes(){return["data-updating"]}get updating(){return this.getAttribute("data-updating")==="lazy"?"lazy":"eager"}set updating(t){this.setAttribute("data-updating",t)}get size(){return _(this,Y).size}get range(){const t=this.getBoundingClientRect().height,{scrollTop:n}=this,r=`${n}-${t}`;if(_(this,Jt).has(r))return _(this,Jt).get(r);let o=0,s=0,i=0,a=0;const c=_(this,Ie);for(const l of _(this,Y)){const d=c.get(l)||_(this,ae);if(i+d<n)i+=d,o+=1,s+=1;else if(a-d<t)a+=d,s+=1;else if(a>=t)break}return[o,s]}attributeChangedCallback(t,n,r){if(n===r||!this.isConnected)return;const o=t==="data-updating"&&r==="eager",s=t==="data-sorted"&&this.hasAttribute("data-sorted");(o||s)&&this.update()}connectedCallback(){this.addEventListener("scroll",()=>this.update()),this.updateSync=this.updateSync.bind(this)}update(){_(this,mt)&&cancelAnimationFrame(_(this,mt)),!_(this,Ye)&&this.hasAttribute("data-sorted")?je(this,mt,requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("virtual-list-sort",{cancelable:!0}))&&this.sort()})):je(this,mt,requestAnimationFrame(this.updateSync))}renderItem(t){const n={item:t,fragment:document.createDocumentFragment()};return this.dispatchEvent(new CustomEvent("virtual-list-render-item",{detail:n})),n.fragment.children[0]}recalculateHeights(t){const n=this.querySelector("ul, ol, tbody");n&&(n.append(this.renderItem(t)),je(this,ae,n.children[0].getBoundingClientRect().height),_(this,Ie).set(t,_(this,ae)),n.replaceChildren())}updateSync(){const t=this.querySelector("ul, ol");if(!t)return;const[n,r]=this.range;if(r<n||!this.dispatchEvent(new CustomEvent("virtual-list-update",{cancelable:!0})))return;const s=new Map,i=_(this,Eo);let a=-1,c=!0,l=0;for(const w of _(this,Y)){if(a===-1&&(!Number.isFinite(_(this,ae))||_(this,ae)===0)&&this.recalculateHeights(w),a+=1,a<n){l+=_(this,Ie).get(w)||_(this,ae);continue}if(a>r){c=!1;break}let L=null;if(i.has(w))L=i.get(w);else{if(L=this.renderItem(w),!L)continue;i.set(w,L)}s.set(w,L)}t.replaceChildren(...s.values()),t.style.paddingTop=`${l}px`;const d=this.size*_(this,ae);t.style.height=`${d||0}px`;let m=!1;const h=this.getBoundingClientRect().bottom;for(const[w,L]of s){const{height:x,bottom:j}=L.getBoundingClientRect();m=m||j>=h,_(this,Ie).set(w,x)}if(!c&&this.size>s.size&&!m)return _(this,Jt).delete(`${this.scrollTop}-${this.getBoundingClientRect().height}`),this.update();this.dispatchEvent(new CustomEvent("virtual-list-updated"))}has(t){return _(this,Y).has(t)}add(t){return _(this,Y).add(t),je(this,Ye,!1),Number.isFinite(_(this,ae))||this.recalculateHeights(t),this.updating==="eager"&&this.update(),this}delete(t){const n=_(this,Y).delete(t);return je(this,Ye,!1),_(this,Ie).delete(t),this.updating==="eager"&&this.update(),n}clear(){_(this,Y).clear(),_(this,Ie).clear(),je(this,ae,1/0),je(this,Ye,!0),this.updating==="eager"&&this.update()}forEach(t,n){for(const r of this)t.call(n,r,r,this)}entries(){return _(this,Y).entries()}values(){return _(this,Y).values()}keys(){return _(this,Y).keys()}[Symbol.iterator](){return _(this,Y)[Symbol.iterator]()}sort(t){return je(this,Y,new Set(Array.from(this).sort(t))),je(this,Ye,!0),this.updating==="eager"&&this.update(),this}}zp(So,"VirtualListElement"),Ye=new WeakMap,Y=new WeakMap,Ie=new WeakMap,ae=new WeakMap,Jt=new WeakMap,Eo=new WeakMap,mt=new WeakMap,window.customElements.get("virtual-list")||(window.VirtualListElement=So,window.customElements.define("virtual-list",So));var Vp=Object.defineProperty,ko=(e,t)=>Vp(e,"name",{value:t,configurable:!0}),_c=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Fe=(e,t,n)=>(_c(e,t,"read from private field"),n?n.call(e):t.get(e)),Hn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Oe=(e,t,n,r)=>(_c(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pt,ht,Ze,Qt;function Tc(e){return Boolean(e instanceof Set||e&&typeof e=="object"&&"size"in e&&"add"in e&&"delete"in e&&"clear"in e)}ko(Tc,"isSetAlike");class _o extends HTMLElement{constructor(){super(...arguments);Hn(this,pt,0),Hn(this,ht,null),Hn(this,Ze,void 0),Hn(this,Qt,new Set),this.filtered=new Set,this.filter=ko((t,n)=>String(t).includes(n),"filter")}static get observedAttributes(){return["src","loading","data-property","aria-owns"]}get input(){return this.querySelector("input, textarea")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get loading(){return this.getAttribute("loading")==="lazy"?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get property(){return this.getAttribute("data-property")||""}set property(t){this.setAttribute("data-property",t)}reset(){this.filtered.clear(),Oe(this,Qt,new Set)}clear(){!this.input||(this.input.value="",this.input.dispatchEvent(new Event("input")))}attributeChangedCallback(t,n,r){const o=this.isConnected&&this.src,s=this.loading==="eager",i=t==="src"||t==="loading"||t==="accept"||t==="data-property",a=t==="src"||t==="data-property",c=n!==r;if(a&&c&&(Oe(this,ht,null),Fe(this,Ze)&&clearTimeout(Fe(this,Ze))),o&&s&&i&&c)cancelAnimationFrame(Fe(this,pt)),Oe(this,pt,requestAnimationFrame(()=>this.load()));else if(t==="aria-owns"){const l=this.ownerDocument.getElementById(r);if(!l)return;Tc(l)&&(this.filtered=l)}}connectedCallback(){this.src&&this.loading==="eager"&&(cancelAnimationFrame(Fe(this,pt)),Oe(this,pt,requestAnimationFrame(()=>this.load())));const t=this.input;if(!t)return;const n=this.getAttribute("aria-owns");n!==null&&this.attributeChangedCallback("aria-owns","",n),t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false"),this.src&&this.loading==="lazy"&&(document.activeElement===t?this.load():t.addEventListener("focus",()=>{this.load()},{once:!0})),t.addEventListener("input",this)}disconnectedCallback(){var t;(t=this.input)==null||t.removeEventListener("input",this)}handleEvent(t){var n,r;t.type==="input"&&(Fe(this,Ze)&&clearTimeout(Fe(this,Ze)),Oe(this,Ze,window.setTimeout(()=>this.filterItems(),((r=(n=this.input)==null?void 0:n.value)==null?void 0:r.length)||0<3?300:100)))}async load(){if(!this.src)throw new Error("missing src");await new Promise(t=>setTimeout(t,0)),this.dispatchEvent(new Event("loadstart"));try{const t=await this.fetch(this.request());if(location.origin+this.src!==t.url)return;if(!t.ok)throw new Error(`Failed to load resource: the server responded with a status of ${t.status}`);Oe(this,Qt,new Set((await t.json())[this.property])),Oe(this,ht,null),this.dispatchEvent(new Event("loadend"))}catch(t){throw(async()=>{this.dispatchEvent(new Event("error")),this.dispatchEvent(new Event("loadend"))})(),t}this.filtered.clear(),this.filterItems()}request(){return new Request(this.src,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"application/json"}})}fetch(t){return fetch(t)}filterItems(){var t,n;const r=(n=(t=this.input)==null?void 0:t.value.trim())!=null?n:"",o=Fe(this,ht);if(Oe(this,ht,r),r===o)return;this.dispatchEvent(new CustomEvent("virtual-filter-input-filter"));let s;o&&r.includes(o)?s=this.filtered:(s=Fe(this,Qt),this.filtered.clear());for(const i of s)this.filter(i,r)?this.filtered.add(i):this.filtered.delete(i);this.dispatchEvent(new CustomEvent("virtual-filter-input-filtered"))}}ko(_o,"VirtualFilterInputElement"),pt=new WeakMap,ht=new WeakMap,Ze=new WeakMap,Qt=new WeakMap,window.customElements.get("virtual-filter-input")||(window.VirtualFilterInputElement=_o,window.customElements.define("virtual-filter-input",_o));var Kp=Object.defineProperty,Cc=(e,t)=>Kp(e,"name",{value:t,configurable:!0}),xc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},et=(e,t,n)=>(xc(e,t,"read from private field"),n?n.call(e):t.get(e)),Nn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Bn=(e,t,n,r)=>(xc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Un,Wn,gt,Yt;function Ac(e,t){const n=[];let r=0;for(let o=0;o<e.length;o++){const s=e[o],i=t.indexOf(s,r);if(i===-1)return n;r=i+1,n.push(i)}return n}Cc(Ac,"defaultPositions");class zn extends HTMLElement{constructor(){super(...arguments);Nn(this,Un,""),Nn(this,Wn,""),Nn(this,gt,void 0),Nn(this,Yt,void 0)}get query(){return this.ownerInput?this.ownerInput.value:this.getAttribute("query")||""}set query(t){this.setAttribute("query",t)}get ownerInput(){const t=this.ownerDocument.getElementById(this.getAttribute("data-owner-input")||"");return t instanceof HTMLInputElement?t:null}connectedCallback(){var t;this.handleEvent(),(t=this.ownerInput)==null||t.addEventListener("input",this),Bn(this,gt,new MutationObserver(()=>this.handleEvent()))}handleEvent(){et(this,Yt)&&cancelAnimationFrame(et(this,Yt)),Bn(this,Yt,requestAnimationFrame(()=>this.mark()))}disconnectedCallback(){var t;(t=this.ownerInput)==null||t.removeEventListener("input",this),et(this,gt).disconnect()}mark(){const t=this.textContent||"",n=this.query;if(t===et(this,Un)&&n===et(this,Wn))return;Bn(this,Un,t),Bn(this,Wn,n),et(this,gt).disconnect();let r=0;const o=document.createDocumentFragment();for(const s of(this.positions||Ac)(n,t)){if(Number(s)!==s||s<r||s>t.length)continue;t.slice(r,s)!==""&&o.appendChild(document.createTextNode(t.slice(r,s))),r=s+1;const a=document.createElement("mark");a.textContent=t[s],o.appendChild(a)}o.appendChild(document.createTextNode(t.slice(r))),this.replaceChildren(o),et(this,gt).observe(this,{attributes:!0,childList:!0,subtree:!0})}}Cc(zn,"MarkedTextElement"),Un=new WeakMap,Wn=new WeakMap,gt=new WeakMap,Yt=new WeakMap,zn.observedAttributes=["query","data-owner-input"],window.customElements.get("marked-text")||(window.MarkedTextElement=zn,window.customElements.define("marked-text",zn));var Pc=Object.defineProperty,Xp=Object.getOwnPropertyDescriptor,Gp=(e,t)=>Pc(e,"name",{value:t,configurable:!0}),Vn=(e,t,n,r)=>{for(var o=r>1?void 0:r?Xp(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Pc(t,n,o),o};let bt=class extends HTMLElement{updateURL(e){const t=e.currentTarget,n=t.getAttribute("data-url")||"";if(this.helpField.value=n,t.matches(".js-git-protocol-clone-url"))for(const r of this.helpTexts)r.textContent=n;for(const r of this.cloneURLButtons)r.classList.remove("selected");t.classList.add("selected")}};Gp(bt,"GitCloneHelpElement"),Vn([y],bt.prototype,"helpField",2),Vn([te],bt.prototype,"helpTexts",2),Vn([te],bt.prototype,"cloneURLButtons",2),bt=Vn([I],bt);var Mc=Object.defineProperty,Jp=Object.getOwnPropertyDescriptor,Qp=(e,t)=>Mc(e,"name",{value:t,configurable:!0}),To=(e,t,n,r)=>{for(var o=r>1?void 0:r?Jp(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Mc(t,n,o),o};let Zt=class extends HTMLElement{constructor(){super();this.addEventListener("socket:message",this.update.bind(this))}update(e){const t=e.detail.data;this.link.setAttribute("aria-label",t.aria_label),this.link.setAttribute("data-ga-click",t.ga_click),this.modifier.setAttribute("class",t.span_class)}};Qp(Zt,"NotificationIndicatorElement"),To([y],Zt.prototype,"link",2),To([y],Zt.prototype,"modifier",2),Zt=To([I],Zt);var qc=Object.defineProperty,Yp=Object.getOwnPropertyDescriptor,Zp=(e,t)=>qc(e,"name",{value:t,configurable:!0}),Co=(e,t,n,r)=>{for(var o=r>1?void 0:r?Yp(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&qc(t,n,o),o};let en=class extends HTMLElement{connectedCallback(){this.addEventListener("socket:message",e=>{const t=e.detail.data;this.link.setAttribute("aria-label",t.aria_label),this.link.setAttribute("data-ga-click",t.ga_click),this.modifier.setAttribute("class",t.span_class)})}toggleSidebar(){const e=new CustomEvent("notification-focus:toggle-sidebar",{bubbles:!0});this.dispatchEvent(e)}};Zp(en,"NotificationFocusIndicatorElement"),Co([y],en.prototype,"link",2),Co([y],en.prototype,"modifier",2),en=Co([I],en);var $c=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th=(e,t)=>$c(e,"name",{value:t,configurable:!0}),xo=(e,t,n,r)=>{for(var o=r>1?void 0:r?eh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&$c(t,n,o),o};let tn=class extends HTMLElement{changeFilter(e){e.preventDefault(),this.detailsContainer.removeAttribute("open");const t=e.currentTarget;this.setFilterTitle(t.innerHTML),this.dispatchEvent(new CustomEvent("focus-mode-filter-change",{detail:{url:t.href}}))}setFilterTitle(e){this.filterTitle.innerHTML=e}};th(tn,"NotificationFocusFiltersElement"),xo([y],tn.prototype,"detailsContainer",2),xo([y],tn.prototype,"filterTitle",2),tn=xo([I],tn);var Ic=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,rh=(e,t)=>Ic(e,"name",{value:t,configurable:!0}),Re=(e,t,n,r)=>{for(var o=r>1?void 0:r?nh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Ic(t,n,o),o};let he=class extends HTMLElement{connectedCallback(){p(".js-notification-focus-list",()=>{this.setupPaginationObserver()}),f("pjax:end","#js-repo-pjax-container",()=>{this.toggleCurrentFocusedNotification()})}disconnectedCallback(){this.disconnectCurrentObserver()}deactivateNavigation(){$a(this.container)}activateNavigation(){Ia(this.container)}replaceContent(e){this.container.innerHTML="",this.container.appendChild(e),this.setupPaginationObserver()}onRemoveItem(e){var t,n,r;const o=e.detail.notificationId,s=yc(this.container,".js-navigation-item.navigation-focus");(r=(n=(t=this.listElements)==null?void 0:t.find(i=>i.notificationId===o))==null?void 0:n.closest("li"))==null||r.remove(),this.listElements.length===0?(this.blankSlate.hidden=!1,this.list.hidden=!0):vc(s,this.container)}toggleCurrentFocusedNotification(){for(const e of this.listElements){const t=window.location.href.includes(e.url());e.setFocusedState(t)}}setupPaginationObserver(){!!window.IntersectionObserver&&this.nextPageItem&&(this.currentObserver=new IntersectionObserver(e=>{!e[0].isIntersecting||(this.disconnectCurrentObserver(),this.loadNextPage())},{root:this.container,threshold:0}),this.currentObserver.observe(this.nextPageItem))}async loadNextPage(){if(!this.nextPageItem)return;const e=this.nextPageItem.getAttribute("data-next-page-url");if(e){this.nextPageItemSpinner.hidden=!1;const t=await U(document,e);this.nextPageItem.remove();const n=t.querySelectorAll("ul > li.focus-notification-item");for(const o of n)this.list.appendChild(o);const r=t.querySelector("ul > li.focus-pagination-next-item");r&&this.list.appendChild(r),this.setupPaginationObserver()}}disconnectCurrentObserver(){this.currentObserver&&this.currentObserver.disconnect()}};rh(he,"NotificationFocusListElement"),Re([y],he.prototype,"container",2),Re([y],he.prototype,"includeFragment",2),Re([y],he.prototype,"list",2),Re([y],he.prototype,"blankSlate",2),Re([te],he.prototype,"listElements",2),Re([y],he.prototype,"nextPageItem",2),Re([y],he.prototype,"nextPageItemSpinner",2),he=Re([I],he);var Fc=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,sh=(e,t)=>Fc(e,"name",{value:t,configurable:!0}),tt=(e,t,n,r)=>{for(var o=r>1?void 0:r?oh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Fc(t,n,o),o};let Ee=class extends HTMLElement{constructor(){super(...arguments);this.notificationId="",this.isUnread=!1}connectedCallback(){var e,t;(e=this.closest(".js-navigation-item"))==null||e.addEventListener("navigation:keydown",this.handleCustomKeybindings.bind(this)),(t=this.closest(".js-navigation-item"))==null||t.addEventListener("navigation:keyopen",this.handleKeyOpen.bind(this))}url(){var e;return(e=this.notificationLink)==null?void 0:e.href}handleCustomKeybindings(e){const t=e.detail;!qn(t.originalEvent)||(t.hotkey==="e"?this.doneForm.dispatchEvent(new Event("submit")):t.hotkey==="M"&&this.unsubscribeForm.dispatchEvent(new Event("submit")))}handleKeyOpen(){this.notificationLink.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}setFocusedState(e){var t,n,r;e&&this.isUnread&&(this.isUnread=!1,(t=this.closest(".js-navigation-item"))==null||t.classList.remove("color-bg-default"),(n=this.closest(".js-navigation-item"))==null||n.classList.add("color-bg-subtle")),(r=this.closest(".js-navigation-item"))==null||r.classList.toggle("current-focused-item",e),this.notificationTitle.classList.toggle("text-bold",e||this.isUnread)}async runRemoveAction(e){e.preventDefault();const t=e.currentTarget,n=new FormData(t),r=t.method,o=t.action,{ok:s}=await fetch(o,{body:n,method:r});s&&this.dispatchEvent(new CustomEvent("focus-mode-remove-item",{bubbles:!0,detail:{notificationId:this.notificationId}}))}};sh(Ee,"NotificationFocusListItemElement"),tt([se],Ee.prototype,"notificationId",2),tt([se],Ee.prototype,"isUnread",2),tt([y],Ee.prototype,"doneForm",2),tt([y],Ee.prototype,"unsubscribeForm",2),tt([y],Ee.prototype,"notificationLink",2),tt([y],Ee.prototype,"notificationTitle",2),Ee=tt([I],Ee);var Oc=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,ah=(e,t)=>Oc(e,"name",{value:t,configurable:!0}),Kn=(e,t,n,r)=>{for(var o=r>1?void 0:r?ih(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Oc(t,n,o),o};let yt=class extends HTMLElement{connectedCallback(){this.addEventListener("notification-focus:toggle-sidebar",this.toggleSidebar.bind(this),!0),window.localStorage.getItem("focus-sidebar-active")==="true"&&this.toggleSidebar()}toggleSidebar(){this.adjustSidebarPosition(),this.sidebar.classList.contains("active")?(this.listElement.deactivateNavigation(),this.sidebar.classList.remove("active"),window.localStorage.removeItem("focus-sidebar-active")):(this.listElement.activateNavigation(),this.sidebar.classList.add("active"),window.localStorage.setItem("focus-sidebar-active","true"))}async onFocusFilterChange(e){const t=e.detail;if(t.url){this.listElement.deactivateNavigation();const n=await U(document,t.url);this.listElement.replaceContent(n),this.listElement.activateNavigation()}}adjustSidebarPosition(){const e=document.querySelector("header[role=banner]");if(e){const t=e.offsetTop+e.offsetHeight;this.sidebar.style.top=`${t-10}px`}}};ah(yt,"NotificationFocusSidebarElement"),Kn([y],yt.prototype,"sidebar",2),Kn([y],yt.prototype,"listElement",2),Kn([y],yt.prototype,"filtersElement",2),yt=Kn([I],yt);var Rc=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,lh=(e,t)=>Rc(e,"name",{value:t,configurable:!0}),R=(e,t,n,r)=>{for(var o=r>1?void 0:r?ch(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Rc(t,n,o),o};let F=class extends HTMLElement{constructor(){super(...arguments);this.selectedLabels=[]}async submitCustomForm(e){await this.submitForm(e),this.closeMenu()}async submitForm(e){e.preventDefault(),Fa();const t=e.currentTarget,n=new FormData(t),r=await self.fetch(t.action,{method:t.method,body:n,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!r.ok){qe();return}const o=await r.json(),s=n.get("do");typeof s=="string"&&this.updateCheckedState(s),typeof s=="string"&&this.updateMenuButtonCopy(s),this.updateSocialCount(o.count),this.applyInputsCheckedPropertiesToAttributesForNextFormReset()}updateMenuButtonCopy(e){this.unwatchButtonCopy.hidden=!(e==="subscribed"||e==="custom"),this.stopIgnoringButtonCopy.hidden=e!=="ignore",this.watchButtonCopy.hidden=!(e!=="subscribed"&&e!=="custom"&&e!=="ignore")}applyInputsCheckedPropertiesToAttributesForNextFormReset(){for(const e of[...this.threadTypeCheckboxes])e.toggleAttribute("checked",e.checked)}updateCheckedState(e){for(const t of this.subscriptionButtons)t.setAttribute("aria-checked",t.value===e?"true":"false");if(e==="custom")this.customButton.setAttribute("aria-checked","true");else{this.customButton.setAttribute("aria-checked","false");for(const t of[...this.threadTypeCheckboxes])$e(t,!1)}}updateSocialCount(e){this.socialCount&&(this.socialCount.textContent=e,this.socialCount.setAttribute("aria-label",`${this.pluralizeUsers(e)} watching this repository`))}pluralizeUsers(e){return parseInt(e)===1?"1 user is":`${e} users are`}selectLabel(e){const t=e.closest(".label-select-menu-item");if(t){const n=t.getAttribute("aria-checked")!=="true";t.setAttribute("aria-checked",n.toString());const r=t.querySelector("input"),o=r==null?void 0:r.getAttribute("value"),s=this.customDialog.querySelector(`[data-label-id="${o}"]`);s==null||s.toggleAttribute("hidden",!n)}}labelsToggled(e){e.preventDefault(),e.stopPropagation(),this.selectLabel(e.target)}openCustomDialog(e){e.preventDefault(),e.stopPropagation(),this.menu.toggleAttribute("hidden",!0),this.enableApplyButtonAndCheckbox(),this.customDialog.toggleAttribute("hidden",!1),setTimeout(()=>{var t;(t=this.customDialog.querySelector("input[type=checkbox][autofocus]"))==null||t.focus()},0)}enableApplyButtonAndCheckbox(){this.customDialog.querySelectorAll('[data-type="label"]:not([hidden])').length>0&&(this.customSubmit.removeAttribute("disabled"),this.threadTypeCheckboxes[0].checked=!0)}closeCustomDialog(e){e.preventDefault(),e.stopPropagation(),this.menu.toggleAttribute("hidden",!1),this.customDialog.toggleAttribute("hidden",!0),setTimeout(()=>{this.customButton.focus()},0)}resetFilterLabelsDialog(e){e.preventDefault(),e.stopPropagation();let t;for(let n=0;n<this.subscriptionsLabels.length;n++){t=this.subscriptionsLabels[n];const r=t==null?void 0:t.getAttribute("data-label-id"),o=this.filterLabelsDialog.querySelector(`[value="${r}"]`),s=o==null?void 0:o.closest(".select-menu-item");this.subscriptionsLabels[n].toggleAttribute("hidden",!0),s==null||s.setAttribute("aria-checked","false"),this.selectedLabels.includes(t==null?void 0:t.getAttribute("data-label-id"))&&(this.subscriptionsLabels[n].toggleAttribute("hidden",!1),s==null||s.setAttribute("aria-checked","true"))}this.closeFilterLabelsDialog(e)}openFilterLabelsDialog(e){e.preventDefault(),e.stopPropagation(),this.saveCurrentLabelsState(),this.customDialog.toggleAttribute("hidden",!0),this.filterLabelsDialog.toggleAttribute("hidden",!1),setTimeout(()=>{var t;(t=this.filterLabelsDialog.querySelector("input[type=checkbox][autofocus]"))==null||t.focus()},0)}closeFilterLabelsDialog(e){e.preventDefault(),e.stopPropagation(),this.menu.toggleAttribute("hidden",!0),this.customDialog.toggleAttribute("hidden",!1),this.filterLabelsDialog.toggleAttribute("hidden",!0)}applyFilterLabelsDialog(e){e.preventDefault(),e.stopPropagation(),this.saveCurrentLabelsState(),this.hideFilterSubtitle(),this.enableIssuesCheckbox(),this.closeFilterLabelsDialog(e)}enableIssuesCheckbox(){const e=this.selectedLabels.length>0;e&&this.threadTypeCheckboxes.length>0&&(this.threadTypeCheckboxes[0].checked=e),this.threadTypeCheckboxesUpdated()}hideFilterSubtitle(){const e=this.selectedLabels.length>0;this.subscriptionsSubtitle.toggleAttribute("hidden",e)}saveCurrentLabelsState(){this.selectedLabels.length=0,this.labelInputs.innerHTML="";const e=this.customDialog.querySelectorAll('[data-type="label"]:not([hidden])');for(let t=0;t<e.length;t++)this.saveLabelInput(e[t].getAttribute("data-label-id")),this.selectedLabels.push(e[t].getAttribute("data-label-id"))}saveLabelInput(e){if(e){const t=document.createElement("input");t.setAttribute("type","hidden"),t.setAttribute("name","labels[]"),t.setAttribute("value",e),this.labelInputs.appendChild(t)}}detailsToggled(){this.menu.toggleAttribute("hidden",!1),this.customDialog.toggleAttribute("hidden",!0)}submitCustom(e){e.preventDefault(),this.details.toggleAttribute("open",!1)}threadTypeCheckboxesUpdated(){const e=!this.threadTypeCheckboxes.some(t=>t.checked);this.customSubmit.disabled=e}closeMenu(){this.details.toggleAttribute("open",!1)}};lh(F,"NotificationsListSubscriptionFormElement"),R([y],F.prototype,"details",2),R([y],F.prototype,"menu",2),R([y],F.prototype,"customButton",2),R([y],F.prototype,"customDialog",2),R([y],F.prototype,"filterLabelsDialog",2),R([te],F.prototype,"subscriptionButtons",2),R([te],F.prototype,"subscriptionsLabels",2),R([te],F.prototype,"issueLabels",2),R([y],F.prototype,"labelInputs",2),R([y],F.prototype,"subscriptionsSubtitle",2),R([y],F.prototype,"socialCount",2),R([y],F.prototype,"unwatchButtonCopy",2),R([y],F.prototype,"stopIgnoringButtonCopy",2),R([y],F.prototype,"watchButtonCopy",2),R([te],F.prototype,"threadTypeCheckboxes",2),R([y],F.prototype,"customSubmit",2),F=R([I],F);var Dc=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,dh=(e,t)=>Dc(e,"name",{value:t,configurable:!0}),Hc=(e,t,n,r)=>{for(var o=r>1?void 0:r?uh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Dc(t,n,o),o};let Xn=class extends HTMLElement{closeMenu(){this.details.toggleAttribute("open",!1)}};dh(Xn,"NotificationsTeamSubscriptionFormElement"),Hc([y],Xn.prototype,"details",2),Xn=Hc([I],Xn);var fh=Object.defineProperty,Gn=(e,t)=>fh(e,"name",{value:t,configurable:!0});class Jn extends HTMLElement{connectedCallback(){this.addEventListener("input",Ao)}disconnectedCallback(){this.removeEventListener("input",Ao)}}Gn(Jn,"PasswordStrengthElement"),window.customElements.get("password-strength")||(window.PasswordStrengthElement=Jn,window.customElements.define("password-strength",Jn));function Ao(e){const t=e.currentTarget;if(!(t instanceof Jn))return;const n=e.target;if(!(n instanceof HTMLInputElement))return;const r=n.form;if(!(r instanceof HTMLFormElement))return;const o=Nc(n.value,{minimumCharacterCount:Number(t.getAttribute("minimum-character-count")),passphraseLength:Number(t.getAttribute("passphrase-length"))});if(o.valid){n.setCustomValidity("");const s=t.querySelector("dl.form-group");s&&(s.classList.remove("errored"),s.classList.add("successed"))}else n.setCustomValidity(t.getAttribute("invalid-message")||"Invalid");Bc(t,o),Dt(r)}Gn(Ao,"onInput");function Nc(e,t){const n={valid:!1,hasMinimumCharacterCount:e.length>=t.minimumCharacterCount,hasMinimumPassphraseLength:t.passphraseLength!==0&&e.length>=t.passphraseLength,hasLowerCase:/[a-z]/.test(e),hasNumber:/\d/.test(e)};return n.valid=n.hasMinimumPassphraseLength||n.hasMinimumCharacterCount&&n.hasLowerCase&&n.hasNumber,n}Gn(Nc,"validatePassword");function Bc(e,t){var n,r;const o=e.querySelector("[data-more-than-n-chars]"),s=e.querySelector("[data-min-chars]"),i=e.querySelector("[data-number-requirement]"),a=e.querySelector("[data-letter-requirement]"),c=((n=e.getAttribute("error-class"))==null?void 0:n.split(" ").filter(d=>d.length>0))||[],l=((r=e.getAttribute("pass-class"))==null?void 0:r.split(" ").filter(d=>d.length>0))||[];for(const d of[o,s,i,a])d==null||d.classList.remove(...c,...l);if(t.hasMinimumPassphraseLength&&o)o.classList.add(...l);else if(t.valid)s.classList.add(...l),i.classList.add(...l),a.classList.add(...l);else{const d=t.hasMinimumCharacterCount?l:c,m=t.hasNumber?l:c,h=t.hasLowerCase?l:c;o==null||o.classList.add(...c),s.classList.add(...d),i.classList.add(...m),a.classList.add(...h)}}Gn(Bc,"highlightPasswordStrengthExplainer");var mh=Object.defineProperty,ph=(e,t)=>mh(e,"name",{value:t,configurable:!0});class Po extends Yr{async fetch(t,n=1e3){const r=await super.fetch(t);return r.status===202?(await new Promise(o=>setTimeout(o,n)),this.fetch(t,n*1.5)):r}}ph(Po,"PollIncludeFragmentElement"),window.customElements.get("poll-include-fragment")||(window.PollIncludeFragmentElement=Po,window.customElements.define("poll-include-fragment",Po));var hh=Object.defineProperty,Uc=(e,t)=>hh(e,"name",{value:t,configurable:!0});class Mo extends na{connectedCallback(){nn.push(this),Qn||(qo(),Qn=window.setInterval(qo,1e3))}disconnectedCallback(){const t=nn.indexOf(this);t!==-1&&nn.splice(t,1),nn.length||(window.clearInterval(Qn),Qn=void 0)}getFormattedDate(){const t=this.date;if(!t)return;const n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),o=Math.floor(r/60),s=Math.floor(o/60),i=Math.floor(s/24),a=r-o*60,c=o-s*60,l=s-i*24;return o<1?this.applyPrecision([`${r}s`]):s<1?this.applyPrecision([`${o}m`,`${a}s`]):i<1?this.applyPrecision([`${s}h`,`${c}m`,`${a}s`]):this.applyPrecision([`${i}d`,`${l}h`,`${c}m`,`${a}s`])}applyPrecision(t){const n=Number(this.getAttribute("data-precision")||t.length);return t.slice(0,n).join(" ")}}Uc(Mo,"PreciseTimeAgoElement");const nn=[];let Qn;function qo(){for(const e of nn)e.textContent=e.getFormattedDate()||""}Uc(qo,"updateNowElements"),window.customElements.get("precise-time-ago")||(window.PreciseTimeAgoElement=Mo,window.customElements.define("precise-time-ago",Mo));var gh=Object.defineProperty,Wc=(e,t)=>gh(e,"name",{value:t,configurable:!0});const bh=/\s|\(|\[/;function zc(e,t,n){const r=e.lastIndexOf(t,n-1);if(r===-1||e.lastIndexOf(" ",n-1)>r)return;const s=e[r-1];return s&&!bh.test(s)?void 0:{word:e.substring(r+t.length,n),position:r+t.length,beginningOfLine:yh(s)}}Wc(zc,"keyword");const yh=Wc(e=>e===void 0||/\n/.test(e),"isBeginningOfLine");var vh=Object.defineProperty,wh=(e,t)=>vh(e,"name",{value:t,configurable:!0});const Lh=["position:absolute;","overflow:auto;","word-wrap:break-word;","top:0px;","left:-9999px;"],Vc=["box-sizing","font-family","font-size","font-style","font-variant","font-weight","height","letter-spacing","line-height","max-height","min-height","padding-bottom","padding-left","padding-right","padding-top","border-bottom","border-left","border-right","border-top","text-decoration","text-indent","text-transform","width","word-spacing"],Kc=new WeakMap;function Xc(e,t){const n=e.nodeName.toLowerCase();if(n!=="textarea"&&n!=="input")throw new Error("expected textField to a textarea or input");let r=Kc.get(e);if(r&&r.parentElement===e.parentElement)r.innerHTML="";else{r=document.createElement("div"),Kc.set(e,r);const a=window.getComputedStyle(e),c=Lh.slice(0);n==="textarea"?c.push("white-space:pre-wrap;"):c.push("white-space:nowrap;");for(let l=0,d=Vc.length;l<d;l++){const m=Vc[l];c.push(`${m}:${a.getPropertyValue(m)};`)}r.style.cssText=c.join(" ")}const o=document.createElement("span");o.style.cssText="position: absolute;",o.innerHTML=" ";let s,i;if(typeof t=="number"){let a=e.value.substring(0,t);a&&(s=document.createTextNode(a)),a=e.value.substring(t),a&&(i=document.createTextNode(a))}else{const a=e.value;a&&(s=document.createTextNode(a))}if(s&&r.appendChild(s),r.appendChild(o),i&&r.appendChild(i),!r.parentElement){if(!e.parentElement)throw new Error("textField must have a parentElement to mirror");e.parentElement.insertBefore(r,e)}return r.scrollTop=e.scrollTop,r.scrollLeft=e.scrollLeft,{mirror:r,marker:o}}wh(Xc,"textFieldMirror");var jh=Object.defineProperty,Eh=(e,t)=>jh(e,"name",{value:t,configurable:!0});function Gc(e,t=e.selectionEnd){const{mirror:n,marker:r}=Xc(e,t),o=n.getBoundingClientRect(),s=r.getBoundingClientRect();return setTimeout(()=>{n.remove()},5e3),{top:s.top-o.top,left:s.left-o.left}}Eh(Gc,"textFieldSelectionPosition");var Sh=Object.defineProperty,$o=(e,t)=>Sh(e,"name",{value:t,configurable:!0});const vt=new WeakMap;class Jc{constructor(t,n){this.expander=t,this.input=n,this.combobox=null,this.menu=null,this.match=null,this.justPasted=!1,this.oninput=this.onInput.bind(this),this.onpaste=this.onPaste.bind(this),this.onkeydown=this.onKeydown.bind(this),this.oncommit=this.onCommit.bind(this),this.onmousedown=this.onMousedown.bind(this),this.onblur=this.onBlur.bind(this),this.interactingWithMenu=!1,n.addEventListener("paste",this.onpaste),n.addEventListener("input",this.oninput),n.addEventListener("keydown",this.onkeydown),n.addEventListener("blur",this.onblur)}destroy(){this.input.removeEventListener("paste",this.onpaste),this.input.removeEventListener("input",this.oninput),this.input.removeEventListener("keydown",this.onkeydown),this.input.removeEventListener("blur",this.onblur)}activate(t,n){this.input===document.activeElement&&this.setMenu(t,n)}deactivate(){const t=this.menu,n=this.combobox;return!t||!n?!1:(this.menu=null,this.combobox=null,t.removeEventListener("combobox-commit",this.oncommit),t.removeEventListener("mousedown",this.onmousedown),n.destroy(),t.remove(),!0)}setMenu(t,n){this.deactivate(),this.menu=n,n.id||(n.id=`text-expander-${Math.floor(Math.random()*1e5).toString()}`),this.expander.append(n);const r=n.querySelector(".js-slash-command-menu-items");r?this.combobox=new Zr(this.input,r):this.combobox=new Zr(this.input,n);const{top:o,left:s}=Gc(this.input,t.position),i=parseInt(window.getComputedStyle(this.input).fontSize);n.style.top=`${o+i}px`,n.style.left=`${s}px`,this.combobox.start(),n.addEventListener("combobox-commit",this.oncommit),n.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1)}setValue(t){if(t==null)return;const n=this.match;if(!n)return;const r=this.input.value.substring(0,n.position-n.key.length),o=this.input.value.substring(n.position+n.text.length);let{cursor:s,value:i}=this.replaceCursorMark(t);i=(i==null?void 0:i.length)===0?i:`${i} `,this.input.value=r+i+o,this.deactivate(),this.input.focus(),s=r.length+(s||i.length),this.input.selectionStart=s,this.input.selectionEnd=s}replaceCursorMark(t){const n=/%cursor%/gm,r=n.exec(t);return r?{cursor:r.index,value:t.replace(n,"")}:{cursor:null,value:t}}onCommit({target:t}){const n=t;if(!(n instanceof HTMLElement)||!this.combobox)return;const r=this.match;if(!r)return;const o={item:n,key:r.key,value:null};!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:o}))||o.value&&this.setValue(o.value)}onBlur(){if(this.interactingWithMenu){this.interactingWithMenu=!1;return}this.deactivate()}onPaste(){this.justPasted=!0}async delay(t){return new Promise(n=>setTimeout(n,t))}async onInput(){if(this.justPasted){this.justPasted=!1;return}const t=this.findMatch();if(t){if(this.match=t,await this.delay(this.appropriateDelay(this.match)),this.match!==t)return;const n=await this.notifyProviders(t);if(!this.match)return;n?this.activate(t,n):this.deactivate()}else this.match=null,this.deactivate()}appropriateDelay(t){return t.beginningOfLine||t.text!==""?0:250}findMatch(){const t=this.input.selectionEnd,n=this.input.value;for(const r of this.expander.keys){const o=zc(n,r,t);if(o)return{text:o.word,key:r,position:o.position,beginningOfLine:o.beginningOfLine}}}async notifyProviders(t){const n=[],r=$o(a=>n.push(a),"provide");return this.expander.dispatchEvent(new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:r,text:t.text,key:t.key}}))?(await Promise.all(n)).filter(a=>a.matched).map(a=>a.fragment)[0]:void 0}onMousedown(){this.interactingWithMenu=!0}onKeydown(t){t.key==="Escape"&&this.deactivate()&&(t.stopImmediatePropagation(),t.preventDefault())}}$o(Jc,"SlashCommandExpander");class Io extends HTMLElement{get keys(){const t=this.getAttribute("keys");return t?t.split(" "):[]}connectedCallback(){const t=this.querySelector('input[type="text"], textarea');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=new Jc(this,t);vt.set(this,n)}disconnectedCallback(){const t=vt.get(this);!t||(t.destroy(),vt.delete(this))}setValue(t){const n=vt.get(this);!n||n.setValue(t)}setMenu(t,n=!1){const r=vt.get(this);!r||!r.match||(n&&(r.interactingWithMenu=!0),r.setMenu(r.match,t))}closeMenu(){const t=vt.get(this);!t||t.setValue("")}isLoading(){const t=this.getElementsByClassName("js-slash-command-expander-loading")[0];if(t){const n=t.cloneNode(!0);n.classList.remove("d-none"),this.setMenu(n)}}showError(){const t=this.getElementsByClassName("js-slash-command-expander-error")[0];if(t){const n=t.cloneNode(!0);n.classList.remove("d-none"),this.setMenu(n)}}}$o(Io,"SlashCommandExpanderElement"),window.customElements.get("slash-command-expander")||(window.SlashCommandExpanderElement=Io,window.customElements.define("slash-command-expander",Io)),f("deprecatedAjaxSend","[data-remote]",function(e){e.currentTarget===e.target&&(e.defaultPrevented||e.currentTarget.classList.add("loading"))}),f("deprecatedAjaxComplete","[data-remote]",function(e){e.currentTarget===e.target&&e.currentTarget.classList.remove("loading")}),M("form.js-ajax-pagination, .js-ajax-pagination form",async function(e,t){const n=e.closest(".js-ajax-pagination");let r;try{r=await t.html()}catch(o){if(o.response&&o.response.status===404){n.remove();return}else throw o}n.replaceWith(r.html),v(e,"page:loaded")});const kh="analytics.click";f("click","[data-analytics-event]",e=>{const n=e.currentTarget.getAttribute("data-analytics-event");if(!n)return;const r=JSON.parse(n);Ht(kh,r)}),document.addEventListener("pjax:start",function(){ze("Loading page")}),document.addEventListener("pjax:error",function(){ze("Loading failed")}),document.addEventListener("pjax:end",function(){ze("Loading complete")});var _h=Object.defineProperty,Qc=(e,t)=>_h(e,"name",{value:t,configurable:!0});const Yc=new WeakMap;p("auto-check",function(e){if(e.classList.contains("js-prevent-default-behavior"))return;const t=e.querySelector("input");if(!t)return;const n=t.closest(".form-group")||e,r=t.form;let o;function s(){return o||(o=`input-check-${(Math.random()*1e4).toFixed(0)}`),o}Qc(s,"generateId");const i=t.getAttribute("aria-describedby");t.addEventListener("focusout:delay",()=>{t.setAttribute("aria-describedby",[o,i].join(" "))});const a=n.querySelector("p.note");a&&(a.id||(a.id=s()),Yc.set(a,a.innerHTML)),e.addEventListener("loadstart",()=>{Yn(t,n),n.classList.add("is-loading"),t.classList.add("is-autocheck-loading"),Dt(r)}),e.addEventListener("loadend",()=>{n.classList.remove("is-loading"),t.classList.remove("is-autocheck-loading")}),t.addEventListener("auto-check-success",async c=>{t.classList.add("is-autocheck-successful"),n.classList.add("successed"),Dt(r);const{response:l}=c.detail;if(!l)return;const d=await l.text();if(!!d){if(a instanceof HTMLElement)a.innerHTML=d,Ve(a);else{const m=l.status===200,h=n.tagName==="DL"?"dd":"div",g=document.createElement(h);g.id=s(),g.classList.add(m?"success":"warning"),g.innerHTML=d,n.append(g),n.classList.add(m?"successed":"warn"),Ve(g),m&&(g.hidden=document.activeElement!==t)}v(t,"auto-check-message-updated")}}),t.addEventListener("auto-check-error",async c=>{t.classList.add("is-autocheck-errored"),n.classList.add("errored"),Dt(r);const{response:l}=c.detail;if(!l)return;const d=await l.text();if(a instanceof HTMLElement)a.innerHTML=d||"Something went wrong",Ve(a);else{const m=n.tagName==="DL"?"dd":"div",h=document.createElement(m);h.id=s(),h.classList.add("error"),h.innerHTML=d||"Something went wrong",n.append(h),Ve(h)}}),t.addEventListener("input",()=>{t.removeAttribute("aria-describedby"),t.value||Yn(t,n)}),t.addEventListener("blur",()=>{const c=n.querySelector(".success");c&&(c.hidden=!0)}),t.addEventListener("focus",()=>{const c=n.querySelector(".success");c&&(c.hidden=!1)}),r.addEventListener("reset",()=>{Yn(t,n)})});function Yn(e,t){var n,r,o,s,i,a;t.classList.remove("is-loading","successed","errored","warn"),e.classList.remove("is-autocheck-loading","is-autocheck-successful","is-autocheck-errored");const c=t.querySelector("p.note");if(c){const l=Yc.get(c);l&&(c.innerHTML=l)}t.tagName==="DL"?((n=t.querySelector("dd.error"))==null||n.remove(),(r=t.querySelector("dd.warning"))==null||r.remove(),(o=t.querySelector("dd.success"))==null||o.remove()):((s=t.querySelector("div.error"))==null||s.remove(),(i=t.querySelector("div.warning"))==null||i.remove(),(a=t.querySelector("div.success"))==null||a.remove())}Qc(Yn,"reset");var Th=Object.defineProperty,Ch=(e,t)=>Th(e,"name",{value:t,configurable:!0});p("auto-complete",function(e){e.addEventListener("loadstart",()=>e.classList.add("is-auto-complete-loading")),e.addEventListener("loadend",()=>e.classList.remove("is-auto-complete-loading"))}),p("auto-complete",{constructor:ra,initialize:Fo}),f("auto-complete-change","auto-complete",function(e){Fo(e.currentTarget)});function Fo(e){const t=e.closest("form");if(!t)return;const n=t.querySelector(".js-auto-complete-button");n instanceof HTMLButtonElement&&(n.disabled=!e.value)}Ch(Fo,"toggleSubmitButton");let Oo=null;f("submit","[data-autosearch-results-container]",async function(e){const t=e.currentTarget;if(!(t instanceof HTMLFormElement))return;e.preventDefault(),Oo==null||Oo.abort(),t.classList.add("is-sending");const n=new URL(t.action,window.location.origin),r=t.method,o=so(t);let s=null;r==="get"?n.search=o:s=new FormData(t);const{signal:i}=Oo=new AbortController,a=new Request(n.toString(),{method:r,body:s,signal:i,headers:{Accept:"text/html","X-Requested-With":"XMLHttpRequest"}});let c;try{c=await fetch(a)}catch{}if(t.classList.remove("is-sending"),!c||!c.ok||i.aborted)return;const l=t.getAttribute("data-autosearch-results-container"),d=l?document.getElementById(l):null;d&&(d.innerHTML="",d.appendChild(fe(document,await c.text()))),Ke(null,"",`?${o}`)}),Nt("input[data-autoselect], textarea[data-autoselect]",async function(e){await Xe(),e.select()});var xh=Object.defineProperty,Ah=(e,t)=>xh(e,"name",{value:t,configurable:!0});f("change","form[data-autosubmit]",function(e){const t=e.currentTarget;V(t)}),f("change","input[data-autosubmit], select[data-autosubmit]",Ro);function Ro(e){const t=e.target;if(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLSelectElement))return;const n=t.form;V(n)}Ah(Ro,"submit");const Ph=We(Ro,300);p("input[data-throttled-autosubmit]",{subscribe:e=>E(e,"input",Ph)});var Mh=Object.defineProperty,Zc=(e,t)=>Mh(e,"name",{value:t,configurable:!0});async function el(e){const t=e.getAttribute("data-url")||"";if(await tl(t)){const r=e.getAttribute("data-gravatar-text");r!=null&&(e.textContent=r)}}Zc(el,"detectGravatar"),p(".js-detect-gravatar",function(e){el(e)});async function tl(e){const t=e;if(!t)return!1;try{const n=await fetch(t,{headers:{Accept:"application/json"}});return n.ok?(await n.json()).has_gravatar:!1}catch{return!1}}Zc(tl,"fetchGravatarInfo");var nl=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Do=(e,t)=>nl(e,"name",{value:t,configurable:!0}),Ho=(e,t,n,r)=>{for(var o=r>1?void 0:r?qh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&nl(t,n,o),o};class rl{constructor(t=50,n=30){this.elements=[],this.timer=null,this.callbacks=[],this.csrf=null,this.timeout=t,this.limit=n}push(t){if(this.timer&&(window.clearTimeout(this.timer),this.timer=null),t instanceof HTMLElement){const n=t.querySelector("[data-csrf]");n!==null&&(this.csrf=n.value)}this.elements.length>=this.limit&&this.flush(),this.elements.push(t),this.timer=window.setTimeout(()=>{this.flush()},this.timeout)}onFlush(t){this.callbacks.push(t)}async flush(){const t=this.elements.splice(0,this.limit);t.length!==0&&await Promise.all(this.callbacks.map(n=>n(t)))}}Do(rl,"AutoFlushingQueue");async function ol(e,t){const n=await fetch(e,{method:"POST",body:t,headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}});if(n.ok){const r=await n.json(),o=new Map;for(const s in r)o.set(s,r[s]);return o}else return new Map}Do(ol,"fetchContents");const sl=new Map;let rn=class extends HTMLElement{constructor(){super(...arguments);this.url=""}connectedCallback(){this.queue.push(this)}get queue(){let e=sl.get(this.url);return e||(e=this.buildAutoFlushingQueue(),sl.set(this.url,e),e)}buildAutoFlushingQueue(){const e=new rl;return e.onFlush(async t=>{const n=new Map,r=new FormData;e.csrf!==null&&r.set("authenticity_token",e.csrf);for(const s in t){const i=t[s],a=`item-${s}`;n.set(a,i);for(const c of i.inputs)r.append(`items[${a}][${c.name}]`,c.value)}const o=await ol(this.url,r);for(const[s,i]of o.entries())n.get(s).replaceWith(fe(document,i))}),e}};Do(rn,"BatchDeferredContentElement"),Ho([se],rn.prototype,"url",2),Ho([te],rn.prototype,"inputs",2),rn=Ho([I],rn);var $h=Object.defineProperty,wt=(e,t)=>$h(e,"name",{value:t,configurable:!0});let No=null;f("click",".js-org-signup-duration-change",e=>{e.preventDefault();const n=e.currentTarget.getAttribute("data-plan-duration");al(n),ll(n);for(const r of document.querySelectorAll(".js-seat-field"))nt(r);il()}),f("change",".js-org-signup-duration-toggle",function({currentTarget:e}){const t=document.getElementById("js-pjax-container"),n=new URL(e.getAttribute("data-url"),window.location.origin);Ut({url:n.toString(),container:t})});async function nt(e){const t=e.getAttribute("data-item-name")||"items",n=e.value,r=new URL(e.getAttribute("data-url"),window.location.origin),o=new URLSearchParams(r.search.slice(1)),s=o.get("plan_duration")||e.getAttribute("data-plan-duration"),i=parseInt(e.getAttribute("data-item-minimum"))||0,a=parseInt(e.getAttribute("data-item-maximum"))||s==="year"?100:300,c=parseInt(e.getAttribute("data-item-count"))||0,l=Math.max(i,parseInt(n)||0),d=l>a,m=document.querySelector(".js-downgrade-button"),h=document.getElementById("downgrade-disabled-message");m instanceof HTMLButtonElement&&(m.disabled=l===c),h instanceof HTMLElement&&m instanceof HTMLButtonElement&&(h.hidden=!m.disabled),o.append(t,l.toString()),document.querySelector(".js-transform-user")&&o.append("transform_user","1"),r.search=o.toString(),No==null||No.abort();const{signal:w}=No=new AbortController;let L=null;try{const O=await fetch(r.toString(),{signal:w,headers:{Accept:"application/json"}});if(!O.ok)return;L=await O.json()}catch{}if(w.aborted||!L)return;const x=document.querySelector(".js-contact-us");x&&x.classList.toggle("d-none",!d);const j=document.querySelector(".js-payment-summary");j&&j.classList.toggle("d-none",d);const P=document.querySelector(".js-submit-billing");P instanceof HTMLElement&&(P.hidden=d);const A=document.querySelector(".js-billing-section");A&&A.classList.toggle("has-removed-contents",L.free||L.is_enterprise_cloud_trial);const q=document.querySelector(".js-upgrade-info");q&&q.classList.toggle("d-none",l<=0);const ve=document.querySelector(".js-downgrade-info");ve&&ve.classList.toggle("d-none",l>=0);const T=document.querySelector(".js-extra-seats-line-item");T&&T.classList.toggle("d-none",L.no_additional_seats),document.querySelector(".js-seat-field")&&cl(n);const Q=document.querySelector(".js-minimum-seats-disclaimer");Q&&(Q.classList.toggle("tooltipped",L.seats===5),Q.classList.toggle("tooltipped-nw",L.seats===5));const ft=L.selectors;for(const O in ft)for(const It of document.querySelectorAll(O))It.innerHTML=ft[O];Ke(Oa(),"",L.url)}wt(nt,"updateTotals");function il(){for(const e of document.querySelectorAll(".js-unit-price"))e.hidden=!e.hidden}wt(il,"toggleDurationUnitPrices");function al(e){const t=e==="year"?"month":"year";for(const r of document.querySelectorAll(".js-plan-duration-text"))r.innerHTML=e;for(const r of document.querySelectorAll(".unstyled-available-plan-duration-adjective"))r.innerHTML=`${e}ly`;for(const r of document.querySelectorAll(".js-org-signup-duration-change"))r.setAttribute("data-plan-duration",t);const n=document.getElementById("signup-plan-duration");n&&(n.value=e)}wt(al,"updateDurationFields");function cl(e){var t;for(const n of document.querySelectorAll(".js-seat-field")){const r=n.getAttribute("data-item-max-seats"),o=(t=n==null?void 0:n.parentNode)==null?void 0:t.querySelector(".Popover");r&&r.length?parseInt(e,10)>parseInt(r,10)?(n.classList.add("color-border-danger-emphasis"),o==null||o.removeAttribute("hidden")):(n.classList.remove("color-border-danger-emphasis"),o==null||o.setAttribute("hidden","true"),n.value=e):n.value=e}}wt(cl,"updateSeatFields");function ll(e){for(const t of document.querySelectorAll(".js-seat-field")){const n=new URL(t.getAttribute("data-url"),window.location.origin),r=new URLSearchParams(n.search.slice(1));r.delete("plan_duration"),r.append("plan_duration",e),n.search=r.toString(),t.setAttribute("data-url",n.toString())}}wt(ll,"updateSeatFieldURLs"),p(".js-addon-purchase-field",{constructor:HTMLInputElement,add(e){Bt(e)&&nt(e),$n(e,function(){nt(e)})}}),p(".js-addon-downgrade-field",{constructor:HTMLSelectElement,add(e){Bt(e)&&nt(e),e.addEventListener("change",function(){nt(e)})}});function ul(e){const t=document.querySelector(".js-addon-purchase-field"),n=e.target.querySelector("input:checked");if(t instanceof HTMLInputElement&&n instanceof HTMLInputElement){const r=n.getAttribute("data-upgrade-url");r&&(t.setAttribute("data-url",r),t.value="0",nt(t))}}wt(ul,"handleOrgChange"),f("details-menu-selected",".js-organization-container",ul,{capture:!0}),me(".js-csv-filter-field",function(e){const t=e.target.value.toLowerCase();for(const n of document.querySelectorAll(".js-csv-data tbody tr"))n instanceof HTMLElement&&(!n.textContent||(n.hidden=!!t&&!n.textContent.toLowerCase().includes(t)))});var Ih=Object.defineProperty,Fh=(e,t)=>Ih(e,"name",{value:t,configurable:!0});p(".js-blob-header.is-stuck",{add(e){Bo(e)},remove(e){Bo(e,!0)}});function Bo(e,t=!1){const n={"tooltipped-nw":"tooltipped-sw","tooltipped-n":"tooltipped-s","tooltipped-ne":"tooltipped-se"};for(const[r,o]of Object.entries(n)){const s=t?o:r,i=t?r:o;for(const a of e.querySelectorAll(`.${s}`))a.classList.replace(s,i)}}Fh(Bo,"flipTooltip");var Oh=Object.defineProperty,X=(e,t)=>Oh(e,"name",{value:t,configurable:!0});let Uo=!1;function Zn(e,t){return document.querySelector(`#${e}LC${t}`)}X(Zn,"queryLineElement");function dl({blobRange:e,anchorPrefix:t}){if(document.querySelectorAll(".js-file-line").length!==0&&(fl(),!!e)){if(e.start.column===null||e.end.column===null)for(let r=e.start.line;r<=e.end.line;r+=1){const o=Zn(t,r);o&&o.classList.add("highlighted")}else if(e.start.line===e.end.line&&e.start.column!=null&&e.end.column!=null){const r=io(e,o=>Zn(t,o));if(r){const o=document.createElement("span");o.classList.add("highlighted"),ao(r,o)}}}}X(dl,"highlightLines");function fl(){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=e.closest(".js-file-line");e.replaceWith(...e.childNodes),t.normalize()}}X(fl,"clearHighlights");function ml(){const e=co(window.location.hash);dl(e),vl();const{blobRange:t,anchorPrefix:n}=e,r=t&&Zn(n,t.start.line);if(!Uo&&r){r.scrollIntoView();const o=r.closest(".blob-wrapper, .js-blob-wrapper");o.scrollLeft=0}Uo=!1}X(ml,"scrollLinesIntoView"),Wt(function(){if(document.querySelector(".js-file-line-container")){setTimeout(ml,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,window.location.origin);n.hash=e,t.action=n.toString()}}});function pl(e){const t=[];for(const r of e)t.push(r.textContent);const n=document.getElementById("js-copy-lines");if(n instanceof eo){n.textContent=`Copy ${e.length===1?"line":"lines"}`,n.value=t.join(`
|
|
`);const r=`Blob, copyLines, numLines:${e.length.toString()}`;n.setAttribute("data-ga-click",r)}}X(pl,"setCopyLines");function hl(e){const t=document.querySelector(".js-permalink-shortcut");if(t instanceof HTMLAnchorElement){const n=`${t.href}${window.location.hash}`,r=document.getElementById("js-copy-permalink");if(r instanceof eo){r.value=n;const o=`Blob, copyPermalink, numLines:${e.toString()}`;r.setAttribute("data-ga-click",o)}return n}}X(hl,"setPermalink");function gl(e,t){const n=document.getElementById("js-new-issue");if(n instanceof HTMLAnchorElement){if(!n.href)return;const r=new URL(n.href,window.location.origin),o=new URLSearchParams(r.search);o.set("permalink",e),r.search=o.toString(),n.href=r.toString(),n.setAttribute("data-ga-click",`Blob, newIssue, numLines:${t.toString()}`)}}X(gl,"setOpenIssueLink");function bl(e,t){const n=document.getElementById("js-new-discussion");if(!(n instanceof HTMLAnchorElement)||!(n==null?void 0:n.href))return;const r=new URL(n.href,window.location.origin),o=new URLSearchParams(r.search);o.set("permalink",e),r.search=o.toString(),n.href=r.toString(),n.setAttribute("data-ga-click",`Blob, newDiscussion, numLines:${t.toString()}`)}X(bl,"setOpenDiscussionLink");function yl(e){const t=document.getElementById("js-view-git-blame");!t||t.setAttribute("data-ga-click",`Blob, viewGitBlame, numLines:${e.toString()}`)}X(yl,"setViewGitBlame");function vl(){const e=document.querySelector(".js-file-line-actions");if(!e)return;const t=document.querySelectorAll(".js-file-line.highlighted"),n=t[0];if(n){pl(t),yl(t.length);const r=hl(t.length);r&&gl(r,t.length),r&&bl(r,t.length),e.style.top=`${n.offsetTop-2}px`,e.classList.remove("d-none")}else e.classList.add("d-none")}X(vl,"showOrHideLineActions");function wl(e){const t=window.scrollY;Uo=!0,e(),window.scrollTo(0,t)}X(wl,"preserveLineNumberScrollPosition"),f("click",".js-line-number",function(e){const t=co(e.currentTarget.id),{blobRange:n}=t,r=Ra(window.location.hash);r&&e.shiftKey&&(t.blobRange={start:r.start,end:n.end}),wl(()=>{window.location.hash=Da(t)})}),f("submit",".js-jump-to-line-form",function(e){const r=e.currentTarget.querySelector(".js-jump-to-line-field").value.replace(/[^\d-]/g,"").split("-").map(o=>parseInt(o,10)).filter(o=>o>0).sort((o,s)=>o-s);r.length&&(window.location.hash=`L${r.join("-L")}`),e.preventDefault()}),p(".js-check-bidi",El);const Rh=/[\u202A-\u202E]|[\u2066-\u2069]/,Ll={"\u202A":"U+202A","\u202B":"U+202B","\u202C":"U+202C","\u202D":"U+202D","\u202E":"U+202E","\u2066":"U+2066","\u2067":"U+2067","\u2068":"U+2068","\u2069":"U+2069"};function Wo(e,t){if(e.nodeType===Node.TEXT_NODE)return jl(e,t);if(!e.childNodes||!e.childNodes.length)return!1;let n=!1;for(const r of e.childNodes)if(n||(n=Wo(r,t)),n&&!t)break;return n}X(Wo,"checkNodeForBidiCharacters");function jl(e,t){let n=!1;if(e.nodeValue)for(let r=e.nodeValue.length-1;r>=0;r--){const o=e.nodeValue.charAt(r);if(Ll[o]){if(n=!0,!t)break;const s=new de(t,{revealedCharacter:Ll[o]}),i=new Range;i.setStart(e,r),i.setEnd(e,r+1),i.deleteContents(),i.insertNode(s)}}return n}X(jl,"checkTextNodeForBidiCharacters");function El(e){let t=!1;const n=performance.now(),r=e.textContent||"";if(Rh.test(r)){const i=e.querySelectorAll(".diff-table .blob-code-inner, .js-file-line-container .js-file-line, .js-suggested-changes-blob .blob-code-inner"),a=document.querySelector(".js-line-alert-template"),c=document.querySelector(".js-revealed-character-template");for(const l of i)if(Wo(l,c)&&(t=!0,a)){const d=new de(a,{});e.getAttribute("data-line-alert")==="before"?l.before(d):l.after(d)}}const s={durationMs:(performance.now()-n).toString(),result:t.toString()};if(Ht("blob_js_check_bidi_character",s),t){const i=document.querySelector(".js-file-alert-template");if(i){const a=new URL(window.location.href,window.location.origin);a.searchParams.get("h")==="1"?a.searchParams.delete("h"):a.searchParams.set("h","1");const c=new de(i,{revealButtonHref:a.href});e.prepend(c)}}e.classList.remove("js-check-bidi")}X(El,"alertOnBidiCharacter");function Sl(e){var t;const n=e.closest(".js-blob-code-container"),r=e.querySelector(".js-codeowners-error-tooltip-template"),o=e.querySelector(".js-codeowners-error-line-alert-template");if(!n||!r||!o)return;const s=e.querySelectorAll(".js-codeowners-error");for(const i of s){const a=i.getAttribute("data-line"),c=parseInt(i.getAttribute("data-column")||"",10),l=i.getAttribute("data-kind"),d=i.getAttribute("data-suggestion"),m=n.querySelector(`.js-file-line-container [data-line-number='${a}'] + .js-file-line`);if(!m)continue;let h=isNaN(c)?0:c-1,g;for(g of m.childNodes){const A=(g.textContent||"").length;if(A>h)break;h-=A}for(;g&&g.nodeName!=="#text";)g=g.childNodes[0];if(!g)continue;let w=l;d&&(w+=`: ${d}`);const L=document.createRange();L.setStart(g,h),L.setEnd(g,((t=g.textContent)==null?void 0:t.length)||h+1);const x=document.createElement("SPAN");x.className="error-highlight",L.surroundContents(x);const j=new de(r,{message:w}).firstElementChild;L.surroundContents(j);const P=new de(o,{});m.after(P)}}X(Sl,"annotateCodeownersErrors"),p(".js-codeowners-errors",Sl);var Dh=Object.defineProperty,Hh=(e,t)=>Dh(e,"name",{value:t,configurable:!0});function kl(e){const t=e.target,n=t==null?void 0:t.closest(".js-branch-protection-integration-select"),r=n==null?void 0:n.querySelector(".js-branch-protection-integration-select-current"),o=t==null?void 0:t.closest(".js-branch-protection-integration-select-item"),s=o==null?void 0:o.querySelector(".js-branch-protection-integration-select-label");r&&s&&n&&(r.innerHTML=s.innerHTML,n.open=!1)}Hh(kl,"changeSelection"),f("change",".js-branch-protection-integration-select-input",kl);var Nh=Object.defineProperty,zo=(e,t)=>Nh(e,"name",{value:t,configurable:!0});function _l(e){const t=new URL(e.getAttribute("data-bulk-actions-url"),window.location.origin),n=new URLSearchParams(t.search.slice(1)),r=e.getAttribute("data-bulk-actions-parameter"),o=Array.from(e.querySelectorAll(".js-bulk-actions-toggle:checked"));if(r){const s=o.map(i=>i.closest(".js-bulk-actions-item").getAttribute("data-bulk-actions-id")).sort();for(const i of s)n.append(`${r}[]`,i)}else for(const s of o.sort((i,a)=>i.value>a.value?1:-1))n.append(s.name,s.value);return t.search=n.toString(),t.toString()}zo(_l,"bulkUrl");let Vo=null;async function Tl(e){const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.querySelector(".js-bulk-actions"),r=!!t.querySelector(".js-bulk-actions-toggle:checked");Vo==null||Vo.abort();const{signal:o}=Vo=new AbortController;let s="";try{const i=await fetch(_l(t),{signal:o,headers:{"X-Requested-With":"XMLHttpRequest"}});if(!i.ok)return;s=await i.text()}catch{}o.aborted||!s||(r?(Ko(t),n.innerHTML=s):(n.innerHTML=s,Ko(t)),v(t,"bulk-actions:updated"))}zo(Tl,"updateBulkActions");function Ko(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)}}zo(Ko,"toggleMembershipTabs"),f("change",".js-bulk-actions-toggle",function(e){const n=e.currentTarget.closest(".js-bulk-actions-container");v(n,"bulk-actions:update")}),f("bulk-actions:update",".js-bulk-actions-container",We(Tl,100));var Bh=Object.defineProperty,er=(e,t)=>Bh(e,"name",{value:t,configurable:!0});function Cl(e){try{const t=window.localStorage.getItem(e);return{kind:"ok",value:t?JSON.parse(t):null}}catch(t){return{kind:"err",value:t}}}er(Cl,"getLocalJSON");function Xo(e,t){try{return window.localStorage.setItem(e,JSON.stringify(t)),{kind:"ok",value:null}}catch(n){return{kind:"err",value:n}}}er(Xo,"setLocalJSON");function xl(){const e={};for(const t of document.getElementsByTagName("script")){const n=t.src.match(/\/([\w-]+)-[0-9a-f]{8,}\.js$/);n&&(e[`${n[1]}.js`]=t.src)}for(const t of document.getElementsByTagName("link")){const n=t.href.match(/\/([\w-]+)-[0-9a-f]{8,}\.css$/);n&&(e[`${n[1]}.css`]=t.href)}return e}er(xl,"gatherBundleURLs");function Al(){const e=xl(),t=Cl("bundle-urls");if(t.kind==="err"){Xo("bundle-urls",e);return}const n=t.value||{},r=Object.keys(e).filter(o=>n[o]!==e[o]);r.length&&Xo("bundle-urls",{...n,...e}).kind==="ok"&&we({downloadedBundles:r})}er(Al,"report"),(async()=>{await zt,window.requestIdleCallback(Al)})();var Uh=Object.defineProperty,Wh=(e,t)=>Uh(e,"name",{value:t,configurable:!0});let Pl,Go=!1;function Jo(){Pl=document.activeElement,document.body&&document.body.classList.toggle("intent-mouse",Go)}Wh(Jo,"setClass"),document.addEventListener("mousedown",function(){Go=!0,Pl===document.activeElement&&Jo()},{capture:!0}),document.addEventListener("keydown",function(){Go=!1},{capture:!0}),document.addEventListener("focusin",Jo,{capture:!0});var zh=Object.defineProperty,Vh=(e,t)=>zh(e,"name",{value:t,configurable:!0});function Ml(e){e.preventDefault(),e.stopPropagation()}Vh(Ml,"cancelEvent"),p("a.btn.disabled",{subscribe:e=>E(e,"click",Ml)}),p(".js-check-all-container",{constructor:HTMLElement,subscribe:oa});var Kh=Object.defineProperty,ql=(e,t)=>Kh(e,"name",{value:t,configurable:!0});const $l="logout-was-successful";function Il(){for(const e of[sessionStorage,localStorage])try{e.clear()}catch{}}ql(Il,"clearData");function Fl(){Lo($l).length>0&&(Il(),jo($l))}ql(Fl,"clearDataIfJustLoggedOut"),Fl();var Xh=Object.defineProperty,Ol=(e,t)=>Xh(e,"name",{value:t,configurable:!0});const Rl=2e3;f("clipboard-copy","[data-copy-feedback]",e=>{const t=e.currentTarget,n=t.getAttribute("data-copy-feedback"),r=t.getAttribute("aria-label"),o=t.getAttribute("data-tooltip-direction")||"s";t.setAttribute("aria-label",n),t.classList.add("tooltipped",`tooltipped-${o}`),t instanceof HTMLElement&&(Ve(t),setTimeout(()=>{r?t.setAttribute("aria-label",r):t.removeAttribute("aria-label"),t.classList.remove("tooltipped",`tooltipped-${o}`)},Rl))});function Dl(e){Yo.delete(e),Qo(e)}Ol(Dl,"timerCallback");function Qo(e){const t=e.querySelector(".js-clipboard-copy-icon"),n=e.querySelector(".js-clipboard-check-icon");e.classList.toggle("ClipboardButton--success"),t&&t.classList.toggle("d-none"),n&&(n.classList.contains("d-sm-none")?n.classList.toggle("d-sm-none"):n.classList.toggle("d-none"))}Ol(Qo,"toggleCopyButton");const Yo=new WeakMap;f("clipboard-copy",".js-clipboard-copy:not([data-view-component])",function({currentTarget:e}){if(!(e instanceof HTMLElement))return;const t=Yo.get(e);t?clearTimeout(t):Qo(e),Yo.set(e,setTimeout(Dl,Rl,e))});var Gh=Object.defineProperty,G=(e,t)=>Gh(e,"name",{value:t,configurable:!0});f("click",".js-code-nav-retry",async function(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;const t=document.querySelector(".js-tagsearch-popover");if(!t)return;const n=t.querySelector(".js-tagsearch-popover-content");if(!n)return;let r;const o=e.currentTarget;o.getAttribute("data-code-nav-kind")==="definitions"?r=t.querySelector(".js-tagsearch-popover-content"):r=t.querySelector(".js-code-nav-references");const i=o.getAttribute("data-code-nav-url"),a=new URL(i,window.location.origin),c=await fetch(a.toString(),{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!c.ok)return;const l=await c.text();!l||(r.innerHTML=l,n.scrollTop=0)}),p(".js-code-nav-container",{constructor:HTMLElement,subscribe(e){const t=e,n=document.querySelector(".js-tagsearch-popover");if(!(n instanceof HTMLElement))return{unsubscribe(){}};const r=n.querySelector(".js-tagsearch-popover-content"),o=new WeakMap,s=new WeakMap;let i;async function a(j){const P=Nl(/\w+[!?]?/g,j.clientX,j.clientY);if(!P)return;const A=P.commonAncestorContainer.parentElement;for(const xv of A.classList)if(["pl-token","pl-c","pl-s","pl-k"].includes(xv))return;if(A.closest(".js-skip-tagsearch"))return;const q=P.toString();if(!q||q.match(/\n|\s|[();&.=",]/))return;let ve=s.get(A);if(ve||(ve=new Set,s.set(A,ve)),ve.has(q))return;ve.add(q);const T=A.closest(".js-tagsearch-file");if(!T)return;const $t=T.getAttribute("data-tagsearch-path")||"";let Q=T.getAttribute("data-tagsearch-lang")||"";if(Q==="HTML+ERB")if(A.closest(".pl-sre"))Q="Ruby";else return;if(e.classList.contains("js-code-block-container")&&(Q=Ul(A)||"",!Q))return;const ft=Wl(P),O=await Hl(n,q,Q,ft,$t);if(!O)return;const It=document.createElement("span");It.classList.add("pl-token"),It.addEventListener("click",l),o.set(It,O),P.surroundContents(It)}G(a,"onMouseMove");function c(){r.scrollTop=0}G(c,"resetScrollTop");function l(j){if(j.altKey||j.ctrlKey||j.metaKey||j.shiftKey)return;const P=j.currentTarget;P===i?g():(d(P),h()),j.preventDefault()}G(l,"onClick");function d(j){i&&i.classList.remove("active"),i=j,i.classList.add("active"),r.innerHTML=o.get(j)||"",m(j)}G(d,"populatePopover");function m(j){const P=t.getClientRects()[0],A=j.getClientRects()[0];n.style.position="absolute",t.classList.contains("position-relative")?(n.style.top=`${A.bottom-P.top+7}px`,n.style.left=`${A.left-P.left-10}px`):(n.style.top=`${window.scrollY+A.bottom+7}px`,n.style.left=`${window.scrollX+A.left-10}px`)}G(m,"positionPopover");function h(){if(!n.hidden){c();return}n.hidden=!1,c(),document.addEventListener("click",L),document.addEventListener("keyup",x),window.addEventListener("resize",w)}G(h,"showPopover");function g(){n.hidden||(n.hidden=!0,i&&i.classList.remove("active"),i=void 0,document.removeEventListener("click",L),document.removeEventListener("keyup",x),window.removeEventListener("resize",w))}G(g,"hidePopover");function w(){i instanceof HTMLElement&&m(i)}G(w,"onResize");function L(j){const{target:P}=j;P instanceof Node&&!n.contains(P)&&!i.contains(P)&&g()}G(L,"onDocumentClick");function x(j){switch(j.key){case"Escape":g();break}}return G(x,"onKeyup"),e.addEventListener("mousemove",a),{unsubscribe(){e.removeEventListener("mousemove",a)}}}});async function Hl(e,t,n,r,o){const s=e.getAttribute("data-tagsearch-url"),i=e.getAttribute("data-tagsearch-ref"),a=new URL(s,window.location.origin),c=new URLSearchParams;c.set("q",t),c.set("blob_path",o),c.set("ref",i),c.set("language",n),c.set("row",r[0].toString()),c.set("col",r[1].toString()),a.search=c.toString();const l=await fetch(a.toString(),{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!l.ok)return"";const d=await l.text();return/js-tagsearch-no-definitions/.test(d)?"":d}G(Hl,"fetchPopoverContents");function Nl(e,t,n){let r,o;if(document.caretPositionFromPoint){const c=document.caretPositionFromPoint(t,n);c&&(r=c.offsetNode,o=c.offset)}else if(document.caretRangeFromPoint){const c=document.caretRangeFromPoint(t,n);c&&(r=c.startContainer,o=c.startOffset)}if(!r||typeof o!="number"||r.nodeType!==Node.TEXT_NODE)return;const s=r.textContent;if(!s)return null;const i=Bl(s,e,o);if(!i)return null;const a=document.createRange();return a.setStart(r,i[1]),a.setEnd(r,i[2]),a}G(Nl,"matchFromPoint");function Bl(e,t,n){let r;for(;r=t.exec(e);){const o=r.index+r[0].length;if(r.index<=n&&n<o)return[r[0],r.index,o]}return null}G(Bl,"findNearestMatch");function Ul(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}G(Ul,"getCodeBlockLanguage");function Wl(e){let t=e.startContainer,n=e.startOffset,r=!1;for(;;){let o=t.previousSibling;for(;!r&&o;)["#comment","BUTTON"].includes(o.nodeName)||(n+=(o.textContent||"").length),o=o.previousSibling;const s=t.parentElement;if(s){if(s.classList.contains("js-code-nav-pass"))r=!0;else if(s.classList.contains("js-file-line")){const i=s.previousElementSibling;if(!i.classList.contains("js-code-nav-line-number"))throw new Error("invariant");return[parseInt(i.getAttribute("data-line-number")||"1",10)-1,n]}t=s}else return[0,0]}}G(Wl,"getRowAndColumn");var Jh=Object.defineProperty,zl=(e,t)=>Jh(e,"name",{value:t,configurable:!0});function Vl(e){const t=e.querySelector(".js-comment-form-error");t instanceof HTMLElement&&(t.hidden=!0)}zl(Vl,"clearFormError"),f("click",".errored.js-remove-error-state-on-click",function({currentTarget:e}){e.classList.remove("errored")}),M(".js-new-comment-form",async function(e,t){let n;Vl(e);try{n=await t.json()}catch(s){Kl(e,s)}if(!n)return;e.reset();for(const s of e.querySelectorAll(".js-resettable-field"))$e(s,s.getAttribute("data-reset-value")||"");const r=e.querySelector(".js-write-tab");r instanceof HTMLElement&&r.click();const o=n.json.updateContent;for(const s in o){const i=o[s],a=document.querySelector(s);a instanceof HTMLElement?In(a,i):console.warn(`couldn't find ${s} for immediate update`)}v(e,"comment:success")});function Kl(e,t){let n="You can't comment at this time";if(t.response&&t.response.status===422){const o=t.response.json;o.errors&&(Array.isArray(o.errors)?n+=` \u2014 your comment ${o.errors.join(", ")}`:n=o.errors)}n+=". ";const r=e.querySelector(".js-comment-form-error");if(r instanceof HTMLElement){r.textContent=n,r.hidden=!1;const o=r.closest("div.form-group.js-remove-error-state-on-click");o&&o.classList.add("errored")}}zl(Kl,"handleFormError");var Qh=Object.defineProperty,Xl=(e,t)=>Qh(e,"name",{value:t,configurable:!0});const Yh=Xl((e,t)=>{const n=e.querySelector(".js-form-action-text"),r=n||e;r.textContent=t?e.getAttribute("data-comment-text"):r.getAttribute("data-default-action-text")},"setButtonText"),Zh=Xl(e=>{let t;return n=>{const o=n.currentTarget.value.trim();o!==t&&(t=o,Yh(e,Boolean(o)))}},"createInputHandler");p(".js-comment-and-button",{constructor:HTMLButtonElement,initialize(e){const t=e.form.querySelector(".js-comment-field"),n=Zh(e);return{add(){t.addEventListener("input",n),t.addEventListener("change",n)},remove(){t.removeEventListener("input",n),t.removeEventListener("change",n)}}}});var eg=Object.defineProperty,Gl=(e,t)=>eg(e,"name",{value:t,configurable:!0});function Zo(e,t){const n=e.closest(".js-write-bucket");n&&n.classList.toggle("focused",t)}Gl(Zo,"toggleFocus");function Jl(e){const t=e.currentTarget;t instanceof Element&&Zo(t,!1)}Gl(Jl,"blurred"),Nt(".js-comment-field",function(e){Zo(e,!0),e.addEventListener("blur",Jl,{once:!0})});var tg=Object.defineProperty,ng=(e,t)=>tg(e,"name",{value:t,configurable:!0});const rg=2303741511,og=4;class tr{static fromFile(t){return new Promise(function(n,r){const o=new FileReader;o.onload=function(){n(new tr(o.result))},o.onerror=function(){r(o.error)},o.readAsArrayBuffer(t)})}constructor(t){this.dataview=new DataView(t),this.pos=0}advance(t){this.pos+=t}readInt(t){const n=this,r=function(){switch(t){case 1:return n.dataview.getUint8(n.pos);case 2:return n.dataview.getUint16(n.pos);case 4:return n.dataview.getUint32(n.pos);default:throw new Error("bytes parameter must be 1, 2 or 4")}}();return this.advance(t),r}readChar(){return this.readInt(1)}readShort(){return this.readInt(2)}readLong(){return this.readInt(4)}readString(t){const n=[];for(let r=0;r<t;r++)n.push(String.fromCharCode(this.readChar()));return n.join("")}scan(t){if(this.readLong()!==rg)throw new Error("invalid PNG");for(this.advance(4);;){const n=this.readLong(),r=this.readString(4),o=this.pos+n+og;if(t.call(this,r,n)===!1||r==="IEND")break;this.pos=o}}}ng(tr,"PNGScanner");var sg=Object.defineProperty,ig=(e,t)=>sg(e,"name",{value:t,configurable:!0});const ag=.0254;async function Ql(e){if(e.type!=="image/png")return null;const t=e.slice(0,10240,e.type),n=await tr.fromFile(t),r={width:0,height:0,ppi:1};return n.scan(function(o){switch(o){case"IHDR":return r.width=this.readLong(),r.height=this.readLong(),!0;case"pHYs":{const s=this.readLong(),i=this.readLong(),a=this.readChar();let c;return a===1&&(c=ag),c&&(r.ppi=Math.round((s+i)/2*c)),!1}case"IDAT":return!1}return!0}),r}ig(Ql,"imageDimensions");const cg=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],Yl=typeof window!="undefined"&&window.mozInnerScreenX!=null;function lg(e,t,n){const r=n&&n.debug||!1;if(r){const d=document.querySelector("#input-textarea-caret-position-mirror-div");d&&d.parentNode.removeChild(d)}const o=document.createElement("div");o.id="input-textarea-caret-position-mirror-div",document.body.appendChild(o);const s=o.style,i=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,a=e.nodeName==="INPUT";s.whiteSpace="pre-wrap",a||(s.wordWrap="break-word"),s.position="absolute",r||(s.visibility="hidden");for(const d of cg)if(a&&d==="lineHeight")if(i.boxSizing==="border-box"){const m=parseInt(i.height),h=parseInt(i.paddingTop)+parseInt(i.paddingBottom)+parseInt(i.borderTopWidth)+parseInt(i.borderBottomWidth),g=h+parseInt(i.lineHeight);m>g?s.lineHeight=`${m-h}px`:m===g?s.lineHeight=i.lineHeight:s.lineHeight=0}else s.lineHeight=i.height;else if(!a&&d==="width"&&i.boxSizing==="border-box"){let m=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),h=Yl?parseFloat(i[d])-m:e.clientWidth+m;s[d]=`${h}px`}else s[d]=i[d];Yl?e.scrollHeight>parseInt(i.height)&&(s.overflowY="scroll"):s.overflow="hidden",o.textContent=e.value.substring(0,t),a&&(o.textContent=o.textContent.replace(/\s/g,"\xA0"));const c=document.createElement("span");c.textContent=e.value.substring(t)||".",o.appendChild(c);const l={top:c.offsetTop+parseInt(i.borderTopWidth),left:c.offsetLeft+parseInt(i.borderLeftWidth),height:parseInt(i.lineHeight)};return r?c.style.backgroundColor="#aaa":document.body.removeChild(o),l}var ug=Object.defineProperty,rt=(e,t)=>ug(e,"name",{value:t,configurable:!0});const nr=new WeakMap;class Zl{constructor(t,n,r){this.index=t,this.coords=n,this.textArea=r}get top(){return this.coords.top}get left(){return this.coords.left}get height(){return this.coords.height}currentChar(t=1){return this.textArea.value.substring(this.index-t,this.index)}checkLine(t){return t<this.coords.top?-1:t>this.coords.top+this.coords.height?1:0}xDistance(t){return Math.abs(this.left-t)}}rt(Zl,"CaretPosition");function Se(e,t){let n;if(nr.has(e)?n=nr.get(e):(n=new Map,nr.set(e,n)),n.has(t))return n.get(t);{const r=new Zl(t,lg(e,t),e);return n.set(t,r),r}}rt(Se,"fetchCaretCoords");const on=rt((e,t,n,r,o,s)=>{if(n===t)return n;const i=rt(d=>{const m=d.filter(h=>h.checkLine(o)===0).sort((h,g)=>h.xDistance(r)>g.xDistance(r)?1:-1);return m.length===0?n:m[0].index},"bestPosition");if(n-t==1){const d=Se(e,t),m=Se(e,n);return i([d,m])}if(n-t==2){const d=Se(e,t),m=Se(e,n-1),h=Se(e,n);return i([d,m,h])}const a=Math.floor((n+t)/2);if(a===t||a===n)return a;const c=Se(e,a);if(o>c.top+c.height)return on(e,a+1,n,r,o,s+1);if(o<c.top)return on(e,t,a-1,r,o,s+1);const l=3;return c.xDistance(r)<l?a:c.left<r?Se(e,a+1).checkLine(o)!==0?a:on(e,a+1,n,r,o,s+1):c.left>r?Se(e,a-1).checkLine(o)!==0?a:on(e,t,a-1,r,o,s+1):a},"binaryCursorSearch"),dg=rt((e,t,n)=>{const r=0,o=e.value.length-1;return on(e,r,o,t,n,0)},"findCursorPosition");function eu(e,t,n){const r=dg(e,t,n);e.setSelectionRange(r,r)}rt(eu,"setCursorPosition");function tu(e,t){const n=e.getBoundingClientRect();t.type==="dragenter"&&nr.delete(e);const r=t.clientX-n.left,o=t.clientY-n.top+e.scrollTop;eu(e,r,o)}rt(tu,"updateCaret");var fg=Object.defineProperty,D=(e,t)=>fg(e,"name",{value:t,configurable:!0});p(".js-paste-markdown",{constructor:HTMLElement,add(e){sa(e),ia(e),aa(e),ca(e)},remove(e){la(e),ua(e),da(e),fa(e)}});const es=new WeakMap;function mg(e,t){es.set(e,t)}D(mg,"cachePlaceholder");function nu(e){return es.get(e)||ns(e)}D(nu,"getPlaceholder");function rr(e){return["video/mp4","video/quicktime"].includes(e.file.type)}D(rr,"isVideo");function ru(e){return e.replace(/[[\]\\"<>&]/g,".").replace(/\.{2,}/g,".").replace(/^\.|\.$/gi,"")}D(ru,"parameterizeName");function ts(e){return rr(e)?`
|
|
Uploading ${e.file.name}\u2026
|
|
`:`${e.isImage()?"!":""}[Uploading ${e.file.name}\u2026]()`}D(ts,"placeholderText");function ou(e){return ru(e).replace(/\.[^.]+$/,"").replace(/\./g," ")}D(ou,"altText");const pg=72*2;function sn(e){const n=e.target.closest("form").querySelector(".btn-primary");n.disabled=!0}D(sn,"disableSubmit");function an(e){const n=e.target.closest("form").querySelector(".btn-primary");n.disabled=!1}D(an,"enableSubmit");async function su(e){const{attachment:t}=e.detail,n=e.currentTarget;let r;t.isImage()?r=await cu(t):rr(t)?r=au(t):r=iu(t),os("",r,e,n)}D(su,"onUploadCompleted");function iu(e){return`[${e.file.name}](${e.href})`}D(iu,"mdLink");function au(e){return`
|
|
${e.href}
|
|
`}D(au,"videoMarkdown");async function cu(e){const t=await lu(e.file),n=ou(e.file.name),r=e.href;return t.ppi===pg?`<img width="${Math.round(t.width/2)}" alt="${n}" src="${r}">`:``}D(cu,"imageTag");async function lu(e){var t;const n={width:0,height:0,ppi:0};try{return(t=await Ql(e))!=null?t:n}catch{return n}}D(lu,"imageSize");function ns(e){const t=ts(e);return rr(e)?`
|
|
${t}
|
|
`:`${t}
|
|
`}D(ns,"replacementText");function rs(e){const t=e.currentTarget.querySelector(".js-comment-field"),n=nu(e.detail.attachment);if(t)t.setCustomValidity(""),lo(t,n,"");else{const o=Vt(e.currentTarget.querySelector(".js-code-editor")).editor.getSearchCursor(n);o.findNext(),o.replace("")}}D(rs,"removeFailedUpload");function os(e,t,n,r){const o=(r||n.currentTarget).querySelector(".js-comment-field"),s=(r||n.currentTarget).querySelector(".js-file-upload-loading-text"),i=ts(n.detail.attachment),{batch:a}=n.detail;if(o){const c=o.value.substring(o.selectionStart,o.selectionEnd);if(e==="uploading"){let l;c.length?l=Ha(o,c,i):l=uo(o,i,{appendNewline:!0}),es.set(n.detail.attachment,l)}else lo(o,i,t);a.isFinished()?an(n):sn(n)}else{const c=Vt((r||n.currentTarget).querySelector(".js-code-editor")).editor;if(e==="uploading")if(c.getSelection().length)c.replaceSelection(i);else{const l=c.getCursor(),d=ns(n.detail.attachment);c.replaceRange(d,l)}else{const l=c.getSearchCursor(i);l.findNext(),l.replace(t)}a.isFinished()?an(n):sn(n)}if(s){const c=s.getAttribute("data-file-upload-message");s.textContent=`${c} (${a.uploaded()+1}/${a.size})`}}D(os,"setValidityAndLinkText"),f("upload:setup",".js-upload-markdown-image",function(e){os("uploading","",e)}),f("upload:complete",".js-upload-markdown-image",su),f("upload:error",".js-upload-markdown-image",function(e){rs(e);const{batch:t}=e.detail;t.isFinished()?an(e):sn(e)});function ss(e){var t;e.stopPropagation();const n=e.currentTarget;if(!n)return;const r=n.querySelector(".js-comment-field");if(r)tu(r,e);else{const o=(t=Vt(n.querySelector(".js-code-editor")))==null?void 0:t.editor;if(o){const s=o.coordsChar({left:e.pageX,top:e.pageY});o.setCursor(s)}}}D(ss,"updateCursor"),f("dragenter","file-attachment",ss),f("dragover","file-attachment",ss),f("upload:invalid",".js-upload-markdown-image",function(e){rs(e);const{batch:t}=e.detail;t.isFinished()?an(e):sn(e)});var hg=Object.defineProperty,ot=(e,t)=>hg(e,"name",{value:t,configurable:!0});function uu(e){const t=e.querySelector(".js-data-preview-url-csrf"),n=e.closest("form").elements.namedItem("authenticity_token");if(t instanceof HTMLInputElement)return t.value;if(n instanceof HTMLInputElement)return n.value;throw new Error("Comment preview authenticity token not found")}ot(uu,"token");function or(e){const t=e.closest(".js-previewable-comment-form"),n=e.classList.contains("js-preview-tab");if(n){const s=t.querySelector(".js-write-bucket"),i=t.querySelector(".js-preview-body");s.clientHeight>0&&(i.style.minHeight=`${s.clientHeight}px`)}t.classList.toggle("preview-selected",n),t.classList.toggle("write-selected",!n);const r=t.querySelector('.tabnav-tab.selected, .tabnav-tab[aria-selected="true"]');r.setAttribute("aria-selected","false"),r.classList.remove("selected"),e.classList.add("selected"),e.setAttribute("aria-selected","true");const o=t.querySelector(".js-write-tab");return n?o.setAttribute("data-hotkey","Control+P,Meta+Shift+p"):o.removeAttribute("data-hotkey"),t}ot(or,"activateTab"),f("click",".js-write-tab",function(e){const t=e.currentTarget,n=t.closest(".js-previewable-comment-form");if(n instanceof xn){setTimeout(()=>{n.querySelector(".js-comment-field").focus()});return}const r=or(t);setTimeout(()=>{r.querySelector(".js-comment-field").focus()});const o=n.querySelector("markdown-toolbar");o instanceof HTMLElement&&(o.hidden=!1)}),f("click",".js-preview-tab",function(e){const t=e.currentTarget,n=t.closest(".js-previewable-comment-form");if(n instanceof xn)return;const r=or(t);setTimeout(()=>{sr(r)});const o=n.querySelector("markdown-toolbar");o instanceof HTMLElement&&(o.hidden=!0),e.stopPropagation(),e.preventDefault()}),f("tab-container-change",".js-previewable-comment-form",function(e){const t=e.detail.relatedTarget,n=t&&t.classList.contains("js-preview-panel"),r=e.currentTarget,o=r.querySelector(".js-write-tab");if(n){const s=r.querySelector(".js-write-bucket"),i=r.querySelector(".js-preview-body");!i.hasAttribute("data-skip-sizing")&&s.clientHeight>0&&(i.style.minHeight=`${s.clientHeight}px`),o.setAttribute("data-hotkey","Control+P,Meta+Shift+p"),sr(r);const c=r.querySelector("markdown-toolbar");c instanceof HTMLElement&&(c.hidden=!0)}else{o.removeAttribute("data-hotkey");const s=r.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!1)}r.classList.toggle("preview-selected",n),r.classList.toggle("write-selected",!n)}),f("preview:render",".js-previewable-comment-form",function(e){const t=e.target.querySelector(".js-preview-tab"),n=or(t);setTimeout(()=>{sr(n);const r=n.querySelector("markdown-toolbar");r instanceof HTMLElement&&(r.hidden=!0)})});function du(e){var t,n,r,o,s,i,a,c,l;const d=e.querySelector(".js-comment-field").value,m=(t=e.querySelector(".js-path"))==null?void 0:t.value,h=(n=e.querySelector(".js-line-number"))==null?void 0:n.value,g=(r=e.querySelector(".js-start-line-number"))==null?void 0:r.value,w=(o=e.querySelector(".js-side"))==null?void 0:o.value,L=(s=e.querySelector(".js-start-side"))==null?void 0:s.value,x=(i=e.querySelector(".js-start-commit-oid"))==null?void 0:i.value,j=(a=e.querySelector(".js-end-commit-oid"))==null?void 0:a.value,P=(c=e.querySelector(".js-base-commit-oid"))==null?void 0:c.value,A=(l=e.querySelector(".js-comment-id"))==null?void 0:l.value,q=new FormData;return q.append("text",d),q.append("authenticity_token",uu(e)),m&&q.append("path",m),h&&q.append("line_number",h),g&&q.append("start_line_number",g),w&&q.append("side",w),L&&q.append("start_side",L),x&&q.append("start_commit_oid",x),j&&q.append("end_commit_oid",j),P&&q.append("base_commit_oid",P),A&&q.append("comment_id",A),q}ot(du,"previewForm");function is(e){const t=e.getAttribute("data-preview-url"),n=du(e);return v(e,"preview:setup",{data:n}),gg(t,n)}ot(is,"fetchPreview");const gg=pe(fu,{hash:mu});let as=null;async function fu(e,t){as==null||as.abort();const{signal:n}=as=new AbortController,r=await fetch(e,{method:"post",body:t,signal:n});if(!r.ok)throw new Error("something went wrong");return r.text()}ot(fu,"uncachedFetch");function mu(e,t){const n=[...t.entries()].toString();return`${e}:${n}`}ot(mu,"hash");async function sr(e){const t=e.querySelector(".comment-body");t.innerHTML="<p>Loading preview…</p>";try{const n=await is(e);t.innerHTML=n||"<p>Nothing to preview</p>",v(e,"preview:rendered")}catch(n){n.name!=="AbortError"&&(t.innerHTML="<p>Error rendering preview</p>")}}ot(sr,"renderPreview"),p(".js-preview-tab",function(e){e.addEventListener("mouseenter",async()=>{const t=e.closest(".js-previewable-comment-form");try{await is(t)}catch{}})}),K("keydown",".js-comment-field",function(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key.toUpperCase()==="P"){const n=t.closest(".js-previewable-comment-form");n.classList.contains("write-selected")&&(n instanceof xn?n.querySelector(".js-preview-tab").click():(t.blur(),n.dispatchEvent(new CustomEvent("preview:render",{bubbles:!0,cancelable:!1}))),e.preventDefault(),e.stopImmediatePropagation())}});var bg=Object.defineProperty,cs=(e,t)=>bg(e,"name",{value:t,configurable:!0});const pu=/^(\+1|-1|:\+1?|:-1?)$/,yg=cs(e=>{let t=!1;for(const n of e.split(`
|
|
`)){const r=n.trim();if(!(!r||r.startsWith(">"))){if(t&&pu.test(r)===!1)return!1;!t&&pu.test(r)&&(t=!0)}}return t},"isReactionLikeComment");f("focusout","#new_comment_field",function(e){const n=e.currentTarget.closest(".js-reaction-suggestion");n&&us(n)}),f("focusin","#new_comment_field",function(e){ls(e)}),K("keyup","#new_comment_field",function(e){ls(e)});function ls(e){const t=e.target,n=t.value,r=t.closest(".js-reaction-suggestion");if(!!r)if(yg(n)){r.classList.remove("hide-reaction-suggestion"),r.classList.add("reaction-suggestion");const o=r.getAttribute("data-reaction-markup");r.setAttribute("data-reaction-suggestion-message",o)}else us(r)}cs(ls,"toggleReactionSuggestion");function us(e){e.classList.remove("reaction-suggestion"),e.classList.add("hide-reaction-suggestion"),e.removeAttribute("data-reaction-suggestion-message")}cs(us,"clearReactionSuggestion"),f("navigation:keydown",".js-commits-list-item",function(e){!qn(e.detail.originalEvent)||e.target instanceof Element&&e.detail.hotkey==="c"&&e.target.querySelector(".js-navigation-open").click()}),document.addEventListener("click",function(e){if(!(e.target instanceof Element))return;const t="a[data-confirm], input[type=submit][data-confirm], input[type=checkbox][data-confirm], button[data-confirm]",n=e.target.closest(t);if(!n)return;const r=n.getAttribute("data-confirm");!r||n instanceof HTMLInputElement&&n.hasAttribute("data-confirm-checked")&&!n.checked||confirm(r)||(e.stopImmediatePropagation(),e.preventDefault())},!0),me(".js-company-name-input",function(e){const t=e.target,n=t.form,r=n.querySelectorAll(".js-company-name-text");if(r.length===0)return;const o=n.querySelector(".js-corp-tos-link"),s=n.querySelector(".js-tos-link");s&&(s.classList.add("d-none"),s.setAttribute("aria-hidden","true"),o&&(o.classList.remove("d-none"),o.setAttribute("aria-hidden","false")));for(const i of r)if(t.value)if(i.hasAttribute("data-wording")){const c=i.getAttribute("data-wording");i.textContent=` ${c} ${t.value}`}else i.textContent=t.value;else i.textContent=""});var vg=Object.defineProperty,wg=(e,t)=>vg(e,"name",{value:t,configurable:!0});p(".js-company-owned:not(:checked)",{constructor:HTMLInputElement,add(e){const n=e.form.querySelector(".js-company-name-input"),r=document.querySelector(".js-company-name-text"),o=document.querySelector(".js-corp-tos-link"),s=document.querySelector(".js-tos-link");e.getAttribute("data-optional")&&n.removeAttribute("required"),$e(n,""),s.classList.remove("d-none"),s.setAttribute("aria-hidden","false"),o.classList.add("d-none"),o.setAttribute("aria-hidden","true"),r.textContent=""}}),p(".js-company-owned:checked",{constructor:HTMLInputElement,add(e){const n=e.form.querySelector(".js-company-name-input");n&&(n.setAttribute("required",""),v(n,"focus"),v(n,"input"))}}),p(".js-company-owned-autoselect",{constructor:HTMLInputElement,add(e){const t=e;function n(){if(t.checked&&t.form){const r=t.form.querySelector(".js-company-owned");$e(r,!0)}}wg(n,"autoselect"),t.addEventListener("change",n),n()}});var Lg=Object.defineProperty,ds=(e,t)=>Lg(e,"name",{value:t,configurable:!0});let De=null;document.addEventListener("keydown",function(e){!e.defaultPrevented&&e.key==="Escape"&&De&&De.removeAttribute("open")}),p(".js-dropdown-details",{subscribe:e=>ie(E(e,"toggle",gu),E(e,"toggle",hu))});function hu({currentTarget:e}){const t=e;if(t.hasAttribute("open")){const n=t.querySelector("[autofocus]");n&&n.focus()}else{const n=t.querySelector("summary");n&&n.focus()}}ds(hu,"autofocus");function gu({currentTarget:e}){const t=e;t.hasAttribute("open")?(De&&De!==t&&De.removeAttribute("open"),De=t):t===De&&(De=null)}ds(gu,"closeCurrentDetailsDropdown"),p("[data-deferred-details-content-url]:not([data-details-no-preload-on-hover])",{subscribe:e=>{const t=e.querySelector("summary");return E(t,"mouseenter",fs)}}),p("[data-deferred-details-content-url]",{subscribe:e=>E(e,"toggle",fs)});function fs({currentTarget:e}){if(!(e instanceof Element))return;const t=e.closest("details"),n=t.getAttribute("data-deferred-details-content-url");t.removeAttribute("data-deferred-details-content-url");const r=t.querySelector("include-fragment, poll-include-fragment");r.src=n}ds(fs,"loadDeferredContent"),f("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"))}),Wt(function({target:e}){if(!e||e.closest("summary"))return;let t=e.parentElement;for(;t;)t=t.closest("details"),t&&(t.hasAttribute("open")||t.setAttribute("open",""),t=t.parentElement)}),f("details-dialog-close","[data-disable-dialog-dismiss]",function(e){e.preventDefault()});var jg=Object.defineProperty,bu=(e,t)=>jg(e,"name",{value:t,configurable:!0});p("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 n=t.querySelector(".js-filterable-field");n&&v(n,"filterable:change")}))}),p("details details-menu .js-filterable-field",{constructor:HTMLInputElement,add(e){const t=e.closest("details");t.addEventListener("toggle",function(){t.hasAttribute("open")||(e.value="",v(e,"filterable:change"))})}}),p("details-menu[role=menu] [role=menu]",e=>{const t=e.closest("details-menu[role]");t&&t!==e&&t.removeAttribute("role")}),p("details details-menu remote-input input",{constructor:HTMLInputElement,add(e){const t=e.closest("details");t.addEventListener("toggle",function(){t.hasAttribute("open")||(e.value="")})}}),p("form details-menu",e=>{const t=e.closest("form");t.addEventListener("reset",()=>{setTimeout(()=>yu(t),0)})});function yu(e){const t=e.querySelectorAll("details-menu [role=menuitemradio] input[type=radio]:checked");for(const n of t)v(n,"change")}bu(yu,"resetMenus"),K("keypress","details-menu .js-filterable-field, details-menu filter-input input",e=>{if(e.key==="Enter"){const r=e.currentTarget.closest("details-menu").querySelector('[role^="menuitem"]:not([hidden])');r instanceof HTMLElement&&r.click(),e.preventDefault()}}),f("details-menu-selected","details-menu",e=>{const n=e.currentTarget.querySelector(".js-filterable-field");n instanceof HTMLInputElement&&n.value&&n.focus()},{capture:!0}),f("details-menu-selected","[data-menu-input]",e=>{if(!(e.target instanceof Element))return;const t=e.target.getAttribute("data-menu-input"),n=document.getElementById(t);(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&(n.value=e.detail.relatedTarget.value)},{capture:!0}),p("details-menu remote-input",{constructor:ma,initialize(e){const t=document.getElementById(e.getAttribute("aria-owns")||"");if(!t)return;let n=null;e.addEventListener("load",()=>{document.activeElement&&t.contains(document.activeElement)&&document.activeElement.id?n=document.activeElement.id:n=null}),e.addEventListener("loadend",()=>{if(n){const r=t.querySelector(`#${n}`)||t.querySelector('[role^="menu"]');r instanceof HTMLElement?r.focus():e.input&&e.input.focus()}})}}),f("details-menu-selected","details-menu[data-menu-max-options]",e=>{const t=+e.currentTarget.getAttribute("data-menu-max-options"),n=e.currentTarget.querySelectorAll('[role="menuitemcheckbox"][aria-checked="true"]'),r=t===n.length;e.currentTarget.querySelector("[data-menu-max-options-warning]").hidden=!r;for(const o of e.currentTarget.querySelectorAll('[role="menuitemcheckbox"] input'))o.disabled=r&&!o.checked},{capture:!0}),p("details > details-menu",{subscribe(e){const t=e.closest("details");return E(t,"toggle",vu)}});async function vu({currentTarget:e}){const t=e,n=t.hasAttribute("open");v(t,n?"menu:activate":"menu:deactivate"),await Xe(),v(t,n?"menu:activated":"menu:deactivated")}bu(vu,"fireMenuToggleEvent");var Eg=Object.defineProperty,ms=(e,t)=>Eg(e,"name",{value:t,configurable:!0});const ps=new WeakMap,wu=["input[type=submit][data-disable-with]","button[data-disable-with]"].join(", ");function Lu(e){return e instanceof HTMLInputElement?e.value||"Submit":e.innerHTML||""}ms(Lu,"getButtonText");function hs(e,t){e instanceof HTMLInputElement?e.value=t:e.innerHTML=t}ms(hs,"setButtonText"),f("submit","form",function(e){for(const t of e.currentTarget.querySelectorAll(wu)){ps.set(t,Lu(t));const n=t.getAttribute("data-disable-with");n&&hs(t,n),t.disabled=!0}},{capture:!0});function gs(e){for(const t of e.querySelectorAll(wu)){const n=ps.get(t);n!=null&&(hs(t,n),(!t.hasAttribute("data-disable-invalid")||e.checkValidity())&&(t.disabled=!1),ps.delete(t))}}ms(gs,"revert"),f("deprecatedAjaxComplete","form",function({currentTarget:e,target:t}){e===t&&gs(e)}),to(gs);var Sg=Object.defineProperty,Lt=(e,t)=>Sg(e,"name",{value:t,configurable:!0});p(".js-document-dropzone",{constructor:HTMLElement,add(e){document.body.addEventListener("dragstart",js),document.body.addEventListener("dragend",Es),document.body.addEventListener("dragenter",cn),document.body.addEventListener("dragover",cn),document.body.addEventListener("dragleave",vs),e.addEventListener("drop",ws)},remove(e){document.body.removeEventListener("dragstart",js),document.body.removeEventListener("dragend",Es),document.body.removeEventListener("dragenter",cn),document.body.removeEventListener("dragover",cn),document.body.removeEventListener("dragleave",vs),e.removeEventListener("drop",ws)}});function bs(e){return Array.from(e.types).indexOf("Files")>=0}Lt(bs,"hasFile");let ys=null;function cn(e){if(Ls)return;const t=e.currentTarget;ys&&window.clearTimeout(ys),ys=window.setTimeout(()=>t.classList.remove("dragover"),200);const n=e.dataTransfer;!n||!bs(n)||(n.dropEffect="copy",t.classList.add("dragover"),e.stopPropagation(),e.preventDefault())}Lt(cn,"onDragenter");function vs(e){e.target instanceof Element&&e.target.classList.contains("js-document-dropzone")&&e.currentTarget.classList.remove("dragover")}Lt(vs,"onBodyDragleave");function ws(e){const t=e.currentTarget;t.classList.remove("dragover"),document.body.classList.remove("dragover");const n=e.dataTransfer;!n||!bs(n)||(v(t,"document:drop",{transfer:n}),e.stopPropagation(),e.preventDefault())}Lt(ws,"onDrop");let Ls=!1;function js(){Ls=!0}Lt(js,"onDragstart");function Es(){Ls=!1}Lt(Es,"onDragend");var kg=Object.defineProperty,ir=(e,t)=>kg(e,"name",{value:t,configurable:!0});async function Ss(e,t){const r=new TextEncoder().encode(t),{seal:o}=await k.import("./chunk-tweetsodium.js");return o(r,e)}ir(Ss,"encrypt");function ks(e){const t=atob(e).split("").map(n=>n.charCodeAt(0));return Uint8Array.from(t)}ir(ks,"decode");function _s(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t)}ir(_s,"encode"),f("submit","form.js-encrypt-submit",async function(e){const t=e.currentTarget;if(e.defaultPrevented||!t.checkValidity())return;const n=t.elements.namedItem("secret_value");if(n.disabled=!0,!n.value)return;e.preventDefault();const r=ks(t.getAttribute("data-public-key"));t.elements.namedItem("encrypted_value").value=_s(await Ss(r,n.value)),t.submit()}),f("submit","form.js-encrypt-bulk-submit",Ts(!0)),f("submit","form.js-encrypt-bulk-submit-enable-empty",Ts(!1));function Ts(e){return async function(t){const n=t.currentTarget;if(t.defaultPrevented||!n.checkValidity())return;const r=ks(n.getAttribute("data-public-key"));t.preventDefault();for(const o of n.elements){const s=o;if(s.id.endsWith("secret")){if(s.disabled=!0,s.required&&!s.value){const a=`${s.name} is invalid!`,c=document.querySelector("template.js-flash-template");c.after(new de(c,{className:"flash-error",message:a}));return}const i=`${s.name}_encrypted_value`;if(!s.value){n.elements.namedItem(i).disabled=e;continue}n.elements.namedItem(i).value=_s(await Ss(r,s.value))}}n.submit()}}ir(Ts,"submitBulk");var _g=Object.defineProperty,Cs=(e,t)=>_g(e,"name",{value:t,configurable:!0});let ar;function ln(e,t){const n=document.querySelector('.js-site-favicon[type="image/svg+xml"]'),r=document.querySelector('.js-site-favicon[type="image/png"]');t||(t="light");const o=t==="light"?"":"-dark";if(n&&r)if(ar==null&&(ar=n.href),e){e=e.substr(0,e.lastIndexOf(".")),e=`${e}${o}.svg`,n.href=e;const s=n.href.substr(0,n.href.lastIndexOf("."));r.href=`${s}.png`}else{const s=n.href.indexOf("-dark.svg"),i=n.href.substr(0,s!==-1?s:n.href.lastIndexOf("."));n.href=`${i}${o}.svg`,r.href=`${i}${o}.png`}}Cs(ln,"updateFavicon");function un(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}Cs(un,"prefersDarkColorScheme");function ju(){ar!=null&&ln(ar,un()?"dark":"light")}Cs(ju,"resetIcon"),p("[data-favicon-override]",{add(e){const t=e.getAttribute("data-favicon-override");setTimeout(()=>ln(t,un()?"dark":"light"))},remove(){ju()}}),un()&&ln(void 0,"dark"),window.matchMedia("(prefers-color-scheme: dark)").addListener(()=>{ln(void 0,un()?"dark":"light")});var Tg=Object.defineProperty,Eu=(e,t)=>Tg(e,"name",{value:t,configurable:!0});p(".js-feature-preview-indicator-container",e=>{Su(e)});async function Su(e){const t=e.getAttribute("data-feature-preview-indicator-src"),n=await ku(t),r=e.querySelectorAll(".js-feature-preview-indicator");for(const o of r)o.hidden=!n}Eu(Su,"fetchFeaturePreviewIndicator");async function ku(e){try{const t=await fetch(e,{headers:{Accept:"application/json"}});return t.ok?(await t.json()).show_indicator:!1}catch{return!1}}Eu(ku,"fetchIndicator"),f("click","[data-feature-preview-trigger-url]",async e=>{const t=e.currentTarget,n=t.getAttribute("data-feature-preview-trigger-url"),r=await Le({content:U(document,n),dialogClass:"feature-preview-dialog"}),o=t.getAttribute("data-feature-preview-close-details"),s=t.getAttribute("data-feature-preview-close-hmac");r.addEventListener("dialog:remove",()=>{we({hydroEventPayload:o,hydroEventHmac:s},!0)});const i=document.querySelectorAll(".js-feature-preview-indicator");for(const a of i)a.hidden=!0}),M(".js-feature-preview-unenroll",async(e,t)=>{await t.text();const n=e.querySelector(".js-feature-preview-slug").value;v(e,`feature-preview-unenroll:${n}`)}),M(".js-feature-preview-enroll",async(e,t)=>{await t.text();const n=e.querySelector(".js-feature-preview-slug").value;v(e,`feature-preview-enroll:${n}`)});var Cg=Object.defineProperty,cr=(e,t)=>Cg(e,"name",{value:t,configurable:!0});class _u{constructor(t,n){this.attachment=t,this.policy=n}async process(t){var n,r,o,s;const i=window.performance.now(),a=new Headers(this.policy.header||{}),c=new XMLHttpRequest;c.open("POST",this.policy.upload_url,!0);for(const[h,g]of a)c.setRequestHeader(h,g);c.onloadstart=()=>{t.attachmentUploadDidStart(this.attachment,this.policy)},c.upload.onprogress=h=>{if(h.lengthComputable){const g=Math.round(h.loaded/h.total*100);t.attachmentUploadDidProgress(this.attachment,g)}},await Tu(c,Cu(this.attachment,this.policy)),c.status===204?(xs(this.policy),t.attachmentUploadDidComplete(this.attachment,this.policy,{})):c.status===201?(xs(this.policy),t.attachmentUploadDidComplete(this.attachment,this.policy,JSON.parse(c.responseText))):t.attachmentUploadDidError(this.attachment,{status:c.status,body:c.responseText});const m={duration:window.performance.now()-i,size:(r=(n=this.attachment)==null?void 0:n.file)==null?void 0:r.size,fileType:(s=(o=this.attachment)==null?void 0:o.file)==null?void 0:s.type,success:c.status===204||c.status===201};we({uploadTiming:m},!0)}}cr(_u,"AttachmentUpload");function Tu(e,t){return new Promise((n,r)=>{e.onload=()=>n(e),e.onerror=r,e.send(t)})}cr(Tu,"send");function Cu(e,t){const n=new FormData;t.same_origin&&n.append("authenticity_token",t.upload_authenticity_token);for(const r in t.form)n.append(r,t.form[r]);return n.append("file",e.file),n}cr(Cu,"uploadForm");function xs(e){const t=typeof e.asset_upload_url=="string"?e.asset_upload_url:null,n=typeof e.asset_upload_authenticity_token=="string"?e.asset_upload_authenticity_token:null;if(!(t&&n))return;const r=new FormData;r.append("authenticity_token",n),fetch(t,{method:"PUT",body:r,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}cr(xs,"markComplete");var xg=Object.defineProperty,ke=(e,t)=>xg(e,"name",{value:t,configurable:!0});async function xu(e,t){const n=qu(e,t);for(const r of e.attachments){const o=await Au(e,r,t);if(!o)return;try{await new _u(r,o).process(n)}catch{v(t,"upload:error",{batch:e,attachment:r}),_e(t,"is-failed");return}}}ke(xu,"upload");async function Au(e,t,n){const r=Pu(t,n),o=[];v(n,"upload:setup",{batch:e,attachment:t,form:r,preprocess:o});try{await Promise.all(o);const s=await fetch(Mu(r,n));if(s.ok)return await s.json();v(n,"upload:invalid",{batch:e,attachment:t});const i=await s.text(),a=s.status,{state:c,messaging:l}=As({status:a,body:i},t.file);_e(n,c,l)}catch{v(n,"upload:invalid",{batch:e,attachment:t}),_e(n,"is-failed")}return null}ke(Au,"validate");function Pu(e,t){const n=t.querySelector(".js-data-upload-policy-url-csrf").value,r=t.getAttribute("data-upload-repository-id"),o=t.getAttribute("data-subject-type"),s=t.getAttribute("data-subject-param"),i=e.file,a=new FormData;return a.append("name",i.name),a.append("size",String(i.size)),a.append("content_type",i.type),a.append("authenticity_token",n),o&&a.append("subject_type",o),s&&a.append("subject",s),r&&a.append("repository_id",r),e.directory&&a.append("directory",e.directory),a}ke(Pu,"policyForm");function Mu(e,t){return new Request(t.getAttribute("data-upload-policy-url"),{method:"POST",body:e,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}ke(Mu,"policyRequest");function qu(e,t){return{attachmentUploadDidStart(n,r){n.saving(0),_e(t,"is-uploading"),v(t,"upload:start",{batch:e,attachment:n,policy:r})},attachmentUploadDidProgress(n,r){n.saving(r),v(t,"upload:progress",{batch:e,attachment:n})},attachmentUploadDidComplete(n,r,o){n.saved($u(o,r)),v(t,"upload:complete",{batch:e,attachment:n}),e.isFinished()&&_e(t,"is-default")},attachmentUploadDidError(n,r){v(t,"upload:error",{batch:e,attachment:n});const{state:o}=As(r);_e(t,o)}}}ke(qu,"createDelegate");function $u(e,t){const n=(e.id==null?null:String(e.id))||(t.asset.id==null?null:String(t.asset.id)),r=(typeof e.href=="string"?e.href:null)||(typeof t.asset.href=="string"?t.asset.href:null);return{id:n,href:r,name:t.asset.name}}ke($u,"savedAttributes");function As(e,t){if(e.status===400)return{state:"is-bad-file"};if(e.status!==422)return{state:"is-failed"};const n=JSON.parse(e.body);if(!n||!n.errors)return{state:"is-failed"};for(const r of n.errors)switch(r.field){case"size":{const o=t?t.size:null;return o!=null&&o===0?{state:"is-empty"}:{state:"is-too-big",messaging:{message:Ag(r.message),target:".js-upload-too-big"}}}case"file_count":return{state:"is-too-many"};case"width":case"height":return{state:"is-bad-dimensions"};case"name":return r.code==="already_exists"?{state:"is-duplicate-filename"}:{state:"is-bad-file"};case"content_type":return{state:"is-bad-file"};case"uploader_id":return{state:"is-bad-permissions"};case"repository_id":return{state:"is-repository-required"};case"format":return{state:"is-bad-format"}}return{state:"is-failed"}}ke(As,"policyErrorState");const Ag=ke(e=>e.startsWith("size")?e.substring(5):e,"trimSizeErrorMessage"),Pg=["is-default","is-uploading","is-bad-file","is-duplicate-filename","is-too-big","is-too-many","is-hidden-file","is-failed","is-bad-dimensions","is-empty","is-bad-permissions","is-repository-required","is-bad-format"];function _e(e,t,n){if(n){const{message:r,target:o}=n,s=e.querySelector(o);s&&(s.innerHTML=r)}e.classList.remove(...Pg),e.classList.add(t)}ke(_e,"resetState");var Mg=Object.defineProperty,lr=(e,t)=>Mg(e,"name",{value:t,configurable:!0});class Iu{constructor(t){this.attachments=t,this.size=this.attachments.length,this.total=ur(this.attachments,n=>n.file.size)}percent(){const t=lr(r=>r.file.size*r.percent/100,"bytes"),n=ur(this.attachments,t);return Math.round(n/this.total*100)}uploaded(){const t=lr(n=>n.isSaved()?1:0,"value");return ur(this.attachments,t)}isFinished(){return this.attachments.every(t=>t.isSaved())}}lr(Iu,"Batch");function ur(e,t){return e.reduce((n,r)=>n+t(r),0)}lr(ur,"sum");var qg=Object.defineProperty,dr=(e,t)=>qg(e,"name",{value:t,configurable:!0});p("file-attachment[hover]",{add(e){e.classList.add("dragover")},remove(e){e.classList.remove("dragover")}}),f("file-attachment-accept","file-attachment",function(e){const{attachments:t}=e.detail;t.length===0&&(_e(e.currentTarget,"is-hidden-file"),e.preventDefault())}),f("file-attachment-accepted","file-attachment",function(e){const t=e.currentTarget.querySelector(".drag-and-drop");if(t&&t.hidden)return;const{attachments:n}=e.detail;xu(new Iu(n),e.currentTarget)});let Fu=0;p("file-attachment",{add(e){Fu++==0&&(document.addEventListener("drop",Ms),document.addEventListener("dragover",qs));const t=e.closest("form");t&&t.addEventListener("reset",$s)},remove(e){--Fu==0&&(document.removeEventListener("drop",Ms),document.removeEventListener("dragover",qs));const t=e.closest("form");t&&t.removeEventListener("reset",$s)}});function Ps(e){return Array.from(e.types).indexOf("Files")>=0}dr(Ps,"hasFile");function Ms(e){const t=e.dataTransfer;t&&Ps(t)&&e.preventDefault()}dr(Ms,"onDocumentDrop");function qs(e){const t=e.dataTransfer;t&&Ps(t)&&e.preventDefault()}dr(qs,"onDocumentDragover");function $s({currentTarget:e}){const t=e.querySelector("file-attachment");_e(t,"is-default")}dr($s,"onFormReset");var $g=Object.defineProperty,Ig=(e,t)=>$g(e,"name",{value:t,configurable:!0});f("filter-input-updated","filter-input",e=>{const t=e.currentTarget.input;if(!(document.activeElement&&document.activeElement===t))return;const{count:n,total:r}=e.detail;ze(`Found ${n} out of ${r} ${r===1?"item":"items"}`)}),f("toggle","details",e=>{setTimeout(()=>Ou(e.target),0)},{capture:!0}),f("tab-container-changed","tab-container",e=>{if(!(e.target instanceof HTMLElement))return;const{relatedTarget:t}=e.detail,n=e.target.querySelector("filter-input");n instanceof pa&&n.setAttribute("aria-owns",t.id)},{capture:!0});function Ou(e){const t=e.querySelector("filter-input");t&&!e.hasAttribute("open")&&t.reset()}Ig(Ou,"resetFilter");var Fg=Object.defineProperty,Ru=(e,t)=>Fg(e,"name",{value:t,configurable:!0});function Is(e,t,n,r={}){var o;const s=(o=r.limit)!=null?o:1/0;let i=0;for(const a of e.children){const c=n(a,t);c==null||(c&&i<s?(i++,Fs(a,!0)):Fs(a,!1))}return i}Ru(Is,"filterList");function Fs(e,t){e.style.display=t?"":"none",e.hidden=!t}Ru(Fs,"toggle");var Og=Object.defineProperty,Rg=(e,t)=>Og(e,"name",{value:t,configurable:!0});const Du=new WeakMap;function Hu(e,t,n){const r=t.toLowerCase(),o=n.limit;let s=Du.get(e);const i=e.querySelector('input[type="radio"]:checked'),a=Array.from(e.children);s||(s=Array.from(e.children),Du.set(e,s));for(const w of a)e.removeChild(w),w instanceof HTMLElement&&(w.style.display="");const c=r?Ge(s,n.sortKey,Je):s,l=o==null?c:c.slice(0,o),d=l.length,m=document.createDocumentFragment();for(const w of l)m.appendChild(w);let h=!1;if(i instanceof HTMLInputElement)for(const w of m.querySelectorAll('input[type="radio"]:checked'))w instanceof HTMLInputElement&&w.value!==i.value&&(w.checked=!1,h=!0);e.appendChild(m),i&&h&&i.dispatchEvent(new Event("change",{bubbles:!0}));const g=e.querySelectorAll(".js-divider");for(const w of g)w.classList.toggle("d-none",Boolean(r&&r.trim().length>0));return d}Rg(Hu,"filterSortList");var Dg=Object.defineProperty,st=(e,t)=>Dg(e,"name",{value:t,configurable:!0});let Os=new AbortController;const dn=new WeakMap,Nu=new WeakMap,Bu=new WeakMap;async function Uu(e,t,n,r){n&&!dn.has(e)&&Vu(e);const o=await Wu(e,t,n,r);return e.hasAttribute("data-filterable-data-pre-rendered")&&(o.suggestions=zu(e,n)),o}st(Uu,"getData");async function Wu(e,t,n,r){const o=new URL(e.getAttribute("data-filterable-src")||"",window.location.origin);if(o.pathname==="/")throw new Error("could not get data-filterable-src");if(n){const s=dn.get(e),i=t.trim();if(s.lastSearchText===i)return s.lastSearchResult;const a=s.lastSearchText===void 0;s.lastSearchText=i;const c=e.getAttribute("data-filterable-for")||"",l=document.getElementById(c);if(Os.abort(),i===""&&!r)s.lastSearchResult={suggestions:[],users:[]};else{Os=new AbortController;const d={headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"},signal:Os.signal},m=o.searchParams||new URLSearchParams;m.set("q",t),m.set("typeAhead","true"),o.search=m.toString(),a||l==null||l.classList.add("is-loading");const h=await fetch(o.toString(),d);s.lastSearchResult=await h.json()}return l==null||l.classList.remove("is-loading"),s.lastSearchResult}else{const s={headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}};return await(await fetch(o.toString(),s)).json()}}st(Wu,"fetchQueryIfNeeded");function zu(e,t){const n=[],r=e.querySelectorAll(".js-filterable-suggested-user");if(r.length>0)for(const o of e.querySelectorAll(".js-filterable-suggested-user"))o.classList.remove("js-filterable-suggested-user"),n.push({name:o.querySelector(".js-description").textContent,login:o.querySelector(".js-username").textContent,selected:o.getAttribute("aria-checked")==="true",element:o,suggestion:!0});if(t){const o=dn.get(e);return r.length>0&&(o.cachedSuggestions=n,o.userResultCache.clear()),o.cachedSuggestions}return n}st(zu,"getPreRenderedUsers");function Vu(e){dn.set(e,{lastSearchResult:{suggestions:[],users:[]},cachedSuggestions:[],userResultCache:new Map})}st(Vu,"initializeTypeAheadCache");async function Ku(e,t,n){var r,o;Bu.set(e,t),await Fn();const s=e.hasAttribute("data-filterable-show-suggestion-header"),i=e.hasAttribute("data-filterable-type-ahead"),a=e.hasAttribute("data-filterable-type-ahead-query-on-empty");let c=Nu.get(e);if(!c)try{c=await Uu(e,t,i,a),i||Nu.set(e,c)}catch(T){if(T.name==="AbortError")return-1;throw T}if(!i&&Bu.get(e)!==t)return-1;const l=n.limit,d=e.querySelector("template"),m={};for(const T of e.querySelectorAll("input[type=hidden]"))m[`${T.name}${T.value}`]=T;let h=d.nextElementSibling;for(;h;){const T=h;h=T.nextElementSibling,T instanceof HTMLElement&&(i||T.getAttribute("aria-checked")==="true"||T.classList.contains("select-menu-divider"))?T.hidden=!0:T.remove()}let g=0;const w=t.trim()==="",L=document.createDocumentFragment(),x=e.querySelector(".js-divider-suggestions"),j=e.querySelector(".js-divider-rest"),P=dn.get(e);function A(T){const $t=`${T.login} ${T.name}`.toLowerCase().trim().includes(t),Q=!(l!=null&&g>=l)&&$t;if(Q||T.selected||T.suggestion){const O=Xu(T,d,m,P);O.hidden=!Q,Q&&g++,L.appendChild(O)}}st(A,"addItem");let q=!1;if(x&&(((r=c.suggestions)==null?void 0:r.length)>0||s&&c.users.length>0)){const T=(o=c.suggestions)!=null?o:[],$t=T.filter(O=>O.selected),Q=T.filter(O=>!O.selected);for(const O of $t)A(O);L.appendChild(x);const ft=g;for(const O of Q)A(O);q=g>ft,x.hidden=!q||i&&!w,s&&c.users.length>0&&(x.hidden=!w)}j&&L.appendChild(j);const ve=g;for(const T of c.users)A(T);return j&&(j.hidden=ve===g||!q),e.append(L),g}st(Ku,"substringMemoryFilterList");function Xu(e,t,n,r){if(e.element!=null)return e.element;if(r==null?void 0:r.userResultCache.has(e.id))return r.userResultCache.get(e.id);const o=t.content.cloneNode(!0),s=o.querySelector("input[type=checkbox], input[type=radio]");e.type&&(s.name=`reviewer_${e.type}_ids[]`),s.value=e.id;const i=`${s.name}${e.id}`;let a=e.selected;n[i]&&(a=!0,n[i].remove(),delete n[i]);const c=o.querySelector("[role^=menuitem]");a&&(c.setAttribute("aria-checked","true"),s.checked=!0),e.disabled&&c.setAttribute("aria-disabled","true");const l=o.querySelector(".js-username");l&&(l.textContent=e.login);const d=o.querySelector(".js-description");d&&(d.textContent=e.name);const m=o.querySelector(".js-extended-description");m&&(e.description?m.textContent=e.description:m.remove());const h=o.querySelector(".js-avatar");return h.className=`${h.className} ${e.class}`,h.src=e.avatar,e.element=c,r==null||r.userResultCache.set(e.id,c),e.element}st(Xu,"createReviewerItem");var Hg=Object.defineProperty,Te=(e,t)=>Hg(e,"name",{value:t,configurable:!0});p(".js-filterable-field",{constructor:HTMLInputElement,initialize(e){e.autocomplete||(e.autocomplete="off");const t=e.hasAttribute("type-ahead")?200:null;let n=e.value;async function r(s){n!==s.value&&(n=s.value,await Xe(),v(s,"filterable:change"))}Te(r,"onInputChange");async function o(){n=e.value,await Xe(),v(e,"filterable:change")}return Te(o,"onFocus"),{add(s){s.addEventListener("focus",o),$n(s,r,{wait:t}),document.activeElement===s&&o()},remove(s){s.removeEventListener("focus",o),Na(s,r)}}}}),f("filterable:change",".js-filterable-field",async function(e){const t=e.currentTarget,n=t.value.trim().toLowerCase(),r=document.querySelectorAll(`[data-filterable-for="${t.id}"]`);for(const o of r){const s=await Ju(o,n);if(s===-1)return;document.activeElement&&t===document.activeElement&&ze(`${s} results found.`),o.dispatchEvent(new CustomEvent("filterable:change",{bubbles:!0,cancelable:!1,detail:{inputField:t}}))}});function Gu(e){return e.hasAttribute("data-filter-value")?e.getAttribute("data-filter-value").toLowerCase().trim():e.textContent.toLowerCase().trim()}Te(Gu,"defaultText");async function Ju(e,t){const n=parseInt(e.getAttribute("data-filterable-limit"),10)||null;let r=0;switch(e.getAttribute("data-filterable-type")){case"fuzzy":{const o=t.toLowerCase();r=Hu(e,t,{limit:n,sortKey:Te(i=>{const a=Gu(i),c=Kt(a,o);return c>0?{score:c,text:a}:null},"sortKey")});break}case"substring":r=Is(e,t.toLowerCase(),Yu,{limit:n});break;case"substring-memory":r=await Ku(e,t,{limit:n});break;default:r=Is(e,t.toLowerCase(),Qu,{limit:n});break}return e.classList.toggle("filterable-active",t.length>0),e.classList.toggle("filterable-empty",r===0),r}Te(Ju,"filter");function Qu(e,t){return e.textContent.toLowerCase().trim().startsWith(t)}Te(Qu,"prefix");function Yu(e,t){return e.hasAttribute("data-skip-substring-filter")||e.classList.contains("select-menu-no-results")?null:(e.querySelector("[data-filterable-item-text]")||e).textContent.toLowerCase().trim().includes(t)}Te(Yu,"substring"),f("filterable:change","details-menu .select-menu-list",function(e){const t=e.currentTarget,n=t.querySelector(".js-new-item-form");n&&Zu(t,n,e.detail.inputField.value)});function Zu(e,t,n){const r=n.length>0&&!ed(e,n);if(e.classList.toggle("is-showing-new-item-form",r),!r)return;t.querySelector(".js-new-item-name").textContent=n;const o=t.querySelector(".js-new-item-value");(o instanceof HTMLInputElement||o instanceof HTMLButtonElement)&&(o.value=n)}Te(Zu,"toggleForm");function ed(e,t){for(const n of e.querySelectorAll("[data-menu-button-text]"))if(n.textContent.toLowerCase().trim()===t.toLowerCase())return!0;return!1}Te(ed,"itemExists"),p("tab-container .select-menu-list .filterable-empty, details-menu .select-menu-list .filterable-empty",{add(e){e.closest(".select-menu-list").classList.add("filterable-empty")},remove(e){e.closest(".select-menu-list").classList.remove("filterable-empty")}});var Ng=Object.defineProperty,Rs=(e,t)=>Ng(e,"name",{value:t,configurable:!0});const td=navigator.userAgent.match(/Firefox\/(\d+)/);td&&Number(td[1])<76&&(p('details-menu label[tabindex][role^="menuitem"]',e=>{const t=e.querySelector("input");if(!t)return;const n=e.classList.contains("select-menu-item"),r=t.classList.contains("d-none"),o=n||r||t.hidden;n&&t.classList.add("d-block"),r&&t.classList.remove("d-none"),o&&(t.classList.add("sr-only"),t.hidden=!1),e.removeAttribute("tabindex")}),f("focus",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',e=>{const t=e.currentTarget.closest("label");t.classList.contains("select-menu-item")&&t.classList.add("navigation-focus"),t.classList.contains("SelectMenu-item")&&t.classList.add("hx_menuitem--focus"),t.classList.contains("dropdown-item")&&t.classList.add("hx_menuitem--focus"),e.currentTarget.addEventListener("blur",()=>{t.classList.contains("select-menu-item")&&t.classList.remove("navigation-focus"),t.classList.contains("SelectMenu-item")&&t.classList.remove("hx_menuitem--focus"),t.classList.contains("dropdown-item")&&t.classList.remove("hx_menuitem--focus")},{once:!0})},{capture:!0}),K("keydown",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',async function(e){if(Ds(e))e.currentTarget instanceof Element&&nd(e.currentTarget);else if(e.key==="Enter"){const t=e.currentTarget;e.preventDefault(),await Xe(),t instanceof HTMLInputElement&&t.click()}}),f("blur",'details-menu label input[role="menuitemradio"], details-menu label input[role="menuitemcheckbox"]',e=>{Hs(e.currentTarget)},{capture:!0}),K("keyup",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',e=>{!Ds(e)||e.currentTarget instanceof Element&&Hs(e.currentTarget)}));function Ds(e){return e.key==="ArrowDown"||e.key==="ArrowUp"}Rs(Ds,"isArrowKeys");function nd(e){const t=e.closest("label");t.hasAttribute("data-role")||t.setAttribute("data-role",t.getAttribute("role")),e.setAttribute("role",t.getAttribute("data-role")),t.removeAttribute("role")}Rs(nd,"switchRoleToInputForNavigation");function Hs(e){const t=e.closest("label");t.hasAttribute("data-role")||t.setAttribute("data-role",t.getAttribute("role")),t.setAttribute("role",t.getAttribute("data-role")),e.removeAttribute("role")}Rs(Hs,"switchRoleBackToOriginalState");var Bg=Object.defineProperty,Ug=(e,t)=>Bg(e,"name",{value:t,configurable:!0});function Ns(){Ba(document)&&Ua(document)}Ug(Ns,"scrollTargetIntoViewIfNeeded"),Wt(Ns),f("click",'a[href^="#"]',function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&setTimeout(Ns,0)}),f("click",".js-flash-close",function(e){const t=e.currentTarget.closest(".flash-messages");e.currentTarget.closest(".flash").remove(),t&&!t.querySelector(".flash")&&t.remove()});var Wg=Object.defineProperty,zg=(e,t)=>Wg(e,"name",{value:t,configurable:!0});const Vg=["flash-notice","flash-error","flash-message","flash-warn"];function rd(e){for(const{key:t,value:n}of Vg.flatMap(Lo)){jo(t);let r;try{r=atob(decodeURIComponent(n))}catch{continue}e.after(new de(e,{className:t,message:r}))}}zg(rd,"displayFlash"),p("template.js-flash-template",{constructor:HTMLTemplateElement,add(e){rd(e)}});const Bs=new WeakMap;document.addEventListener("focus",function(e){const t=e.target;t instanceof Element&&!Bs.get(t)&&(v(t,"focusin:delay"),Bs.set(t,!0))},{capture:!0}),document.addEventListener("blur",function(e){setTimeout(function(){const t=e.target;t instanceof Element&&t!==document.activeElement&&(v(t,"focusout:delay"),Bs.delete(t))},200)},{capture:!0}),M(".js-form-toggle-target",async function(e,t){try{await t.text()}catch{return}const n=e.closest(".js-form-toggle-container");n.querySelector(".js-form-toggle-target[hidden]").hidden=!1,e.hidden=!0});var Kg=Object.defineProperty,Xg=(e,t)=>Kg(e,"name",{value:t,configurable:!0});function od(e){e instanceof CustomEvent&&ze(`${e.detail} results found.`)}Xg(od,"noticeHandler"),p("fuzzy-list",{constructor:Wa,subscribe:e=>E(e,"fuzzy-list-sorted",od)}),f("click",".email-hidden-toggle",function(e){const t=e.currentTarget.nextElementSibling;t instanceof HTMLElement&&(t.style.display="",t.classList.toggle("expanded"),e.preventDefault())});var Gg=Object.defineProperty,sd=(e,t)=>Gg(e,"name",{value:t,configurable:!0});p(".js-hook-url-field",{constructor:HTMLInputElement,add(e){function t(){const n=e.form;if(!n)return;let r;try{r=new URL(e.value)}catch{}const o=n.querySelector(".js-invalid-url-notice");o instanceof HTMLElement&&(o.hidden=!!(e.value===""||r&&/^https?:/.test(r.protocol)));const s=n.querySelector(".js-insecure-url-notice");s instanceof HTMLElement&&r&&e.value&&(s.hidden=/^https:$/.test(r.protocol));const i=n.querySelector(".js-ssl-hook-fields");i instanceof HTMLElement&&(i.hidden=!(r&&r.protocol==="https:"))}sd(t,"checkUrl"),$n(e,t),t()}});function Us(e){const t=document.querySelectorAll(".js-hook-event-checkbox");for(const n of t)n.checked=n.matches(e)}sd(Us,"chooseEvents"),f("change",".js-hook-event-choice",function(e){const t=e.currentTarget,n=t.checked&&t.value==="custom",r=t.closest(".js-hook-events-field");if(r&&r.classList.toggle("is-custom",n),t.checked)if(n){const o=document.querySelector(".js-hook-wildcard-event");o.checked=!1}else t.value==="push"?Us('[value="push"]'):t.value==="all"&&Us(".js-hook-wildcard-event")}),f("click",".js-hook-deliveries-pagination-button",async function(e){const t=e.currentTarget;t.disabled=!0;const n=t.parentElement,r=t.getAttribute("data-url");n.before(await U(document,r)),n.remove()}),M(".js-redeliver-hook-form",async function(e,t){let n;try{n=await t.html()}catch{e.classList.add("failed");return}document.querySelector(".js-hook-deliveries-container").replaceWith(n.html)});var Jg=Object.defineProperty,Qg=(e,t)=>Jg(e,"name",{value:t,configurable:!0});p("[data-hotkey]",{constructor:HTMLElement,add(e){if(za())no(e);else{const t=e.getAttribute("data-hotkey");if(t){const n=id(t);n.length>0&&(e.setAttribute("data-hotkey",n),no(e))}}},remove(e){ha(e)}});function id(e){return e.split(",").filter(n=>Va(n)).join(",")}Qg(id,"filterOutCharacterKeyShortcuts");var Yg=Object.defineProperty,H=(e,t)=>Yg(e,"name",{value:t,configurable:!0});const N=document.querySelector(".js-hovercard-content"),Zg=pe(U);let ge,fr=null,Ws,zs=0;const Vs=12,Ks=24,ad=Ks-7,cd=16,eb=100,tb=250;function He(e){return"Popover-message--"+e}H(He,"contentClass");function ld(e){setTimeout(()=>{if(document.body&&document.body.contains(e)){const t=e.querySelector("[data-hovercard-tracking]");if(t){const r=t.getAttribute("data-hovercard-tracking");r&&Ht("user-hovercard-load",JSON.parse(r))}const n=e.querySelector("[data-hydro-view]");n instanceof HTMLElement&&Ka(n)}},500)}H(ld,"trackLoad");function jt(){N instanceof HTMLElement&&(N.style.display="none",N.children[0].innerHTML="",fr=null,ge=null)}H(jt,"hideCard");function ud(e){const t=e.getClientRects();let n=t[0]||e.getBoundingClientRect()||{top:0,left:0,height:0,width:0};if(t.length>0){for(const r of t)if(r.left<zs&&r.right>zs){n=r;break}}return n}H(ud,"selectRectNearestMouse");function dd(e){const{width:t,height:n}=N.getBoundingClientRect(),{left:r,top:o,height:s,width:i}=ud(e),a=o>n;if(e.classList.contains("js-hovercard-left")){const l=r-t-Vs,d=o+s/2;return{containerTop:a?d-n+ad+cd/2:d-ad-cd/2,containerLeft:l,contentClassSuffix:a?"right-bottom":"right-top"}}else{const l=window.innerWidth-r>t,d=r+i/2,m=l?d-Ks:d-t+Ks;return{containerTop:a?o-n-Vs:o+s+Vs,containerLeft:m,contentClassSuffix:a?l?"bottom-left":"bottom-right":l?"top-left":"top-right"}}}H(dd,"calculatePositions");function fd(e,t){if(!(N instanceof HTMLElement))return;N.style.visibility="hidden",N.style.display="block",t.classList.remove(He("bottom-left"),He("bottom-right"),He("right-top"),He("right-bottom"),He("top-left"),He("top-right"));const{containerTop:n,containerLeft:r,contentClassSuffix:o}=dd(e);t.classList.add(He(o)),N.style.top=`${n+window.pageYOffset}px`,N.style.left=`${r+window.pageXOffset}px`,wd(e,N),N.style.visibility=""}H(fd,"positionCard");function Xs(e,t){if(!(N instanceof HTMLElement))return;const n=N.children[0];n.innerHTML="";const r=document.createElement("div");for(const o of e.children)r.appendChild(o.cloneNode(!0));n.appendChild(r),fd(t,n),ld(r),N.style.display="block"}H(Xs,"showCard");function md(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"):null}H(md,"determineEnclosingSubject");function pd(e){const t=e.getAttribute("data-hovercard-url");if(t){const n=md(e);if(n){const r=new URL(t,window.location.origin),o=new URLSearchParams(r.search.slice(1));return o.append("subject",n),o.append("current_path",window.location.pathname+window.location.search),r.search=o.toString(),r.toString()}return t}return""}H(pd,"hovercardUrlFromTarget");function hd(e){const t=e.getAttribute("data-hovercard-type");return t==="pull_request"||t==="issue"?!!e.closest("[data-issue-and-pr-hovercards-enabled]"):t==="team"?!!e.closest("[data-team-hovercards-enabled]"):t==="repository"?!!e.closest("[data-repository-hovercards-enabled]"):t==="commit"?!!e.closest("[data-commit-hovercards-enabled]"):t==="project"?!!e.closest("[data-project-hovercards-enabled]"):t==="discussion"?!!e.closest("[data-discussion-hovercards-enabled]"):t==="acv_badge"?!!e.closest("[data-acv-badge-hovercards-enabled]"):t==="sponsors_listing"?!!e.closest("[data-sponsors-listing-hovercards-enabled]"):!0}H(hd,"hovercardsAreEnabledForType");async function gd(e,t){if("ontouchstart"in document)return;const r=e.currentTarget;if(e instanceof MouseEvent&&(zs=e.clientX),!(r instanceof Element)||ge===r||r.closest(".js-hovercard-content")||!hd(r))return;jt(),ge=r,fr=document.activeElement;const o=pd(r);let s;try{const i=new Promise(a=>window.setTimeout(a,t,0));s=await Zg(document,o),await i}catch(i){const a=i.response;if(a&&a.status===404){const c="Hovercard is unavailable";r.setAttribute("aria-label",c),r.classList.add("tooltipped","tooltipped-ne")}else if(a&&a.status===410){const c=await a.clone().json();r.setAttribute("aria-label",c.message),r.classList.add("tooltipped","tooltipped-ne")}return}r===ge&&(Xs(s,r),e instanceof KeyboardEvent&&N instanceof HTMLElement&&N.focus())}H(gd,"activateFn");function bd(e){gd(e,tb)}H(bd,"activateWithTimeoutFn");function mr(e){if(!!ge){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&&fr instanceof HTMLElement&&fr.focus();jt()}}H(mr,"deactivateFn");function yd(e){const t=ge;Ws=window.setTimeout(()=>{ge===t&&mr(e)},eb)}H(yd,"deactivateWithTimeoutFn");function Gs(e){if(e instanceof KeyboardEvent)switch(e.key){case"Escape":mr(e)}}H(Gs,"keyupFn");function vd(){Ws&&clearTimeout(Ws)}H(vd,"cancelDeactivation"),N&&(p("[data-hovercard-url]",{subscribe:e=>ie(E(e,"mouseover",bd),E(e,"mouseleave",yd),E(e,"keyup",Gs))}),p("[data-hovercard-url]",{remove(e){ge===e&&jt()}}),p(".js-hovercard-content",{subscribe:e=>ie(E(e,"mouseover",vd),E(e,"mouseleave",mr),E(e,"keyup",Gs))}),p(".js-hovercard-include-fragment",{constructor:HTMLTemplateElement,add(e){ge&&Xs(e.content,ge)}}),f("menu:activated","details",jt),window.addEventListener("statechange",jt));function wd(e,t){const n=e.getAttribute("data-hovercard-z-index-override");n?t.style.zIndex=n:t.style.zIndex="100"}H(wd,"setZIndexOverride"),async function(){document.addEventListener("pjax:complete",()=>fo({pjax:"true"})),await zt,fo()}(),f("click","[data-octo-click]",function(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.getAttribute("data-octo-click")||"",r={};if(t.hasAttribute("data-ga-click")){const s=t.getAttribute("data-ga-click").split(",");r.category=s[0].trim(),r.action=s[1].trim()}if(t.hasAttribute("data-octo-dimensions")){const o=t.getAttribute("data-octo-dimensions").split(",");for(const s of o){const[i,a]=s.split(/:(.+)/);i&&(r[i]=a||"")}}Ht(n,r)}),f("click","[data-hydro-click]",function(e){const t=e.currentTarget,n=t.getAttribute("data-hydro-click")||"",r=t.getAttribute("data-hydro-click-hmac")||"",o=t.getAttribute("data-hydro-client-context")||"";mo(n,r,o)}),f("click","[data-optimizely-hydro-click]",function(e){const t=e.currentTarget,n=t.getAttribute("data-optimizely-hydro-click")||"",r=t.getAttribute("data-optimizely-hydro-click-hmac")||"";mo(n,r,"")}),M(".js-immediate-updates",async function(e,t){let n;try{n=(await t.json()).json.updateContent}catch(r){r.response.json&&(n=r.response.json.updateContent)}if(n)for(const r in n){const o=n[r],s=document.querySelector(r);s instanceof HTMLElement&&In(s,o)}});var nb=Object.defineProperty,Js=(e,t)=>nb(e,"name",{value:t,configurable:!0});p("include-fragment, poll-include-fragment",{subscribe:e=>ie(E(e,"error",jd),E(e,"loadstart",Ld))}),f("click","include-fragment button[data-retry-button]",({currentTarget:e})=>{const t=e.closest("include-fragment"),n=t.src;t.src="",t.src=n});function Qs(e,t){const n=e.currentTarget;if(n instanceof Element){for(const r of n.querySelectorAll("[data-show-on-error]"))r instanceof HTMLElement&&(r.hidden=!t);for(const r of n.querySelectorAll("[data-hide-on-error]"))r instanceof HTMLElement&&(r.hidden=t)}}Js(Qs,"toggleElements");function Ld(e){Qs(e,!1)}Js(Ld,"onLoad");function jd(e){Qs(e,!0)}Js(jd,"onError"),p("[data-indeterminate]",{constructor:HTMLInputElement,initialize(e){e.indeterminate=!0}});var rb=Object.defineProperty,ob=(e,t)=>rb(e,"name",{value:t,configurable:!0});function Ed(){k.import("./chunk-jump-to.js")}ob(Ed,"load"),p(".js-jump-to-field",{constructor:HTMLInputElement,add(e){e.addEventListener("focusin",Ed,{once:!0}),Xa(window.location.pathname)}});var sb=Object.defineProperty,ib=(e,t)=>sb(e,"name",{value:t,configurable:!0});let Ys=!1;async function Zs(){if(Ys)return;Ys=!0;const t={contexts:document.querySelector("meta[name=github-keyboard-shortcuts]").content},n=`/site/keyboard_shortcuts?${new URLSearchParams(t).toString()}`,r=await Le({content:U(document,n)});r.style.width="800px",r.addEventListener("dialog:remove",function(){Ys=!1},{once:!0})}ib(Zs,"showKeyboardShortcuts"),f("click",".js-keyboard-shortcuts",Zs),document.addEventListener("keydown",e=>{e instanceof KeyboardEvent&&(!qn(e)||e.target instanceof Node&&Ga(e.target)||An(e)==="Shift+?"&&Zs())}),p(".js-modifier-key",{constructor:HTMLElement,add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.textContent;t&&(t=t.replace(/ctrl/,"\u2318"),t=t.replace(/alt/,"\u2325"),e.textContent=t)}}}),p(".js-modifier-label-key",{add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.textContent;t=t.replace(/ctrl\+/,"cmd-"),t=t.replace(/alt\+/,"option-"),t=t.replace(/shift\+/,"shift-"),e.textContent=t}}}),p(".js-modifier-aria-label-key",{add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.getAttribute("aria-label");t=t.replace(/ctrl\+/,"cmd-"),t=t.replace(/alt\+/,"option-"),t=t.replace(/shift\+/,"shift-"),e.setAttribute("aria-label",t)}}});var ab=Object.defineProperty,cb=(e,t)=>ab(e,"name",{value:t,configurable:!0});function fn(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=parseInt(t.getAttribute("data-input-max-length")||"",10),r=parseInt(t.getAttribute("data-warning-length")||"",10)||5,s=t.value.replace(/(\r\n|\n|\r)/g,`\r
|
|
`);let i=n-s.length;if(i<=0){let d=s.substr(0,n);d.endsWith("\r")?(d=d.substr(0,n-1),i=1):i=0,t.value=d}const a=t.getAttribute("data-warning-text"),l=t.closest(".js-length-limited-input-container").querySelector(".js-length-limited-input-warning");i<=r?(l.textContent=a.replace(new RegExp("{{remaining}}","g"),`${i}`),l.classList.remove("d-none")):(l.textContent="",l.classList.add("d-none"))}cb(fn,"displayLengthWarning"),p(".js-length-limited-input",{add(e){e.addEventListener("input",fn),e.addEventListener("change",fn)},remove(e){e.removeEventListener("input",fn),e.removeEventListener("change",fn)}}),p("link[rel=prefetch-viewed]",{initialize(){window.requestIdleCallback(()=>{fetch(location.href,{method:"HEAD",credentials:"same-origin",headers:{Purpose:"prefetch-viewed"}})})}}),f("click",".js-member-search-filter",function(e){e.preventDefault();const t=e.currentTarget.getAttribute("data-filter"),r=e.currentTarget.closest("[data-filter-on]").getAttribute("data-filter-on"),o=document.querySelector(".js-member-filter-field"),s=o.value,i=new RegExp(`${r}:(?:[a-z]|_|((').*(')))+`),a=s.toString().trim().replace(i,"");o.value=`${a} ${t}`.replace(/\s\s/," ").trim(),o.focus(),v(o,"input")}),f("auto-check-success",".js-new-organization-name",function(e){const t=e.target,r=t.closest("dd").querySelector(".js-field-hint-name");!r||(r.textContent=t.value)}),M(".js-notice-dismiss",async function(e,t){await t.text(),e.closest(".js-notice").remove()}),f("submit",".js-notice-dismiss-remote",async function(e){const t=e.currentTarget;e.preventDefault();let n;try{n=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}catch{qe();return}n&&!n.ok?qe():t.closest(".js-notice").remove()});var lb=Object.defineProperty,ub=(e,t)=>lb(e,"name",{value:t,configurable:!0});function Sd(e){try{const t=e.getBoundingClientRect();if(t.height===0&&t.width===0||e.style.opacity==="0"||e.style.visibility==="hidden")return!1}catch{}return!0}ub(Sd,"isVisible"),f("click",".js-github-dev-shortcut",function(e){e.preventDefault();for(const n of document.querySelectorAll("textarea.js-comment-field"))if(n.value&&Sd(n)&&!confirm("Are you sure you want to open github.dev?"))return;const t=e.currentTarget;t.pathname=window.location.pathname,t.hash=window.location.hash,window.location.href=t.href}),f("click",".js-github-dev-new-tab-shortcut",function(e){const t=e.currentTarget;t.pathname=window.location.pathname,t.hash=window.location.hash}),f("click",".js-permalink-shortcut",function(e){const t=e.currentTarget;try{Ke(null,"",t.href+window.location.hash)}catch{window.location.href=t.href+window.location.hash}for(const n of document.querySelectorAll(".js-permalink-replaceable-link"))n instanceof HTMLAnchorElement&&(n.href=n.getAttribute("data-permalink-href"));e.preventDefault()}),M(".js-permission-menu-form",async function(e,t){const n=e.querySelector(".js-permission-success"),r=e.querySelector(".js-permission-error");n.hidden=!0,r.hidden=!0,e.classList.add("is-loading");let o;try{o=await t.json()}catch{e.classList.remove("is-loading"),r.hidden=!1;return}e.classList.remove("is-loading"),n.hidden=!1;const s=e.closest(".js-org-repo");if(s){const i=o.json;s.classList.toggle("with-higher-access",i.members_with_higher_access)}});var db=Object.defineProperty,pr=(e,t)=>db(e,"name",{value:t,configurable:!0});(async function(){await Xt;const e=document.querySelector(".js-pjax-loader-bar");if(!e)return;const t=e.firstElementChild;if(!(t instanceof HTMLElement))return;let n=0,r=null,o=null;function s(){i(0),e&&e.classList.add("is-loading"),r=window.setTimeout(a,0)}pr(s,"initiateLoader");function i(l){t instanceof HTMLElement&&(l===0&&(o==null&&(o=getComputedStyle(t).transition),t.style.transition="none"),n=l,t.style.width=`${n}%`,l===0&&(t.clientWidth,t.style.transition=o||""))}pr(i,"setWidth");function a(){n===0&&(n=12),i(Math.min(n+3,95)),r=window.setTimeout(a,500)}pr(a,"increment");function c(){r&&clearTimeout(r),i(100),e&&e.classList.remove("is-loading")}pr(c,"finishLoader"),document.addEventListener("pjax:start",s),document.addEventListener("pjax:end",c)})();var fb=Object.defineProperty,ei=(e,t)=>fb(e,"name",{value:t,configurable:!0});let ti=null;const ni="last_pjax_request",hr="pjax_start",ri="pjax_end";function kd(e){e instanceof CustomEvent&&e.detail&&e.detail.url&&(window.performance.mark(hr),ti=e.detail.url)}ei(kd,"markPjaxStart");async function _d(){if(await Xe(),!window.performance.getEntriesByName(hr).length)return;window.performance.mark(ri),window.performance.measure(ni,hr,ri);const t=window.performance.getEntriesByName(ni).pop(),n=t?t.duration:null;!n||(ti&&we({requestUrl:ti,pjaxDuration:Math.round(n)}),Td())}ei(_d,"trackPjaxTiming");function Td(){window.performance.clearMarks(hr),window.performance.clearMarks(ri),window.performance.clearMeasures(ni)}ei(Td,"clearPjaxMarks"),"getEntriesByName"in window.performance&&(document.addEventListener("pjax:start",kd),document.addEventListener("pjax:end",_d)),document.addEventListener("pjax:click",function(e){if(window.onbeforeunload)return e.preventDefault()});var mb=Object.defineProperty,pb=(e,t)=>mb(e,"name",{value:t,configurable:!0});function Cd(e){const t=e.createElement("textarea");return t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",e.body.appendChild(t),t.focus(),()=>(t.blur(),t.remove(),t.value)}pb(Cd,"captureKeypresses");let gr=null;f("pjax:click",".js-pjax-capture-input",function(){gr=Cd(document)}),f("pjax:end","#js-repo-pjax-container",function(){if(gr){const e=gr(),t=document.querySelector(".js-pjax-restore-captured-input");t instanceof HTMLInputElement&&e&&$e(t,e),gr=null}});var hb=Object.defineProperty,gb=(e,t)=>hb(e,"name",{value:t,configurable:!0});function xd(e,t){const n=e.split("/",3).join("/"),r=t.split("/",3).join("/");return n===r}gb(xd,"isSameRepo"),f("pjax:click","#js-repo-pjax-container a[href]",function(e){const t=e.currentTarget.pathname;xd(t,location.pathname)||e.preventDefault()}),f("pjax:click",".js-comment-body",function(e){const t=e.target;t instanceof HTMLAnchorElement&&t.pathname.split("/")[3]==="files"&&e.preventDefault()}),f("pjax:click",".js-pjax-history-navigate",function(e){e.currentTarget instanceof HTMLAnchorElement&&(e.currentTarget.href===Ja()?(history.back(),e.detail.relatedEvent.preventDefault(),e.preventDefault()):e.currentTarget.href===Qa()&&(history.forward(),e.detail.relatedEvent.preventDefault(),e.preventDefault()))});var bb=Object.defineProperty,Ad=(e,t)=>bb(e,"name",{value:t,configurable:!0});function oi(e){return e.getAttribute("data-pjax-preserve-scroll")!=null?!1:0}Ad(oi,"preserveScrollTo");function mn(e){let t=e;for(;t;){const n=t.getAttribute("data-pjax");if(n&&n!=="true")return document.querySelector(n);t=t.parentElement&&t.parentElement.closest("[data-pjax]")}return e.closest("[data-pjax-container]")}Ad(mn,"detectContainer");var yb=Object.defineProperty,Pd=(e,t)=>yb(e,"name",{value:t,configurable:!0});function Md(e){if(e.id)return`#${e.id}`;throw new Error("pjax container has no id")}Pd(Md,"getContainerSelector");function qd(e,t){const n=mn(e),r=Md(n),o=new URL(e.href,window.location.origin),s=new URLSearchParams(o.search.slice(1));return o.search=s.toString(),fetch(o.href,{headers:Object.assign({Accept:"text/html","X-PJAX":"true","X-PJAX-Container":r,"X-Requested-With":"XMLHttpRequest"},t&&t.headers)})}Pd(qd,"pjaxFetch"),p("[data-pjax-container] link[rel=pjax-prefetch]",{constructor:HTMLLinkElement,initialize(e){qd(e,{headers:{Purpose:"prefetch"}})}});var vb=Object.defineProperty,$d=(e,t)=>vb(e,"name",{value:t,configurable:!0});f("click","[data-pjax] a, a[data-pjax]",function(e){const t=e.currentTarget;if(t instanceof HTMLAnchorElement){if(t.getAttribute("data-skip-pjax")!=null||t.getAttribute("data-remote")!=null)return;const n=mn(t);n&&Id(e,{container:n,scrollTo:oi(t)})}}),f("change","select[data-pjax]",function(e){const t=e.currentTarget,n=mn(t);n&&Ut({url:t.value,container:n})});function Id(e,t){const n=e.currentTarget;if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||location.protocol!==n.protocol||location.hostname!==n.hostname||n.href.indexOf("#")>-1&&si(n)===si(location)||e.defaultPrevented)return;const r={url:n.href,target:n,...t},o=new CustomEvent("pjax:click",{bubbles:!0,cancelable:!0,detail:{options:r,relatedEvent:e}});n.dispatchEvent(o)&&(Ut(r),e.preventDefault(),n.dispatchEvent(new CustomEvent("pjax:clicked",{bubbles:!0,cancelable:!0,detail:{options:r}})))}$d(Id,"click");function si(e){return e.href.replace(/#.*/,"")}$d(si,"stripHash");var wb=Object.defineProperty,Lb=(e,t)=>wb(e,"name",{value:t,configurable:!0});f("submit","form[data-pjax]",function(e){const t=e.currentTarget,n=mn(t);if(!n)return;const r=oi(t),o={type:(t.method||"GET").toUpperCase(),url:t.action,target:t,scrollTo:r,container:n};if(o.type==="GET"){if(t.querySelector("input[type=file]"))return;const s=Fd(o.url);s.search+=(s.search?"&":"")+so(t),o.url=s.toString()}else o.data=new FormData(t);Ut(o),e.preventDefault()});function Fd(e){const t=document.createElement("a");return t.href=e,t}Lb(Fd,"parseURL"),p("body.js-print-popup",()=>{window.print(),setTimeout(window.close,1e3)}),p("poll-include-fragment[data-redirect-url]",function(e){const t=e.getAttribute("data-redirect-url");e.addEventListener("load",function(){window.location.href=t})}),p("poll-include-fragment[data-reload]",function(e){e.addEventListener("load",function(){window.location.reload()})});var jb=Object.defineProperty,Eb=(e,t)=>jb(e,"name",{value:t,configurable:!0});function Od(){return typeof Blob=="function"&&typeof PerformanceObserver=="function"&&typeof Intl!="undefined"&&typeof MutationObserver!="undefined"&&typeof URLSearchParams!="undefined"&&typeof WebSocket!="undefined"&&typeof IntersectionObserver!="undefined"&&typeof AbortController!="undefined"&&typeof queueMicrotask!="undefined"&&typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"&&typeof customElements!="undefined"&&typeof HTMLDetailsElement!="undefined"&&"fromEntries"in Object&&"entries"in FormData.prototype&&"toggleAttribute"in Element.prototype&&"flatMap"in Array.prototype&&"replaceChildren"in Element.prototype}Eb(Od,"capableBrowser");var Sb=Object.defineProperty,be=(e,t)=>Sb(e,"name",{value:t,configurable:!0});let Rd=!1,Dd=0;const kb=Date.now();function _b(e){e.error&&br(vr(yr(e.error)))}be(_b,"reportEvent");async function Tb(e){if(!!e.promise)try{await e.promise}catch(t){br(vr(yr(t)))}}be(Tb,"reportPromiseRejectionEvent");function ii(e,t={}){e&&e.name!=="AbortError"&&br(vr(yr(e),t))}be(ii,"reportError");async function br(e){var t,n;if(!Wd())return;const r=(n=(t=document.head)==null?void 0:t.querySelector('meta[name="browser-errors-url"]'))==null?void 0:n.content;if(!!r){if(Bd(e.error.stacktrace)){Rd=!0;return}Dd++;try{await fetch(r,{method:"post",body:JSON.stringify(e)})}catch{}}}be(br,"report");function yr(e){return{type:e.name,value:e.message,stacktrace:Hd(e)}}be(yr,"formatError");function vr(e,t={}){return Object.assign({error:e,sanitizedUrl:Ya()||window.location.href,readyState:document.readyState,referrer:document.referrer,timeSinceLoad:Math.round(Date.now()-kb),user:Ud()||void 0},t)}be(vr,"errorContext");function Hd(e){return ga(e.stack||"").map(t=>({filename:t.file||"",function:String(t.methodName),lineno:(t.lineNumber||0).toString(),colno:(t.column||0).toString()}))}be(Hd,"stacktrace");const Nd=/(chrome|moz|safari)-extension:\/\//;function Bd(e){return e.some(t=>Nd.test(t.filename)||Nd.test(t.function))}be(Bd,"isExtensionError");function Ud(){var e,t;const n=(t=(e=document.head)==null?void 0:e.querySelector('meta[name="user-login"]'))==null?void 0:t.content;return n||`anonymous-${Za()}`}be(Ud,"pageUser");let ai=!1;window.addEventListener("pageshow",()=>ai=!1),window.addEventListener("pagehide",()=>ai=!0);function Wd(){return!ai&&!Rd&&Dd<10&&Od()&&!po(document)}be(Wd,"reportable"),typeof BroadcastChannel=="function"&&new BroadcastChannel("shared-worker-error").addEventListener("message",t=>{ii(t.data.error)});const Cb="$__",zd=document.querySelector("meta[name=js-proxy-site-detection-payload]"),Vd=document.querySelector("meta[name=expected-hostname]");if(zd instanceof HTMLMetaElement&&Vd instanceof HTMLMetaElement&&po(document)){const e={url:window.location.href,expectedHostname:Vd.content,documentHostname:document.location.hostname,proxyPayload:zd.content},t=new Error,n={};n[`${Cb}`]=btoa(JSON.stringify(e)),ii(t,n)}var xb=Object.defineProperty,Ab=(e,t)=>xb(e,"name",{value:t,configurable:!0});K("keydown",".js-quick-submit",function(e){Kd(e)});function Kd(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&e.key==="Enter"){const n=t.form,r=n.querySelector("input[type=submit], button[type=submit]");if(e.shiftKey){const o=n.querySelector(".js-quick-submit-alternative");(o instanceof HTMLInputElement||o instanceof HTMLButtonElement)&&!o.disabled&&V(n,o)}else(r instanceof HTMLInputElement||r instanceof HTMLButtonElement)&&r.disabled||V(n);e.preventDefault()}}Ab(Kd,"quickSubmit");var Pb=Object.defineProperty,ci=(e,t)=>Pb(e,"name",{value:t,configurable:!0});let wr;p(".js-comment-quote-reply",function(e){var t;e.hidden=((t=e.closest(".js-quote-selection-container"))==null?void 0:t.querySelector(".js-inline-comment-form-container textarea, .js-new-comment-form textarea"))==null});function li(e){return e.nodeName==="DIV"&&e.classList.contains("highlight")}ci(li,"isHighlightContainer");function Xd(e){return e.nodeName==="IMG"||e.firstChild!=null}ci(Xd,"hasContent");const Gd={PRE(e){const t=e.parentElement;if(t&&li(t)){const n=t.className.match(/highlight-source-(\S+)/),r=n?n[1]:"",o=(e.textContent||"").replace(/\n+$/,"");e.textContent=`\`\`\`${r}
|
|
${o}
|
|
\`\`\``,e.append(`
|
|
|
|
`)}return e},A(e){const t=e.textContent||"";return e.classList.contains("user-mention")||e.classList.contains("team-mention")||e.classList.contains("issue-link")&&/^#\d+$/.test(t)?t:e},IMG(e){const t=e.getAttribute("alt");return t&&e.classList.contains("emoji")?t:e},DIV(e){if(e.classList.contains("js-suggested-changes-blob"))e.remove();else if(e.classList.contains("blob-wrapper-embedded")){const t=e.parentElement,n=t.querySelector("a[href]"),r=document.createElement("p");r.textContent=n.href,t.replaceWith(r)}return e}};function Jd(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return o.nodeName in Gd&&Xd(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),n=[];let r=t.nextNode();for(;r;)r instanceof HTMLElement&&n.push(r),r=t.nextNode();n.reverse();for(const o of n)o.replaceWith(Gd[o.nodeName](o))}ci(Jd,"insertMarkdownSyntax"),f("click",".js-comment-quote-reply",function({isTrusted:e,currentTarget:t}){const n=t.closest(".js-comment"),r=n.querySelector(".js-comment-body"),o=n.querySelector(".js-comment-body").cloneNode(!0),s=n.closest(".js-quote-selection-container"),i=r.querySelectorAll("button.js-convert-to-issue-button, span.js-clear");for(const l of i)l.remove();let a=new ba;if(!e&&a.range.collapsed||(s.hasAttribute("data-quote-markdown")&&(a=new ya(s.getAttribute("data-quote-markdown")||"",l=>{const d=a.range.startContainer.parentElement,m=d&&d.closest("pre");if(m instanceof HTMLElement){const h=m.parentElement;if(h&&li(h)){const g=document.createElement("div");g.className=h.className,g.appendChild(l),l.appendChild(g)}}Jd(l)})),wr&&r.contains(wr.anchorNode)?a.range=wr.range:a.range.collapsed&&a.select(r),a.closest(".js-quote-selection-container")!==s))return;const c=a.range;s.dispatchEvent(new CustomEvent("quote-selection",{bubbles:!0,detail:a})),a.range=c;for(const l of s.querySelectorAll("textarea"))if(Bt(l)){a.insert(l);break}n.querySelector(".js-comment-body").replaceWith(o)});let ui;document.addEventListener("selectionchange",We(function(){const e=window.getSelection();let t;try{t=e.getRangeAt(0)}catch{ui=null;return}ui={anchorNode:e.anchorNode,range:t}},100)),document.addEventListener("toggle",()=>{wr=ui},{capture:!0});var Mb=Object.defineProperty,Qd=(e,t)=>Mb(e,"name",{value:t,configurable:!0});M(".js-pick-reaction",async function(e,t){const n=await t.json(),r=e.closest(".js-comment"),o=r.querySelector(".js-reactions-container"),s=r.querySelector(".js-comment-header-reaction-button"),i=fe(document,n.json.reactions_container.trim()),a=fe(document,n.json.comment_header_reaction_button.trim());o.replaceWith(i),s.replaceWith(a)});function di(e){const t=e.target,n=t.getAttribute("data-reaction-label"),o=t.closest(".js-add-reaction-popover").querySelector(".js-reaction-description");o.hasAttribute("data-default-text")||o.setAttribute("data-default-text",o.textContent||""),o.textContent=n}Qd(di,"showReactionContent");function fi(e){const n=e.target.closest(".js-add-reaction-popover").querySelector(".js-reaction-description"),r=n.getAttribute("data-default-text");r&&(n.textContent=r)}Qd(fi,"hideReactionContent"),f("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",di),n.addEventListener("mouseleave",fi)):(n.removeEventListener("mouseenter",di),n.removeEventListener("mouseleave",fi))},{capture:!0});var qb=Object.defineProperty,$b=(e,t)=>qb(e,"name",{value:t,configurable:!0});function Yd(e,t,n){e.getAttribute("data-type")==="json"&&n.headers.set("Accept","application/json"),v(e,"deprecatedAjaxSend",{request:n}),t.text().catch(o=>{if(o.response)return o.response;throw o}).then(o=>{o.status<300?v(e,"deprecatedAjaxSuccess"):v(e,"deprecatedAjaxError",{error:o.statusText,status:o.status,text:o.text})},o=>{v(e,"deprecatedAjaxError",{error:o.message,status:0,text:null})}).then(()=>{v(e,"deprecatedAjaxComplete")})}$b(Yd,"submitWithLegacyEvents"),f("click",["form button:not([type])","form button[type=submit]","form input[type=submit]"].join(", "),function(e){const t=e.currentTarget;t.form&&!e.defaultPrevented&&ec(t)}),M("form[data-remote]",Yd),f("deprecatedAjaxComplete","form",function({currentTarget:e}){const t=ho(e);t&&t.remove()}),to(e=>{const t=ho(e);t&&t.remove()}),va(Fn);var Zd=Object.defineProperty,Ib=Object.getOwnPropertyDescriptor,Fb=(e,t)=>Zd(e,"name",{value:t,configurable:!0}),pn=(e,t,n,r)=>{for(var o=r>1?void 0:r?Ib(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Zd(t,n,o),o};let it=class extends HTMLElement{constructor(){super(...arguments);this.loaderWasFocused=!1}connectedCallback(){this.setPaginationUrl(this.list)}get hasNextPage(){return!this.form.hidden}loadNextPage(){!this.hasNextPage||V(this.form)}get disabled(){return this.submitButton.hasAttribute("aria-disabled")}set disabled(e){e?this.submitButton.setAttribute("aria-disabled","true"):this.submitButton.removeAttribute("aria-disabled"),this.submitButton.classList.toggle("disabled",e)}loadstart(e){e.target.addEventListener("focus",()=>{this.loaderWasFocused=!0},{once:!0}),e.target.addEventListener("include-fragment-replaced",()=>{var t;this.setPaginationUrl(this.list),this.loaderWasFocused&&((t=this.focusMarkers.pop())==null||t.focus()),this.loaderWasFocused=!1},{once:!0})}async submit(e){var t;if(e.preventDefault(),this.disabled)return;this.disabled=!0;let n;try{const o=await fetch(this.form.action);if(!o.ok)return;n=await o.text()}catch{return}const r=fe(document,n);this.setPaginationUrl(r),this.list.append(r),(t=this.focusMarkers.pop())==null||t.focus(),this.disabled=!1,this.dispatchEvent(new CustomEvent("remote-pagination-load"))}setPaginationUrl(e){const t=e.querySelector("[data-pagination-src]");if(!t)return;const n=t.getAttribute("data-pagination-src");n?(this.form.action=n,this.form.hidden=!1):this.form.hidden=!0}};Fb(it,"RemotePaginationElement"),pn([y],it.prototype,"form",2),pn([y],it.prototype,"list",2),pn([te],it.prototype,"focusMarkers",2),pn([y],it.prototype,"submitButton",2),it=pn([I],it),p(".has-removed-contents",function(){let e;return{add(t){e=Array.from(t.childNodes);for(const r of e)t.removeChild(r);const n=t.closest("form");n&&v(n,"change")},remove(t){for(const r of e)t.appendChild(r);const n=t.closest("form");n&&v(n,"change")}}});var Ob=Object.defineProperty,hn=(e,t)=>Ob(e,"name",{value:t,configurable:!0});const mi=".js-render-plaintext";function ef(e){const t=e.closest(".js-render-needs-enrichment");if(!t)return;t.querySelector(mi)&&Lr(t,!1)}hn(ef,"markdownEnrichmentSuccess");function tf(e){var t;const n=(t=e.parentElement)==null?void 0:t.closest(".js-render-needs-enrichment");if(!n)return;Lr(n,!1);const r=n.querySelector(mi);if(!r)return;const o=r.querySelector("pre"),s=Mn`
|
|
<div class="flash flash-error mb-4">Error rendering markdown</div>
|
|
${o}
|
|
`;n.classList.add("render-error"),r.classList.remove("render-plaintext-hidden"),Pn(s,r)}hn(tf,"markdownEnrichmentFailed");function Lr(e,t){const n=e.getElementsByClassName("js-render-enrichment-loader")[0],r=e.getElementsByClassName("render-expand")[0];n&&(n.hidden=!t),r&&(r.hidden=t)}hn(Lr,"setCodeBlockLoaderVisibility");function nf(e,t){const n=e.querySelector(mi);t?n.classList.remove("render-plaintext-hidden"):n.classList.add("render-plaintext-hidden")}hn(nf,"setRawCodeBlockVisibility");class rf{constructor(t){this.el=t,this.enrichmentTarget=t.getElementsByClassName("js-render-enrichment-target")[0],this.iframeUrl=this.el.getAttribute("data-src"),this.identifier=this.el.getAttribute("data-identity"),this.iframeContentType=this.el.getAttribute("data-type"),this.iframeOrigin=new URL(this.iframeUrl,window.location.origin).origin,this.iframeContent=this.el.getAttribute("data-content"),Lr(this.el,!0)}enrich(){const t=this.createDialog();Pn(t,this.enrichmentTarget),this.setupModal()}setupModal(){const t=this.generateIframeCode("-fullscreen"),n=this.el.querySelector(".Box-body");this.el.querySelector(".js-full-screen-render").addEventListener("click",()=>{Pn(t,n)})}createDialog(){const t=this.generateIframeCode();return Mn` <div class="d-flex flex-column flex-auto js-render-box">
|
|
<details class="details-reset details-overlay details-overlay-dark">
|
|
<summary class="btn-sm btn position-absolute js-full-screen-render render-expand" aria-haspopup="dialog" hidden>
|
|
<svg
|
|
width="16"
|
|
height="16"
|
|
viewBox="0 0 16 16"
|
|
fill="currentColor"
|
|
class="octicon"
|
|
style="display:inline-block;vertical-align:text-bottom"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M3.72 3.72a.75.75 0 011.06 1.06L2.56 7h10.88l-2.22-2.22a.75.75 0 011.06-1.06l3.5 3.5a.75.75 0 010 1.06l-3.5 3.5a.75.75 0 11-1.06-1.06l2.22-2.22H2.56l2.22 2.22a.75.75 0 11-1.06 1.06l-3.5-3.5a.75.75 0 010-1.06l3.5-3.5z"
|
|
></path>
|
|
</svg>
|
|
</summary>
|
|
<details-dialog class="Box Box--overlay render-full-screen d-flex flex-column anim-fade-in fast">
|
|
<div>
|
|
<button
|
|
aria-label="Close dialog"
|
|
data-close-dialog=""
|
|
type="button"
|
|
data-view-component="true"
|
|
class="Link--muted btn-link position-absolute render-full-screen-close"
|
|
>
|
|
<svg
|
|
width="24"
|
|
height="24"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
style="display:inline-block;vertical-align:text-bottom"
|
|
class="octicon octicon-x"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M5.72 5.72a.75.75 0 011.06 0L12 10.94l5.22-5.22a.75.75 0 111.06 1.06L13.06 12l5.22 5.22a.75.75 0 11-1.06 1.06L12 13.06l-5.22 5.22a.75.75 0 01-1.06-1.06L10.94 12 5.72 6.78a.75.75 0 010-1.06z"
|
|
></path>
|
|
</svg>
|
|
</button>
|
|
<div class="Box-body"></div>
|
|
</div>
|
|
</details-dialog>
|
|
</details>
|
|
${t}
|
|
</div>`}generateIframeCode(t=""){const n=this.iframeUrl+t,r=this.identifier+t;return Mn`
|
|
<div
|
|
class="render-container js-render-target p-0"
|
|
data-identity="${r}"
|
|
data-host="${this.iframeOrigin}"
|
|
data-type="${this.iframeContentType}"
|
|
>
|
|
<iframe
|
|
class="render-viewer"
|
|
src="${n}"
|
|
name="${r}"
|
|
data-content="${this.iframeContent}"
|
|
sandbox="allow-scripts allow-same-origin allow-top-navigation"
|
|
>
|
|
</iframe>
|
|
</div>
|
|
`}}hn(rf,"EnrichableMarkdownRenderer"),p(".js-render-needs-enrichment",function(e){const t=e;new rf(t).enrich()}),f("preview:rendered",".js-previewable-comment-form",function(e){const n=e.currentTarget.querySelector(".js-render-needs-enrichment");n&&nf(n,!1)});var Rb=Object.defineProperty,Et=(e,t)=>Rb(e,"name",{value:t,configurable:!0});const jr=["is-render-pending","is-render-ready","is-render-loading","is-render-loaded"],Db=["is-render-ready","is-render-loading","is-render-loaded","is-render-failed","is-render-failed-fatally"],St=new WeakMap;function pi(e){const t=St.get(e);t!=null&&(t.load=t.hello=null,t.helloTimer&&(clearTimeout(t.helloTimer),t.helloTimer=null),t.loadTimer&&(clearTimeout(t.loadTimer),t.loadTimer=null))}Et(pi,"resetTiming");function gn(e){e.classList.remove(...jr),e.classList.add("is-render-failed"),tf(e),pi(e)}Et(gn,"renderFailed");function hi(e,t=!1){var n;!Bt(e)||e.classList.contains("is-render-ready")||e.classList.contains("is-render-failed")||e.classList.contains("is-render-failed-fatally")||t&&!((n=St.get(e))==null?void 0:n.hello)||gn(e)}Et(hi,"timeoutWatchdog"),p(".js-render-target",function(e){var t;const n=e;n.classList.remove(...Db),n.style.height="auto",!((t=St.get(e))==null?void 0:t.load)&&(pi(e),!St.get(e)&&(St.set(e,{load:Date.now(),hello:null,helloTimer:window.setTimeout(hi,1e4,e,!0),loadTimer:window.setTimeout(hi,45e3,e)}),e.classList.add("is-render-automatic","is-render-requested")))});function bn(e,t){e&&e.postMessage&&e.postMessage(JSON.stringify(t),"*")}Et(bn,"postAsJson"),window.addEventListener("message",function(e){let t=e.data;if(!t)return;if(typeof t=="string")try{t=JSON.parse(t)}catch{return}if(typeof t.type!="string"&&t.type!=="render")return;const n=t.type;if(typeof t.identity!="string")return;const r=t.identity;if(typeof t.body!="string")return;const o=t.body;let s;for(const d of document.querySelectorAll(".js-render-target"))if(!r||d.getAttribute("data-identity")===r){s=d;break}if(!s||e.origin!==s.getAttribute("data-host"))return;const i=t.payload!=null?t.payload:void 0,a=s.querySelector("iframe"),c=a==null?void 0:a.contentWindow;function l(){const d=a==null?void 0:a.getAttribute("data-content");if(!d)return;const m={type:"render:cmd",body:{cmd:"code_rendering_service:data:ready","code_rendering_service:data:ready":JSON.parse(d)}};bn(c,m)}switch(Et(l,"postData"),o){case"hello":{const d=St.get(s)||{untimed:!0};d.hello=Date.now();const m={type:"render:cmd",body:{cmd:"ack",ack:!0}},h={type:"render:cmd",body:{cmd:"branding",branding:!1}};if(!c)return;if(bn(c,m),bn(c,h),s.classList.contains("is-local")){const g=s.closest(".js-code-editor"),w=g instanceof HTMLElement?Vt(g):null;if(w){let L=null;const x=Et((j,P)=>{if(P&&P.origin==="setValue")return;const A=w.code();A!==L&&(L=A,bn(c,{type:"render:data",body:A}))},"sendEditorData");w.editor.on("change",x),x()}}}break;case"error":gn(s);break;case"error:fatal":{gn(s),s.classList.add("is-render-failed-fatal");break}case"error:invalid":gn(s),s.classList.add("is-render-failed-invalid");break;case"loading":s.classList.remove(...jr),s.classList.add("is-render-loading");break;case"loaded":s.classList.remove(...jr),s.classList.add("is-render-loaded");break;case"ready":ef(s),s.classList.remove(...jr),s.classList.add("is-render-ready"),i&&typeof i.height=="number"&&(s.style.height=`${i.height}px`),v(s,"render:hook:afterready",{container:s,payload:i});break;case"resize":i&&typeof i.height=="number"&&(s.style.height=`${i.height}px`);break;case"data":v(s,"edit:visual",i);break;case"code_rendering_service:markdown:get_data":if(!c)return;l();break;default:v(s,"render:hook:message",{type:n,body:o,payload:i});break}}),M("form[data-replace-remote-form]",async function(e,t){e.classList.remove("is-error"),e.classList.add("is-loading");try{let n=e;const r=await t.html(),o=e.closest("[data-replace-remote-form-target]");if(o){const s=o.getAttribute("data-replace-remote-form-target");n=s?document.getElementById(s):o}n.replaceWith(r.html)}catch{e.classList.remove("is-loading"),e.classList.add("is-error")}}),PerformanceObserver&&(PerformanceObserver.supportedEntryTypes||[]).includes("longtask")&&new PerformanceObserver(function(t){const n=t.getEntries().map(({name:r,duration:o})=>({name:r,duration:o,url:window.location.href}));we({longTasks:n})}).observe({entryTypes:["longtask"]});var Hb=Object.defineProperty,Nb=(e,t)=>Hb(e,"name",{value:t,configurable:!0});const of=new WeakMap;function sf(e){return e.closest("markdown-toolbar").field}Nb(sf,"getTextarea"),f("click",".js-markdown-link-button",async function({currentTarget:e}){const n=document.querySelector(".js-markdown-link-dialog").content.cloneNode(!0);if(!(n instanceof DocumentFragment))return;const r=await Le({content:n});e instanceof HTMLElement&&of.set(r,sf(e).selectionEnd)}),f("click",".js-markdown-link-insert",({currentTarget:e})=>{const t=e.closest("details-dialog"),n=document.querySelector(`#${e.getAttribute("data-for-textarea")}`),r=of.get(t)||0,o=t.querySelector("#js-dialog-link-href").value,i=`[${t.querySelector("#js-dialog-link-text").value}](${o}) `,a=n.value.slice(0,r),c=n.value.slice(r);n.value=a+i+c,n.focus(),n.selectionStart=n.selectionEnd=r+i.length}),f("details-menu-select",".js-saved-reply-menu",function(e){if(!(e.target instanceof Element))return;const t=e.detail.relatedTarget.querySelector(".js-saved-reply-body");if(!t)return;const n=(t.textContent||"").trim(),o=e.target.closest(".js-previewable-comment-form").querySelector("textarea.js-comment-field");uo(o,n),setTimeout(()=>o.focus(),0)},{capture:!0}),K("keydown",".js-saved-reply-shortcut-comment-field",function(e){An(e)==="Control+."&&(e.target.closest(".js-previewable-comment-form").querySelector(".js-saved-reply-container").setAttribute("open",""),e.preventDefault())}),K("keydown",".js-saved-reply-filter-input",function(e){if(/^Control\+[1-9]$/.test(An(e))){const n=e.target.closest(".js-saved-reply-container").querySelectorAll('[role="menuitem"]'),r=Number(e.key),o=n[r-1];o instanceof HTMLElement&&(o.click(),e.preventDefault())}});var Bb=Object.defineProperty,gi=(e,t)=>Bb(e,"name",{value:t,configurable:!0});function af(e,t){return e.querySelector(`#LC${t}`)}gi(af,"queryLineElement");function cf(e,t){const n=io(e,r=>af(t,r));if(n){const r=document.createElement("span"),o=["text-bold","hx_keyword-hl","rounded-1","d-inline-block"];r.classList.add(...o),ao(n,r)}}gi(cf,"highlightColumns");function lf(e){const t=parseInt(e.getAttribute("data-start-line")),n=parseInt(e.getAttribute("data-end-line")),r=parseInt(e.getAttribute("data-start-column")),o=parseInt(e.getAttribute("data-end-column"));return t!==n||t===n&&r===o?null:{start:{line:t,column:r},end:{line:n,column:o!==0?o:null}}}gi(lf,"parseColumnHighlightRange"),p(".js-highlight-code-snippet-columns",function(e){const t=lf(e);t!==null&&cf(t,e)}),f("click",".js-segmented-nav-button",function(e){e.preventDefault();const t=e.currentTarget,n=t.getAttribute("data-selected-tab"),r=t.closest(".js-segmented-nav"),o=r.parentElement;for(const s of r.querySelectorAll(".js-segmented-nav-button"))s.classList.remove("selected");t.classList.add("selected");for(const s of o.querySelectorAll(".js-selected-nav-tab"))s.parentElement===o&&s.classList.remove("active");document.querySelector(`.${n}`).classList.add("active")});var Ub=Object.defineProperty,Wb=(e,t)=>Ub(e,"name",{value:t,configurable:!0});function Ce(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}Wb(Ce,"getPageID");const zb=We(function(){Ft(Ce())},50);window.addEventListener("submit",wa,{capture:!0}),window.addEventListener("pageshow",function(){Ft(Ce())}),window.addEventListener("pjax:end",function(){Ft(Ce())}),p(".js-session-resumable",function(){zb()}),window.addEventListener("pagehide",function(){Ot(Ce(),{selector:".js-session-resumable"})}),window.addEventListener("pjax:beforeReplace",function(e){const t=e.detail.previousState,n=t?t.url:null;if(n)Ot(Ce(new URL(n,window.location.origin)),{selector:".js-session-resumable"});else{const r=new Error("pjax:beforeReplace event.detail.previousState.url is undefined");setTimeout(function(){throw r})}}),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 r=(n.getAttribute("data-selected-links")||"").split(" ").indexOf(t)>=0;r?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"),n.classList.toggle("selected",r)}});var Vb=Object.defineProperty,yn=(e,t)=>Vb(e,"name",{value:t,configurable:!0});const bi=["notification_referrer_id","notifications_before","notifications_after","notifications_query"],Er="notification_shelf";function uf(e,t=null){return e.has("notification_referrer_id")?(ff(e,t),mf(e)):null}yn(uf,"storeAndStripShelfParams");function df(e=null){const t=yi(e);if(!t)return go(Er),null;try{const n=tc(Er);if(!n)return null;const r=JSON.parse(n);if(!r||!r.pathname)throw new Error("Must have a pathname");if(r.pathname!==t)throw new Error("Stored pathname does not match current pathname.");const o={};for(const s of bi)o[s]=r[s];return o}catch{return go(Er),null}}yn(df,"getStoredShelfParamsForCurrentPage");function ff(e,t){const n=yi(t);if(!n)return;const r={pathname:n};for(const o of bi){const s=e.get(o);s&&(r[o]=s)}nc(Er,JSON.stringify(r))}yn(ff,"storeShelfParams");function mf(e){for(const t of bi)e.delete(t);return e}yn(mf,"deleteShelfParams");function yi(e){e=e||window.location.pathname;const t=/^(\/[^/]+\/[^/]+\/pull\/[^/]+)/,n=e.match(t);return n?n[0]:null}yn(yi,"getCurrentPullRequestPathname");var Kb=Object.defineProperty,Sr=(e,t)=>Kb(e,"name",{value:t,configurable:!0});async function pf(){return M(".js-notification-shelf .js-notification-action form",async function(e,t){if(e.hasAttribute("data-redirect-to-inbox-on-submit")){await vi(t);const r=document.querySelector(".js-notifications-back-to-inbox");r&&r.click();return}rc(e,e),await vi(t)})}Sr(pf,"remoteShelfActionForm");function hf(){const e=new URLSearchParams(window.location.search),t=uf(e);if(t){const n=new URL(window.location.href,window.location.origin);return n.search=t.toString(),n.toString()}}Sr(hf,"urlWithoutNotificationParameters");function gf(e){if(!(e instanceof Yr))return;const t=df();if(!t)return;const n=e.getAttribute("data-base-src");if(!n)return;const r=new URL(n,window.location.origin),o=new URLSearchParams(r.search);for(const[s,i]of Object.entries(t))typeof i=="string"&&o.set(s,i);r.search=o.toString(),e.setAttribute("src",r.toString())}Sr(gf,"loadShelfFromStoredParams");async function vi(e){try{await e.text()}catch{}}Sr(vi,"performRequest");var Xb=Object.defineProperty,bf=(e,t)=>Xb(e,"name",{value:t,configurable:!0});pf();function yf(){const e=hf();e&&Ke(null,"",e)}bf(yf,"removeNotificationParams"),yf(),p(".js-notification-shelf-include-fragment",gf),f("submit",".js-mark-notification-form",async function(e){const t=e.currentTarget;e.preventDefault();try{await fetch(t.action,{method:t.method,body:new FormData(t),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}catch{}});async function vf(){await zt;const e=document.querySelector(".js-mark-notification-form");e instanceof HTMLFormElement&&V(e)}bf(vf,"markNotificationAsRead"),vf();var Gb=Object.defineProperty,wi=(e,t)=>Gb(e,"name",{value:t,configurable:!0});function wf(e){return!!e.closest(".js-jump-to-field")}wi(wf,"isJumpToAvailable");function kr(e,t){if(wf(e))return;const n=document.querySelector(".js-site-search-form");document.querySelector(".js-site-search").classList.toggle("scoped-search",t);let r,o;t?(r=n.getAttribute("data-scoped-search-url"),o=e.getAttribute("data-scoped-placeholder")):(r=n.getAttribute("data-unscoped-search-url"),o=e.getAttribute("data-unscoped-placeholder")),n.setAttribute("action",r),e.setAttribute("placeholder",o)}wi(kr,"toggleSearchScope"),K("keyup",".js-site-search-field",function(e){const t=e.target,n=t.value.length===0;n&&e.key==="Backspace"&&t.classList.contains("is-clearable")&&kr(t,!1),n&&e.key==="Escape"&&kr(t,!0),t.classList.toggle("is-clearable",n)}),Nt(".js-site-search-focus",function(e){const t=e.closest(".js-chromeless-input-container");t.classList.add("focus");function n(){t.classList.remove("focus"),e.value.length===0&&e.classList.contains("js-site-search-field")&&kr(e,!0),e.removeEventListener("blur",n)}wi(n,"blurHandler"),e.addEventListener("blur",n)}),f("submit",".js-site-search-form",function(e){if(!(e.target instanceof Element))return;const t=e.target.querySelector(".js-site-search-type-field");t.value=new URLSearchParams(window.location.search).get("type")||""}),p("textarea.js-size-to-fit",{constructor:HTMLTextAreaElement,subscribe:La}),f("click",".js-smoothscroll-anchor",function(e){const t=e.currentTarget;if(!(t instanceof HTMLAnchorElement))return;const n=oc(document,t.hash);!n||(n.scrollIntoView({behavior:"smooth"}),e.preventDefault())});var Jb=Object.defineProperty,Qb=(e,t)=>Jb(e,"name",{value:t,configurable:!0});const Yb=1e3,Lf=new WeakMap,jf=document.querySelector("#snippet-clipboard-copy-button");async function Ef(e,t){const n=e.getAttribute("data-snippet-clipboard-copy-content");if(n===null||(e.removeAttribute("data-snippet-clipboard-copy-content"),!(jf instanceof HTMLTemplateElement)))return;const o=jf.content.cloneNode(!0).children[0];if(!(o instanceof HTMLElement))return;const s=o.children[0];if(!(s instanceof HTMLElement))return;s.setAttribute("value",n),document.addEventListener("selectionchange",()=>{const a=document.getSelection();if(a&&e.contains(a.anchorNode)){const c=a==null?void 0:a.toString();s.style.display=c.trim()===""?"inherit":"none"}},{signal:t});const i=e.querySelector("pre");if(i!==null){let a;i.addEventListener("scroll",()=>{a&&clearTimeout(a),s.style.display="none",a=setTimeout(()=>{s.style.display="inherit"},Yb)},{signal:t})}e.appendChild(o)}Qb(Ef,"insertSnippetClipboardCopyButton"),p("[data-snippet-clipboard-copy-content]",{constructor:HTMLElement,add(e){const t=new AbortController;Lf.set(e,t),Ef(e,t.signal)}}),p(".snippet-clipboard-content clipboard-copy",{constructor:HTMLElement,remove(e){const t=Lf.get(e);t&&t.abort()}});var Zb=Object.defineProperty,Sf=(e,t)=>Zb(e,"name",{value:t,configurable:!0});function Li(e,t,n){ji(e,t),n&&e.classList.toggle("on");const r=Array.from(e.querySelectorAll(".js-social-updatable"),On);return Promise.all(r)}Sf(Li,"handleSocialResponse"),M(".js-social-form",async function(e,t){var n,r;let o;const s=e.closest(".js-social-container"),i=e.classList.contains("js-deferred-toggler-target");try{o=await t.json(),s&&await Li(s,o.json.count,i)}catch(a){if(((n=a.response)==null?void 0:n.status)===409&&a.response.json.confirmationDialog){const c=a.response.json.confirmationDialog,l=document.querySelector(c.templateSelector),d=(r=e.querySelector(".js-confirm-csrf-token"))==null?void 0:r.value;if(l instanceof HTMLTemplateElement&&d){const m=new de(l,{confirmUrl:e.action,confirmCsrfToken:d,...c.inputs||{}}),h=await Le({content:m});h.addEventListener("social-confirmation-form:success",async g=>{g instanceof CustomEvent&&s&&await Li(s,g.detail.count,i)}),h.addEventListener("social-confirmation-form:error",()=>{qe()})}}else s&&!i&&s.classList.toggle("on"),qe()}}),M(".js-social-confirmation-form",async function(e,t){try{const n=await t.json();v(e,"social-confirmation-form:success",n.json)}catch{v(e,"social-confirmation-form:error")}});function ji(e,t){for(const n of e.querySelectorAll(".js-social-count")){n.textContent=t;const r=n.getAttribute("data-singular-suffix"),o=n.getAttribute("data-plural-suffix"),s=t==="1"?r:o;s&&n.setAttribute("aria-label",`${t} ${s}`)}}Sf(ji,"updateSocialCounts");var ey=Object.defineProperty,_r=(e,t)=>ey(e,"name",{value:t,configurable:!0});class kf extends ja{constructor(t,n,r,o){super(t,()=>this.getUrlFromRefreshUrl(),r,o);this.refreshUrl=n}getUrlFromRefreshUrl(){return _f(this.refreshUrl)}}_r(kf,"AliveSession");async function _f(e){const t=await Tf(e);return t&&t.url&&t.token?Cf(t.url,t.token):null}_r(_f,"fetchRefreshUrl");async function Tf(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(t.ok)return t.json();if(t.status===404)return null;throw new Error("fetch error")}_r(Tf,"fetchJSON");async function Cf(e,t){const n=await fetch(e,{method:"POST",mode:"same-origin",headers:{"Scoped-CSRF-Token":t}});if(n.ok)return n.text();throw new Error("fetch error")}_r(Cf,"post");var ty=Object.defineProperty,ny=(e,t)=>ty(e,"name",{value:t,configurable:!0});const Tr=[],ry=3e4,oy=0;let Cr=document.hidden,xr;function xf(e){return e(Cr),Tr.push(e),new sc(()=>{const t=Tr.indexOf(e);t!==-1&&Tr.splice(t,1)})}ny(xf,"addIdleStateListener"),(()=>{document.addEventListener("visibilitychange",()=>{const e=document.hidden;xr!==void 0&&clearTimeout(xr),xr=setTimeout(()=>{if(e!==Cr){Cr=e,xr=void 0;for(const n of Tr)n(Cr)}},e?ry:oy)})})();var sy=Object.defineProperty,ne=(e,t)=>sy(e,"name",{value:t,configurable:!0});function Af(){return"SharedWorker"in window&&ic("localStorage").getItem("bypassSharedWorker")!=="true"}ne(Af,"isSharedWorkerSupported");function Pf(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket-src]"))==null?void 0:e.href)!=null?t:null}ne(Pf,"workerSrc");function Mf(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket]"))==null?void 0:e.href)!=null?t:null}ne(Mf,"socketUrl");function qf(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket]"))==null?void 0:e.getAttribute("data-refresh-url"))!=null?t:null}ne(qf,"socketRefreshUrl");function $f(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket]"))==null?void 0:e.getAttribute("data-session-id"))!=null?t:null}ne($f,"sessionIdentifier");function If(e){return Ei(e).map(t=>({subscriber:e,topic:t}))}ne(If,"subscriptions");function Ei(e){return(e.getAttribute("data-channel")||"").trim().split(/\s+/).map(Ea.parse).filter(Ff)}ne(Ei,"channels");function Ff(e){return e!=null}ne(Ff,"isPresent");function Si(e,{channel:t,type:n,data:r}){for(const o of e)o.dispatchEvent(new CustomEvent(`socket:${n}`,{bubbles:!1,cancelable:!1,detail:{name:t,data:r}}))}ne(Si,"notify");class Of{constructor(t,n,r,o,s){this.subscriptions=new Sa,this.presenceMetadata=new ka,this.notifyPresenceDebouncedByChannel=new Map,this.notify=s,this.worker=new SharedWorker(t,`github-socket-worker-v2-${o}`),this.worker.port.onmessage=({data:i})=>this.receive(i),this.worker.port.postMessage({connect:{url:n,refreshUrl:r}})}subscribe(t){const n=this.subscriptions.add(...t);n.length&&this.worker.port.postMessage({subscribe:n});const r=new Set(n.map(s=>s.name)),o=t.reduce((s,i)=>{const a=i.topic.name;return ro(a)&&!r.has(a)&&s.add(a),s},new Set);o.size&&this.worker.port.postMessage({requestPresence:Array.from(o)})}unsubscribeAll(...t){const n=this.subscriptions.drain(...t);n.length&&this.worker.port.postMessage({unsubscribe:n});const r=this.presenceMetadata.removeSubscribers(t);this.sendPresenceMetadataUpdate(r)}updatePresenceMetadata(t){const n=new Set;for(const r of t)this.presenceMetadata.setMetadata(r),n.add(r.channelName);this.sendPresenceMetadataUpdate(n)}sendPresenceMetadataUpdate(t){if(!t.size)return;const n=[];for(const r of t)n.push({channelName:r,metadata:this.presenceMetadata.getChannelMetadata(r)});this.worker.port.postMessage({updatePresenceMetadata:n})}online(){this.worker.port.postMessage({online:!0})}offline(){this.worker.port.postMessage({online:!1})}hangup(){this.worker.port.postMessage({hangup:!0})}receive(t){const{channel:n}=t;if(t.type==="presence"){let r=this.notifyPresenceDebouncedByChannel.get(n);r||(r=We((o,s)=>{this.notify(o,s),this.notifyPresenceDebouncedByChannel.delete(n)},100),this.notifyPresenceDebouncedByChannel.set(n,r)),r(this.subscriptions.subscribers(n),t);return}this.notify(this.subscriptions.subscribers(n),t)}}ne(Of,"AliveSessionProxy");function Rf(){const e=Pf();if(!e)return;const t=Mf();if(!t)return;const n=qf();if(!n)return;const r=$f();if(!r)return;const s=ne(()=>{if(Af())try{return new Of(e,t,n,r,Si)}catch{}return new kf(t,n,!1,Si)},"createSession")(),i=Rn(l=>s.subscribe(l.flat())),a=Rn(l=>s.unsubscribeAll(...l)),c=Rn(l=>s.updatePresenceMetadata(l));p(".js-socket-channel[data-channel]",{subscribe:l=>{const d=If(l),m=d.map(g=>g.topic.name).filter(g=>ro(g));let h={unsubscribe(){}};if(m.length){let g,w;const L=ne(()=>{const x=[];g&&x.push(g),w!==void 0&&x.push({[_a]:w?1:0});for(const j of m)c({subscriber:l,channelName:j,metadata:x})},"queueMetadataOrIdleChange");h=ie(E(l,"socket:set-presence-metadata",x=>{const{detail:j}=x;g=j,L()}),xf(x=>{!ac("PRESENCE_IDLE")||(w=x,L())}))}return i(d),h},remove:l=>a(l)}),window.addEventListener("online",()=>s.online()),window.addEventListener("offline",()=>s.offline()),window.addEventListener("unload",()=>{"hangup"in s&&s.hangup()})}ne(Rf,"connect"),(async()=>{await Xt,Rf()})();var iy=Object.defineProperty,ki=(e,t)=>iy(e,"name",{value:t,configurable:!0});const Df=new Map;function Hf(e,t){const n=[];for(const r of e){const o=Df.get(r.name);o&&o.arrived>t&&n.push(o)}return n}ki(Hf,"stale");function Nf(e,t){for(const n of e.querySelectorAll(".js-socket-channel[data-channel]"))for(const r of Hf(Ei(n),t))n.dispatchEvent(new CustomEvent("socket:message",{bubbles:!1,cancelable:!1,detail:{name:r.name,data:r.data,cached:!0}}))}ki(Nf,"dispatch");function Bf(e){const{name:t,data:n,cached:r}=e.detail;if(r)return;const o={name:t,data:{...n},arrived:Date.now()};o.data.wait=0,Df.set(t,o)}ki(Bf,"store"),document.addEventListener("socket:message",Bf,{capture:!0}),document.addEventListener("pjax:popstate",function(e){const t=e.target,n=e.detail.cachedAt;n&&setTimeout(()=>Nf(t,n))}),p("form.js-auto-replay-enforced-sso-request",{constructor:HTMLFormElement,initialize(e){V(e)}});var ay=Object.defineProperty,cy=(e,t)=>ay(e,"name",{value:t,configurable:!0});function _i(e){const t=document.querySelector(".js-stale-session-flash"),n=t.querySelector(".js-stale-session-flash-signed-in"),r=t.querySelector(".js-stale-session-flash-signed-out");t.hidden=!1,n.hidden=e==="false",r.hidden=e==="true",window.addEventListener("popstate",function(o){o.state&&o.state.container!=null&&location.reload()}),document.addEventListener("submit",function(o){o.preventDefault()})}cy(_i,"sessionChanged");let vn;if(typeof BroadcastChannel=="function")try{vn=new BroadcastChannel("stale-session"),vn.onmessage=e=>{typeof e.data=="string"&&_i(e.data)}}catch{}if(!vn){let e=!1;vn={postMessage(t){e=!0;try{window.localStorage.setItem("logged-in",t)}finally{e=!1}}},window.addEventListener("storage",function(t){if(!e&&t.storageArea===window.localStorage&&t.key==="logged-in")try{(t.newValue==="true"||t.newValue==="false")&&_i(t.newValue)}finally{window.localStorage.removeItem(t.key)}})}const Uf=document.querySelector(".js-stale-session-flash[data-signedin]");if(Uf){const e=Uf.getAttribute("data-signedin")||"";vn.postMessage(e)}var ly=Object.defineProperty,kt=(e,t)=>ly(e,"name",{value:t,configurable:!0});function Ti(e,t,n){const r=e.getBoundingClientRect().height,o=t.getBoundingClientRect(),s=n.getBoundingClientRect();let i=s.top;i+o.height+10>=r&&(i=Math.max(r-o.height-10,0));let a=s.right;n.closest(".js-build-status-to-the-left")!=null&&(a=Math.max(s.left-o.width-10,0)),t.style.top=`${i}px`,t.style.left=`${a}px`,t.style.right="auto"}kt(Ti,"updateStatusPosition"),f("toggle",".js-build-status .js-dropdown-details",function(e){const t=e.currentTarget,n=t.querySelector(".js-status-dropdown-menu");if(!n)return;function r(){t.hasAttribute("open")||s()}kt(r,"closeOnToggle");function o(i){n.contains(i.target)||s()}kt(o,"closeOnScroll");function s(){t.removeAttribute("open"),n.classList.add("d-none"),t.appendChild(n),t.removeEventListener("toggle",r),window.removeEventListener("scroll",o)}kt(s,"closeStatusPopover"),t.addEventListener("toggle",r),n.classList.contains("js-close-menu-on-scroll")&&window.addEventListener("scroll",o,{capture:!0}),n.classList.remove("d-none"),n.querySelector(".js-details-container").classList.add("open"),n.classList.contains("js-append-menu-to-body")&&(document.body.appendChild(n),Ti(document.body,n,t))},{capture:!0});async function Ci(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 r=n.querySelector(".js-status-loader");if(!r)return;const o=n.querySelector(".js-status-loading"),s=n.querySelector(".js-status-error"),i=r.getAttribute("data-contents-url");o.classList.remove("d-none"),s.classList.add("d-none");let a;try{await Fn(),a=await U(document,i)}catch{o.classList.add("d-none"),s.classList.remove("d-none")}a&&(r.replaceWith(a),n.querySelector(".js-details-container").classList.add("open"),t&&n.classList.contains("js-append-menu-to-body")&&Ti(document.body,n,t))}kt(Ci,"loadStatus"),f("click",".js-status-retry",({currentTarget:e})=>{Ci(e)});function xi(e){const t=e.currentTarget;Ci(t)}kt(xi,"onMouseEnter"),p(".js-build-status",{add(e){e.addEventListener("mouseenter",xi,{once:!0})},remove(e){e.removeEventListener("mouseenter",xi)}});var uy=Object.defineProperty,dy=(e,t)=>uy(e,"name",{value:t,configurable:!0});f("click","button[data-sudo-required], summary[data-sudo-required]",Ai),p("form[data-sudo-required]",{constructor:HTMLFormElement,subscribe:e=>E(e,"submit",Ai)});async function Ai(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;e.stopPropagation(),e.preventDefault(),await cc()&&(t.removeAttribute("data-sudo-required"),t instanceof HTMLFormElement?V(t):t.click())}dy(Ai,"checkSudo");var fy=Object.defineProperty,Ne=(e,t)=>fy(e,"name",{value:t,configurable:!0});const Wf={"actor:":"ul.js-user-suggestions","user:":"ul.js-user-suggestions","operation:":"ul.js-operation-suggestions","org:":"ul.js-org-suggestions","action:":"ul.js-action-suggestions","repo:":"ul.js-repo-suggestions","country:":"ul.js-country-suggestions"};p("text-expander[data-audit-url]",{subscribe:e=>ie(E(e,"text-expander-change",Vf),E(e,"text-expander-value",zf))});function zf(e){const t=e.detail;if(!Pi(t.key))return;const n=t.item.getAttribute("data-value");t.value=`${t.key}${n}`}Ne(zf,"onvalue");function Vf(e){const{key:t,provide:n,text:r}=e.detail;if(!Pi(t))return;const s=e.target.getAttribute("data-audit-url");n(Xf(s,t,r))}Ne(Vf,"onchange");function Kf(e,t){const n=t.toLowerCase();return n?Ge(e,Ne(o=>{const s=o.textContent.toLowerCase().trim(),i=Kt(s,n);return i>0?{score:i,text:s}:null},"key"),Je):e}Ne(Kf,"search");const my=pe(e=>[...e.children],{hash:e=>e.className});async function Xf(e,t,n){const o=(await py(e)).querySelector(Gf(t));if(!o)return{matched:!1};const s=Kf(my(o),n).slice(0,5),i=o.cloneNode(!1);i.innerHTML="";for(const a of s)i.append(a);return{fragment:i,matched:s.length>0}}Ne(Xf,"auditMenu");function Pi(e){return Object.getOwnPropertyNames(Wf).includes(e)}Ne(Pi,"isActivationKey");function Gf(e){const t=Wf[e];if(!t)throw new Error(`Unknown audit log expander key: ${e}`);return t}Ne(Gf,"selector");async function Jf(e){const t=await U(document,e),n=document.createElement("div");return n.append(t),n}Ne(Jf,"fetchMenu");const py=pe(Jf);var hy=Object.defineProperty,xe=(e,t)=>hy(e,"name",{value:t,configurable:!0});function Qf(e){if(e.hasAttribute("data-use-colon-emoji"))return e.getAttribute("data-value");const t=e.firstElementChild;return t&&t.tagName==="G-EMOJI"&&!t.firstElementChild?t.textContent:e.getAttribute("data-value")}xe(Qf,"getValue");function Yf(e,t){const n=` ${t.toLowerCase().replace(/_/g," ")}`;return Ge(e,xe(o=>{const s=o.getAttribute("data-emoji-name"),i=em(Zf(o),n);return i>0?{score:i,text:s}:null},"key"),Je)}xe(Yf,"search");function Zf(e){return` ${e.getAttribute("data-text").trim().toLowerCase().replace(/_/g," ")}`}xe(Zf,"emojiText");function em(e,t){const n=e.indexOf(t);return n>-1?1e3-n:0}xe(em,"emojiScore"),p("text-expander[data-emoji-url]",{subscribe:e=>ie(E(e,"text-expander-change",nm),E(e,"text-expander-value",tm))});function tm(e){const t=e.detail;t.key===":"&&(t.value=Qf(t.item))}xe(tm,"onvalue");function nm(e){const{key:t,provide:n,text:r}=e.detail;if(t!==":")return;const s=e.target.getAttribute("data-emoji-url");n(rm(s,r))}xe(nm,"onchange");async function rm(e,t){const[n,r]=await gy(e),o=Yf(r,t).slice(0,5);n.innerHTML="";for(const s of o)n.append(s);return{fragment:n,matched:o.length>0}}xe(rm,"emojiMenu");async function om(e){const n=(await U(document,e)).firstElementChild;return[n,[...n.children]]}xe(om,"fetchEmoji");const gy=pe(om);var by=Object.defineProperty,Z=(e,t)=>by(e,"name",{value:t,configurable:!0});function sm(e){return`${e.number} ${e.title.trim().toLowerCase()}`}Z(sm,"asText");function im(e,t){if(!t)return e;const n=new RegExp(`\\b${am(t)}`),r=/^\d+$/.test(t)?s=>cm(s,n):s=>Kt(s,t);return Ge(e,Z(s=>{const i=sm(s),a=r(i);return a>0?{score:a,text:i}:null},"key"),Je)}Z(im,"search");function am(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}Z(am,"escapeRegExp");function cm(e,t){const n=e.search(t);return n>-1?1e3-n:0}Z(cm,"issueNumberScore");function lm(e,t,n){const r=Z(s=>Rt`
|
|
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
|
|
${s.map(o)}
|
|
</ul>
|
|
`,"itemsTemplate"),o=Z(s=>{const i=s.type in n?fe(document,n[s.type]):"";return Rt`
|
|
<li class="markdown-title" role="option" id="suggester-issue-${s.id}" data-value="${s.number}">
|
|
<span class="d-inline-block mr-1">${i}</span>
|
|
<small>#${s.number}</small> ${Ta(s.title)}
|
|
</li>
|
|
`},"itemTemplate");oo(r(e),t)}Z(lm,"renderResults"),p("text-expander[data-issue-url]",{subscribe:e=>{const t=[E(e,"text-expander-change",dm),E(e,"text-expander-value",um),E(e,"keydown",mm),E(e,"click",fm)];return ie(...t)}});function um(e){const t=e.detail;if(t.key!=="#")return;const n=t.item.getAttribute("data-value");t.value=`#${n}`}Z(um,"onvalue");function dm(e){const{key:t,provide:n,text:r}=e.detail;if(t!=="#")return;if(r==="#"){Ar(e.target);return}const s=e.target.getAttribute("data-issue-url");n(pm(s,r))}Z(dm,"onchange");function Ar(e){if(!e)return;const t=e.closest("text-expander");t&&t.dismiss()}Z(Ar,"hideSuggestions");function fm(e){Ar(e.target)}Z(fm,"onclick");function mm(e){const t=["ArrowRight","ArrowLeft"],{key:n}=e;t.indexOf(n)<0||Ar(e.target)}Z(mm,"onkeydown");async function pm(e,t){const n=await yy(e),r=document.createElement("div"),o=im(n.suggestions,t).slice(0,5);return lm(o,r,n.icons),{fragment:r.firstElementChild,matched:o.length>0}}Z(pm,"issueMenu");const yy=pe(async function(e){const t=await self.fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!t.ok){const n=new Error,r=t.statusText?` ${t.statusText}`:"";throw n.message=`HTTP ${t.status}${r}`,n}return t.json()});var vy=Object.defineProperty,re=(e,t)=>vy(e,"name",{value:t,configurable:!0});function hm(e){return e.description?`${e.name} ${e.description}`.trim().toLowerCase():`${e.login} ${e.name}`.trim().toLowerCase()}re(hm,"asText");function gm(e,t){if(!t)return e;const n=ym(t);return Ge(e,re(o=>{const s=hm(o),i=n(s,o.participant);return i>0?{score:i,text:s}:null},"key"),Je)}re(gm,"search");function bm(e,t){const n=re(o=>Rt`
|
|
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
|
|
${o.map(r)}
|
|
</ul>
|
|
`,"itemsTemplate"),r=re(o=>{const s=o.type==="user"?o.login:o.name,i=o.type==="user"?o.name:o.description;return Rt`
|
|
<li role="option" id="suggester-${o.id}-${o.type}-${s}" data-value="${s}">
|
|
<span>${s}</span>
|
|
<small>${i}</small>
|
|
</li>
|
|
`},"itemTemplate");oo(n(e),t)}re(bm,"renderResults");function ym(e){if(!e)return()=>2;const t=e.toLowerCase().split("");return(n,r)=>{if(!n)return 0;const o=vm(n,t);if(!o)return 0;const i=e.length/o[1]/(o[0]/2+1);return r?i+1:i}}re(ym,"fuzzyScorer");function vm(e,t){let n,r,o,s;const i=wm(e,t[0]);if(i.length===0)return null;if(t.length===1)return[i[0],1,[]];for(s=null,r=0,o=i.length;r<o;r++){const a=i[r];if(!(n=Lm(e,t,a+1)))continue;const c=n[n.length-1]-a;(!s||c<s[1])&&(s=[a,c,n])}return s}re(vm,"shortestMatch");function wm(e,t){let n=0;const r=[];for(;(n=e.indexOf(t,n))>-1;)r.push(n++);return r}re(wm,"allIndexesOf");function Lm(e,t,n){let r=n;const o=[];for(let s=1;s<t.length;s+=1){if(r=e.indexOf(t[s],r),r===-1)return;o.push(r++)}return o}re(Lm,"indexesOfChars"),p("text-expander[data-mention-url]",{subscribe:e=>ie(E(e,"text-expander-change",Em),E(e,"text-expander-value",jm))});function jm(e){const t=e.detail;if(t.key!=="@")return;const n=t.item.getAttribute("data-value");t.value=`@${n}`}re(jm,"onvalue");function Em(e){const{key:t,provide:n,text:r}=e.detail;if(t!=="@"||(r==null?void 0:r.split(" ").length)>1)return;const s=e.target.getAttribute("data-mention-url");n(Sm(s,r))}re(Em,"onchange");async function Sm(e,t){const n=await wy(e),r=document.createElement("div"),o=gm(n,t).slice(0,5);return bm(o,r),{fragment:r.firstElementChild,matched:o.length>0}}re(Sm,"mentionMenu");const wy=pe(async function(e){const t=await self.fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!t.ok){const n=new Error,r=t.statusText?` ${t.statusText}`:"";throw n.message=`HTTP ${t.status}${r}`,n}return t.json()});var Ly=Object.defineProperty,$=(e,t)=>Ly(e,"name",{value:t,configurable:!0});const Mi="/";function km(e,t){const n=t.toLowerCase().trim(),r=$(o=>{const s=(o.getAttribute("data-text")||"").trim().toLowerCase(),i=Kt(s,n);return i>0?{score:i,text:s}:null},"key");return n?Ge(e,r,Je):e}$(km,"search"),p("slash-command-expander[data-slash-command-url]",{subscribe:e=>ie(E(e,"text-expander-change",qm),E(e,"text-expander-value",_m))}),f("click",".js-slash-command-toolbar-button",async e=>{if(!(e.target instanceof Element))return;const t=e.target.closest(".js-previewable-comment-form");if(!t)return;const n=t.querySelector("textarea.js-comment-field");if(!n)return;const r=Mi,o=n.selectionEnd||0,s=n.value.substring(0,o),i=n.value.substring(o),a=n.value===""||s.match(/\s$/)?"":" ",c=o+r.length+1;n.value=s+a+r+i,n.selectionStart=c,n.selectionEnd=c,n.focus(),v(n,"input")});async function _m(e){const t=e.detail,{key:n,item:r}=t;if(n!==Mi)return;const o=r.getAttribute("data-url");if(!o)return;const s=e.currentTarget,i=r.querySelector(".js-slash-command-suggestion-form");if(!i)return;const a=i.querySelector(".js-data-url-csrf");if(!a)return;const c=new FormData(i);s.isLoading();try{const l=await U(document,o,{method:"PATCH",body:c,headers:{Accept:"text/html","Scoped-CSRF-Token":a.value}});if(!l)return;qi(s,l)}catch{s.showError()}}$(_m,"onValue");function qi(e,t){var n;const r=t.firstElementChild;if(!r)return;t.children.length>1&&Mm(t.lastElementChild,e),r.hasAttribute("data-reload-suggestions")&&(Im=pe(Ii));const o=r.getAttribute("data-component-type");o==="fill"?/<\/?[a-z][\s\S]*>/i.test(r.innerHTML)?e.setValue(r.innerHTML.trim()):e.setValue(((n=r.textContent)==null?void 0:n.trim())||""):o==="menu"||o==="error"?e.setMenu(r.querySelector(".js-slash-command-menu")):o==="action"?e.closeMenu():o==="embedded_form"?Pm(e,r):o==="dialog_form"?xm(e,r):o==="modal_form"&&Am(e,r),Ft(Ce())}$(qi,"handleResponse");function Tm(e){if(!(e.metaKey&&e.key==="Enter"))return;e.preventDefault(),e.stopPropagation();const t=e.target,n=t==null?void 0:t.form;if(!!n)if(n.requestSubmit)n.requestSubmit();else{const r=n.querySelector("[type='submit']");r==null||r.click()}}$(Tm,"submitOnCommandEnter");function $i(e){const t=new FormData(e);let n="";for(const r of t)n=n+r[0],n=n+r[1].toString();return n}$($i,"getFormContents");function Pr(e){let t=!1;for(const n of e.querySelectorAll("select,input,textarea")){const r=n;r.type!=="hidden"&&(t||(r.focus(),t=!0),r.addEventListener("keydown",Tm))}}$(Pr,"focusFirstFormInput");function Mr(e,t){const n=e.querySelectorAll("[data-close-dialog]");for(const r of n)r.addEventListener("click",o=>{o.preventDefault(),Ot(Ce(),{selector:".js-session-resumable"}),t()})}$(Mr,"hookUpCancelActionListeners");function qr(e,t,n,r){const o=$i(e);t.addEventListener("keydown",s=>{if(s.key==="Escape"){const i="Are you sure you want to dismiss the form?",a=$i(e);(o===a||confirm(i))&&(Ot(Ce(),{selector:".js-session-resumable"}),r(),n&&n.focus())}})}$(qr,"addDismissAlertListener");function $r(e,t,n){e.addEventListener("submit",async r=>{r.preventDefault();const o=r.target,s=o.querySelector(".js-data-url-csrf");if(!s)return;const i=o.getAttribute("action");if(!i)return;Cm(t);const a=new FormData(o),c=await U(document,i,{method:"PATCH",body:a,headers:{Accept:"text/html","Scoped-CSRF-Token":s.value}});n(),!!c&&qi(t,c)})}$($r,"addSubmitButtonListener");function Cm(e){const t=e.closest(".js-slash-command-surface"),n=e.closest("form"),r=t||n;if(r)for(const o of r.querySelectorAll("[data-disable-with][disabled]"))o.disabled=!1}$(Cm,"reenableParentFormButtons");function xm(e,t){const n=t.querySelector(".js-slash-command-menu");e.setMenu(n,!0);const r=n.querySelector("form"),o=document.activeElement;Pr(r);const s=$(()=>{e.closeMenu()},"closeForm");qr(r,r,o,s),Mr(r,s),$r(r,e,s)}$(xm,"handleDialogForm");function Am(e,t){const n=e.closest("form");if(!n)return;const r=t.querySelector('[data-component="form"]');n.insertAdjacentElement("afterend",r);const o=document.activeElement;Pr(r);const s=$(()=>{n.hidden=!1,r.remove()},"closeForm");Mr(r,s);const i=r.getElementsByTagName("form")[0];qr(i,r,o,s),$r(r,e,s)}$(Am,"handleModalForm");function Pm(e,t){const n=e.closest(".js-slash-command-surface"),r=e.closest("form"),o=n||r;if(!o)return;o.hidden=!0;const s=t.querySelector('[data-component="form"]');o.insertAdjacentElement("afterend",s);const i=document.activeElement;Pr(s);const a=$(()=>{o.hidden=!1,s.remove()},"closeForm");Mr(s,a);const c=s.getElementsByTagName("form")[0];qr(c,s,i,a),$r(s,e,a)}$(Pm,"handleEmbeddedForm");const jy=5e3;function Mm(e,t){var n,r;const o=(n=t.parentElement)==null?void 0:n.parentElement;if(!o)return;const s=o.querySelector(".drag-and-drop .default");let i=!1;s&&(i=s.hidden,s.hidden=!0),(r=s==null?void 0:s.parentElement)==null||r.prepend(e),setTimeout(()=>{s&&(s.hidden=i),e.remove()},jy)}$(Mm,"showFooter");function qm(e){const{key:t,provide:n,text:r}=e.detail;if(t!==Mi)return;const o=e.target;o.isLoading();const s=o.getAttribute("data-slash-command-url");n($m(s,r,o))}$(qm,"onChange");async function $m(e,t,n){try{const[r,o]=await Im(e),s=r.querySelector(".js-slash-command-menu-items"),i=km(o,t);if(s){s.innerHTML="";for(const a of o)if(a.classList.contains("js-group-divider")){const c=a.getAttribute("data-group-id");i.filter(d=>d.getAttribute("data-group-id")===c).length>0&&s.append(a)}else i.includes(a)&&s.append(a)}return{fragment:r,matched:i.length>0}}catch(r){throw n.showError(),new Error(r)}}$($m,"slashCommandMenu");async function Ii(e){const n=(await U(document,e)).firstElementChild,r=n.querySelectorAll(".js-slash-command-menu-items li");return[n,[...r]]}$(Ii,"fetchSlashCommands");let Im=pe(Ii);var Ey=Object.defineProperty,Sy=(e,t)=>Ey(e,"name",{value:t,configurable:!0});function Fm(e,t){const n=e.closest(".js-survey-question-form"),r=n.querySelector("input.js-survey-other-text"),o=t&&!n.classList.contains("is-other-selected");n.classList.toggle("is-other-selected",o),r.hidden=!t,o?(r.required=!0,r.focus()):r.required=!1,v(r,"change")}Sy(Fm,"handleOther"),f("change","input.js-survey-radio",function({currentTarget:e}){Fm(e,e.classList.contains("js-survey-radio-other"))}),f("change","input.js-survey-checkbox-enable-submit",function({currentTarget:e}){var t;const n=e.checked,r=(t=e.closest("form"))==null?void 0:t.querySelector("button[type=submit]");r.disabled=!n}),f("change","input.js-survey-contact-checkbox",function(e){const t=e.currentTarget,r=t.closest(".js-survey-question-form").querySelector(".js-survey-contact-checkbox-hidden");t.checked?r.setAttribute("disabled","true"):r.removeAttribute("disabled")}),f("details-menu-selected",".js-sync-select-menu-icon",function(e){const t=document.querySelector(".js-sync-select-menu-icon-completed"),n=document.querySelector(".js-sync-select-menu-icon-canceled"),r=e.detail.relatedTarget.querySelector('input[name="state_reason"]').value;r==="completed"?(t.style.display="inline-block",n.style.display="none"):r==="canceled"&&(t.style.display="none",n.style.display="inline-block")},{capture:!0}),f("details-menu-selected",".js-sync-select-menu-text",function(e){const t=document.querySelector(".js-sync-select-menu-button"),n=e.detail.relatedTarget.querySelector("span[data-menu-button-text]").textContent;t.textContent=n,t.focus()},{capture:!0}),f("click",'tab-container [role="tab"]',function(e){const{currentTarget:t}=e,r=t.closest("tab-container").querySelector(".js-filterable-field, [data-filter-placeholder-input]");if(r instanceof HTMLInputElement){const o=t.getAttribute("data-filter-placeholder");o&&r.setAttribute("placeholder",o),r.focus()}}),f("tab-container-changed","tab-container",function(e){const t=e.detail.relatedTarget,n=t.getAttribute("data-fragment-url"),r=t.querySelector("include-fragment");n&&r&&!r.hasAttribute("src")&&(r.src=n)}),document.addEventListener("keydown",e=>{if(e.key!=="Escape"||e.target!==document.body)return;const t=document.querySelector(".js-targetable-element:target");!t||bo(t,()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)})}),document.addEventListener("click",e=>{const t=document.querySelector(".js-targetable-element:target");!t||e.target instanceof HTMLAnchorElement||e.target instanceof HTMLElement&&(t.contains(e.target)||bo(t,()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)}))});var ky=Object.defineProperty,Ir=(e,t)=>ky(e,"name",{value:t,configurable:!0});async function Om(e){const t=e.currentTarget;if(Dm(t)){t.classList.remove("tooltipped");return}const n=t.getAttribute("data-url");if(!n)return;const r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)return;const o=await r.json(),s=t.getAttribute("data-id"),i=document.querySelectorAll(`.js-team-mention[data-id='${s}']`);for(const a of i)a.removeAttribute("data-url");try{o.total===0?o.members.push("This team has no members"):o.total>o.members.length&&o.members.push(`${o.total-o.members.length} more`),Fi(i,Rm(o.members))}catch(a){const c=a.response?a.response.status:500,l=t.getAttribute(c===404?"data-permission-text":"data-error-text");Fi(i,l)}}Ir(Om,"members");function Fi(e,t){for(const n of e)n instanceof HTMLElement&&(n.setAttribute("aria-label",t),n.classList.add("tooltipped","tooltipped-s","tooltipped-multiline"))}Ir(Fi,"tip");function Rm(e){if("ListFormat"in Intl)return new Intl.ListFormat().format(e);if(e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return e.join(" and ");{const t=e[e.length-1];return e.slice(0,-1).concat(`and ${t}`).join(", ")}}Ir(Rm,"sentence");function Dm(e){return!!e.getAttribute("data-hovercard-url")&&!!e.closest("[data-team-hovercards-enabled]")}Ir(Dm,"teamHovercardEnabled"),p(".js-team-mention",function(e){e.addEventListener("mouseenter",Om)});var Hm=Object.defineProperty,_y=Object.getOwnPropertyDescriptor,Ty=(e,t)=>Hm(e,"name",{value:t,configurable:!0}),Fr=(e,t,n,r)=>{for(var o=r>1?void 0:r?_y(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Hm(t,n,o),o};let _t=class extends HTMLElement{acceptSuggestion(){var e;((e=this.suggestion)==null?void 0:e.textContent)&&(this.input.value=this.suggestion.textContent,this.input.dispatchEvent(new Event("input")),this.suggestionContainer&&(this.suggestionContainer.hidden=!0),this.input.focus())}};Ty(_t,"TextSuggesterElement"),Fr([y],_t.prototype,"input",2),Fr([y],_t.prototype,"suggestionContainer",2),Fr([y],_t.prototype,"suggestion",2),_t=Fr([I],_t);var Cy=Object.defineProperty,Or=(e,t)=>Cy(e,"name",{value:t,configurable:!0});function Nm(){const e=document.querySelector(".js-timeline-marker");return e!=null?e.getAttribute("data-last-modified"):null}Or(Nm,"getTimelineLastModified");function Oi(e){if(Um(e)||Bm(e))return;const t=Nm();t&&e.headers.set("X-Timeline-Last-Modified",t)}Or(Oi,"addTimelineLastModifiedHeader");function Bm(e){return e.headers.get("X-PJAX")==="true"}Or(Bm,"isPjax");function Um(e){let t;try{t=new URL(e.url)}catch{return!0}return t.host!==window.location.host}Or(Um,"isCrossDomain"),M(".js-needs-timeline-marker-header",function(e,t,n){Oi(n)}),f("deprecatedAjaxSend","[data-remote]",function(e){const{request:t}=e.detail;Oi(t)});var xy=Object.defineProperty,Ae=(e,t)=>xy(e,"name",{value:t,configurable:!0});const Wm=5e3,Ay=".js-comment-body img",Py=".js-comment-body video";Wt(function({target:e}){const t=Dr();if(t&&!e){const n=document.querySelector("#js-timeline-progressive-loader");n&&Ri(t,n)}}),p(".js-timeline-progressive-focus-container",function(e){const t=Dr();if(!t)return;const n=document.getElementById(t);n&&e.contains(n)&&Rr(n)}),p("#js-discussions-timeline-anchor-loader",{constructor:HTMLElement,add:e=>{if(document.querySelector("#js-timeline-progressive-loader"))return;const n=Dr();if(!n)return;document.getElementById(n)||Ri(n,e)}});async function zm(){const e=document.querySelectorAll(Py),t=Array.from(e).map(n=>new Promise(r=>{if(n.readyState>=n.HAVE_METADATA)r(n);else{const o=setTimeout(()=>r(n),Wm),s=Ae(()=>{clearTimeout(o),r(n)},"done");n.addEventListener("loadeddata",()=>{n.readyState>=n.HAVE_METADATA&&s()}),n.addEventListener("error",()=>s())}}));return Promise.all(t)}Ae(zm,"videosReady");async function Vm(){const e=document.querySelectorAll(Ay),t=Array.from(e).map(n=>{new Promise(r=>{if(n.complete)r(n);else{const o=setTimeout(()=>r(n),Wm),s=Ae(()=>{clearTimeout(o),r(n)},"done");n.addEventListener("load",()=>s()),n.addEventListener("error",()=>s())}})});return Promise.all(t)}Ae(Vm,"imagesReady");async function Km(){return Promise.all([zm(),Vm()])}Ae(Km,"mediaLoaded");async function Rr(e){await Km(),Xm(e);const t=e.querySelector(`[href='#${e.id}']`);t&&t.click()}Ae(Rr,"focusElement");async function Ri(e,t){if(!t)return;const n=t.getAttribute("data-timeline-item-src");if(!n)return;const r=new URL(n,window.location.origin),o=new URLSearchParams(r.search.slice(1));o.append("anchor",e),r.search=o.toString();let s;try{s=await U(document,r.toString())}catch{return}const i=s.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 l=document.getElementById(e);l&&await Rr(l)}else{const l=document.getElementById("js-progressive-timeline-item-container");l&&l.replaceWith(s);const d=document.getElementById(e);d&&await Rr(d)}}Ae(Ri,"loadElement");function Xm(e){const t=e.closest("details, .js-details-container");!t||(t.nodeName==="DETAILS"?t.setAttribute("open","open"):lc(t)||yo(t))}Ae(Xm,"expandDetailsIfPresent");function Dr(){return window.location.hash.slice(1)}Ae(Dr,"urlAnchor");var My=Object.defineProperty,Gm=(e,t)=>My(e,"name",{value:t,configurable:!0});p(".js-discussion",Jm);function Jm(){let e=new WeakSet;t(),document.addEventListener("pjax:end",t),p(".js-timeline-item",n=>{n instanceof HTMLElement&&(e.has(n)||Ve(n))});function t(){e=new WeakSet(document.querySelectorAll(".js-timeline-item"))}Gm(t,"setExistingTimelineItems")}Gm(Jm,"announceTimelineEvents");var qy=Object.defineProperty,Hr=(e,t)=>qy(e,"name",{value:t,configurable:!0});function Tt(e){const{name:t,value:n}=e,r={name:window.location.href};switch(t){case"CLS":r.cls=n;break;case"FCP":r.fcp=n;break;case"FID":r.fid=n;break;case"LCP":r.lcp=n;break;case"TTFB":r.ttfb=n;break}we({webVitalTimings:[r]}),Qm(t,n)}Hr(Tt,"sendVitals");function Qm(e,t){const n=document.querySelector("#staff-bar-web-vitals"),r=n==null?void 0:n.querySelector(`[data-metric=${e.toLowerCase()}]`);!r||(r.textContent=t.toPrecision(6))}Hr(Qm,"updateStaffBar");function Ym(){return!!(window.performance&&window.performance.timing&&window.performance.getEntriesByType)}Hr(Ym,"isTimingSuppported");async function Zm(){if(!Ym())return;await zt,await new Promise(n=>setTimeout(n));const e=window.performance.getEntriesByType("resource");e.length&&we({resourceTimings:e});const t=window.performance.getEntriesByType("navigation");t.length&&we({navigationTimings:t})}Hr(Zm,"sendTimingResults"),Zm(),Ca(Tt),xa(Tt),Aa(Tt),Pa(Tt),Ma(Tt),f("click",".js-toggler-container .js-toggler-target",function(e){if(e.button!==0)return;const t=e.currentTarget.closest(".js-toggler-container");t&&t.classList.toggle("on")}),M(".js-toggler-container",async(e,t)=>{e.classList.remove("success","error"),e.classList.add("loading");try{await t.text(),e.classList.add("success")}catch{e.classList.add("error")}finally{e.classList.remove("loading")}});const $y={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]};function Iy(e,t,n={}){const r=Fy(e),o=Oy(r),s=getComputedStyle(r),i=r.getBoundingClientRect(),[a,c]=[s.borderTopWidth,s.borderLeftWidth].map(d=>parseInt(d,10)||0),l={top:i.top+a,left:i.left+c};return Dy(o,l,e.getBoundingClientRect(),t instanceof Element?t.getBoundingClientRect():t,Ry(n))}function Fy(e){let t=e.parentNode;for(;t!==null;){if(t instanceof HTMLElement&&getComputedStyle(t).position!=="static")return t;t=t.parentNode}return document.body}function Oy(e){let t=e;for(;t!==null&&!(t===document.body||getComputedStyle(t).overflow!=="visible");)t=t.parentNode;const n=t===document.body||!(t instanceof HTMLElement)?document.body:t,r=n.getBoundingClientRect(),o=getComputedStyle(n),[s,i,a,c]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map(l=>parseInt(l,10)||0);return{top:r.top+s,left:r.left+i,width:r.width-a-i,height:Math.max(r.height-s-c,n===document.body?window.innerHeight:-1/0)}}const wn={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function Ry(e={}){var t,n,r,o,s;const i=(t=e.side)!==null&&t!==void 0?t:wn.side,a=(n=e.align)!==null&&n!==void 0?n:wn.align;return{side:i,align:a,anchorOffset:(r=e.anchorOffset)!==null&&r!==void 0?r:i==="inside-center"?0:wn.anchorOffset,alignmentOffset:(o=e.alignmentOffset)!==null&&o!==void 0?o:a!=="center"&&i.startsWith("inside")?wn.alignmentOffset:0,allowOutOfBounds:(s=e.allowOutOfBounds)!==null&&s!==void 0?s:wn.allowOutOfBounds}}function Dy(e,t,n,r,{side:o,align:s,allowOutOfBounds:i,anchorOffset:a,alignmentOffset:c}){const l={top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height};let d=ep(n,r,o,s,a,c),m=o;if(d.top-=t.top,d.left-=t.left,!i){const h=$y[o];let g=0;if(h){let w=o;for(;g<h.length&&Hy(w,d,l,n);){const L=h[g++];w=L,d=ep(n,r,L,s,a,c),d.top-=t.top,d.left-=t.left,m=L}}d.top<l.top&&(d.top=l.top),d.left<l.left&&(d.left=l.left),d.left+n.width>e.width+l.left&&(d.left=e.width+l.left-n.width),h&&g<h.length&&d.top+n.height>e.height+l.top&&(d.top=e.height+l.top-n.height)}return Object.assign(Object.assign({},d),{anchorSide:m})}function ep(e,t,n,r,o,s){const i=t.left+t.width,a=t.top+t.height;let c=-1,l=-1;return n==="outside-top"?c=t.top-o-e.height:n==="outside-bottom"?c=a+o:n==="outside-left"?l=t.left-o-e.width:n==="outside-right"&&(l=i+o),(n==="outside-top"||n==="outside-bottom")&&(r==="start"?l=t.left+s:r==="center"?l=t.left-(e.width-t.width)/2+s:l=i-e.width-s),(n==="outside-left"||n==="outside-right")&&(r==="start"?c=t.top+s:r==="center"?c=t.top-(e.height-t.height)/2+s:c=a-e.height-s),n==="inside-top"?c=t.top+o:n==="inside-bottom"?c=a-o-e.height:n==="inside-left"?l=t.left+o:n==="inside-right"?l=i-o-e.width:n==="inside-center"&&(l=(i+t.left)/2-e.width/2+o),n==="inside-top"||n==="inside-bottom"?r==="start"?l=t.left+s:r==="center"?l=t.left-(e.width-t.width)/2+s:l=i-e.width-s:(n==="inside-left"||n==="inside-right"||n==="inside-center")&&(r==="start"?c=t.top+s:r==="center"?c=t.top-(e.height-t.height)/2+s:c=a-e.height-s),{top:c,left:l}}function Hy(e,t,n,r){return e==="outside-top"||e==="outside-bottom"?t.top<n.top||t.top+r.height>n.height+n.top:t.left<n.left||t.left+r.width>n.width+n.left}var Ny=Object.defineProperty,By=(e,t)=>Ny(e,"name",{value:t,configurable:!0}),tp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ct=(e,t,n)=>(tp(e,t,"read from private field"),n?n.call(e):t.get(e)),Ln=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},S=(e,t,n,r)=>(tp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),jn,W,ee,ce,Nr;const np="hx_tooltip-open",rp="hx_tooltip",oe=6,op=["hx_tooltip-n","hx_tooltip-s","hx_tooltip-e","hx_tooltip-w","hx_tooltip-ne","hx_tooltip-se","hx_tooltip-nw","hx_tooltip-sw"],Uy={n:"hx_tooltip-n",s:"hx_tooltip-s",e:"hx_tooltip-e",w:"hx_tooltip-w",ne:"hx_tooltip-ne",se:"hx_tooltip-se",nw:"hx_tooltip-nw",sw:"hx_tooltip-sw"};class Br extends HTMLElement{constructor(){super(...arguments);Ln(this,jn,void 0),Ln(this,W,"s"),Ln(this,ee,"center"),Ln(this,ce,"outside-bottom"),Ln(this,Nr,!1)}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}get type(){return this.getAttribute("data-type")==="label"?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return Ct(this,W)}set direction(t){this.setAttribute("data-direction",t)}get align(){return Ct(this,ee)}get side(){return Ct(this,ce)}connectedCallback(){this.hidden=!0,S(this,Nr,!0),this.id||(this.id=`tooltip-${Date.now()}-${(Math.random()*1e4).toFixed(0)}`),!!this.control&&(this.classList.add(rp),this.setAttribute("role","tooltip"),this.addEvents())}attributeChangedCallback(t,n,r){if(t==="id"||t==="data-type"){if(!this.id||!this.control)return;if(this.type==="label")this.control.setAttribute("aria-labelledby",this.id);else{let o=this.control.getAttribute("aria-describedby");o?o=`${o} ${this.id}`:o=this.id,this.control.setAttribute("aria-describedby",o)}}else if(t==="hidden")if(r==="")this.classList.remove(np,...op);else{this.classList.add(np,rp);for(const s of this.ownerDocument.querySelectorAll(this.tagName))s!==this&&(s.hidden=!0);this.updatePosition()}else if(t==="data-direction"){this.classList.remove(...op);const o=S(this,W,r||"s");o==="n"?(S(this,ee,"center"),S(this,ce,"outside-top")):o==="ne"?(S(this,ee,"start"),S(this,ce,"outside-top")):o==="e"?(S(this,ee,"center"),S(this,ce,"outside-right")):o==="se"?(S(this,ee,"start"),S(this,ce,"outside-bottom")):o==="s"?(S(this,ee,"center"),S(this,ce,"outside-bottom")):o==="sw"?(S(this,ee,"end"),S(this,ce,"outside-bottom")):o==="w"?(S(this,ee,"center"),S(this,ce,"outside-left")):o==="nw"&&(S(this,ee,"end"),S(this,ce,"outside-top")),this.updatePosition()}}disconnectedCallback(){Ct(this,jn).abort()}addEvents(){if(!this.control)return;S(this,jn,new AbortController);const{signal:t}=Ct(this,jn);this.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("blur",this,{signal:t}),this.ownerDocument.addEventListener("keydown",this,{signal:t})}handleEvent(t){!this.control||((t.type==="mouseenter"||t.type==="focus")&&this.hidden?this.hidden=!1:t.type==="blur"?this.hidden=!0:t.type==="mouseleave"&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hidden=!0:t.type==="keydown"&&t.key==="Escape"&&!this.hidden&&(this.hidden=!0))}updatePosition(){if(!this.control||!Ct(this,Nr)||this.hidden)return;const t=Iy(this,this.control,this),{anchorSide:n}=t;let{top:r,left:o}=t;this.style.top=`${r}px`,this.style.left=`${o}px`;const s=this.getBoundingClientRect(),i=this.control.getBoundingClientRect(),a=s.width,c=s.left+a/2,l=i.x+i.width/2,d=Math.abs(c-l),m=Math.abs(s.left-i.x),h=Math.abs(s.left+a-i.right),g=Math.min(d,m,h);g===d?(S(this,ee,"center"),n==="outside-top"?(S(this,W,"n"),r-=oe):n==="outside-bottom"?(S(this,W,"s"),r+=oe):n==="outside-left"?(S(this,W,"w"),o-=oe):(S(this,W,"e"),o+=oe)):g===h?(S(this,ee,"end"),n==="outside-top"?(S(this,W,"nw"),r-=oe):n==="outside-bottom"?(S(this,W,"sw"),r+=oe):n==="outside-left"?(S(this,W,"w"),o-=oe):(S(this,W,"e"),o+=oe)):(S(this,ee,"start"),n==="outside-top"?(S(this,W,"ne"),r-=oe):n==="outside-bottom"?(S(this,W,"se"),r+=oe):n==="outside-left"?(S(this,W,"w"),o-=oe):(S(this,W,"e"),o+=oe)),this.style.top=`${r}px`,this.style.left=`${o}px`,this.classList.add(Uy[this.direction])}}By(Br,"PrimerTooltipElement"),jn=new WeakMap,W=new WeakMap,ee=new WeakMap,ce=new WeakMap,Nr=new WeakMap,Br.observedAttributes=["data-type","data-direction","id","hidden"],window.customElements.get("primer-tooltip")||(window.PrimerTooltipElement=Br,window.customElements.define("primer-tooltip",Br)),window.requestIdleCallback(()=>{const e=uc();e&&wc("tz",encodeURIComponent(e))});var sp=Object.defineProperty,Wy=Object.getOwnPropertyDescriptor,Di=(e,t)=>sp(e,"name",{value:t,configurable:!0}),z=(e,t,n,r)=>{for(var o=r>1?void 0:r?Wy(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&sp(t,n,o),o},J;(function(e){e.Initializing="initializing",e.Unsupported="unsupported",e.Ready="ready",e.Waiting="waiting",e.Error="error",e.Submitting="submitting"})(J||(J={}));let ye=class extends HTMLElement{constructor(){super(...arguments);this.state=J.Initializing,this.json="",this.autofocusWhenReady=!1,this.hasErrored=!1}connectedCallback(){this.originalButtonText=this.button.textContent,this.setState(dc()?J.Ready:J.Unsupported)}setState(e){this.button.textContent=this.hasErrored?this.button.getAttribute("data-retry-message"):this.originalButtonText,this.button.disabled=!1,this.button.hidden=!1;for(const t of this.messages)t.hidden=!0;switch(e){case J.Initializing:this.button.disabled=!0;break;case J.Unsupported:this.button.disabled=!0,this.unsupportedMessage.hidden=!1;break;case J.Ready:this.autofocusWhenReady&&this.button.focus();break;case J.Waiting:this.waitingMessage.hidden=!1,this.button.hidden=!0;break;case J.Error:this.errorMessage.hidden=!1;break;case J.Submitting:this.button.textContent="Verifying\u2026",this.button.disabled=!0;break;default:throw new Error("invalid state")}this.state=e}async prompt(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("webauthn-get-prompt"));try{this.setState(J.Waiting);const t=JSON.parse(this.json),n=await fc(t);this.setState(J.Submitting);const r=this.closest(".js-webauthn-form"),o=r.querySelector(".js-webauthn-response");o.value=JSON.stringify(n),V(r)}catch(t){throw this.hasErrored=!0,this.setState(J.Error),t}}};Di(ye,"WebauthnGetElement"),z([y],ye.prototype,"button",2),z([te],ye.prototype,"messages",2),z([y],ye.prototype,"unsupportedMessage",2),z([y],ye.prototype,"waitingMessage",2),z([y],ye.prototype,"errorMessage",2),z([se],ye.prototype,"json",2),z([se],ye.prototype,"autofocusWhenReady",2),ye=z([I],ye);var Be;(function(e){e.Initializing="initializing",e.ShowingForm="showing-form",e.ShowingRevealer="showing-revealer"})(Be||(Be={}));let at=class extends HTMLElement{constructor(){super(...arguments);this.state=Be.ShowingForm}connectedCallback(){this.setState(this.state)}setState(e){switch(this.revealer.hidden=!0,this.form.hidden=!1,e){case Be.Initializing:break;case Be.ShowingForm:this.passwordField.focus(),this.dispatchEvent(new CustomEvent("sudo-password-showing-form"));break;case Be.ShowingRevealer:this.revealer.hidden=!1,this.form.hidden=!0;break;default:throw new Error("invalid state")}this.state=e}reveal(){this.setState(Be.ShowingForm)}};Di(at,"SudoPasswordElement"),z([se],at.prototype,"state",2),z([y],at.prototype,"revealer",2),z([y],at.prototype,"form",2),z([y],at.prototype,"passwordField",2),at=z([I],at);let En=class extends HTMLElement{connectedCallback(){var e;(e=this.webauthnGet)==null||e.addEventListener("webauthn-get-prompt",()=>{this.sudoPassword.setState(Be.ShowingRevealer)}),this.sudoPassword.addEventListener("sudo-password-showing-form",()=>{var t;(t=this.webauthnGet)==null||t.setState(J.Ready)})}};Di(En,"SudoAuthElement"),z([y],En.prototype,"webauthnGet",2),z([y],En.prototype,"sudoPassword",2),En=z([I],En);var zy=Object.defineProperty,ip=(e,t)=>zy(e,"name",{value:t,configurable:!0});let Hi=0;function ap(){if(!document.hasFocus())return;const e=document.querySelector(".js-timeline-marker-form");e&&e instanceof HTMLFormElement&&V(e)}ip(ap,"markThreadAsRead");const Ur="IntersectionObserver"in window?new IntersectionObserver(function(e){for(const t of e)t.isIntersecting&&Ni(t.target)},{root:null,rootMargin:"0px",threshold:1}):null;p(".js-unread-item",{constructor:HTMLElement,add(e){Hi++,Ur&&Ur.observe(e)},remove(e){Hi--,Ur&&Ur.unobserve(e),Hi===0&&ap()}});function Ni(e){e.classList.remove("js-unread-item","unread-item")}ip(Ni,"clearUnread"),p(".js-discussion[data-channel-target]",{subscribe:e=>E(e,"socket:message",function(t){const n=t.target,r=t.detail.data;if(n.getAttribute("data-channel-target")===r.gid)for(const o of document.querySelectorAll(".js-unread-item"))Ni(o)})});var Vy=Object.defineProperty,Ky=(e,t)=>Vy(e,"name",{value:t,configurable:!0});let Wr=0;const cp=/^\(\d+\)\s+/;function Bi(){const e=Wr?`(${Wr}) `:"";document.title.match(cp)?document.title=document.title.replace(cp,e):document.title=`${e}${document.title}`}Ky(Bi,"updateTitle"),p(".js-unread-item",{add(){Wr++,Bi()},remove(){Wr--,Bi()}});var Xy=Object.defineProperty,Gy=(e,t)=>Xy(e,"name",{value:t,configurable:!0});p(".js-socket-channel.js-updatable-content",{subscribe:e=>E(e,"socket:message",function(t){const{gid:n,wait:r}=t.detail.data,o=t.target,s=n?lp(o,n):o;s&&setTimeout(On,r||0,s)})});function lp(e,t){if(e.getAttribute("data-gid")===t)return e;for(const n of e.querySelectorAll("[data-url][data-gid]"))if(n.getAttribute("data-gid")===t)return n;return null}Gy(lp,"findByGid");var Jy=Object.defineProperty,Qy=(e,t)=>Jy(e,"name",{value:t,configurable:!0});async function up(){if(!(!history.state||!history.state.staleRecords)){await Xt;for(const e in history.state.staleRecords)for(const t of document.querySelectorAll(`.js-updatable-content [data-url='${e}'], .js-updatable-content[data-url='${e}']`)){const n=history.state.staleRecords[e];t instanceof HTMLElement&&In(t,n,!0)}Ke(null,"",location.href)}}Qy(up,"reapplyPreviouslyUpdatedContent"),window.addEventListener("beforeunload",function(){if(Object.keys(vo).length>0){const e=history.state||{};e.staleRecords=vo,Ke(e,"",location.href)}});try{up()}catch{}f("upload:setup",".js-upload-avatar-image",function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-alambic-organization"),r=e.currentTarget.getAttribute("data-alambic-owner-type"),o=e.currentTarget.getAttribute("data-alambic-owner-id");n&&t.append("organization_id",n),r&&t.append("owner_type",r),o&&t.append("owner_id",o)}),f("upload:complete",".js-upload-avatar-image",function(e){const{attachment:t}=e.detail,n=`/settings/avatars/${t.id}`;Le({content:U(document,n)})});var Yy=Object.defineProperty,Zy=(e,t)=>Yy(e,"name",{value:t,configurable:!0});function Sn(){if(document.querySelector(":target"))return;const e=mc(location.hash).toLowerCase(),t=pc(document,`user-content-${e}`);t&&hc(t)}Zy(Sn,"hashchange"),window.addEventListener("hashchange",Sn),document.addEventListener("pjax:success",Sn),async function(){await Xt,Sn()}(),f("click","a[href]",function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&t.href===location.href&&location.hash.length>1&&setTimeout(function(){e.defaultPrevented||Sn()})});var ev=Object.defineProperty,tv=(e,t)=>ev(e,"name",{value:t,configurable:!0});async function dp(e){const t=e.currentTarget,{init:n}=await k.import("./chunk-user-status-submit.js");n(t)}tv(dp,"load"),p(".js-user-status-container",{subscribe:e=>E(e,"click",dp,{once:!0})});var nv=Object.defineProperty,Pe=(e,t)=>nv(e,"name",{value:t,configurable:!0});function fp(e,t){const n=e.querySelector(".js-user-list-base");n&&(n.textContent=t||n.getAttribute("data-generic-message"),n.hidden=!1)}Pe(fp,"setFlashError");function Ui(e,t){const r=(t||e).querySelectorAll(".js-user-list-error");for(const i of r)i.hidden=!0;const o=t?[t]:e.querySelectorAll(".errored.js-user-list-input-container");for(const i of o)i.classList.remove("errored");const s=e.querySelector(".js-user-list-base");s&&(s.hidden=!0)}Pe(Ui,"resetValidation"),M(".js-user-list-form",async function(e,t){var n;Ui(e);const r=e.querySelector("[data-submitting-message]"),o=r==null?void 0:r.textContent;r&&(r.textContent=r.getAttribute("data-submitting-message"),r.disabled=!0);for(const s of e.querySelectorAll(".js-user-list-input"))s.disabled=!0;try{const s=await t.html();v(e,"user-list-form:success",s.html)}catch(s){if(((n=s.response)==null?void 0:n.status)===422)e.replaceWith(s.response.html);else{fp(e),r&&(o&&(r.textContent=o),r.disabled=!1);for(const i of e.querySelectorAll(".js-user-list-input"))i.disabled=!1}}}),f("user-list-form:success",".js-follow-list",e=>{const t=e.detail,n=t instanceof DocumentFragment?t.querySelector(".js-target-url"):null;(n==null?void 0:n.textContent)?location.href=n.textContent:location.reload()});function Wi(e){if(!(e.currentTarget instanceof HTMLElement))return;const t=e.currentTarget.closest(".js-user-list-form"),n=e.currentTarget.closest(".js-user-list-input-container");t&&n&&Ui(t,n)}Pe(Wi,"clearErrorsFromInput"),me(".js-user-list-form input",Wi),me(".js-user-list-form textarea",Wi),f("auto-check-error",".js-user-list-form input",function(e){const t=e.currentTarget.closest(".js-user-list-input-container"),n=t==null?void 0:t.querySelector(".js-user-list-error");n&&(n.hidden=!1)});function mp(e){var t;const n=new Map;for(const r of e){const o=(t=r.querySelector(".js-user-lists-create-trigger"))==null?void 0:t.getAttribute("data-repository-id");if(o){const s=n.get(o);s?s.push(r):n.set(o,[r])}}return n}Pe(mp,"groupRootsByRepositoryId");async function pp(e,t,n){const r=new FormData;r.set("authenticity_token",t);for(const i of n)r.append("repository_ids[]",i);const o=await fetch(e,{method:"POST",body:r,headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}}),s=new Map;if(o.ok){const i=await o.json();for(const a in i)s.set(a,fe(document,i[a]))}return s}Pe(pp,"requestMenuBatchRender");function hp(e,t){for(const[n,r]of e.entries()){const o=t.get(n)||[];for(const s of o)s.replaceWith(o.length===1?r:r.cloneNode(!0))}}Pe(hp,"replaceUserListMenuRoots");async function zi(){var e;const t=document.querySelectorAll(".js-user-list-menu-content-root");if(t.length===0)return;const n=t[0].getAttribute("data-batch-update-url");if(!n)return;const r=(e=t[0].querySelector(".js-user-list-batch-update-csrf"))==null?void 0:e.value;if(!r)return;const o=mp(t),s=o.keys(),i=await pp(n,r,s);i.size>0&&hp(i,o)}Pe(zi,"updateAllUserListMenus");function Vi(e){const t=new Promise((n,r)=>{e.addEventListener("user-list-menu-form:success",()=>n()),e.addEventListener("user-list-menu-form:error",o=>r(o))});return V(e),t}Pe(Vi,"requestUserListMenuFormSubmit");function gp(e){const t=e.target;if(!(t instanceof HTMLDetailsElement)||t.hasAttribute("open"))return;const n=t.querySelector(".js-user-list-menu-form");n&&Gt(n)&&V(n)}Pe(gp,"submitUserListFormOnToggle"),f("toggle",".js-user-list-menu",gp,{capture:!0}),f("click",".js-user-list-menu .js-submit-before-navigate",async e=>{const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.closest(".js-user-list-menu-content-root");if(!n)return;n.removeAttribute("data-update-after-submit");const r=n.querySelector(".js-user-list-menu-form");if(r)try{await Vi(r)}catch{qe(),e.preventDefault()}}),M(".js-user-list-menu-form",async function(e,t){let n;try{n=await t.json()}catch(o){qe(),v(e,"user-list-menu-form:error",o);return}if(n.json.didStar){const o=e.closest(".js-toggler-container");o&&o.classList.add("on");const s=n.json.starCount;if(s){const i=e.closest(".js-social-container");i&&ji(i,s)}}const r=e.closest(".js-user-list-menu-content-root[data-update-after-submit]");if(r)for(const o of e.querySelectorAll(".js-user-list-menu-item"))o.checked=o.defaultChecked;n.json.didCreate?await zi():r&&await On(r),v(e,"user-list-menu-form:success")}),f("click",".js-user-list-delete-confirmation-trigger",e=>{const{currentTarget:t}=e,n=t.getAttribute("data-template-id");if(!n)return;const r=document.getElementById(n);if(!r||!(r instanceof HTMLTemplateElement))return;const o=t.closest(".js-edit-user-list-dialog");o&&(o.open=!1);const s=r.content.cloneNode(!0),i=r.getAttribute("data-labelledby");Le({content:s,labelledBy:i})}),f("click",".js-user-lists-create-trigger",async function(e){const{currentTarget:t}=e,n=document.querySelector(".js-user-list-create-dialog-template"),r=e.currentTarget.getAttribute("data-repository-id"),o=t.closest(".js-user-list-menu-content-root");if(!n||!(n instanceof HTMLTemplateElement)||!r){t instanceof HTMLButtonElement&&(t.disabled=!0);return}const s=n.getAttribute("data-label");if(o&&Gt(o)){const c=o.querySelector(".js-user-list-menu-form");c&&await Vi(c)}const i=new de(n,{repositoryId:r}),a=await Le({content:i,label:s});a.addEventListener("user-list-form:success",async()=>{await zi();const c=a.closest("details");c&&(c.open=!1)})});var bp=Object.defineProperty,rv=Object.getOwnPropertyDescriptor,ov=(e,t)=>bp(e,"name",{value:t,configurable:!0}),zr=(e,t,n,r)=>{for(var o=r>1?void 0:r?rv(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&bp(t,n,o),o};let xt=class extends HTMLElement{show(){this.input.type="text",this.input.focus(),this.showButton.hidden=!0,this.hideButton.hidden=!1}hide(){this.input.type="password",this.input.focus(),this.hideButton.hidden=!0,this.showButton.hidden=!1}};ov(xt,"VisiblePasswordElement"),zr([y],xt.prototype,"input",2),zr([y],xt.prototype,"showButton",2),zr([y],xt.prototype,"hideButton",2),xt=zr([I],xt);var sv=Object.defineProperty,kn=(e,t)=>sv(e,"name",{value:t,configurable:!0});p("[data-warn-unsaved-changes]",{add(e){e.addEventListener("input",_n),e.addEventListener("change",_n),e.addEventListener("submit",At);const t=e.closest("details-dialog");t&&(t.closest("details").addEventListener("toggle",Ki),t.addEventListener("details-dialog-close",Xi))},remove(e){e.removeEventListener("input",_n),e.removeEventListener("change",_n),e.removeEventListener("submit",At);const t=e.closest("details-dialog");t&&(t.closest("details").removeEventListener("toggle",Ki),t.removeEventListener("details-dialog-close",Xi),At())}});function _n(e){const t=e.currentTarget;Gt(t)?yp(t):At()}kn(_n,"prepareUnsavedChangesWarning");function yp(e){const t=e.getAttribute("data-warn-unsaved-changes")||"Changes you made may not be saved.";window.onbeforeunload=function(n){return n.returnValue=t,t}}kn(yp,"enableSaveChangesReminder");function At(){window.onbeforeunload=null}kn(At,"disableSaveChangesReminder");function Ki({currentTarget:e}){e.hasAttribute("open")||At()}kn(Ki,"disableSaveChangesReminderOnClosedDialogs");function Xi(e){const t=e.currentTarget;if(!t.closest("details[open]"))return;let r=!0;const o=t.querySelectorAll("form[data-warn-unsaved-changes]");for(const s of o)if(Gt(s)){const i=s.getAttribute("data-warn-unsaved-changes");r=confirm(i);break}r||e.preventDefault()}kn(Xi,"promptOnDialogClosing");var iv=Object.defineProperty,av=(e,t)=>iv(e,"name",{value:t,configurable:!0});p(".will-transition-once",{constructor:HTMLElement,subscribe:e=>E(e,"transitionend",vp)});function vp(e){e.target.classList.remove("will-transition-once")}av(vp,"onTransitionEnd");var cv=Object.defineProperty,lv=(e,t)=>cv(e,"name",{value:t,configurable:!0});function wp(e,t=0){const n=e.getBoundingClientRect(),r=n.top-t,o=n.bottom-window.innerHeight+t;r<0?window.scrollBy(0,r):o>0&&window.scrollBy(0,o)}lv(wp,"adjustViewport"),f("click",".js-video-play, .js-video-close",function(e){const n=e.currentTarget.closest(".js-video-container"),r=n.querySelector(".js-video-iframe");n.tagName.toLowerCase()==="details"&&n.addEventListener("details-dialog-close",function(){r.removeAttribute("src"),window.setTimeout(function(){n.classList.remove("is-expanded")},10)}),n.classList.contains("is-expanded")?(r.removeAttribute("src"),n.classList.remove("is-expanded")):(r.src=r.getAttribute("data-src")||"",n.classList.add("is-expanded")),wp(r,20)});var uv=Object.defineProperty,Gi=(e,t)=>uv(e,"name",{value:t,configurable:!0});async function Lp(e){const t=e.currentTarget,n=t.getAttribute("data-url");if(!n||jp(t))return;const r=t.getAttribute("data-id")||"",o=t.textContent,s=document.querySelectorAll(`.js-issue-link[data-id='${r}']`);for(const i of s)i.removeAttribute("data-url");try{const i=await fetch(n,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!i.ok){const c=new Error,l=i.statusText?` ${i.statusText}`:"";throw c.message=`HTTP ${i.status}${l}`,c}const a=await i.json();Ji(s,`${o}, ${a.title}`)}catch(i){const a=(i.response!=null?i.response.status:void 0)||500,c=(()=>{switch(a){case 404:return t.getAttribute("data-permission-text");default:return t.getAttribute("data-error-text")}})();Ji(s,c||"")}}Gi(Lp,"issueLabel");function Ji(e,t){for(const n of e)n instanceof HTMLElement&&(n.classList.add("tooltipped","tooltipped-ne"),n.setAttribute("aria-label",t))}Gi(Ji,"setLabel");function jp(e){switch(e.getAttribute("data-hovercard-type")){case"issue":case"pull_request":return!!e.closest("[data-issue-and-pr-hovercards-enabled]");case"discussion":return!!e.closest("[data-discussion-hovercards-enabled]");default:return!1}}Gi(jp,"isHovercardEnabled"),p(".js-issue-link",{subscribe:e=>E(e,"mouseenter",Lp)}),k.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var dv=Object.freeze({__proto__:null}),Tn=qa(dv);const Ep={};for(const e of Object.keys(Tn))Ep[Tn[e]]=e;const b={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var ct=b;for(const e of Object.keys(b)){if(!("channels"in b[e]))throw new Error("missing channels property: "+e);if(!("labels"in b[e]))throw new Error("missing channel labels property: "+e);if(b[e].labels.length!==b[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=b[e];delete b[e].channels,delete b[e].labels,Object.defineProperty(b[e],"channels",{value:t}),Object.defineProperty(b[e],"labels",{value:n})}b.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),s=Math.max(t,n,r),i=s-o;let a,c;s===o?a=0:t===s?a=(n-r)/i:n===s?a=2+(r-t)/i:r===s&&(a=4+(t-n)/i),a=Math.min(a*60,360),a<0&&(a+=360);const l=(o+s)/2;return s===o?c=0:l<=.5?c=i/(s+o):c=i/(2-s-o),[a,c*100,l*100]},b.rgb.hsv=function(e){let t,n,r,o,s;const i=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(i,a,c),d=l-Math.min(i,a,c),m=function(h){return(l-h)/6/d+1/2};return d===0?(o=0,s=0):(s=d/l,t=m(i),n=m(a),r=m(c),i===l?o=r-n:a===l?o=1/3+t-r:c===l&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,l*100]},b.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=b.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,s*100,r*100]},b.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),s=(1-t-o)/(1-o)||0,i=(1-n-o)/(1-o)||0,a=(1-r-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function fv(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}b.rgb.keyword=function(e){const t=Ep[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(Tn)){const s=Tn[o],i=fv(e,s);i<n&&(n=i,r=o)}return r},b.keyword.rgb=function(e){return Tn[e]},b.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,s=t*.2126+n*.7152+r*.0722,i=t*.0193+n*.1192+r*.9505;return[o*100,s*100,i*100]},b.rgb.lab=function(e){const t=b.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const s=116*r-16,i=500*(n-r),a=200*(r-o);return[s,i,a]},b.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,s,i;if(n===0)return i=r*255,[i,i,i];r<.5?o=r*(1+n):o=r+n-r*n;const a=2*r-o,c=[0,0,0];for(let l=0;l<3;l++)s=t+1/3*-(l-1),s<0&&s++,s>1&&s--,6*s<1?i=a+(o-a)*6*s:2*s<1?i=o:3*s<2?i=a+(o-a)*(2/3-s)*6:i=a,c[l]=i*255;return c},b.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=s<=1?s:2-s;const i=(r+n)/2,a=r===0?2*o/(s+o):2*n/(r+n);return[t,a*100,i*100]},b.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,s=t-Math.floor(t),i=255*r*(1-n),a=255*r*(1-n*s),c=255*r*(1-n*(1-s));switch(r*=255,o){case 0:return[r,c,i];case 1:return[a,r,i];case 2:return[i,r,c];case 3:return[i,a,r];case 4:return[c,i,r];case 5:return[r,i,a]}},b.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let s,i;i=(2-n)*r;const a=(2-n)*o;return s=n*o,s/=a<=1?a:2-a,s=s||0,i/=2,[t,s*100,i*100]},b.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let s;o>1&&(n/=o,r/=o);const i=Math.floor(6*t),a=1-r;s=6*t-i,(i&1)!=0&&(s=1-s);const c=n+s*(a-n);let l,d,m;switch(i){default:case 6:case 0:l=a,d=c,m=n;break;case 1:l=c,d=a,m=n;break;case 2:l=n,d=a,m=c;break;case 3:l=n,d=c,m=a;break;case 4:l=c,d=n,m=a;break;case 5:l=a,d=n,m=c;break}return[l*255,d*255,m*255]},b.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),i=1-Math.min(1,n*(1-o)+o),a=1-Math.min(1,r*(1-o)+o);return[s*255,i*255,a*255]},b.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,s,i;return o=t*3.2406+n*-1.5372+r*-.4986,s=t*-.9689+n*1.8758+r*.0415,i=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),[o*255,s*255,i*255]},b.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,s=500*(t-n),i=200*(n-r);return[o,s,i]},b.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,s,i;s=(t+16)/116,o=n/500+s,i=s-r/200;const a=s**3,c=o**3,l=i**3;return s=a>.008856?a:(s-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o*=95.047,s*=100,i*=108.883,[o,s,i]},b.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const i=Math.sqrt(n*n+r*r);return[t,i,o]},b.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,s=n*Math.cos(o),i=n*Math.sin(o);return[t,s,i]},b.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let s=t===null?b.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let i=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(i+=60),i},b.hsv.ansi16=function(e){return b.rgb.ansi16(b.hsv.rgb(e),e[2])},b.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},b.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,s=(t>>2&1)*n*255;return[r,o,s]},b.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]},b.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n},b.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(a=>a+a).join(""));const r=parseInt(n,16),o=r>>16&255,s=r>>8&255,i=r&255;return[o,s,i]},b.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),s=Math.min(Math.min(t,n),r),i=o-s;let a,c;return i<1?a=s/(1-i):a=0,i<=0?c=0:o===t?c=(n-r)/i%6:o===n?c=2+(r-t)/i:c=4+(t-n)/i,c/=6,c%=1,[c*360,i*100,a*100]},b.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]},b.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]},b.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],s=t%1*6,i=s%1,a=1-i;let c=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=i,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=i;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=i,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-n)*r,[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]},b.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]},b.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]},b.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]},b.hwb.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=1-n,o=r-t;let s=0;return o<1&&(s=(r-o)/(1-o)),[e[0],o*100,s*100]},b.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},b.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},b.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},b.gray.hsl=function(e){return[0,0,e[0]]},b.gray.hsv=b.gray.hsl,b.gray.hwb=function(e){return[0,100,e[0]]},b.gray.cmyk=function(e){return[0,0,0,e[0]]},b.gray.lab=function(e){return[e[0],0,0]},b.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},b.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function mv(){const e={},t=Object.keys(ct);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function pv(e){const t=mv(),n=[e];for(t[e].distance=0;n.length;){const r=n.pop(),o=Object.keys(ct[r]);for(let s=o.length,i=0;i<s;i++){const a=o[i],c=t[a];c.distance===-1&&(c.distance=t[r].distance+1,c.parent=r,n.unshift(a))}}return t}function hv(e,t){return function(n){return t(e(n))}}function gv(e,t){const n=[t[e].parent,e];let r=ct[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),r=hv(ct[t[o].parent][o],r),o=t[o].parent;return r.conversion=n,r}var bv=function(e){const t=pv(e),n={},r=Object.keys(t);for(let o=r.length,s=0;s<o;s++){const i=r[s];t[i].parent!==null&&(n[i]=gv(i,t))}return n};const Pt={},yv=Object.keys(ct);function vv(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function wv(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let s=o.length,i=0;i<s;i++)o[i]=Math.round(o[i]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}yv.forEach(e=>{Pt[e]={},Object.defineProperty(Pt[e],"channels",{value:ct[e].channels}),Object.defineProperty(Pt[e],"labels",{value:ct[e].labels});const t=bv(e);Object.keys(t).forEach(r=>{const o=t[r];Pt[e][r]=wv(o),Pt[e][r].raw=vv(o)})});var lt=Pt,Lv=Object.defineProperty,B=(e,t)=>Lv(e,"name",{value:t,configurable:!0});function Vr(){return[Math.floor(Math.random()*(255-0)+0),Math.floor(Math.random()*(255-0)+0),Math.floor(Math.random()*(255-0)+0)]}B(Vr,"randomRGBColor");function Mt(e,t){const n=lt.rgb.hsl(t);e.style.setProperty("--label-r",t[0].toString()),e.style.setProperty("--label-g",t[1].toString()),e.style.setProperty("--label-b",t[2].toString()),e.style.setProperty("--label-h",n[0].toString()),e.style.setProperty("--label-s",n[1].toString()),e.style.setProperty("--label-l",n[2].toString())}B(Mt,"setColorSwatch");function Kr(e,t){e.blur();const n=e.closest("form"),r=n.querySelector(".js-new-label-color-input");$e(r,`#${lt.rgb.hex(t)}`);const o=n.querySelector(".js-new-label-color");Mt(o,t)}B(Kr,"setInputColorFromButton");function Sp(e,t){e.closest(".js-label-error-container").classList.add("errored"),e.textContent=t,e.hidden=!1}B(Sp,"addErrorToField");function kp(e){e.closest(".js-label-error-container").classList.remove("errored"),e.hidden=!0}B(kp,"removeErrorFromField");function ut(e,t,n){const r=t.querySelector(e);!r||(n?Sp(r,n[0]):kp(r))}B(ut,"showOrHideLabelError");function Xr(e,t){ut(".js-label-name-error",e,t.name),ut(".js-label-description-error",e,t.description),ut(".js-label-color-error",e,t.color)}B(Xr,"showLabelErrors");function Ue(e){ut(".js-label-name-error",e,null),ut(".js-label-description-error",e,null),ut(".js-label-color-error",e,null)}B(Ue,"hideLabelErrors");function _p(e,t,n,r,o){const s=new URL(`${e}${encodeURIComponent(t)}`,window.location.origin),i=new URLSearchParams(s.search.slice(1));return i.append("color",n),r&&i.append("description",r),o&&i.append("id",o),s.search=i.toString(),s.toString()}B(_p,"labelPreviewUrl");function Tp(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}B(Tp,"labelDescriptionFrom");function Cp(e){const t=e.querySelector(".js-new-label-color-input");return t.checkValidity()?t.value.trim().replace(/^#/,""):"ededed"}B(Cp,"labelColorFrom");function xp(e,t){let r=e.querySelector(".js-new-label-name-input").value.trim();return r.length<1&&(r=t.getAttribute("data-default-name")),r}B(xp,"labelNameFrom");async function dt(e){const t=e.closest(".js-label-preview-container");if(!t)return;const n=e.closest(".js-label-form"),r=n.querySelector(".js-new-label-error"),o=n.getAttribute("data-label-id"),s=t.querySelector(".js-label-preview"),i=xp(n,s);if(!n.checkValidity()&&i!=="Label preview")return;const a=Cp(n),c=Tp(n),l=s.getAttribute("data-url-template"),d=_p(l,i,a,c,o);if(t.hasAttribute("data-last-preview-url")){const h=t.getAttribute("data-last-preview-url");if(d===h)return}let m;try{m=await U(document,d)}catch(h){const g=await h.response.json();Xr(n,g),r&&(r.textContent=g.message,r.hidden=!1);return}r&&(r.textContent="",r.hidden=!0),Ue(n),s.innerHTML="",s.appendChild(m),t.setAttribute("data-last-preview-url",d)}B(dt,"updateLabelPreview");function Ap(e){dt(e.target)}B(Ap,"onLabelFormInputChange");function Qi(e,t){e.closest(".js-details-container").classList.toggle("is-empty",t)}B(Qi,"toggleBlankSlate");function Yi(e){const t=document.querySelector(".js-labels-count"),r=Number(t.textContent)+e;t.textContent=r.toString();const o=document.querySelector(".js-labels-label");return o.textContent=o.getAttribute(r===1?"data-singular-string":"data-plural-string"),r}B(Yi,"updateCount"),me(".js-label-filter-field",function(e){const t=e.target,r=t.closest("details-menu").querySelector(".js-new-label-name");if(!r)return;const o=t.value.trim();r.textContent=o}),f("filterable:change",".js-filterable-issue-labels",function(e){const t=e.currentTarget.closest("details-menu"),n=t.querySelector(".js-add-label-button");if(!n)return;const o=e.detail.inputField.value.trim().toLowerCase();let s=!1;for(const i of t.querySelectorAll("input[data-label-name]"))if((i.getAttribute("data-label-name")||"").toLowerCase()===o){s=!0;break}n.hidden=o.length===0||s}),Nt(".js-new-label-color-input",function(e){const n=e.closest("form").querySelector(".js-new-label-swatches");n.hidden=!1,e.addEventListener("blur",function(){n.hidden=!0},{once:!0})}),me(".js-new-label-color-input",function(e){const t=e.target;let n=t.value.trim();if(!(n.length<1))if(n.indexOf("#")!==0&&(n=`#${n}`,t.value=n),t.checkValidity()){t.classList.remove("color-fg-danger");const o=t.closest("form").querySelector(".js-new-label-color");Mt(o,lt.hex.rgb(n))}else t.classList.add("color-fg-danger")}),K("keyup",".js-new-label-color-input",function(e){const t=e.target;let n=t.value.trim();if(n.indexOf("#")!==0&&(n=`#${n}`,t.value=n),t.checkValidity()){const s=t.closest("form").querySelector(".js-new-label-color");Mt(s,lt.hex.rgb(n))}v(t,"change",!1);const r=t.closest("form");Ue(r)}),K("keyup",".js-new-label-description-input",function(e){const n=e.target.form;Ue(n)}),K("keyup",".js-new-label-color-input",function(e){const n=e.target.form;Ue(n)}),f("click",".js-new-label-color",async function(e){const t=e.currentTarget,n=Vr();Kr(t,n),dt(t)}),f("mousedown",".js-new-label-color-swatch",function(e){const t=e.currentTarget,n=t.getAttribute("data-color");Kr(t,lt.hex.rgb(n)),dt(t);const r=t.closest(".js-new-label-swatches");r.hidden=!0}),f("toggle",".js-new-label-modal",function(e){e.target.hasAttribute("open")&&Zi(e.target)},{capture:!0});async function Zi(e){const t=e.querySelector(".js-new-label-name-input");if(!t)return;const n=e.querySelector(".js-new-label-color-input"),r=Vr(),o=`#${lt.rgb.hex(r)}`;n.value=o;const s=e.querySelector(".js-new-label-color");Mt(s,r);const a=document.querySelector(".js-new-label-name").textContent;$e(t,a),gc(t),dt(s)}B(Zi,"initLabelModal"),M(".js-new-label-modal-form",async function(e,t){const n=e.querySelector(".js-new-label-error");let r;try{r=await t.html()}catch(a){const c=a.response.json;n.textContent=c.message,n.hidden=!1}if(!r)return;n.hidden=!0,document.querySelector(".js-new-label-modal").removeAttribute("open");const o=document.querySelector(".js-filterable-issue-labels"),s=r.html.querySelector("input");o.prepend(r.html),s&&s.dispatchEvent(new Event("change",{bubbles:!0}));const i=document.querySelector(".js-label-filter-field");i.value=i.defaultValue,i.focus()}),f("click",".js-edit-label-cancel",function(e){const t=e.target.closest("form");Ue(t),t.reset();const n=t.querySelector(".js-new-label-color-input"),r=n.value,o=t.querySelector(".js-new-label-color");Mt(o,lt.hex.rgb(r)),wo(t),dt(n);const s=e.currentTarget.closest(".js-labels-list-item");if(s){s.querySelector(".js-update-label").classList.add("d-none");const a=s.querySelector(".js-label-preview");a&&(a.classList.add("d-none"),s.querySelector(".js-label-link").classList.remove("d-none"));const c=s.querySelectorAll(".js-hide-on-label-edit");for(const l of c)l.hidden=!l.hidden}}),M(".js-update-label",async function(e,t){let n;try{n=await t.html()}catch(o){const s=o.response.json;Xr(e,s);return}Ue(e),e.closest(".js-labels-list-item").replaceWith(n.html)}),M(".js-create-label",async function(e,t){let n;try{n=await t.html()}catch(i){const a=i.response.json;Xr(e,a);return}e.reset(),Ue(e),document.querySelector(".js-label-list").prepend(n.html),Yi(1),Qi(e,!1);const r=e.querySelector(".js-new-label-color"),o=Vr();Kr(r,o),dt(e.querySelector(".js-new-label-name-input")),wo(e);const s=e.closest(".js-details-container");s instanceof HTMLElement&&yo(s)}),f("click",".js-details-target-new-label",function(){document.querySelector(".js-create-label").querySelector(".js-new-label-name-input").focus()}),f("click",".js-edit-label",function(e){const t=e.currentTarget.closest(".js-labels-list-item"),n=t.querySelector(".js-update-label");n.classList.remove("d-none"),n.querySelector(".js-new-label-name-input").focus();const o=t.querySelector(".js-label-preview");o&&(o.classList.remove("d-none"),t.querySelector(".js-label-link").classList.add("d-none"));const s=t.querySelectorAll(".js-hide-on-label-edit");for(const i of s)i.hidden=!i.hidden}),M(".js-delete-label",async function(e,t){const n=e.closest(".js-labels-list-item");n.querySelector(".js-label-delete-spinner").hidden=!1,await t.text();const r=Yi(-1);Qi(e,r===0),n.remove()});const Gr=We(Ap,500);f("suggester:complete",".js-new-label-name-input",Gr),me(".js-new-label-name-input",Gr),me(".js-new-label-description-input",Gr),me(".js-new-label-color-input",Gr),K("keypress",".js-new-label-name-input",function(e){const t=e.target,n=parseInt(t.getAttribute("data-maxlength"));bc(t.value)>=n&&e.preventDefault()}),f("click",".js-issues-label-select-menu-item",function(e){!e.altKey&&!e.shiftKey||(e.preventDefault(),e.stopPropagation(),e.altKey&&(window.location.href=e.currentTarget.getAttribute("data-excluded-url")),e.shiftKey&&(window.location.href=e.currentTarget.getAttribute("data-included-url")))}),K("keydown",".js-issues-label-select-menu-item",function(e){if(e.key!=="Enter"||!e.altKey&&!e.shiftKey)return;const t=e.currentTarget;e.preventDefault(),e.stopPropagation(),t instanceof HTMLAnchorElement&&(e.altKey&&(window.location.href=t.getAttribute("data-excluded-url")),e.shiftKey&&(window.location.href=t.getAttribute("data-included-url")))}),f("click",".js-open-label-creation-modal",async function(e){e.stopImmediatePropagation();const t=await Le({content:document.querySelector(".js-label-creation-template").content.cloneNode(!0),detailsClass:"js-new-label-modal"});Zi(t)},{capture:!0});var jv=Object.defineProperty,Ev=(e,t)=>jv(e,"name",{value:t,configurable:!0});f("change",".js-thread-notification-setting",Jr),f("change",".js-custom-thread-notification-option",Jr),f("reset",".js-custom-thread-settings-form",Jr);function Jr(){const e=document.querySelector(".js-reveal-custom-thread-settings").checked,t=!document.querySelector(".js-custom-thread-notification-option:checked"),n=document.querySelector(".js-custom-thread-settings"),r=document.querySelector("[data-custom-option-required-text]"),o=e&&t?r.getAttribute("data-custom-option-required-text"):"";r.setCustomValidity(o),n.hidden=!e}Ev(Jr,"toggleEventSettings");var Pp=Object.defineProperty,Sv=Object.getOwnPropertyDescriptor,kv=(e,t)=>Pp(e,"name",{value:t,configurable:!0}),Mp=(e,t,n,r)=>{for(var o=r>1?void 0:r?Sv(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Pp(t,n,o),o};let Qr=class extends HTMLElement{get activeClass(){return this.getAttribute("active-class")||"collapsible-sidebar-widget-active"}get loadingClass(){return this.getAttribute("loading-class")||"collapsible-sidebar-widget-loading"}get url(){return this.getAttribute("url")||""}get isOpen(){return this.hasAttribute("open")}set isOpen(e){e?this.setAttribute("open",""):this.removeAttribute("open")}onKeyDown(e){if(e.code==="Enter"||e.code==="Space")return e.preventDefault(),this.load()}onMouseDown(e){return e.preventDefault(),this.load()}load(){return this.pendingRequest?this.pendingRequest.abort():this.collapsible.hasAttribute("loaded")?this.isOpen?this.setClose():this.setOpen():(this.setLoading(),this.updateCollapsible())}setLoading(){this.classList.add(this.loadingClass),this.classList.remove(this.activeClass)}setOpen(){this.classList.add(this.activeClass),this.classList.remove(this.loadingClass),this.isOpen=!0}setClose(){this.classList.remove(this.activeClass),this.classList.remove(this.loadingClass),this.isOpen=!1}handleAbort(){this.pendingRequest=null,this.setClose()}async updateCollapsible(){var e;try{this.pendingRequest=new AbortController,this.pendingRequest.signal.addEventListener("abort",()=>this.handleAbort());const t=await fetch(this.url,{signal:(e=this.pendingRequest)==null?void 0:e.signal,headers:{Accept:"text/html","X-Requested-With":"XMLHttpRequest"}});if(this.pendingRequest=null,!t.ok)return this.setClose();const n=await t.text();this.collapsible.innerHTML=n,this.collapsible.setAttribute("loaded",""),this.setOpen()}catch{return this.pendingRequest=null,this.setClose()}}};kv(Qr,"CollapsibleSidebarWidgetElement"),Mp([y],Qr.prototype,"collapsible",2),Qr=Mp([I],Qr);var qp=Object.defineProperty,_v=Object.getOwnPropertyDescriptor,Tv=(e,t)=>qp(e,"name",{value:t,configurable:!0}),Me=(e,t,n,r)=>{for(var o=r>1?void 0:r?_v(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&qp(t,n,o),o};let le=class extends HTMLElement{constructor(){super(...arguments);this.url="",this.csrf="",this.instrument="",this.column=1}get isDisabled(){var e;return(e=this.read)==null?void 0:e.hasAttribute("disabled")}set hasErrored(e){e?this.setAttribute("errored",""):this.removeAttribute("errored")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get hasExpanded(){return this.read.getAttribute("aria-expanded")==="true"}connectedCallback(){var e,t;this.disabled=(t=(e=this.read)==null?void 0:e.disabled)!=null?t:!0,this.querySelector("details")!==null&&this.classList.toggle("no-pointer")}handleDetailsSelect(e){var t;const n=e,r=e.target,o=(t=n.detail)==null?void 0:t.relatedTarget,s=r.closest("details"),i=s==null?void 0:s.querySelector("[data-menu-button]");if(o.getAttribute("aria-checked")==="true"){o.setAttribute("aria-checked","false"),e.preventDefault();for(const a of this.inputs)if(o.contains(a)){this.updateCell(a.name,""),(i==null?void 0:i.innerHTML)&&(i.innerHTML=a.placeholder);break}s==null||s.removeAttribute("open")}}handleDetailsSelected(e){var t;const r=(t=e.detail)==null?void 0:t.relatedTarget;for(const o of this.inputs)if(r.contains(o)){this.updateCell(o.name,o.value);break}}mouseDownFocus(e){!this.isDisabled||this.onFocus(e)}keyDownFocus(e){(e.code==="Enter"||e.code==="Space")&&this.read!==document.activeElement&&this.onFocus(e)}onChange(e){var t,n;e.target.getAttribute("type")!=="date"&&this.updateCell((t=this.read)==null?void 0:t.name,(n=this.read)==null?void 0:n.value)}onFocus(e){e.preventDefault(),this.disabled=!1,this.read.disabled=!1,this.read.focus()}onBlur(e){var t,n;if(this.hasExpanded){e.preventDefault();return}e.target.getAttribute("type")==="date"&&this.updateCell((t=this.read)==null?void 0:t.name,(n=this.read)==null?void 0:n.value),this.read.disabled=!0,this.disabled=!0}onKeyDown(e){if(e.code==="Enter"||e.code==="Tab"){if(e.preventDefault(),e.stopPropagation(),this.hasExpanded)return;this.read.blur()}}async updateCell(e="",t=""){const n=new FormData;n.set(e,t),n.set("ui",this.instrument);for(const o of this.parameters)n.set(o.name,o.value);const r=Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});try{if(this.write){const d=this.read.value,m=this.read.type==="date"&&d?r.format(Date.parse(d)):d;this.write.innerHTML=d?m:this.read.placeholder}const o=await fetch(this.url,{method:"PUT",body:n,headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest","Scoped-CSRF-Token":`${this.csrf}`}});if(!o.ok)throw new Error("connection error");if(!this.write)return;const a=(await o.json()).memexProjectItem.memexProjectColumnValues.find(d=>d.memexProjectColumnId===Number(this.column)).value,c=this.read.type==="date"?Date.parse(a.value):a.html,l=this.read.type==="date"&&c?r.format(c):c;this.write.innerHTML=t?l:this.read.placeholder}catch{this.hasErrored=!0}}};Tv(le,"SidebarMemexInputElement"),Me([se],le.prototype,"url",2),Me([se],le.prototype,"csrf",2),Me([se],le.prototype,"instrument",2),Me([se],le.prototype,"column",2),Me([te],le.prototype,"inputs",2),Me([y],le.prototype,"read",2),Me([y],le.prototype,"write",2),Me([te],le.prototype,"parameters",2),le=Me([I],le);var Cv=Object.defineProperty,ue=(e,t)=>Cv(e,"name",{value:t,configurable:!0});function qt(e,t=!1){(t||!Ip(e))&&(e instanceof HTMLFormElement?V(e):Cn(e))}ue(qt,"submitForm");function ea(e){const t=e.currentTarget,n=t.closest(".js-issue-sidebar-form")||t.querySelector(".js-issue-sidebar-form");qt(n)}ue(ea,"submitOnMenuClose"),f("details-menu-selected",".js-discussion-sidebar-menu",function(e){const t=e.detail.relatedTarget,n=e.currentTarget,r=t.closest(".js-issue-sidebar-form"),o=n.hasAttribute("data-multiple");if(t.hasAttribute("data-clear-assignees")){const s=n.querySelectorAll('input[name="issue[user_assignee_ids][]"]:checked');for(const i of s)i.disabled=!1,i.checked=!1;qt(r)}else o?n.closest("details").addEventListener("toggle",ea,{once:!0}):qt(r)},{capture:!0});function $p(e,t){e.replaceWith(fe(document,t))}ue($p,"updateSidebar"),M(".js-issue-sidebar-form",async function(e,t){const n=await t.html();e.closest(".js-discussion-sidebar-item").replaceWith(n.html)}),f("click","div.js-issue-sidebar-form .js-suggested-reviewer",function(e){const t=e.currentTarget,n=t.closest(".js-issue-sidebar-form");Cn(n,"post",{name:t.name,value:t.value}),e.preventDefault()}),f("click","div.js-issue-sidebar-form .js-issue-assign-self",function(e){var t;const n=e.currentTarget,r=n.closest(".js-issue-sidebar-form");Cn(r,"post",{name:n.name,value:n.value}),n.remove(),(t=document.querySelector("form#new_issue .is-submit-button-value"))==null||t.remove(),e.preventDefault()}),f("click",".js-issue-unassign-self",function(e){const t=e.currentTarget.closest(".js-issue-sidebar-form");Cn(t,"delete"),e.preventDefault()}),M(".js-pages-preview-toggle-form",async function(e,t){const n=await t.json();e.querySelector("button.btn").textContent=n.json.new_button_value});async function Cn(e,t="post",n){const r=ta(e);n&&r.append(n.name,n.value);const o=e.getAttribute("data-url");if(!o)return;const s=e.querySelector(".js-data-url-csrf"),i=await fetch(o,{method:t,body:t==="delete"?"":r,mode:"same-origin",headers:{"Scoped-CSRF-Token":s.value,"X-Requested-With":"XMLHttpRequest"}});if(!i.ok)return;const a=await i.text();$p(e.closest(".js-discussion-sidebar-item"),a)}ue(Cn,"previewSubmit");function Ip(e){const t=e.getAttribute("data-reviewers-team-size-check-url");if(!t)return!1;const n=[...document.querySelectorAll(".js-reviewer-team")].map(a=>a.getAttribute("data-id")),r=e instanceof HTMLFormElement?new FormData(e):ta(e),s=new URLSearchParams(r).getAll("reviewer_team_ids[]").filter(a=>!n.includes(a));if(s.length===0)return!1;const i=new URLSearchParams(s.map(a=>["reviewer_team_ids[]",a]));return Fp(e,`${t}?${i}`),!0}ue(Ip,"reviewerTeamsCheckRequired");async function Fp(e,t){const n=await fetch(t);if(!n.ok)return;const r=await n.text();if(r.match(/[^\w-]js-large-team[^\w-]/))Op(e,r);else{qt(e,!0);return}}ue(Fp,"triggerTeamReviewerCheck");function Op(e,t){const n=e.querySelector(".js-large-teams-check-warning-container");for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(fe(document,t));const r=n.querySelector("details");function o(s){if(s.target instanceof Element){if(r.open=!1,!s.target.classList.contains("js-large-teams-request-button")){const i=e.querySelectorAll("input[name='reviewer_team_ids[]']");for(const a of i)n.querySelector(`.js-large-team[data-id='${a.value}']`)&&(a.checked=!1)}qt(e,!0),s.preventDefault()}}ue(o,"dialogAction"),n.querySelector(".js-large-teams-request-button").addEventListener("click",o,{once:!0}),n.querySelector(".js-large-teams-do-not-request-button").addEventListener("click",o,{once:!0}),r.addEventListener("details-dialog-close",o,{once:!0}),r.open=!0}ue(Op,"showTeamReviewerConfirmationDialog"),f("click","div.js-project-column-menu-container .js-project-column-menu-item button",async function(e){const t=e.currentTarget;Rp(t);const n=t.getAttribute("data-url"),r=t.parentElement.querySelector(".js-data-url-csrf"),o=t.getAttribute("data-card-id"),s=new FormData;if(s.append("card_id",o),s.append("use_automation_prioritization","true"),e.preventDefault(),!(await fetch(n,{method:"PUT",mode:"same-origin",body:s,headers:{"Scoped-CSRF-Token":r.value,"X-Requested-With":"XMLHttpRequest"}})).ok)return;const a=document.activeElement,c=t.closest(".js-project-column-menu-dropdown");if(a&&c.contains(a))try{a.blur()}catch{}});function Rp(e){const n=e.closest(".js-project-column-menu-dropdown").querySelector(".js-project-column-menu-summary"),r=e.getAttribute("data-column-name");n.textContent=r}ue(Rp,"updateProjectColumnMenuSummary"),f("click",".js-prompt-dismiss",function(e){e.currentTarget.closest(".js-prompt").remove()});function ta(e){const t=e.closest("form"),r=new FormData(t).entries(),o=new FormData;for(const[s,i]of r)t.contains(Dp(t,s,i.toString()))&&o.append(s,i);return o}ue(ta,"scopedFormData");function Dp(e,t,n){for(const r of e.elements)if((r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLButtonElement)&&r.name===t&&r.value===n)return r;return null}ue(Dp,"findParam"),f("click",".js-convert-to-draft",function(e){const t=e.currentTarget.getAttribute("data-url"),n=e.currentTarget.parentElement.querySelector(".js-data-url-csrf");fetch(t,{method:"POST",mode:"same-origin",headers:{"Scoped-CSRF-Token":n.value,"X-Requested-With":"XMLHttpRequest"}})}),f("click","div.js-restore-item",async function(e){const t=e.currentTarget.getAttribute("data-url"),n=e.currentTarget.getAttribute("data-column"),r=e.currentTarget.querySelector(".js-data-url-csrf"),o=new FormData;if(o.set("memexProjectItemIds[]",n),!(await fetch(t,{method:"PUT",mode:"same-origin",body:o,headers:{"Scoped-CSRF-Token":r.value,"X-Requested-With":"XMLHttpRequest"}})).ok)throw new Error("connection error");ea(e)}),C("launch-code",()=>k.import("./chunk-launch-code-element.js")),C("metric-selection",()=>k.import("./chunk-metric-selection-element.js")),C("severity-calculator",()=>k.import("./chunk-severity-calculator-element.js")),C("command-palette-page",()=>k.import("./chunk-command-palette-page-element.js")),C("command-palette-page-stack",()=>k.import("./chunk-command-palette-page-stack-element.js")),C("readme-toc",()=>k.import("./chunk-readme-toc-element.js")),C("delayed-loading",()=>k.import("./chunk-delayed-loading-element.js")),C("feature-callout",()=>k.import("./chunk-feature-callout-element.js")),C("codespaces-policy-form",()=>k.import("./chunk-codespaces-policy-form-element.js")),C("action-list",()=>k.import("./chunk-action-list-element.js")),C("memex-project-picker",()=>k.import("./chunk-memex-project-picker-element.js")),C("project-picker",()=>k.import("./chunk-project-picker-element.js")),C("profile-pins",()=>k.import("./chunk-profile-pins-element.js")),C("emoji-picker",()=>k.import("./chunk-emoji-picker-element.js")),C("edit-hook-secret",()=>k.import("./chunk-edit-hook-secret-element.js")),C("insights-query",()=>k.import("./chunk-insights-query.js")),C("remote-clipboard-copy",()=>k.import("./chunk-remote-clipboard-copy.js")),C("series-table",()=>k.import("./chunk-series-table.js")),C("line-chart",()=>k.import("./chunk-line-chart.js")),C("bar-chart",()=>k.import("./chunk-bar-chart.js")),C("stacked-area-chart",()=>k.import("./chunk-stacked-area-chart.js")),C("presence-avatars",()=>k.import("./chunk-presence-avatars.js")),C("pulse-authors-graph",()=>k.import("./chunk-pulse-authors-graph-element.js")),C("stacks-input-config-view",()=>k.import("./chunk-stacks-input-config-view.js")),C("community-contributions-graph",()=>k.import("./chunk-community-contributions.js")),C("discussion-page-views-graph",()=>k.import("./chunk-discussion-page-views.js")),C("discussions-daily-contributors",()=>k.import("./chunk-discussions-daily-contributors.js")),C("discussions-new-contributors",()=>k.import("./chunk-discussions-new-contributors.js")),C("code-frequency-graph",()=>k.import("./chunk-code-frequency-graph-element.js"))}}});
|
|
//# sourceMappingURL=behaviors-afda55e1.js.map
|