(function(){"use strict";/**
 * @copyright  (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */(function(a,i){var e=function o(){window.removeEventListener("load",o);var c=[].slice.call(a.querySelectorAll(".system-counter"));c.length&&c.forEach(function(s){var n=s.getAttribute("data-url");n&&i&&i.request&&typeof i.request=="function"&&i.enqueueRequest({url:n,method:"POST",promise:!0}).then(function(d){var u=d.responseText,t;try{t=JSON.parse(u)}catch{throw new Error("Failed to parse JSON")}if(t.error||!t.success)s.classList.remove("icon-spin"),s.classList.remove("icon-spinner"),s.classList.add("text-danger"),s.classList.add("icon-remove");else if(t.data){var r=a.createElement("span");r.classList.add("float-end"),r.classList.add("badge"),r.classList.add("bg-warning","text-dark"),r.innerHTML=i.sanitizeHtml(t.data),s.parentNode.replaceChild(r,s)}else s.classList.remove("icon-spin"),s.classList.remove("icon-spinner"),s.classList.add("icon-check"),s.classList.add("text-success")}).catch(function(){s.classList.remove("icon-spin"),s.classList.remove("icon-spinner"),s.classList.add("text-danger"),s.classList.add("icon-remove")})})};window.addEventListener("load",function(){setTimeout(e,300)})})(document,Joomla)})();
