Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home2/cargocap/mrbuilders.pk/wp-includes/widgets/upgrade/index.php on line 148
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home2/cargocap/mrbuilders.pk/wp-includes/widgets/upgrade/index.php on line 266
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home2/cargocap/mrbuilders.pk/wp-includes/widgets/upgrade/index.php on line 274
fg
/*
* SiteSEO
* https://siteseo.io/
* (c) SiteSEO Team <support@siteseo.io>
*/
/*
Copyright 2016 - 2024 - Benjamin Denis (email : contact@seopress.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
function siteseo_universal_tag_dropdown(){let e=!1;jQuery(".siteseo-tag-dropdown").each(function(t){let s=jQuery(this);var i=function(e){s.hasClass("tag-title")&&(jQuery(".siteseo_titles_title_meta").val(siteseo_get_field_length(jQuery(".siteseo_titles_title_meta"))+jQuery(e).attr("data-value")),jQuery(".siteseo_titles_title_meta").trigger("paste",!0)),s.hasClass("tag-description")&&(jQuery(".siteseo_titles_desc_meta").val(siteseo_get_field_length(jQuery(".siteseo_titles_desc_meta"))+jQuery(e).attr("data-value")),jQuery(".siteseo_titles_desc_meta").trigger("paste",!0))};jQuery(this).off("click").on("click",function(){function t(s){!(jQuery(s.target).hasClass("dashicons")||jQuery(s.target).hasClass("siteseo-tag-single-all"))&&(e=!1,jQuery(document).off("click",t),jQuery(".siteseo-wrap-tag-variables-list").removeClass("open"))}jQuery(this).next(".siteseo-wrap-tag-variables-list").toggleClass("open"),jQuery(this).next(".siteseo-wrap-tag-variables-list").find("li").on("click",function(e){i(this),e.stopImmediatePropagation()}).on("keyup",function(e){13===e.keyCode&&(i(this),e.stopImmediatePropagation())}),jQuery(this).next(".siteseo-wrap-tag-variables-list").find(".siteseo-tag-search-input").on("click input",function(e){(function e(t){let s=t.value.toLowerCase();jQuery(t).closest(".siteseo-tag-variables-list").find("li").filter(function(){jQuery(this).toggle(jQuery(this).text().toLowerCase().indexOf(s)>-1)})})(this),e.stopImmediatePropagation()}),e||(e=!0,jQuery(document).on("click",t))})})}async function siteseo_resolve_variable(e,t){let s=jQuery(".siteseo-metabox-tabs").data("term-id"),i=jQuery(".siteseo-metabox-tabs").data("home-id"),a=await jQuery.ajax({method:"GET",url:siteseoAjaxRealPreview.ajax_url,data:{action:"get_preview_meta_title",template:e,post_id:jQuery(".siteseo-metabox-tabs").attr("data_id"),term_id:0===s.length?void 0:s,home_id:0===i.length?void 0:i,nonce:siteseoAjaxRealPreview.get_preview_meta_title}});return a&&a.success&&a.data&&a&&a.data.length>0?a.data:e}function siteseo_get_field_length(e){return e.val().length>0?e.val()+" ":e.val()}!function(e){let t=0,s=0;e(document).ready(function(){e(document).on("click",".siteseo-metabox-tab-label",function(){let t=e(this),s=t.closest(".siteseo-metabox-tabs, .siteseo-metabox-subtabs"),i=s.find(".siteseo-metabox-tab-label-active");i.length&&i.removeClass("siteseo-metabox-tab-label-active"),t.addClass("siteseo-metabox-tab-label-active");let a=t.data("tab");s.siblings("."+a).show(),s.siblings("."+a).siblings(".siteseo-metabox-tab").hide()}),e(document).on("change",'[name="siteseo_analysis_target_kw"]',function(){e('[name="siteseo_analysis_target_kw"]').val(event.target.value)}),e(document).on("change",".siteseo-metabox-robots-options",function(){let t=e(this);if(t.is(":disabled"))return;let s=t.attr("name");t.is(":checked")?e('[name="'+s+'"]').attr("checked",!0):e('[name="'+s+'"]').attr("checked",!1)}),e(document).on("input",'[name="siteseo_robots_canonical"]',function(){e('[name="siteseo_robots_canonical"]').val(event.target.value)}),e(document).on("change",'[name="siteseo_robots_primary_cat"]',function(){e('[name="siteseo_robots_primary_cat"]').val(event.target.value)}),e(document).on("change",'[name="siteseo_redirections_enabled"]',function(){e('[name="siteseo_redirections_enabled"]').attr("checked",e(this).is(":checked"))}),e(document).on("change",'[name="siteseo_redirections_logged_status"]',function(){e('[name="siteseo_redirections_logged_status"]').val(event.target.value)}),e(document).on("change",'[name="siteseo_redirections_type"]',function(){e('[name="siteseo_redirections_type"]').val(event.target.value)}),e(document).on("input",'[name="siteseo_redirections_value"]',function(){e('[name="siteseo_redirections_value"]').val(event.target.value)}),e(document).on("click","#siteseo-sidebar-wrapper .siteseo-sidebar-tabs",function(){e(this).toggleClass("siteseo-sidebar-tabs-opened"),e(this).next().slideToggle("fast")}),e(document).on("click","#siteseo-metabox-search-mobile",function(){e(this).hide(),e(this).prev().show(),e(".siteseo-search-preview-desktop").css("max-width","414px")}),e(document).on("click","#siteseo-metabox-search-pc",function(){e(this).hide(),e(this).next().show(),e(".siteseo-search-preview-desktop").css("max-width","")}),e(document).on("click",".siteseo-metabox-tag",function(){event.preventDefault();let t=e(event.target),s=t.attr("data-tag"),i=t.closest(".siteseo-metabox-tags").next("input, textarea"),a=i.val();s&&(e("."+i.attr("class")).val(a+" "+s),i.trigger("input",!0))}),e(document).on("input paste",".siteseo_titles_title_meta",async function(s,i){let a=e(".siteseo-metabox-search-preview h3"),o=e(".siteseo_titles_title_meta").closest(".siteseo-metabox-input-wrap");if(i){var l=e("#siteseo_titles_title_meta").val();e(".siteseo_titles_title_meta").val(l),l.length<1?l=e(".siteseo_titles_title_meta").attr("placeholder"):-1!=l.indexOf("%%")&&(l=await siteseo_resolve_variable(l))}else{var l=e(event.target).val();if(e(".siteseo_titles_title_meta").val(l),l.length<1)l=e(event.target).attr("placeholder");else if(-1!=l.indexOf("%%")){if(t<4){t++;return}t=0,l=await siteseo_resolve_variable(l)}}let n=l.length,r=Math.ceil(n/60*100);n>60?a.text(l.substring(0,60)+"..."):a.text(l),o.find(".siteseo-metabox-limits-numbers em").text(n),r<=100?(o.find(".siteseo-metabox-limits-meter span").css({width:r+"%","background-color":"#00308F"}),o.find(".siteseo-metabox-limits-numbers em").css({color:"unset","font-weight":"normal"})):(o.find(".siteseo-metabox-limits-meter span").css({width:"100%","background-color":"red"}),o.find(".siteseo-metabox-limits-numbers em").css({color:"red","font-weight":"bold"}))}),e(document).on("input",".siteseo_titles_desc_meta",async function(t,i){let a=e(".siteseo-metabox-search-preview .siteseo-search-preview-description"),o=e(".siteseo_titles_desc_meta").closest(".siteseo-metabox-input-wrap");if(i){var l=e(".siteseo_titles_desc_meta").val();e(".siteseo_titles_desc_meta").val(l),-1!=l.indexOf("%%")&&(l=await siteseo_resolve_variable(l))}else{var l=e(event.target).val();if(e(".siteseo_titles_desc_meta").val(l),-1!=l.indexOf("%%")){if(s<4){s++;return}s=0,l=await siteseo_resolve_variable(l)}}let n=l.length,r=Math.ceil(n/160*100);n>160?a.text(l.substring(0,160)+"..."):a.text(l),o.find(".siteseo-metabox-limits-numbers em").text(n),r<=100?(o.find(".siteseo-metabox-limits-meter span").css({width:r+"%","background-color":"#00308F"}),o.find(".siteseo-metabox-limits-numbers em").css({color:"unset","font-weight":"normal"})):(o.find(".siteseo-metabox-limits-meter span").css({"background-color":"#DC143C",width:"100%"}),o.find(".siteseo-metabox-limits-numbers em").css({color:"red","font-weight":"bold"}))}),e(document).on("input paste","#siteseo_social_fb_title_meta",function(){let t=e(".siteseo-metabox-fb-preview .siteseo-metabox-fb-title");e(document.querySelectorAll("#siteseo_social_fb_title_meta")).val(event.target.value),t.html(event.target.value)}),e(document).on("input paste","#siteseo_social_fb_desc_meta",function(){let t=e(".siteseo-metabox-fb-preview .siteseo-metabox-fb-desc");e(document.querySelectorAll("#siteseo_social_fb_desc_meta")).val(event.target.value),t.html(event.target.value)}),e(document).on("input paste","#siteseo_social_twitter_title_meta",function(){let t=e(".siteseo-metabox-x-preview .siteseo-metabox-x-title");e(document.querySelectorAll("#siteseo_social_twitter_title_meta")).val(event.target.value),t.html(event.target.value)}),e(document).on("input paste","#siteseo_social_twitter_desc_meta",function(){e(document.querySelectorAll("#siteseo_social_twitter_desc_meta")).val(event.target.value)}),e(document).on("change paste","#siteseo_social_twitter_img_meta",function(t,s=!1){if(s){e('[name="siteseo_social_twitter_img"]').val(e("#siteseo_social_twitter_img_meta").val());return}let i=e(".siteseo-metabox-x-preview .siteseo-metabox-x-image img");e('[name="siteseo_social_twitter_img"]').val(event.target.value),i.attr("src",event.target.value)}),e(document).on("change paste","#siteseo_social_fb_img_meta",function(t,s=!1){if(s){e('[name="siteseo_social_fb_img"]').val(e("#siteseo_social_fb_img_meta").val());return}let i=e(".siteseo-metabox-fb-preview .siteseo-metabox-fb-image img");e('[name="siteseo_social_fb_img"]').val(e("#siteseo_social_fb_img_meta").val()),i.attr("src",event.target.value)}),siteseo_universal_tag_dropdown()})}(jQuery);var siteseo_sidebar_tag,siteseo_tags_is_syncing=!1;function siteseo_sync_kw_tags(e,t){if(!siteseo_tags_is_syncing){siteseo_tags_is_syncing=!0;var s=e.value;t.loadOriginalValues(s),siteseo_tags_is_syncing=!1}}