function cdp_tooltips_update_content(){if(jQuery("select").cdpNiceSelect("update"),!(void 0!==jQuery.cdp&&void 0!==jQuery.cdp.isPremium)||!jQuery.cdp.isPremium()){jQuery(".cdp-premium-in-select").find('.option[data-value="premium"]').addClass("cdp-tooltip-premium disabled"),jQuery(".cdp-option-premium").find('.option[data-value="3"]').addClass("cdp-tooltip-premium disabled"),$prems=jQuery(".cdp-tooltip-premium");for(let t=0;t<$prems.length;t++){let e=$prems[t],c=-15;isNaN(parseInt(jQuery(e).attr("data-top")))||(c=parseInt(jQuery(e).attr("data-top"))),jQuery(e).cdptipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:c,side:"top",content:cdpJS.strPremFeatureHtml,contentAsHTML:!0,maxWidth:290,theme:["cdptipster-noir","cdptipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}jQuery(".cdp-tooltip-premium-dc").cdptipster({delay:10,debug:!1,delayTouch:[100,200],interactive:!0,distance:3,side:"top",content:cdpJS.strPremFeatureHtml,contentAsHTML:!0,maxWidth:290,theme:["cdptipster-noir","cdptipster-noir-customized","cdp-tooltip-premium-css"],repositionOnScroll:!0})}}function cdp_totally_know_what_i_am_doing(t){if("really"!=t)return cdpJS.strAreYouSure;console.log(cdpJS.strYouAreCrazy);let e=jQuery;e("#cdp-purl").val();e.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"debug_function"}).done(t=>{console.log(t),console.log(cdpJS.strDebugOutputEnd)})}jQuery(document).ready(function(t){t("#cdp-purl").val();let e=null,c="default",o=null,i=null,d=null,n=null,p=null,s=null,a=null,l=!1;const r=void 0!==t.cdp&&void 0!==t.cdp.isPremium;function u(e=null,c=!1){let o=this;"string"==typeof e&&(o=`.${e}`),0!=c&&(o=c),$parent=t(t(o).parents(".cdp-collapsible")[0]),$arrow=$parent.find(".cdp-arrow"),$body=$parent.find(".cdp-collapsible-content"),$title=$parent.find(".cdp-collapsible-title"),$titles=t(".cdp-collapsible-title"),group=$parent.attr("data-cdp-group"),height=$body.prop("scrollHeight"),$oArrows=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-arrow"),$oBodies=t(`.cdp-collapsible[data-cdp-group="${group}"]`).not($parent).find(".cdp-collapsible-content"),$body.hasClass("cdp-active")?($body.removeClass("cdp-active"),$titles.removeClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":""})):($titles.removeClass("cdp-active"),$body.addClass("cdp-active"),$title.addClass("cdp-active"),$oBodies.removeClass("cdp-active"),$arrow.removeClass("cdp-arrow-left").addClass("cdp-arrow-down"),$oArrows.removeClass("cdp-arrow-down").addClass("cdp-arrow-left"),$body.css({"max-height":`${height+30}px`}),$oBodies.css({"max-height":""}))}function m(){let e=t(".cdp-names-prefix").text(),c=t(".cdp-names-suffix").text(),o={year:(i=new Date).getFullYear(),month:("0"+(i.getMonth()+1)).slice(-2),day:i.getDate()<=9?"0"+i.getDate():i.getDate(),hour:i.getHours()<=9?"0"+i.getHours():i.getHours(),minute:i.getMinutes()<=9?"0"+i.getMinutes():i.getMinutes(),second:i.getSeconds()<=9?"0"+i.getSeconds():i.getSeconds(),week:i.getDay()};var i;let d="(blank)"==t(".cdp-togglable-name-b").text()?"":cdpJS.strTogglableName,n=`${e.trim()} ${d} ${c.trim()}`;n=n.replace(/\[Counter\]/g,"2");let p=t(".cdp-date-picked").val();"1"==p?n=n.replace(/\[CurrentDate\]/g,`${o.month}/${o.day}/${o.year}`):"2"==p?n=n.replace(/\[CurrentDate\]/g,`${o.day}/${o.month}/${o.year}`):"3"==p&&function(e){let c=t(".cdp-custom-date-picking").val();t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"get_formatted_time",format:c}).done(t=>{e(t)}).fail(()=>{e(!1)})}(e=>{n=n.replace(/\[CurrentDate\]/g,`${e}`),t(".cdp-example-name").text(n),n=(n=n.replace(/\[CurrentTime\]/g,`${o.hour}:${o.minute}:${o.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(n)}),"3"!=p&&(n=(n=n.replace(/\[CurrentTime\]/g,`${o.hour}:${o.minute}:${o.second}`)).replace(/\s+/gim," "),t(".cdp-example-name").text(n))}function h(e=""){before=t(e).html(),text=t(e).html(),$picks=['
[Counter]
','[CurrentTime]
','[CurrentDate]
'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(e).html(text)}function f(){val=t('.cdp-other-options[name="after_copy"]').val(),2==val?t(".cdp-if-edit-page-selected").show(300):t(".cdp-if-edit-page-selected").is(":hidden")||t(".cdp-if-edit-page-selected").hide(300),setTimeout(()=>{jQuery(".cdp-oth-section").css({"max-height":""}),jQuery(".cdp-oth-section").css({"max-height":jQuery(".cdp-oth-section").height()})},310)}function g(o=!1){let i=t(this).attr("data-cdp-btn");1==o&&(i="copy-quick");let d=["copy-quick","copy-custom","copy-custom-link"],n=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic");if(d.includes(i)){let o={type:i};if(i==d[0]){if(o.times=t(".cdp-modal-input-times-tooltip").val(),o.site=t('.cdp-input-dynamic[name="tooltip-which-site-first"]').val(),o.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val(),o.swap="2"==t(".cdp-swap").val()?"true":"false",!o.profile||"custom"==o.profile)return t.cdpNotification("warning","Please select settings for this copy."),void _()}else if(i==d[1]||i==d[2]){t("#cdp-copy-modal-global").is(":visible")?($select=t('.cdp-input-dynamic[name="tooltip-which-profile-second-modal"]'),o.site=t('.cdp-input-dynamic[name="tooltip-which-site-second-modal"]').val(),o.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-second-modal"]').val()):(o.site=t('.cdp-input-dynamic[name="tooltip-which-site-second"]').val(),o.profile=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]').val()),o.times=t('.cdp-modal-input-times[name="tooltip-which-times-second"]').val(),o.swap="2"==t(".cdp-swap").val()?"true":"false",o.custom={};for(let e=0;e{})){window.onbeforeunload=(()=>cdpJS.strCopyInProgress),$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")&&($e.show(),$e.animate({opacity:1},300,function(){e(!0)}))}(()=>{t.ajax({type:"POST",url:ajaxurl,data:{action:"cdp_action_handling",token:"cdp",f:"copy_post",nonce:cdpGlobalJS.ajaxNonce,origin:"tooltip",id:[e],data:o},timeout:0}).done(function(e){_(),t.isJsonString(e)&&(e=t.cdpParse(e)),"error"==e.status?t.cdpNotification("error",cdpJS.strCopyPostIssue):i==d[2]||void 0!==e.link&&e.link.length>0?"pConv"==e.link?(t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"delete_success_img"}),"-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))):window.location.href=e.link:location.reload()}).fail(function(e){t.cdpNotification("error",cdpJS.strCopyPostIssueConsInfo),_(),console.log(e),console.log(e.responseText)})})}else t.cdpNotification(cdpJS.strTooltipBtnIssue)}function v(e,o=!1){let i=["clear","alloptions","custom","custom_named","null","undefined",null,void 0],d=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]'),n=t('.cdp-input-dynamic[name="tooltip-which-profile-second-modal"]'),p=d,s=!1;t("#cdp-copy-modal-global").is(":visible")&&(p=n,s=!0);let a=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic:not(:disabled)"),l=t(".cdp-modal-checkboxes").find(".cdp-input-dynamic"),r=p.val();0==e&&0!=o&&(r=o),"custom_named"==r?p.val("custom_named"):void 0===r||"custom"==r||null==r||void 0==r?p.val("custom"):"clear"==r?(0!=e&&e.preventDefault(),l.prop("checked",!1),p.val("custom_named")):"alloptions"==r?(0!=e&&e.preventDefault(),a.prop("checked",!0),p.val("custom_named")):!i.includes(r)&&r.length>=1?b(r,function(e){for(let c in e)"object"!=typeof c&&t(`.cdp-input-dynamic[name="${c}"]`).prop("checked",y(e[c]))}):(0!=e&&e.preventDefault(),t.cdpNotification("warning",cdpJS.strSelectedProfIssue)),0==e&&p.val(r),i.includes(r)||(c=r,s?d.val(r):n.val(r)),cdp_tooltips_update_content()}function y(t){return"string"==typeof t&&"true"==t.trim().toLowerCase()}function b(e="default",c){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"get_settings",profile:e}).done(e=>{if(t.isJsonString(e)&&(e=t.cdpParse(e)),e.status&&"error_no_exists"==e.status){t.cdpNotification("warning",cdpJS.strSelectedProfEmpty);let e={},o=t(".cdp-modal-option-r");for(let c=0;c{t.cdpNotification("error",cdpJS.strSelectedProfGetIssue),console.log(cdpJS.strConsLogErr),console.log(e),console.log("––––––––––––––––––––––––––"),c(!1)})}function x(){t(this).attr("class");let e=parseInt(t(this).val());e<=0&&(e=1),e>9999&&(e=9999),isNaN(e)&&(e=1),e||(e=1),t(".cdp-modal-input-times").val(e),t(".cdp-modal-input-times-tooltip").val(e),e>50?(t(".cdp-error-span-tooltip").show(300),t(".cdp-tooltip-before").attr("style","height: calc(225px - 20px - 16px) !important")):(t(".cdp-error-span-tooltip").hide(300),t(".cdp-tooltip-before").attr("style","")),e>1?(t(".cdp-multiple-tooltip-count").animate({opacity:1},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').hide()):(t(".cdp-multiple-tooltip-count").animate({opacity:0},200),t('.cdp-tooltip-btn-copy[data-cdp-btn="copy-custom-link"]').show()),setTimeout(()=>{O()},310)}function _(e=(()=>{})){window.onbeforeunload=null,$e=t(".cdp-copy-loader-overlay"),$e.is(":hidden")||$e.animate({opacity:0},300,function(){$e.hide(),e(!0)})}function w(){let e=t(".cdp-profile-selected").val();var c,o;b(e,i=>{if(t.isJsonString(i)||"object"==typeof i){"object"!=typeof i&&(i=JSON.parse(i));let d=["usmplugin","yoast","woo"];for(k in i)"names"==k?(t(".cdp-names-prefix").html(i[k].prefix),t(".cdp-names-suffix").html(i[k].suffix),"3"!=i[k].format||r||(i[k].format="1"),t(".cdp-date-picked").val(i[k].format),t(".cdp-custom-date-picking").val(i[k].custom)):(!d.includes(k)||d.includes(k)&&r&&t.cdp.isPremium())&&t(`.cdp-data-set[data-cdp-opt="${k}"]`).prop("checked","true"==i[k]);cdp_tooltips_update_content(),m(),f(),r&&t.cdp.isPremium()&&t.cdp.premium.detectChangeOfCustom(),j(),h(".cdp-names-prefix"),h(".cdp-names-suffix"),c=e,o=(()=>{}),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"set_default_profile",selection:c}).done(t=>{o(t)}).fail(()=>{o(!1)})}else t.cdpNotification("warning",cdpJS.strServerDataIssue)})}function $(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=t(".cdp-input-d-id").length,c=t(".cdp-input-d-id:checked").length;c==e?t(".cdp-d-select-all").text("Deselect all"):t(".cdp-d-select-all").text("Select all"),t(".cdp-t-d-ct").text(c),$visible=t(".cdp-input-d-id:visible").length,$visible_checked=t(".cdp-input-d-id:checked:visible").length,$visible==$visible_checked?t(".cdp-d-checkbox-all").prop("checked",!0):t(".cdp-d-checkbox-all").prop("checked",!1),function(){let e=t(".cdp-input-d-id").parents("tr"),c=t(".cdp-input-d-id:checked").parents("tr");e.removeClass("cdp-del"),c.addClass("cdp-del")}()}function S(e){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"give_me_current_tasks"}).done(c=>{t.isJsonString(c)&&(c=t.cdpParse(c)),"success"==c.status&&e(c.tasks)})}function C(e){let c=0,o=+new Date/1e3,i=t(".cdp-dd-item");for(let o=0;o=86400;t(".cdp-dd-undone-list").append(I(i.shown,task,e,i.f)),c++}}else{if(d.hasClass("cdp-dd-d"))continue;d.remove(),t(".cdp-dd-done-list").append(D(i.data,i.shown,task,i.f)),c++}}(c>0||0==i.length)&&function(){let e=t(".cdp-dd-item").length,c=t(".cdp-dd-d").length,o=t(".cdp-dd-ud").length;c<=0?(t(".cdp-done-notis, .cdp-done-notis").addClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").hide()):(t(".cdp-done-notis, .cdp-done-notis").removeClass("cdp-noti-hide"),t(".cdp-done-hr, .cdp-done-notis").show()),o<=0?(t(".cdp-undone-notis, .cdp-undone-notis").addClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").hide()):(t(".cdp-undone-notis, .cdp-undone-notis").removeClass("cdp-noti-hide"),t(".cdp-undone-hr, .cdp-undone-notis").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)}()}function j(){$trs=t(".cdp-table tbody.cdp-ff-b1").find("tr");for(let e=0;e<$trs.length;e++){let c=t($trs[e]);c.find("input").is(":checked")?c.addClass("cdp-selected-tr-opt"):c.removeClass("cdp-selected-tr-opt")}}function J(e){if(t(".cdp-modal").is(":visible"))return;let c=window;0!=t("#wpbody").scrollTop()&&(c="#wpbody");let o=t(c).scrollTop()+2;o<=0&&(o=2),"click"!=e.type&&t(".cdp-nice-select, .cdp-nice-select .list").css({transition:"all 0s"}),t(".cdp-nice-select .list").css({"margin-top":`${-o}px`}),t("#cdpp-af-author").length>0&&(t(".ui-autocomplete").css({top:`${t("#cdpp-af-author").offset().top+40}px`}),t(".cdp-cool-datepicker").css({top:`${t(".cdpp-input-a").offset().top+40}px`})),clearTimeout(n),n=setTimeout(()=>{t(".cdp-cdp-nice-select .list").css({transition:""})},100),clearTimeout(d),d=setTimeout(()=>{let o=t(c).scrollTop()+2;o<=0&&(o=2),"click"!=e.type&&t(".cdp-nice-select .list").css({transition:"all 0s !important"}),t(".cdp-nice-select .list").css({"margin-top":`${-o}px`}),t("#cdpp-af-author").length>0&&(t(".ui-autocomplete").css({top:`${t("#cdpp-af-author").offset().top+40}px`}),t(".cdp-cool-datepicker").css({top:`${t(".cdpp-input-a").offset().top+40}px`})),clearTimeout(n),n=setTimeout(()=>{t(".cdp-nice-select .list").css({transition:""})},100)},100)}function T(){let e=t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),c=t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked");e||c?t(".cdp-no-empty-text").html(cdpJS.strIncludingHtml):t(".cdp-no-empty-text").html(cdpJS.strIncludingHtml2)}function N(e){e.preventDefault(),$parent=t(this).parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),u("true",$col)}t(".cdp-intro-button").on("click",function(){let e=t(".cdp-intro").height();t(".cdp-intro").css({height:e+"px"}),t(".cdp-intro").animate({opacity:0,height:0},300,function(){t(".cdp-intro").hide(10),t("#cdp-never-intro").is(":checked")&&t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"no_intro",nonce:cdpGlobalJS.ajaxNonce}).done(e=>{"error"==e&&t.cdpNotification("error",cdpJS.strIntroSaveIssue)}).fail(e=>{t.cdpNotification("error",cdpJS.strIntroSaveIssue2)})}),t(".cdp-s-i-a").show(),t(".cdp-s-i-a").animate({opacity:1},300)}),t(".cdp-save-options").on("click",function(){let e=t(".cdp-data-set"),c=t(".cdp-other-inputs"),o=t(".cdp-profile-selected").val(),i=t(".cdp-names-prefix").text().replace(/\s+/g," ").trim(),d=t(".cdp-names-suffix").text().replace(/\s+/g," ").trim(),n={names:{prefix:i,suffix:d,format:t(".cdp-date-picked").val(),custom:t(".cdp-custom-date-picking").val(),display:t(t(`option[value="${t(".cdp-profile-selected").val()}"]`)[0]).text()}},p={afterCopy:t('.cdp-other-options[name="after_copy"]').val(),postConverter:t('.cdp-other-options[name="post_converter"]').val(),others:{}},s={},a=t(".cdp-other-roles");for(let e=0;e{"success"==e?t.cdpNotification("success",cdpJS.strSettingsSaved,2e3):"error"==e?t.cdpNotification("error",cdpJS.strSettingsSaveIssue):t.cdpNotification("success",cdpJS.strSettingsSaved,2e3)}).fail(e=>{t.cdpNotification("error",cdpJS.strSettingsSaveIssue2),console.log(e)})}),t("#cdp-show-into-again").on("click",function(){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",f:"intro_again",nonce:cdpGlobalJS.ajaxNonce}).done(e=>{"error"==e&&t.cdpNotification("error",cdpJS.strIntroUpdateIssue)}).fail(e=>{t.cdpNotification("error",cdpJS.strIntroUpdateIssue2)}),t(".cdp-s-i-a").animate({opacity:0},300,function(){t(".cdp-s-i-a").hide()}),function(){t(".cdp-intro").show().css({height:""});let e=t(".cdp-intro").height();t(".cdp-intro").css({height:"0px"}),t(".cdp-intro").animate({opacity:1,height:e+"px"},300,function(){})}()}),t(".cdp-show-projects").on("click",function(){t(".cdp-projects").is(":hidden")&&t(".cdp-projects").show(300);t(".cdp-show-projects").removeClass("cdp-pointer").animate({opacity:.5},300)}),t(".cdp-project-box").on("mouseenter",function(){t(".cdp-project-box").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-project-box").on("mouseleave",function(){t(".cdp-project-box").removeClass("cdp-half-opacity")}),t(".cdp-collapsible-title").on("click",u),t(".cdp-magic-input").on("keyup change",function(){before=t(this).html(),text=t(this).html(),$picks=['[Counter]
','[CurrentTime]
','[CurrentDate]
'],text=text.replace(/\[Counter\]/g,$picks[0]),text=text.replace(/\[CurrentDate\]/g,$picks[2]),text=text.replace(/\[CurrentTime\]/g,$picks[1]),text!=before&&t(this).html(text)}),t(".cdp-magic-input").on("focus",function(e,c){if(c)return;let o=t(this).text();" "!=o[0]&&(o=" "+o);" "!=o[o.length-1]&&(o+=" ");t(this).html(o),h(this)}),t(".cdp-magic-input").on("mouseup",".cdp-name-box-small",function(){t(this).hide(300),setTimeout(()=>{t(this).remove(),m()},300)}),t(".cdp-support-animated").on("mouseenter",function(){t(".cdp-support-animated").not(t(this)).addClass("cdp-half-opacity")}),t(".cdp-name-clickable").on("mouseup",function(e){if(e.preventDefault(),$picks=['[Counter]
','[CurrentTime]
','[CurrentDate]
'],$box={1:".cdp-names-prefix",2:".cdp-names-real-input",3:".cdp-names-suffix"},t($box[e.which]).append($picks[t(this).attr("data-cdp-val")]),m(),e.which==e)return!1}),t(".cdp-support-animated").on("mouseleave",function(){t(".cdp-support-animated").removeClass("cdp-half-opacity")}),t(".cdp-f-einput-n").on("click","button",function(){let e=t(t(this).parents(".cdp-cf")[0]).find("input"),c=t(this).text(),o="12";"V"==c[0]?o="-51":"D"==c[0]&&(o="23");if(e.val().trim().length<=0)return void t.cdpNotification("warning",cdpJS.strLicenseKeyEmpty);t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"i_love_squirrels",rat:e.val(),m:o}).done(c=>{t.isJsonString(c)&&(c=t.cdpParse(c)),"success"==c.status?"valid"==c.data.license?(t.cdpNotification("success",cdpJS.strLicenseActiveReloading),setTimeout(()=>{window.location.reload()},2e3)):"site_inactive"==c.data.license?(t.cdpNotification("success",cdpJS.strLicenseValidPressBtn),e.prop("disabled",!0),t(this).text("Activate")):void 0!==c.data&&void 0!==c.data.msg?(t.cdpNotification("success",c.data.msg),setTimeout(()=>{window.location.reload()},2e3)):t.cdpNotification("warning",cdpJS.strUnknownRespRefreshPage):"fail"==c.status?t.cdpNotification(c.fail.type,c.fail.msg):(console.error(c),t.cdpNotification("error",cdpJS.strSendRequestIssue))}).fail(e=>{t.cdpNotification("error",cdpJS.strSendRequestIssue2)})}),t(".cdp-names-real-input, .cdp-date-picked").on("keyup change",m),t('.cdp-other-options[name="after_copy"]').on("change",f),t("body").on("change keyup",".cdp-input-dynamic",function(){$input=t(t(".cdp-tooltip-content, .cdp-modal-content").find(`[name="${t(this).attr("name")}"]`)),"checkbox"==t(this).attr("type")?$input.prop("checked",t(this).is(":checked")):t($input).is("select")?($input.val(t(this).val()),t($input).hasClass("cdp-modal-input-profiles-r")&&v(!1,t(this).val())):$input.val(t(this).val());if(cdp_tooltips_update_content(),t($input).is("select")&&t($input).hasClass("cdp-premium-modal-dropdown")){let e=t("div.cdp-premium-modal-dropdown"),c=t(t(this).parents("div")[0]).find("div.cdp-premium-modal-dropdown");"2"==c.find("li.selected").data("value")?(e.find("span.current").addClass("cdp-relative"),e.find("span.current").html(cdpJS.strChangeTypeOfCopy)):e.find("span.current").removeClass("cdp-relative")}}),t("body").on("click",".cdp-tooltip-before-button",function(){l=!0;let e=t('.cdp-input-dynamic[name="tooltip-which-profile-first"]').val();"custom"!=e&&v(!1,e);t(".cdp-tooltip-before-options").hide(200),setTimeout(()=>{t(".cdp-tooltip-full-options").show(200),setTimeout(()=>{O(),setTimeout(()=>{l=!1},2e3)},200)},200)}),t("body").on("click",".cdp-tooltip-btn-copy",g),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-second"]',v),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-second-modal"]',v),t("body").on("change",'.cdp-input-dynamic[name="tooltip-which-profile-first"]',function(){v(!1,t(this).val())}),t("body").on("change",".cdp-modal-checkboxes .cdp-input-dynamic",function(){let e=t('.cdp-input-dynamic[name="tooltip-which-profile-second"]');t("#cdp-copy-modal-global").is(":visible")&&(e=t('.cdp-input-dynamic[name="tooltip-which-profile-second-modal"]'));e.val("custom_named"),cdp_tooltips_update_content(),v(!1,"custom_named")}),t("body").on("change",".cdp-modal-input-times-tooltip",x),t("body").on("change",".cdp-modal-input-times",x),t("body").on("click",".cdp-modal-times, .cdp-modal",t.cdpModalClose),t("body").on("click",".cdp-modal-open",t.cdpModal),t("body").on("change",".cdp-profile-selected",w),t("body").on("click",".cdp-show-more-d-title",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-more-d-title").is(":hidden")?(t(".cdp-more-d-title").show(300),t(this).text("(hide more options)")):(t(".cdp-more-d-title").hide(300),t(this).text("(show more options)"));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-first-chapter-cb",function(){t(".cdp-d-section").css({"max-height":"",height:""});let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,c=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,o=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;e+c+o>1?t(".cdp-d-option-select-parent").show(300):t(".cdp-d-option-select-parent").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("click",".cdp-d-search",function(){let e=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")?1:0,c=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")?1:0,d=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")?1:0;e+c+d<=0?t.cdpNotification("error",cdpJS.strCheckDuplicatesSearch):null==i?function(e=function(){}){t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"get_all_posts"}).done(c=>{t.isJsonString(c)&&(c=t.cdpParse(c)),e(c)}).fail(c=>{t.cdpNotification("error",cdpJS.strPostListIssue),console.log(c),e(!1)})}(t=>{0!=t&&p(t)}):p(i);function n(t,e){let c=parseInt(e[e.length-1]);for(let o=e.length;o>0&&(c=parseInt(e[o-1]),ext=!1,t.posts.findIndex(t=>t.ID==c)>=0?ext=!0:t.pages.findIndex(t=>t.ID==c)>=0?ext=!0:t.custom.findIndex(t=>t.ID==c)>=0?ext=!0:c=!1,1!=ext);--o);return c}function p(e){let c={posts:[],pages:[],custom:[]},d={},p={};null!=i&&(c=i);let m=!!t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked"),h=!!t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked"),f=!!t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked"),g=!!t('.cdp-d-option[name="cdp-d-b-title"]').is(":checked"),v=!!t('.cdp-d-option[name="cdp-d-b-slug"]').is(":checked"),y=!!t('.cdp-d-option[name="cdp-d-c-excerpt"]').is(":checked"),b=!!t('.cdp-d-option[name="cdp-d-c-count"]').is(":checked"),x=t('.cdp-d-option-select[name="cdp-d-d-sel-which"]').val(),k=null,_=null;if(m+h+f>1&&(k=t('.cdp-d-option-select[name="cdp-d-sels-diftyp"]').val()),1==g&&(_="1"==t('.cdp-d-option[name="cdp-radio-btn-dtitles"]:checked').val()),null==i)for(post_type in e)if("meta"!=post_type)for(post in e[post_type]){post=e[post_type][post],post.post_type=post.post_type[0].toUpperCase()+post.post_type.slice(1);let o=e.meta[post.ID]._cdp_origin,i=e.meta[post.ID]._cdp_counter,d=e.meta[post.ID]._cdp_origin_title,s=l(post.post_content),a={id:post.ID,url:post.guid,slug:post.post_name,type:post.post_type,date:post.post_date,title:post.post_title,status:post.post_status,edit:post.post_modified,excerpt:post.post_excerpt,words:u(s),origin:"object"==typeof o&&n(e,o),counter:"object"==typeof i&&i[i.length-1],origin_title:"object"==typeof d&&d[0]};if(r&&t.cdp.isPremium()&&(a.content=t.cdp.premium.prepareAdvanced(s),a.author=t.cdp.premium.prepareAdvanced(post.post_author)),"object"==typeof o){let t=parseInt(o[o.length-1]);void 0===p[t]?p[t]=1:p[t]++}c[post_type].push(a)}c=function(t){let e=JSON.parse(JSON.stringify(t));return e.posts.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.pages.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e.custom.sort((t,e)=>!1===t.origin?-1:!1===e.origin?1:0),e}(c),null==i&&(i=c);let w=[],S=[],C=!1,j=0,J=0,T=[],N=[],I=[];if("2"==k){j=1;let t=[],e=[],o=[];1==m&&(t=c.posts),1==h&&(e=c.pages),1==f&&(o=c.custom),w=(w=[].concat(t,e,o)).sort((t,e)=>t.ide.id?1:0),S=P(w)}else{let t=[],e=[],o=[];1==m&&(j+=1),1==h&&(j+=1),1==f&&(j+=1),c.posts=c.posts.sort((t,e)=>t.ide.id?1:0),1==m&&(t=P(c.posts)),c.pages=c.pages.sort((t,e)=>t.ide.id?1:0),1==h&&(e=P(c.pages)),c.custom=c.custom.sort((t,e)=>t.ide.id?1:0),1==f&&(o=P(c.custom)),S=[].concat(t,e,o)}function D(e){1==++J&&(T=e),2==J&&(N=e),3==J&&(I=e),J==j&&function(e){for(post in $tbody=t("#cdp-d-table-tbody"),$tbody.html(""),e)$tbody.append((c=e[post],t(`\n | \n | \n ${""!=c.slug?c.slug:c.url} | \n ${c.type} | \n ${c.date.slice(0,-8)} | \n ${c.words} | \n
`)));var c;if("1"==x)for(parent in d)for(child in d[parent])t(`.cdp-input-d-id[name="${d[parent][child]}"]`).prop("checked",!0);else if("2"==x)for(parent in d){t(`.cdp-input-d-id[name="${parent}"]`).prop("checked",!0);let e=Math.max(...d[parent]);for(child in d[parent])d[parent][child]!=e&&t(`.cdp-input-d-id[name="${d[parent][child]}"]`).prop("checked",!0)}else"3"==x&&t(".cdp-input-d-id").prop("checked",!0);s=d,a=x;let i=!(g||v||y||b),n=t('.cdp-d-option[name="cdp-d-a-posts"]').is(":checked")+0,p=t('.cdp-d-option[name="cdp-d-a-pages"]').is(":checked")+0,l=t('.cdp-d-option[name="cdp-d-a-customs"]').is(":checked")+0;i&&n+p+l>0&&e.length>0?(t("#cdp-d-table-tbody").find("tr").attr("data-ignore",!0),o.refresh(),t(".cdp-delete-info").hide(300),t('[data-empty-info="true"]').find("div").html(cdpJS.strFilterNotSelected),t('[data-empty-info="true"]').addClass("cdp-customized")):o.refresh();t(".cdp-d-searchbox-c").val(""),$(),0==e.length?(t.cdpNotification("warning",cdpJS.strNoDataForFilter),t(".cdp-delete-info").hide(300)):t(".cdp-not-yet-search").is(":visible")||(t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300),setTimeout(()=>{t(".cdp-d-section").css({"max-height":"",height:""}),t(".cdp-d-section").css({"max-height":`${t(".cdp-d-section").height()}px`})},320))}(S=[].concat(T,N,I))}function P(e){let c=[],o=[],i=!(g||v||y||b);if(!e)return c;function n(t,e){if(t.id==e.origin&&0!=e.origin_title){let t=e.origin_title.replace(/\[Counter\]/g,e.counter);if(e.title==t)return!0}return!1}function p(t){for(let e=0;e=.85,l=!1;l=1==p||1==a?1==y&&(""==c.excerpt||c.excerpt==t[d].excerpt):1==y&&""!=c.excerpt&&c.excerpt==t[d].excerpt;let r=1==b&&c.words==t[d].words,u=1==i&&c.id==t[d].origin&&t.findIndex(e=>e.origin==t[d].id)<=-1;!p&&g||!a&&v||!l&&y||!r&&b||!u&&i||(s(c,!0,!1),s(t[d],!1,c.id))}}D(c)}function s(t,e=!1,i=!1){o.includes(t.id)||(1==e?d[t.id]=[]:0!=i&&d[i].push(t.id),o.push(t.id),c.push(t))}r&&t.cdp.isPremium()?t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"get_authors"}).done(c=>{if(t.isJsonString(c)&&(c=t.cdpParse(c)),"success"===c.status){let o=c.users;p(e=t.cdp.premium.advancedfilter(e,o))}else!1===C&&(t.cdpNotification("info",cdpJS.strServerConnectIssue),C=!0),p(e)}).fail(()=>{!1===C&&(t.cdpNotification("info",cdpJS.strServerConnectIssue),C=!0),p(e)}):p(e)}}function l(t){return(t=(t=(t=t.replace(/\<\!\-\-(.*?)\-\-\>/gim,"")).replace(/<[^>]*>/gim," ")).replace(/\s+/gim," ")).trim()}function u(t){return(t=t.split(" ")).length}}),t("body").on("change",".cdp-input-d-id",function(){if("0"==t("#cdp-d-table-pagi-ilosc-wynikow").text())return;let e=parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text()),c=parseInt(t(".cdp-t-d-ct").text());t(this).is(":checked")?(c++,t(this).parents("tr").addClass("cdp-del")):(c--,t(this).parents("tr").removeClass("cdp-del"));if(t(".cdp-t-d-ct").text(c),c==e)t(".cdp-d-select-all").text("Deselect all"),t(".cdp-d-checkbox-all").prop("checked",!0);else{t(".cdp-d-select-all").text("Select all");let e=t(".cdp-input-d-id:visible");for(let c=0;c801&&!0!==c){let t=Math.ceil(p.length/800);for(let c=0,o=!0;c{if(t.isJsonString(e)&&(e=t.cdpParse(e)),"success"==e.status){t("#cdp-d-table-tbody").find(".cdp-del").remove();let e=i.posts.filter(t=>!p.includes(t.id)),d=i.pages.filter(t=>!p.includes(t.id)),s=i.custom.filter(t=>!p.includes(t.id));i={posts:e,pages:d,custom:s},!0!==c&&o.refresh(),$(),0==n&&t.cdpNotification("success",cdpJS.strDeletionProcessStarted),S(C),!0!==c&&($parent=t(".cdp-d-section").parents(".cdp-collapsible"),$col=t(t($parent[0]).find(".cdp-collapsible-title")[0]),u("true",$col))}else!0!==c&&t.cdpNotification("error",`${cdpJS.strDeletionTaskStart} ${"1"==l?cdpJS.strDeletionTaskEnd:""}`)}).fail(e=>{!0!==c&&t.cdpNotification("error",cdpJS.strDeletionTaskConsInfo),console.log(e)})}),t("body").on("change",".cdp-d-throttling",function(){t(".cdp-d-section").css({"max-height":"",height:""}),"1"==t(this).val()?t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").show(300):t(".cdp-d-throttling-count-p, .cdp-even-more-th-info").hide(300);setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-d-throttling-count",function(){let e=parseInt(t(this).val());isNaN(e)?t(this).val(1):e>=1&&e<=10240?e>=1&&e<=1&&t(this).val(1):e<1?t(this).val(1):t(this).val(10240)}),t("body").on("change",".cdp-custom-date-picking",m),t("body").on("mouseover",".cdp-tooltip-copy",function(){if(!0===l)return;t(this).hasClass("cdptipstered")||(t(this).cdptipster({delay:100,timer:400,debug:!1,delayTouch:[100,200],interactive:!0,distance:4,side:"bottom",contentAsHTML:!0,content:t(".cdp-tooltip-content").html(),repositionOnScroll:!0,selfDestruction:!1,trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{mouseleave:!0,click:!0,tap:!0},functionBefore:P,functionReady:M,functionAfter:A,functionFormat:H}),t(this).cdptipster("open"),t("#cdp-hideTT").length>0&&t(".cdptipster-base").hide())}),t("body").on("keyup",".cdp-d-searchbox-c",function(){if(t('[data-empty-info="true"].cdp-customized').length>0)return;let e=t(this).val();e.length>100&&(e=e.substr(0,100));if(e=(e=e.trim().replace(/\s+/gim," ").toLowerCase()).split(" "),$trs=t("#cdp-d-table-tbody").find("tr"),$trs.length<=0)return;$trs.removeAttr("data-ignore");for(let c=0;c<$trs.length;++c){$tr=t($trs[c]),$title=t($tr.find("td")[1]).text().toLowerCase(),$url=t($tr.find("td")[2]).text().toLowerCase();let o=!1;for(let t=0;t{o.refresh()},20)}),t("body").on("change",".cdp-data-set",j),t("#wpbody").on("scroll",J),t(window).on("scroll",J),t("body").on("click",".cdp-nice-select",J),t("body").on("click",".cdp-show-the-copies",function(e){e.preventDefault(),t(".cdp-d-section").css({"max-height":"",height:""}),t("#cdp-d-table-tbody").find("tr").not('[data-empty-info="true"]').removeAttr("data-ignore"),t(".cdp-d-searchbox-c").val(""),t('[data-empty-info="true"]').addClass("cdp-customized"),o.refresh(),$(),t(".cdp-d-section").css({"max-height":"",height:""}),parseInt(t("#cdp-d-table-pagi-ilosc-wynikow").text())>0&&t(".cdp-delete-info").show(300);t(".cdp-not-yet-search").is(":visible")||(t(".cdp-not-yet-search").show(300),t('[data-empty-info="true"]').hasClass("cdp-customized")||t(".cdp-delete-info").show(300));setTimeout(()=>{t(".cdp-d-section").css({"max-height":t(".cdp-d-section").height()})},310)}),t("body").on("change",".cdp-per-page-select-show",function(){let e=t(this).val();o.changePageSize(e)}),t("body").on("change",'.cdp-d-option[name="cdp-d-b-title"]',T),t("body").on("change",'.cdp-d-option[name="cdp-d-b-slug"]',T),t("body").on("click",".cdp-tab-element",function(){if(t(this).hasClass("cdp-tab-active"))return;if("true"==t(this).attr("data-disabled"))return;let e=t(t(`#${t(this).attr("data-box")}`)[0]),c=t(t(`#${t(".cdp-tab-active").attr("data-box")}`)[0]);if(!e||e.length<=0)return;t(".cdp-tab-active").removeClass("cdp-tab-active"),t(this).addClass("cdp-tab-active"),e.show(),e.css({"max-height":"",height:""});let o=e.height();e.css({"max-height":"0px",opacity:0}),e.animate({"max-height":o+"px",opacity:1},500,function(){let e=t(".cdp-d-section").height();t(".cdp-d-section").css({height:e+"px","max-height":e+"px"})}),t(".cdp-d-section").css({height:"","max-height":""}),c.css({"max-height":c.height()+"px",opacity:1}),c.animate({"max-height":"0px",opacity:0},500,function(){c.hide()}),setTimeout(()=>{c.css({"max-height":"",height:""}),e.css({"max-height":"",height:""})},510);let i=parseInt(t(window).height()/8);t("#wpbody").animate({scrollTop:jQuery(".cdp-d-section")[0].offsetTop-i},500)}),t("body").on("click",".cdp-premium-element",function(t){t.preventDefault()}),t("body").on("click",".cdp-go-to-names-chapter",function(e){e.preventDefault(),L(),u("cdp-name-section-cnx"),setTimeout(()=>{let e=parseInt(t(window).height()/4);t("#wpbody").animate({scrollTop:t(".cdp-name-section-cnx")[0].offsetTop-e},500)},400)}),t("body").on("click",".cdp-close-chapter",N),t("body").on("click",".cdp-save-options",N),t("body").on("click",".cdp-togglable-name-b",function(){"(Name of original)"==t(".cdp-togglable-name-b").text()?(t(".cdp-togglable-name-b").text("(blank)"),t(".cdp-togglable-name-b").cdptipster("content",cdpJS.strTogglableNameChange)):(t(".cdp-togglable-name-b").text(cdpJS.strTogglableName),t(".cdp-togglable-name-b").cdptipster("content",cdpJS.strTogglableNameChangeBlank));m()}),t("body").on("click",".cdp_notice_perf_close",function(){setTimeout(function(){t("#cdp_notice_error_modal").remove()},700),t.post(ajaxurl,{action:"cdp_action_handling",token:"cdp",nonce:cdpGlobalJS.ajaxNonce,f:"hide_cron_notice"})}),t("body").on("click",".cdp-copy-notice-logs",function(){!function(e){try{const c=document.createElement("textarea");c.value=e,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),document.execCommand("copy"),document.body.removeChild(c),t.cdpNotification("success",cdpJS.copySuccessfull)}catch(e){return console.log(e),t.cdpNotification("warning",cdpJS.copyFailed),!1}}(t(".cdp_notice_logs").text())}),t("#cdp_jvlabelWrap-fake").on("click",function(){if(0===t("#support-cdp").length){t(t(".cdp-container")[0]).append('