/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */(()=>{const r=()=>{if(Joomla.getOptions("js-override-check")){const i=Joomla.getOptions("js-override-check"),t=(s,n,e)=>{const o=document.getElementById("plg_quickicon_overridecheck");o&&(o.classList.add(s),e&&o.setAttribute("href",e)),o.querySelectorAll("span.j-links-link").forEach(l=>{l.innerHTML=Joomla.sanitizeHtml(n)})};Joomla.enqueueRequest({url:i.ajaxUrl,method:"GET",promise:!0}).then(s=>{const n=s.responseText,e=JSON.parse(n);if(e.installerOverride!=="disabled")if(Array.isArray(e))e.length===0?t("success",Joomla.Text._("PLG_QUICKICON_OVERRIDECHECK_UPTODATE"),""):(window.scrollTo(0,0),t("danger",Joomla.Text._("PLG_QUICKICON_OVERRIDECHECK_OVERRIDEFOUND").replace("%s",`<span class="badge text-dark bg-light">${e.length}</span>`),""));else throw new Error("Override check: unexpected value type");else t("danger",Joomla.Text._("PLG_QUICKICON_OVERRIDECHECK_ERROR_ENABLE"),`index.php?option=com_plugins&task=plugin.edit&extension_id=${i.pluginId}`)}).catch(()=>{t("danger",Joomla.Text._("PLG_QUICKICON_OVERRIDECHECK_ERROR"),"")})}};window.addEventListener("load",()=>setTimeout(r,390))})();
