Sid Gifari File Manager
🏠 Root
/
home
/
genremedia08
/
thepassage.overlookedtracks.com
/
wp-content9
/
plugins
/
echo-knowledge-base
/
js
/
ai
/
Editing: admin-ai-dashboard.min.js
(function(){"use strict";const{useState:t,useEffect:e,createElement:a}=wp.element;const{__:n}=wp.i18n;const{showError:s,showSuccess:o,makeApiRequest:i}=window.EPKB_AI_Util_React||{};const l=({settings:e,tabData:i,isLoading:l,onTabSwitch:r})=>{const d=i?.status||null;const c=e?.show_get_started||d?.show_get_started;const p=i?.is_ai_enabled||false;const[u,b]=t([]);const[m,k]=t("");const g=()=>{if(!d){return null}if(c){return null}if(!c&&(d.overall==="error"||d.overall==="warning")){const t=[...d.issues||[],...d.warnings||[]];if(t.length>0){return a("div",{className:"epkb-ai-status-issues"},a("div",{className:"epkb-ai-status-section"},a("h3",null,n("Warnings","echo-knowledge-base")),t.map((t,e)=>a("div",{key:e,className:"epkb-ai-notice epkb-ai-notice-warning"},a("p",null,t.message),t.action&&a("p",{className:"epkb-ai-action"},t.link?a("a",{href:t.link,className:"epkb-ai-button epkb-ai-button-small"},t.action):t.action)))))}return a("div",{className:"epkb-ai-status-issues"},d.warnings.length>0&&a("div",{className:"epkb-ai-status-section"},a("h3",null,n("Warnings","echo-knowledge-base")),d.warnings.map((t,e)=>a("div",{key:e,className:"epkb-ai-notice epkb-ai-notice-warning"},a("p",null,t.message),t.action&&a("p",{className:"epkb-ai-action"},t.link?a("a",{href:t.link,className:"epkb-ai-button epkb-ai-button-small"},t.action):t.action)))))}return null};const f=()=>{if(p){return null}return a("div",{className:"epkb-ai-not-enabled-notice"},a("h3",null,n("This Knowledge Base AI Is Not Enabled","echo-knowledge-base")),a("p",null,n("AI features are optional and turned off by default. AI will only work after you manually enable it and add your own API key in ","echo-knowledge-base"),a("a",{href:"#",onClick:t=>{t.preventDefault();r("general-settings")}},n("General Settings","echo-knowledge-base")),"."))};const h=()=>{if(!p){return null}const t=i?.dashboard_stats||{};return a("div",{className:"epkb-ai-stats-grid"},Object.values(t).map((t,e)=>a("div",{key:e,className:"epkb-ai-stat-box"+(t.is_coming_soon?" epkb-ai-stat-box-coming-soon":""),style:{borderTopColor:t.color}},a("div",{className:"epkb-ai-stat-header"},a("div",{className:"epkb-ai-stat-icon",style:{backgroundColor:t.color+"15"}},a("span",{className:t.icon,style:{color:t.color}})),a("h3",null,t.title)),a("div",{className:"epkb-ai-stat-content"},t.is_coming_soon?a("div",{className:"epkb-ai-coming-soon"},a("span",{className:"epkb-ai-coming-soon-badge"},t.value),a("p",{className:"epkb-ai-stat-description"},t.description)):a("div",null,a("p",{className:"epkb-ai-stat-description"},t.description),(t.show_as_main||t.total!==undefined)&&a("div",{className:"epkb-ai-stat-numbers"},a("span",{className:"epkb-ai-stat-number"},t.value||"0"))),t.bottom_text&&a("div",{className:"epkb-ai-stat-bottom"},a("span",null,t.bottom_text))))))};const v=(t,e,a)=>new Promise(s=>{const o=t?.first_name||"";const i=t?.email||"";const l=t?.site_url||window.location.origin;const r=t=>{const e=document.createElement("div");e.textContent=t;return e.innerHTML};const d=document.createElement("div");d.className="epkb-ai-vote-dialog-overlay";d.style.cssText=`\n\t\t\t\t\tposition: fixed;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\tright: 0;\n\t\t\t\t\tbottom: 0;\n\t\t\t\t\tbackground: rgba(0, 0, 0, 0.5);\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t\tz-index: 9999999;\n\t\t\t\t`;const c=document.createElement("div");c.className="epkb-ai-vote-dialog";c.style.cssText=`\n\t\t\t\t\tbackground: white;\n\t\t\t\t\tborder-radius: 8px;\n\t\t\t\t\tpadding: 24px;\n\t\t\t\t\tmax-width: 500px;\n\t\t\t\t\twidth: 90%;\n\t\t\t\t\tbox-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tz-index: 9999999;\n\t\t\t\t`;const p=`\n\t\t\t\t\t<h3 style="margin: 0 0 16px 0; font-size: 18px; font-weight: 600;">\n\t\t\t\t\t\t${n("Vote for Top 3 Features","echo-knowledge-base")}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p style="margin: 0 0 20px 0; color: #555; line-height: 1.5;">\n\t\t\t\t\t\t${n("Help us prioritize features by providing your information:","echo-knowledge-base")}\n\t\t\t\t\t</p>\n\t\t\t\t\t<form id="epkb-vote-form" style="display: flex; flex-direction: column; gap: 15px;">\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<label style="display: block; margin-bottom: 5px; font-weight: 500;">\n\t\t\t\t\t\t\t\t${n("First Name","echo-knowledge-base")} <span style="color: #999; font-weight: bold; font-size: 0.9em;">${n("(optional)","echo-knowledge-base")}</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<input type="text" \n\t\t\t\t\t\t\t\t id="epkb-vote-first-name" \n\t\t\t\t\t\t\t\t value="${r(o)}"\n\t\t\t\t\t\t\t\t style="width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<label style="display: block; margin-bottom: 5px; font-weight: 500;">\n\t\t\t\t\t\t\t\t${n("Email","echo-knowledge-base")} <span style="color: #999; font-weight: bold; font-size: 0.9em;">${n("(optional)","echo-knowledge-base")}</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<input type="email" \n\t\t\t\t\t\t\t\t id="epkb-vote-email" \n\t\t\t\t\t\t\t\t value="${r(i)}"\n\t\t\t\t\t\t\t\t style="width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${e.includes("other-feature")?`\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<label style="display: block; margin-bottom: 5px; font-weight: 500;">\n\t\t\t\t\t\t\t\t${n("Describe Your Feature Request","echo-knowledge-base")} <span style="color: red;">*</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\tid="epkb-vote-other-feature-text"\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\tplaceholder="${n("Please describe the feature you would like to see...","echo-knowledge-base")}"\n\t\t\t\t\t\t\t\tstyle="width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; min-height: 80px; resize: vertical;">${r(a)}</textarea>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`:""}\n\t\t\t\t\t\t<div style="display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px;">\n\t\t\t\t\t\t\t<button type="button" class="epkb-ai-button epkb-ai-button-secondary" id="epkb-vote-cancel">\n\t\t\t\t\t\t\t\t${n("Cancel","echo-knowledge-base")}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button type="submit" class="epkb-ai-button epkb-ai-button-primary" id="epkb-vote-submit">\n\t\t\t\t\t\t\t\t${n("Submit Vote","echo-knowledge-base")}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t`;c.innerHTML=p;d.appendChild(c);document.body.appendChild(d);const u=c.querySelector("#epkb-vote-form");const b=c.querySelector("#epkb-vote-cancel");const m=c.querySelector("#epkb-vote-first-name");const k=c.querySelector("#epkb-vote-email");if(m){m.focus()}const g=t=>{t.preventDefault();const e={first_name:m.value.trim(),email:k.value.trim(),site_url:l};const a=c.querySelector("#epkb-vote-other-feature-text");if(a){e.other_feature_text=a.value.trim();if(!e.other_feature_text){alert(n("Please describe the feature you would like to see.","echo-knowledge-base"));a.focus();return}}if(e.email){const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;if(!t.test(e.email)){alert(n("Please enter a valid email address.","echo-knowledge-base"));k.focus();return}}h();s(e)};const f=()=>{h();s(null)};const h=()=>{document.body.removeChild(d)};u.addEventListener("submit",g);b.addEventListener("click",f);d.addEventListener("click",t=>{if(t.target===d){f()}});document.addEventListener("keydown",function t(e){if(e.key==="Escape"){document.removeEventListener("keydown",t);f()}})});const w=async()=>{if(u.length===0){s(n("Please select at least one feature to vote for.","echo-knowledge-base"));return}const t=i?.current_user||{};const e=await v(t,u,m);if(!e){return}const a={...e,features:u,action:"epkb_vote_for_features",_wpnonce_epkb_ajax_action:epkb_vars.nonce};if(e.other_feature_text){a.other_feature_text=e.other_feature_text}const l=document.createElement("div");l.className="epkb-ai-loading-overlay";l.style.cssText=`\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tright: 0;\n\t\t\t\tbottom: 0;\n\t\t\t\tbackground: rgba(0, 0, 0, 0.5);\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\tz-index: 9999999;\n\t\t\t`;l.innerHTML=`\n\t\t\t\t<div style="background: white; padding: 20px; border-radius: 8px;">\n\t\t\t\t\t${n("Submitting your vote...","echo-knowledge-base")}\n\t\t\t\t</div>\n\t\t\t`;document.body.appendChild(l);jQuery.ajax({type:"POST",dataType:"json",url:epkb_vars.ajax_url,data:a,success:function(t){document.body.removeChild(l);if(t.success){const e=t.data&&t.data.message?t.data.message:n("Thank you for voting!","echo-knowledge-base");o(e);b([])}else{const e=t.data&&t.data.message?t.data.message:n("Failed to submit vote. Please try again.","echo-knowledge-base");s(e)}},error:function(t,e,a){document.body.removeChild(l);s(n("An error occurred. Please try again.","echo-knowledge-base")+" ["+a+"]");console.error("Vote submission error:",a)}})};const y=()=>{const t=i?.news||[];if(t.length===0){return null}return a("div",{className:"epkb-ai-news-section"},a("h3",null,n("Latest AI Updates","echo-knowledge-base")),a("div",{className:"epkb-ai-news-items"},t.map((t,e)=>a("div",{key:e,className:`epkb-ai-news-item epkb-ai-news-${t.type}`},a("div",{className:"epkb-ai-news-header"},a("span",{className:"epkb-ai-news-date"},t.date),a("span",{className:`epkb-ai-news-badge epkb-ai-news-badge-${t.type}`},t.type)),a("h4",null,t.title),a("p",null,t.description),t.link&&a("a",{href:t.link,target:"_blank",className:"epkb-ai-news-link"},n("Learn more","echo-knowledge-base")," →")))))};const x=()=>{const t=i?.upcoming_features||[];if(t.length===0){return null}const e=t=>{b(e=>{if(e.includes(t)){if(t==="other-feature"){k("")}return e.filter(e=>e!==t)}else{return[...e,t]}})};return a("div",{className:"epkb-ai-upcoming-features"},a("h3",null,n("Vote for Top 3 Features","echo-knowledge-base")+"!"),a("p",{style:{marginBottom:"20px",color:"#666"}},n("Select the features you would like to see implemented:","echo-knowledge-base")),a("div",{className:"epkb-ai-features-grid"},t.map((t,s)=>a("div",{key:s,className:"epkb-ai-feature-card"+(u.includes(t.id)?" epkb-ai-feature-selected":"")+(t.released?" epkb-ai-feature-released":""),style:{cursor:t.released?"default":"pointer",position:"relative"}},a("div",{className:"epkb-ai-feature-header",onClick:t.released?undefined:()=>e(t.id)},a("span",{className:`epkb-ai-feature-icon ${t.icon}`}),a("div",{className:"epkb-ai-feature-content"},a("div",{className:"epkb-ai-feature-title-row"},a("h4",null,t.title)),a("p",null,t.description)),t.released?a("span",{className:"epkb-ai-feature-released-badge",style:{padding:"6px 12px",background:"#10B981",color:"white",borderRadius:"4px",fontWeight:"600",fontSize:"14px"}},n("Released","echo-knowledge-base")):a("input",{type:"checkbox",id:`feature-${t.id}`,checked:u.includes(t.id),onChange:()=>e(t.id),onClick:t=>t.stopPropagation()}))))),a("div",{className:"epkb-ai-vote-button-container",style:{marginTop:"30px",textAlign:"center",padding:"20px",background:"#f8f9fa",borderRadius:"8px"}},a("button",{className:"epkb-ai-button epkb-ai-button-primary epkb-ai-button-large",onClick:w,disabled:u.length===0,style:{padding:"12px 30px",fontSize:"16px",opacity:u.length===0?"0.5":"1",cursor:u.length===0?"not-allowed":"pointer"}},a("span",{className:"epkbfa epkbfa-thumbs-up",style:{marginRight:"8px"}}),n("Vote for Top 3 Features","echo-knowledge-base")),u.length>0&&a("p",{style:{marginTop:"10px",color:"#666",fontSize:"14px"}},`${u.length} ${u.length===1?n("feature selected","echo-knowledge-base"):n("features selected","echo-knowledge-base")}`)),a("div",{className:"epkb-ai-upcoming-features-disclaimer"},a("p",null,n("Note: Your feedback helps us prioritize development. Features are subject to change.","echo-knowledge-base"))))};const N=()=>{const t=i?.tools_link;if(!t){return null}return a("div",{className:"epkb-ai-tools-link-section",style:{marginTop:"30px"}},a("a",{href:t.link,className:"epkb-ai-tools-link"},a("span",{className:t.icon}),a("div",null,a("h4",null,t.title),a("p",null,t.description))))};return a("div",{className:"epkb-ai-dashboard-container epkb-ai-dashboard-beta"},f(),g(),h(),a("div",{className:"epkb-ai-dashboard-columns"},a("div",{className:"epkb-ai-dashboard-main"},x()),a("div",{className:"epkb-ai-dashboard-sidebar"},y(),N())))};window.EPKB_AI_Dashboard={AIAdminDashboard:l}})();
Save
Cancel