jQuery(document).ready(function(e){"use strict";var t=e("#preview-action").find(".preview").attr("href").replace(/&?preview=\w+/,"")+"&gvc_preview=1&post_ID="+e('form#post input[name="post_ID"]').val(),a=function(e,t,a){var s;return function(){var c=this,n=arguments,o=a&&!s;clearTimeout(s),s=setTimeout(function(){s=null,a||e.apply(c,n)},t),o&&e.apply(c,n)}}(function(){var c;if(e("body").hasClass("vc_fullscreen")){if(void 0!==(c=e("#title"))&&""===c.val()&&(c.val("Post #"+e("#post_ID").val()).blur(),wp.autosave))return wp.autosave.server.triggerSave(),void setTimeout(a,200);wp.ajax.send("save_preview",{success:function(){e("#gvcpreview").attr("src",t+"&t="+(new Date).getTime())},data:{_wpnonce:e('form#post input[name="_wpnonce"]').val(),post_ID:e('form#post input[name="post_ID"]').val(),content:s(),custom_css:e("#vc_post-custom-css").val()}})}},10),s=function(){try{return tinyMCE.activeEditor.getContent()||jQuery(".wp-editor-area").val()}catch(e){return jQuery(".wp-editor-area").val()}};vc.shortcodes.bind("change",a),vc.shortcodes.bind("remove",a),e("body").on("click","#vc_fullscreen-button",a),e("body").on("click",'[data-vc-ui-element="button-save"]',a),e("body").on("click",".gvc-resp-buttons > *",function(t){var s="";t.preventDefault(),e(this).hasClass("gvc-refresh")?a():(e(this).hasClass("gvc-tablet")?s="gvc-tablet":e(this).hasClass("gvc-phone")&&(s="gvc-phone"),e("#gvcpreview").removeClass("gvc-tablet gvc-phone"),s&&e("#gvcpreview").addClass(s),e(this).parent().find("> *").removeClass("gvc-active"),e(this).addClass("gvc-active"))})});