!function(n){"use strict";function s(t){return(t=parseInt(t,10))<1?0:1e6<=t?(t=Math.floor(t/1e5)/10)+"M":1e3<=t?(t=Math.floor(t/100)/10)+"K":t}function l(t,a){var i;t&&t.length&&(i=t.attr("data-post-id"),t=t.data("like-count"),(i=n(".post-like[data-post-id="+i+"]"))&&i.length&&(t=a?parseInt(t,10)+1:t-1,i.data("like-count",Math.max(0,t)),i.find(".count").text(s(t)),i.find(".label").length&&(i=(a=i.find(".label")).first().parent(),a.text(1 a").length&&n("body").on("click",".post-list-social-icon-list a.popup-window, .article-share a.popup-window, .tweet-it, .social-share-icons > a",function(t){t.preventDefault();var i=n(this),t=i.attr("data-props")?i.attr("data-props"):"width=555,height=401";return window.open(i.attr("href"),i.attr("title"),t),i.data("social-type")&&i.data("post-id")&&(t={action:loftoceanSocialAjax.social.action,post_id:i.data("post-id"),social:i.data("social-type")},n.post(loftoceanSocialAjax.url,t).done(function(){var t=(i.data("raw-counter")||0)+1,a='.loftocean-social-share-icon[data-social-type="'+i.data("social-type")+'"]';n(a).data("raw-counter",t).find("span.counter").text(s(t))})),!1}),wpApiSettings&&wpApiSettings.root&&loftoceanSocialAjax&&loftoceanSocialAjax.loadPostMetasDynamically&&(e=n(".loftocean-view-meta"),o=n(".loftocean-like-meta"),(t=n("
",{class:"temp-div"}).add(e).add(o).not(".temp-div")).length&&(a=[],i=loftoceanSocialAjax.currentPostID,t.each(function(){n(this).data("post-id")&&!a.includes(n(this).data("post-id"))&&a.push(n(this).data("post-id"))}),i&&!a.includes(parseInt(i,10))&&a.push(i),a.length&&(i=wpApiSettings.root+"loftocean/v1/get-post-metas/"+a.join(",")+"/"+(i||0),n.get(i).done(function(a,t,i){200==i.status&&200==a.status&&(a=a.data,e.each(function(){var t=n(this).data("post-id");a[t]&&a[t]["loftocean-view-count"]&&(t=a[t]["loftocean-view-count"],n(this).find(".count").length&&n(this).find(".count").text(t.format))}),o.each(function(){var t=n(this).data("post-id");a[t]&&a[t]["loftocean-like-count"]&&(t=a[t]["loftocean-like-count"],n(this).data("like-count",Math.max(0,t.raw)),n(this).find(".count").length&&n(this).find(".count").text(t.format))}))}))))})}(jQuery);