1var y=Object.defineProperty;var T=(s,n,e)=>n in s?y(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e;var i=(s,n,e)=>T(s,typeof n!="symbol"?n+"":n,e);import{C as f,t as F,r as g,c as A}from"../application.3a13dd1a.js";const E="footer";class u extends f{constructor(){super(...arguments);i(this,"id",null);i(this,"replyingTo",null);i(this,"replyForm",null);i(this,"replyFooter",null)}initialize(){this.onToggleClick=this.onToggleClick.bind(this)}connect(){const{element:e,toggleTarget:t,contentTarget:r}=this,{hash:o}=window.location,l=o&&(e.matches(o)||e.querySelector(o));this.replyFormTemplate=F(this.replyFormTemplateTarget.innerHTML);const c=t.id||`comments-toggle-${g(10)}`,a=r.id||`comments-content-${g(10)}`;t.id=c,t.setAttribute("aria-controls",a),r.id=a,r.setAttribute("aria-labelledby",c),t.addEventListener("click",this.onToggleClick,!1),requestAnimationFrame(()=>{this.toggle(l?!1:this.hiddenValue)})}toggle(e){const{toggleTarget:t,contentTarget:r}=this,o=r.matches('[aria-hidden="true"]'),l=e!==void 0?e:!o;t.setAttribute("aria-expanded",!l),r.setAttribute("aria-hidden",l)}onToggleClick(){requestAnimationFrame(()=>{this.toggle()})}reply({target:e,params:{id:t,replyTarget:r,name:o}}){if(this.replyingTo===t)return;const l=e.closest(`#${r}`),c=this.replyFormTemplate({replyCommentId:t,replyCommentName:o}).trim(),a=document.createElement("div");a.innerHTML=c;const m=a.firstChild;this.cancelReply(),this.replyingTo=t;const d=A();document.body.prepend(d),d.focus(),requestAnimationFrame(()=>{const p=l.querySelector(E);this.replyForm=m,this.replyFooter=p,l.insertBefore(m,p),p.hidden=!0,Array.from(m.querySelectorAll("input")).find(h=>!!h.offsetParent).focus(),d.remove()})}cancelReply(){const{replyForm:e,replyFooter:t}=this;e&&requestAnimationFrame(()=>{e.remove(),t.hidden=!1,this.replyingTo=null,this.replyForm=null,this.replyFooter=null})}}i(u,"targets",["toggle","content","replyFormTemplate"]),i(u,"values",{hidden:{type:Boolean,default:!1}});export{u as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.