function lightbox(e){document.querySelectorAll(e).forEach(function(e){e.addEventListener("click",function(e){!function(t){t.preventDefault();for(var n,o=[],i=0,e=t.target.closest(".kg-card").previousElementSibling;e&&(e.classList.contains("kg-image-card")||e.classList.contains("kg-gallery-card"));){var r=[];e.querySelectorAll("img").forEach(function(e){r.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e}),i+=1}),e=e.previousElementSibling,o=r.concat(o)}t.target.classList.contains("kg-image")?o.push({src:t.target.getAttribute("src"),msrc:t.target.getAttribute("src"),w:t.target.getAttribute("width"),h:t.target.getAttribute("height"),el:t.target}):(n=!1,t.target.closest(".kg-gallery-card").querySelectorAll("img").forEach(function(e){o.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e}),n||e===t.target?n=!0:i+=1}));for(var a=t.target.closest(".kg-card").nextElementSibling;a&&(a.classList.contains("kg-image-card")||a.classList.contains("kg-gallery-card"));)a.querySelectorAll("img").forEach(function(e){o.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e})}),a=a.nextElementSibling;var s=document.querySelectorAll(".pswp")[0];new PhotoSwipe(s,PhotoSwipeUI_Default,o,{bgOpacity:.9,closeOnScroll:!0,fullscreenEl:!1,history:!1,index:i,shareEl:!1,zoomEl:!1,getThumbBoundsFn:function(e){var t=o[e].el,e=window.pageYOffset||document.documentElement.scrollTop,t=t.getBoundingClientRect();return{x:t.left,y:t.top+e,w:t.width}}}).init()}(e)})})}!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},e=n[e]=n[e]||[];return-1==e.indexOf(t)&&e.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){e=this._events&&this._events[e];if(e&&e.length){t=e.indexOf(t);return-1!=t&&e.splice(t,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var o=this._onceEvents&&this._onceEvents[e],i=0;ix
',t.appendChild(n.childNodes[1])),e&&r.extend(i,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var o=".fitvidsignore";i.ignore&&(o=o+", "+i.ignore);e=r(this).find(e.join(","));(e=(e=e.not("object object")).not(o)).each(function(){var e,t,n=r(this);0').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),n.removeAttr("height").removeAttr("width"))})})},r.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipeUI_Default=t()}(this,function(){"use strict";return function(o,s){function e(e){if(k)return!0;e=e||window.event,S.timeToIdle&&S.mouseUsed&&!x&&Z();for(var t,n,o=(e.target||e.srcElement).getAttribute("class")||"",i=0;iS.fitControlsWidth?(t=S.barsSize,S.captionEl&&"auto"===t.bottom?(h||((h=s.createEl("pswp__caption pswp__caption--fake")).appendChild(s.createEl("pswp__caption__center")),m.insertBefore(h,f),s.addClass(m,"pswp__ui--fit")),S.addCaptionHTMLFn(e,h,!0)?(e=h.clientHeight,n.bottom=parseInt(e,10)||44):n.bottom=t.top):n.bottom="auto"===t.bottom?0:t.bottom,n.top=t.top):n.top=n.bottom=0}function d(){function e(e){if(e)for(var t=e.length,n=0;n"+e.label+"",S.parseShareButtonOut&&(i=S.parseShareButtonOut(e,i));y.children[0].innerHTML=i,y.children[0].onclick=a},P=0,Z=function(){clearTimeout(L),P=0,x&&D.setIdle(!1)},z=function(e){I!==e&&(t(E,"preloader--active",!e),I=e)},N=[{name:"caption",option:"captionEl",onInit:function(e){f=e}},{name:"share-modal",option:"shareEl",onInit:function(e){y=e},onTap:function(){r()}},{name:"button--share",option:"shareEl",onInit:function(e){v=e},onTap:function(){r()}},{name:"button--zoom",option:"zoomEl",onTap:o.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){g=e}},{name:"button--close",option:"closeEl",onTap:o.close},{name:"button--arrow--left",option:"arrowEl",onTap:o.prev},{name:"button--arrow--right",option:"arrowEl",onTap:o.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){p.isFullscreen()?p.exit():p.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){E=e}}];D.init=function(){var t;s.extend(o.options,F,!0),S=o.options,m=s.getChildByClass(o.scrollWrap,"pswp__ui"),(b=o.listen)("onVerticalDrag",function(e){M&&e<.95?D.hideControls():!M&&.95<=e&&D.showControls()}),b("onPinchClose",function(e){M&&e<.9?(D.hideControls(),t=!0):t&&!M&&.9=jt()-1&&t<0)&&(e=xt.x+t*g.mainScrollEndFriction)),xt.x=e,ot(e,K)}function l(e,t){var n=bt[e]-Ye[e];return Ue[e]+He[e]+n-t/X*n}function w(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)}function c(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function p(e,t){return e=Qt(h.currItem,We,e),t&&(Oe=e),e}function x(e){return(e=e||h.currItem).initialZoomLevel}function b(e){return 0<(e=e||h.currItem).w?g.maxSpreadZoom:1}function E(e,t,n,o){return o===h.currItem.initialZoomLevel?(n[e]=h.currItem.initialPosition[e],!0):(n[e]=l(e,o),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]Oe.min[e]||rOe.min[e]&&(c=g.panEndFriction,Oe.min[e],n=Oe.min[e]-Ue[e]),(n<=0||l<0)&&1ft.x&&(i=ft.x)):Oe.min.x!==Oe.max.x&&(o=r)):(rh.currItem.fitRatio&&(Ke[e]+=t[e]*c)):(void 0!==i&&(d(i,!0),Le=i!==ft.x),Oe.min.x!==Oe.max.x&&(void 0!==o?Ke.x=o:Le||(Ke.x+=t.x*c)),void 0!==i)}function Z(e){var t;"mousedown"===e.type&&0h.currItem.fitRatio&&Mt(xe))}}var q,B,H,U,K,W,j,Y,G,V,X,Q,$,J,ee,te,ne,oe,ie,re,ae,se,le,ce,ue,de,pe,me,fe,he,ge,ve,ye,we,xe,be,Ee,Ie,Ce,Te,Se,ke,Ae,Le,De,_e,Me,Oe,Fe,Re,Pe,Ze,ze,Ne,qe,Be,He=o(),Ue=o(),Ke=o(),We={},je=0,Ye={},Ge=o(),Ve=0,Xe=!0,Qe=[],$e={},Je=!1,et={},tt=function(e){Fe&&(e&&(V>h.currItem.fitRatio?Je||($t(h.currItem,!1,!0),Je=!0):Je&&($t(h.currItem),Je=!1)),s(Fe,Ke.x,Ke.y,V))},nt=function(e){e.container&&s(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},ot=function(e,t){t[se]=Q+e+"px, 0px"+$},it=null,rt=function(){it&&(f.unbind(document,"mousemove",rt),f.addClass(m,"pswp--has_mouse"),g.mouseUsed=!0,v("mouseUsed")),it=setTimeout(function(){it=null},100)},at={},st=0,t={shout:v,listen:r,viewportSize:We,options:g,isMainScrollAnimating:function(){return Re},getZoomLevel:function(){return V},getCurrentIndex:function(){return U},isDragging:function(){return Ce},isZooming:function(){return _e},setScrollOffset:function(e,t){Ye.x=e,he=Ye.y=t,v("updateScrollOffset",Ye)},applyZoomPan:function(e,t,n,o){Ke.x=t,Ke.y=n,V=e,tt(o)},init:function(){if(!q&&!B){var e;h.framework=f,h.template=m,h.bg=f.getChildByClass(m,"pswp__bg"),pe=m.className,q=!0,ge=f.detectFeatures(),ue=ge.raf,de=ge.caf,se=ge.transform,fe=ge.oldIE,h.scrollWrap=f.getChildByClass(m,"pswp__scroll-wrap"),h.container=f.getChildByClass(h.scrollWrap,"pswp__container"),K=h.container.style,h.itemHolders=te=[{el:h.container.children[0],wrap:0,index:-1},{el:h.container.children[1],wrap:0,index:-1},{el:h.container.children[2],wrap:0,index:-1}],te[0].el.style.display=te[2].el.style.display="none",function(){if(se){var e=ge.perspective&&!ce;return Q="translate"+(e?"3d(":"("),$=ge.perspective?", 0px)":")"}se="left",f.addClass(m,"pswp--ie"),ot=function(e,t){t.left=e+"px"},nt=function(e){var t=1=jt())&&(U=0),h.currItem=Wt(U),(ge.isOldIOSPhone||ge.isOldAndroid)&&(Xe=!1),m.setAttribute("aria-hidden","false"),g.modal&&(Xe?m.style.position="fixed":(m.style.position="absolute",m.style.top=f.getScrollY()+"px")),void 0===he&&(v("initialLayout"),he=me=f.getScrollY());t="pswp--open ";for(g.mainClass&&(t+=g.mainClass+" "),g.showHideOpacity&&(t+="pswp--animate_opacity "),t+=ce?"pswp--touch":"pswp--notouch",t+=ge.animationName?" pswp--css_animation":"",t+=ge.svg?" pswp--svg":"",f.addClass(m,t),h.updateSize(),W=-1,Ve=null,e=0;e<3;e++)ot((e+W)*Ge.x,te[e].el.style);fe||f.bind(h.scrollWrap,Y,h),r("initialZoomInEnd",function(){h.setContent(te[0],U-1),h.setContent(te[2],U+1),te[0].el.style.display=te[2].el.style.display="block",g.focus&&m.focus(),f.bind(document,"keydown",h),ge.transform&&f.bind(h.scrollWrap,"click",h),g.mouseUsed||f.bind(document,"mousemove",rt),f.bind(window,"resize scroll orientationchange",h),v("bindEvents")}),h.setContent(te[1],U),h.updateCurrItem(),v("afterInit"),Xe||(J=setInterval(function(){st||Ce||_e||V!==h.currItem.initialZoomLevel||h.updateSize()},1e3)),f.addClass(m,"pswp--visible")}},close:function(){q&&(B=!(q=!1),v("close"),f.unbind(window,"resize scroll orientationchange",h),f.unbind(window,"scroll",G.scroll),f.unbind(document,"keydown",h),f.unbind(document,"mousemove",rt),ge.transform&&f.unbind(h.scrollWrap,"click",h),Ce&&f.unbind(window,j,h),clearTimeout(ve),v("unbindEvents"),Yt(h.currItem,null,!0,h.destroy))},destroy:function(){v("destroy"),Bt&&clearTimeout(Bt),m.setAttribute("aria-hidden","true"),m.className=pe,J&&clearInterval(J),f.unbind(h.scrollWrap,Y,h),f.unbind(window,"scroll",h),It(),A(),et=null},panTo:function(e,t,n){n||(e>Oe.min.x?e=Oe.min.x:eOe.min.y?t=Oe.min.y:th.currItem.initialZoomLevel+h.currItem.initialZoomLevel/15&&(qe=!0),n=1,e=x(),r=b(),iOe.min[t]?o.backAnimDestination[t]=Oe.min[t]:Ke[t]=jt()&&(U=g.loop?0:jt()-1,i=!0),i&&!g.loop||(Ve+=r,je-=r,n=!0));var i=Ge.x*je,r=Math.abs(i-xt.x),a=n||i>xt.x==0The image could not be loaded.',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Ht.length}},Qt=function(e,t,n){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=Pt(),e.initialPosition=e.bounds.center,e.bounds;var o,i,r,a=!n;return a&&(e.vGap||(e.vGap={top:0,bottom:0}),v("parseVerticalMargin",e)),Gt.x=t.x,Gt.y=t.y-e.vGap.top-e.vGap.bottom,a&&(o=Gt.x/e.w,i=Gt.y/e.h,e.fitRatio=oGt.x?Math.round(Gt.x-o):r.center.x,r.max.y=i>Gt.y?Math.round(Gt.y-i)+t.vGap.top:r.center.y,r.min.x=o>Gt.x?0:r.center.x,r.min.y=i>Gt.y?t.vGap.top:r.center.y,a&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},$t=function(e,t,n){var o;e.src&&(t=t||e.container.lastChild,o=n?e.w:Math.round(e.w*e.fitRatio),n=n?e.h:Math.round(e.h*e.fitRatio),e.placeholder&&!e.loaded&&(e.placeholder.style.width=o+"px",e.placeholder.style.height=n+"px"),t.style.width=o+"px",t.style.height=n+"px")};i("Controller",{publicMethods:{lazyLoadItem:function(e){e=a(e);var t=Wt(e);t&&(!t.loaded&&!t.loading||ee)&&(v("gettingData",e,t),t.src&&zt(t))},initController:function(){f.extend(g,Xt,!0),h.items=Ht=e,Wt=h.getItemAt,jt=g.getNumItemsFn,g.loop,jt()<3&&(g.loop=!1),r("beforeChange",function(e){for(var t=g.preload,n=null===e||0<=e,o=Math.min(t[0],jt()),i=Math.min(t[1],jt()),r=1;r<=(n?i:o);r++)h.lazyLoadItem(U+r);for(r=1;r<=(n?o:i);r++)h.lazyLoadItem(U-r)}),r("initialLayout",function(){h.currItem.initialLayout=g.getThumbBoundsFn&&g.getThumbBoundsFn(U)}),r("mainScrollAnimComplete",qt),r("initialZoomInEnd",qt),r("destroy",function(){for(var e,t=0;t=Oe.max.x&&n<=Oe.min.y&&n>=Oe.max.y)&&e.preventDefault(),h.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:We.x/2+Ye.x,y:We.y/2+Ye.y};var t=g.getDoubleTapZoom(!0,h.currItem),n=V===t;h.mouseZoomedIn=!n,h.zoomTo(n?h.currItem.initialZoomLevel:t,e,333),f[(n?"remove":"add")+"Class"](m,"pswp--zoomed-in")}}});function on(){return vn.hash.substring(1)}function rn(){sn&&clearTimeout(sn),cn&&clearTimeout(cn)}function an(){var e=on(),t={};if(e.length<5)return t;var n,o=e.split("&");for(r=0;ri.offsetWidth;){if(!r.lastElementChild)return;e.unshift(r.lastElementChild),r.lastElementChild.remove()}if(e.length){const t=document.createElement("button");t.setAttribute("class","nav-more-toggle"),t.setAttribute("aria-label","More"),t.innerHTML='';const n=document.createElement("div");n.setAttribute("class","gh-dropdown"),10<=e.length?(document.body.classList.add("is-dropdown-mega"),n.style.gridTemplateRows="repeat("+Math.ceil(e.length/2)+", 1fr)"):document.body.classList.remove("is-dropdown-mega"),e.forEach(function(e){n.appendChild(e)}),t.appendChild(n),r.appendChild(t),document.body.classList.add("is-dropdown-loaded"),t.addEventListener("click",function(){document.body.classList.toggle("is-dropdown-open")}),a=function(e){!t.contains(e.target)&&document.body.classList.contains("is-dropdown-open")&&document.body.classList.remove("is-dropdown-open")},window.addEventListener("click",a)}else document.body.classList.add("is-dropdown-loaded")}}imagesLoaded(e,function(){n()}),window.addEventListener("resize",function(){setTimeout(function(){window.removeEventListener("click",a),r.innerHTML=t,n()},1)})}}(),function(t,n){var o,i,r,a,s,l,c,u;function d(){if(404===this.status)return t.removeEventListener("scroll",m),void t.removeEventListener("resize",f);this.response.querySelectorAll("article.post-card").forEach(function(e){i.appendChild(n.importNode(e,!0))});var e=this.response.querySelector("link[rel=next]");e?o.href=e.href:(t.removeEventListener("scroll",m),t.removeEventListener("resize",f)),u=n.documentElement.scrollHeight,s=a=!1}function e(){var e;s||(l+c<=u-r?a=!1:(s=!0,(e=new t.XMLHttpRequest).responseType="document",e.addEventListener("load",d),e.open("GET",o.href),e.send(null)))}function p(){a||t.requestAnimationFrame(e),a=!0}function m(){l=t.scrollY,p()}function f(){c=t.innerHeight,u=n.documentElement.scrollHeight,p()}n.documentElement.classList.contains("no-infinite-scroll")||(!(o=n.querySelector("link[rel=next]"))||(i=n.querySelector(".post-feed"))&&(s=a=!(r=300),l=t.scrollY,c=t.innerHeight,u=n.documentElement.scrollHeight,t.addEventListener("scroll",m,{passive:!0}),t.addEventListener("resize",f),p()))}(window,document),lightbox(".kg-image-card > .kg-image[width][height], .kg-gallery-image > img");
//# sourceMappingURL=casper.js.map