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