(()=>{"use strict";var e;(e=jQuery)(function(){if(document.querySelector(".pr_greetings_template"))try{!function(){var t=e(".pr_greetings_template select").find(":selected").val();function _(){e(".is_opt_in").is(":checked")?e(".pr_opt_in ").show(200):e(".pr_opt_in ").hide(200)}"no"===t||""===t?e(".g_content_collapsible").hide():e(".g_content_collapsible").show(),"greetings-1"===t&&(e(".ctc_greetings_settings.ctc_g_1").show(),e(".pr_ht_ctc_greetings_1").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),"greetings-2"===t&&(e(".ctc_greetings_settings.ctc_g_2").show(),e(".pr_ht_ctc_greetings_2").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),e(".pr_greetings_template select").on("change",function(t){var n=t.target.value;"no"===n?(e(".g_content_collapsible").hide(100),e(" .ctc_greetings_settings").hide()):(e(".g_content_collapsible").show(),"greetings-2"!==n&&"greetings-1"!==n||e(" .ctc_greetings_settings").hide(),e(".ctc_greetings_notes").show(),"greetings-1"===n&&(e(".ctc_greetings_settings.ctc_g_1").show(100),e(".pr_ht_ctc_greetings_1").show(100),_()),"greetings-2"===n&&(e(".ctc_greetings_settings.ctc_g_2").show(100),e(".pr_ht_ctc_greetings_2").show(100),_()),e(".pr_ht_ctc_greetings_settings").show())}),e(".is_opt_in").on("change",function(e){_()})}()}catch(e){}var t,_=document.querySelector(".ctc-admin-greetings-page"),n=document.querySelector(".ctc-admin-woo-page");if(_||n)try{t=1,function e(){if(document.getElementById("header_content_ifr"))try{!function(){try{Array.prototype.forEach.call(tinyMCE.editors,function(e){e&&e.dom&&e.getBody&&e.dom.setStyle(e.getBody(),"backgroundColor","#26a69a")})}catch(e){}}()}catch(e){}else++t<28&&setTimeout(e,1e3)}()}catch(e){}!function(){var t,_,n;function c(){""===e(".g_header_image").val()?(e(".row_g_header_online_status").hide(),e(".row_g_header_online_status_color").hide()):(e(".row_g_header_online_status").show(),e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide())}e(".ctc_add_image_wp").on("click",function(i){i.preventDefault(),t||(t=wp.media.frames.file_frame=wp.media({title:"Select Header Image",button:{text:"Select"},multiple:!1})).on("select",function(){if(void 0===(_=t.state().get("selection").first().toJSON()))return!0;n=_.url,e(".g_header_image").val(n),e(".g_header_image_preview").attr("src",n),e(".g_header_image_preview").show(),e(".ctc_remove_image_wp").show(),c(),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings_header_image",{detail:n}))}),t.open()}),e(".ctc_remove_image_wp").on("click",function(t){t.preventDefault(),e(".g_header_image").val(""),e(".g_header_image_preview").hide(),e(".ctc_remove_image_wp").hide(),c()}),c(),e(".g_header_online_status").on("change",function(){e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide()})}()})})();