var jetpackLikesWidgetBatch=[],jetpackLikesMasterReady=!1,jetpackLikesLookAhead=2e3,jetpackCommentLikesLoadedWidgets=[];function JetpackLikesPostMessage(e,t){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return}pm({target:t,type:"likesMessage",data:e,origin:"*"})}function JetpackLikesBatchHandler(){var e=[];jQuery("div.jetpack-likes-widget-unloaded").each(function(){if(!(jetpackLikesWidgetBatch.indexOf(this.id)>-1)&&jetpackIsScrolledIntoView(this)){jetpackLikesWidgetBatch.push(this.id);var t,i=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/.exec(this.id);i&&5===i.length&&(t={blog_id:i[2],width:this.width},"post"===i[1]?t.post_id=i[3]:"comment"===i[1]&&(t.comment_id=i[3]),t.obj_id=i[4],e.push(t))}}),e.length>0&&JetpackLikesPostMessage({event:"initialBatch",requests:e},window.frames["likes-master"])}function JetpackLikesMessageListener(e,t){var i,a,s,d,o,r;if(void 0!==e.event&&("https://widgets.wp.com","https://widgets.wp.com"===t.origin))switch(e.event){case"masterReady":jQuery(document).ready(function(){jetpackLikesMasterReady=!0;var e={event:"injectStyles"},t=jQuery(".sd-text-color"),i=jQuery(".sd-link-color");jQuery("iframe.admin-bar-likes-widget").length>0&&(JetpackLikesPostMessage({event:"adminBarEnabled"},window.frames["likes-master"]),e.adminBarStyles={background:jQuery("#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a").css("background"),isRtl:"rtl"===jQuery("#wpadminbar").css("direction")}),window.addEventListener||jQuery("#wp-admin-bar-admin-bar-likes-widget").hide(),e.textStyles={color:t.css("color"),fontFamily:t.css("font-family"),fontSize:t.css("font-size"),direction:t.css("direction"),fontWeight:t.css("font-weight"),fontStyle:t.css("font-style"),textDecoration:t.css("text-decoration")},e.linkStyles={color:i.css("color"),fontFamily:i.css("font-family"),fontSize:i.css("font-size"),textDecoration:i.css("text-decoration"),fontWeight:i.css("font-weight"),fontStyle:i.css("font-style")},JetpackLikesPostMessage(e,window.frames["likes-master"]),JetpackLikesBatchHandler()});break;case"showLikeWidget":case"showCommentLikeWidget":jQuery("#"+e.id+" .likes-widget-placeholder").fadeOut("fast");break;case"killCommentLikes":jQuery(".jetpack-comment-likes-widget-wrapper").remove();break;case"clickReblogFlair":wpcom_reblog.toggle_reblog_box_flair(e.obj_id);break;case"showOtherGravatars":i=jQuery("#likes-other-gravatars"),a=i.find("ul"),i.hide(),a.html(""),i.find(".likes-text span").text(e.total),jQuery.each(e.likers,function(e,t){var i;"http"===t.profile_URL.substr(0,4)&&((i=jQuery("
  • ")).addClass(t.css_class),i.find("a").attr({href:t.profile_URL,rel:"nofollow",target:"_parent"}).addClass("wpl-liker"),i.find("img").attr({src:t.avatar_URL,alt:t.name}).css({width:"30px",height:"30px",paddingRight:"3px"}),a.append(i))}),s=jQuery("[name='"+e.parent+"']").offset(),i.css("left",s.left+e.position.left-10+"px"),i.css("top",s.top+e.position.top-33+"px"),d=Math.floor(e.width/37),(o=37*Math.ceil(e.likers.length/d)+13)>204&&(o=204),i.css("height",o+"px"),i.css("width",37*d-7+"px"),a.css("width",37*d+"px"),i.fadeIn("slow"),(r=a[0].offsetWidth-a[0].clientWidth)>0&&(i.width(i.width()+r),a.width(a.width()+r))}}function JetpackLikesWidgetQueueHandler(){var e;if(jetpackLikesMasterReady){jetpackUnloadScrolledOutWidgets();var t=jetpackGetUnloadedWidgetsInView();t.length>0&&JetpackLikesBatchHandler();for(var i=0,a=t.length;i<=a-1;i++)(e=t[i].id)&&jetpackLoadLikeWidgetIframe(e)}else setTimeout(JetpackLikesWidgetQueueHandler,500)}function jetpackLoadLikeWidgetIframe(e){var t;if(void 0!==e){(t=jQuery("#"+e)).find("iframe").remove();var i=t.find(".likes-widget-placeholder");if(i.hasClass("post-likes-widget-placeholder")){var a=document.createElement("iframe");a.class="post-likes-widget jetpack-likes-widget",a.name=t.data("name"),a.src=t.data("src"),a.height="18px",a.width="200px",a.frameBorder="0",a.scrolling="no",t.hasClass("slim-likes-widget")?(a.height="22px",a.width="68px",a.scrolling="no"):(a.height="55px",a.width="100%"),i.after(a)}if(i.hasClass("comment-likes-widget-placeholder")){var s=document.createElement("iframe");s.class="comment-likes-widget-frame jetpack-likes-widget-frame",s.name=t.data("name"),s.src=t.data("src"),s.height="18px",s.width="100%",s.frameBorder="0",s.scrolling="no",t.find(".comment-like-feedback").after(s),jetpackCommentLikesLoadedWidgets.push(s)}t.removeClass("jetpack-likes-widget-unloaded").addClass("jetpack-likes-widget-loading"),t.find("iframe").load(function(e){var i=jQuery(e.target);JetpackLikesPostMessage({event:"loadLikeWidget",name:i.attr("name"),width:i.width()},window.frames["likes-master"]),t.removeClass("jetpack-likes-widget-loading").addClass("jetpack-likes-widget-loaded"),t.hasClass("slim-likes-widget")&&t.find("iframe").Jetpack("resizeable")})}}function jetpackGetUnloadedWidgetsInView(){return jQuery("div.jetpack-likes-widget-unloaded").filter(function(){return jetpackIsScrolledIntoView(this)})}function jetpackIsScrolledIntoView(e){var t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t+jetpackLikesLookAhead>=0&&i<=window.innerHeight+jetpackLikesLookAhead}function jetpackUnloadScrolledOutWidgets(){for(var e=jetpackCommentLikesLoadedWidgets.length-1;e>=0;e--){var t=jetpackCommentLikesLoadedWidgets[e];if(!jetpackIsScrolledIntoView(t)){var i=jQuery(t).parent().parent();i.removeClass("jetpack-likes-widget-loaded jetpack-likes-widget-loading").addClass("jetpack-likes-widget-unloaded"),i.children(".comment-likes-widget-placeholder").fadeIn(),jetpackCommentLikesLoadedWidgets.splice(e,1),jQuery(t).remove()}}}pm.bind("likesMessage",JetpackLikesMessageListener),jQuery(document).click(function(e){var t=jQuery("#likes-other-gravatars");0===t.has(e.target).length&&t.fadeOut("slow")});var jetpackWidgetsDelayedExec=function(e,t){var i;return function(){i&&clearTimeout(i),i=setTimeout(t,e)}},jetpackOnScrollStopped=jetpackWidgetsDelayedExec(250,JetpackLikesWidgetQueueHandler);JetpackLikesWidgetQueueHandler(),window.addEventListener("scroll",jetpackOnScrollStopped,!0); !function(a,b){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("jquery")):a.jQueryBridget=b(a,a.jQuery)}(window,function(a,b){"use strict";function c(c,f,h){function i(a,b,d){var e,f="$()."+c+'("'+b+'")';return a.each(function(a,i){var j=h.data(i,c);if(!j)return void g(c+" not initialized. Cannot call methods, i.e. "+f);var k=j[b];if(!k||"_"==b.charAt(0))return void g(f+" is not a valid method");var l=k.apply(j,d);e=void 0===e?l:e}),void 0!==e?e:a}function j(a,b){a.each(function(a,d){var e=h.data(d,c);e?(e.option(b),e._init()):(e=new f(d,b),h.data(d,c,e))})}(h=h||b||a.jQuery)&&(f.prototype.option||(f.prototype.option=function(a){h.isPlainObject(a)&&(this.options=h.extend(!0,this.options,a))}),h.fn[c]=function(a){if("string"==typeof a){return i(this,a,e.call(arguments,1))}return j(this,a),this},d(h))}function d(a){!a||a&&a.bridget||(a.bridget=c)}var e=Array.prototype.slice,f=a.console,g=void 0===f?function(){}:function(a){f.error(a)};return d(b||a.jQuery),c}),function(a,b){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",b):"object"==typeof module&&module.exports?module.exports=b():a.EvEmitter=b()}("undefined"!=typeof window?window:this,function(){function a(){}var b=a.prototype;return b.on=function(a,b){if(a&&b){var c=this._events=this._events||{},d=c[a]=c[a]||[];return-1==d.indexOf(b)&&d.push(b),this}},b.once=function(a,b){if(a&&b){this.on(a,b);var c=this._onceEvents=this._onceEvents||{};return(c[a]=c[a]||{})[b]=!0,this}},b.off=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=c.indexOf(b);return-1!=d&&c.splice(d,1),this}},b.emitEvent=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=0,e=c[d];b=b||[];for(var f=this._onceEvents&&this._onceEvents[a];e;){var g=f&&f[e];g&&(this.off(a,e),delete f[e]),e.apply(this,b),d+=g?0:1,e=c[d]}return this}},a}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return b()}):"object"==typeof module&&module.exports?module.exports=b():a.getSize=b()}(window,function(){"use strict";function a(a){var b=parseFloat(a);return-1==a.indexOf("%")&&!isNaN(b)&&b}function b(){}function c(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0;b