jQuery(document).ready(function(t){let e=t("#cdp-purl").val(),i=[];function o(){t("#cdp_notice_error_modal").find(".cdp_notice_content").animate({top:"-20px"},300),t("#cdp_notice_error_modal").fadeOut(300)}function n(){setTimeout(()=>{t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"i_saw_this_noti",noti_token:token}).done(()=>{delete i[i.findIndex(t=>t===token)]}).fail(()=>{n(token)})},500*i.length)}function c(){let e=t(".cdp-dd-item").length,i=t(".cdp-dd-d").length,o=t(".cdp-dd-ud").length;i<=0?(t(".cdp-done-notis, .cdp-done-notis").addClass("cdp-noti-hide"),t(".cdp-done-hr").hide()):(t(".cdp-done-notis, .cdp-done-notis").removeClass("cdp-noti-hide"),t(".cdp-done-hr").show()),o<=0?(t(".cdp-undone-notis, .cdp-undone-notis").addClass("cdp-noti-hide"),t(".cdp-undone-hr").hide()):(t(".cdp-undone-notis, .cdp-undone-notis").removeClass("cdp-noti-hide"),t(".cdp-undone-hr").show()),e<=0?t(".cdp-admin-bar-noti").addClass("cdp-noti-hide"):t(".cdp-admin-bar-noti").removeClass("cdp-noti-hide"),t(".cdp-notis-counter").text(t(".cdp-bnew-notis").length)}if(t("body").on("click",".cdp-notification .cdp-times-button",t.cdpRemoveNotifiaction),t("body").on("mouseover",".cdp-bnew-notis",function(){let e=parseInt(t(".cdp-notis-counter").text()),o=t(".cdp-bnew-notis").length,c=t(this).attr("data-token");t(this).hasClass("cdp-bnew-notis")&&e-1>=0&&(t(this).removeClass("cdp-bnew-notis"),t(".cdp-notis-counter").text(e-1));(e>0||o>0)&&(i.push(c),setTimeout(()=>{t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"i_saw_this_noti",noti_token:c}).done(()=>{delete i[i.findIndex(t=>t===c)]}).fail(()=>{n()})},500*i.length))}),t("body").on("mouseover",".cdp-dropdown-left",function(){if(!t(this).hasClass("cdptipstered")){let e=t(t(this).parents(".cdp-dd-d")[0]),i=e.attr("data-fdate");if(fdate=e.attr("data-ftext"),!fdate)return;i=i?`
${i}`:"",t(this).cdptipster({delay:30,animationDuration:250,debug:!1,timer:30,delayTouch:[50,100],interactive:!0,distance:6,side:"left",contentAsHTML:!0,maxWidth:340,trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},content:`${fdate}${i}`,theme:["cdptipster-noir","cdptipster-noir-customized","cdp-center"],repositionOnScroll:!0,functionReady:function(){setTimeout(()=>{t.tooltipReposition()},150)}}),t(this).cdptipster("open")}}),t("body").on("click",".cdp-dropdown-clear-all-notis",function(e){e.preventDefault(),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"clear_crons"}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status){let e=t(".cdp-dd-item");e.hide(300),setTimeout(()=>{e.remove(),c()},300),t.cdpNotification("success",cdpGlobalJS.strTasksCleared)}else"fail"==e.status?t.cdpNotification(e.type,e.msg):t.cdpNotification("error",cdpGlobalJS.strTasksUpdateIssue)}).fail(e=>{t.cdpNotification("error",cdpGlobalJS.strTasksUpdateIssue2)})}),t("body").on("click",".cdp-noti-hide-btn",function(){let e=t(this).parents(".ab-item").attr("data-token");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"try_to_hide_the_tasks",task:e}).done(e=>{t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status?(t(this).parents(".ab-item").hide(300),setTimeout(()=>{t(this).parents(".ab-item").remove(),c()},300),t.cdpNotification("success",cdpGlobalJS.strTaskHide)):"fail"==e.status?t.cdpNotification(e.type,e.msg):t.cdpNotification("error",cdpGlobalJS.strTaskHideIssue)}).fail(()=>{t.cdpNotification("error",cdpGlobalJS.strTaskHideIssue2)})}),t("body").on("click",".cdp-noti-kill-btn",function(){let e=t(this).parents(".ab-item").attr("data-token");t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"try_to_kill_the_tasks",task:e}).done(e=>{t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status?(t(this).parents(".ab-item").hide(300),setTimeout(()=>{t(this).parents(".ab-item").remove(),c()},300),t.cdpNotification("success",cdpGlobalJS.strTaskKill)):"fail"==e.status?t.cdpNotification(e.type,e.msg):t.cdpNotification("error",cdpGlobalJS.strTaskKillIssue)}).fail(()=>{t.cdpNotification("error",cdpGlobalJS.strTaskKillIssue2)})}),t("body").on("click",".cdp-review-button",function(){function e(){t("#cdp-review-notice").css({"max-height":`${t("#cdp-review-notice").height()}px`,opacity:1}),t("#cdp-review-notice").animate({"max-height":"0px",opacity:0},300)}function i(i){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"review_dismiss",decision:i}).done(i=>{t.isJsonString(i)&&(i=t.cdpParse(i)),"success"!=i.status&&t.cdpNotification("warning",cdpGlobalJS.strDissmisIssue),e()}).fail(i=>{t.cdpNotification("error",cdpGlobalJS.strDissmisRequestIssue),e()})}"cdp-review-review"==t(this).attr("id")?(i("hide"),t.cdpNotification("success",cdpGlobalJS.strReviewReview)):"cdp-review-already"==t(this).attr("id")?(i("hide"),t.cdpNotification("success",cdpGlobalJS.strReviewAlready)):"cdp-review-later"==t(this).attr("id")?(i("remind"),t.cdpNotification("success",cdpGlobalJS.strReviewLater)):(i("hide"),t.cdpNotification("success",cdpGlobalJS.strReviewDefault))}),t("body #cdp_notice_error_modal").on("click",".cdp-modal-times",o),t("body #cdp_notice_error_modal").on("click",".cdp-notice-nope",o),t("body #cdp_notice_error_modal").on("click",".cdp-notice-yeah",o),t("body").on("mouseenter","#cdp-review-no",function(){t("#cdp-review-sad").css({opacity:1})}),t("body").on("mouseleave","#cdp-review-no",function(){t("#cdp-review-sad").css({opacity:0})}),t(".cdp-copy-loader-overlay").length>0&&t(".cdp-copy-loader-overlay").prependTo("body"),t("#cdp-show-copy-banner").length>0&&(t(".cdp-copy-alert-success").prependTo("body"),setTimeout(()=>{"-28"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"32px",opacity:1},300),setTimeout(()=>{"32"==t(".cdp-copy-alert-success").position().top&&t(".cdp-copy-alert-success").animate({top:"-28px",opacity:0},300)},3e3),t("#cdp_notice_error_modal").length>0&&(t("#cdp_notice_error_modal").show(),t("#cdp_notice_error_modal").fadeIn(300),t("#cdp_notice_error_modal").animate({opacity:1},500),t("#cdp_notice_error_modal .cdp_notice_content").animate({opacity:1,top:"50%"},500))},110)),t(".cdp-preloader-c").hasClass("cdp_is_cool_installed")&&setTimeout(()=>{t.cdpNotification("info",cdpGlobalJS.strCDPInstallSuccess,3e3)},500),"undefined"!=typeof pagenow&&["toplevel_page_copy-delete-posts","plugins"].includes(pagenow)){let i=`background:url('${`${e}/assets/imgs/stars.gif`}')`;t('[data-slug="copy-delete-posts-premium"]').find("strong").html(''+cdpGlobalJS.strCDPInfo+` `+cdpGlobalJS.strCDPInfoPremium+"")}t.cdpTooltipsTop(),t("#cdp-review-notice").find(".notice-dismiss").cdptipster({delay:30,animationDuration:250,debug:!1,timer:30,delayTouch:[50,100],interactive:!1,distance:-4,side:"top",contentAsHTML:!0,maxWidth:800,trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},content:cdpGlobalJS.strHideBannerNow,theme:["cdptipster-noir","cdptipster-noir-customized","cdp-banner","cdp-center"],repositionOnScroll:!0,functionReady:function(){setTimeout(()=>{t.tooltipReposition()},150)}}),t("#cdp-copy-modal-global").length>0&&t("#cdp-copy-modal-global").appendTo("body")}),function(t){t.extend({cdpNotification:function(e="default",i=cdpGlobalJS.strErrWithNotif,o=7e3){t(".cdp-notification-box").length<=0&&t("body").prepend(t('