rittenhop-ghost/content/themes/solo/assets/built/main.min.js
2024-08-29 19:55:56 -04:00

1 line
61 KiB
JavaScript

function dropdown(){const o=window.matchMedia("(max-width: 767px)"),i=document.querySelector(".gh-head-menu"),a=i?.querySelector(".nav");if(a){const e=document.querySelector(".gh-head-logo"),t=a.innerHTML;o.matches&&a.querySelectorAll("li").forEach(function(e,t){e.style.transitionDelay=.03*(t+1)+"s"});const n=function(){if(!o.matches){for(var e=[];a.offsetWidth+64>i.offsetWidth&&a.lastElementChild;)e.unshift(a.lastElementChild),a.lastElementChild.remove();if(e.length){const t=document.createElement("button"),n=(t.setAttribute("class","nav-more-toggle gh-icon-btn"),t.setAttribute("aria-label","More"),t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="currentColor"><path d="M21.333 16c0-1.473 1.194-2.667 2.667-2.667v0c1.473 0 2.667 1.194 2.667 2.667v0c0 1.473-1.194 2.667-2.667 2.667v0c-1.473 0-2.667-1.194-2.667-2.667v0zM13.333 16c0-1.473 1.194-2.667 2.667-2.667v0c1.473 0 2.667 1.194 2.667 2.667v0c0 1.473-1.194 2.667-2.667 2.667v0c-1.473 0-2.667-1.194-2.667-2.667v0zM5.333 16c0-1.473 1.194-2.667 2.667-2.667v0c1.473 0 2.667 1.194 2.667 2.667v0c0 1.473-1.194 2.667-2.667 2.667v0c-1.473 0-2.667-1.194-2.667-2.667v0z"></path></svg>',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),a.appendChild(t),document.body.classList.add("is-dropdown-loaded"),window.addEventListener("click",function(e){document.body.classList.contains("is-dropdown-open")?document.body.classList.remove("is-dropdown-open"):t.contains(e.target)&&document.body.classList.add("is-dropdown-open")})}else document.body.classList.add("is-dropdown-loaded")}};imagesLoaded(e,function(){n()}),window.addEventListener("load",function(){e||n()}),window.addEventListener("resize",function(){setTimeout(()=>{a.innerHTML=t,n()},1)})}}function lightbox(e){document.querySelectorAll(e).forEach(function(e){e.addEventListener("click",function(e){var t=e;t.preventDefault();for(var n,o=[],i=0,a=t.target.closest(".kg-card").previousElementSibling;a&&(a.classList.contains("kg-image-card")||a.classList.contains("kg-gallery-card"));){var r=[];a.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}),a=a.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 s=t.target.closest(".kg-card").nextElementSibling;s&&(s.classList.contains("kg-image-card")||s.classList.contains("kg-gallery-card"));)s.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})}),s=s.nextElementSibling;e=document.querySelectorAll(".pswp")[0];new PhotoSwipe(e,PhotoSwipeUI_Default,o,{bgOpacity:.9,closeOnScroll:!0,fullscreenEl:!1,history:!1,index:i,shareEl:!1,zoomEl:!1,getThumbBoundsFn:function(e){var e=o[e].el,t=window.pageYOffset||document.documentElement.scrollTop,e=e.getBoundingClientRect();return{x:e.left,y:e.top+t,w:e.width}}}).init()})})}function pagination(e,s,l=!1){const c=document.querySelector(".gh-feed");if(!c)return;let t=!1;async function n(){var t=document.querySelector("link[rel=next]");if(t)try{var e=await(await fetch(t.href)).text(),n=(new DOMParser).parseFromString(e,"text/html"),o=n.querySelectorAll(".gh-feed:not(.gh-featured):not(.gh-related) > *");const a=document.createDocumentFragment(),r=[];o.forEach(function(e){e=document.importNode(e,!0);l&&(e.style.visibility="hidden"),a.appendChild(e),r.push(e)}),c.appendChild(a),s&&s(r,d);var i=n.querySelector("link[rel=next]");i&&i.href?t.href=i.href:(t.remove(),u&&u.remove())}catch(e){throw t.remove(),u&&u.remove(),e}}const o=c.nextElementSibling||c.parentElement.nextElementSibling||document.querySelector(".gh-foot"),u=document.querySelector(".gh-loadmore"),d=(!document.querySelector("link[rel=next]")&&u&&u.remove(),async function(){o.getBoundingClientRect().top<=window.innerHeight&&document.querySelector("link[rel=next]")&&await n()});const i=new IntersectionObserver(async function(e){if(!t){if(t=!0,e[0].isIntersecting)if(l)await n();else for(;o.getBoundingClientRect().top<=window.innerHeight&&document.querySelector("link[rel=next]");)await n();t=!1,document.querySelector("link[rel=next]")||i.disconnect()}});e?i.observe(o):u.addEventListener("click",n)}function initParallax(){jarallax(document.querySelectorAll(".has-parallax-feed .gh-card"),{speed:.8})}!function(e,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){var n;return e&&t&&((n=(n=this._events=this._events||{})[e]=n[e]||[]).includes(t)||n.push(t)),this},t.once=function(e,t){var n;return e&&t&&(this.on(e,t),((n=this._onceEvents=this._onceEvents||{})[e]=n[e]||{})[t]=!0),this},t.off=function(e,t){e=this._events&&this._events[e];return e&&e.length&&-1!=(t=e.indexOf(t))&&e.splice(t,1),this},t.emitEvent=function(e,t){let n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];var o,i=this._onceEvents&&this._onceEvents[e];for(o of n)i&&i[o]&&(this.off(e,o),delete i[o]),o.apply(this,t)}return this},t.allOff=function(){return delete this._events,delete this._onceEvents,this},e}),function(e,t){"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){let a=t.jQuery,r=t.console;function s(e,t,n){if(!(this instanceof s))return new s(e,t,n);let o=e;var i;(o="string"==typeof e?document.querySelectorAll(e):o)?(this.elements=(i=o,Array.isArray(i)?i:"object"==typeof i&&"number"==typeof i.length?[...i]:[i]),this.options={},"function"==typeof t?n=t:Object.assign(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred),setTimeout(this.check.bind(this))):r.error("Bad element for imagesLoaded "+(o||e))}(s.prototype=Object.create(e.prototype)).getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const i=[1,9,11],l=(s.prototype.addElementImages=function(e){"IMG"===e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t,n,o=e["nodeType"];if(o&&i.includes(o)){for(t of e.querySelectorAll("img"))this.addImage(t);if("string"==typeof this.options.background)for(n of e.querySelectorAll(this.options.background))this.addElementBackgroundImages(n)}},/url\((['"])?(.*?)\1\)/gi);function n(e){this.img=e}function o(e,t){this.url=e,this.element=t,this.img=new Image}return s.prototype.addElementBackgroundImages=function(t){var n=getComputedStyle(t);if(n){let e=l.exec(n.backgroundImage);for(;null!==e;){var o=e&&e[2];o&&this.addBackground(o,t),e=l.exec(n.backgroundImage)}}},s.prototype.addImage=function(e){e=new n(e);this.images.push(e)},s.prototype.addBackground=function(e,t){e=new o(e,t);this.images.push(e)},s.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,this.images.length){let t=(e,t,n)=>{setTimeout(()=>{this.progress(e,t,n)})};this.images.forEach(function(e){e.once("progress",t),e.check()})}else this.complete()},s.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&r&&r.log("progress: "+n,e,t)},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred&&(e=this.hasAnyBroken?"reject":"resolve",this.jqDeferred[e](this))},(n.prototype=Object.create(e.prototype)).check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},n.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},n.prototype.confirm=function(e,t){this.isLoaded=e;e=this.img.parentNode,e="PICTURE"===e.nodeName?e:this.img;this.emitEvent("progress",[this,e,t])},n.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},n.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},n.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},(o.prototype=Object.create(n.prototype)).check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},o.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},o.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},(s.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&((a=e).fn.imagesLoaded=function(e,t){return new s(this,e,t).jqDeferred.promise(a(this))})})(),s}),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(A)return!0;e=e||window.event,T.timeToIdle&&T.mouseUsed&&!x&&l();for(var t,n,o=(e.target||e.srcElement).getAttribute("class")||"",i=0;i<F.length;i++)(t=F[i]).onTap&&-1<o.indexOf("pswp__"+t.name)&&(t.onTap(),n=!0);n&&(e.stopPropagation&&e.stopPropagation(),A=!0,e=s.features.isOldAndroid?600:30,setTimeout(function(){A=!1},e))}function n(){var e=1===T.getNumItemsFn();e!==C&&(_(p,"ui--one-slide",e),C=e)}function r(){_(y,"share-modal--hidden",O)}function i(){if((O=!O)?(s.removeClass(y,"pswp__share-modal--fade-in"),setTimeout(function(){O&&r()},300)):(r(),setTimeout(function(){O||s.addClass(y,"pswp__share-modal--fade-in")},30)),!O){for(var e,t,n,o,i="",a=0;a<T.shareButtons.length;a++)e=T.shareButtons[a],t=T.getImageURLForShare(e),n=T.getPageURLForShare(e),o=T.getTextForShare(e),i+='<a href="'+e.url.replace("{{url}}",encodeURIComponent(n)).replace("{{image_url}}",encodeURIComponent(t)).replace("{{raw_image_url}}",t).replace("{{text}}",encodeURIComponent(o))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",T.parseShareButtonOut&&(i=T.parseShareButtonOut(e,i));y.children[0].innerHTML=i,y.children[0].onclick=Z}}function a(e){for(var t=0;t<T.closeElClasses.length;t++)if(s.hasClass(e,"pswp__"+T.closeElClasses[t]))return!0}function l(){clearTimeout(k),P=0,x&&D.setIdle(!1)}function c(e){(e=(e=e||window.event).relatedTarget||e.toElement)&&"HTML"!==e.nodeName||(clearTimeout(k),k=setTimeout(function(){D.setIdle(!0)},T.timeToIdleOutside))}function u(e){E!==e&&(_(b,"preloader--active",!e),E=e)}function d(e){var t,n=e.vGap;!o.likelyTouchDevice||T.mouseUsed||screen.width>T.fitControlsWidth?(t=T.barsSize,T.captionEl&&"auto"===t.bottom?(h||((h=s.createEl("pswp__caption pswp__caption--fake")).appendChild(s.createEl("pswp__caption__center")),p.insertBefore(h,f),s.addClass(p,"pswp__ui--fit")),T.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 R(){function e(e){if(e)for(var t=e.length,n=0;n<t;n++){i=e[n],a=i.className;for(var o=0;o<F.length;o++)r=F[o],-1<a.indexOf("pswp__"+r.name)&&(T[r.option]?(s.removeClass(i,"pswp__element--disabled"),r.onInit&&r.onInit(i)):s.addClass(i,"pswp__element--disabled"))}}e(p.children);var i,a,r,t=s.getChildByClass(p,"pswp__top-bar");t&&e(t.children)}var m,p,f,h,t,g,y,v,x,w,b,E,I,C,T,A,S,k,D=this,L=!1,M=!0,O=!0,z={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return o.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return o.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},_=function(e,t,n){s[(n?"add":"remove")+"Class"](e,"pswp__"+t)},Z=function(e){var t=(e=e||window.event).target||e.srcElement;return o.shout("shareLinkClick",e,t),!(!t.href||!t.hasAttribute("download")&&(window.open(t.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),O||i(),1))},P=0,F=[{name:"caption",option:"captionEl",onInit:function(e){f=e}},{name:"share-modal",option:"shareEl",onInit:function(e){y=e},onTap:function(){i()}},{name:"button--share",option:"shareEl",onInit:function(e){g=e},onTap:function(){i()}},{name:"button--zoom",option:"zoomEl",onTap:o.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){t=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(){m.isFullscreen()?m.exit():m.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){b=e}}];D.init=function(){var t;s.extend(o.options,z,!0),T=o.options,p=s.getChildByClass(o.scrollWrap,"pswp__ui"),(w=o.listen)("onVerticalDrag",function(e){M&&e<.95?D.hideControls():!M&&.95<=e&&D.showControls()}),w("onPinchClose",function(e){M&&e<.9?(D.hideControls(),t=!0):t&&!M&&.9<e&&D.showControls()}),w("zoomGestureEnded",function(){(t=!1)&&!M&&D.showControls()}),w("beforeChange",D.update),w("doubleTap",function(e){var t=o.currItem.initialZoomLevel;o.getZoomLevel()!==t?o.zoomTo(t,e,333):o.zoomTo(T.getDoubleTapZoom(!1,o.currItem),e,333)}),w("preventDragEvent",function(e,t,n){var o=e.target||e.srcElement;o&&o.getAttribute("class")&&-1<e.type.indexOf("mouse")&&(0<o.getAttribute("class").indexOf("__caption")||/(SMALL|STRONG|EM)/i.test(o.tagName))&&(n.prevent=!1)}),w("bindEvents",function(){s.bind(p,"pswpTap click",e),s.bind(o.scrollWrap,"pswpTap",D.onGlobalTap),o.likelyTouchDevice||s.bind(o.scrollWrap,"mouseover",D.onMouseOver)}),w("unbindEvents",function(){O||i(),S&&clearInterval(S),s.unbind(document,"mouseout",c),s.unbind(document,"mousemove",l),s.unbind(p,"pswpTap click",e),s.unbind(o.scrollWrap,"pswpTap",D.onGlobalTap),s.unbind(o.scrollWrap,"mouseover",D.onMouseOver),m&&(s.unbind(document,m.eventK,D.updateFullscreen),m.isFullscreen()&&(T.hideAnimationDuration=0,m.exit()),m=null)}),w("destroy",function(){T.captionEl&&(h&&p.removeChild(h),s.removeClass(f,"pswp__caption--empty")),y&&(y.children[0].onclick=null),s.removeClass(p,"pswp__ui--over-close"),s.addClass(p,"pswp__ui--hidden"),D.setIdle(!1)}),T.showAnimationDuration||s.removeClass(p,"pswp__ui--hidden"),w("initialZoomIn",function(){T.showAnimationDuration&&s.removeClass(p,"pswp__ui--hidden")}),w("initialZoomOut",function(){s.addClass(p,"pswp__ui--hidden")}),w("parseVerticalMargin",d),R(),T.shareEl&&g&&y&&(O=!0),n(),T.timeToIdle&&w("mouseUsed",function(){s.bind(document,"mousemove",l),s.bind(document,"mouseout",c),S=setInterval(function(){2===++P&&D.setIdle(!0)},T.timeToIdle/2)}),T.fullscreenEl&&!s.features.isOldAndroid&&((m=m||D.getFullscreenAPI())?(s.bind(document,m.eventK,D.updateFullscreen),D.updateFullscreen(),s.addClass(o.template,"pswp--supports-fs")):s.removeClass(o.template,"pswp--supports-fs")),T.preloaderEl&&(u(!0),w("beforeChange",function(){clearTimeout(I),I=setTimeout(function(){o.currItem&&o.currItem.loading?o.allowProgressiveImg()&&(!o.currItem.img||o.currItem.img.naturalWidth)||u(!1):u(!0)},T.loadingIndicatorDelay)}),w("imageLoadComplete",function(e,t){o.currItem===t&&u(!0)}))},D.setIdle=function(e){_(p,"ui--idle",x=e)},D.update=function(){L=!(!M||!o.currItem||(D.updateIndexIndicator(),T.captionEl&&(T.addCaptionHTMLFn(o.currItem,f),_(f,"caption--empty",!o.currItem.title)),0)),O||i(),n()},D.updateFullscreen=function(e){e&&setTimeout(function(){o.setScrollOffset(0,s.getScrollY())},50),s[(m.isFullscreen()?"add":"remove")+"Class"](o.template,"pswp--fs")},D.updateIndexIndicator=function(){T.counterEl&&(t.innerHTML=o.getCurrentIndex()+1+T.indexIndicatorSep+T.getNumItemsFn())},D.onGlobalTap=function(e){var t=(e=e||window.event).target||e.srcElement;if(!A)if(e.detail&&"mouse"===e.detail.pointerType)a(t)?o.close():s.hasClass(t,"pswp__img")&&(1===o.getZoomLevel()&&o.getZoomLevel()<=o.currItem.fitRatio?T.clickToCloseNonZoomable&&o.close():o.toggleDesktopZoom(e.detail.releasePoint));else if(T.tapToToggleControls&&(M?D.hideControls():D.showControls()),T.tapToClose&&(s.hasClass(t,"pswp__img")||a(t)))return void o.close()},D.onMouseOver=function(e){e=(e=e||window.event).target||e.srcElement;_(p,"ui--over-close",a(e))},D.hideControls=function(){s.addClass(p,"pswp__ui--hidden"),M=!1},D.showControls=function(){M=!0,L||D.update(),s.removeClass(p,"pswp__ui--hidden")},D.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},D.getFullscreenAPI=function(){var e,t=document.documentElement,n="fullscreenchange";return t.requestFullscreen?e={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:n}:t.mozRequestFullScreen?e={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+n}:t.webkitRequestFullscreen?e={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+n}:t.msRequestFullscreen&&(e={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),e&&(e.enter=function(){return v=T.closeOnScroll,T.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?o.template[this.enterK]():void o.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},e.exit=function(){return T.closeOnScroll=v,document[this.exitK]()},e.isFullscreen=function(){return document[this.elementK]}),e}}}),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(m,z,t,Z){var p={features:null,bind:function(e,t,n,o){var i=(o?"remove":"add")+"EventListener";t=t.split(" ");for(var a=0;a<t.length;a++)t[a]&&e[i](t[a],n,!1)},isArray:function(e){return e instanceof Array},createEl:function(e,t){t=document.createElement(t||"div");return e&&(t.className=e),t},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,n){p.bind(e,t,n,!0)},removeClass:function(e,t){t=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(t," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){p.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},hasClass:function(e,t){return e.className&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},getChildByClass:function(e,t){for(var n=e.firstChild;n;){if(p.hasClass(n,t))return n;n=n.nextSibling}},arraySearch:function(e,t,n){for(var o=e.length;o--;)if(e[o][n]===t)return o;return-1},extend:function(e,t,n){for(var o in t)if(t.hasOwnProperty(o)){if(n&&e.hasOwnProperty(o))continue;e[o]=t[o]}},easing:{sine:{out:function(e){return Math.sin(e*(Math.PI/2))},inOut:function(e){return-(Math.cos(Math.PI*e)-1)/2}},cubic:{out:function(e){return--e*e*e+1}}},detectFeatures:function(){if(p.features)return p.features;var e,t,n=p.createEl().style,o="",i={};i.oldIE=document.all&&!document.addEventListener,i.touch="ontouchstart"in window,window.requestAnimationFrame&&(i.raf=window.requestAnimationFrame,i.caf=window.cancelAnimationFrame),i.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,i.pointerEvent||(e=navigator.userAgent,/iP(hone|od)/.test(navigator.platform)&&(t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/))&&0<t.length&&1<=(t=parseInt(t[1],10))&&t<8&&(i.isOldIOSPhone=!0),t=(t=e.match(/Android\s([0-9\.]*)/))?t[1]:0,1<=(t=parseFloat(t))&&(t<4.4&&(i.isOldAndroid=!0),i.androidVersion=t),i.isMobileOpera=/opera mini|opera mobi/i.test(e));for(var a,r,s,l=["transform","perspective","animationName"],c=["","webkit","Moz","ms","O"],u=0;u<4;u++){for(var o=c[u],d=0;d<3;d++)a=l[d],r=o+(o?a.charAt(0).toUpperCase()+a.slice(1):a),!i[a]&&r in n&&(i[a]=r);o&&!i.raf&&(o=o.toLowerCase(),i.raf=window[o+"RequestAnimationFrame"],i.raf)&&(i.caf=window[o+"CancelAnimationFrame"]||window[o+"CancelRequestAnimationFrame"])}return i.raf||(s=0,i.raf=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-s)),o=window.setTimeout(function(){e(t+n)},n);return s=t+n,o},i.caf=function(e){clearTimeout(e)}),i.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,p.features=i}},f=(p.detectFeatures(),p.features.oldIE&&(p.bind=function(e,t,n,o){t=t.split(" ");for(var i,a=(o?"detach":"attach")+"Event",r=function(){n.handleEvent.call(n)},s=0;s<t.length;s++)if(i=t[s])if("object"==typeof n&&n.handleEvent){if(o){if(!n["oldIE"+i])return!1}else n["oldIE"+i]=r;e[a]("on"+i,n["oldIE"+i])}else e[a]("on"+i,n)}),this),j=25,h={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(e){return"A"===e.tagName},getDoubleTapZoom:function(e,t){return e||t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};p.extend(h,Z);function e(){return{x:0,y:0}}function $(e,t){p.extend(f,t.publicMethods),We.push(e)}function q(e){var t=_();return t-1<e?e-t:e<0?t+e:e}function a(e,t){return Ke[e]||(Ke[e]=[]),Ke[e].push(t)}function B(e,t,n,o){o===f.currItem.initialZoomLevel?n[e]=f.currItem.initialPosition[e]:(n[e]=Je(e,o),n[e]>t.min[e]?n[e]=t.min[e]:n[e]<t.max[e]&&(n[e]=t.max[e]))}function N(e){var t="";h.escKey&&27===e.keyCode?t="close":h.arrowKeys&&(37===e.keyCode?t="prev":39===e.keyCode&&(t="next")),!t||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||(e.preventDefault?e.preventDefault():e.returnValue=!1,f[t]())}function H(e){e&&(De||ke||v||Te)&&(e.preventDefault(),e.stopPropagation())}function W(){f.setScrollOffset(0,p.getScrollY())}function U(e){var t;"mousedown"===e.type&&0<e.button||(Jt?e.preventDefault():Ae&&"mousedown"===e.type||(Mt(e,!0)&&e.preventDefault(),I("pointerDown"),pe&&((t=p.arraySearch(ht,e.pointerId,"id"))<0&&(t=ht.length),ht[t]={x:e.pageX,y:e.pageY,id:e.pointerId}),e=(t=jt(e)).length,c=null,ct(),l&&1!==e||(l=Fe=!0,p.bind(window,ee,f),Ce=Ze=Re=Te=Me=De=Se=ke=!1,Pe=null,I("firstTouchStart",t),S(qe,x),$e.x=$e.y=0,S(M,t[0]),S(ft,M),gt.x=b.x*Be,yt=[{x:M.x,y:M.y}],Ee=be=C(),ot(y,!0),At(),St()),!u&&1<e&&!v&&!Me&&(ne=y,u=Se=!(ke=!1),$e.y=$e.x=0,S(qe,x),S(D,t[0]),S(pt,t[1]),_t(D,pt,It),Et.x=Math.abs(It.x)-x.x,Et.y=Math.abs(It.y)-x.y,Oe=Tt(D,pt))))}function V(e){var t;e.preventDefault(),pe&&-1<(t=p.arraySearch(ht,e.pointerId,"id"))&&((t=ht[t]).x=e.pageX,t.y=e.pageY),l&&(t=jt(e),Pe||De||u?c=t:O.x!==b.x*Be?Pe="h":(e=Math.abs(t[0].x-M.x)-Math.abs(t[0].y-M.y),Math.abs(e)>=mt&&(Pe=0<e?"h":"v",c=t)))}function K(e){if(s.isOldAndroid){if(Ae&&"mouseup"===e.type)return;-1<e.type.indexOf("touch")&&(clearTimeout(Ae),Ae=setTimeout(function(){Ae=0},600))}var t;I("pointerUp"),Mt(e,!1)&&e.preventDefault(),pe&&-1<(a=p.arraySearch(ht,e.pointerId,"id"))&&(t=ht.splice(a,1)[0],navigator.msPointerEnabled&&(t.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],t.type)||(t.type=e.pointerType||"mouse"));var n=(a=jt(e)).length;if(2===(n="mouseup"===e.type?0:n))return!(c=null);1===n&&S(ft,a[0]),0!==n||Pe||v||(t||("mouseup"===e.type?t={x:e.pageX,y:e.pageY,type:"mouse"}:e.changedTouches&&e.changedTouches[0]&&(t={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:"touch"})),I("touchRelease",e,t));var o,i,a=-1;if(0===n&&(l=!1,p.unbind(window,ee,f),At(),u?a=0:-1!==bt&&(a=C()-bt)),bt=1===n?C():-1,e=-1!==a&&a<150?"zoom":"swipe",u&&n<2&&(u=!1,1===n&&(e="zoomPointerUp"),I("zoomGestureEnded")),c=null,De||ke||v||Te)if(ct(),(Ie=Ie||Bt()).calculateSwipeSpeed("x"),Te)Ft()<h.verticalDragRange?f.close():(o=x.y,i=ze,ut("verticalDrag",0,1,300,p.easing.cubic.out,function(e){x.y=(f.currItem.initialPosition.y-o)*e+o,T((1-i)*e+i),A()}),I("onVerticalDrag",1));else{if((Me||v)&&0===n){if(Ht(e,Ie))return;e="zoomPointerUp"}if(!v)return"swipe"!==e?void Ut():void(!Me&&y>f.currItem.fitRatio&&Nt(Ie))}}var G,Y,X,g,Q,J,ee,te,o,y,ne,oe,ie,ae,re,r,se,le,ce,ue,de,me,pe,i,fe,he,ge,ye,ve,xe,s,we,be,Ee,Ie,Ce,Te,Ae,l,Se,ke,De,Le,Me,c,u,Oe,d,_e,v,Pe,Fe,Re,ze,Ze,je,$e=e(),qe=e(),x=e(),w={},Be=0,Ne={},b=e(),E=0,He=!0,We=[],Ue={},Ve=!1,Ke={},I=function(e){var t=Ke[e];if(t){var n=Array.prototype.slice.call(arguments);n.shift();for(var o=0;o<t.length;o++)t[o].apply(f,n)}},C=function(){return(new Date).getTime()},T=function(e){ze=e,f.bg.style.opacity=e*h.bgOpacity},Ge=function(e,t,n,o,i){(!Ve||i&&i!==f.currItem)&&(o/=(i||f.currItem).fitRatio),e[me]=oe+t+"px, "+n+"px"+ie+" scale("+o+")"},A=function(e){_e&&(e&&(y>f.currItem.fitRatio?Ve||(cn(f.currItem,!1,!0),Ve=!0):Ve&&(cn(f.currItem),Ve=!1)),Ge(_e,x.x,x.y,y))},Ye=function(e){e.container&&Ge(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},Xe=function(e,t){t[me]=oe+e+"px, 0px"+ie},Qe=function(e,t){var n;!h.loop&&t&&(t=g+(b.x*Be-e)/b.x,n=Math.round(e-O.x),t<0&&0<n||t>=_()-1&&n<0)&&(e=O.x+n*h.mainScrollEndFriction),O.x=e,Xe(e,Q)},Je=function(e,t){var n=Et[e]-Ne[e];return qe[e]+$e[e]+n-t/ne*n},S=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},et=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},tt=null,nt=function(){tt&&(p.unbind(document,"mousemove",nt),p.addClass(m,"pswp--has_mouse"),h.mouseUsed=!0,I("mouseUsed")),tt=setTimeout(function(){tt=null},100)},ot=function(e,t){e=sn(f.currItem,w,e);return t&&(d=e),e},it=function(e){return(e=e||f.currItem).initialZoomLevel},at=function(e){return 0<(e=e||f.currItem).w?h.maxSpreadZoom:1},k={},rt=0,st=function(e){k[e]&&(k[e].raf&&he(k[e].raf),rt--,delete k[e])},lt=function(e){k[e]&&st(e),k[e]||(rt++,k[e]={})},ct=function(){for(var e in k)k.hasOwnProperty(e)&&st(e)},ut=function(e,t,n,o,i,a,r){function s(){k[e]&&(l=C()-c,o<=l?(st(e),a(n),r&&r()):(a((n-t)*i(l/o)+t),k[e].raf=fe(s)))}var l,c=C();lt(e);s()},Z={shout:I,listen:a,viewportSize:w,options:h,isMainScrollAnimating:function(){return v},getZoomLevel:function(){return y},getCurrentIndex:function(){return g},isDragging:function(){return l},isZooming:function(){return u},setScrollOffset:function(e,t){Ne.x=e,xe=Ne.y=t,I("updateScrollOffset",Ne)},applyZoomPan:function(e,t,n,o){x.x=t,x.y=n,y=e,A(o)},init:function(){if(!G&&!Y){f.framework=p,f.template=m,f.bg=p.getChildByClass(m,"pswp__bg"),ge=m.className,G=!0,s=p.detectFeatures(),fe=s.raf,he=s.caf,me=s.transform,ve=s.oldIE,f.scrollWrap=p.getChildByClass(m,"pswp__scroll-wrap"),f.container=p.getChildByClass(f.scrollWrap,"pswp__container"),Q=f.container.style,f.itemHolders=r=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],r[0].el.style.display=r[2].el.style.display="none",me?(t=s.perspective&&!i,oe="translate"+(t?"3d(":"("),ie=s.perspective?", 0px)":")"):(me="left",p.addClass(m,"pswp--ie"),Xe=function(e,t){t.left=e+"px"},Ye=function(e){var t=1<e.fitRatio?1:e.fitRatio,n=e.container.style,o=t*e.w,t=t*e.h;n.width=o+"px",n.height=t+"px",n.left=e.initialPosition.x+"px",n.top=e.initialPosition.y+"px"},A=function(){var e,t,n,o;_e&&(e=_e,n=(o=1<(t=f.currItem).fitRatio?1:t.fitRatio)*t.w,o=o*t.h,e.width=n+"px",e.height=o+"px",e.left=x.x+"px",e.top=x.y+"px")}),o={resize:f.updateSize,orientationchange:function(){clearTimeout(we),we=setTimeout(function(){w.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:W,keydown:N,click:H};var e,t=s.isOldIOSPhone||s.isOldAndroid||s.isMobileOpera;for(s.animationName&&s.transform&&!t||(h.showAnimationDuration=h.hideAnimationDuration=0),e=0;e<We.length;e++)f["init"+We[e]]();z&&(f.ui=new z(f,p)).init(),I("firstUpdate"),g=g||h.index||0,(isNaN(g)||g<0||g>=_())&&(g=0),f.currItem=en(g),(s.isOldIOSPhone||s.isOldAndroid)&&(He=!1),m.setAttribute("aria-hidden","false"),h.modal&&(He?m.style.position="fixed":(m.style.position="absolute",m.style.top=p.getScrollY()+"px")),void 0===xe&&(I("initialLayout"),xe=ye=p.getScrollY());var n="pswp--open ";for(h.mainClass&&(n+=h.mainClass+" "),h.showHideOpacity&&(n+="pswp--animate_opacity "),n=(n=(n+=i?"pswp--touch":"pswp--notouch")+(s.animationName?" pswp--css_animation":""))+(s.svg?" pswp--svg":""),p.addClass(m,n),f.updateSize(),J=-1,E=null,e=0;e<3;e++)Xe((e+J)*b.x,r[e].el.style);ve||p.bind(f.scrollWrap,te,f),a("initialZoomInEnd",function(){f.setContent(r[0],g-1),f.setContent(r[2],g+1),r[0].el.style.display=r[2].el.style.display="block",h.focus&&m.focus(),p.bind(document,"keydown",f),s.transform&&p.bind(f.scrollWrap,"click",f),h.mouseUsed||p.bind(document,"mousemove",nt),p.bind(window,"resize scroll orientationchange",f),I("bindEvents")}),f.setContent(r[1],g),f.updateCurrItem(),I("afterInit"),He||(ae=setInterval(function(){rt||l||u||y!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),p.addClass(m,"pswp--visible")}var t},close:function(){G&&(Y=!(G=!1),I("close"),p.unbind(window,"resize scroll orientationchange",f),p.unbind(window,"scroll",o.scroll),p.unbind(document,"keydown",f),p.unbind(document,"mousemove",nt),s.transform&&p.unbind(f.scrollWrap,"click",f),l&&p.unbind(window,ee,f),clearTimeout(we),I("unbindEvents"),tn(f.currItem,null,!0,f.destroy))},destroy:function(){I("destroy"),Yt&&clearTimeout(Yt),m.setAttribute("aria-hidden","true"),m.className=ge,ae&&clearInterval(ae),p.unbind(f.scrollWrap,te,f),p.unbind(window,"scroll",f),At(),ct(),Ke=null},panTo:function(e,t,n){n||(e>d.min.x?e=d.min.x:e<d.max.x&&(e=d.max.x),t>d.min.y?t=d.min.y:t<d.max.y&&(t=d.max.y)),x.x=e,x.y=t,A()},handleEvent:function(e){e=e||window.event,o[e.type]&&o[e.type](e)},goTo:function(e){var t=(e=q(e))-g;E=t,g=e,f.currItem=en(g),Be-=t,Qe(b.x*Be),ct(),v=!1,f.updateCurrItem()},next:function(){f.goTo(g+1)},prev:function(){f.goTo(g-1)},updateCurrZoomItem:function(e){var t;e&&I("beforeChange",0),_e=r[1].el.children.length&&(t=r[1].el.children[0],p.hasClass(t,"pswp__zoom-wrap"))?t.style:null,d=f.currItem.bounds,ne=y=f.currItem.initialZoomLevel,x.x=d.center.x,x.y=d.center.y,e&&I("afterChange")},invalidateCurrItems:function(){re=!0;for(var e=0;e<3;e++)r[e].item&&(r[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==E){var t,n=Math.abs(E);if(!(e&&n<2)){f.currItem=en(g),Ve=!1,I("beforeChange",E),3<=n&&(J+=E+(0<E?-3:3),n=3);for(var o=0;o<n;o++)0<E?(t=r.shift(),r[2]=t,Xe((++J+2)*b.x,t.el.style),f.setContent(t,g-n+o+1+1)):(t=r.pop(),r.unshift(t),Xe(--J*b.x,t.el.style),f.setContent(t,g+n-o-1-1));_e&&1===Math.abs(E)&&(e=en(se)).initialZoomLevel!==y&&(sn(e,w),cn(e),Ye(e)),E=0,f.updateCurrZoomItem(),se=g,I("afterChange")}}},updateSize:function(e){if(!He&&h.modal){var t=p.getScrollY();if(xe!==t&&(m.style.top=t+"px",xe=t),!e&&Ue.x===window.innerWidth&&Ue.y===window.innerHeight)return;Ue.x=window.innerWidth,Ue.y=window.innerHeight,m.style.height=Ue.y+"px"}if(w.x=f.scrollWrap.clientWidth,w.y=f.scrollWrap.clientHeight,W(),b.x=w.x+Math.round(w.x*h.spacing),b.y=w.y,Qe(b.x*Be),I("beforeResize"),void 0!==J){for(var n,o,i,a=0;a<3;a++)n=r[a],Xe((a+J)*b.x,n.el.style),i=g+a-1,h.loop&&2<_()&&(i=q(i)),(o=en(i))&&(re||o.needsUpdate||!o.bounds)?(f.cleanSlide(o),f.setContent(n,i),1===a&&(f.currItem=o,f.updateCurrZoomItem(!0)),o.needsUpdate=!1):-1===n.index&&0<=i&&f.setContent(n,i),o&&o.container&&(sn(o,w),cn(o),Ye(o));re=!1}ne=y=f.currItem.initialZoomLevel,(d=f.currItem.bounds)&&(x.x=d.center.x,x.y=d.center.y,A(!0)),I("resize")},zoomTo:function(t,e,n,o,i){e&&(ne=y,Et.x=Math.abs(e.x)-x.x,Et.y=Math.abs(e.y)-x.y,S(qe,x));function a(e){1===e?(y=t,x.x=r.x,x.y=r.y):(y=(t-s)*e+s,x.x=(r.x-l.x)*e+l.x,x.y=(r.y-l.y)*e+l.y),i&&i(e),A(1===e)}var e=ot(t,!1),r={},s=(B("x",e,r,t),B("y",e,r,t),y),l={x:x.x,y:x.y};et(r);n?ut("customZoomTo",0,1,n,o||p.easing.sine.inOut,a):a(1)}},dt=30,mt=10,D={},pt={},L={},M={},ft={},ht=[],gt={},yt=[],vt={},xt=0,wt=e(),bt=0,O=e(),Et=e(),It=e(),Ct=function(e,t){return e.x===t.x&&e.y===t.y},Tt=function(e,t){return vt.x=Math.abs(e.x-t.x),vt.y=Math.abs(e.y-t.y),Math.sqrt(vt.x*vt.x+vt.y*vt.y)},At=function(){Le&&(he(Le),Le=null)},St=function(){l&&(Le=fe(St),qt())},kt=function(){return!("fit"===h.scaleMode&&y===f.currItem.initialZoomLevel)},Dt=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&-1<e.getAttribute("class").indexOf("pswp__scroll-wrap"))&&(t(e)?e:Dt(e.parentNode,t))},Lt={},Mt=function(e,t){return Lt.prevent=!Dt(e.target,h.isClickableElement),I("preventDragEvent",e,t,Lt),Lt.prevent},Ot=function(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t},_t=function(e,t,n){n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y)},Pt=function(e,t,n){var o;50<e-Ee&&((o=2<yt.length?yt.shift():{}).x=t,o.y=n,yt.push(o),Ee=e)},Ft=function(){var e=x.y-f.currItem.initialPosition.y;return 1-Math.abs(e/(w.y/2))},Rt={},zt={},Zt=[],jt=function(e){for(;0<Zt.length;)Zt.pop();return pe?(je=0,ht.forEach(function(e){0===je?Zt[0]=e:1===je&&(Zt[1]=e),je++})):-1<e.type.indexOf("touch")?e.touches&&0<e.touches.length&&(Zt[0]=Ot(e.touches[0],Rt),1<e.touches.length)&&(Zt[1]=Ot(e.touches[1],zt)):(Rt.x=e.pageX,Rt.y=e.pageY,Rt.id="",Zt[0]=Rt),Zt},$t=function(e,t){var n,o,i,a=x[e]+t[e],r=0<t[e],s=O.x+t.x,l=O.x-gt.x,c=a>d.min[e]||a<d.max[e]?h.panEndFriction:1,a=x[e]+t[e]*c;return!h.allowPanToNext&&y!==f.currItem.initialZoomLevel||(_e?"h"!==Pe||"x"!==e||ke||(r?(a>d.min[e]&&(c=h.panEndFriction,d.min[e],n=d.min[e]-qe[e]),(n<=0||l<0)&&1<_()?(i=s,l<0&&s>gt.x&&(i=gt.x)):d.min.x!==d.max.x&&(o=a)):(a<d.max[e]&&(c=h.panEndFriction,d.max[e],n=qe[e]-d.max[e]),(n<=0||0<l)&&1<_()?(i=s,0<l&&s<gt.x&&(i=gt.x)):d.min.x!==d.max.x&&(o=a))):i=s,"x"!==e)?void(v||Me||y>f.currItem.fitRatio&&(x[e]+=t[e]*c)):(void 0!==i&&(Qe(i,!0),Me=i!==gt.x),d.min.x!==d.max.x&&(void 0!==o?x.x=o:Me||(x.x+=t.x*c)),void 0!==i)},qt=function(){var e,t,n,o,i,a;c&&0!==(e=c.length)&&(S(D,c[0]),L.x=D.x-M.x,L.y=D.y-M.y,u&&1<e?(M.x=D.x,M.y=D.y,!L.x&&!L.y&&Ct(c[1],pt)||(S(pt,c[1]),ke||(ke=!0,I("zoomGestureStarted")),e=Tt(D,pt),(t=Wt(e))>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(Ze=!0),n=1,o=it(),i=at(),t<o?h.pinchToClose&&!Ze&&ne<=f.currItem.initialZoomLevel?(T(a=1-(o-t)/(o/1.2)),I("onPinchClose",a),Re=!0):t=o-(n=1<(n=(o-t)/o)?1:n)*(o/3):i<t&&(t=i+(n=1<(n=(t-i)/(6*o))?1:n)*o),n<0&&(n=0),_t(D,pt,wt),$e.x+=wt.x-It.x,$e.y+=wt.y-It.y,S(It,wt),x.x=Je("x",t),x.y=Je("y",t),Ce=y<t,y=t,A())):Pe&&(Fe&&(Fe=!1,Math.abs(L.x)>=mt&&(L.x-=c[0].x-ft.x),Math.abs(L.y)>=mt)&&(L.y-=c[0].y-ft.y),M.x=D.x,M.y=D.y,0===L.x&&0===L.y||("v"===Pe&&h.closeOnVerticalDrag&&!kt()?($e.y+=L.y,x.y+=L.y,a=Ft(),Te=!0,I("onVerticalDrag",a),T(a),A()):(Pt(C(),D.x,D.y),De=!0,d=f.currItem.bounds,$t("x",L)||($t("y",L),et(x),A())))))},Bt=function(){var t,n,o={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=(1<yt.length?(t=C()-Ee+50,yt[yt.length-2]):(t=C()-be,ft))[e],o.lastFlickOffset[e]=M[e]-n,o.lastFlickDist[e]=Math.abs(o.lastFlickOffset[e]),20<o.lastFlickDist[e]?o.lastFlickSpeed[e]=o.lastFlickOffset[e]/t:o.lastFlickSpeed[e]=0,Math.abs(o.lastFlickSpeed[e])<.1&&(o.lastFlickSpeed[e]=0),o.slowDownRatio[e]=.95,o.slowDownRatioReverse[e]=1-o.slowDownRatio[e],o.speedDecelerationRatio[e]=1},calculateOverBoundsAnimOffset:function(t,e){o.backAnimStarted[t]||(x[t]>d.min[t]?o.backAnimDestination[t]=d.min[t]:x[t]<d.max[t]&&(o.backAnimDestination[t]=d.max[t]),void 0!==o.backAnimDestination[t]&&(o.slowDownRatio[t]=.7,o.slowDownRatioReverse[t]=1-o.slowDownRatio[t],o.speedDecelerationRatioAbs[t]<.05)&&(o.lastFlickSpeed[t]=0,o.backAnimStarted[t]=!0,ut("bounceZoomPan"+t,x[t],o.backAnimDestination[t],e||300,p.easing.sine.out,function(e){x[t]=e,A()})))},calculateAnimOffset:function(e){o.backAnimStarted[e]||(o.speedDecelerationRatio[e]=o.speedDecelerationRatio[e]*(o.slowDownRatio[e]+o.slowDownRatioReverse[e]-o.slowDownRatioReverse[e]*o.timeDiff/10),o.speedDecelerationRatioAbs[e]=Math.abs(o.lastFlickSpeed[e]*o.speedDecelerationRatio[e]),o.distanceOffset[e]=o.lastFlickSpeed[e]*o.speedDecelerationRatio[e]*o.timeDiff,x[e]+=o.distanceOffset[e])},panAnimLoop:function(){k.zoomPan&&(k.zoomPan.raf=fe(o.panAnimLoop),o.now=C(),o.timeDiff=o.now-o.lastNow,o.lastNow=o.now,o.calculateAnimOffset("x"),o.calculateAnimOffset("y"),A(),o.calculateOverBoundsAnimOffset("x"),o.calculateOverBoundsAnimOffset("y"),o.speedDecelerationRatioAbs.x<.05)&&o.speedDecelerationRatioAbs.y<.05&&(x.x=Math.round(x.x),x.y=Math.round(x.y),A(),st("zoomPan"))}};return o},Nt=function(e){return e.calculateSwipeSpeed("y"),d=f.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},Math.abs(e.lastFlickSpeed.x)<=.05&&Math.abs(e.lastFlickSpeed.y)<=.05?(e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0):(lt("zoomPan"),e.lastNow=C(),void e.panAnimLoop())},Ht=function(e,t){var n,o,i;v||(xt=g),"swipe"===e&&(e=M.x-ft.x,a=t.lastFlickDist.x<10,dt<e&&(a||20<t.lastFlickOffset.x)?o=-1:e<-dt&&(a||t.lastFlickOffset.x<-20)&&(o=1)),o&&((g+=o)<0?(g=h.loop?_()-1:0,i=!0):g>=_()&&(g=h.loop?0:_()-1,i=!0),i&&!h.loop||(E+=o,Be-=o,n=!0));var e=b.x*Be,a=Math.abs(e-O.x),r=n||e>O.x==0<t.lastFlickSpeed.x?(r=0<Math.abs(t.lastFlickSpeed.x)?a/Math.abs(t.lastFlickSpeed.x):333,r=Math.min(r,400),Math.max(r,250)):333;return xt===g&&(n=!1),v=!0,I("mainScrollAnimStart"),ut("mainScroll",O.x,e,r,p.easing.cubic.out,Qe,function(){ct(),v=!1,xt=-1,!n&&xt===g||f.updateCurrItem(),I("mainScrollAnimComplete")}),n&&f.updateCurrItem(!0),n},Wt=function(e){return 1/Oe*e*ne},Ut=function(){var e=y,t=it(),n=at();y<t?e=t:n<y&&(e=n);var o,i=ze;return Re&&!Ce&&!Ze&&y<t?f.close():(Re&&(o=function(e){T((1-i)*e+i)}),f.zoomTo(e,0,200,p.easing.cubic.out,o)),!0};$("Gestures",{publicMethods:{initGestures:function(){function e(e,t,n,o,i){le=e+t,ce=e+n,ue=e+o,de=i?e+i:""}(pe=s.pointerEvent)&&s.touch&&(s.touch=!1),pe?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):s.touch?(e("touch","start","move","end","cancel"),i=!0):e("mouse","down","move","up"),ee=ce+" "+ue+" "+de,te=le,pe&&!i&&(i=1<navigator.maxTouchPoints||1<navigator.msMaxTouchPoints),f.likelyTouchDevice=i,o[le]=U,o[ce]=V,o[ue]=K,de&&(o[de]=o[ue]),s.touch&&(te+=" mousedown",ee+=" mousemove mouseup",o.mousedown=o[le],o.mousemove=o[ce],o.mouseup=o[ue]),i||(h.allowPanToNext=!1)}}});function Vt(e){function t(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,n.onload=n.onerror=null,n=null}e.loading=!0,e.loaded=!1;var n=e.img=p.createEl("pswp__img","img");n.onload=t,n.onerror=function(){e.loadError=!0,t()},n.src=e.src}function Kt(e,t){return e.src&&e.loadError&&e.container&&(t&&(e.container.innerHTML=""),e.container.innerHTML=h.errorMsg.replace("%url%",e.src),1)}function Gt(){if(nn.length){for(var e,t=0;t<nn.length;t++)(e=nn[t]).holder.index===e.index&&ln(e.index,e.item,e.baseDiv,e.img,!1,e.clearPlaceholder);nn=[]}}var Yt,Xt,Qt,Jt,en,_,tn=function(a,e,r,t){function s(){st("initialZoom"),r?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(T(1),e&&(e.style.display="block"),p.addClass(m,"pswp--animated-in"),I("initialZoom"+(r?"OutEnd":"InEnd"))),t&&t(),Jt=!1}Yt&&clearTimeout(Yt),Qt=Jt=!0,a.initialLayout?(l=a.initialLayout,a.initialLayout=null):l=h.getThumbBoundsFn&&h.getThumbBoundsFn(g);var l,c,u,d=r?h.hideAnimationDuration:h.showAnimationDuration;d&&l&&void 0!==l.x?(c=X,u=!f.currItem.src||f.currItem.loadError||h.showHideOpacity,a.miniImg&&(a.miniImg.style.webkitBackfaceVisibility="hidden"),r||(y=l.w/a.w,x.x=l.x,x.y=l.y-ye,f[u?"template":"bg"].style.opacity=.001,A()),lt("initialZoom"),r&&!c&&p.removeClass(m,"pswp--animated-in"),u&&(r?p[(c?"remove":"add")+"Class"](m,"pswp--animate_opacity"):setTimeout(function(){p.addClass(m,"pswp--animate_opacity")},30)),Yt=setTimeout(function(){var t,n,o,i,e;I("initialZoom"+(r?"Out":"In")),r?(t=l.w/a.w,n={x:x.x,y:x.y},o=y,i=ze,e=function(e){1===e?(y=t,x.x=l.x,x.y=l.y-xe):(y=(t-o)*e+o,x.x=(l.x-n.x)*e+n.x,x.y=(l.y-xe-n.y)*e+n.y),A(),u?m.style.opacity=1-e:T(i-e*i)},c?ut("initialZoom",0,1,d,p.easing.cubic.out,e,s):(e(1),Yt=setTimeout(s,d+20))):(y=a.initialZoomLevel,S(x,a.initialPosition),A(),T(1),u?m.style.opacity=1:T(1),Yt=setTimeout(s,d+20))},r?25:90)):(I("initialZoom"+(r?"Out":"In")),y=a.initialZoomLevel,S(x,a.initialPosition),A(),m.style.opacity=r?0:1,T(1),d?setTimeout(function(){s()},d):s())},P={},nn=[],on={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Xt.length}},an=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},rn=function(e,t,n){var o=e.bounds;o.center.x=Math.round((P.x-t)/2),o.center.y=Math.round((P.y-n)/2)+e.vGap.top,o.max.x=t>P.x?Math.round(P.x-t):o.center.x,o.max.y=n>P.y?Math.round(P.y-n)+e.vGap.top:o.center.y,o.min.x=t>P.x?0:o.center.x,o.min.y=n>P.y?e.vGap.top:o.center.y},sn=function(e,t,n){var o,i;return e.src&&!e.loadError?((o=!n)&&(e.vGap||(e.vGap={top:0,bottom:0}),I("parseVerticalMargin",e)),P.x=t.x,P.y=t.y-e.vGap.top-e.vGap.bottom,o&&(t=P.x/e.w,i=P.y/e.h,e.fitRatio=t<i?t:i,"orig"===(t=h.scaleMode)?n=1:"fit"===t&&(n=e.fitRatio),e.initialZoomLevel=n=1<n?1:n,e.bounds||(e.bounds=an())),n?(rn(e,e.w*n,e.h*n),o&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0):(e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=an(),e.initialPosition=e.bounds.center,e.bounds)},ln=function(e,t,n,o,i,a){t.loadError||o&&(t.imageAppended=!0,cn(t,o,t===f.currItem&&Ve),n.appendChild(o),a)&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500)},cn=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")};$("Controller",{publicMethods:{lazyLoadItem:function(e){e=q(e);var t=en(e);t&&(!t.loaded&&!t.loading||re)&&(I("gettingData",e,t),t.src)&&Vt(t)},initController:function(){p.extend(h,on,!0),f.items=Xt=t,en=f.getItemAt,_=h.getNumItemsFn,h.loop,_()<3&&(h.loop=!1),a("beforeChange",function(e){for(var t=h.preload,n=null===e||0<=e,o=Math.min(t[0],_()),i=Math.min(t[1],_()),a=1;a<=(n?i:o);a++)f.lazyLoadItem(g+a);for(a=1;a<=(n?o:i);a++)f.lazyLoadItem(g-a)}),a("initialLayout",function(){f.currItem.initialLayout=h.getThumbBoundsFn&&h.getThumbBoundsFn(g)}),a("mainScrollAnimComplete",Gt),a("initialZoomInEnd",Gt),a("destroy",function(){for(var e,t=0;t<Xt.length;t++)(e=Xt[t]).container&&(e.container=null),e.placeholder&&(e.placeholder=null),e.img&&(e.img=null),e.preloader&&(e.preloader=null),e.loadError&&(e.loaded=e.loadError=!1);nn=null})},getItemAt:function(e){return 0<=e&&void 0!==Xt[e]&&Xt[e]},allowProgressiveImg:function(){return h.forceProgressiveLoading||!i||h.mouseUsed||1200<screen.width},setContent:function(t,n){h.loop&&(n=q(n));var e=f.getItemAt(t.index);e&&(e.container=null);var o,i,a,e=f.getItemAt(n);e?(I("gettingData",n,e),t.index=n,i=(t.item=e).container=p.createEl("pswp__zoom-wrap"),!e.src&&e.html&&(e.html.tagName?i.appendChild(e.html):i.innerHTML=e.html),Kt(e),sn(e,w),!e.src||e.loadError||e.loaded?e.src&&!e.loadError&&((o=p.createEl("pswp__img","img")).style.opacity=1,o.src=e.src,cn(e,o),ln(n,e,i,o,!0)):(e.loadComplete=function(e){if(G){if(t&&t.index===n){if(Kt(e,!0))return e.loadComplete=e.img=null,sn(e,w),Ye(e),void(t.index===g&&f.updateCurrZoomItem());e.imageAppended?!Jt&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null):s.transform&&(v||Jt)?nn.push({item:e,baseDiv:i,img:e.img,index:n,holder:t,clearPlaceholder:!0}):ln(n,e,i,e.img,v||Jt,!0)}e.loadComplete=null,e.img=null,I("imageLoadComplete",n,e)}},p.features.transform&&(a="pswp__img pswp__img--placeholder",a+=e.msrc?"":" pswp__img--placeholder--blank",a=p.createEl(a,e.msrc?"img":""),e.msrc&&(a.src=e.msrc),cn(e,a),i.appendChild(a),e.placeholder=a),e.loading||Vt(e),f.allowProgressiveImg()&&(!Qt&&s.transform?nn.push({item:e,baseDiv:i,img:e.img,index:n,holder:t}):ln(n,e,i,e.img,!0,!0))),Qt||n!==g?Ye(e):(_e=i.style,tn(e,o||e.img)),t.el.innerHTML="",t.el.appendChild(i)):t.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}});function un(e,t,n){var o=document.createEvent("CustomEvent"),t={origEvent:e,target:e.target,releasePoint:t,pointerType:n||"touch"};o.initCustomEvent("pswpTap",!0,!0,t),e.target.dispatchEvent(o)}var dn,F,mn={};$("Tap",{publicMethods:{initTap:function(){a("firstTouchStart",f.onTapStart),a("touchRelease",f.onTapRelease),a("destroy",function(){mn={},dn=null})},onTapStart:function(e){1<e.length&&(clearTimeout(dn),dn=null)},onTapRelease:function(e,t){var n,o,i;!t||De||Se||rt||(n=t,dn&&(clearTimeout(dn),dn=null,o=n,i=mn,Math.abs(o.x-i.x)<j)&&Math.abs(o.y-i.y)<j?I("doubleTap",n):"mouse"===t.type?un(e,t,"mouse"):"BUTTON"===e.target.tagName.toUpperCase()||p.hasClass(e.target,"pswp__single-tap")?un(e,t):(S(mn,n),dn=setTimeout(function(){un(e,t),dn=null},300)))}}}),$("DesktopZoom",{publicMethods:{initDesktopZoom:function(){ve||(i?a("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(e){F={};var t="wheel mousewheel DOMMouseScroll";a("bindEvents",function(){p.bind(m,t,f.handleMouseWheel)}),a("unbindEvents",function(){F&&p.unbind(m,t,f.handleMouseWheel)}),f.mouseZoomedIn=!1;function n(){f.mouseZoomedIn&&(p.removeClass(m,"pswp--zoomed-in"),f.mouseZoomedIn=!1),y<1?p.addClass(m,"pswp--zoom-allowed"):p.removeClass(m,"pswp--zoom-allowed"),i()}var o,i=function(){o&&(p.removeClass(m,"pswp--dragging"),o=!1)};a("resize",n),a("afterChange",n),a("pointerDown",function(){f.mouseZoomedIn&&(o=!0,p.addClass(m,"pswp--dragging"))}),a("pointerUp",i),e||n()},handleMouseWheel:function(e){if(y<=f.currItem.fitRatio)return h.modal&&(!h.closeOnScroll||rt||l?e.preventDefault():me&&2<Math.abs(e.deltaY)&&(X=!0,f.close())),!0;if(e.stopPropagation(),F.x=0,"deltaX"in e)1===e.deltaMode?(F.x=18*e.deltaX,F.y=18*e.deltaY):(F.x=e.deltaX,F.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(F.x=-.16*e.wheelDeltaX),e.wheelDeltaY?F.y=-.16*e.wheelDeltaY:F.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;F.y=e.detail}ot(y,!0);var t=x.x-F.x,n=x.y-F.y;(h.modal||t<=d.min.x&&t>=d.max.x&&n<=d.min.y&&n>=d.max.y)&&e.preventDefault(),f.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:w.x/2+Ne.x,y:w.y/2+Ne.y};var t=h.getDoubleTapZoom(!0,f.currItem),n=y===t;f.mouseZoomedIn=!n,f.zoomTo(n?f.currItem.initialZoomLevel:t,e,333),p[(n?"remove":"add")+"Class"](m,"pswp--zoomed-in")}}});function pn(){hn&&clearTimeout(hn),yn&&clearTimeout(yn)}function fn(){var e=An(),t={};if(!(e.length<5)){var n,o=e.split("&");for(a=0;a<o.length;a++)!o[a]||(n=o[a].split("=")).length<2||(t[n[0]]=n[1]);if(h.galleryPIDs){for(var i=t.pid,a=t.pid=0;a<Xt.length;a++)if(Xt[a].pid===i){t.pid=a;break}}else t.pid=parseInt(t.pid,10)-1;t.pid<0&&(t.pid=0)}return t}var hn,gn,yn,vn,xn,wn,n,bn,En,In,R,Cn,Tn={history:!0,galleryUID:1},An=function(){return R.hash.substring(1)},Sn=function(){var e,t;yn&&clearTimeout(yn),rt||l?yn=setTimeout(Sn,500):(vn?clearTimeout(gn):vn=!0,t=g+1,(e=en(g)).hasOwnProperty("pid")&&(t=e.pid),e=n+"&gid="+h.galleryUID+"&pid="+t,bn||-1===R.hash.indexOf(e)&&(In=!0),t=R.href.split("#")[0]+"#"+e,Cn?"#"+e!==window.location.hash&&history[bn?"replaceState":"pushState"]("",document.title,t):bn?R.replace(t):R.hash=e,bn=!0,gn=setTimeout(function(){vn=!1},60))};$("History",{publicMethods:{initHistory:function(){var e,t;p.extend(h,Tn,!0),h.history&&(R=window.location,bn=En=In=!1,n=An(),Cn="pushState"in history,-1<n.indexOf("gid=")&&(n=(n=n.split("&gid=")[0]).split("?gid=")[0]),a("afterChange",f.updateURL),a("unbindEvents",function(){p.unbind(window,"hashchange",f.onHashChange)}),e=function(){wn=!0,En||(In?history.back():n?R.hash=n:Cn?history.pushState("",document.title,R.pathname+R.search):R.hash=""),pn()},a("unbindEvents",function(){X&&e()}),a("destroy",function(){wn||e()}),a("firstUpdate",function(){g=fn().pid}),-1<(t=n.indexOf("pid="))&&"&"===(n=n.substring(0,t)).slice(-1)&&(n=n.slice(0,-1)),setTimeout(function(){G&&p.bind(window,"hashchange",f.onHashChange)},40))},onHashChange:function(){return An()===n?(En=!0,void f.close()):void(vn||(xn=!0,f.goTo(fn().pid),xn=!1))},updateURL:function(){pn(),xn||(bn?hn=setTimeout(Sn,800):Sn())}}}),p.extend(f,Z)}}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).reframe=t()}(this,function(){"use strict";function t(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var o=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],r=0,s=a.length;r<s;r++,i++)o[i]=a[r];return o}return function(e,i){return void 0===i&&(i="js-reframe"),("string"==typeof e?t(document.querySelectorAll(e)):"length"in e?t(e):[e]).forEach(function(e){var t,n,o;-1!==e.className.split(" ").indexOf(i)||-1<e.style.width.indexOf("%")||(t=e.getAttribute("height")||e.offsetHeight,n=e.getAttribute("width")||e.offsetWidth,t=("string"==typeof t?parseInt(t):t)/("string"==typeof n?parseInt(n):n)*100,(n=document.createElement("div")).className=i,(o=n.style).position="relative",o.width="100%",o.paddingTop=t+"%",(o=e.style).position="absolute",o.width="100%",o.height="100%",o.left="0",o.top="0",null!=(t=e.parentNode)&&t.insertBefore(n,e),null!=(o=e.parentNode)&&o.removeChild(e),n.appendChild(e))})}}),function(){var e=document.querySelector(".gh-burger");e&&e.addEventListener("click",function(){document.body.classList.contains("is-head-open")?document.body.classList.remove("is-head-open"):document.body.classList.add("is-head-open")})}(),lightbox(".kg-image-card > .kg-image[width][height], .kg-gallery-image > img"),reframe(document.querySelectorAll(['.gh-content iframe[src*="youtube.com"]','.gh-content iframe[src*="youtube-nocookie.com"]','.gh-content iframe[src*="player.vimeo.com"]','.gh-content iframe[src*="kickstarter.com"][src*="video.html"]',".gh-content object",".gh-content embed"].join(","))),dropdown(),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).jarallax=t()}(this,function(){"use strict";function e(e){"complete"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",e,{capture:!0,once:!0,passive:!0})}let t;var p=t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};const r=p["navigator"],n=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(r.userAgent);let o,f;function i(){f=n?(!o&&document.body&&((o=document.createElement("div")).style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(o)),(o?o.clientHeight:0)||p.innerHeight||document.documentElement.clientHeight):p.innerHeight||document.documentElement.clientHeight}i(),p.addEventListener("resize",i),p.addEventListener("orientationchange",i),p.addEventListener("load",i),e(()=>{i()});const a=[];function s(){a.length&&(a.forEach((e,t)=>{var{instance:e,oldData:n}=e,o=e.$item.getBoundingClientRect(),o={width:o.width,height:o.height,top:o.top,bottom:o.bottom,wndW:p.innerWidth,wndH:f},i=!n||n.wndW!==o.wndW||n.wndH!==o.wndH||n.width!==o.width||n.height!==o.height,n=i||!n||n.top!==o.top||n.bottom!==o.bottom;a[t].oldData=o,i&&e.onResize(),n&&e.onScroll()}),p.requestAnimationFrame(s))}let l=0;class c{constructor(e,t){const n=this,o=(n.instanceID=l,l+=1,n.$item=e,n.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null},n.$item.dataset||{}),i={};if(Object.keys(o).forEach(e=>{var t=e.substr(0,1).toLowerCase()+e.substr(1);t&&void 0!==n.defaults[t]&&(i[t]=o[e])}),n.options=n.extend({},n.defaults,i,t),n.pureOptions=n.extend({},n.options),Object.keys(n.options).forEach(e=>{"true"===n.options[e]?n.options[e]=!0:"false"===n.options[e]&&(n.options[e]=!1)}),n.options.speed=Math.min(2,Math.max(-1,parseFloat(n.options.speed))),"string"==typeof n.options.disableParallax&&(n.options.disableParallax=new RegExp(n.options.disableParallax)),n.options.disableParallax instanceof RegExp){const e=n.options.disableParallax;n.options.disableParallax=()=>e.test(r.userAgent)}if("function"!=typeof n.options.disableParallax&&(n.options.disableParallax=()=>!1),"string"==typeof n.options.disableVideo&&(n.options.disableVideo=new RegExp(n.options.disableVideo)),n.options.disableVideo instanceof RegExp){const e=n.options.disableVideo;n.options.disableVideo=()=>e.test(r.userAgent)}"function"!=typeof n.options.disableVideo&&(n.options.disableVideo=()=>!1);let a=n.options.elementInViewport;a&&"object"==typeof a&&void 0!==a.length&&([a]=a),a instanceof Element||(a=null),n.options.elementInViewport=a,n.image={src:n.options.imgSrc||null,$container:null,useImgTag:!1,position:"fixed"},n.initImg()&&n.canInitParallax()&&n.init()}css(t,n){return"string"==typeof n?p.getComputedStyle(t).getPropertyValue(n):(Object.keys(n).forEach(e=>{t.style[e]=n[e]}),t)}extend(n,...o){return n=n||{},Object.keys(o).forEach(t=>{o[t]&&Object.keys(o[t]).forEach(e=>{n[e]=o[t][e]})}),n}getWindowData(){return{width:p.innerWidth||document.documentElement.clientWidth,height:f,y:document.documentElement.scrollTop}}initImg(){var e=this;let t=e.options.imgElement;return(t=t&&"string"==typeof t?e.$item.querySelector(t):t)instanceof Element||(e.options.imgSrc?(t=new Image).src=e.options.imgSrc:t=null),t&&(e.options.keepImg?e.image.$item=t.cloneNode(!0):(e.image.$item=t,e.image.$itemParent=t.parentNode),e.image.useImgTag=!0),!(!e.image.$item&&(null===e.image.src&&(e.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.image.bgImage=e.css(e.$item,"background-image")),!e.image.bgImage||"none"===e.image.bgImage))}canInitParallax(){return!this.options.disableParallax()}init(){const e=this,t={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"};let n={pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden"};if(!e.options.keepImg){const t=e.$item.getAttribute("style");if(t&&e.$item.setAttribute("data-jarallax-original-styles",t),e.image.useImgTag){const t=e.image.$item.getAttribute("style");t&&e.image.$item.setAttribute("data-jarallax-original-styles",t)}}if("static"===e.css(e.$item,"position")&&e.css(e.$item,{position:"relative"}),"auto"===e.css(e.$item,"z-index")&&e.css(e.$item,{zIndex:0}),e.image.$container=document.createElement("div"),e.css(e.image.$container,t),e.css(e.image.$container,{"z-index":e.options.zIndex}),"fixed"===this.image.position&&e.css(e.image.$container,{"-webkit-clip-path":"polygon(0 0, 100% 0, 100% 100%, 0 100%)","clip-path":"polygon(0 0, 100% 0, 100% 100%, 0 100%)"}),e.image.$container.setAttribute("id","jarallax-container-"+e.instanceID),e.$item.appendChild(e.image.$container),e.image.useImgTag?n=e.extend({"object-fit":e.options.imgSize,"object-position":e.options.imgPosition,"max-width":"none"},t,n):(e.image.$item=document.createElement("div"),e.image.src&&(n=e.extend({"background-position":e.options.imgPosition,"background-size":e.options.imgSize,"background-repeat":e.options.imgRepeat,"background-image":e.image.bgImage||`url("${e.image.src}")`},t,n))),"opacity"!==e.options.type&&"scale"!==e.options.type&&"scale-opacity"!==e.options.type&&1!==e.options.speed||(e.image.position="absolute"),"fixed"===e.image.position){const t=function(e){for(var t=[];null!==e.parentElement;)1===(e=e.parentElement).nodeType&&t.push(e);return t}(e.$item).filter(e=>{var e=p.getComputedStyle(e),t=e["-webkit-transform"]||e["-moz-transform"]||e.transform;return t&&"none"!==t||/(auto|scroll)/.test(e.overflow+e["overflow-y"]+e["overflow-x"])});e.image.position=t.length?"absolute":"fixed"}n.position=e.image.position,e.css(e.image.$item,n),e.image.$container.appendChild(e.image.$item),e.onResize(),e.onScroll(!0),e.options.onInit&&e.options.onInit.call(e),"none"!==e.css(e.$item,"background-image")&&e.css(e.$item,{"background-image":"none"}),e.addToParallaxList()}addToParallaxList(){a.push({instance:this}),1===a.length&&p.requestAnimationFrame(s)}removeFromParallaxList(){const n=this;a.forEach((e,t)=>{e.instance.instanceID===n.instanceID&&a.splice(t,1)})}destroy(){var e,t=this,n=(t.removeFromParallaxList(),t.$item.getAttribute("data-jarallax-original-styles"));t.$item.removeAttribute("data-jarallax-original-styles"),n?t.$item.setAttribute("style",n):t.$item.removeAttribute("style"),t.image.useImgTag&&(e=t.image.$item.getAttribute("data-jarallax-original-styles"),t.image.$item.removeAttribute("data-jarallax-original-styles"),e?t.image.$item.setAttribute("style",n):t.image.$item.removeAttribute("style"),t.image.$itemParent)&&t.image.$itemParent.appendChild(t.image.$item),t.image.$container&&t.image.$container.parentNode.removeChild(t.image.$container),t.options.onDestroy&&t.options.onDestroy.call(t),delete t.$item.jarallax}clipContainer(){}coverImage(){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.height,o=e.options["speed"],i="scroll"===e.options.type||"scroll-opacity"===e.options.type;let a=0,r=n,s;return i&&(o<0?(a=o*Math.max(n,f),f<n&&(a-=o*(n-f))):a=o*(n+f),1<o?r=Math.abs(a-f):o<0?r=a/o+Math.abs(a):r+=(f-n)*(1-o),a/=2),e.parallaxScrollDistance=a,s=i?(f-r)/2:(n-r)/2,e.css(e.image.$item,{height:r+"px",marginTop:s+"px",left:"fixed"===e.image.position?t.left+"px":"0",width:t.width+"px"}),e.options.onCoverImage&&e.options.onCoverImage.call(e),{image:{height:r,marginTop:s},container:t}}isVisible(){return this.isElementInViewport||!1}onScroll(e){var n=this,o=n.$item.getBoundingClientRect(),i=o.top,a=o.height,r={};let t=o;if(n.options.elementInViewport&&(t=n.options.elementInViewport.getBoundingClientRect()),n.isElementInViewport=0<=t.bottom&&0<=t.right&&t.top<=f&&t.left<=p.innerWidth,e||n.isElementInViewport){var e=Math.max(0,i),s=Math.max(0,a+i),l=Math.max(0,-i),c=Math.max(0,i+a-f),u=Math.max(0,a-(i+a-f)),d=Math.max(0,-i+f-a),m=1-(f-i)/(f+a)*2;let t=1;if(a<f?t=1-(l||c)/a:s<=f?t=s/f:u<=f&&(t=u/f),"opacity"!==n.options.type&&"scale-opacity"!==n.options.type&&"scroll-opacity"!==n.options.type||(r.transform="translate3d(0,0,0)",r.opacity=t),"scale"===n.options.type||"scale-opacity"===n.options.type){let e=1;n.options.speed<0?e-=n.options.speed*t:e+=n.options.speed*(1-t),r.transform=`scale(${e}) translate3d(0,0,0)`}if("scroll"===n.options.type||"scroll-opacity"===n.options.type){let e=n.parallaxScrollDistance*m;"absolute"===n.image.position&&(e-=i),r.transform=`translate3d(0,${e}px,0)`}n.css(n.image.$item,r),n.options.onScroll&&n.options.onScroll.call(n,{section:o,beforeTop:e,beforeTopEnd:s,afterTop:l,beforeBottom:c,beforeBottomEnd:u,afterBottom:d,visiblePercent:t,fromViewportCenter:m})}}onResize(){this.coverImage()}}function u(e,t,...n){var o=(e=("object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?[e]:e).length;let i,a=0;for(;a<o;a+=1)if("object"==typeof t||void 0===t?e[a].jarallax||(e[a].jarallax=new c(e[a],t)):e[a].jarallax&&(i=e[a].jarallax[t].apply(e[a].jarallax,n)),void 0!==i)return i;return e}u.constructor=c;const d=p.jQuery;if(void 0!==d){const e=function(...e){Array.prototype.unshift.call(e,this);e=u.apply(p,e);return"object"!=typeof e?e:this},t=(e.constructor=u.constructor,d.fn.jarallax);d.fn.jarallax=e,d.fn.jarallax.noConflict=function(){return d.fn.jarallax=t,this}}return e(()=>{u(document.querySelectorAll("[data-jarallax]"))}),u}),function(){if(document.body.classList.contains("has-background-about")){const e=document.querySelector(".gh-about");if(e){const t=e.querySelector(".gh-about-image");t.naturalWidth||imagesLoaded(t,function(){e.style.setProperty("--about-height",t.clientWidth*t.naturalHeight/t.naturalWidth+"px")})}}}(),initParallax(),function(){var e=document.querySelector("[data-toggle-comments]");e&&e.addEventListener("click",function(){document.body.classList.toggle("comments-opened")})}(),function(){var e=document.querySelector(".gh-article-excerpt");if(e){let t=e.textContent;var n=t.match(/\p{EPres}|\p{ExtPict}/gu);n&&(n.forEach(function(e){t=t.replace(e,`<span class="emoji">${e}</span>`)}),e.innerHTML=t)}}(),pagination(!0,initParallax);