mirror of
https://github.com/TryGhost/Ruby.git
synced 2024-10-30 04:48:33 +02:00
2 lines
87 KiB
JavaScript
2 lines
87 KiB
JavaScript
!function(t,i){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("jquery")):t.jQueryBridget=i(t,t.jQuery)}(window,function(e,t){"use strict";function i(c,o,u){(u=u||t||e.jQuery)&&(o.prototype.option||(o.prototype.option=function(e){u.isPlainObject(e)&&(this.options=u.extend(!0,this.options,e))}),u.fn[c]=function(e){if("string"!=typeof e)return n=e,this.each(function(e,t){var i=u.data(t,c);i?(i.option(n),i._init()):(i=new o(t,n),u.data(t,c,i))}),this;var t,r,s,a,l,n,i=d.call(arguments,1);return s=i,l="$()."+c+'("'+(r=e)+'")',(t=this).each(function(e,t){var i,n,o=u.data(t,c);o?(i=o[r])&&"_"!=r.charAt(0)?(n=i.apply(o,s),a=void 0===a?n:a):p(l+" is not a valid method"):p(c+" not initialized. Cannot call methods, i.e. "+l)}),void 0!==a?a:t},n(u))}function n(e){!e||e&&e.bridget||(e.bridget=i)}var d=Array.prototype.slice,o=e.console,p=void 0===o?function(){}:function(e){o.error(e)};return n(t||e.jQuery),i}),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 i=this._events=this._events||{},n=i[e]=i[e]||[];return-1==n.indexOf(t)&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{};return(i[e]=i[e]||{})[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return-1!=n&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o];n&&n[r]&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",t):"object"==typeof module&&module.exports?module.exports=t():e.matchesSelector=t()}(window,function(){"use strict";var i=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0;i<t.length;i++){var n=t[i]+"MatchesSelector";if(e[n])return n}}();return function(e,t){return e[i](t)}}),function(t,i){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("desandro-matches-selector")):t.fizzyUIUtils=i(t,t.matchesSelector)}(window,function(c,r){var u={extend:function(e,t){for(var i in t)e[i]=t[i];return e},modulo:function(e,t){return(e%t+t)%t}},t=Array.prototype.slice;u.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?t.call(e):[e]},u.removeFrom=function(e,t){var i=e.indexOf(t);-1!=i&&e.splice(i,1)},u.getParent=function(e,t){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,r(e,t))return e},u.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},u.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},u.filterFindElements=function(e,n){e=u.makeArray(e);var o=[];return e.forEach(function(e){if(e instanceof HTMLElement){if(!n)return void o.push(e);r(e,n)&&o.push(e);for(var t=e.querySelectorAll(n),i=0;i<t.length;i++)o.push(t[i])}}),o},u.debounceMethod=function(e,t,n){n=n||100;var o=e.prototype[t],r=t+"Timeout";e.prototype[t]=function(){var e=this[r];clearTimeout(e);var t=arguments,i=this;this[r]=setTimeout(function(){o.apply(i,t),delete i[r]},n)}},u.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},u.toDashed=function(e){return e.replace(/(.)([A-Z])/g,function(e,t,i){return t+"-"+i}).toLowerCase()};var d=c.console;return u.htmlInit=function(a,l){u.docReady(function(){var e=u.toDashed(l),o="data-"+e,t=document.querySelectorAll("["+o+"]"),i=document.querySelectorAll(".js-"+e),n=u.makeArray(t).concat(u.makeArray(i)),r=o+"-options",s=c.jQuery;n.forEach(function(t){var e,i=t.getAttribute(o)||t.getAttribute(r);try{e=i&&JSON.parse(i)}catch(e){return void(d&&d.error("Error parsing "+o+" on "+t.className+": "+e))}var n=new a(t,e);s&&s.data(t,l,n)})})},u}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/core",["ev-emitter/ev-emitter","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("ev-emitter"),require("fizzy-ui-utils")):i.InfiniteScroll=n(i,i.EvEmitter,i.fizzyUIUtils)}(window,function(t,e,o){function r(e,t){var i=o.getQueryElement(e);if(i){if((e=i).infiniteScrollGUID){var n=a[e.infiniteScrollGUID];return n.option(t),n}this.element=e,this.options=o.extend({},r.defaults),this.option(t),s&&(this.$element=s(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(i||e))}var s=t.jQuery,a={};r.defaults={},r.create={},r.destroy={};var i=r.prototype;o.extend(i,e.prototype);var n=0;i.create=function(){var e=this.guid=++n;if(this.element.infiniteScrollGUID=e,(a[e]=this).pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath())for(var t in this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit(),r.create)r.create[t].call(this);else console.error("Disabling InfiniteScroll")},i.option=function(e){o.extend(this.options,e)},i.callOnInit=function(){var e=this.options.onInit;e&&e.call(this,this)},i.dispatchEvent=function(e,t,i){this.log(e,i);var n,o,r=t?[t].concat(i):i;this.emitEvent(e,r),s&&this.$element&&(n=e+=".infiniteScroll",t&&((o=s.Event(t)).type=e,n=o),this.$element.trigger(n,i))};var l={initialized:function(e){return"on "+e},request:function(e){return"URL: "+e},load:function(e,t){return(e.title||"")+". URL: "+t},error:function(e,t){return e+". URL: "+t},append:function(e,t,i){return i.length+" items. URL: "+t},last:function(e,t){return"URL: "+t},history:function(e,t){return"URL: "+t},pageIndex:function(e,t){return"current page determined to be: "+e+" from "+t}};i.log=function(e,t){var i,n;this.options.debug&&(i="[InfiniteScroll] "+e,(n=l[e])&&(i+=". "+n.apply(this,t)),console.log(i))},i.updateMeasurements=function(){this.windowHeight=t.innerHeight;var e=this.element.getBoundingClientRect();this.top=e.top+t.pageYOffset},i.updateScroller=function(){var e=this.options.elementScroll;if(e){if(this.scroller=!0===e?this.element:o.getQueryElement(e),!this.scroller)throw"Unable to find elementScroll: "+e}else this.scroller=t},i.updateGetPath=function(){var e=this.options.path;if(e){var t=typeof e;if("function"!=t)return"string"==t&&e.match("{{#}}")?void this.updateGetPathTemplate(e):void this.updateGetPathSelector(e);this.getPath=e}else console.error("InfiniteScroll path option required. Set as: "+e)},i.updateGetPathTemplate=function(t){this.getPath=function(){var e=this.pageIndex+1;return t.replace("{{#}}",e)}.bind(this);var e=t.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),i=new RegExp(e),n=location.href.match(i);n&&(this.pageIndex=parseInt(n[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};var c=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/];return i.updateGetPathSelector=function(e){var t=document.querySelector(e);if(t){for(var i,n,o=t.getAttribute("href"),r=0;o&&r<c.length;r++){n=c[r];var s=o.match(n);if(s){i=s.slice(1);break}}return i?(this.isPathSelector=!0,this.getPath=function(){var e=this.pageIndex+1;return i[0]+e+i[2]}.bind(this),this.pageIndex=parseInt(i[1],10)-1,void this.log("pageIndex",[this.pageIndex,"next link"])):void console.error("InfiniteScroll unable to parse next link href: "+o)}console.error("Bad InfiniteScroll path option. Next link not found: "+e)},i.updateGetAbsolutePath=function(){var e,t,i=this.getPath();i.match(/^http/)||i.match(/^\//)?this.getAbsolutePath=this.getPath:(e=location.pathname,i.match(/^\?/)?this.getAbsolutePath=function(){return e+this.getPath()}:(t=e.substring(0,e.lastIndexOf("/")),this.getAbsolutePath=function(){return t+"/"+this.getPath()}))},r.create.hideNav=function(){var e=o.getQueryElement(this.options.hideNav);e&&(e.style.display="none",this.nav=e)},r.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},i.destroy=function(){for(var e in this.allOff(),r.destroy)r.destroy[e].call(this);delete this.element.infiniteScrollGUID,delete a[this.guid],s&&this.$element&&s.removeData(this.element,"infiniteScroll")},r.throttle=function(n,o){var r,s;return o=o||200,function(){var e=+new Date,t=arguments,i=function(){r=e,n.apply(this,t)}.bind(this);r&&e<r+o?(clearTimeout(s),s=setTimeout(i,o)):i()}},r.data=function(e){var t=(e=o.getQueryElement(e))&&e.infiniteScrollGUID;return t&&a[t]},r.setJQuery=function(e){s=e},o.htmlInit(r,"infinite-scroll"),i._init=function(){},s&&s.bridget&&s.bridget("infiniteScroll",r),r}),function(t,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/page-load",["./core"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("./core")):i(t,t.InfiniteScroll)}(window,function(n,o){function s(e){for(var t=document.createDocumentFragment(),i=0;e&&i<e.length;i++)t.appendChild(e[i]);return t}function i(e){for(var t=e.querySelectorAll("script"),i=0;i<t.length;i++){var n=t[i],o=document.createElement("script");(function(e,t){for(var i=e.attributes,n=0;n<i.length;n++){var o=i[n];t.setAttribute(o.name,o.value)}})(n,o),o.innerHTML=n.innerHTML,n.parentNode.replaceChild(o,n)}}var e=o.prototype;return o.defaults.loadOnScroll=!0,o.defaults.checkLastPage=!0,o.defaults.responseType="document",o.create.pageLoad=function(){this.canLoad=!0,this.on("scrollThreshold",this.onScrollThresholdLoad),this.on("load",this.checkLastPage),this.options.outlayer&&this.on("append",this.onAppendOutlayer)},e.onScrollThresholdLoad=function(){this.options.loadOnScroll&&this.loadNextPage()},e.loadNextPage=function(){var t,e,i,n,o,r,s,a,l,c;!this.isLoading&&this.canLoad&&(t=this.getAbsolutePath(),this.isLoading=!0,e=function(e){this.onPageLoad(e,t)}.bind(this),i=function(e){this.onPageError(e,t)}.bind(this),n=function(e){this.lastPageReached(e,t)}.bind(this),o=t,r=this.options.responseType,s=e,a=i,l=n,(c=new XMLHttpRequest).open("GET",o,!0),c.responseType=r||"",c.setRequestHeader("X-Requested-With","XMLHttpRequest"),c.onload=function(){var e;200==c.status?s(c.response):204==c.status?l(c.response):(e=new Error(c.statusText),a(e))},c.onerror=function(){var e=new Error("Network error requesting "+o);a(e)},c.send(),this.dispatchEvent("request",null,[t]))},e.onPageLoad=function(e,t){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[e,t]),this.appendNextPage(e,t),e},e.appendNextPage=function(e,t){var i,n,o,r=this.options.append;"document"==this.options.responseType&&r&&(i=e.querySelectorAll(r),n=s(i),o=function(){this.appendItems(i,n),this.isLoading=!1,this.dispatchEvent("append",null,[e,t,i])}.bind(this),this.options.outlayer?this.appendOutlayerItems(n,o):o())},e.appendItems=function(e,t){e&&e.length&&(i(t=t||s(e)),this.element.appendChild(t))},e.appendOutlayerItems=function(e,t){var i=o.imagesLoaded||n.imagesLoaded;return i?void i(e,t):(console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1))},e.onAppendOutlayer=function(e,t,i){this.options.outlayer.appended(i)},e.checkLastPage=function(e,t){var i=this.options.checkLastPage;if(i){var n,o=this.options.path;if("function"==typeof o)if(!this.getPath())return void this.lastPageReached(e,t);"string"==typeof i?n=i:this.isPathSelector&&(n=o),n&&e.querySelector&&(e.querySelector(n)||this.lastPageReached(e,t))}},e.lastPageReached=function(e,t){this.canLoad=!1,this.dispatchEvent("last",null,[e,t])},e.onPageError=function(e,t){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[e,t]),e},o.create.prefill=function(){if(this.options.prefill){var e=this.options.append;if(!e)return void console.error("append option required for prefill. Set as :"+e);this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()}},e.prefill=function(){var e=this.getPrefillDistance();this.isPrefilling=0<=e,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},e.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},e.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},o}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/scroll-watch",["./core","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("./core"),require("fizzy-ui-utils")):n(i,i.InfiniteScroll,i.fizzyUIUtils)}(window,function(i,e,t){var n=e.prototype;return e.defaults.scrollThreshold=400,e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);var e=this.options.scrollThreshold;!e&&0!==e||this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){var t=e?"addEventListener":"removeEventListener";this.scroller[t]("scroll",this.pageScrollHandler),i[t]("resize",this.resizeHandler)},n.onPageScroll=e.throttle(function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")}),n.getBottomDistance=function(){return this.options.elementScroll?this.getElementBottomDistance():this.getWindowBottomDistance()},n.getWindowBottomDistance=function(){return this.top+this.element.clientHeight-(i.pageYOffset+this.windowHeight)},n.getElementBottomDistance=function(){return this.scroller.scrollHeight-(this.scroller.scrollTop+this.scroller.clientHeight)},n.onResize=function(){this.updateMeasurements()},t.debounceMethod(e,"onResize",150),e}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/history",["./core","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("./core"),require("fizzy-ui-utils")):n(i,i.InfiniteScroll,i.fizzyUIUtils)}(window,function(n,e,t){var i=e.prototype;e.defaults.history="replace";var r=document.createElement("a");return e.create.history=function(){if(this.options.history)return r.href=this.getAbsolutePath(),(r.origin||r.protocol+"//"+r.host)==location.origin?void(this.options.append?this.createHistoryAppend():this.createHistoryPageLoad()):void console.error("[InfiniteScroll] cannot set history with different origin: "+r.origin+" on "+location.origin+" . History behavior disabled.")},i.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPageIndex=0,this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},i.bindHistoryAppendEvents=function(e){var t=e?"addEventListener":"removeEventListener";this.scroller[t]("scroll",this.scrollHistoryHandler),n[t]("unload",this.unloadHandler)},i.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=i.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},i.onAppendHistory=function(e,t,i){var n,o;i&&i.length&&(n=i[0],o=this.getElementScrollY(n),r.href=t,this.scrollPages.push({top:o,path:r.href,title:e.title}))},i.getElementScrollY=function(e){return this.options.elementScroll?this.getElementElementScrollY(e):this.getElementWindowScrollY(e)},i.getElementWindowScrollY=function(e){return e.getBoundingClientRect().top+n.pageYOffset},i.getElementElementScrollY=function(e){return e.offsetTop-this.top},i.onScrollHistory=function(){for(var e,t,i=this.getScrollViewY(),n=0;n<this.scrollPages.length;n++){var o=this.scrollPages[n];if(o.top>=i)break;e=n,t=o}e!=this.scrollPageIndex&&(this.scrollPageIndex=e,this.setHistory(t.title,t.path))},t.debounceMethod(e,"onScrollHistory",150),i.getScrollViewY=function(){return this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:n.pageYOffset+this.windowHeight/2},i.setHistory=function(e,t){var i=this.options.history;i&&history[i+"State"]&&(history[i+"State"](null,e,t),this.options.historyTitle&&(document.title=e),this.dispatchEvent("history",null,[e,t]))},i.onUnload=function(){var e,t,i=this.scrollPageIndex;0!==i&&(e=this.scrollPages[i],t=n.pageYOffset-e.top+this.top,this.destroyHistory(),scrollTo(0,t))},i.onPageLoadHistory=function(e,t){this.setHistory(e.title,t)},e}),function(e,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/button",["./core","fizzy-ui-utils/utils"],function(e,t){return i(0,e,t)}):"object"==typeof module&&module.exports?module.exports=i(0,require("./core"),require("fizzy-ui-utils")):i(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,function(e,t,i){function n(e,t){this.element=e,this.infScroll=t,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),t.on("request",this.disable.bind(this)),t.on("load",this.enable.bind(this)),t.on("error",this.hide.bind(this)),t.on("last",this.hide.bind(this))}return t.create.button=function(){var e=i.getQueryElement(this.options.button);e&&(this.button=new n(e,this))},t.destroy.button=function(){this.button&&this.button.destroy()},n.prototype.onClick=function(e){e.preventDefault(),this.infScroll.loadNextPage()},n.prototype.enable=function(){this.element.removeAttribute("disabled")},n.prototype.disable=function(){this.element.disabled="disabled"},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.destroy=function(){this.element.removeEventListener("click",this.clickHandler)},t.Button=n,t}),function(e,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/status",["./core","fizzy-ui-utils/utils"],function(e,t){return i(0,e,t)}):"object"==typeof module&&module.exports?module.exports=i(0,require("./core"),require("fizzy-ui-utils")):i(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,function(e,t,i){function n(e){r(e,"none")}function o(e){r(e,"block")}function r(e,t){e&&(e.style.display=t)}var s=t.prototype;return t.create.status=function(){var e=i.getQueryElement(this.options.status);e&&(this.statusElement=e,this.statusEventElements={request:e.querySelector(".infinite-scroll-request"),error:e.querySelector(".infinite-scroll-error"),last:e.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},s.bindHideStatus=function(e){var t=this.options.append?"append":"load";this[e](t,this.hideAllStatus)},s.showRequestStatus=function(){this.showStatus("request")},s.showErrorStatus=function(){this.showStatus("error")},s.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},s.showStatus=function(e){o(this.statusElement),this.hideStatusEventElements(),o(this.statusEventElements[e])},s.hideAllStatus=function(){n(this.statusElement),this.hideStatusEventElements()},s.hideStatusEventElements=function(){for(var e in this.statusEventElements){n(this.statusEventElements[e])}},t}),function(e){"function"==typeof define&&define.amd?define(["infinite-scroll/js/core","infinite-scroll/js/page-load","infinite-scroll/js/scroll-watch","infinite-scroll/js/history","infinite-scroll/js/button","infinite-scroll/js/status"],e):"object"==typeof module&&module.exports&&(module.exports=e(require("./core"),require("./page-load"),require("./scroll-watch"),require("./history"),require("./button"),require("./status")))}((window,function(e){return e})),function(t,i){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("ev-emitter")):t.imagesLoaded=i(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function r(e,t){for(var i in t)e[i]=t[i];return e}function s(e,t,i){if(!(this instanceof s))return new s(e,t,i);var n,o=e;return"string"==typeof e&&(o=document.querySelectorAll(e)),o?(this.elements=(n=o,Array.isArray(n)?n:"object"==typeof n&&"number"==typeof n.length?c.call(n):[n]),this.options=r({},this.options),"function"==typeof t?i=t:r(this.options,t),i&&this.on("always",i),this.getImages(),a&&(this.jqDeferred=new a.Deferred),void setTimeout(this.check.bind(this))):void l.error("Bad element for imagesLoaded "+(o||e))}function i(e){this.img=e}function n(e,t){this.url=e,this.element=t,this.img=new Image}var a=t.jQuery,l=t.console,c=Array.prototype.slice;(s.prototype=Object.create(e.prototype)).options={},s.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},s.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background)for(var r=e.querySelectorAll(this.options.background),n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}};var u={1:!0,9:!0,11:!0};return s.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},s.prototype.addImage=function(e){var t=new i(e);this.images.push(t)},s.prototype.addBackground=function(e,t){var i=new n(e,t);this.images.push(i)},s.prototype.check=function(){function t(e,t,i){setTimeout(function(){n.progress(e,t,i)})}var n=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},s.prototype.progress=function(e,t,i){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&&l&&l.log("progress: "+i,e,t)},s.prototype.complete=function(){var e,t=this.hasAnyBroken?"fail":"done";this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred&&(e=this.hasAnyBroken?"reject":"resolve",this.jqDeferred[e](this))},(i.prototype=Object.create(e.prototype)).check=function(){return this.getIsImageComplete()?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},i.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},i.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},i.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},i.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},i.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},i.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},(n.prototype=Object.create(i.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())},n.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},n.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(){var e,t,i;function n(e,t){var i,n;if(this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1},"object"==typeof e)for(i in e)n=e[i],this.options[i]=n;this.context=null!=t?t:this,this.unique=this._genKey()}n.prototype.hasNext=function(){return"string"==typeof this.context.nextUrl&&0<this.context.nextUrl.length},n.prototype.next=function(){return!!this.hasNext()&&this.run(this.context.nextUrl)},n.prototype.run=function(e){var t,i;if("string"!=typeof this.options.clientId&&"string"!=typeof this.options.accessToken)throw new Error("Missing clientId or accessToken.");if("string"!=typeof this.options.accessToken&&"string"!=typeof this.options.clientId)throw new Error("Missing clientId or accessToken.");return null!=this.options.before&&"function"==typeof this.options.before&&this.options.before.call(this),"undefined"!=typeof document&&null!==document&&((i=document.createElement("script")).id="instafeed-fetcher",i.src=e||this._buildUrl(),document.getElementsByTagName("head")[0].appendChild(i),t="instafeedCache"+this.unique,window[t]=new n(this.options,this),window[t].unique=this.unique),!0},n.prototype.parse=function(e){var t,i,n,o,r,s,a,l,c,u,d,p,h,f,m,g,y,v,b,w,x,S,E,I,k,C,T,_;if("object"!=typeof e){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(200!==e.meta.code){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,e.meta.error_message),!1;throw new Error("Error from Instagram: "+e.meta.error_message)}if(0===e.data.length){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}if(null!=this.options.success&&"function"==typeof this.options.success&&this.options.success.call(this,e),this.context.nextUrl="",null!=e.pagination&&(this.context.nextUrl=e.pagination.next_url),"none"!==this.options.sortBy)switch(k="least"===(C="random"===this.options.sortBy?["","random"]:this.options.sortBy.split("-"))[0],C[1]){case"random":e.data.sort(function(){return.5-Math.random()});break;case"recent":e.data=this._sortBy(e.data,"created_time",k);break;case"liked":e.data=this._sortBy(e.data,"likes.count",k);break;case"commented":e.data=this._sortBy(e.data,"comments.count",k);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}if("undefined"!=typeof document&&null!==document&&!1===this.options.mock){if(p=e.data,I=parseInt(this.options.limit,10),null!=this.options.limit&&p.length>I&&(p=p.slice(0,I)),s=document.createDocumentFragment(),null!=this.options.filter&&"function"==typeof this.options.filter&&(p=this._filter(p,this.options.filter)),null!=this.options.template&&"string"==typeof this.options.template){for(a="",_=document.createElement("div"),l=0,w=p.length;l<w;l++){if("object"!=typeof(u=(c=p[l]).images[this.options.resolution]))throw r="No image found for resolution: "+this.options.resolution+".",new Error(r);g=u.width,m=(f=u.height)<g?"landscape":"square",g<f&&(m="portrait"),d=u.url,0<=window.location.protocol.indexOf("http")&&!this.options.useHttp&&(d=d.replace(/https?:\/\//,"//")),a+=this._makeTemplate(this.options.template,{model:c,id:c.id,link:c.link,type:c.type,image:d,width:g,height:f,orientation:m,caption:this._getObjectProperty(c,"caption.text"),likes:c.likes.count,comments:c.comments.count,location:this._getObjectProperty(c,"location.name")})}for(_.innerHTML=a,o=[],n=0,i=_.childNodes.length;n<i;)o.push(_.childNodes[n]),n+=1;for(v=0,x=o.length;v<x;v++)E=o[v],s.appendChild(E)}else for(b=0,S=p.length;b<S;b++){if(c=p[b],h=document.createElement("img"),"object"!=typeof(u=c.images[this.options.resolution]))throw r="No image found for resolution: "+this.options.resolution+".",new Error(r);d=u.url,0<=window.location.protocol.indexOf("http")&&!this.options.useHttp&&(d=d.replace(/https?:\/\//,"//")),h.src=d,!0===this.options.links?((t=document.createElement("a")).href=c.link,t.appendChild(h),s.appendChild(t)):s.appendChild(h)}if("string"==typeof(T=this.options.target)&&(T=document.getElementById(T)),null==T)throw r='No element with id="'+this.options.target+'" on page.',new Error(r);T.appendChild(s),document.getElementsByTagName("head")[0].removeChild(document.getElementById("instafeed-fetcher")),y="instafeedCache"+this.unique,window[y]=void 0;try{delete window[y]}catch(e){0}}return null!=this.options.after&&"function"==typeof this.options.after&&this.options.after.call(this),!0},n.prototype._buildUrl=function(){var e,t;switch(this.options.get){case"popular":e="media/popular";break;case"tagged":if(!this.options.tagName)throw new Error("No tag name specified. Use the 'tagName' option.");e="tags/"+this.options.tagName+"/media/recent";break;case"location":if(!this.options.locationId)throw new Error("No location specified. Use the 'locationId' option.");e="locations/"+this.options.locationId+"/media/recent";break;case"user":if(!this.options.userId)throw new Error("No user specified. Use the 'userId' option.");e="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return t="https://api.instagram.com/v1/"+e,null!=this.options.accessToken?t+="?access_token="+this.options.accessToken:t+="?client_id="+this.options.clientId,null!=this.options.limit&&(t+="&count="+this.options.limit),t+="&callback=instafeedCache"+this.unique+".parse"},n.prototype._genKey=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return""+e()+e()+e()+e()},n.prototype._makeTemplate=function(e,t){for(var i,n,o,r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,s=e;r.test(s);)n=s.match(r)[1],o=null!=(i=this._getObjectProperty(t,n))?i:"",s=s.replace(r,function(){return""+o});return s},n.prototype._getObjectProperty=function(e,t){for(var i,n=(t=t.replace(/\[(\w+)\]/g,".$1")).split(".");n.length;){if(i=n.shift(),!(null!=e&&i in e))return null;e=e[i]}return e},n.prototype._sortBy=function(e,o,r){var t=function(e,t){var i=this._getObjectProperty(e,o),n=this._getObjectProperty(t,o);return r?n<i?1:-1:i<n?1:-1};return e.sort(t.bind(this)),e},n.prototype._filter=function(e,t){for(var i=[],n=function(e){if(t(e))return i.push(e)},o=0,r=e.length;o<r;o++)n(e[o]);return i},e=n,t=this,i=function(){return e},"function"==typeof define&&define.amd?define([],i):"object"==typeof module&&module.exports?module.exports=e:t.Instafeed=e}.call(this),function(e){var t=function(a,R){"use strict";if(R.getElementsByClassName){var H,F,B=R.documentElement,l=a.Date,n=a.HTMLPictureElement,c="addEventListener",N="getAttribute",u=a[c],q=a.setTimeout,d=a.requestAnimationFrame||q,p=a.requestIdleCallback,U=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],i={},j=Array.prototype.forEach,W=function(e,t){return i[t]||(i[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),i[t].test(e[N]("class")||"")&&i[t]},Z=function(e,t){W(e,t)||e.setAttribute("class",(e[N]("class")||"").trim()+" "+t)},$=function(e,t){var i;(i=W(e,t))&&e.setAttribute("class",(e[N]("class")||"").replace(i," "))},G=function(t,i,e){var n=e?c:"removeEventListener";e&&G(t,i),o.forEach(function(e){t[n](e,i)})},K=function(e,t,i,n,o){var r=R.createEvent("Event");return i||(i={}),i.instance=H,r.initEvent(t,!n,!o),r.detail=i,e.dispatchEvent(r),r},Y=function(e,t){var i;!n&&(i=a.picturefill||F.pf)?(t&&t.src&&!e[N]("srcset")&&e.setAttribute("srcset",t.src),i({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)},Q=function(e,t){return(getComputedStyle(e,null)||{})[t]},s=function(e,t,i){for(i=i||e.offsetWidth;i<F.minSize&&t&&!e._lazysizesWidth;)i=t.offsetWidth,t=t.parentNode;return i},V=function(){var i,n,t=[],o=[],r=t,s=function(){var e=r;for(r=t.length?o:t,i=!0,n=!1;e.length;)e.shift()();i=!1},e=function(e,t){i&&!t?e.apply(this,arguments):(r.push(e),n||(n=!0,(R.hidden?q:d)(s)))};return e._lsFlush=s,e}(),X=function(i,e){return e?function(){V(i)}:function(){var e=this,t=arguments;V(function(){i.apply(e,t)})}},J=function(e){var i,n=0,o=F.throttleDelay,r=F.ricTimeout,t=function(){i=!1,n=l.now(),e()},s=p&&r>49?function(){p(t,{timeout:r}),r!==F.ricTimeout&&(r=F.ricTimeout)}:X(function(){q(t)},!0);return function(e){var t;(e=!0===e)&&(r=33),i||(i=!0,t=o-(l.now()-n),t<0&&(t=0),e||t<9?s():q(s,t))}},ee=function(e){var t,i,n=99,o=function(){t=null,e()},r=function(){var e=l.now()-i;e<n?q(r,n-e):(p||o)(o)};return function(){i=l.now(),t||(t=q(r,n))}};!function(){var e,t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};F=a.lazySizesConfig||a.lazysizesConfig||{};for(e in t)e in F||(F[e]=t[e]);a.lazySizesConfig=F,q(function(){F.init&&r()})}();var e=function(){var h,f,d,m,t,g,y,v,b,w,x,S,r=/^img$/i,p=/^iframe$/i,E="onscroll"in a&&!/(gle|ing)bot/.test(navigator.userAgent),I=0,k=0,C=0,T=-1,_=function(e){C--,e&&e.target&&G(e.target,_),(!e||C<0||!e.target)&&(C=0)},A=function(e){return null==S&&(S="hidden"==Q(R.body,"visibility")),S||"hidden"!=Q(e.parentNode,"visibility")&&"hidden"!=Q(e,"visibility")},z=function(e,t){var i,n=e,o=A(e);for(v-=t,x+=t,b-=t,w+=t;o&&(n=n.offsetParent)&&n!=R.body&&n!=B;)(o=(Q(n,"opacity")||1)>0)&&"visible"!=Q(n,"overflow")&&(i=n.getBoundingClientRect(),o=w>i.left&&b<i.right&&x>i.top-1&&v<i.bottom+1);return o},e=function(){var e,t,i,n,o,r,s,a,l,c,u,d,p=H.elements;if((m=F.loadMode)&&C<8&&(e=p.length)){for(t=0,T++,c=!F.expand||F.expand<1?B.clientHeight>500&&B.clientWidth>500?500:370:F.expand,u=c*F.expFactor,d=F.hFac,S=null,k<u&&C<1&&T>2&&m>2&&!R.hidden?(k=u,T=0):k=m>1&&T>1&&C<6?c:I;t<e;t++)if(p[t]&&!p[t]._lazyRace)if(E)if((a=p[t][N]("data-expand"))&&(r=1*a)||(r=k),l!==r&&(g=innerWidth+r*d,y=innerHeight+r,s=-1*r,l=r),i=p[t].getBoundingClientRect(),(x=i.bottom)>=s&&(v=i.top)<=y&&(w=i.right)>=s*d&&(b=i.left)<=g&&(x||w||b||v)&&(F.loadHidden||A(p[t]))&&(f&&C<3&&!a&&(m<3||T<4)||z(p[t],r))){if(O(p[t]),o=!0,C>9)break}else!o&&f&&!n&&C<4&&T<4&&m>2&&(h[0]||F.preloadAfterLoad)&&(h[0]||!a&&(x||w||b||v||"auto"!=p[t][N](F.sizesAttr)))&&(n=h[0]||p[t]);else O(p[t]);n&&!o&&O(n)}},i=J(e),P=function(e){Z(e.target,F.loadedClass),$(e.target,F.loadingClass),G(e.target,M),K(e.target,"lazyloaded")},n=X(P),M=function(e){n({target:e.target})},D=function(t,i){try{t.contentWindow.location.replace(i)}catch(e){t.src=i}},L=function(e){var t,i=e[N](F.srcsetAttr);(t=F.customMedia[e[N]("data-media")||e[N]("media")])&&e.setAttribute("media",t),i&&e.setAttribute("srcset",i)},s=X(function(e,t,i,n,o){var r,s,a,l,c,u;(c=K(e,"lazybeforeunveil",t)).defaultPrevented||(n&&(i?Z(e,F.autosizesClass):e.setAttribute("sizes",n)),s=e[N](F.srcsetAttr),r=e[N](F.srcAttr),o&&(a=e.parentNode,l=a&&U.test(a.nodeName||"")),u=t.firesLoad||"src"in e&&(s||r||l),c={target:e},u&&(G(e,_,!0),clearTimeout(d),d=q(_,2500),Z(e,F.loadingClass),G(e,M,!0)),l&&j.call(a.getElementsByTagName("source"),L),s?e.setAttribute("srcset",s):r&&!l&&(p.test(e.nodeName)?D(e,r):e.src=r),o&&(s||l)&&Y(e,{src:r})),e._lazyRace&&delete e._lazyRace,$(e,F.lazyClass),V(function(){(!u||e.complete&&e.naturalWidth>1)&&(u?_(c):C--,P(c))},!0)}),O=function(e){var t,i=r.test(e.nodeName),n=i&&(e[N](F.sizesAttr)||e[N]("sizes")),o="auto"==n;(!o&&f||!i||!e[N]("src")&&!e.srcset||e.complete||W(e,F.errorClass)||!W(e,F.lazyClass))&&(t=K(e,"lazyunveilread").detail,o&&te.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,C++,s(e,t,o,n,i))},o=function(){if(!f){if(l.now()-t<999)return void q(o,999);var e=ee(function(){F.loadMode=3,i()});f=!0,F.loadMode=3,i(),u("scroll",function(){3==F.loadMode&&(F.loadMode=2),e()},!0)}};return{_:function(){t=l.now(),H.elements=R.getElementsByClassName(F.lazyClass),h=R.getElementsByClassName(F.lazyClass+" "+F.preloadClass),u("scroll",i,!0),u("resize",i,!0),a.MutationObserver?new MutationObserver(i).observe(B,{childList:!0,subtree:!0,attributes:!0}):(B[c]("DOMNodeInserted",i,!0),B[c]("DOMAttrModified",i,!0),setInterval(i,999)),u("hashchange",i,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(e){R[c](e,i,!0)}),/d$|^c/.test(R.readyState)?o():(u("load",o),R[c]("DOMContentLoaded",i),q(o,2e4)),H.elements.length?(e(),V._lsFlush()):i()},checkElems:i,unveil:O}}(),te=function(){var i,r=X(function(e,t,i,n){var o,r,s;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),U.test(t.nodeName||""))for(o=t.getElementsByTagName("source"),r=0,s=o.length;r<s;r++)o[r].setAttribute("sizes",n);i.detail.dataAttr||Y(e,i.detail)}),n=function(e,t,i){var n,o=e.parentNode;o&&(i=s(e,o,i),n=K(e,"lazybeforesizes",{width:i,dataAttr:!!t}),n.defaultPrevented||(i=n.detail.width)&&i!==e._lazysizesWidth&&r(e,o,n,i))},e=function(){var e,t=i.length;if(t)for(e=0;e<t;e++)n(i[e])},t=ee(e);return{_:function(){i=R.getElementsByClassName(F.autosizesClass),u("resize",t)},checkElems:t,updateElem:n}}(),r=function(){r.i||(r.i=!0,te._(),e._())};return H={cfg:F,autoSizer:te,loader:e,init:r,uP:Y,aC:Z,rC:$,hC:W,fire:K,gW:s,rAF:V}}}(e,e.document);e.lazySizes=t,"object"==typeof module&&module.exports&&(module.exports=t)}(window),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,a){function e(e){if(T)return!0;e=e||window.event,C.timeToIdle&&C.mouseUsed&&!w&&H();for(var t,i,n,o=(e.target||e.srcElement).getAttribute("class")||"",r=0;r<B.length;r++)(t=B[r]).onTap&&-1<o.indexOf("pswp__"+t.name)&&(t.onTap(),i=!0);i&&(e.stopPropagation&&e.stopPropagation(),T=!0,n=a.features.isOldAndroid?600:30,setTimeout(function(){T=!1},n))}function i(e,t,i){a[(i?"add":"remove")+"Class"](e,"pswp__"+t)}function n(){var e=1===C.getNumItemsFn();e!==k&&(i(h,"ui--one-slide",e),k=e)}function t(){i(v,"share-modal--hidden",D)}function r(){return(D=!D)?(a.removeClass(v,"pswp__share-modal--fade-in"),setTimeout(function(){D&&t()},300)):(t(),setTimeout(function(){D||a.addClass(v,"pswp__share-modal--fade-in")},30)),D||O(),0}function s(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)),D||r(),1))}function l(e){for(var t=0;t<C.closeElClasses.length;t++)if(a.hasClass(e,"pswp__"+C.closeElClasses[t]))return!0}function c(e){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!==t.nodeName||(clearTimeout(A),A=setTimeout(function(){z.setIdle(!0)},C.timeToIdleOutside))}function u(e){var t,i,n=e.vGap;!o.likelyTouchDevice||C.mouseUsed||screen.width>C.fitControlsWidth?(t=C.barsSize,C.captionEl&&"auto"===t.bottom?(m||((m=a.createEl("pswp__caption pswp__caption--fake")).appendChild(a.createEl("pswp__caption__center")),h.insertBefore(m,f),a.addClass(h,"pswp__ui--fit")),C.addCaptionHTMLFn(e,m,!0)?(i=m.clientHeight,n.bottom=parseInt(i,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,i=0;i<t;i++){o=e[i],r=o.className;for(var n=0;n<B.length;n++)s=B[n],-1<r.indexOf("pswp__"+s.name)&&(C[s.option]?(a.removeClass(o,"pswp__element--disabled"),s.onInit&&s.onInit(o)):a.addClass(o,"pswp__element--disabled"))}}var o,r,s;e(h.children);var t=a.getChildByClass(h,"pswp__top-bar");t&&e(t.children)}var p,h,f,m,g,y,v,b,w,x,S,E,I,k,C,T,_,A,z=this,P=!1,M=!0,D=!0,L={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},O=function(){for(var e,t,i,n,o="",r=0;r<C.shareButtons.length;r++)e=C.shareButtons[r],t=C.getImageURLForShare(e),i=C.getPageURLForShare(e),n=C.getTextForShare(e),o+='<a href="'+e.url.replace("{{url}}",encodeURIComponent(i)).replace("{{image_url}}",encodeURIComponent(t)).replace("{{raw_image_url}}",t).replace("{{text}}",encodeURIComponent(n))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",C.parseShareButtonOut&&(o=C.parseShareButtonOut(e,o));v.children[0].innerHTML=o,v.children[0].onclick=s},R=0,H=function(){clearTimeout(A),R=0,w&&z.setIdle(!1)},F=function(e){E!==e&&(i(S,"preloader--active",!e),E=e)},B=[{name:"caption",option:"captionEl",onInit:function(e){f=e}},{name:"share-modal",option:"shareEl",onInit:function(e){v=e},onTap:function(){r()}},{name:"button--share",option:"shareEl",onInit:function(e){y=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){S=e}}];z.init=function(){var t;a.extend(o.options,L,!0),C=o.options,h=a.getChildByClass(o.scrollWrap,"pswp__ui"),(x=o.listen)("onVerticalDrag",function(e){M&&e<.95?z.hideControls():!M&&.95<=e&&z.showControls()}),x("onPinchClose",function(e){M&&e<.9?(z.hideControls(),t=!0):t&&!M&&.9<e&&z.showControls()}),x("zoomGestureEnded",function(){(t=!1)&&!M&&z.showControls()}),x("beforeChange",z.update),x("doubleTap",function(e){var t=o.currItem.initialZoomLevel;o.getZoomLevel()!==t?o.zoomTo(t,e,333):o.zoomTo(C.getDoubleTapZoom(!1,o.currItem),e,333)}),x("preventDragEvent",function(e,t,i){var n=e.target||e.srcElement;n&&n.getAttribute("class")&&-1<e.type.indexOf("mouse")&&(0<n.getAttribute("class").indexOf("__caption")||/(SMALL|STRONG|EM)/i.test(n.tagName))&&(i.prevent=!1)}),x("bindEvents",function(){a.bind(h,"pswpTap click",e),a.bind(o.scrollWrap,"pswpTap",z.onGlobalTap),o.likelyTouchDevice||a.bind(o.scrollWrap,"mouseover",z.onMouseOver)}),x("unbindEvents",function(){D||r(),_&&clearInterval(_),a.unbind(document,"mouseout",c),a.unbind(document,"mousemove",H),a.unbind(h,"pswpTap click",e),a.unbind(o.scrollWrap,"pswpTap",z.onGlobalTap),a.unbind(o.scrollWrap,"mouseover",z.onMouseOver),p&&(a.unbind(document,p.eventK,z.updateFullscreen),p.isFullscreen()&&(C.hideAnimationDuration=0,p.exit()),p=null)}),x("destroy",function(){C.captionEl&&(m&&h.removeChild(m),a.removeClass(f,"pswp__caption--empty")),v&&(v.children[0].onclick=null),a.removeClass(h,"pswp__ui--over-close"),a.addClass(h,"pswp__ui--hidden"),z.setIdle(!1)}),C.showAnimationDuration||a.removeClass(h,"pswp__ui--hidden"),x("initialZoomIn",function(){C.showAnimationDuration&&a.removeClass(h,"pswp__ui--hidden")}),x("initialZoomOut",function(){a.addClass(h,"pswp__ui--hidden")}),x("parseVerticalMargin",u),d(),C.shareEl&&y&&v&&(D=!0),n(),C.timeToIdle&&x("mouseUsed",function(){a.bind(document,"mousemove",H),a.bind(document,"mouseout",c),_=setInterval(function(){2===++R&&z.setIdle(!0)},C.timeToIdle/2)}),C.fullscreenEl&&!a.features.isOldAndroid&&((p=p||z.getFullscreenAPI())?(a.bind(document,p.eventK,z.updateFullscreen),z.updateFullscreen(),a.addClass(o.template,"pswp--supports-fs")):a.removeClass(o.template,"pswp--supports-fs")),C.preloaderEl&&(F(!0),x("beforeChange",function(){clearTimeout(I),I=setTimeout(function(){o.currItem&&o.currItem.loading?o.allowProgressiveImg()&&(!o.currItem.img||o.currItem.img.naturalWidth)||F(!1):F(!0)},C.loadingIndicatorDelay)}),x("imageLoadComplete",function(e,t){o.currItem===t&&F(!0)}))},z.setIdle=function(e){i(h,"ui--idle",w=e)},z.update=function(){P=!(!M||!o.currItem)&&(z.updateIndexIndicator(),C.captionEl&&(C.addCaptionHTMLFn(o.currItem,f),i(f,"caption--empty",!o.currItem.title)),!0),D||r(),n()},z.updateFullscreen=function(e){e&&setTimeout(function(){o.setScrollOffset(0,a.getScrollY())},50),a[(p.isFullscreen()?"add":"remove")+"Class"](o.template,"pswp--fs")},z.updateIndexIndicator=function(){C.counterEl&&(g.innerHTML=o.getCurrentIndex()+1+C.indexIndicatorSep+C.getNumItemsFn())},z.onGlobalTap=function(e){var t=(e=e||window.event).target||e.srcElement;if(!T)if(e.detail&&"mouse"===e.detail.pointerType){if(l(t))return void o.close();a.hasClass(t,"pswp__img")&&(1===o.getZoomLevel()&&o.getZoomLevel()<=o.currItem.fitRatio?C.clickToCloseNonZoomable&&o.close():o.toggleDesktopZoom(e.detail.releasePoint))}else if(C.tapToToggleControls&&(M?z.hideControls():z.showControls()),C.tapToClose&&(a.hasClass(t,"pswp__img")||l(t)))return void o.close()},z.onMouseOver=function(e){var t=(e=e||window.event).target||e.srcElement;i(h,"ui--over-close",l(t))},z.hideControls=function(){a.addClass(h,"pswp__ui--hidden"),M=!1},z.showControls=function(){M=!0,P||z.update(),a.removeClass(h,"pswp__ui--hidden")},z.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},z.getFullscreenAPI=function(){var e,t=document.documentElement,i="fullscreenchange";return t.requestFullscreen?e={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:i}:t.mozRequestFullScreen?e={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+i}:t.webkitRequestFullscreen?e={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+i}:t.msRequestFullscreen&&(e={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),e&&(e.enter=function(){return b=C.closeOnScroll,C.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?o.template[this.enterK]():void o.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},e.exit=function(){return C.closeOnScroll=b,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(h,n,e,t){var f={features:null,bind:function(e,t,i,n){var o=(n?"remove":"add")+"EventListener";t=t.split(" ");for(var r=0;r<t.length;r++)t[r]&&e[o](t[r],i,!1)},isArray:function(e){return e instanceof Array},createEl:function(e,t){var i=document.createElement(t||"div");return e&&(i.className=e),i},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,i){f.bind(e,t,i,!0)},removeClass:function(e,t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(i," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){f.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 i=e.firstChild;i;){if(f.hasClass(i,t))return i;i=i.nextSibling}},arraySearch:function(e,t,i){for(var n=e.length;n--;)if(e[n][i]===t)return n;return-1},extend:function(e,t,i){for(var n in t)if(t.hasOwnProperty(n)){if(i&&e.hasOwnProperty(n))continue;e[n]=t[n]}},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(f.features)return f.features;var e,t,i,n,o=f.createEl().style,r="",s={};s.oldIE=document.all&&!document.addEventListener,s.touch="ontouchstart"in window,window.requestAnimationFrame&&(s.raf=window.requestAnimationFrame,s.caf=window.cancelAnimationFrame),s.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,s.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&&(s.isOldIOSPhone=!0)),n=(i=e.match(/Android\s([0-9\.]*)/))?i[1]:0,1<=(n=parseFloat(n))&&(n<4.4&&(s.isOldAndroid=!0),s.androidVersion=n),s.isMobileOpera=/opera mini|opera mobi/i.test(e));for(var a,l,c,u=["transform","perspective","animationName"],d=["","webkit","Moz","ms","O"],p=0;p<4;p++){r=d[p];for(var h=0;h<3;h++)a=u[h],l=r+(r?a.charAt(0).toUpperCase()+a.slice(1):a),!s[a]&&l in o&&(s[a]=l);r&&!s.raf&&(r=r.toLowerCase(),s.raf=window[r+"RequestAnimationFrame"],s.raf&&(s.caf=window[r+"CancelAnimationFrame"]||window[r+"CancelRequestAnimationFrame"]))}return s.raf||(c=0,s.raf=function(e){var t=(new Date).getTime(),i=Math.max(0,16-(t-c)),n=window.setTimeout(function(){e(t+i)},i);return c=t+i,n},s.caf=function(e){clearTimeout(e)}),s.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,f.features=s}};f.detectFeatures(),f.features.oldIE&&(f.bind=function(e,t,i,n){t=t.split(" ");for(var o,r=(n?"detach":"attach")+"Event",s=function(){i.handleEvent.call(i)},a=0;a<t.length;a++)if(o=t[a])if("object"==typeof i&&i.handleEvent){if(n){if(!i["oldIE"+o])return!1}else i["oldIE"+o]=s;e[r]("on"+o,i["oldIE"+o])}else e[r]("on"+o,i)});var m=this,g={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"};f.extend(g,t);function i(){return{x:0,y:0}}function o(e,t){f.extend(m,t.publicMethods),Ve.push(e)}function l(e){var t=Gt();return t-1<e?e-t:e<0?t+e:e}function r(e,t){return et[e]||(et[e]=[]),et[e].push(t)}function y(e){var t=et[e];if(t){var i=Array.prototype.slice.call(arguments);i.shift();for(var n=0;n<t.length;n++)t[n].apply(m,i)}}function v(){return(new Date).getTime()}function b(e){Be=e,m.bg.style.opacity=e*g.bgOpacity}function s(e,t,i,n,o){(!Je||o&&o!==m.currItem)&&(n/=o?o.fitRatio:m.currItem.fitRatio),e[ae]=V+t+"px, "+i+"px"+X+" scale("+n+")"}function u(e,t){var i,n;!g.loop&&t&&(i=j+(Ke.x*$e-e)/Ke.x,n=Math.round(e-xt.x),(i<0&&0<n||i>=Gt()-1&&n<0)&&(e=xt.x+n*g.mainScrollEndFriction)),xt.x=e,nt(e,W)}function w(e,t){var i=St[e]-Ge[e];return je[e]+Ue[e]+i-t/Q*i}function x(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)}function S(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function d(e,t){var i=Xt(m.currItem,Ze,e);return t&&(De=i),i}function E(e){return(e=e||m.currItem).initialZoomLevel}function I(e){return 0<(e=e||m.currItem).w?g.maxSpreadZoom:1}function p(e,t,i,n){return n===m.currItem.initialZoomLevel?(i[e]=m.currItem.initialPosition[e],!0):(i[e]=w(e,n),i[e]>t.min[e]?(i[e]=t.min[e],!0):i[e]<t.max[e]&&(i[e]=t.max[e],!0))}function a(e){var t="";g.escKey&&27===e.keyCode?t="close":g.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,m[t]()))}function c(e){e&&(Te||Ce||Oe||Se)&&(e.preventDefault(),e.stopPropagation())}function k(){m.setScrollOffset(0,f.getScrollY())}function C(e){st[e]&&(st[e].raf&&de(st[e].raf),at--,delete st[e])}function T(e){st[e]&&C(e),st[e]||(at++,st[e]={})}function _(){for(var e in st)st.hasOwnProperty(e)&&C(e)}function A(e,t,i,n,o,r,s){var a,l=v();T(e);var c=function(){if(st[e]){if(a=v()-l,n<=a)return C(e),r(i),void(s&&s());r((i-t)*o(a/n)+t),st[e].raf=ue(c)}};c()}function z(e,t){return yt.x=Math.abs(e.x-t.x),yt.y=Math.abs(e.y-t.y),Math.sqrt(yt.x*yt.x+yt.y*yt.y)}function P(e,t){return Tt.prevent=!Ct(e.target,g.isClickableElement),y("preventDragEvent",e,t,Tt),Tt.prevent}function M(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t}function D(e,t,i){i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y)}function L(){var e=We.y-m.currItem.initialPosition.y;return 1-Math.abs(e/(Ze.y/2))}function O(e){for(;0<zt.length;)zt.pop();return le?(qe=0,ft.forEach(function(e){0===qe?zt[0]=e:1===qe&&(zt[1]=e),qe++})):-1<e.type.indexOf("touch")?e.touches&&0<e.touches.length&&(zt[0]=M(e.touches[0],_t),1<e.touches.length&&(zt[1]=M(e.touches[1],At))):(_t.x=e.pageX,_t.y=e.pageY,_t.id="",zt[0]=_t),zt}function R(e,t){var i,n,o,r=We[e]+t[e],s=0<t[e],a=xt.x+t.x,l=xt.x-mt.x,c=r>De.min[e]||r<De.max[e]?g.panEndFriction:1,r=We[e]+t[e]*c;return!g.allowPanToNext&&Y!==m.currItem.initialZoomLevel||(Le?"h"!==Re||"x"!==e||Ce||(s?(r>De.min[e]&&(c=g.panEndFriction,De.min[e],i=De.min[e]-je[e]),(i<=0||l<0)&&1<Gt()?(o=a,l<0&&a>mt.x&&(o=mt.x)):De.min.x!==De.max.x&&(n=r)):(r<De.max[e]&&(c=g.panEndFriction,De.max[e],i=je[e]-De.max[e]),(i<=0||0<l)&&1<Gt()?(o=a,0<l&&a<mt.x&&(o=mt.x)):De.min.x!==De.max.x&&(n=r))):o=a,"x"!==e)?void(Oe||Ae||Y>m.currItem.fitRatio&&(We[e]+=t[e]*c)):(void 0!==o&&(u(o,!0),Ae=o!==mt.x),De.min.x!==De.max.x&&(void 0!==n?We.x=n:Ae||(We.x+=t.x*c)),void 0!==o)}function H(e){if(!("mousedown"===e.type&&0<e.button)){if(Zt)return void e.preventDefault();var t,i,n;Ee&&"mousedown"===e.type||(P(e,!0)&&e.preventDefault(),y("pointerDown"),le&&((t=f.arraySearch(ft,e.pointerId,"id"))<0&&(t=ft.length),ft[t]={x:e.pageX,y:e.pageY,id:e.pointerId}),n=(i=O(e)).length,ze=null,_(),Ie&&1!==n||(Ie=He=!0,f.bind(window,$,m),xe=Ne=Fe=Se=Ae=Te=ke=Ce=!1,Re=null,y("firstTouchStart",i),x(je,We),Ue.x=Ue.y=0,x(pt,i[0]),x(ht,pt),mt.x=Ke.x*$e,gt=[{x:pt.x,y:pt.y}],be=ve=v(),d(Y,!0),It(),kt()),!Pe&&1<n&&!Oe&&!Ae&&(Q=Y,Pe=ke=!(Ce=!1),Ue.y=Ue.x=0,x(je,We),x(ct,i[0]),x(ut,i[1]),D(ct,ut,Et),St.x=Math.abs(Et.x)-We.x,St.y=Math.abs(Et.y)-We.y,Me=z(ct,ut)))}}function F(e){var t,i,n,o;e.preventDefault(),le&&-1<(t=f.arraySearch(ft,e.pointerId,"id"))&&((i=ft[t]).x=e.pageX,i.y=e.pageY),Ie&&(n=O(e),Re||Te||Pe?ze=n:xt.x!==Ke.x*$e?Re="h":(o=Math.abs(n[0].x-pt.x)-Math.abs(n[0].y-pt.y),10<=Math.abs(o)&&(Re=0<o?"h":"v",ze=n)))}function B(e){if(ge.isOldAndroid){if(Ee&&"mouseup"===e.type)return;-1<e.type.indexOf("touch")&&(clearTimeout(Ee),Ee=setTimeout(function(){Ee=0},600))}var t,i;y("pointerUp"),P(e,!1)&&e.preventDefault(),!le||-1<(i=f.arraySearch(ft,e.pointerId,"id"))&&(t=ft.splice(i,1)[0],navigator.msPointerEnabled?(t.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],t.type||(t.type=e.pointerType||"mouse")):t.type=e.pointerType||"mouse");var n,o=O(e),r=o.length;if("mouseup"===e.type&&(r=0),2===r)return!(ze=null);1===r&&x(ht,o[0]),0!==r||Re||Oe||(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"})),y("touchRelease",e,t));var s,a,l=-1;if(0===r&&(Ie=!1,f.unbind(window,$,m),It(),Pe?l=0:-1!==wt&&(l=v()-wt)),wt=1===r?v():-1,n=-1!==l&&l<150?"zoom":"swipe",Pe&&r<2&&(Pe=!1,1===r&&(n="zoomPointerUp"),y("zoomGestureEnded")),ze=null,Te||Ce||Oe||Se)if(_(),(we=we||Mt()).calculateSwipeSpeed("x"),Se){L()<g.verticalDragRange?m.close():(s=We.y,a=Be,A("verticalDrag",0,1,300,f.easing.cubic.out,function(e){We.y=(m.currItem.initialPosition.y-s)*e+s,b((1-a)*e+a),tt()}),y("onVerticalDrag",1))}else{if((Ae||Oe)&&0===r){if(Lt(n,we))return;n="zoomPointerUp"}if(!Oe)return"swipe"!==n?void Rt():void(!Ae&&Y>m.currItem.fitRatio&&Dt(we))}}var N,q,U,j,W,Z,$,G,K,Y,Q,V,X,J,ee,te,ie,ne,oe,re,se,ae,le,ce,ue,de,pe,he,fe,me,ge,ye,ve,be,we,xe,Se,Ee,Ie,ke,Ce,Te,_e,Ae,ze,Pe,Me,De,Le,Oe,Re,He,Fe,Be,Ne,qe,Ue=i(),je=i(),We=i(),Ze={},$e=0,Ge={},Ke=i(),Ye=0,Qe=!0,Ve=[],Xe={},Je=!1,et={},tt=function(e){Le&&(e&&(Y>m.currItem.fitRatio?Je||(Jt(m.currItem,!1,!0),Je=!0):Je&&(Jt(m.currItem),Je=!1)),s(Le,We.x,We.y,Y))},it=function(e){e.container&&s(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},nt=function(e,t){t[ae]=V+e+"px, 0px"+X},ot=null,rt=function(){ot&&(f.unbind(document,"mousemove",rt),f.addClass(h,"pswp--has_mouse"),g.mouseUsed=!0,y("mouseUsed")),ot=setTimeout(function(){ot=null},100)},st={},at=0,lt={shout:y,listen:r,viewportSize:Ze,options:g,isMainScrollAnimating:function(){return Oe},getZoomLevel:function(){return Y},getCurrentIndex:function(){return j},isDragging:function(){return Ie},isZooming:function(){return Pe},setScrollOffset:function(e,t){Ge.x=e,me=Ge.y=t,y("updateScrollOffset",Ge)},applyZoomPan:function(e,t,i,n){We.x=t,We.y=i,Y=e,tt(n)},init:function(){if(!N&&!q){var e;m.framework=f,m.template=h,m.bg=f.getChildByClass(h,"pswp__bg"),pe=h.className,N=!0,ge=f.detectFeatures(),ue=ge.raf,de=ge.caf,ae=ge.transform,fe=ge.oldIE,m.scrollWrap=f.getChildByClass(h,"pswp__scroll-wrap"),m.container=f.getChildByClass(m.scrollWrap,"pswp__container"),W=m.container.style,m.itemHolders=te=[{el:m.container.children[0],wrap:0,index:-1},{el:m.container.children[1],wrap:0,index:-1},{el:m.container.children[2],wrap:0,index:-1}],te[0].el.style.display=te[2].el.style.display="none",function(){if(ae){var e=ge.perspective&&!ce;return V="translate"+(e?"3d(":"("),X=ge.perspective?", 0px)":")"}ae="left",f.addClass(h,"pswp--ie"),nt=function(e,t){t.left=e+"px"},it=function(e){var t=1<e.fitRatio?1:e.fitRatio,i=e.container.style,n=t*e.w,o=t*e.h;i.width=n+"px",i.height=o+"px",i.left=e.initialPosition.x+"px",i.top=e.initialPosition.y+"px"},tt=function(){var e,t,i,n,o;Le&&(e=Le,n=(i=1<(t=m.currItem).fitRatio?1:t.fitRatio)*t.w,o=i*t.h,e.width=n+"px",e.height=o+"px",e.left=We.x+"px",e.top=We.y+"px")}}(),K={resize:m.updateSize,orientationchange:function(){clearTimeout(ye),ye=setTimeout(function(){Ze.x!==m.scrollWrap.clientWidth&&m.updateSize()},500)},scroll:k,keydown:a,click:c};var t=ge.isOldIOSPhone||ge.isOldAndroid||ge.isMobileOpera;for(ge.animationName&&ge.transform&&!t||(g.showAnimationDuration=g.hideAnimationDuration=0),e=0;e<Ve.length;e++)m["init"+Ve[e]]();n&&(m.ui=new n(m,f)).init(),y("firstUpdate"),j=j||g.index||0,(isNaN(j)||j<0||j>=Gt())&&(j=0),m.currItem=$t(j),(ge.isOldIOSPhone||ge.isOldAndroid)&&(Qe=!1),h.setAttribute("aria-hidden","false"),g.modal&&(Qe?h.style.position="fixed":(h.style.position="absolute",h.style.top=f.getScrollY()+"px")),void 0===me&&(y("initialLayout"),me=he=f.getScrollY());var i="pswp--open ";for(g.mainClass&&(i+=g.mainClass+" "),g.showHideOpacity&&(i+="pswp--animate_opacity "),i+=ce?"pswp--touch":"pswp--notouch",i+=ge.animationName?" pswp--css_animation":"",i+=ge.svg?" pswp--svg":"",f.addClass(h,i),m.updateSize(),Z=-1,Ye=null,e=0;e<3;e++)nt((e+Z)*Ke.x,te[e].el.style);fe||f.bind(m.scrollWrap,G,m),r("initialZoomInEnd",function(){m.setContent(te[0],j-1),m.setContent(te[2],j+1),te[0].el.style.display=te[2].el.style.display="block",g.focus&&h.focus(),f.bind(document,"keydown",m),ge.transform&&f.bind(m.scrollWrap,"click",m),g.mouseUsed||f.bind(document,"mousemove",rt),f.bind(window,"resize scroll orientationchange",m),y("bindEvents")}),m.setContent(te[1],j),m.updateCurrItem(),y("afterInit"),Qe||(J=setInterval(function(){at||Ie||Pe||Y!==m.currItem.initialZoomLevel||m.updateSize()},1e3)),f.addClass(h,"pswp--visible")}},close:function(){N&&(q=!(N=!1),y("close"),f.unbind(window,"resize scroll orientationchange",m),f.unbind(window,"scroll",K.scroll),f.unbind(document,"keydown",m),f.unbind(document,"mousemove",rt),ge.transform&&f.unbind(m.scrollWrap,"click",m),Ie&&f.unbind(window,$,m),clearTimeout(ye),y("unbindEvents"),Kt(m.currItem,null,!0,m.destroy))},destroy:function(){y("destroy"),Ut&&clearTimeout(Ut),h.setAttribute("aria-hidden","true"),h.className=pe,J&&clearInterval(J),f.unbind(m.scrollWrap,G,m),f.unbind(window,"scroll",m),It(),_(),et=null},panTo:function(e,t,i){i||(e>De.min.x?e=De.min.x:e<De.max.x&&(e=De.max.x),t>De.min.y?t=De.min.y:t<De.max.y&&(t=De.max.y)),We.x=e,We.y=t,tt()},handleEvent:function(e){e=e||window.event,K[e.type]&&K[e.type](e)},goTo:function(e){var t=(e=l(e))-j;Ye=t,j=e,m.currItem=$t(j),$e-=t,u(Ke.x*$e),_(),Oe=!1,m.updateCurrItem()},next:function(){m.goTo(j+1)},prev:function(){m.goTo(j-1)},updateCurrZoomItem:function(e){var t;e&&y("beforeChange",0),Le=te[1].el.children.length?(t=te[1].el.children[0],f.hasClass(t,"pswp__zoom-wrap")?t.style:null):null,De=m.currItem.bounds,Q=Y=m.currItem.initialZoomLevel,We.x=De.center.x,We.y=De.center.y,e&&y("afterChange")},invalidateCurrItems:function(){ee=!0;for(var e=0;e<3;e++)te[e].item&&(te[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==Ye){var t,i=Math.abs(Ye);if(!(e&&i<2)){m.currItem=$t(j),Je=!1,y("beforeChange",Ye),3<=i&&(Z+=Ye+(0<Ye?-3:3),i=3);for(var n,o=0;o<i;o++)0<Ye?(t=te.shift(),te[2]=t,nt((++Z+2)*Ke.x,t.el.style),m.setContent(t,j-i+o+1+1)):(t=te.pop(),te.unshift(t),nt(--Z*Ke.x,t.el.style),m.setContent(t,j+i-o-1-1));!Le||1!==Math.abs(Ye)||(n=$t(ie)).initialZoomLevel!==Y&&(Xt(n,Ze),Jt(n),it(n)),Ye=0,m.updateCurrZoomItem(),ie=j,y("afterChange")}}},updateSize:function(e){if(!Qe&&g.modal){var t=f.getScrollY();if(me!==t&&(h.style.top=t+"px",me=t),!e&&Xe.x===window.innerWidth&&Xe.y===window.innerHeight)return;Xe.x=window.innerWidth,Xe.y=window.innerHeight,h.style.height=Xe.y+"px"}if(Ze.x=m.scrollWrap.clientWidth,Ze.y=m.scrollWrap.clientHeight,k(),Ke.x=Ze.x+Math.round(Ze.x*g.spacing),Ke.y=Ze.y,u(Ke.x*$e),y("beforeResize"),void 0!==Z){for(var i,n,o,r=0;r<3;r++)i=te[r],nt((r+Z)*Ke.x,i.el.style),o=j+r-1,g.loop&&2<Gt()&&(o=l(o)),(n=$t(o))&&(ee||n.needsUpdate||!n.bounds)?(m.cleanSlide(n),m.setContent(i,o),1===r&&(m.currItem=n,m.updateCurrZoomItem(!0)),n.needsUpdate=!1):-1===i.index&&0<=o&&m.setContent(i,o),n&&n.container&&(Xt(n,Ze),Jt(n),it(n));ee=!1}Q=Y=m.currItem.initialZoomLevel,(De=m.currItem.bounds)&&(We.x=De.center.x,We.y=De.center.y,tt(!0)),y("resize")},zoomTo:function(t,e,i,n,o){e&&(Q=Y,St.x=Math.abs(e.x)-We.x,St.y=Math.abs(e.y)-We.y,x(je,We));var r=d(t,!1),s={};p("x",r,s,t),p("y",r,s,t);var a=Y,l=We.x,c=We.y;S(s);function u(e){1===e?(Y=t,We.x=s.x,We.y=s.y):(Y=(t-a)*e+a,We.x=(s.x-l)*e+l,We.y=(s.y-c)*e+c),o&&o(e),tt(1===e)}i?A("customZoomTo",0,1,i,n||f.easing.sine.inOut,u):u(1)}},ct={},ut={},dt={},pt={},ht={},ft=[],mt={},gt=[],yt={},vt=0,bt=i(),wt=0,xt=i(),St=i(),Et=i(),It=function(){_e&&(de(_e),_e=null)},kt=function(){Ie&&(_e=ue(kt),Pt())},Ct=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&-1<e.getAttribute("class").indexOf("pswp__scroll-wrap"))&&(t(e)?e:Ct(e.parentNode,t))},Tt={},_t={},At={},zt=[],Pt=function(){if(ze){var e=ze.length;if(0!==e)if(x(ct,ze[0]),dt.x=ct.x-pt.x,dt.y=ct.y-pt.y,Pe&&1<e){if(pt.x=ct.x,pt.y=ct.y,!dt.x&&!dt.y&&(p=ze[1],h=ut,p.x===h.x&&p.y===h.y))return;x(ut,ze[1]),Ce||(Ce=!0,y("zoomGestureStarted"));var t=z(ct,ut),i=Ot(t);i>m.currItem.initialZoomLevel+m.currItem.initialZoomLevel/15&&(Ne=!0);var n,o=1,r=E(),s=I();i<r?g.pinchToClose&&!Ne&&Q<=m.currItem.initialZoomLevel?(b(n=1-(r-i)/(r/1.2)),y("onPinchClose",n),Fe=!0):(1<(o=(r-i)/r)&&(o=1),i=r-o*(r/3)):s<i&&(1<(o=(i-s)/(6*r))&&(o=1),i=s+o*r),o<0&&(o=0),D(ct,ut,bt),Ue.x+=bt.x-Et.x,Ue.y+=bt.y-Et.y,x(Et,bt),We.x=w("x",i),We.y=w("y",i),xe=Y<i,Y=i,tt()}else{if(!Re)return;if(He&&(He=!1,10<=Math.abs(dt.x)&&(dt.x-=ze[0].x-ht.x),10<=Math.abs(dt.y)&&(dt.y-=ze[0].y-ht.y)),pt.x=ct.x,pt.y=ct.y,0===dt.x&&0===dt.y)return;if("v"===Re&&g.closeOnVerticalDrag&&"fit"===g.scaleMode&&Y===m.currItem.initialZoomLevel){Ue.y+=dt.y,We.y+=dt.y;var a=L();return Se=!0,y("onVerticalDrag",a),b(a),void tt()}l=v(),c=ct.x,u=ct.y,50<l-be&&((d=2<gt.length?gt.shift():{}).x=c,d.y=u,gt.push(d),be=l),Te=!0,De=m.currItem.bounds,R("x",dt)||(R("y",dt),S(We),tt())}}var l,c,u,d,p,h},Mt=function(){var t,i,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){i=1<gt.length?(t=v()-be+50,gt[gt.length-2][e]):(t=v()-ve,ht[e]),n.lastFlickOffset[e]=pt[e]-i,n.lastFlickDist[e]=Math.abs(n.lastFlickOffset[e]),20<n.lastFlickDist[e]?n.lastFlickSpeed[e]=n.lastFlickOffset[e]/t:n.lastFlickSpeed[e]=0,Math.abs(n.lastFlickSpeed[e])<.1&&(n.lastFlickSpeed[e]=0),n.slowDownRatio[e]=.95,n.slowDownRatioReverse[e]=1-n.slowDownRatio[e],n.speedDecelerationRatio[e]=1},calculateOverBoundsAnimOffset:function(t,e){n.backAnimStarted[t]||(We[t]>De.min[t]?n.backAnimDestination[t]=De.min[t]:We[t]<De.max[t]&&(n.backAnimDestination[t]=De.max[t]),void 0!==n.backAnimDestination[t]&&(n.slowDownRatio[t]=.7,n.slowDownRatioReverse[t]=1-n.slowDownRatio[t],n.speedDecelerationRatioAbs[t]<.05&&(n.lastFlickSpeed[t]=0,n.backAnimStarted[t]=!0,A("bounceZoomPan"+t,We[t],n.backAnimDestination[t],e||300,f.easing.sine.out,function(e){We[t]=e,tt()}))))},calculateAnimOffset:function(e){n.backAnimStarted[e]||(n.speedDecelerationRatio[e]=n.speedDecelerationRatio[e]*(n.slowDownRatio[e]+n.slowDownRatioReverse[e]-n.slowDownRatioReverse[e]*n.timeDiff/10),n.speedDecelerationRatioAbs[e]=Math.abs(n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]),n.distanceOffset[e]=n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]*n.timeDiff,We[e]+=n.distanceOffset[e])},panAnimLoop:function(){if(st.zoomPan&&(st.zoomPan.raf=ue(n.panAnimLoop),n.now=v(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),tt(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05))return We.x=Math.round(We.x),We.y=Math.round(We.y),tt(),void C("zoomPan")}};return n},Dt=function(e){return e.calculateSwipeSpeed("y"),De=m.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):(T("zoomPan"),e.lastNow=v(),void e.panAnimLoop())},Lt=function(e,t){var i,n,o,r,s;Oe||(vt=j),"swipe"===e&&(o=pt.x-ht.x,r=t.lastFlickDist.x<10,30<o&&(r||20<t.lastFlickOffset.x)?n=-1:o<-30&&(r||t.lastFlickOffset.x<-20)&&(n=1)),n&&((j+=n)<0?(j=g.loop?Gt()-1:0,s=!0):j>=Gt()&&(j=g.loop?0:Gt()-1,s=!0),s&&!g.loop||(Ye+=n,$e-=n,i=!0));var a=Ke.x*$e,l=Math.abs(a-xt.x),c=i||a>xt.x==0<t.lastFlickSpeed.x?(c=0<Math.abs(t.lastFlickSpeed.x)?l/Math.abs(t.lastFlickSpeed.x):333,c=Math.min(c,400),Math.max(c,250)):333;return vt===j&&(i=!1),Oe=!0,y("mainScrollAnimStart"),A("mainScroll",xt.x,a,c,f.easing.cubic.out,u,function(){_(),Oe=!1,vt=-1,!i&&vt===j||m.updateCurrItem(),y("mainScrollAnimComplete")}),i&&m.updateCurrItem(!0),i},Ot=function(e){return 1/Me*e*Q},Rt=function(){var e=Y,t=E(),i=I();Y<t?e=t:i<Y&&(e=i);var n,o=Be;return Fe&&!xe&&!Ne&&Y<t?m.close():(Fe&&(n=function(e){b((1-o)*e+o)}),m.zoomTo(e,0,200,f.easing.cubic.out,n)),!0};o("Gestures",{publicMethods:{initGestures:function(){function e(e,t,i,n,o){ne=e+t,oe=e+i,re=e+n,se=o?e+o:""}(le=ge.pointerEvent)&&ge.touch&&(ge.touch=!1),le?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):ge.touch?(e("touch","start","move","end","cancel"),ce=!0):e("mouse","down","move","up"),$=oe+" "+re+" "+se,G=ne,le&&!ce&&(ce=1<navigator.maxTouchPoints||1<navigator.msMaxTouchPoints),m.likelyTouchDevice=ce,K[ne]=H,K[oe]=F,K[re]=B,se&&(K[se]=K[re]),ge.touch&&(G+=" mousedown",$+=" mousemove mouseup",K.mousedown=K[ne],K.mousemove=K[oe],K.mouseup=K[re]),ce||(g.allowPanToNext=!1)}}});function Ht(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}}function Ft(e,t,i,n,o,r){t.loadError||n&&(t.imageAppended=!0,Jt(t,n,t===m.currItem&&Je),i.appendChild(n),r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))}function Bt(e){function t(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,i.onload=i.onerror=null,i=null}e.loading=!0,e.loaded=!1;var i=e.img=f.createEl("pswp__img","img");return i.onload=t,i.onerror=function(){e.loadError=!0,t()},i.src=e.src,i}function Nt(e,t){return e.src&&e.loadError&&e.container&&(t&&(e.container.innerHTML=""),e.container.innerHTML=g.errorMsg.replace("%url%",e.src),1)}function qt(){if(Qt.length){for(var e,t=0;t<Qt.length;t++)(e=Qt[t]).holder.index===e.index&&Ft(e.index,e.item,e.baseDiv,e.img,0,e.clearPlaceholder);Qt=[]}}var Ut,jt,Wt,Zt,$t,Gt,Kt=function(s,e,a,t){var l;Ut&&clearTimeout(Ut),Wt=Zt=!0,s.initialLayout?(l=s.initialLayout,s.initialLayout=null):l=g.getThumbBoundsFn&&g.getThumbBoundsFn(j);function c(){C("initialZoom"),a?(m.template.removeAttribute("style"),m.bg.removeAttribute("style")):(b(1),e&&(e.style.display="block"),f.addClass(h,"pswp--animated-in"),y("initialZoom"+(a?"OutEnd":"InEnd"))),t&&t(),Zt=!1}var u=a?g.hideAnimationDuration:g.showAnimationDuration;if(!u||!l||void 0===l.x)return y("initialZoom"+(a?"Out":"In")),Y=s.initialZoomLevel,x(We,s.initialPosition),tt(),h.style.opacity=a?0:1,b(1),void(u?setTimeout(function(){c()},u):c());var d,p;d=U,p=!m.currItem.src||m.currItem.loadError||g.showHideOpacity,s.miniImg&&(s.miniImg.style.webkitBackfaceVisibility="hidden"),a||(Y=l.w/s.w,We.x=l.x,We.y=l.y-he,m[p?"template":"bg"].style.opacity=.001,tt()),T("initialZoom"),a&&!d&&f.removeClass(h,"pswp--animated-in"),p&&(a?f[(d?"remove":"add")+"Class"](h,"pswp--animate_opacity"):setTimeout(function(){f.addClass(h,"pswp--animate_opacity")},30)),Ut=setTimeout(function(){var t,i,n,o,r,e;y("initialZoom"+(a?"Out":"In")),a?(t=l.w/s.w,i=We.x,n=We.y,o=Y,r=Be,e=function(e){1===e?(Y=t,We.x=l.x,We.y=l.y-me):(Y=(t-o)*e+o,We.x=(l.x-i)*e+i,We.y=(l.y-me-n)*e+n),tt(),p?h.style.opacity=1-e:b(r-e*r)},d?A("initialZoom",0,1,u,f.easing.cubic.out,e,c):(e(1),Ut=setTimeout(c,u+20))):(Y=s.initialZoomLevel,x(We,s.initialPosition),tt(),b(1),p?h.style.opacity=1:b(1),Ut=setTimeout(c,u+20))},a?25:90)},Yt={},Qt=[],Vt={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 jt.length}},Xt=function(e,t,i){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=Ht(),e.initialPosition=e.bounds.center,e.bounds;var n,o,r,s,a,l,c,u=!i;return u&&(e.vGap||(e.vGap={top:0,bottom:0}),y("parseVerticalMargin",e)),Yt.x=t.x,Yt.y=t.y-e.vGap.top-e.vGap.bottom,u&&(a=Yt.x/e.w,l=Yt.y/e.h,e.fitRatio=a<l?a:l,"orig"===(c=g.scaleMode)?i=1:"fit"===c&&(i=e.fitRatio),1<i&&(i=1),e.initialZoomLevel=i,e.bounds||(e.bounds=Ht())),i?(o=(n=e).w*i,r=e.h*i,(s=n.bounds).center.x=Math.round((Yt.x-o)/2),s.center.y=Math.round((Yt.y-r)/2)+n.vGap.top,s.max.x=o>Yt.x?Math.round(Yt.x-o):s.center.x,s.max.y=r>Yt.y?Math.round(Yt.y-r)+n.vGap.top:s.center.y,s.min.x=o>Yt.x?0:s.center.x,s.min.y=r>Yt.y?n.vGap.top:s.center.y,u&&i===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},Jt=function(e,t,i){var n,o;e.src&&(t=t||e.container.lastChild,n=i?e.w:Math.round(e.w*e.fitRatio),o=i?e.h:Math.round(e.h*e.fitRatio),e.placeholder&&!e.loaded&&(e.placeholder.style.width=n+"px",e.placeholder.style.height=o+"px"),t.style.width=n+"px",t.style.height=o+"px")};o("Controller",{publicMethods:{lazyLoadItem:function(e){e=l(e);var t=$t(e);t&&(!t.loaded&&!t.loading||ee)&&(y("gettingData",e,t),t.src&&Bt(t))},initController:function(){f.extend(g,Vt,!0),m.items=jt=e,$t=m.getItemAt,Gt=g.getNumItemsFn,g.loop,Gt()<3&&(g.loop=!1),r("beforeChange",function(e){for(var t=g.preload,i=null===e||0<=e,n=Math.min(t[0],Gt()),o=Math.min(t[1],Gt()),r=1;r<=(i?o:n);r++)m.lazyLoadItem(j+r);for(r=1;r<=(i?n:o);r++)m.lazyLoadItem(j-r)}),r("initialLayout",function(){m.currItem.initialLayout=g.getThumbBoundsFn&&g.getThumbBoundsFn(j)}),r("mainScrollAnimComplete",qt),r("initialZoomInEnd",qt),r("destroy",function(){for(var e,t=0;t<jt.length;t++)(e=jt[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);Qt=null})},getItemAt:function(e){return 0<=e&&void 0!==jt[e]&&jt[e]},allowProgressiveImg:function(){return g.forceProgressiveLoading||!ce||g.mouseUsed||1200<screen.width},setContent:function(t,i){g.loop&&(i=l(i));var e=m.getItemAt(t.index);e&&(e.container=null);var n,o,r,s,a=m.getItemAt(i);a?(y("gettingData",i,a),t.index=i,o=(t.item=a).container=f.createEl("pswp__zoom-wrap"),!a.src&&a.html&&(a.html.tagName?o.appendChild(a.html):o.innerHTML=a.html),Nt(a),Xt(a,Ze),!a.src||a.loadError||a.loaded?a.src&&!a.loadError&&((n=f.createEl("pswp__img","img")).style.opacity=1,n.src=a.src,Jt(a,n),Ft(0,a,o,n)):(a.loadComplete=function(e){if(N){if(t&&t.index===i){if(Nt(e,!0))return e.loadComplete=e.img=null,Xt(e,Ze),it(e),void(t.index===j&&m.updateCurrZoomItem());e.imageAppended?!Zt&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null):ge.transform&&(Oe||Zt)?Qt.push({item:e,baseDiv:o,img:e.img,index:i,holder:t,clearPlaceholder:!0}):Ft(0,e,o,e.img,0,!0)}e.loadComplete=null,e.img=null,y("imageLoadComplete",i,e)}},f.features.transform&&(r="pswp__img pswp__img--placeholder",r+=a.msrc?"":" pswp__img--placeholder--blank",s=f.createEl(r,a.msrc?"img":""),a.msrc&&(s.src=a.msrc),Jt(a,s),o.appendChild(s),a.placeholder=s),a.loading||Bt(a),m.allowProgressiveImg()&&(!Wt&&ge.transform?Qt.push({item:a,baseDiv:o,img:a.img,index:i,holder:t}):Ft(0,a,o,a.img,0,!0))),Wt||i!==j?it(a):(Le=o.style,Kt(a,n||a.img)),t.el.innerHTML="",t.el.appendChild(o)):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 ei(e,t,i){var n=document.createEvent("CustomEvent"),o={origEvent:e,target:e.target,releasePoint:t,pointerType:i||"touch"};n.initCustomEvent("pswpTap",!0,!0,o),e.target.dispatchEvent(n)}var ti,ii,ni={};o("Tap",{publicMethods:{initTap:function(){r("firstTouchStart",m.onTapStart),r("touchRelease",m.onTapRelease),r("destroy",function(){ni={},ti=null})},onTapStart:function(e){1<e.length&&(clearTimeout(ti),ti=null)},onTapRelease:function(e,t){if(t&&!Te&&!ke&&!at){var i=t;if(ti&&(clearTimeout(ti),ti=null,n=i,o=ni,Math.abs(n.x-o.x)<25&&Math.abs(n.y-o.y)<25))return void y("doubleTap",i);if("mouse"===t.type)return void ei(e,t,"mouse");if("BUTTON"===e.target.tagName.toUpperCase()||f.hasClass(e.target,"pswp__single-tap"))return void ei(e,t);x(ni,i),ti=setTimeout(function(){ei(e,t),ti=null},300)}var n,o}}}),o("DesktopZoom",{publicMethods:{initDesktopZoom:function(){fe||(ce?r("mouseUsed",function(){m.setupDesktopZoom()}):m.setupDesktopZoom(!0))},setupDesktopZoom:function(e){ii={};var t="wheel mousewheel DOMMouseScroll";r("bindEvents",function(){f.bind(h,t,m.handleMouseWheel)}),r("unbindEvents",function(){ii&&f.unbind(h,t,m.handleMouseWheel)}),m.mouseZoomedIn=!1;function i(){m.mouseZoomedIn&&(f.removeClass(h,"pswp--zoomed-in"),m.mouseZoomedIn=!1),Y<1?f.addClass(h,"pswp--zoom-allowed"):f.removeClass(h,"pswp--zoom-allowed"),o()}var n,o=function(){n&&(f.removeClass(h,"pswp--dragging"),n=!1)};r("resize",i),r("afterChange",i),r("pointerDown",function(){m.mouseZoomedIn&&(n=!0,f.addClass(h,"pswp--dragging"))}),r("pointerUp",o),e||i()},handleMouseWheel:function(e){if(Y<=m.currItem.fitRatio)return g.modal&&(!g.closeOnScroll||at||Ie?e.preventDefault():ae&&2<Math.abs(e.deltaY)&&(U=!0,m.close())),!0;if(e.stopPropagation(),ii.x=0,"deltaX"in e)1===e.deltaMode?(ii.x=18*e.deltaX,ii.y=18*e.deltaY):(ii.x=e.deltaX,ii.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(ii.x=-.16*e.wheelDeltaX),e.wheelDeltaY?ii.y=-.16*e.wheelDeltaY:ii.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;ii.y=e.detail}d(Y,!0);var t=We.x-ii.x,i=We.y-ii.y;(g.modal||t<=De.min.x&&t>=De.max.x&&i<=De.min.y&&i>=De.max.y)&&e.preventDefault(),m.panTo(t,i)},toggleDesktopZoom:function(e){e=e||{x:Ze.x/2+Ge.x,y:Ze.y/2+Ge.y};var t=g.getDoubleTapZoom(!0,m.currItem),i=Y===t;m.mouseZoomedIn=!i,m.zoomTo(i?m.currItem.initialZoomLevel:t,e,333),f[(i?"remove":"add")+"Class"](h,"pswp--zoomed-in")}}});function oi(){return yi.hash.substring(1)}function ri(){ai&&clearTimeout(ai),ci&&clearTimeout(ci)}function si(){var e=oi(),t={};if(e.length<5)return t;var i,n=e.split("&");for(r=0;r<n.length;r++){n[r]&&((i=n[r].split("=")).length<2||(t[i[0]]=i[1]))}if(g.galleryPIDs){for(var o=t.pid,r=t.pid=0;r<jt.length;r++)if(jt[r].pid===o){t.pid=r;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t}var ai,li,ci,ui,di,pi,hi,fi,mi,gi,yi,vi,bi={history:!0,galleryUID:1},wi=function(){var e,t,i,n;ci&&clearTimeout(ci),at||Ie?ci=setTimeout(wi,500):(ui?clearTimeout(li):ui=!0,e=j+1,(t=$t(j)).hasOwnProperty("pid")&&(e=t.pid),i=hi+"&gid="+g.galleryUID+"&pid="+e,fi||-1===yi.hash.indexOf(i)&&(gi=!0),n=yi.href.split("#")[0]+"#"+i,vi?"#"+i!==window.location.hash&&history[fi?"replaceState":"pushState"]("",document.title,n):fi?yi.replace(n):yi.hash=i,fi=!0,li=setTimeout(function(){ui=!1},60))};o("History",{publicMethods:{initHistory:function(){var e,t;f.extend(g,bi,!0),g.history&&(yi=window.location,fi=mi=gi=!1,hi=oi(),vi="pushState"in history,-1<hi.indexOf("gid=")&&(hi=(hi=hi.split("&gid=")[0]).split("?gid=")[0]),r("afterChange",m.updateURL),r("unbindEvents",function(){f.unbind(window,"hashchange",m.onHashChange)}),e=function(){pi=!0,mi||(gi?history.back():hi?yi.hash=hi:vi?history.pushState("",document.title,yi.pathname+yi.search):yi.hash=""),ri()},r("unbindEvents",function(){U&&e()}),r("destroy",function(){pi||e()}),r("firstUpdate",function(){j=si().pid}),-1<(t=hi.indexOf("pid="))&&("&"===(hi=hi.substring(0,t)).slice(-1)&&(hi=hi.slice(0,-1))),setTimeout(function(){N&&f.bind(window,"hashchange",m.onHashChange)},40))},onHashChange:function(){return oi()===hi?(mi=!0,void m.close()):void(ui||(di=!0,m.goTo(si().pid),di=!1))},updateURL:function(){ri(),di||(fi?ai=setTimeout(wi,800):wi())}}}),f.extend(m,lt)}}),function(x){x.fn.theiaStickySidebar=function(e){var t,i;function n(e,t){return!0===e.initialized||!(x("body").width()<e.minWidth)&&(i=t,(b=e).initialized=!0,x("head").append(x('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')),i.each(function(){var i,e={};e.sidebar=x(this),e.options=b||{},e.container=x(e.options.containerSelector),0==e.container.length&&(e.container=e.sidebar.parent()),e.sidebar.parents().css("-webkit-transform","none"),e.sidebar.css({position:"relative",overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),e.stickySidebar=e.sidebar.find(".theiaStickySidebar"),0==e.stickySidebar.length&&(i=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i,e.sidebar.find("script").filter(function(e,t){return 0===t.type.length||t.type.match(i)}).remove(),e.stickySidebar=x("<div>").addClass("theiaStickySidebar").append(e.sidebar.children()),e.sidebar.append(e.stickySidebar)),e.marginBottom=parseInt(e.sidebar.css("margin-bottom")),e.paddingTop=parseInt(e.sidebar.css("padding-top")),e.paddingBottom=parseInt(e.sidebar.css("padding-bottom"));var t,n,o=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight();function v(){e.fixedScrollTop=0,e.sidebar.css({"min-height":"1px"}),e.stickySidebar.css({position:"static",width:"",transform:"none"})}e.stickySidebar.css("padding-top",1),e.stickySidebar.css("padding-bottom",1),o-=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight()-r-o,0==o?(e.stickySidebar.css("padding-top",0),e.stickySidebarPaddingTop=0):e.stickySidebarPaddingTop=1,0==r?(e.stickySidebar.css("padding-bottom",0),e.stickySidebarPaddingBottom=0):e.stickySidebarPaddingBottom=1,e.previousScrollTop=null,e.fixedScrollTop=0,v(),e.onScroll=function(e){if(e.stickySidebar.is(":visible"))if(x("body").width()<e.options.minWidth)v();else{if(e.options.disableOnResponsiveLayouts)if(e.sidebar.outerWidth("none"==e.sidebar.css("float"))+50>e.container.width())return void v();var t,i,n,o,r,s,a,l,c,u,d,p,h,f,m,g=x(document).scrollTop(),y="static";g>=e.sidebar.offset().top+(e.paddingTop-e.options.additionalMarginTop)&&(t=e.paddingTop+b.additionalMarginTop,i=e.paddingBottom+e.marginBottom+b.additionalMarginBottom,n=e.sidebar.offset().top,o=e.sidebar.offset().top+(p=e.container,h=p.height(),p.children().each(function(){h=Math.max(h,x(this).height())}),h),r=0+b.additionalMarginTop,s=e.stickySidebar.outerHeight()+t+i<x(window).height()?r+e.stickySidebar.outerHeight():x(window).height()-e.marginBottom-e.paddingBottom-b.additionalMarginBottom,a=n-g+e.paddingTop,l=o-g-e.paddingBottom-e.marginBottom,c=e.stickySidebar.offset().top-g,u=e.previousScrollTop-g,"fixed"==e.stickySidebar.css("position")&&"modern"==e.options.sidebarBehavior&&(c+=u),"stick-to-top"==e.options.sidebarBehavior&&(c=b.additionalMarginTop),"stick-to-bottom"==e.options.sidebarBehavior&&(c=s-e.stickySidebar.outerHeight()),c=0<u?Math.min(c,r):Math.max(c,s-e.stickySidebar.outerHeight()),c=Math.max(c,a),c=Math.min(c,l-e.stickySidebar.outerHeight()),y=((d=e.container.height()==e.stickySidebar.outerHeight())||c!=r)&&(d||c!=s-e.stickySidebar.outerHeight())?g+c-e.sidebar.offset().top-e.paddingTop<=b.additionalMarginTop?"static":"absolute":"fixed"),"fixed"==y?(f=x(document).scrollLeft(),e.stickySidebar.css({position:"fixed",width:w(e.stickySidebar)+"px",transform:"translateY("+c+"px)",left:e.sidebar.offset().left+parseInt(e.sidebar.css("padding-left"))-f+"px",top:"0px"})):"absolute"==y?(m={},"absolute"!=e.stickySidebar.css("position")&&(m.position="absolute",m.transform="translateY("+(g+c-e.sidebar.offset().top-e.stickySidebarPaddingTop-e.stickySidebarPaddingBottom)+"px)",m.top="0px"),m.width=w(e.stickySidebar)+"px",m.left="",e.stickySidebar.css(m)):"static"==y&&v(),"static"!=y&&1==e.options.updateSidebarHeight&&e.sidebar.css({"min-height":e.stickySidebar.outerHeight()+e.stickySidebar.offset().top-e.sidebar.offset().top+e.paddingBottom}),e.previousScrollTop=g}},e.onScroll(e),x(document).scroll((t=e,function(){t.onScroll(t)})),x(window).resize((n=e,function(){n.stickySidebar.css({position:"static"}),n.onScroll(n)}))}),!0);var b,i}function w(e){var t;try{t=e[0].getBoundingClientRect().width}catch(e){}return void 0===t&&(t=e.width()),t}(e=x.extend({containerSelector:"",additionalMarginTop:0,additionalMarginBottom:0,updateSidebarHeight:!0,minWidth:0,disableOnResponsiveLayouts:!0,sidebarBehavior:"modern"},e)).additionalMarginTop=parseInt(e.additionalMarginTop)||0,e.additionalMarginBottom=parseInt(e.additionalMarginBottom)||0,n(t=e,i=this)||(console.log("TSS: Body width smaller than options.minWidth. Init is delayed."),x(document).scroll(function(t,i){return function(e){n(t,i)&&x(this).unbind(e)}}(t,i)),x(window).resize(function(t,i){return function(e){n(t,i)&&x(this).unbind(e)}}(t,i)))}}(jQuery);var body=$("body");function social(){"use strict";var e,t={facebook:{name:"Facebook",icon:"facebook"},twitter:{name:"Twitter",icon:"twitter"},instagram:{name:"Instagram",icon:"instagram"},dribbble:{name:"Dribbble",icon:"dribbble"},behance:{name:"Behance",icon:"behance"},github:{name:"GitHub",icon:"github-circle"},linkedin:{name:"LinkedIn",icon:"linkedin"},vk:{name:"VK",icon:"vk"},rss:{name:"RSS",icon:"rss"}},i=themeOptions.social_links,n="";for(e in i)""!=i[e]&&(n+='<a class="social-item" href="'+i[e]+'" target="_blank"><i class="icon icon-'+t[e].icon+'"></i></a>');$(".social").html(n)}function author(){"use strict";$(".author-name").on("click",function(){$(this).next(".author-social").toggleClass("enabled")})}function stickySidebar(){"use strict";jQuery(".sidebar-column, .related-column").theiaStickySidebar({additionalMarginTop:30,additionalMarginBottom:30})}function pagination(){"use strict";var e=$(".post-feed .row"),n=$(".infinite-scroll-button");body.hasClass("paged-next")&&(e.on("request.infiniteScroll",function(e,t){n.hide()}),e.on("load.infiniteScroll",function(e,t,i){$(t).find("body").hasClass("paged-next")&&n.show()}),e.infiniteScroll({append:".post-column",button:".infinite-scroll-button",debug:!1,hideNav:".pagination",history:!1,path:".pagination .older-posts",scrollThreshold:!1,status:".infinite-scroll-status"}))}function facebook(){"use strict";var e=$(".widget-facebook");"__YOUR_FACEBOOK_PAGE_URL__"==e.find(".fb-page").attr("data-href")&&e.remove()}function loadInstagram(){"use strict";var i,n=$(".instagram-feed"),o="ruby_instagram";""!=themeOptions.instagram_token?null!==localStorage.getItem(o)&&Math.floor(Date.now()/1e3)-JSON.parse(localStorage.getItem(o)).timestamp<300?outputInstagram(i=JSON.parse(localStorage.getItem(o)).photos,n):$.ajax({url:"https://graph.instagram.com/me/media/",type:"GET",data:{access_token:themeOptions.instagram_token,limit:6,fields:"media_url, permalink, thumbnail_url, media_type"},success:function(e){var t={photos:i=e.data,timestamp:Math.floor(Date.now()/1e3)};localStorage.setItem(o,JSON.stringify(t)),outputInstagram(i,n)}}):n.parent(".widget-instagram").remove()}function outputInstagram(e,t){"use strict";var i,n,o="";for(n in e){var r="VIDEO"!=(i=e[n]).media_type?i.media_url:i.thumbnail_url;o+='<a class="instagram-feed-item" href="'+i.permalink+'" target="_blank" rel="noopener noreferrer"><img class="u-object-fit" src="'+r+'"><i class="instagram-feed-item-icon icon icon-instagram"></i></a>'}t.each(function(e,t){$(t).html(o),$(t).css("height",Math.round($(t).height())+"px")})}function gallery(){"use strict";document.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),i=e.attributes.width.value/e.attributes.height.value;t.style.flex=i+" 1 0%"}),pswp(".kg-gallery-container",".kg-gallery-image",".kg-gallery-image",!1,!0),pswp(".kg-image-card",".kg-image",".kg-image",!1,!1)}function copyright(){"use strict";""!=themeOptions.copyright&&$(".copyright").html(themeOptions.copyright)}function offCanvas(){"use strict";$(".burger:not(.burger.close)").on("click",function(){body.addClass("canvas-visible canvas-opened"),dimmer("open","medium")}),$(".burger-close").on("click",function(){body.hasClass("canvas-opened")&&(body.removeClass("canvas-opened"),dimmer("close","medium"))}),$(".dimmer").on("click",function(){body.hasClass("canvas-opened")&&(body.removeClass("canvas-opened"),dimmer("close","medium"))})}function pswp(n,a,l,c,u){function o(e,t){var n,i,o,r,s=document.querySelectorAll(".pswp")[0];r=[],$(t).find(a).each(function(e,t){i=$(t),i.find(l),o={src:u?i.find("img").attr("src"):i.attr("src"),w:0,h:0},c&&i.find(c).length&&(o.title=i.find(c).html()),r.push(o)}),(n=new PhotoSwipe(s,PhotoSwipeUI_Default,r,{closeOnScroll:!1,history:!1,index:e,shareEl:!1,showAnimationDuration:0,showHideOpacity:!0})).listen("gettingData",function(e,t){var i;(t.w<1||t.h<1)&&((i=new Image).onload=function(){t.w=this.width,t.h=this.height,n.updateSize(!0)},i.src=t.src)}),n.init()}$(n).on("click",l,function(e){!function(e){e.preventDefault();var t=$(e.target).closest(n).find(a).index($(e.target).closest(a)),i=$(e.target).closest(n);o(t,i[0])}(e)})}function dimmer(e,t){"use strict";var i=$(".dimmer");switch(e){case"open":i.fadeIn(t);break;case"close":i.fadeOut(t)}}window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.loadHidden=!1,$(function(){"use strict";social(),author(),stickySidebar(),pagination(),facebook(),loadInstagram(),gallery(),copyright(),offCanvas()});
|
|
//# sourceMappingURL=main.min.js.map
|