/*! DO NOT EDIT THIS FILE. This file is a auto generated on 2023-03-25 */
jQuery(document).ready(function(s){$wcfm_messages_table="",0<s("#support_ticket_reply").length&&"undefined"!=typeof tinymce&&tinymce.init({selector:"#support_ticket_reply",height:75,menubar:!1,plugins:["advlist autolink lists link charmap print preview anchor","searchreplace visualblocks code fullscreen","insertdatetime table contextmenu paste code directionality","autoresize"],toolbar:tinyMce_toolbar,content_css:"//www.tinymce.com/css/codepen.min.css",statusbar:!1,browser_spellcheck:!0}),s("#wcfm_reply_send_button").click(function(e){e.preventDefault();var e="",e="undefined"!=typeof tinymce&&null!=tinymce.get("support_ticket_reply")?tinymce.get("support_ticket_reply").getContent():s("#support_ticket_reply").val();$is_valid=!0,s(".wcfm-message").html("").removeClass("wcfm-error").removeClass("wcfm-success").slideUp(),0==e.length&&($is_valid=!1,s("#wcfm_support_ticket_reply_form .wcfm-message").html('<span class="wcicon-status-cancelled"></span>'+wcfm_support_manage_messages.no_reply).addClass("wcfm-error").slideDown(),audio.play()),$is_valid&&(s("#wcfm_support_ticket_reply_form").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),e={action:"wcfm_ajax_controller",controller:"wcfm-support-manage",support_ticket_reply:e,wcfm_support_ticket_reply_form:jQuery("#wcfm_support_ticket_reply_form").serialize(),wcfm_ajax_nonce:wcfm_params.wcfm_ajax_nonce},s.post(wcfm_params.ajax_url,e,function(e){e&&($response_json=s.parseJSON(e),s(".wcfm-message").html("").removeClass("wcfm-error").removeClass("wcfm-success").slideUp(),wcfm_notification_sound.play(),$response_json.status?(tinymce.get("support_ticket_reply").setContent(""),s("#wcfm_support_ticket_reply_form .wcfm-message").html('<span class="wcicon-status-completed"></span>'+$response_json.message).addClass("wcfm-success").slideDown("slow",function(){$response_json.redirect&&(window.location=$response_json.redirect)})):s("#wcfm_support_ticket_reply_form .wcfm-message").html('<span class="wcicon-status-cancelled"></span>'+$response_json.message).addClass("wcfm-error").slideDown(),s("#wcfm_support_ticket_reply_form").unblock())}))})});