(()=>{"use strict";jQuery(function(e){var t=e("#liveblog"),n=e("#post_ID").val(),o=function(n,o){var s=(o?liveblog_admin_settings.error_message_template:liveblog_admin_settings.short_error_message_template).replace("{error-message}",n).replace("{error-code}",o);e("p.error",t).show().html(s)};t.on("click","button",function(s){s.preventDefault();var a={};if(1==liveblog_admin_settings.use_rest_api){var i=liveblog_admin_settings.endpoint_url;a.state=encodeURIComponent(e(this).val()),a.template_name=encodeURIComponent(e("#liveblog-key-template-name").val()),a.template_format=encodeURIComponent(e("#liveblog-key-template-format").val()),a.limit=encodeURIComponent(e("#liveblog-key-limit").val()),a[liveblog_admin_settings.nonce_key]=liveblog_admin_settings.nonce;var l="POST"}else i=ajaxurl+"?action=set_liveblog_state_for_post&post_id="+encodeURIComponent(n)+"&state="+encodeURIComponent(e(this).val())+"&"+liveblog_admin_settings.nonce_key+"="+liveblog_admin_settings.nonce,i+="&"+e("input, textarea, select",t).serialize(),l="GET";e.ajax(i,{dataType:"json",data:a,method:l,success:function(n,o,s){e(".inside",t).empty().append(n),"success"!==o||e("p.success",t).show(0).delay(5e3).hide(0)},error:function(e,t,n){e.status&&e.status>200?o(e.statusText,e.status):o(t)}})})})})();
//# sourceMappingURL=admin.js.map