/*! PhotoSwipe - v4.1.3 - 2019-01-08 * http://photoswipe.com * Copyright (c) 2019 Dmitry Semenov; * Heavily Modified (c) 2025 Florian Greistorfer */ !function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(m,_,t,n){function e(){return{x:0,y:0}}function N(e,t){g.extend(w,t.publicMethods),Be.push(e)}function U(e){var t=L();return t-1t.min[e]?n[e]=t.min[e]:n[e]=ut&&(x=0w.currItem.fitRatio&&Yt(Ie))}}var K,q,$,p,j,J,Q,ee,o,f,te,ne,oe,ie,ae,r,re,le,se,ce,ue,de,me,i,pe,fe,he,ye,xe,ge,l,we,ve,be,Ie,Ce,De,Se,s,Te,Me,Ae,Ee,Oe,c,u,ke,d,h,y,x,Re,Pe,Ze,Le,Fe,g={features:null,bind:function(e,t,n,o){var i=(o?"remove":"add")+"EventListener";t=t.split(" ");for(var a=0;aw.currItem.fitRatio?Ge||(ln(w.currItem,!1,!0),Ge=!0):Ge&&(ln(w.currItem),Ge=!1)),Ve(h,b.x,b.y,f))},Ke=function(e){e.container&&Ve(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},qe=function(e,t){t[de]=ne+e+"px, 0px"+oe},$e=function(e,t){var n;!v.loop&&t&&(t=p+(C.x*Ue-e)/C.x,n=Math.round(e-Z.x),t<0&&0=L()-1&&n<0)&&(e=Z.x+n*v.mainScrollEndFriction),Z.x=e,qe(e,j)},je=function(e,t){var n=vt[e]-Ye[e];return Ne[e]+_e[e]+n-t/te*n},E=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Je=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Qe=null,et=function(){Qe&&(g.unbind(document,"mousemove",et),g.addClass(m,"pswp--has_mouse"),v.mouseUsed=!0,S("mouseUsed")),Qe=setTimeout(function(){Qe=null},100)},tt=function(e,t){e=an(w.currItem,I,e);return t&&(d=e),e},nt=function(e){return(e=e||w.currItem).initialZoomLevel},ot=function(e){return 0<(e=e||w.currItem).w?v.maxSpreadZoom:1},O={},it=0,at=function(e){O[e]&&(O[e].raf&&fe(O[e].raf),it--,delete O[e])},rt=function(e){O[e]&&at(e),O[e]||(it++,O[e]={})},lt=function(){for(var e in O)O.hasOwnProperty(e)&&at(e)},st=function(e,t,n,o,i,a,r){function l(){O[e]&&(s=T()-c,o<=s?(at(e),a(n),r&&r()):(a((n-t)*i(s/o)+t),O[e].raf=pe(l)))}var s,c=T();rt(e);l()},n={shout:S,listen:a,viewportSize:I,options:v,isMainScrollAnimating:function(){return y},getZoomLevel:function(){return f},getCurrentIndex:function(){return p},isDragging:function(){return s},isZooming:function(){return u},setScrollOffset:function(e,t){Ye.x=e,ge=Ye.y=t,S("updateScrollOffset",Ye)},applyZoomPan:function(e,t,n,o){b.x=t,b.y=n,f=e,A(o)},init:function(){if(!K&&!q){w.framework=g,w.template=m,w.bg=g.getChildByClass(m,"pswp__bg"),he=m.className,K=!0,l=g.detectFeatures(),pe=l.raf,fe=l.caf,de=l.transform,xe=l.oldIE,w.scrollWrap=g.getChildByClass(m,"pswp__scroll-wrap"),w.container=g.getChildByClass(w.scrollWrap,"pswp__container"),j=w.container.style,w.itemHolders=r=[{el:w.container.children[0],wrap:0,index:-1},{el:w.container.children[1],wrap:0,index:-1},{el:w.container.children[2],wrap:0,index:-1}],r[0].el.style.display=r[2].el.style.display="none",de?(t=l.perspective&&!i,ne="translate"+(t?"3d(":"("),oe=l.perspective?", 0px)":")"):(de="left",g.addClass(m,"pswp--ie"),qe=function(e,t){t.left=e+"px"},Ke=function(e){var t=1=L())&&(p=0),w.currItem=Jt(p),(l.isOldIOSPhone||l.isOldAndroid)&&(We=!1),m.setAttribute("aria-hidden","false"),v.modal&&(We?m.style.position="fixed":(m.style.position="absolute",m.style.top=g.getScrollY()+"px")),void 0===ge&&(S("initialLayout"),ge=ye=g.getScrollY());var n="pswp--open ";for(v.mainClass&&(n+=v.mainClass+" "),v.showHideOpacity&&(n+="pswp--animate_opacity "),n=(n=(n+=i?"pswp--touch":"pswp--notouch")+(l.animationName?" pswp--css_animation":""))+(l.svg?" pswp--svg":""),g.addClass(m,n),w.updateSize(),J=-1,D=null,e=0;e<3;e++)qe((e+J)*C.x,r[e].el.style);xe||g.bind(w.scrollWrap,ee,w),a("initialZoomInEnd",function(){w.setContent(r[0],p-1),w.setContent(r[2],p+1),r[0].el.style.display=r[2].el.style.display="block",v.focus&&m.focus(),g.bind(document,"keydown",w),l.transform&&g.bind(w.scrollWrap,"click",w),v.mouseUsed||g.bind(document,"mousemove",et),g.bind(window,"resize scroll orientationchange",w),S("bindEvents")}),w.setContent(r[1],p),w.updateCurrItem(),S("afterInit"),We||(ie=setInterval(function(){it||s||u||f!==w.currItem.initialZoomLevel||w.updateSize()},1e3)),g.addClass(m,"pswp--visible")}},close:function(){K&&(q=!(K=!1),S("close"),g.unbind(window,"resize scroll orientationchange",w),g.unbind(window,"scroll",o.scroll),g.unbind(document,"keydown",w),g.unbind(document,"mousemove",et),l.transform&&g.unbind(w.scrollWrap,"click",w),s&&g.unbind(window,Q,w),clearTimeout(we),S("unbindEvents"),Qt(w.currItem,null,!0,w.destroy))},destroy:function(){S("destroy"),Kt&&clearTimeout(Kt),m.setAttribute("aria-hidden","true"),m.className=he,ie&&clearInterval(ie),g.unbind(w.scrollWrap,ee,w),g.unbind(window,"scroll",w),Dt(),lt(),Xe=null},panTo:function(e,t,n){n||(e>d.min.x?e=d.min.x:ed.min.y?t=d.min.y:td.min[e]||ad.min[e]&&(c=v.panEndFriction,d.min[e],n=d.min[e]-Ne[e]),(n<=0||s<0)&&1ft.x&&(i=ft.x)):d.min.x!==d.max.x&&(o=a)):(aw.currItem.fitRatio&&(b[e]+=t[e]*c)},Nt=function(){if(c){var e,t,n,o,i,a=c.length;if(0!==a)if(E(k,c[0]),R.x=k.x-P.x,R.y=k.y-P.y,u&&1w.currItem.initialZoomLevel+w.currItem.initialZoomLevel/15&&(Le=!0),t=1,n=nt(),o=ot(),e=ut&&(R.x-=c[0].x-mt.x),Math.abs(R.y)>=ut)&&(R.y-=c[0].y-mt.y),P.x=k.x,P.y=k.y,0!==R.x||0!==R.y)){if("v"===x&&v.closeOnVerticalDrag)if(!Tt())return _e.y+=R.y,b.y+=R.y,i=Pt(),De=!0,S("onVerticalDrag",i),M(i),void A();Rt(T(),k.x,k.y),Ae=!0,d=w.currItem.bounds,_t("x",R)||(_t("y",R),Je(b),A())}}},Ut=function(){var t,n,o={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=(1d.min[t]?o.backAnimDestination[t]=d.min[t]:b[t]=L()&&(p=v.loop?0:L()-1,i=!0),i&&!v.loop||(D+=o,Ue-=o,n=!0));var n,o,i,e=C.x*Ue,a=Math.abs(e-Z.x),r=n||e>Z.x==0The image could not be loaded.',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return qt.length}},nn=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},on=function(e,t,n){var o=e.bounds;o.center.x=Math.round((F.x-t)/2),o.center.y=Math.round((F.y-n)/2)+e.vGap.top,o.max.x=t>F.x?Math.round(F.x-t):o.center.x,o.max.y=n>F.y?Math.round(F.y-n)+e.vGap.top:o.center.y,o.min.x=t>F.x?0:o.center.x,o.min.y=n>F.y?e.vGap.top:o.center.y},an=function(e,t,n){var o,i;return!e.src||e.loadError?(e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=nn(),e.initialPosition=e.bounds.center,e.bounds):((o=!n)&&(e.vGap||(e.vGap={top:0,bottom:0}),S("parseVerticalMargin",e)),F.x=t.x,F.y=t.y-e.vGap.top-e.vGap.bottom,o&&(t=F.x/e.w,i=F.y/e.h,e.fitRatio=t=d.max.x&&n<=d.min.y&&n>=d.max.y)&&e.preventDefault(),w.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:I.x/2+Ye.x,y:I.y/2+Ye.y};var t=v.getDoubleTapZoom(!0,w.currItem),n=f===t;w.mouseZoomedIn=!n,w.zoomTo(n?w.currItem.initialZoomLevel:t,e,333),g[(n?"remove":"add")+"Class"](m,"pswp--zoomed-in")}}}),{history:!0,galleryUID:1}),Sn=function(){return new URLSearchParams(window.location.search)},Tn=function(){var e,t;fn&&clearTimeout(fn),it||s?fn=setTimeout(Tn,500):(hn?clearTimeout(pn):hn=!0,e=p+1,(t=Jt(p)).hasOwnProperty("pid")&&(e=t.pid),(t=new URL(window.location.href)).searchParams.delete("pid"),t.searchParams.delete("gid"),t.searchParams.append("gid",v.galleryUID),t.searchParams.append("pid",e),In?history[gn?"replaceState":"pushState"]("",document.title,t):gn?window.location.replace(t.href):window.location=t.href,gn=!0,pn=setTimeout(function(){hn=!1},60))};N("History",{publicMethods:{initHistory:function(){var e;g.extend(v,Dn,!0),v.history&&(gn=wn=vn=!1,In="pushState"in history,bn=new URL(window.location.href),a("afterChange",w.updateURL),a("unbindEvents",function(){g.unbind(window,"searchchange",w.onSearchChange)}),e=function(){xn=!0,wn||(vn?history.back():(bn.searchParams.delete("gid"),bn.searchParams.delete("pid"),In?history.pushState("",document.title,bn):window.location=bn.href)),cn()},a("unbindEvents",function(){$&&e()}),a("destroy",function(){xn||e()}),a("firstUpdate",function(){p=un().pid}),setTimeout(function(){K&&g.bind(window,"searchchange",w.onSearchChange)},40))},onSearchChange:function(){hn||(yn=!0,w.goTo(un().pid),yn=!1)},updateURL:function(){cn(),yn||(gn?mn=setTimeout(Tn,800):Tn())}}}),g.extend(w,n)}});