Google
Edit File: share-buttons-c3c47449768138d1b5ed-min.en-US.js
webpackJsonp([37],{144:function(t,e,i){"use strict";var n={mm:"mm",h:"h",A:"A",D:"D",ddd:"ddd",M:"M",MMM:"MMM",YYYY:"YYYY","h:mm a":"h:mm a",LT:"LT",L:"L",ll:"ll",LL:"LL",lll:"lll","DD-MMM HH:mm:ss Z":"DD-MMM HH:mm:ss Z","MMMM D, YYYY [at] h:mm a":"MMMM D, YYYY [at] h:mm a",date:"date","MMMM-YYYY":"MMMM-YYYY","YYYY-MM-DD":"YYYY-MM-DD","h:mma":"h:mma",ha:"ha","MMM D":"MMM D",DDMMYYYY:"DDMMYYYY","MMM DD [at] h:mm A":"MMM DD [at] h:mm A","MMMM D, YYYY, h:mma":"MMMM D, YYYY, h:mma","MMMM YYYY":"MMMM YYYY","ddd, MMM DD [at] h:mm A":"ddd, MMM DD [at] h:mm A","ddd, MMM DD YYYY [at] hh:mmA":"ddd, MMM DD YYYY [at] hh:mmA","MMM DD, YYYY":"MMM DD, YYYY","L hh:mma":"L hh:mma","hh:mmA":"hh:mmA","L LTS":"L LTS",LTS:"LTS","dddd, MMMM DD, YYYY":"dddd, MMMM DD, YYYY","YYYYMMDDTHHMMSS[Z]":"YYYYMMDDTHHMMSS[Z]","MM/YY":"MM/YY","MMMM D, YYYY":"MMMM D, YYYY","MMMM D, YYYY hh:mmA Z":"MMMM D, YYYY hh:mmA Z","HH:mm":"HH:mm"},a={mm:n.mm,minute:n.mm,minutes:n.mm,h:n.h,hour:n.h,hours:n.h,A:n.A,D:n.D,day:n.D,M:n.M,month:n.M,months:n.M,MMM:n.MMM,shortMonth:n.MMM,YYYY:n.YYYY,year:n.YYYY,years:n.YYYY,LT:n.LT,time:n["h:mm a"],L:n.L,abbreviatedDate:n.L,ll:n.ll,shortDate:n.ll,LL:n.LL,longDate:n.LL,lll:n.lll,shortDateTime:n.lll,"MMMM D, YYYY [at] h:mm a":n["MMMM D, YYYY [at] h:mm a"],longDateTime:n["MMMM D, YYYY [at] h:mm a"],date:n.date};t.exports={formatAliases:a,ALIAS_KEYS:n}},158:function(t,e,i){"use strict";var n=i(178);t.exports=function(t,e,i,a){return i=parseInt(i,10),isNaN(i)&&(i=0),n.pluralize(e,i,a)}},238:function(t,e,i){"use strict";var n=i(48),a=i(180).checkCookie,r=i(144).formatAliases,o=function(){return a("i18nShowLocalizedComponents")};t.exports={formatDateTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.shortDate,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return n.formatDateTime(t,e,i,o())},formatRelativeDateTime:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n.formatRelativeTime(t,e,i,o())},formatAliases:r}},3467:function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t:{default:t}}(i(27)),a=i(702),r=[],o=null,s=function(){var t=r.map(function(t){return t.itemId}).join(",");a.get("/api/blog-like-count/"+t).then(function(t){var e=t.data;r.forEach(function(t){e.hasOwnProperty(t.itemId)?t.resolve(e[t.itemId]):t.reject()}),r=[],o=null})},u=function(t){return new n.default(function(e,i){r.push({itemId:t,resolve:e,reject:i}),null!==o&&clearTimeout(o),o=setTimeout(s,100)})};t.exports={like:function(t){return a.post("/api/content-items/"+t+"/sentiment/like").then(function(t){return t.data})},getLikeCount:function(t){return u(t)}}},41:function(t,e,i){"use strict";var n=i(58),a=n.formatDateTime,r=n.formatRelativeDateTime,o=n.formatAliases;t.exports={format:i(176),t:i(4),pluralize:i(158),formatMoney:i(439),formatNumber:i(737),formatDateTime:a,formatRelativeDateTime:r,formatAliases:o}},58:function(t,e,i){"use strict";var n=i(238),a=n.formatDateTime,r=n.formatRelativeDateTime,o=i(144).formatAliases;t.exports={formatDateTime:a,formatRelativeDateTime:r,formatAliases:o}},6312:function(t,e,i){var n=i(41).t,a=i(41).pluralize,r=i(3467);YUI.add("squarespace-share-buttons",function(t){"use strict";function e(e,i){try{var n=e[u.URL_KEYS[i]],a=s.createElement("a");a.href=n;var r='.Share[data-item-path="'+a.pathname.replace(/^\/|\/$/g,"")+'"] .Share-buttons-item[data-service="'+i+'"]',o=t.Object.getValue(e,u.COUNT_KEYS[i])||0,l=s.querySelectorAll(r);Array.prototype.forEach.call(l,function(t){t.querySelector(".Share-buttons-item-count").innerHTML=o})}catch(t){}}function i(t){this.container=t.container,this.like=t.like,this.ID=t.id,this.PATH=t.path,this.SHARE_LINK=o.Static.SQUARESPACE_CONTEXT.website.baseUrl+"/"+this.PATH,this.shareButtonClickHandler=this.shareButtonClickHandler.bind(this)}var o=t.config.win,s=t.config.win.document,u={CALLBACK_NAMESPACE:"SquarespaceShareButtonCounts"+Date.now(),SERVICE_NAMES:["facebook","linkedin","pinterest"],COUNT_KEYS:{facebook:["share","share_count"],linkedin:["count"],pinterest:["count"]},URL_KEYS:{facebook:"id",linkedin:"url",pinterest:"url"},API_BASE_URLS:{facebook:"https://graph.facebook.com/?id=",linkedin:"https://www.linkedin.com/countserv/count/share?url=",pinterest:"https://widgets.pinterest.com/v1/urls/count.json?source=6&url="}};o[u.CALLBACK_NAMESPACE]={facebook:function(t){e(t,"facebook")},linkedin:function(t){e(t,"linkedin")},pinterest:function(t){e(t,"pinterest")}},i.prototype={init:function(){u.SERVICE_NAMES.forEach(function(t){this.getCount(t)},this),this.like&&(this.initializeLikes(),this.isInLocalStorage(this.like)&&this.like.classList.add("is-active")),this.container.addEventListener("click",this.shareButtonClickHandler)},destroy:function(){this.container.removeEventListener("click",this.shareButtonClickHandler)},getCount:function(t){var e=s.createElement("script");e.src=[u.API_BASE_URLS[t],this.SHARE_LINK,"&callback=",u.CALLBACK_NAMESPACE,".",t].join(""),s.body.appendChild(e),s.body.removeChild(e)},shareButtonClickHandler:function(e){e.preventDefault();var i=t.one(e.target).ancestor(".Share-buttons-item",!0);i&&i.getDOMNode()&&(i=i.getDOMNode()).getAttribute("data-service")&&(this.like&&i===this.like?this.onLike():this.onShare(i))},initializeLikes:function(){r.getLikeCount(this.ID).then(function(t){this.syncLikes(t)}.bind(this)).catch(function(){this.syncLikes()}.bind(this))},syncLikes:function(t){var e=this.like.querySelector(".Share-buttons-item-label");t||(t=parseInt(this.like.getAttribute("data-like-count"),10)),e.innerHTML=a("shareLikes",["{%n} Like","{%n} Likes"],t),this.like.setAttribute("data-like-count",t)},onLike:function(){this.like.classList.contains("is-active")||r.like(this.ID).then(function(e){!0===e.commited&&(this.incrementLike(),this.addToLocalStorage(this.like)),e.error&&(t.Squarespace.Utils.areCookiesEnabled()||t.config.win.alert(n("You need to enable cookies to be able to like something.")))}.bind(this)).catch(function(t){})},incrementLike:function(){var t=parseInt(this.like.getAttribute("data-like-count"),10);t+=1,this.like.classList.add("is-active"),this.syncLikes(t)},onShare:function(t){window.open(t.getAttribute("href"),n("Share"),"width=420,height=230,dialog");var e=t.querySelector(".Share-buttons-item-count");e&&(e.innerHTML=parseInt(e.innerHTML,10)+1)},onSharePopupClose:function(t,e){var i,n=0;i=setInterval(function(){(t.closed||n>150)&&(clearInterval(i),this.getCount(e)),n++}.bind(this),200)},getLocalStorageKey:function(t){var e=t.getAttribute("data-service");return t===this.like?"squarespace-likes":e?"squarespace-shares-"+e:null},isInLocalStorage:function(t){try{if(!localStorage||!JSON)return!1}catch(t){return!1}var e=this.getLocalStorageKey(t),i=JSON.parse(localStorage.getItem(e));if(i)return!0===i[this.ID]},addToLocalStorage:function(e){if(!t.config.win.localStorage||!t.config.win.JSON)return!1;var i=this.getLocalStorageKey(e),n=JSON.parse(localStorage.getItem(i))||{};n[this.ID]=!0,localStorage.setItem(i,JSON.stringify(n))},readCookie:function(t){for(var e=t+"=",i=s.cookie.split(";"),n=0;n<i.length;n++){for(var a=i[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(e))return a.substring(e.length,a.length)}return null}};var l;o.Squarespace.onInitialize(t,function(){l=[],t.all(".Share").each(function(t){var e=new i({container:t=t.getDOMNode(),id:t.getAttribute("data-item-identifier"),path:t.getAttribute("data-item-path"),like:t.querySelector(".Share-buttons-item--like")});e.init(),l.push(e)})}),o.Squarespace.onDestroy(t,function(){l.forEach(function(t){t.destroy()}),l=null})},"1.0",{requires:[]})},737:function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=n(i(17));e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,s.default)(t);if((0,u.default)(i,'[formatNumber] expects a numeric value. Received "'+t+'"'),!i)return"";var n=(0,a.default)({},l,e);return"percentage"===n.style?(0,r.formatNumber)(t,o.numberFormats.percent):n.round2?(0,r.formatNumber)(t,o.numberFormats.round2):n.useGrouping?(0,r.formatNumber)(t):(0,r.formatNumber)(t,o.numberFormats.withoutGrouping)};var r=i(48),o=i(124),s=n(i(284)),u=n(i(88)),l={style:"decimal",useGrouping:!0,round2:!1};t.exports=e.default},8929:function(t,e,i){i(6312)}},[8929]);