window.OMAPI_Plugins=window.OMAPI_Plugins||{},function(t,n,e,o,i){"use strict";o.handleSubmission=n=>{if(n.preventDefault(),!o.pluginData.status)throw new Error("Missing Plugin Data");const i=e(".button-install"),a=e(".button-activate"),s=i.html(),l=a.html();i.html(i.data("actiontext")),a.html(a.data("actiontext")),e("#om-plugin-alerts").hide(),e.ajax({type:"POST",beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",o.restNonce)},url:o.restUrl+"omapp/v1/plugins/",data:{id:o.pluginData.id,actionNonce:o.actionNonce},success:function(n){t.location.reload()},error:function(t,n,r){i.html(s),a.html(l);let u="Something went wrong!";if(t.responseJSON&&t.responseJSON.message&&(u+="
Error found: "+t.responseJSON.message),t.responseJSON&&t.responseJSON.data)try{u+=`
(data: ${JSON.stringify(t.responseJSON.data)})`}catch(t){}const c=o.pluginData.installed?"activate":"install";console.error(`Could not ${c} the ${o.pluginData.name} plugin`,{jqXHR:t,textStatus:n,errorThrown:r}),e("#om-plugin-alerts").show().html(e("