(()=>{"use strict";var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const e=window.wp.domReady;var i=t.n(e);class s{constructor(t,e,i){this.tr=t,this.index=e,this.activeTermId=i}init(){this.details=this.tr.querySelector(".column-details details"),this.details&&(this.createNewTr(),[...this.tr.querySelectorAll(".single-url-detail-toggle"),this.details.querySelector("summary")].forEach((t=>{t.addEventListener("click",(()=>{this.toggle(t)}))}))),this.maybeInitiallyOpenRow()}maybeInitiallyOpenRow(){this.activeTermId&&this.tr.id===`tag-${this.activeTermId}`&&this.toggle(this.tr.querySelector(".single-url-detail-toggle"))}createNewTr(){this.newTr=document.createElement("tr"),this.newTr.classList.add("details");const t=document.createElement("td");t.setAttribute("colspan",this.getRowColspan());for(const e of this.details.childNodes)"SUMMARY"!==e.tagName&&t.appendChild(e.cloneNode(!0));this.newTr.appendChild(t)}getRowColspan(){return[...this.tr.childNodes].filter((t=>["TD","TH"].includes(t.tagName))).length}toggle(t){this.tr.classList.contains("expanded")?this.onClose(t):this.onOpen(t)}onOpen(t){this.tr.parentNode.insertBefore(this.newTr,this.tr.nextSibling),this.tr.classList.add("expanded"),"SUMMARY"!==t.tagName&&this.details.setAttribute("open",!0)}onClose(t){this.tr.parentNode.removeChild(this.newTr),this.tr.classList.remove("expanded"),"SUMMARY"!==t.tagName&&this.details.removeAttribute("open")}}class r{constructor(t){this.rows=[...document.querySelectorAll('.wp-list-table tr[id^="tag-"]')].map(((e,i)=>{const r=new s(e,i,t);return r.init(),r})).filter((t=>t.details))}init(){this.addToggleAllListener()}addToggleAllListener(){let e=!1;const i=[...document.querySelectorAll(".column-details button.error-details-toggle")],s=t=>{e=!e,this.rows.forEach((i=>{e?i.onOpen(t):i.onClose(t)}))};t.g.addEventListener("click",(t=>{i.includes(t.target)&&s(t.target)}))}}i()((()=>{let t=null;const e=window.location.hash.match(/^#tag-(\d+)/);e&&(t=parseInt(e[1])),new r(t).init()}))})();