!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(e,t){const a=(e,t)=>{e.preventDefault(),e.target.classList.add("updating-message"),e.target.setAttribute("disabled","disabled");let a=e.target.getAttribute("data-url");const n=new XMLHttpRequest;n.open("GET",a,!0),n.setRequestHeader("X_REQUESTED_WITH","xmlhttprequest"),n.send(),n.onreadystatechange=()=>{4===n.readyState&&200===n.status&&(e.target.classList.remove("updating-message"),e.target.insertAdjacentHTML("beforeBegin","<span>All Done</span>"),e.target.style.display="none")}},n=(e,t)=>{e.preventDefault(),e.target.classList.add("updating-message"),e.target.setAttribute("disabled","disabled");let n="action=kaliforms_install_plugin&download_url="+e.target.getAttribute("data-download-url")+"&nonce="+KaliFormsExtensions.ajax_nonce;const r=new XMLHttpRequest;r.open("POST",ajaxurl,!0),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send(n),r.onreadystatechange=()=>{if(4===r.readyState&&200===r.status){str=r.response.substring(r.response.indexOf("</div>")+6);const n=JSON.parse(str);if(n.hasOwnProperty("activate_url")){e.target.classList.remove("updated-message");let r=e.target.parentNode,s=a;const l=document.createElement("a");l.classList.add("button"),l.classList.add("button-primary"),l.innerText="Activate",l.setAttribute("href","#"),l.setAttribute("data-url",n.activate_url),l.addEventListener("click",e=>s(e,t)),r.removeChild(e.target),r.appendChild(l)}}}};document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("kaliforms-extensions-page");if(null===e)return;[...e.querySelectorAll(".plugin-card")].map(e=>{let t=e.querySelector('a[data-action="activate"]'),r=e.querySelector('a[data-action="install"'),s=a,l=n;null!==t&&t.addEventListener("click",t=>s(t,e)),null!==r&&r.addEventListener("click",t=>l(t,e))})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("install-kali-forms");null!==e&&e.addEventListener("click",e=>{e.preventDefault(),e.target.classList.add("updating-message"),e.target.setAttribute("disabled","disabled"),"install"===e.target.getAttribute("data-action")&&wp.updates.installPlugin({slug:"kali-forms",success:e=>{let t=e.activateUrl;const a=new XMLHttpRequest;a.open("GET",t,!0),a.setRequestHeader("X_REQUESTED_WITH","xmlhttprequest"),a.send(),a.onreadystatechange=()=>{4===a.readyState&&200===a.status&&location.reload()}}})})})}]);