Current File : /home/pacjaorg/.trash/media.1/system/js/messages.min.js
class AlertElement extends HTMLElement{constructor(){super(),this.close=this.close.bind(this),this.destroyCloseButton=this.destroyCloseButton.bind(this),this.createCloseButton=this.createCloseButton.bind(this),this.onMutation=this.onMutation.bind(this),this.observer=new MutationObserver(this.onMutation),this.observer.observe(this,{attributes:!1,childList:!0,subtree:!0}),this.addEventListener("animationend",t=>{t.animationName==="joomla-alert-fade-in"&&t.target===this&&(this.dispatchEvent(new CustomEvent("joomla.alert.shown")),this.style.removeProperty("animationName"))}),this.addEventListener("animationend",t=>{t.animationName==="joomla-alert-fade-out"&&t.target===this&&(this.dispatchEvent(new CustomEvent("joomla.alert.closed")),this.remove())})}static get observedAttributes(){return["type","role","dismiss","auto-dismiss","close-text"]}get type(){return this.getAttribute("type")}set type(t){this.setAttribute("type",t)}get role(){return this.getAttribute("role")}set role(t){this.setAttribute("role",t)}get closeText(){return this.getAttribute("close-text")}set closeText(t){this.setAttribute("close-text",t)}get dismiss(){return this.getAttribute("dismiss")}set dismiss(t){this.setAttribute("dismiss",t)}get autodismiss(){return this.getAttribute("auto-dismiss")}set autodismiss(t){this.setAttribute("auto-dismiss",t)}connectedCallback(){this.dispatchEvent(new CustomEvent("joomla.alert.show")),this.style.animationName="joomla-alert-fade-in",(!this.type||!["info","warning","danger","success"].includes(this.type))&&this.setAttribute("type","info"),(!this.role||!["alert","alertdialog"].includes(this.role))&&this.setAttribute("role","alert"),this.firstElementChild&&this.firstElementChild.tagName==="BUTTON"&&(this.button=this.firstElementChild,this.button.classList.contains("joomla-alert--close")&&this.button.classList.add("joomla-alert--close"),this.button.innerHTML===""&&(this.button.innerHTML='<span aria-hidden="true">&times;</span>'),this.button.hasAttribute("aria-label")||this.button.setAttribute("aria-label",this.closeText)),this.hasAttribute("dismiss")&&!this.button&&this.createCloseButton(),this.hasAttribute("auto-dismiss")&&this.autoDismiss()}disconnectedCallback(){this.button&&this.button.removeEventListener("click",this.close),this.observer.disconnect()}attributeChangedCallback(t,o,e){switch(t){case"type":(!e||e&&["info","warning","danger","success"].indexOf(e)===-1)&&(this.type="info");break;case"role":(!e||e&&["alert","alertdialog"].indexOf(e)===-1)&&(this.role="alert");break;case"dismiss":(!e||e==="")&&(!o||o==="")?this.button&&!this.hasAttribute("dismiss")?this.destroyCloseButton():!this.button&&this.hasAttribute("dismiss")&&this.createCloseButton():this.button&&e==="false"?this.destroyCloseButton():!this.button&&e!=="false"&&this.createCloseButton();break;case"close-text":(!e||e!==o)&&this.button&&this.button.setAttribute("aria-label",e);break;case"auto-dismiss":this.autoDismiss();break}}onMutation(t){for(const o of t)o.type==="childList"&&o.addedNodes.length&&this.button&&this.firstElementChild!==this.button&&this.prepend(this.button)}close(){this.dispatchEvent(new CustomEvent("joomla.alert.close")),this.style.animationName="joomla-alert-fade-out"}createCloseButton(){this.button=document.createElement("button"),this.button.setAttribute("type","button"),this.button.classList.add("joomla-alert--close"),this.button.innerHTML='<span aria-hidden="true">&times;</span>',this.button.setAttribute("aria-label",this.closeText),this.insertAdjacentElement("afterbegin",this.button),this.button.addEventListener("click",this.close)}destroyCloseButton(){this.button&&(this.button.removeEventListener("click",this.close),this.button.parentNode.removeChild(this.button),this.button=null)}autoDismiss(){const t=parseInt(this.getAttribute("auto-dismiss"),10);setTimeout(this.close,t>=10?t:3e3)}}customElements.get("joomla-alert")||customElements.define("joomla-alert",AlertElement);/**
 * @copyright  (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */const getMessageContainer=s=>{let t;return s instanceof HTMLElement?s:(typeof s>"u"||s&&s==="#system-message-container"?t=document.getElementById("system-message-container"):t=document.querySelector(s),t)};Joomla.renderMessages=(s,t,o,e)=>{const h=getMessageContainer(t);(typeof o>"u"||o&&o===!1)&&Joomla.removeMessages(h),Object.keys(s).forEach(i=>{let n=i;const u=s[i],a=document.createElement("joomla-alert");if(["success","info","danger","warning"].indexOf(i)<0&&(n=i==="notice"?"info":i,n=i==="message"?"success":n,n=i==="error"?"danger":n,n=i==="warning"?"warning":n),a.setAttribute("type",n),a.setAttribute("close-text",Joomla.Text._("JCLOSE")),a.setAttribute("dismiss",!0),e&&parseInt(e,10)>0&&a.setAttribute("auto-dismiss",e),typeof Joomla.Text._(i)<"u"){const r=document.createElement("div");r.className="alert-heading",r.innerHTML=Joomla.sanitizeHtml(`<span class="${i}"></span><span class="visually-hidden">${Joomla.Text._(i)?Joomla.Text._(i):i}</span>`),a.appendChild(r)}const l=document.createElement("div");l.className="alert-wrapper",u.forEach(r=>{l.innerHTML+=Joomla.sanitizeHtml(`<div class="alert-message">${r}</div>`)}),a.appendChild(l),h.appendChild(a)})},Joomla.removeMessages=s=>{getMessageContainer(s).querySelectorAll("joomla-alert").forEach(o=>o.close())},document.addEventListener("DOMContentLoaded",()=>{const s=Joomla.getOptions("joomla.messages");s&&Object.keys(s).map(t=>Joomla.renderMessages(s[t],void 0,!0,void 0))});
Site is undergoing maintenance

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!