File: /www/wwwroot/www.cytocare.cn/wp-content/themes/peakshops/assets/js/admin-meta.min.js
jQuery(function(d){var o,n,t,a;d(document).on("change.thb",".thb-field-link-mega input",function(){var e=d(this),t=e.is(":checked"),a=e.parents(".thb_menu_options").find(".thb-field-link-image");t?a.slideDown():a.slideUp()}),d(document).on("change.thb",".thb-field-link-imagetoggle input",function(){var e=d(this),t=e.is(":checked"),a=e.parents(".thb_menu_options").find(".thb-field-link-imagelink");t?a.slideDown():a.slideUp()}),d('.thb_menu_options input[type="checkbox"]').trigger("change.thb"),d(".thb-download-emails:not(.disabled)").on("click",function(e){var t=d(this);return d.ajax({method:"POST",url:ajaxurl,data:{action:"thb_download_emails"},beforeSend:function(){t.addClass("disabled")},success:function(e){t.removeClass("disabled"),location.href=e}}),!1}),d(".thb-registration").length&&(d(".thb-register:not(.disabled)").on("click",function(e){var a=d(this),t=d("#thb_product_key").val(),o=d("#thb_purchase_code").val(),n=a.hasClass("thb_purchase_code"),i=n?a.data("verify-by-purchase"):a.data("verify"),s={domain:a.data("domain")};return n?s.purchase_code=o:s.product_key=t,d.ajax({method:"GET",url:i,data:s,beforeSend:function(){a.addClass("disabled")},error:function(e){var t;a.removeClass("disabled"),!e.responseText||(t=d.parseJSON(e.responseText)).error_message&&("Invalid product_key"===t.error_message?a.parents(".step").find(".thb_error_messages").html('<div class="thb-error"><p><span class="dashicons dashicons-warning"></span> Invalid Product Key</p><p><small>Please make sure that you are using the exactly the same WordPress URL inside Settings > General.</small></p></div>'):"Invalid purchase_code"===t.error_message?a.parents(".step").find(".thb_error_messages").html('<div class="thb-error"><p><span class="dashicons dashicons-warning"></span> Invalid Envato Purchase Code</p><p><small>Please make sure that you are using the correct Envato Purchase Code for this theme.</small></p></div>'):"Invalid domain"===t.error_message?a.parents(".step").find(".thb_error_messages").html('<div class="thb-error"><p><span class="dashicons dashicons-warning"></span> Invalid Domain</p><p><small>Please make sure that you are using the exactly the same WordPress URL inside Settings > General.</small></p></div>'):a.parents(".step").find(".thb_error_messages").html('<div class="thb-error"><p><span class="dashicons dashicons-warning"></span> '+t.error_message+"</p></div>"))},success:function(e){e.product_key&&(t=e.product_key),d.ajax(ajaxurl,{method:"POST",data:{action:"thb_update_options",key:t,expired:0,security:a.data("security")},success:function(){location.reload()}})}}),!1}),d(".thb-delete-key").on("click",function(e){var t=d(this);return d.ajax(ajaxurl,{method:"POST",data:{action:"thb_update_options",key:"",expired:0,security:t.data("security")},success:function(){location.reload()}}),!1})),d("#thb-adm-popup").length&&((o={popup:d("#thb-adm-popup"),close:d(".thb-popup-close"),btn:d(".import-opts-btn")}).close.on("click",function(){d(this).closest(o.popup).removeClass("opvis")}),d(document).on("keyup",function(e){27===e.keyCode&&o.popup.hasClass("opvis")&&o.close.trigger("click")}),d(".thb-check-line [type=checkbox]").on("change",function(){var e=d(this);e.toggleClass("thb-checked"),"ty-contents"===e.attr("id")&&(e.hasClass("child-opened")?e.removeClass("child-opened").parent().next().removeClass("done"):e.addClass("child-opened").parent().next().addClass("done"))}),o.btn.on("click",function(){var e=d(this),t=e.data("demo");o.popup.find(".button").data("selected",t),o.popup.find("figure img").attr("src",e.closest(".theme").find("img").attr("src")),o.popup.find("[type=checkbox]"),o.popup.addClass("opvis")}),n=new FormData,"undefined"!=typeof ocdi&&(n.append("action","ocdi_import_demo_data"),n.append("security",ocdi.ajax_nonce)),o.popup.find("form").on("submit",function(e){e.preventDefault();var t=d(this),a=t.find(".button").data("selected");o.popup.find("form").addClass("thb-loading"),t.closest(".thb-popup-box").find(".thb-import-loading").addClass("opvis"),t.children("[type=submit]").addClass("disabled").attr("disabled","disabled").unbind("click"),n.append("selected",a),n.append("thb_import_options",t.serialize()),function a(o){d.ajax({method:"POST",url:ocdi.ajax_url,data:o,contentType:!1,processData:!1}).done(function(e){var t;void 0!==e.status&&"newAJAX"===e.status?a(o):void 0!==e.status&&"afterAllImportAJAX"===e.status?((t=new FormData).append("action","ocdi_after_import_data"),t.append("security",ocdi.ajax_nonce),a(t)):location.reload()})}(n)})),d("#thb-term-color").length&&(d("#thb-term-color").wpColorPicker(),0===d("#thb-term-image").val()&&d(".thb_remove_header").hide(),d(document).on("click",".thb_upload_header",function(e){e.preventDefault(),t||(t=wp.media.frames.downloadable_file=wp.media({title:thb_admin.i18n.mediaTitle,button:{text:thb_admin.i18n.mediaButton},multiple:!1})).on("select",function(){var e=t.state().get("selection").first().toJSON();d("#thb-term-image").val(e.id),d("#thb_term_image_holder img").attr("src",e.url),d(".thb_remove_header").show()}),t.open()}),d(document).on("click",".thb_remove_header",function(e){return d("#thb_term_image_holder img").attr("src",thb_admin.wc_placeholder),d("#thb-term-image").val(""),d(".thb_remove_header").hide(),!1})),d("#product_cat_header").length&&(0===d("#product_cat_thumbnail_id").val()&&d(".remove_image_button").hide(),0===d("#product_cat_header_id").val()&&d(".thb_remove_header").hide(),d(document).on("click",".thb_upload_header",function(e){e.preventDefault(),a||(a=wp.media.frames.downloadable_file=wp.media({title:thb_admin.i18n.mediaTitle,button:{text:thb_admin.i18n.mediaButton},multiple:!1})).on("select",function(){var e=a.state().get("selection").first().toJSON();d("#product_cat_header_id").val(e.id),d("#product_cat_header img").attr("src",e.url),d(".thb_remove_header").show()}),a.open()}),d(document).on("click",".thb_remove_header",function(e){return d("#product_cat_header img").attr("src",thb_admin.wc_placeholder),d("#product_cat_header_id").val(""),d(".thb_remove_header").hide(),!1}))});