Files
everything/EveryThing/wwwroot/vendor/libs/photoswipe/photoswipe.js
David Štaleker db0cc8d3de prvi
2025-07-18 05:33:16 +02:00

7 lines
44 KiB
JavaScript

!function(e,t){var n=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=526)}({526:function(e,t,n){"use strict";n.r(t),n.d(t,"initPhotoSwipeFromDOM",function(){return l});var o=n(66),i=n.n(o);n.d(t,"PhotoSwipe",function(){return i.a});var a=n(67),r=n.n(a);n.d(t,"PhotoSwipeUI_Default",function(){return r.a});var l=function(e,t,n,o){$(".pswp").length||$("body").append('\x3c!-- PhotoSwipe Template --\x3e\n<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">\n <div class="pswp__bg"></div>\n <div class="pswp__scroll-wrap">\n <div class="pswp__container">\n <div class="pswp__item"></div>\n <div class="pswp__item"></div>\n <div class="pswp__item"></div>\n </div>\n <div class="pswp__ui pswp__ui--hidden">\n <div class="pswp__top-bar">\n <div class="pswp__counter"></div>\n <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>\n <button class="pswp__button pswp__button--share" title="Share"></button>\n <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>\n <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>\n\n <div class="pswp__preloader">\n <div class="pswp__preloader__icn">\n <div class="pswp__preloader__cut">\n <div class="pswp__preloader__donut"></div>\n </div>\n </div>\n </div>\n </div>\n\n <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">\n <div class="pswp__share-tooltip"></div>\n </div>\n\n <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>\n <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>\n\n <div class="pswp__caption">\n <div class="pswp__caption__center"></div>\n </div>\n </div>\n </div>\n</div>\n\x3c!-- / PhotoSwipe Template --\x3e'),$(e).on("click","figure a",function(a){a.preventDefault(),a.stopPropagation();var l,s="FIGURE"===(l=a.target).tagName.toUpperCase()?l:$(l).parents("figure")[0],u=function(t){if(!t)return null;var n=$(e).find("figure"),o=0,i=null;return n.each(function(){this===t&&(i=o),o++}),i}(s);if(null!==u){var c=function(){var t=[];return $(e).find("figure a").each(function(){var e=$(this).find("img"),n=this.getAttribute("data-size").split("x"),o=this.getAttribute("data-title"),i={src:this.getAttribute("href"),w:parseInt(n[0],10),h:parseInt(n[1],10)};e.length>0&&(i.msrc=e[0].getAttribute("src")),o&&(i.title=o),i.el=$(this).parents("figure")[0],t.push(i)}),t}(),d=$.extend({},t,{index:u,getThumbBoundsFn:function(e){var t=$(c[e].el).find("img")[0],n=window.pageYOffset||document.documentElement.scrollTop,o=t.getBoundingClientRect();return{x:o.left,y:o.top+n,w:o.width}}}),p=new i.a($(".pswp")[0],r.a,c,d);return p.init(),n&&Object.keys(n).forEach(function(e){p.listen(e,n[e].bind(p))}),o&&o.call(p),!1}})}},66:function(e,t,n){var o,i;
/*! PhotoSwipe - v4.1.3 - 2019-01-08
* http://photoswipe.com
* Copyright (c) 2019 Dmitry Semenov; */void 0===(i="function"==typeof(o=function(){"use strict";return function(e,t,n,o){var i={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){var n=document.createElement(t||"div");return e&&(n.className=e),n},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,n){i.bind(e,t,n,!0)},removeClass:function(e,t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){i.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(i.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(i.features)return i.features;var e=i.createEl(),t=e.style,n="",o={};if(o.oldIE=document.all&&!document.addEventListener,o.touch="ontouchstart"in window,window.requestAnimationFrame&&(o.raf=window.requestAnimationFrame,o.caf=window.cancelAnimationFrame),o.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,!o.pointerEvent){var a=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var r=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);r&&r.length>0&&(r=parseInt(r[1],10))>=1&&r<8&&(o.isOldIOSPhone=!0)}var l=a.match(/Android\s([0-9\.]*)/),s=l?l[1]:0;(s=parseFloat(s))>=1&&(s<4.4&&(o.isOldAndroid=!0),o.androidVersion=s),o.isMobileOpera=/opera mini|opera mobi/i.test(a)}for(var u,c,d=["transform","perspective","animationName"],p=["","webkit","Moz","ms","O"],m=0;m<4;m++){n=p[m];for(var f=0;f<3;f++)u=d[f],c=n+(n?u.charAt(0).toUpperCase()+u.slice(1):u),!o[u]&&c in t&&(o[u]=c);n&&!o.raf&&(n=n.toLowerCase(),o.raf=window[n+"RequestAnimationFrame"],o.raf&&(o.caf=window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"]))}if(!o.raf){var h=0;o.raf=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-h)),o=window.setTimeout(function(){e(t+n)},n);return h=t+n,o},o.caf=function(e){clearTimeout(e)}}return o.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,i.features=o,o}};i.detectFeatures(),i.features.oldIE&&(i.bind=function(e,t,n,o){t=t.split(" ");for(var i,a=(o?"detach":"attach")+"Event",r=function(){n.handleEvent.call(n)},l=0;l<t.length;l++)if(i=t[l])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)});var a=this,r={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?1:t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};i.extend(r,o);var l,s,u,c,d,p,m,f,h,v,w,g,x,y,b,_,C,I,T,E,S,D,M,O,F,k,A,R,P,L,Z,z,N,U,K,B,H,W,Y,G,q,$,j,V,X,J,Q,ee,te,ne,oe,ie,ae,re,le,se,ue={x:0,y:0},ce={x:0,y:0},de={x:0,y:0},pe={},me=0,fe={},he={x:0,y:0},ve=0,we=!0,ge=[],xe={},ye=!1,be=function(e,t){i.extend(a,t.publicMethods),ge.push(e)},_e=function(e){var t=Kt();return e>t-1?e-t:e<0?t+e:e},Ce={},Ie=function(e,t){return Ce[e]||(Ce[e]=[]),Ce[e].push(t)},Te=function(e){var t=Ce[e];if(t){var n=Array.prototype.slice.call(arguments);n.shift();for(var o=0;o<t.length;o++)t[o].apply(a,n)}},Ee=function(){return(new Date).getTime()},Se=function(e){re=e,a.bg.style.opacity=e*r.bgOpacity},De=function(e,t,n,o,i){(!ye||i&&i!==a.currItem)&&(o/=i?i.fitRatio:a.currItem.fitRatio),e[D]=g+t+"px, "+n+"px"+x+" scale("+o+")"},Me=function(e){te&&(e&&(v>a.currItem.fitRatio?ye||(Vt(a.currItem,!1,!0),ye=!0):ye&&(Vt(a.currItem),ye=!1)),De(te,de.x,de.y,v))},Oe=function(e){e.container&&De(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},Fe=function(e,t){t[D]=g+e+"px, 0px"+x},ke=function(e,t){if(!r.loop&&t){var n=c+(he.x*me-e)/he.x,o=Math.round(e-ct.x);(n<0&&o>0||n>=Kt()-1&&o<0)&&(e=ct.x+o*r.mainScrollEndFriction)}ct.x=e,Fe(e,d)},Ae=function(e,t){var n=dt[e]-fe[e];return ce[e]+ue[e]+n-n*(t/w)},Re=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Pe=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Le=null,Ze=function(){Le&&(i.unbind(document,"mousemove",Ze),i.addClass(e,"pswp--has_mouse"),r.mouseUsed=!0,Te("mouseUsed")),Le=setTimeout(function(){Le=null},100)},ze=function(e,t){var n=Gt(a.currItem,pe,e);return t&&(ee=n),n},Ne=function(e){return e||(e=a.currItem),e.initialZoomLevel},Ue=function(e){return e||(e=a.currItem),e.w>0?r.maxSpreadZoom:1},Ke=function(e,t,n,o){return o===a.currItem.initialZoomLevel?(n[e]=a.currItem.initialPosition[e],!0):(n[e]=Ae(e,o),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]<t.max[e]&&(n[e]=t.max[e],!0))},Be=function(e){var t="";r.escKey&&27===e.keyCode?t="close":r.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,a[t]()))},He=function(e){e&&($||q||ne||H)&&(e.preventDefault(),e.stopPropagation())},We=function(){a.setScrollOffset(0,i.getScrollY())},Ye={},Ge=0,qe=function(e){Ye[e]&&(Ye[e].raf&&k(Ye[e].raf),Ge--,delete Ye[e])},$e=function(e){Ye[e]&&qe(e),Ye[e]||(Ge++,Ye[e]={})},je=function(){for(var e in Ye)Ye.hasOwnProperty(e)&&qe(e)},Ve=function(e,t,n,o,i,a,r){var l,s=Ee();$e(e);var u=function(){if(Ye[e]){if((l=Ee()-s)>=o)return qe(e),a(n),void(r&&r());a((n-t)*i(l/o)+t),Ye[e].raf=F(u)}};u()},Xe={shout:Te,listen:Ie,viewportSize:pe,options:r,isMainScrollAnimating:function(){return ne},getZoomLevel:function(){return v},getCurrentIndex:function(){return c},isDragging:function(){return Y},isZooming:function(){return J},setScrollOffset:function(e,t){fe.x=e,L=fe.y=t,Te("updateScrollOffset",fe)},applyZoomPan:function(e,t,n,o){de.x=t,de.y=n,v=e,Me(o)},init:function(){if(!l&&!s){var n;a.framework=i,a.template=e,a.bg=i.getChildByClass(e,"pswp__bg"),A=e.className,l=!0,Z=i.detectFeatures(),F=Z.raf,k=Z.caf,D=Z.transform,P=Z.oldIE,a.scrollWrap=i.getChildByClass(e,"pswp__scroll-wrap"),a.container=i.getChildByClass(a.scrollWrap,"pswp__container"),d=a.container.style,a.itemHolders=_=[{el:a.container.children[0],wrap:0,index:-1},{el:a.container.children[1],wrap:0,index:-1},{el:a.container.children[2],wrap:0,index:-1}],_[0].el.style.display=_[2].el.style.display="none",function(){if(D){var t=Z.perspective&&!O;return g="translate"+(t?"3d(":"("),void(x=Z.perspective?", 0px)":")")}D="left",i.addClass(e,"pswp--ie"),Fe=function(e,t){t.left=e+"px"},Oe=function(e){var t=e.fitRatio>1?1:e.fitRatio,n=e.container.style,o=t*e.w,i=t*e.h;n.width=o+"px",n.height=i+"px",n.left=e.initialPosition.x+"px",n.top=e.initialPosition.y+"px"},Me=function(){if(te){var e=te,t=a.currItem,n=t.fitRatio>1?1:t.fitRatio,o=n*t.w,i=n*t.h;e.width=o+"px",e.height=i+"px",e.left=de.x+"px",e.top=de.y+"px"}}}(),h={resize:a.updateSize,orientationchange:function(){clearTimeout(z),z=setTimeout(function(){pe.x!==a.scrollWrap.clientWidth&&a.updateSize()},500)},scroll:We,keydown:Be,click:He};var o=Z.isOldIOSPhone||Z.isOldAndroid||Z.isMobileOpera;for(Z.animationName&&Z.transform&&!o||(r.showAnimationDuration=r.hideAnimationDuration=0),n=0;n<ge.length;n++)a["init"+ge[n]]();if(t){var u=a.ui=new t(a,i);u.init()}Te("firstUpdate"),c=c||r.index||0,(isNaN(c)||c<0||c>=Kt())&&(c=0),a.currItem=Ut(c),(Z.isOldIOSPhone||Z.isOldAndroid)&&(we=!1),e.setAttribute("aria-hidden","false"),r.modal&&(we?e.style.position="fixed":(e.style.position="absolute",e.style.top=i.getScrollY()+"px")),void 0===L&&(Te("initialLayout"),L=R=i.getScrollY());var m="pswp--open ";for(r.mainClass&&(m+=r.mainClass+" "),r.showHideOpacity&&(m+="pswp--animate_opacity "),m+=O?"pswp--touch":"pswp--notouch",m+=Z.animationName?" pswp--css_animation":"",m+=Z.svg?" pswp--svg":"",i.addClass(e,m),a.updateSize(),p=-1,ve=null,n=0;n<3;n++)Fe((n+p)*he.x,_[n].el.style);P||i.bind(a.scrollWrap,f,a),Ie("initialZoomInEnd",function(){a.setContent(_[0],c-1),a.setContent(_[2],c+1),_[0].el.style.display=_[2].el.style.display="block",r.focus&&e.focus(),i.bind(document,"keydown",a),Z.transform&&i.bind(a.scrollWrap,"click",a),r.mouseUsed||i.bind(document,"mousemove",Ze),i.bind(window,"resize scroll orientationchange",a),Te("bindEvents")}),a.setContent(_[1],c),a.updateCurrItem(),Te("afterInit"),we||(y=setInterval(function(){Ge||Y||J||v!==a.currItem.initialZoomLevel||a.updateSize()},1e3)),i.addClass(e,"pswp--visible")}},close:function(){l&&(l=!1,s=!0,Te("close"),i.unbind(window,"resize scroll orientationchange",a),i.unbind(window,"scroll",h.scroll),i.unbind(document,"keydown",a),i.unbind(document,"mousemove",Ze),Z.transform&&i.unbind(a.scrollWrap,"click",a),Y&&i.unbind(window,m,a),clearTimeout(z),Te("unbindEvents"),Bt(a.currItem,null,!0,a.destroy))},destroy:function(){Te("destroy"),Lt&&clearTimeout(Lt),e.setAttribute("aria-hidden","true"),e.className=A,y&&clearInterval(y),i.unbind(a.scrollWrap,f,a),i.unbind(window,"scroll",a),ft(),je(),Ce=null},panTo:function(e,t,n){n||(e>ee.min.x?e=ee.min.x:e<ee.max.x&&(e=ee.max.x),t>ee.min.y?t=ee.min.y:t<ee.max.y&&(t=ee.max.y)),de.x=e,de.y=t,Me()},handleEvent:function(e){e=e||window.event,h[e.type]&&h[e.type](e)},goTo:function(e){var t=(e=_e(e))-c;ve=t,c=e,a.currItem=Ut(c),me-=t,ke(he.x*me),je(),ne=!1,a.updateCurrItem()},next:function(){a.goTo(c+1)},prev:function(){a.goTo(c-1)},updateCurrZoomItem:function(e){if(e&&Te("beforeChange",0),_[1].el.children.length){var t=_[1].el.children[0];te=i.hasClass(t,"pswp__zoom-wrap")?t.style:null}else te=null;ee=a.currItem.bounds,w=v=a.currItem.initialZoomLevel,de.x=ee.center.x,de.y=ee.center.y,e&&Te("afterChange")},invalidateCurrItems:function(){b=!0;for(var e=0;e<3;e++)_[e].item&&(_[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==ve){var t,n=Math.abs(ve);if(!(e&&n<2)){a.currItem=Ut(c),ye=!1,Te("beforeChange",ve),n>=3&&(p+=ve+(ve>0?-3:3),n=3);for(var o=0;o<n;o++)ve>0?(t=_.shift(),_[2]=t,Fe((++p+2)*he.x,t.el.style),a.setContent(t,c-n+o+1+1)):(t=_.pop(),_.unshift(t),Fe(--p*he.x,t.el.style),a.setContent(t,c+n-o-1-1));if(te&&1===Math.abs(ve)){var i=Ut(C);i.initialZoomLevel!==v&&(Gt(i,pe),Vt(i),Oe(i))}ve=0,a.updateCurrZoomItem(),C=c,Te("afterChange")}}},updateSize:function(t){if(!we&&r.modal){var n=i.getScrollY();if(L!==n&&(e.style.top=n+"px",L=n),!t&&xe.x===window.innerWidth&&xe.y===window.innerHeight)return;xe.x=window.innerWidth,xe.y=window.innerHeight,e.style.height=xe.y+"px"}if(pe.x=a.scrollWrap.clientWidth,pe.y=a.scrollWrap.clientHeight,We(),he.x=pe.x+Math.round(pe.x*r.spacing),he.y=pe.y,ke(he.x*me),Te("beforeResize"),void 0!==p){for(var o,l,s,u=0;u<3;u++)o=_[u],Fe((u+p)*he.x,o.el.style),s=c+u-1,r.loop&&Kt()>2&&(s=_e(s)),(l=Ut(s))&&(b||l.needsUpdate||!l.bounds)?(a.cleanSlide(l),a.setContent(o,s),1===u&&(a.currItem=l,a.updateCurrZoomItem(!0)),l.needsUpdate=!1):-1===o.index&&s>=0&&a.setContent(o,s),l&&l.container&&(Gt(l,pe),Vt(l),Oe(l));b=!1}w=v=a.currItem.initialZoomLevel,(ee=a.currItem.bounds)&&(de.x=ee.center.x,de.y=ee.center.y,Me(!0)),Te("resize")},zoomTo:function(e,t,n,o,a){t&&(w=v,dt.x=Math.abs(t.x)-de.x,dt.y=Math.abs(t.y)-de.y,Re(ce,de));var r=ze(e,!1),l={};Ke("x",r,l,e),Ke("y",r,l,e);var s=v,u={x:de.x,y:de.y};Pe(l);var c=function(t){1===t?(v=e,de.x=l.x,de.y=l.y):(v=(e-s)*t+s,de.x=(l.x-u.x)*t+u.x,de.y=(l.y-u.y)*t+u.y),a&&a(t),Me(1===t)};n?Ve("customZoomTo",0,1,n,o||i.easing.sine.inOut,c):c(1)}},Je={},Qe={},et={},tt={},nt={},ot=[],it={},at=[],rt={},lt=0,st={x:0,y:0},ut=0,ct={x:0,y:0},dt={x:0,y:0},pt={x:0,y:0},mt=function(e,t){return rt.x=Math.abs(e.x-t.x),rt.y=Math.abs(e.y-t.y),Math.sqrt(rt.x*rt.x+rt.y*rt.y)},ft=function(){j&&(k(j),j=null)},ht=function(){Y&&(j=F(ht),Mt())},vt=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&e.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(t(e)?e:vt(e.parentNode,t))},wt={},gt=function(e,t){return wt.prevent=!vt(e.target,r.isClickableElement),Te("preventDragEvent",e,t,wt),wt.prevent},xt=function(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t},yt=function(e,t,n){n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y)},bt=function(){var e=de.y-a.currItem.initialPosition.y;return 1-Math.abs(e/(pe.y/2))},_t={},Ct={},It=[],Tt=function(e){for(;It.length>0;)It.pop();return M?(se=0,ot.forEach(function(e){0===se?It[0]=e:1===se&&(It[1]=e),se++})):e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(It[0]=xt(e.touches[0],_t),e.touches.length>1&&(It[1]=xt(e.touches[1],Ct))):(_t.x=e.pageX,_t.y=e.pageY,_t.id="",It[0]=_t),It},Et=function(e,t){var n,o,i,l,s=de[e]+t[e],u=t[e]>0,c=ct.x+t.x,d=ct.x-it.x;if(n=s>ee.min[e]||s<ee.max[e]?r.panEndFriction:1,s=de[e]+t[e]*n,(r.allowPanToNext||v===a.currItem.initialZoomLevel)&&(te?"h"!==oe||"x"!==e||q||(u?(s>ee.min[e]&&(n=r.panEndFriction,ee.min[e],o=ee.min[e]-ce[e]),(o<=0||d<0)&&Kt()>1?(l=c,d<0&&c>it.x&&(l=it.x)):ee.min.x!==ee.max.x&&(i=s)):(s<ee.max[e]&&(n=r.panEndFriction,ee.max[e],o=ce[e]-ee.max[e]),(o<=0||d>0)&&Kt()>1?(l=c,d>0&&c<it.x&&(l=it.x)):ee.min.x!==ee.max.x&&(i=s))):l=c,"x"===e))return void 0!==l&&(ke(l,!0),V=l!==it.x),ee.min.x!==ee.max.x&&(void 0!==i?de.x=i:V||(de.x+=t.x*n)),void 0!==l;ne||V||v>a.currItem.fitRatio&&(de[e]+=t[e]*n)},St=function(e){if(!("mousedown"===e.type&&e.button>0))if(Nt)e.preventDefault();else if(!W||"mousedown"!==e.type){if(gt(e,!0)&&e.preventDefault(),Te("pointerDown"),M){var t=i.arraySearch(ot,e.pointerId,"id");t<0&&(t=ot.length),ot[t]={x:e.pageX,y:e.pageY,id:e.pointerId}}var n=Tt(e),o=n.length;X=null,je(),Y&&1!==o||(Y=ie=!0,i.bind(window,m,a),B=le=ae=H=V=$=G=q=!1,oe=null,Te("firstTouchStart",n),Re(ce,de),ue.x=ue.y=0,Re(tt,n[0]),Re(nt,tt),it.x=he.x*me,at=[{x:tt.x,y:tt.y}],U=N=Ee(),ze(v,!0),ft(),ht()),!J&&o>1&&!ne&&!V&&(w=v,q=!1,J=G=!0,ue.y=ue.x=0,Re(ce,de),Re(Je,n[0]),Re(Qe,n[1]),yt(Je,Qe,pt),dt.x=Math.abs(pt.x)-de.x,dt.y=Math.abs(pt.y)-de.y,Q=mt(Je,Qe))}},Dt=function(e){if(e.preventDefault(),M){var t=i.arraySearch(ot,e.pointerId,"id");if(t>-1){var n=ot[t];n.x=e.pageX,n.y=e.pageY}}if(Y){var o=Tt(e);if(oe||$||J)X=o;else if(ct.x!==he.x*me)oe="h";else{var a=Math.abs(o[0].x-tt.x)-Math.abs(o[0].y-tt.y);Math.abs(a)>=10&&(oe=a>0?"h":"v",X=o)}}},Mt=function(){if(X){var e=X.length;if(0!==e)if(Re(Je,X[0]),et.x=Je.x-tt.x,et.y=Je.y-tt.y,J&&e>1){if(tt.x=Je.x,tt.y=Je.y,!et.x&&!et.y&&function(e,t){return e.x===t.x&&e.y===t.y}(X[1],Qe))return;Re(Qe,X[1]),q||(q=!0,Te("zoomGestureStarted"));var t=mt(Je,Qe),n=Rt(t);n>a.currItem.initialZoomLevel+a.currItem.initialZoomLevel/15&&(le=!0);var o=1,i=Ne(),l=Ue();if(n<i)if(r.pinchToClose&&!le&&w<=a.currItem.initialZoomLevel){var s=i-n,u=1-s/(i/1.2);Se(u),Te("onPinchClose",u),ae=!0}else(o=(i-n)/i)>1&&(o=1),n=i-o*(i/3);else n>l&&((o=(n-l)/(6*i))>1&&(o=1),n=l+o*i);o<0&&(o=0),yt(Je,Qe,st),ue.x+=st.x-pt.x,ue.y+=st.y-pt.y,Re(pt,st),de.x=Ae("x",n),de.y=Ae("y",n),B=n>v,v=n,Me()}else{if(!oe)return;if(ie&&(ie=!1,Math.abs(et.x)>=10&&(et.x-=X[0].x-nt.x),Math.abs(et.y)>=10&&(et.y-=X[0].y-nt.y)),tt.x=Je.x,tt.y=Je.y,0===et.x&&0===et.y)return;if("v"===oe&&r.closeOnVerticalDrag&&"fit"===r.scaleMode&&v===a.currItem.initialZoomLevel){ue.y+=et.y,de.y+=et.y;var c=bt();return H=!0,Te("onVerticalDrag",c),Se(c),void Me()}!function(e,t,n){if(e-U>50){var o=at.length>2?at.shift():{};o.x=t,o.y=n,at.push(o),U=e}}(Ee(),Je.x,Je.y),$=!0,ee=a.currItem.bounds;var d=Et("x",et);d||(Et("y",et),Pe(de),Me())}}},Ot=function(e){if(Z.isOldAndroid){if(W&&"mouseup"===e.type)return;e.type.indexOf("touch")>-1&&(clearTimeout(W),W=setTimeout(function(){W=0},600))}var t;if(Te("pointerUp"),gt(e,!1)&&e.preventDefault(),M){var n=i.arraySearch(ot,e.pointerId,"id");n>-1&&(t=ot.splice(n,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 o,l=Tt(e),s=l.length;if("mouseup"===e.type&&(s=0),2===s)return X=null,!0;1===s&&Re(nt,l[0]),0!==s||oe||ne||(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"})),Te("touchRelease",e,t));var u=-1;if(0===s&&(Y=!1,i.unbind(window,m,a),ft(),J?u=0:-1!==ut&&(u=Ee()-ut)),ut=1===s?Ee():-1,o=-1!==u&&u<150?"zoom":"swipe",J&&s<2&&(J=!1,1===s&&(o="zoomPointerUp"),Te("zoomGestureEnded")),X=null,$||q||ne||H)if(je(),K||(K=Ft()),K.calculateSwipeSpeed("x"),H){var c=bt();if(c<r.verticalDragRange)a.close();else{var d=de.y,p=re;Ve("verticalDrag",0,1,300,i.easing.cubic.out,function(e){de.y=(a.currItem.initialPosition.y-d)*e+d,Se((1-p)*e+p),Me()}),Te("onVerticalDrag",1)}}else{if((V||ne)&&0===s){var f=At(o,K);if(f)return;o="zoomPointerUp"}ne||("swipe"===o?!V&&v>a.currItem.fitRatio&&kt(K):Pt())}},Ft=function(){var e,t,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(o){at.length>1?(e=Ee()-U+50,t=at[at.length-2][o]):(e=Ee()-N,t=nt[o]),n.lastFlickOffset[o]=tt[o]-t,n.lastFlickDist[o]=Math.abs(n.lastFlickOffset[o]),n.lastFlickDist[o]>20?n.lastFlickSpeed[o]=n.lastFlickOffset[o]/e:n.lastFlickSpeed[o]=0,Math.abs(n.lastFlickSpeed[o])<.1&&(n.lastFlickSpeed[o]=0),n.slowDownRatio[o]=.95,n.slowDownRatioReverse[o]=1-n.slowDownRatio[o],n.speedDecelerationRatio[o]=1},calculateOverBoundsAnimOffset:function(e,t){n.backAnimStarted[e]||(de[e]>ee.min[e]?n.backAnimDestination[e]=ee.min[e]:de[e]<ee.max[e]&&(n.backAnimDestination[e]=ee.max[e]),void 0!==n.backAnimDestination[e]&&(n.slowDownRatio[e]=.7,n.slowDownRatioReverse[e]=1-n.slowDownRatio[e],n.speedDecelerationRatioAbs[e]<.05&&(n.lastFlickSpeed[e]=0,n.backAnimStarted[e]=!0,Ve("bounceZoomPan"+e,de[e],n.backAnimDestination[e],t||300,i.easing.sine.out,function(t){de[e]=t,Me()}))))},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,de[e]+=n.distanceOffset[e])},panAnimLoop:function(){if(Ye.zoomPan&&(Ye.zoomPan.raf=F(n.panAnimLoop),n.now=Ee(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),Me(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05))return de.x=Math.round(de.x),de.y=Math.round(de.y),Me(),void qe("zoomPan")}};return n},kt=function(e){if(e.calculateSwipeSpeed("y"),ee=a.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},Math.abs(e.lastFlickSpeed.x)<=.05&&Math.abs(e.lastFlickSpeed.y)<=.05)return e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0;$e("zoomPan"),e.lastNow=Ee(),e.panAnimLoop()},At=function(e,t){var n,o,l;if(ne||(lt=c),"swipe"===e){var s=tt.x-nt.x,u=t.lastFlickDist.x<10;s>30&&(u||t.lastFlickOffset.x>20)?o=-1:s<-30&&(u||t.lastFlickOffset.x<-20)&&(o=1)}o&&((c+=o)<0?(c=r.loop?Kt()-1:0,l=!0):c>=Kt()&&(c=r.loop?0:Kt()-1,l=!0),l&&!r.loop||(ve+=o,me-=o,n=!0));var d,p=he.x*me,m=Math.abs(p-ct.x);return n||p>ct.x==t.lastFlickSpeed.x>0?(d=Math.abs(t.lastFlickSpeed.x)>0?m/Math.abs(t.lastFlickSpeed.x):333,d=Math.min(d,400),d=Math.max(d,250)):d=333,lt===c&&(n=!1),ne=!0,Te("mainScrollAnimStart"),Ve("mainScroll",ct.x,p,d,i.easing.cubic.out,ke,function(){je(),ne=!1,lt=-1,(n||lt!==c)&&a.updateCurrItem(),Te("mainScrollAnimComplete")}),n&&a.updateCurrItem(!0),n},Rt=function(e){return 1/Q*e*w},Pt=function(){var e=v,t=Ne(),n=Ue();v<t?e=t:v>n&&(e=n);var o,r=re;return ae&&!B&&!le&&v<t?(a.close(),!0):(ae&&(o=function(e){Se((1-r)*e+r)}),a.zoomTo(e,0,200,i.easing.cubic.out,o),!0)};be("Gestures",{publicMethods:{initGestures:function(){var e=function(e,t,n,o,i){I=e+t,T=e+n,E=e+o,S=i?e+i:""};(M=Z.pointerEvent)&&Z.touch&&(Z.touch=!1),M?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):Z.touch?(e("touch","start","move","end","cancel"),O=!0):e("mouse","down","move","up"),m=T+" "+E+" "+S,f=I,M&&!O&&(O=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),a.likelyTouchDevice=O,h[I]=St,h[T]=Dt,h[E]=Ot,S&&(h[S]=h[E]),Z.touch&&(f+=" mousedown",m+=" mousemove mouseup",h.mousedown=h[I],h.mousemove=h[T],h.mouseup=h[E]),O||(r.allowPanToNext=!1)}}});var Lt,Zt,zt,Nt,Ut,Kt,Bt=function(t,n,o,l){var s;Lt&&clearTimeout(Lt),Nt=!0,zt=!0,t.initialLayout?(s=t.initialLayout,t.initialLayout=null):s=r.getThumbBoundsFn&&r.getThumbBoundsFn(c);var d,p,m=o?r.hideAnimationDuration:r.showAnimationDuration,f=function(){qe("initialZoom"),o?(a.template.removeAttribute("style"),a.bg.removeAttribute("style")):(Se(1),n&&(n.style.display="block"),i.addClass(e,"pswp--animated-in"),Te("initialZoom"+(o?"OutEnd":"InEnd"))),l&&l(),Nt=!1};if(!m||!s||void 0===s.x)return Te("initialZoom"+(o?"Out":"In")),v=t.initialZoomLevel,Re(de,t.initialPosition),Me(),e.style.opacity=o?0:1,Se(1),void(m?setTimeout(function(){f()},m):f());d=u,p=!a.currItem.src||a.currItem.loadError||r.showHideOpacity,t.miniImg&&(t.miniImg.style.webkitBackfaceVisibility="hidden"),o||(v=s.w/t.w,de.x=s.x,de.y=s.y-R,a[p?"template":"bg"].style.opacity=.001,Me()),$e("initialZoom"),o&&!d&&i.removeClass(e,"pswp--animated-in"),p&&(o?i[(d?"remove":"add")+"Class"](e,"pswp--animate_opacity"):setTimeout(function(){i.addClass(e,"pswp--animate_opacity")},30)),Lt=setTimeout(function(){if(Te("initialZoom"+(o?"Out":"In")),o){var n=s.w/t.w,a={x:de.x,y:de.y},r=v,l=re,u=function(t){1===t?(v=n,de.x=s.x,de.y=s.y-L):(v=(n-r)*t+r,de.x=(s.x-a.x)*t+a.x,de.y=(s.y-L-a.y)*t+a.y),Me(),p?e.style.opacity=1-t:Se(l-t*l)};d?Ve("initialZoom",0,1,m,i.easing.cubic.out,u,f):(u(1),Lt=setTimeout(f,m+20))}else v=t.initialZoomLevel,Re(de,t.initialPosition),Me(),Se(1),p?e.style.opacity=1:Se(1),Lt=setTimeout(f,m+20)},o?25:90)},Ht={},Wt=[],Yt={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 Zt.length}},Gt=function(e,t,n){if(e.src&&!e.loadError){var o=!n;if(o&&(e.vGap||(e.vGap={top:0,bottom:0}),Te("parseVerticalMargin",e)),Ht.x=t.x,Ht.y=t.y-e.vGap.top-e.vGap.bottom,o){var i=Ht.x/e.w,a=Ht.y/e.h;e.fitRatio=i<a?i:a;var l=r.scaleMode;"orig"===l?n=1:"fit"===l&&(n=e.fitRatio),n>1&&(n=1),e.initialZoomLevel=n,e.bounds||(e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}})}if(!n)return;return function(e,t,n){var o=e.bounds;o.center.x=Math.round((Ht.x-t)/2),o.center.y=Math.round((Ht.y-n)/2)+e.vGap.top,o.max.x=t>Ht.x?Math.round(Ht.x-t):o.center.x,o.max.y=n>Ht.y?Math.round(Ht.y-n)+e.vGap.top:o.center.y,o.min.x=t>Ht.x?0:o.center.x,o.min.y=n>Ht.y?e.vGap.top:o.center.y}(e,e.w*n,e.h*n),o&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds}return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}},e.initialPosition=e.bounds.center,e.bounds},qt=function(e,t,n,o,i,r){t.loadError||o&&(t.imageAppended=!0,Vt(t,o,t===a.currItem&&ye),n.appendChild(o),r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))},$t=function(e){e.loading=!0,e.loaded=!1;var t=e.img=i.createEl("pswp__img","img"),n=function(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,t.onload=t.onerror=null,t=null};return t.onload=n,t.onerror=function(){e.loadError=!0,n()},t.src=e.src,t},jt=function(e,t){if(e.src&&e.loadError&&e.container)return t&&(e.container.innerHTML=""),e.container.innerHTML=r.errorMsg.replace("%url%",e.src),!0},Vt=function(e,t,n){if(e.src){t||(t=e.container.lastChild);var o=n?e.w:Math.round(e.w*e.fitRatio),i=n?e.h:Math.round(e.h*e.fitRatio);e.placeholder&&!e.loaded&&(e.placeholder.style.width=o+"px",e.placeholder.style.height=i+"px"),t.style.width=o+"px",t.style.height=i+"px"}},Xt=function(){if(Wt.length){for(var e,t=0;t<Wt.length;t++)(e=Wt[t]).holder.index===e.index&&qt(e.index,e.item,e.baseDiv,e.img,!1,e.clearPlaceholder);Wt=[]}};be("Controller",{publicMethods:{lazyLoadItem:function(e){e=_e(e);var t=Ut(e);t&&(!t.loaded&&!t.loading||b)&&(Te("gettingData",e,t),t.src&&$t(t))},initController:function(){i.extend(r,Yt,!0),a.items=Zt=n,Ut=a.getItemAt,Kt=r.getNumItemsFn,r.loop,Kt()<3&&(r.loop=!1),Ie("beforeChange",function(e){var t,n=r.preload,o=null===e||e>=0,i=Math.min(n[0],Kt()),l=Math.min(n[1],Kt());for(t=1;t<=(o?l:i);t++)a.lazyLoadItem(c+t);for(t=1;t<=(o?i:l);t++)a.lazyLoadItem(c-t)}),Ie("initialLayout",function(){a.currItem.initialLayout=r.getThumbBoundsFn&&r.getThumbBoundsFn(c)}),Ie("mainScrollAnimComplete",Xt),Ie("initialZoomInEnd",Xt),Ie("destroy",function(){for(var e,t=0;t<Zt.length;t++)(e=Zt[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);Wt=null})},getItemAt:function(e){return e>=0&&void 0!==Zt[e]&&Zt[e]},allowProgressiveImg:function(){return r.forceProgressiveLoading||!O||r.mouseUsed||screen.width>1200},setContent:function(e,t){r.loop&&(t=_e(t));var n=a.getItemAt(e.index);n&&(n.container=null);var o,s=a.getItemAt(t);if(s){Te("gettingData",t,s),e.index=t,e.item=s;var u=s.container=i.createEl("pswp__zoom-wrap");if(!s.src&&s.html&&(s.html.tagName?u.appendChild(s.html):u.innerHTML=s.html),jt(s),Gt(s,pe),!s.src||s.loadError||s.loaded)s.src&&!s.loadError&&((o=i.createEl("pswp__img","img")).style.opacity=1,o.src=s.src,Vt(s,o),qt(t,s,u,o,!0));else{if(s.loadComplete=function(n){if(l){if(e&&e.index===t){if(jt(n,!0))return n.loadComplete=n.img=null,Gt(n,pe),Oe(n),void(e.index===c&&a.updateCurrZoomItem());n.imageAppended?!Nt&&n.placeholder&&(n.placeholder.style.display="none",n.placeholder=null):Z.transform&&(ne||Nt)?Wt.push({item:n,baseDiv:u,img:n.img,index:t,holder:e,clearPlaceholder:!0}):qt(t,n,u,n.img,ne||Nt,!0)}n.loadComplete=null,n.img=null,Te("imageLoadComplete",t,n)}},i.features.transform){var d="pswp__img pswp__img--placeholder";d+=s.msrc?"":" pswp__img--placeholder--blank";var p=i.createEl(d,s.msrc?"img":"");s.msrc&&(p.src=s.msrc),Vt(s,p),u.appendChild(p),s.placeholder=p}s.loading||$t(s),a.allowProgressiveImg()&&(!zt&&Z.transform?Wt.push({item:s,baseDiv:u,img:s.img,index:t,holder:e}):qt(t,s,u,s.img,!0,!0))}zt||t!==c?Oe(s):(te=u.style,Bt(s,o||s.img)),e.el.innerHTML="",e.el.appendChild(u)}else e.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}});var Jt,Qt,en={},tn=function(e,t,n){var o=document.createEvent("CustomEvent"),i={origEvent:e,target:e.target,releasePoint:t,pointerType:n||"touch"};o.initCustomEvent("pswpTap",!0,!0,i),e.target.dispatchEvent(o)};be("Tap",{publicMethods:{initTap:function(){Ie("firstTouchStart",a.onTapStart),Ie("touchRelease",a.onTapRelease),Ie("destroy",function(){en={},Jt=null})},onTapStart:function(e){e.length>1&&(clearTimeout(Jt),Jt=null)},onTapRelease:function(e,t){var n,o;if(t&&!$&&!G&&!Ge){var a=t;if(Jt&&(clearTimeout(Jt),Jt=null,n=a,o=en,Math.abs(n.x-o.x)<25&&Math.abs(n.y-o.y)<25))return void Te("doubleTap",a);if("mouse"===t.type)return void tn(e,t,"mouse");var r=e.target.tagName.toUpperCase();if("BUTTON"===r||i.hasClass(e.target,"pswp__single-tap"))return void tn(e,t);Re(en,a),Jt=setTimeout(function(){tn(e,t),Jt=null},300)}}}}),be("DesktopZoom",{publicMethods:{initDesktopZoom:function(){P||(O?Ie("mouseUsed",function(){a.setupDesktopZoom()}):a.setupDesktopZoom(!0))},setupDesktopZoom:function(t){Qt={};var n="wheel mousewheel DOMMouseScroll";Ie("bindEvents",function(){i.bind(e,n,a.handleMouseWheel)}),Ie("unbindEvents",function(){Qt&&i.unbind(e,n,a.handleMouseWheel)}),a.mouseZoomedIn=!1;var o,r=function(){a.mouseZoomedIn&&(i.removeClass(e,"pswp--zoomed-in"),a.mouseZoomedIn=!1),v<1?i.addClass(e,"pswp--zoom-allowed"):i.removeClass(e,"pswp--zoom-allowed"),l()},l=function(){o&&(i.removeClass(e,"pswp--dragging"),o=!1)};Ie("resize",r),Ie("afterChange",r),Ie("pointerDown",function(){a.mouseZoomedIn&&(o=!0,i.addClass(e,"pswp--dragging"))}),Ie("pointerUp",l),t||r()},handleMouseWheel:function(e){if(v<=a.currItem.fitRatio)return r.modal&&(!r.closeOnScroll||Ge||Y?e.preventDefault():D&&Math.abs(e.deltaY)>2&&(u=!0,a.close())),!0;if(e.stopPropagation(),Qt.x=0,"deltaX"in e)1===e.deltaMode?(Qt.x=18*e.deltaX,Qt.y=18*e.deltaY):(Qt.x=e.deltaX,Qt.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(Qt.x=-.16*e.wheelDeltaX),e.wheelDeltaY?Qt.y=-.16*e.wheelDeltaY:Qt.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;Qt.y=e.detail}ze(v,!0);var t=de.x-Qt.x,n=de.y-Qt.y;(r.modal||t<=ee.min.x&&t>=ee.max.x&&n<=ee.min.y&&n>=ee.max.y)&&e.preventDefault(),a.panTo(t,n)},toggleDesktopZoom:function(t){t=t||{x:pe.x/2+fe.x,y:pe.y/2+fe.y};var n=r.getDoubleTapZoom(!0,a.currItem),o=v===n;a.mouseZoomedIn=!o,a.zoomTo(o?a.currItem.initialZoomLevel:n,t,333),i[(o?"remove":"add")+"Class"](e,"pswp--zoomed-in")}}});var nn,on,an,rn,ln,sn,un,cn,dn,pn,mn,fn,hn={history:!0,galleryUID:1},vn=function(){return mn.hash.substring(1)},wn=function(){nn&&clearTimeout(nn),an&&clearTimeout(an)},gn=function(){var e=vn(),t={};if(e.length<5)return t;var n,o=e.split("&");for(n=0;n<o.length;n++)if(o[n]){var i=o[n].split("=");i.length<2||(t[i[0]]=i[1])}if(r.galleryPIDs){var a=t.pid;for(t.pid=0,n=0;n<Zt.length;n++)if(Zt[n].pid===a){t.pid=n;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t},xn=function(){if(an&&clearTimeout(an),Ge||Y)an=setTimeout(xn,500);else{rn?clearTimeout(on):rn=!0;var e=c+1,t=Ut(c);t.hasOwnProperty("pid")&&(e=t.pid);var n=un+"&gid="+r.galleryUID+"&pid="+e;cn||-1===mn.hash.indexOf(n)&&(pn=!0);var o=mn.href.split("#")[0]+"#"+n;fn?"#"+n!==window.location.hash&&history[cn?"replaceState":"pushState"]("",document.title,o):cn?mn.replace(o):mn.hash=n,cn=!0,on=setTimeout(function(){rn=!1},60)}};be("History",{publicMethods:{initHistory:function(){if(i.extend(r,hn,!0),r.history){mn=window.location,pn=!1,dn=!1,cn=!1,un=vn(),fn="pushState"in history,un.indexOf("gid=")>-1&&(un=(un=un.split("&gid=")[0]).split("?gid=")[0]),Ie("afterChange",a.updateURL),Ie("unbindEvents",function(){i.unbind(window,"hashchange",a.onHashChange)});var e=function(){sn=!0,dn||(pn?history.back():un?mn.hash=un:fn?history.pushState("",document.title,mn.pathname+mn.search):mn.hash=""),wn()};Ie("unbindEvents",function(){u&&e()}),Ie("destroy",function(){sn||e()}),Ie("firstUpdate",function(){c=gn().pid});var t=un.indexOf("pid=");t>-1&&"&"===(un=un.substring(0,t)).slice(-1)&&(un=un.slice(0,-1)),setTimeout(function(){l&&i.bind(window,"hashchange",a.onHashChange)},40)}},onHashChange:function(){if(vn()===un)return dn=!0,void a.close();rn||(ln=!0,a.goTo(gn().pid),ln=!1)},updateURL:function(){wn(),ln||(cn?nn=setTimeout(xn,800):xn())}}}),i.extend(a,Xe)}})?o.call(t,n,t,e):o)||(e.exports=i)},67:function(e,t,n){var o,i;
/*! PhotoSwipe Default UI - 4.1.3 - 2019-01-08
* http://photoswipe.com
* Copyright (c) 2019 Dmitry Semenov; */void 0===(i="function"==typeof(o=function(){"use strict";return function(e,t){var n,o,i,a,r,l,s,u,c,d,p,m,f,h,v,w,g,x,y=this,b=!1,_=!0,C=!0,I={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 e.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return e.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},T=function(e){if(w)return!0;e=e||window.event,v.timeToIdle&&v.mouseUsed&&!c&&R();for(var n,o,i=e.target||e.srcElement,a=i.getAttribute("class")||"",r=0;r<z.length;r++)(n=z[r]).onTap&&a.indexOf("pswp__"+n.name)>-1&&(n.onTap(),o=!0);if(o){e.stopPropagation&&e.stopPropagation(),w=!0;var l=t.features.isOldAndroid?600:30;setTimeout(function(){w=!1},l)}},E=function(e,n,o){t[(o?"add":"remove")+"Class"](e,"pswp__"+n)},S=function(){var e=1===v.getNumItemsFn();e!==h&&(E(o,"ui--one-slide",e),h=e)},D=function(){E(s,"share-modal--hidden",C)},M=function(){return(C=!C)?(t.removeClass(s,"pswp__share-modal--fade-in"),setTimeout(function(){C&&D()},300)):(D(),setTimeout(function(){C||t.addClass(s,"pswp__share-modal--fade-in")},30)),C||F(),!1},O=function(t){var n=(t=t||window.event).target||t.srcElement;return e.shout("shareLinkClick",t,n),!(!n.href||!n.hasAttribute("download")&&(window.open(n.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)),C||M(),1))},F=function(){for(var e,t,n,o,i,a="",r=0;r<v.shareButtons.length;r++)e=v.shareButtons[r],n=v.getImageURLForShare(e),o=v.getPageURLForShare(e),i=v.getTextForShare(e),t=e.url.replace("{{url}}",encodeURIComponent(o)).replace("{{image_url}}",encodeURIComponent(n)).replace("{{raw_image_url}}",n).replace("{{text}}",encodeURIComponent(i)),a+='<a href="'+t+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",v.parseShareButtonOut&&(a=v.parseShareButtonOut(e,a));s.children[0].innerHTML=a,s.children[0].onclick=O},k=function(e){for(var n=0;n<v.closeElClasses.length;n++)if(t.hasClass(e,"pswp__"+v.closeElClasses[n]))return!0},A=0,R=function(){clearTimeout(x),A=0,c&&y.setIdle(!1)},P=function(e){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!==t.nodeName||(clearTimeout(x),x=setTimeout(function(){y.setIdle(!0)},v.timeToIdleOutside))},L=function(e){m!==e&&(E(p,"preloader--active",!e),m=e)},Z=function(n){var r=n.vGap;if(!e.likelyTouchDevice||v.mouseUsed||screen.width>v.fitControlsWidth){var l=v.barsSize;if(v.captionEl&&"auto"===l.bottom)if(a||((a=t.createEl("pswp__caption pswp__caption--fake")).appendChild(t.createEl("pswp__caption__center")),o.insertBefore(a,i),t.addClass(o,"pswp__ui--fit")),v.addCaptionHTMLFn(n,a,!0)){var s=a.clientHeight;r.bottom=parseInt(s,10)||44}else r.bottom=l.top;else r.bottom="auto"===l.bottom?0:l.bottom;r.top=l.top}else r.top=r.bottom=0},z=[{name:"caption",option:"captionEl",onInit:function(e){i=e}},{name:"share-modal",option:"shareEl",onInit:function(e){s=e},onTap:function(){M()}},{name:"button--share",option:"shareEl",onInit:function(e){l=e},onTap:function(){M()}},{name:"button--zoom",option:"zoomEl",onTap:e.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){r=e}},{name:"button--close",option:"closeEl",onTap:e.close},{name:"button--arrow--left",option:"arrowEl",onTap:e.prev},{name:"button--arrow--right",option:"arrowEl",onTap:e.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){n.isFullscreen()?n.exit():n.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){p=e}}];y.init=function(){var r;t.extend(e.options,I,!0),v=e.options,o=t.getChildByClass(e.scrollWrap,"pswp__ui"),(d=e.listen)("onVerticalDrag",function(e){_&&e<.95?y.hideControls():!_&&e>=.95&&y.showControls()}),d("onPinchClose",function(e){_&&e<.9?(y.hideControls(),r=!0):r&&!_&&e>.9&&y.showControls()}),d("zoomGestureEnded",function(){(r=!1)&&!_&&y.showControls()}),d("beforeChange",y.update),d("doubleTap",function(t){var n=e.currItem.initialZoomLevel;e.getZoomLevel()!==n?e.zoomTo(n,t,333):e.zoomTo(v.getDoubleTapZoom(!1,e.currItem),t,333)}),d("preventDragEvent",function(e,t,n){var o=e.target||e.srcElement;o&&o.getAttribute("class")&&e.type.indexOf("mouse")>-1&&(o.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(o.tagName))&&(n.prevent=!1)}),d("bindEvents",function(){t.bind(o,"pswpTap click",T),t.bind(e.scrollWrap,"pswpTap",y.onGlobalTap),e.likelyTouchDevice||t.bind(e.scrollWrap,"mouseover",y.onMouseOver)}),d("unbindEvents",function(){C||M(),g&&clearInterval(g),t.unbind(document,"mouseout",P),t.unbind(document,"mousemove",R),t.unbind(o,"pswpTap click",T),t.unbind(e.scrollWrap,"pswpTap",y.onGlobalTap),t.unbind(e.scrollWrap,"mouseover",y.onMouseOver),n&&(t.unbind(document,n.eventK,y.updateFullscreen),n.isFullscreen()&&(v.hideAnimationDuration=0,n.exit()),n=null)}),d("destroy",function(){v.captionEl&&(a&&o.removeChild(a),t.removeClass(i,"pswp__caption--empty")),s&&(s.children[0].onclick=null),t.removeClass(o,"pswp__ui--over-close"),t.addClass(o,"pswp__ui--hidden"),y.setIdle(!1)}),v.showAnimationDuration||t.removeClass(o,"pswp__ui--hidden"),d("initialZoomIn",function(){v.showAnimationDuration&&t.removeClass(o,"pswp__ui--hidden")}),d("initialZoomOut",function(){t.addClass(o,"pswp__ui--hidden")}),d("parseVerticalMargin",Z),function(){var e,n,i,a=function(o){if(o)for(var a=o.length,r=0;r<a;r++){e=o[r],n=e.className;for(var l=0;l<z.length;l++)i=z[l],n.indexOf("pswp__"+i.name)>-1&&(v[i.option]?(t.removeClass(e,"pswp__element--disabled"),i.onInit&&i.onInit(e)):t.addClass(e,"pswp__element--disabled"))}};a(o.children);var r=t.getChildByClass(o,"pswp__top-bar");r&&a(r.children)}(),v.shareEl&&l&&s&&(C=!0),S(),v.timeToIdle&&d("mouseUsed",function(){t.bind(document,"mousemove",R),t.bind(document,"mouseout",P),g=setInterval(function(){2==++A&&y.setIdle(!0)},v.timeToIdle/2)}),v.fullscreenEl&&!t.features.isOldAndroid&&(n||(n=y.getFullscreenAPI()),n?(t.bind(document,n.eventK,y.updateFullscreen),y.updateFullscreen(),t.addClass(e.template,"pswp--supports-fs")):t.removeClass(e.template,"pswp--supports-fs")),v.preloaderEl&&(L(!0),d("beforeChange",function(){clearTimeout(f),f=setTimeout(function(){e.currItem&&e.currItem.loading?(!e.allowProgressiveImg()||e.currItem.img&&!e.currItem.img.naturalWidth)&&L(!1):L(!0)},v.loadingIndicatorDelay)}),d("imageLoadComplete",function(t,n){e.currItem===n&&L(!0)}))},y.setIdle=function(e){c=e,E(o,"ui--idle",e)},y.update=function(){_&&e.currItem?(y.updateIndexIndicator(),v.captionEl&&(v.addCaptionHTMLFn(e.currItem,i),E(i,"caption--empty",!e.currItem.title)),b=!0):b=!1,C||M(),S()},y.updateFullscreen=function(o){o&&setTimeout(function(){e.setScrollOffset(0,t.getScrollY())},50),t[(n.isFullscreen()?"add":"remove")+"Class"](e.template,"pswp--fs")},y.updateIndexIndicator=function(){v.counterEl&&(r.innerHTML=e.getCurrentIndex()+1+v.indexIndicatorSep+v.getNumItemsFn())},y.onGlobalTap=function(n){var o=(n=n||window.event).target||n.srcElement;if(!w)if(n.detail&&"mouse"===n.detail.pointerType){if(k(o))return void e.close();t.hasClass(o,"pswp__img")&&(1===e.getZoomLevel()&&e.getZoomLevel()<=e.currItem.fitRatio?v.clickToCloseNonZoomable&&e.close():e.toggleDesktopZoom(n.detail.releasePoint))}else if(v.tapToToggleControls&&(_?y.hideControls():y.showControls()),v.tapToClose&&(t.hasClass(o,"pswp__img")||k(o)))return void e.close()},y.onMouseOver=function(e){var t=(e=e||window.event).target||e.srcElement;E(o,"ui--over-close",k(t))},y.hideControls=function(){t.addClass(o,"pswp__ui--hidden"),_=!1},y.showControls=function(){_=!0,b||y.update(),t.removeClass(o,"pswp__ui--hidden")},y.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},y.getFullscreenAPI=function(){var t,n=document.documentElement,o="fullscreenchange";return n.requestFullscreen?t={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:o}:n.mozRequestFullScreen?t={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+o}:n.webkitRequestFullscreen?t={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+o}:n.msRequestFullscreen&&(t={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),t&&(t.enter=function(){if(u=v.closeOnScroll,v.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK)return e.template[this.enterK]();e.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},t.exit=function(){return v.closeOnScroll=u,document[this.exitK]()},t.isFullscreen=function(){return document[this.elementK]}),t}}})?o.call(t,n,t,e):o)||(e.exports=i)}});if("object"==typeof n){var o=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,e&&e!==window?e:null];for(var i in n)o[0]&&(o[0][i]=n[i]),o[1]&&"__esModule"!==i&&(o[1][i]=n[i]),o[2]&&(o[2][i]=n[i])}}(this);