window.socialWarfare=window.socialWarfare||{},function(a,e){"use strict";function t(a){return"string"==typeof a&&a.length>0}if("function"!=typeof e){if("function"!=typeof jQuery)return void console.log("Social Warfare requires jQuery, or $ as an alias of jQuery. Please make sure your theme provides access to jQuery before activating Social Warfare.");var e=jQuery}socialWarfare.paddingTop=parseInt(e("body").css("padding-top")),socialWarfare.paddingBottom=parseInt(e("body").css("padding-bottom")),socialWarfare.initPlugin=function(){if(e("body").css({paddingTop:socialWarfare.paddingTop,paddingBottom:socialWarfare.paddingBottom}),socialWarfare.establishPanels(),socialWarfare.establishBreakpoint(),socialWarfare.panels.staticHorizontal||socialWarfare.panels.floatingSide||socialWarfare.panels.floatingHorizontal){socialWarfare.createFloatHorizontalPanel(),socialWarfare.positionFloatSidePanel(),socialWarfare.activateHoverStates(),socialWarfare.handleButtonClicks(),socialWarfare.updateFloatingButtons(),"object"==typeof swpPinIt&&1==swpPinIt.enabled&&(socialWarfare.createHoverSaveButton(),socialWarfare.triggerImageListeners()),setTimeout(function(){socialWarfare.checkListeners(0,5)},2e3);var t=Date.now();e(a).scroll(function(){t+50-Date.now()<0&&(socialWarfare.updateFloatingButtons(),t=Date.now())})}};var i;socialWarfare.onWindowResize=function(){clearTimeout(i),i=setTimeout(socialWarfare.initPlugin,100)},socialWarfare.establishPanels=function(){return socialWarfare.panels={staticHorizontal:null,floatingSide:null,floatingHorizontal:null},socialWarfare.panels.staticHorizontal=e(".swp_social_panel").not(".swp_social_panelSide"),socialWarfare.panels.floatingSide=e(".swp_social_panelSide"),socialWarfare.panels},socialWarfare.activateHoverStates=function(){socialWarfare.trigger("pre_activate_buttons"),e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer").on("mouseenter",function(){if(!e(this).hasClass("swp_nohover")){socialWarfare.resetStaticPanel();var a=e(this).find(".swp_share").outerWidth(),t=e(this).find("i.sw").outerWidth(),i=e(this).width(),o=1+(a+35)/i;e(this).find(".iconFiller").width(a+t+25+"px"),e(this).css("flex",o+" 1 0%")}}),e(".swp_social_panel:not(.swp_social_panelSide)").on("mouseleave",socialWarfare.resetStaticPanel)},socialWarfare.resetStaticPanel=function(){e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover) .iconFiller").removeAttr("style"),e(".swp_social_panel:not(.swp_social_panelSide) .nc_tweetContainer:not(.swp_nohover)").removeAttr("style")},socialWarfare.handleButtonClicks=function(){e(".nc_tweet, a.swp_CTT").off("click"),e(".nc_tweet, a.swp_CTT").on("click",function(t){if(e(this).hasClass("noPop"))return t;if(void 0===e(this).data("link"))return t;t.preventDefault();var i,o,r,n,s,l,c=e(this).data("link").replace("’","'");i=270,o=500,e(this).is(".pinterest, .buffer_link, .flipboard")&&(i=550,o=775),e(this).hasClass("nc_tweet")?l=e(this).parents(".nc_tweetContainer").data("network"):e(this).hasClass("swp_CTT")&&(l="ctt"),r=a.screenY+(a.innerHeight-i)/2,n=a.screenX+(a.innerWidth-o)/2,s="height="+i+",width="+o+",top="+r+",left="+n,a.open(c,l,s),socialWarfare.trackClick(l)})},socialWarfare.createFloatHorizontalPanel=function(){if(socialWarfare.panels.staticHorizontal.length){var a=socialWarfare.panels.staticHorizontal.data("float"),t=socialWarfare.panels.staticHorizontal.data("float-mobile"),i=socialWarfare.panels.staticHorizontal.data("float-color"),o=e('
'),r="";e(".nc_wrapper").length&&e(".nc_wrapper").remove(),e(".swp_floating_horizontal_wrapper").length&&e(".swp_floating_horizontal_wrapper").remove(),"top"!=a&&"bottom"!=a&&"top"!=t&&"bottom"!=t||(r=socialWarfare.isMobile()?t:a,o.addClass(r).hide().appendTo("body"),socialWarfare.panels.floatingHorizontal=socialWarfare.panels.staticHorizontal.first().clone(),socialWarfare.panels.floatingHorizontal.addClass("nc_floater").appendTo(o),socialWarfare.updateFloatingHorizontalDimensions(),e(".swp_social_panel .swp_count").css({transition:"padding .1s linear"}))}},socialWarfare.updateFloatingHorizontalDimensions=function(){if(socialWarfare.panels.staticHorizontal.length&&socialWarfare.panels.floatingHorizontal){var a="100%",e=0,t=socialWarfare.panels.staticHorizontal,i=t.parent();i.hasClass("swp-hidden-panel-wrap")&&(i=i.parent()),void 0!==t.offset().left&&(e=t.offset().left),void 0!==t.width()&&(a=t.width()),0==e&&(e=i.offset().left),100!=a&&0!=a||(a=i.width()),socialWarfare.panels.floatingHorizontal.css({width:a,left:e})}},socialWarfare.staticPanelIsVisible=function(){var t=!1,i=e(a).scrollTop();return e(".swp_social_panel").not(".swp_social_panelSide, .nc_floater").each(function(o){var r=e(this).offset();if(void 0!==socialWarfare.floatBeforeContent&&"1"!=socialWarfare.floatBeforeContent){var n=e(".swp-content-locator").parent();0===o&&n.length&&n.offset().top>i+e(a).height()&&(t=!0)}e(this).is(":visible")&&r.top+e(this).height()>i&&r.top0},socialWarfare.toggleFloatingHorizontalPanel=function(){if(socialWarfare.hasReferencePanel()&&socialWarfare.panels.floatingHorizontal){var a=socialWarfare.panels.floatingHorizontal.first(),t=socialWarfare.isMobile()?e(a).data("float-mobile"):e(a).data("float"),i="bottom"==t?socialWarfare.paddingBottom:socialWarfare.paddingTop,o="padding-"+t;"off"!=t&&(socialWarfare.staticPanelIsVisible()?(e(".nc_wrapper, .swp_floating_horizontal_wrapper").hide(),socialWarfare.isMobile()&&e("#wpadminbar").length&&e("#wpadminbar").css("top",0)):(i+=50,e(".nc_wrapper, .swp_floating_horizontal_wrapper").show(),socialWarfare.isMobile()&&"top"==t&&e("#wpadminbar").length&&e("#wpadminbar").css("top",a.parent().height())),e("body").css(o,i))}},socialWarfare.positionFloatSidePanel=function(){var e,t,i,o=socialWarfare.panels.floatingSide;if(o&&o.length&&!o.hasClass("swp_side_top")&&!o.hasClass("swp_side_bottom")){if(e=o.outerHeight(),t=a.innerHeight,e>t)return o.css("top",0);i=(t-e)/2,o.css("top",i)}},socialWarfare.createHoverSaveButton=function(){if(e(".tve_editor_page").length)return e(".sw-pinit-button").remove(),void e(".sw-pinit").each(function(){var a=e(".sw-pinit").contents();e(this).replaceWith(a)});var a=e(document.createElement("a"));return a.css("display: none"),a.addClass("swp-hover-pin-button"),a.text("Save"),socialWarfare.hoverSaveButton=e(a),a},socialWarfare.triggerImageListeners=function(){e(".swp-content-locator").parent().find("img").off("mouseenter",socialWarfare.renderPinterestSaveButton),e(".swp-content-locator").parent().find("img").on("mouseenter",socialWarfare.renderPinterestSaveButton),setTimeout(socialWarfare.triggerImageListeners,2e3)},socialWarfare.getPinMedia=function(a){if(t(swpPinIt.image_source))return swpPinIt.image_source;if(t(a.attr("src")))return a.attr("src");var i=["src","lazy-src","media"],o="";if(i.some(function(e){if(t(a.data(e)))return o=a.data(e),!0}),""!=o){var r=e("");return r.attr("src",o),r.prop("src")}},socialWarfare.getPinDescription=function(a){return t(a.data("pin-description"))?a.data("pin-description"):t(swpPinIt.image_description)?swpPinIt.image_description:t(a.attr("title"))?a.attr("title"):t(a.attr("alt"))?a.attr("alt"):t(swpPinIt.post_title)?swpPinIt.post_title:void 0},socialWarfare.enablePinterestSaveButtons=function(){jQuery("img").on("mouseenter",function(){var a=socialWarfare.findPinterestBrowserSaveButtons();void 0!==a&&a&&socialWarfare.removePinterestBrowserSaveButtons(a)})},socialWarfare.toggleHoverSaveDisplay=function(a){var t=a.offset().top,i=a.offset().left;switch(swpPinIt.vLocation){case"top":t+=15;break;case"middle":var o=a.height()/2-7.5-12;t+=o;break;case"bottom":t+=a.height()-15-24}switch(swpPinIt.hLocation){case"left":i+=15;break;case"center":var o=a.width()/2-7.5-60;i+=o;break;case"right":i+=a.width()-15-120}socialWarfare.hoverSaveButton.css("top",t),socialWarfare.hoverSaveButton.css("left",i),a.on("mouseleave",function(a){"swp-hover-pin-button"!=a.relatedTarget.className&&e(".swp-hover-pin-button").remove()}),e(document.body).append(socialWarfare.hoverSaveButton)},socialWarfare.renderPinterestSaveButton=function(t){function i(t){var i=e(a).width()-1264,o=e(a).height()-506,r=",top="+o+",left="+i;a.open(s,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"+r),socialWarfare.trackClick("pin_image"),e(".swp-hover-pin-button").remove()}if(!(t.relatedTarget&&"swp-hover-pin-button"==t.relatedTarget.className||e(".swp-hover-pin-button").length>0)){var o=e(t.target);if(!(void 0!=typeof swpPinIt.disableOnAnchors&&swpPinIt.disableOnAnchors&&o.parents().filter("a").length||o.outerHeight()t)){var i=e(".swp_social_panel");if(i.length>0&&i.find(".swp_pinterest"))return void socialWarfare.handleButtonClicks();setTimeout(function(){socialWarfare.checkListeners(++a,t)},2e3)}},socialWarfare.establishBreakpoint=function(){var a=e(".swp_social_panel");socialWarfare.breakpoint=1100,(a.length&&a.data("min-width")||0==a.data("min-width"))&&(socialWarfare.breakpoint=parseInt(a.data("min-width")))},socialWarfare.isMobile=function(){return e(a).width()