HEX
Server: Apache
System: Linux efa57bbe-abb1-400d-2985-3b056fbc2701.secureserver.net 6.1.147-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 24 12:33:32 EDT 2025 x86_64
User: root (0)
PHP: 8.0.30.4
Disabled: NONE
Upload Files
File: /var/www/wp-content/plugins/pojo-accessibility/assets/build/remediation-module.js
(()=>{"use strict";const e="update",t="remove";class i{constructor(e,t){this.dom=e,this.data=t}run(){throw new Error(`Action type '${this.data.type}' - not implemented`)}getElementByXPath(e){return this.dom.evaluate(e,this.dom,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}createElement(e,t=[],i=""){const n=document.createElement(e);return t.forEach(e=>{n.setAttribute(e.name,e.value)}),i&&(n.textContent=i),n}}class n extends i{run(){const{xpath:i,action:n,attribute_name:r,attribute_value:s}=this.data,a=i.replace("svg","*[name()='svg']"),o=this.getElementByXPath(a);if(!o)return!1;switch(n){case"add":case e:o.setAttribute(r,s);const i={alt:["role","title"],role:["alt","title"]};i[r]&&i[r].forEach(e=>o.removeAttribute(e));break;case t:o.removeAttribute(r);break;case"clear":o.setAttribute(r,"")}return!0}}class r extends i{run(){const{xpath:i,action:n,content:r,child:s}=this.data,a=this.getElementByXPath(i);if(!a)return!1;let o=null;if(s)try{o=this.createElement(s.tag,s.attributes||[],s.content||"")}catch(e){return}switch(n){case e:a.nodeValue=r;break;case t:a.remove();break;case"add_child":o&&a.appendChild(o);break;case"remove_child":o&&a.removeChild(o);break;case"add_before":o&&a.parentNode&&a.parentNode.insertBefore(o,a);break;case"add_after":o&&a.parentNode&&a.parentNode.insertBefore(o,a.nextSibling)}return!0}}class s extends i{replaceIgnoreCase(e,t,i,n,r){const s=n.indexOf(r);return-1===s?e:e.substring(0,s)+i+e.substring(s+t.length)}run(){const{xpath:e,find:t,replace:i}=this.data,n=this.getElementByXPath(e);if(!n)return!1;const r=n.outerHTML;if("string"!=typeof t||"string"!=typeof i)return!1;const s=r.toLowerCase(),a=t.toLowerCase();if(!s.includes(a))return!1;const o=this.replaceIgnoreCase(r,t,i,s,a);if(o===r)return!1;const l=document.createElement("div");l.innerHTML=o;const d=l.firstElementChild;return d&&n.parentNode&&n.parentNode.replaceChild(d,n),!0}}class a extends i{constructor(e,t){super(e,t),this.maybeAddStyleTag()}maybeAddStyleTag(){let e=this.dom.querySelector("style#ea11y-remediation-styles");e||(e=this.dom.createElement("style"),e.id="ea11y-remediation-styles",this.dom.body.appendChild(e))}getStyleTag(){return this.dom.querySelector("style#ea11y-remediation-styles")}isValidCSS(e){try{return!(!e||"string"!=typeof e)&&(![/@import/i,/javascript:/i,/expression\s*\(/i,/behavior\s*:/i,/binding\s*:/i,/-moz-binding/i].some(t=>t.test(e))&&/^[\s\S]*\{\s*[\s\S]+:\s*[\s\S]+;\s*\}[\s\S]*$/.test(e.replace(/\s+/g," ").trim()))}catch(e){return!1}}run(){const e=this.getStyleTag();return!!e&&(this.isValidCSS(this.data.rule)&&(e.innerText+=this.data.rule),!0)}}class o{constructor(e){this.remediations=e,this.classMap={attribute:n,element:r,replace:s,styles:a},this.checkTimeout=null,this.runAll()}runAll(){this.remediations=this.remediations.filter(e=>!this.runRemediation(e))}runRemediation(e){const t=(e.type||"").toLowerCase(),i=this.classMap[t];if(i)try{return new i(document,e).run()}catch(t){window.AllyRemediations?.debug&&window.AllyRemediations.debug&&console.error("Remediation failed",t,e)}return!1}checkRemediations(){this.isComplete()||this.runAll()}isComplete(){return 0===this.remediations.length}}if(window?.AllyRemediations&&Array.isArray(window.AllyRemediations?.remediations)){let l=null,d=null,c=!1;function u(){c?l.runAll():(c=!0,l=new o(window.AllyRemediations.remediations),window.MutationObserver&&l.remediations.length>0&&(d=new MutationObserver(e=>{let t=!1;for(const i of e)if("childList"===i.type&&i.addedNodes.length>0){t=!0;break}t&&(clearTimeout(l.checkTimeout),l.checkTimeout=setTimeout(()=>{l.checkRemediations(),l.isComplete()&&d&&(d.disconnect(),d=null)},100))}),d.observe(document.body,{childList:!0,subtree:!0})))}window.addEventListener("DOMContentLoaded",function(){setTimeout(()=>{u()},400)}),"loading"!==document.readyState&&setTimeout(()=>{u()},400)}})();