Sindbad~EG File Manager
(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.jQuery;var n=t.n(e);const o=window.popupMaker.i18n;let a,c,r;function i(t,e){if(r=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===t.tagName.toLowerCase())return"html";const n={root:document.body,idName:t=>!0,className:t=>!0,tagName:t=>!0,attr:(t,e)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};a={...n,...e},c=function(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}(a.root,n);let o=l(t,"all",()=>l(t,"two",()=>l(t,"one",()=>l(t,"none"))));if(o){const e=T(x(o,t));return e.length>0&&(o=e[0]),p(o)}throw new Error("Selector was not found.")}function l(t,e,n){let o=null,c=[],i=t,l=0;for(;i;){const t=(new Date).getTime()-r.getTime();if(void 0!==a.timeoutMs&&t>a.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${t}ms`);let p=v(m(i))||v(...f(i))||v(...h(i))||v(y(i))||[k()];const u=b(i);if("all"==e)u&&(p=p.concat(p.filter(C).map(t=>w(t,u))));else if("two"==e)p=p.slice(0,1),u&&(p=p.concat(p.filter(C).map(t=>w(t,u))));else if("one"==e){const[t]=p=p.slice(0,1);u&&C(t)&&(p=[w(t,u)])}else"none"==e&&(p=[k()],u&&(p=[w(p[0],u)]));for(let t of p)t.level=l;if(c.push(p),c.length>=a.seedMinLength&&(o=s(c,n),o))break;i=i.parentElement,l++}return o||(o=s(c,n)),!o&&n?n():o}function s(t,e){const n=T(_(t));if(n.length>a.threshold)return e?e():null;for(let t of n)if(d(t))return t;return null}function p(t){let e=t[0],n=e.name;for(let o=1;o<t.length;o++){const a=t[o].level||0;n=e.level===a-1?`${t[o].name} > ${n}`:`${t[o].name} ${n}`,e=t[o]}return n}function u(t){return t.map(t=>t.penalty).reduce((t,e)=>t+e,0)}function d(t){const e=p(t);switch(c.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function m(t){const e=t.getAttribute("id");return e&&a.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function f(t){const e=Array.from(t.attributes).filter(t=>a.attr(t.name,t.value));return e.map(t=>({name:`[${CSS.escape(t.name)}="${CSS.escape(t.value)}"]`,penalty:.5}))}function h(t){return Array.from(t.classList).filter(a.className).map(t=>({name:"."+CSS.escape(t),penalty:1}))}function y(t){const e=t.tagName.toLowerCase();return a.tagName(e)?{name:e,penalty:2}:null}function k(){return{name:"*",penalty:3}}function b(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let o=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&o++,n!==t);)n=n.nextSibling;return o}function w(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function C(t){return"html"!==t.name&&!t.name.startsWith("#")}function v(...t){const e=t.filter(g);return e.length>0?e:null}function g(t){return null!=t}function*_(t,e=[]){if(t.length>0)for(let n of t[0])yield*_(t.slice(1,t.length),e.concat(n));else yield e}function T(t){return[...t].sort((t,e)=>u(t)-u(e))}function*x(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>a.optimizedMinLength)for(let o=1;o<t.length-1;o++){if(n.counter>a.maxNumberOfTries)return;n.counter+=1;const c=[...t];c.splice(o,1);const r=p(c);if(n.visited.has(r))return;d(c)&&N(c,e)&&(yield c,n.visited.set(r,!0),yield*x(c,e,n))}}function N(t,e){return c.querySelector(p(t))===e}function S(t){const e=document.createElement("div"),a=t.actions?`\n\t\t<div class="pum-modal-actions">\n\t\t\t${t.actions.primary?`\n\t\t\t\t<button class="button button-primary pum-modal-proceed">\n\t\t\t\t\t${t.actions.primary.text}\n\t\t\t\t</button>\n\t\t\t`:""}\n\t\t\t${t.actions.secondary?`\n\t\t\t\t<button class="button button-secondary pum-modal-cancel">\n\t\t\t\t\t${t.actions.secondary.text}\n\t\t\t\t</button>\n\t\t\t`:""}\n\t\t</div>\n\t`:"";e.innerHTML=`<div class="pum-modal pum-modal-overlay">\n\t\t<div class="pum-modal-content">\n\t\t\t<div class="pum-modal-header">\n\t\t\t\t<div class="pum-logo"></div>\n\t\t\t\t<h4>${t.title}</h4>\n\t\t\t\t<button class="pum-modal-close">\n\t\t\t\t\t<span class="dashicons dashicons-no-alt"></span>\n\t\t\t\t\t<span class="screen-reader-text">${t.closeText||(0,o.__)("Close","popup-maker")}</span>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div class="pum-modal-body">\n\t\t\t\t${t.content}\n\t\t\t\t${a}\n\t\t\t</div>\n\t\t</div>\n\t</div>`,document.body.appendChild(e);const c=()=>{n()(document).off("keydown",r),n()(document).off("mousedown",i),n()(".pum-modal-close, .pum-modal-cancel",e).off("click",c),n()(".pum-modal-proceed",e).off("click",l),n()(".pum-modal-cancel",e).off("click",s),n()(e).fadeOut(200,()=>{e.remove()})},r=t=>{"Escape"===t.key&&c()},i=t=>{n()(t.target).hasClass("pum-modal-overlay")&&c()},l=()=>{t.actions?.primary?.onClick&&t.actions.primary.onClick(),c()},s=()=>{t.actions?.secondary?.onClick&&t.actions.secondary.onClick(),c()};return n()(document).on("keydown",r),n()(document).on("mousedown",i),n()(".pum-modal-close, .pum-modal-cancel",e).on("click",c),t.actions?.primary&&n()(".pum-modal-proceed",e).on("click",l),t.actions?.secondary&&n()(".pum-modal-cancel",e).on("click",s),e}class E{defaultText={instructions:(0,o.__)("After clicking ok, click the element you want a selector for.","popup-maker"),results:(0,o.__)("Selector","popup-maker"),copy:(0,o.__)("Copy","popup-maker"),close:(0,o.__)("Close","popup-maker"),copied:(0,o.__)("Copied to clipboard","popup-maker")};constructor(){this.text=popupMakerAdminBar?.i18n||this.defaultText,this.initialize()}async copyToClipboard(t){try{return navigator.clipboard&&window.isSecureContext?(await navigator.clipboard.writeText(t),!0):this.fallbackCopyToClipboard(t)}catch(e){return console.error("Failed to copy text:",e),this.fallbackCopyToClipboard(t)}}fallbackCopyToClipboard(t){const e=document.createElement("textarea");try{return e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy")}catch(t){return console.error("Fallback copy failed:",t),!1}finally{document.body.removeChild(e)}}showCopiedNotice(t){const e=document.createElement("div");e.classList.add("notice","notice-success"),e.innerHTML=`<p>${this.text.copied}</p>`,t.append(e),setTimeout(()=>{n()(e).fadeOut(200,()=>{n()(e).remove()})},3e3)}handleSelectorClick=async t=>{t.preventDefault(),t.stopPropagation();const e=i(t.target,{seedMinLength:3}),o=S({title:this.text.results,content:`\n\t\t\t\t<div class="pum-modal-copy">\n\t\t\t\t\t<p>${e}</p>\n\t\t\t\t\t<button class="copy-clipboard button button-secondary">\n\t\t\t\t\t\t<span class="dashicons dashicons-clipboard"></span>\n\t\t\t\t\t\t<span class="screen-reader-text">${this.text.copy}</span>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t`,closeText:this.text.close});n()(".copy-clipboard",o).on("click",async()=>{await this.copyToClipboard(e)&&this.showCopiedNotice(n()(".pum-modal-body",o))})};initialize(){const{PUM:t}=window;n()(document).on("click","#wp-admin-bar-pum-get-selector",t=>{t.preventDefault(),t.stopPropagation(),S({title:(0,o.__)("Get Element Selector","popup-maker"),content:this.text.instructions,closeText:this.text.close,actions:{primary:{text:(0,o.__)("Start Selection","popup-maker"),onClick:()=>{setTimeout(()=>{n()(document).one("click",this.handleSelectorClick)},250)}},secondary:{text:(0,o.__)("Cancel","popup-maker"),onClick:()=>{}}}})}),n()(document).on("click",".pum-toolbar-action",e=>{e.preventDefault(),e.stopPropagation();const a=n()(e.target).attr("href");if(!a)return;const[c,r]=a.split("__")[1].split("--");switch(c){case"open":t.open(r);break;case"close":t.close(r);break;case"check-conditions":S({title:(0,o.__)("Conditions Check","popup-maker"),content:t.checkConditions(r)?(0,o.__)("The conditions were met.","popup-maker"):(0,o.__)("The conditions were not met.","popup-maker")});break;case"reset-cookies":t.clearCookies(r),S({title:(0,o.__)("Cookies Reset","popup-maker"),content:(0,o.__)("The cookies were reset successfully.","popup-maker")})}})}}n()(()=>{new E}),(window.popupMaker=window.popupMaker||{}).adminBar={}})();
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists