Sid Gifari File Manager
🏠 Root
/
home1
/
plant149
/
wildlifesupport.net
/
wp-content
/
plugins
/
ezoic-integration
/
admin
/
js
/
Editing: ad-select-elements.js
(()=>{"use strict";function e(e){return"object"==typeof e&&null!==e&&e.nodeType===Node.ELEMENT_NODE}const t={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"};function n(e="unknown problem",...t){console.warn(`CssSelectorGenerator: ${e}`,...t)}const o={selectors:[t.id,t.class,t.tag,t.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function r(e){return e instanceof RegExp}function i(e){return["string","function"].includes(typeof e)||r(e)}function l(e){return Array.isArray(e)?e.filter(i):[]}function s(e){const t=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(e){return e instanceof Node}(e)&&t.includes(e.nodeType)}function c(e,t){if(s(e))return e.contains(t)||n("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element's real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will not work as intended."),e;const o=t.getRootNode({composed:!1});return s(o)?(o!==document&&n("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),o):h(t)}function a(e){return"number"==typeof e?e:Number.POSITIVE_INFINITY}function u(e=[]){const[t=[],...n]=e;return 0===n.length?t:n.reduce((e,t)=>e.filter(e=>t.includes(e)),t)}function d(e){const t=e.map(e=>{if(r(e))return t=>e.test(t);if("function"==typeof e)return t=>{const o=e(t);return"boolean"!=typeof o?(n("pattern matcher function invalid","Provided pattern matching function does not return boolean. It's result will be ignored.",e),!1):o};if("string"==typeof e){const t=new RegExp("^"+e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".+")+"$");return e=>t.test(e)}return n("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",e),()=>!1});return e=>t.some(t=>t(e))}function m(e,t,n){const o=Array.from(c(n,e[0]).querySelectorAll(t));return o.length===e.length&&e.every(e=>o.includes(e))}function f(t,n){n=null!=n?n:h(t);const o=[];let r=t;for(;e(r)&&r!==n;)o.push(r),r=r.parentElement;return o}function p(e,t){return u(e.map(e=>f(e,t)))}function h(e){return e.ownerDocument.querySelector(":root")}const g=new RegExp(["^$","\\s"].join("|")),y=new RegExp(["^$"].join("|")),v=[t.nthoftype,t.tag,t.id,t.class,t.attribute,t.nthchild],b=d(["class","id","ng-*"]);function E({name:e}){return`[${e}]`}function w({name:e,value:t}){return`[${e}='${t}']`}function x({nodeName:e,nodeValue:t}){return{name:j(e),value:j(null!=t?t:void 0)}}function C(e){const t=Array.from(e.attributes).filter(t=>function({nodeName:e,nodeValue:t},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===e||"src"===e&&(null==t?void 0:t.startsWith("data:"))||b(e))}(t,e)).map(x);return[...t.map(E),...t.map(w)]}function S(e){var t;return(null!==(t=e.getAttribute("class"))&&void 0!==t?t:"").trim().split(/\s+/).filter(e=>!y.test(e)).map(e=>`.${j(e)}`)}function N(e){var t;const n=null!==(t=e.getAttribute("id"))&&void 0!==t?t:"",o=`#${j(n)}`,r=e.getRootNode({composed:!1});return!g.test(n)&&m([e],o,r)?[o]:[]}function k(e){var t;const n=null===(t=e.parentElement)||void 0===t?void 0:t.children;if(n)for(let t=0;t<n.length;t++)if(n[t]===e)return[`:nth-child(${String(t+1)})`];return[]}function I(e){return[j(e.tagName.toLowerCase())]}function L(e){const t=[...new Set((n=e.map(I),[].concat(...n)))];var n;return 0===t.length||t.length>1?[]:[t[0]]}function T(e){const t=L([e])[0],n=e.parentElement;if(n){const o=Array.from(n.children).filter(e=>e.tagName.toLowerCase()===t),r=o.indexOf(e);if(r>-1)return[`${t}:nth-of-type(${String(r+1)})`]}return[]}function*z(e=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){let n=0,o=A(1);for(;o.length<=e.length&&n<t;){n+=1;const t=o.map(t=>e[t]);yield t,o=O(o,e.length-1)}}function O(e=[],t=0){const n=e.length;if(0===n)return[];const o=[...e];o[n-1]+=1;for(let e=n-1;e>=0;e--)if(o[e]>t){if(0===e)return A(n+1);o[e-1]++,o[e]=o[e-1]+1}return o[n-1]>t?A(n+1):o}function A(e=1){return Array.from(Array(e).keys())}const _=":".charCodeAt(0).toString(16).toUpperCase(),R=/[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;function j(e=""){return CSS?CSS.escape(e):function(e=""){return e.split("").map(e=>":"===e?`\\${_} `:R.test(e)?`\\${e}`:escape(e).replace(/%/g,"\\")).join("")}(e)}const B={tag:L,id:function(e){return 0===e.length||e.length>1?[]:N(e[0])},class:function(e){return u(e.map(S))},attribute:function(e){return u(e.map(C))},nthchild:function(e){return u(e.map(k))},nthoftype:function(e){return u(e.map(T))}},$={tag:I,id:N,class:S,attribute:C,nthchild:k,nthoftype:T};function M(e){return e.includes(t.tag)||e.includes(t.nthoftype)?[...e]:[...e,t.tag]}function*D(e,t){const n={};for(const o of e){const e=t[o];e&&e.length>0&&(n[o]=e)}for(const e of function*(e={}){const t=Object.entries(e);if(0===t.length)return;const n=[{index:t.length-1,partial:{}}];for(;n.length>0;){const e=n.pop();if(!e)break;const{index:o,partial:r}=e;if(o<0){yield r;continue}const[i,l]=t[o];for(let e=l.length-1;e>=0;e--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:l[e]})})}}(n))yield P(e)}function P(e={}){const n=[...v];return e[t.tag]&&e[t.nthoftype]&&n.splice(n.indexOf(t.tag),1),n.map(t=>{return(o=e)[n=t]?o[n].join(""):"";var n,o}).join("")}function W(e,t){return[...e.map(e=>t+" "+e),...e.map(e=>t+" > "+e)]}function*V(e,t,n="",o){const r=function*(e,t){const n=new Set,o=function(e,t){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=t,l=d(n),s=d(o);return function(e){const{selectors:t,includeTag:n}=e,o=[...t];return n&&!o.includes("tag")&&o.push("tag"),o}(t).reduce((t,n)=>{const o=function(e,t){return(0,B[t])(e)}(e,n),c=function(e=[],t,n){return e.filter(e=>n(e)||!t(e))}(o,l,s),a=function(e=[],t){return e.sort((e,n)=>{const o=t(e),r=t(n);return o&&!r?-1:!o&&r?1:0})}(c,s);return t[n]=r?Array.from(z(a,{maxResults:i})):a.map(e=>[e]),t},{})}(e,t);for(const e of function*(e,t){for(const n of function(e){const{selectors:t,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=e,i=n?function(e=[],{maxResults:t=Number.POSITIVE_INFINITY}={}){return Array.from(z(e,{maxResults:t}))}(t,{maxResults:r}):t.map(e=>[e]);return o?i.map(M):i}(t))yield*D(n,e)}(o,t))n.has(e)||(n.add(e),yield e)}(e,o);for(const o of function*(e,t){if(""===t)yield*e;else for(const n of e)yield*W([n],t)}(r,n))m(e,o,t)&&(yield o)}function*Y(e,t,n="",o){if(0===e.length)return null;const r=[e.length>1?e:[],...p(e,t).map(e=>[e])];for(const e of r)for(const r of V(e,t,n,o))yield{foundElements:e,selector:r}}function q(e){return{value:e,include:!1}}function F({selectors:e,operator:n}){let o=[...v];e[t.tag]&&e[t.nthoftype]&&(o=o.filter(e=>e!==t.tag));let r="";return o.forEach(t=>{var n;(null!==(n=e[t])&&void 0!==n?n:[]).forEach(({value:e,include:t})=>{t&&(r+=e)})}),n+r}function G(e,n){return e.map(e=>function(e,n){return[n?":scope":":root",...f(e,n).reverse().map(e=>{var n;const o=function(e,t,n=""){const o={};return t.forEach(t=>{Reflect.set(o,t,function(e,t){return $[t](e)}(e,t).map(q))}),{element:e,operator:n,selectors:o}}(e,[t.nthchild]," > ");return(null!==(n=o.selectors.nthchild)&&void 0!==n?n:[]).forEach(e=>{e.include=!0}),o}).map(F)].join("")}(e,n)).join(", ")}function U(n,r={}){const i=function*(n,r={}){var i;const s=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const n=(Array.isArray(t)?t:[t]).filter(e);return[...new Set(n)]}(n),u=function(e,n={}){const r=Object.assign(Object.assign({},o),n);return{selectors:(i=r.selectors,Array.isArray(i)?i.filter(e=>{return n=t,o=e,Object.values(n).includes(o);var n,o}):[]),whitelist:l(r.whitelist),blacklist:l(r.blacklist),root:c(r.root,e),combineWithinSelector:!!r.combineWithinSelector,combineBetweenSelectors:!!r.combineBetweenSelectors,includeTag:!!r.includeTag,maxCombinations:a(r.maxCombinations),maxCandidates:a(r.maxCandidates),useScope:!!r.useScope,maxResults:a(r.maxResults)};var i}(s[0],r),d=null!==(i=u.root)&&void 0!==i?i:h(s[0]);let f=0;for(const e of function*({elements:e,root:t,rootSelector:n="",options:o}){let r=t,i=n,l=!0;for(;l;){let n=!1;for(const l of Y(e,r,i,o)){const{foundElements:o,selector:s}=l;if(n=!0,!m(e,s,t)){r=o[0],i=s;break}yield s}n||(l=!1)}}({elements:s,options:u,root:d,rootSelector:""}))if(yield e,f++,f>=u.maxResults)return;s.length>1&&(yield s.map(e=>U(e,u)).join(", "),f++,f>=u.maxResults)||(yield G(s,u.useScope?d:void 0))}(n,Object.assign(Object.assign({},r),{maxResults:1}));return i.next().value}window.EzOutline=function(e){var t=["div","p","header","footer","h1","h2","h3","h4","table","img"],n=["ez_wp_select_element_ui"],o={},r={opts:{namespace:(e=e||{}).namespace||"ez-outline",borderWidth:e.borderWidth||2,click:e.click||!1,filter:e.filter||!1},active:!1,initialized:!1,elements:{},selected:{}};function i(e){var t=!1;return n.forEach(function(n){e.classList.contains(n)&&(t=!0)}),t}function l(e){var t=U(e.target,{selectors:["id","class","tag","nthchild"],blacklist:["data-*","style","body"],includeTag:!1,maxCandidates:10,maxCombinations:5,combineBetweenSelectors:!1,root:document.body});return!!t&&(t=(t=t.replace(/nth-child/g,"eq")).replace(/nth-of-type/g,"eq"),o.stop(),r.selected.element=e.target,r.selected.backgroundColor=o.element.style.backgroundColor,document.getElementById("ez-elementor-selector-xpath").value=t,r.opts.click(o.element,t),!1)}function s(e){27===e.keyCode&&(o.element.style.backgroundColor=r.selected.backgroundColor,r.selected.element=null,document.getElementById("ez-elementor-selector-xpath").value="",o.start())}function c(e){if(r.opts.filter&&!r.opts.filter.includes(e.target.tagName.toLowerCase()))return!1;for(var t=e.target;t;){if(i(t))return!1;t=t.parentElement}l.call(this,e)}function a(e){if(!e.target.classList.contains(r.opts.namespace)&&(!t||t.includes(e.target.tagName.toLowerCase()))&&!i(e.target)){o.element=e.target,e.target.style.cursor="crosshair";var n=r.opts.borderWidth,l=(r.elements.window||(r.elements.window=window),r.elements.window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),s=o.element.getBoundingClientRect(),c=s.top+l;r.elements.top.style.top=Math.max(0,c-n)+"px",r.elements.top.style.left=s.left-n+"px",r.elements.top.style.width=s.width+n+"px",r.elements.top.style.height=n+"px",r.elements.bottom.style.top=c+s.height+"px",r.elements.bottom.style.left=s.left-n+"px",r.elements.bottom.style.width=s.width+n+"px",r.elements.bottom.style.height=n+"px",r.elements.left.style.top=c-n+"px",r.elements.left.style.left=Math.max(0,s.left-n)+"px",r.elements.left.style.width=n+"px",r.elements.left.style.height=s.height+n+"px",r.elements.right.style.top=c-n+"px",r.elements.right.style.left=s.left+s.width+"px",r.elements.right.style.width=n+"px",r.elements.right.style.height=s.height+2*n+"px"}}return o.start=function(){!function(){if(!r.initialized){var e="."+r.opts.namespace+" {background:#09c;position:absolute;z-index:1000000;}",t=document.createElement("style");t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.innerHTML=e,r.initialized=!0}}(),r.active||(r.active=!0,function(){var e=document.createElement("div");e.classList.add(r.opts.namespace),e.classList.add(r.opts.namespace+"-top"),document.body.appendChild(e),r.elements.top=e;var t=document.createElement("div");t.classList.add(r.opts.namespace),t.classList.add(r.opts.namespace+"-bottom"),document.body.appendChild(t),r.elements.bottom=t;var n=document.createElement("div");n.classList.add(r.opts.namespace),n.classList.add(r.opts.namespace+"-left"),document.body.appendChild(n),r.elements.left=n;var o=document.createElement("div");o.classList.add(r.opts.namespace),o.classList.add(r.opts.namespace+"-right"),document.body.appendChild(o),r.elements.right=o}(),document.body.addEventListener("mousemove",a,!1),document.addEventListener("keyup",s),r.opts.click&&window.setTimeout(function(){document.body.addEventListener("click",c,!1)},50))},o.stop=function(){r.active&&(r.active=!1,document.body.removeChild(r.elements.top),document.body.removeChild(r.elements.bottom),document.body.removeChild(r.elements.left),document.body.removeChild(r.elements.right),document.body.removeEventListener("mousemove",a,!1),document.body.removeEventListener("keyup",s,!1),document.body.removeEventListener("click",c,!1))},o.navigate=function(e){var t=document.createElement("form");t.setAttribute("method","post"),t.setAttribute("action",e),t.setAttribute("target","_self");var n=document.createElement("input");n.type="hidden",n.name="ez_wp_select_element",n.value="true",t.appendChild(n),document.body.appendChild(t),t.submit(),document.body.removeChild(t)},o},document.addEventListener("DOMContentLoaded",function(){var e=null,t=null,n=EzOutline({click:function(n,o){e=n,t=n.style.backgroundColor,n.style.backgroundColor="#c3d8fa",document.getElementById("ez-elementor-selector-xpath").value=o}});document.addEventListener("click",function(e){e.target.matches("a[href], a[href] *")&&(e.preventDefault(),n.navigate(e.target.getAttribute("href")))},!1);var o=document.createElement("div");o.classList.add("ez_wp_select_element_ui"),o.innerHTML='<div class="ez_wp_container"><img src="/wp-content/plugins/ezoic-integration/admin/img/ezoic-logo.png" height="16" /><div class="form"><div class="control"><span class="label">Selected Element:</span><span class="selector-field"><input type="text" id="ez-elementor-selector-xpath" /></span><button id="ez-element-selector-use">Use This Element</button><button id="ez-element-selector-reselect" title="Reselect Element" style="background: transparent;"><svg width="16" height="16" viewBox="0 0 24 24" fill="black"><path d="M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"/></svg></button></div><div class="control"><span class="label">Go to Page:</span><span class="selector-field"><input type="text" id="ez-elementor-selector-url" /></span><button id="ez-element-selector-nav" style="background-color: black; color: white;">Go</button></div></div></div>',document.body.prepend(o),document.getElementById("ez-element-selector-reselect").addEventListener("click",function(o){document.getElementById("ez-elementor-selector-xpath").value="",e&&(e.style.backgroundColor=t||"",e=null,t=null),n.start()}),document.getElementById("ez-element-selector-use").addEventListener("click",function(e){var t=document.getElementById("ez-elementor-selector-xpath");window.opener.postMessage('{"action":"select-element","xpath":"'+t.value+'"}',"*"),window.close()}),document.getElementById("ez-element-selector-nav").addEventListener("click",function(e){n.navigate(document.getElementById("ez-elementor-selector-url").value)}),n.start()}),window.EzoicAdSettings={}})();
Save
Cancel